diff --git a/assets/fabric.http.js b/assets/fabric.http.js index b0182bcf..c9a3eaca 100644 --- a/assets/fabric.http.js +++ b/assets/fabric.http.js @@ -1,254311 +1,129 @@ -var FabricHTTP = (function (require$$0$4, require$$0$5, require$$1$3, require$$2$2, require$$1$4, require$$0$7, require$$0$6, require$$10$1, require$$1$5, require$$4$1, require$$6, require$$0$8, require$$7$1, require$$4$2, require$$5$2, require$$6$1, require$$7$2, require$$3$1, require$$1$6, require$$1$7, require$$2$3) { - 'use strict'; - - function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - - var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$4); - var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5); - var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$3); - var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2$2); - var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$4); - var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$7); - var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$6); - var require$$10__default = /*#__PURE__*/_interopDefaultLegacy(require$$10$1); - var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$5); - var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4$1); - var require$$6__default = /*#__PURE__*/_interopDefaultLegacy(require$$6); - var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$8); - var require$$7__default = /*#__PURE__*/_interopDefaultLegacy(require$$7$1); - var require$$4__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$4$2); - var require$$5__default = /*#__PURE__*/_interopDefaultLegacy(require$$5$2); - var require$$6__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$6$1); - var require$$7__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$7$2); - var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3$1); - var require$$1__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$1$6); - var require$$1__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$1$7); - var require$$2__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$2$3); - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function getAugmentedNamespace(n) { - if (n.__esModule) return n; - var a = Object.defineProperty({}, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; - } - - function commonjsRequire (path) { - throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); - } - - var scripts$2 = {}; - - /* - Fabric Core Constants. - --- - Author: Fabric Labs - Copyright: All Rights Reserved. - */ - - // Dependencies - const crypto$p = require$$0__default["default"]; - - // Networking and Environment - const PEER_PORT = 9999; - const MAX_PEERS = 32; - const PRECISION = 100; - - // Fabric Core - const BITCOIN_GENESIS = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'; - const BITCOIN_GENESIS_ROOT = '4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b'; - const FABRIC_KEY_DERIVATION_PATH$1 = "m/44'/0'/0'/0/0"; - - // Message Constants - const MAGIC_BYTES$2 = 0xC0D3F33D; - const VERSION_NUMBER$1 = 0x01; // 0 for development, pre-alpha, 1 for production - const HEADER_SIZE$2 = 144; // [4], [4], [32], [4], [4], [32], [64] bytes - const LARGE_COLLECTION_SIZE = 10; // TODO: test with 1,000,000 - const MAX_MESSAGE_SIZE$3 = 4096 - HEADER_SIZE$2; - - // Stacks and Frames - const MAX_STACK_HEIGHT = 32; // max height of stack (number of elements) - const MAX_FRAME_SIZE$1 = 32; // max size of a stack frame in bytes - const MAX_MEMORY_ALLOC$1 = MAX_STACK_HEIGHT * MAX_FRAME_SIZE$1; - const MAX_TX_PER_BLOCK$1 = 100; - const MAX_CHANNEL_VALUE$1 = 100000000; - - // Machine Constraints - const MACHINE_MAX_MEMORY = MAX_MEMORY_ALLOC$1 * MAX_MESSAGE_SIZE$3; - const MAX_CHAT_MESSAGE_LENGTH = 2048; - - // FABRIC ONLY - const GENERIC_MESSAGE_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericMessage').digest('hex').slice(0, 4), 16); - const LOG_MESSAGE_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericLogMessage').digest('hex').slice(0, 4), 16); - const GENERIC_LIST_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericList').digest('hex').slice(0, 4), 16); - const DOCUMENT_PUBLISH_TYPE$1 = 998; - const DOCUMENT_REQUEST_TYPE$1 = 999; - - // Opcodes - const OP_CYCLE$1 = '00'; - const OP_DONE = 'ff'; - - // Bitcoin - const OP_0 = '00'; - const OP_36 = '24'; - const OP_CHECKSIG = 'ac'; - const OP_DUP = '76'; - const OP_EQUAL = '87'; - const OP_SHA256 = 'a8'; - const OP_HASH160 = 'a9'; - const OP_PUSHDATA1 = '4c'; - const OP_RETURN = '6a'; - const OP_EQUALVERIFY = '88'; - const OP_SEPARATOR = 'ab'; - - const P2P_GENERIC$1 = 0x80; // 128 in decimal - const P2P_IDENT_REQUEST$2 = 0x01; // 1, or the identity - const P2P_IDENT_RESPONSE$2 = 0x11; - const P2P_ROOT$2 = 0x00000000; - const P2P_PING$2 = 0x00000012; // same ID as Lightning (18) - const P2P_PONG$2 = 0x00000013; // same ID as Lightning (19) - const P2P_INSTRUCTION$2 = 0x00000020; // TODO: select w/ no overlap - const P2P_START_CHAIN$2 = 0x00000021; - const P2P_STATE_REQUEST$1 = 0x00000029; // TODO: select w/ no overlap - const P2P_STATE_ROOT$2 = 0x00000030; // TODO: select w/ no overlap - const P2P_BASE_MESSAGE$2 = 0x00000031; // TODO: select w/ no overlap - const P2P_STATE_COMMITTMENT$2 = 0x00000032; // TODO: select w/ no overlap - const P2P_STATE_CHANGE$2 = 0x00000033; // TODO: select w/ no overlap - const P2P_TRANSACTION$1 = 0x00000039; // TODO: select w/ no overlap - const P2P_CALL$1 = 0x00000042; - const P2P_CHAIN_SYNC_REQUEST$1 = 0x55; - const P2P_SESSION_ACK$1 = 0x4200; - const P2P_MUSIG_START = 0x4220; - const P2P_MUSIG_ACCEPT = 0x4221; - const P2P_MUSIG_RECEIVE_COUNTER = 0x4222; - const P2P_MUSIG_SEND_PROPOSAL = 0x4223; - const P2P_MUSIG_REPLY_TO_PROPOSAL = 0x4224; - const P2P_MUSIG_ACCEPT_PROPOSAL = 0x4225; - - const PEER_CANDIDATE$1 = 0x09; - // TODO: should be 0x02 for Bitcoin P2P - const BLOCK_CANDIDATE$1 = 0x03; - - const SESSION_START$1 = 0x02; - const CHAT_MESSAGE$1 = 0x67; - - // Lightning - const LIGHTNING_TEST_HEADER = 'D0520C6E'; - const LIGHTNING_PROTOCOL_H_INIT$1 = 'Noise_XK_secp256k1_ChaChaPoly_SHA256'; - const LIGHTNING_PROTOCOL_PROLOGUE$1 = 'lightning'; - - // Lightning BMM - const LIGHTNING_BMM_HEADER = 'D0520C6E'; - const LIGHTNING_SIDECHAIN_NUM = 0xFF; // 1-byte - sidechain number - - const LIGHTNING_SIDEBLOCK_HASH = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000; // 32-bytes - const LIGHTNING_PARENT_SIDEBLOCK_HASH = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // 32-bytes - - const ZERO_LENGTH_PLAINTEXT$1 = ''; - - var constants$1 = { - PEER_PORT, - MAX_PEERS, - PRECISION, - BITCOIN_GENESIS, - BITCOIN_GENESIS_ROOT, - FABRIC_KEY_DERIVATION_PATH: FABRIC_KEY_DERIVATION_PATH$1, - HEADER_SIZE: HEADER_SIZE$2, - GENERIC_MESSAGE_TYPE: GENERIC_MESSAGE_TYPE$1, - LOG_MESSAGE_TYPE: LOG_MESSAGE_TYPE$1, - GENERIC_LIST_TYPE: GENERIC_LIST_TYPE$1, - LARGE_COLLECTION_SIZE, - BLOCK_CANDIDATE: BLOCK_CANDIDATE$1, - CHAT_MESSAGE: CHAT_MESSAGE$1, - ZERO_LENGTH_PLAINTEXT: ZERO_LENGTH_PLAINTEXT$1, - LIGHTNING_TEST_HEADER, - LIGHTNING_PROTOCOL_H_INIT: LIGHTNING_PROTOCOL_H_INIT$1, - LIGHTNING_PROTOCOL_PROLOGUE: LIGHTNING_PROTOCOL_PROLOGUE$1, - LIGHTNING_BMM_HEADER, - LIGHTNING_SIDECHAIN_NUM, - LIGHTNING_SIDEBLOCK_HASH, - LIGHTNING_PARENT_SIDEBLOCK_HASH, - MAGIC_BYTES: MAGIC_BYTES$2, - MAX_FRAME_SIZE: MAX_FRAME_SIZE$1, - MAX_MEMORY_ALLOC: MAX_MEMORY_ALLOC$1, - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$3, - MAX_STACK_HEIGHT, - MAX_CHANNEL_VALUE: MAX_CHANNEL_VALUE$1, - MAX_CHAT_MESSAGE_LENGTH, - MAX_TX_PER_BLOCK: MAX_TX_PER_BLOCK$1, - MACHINE_MAX_MEMORY, - OP_CYCLE: OP_CYCLE$1, - OP_DONE, - OP_0, - OP_36, - OP_CHECKSIG, - OP_DUP, - OP_EQUAL, - OP_SHA256, - OP_HASH160, - OP_PUSHDATA1, - OP_RETURN, - OP_EQUALVERIFY, - OP_SEPARATOR, - P2P_GENERIC: P2P_GENERIC$1, - P2P_IDENT_REQUEST: P2P_IDENT_REQUEST$2, - P2P_IDENT_RESPONSE: P2P_IDENT_RESPONSE$2, - P2P_CHAIN_SYNC_REQUEST: P2P_CHAIN_SYNC_REQUEST$1, - P2P_ROOT: P2P_ROOT$2, - P2P_PING: P2P_PING$2, - P2P_PONG: P2P_PONG$2, - P2P_START_CHAIN: P2P_START_CHAIN$2, - P2P_INSTRUCTION: P2P_INSTRUCTION$2, - P2P_BASE_MESSAGE: P2P_BASE_MESSAGE$2, - P2P_STATE_ROOT: P2P_STATE_ROOT$2, - P2P_STATE_COMMITTMENT: P2P_STATE_COMMITTMENT$2, - P2P_STATE_CHANGE: P2P_STATE_CHANGE$2, - P2P_STATE_REQUEST: P2P_STATE_REQUEST$1, - P2P_TRANSACTION: P2P_TRANSACTION$1, - P2P_CALL: P2P_CALL$1, - P2P_SESSION_ACK: P2P_SESSION_ACK$1, - P2P_MUSIG_START, - P2P_MUSIG_ACCEPT, - P2P_MUSIG_RECEIVE_COUNTER, - P2P_MUSIG_SEND_PROPOSAL, - P2P_MUSIG_REPLY_TO_PROPOSAL, - P2P_MUSIG_ACCEPT_PROPOSAL, - PEER_CANDIDATE: PEER_CANDIDATE$1, - DOCUMENT_PUBLISH_TYPE: DOCUMENT_PUBLISH_TYPE$1, - DOCUMENT_REQUEST_TYPE: DOCUMENT_REQUEST_TYPE$1, - SESSION_START: SESSION_START$1, - VERSION_NUMBER: VERSION_NUMBER$1 - }; - - const { - P2P_SESSION_ACK - } = constants$1; - - // engine - const TICK_INTERVAL = 1000; - const SESSION_SEED = '79084a7963fc1761e8f6871d6aa704c4922316030af4aa5a076dde35fc0b6857'; - - // http - const HTTP_CLIENT_PORT = 80; - const HTTP_SERVER_PORT$1 = 9999; - - // https - const HTTPS_CLIENT_PORT = 443; - const HTTPS_SERVER_PORT = 19999; - - // websockets - const MAXIMUM_PING = 10000; - const WEBSOCKET_KEEPALIVE = 600000; // 10 minutes - - // browser / dom - const BROWSER_TARGET$2 = '#browser-content'; - - // exports - var constants = { - TICK_INTERVAL, - SESSION_SEED, - HTTP_CLIENT_PORT, - HTTP_SERVER_PORT: HTTP_SERVER_PORT$1, - HTTPS_CLIENT_PORT, - HTTPS_SERVER_PORT, - MAXIMUM_PING, - WEBSOCKET_KEEPALIVE, - BROWSER_TARGET: BROWSER_TARGET$2, - P2P_SESSION_ACK - }; - - var d3Graphviz = {exports: {}}; - - var xhtml = "http://www.w3.org/1999/xhtml"; - - var namespaces = { - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" - }; - - function namespace(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; - } - - function creatorInherit(name) { - return function() { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml - ? document.createElement(name) - : document.createElementNS(uri, name); - }; - } - - function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; - } - - function creator(name) { - var fullname = namespace(name); - return (fullname.local - ? creatorFixed - : creatorInherit)(fullname); - } - - function none() {} - - function selector(selector) { - return selector == null ? none : function() { - return this.querySelector(selector); - }; - } - - function selection_select(select) { - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection$1(subgroups, this._parents); - } - - function empty$1() { - return []; - } - - function selectorAll(selector) { - return selector == null ? empty$1 : function() { - return this.querySelectorAll(selector); - }; - } - - function selection_selectAll(select) { - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection$1(subgroups, parents); - } - - function matcher(selector) { - return function() { - return this.matches(selector); - }; - } - - function selection_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection$1(subgroups, this._parents); - } - - function sparse(update) { - return new Array(update.length); - } - - function selection_enter() { - return new Selection$1(this._enter || this._groups.map(sparse), this._parents); - } - - function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; - } - - EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, - insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, - querySelector: function(selector) { return this._parent.querySelector(selector); }, - querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } - }; - - function constant$2(x) { - return function() { - return x; - }; - } - - var keyPrefix = "$"; // Protect against keys like “__proto__”. - - function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } - } - - function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = {}, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); - if (keyValue in nodeByKeyValue) { - exit[i] = node; - } else { - nodeByKeyValue[keyValue] = node; - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = keyPrefix + key.call(parent, data[i], i, data); - if (node = nodeByKeyValue[keyValue]) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue[keyValue] = null; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) { - exit[i] = node; - } - } - } - - function selection_data(value, key) { - if (!value) { - data = new Array(this.size()), j = -1; - this.each(function(d) { data[++j] = d; }); - return data; - } - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - - if (typeof value !== "function") value = constant$2(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = value.call(parent, parent && parent.__data__, j, parents), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection$1(update, parents); - update._enter = enter; - update._exit = exit; - return update; - } - - function selection_exit() { - return new Selection$1(this._exit || this._groups.map(sparse), this._parents); - } - - function selection_join(onenter, onupdate, onexit) { - var enter = this.enter(), update = this, exit = this.exit(); - enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); - if (onupdate != null) update = onupdate(update); - if (onexit == null) exit.remove(); else onexit(exit); - return enter && update ? enter.merge(update).order() : update; - } - - function selection_merge(selection) { - - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection$1(merges, this._parents); - } - - function selection_order() { - - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; - } - - function selection_sort(compare) { - if (!compare) compare = ascending; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection$1(sortgroups, this._parents).order(); - } - - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - - function selection_call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; - } - - function selection_nodes() { - var nodes = new Array(this.size()), i = -1; - this.each(function() { nodes[++i] = this; }); - return nodes; - } - - function selection_node() { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; - } - - function selection_size() { - var size = 0; - this.each(function() { ++size; }); - return size; - } - - function selection_empty() { - return !this.node(); - } - - function selection_each(callback) { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; - } - - function attrRemove$1(name) { - return function() { - this.removeAttribute(name); - }; - } - - function attrRemoveNS$1(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attrConstant$1(name, value) { - return function() { - this.setAttribute(name, value); - }; - } - - function attrConstantNS$1(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; - } - - function attrFunction$1(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; - } - - function attrFunctionNS$1(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; - } - - function selection_attr(name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each((value == null - ? (fullname.local ? attrRemoveNS$1 : attrRemove$1) : (typeof value === "function" - ? (fullname.local ? attrFunctionNS$1 : attrFunction$1) - : (fullname.local ? attrConstantNS$1 : attrConstant$1)))(fullname, value)); - } - - function defaultView(node) { - return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node - || (node.document && node) // node is a Window - || node.defaultView; // node is a Document - } - - function styleRemove$1(name) { - return function() { - this.style.removeProperty(name); - }; - } - - function styleConstant$1(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; - } - - function styleFunction$1(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; - } - - function selection_style(name, value, priority) { - return arguments.length > 1 - ? this.each((value == null - ? styleRemove$1 : typeof value === "function" - ? styleFunction$1 - : styleConstant$1)(name, value, priority == null ? "" : priority)) - : styleValue(this.node(), name); - } - - function styleValue(node, name) { - return node.style.getPropertyValue(name) - || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); - } - - function propertyRemove(name) { - return function() { - delete this[name]; - }; - } - - function propertyConstant(name, value) { - return function() { - this[name] = value; - }; - } - - function propertyFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; - } - - function selection_property(name, value) { - return arguments.length > 1 - ? this.each((value == null - ? propertyRemove : typeof value === "function" - ? propertyFunction - : propertyConstant)(name, value)) - : this.node()[name]; - } - - function classArray(string) { - return string.trim().split(/^|\s+/); - } - - function classList(node) { - return node.classList || new ClassList(node); - } - - function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); - } - - ClassList.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } - }; - - function classedAdd(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); - } - - function classedRemove(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); - } - - function classedTrue(names) { - return function() { - classedAdd(this, names); - }; - } - - function classedFalse(names) { - return function() { - classedRemove(this, names); - }; - } - - function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; - } - - function selection_classed(name, value) { - var names = classArray(name + ""); - - if (arguments.length < 2) { - var list = classList(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each((typeof value === "function" - ? classedFunction : value - ? classedTrue - : classedFalse)(names, value)); - } - - function textRemove() { - this.textContent = ""; - } - - function textConstant$1(value) { - return function() { - this.textContent = value; - }; - } - - function textFunction$1(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; - } - - function selection_text(value) { - return arguments.length - ? this.each(value == null - ? textRemove : (typeof value === "function" - ? textFunction$1 - : textConstant$1)(value)) - : this.node().textContent; - } - - function htmlRemove() { - this.innerHTML = ""; - } - - function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; - } - - function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; - } - - function selection_html(value) { - return arguments.length - ? this.each(value == null - ? htmlRemove : (typeof value === "function" - ? htmlFunction - : htmlConstant)(value)) - : this.node().innerHTML; - } - - function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); - } - - function selection_raise() { - return this.each(raise); - } - - function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); - } - - function selection_lower() { - return this.each(lower); - } - - function selection_append(name) { - var create = typeof name === "function" ? name : creator(name); - return this.select(function() { - return this.appendChild(create.apply(this, arguments)); - }); - } - - function constantNull() { - return null; - } - - function selection_insert(name, before) { - var create = typeof name === "function" ? name : creator(name), - select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); - } - - function remove$1() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); - } - - function selection_remove() { - return this.each(remove$1); - } - - function selection_cloneShallow() { - var clone = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - function selection_cloneDeep() { - var clone = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - function selection_clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); - } - - function selection_datum(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; - } - - var filterEvents = {}; - - var event = null; - - if (typeof document !== "undefined") { - var element = document.documentElement; - if (!("onmouseenter" in element)) { - filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"}; - } - } - - function filterContextListener(listener, index, group) { - listener = contextListener(listener, index, group); - return function(event) { - var related = event.relatedTarget; - if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) { - listener.call(this, event); - } - }; - } - - function contextListener(listener, index, group) { - return function(event1) { - var event0 = event; // Events can be reentrant (e.g., focus). - event = event1; - try { - listener.call(this, this.__data__, index, group); - } finally { - event = event0; - } - }; - } - - function parseTypenames$1(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return {type: t, name: name}; - }); - } - - function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; - } - - function onAdd(typename, value, capture) { - var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; - return function(d, i, group) { - var on = this.__on, o, listener = wrap(value, i, group); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - this.addEventListener(o.type, o.listener = listener, o.capture = capture); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, capture); - o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture}; - if (!on) this.__on = [o]; - else on.push(o); - }; - } - - function selection_on(typename, value, capture) { - var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - if (capture == null) capture = false; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture)); - return this; - } - - function customEvent(event1, listener, that, args) { - var event0 = event; - event1.sourceEvent = event; - event = event1; - try { - return listener.apply(that, args); - } finally { - event = event0; - } - } - - function dispatchEvent(node, type, params) { - var window = defaultView(node), - event = window.CustomEvent; - - if (typeof event === "function") { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); - } - - function dispatchConstant(type, params) { - return function() { - return dispatchEvent(this, type, params); - }; - } - - function dispatchFunction(type, params) { - return function() { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; - } - - function selection_dispatch(type, params) { - return this.each((typeof params === "function" - ? dispatchFunction - : dispatchConstant)(type, params)); - } - - var root$1 = [null]; - - function Selection$1(groups, parents) { - this._groups = groups; - this._parents = parents; - } - - function selection() { - return new Selection$1([[document.documentElement]], root$1); - } - - Selection$1.prototype = selection.prototype = { - constructor: Selection$1, - select: selection_select, - selectAll: selection_selectAll, - filter: selection_filter, - data: selection_data, - enter: selection_enter, - exit: selection_exit, - join: selection_join, - merge: selection_merge, - order: selection_order, - sort: selection_sort, - call: selection_call, - nodes: selection_nodes, - node: selection_node, - size: selection_size, - empty: selection_empty, - each: selection_each, - attr: selection_attr, - style: selection_style, - property: selection_property, - classed: selection_classed, - text: selection_text, - html: selection_html, - raise: selection_raise, - lower: selection_lower, - append: selection_append, - insert: selection_insert, - remove: selection_remove, - clone: selection_clone, - datum: selection_datum, - on: selection_on, - dispatch: selection_dispatch - }; - - function select(selector) { - return typeof selector === "string" - ? new Selection$1([[document.querySelector(selector)]], [document.documentElement]) - : new Selection$1([[selector]], root$1); - } - - function create$1(name) { - return select(creator(name).call(document.documentElement)); - } - - var nextId = 0; - - function local$1() { - return new Local$1; - } - - function Local$1() { - this._ = "@" + (++nextId).toString(36); - } - - Local$1.prototype = local$1.prototype = { - constructor: Local$1, - get: function(node) { - var id = this._; - while (!(id in node)) if (!(node = node.parentNode)) return; - return node[id]; - }, - set: function(node, value) { - return node[this._] = value; - }, - remove: function(node) { - return this._ in node && delete node[this._]; - }, - toString: function() { - return this._; - } - }; - - function sourceEvent() { - var current = event, source; - while (source = current.sourceEvent) current = source; - return current; - } - - function point(node, event) { - var svg = node.ownerSVGElement || node; - - if (svg.createSVGPoint) { - var point = svg.createSVGPoint(); - point.x = event.clientX, point.y = event.clientY; - point = point.matrixTransform(node.getScreenCTM().inverse()); - return [point.x, point.y]; - } - - var rect = node.getBoundingClientRect(); - return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; - } - - function mouse(node) { - var event = sourceEvent(); - if (event.changedTouches) event = event.changedTouches[0]; - return point(node, event); - } - - function selectAll(selector) { - return typeof selector === "string" - ? new Selection$1([document.querySelectorAll(selector)], [document.documentElement]) - : new Selection$1([selector == null ? [] : selector], root$1); - } - - function touch(node, touches, identifier) { - if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches; - - for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) { - if ((touch = touches[i]).identifier === identifier) { - return point(node, touch); - } - } - - return null; - } - - function touches(node, touches) { - if (touches == null) touches = sourceEvent().touches; - - for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) { - points[i] = point(node, touches[i]); - } - - return points; - } - - var src$b = /*#__PURE__*/Object.freeze({ - __proto__: null, - create: create$1, - creator: creator, - local: local$1, - matcher: matcher, - mouse: mouse, - namespace: namespace, - namespaces: namespaces, - clientPoint: point, - select: select, - selectAll: selectAll, - selection: selection, - selector: selector, - selectorAll: selectorAll, - style: styleValue, - touch: touch, - touches: touches, - window: defaultView, - get event () { return event; }, - customEvent: customEvent - }); - - var require$$0$3 = /*@__PURE__*/getAugmentedNamespace(src$b); - - var noop$2 = {value: function() {}}; - - function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - return new Dispatch(_); - } - - function Dispatch(_) { - this._ = _; - } - - function parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return {type: t, name: name}; - }); - } - - Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, - T = parseTypenames(typename + "", _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get$2(_[t], typename.name))) return t; - return; - } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set$1(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set$1(_[t], typename.name, null); - } - - return this; - }, - copy: function() { - var copy = {}, _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - } - }; - - function get$2(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } - } - - function set$1(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop$2, type = type.slice(0, i).concat(type.slice(i + 1)); - break; - } - } - if (callback != null) type.push({name: name, value: callback}); - return type; - } - - var src$a = /*#__PURE__*/Object.freeze({ - __proto__: null, - dispatch: dispatch - }); - - var require$$1$2 = /*@__PURE__*/getAugmentedNamespace(src$a); - - var frame$2 = 0, // is an animation frame pending? - timeout$1 = 0, // is a timeout pending? - interval$1 = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = typeof performance === "object" && performance.now ? performance : Date, - setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; - - function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); - } - - function clearNow() { - clockNow = 0; - } - - function Timer() { - this._call = - this._time = - this._next = null; - } - - Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } - }; - - function timer(callback, delay, time) { - var t = new Timer; - t.restart(callback, delay, time); - return t; - } - - function timerFlush() { - now(); // Get the current time, if not already set. - ++frame$2; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(null, e); - t = t._next; - } - --frame$2; - } - - function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame$2 = timeout$1 = 0; - try { - timerFlush(); - } finally { - frame$2 = 0; - nap(); - clockNow = 0; - } - } - - function poke() { - var now = clock.now(), delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; - } - - function nap() { - var t0, t1 = taskHead, t2, time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; - } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; - } - } - taskTail = t0; - sleep(time); - } - - function sleep(time) { - if (frame$2) return; // Soonest alarm already set, or will be. - if (timeout$1) timeout$1 = clearTimeout(timeout$1); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) timeout$1 = setTimeout(wake, time - clock.now() - clockSkew); - if (interval$1) interval$1 = clearInterval(interval$1); - } else { - if (!interval$1) clockLast = clock.now(), interval$1 = setInterval(poke, pokeDelay); - frame$2 = 1, setFrame(wake); - } - } - - function timeout(callback, delay, time) { - var t = new Timer; - delay = delay == null ? 0 : +delay; - t.restart(function(elapsed) { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; - } - - function interval(callback, delay, time) { - var t = new Timer, total = delay; - if (delay == null) return t.restart(callback, delay, time), t; - delay = +delay, time = time == null ? now() : +time; - t.restart(function tick(elapsed) { - elapsed += total; - t.restart(tick, total += delay, time); - callback(elapsed); - }, delay, time); - return t; - } - - var src$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - now: now, - timer: timer, - timerFlush: timerFlush, - timeout: timeout, - interval: interval - }); - - var emptyOn = dispatch("start", "end", "cancel", "interrupt"); - var emptyTween = []; - - var CREATED = 0; - var SCHEDULED = 1; - var STARTING = 2; - var STARTED = 3; - var RUNNING = 4; - var ENDING = 5; - var ENDED = 6; - - function schedule(node, name, id, index, group, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id in schedules) return; - create(node, id, { - name: name, - index: index, // For context during callback. - group: group, // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); - } - - function init(node, id) { - var schedule = get$1(node, id); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; - } - - function set(node, id) { - var schedule = get$1(node, id); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; - } - - function get$1(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); - return schedule; - } - - function create(node, id, self) { - var schedules = node.__transition, - tween; - - // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); - - // If the elapsed delay is less than our first sleep, start immediately. - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; - - // If the state is not SCHEDULED, then we previously errored on start. - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - - // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - if (o.state === STARTED) return timeout(start); - - // Interrupt the active transition, if any. - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - - // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - - // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - timeout(function() { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - - // Dispatch the start event. - // Note this must be done before the tween are initialized. - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - self.state = STARTED; - - // Initialize the tween, deleting null tween. - tween = new Array(n = self.tween.length); - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } - - // Dispatch the end event. - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - for (var i in schedules) return; // eslint-disable-line no-unused-vars - delete node.__transition; - } - } - - function interrupt(node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - - if (!schedules) return; - - name = name == null ? null : name + ""; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { empty = false; continue; } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - - if (empty) delete node.__transition; - } - - function selection_interrupt(name) { - return this.each(function() { - interrupt(this, name); - }); - } - - function define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - - function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; - } - - function Color() {} - - var darker = 0.7; - var brighter = 1 / darker; - - var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); - - var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 - }; - - define(Color, color, { - copy: function(channels) { - return Object.assign(new this.constructor, this, channels); - }, - displayable: function() { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb - }); - - function color_formatHex() { - return this.rgb().formatHex(); - } - - function color_formatHsl() { - return hslConvert(this).formatHsl(); - } - - function color_formatRgb() { - return this.rgb().formatRgb(); - } - - function color(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 - : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 - : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) - : null; - } - - function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); - } - - function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); - } - - function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb; - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); - } - - function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); - } - - function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - - define(Rgb, rgb, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function() { - return this; - }, - displayable: function() { - return (-0.5 <= this.r && this.r < 255.5) - && (-0.5 <= this.g && this.g < 255.5) - && (-0.5 <= this.b && this.b < 255.5) - && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb - })); - - function rgb_formatHex() { - return "#" + hex$3(this.r) + hex$3(this.g) + hex$3(this.b); - } - - function rgb_formatRgb() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") - + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.b) || 0)) - + (a === 1 ? ")" : ", " + a + ")"); - } - - function hex$3(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); - } - - function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); - } - - function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl; - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); - } - - function hsl$2(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define(Hsl, hsl$2, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - displayable: function() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) - && (0 <= this.l && this.l <= 1) - && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl: function() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") - + (this.h || 0) + ", " - + (this.s || 0) * 100 + "%, " - + (this.l || 0) * 100 + "%" - + (a === 1 ? ")" : ", " + a + ")"); - } - })); - - /* From FvD 13.37, CSS Color Module Level 3 */ - function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 - : h < 180 ? m2 - : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 - : m1) * 255; - } - - var deg2rad = Math.PI / 180; - var rad2deg = 180 / Math.PI; - - // https://observablehq.com/@mbostock/lab-and-rgb - var K$5 = 18, - Xn = 0.96422, - Yn = 1, - Zn = 0.82521, - t0 = 4 / 29, - t1 = 6 / 29, - t2 = 3 * t1 * t1, - t3 = t1 * t1 * t1; - - function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) return hcl2lab(o); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), - g = rgb2lrgb(o.g), - b = rgb2lrgb(o.b), - y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; - if (r === g && g === b) x = z = y; else { - x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); - } - return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); - } - - function lab$1(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); - } - - function Lab(l, a, b, opacity) { - this.l = +l; - this.a = +a; - this.b = +b; - this.opacity = +opacity; - } - - define(Lab, lab$1, extend(Color, { - brighter: function(k) { - return new Lab(this.l + K$5 * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - darker: function(k) { - return new Lab(this.l - K$5 * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - rgb: function() { - var y = (this.l + 16) / 116, - x = isNaN(this.a) ? y : y + this.a / 500, - z = isNaN(this.b) ? y : y - this.b / 200; - x = Xn * lab2xyz(x); - y = Yn * lab2xyz(y); - z = Zn * lab2xyz(z); - return new Rgb( - lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), - lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), - lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), - this.opacity - ); - } - })); - - function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; - } - - function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); - } - - function lrgb2rgb(x) { - return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); - } - - function rgb2lrgb(x) { - return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); - } - - function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * rad2deg; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); - } - - function hcl$2(h, c, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); - } - - function Hcl(h, c, l, opacity) { - this.h = +h; - this.c = +c; - this.l = +l; - this.opacity = +opacity; - } - - function hcl2lab(o) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * deg2rad; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); - } - - define(Hcl, hcl$2, extend(Color, { - brighter: function(k) { - return new Hcl(this.h, this.c, this.l + K$5 * (k == null ? 1 : k), this.opacity); - }, - darker: function(k) { - return new Hcl(this.h, this.c, this.l - K$5 * (k == null ? 1 : k), this.opacity); - }, - rgb: function() { - return hcl2lab(this).rgb(); - } - })); - - var A = -0.14861, - B = +1.78277, - C = -0.29227, - D = -0.90649, - E = +1.97294, - ED = E * D, - EB = E * B, - BC_DA = B * C - D * A; - - function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), - bl = b - l, - k = (E * (g - l) - C * bl) / D, - s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 - h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); - } - - function cubehelix$2(h, s, l, opacity) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); - } - - function Cubehelix(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define(Cubehelix, cubehelix$2, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, - l = +this.l, - a = isNaN(this.s) ? 0 : this.s * l * (1 - l), - cosh = Math.cos(h), - sinh = Math.sin(h); - return new Rgb( - 255 * (l + a * (A * cosh + B * sinh)), - 255 * (l + a * (C * cosh + D * sinh)), - 255 * (l + a * (E * cosh)), - this.opacity - ); - } - })); - - function basis(t1, v0, v1, v2, v3) { - var t2 = t1 * t1, t3 = t2 * t1; - return ((1 - 3 * t1 + 3 * t2 - t3) * v0 - + (4 - 6 * t2 + 3 * t3) * v1 - + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 - + t3 * v3) / 6; - } - - function basis$1(values) { - var n = values.length - 1; - return function(t) { - var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), - v1 = values[i], - v2 = values[i + 1], - v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, - v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; - } - - function basisClosed(values) { - var n = values.length; - return function(t) { - var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), - v0 = values[(i + n - 1) % n], - v1 = values[i % n], - v2 = values[(i + 1) % n], - v3 = values[(i + 2) % n]; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; - } - - function constant$1(x) { - return function() { - return x; - }; - } - - function linear(a, d) { - return function(t) { - return a + t * d; - }; - } - - function exponential(a, b, y) { - return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { - return Math.pow(a + t * b, y); - }; - } - - function hue$1(a, b) { - var d = b - a; - return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$1(isNaN(a) ? b : a); - } - - function gamma(y) { - return (y = +y) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a); - }; - } - - function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : constant$1(isNaN(a) ? b : a); - } - - var interpolateRgb = (function rgbGamma(y) { - var color = gamma(y); - - function rgb$1(start, end) { - var r = color((start = rgb(start)).r, (end = rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - rgb$1.gamma = rgbGamma; - - return rgb$1; - })(1); - - function rgbSpline(spline) { - return function(colors) { - var n = colors.length, - r = new Array(n), - g = new Array(n), - b = new Array(n), - i, color; - for (i = 0; i < n; ++i) { - color = rgb(colors[i]); - r[i] = color.r || 0; - g[i] = color.g || 0; - b[i] = color.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color.opacity = 1; - return function(t) { - color.r = r(t); - color.g = g(t); - color.b = b(t); - return color + ""; - }; - }; - } - - var rgbBasis = rgbSpline(basis$1); - var rgbBasisClosed = rgbSpline(basisClosed); - - function numberArray(a, b) { - if (!b) b = []; - var n = a ? Math.min(b.length, a.length) : 0, - c = b.slice(), - i; - return function(t) { - for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; - return c; - }; - } - - function isNumberArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); - } - - function array(a, b) { - return (isNumberArray(b) ? numberArray : genericArray)(a, b); - } - - function genericArray(a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; - - for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; - - return function(t) { - for (i = 0; i < na; ++i) c[i] = x[i](t); - return c; - }; - } - - function date(a, b) { - var d = new Date; - return a = +a, b = +b, function(t) { - return d.setTime(a * (1 - t) + b * t), d; - }; - } - - function interpolateNumber(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; - } - - function object(a, b) { - var i = {}, - c = {}, - k; - - if (a === null || typeof a !== "object") a = {}; - if (b === null || typeof b !== "object") b = {}; - - for (k in b) { - if (k in a) { - i[k] = value(a[k], b[k]); - } else { - c[k] = b[k]; - } - } - - return function(t) { - for (k in i) c[k] = i[k](t); - return c; - }; - } - - var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); - - function zero(b) { - return function() { - return b; - }; - } - - function one(b) { - return function(t) { - return b(t) + ""; - }; - } - - function interpolateString(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - a = a + "", b = b + ""; - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) - && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { // interpolate non-matching numbers - s[++i] = null; - q.push({i: i, x: interpolateNumber(am, bm)}); - } - bi = reB.lastIndex; - } - - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 ? (q[0] - ? one(q[0].x) - : zero(b)) - : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); - } - - function value(a, b) { - var t = typeof b, c; - return b == null || t === "boolean" ? constant$1(b) - : (t === "number" ? interpolateNumber - : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString) - : b instanceof color ? interpolateRgb - : b instanceof Date ? date - : isNumberArray(b) ? numberArray - : Array.isArray(b) ? genericArray - : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object - : interpolateNumber)(a, b); - } - - function discrete(range) { - var n = range.length; - return function(t) { - return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; - }; - } - - function hue(a, b) { - var i = hue$1(+a, +b); - return function(t) { - var x = i(t); - return x - 360 * Math.floor(x / 360); - }; - } - - function round(a, b) { - return a = +a, b = +b, function(t) { - return Math.round(a * (1 - t) + b * t); - }; - } - - var degrees = 180 / Math.PI; - - var identity$3 = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 - }; - - function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; - } - - var cssNode, - cssRoot, - cssView, - svgNode; - - function parseCss(value) { - if (value === "none") return identity$3; - if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; - cssNode.style.transform = value; - value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); - cssRoot.removeChild(cssNode); - value = value.slice(7, -1).split(","); - return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); - } - - function parseSvg(value) { - if (value == null) return identity$3; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity$3; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); - } - - function interpolateTransform(parse, pxComma, pxParen, degParen) { - - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path - q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - - return function(a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - }; - } - - var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); - var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - - var rho = Math.SQRT2, - rho2 = 2, - rho4 = 4, - epsilon2 = 1e-12; - - function cosh(x) { - return ((x = Math.exp(x)) + 1 / x) / 2; - } - - function sinh(x) { - return ((x = Math.exp(x)) - 1 / x) / 2; - } - - function tanh(x) { - return ((x = Math.exp(2 * x)) - 1) / (x + 1); - } - - // p0 = [ux0, uy0, w0] - // p1 = [ux1, uy1, w1] - function interpolateZoom(p0, p1) { - var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], - ux1 = p1[0], uy1 = p1[1], w1 = p1[2], - dx = ux1 - ux0, - dy = uy1 - uy0, - d2 = dx * dx + dy * dy, - i, - S; - - // Special case for u0 ≅ u1. - if (d2 < epsilon2) { - S = Math.log(w1 / w0) / rho; - i = function(t) { - return [ - ux0 + t * dx, - uy0 + t * dy, - w0 * Math.exp(rho * t * S) - ]; - }; - } - - // General case. - else { - var d1 = Math.sqrt(d2), - b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), - b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), - r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), - r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); - S = (r1 - r0) / rho; - i = function(t) { - var s = t * S, - coshr0 = cosh(r0), - u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); - return [ - ux0 + u * dx, - uy0 + u * dy, - w0 * coshr0 / cosh(rho * s + r0) - ]; - }; - } - - i.duration = S * 1000; - - return i; - } - - function hsl(hue) { - return function(start, end) { - var h = hue((start = hsl$2(start)).h, (end = hsl$2(end)).h), - s = nogamma(start.s, end.s), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.s = s(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; - } - } - - var hsl$1 = hsl(hue$1); - var hslLong = hsl(nogamma); - - function lab(start, end) { - var l = nogamma((start = lab$1(start)).l, (end = lab$1(end)).l), - a = nogamma(start.a, end.a), - b = nogamma(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.l = l(t); - start.a = a(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - function hcl(hue) { - return function(start, end) { - var h = hue((start = hcl$2(start)).h, (end = hcl$2(end)).h), - c = nogamma(start.c, end.c), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.c = c(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; - } - } - - var hcl$1 = hcl(hue$1); - var hclLong = hcl(nogamma); - - function cubehelix(hue) { - return (function cubehelixGamma(y) { - y = +y; - - function cubehelix(start, end) { - var h = hue((start = cubehelix$2(start)).h, (end = cubehelix$2(end)).h), - s = nogamma(start.s, end.s), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.s = s(t); - start.l = l(Math.pow(t, y)); - start.opacity = opacity(t); - return start + ""; - }; - } - - cubehelix.gamma = cubehelixGamma; - - return cubehelix; - })(1); - } - - var cubehelix$1 = cubehelix(hue$1); - var cubehelixLong = cubehelix(nogamma); - - function piecewise(interpolate, values) { - var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); - while (i < n) I[i] = interpolate(v, v = values[++i]); - return function(t) { - var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); - return I[i](t - i); - }; - } - - function quantize(interpolator, n) { - var samples = new Array(n); - for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); - return samples; - } - - var src$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - interpolate: value, - interpolateArray: array, - interpolateBasis: basis$1, - interpolateBasisClosed: basisClosed, - interpolateDate: date, - interpolateDiscrete: discrete, - interpolateHue: hue, - interpolateNumber: interpolateNumber, - interpolateNumberArray: numberArray, - interpolateObject: object, - interpolateRound: round, - interpolateString: interpolateString, - interpolateTransformCss: interpolateTransformCss, - interpolateTransformSvg: interpolateTransformSvg, - interpolateZoom: interpolateZoom, - interpolateRgb: interpolateRgb, - interpolateRgbBasis: rgbBasis, - interpolateRgbBasisClosed: rgbBasisClosed, - interpolateHsl: hsl$1, - interpolateHslLong: hslLong, - interpolateLab: lab, - interpolateHcl: hcl$1, - interpolateHclLong: hclLong, - interpolateCubehelix: cubehelix$1, - interpolateCubehelixLong: cubehelixLong, - piecewise: piecewise, - quantize: quantize - }); - - function tweenRemove(id, name) { - var tween0, tween1; - return function() { - var schedule = set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; - } - - function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error; - return function() { - var schedule = set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; - } - - function transition_tween(name, value) { - var id = this._id; - - name += ""; - - if (arguments.length < 2) { - var tween = get$1(this.node(), id).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - - return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); - } - - function tweenValue(transition, name, value) { - var id = transition._id; - - transition.each(function() { - var schedule = set(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - - return function(node) { - return get$1(node, id).value[name]; - }; - } - - function interpolate(a, b) { - var c; - return (typeof b === "number" ? interpolateNumber - : b instanceof color ? interpolateRgb - : (c = color(b)) ? (b = c, interpolateRgb) - : interpolateString)(a, b); - } - - function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; - } - - function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attrConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function attrConstantNS(fullname, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function attrFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function attrFunctionNS(fullname, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function transition_attr(name, value) { - var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate; - return this.attrTween(name, typeof value === "function" - ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) - : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) - : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value)); - } - - function attrInterpolate(name, i) { - return function(t) { - this.setAttribute(name, i.call(this, t)); - }; - } - - function attrInterpolateNS(fullname, i) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; - } - - function attrTweenNS(fullname, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - tween._value = value; - return tween; - } - - function attrTween(name, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - tween._value = value; - return tween; - } - - function transition_attrTween(name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); - } - - function delayFunction(id, value) { - return function() { - init(this, id).delay = +value.apply(this, arguments); - }; - } - - function delayConstant(id, value) { - return value = +value, function() { - init(this, id).delay = value; - }; - } - - function transition_delay(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? delayFunction - : delayConstant)(id, value)) - : get$1(this.node(), id).delay; - } - - function durationFunction(id, value) { - return function() { - set(this, id).duration = +value.apply(this, arguments); - }; - } - - function durationConstant(id, value) { - return value = +value, function() { - set(this, id).duration = value; - }; - } - - function transition_duration(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? durationFunction - : durationConstant)(id, value)) - : get$1(this.node(), id).duration; - } - - function easeConstant(id, value) { - if (typeof value !== "function") throw new Error; - return function() { - set(this, id).ease = value; - }; - } - - function transition_ease(value) { - var id = this._id; - - return arguments.length - ? this.each(easeConstant(id, value)) - : get$1(this.node(), id).ease; - } - - function transition_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); - } - - function transition_merge(transition) { - if (transition._id !== this._id) throw new Error; - - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); - } - - function start(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); - } - - function onFunction(id, name, listener) { - var on0, on1, sit = start(name) ? init : set; - return function() { - var schedule = sit(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - - schedule.on = on1; - }; - } - - function transition_on(name, listener) { - var id = this._id; - - return arguments.length < 2 - ? get$1(this.node(), id).on.on(name) - : this.each(onFunction(id, name, listener)); - } - - function removeFunction(id) { - return function() { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id) return; - if (parent) parent.removeChild(this); - }; - } - - function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); - } - - function transition_select(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule(subgroup[i], name, id, i, subgroup, get$1(node, id)); - } - } - } - - return new Transition(subgroups, this._parents, name, id); - } - - function transition_selectAll(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - for (var children = select.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) { - if (child = children[k]) { - schedule(child, name, id, k, children, inherit); - } - } - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); - } - - var Selection = selection.prototype.constructor; - - function transition_selection() { - return new Selection(this._groups, this._parents); - } - - function styleNull(name, interpolate) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; - } - - function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; - } - - function styleConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function styleFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function styleMaybeRemove(id, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; - return function() { - var schedule = set(this, id), - on = schedule.on, - listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - - schedule.on = on1; - }; - } - - function transition_style(name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate; - return value == null ? this - .styleTween(name, styleNull(name, i)) - .on("end.style." + name, styleRemove(name)) - : typeof value === "function" ? this - .styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))) - .each(styleMaybeRemove(this._id, name)) - : this - .styleTween(name, styleConstant(name, i, value), priority) - .on("end.style." + name, null); - } - - function styleInterpolate(name, i, priority) { - return function(t) { - this.style.setProperty(name, i.call(this, t), priority); - }; - } - - function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; - } - - function transition_styleTween(name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); - } - - function textConstant(value) { - return function() { - this.textContent = value; - }; - } - - function textFunction(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; - } - - function transition_text(value) { - return this.tween("text", typeof value === "function" - ? textFunction(tweenValue(this, "text", value)) - : textConstant(value == null ? "" : value + "")); - } - - function textInterpolate(i) { - return function(t) { - this.textContent = i.call(this, t); - }; - } - - function textTween(value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - tween._value = value; - return tween; - } - - function transition_textTween(value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, textTween(value)); - } - - function transition_transition() { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - var inherit = get$1(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); - } - - function transition_end() { - var on0, on1, that = this, id = that._id, size = that.size(); - return new Promise(function(resolve, reject) { - var cancel = {value: reject}, - end = {value: function() { if (--size === 0) resolve(); }}; - - that.each(function() { - var schedule = set(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - - schedule.on = on1; - }); - }); - } - - var id = 0; - - function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; - } - - function transition(name) { - return selection().transition(name); - } - - function newId() { - return ++id; - } - - var selection_prototype = selection.prototype; - - Transition.prototype = transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition_transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: transition_tween, - delay: transition_delay, - duration: transition_duration, - ease: transition_ease, - end: transition_end - }; - - function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; - } - - var defaultTiming = { - time: null, // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut - }; - - function inherit(node, id) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - return defaultTiming.time = now(), defaultTiming; - } - } - return timing; - } - - function selection_transition(name) { - var id, - timing; - - if (name instanceof Transition) { - id = name._id, name = name._name; - } else { - id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); - } - - selection.prototype.interrupt = selection_interrupt; - selection.prototype.transition = selection_transition; - - var root = [null]; - - function active(node, name) { - var schedules = node.__transition, - schedule, - i; - - if (schedules) { - name = name == null ? null : name + ""; - for (i in schedules) { - if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) { - return new Transition([[node]], root, name, +i); - } - } - } - - return null; - } - - var src$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - transition: transition, - active: active, - interrupt: interrupt - }); - - var require$$2$1 = /*@__PURE__*/getAugmentedNamespace(src$7); - - var require$$3 = /*@__PURE__*/getAugmentedNamespace(src$9); - - var require$$4 = /*@__PURE__*/getAugmentedNamespace(src$8); - - function noevent$1() { - event.preventDefault(); - event.stopImmediatePropagation(); - } - - function dragDisable(view) { - var root = view.document.documentElement, - selection = select(view).on("dragstart.drag", noevent$1, true); - if ("onselectstart" in root) { - selection.on("selectstart.drag", noevent$1, true); - } else { - root.__noselect = root.style.MozUserSelect; - root.style.MozUserSelect = "none"; - } - } - - function yesdrag(view, noclick) { - var root = view.document.documentElement, - selection = select(view).on("dragstart.drag", null); - if (noclick) { - selection.on("click.drag", noevent$1, true); - setTimeout(function() { selection.on("click.drag", null); }, 0); - } - if ("onselectstart" in root) { - selection.on("selectstart.drag", null); - } else { - root.style.MozUserSelect = root.__noselect; - delete root.__noselect; - } - } - - function constant(x) { - return function() { - return x; - }; - } - - function ZoomEvent(target, type, transform) { - this.target = target; - this.type = type; - this.transform = transform; - } - - function Transform$2(k, x, y) { - this.k = k; - this.x = x; - this.y = y; - } - - Transform$2.prototype = { - constructor: Transform$2, - scale: function(k) { - return k === 1 ? this : new Transform$2(this.k * k, this.x, this.y); - }, - translate: function(x, y) { - return x === 0 & y === 0 ? this : new Transform$2(this.k, this.x + this.k * x, this.y + this.k * y); - }, - apply: function(point) { - return [point[0] * this.k + this.x, point[1] * this.k + this.y]; - }, - applyX: function(x) { - return x * this.k + this.x; - }, - applyY: function(y) { - return y * this.k + this.y; - }, - invert: function(location) { - return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; - }, - invertX: function(x) { - return (x - this.x) / this.k; - }, - invertY: function(y) { - return (y - this.y) / this.k; - }, - rescaleX: function(x) { - return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); - }, - rescaleY: function(y) { - return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); - }, - toString: function() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } - }; - - var identity$2 = new Transform$2(1, 0, 0); - - transform.prototype = Transform$2.prototype; - - function transform(node) { - while (!node.__zoom) if (!(node = node.parentNode)) return identity$2; - return node.__zoom; - } - - function nopropagation() { - event.stopImmediatePropagation(); - } - - function noevent() { - event.preventDefault(); - event.stopImmediatePropagation(); - } - - // Ignore right-click, since that should open the context menu. - function defaultFilter() { - return !event.ctrlKey && !event.button; - } - - function defaultExtent() { - var e = this; - if (e instanceof SVGElement) { - e = e.ownerSVGElement || e; - if (e.hasAttribute("viewBox")) { - e = e.viewBox.baseVal; - return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; - } - return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; - } - return [[0, 0], [e.clientWidth, e.clientHeight]]; - } - - function defaultTransform() { - return this.__zoom || identity$2; - } - - function defaultWheelDelta() { - return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002); - } - - function defaultTouchable() { - return navigator.maxTouchPoints || ("ontouchstart" in this); - } - - function defaultConstrain(transform, extent, translateExtent) { - var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], - dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], - dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], - dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; - return transform.translate( - dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), - dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) - ); - } - - function zoom() { - var filter = defaultFilter, - extent = defaultExtent, - constrain = defaultConstrain, - wheelDelta = defaultWheelDelta, - touchable = defaultTouchable, - scaleExtent = [0, Infinity], - translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], - duration = 250, - interpolate = interpolateZoom, - listeners = dispatch("start", "zoom", "end"), - touchstarting, - touchending, - touchDelay = 500, - wheelDelay = 150, - clickDistance2 = 0; - - function zoom(selection) { - selection - .property("__zoom", defaultTransform) - .on("wheel.zoom", wheeled) - .on("mousedown.zoom", mousedowned) - .on("dblclick.zoom", dblclicked) - .filter(touchable) - .on("touchstart.zoom", touchstarted) - .on("touchmove.zoom", touchmoved) - .on("touchend.zoom touchcancel.zoom", touchended) - .style("touch-action", "none") - .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - - zoom.transform = function(collection, transform, point) { - var selection = collection.selection ? collection.selection() : collection; - selection.property("__zoom", defaultTransform); - if (collection !== selection) { - schedule(collection, transform, point); - } else { - selection.interrupt().each(function() { - gesture(this, arguments) - .start() - .zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform) - .end(); - }); - } - }; - - zoom.scaleBy = function(selection, k, p) { - zoom.scaleTo(selection, function() { - var k0 = this.__zoom.k, - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return k0 * k1; - }, p); - }; - - zoom.scaleTo = function(selection, k, p) { - zoom.transform(selection, function() { - var e = extent.apply(this, arguments), - t0 = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, - p1 = t0.invert(p0), - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); - }, p); - }; - - zoom.translateBy = function(selection, x, y) { - zoom.transform(selection, function() { - return constrain(this.__zoom.translate( - typeof x === "function" ? x.apply(this, arguments) : x, - typeof y === "function" ? y.apply(this, arguments) : y - ), extent.apply(this, arguments), translateExtent); - }); - }; - - zoom.translateTo = function(selection, x, y, p) { - zoom.transform(selection, function() { - var e = extent.apply(this, arguments), - t = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; - return constrain(identity$2.translate(p0[0], p0[1]).scale(t.k).translate( - typeof x === "function" ? -x.apply(this, arguments) : -x, - typeof y === "function" ? -y.apply(this, arguments) : -y - ), e, translateExtent); - }, p); - }; - - function scale(transform, k) { - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); - return k === transform.k ? transform : new Transform$2(k, transform.x, transform.y); - } - - function translate(transform, p0, p1) { - var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k; - return x === transform.x && y === transform.y ? transform : new Transform$2(transform.k, x, y); - } - - function centroid(extent) { - return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; - } - - function schedule(transition, transform, point) { - transition - .on("start.zoom", function() { gesture(this, arguments).start(); }) - .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); }) - .tween("zoom", function() { - var that = this, - args = arguments, - g = gesture(that, args), - e = extent.apply(that, args), - p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, - w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), - a = that.__zoom, - b = typeof transform === "function" ? transform.apply(that, args) : transform, - i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); - return function(t) { - if (t === 1) t = b; // Avoid rounding error on end. - else { var l = i(t), k = w / l[2]; t = new Transform$2(k, p[0] - l[0] * k, p[1] - l[1] * k); } - g.zoom(null, t); - }; - }); - } - - function gesture(that, args, clean) { - return (!clean && that.__zooming) || new Gesture(that, args); - } - - function Gesture(that, args) { - this.that = that; - this.args = args; - this.active = 0; - this.extent = extent.apply(that, args); - this.taps = 0; - } - - Gesture.prototype = { - start: function() { - if (++this.active === 1) { - this.that.__zooming = this; - this.emit("start"); - } - return this; - }, - zoom: function(key, transform) { - if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); - if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); - if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); - this.that.__zoom = transform; - this.emit("zoom"); - return this; - }, - end: function() { - if (--this.active === 0) { - delete this.that.__zooming; - this.emit("end"); - } - return this; - }, - emit: function(type) { - customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]); - } - }; - - function wheeled() { - if (!filter.apply(this, arguments)) return; - var g = gesture(this, arguments), - t = this.__zoom, - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), - p = mouse(this); - - // If the mouse is in the same location as before, reuse it. - // If there were recent wheel events, reset the wheel idle timeout. - if (g.wheel) { - if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { - g.mouse[1] = t.invert(g.mouse[0] = p); - } - clearTimeout(g.wheel); - } - - // If this wheel event won’t trigger a transform change, ignore it. - else if (t.k === k) return; - - // Otherwise, capture the mouse point and location at the start. - else { - g.mouse = [p, t.invert(p)]; - interrupt(this); - g.start(); - } - - noevent(); - g.wheel = setTimeout(wheelidled, wheelDelay); - g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); - - function wheelidled() { - g.wheel = null; - g.end(); - } - } - - function mousedowned() { - if (touchending || !filter.apply(this, arguments)) return; - var g = gesture(this, arguments, true), - v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), - p = mouse(this), - x0 = event.clientX, - y0 = event.clientY; - - dragDisable(event.view); - nopropagation(); - g.mouse = [p, this.__zoom.invert(p)]; - interrupt(this); - g.start(); - - function mousemoved() { - noevent(); - if (!g.moved) { - var dx = event.clientX - x0, dy = event.clientY - y0; - g.moved = dx * dx + dy * dy > clickDistance2; - } - g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent, translateExtent)); - } - - function mouseupped() { - v.on("mousemove.zoom mouseup.zoom", null); - yesdrag(event.view, g.moved); - noevent(); - g.end(); - } - } - - function dblclicked() { - if (!filter.apply(this, arguments)) return; - var t0 = this.__zoom, - p0 = mouse(this), - p1 = t0.invert(p0), - k1 = t0.k * (event.shiftKey ? 0.5 : 2), - t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent); - - noevent(); - if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0); - else select(this).call(zoom.transform, t1); - } - - function touchstarted() { - if (!filter.apply(this, arguments)) return; - var touches = event.touches, - n = touches.length, - g = gesture(this, arguments, event.changedTouches.length === n), - started, i, t, p; - - nopropagation(); - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - p = [p, this.__zoom.invert(p), t.identifier]; - if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; - else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; - } - - if (touchstarting) touchstarting = clearTimeout(touchstarting); - - if (started) { - if (g.taps < 2) touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); - interrupt(this); - g.start(); - } - } - - function touchmoved() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event.changedTouches, - n = touches.length, i, t, p, l; - - noevent(); - if (touchstarting) touchstarting = clearTimeout(touchstarting); - g.taps = 0; - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; - else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; - } - t = g.that.__zoom; - if (g.touch1) { - var p0 = g.touch0[0], l0 = g.touch0[1], - p1 = g.touch1[0], l1 = g.touch1[1], - dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, - dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; - t = scale(t, Math.sqrt(dp / dl)); - p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; - l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; - } - else if (g.touch0) p = g.touch0[0], l = g.touch0[1]; - else return; - g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); - } - - function touchended() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event.changedTouches, - n = touches.length, i, t; - - nopropagation(); - if (touchending) clearTimeout(touchending); - touchending = setTimeout(function() { touchending = null; }, touchDelay); - for (i = 0; i < n; ++i) { - t = touches[i]; - if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0; - else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; - } - if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; - if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); - else { - g.end(); - // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. - if (g.taps === 2) { - var p = select(this).on("dblclick.zoom"); - if (p) p.apply(this, arguments); - } - } - } - - zoom.wheelDelta = function(_) { - return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant(+_), zoom) : wheelDelta; - }; - - zoom.filter = function(_) { - return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), zoom) : filter; - }; - - zoom.touchable = function(_) { - return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), zoom) : touchable; - }; - - zoom.extent = function(_) { - return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; - }; - - zoom.scaleExtent = function(_) { - return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; - }; - - zoom.translateExtent = function(_) { - return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; - }; - - zoom.constrain = function(_) { - return arguments.length ? (constrain = _, zoom) : constrain; - }; - - zoom.duration = function(_) { - return arguments.length ? (duration = +_, zoom) : duration; - }; - - zoom.interpolate = function(_) { - return arguments.length ? (interpolate = _, zoom) : interpolate; - }; - - zoom.on = function() { - var value = listeners.on.apply(listeners, arguments); - return value === listeners ? zoom : value; - }; - - zoom.clickDistance = function(_) { - return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); - }; - - return zoom; - } - - var src$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - zoom: zoom, - zoomTransform: transform, - zoomIdentity: identity$2 - }); - - var require$$5$1 = /*@__PURE__*/getAugmentedNamespace(src$6); - - var viz = {exports: {}}; - - /* - Viz.js 1.8.2 (Graphviz 2.40.1, Expat 2.2.5, Emscripten 1.37.33) - Copyright (c) 2014-2018 Michael Daines - Licensed under MIT license - - This distribution contains other software in object code form: - - Graphviz - Licensed under Eclipse Public License - v 1.0 - http://www.graphviz.org - - Expat - Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. - Licensed under MIT license - http://www.libexpat.org - - zlib - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler - http://www.zlib.net/zlib_license.html - */ - - (function (module, exports) { - (function(global) { - var Module = function(Module) { - Module = Module || {}; - var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key];}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true;}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true;}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true;}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true;}else {throw new Error("Module['ENVIRONMENT'] value is not valid. must be one of: WEB|WORKER|NODE|SHELL.")}}else {ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof commonjsRequire==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;}if(ENVIRONMENT_IS_NODE){var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;ret=tryParseAsDataURI(filename);if(!ret){if(!nodeFS)nodeFS=require$$0__default$1["default"];if(!nodePath)nodePath=require$$1__default["default"];filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);}return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/");}Module["arguments"]=process["argv"].slice(2);{module["exports"]=Module;}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",(function(reason,p){process["exit"](1);}));Module["inspect"]=(function(){return "[Emscripten Module object]"});}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)};}Module["readBinary"]=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs;}else if(typeof arguments!="undefined"){Module["arguments"]=arguments;}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status);});}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}};}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror();};xhr.onerror=onerror;xhr.send(null);};if(typeof arguments!="undefined"){Module["arguments"]=arguments;}Module["setWindowTitle"]=(function(title){document.title=title;});}Module["print"]=typeof console!=="undefined"?console.log:typeof print!=="undefined"?print:null;Module["printErr"]=typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn||Module["print"];Module.print=Module["print"];Module.printErr=Module["printErr"];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key];}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size/factor)*factor;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else {return 0}}}}new Array(0);var GLOBAL_BASE=8;var ABORT=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text);}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}var JSfuncs={"stackSave":(function(){stackSave();}),"stackRestore":(function(){stackRestore();}),"arrayToC":(function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len);}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type);}}var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab;}else {zeroinit=false;size=slab.length;}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr;}else {ret=[typeof _malloc==="function"?_malloc:staticAlloc,stackAlloc,staticAlloc,dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length));}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0;}stop=ret+size;while(ptr>0]=0;}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret);}else {HEAPU8.set(new Uint8Array(slab),ret);}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK;}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else {var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else {u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3;}else {u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4;}else {u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5;}}}if(u0<65536){str+=String.fromCharCode(u0);}else {var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else {if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len;}else if(u<=2047){len+=2;}else if(u<=65535){len+=3;}else if(u<=2097151){len+=4;}else if(u<=67108863){len+=5;}else {len+=6;}}return len}typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e;}if(!err.stack){return "(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var PAGE_SIZE=16384;var buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=new Uint16Array(buffer);Module["HEAPU32"]=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer);}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ");}function enlargeMemory(){abortOnCannotGrowMemory();}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func);}else {Module["dynCall_vi"](func,callback.arg);}}else {func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer);}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i);}if(!dontAddNull)HEAP8[buffer>>0]=0;}if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_min=Math.min;var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var ASM_CONSTS=[(function($0,$1){var path=Pointer_stringify($0);var data=Pointer_stringify($1);FS.createPath("/",PATH.dirname(path));FS.writeFile(PATH.join("/",path),data);})];function _emscripten_asm_const_iii(code,a0,a1){return ASM_CONSTS[code](a0,a1)}STATIC_BASE=GLOBAL_BASE;STATICTOP=STATIC_BASE+197232;__ATINIT__.push();memoryInitializer="data:application/octet-stream;base64,AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/ACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAIMEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAIMEAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkACEAAAAAAAAAAAAAAAABBAoC8AAAgAAAABAAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICWQAAAAAAAgJZABJDDAAAAAAAAAAAAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWEAAAAAAAABYQAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYQAAAAAAAAFhAAAAAAAAAAAAAAAAAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUkAAAAAAAABSQAAgAwIAAAAAAAAAAAAAEEAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAABCQAAAAAAAAEJAAAAAAAAgg0AAAAAAAMCIQAAAAAAAAFJAAAAAAAAAUkAAAAAAAAAAAAAAAAAAAEJAAAAAAAAAQkAAAAAAACCDQAAAAAAAwIhAAAAAAAAAUkAAAAAAAABSQACwwQAAAAAAAAAAAAAAEEBANgAAkwAAAAEAAAAAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAEAACAAAAAAAAAAAAABBAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYQAAAAAAAAFhAALDBAAAAAAAAAAAAAAAAABw6AAAQAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWEAAAAAAAABYQEAgPgMAAAAAAAAAAAAAEEAkOwAAegAAAAEAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAAAAAAAAAAAAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJA////////73/////////vf////////+//////////7/8AAAAAAAD4PzMzMzMzM9M/PAAAAAAAAACamZmZmZmpPwEAAAAAAAAAAQAAAAAAAAAAAAAAAADwPwEAAAAAAAAAAgAAAAAAAAAAAAAAAADwPwIAAAAAAAAAAwAAAAAAAAAAAAAAAADgPwMAAAAAAAAABAAAAAAAAAAAAAAAAADwPwQAAAAAAAAABQAAAAAAAAAzMzMzMzPzPwUAAAAAAAAABgAAAAAAAACamZmZmZnpPwYAAAAAAAAABwAAAAAAAAAAAAAAAADwPwcAAAAAAAAACAAAAAAAAAAAAAAAAADgPwgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAMzMzMzMz078AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgEZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAmpmZmZmZ2b8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzMzMzPjPwAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAexSuR+F65L8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAEAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABr4VQAAAQAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAAAgGZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgGZAmpmZmZmZ2b8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAgGZAexSuR+F65L8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgEZAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAQAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABUAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAEAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwVQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAAAAQAAAAAAAAAAAAAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQP1ioNc07TtU/JXUCmggb2j8AAAAAAADgPwAAAAAAAOA/LNSa5h2n6j9q3nGKjuToP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAAOA/XdxGA3gL4j8AAAAAAADQP1ioNc07TtU/AAAAAAAA0D/TvOMUHcnRPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/07zjFB3J0T/TvOMUHcnRP13cRgN4C+I/XdxGA3gL4j9d3EYDeAviPw1xrIvbaNw/ZF3cRgN47T/Sb18HzhnnPxB6Nqs+V+U/EHo2qz5X5T/Sb18HzhnnP3gLJCh+jOM/tRX7y+7J4T/Sb18HzhnnP9JvXwfOGec/WKg1zTtO1T+IhVrTvOPYP9JvXwfOGec/eAskKH6M4z/EQq1p3nHsP9JvXwfOGec/0m9fB84Z5z+1FfvL7snhP9JvXwfOGec/EHo2qz5X5T+1FfvL7snhP3gLJCh+jOM/0m9fB84Z5z/Sb18HzhnnP4Y41sVtNO4/0m9fB84Z5z/Sb18HzhnnP3gLJCh+jOM/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/pgpGJXUC3j8AAAAAAADgP1ioNc07TtU/DXGsi9to3D8AAAAAAADgPw1xrIvbaNw/AAAAAAAA4D8NcayL22jcP1ioNc07TtU/AAAAAAAA4D8AAAAAAADgP9O84xQdydE/07zjFB3J0T8AAAAAAADgP9O84xQdydE/at5xio7k6D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgP1ioNc07TtU/iIVa07zj2D/TvOMUHcnRPwAAAAAAAOA/AAAAAAAA4D/Sb18HzhnnPwAAAAAAAOA/AAAAAAAA4D8NcayL22jcP/RsVn2utt4/ETY8vVKWyT/0bFZ9rrbePzsBTYQNT+E/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D9YqDXNO07VPwAAAAAAAOA/AAAAAAAA4D8+6Nms+lzFPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/gnNGlPYGxz8NcayL22jcPwAAAAAAAOA/WKg1zTtO1T9YqDXNO07VP7UV+8vuyeE/tRX7y+7J4T8AAAAAAADQPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAANA/AAAAAAAA0D8H8BZIUPzcP6K0N/jCZNY/WKg1zTtO1T8NcayL22jcPw1xrIvbaNw/AAAAAAAA4D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA0D8NcayL22jcPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/AAAAAAAA8D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQP8RCrWnecew/AAAAAAAA0D9/2T15WKjRPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/eAskKH6M4z/Sb18HzhnnP8RCrWnecew/E/JBz2bV0z8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/EHo2qz5X5T8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D/TvOMUHcnRPwAAAAAAANA/AAAAAAAA0D/TvOMUHcnRPwAAAAAAAOA/0m9fB84Z5z8AAAAAAADgPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP/RsVn2uttY/tRX7y+7J4T+1FfvL7snhP8RCrWnecew/EHo2qz5X5T/129eBc0bMP1ioNc07TtU/WKg1zTtO1T+IhVrTvOPYPwFNhA1Pr+I/07zjFB3J0T9YqDXNO07VP9O84xQdydE/07zjFB3J0T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP9O84xQdydE/07zjFB3J0T8BTYQNT6/iPwFNhA1Pr+I/AU2EDU+v4j+1FfvL7snhP8xdS8gHPfA/EHo2qz5X5T8QejarPlflP9JvXwfOGec/0m9fB84Z5z8QejarPlflP3gLJCh+jOM/at5xio7k6D/Sb18HzhnnP9O84xQdydE/AAAAAAAA4D8QejarPlflP7UV+8vuyeE/LNSa5h2n6j/Sb18HzhnnP2recYqO5Og/EHo2qz5X5T9q3nGKjuToP9JvXwfOGec/EHo2qz5X5T94CyQofozjP9JvXwfOGec/EHo2qz5X5T+GONbFbTTuPxB6Nqs+V+U/EHo2qz5X5T94CyQofozjP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP6YKRiV1At4/tRX7y+7J4T9Iv30dOGfMP7UV+8vuyeE/tRX7y+7J4T8AAAAAAADgP7UV+8vuyeE/tRX7y+7J4T/TvOMUHcnRP7UV+8vuyeE/tRX7y+7J4T9Iv30dOGfMP0i/fR04Z8w/AAAAAAAA4D9Iv30dOGfMPyzUmuYdp+o/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T9YqDXNO07VPwAAAAAAAOA/07zjFB3J0T+1FfvL7snhPwAAAAAAAOA/0m9fB84Z5z8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8Cmggbnl7VP+C+DpwzotA/ApoIG55e1T8BTYQNT6/iP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/WKg1zTtO1T+1FfvL7snhP7UV+8vuyeE/PujZrPpcxT+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhPx04Z0Rpb8g/WKg1zTtO1T+1FfvL7snhP1ioNc07TtU/WKg1zTtO1T8AAAAAAADgPwAAAAAAAOA/07zjFB3J0T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T/TvOMUHcnRP9O84xQdydE/5x2n6Egu4T+itDf4wmTWP0i/fR04Z8w/WKg1zTtO1T9YqDXNO07VP7UV+8vuyeE/AAAAAAAA8D8AAAAAAADwP9O84xQdydE/eAskKH6M4z/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAAPA/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T8AAAAAAADwP9O84xQdydE/6pWyDHGs1z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP7UV+8vuyeE/at5xio7k6D8AAAAAAADwP5jdk4eFWtc/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP8RCrWnecew/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/SL99HThnzD94CyQofozjP4Y41sVtNO4/eAskKH6M4z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP1GgT+RJ0g5AtMh2vp86NcA6It+l1CXVv/OCPkeaLoo/n+V5cHfW+b9+/RAbLJzmP5bs2AjE68w/zc6idyrg0D+w479AECDtv62h1F5E29g/O6F85lGWdj/TbnD5eoR7P4HMzqJ3KuS/0a3X9KCgyD9q3zcZsD+EP77KkBle/4Q/HJYGflTDxL+lSSno9uIjQKnZA63AkME/CMSQQZNpiT/6RJ4kXTPQvwHwmTYtwl4/DZx9L8+Ulz+JtfgUAOOJP+WpWEY0y7G/jwDJz6Fnpr9ctcb7zLSIP02kj1Q6s5A/5scEoWHWoL/HaWccE/eCvyp/a+UtcFy/5FdiVAiadT/R8YdVcgS3P5XUCWgiPDPAZCMQr+t3EMCnIarwZ3jHP9r/AGvVrsE/TihEwCFU97+qSIWxhSD1P51oVyHlJ/Y/TS7GwDqOzT9Zayi1F9HcvwM/qmG/J8w/pkdTPZl/2j+2gTtQpzyuP1FM3gAz37m/9XaV/9oLpj/UpTW8D/aUPx+tILws3JA/KCzxgLLJI0AjWuFMAoq3P0ijZVGWKX8/u7SG98Gekz8XqHtTR32gvyErruBtlIs/M3PchNYetb+geISJ9fyPP2k1JO6x9JG/uM0zel6/aj+SPq2iPzTNv36w58ZPPpi/ByObUC3HpD8+GMJ7WLmRvy18fa1LjcY/AAAAQPsh+T8AAAAALUR0PgAAAICYRvg8AAAAYFHMeDsAAACAgxvwOQAAAEAgJXo4AAAAgCKC4zYAAAAAHfNpNQAAAAAAAPC/vAQBAOgqAAADAAAAEC0AAAMAAADoLwAAAwAAALAwAAADAAAAADIAAAMAAAB4NQAAAwAAALQ4AAADAAAAxC4AAAMAAAB8OQAAAwAAAIQ6AAADAAAAED8AAAMAAAA0PQAAAAAAANQsAAAAAAAAwC8AAAAAAAAQMAAAAAAAANgxAAAAAAAAKDIAAAAAAACMOAAAAAAAAGAuAAAAAAAAVDkAAAAAAABcOgAAAAAAAOg+AAAAAAAADD0AAAQAAAA4PwAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAACAAAAAQAAAAEAAAADAAAAAAAAAAAAAAAI2QIAGNkCACjZAgA42QIASNkCAFjZAgBo2QIAeNkCABjZAgAY2QIAWNkCAFjZAgAfAAAAPwAAAH8AAAAAAAAAooUBAAEAAACoKwAAaAAAAAQAAADVCAEAAQAAACAsAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAUBAAEAAAAAAAAA4AAAAAAAAAB4BQEAAQAAAAAAAADgAAAAAQAAAH8FAQABAAAAAAAAAKgAAAACAAAAiQUBAAEAAAAAAAAA4AAAAAMAAACTBQEAAQAAAAAAAADgAAAABAAAAKEFAQABAAAAAAAAAOAAAAAFAAAAqwUBAAEAAAAAAAAA4AAAAAYAAAC4BQEAAQAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAA/////wAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2ggBAAEAAADELQAAGAEAAAEAAADfCAEAAQAAAMQtAAAYAQAAAgAAAOUIAQABAAAAxC0AABgBAAADAAAA7ggBAAEAAADELQAAGAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPgIAQABAAAAAAAAAHABAAABAAAAAgkBAAEAAAAAAAAAcAEAAAIAAAANCQEAAQAAAAAAAAA4AQAAAwAAABsJAQABAAAAAAAAADgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAkAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAwAAAANAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAYAAAACAAAAAgAAAAcAAAACAAAAAAAAAGIYAgBnAQIA+AICADgJAgAvEAIAbhQCAO4XAgD/FwIAAAAAAGIJAQABAAAAKC8AAKgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmCQEAAQAAAAAAAADIAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAbgkBAAEAAAA4MAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAKYKAQABAAAAAAAAACACAAACAAAAsAoBAAEAAAAAAAAAWAIAAAAAAAC5CgEAAQAAAAAAAABYAgAAAwAAAMIKAQABAAAAAAAAAFgCAAAAAAAAzAoBAAEAAAAAAAAAIAIAAAMAAADYCgEAAQAAAAAAAAAgAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAASAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAVAAAAFgAAABcAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAMAAAAJAAAAAwAAAAMAAAAKAAAABAAAAAAAAABiGAIAZwECADgJAgD4AgIAbhQCAC8QAgD/FwIA7hcCAAAAAAAAAAAAlQwBAP////88MQAAkAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJgMAQD/////AAAAALACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACojQEAAQAAAFAyAADoAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAGQAAABoAAAAAAAAABAAAAAAAAAAbAAAAHAAAAB0AAAAeAAAAAAAAAAAAAAAAAAAAAAAAAB8AAAAgAAAAIQAAACIAAAACAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAMAAAABQAAAAQAAAANAAAABQAAAAMAAACVEAEAoxABALkQAQDz+QIAxxABANYQAQDbEAEA+RABAPP5AgALEQEAOxEBAPP5AgBZEQEAgREBAI8RAQC+EQEA8hEBAAMSAQAoEgEASxIBAFESAQBtEgEAihIBAKUSAQDGEgEA4BIBAAITAQAhEwEARxMBAF8TAQB/EwEAnBMBAMATAQDMEwEA8/kCANcTAQD9EwEAIRQBAEcUAQDz+QIAfRQBAJUUAQCiFAEA0RQBAMwTAQDz+QIA3hQBAOcUAQAIFQEAQxUBAI4VAQDiFQEABBYBABkWAQAwFgEARhYBAF4WAQDz+QIAdBYBAI8WAQCzFgEA1xYBAPwWAQDz+QIAHRcBADcXAQBJFwEAVhcBAGMXAQB3FwEAhhcBAI4XAQCjFwEAsRcBAO8XAQD6FwEAzBMBAPP5AgAAGAEADBgBABsYAQBLEgEA8/kCAC4YAQBXGAEAdRgBAIUYAQCWGAEAnRgBAKwYAQC8GAEAABkBAAcZAQBLEgEA8/kCABEZAQA9GQEASBkBAFEZAQBaGQEAaxkBAHwZAQCQGQEAzBMBAPP5AgCcGQEArBkBALoZAQDIGQEA1RkBAOIZAQD4GQEAARoBABAaAQAdGgEALhoBAMwTAQDz+QIAORoBAFgaAQDz+QIAahoBAHkaAQCpGgEAsxoBAMAaAQDNGgEA2hoBAOcaAQDqGgEA8/kCAO4aAQDz+QIAERsBAEIbAQBxGwEAiBsBAKMbAQC+GwEAzBMBAPP5AgDaGwEA8/kCAAIcAQAOHAEAIRwBADQcAQBJHAEAXhwBAGIcAQBLEgEA8/kCAG4cAQDz+QIAfhwBAIwcAQCYHAEApRwBAMUcAQDbHAEA8/kCAO8cAQA4HQEAfh0BAK4dAQDhHQEA6B0BAA8eAQA2HgEA8/kCADseAQAAAAAAAAAAAPBHAQABAAAAAAAAAAgDAAABAAAArx4BAAEAAAAAAAAACAMAAAIAAADpRwEAAQAAAAAAAABAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjAAAAAAAAACQAAAAlAAAABgAAACYAAAAnAAAAKAAAACkAAAAqAAAAAAAAAAAAAAAAAAAAAAAAACsAAAAsAAAALQAAAC4AAAAEAAAALwAAAAAAAAAAAAAADgAAAAAAAAAPAAAABwAAAAUAAAAQAAAABgAAAAAAAAB/AAIAiQACAHkxAQDOAAIACQECACsBAgAxAQIAYhgCAFgBAgBnAQIAhAECAI8BAgCxAQIA5wECAB0CAgBYAgIAjgICALACAgC/AgIA8AICAPgCAgA/JQEASCUBABUDAgBRJQEAXwMCAFolAQBpAwIAYyUBAHMDAgDCAwIA/QMCAG8lAQA4BAIAQwQCAIgEAgCWBAIA4AQCAO4EAgD8BAIABwUCADgFAgB4BQIAgAUCAIgFAgDDBQIA+QUCAAUGAgB+MQEAEQYCABsGAgAmBgIAQwYCAHkGAgA4CQIAWgkCAGYJAgAlDAIAVgwCAIIMAgC4DAIAxQwCAOcMAgAJDQIAEg0CAFwNAgBmDQIAqw0CAOENAgDsDQIAcQ4CAIYOAgB3JQEAkA4CAJoOAgDQDgIAEA8CAB4PAgByDwIAgQ8CAJAPAgDfDwIAhjEBAB8QAgApEAIALxACAFsQAgCCEAIAkxACAJ4QAgDjEAIAKBECADcRAgBHEQIAWRECAGkRAgB5EQIAhhECAJARAgDGEQIAzxECAA8SAgAiEgIAizEBACoSAgBgEgIAhxICAL0SAgDkEgIA8hICACgTAgByEwIAvBMCAMcTAgD9EwIAAhQCAB8UAgA8FAIARxQCAG4UAgCGFAIAvBQCAPIUAgD+FAIAJRUCADAVAgBhFQIAkhUCAHg8AQC5FQIA5RUCABsWAgBRFgIAWxYCAHgWAgC4FgIA7hYCAJExAQAGFwIAMhcCAFkXAgCPFwIAzBcCAO4XAgD0FwIA/xcCACYYAgAAAAAAq40BAAEAAADINQAAeAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMdIAQABAAAAAAAAAJgDAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAAAAAAAzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAABIAAAAIAAAABgAAABMAAAAHAAAAAAAAAAAAAACtJgEAAQAAANw4AADQAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsCYBAAEAAAAAAAAA8AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAA1AAAANgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAADcAAAAAAAAAAAAAABQAAAAAAAAAFQAAAAkAAAAHAAAAFgAAAAgAAAAAAAAAeTEBAGIYAgBnAQIAfjEBAHkGAgA4CQIAhjEBAFsQAgAPEgIAizEBAEcUAgBuFAIAeDwBAJExAQDuFwIA/xcCAAAAAACWMQEAAQAAAKQ5AAAoBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmjEBAAEAAAAAAAAASAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAA5AAAAOgAAAAoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQQAAAEIAAABDAAAAAAAAAAAAAAAAAAAAAAAAABcAAAAAAAAAGAAAAAsAAAAIAAAAGQAAAAkAAAAAAAAAzgACAA47AQBiGAIAZwECAIQBAgAZOwEAHzsBACo7AQAxOwEAjwECAOcBAgA5OwEAPzsBAEo7AQCOAgIAsAICAPgCAgBROwEAXwMCAHMDAgD9AwIAWzsBAIgEAgCWBAIA4AQCAGY7AQDuBAIAbjsBAHc7AQCFOwEAjzsBAMMFAgCYOwEABQYCACYGAgBDBgIAnjsBAIoGAgC1BgIA3gYCAAEHAgAqBwIATQcCAHYHAgCZBwIAwgcCAOUHAgAOCAIAMQgCAFoIAgB9CAIApggCAMkIAgDyCAIAFQkCADgJAgClOwEAWgkCALE7AQCCDAIA5wwCAKsNAgC+OwEAkA8CAMs7AQAfEAIALxACANU7AQBbEAIAghACAJMQAgDkOwEA9jsBAJ4QAgAoEQIANxECAEcRAgBZEQIAaRECAAY8AQARPAEAHDwBAHkRAgAPEgIAFBICACE8AQAqPAEAMzwBAEM8AQBKPAEAYBICAIcSAgC9EgIA8hICAAIUAgAfFAIAUjwBAG4UAgBZPAEA/hQCAGI8AQAwFQIAajwBAJIVAgB4PAEAuRUCAOUVAgB/PAEAeBYCALgWAgCJPAEA7hYCAAYXAgBZFwIAkzwBAKE8AQCPFwIAlhcCAMwXAgDuFwIA/xcCACYYAgAAAAAAszwBAAEAAACsOgAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALc8AQABAAAAAAAAAKAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAEUAAAAAAAAAAAAAAEYAAABHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAABsAAAAMAAAACQAAABwAAAAKAAAAAAAAAEFCAACwoQEAQUkAAIqhAQBBUgAAXaEBAEFYAADFoQEAQiAAAAGkAQBCSQAAEqQBAENCAABKogEAQ08AADiiAQBDWAAAV6IBAEggAAB7ogEASEIAAIWiAQBISQAAEaMBAEhYAACUogEASGIAAMWiAQBIaQAA+KIBAEhyAACqogEASHgAANuiAQBJIAAAI6QBAEtCAADcoQEAS0kAACSiAQBLUgAAEKIBAEtYAAD9oQEATkIAACOjAQBOSQAAaqMBAE5SAACCowEATlgAAE6jAQBQQQAA46MBAFBCAACfowEAUEkAANOjAQBQWAAAv6MBAFIgAADapQEAUyAAAPKjAQBaRAAAYKQBAAAAAAAAAAAAAQAAAAAAAABdRwEA/////1w9AADYBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYUcBAP////8AAAAA+AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAGlHAQABAAAAIEMAAAAAAAAQAAAAcUcBAAEAAAAgQwAAAAAAABEAAAB5RwEAAQAAACBDAAAAAAAAEQAAAIJHAQABAAAAIEMAAAAAAAARAAAAikcBAAEAAAAgQwAAAAAAABMAAACSRwEAAQAAACRDAAAAAAAAFAAAAJpHAQABAAAAJEMAAAAAAAAVAAAAokcBAAEAAAAkQwAAAAAAABUAAACrRwEAAQAAACRDAAAAAAAAFQAAALNHAQABAAAAJEMAAAAAAAAWAAAAu0cBAAEAAAAoQwAAAAAAABcAAADERwEAAQAAAChDAAAAAAAAGAAAAM1HAQABAAAAKEMAAAAAAAAYAAAA10cBAAEAAAAoQwAAAAAAABgAAADgRwEAAQAAAChDAAAAAAAAGQAAAOlHAQABAAAALEMAAAAAAAAZAAAA8EcBAAEAAAAsQwAAAAAAABoAAAD2RwEAAQAAADBDAAAAAAAACgAAAP9HAQABAAAANEMAAAAAAAALAAAAB0gBAAEAAAA0QwAAAAAAAAwAAAAPSAEAAQAAADRDAAAAAAAADAAAABhIAQABAAAANEMAAAAAAAAMAAAAIEgBAAEAAAA0QwAAAAAAAA4AAAAoSAEAAQAAADRDAAAAAAAADgAAAC9IAQABAAAANEMAAAAAAAANAAAAN0gBAAEAAAA0QwAAAAAAAAUAAAA/SAEAAQAAADRDAAAAAAAABgAAAEdIAQABAAAANEMAAAAAAAAHAAAAT0gBAAEAAAA0QwAAAAAAAAcAAABYSAEAAQAAADRDAAAAAAAABwAAAGBIAQABAAAANEMAAAAAAAAJAAAAaEgBAAEAAAA0QwAAAAAAAAkAAABvSAEAAQAAADRDAAAAAAAACAAAAHdIAQABAAAANEMAAAAAAAAAAAAAf0gBAAEAAAA4QwAAAAAAAAEAAACISAEAAQAAADhDAAAAAAAAAgAAAJFIAQABAAAAOEMAAAAAAAACAAAAm0gBAAEAAAA4QwAAAAAAAAIAAACkSAEAAQAAADhDAAAAAAAABAAAAK1IAQABAAAAOEMAAAAAAAAEAAAAtUgBAAEAAAA4QwAAAAAAAAMAAAC+SAEAAQAAADhDAAAAAAAAEgAAAMdIAQABAAAAIEMAAAAAAAAbAAAAz0gBAAEAAAA8QwAAAAAAABwAAADXSAEAAQAAADxDAAAAAAAAHQAAAN9IAQABAAAAPEMAAAAAAAAdAAAA6EgBAAEAAAA8QwAAAAAAAB0AAADwSAEAAQAAADxDAAAAAAAAHgAAAPhIAQABAAAAQEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAAGNMAQBMQwAAAQAAAGhDAAAAAAAAAAAAAEgAAABJAAAAAQAAAAAAAACihQEAAAAAAFxDAABkQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAgAAAAQAAAAYAQAAMAEAALAAAACIVAEAjVQBAJFUAQCYVAEAnFQBAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAdAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAfAAAAAAAAAAAAAACRWQEAKEQAAAEAAACARAAAAAAAAAAAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAEsAAABVAAAASwAAAFYAAABXAAAAWAAAAFkAAAAAAAAAnlkBAAAAAAA4RAAAKNsCAAEAAACkWQEAAAAAAEBEAAAo2wIAAgAAAKhZAQAAAAAASEQAACjbAgADAAAArVkBAAAAAABQRAAAKNsCAAQAAACzWQEAAAAAAFhEAAAo2wIABQAAALlZAQAAAAAAcEQAACjbAgAGAAAAw1kBAAAAAAB4RAAAKNsCAAcAAADJWQEAAAAAAGBEAAAo2wIABwAAAM1ZAQAAAAAAYEQAACjbAgAHAAAA0lkBAAAAAABoRAAAKNsCAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADAAAAAAAAAAAQAAACAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAQAAAAAAAAAPGcBAFRnAQBzZwEAkGcBAK9nAQC2ZwEAv2cBADxnAQBBZwEASGcBAE1nAQDeZgEA8GYBAP5mAQAMZwEAGmcBACFnAQAwZwEAPGcBAAAAAADz+QIAAAAAAB0SAgABAAAA+GkBAAcAAAC8aQEAAwAAAMYlAgAFAAAAAGoBAA8AAACQjQEACAAAAJCNAQAQAAAACGoBAAQAAAAIagEAEQAAAA1qAQAFAAAADWoBAAIAAAATagEABgAAABpqAQAEAAAAJmoBAAcAAAAuagEABwAAAD5qAQAFAAAARGoBAAgAAABbagEACAAAAERqAQAJAAAAZGoBAAcAAABsagEACgAAAIZqAQAHAAAAjmoBAAsAAACoagEABgAAAK9qAQAMAAAAzWoBAAkAAACvagEADQAAANdqAQAIAAAA4GoBAA4AAAABawEACAAAAAprAQASAAAAK2sBAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAIAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAMAAAAhAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAiAAAABQAAAAAAAAAAAAAAAAAAAAUAAABAAAAAiEcAAJhHAAAGAAAABAAAAKRHAAAGAAAACAAAAAYAAAAEAAAArEcAAAAEAAAIAAAA/////wAAAAAAAAAAIwAAAAAAAAAAAAAAAAAAAAAAAAA1AAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAGAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAGAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAIAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAIAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAJAAAAAAAAAAcAAAAAAAAACQAAAAsAAAAIAAAACgAAADBJAAC0SAAAGEkAAAEAAAABAAAACgAAABYAAAALAAAAWgAAACQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA0AAAAAAAAABwAAAAAAAAAHAAAAAgAAAAUAAAAIAAAAAAAAAAAAAAAGAAAAAwAAAA4AAAALAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAADwAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlAAAAEAAAAAAAAAAHAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAmAAAAAAAAAAAAAAAAAAAAAAAAABAAAAD/////AAAAAAAAAAAnAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAwAAAAEAAAABAAAAAgAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAABAAAAAUAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAGAAAAAQAAAAEAAAAHAAAACAAAAAkAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAAQAAAAEAAAALAAAAAQAAAAwAAAABAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABMAAAATAAAAEwAAABMAAAAXAAAAGAAAABkAAAATAAAAGgAAABsAAAAcAAAAHQAAABMAAAATAAAAEwAAABMAAAATAAAAAQAAAB4AAAABAAAAAQAAABMAAAABAAAAHwAAACAAAAAhAAAAIgAAACMAAAATAAAAJAAAACUAAAAmAAAAEwAAABMAAAATAAAAEwAAACcAAAAoAAAAKQAAABMAAAAqAAAAKwAAACwAAAAtAAAAEwAAABMAAAATAAAAEwAAABMAAAABAAAAAQAAAAEAAAABAAAAAQAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAALgAAABMAAAATAAAAEwAAAC8AAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAADAAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAAAAAAAEAAAABAAAAAgAAAAMAAAABAAAABAAAAAEAAAAFAAAAAQAAAAYAAAAHAAAABwAAAAEAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAAAwAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAIAAAAB5swEAWrMBACB8AQCGswEAfrMBAIyzAQAAAAAAJoABAC+AAQA2gAEARIABAHqyAQCiswEAS4ABAFKAAQABAAAACAAAAP////8AAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAA8IEBAAgAAAADAAAA+YEBAP2BAQALAAAABgAAAKiNAQAJggEAAgAAAAEAAAAMggEAEIIBAAQAAAACAAAAFYIBABmCAQAEAAAABAAAAB6CAQAjggEABQAAAAUAAAApggEALYIBAAQAAAAHAAAAMoIBADaCAQAFAAAACQAAADyCAQBAggEABAAAAAoAAABFggEASoIBAAQAAAAMAAAAT4IBAOKGAQAAAAAAAQAAAOqGAQABAAAAAAAAAHWyAQABAAAAAQAAAB0SAgAAAAAAAAAAAAAAAAAAAAAAAAAAAMuFAQAxAAAAAAAAAAAAAACjrQEAEAAAAEUeAgCAAAAAxIUBAEAAAAAOoAEAEAAAAMaFAQBAAAAAAAAAAAAAAACShQEAAQAAAJmFAQACAAAAnoUBAAMAAADMpgEABAAAADCdAQAFAAAAooUBAAYAAAAdEgIACAAAAKaFAQAhAAAAqoUBACIAAACuhQEAIgAAALKFAQABAAAAt4UBAAcAAAC9hQEAJwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAApAAAAAAAAAAAAAAAAAAAAAAAAAP2KAQAEiwEAAAAAAKWNAQCojQEAq40BAAAAAAAAAAAAAQAAAAIAAAD/////aI0BAG6NAQAdEgIAAAAAAGQAAABlAAAAZgAAAGQAAAAIAAAACAAAAAAAAAAAAAAAKgAAABEAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAJAAAAKwAAABEAAAAAAAAAAAAAAAAAAAAIAAAA/////wAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAADMpgEAYFUAAIAGAAAAAAAA+ZwBAGBVAACwBgAAAAAAANKlAQBgVQAA4AYAAAAAAAABnQEAYFUAAOAGAAAAAAAABp0BAGBVAAAQBwAAAAAAAA2dAQB4VQAAEAcAAAAAAAATnQEAYFUAAEAHAAAAAAAAF50BAGBVAABwBwAAAAAAAB0SAgBgVQAAoAcAAAAAAAAgnQEAYFUAAKAHAAAAAAAAKp0BAGBVAABQBgAAAAAAADCdAQBgVQAA0AcAAAAAAAA4nQEAYFUAAAAIAAAAAAAAQp0BAGBVAAAwCAAAAAAAAFCdAQBgVQAAYAgAAAAAAABWnQEAYFUAAJAIAAAAAAAAX50BAGBVAADACAAAAAAAAGedAQBgVQAA8AgAAAAAAABwnQEAYFUAACAJAAAAAAAAeJ0BAGBVAABQCQAAAAAAAH2dAQBgVQAAgAkAAAAAAACBnQEAYFUAALAJAAAAAAAAiJ0BAGBVAADgCQAAAAAAAI6dAQBgVQAAEAoAAAAAAACYnQEAkFUAAEAKAAAAAAAAoZ0BAGBVAACABgAAAAAAAKadAQBgVQAAgAYAAAAAAACwnQEAYFUAAHAKAAAAAAAAt50BAGBVAACgCgAAAAAAAMSdAQBgVQAA0AoAAAAAAADSnQEAYFUAAAALAAAAAAAA4J0BAGBVAAAwCwAAAAAAAOydAQBgVQAAYAsAAAAAAAD5nQEAYFUAAJALAAAAAAAAAp4BAGBVAADACwAAAAAAAAyeAQBgVQAA8AsAAAAAAAAVngEAYFUAACAMAAAAAAAAHZ4BAGBVAABQDAAAAAAAACWeAQBgVQAAgAwAAAAAAAAungEAYFUAALAMAAAAAAAAMp4BAGBVAADgDAAAAAAAAD2eAQBgVQAAEA0AAAAAAABBngEAYFUAAEANAAAAAAAAS54BAGBVAABwDQAAAAAAAFSeAQBgVQAAoA0AAAAAAABcngEAYFUAANANAAAAAAAAaZ4BAGBVAAAADgAAAAAAAHWeAQBgVQAAMA4AAAAAAACAngEAYFUAAGAOAAAAAAAAkJ4BAGBVAACQDgAAAAAAAJ6eAQBgVQAAwA4AAAAAAACtngEAYFUAAPAOAAAAAAAAt54BAGBVAAAgDwAAAAAAAMCeAQBgVQAAUA8AAAAAAADKngEAYFUAAIAPAAAAAAAA1J4BAGBVAACwDwAAAAAAANueAQBgVQAA4A8AAAAAAADingEAYFUAABAQAAAAAAAA7J4BAKhVAAAAAAAAAAAAAPOeAQCoVQAAAAAAAAAAAADVnAEAwFUAAAAAAAAAAAAA+54BANhVAABAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbAAAAXAAAABcAAAAEAAAAAgAAAAwAAABdAAAAXAAAABcAAAAFAAAAAAAAAA0AAABbAAAAXAAAABcAAAAEAAAAAgAAAAwAAABeAAAAXwAAABgAAAAGAAAAAwAAAA4AAABgAAAAYQAAABcAAAAHAAAAAAAAAA8AAABbAAAAXAAAABcAAAAIAAAAAgAAAAwAAAAQAAAAEQAAABIAAAATAAAA/Z8BAASgAQAAAAAADKABAA6gAQB/HgIAEKABAAwAAAAEAAAABgAAAAIAAAADAAAAAQAAAAkAAAAIAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAF2hAQBtoQEAeqEBAAAAAAAAAAAABAAAAH+hAQAAAAAAAAAAAIqhAQBtoQEAeqEBAAAAAAChoQEABQAAAH+hAQAAAAAAqaEBALChAQBtoQEAwKEBAAAAAAAAAAAABgAAAH+hAQDrsQEAAAAAAMWhAQBtoQEAwKEBAAAAAAChoQEABwAAAH+hAQDrsQEAqaEBANyhAQDpoQEAwKEBAAAAAAAAAAAACgAAAPehAQDrsQEAAAAAAP2hAQDpoQEAwKEBAAAAAACpoQEACwAAAPehAQDrsQEAqaEBABCiAQDpoQEAHqIBAAAAAAAAAAAACAAAAPehAQAAAAAAAAAAACSiAQDpoQEAHqIBAAAAAACpoQEACQAAAPehAQAAAAAAqaEBADiiAQA4ogEAAAAAAAAAAAAAAAAADAAAAECiAQAAAAAAAAAAAEqiAQA4ogEA67EBAAAAAAAAAAAADgAAAECiAQDrsQEAAAAAAFeiAQA4ogEA67EBAAAAAAChoQEADwAAAECiAQDrsQEAqaEBAGuiAQA4ogEAAAAAAAAAAAChoQEADQAAAECiAQAAAAAAqaEBAHuiAQB7ogEAAAAAAAAAAAAAAAAAEAAAAH+hAQAAAAAAAAAAAIWiAQB7ogEA67EBAAAAAAAAAAAAEgAAAH+hAQDrsQEAAAAAAJSiAQB7ogEA67EBAAAAAAChoQEAEwAAAH+hAQDrsQEAqaEBAKqiAQB7ogEAAAAAALuiAQAAAAAAFAAAAH+hAQAAAAAAAAAAAMWiAQB7ogEA67EBALuiAQAAAAAAFgAAAH+hAQDrsQEAAAAAANuiAQB7ogEA67EBALuiAQChoQEAFwAAAH+hAQDrsQEAqaEBAPiiAQB7ogEAAAAAALuiAQChoQEAFQAAAH+hAQAAAAAAqaEBABGjAQB7ogEAAAAAAAAAAAChoQEAEQAAAH+hAQAAAAAAqaEBACOjAQA5owEA67EBAAAAAAAAAAAAGgAAAPehAQDrsQEAAAAAAE6jAQA5owEA67EBAAAAAACpoQEAGwAAAPehAQDrsQEAqaEBAGqjAQA5owEAAAAAAAAAAACpoQEAGQAAAPehAQAAAAAAqaEBAIKjAQA5owEAmaMBAAAAAAAAAAAAGAAAAPehAQAAAAAAAAAAAJ+jAQCtowEA67EBAAAAAAAAAAAAHgAAAPehAQDrsQEAAAAAAL+jAQCtowEA67EBAAAAAACpoQEAHwAAAPehAQDrsQEAqaEBANOjAQCtowEAAAAAAAAAAACpoQEAHQAAAPehAQAAAAAAqaEBAOOjAQCtowEAmaMBAAAAAAAAAAAAHAAAAPehAQAAAAAAAAAAAPKjAQDyowEAAAAAAAAAAAAAAAAAIAAAAPmjAQAAAAAAAAAAAAGkAQAMpAEA67EBAAAAAAAAAAAAAgAAAPehAQDrsQEAAAAAABKkAQAMpAEA67EBAAAAAACpoQEAAwAAAPehAQDrsQEAqaEBACOkAQAMpAEAAAAAAAAAAACpoQEAAQAAAPehAQAAAAAAqaEBANqlAQAMpAEAAAAAAAAAAAAAAAAAAAAAAPehAQAAAAAAAAAAADCkAQBKpAEAWaQBAAAAAACpoQEAIQAAAPehAQAAAAAAqaEBAGCkAQBtpAEAAAAAAAAAAAAAAAAAIgAAAPmjAQAAAAAAAAAAAAgAAAAEAAAAAAAAAAoAAAAtAAAAEgAAAAAAAAAAAAAAAAAAAAgAAAD/////AAAAAAAAAAAuAAAAAAAAAAAAAAAAAAAAAAAAAAmnAQDGAAAAD6cBAMEAAAAWpwEAwgAAABynAQDAAAAAI6cBAJEDAAAppwEAxQAAAC+nAQDDAAAANqcBAMQAAAA7pwEAkgMAAECnAQDHAAAAR6cBAKcDAABLpwEAISAAAFKnAQCUAwAAWKcBANAAAABcpwEAyQAAAGOnAQDKAAAAaacBAMgAAABwpwEAlQMAAHinAQCXAwAAfKcBAMsAAACBpwEAkwMAAIenAQDNAAAAjqcBAM4AAACUpwEAzAAAAJunAQCZAwAAoKcBAM8AAAClpwEAmgMAAKunAQCbAwAAsqcBAJwDAAC1pwEA0QAAALynAQCdAwAAv6cBAFIBAADFpwEA0wAAAMynAQDUAAAA0qcBANIAAADZpwEAqQMAAN+nAQCfAwAA56cBANgAAADupwEA1QAAAPWnAQDWAAAA+qcBAKYDAAD+pwEAoAMAAAGoAQAzIAAAB6gBAKgDAAALqAEAoQMAAA+oAQBgAQAAFqgBAKMDAAAcqAEA3gAAACKoAQCkAwAAJqgBAJgDAAAsqAEA2gAAADOoAQDbAAAAOagBANkAAABAqAEApQMAAEioAQDcAAAATagBAJ4DAABQqAEA3QAAAFeoAQB4AQAAXKgBAJYDAABhqAEA4QAAAGioAQDiAAAAbqgBALQAAAB0qAEA5gAAAHqoAQDgAAAAgagBADUhAACJqAEAsQMAAI+oAQAmAAAAk6gBACciAACXqAEAICIAAJuoAQDlAAAAoagBAEgiAACnqAEA4wAAAK6oAQDkAAAAs6gBAB4gAAC5qAEAsgMAAL6oAQCmAAAAxagBACIgAADKqAEAKSIAAM6oAQDnAAAA1agBALgAAADbqAEAogAAAOCoAQDHAwAA5KgBAMYCAADpqAEAYyYAAO+oAQBFIgAA9KgBAKkAAAD5qAEAtSEAAP+oAQAqIgAAA6kBAKQAAAAKqQEA0yEAAA+pAQAgIAAAFqkBAJMhAAAbqQEAsAAAAB+pAQC0AwAAJakBAGYmAAArqQEA9wAAADKpAQDpAAAAOakBAOoAAAA/qQEA6AAAAEapAQAFIgAATKkBAAMgAABRqQEAAiAAAFapAQC1AwAAXqkBAGEiAABkqQEAtwMAAGipAQDwAAAAbKkBAOsAAABxqQEArCAAAHapAQADIgAAfKkBAJIBAACBqQEAACIAAIipAQC9AAAAj6kBALwAAACWqQEAvgAAAJ2pAQBEIAAAo6kBALMDAACpqQEAZSIAAKypAQA+AAAAr6kBANQhAAC0qQEAlCEAALmpAQBlJgAAwKkBACYgAADHqQEA7QAAAM6pAQDuAAAA1KkBAKEAAADaqQEA7AAAAOGpAQARIQAA56kBAB4iAADtqQEAKyIAAPGpAQC5AwAA9qkBAL8AAAD9qQEACCIAAAKqAQDvAAAAB6oBALoDAAANqgEA0CEAABKqAQC7AwAAGaoBACkjAAAeqgEAqwAAACSqAQCQIQAAKaoBAAgjAAAvqgEAHCAAADWqAQBkIgAAOKoBAAojAAA/qgEAFyIAAEaqAQDKJQAASqoBAA4gAABOqgEAOSAAAFWqAQAYIAAAW6oBADwAAABeqgEArwAAAGOqAQAUIAAAaaoBALUAAABvqgEAtwAAAEazAQASIgAAdqoBALwDAAB5qgEAByIAAH+qAQCgAAAAhKoBABMgAACKqgEAYCIAAI2qAQALIgAAkKoBAKwAAACUqgEACSIAAJqqAQCEIgAAn6oBAPEAAACmqgEAvQMAAKmqAQDzAAAAsKoBAPQAAAC2qgEAUwEAALyqAQDyAAAAw6oBAD4gAADJqgEAyQMAAM+qAQC/AwAA16oBAJUiAADdqgEAKCIAAOCqAQCqAAAA5aoBALoAAADqqgEA+AAAAPGqAQD1AAAA+KoBAJciAAD/qgEA9gAAAASrAQC2AAAACasBAAIiAAAOqwEAMCAAABWrAQClIgAAGqsBAMYDAAAeqwEAwAMAACGrAQDWAwAAJasBALEAAAAsqwEAowAAADKrAQAyIAAAOKsBAA8iAAA9qwEAHSIAAEKrAQDIAwAARqsBACIAAABLqwEA0iEAAFCrAQAaIgAAVqsBACojAABbqwEAuwAAAGGrAQCSIQAAZqsBAAkjAABsqwEAHSAAAHKrAQAcIQAAd6sBAK4AAAB7qwEACyMAAIKrAQDBAwAAhqsBAA8gAACKqwEAOiAAAJGrAQAZIAAAl6sBABogAACdqwEAYQEAAKSrAQDFIgAAqasBAKcAAACuqwEArQAAALKrAQDDAwAAuKsBAMIDAAC/qwEAPCIAAMOrAQBgJgAAyqsBAIIiAADOqwEAhiIAANOrAQARIgAA16sBAIMiAADbqwEAuQAAAOCrAQCyAAAA5asBALMAAADqqwEAhyIAAO+rAQDfAAAA9asBAMQDAAD5qwEANCIAAACsAQC4AwAABqwBANEDAAAPrAEACSAAABasAQD+AAAAHKwBANwCAAAirAEA1wAAACisAQAiIQAALqwBANEhAAAzrAEA+gAAADqsAQCRIQAAP6wBAPsAAABFrAEA+QAAAEysAQCoAAAAUKwBANIDAABWrAEAxQMAAF6sAQD8AAAAY6wBABghAABqrAEAvgMAAG2sAQD9AAAAdKwBAKUAAAB4rAEA/wAAAH2sAQC2AwAAgqwBAA0gAACGrAEADCAAAAcAAAAIAAAAAQEAAAgAAAAIAAAAAAAAAAAAAAAvAAAAEwAAAAAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAwAAAAFAAAAAAAAAAAAAAAAAAAAAazAQAJAAAACLMBAAoAAAANswEACgAAABWzAQALAAAAG7MBAAsAAAAkswEADAAAACezAQAMAAAALbMBAA0AAAAyswEADQAAADqzAQAOAAAAP7MBAA4AAABGswEADwAAAEyzAQAPAAAAWLMBABAAAABiAAAAMQAAADIAAAAUAAAAMwAAAGMAAAA0AAAAFQAAADUAAAAIAAAABAAAAP////8AAAAAAAAAABUAAAAAAAAAAAAAAAAAAACjtAEAVV3Jf8l//wCutAEAuy3Uvq7U/wC5tAEAFHf9/cCG/wDEtAEAVV3Jf8l//wDPtAEAuy3Uvq7U/wDatAEAFHf9/cCG/wDltAEAKmb///+Z/wDwtAEAVV3Jf8l//wD7tAEAuy3Uvq7U/wAGtQEAFHf9/cCG/wARtQEAKmb///+Z/wActQEAl62wOGyw/wAntQEAVV3Jf8l//wAytQEAuy3Uvq7U/wA9tQEAFHf9/cCG/wBItQEAKmb///+Z/wBTtQEAl62wOGyw/wBetQEA6Pzw8AJ//wBptQEAVV3Jf8l//wB0tQEAuy3Uvq7U/wB/tQEAFHf9/cCG/wCKtQEAKmb///+Z/wCVtQEAl62wOGyw/wCgtQEA6Pzw8AJ//wCrtQEAEeC/v1sX/wC2tQEAVV3Jf8l//wDBtQEAuy3Uvq7U/wDMtQEAFHf9/cCG/wDXtQEAKmb///+Z/wDitQEAl62wOGyw/wDttQEA6Pzw8AJ//wD4tQEAEeC/v1sX/wADtgEAAABmZmZm/wAOtgEAkxn33uv3/wAYtgEAjkvhnsrh/wAitgEAkby9MYK9/wAstgEAnxD/7/P//wA2tgEAjy7nvdfn/wBAtgEAj3/Wa67W/wBKtgEAk9C1IXG1/wBUtgEAnxD/7/P//wBetgEAjy7nvdfn/wBotgEAj3/Wa67W/wBytgEAkby9MYK9/wB8tgEAlfGcCFGc/wCGtgEAnxD/7/P//wCQtgEAlCvvxtvv/wCatgEAjkvhnsrh/wCktgEAj3/Wa67W/wCutgEAkby9MYK9/wC4tgEAlfGcCFGc/wDCtgEAnxD/7/P//wDMtgEAlCvvxtvv/wDWtgEAjkvhnsrh/wDgtgEAj3/Wa67W/wDqtgEAkKnGQpLG/wD0tgEAk9C1IXG1/wD+tgEAl/GUCEWU/wAItwEAlAj/9/v//wAStwEAkxn33uv3/wActwEAlCvvxtvv/wAmtwEAjkvhnsrh/wAwtwEAj3/Wa67W/wA6twEAkKnGQpLG/wBEtwEAk9C1IXG1/wBOtwEAl/GUCEWU/wBYtwEAlAj/9/v//wBitwEAkxn33uv3/wBstwEAlCvvxtvv/wB2twEAjkvhnsrh/wCAtwEAj3/Wa67W/wCKtwEAkKnGQpLG/wCUtwEAk9C1IXG1/wCetwEAlfGcCFGc/wCotwEAmOtrCDBr/wCytwEAF+9UVDAF/wC8twEAd/88ADww/wDHtwEAF+yMjFEK/wDRtwEAGMK/v4Et/wDbtwEAHXDf38J9/wDltwEAHjT29ujD/wDvtwEAeSbqx+rl/wD5twEAeF/NgM3B/wADuAEAfKWXNZeP/wANuAEAfPxmAWZe/wAXuAEAF+9UVDAF/wAhuAEAfPxmAWZe/wAsuAEAd/88ADww/wA3uAEAF+yMjFEK/wBBuAEAGMK/v4Et/wBLuAEAHXDf38J9/wBVuAEAHjT29ujD/wBfuAEAAAD19fX1/wBpuAEAeSbqx+rl/wBzuAEAeF/NgM3B/wB9uAEAfKWXNZeP/wCHuAEAHIfY2LNl/wCQuAEAAAD19fX1/wCZuAEAe3+0WrSs/wCiuAEAFdempmEa/wCruAEAHXDf38J9/wC0uAEAeF/NgM3B/wC9uAEAef2FAYVx/wDGuAEAFdempmEa/wDPuAEAHXDf38J9/wDYuAEAAAD19fX1/wDhuAEAeF/NgM3B/wDquAEAef2FAYVx/wDzuAEAF+yMjFEK/wD8uAEAHIfY2LNl/wAFuQEAHjT29ujD/wAOuQEAeSbqx+rl/wAXuQEAe3+0WrSs/wAguQEAfPxmAWZe/wApuQEAF+yMjFEK/wAyuQEAHIfY2LNl/wA7uQEAHjT29ujD/wBEuQEAAAD19fX1/wBNuQEAeSbqx+rl/wBWuQEAe3+0WrSs/wBfuQEAfPxmAWZe/wBouQEAF+yMjFEK/wBxuQEAGMK/v4Et/wB6uQEAHXDf38J9/wCDuQEAHjT29ujD/wCMuQEAeSbqx+rl/wCVuQEAeF/NgM3B/wCeuQEAfKWXNZeP/wCnuQEAfPxmAWZe/wCwuQEAF+yMjFEK/wC5uQEAGMK/v4Et/wDCuQEAHXDf38J9/wDLuQEAHjT29ujD/wDUuQEAAAD19fX1/wDduQEAeSbqx+rl/wDmuQEAeF/NgM3B/wDvuQEAfKWXNZeP/wD4uQEAfPxmAWZe/wABugEAhxT55fX5/wAKugEAdUrYmdjJ/wATugEAZ7miLKJf/wAcugEAiA777fj7/wAlugEAfzbisuLi/wAuugEAcXjCZsKk/wA3ugEAYr6LI4tF/wBAugEAiA777fj7/wBJugEAfzbisuLi/wBSugEAcXjCZsKk/wBbugEAZ7miLKJf/wBkugEAZv9tAG0s/wBtugEAiA777fj7/wB2ugEAdyLszOzm/wB/ugEAdUrYmdjJ/wCIugEAcXjCZsKk/wCRugEAZ7miLKJf/wCaugEAZv9tAG0s/wCjugEAiA777fj7/wCsugEAdyLszOzm/wC1ugEAdUrYmdjJ/wC+ugEAcXjCZsKk/wDHugEAaZ+uQa52/wDQugEAYr6LI4tF/wDZugEAZv9YAFgk/wDiugEAhgb99/z9/wDrugEAhxT55fX5/wD0ugEAdyLszOzm/wD9ugEAdUrYmdjJ/wAGuwEAcXjCZsKk/wAPuwEAaZ+uQa52/wAYuwEAYr6LI4tF/wAhuwEAZv9YAFgk/wAquwEAhgb99/z9/wAzuwEAhxT55fX5/wA8uwEAdyLszOzm/wBFuwEAdUrYmdjJ/wBOuwEAcXjCZsKk/wBXuwEAaZ+uQa52/wBguwEAYr6LI4tF/wBpuwEAZv9tAG0s/wByuwEAZf9EAEQb/wB7uwEAkBT04Oz0/wCEuwEAlEbanrza/wCNuwEAxHuniFan/wCWuwEAiA777fj7/wCfuwEAkjXjs83j/wCouwEAokrGjJbG/wCxuwEAypWdiEGd/wC6uwEAiA777fj7/wDDuwEAkjXjs83j/wDMuwEAokrGjJbG/wDVuwEAxHuniFan/wDeuwEA1uGBgQ98/wDnuwEAiA777fj7/wDwuwEAlCvmv9Pm/wD5uwEAlEbanrza/wACvAEAokrGjJbG/wALvAEAxHuniFan/wAUvAEA1uGBgQ98/wAdvAEAiA777fj7/wAmvAEAlCvmv9Pm/wAvvAEAlEbanrza/wA4vAEAokrGjJbG/wBBvAEAvmSxjGux/wBKvAEAypWdiEGd/wBTvAEA1fxubgFr/wBcvAEAhgb99/z9/wBlvAEAkBT04Oz0/wBuvAEAlCvmv9Pm/wB3vAEAlEbanrza/wCAvAEAokrGjJbG/wCJvAEAvmSxjGux/wCSvAEAypWdiEGd/wCbvAEA1fxubgFr/wCkvAEAhgb99/z9/wCtvAEAkBT04Oz0/wC2vAEAlCvmv9Pm/wC/vAEAlEbanrza/wDIvAEAokrGjJbG/wDRvAEAvmSxjGux/wDavAEAypWdiEGd/wDjvAEA1uGBgQ98/wDsvAEA1f9NTQBL/wD1vAEActOeG553/wD/vAEAEvzZ2V8C/wAJvQEArV+zdXCz/wATvQEActOeG553/wAdvQEAEvzZ2V8C/wAnvQEArV+zdXCz/wAxvQEA6dHn5ymK/wA7vQEActOeG553/wBFvQEAEvzZ2V8C/wBPvQEArV+zdXCz/wBZvQEA6dHn5ymK/wBjvQEAPtCmZqYe/wBtvQEActOeG553/wB3vQEAEvzZ2V8C/wCBvQEArV+zdXCz/wCLvQEA6dHn5ymK/wCVvQEAPtCmZqYe/wCfvQEAH/zm5qsC/wCpvQEActOeG553/wCzvQEAEvzZ2V8C/wC9vQEArV+zdXCz/wDHvQEA6dHn5ymK/wDRvQEAPtCmZqYe/wDbvQEAH/zm5qsC/wDlvQEAG9KmpnYd/wDvvQEActOeG553/wD5vQEAEvzZ2V8C/wADvgEArV+zdXCz/wANvgEA6dHn5ymK/wAXvgEAPtCmZqYe/wAhvgEAH/zm5qsC/wArvgEAG9KmpnYd/wA1vgEAAABmZmZm/wA/vgEATBnz4PPb/wBIvgEAXz3dqN21/wBRvgEAjKrKQ6LK/wBavgEAQRH58Pno/wBjvgEAVy7kuuS8/wBsvgEAe2XMe8zE/wB1vgEAjcW+K4y+/wB+vgEAQRH58Pno/wCHvgEAVy7kuuS8/wCQvgEAe2XMe8zE/wCZvgEAjKrKQ6LK/wCivgEAkfOsCGis/wCrvgEAQRH58Pno/wC0vgEATSnrzOvF/wC9vgEAXz3dqN21/wDGvgEAe2XMe8zE/wDPvgEAjKrKQ6LK/wDYvgEAkfOsCGis/wDhvgEAQRH58Pno/wDqvgEATSnrzOvF/wDzvgEAXz3dqN21/wD8vgEAe2XMe8zE/wAFvwEAiaDTTrPT/wAOvwEAjcW+K4y+/wAXvwEAk/KeCFie/wAgvwEAPAz89/zw/wApvwEATBnz4PPb/wAyvwEATSnrzOvF/wA7vwEAXz3dqN21/wBEvwEAe2XMe8zE/wBNvwEAiaDTTrPT/wBWvwEAjcW+K4y+/wBfvwEAk/KeCFie/wBovwEAPAz89/zw/wBxvwEATBnz4PPb/wB6vwEATSnrzOvF/wCDvwEAXz3dqN21/wCMvwEAe2XMe8zE/wCVvwEAiaDTTrPT/wCevwEAjcW+K4y+/wCnvwEAkfOsCGis/wCwvwEAlu+BCECB/wC5vwEAShX15fXg/wDEvwEAUEjZodmb/wDPvwEAYrKjMaNU/wDavwEASQ/47fjp/wDlvwEATjbkuuSz/wDwvwEAVmjEdMR2/wD7vwEAYr6LI4tF/wAGwAEASQ/47fjp/wARwAEATjbkuuSz/wAcwAEAVmjEdMR2/wAnwAEAYrKjMaNU/wAywAEAZv9tAG0s/wA9wAEASQ/47fjp/wBIwAEATSzpx+nA/wBTwAEAUEjZodmb/wBewAEAVmjEdMR2/wBpwAEAYrKjMaNU/wB0wAEAZv9tAG0s/wB/wAEASQ/47fjp/wCKwAEATSzpx+nA/wCVwAEAUEjZodmb/wCgwAEAVmjEdMR2/wCrwAEAYJ6rQatd/wC2wAEAYr6LI4tF/wDBwAEAbP9aAFoy/wDMwAEASAf89/z1/wDXwAEAShX15fXg/wDiwAEATSzpx+nA/wDtwAEAUEjZodmb/wD4wAEAVmjEdMR2/wADwQEAYJ6rQatd/wAOwQEAYr6LI4tF/wAZwQEAbP9aAFoy/wAkwQEASAf89/z1/wAvwQEAShX15fXg/wA6wQEATSzpx+nA/wBFwQEAUEjZodmb/wBQwQEAVmjEdMR2/wBbwQEAYJ6rQatd/wBmwQEAYr6LI4tF/wBxwQEAZv9tAG0s/wB8wQEAZf9EAEQb/wCHwQEAAADw8PDw/wCRwQEAAAC9vb29/wCbwQEAAABjY2Nj/wClwQEAAAD39/f3/wCvwQEAAADMzMzM/wC5wQEAAACWlpaW/wDDwQEAAABSUlJS/wDNwQEAAAD39/f3/wDXwQEAAADMzMzM/wDhwQEAAACWlpaW/wDrwQEAAABjY2Nj/wD1wQEAAAAlJSUl/wD/wQEAAAD39/f3/wAJwgEAAADZ2dnZ/wATwgEAAAC9vb29/wAdwgEAAACWlpaW/wAnwgEAAABjY2Nj/wAxwgEAAAAlJSUl/wA7wgEAAAD39/f3/wBFwgEAAADZ2dnZ/wBPwgEAAAC9vb29/wBZwgEAAACWlpaW/wBjwgEAAABzc3Nz/wBtwgEAAABSUlJS/wB3wgEAAAAlJSUl/wCBwgEAAAD//////wCLwgEAAADw8PDw/wCVwgEAAADZ2dnZ/wCfwgEAAAC9vb29/wCpwgEAAACWlpaW/wCzwgEAAABzc3Nz/wC9wgEAAABSUlJS/wDHwgEAAAAlJSUl/wDRwgEAAAD//////wDbwgEAAADw8PDw/wDlwgEAAADZ2dnZ/wDvwgEAAAC9vb29/wD5wgEAAACWlpaW/wADwwEAAABzc3Nz/wANwwEAAABSUlJS/wAXwwEAAAAlJSUl/wAhwwEAAAAAAAAA/wArwwEAFTD+/ubO/wA3wwEAE5P9/a5r/wBDwwEADvDm5lUN/wBPwwEAEyD+/u3e/wBbwwEAFHj9/b6F/wBnwwEAEcL9/Y08/wBzwwEADf3Z2UcB/wB/wwEAEyD+/u3e/wCLwwEAFHj9/b6F/wCXwwEAEcL9/Y08/wCjwwEADvDm5lUN/wCvwwEADfqmpjYD/wC7wwEAEyD+/u3e/wDHwwEAFVv9/dCi/wDTwwEAE5P9/a5r/wDfwwEAEcL9/Y08/wDrwwEADvDm5lUN/wD3wwEADfqmpjYD/wADxAEAEyD+/u3e/wAPxAEAFVv9/dCi/wAbxAEAE5P9/a5r/wAnxAEAEcL9/Y08/wAzxAEAEOrx8WkT/wA/xAEADf3Z2UgB/wBLxAEADPeMjC0E/wBXxAEAFRT///Xr/wBjxAEAFTD+/ubO/wBvxAEAFVv9/dCi/wB7xAEAE5P9/a5r/wCHxAEAEcL9/Y08/wCTxAEAEOrx8WkT/wCfxAEADf3Z2UgB/wCrxAEADPeMjC0E/wC3xAEAFRT///Xr/wDDxAEAFTD+/ubO/wDPxAEAFVv9/dCi/wDbxAEAE5P9/a5r/wDnxAEAEcL9/Y08/wDzxAEAEOrx8WkT/wD/xAEADf3Z2UgB/wALxQEADfqmpjYD/wAXxQEADPZ/fycE/wAjxQEAGTb+/ujI/wAsxQEAE3n9/buE/wA1xQEABcXj40oz/wA+xQEAGiX+/vDZ/wBHxQEAGHP9/cyK/wBQxQEADaT8/I1Z/wBZxQEAA9rX1zAf/wBixQEAGiX+/vDZ/wBrxQEAGHP9/cyK/wB0xQEADaT8/I1Z/wB9xQEABcXj40oz/wCGxQEAAP+zswAA/wCPxQEAGiX+/vDZ/wCYxQEAGF/9/dSe/wChxQEAE3n9/buE/wCqxQEADaT8/I1Z/wCzxQEABcXj40oz/wC8xQEAAP+zswAA/wDFxQEAGiX+/vDZ/wDOxQEAGF/9/dSe/wDXxQEAE3n9/buE/wDgxQEADaT8/I1Z/wDpxQEAB7Lv72VI/wDyxQEAA9rX1zAf/wD7xQEAAP+ZmQAA/wAExgEAGBL///fs/wANxgEAGTb+/ujI/wAWxgEAGF/9/dSe/wAfxgEAE3n9/buE/wAoxgEADaT8/I1Z/wAxxgEAB7Lv72VI/wA6xgEAA9rX1zAf/wBDxgEAAP+ZmQAA/wBMxgEAGBL///fs/wBVxgEAGTb+/ujI/wBexgEAGF/9/dSe/wBnxgEAE3n9/buE/wBwxgEADaT8/I1Z/wB5xgEAB7Lv72VI/wCCxgEAA9rX1zAf/wCLxgEAAP+zswAA/wCUxgEAAP9/fwAA/wCdxgEAjkTjps7j/wCpxgEAvpmaaj2a/wC2xgEAkNO0H3i0/wDCxgEAQWHfst+K/wDOxgEAUrigM6As/wDaxgEAAGP7+5qZ/wDmxgEA/uHj4xoc/wDyxgEAF4/9/b9v/wD+xgEAFf///38A/wAKxwEAxirWyrLW/wAWxwEAjkTjps7j/wAixwEAvpmaaj2a/wAvxwEAKmb///+Z/wA8xwEAkNO0H3i0/wBIxwEAQWHfst+K/wBUxwEAUrigM6As/wBgxwEAAGP7+5qZ/wBsxwEA/uHj4xoc/wB4xwEAF4/9/b9v/wCExwEAFf///38A/wCQxwEAxirWyrLW/wCcxwEAjkTjps7j/wCoxwEAvpmaaj2a/wC1xwEAKmb///+Z/wDCxwEAD8WxsVko/wDPxwEAkNO0H3i0/wDbxwEAQWHfst+K/wDnxwEAUrigM6As/wDzxwEAAGP7+5qZ/wD/xwEA/uHj4xoc/wALyAEAF4/9/b9v/wAXyAEAFf///38A/wAjyAEAxirWyrLW/wAvyAEAjkTjps7j/wA6yAEAkNO0H3i0/wBFyAEAQWHfst+K/wBQyAEAjkTjps7j/wBbyAEAkNO0H3i0/wBmyAEAQWHfst+K/wBxyAEAUrigM6As/wB8yAEAjkTjps7j/wCHyAEAkNO0H3i0/wCSyAEAQWHfst+K/wCdyAEAUrigM6As/wCoyAEAAGP7+5qZ/wCzyAEAjkTjps7j/wC+yAEAkNO0H3i0/wDJyAEAQWHfst+K/wDUyAEAUrigM6As/wDfyAEAAGP7+5qZ/wDqyAEA/uHj4xoc/wD1yAEAjkTjps7j/wAAyQEAkNO0H3i0/wALyQEAQWHfst+K/wAWyQEAUrigM6As/wAhyQEAAGP7+5qZ/wAsyQEA/uHj4xoc/wA3yQEAF4/9/b9v/wBCyQEAjkTjps7j/wBNyQEAkNO0H3i0/wBYyQEAQWHfst+K/wBjyQEAUrigM6As/wBuyQEAAGP7+5qZ/wB5yQEA/uHj4xoc/wCEyQEAF4/9/b9v/wCPyQEAFf///38A/wCayQEAjkTjps7j/wClyQEAkNO0H3i0/wCwyQEAQWHfst+K/wC7yQEAUrigM6As/wDGyQEAAGP7+5qZ/wDRyQEA/uHj4xoc/wDcyQEAF4/9/b9v/wDnyQEAFf///38A/wDyyQEAxirWyrLW/wD9yQEAA077+7Su/wAJygEAkjXjs83j/wAVygEATSnrzOvF/wAhygEAA077+7Su/wAtygEAkjXjs83j/wA5ygEATSnrzOvF/wBFygEAyhvk3svk/wBRygEAA077+7Su/wBdygEAkjXjs83j/wBpygEATSnrzOvF/wB1ygEAyhvk3svk/wCBygEAGFj+/tmm/wCNygEAA077+7Su/wCZygEAkjXjs83j/wClygEATSnrzOvF/wCxygEAyhvk3svk/wC9ygEAGFj+/tmm/wDJygEAKjL////M/wDVygEAA077+7Su/wDhygEAkjXjs83j/wDtygEATSnrzOvF/wD5ygEAyhvk3svk/wAFywEAGFj+/tmm/wARywEAKjL////M/wAdywEAHCzl5di9/wApywEAA077+7Su/wA1ywEAkjXjs83j/wBBywEATSnrzOvF/wBNywEAyhvk3svk/wBZywEAGFj+/tmm/wBlywEAKjL////M/wBxywEAHCzl5di9/wB9ywEA6SP9/drs/wCJywEAA077+7Su/wCVywEAkjXjs83j/wChywEATSnrzOvF/wCtywEAyhvk3svk/wC5ywEAGFj+/tmm/wDFywEAKjL////M/wDRywEAHCzl5di9/wDdywEA6SP9/drs/wDpywEAAADy8vLy/wD1ywEAbDXis+LN/wABzAEAEVH9/c2s/wANzAEAmx/oy9Xo/wAZzAEAbDXis+LN/wAlzAEAEVH9/c2s/wAxzAEAmx/oy9Xo/wA9zAEA5Cv09Mrk/wBJzAEAbDXis+LN/wBVzAEAEVH9/c2s/wBhzAEAmx/oy9Xo/wBtzAEA5Cv09Mrk/wB5zAEAOC315vXJ/wCFzAEAbDXis+LN/wCRzAEAEVH9/c2s/wCdzAEAmx/oy9Xo/wCpzAEA5Cv09Mrk/wC1zAEAOC315vXJ/wDBzAEAI1H///Ku/wDNzAEAbDXis+LN/wDZzAEAEVH9/c2s/wDlzAEAmx/oy9Xo/wDxzAEA5Cv09Mrk/wD9zAEAOC315vXJ/wAJzQEAI1H///Ku/wAVzQEAGSfx8eLM/wAhzQEAbDXis+LN/wAtzQEAEVH9/c2s/wA5zQEAmx/oy9Xo/wBFzQEA5Cv09Mrk/wBRzQEAOC315vXJ/wBdzQEAI1H///Ku/wBpzQEAGSfx8eLM/wB1zQEAAADMzMzM/wCBzQEA5v2OjgFS/wCLzQEATb9kJ2QZ/wCWzQEA5tzFxRt9/wCgzQEA6Hbe3neu/wCqzQEA5T7x8bba/wC0zQEA6R39/eDv/wC+zQEAOyb15vXQ/wDIzQEAPWfhuOGG/wDSzQEAP6a8f7xB/wDczQEARMWSTZIh/wDmzQEA5v2OjgFS/wDwzQEARMWSTZIh/wD7zQEATb9kJ2QZ/wAGzgEA5tzFxRt9/wAQzgEA6Hbe3neu/wAazgEA5T7x8bba/wAkzgEA6R39/eDv/wAuzgEAAAD39/f3/wA4zgEAOyb15vXQ/wBCzgEAPWfhuOGG/wBMzgEAP6a8f7xB/wBWzgEA50zp6aPJ/wBfzgEAAAD39/f3/wBozgEAP4HXoddq/wBxzgEA5NzQ0ByL/wB6zgEA5T7x8bba/wCDzgEAPWfhuOGG/wCMzgEASMasTawm/wCVzgEA5NzQ0ByL/wCezgEA5T7x8bba/wCnzgEAAAD39/f3/wCwzgEAPWfhuOGG/wC5zgEASMasTawm/wDCzgEA5tzFxRt9/wDLzgEA50zp6aPJ/wDUzgEA6R39/eDv/wDdzgEAOyb15vXQ/wDmzgEAP4HXoddq/wDvzgEARMWSTZIh/wD4zgEA5tzFxRt9/wABzwEA50zp6aPJ/wAKzwEA6R39/eDv/wATzwEAAAD39/f3/wAczwEAOyb15vXQ/wAlzwEAP4HXoddq/wAuzwEARMWSTZIh/wA3zwEA5tzFxRt9/wBAzwEA6Hbe3neu/wBJzwEA5T7x8bba/wBSzwEA6R39/eDv/wBbzwEAOyb15vXQ/wBkzwEAPWfhuOGG/wBtzwEAP6a8f7xB/wB2zwEARMWSTZIh/wB/zwEA5tzFxRt9/wCIzwEA6Hbe3neu/wCRzwEA5T7x8bba/wCazwEA6R39/eDv/wCjzwEAAAD39/f3/wCszwEAOyb15vXQ/wC1zwEAPWfhuOGG/wC+zwEAP6a8f7xB/wDHzwEARMWSTZIh/wDQzwEAzv9LQABL/wDazwEAZf9EAEQb/wDlzwEAzq2DdiqD/wDvzwEAx1ermXCr/wD5zwEAxzPPwqXP/wAD0AEA0hXo59To/wAN0AEATB7w2fDT/wAX0AEAUETbptug/wAh0AEAWHuuWq5h/wAr0AEAYcV4G3g3/wA10AEAzv9LQABL/wA/0AEAYcV4G3g3/wBK0AEAZf9EAEQb/wBV0AEAzq2DdiqD/wBf0AEAx1ermXCr/wBp0AEAxzPPwqXP/wBz0AEA0hXo59To/wB90AEAAAD39/f3/wCH0AEATB7w2fDT/wCR0AEAUETbptug/wCb0AEAWHuuWq5h/wCl0AEAxEbDr43D/wCu0AEAAAD39/f3/wC30AEAUlq/f797/wDA0AEAyaiUezKU/wDJ0AEAxzPPwqXP/wDS0AEAUETbptug/wDb0AEAZv+IAIg3/wDk0AEAyaiUezKU/wDt0AEAxzPPwqXP/wD20AEAAAD39/f3/wD/0AEAUETbptug/wAI0QEAZv+IAIg3/wAR0QEAzq2DdiqD/wAa0QEAxEbDr43D/wAj0QEA0hXo59To/wAs0QEATB7w2fDT/wA10QEAUlq/f797/wA+0QEAYcV4G3g3/wBH0QEAzq2DdiqD/wBQ0QEAxEbDr43D/wBZ0QEA0hXo59To/wBi0QEAAAD39/f3/wBr0QEATB7w2fDT/wB00QEAUlq/f797/wB90QEAYcV4G3g3/wCG0QEAzq2DdiqD/wCP0QEAx1ermXCr/wCY0QEAxzPPwqXP/wCh0QEA0hXo59To/wCq0QEATB7w2fDT/wCz0QEAUETbptug/wC80QEAWHuuWq5h/wDF0QEAYcV4G3g3/wDO0QEAzq2DdiqD/wDX0QEAx1ermXCr/wDg0QEAxzPPwqXP/wDp0QEA0hXo59To/wDy0QEAAAD39/f3/wD70QEATB7w2fDT/wAE0gEAUETbptug/wAN0gEAWHuuWq5h/wAW0gEAYcV4G3g3/wAf0gEAvQvy7Ofy/wAo0gEAlz3bpr3b/wAx0gEAjcW+K4y+/wA60gEAuQj28e72/wBD0gEAmyjhvcnh/wBM0gEAkXDPdKnP/wBV0gEAj/ewBXCw/wBe0gEAuQj28e72/wBn0gEAmyjhvcnh/wBw0gEAkXDPdKnP/wB50gEAjcW+K4y+/wCC0gEAj/eNBFqN/wCL0gEAuQj28e72/wCU0gEAqBjm0NHm/wCd0gEAlz3bpr3b/wCm0gEAkXDPdKnP/wCv0gEAjcW+K4y+/wC40gEAj/eNBFqN/wDB0gEAuQj28e72/wDK0gEAqBjm0NHm/wDT0gEAlz3bpr3b/wDc0gEAkXDPdKnP/wDl0gEAjrfANpDA/wDu0gEAj/ewBXCw/wD30gEAj/h7A057/wAA0wEA6Qj///f7/wAJ0wEAvQvy7Ofy/wAS0wEAqBjm0NHm/wAb0wEAlz3bpr3b/wAk0wEAkXDPdKnP/wAt0wEAjrfANpDA/wA20wEAj/ewBXCw/wA/0wEAj/h7A057/wBI0wEA6Qj///f7/wBR0wEAvQvy7Ofy/wBa0wEAqBjm0NHm/wBj0wEAlz3bpr3b/wBs0wEAkXDPdKnP/wB10wEAjrfANpDA/wB+0wEAj/ewBXCw/wCH0wEAj/eNBFqN/wCQ0wEAj/lYAjhY/wCZ0wEAyA7w7OLw/wCk0wEAlz3bpr3b/wCv0wEAgtCZHJCZ/wC60wEAzwj39u/3/wDF0wEAmyjhvcnh/wDQ0wEAj4DPZ6nP/wDb0wEAgvuKAoGK/wDm0wEAzwj39u/3/wDx0wEAmyjhvcnh/wD80wEAj4DPZ6nP/wAH1AEAgtCZHJCZ/wAS1AEAd/xsAWxZ/wAd1AEAzwj39u/3/wAo1AEAqBjm0NHm/wAz1AEAlz3bpr3b/wA+1AEAj4DPZ6nP/wBJ1AEAgtCZHJCZ/wBU1AEAd/xsAWxZ/wBf1AEAzwj39u/3/wBq1AEAqBjm0NHm/wB11AEAlz3bpr3b/wCA1AEAj4DPZ6nP/wCL1AEAjrfANpDA/wCW1AEAgvuKAoGK/wCh1AEAdvxkAWRQ/wCs1AEA6Qj///f7/wC31AEAyA7w7OLw/wDC1AEAqBjm0NHm/wDN1AEAlz3bpr3b/wDY1AEAj4DPZ6nP/wDj1AEAjrfANpDA/wDu1AEAgvuKAoGK/wD51AEAdvxkAWRQ/wAE1QEA6Qj///f7/wAP1QEAyA7w7OLw/wAa1QEAqBjm0NHm/wAl1QEAlz3bpr3b/wAw1QEAj4DPZ6nP/wA71QEAjrfANpDA/wBG1QEAgvuKAoGK/wBR1QEAd/xsAWxZ/wBc1QEAdftGAUY2/wBn1QEAEu5/fzsI/wBx1QEAw/9LLQBL/wB81QEAFPazs1gG/wCG1QEAFujg4IIU/wCQ1QEAF5v9/bhj/wCa1QEAGEj+/uC2/wCk1QEApRTr2Nrr/wCu1QEAsS/SsqvS/wC41QEAs1SsgHOs/wDC1QEAvbWIVCeI/wDM1QEAEu5/fzsI/wDW1QEAvbWIVCeI/wDh1QEAw/9LLQBL/wDs1QEAFPazs1gG/wD21QEAFujg4IIU/wAA1gEAF5v9/bhj/wAK1gEAGEj+/uC2/wAU1gEAAAD39/f3/wAe1gEApRTr2Nrr/wAo1gEAsS/SsqvS/wAy1gEAs1SsgHOs/wA81gEAF7vx8aNA/wBF1gEAAAD39/f3/wBO1gEAskXDmY7D/wBX1gEAEf3m5mEB/wBg1gEAF5v9/bhj/wBp1gEAsS/SsqvS/wBy1gEAuZuZXjyZ/wB71gEAEf3m5mEB/wCE1gEAF5v9/bhj/wCN1gEAAAD39/f3/wCW1gEAsS/SsqvS/wCf1gEAuZuZXjyZ/wCo1gEAFPazs1gG/wCx1gEAF7vx8aNA/wC61gEAGEj+/uC2/wDD1gEApRTr2Nrr/wDM1gEAskXDmY7D/wDV1gEAvbWIVCeI/wDe1gEAFPazs1gG/wDn1gEAF7vx8aNA/wDw1gEAGEj+/uC2/wD51gEAAAD39/f3/wAC1wEApRTr2Nrr/wAL1wEAskXDmY7D/wAU1wEAvbWIVCeI/wAd1wEAFPazs1gG/wAm1wEAFujg4IIU/wAv1wEAF5v9/bhj/wA41wEAGEj+/uC2/wBB1wEApRTr2Nrr/wBK1wEAsS/SsqvS/wBT1wEAs1SsgHOs/wBc1wEAvbWIVCeI/wBl1wEAFPazs1gG/wBu1wEAFujg4IIU/wB31wEAF5v9/bhj/wCA1wEAGEj+/uC2/wCJ1wEAAAD39/f3/wCS1wEApRTr2Nrr/wCb1wEAsS/SsqvS/wCk1wEAs1SsgHOs/wCt1wEAvbWIVCeI/wC21wEAvA7v5+Hv/wC/1wEA1kPJyZTH/wDI1wEA6t7d3Rx3/wDR1wEAuQj28e72/wDa1wEA0ynY17XY/wDj1wEA5Ivf32Ww/wDs1wEA7+jOzhJW/wD11wEAuQj28e72/wD+1wEA0ynY17XY/wAH2AEA5Ivf32Ww/wAQ2AEA6t7d3Rx3/wAZ2AEA7P+YmABD/wAi2AEAuQj28e72/wAr2AEAzCba1Lna/wA02AEA1kPJyZTH/wA92AEA5Ivf32Ww/wBG2AEA6t7d3Rx3/wBP2AEA7P+YmABD/wBY2AEAuQj28e72/wBh2AEAzCba1Lna/wBq2AEA1kPJyZTH/wBz2AEA5Ivf32Ww/wB82AEA6dHn5ymK/wCF2AEA7+jOzhJW/wCO2AEA7P+RkQA//wCX2AEAwwX59/T5/wCg2AEAvA7v5+Hv/wCp2AEAzCba1Lna/wCy2AEA1kPJyZTH/wC72AEA5Ivf32Ww/wDE2AEA6dHn5ymK/wDN2AEA7+jOzhJW/wDW2AEA7P+RkQA//wDf2AEAwwX59/T5/wDo2AEAvA7v5+Hv/wDx2AEAzCba1Lna/wD62AEA1kPJyZTH/wAD2QEA5Ivf32Ww/wAM2QEA6dHn5ymK/wAV2QEA7+jOzhJW/wAe2QEA7P+YmABD/wAn2QEA8v9nZwAf/wAw2QEAtAj17+31/wA82QEAqCXcvL3c/wBI2QEAsGSxdWux/wBU2QEAtgf38vD3/wBg2QEArRziy8ni/wBs2QEArTrInprI/wB42QEAtoCjalGj/wCE2QEAtgf38vD3/wCQ2QEArRziy8ni/wCc2QEArTrInprI/wCo2QEAsGSxdWux/wC02QEAvLmPVCeP/wDA2QEAtgf38vD3/wDM2QEAqhLr2trr/wDY2QEAqCXcvL3c/wDk2QEArTrInprI/wDw2QEAsGSxdWux/wD82QEAvLmPVCeP/wAI2gEAtgf38vD3/wAU2gEAqhLr2trr/wAg2gEAqCXcvL3c/wAs2gEArTrInprI/wA42gEArFO6gH26/wBE2gEAtoCjalGj/wBQ2gEAvtiGShSG/wBc2gEAvwL9/Pv9/wBo2gEAtAj17+31/wB02gEAqhLr2trr/wCA2gEAqCXcvL3c/wCM2gEArTrInprI/wCY2gEArFO6gH26/wCk2gEAtoCjalGj/wCw2gEAvtiGShSG/wC82gEAvwL9/Pv9/wDI2gEAtAj17+31/wDU2gEAqhLr2trr/wDg2gEAqCXcvL3c/wDs2gEArTrInprI/wD42gEArFO6gH26/wAE2wEAtoCjalGj/wAQ2wEAvLmPVCeP/wAc2wEAv/99PwB9/wAo2wEA8v9nZwAf/wAy2wEAlvFhBTBh/wA92wEA+dyyshgr/wBH2wEABaPW1mBN/wBR2wEADXf09KWC/wBb2wEADzb9/dvH/wBl2wEAjiDw0eXw/wBv2wEAjVfeksXe/wB52wEAj6fDQ5PD/wCD2wEAlM6sIWas/wCN2wEA8v9nZwAf/wCX2wEAlM6sIWas/wCi2wEAlvFhBTBh/wCt2wEA+dyyshgr/wC32wEABaPW1mBN/wDB2wEADXf09KWC/wDL2wEADzb9/dvH/wDV2wEAAAD39/f3/wDf2wEAjiDw0eXw/wDp2wEAjVfeksXe/wDz2wEAj6fDQ5PD/wD92wEADJbv74pi/wAG3AEAAAD39/f3/wAP3AEAj4DPZ6nP/wAY3AEA+P/KygAg/wAh3AEADXf09KWC/wAq3AEAjVfeksXe/wAz3AEAj/ewBXGw/wA83AEA+P/KygAg/wBF3AEADXf09KWC/wBO3AEAAAD39/f3/wBX3AEAjVfeksXe/wBg3AEAj/ewBXGw/wBp3AEA+dyyshgr/wBy3AEADJbv74pi/wB73AEADzb9/dvH/wCE3AEAjiDw0eXw/wCN3AEAj4DPZ6nP/wCW3AEAlM6sIWas/wCf3AEA+dyyshgr/wCo3AEADJbv74pi/wCx3AEADzb9/dvH/wC63AEAAAD39/f3/wDD3AEAjiDw0eXw/wDM3AEAj4DPZ6nP/wDV3AEAlM6sIWas/wDe3AEA+dyyshgr/wDn3AEABaPW1mBN/wDw3AEADXf09KWC/wD53AEADzb9/dvH/wAC3QEAjiDw0eXw/wAL3QEAjVfeksXe/wAU3QEAj6fDQ5PD/wAd3QEAlM6sIWas/wAm3QEA+dyyshgr/wAv3QEABaPW1mBN/wA43QEADXf09KWC/wBB3QEADzb9/dvH/wBK3QEAAAD39/f3/wBT3QEAjiDw0eXw/wBc3QEAjVfeksXe/wBl3QEAj6fDQ5PD/wBu3QEAlM6sIWas/wB33QEA8v9nZwAf/wCB3QEAAAAaGhoa/wCM3QEA+dyyshgr/wCW3QEABaPW1mBN/wCg3QEADXf09KWC/wCq3QEADzb9/dvH/wC03QEAAADg4ODg/wC+3QEAAAC6urq6/wDI3QEAAACHh4eH/wDS3QEAAABNTU1N/wDc3QEA8v9nZwAf/wDm3QEAAABNTU1N/wDx3QEAAAAaGhoa/wD83QEA+dyyshgr/wAG3gEABaPW1mBN/wAQ3gEADXf09KWC/wAa3gEADzb9/dvH/wAk3gEAAAD//////wAu3gEAAADg4ODg/wA43gEAAAC6urq6/wBC3gEAAACHh4eH/wBM3gEADJbv74pi/wBV3gEAAAD//////wBe3gEAAACZmZmZ/wBn3gEA+P/KygAg/wBw3gEADXf09KWC/wB53gEAAAC6urq6/wCC3gEAAABAQEBA/wCL3gEA+P/KygAg/wCU3gEADXf09KWC/wCd3gEAAAD//////wCm3gEAAAC6urq6/wCv3gEAAABAQEBA/wC43gEA+dyyshgr/wDB3gEADJbv74pi/wDK3gEADzb9/dvH/wDT3gEAAADg4ODg/wDc3gEAAACZmZmZ/wDl3gEAAABNTU1N/wDu3gEA+dyyshgr/wD33gEADJbv74pi/wAA3wEADzb9/dvH/wAJ3wEAAAD//////wAS3wEAAADg4ODg/wAb3wEAAACZmZmZ/wAk3wEAAABNTU1N/wAt3wEA+dyyshgr/wA23wEABaPW1mBN/wA/3wEADXf09KWC/wBI3wEADzb9/dvH/wBR3wEAAADg4ODg/wBa3wEAAAC6urq6/wBj3wEAAACHh4eH/wBs3wEAAABNTU1N/wB13wEA+dyyshgr/wB+3wEABaPW1mBN/wCH3wEADXf09KWC/wCQ3wEADzb9/dvH/wCZ3wEAAAD//////wCi3wEAAADg4ODg/wCr3wEAAAC6urq6/wC03wEAAACHh4eH/wC93wEAAABNTU1N/wDG3wEAAyD9/eDd/wDP3wEA9Fz6+p+1/wDY3wEA49zFxRuK/wDh3wEADRz+/uvi/wDq3wEA/Ej7+7S5/wDz3wEA7pP392ih/wD83wEA4P2urgF+/wAF4AEADRz+/uvi/wAO4AEA/Ej7+7S5/wAX4AEA7pP392ih/wAg4AEA49zFxRuK/wAp4AEA1fx6egF3/wAy4AEADRz+/uvi/wA74AEAAzz8/MXA/wBE4AEA9Fz6+p+1/wBN4AEA7pP392ih/wBW4AEA49zFxRuK/wBf4AEA1fx6egF3/wBo4AEADRz+/uvi/wBx4AEAAzz8/MXA/wB64AEA9Fz6+p+1/wCD4AEA7pP392ih/wCM4AEA5sPd3TSX/wCV4AEA4P2urgF+/wCe4AEA1fx6egF3/wCn4AEADgz///fz/wCw4AEAAyD9/eDd/wC54AEAAzz8/MXA/wDC4AEA9Fz6+p+1/wDL4AEA7pP392ih/wDU4AEA5sPd3TSX/wDd4AEA4P2urgF+/wDm4AEA1fx6egF3/wDv4AEADgz///fz/wD44AEAAyD9/eDd/wAB4QEAAzz8/MXA/wAK4QEA9Fz6+p+1/wAT4QEA7pP392ih/wAc4QEA5sPd3TSX/wAl4QEA4P2urgF+/wAu4QEA1fx6egF3/wA34QEAx/9qSQBq/wBA4QEA9f+lpQAm/wBM4QEAp6uVMTaV/wBZ4QEAAtDX1zAn/wBl4QEACrj09G1D/wBx4QEAFJ39/a5h/wB94QEAHm7+/uCQ/wCJ4QEAiBj44PP4/wCV4QEAikPpq9np/wCh4QEAj3HRdK3R/wCt4QEAl520RXW0/wC54QEA9f+lpQAm/wDF4QEAl520RXW0/wDS4QEAp6uVMTaV/wDf4QEAAtDX1zAn/wDr4QEACrj09G1D/wD34QEAFJ39/a5h/wAD4gEAHm7+/uCQ/wAP4gEAKkD///+//wAb4gEAiBj44PP4/wAn4gEAikPpq9np/wAz4gEAj3HRdK3R/wA/4gEADaT8/I1Z/wBK4gEAKkD///+//wBV4gEAj1bbkb/b/wBg4gEA/uHX1xkc/wBr4gEAFJ39/a5h/wB24gEAikPpq9np/wCB4gEAkcG2LHu2/wCM4gEA/uHX1xkc/wCX4gEAFJ39/a5h/wCi4gEAKkD///+//wCt4gEAikPpq9np/wC44gEAkcG2LHu2/wDD4gEAAtDX1zAn/wDO4gEADaT8/I1Z/wDZ4gEAHm7+/uCQ/wDk4gEAiBj44PP4/wDv4gEAj1bbkb/b/wD64gEAl520RXW0/wAF4wEAAtDX1zAn/wAQ4wEADaT8/I1Z/wAb4wEAHm7+/uCQ/wAm4wEAKkD///+//wAx4wEAiBj44PP4/wA84wEAj1bbkb/b/wBH4wEAl520RXW0/wBS4wEAAtDX1zAn/wBd4wEACrj09G1D/wBo4wEAFJ39/a5h/wBz4wEAHm7+/uCQ/wB+4wEAiBj44PP4/wCJ4wEAikPpq9np/wCU4wEAj3HRdK3R/wCf4wEAl520RXW0/wCq4wEAAtDX1zAn/wC14wEACrj09G1D/wDA4wEAFJ39/a5h/wDL4wEAHm7+/uCQ/wDW4wEAKkD///+//wDh4wEAiBj44PP4/wDs4wEAikPpq9np/wD34wEAj3HRdK3R/wAC5AEAl520RXW0/wAN5AEA9f+lpQAm/wAZ5AEAa/9oAGg3/wAm5AEAAtDX1zAn/wAy5AEACrj09G1D/wA+5AEAFJ39/a5h/wBK5AEAH3P+/uCL/wBW5AEAM2rv2e+L/wBi5AEAPoLZptlq/wBu5AEAU3m9Zr1j/wB65AEAZ9OYGphQ/wCG5AEA9f+lpQAm/wCS5AEAZ9OYGphQ/wCf5AEAa/9oAGg3/wCs5AEAAtDX1zAn/wC45AEACrj09G1D/wDE5AEAFJ39/a5h/wDQ5AEAH3P+/uCL/wDc5AEAKkD///+//wDo5AEAM2rv2e+L/wD05AEAPoLZptlq/wAA5QEAU3m9Zr1j/wAM5QEADaT8/I1Z/wAX5QEAKkD///+//wAi5QEAQojPkc9g/wAt5QEA/uHX1xkc/wA45QEAFJ39/a5h/wBD5QEAPoLZptlq/wBO5QEAYtKWGpZB/wBZ5QEA/uHX1xkc/wBk5QEAFJ39/a5h/wBv5QEAKkD///+//wB65QEAPoLZptlq/wCF5QEAYtKWGpZB/wCQ5QEAAtDX1zAn/wCb5QEADaT8/I1Z/wCm5QEAH3P+/uCL/wCx5QEAM2rv2e+L/wC85QEAQojPkc9g/wDH5QEAZ9OYGphQ/wDS5QEAAtDX1zAn/wDd5QEADaT8/I1Z/wDo5QEAH3P+/uCL/wDz5QEAKkD///+//wD+5QEAM2rv2e+L/wAJ5gEAQojPkc9g/wAU5gEAZ9OYGphQ/wAf5gEAAtDX1zAn/wAq5gEACrj09G1D/wA15gEAFJ39/a5h/wBA5gEAH3P+/uCL/wBL5gEAM2rv2e+L/wBW5gEAPoLZptlq/wBh5gEAU3m9Zr1j/wBs5gEAZ9OYGphQ/wB35gEAAtDX1zAn/wCC5gEACrj09G1D/wCN5gEAFJ39/a5h/wCY5gEAH3P+/uCL/wCj5gEAKkD///+//wCu5gEAM2rv2e+L/wC55gEAPoLZptlq/wDE5gEAU3m9Zr1j/wDP5gEAZ9OYGphQ/wDa5gEADSz+/uDS/wDj5gEACYv8/JJy/wDs5gEAAdPe3i0m/wD15gEADSX+/uXZ/wD+5gEAC2z8/K6R/wAH5wEAB7P7+2pK/wAQ5wEA/eDLyxgd/wAZ5wEADSX+/uXZ/wAi5wEAC2z8/K6R/wAr5wEAB7P7+2pK/wA05wEAAdPe3i0m/wA95wEA/eelpQ8V/wBG5wEADSX+/uXZ/wBP5wEADFz8/Luh/wBY5wEACYv8/JJy/wBh5wEAB7P7+2pK/wBq5wEAAdPe3i0m/wBz5wEA/eelpQ8V/wB85wEADSX+/uXZ/wCF5wEADFz8/Luh/wCO5wEACYv8/JJy/wCX5wEAB7P7+2pK/wCg5wEAA9Dv7zss/wCp5wEA/eDLyxgd/wCy5wEA+/+ZmQAN/wC75wEADg////Xw/wDE5wEADSz+/uDS/wDN5wEADFz8/Luh/wDW5wEACYv8/JJy/wDf5wEAB7P7+2pK/wDo5wEAA9Dv7zss/wDx5wEA/eDLyxgd/wD65wEA+/+ZmQAN/wAD6AEADg////Xw/wAM6AEADSz+/uDS/wAV6AEADFz8/Luh/wAe6AEACYv8/JJy/wAn6AEAB7P7+2pK/wAw6AEAA9Dv7zss/wA56AEA/eDLyxgd/wBC6AEA/eelpQ8V/wBL6AEA+f9nZwAN/wBU6AEA/uHk5Boc/wBd6AEAkrK4N364/wBm6AEAU5OvTa9K/wBv6AEA/uHk5Boc/wB46AEAkrK4N364/wCB6AEAU5OvTa9K/wCK6AEAz4SjmE6j/wCT6AEA/uHk5Boc/wCc6AEAkrK4N364/wCl6AEAU5OvTa9K/wCu6AEAz4SjmE6j/wC36AEAFf///38A/wDA6AEA/uHk5Boc/wDJ6AEAkrK4N364/wDS6AEAU5OvTa9K/wDb6AEAz4SjmE6j/wDk6AEAFf///38A/wDt6AEAKsz///8z/wD26AEA/uHk5Boc/wD/6AEAkrK4N364/wAI6QEAU5OvTa9K/wAR6QEAz4SjmE6j/wAa6QEAFf///38A/wAj6QEAKsz///8z/wAs6QEAD8GmplYo/wA16QEA/uHk5Boc/wA+6QEAkrK4N364/wBH6QEAU5OvTa9K/wBQ6QEAz4SjmE6j/wBZ6QEAFf///38A/wBi6QEAKsz///8z/wBr6QEAD8GmplYo/wB06QEA6Hn394G//wB96QEA/uHk5Boc/wCG6QEAkrK4N364/wCP6QEAU5OvTa9K/wCY6QEAz4SjmE6j/wCh6QEAFf///38A/wCq6QEAKsz///8z/wCz6QEAD8GmplYo/wC86QEA6Hn394G//wDF6QEAAACZmZmZ/wDO6QEAcnjCZsKl/wDX6QEAC5v8/I1i/wDg6QEAnE3LjaDL/wDp6QEAcnjCZsKl/wDy6QEAC5v8/I1i/wD76QEAnE3LjaDL/wAE6gEA5Gbn54rD/wAN6gEAcnjCZsKl/wAW6gEAC5v8/I1i/wAf6gEAnE3LjaDL/wAo6gEA5Gbn54rD/wAx6gEAOpvYpthU/wA66gEAcnjCZsKl/wBD6gEAC5v8/I1i/wBM6gEAnE3LjaDL/wBV6gEA5Gbn54rD/wBe6gEAOpvYpthU/wBn6gEAItD//9kv/wBw6gEAcnjCZsKl/wB56gEAC5v8/I1i/wCC6gEAnE3LjaDL/wCL6gEA5Gbn54rD/wCU6gEAOpvYpthU/wCd6gEAItD//9kv/wCm6gEAGVrl5cSU/wCv6gEAcnjCZsKl/wC46gEAC5v8/I1i/wDB6gEAnE3LjaDL/wDK6gEA5Gbn54rD/wDT6gEAOpvYpthU/wDc6gEAItD//9kv/wDl6gEAGVrl5cSU/wDu6gEAAACzs7Oz/wD36gEAeFTTjdPH/wAB6wEA01K9vIC9/wAM6wEAKkz///+z/wAW6wEAryXavrra/wAg6wEABIv7+4By/wAq6wEAkGTTgLHT/wA06wEAFpz9/bRi/wA+6wEAOobes95p/wBI6wEA6S/8/M3l/wBS6wEAAADZ2dnZ/wBc6wEAeFTTjdPH/wBm6wEA01K9vIC9/wBx6wEATSnrzOvF/wB86wEAKkz///+z/wCG6wEAryXavrra/wCQ6wEABIv7+4By/wCa6wEAkGTTgLHT/wCk6wEAFpz9/bRi/wCu6wEAOobes95p/wC46wEA6S/8/M3l/wDC6wEAAADZ2dnZ/wDM6wEAeFTTjdPH/wDW6wEA01K9vIC9/wDh6wEATSnrzOvF/wDs6wEAJZD//+1v/wD36wEAKkz///+z/wAB7AEAryXavrra/wAL7AEABIv7+4By/wAV7AEAkGTTgLHT/wAf7AEAFpz9/bRi/wAp7AEAOobes95p/wAz7AEA6S/8/M3l/wA97AEAAADZ2dnZ/wBH7AEAeFTTjdPH/wBQ7AEAKkz///+z/wBZ7AEAryXavrra/wBi7AEAeFTTjdPH/wBr7AEAKkz///+z/wB07AEAryXavrra/wB97AEABIv7+4By/wCG7AEAeFTTjdPH/wCP7AEAKkz///+z/wCY7AEAryXavrra/wCh7AEABIv7+4By/wCq7AEAkGTTgLHT/wCz7AEAeFTTjdPH/wC87AEAKkz///+z/wDF7AEAryXavrra/wDO7AEABIv7+4By/wDX7AEAkGTTgLHT/wDg7AEAFpz9/bRi/wDp7AEAeFTTjdPH/wDy7AEAKkz///+z/wD77AEAryXavrra/wAE7QEABIv7+4By/wAN7QEAkGTTgLHT/wAW7QEAFpz9/bRi/wAf7QEAOobes95p/wAo7QEAeFTTjdPH/wAx7QEAKkz///+z/wA67QEAryXavrra/wBD7QEABIv7+4By/wBM7QEAkGTTgLHT/wBV7QEAFpz9/bRi/wBe7QEAOobes95p/wBn7QEA6S/8/M3l/wBw7QEAeFTTjdPH/wB57QEAKkz///+z/wCC7QEAryXavrra/wCL7QEABIv7+4By/wCU7QEAkGTTgLHT/wCd7QEAFpz9/bRi/wCm7QEAOobes95p/wCv7QEA6S/8/M3l/wC47QEAAADZ2dnZ/wDB7QEA7f2engFC/wDP7QEAsYKiXk+i/wDe7QEA+rTV1T5P/wDs7QEACrj09G1D/wD67QEAFJ39/a5h/wAI7gEAH3P+/uCL/wAW7gEAMWD15vWY/wAk7gEAT0Hdq92k/wAy7gEAcnjCZsKl/wBA7gEAj7u9Moi9/wBO7gEA7f2engFC/wBc7gEAj7u9Moi9/wBr7gEAsYKiXk+i/wB67gEA+rTV1T5P/wCI7gEACrj09G1D/wCW7gEAFJ39/a5h/wCk7gEAH3P+/uCL/wCy7gEAKkD///+//wDA7gEAMWD15vWY/wDO7gEAT0Hdq92k/wDc7gEAcnjCZsKl/wDq7gEADaT8/I1Z/wD37gEAKkD///+//wAE7wEAUU3VmdWU/wAR7wEA/uHX1xkc/wAe7wEAFJ39/a5h/wAr7wEAT0Hdq92k/wA47wEAj8S6K4O6/wBF7wEA/uHX1xkc/wBS7wEAFJ39/a5h/wBf7wEAKkD///+//wBs7wEAT0Hdq92k/wB57wEAj8S6K4O6/wCG7wEA+rTV1T5P/wCT7wEADaT8/I1Z/wCg7wEAH3P+/uCL/wCt7wEAMWD15vWY/wC67wEAUU3VmdWU/wDH7wEAj7u9Moi9/wDU7wEA+rTV1T5P/wDh7wEADaT8/I1Z/wDu7wEAH3P+/uCL/wD77wEAKkD///+//wAI8AEAMWD15vWY/wAV8AEAUU3VmdWU/wAi8AEAj7u9Moi9/wAv8AEA+rTV1T5P/wA88AEACrj09G1D/wBJ8AEAFJ39/a5h/wBW8AEAH3P+/uCL/wBj8AEAMWD15vWY/wBw8AEAT0Hdq92k/wB98AEAcnjCZsKl/wCK8AEAj7u9Moi9/wCX8AEA+rTV1T5P/wCk8AEACrj09G1D/wCx8AEAFJ39/a5h/wC+8AEAH3P+/uCL/wDL8AEAKkD///+//wDY8AEAMWD15vWY/wDl8AEAT0Hdq92k/wDy8AEAcnjCZsKl/wD/8AEAj7u9Moi9/wAM8QEAkw//8Pj//wAb8QEAGCP6+uvX/wAt8QEAf///AP///wA38QEAcYD/f//U/wBH8QEAfw//8P///wBS8QEAKhr19fXc/wBd8QEAFzr//+TE/wBp8QEAAAAAAAAA/wB08QEAGTH//+vN/wCI8QEAqv//AAD//wCS8QEAwM7iiivi/wCi8QEAAL6lpSoq/wCt8QEAF2Pe3riH/wC88QEAgGegX56g/wDL8QEAP///f/8A/wDb8QEAEdrS0mke/wDq8QEAC6///39Q/wD18QEAmpPtZJXt/wAJ8gEAISL///jc/wAX8gEA9ufc3BQ8/wAk8gEAf///AP///wAu8gEAqv+LAACL/wA88gEAf/+LAIuL/wBK8gEAHu+4uIYL/wBd8gEAAACpqamp/wBr8gEAVf9kAGQA/wB68gEAAACpqamp/wCI8gEAJ269vbdr/wCX8gEA1P+LiwCL/wCo8gEAOo5rVWsv/wC88gEAF////4wA/wDM8gEAxsDMmTLM/wDc8gEAAP+LiwAA/wDp8gEACnnp6ZZ6/wD58gEAVT28j7yP/wAL8wEAr4+LSD2L/wAe8wEAf2dPL09P/wAx8wEAf2dPL09P/wBE8wEAgP/RAM7R/wBX8wEAx//TlADT/wBn8wEA6Ov//xST/wB18wEAiv//AL///wCG8wEAAABpaWlp/wCT8wEAAABpaWlp/wCg8wEAlOH/HpD//wCw8wEAAM6ysiIi/wC/8wEAHA////rw/wDQ8wEAVcCLIosi/wDh8wEA1P///wD//wDu8wEAAADc3Nzc/wD98wEAqgf/+Pj//wAN9AEAI////9cA/wAX9AEAHtna2qUg/wAm9AEAAACAgICA/wAw9AEAVf+AAIAA/wA79AEAO9D/rf8v/wBM9AEAAACAgICA/wBW9AEAVQ//8P/w/wBk9AEA6Zb//2m0/wBx9AEAAIzNzVxc/wCA9AEAwv+CSwCC/wCM9AEAKg/////w/wCX9AEAJmrw8OaM/wCi9AEAqhT65ub6/wCw9AEA8A////D1/wDD9AEAQP/8fPwA/wDS9AEAJjH///rN/wDk9AEAiT/mrdjm/wDz9AEAAHfw8ICA/wAD9QEAfx//4P///wAS9QEAKij6+vrS/wAs9QEAAADT09PT/wA79QEAVWTukO6Q/wBL9QEAAADT09PT/wBa9QEA+En//7bB/wBp9QEADIT//6B6/wB69QEAfdGyILKq/wCN9QEAj3X6h876/wCf9QEAlDiZd4iZ/wCz9QEAlDiZd4iZ/wDH9QEAlzTesMTe/wDb9QEAKh/////g/wDs9QEAVf//AP8A/wD29QEAVcDNMs0y/wAF9gEAFRT6+vDm/wAQ9gEA1P///wD//wAd9gEAAP+AgAAA/wAp9gEAcYDNZs2q/wA/9gEAqv/NAADN/wBP9gEAzJjTulXT/wBh9gEAt3zbk3Db/wBz9gEAZ6mzPLNx/wCH9gEAsI/ue2ju/wCc9gEAb//6APqa/wCz9gEAfafRSNHM/wDI9gEA5OTHxxWF/wDd9gEAqsZwGRlw/wDv9gEAagn/9f/6/wD+9gEABB7//+Th/wAN9wEAGkn//+S1/wAb9wEAGVH//96t/wAs9wEAqv+AAACA/wA29wEAGxf9/fXm/wBD9wEAKv+AgIAA/wBO9wEAOMCOa44j/wBd9wEAG////6UA/wBp9wEAC////0UA/wB49wEA1nva2nDW/wCE9wEAJkju7uiq/wCX9wEAVWT7mPuY/wCm9wEAf0Pur+7u/wC59wEA8Xzb23CT/wDM9wEAGin//+/V/wDc9wEAFEb//9q5/wDr9wEAFLDNzYU//wD19wEA9z///8DL/wD/9wEA1Ebd3aDd/wAJ+AEAhDvmsODm/wAZ+AEA1P+AgACA/wAl+AEAAP///wAA/wAu+AEAAD28vI+P/wA9+AEAn7XhQWnh/wBM+AEAEdyLi0UT/wBd+AEABIr6+oBy/wBp+AEAE5r09KRg/wB5+AEAZ6qLLotX/wCH+AEAERD///Xu/wCV+AEADbegoFIt/wCh+AEAAADAwMDA/wCt+AEAi2zrh87r/wC6+AEAr4/NalrN/wDJ+AEAlDiQcICQ/wDY+AEAlDiQcICQ/wDn+AEAAAX///r6/wDx+AEAav//AP9//wAC+QEAkpu0RoK0/wAR+QEAGFTS0rSM/wAa+QEAf/+AAICA/wAk+QEA1B3Y2L/Y/wAx+QEABrj//2NH/wA9+QEAe7bgQODQ/wBM+QEA1HPu7oLu/wBY+QEAG0T19d6z/wBj+QEAAAD//////wBu+QEAAAD19fX1/wB++QEAKv////8A/wCK+QEAOMDNms0y/wCb+QEALUP89/y5/wCk+QEARFvdrd2O/wCt+QEAYrKjMaNU/wC2+QEAKjL////M/wC/+QEAPlXmwuaZ/wDI+QEAVWTGeMZ5/wDR+QEAY7uEI4RD/wDa+QEAKjL////M/wDj+QEAPlXmwuaZ/wDs+QEAVWTGeMZ5/wD1+QEAYrKjMaNU/wD++QEAa/9oAGg3/wAH+gEAKjL////M/wAQ+gEAN1Hw2fCj/wAZ+gEARFvdrd2O/wAi+gEAVWTGeMZ5/wAr+gEAYrKjMaNU/wA0+gEAa/9oAGg3/wA9+gEAKjL////M/wBG+gEAN1Hw2fCj/wBP+gEARFvdrd2O/wBY+gEAVWTGeMZ5/wBh+gEAYJ6rQatd/wBq+gEAY7uEI4RD/wBz+gEAbP9aAFoy/wB8+gEAKhn////l/wCF+gEALUP89/y5/wCO+gEAN1Hw2fCj/wCX+gEARFvdrd2O/wCg+gEAVWTGeMZ5/wCp+gEAYJ6rQatd/wCy+gEAY7uEI4RD/wC7+gEAbP9aAFoy/wDE+gEAKhn////l/wDN+gEALUP89/y5/wDW+gEAN1Hw2fCj/wDf+gEARFvdrd2O/wDo+gEAVWTGeMZ5/wDx+gEAYJ6rQatd/wD6+gEAY7uEI4RD/wAD+wEAa/9oAGg3/wAM+wEAbv9FAEUp/wAV+wEAMUn47fix/wAg+wEAdWHNf827/wAr+wEAkMK4LH+4/wA2+wEAKjL////M/wBB+wEAY0Laodq0/wBM+wEAhKrEQbbE/wBX+wEAlsuoIl6o/wBi+wEAKjL////M/wBt+wEAY0Laodq0/wB4+wEAhKrEQbbE/wCD+wEAkMK4LH+4/wCO+wEApL+UJTSU/wCZ+wEAKjL////M/wCk+wEARTrpx+m0/wCv+wEAdWHNf827/wC6+wEAhKrEQbbE/wDF+wEAkMK4LH+4/wDQ+wEApL+UJTSU/wDb+wEAKjL////M/wDm+wEARTrpx+m0/wDx+wEAdWHNf827/wD8+wEAhKrEQbbE/wAH/AEAi9jAHZHA/wAS/AEAlsuoIl6o/wAd/AEAnueEDCyE/wAo/AEAKib////Z/wAz/AEAMUn47fix/wA+/AEARTrpx+m0/wBJ/AEAdWHNf827/wBU/AEAhKrEQbbE/wBf/AEAi9jAHZHA/wBq/AEAlsuoIl6o/wB1/AEAnueEDCyE/wCA/AEAKib////Z/wCL/AEAMUn47fix/wCW/AEARTrpx+m0/wCh/AEAdWHNf827/wCs/AEAhKrEQbbE/wC3/AEAi9jAHZHA/wDC/AEAlsuoIl6o/wDN/AEApL+UJTSU/wDY/AEAnudYCB1Y/wDj/AEAJUL///e8/wDu/AEAHK/+/sRP/wD5/AEAEO7Z2V8O/wAE/QEAKir////U/wAP/QEAHHD+/tmO/wAa/QEAFtX+/pkp/wAl/QEAD/zMzEwC/wAw/QEAKir////U/wA7/QEAHHD+/tmO/wBG/QEAFtX+/pkp/wBR/QEAEO7Z2V8O/wBc/QEADfiZmTQE/wBn/QEAKir////U/wBy/QEAH23+/uOR/wB9/QEAHK/+/sRP/wCI/QEAFtX+/pkp/wCT/QEAEO7Z2V8O/wCe/QEADfiZmTQE/wCp/QEAKir////U/wC0/QEAH23+/uOR/wC//QEAHK/+/sRP/wDK/QEAFtX+/pkp/wDV/QEAEuns7HAU/wDg/QEAD/zMzEwC/wDr/QEADPeMjC0E/wD2/QEAKhn////l/wAB/gEAJUL///e8/wAM/gEAH23+/uOR/wAX/gEAHK/+/sRP/wAi/gEAFtX+/pkp/wAt/gEAEuns7HAU/wA4/gEAD/zMzEwC/wBD/gEADPeMjC0E/wBO/gEAKhn////l/wBZ/gEAJUL///e8/wBk/gEAH23+/uOR/wBv/gEAHK/+/sRP/wB6/gEAFtX+/pkp/wCF/gEAEuns7HAU/wCQ/gEAD/zMzEwC/wCb/gEADfiZmTQE/wCm/gEADfBmZiUG/wCx/gEAIl///+2g/wC8/gEAGLL+/rJM/wDH/gEABd3w8Dsg/wDS/gEAKk3///+y/wDd/gEAHaL+/sxc/wDo/gEAEcL9/Y08/wDz/gEA/uHj4xoc/wD+/gEAKk3///+y/wAJ/wEAHaL+/sxc/wAU/wEAEcL9/Y08/wAf/wEABd3w8Dsg/wAq/wEA9v+9vQAm/wA1/wEAKk3///+y/wBA/wEAHoj+/tl2/wBL/wEAGLL+/rJM/wBW/wEAEcL9/Y08/wBh/wEABd3w8Dsg/wBs/wEA9v+9vQAm/wB3/wEAKk3///+y/wCC/wEAHoj+/tl2/wCN/wEAGLL+/rJM/wCY/wEAEcL9/Y08/wCj/wEAB9T8/E4q/wCu/wEA/uHj4xoc/wC5/wEA9f+xsQAm/wDE/wEAKjL////M/wDP/wEAIl///+2g/wDa/wEAHoj+/tl2/wDl/wEAGLL+/rJM/wDw/wEAEcL9/Y08/wD7/wEAB9T8/E4q/wAGAAIA/uHj4xoc/wARAAIA9f+xsQAm/wAcAAIAKjL////M/wAnAAIAIl///+2g/wAyAAIAHoj+/tl2/wA9AAIAGLL+/rJM/wBIAAIAEcL9/Y08/wBTAAIAB9T8/E4q/wBeAAIA/uHj4xoc/wBpAAIA9v+9vQAm/wB0AAIA8v+AgAAm/wB/AAIAkw//8Pj//wCJAAIAGCP6+uvX/wCWAAIAFyT//+/b/wCkAAIAFyTu7t/M/wCyAAIAFyTNzcCw/wDAAAIAGCKLi4N4/wDOAAIAcYD/f//U/wDZAAIAcYD/f//U/wDlAAIAcYDudu7G/wDxAAIAcYDNZs2q/wD9AAIAcYCLRYt0/wAJAQIAfw//8P///wAPAQIAfw//8P///wAWAQIAfw/u4O7u/wAdAQIAfw7Nwc3N/wAkAQIAfw6Lg4uL/wArAQIAKhr19fXc/wAxAQIAFzr//+TE/wA4AQIAFzr//+TE/wBAAQIAFzru7tW3/wBIAQIAFjrNzbee/wBQAQIAFzqLi31r/wBiGAIAAAAAAAAA/wBYAQIAGTH//+vN/wBnAQIAqv//AAD//wBsAQIAqv//AAD//wByAQIAqv/uAADu/wB4AQIAqv/NAADN/wB+AQIAqv+LAACL/wCEAQIAwM7iiivi/wCPAQIAAL6lpSoq/wCVAQIAAL///0BA/wCcAQIAAL/u7js7/wCjAQIAAL/NzTMz/wCqAQIAAL6LiyMj/wCxAQIAF2Pe3riH/wC7AQIAF2T//9Ob/wDGAQIAF2Pu7sWR/wDRAQIAF2PNzap9/wDcAQIAF2OLi3NV/wDnAQIAgGegX56g/wDxAQIAg2f/mPX//wD8AQIAg2bujuXu/wAHAgIAg2fNesXN/wASAgIAg2aLU4aL/wAdAgIAP///f/8A/wAoAgIAP///f/8A/wA0AgIAP//udu4A/wBAAgIAP//NZs0A/wBMAgIAP/+LRYsA/wBYAgIAEdrS0mke/wBiAgIAEdv//38k/wBtAgIAEdvu7nYh/wB4AgIAEdrNzWYd/wCDAgIAEdyLi0UT/wCOAgIAC6///39Q/wCUAgIAB6n//3JW/wCbAgIABqnu7mpQ/wCiAgIABqnNzVtF/wCpAgIABqiLiz4v/wCwAgIAmpPtZJXt/wC/AgIAISL///jc/wDIAgIAISL///jc/wDSAgIAIiPu7ujN/wDcAgIAIiLNzcix/wDmAgIAIyKLi4h4/wDwAgIA9ufc3BQ8/wD4AgIAf///AP///wD9AgIAf///AP///wADAwIAf//uAO7u/wAJAwIAf//NAM3N/wAPAwIAf/+LAIuL/wAVAwIAHu+4uIYL/wAjAwIAHvD//7kP/wAyAwIAHvDu7q0O/wBBAwIAHvDNzZUM/wBQAwIAHvCLi2UI/wBfAwIAVf9kAGQA/wBpAwIAJ269vbdr/wBzAwIAOo5rVWsv/wCCAwIAOo//yv9w/wCSAwIAOo/uvO5o/wCiAwIAOo/Nos1a/wCyAwIAOo+Lbos9/wDCAwIAF////4wA/wDNAwIAFf///38A/wDZAwIAFf/u7nYA/wDlAwIAFf/NzWYA/wDxAwIAFf+Li0UA/wD9AwIAxsDMmTLM/wAIBAIAxsH/vz7//wAUBAIAxsDusjru/wAgBAIAxsDNmjLN/wAsBAIAxsCLaCKL/wA4BAIACnnp6ZZ6/wBDBAIAVT28j7yP/wBQBAIAVT7/wf/B/wBeBAIAVT7utO60/wBsBAIAVT7Nm82b/wB6BAIAVT6LaYtp/wCIBAIAr4+LSD2L/wCWBAIAf2dPL09P/wCkBAIAf2j/l////wCzBAIAf2fuje7u/wDCBAIAf2jNec3N/wDRBAIAf2iLUouL/wDgBAIAf2dPL09P/wDuBAIAgP/RAM7R/wD8BAIAx//TlADT/wAHBQIA6Ov//xST/wAQBQIA6Ov//xST/wAaBQIA6Ovu7hKJ/wAkBQIA6OvNzRB2/wAuBQIA5+yLiwpQ/wA4BQIAiv//AL///wBEBQIAiv//AL///wBRBQIAiv/uALLu/wBeBQIAiv/NAJrN/wBrBQIAiv+LAGiL/wB4BQIAAABpaWlp/wCABQIAAABpaWlp/wCIBQIAlOH/HpD//wCTBQIAlOH/HpD//wCfBQIAlOHuHIbu/wCrBQIAlOHNGHTN/wC3BQIAlOGLEE6L/wDDBQIAAM6ysiIi/wDNBQIAAM///zAw/wDYBQIAAM/u7iws/wDjBQIAAM/NzSYm/wDuBQIAAM+Lixoa/wD5BQIAHA////rw/wAFBgIAVcCLIosi/wARBgIAAADc3Nzc/wAbBgIAqgf/+Pj//wAmBgIAI////9cA/wArBgIAI////9cA/wAxBgIAI//u7skA/wA3BgIAI//Nza0A/wA9BgIAI/+Li3UA/wBDBgIAHtna2qUg/wBNBgIAHtr//8El/wBYBgIAHtru7rQi/wBjBgIAHtrNzZsd/wBuBgIAHtqLi2kU/wB5BgIAAADAwMDA/wB+BgIAAAAAAAAA/wCEBgIAAAADAwMD/wCKBgIAAAAaGhoa/wCRBgIAAAD//////wCZBgIAAAAcHBwc/wCgBgIAAAAfHx8f/wCnBgIAAAAhISEh/wCuBgIAAAAkJCQk/wC1BgIAAAAmJiYm/wC8BgIAAAApKSkp/wDDBgIAAAArKysr/wDKBgIAAAAuLi4u/wDRBgIAAAAwMDAw/wDYBgIAAAAFBQUF/wDeBgIAAAAzMzMz/wDlBgIAAAA2NjY2/wDsBgIAAAA4ODg4/wDzBgIAAAA7Ozs7/wD6BgIAAAA9PT09/wABBwIAAABAQEBA/wAIBwIAAABCQkJC/wAPBwIAAABFRUVF/wAWBwIAAABHR0dH/wAdBwIAAABKSkpK/wAkBwIAAAAICAgI/wAqBwIAAABNTU1N/wAxBwIAAABPT09P/wA4BwIAAABSUlJS/wA/BwIAAABUVFRU/wBGBwIAAABXV1dX/wBNBwIAAABZWVlZ/wBUBwIAAABcXFxc/wBbBwIAAABeXl5e/wBiBwIAAABhYWFh/wBpBwIAAABjY2Nj/wBwBwIAAAAKCgoK/wB2BwIAAABmZmZm/wB9BwIAAABpaWlp/wCEBwIAAABra2tr/wCLBwIAAABubm5u/wCSBwIAAABwcHBw/wCZBwIAAABzc3Nz/wCgBwIAAAB1dXV1/wCnBwIAAAB4eHh4/wCuBwIAAAB6enp6/wC1BwIAAAB9fX19/wC8BwIAAAANDQ0N/wDCBwIAAAB/f39//wDJBwIAAACCgoKC/wDQBwIAAACFhYWF/wDXBwIAAACHh4eH/wDeBwIAAACKioqK/wDlBwIAAACMjIyM/wDsBwIAAACPj4+P/wDzBwIAAACRkZGR/wD6BwIAAACUlJSU/wABCAIAAACWlpaW/wAICAIAAAAPDw8P/wAOCAIAAACZmZmZ/wAVCAIAAACcnJyc/wAcCAIAAACenp6e/wAjCAIAAAChoaGh/wAqCAIAAACjo6Oj/wAxCAIAAACmpqam/wA4CAIAAACoqKio/wA/CAIAAACrq6ur/wBGCAIAAACtra2t/wBNCAIAAACwsLCw/wBUCAIAAAASEhIS/wBaCAIAAACzs7Oz/wBhCAIAAAC1tbW1/wBoCAIAAAC4uLi4/wBvCAIAAAC6urq6/wB2CAIAAAC9vb29/wB9CAIAAAC/v7+//wCECAIAAADCwsLC/wCLCAIAAADExMTE/wCSCAIAAADHx8fH/wCZCAIAAADJycnJ/wCgCAIAAAAUFBQU/wCmCAIAAADMzMzM/wCtCAIAAADPz8/P/wC0CAIAAADR0dHR/wC7CAIAAADU1NTU/wDCCAIAAADW1tbW/wDJCAIAAADZ2dnZ/wDQCAIAAADb29vb/wDXCAIAAADe3t7e/wDeCAIAAADg4ODg/wDlCAIAAADj4+Pj/wDsCAIAAAAXFxcX/wDyCAIAAADl5eXl/wD5CAIAAADo6Ojo/wAACQIAAADr6+vr/wAHCQIAAADt7e3t/wAOCQIAAADw8PDw/wAVCQIAAADy8vLy/wAcCQIAAAD19fX1/wAjCQIAAAD39/f3/wAqCQIAAAD6+vr6/wAxCQIAAAD8/Pz8/wA4CQIAVf//AP8A/wA+CQIAVf//AP8A/wBFCQIAVf/uAO4A/wBMCQIAVf/NAM0A/wBTCQIAVf+LAIsA/wBaCQIAO9D/rf8v/wBmCQIAAADAwMDA/wBrCQIAAAAAAAAA/wBxCQIAAAADAwMD/wB3CQIAAAAaGhoa/wB+CQIAAAD//////wCGCQIAAAAcHBwc/wCNCQIAAAAfHx8f/wCUCQIAAAAhISEh/wCbCQIAAAAkJCQk/wCiCQIAAAAmJiYm/wCpCQIAAAApKSkp/wCwCQIAAAArKysr/wC3CQIAAAAuLi4u/wC+CQIAAAAwMDAw/wDFCQIAAAAFBQUF/wDLCQIAAAAzMzMz/wDSCQIAAAA2NjY2/wDZCQIAAAA4ODg4/wDgCQIAAAA7Ozs7/wDnCQIAAAA9PT09/wDuCQIAAABAQEBA/wD1CQIAAABCQkJC/wD8CQIAAABFRUVF/wADCgIAAABHR0dH/wAKCgIAAABKSkpK/wARCgIAAAAICAgI/wAXCgIAAABNTU1N/wAeCgIAAABPT09P/wAlCgIAAABSUlJS/wAsCgIAAABUVFRU/wAzCgIAAABXV1dX/wA6CgIAAABZWVlZ/wBBCgIAAABcXFxc/wBICgIAAABeXl5e/wBPCgIAAABhYWFh/wBWCgIAAABjY2Nj/wBdCgIAAAAKCgoK/wBjCgIAAABmZmZm/wBqCgIAAABpaWlp/wBxCgIAAABra2tr/wB4CgIAAABubm5u/wB/CgIAAABwcHBw/wCGCgIAAABzc3Nz/wCNCgIAAAB1dXV1/wCUCgIAAAB4eHh4/wCbCgIAAAB6enp6/wCiCgIAAAB9fX19/wCpCgIAAAANDQ0N/wCvCgIAAAB/f39//wC2CgIAAACCgoKC/wC9CgIAAACFhYWF/wDECgIAAACHh4eH/wDLCgIAAACKioqK/wDSCgIAAACMjIyM/wDZCgIAAACPj4+P/wDgCgIAAACRkZGR/wDnCgIAAACUlJSU/wDuCgIAAACWlpaW/wD1CgIAAAAPDw8P/wD7CgIAAACZmZmZ/wACCwIAAACcnJyc/wAJCwIAAACenp6e/wAQCwIAAAChoaGh/wAXCwIAAACjo6Oj/wAeCwIAAACmpqam/wAlCwIAAACoqKio/wAsCwIAAACrq6ur/wAzCwIAAACtra2t/wA6CwIAAACwsLCw/wBBCwIAAAASEhIS/wBHCwIAAACzs7Oz/wBOCwIAAAC1tbW1/wBVCwIAAAC4uLi4/wBcCwIAAAC6urq6/wBjCwIAAAC9vb29/wBqCwIAAAC/v7+//wBxCwIAAADCwsLC/wB4CwIAAADExMTE/wB/CwIAAADHx8fH/wCGCwIAAADJycnJ/wCNCwIAAAAUFBQU/wCTCwIAAADMzMzM/wCaCwIAAADPz8/P/wChCwIAAADR0dHR/wCoCwIAAADU1NTU/wCvCwIAAADW1tbW/wC2CwIAAADZ2dnZ/wC9CwIAAADb29vb/wDECwIAAADe3t7e/wDLCwIAAADg4ODg/wDSCwIAAADj4+Pj/wDZCwIAAAAXFxcX/wDfCwIAAADl5eXl/wDmCwIAAADo6Ojo/wDtCwIAAADr6+vr/wD0CwIAAADt7e3t/wD7CwIAAADw8PDw/wACDAIAAADy8vLy/wAJDAIAAAD19fX1/wAQDAIAAAD39/f3/wAXDAIAAAD6+vr6/wAeDAIAAAD8/Pz8/wAlDAIAVQ//8P/w/wAuDAIAVQ//8P/w/wA4DAIAVQ/u4O7g/wBCDAIAVQ7Nwc3B/wBMDAIAVQ6Lg4uD/wBWDAIA6Zb//2m0/wBeDAIA6pH//260/wBnDAIA643u7mqn/wBwDAIA7IfNzWCQ/wB5DAIA6pSLizpi/wCCDAIAAIzNzVxc/wCMDAIAAJT//2pq/wCXDAIAAJTu7mNj/wCiDAIAAJXNzVVV/wCtDAIAAJSLizo6/wC4DAIAwv+CSwCC/wC/DAIAKgD////+AADFDAIAKg/////w/wDLDAIAKg/////w/wDSDAIAKg/u7u7g/wDZDAIAKg7Nzc3B/wDgDAIAKg6Li4uD/wDnDAIAJmrw8OaM/wDtDAIAJ3D///aP/wD0DAIAJ3Du7uaF/wD7DAIAJ2/NzcZz/wACDQIAJ2+Li4ZO/wAJDQIAqhT65ub6/wASDQIA8A////D1/wAgDQIA8A////D1/wAvDQIA7w/u7uDl/wA+DQIA8A7NzcHF/wBNDQIA7w6Li4OG/wBcDQIAQP/8fPwA/wBmDQIAJjH///rN/wBzDQIAJjH///rN/wCBDQIAJTLu7um//wCPDQIAJjHNzcml/wCdDQIAJzGLi4lw/wCrDQIAiT/mrdjm/wC1DQIAikD/v+///wDADQIAikDust/u/wDLDQIAij/NmsDN/wDWDQIAiUCLaIOL/wDhDQIAAHfw8ICA/wDsDQIAfx//4P///wD2DQIAfx//4P///wABDgIAfx/u0e7u/wAMDgIAfx/NtM3N/wAXDgIAfx+LeouL/wAiDgIAI3Pu7t2C/wAxDgIAI3T//+yL/wBBDgIAI3Pu7tyC/wBRDgIAI3PNzb5w/wBhDgIAI3OLi4FM/wBxDgIAKij6+vrS/wCGDgIAAADT09PT/wCQDgIAAADT09PT/wCaDgIA+En//7bB/wCkDgIA+VH//665/wCvDgIA+FHu7qKt/wC6DgIA+VDNzYyV/wDFDgIA+VCLi19l/wDQDgIADIT//6B6/wDcDgIADIT//6B6/wDpDgIAC4Tu7pVy/wD2DgIADIXNzYFi/wADDwIADIWLi1dC/wAQDwIAfdGyILKq/wAeDwIAj3X6h876/wArDwIAj0//sOL//wA5DwIAj0/upNPu/wBHDwIAjk/NjbbN/wBVDwIAj06LYHuL/wBjDwIAr4//hHD//wByDwIAlDiZd4iZ/wCBDwIAlDiZd4iZ/wCQDwIAlzTesMTe/wCfDwIAlzX/yuH//wCvDwIAlzXuvNLu/wC/DwIAlzXNorXN/wDPDwIAljWLbnuL/wDfDwIAKh/////g/wDrDwIAKh/////g/wD4DwIAKh/u7u7R/wAFEAIAKh/Nzc20/wASEAIAKh+Li4t6/wAfEAIAVcDNMs0y/wApEAIAFRT6+vDm/wAvEAIA1P///wD//wA3EAIA1P///wD//wBAEAIA1P/u7gDu/wBJEAIA1P/NzQDN/wBSEAIA1P+LiwCL/wBbEAIA77mwsDBg/wBiEAIA5Mv//zSz/wBqEAIA5Mvu7jCn/wByEAIA5MzNzSmQ/wB6EAIA5MuLixxi/wCCEAIAcYDNZs2q/wCTEAIAqv/NAADN/wCeEAIAzJjTulXT/wCrEAIAy5n/4Gb//wC5EAIAy5nu0V/u/wDHEAIAy5nNtFLN/wDVEAIAy5qLejeL/wDjEAIAt3zbk3Db/wDwEAIAt33/q4L//wD+EAIAt33un3nu/wAMEQIAt33NiWjN/wAaEQIAt3yLXUeL/wAoEQIAZ6mzPLNx/wA3EQIAsI/ue2ju/wBHEQIAb//6APqa/wBZEQIAfafRSNHM/wBpEQIA5OTHxxWF/wB5EQIAqsZwGRlw/wCGEQIAagn/9f/6/wCQEQIABB7//+Th/wCaEQIABB7//+Th/wClEQIABB7u7tXS/wCwEQIAAx3Nzbe1/wC7EQIABR2Li317/wDGEQIAGkn//+S1/wDPEQIAGVH//96t/wDbEQIAGVH//96t/wDoEQIAGVLu7s+h/wD1EQIAGVLNzbOL/wACEgIAGVKLi3le/wAPEgIAqv+AAACA/wAUEgIAqv+AAACA/wAdEgIAKgD////+AAAiEgIAGxf9/fXm/wAqEgIAOMCOa44j/wA0EgIAOMH/wP8+/wA/EgIAOMDus+46/wBKEgIAOMDNms0y/wBVEgIAOMCLaYsi/wBgEgIAG////6UA/wBnEgIAG////6UA/wBvEgIAG//u7poA/wB3EgIAG//NzYUA/wB/EgIAG/+Li1oA/wCHEgIAC////0UA/wCREgIAC////0UA/wCcEgIAC//u7kAA/wCnEgIAC//NzTcA/wCyEgIAC/+LiyUA/wC9EgIA1nva2nDW/wDEEgIA1nz//4P6/wDMEgIA1nzu7nrp/wDUEgIA1nzNzWnJ/wDcEgIA1XyLi0eJ/wDkEgIAJkju7uiq/wDyEgIAVWT7mPuY/wD8EgIAVWX/mv+a/wAHEwIAVWTukO6Q/wASEwIAVWTNfM18/wAdEwIAVWSLVItU/wAoEwIAf0Pur+7u/wA2EwIAf0T/u////wBFEwIAf0Turu7u/wBUEwIAf0TNls3N/wBjEwIAf0OLZouL/wByEwIA8Xzb23CT/wCAEwIA8X3//4Kr/wCPEwIA8X3u7nmf/wCeEwIA8X3NzWiJ/wCtEwIA8XyLi0dd/wC8EwIAGin//+/V/wDHEwIAFEb//9q5/wDREwIAFEb//9q5/wDcEwIAE0Xu7sut/wDnEwIAE0XNza+V/wDyEwIAFEWLi3dl/wD9EwIAFLDNzYU//wACFAIA9z///8DL/wAHFAIA9Un//7XF/wANFAIA9Unu7qm4/wATFAIA9UrNzZGe/wAZFAIA9UmLi2Ns/wAfFAIA1Ebd3aDd/wAkFAIA1ET//7v//wAqFAIA1ETu7q7u/wAwFAIA1ETNzZbN/wA2FAIA1EOLi2aL/wA8FAIAhDvmsODm/wBHFAIAxN3woCDw/wBOFAIAv8//mzD//wBWFAIAwM/ukSzu/wBeFAIAwM/NfSbN/wBmFAIAwM+LVRqL/wBuFAIAAP///wAA/wByFAIAAP///wAA/wB3FAIAAP/u7gAA/wB8FAIAAP/NzQAA/wCBFAIAAP+LiwAA/wCGFAIAAD28vI+P/wCQFAIAAD7//8HB/wCbFAIAAD7u7rS0/wCmFAIAAD7NzZub/wCxFAIAAD6Li2lp/wC8FAIAn7XhQWnh/wDGFAIAn7f/SHb//wDRFAIAn7fuQ27u/wDcFAIAn7bNOl/N/wDnFAIAn7eLJ0CL/wDyFAIAEdyLi0UT/wD+FAIABIr6+oBy/wAFFQIACZb//4xp/wANFQIACZbu7oJi/wAVFQIACZbNzXBU/wAdFQIACZaLi0w5/wAlFQIAE5r09KRg/wAwFQIAZ6qLLotX/wA5FQIAZ6v/VP+f/wBDFQIAZ6vuTu6U/wBNFQIAZ6vNQ82A/wBXFQIAZ6qLLotX/wBhFQIAERD///Xu/wBqFQIAERD///Xu/wB0FQIAEhHu7uXe/wB+FQIAEhHNzcW//wCIFQIAEhCLi4aC/wCSFQIADbegoFIt/wCZFQIADbj//4JH/wChFQIADbju7nlC/wCpFQIADbjNzWg5/wCxFQIADbmLi0cm/wC5FQIAi2zrh87r/wDBFQIAkHj/h87//wDKFQIAkHjufsDu/wDTFQIAkHjNbKbN/wDcFQIAkXeLSnCL/wDlFQIAr4/NalrN/wDvFQIAr5D/g2///wD6FQIAr5Duemfu/wAFFgIAr5DNaVnN/wAQFgIAr5CLRzyL/wAbFgIAlDiQcICQ/wAlFgIAlTj/xuL//wAwFgIAlTjuudPu/wA7FgIAlDnNn7bN/wBGFgIAlTiLbHuL/wBRFgIAlDiQcICQ/wBbFgIAAAX///r6/wBgFgIAAAX///r6/wBmFgIAAAXu7unp/wBsFgIAAATNzcnJ/wByFgIAAAOLi4mJ/wB4FgIAav//AP9//wCEFgIAav//AP9//wCRFgIAav/uAO52/wCeFgIAav/NAM1m/wCrFgIAav+LAItF/wC4FgIAkpu0RoK0/wDCFgIAkpz/Y7j//wDNFgIAkpzuXKzu/wDYFgIAkpzNT5TN/wDjFgIAk5uLNmSL/wDuFgIAGFTS0rSM/wDyFgIAFLD//6VP/wD3FgIAFLDu7ppJ/wD8FgIAFLDNzYU//wABFwIAFLCLi1or/wAGFwIA1B3Y2L/Y/wAOFwIA1B7//+H//wAXFwIA1B7u7tLu/wAgFwIA1B3NzbXN/wApFwIA1B2Li3uL/wAyFwIABrj//2NH/wA5FwIABrj//2NH/wBBFwIABrju7lxC/wBJFwIABrjNzU85/wBRFwIABrmLizYm/wCjGAIAKgD////+AABZFwIAe7bgQODQ/wBjFwIAgf//APX//wBuFwIAgf/uAOXu/wB5FwIAgf/NAMXN/wCEFwIAgf+LAIaL/wCPFwIA1HPu7oLu/wCWFwIA49fQ0CCQ/wCgFwIA68H//z6W/wCrFwIA68Du7jqM/wC2FwIA68DNzTJ4/wDBFwIA68CLiyJS/wDMFwIAG0T19d6z/wDSFwIAG0X//+e6/wDZFwIAG0Tu7tiu/wDgFwIAG0TNzbqW/wDnFwIAG0OLi35m/wDuFwIAAAD//////wD0FwIAAAD19fX1/wD/FwIAKv////8A/wAGGAIAKv////8A/wAOGAIAKv/u7u4A/wAWGAIAKv/Nzc0A/wAeGAIAKv+Li4sA/wAmGAIAOMDNms0y/wCaHAIAfywCALYYAgC4GAIAuhgCALwYAgC+GAIAwBgCAMIYAgDEGAIAxhgCAMkYAgDMGAIAzxgCANIYAgDVGAIA2BgCANsYAgDeGAIA4RgCAOQYAgAAAAAABAAAAAQAAAALAAAANgAAABYAAAAAAAAAAAAAAAAAAAAIAAAAEAAAABgAAAAAAAAAAAAAABcAAAAAAAAAAAAAAAAAAAAIAAAAEAAAABgAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAANwAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAADGJQIACQAAAMwlAgAKAAAA1SUCAAsAAAAXJgIADAAAAB0mAgANAAAAIiYCAA4AAADVJQIADwAAAKomAgAQAAAAsSYCABEAAAC5JgIAEgAAAMAmAgATAAAAzCYCABQAAAAXJgIAFQAAANgmAgAWAAAA4CYCABcAAADqJgIAGAAAAPgmAgAZAAAA/yYCABoAAAAEJwIAGwAAAAcnAgAcAAAADCcCAB0AAAAUJwIAHgAAABonAgAfAAAAICcCACAAAAAnJwIAIQAAAC0nAgAhAAAANScCACIAAAA8JwIAIwAAANUlAgAkAAAAsSYCABEAAAC5JgIAEgAAADMpAgAlAAAAwCYCABMAAADMJgIAFAAAABcmAgAVAAAAPikCACYAAADgJgIAFwAAAOomAgAYAAAA+CYCABkAAAD/JgIAGgAAAAQnAgAbAAAABycCABwAAABGKQIAJwAAABQnAgAeAAAAGicCAB8AAAAgJwIAIAAAACcnAgAhAAAALScCACEAAAA1JwIAIgAAADwnAgAjAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwWHBwcHBwcHBwcHBYcGhwcFhwcHBwcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAABP7//4f+//8HAAAAAAAAAAD//3////9///////////N//v3//////3///////////w/g/////zH8////AAAAAAAAAP//////////////AQD4AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQNf///v/////f39U/f8PAP7f///////////+3/////8DAP///////58Z////zz8DAAAAAAAA/v///38C/v///38AAAAAAAAAAAD///8HBwAAAAAA/v//B/4HAAAAAP7//////////3z/fy8AYAAAAOD///////8jAAAA/wMAAADgn/n///3FAwAAALADAAMA4If5///9bQMAAABeAAAcAOCv+////e0jAAAAAAEAAADgn/n///3NIwAAALADAAAA4Mc91hjHvwMAAAAAAAAAAODf/f///e8DAAAAAAMAAADg3/3///3vAwAAAEADAAAA4N/9///9/wMAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAD+/////38NAD8AAAAAAAAAliXw/q5sDSAfAAAAAAAAAAAAAAAAAAAA//7///8DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////PwD/////fwDt2gcAAAAAUAFQMYKrYiwAAAAAQADJgPUHAAAAAAgBAv////////////////////////8P//////////////8D//8/P/////8/P/+q////P////////99f3B/PD/8f3B8AAAAAQEwAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAIAAAAD+AwAA/v///////////x8A/v////////////8H4P////8fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////z8AAAAAAAAAAAAAAP//////////////////////////DwAAAAAAAAAAAAAAAAAAAABg/wf+//+H/v//BwAAAAAAAIAA//9/////f/////8AAAAAAAAA//////////////8BAPgDAAMAAAAAAP//////////PwAAAAMAAADA1///+/////9/f1T9/w8A/t////////////7f/////3sA////////nxn////PPwMAAAAAAAD+////fwL+////fwD+//v//7sWAP///wcHAAAAAAD+//8H//8HAP8D////////////fP9/7///Pf8D7v////////P/Px7/z/8AAO6f+f///cXTnzmAsM//AwDkh/n///1t04c5AF7A/x8A7q/7///97fO/OwAAwf8AAO6f+f///c3zjznAsMP/AADsxz3WGMe/w8c9gACA/wAA7t/9///978PfPWAAw/8AAOzf/f///e/D3z1gQMP/AADs3/3///3/w889gADD/wAAAAAAAAAAAAAAAAAAAAAAAP7/////f/8H/3//AwAAAACWJfD+rmz/O18//wMAAAAAAAAAA/8DoML//v///wP+/98Pv/7/P/4CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8fAgAAAKAAAAD+/z4A/v///////////x9m/v////////////93GQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAGAAAABwAAAAEAAAABAAAAAAAAAAAAAAAAFQoAABUAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUGBgYGBgYGBgYGBgYGBgYGBwcHBwcAAAAAAAAAAAABASsAAAAsAAAALQAAAC4AAAAvAAAALQAAADAAAAAxAAAAMgAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAoAAAAKQAAACAAAAAqAAAADAAAABkAAAAhAAAABgAAAAcAAAABAAAAAQAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkWEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBgYGBgYGBgYGBgYGBgYGBgcHBwcHAAAAAAAAAAAAAQErAAAALAAAAC0AAAAuAAAALwAAAC0AAAAwAAAAMQAAADIAAAAA3QAAYOYAANjkAADM5wAAzOcAADjpAADY5AAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAIAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAAzAAAANAAAACkAAAA1AAAADQAAABoAAAAqAAAACQAAAAoAAAACAAAAAAAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkWEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcFhwcHBwcHBwcHBwWHBocHBYcHBwcHBYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAANgAAADcAAAAyAAAAOAAAAA4AAAAbAAAAMwAAAAsAAAAMAAAAAgAAAAABAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFhICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAz40BALIzAgBTjgEAuzMCAMIzAgDLMwIAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAGAAAABwAAAAEAAAABAAAAAAAAAAAAAAAAFQoAABUAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUGBgYGBgYGBgYGBgYGBgYGBwcHBwcAAAAAAAAAAAABASsAAAAsAAAALQAAAC4AAAAvAAAALQAAADAAAAAxAAAAMgAAAETsAACw7QAAHO8AAIjwAACI8AAA9PEAABzvAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAKAAAACkAAAAgAAAAKgAAAAwAAAAZAAAAIQAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFxICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAIAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAoAAAAKQAAACAAAAAqAAAADAAAABkAAAAhAAAABgAAAAcAAAABAAAAAQAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkXEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBgYGBgYGBgYGBgYGBgYGBgcHBwcHAAAAAAAAAAAAAQErAAAALAAAAC0AAAAuAAAALwAAAC0AAAAwAAAAMQAAADIAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAMwAAADQAAAApAAAANQAAAA0AAAAaAAAAKgAAAAkAAAAKAAAAAgAAAAAAAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFxICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADYAAAA3AAAAMgAAADgAAAAOAAAAGwAAADMAAAALAAAADAAAAAIAAAAAAQAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwWHBwcHBwcHBwcHBYcGhwcFhwcHBwcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF00AgBjNAIAZjQCAGw0AgAGNAIAczQCAHw0AgCENAIAnPMAABQAAABDLlVURi04AAAAAAAAAAAAAAAAAN4SBJUAAAAA////////////////AgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADAFAAAwBUAAMAWAADAFwAAwBgAAMAZAADAGgAAwBsAAMAcAADAHQAAwB4AAMAfAADAAAAAswEAAMMCAADDAwAAwwQAAMMFAADDBgAAwwcAAMMIAADDCQAAwwoAAMMLAADDDAAAww0AANMOAADDDwAAwwAADLsBAAzDAgAMwwMADMMEAAzTgPQAAAkAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAQAAAA/PkCAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9QAABQAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAABAAAAAE/gIAAAQAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACv////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD1AACE9QAABQAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABAAAAAMAgMAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmOgCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAABAAAAAQAAAAGAAAAg/miAERObgD8KRUA0VcnAN009QBi28AAPJmVAEGQQwBjUf4Au96rALdhxQA6biQA0k1CAEkG4AAJ6i4AHJLRAOsd/gApsRwA6D6nAPU1ggBEuy4AnOmEALQmcABBfl8A1pE5AFODOQCc9DkAi1+EACj5vQD4HzsA3v+XAA+YBQARL+8AClqLAG0fbQDPfjYACcsnAEZPtwCeZj8ALepfALondQDl68cAPXvxAPc5BwCSUooA+2vqAB+xXwAIXY0AMANWAHv8RgDwq2sAILzPADb0mgDjqR0AXmGRAAgb5gCFmWUAoBRfAI1AaACA2P8AJ3NNAAYGMQDKVhUAyahzAHviYABrjMAAIAAAAAkAAAAKAAAADQAAAAsAAAAMAAAAhQAAAAAgAAABIAAAAiAAAAMgAAAEIAAABSAAAAYgAAAIIAAACSAAAAogAAAoIAAAKSAAAF8gAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAZAAAAOgDAAAQJwAAoIYBAEBCDwCAlpgAAOH1BV9wiQD/CS8PdAAAAP1XAgBuAAAA/1cCAHIAAAABWAIAZgAAAANYAgBhAAAABVgCAGUAAAAHWAIAdwAAAAlYAgBXAAAAFlgCAHMAAAAkWAIAUwAAADBYAgBkAAAAPVgCAEQAAABJWAIAAAAAAAAAAAAAAAAAAAAEAAQAGwAbACAAIAAjACEACgACABYACQAhACEAIQAVABwAAQAUABQAFAAUABQAFAAUAAgABAAFABsAAgAXABsAIAAfAB4AHQAJABMAAAAVABIAFQADAAcAFQAVABQAFAAUABQAFAAUABQAFAAIAAQABQAFAAYAGwAaABgAGQAgAAcAFQAUABQAFAAUABQAFAALABQADQAUAAwAFAAUABQADgAUABQAFAAQABQADwAUABEAAAAAAAAArgAuAC8AMwA1ADAANwCqANsA2wDbANsAAAA9AIcANwA3ANsA2wAAACgANQAuADIALwBiAAAAAABHAAAAAADbAFEAAADbANsA2wAAANsAhABVANsAggDbAAAAgQDbAAAAPgBCAEEASABEAFIAWwAAAAAAXgBfANsAAADbANsA2wAAAAAAewBJAFcAUgBaAFoAXQAAAF8AAABfAAAAZQBdAF8AAABdAG4AagAAAGkAAABuAAAA2wCTAJoAoQCoAKsAcACxALgAvwDGAM0A0wAAAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAMABAAHAAMABAAFAAUABgAGAAgABwAHABEAFgASABEAEgAIAAgADwAPABcADwAYAA8AGQAaABoAHgAWADQAHgAFADIABgAiACIAMwAXABgANQAZABoAGgAqADYAKgA0ADcAMgBFADsAPAAzADsAPABGADUARwBIAEwANgAiAEkASgA3AEUATgBQAGIAUQBSAFQARgBHAFUASABMAFYASQBKAFgAWgBOAEQAUABRAFIAVAA4AC8ALABVACkAVgAbABAAWABaAF0AXQBdAF0AXQBdAF0AXgBeAF4AXgBeAF4AXgBfAF8AXwBfAF8AXwBfAGAACQBgAGAAYABgAGAAYQBhAGMAAgBjAGMAYwBjAGMAZAAAAGQAAABkAGQAZABlAAAAZQBlAGUAZQBlAGYAZgAAAGYAZgBmAGYAZwAAAGcAZwBnAGcAaAAAAGgAaABoAGgAaABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAAXAABAF0AXQBeAF4AXwBfAFwAXABcAFwAXABgAFwAXABcAGEAXABcAGIAYgBiAGIAYgBiAGIAYwBkAGUAZgBmAFwAXABnAFwAXABcAGAAXABcAGEAXABhAFwAaABhAFwAYgBiAGIAYgBiAGIAYgBiAGMAZABlAGUAXABmAFwAXABcAGcAaABhAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgAAAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAACgALAAwADQAOAAoADwAQABEAEgATAAoAFAAVABUAFQAWABcAFQAYABUAFQAZABUAFQAVABoAFQAVAAoAFQAVABUAFgAXABgAFQAVABkAFQAVABUAGgAVABUAFQAVABsADAAMACQAHgAeACAAIQAgACEAJAAlACYALQAyAC8ALgAqACUAJgAoACkAMwAqADQAKwA1ADYANwA8ADIARwA9ACIARQAiAD8AQABGADMANABIADUANgA3AC8ASQAqAEcASgBFAEwAXAA8AEYAXAA9AE0ASABOAE8AUgBJAEEAUABRAEoATABTAFQAMQBVAFYAVwBNAE4AWABPAFIAWQBQAFEAWgBbAFMARABUAFUAVgBXAEsARAAsAFgALABZADgALABaAFsAHQAdAB0AHQAdAB0AHQAfAB8AHwAfAB8AHwAfACMAIwAjACMAIwAjACMAJwBcACcAJwAnACcAJwAwADAAOQAcADkAOQA5ADkAOQA6AFwAOgBcADoAOgA6ADsAXAA7ADsAOwA7ADsAPgA+AFwAPgA+AD4APgBCAFwAQgBCAEIAQgBDAFwAQwBDAEMAQwBDAAkAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwACACu/9EACgCu/67/CwCu/67/rv+u/67/rv+u/67/BQDRAK7/0QDRANEA0QDRANEA0QDRAK7/+/+u/w4A7P+u/67/rv+u/9EA0QDRANEA0QANACUADABCABAAUAATAG0AewAUAJgADwCmAMMArv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/FwCu/3cArv8HAC4Arv8mAK7/FwARACMArv8NAK7/rv+u/67/OgCu/67/NQCu/67/rv8oAK7/BwCu/zsARQCu/0gArv+u/67/rv+u/67/rv/8/+gA9v///xoAAAAnAAEAMgCu/67/AgAkAAMALwCu/67/rv+u/67//v+UAK7/CQAbAK7/vP+u/67/r/+u/67/rv+u/67/rv+u/wAAAAAAAG3m7N4FAAsASQAxAVMAfwEwAWkAeAH/AIEBUwKCAYMBhAGFAYYBVAKHAYgBiQFWAooBVwKLAYwBjgHdAY8BWQKQAVsCkQGSAZMBYAKUAWMClgFpApcBaAKYAZkBnAFvAp0BcgKfAXUCpgGAAqcBqAGpAYMCrAGtAa4BiAKvAbABsQGKArIBiwK3AZICuAG5AbwBvQHEAcYBxAHFAcUBxgHHAckBxwHIAcgByQHKAcwBygHLAcsBzAHxAfMB8QHyAfIB8wH0AfUB9gGVAfcBvwEgAp4BhgOsA4gDrQOJA64DigOvA4wDzAOOA80DjwPOA5kDRQOZA74fowPCA/cD+AP6A/sDYB6bHp4e3wBZH1EfWx9TH10fVR9fH1cfvB+zH8wfwx/sH+Uf/B/zHzoCZSw7AjwCPQKaAT4CZixBAkICQwKAAUQCiQJFAowC9AO4A/kD8gP9A3sD/gN8A/8DfQPABM8EJiHJAyohawArIeUAMiFOIYMhhCFgLGEsYixrAmMsfR1kLH0CbSxRAm4scQJvLFACcCxSAnIscyx1LHYsfiw/An8sQALyLPMsfad5HYunjKeNp2UCqqdmAscQJy3NEC0tdgN3A5wDtQCSA9ADmAPRA6YD1QOgA9YDmgPwA6ED8QOVA/UDzwPXAwAAAABBACAawAAgHwABAS8yAQEFOQEBD0oBAS15AQEFcAMBA5EDIBGjAyAJAARQEBAEICBgBAEhigQBNcEEAQ3QBAE/FAUBEzEFMCagAQEFswEBA80BAQ/eAQER+AEBJyICARHYAwEXAB4BlaAeAV8IH/gIGB/4Bigf+Ag4H/gISB/4Bmgf+AiIH/gImB/4CKgf+Ai4H/gCuh+2AsgfqgTYH/gC2h+cAugf+ALqH5AC+B+AAvofggJGAgEJEAUBA2AhEBAALDAvZywBBYAsAWPrLAEDQKYBLYCmARcipwENMqcBPXmnAQN+pwEJkKcBA6CnAQkh/yAaAAAAAHsgdmFyIHBhdGggPSBQb2ludGVyX3N0cmluZ2lmeSgkMCk7IHZhciBkYXRhID0gUG9pbnRlcl9zdHJpbmdpZnkoJDEpOyBGUy5jcmVhdGVQYXRoKCIvIiwgUEFUSC5kaXJuYW1lKHBhdGgpKTsgRlMud3JpdGVGaWxlKFBBVEguam9pbigiLyIsIHBhdGgpLCBkYXRhKTsgfQBjb3JlAHhkb3R2ZXJzaW9uADEuNwAxLjQAMS4yAF9sZHJhd18AX2hkcmF3XwBfdGRyYXdfAF9obGRyYXdfAF90bGRyYXdfAHhkb3QgdmVyc2lvbiAiJXMiIHRvbyBsb25nACAlZCAAJS4wMmYAJXMlZCAtACMlMDJ4JTAyeCUwMnglMDJ4AHNldGxpbmV3aWR0aCgAJS4zZgBTIABDIAAyIABFIABlIABGIAB0ICV1IABUIABkb3Q6ZG90AGd2OmRvdABjYW5vbjpkb3QAcGxhaW46ZG90AHBsYWluLWV4dDpkb3QAeGRvdDp4ZG90AHhkb3QxLjI6eGRvdAB4ZG90MS40Onhkb3QASSAAIl9zdWJncmFwaF9jbnQiOiAlZAAiX2d2aWQiOiAlZAAiZWRnZXMiOiBbCgAiX2d2aWQiOiAlZCwKACJ0YWlsIjogJWQsCgAiaGVhZCI6ICVkACJvYmplY3RzIjogWwoAIm5vZGVzIjogWwoAIm5hbWUiOiAiJXMiAFwiAFwvAFxiAFxmAFxuAFxyAFx0ACJzdWJncmFwaHMiOiBbCgAiJXMiOiAAIiVzIgBDb3VsZCBub3QgcGFyc2UgeGRvdCAiJXMiCgBbCgAib3AiOiAiJWMiLAoAInJlY3QiOiBbJS4wM2YsJS4wM2YsJS4wM2YsJS4wM2ZdCgAib3AiOiAiTCIsCgAib3AiOiAiVCIsCgAicHQiOiBbJS4wM2YsJS4wM2ZdLAoAImFsaWduIjogIiVjIiwKACJ3aWR0aCI6ICUuMDNmLAoAInRleHQiOiAiJXMiCgAiZ3JhZCI6ICJub25lIiwKACJjb2xvciI6ICIlcyIKACJncmFkIjogImxpbmVhciIsCgAiZ3JhZCI6ICJyYWRpYWwiLAoAIm9wIjogIkYiLAoAInNpemUiOiAlLjAzZiwKACJmYWNlIjogIiVzIgoAIm9wIjogIlMiLAoAInN0eWxlIjogIiVzIgoAIm9wIjogInQiLAoAImZvbnRjaGFyIjogJWQKACJwMCI6IFslLjAzZiwlLjAzZiwlLjAzZl0sCgAicDEiOiBbJS4wM2YsJS4wM2YsJS4wM2ZdLAoAInN0b3BzIjogWwB7ImZyYWMiOiAlLjAzZiwgImNvbG9yIjogIiVzIn0AXQoAInAwIjogWyUuMDNmLCUuMDNmXSwKACJwMSI6IFslLjAzZiwlLjAzZl0sCgAicG9pbnRzIjogWwBbJS4wM2YsJS4wM2ZdAGRyYXdfAGxkcmF3XwBoZHJhd18AdGRyYXdfAGhsZHJhd18AdGxkcmF3XwAiZGlyZWN0ZWQiOiAlcywKACJzdHJpY3QiOiAlcwBEdXBsaWNhdGUgY2x1c3RlciBuYW1lICIlcyIKAHhkb3QAanNvbgBqc29uMABkb3RfanNvbgB4ZG90X2pzb24AanNvbjpqc29uAGpzb24wOmpzb24AZG90X2pzb246anNvbgB4ZG90X2pzb246anNvbgBuID49IDQAZ3ZyZW5kZXJfY29yZV9maWcuYwBmaWdfYmV6aWVyAGZpZ19yZXNvbHZlX2NvbG9yAGZpZwBmaWc6ZmlnAG1hcAByZWN0ICVzICVkLCVkICVkLCVkCgBjaXJjbGUgJXMgJWQsJWQsJWQKAHBvbHkgJXMAICVkLCVkAGd2cmVuZGVyX2NvcmVfbWFwLmMAbWFwX291dHB1dF9zaGFwZQByZWN0YW5nbGUgKCVkLCVkKSAoJWQsJWQpICVzICVzCgA8YXJlYSBzaGFwZT0iY2lyY2xlIgA8YXJlYSBzaGFwZT0icmVjdCIAPGFyZWEgc2hhcGU9InBvbHkiACBocmVmPSIAIHRpdGxlPSIAIGFsdD0iIgAgY29vcmRzPSIAJWQsJWQsJWQAJWQsJWQsJWQsJWQAJWQsJWQALCVkLCVkACI+CgA8L21hcD4KAGJhc2UgcmVmZXJlcgoAZGVmYXVsdCAAPG1hcCBpZD0iACIgbmFtZT0iAGlzbWFwOm1hcABjbWFwOm1hcABpbWFwOm1hcABjbWFweDptYXAAaW1hcF9ucDptYXAAY21hcHhfbnA6bWFwACMgJXMKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuMWYgJWQgJWQgJWQgJWQgJWQgJWQKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuMWYgJWQgJWQgJWQgJWQKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuM2YgJWQgJS40ZiAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZAoAJWQgJWQgIyUwMnglMDJ4JTAyeAoAZ3ZyZW5kZXJfY29yZV9tcC5jAG1wX3Jlc29sdmVfY29sb3IAJWQgJWQgJWQgJWQgJWQgJWQgJS4xZiAlLjRmICVkICUuMWYgJS4xZiAlZCAlZCAlc1wwMDEKACMgZW5kIG9mIEZJRyBmaWxlCgAjRklHIDMuMgoAIyBHZW5lcmF0ZWQgYnkgJXMgdmVyc2lvbiAlcyAoJXMpCgAjIFRpdGxlOiAlcwoAIyBQYWdlczogJWQKAFBvcnRyYWl0CgBDZW50ZXIKAEluY2hlcwoATGV0dGVyCgAxMDAuMDAKAFNpbmdsZQoALTIKADEyMDAAIDIKAG1wAG1wOm1wACBdICAlZCB0cnVlICVzCgAgXSAgJWQgZmFsc2UgJXMKACBzZXRsaW5ld2lkdGgKACVzIABzZXRoc2IAJS41ZyAlLjVnICUuNWcgJXNjb2xvcgoAJSAAbmV3cGF0aCAAIG1vdmV0bwoAIGxpbmV0bwoAc3Ryb2tlCgAgY3VydmV0bwoAY2xvc2VwYXRoIGZpbGwKAGNsb3NlcGF0aCBzdHJva2UKACBlbGxpcHNlX3BhdGggZmlsbAoAIGVsbGlwc2VfcGF0aCBzdHJva2UKACAvJXMgc2V0X2ZvbnQKACBtb3ZldG8gACAlcyBhbGlnbmVkdGV4dAoAWyAvUmVjdCBbIAAgXQoAICAvQm9yZGVyIFsgMCAwIDAgXQogIC9BY3Rpb24gPDwgL1N1YnR5cGUgL1VSSSAvVVJJICVzID4+CiAgL1N1YnR5cGUgL0xpbmsKL0FOTiBwZGZtYXJrCgBnc2F2ZQoAJSUgJXMKADAgMCAwIGVkZ2Vjb2xvcgoAZW5kcGFnZQpzaG93cGFnZQpncmVzdG9yZQoAJSVQYWdlVHJhaWxlcgoAJSUlJUVuZFBhZ2U6ICVkCgAlJSUlUGFnZTogJWQgJWQKACUlJSVQYWdlQm91bmRpbmdCb3g6ICVkICVkICVkICVkCgBMYW5kc2NhcGUAUG9ydHJhaXQAJSUlJVBhZ2VPcmllbnRhdGlvbjogJXMKADw8IC9QYWdlU2l6ZSBbJWQgJWRdID4+IHNldHBhZ2VkZXZpY2UKACVkICVkICVkIGJlZ2lucGFnZQoAZ3NhdmUKJWQgJWQgJWQgJWQgYm94cHJpbSBjbGlwIG5ld3BhdGgKACVnICVnIHNldF9zY2FsZSAlZCByb3RhdGUgJWcgJWcgdHJhbnNsYXRlCgBjYW52YXMgc2l6ZSAoJWQsJWQpIGV4Y2VlZHMgUERGIGxpbWl0ICglZCkKCShzdWdnZXN0IHNldHRpbmcgYSBib3VuZGluZyBib3ggc2l6ZSwgc2VlIGRvdCgxKSkKAFsgL0Nyb3BCb3ggWyVkICVkICVkICVkXSAvUEFHRVMgcGRmbWFyawoAJWQgJWQgc2V0bGF5ZXIKACUlJSVUaXRsZTogJXMKACUlUGFnZXM6IChhdGVuZCkKACUlUGFnZXM6IDEKACUlQm91bmRpbmdCb3g6IChhdGVuZCkKACUlJSVCb3VuZGluZ0JveDogJWQgJWQgJWQgJWQKACUlRW5kQ29tbWVudHMKc2F2ZQoAc2V0dXBMYXRpbjEKAFsge0NhdGFsb2d9IDw8IC9VUkkgPDwgL0Jhc2UgJXMgPj4gPj4KL1BVVCBwZGZtYXJrCgAlJUJlZ2luUHJvbG9nAC9Eb3REaWN0IDIwMCBkaWN0IGRlZgBEb3REaWN0IGJlZ2luAC9zZXR1cExhdGluMSB7AG1hcmsAL0VuY29kaW5nVmVjdG9yIDI1NiBhcnJheSBkZWYAIEVuY29kaW5nVmVjdG9yIDAASVNPTGF0aW4xRW5jb2RpbmcgMCAyNTUgZ2V0aW50ZXJ2YWwgcHV0aW50ZXJ2YWwARW5jb2RpbmdWZWN0b3IgNDUgL2h5cGhlbiBwdXQAJSBTZXQgdXAgSVNPIExhdGluIDEgY2hhcmFjdGVyIGVuY29kaW5nAC9zdGFybmV0SVNPIHsAICAgICAgICBkdXAgZHVwIGZpbmRmb250IGR1cCBsZW5ndGggZGljdCBiZWdpbgAgICAgICAgIHsgMSBpbmRleCAvRklEIG5lIHsgZGVmIH17IHBvcCBwb3AgfSBpZmVsc2UAICAgICAgICB9IGZvcmFsbAAgICAgICAgIC9FbmNvZGluZyBFbmNvZGluZ1ZlY3RvciBkZWYAICAgICAgICBjdXJyZW50ZGljdCBlbmQgZGVmaW5lZm9udAB9IGRlZgAvVGltZXMtUm9tYW4gc3Rhcm5ldElTTyBkZWYAL1RpbWVzLUl0YWxpYyBzdGFybmV0SVNPIGRlZgAvVGltZXMtQm9sZCBzdGFybmV0SVNPIGRlZgAvVGltZXMtQm9sZEl0YWxpYyBzdGFybmV0SVNPIGRlZgAvSGVsdmV0aWNhIHN0YXJuZXRJU08gZGVmAC9IZWx2ZXRpY2EtT2JsaXF1ZSBzdGFybmV0SVNPIGRlZgAvSGVsdmV0aWNhLUJvbGQgc3Rhcm5ldElTTyBkZWYAL0hlbHZldGljYS1Cb2xkT2JsaXF1ZSBzdGFybmV0SVNPIGRlZgAvQ291cmllciBzdGFybmV0SVNPIGRlZgAvQ291cmllci1PYmxpcXVlIHN0YXJuZXRJU08gZGVmAC9Db3VyaWVyLUJvbGQgc3Rhcm5ldElTTyBkZWYAL0NvdXJpZXItQm9sZE9ibGlxdWUgc3Rhcm5ldElTTyBkZWYAY2xlYXJ0b21hcmsAfSBiaW5kIGRlZgAlJUJlZ2luUmVzb3VyY2U6IHByb2NzZXQgZ3JhcGh2aXogMCAwAC9jb29yZC1mb250LWZhbWlseSAvVGltZXMtUm9tYW4gZGVmAC9kZWZhdWx0LWZvbnQtZmFtaWx5IC9UaW1lcy1Sb21hbiBkZWYAL2Nvb3JkZm9udCBjb29yZC1mb250LWZhbWlseSBmaW5kZm9udCA4IHNjYWxlZm9udCBkZWYAL0ludlNjYWxlRmFjdG9yIDEuMCBkZWYAL3NldF9zY2FsZSB7ACAgICAgICBkdXAgMSBleGNoIGRpdiAvSW52U2NhbGVGYWN0b3IgZXhjaCBkZWYAICAgICAgIHNjYWxlACUgc3R5bGVzAC9zb2xpZCB7IFtdIDAgc2V0ZGFzaCB9IGJpbmQgZGVmAC9kYXNoZWQgeyBbOSBJbnZTY2FsZUZhY3RvciBtdWwgZHVwIF0gMCBzZXRkYXNoIH0gYmluZCBkZWYAL2RvdHRlZCB7IFsxIEludlNjYWxlRmFjdG9yIG11bCA2IEludlNjYWxlRmFjdG9yIG11bF0gMCBzZXRkYXNoIH0gYmluZCBkZWYAL2ludmlzIHsvZmlsbCB7bmV3cGF0aH0gZGVmIC9zdHJva2Uge25ld3BhdGh9IGRlZiAvc2hvdyB7cG9wIG5ld3BhdGh9IGRlZn0gYmluZCBkZWYAL2JvbGQgeyAyIHNldGxpbmV3aWR0aCB9IGJpbmQgZGVmAC9maWxsZWQgeyB9IGJpbmQgZGVmAC91bmZpbGxlZCB7IH0gYmluZCBkZWYAL3JvdW5kZWQgeyB9IGJpbmQgZGVmAC9kaWFnb25hbHMgeyB9IGJpbmQgZGVmAC90YXBlcmVkIHsgfSBiaW5kIGRlZgAlIGhvb2tzIGZvciBzZXR0aW5nIGNvbG9yIAAvbm9kZWNvbG9yIHsgc2V0aHNiY29sb3IgfSBiaW5kIGRlZgAvZWRnZWNvbG9yIHsgc2V0aHNiY29sb3IgfSBiaW5kIGRlZgAvZ3JhcGhjb2xvciB7IHNldGhzYmNvbG9yIH0gYmluZCBkZWYAL25vcGNvbG9yIHtwb3AgcG9wIHBvcH0gYmluZCBkZWYAL2JlZ2lucGFnZSB7CSUgaSBqIG5wYWdlcwAJL25wYWdlcyBleGNoIGRlZgAJL2ogZXhjaCBkZWYACS9pIGV4Y2ggZGVmAAkvc3RyIDEwIHN0cmluZyBkZWYACW5wYWdlcyAxIGd0IHsACQlnc2F2ZQAJCQljb29yZGZvbnQgc2V0Zm9udAAJCQkwIDAgbW92ZXRvAAkJCShcKCkgc2hvdyBpIHN0ciBjdnMgc2hvdyAoLCkgc2hvdyBqIHN0ciBjdnMgc2hvdyAoXCkpIHNob3cACQlncmVzdG9yZQAJfSBpZgAvc2V0X2ZvbnQgewAJZmluZGZvbnQgZXhjaAAJc2NhbGVmb250IHNldGZvbnQAJSBkcmF3IHRleHQgZml0dGVkIHRvIGl0cyBleHBlY3RlZCB3aWR0aAAvYWxpZ25lZHRleHQgewkJCSUgd2lkdGggdGV4dAAJL3RleHQgZXhjaCBkZWYACS93aWR0aCBleGNoIGRlZgAJZ3NhdmUACQl3aWR0aCAwIGd0IHsACQkJW10gMCBzZXRkYXNoAAkJCXRleHQgc3RyaW5nd2lkdGggcG9wIHdpZHRoIGV4Y2ggc3ViIHRleHQgbGVuZ3RoIGRpdiAwIHRleHQgYXNob3cACQl9IGlmAAlncmVzdG9yZQAvYm94cHJpbSB7CQkJCSUgeGNvcm5lciB5Y29ybmVyIHhzaXplIHlzaXplAAkJNCAyIHJvbGwACQltb3ZldG8ACQkyIGNvcHkACQlleGNoIDAgcmxpbmV0bwAJCTAgZXhjaCBybGluZXRvAAkJcG9wIG5lZyAwIHJsaW5ldG8ACQljbG9zZXBhdGgAL2VsbGlwc2VfcGF0aCB7AAkvcnkgZXhjaCBkZWYACS9yeCBleGNoIGRlZgAJL3kgZXhjaCBkZWYACS94IGV4Y2ggZGVmAAltYXRyaXggY3VycmVudG1hdHJpeAAJbmV3cGF0aAAJeCB5IHRyYW5zbGF0ZQAJcnggcnkgc2NhbGUACTAgMCAxIDAgMzYwIGFyYwAJc2V0bWF0cml4AC9lbmRwYWdlIHsgc2hvd3BhZ2UgfSBiaW5kIGRlZgAvc2hvd3BhZ2UgeyB9IGRlZgAvbGF5ZXJjb2xvcnNlcQAJWwklIGxheWVyIGNvbG9yIHNlcXVlbmNlIC0gZGFya2VzdCB0byBsaWdodGVzdAAJCVswIDAgMF0ACQlbLjIgLjggLjhdAAkJWy40IC44IC44XQAJCVsuNiAuOCAuOF0ACQlbLjggLjggLjhdAAldAGRlZgAvbGF5ZXJsZW4gbGF5ZXJjb2xvcnNlcSBsZW5ndGggZGVmAC9zZXRsYXllciB7L21heGxheWVyIGV4Y2ggZGVmIC9jdXJsYXllciBleGNoIGRlZgAJbGF5ZXJjb2xvcnNlcSBjdXJsYXllciAxIHN1YiBsYXllcmxlbiBtb2QgZ2V0AAlhbG9hZCBwb3Agc2V0aHNiY29sb3IACS9ub2RlY29sb3Ige25vcGNvbG9yfSBkZWYACS9lZGdlY29sb3Ige25vcGNvbG9yfSBkZWYACS9ncmFwaGNvbG9yIHtub3Bjb2xvcn0gZGVmAC9vbmxheWVyIHsgY3VybGF5ZXIgbmUge2ludmlzfSBpZiB9IGRlZgAvb25sYXllcnMgewAJL215dXBwZXIgZXhjaCBkZWYACS9teWxvd2VyIGV4Y2ggZGVmAAljdXJsYXllciBteWxvd2VyIGx0AAljdXJsYXllciBteXVwcGVyIGd0AAlvcgAJe2ludmlzfSBpZgAvY3VybGF5ZXIgMCBkZWYAJSVFbmRSZXNvdXJjZQAlJUVuZFByb2xvZwAlJUJlZ2luU2V0dXAAMTQgZGVmYXVsdC1mb250LWZhbWlseSBzZXRfZm9udAAlIC9hcnJvd2xlbmd0aCAxMCBkZWYAJSAvYXJyb3d3aWR0aCA1IGRlZgAlIG1ha2Ugc3VyZSBwZGZtYXJrIGlzIGhhcm1sZXNzIGZvciBQUy1pbnRlcnByZXRlcnMgb3RoZXIgdGhhbiBEaXN0aWxsZXIAL3BkZm1hcmsgd2hlcmUge3BvcH0ge3VzZXJkaWN0IC9wZGZtYXJrIC9jbGVhcnRvbWFyayBsb2FkIHB1dH0gaWZlbHNlACUgbWFrZSAnPDwnIGFuZCAnPj4nIHNhZmUgb24gUFMgTGV2ZWwgMSBkZXZpY2VzAC9sYW5ndWFnZWxldmVsIHdoZXJlIHtwb3AgbGFuZ3VhZ2VsZXZlbH17MX0gaWZlbHNlADIgbHQgewAgICAgdXNlcmRpY3QgKDw8KSBjdm4gKFspIGN2biBsb2FkIHB1dAAgICAgdXNlcmRpY3QgKD4+KSBjdm4gKFspIGN2biBsb2FkIHB1dAB9IGlmACUlRW5kU2V0dXAAJSVUcmFpbGVyCgAlJSUlUGFnZXM6ICVkCgBlbmQKcmVzdG9yZQoAJSVFT0YKACUhUFMtQWRvYmUtMy4wACBFUFNGLTMuMAoAJSUlJUNyZWF0b3I6ICVzIHZlcnNpb24gJXMgKCVzKQoAcHMyOnBzADwhLS0gADxwb2x5bGluZQAgcG9pbnRzPSIAIi8+CgAgZmlsbD0iAHVybCgjbF8lZCkAdXJsKCNyXyVkKQAiIGZpbGwtb3BhY2l0eT0iJWYAIiBzdHJva2U9IgAiIHN0cm9rZS13aWR0aD0iACIgc3Ryb2tlLWRhc2hhcnJheT0iJXMANSwyADEsNQAiIHN0cm9rZS1vcGFjaXR5PSIlZgBndnJlbmRlcl9jb3JlX3N2Zy5jAHN2Z19wcmludF9jb2xvcgA8cGF0aAAgaWQ9IgBfcCIgACBkPSIAJWMAPGRlZnM+CjxyYWRpYWxHcmFkaWVudCBpZD0icl8lZCIgY3g9IjUwJSUiIGN5PSI1MCUlIiByPSI3NSUlIiBmeD0iJWQlJSIgZnk9IiVkJSUiPgoAPHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjoAO3N0b3Atb3BhY2l0eToAMS4AOyIvPgoAPHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjoAOyIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+CgA8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJsXyVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgAHgxPSIAIiB5MT0iACIgeDI9IgAiIHkyPSIAIiA+CgA8c3RvcCBvZmZzZXQ9IiUuMDNmIiBzdHlsZT0ic3RvcC1jb2xvcjoAOyIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+CgA8cG9seWdvbgA8ZWxsaXBzZQAgY3g9IgAiIGN5PSIAIiByeD0iACIgcnk9IgA8dGV4dAAgdGV4dC1hbmNob3I9InN0YXJ0IgAgdGV4dC1hbmNob3I9ImVuZCIAIHRleHQtYW5jaG9yPSJtaWRkbGUiACB4PSIAIiB5PSIAIGZvbnQtZmFtaWx5PSIlcwAsJXMAIGZvbnQtd2VpZ2h0PSIlcyIAIGZvbnQtc3RyZXRjaD0iJXMiACBmb250LXN0eWxlPSIlcyIAIGZvbnQtZmFtaWx5PSIlcyIAIGZvbnQtd2VpZ2h0PSJib2xkIgAgZm9udC1zdHlsZT0iaXRhbGljIgAgdGV4dC1kZWNvcmF0aW9uPSIAJXNvdmVybGluZQAlc2xpbmUtdGhyb3VnaAAgYmFzZWxpbmUtc2hpZnQ9InN1cGVyIgAgYmFzZWxpbmUtc2hpZnQ9InN1YiIAIGZvbnQtc2l6ZT0iJS4yZiIAIGZpbGw9IiVzIgAgZmlsbD0iIyUwMnglMDJ4JTAyeCIAc3ZnX3RleHRzcGFuAD4APHRleHRQYXRoIHhsaW5rOmhyZWY9IiMlc19wIiBzdGFydE9mZnNldD0iNTAlJSI+ADx0c3BhbiB4PSIwIiBkeT0iACI+ADwvdHNwYW4+PC90ZXh0UGF0aD4APC90ZXh0PgoAPC9nPgoAPGcAIGlkPSJhXwAgeGxpbms6aHJlZj0iACB4bGluazp0aXRsZT0iACB0YXJnZXQ9IgA8dGl0bGU+ADwvdGl0bGU+CgA8ZyBpZD0iAF8lcwAiIGNsYXNzPSIlcwBjbGFzcwAgdHJhbnNmb3JtPSJzY2FsZSgAKSByb3RhdGUoJWQpIHRyYW5zbGF0ZSgAKSI+CgA8L3N2Zz4KADwhLS0AIFBhZ2VzOiAlZCAtLT4KADxzdmcgd2lkdGg9IiVkcHQiIGhlaWdodD0iJWRwdCIKACB2aWV3Qm94PSIlLjJmICUuMmYgJS4yZiAlLjJmIgAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiADw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJubyI/PgoAc3R5bGVzaGVldAA8P3htbC1zdHlsZXNoZWV0IGhyZWY9IgAiIHR5cGU9InRleHQvY3NzIj8+CgA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iCgAgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CgA8IS0tIEdlbmVyYXRlZCBieSAAZGFya2JsdWUAZGFya2N5YW4AZGFya2dyYXkAZGFya2dyZXkAZGFya21hZ2VudGEAZGFya3JlZABsaWdodGdyZWVuACMgACBjcmVhdGUgbGluZSAAIC1maWxsIAAgLWRhc2ggNQAgLWRhc2ggMgBndnJlbmRlcl9jb3JlX3RrLmMAdGtnZW5fcHJpbnRfdGFncwBncmFwaCBsYWJlbAAgLXRhZ3MgeyVkJXMlcH0AdGtnZW5fcHJpbnRfY29sb3IAJGMAIC13aWR0aCAAIC1zbW9vdGggYmV6aWVyIAAgY3JlYXRlIHBvbHlnb24gACAtb3V0bGluZSAAIGNyZWF0ZSBvdmFsIAAgY3JlYXRlIHRleHQgACAtdGV4dCB7AH0AIC1mb250IHsAICVkfQAgLWFuY2hvciB3ACAtYW5jaG9yIGUAIwAgVGl0bGU6IAAgUGFnZXM6ICVkCgAjIEdlbmVyYXRlZCBieSAAKQoAdGsAdGs6dGsAICAgICAgPCEtLSAAIC0tPgoARXJyb3IgZHVyaW5nIGNvbnZlcnNpb24gdG8gIlVURi04Ii4gIFF1aXRpbmcuCgAgPHY6c2hhcGUgc3R5bGU9InBvc2l0aW9uOmFic29sdXRlOyAAIHdpZHRoOiAlZDsgaGVpZ2h0OiAlZCIgZmlsbGVkPSJmYWxzZSI+ADx2OnBhdGggdj0iACBtIAAlLjBmLCUuMGYgACBsIAAgZSAAIi8+ADwvdjpzaGFwZT4KADx2OnN0cm9rZSBjb2xvcj0iACIgd2VpZ2h0PSIlLjBmcHQAIiBkYXNoc3R5bGU9ImRhc2gAIiBkYXNoc3R5bGU9ImRvdAAiIC8+ACMlMDJ4JTAyeCUwMngAZ3ZyZW5kZXJfY29yZV92bWwuYwB2bWxfcHJpbnRfY29sb3IAIHdpZHRoOiAlZDsgaGVpZ2h0OiAlZCIAID4APHY6cGF0aCAgdj0iAC8+PC92OnNoYXBlPgoAbSAAJXMlLjBmLCUuMGYgAGMgACBmaWxsZWQ9InRydWUiIGZpbGxjb2xvcj0iACIgACBmaWxsZWQ9ImZhbHNlIiAAJS4wZiAlLjBmIABsIAB4IGUgIi8+ACAgPHY6b3ZhbCBzdHlsZT0icG9zaXRpb246YWJzb2x1dGU7ACBsZWZ0OiAlLjJmOyB0b3A6ICUuMmY7ACB3aWR0aDogJS4yZjsgaGVpZ2h0OiAlLjJmIgA8L3Y6b3ZhbD4KADx2OnJlY3Qgc3R5bGU9InBvc2l0aW9uOmFic29sdXRlOyAAIHN0cm9rZWQ9ImZhbHNlIiBmaWxsZWQ9ImZhbHNlIj4KADx2OnRleHRib3ggaW5zZXQ9IjAsMCwwLDAiIHN0eWxlPSJwb3NpdGlvbjphYnNvbHV0ZTsgdi10ZXh0LXdyYXBwaW5nOidmYWxzZSc7cGFkZGluZzonMCc7AGZvbnQtZmFtaWx5OiAnJXMnOwBmb250LXdlaWdodDogJXM7AGZvbnQtc3RyZXRjaDogJXM7AGZvbnQtc3R5bGU6ICVzOwAgZm9udC1zaXplOiAlLjJmcHQ7AGNvbG9yOiVzOwBjb2xvcjojJTAyeCUwMnglMDJ4OwB2bWxfdGV4dHNwYW4AIj48Y2VudGVyPgA8L2NlbnRlcj48L3Y6dGV4dGJveD4KADwvdjpyZWN0PgoAPC9hPgoAPGEAIGhyZWY9IiVzIgAgdGl0bGU9IiVzIgAgdGFyZ2V0PSIlcyIAPgoAPC92Omdyb3VwPgoAPC9ESVY+CgA8RElWIGlkPSdfVk1MMl8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTt2aXNpYmlsaXR5OmhpZGRlbiI+CgA8IS0tIGluc2VydCBhbnkgb3RoZXIgaHRtbCBjb250ZW50IGhlcmUgLS0+CgA8RElWIGlkPSdfbm90Vk1MMV8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTsiPgoAPCEtLSB0aGlzIHNob3VsZCBvbmx5IGRpc3BsYXkgb24gTk9OLUlFIGJyb3dzZXJzIC0tPgoAPEgyPlNvcnJ5LCB0aGlzIGRpYWdyYW0gd2lsbCBvbmx5IGRpc3BsYXkgY29ycmVjdGx5IG9uIEludGVybmV0IEV4cGxvcmVyIDUgKGFuZCB1cCkgYnJvd3NlcnMuPC9IMj4KADxESVYgaWQ9J19ub3RWTUwyXycgc3R5bGU9InBvc2l0aW9uOnJlbGF0aXZlOyI+CgA8IS0tIGluc2VydCBhbnkgb3RoZXIgTk9OLUlFIGh0bWwgY29udGVudCBoZXJlIC0tPgoAPC9CT0RZPgo8L0hUTUw+CgA8SEVBRD4APE1FVEEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPgoAPFRJVExFPgA8L1RJVExFPgA8IS0tIFBhZ2VzOiAlZCAtLT4KACAgIDxTQ1JJUFQgTEFOR1VBR0U9J0phdmFzY3JpcHQnPgoAICAgZnVuY3Rpb24gYnJvd3NlcmNoZWNrKCkKACAgIHsKACAgICAgIHZhciB1YSA9IHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50CgAgICAgICB2YXIgbXNpZSA9IHVhLmluZGV4T2YgKCAnTVNJRSAnICkKACAgICAgIHZhciBpZXZlcnM7CgAgICAgICB2YXIgaXRlbTsKACAgICAgIHZhciBWTUx5ZXM9bmV3IEFycmF5KCdfVk1MMV8nLCdfVk1MMl8nKTsKACAgICAgIHZhciBWTUxubz1uZXcgQXJyYXkoJ19ub3RWTUwxXycsJ19ub3RWTUwyXycpOwoAICAgICAgaWYgKCBtc2llID4gMCApeyAgICAgIC8vIElmIEludGVybmV0IEV4cGxvcmVyLCByZXR1cm4gdmVyc2lvbiBudW1iZXIKACAgICAgICAgIGlldmVycz0gcGFyc2VJbnQgKHVhLnN1YnN0cmluZyAobXNpZSs1LCB1YS5pbmRleE9mICgnLicsIG1zaWUgKSkpCgAgICAgICB9CgAgICAgICBpZiAoaWV2ZXJzPj01KXsKACAgICAgICBmb3IgKHggaW4gVk1MeWVzKXsKACAgICAgICAgIGl0ZW0gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChWTUx5ZXNbeF0pOwoAICAgICAgICAgaWYgKGl0ZW0pIHsKACAgICAgICAgICAgaXRlbS5zdHlsZS52aXNpYmlsaXR5PSd2aXNpYmxlJzsKACAgICAgICAgIH0KACAgICAgICB9CgAgICAgICAgZm9yICh4IGluIFZNTG5vKXsKACAgICAgICAgIGl0ZW0gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChWTUxub1t4XSk7CgAgICAgICAgICAgIGl0ZW0uc3R5bGUudmlzaWJpbGl0eT0naGlkZGVuJzsKACAgICAgfWVsc2V7CgAgICAgIH0KACAgIH0KACAgIDwvU0NSSVBUPgoAPC9IRUFEPgA8Qk9EWSBvbmxvYWQ9J2Jyb3dzZXJjaGVjaygpOyc+CgA8RElWIGlkPSdfVk1MMV8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTsgZGlzcGxheTppbmxpbmU7IHZpc2liaWxpdHk6aGlkZGVuACB3aWR0aDogJWRwdDsgaGVpZ2h0OiAlZHB0Ij4KADxTVFlMRT4KAHZcOiogeyBiZWhhdmlvcjogdXJsKCNkZWZhdWx0I1ZNTCk7ZGlzcGxheTppbmxpbmUtYmxvY2t9CgA8L1NUWUxFPgoAPHhtbDpuYW1lc3BhY2UgbnM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206dm1sIiBwcmVmaXg9InYiIC8+CgAgPHY6Z3JvdXAgc3R5bGU9InBvc2l0aW9uOnJlbGF0aXZlOyAAIHdpZHRoOiAlZHB0OyBoZWlnaHQ6ICVkcHQiACBjb29yZG9yaWdpbj0iMCwwIiBjb29yZHNpemU9IiVkLCVkIiA+ADxIVE1MPgoACjwhLS0gR2VuZXJhdGVkIGJ5IAAgdmVyc2lvbiAAICgAKQotLT4KAGFxdWEAZnVjaHNpYQBsaW1lAG9saXZlAHRlYWwAdm1sAHZtbDp2bWwALy8qKiogY29tbWVudDogJXMKAC8vKioqIHBvbHlsaW5lCgBzY2FsZSAgICA8JTkuM2YsICU5LjNmLCAlOS4zZj4KAHJvdGF0ZSAgIDwlOS4zZiwgJTkuM2YsICU5LjNmPgoAdHJhbnNsYXRlPCU5LjNmLCAlOS4zZiwgJTkuM2Y+CgBzcGhlcmVfc3dlZXAgewogICAgJXMKICAgICVkLAoAbGluZWFyX3NwbGluZQA8JTkuM2YsICU5LjNmLCAlOS4zZj4sICUuM2YKACVzICAgICVzACAgICB0b2xlcmFuY2UgMC4wMQogICAgJXMgICAgJXMgICAgJXMgICAgJXN9CgAlcyVzACVzIHRyYW5zbWl0ICUuM2YAUmVkAEdyZWVuAEJsdWUAcmdiPCU5LjNmLCAlOS4zZiwgJTkuM2Y+IHRyYW5zbWl0ICUuM2YAb29wcywgaW50ZXJuYWwgZXJyb3I6IHVuaGFuZGxlZCBjb2xvciB0eXBlPSVkICVzCgBndnJlbmRlcl9jb3JlX3Bvdi5jAHBvdl9jb2xvcl9hc19zdHIAcGlnbWVudCB7IGNvbG9yICVzIH0KAHBvdiByZW5kZXJlcjplbCAtICVzCgAvLyoqKiBiZXppZXIKAGJfc3BsaW5lACAgICAgICAgdG9sZXJhbmNlIDAuMDEKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogcG9seWdvbgoAICAgIHRvbGVyYW5jZSAwLjEKICAgICVzICAgICVzICAgICVzICAgICVzfQoAcG9seWdvbiB7ICVkLAoAPCU5LjNmLCAlOS4zZiwgJTkuM2Y+ACVzCiAgICAlcwAKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogZWxsaXBzZQoAdG9ydXMgeyAlLjNmLCAlLjNmCiAgICAlcyAgICAlcyAgICAlcyAgICAlc30KAHNwaGVyZSB7PCU5LjNmLCAlOS4zZiwgJTkuM2Y+LCAxLjAKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogdGV4dHNwYW46ICVzLCBmb250c2l6ZSA9ICUuM2YsIGZvbnRuYW1lID0gJXMKAHNjYWxlICUuM2YKAHRleHQgewogICAgdHRmICIlcyIsCiAgICAiJXMiLCAlLjNmLCAlLjNmCiAgICAlcyAgICAlcyAgICAlcyAgICAlcyAgICAlc30KACAgICBub19zaGFkb3cKAC8vKioqIGVuZF9lZGdlCgAvLyoqKiBiZWdpbl9lZGdlCgAvLyoqKiBlbmRfbm9kZQoALy8qKiogYmVnaW5fbm9kZTogJXMKAC8vKioqIGVuZF9jbHVzdGVyCgAvLyoqKiBiZWdpbl9jbHVzdGVyCgAvLyoqKiBlbmRfcGFnZQoALy8qKiogYmVnaW5fcGFnZQoALy8qKiogZW5kX2xheWVyCgAvLyoqKiBiZWdpbl9sYXllcjogJXMsICVkLyVkCgAvLyoqKiBlbmRfZ3JhcGgKAC8vKioqIGJlZ2luX2dyYXBoICVzCgBjYW1lcmEgeyBsb2NhdGlvbiA8JS4zZiAsICUuM2YgLCAlLjNmPgogICAgICAgICBsb29rX2F0ICA8JS4zZiAsICUuM2YgLCAlLjNmPgogICAgICAgICByaWdodCB4ICogaW1hZ2Vfd2lkdGggLyBpbWFnZV9oZWlnaHQKICAgICAgICAgYW5nbGUgJS4zZgp9CgAvL3NreQpwbGFuZSB7IDwwLCAxLCAwPiwgMSBob2xsb3cKICAgIHRleHR1cmUgewogICAgICAgIHBpZ21lbnQgeyBib3pvIHR1cmJ1bGVuY2UgMC45NQogICAgICAgICAgICBjb2xvcl9tYXAgewogICAgICAgICAgICAgICAgWzAuMDAgcmdiIDwwLjA1LCAwLjIwLCAwLjUwPl0KICAgICAgICAgICAgICAgIFswLjUwIHJnYiA8MC4wNSwgMC4yMCwgMC41MD5dCiAgICAgICAgICAgICAgICBbMC43NSByZ2IgPDEuMDAsIDEuMDAsIDEuMDA+XQogICAgICAgICAgICAgICAgWzAuNzUgcmdiIDwwLjI1LCAwLjI1LCAwLjI1Pl0KICAgICAgICAgICAgICAgIFsxLjAwIHJnYiA8MC41MCwgMC41MCwgMC41MD5dCiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2NhbGUgPDEuMDAsIDEuMDAsIDEuNTA+ICogMi41MAogICAgICAgICAgICB0cmFuc2xhdGUgPDAuMDAsIDAuMDAsIDAuMDA+CiAgICAgICAgfQogICAgICAgIGZpbmlzaCB7IGFtYmllbnQgMSBkaWZmdXNlIDAgfQogICAgfQogICAgc2NhbGUgMTAwMDAKfQovL21pc3QKZm9nIHsgZm9nX3R5cGUgMgogICAgZGlzdGFuY2UgNTAKICAgIGNvbG9yIHJnYiA8MS4wMCwgMS4wMCwgMS4wMD4gKiAwLjc1CiAgICBmb2dfb2Zmc2V0IDAuMTAKICAgIGZvZ19hbHQgMS41MAogICAgdHVyYnVsZW5jZSAxLjc1Cn0KLy9nbmQKcGxhbmUgeyA8MC4wMCwgMS4wMCwgMC4wMD4sIDAKICAgIHRleHR1cmUgewogICAgICAgIHBpZ21lbnR7IGNvbG9yIHJnYiA8MC4yNSwgMC40NSwgMC4wMD4gfQogICAgICAgIG5vcm1hbCB7IGJ1bXBzIDAuNzUgc2NhbGUgMC4wMSB9CiAgICAgICAgZmluaXNoIHsgcGhvbmcgMC4xMCB9CiAgICB9Cn0KAGxpZ2h0X3NvdXJjZSB7IDwxNTAwLDMwMDAsLTI1MDA+IGNvbG9yIFdoaXRlIH0KACN2ZXJzaW9uIDMuNjsKAGdsb2JhbF9zZXR0aW5ncyB7IGFzc3VtZWRfZ2FtbWEgMS4wIH0KACNkZWZhdWx0IHsgZmluaXNoIHsgYW1iaWVudCAwLjEgZGlmZnVzZSAwLjkgfSB9CgAjaW5jbHVkZSAiY29sb3JzLmluYyIKI2luY2x1ZGUgInRleHR1cmVzLmluYyIKI2luY2x1ZGUgInNoYXBlcy5pbmMiCgAjZGVjbGFyZSAlcyA9ICVzOwoAQmxhY2sAV2hpdGUAYmFrZXJzY2hvYwBicmFzcwBicmlnaHRnb2xkAGJyb256ZQBicm9uemUyAGNsZWFyAGNvb2xjb3BwZXIAY29wcGVyAGRhcmticm93bgBkYXJrcHVycGxlAGRhcmt0YW4AZGFya3dvb2QAZGtncmVlbmNvcHBlcgBkdXN0eXJvc2UAZmVsZHNwYXIAZmxlc2gAZ3JheTA1AGdyZWVuY29wcGVyAGh1bnRlcnNncmVlbgBsaWdodF9wdXJwbGUAbGlnaHR3b29kAG1hbmRhcmlub3JhbmdlAG1lZGl1bWZvcmVzdGdyZWVuAG1lZGl1bWdvbGRlbnJvZABtZWRpdW13b29kAG1lZF9wdXJwbGUAbWljYQBuZW9uYmx1ZQBuZW9ucGluawBuZXdtaWRuaWdodGJsdWUAbmV3dGFuAG9sZGdvbGQAcXVhcnR6AHJpY2hibHVlAHNjYXJsZXQAc2VtaVN3ZWV0Q2hvYwBzaWx2ZXIAc3BpY3lwaW5rAHN1bW1lcnNreQB2ZXJ5ZGFya2Jyb3duAHZlcnlfbGlnaHRfcHVycGxlAHBvdgBwb3Y6cG92ACVzICVzCgAuXCIgACAlZCAlZAAgJXMKACAlZABmaWxsIABlbGxpcHNlIGF0dHJzJWQgJXN3aWQgJS41ZiBodCAlLjVmIGF0ICglLjVmLCUuNWYpOwoALmZ0ICVzCgAucHMgJWQqXG4oU0Z1LyUuMGZ1CgAiJXMiIGF0ICglLjVmLCUuNWYpOwoAJTAzbwAlcyVzIGlzIG5vdCBhIHRyb2ZmIGZvbnQKAGRvdCBwaWMgcGx1Z2luOiAAUgBdCi5QRQoALlBTICUuNWYgJS41ZgoAJXMgdG8gY2hhbmdlIGRyYXdpbmcgc2l6ZSwgbXVsdGlwbHkgdGhlIHdpZHRoIGFuZCBoZWlnaHQgb24gdGhlIC5QUyBsaW5lIGFib3ZlIGFuZCB0aGUgbnVtYmVyIG9uIHRoZSB0d28gbGluZXMgYmVsb3cgKHJvdW5kZWQgdG8gdGhlIG5lYXJlc3QgaW50ZWdlcikgYnkgYSBzY2FsZSBmYWN0b3IKAC5uciBTRiAlLjBmCnNjYWxldGhpY2tuZXNzID0gJS4wZgoAJXMgZG9uJ3QgY2hhbmdlIGFueXRoaW5nIGJlbG93IHRoaXMgbGluZSBpbiB0aGlzIGRyYXdpbmcKACVzIG5vbi1mYXRhbCBydW4tdGltZSBwaWMgdmVyc2lvbiBkZXRlcm1pbmF0aW9uLCB2ZXJzaW9uIDIKAGJveHJhZD0yLjAgJXMgd2lsbCBiZSByZXNldCB0byAwLjAgYnkgZ3BpYyBvbmx5CgBzY2FsZT0xLjAgJXMgcmVxdWlyZWQgZm9yIGNvbXBhcmlzb25zCgAlcyBib3hyYWQgaXMgbm93IDAuMCBpbiBncGljLCBlbHNlIGl0IHJlbWFpbnMgMi4wCgAlcyBkYXNod2lkIGlzIDAuMSBpbiAxMHRoIEVkaXRpb24sIDAuMDUgaW4gRFdCIDIgYW5kIGluIGdwaWMKACVzIGZpbGx2YWwgaXMgMC4zIGluIDEwdGggRWRpdGlvbiAoZmlsbCAwIG1lYW5zIGJsYWNrKSwgMC41IGluIGdwaWMgKGZpbGwgMCBtZWFucyB3aGl0ZSksIHVuZGVmaW5lZCBpbiBEV0IgMgoAJXMgZmlsbCBoYXMgbm8gbWVhbmluZyBpbiBEV0IgMiwgZ3BpYyBjYW4gdXNlIGZpbGwgb3IgZmlsbGVkLCAxMHRoIEVkaXRpb24gdXNlcyBmaWxsIG9ubHkKACVzIERXQiAyIGRvZXNuJ3QgdXNlIGZpbGwgYW5kIGRvZXNuJ3QgZGVmaW5lIGZpbGx2YWwKACVzIHJlc2V0IHdvcmtzIGluIGdwaWMgYW5kIDEwdGggZWRpdGlvbiwgYnV0IGlzbid0IGRlZmluZWQgaW4gRFdCIDIKACVzIERXQiAyIGNvbXBhdGliaWxpdHkgZGVmaW5pdGlvbnMKAGlmIGJveHJhZCA+IDEuMCAmJiBkYXNod2lkIDwgMC4wNzUgdGhlbiBYCglmaWxsdmFsID0gMTsKCWRlZmluZSBmaWxsIFkgWTsKCWRlZmluZSBzb2xpZCBZIFk7CglkZWZpbmUgcmVzZXQgWSBzY2FsZT0xLjAgWTsKWAoAcmVzZXQgJXMgc2V0IHRvIGtub3duIHN0YXRlCgAlcyBHTlUgcGljIHZzLiAxMHRoIEVkaXRpb24gZFwoZSd0ZW50ZQoAaWYgZmlsbHZhbCA+IDAuNCB0aGVuIFgKCWRlZmluZSBzZXRmaWxsdmFsIFkgZmlsbHZhbCA9IDEgLSBZOwoJZGVmaW5lIGJvbGQgWSB0aGlja25lc3MgMiBZOwoACSVzIGlmIHlvdSB1c2UgZ3BpYyBhbmQgaXQgYmFyZnMgb24gZW5jb3VudGVyaW5nICJzb2xpZCIsCgAJJXMJaW5zdGFsbCBhIG1vcmUgcmVjZW50IHZlcnNpb24gb2YgZ3BpYyBvciBzd2l0Y2ggdG8gRFdCIG9yIDEwdGggRWRpdGlvbiBwaWM7CgAJJXMJc29ycnksIHRoZSBncm9mZiBmb2xrcyBjaGFuZ2VkIGdwaWM7IHNlbmQgYW55IGNvbXBsYWludCB0byB0aGVtOwoAWCBlbHNlIFoKCWRlZmluZSBzZXRmaWxsdmFsIFkgZmlsbHZhbCA9IFk7CglkZWZpbmUgYm9sZCBZIFk7CglkZWZpbmUgZmlsbGVkIFkgZmlsbCBZOwpaCgAlcyBhcnJvd2hlYWQgaGFzIG5vIG1lYW5pbmcgaW4gRFdCIDIsIGFycm93aGVhZCA9IDcgbWFrZXMgZmlsbGVkIGFycm93aGVhZHMgaW4gZ3BpYyBhbmQgaW4gMTB0aCBFZGl0aW9uCgAlcyBhcnJvd2hlYWQgaXMgdW5kZWZpbmVkIGluIERXQiAyLCBpbml0aWFsbHkgMSBpbiBncGljLCAyIGluIDEwdGggRWRpdGlvbgoAYXJyb3doZWFkID0gNyAlcyBub3QgdXNlZCBieSBncmFwaHZpegoAJXMgR05VIHBpYyBzdXBwb3J0cyBhIGJveHJhZCB2YXJpYWJsZSB0byBkcmF3IGJveGVzIHdpdGggcm91bmRlZCBjb3JuZXJzOyBEV0IgYW5kIDEwdGggRWQuIGRvIG5vdAoAYm94cmFkID0gMCAlcyBubyByb3VuZGVkIGNvcm5lcnMgaW4gZ3JhcGh2aXoKACVzIEdOVSBwaWMgc3VwcG9ydHMgYSBsaW5ldGhpY2sgdmFyaWFibGUgdG8gc2V0IGxpbmUgdGhpY2tuZXNzOyBEV0IgYW5kIDEwdGggRWQuIGRvIG5vdAoAbGluZXRoaWNrID0gMDsgb2xkbGluZXRoaWNrID0gbGluZXRoaWNrCgAlcyAuUFMgdy9vIGFyZ3MgY2F1c2VzIEdOVSBwaWMgdG8gc2NhbGUgZHJhd2luZyB0byBmaXQgOC41eDExIHBhcGVyOyBEV0IgZG9lcyBub3QKACVzIG1heHBzaHQgYW5kIG1heHBzd2lkIGhhdmUgbm8gbWVhbmluZyBpbiBEV0IgMi4wLCBzZXQgcGFnZSBib3VuZGFyaWVzIGluIGdwaWMgYW5kIGluIDEwdGggRWRpdGlvbgoAJXMgbWF4cHNodCBhbmQgbWF4cHN3aWQgYXJlIHByZWRlZmluZWQgdG8gMTEuMCBhbmQgOC41IGluIGdwaWMKAG1heHBzaHQgPSAlZgptYXhwc3dpZCA9ICVmCgBEb3Q6IFsKAGRlZmluZSBhdHRyczAgJSUgJSU7IGRlZmluZSB1bmZpbGxlZCAlJSAlJTsgZGVmaW5lIHJvdW5kZWQgJSUgJSU7IGRlZmluZSBkaWFnb25hbHMgJSUgJSUKACVzJXMgdW5zdXBwb3J0ZWQKACVzIHJlc3RvcmUgcG9pbnQgc2l6ZSBhbmQgZm9udAoucHMgXG4oLlMKLmZ0IFxuKERGCgAlcyBDcmVhdG9yOiAlcyB2ZXJzaW9uICVzICglcykKACVzIFRpdGxlOiAlcwoAJXMgc2F2ZSBwb2ludCBzaXplIGFuZCBmb250Ci5uciAuUyBcbigucwoubnIgREYgXG4oLmYKAHBpYwBwaWM6cGljAHBuZzpzdmcAZ2lmOnN2ZwBqcGVnOnN2ZwBqcGU6c3ZnAGpwZzpzdmcAcG5nOmZpZwBnaWY6ZmlnAGpwZWc6ZmlnAGpwZTpmaWcAanBnOmZpZwBwbmc6dnJtbABnaWY6dnJtbABqcGVnOnZybWwAanBlOnZybWwAanBnOnZybWwAZXBzOnBzAHBzOnBzAChsaWIpOnBzAHBuZzptYXAAZ2lmOm1hcABqcGVnOm1hcABqcGU6bWFwAGpwZzptYXAAcHM6bWFwAGVwczptYXAAc3ZnOm1hcABwbmc6ZG90AGdpZjpkb3QAanBlZzpkb3QAanBlOmRvdABqcGc6ZG90AHBzOmRvdABlcHM6ZG90AHN2Zzpkb3QAcG5nOnhkb3QAZ2lmOnhkb3QAanBlZzp4ZG90AGpwZTp4ZG90AGpwZzp4ZG90AHBzOnhkb3QAZXBzOnhkb3QAc3ZnOnhkb3QAc3ZnOnN2ZwBwbmc6dm1sAGdpZjp2bWwAanBlZzp2bWwAanBlOnZtbABqcGc6dm1sAGdpZjp0awBpbWFnZSBjcmVhdGUgcGhvdG8gInBob3RvXyVzIiAtZmlsZSAiJXMiCgAkYyBjcmVhdGUgaW1hZ2UgJS4yZiAlLjJmIC1pbWFnZSAicGhvdG9fJXMiCgA8djppbWFnZSBzcmM9IiVzIiBzdHlsZT0iIHBvc2l0aW9uOmFic29sdXRlOyB3aWR0aDolLjJmOyBoZWlnaHQ6JS4yZjsgbGVmdDolLjJmIDsgdG9wOiUuMmYiACAvPgoAZ3Zsb2FkaW1hZ2VfY29yZS5jAGNvcmVfbG9hZGltYWdlX3BzbGliAFsgACVnICVnIABdICAlZCB0cnVlICVzCgBdICAlZCBmYWxzZSAlcwoAY29yZV9sb2FkaW1hZ2VfcHMAZ3NhdmUgJWcgJWcgdHJhbnNsYXRlIG5ld3BhdGgKAHVzZXJfc2hhcGVfJWQKAGdyZXN0b3JlCgBjb3JlX2xvYWRpbWFnZV92cm1sAFNoYXBlIHsKACAgYXBwZWFyYW5jZSBBcHBlYXJhbmNlIHsKACAgICBtYXRlcmlhbCBNYXRlcmlhbCB7CgAgICAgICBhbWJpZW50SW50ZW5zaXR5IDAuMzMKACAgICAgICAgZGlmZnVzZUNvbG9yIDEgMSAxCgAgICAgfQoAICAgIHRleHR1cmUgSW1hZ2VUZXh0dXJlIHsgdXJsICIlcyIgfQoAICB9CgBjb3JlX2xvYWRpbWFnZV9maWcAJWQgJWQgJWQgJWQgJWQgJWQgJWQgJWQgJWQgJS4xZiAlZCAlZCAlZCAlZCAlZCAlZAogJWQgJXMKACAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZAoAY29yZV9sb2FkaW1hZ2Vfc3ZnADxpbWFnZSB4bGluazpocmVmPSIAIiB3aWR0aD0iJWdweCIgaGVpZ2h0PSIlZ3B4IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiB4PSIlZyIgeT0iJWciACB0cmFuc2Zvcm09InJvdGF0ZSglZCAlZyAlZykiACIgd2lkdGg9IiVncHgiIGhlaWdodD0iJWdweCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pbllNaW4gbWVldCIgeD0iJWciIHk9IiVnIgAvPgoAZG90X2xheW91dABwaGFzZQBkb3QgZG9lcyBub3Qgc3VwcG9ydCB0aGUgYXNwZWN0IGF0dHJpYnV0ZSBmb3IgZGlzY29ubmVjdGVkIGdyYXBocyBvciBncmFwaHMgd2l0aCBjbHVzdGVycwoAY29tcG91bmQAdiA9PSBuAGRvdGluaXQuYwByZW1vdmVfZnJvbV9yYW5rAG9yZGVyAGVkZ2UgbGFiZWxzIHdpdGggc3BsaW5lcz1jdXJ2ZWQgbm90IHN1cHBvcnRlZCBpbiBkb3QgLSB1c2UgeGxhYmVscwoARURfbGFiZWwoZmUpAGRvdHNwbGluZXMuYwBfZG90X3NwbGluZXMAZmxhdCBlZGdlIGJldHdlZW4gYWRqYWNlbnQgbm9kZXMgb25lIG9mIHdoaWNoIGhhcyBhIHJlY29yZCBzaGFwZSAtIHJlcGxhY2UgcmVjb3JkcyB3aXRoIEhUTUwtbGlrZSBsYWJlbHMKACAgRWRnZSAlcyAlcyAlcwoAeHh4ADEwMDAwAHslc30AYXV4ZwBsYWJlbF9mbG9hdABmaXhlZAAobCA9IEVEX2xhYmVsKGZlKSkAc2V0RWRnZUxhYmVsUG9zAGUgIT0gTlVMTABmYXN0Z3IuYwBkZWxldGVfZmFzdF9lZGdlAG4gIT0gTkRfbmV4dChuKQBmYXN0X25vZGUAdSAhPSB2AGZhc3Rfbm9kZWFwcABORF9uZXh0KHYpID09IE5VTEwAZmluZF9mYXN0X25vZGUoZywgbikAZGVsZXRlX2Zhc3Rfbm9kZQBkZWxldGVfZmxhdF9lZGdlAG1lcmdlX29uZXdheSBnbGl0Y2gKAG1lcmdlX29uZXdheQBzYWZlX2RlbGV0ZV9mYXN0X2VkZ2UAbGcAY29tcABjbnQgPT0gc3oAbWluY3Jvc3MuYwBmaXhMYWJlbE9yZGVyAHJlbWluY3Jvc3MAbWluY3Jvc3MgJXM6ICVkIGNyb3NzaW5ncywgJS4yZiBzZWNzLgoAdgBuZWlnaGJvcgAocnYgPT0gMCkgfHwgKE5EX29yZGVyKHJ2KS1ORF9vcmRlcih2KSkqZGlyID4gMABjb25zdHJhaW5pbmdfZmxhdF9lZGdlKGcsdixlKSA9PSBGQUxTRQBmbGF0X3Jlb3JkZXIATkRfcmFuayh2KSA9PSByAHBvc3RvcmRlcgBmbGF0aW5kZXgoYWdoZWFkKGUpKSA8IE0tPm5yb3dzAGZsYXRfc2VhcmNoAGZsYXRpbmRleChhZ3RhaWwoZSkpIDwgTS0+bmNvbHMAb3V0AG9yZGVyaW5nICclcycgbm90IHJlY29nbml6ZWQuCgBvcmRlcmluZyAnJXMnIG5vdCByZWNvZ25pemVkIGZvciBub2RlICclcycuCgBtZXJnZTI6IGdyYXBoICVzLCByYW5rICVkIGhhcyBvbmx5ICVkIDwgJWQgbm9kZXMKAG1pbmNyb3NzOiBwYXNzICVkIGl0ZXIgJWQgdHJ5aW5nICVkIGN1cl9jcm9zcyAlZCBiZXN0X2Nyb3NzICVkCgBORF9vcmRlcih2KSA8IE5EX29yZGVyKHcpAGJhbGFuY2UAdHJhbnNwb3NlX3N0ZXAAc3VycHJpc2UKAGluc3RhbGxfaW5fcmFuaywgbGluZSAlZDogJXMgJXMgcmFuayAlZCBpID0gJWQgYW4gPSAwCgBHRF9yYW5rKGcpW3JdLm4gPD0gR0RfcmFuayhnKVtyXS5hbgBpbnN0YWxsX2luX3JhbmsAaW5zdGFsbF9pbl9yYW5rLCBsaW5lICVkOiBORF9vcmRlciglcykgWyVkXSA+IEdEX3JhbmsoUm9vdClbJWRdLmFuIFslZF0KAGluc3RhbGxfaW5fcmFuaywgbGluZSAlZDogcmFuayAlZCBub3QgaW4gcmFuayByYW5nZSBbJWQsJWRdCgBpbnN0YWxsX2luX3JhbmssIGxpbmUgJWQ6IEdEX3JhbmsoZylbJWRdLnYgKyBORF9vcmRlciglcykgWyVkXSA+IEdEX3JhbmsoZylbJWRdLmF2ICsgR0RfcmFuayhSb290KVslZF0uYW4gWyVkXQoAX25ld19yYW5rAG1jbGltaXQAcmFuayhnLCAyLCBuc2l0ZXIyKGcpKSA9PSAwAHBvc2l0aW9uLmMAZG90X3Bvc2l0aW9uAEFSPSUwLjRsZgkgQXJlYT0gJTAuNGxmCQBEdW1teT0lZAoAR29pbmcgdG8gYXBwbHkgYW5vdGhlciBleHBhbnNpb24uCgBuZXh0I2l0ZXI9JWQKAGhwAGNvbm5lY3RHcmFwaABFZGdlIGxlbmd0aCAlZiBsYXJnZXIgdGhhbiBtYXhpbXVtICV1IGFsbG93ZWQuCkNoZWNrIGZvciBvdmVyd2lkZSBub2RlKHMpLgoAbnNsaW1pdABjb250YWluX25vZGVzIGNsdXN0ICVzIHJhbmsgJWQgbWlzc2luZyBub2RlCgBuc2xpbWl0MQBuZXdyYW5rAE1heHJhbmsgPSAlZCwgbWlucmFuayA9ICVkCgBsZWFkZXIgIT0gTlVMTAByYW5rLmMAY2x1c3Rlcl9sZWFkZXIAKE5EX1VGX3NpemUobikgPD0gMSkgfHwgKG4gPT0gbGVhZGVyKQBhZ2hlYWQoZSkgPT0gVUZfZmluZChhZ2hlYWQoZSkpAG1pbm1heF9lZGdlcwBhZ3RhaWwoZSkgPT0gVUZfZmluZChhZ3RhaWwoZSkpAHJhbmsAc2FtZQBtaW4Ac291cmNlAG1heABzaW5rAGxldmVsIGFzc2lnbm1lbnQgY29uc3RyYWludHMAbGV2ZWwgZ3JhcGggcmVjAH9yb290AH90b3AAf2JvdABjb21wYWN0AF93ZWFrXyVkAHJhbmtpbmc6IGZhaWx1cmUgdG8gY3JlYXRlIHN0cm9uZyBjb25zdHJhaW50IGVkZ2UgYmV0d2VlbiBub2RlcyAlcyBhbmQgJXMKACVzIGhhcyB1bnJlY29nbml6ZWQgcmFuaz0lcwBsZXZlbCBlZGdlIHJlYwBsZXZlbCBub2RlIHJlYwBzYW1laGVhZABzYW1ldGFpbAB0b28gbWFueSAoPiAlZCkgc2FtZXtoZWFkLHRhaWx9IGdyb3VwcyBmb3Igbm9kZSAlcwoAY29tYmlBUiA9ICVsZgoAJWxmLCVkAHRoZSBhc3BlY3QgYXR0cmlidXRlIGhhcyBiZWVuIGRpc2FibGVkIGR1ZSB0byBpbXBsZW1lbnRhdGlvbiBmbGF3cyAtIGF0dHJpYnV0ZSBpZ25vcmVkLgoARURfdG9fdmlydChlKSA9PSBOVUxMAGNsYXNzMi5jAG1lcmdlX2NoYWluAEVEX3RvX3ZpcnQob3JpZykgPT0gTlVMTABtYWtlX2NoYWluAEVEX3RvX3ZpcnQob3JpZykgIT0gTlVMTABORF9yYW5rKGZyb20pIDwgTkRfcmFuayh0bykAY2x1c3Rlci5jAG1hcF9wYXRoACVzIHdhcyBhbHJlYWR5IGluIGEgcmFua3NldCwgZGVsZXRlZCBmcm9tIGNsdXN0ZXIgJXMKAGxoZWFkAGx0YWlsACVzIC0+ICVzOiBzcGxpbmUgc2l6ZSA+IDEgbm90IHN1cHBvcnRlZAoAJXMgLT4gJXM6IGhlYWQgbm90IGluc2lkZSBoZWFkIGNsdXN0ZXIgJXMKACVzIC0+ICVzOiB0YWlsIGlzIGluc2lkZSBoZWFkIGNsdXN0ZXIgJXMKAGJlei0+c2ZsYWcAY29tcG91bmQuYwBtYWtlQ29tcG91bmRFZGdlAGJlei0+ZWZsYWcAJXMgLT4gJXM6IHRhaWwgbm90IGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKACVzIC0+ICVzOiBoZWFkIGlzIGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKAHNlZ21lbnQgWyVzLCVzXSBkb2VzIG5vdCBpbnRlcnNlY3QgYm94IGxsPSVzLHVyPSVzCgBib3hJbnRlcnNlY3RmACglLjVnLCUuNWcpAGNsdXN0ZXIgbmFtZWQgJXMgbm90IGZvdW5kCgBjb25jZW50cmF0ZT10cnVlIG1heSBub3Qgd29yayBjb3JyZWN0bHkuCgByZWJ1aWx0ZF92bGlzdHM6IHJhbmsgbGVhZCAlcyBub3QgaW4gb3JkZXIgJWQgb2YgcmFuayAlZAoAZGVnZW5lcmF0ZSBjb25jZW50cmF0ZWQgcmFuayAlcywlZAoATkRfaW4ocmlnaHQpLnNpemUgKyBORF9vdXQocmlnaHQpLnNpemUgPT0gMABjb25jLmMAbWVyZ2V2aXJ0dWFsAGRvdDogT3V0IG9mIG1lbW9yeQoATkRfb3V0KHYpLnNpemUgPT0gMgBmbGF0LmMAc2V0Ym91bmRzAEdEX21pbnJhbmsoZykgPT0gMABhYm9taW5hdGlvbgBuZWF0b19sYXlvdXQAbmVhdG8AZmRwAHNmZHAAdHdvcGkAY2lyY28AcGF0Y2h3b3JrAG9zYWdlAG5vcABub3AxAG5vcDIAJWxmLCVsZiwlbGYlYwBub2RlICVzLCBwb3NpdGlvbiAlcywgZXhwZWN0ZWQgdHdvIGRvdWJsZXMKAG5vdHJhbnNsYXRlAG5vZGUgJXMgaW4gZ3JhcGggJXMgaGFzIG5vIHBvc2l0aW9uCgBzLCVsZiwlbGYlbgAgZSwlbGYsJWxmJW4AcG9zIGF0dHJpYnV0ZSBmb3IgZWRnZSAoJXMsJXMpIGRvZXNuJ3QgaGF2ZSAzbisxIHBvaW50cwoAJWxmLCVsZiVuAHN5bnRheCBlcnJvciBpbiBwb3MgYXR0cmlidXRlIGZvciBlZGdlICglcywlcykKACVsZiwlbGYsJWxmLCVsZgBzdGFydABzZWxmAHJhbmRvbQBub2RlIHBvc2l0aW9ucyBhcmUgaWdub3JlZCB1bmxlc3Mgc3RhcnQ9cmFuZG9tCgBhcyByZXF1aXJlZCBieSB0aGUgLW4gZmxhZwoAX25lYXRvX2NjAGdyYXBoICVzIGlzIGRpc2Nvbm5lY3RlZC4gSGVuY2UsIHRoZSBjaXJjdWl0IG1vZGVsCgBBbHRlcm5hdGl2ZWx5LCBjb25zaWRlciBydW5uaW5nIG5lYXRvIHVzaW5nIC1HcGFjaz10cnVlIG9yIGRlY29tcG9zaW5nCgB0aGUgZ3JhcGggaW50byBjb25uZWN0ZWQgY29tcG9uZW50cy4KAFNvbHZpbmcgbW9kZWwgJWQgaXRlcmF0aW9ucyAlZCB0b2wgJWYKAE5EX2lkKG5wKSA9PSBpAG5lYXRvaW5pdC5jAG1ha2VHcmFwaERhdGEAZiA8IGdyYXBoW2pdLm5lZGdlcwBkZnNDeWNsZQBtb2RlbCAlZCBzbWFydF9pbml0ICVkIHN0cmVzc3d0ICVkIGl0ZXJhdGlvbnMgJWQgdG9sICVmCgBjb252ZXJ0IGdyYXBoOiAAbWFqb3JpemF0aW9uCgAlZCBub2RlcyAlLjJmIHNlYwoAbGV2ZWxzZ2FwAGxheW91dCBhYm9ydGVkCgBzdHJlc3N3dAAlcyBhdHRyaWJ1dGUgdmFsdWUgbXVzdCBiZSAxIG9yIDIgLSBpZ25vcmluZwoAbW9kZWwAY2lyY3VpdABzdWJzZXQAc2hvcnRwYXRoAG1kcwBlZGdlcyBpbiBncmFwaCAlcyBoYXZlIG5vIGxlbiBhdHRyaWJ1dGUuIEhlbmNlLCB0aGUgbWRzIG1vZGVsCgBpcyBpbmFwcHJvcHJpYXRlLiBSZXZlcnRpbmcgdG8gdGhlIHNob3J0ZXN0IHBhdGggbW9kZWwuCgBVbmtub3duIHZhbHVlICVzIGZvciBhdHRyaWJ1dGUgIm1vZGVsIiBpbiBncmFwaCAlcyAtIGlnbm9yZWQKAG1vZGUAS0sAbWFqb3IAaGllcgBJbGxlZ2FsIHZhbHVlICVzIGZvciBhdHRyaWJ1dGUgIm1vZGUiIGluIGdyYXBoICVzIC0gaWdub3JlZAoAbWFrZVNwbGluZTogZmFpbGVkIHRvIG1ha2Ugc3BsaW5lIGVkZ2UgKCVzLCVzKQoAc3BsaW5lICVzICVzCgBiID09IG4AbmVhdG9zcGxpbmVzLmMAbWFrZV9iYXJyaWVycwB0aGUgYm91bmRpbmcgYm94ZXMgb2Ygc29tZSBub2RlcyB0b3VjaCAtIGZhbGxpbmcgYmFjayB0byBzdHJhaWdodCBsaW5lIGVkZ2VzCgBzb21lIG5vZGVzIHdpdGggbWFyZ2luICglLjAyZiwlLjAyZikgdG91Y2ggLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAcG9seWxpbmVzAGxpbmUgc2VnbWVudHMAb3J0aG9nb25hbCBsaW5lcwBDcmVhdGluZyBlZGdlcyB1c2luZyAlcwoAcG9seWxpbmUgJXMgJXMKAG1kc01vZGVsOiBkZWx0YSA9ICVmCgBTZXR0aW5nIHVwIHN0cmVzcyBmdW5jdGlvbgBTb2x2aW5nIG1vZGVsOiAACmZpbmFsIGUgPSAlZiAlZCBpdGVyYXRpb25zICUuMmYgc2VjCgBEYW1waW5nAGRlZmF1bHRkaXN0ACBpbiAlcyAtIHNldHRpbmcgdG8gJS4wMmYKAGJhZCBlZGdlIGxlbiAiJXMiAFNldHRpbmcgaW5pdGlhbCBwb3NpdGlvbnMKAHN0YXJ0PSVzIG5vdCBzdXBwb3J0ZWQgd2l0aCBtb2RlPXNlbGYgLSBpZ25vcmVkCgBTZXR0aW5nIHVwIHNwcmluZyBtb2RlbDogACUuMmYgc2VjCgAKZmluYWwgZSA9ICVmACEAICVkJXMgaXRlcmF0aW9ucyAlLjJmIHNlYwoATWF4LiBpdGVyYXRpb25zICglZCkgcmVhY2hlZCBvbiBncmFwaCAlcwoAJXMgJS4zZgoAJS4zZiAATkRfaGVhcGluZGV4KHYpIDwgMABzdHVmZi5jAG5lYXRvX2VucXVldWUAQ2FsY3VsYXRpbmcgc2hvcnRlc3QgcGF0aHM6IABzcGVjaWZpZWQgcm9vdCBub2RlICIlcyIgd2FzIG5vdCBmb3VuZC4AVXNpbmcgZGVmYXVsdCBjYWxjdWxhdGlvbiBmb3Igcm9vdCBub2RlCgByZXBvc2l0aW9uICVzCgAlcyA6ICVmICVmCgAlcyA6ICVmICVmICVmICVmCgAgIABHcmFwaCAlcyBoYXMgYXJyYXkgcGFja2luZyB3aXRoIHVzZXIgdmFsdWVzIGJ1dCBubyAic29ydHYiIGF0dHJpYnV0ZXMgYXJlIGRlZmluZWQuAHBpbgBXYXJuaW5nOiBub2RlICVzLCBwb3NpdGlvbiAlcywgZXhwZWN0ZWQgdHdvIGZsb2F0cwoAY29vcmRzAGxheW91dCAlcwoAZW5kICVzCgBpZHggPT0gc3oAbGF5b3V0LmMAZXhwYW5kQ2x1c3RlcgBpID09IGRlZwBnZXRFZGdlTGlzdABfZGdfJWQAZGVyaXZlIGdyYXBoICVzIG9mICVzCgBub2RlICIlcyIgaXMgY29udGFpbmVkIGluIHR3byBub24tY29tcGFyYWJsZSBjbHVzdGVycyAiJXMiIGFuZCAiJXMiCgBfcG9ydF8lc18lc18lc18lbGQAX3BvcnRfJXNfKCVkKV8oJWQpXyVsZAAlbGYsJWxmLCVsZiwlbGYlYwBncmFwaCAlcywgY29vcmQgJXMsIGV4cGVjdGVkIGZvdXIgZG91YmxlcwoAc3BsaW5lcyBhbmQgY2x1c3RlciBlZGdlcyBub3Qgc3VwcG9ydGVkIC0gdXNpbmcgbGluZSBzZWdtZW50cwoAbWF4aXRlcgBUMABmZHAgZG9lcyBub3Qgc3VwcG9ydCBzdGFydD1zZWxmIC0gaWdub3JpbmcKAHhMYXlvdXQgADk6cHJpc20AdHJpZXMgPSAlZCwgbW9kZSA9ICVzCgBkZXJpdmVkAGluZm8Ac2ZkcCBvbmx5IHN1cHBvcnRzIHN0YXJ0PXJhbmRvbQoASwByZXB1bHNpdmVmb3JjZQBsZXZlbHMAc21vb3RoaW5nAHF1YWR0cmVlAGJlYXV0aWZ5AG92ZXJsYXBfc2hyaW5rAHJvdGF0aW9uAGxhYmVsX3NjaGVtZQBsYWJlbF9zY2hlbWUgPSAlZCA+IDQgOiBpZ25vcmluZwoAZmFzdABhdmdfZGlzdABncmFwaF9kaXN0AHBvd2VyX2Rpc3QAc3ByaW5nAGRpbWVuAGRpbQBzcHJpbmdfZWxlY3RyaWNhbF9jb250cm9sOgoAICByZXB1bHNpdmUgYW5kIGF0dHJhY3RpdmUgZXhwb25lbnRzOiAlLjAzZiAlLjAzZgoAICByYW5kb20gc3RhcnQgJWQgc2VlZCAlZAoAICBLIDogJS4wM2YgQyA6ICUuMDNmCgAgIG1heCBsZXZlbHMgJWQgY29hcnNlbl9zY2hlbWUgJWQgY29hcnNlbl9ub2RlICVkCgAgIHF1YWR0cmVlIHNpemUgJWQgbWF4X2xldmVsICVkCgAgIEJhcm5lcy1IdXR0IGNvbnN0YW50ICUuMDNmIHRvbGVyYW5jZSAgJS4wM2YgbWF4aXRlciAlZAoAICBjb29saW5nICUuMDNmIHN0ZXAgc2l6ZSAgJS4wM2YgYWRhcHRpdmUgJWQKACAgYmVhdXRpZnlfbGVhdmVzICVkIG5vZGUgd2VpZ2h0cyAlZCByb3RhdGlvbiAlLjAzZgoAICBzbW9vdGhpbmcgJXMgb3ZlcmxhcCAlZCBpbml0aWFsX3NjYWxpbmcgJS4wM2YgZG9fc2hyaW5raW5nICVkCgAgIG9jdHJlZSBzY2hlbWUgJXMgbWV0aG9kICVzCgAgIGVkZ2VfbGFiZWxpbmdfc2NoZW1lICVkCgBTUFJJTkdfRUxFQ1RSSUNBTABTUFJJTkdfTUFYRU5UAFNUUkVTU19NQVhFTlQAU1RSRVNTX0FQUFJPWABTVFJFU1MAVU5JRk9STV9TVFJFU1MARlVMTF9TVFJFU1MATk9ORQBOT1JNQUwARkFTVABIWUJSSUQAU1RSRVNTX01BSk9SSVpBVElPTl9HUkFQSF9ESVNUAFNUUkVTU19NQUpPUklaQVRJT05fQVZHX0RJU1QAU1RSRVNTX01BSk9SSVpBVElPTl9QT1dFUl9ESVNUAFNQUklORwBUUklBTkdMRQBSTkcADSAgICAgICAgICAgICAgICBpdGVyID0gJWQsIHN0ZXAgPSAlZiBGbm9ybSA9ICVmIG56ID0gJWQgIEsgPSAlZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAc3ByaW5nX2VsZWN0cmljYWxfZW1iZWRkaW5nX3Nsb3cAZG1lYW4gPSAlZiwgcmhvID0gJWYKAHNlbmQgcmFuZG9tIGNvb3JkaW5hdGVzCgBzY2FsaW5nIGZhY3RvciA9ICVmCgBRVUFEX1RSRUVfSFlCUklELCBzaXplIGxhcmdlciB0aGFuICVkLCBzd2l0Y2ggdG8gZmFzdCBxdWFkdHJlZQBjdHJsLT5vdmVybGFwPSVkCgAlZCAlZAoAdW5pZm9ybV9zdHJlc3MuYwBVbmlmb3JtU3RyZXNzU21vb3RoZXJfbmV3AFNwYXJzZU1hdHJpeF9pc19zeW1tZXRyaWMoQiwgRkFMU0UpAHVuaWZvcm1fc3RyZXNzAHxlZGdlbGFiZWx8AGxlbgBub3JtYWxpemUAb3ZlcmxhcABPdmVybGFwIHZhbHVlICIlcyIgdW5zdXBwb3J0ZWQgLSBpZ25vcmVkCgBVbnJlY29nbml6ZWQgb3ZlcmxhcCB2YWx1ZSAiJXMiIC0gdXNpbmcgZmFsc2UKAFZvcm9ub2kAb3ZlcmxhcDogJXMgdmFsdWUgJWQgc2NhbGluZyAlLjA0ZgoAb3ZlcmxhcF9zY2FsaW5nAHZvcm9ub2kAc2NhbGluZwB2cHNjAGlwc2VwAG9zY2FsZQBvbGQgc2NhbGluZwBzY2FsZXh5AHggYW5kIHkgc2NhbGluZwBvcnRobwBvcnRob2dvbmFsIGNvbnN0cmFpbnRzAG9ydGhvX3l4AG9ydGhveHkAeHkgb3J0aG9nb25hbCBjb25zdHJhaW50cwBvcnRob3l4AHl4IG9ydGhvZ29uYWwgY29uc3RyYWludHMAcG9ydGhvAHBzZXVkby1vcnRob2dvbmFsIGNvbnN0cmFpbnRzAHBvcnRob195eABwb3J0aG94eQB4eSBwc2V1ZG8tb3J0aG9nb25hbCBjb25zdHJhaW50cwBwb3J0aG95eAB5eCBwc2V1ZG8tb3J0aG9nb25hbCBjb25zdHJhaW50cwBwcmlzbQBBZGp1c3RpbmcgJXMgdXNpbmcgJXMKAFVuaGFuZGxlZCBhZGp1c3Qgb3B0aW9uICVzCgBOdW1iZXIgb2YgaXRlcmF0aW9ucyA9ICVkCgBOdW1iZXIgb2YgaW5jcmVhc2VzID0gJWQKAG92ZXJsYXAgWyVkXSA6ICVkCgB2b3JvX21hcmdpbgBzZXAAZXNlcABOb2RlIHNlcGFyYXRpb246IGFkZD0lZCAoJWYsJWYpCgAlZiwlZgBzY2FsZSA9ICglLjAzZiwlLjAzZikKAEVkZ2Ugc2VwYXJhdGlvbjogYWRkPSVkICglZiwlZikKAENhbGN1bGF0aW5nIGNpcmN1aXQgbW9kZWwAY29uanVnYXRlX2dyYWRpZW50OiB1bmV4cGVjdGVkIGxlbmd0aCAwIHZlY3RvcgoAQ2FsY3VsYXRpbmcgc3Vic2V0IG1vZGVsAGdyYXBoIGlzIGRpc2Nvbm5lY3RlZC4gSGVuY2UsIHRoZSBjaXJjdWl0IG1vZGVsCgBpcyB1bmRlZmluZWQuIFJldmVydGluZyB0byB0aGUgc2hvcnRlc3QgcGF0aCBtb2RlbC4KAENhbGN1bGF0aW5nIE1EUyBtb2RlbABDYWxjdWxhdGluZyBzaG9ydGVzdCBwYXRocwA6ICUuMmYgc2VjCgBTZXR0aW5nIGluaXRpYWwgcG9zaXRpb25zADogJS4yZiBzZWMAY2cAZGVsdGEgPD0gMHhGRkZGAGNvbnN0cmFpbnQuYwBta05Db25zdHJhaW50RwB2ZwBjb21wcmVzcyAlZyAKAHNjYWxlIGJ5ICVnLCVnIAoAYmVzdGNvc3QgPCBIVUdFX1ZBTABjb21wdXRlU2NhbGVYWQBHcmFwaHZpeiBidWlsdCB3aXRob3V0IGFueSB0cmlhbmd1bGF0aW9uIGxpYnJhcnkKAGRlbGF1bmF5X3RyaWFuZ3VsYXRpb246ICVzCgBkZWxhdW5heV90cmk6ICVzCgB0cnlpbmcgdG8gZGVsZXRlIGEgbm9uLWxpbmUKAAppbnRlcnNlY3Rpb24gYXQgJS4zZiAlLjNmCgBzZWcjJWQgOiAoJS4zZiwgJS4zZikgKCUuM2YsICUuM2YpCgByZW1vdmVfb3ZlcmxhcDogR3JhcGh2aXogbm90IGJ1aWx0IHdpdGggdHJpYW5ndWxhdGlvbiBsaWJyYXJ5CgBtYWtlQWRkUG9seTogdW5rbm93biBzaGFwZSB0eXBlICVzCgBtYWtlUG9seTogdW5rbm93biBzaGFwZSB0eXBlICVzCgB4IT1OVUxMAHNtYXJ0X2luaV94LmMASU1EU19naXZlbl9kaW0AaWxsLWNvbmRpdGlvbmVkAHJvb3QgPSAlcyBtYXggc3RlcHMgdG8gcm9vdCA9ICVkCgB0d29waTogdXNlIG9mIHdlaWdodD0wIGNyZWF0ZXMgZGlzY29ubmVjdGVkIGNvbXBvbmVudC4KAFJhbmsgc2VwYXJhdGlvbiA9IAAlLjAzbGYgAGFyZWEAaW5zZXQAJXMgY29vcmQgJS41ZyAlLjVnIGh0ICVmIHdpZHRoICVmCgAlLjAzZgByZWMgJWYgJWYgJWYgJWYKACVmIC0gJWYgJWYgJWYgJWYgPSAlZiAoJWYgJWYgJWYgJWYpCgB0cnlpbmcgdG8gYWRkIHRvIHJlY3QgeyVmICsvLSAlZiwgJWYgKy8tICVmfQoAdG90YWwgYWRkZWQgc28gZmFyID0gJWQKAGFkZGluZyAlZCBpdGVtcywgdG90YWwgYXJlYSA9ICVmLCB3ID0gJWYsIGFyZWEvdz0lZgoAY29tcG91bmRFZGdlczogY291bGQgbm90IGNvbnN0cnVjdCBvYnN0YWNsZXMgLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAY29tcG91bmRFZGdlczogbm9kZXMgdG91Y2ggLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAcGFjayB2YWx1ZSAlZCBpcyBzbWFsbGVyIHRoYW4gZXNlcCAoJS4wM2YsJS4wM2YpCgBzZXAgdmFsdWUgKCUuMDNmLCUuMDNmKSBpcyBzbWFsbGVyIHRoYW4gZXNlcCAoJS4wM2YsJS4wM2YpCgBjYyVzXyVkAGNjJXMrJWQAY19jbnQgPT0gMABjb21wLmMAZmluZENDb21wAGdyaWQoJWQsJWQpOiAlcwoAd2d0ID4gMABRdWFkVHJlZS5jAFF1YWRUcmVlX3JlcHVsc2l2ZV9mb3JjZV9hY2N1bXVsYXRlAHF0Mi0+biA+IDAAcXQxLT5uID4gMCAmJiBxdDItPm4gPiAwAFF1YWRUcmVlX3JlcHVsc2l2ZV9mb3JjZV9pbnRlcmFjdABkaXN0ID4gMAAhKHEtPmwpAFF1YWRUcmVlX2FkZF9pbnRlcm5hbABpaSA8IDE8PGRpbSAmJiBpaSA+PSAwAHEtPnF0c1tpaV0AcS0+biA9PSAxACEocS0+cXRzKQBxLT5sAHdpZHRoID4gMABRdWFkVHJlZV9uZXcAQS0+Zm9ybWF0ID09IEZPUk1BVF9DU1IAU3BhcnNlTWF0cml4LmMAU3BhcnNlTWF0cml4X3RyYW5zcG9zZQBBICYmIEIAU3BhcnNlTWF0cml4X2FkZABBLT5mb3JtYXQgPT0gQi0+Zm9ybWF0ICYmIEEtPmZvcm1hdCA9PSBGT1JNQVRfQ1NSAEEtPnR5cGUgPT0gQi0+dHlwZQBTcGFyc2VNYXRyaXhfaXNfc3ltbWV0cmljAEEtPmZvcm1hdCA9PSBGT1JNQVRfQ09PUkQAU3BhcnNlTWF0cml4X2Zyb21fY29vcmRpbmF0ZV9mb3JtYXQAbSA+IDAgJiYgbiA+IDAgJiYgbnogPj0gMABTcGFyc2VNYXRyaXhfZnJvbV9jb29yZGluYXRlX2FycmF5c19pbnRlcm5hbABBAGphW21hc2tbamFbal1dXSA9PSBqYVtqXQBTcGFyc2VNYXRyaXhfc3VtX3JlcGVhdF9lbnRyaWVzAGlkIDwgbiooeW1heC15bWluKzEpAGphW21hc2tbaWRdXSA9PSBqYVtqXQBTcGFyc2VNYXRyaXhfbXVsdGlwbHlfZGVuc2UyAEEtPnR5cGUgPT0gTUFUUklYX1RZUEVfUkVBTABTcGFyc2VNYXRyaXhfbXVsdGlwbHlfdmVjdG9yAEEtPnR5cGUgPT0gTUFUUklYX1RZUEVfUkVBTCB8fCBBLT50eXBlID09IE1BVFJJWF9UWVBFX0lOVEVHRVIAU3BhcnNlTWF0cml4X211bHRpcGx5X2RlbnNlMQBTcGFyc2VNYXRyaXhfbXVsdGlwbHkAamNbbWFza1tqYltrXV1dID09IGpiW2tdAFNwYXJzZU1hdHJpeF9tdWx0aXBseTMAamRbbWFza1tqY1trXV1dID09IGpjW2tdAFNwYXJzZU1hdHJpeF9jb29yZGluYXRlX2Zvcm1fYWRkX2VudHJpZXMAU3BhcnNlTWF0cml4X2RpdmlkZV9yb3dfYnlfZGVncmVlAG4gPiAxAGdlbmVyYWwuYwBpcmFuZABvbmVibG9jawBtaW5kaXN0AGFydGljdWxhdGlvbl9wb3MAcm9vdABQcmlvcml0eVF1ZXVlLmMAUHJpb3JpdHlRdWV1ZV9wdXNoAGdhaW4gPD0gcS0+bmdhaW4AU3BhcnNlTWF0cml4X2lzX3N5bW1ldHJpYyhBLCBGQUxTRSkAcG9zdF9wcm9jZXNzLmMAaWRlYWxfZGlzdGFuY2VfbWF0cml4AGxlbiA+IDAAU3RyZXNzTWFqb3JpemF0aW9uU21vb3RoZXIyX25ldwBueiA+IDAAaWRlYWxfZGlzdF9zY2hlbWUgdmFsdWUgd3JvbmcAU3BhcnNlTWF0cml4X2lzX3N5bW1ldHJpYyhBLCBGQUxTRSkgJiYgQS0+dHlwZSA9PSBNQVRSSVhfVFlQRV9SRUFMAFNwYXJzZVN0cmVzc01ham9yaXphdGlvblNtb290aGVyX25ldwBpZGlhZyA+PSAwAFN0cmVzc01ham9yaXphdGlvblNtb290aGVyX3Ntb290aAAoIWpjbikgJiYgKCF2YWwpAGdldF9lZGdlX2xhYmVsX21hdHJpeABUcmlhbmdsZVNtb290aGVyX25ldwBqZGlhZyA+PSAwAFNwcmluZ1Ntb290aGVyX25ldwAhZmxhZwBTcHJpbmdTbW9vdGhlcl9zbW9vdGgAbmVpZ2hiPSVkCgByb290ID0gJXMKAF9ibG9ja18lZABzLT5zeiA+IDAAYmxvY2t0cmVlLmMAcG9wAGFjdHVhbABub2RlbGlzdC5jAGluc2VydE5vZGVsaXN0AF9zcGFuXyVkAF9jbG9uZV8lZABpcABkZWdsaXN0LmMAcmVtb3ZlRGVnbGlzdABFcnJvcgBXYXJuaW5nACVzOiAAdXNlcm91dDogY291bGQgbm90IGFsbG9jYXRlIG1lbW9yeQoAX0FHX3N0cmRhdGEAX0FHX2RhdGFkaWN0AGFnZGljdG9mOiB1bmtub3duIGtpbmQgJWQKACVjJWxkAG1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUAYWdkZWxldGUgb24gd3JvbmcgZ3JhcGgAX0FHX3BlbmRpbmcAYWdyZWNvcmRfY2FsbGJhY2sgb2YgYSBiYWQgb2JqZWN0AHBlbmQgZGljdG9mIGEgYmFkIG9iamVjdABtb3ZlIHRvIGZyb250IGxvY2sgaW5jb25zaXN0ZW5jeQBcXABmYXRhbCBmbGV4IHNjYW5uZXIgaW50ZXJuYWwgZXJyb3ItLW5vIGFjdGlvbiBmb3VuZAAlcwoAZmF0YWwgZmxleCBzY2FubmVyIGludGVybmFsIGVycm9yLS1lbmQgb2YgYnVmZmVyIG1pc3NlZABmYXRhbCBlcnJvciAtIHNjYW5uZXIgaW5wdXQgYnVmZmVyIG92ZXJmbG93AG91dCBvZiBkeW5hbWljIG1lbW9yeSBpbiBhYWdfZ2V0X25leHRfYnVmZmVyKCkAaW5wdXQAc3ludGF4IGFtYmlndWl0eSAtIGJhZGx5IGRlbGltaXRlZCBudW1iZXIgJwAnIGluIGxpbmUgJWQgb2YgACBzcGxpdHMgaW50byB0d28gdG9rZW5zCgAlcwBsaW5lACVkICUxWyJdJW4Ab3V0IG9mIGR5bmFtaWMgbWVtb3J5IGluIGFhZ19jcmVhdGVfYnVmZmVyKCkAb3V0IG9mIGR5bmFtaWMgbWVtb3J5IGluIGFhZ2Vuc3VyZV9idWZmZXJfc3RhY2soKQA6IAAgaW4gbGluZSAlZAAgbmVhciAnACBzY2FubmluZyBhIHF1b3RlZCBzdHJpbmcgKG1pc3NpbmcgZW5kcXVvdGU/IGxvbmdlciB0aGFuICVkPykAClN0cmluZyBzdGFydGluZzoiACBzY2FubmluZyBhIEhUTUwgc3RyaW5nIChtaXNzaW5nICc+Jz8gYmFkIG5lc3Rpbmc/IGxvbmdlciB0aGFuICVkPykAClN0cmluZyBzdGFydGluZzo8ACBzY2FubmluZyBhIC8qLi4uKi8gY29tbWVudCAobWlzc2luZyAnKi8/IGxvbmdlciB0aGFuICVkPykAZmxleCBzY2FubmVyIHB1c2gtYmFjayBvdmVyZmxvdwAiIgBzdHJpY3QAbGluZWxlbmd0aAA7CgAgW2tleT0AXQAgWwAsCgA9AF8lbGRfU1VTUEVDVABkaQBzdHJpY3QgAHsKAF07CgAS7u4UCQPu/u7u7gHu7u4B7u4K/u4TGRXuEwHu7u7uCxHu7u7u7u7u7u4B7u4WCQEBHQ8X7u4aFxvu7hzu7u7uARn77u7uAe4Q7u4e7u7u7gACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXEQICAgICAgICAgICAgISEAITAgIWAgICAgICAgICAgICAgICAgICAgICAgICAgIUAhUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg4CDwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBAgMEBQYHCAkKCwwNCwMEBQ8HAwwNBgwNDgwNGhUWAAEAAwcOBg8IDA0SEyoQEQkQLzARMhcTDRQSLhIUQRMyEyxAKkIZLEJGIgwNDiMPCRARChARyRARLUVG/AEG9g8H9iQCEBEvMDZNTigmOzwqNjE5PT8vOkDYRDA+JTdDNUsrOElMAAMJAAAAAQ4CCwwIIyQlNjs9AA0QEhsWHBInMiIXMx48Bgc1BQ8RFBgpABMpAAAAAAA3FSgdHgAhJjQfMD4ZLAAbACAaKgArOi4vADE4OS0AAgIBAAMDAQABAAEBAQACAQEAAgIDAQEAAAUAAQMBAwUDAQEBAQIAAQAEAgACAQEDAgEAAwIBAAEBAAEBAQMAGBkZGRobHBwdHR4eHx8gICEhIiIjJCQmJyUlKCgpKSkqKisrKywsLS0uLy8wMTEyMzQ2NTc3Nzg4ODk5Ojru7v/u7u7u7u4fIO4A7+7u7gzu7u4IDe7u7vju7u7u7u717v8DCAQhBQsSEycUFRYpMkEXGBkaLDM0QkdIG0ocHS4eTx8ga2V5AGF0dHJpYnV0ZSBtYWNyb3Mgbm90IGltcGxlbWVudGVkACVzOiVzAENvdWxkIG5vdCBvcGVuICIlcyIgZm9yIHdyaXRpbmcgOiAlcwoATm8gbGlieiBzdXBwb3J0LgoALiVkAG5vbmFtZS5ndgBndndyaXRlX25vX3ogcHJvYmxlbSAlZAoAbWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZQoATm8gbGlieiBzdXBwb3J0CgBndnByaW50ZjogJXMKAC05OTk5OTk5OTk5OTk5OTkuOTkAZ3JhcGh2aXoAMi40MC4xADIwMTYxMjI1LjAzMDQAcmVuZGVyAGRldmljZQBsb2FkaW1hZ2UAZHluYW1pYyBsb2FkaW5nIG5vdCBhdmFpbGFibGUKAFVzaW5nICVzOiAlczolcwoAZ3Z1c2Vyc2hhcGUuYwBndnVzZXJzaGFwZV9maW5kAGd2dXNlcnNoYXBlX2ZpbGVfYWNjZXNzAEZpbGVuYW1lICIlcyIgaXMgdW5zYWZlCgAlcyB3aGlsZSBvcGVuaW5nICVzCgB1cy0+ZgBndnVzZXJzaGFwZV9vcGVuACIlcyIgd2FzIG5vdCBmb3VuZCBhcyBhIGZpbGUgb3IgYXMgYSBzaGFwZSBsaWJyYXJ5IG1lbWJlcgoAL01lZGlhQm94AChbYS16XVthLXpBLVpdKik9IihbXiJdKikiAGNhbm5vdCBjb21waWxlIHJlZ3VsYXIgZXhwcmVzc2lvbiAlcwAlbGYlMnMAcHQAdmlld0JveAAlbGYgJWxmICVsZiAlbGYAaW4AcHgAcGMAIgBjbQBtbQAlJUJvdW5kaW5nQm94OgAB0NHS09TV1tfY2QA8c3ZnAFdFQlAAd2VicAAobGliKQCJUE5HDQoaCgBwbmcAJSFQUy1BZG9iZS0AQk0AYm1wAEdJRjgAZ2lmAP/Y/+AAanBlZwAlUERGLQBwZGYAxdDTxgBlcHMAPD94bWwAeG1sAFJJRkYAcmlmZgAAAAEAAGljbwAlZCAlZCAlZCAlZABMYXlvdXQgd2FzIG5vdCBkb25lCgBmYWlsdXJlIG1hbGxvYydpbmcgZm9yIHJlc3VsdCBzdHJpbmcAZ2M6IE91dCBvZiBtZW1vcnkKAF9jY18Ab3JpZwBvcABjY29tcHMuYwBtYXBDbHVzdABjY2dyYXBoaW5mbwBjY2dub2RlaW5mbwAoJTRsZCkgJTdsZCBub2RlcyAlN2xkIGVkZ2VzCgAgICAgICAgJTdkIG5vZGVzICU3ZCBlZGdlcyAlN2xkIGNvbXBvbmVudHMgJXMKAGRnAEVycm9yOiBub2RlICIlcyIgYmVsb25ncyB0byB0d28gbm9uLW5lc3RlZCBjbHVzdGVycyAiJXMiIGFuZCAiJXMiCgBzb3J0dgByb3cgbWFqb3IAY29sdW1uIG1ham9yAGFycmF5IHBhY2tpbmc6ICVzICVkIHJvd3MgJWQgY29sdW1ucwoAYmJbJXNdICUuNWcgJS41ZyAlLjVnICUuNWcKAHN0ZXAgc2l6ZSA9ICVkCgBwb3NbJWRdICVkICVkCgBjYyAoJWQgY2VsbHMpIGF0ICglZCwlZCkgKCVkLCVkKQoAY2MgKCVkIGNlbGxzKSBhdCAoJWQsJWQpCgAlcyBuby4gY2VsbHMgJWQgVyAlZCBIICVkCgAgICVkICVkIGNlbGwKAGxpYnBhY2s6IGRpc2MgPSAlZiAoIDwgMCkKAFBhY2tpbmc6IGNvbXB1dGUgZ3JpZCBzaXplCgBhICVmIGIgJWYgYyAlZiBkICVmIHIgJWYKAHJvb3QgJWQgKCVmKSAlZCAoJWYpCgAgcjEgJWYgcjIgJWYKAHBpbmZvAHBhY2suYwBnZXRQYWNrSW5mbwAgIG1hcmdpbiAlZAoAcGFja21vZGUAcGFyc2VQYWNrTW9kZUluZm8AYXJyYXkAYXNwZWN0ACVmAHBhY2sgaW5mbzoKACAgbW9kZSAgICVzCgAgIGFzcGVjdCAlZgoAICBzaXplICAgJWQKACAgZmxhZ3MgICVkCgB1bmRlZmluZWQAcGFjawBBcnJvdyB0eXBlICIlcyIgdW5rbm93biAtIGlnbm9yaW5nCgBub3JtYWwAY3JvdwB0ZWUAZG90AGludgB2ZWUAcGVuAG1wdHkAY3VydmUAaWN1cnZlAGwAaGFsZgBpbnZlbXB0eQBfYmFja2dyb3VuZABfZHJhd18AQ291bGQgbm90IHBhcnNlICJfYmFja2dyb3VuZCIgYXR0cmlidXRlIGluIGdyYXBoICVzCgAgICIlcyIKAG5vIG1lbW9yeSBmcm9tIHptYWxsb2MoKQoAb2JqAGVtaXQuYwBwb3Bfb2JqX3N0YXRlAGNsdXN0ACVsZABwYWdlJWQsJWRfAFRvdGFsIHNpemUgPiAxIGluICIlcyIgY29sb3Igc3BlYyAASWxsZWdhbCBsZW5ndGggdmFsdWUgaW4gIiVzIiBjb2xvciBhdHRyaWJ1dGUgAGxucmNvbG9yc2NoZW1lAGVtaXRfZWRnZV9sYWJlbAAlcy0lcwBmb3J3YXJkAGJhY2sAIC0+IAAgLS0gAGluIGVkZ2UgJXMlcyVzCgBsYWJlbGFsaWduZWQAZWRnZWhyZWYAZWRnZVVSTABsYWJlbGhyZWYAbGFiZWxVUkwAdGFpbGhyZWYAdGFpbFVSTABoZWFkaHJlZgBoZWFkVVJMAGVkZ2V0YXJnZXQAbGFiZWx0YXJnZXQAdGFpbHRhcmdldABoZWFkdGFyZ2V0AGVkZ2V0b29sdGlwAGxhYmVsdG9vbHRpcAB0YWlsdG9vbHRpcABoZWFkdG9vbHRpcAABbmVzdGluZyBub3QgYWxsb3dlZCBpbiBzdHlsZTogJXMKAHVubWF0Y2hlZCAnKScgaW4gc3R5bGU6ICVzCgB0cnVuY2F0aW5nIHN0eWxlICclcycKAHVubWF0Y2hlZCAnKCcgaW4gc3R5bGU6ICVzCgBhbGwAaW4gY2x1c3RlciAlcwoATW9yZSB0aGFuIDIgY29sb3JzIHNwZWNpZmllZCBmb3IgYSBncmFkaWVudCAtIGlnbm9yaW5nIHJlbWFpbmluZwoAZ3JhZGllbnQgcGVuIGNvbG9ycyBub3QgeWV0IHN1cHBvcnRlZC4KAEltYWdlcyB1bnN1cHBvcnRlZCBpbiAiYmFja2dyb3VuZCIgYXR0cmlidXRlCgBsYXllcnMgbm90IHN1cHBvcnRlZCBpbiAlcyBvdXRwdXQKAExheW91dCB3YXMgbm90IGRvbmUuICBNaXNzaW5nIGxheW91dCBwbHVnaW5zPyAKAGd2UmVuZGVySm9icyAlczogJS4yZiBzZWNzLgoAbGF5b3V0IHdhcyBub3QgZG9uZQoAcmVuZGVyZXIgZm9yICVzIGlzIHVuYXZhaWxhYmxlCgBwYWdlZGlyPSVzIGlnbm9yZWQKAHZpZXdwb3J0ACVsZiwlbGYsJWxmLCclW14nXScAJWxmLCVsZiwlbGYsJVteLF0lcwAlbGYsJWxmLCVsZiwlbGYsJWxmAG91dHB1dG9yZGVyAG9kZXNmaXJzdABkZ2VzZmlyc3QAbGF5ZXJzAGxheWVyc2VsZWN0AFRoZSBsYXllcnNlbGVjdCBhdHRyaWJ1dGUgIiVzIiBkb2VzIG5vdCBtYXRjaCBhbnkgbGF5ZXIgc3BlY2lmZWQgYnkgdGhlIGxheWVycyBhdHRyaWJ1dGUgLSBpZ25vcmVkLgoAbGF5ZXJzZXAAOgkgAGxheWVybGlzdHNlcAAsAFRoZSBjaGFyYWN0ZXIgJyVjJyBhcHBlYXJzIGluIGJvdGggdGhlIGxheWVyc2VwIGFuZCBsYXllcmxpc3RzZXAgYXR0cmlidXRlcyAtIGxheWVybGlzdHNlcCBpZ25vcmVkLgoAcGFkAEJMAHBhZ2VkaXIAc29saWQAAHNldGxpbmV3aWR0aAAxAABzcGwtPnNpemUgPiAwAGluaXRfc3BsaW5lc19iYgBiei5zaXplID4gMABiZXppZXJfYmIAYnouc2l6ZSAlIDMgPT0gMQAlbGYAZm9udHBhdGgARE9URk9OVFBBVEgAR0RGT05UUEFUSABpbWFnZXBhdGgAcXVhbnR1bQByYW5rZGlyAExSAEJUAFJMAG5vZGVzZXAAcmFua3NlcABlcXVhbGx5AHNob3dib3hlcwBmb250bmFtZXMAc2l6ZQBwYWdlAGNlbnRlcgByb3RhdGUAb3JpZW50YXRpb24AbGFuZHNjYXBlAGNsdXN0ZXJyYW5rAGNvbmNlbnRyYXRlAGRwaQByZXNvbHV0aW9uAG9yZGVyaW5nAGZpbGxjb2xvcgBmb250c2l6ZQBmb250bmFtZQBmb250Y29sb3IAeGxhYmVsAHBlbndpZHRoAHBlcmlwaGVyaWVzAHNrZXcAZGlzdG9ydGlvbgBub2p1c3RpZnkAbGF5ZXIAZ3JvdXAAY29tbWVudAB2ZXJ0aWNlcwB6AHdlaWdodABsYWJlbGZsb2F0AGRpcgBhcnJvd2hlYWQAYXJyb3d0YWlsAGhlYWRsYWJlbAB0YWlsbGFiZWwAbGFiZWxmb250c2l6ZQBsYWJlbGZvbnRuYW1lAGxhYmVsZm9udGNvbG9yAGxhYmVsZGlzdGFuY2UAbGFiZWxhbmdsZQBtaW5sZW4AZGVjb3JhdGUAYXJyb3dzaXplAGNvbnN0cmFpbnQAdGFpbGNsaXAAaGVhZGNsaXAAbGFiZWxqdXN0AGxvY2FsAGdsb2JhbAAlbGYsJWxmJWMAJWxmJWMAcmF0aW8AYXV0bwBjb21wcmVzcwBleHBhbmQAZmlsbABnZABwcwBzdmcAY2hhcnNldAB1dGYtOABsYXRpbi0xAGxhdGluMQBsMQBJU08tODg1OS0xAElTT184ODU5LTEASVNPODg1OS0xAElTTy1JUi0xMDAAYmlnLTUAYmlnNQB1dGY4AFVuc3VwcG9ydGVkIGNoYXJzZXQgIiVzIiAtIGFzc3VtaW5nIHV0Zi04CgBVbnN1cHBvcnRlZCBjaGFyc2V0IHZhbHVlICVkCgBVVEYtOABCSUctNQBpbiBsYWJlbCBvZiBncmFwaCAlcwoAaW4gbGFiZWwgb2Ygbm9kZSAlcwoAaW4gbGFiZWwgb2YgZWRnZSAlcyAlcyAlcwoAa2luZCA9PSBMVF9OT05FAGxhYmVscy5jAG1ha2VfbGFiZWwAXEwAXEcAXEUAXEgAXFQAJiMxMzsAJiMxMDsAJnF1b3Q7ACYjMTYwOwAmYW1wOwAmZ3Q7ACYjMzk7ACYjNDU7ACZsdDsAJXMgJWQgbm9kZXMgJWQgZWRnZXMgbWF4aXRlcj0lZCBiYWxhbmNlPSVkCgBuZXR3b3JrIHNpbXBsZXg6IAAlZCAAJXMlZCBub2RlcyAlZCBlZGdlcyAlZCBpdGVyICUuMmYgc2VjCgB1cGRhdGU6IG1pc21hdGNoZWQgbGNhIGluIHRyZWV1cGRhdGVzCgBUcmVlX2VkZ2Uuc2l6ZSA9PSBOX25vZGVzIC0gMQBucy5jAGZlYXNpYmxlX3RyZWUAIVRSRUVfRURHRShlKQBtZXJnZV90cmVlcwAocjAtPmhlYXBfaW5kZXggPiAtMSkgfHwgKHIxLT5oZWFwX2luZGV4ID4gLTEpAFNUc2V0VW5pb24Aci0+aGVhcF9pbmRleCA+PSAwAGFkZF90cmVlX2VkZ2U6IG1pc3NpbmcgdHJlZSBlZGdlCgBhZGRfdHJlZV9lZGdlOiBlbXB0eSBvdXRlZGdlIGxpc3QKAGFkZF90cmVlX2VkZ2U6IGVtcHR5IGluZWRnZSBsaXN0CgB0cm91YmxlIGluIGluaXRfcmFuawoACSVzICVkCgBzZWFyY2hzaXplAGdyYXBoIAAgAG5vZGUgAHN0b3AKACUuNWcAcG9zAHJlY3RzAHhscABscABoZWFkX2xwAHRhaWxfbHAAbHdpZHRoAGxoZWlnaHQAYmIAJS41ZywlLjVnLCUuNWcALCUuNWcAJS41ZywlLjVnAHNhbXBsZXBvaW50cwAlLjVnICUuNWcAcywlLjVnLCUuNWcgAGUsJS41ZywlLjVnIAAlLjVnLCUuNWcsJS41ZywlLjVnACUuMmYAJS41ZywlLjVnLCUuNWcsJS41ZyAAL3BhdGhib3ggewogICAgL1ggZXhjaCBuZWcgJS41ZyBzdWIgZGVmCiAgICAvWSBleGNoICUuNWcgc3ViIGRlZgogICAgL3ggZXhjaCBuZWcgJS41ZyBzdWIgZGVmCiAgICAveSBleGNoICUuNWcgc3ViIGRlZgogICAgbmV3cGF0aCB4IHkgbW92ZXRvCiAgICBYIHkgbGluZXRvCiAgICBYIFkgbGluZXRvCiAgICB4IFkgbGluZXRvCiAgICBjbG9zZXBhdGggc3Ryb2tlCn0gZGVmCgAvcGF0aGJveCB7CiAgICAvWSBleGNoICUuNWcgc3ViIGRlZgogICAgL1ggZXhjaCAlLjVnIHN1YiBkZWYKICAgIC95IGV4Y2ggJS41ZyBzdWIgZGVmCiAgICAveCBleGNoICUuNWcgc3ViIGRlZgogICAgbmV3cGF0aCB4IHkgbW92ZXRvCiAgICBYIHkgbGluZXRvCiAgICBYIFkgbGluZXRvCiAgICB4IFkgbGluZXRvCiAgICBjbG9zZXBhdGggc3Ryb2tlCiB9IGRlZgovZGJnc3RhcnQgeyBnc2F2ZSAlLjVnICUuNWcgdHJhbnNsYXRlIH0gZGVmCi9hcnJvd2xlbmd0aCAxMCBkZWYKL2Fycm93d2lkdGggYXJyb3dsZW5ndGggMiBkaXYgZGVmCi9hcnJvd2hlYWQgewogICAgZ3NhdmUKICAgIHJvdGF0ZQogICAgY3VycmVudHBvaW50CiAgICBuZXdwYXRoCiAgICBtb3ZldG8KICAgIGFycm93bGVuZ3RoIGFycm93d2lkdGggMiBkaXYgcmxpbmV0bwogICAgMCBhcnJvd3dpZHRoIG5lZyBybGluZXRvCiAgICBjbG9zZXBhdGggZmlsbAogICAgZ3Jlc3RvcmUKfSBiaW5kIGRlZgovbWFrZWFycm93IHsKICAgIGN1cnJlbnRwb2ludCBleGNoIHBvcCBzdWIgZXhjaCBjdXJyZW50cG9pbnQgcG9wIHN1YiBhdGFuCiAgICBhcnJvd2hlYWQKfSBiaW5kIGRlZgovcG9pbnQgeyAgICBuZXdwYXRoICAgIDIgMCAzNjAgYXJjIGZpbGx9IGRlZi9tYWtldmVjIHsKICAgIC9ZIGV4Y2ggZGVmCiAgICAvWCBleGNoIGRlZgogICAgL3kgZXhjaCBkZWYKICAgIC94IGV4Y2ggZGVmCiAgICBuZXdwYXRoIHggeSBtb3ZldG8KICAgIFggWSBsaW5ldG8gc3Ryb2tlCiAgICBYIFkgbW92ZXRvCiAgICB4IHkgbWFrZWFycm93Cn0gZGVmCgBsb3N0ICVzICVzIGVkZ2UKAG5vIHBvc2l0aW9uIGZvciBlZGdlIHdpdGggbGFiZWwgJXMAbm8gcG9zaXRpb24gZm9yIGVkZ2Ugd2l0aCB0YWlsIGxhYmVsICVzAG5vIHBvc2l0aW9uIGZvciBlZGdlIHdpdGggaGVhZCBsYWJlbCAlcwBubyBwb3NpdGlvbiBmb3IgZWRnZSB3aXRoIHhsYWJlbCAlcwBmb3JjZWxhYmVscwAlZCBvdXQgb2YgJWQgbGFiZWxzIHBvc2l0aW9uZWQuCgAlZCBvdXQgb2YgJWQgZXh0ZXJpb3IgbGFiZWxzIHBvc2l0aW9uZWQuCgAlZCBvYmpzICVkIHhsYWJlbHMgZm9yY2U9JWQgYmI9KCUuMDJmLCUuMDJmKSAoJS4wMmYsJS4wMmYpCgBvYmplY3RzCgAgWyVkXSAoJS4wMmYsJS4wMmYpICglLjAyZiwlLjAyZikgJXAgIiVzIgoAeGxhYmVscwoAIFslZF0gJXAgc2V0ICVkICglLjAyZiwlLjAyZikgKCUuMDJmLCUuMDJmKSAlcwoAc2hhcGVmaWxlIG5vdCBzZXQgb3Igbm90IGZvdW5kIGZvciBlcHNmIG5vZGUgJXMKAGNvdWxkbid0IG9wZW4gZXBzZiBmaWxlICVzCgAlJSUlQm91bmRpbmdCb3g6ICVkICVkICVkICVkAHJlYWQAQm91bmRpbmdCb3ggbm90IGZvdW5kIGluIGVwc2YgZmlsZSAlcwoAY2FuJ3QgZmluZCBsaWJyYXJ5IGZpbGUgJXMKAGNhbid0IG9wZW4gbGlicmFyeSBmaWxlICVzCgBFT0YAQkVHSU4ARU5EAFRSQUlMRVIAL3VzZXJfc2hhcGVfJWQgewoAJSVCZWdpbkRvY3VtZW50OgoAJSVFbmREb2N1bWVudAoAfSBiaW5kIGRlZgoAVVRGLTggaW5wdXQgdXNlcyBub24tTGF0aW4xIGNoYXJhY3RlcnMgd2hpY2ggY2Fubm90IGJlIGhhbmRsZWQgYnkgdGhpcyBQb3N0U2NyaXB0IGRyaXZlcgoAY2Fubm90IHJlLWFsbG9jYXRlIHBzCgByb3V0ZXNwbGluZXNpbml0OiBjYW5ub3QgYWxsb2NhdGUgcHMKAHJvdXRlc3BsaW5lczogJWQgZWRnZXMsICVkIGJveGVzICUuMmYgc2VjCgBpbiByb3V0ZXNwbGluZXMsIGNhbm5vdCBmaW5kIE5PUk1BTCBlZGdlCgBpbiByb3V0ZXNwbGluZXMsIGlsbGVnYWwgdmFsdWVzIG9mIHByZXYgJWQgYW5kIG5leHQgJWQsIGxpbmUgJWQKAGluIHJvdXRlc3BsaW5lcywgZWRnZSBpcyBhIGxvb3AgYXQgJXMKAGluIHJvdXRlc3BsaW5lcywgUHNob3J0ZXN0cGF0aCBmYWlsZWQKAGluIHJvdXRlc3BsaW5lcywgUHJvdXRlc3BsaW5lIGZhaWxlZAoAVW5hYmxlIHRvIHJlY2xhaW0gYm94IHNwYWNlIGluIHNwbGluZSByb3V0aW5nIGZvciBlZGdlICIlcyIgLT4gIiVzIi4gU29tZXRoaW5nIGlzIHByb2JhYmx5IHNlcmlvdXNseSB3cm9uZy4KAGluIGNoZWNrcGF0aCwgYm94IDAgaGFzIExMIGNvb3JkID4gVVIgY29vcmQKAGluIGNoZWNrcGF0aCwgYm94ICVkIGhhcyBMTCBjb29yZCA+IFVSIGNvb3JkCgBpbiBjaGVja3BhdGgsIGJveGVzICVkIGFuZCAlZCBkb24ndCB0b3VjaAoAaW4gY2hlY2twYXRoLCBzdGFydCBwb3J0IG5vdCBpbiBmaXJzdCBib3gKAGluIGNoZWNrcGF0aCwgZW5kIHBvcnQgbm90IGluIGxhc3QgYm94CgAlZCBib3hlczoKACVkICglLjVnLCAlLjVnKSwgKCUuNWcsICUuNWcpCgBjb25zdHJhaW5lZABub3QgY29uc3RyYWluZWQAc3RhcnQgcG9ydDogKCUuNWcsICUuNWcpLCB0YW5nZW50IGFuZ2xlOiAlLjVnLCAlcwoAZW5kIHBvcnQ6ICglLjVnLCAlLjVnKSwgdGFuZ2VudCBhbmdsZTogJS41ZywgJXMKAHNpZGVzID09IDQAc2hhcGVzLmMAcm91bmRfY29ybmVycwBiYWQgbGFiZWwgZm9ybWF0ICVzCgBcTgBtYXJnaW4AJWxmLCVsZgByZWd1bGFyAGN1c3RvbQBzaGFwZWZpbGUAPG5pbD4ATm8gb3IgaW1wcm9wZXIgc2hhcGVmaWxlPSIlcyIgZm9yIG5vZGUgIiVzIgoATm8gb3IgaW1wcm9wZXIgaW1hZ2U9IiVzIiBmb3Igbm9kZSAiJXMiCgBsYWJlbGxvYwBub2RlICclcycsIGdyYXBoICclcycgc2l6ZSB0b28gc21hbGwgZm9yIGxhYmVsCgBlcHNmAHVzaW5nICVzIGZvciB1bmtub3duIHNoYXBlICVzCgBwb2x5Z29uAG92YWwAY2lyY2xlAHBvaW50AGVnZwB0cmlhbmdsZQBwbGFpbnRleHQAcGxhaW4AZGlhbW9uZAB0cmFwZXppdW0AcGFyYWxsZWxvZ3JhbQBob3VzZQBwZW50YWdvbgBoZXhhZ29uAHNlcHRhZ29uAG9jdGFnb24Abm90ZQB0YWIAZm9sZGVyAGJveDNkAGNvbXBvbmVudABjeWxpbmRlcgByZWN0AHJlY3RhbmdsZQBzcXVhcmUAZG91YmxlY2lyY2xlAGRvdWJsZW9jdGFnb24AdHJpcGxlb2N0YWdvbgBpbnZ0cmlhbmdsZQBpbnZ0cmFwZXppdW0AaW52aG91c2UAdW5kZXJsaW5lAE1kaWFtb25kAE1zcXVhcmUATWNpcmNsZQBwcm9tb3RlcgBjZHMAdGVybWluYXRvcgB1dHIAaW5zdWxhdG9yAHJpYm9zaXRlAHJuYXN0YWIAcHJvdGVhc2VzaXRlAHByb3RlaW5zdGFiAHByaW1lcnNpdGUAcmVzdHJpY3Rpb25zaXRlAGZpdmVwb3ZlcmhhbmcAdGhyZWVwb3ZlcmhhbmcAbm92ZXJoYW5nAGFzc2VtYmx5AHNpZ25hdHVyZQBycHJvbW90ZXIAbGFycm93AHJhcnJvdwBscHJvbW90ZXIAcmVjb3JkAE1yZWNvcmQAc3RhcgAjODA4MDgwACNmY2ZjZmMAIzMwMzAzMAAjZThlOGU4ACNlMGUwZTAAI2YwZjBmMAAjMTAxMDEwACNmOGY4ZjgAaW4gbm9kZSAlcwoAcm91bmRlZABkaWFnb25hbHMAcmFkaWFsAHN0cmlwZWQAd2VkZ2VkAF8Abm9kZSAlcywgcG9ydCAlcywgdW5yZWNvZ25pemVkIGNvbXBhc3MgcG9pbnQgJyVzJyAtIGlnbm9yZWQKAG5vZGUgJXMsIHBvcnQgJXMgdW5yZWNvZ25pemVkCgAlLjVnICUuNWcgdHJhbnNsYXRlIG5ld3BhdGggdXNlcl9zaGFwZV8lZAoAaW52aXMAAGZpbGxlZAAAcwBlAHcAc3BsaW5lcy5jAGJlZ2lucGF0aABQLT5lbmQudGhldGEgPCAyICogTV9QSQBlbmRwYXRoAG1ha2VTZWxmRWRnZQBnZXRzcGxpbmVwb2ludHM6IG5vIHNwbGluZSBwb2ludHMgYXZhaWxhYmxlIGZvciBlZGdlICglcywlcykKAHBvbHlsaW5lTWlkcG9pbnQAc3Bhbi0+Zm9udAB0ZXh0c3Bhbi5jAHRleHRzcGFuX3NpemUAZm9udC0+bmFtZQBmb250bmFtZTogIiVzIiByZXNvbHZlZCB0bzogJXMKAGZvbnRuYW1lOiB1bmFibGUgdG8gcmVzb2x2ZSAiJXMiCgBjb3VyAGFyaWFsAGhlbHZldGljYQBbaW50ZXJuYWwgdGltZXNdAFtpbnRlcm5hbCBjb3VyaWVyXQBbaW50ZXJuYWwgYXJpYWxdAEF2YW50R2FyZGUtQm9vawBVUlcgR290aGljIEwAYm9vawBzYW5zLVNlcmlmAEF2YW50R2FyZGUtQm9va09ibGlxdWUAb2JsaXF1ZQBpdGFsaWMAQXZhbnRHYXJkZS1EZW1pAGRlbWkAQXZhbnRHYXJkZS1EZW1pT2JsaXF1ZQBCb29rbWFuLURlbWkAVVJXIEJvb2ttYW4gTABzZXJpZgBCb29rbWFuLURlbWlJdGFsaWMAQm9va21hbi1MaWdodABsaWdodABCb29rbWFuLUxpZ2h0SXRhbGljAENvdXJpZXIAbW9ub3NwYWNlAENvdXJpZXItQm9sZABDb3VyaWVyLUJvbGRPYmxpcXVlAENvdXJpZXItT2JsaXF1ZQBIZWx2ZXRpY2EASGVsdmV0aWNhLUJvbGQASGVsdmV0aWNhLUJvbGRPYmxpcXVlAEhlbHZldGljYS1OYXJyb3cAY29uZGVuc2VkAEhlbHZldGljYS1OYXJyb3ctQm9sZABIZWx2ZXRpY2EtTmFycm93LUJvbGRPYmxpcXVlAEhlbHZldGljYS1OYXJyb3ctT2JsaXF1ZQBIZWx2ZXRpY2EtT2JsaXF1ZQBOZXdDZW50dXJ5U2NobGJrLUJvbGQAQ2VudHVyeSBTY2hvb2xib29rIEwATmV3Q2VudHVyeVNjaGxiay1Cb2xkSXRhbGljAE5ld0NlbnR1cnlTY2hsYmstSXRhbGljAE5ld0NlbnR1cnlTY2hsYmstUm9tYW4Acm9tYW4AUGFsYXRpbm8tQm9sZABQYWxhdGlubyBMaW5vdHlwZQBQYWxhdGluby1Cb2xkSXRhbGljAFBhbGF0aW5vLUl0YWxpYwBQYWxhdGluby1Sb21hbgBTeW1ib2wAZmFudGFzeQBUaW1lcy1Cb2xkAFRpbWVzAFRpbWVzLUJvbGRJdGFsaWMAVGltZXMtSXRhbGljAFphcGZDaGFuY2VyeS1NZWRpdW1JdGFsaWMAVVJXIENoYW5jZXJ5IEwAbWVkaXVtAFphcGZEaW5nYmF0cwBEaW5nYmF0cwBpbnB1dHNjYWxlAG5vAHRydWUAeWVzAHV0aWxzLmMAdSA9PSBVRl9maW5kKHUpAFVGX3NldG5hbWUAAWZpbGUgbG9hZGluZyBpcyBkaXNhYmxlZCBiZWNhdXNlIHRoZSBlbnZpcm9ubWVudCBjb250YWlucyBTRVJWRVJfTkFNRT0iJXMiCmFuZCB0aGUgR1ZfRklMRV9QQVRIIHZhcmlhYmxlIGlzIHVuc2V0IG9yIGVtcHR5LgoAUGF0aCBwcm92aWRlZCB0byBmaWxlOiAiJXMiIGhhcyBiZWVuIGlnbm9yZWQgYmVjYXVzZSBmaWxlcyBhcmUgb25seSBwZXJtaXR0ZWQgdG8gYmUgbG9hZGVkIGZyb20gdGhlIGRpcmVjdG9yaWVzIGluICIlcyIgd2hlbiBydW5uaW5nIGluIGFuIGh0dHAgc2VydmVyLgoAJXMlcyVzAC8AOgBlbGxpcHNlAFRpbWVzLVJvbWFuAGNsdXN0ZXIAX19jbHVzdGVybm9kZXMAY2x1c3RlciBjeWNsZSAlcyAtLSAlcyBub3Qgc3VwcG9ydGVkCgB0YWlsIGNsdXN0ZXIgJXMgaW5zaWRlIGhlYWQgY2x1c3RlciAlcwoAaGVhZCBjbHVzdGVyICVzIGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKAHRhaWwgbm9kZSAlcyBpbnNpZGUgaGVhZCBjbHVzdGVyICVzCgBoZWFkIG5vZGUgJXMgaW5zaWRlIHRhaWwgY2x1c3RlciAlcwoAX18AbGFiZWwAc2hhcGUAYm94AFR3byBjbHVzdGVycyBuYW1lZCAlcyAtIHRoZSBzZWNvbmQgd2lsbCBiZSBpZ25vcmVkCgBtYXBOAEFFbGlnAEFhY3V0ZQBBY2lyYwBBZ3JhdmUAQWxwaGEAQXJpbmcAQXRpbGRlAEF1bWwAQmV0YQBDY2VkaWwAQ2hpAERhZ2dlcgBEZWx0YQBFVEgARWFjdXRlAEVjaXJjAEVncmF2ZQBFcHNpbG9uAEV0YQBFdW1sAEdhbW1hAElhY3V0ZQBJY2lyYwBJZ3JhdmUASW90YQBJdW1sAEthcHBhAExhbWJkYQBNdQBOdGlsZGUATnUAT0VsaWcAT2FjdXRlAE9jaXJjAE9ncmF2ZQBPbWVnYQBPbWljcm9uAE9zbGFzaABPdGlsZGUAT3VtbABQaGkAUGkAUHJpbWUAUHNpAFJobwBTY2Fyb24AU2lnbWEAVEhPUk4AVGF1AFRoZXRhAFVhY3V0ZQBVY2lyYwBVZ3JhdmUAVXBzaWxvbgBVdW1sAFhpAFlhY3V0ZQBZdW1sAFpldGEAYWFjdXRlAGFjaXJjAGFjdXRlAGFlbGlnAGFncmF2ZQBhbGVmc3ltAGFscGhhAGFtcABhbmQAYW5nAGFyaW5nAGFzeW1wAGF0aWxkZQBhdW1sAGJkcXVvAGJldGEAYnJ2YmFyAGJ1bGwAY2FwAGNjZWRpbABjZWRpbABjZW50AGNoaQBjaXJjAGNsdWJzAGNvbmcAY29weQBjcmFycgBjdXAAY3VycmVuAGRBcnIAZGFnZ2VyAGRhcnIAZGVnAGRlbHRhAGRpYW1zAGRpdmlkZQBlYWN1dGUAZWNpcmMAZWdyYXZlAGVtcHR5AGVtc3AAZW5zcABlcHNpbG9uAGVxdWl2AGV0YQBldGgAZXVtbABldXJvAGV4aXN0AGZub2YAZm9yYWxsAGZyYWMxMgBmcmFjMTQAZnJhYzM0AGZyYXNsAGdhbW1hAGdlAGd0AGhBcnIAaGFycgBoZWFydHMAaGVsbGlwAGlhY3V0ZQBpY2lyYwBpZXhjbABpZ3JhdmUAaW1hZ2UAaW5maW4AaW50AGlvdGEAaXF1ZXN0AGlzaW4AaXVtbABrYXBwYQBsQXJyAGxhbWJkYQBsYW5nAGxhcXVvAGxhcnIAbGNlaWwAbGRxdW8AbGUAbGZsb29yAGxvd2FzdABsb3oAbHJtAGxzYXF1bwBsc3F1bwBsdABtYWNyAG1kYXNoAG1pY3JvAG1pZGRvdABtdQBuYWJsYQBuYnNwAG5kYXNoAG5lAG5pAG5vdABub3RpbgBuc3ViAG50aWxkZQBudQBvYWN1dGUAb2NpcmMAb2VsaWcAb2dyYXZlAG9saW5lAG9tZWdhAG9taWNyb24Ab3BsdXMAb3IAb3JkZgBvcmRtAG9zbGFzaABvdGlsZGUAb3RpbWVzAG91bWwAcGFyYQBwYXJ0AHBlcm1pbABwZXJwAHBoaQBwaQBwaXYAcGx1c21uAHBvdW5kAHByaW1lAHByb2QAcHJvcABwc2kAcXVvdAByQXJyAHJhZGljAHJhbmcAcmFxdW8AcmFycgByY2VpbAByZHF1bwByZWFsAHJlZwByZmxvb3IAcmhvAHJsbQByc2FxdW8AcnNxdW8Ac2JxdW8Ac2Nhcm9uAHNkb3QAc2VjdABzaHkAc2lnbWEAc2lnbWFmAHNpbQBzcGFkZXMAc3ViAHN1YmUAc3VtAHN1cABzdXAxAHN1cDIAc3VwMwBzdXBlAHN6bGlnAHRhdQB0aGVyZTQAdGhldGEAdGhldGFzeW0AdGhpbnNwAHRob3JuAHRpbGRlAHRpbWVzAHRyYWRlAHVBcnIAdWFjdXRlAHVhcnIAdWNpcmMAdWdyYXZlAHVtbAB1cHNpaAB1cHNpbG9uAHV1bWwAd2VpZXJwAHhpAHlhY3V0ZQB5ZW4AeXVtbAB6ZXRhAHp3agB6d25qAFVURjggY29kZXMgPiA0IGJ5dGVzIGFyZSBub3QgY3VycmVudGx5IHN1cHBvcnRlZCAoZ3JhcGggJXMpIC0gdHJlYXRlZCBhcyBMYXRpbi0xLiBQZXJoYXBzICItR2NoYXJzZXQ9bGF0aW4xIiBpcyBuZWVkZWQ/CgBJbnZhbGlkICVkLWJ5dGUgVVRGOCBmb3VuZCBpbiBpbnB1dCBvZiBncmFwaCAlcyAtIHRyZWF0ZWQgYXMgTGF0aW4tMS4gUGVyaGFwcyAiLUdjaGFyc2V0PWxhdGluMSIgaXMgbmVlZGVkPwoAYnouc2l6ZQBvdmVybGFwX2JlemllcgB1cnZlZABvbXBvdW5kAGFsc2UAaW5lAG9uZQBvAHJ0aG8Ab2x5bGluZQBwbGluZQBydWUAZXMAVW5rbm93biAic3BsaW5lcyIgdmFsdWU6ICIlcyIgLSBpZ25vcmVkCgBzcGxpbmVzAG9kYgBPcnRob2dvbmFsIGVkZ2VzIGRvIG5vdCBjdXJyZW50bHkgaGFuZGxlIGVkZ2UgbGFiZWxzLiBUcnkgdXNpbmcgeGxhYmVscy4KAG9ydGhvICVzICVzCgBjaGFuaQBvcnRoby5jAGNoYW5TZWFyY2gAY3AAJSUhUFMtQWRvYmUtMi4wCiUlJSVCb3VuZGluZ0JveDogKGF0ZW5kKQovcG9pbnQgewogIC9ZIGV4Y2ggZGVmCiAgL1ggZXhjaCBkZWYKICBuZXdwYXRoCiAgWCBZIDMgMCAzNjAgYXJjIGZpbGwKfSBkZWYKL2NlbGwgewogIC9ZIGV4Y2ggZGVmCiAgL1ggZXhjaCBkZWYKICAveSBleGNoIGRlZgogIC94IGV4Y2ggZGVmCiAgbmV3cGF0aAogIHggeSBtb3ZldG8KICB4IFkgbGluZXRvCiAgWCBZIGxpbmV0bwogIFggeSBsaW5ldG8KICBjbG9zZXBhdGggc3Ryb2tlCn0gZGVmCi9ub2RlIHsKIC91IGV4Y2ggZGVmCiAvciBleGNoIGRlZgogL2QgZXhjaCBkZWYKIC9sIGV4Y2ggZGVmCiBuZXdwYXRoIGwgZCBtb3ZldG8KIHIgZCBsaW5ldG8gciB1IGxpbmV0byBsIHUgbGluZXRvCiBjbG9zZXBhdGggZmlsbAp9IGRlZgoKACVkICVkIHRyYW5zbGF0ZQoAMC44IDAuOCAwLjggc2V0cmdiY29sb3IKAHNob3dwYWdlCiUlJSVUcmFpbGVyCiUlJSVCb3VuZGluZ0JveDogJWQgJWQgJWQgJWQKAG5ld3BhdGggJWQgJWQgbW92ZXRvCgAlZCAlZCBsaW5ldG8KACVkICVkIGxpbmV0byBzdHJva2UKAGNoYW5uZWwgJWQgKCVmLCVmKQoAIC0+CgAgICAgIAAoKCVmLCVmKSwoJWYsJWYpKSAlcyAlcwBCX1JJR0hUAEJfRE9XTgBCX0xFRlQAQl9VUABCX05PREUAc2VnAG5leHRfc2VnAGRlY2lkZV9wb2ludABpbmNvbXBhcmFibGUgc2VnbWVudHMgISEgLS0gQWJvcnRpbmcKAHMxLT5jb21tX2Nvb3JkPT1zMi0+Y29tbV9jb29yZABpc19wYXJhbGxlbABncmFwaCBHIHsKACBub2RlW3NoYXBlPXBvaW50XQoAICAlZCBbcG9zPSIlZCwlZCJdCgAgICVkIC0tICVkW2xlbj0iJWYiXQoAfQoAY29sb3IgJXMAJXMgaXMgbm90IGEga25vd24gY29sb3IuCgBlcnJvciBpbiBjb2x4bGF0ZSgpCgBzb2xpZABpbnZpc2libGUAYm9sZABzZXRsaW5ld2lkdGgAZmlsbGVkAHVuZmlsbGVkAHRhcGVyZWQAZ3ZyZW5kZXJfc2V0X3N0eWxlOiB1bnN1cHBvcnRlZCBzdHlsZSAlcyAtIGlnbm9yaW5nCgBndnJlbmRlci5jAGd2cmVuZGVyX3VzZXJzaGFwZQBuYW1lAG5hbWVbMF0AYm90aABsYXlvdXQATGF5b3V0IHR5cGU6ICIlcyIgbm90IHJlY29nbml6ZWQuIFVzZSBvbmUgb2Y6JXMKAGpvYgBndmxvYWRpbWFnZS5jAGd2bG9hZGltYWdlAHVzAHVzLT5uYW1lAHVzLT5uYW1lWzBdAE5vIGxvYWRpbWFnZSBwbHVnaW4gZm9yICIlcyIKAFEATGVmdABLUF9MZWZ0AFJpZ2h0AEtQX1JpZ2h0AFVwAEtQX1VwAERvd24AS1BfRG93bgBwbHVzAEtQX0FkZABtaW51cwBLUF9TdWJ0cmFjdABGAGVkZ2UAdGFpbHBvcnQAaGVhZHBvcnQAa2V5AFVSTABub2RlAGRpZ3JhcGgAZ3JhcGgAc3ViZ3JhcGgAX0xUWF9saWJyYXJ5AHRleHRsYXlvdXQAb2JqcC0+bGJsAHhsYWJlbHMuYwB4bGFkanVzdAB4bGludGVyc2VjdGlvbnMAbHAgIT0gY2xwAGdldGludHJzeGkAb2JqcDEtPnN6LnggPT0gMCAmJiBvYmpwMS0+c3oueSA9PSAwAGxibGVuY2xvc2luZwB2cAB4bGhkeHVubG9hZABzaXplPT1mcmVlZAByZWN0LmJvdW5kYXJ5WzJdIDwgSU5UX01BWABvYmpwbHBta3MAcmVjdC5ib3VuZGFyeVszXSA8IElOVF9NQVgAb3V0IG9mIG1lbW9yeQoAIyUyeCUyeCUyeCUyeAAlbGYlbGYlbGYAL2FjY2VudDMvMQAvYWNjZW50My8yAC9hY2NlbnQzLzMAL2FjY2VudDQvMQAvYWNjZW50NC8yAC9hY2NlbnQ0LzMAL2FjY2VudDQvNAAvYWNjZW50NS8xAC9hY2NlbnQ1LzIAL2FjY2VudDUvMwAvYWNjZW50NS80AC9hY2NlbnQ1LzUAL2FjY2VudDYvMQAvYWNjZW50Ni8yAC9hY2NlbnQ2LzMAL2FjY2VudDYvNAAvYWNjZW50Ni81AC9hY2NlbnQ2LzYAL2FjY2VudDcvMQAvYWNjZW50Ny8yAC9hY2NlbnQ3LzMAL2FjY2VudDcvNAAvYWNjZW50Ny81AC9hY2NlbnQ3LzYAL2FjY2VudDcvNwAvYWNjZW50OC8xAC9hY2NlbnQ4LzIAL2FjY2VudDgvMwAvYWNjZW50OC80AC9hY2NlbnQ4LzUAL2FjY2VudDgvNgAvYWNjZW50OC83AC9hY2NlbnQ4LzgAL2JsdWVzMy8xAC9ibHVlczMvMgAvYmx1ZXMzLzMAL2JsdWVzNC8xAC9ibHVlczQvMgAvYmx1ZXM0LzMAL2JsdWVzNC80AC9ibHVlczUvMQAvYmx1ZXM1LzIAL2JsdWVzNS8zAC9ibHVlczUvNAAvYmx1ZXM1LzUAL2JsdWVzNi8xAC9ibHVlczYvMgAvYmx1ZXM2LzMAL2JsdWVzNi80AC9ibHVlczYvNQAvYmx1ZXM2LzYAL2JsdWVzNy8xAC9ibHVlczcvMgAvYmx1ZXM3LzMAL2JsdWVzNy80AC9ibHVlczcvNQAvYmx1ZXM3LzYAL2JsdWVzNy83AC9ibHVlczgvMQAvYmx1ZXM4LzIAL2JsdWVzOC8zAC9ibHVlczgvNAAvYmx1ZXM4LzUAL2JsdWVzOC82AC9ibHVlczgvNwAvYmx1ZXM4LzgAL2JsdWVzOS8xAC9ibHVlczkvMgAvYmx1ZXM5LzMAL2JsdWVzOS80AC9ibHVlczkvNQAvYmx1ZXM5LzYAL2JsdWVzOS83AC9ibHVlczkvOAAvYmx1ZXM5LzkAL2JyYmcxMC8xAC9icmJnMTAvMTAAL2JyYmcxMC8yAC9icmJnMTAvMwAvYnJiZzEwLzQAL2JyYmcxMC81AC9icmJnMTAvNgAvYnJiZzEwLzcAL2JyYmcxMC84AC9icmJnMTAvOQAvYnJiZzExLzEAL2JyYmcxMS8xMAAvYnJiZzExLzExAC9icmJnMTEvMgAvYnJiZzExLzMAL2JyYmcxMS80AC9icmJnMTEvNQAvYnJiZzExLzYAL2JyYmcxMS83AC9icmJnMTEvOAAvYnJiZzExLzkAL2JyYmczLzEAL2JyYmczLzIAL2JyYmczLzMAL2JyYmc0LzEAL2JyYmc0LzIAL2JyYmc0LzMAL2JyYmc0LzQAL2JyYmc1LzEAL2JyYmc1LzIAL2JyYmc1LzMAL2JyYmc1LzQAL2JyYmc1LzUAL2JyYmc2LzEAL2JyYmc2LzIAL2JyYmc2LzMAL2JyYmc2LzQAL2JyYmc2LzUAL2JyYmc2LzYAL2JyYmc3LzEAL2JyYmc3LzIAL2JyYmc3LzMAL2JyYmc3LzQAL2JyYmc3LzUAL2JyYmc3LzYAL2JyYmc3LzcAL2JyYmc4LzEAL2JyYmc4LzIAL2JyYmc4LzMAL2JyYmc4LzQAL2JyYmc4LzUAL2JyYmc4LzYAL2JyYmc4LzcAL2JyYmc4LzgAL2JyYmc5LzEAL2JyYmc5LzIAL2JyYmc5LzMAL2JyYmc5LzQAL2JyYmc5LzUAL2JyYmc5LzYAL2JyYmc5LzcAL2JyYmc5LzgAL2JyYmc5LzkAL2J1Z24zLzEAL2J1Z24zLzIAL2J1Z24zLzMAL2J1Z240LzEAL2J1Z240LzIAL2J1Z240LzMAL2J1Z240LzQAL2J1Z241LzEAL2J1Z241LzIAL2J1Z241LzMAL2J1Z241LzQAL2J1Z241LzUAL2J1Z242LzEAL2J1Z242LzIAL2J1Z242LzMAL2J1Z242LzQAL2J1Z242LzUAL2J1Z242LzYAL2J1Z243LzEAL2J1Z243LzIAL2J1Z243LzMAL2J1Z243LzQAL2J1Z243LzUAL2J1Z243LzYAL2J1Z243LzcAL2J1Z244LzEAL2J1Z244LzIAL2J1Z244LzMAL2J1Z244LzQAL2J1Z244LzUAL2J1Z244LzYAL2J1Z244LzcAL2J1Z244LzgAL2J1Z245LzEAL2J1Z245LzIAL2J1Z245LzMAL2J1Z245LzQAL2J1Z245LzUAL2J1Z245LzYAL2J1Z245LzcAL2J1Z245LzgAL2J1Z245LzkAL2J1cHUzLzEAL2J1cHUzLzIAL2J1cHUzLzMAL2J1cHU0LzEAL2J1cHU0LzIAL2J1cHU0LzMAL2J1cHU0LzQAL2J1cHU1LzEAL2J1cHU1LzIAL2J1cHU1LzMAL2J1cHU1LzQAL2J1cHU1LzUAL2J1cHU2LzEAL2J1cHU2LzIAL2J1cHU2LzMAL2J1cHU2LzQAL2J1cHU2LzUAL2J1cHU2LzYAL2J1cHU3LzEAL2J1cHU3LzIAL2J1cHU3LzMAL2J1cHU3LzQAL2J1cHU3LzUAL2J1cHU3LzYAL2J1cHU3LzcAL2J1cHU4LzEAL2J1cHU4LzIAL2J1cHU4LzMAL2J1cHU4LzQAL2J1cHU4LzUAL2J1cHU4LzYAL2J1cHU4LzcAL2J1cHU4LzgAL2J1cHU5LzEAL2J1cHU5LzIAL2J1cHU5LzMAL2J1cHU5LzQAL2J1cHU5LzUAL2J1cHU5LzYAL2J1cHU5LzcAL2J1cHU5LzgAL2J1cHU5LzkAL2RhcmsyMy8xAC9kYXJrMjMvMgAvZGFyazIzLzMAL2RhcmsyNC8xAC9kYXJrMjQvMgAvZGFyazI0LzMAL2RhcmsyNC80AC9kYXJrMjUvMQAvZGFyazI1LzIAL2RhcmsyNS8zAC9kYXJrMjUvNAAvZGFyazI1LzUAL2RhcmsyNi8xAC9kYXJrMjYvMgAvZGFyazI2LzMAL2RhcmsyNi80AC9kYXJrMjYvNQAvZGFyazI2LzYAL2RhcmsyNy8xAC9kYXJrMjcvMgAvZGFyazI3LzMAL2RhcmsyNy80AC9kYXJrMjcvNQAvZGFyazI3LzYAL2RhcmsyNy83AC9kYXJrMjgvMQAvZGFyazI4LzIAL2RhcmsyOC8zAC9kYXJrMjgvNAAvZGFyazI4LzUAL2RhcmsyOC82AC9kYXJrMjgvNwAvZGFyazI4LzgAL2duYnUzLzEAL2duYnUzLzIAL2duYnUzLzMAL2duYnU0LzEAL2duYnU0LzIAL2duYnU0LzMAL2duYnU0LzQAL2duYnU1LzEAL2duYnU1LzIAL2duYnU1LzMAL2duYnU1LzQAL2duYnU1LzUAL2duYnU2LzEAL2duYnU2LzIAL2duYnU2LzMAL2duYnU2LzQAL2duYnU2LzUAL2duYnU2LzYAL2duYnU3LzEAL2duYnU3LzIAL2duYnU3LzMAL2duYnU3LzQAL2duYnU3LzUAL2duYnU3LzYAL2duYnU3LzcAL2duYnU4LzEAL2duYnU4LzIAL2duYnU4LzMAL2duYnU4LzQAL2duYnU4LzUAL2duYnU4LzYAL2duYnU4LzcAL2duYnU4LzgAL2duYnU5LzEAL2duYnU5LzIAL2duYnU5LzMAL2duYnU5LzQAL2duYnU5LzUAL2duYnU5LzYAL2duYnU5LzcAL2duYnU5LzgAL2duYnU5LzkAL2dyZWVuczMvMQAvZ3JlZW5zMy8yAC9ncmVlbnMzLzMAL2dyZWVuczQvMQAvZ3JlZW5zNC8yAC9ncmVlbnM0LzMAL2dyZWVuczQvNAAvZ3JlZW5zNS8xAC9ncmVlbnM1LzIAL2dyZWVuczUvMwAvZ3JlZW5zNS80AC9ncmVlbnM1LzUAL2dyZWVuczYvMQAvZ3JlZW5zNi8yAC9ncmVlbnM2LzMAL2dyZWVuczYvNAAvZ3JlZW5zNi81AC9ncmVlbnM2LzYAL2dyZWVuczcvMQAvZ3JlZW5zNy8yAC9ncmVlbnM3LzMAL2dyZWVuczcvNAAvZ3JlZW5zNy81AC9ncmVlbnM3LzYAL2dyZWVuczcvNwAvZ3JlZW5zOC8xAC9ncmVlbnM4LzIAL2dyZWVuczgvMwAvZ3JlZW5zOC80AC9ncmVlbnM4LzUAL2dyZWVuczgvNgAvZ3JlZW5zOC83AC9ncmVlbnM4LzgAL2dyZWVuczkvMQAvZ3JlZW5zOS8yAC9ncmVlbnM5LzMAL2dyZWVuczkvNAAvZ3JlZW5zOS81AC9ncmVlbnM5LzYAL2dyZWVuczkvNwAvZ3JlZW5zOS84AC9ncmVlbnM5LzkAL2dyZXlzMy8xAC9ncmV5czMvMgAvZ3JleXMzLzMAL2dyZXlzNC8xAC9ncmV5czQvMgAvZ3JleXM0LzMAL2dyZXlzNC80AC9ncmV5czUvMQAvZ3JleXM1LzIAL2dyZXlzNS8zAC9ncmV5czUvNAAvZ3JleXM1LzUAL2dyZXlzNi8xAC9ncmV5czYvMgAvZ3JleXM2LzMAL2dyZXlzNi80AC9ncmV5czYvNQAvZ3JleXM2LzYAL2dyZXlzNy8xAC9ncmV5czcvMgAvZ3JleXM3LzMAL2dyZXlzNy80AC9ncmV5czcvNQAvZ3JleXM3LzYAL2dyZXlzNy83AC9ncmV5czgvMQAvZ3JleXM4LzIAL2dyZXlzOC8zAC9ncmV5czgvNAAvZ3JleXM4LzUAL2dyZXlzOC82AC9ncmV5czgvNwAvZ3JleXM4LzgAL2dyZXlzOS8xAC9ncmV5czkvMgAvZ3JleXM5LzMAL2dyZXlzOS80AC9ncmV5czkvNQAvZ3JleXM5LzYAL2dyZXlzOS83AC9ncmV5czkvOAAvZ3JleXM5LzkAL29yYW5nZXMzLzEAL29yYW5nZXMzLzIAL29yYW5nZXMzLzMAL29yYW5nZXM0LzEAL29yYW5nZXM0LzIAL29yYW5nZXM0LzMAL29yYW5nZXM0LzQAL29yYW5nZXM1LzEAL29yYW5nZXM1LzIAL29yYW5nZXM1LzMAL29yYW5nZXM1LzQAL29yYW5nZXM1LzUAL29yYW5nZXM2LzEAL29yYW5nZXM2LzIAL29yYW5nZXM2LzMAL29yYW5nZXM2LzQAL29yYW5nZXM2LzUAL29yYW5nZXM2LzYAL29yYW5nZXM3LzEAL29yYW5nZXM3LzIAL29yYW5nZXM3LzMAL29yYW5nZXM3LzQAL29yYW5nZXM3LzUAL29yYW5nZXM3LzYAL29yYW5nZXM3LzcAL29yYW5nZXM4LzEAL29yYW5nZXM4LzIAL29yYW5nZXM4LzMAL29yYW5nZXM4LzQAL29yYW5nZXM4LzUAL29yYW5nZXM4LzYAL29yYW5nZXM4LzcAL29yYW5nZXM4LzgAL29yYW5nZXM5LzEAL29yYW5nZXM5LzIAL29yYW5nZXM5LzMAL29yYW5nZXM5LzQAL29yYW5nZXM5LzUAL29yYW5nZXM5LzYAL29yYW5nZXM5LzcAL29yYW5nZXM5LzgAL29yYW5nZXM5LzkAL29ycmQzLzEAL29ycmQzLzIAL29ycmQzLzMAL29ycmQ0LzEAL29ycmQ0LzIAL29ycmQ0LzMAL29ycmQ0LzQAL29ycmQ1LzEAL29ycmQ1LzIAL29ycmQ1LzMAL29ycmQ1LzQAL29ycmQ1LzUAL29ycmQ2LzEAL29ycmQ2LzIAL29ycmQ2LzMAL29ycmQ2LzQAL29ycmQ2LzUAL29ycmQ2LzYAL29ycmQ3LzEAL29ycmQ3LzIAL29ycmQ3LzMAL29ycmQ3LzQAL29ycmQ3LzUAL29ycmQ3LzYAL29ycmQ3LzcAL29ycmQ4LzEAL29ycmQ4LzIAL29ycmQ4LzMAL29ycmQ4LzQAL29ycmQ4LzUAL29ycmQ4LzYAL29ycmQ4LzcAL29ycmQ4LzgAL29ycmQ5LzEAL29ycmQ5LzIAL29ycmQ5LzMAL29ycmQ5LzQAL29ycmQ5LzUAL29ycmQ5LzYAL29ycmQ5LzcAL29ycmQ5LzgAL29ycmQ5LzkAL3BhaXJlZDEwLzEAL3BhaXJlZDEwLzEwAC9wYWlyZWQxMC8yAC9wYWlyZWQxMC8zAC9wYWlyZWQxMC80AC9wYWlyZWQxMC81AC9wYWlyZWQxMC82AC9wYWlyZWQxMC83AC9wYWlyZWQxMC84AC9wYWlyZWQxMC85AC9wYWlyZWQxMS8xAC9wYWlyZWQxMS8xMAAvcGFpcmVkMTEvMTEAL3BhaXJlZDExLzIAL3BhaXJlZDExLzMAL3BhaXJlZDExLzQAL3BhaXJlZDExLzUAL3BhaXJlZDExLzYAL3BhaXJlZDExLzcAL3BhaXJlZDExLzgAL3BhaXJlZDExLzkAL3BhaXJlZDEyLzEAL3BhaXJlZDEyLzEwAC9wYWlyZWQxMi8xMQAvcGFpcmVkMTIvMTIAL3BhaXJlZDEyLzIAL3BhaXJlZDEyLzMAL3BhaXJlZDEyLzQAL3BhaXJlZDEyLzUAL3BhaXJlZDEyLzYAL3BhaXJlZDEyLzcAL3BhaXJlZDEyLzgAL3BhaXJlZDEyLzkAL3BhaXJlZDMvMQAvcGFpcmVkMy8yAC9wYWlyZWQzLzMAL3BhaXJlZDQvMQAvcGFpcmVkNC8yAC9wYWlyZWQ0LzMAL3BhaXJlZDQvNAAvcGFpcmVkNS8xAC9wYWlyZWQ1LzIAL3BhaXJlZDUvMwAvcGFpcmVkNS80AC9wYWlyZWQ1LzUAL3BhaXJlZDYvMQAvcGFpcmVkNi8yAC9wYWlyZWQ2LzMAL3BhaXJlZDYvNAAvcGFpcmVkNi81AC9wYWlyZWQ2LzYAL3BhaXJlZDcvMQAvcGFpcmVkNy8yAC9wYWlyZWQ3LzMAL3BhaXJlZDcvNAAvcGFpcmVkNy81AC9wYWlyZWQ3LzYAL3BhaXJlZDcvNwAvcGFpcmVkOC8xAC9wYWlyZWQ4LzIAL3BhaXJlZDgvMwAvcGFpcmVkOC80AC9wYWlyZWQ4LzUAL3BhaXJlZDgvNgAvcGFpcmVkOC83AC9wYWlyZWQ4LzgAL3BhaXJlZDkvMQAvcGFpcmVkOS8yAC9wYWlyZWQ5LzMAL3BhaXJlZDkvNAAvcGFpcmVkOS81AC9wYWlyZWQ5LzYAL3BhaXJlZDkvNwAvcGFpcmVkOS84AC9wYWlyZWQ5LzkAL3Bhc3RlbDEzLzEAL3Bhc3RlbDEzLzIAL3Bhc3RlbDEzLzMAL3Bhc3RlbDE0LzEAL3Bhc3RlbDE0LzIAL3Bhc3RlbDE0LzMAL3Bhc3RlbDE0LzQAL3Bhc3RlbDE1LzEAL3Bhc3RlbDE1LzIAL3Bhc3RlbDE1LzMAL3Bhc3RlbDE1LzQAL3Bhc3RlbDE1LzUAL3Bhc3RlbDE2LzEAL3Bhc3RlbDE2LzIAL3Bhc3RlbDE2LzMAL3Bhc3RlbDE2LzQAL3Bhc3RlbDE2LzUAL3Bhc3RlbDE2LzYAL3Bhc3RlbDE3LzEAL3Bhc3RlbDE3LzIAL3Bhc3RlbDE3LzMAL3Bhc3RlbDE3LzQAL3Bhc3RlbDE3LzUAL3Bhc3RlbDE3LzYAL3Bhc3RlbDE3LzcAL3Bhc3RlbDE4LzEAL3Bhc3RlbDE4LzIAL3Bhc3RlbDE4LzMAL3Bhc3RlbDE4LzQAL3Bhc3RlbDE4LzUAL3Bhc3RlbDE4LzYAL3Bhc3RlbDE4LzcAL3Bhc3RlbDE4LzgAL3Bhc3RlbDE5LzEAL3Bhc3RlbDE5LzIAL3Bhc3RlbDE5LzMAL3Bhc3RlbDE5LzQAL3Bhc3RlbDE5LzUAL3Bhc3RlbDE5LzYAL3Bhc3RlbDE5LzcAL3Bhc3RlbDE5LzgAL3Bhc3RlbDE5LzkAL3Bhc3RlbDIzLzEAL3Bhc3RlbDIzLzIAL3Bhc3RlbDIzLzMAL3Bhc3RlbDI0LzEAL3Bhc3RlbDI0LzIAL3Bhc3RlbDI0LzMAL3Bhc3RlbDI0LzQAL3Bhc3RlbDI1LzEAL3Bhc3RlbDI1LzIAL3Bhc3RlbDI1LzMAL3Bhc3RlbDI1LzQAL3Bhc3RlbDI1LzUAL3Bhc3RlbDI2LzEAL3Bhc3RlbDI2LzIAL3Bhc3RlbDI2LzMAL3Bhc3RlbDI2LzQAL3Bhc3RlbDI2LzUAL3Bhc3RlbDI2LzYAL3Bhc3RlbDI3LzEAL3Bhc3RlbDI3LzIAL3Bhc3RlbDI3LzMAL3Bhc3RlbDI3LzQAL3Bhc3RlbDI3LzUAL3Bhc3RlbDI3LzYAL3Bhc3RlbDI3LzcAL3Bhc3RlbDI4LzEAL3Bhc3RlbDI4LzIAL3Bhc3RlbDI4LzMAL3Bhc3RlbDI4LzQAL3Bhc3RlbDI4LzUAL3Bhc3RlbDI4LzYAL3Bhc3RlbDI4LzcAL3Bhc3RlbDI4LzgAL3BpeWcxMC8xAC9waXlnMTAvMTAAL3BpeWcxMC8yAC9waXlnMTAvMwAvcGl5ZzEwLzQAL3BpeWcxMC81AC9waXlnMTAvNgAvcGl5ZzEwLzcAL3BpeWcxMC84AC9waXlnMTAvOQAvcGl5ZzExLzEAL3BpeWcxMS8xMAAvcGl5ZzExLzExAC9waXlnMTEvMgAvcGl5ZzExLzMAL3BpeWcxMS80AC9waXlnMTEvNQAvcGl5ZzExLzYAL3BpeWcxMS83AC9waXlnMTEvOAAvcGl5ZzExLzkAL3BpeWczLzEAL3BpeWczLzIAL3BpeWczLzMAL3BpeWc0LzEAL3BpeWc0LzIAL3BpeWc0LzMAL3BpeWc0LzQAL3BpeWc1LzEAL3BpeWc1LzIAL3BpeWc1LzMAL3BpeWc1LzQAL3BpeWc1LzUAL3BpeWc2LzEAL3BpeWc2LzIAL3BpeWc2LzMAL3BpeWc2LzQAL3BpeWc2LzUAL3BpeWc2LzYAL3BpeWc3LzEAL3BpeWc3LzIAL3BpeWc3LzMAL3BpeWc3LzQAL3BpeWc3LzUAL3BpeWc3LzYAL3BpeWc3LzcAL3BpeWc4LzEAL3BpeWc4LzIAL3BpeWc4LzMAL3BpeWc4LzQAL3BpeWc4LzUAL3BpeWc4LzYAL3BpeWc4LzcAL3BpeWc4LzgAL3BpeWc5LzEAL3BpeWc5LzIAL3BpeWc5LzMAL3BpeWc5LzQAL3BpeWc5LzUAL3BpeWc5LzYAL3BpeWc5LzcAL3BpeWc5LzgAL3BpeWc5LzkAL3ByZ24xMC8xAC9wcmduMTAvMTAAL3ByZ24xMC8yAC9wcmduMTAvMwAvcHJnbjEwLzQAL3ByZ24xMC81AC9wcmduMTAvNgAvcHJnbjEwLzcAL3ByZ24xMC84AC9wcmduMTAvOQAvcHJnbjExLzEAL3ByZ24xMS8xMAAvcHJnbjExLzExAC9wcmduMTEvMgAvcHJnbjExLzMAL3ByZ24xMS80AC9wcmduMTEvNQAvcHJnbjExLzYAL3ByZ24xMS83AC9wcmduMTEvOAAvcHJnbjExLzkAL3ByZ24zLzEAL3ByZ24zLzIAL3ByZ24zLzMAL3ByZ240LzEAL3ByZ240LzIAL3ByZ240LzMAL3ByZ240LzQAL3ByZ241LzEAL3ByZ241LzIAL3ByZ241LzMAL3ByZ241LzQAL3ByZ241LzUAL3ByZ242LzEAL3ByZ242LzIAL3ByZ242LzMAL3ByZ242LzQAL3ByZ242LzUAL3ByZ242LzYAL3ByZ243LzEAL3ByZ243LzIAL3ByZ243LzMAL3ByZ243LzQAL3ByZ243LzUAL3ByZ243LzYAL3ByZ243LzcAL3ByZ244LzEAL3ByZ244LzIAL3ByZ244LzMAL3ByZ244LzQAL3ByZ244LzUAL3ByZ244LzYAL3ByZ244LzcAL3ByZ244LzgAL3ByZ245LzEAL3ByZ245LzIAL3ByZ245LzMAL3ByZ245LzQAL3ByZ245LzUAL3ByZ245LzYAL3ByZ245LzcAL3ByZ245LzgAL3ByZ245LzkAL3B1YnUzLzEAL3B1YnUzLzIAL3B1YnUzLzMAL3B1YnU0LzEAL3B1YnU0LzIAL3B1YnU0LzMAL3B1YnU0LzQAL3B1YnU1LzEAL3B1YnU1LzIAL3B1YnU1LzMAL3B1YnU1LzQAL3B1YnU1LzUAL3B1YnU2LzEAL3B1YnU2LzIAL3B1YnU2LzMAL3B1YnU2LzQAL3B1YnU2LzUAL3B1YnU2LzYAL3B1YnU3LzEAL3B1YnU3LzIAL3B1YnU3LzMAL3B1YnU3LzQAL3B1YnU3LzUAL3B1YnU3LzYAL3B1YnU3LzcAL3B1YnU4LzEAL3B1YnU4LzIAL3B1YnU4LzMAL3B1YnU4LzQAL3B1YnU4LzUAL3B1YnU4LzYAL3B1YnU4LzcAL3B1YnU4LzgAL3B1YnU5LzEAL3B1YnU5LzIAL3B1YnU5LzMAL3B1YnU5LzQAL3B1YnU5LzUAL3B1YnU5LzYAL3B1YnU5LzcAL3B1YnU5LzgAL3B1YnU5LzkAL3B1YnVnbjMvMQAvcHVidWduMy8yAC9wdWJ1Z24zLzMAL3B1YnVnbjQvMQAvcHVidWduNC8yAC9wdWJ1Z240LzMAL3B1YnVnbjQvNAAvcHVidWduNS8xAC9wdWJ1Z241LzIAL3B1YnVnbjUvMwAvcHVidWduNS80AC9wdWJ1Z241LzUAL3B1YnVnbjYvMQAvcHVidWduNi8yAC9wdWJ1Z242LzMAL3B1YnVnbjYvNAAvcHVidWduNi81AC9wdWJ1Z242LzYAL3B1YnVnbjcvMQAvcHVidWduNy8yAC9wdWJ1Z243LzMAL3B1YnVnbjcvNAAvcHVidWduNy81AC9wdWJ1Z243LzYAL3B1YnVnbjcvNwAvcHVidWduOC8xAC9wdWJ1Z244LzIAL3B1YnVnbjgvMwAvcHVidWduOC80AC9wdWJ1Z244LzUAL3B1YnVnbjgvNgAvcHVidWduOC83AC9wdWJ1Z244LzgAL3B1YnVnbjkvMQAvcHVidWduOS8yAC9wdWJ1Z245LzMAL3B1YnVnbjkvNAAvcHVidWduOS81AC9wdWJ1Z245LzYAL3B1YnVnbjkvNwAvcHVidWduOS84AC9wdWJ1Z245LzkAL3B1b3IxMC8xAC9wdW9yMTAvMTAAL3B1b3IxMC8yAC9wdW9yMTAvMwAvcHVvcjEwLzQAL3B1b3IxMC81AC9wdW9yMTAvNgAvcHVvcjEwLzcAL3B1b3IxMC84AC9wdW9yMTAvOQAvcHVvcjExLzEAL3B1b3IxMS8xMAAvcHVvcjExLzExAC9wdW9yMTEvMgAvcHVvcjExLzMAL3B1b3IxMS80AC9wdW9yMTEvNQAvcHVvcjExLzYAL3B1b3IxMS83AC9wdW9yMTEvOAAvcHVvcjExLzkAL3B1b3IzLzEAL3B1b3IzLzIAL3B1b3IzLzMAL3B1b3I0LzEAL3B1b3I0LzIAL3B1b3I0LzMAL3B1b3I0LzQAL3B1b3I1LzEAL3B1b3I1LzIAL3B1b3I1LzMAL3B1b3I1LzQAL3B1b3I1LzUAL3B1b3I2LzEAL3B1b3I2LzIAL3B1b3I2LzMAL3B1b3I2LzQAL3B1b3I2LzUAL3B1b3I2LzYAL3B1b3I3LzEAL3B1b3I3LzIAL3B1b3I3LzMAL3B1b3I3LzQAL3B1b3I3LzUAL3B1b3I3LzYAL3B1b3I3LzcAL3B1b3I4LzEAL3B1b3I4LzIAL3B1b3I4LzMAL3B1b3I4LzQAL3B1b3I4LzUAL3B1b3I4LzYAL3B1b3I4LzcAL3B1b3I4LzgAL3B1b3I5LzEAL3B1b3I5LzIAL3B1b3I5LzMAL3B1b3I5LzQAL3B1b3I5LzUAL3B1b3I5LzYAL3B1b3I5LzcAL3B1b3I5LzgAL3B1b3I5LzkAL3B1cmQzLzEAL3B1cmQzLzIAL3B1cmQzLzMAL3B1cmQ0LzEAL3B1cmQ0LzIAL3B1cmQ0LzMAL3B1cmQ0LzQAL3B1cmQ1LzEAL3B1cmQ1LzIAL3B1cmQ1LzMAL3B1cmQ1LzQAL3B1cmQ1LzUAL3B1cmQ2LzEAL3B1cmQ2LzIAL3B1cmQ2LzMAL3B1cmQ2LzQAL3B1cmQ2LzUAL3B1cmQ2LzYAL3B1cmQ3LzEAL3B1cmQ3LzIAL3B1cmQ3LzMAL3B1cmQ3LzQAL3B1cmQ3LzUAL3B1cmQ3LzYAL3B1cmQ3LzcAL3B1cmQ4LzEAL3B1cmQ4LzIAL3B1cmQ4LzMAL3B1cmQ4LzQAL3B1cmQ4LzUAL3B1cmQ4LzYAL3B1cmQ4LzcAL3B1cmQ4LzgAL3B1cmQ5LzEAL3B1cmQ5LzIAL3B1cmQ5LzMAL3B1cmQ5LzQAL3B1cmQ5LzUAL3B1cmQ5LzYAL3B1cmQ5LzcAL3B1cmQ5LzgAL3B1cmQ5LzkAL3B1cnBsZXMzLzEAL3B1cnBsZXMzLzIAL3B1cnBsZXMzLzMAL3B1cnBsZXM0LzEAL3B1cnBsZXM0LzIAL3B1cnBsZXM0LzMAL3B1cnBsZXM0LzQAL3B1cnBsZXM1LzEAL3B1cnBsZXM1LzIAL3B1cnBsZXM1LzMAL3B1cnBsZXM1LzQAL3B1cnBsZXM1LzUAL3B1cnBsZXM2LzEAL3B1cnBsZXM2LzIAL3B1cnBsZXM2LzMAL3B1cnBsZXM2LzQAL3B1cnBsZXM2LzUAL3B1cnBsZXM2LzYAL3B1cnBsZXM3LzEAL3B1cnBsZXM3LzIAL3B1cnBsZXM3LzMAL3B1cnBsZXM3LzQAL3B1cnBsZXM3LzUAL3B1cnBsZXM3LzYAL3B1cnBsZXM3LzcAL3B1cnBsZXM4LzEAL3B1cnBsZXM4LzIAL3B1cnBsZXM4LzMAL3B1cnBsZXM4LzQAL3B1cnBsZXM4LzUAL3B1cnBsZXM4LzYAL3B1cnBsZXM4LzcAL3B1cnBsZXM4LzgAL3B1cnBsZXM5LzEAL3B1cnBsZXM5LzIAL3B1cnBsZXM5LzMAL3B1cnBsZXM5LzQAL3B1cnBsZXM5LzUAL3B1cnBsZXM5LzYAL3B1cnBsZXM5LzcAL3B1cnBsZXM5LzgAL3B1cnBsZXM5LzkAL3JkYnUxMC8xAC9yZGJ1MTAvMTAAL3JkYnUxMC8yAC9yZGJ1MTAvMwAvcmRidTEwLzQAL3JkYnUxMC81AC9yZGJ1MTAvNgAvcmRidTEwLzcAL3JkYnUxMC84AC9yZGJ1MTAvOQAvcmRidTExLzEAL3JkYnUxMS8xMAAvcmRidTExLzExAC9yZGJ1MTEvMgAvcmRidTExLzMAL3JkYnUxMS80AC9yZGJ1MTEvNQAvcmRidTExLzYAL3JkYnUxMS83AC9yZGJ1MTEvOAAvcmRidTExLzkAL3JkYnUzLzEAL3JkYnUzLzIAL3JkYnUzLzMAL3JkYnU0LzEAL3JkYnU0LzIAL3JkYnU0LzMAL3JkYnU0LzQAL3JkYnU1LzEAL3JkYnU1LzIAL3JkYnU1LzMAL3JkYnU1LzQAL3JkYnU1LzUAL3JkYnU2LzEAL3JkYnU2LzIAL3JkYnU2LzMAL3JkYnU2LzQAL3JkYnU2LzUAL3JkYnU2LzYAL3JkYnU3LzEAL3JkYnU3LzIAL3JkYnU3LzMAL3JkYnU3LzQAL3JkYnU3LzUAL3JkYnU3LzYAL3JkYnU3LzcAL3JkYnU4LzEAL3JkYnU4LzIAL3JkYnU4LzMAL3JkYnU4LzQAL3JkYnU4LzUAL3JkYnU4LzYAL3JkYnU4LzcAL3JkYnU4LzgAL3JkYnU5LzEAL3JkYnU5LzIAL3JkYnU5LzMAL3JkYnU5LzQAL3JkYnU5LzUAL3JkYnU5LzYAL3JkYnU5LzcAL3JkYnU5LzgAL3JkYnU5LzkAL3JkZ3kxMC8xAC9yZGd5MTAvMTAAL3JkZ3kxMC8yAC9yZGd5MTAvMwAvcmRneTEwLzQAL3JkZ3kxMC81AC9yZGd5MTAvNgAvcmRneTEwLzcAL3JkZ3kxMC84AC9yZGd5MTAvOQAvcmRneTExLzEAL3JkZ3kxMS8xMAAvcmRneTExLzExAC9yZGd5MTEvMgAvcmRneTExLzMAL3JkZ3kxMS80AC9yZGd5MTEvNQAvcmRneTExLzYAL3JkZ3kxMS83AC9yZGd5MTEvOAAvcmRneTExLzkAL3JkZ3kzLzEAL3JkZ3kzLzIAL3JkZ3kzLzMAL3JkZ3k0LzEAL3JkZ3k0LzIAL3JkZ3k0LzMAL3JkZ3k0LzQAL3JkZ3k1LzEAL3JkZ3k1LzIAL3JkZ3k1LzMAL3JkZ3k1LzQAL3JkZ3k1LzUAL3JkZ3k2LzEAL3JkZ3k2LzIAL3JkZ3k2LzMAL3JkZ3k2LzQAL3JkZ3k2LzUAL3JkZ3k2LzYAL3JkZ3k3LzEAL3JkZ3k3LzIAL3JkZ3k3LzMAL3JkZ3k3LzQAL3JkZ3k3LzUAL3JkZ3k3LzYAL3JkZ3k3LzcAL3JkZ3k4LzEAL3JkZ3k4LzIAL3JkZ3k4LzMAL3JkZ3k4LzQAL3JkZ3k4LzUAL3JkZ3k4LzYAL3JkZ3k4LzcAL3JkZ3k4LzgAL3JkZ3k5LzEAL3JkZ3k5LzIAL3JkZ3k5LzMAL3JkZ3k5LzQAL3JkZ3k5LzUAL3JkZ3k5LzYAL3JkZ3k5LzcAL3JkZ3k5LzgAL3JkZ3k5LzkAL3JkcHUzLzEAL3JkcHUzLzIAL3JkcHUzLzMAL3JkcHU0LzEAL3JkcHU0LzIAL3JkcHU0LzMAL3JkcHU0LzQAL3JkcHU1LzEAL3JkcHU1LzIAL3JkcHU1LzMAL3JkcHU1LzQAL3JkcHU1LzUAL3JkcHU2LzEAL3JkcHU2LzIAL3JkcHU2LzMAL3JkcHU2LzQAL3JkcHU2LzUAL3JkcHU2LzYAL3JkcHU3LzEAL3JkcHU3LzIAL3JkcHU3LzMAL3JkcHU3LzQAL3JkcHU3LzUAL3JkcHU3LzYAL3JkcHU3LzcAL3JkcHU4LzEAL3JkcHU4LzIAL3JkcHU4LzMAL3JkcHU4LzQAL3JkcHU4LzUAL3JkcHU4LzYAL3JkcHU4LzcAL3JkcHU4LzgAL3JkcHU5LzEAL3JkcHU5LzIAL3JkcHU5LzMAL3JkcHU5LzQAL3JkcHU5LzUAL3JkcHU5LzYAL3JkcHU5LzcAL3JkcHU5LzgAL3JkcHU5LzkAL3JkeWxidTEwLzEAL3JkeWxidTEwLzEwAC9yZHlsYnUxMC8yAC9yZHlsYnUxMC8zAC9yZHlsYnUxMC80AC9yZHlsYnUxMC81AC9yZHlsYnUxMC82AC9yZHlsYnUxMC83AC9yZHlsYnUxMC84AC9yZHlsYnUxMC85AC9yZHlsYnUxMS8xAC9yZHlsYnUxMS8xMAAvcmR5bGJ1MTEvMTEAL3JkeWxidTExLzIAL3JkeWxidTExLzMAL3JkeWxidTExLzQAL3JkeWxidTExLzUAL3JkeWxidTExLzYAL3JkeWxidTExLzcAL3JkeWxidTExLzgAL3JkeWxidTExLzkAL3JkeWxidTMvMQAvcmR5bGJ1My8yAC9yZHlsYnUzLzMAL3JkeWxidTQvMQAvcmR5bGJ1NC8yAC9yZHlsYnU0LzMAL3JkeWxidTQvNAAvcmR5bGJ1NS8xAC9yZHlsYnU1LzIAL3JkeWxidTUvMwAvcmR5bGJ1NS80AC9yZHlsYnU1LzUAL3JkeWxidTYvMQAvcmR5bGJ1Ni8yAC9yZHlsYnU2LzMAL3JkeWxidTYvNAAvcmR5bGJ1Ni81AC9yZHlsYnU2LzYAL3JkeWxidTcvMQAvcmR5bGJ1Ny8yAC9yZHlsYnU3LzMAL3JkeWxidTcvNAAvcmR5bGJ1Ny81AC9yZHlsYnU3LzYAL3JkeWxidTcvNwAvcmR5bGJ1OC8xAC9yZHlsYnU4LzIAL3JkeWxidTgvMwAvcmR5bGJ1OC80AC9yZHlsYnU4LzUAL3JkeWxidTgvNgAvcmR5bGJ1OC83AC9yZHlsYnU4LzgAL3JkeWxidTkvMQAvcmR5bGJ1OS8yAC9yZHlsYnU5LzMAL3JkeWxidTkvNAAvcmR5bGJ1OS81AC9yZHlsYnU5LzYAL3JkeWxidTkvNwAvcmR5bGJ1OS84AC9yZHlsYnU5LzkAL3JkeWxnbjEwLzEAL3JkeWxnbjEwLzEwAC9yZHlsZ24xMC8yAC9yZHlsZ24xMC8zAC9yZHlsZ24xMC80AC9yZHlsZ24xMC81AC9yZHlsZ24xMC82AC9yZHlsZ24xMC83AC9yZHlsZ24xMC84AC9yZHlsZ24xMC85AC9yZHlsZ24xMS8xAC9yZHlsZ24xMS8xMAAvcmR5bGduMTEvMTEAL3JkeWxnbjExLzIAL3JkeWxnbjExLzMAL3JkeWxnbjExLzQAL3JkeWxnbjExLzUAL3JkeWxnbjExLzYAL3JkeWxnbjExLzcAL3JkeWxnbjExLzgAL3JkeWxnbjExLzkAL3JkeWxnbjMvMQAvcmR5bGduMy8yAC9yZHlsZ24zLzMAL3JkeWxnbjQvMQAvcmR5bGduNC8yAC9yZHlsZ240LzMAL3JkeWxnbjQvNAAvcmR5bGduNS8xAC9yZHlsZ241LzIAL3JkeWxnbjUvMwAvcmR5bGduNS80AC9yZHlsZ241LzUAL3JkeWxnbjYvMQAvcmR5bGduNi8yAC9yZHlsZ242LzMAL3JkeWxnbjYvNAAvcmR5bGduNi81AC9yZHlsZ242LzYAL3JkeWxnbjcvMQAvcmR5bGduNy8yAC9yZHlsZ243LzMAL3JkeWxnbjcvNAAvcmR5bGduNy81AC9yZHlsZ243LzYAL3JkeWxnbjcvNwAvcmR5bGduOC8xAC9yZHlsZ244LzIAL3JkeWxnbjgvMwAvcmR5bGduOC80AC9yZHlsZ244LzUAL3JkeWxnbjgvNgAvcmR5bGduOC83AC9yZHlsZ244LzgAL3JkeWxnbjkvMQAvcmR5bGduOS8yAC9yZHlsZ245LzMAL3JkeWxnbjkvNAAvcmR5bGduOS81AC9yZHlsZ245LzYAL3JkeWxnbjkvNwAvcmR5bGduOS84AC9yZHlsZ245LzkAL3JlZHMzLzEAL3JlZHMzLzIAL3JlZHMzLzMAL3JlZHM0LzEAL3JlZHM0LzIAL3JlZHM0LzMAL3JlZHM0LzQAL3JlZHM1LzEAL3JlZHM1LzIAL3JlZHM1LzMAL3JlZHM1LzQAL3JlZHM1LzUAL3JlZHM2LzEAL3JlZHM2LzIAL3JlZHM2LzMAL3JlZHM2LzQAL3JlZHM2LzUAL3JlZHM2LzYAL3JlZHM3LzEAL3JlZHM3LzIAL3JlZHM3LzMAL3JlZHM3LzQAL3JlZHM3LzUAL3JlZHM3LzYAL3JlZHM3LzcAL3JlZHM4LzEAL3JlZHM4LzIAL3JlZHM4LzMAL3JlZHM4LzQAL3JlZHM4LzUAL3JlZHM4LzYAL3JlZHM4LzcAL3JlZHM4LzgAL3JlZHM5LzEAL3JlZHM5LzIAL3JlZHM5LzMAL3JlZHM5LzQAL3JlZHM5LzUAL3JlZHM5LzYAL3JlZHM5LzcAL3JlZHM5LzgAL3JlZHM5LzkAL3NldDEzLzEAL3NldDEzLzIAL3NldDEzLzMAL3NldDE0LzEAL3NldDE0LzIAL3NldDE0LzMAL3NldDE0LzQAL3NldDE1LzEAL3NldDE1LzIAL3NldDE1LzMAL3NldDE1LzQAL3NldDE1LzUAL3NldDE2LzEAL3NldDE2LzIAL3NldDE2LzMAL3NldDE2LzQAL3NldDE2LzUAL3NldDE2LzYAL3NldDE3LzEAL3NldDE3LzIAL3NldDE3LzMAL3NldDE3LzQAL3NldDE3LzUAL3NldDE3LzYAL3NldDE3LzcAL3NldDE4LzEAL3NldDE4LzIAL3NldDE4LzMAL3NldDE4LzQAL3NldDE4LzUAL3NldDE4LzYAL3NldDE4LzcAL3NldDE4LzgAL3NldDE5LzEAL3NldDE5LzIAL3NldDE5LzMAL3NldDE5LzQAL3NldDE5LzUAL3NldDE5LzYAL3NldDE5LzcAL3NldDE5LzgAL3NldDE5LzkAL3NldDIzLzEAL3NldDIzLzIAL3NldDIzLzMAL3NldDI0LzEAL3NldDI0LzIAL3NldDI0LzMAL3NldDI0LzQAL3NldDI1LzEAL3NldDI1LzIAL3NldDI1LzMAL3NldDI1LzQAL3NldDI1LzUAL3NldDI2LzEAL3NldDI2LzIAL3NldDI2LzMAL3NldDI2LzQAL3NldDI2LzUAL3NldDI2LzYAL3NldDI3LzEAL3NldDI3LzIAL3NldDI3LzMAL3NldDI3LzQAL3NldDI3LzUAL3NldDI3LzYAL3NldDI3LzcAL3NldDI4LzEAL3NldDI4LzIAL3NldDI4LzMAL3NldDI4LzQAL3NldDI4LzUAL3NldDI4LzYAL3NldDI4LzcAL3NldDI4LzgAL3NldDMxMC8xAC9zZXQzMTAvMTAAL3NldDMxMC8yAC9zZXQzMTAvMwAvc2V0MzEwLzQAL3NldDMxMC81AC9zZXQzMTAvNgAvc2V0MzEwLzcAL3NldDMxMC84AC9zZXQzMTAvOQAvc2V0MzExLzEAL3NldDMxMS8xMAAvc2V0MzExLzExAC9zZXQzMTEvMgAvc2V0MzExLzMAL3NldDMxMS80AC9zZXQzMTEvNQAvc2V0MzExLzYAL3NldDMxMS83AC9zZXQzMTEvOAAvc2V0MzExLzkAL3NldDMxMi8xAC9zZXQzMTIvMTAAL3NldDMxMi8xMQAvc2V0MzEyLzEyAC9zZXQzMTIvMgAvc2V0MzEyLzMAL3NldDMxMi80AC9zZXQzMTIvNQAvc2V0MzEyLzYAL3NldDMxMi83AC9zZXQzMTIvOAAvc2V0MzEyLzkAL3NldDMzLzEAL3NldDMzLzIAL3NldDMzLzMAL3NldDM0LzEAL3NldDM0LzIAL3NldDM0LzMAL3NldDM0LzQAL3NldDM1LzEAL3NldDM1LzIAL3NldDM1LzMAL3NldDM1LzQAL3NldDM1LzUAL3NldDM2LzEAL3NldDM2LzIAL3NldDM2LzMAL3NldDM2LzQAL3NldDM2LzUAL3NldDM2LzYAL3NldDM3LzEAL3NldDM3LzIAL3NldDM3LzMAL3NldDM3LzQAL3NldDM3LzUAL3NldDM3LzYAL3NldDM3LzcAL3NldDM4LzEAL3NldDM4LzIAL3NldDM4LzMAL3NldDM4LzQAL3NldDM4LzUAL3NldDM4LzYAL3NldDM4LzcAL3NldDM4LzgAL3NldDM5LzEAL3NldDM5LzIAL3NldDM5LzMAL3NldDM5LzQAL3NldDM5LzUAL3NldDM5LzYAL3NldDM5LzcAL3NldDM5LzgAL3NldDM5LzkAL3NwZWN0cmFsMTAvMQAvc3BlY3RyYWwxMC8xMAAvc3BlY3RyYWwxMC8yAC9zcGVjdHJhbDEwLzMAL3NwZWN0cmFsMTAvNAAvc3BlY3RyYWwxMC81AC9zcGVjdHJhbDEwLzYAL3NwZWN0cmFsMTAvNwAvc3BlY3RyYWwxMC84AC9zcGVjdHJhbDEwLzkAL3NwZWN0cmFsMTEvMQAvc3BlY3RyYWwxMS8xMAAvc3BlY3RyYWwxMS8xMQAvc3BlY3RyYWwxMS8yAC9zcGVjdHJhbDExLzMAL3NwZWN0cmFsMTEvNAAvc3BlY3RyYWwxMS81AC9zcGVjdHJhbDExLzYAL3NwZWN0cmFsMTEvNwAvc3BlY3RyYWwxMS84AC9zcGVjdHJhbDExLzkAL3NwZWN0cmFsMy8xAC9zcGVjdHJhbDMvMgAvc3BlY3RyYWwzLzMAL3NwZWN0cmFsNC8xAC9zcGVjdHJhbDQvMgAvc3BlY3RyYWw0LzMAL3NwZWN0cmFsNC80AC9zcGVjdHJhbDUvMQAvc3BlY3RyYWw1LzIAL3NwZWN0cmFsNS8zAC9zcGVjdHJhbDUvNAAvc3BlY3RyYWw1LzUAL3NwZWN0cmFsNi8xAC9zcGVjdHJhbDYvMgAvc3BlY3RyYWw2LzMAL3NwZWN0cmFsNi80AC9zcGVjdHJhbDYvNQAvc3BlY3RyYWw2LzYAL3NwZWN0cmFsNy8xAC9zcGVjdHJhbDcvMgAvc3BlY3RyYWw3LzMAL3NwZWN0cmFsNy80AC9zcGVjdHJhbDcvNQAvc3BlY3RyYWw3LzYAL3NwZWN0cmFsNy83AC9zcGVjdHJhbDgvMQAvc3BlY3RyYWw4LzIAL3NwZWN0cmFsOC8zAC9zcGVjdHJhbDgvNAAvc3BlY3RyYWw4LzUAL3NwZWN0cmFsOC82AC9zcGVjdHJhbDgvNwAvc3BlY3RyYWw4LzgAL3NwZWN0cmFsOS8xAC9zcGVjdHJhbDkvMgAvc3BlY3RyYWw5LzMAL3NwZWN0cmFsOS80AC9zcGVjdHJhbDkvNQAvc3BlY3RyYWw5LzYAL3NwZWN0cmFsOS83AC9zcGVjdHJhbDkvOAAvc3BlY3RyYWw5LzkAL3N2Zy9hbGljZWJsdWUAL3N2Zy9hbnRpcXVld2hpdGUAL3N2Zy9hcXVhAC9zdmcvYXF1YW1hcmluZQAvc3ZnL2F6dXJlAC9zdmcvYmVpZ2UAL3N2Zy9iaXNxdWUAL3N2Zy9ibGFjawAvc3ZnL2JsYW5jaGVkYWxtb25kAC9zdmcvYmx1ZQAvc3ZnL2JsdWV2aW9sZXQAL3N2Zy9icm93bgAvc3ZnL2J1cmx5d29vZAAvc3ZnL2NhZGV0Ymx1ZQAvc3ZnL2NoYXJ0cmV1c2UAL3N2Zy9jaG9jb2xhdGUAL3N2Zy9jb3JhbAAvc3ZnL2Nvcm5mbG93ZXJibHVlAC9zdmcvY29ybnNpbGsAL3N2Zy9jcmltc29uAC9zdmcvY3lhbgAvc3ZnL2RhcmtibHVlAC9zdmcvZGFya2N5YW4AL3N2Zy9kYXJrZ29sZGVucm9kAC9zdmcvZGFya2dyYXkAL3N2Zy9kYXJrZ3JlZW4AL3N2Zy9kYXJrZ3JleQAvc3ZnL2RhcmtraGFraQAvc3ZnL2RhcmttYWdlbnRhAC9zdmcvZGFya29saXZlZ3JlZW4AL3N2Zy9kYXJrb3JhbmdlAC9zdmcvZGFya29yY2hpZAAvc3ZnL2RhcmtyZWQAL3N2Zy9kYXJrc2FsbW9uAC9zdmcvZGFya3NlYWdyZWVuAC9zdmcvZGFya3NsYXRlYmx1ZQAvc3ZnL2RhcmtzbGF0ZWdyYXkAL3N2Zy9kYXJrc2xhdGVncmV5AC9zdmcvZGFya3R1cnF1b2lzZQAvc3ZnL2Rhcmt2aW9sZXQAL3N2Zy9kZWVwcGluawAvc3ZnL2RlZXBza3libHVlAC9zdmcvZGltZ3JheQAvc3ZnL2RpbWdyZXkAL3N2Zy9kb2RnZXJibHVlAC9zdmcvZmlyZWJyaWNrAC9zdmcvZmxvcmFsd2hpdGUAL3N2Zy9mb3Jlc3RncmVlbgAvc3ZnL2Z1Y2hzaWEAL3N2Zy9nYWluc2Jvcm8AL3N2Zy9naG9zdHdoaXRlAC9zdmcvZ29sZAAvc3ZnL2dvbGRlbnJvZAAvc3ZnL2dyYXkAL3N2Zy9ncmVlbgAvc3ZnL2dyZWVueWVsbG93AC9zdmcvZ3JleQAvc3ZnL2hvbmV5ZGV3AC9zdmcvaG90cGluawAvc3ZnL2luZGlhbnJlZAAvc3ZnL2luZGlnbwAvc3ZnL2l2b3J5AC9zdmcva2hha2kAL3N2Zy9sYXZlbmRlcgAvc3ZnL2xhdmVuZGVyYmx1c2gAL3N2Zy9sYXduZ3JlZW4AL3N2Zy9sZW1vbmNoaWZmb24AL3N2Zy9saWdodGJsdWUAL3N2Zy9saWdodGNvcmFsAC9zdmcvbGlnaHRjeWFuAC9zdmcvbGlnaHRnb2xkZW5yb2R5ZWxsb3cAL3N2Zy9saWdodGdyYXkAL3N2Zy9saWdodGdyZWVuAC9zdmcvbGlnaHRncmV5AC9zdmcvbGlnaHRwaW5rAC9zdmcvbGlnaHRzYWxtb24AL3N2Zy9saWdodHNlYWdyZWVuAC9zdmcvbGlnaHRza3libHVlAC9zdmcvbGlnaHRzbGF0ZWdyYXkAL3N2Zy9saWdodHNsYXRlZ3JleQAvc3ZnL2xpZ2h0c3RlZWxibHVlAC9zdmcvbGlnaHR5ZWxsb3cAL3N2Zy9saW1lAC9zdmcvbGltZWdyZWVuAC9zdmcvbGluZW4AL3N2Zy9tYWdlbnRhAC9zdmcvbWFyb29uAC9zdmcvbWVkaXVtYXF1YW1hcmluZQAvc3ZnL21lZGl1bWJsdWUAL3N2Zy9tZWRpdW1vcmNoaWQAL3N2Zy9tZWRpdW1wdXJwbGUAL3N2Zy9tZWRpdW1zZWFncmVlbgAvc3ZnL21lZGl1bXNsYXRlYmx1ZQAvc3ZnL21lZGl1bXNwcmluZ2dyZWVuAC9zdmcvbWVkaXVtdHVycXVvaXNlAC9zdmcvbWVkaXVtdmlvbGV0cmVkAC9zdmcvbWlkbmlnaHRibHVlAC9zdmcvbWludGNyZWFtAC9zdmcvbWlzdHlyb3NlAC9zdmcvbW9jY2FzaW4AL3N2Zy9uYXZham93aGl0ZQAvc3ZnL25hdnkAL3N2Zy9vbGRsYWNlAC9zdmcvb2xpdmUAL3N2Zy9vbGl2ZWRyYWIAL3N2Zy9vcmFuZ2UAL3N2Zy9vcmFuZ2VyZWQAL3N2Zy9vcmNoaWQAL3N2Zy9wYWxlZ29sZGVucm9kAC9zdmcvcGFsZWdyZWVuAC9zdmcvcGFsZXR1cnF1b2lzZQAvc3ZnL3BhbGV2aW9sZXRyZWQAL3N2Zy9wYXBheWF3aGlwAC9zdmcvcGVhY2hwdWZmAC9zdmcvcGVydQAvc3ZnL3BpbmsAL3N2Zy9wbHVtAC9zdmcvcG93ZGVyYmx1ZQAvc3ZnL3B1cnBsZQAvc3ZnL3JlZAAvc3ZnL3Jvc3licm93bgAvc3ZnL3JveWFsYmx1ZQAvc3ZnL3NhZGRsZWJyb3duAC9zdmcvc2FsbW9uAC9zdmcvc2FuZHlicm93bgAvc3ZnL3NlYWdyZWVuAC9zdmcvc2Vhc2hlbGwAL3N2Zy9zaWVubmEAL3N2Zy9zaWx2ZXIAL3N2Zy9za3libHVlAC9zdmcvc2xhdGVibHVlAC9zdmcvc2xhdGVncmF5AC9zdmcvc2xhdGVncmV5AC9zdmcvc25vdwAvc3ZnL3NwcmluZ2dyZWVuAC9zdmcvc3RlZWxibHVlAC9zdmcvdGFuAC9zdmcvdGVhbAAvc3ZnL3RoaXN0bGUAL3N2Zy90b21hdG8AL3N2Zy90dXJxdW9pc2UAL3N2Zy92aW9sZXQAL3N2Zy93aGVhdAAvc3ZnL3doaXRlAC9zdmcvd2hpdGVzbW9rZQAvc3ZnL3llbGxvdwAvc3ZnL3llbGxvd2dyZWVuAC95bGduMy8xAC95bGduMy8yAC95bGduMy8zAC95bGduNC8xAC95bGduNC8yAC95bGduNC8zAC95bGduNC80AC95bGduNS8xAC95bGduNS8yAC95bGduNS8zAC95bGduNS80AC95bGduNS81AC95bGduNi8xAC95bGduNi8yAC95bGduNi8zAC95bGduNi80AC95bGduNi81AC95bGduNi82AC95bGduNy8xAC95bGduNy8yAC95bGduNy8zAC95bGduNy80AC95bGduNy81AC95bGduNy82AC95bGduNy83AC95bGduOC8xAC95bGduOC8yAC95bGduOC8zAC95bGduOC80AC95bGduOC81AC95bGduOC82AC95bGduOC83AC95bGduOC84AC95bGduOS8xAC95bGduOS8yAC95bGduOS8zAC95bGduOS80AC95bGduOS81AC95bGduOS82AC95bGduOS83AC95bGduOS84AC95bGduOS85AC95bGduYnUzLzEAL3lsZ25idTMvMgAveWxnbmJ1My8zAC95bGduYnU0LzEAL3lsZ25idTQvMgAveWxnbmJ1NC8zAC95bGduYnU0LzQAL3lsZ25idTUvMQAveWxnbmJ1NS8yAC95bGduYnU1LzMAL3lsZ25idTUvNAAveWxnbmJ1NS81AC95bGduYnU2LzEAL3lsZ25idTYvMgAveWxnbmJ1Ni8zAC95bGduYnU2LzQAL3lsZ25idTYvNQAveWxnbmJ1Ni82AC95bGduYnU3LzEAL3lsZ25idTcvMgAveWxnbmJ1Ny8zAC95bGduYnU3LzQAL3lsZ25idTcvNQAveWxnbmJ1Ny82AC95bGduYnU3LzcAL3lsZ25idTgvMQAveWxnbmJ1OC8yAC95bGduYnU4LzMAL3lsZ25idTgvNAAveWxnbmJ1OC81AC95bGduYnU4LzYAL3lsZ25idTgvNwAveWxnbmJ1OC84AC95bGduYnU5LzEAL3lsZ25idTkvMgAveWxnbmJ1OS8zAC95bGduYnU5LzQAL3lsZ25idTkvNQAveWxnbmJ1OS82AC95bGduYnU5LzcAL3lsZ25idTkvOAAveWxnbmJ1OS85AC95bG9yYnIzLzEAL3lsb3JicjMvMgAveWxvcmJyMy8zAC95bG9yYnI0LzEAL3lsb3JicjQvMgAveWxvcmJyNC8zAC95bG9yYnI0LzQAL3lsb3JicjUvMQAveWxvcmJyNS8yAC95bG9yYnI1LzMAL3lsb3JicjUvNAAveWxvcmJyNS81AC95bG9yYnI2LzEAL3lsb3JicjYvMgAveWxvcmJyNi8zAC95bG9yYnI2LzQAL3lsb3JicjYvNQAveWxvcmJyNi82AC95bG9yYnI3LzEAL3lsb3JicjcvMgAveWxvcmJyNy8zAC95bG9yYnI3LzQAL3lsb3JicjcvNQAveWxvcmJyNy82AC95bG9yYnI3LzcAL3lsb3JicjgvMQAveWxvcmJyOC8yAC95bG9yYnI4LzMAL3lsb3JicjgvNAAveWxvcmJyOC81AC95bG9yYnI4LzYAL3lsb3JicjgvNwAveWxvcmJyOC84AC95bG9yYnI5LzEAL3lsb3JicjkvMgAveWxvcmJyOS8zAC95bG9yYnI5LzQAL3lsb3JicjkvNQAveWxvcmJyOS82AC95bG9yYnI5LzcAL3lsb3JicjkvOAAveWxvcmJyOS85AC95bG9ycmQzLzEAL3lsb3JyZDMvMgAveWxvcnJkMy8zAC95bG9ycmQ0LzEAL3lsb3JyZDQvMgAveWxvcnJkNC8zAC95bG9ycmQ0LzQAL3lsb3JyZDUvMQAveWxvcnJkNS8yAC95bG9ycmQ1LzMAL3lsb3JyZDUvNAAveWxvcnJkNS81AC95bG9ycmQ2LzEAL3lsb3JyZDYvMgAveWxvcnJkNi8zAC95bG9ycmQ2LzQAL3lsb3JyZDYvNQAveWxvcnJkNi82AC95bG9ycmQ3LzEAL3lsb3JyZDcvMgAveWxvcnJkNy8zAC95bG9ycmQ3LzQAL3lsb3JyZDcvNQAveWxvcnJkNy82AC95bG9ycmQ3LzcAL3lsb3JyZDgvMQAveWxvcnJkOC8yAC95bG9ycmQ4LzMAL3lsb3JyZDgvNAAveWxvcnJkOC81AC95bG9ycmQ4LzYAL3lsb3JyZDgvNwAveWxvcnJkOC84AC95bG9ycmQ5LzEAL3lsb3JyZDkvMgAveWxvcnJkOS8zAC95bG9ycmQ5LzQAL3lsb3JyZDkvNQAveWxvcnJkOS82AC95bG9ycmQ5LzcAL3lsb3JyZDkvOAAveWxvcnJkOS85AGFsaWNlYmx1ZQBhbnRpcXVld2hpdGUAYW50aXF1ZXdoaXRlMQBhbnRpcXVld2hpdGUyAGFudGlxdWV3aGl0ZTMAYW50aXF1ZXdoaXRlNABhcXVhbWFyaW5lAGFxdWFtYXJpbmUxAGFxdWFtYXJpbmUyAGFxdWFtYXJpbmUzAGFxdWFtYXJpbmU0AGF6dXJlAGF6dXJlMQBhenVyZTIAYXp1cmUzAGF6dXJlNABiZWlnZQBiaXNxdWUAYmlzcXVlMQBiaXNxdWUyAGJpc3F1ZTMAYmlzcXVlNABibGFuY2hlZGFsbW9uZABibHVlAGJsdWUxAGJsdWUyAGJsdWUzAGJsdWU0AGJsdWV2aW9sZXQAYnJvd24AYnJvd24xAGJyb3duMgBicm93bjMAYnJvd240AGJ1cmx5d29vZABidXJseXdvb2QxAGJ1cmx5d29vZDIAYnVybHl3b29kMwBidXJseXdvb2Q0AGNhZGV0Ymx1ZQBjYWRldGJsdWUxAGNhZGV0Ymx1ZTIAY2FkZXRibHVlMwBjYWRldGJsdWU0AGNoYXJ0cmV1c2UAY2hhcnRyZXVzZTEAY2hhcnRyZXVzZTIAY2hhcnRyZXVzZTMAY2hhcnRyZXVzZTQAY2hvY29sYXRlAGNob2NvbGF0ZTEAY2hvY29sYXRlMgBjaG9jb2xhdGUzAGNob2NvbGF0ZTQAY29yYWwAY29yYWwxAGNvcmFsMgBjb3JhbDMAY29yYWw0AGNvcm5mbG93ZXJibHVlAGNvcm5zaWxrAGNvcm5zaWxrMQBjb3Juc2lsazIAY29ybnNpbGszAGNvcm5zaWxrNABjcmltc29uAGN5YW4AY3lhbjEAY3lhbjIAY3lhbjMAY3lhbjQAZGFya2dvbGRlbnJvZABkYXJrZ29sZGVucm9kMQBkYXJrZ29sZGVucm9kMgBkYXJrZ29sZGVucm9kMwBkYXJrZ29sZGVucm9kNABkYXJrZ3JlZW4AZGFya2toYWtpAGRhcmtvbGl2ZWdyZWVuAGRhcmtvbGl2ZWdyZWVuMQBkYXJrb2xpdmVncmVlbjIAZGFya29saXZlZ3JlZW4zAGRhcmtvbGl2ZWdyZWVuNABkYXJrb3JhbmdlAGRhcmtvcmFuZ2UxAGRhcmtvcmFuZ2UyAGRhcmtvcmFuZ2UzAGRhcmtvcmFuZ2U0AGRhcmtvcmNoaWQAZGFya29yY2hpZDEAZGFya29yY2hpZDIAZGFya29yY2hpZDMAZGFya29yY2hpZDQAZGFya3NhbG1vbgBkYXJrc2VhZ3JlZW4AZGFya3NlYWdyZWVuMQBkYXJrc2VhZ3JlZW4yAGRhcmtzZWFncmVlbjMAZGFya3NlYWdyZWVuNABkYXJrc2xhdGVibHVlAGRhcmtzbGF0ZWdyYXkAZGFya3NsYXRlZ3JheTEAZGFya3NsYXRlZ3JheTIAZGFya3NsYXRlZ3JheTMAZGFya3NsYXRlZ3JheTQAZGFya3NsYXRlZ3JleQBkYXJrdHVycXVvaXNlAGRhcmt2aW9sZXQAZGVlcHBpbmsAZGVlcHBpbmsxAGRlZXBwaW5rMgBkZWVwcGluazMAZGVlcHBpbms0AGRlZXBza3libHVlAGRlZXBza3libHVlMQBkZWVwc2t5Ymx1ZTIAZGVlcHNreWJsdWUzAGRlZXBza3libHVlNABkaW1ncmF5AGRpbWdyZXkAZG9kZ2VyYmx1ZQBkb2RnZXJibHVlMQBkb2RnZXJibHVlMgBkb2RnZXJibHVlMwBkb2RnZXJibHVlNABmaXJlYnJpY2sAZmlyZWJyaWNrMQBmaXJlYnJpY2syAGZpcmVicmljazMAZmlyZWJyaWNrNABmbG9yYWx3aGl0ZQBmb3Jlc3RncmVlbgBnYWluc2Jvcm8AZ2hvc3R3aGl0ZQBnb2xkAGdvbGQxAGdvbGQyAGdvbGQzAGdvbGQ0AGdvbGRlbnJvZABnb2xkZW5yb2QxAGdvbGRlbnJvZDIAZ29sZGVucm9kMwBnb2xkZW5yb2Q0AGdyYXkAZ3JheTAAZ3JheTEAZ3JheTEwAGdyYXkxMDAAZ3JheTExAGdyYXkxMgBncmF5MTMAZ3JheTE0AGdyYXkxNQBncmF5MTYAZ3JheTE3AGdyYXkxOABncmF5MTkAZ3JheTIAZ3JheTIwAGdyYXkyMQBncmF5MjIAZ3JheTIzAGdyYXkyNABncmF5MjUAZ3JheTI2AGdyYXkyNwBncmF5MjgAZ3JheTI5AGdyYXkzAGdyYXkzMABncmF5MzEAZ3JheTMyAGdyYXkzMwBncmF5MzQAZ3JheTM1AGdyYXkzNgBncmF5MzcAZ3JheTM4AGdyYXkzOQBncmF5NABncmF5NDAAZ3JheTQxAGdyYXk0MgBncmF5NDMAZ3JheTQ0AGdyYXk0NQBncmF5NDYAZ3JheTQ3AGdyYXk0OABncmF5NDkAZ3JheTUAZ3JheTUwAGdyYXk1MQBncmF5NTIAZ3JheTUzAGdyYXk1NABncmF5NTUAZ3JheTU2AGdyYXk1NwBncmF5NTgAZ3JheTU5AGdyYXk2AGdyYXk2MABncmF5NjEAZ3JheTYyAGdyYXk2MwBncmF5NjQAZ3JheTY1AGdyYXk2NgBncmF5NjcAZ3JheTY4AGdyYXk2OQBncmF5NwBncmF5NzAAZ3JheTcxAGdyYXk3MgBncmF5NzMAZ3JheTc0AGdyYXk3NQBncmF5NzYAZ3JheTc3AGdyYXk3OABncmF5NzkAZ3JheTgAZ3JheTgwAGdyYXk4MQBncmF5ODIAZ3JheTgzAGdyYXk4NABncmF5ODUAZ3JheTg2AGdyYXk4NwBncmF5ODgAZ3JheTg5AGdyYXk5AGdyYXk5MABncmF5OTEAZ3JheTkyAGdyYXk5MwBncmF5OTQAZ3JheTk1AGdyYXk5NgBncmF5OTcAZ3JheTk4AGdyYXk5OQBncmVlbgBncmVlbjEAZ3JlZW4yAGdyZWVuMwBncmVlbjQAZ3JlZW55ZWxsb3cAZ3JleQBncmV5MABncmV5MQBncmV5MTAAZ3JleTEwMABncmV5MTEAZ3JleTEyAGdyZXkxMwBncmV5MTQAZ3JleTE1AGdyZXkxNgBncmV5MTcAZ3JleTE4AGdyZXkxOQBncmV5MgBncmV5MjAAZ3JleTIxAGdyZXkyMgBncmV5MjMAZ3JleTI0AGdyZXkyNQBncmV5MjYAZ3JleTI3AGdyZXkyOABncmV5MjkAZ3JleTMAZ3JleTMwAGdyZXkzMQBncmV5MzIAZ3JleTMzAGdyZXkzNABncmV5MzUAZ3JleTM2AGdyZXkzNwBncmV5MzgAZ3JleTM5AGdyZXk0AGdyZXk0MABncmV5NDEAZ3JleTQyAGdyZXk0MwBncmV5NDQAZ3JleTQ1AGdyZXk0NgBncmV5NDcAZ3JleTQ4AGdyZXk0OQBncmV5NQBncmV5NTAAZ3JleTUxAGdyZXk1MgBncmV5NTMAZ3JleTU0AGdyZXk1NQBncmV5NTYAZ3JleTU3AGdyZXk1OABncmV5NTkAZ3JleTYAZ3JleTYwAGdyZXk2MQBncmV5NjIAZ3JleTYzAGdyZXk2NABncmV5NjUAZ3JleTY2AGdyZXk2NwBncmV5NjgAZ3JleTY5AGdyZXk3AGdyZXk3MABncmV5NzEAZ3JleTcyAGdyZXk3MwBncmV5NzQAZ3JleTc1AGdyZXk3NgBncmV5NzcAZ3JleTc4AGdyZXk3OQBncmV5OABncmV5ODAAZ3JleTgxAGdyZXk4MgBncmV5ODMAZ3JleTg0AGdyZXk4NQBncmV5ODYAZ3JleTg3AGdyZXk4OABncmV5ODkAZ3JleTkAZ3JleTkwAGdyZXk5MQBncmV5OTIAZ3JleTkzAGdyZXk5NABncmV5OTUAZ3JleTk2AGdyZXk5NwBncmV5OTgAZ3JleTk5AGhvbmV5ZGV3AGhvbmV5ZGV3MQBob25leWRldzIAaG9uZXlkZXczAGhvbmV5ZGV3NABob3RwaW5rAGhvdHBpbmsxAGhvdHBpbmsyAGhvdHBpbmszAGhvdHBpbms0AGluZGlhbnJlZABpbmRpYW5yZWQxAGluZGlhbnJlZDIAaW5kaWFucmVkMwBpbmRpYW5yZWQ0AGluZGlnbwBpbnZpcwBpdm9yeQBpdm9yeTEAaXZvcnkyAGl2b3J5MwBpdm9yeTQAa2hha2kAa2hha2kxAGtoYWtpMgBraGFraTMAa2hha2k0AGxhdmVuZGVyAGxhdmVuZGVyYmx1c2gAbGF2ZW5kZXJibHVzaDEAbGF2ZW5kZXJibHVzaDIAbGF2ZW5kZXJibHVzaDMAbGF2ZW5kZXJibHVzaDQAbGF3bmdyZWVuAGxlbW9uY2hpZmZvbgBsZW1vbmNoaWZmb24xAGxlbW9uY2hpZmZvbjIAbGVtb25jaGlmZm9uMwBsZW1vbmNoaWZmb240AGxpZ2h0Ymx1ZQBsaWdodGJsdWUxAGxpZ2h0Ymx1ZTIAbGlnaHRibHVlMwBsaWdodGJsdWU0AGxpZ2h0Y29yYWwAbGlnaHRjeWFuAGxpZ2h0Y3lhbjEAbGlnaHRjeWFuMgBsaWdodGN5YW4zAGxpZ2h0Y3lhbjQAbGlnaHRnb2xkZW5yb2QAbGlnaHRnb2xkZW5yb2QxAGxpZ2h0Z29sZGVucm9kMgBsaWdodGdvbGRlbnJvZDMAbGlnaHRnb2xkZW5yb2Q0AGxpZ2h0Z29sZGVucm9keWVsbG93AGxpZ2h0Z3JheQBsaWdodGdyZXkAbGlnaHRwaW5rAGxpZ2h0cGluazEAbGlnaHRwaW5rMgBsaWdodHBpbmszAGxpZ2h0cGluazQAbGlnaHRzYWxtb24AbGlnaHRzYWxtb24xAGxpZ2h0c2FsbW9uMgBsaWdodHNhbG1vbjMAbGlnaHRzYWxtb240AGxpZ2h0c2VhZ3JlZW4AbGlnaHRza3libHVlAGxpZ2h0c2t5Ymx1ZTEAbGlnaHRza3libHVlMgBsaWdodHNreWJsdWUzAGxpZ2h0c2t5Ymx1ZTQAbGlnaHRzbGF0ZWJsdWUAbGlnaHRzbGF0ZWdyYXkAbGlnaHRzbGF0ZWdyZXkAbGlnaHRzdGVlbGJsdWUAbGlnaHRzdGVlbGJsdWUxAGxpZ2h0c3RlZWxibHVlMgBsaWdodHN0ZWVsYmx1ZTMAbGlnaHRzdGVlbGJsdWU0AGxpZ2h0eWVsbG93AGxpZ2h0eWVsbG93MQBsaWdodHllbGxvdzIAbGlnaHR5ZWxsb3czAGxpZ2h0eWVsbG93NABsaW1lZ3JlZW4AbGluZW4AbWFnZW50YQBtYWdlbnRhMQBtYWdlbnRhMgBtYWdlbnRhMwBtYWdlbnRhNABtYXJvb24AbWFyb29uMQBtYXJvb24yAG1hcm9vbjMAbWFyb29uNABtZWRpdW1hcXVhbWFyaW5lAG1lZGl1bWJsdWUAbWVkaXVtb3JjaGlkAG1lZGl1bW9yY2hpZDEAbWVkaXVtb3JjaGlkMgBtZWRpdW1vcmNoaWQzAG1lZGl1bW9yY2hpZDQAbWVkaXVtcHVycGxlAG1lZGl1bXB1cnBsZTEAbWVkaXVtcHVycGxlMgBtZWRpdW1wdXJwbGUzAG1lZGl1bXB1cnBsZTQAbWVkaXVtc2VhZ3JlZW4AbWVkaXVtc2xhdGVibHVlAG1lZGl1bXNwcmluZ2dyZWVuAG1lZGl1bXR1cnF1b2lzZQBtZWRpdW12aW9sZXRyZWQAbWlkbmlnaHRibHVlAG1pbnRjcmVhbQBtaXN0eXJvc2UAbWlzdHlyb3NlMQBtaXN0eXJvc2UyAG1pc3R5cm9zZTMAbWlzdHlyb3NlNABtb2NjYXNpbgBuYXZham93aGl0ZQBuYXZham93aGl0ZTEAbmF2YWpvd2hpdGUyAG5hdmFqb3doaXRlMwBuYXZham93aGl0ZTQAbmF2eQBuYXZ5Ymx1ZQBub25lAG9sZGxhY2UAb2xpdmVkcmFiAG9saXZlZHJhYjEAb2xpdmVkcmFiMgBvbGl2ZWRyYWIzAG9saXZlZHJhYjQAb3JhbmdlAG9yYW5nZTEAb3JhbmdlMgBvcmFuZ2UzAG9yYW5nZTQAb3JhbmdlcmVkAG9yYW5nZXJlZDEAb3JhbmdlcmVkMgBvcmFuZ2VyZWQzAG9yYW5nZXJlZDQAb3JjaGlkAG9yY2hpZDEAb3JjaGlkMgBvcmNoaWQzAG9yY2hpZDQAcGFsZWdvbGRlbnJvZABwYWxlZ3JlZW4AcGFsZWdyZWVuMQBwYWxlZ3JlZW4yAHBhbGVncmVlbjMAcGFsZWdyZWVuNABwYWxldHVycXVvaXNlAHBhbGV0dXJxdW9pc2UxAHBhbGV0dXJxdW9pc2UyAHBhbGV0dXJxdW9pc2UzAHBhbGV0dXJxdW9pc2U0AHBhbGV2aW9sZXRyZWQAcGFsZXZpb2xldHJlZDEAcGFsZXZpb2xldHJlZDIAcGFsZXZpb2xldHJlZDMAcGFsZXZpb2xldHJlZDQAcGFwYXlhd2hpcABwZWFjaHB1ZmYAcGVhY2hwdWZmMQBwZWFjaHB1ZmYyAHBlYWNocHVmZjMAcGVhY2hwdWZmNABwZXJ1AHBpbmsAcGluazEAcGluazIAcGluazMAcGluazQAcGx1bQBwbHVtMQBwbHVtMgBwbHVtMwBwbHVtNABwb3dkZXJibHVlAHB1cnBsZQBwdXJwbGUxAHB1cnBsZTIAcHVycGxlMwBwdXJwbGU0AHJlZAByZWQxAHJlZDIAcmVkMwByZWQ0AHJvc3licm93bgByb3N5YnJvd24xAHJvc3licm93bjIAcm9zeWJyb3duMwByb3N5YnJvd240AHJveWFsYmx1ZQByb3lhbGJsdWUxAHJveWFsYmx1ZTIAcm95YWxibHVlMwByb3lhbGJsdWU0AHNhZGRsZWJyb3duAHNhbG1vbgBzYWxtb24xAHNhbG1vbjIAc2FsbW9uMwBzYWxtb240AHNhbmR5YnJvd24Ac2VhZ3JlZW4Ac2VhZ3JlZW4xAHNlYWdyZWVuMgBzZWFncmVlbjMAc2VhZ3JlZW40AHNlYXNoZWxsAHNlYXNoZWxsMQBzZWFzaGVsbDIAc2Vhc2hlbGwzAHNlYXNoZWxsNABzaWVubmEAc2llbm5hMQBzaWVubmEyAHNpZW5uYTMAc2llbm5hNABza3libHVlAHNreWJsdWUxAHNreWJsdWUyAHNreWJsdWUzAHNreWJsdWU0AHNsYXRlYmx1ZQBzbGF0ZWJsdWUxAHNsYXRlYmx1ZTIAc2xhdGVibHVlMwBzbGF0ZWJsdWU0AHNsYXRlZ3JheQBzbGF0ZWdyYXkxAHNsYXRlZ3JheTIAc2xhdGVncmF5MwBzbGF0ZWdyYXk0AHNsYXRlZ3JleQBzbm93AHNub3cxAHNub3cyAHNub3czAHNub3c0AHNwcmluZ2dyZWVuAHNwcmluZ2dyZWVuMQBzcHJpbmdncmVlbjIAc3ByaW5nZ3JlZW4zAHNwcmluZ2dyZWVuNABzdGVlbGJsdWUAc3RlZWxibHVlMQBzdGVlbGJsdWUyAHN0ZWVsYmx1ZTMAc3RlZWxibHVlNAB0YW4AdGFuMQB0YW4yAHRhbjMAdGFuNAB0aGlzdGxlAHRoaXN0bGUxAHRoaXN0bGUyAHRoaXN0bGUzAHRoaXN0bGU0AHRvbWF0bwB0b21hdG8xAHRvbWF0bzIAdG9tYXRvMwB0b21hdG80AHR1cnF1b2lzZQB0dXJxdW9pc2UxAHR1cnF1b2lzZTIAdHVycXVvaXNlMwB0dXJxdW9pc2U0AHZpb2xldAB2aW9sZXRyZWQAdmlvbGV0cmVkMQB2aW9sZXRyZWQyAHZpb2xldHJlZDMAdmlvbGV0cmVkNAB3aGVhdAB3aGVhdDEAd2hlYXQyAHdoZWF0MwB3aGVhdDQAd2hpdGUAd2hpdGVzbW9rZQB5ZWxsb3cAeWVsbG93MQB5ZWxsb3cyAHllbGxvdzMAeWVsbG93NAB5ZWxsb3dncmVlbgBsYWNrAGhpdGUAaWdodGdyZXkAWDExLwAvJXMvJXMAaW1hZ2VzY2FsZQBmYWxzZQBibGFjawBkb3R0ZWQAZGFzaGVkAGNwLT5zcmMAaHRtbHRhYmxlLmMAZW1pdF9odG1sX2ltZwBjcC0+c3JjWzBdAHRyYW5zcGFyZW50AF8lZAAlZAAyADMANAA1ADYANwA4ADkAMTAAMTEAMTIAMTMAMTQAMTUAMTYAMTcAMTgAMTkAMjAAQWdub2RlaW5mb190AEFnZWRnZWluZm9fdAByb3dnAGNvbGcAQWdyYXBoaW5mb190AGRlbHggPj0gMABwb3NfaHRtbF90YmwAZGVseSA+PSAwAHRhYmxlIHNpemUgdG9vIHNtYWxsIGZvciBjb250ZW50CgBmaXhlZCB0YWJsZSBzaXplIHdpdGggdW5zcGVjaWZpZWQgd2lkdGggb3IgaGVpZ2h0CgBjZWxsIHNpemUgdG9vIHNtYWxsIGZvciBjb250ZW50CgBmaXhlZCBjZWxsIHNpemUgd2l0aCB1bnNwZWNpZmllZCB3aWR0aCBvciBoZWlnaHQKAE5vIG9yIGltcHJvcGVyIGltYWdlIGZpbGU9IiVzIgoAcGVuY29sb3IALT4AZlBRLmMAUFFjaGVjawBIZWFwIG92ZXJmbG93CgAlIVBTLUFkb2JlLTIuMAovbm9kZSB7CiAgL1kgZXhjaCBkZWYKICAvWCBleGNoIGRlZgogIC95IGV4Y2ggZGVmCiAgL3ggZXhjaCBkZWYKICBuZXdwYXRoCiAgeCB5IG1vdmV0bwogIHggWSBsaW5ldG8KICBYIFkgbGluZXRvCiAgWCB5IGxpbmV0bwogIGNsb3NlcGF0aCBmaWxsCn0gZGVmCi9jZWxsIHsKICAvWSBleGNoIGRlZgogIC9YIGV4Y2ggZGVmCiAgL3kgZXhjaCBkZWYKICAveCBleGNoIGRlZgogIG5ld3BhdGgKICB4IHkgbW92ZXRvCiAgeCBZIGxpbmV0bwogIFggWSBsaW5ldG8KICBYIHkgbGluZXRvCiAgY2xvc2VwYXRoIHN0cm9rZQp9IGRlZgoAc2hvd3BhZ2UKAGZhaWxlZCBhdCBub2RlICVkWzBdCgBucC0+Y2VsbHNbMF0AbWF6ZS5jAGNoa1NncmFwaABmYWlsZWQgYXQgbm9kZSAlZFsxXQoAbnAtPmNlbGxzWzFdAGRpdGVtcwBmaW5kU1ZlcnQAJSUlJVBhZ2U6IDEgMQolJSUlUGFnZUJvdW5kaW5nQm94OiAlZCAlZCAlZCAlZAoAJWYgJWYgdHJhbnNsYXRlCgAwIDAgMSBzZXRyZ2Jjb2xvcgoAJWYgJWYgJWYgJWYgbm9kZQoAMCAwIDAgc2V0cmdiY29sb3IKACVmICVmICVmICVmIGNlbGwKADEgMCAwIHNldHJnYmNvbG9yCgB1bmV4cGVjdGVkIGNhc2UgaW4gbG9jYXRlX2VuZHBvaW50CgAwAHRyYXBlem9pZC5jAGxvY2F0ZV9lbmRwb2ludABhZGRfc2VnbWVudDogZXJyb3IKAG5ld25vZGU6IFF1ZXJ5LXRhYmxlIG92ZXJmbG93CgBuZXdub2RlAG5ld3RyYXA6IFRyYXBlem9pZC10YWJsZSBvdmVyZmxvdyAlZAoAbmV3dHJhcABpbmRleC5jAFJUcmVlU2VhcmNoAG4tPmxldmVsID49IDAAUlRyZWVJbnNlcnQAbGV2ZWwgPj0gMCAmJiBsZXZlbCA8PSAoKm4pLT5sZXZlbAByLT5ib3VuZGFyeVtpXSA8PSByLT5ib3VuZGFyeVtOVU1ESU1TICsgaV0AciAmJiBuICYmIG5ldwBSVHJlZUluc2VydDIAbGV2ZWwgPj0gMCAmJiBsZXZlbCA8PSBuLT5sZXZlbABGQUxTRQBub2RlLmMATm9kZUNvdmVyAHIgJiYgbgBQaWNrQnJhbmNoAEFkZEJyYW5jaABpIDwgTk9ERUNBUkQAbmV3AG4gJiYgaSA+PSAwICYmIGkgPCBOT0RFQ0FSRABEaXNjb25CcmFuY2gAcgByZWN0YW5nbGUuYwBSZWN0QXJlYQByICYmIHJyAENvbWJpbmVSZWN0AHIgJiYgcwBPdmVybGFwAG4Ac3BsaXQucS5jAFNwbGl0Tm9kZQBiAG4tPmNvdW50ICsgKCpubiktPmNvdW50ID09IE5PREVDQVJEICsgMQBMb2FkTm9kZXMAcQBwAHJ0cC0+c3BsaXQuUGFydGl0aW9uc1swXS5wYXJ0aXRpb25baV0gPT0gMCB8fCBydHAtPnNwbGl0LlBhcnRpdGlvbnNbMF0ucGFydGl0aW9uW2ldID09IDEAcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzBdICsgcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzFdID09IE5PREVDQVJEICsgMQBNZXRob2RaZXJvAHJ0cC0+c3BsaXQuUGFydGl0aW9uc1swXS5jb3VudFswXSA+PSBydHAtPk1pbkZpbGwgJiYgcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzFdID49IHJ0cC0+TWluRmlsbAAhcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLnRha2VuW2ldAENsYXNzaWZ5AEdldEJyYW5jaGVzAG4tPmJyYW5jaFtpXS5jaGlsZAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKAICAgICAhAMWQEAH1AIAwcSExRXFhcIC2kMHwoFDA4pESsPLRAvMCAyBjQ1GxwdHgsMISIjJCUmJygMGBkXBAobHBogKgohIiMkJSYnKAwKDlMKLFgxWFhYWFhYDBscDy5YMyEiIyQlJicoGxz/U///ISIjJCUmJygM//8F////CRT//////wwbHP8QFRYhIiMkJSYnKBsc/////yEiIyQlJicoDP8SExQRFhf///////8MGxz///8SISIjJCUmJygbHP////8hIiMkJSYnKAz///////8T////////DBsc/////yEiIyQlJicoGxz/////ISIjJCUmJygSExQVFhcYGf///////////yMkJSYnGxITFBYXIjZoAR84ViEgAhsbG14bGzc5cDbSwk8EPCJHIj8iRCIiWCJlIiIFBl9gOQQHCAkKCwwNDgRmZ11qbQUGb1g7cQcICQoLDA0OBHI8W3M+YUYbEhMUFhcEBQY/QWJJBwgJCgsMDQ4FBgBcAAAHCAkKCwwNDgQAAE8AAABTQgAAAAAABAUGAERUVQcICQoLDA0OBQYAAAAABwgJCgsMDQ4EACosLkcxMwAAAAAAAAQFBgAAAEoHCAkKCwwNDgUGAAAAAAcICQoLDA0OBAAAAAAAAEwAAAAAAAAEBQYAAAAABwgJCgsMDQ4FBgAAAAAHCAkKCwwNDikrLS8wMjQ1AAAAAAAAAAAAKSstMDIABC8AJCMAEhQWGhweIBgABQcvLy8ALy8AAAkIKAAAASICBgAAAAAACAAAAAAAAAAAAAAAAAAlAyYTCikVCyoXDi0ZERsMKx0NLB8PIRAAMwAwAC9DADEALwA1LidCMkEAOjgAPDRFADYAQAAAPwBENzs5PQACAwMBAQIBAQEDAwMDAwMDAwEBAQEBAQEBAQEBAQEBAQECAQECAAYBAwMDAwMBAAECAwAEAQIDAAQABAAEAAMCAQIBAgFTeW50YXggZXJyb3I6IG5vbi1zcGFjZSBzdHJpbmcgdXNlZCBiZWZvcmUgPFRBQkxFPgBTeW50YXggZXJyb3I6IG5vbi1zcGFjZSBzdHJpbmcgdXNlZCBhZnRlciA8L1RBQkxFPgAAKSoqKissLC0tLS0tLS0tLS0uLzAxMjM0NTY3ODk6Ozw9Pj4/P0FAQkJCQkJCQ0NERERGRUdHR0lISkhLSExITU1OTk9P/wMPEBEjOiQ9JUAVQyZFJ0gYSxlNGigcTh0eUFFSWVpsa25jZFdpbWVtb3J5IGV4aGF1c3RlZAAlcyBpbiBsaW5lICVkIAoALi4uICVzIC4uLgoAVEFCTEUAVFIAVEgAVEQASFRNTABGT05UAEIAVQBPAEkAU1VQAFNVQgBTAEJSAEhSAFZSAElNRwBVbmtub3duIEhUTUwgZWxlbWVudCA8JXM+IG9uIGxpbmUgJWQgCgA8SU1HPgBJbGxlZ2FsIGF0dHJpYnV0ZSAlcyBpbiAlcyAtIGlnbm9yZWQKAHNjYWxlAHNyYwA8QlI+AGFsaWduAElHSFQARUZUAEVOVEVSAElsbGVnYWwgdmFsdWUgJXMgZm9yIEFMSUdOIC0gaWdub3JlZAoAPEZPTlQ+AGNvbG9yAGZhY2UAcG9pbnQtc2l6ZQBQT0lOVC1TSVpFAEltcHJvcGVyICVzIHZhbHVlICVzIC0gaWdub3JlZAAlcyB2YWx1ZSAlcyA+ICVkIC0gdG9vIGxhcmdlIC0gaWdub3JlZAAlcyB2YWx1ZSAlcyA8ICVkIC0gdG9vIHNtYWxsIC0gaWdub3JlZAA8VEQ+AGJhbGlnbgBiZ2NvbG9yAGJvcmRlcgBjZWxscGFkZGluZwBjZWxsc3BhY2luZwBjb2xzcGFuAGZpeGVkc2l6ZQBncmFkaWVudGFuZ2xlAGhlaWdodABocmVmAGlkAHBvcnQAcm93c3BhbgBzaWRlcwBzdHlsZQB0YXJnZXQAdGl0bGUAdG9vbHRpcAB2YWxpZ24Ad2lkdGgAV0lEVEgAT1RUT00AT1AASURETEUASWxsZWdhbCB2YWx1ZSAlcyBmb3IgVkFMSUdOIC0gaWdub3JlZAoAICwAT1VOREVEAEFESUFMAElsbGVnYWwgdmFsdWUgJXMgZm9yIFNUWUxFIC0gaWdub3JlZAoAU09MSUQASU5WSVNJQkxFAElOVklTAERPVFRFRABEQVNIRUQAVW5yZWNvZ25pemVkIGNoYXJhY3RlciAnJWMnICglZCkgaW4gc2lkZXMgYXR0cmlidXRlCgBST1dTUEFOAFJPV1NQQU4gdmFsdWUgY2Fubm90IGJlIDAgLSBpZ25vcmVkCgBIRUlHSFQAR1JBRElFTlRBTkdMRQBSVUUAQUxTRQBJbGxlZ2FsIHZhbHVlICVzIGZvciBGSVhFRFNJWkUgLSBpZ25vcmVkCgBDT0xTUEFOAENPTFNQQU4gdmFsdWUgY2Fubm90IGJlIDAgLSBpZ25vcmVkCgBDRUxMU1BBQ0lORwBDRUxMUEFERElORwBCT1JERVIASWxsZWdhbCB2YWx1ZSAlcyBmb3IgQkFMSUdOIGluIFREIC0gaWdub3JlZAoARVhUAElsbGVnYWwgdmFsdWUgJXMgZm9yIEFMSUdOIGluIFREIC0gaWdub3JlZAoAPFRBQkxFPgBjZWxsYm9yZGVyAGNvbHVtbnMAcm93cwBVbmtub3duIHZhbHVlICVzIGZvciBST1dTIC0gaWdub3JlZAoAVW5rbm93biB2YWx1ZSAlcyBmb3IgQ09MVU1OUyAtIGlnbm9yZWQKAENFTExTQk9SREVSADxIVE1MPgA8L0hUTUw+AC0tAExhYmVsIGNsb3NlZCBiZWZvcmUgZW5kIG9mIEhUTUwgZWxlbWVudAoAVW5jbG9zZWQgY29tbWVudAoAaiA9PSAwAGN2dC5jAFBvYnNwYXRoAHJvdXRlLmMAbGlicGF0aC8lczolZDogJXMKAHNob3J0ZXN0LmMAc291cmNlIHBvaW50IG5vdCBpbiBhbnkgdHJpYW5nbGUAZGVzdGluYXRpb24gcG9pbnQgbm90IGluIGFueSB0cmlhbmdsZQBjYW5ub3QgZmluZCB0cmlhbmdsZSBwYXRoAGNhbm5vdCBtYWxsb2Mgb3BzAGNhbm5vdCByZWFsbG9jIG9wcwB0cmlhbmd1bGF0aW9uIGZhaWxlZABjYW5ub3QgbWFsbG9jIHRyaXMAY2Fubm90IHJlYWxsb2MgdHJpcwBjYW5ub3QgbWFsbG9jIGRxLnBubHMAY2Fubm90IHJlYWxsb2MgZHEucG5scwBjYW5ub3QgbWFsbG9jIHBubHMAY2Fubm90IG1hbGxvYyBwbmxwcwBjYW5ub3QgcmVhbGxvYyBwbmxzAGNhbm5vdCByZWFsbG9jIHBubHBzAENEQVRBAElEAElEUkVGAElEUkVGUwBFTlRJVFkARU5USVRJRVMATk1UT0tFTgBOTVRPS0VOUwBOT1RBVElPTigAKAB8AGh0dHA6Ly93d3cudzMub3JnL1hNTC8xOTk4L25hbWVzcGFjZQBodHRwOi8vd3d3LnczLm9yZy8yMDAwL3htbG5zLwB4bWw9aHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlAC9kZXYvdXJhbmRvbQBmYWxsYmFjayg0KQBnZXR0aW1lb2ZkYXlfcmVzID09IDAAeG1scGFyc2UuYwBnYXRoZXJfdGltZV9lbnRyb3B5AEVYUEFUX0VOVFJPUFlfREVCVUcAMQBFbnRyb3B5OiAlcyAtLT4gMHglMCpseCAoJWx1IGJ5dGVzKQoAaW52YWxpZCBhcmd1bWVudABwcmVmaXggbXVzdCBub3QgYmUgYm91bmQgdG8gb25lIG9mIHRoZSByZXNlcnZlZCBuYW1lc3BhY2UgbmFtZXMAcmVzZXJ2ZWQgcHJlZml4ICh4bWxucykgbXVzdCBub3QgYmUgZGVjbGFyZWQgb3IgdW5kZWNsYXJlZAByZXNlcnZlZCBwcmVmaXggKHhtbCkgbXVzdCBub3QgYmUgdW5kZWNsYXJlZCBvciBib3VuZCB0byBhbm90aGVyIG5hbWVzcGFjZSBuYW1lAGNhbm5vdCBzdXNwZW5kIGluIGV4dGVybmFsIHBhcmFtZXRlciBlbnRpdHkAcGFyc2luZyBmaW5pc2hlZABwYXJzaW5nIGFib3J0ZWQAcGFyc2VyIG5vdCBzdXNwZW5kZWQAcGFyc2VyIHN1c3BlbmRlZABpbGxlZ2FsIGNoYXJhY3RlcihzKSBpbiBwdWJsaWMgaWQAdGV4dCBkZWNsYXJhdGlvbiBub3Qgd2VsbC1mb3JtZWQAWE1MIGRlY2xhcmF0aW9uIG5vdCB3ZWxsLWZvcm1lZABpbmNvbXBsZXRlIG1hcmt1cCBpbiBwYXJhbWV0ZXIgZW50aXR5AG11c3Qgbm90IHVuZGVjbGFyZSBwcmVmaXgAdW5ib3VuZCBwcmVmaXgAY2Fubm90IGNoYW5nZSBzZXR0aW5nIG9uY2UgcGFyc2luZyBoYXMgYmVndW4AcmVxdWVzdGVkIGZlYXR1cmUgcmVxdWlyZXMgWE1MX0RURCBzdXBwb3J0IGluIEV4cGF0AGVudGl0eSBkZWNsYXJlZCBpbiBwYXJhbWV0ZXIgZW50aXR5AHVuZXhwZWN0ZWQgcGFyc2VyIHN0YXRlIC0gcGxlYXNlIHNlbmQgYSBidWcgcmVwb3J0AGRvY3VtZW50IGlzIG5vdCBzdGFuZGFsb25lAGVycm9yIGluIHByb2Nlc3NpbmcgZXh0ZXJuYWwgZW50aXR5IHJlZmVyZW5jZQB1bmNsb3NlZCBDREFUQSBzZWN0aW9uAGVuY29kaW5nIHNwZWNpZmllZCBpbiBYTUwgZGVjbGFyYXRpb24gaXMgaW5jb3JyZWN0AHVua25vd24gZW5jb2RpbmcAWE1MIG9yIHRleHQgZGVjbGFyYXRpb24gbm90IGF0IHN0YXJ0IG9mIGVudGl0eQByZWZlcmVuY2UgdG8gZXh0ZXJuYWwgZW50aXR5IGluIGF0dHJpYnV0ZQByZWZlcmVuY2UgdG8gYmluYXJ5IGVudGl0eQByZWZlcmVuY2UgdG8gaW52YWxpZCBjaGFyYWN0ZXIgbnVtYmVyAGFzeW5jaHJvbm91cyBlbnRpdHkAcmVjdXJzaXZlIGVudGl0eSByZWZlcmVuY2UAdW5kZWZpbmVkIGVudGl0eQBpbGxlZ2FsIHBhcmFtZXRlciBlbnRpdHkgcmVmZXJlbmNlAGp1bmsgYWZ0ZXIgZG9jdW1lbnQgZWxlbWVudABkdXBsaWNhdGUgYXR0cmlidXRlAG1pc21hdGNoZWQgdGFnAHBhcnRpYWwgY2hhcmFjdGVyAHVuY2xvc2VkIHRva2VuAG5vdCB3ZWxsLWZvcm1lZCAoaW52YWxpZCB0b2tlbikAbm8gZWxlbWVudCBmb3VuZABzeW50YXggZXJyb3IAb3V0IG9mIG1lbW9yeQACAwQFBgcIAAAJCgsMDQ4PEBEAAAAAAAAAAAAAAAASEwAUAAAAAAAAAAAAAAAAAAAVFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEXAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBARgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQMaGxwdHgAAHyAhIiMkJRARAAAAAAAAAAAAAAAAEhMmFAAAAAAAAAAAAAAAAAAAJxYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBFwAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENEQVRBW1VTLUFTQ0lJAFVURi0xNgBVVEYtMTZCRQBVVEYtMTZMRQB2ZXJzaW9uAGVuY29kaW5nAHN0YW5kYWxvbmUARE9DVFlQRQBTWVNURU0AUFVCTElDAEVOVElUWQBBVFRMSVNUAEVMRU1FTlQATk9UQVRJT04ASU5DTFVERQBJR05PUkUARU1QVFkAQU5ZAFBDREFUQQBJTVBMSUVEAFJFUVVJUkVEAEZJWEVEAENEQVRBAElEAElEUkVGAElEUkVGUwBFTlRJVElFUwBOTVRPS0VOAE5NVE9LRU5TAE5EQVRBAFQhIhkNAQIDEUscDBAECx0SHidobm9wcWIgBQYPExQVGggWBygkFxgJCg4bHyUjg4J9JiorPD0+P0NHSk1YWVpbXF1eX2BhY2RlZmdpamtscnN0eXp7fABJbGxlZ2FsIGJ5dGUgc2VxdWVuY2UARG9tYWluIGVycm9yAFJlc3VsdCBub3QgcmVwcmVzZW50YWJsZQBOb3QgYSB0dHkAUGVybWlzc2lvbiBkZW5pZWQAT3BlcmF0aW9uIG5vdCBwZXJtaXR0ZWQATm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeQBObyBzdWNoIHByb2Nlc3MARmlsZSBleGlzdHMAVmFsdWUgdG9vIGxhcmdlIGZvciBkYXRhIHR5cGUATm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UAT3V0IG9mIG1lbW9yeQBSZXNvdXJjZSBidXN5AEludGVycnVwdGVkIHN5c3RlbSBjYWxsAFJlc291cmNlIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlAEludmFsaWQgc2VlawBDcm9zcy1kZXZpY2UgbGluawBSZWFkLW9ubHkgZmlsZSBzeXN0ZW0ARGlyZWN0b3J5IG5vdCBlbXB0eQBDb25uZWN0aW9uIHJlc2V0IGJ5IHBlZXIAT3BlcmF0aW9uIHRpbWVkIG91dABDb25uZWN0aW9uIHJlZnVzZWQASG9zdCBpcyBkb3duAEhvc3QgaXMgdW5yZWFjaGFibGUAQWRkcmVzcyBpbiB1c2UAQnJva2VuIHBpcGUASS9PIGVycm9yAE5vIHN1Y2ggZGV2aWNlIG9yIGFkZHJlc3MAQmxvY2sgZGV2aWNlIHJlcXVpcmVkAE5vIHN1Y2ggZGV2aWNlAE5vdCBhIGRpcmVjdG9yeQBJcyBhIGRpcmVjdG9yeQBUZXh0IGZpbGUgYnVzeQBFeGVjIGZvcm1hdCBlcnJvcgBJbnZhbGlkIGFyZ3VtZW50AEFyZ3VtZW50IGxpc3QgdG9vIGxvbmcAU3ltYm9saWMgbGluayBsb29wAEZpbGVuYW1lIHRvbyBsb25nAFRvbyBtYW55IG9wZW4gZmlsZXMgaW4gc3lzdGVtAE5vIGZpbGUgZGVzY3JpcHRvcnMgYXZhaWxhYmxlAEJhZCBmaWxlIGRlc2NyaXB0b3IATm8gY2hpbGQgcHJvY2VzcwBCYWQgYWRkcmVzcwBGaWxlIHRvbyBsYXJnZQBUb28gbWFueSBsaW5rcwBObyBsb2NrcyBhdmFpbGFibGUAUmVzb3VyY2UgZGVhZGxvY2sgd291bGQgb2NjdXIAU3RhdGUgbm90IHJlY292ZXJhYmxlAFByZXZpb3VzIG93bmVyIGRpZWQAT3BlcmF0aW9uIGNhbmNlbGVkAEZ1bmN0aW9uIG5vdCBpbXBsZW1lbnRlZABObyBtZXNzYWdlIG9mIGRlc2lyZWQgdHlwZQBJZGVudGlmaWVyIHJlbW92ZWQARGV2aWNlIG5vdCBhIHN0cmVhbQBObyBkYXRhIGF2YWlsYWJsZQBEZXZpY2UgdGltZW91dABPdXQgb2Ygc3RyZWFtcyByZXNvdXJjZXMATGluayBoYXMgYmVlbiBzZXZlcmVkAFByb3RvY29sIGVycm9yAEJhZCBtZXNzYWdlAEZpbGUgZGVzY3JpcHRvciBpbiBiYWQgc3RhdGUATm90IGEgc29ja2V0AERlc3RpbmF0aW9uIGFkZHJlc3MgcmVxdWlyZWQATWVzc2FnZSB0b28gbGFyZ2UAUHJvdG9jb2wgd3JvbmcgdHlwZSBmb3Igc29ja2V0AFByb3RvY29sIG5vdCBhdmFpbGFibGUAUHJvdG9jb2wgbm90IHN1cHBvcnRlZABTb2NrZXQgdHlwZSBub3Qgc3VwcG9ydGVkAE5vdCBzdXBwb3J0ZWQAUHJvdG9jb2wgZmFtaWx5IG5vdCBzdXBwb3J0ZWQAQWRkcmVzcyBmYW1pbHkgbm90IHN1cHBvcnRlZCBieSBwcm90b2NvbABBZGRyZXNzIG5vdCBhdmFpbGFibGUATmV0d29yayBpcyBkb3duAE5ldHdvcmsgdW5yZWFjaGFibGUAQ29ubmVjdGlvbiByZXNldCBieSBuZXR3b3JrAENvbm5lY3Rpb24gYWJvcnRlZABObyBidWZmZXIgc3BhY2UgYXZhaWxhYmxlAFNvY2tldCBpcyBjb25uZWN0ZWQAU29ja2V0IG5vdCBjb25uZWN0ZWQAQ2Fubm90IHNlbmQgYWZ0ZXIgc29ja2V0IHNodXRkb3duAE9wZXJhdGlvbiBhbHJlYWR5IGluIHByb2dyZXNzAE9wZXJhdGlvbiBpbiBwcm9ncmVzcwBTdGFsZSBmaWxlIGhhbmRsZQBSZW1vdGUgSS9PIGVycm9yAFF1b3RhIGV4Y2VlZGVkAE5vIG1lZGl1bSBmb3VuZABXcm9uZyBtZWRpdW0gdHlwZQBObyBlcnJvciBpbmZvcm1hdGlvbgAAEhATFBUWFxgZGhscHR4fICEQECIjECQlJicoKSorECwtLhEvMBERMRERETIzNDU2Nzg5ERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA6EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA7EDw9Pj9AQRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBCEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBDEBBEEEVGRxBIEEkQEBAQSktMTRAQThBPUBAQEBBREBAQEBAQEBAQEBAQEFIQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFMQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBUVVZXEBBYWRAQEBAQEBAQEBAQEBAQEBAQEBAQEBBaEFtcXV5fYGFiEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////AAAAAP7/APwBAAD4AQAAeAAAAAD/+9/7AACAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8APz/4K//////////////3///////IECwAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAPwDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAAAAIb+////AEBJAAAAAAAYAN//AMgAAAAAAAAAAQA8AAAAAAAAAAAAAAAAEOABHgBg/78AAAAAAAD/BwAAAAAAAAAAAAAAAAAAAAAAAAD4zwMAAAADACD/fwAAAE4AAAAAAAAAAAAAAAAAAAAAAPwAAAAAAAAAAAAQACAeADAAAQAAAAAAAAAAEAAgAAAAAPwPAAAAAAAAABAAIAAAAAAAAAAAAAAAAAAQACAAAAAAAwAAAAAAAAAAEAAgAAAAAP0AAAAAAAAAAAAAIAAAAAD/BwAAAAAAAAAAACAAAAAAAP8AAAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAIAAAAAA/AgAAAAAAAAAAAAQAAAAAEAAAAAAAAIAAgMDfAAwAAAAAAAAAAAAAAAAAHwAAAAAAAP7///8A/P//AAAAAAAAAAD8AAAAAAAAwP/f/wcAAAAAAAAAAAAAgAYA/AAAGD4AAIC/AMwAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAGD///8fAAD/AwAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAEAABgAAAAAAAAAAAA4AAAAABAAAABwAAAAAAAAAAAAAAAAAAAAMAAA/n8vAAD/A/9/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4xAAAAAAAAAAAAAAAAAAAAAAAAxP////8AAADAAAAAAAAAAAABAOCfAAAAAH8/AAAAAAAAAAAAAAAAAAAAABAAEAAA/P///x8AAAAAAAwAAAAAAABAAAzwAAAAAAAAwPgAAAAAAAAAwAAAAAAAAAAA/wD///8hEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////fwAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAPgAOAA4ABggPj////8//////9/H/zxf/9/AAD///8DAAD/////AQB7A9DBr0IADB+8//8AAAAAAAL//////////////////////////////////////////////////////////w8A/////38AAAD/BwAA/////////////z8AAAAAAAD8///+/////////////////////////////////////////////////////x//AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCHA/4AAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAP//////f/8PAAAAAAAAAAD////7/////////////w8A//////////////////////////////////8/AAAA/w8e////AfzB4AAAAAAAAAAAAAAAHgEAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAP////8PAAAA////f////////////////////////////////////38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAP///////38AAAAAAADAAOAAAAAAAAAAAAAAAIAPcAAAAAAAAAAAAAAAAAAA/wD//38AAwAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAEQIAAAAD/8DAAAAAAAA8AAAAAAAAAAAABDAAAD//wMHAAAAAAD4AAAAAAiAAAAAAAAAAAAAAAgA/z8AwAAAAAAAAAAAAAAAAAAAAPAAAIALAAAAAAAAAIACAADAAABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAgAAAAAAAAAAAAAAAAAAAAD8/wMAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD///8DfwD/////9/9/DwAAAAAAAAAAAAAAAAAAAAAAgP7/APwBAAD4AQAA+D8AAAAAAAAAAAAAAAAAAAB/fwAwh///////j/8AAAAAAADg//8H/w8AAAAAAAD//////z8AAAAADwAAAAAAAAAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAAAAAAAAAACA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAADAjwAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAh/8A/wEAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+AAAA/wAAAP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////fwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMA//P8/AAAAAwAAAAAAAP4DAAAAAAAAAAAAAAAAABgADwAAAAAAAAAAAAAAAAAAAOEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAcAAAAAAAAAAAAAAAAA////////////////////////////////////////PwD/////f/7///////////////////////////8/AAAAAP//////////PwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////38A//8DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAIAAAACAAAIAAAACAAAIAAAACAAAAAAgAAAAIAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwD//////w////////////////8PAP9//n/+//7/AAAAAP8H////f/////////8P//////8HAAAAAAAAAADA////BwD//////wf/AQMAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AQC///////////8f//8PAP/////fBwAA//8BAP////////9//f////////////////////////////8e/////////z8PAP///wAAAAAAAAAAAAAAAAAAAAAAAPj//////////+H/AAAAAAAA//////////8/AAAAAAAAAP//////////////////DwAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAQIEBwMGBQASERMUFRYXGBkaGxwdHh8gIREiIyQRJSYnKCkqKywRLS4vEBAwEBAQEBAQEDEyMxA0NRAQERERERERERERERERERERERERERERERERETYRERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERE3ERERETgROTo7PD0+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERET8QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBARQEERQkNERUZHSEkQEBBKS0xNThAQEE9QEBAQEFEQEBAQEBAQEBARERFSUxAQEBAQEBAQEBAQEREREVQQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAREVUQEBAQVhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBXEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBYWVpbEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFwQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAAAP7//wf+//8HAAAAAAAEIAT//3////9//////////////////////////////////8P/AwAfUAAAAAAAAAAAAAAgAAAAAADfPEDX///7////////////v///////////////////////A/z/////////////////////////AP7///9/Av7/////AAAAAAD/v7YA////BwcAAAD/B//////////+/8P////////////////vH/7h/58AAP///////wDg////////////////AwD//////wcwBP////z/HwAA////AQAAAAAAAAAA/R8AAAAAAADwA/9//////////+//3+H/z//+/u6f+f///cXjn1mAsM//AwDuh/n///1tw4cZAl7A/z8A7r/7///97eO/GwEAz/8AAO6f+f///e3jnxnAsM//AgDsxz3WGMf/w8cdgQDA/wAA7t/9///97+PfHWADz/8AAOzf/f///e/j3x1gQM//BgDs3/3/////599dgADP/wD87P9//P//+y9/gF//AAAMAP7/////f/8HPyD/AwAAAACWJfD+ruz/O18g//MAAAAAAQAAAP8DAAD//v///x/+/wP///7///8fAAAAAAAAAAD///////9/+f8D///nwf//f0D/M/////+/IP//////9////////////z1/Pf//////Pf////89fz3/f/////////89//////////+HAAAAAP//AAD/////////////HwD+//////////////////////////////////////////////////////////+f///+//8H////////////xwEA/98PAP//DwD//w8A/98NAP///////8///wGAEP8DAAAAAP8D//////////////8A//////8H//////////8/AP///x//D/8BwP////8/HwD//////w////8D/wMAAAAA////D/////////9//v8fAP8D/wOAAAAAAAAAAAAAAAD////////v/+8P/wMAAAAA///////z////////v/8DAP///////z8A/+P//////z8AAAAAAAAAAAAAAAAA3m8A////////////////////////////////AAAAAAAAAAD//z8//////z8//6r///8/////////31/cH88P/x/cHwAAAAAAAAAAAAAAAAAAAoAAAP8fAAAAAAAAAAAAAAAAhPwvPlC9//PgQwAA//////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwP///////wMAAP//////f///////f/////////////////////8feAwA/////78g/////////4AAAP//fwB/f39/f39/f/////8AAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAD+Az4f/v///////////3/g/v/////////////34P////8//v////////////9/AAD///8HAAAAAAAA////////////////////////////////PwAAAAAAAAAAAP////////////////////////////////8fAAAAAAAA//////////////////////8fAAAAAAAAAAD//////z//H////w8AAP//////f/CP////gP////////////8AAAAAgP/8////////////////eQ8A/wcAAAAAAAAAAAD/u/f///8AAAD///////8PAP//////////DwD/AwAA/Aj//////wf/////BwD///8f////////9/8AgP8DAAAAAP///////38A/z//A///fwT/////////fwUAADj//zwAfn5+AH9/AAAAAAAAAAAAAAAAAAAAAAAA//////8H/wP//////////////////////////w8A//9/+P//////D/////////////////8//////////////////wMAAAAAfwD44P/9f1/b/////////////////wMAAAD4////////////////PwAA///////////8////////AAAAAAD/DwAAAAAAAAAAAAAAAAAA3/////////////////////8fAAD/A/7//wf+//8HwP////////////9//Pz8HAAAAAD/7///f///t/8//z8AAAAA////////////////////BwAAAAAAAAAA////////HwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///x////////8BAAAAAAD///9/AAD///8HAAAAAAAA////P/////8P/z4AAAAAAP////////////////////////8//wMAAAAAAAAAAAAAP/3/////v5H//z8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//z8A////AwAAAAAAAAAA/////////8AAAAAAAAAAAG/w7/7//w8AAAAAAP///x8AAAAAAAAAAAAAAAAAAAAA////////PwD//z8A//8HAAAAAAAAAAAAAAAAAAAAAAD///////////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////PwAAAMD/AAD8////////AQAA////Af8D////////x/8AAAAAAAAAAP//////////HgD/AwAAAAAAAAAAAAAAAAAAAAAAAAAA////////PwD/AwAAAAAAAP////////////////9/AAAAAAAAAAAAAAAAAAAAAAAA////////////////BwAAAAAAAAAAAAAAAAAAAAAAAAD//////38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8fAP//////fwAA+P8AAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////f///////////fZN7/6+//////////v+ff3////3tf/P3//////////////////////////////////////////////////////z/////9///3////9///3////9///3////9//////f////3///fP////////7////5b+9wqE6paqlvf3Xv/7/w/u+/8PAAAAAAAAAABMQ19BTEwATENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVMATEFORwBDLlVURi04AFBPU0lYAE1VU0xfTE9DUEFUSAARAAoAERERAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABEADwoREREDCgcAARMJCwsAAAkGCwAACwAGEQAAABEREQAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA0AAAAEDQAAAAAJDgAAAAAADgAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABISEgAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAoAAAAACgAAAAAJCwAAAAAACwAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAwAAAAACQwAAAAAAAwAAAwAAC0rICAgMFgweAAobnVsbCkALTBYKzBYIDBYLTB4KzB4IDB4AGluZgBJTkYATkFOADAxMjM0NTY3ODlBQkNERUYuAGFsbnVtAGFscGhhAGJsYW5rAGNudHJsAGRpZ2l0AGdyYXBoAGxvd2VyAHByaW50AHB1bmN0AHNwYWNlAHVwcGVyAHhkaWdpdABDLlVURi04AAAAAAAAAAAAQwAvcHJvYy9zZWxmL2ZkLwByd2EAaW5maW5pdHkAbmFuAAkACgANAAwABwAbAFtbOmFsbnVtOl1fXQBbXls6YWxudW06XV9dAFtbOnNwYWNlOl1dAFteWzpzcGFjZTpdXQBbWzpkaWdpdDpdXQBbXls6ZGlnaXQ6XV0AL3RtcC90bXBmaWxlX1hYWFhYWAB3Kw==";var tempDoublePtr=STATICTOP;STATICTOP+=16;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]);}function _emscripten_get_now(){abort();}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now();}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now();}else {___setErrNo(ERRNO_CODES.EINVAL);return -1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function ___clock_gettime(){return _clock_gettime.apply(null,arguments)}function ___lock(){}function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);return -1}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return !!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path=".";}if(path&&trailingSlash){path+="/";}return (isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return "."}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir}),basename:(function(path){if(path==="/")return "/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return ""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/";}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return !!p})),!resolvedAbsolute).join("/");return (resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return [];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8");}else {result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null}tty.input=intArrayFromString(result,true);}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[];}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[];}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={};}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null;}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream;}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream;}node.timestamp=Date.now();if(parent){parent.contents[name]=node;}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length;}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else {for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++;}}));var remove=[];Object.keys(dst.entries).forEach((function(key){dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++;}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault();});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done);}));}else {IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done);}));}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done);}else {IDBFS.removeRemoteEntry(store,path,done);}}));})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"];}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]};}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2;}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent;}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k;}}if(!flags){return newFlags}else {throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096;}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0;}return {dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode;}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date);}if(attr.size!==undefined){fs.truncateSync(path,attr.size);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode);}else {fs.writeFileSync(path,"",{mode:node.mode});}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags));}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position;}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size;}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position;}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size;}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return {path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key];}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return !!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return {path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent;}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else {var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next;}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return (this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode;})},write:{get:(function(){return (this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode;})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}});}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node);}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return !!node.mounted}),isFile:(function(mode){return (mode&61440)===32768}),isDir:(function(mode){return (mode&61440)===16384}),isLink:(function(mode){return (mode&61440)===40960}),isChrdev:(function(mode){return (mode&61440)===8192}),isBlkdev:(function(mode){return (mode&61440)===24576}),isFIFO:(function(mode){return (mode&61440)===4096}),isSocket:(function(mode){return (mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else {if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val;})},isRead:{get:(function(){return (this.flags&2097155)!==1})},isWrite:{get:(function(){return (this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}});}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p];}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null;}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream);}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops};}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts);}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done);}));}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current);}current=next;}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter;};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined");}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else {return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength();}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray};}else {var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)};}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags);}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return -ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return -ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return -ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return -ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0);})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();off<<=12;var ptr;var allocated=false;if(fd===-1){ptr=_memalign(PAGE_SIZE,len);if(!ptr)return -ERRNO_CODES.ENOMEM;_memset(ptr,0,len);allocated=true;}else {var info=FS.getStream(fd);if(!info)return -ERRNO_CODES.EBADF;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated;}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags};return ptr}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return -ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return -ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return -1;default:{return -ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return -ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op);}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc);}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);function ___unlock(){}function __exit(status){Module["exit"](status);}function _exit(status){__exit(status);}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=staticAlloc(TOTAL_ENV_SIZE);envPtr=staticAlloc(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr;}else {envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2];}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length;}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1;}HEAP32[envPtr+strings.length*ptrSize>>2]=0;}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}var _llvm_ceil_f64=Math_ceil;var _llvm_fabs_f32=Math_abs;var _llvm_fabs_f64=Math_abs;var _llvm_floor_f64=Math_floor;var _llvm_pow_f64=Math_pow;var _llvm_sqrt_f32=Math_sqrt;var _llvm_sqrt_f64=Math_sqrt;function _llvm_trap(){abort("trap!");}function _longjmp(env,value){Module["setThrew"](env,value||1);throw "longjmp"}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _setenv(envname,envval,overwrite){if(envname===0){___setErrNo(ERRNO_CODES.EINVAL);return -1}var name=Pointer_stringify(envname);var val=Pointer_stringify(envval);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return -1}if(ENV.hasOwnProperty(name)&&!overwrite)return 0;ENV[name]=val;___buildEnvironment(ENV);return 0}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret;}return ret}function _times(buffer){if(buffer!==0){_memset(buffer,0,16);}return 0}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6};}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow;}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()});}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()});}else {_emscripten_get_now=Date.now;}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();}));__ATMAIN__.push((function(){FS.ignorePermissions=false;}));__ATEXIT__.push((function(){FS.quit();}));__ATINIT__.unshift((function(){}));__ATEXIT__.push((function(){}));if(ENVIRONMENT_IS_NODE){var fs=require$$0__default$1["default"];var NODEJS_PATH=require$$1__default["default"];NODEFS.staticInit();}___buildEnvironment(ENV);DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");}chr&=255;}ret.push(String.fromCharCode(chr));}return ret.join("")}var decodeBase64=typeof atob==="function"?atob:(function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2);}if(enc4!==64){output=output+String.fromCharCode(chr3);}}while(i>2]=0;s=y;o=0;e=$(29,b|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;a:do if((g|0)!=1){o=0;v=$(23,e<<3|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){e=V6(c[f>>2]|0,w|0,x|0)|0;if(!e)bb(f|0,p|0);z=p;}else e=-1;if((e|0)!=1){if(!(a[194954]|0))t=0;else {o=0;e=_(3)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=0;k=0;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;break}t=e;}o=0;e=aa(97,b|0,110064)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[47323]=0;b:do if(e|0?(i=a[e>>0]|0,i<<24>>24):0){h=e;f=i;g=0;while(1){i=h+1|0;if(!(f<<24>>24))break b;switch(f<<24>>24|0){case 99:{e=8;u=16;break}case 105:{e=18;u=16;break}case 109:{e=1;u=16;break}case 114:{e=4;u=16;break}case 115:{e=2;u=16;break}default:e=g;}if((u|0)==16){u=0;e=g|e;c[47323]=e;}h=i;f=a[i>>0]|0;g=e;}}while(0);if(d|0){o=0;ca(20,0,110068,j|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){n=0;k=t;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;break}}o=0;r=aa(98,b|0,0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){m=c[r+16>>2]|0;if(c[47323]&2|0){o=0;ja(26,c[15712]|0,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break}}o=0;g=$(25,b|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){n=0;while(1){if(!g)break;o=0;e=aa(99,b|0,g|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}i=n;while(1){if(!e)break;if(!((c[47134]|0)==2?(c[(c[e+16>>2]|0)+8>>2]|0)!=0:0))u=32;c:do if((u|0)==32){u=0;do if(a[194954]|0){k=c[e>>2]&3;j=(c[c[((k|0)==3?e:e+48|0)+40>>2]>>2]|0)>>>4;k=(c[c[((k|0)==2?e:e+-48|0)+40>>2]>>2]|0)>>>4;if(j>>>0>k>>>0){o=0;f=ca(34,t|0,k|0,j|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){d=V6(c[h>>2]|0,w|0,x|0)|0;if(!d)bb(h|0,p|0);z=p;}else d=-1;if((d|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}if(f|0)break c;o=0;ka(64,t|0,k|0,j|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}break}else {o=0;f=ca(34,t|0,j|0,k|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){d=V6(c[h>>2]|0,w|0,x|0)|0;if(!d)bb(h|0,p|0);z=p;}else d=-1;if((d|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}if(f|0)break c;o=0;ka(64,t|0,j|0,k|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}break}}while(0);c[v+(i<<3)+4>>2]=e;o=0;d=$(30,e|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}c[v+(i<<3)>>2]=d;i=i+1|0;}while(0);o=0;e=aa(100,b|0,e|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}}o=0;g=aa(86,b|0,g|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}n=i;}o=0;j=$(31,n<<3|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){o=0;ma(28,v|0,n|0,8,101);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){g=c[m>>2]|0;o=0;ia(110,g+2|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){i=c[m+16>>2]|0;d=i+(g*40|0)|0;i=i+((g+1|0)*40|0)|0;q=c[15712]|0;h=0;while(1){if((h|0)>=(n|0))break;if((h|0)>0?c[47323]&16|0:0){o=0;ja(26,q|0,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}e=c[v+(h<<3)+4>>2]|0;k=c[e>>2]&3;g=c[(c[(c[((k|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;e=c[(c[(c[((k|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;if((g|0)==(e|0)){o=0;ma(29,m|0,g|0,i|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}else {o=0;ka(65,m|0,e|0,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}o=0;ka(65,m|0,g|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}o=0;e=ca(35,m|0,i|0,d|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}if(e|0){k=t;m=j;i=r;d=v;h=v;break a}e=j+(h<<3)|0;o=0;ma(30,s|0,m|0,d|0,i|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}g=s;k=c[g+4>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=k;o=0;ia(111,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}h=h+1|0;}o=0;ha(8);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){o=0;e=$(32,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[r+20>>2]=e;o=0;e=$(33,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[r+24>>2]=e;o=0;ka(66,n|0,j|0,r|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){w=U6(189296,1,w|0,x|0)|0;x=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){k=t;m=j;i=r;d=v;h=v;e=0;g=q;u=74;}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=0;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=0;u=74;}}else {k=t;m=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=0;m=0;j=0;i=0;d=0;h=v;e=z;g=0;u=74;}}else {n=0;k=0;m=0;j=0;i=0;d=0;h=0;e=z;g=0;u=74;}while(0);d:while(1){if((u|0)==74){u=0;if(e|0){q=g;continue}o=0;ia(112,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){A=g;f=h;q=d;r=i;s=j;t=m;v=k;u=n;e=z;g=A;h=f;d=q;i=r;j=s;m=t;k=v;n=u;u=74;continue}if(c[47323]&4|0){o=0;na(8,g|0,i|0,n|0,m|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=g;q=h;r=d;s=i;t=j;v=m;A=k;u=n;e=z;g=f;h=q;d=r;i=s;j=t;m=v;k=A;n=u;u=74;continue}}o=0;oa(10,b|0,i|0,n|0,m|0,d|0,0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=g;q=h;r=d;s=i;t=j;v=m;A=k;u=n;e=z;g=f;h=q;d=r;i=s;j=t;m=v;k=A;n=u;u=74;continue}q=g;}if(!(a[194954]|0))e=0;else {o=0;ia(113,k|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}e=0;}while(1){if((e|0)>=(n|0))break;o=0;ia(105,c[m+(e<<3)+4>>2]|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;g=q;u=74;continue d}e=e+1|0;}o=0;ia(105,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}o=0;ia(114,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}o=0;ia(105,h|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;}else break}U1(w|0);l=y;return}function sQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+64|0;p=q+32|0;o=q+16|0;j=q;k=q+48|0;T4(110935,a)|0;T4(110946,a)|0;m=b+16|0;n=j+8|0;i=k+4|0;g=0;while(1){if((g|0)>=(c[b>>2]|0))break;d=c[m>>2]|0;e=c[d+(g*40|0)+20>>2]|0;f=c[d+(g*40|0)+24>>2]|0;if((e|0)==(f|0)){lR(j,e);d=~~+h[j>>3];e=~~+h[n>>3];}else {nR(k,(c[e>>2]&1|0)==0?e:f,d+(g*40|0)|0);d=c[k>>2]|0;e=c[i>>2]|0;}c[o>>2]=g;c[o+4>>2]=d;c[o+8>>2]=e;w4(a,110966,o)|0;g=g+1|0;}f=b+4|0;e=b+20|0;d=0;while(1){if((d|0)>=(c[f>>2]|0))break;o=c[e>>2]|0;b=c[o+(d*24|0)+16>>2]|0;r=+h[o+(d*24|0)>>3];c[p>>2]=c[o+(d*24|0)+12>>2];c[p+4>>2]=b;h[p+8>>3]=r;w4(a,110986,p)|0;d=d+1|0;}T4(111008,a)|0;l=q;return}function tQ(a){a=a|0;var b=0.0,d=0.0,e=0,f=0;f=c[a>>2]&3;e=c[(c[((f|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0;a=c[(c[((f|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0;b=+h[e+16>>3]-+h[a+16>>3];d=+h[e+24>>3]-+h[a+24>>3];return ~~(d*d+b*b)|0}function uQ(a,b){a=a|0;b=b|0;return (c[a>>2]|0)-(c[b>>2]|0)|0}function vQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;j=n;lR(n+16|0,d);k=d+32|0;m=d+36|0;g=0;while(1){if((g|0)>=(c[k>>2]|0))break;h=c[(c[m>>2]|0)+(g<<2)>>2]|0;do if(!(a[h+36>>0]|0)){i=c[h+20>>2]|0;if((i|0)==(d|0)){jR(j,h,c[h+24>>2]|0);ER(b,f,h,0.0)|0;break}else {jR(j,h,i);ER(b,e,h,0.0)|0;break}}while(0);g=g+1|0;}c[b>>2]=(c[b>>2]|0)+2;l=n;return}function wQ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;h=k;lR(k+16|0,b);i=b+32|0;j=b+36|0;f=0;while(1){if((f|0)>=(c[i>>2]|0))break;g=c[(c[j>>2]|0)+(f<<2)>>2]|0;e=c[g+20>>2]|0;if((e|0)==(b|0))e=c[g+24>>2]|0;jR(h,g,e);ER(a,d,g,0.0)|0;f=f+1|0;}c[a>>2]=(c[a>>2]|0)+1;c[d+24>>2]=b;c[d+20>>2]=b;l=k;return}function xQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+128|0;C=H+64|0;n=H+48|0;D=H+32|0;E=H+16|0;F=H;g=0;i=e;while(1){if(!i)break;g=g+1|0;i=c[i+8>>2]|0;}B=JK((g*56|0)+-112|0)|0;c[C+52>>2]=0;c[C+48>>2]=0;A=e+8|0;e=c[A>>2]|0;i=c[e+8>>2]|0;g=c[e+20>>2]|0;if(c[g>>2]&1)g=c[e+24>>2]|0;jR(n,e,g);j=e;q=e;p=0.0;o=+h[n>>3];z=0;m=0.0;x=+h[n+8>>3];while(1){y=i+8|0;if(!(c[y>>2]|0))break;v=kR(j,i)|0;cV(d,v,c[q+12>>2]|0);t=q+36|0;u=i+36|0;if((a[t>>0]|0)==(a[u>>0]|0))if((c[y>>2]|0)==(f|0)){jR(E,i,v);e=E;G=12;}else {j=q;e=z;k=x;}else {lR(D,v);e=D;G=12;}if((G|0)==12){G=0;w=+h[e>>3];k=+h[e+8>>3];e=a[t>>0]|0;s=e<<24>>24==0;r=(q|0)==(c[A>>2]|0);if(s){if(!(a[u>>0]|0))e=0;else e=(c[i+20>>2]|0)==(v|0)?4:2;n=v+48|0;q=g+48|0;j=g+40|0;g=r?0:p>o?4:2;}else {if(e<<24>>24==(a[u>>0]|0))e=0;else e=(c[i+20>>2]|0)==(v|0)?1:3;n=v+40|0;q=g+40|0;j=g+48|0;g=r?0:m>x?1:3;}mR(C,s&1,+h[j>>3],+h[q>>3],+h[n>>3],g,e);q=z+1|0;g=B+(z*56|0)|0;e=C;j=g+56|0;do{c[g>>2]=c[e>>2];g=g+4|0;e=e+4|0;}while((g|0)<(j|0));if((a[t>>0]|0)!=(a[u>>0]|0)?(c[y>>2]|0)==(f|0):0){jR(F,i,v);n=(a[u>>0]|0)==0;e=v+40|0;g=v+48|0;p=+h[(n?g:e)>>3];mR(C,n&1,+h[(n?e:g)>>3],p,p,n?(o>w?4:2):x>k?1:3,0);n=z+2|0;g=B+(q*56|0)|0;e=C;j=g+56|0;do{c[g>>2]=c[e>>2];g=g+4|0;e=e+4|0;}while((g|0)<(j|0));g=v;j=i;p=o;o=w;e=n;m=x;}else {g=v;j=i;p=o;o=w;e=q;m=x;}}v=i;i=c[y>>2]|0;q=j;z=e;x=k;j=v;}i=W1(B,z*56|0)|0;e=z+-1|0;g=0;while(1){if((g|0)>=(z|0))break;if((g|0)>0)c[i+(g*56|0)+48>>2]=i+((g+-1|0)*56|0);if((g|0)<(e|0)){G=g+1|0;c[i+(g*56|0)+52>>2]=i+(G*56|0);g=G;continue}else {g=g+1|0;continue}}c[b>>2]=z;c[b+4>>2]=i;l=H;return}function yQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;j=Vz(25692,c[4581]|0)|0;k=a+8|0;i=0;while(1){if((i|0)>=(c[a>>2]|0))break;b=(c[k>>2]|0)+(i*72|0)|0;if(!(c[b>>2]&4)){while(1){d=c[(c[b+36>>2]|0)+8>>2]|0;if(!d)break;d=c[d+20>>2]|0;if(!d)break;if(!(c[d>>2]&1))b=d;else break}g=JK(40)|0;c[g+36>>2]=b;h[g+8>>3]=+h[b+40>>3];f=b;d=c[b>>2]|0;while(1){c[f>>2]=d|4;d=c[c[f+36>>2]>>2]|0;if(!d)break;e=c[d+24>>2]|0;if(!e)break;d=c[e>>2]|0;if(d&1|0)break;else f=e;}h[g+16>>3]=+h[f+56>>3];eR(j,g,+h[b+48>>3]);}i=i+1|0;}return j|0}function zQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;j=Vz(25692,c[4581]|0)|0;k=a+8|0;i=0;while(1){if((i|0)>=(c[a>>2]|0))break;b=(c[k>>2]|0)+(i*72|0)|0;if(!(c[b>>2]&2)){while(1){d=c[(c[b+36>>2]|0)+12>>2]|0;if(!d)break;d=c[d+20>>2]|0;if(!d)break;if(!(c[d>>2]&1))b=d;else break}g=JK(40)|0;c[g+36>>2]=b;h[g+8>>3]=+h[b+48>>3];f=b;d=c[b>>2]|0;while(1){c[f>>2]=d|2;d=c[(c[f+36>>2]|0)+4>>2]|0;if(!d)break;e=c[d+24>>2]|0;if(!e)break;d=c[e>>2]|0;if(d&1|0)break;else f=e;}h[g+16>>3]=+h[f+64>>3];eR(j,g,+h[b+40>>3]);}i=i+1|0;}return j|0}function AQ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=e+20|0;i=e+24|0;e=0;while(1){if((e|0)>=(b|0))break;g=c[d+(e<<3)>>2]|0;h=c[d+(e<<3)+4>>2]|0;f=0;while(1){if((f|0)>=(g|0))break;k=h+(f*56|0)|0;dR(JQ(c[((a[k>>0]|0)==0?j:i)>>2]|0,k)|0,k);f=f+1|0;}e=e+1|0;}return}function BQ(a){a=a|0;var b=0,d=0;d=a+20|0;LQ(c[d>>2]|0);b=a+24|0;LQ(c[b>>2]|0);MQ(c[d>>2]|0);MQ(c[b>>2]|0);NQ(c[d>>2]|0,a);NQ(c[b>>2]|0,a);OQ(c[d>>2]|0);OQ(c[b>>2]|0);return}function CQ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0,E=0.0;z=l;l=l+224|0;n=z+176|0;m=z+208|0;x=z+160|0;y=z+128|0;k=z+96|0;t=z+64|0;u=z;o=z+32|0;v=u+8|0;h[v>>3]=1797693134862315708145274.0e284;h[u>>3]=1797693134862315708145274.0e284;w=u+24|0;h[w>>3]=-1797693134862315708145274.0e284;p=u+16|0;h[p>>3]=-1797693134862315708145274.0e284;T4(110183,a)|0;c[n>>2]=10;c[n+4>>2]=10;w4(a,110589,n)|0;T4(138265,a)|0;i=b+4|0;j=b+12|0;q=t+8|0;r=t+16|0;s=t+24|0;g=0;while(1){if((g|0)>=(c[i>>2]|0))break;D=(c[j>>2]|0)+(g*72|0)+40|0;c[t>>2]=c[D>>2];c[t+4>>2]=c[D+4>>2];c[t+8>>2]=c[D+8>>2];c[t+12>>2]=c[D+12>>2];c[t+16>>2]=c[D+16>>2];c[t+20>>2]=c[D+20>>2];c[t+24>>2]=c[D+24>>2];c[t+28>>2]=c[D+28>>2];C=+h[q>>3];B=+h[r>>3];A=+h[s>>3];h[k>>3]=+h[t>>3];h[k+8>>3]=C;h[k+16>>3]=B;h[k+24>>3]=A;w4(a,138284,k)|0;g=g+1|0;}g=0;while(1){if((g|0)>=(d|0))break;D=c[f+(g<<3)+4>>2]|0;k=e+(g<<3)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[n>>2]=c[u>>2];c[n+4>>2]=c[u+4>>2];c[n+8>>2]=c[u+8>>2];c[n+12>>2]=c[u+12>>2];c[n+16>>2]=c[u+16>>2];c[n+20>>2]=c[u+20>>2];c[n+24>>2]=c[u+24>>2];c[n+28>>2]=c[u+28>>2];KQ(o,a,D,m,b,n);c[u>>2]=c[o>>2];c[u+4>>2]=c[o+4>>2];c[u+8>>2]=c[o+8>>2];c[u+12>>2]=c[o+12>>2];c[u+16>>2]=c[o+16>>2];c[u+20>>2]=c[o+20>>2];c[u+24>>2]=c[o+24>>2];c[u+28>>2]=c[o+28>>2];g=g+1|0;}T4(110606,a)|0;i=b+8|0;g=0;while(1){if((g|0)>=(c[b>>2]|0))break;D=(c[i>>2]|0)+(g*72|0)+40|0;c[t>>2]=c[D>>2];c[t+4>>2]=c[D+4>>2];c[t+8>>2]=c[D+8>>2];c[t+12>>2]=c[D+12>>2];c[t+16>>2]=c[D+16>>2];c[t+20>>2]=c[D+20>>2];c[t+24>>2]=c[D+24>>2];c[t+28>>2]=c[D+28>>2];E=+h[t>>3];A=+h[q>>3];B=+h[r>>3];C=+h[s>>3];h[y>>3]=E;h[y+8>>3]=A;h[y+16>>3]=B;h[y+24>>3]=C;w4(a,138321,y)|0;h[u>>3]=+h[(+h[u>>3]>3];h[v>>3]=+h[(+h[v>>3]>3];h[p>>3]=+h[(+h[p>>3]>B?u:t)+16>>3];h[w>>3]=+h[(+h[w>>3]>C?u:t)+24>>3];g=g+1|0;}v=~~(+h[v>>3]+10.0);y=~~(+h[p>>3]+10.0);D=~~(+h[w>>3]+10.0);c[x>>2]=~~(+h[u>>3]+10.0);c[x+4>>2]=v;c[x+8>>2]=y;c[x+12>>2]=D;w4(a,110631,x)|0;l=z;return}function DQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;N=l;l=l+112|0;F=N+88|0;E=N+72|0;M=N+32|0;I=N+16|0;J=N;K=N+56|0;L=N+40|0;G=c[15712]|0;w=(i|0)==0;x=J+8|0;y=I+8|0;v=0;m=0;n=0;o=0;p=0;i=0;while(1){if((v|0)>=(e|0))break;z=c[g+(v<<3)+4>>2]|0;A=z+48|0;u=(c[(c[((c[z>>2]&3|0)==3?z:A)+40>>2]|0)+16>>2]|0)+16|0;B=z+16|0;C=(c[B>>2]|0)+16|0;c[E>>2]=c[u>>2];c[E+4>>2]=c[u+4>>2];c[E+8>>2]=c[u+8>>2];c[E+12>>2]=c[u+12>>2];c[F>>2]=c[C>>2];c[F+4>>2]=c[C+4>>2];c[F+8>>2]=c[C+8>>2];c[F+12>>2]=c[C+12>>2];EQ(K,E,F);c[I>>2]=c[K>>2];c[I+4>>2]=c[K+4>>2];c[I+8>>2]=c[K+8>>2];c[I+12>>2]=c[K+12>>2];C=z+-48|0;u=(c[(c[((c[z>>2]&3|0)==2?z:C)+40>>2]|0)+16>>2]|0)+16|0;t=(c[B>>2]|0)+56|0;c[E>>2]=c[u>>2];c[E+4>>2]=c[u+4>>2];c[E+8>>2]=c[u+8>>2];c[E+12>>2]=c[u+12>>2];c[F>>2]=c[t>>2];c[F+4>>2]=c[t+4>>2];c[F+8>>2]=c[t+8>>2];c[F+12>>2]=c[t+12>>2];EQ(L,E,F);c[J>>2]=c[L>>2];c[J+4>>2]=c[L+4>>2];c[J+8>>2]=c[L+8>>2];c[J+12>>2]=c[L+12>>2];t=c[f+(v<<3)>>2]|0;u=c[f+(v<<3)+4>>2]|0;s=t*3|0;D=s+1|0;if((s|0)>=(n|0)){if(m|0)U1(i);p=KK(D<<4)|0;m=p;n=D;o=p;i=p;}if(!(a[u>>0]|0)){k=+(GQ(u,d)|0);j=+h[I>>3];}else {j=+FQ(u,d);k=+h[y>>3];}r=m+16|0;h[m+16>>3]=j;h[m+24>>3]=k;c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];r=1;q=u;s=2;while(1){if((r|0)>=(t|0))break;q=u+(r*56|0)|0;if(!(a[q>>0]|0))k=+(GQ(q,d)|0);else j=+FQ(q,d);O=m+(s+2<<4)|0;Q=m+(s+1<<4)|0;P=m+(s<<4)|0;h[P>>3]=j;h[m+(s<<4)+8>>3]=k;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];r=r+1|0;s=s+3|0;}if(!(a[q>>0]|0)){k=+(GQ(q,d)|0);j=+h[J>>3];}else {j=+FQ(q,d);k=+h[x>>3];}Q=m+(s<<4)|0;O=s+1|0;P=m+(O<<4)|0;h[P>>3]=j;h[m+(O<<4)+8>>3]=k;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];if(0>1);dO(z,c[((c[z>>2]&3|0)==2?z:C)+40>>2]|0,m,D,25680);if((!w?(H=c[(c[B>>2]|0)+96>>2]|0,H|0):0)?(a[H+81>>0]|0)==0:0){c[E>>2]=c[I>>2];c[E+4>>2]=c[I+4>>2];c[E+8>>2]=c[I+8>>2];c[E+12>>2]=c[I+12>>2];c[F>>2]=c[J>>2];c[F+4>>2]=c[J+4>>2];c[F+8>>2]=c[J+8>>2];c[F+12>>2]=c[J+12>>2];yO(b,z,E,F);}v=v+1|0;}U1(o);l=N;return}function EQ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]+ +h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]+ +h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function FQ(a,b){a=a|0;b=b|0;var d=0.0,e=0;b=JQ(c[b+24>>2]|0,a)|0;e=c[b+36>>2]|0;d=+h[e+40>>3];return +((+h[e+56>>3]-d)*(+(c[a+44>>2]|0)/+((c[b+24>>2]|0)+1|0))+d)}function GQ(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=JQ(c[b+20>>2]|0,a)|0;b=c[e+36>>2]|0;d=+h[b+48>>3];return ~~((1.0-+(c[a+44>>2]|0)/+((c[e+24>>2]|0)+1|0))*(+h[b+64>>3]-d)+d)|0}function HQ(a){a=a|0;return 0}function IQ(a){a=a|0;return 0}function JQ(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b+8|0,512)|0;if(!a)qa(110155,110161,423,110169);a=c[a+16>>2]|0;a=nb[c[a>>2]&63](a,b+16|0,512)|0;if(!a)qa(110180,110161,425,110169);else return a|0;return 0}function KQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0.0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0;z=l;l=l+32|0;y=z+16|0;u=z+8|0;m=z;j=c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;t=c[f+4>>2]|0;if(!(a[t>>0]|0)){k=+h[j+56>>3];s=+h[j+40>>3];j=GQ(t,g)|0;k=(s+k)*.5;}else {k=+h[j+64>>3];s=+h[j+48>>3];j=~~((s+k)*.5);k=+FQ(t,g);}A=~~k;p=+h[i>>3];r=+(A|0);p=p>3]=p;v=i+8|0;q=+h[v>>3];s=+(j|0);q=q>3]=q;w=i+16|0;k=+h[w>>3];r=k>r?k:r;h[w>>3]=r;x=i+24|0;k=+h[x>>3];s=k>s?k:s;h[x>>3]=s;c[m>>2]=A;c[m+4>>2]=j;w4(d,110682,m)|0;o=c[f>>2]|0;m=t;n=1;f=A;while(1){if((n|0)>=(o|0))break;m=t+(n*56|0)|0;if(!(a[m>>0]|0))j=GQ(m,g)|0;else f=~~+FQ(m,g);B=+(f|0);D=p>3]=D;k=+(j|0);C=q>3]=C;B=r>B?r:B;h[w>>3]=B;k=s>k?s:k;h[x>>3]=k;c[u>>2]=f;c[u+4>>2]=j;w4(d,110704,u)|0;n=n+1|0;p=D;q=C;r=B;s=k;}j=c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;if(!(a[m>>0]|0)){k=+h[j+56>>3];D=+h[j+40>>3];j=GQ(m,g)|0;k=(D+k)*.5;}else {k=+h[j+64>>3];D=+h[j+48>>3];j=~~((D+k)*.5);k=+FQ(m,g);}A=~~k;C=+(A|0);h[i>>3]=p>3]=q>3]=r>C?r:C;h[x>>3]=s>D?s:D;c[y>>2]=A;c[y+4>>2]=j;w4(d,110718,y)|0;c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];c[b+16>>2]=c[i+16>>2];c[b+20>>2]=c[i+20>>2];c[b+24>>2]=c[i+24>>2];c[b+28>>2]=c[i+28>>2];l=z;return}function LQ(a){a=a|0;var b=0;a=Tz(a)|0;while(1){if(!a)break;b=Tz(c[a+16>>2]|0)|0;while(1){if(!b)break;c[b+32>>2]=oR(c[b+24>>2]|0)|0;b=c[b>>2]|0;}a=c[a>>2]|0;}return}function MQ(a){a=a|0;var b=0;a=Tz(a)|0;while(1){if(!a)break;b=Tz(c[a+16>>2]|0)|0;while(1){if(!b)break;if(c[b+24>>2]|0)cR(b);b=c[b>>2]|0;}a=c[a>>2]|0;}return}function NQ(a,b){a=a|0;b=b|0;var d=0;d=Tz(a)|0;while(1){if(!d)break;a=Tz(c[d+16>>2]|0)|0;while(1){if(!a)break;SQ(a,b);a=c[a>>2]|0;}d=c[d>>2]|0;}return}function OQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0;e=Tz(a)|0;while(1){if(!e)break;i=e+8|0;f=Tz(c[e+16>>2]|0)|0;while(1){if(!f)break;a=f+24|0;a:do if(c[a>>2]|0){if(c[47323]&8|0)PQ(f,~~+h[i>>3]);g=f+32|0;tR(c[g>>2]|0);b=c[a>>2]|0;d=f+28|0;a=0;while(1){if((a|0)>=(b|0))break a;c[(c[(c[d>>2]|0)+(a<<2)>>2]|0)+44>>2]=(c[(c[(c[g>>2]|0)+4>>2]|0)+(a*12|0)+4>>2]|0)+1;a=a+1|0;}}while(0);f=c[f>>2]|0;}e=c[e>>2]|0;}return}function PQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+32|0;d=j;g=a+24|0;a:do if((c[g>>2]|0)>=2){i=c[15712]|0;m=+h[a+8>>3];k=+h[a+16>>3];c[d>>2]=b;h[d+8>>3]=m;h[d+16>>3]=k;w4(i,110739,d)|0;f=a+32|0;a=a+28|0;b=0;while(1){if((b|0)>=(c[g>>2]|0))break a;e=c[(c[(c[f>>2]|0)+4>>2]|0)+(b*12|0)+8>>2]|0;b:do if(Xz(e)|0){QQ(i,c[(c[a>>2]|0)+(b<<2)>>2]|0);T4(110759,i)|0;d=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!d)break b;T4(110764,i)|0;QQ(i,c[(c[a>>2]|0)+(c[d>>2]<<2)>>2]|0);T4(153599,i)|0;d=nb[c[e>>2]&63](e,d,8)|0;}}while(0);b=b+1|0;}}while(0);l=j;return}function QQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0;g=l;l=l+80|0;f=g+40|0;e=g;if(!(a[d>>0]|0)){m=+h[d+16>>3];j=+h[d+8>>3];k=+h[d+24>>3];i=RQ(c[d+32>>2]|0)|0;e=RQ(c[d+36>>2]|0)|0;h[f>>3]=m;h[f+8>>3]=j;h[f+16>>3]=k;h[f+24>>3]=j;c[f+32>>2]=i;c[f+36>>2]=e;w4(b,110770,f)|0;}else {k=+h[d+8>>3];j=+h[d+16>>3];m=+h[d+24>>3];f=RQ(c[d+32>>2]|0)|0;i=RQ(c[d+36>>2]|0)|0;h[e>>3]=k;h[e+8>>3]=j;h[e+16>>3]=k;h[e+24>>3]=m;c[e+32>>2]=f;c[e+36>>2]=i;w4(b,110770,e)|0;}l=g;return}function RQ(a){a=a|0;switch(a|0){case 0:{a=110821;break}case 1:{a=110816;break}case 2:{a=110809;break}case 3:{a=110802;break}case 4:{a=110794;break}default:a=0;}return a|0}function SQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+16|0;r=w+8|0;t=w;u=c[a+32>>2]|0;v=c[a+28>>2]|0;p=a+24|0;m=r+4|0;n=t+4|0;j=0;a=c[p>>2]|0;a:while(1){q=j+1|0;if((q|0)>=(a|0))break;o=v+(j<<2)|0;k=q;while(1){if((k|0)>=(a|0)){j=q;continue a}b:do if(((sR(u,j,k)|0)==0?(sR(u,k,j)|0)==0:0)?(s=v+(k<<2)|0,TQ(c[o>>2]|0,c[s>>2]|0)|0):0){f=c[o>>2]|0;a=c[f+48>>2]|0;i=c[s>>2]|0;d=c[i+48>>2]|0;e=(d|0)==0;if(a)if(e)a=1;else a=+h[a+8>>3]!=+h[d+8>>3];else a=e^1;g=a&1;UQ(r,f,i,0,g);a=c[r>>2]|0;i=c[m>>2]|0;f=g^1;UQ(t,c[o>>2]|0,c[s>>2]|0,1,f);d=c[t>>2]|0;e=c[n>>2]|0;switch(i|0){case -1:{VQ(c[s>>2]|0,c[o>>2]|0,g,0,a,b);VQ(c[s>>2]|0,c[o>>2]|0,f,1,d,b);if((e|0)!=1)break b;WQ(c[o>>2]|0,c[s>>2]|0,f,b);break b}case 0:switch(e|0){case -1:{VQ(c[s>>2]|0,c[o>>2]|0,g,0,a,b);VQ(c[s>>2]|0,c[o>>2]|0,f,1,d,b);break b}case 0:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);break b}case 1:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);break b}default:break b}case 1:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);if((e|0)!=-1)break b;WQ(c[o>>2]|0,c[s>>2]|0,f,b);break b}default:break b}}while(0);k=k+1|0;a=c[p>>2]|0;}}l=w;return}function TQ(a,b){a=a|0;b=b|0;if(!(+h[a+8>>3]==+h[b+8>>3]))qa(110892,110161,843,110923);if((+h[a+16>>3]==+h[b+16>>3]?+h[a+24>>3]==+h[b+24>>3]:0)?(c[a+32>>2]|0)==(c[b+32>>2]|0):0)a=(c[a+36>>2]|0)==(c[b+36>>2]|0)&1;else a=0;return a|0}function UQ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=0;while(1){b=XQ(b,e)|0;if(!b){h=0;break}d=XQ(d,f)|0;if(!d){i=6;break}if(!(TQ(b,d)|0)){i=7;break}g=g+1|0;}if((i|0)==6)qa(138394,110161,871,110841);else if((i|0)==7)h=ZQ(b,YQ(b,d)|0,g+1|0,1-e|0)|0;c[a>>2]=g;c[a+4>>2]=h;return}function VQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=i+20|0;n=i+24|0;i=JQ(c[((a[b>>0]|0)==0?o:n)>>2]|0,b)|0;qR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0);k=1;while(1){if((k|0)>(g|0))break;l=XQ(b,e)|0;m=XQ(d,f)|0;do if(!(a[b>>0]|0)){j=JQ(c[n>>2]|0,l)|0;if(+h[l+8>>3]==+h[b+16>>3]){p=(c[b+32>>2]|0)==1;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}}else {p=(c[b+36>>2]|0)==1;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}}}else {j=JQ(c[o>>2]|0,l)|0;if(+h[l+8>>3]==+h[b+16>>3]){p=(c[b+32>>2]|0)==2;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}}else {p=(c[b+36>>2]|0)==2;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}}}while(0);b=l;d=m;k=k+1|0;}return}function WQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;while(1){if(!(TQ(b,d)|0))break;g=XQ(b,1)|0;d=XQ(d,e)|0;b=g;}g=c[(JQ(c[((a[b>>0]|0)==0?f+20|0:f+24|0)>>2]|0,b)|0)+32>>2]|0;rR(g,c[b+40>>2]|0,c[d+40>>2]|0);return}function XQ(a,b){a=a|0;b=b|0;if(!a)qa(110828,110161,798,110832);else return c[((b|0)==0?a+48|0:a+52|0)>>2]|0;return 0}function YQ(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=a[b>>0]|0;if(d<<24>>24==(a[c>>0]|0)?!(+h[b+8>>3]!=+h[c+8>>3]):0){if(!(d<<24>>24))b=_Q(b,c,3,1)|0;else b=_Q(b,c,4,2)|0;l=f;return b|0}gA(1,110854,e)|0;bb(189296,1);return 0}function ZQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0;j=1;while(1){if((j|0)>(e|0))break;i=XQ(b,f)|0;g=+h[i+8>>3]==+h[b+16>>3];do if(!(a[b>>0]|0))if(g){g=(c[b+32>>2]|0)==1;break}else {g=(c[b+36>>2]|0)==3;break}else if(g){g=(c[b+32>>2]|0)==4;break}else {g=(c[b+36>>2]|0)==2;break}while(0);b=i;j=j+1|0;d=g?0-d|0:d;}return d|0}function _Q(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0;j=+h[a+24>>3];k=+h[b+16>>3];do if(!(j>3],i=+h[b+24>>3],!(g>i)):0){if(k>2]|0;return ((d|0)==(c[b+32>>2]|0)?0:(d|0)==(e|0)?1:-1)|0}else {d=c[a+32>>2]|0;b=(d|0)==(c[b+36>>2]|0)?0:(d|0)==(e|0)?1:-1;break}if(!(j==i))if(j>2]|0)==(d|0);d=bR(c[b+32>>2]|0,c[a+32>>2]|0,d,e)|0;return (o?d:0-d|0)|0}else {o=(c[b+36>>2]|0)==(e|0);b=bR(c[a+32>>2]|0,c[b+32>>2]|0,d,e)|0;b=o?b:0-b|0;break}o=c[a+32>>2]|0;n=c[b+32>>2]|0;if((o|0)==(n|0)){b=c[b+36>>2]|0;if((c[a+36>>2]|0)==(b|0)){b=0;break}}else b=c[b+36>>2]|0;m=(n|0)==(d|0);if((n|0)==(b|0)){if(m){b=1;break}if((n|0)==(e|0)){b=-1;break}if((o|0)!=(d|0)?(c[a+36>>2]|0)!=(d|0):0){b=1;break}if((o|0)!=(e|0)?(c[a+36>>2]|0)!=(e|0):0){b=-1;break}b=0;break}f=(b|0)==(e|0);if(m&f){b=(c[a+36>>2]|0)==(e|0);if((o|0)==(d|0)){if(!b){b=-1;break}}else if(b){b=1;break}b=0;break}l=(b|0)==(d|0);if((n|0)==(e|0)&l){b=(o|0)==(e|0);if((c[a+36>>2]|0)==(d|0)){if(!b){b=-1;break}}else if(b){b=1;break}b=0;break}if(!n){if(l){b=aR(o,c[a+36>>2]|0,d)|0;break}if(f){b=0-(aR(o,c[a+36>>2]|0,e)|0)|0;break}}f=c[a+36>>2]|0;if(m&(b|0)==0){b=aR(f,o,d)|0;break}else {b=0-(aR(f,o,e)|0)|0;break}}else b=0;while(0);return b|0}function $Q(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0;i=+h[a+24>>3];j=+h[b+24>>3];do if(i>2]|0;if((a|0)==(d|0)?(c[b+32>>2]|0)==(e|0):0){a=-1;break}if((a|0)==(e|0)?(c[b+32>>2]|0)==(d|0):0){a=1;break}a=0;}else {f=c[b+32>>2]|0;g=(f|0)==(e|0);if(i==j)if(g){a=bR(c[a+36>>2]|0,c[b+36>>2]|0,d,e)|0;break}else {a=0-(bR(c[b+36>>2]|0,c[a+36>>2]|0,d,e)|0)|0;break}if(g?(c[b+36>>2]|0)==(e|0):0){a=-1;break}if((f|0)==(d|0)?(c[b+36>>2]|0)==(d|0):0){a=1;break}a=0;}while(0);return a|0}function aR(a,b,c){a=a|0;b=b|0;c=c|0;return ((a|0)==(c|0)?((b|0)==(c|0))<<31>>31:1)|0}function bR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((a|0)==(d|0)){b=(a|0)==0;if(b)return 0;else b=b&1;}return ((a|0)!=0|(b|0)!=(c|0))<<31>>31|0}function cR(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;g=c[a+28>>2]|0;h=c[a+24>>2]|0;d=c[a+32>>2]|0;a=0;a:while(1){e=a+1|0;if((e|0)>=(h|0))break;f=g+(a<<2)|0;b=e;while(1){if((b|0)==(h|0)){a=e;continue a}switch(YQ(c[f>>2]|0,c[g+(b<<2)>>2]|0)|0){case 1:{qR(d,a,b);break}case -1:{qR(d,b,a);break}default:{}}b=b+1|0;}}return}function dR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+24|0;e=c[f>>2]|0;d=e+1|0;c[f>>2]=d;c[b+40>>2]=e;e=a+28|0;a=c[e>>2]|0;if(!a)a=KK(d<<2)|0;else a=MK(a,d<<2)|0;c[e>>2]=a;c[a+((c[f>>2]|0)+-1<<2)>>2]=b;return}function eR(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;h[f>>3]=d;e=nb[c[a>>2]&63](a,f,512)|0;if(!e){e=JK(24)|0;h[e+8>>3]=+h[f>>3];c[e+16>>2]=Vz(25728,c[4581]|0)|0;nb[c[a>>2]&63](a,e,1)|0;}f=c[e+16>>2]|0;nb[c[f>>2]&63](f,b,1)|0;l=g;return}function fR(a,b,d){a=a|0;b=b|0;d=d|0;pR(c[b+32>>2]|0);U1(c[b+28>>2]|0);U1(b);return}function gR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b>>3];f=+h[c>>3];if(!(e>f))if(e>3]>=+h[c+8>>3])<<31>>31;else a=0;else a=!(+h[b+8>>3]<=+h[c+8>>3])&1;return a|0}function hR(a,b,d){a=a|0;b=b|0;d=d|0;Rz(c[b+16>>2]|0)|0;U1(b);return}function iR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;f=+h[b>>3];e=+h[c>>3];return (f>e?1:(f>31)|0}function jR(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0;i=(a[d+36>>0]|0)!=0;j=e+40|0;do if((c[d+24>>2]|0)==(e|0)){f=+h[j>>3];if(i){g=(+h[e+64>>3]+ +h[e+48>>3])*.5;break}else {g=+h[e+48>>3];f=(+h[e+56>>3]+f)*.5;break}}else if(i){g=(+h[e+64>>3]+ +h[e+48>>3])*.5;f=+h[e+56>>3];break}else {g=+h[e+64>>3];f=(+h[e+56>>3]+ +h[j>>3])*.5;break}while(0);h[b>>3]=f;h[b+8>>3]=g;return}function kR(a,b){a=a|0;b=b|0;var d=0;d=c[a+20>>2]|0;if((d|0)!=(c[b+20>>2]|0)?(d|0)!=(c[b+24>>2]|0):0)d=c[a+24>>2]|0;return d|0}function lR(a,b){a=a|0;b=b|0;var c=0.0;c=(+h[b+64>>3]+ +h[b+48>>3])*.5;h[a>>3]=(+h[b+56>>3]+ +h[b+40>>3])*.5;h[a+8>>3]=c;return}function mR(b,d,e,f,g,i,j){b=b|0;d=d|0;e=+e;f=+f;g=+g;i=i|0;j=j|0;var k=0,l=0;a[b>>0]=d;h[b+8>>3]=e;if(f>3]=f;h[b+16>>3]=e;c[b+36>>2]=d;c[b+32>>2]=l;a[b+1>>0]=k;return}function nR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[b+36>>2]|0;do if((c[e+4>>2]|0)!=(d|0)){if((c[e+12>>2]|0)==(d|0)){e=~~((+h[b+56>>3]+ +h[b+40>>3])*.5);d=~~+h[b+48>>3];break}if((c[e+8>>2]|0)==(d|0)){e=~~+h[b+40>>3];d=~~((+h[b+64>>3]+ +h[b+48>>3])*.5);break}if((c[e>>2]|0)==(d|0)){e=~~+h[b+56>>3];d=~~((+h[b+64>>3]+ +h[b+48>>3])*.5);}else {e=0;d=0;}}else {e=~~((+h[b+56>>3]+ +h[b+40>>3])*.5);d=~~+h[b+64>>3];}while(0);c[a>>2]=e;c[a+4>>2]=d;return}function oR(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=JK(8)|0;c[d>>2]=a;e=d+4|0;c[e>>2]=JK(a*12|0)|0;b=0;while(1){if((b|0)>=(a|0))break;g=PU()|0;f=c[e>>2]|0;c[f+(b*12|0)+8>>2]=g;c[f+(b*12|0)>>2]=0;b=b+1|0;}return d|0}function pR(a){a=a|0;var b=0,d=0,e=0;d=a+4|0;b=0;while(1){e=c[d>>2]|0;if((b|0)>=(c[a>>2]|0))break;Rz(c[e+(b*12|0)+8>>2]|0)|0;b=b+1|0;}U1(e);U1(a);return}function qR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c[(c[a+4>>2]|0)+(b*12|0)+8>>2]|0;nb[c[d>>2]&63](d,f,1)|0;l=e;return}function rR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e;c[f>>2]=d;a=a+4|0;g=c[(c[a>>2]|0)+(b*12|0)+8>>2]|0;nb[c[g>>2]&63](g,f,2)|0;c[f>>2]=b;d=c[(c[a>>2]|0)+(d*12|0)+8>>2]|0;nb[c[d>>2]&63](d,f,2)|0;l=e;return}function sR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c[(c[a+4>>2]|0)+(b*12|0)+8>>2]|0;d=(nb[c[d>>2]&63](d,f,512)|0)!=0&1;l=e;return d|0}function tR(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;switch(b|0){case 0:break;case 1:{c[(c[a+4>>2]|0)+4>>2]=0;break}default:{e=uR(b)|0;f=a+4|0;d=0;b=0;while(1){if((d|0)>=(c[a>>2]|0)){b=0;break}if(!(c[(c[f>>2]|0)+(d*12|0)>>2]|0))b=vR(a,d,b,e)|0;d=d+1|0;}while(1){d=wR(e)|0;if((d|0)<=-1)break;c[(c[f>>2]|0)+(d*12|0)+4>>2]=b;b=b+1|0;}xR(e);}}return}function uR(a){a=a|0;var b=0;b=JK(8)|0;c[b+4>>2]=JK(a<<2)|0;c[b>>2]=-1;return b|0}function vR(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;i=a+4|0;g=c[i>>2]|0;j=g+(b*12|0)|0;c[j>>2]=1;g=c[g+(b*12|0)+8>>2]|0;h=g+4|0;d=d+1|0;g=Tz(g)|0;while(1){if(!g)break;f=c[(c[h>>2]|0)+8>>2]|0;if((f|0)<0)f=c[g+8>>2]|0;else f=g+(0-f)|0;f=c[f>>2]|0;if(!(c[(c[i>>2]|0)+(f*12|0)>>2]|0))d=vR(a,f,d,e)|0;g=c[g>>2]|0;}c[j>>2]=2;yR(e,b);return d+1|0}function wR(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if((b|0)==-1)a=-1;else {d=c[(c[a+4>>2]|0)+(b<<2)>>2]|0;c[a>>2]=b+-1;a=d;}return a|0}function xR(a){a=a|0;U1(c[a+4>>2]|0);U1(a);return}function yR(a,b){a=a|0;b=b|0;var d=0;d=(c[a>>2]|0)+1|0;c[a>>2]=d;c[(c[a+4>>2]|0)+(d<<2)>>2]=b;return}function zR(a){a=a|0;var d=0,e=0,f=0;e=c[a>>2]|0;c[a+8>>2]=e;c[a+12>>2]=c[a+4>>2];d=a+16|0;a=0;while(1){if((a|0)>=(e|0))break;f=c[d>>2]|0;b[f+(a*40|0)+18>>1]=b[f+(a*40|0)+16>>1]|0;a=a+1|0;}return}function AR(a){a=a|0;var d=0,e=0,f=0;d=c[a+8>>2]|0;c[a>>2]=d;c[a+4>>2]=c[a+12>>2];e=a+16|0;a=0;while(1){if((a|0)>=(d|0))break;f=c[e>>2]|0;b[f+(a*40|0)+16>>1]=b[f+(a*40|0)+18>>1]|0;a=a+1|0;}d=d+2|0;while(1){if((a|0)>=(d|0))break;b[(c[e>>2]|0)+(a*40|0)+16>>1]=0;a=a+1|0;}return}function BR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=JK(((c[a>>2]|0)*6|0)+(b<<1)<<2)|0;c[a+20>>2]=JK((((c[a>>2]|0)*3|0)+b|0)*24|0)|0;e=c[a>>2]|0;f=a+16|0;a=0;while(1){if((a|0)>=(e|0))break;c[(c[f>>2]|0)+(a*40|0)+28>>2]=d;d=d+24|0;a=a+1|0;}e=e+2|0;while(1){if((a|0)>=(e|0))break;c[(c[f>>2]|0)+(a*40|0)+28>>2]=d;d=d+(b<<2)|0;a=a+1|0;}return}function CR(a){a=a|0;var b=0;b=JK(24)|0;c[b>>2]=0;c[b+16>>2]=JK(a*40|0)|0;return b|0}function DR(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=c[a>>2]|0;c[d+(b*40|0)+32>>2]=b;c[a>>2]=b+1;return d+(b*40|0)|0}function ER(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,g=0;g=a+4|0;f=c[g>>2]|0;c[g>>2]=f+1;g=c[a+20>>2]|0;a=g+(f*24|0)|0;c[g+(f*24|0)+12>>2]=c[b+32>>2];c[g+(f*24|0)+16>>2]=c[d+32>>2];h[a>>3]=e;c[g+(f*24|0)+8>>2]=0;FR(b,f);FR(d,f);return a|0}function FR(a,d){a=a|0;d=d|0;var e=0,f=0;e=a+16|0;f=b[e>>1]|0;c[(c[a+28>>2]|0)+(f<<16>>16<<2)>>2]=d;b[e>>1]=f+1<<16>>16;return}function GR(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+28>>2]|0);U1(c[b>>2]|0);U1(c[a+20>>2]|0);U1(a);return}function HR(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;g=c[a>>2]|0;i=a+16|0;f=0;while(1){if((f|0)>=(g|0))break;c[(c[i>>2]|0)+(f*40|0)>>2]=-2147483648;f=f+1|0;}XU();a:do if(!(_U(d)|0)){c[d+8>>2]=0;c[d>>2]=0;d=a+20|0;b:while(1){g=aV()|0;if(!g){f=0;break a}c[g>>2]=0-(c[g>>2]|0);if((g|0)==(e|0)){f=0;break a}i=g+16|0;j=g+28|0;f=0;while(1){if((f|0)>=(b[i>>1]|0))continue b;k=(c[d>>2]|0)+((c[(c[j>>2]|0)+(f<<2)>>2]|0)*24|0)|0;l=IR(a,k,g)|0;m=c[l>>2]|0;do if((m|0)<0){n=~~-(+h[k>>3]+ +(c[g>>2]|0));if((m|0)==-2147483648){c[l>>2]=n;if(_U(l)|0){f=1;break a}c[l+8>>2]=g;c[l+12>>2]=k;break}else {if((m|0)>=(n|0))break;bV(l,n);c[l+8>>2]=g;c[l+12>>2]=k;break}}while(0);f=f+1|0;}}}else f=1;while(0);return f|0}function IR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[b+12>>2]|0;if((e|0)==(c[d+32>>2]|0))e=c[b+16>>2]|0;return (c[a+16>>2]|0)+(e*40|0)|0}function JR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=c[a>>2]|0;LF(g,3,b)|0;b=c[g+92>>2]|0;do if(b){d=c[b+16>>2]|0;h=c[d+12>>2]|0;c[a+76>>2]=h;e=c[d+16>>2]|0;c[a+84>>2]=e;f=a+80|0;c[f>>2]=c[d>>2];c[a+88>>2]=c[b+4>>2];d=a+152|0;e=c[d>>2]|c[e>>2];c[d>>2]=e;b=c[g+80>>2]|0;if(!b){c[a+60>>2]=0;b=999;break}else {g=c[b+16>>2]|0;c[a+60>>2]=c[g+12>>2];i=c[g+16>>2]|0;c[a+68>>2]=i;c[a+72>>2]=c[b+4>>2];c[d>>2]=e|c[i>>2];c[a+64>>2]=c[((h|0)==0?f:g)>>2];b=300;break}}else b=999;while(0);return b|0}function KR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(!(kF(a)|0))if((b|0)!=0?(d=c[b>>2]|0,(d|0)!=0):0){tb[d&127](a);a=0;}else a=0;else a=1;return a|0}function LR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+4>>2]|0,d|0):0)tb[d&127](a);c[(c[a>>2]|0)+24>>2]=0;sF(a);return}function MR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;e=+h[b+504>>3];f=+h[b+512>>3];i=+h[b+352>>3];if(!(c[b+360>>2]|0)){g=+h[d>>3]+e;d=d+8|0;e=f;}else g=-(f+ +h[d+8>>3]);f=+h[b+528>>3]*i*(+h[d>>3]+e);h[a>>3]=+h[b+520>>3]*i*g;h[a+8>>3]=f;return}function NR(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0;f=+h[a+504>>3];g=+h[a+512>>3];i=+h[a+352>>3];j=+h[a+520>>3]*i;i=+h[a+528>>3]*i;a:do if(!(c[a+360>>2]|0)){a=0;while(1){if((a|0)>=(e|0))break a;h[d+(a<<4)>>3]=(+h[b+(a<<4)>>3]+f)*j;h[d+(a<<4)+8>>3]=(+h[b+(a<<4)+8>>3]+g)*i;a=a+1|0;}}else {a=0;while(1){if((a|0)>=(e|0))break a;k=-(j*(+h[b+(a<<4)+8>>3]+g));h[d+(a<<4)+8>>3]=(+h[b+(a<<4)>>3]+f)*i;h[d+(a<<4)>>3]=k;a=a+1|0;}}while(0);return d|0}function OR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+8>>2]|0,d|0):0)tb[d&127](a);return}function PR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+12>>2]|0,d|0):0)tb[d&127](a);rF(a);return}function QR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+24>>2]|0,d|0):0)tb[d&127](a);return}function RR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+28>>2]|0,d|0):0)tb[d&127](a);return}function SR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+16>>2]|0,d|0):0){b=c[a+160>>2]|0;xb[d&31](a,c[(c[(c[a>>2]|0)+308>>2]|0)+(b<<2)>>2]|0,b,c[a+156>>2]|0);}return}function TR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+20>>2]|0,d|0):0)tb[d&127](a);return}function UR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+32>>2]|0,d|0):0)tb[d&127](a);return}function VR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+36>>2]|0,d|0):0)tb[d&127](a);return}function WR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+40>>2]|0,d|0):0)tb[d&127](a);return}function XR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+44>>2]|0,d|0):0)tb[d&127](a);return}function YR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+48>>2]|0,d|0):0)tb[d&127](a);return}function ZR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+52>>2]|0,d|0):0)tb[d&127](a);return}function _R(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+56>>2]|0,d|0):0)tb[d&127](a);return}function $R(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+60>>2]|0,d|0):0)tb[d&127](a);return}function aS(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+64>>2]|0,d|0):0)tb[d&127](a);return}function bS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+68>>2]|0,d|0):0)tb[d&127](a);return}function cS(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=c[a+60>>2]|0;if(g|0?(h=c[g+72>>2]|0,h|0):0)yb[h&15](a,b,d,e,f);return}function dS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+76>>2]|0,d|0):0)tb[d&127](a);return}function eS(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+60>>2]|0;if(d|0?(e=c[d+80>>2]|0,e|0):0)ub[e&63](a,b);return}function fS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+84>>2]|0,d|0):0)tb[d&127](a);return}function gS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+48|0;f=k+32|0;h=k;i=k+16|0;j=c[b+60>>2]|0;m=c[e>>2]|0;do if(m|0?a[m>>0]|0:0){m=c[b+16>>2]|0;if(m|0?(c[m+144>>2]|0)==0:0)break;if(!(c[b+152>>2]&8192)){c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];MR(i,b,f);c[h>>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];}else {c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];}if(j|0?(g=c[j+88>>2]|0,g|0):0){c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];vb[g&127](b,f,e);}}while(0);l=k;return}function hS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=c[b+60>>2]|0;g=(c[b+16>>2]|0)+16|0;i=R2(d,58)|0;h=(i|0)!=0;if(h)a[i>>0]=0;if(f|0?(iS(c[b+68>>2]|0,d,g),e=c[f+92>>2]|0,e|0):0)ub[e&63](b,g);if(h)a[i>>0]=58;return}function iS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;g=k+16|0;j=k+8|0;i=k;c[d>>2]=b;c[d+32>>2]=5;e=zT(b)|0;f=c[a+16>>2]|0;if(!((f|0)!=0?(u5(e,f,c[a+20>>2]|0,4,102)|0)!=0:0))h=3;a:do if((h|0)==3){switch(AT(b,d,c[a+24>>2]|0)|0){case 0:break a;case 1:break;default:{gA(1,111046,g)|0;break a}}a=KK((l2(b)|0)+16|0)|0;c[i>>2]=b;m4(a,111011,i)|0;if(PJ(a)|0){c[j>>2]=b;gA(0,111020,j)|0;}U1(a);}while(0);l=k;return}function jS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=c[b+60>>2]|0;g=(c[b+16>>2]|0)+56|0;i=R2(d,58)|0;h=(i|0)!=0;if(h)a[i>>0]=0;if(f|0?(iS(c[b+68>>2]|0,d,g),e=c[f+92>>2]|0,e|0):0)ub[e&63](b,g);if(h)a[i>>0]=58;return}function kS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,h=0,i=0,j=0;h=c[a+60>>2]|0;i=a+16|0;j=(c[i>>2]|0)+96|0;if(h|0?(iS(c[a+68>>2]|0,b,j),f=c[h+92>>2]|0,f|0):0)ub[f&63](a,j);j=c[i>>2]|0;c[j+136>>2]=d;g[j+140>>2]=e;return}function lS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;k=m;j=c[b+60>>2]|0;b=c[b+16>>2]|0;c[b+160>>2]=d;a:do if((d|0)!=0&(j|0)!=0){j=b+144|0;i=b+152|0;g=b+148|0;b=d;b:while(1){f=b+4|0;b=c[b>>2]|0;if(!b)break a;c:do switch(a[b>>0]|0){case 115:{if(!(s2(b,111067)|0)){c[j>>2]=3;b=f;continue b}if(!(s2(b,111088)|0)){e=115;while(1){d=b+1|0;if(!(e<<24>>24))break;b=d;e=a[d>>0]|0;}h[i>>3]=+r5(d);b=f;continue b}break}case 100:{if(!(s2(b,137327)|0)){c[j>>2]=1;b=f;continue b}if(!(s2(b,137320)|0)){c[j>>2]=2;b=f;continue b}break}case 105:{if(s2(b,134335)|0?s2(b,111073)|0:0)break c;c[j>>2]=0;b=f;continue b}case 98:{if(!(s2(b,111083)|0)){h[i>>3]=2.0;b=f;continue b}break}case 102:{if(!(s2(b,111101)|0)){c[g>>2]=1;b=f;continue b}break}case 117:{if(!(s2(b,111108)|0)){c[g>>2]=0;b=f;continue b}break}case 116:{if(!(s2(b,111117)|0)){b=f;continue b}break}default:{}}while(0);c[k>>2]=b;gA(0,111125,k)|0;b=f;}}while(0);l=m;return}function mS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+32|0;g=j;d=c[a+60>>2]|0;if((d|0?(i=d+96|0,f=c[i>>2]|0,f|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){d=b+16|0;h[g>>3]=(+h[d>>3]+ +h[b>>3])*.5;h[g+8>>3]=(+h[b+24>>3]+ +h[b+8>>3])*.5;b=g+16|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];if(!(c[a+152>>2]&8192)){NR(a,g,g,2)|0;f=c[i>>2]|0;}vb[f&127](a,g,e);}l=j;return}function nS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+48|0;m=o;f=c[a+60>>2]|0;if((f|0?(n=f+100|0,c[n>>2]|0):0)?(k=a+16|0,j=c[k>>2]|0,c[j+144>>2]|0):0){if(!(e&4)){f=e;g=0;}else {f=e&-5;e=j+16|0;g=m;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));g=e;h=j+56|0;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));g=1;}if(!(c[a+152>>2]&8192)){e=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=e;e=MK(c[47364]|0,e<<4)|0;c[47364]=e;}else e=c[47364]|0;NR(a,b,e,d)|0;xb[c[n>>2]&31](a,e,d,f);}else xb[c[n>>2]&31](a,b,d,f);if(g|0){g=(c[k>>2]|0)+16|0;h=m;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0))}}l=o;return}function oS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+64|0;f=e;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];g=f+32|0;b=b+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];h[f+16>>3]=+h[f>>3];h[f+24>>3]=+h[f+40>>3];h[f+48>>3]=+h[g>>3];h[f+56>>3]=+h[f+8>>3];nS(a,f,4,d);l=e;return}function pS(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=c[a+60>>2]|0;do if((i|0?(j=i+104|0,h=c[j>>2]|0,h|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){if(c[a+152>>2]&8192|0){zb[h&15](a,b,d,e,f,g&255);break}h=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=h;h=MK(c[47364]|0,h<<4)|0;c[47364]=h;}else h=c[47364]|0;NR(a,b,h,d)|0;zb[c[j>>2]&15](a,h,d,e,f,g&255);}while(0);return}function qS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=c[a+60>>2]|0;do if((e|0?(g=e+108|0,f=c[g>>2]|0,f|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){if(c[a+152>>2]&8192|0){vb[f&127](a,b,d);break}e=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=e;e=MK(c[47364]|0,e<<4)|0;c[47364]=e;}else e=c[47364]|0;NR(a,b,e,d)|0;vb[c[g>>2]&127](a,e,d);}while(0);return}function rS(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b+60>>2]|0;if((d|0?!((e|0)==0|(a[d>>0]|0)==0):0)?(f=c[e+112>>2]|0,f|0):0)ub[f&63](b,d);return}function sS(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;F=l;l=l+112|0;B=F+64|0;E=F;n=F+96|0;x=F+48|0;y=F+32|0;C=c[b+60>>2]|0;if(!b)qa(111282,111178,691,111189);if(!d)qa(111208,111178,692,111189);if(!(a[d>>0]|0))qa(111213,111178,693,111189);D=NF(d)|0;if(!D){if((C|0)!=0&(iN(d)|0)!=0?(m=c[C+116>>2]|0,m|0):0)yb[m&15](b,d,e,f,g&255);}else {s=b+432|0;c[B>>2]=c[s>>2];c[B+4>>2]=c[s+4>>2];c[B+8>>2]=c[s+8>>2];c[B+12>>2]=c[s+12>>2];QF(n,D,B);s=c[n>>2]|0;m=c[n+4>>2]|0;if(!((s|0)<1&(m|0)<1)){n=E+16|0;c[n>>2]=c[e>>2];c[n+4>>2]=c[e+4>>2];c[n+8>>2]=c[e+8>>2];c[n+12>>2]=c[e+12>>2];c[E>>2]=c[e>>2];c[E+4>>2]=c[e+4>>2];c[E+8>>2]=c[e+8>>2];c[E+12>>2]=c[e+12>>2];z=E+8|0;A=E+24|0;d=1;while(1){if((d|0)>=(f|0))break;G=e+(d<<4)|0;v=+h[G>>3];h[E>>3]=+h[(+h[E>>3]>3];w=+h[e+(d<<4)+8>>3];h[z>>3]=+h[(+h[z>>3]>3];h[n>>3]=+h[(+h[n>>3]>v?n:G)>>3];h[A>>3]=+h[(+h[A>>3]>w?n:G)+8>>3];d=d+1|0;}k=+h[n>>3];j=+h[E>>3];t=k-j;u=+h[A>>3];v=+h[z>>3];w=u-v;o=+(m|0);p=+(s|0);q=t/p;r=w/o;a:do switch(tS(i)|0){case 1:if(q>3]=j;k=k-t;h[n>>3]=k;}if(o>3]=v+w;h[A>>3]=u-w;}if(!(c[b+152>>2]&8192)){c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];MR(x,b,B);c[E>>2]=c[x>>2];c[E+4>>2]=c[x+4>>2];c[E+8>>2]=c[x+8>>2];c[E+12>>2]=c[x+12>>2];c[B>>2]=c[n>>2];c[B+4>>2]=c[n+4>>2];c[B+8>>2]=c[n+8>>2];c[B+12>>2]=c[n+12>>2];MR(y,b,B);c[n>>2]=c[y>>2];c[n+4>>2]=c[y+4>>2];c[n+8>>2]=c[y+8>>2];c[n+12>>2]=c[y+12>>2];k=+h[n>>3];j=+h[E>>3];}if(j>k){h[E>>3]=k;h[n>>3]=j;}j=+h[z>>3];k=+h[A>>3];if(j>k){h[z>>3]=k;h[A>>3]=j;}if(C|0){G=c[b+72>>2]|0;c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];c[B+16>>2]=c[E+16>>2];c[B+20>>2]=c[E+20>>2];c[B+24>>2]=c[E+24>>2];c[B+28>>2]=c[E+28>>2];xS(b,D,B,g,G);}}}l=F;return}function tS(b){b=b|0;if(a[b>>0]|0)if(c3(b,141116)|0)if(c3(b,141048)|0)if(!(c3(b,111221)|0))b=4;else b=(dP(b)|0)<<24>>24!=0&1;else b=3;else b=2;else b=0;return b|0}function uS(a,b){a=a|0;b=+b;if(c[a+60>>2]|0)h[(c[a+16>>2]|0)+152>>3]=b;return}function vS(a,b){a=a|0;b=b|0;b=LF(a,1,b)|0;if(!b)b=999;else {b=c[b+16>>2]|0;c[a+184>>2]=c[b+4>>2];c[a+172>>2]=c[b+12>>2];c[a+176>>2]=c[b>>2];c[a+180>>2]=c[b+16>>2];b=300;}return b|0}function wS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i;TC(b,137483,280,1)|0;g=b+16|0;c[(c[g>>2]|0)+144>>2]=a;if((yC(b)|0)!=(b|0))c[(c[(yC(b)|0)+16>>2]|0)+144>>2]=a;e=QA(b,111226)|0;d=a+172|0;if((e|0)!=0?(c[d>>2]=0,(vS(a,e)|0)==999):0){d=MF(a,1,e)|0;c[f>>2]=e;c[f+4>>2]=d;gA(1,111233,f)|0;d=-1;}else {e=c[d>>2]|0;if(!e)d=-1;else {RJ(1);qK(b,c[c[a+180>>2]>>2]&1);d=c[(c[g>>2]|0)+8>>2]|0;c[(c[(yC(b)|0)+16>>2]|0)+8>>2]=d;_N();d=c[e>>2]|0;if(d|0?(tb[d&127](b),h=c[e+4>>2]|0,h|0):0)c[(c[g>>2]|0)+148>>2]=h;RJ(0);d=0;}}l=i;return d|0}function xS(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+176|0;k=n+8|0;j=n;h=n+40|0;if(!b)qa(111282,111286,52,111300);if(!d)qa(111312,111286,53,111300);i=c[d+8>>2]|0;if(!i)qa(111315,111286,54,111300);if(!(a[i>>0]|0))qa(111324,111286,55,111300);r3(h,c[d+28>>2]|0)|0;i=h+(l2(h)|0)|0;a[i>>0]=58;a[i+1>>0]=0;F4(h,g)|0;if((yS(b,h)|0)==999){c[j>>2]=h;gA(0,111336,j)|0;}g=c[b+92>>2]|0;if(g|0?(m=c[g>>2]|0,m|0):0){c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[k+16>>2]=c[e+16>>2];c[k+20>>2]=c[e+20>>2];c[k+24>>2]=c[e+24>>2];c[k+28>>2]=c[e+28>>2];xb[m&31](b,d,k,f);}l=n;return}function yS(a,b){a=a|0;b=b|0;b=LF(c[a>>2]|0,4,b)|0;if(!b)b=999;else {b=c[b+16>>2]|0;c[a+92>>2]=c[b+12>>2];c[a+96>>2]=c[b>>2];b=300;}return b|0}function zS(a){a=a|0;return 1}function AS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+336|0;h[c>>3]=+h[c>>3]+10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function BS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+336|0;h[c>>3]=+h[c>>3]-10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function CS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+344|0;h[c>>3]=+h[c>>3]-10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function DS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+344|0;h[c>>3]=+h[c>>3]+10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function ES(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+352|0;h[c>>3]=+h[c>>3]*1.1;a[b+537>>0]=1;return 0}function FS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+352|0;h[c>>3]=+h[c>>3]*.9090909090909091;a[b+537>>0]=1;return 0}function GS(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;e=b+536|0;d=(a[e>>0]|0)==0;a[e>>0]=d&1;if(d){d=c[b+448>>2]|0;e=c[b+452>>2]|0;i=+(d>>>0);g=+(e>>>0);f=i/+(d|0)>3]=(f?i:g)/+((f?d:e)|0);e=b+336|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;a[b+537>>0]=1;}return 0}function HS(b){b=b|0;var d=0,e=0;d=c[(c[b>>2]|0)+168>>2]|0;e=b+580|0;if(!(c[e>>2]|0)){c[e>>2]=d;e=(c[d+16>>2]|0)+112|0;a[e>>0]=a[e>>0]|2;XS(b,d);}sI(b,d);a[b+540>>0]=1;return}function IS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0;k=l;l=l+16|0;f=k;switch(d|0){case 1:{c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];QS(b,f);WS(b);a[b+538>>0]=1;a[b+541>>0]=1;j=13;break}case 2:{a[b+538>>0]=1;a[b+541>>0]=2;j=13;break}case 3:{c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];QS(b,f);a[b+538>>0]=1;a[b+541>>0]=3;j=13;break}case 4:{a[b+536>>0]=0;if(!(c[b+360>>2]|0)){f=b+352|0;i=+h[f>>3];d=b+336|0;h[d>>3]=(+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+520>>3]*i)+ +h[d>>3];g=+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5;d=b+528|0;}else {f=b+352|0;i=+h[f>>3];d=b+336|0;h[d>>3]=+h[d>>3]-(+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+528>>3]*i);g=+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5;d=b+520|0;}j=b+344|0;h[j>>3]=g*.10000000000000009/(+h[d>>3]*i)+ +h[j>>3];h[f>>3]=i*1.1;j=13;break}case 5:{a[b+536>>0]=0;j=b+352|0;i=+h[j>>3]*.9090909090909091;h[j>>3]=i;if(!(c[b+360>>2]|0)){f=b+336|0;h[f>>3]=+h[f>>3]-(+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+520>>3]*i);g=+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5;f=b+528|0;}else {f=b+336|0;h[f>>3]=(+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+528>>3]*i)+ +h[f>>3];g=+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5;f=b+520|0;}j=b+344|0;h[j>>3]=+h[j>>3]-g*.10000000000000009/(+h[f>>3]*i);j=13;break}default:{}}if((j|0)==13)a[b+537>>0]=1;b=b+560|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];l=k;return}function JS(b,c,d){b=b|0;c=c|0;d=d|0;a[b+538>>0]=0;a[b+541>>0]=0;return}function KS(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0;k=l;l=l+16|0;e=k;i=b+560|0;j=(+h[d>>3]-+h[i>>3])/+h[b+520>>3];g=(+h[d+8>>3]-+h[b+568>>3])/+h[b+528>>3];if(!(+B(+j)<.0001&+B(+g)<.0001)){switch(a[b+541>>0]|0){case 0:{c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];QS(b,e);break}case 2:{f=+h[b+352>>3];if(!(c[b+360>>2]|0)){e=b+336|0;h[e>>3]=+h[e>>3]-j/f;e=b+344|0;h[e>>3]=+h[e>>3]-g/f;}else {e=b+336|0;h[e>>3]=+h[e>>3]-g/f;e=b+344|0;h[e>>3]=+h[e>>3]+j/f;}a[b+537>>0]=1;break}default:{}}c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];}l=k;return}function LS(a,b,c){a=a|0;b=b|0;c=c|0;return}function MS(a){a=a|0;return}function NS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=c[b>>2]|0;if(d){d=$4(d,138821)|0;if(d|0){i=jF(d,0)|0;I4(d)|0;f=5;}}else {i=jF(c[15647]|0,0)|0;f=5;}if((f|0)==5?i|0:0){g=j+168|0;d=c[g>>2]|0;if(d|0){f=c[j+172>>2]|0;if((f|0)!=0?(h=c[f+4>>2]|0,(h|0)!=0):0){tb[h&127](d);d=c[g>>2]|0;}vK(d);sB(c[g>>2]|0)|0;}YC(i,0,137483,280,1);YC(i,1,137447,304,1);YC(i,2,137460,176,1);c[g>>2]=i;c[(c[i+16>>2]|0)+144>>2]=j;if((nG(j,i,e)|0)!=-1){c[b+580>>2]=0;c[b+576>>2]=0;a[b+537>>0]=1;}}return}function OS(a,b){a=a|0;b=b|0;a=c[a>>2]|0;nG(a,c[a+168>>2]|0,b)|0;return}function PS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=c[a>>2]|0;f=g+160|0;e=c[f>>2]|0;if((e|0)!=0?(c[g+164>>2]|0)==0:0){i=g+192|0;h=c[i>>2]|0;c[f>>2]=0;c[i>>2]=0;f=h;}else {f=0;e=0;}pG(g,c[g+168>>2]|0,b,d)|0;if(e|0){i=c[a>>2]|0;c[i+160>>2]=e;c[i+192>>2]=f;}return}function QS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0;f=l;l=l+80|0;e=f+48|0;g=f;m=f+32|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];RS(m,b,e);k=+h[m>>3];j=+h[m+8>>3];i=1.0/+h[b+352>>3];h[g+16>>3]=i+k;h[g+24>>3]=i+j;h[g>>3]=k-i;h[g+8>>3]=j-i;d=c[(c[b>>2]|0)+168>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];c[e+16>>2]=c[g+16>>2];c[e+20>>2]=c[g+20>>2];c[e+24>>2]=c[g+24>>2];c[e+28>>2]=c[g+28>>2];d=SS(d,e)|0;e=b+576|0;if((d|0)!=(c[e>>2]|0)){TS(b);c[e>>2]=d;US(b);a[b+537>>0]=1;}l=f;return}function RS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0;if(!(c[b+360>>2]|0)){e=+h[b+352>>3];f=+h[d+8>>3];g=e;i=b+528|0;e=+h[d>>3]/(+h[b+520>>3]*e)-+h[b+504>>3];}else {e=+h[b+352>>3];f=-+h[d>>3];g=e;i=b+520|0;e=+h[d+8>>3]/(+h[b+528>>3]*e)-+h[b+504>>3];}g=f/(+h[i>>3]*g)-+h[b+512>>3];h[a>>3]=e;h[a+8>>3]=g;return}function SS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g;e=jC(a)|0;a:while(1){if(!e){e=9;break}d=XA(a,e)|0;while(1){if(!d)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];if((jQ(d,f)|0)<<24>>24){e=6;break a}d=ZA(a,d)|0;}e=kC(a,e)|0;}do if((e|0)!=6)if((e|0)==9){d=lC(a)|0;while(1){if(!d)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];if((gQ(d,f)|0)<<24>>24){e=12;break}d=mC(a,d)|0;}if((e|0)==12)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];d=VS(a,f)|0;if(!d){d=a;break}else break}while(0);l=g;return d|0}function TS(b){b=b|0;var d=0;d=c[b+576>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{d=(c[d+16>>2]|0)+112|0;a[d>>0]=a[d>>0]&-2;break a}case 1:{d=(c[d+16>>2]|0)+117|0;a[d>>0]=a[d>>0]&-2;break a}case 2:{d=(c[d+16>>2]|0)+115|0;a[d>>0]=a[d>>0]&-2;break a}default:break a}while(0);c[b+584>>2]=0;return}function US(b){b=b|0;var d=0,e=0;e=b+584|0;d=c[e>>2]|0;if(d|0){U1(d);c[e>>2]=0;}d=c[b+576>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{b=(c[d+16>>2]|0)+112|0;a[b>>0]=a[b>>0]|1;b=GA(d,0,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}case 1:{b=(c[d+16>>2]|0)+117|0;a[b>>0]=a[b>>0]|1;b=GA(xC(d)|0,1,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}case 2:{b=(c[d+16>>2]|0)+115|0;a[b>>0]=a[b>>0]|1;b=GA(xC(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0,2,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}default:break a}while(0);return}function VS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+32|0;e=m;g=c[a+16>>2]|0;i=c[g+180>>2]|0;j=g+184|0;d=1;while(1){if((d|0)>(i|0)){k=4;break}f=c[(c[j>>2]|0)+(d<<2)>>2]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];c[e+16>>2]=c[b+16>>2];c[e+20>>2]=c[b+20>>2];c[e+24>>2]=c[b+24>>2];c[e+28>>2]=c[b+28>>2];f=VS(f,e)|0;if(!f)d=d+1|0;else {a=f;break}}do if((k|0)==4){o=+h[g+24>>3];n=+h[g+40>>3];if(((+h[b+16>>3]>=+h[g+16>>3]?+h[g+32>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=o:0)?n>=+h[b+8>>3]:0)break;a=0;}while(0);l=m;return a|0}function WS(b){b=b|0;var d=0,e=0,f=0;f=b+580|0;d=c[f>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{e=(c[d+16>>2]|0)+112|0;a[e>>0]=a[e>>0]&-7|4;break a}case 1:{e=(c[d+16>>2]|0)+117|0;a[e>>0]=a[e>>0]&-7|4;break a}case 2:{e=(c[d+16>>2]|0)+115|0;a[e>>0]=a[e>>0]&-7|4;break a}default:break a}while(0);d=b+588|0;e=c[d>>2]|0;if(e|0){U1(e);c[d>>2]=0;}d=c[b+576>>2]|0;c[f>>2]=d;b:do if(d|0)switch(IC(d)|0){case 0:{f=(c[d+16>>2]|0)+112|0;a[f>>0]=a[f>>0]|2;XS(b,d);break b}case 1:{f=(c[d+16>>2]|0)+117|0;a[f>>0]=a[f>>0]|2;YS(b,d);break b}case 2:{f=(c[d+16>>2]|0)+115|0;a[f>>0]=a[f>>0]|2;ZS(b,d);break b}default:break b}while(0);return}function XS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+592|0;do if((yC(b)|0)==(b|0))if(!(xB(b)|0)){GF(d,0,111494);break}else {GF(d,0,111486);break}else GF(d,0,111500);while(0);GF(d,1,KB(b)|0);c[a+596>>2]=2;f=a+604|0;d=0;e=2;while(1){d=LA(b,0,d)|0;if(!d)break;GF(f,e,c[d+8>>2]|0);GF(f,e+1|0,RA(b,d)|0);GF(f,e+2|0,0);e=e+3|0;}c[a+608>>2]=e;d=GA(b,0,141055,0)|0;if(!d){d=GA(b,0,111477,0)|0;if(d|0)g=11;}else g=11;if((g|0)==11)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function YS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=a+592|0;GF(f,0,111481);GF(f,1,KB(b)|0);c[a+596>>2]=2;f=a+604|0;g=yC(xC(b)|0)|0;e=2;d=0;while(1){d=LA(g,1,d)|0;if(!d)break;GF(f,e,c[d+8>>2]|0);GF(f,e|1,RA(b,d)|0);e=e+2|0;}c[a+608>>2]=e;d=GA(xC(b)|0,1,141055,0)|0;if(!d){d=GA(xC(b)|0,1,111477,0)|0;if(d|0)h=6;}else h=6;if((h|0)==6)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function ZS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;h=a+592|0;GF(h,0,111450);k=b+48|0;GF(h,1,KB(c[((c[b>>2]&3|0)==3?b:k)+40>>2]|0)|0);k=(xB(xC(c[((c[b>>2]&3|0)==3?b:k)+40>>2]|0)|0)|0)!=0;GF(h,3,k?137738:141747);k=b+-48|0;GF(h,4,KB(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0);c[a+596>>2]=7;i=a+604|0;j=yC(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0)|0;g=7;d=0;a:while(1){while(1){d=LA(j,2,d)|0;if(!d)break a;e=d+8|0;f=c[e>>2]|0;if(!(s2(f,111455)|0)){l=5;break}if(!(s2(f,111464)|0)){l=7;break}if(s2(f,111473)|0)break;GF(h,6,RA(b,d)|0);}if((l|0)==5){l=0;GF(h,2,RA(b,d)|0);}else if((l|0)==7){l=0;GF(h,5,RA(b,d)|0);}GF(i,g,c[e>>2]|0);GF(i,g+1|0,RA(b,d)|0);g=g+2|0;}c[a+608>>2]=g;d=GA(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0,2,141055,0)|0;if(!d){d=GA(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0,2,111477,0)|0;if(d|0)l=13;}else l=13;if((l|0)==13)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function _S(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=$S(a,b,c[d>>2]|0)|0;d=c[d+4>>2]|0;while(1){f=c[d+4>>2]|0;if(!f)break;b=0;while(1){e=c[f+(b*20|0)+4>>2]|0;if(!e)break;JF(a,c[d>>2]|0,e,c[f+(b*20|0)+8>>2]|0,g,f+(b*20|0)|0)|0;b=b+1|0;}d=d+8|0;}return}function $S(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=KK(12)|0;if(!b)b=0;else b=D4(b)|0;c[e+4>>2]=b;c[e+8>>2]=D4(d)|0;d=a+100|0;c[e>>2]=c[d>>2];c[d>>2]=e;return e|0}function aT(b,c){b=b|0;c=c|0;bT(b);a[b+44>>0]=0;cT(b)|0;PO(b)|0;return}function bT(b){b=b|0;var d=0,e=0;d=c[b+32>>2]|0;a:do if(d|0)while(1){e=c[d>>2]|0;if(!e)break a;if((a[e>>0]|0)==103?d4(e,111509)|0:0)_S(b,0,c[d+4>>2]|0);d=d+8|0;}while(0);return}function cT(a){a=a|0;var b=0;b=LF(a,2,111522)|0;if(!b)a=999;else {c[a+148>>2]=c[(c[b+16>>2]|0)+12>>2];a=300;}return a|0}function dT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a=c[a+148>>2]|0;if((a|0)!=0?(e=c[a>>2]|0,(e|0)!=0):0)a=lb[e&127](b,d)|0;else a=0;return a|0}function eT(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return (c[b>>2]|0)-(c[d>>2]|0)|0}function fT(a){a=a|0;var b=0.0,d=0.0;a=c[a+16>>2]|0;d=+h[a+16>>3];b=+h[a+24>>3];return (gT(~~(d>b?d:b)>>>0)|0)+1|0}function gT(a){a=a|0;var b=0,c=0;if(!a)a=-1;else {c=a>>>0>65535;a=c?a>>>16:a;c=c?16:0;b=a>>>0>255;a=b?a>>>8:a;c=b?c|8:c;b=a>>>0>15;a=b?a>>>4:a;c=b?c|4:c;b=a>>>0>3;a=(b?c|2:c)+((b?a>>>2:a)>>>0>1&1)|0;}return a|0}function hT(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+32|0;q=r;p=iT(b,d,e,f,g)|0;e=jT(p)|0;if((e|0)>=0){n=q+16|0;o=q+24|0;m=q+8|0;k=g+32|0;e=0;g=0;while(1){if((g|0)>=(d|0))break;f=b+(g*40|0)+32|0;do if(c[f>>2]|0){kT(q,p,b+(g*40|0)|0);i=+h[n>>3];j=+h[o>>3];if(!(c[q>>2]|0)){a[(c[f>>2]|0)+36>>0]=1;break}if(+h[m>>3]==0.0){f=c[f>>2]|0;h[f+16>>3]=i;h[f+24>>3]=j;a[f+36>>0]=1;break}if((a[k>>0]|0)==1){f=c[f>>2]|0;h[f+16>>3]=i;h[f+24>>3]=j;a[f+36>>0]=1;}else e=1;}while(0);g=g+1|0;}lT(p);}l=r;return e|0}function iT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=JK(28)|0;j=Vz(25912,c[4584]|0)|0;h=g+20|0;c[h>>2]=j;do if(j){j=TV()|0;c[g+24>>2]=j;if(!j){U4(111740,14,1,c[15712]|0)|0;i=6;break}else {c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=d;c[g+12>>2]=e;c[g+16>>2]=f;break}}else {U4(111740,14,1,c[15712]|0)|0;i=6;}while(0);if((i|0)==6){a=c[h>>2]|0;if(a|0)Rz(a)|0;a=c[g+24>>2]|0;if(a|0)VV(a)|0;U1(g);g=0;}return g|0}function jT(a){a=a|0;var b=0;b=uT(a)|0;if((b|0)>=0){vT(a);wT(a);b=Rz(c[a+20>>2]|0)|0;}return b|0}function kT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0,L=0,M=0;M=l;l=l+464|0;J=M+416|0;L=M+400|0;G=M+384|0;m=M+352|0;n=M+320|0;o=M+288|0;p=M+256|0;r=M+224|0;s=M+192|0;t=M+160|0;u=M+128|0;v=M+96|0;x=M+64|0;y=M+32|0;H=M;z=c[d+32>>2]|0;e=+h[z>>3];C=d+16|0;A=(e*2.0+ +h[C>>3])*.125;D=z+8|0;I=d+24|0;i=+h[I>>3];K=(+h[D>>3]*2.0+i)*.5;if(!z)qa(111533,111543,445,111553);f=J;g=f+36|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));B=z+16|0;h[B>>3]=+h[d>>3]-e;E=d+8|0;F=z+24|0;h[F>>3]=i+ +h[E>>3];mT(m,b,d,J);j=c[m>>2]|0;f=c[m+4>>2]|0;e=+h[m+8>>3];m=m+16|0;c[L>>2]=c[m>>2];c[L+4>>2]=c[m+4>>2];c[L+8>>2]=c[m+8>>2];c[L+12>>2]=c[m+12>>2];a:do if(!j){c[a>>2]=0;c[a+4>>2]=f;h[a+8>>3]=e;a=a+16|0;c[a>>2]=c[L>>2];c[a+4>>2]=c[L+4>>2];c[a+8>>2]=c[L+8>>2];c[a+12>>2]=c[L+12>>2];}else {h[F>>3]=+h[E>>3];mT(n,b,d,J);g=c[n>>2]|0;m=c[n+4>>2]|0;i=+h[n+8>>3];n=n+16|0;c[G>>2]=c[n>>2];c[G+4>>2]=c[n+4>>2];c[G+8>>2]=c[n+8>>2];c[G+12>>2]=c[n+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=m;e=i;}else g=j;h[F>>3]=+h[E>>3]-+h[D>>3];mT(o,b,d,J);m=c[o>>2]|0;j=c[o+4>>2]|0;i=+h[o+8>>3];o=o+16|0;c[G>>2]=c[o>>2];c[G+4>>2]=c[o+4>>2];c[G+8>>2]=c[o+8>>2];c[G+12>>2]=c[o+12>>2];if(!m){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=j;e=i;}else m=g;h[B>>3]=+h[d>>3];h[F>>3]=+h[I>>3]+ +h[E>>3];mT(p,b,d,J);g=c[p>>2]|0;j=c[p+4>>2]|0;i=+h[p+8>>3];p=p+16|0;c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3]-+h[D>>3];mT(r,b,d,J);g=c[r>>2]|0;j=c[r+4>>2]|0;i=+h[r+8>>3];r=r+16|0;c[G>>2]=c[r>>2];c[G+4>>2]=c[r+4>>2];c[G+8>>2]=c[r+8>>2];c[G+12>>2]=c[r+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[B>>3]=+h[C>>3]+ +h[d>>3];h[F>>3]=+h[I>>3]+ +h[E>>3];mT(s,b,d,J);g=c[s>>2]|0;j=c[s+4>>2]|0;i=+h[s+8>>3];s=s+16|0;c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3];mT(t,b,d,J);g=c[t>>2]|0;j=c[t+4>>2]|0;i=+h[t+8>>3];t=t+16|0;c[G>>2]=c[t>>2];c[G+4>>2]=c[t+4>>2];c[G+8>>2]=c[t+8>>2];c[G+12>>2]=c[t+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3]-+h[D>>3];mT(u,b,d,J);g=c[u>>2]|0;j=c[u+4>>2]|0;i=+h[u+8>>3];u=u+16|0;c[G>>2]=c[u>>2];c[G+4>>2]=c[u+4>>2];c[G+8>>2]=c[u+8>>2];c[G+12>>2]=c[u+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=j;e=i;}else g=m;j=(c[J+28>>2]|0)==0;do if(!(c[J+24>>2]|0))if(j){if(c[J+32>>2]|0){w=38;break}if(!((c[J+12>>2]|0)==0&(c[J>>2]|0)==0))w=38;}else w=46;else if(j)w=38;else w=46;while(0);b:do if((w|0)==38)if(!(c[J+32>>2]|0)){h[B>>3]=+h[d>>3]-+h[z>>3];p=v+4|0;r=v+8|0;s=v+16|0;m=F;j=E;i=+h[I>>3];c:while(1){while(1){h[m>>3]=+h[j>>3]+i;if(!(+h[B>>3]<=+h[C>>3]+ +h[d>>3])){w=46;break b}mT(v,b,d,J);n=c[v>>2]|0;o=c[p>>2]|0;k=+h[r>>3];c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!n)break c;if(k>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=B;j=B;i=A;g=n;f=o;e=k;}c[a>>2]=0;c[a+4>>2]=o;h[a+8>>3]=k;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}else w=46;while(0);d:do if((w|0)==46)if((c[J+12>>2]|0)==0&(c[J>>2]|0)==0){h[B>>3]=+h[d>>3]-+h[z>>3];k=+h[E>>3];n=x+4|0;o=x+8|0;p=x+16|0;i=k;k=+h[I>>3]+k;while(1){h[F>>3]=k;if(!(k>=i-+h[D>>3]))break d;mT(x,b,d,J);j=c[x>>2]|0;m=c[n>>2]|0;i=+h[o>>3];c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!j)break;if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];g=j;f=m;e=i;}i=+h[E>>3];k=+h[F>>3]-K;}c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);i=+h[d>>3];k=+h[C>>3]+i;h[B>>3]=k;q=+h[D>>3];h[F>>3]=+h[E>>3]-q;j=c[J+4>>2]|0;do if(!(c[J+8>>2]|0)){m=c[J>>2]|0;if(!((j|0)==0&(m|0)==0)){w=59;break}if(c[J+20>>2]|0){j=0;m=0;w=59;break}if(c[J+32>>2]|0){j=0;m=0;w=59;}}else {m=c[J>>2]|0;w=59;}while(0);e:do if((w|0)==59){f:do if((j|0)==0&(m|0)==0){h[B>>3]=k;p=y+4|0;r=y+8|0;s=y+16|0;m=F;j=E;i=q;g:while(1){while(1){h[m>>3]=+h[j>>3]-i;i=+h[d>>3];if(!(+h[B>>3]>=i-+h[z>>3]))break f;mT(y,b,d,J);n=c[y>>2]|0;o=c[p>>2]|0;k=+h[r>>3];c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!n)break g;if(k>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=B;j=B;i=A;g=n;f=o;e=k;}c[a>>2]=0;c[a+4>>2]=o;h[a+8>>3]=k;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);if(c[J+20>>2]|0)break;if(c[J+32>>2]|0)break;h[B>>3]=+h[C>>3]+i;i=+h[E>>3];n=H+4|0;o=H+8|0;p=H+16|0;k=i;i=i-+h[D>>3];while(1){h[F>>3]=i;if(!(i<=+h[I>>3]+k))break e;mT(H,b,d,J);j=c[H>>2]|0;m=c[n>>2]|0;i=+h[o>>3];c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!j)break;if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];g=j;f=m;e=i;}k=+h[E>>3];i=+h[F>>3]+K;}c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);c[a>>2]=g;c[a+4>>2]=f;h[a+8>>3]=e;a=a+16|0;c[a>>2]=c[L>>2];c[a+4>>2]=c[L+4>>2];c[a+8>>2]=c[L+8>>2];c[a+12>>2]=c[L+12>>2];}while(0);l=M;return}function lT(a){a=a|0;VV(c[a+24>>2]|0)|0;U1(a);return}function mT(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,m=0,n=0.0,o=0,p=0,q=0,r=0.0,s=0,t=0;t=l;l=l+48|0;q=t+32|0;s=t+16|0;p=t;g=c[e+32>>2]|0;if(!g)qa(111533,111543,382,111562);o=g+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];o=d+4|0;m=0;g=0;while(1){if((m|0)>=(c[o>>2]|0))break;j=c[d>>2]|0;k=j+(m*40|0)|0;do if((k|0)!=(e|0)){if(+h[j+(m*40|0)+16>>3]>0.0?+h[j+(m*40|0)+24>>3]>0.0:0)break;g=g+((nT(e,k)|0)!=0&1)|0;}while(0);m=m+1|0;}oT(e,q);m=c[d+24>>2]|0;m=XV(m,c[m>>2]|0,q)|0;if(!m){c[b>>2]=g;h[b+8>>3]=0.0;s=b+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];}else {k=m;i=0.0;while(1){if(!k)break;j=c[(c[k+4>>2]|0)+16>>2]|0;if((j|0)!=(e|0)){pT(j,s);n=+qT(q,s);if(n>0.0){g=g+1|0;i=+rT(e,j,q,n,f)+i;}d=c[j+32>>2]|0;if(((d|0)!=0?(a[d+36>>0]|0)!=0:0)?(oT(j,s),r=+qT(q,s),r>0.0):0){g=g+1|0;i=+sT(e,j,q,r,f)+i;}}k=c[k>>2]|0;}SV(m);c[b>>2]=g;h[b+8>>3]=i;s=b+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];}l=t;return}function nT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0.0;a=c[a+32>>2]|0;if(+h[b+16>>3]==0.0?+h[b+24>>3]==0.0:0){if((((a|0)!=0?(d=+h[b>>3],e=+h[a+16>>3],d>e):0)?d<+h[a>>3]+e:0)?(f=+h[b+8>>3],g=+h[a+24>>3],f>g):0)a=f<+h[a+8>>3]+g&1;else a=0;return a|0}qa(111599,111543,219,111636);return 0}function oT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a+32>>2]|0;e=+h[a+16>>3];c[b>>2]=~~e;d=+h[a+24>>3];c[b+4>>2]=~~d;c[b+8>>2]=~~(+h[a>>3]+e);c[b+12>>2]=~~(+h[a+8>>3]+d);return}function pT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;e=+h[a>>3];c[b>>2]=~~e;d=+h[a+8>>3];c[b+4>>2]=~~d;c[b+8>>2]=~~(+h[a+16>>3]+e);c[b+12>>2]=~~(+h[a+24>>3]+d);return}function qT(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=c[a+8>>2]|0;j=c[b>>2]|0;if((((i|0)>=(j|0)?(k=c[a>>2]|0,l=c[b+8>>2]|0,(k|0)<=(l|0)):0)?(e=c[a+12>>2]|0,f=c[b+4>>2]|0,(e|0)>=(f|0)):0)?(g=c[a+4>>2]|0,h=c[b+12>>2]|0,(g|0)<=(h|0)):0)d=(+(c[((e|0)<(h|0)?a:b)+12>>2]|0)-+(c[((g|0)>(f|0)?a:b)+4>>2]|0))*(+(c[((i|0)<(l|0)?a:b)+8>>2]|0)-+(c[((k|0)>(j|0)?a:b)>>2]|0));else d=0.0;return +d}function rT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;a=tT(a,b)|0;f=f+(((a|0)<0?5:a)<<2)|0;a=c[f>>2]|0;if(!a){c[f>>2]=b;g=e;}else {pT(a,i);g=+qT(d,i);g=g>e?g:0.0;a=c[f>>2]|0;if((c[a+32>>2]|0)!=0?(oT(a,i),h=+qT(d,i),h>e):0)g=h>g?h:g;if(!(g>0.0)){c[f>>2]=b;g=e;}}l=j;return +g}function sT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;a=tT(a,b)|0;f=f+(((a|0)<0?5:a)<<2)|0;a=c[f>>2]|0;if(!a){c[f>>2]=b;g=e;}else {pT(a,i);g=+qT(d,i);g=g>e?g:0.0;a=c[f>>2]|0;if((c[a+32>>2]|0)!=0?(oT(a,i),h=+qT(d,i),h>e):0)g=h>g?h:g;if(!(g>0.0)){c[f>>2]=b;g=e;}}l=j;return +g}function tT(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=c[b+32>>2]|0;f=c[d+32>>2]|0;if((e|0)==(f|0))qa(111578,111543,276,111588);do if((a[e+36>>0]|0)!=0?(a[f+36>>0]|0)!=0:0){j=+h[b>>3];if(j==0.0?+h[b+8>>3]==0.0:0){e=-1;break}k=+h[d>>3];i=+h[d+8>>3];if(!(k==0.0&i==0.0)){g=+h[b+8>>3];if(ij?2:1;break}e=kg){if(e){e=6;break}e=k>j?8:7;break}if(!e)if(k>j)e=5;else e=-1;else e=3;}else e=-1;}else e=-1;while(0);return e|0}function uT(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;k=l;l=l+32|0;d=k+24|0;e=k+16|0;f=k;g=fT(a)|0;h=a+4|0;i=e+4|0;j=a+20|0;b=0;while(1){if((b|0)>=(c[h>>2]|0)){b=0;break}m=JK(32)|0;o=(c[a>>2]|0)+(b*40|0)|0;n=m+12|0;c[m+28>>2]=o;xT(f,o);c[n>>2]=c[f>>2];c[n+4>>2]=c[f+4>>2];c[n+8>>2]=c[f+8>>2];c[n+12>>2]=c[f+12>>2];n=c[n>>2]|0;c[e>>2]=(((c[m+20>>2]|0)-n|0)/2|0)+n;n=c[m+16>>2]|0;c[i>>2]=(((c[m+24>>2]|0)-n|0)/2|0)+n;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[m+8>>2]=yT(d,g)|0;n=c[j>>2]|0;if(!(nb[c[n>>2]&63](n,m,1)|0)){b=-1;break}else b=b+1|0;}l=k;return b|0}function vT(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;e=c[d>>2]|0;b=a+24|0;a=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!a)break;e=c[b>>2]|0;YV(e,a+12|0,c[a+28>>2]|0,e,0)|0;e=c[d>>2]|0;a=nb[c[e>>2]&63](e,a,8)|0;}return}function wT(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=a+20|0;f=Xz(c[e>>2]|0)|0;d=0;while(1){if(!(Xz(c[e>>2]|0)|0))break;g=c[e>>2]|0;a=c[(c[g+8>>2]|0)+4>>2]|0;if(!a){h=8;break}b=c[(c[g+4>>2]|0)+8>>2]|0;if((b|0)<0)a=c[a+8>>2]|0;else a=a+(0-b)|0;if(!a){h=8;break}nb[c[g>>2]&63](g,a,4096)|0;U1(a);d=d+1|0;}if((h|0)==8)qa(111649,111543,616,111652);if((f|0)==(d|0))return;else qa(111664,111543,623,111652);}function xT(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,l=0.0;d=c[b+32>>2]|0;if(!d){e=0.0;f=0.0;}else {e=+h[d>>3];f=+h[d+8>>3];}l=+h[b>>3];k=~~+A(+(l-e));g=+h[b+8>>3];j=~~+A(+(g-f));i=~~+N(+(l+e+ +h[b+16>>3]));if((i|0)==2147483647)qa(111676,111543,264,111703);d=~~+N(+(g+f+ +h[b+24>>3]));if((d|0)==2147483647)qa(111713,111543,266,111703);else {c[a>>2]=k;c[a+4>>2]=j;c[a+8>>2]=i;c[a+12>>2]=d;return}}function yT(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=0;e=c[a>>2]|0;d=c[a+4>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;i=e>>>a&1;b=d>>>a&1;g=b+-1|0;h=g&(e^d);g=g&0-i;f=i<<1|f<<2|i^b;b=a;e=h^e^g;d=h^d^g;}return f|0}function zT(b){b=b|0;var d=0,e=0,f=0,g=0;d=l2(b)|0;if(d>>>0>=(c[47365]|0)>>>0){d=d+11|0;c[47365]=d;d=MK(c[47366]|0,d)|0;c[47366]=d;if(!d)d=0;else e=4;}else {d=c[47366]|0;e=4;}if((e|0)==4){g=d;while(1){e=a[b>>0]|0;if(!(e<<24>>24))break;f=e&255;if(e3(f)|0)e=(d3(f)|0)&255;a[g>>0]=e;g=g+1|0;b=b+1|0;}a[g>>0]=0;}return d|0}function AT(b,e,f){b=b|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0;F=l;l=l+144|0;s=F+96|0;p=F+80|0;v=F+124|0;t=F+72|0;w=F+64|0;x=F+56|0;C=F+48|0;D=F+40|0;E=F+32|0;y=F+24|0;z=F+16|0;A=F+8|0;B=F;i=F+120|0;m=F+116|0;n=F+112|0;o=F+108|0;c[e+32>>2]=f;r=b;while(1)if((a[r>>0]|0)==32)r=r+1|0;else break;c[o>>2]=255;b=a[r>>0]|0;a:do if(b<<24>>24==35){c[p>>2]=i;c[p+4>>2]=m;c[p+8>>2]=n;c[p+12>>2]=o;if((b5(r,111755,p)|0)<=2){b=a[r>>0]|0;q=12;break}switch(f|0){case 0:{G=+((c[i>>2]|0)>>>0)*.00392156862745098;h[C>>3]=G;g=+((c[m>>2]|0)>>>0)*.00392156862745098;h[D>>3]=g;j=+((c[n>>2]|0)>>>0)*.00392156862745098;h[E>>3]=j;k=+((c[o>>2]|0)>>>0)*.00392156862745098;BT(G,g,j,t,w,x);h[e>>3]=+h[t>>3];h[e+8>>3]=+h[w>>3];h[e+16>>3]=+h[x>>3];h[e+24>>3]=k;b=0;break a}case 1:{a[e>>0]=c[i>>2];a[e+1>>0]=c[m>>2];a[e+2>>0]=c[n>>2];a[e+3>>0]=c[o>>2];b=0;break a}case 3:{j=+((c[i>>2]|0)>>>0)*.00392156862745098;h[C>>3]=j;k=+((c[m>>2]|0)>>>0)*.00392156862745098;h[D>>3]=k;G=+((c[n>>2]|0)>>>0)*.00392156862745098;h[E>>3]=G;CT(j,k,G,y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break a}case 2:{c[e>>2]=(((c[i>>2]|0)*65535|0)>>>0)/255|0;c[e+4>>2]=(((c[m>>2]|0)*65535|0)>>>0)/255|0;c[e+8>>2]=(((c[n>>2]|0)*65535|0)>>>0)/255|0;c[e+12>>2]=(((c[o>>2]|0)*65535|0)>>>0)/255|0;b=0;break a}case 4:{h[e>>3]=+((c[i>>2]|0)>>>0)*.00392156862745098;h[e+8>>3]=+((c[m>>2]|0)>>>0)*.00392156862745098;h[e+16>>3]=+((c[n>>2]|0)>>>0)*.00392156862745098;h[e+24>>3]=+((c[o>>2]|0)>>>0)*.00392156862745098;b=0;break a}default:{b=0;break a}}}else q=12;while(0);b:do if((q|0)==12){if(!(b<<24>>24!=46?((b&255)+-48|0)>>>0>=10:0)){b=l2(r)|0;if(b>>>0>=(c[47367]|0)>>>0){b=b+11|0;c[47367]=b;b=MK(c[47368]|0,b)|0;c[47368]=b;if(!b){b=-1;break}}else b=c[47368]|0;m=b;i=r;c:while(1){n=i+1|0;i=a[i>>0]|0;switch(i<<24>>24){case 0:break c;case 44:{i=32;break}default:{}}a[m>>0]=i;m=m+1|0;i=n;}a[m>>0]=0;c[s>>2]=t;c[s+4>>2]=w;c[s+8>>2]=x;if((b5(b,111769,s)|0)==3){k=+h[t>>3];k=k<1.0?k:1.0;k=k>0.0?k:0.0;h[t>>3]=k;j=+h[w>>3];j=j<1.0?j:1.0;j=j>0.0?j:0.0;h[w>>3]=j;g=+h[x>>3];g=g<1.0?g:1.0;g=g>0.0?g:0.0;h[x>>3]=g;switch(f|0){case 0:{h[e>>3]=k;h[e+8>>3]=j;h[e+16>>3]=g;h[e+24>>3]=1.0;b=0;break b}case 1:{DT(k,j,g,C,D,E);a[e>>0]=~~(+h[C>>3]*255.0);a[e+1>>0]=~~(+h[D>>3]*255.0);a[e+2>>0]=~~(+h[E>>3]*255.0);a[e+3>>0]=-1;b=0;break b}case 3:{DT(k,j,g,C,D,E);CT(+h[C>>3],+h[D>>3],+h[E>>3],y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break b}case 2:{DT(k,j,g,C,D,E);c[e>>2]=~~(+h[C>>3]*65535.0);c[e+4>>2]=~~(+h[D>>3]*65535.0);c[e+8>>2]=~~(+h[E>>3]*65535.0);c[e+12>>2]=65535;b=0;break b}case 4:{DT(k,j,g,C,D,E);h[e>>3]=+h[C>>3];h[e+8>>3]=+h[D>>3];h[e+16>>3]=+h[E>>3];h[e+24>>3]=1.0;b=0;break b}default:{b=0;break b}}}}i=ET(r)|0;c[v>>2]=i;if(!i)b=-1;else {b=c[47369]|0;if(!(((b|0)!=0?(u=c[b>>2]|0,(a[u>>0]|0)==(a[i>>0]|0)):0)?(s2(u,i)|0)==0:0)){b=u5(v,25948,2491,12,103)|0;c[47369]=b;if(!b)switch(f|0){case 0:{c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;h[e+24>>3]=1.0;b=1;break b}case 1:{a[e+2>>0]=0;a[e+1>>0]=0;a[e>>0]=0;a[e+3>>0]=-1;b=1;break b}case 3:{c[e>>2]=0;b=1;break b}case 2:{c[e+8>>2]=0;c[e+4>>2]=0;c[e>>2]=0;c[e+12>>2]=65535;b=1;break b}case 4:{c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;h[e+24>>3]=1.0;b=1;break b}default:{b=1;break b}}}switch(f|0){case 0:{h[e>>3]=+(d[b+4>>0]|0)*.00392156862745098;h[e+8>>3]=+(d[b+5>>0]|0)*.00392156862745098;h[e+16>>3]=+(d[b+6>>0]|0)*.00392156862745098;h[e+24>>3]=+(d[b+10>>0]|0)*.00392156862745098;b=0;break b}case 1:{a[e>>0]=a[b+7>>0]|0;a[e+1>>0]=a[b+8>>0]|0;a[e+2>>0]=a[b+9>>0]|0;a[e+3>>0]=a[b+10>>0]|0;b=0;break b}case 3:{j=+(d[b+7>>0]|0)*.00392156862745098;h[C>>3]=j;k=+(d[b+8>>0]|0)*.00392156862745098;h[D>>3]=k;G=+(d[b+9>>0]|0)*.00392156862745098;h[E>>3]=G;CT(j,k,G,y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break b}case 2:{c[e>>2]=(d[b+7>>0]|0)*257;c[e+4>>2]=(d[b+8>>0]|0)*257;c[e+8>>2]=(d[b+9>>0]|0)*257;c[e+12>>2]=(d[b+10>>0]|0)*257;b=0;break b}case 4:{h[e>>3]=+(d[b+7>>0]|0)*.00392156862745098;h[e+8>>3]=+(d[b+8>>0]|0)*.00392156862745098;h[e+16>>3]=+(d[b+9>>0]|0)*.00392156862745098;h[e+24>>3]=+(d[b+10>>0]|0)*.00392156862745098;b=0;break b}default:{b=0;break b}}}}while(0);l=F;return b|0}function BT(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;i=bc?b:c;m=ma?a:i);g=i/m;if(m>0.0)if(g>0.0){j=(m-a)/i;k=(m-b)/i;l=(m-c)/i;do if(!(m==a)){if(m==b){a=j+2.0-l;break}if(m==c)a=k+4.0-j;else a=0.0;}else a=(b-c)/i;while(0);a=a*60.0;if(a<0.0)a=a+360.0;}else a=0.0;else {g=0.0;a=0.0;}h[d>>3]=a*.002777777777777778;h[f>>3]=m;h[e>>3]=g;return}function CT(a,b,c,d,e,f,g){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;g=g|0;h[d>>3]=1.0-a;h[e>>3]=1.0-b;h[f>>3]=1.0-c;b=+h[d>>3];c=+h[e>>3];c=b>3]=c;b=+h[f>>3];c=b>3]=c;h[d>>3]=+h[d>>3]-c;h[e>>3]=+h[e>>3]-+h[g>>3];h[f>>3]=+h[f>>3]-+h[g>>3];return}function DT(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0.0,k=0,l=0;a:do if(!(b<=0.0)){i=!(a>=1.0)?a*6.0:0.0;l=~~i;i=i-+(l|0);a=(1.0-b)*c;j=(1.0-i*b)*c;b=(1.0-(1.0-i)*b)*c;switch(l|0){case 0:{g=a;i=b;a=c;k=8;break a}case 1:{g=a;i=c;a=j;k=8;break a}case 2:{g=b;i=c;k=8;break a}case 3:{g=c;i=j;k=8;break a}case 4:{g=c;i=a;a=b;k=8;break a}case 5:{g=j;i=a;a=c;k=8;break a}default:break a}}else {g=c;i=c;a=c;k=8;}while(0);if((k|0)==8){h[d>>3]=a;h[e>>3]=i;h[f>>3]=g;}return}function ET(b){b=b|0;var d=0,e=0;d=a[b>>0]|0;if(((d<<24>>24!=98?(e=b+1|0,!(d<<24>>24==119|(Q2(e,137266,4)|0)==0)):0)?!(d<<24>>24==108|(Q2(e,137271,4)|0)==0):0)?(Q2(e,137276,8)|0)!=0:0){do if(d<<24>>24==47){d=R2(e,47)|0;if(!d)b=e;else {if((a[e>>0]|0)!=47){e=(j3(137285,e,4)|0)==0;b=e?d+1|0:b;break}d=c[47370]|0;if((d|0?a[d>>0]|0:0)?j3(137285,d,3)|0:0){b=GT(d,b+2|0)|0;break}b=b+2|0;}}else {d=c[47370]|0;if(((d|0)!=0?(a[d>>0]|0)!=0:0)?(j3(137285,d,3)|0)!=0:0)b=GT(d,b)|0;}while(0);b=zT(b)|0;}return b|0}function FT(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function GT(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;g=l2(a)|0;g=(l2(b)|0)+g|0;d=g+13|0;if((g+3|0)>>>0<(c[47371]|0)>>>0)d=c[47372]|0;else {c[47371]=d;d=MK(c[47372]|0,d)|0;c[47372]=d;}c[e>>2]=a;c[e+4>>2]=b;m4(d,137290,e)|0;l=f;return c[47372]|0}function HT(a){a=a|0;c[47370]=a;return}function IT(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;var f=0,g=0;f=l;l=l+208|0;g=f;JT(g,+h[a>>3],+h[a+8>>3],b,c,d,e);a=KT(g)|0;l=f;return a|0}function JT(a,b,c,d,e,f,g){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;g=+g;var i=0,j=0;h[a>>3]=b;h[a+8>>3]=c;j=a+16|0;h[j>>3]=d;i=a+24|0;h[i>>3]=e;h[a+32>>3]=0.0;c=+K(+(+F(+f)/e),+(+E(+f)/d));h[a+56>>3]=c;e=+K(+(+F(+g)/e),+(+E(+g)/d));h[a+40>>3]=1.0;h[a+48>>3]=0.0;e=e-+A(+((e-c)*.15915494309189535))*6.283185307179586;h[a+64>>3]=g-f>3.141592653589793&e-c<3.141592653589793?e+6.283185307179586:e;QT(a);RT(a);ST(a);g=+h[j>>3];g=(g-+h[i>>3])/g;h[a+168>>3]=g;h[a+176>>3]=(2.0-g)*g;g=1.0-g;h[a+184>>3]=g;h[a+192>>3]=g*g;return}function KT(a){a=a|0;var b=0,c=0.0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;q=JK(8)|0;f=+h[a+56>>3];e=+h[a+64>>3]-f;p=1;b=0;while(1){o=e/+(p|0);if(!(b<<24>>24==0&(p|0)<1024))break;a:do if(!(o<=1.5707963267948966))b=0;else {c=f;d=0;b=1;while(1){if(!(b<<24>>24!=0&(d|0)<(p|0)))break a;n=c+o;b=+LT(a,c,n)<=1.0e-05&1;c=n;d=d+1|0;}}while(0);p=p<<1;}i=+E(+f);u=+F(+f);d=a+16|0;s=+h[d>>3];v=s*i;j=a+24|0;c=+h[j>>3];g=c*u;i=c*i;c=+h[a>>3];k=a+40|0;t=+h[k>>3];l=a+48|0;r=+h[l>>3];e=t*v+c-r*g;m=a+8|0;n=+h[m>>3];g=r*v+t*g+n;s=-(u*s);MT(q,c,n);NT(q,e,g);n=+G(+(o*.5));n=+F(+o)*.3333333333333333*(+C(+(n*n*3.0+4.0))+-1.0);c=f;f=g;g=r*s+t*i;i=t*s-r*i;b=0;while(1){if((b|0)>=(p|0))break;r=c+o;u=+E(+r);v=+F(+r);x=+h[d>>3];z=x*u;w=+h[j>>3];t=w*v;u=w*u;w=+h[k>>3];y=+h[l>>3];s=w*z+ +h[a>>3]-y*t;t=y*z+w*t+ +h[m>>3];x=-(v*x);v=w*x-y*u;u=y*x+w*u;OT(q,e+i*n,f+g*n,s-v*n,t-u*n,s,t);c=r;e=s;f=t;g=u;i=v;b=b+1|0;}PT(q);return q|0}function LT(a,b,c){a=a|0;b=+b;c=+c;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;d=c+b;i=+h[a+16>>3];e=+h[a+24>>3]/i;g=+E(+d);f=+E(+(d*2.0));d=+E(+(d*3.0));a=e<.25?10392:10648;return +(((e*.001+4.98)*e+.207)/(e+.0067)*i*+L(+(((+h[a+32>>3]*e+ +h[a+40>>3])*e+ +h[a+48>>3])/(+h[a+56>>3]+e)*g+((+h[a>>3]*e+ +h[a+8>>3])*e+ +h[a+16>>3])/(+h[a+24>>3]+e)+((+h[a+64>>3]*e+ +h[a+72>>3])*e+ +h[a+80>>3])/(+h[a+88>>3]+e)*f+((+h[a+96>>3]*e+ +h[a+104>>3])*e+ +h[a+112>>3])/(+h[a+120>>3]+e)*d+(((+h[a+160>>3]*e+ +h[a+168>>3])*e+ +h[a+176>>3])/(+h[a+184>>3]+e)*g+((+h[a+128>>3]*e+ +h[a+136>>3])*e+ +h[a+144>>3])/(+h[a+152>>3]+e)+((+h[a+192>>3]*e+ +h[a+200>>3])*e+ +h[a+208>>3])/(+h[a+216>>3]+e)*f+((+h[a+224>>3]*e+ +h[a+232>>3])*e+ +h[a+240>>3])/(+h[a+248>>3]+e)*d)*(c-b))))}function MT(a,b,d){a=a|0;b=+b;d=+d;var e=0;c[47373]=100;e=JK(1600)|0;c[a>>2]=e;h[e>>3]=b;h[e+8>>3]=d;c[a+4>>2]=1;return}function NT(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;f=c[a>>2]|0;e=(c[a+4>>2]|0)+-1|0;OT(a,+h[f+(e<<4)>>3],+h[f+(e<<4)+8>>3],b,d,b,d);return}function OT(a,b,d,e,f,g,i){a=a|0;b=+b;d=+d;e=+e;f=+f;g=+g;i=+i;var j=0,k=0,l=0,m=0;l=a+4|0;j=c[l>>2]|0;k=c[47373]|0;if((j+3|0)<(k|0))a=c[a>>2]|0;else {c[47373]=k<<1;j=W1(c[a>>2]|0,k<<5)|0;c[a>>2]=j;a=j;j=c[l>>2]|0;}h[a+(j<<4)>>3]=b;m=j+1|0;h[a+(j<<4)+8>>3]=d;h[a+(m<<4)>>3]=e;k=j+2|0;h[a+(m<<4)+8>>3]=f;h[a+(k<<4)>>3]=g;c[l>>2]=j+3;h[a+(k<<4)+8>>3]=i;return}function PT(a){a=a|0;var b=0;b=c[a>>2]|0;NT(a,+h[b>>3],+h[b+8>>3]);c[a>>2]=W1(c[a>>2]|0,c[a+4>>2]<<4)|0;c[47373]=0;return}function QT(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0;d=+h[a+16>>3];b=+h[a+24>>3];b=+C(+(d*d-b*b));d=b*+h[a+40>>3];b=b*+h[a+48>>3];e=+h[a>>3];h[a+104>>3]=e-d;c=+h[a+8>>3];h[a+112>>3]=c-b;h[a+120>>3]=e+d;h[a+128>>3]=c+b;return}function RT(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0;d=+h[a+16>>3];i=+h[a+56>>3];j=+E(+i)*d;b=+h[a+24>>3];i=+F(+i)*b;g=+h[a+64>>3];d=+E(+g)*d;b=+F(+g)*b;g=+h[a>>3];c=+h[a+40>>3];e=+h[a+48>>3];h[a+72>>3]=c*j+g-e*i;f=+h[a+8>>3];h[a+80>>3]=e*j+f+c*i;h[a+88>>3]=g+c*d-e*b;h[a+96>>3]=f+e*d+c*b;return}function ST(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0;k=+h[a+24>>3];l=+h[a+16>>3];e=k/l;m=+h[a+48>>3];n=+B(+m)<.1;j=+h[a+40>>3];do if(n){b=m/j;c=+J(+(b*e));d=-c;if(j<0.0){b=+J(+(b/e));e=d;d=3.141592653589793-c;c=4.71238898038469-b;b=1.5707963267948966-b;break}else {b=+J(+(b/e));e=-3.141592653589793-c;c=1.5707963267948966-b;b=-1.5707963267948966-b;break}}else {b=j/m;c=+J(+(b/e));d=c+1.5707963267948966;if(m<0.0){b=+J(+(b*e));e=c+-1.5707963267948966;c=b+3.141592653589793;break}else {b=+J(+(b*e));e=d;d=c+4.71238898038469;c=b;b=b+-3.141592653589793;break}}while(0);g=+h[a+56>>3];e=e-+A(+((e-g)*.15915494309189535))*6.283185307179586;b=b-+A(+((b-g)*.15915494309189535))*6.283185307179586;f=d-+A(+((d-g)*.15915494309189535))*6.283185307179586;g=c-+A(+((c-g)*.15915494309189535))*6.283185307179586;i=+h[a+64>>3];if(!(e<=i)){e=+h[a+72>>3];c=+h[a+88>>3];c=e>3]-k*+F(+e)*m;h[a+136>>3]=c;if(!(b<=i)){e=+h[a+80>>3];d=+h[a+96>>3];d=e>3]+ +F(+b)*k*j;h[a+144>>3]=d;if(!(f<=i)){f=+h[a+72>>3];b=+h[a+88>>3];b=f>b?f:b;}else b=+E(+f)*l*j+ +h[a>>3]-k*+F(+f)*m;h[a+152>>3]=b-c;if(!(g<=i)){m=+h[a+80>>3];b=+h[a+96>>3];b=m>b?m:b;}else b=+E(+g)*l*m+ +h[a+8>>3]+ +F(+g)*k*j;h[a+160>>3]=b-d;return}function TT(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+80|0;m=n;UT(b);k=+h[e+56>>3];g=+h[e+64>>3];switch(a[e+80>>0]|0){case 116:{g=(+h[e+48>>3]-+VT(d))*.5+g;f=4;break}case 98:{g=g-(+h[e+48>>3]-+VT(d))*.5;f=4;break}default:{}}if((f|0)==4)g=g+-1.0;h[m>>3]=k;h[m+8>>3]=g;c[m+20>>2]=c[e+8>>2];c[m+16>>2]=c[e+4>>2];h[m+32>>3]=+h[e+16>>3];j=b+16|0;f=QA(c[(c[j>>2]|0)+8>>2]|0,137297)|0;e=m+56|0;c[e>>2]=f;i=m+60|0;c[i>>2]=c[(c[j>>2]|0)+212>>2];j=m+64|0;a[j>>0]=0;if(!((f|0)!=0?(a[f>>0]|0)!=0:0))c[e>>2]=137308;if((a[d+4>>0]|0)==1){e=c[d>>2]|0;lS(b,c[(c[b>>2]|0)+336>>2]|0);f=c[e+24>>2]|0;if(!f)hS(b,137314);else hS(b,f);XT(b,e,m);if(a[j>>0]|0)U1(c[i>>2]|0);}else WT(b,c[d>>2]|0,m);YT(b);l=n;return}function UT(a){a=a|0;var d=0,e=0,f=0;d=aI(a)|0;e=c[d>>2]|0;a=c[e+4>>2]|0;c[d+4>>2]=a;c[d+12>>2]=c[e+12>>2];switch(a|0){case 2:{a=e+8|0;f=6;break}case 0:{a=e+8|0;f=6;break}case 1:{a=e+8|0;f=6;break}case 3:{a=e+8|0;f=6;break}default:{}}if((f|0)==6)c[d+8>>2]=c[a>>2];c[d+208>>2]=c[e+208>>2];c[d+228>>2]=c[e+228>>2];c[d+244>>2]=c[e+244>>2];f=d+260|0;b[f>>1]=b[f>>1]&-2|b[e+260>>1]&1;return}function VT(b){b=b|0;var d=0.0,e=0,f=0;switch(a[b+4>>0]|0){case 1:{e=c[b>>2]|0;b=e+72|0;e=e+56|0;f=5;break}case 3:{e=c[b>>2]|0;b=e+24|0;e=e+8|0;f=5;break}case 2:{e=c[b>>2]|0;b=e+32|0;e=e+16|0;f=5;break}default:d=0.0;}if((f|0)==5)d=+h[b>>3]-+h[e>>3];return +d}function WT(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;n=l;l=l+96|0;j=n+64|0;i=n+32|0;g=n+16|0;k=n;m=b[e+4>>1]|0;if(m<<16>>16>=1){r=e+8|0;p=+h[e+24>>3];o=+h[r>>3];h[k>>3]=(o+p)*.5+ +h[f>>3];h[k+8>>3]=(+h[e+16>>3]+ +h[e+32>>3])*.5+ +h[f+8>>3];q=c[e>>2]|0;s=f+16|0;f=a[e+6>>0]|0;c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[i+16>>2]=c[s+16>>2];c[i+20>>2]=c[s+20>>2];c[i+24>>2]=c[s+24>>2];c[i+28>>2]=c[s+28>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];c[j+16>>2]=c[r+16>>2];c[j+20>>2]=c[r+20>>2];c[j+24>>2]=c[r+24>>2];c[j+28>>2]=c[r+28>>2];iU(d,m<<16>>16,q,g,(p-o)*.5,i,j,f);}l=n;return}function XT(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+176|0;t=y+96|0;v=y+64|0;w=y+136|0;p=y;q=y+128|0;r=f+48|0;c[v>>2]=c[r>>2];c[v+4>>2]=c[r+4>>2];c[v+8>>2]=c[r+8>>2];c[v+12>>2]=c[r+12>>2];c[v+16>>2]=c[r+16>>2];c[v+20>>2]=c[r+20>>2];c[v+24>>2]=c[r+24>>2];c[v+28>>2]=c[r+28>>2];m=+h[g>>3];n=+h[g+8>>3];r=f+84|0;i=c[r>>2]|0;if(!(c[f>>2]|0))x=(c[f+8>>2]|0)!=0;else x=1;u=f+108|0;j=c[u>>2]|0;if(j|0)ZT(g,j,186544);h[v>>3]=+h[v>>3]+m;s=v+16|0;h[s>>3]=+h[s>>3]+m;s=v+8|0;h[s>>3]=+h[s>>3]+n;s=v+24|0;h[s>>3]=+h[s>>3]+n;if(x?(c[e+152>>2]&4|0)==0:0){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];s=_T(e,g,f,t,w)|0;}else s=0;o=f+42|0;j=b[o>>1]|0;if(!(j&32)){k=c[f+20>>2]|0;if(k){j=$T(e,k,c[f+28>>2]|0,j&65535,q)|0;if(!(b[o>>1]&4)){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];oS(e,t,j);}else {o=d[f+33>>0]|0;c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];TM(e,aU(p,t,o)|0,4,4,j);}U1(c[q>>2]|0);}while(1){j=c[i>>2]|0;if(!j)break;bU(e,j,g);i=i+4|0;}i=c[r>>2]|0;uS(e,1.0);j=f+24|0;while(1){k=i+4|0;i=c[i>>2]|0;if(!i)break;if(!(a[i+100>>0]|0)){i=k;continue}cU(e,i,g,c[j>>2]|0,c[k>>2]|0);i=k;}if(a[f+33>>0]|0){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];dU(e,f,t);}}if(s|0)eU(e,w);if((x?c[e+152>>2]&4|0:0)?(c[t>>2]=c[v>>2],c[t+4>>2]=c[v+4>>2],c[t+8>>2]=c[v+8>>2],c[t+12>>2]=c[v+12>>2],c[t+16>>2]=c[v+16>>2],c[t+20>>2]=c[v+20>>2],c[t+24>>2]=c[v+24>>2],c[t+28>>2]=c[v+28>>2],_T(e,g,f,t,w)|0):0)eU(e,w);if(c[u>>2]|0)fU(g,186544);l=y;return}function YT(a){a=a|0;var b=0;b=c[a+16>>2]|0;c[b+208>>2]=0;c[b+228>>2]=0;c[b+244>>2]=0;c[b+212>>2]=0;bI(a);return}function ZT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0;i=a+16|0;f=c[i>>2]|0;if(f|0){if(!(c[b>>2]|0)){f=0;g=d;}else {c[d>>2]=f;f=c[b>>2]|0;g=i;}c[g>>2]=f;}f=c[a+20>>2]|0;if(f|0){g=b+4|0;if(!(c[g>>2]|0)){f=0;g=d;}else {c[d+4>>2]=f;f=c[g>>2]|0;g=i;}c[g+4>>2]=f;}e=+h[a+32>>3];if(e>=0.0){f=b+16|0;if(!(+h[f>>3]>=0.0))e=-1.0;else {h[d+16>>3]=e;e=+h[f>>3];d=i;}h[d+16>>3]=e;}return}function _T(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+224|0;n=u+8|0;k=u;t=u+40|0;j=u+184|0;i=u+56|0;m=c[d+16>>2]|0;o=m+208|0;c[h>>2]=c[o>>2];p=m+228|0;c[h+4>>2]=c[p>>2];q=m+244|0;c[h+8>>2]=c[q>>2];r=m+212|0;c[h+12>>2]=c[r>>2];s=m+260|0;a[h+16>>0]=(b[s>>1]<<15&65535)<<16>>16>>15;h=c[f+16>>2]|0;if((h|0)!=0?(a[h>>0]|0)!=0:0)i=0;else {kA(t,128,i);i=e+60|0;h=c[i>>2]|0;if(!h){h=D4(dI(d,c[m+8>>2]|0,t)|0)|0;c[i>>2]=h;a[e+64>>0]=1;}nA(t,h)|0;i=c[47374]|0;c[47374]=i+1;c[k>>2]=i;m4(j,137391,k)|0;nA(t,j)|0;i=t+4|0;h=c[i>>2]|0;if(h>>>0>=(c[t+8>>2]|0)>>>0){lA(t,1)|0;h=c[i>>2]|0;}a[h>>0]=0;h=c[t>>2]|0;c[i>>2]=h;i=1;}h=cI(d,0,c[f>>2]|0,c[f+12>>2]|0,c[f+8>>2]|0,h,c[m+8>>2]|0)|0;if(i)oA(t);do if(h|0){if((c[o>>2]|0)==0?(b[s>>1]&1)==0:0)break;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];c[n+16>>2]=c[g+16>>2];c[n+20>>2]=c[g+20>>2];c[n+24>>2]=c[g+24>>2];c[n+28>>2]=c[g+28>>2];kI(d,n);cS(d,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0);}while(0);l=u;return h|0}function $T(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;if(!((JJ(b,f,i)|0)<<24>>24)){jS(a,b);b=1;}else {jS(a,c[f>>2]|0);b=c[f+4>>2]|0;h=+g[i>>2];if(!b)kS(a,137314,d,h);else kS(a,b,d,h);b=e>>>1&1|2;}hS(a,137379);l=j;return b|0}function aU(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];e=a+32|0;b=b+16|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];if((d|0)>1){j=+(d|0)*.5;i=+h[a>>3]+j;h[a>>3]=i;d=a+8|0;g=+h[d>>3]+j;h[d>>3]=g;f=+h[e>>3]-j;h[e>>3]=f;e=a+40|0;j=+h[e>>3]-j;h[e>>3]=j;}else {f=+h[e>>3];g=+h[a+8>>3];i=+h[a>>3];j=+h[a+40>>3];}h[a+16>>3]=f;h[a+24>>3]=g;h[a+48>>3]=i;h[a+56>>3]=j;return a|0}function bU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+176|0;r=v+96|0;s=v+136|0;t=v+64|0;p=v;q=v+128|0;u=f+48|0;c[t>>2]=c[u>>2];c[t+4>>2]=c[u+4>>2];c[t+8>>2]=c[u+8>>2];c[t+12>>2]=c[u+12>>2];c[t+16>>2]=c[u+16>>2];c[t+20>>2]=c[u+20>>2];c[t+24>>2]=c[u+24>>2];c[t+28>>2]=c[u+28>>2];j=+h[g>>3];k=+h[g+8>>3];if(!(c[f>>2]|0))u=(c[f+8>>2]|0)!=0;else u=1;h[t>>3]=+h[t>>3]+j;o=t+16|0;h[o>>3]=+h[o>>3]+j;o=t+8|0;h[o>>3]=+h[o>>3]+k;o=t+24|0;h[o>>3]=+h[o>>3]+k;if(u?(c[e+152>>2]&4|0)==0:0){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];o=_T(e,g,f,r,s)|0;}else o=0;n=f+42|0;i=b[n>>1]|0;a:do if(!(i&32)){m=c[f+20>>2]|0;if(m|0){i=$T(e,m,c[f+28>>2]|0,i&65535,q)|0;if(!(b[n>>1]&4)){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];oS(e,r,i);}else {n=d[f+33>>0]|0;c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];TM(e,aU(p,r,n)|0,4,4,i);}U1(c[q>>2]|0);}if(a[f+33>>0]|0){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];dU(e,f,r);}i=f+88|0;switch(a[f+92>>0]|0){case 1:{XT(e,c[i>>2]|0,g);break a}case 3:{hU(e,c[i>>2]|0,g);break a}default:{WT(e,c[i>>2]|0,g);break a}}}while(0);if(o|0)eU(e,s);if((u?c[e+152>>2]&4|0:0)?(c[r>>2]=c[t>>2],c[r+4>>2]=c[t+4>>2],c[r+8>>2]=c[t+8>>2],c[r+12>>2]=c[t+12>>2],c[r+16>>2]=c[t+16>>2],c[r+20>>2]=c[t+20>>2],c[r+24>>2]=c[t+24>>2],c[r+28>>2]=c[t+28>>2],_T(e,g,f,r,s)|0):0)eU(e,s);l=v;return}function cU(f,g,i,j,k){f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0.0,n=0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0;A=l;l=l+32|0;y=A+16|0;z=A;r=+h[i>>3];x=+h[i+8>>3];q=(j|0)==0?137314:j;jS(f,q);hS(f,q);t=+h[g+48>>3];o=+h[g+56>>3];u=+h[g+64>>3];p=+h[g+72>>3];s=t+r;r=u+r;x=o+x;q=g+100|0;i=a[q>>0]|0;if((i&1)!=0?(n=c[g+96>>2]|0,((e[g+80>>1]|0)+(e[g+84>>1]|0)|0)<(c[n+104>>2]|0)):0){i=b[g+86>>1]|0;do if(i<<16>>16)if(((e[g+82>>1]|0)+(i&65535)|0)==(c[n+100>>2]|0)){B=a[n+32>>0]|0;C=(B<<24>>24)/2|0;j=(C<<24>>24)+(d[n+33>>0]|0)|0;i=j;j=j&255;m=x-+(C<<24>>24);n=B;break}else {n=a[n+32>>0]|0;i=0;j=((n<<24>>24)/2|0)<<24>>24;m=x;break}else {C=a[n+32>>0]|0;j=((C<<24>>24)/2|0)<<24>>24;i=j+(d[n+33>>0]|0)|0;m=x;n=C;}while(0);h[z+8>>3]=m-+(j|0);h[z>>3]=r+ +(((n<<24>>24)/2|0)<<24>>24);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];gU(f,y,0.0,p-o+ +(i&255|0)+ +(n<<24>>24));i=a[q>>0]|0;}if(i&2?(v=b[g+86>>1]|0,w=c[g+96>>2]|0,((e[g+82>>1]|0)+(v&65535)|0)<(c[w+100>>2]|0)):0){i=b[g+84>>1]|0;do if(!(i<<16>>16)){i=a[w+32>>0]|0;C=(i<<24>>24)/2|0;n=(C<<24>>24)+(d[w+33>>0]|0)|0;j=n&255;n=n&255;m=+(C<<24>>24);h[z>>3]=s-m-+(n|0);if((c[w+104>>2]|0)==(e[g+80>>1]|0)){j=n<<1&255;break}if((k|0)!=0?(b[k+86>>1]|0)!=v<<16>>16:0)j=~~(+(j&255)-u+ +h[w+64>>3]-m)&255;}else {if(((e[g+80>>1]|0)+(i&65535)|0)==(c[w+104>>2]|0)){i=a[w+32>>0]|0;C=(i<<24>>24)/2|0;j=(C&255)+(d[w+33>>0]|0)&255;h[z>>3]=s-+(C<<24>>24);break}i=a[w+32>>0]|0;m=+(((i<<24>>24)/2|0)<<24>>24);h[z>>3]=s-m;if((k|0)!=0?(b[k+86>>1]|0)!=v<<16>>16:0)j=~~(+h[w+64>>3]-u-m)&255;else j=0;}while(0);h[z+8>>3]=x-+(((i<<24>>24)/2|0)<<24>>24);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];gU(f,y,u-t+ +(j&255)+ +(i<<24>>24),0.0);}l=A;return}function dU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0;p=l;l=l+160|0;o=p+112|0;n=p;j=p+144|0;m=c[f+24>>2]|0;hS(e,(m|0)==0?137314:m);m=f+42|0;i=b[m>>1]|0;if(!(i&384))lS(e,c[(c[e>>2]|0)+336>>2]|0);else {c[j+4>>2]=0;c[j>>2]=0;i=i&65535;if(!(i&256)){if(i&128|0){i=137320;k=4;}}else {i=137327;k=4;}if((k|0)==4)c[j>>2]=i;lS(e,j);}k=f+33|0;uS(e,+(d[k>>0]|0));a:do if(!(b[m>>1]&4)){i=b[f+36>>1]&15360;if(!(i<<16>>16)){i=a[k>>0]|0;if((i&255)>1){q=+(i&255)*.5;h[g>>3]=+h[g>>3]+q;n=g+8|0;h[n>>3]=+h[n>>3]+q;n=g+16|0;h[n>>3]=+h[n>>3]-q;n=g+24|0;h[n>>3]=+h[n>>3]-q;};c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];oS(e,o,0);break}j=n+16|0;m=d[k>>0]|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];aU(j,o,m)|0;do switch(((i&65535)+-1024|0)>>>10&4194303|0){case 7:{qS(e,j,2);break a}case 3:{qS(e,n+32|0,2);break a}case 1:{qS(e,n+48|0,2);break a}case 0:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,2);break a}case 11:{qS(e,j,3);break a}case 5:{qS(e,n+32|0,3);break a}case 2:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];qS(e,n+48|0,3);break a}case 8:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,3);break a}case 13:{qS(e,j,4);break a}case 6:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];qS(e,n+32|0,4);break a}case 10:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];g=n+96|0;o=n+32|0;c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];qS(e,n+48|0,4);break a}case 12:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,4);break a}case 9:{qS(e,j,2);qS(e,n+48|0,2);break a}case 4:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,2);qS(e,n+32|0,2);break a}default:break a}while(0)}else {m=d[k>>0]|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];TM(e,aU(n,o,m)|0,4,4,0);}while(0);l=p;return}function eU(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=c[d+16>>2]|0;f=h+208|0;if((c[f>>2]|0)==0?(b[h+260>>1]&1)==0:0)d=0;else {dS(d);d=c[f>>2]|0;}if((d|0)!=(c[e>>2]|0)){U1(d);c[f>>2]=c[e>>2];}d=h+228|0;f=c[d>>2]|0;g=e+4|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}d=h+244|0;f=c[d>>2]|0;g=e+8|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}d=h+212|0;f=c[d>>2]|0;g=e+12|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}h=h+260|0;b[h>>1]=b[h>>1]&-2|a[e+16>>0]&1;return}function fU(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=c[b>>2]|0;if(e|0)c[a+16>>2]=e;e=c[b+4>>2]|0;if(e|0)c[a+20>>2]=e;d=+h[b+16>>3];if(d>=0.0)h[a+32>>3]=d;return}function gU(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0,i=0;f=l;l=l+64|0;g=f+32|0;i=f;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];h[i+16>>3]=+h[b>>3]+d;h[i+24>>3]=+h[b+8>>3]+e;c[g>>2]=c[i>>2];c[g+4>>2]=c[i+4>>2];c[g+8>>2]=c[i+8>>2];c[g+12>>2]=c[i+12>>2];c[g+16>>2]=c[i+16>>2];c[g+20>>2]=c[i+20>>2];c[g+24>>2]=c[i+24>>2];c[g+28>>2]=c[i+28>>2];oS(a,g,1);l=f;return}function hU(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0.0;i=l;l=l+64|0;g=i;k=+h[e>>3];n=k+ +h[d>>3];m=+h[e+8>>3];j=m+ +h[d+8>>3];k=k+ +h[d+16>>3];m=m+ +h[d+24>>3];h[g>>3]=k;h[g+8>>3]=m;h[g+32>>3]=n;h[g+40>>3]=j;h[g+16>>3]=n;h[g+24>>3]=m;h[g+48>>3]=k;h[g+56>>3]=j;f=c[d+36>>2]|0;if(!f)f=c[e+56>>2]|0;e=c[d+32>>2]|0;if(!e)qa(137334,137342,623,137354);if(!(a[e>>0]|0))qa(137368,137342,624,137354);else {sS(b,e,g,4,1,f);l=i;return}}function iU(d,e,f,g,i,j,k,m){d=d|0;e=e|0;f=f|0;g=g|0;i=+i;j=j|0;k=k|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0,K=0,L=0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0;R=l;l=l+128|0;K=R+104|0;O=R+48|0;P=R+16|0;L=R;J=L;c[J>>2]=0;c[J+4>>2]=0;M=+h[g>>3];N=M-i;I=M+i;J=L+8|0;h[J>>3]=(+h[k+24>>3]-+h[k+8>>3])*.5+ +h[g+8>>3];eS(d,1);D=P+16|0;E=P+4|0;F=P+24|0;G=O+4|0;H=O+16|0;s=(m|0)==0;t=O+24|0;u=O+8|0;v=O+32|0;w=O+40|0;x=O+48|0;y=j+16|0;z=j+4|0;A=P+8|0;q=0;while(1){if((q|0)>=(e|0))break;switch(a[f+(q*24|0)+6>>0]|0){case 108:{i=N;break}case 114:{i=I-+h[f+(q*24|0)+8>>3];break}default:i=M-+h[f+(q*24|0)+8>>3]*.5;}h[g>>3]=i;B=f+(q*24|0)+16|0;h[J>>3]=+h[J>>3]-+h[B>>3];C=f+(q*24|0)+4|0;p=c[f+(q*24|0)>>2]|0;r=0;while(1){if((r|0)>=(b[C>>1]|0))break;o=p+4|0;m=c[o>>2]|0;if(m){h[D>>3]=+h[(+h[m+16>>3]>0.0?m:j)+16>>3];c[P>>2]=c[((c[m>>2]|0)==0?j:m)>>2];k=c[((c[m+4>>2]|0)==0?j:m)+4>>2]|0;c[E>>2]=k;m=c[m+24>>2]&127;if(!m)Q=12;else m=c[F>>2]&-128|m;}else {h[D>>3]=+h[y>>3];c[P>>2]=c[j>>2];k=c[z>>2]|0;c[E>>2]=k;Q=12;}if((Q|0)==12){Q=0;m=c[F>>2]&-128;}c[F>>2]=m;hS(d,k);c[O>>2]=c[p>>2];c[G>>2]=P;h[H>>3]=+h[p+16>>3];if(s)n=1.0;else n=+h[p+24>>3];h[t>>3]=n;c[A>>2]=c[(c[o>>2]|0)+8>>2];c[u>>2]=c[p+8>>2];o=p+32|0;h[v>>3]=+h[o>>3];h[w>>3]=+h[B>>3];a[x>>0]=108;h[L>>3]=i;c[K>>2]=c[L>>2];c[K+4>>2]=c[L+4>>2];c[K+8>>2]=c[L+8>>2];c[K+12>>2]=c[L+12>>2];gS(d,K,O);n=+h[o>>3]+i;h[g>>3]=n;p=p+56|0;r=r+1|0;i=n;}q=q+1|0;}fS(d);l=R;return}function jU(a){a=a|0;U1(c[a>>2]|0);U1(c[a+4>>2]|0);U1(c[a+8>>2]|0);U1(c[a+16>>2]|0);U1(c[a+12>>2]|0);U1(c[a+20>>2]|0);U1(c[a+24>>2]|0);return}function kU(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(a|0){j=a+4|0;e=0;g=c[a>>2]|0;while(1){if((e|0)>=(b[j>>1]|0))break;k=g+4|0;d=0;f=c[g>>2]|0;while(1){if((d|0)>=(b[k>>1]|0))break;U1(c[f>>2]|0);h=c[f+8>>2]|0;if(h|0?(i=c[f+12>>2]|0,i|0):0)tb[i&127](h);d=d+1|0;f=f+56|0;}e=e+1|0;g=g+24|0;}d=c[a>>2]|0;if(d|0)U1(d);U1(a);}return}function lU(a){a=a|0;U1(c[a+32>>2]|0);U1(a);return}function mU(b,d){b=b|0;d=d|0;switch(a[b+4>>0]|0){case 1:{nU(c[b>>2]|0);break}case 3:{lU(c[b>>2]|0);break}default:kU(c[b>>2]|0);}if(d|0)U1(b);return}function nU(a){a=a|0;var b=0,d=0,e=0;e=a+84|0;if((c[a+100>>2]|0)==-1)Rz(c[e>>2]|0)|0;else {b=c[e>>2]|0;U1(c[a+92>>2]|0);U1(c[a+96>>2]|0);while(1){d=c[b>>2]|0;if(!d)break;oU(d);b=b+4|0;}U1(c[e>>2]|0);}jU(a);U1(a);return}function oU(a){a=a|0;mU(a+88|0,0);jU(a);U1(a);return}function pU(b,e,f){b=b|0;e=e|0;f=f|0;var g=0;b=c[(c[(c[b+16>>2]|0)+104>>2]|0)+72>>2]|0;if((a[b+4>>0]|0)!=2?(g=qU(c[b>>2]|0,e)|0,(g|0)!=0):0){c[f>>2]=d[g+35>>0];b=g+48|0;}else b=0;return b|0}function qU(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+4>>2]|0;if(!((d|0)!=0?(c3(d,b)|0)==0:0))e=3;a:do if((e|0)==3){d=c[a+84>>2]|0;while(1){a=c[d>>2]|0;if(!a){a=0;break a}a=rU(a,b)|0;if(!a)d=d+4|0;else break}}while(0);return a|0}function rU(b,d){b=b|0;d=d|0;var e=0;e=c[b+4>>2]|0;if(!((e|0)!=0?(c3(e,d)|0)==0:0))if((a[b+92>>0]|0)==1)b=qU(c[b+88>>2]|0,d)|0;else b=0;return b|0}function sU(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0}function tU(d){d=d|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=d+92|0;c[p>>2]=JK((c[d+100>>2]<<2)+4|0)|0;n=JK((c[d+104>>2]<<2)+4|0)|0;c[d+96>>2]=n;o=d+32|0;m=c[d+84>>2]|0;while(1){l=c[m>>2]|0;if(!l)break;d=b[l+82>>1]|0;f=+h[l+72>>3];if(d<<16>>16==1)i=~~f;else {i=~~((f-+(O((a[o>>0]|0)+-1|0,(d&65535)+-1|0)|0))/+(d&65535));i=(i|0)>1?i:1;}j=b[l+80>>1]|0;f=+h[l+64>>3];if(j<<16>>16==1)k=~~f;else {k=~~((f-+(O((a[o>>0]|0)+-1|0,(j&65535)+-1|0)|0))/+(j&65535));k=(k|0)>1?k:1;}q=e[l+86>>1]|0;g=(d&65535)+q|0;d=q;while(1){if((d|0)>=(g|0))break;q=(c[p>>2]|0)+(d<<2)|0;r=c[q>>2]|0;c[q>>2]=(r|0)>(i|0)?r:i;d=d+1|0;}d=e[l+84>>1]|0;g=(j&65535)+d|0;while(1){if((d|0)>=(g|0))break;r=n+(d<<2)|0;q=c[r>>2]|0;c[r>>2]=(q|0)>(k|0)?q:k;d=d+1|0;}m=m+4|0;}return}function uU(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;if(a>>>0<21)a=c[55840+(a<<2)>>2]|0;else {c[b>>2]=a;m4(194959,137395,b)|0;a=194959;}l=d;return a|0}function vU(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=a+104|0;l=a+100|0;j=d+16|0;f=0;g=0;while(1){if((f|0)>(c[k>>2]|0))break;i=tC(d,uU(f)|0,1)|0;TC(i,137447,304,1)|0;m=i+16|0;c[(c[m>>2]|0)+176>>2]=0;o=JK((c[l>>2]<<2)+4|0)|0;n=c[m>>2]|0;c[n+172>>2]=o;c[n+184>>2]=0;n=JK((c[l>>2]<<2)+4|0)|0;c[(c[m>>2]|0)+180>>2]=n;if(!g)c[(c[j>>2]|0)+192>>2]=i;else c[(c[g+16>>2]|0)+164>>2]=i;f=f+1|0;g=i;}j=b+16|0;f=0;g=0;while(1){if((f|0)>(c[l>>2]|0))break;i=tC(b,uU(f)|0,1)|0;TC(i,137447,304,1)|0;o=i+16|0;c[(c[o>>2]|0)+176>>2]=0;m=JK((c[k>>2]<<2)+4|0)|0;n=c[o>>2]|0;c[n+172>>2]=m;c[n+184>>2]=0;n=JK((c[k>>2]<<2)+4|0)|0;c[(c[o>>2]|0)+180>>2]=n;if(!g)c[(c[j>>2]|0)+192>>2]=i;else c[(c[g+16>>2]|0)+164>>2]=i;f=f+1|0;g=i;}f=c[a+84>>2]|0;while(1){g=c[f>>2]|0;if(!g)break;o=g+84|0;n=tC(d,uU(e[o>>1]|0)|0,0)|0;o=tC(d,uU((e[g+80>>1]|0)+(e[o>>1]|0)|0)|0,0)|0;wU(d,n,o,~~+h[g+64>>3]);o=g+86|0;n=tC(b,uU(e[o>>1]|0)|0,0)|0;o=tC(b,uU((e[g+82>>1]|0)+(e[o>>1]|0)|0)|0,0)|0;wU(b,n,o,~~+h[g+72>>3]);f=f+4|0;}xU(d);xU(b);return}function wU(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0;h=iB(a,d,f,0,0)|0;if(!h){i=iB(a,d,f,0,1)|0;TC(i,137460,176,1)|0;b[(c[i+16>>2]|0)+170>>1]=g;d=d+16|0;a=c[d>>2]|0;h=c[a+180>>2]|0;if(!h)a=KK((c[a+184>>2]<<2)+8|0)|0;else a=MK(h,(c[a+184>>2]<<2)+8|0)|0;g=c[d>>2]|0;c[g+180>>2]=a;g=g+184|0;h=c[g>>2]|0;c[g>>2]=h+1;c[a+(h<<2)>>2]=i;d=c[d>>2]|0;c[(c[d+180>>2]|0)+(c[d+184>>2]<<2)>>2]=0;d=f+16|0;a=c[d>>2]|0;h=c[a+172>>2]|0;if(!h)a=KK((c[a+176>>2]<<2)+8|0)|0;else a=MK(h,(c[a+176>>2]<<2)+8|0)|0;g=c[d>>2]|0;c[g+172>>2]=a;g=g+176|0;f=c[g>>2]|0;c[g>>2]=f+1;c[a+(f<<2)>>2]=i;i=c[d>>2]|0;c[(c[i+172>>2]|0)+(c[i+176>>2]<<2)>>2]=0;}else {i=(c[h+16>>2]|0)+170|0;f=e[i>>1]|0;b[i>>1]=(f|0)>(g|0)?f:g;}return}function xU(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[(c[a+16>>2]|0)+192>>2]|0;while(1){f=d+16|0;h=c[(c[f>>2]|0)+164>>2]|0;if(!h)break;if(iB(a,d,h,0,0)|0){d=h;continue}g=iB(a,d,h,0,1)|0;TC(g,137460,176,1)|0;b[(c[g+16>>2]|0)+170>>1]=0;d=c[f>>2]|0;e=c[d+180>>2]|0;if(!e)d=KK((c[d+184>>2]<<2)+8|0)|0;else d=MK(e,(c[d+184>>2]<<2)+8|0)|0;i=c[f>>2]|0;c[i+180>>2]=d;i=i+184|0;e=c[i>>2]|0;c[i>>2]=e+1;c[d+(e<<2)>>2]=g;f=c[f>>2]|0;c[(c[f+180>>2]|0)+(c[f+184>>2]<<2)>>2]=0;f=h+16|0;d=c[f>>2]|0;e=c[d+172>>2]|0;if(!e)d=KK((c[d+176>>2]<<2)+8|0)|0;else d=MK(e,(c[d+176>>2]<<2)+8|0)|0;e=c[f>>2]|0;c[e+172>>2]=d;e=e+176|0;i=c[e>>2]|0;c[e>>2]=i+1;c[d+(i<<2)>>2]=g;d=c[f>>2]|0;c[(c[d+172>>2]|0)+(c[d+176>>2]<<2)>>2]=0;d=h;}return}function yU(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=a+92|0;e=0;f=0;b=c[(c[(c[b+16>>2]|0)+192>>2]|0)+16>>2]|0;while(1){b=c[b+164>>2]|0;if(!b)break;b=c[b+16>>2]|0;h=b+232|0;c[(c[g>>2]|0)+(f<<2)>>2]=(c[h>>2]|0)-e;e=c[h>>2]|0;f=f+1|0;}a=a+96|0;e=0;f=0;b=c[(c[(c[d+16>>2]|0)+192>>2]|0)+16>>2]|0;while(1){b=c[b+164>>2]|0;if(!b)break;b=c[b+16>>2]|0;h=b+232|0;c[(c[a>>2]|0)+(f<<2)>>2]=(c[h>>2]|0)-e;e=c[h>>2]|0;f=f+1|0;}return}function zU(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h+4|0;d=h;c[d>>2]=c[4647];e=c[b+100>>2]|0;if((e|0)!=1?(f=b+104|0,(c[f>>2]|0)!=1):0){c[b+92>>2]=JK((e<<2)+4|0)|0;c[b+96>>2]=JK((c[f>>2]<<2)+4|0)|0;a[g>>0]=a[d>>0]|0;a[g+1>>0]=a[d+1>>0]|0;a[g+2>>0]=a[d+2>>0]|0;a[g+3>>0]=a[d+3>>0]|0;f=oB(137473,g,0)|0;a[g>>0]=a[d>>0]|0;a[g+1>>0]=a[d+1>>0]|0;a[g+2>>0]=a[d+2>>0]|0;a[g+3>>0]=a[d+3>>0]|0;g=oB(137478,g,0)|0;TC(f,137483,280,1)|0;TC(g,137483,280,1)|0;vU(b,f,g);uL(f,2,2147483647)|0;uL(g,2,2147483647)|0;yU(b,f,g);AU(f,g);}else tU(b);l=h;return}function AU(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=(c[b+16>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;f=d+16|0;d=c[f>>2]|0;e=c[d+172>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+180>>2]|0;if(e){U1(e);d=c[f>>2]|0;}d=d+164|0;}sB(a)|0;sB(b)|0;return}function BU(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0;p=l;l=l+272|0;n=p+104|0;o=p+136|0;j=p+72|0;k=p;g=p+144|0;c[k+48>>2]=b;switch(IC(b)|0){case 0:{e=c[b+60>>2]|0;break}case 1:{e=xC(b)|0;break}case 2:{e=xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;break}default:{}}i=k+52|0;c[i>>2]=e;m=c[e+60>>2]|0;h[k+32>>3]=+h[d+16>>3];c[k+16>>2]=c[d+4>>2];c[k+20>>2]=c[d+8>>2];c[k+40>>2]=0;f=LW(c[d>>2]|0,o,k)|0;if(!f){kA(n,128,g);a[d+82>>0]=0;e=D4(CU(b,n)|0)|0;c[d>>2]=e;if((c[d+12>>2]|0)==1)e=eQ(e)|0;else e=bQ(e,c[i>>2]|0)|0;U1(c[d>>2]|0);c[d>>2]=e;xK(c[(c[m+16>>2]|0)+144>>2]|0,d);oA(n);e=c[o>>2]|0;}else {e=f+4|0;if((a[e>>0]|0)==1){if((c[(c[f>>2]|0)+24>>2]|0)==0?DU(b)|0:0){i=D4(DU(b)|0)|0;c[(c[f>>2]|0)+24>>2]=i;}m=EU(m,c[f>>2]|0,0,k)|0;c[o>>2]=c[o>>2]|m;m=c[f>>2]|0;r=+h[m+64>>3]*.5;q=+h[m+72>>3]*.5;FU(j,-r,-q,r,q);m=c[f>>2]|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[n+16>>2]=c[j+16>>2];c[n+20>>2]=c[j+20>>2];c[n+24>>2]=c[j+24>>2];c[n+28>>2]=c[j+28>>2];GU(m,n,15);}else {HU(c[(c[m+16>>2]|0)+144>>2]|0,c[f>>2]|0,k);n=c[f>>2]|0;q=+h[n+24>>3]*.5;r=+h[n+32>>3]*.5;FU(j,-q,-r,q,r);n=(c[f>>2]|0)+8|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[n+16>>2]=c[j+16>>2];c[n+20>>2]=c[j+20>>2];c[n+24>>2]=c[j+24>>2];c[n+28>>2]=c[j+28>>2];}h[d+24>>3]=+h[j+16>>3]-+h[j>>3];h[d+32>>3]=+h[j+24>>3]-+h[j+8>>3];c[d+72>>2]=f;if((a[e>>0]|0)==1){U1(c[d>>2]|0);c[d>>2]=D4(141611)|0;}e=c[o>>2]|0;}l=p;return e|0}function CU(b,d){b=b|0;d=d|0;var e=0;a:do switch(IC(b)|0){case 0:{nA(d,KB(b)|0)|0;break}case 1:{nA(d,KB(b)|0)|0;break}case 2:{nA(d,KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)|0;e=b+-48|0;nA(d,KB(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)|0)|0;if(!(xB(xC(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)|0)|0)){nA(d,141747)|0;break a}else {nA(d,137738)|0;break a}}default:{}}while(0);e=d+4|0;b=c[e>>2]|0;if(b>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;b=c[e>>2]|0;}a[b>>0]=0;d=c[d>>2]|0;c[e>>2]=d;return d|0}function DU(b){b=b|0;var c=0,d=0;c=QA(b,137729)|0;if(!((c|0)!=0?(a[c>>0]|0)!=0:0))d=3;do if((d|0)==3){c=QA(b,140823)|0;if(c|0?a[c>>0]|0:0)break;c=0;}while(0);return c|0}function EU(f,g,i,j){f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+16|0;u=w+8|0;t=w;v=g+108|0;k=c[v>>2]|0;if(k|0)ZT(j,k,186576);c[g+80>>2]=i;k=LU(f,g,j)|0;r=g+36|0;f=b[r>>1]|0;if(!(f&128))a[g+32>>0]=2;i=g+33|0;if(!(f&32))a[i>>0]=1;zU(g);n=c[g+104>>2]|0;p=a[g+32>>0]|0;f=O(n+1|0,p)|0;o=d[i>>0]<<1;q=c[g+100>>2]|0;p=O(q+1|0,p)|0;m=g+96|0;f=o+f|0;i=0;while(1){if((i|0)>=(n|0))break;f=(c[(c[m>>2]|0)+(i<<2)>>2]|0)+f|0;i=i+1|0;}n=g+92|0;i=p+o|0;m=0;while(1){if((m|0)>=(q|0))break;i=(c[(c[n>>2]|0)+(m<<2)>>2]|0)+i|0;m=m+1|0;}n=g+38|0;do if(b[r>>1]&1){r=b[n>>1]|0;m=r&65535;if(r<<16>>16?(s=b[g+40>>1]|0,s<<16>>16):0){if(!((f|0)>(m|0)|(i|0)>(s&65535|0))){i=0;f=0;break}gA(0,137529,t)|0;k=1;i=0;f=0;break}gA(0,137563,u)|0;k=1;}while(0);u=e[n>>1]|0;h[g+64>>3]=+(((f|0)>(u|0)?f:u)|0);u=e[g+40>>1]|0;h[g+72>>3]=+(((i|0)>(u|0)?i:u)|0);if(c[v>>2]|0)fU(j,186576);l=w;return k|0}function FU(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function GU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0;I=l;l=l+64|0;G=I+32|0;H=I;E=c[e+84>>2]|0;k=c[e+80>>2]|0;if((k|0?(i=c[k+24>>2]|0,i|0):0)?(j=e+24|0,(c[j>>2]|0)==0):0)c[j>>2]=D4(i)|0;F=e+48|0;i=f+16|0;n=+h[i>>3];m=+h[f>>3];k=~~(n-m-+(~~+h[e+64>>3]|0));if((k|0)<=-1)qa(137496,137342,1761,137506);o=f+24|0;y=+h[o>>3];p=f+8|0;q=+h[p>>3];r=+(~~+h[e+72>>3]|0);s=~~(y-q-r);if((s|0)<=-1)qa(137519,137342,1764,137506);t=b[e+36>>1]|0;j=t&65535;a:do if(j&1){b:do if((k|0)>0)switch(j&6){case 4:{h[i>>3]=m+r;break b}case 2:{J=+(k|0);h[i>>3]=n+J;m=m+J;h[f>>3]=m;break b}default:{J=+(k>>>1|0);m=m+J;h[f>>3]=m;h[i>>3]=n-J;break b}}while(0);if((s|0)>0)switch(t&24){case 16:{y=q+r;h[o>>3]=y;s=0;i=0;break a}case 8:{J=+(s|0);y=y+J;h[o>>3]=y;h[p>>3]=q+J;s=0;i=0;break a}default:{J=+(s>>>1|0);h[p>>3]=q+J;y=y-J;h[o>>3]=y;s=0;i=0;break a}}else {s=0;i=0;}}else i=k;while(0);n=+(d[e+33>>0]|0);C=e+32|0;u=a[C>>0]|0;q=+(u<<24>>24);D=e+104|0;k=c[D>>2]|0;t=(i|0)/(k|0)|0;o=i-(O(t,k)|0)|0;o=~~(((o|0)>-1?.5:-.5)+ +(o|0));B=e+96|0;p=u<<24>>24;i=~~(m+n+q);j=0;while(1){if((j|0)>(k|0))break;A=(c[B>>2]|0)+(j<<2)|0;k=c[A>>2]|0;c[A>>2]=i;i=i+t+((j|0)<(o|0)&1)+k+p|0;j=j+1|0;k=c[D>>2]|0;}A=e+100|0;k=c[A>>2]|0;t=(s|0)/(k|0)|0;p=s-(O(t,k)|0)|0;p=~~(((p|0)>-1?.5:-.5)+ +(p|0));z=e+92|0;o=u<<24>>24;i=~~(y-n-q);j=0;while(1){if((j|0)>(k|0))break;x=(c[z>>2]|0)+(j<<2)|0;k=c[x>>2]|0;c[x>>2]=i;i=i-t+(((j|0)<(p|0))<<31>>31)-k-o|0;j=j+1|0;k=c[A>>2]|0;}u=(g|0)==0;v=H+16|0;w=H+24|0;x=H+8|0;i=E;while(1){o=c[i>>2]|0;if(!o)break;k=b[o+84>>1]|0;if(u){j=0;p=b[o+80>>1]|0;s=b[o+86>>1]|0;t=b[o+82>>1]|0;}else {j=k<<16>>16==0?8:0;s=b[o+86>>1]|0;j=s<<16>>16==0?j|4:j;p=b[o+80>>1]|0;t=b[o+82>>1]|0;j=(((p&65535)+(k&65535)|0)==(c[D>>2]|0)?j|2:j)|((t&65535)+(s&65535)|0)==(c[A>>2]|0);}K=c[B>>2]|0;k=k&65535;h[H>>3]=+(c[K+(k<<2)>>2]|0);E=a[C>>0]|0;h[v>>3]=+((c[K+((p&65535)+k<<2)>>2]|0)-E|0);p=c[z>>2]|0;h[w>>3]=+(c[p+((s&65535)<<2)>>2]|0);h[x>>3]=+((c[p+((t&65535)+(s&65535)<<2)>>2]|0)+E|0);c[G>>2]=c[H>>2];c[G+4>>2]=c[H+4>>2];c[G+8>>2]=c[H+8>>2];c[G+12>>2]=c[H+12>>2];c[G+16>>2]=c[H+16>>2];c[G+20>>2]=c[H+20>>2];c[G+24>>2]=c[H+24>>2];c[G+28>>2]=c[H+28>>2];IU(o,G,j&g);i=i+4|0;}a[e+35>>0]=g;c[F>>2]=c[f>>2];c[F+4>>2]=c[f+4>>2];c[F+8>>2]=c[f+8>>2];c[F+12>>2]=c[f+12>>2];c[F+16>>2]=c[f+16>>2];c[F+20>>2]=c[f+20>>2];c[F+24>>2]=c[f+24>>2];c[F+28>>2]=c[f+28>>2];l=I;return}function HU(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0.0,Q=0.0,R=0.0;O=l;l=l+112|0;H=O+48|0;I=O+16|0;J=O;c[I>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;c[I+12>>2]=0;c[I+16>>2]=0;c[I+20>>2]=0;c[I+24>>2]=0;c[I+28>>2]=0;K=e+4|0;L=f+16|0;M=f+32|0;N=I+16|0;r=b[K>>1]|0;n=r<<16>>16;g=0;j=-1.0;m=0;while(1){if((m|0)>=(n|0)){g=1;break}i=c[e>>2]|0;if((b[i+(m*24|0)+4>>1]|0)>1){g=0;break}i=c[(c[i+(m*24|0)>>2]|0)+4>>2]|0;if(!i){k=+h[M>>3];h[N>>3]=k;i=L;}else {if(c[i+24>>2]&127|0){g=0;break}k=+h[(+h[i+16>>3]>0.0?i:L)+16>>3];h[N>>3]=k;i=(c[i>>2]|0)==0?L:i;}i=c[i>>2]|0;c[I>>2]=i;if(!(j==-1.0)){if(k!=j){g=0;break}}else j=k;if(g){if(s2(i,g)|0){g=0;break}}else g=i;m=m+1|0;}a[e+6>>0]=g;E=f+48|0;F=f+20|0;G=I+4|0;w=f+40|0;x=I+24|0;y=d+144|0;z=H+4|0;v=J+8|0;A=H+16|0;B=H+24|0;C=H+8|0;D=H+12|0;f=(g|0)==0;j=0.0;s=0.0;t=0.0;u=0.0;n=0;g=r;while(1){if((n|0)>=(g<<16>>16|0))break;k=0.0;q=0.0;m=0;p=0.0;j=0.0;i=c[e>>2]|0;while(1){if((m|0)>=(b[i+(n*24|0)+4>>1]|0))break;c[H>>2]=EK(c[(c[i+(n*24|0)>>2]|0)+(m*56|0)>>2]|0,c[E>>2]|0)|0;i=(c[e>>2]|0)+(n*24|0)|0;g=c[(c[i>>2]|0)+(m*56|0)+4>>2]|0;if(!g){h[N>>3]=+h[M>>3];c[I>>2]=c[L>>2];c[G>>2]=c[F>>2];c[x>>2]=c[x>>2]&-128|c[w>>2]&127;}else {g=c[g+24>>2]&127;if(!g)g=c[w>>2]&127;c[x>>2]=c[x>>2]&-128|g;r=c[(c[i>>2]|0)+(m*56|0)+4>>2]|0;h[N>>3]=+h[(+h[r+16>>3]>0.0?r:L)+16>>3];c[I>>2]=c[((c[r>>2]|0)==0?L:r)>>2];c[G>>2]=c[((c[r+4>>2]|0)==0?L:r)+4>>2];}i=c[y>>2]|0;c[z>>2]=nb[c[i>>2]&63](i,I,1)|0;LO(J,d,H);Q=+h[J>>3];o=+h[v>>3];U1(c[(c[(c[e>>2]|0)+(n*24|0)>>2]|0)+(m*56|0)>>2]|0);i=c[e>>2]|0;r=c[i+(n*24|0)>>2]|0;c[r+(m*56|0)>>2]=c[H>>2];h[r+(m*56|0)+32>>3]=Q;h[r+(m*56|0)+16>>3]=+h[A>>3];h[r+(m*56|0)+24>>3]=+h[B>>3];c[r+(m*56|0)+4>>2]=c[z>>2];c[r+(m*56|0)+8>>2]=c[C>>2];c[r+(m*56|0)+12>>2]=c[D>>2];P=+h[N>>3];R=+h[B>>3];k=R>k?R:k;q=Q+q;m=m+1|0;p=P>p?P:p;j=o>j?o:j;}h[i+(n*24|0)+8>>3]=q;g=(n|0)==0;do if(f)if(g){o=p;k=p-k;g=i;break}else {o=p;k=t-u+p-k;g=i+(n*24|0)|0;break}else {o=j;k=g?p:j;g=i+(n*24|0)|0;}while(0);h[g+16>>3]=k;s=q>s?q:s;t=o+t;u=+h[i+(n*24|0)+16>>3]+u;n=n+1|0;g=b[K>>1]|0;}h[e+24>>3]=s;h[e+32>>3]=g<<16>>16==1?j:t;l=O;return}function IU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0;y=l;l=l+64|0;v=y+32|0;x=y;j=e+24|0;if((c[j>>2]|0)==0?(i=c[(c[e+96>>2]|0)+24>>2]|0,i|0):0)c[j>>2]=D4(i)|0;t=e+36|0;w=b[t>>1]|0;i=w&65535;a:do if(i&1){k=+h[e+64>>3];q=+h[e+72>>3];j=f+16|0;m=+h[j>>3];o=+h[f>>3];n=m-o-k;b:do if(n>0.0)switch(i&6){case 4:{m=o+k;h[j>>3]=m;k=o;break b}case 2:{m=n+m;h[j>>3]=m;k=o+n;h[f>>3]=k;break b}default:{p=n*.5;k=p+o;h[f>>3]=k;m=m-p;h[j>>3]=m;break b}}else k=o;while(0);i=f+24|0;p=+h[i>>3];j=f+8|0;n=+h[j>>3];o=p-n-q;if(o>0.0)switch(w&24){case 16:{o=n+q;h[i>>3]=o;break a}case 8:{q=o+p;h[i>>3]=q;n=n+o;h[j>>3]=n;o=q;break a}default:{o=o*.5;n=o+n;h[j>>3]=n;o=p-o;h[i>>3]=o;break a}}else o=p;}else {k=+h[f>>3];n=+h[f+8>>3];m=+h[f+16>>3];o=+h[f+24>>3];}while(0);s=e+48|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];c[s+16>>2]=c[f+16>>2];c[s+20>>2]=c[f+20>>2];c[s+24>>2]=c[f+24>>2];c[s+28>>2]=c[f+28>>2];a[e+35>>0]=g;A=+(d[e+33>>0]|0);z=+(d[e+34>>0]|0);p=k+A+z;h[x>>3]=p;q=n+A+z;s=x+8|0;h[s>>3]=q;n=m-A-z;f=x+16|0;h[f>>3]=n;o=o-A-z;r=x+24|0;h[r>>3]=o;j=e+88|0;switch(a[e+92>>0]|0){case 1:{w=c[j>>2]|0;c[v>>2]=c[x>>2];c[v+4>>2]=c[x+4>>2];c[v+8>>2]=c[x+8>>2];c[v+12>>2]=c[x+12>>2];c[v+16>>2]=c[x+16>>2];c[v+20>>2]=c[x+20>>2];c[v+24>>2]=c[x+24>>2];c[v+28>>2]=c[x+28>>2];GU(w,v,g);break}case 3:{i=c[j>>2]|0;k=+h[i+24>>3];m=n-p-+h[i+16>>3];c:do if(m>0.0)switch(w&6){case 4:{h[f>>3]=n-m;break c}case 2:{h[x>>3]=m+p;break c}default:break c}while(0);k=o-q-k;d:do if(k>0.0)switch(w&24){case 16:{h[r>>3]=o-k;break d}case 8:{h[s>>3]=k+q;break d}default:break d}while(0);c[v>>2]=c[x>>2];c[v+4>>2]=c[x+4>>2];c[v+8>>2]=c[x+8>>2];c[v+12>>2]=c[x+12>>2];c[v+16>>2]=c[x+16>>2];c[v+20>>2]=c[x+20>>2];c[v+24>>2]=c[x+24>>2];c[v+28>>2]=c[x+28>>2];JU(i,v);break}default:{i=c[j>>2]|0;k=+h[i+32>>3];m=n-p-+h[i+24>>3];e:do if(m>0.0?(u=w&6,u<<16>>16!=6):0)switch(u&7){case 4:{h[f>>3]=n-m;break e}case 2:{h[x>>3]=m+p;break e}default:{A=m*.5;h[x>>3]=A+p;h[f>>3]=n-A;break e}}while(0);k=o-q-k;f:do if(k>0.0)switch(w&24){case 16:{h[r>>3]=o-k;break f}case 8:{h[s>>3]=k+q;break f}default:{A=k*.5;h[s>>3]=A+q;h[r>>3]=o-A;break f}}while(0);w=i+8|0;c[w>>2]=c[x>>2];c[w+4>>2]=c[x+4>>2];c[w+8>>2]=c[x+8>>2];c[w+12>>2]=c[x+12>>2];c[w+16>>2]=c[x+16>>2];c[w+20>>2]=c[x+20>>2];c[w+24>>2]=c[x+24>>2];c[w+28>>2]=c[x+28>>2];x=b[t>>1]&768;KU(c[j>>2]|0,(x&1023)==512?108:(x&1023)==256?114:110);}}l=y;return}function JU(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];return}function KU(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;g=b[d+4>>1]|0;f=0;while(1){if((f|0)>=(g|0))break;h=(c[d>>2]|0)+(f*24|0)+6|0;if(!(a[h>>0]|0))a[h>>0]=e;f=f+1|0;}return}function LU(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;l=f+84|0;t=c[l>>2]|0;u=KL()|0;v=PU()|0;i=0;h=0;k=Tz(t)|0;while(1){if(!k)break;j=Tz(c[k+8>>2]|0)|0;while(1){if(!j)break;j=c[j>>2]|0;i=i+1|0;}h=h+1|0;if(a[k+12>>0]|0)TU(v,h);k=c[k>>2]|0;}h=JK((i<<2)+4|0)|0;c[l>>2]=h;i=0;j=0;k=0;q=0;r=Tz(t)|0;while(1){if(!r)break;s=q&65535;p=0;o=Tz(c[r+8>>2]|0)|0;while(1){if(!o)break;n=c[o+8>>2]|0;c[h>>2]=n;k=MU(d,n,f,g)|0|k;l=NU(u,q,p,n)|0;b[n+86>>1]=s;b[n+84>>1]=l;l=l+(e[n+80>>1]|0)|0;m=q+(e[n+82>>1]|0)|0;if(UU(v,m)|0){p=n+100|0;a[p>>0]=a[p>>0]|2;}p=l;h=h+4|0;o=c[o>>2]|0;i=(l|0)>(i|0)?l:i;j=(m|0)>(j|0)?m:j;}q=q+1|0;r=c[r>>2]|0;}c[f+100>>2]=j;c[f+104>>2]=i;Rz(t)|0;Rz(v)|0;NL(u);return k|0}function MU(f,g,i,j){f=f|0;g=g|0;i=i|0;j=j|0;var k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+16|0;t=u+8|0;s=u;c[g+96>>2]=i;q=g+36|0;o=b[q>>1]|0;if(!(o&64)){if(!(b[i+36>>1]&64))n=2;else n=a[i+34>>0]|0;a[g+34>>0]=n;}if(!(o&32)){n=a[i+88>>0]|0;if(n<<24>>24<=-1)if(!(b[i+36>>1]&32))n=1;else n=a[i+33>>0]|0;a[g+33>>0]=n;}n=g+88|0;p=g+92|0;switch(a[p>>0]|0){case 1:{o=EU(f,c[n>>2]|0,g,j)|0;i=c[n>>2]|0;n=o;o=i+64|0;i=i+72|0;break}case 3:{o=OU(c[n>>2]|0,j)|0;i=c[n>>2]|0;n=o;o=i+16|0;i=i+24|0;break}default:{HU(c[(c[f+16>>2]|0)+144>>2]|0,c[n>>2]|0,j);i=c[n>>2]|0;n=0;o=i+24|0;i=i+32|0;}}k=+((d[g+33>>0]|0)+(d[g+34>>0]|0)<<1|0);m=+h[o>>3]+k;k=+h[i>>3]+k;i=g+38|0;do if(b[q>>1]&1){o=b[i>>1]|0;if(o<<16>>16?(r=b[g+40>>1]|0,r<<16>>16):0){if(!(m>+(o&65535)|k>+(r&65535))){m=0.0;k=0.0;break}if((a[p>>0]|0)==3){m=0.0;k=0.0;break}gA(0,137614,s)|0;n=1;m=0.0;k=0.0;break}gA(0,137647,t)|0;n=1;}while(0);v=+(e[i>>1]|0);h[g+64>>3]=m>v?m:v;m=+(e[g+40>>1]|0);h[g+72>>3]=k>m?k:m;l=u;return n|0}function NU(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var f=0,g=0,h=0,i=0,j=0;j=d+80|0;i=(e[j>>1]|0)+-1|0;h=0;a:while(1){f=c;while(1){if(h)break a;g=i+f|0;while(1){if((g|0)<(f|0)){c=f;h=1;continue a}if(SL(a,g,b)|0)break;g=g+-1|0;}f=g+1|0;}}h=d+82|0;f=c;while(1){if((f|0)<(c+(e[j>>1]|0)|0))g=b;else break;while(1){if((g|0)>=((e[h>>1]|0)+b|0))break;QL(a,f,g);g=g+1|0;}f=f+1|0;}return c|0}function OU(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;j=m;i=m+8|0;d=d+52|0;g=b+32|0;RF(i,c[d>>2]|0,c[g>>2]|0);k=c[i>>2]|0;i=c[i+4>>2]|0;if((i&k|0)==-1){c[j>>2]=c[g>>2];gA(1,137697,j)|0;d=1;f=0.0;e=0.0;}else {a[(c[(c[d>>2]|0)+16>>2]|0)+114>>0]=1;d=0;f=+(i|0);e=+(k|0);}c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;h[b+16>>3]=e;h[b+24>>3]=f;l=m;return d|0}function PU(){return Vz(55924,c[4581]|0)|0}function QU(a,b,d){a=a|0;b=b|0;d=d|0;d=JK(12)|0;c[d>>2]=c[b>>2];return d|0}function RU(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function SU(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return ((b|0)>(e|0)?1:((b|0)<(e|0))<<31>>31)|0}function TU(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;nb[c[a>>2]&63](a,e,1)|0;l=d;return}function UU(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;b=(nb[c[a>>2]&63](a,e,512)|0)!=0&1;l=d;return b|0}function VU(a){a=a|0;var b=0;if(!(c[47375]|0)){b=JK((a<<2)+4|0)|0;c[47375]=b;c[b>>2]=189504;c[47386]=a;}c[47387]=0;return}function WU(){U1(c[47375]|0);c[47375]=0;c[47387]=0;return}function XU(){c[47387]=0;return}function YU(){var a=0,b=0,d=0;b=c[47387]|0;d=c[47375]|0;a=1;while(1){if((a|0)>(b|0)){a=5;break}if((c[(c[d+(a<<2)>>2]|0)+4>>2]|0)==(a|0))a=a+1|0;else {a=4;break}}if((a|0)==4)qa(138394,137741,59,137747);else if((a|0)==5)return}function ZU(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;f=c[47375]|0;g=c[f+(a<<2)>>2]|0;h=c[g>>2]|0;while(1){b=(a|0)/2|0;d=c[f+(b<<2)>>2]|0;e=f+(a<<2)|0;if((c[d>>2]|0)>=(h|0))break;c[e>>2]=d;c[d+4>>2]=a;a=b;}c[e>>2]=g;c[g+4>>2]=a;return}function _U(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=c[47387]|0;if((b|0)==(c[47386]|0)){gA(1,137755,d)|0;a=1;}else {b=b+1|0;c[47387]=b;c[(c[47375]|0)+(b<<2)>>2]=a;ZU(b);YU();a=0;}l=d;return a|0}function $U(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=c[47375]|0;f=c[e+(a<<2)>>2]|0;g=c[f>>2]|0;h=c[47387]|0;i=(h|0)/2|0;while(1){if((a|0)>(i|0))break;d=a<<1;b=c[e+(d<<2)>>2]|0;if((d|0)<(h|0)){l=d|1;j=c[e+(l<<2)>>2]|0;k=(c[b>>2]|0)<(c[j>>2]|0);d=k?l:d;b=k?j:b;}if((g|0)>=(c[b>>2]|0))break;c[e+(a<<2)>>2]=b;c[b+4>>2]=a;a=d;}c[e+(a<<2)>>2]=f;c[f+4>>2]=a;return}function aV(){var a=0,b=0,d=0,e=0;b=c[47387]|0;if(!b)a=0;else {e=c[47375]|0;d=e+4|0;a=c[d>>2]|0;c[d>>2]=c[e+(b<<2)>>2];b=b+-1|0;c[47387]=b;if(b|0)$U(1);YU();}return a|0}function bV(a,b){a=a|0;b=b|0;c[a>>2]=b;ZU(c[a+4>>2]|0);YU();return}function cV(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=b+16|0;j=c[m>>2]|0;j=(a[j+((c[e+12>>2]|0)*40|0)+36>>0]|0)!=(a[j+((c[e+16>>2]|0)*40|0)+36>>0]|0);k=~~((+h[d+64>>3]+-3.0-+h[d+48>>3])*.5);l=~~((+h[d+56>>3]+-3.0-+h[d+40>>3])*.5);g=(k|0)<(l|0)?k:l;n=d+4|0;f=0;while(1){b=c[n>>2]|0;if((f|0)>=(b|0)){g=f;break}i=c[d+8+(f<<2)>>2]|0;o=c[m>>2]|0;if((a[o+((c[i+12>>2]|0)*40|0)+36>>0]|0)==(a[o+((c[i+16>>2]|0)*40|0)+36>>0]|0)){g=f;break}dV(i,g);f=f+1|0;}while(1){if((g|0)>=(b|0))break;f=c[d+8+(g<<2)>>2]|0;if(j|(f|0)==(e|0)){dV(f,a[(c[m>>2]|0)+((c[f+12>>2]|0)*40|0)+36>>0]|0?k:l);b=c[n>>2]|0;}g=g+1|0;}return}function dV(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+8|0;e=c[d>>2]|0;c[d>>2]=e+1;if((e|0)>=(b|0)){c[d>>2]=0;h[a>>3]=+h[a>>3]+16384.0;}return}function eV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0.0;x=l;l=l+112|0;u=x+64|0;t=x+96|0;m=x+32|0;v=x;w=JK(28)|0;b=tB(a)|0;s=w+4|0;c[s>>2]=b;b=JK(b*72|0)|0;r=w+12|0;c[r>>2]=b;e=v+8|0;h[e>>3]=1797693134862315708145274.0e284;h[v>>3]=1797693134862315708145274.0e284;f=v+24|0;h[f>>3]=-1797693134862315708145274.0e284;g=v+16|0;h[g>>3]=-1797693134862315708145274.0e284;i=m+16|0;j=m+8|0;k=m+24|0;d=jC(a)|0;n=1797693134862315708145274.0e284;o=1797693134862315708145274.0e284;p=-1797693134862315708145274.0e284;q=-1797693134862315708145274.0e284;while(1){if(!d)break;C=d+16|0;D=c[C>>2]|0;z=(+h[D+96>>3]+ +h[D+88>>3])*.5;z=z<1.0?1.0:z;y=+h[D+80>>3]*.5;y=y<1.0?1.0:y;E=+h[D+16>>3];B=E-z;h[m>>3]=B;z=E+z;h[i>>3]=z;E=+h[D+24>>3];A=E-y;h[j>>3]=A;y=E+y;h[k>>3]=y;B=+h[(n>3];h[v>>3]=B;A=+h[(o>3];h[e>>3]=A;z=+h[(p>z?v:m)+16>>3];h[g>>3]=z;y=+h[(q>y?v:m)+24>>3];h[f>>3]=y;D=b+40|0;c[D>>2]=c[m>>2];c[D+4>>2]=c[m+4>>2];c[D+8>>2]=c[m+8>>2];c[D+12>>2]=c[m+12>>2];c[D+16>>2]=c[m+16>>2];c[D+20>>2]=c[m+20>>2];c[D+24>>2]=c[m+24>>2];c[D+28>>2]=c[m+28>>2];c[b>>2]=c[b>>2]|1;c[(c[C>>2]|0)+112>>2]=b;b=b+72|0;d=kC(a,d)|0;n=B;o=A;p=z;q=y;}h[v>>3]=n+-36.0;h[e>>3]=o+-36.0;h[g>>3]=p+36.0;h[f>>3]=q+36.0;D=c[r>>2]|0;f=c[s>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];f=oV(D,f,t,u)|0;if(c[47323]&1|0){r=c[r>>2]|0;C=c[s>>2]|0;D=c[t>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];fV(r,C,u,f,D);}e=w+8|0;c[e>>2]=JK((c[t>>2]|0)*72|0)|0;c[w>>2]=c[t>>2];d=c[t>>2]|0;b=0;while(1){if((b|0)>=(d|0))break;D=(c[e>>2]|0)+(b*72|0)+40|0;C=f+(b<<5)|0;c[D>>2]=c[C>>2];c[D+4>>2]=c[C+4>>2];c[D+8>>2]=c[C+8>>2];c[D+12>>2]=c[C+12>>2];c[D+16>>2]=c[C+16>>2];c[D+20>>2]=c[C+20>>2];c[D+24>>2]=c[C+24>>2];c[D+28>>2]=c[C+28>>2];b=b+1|0;}U1(f);c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];c[w+16>>2]=gV(w,u)|0;l=x;return w|0}function fV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0.0;q=l;l=l+128|0;p=q+96|0;o=q+64|0;j=q+32|0;r=q+16|0;s=q;m=+h[d+16>>3];n=+h[d>>3];k=+h[d+24>>3];g=+h[d+8>>3];i=c[15712]|0;T4(137770,i)|0;c[s>>2]=10;c[s+4>>2]=10;c[s+8>>2]=~~(m+10.0-n);c[s+12>>2]=~~(k+10.0-g);w4(i,138200,s)|0;h[r>>3]=10.0-n;h[r+8>>3]=10.0-g;w4(i,138248,r)|0;T4(138265,i)|0;d=0;while(1){if((d|0)>=(b|0))break;v=+h[a+(d*72|0)+48>>3];u=+h[a+(d*72|0)+56>>3];t=+h[a+(d*72|0)+64>>3];h[j>>3]=+h[a+(d*72|0)+40>>3];h[j+8>>3]=v;h[j+16>>3]=u;h[j+24>>3]=t;w4(i,138284,j)|0;d=d+1|0;}T4(138302,i)|0;d=0;while(1){if((d|0)>=(f|0))break;t=+h[e+(d<<5)+8>>3];u=+h[e+(d<<5)+16>>3];v=+h[e+(d<<5)+24>>3];h[o>>3]=+h[e+(d<<5)>>3];h[o+8>>3]=t;h[o+16>>3]=u;h[o+24>>3]=v;w4(i,138321,o)|0;d=d+1|0;}T4(138339,i)|0;h[p>>3]=n;h[p+8>>3]=g;h[p+16>>3]=m;h[p+24>>3]=k;w4(i,138321,p)|0;T4(138086,i)|0;l=q;return}function gV(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;A=l;l=l+32|0;t=A+16|0;k=A;w=c[a>>2]|0;y=CR(w<<2|2)|0;z=Vz(55960,c[4581]|0)|0;v=Vz(55996,c[4581]|0)|0;w=JK(w<<7)|0;f=JK(c[a>>2]<<4)|0;x=a+8|0;g=b+16|0;i=k+8|0;j=b+24|0;m=b+8|0;d=0;while(1){if((d|0)>=(c[a>>2]|0))break;n=c[x>>2]|0;o=n+(d*72|0)|0;c[n+(d*72|0)+32>>2]=4;p=n+(d*72|0)+36|0;c[p>>2]=f+(d<<2<<2);q=n+(d*72|0)+40|0;e=+h[n+(d*72|0)+56>>3];if(e<+h[g>>3]){h[k>>3]=e;h[i>>3]=+h[n+(d*72|0)+48>>3];c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];s=hV(y,z,t,w,1)|0;c[s+20>>2]=o;c[c[p>>2]>>2]=s;}e=+h[n+(d*72|0)+64>>3];if(e<+h[j>>3]){h[k>>3]=+h[q>>3];h[i>>3]=e;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];s=hV(y,v,t,w,0)|0;c[s+20>>2]=o;c[(c[p>>2]|0)+4>>2]=s;}if(+h[q>>3]>+h[b>>3]){c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];s=hV(y,z,t,w,1)|0;c[s+24>>2]=o;c[(c[p>>2]|0)+8>>2]=s;}if(+h[n+(d*72|0)+48>>3]>+h[m>>3]){c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];s=hV(y,v,t,w,0)|0;c[s+24>>2]=o;c[(c[p>>2]|0)+12>>2]=s;}d=d+1|0;}o=JK(c[y>>2]<<2)|0;r=a+4|0;s=a+12|0;p=t+8|0;m=0;q=0;n=0;while(1){d=c[r>>2]|0;if((n|0)>=(d|0)){b=0;break}g=c[s>>2]|0;i=g+(n*72|0)|0;j=g+(n*72|0)+36|0;c[j>>2]=o+(m<<2);b=g+(n*72|0)+40|0;c[t>>2]=c[b>>2];c[t+4>>2]=c[b+4>>2];c[t+8>>2]=c[b+8>>2];c[t+12>>2]=c[b+12>>2];b=g+(n*72|0)+56|0;k=g+(n*72|0)+32|0;d=nb[c[v>>2]&63](v,t,512)|0;while(1){if(!d)break;if(!(+h[d+8>>3]<+h[b>>3]))break;C=c[d>>2]|0;B=c[j>>2]|0;f=c[k>>2]|0;c[k>>2]=f+1;c[B+(f<<2)>>2]=C;c[(c[d>>2]|0)+24>>2]=i;d=nb[c[v>>2]&63](v,d,8)|0;}f=g+(n*72|0)+64|0;d=nb[c[z>>2]&63](z,t,512)|0;while(1){if(!d){u=20;break}e=+h[f>>3];if(!(+h[d+16>>3]>2]|0;B=c[j>>2]|0;C=c[k>>2]|0;c[k>>2]=C+1;c[B+(C<<2)>>2]=b;c[(c[d>>2]|0)+24>>2]=i;d=nb[c[z>>2]&63](z,d,8)|0;}if((u|0)==20){u=0;e=+h[f>>3];}h[p>>3]=e;b=g+(n*72|0)+56|0;d=nb[c[v>>2]&63](v,t,512)|0;while(1){if(!d){u=25;break}e=+h[b>>3];if(!(+h[d+8>>3]>2]|0;B=c[j>>2]|0;C=c[k>>2]|0;c[k>>2]=C+1;c[B+(C<<2)>>2]=D;c[(c[d>>2]|0)+20>>2]=i;d=nb[c[v>>2]&63](v,d,8)|0;}if((u|0)==25){u=0;e=+h[b>>3];}h[t>>3]=e;h[p>>3]=+h[g+(n*72|0)+48>>3];d=nb[c[z>>2]&63](z,t,512)|0;while(1){if(!d)break;if(!(+h[d+16>>3]<+h[f>>3]))break;B=c[d>>2]|0;C=c[j>>2]|0;D=c[k>>2]|0;c[k>>2]=D+1;c[C+(D<<2)>>2]=B;c[(c[d>>2]|0)+20>>2]=i;d=nb[c[z>>2]&63](z,d,8)|0;}D=c[k>>2]|0;m=D+m|0;q=(D|0)>(q|0)?D:q;n=n+1|0;}while(1){if((b|0)>=(d|0))break;iV((c[s>>2]|0)+(b*72|0)|0);b=b+1|0;d=c[r>>2]|0;}d=c[y>>2]|0;D=c[y+16>>2]|0;c[D+(d*40|0)+32>>2]=d;d=d+1|0;c[D+(d*40|0)+32>>2]=d;BR(y,q);d=0;while(1){if((d|0)>=(c[a>>2]|0))break;jV((c[x>>2]|0)+(d*72|0)|0,y);d=d+1|0;}Rz(z)|0;Rz(v)|0;U1(w);kV(y);zR(y);l=A;return y|0}function hV(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=nb[c[d>>2]&63](d,e,512)|0;do if(!h){b=DR(b)|0;if(!f)qa(138183,138131,291,138190);else {h=c[b+32>>2]|0;i=f+(h<<5)|0;f=f+(h<<5)+8|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[i>>2]=b;a[b+36>>0]=g;nb[c[d>>2]&63](d,i,1)|0;break}}else i=h;while(0);return c[i>>2]|0}function iV(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;a:do if((+h[b+64>>3]+-3.0-+h[b+48>>3])*.5<2.0){i=c[b+32>>2]|0;j=b+36|0;g=0;while(1){if((g|0)>=(i|0))break a;d=c[(c[j>>2]|0)+(g<<2)>>2]|0;b:do if(a[d+36>>0]|0){f=c[d+20>>2]|0;if((f|0)==(b|0)){e=c[d+24>>2]|0;d=e;e=c[e>>2]|0;do{c[d>>2]=e|8;d=c[c[d+36>>2]>>2]|0;if(!d)break b;d=c[d+24>>2]|0;e=c[d>>2]|0;}while(!(e&1|0))}else {e=f;d=c[f>>2]|0;do{c[e>>2]=d|8;d=c[(c[e+36>>2]|0)+8>>2]|0;if(!d)break b;e=c[d+20>>2]|0;d=c[e>>2]|0;}while(!(d&1|0))}}while(0);g=g+1|0;}}while(0);c:do if((+h[b+56>>3]+-3.0-+h[b+40>>3])*.5<2.0){i=c[b+32>>2]|0;j=b+36|0;g=0;while(1){if((g|0)>=(i|0))break c;d=c[(c[j>>2]|0)+(g<<2)>>2]|0;d:do if(!(a[d+36>>0]|0)){f=c[d+20>>2]|0;if((f|0)==(b|0)){e=c[d+24>>2]|0;d=e;e=c[e>>2]|0;do{c[d>>2]=e|16;d=c[(c[d+36>>2]|0)+4>>2]|0;if(!d)break d;d=c[d+24>>2]|0;e=c[d>>2]|0;}while(!(e&1|0))}else {e=f;d=c[f>>2]|0;do{c[e>>2]=d|16;d=c[(c[e+36>>2]|0)+12>>2]|0;if(!d)break d;e=c[d+20>>2]|0;d=c[e>>2]|0;}while(!(d&1|0))}}while(0);g=g+1|0;}}while(0);return}function jV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;g=+h[a+56>>3]-+h[a+40>>3];i=+h[a+64>>3]-+h[a+48>>3];f=(i+g)*.5+500.0;if((i+-3.0)*.5<2.0){l=(c[a>>2]&8|0)==0;f=l?16384.0:f;p=l?16384.0:g;}else p=g;if((g+-3.0)*.5<2.0){l=(c[a>>2]&16|0)==0;i=l?16384.0:i;f=l?16384.0:f;}l=a+36|0;d=c[l>>2]|0;e=c[d+8>>2]|0;if((e|0)!=0?(j=c[d+4>>2]|0,(j|0)!=0):0){j=ER(b,e,j,f)|0;e=a+4|0;d=c[e>>2]|0;c[e>>2]=d+1;c[a+8+(d<<2)>>2]=j;d=c[l>>2]|0;}e=c[d+4>>2]|0;if((e|0)!=0?(k=c[d>>2]|0,(k|0)!=0):0){k=ER(b,e,k,f)|0;j=a+4|0;d=c[j>>2]|0;c[j>>2]=d+1;c[a+8+(d<<2)>>2]=k;d=c[l>>2]|0;}e=c[d+8>>2]|0;if((e|0)!=0?(m=c[d+12>>2]|0,(m|0)!=0):0){m=ER(b,e,m,f)|0;k=a+4|0;d=c[k>>2]|0;c[k>>2]=d+1;c[a+8+(d<<2)>>2]=m;d=c[l>>2]|0;}e=c[d+12>>2]|0;if((e|0)!=0?(n=c[d>>2]|0,(n|0)!=0):0){n=ER(b,e,n,f)|0;m=a+4|0;d=c[m>>2]|0;c[m>>2]=d+1;c[a+8+(d<<2)>>2]=n;d=c[l>>2]|0;}e=c[d+4>>2]|0;if((e|0)!=0?(o=c[d+12>>2]|0,(o|0)!=0):0){o=ER(b,e,o,i)|0;n=a+4|0;d=c[n>>2]|0;c[n>>2]=d+1;c[a+8+(d<<2)>>2]=o;d=c[l>>2]|0;}e=c[d+8>>2]|0;if(e|0?(q=c[d>>2]|0,q|0):0){b=ER(b,e,q,p)|0;o=a+4|0;q=c[o>>2]|0;c[o>>2]=q+1;c[a+8+(q<<2)>>2]=b;}return}function kV(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j+8|0;h=j;f=a+16|0;g=c[15712]|0;e=0;while(1){if((e|0)>=(c[a>>2]|0)){b=10;break}b=c[f>>2]|0;d=b+(e*40|0)+20|0;if((c[d>>2]|0)==0?(c[h>>2]=e,w4(g,138096,h)|0,(c[d>>2]|0)==0):0){b=5;break}b=b+(e*40|0)+24|0;if((c[b>>2]|0)==0?(c[i>>2]=e,w4(g,138148,i)|0,(c[b>>2]|0)==0):0){b=8;break}e=e+1|0;}if((b|0)==5)qa(138118,138131,311,138138);else if((b|0)==8)qa(138170,138131,313,138138);else if((b|0)==10){l=j;return}}function lV(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[c+8>>3];if(!(e>f))if(!(e>3];e=+h[c>>3];if(f>e)a=1;else a=(f>31;}else a=-1;else a=1;return a|0}function mV(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b>>3];f=+h[c>>3];if(!(e>f))if(!(e>3];e=+h[c+8>>3];if(f>e)a=1;else a=(f>31;}else a=-1;else a=1;return a|0}function nV(a){a=a|0;var b=0,d=0;d=a+8|0;U1(c[(c[d>>2]|0)+36>>2]|0);b=a+12|0;U1(c[(c[b>>2]|0)+36>>2]|0);U1(c[d>>2]|0);U1(c[b>>2]|0);GR(c[a+16>>2]|0);Rz(c[a+20>>2]|0)|0;Rz(c[a+24>>2]|0)|0;U1(a);return}function oV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+32|0;h=p;i=b<<2;f=i+4|0;i=i+5|0;o=KK(i*56|0)|0;i=JK(i<<2)|0;g=f*5|1;j=KK(g*72|0)|0;m=g<<5;k=JK(m)|0;m=JK(m)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[h+16>>2]=c[e+16>>2];c[h+20>>2]=c[e+20>>2];c[h+24>>2]=c[e+24>>2];c[h+28>>2]=c[e+28>>2];pV(a,b,h,o,0);z5(173);qV(f,i);AV(f,o,i,g,j)|0;n=rV(f,o,j,0,k)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[h+16>>2]=c[e+16>>2];c[h+20>>2]=c[e+20>>2];c[h+24>>2]=c[e+24>>2];c[h+28>>2]=c[e+28>>2];pV(a,b,h,o,1);qV(f,i);AV(f,o,i,g,j)|0;f=rV(f,o,j,1,m)|0;g=JK(O(n<<5,f)|0)|0;b=0;a=0;while(1){if((b|0)>=(f|0))break;h=m+(b<<5)|0;e=0;while(1){if((e|0)>=(n|0))break;q=a+((sV(g+(a<<5)|0,h,k+(e<<5)|0)|0)!=0&1)|0;e=e+1|0;a=q;}b=b+1|0;}q=MK(g,a<<5)|0;U1(o);U1(i);U1(j);U1(k);U1(m);c[d>>2]=a;l=p;return q|0}function pV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;j=l;l=l+96|0;h=j+64|0;i=j;c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];c[h+16>>2]=c[d+16>>2];c[h+20>>2]=c[d+20>>2];c[h+24>>2]=c[d+24>>2];c[h+28>>2]=c[d+28>>2];yV(h,f,1,i);d=zV(e,1,i)|0;g=0;while(1){if((g|0)>=(b|0))break;k=a+(g*72|0)+40|0;c[h>>2]=c[k>>2];c[h+4>>2]=c[k+4>>2];c[h+8>>2]=c[k+8>>2];c[h+12>>2]=c[k+12>>2];c[h+16>>2]=c[k+16>>2];c[h+20>>2]=c[k+20>>2];c[h+24>>2]=c[k+24>>2];c[h+28>>2]=c[k+28>>2];yV(h,f,0,i);d=zV(e,d,i)|0;g=g+1|0;}l=j;return}function qV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=0;while(1){if((d|0)>(a|0))break;c[b+(d<<2)>>2]=d;d=d+1|0;}g=a+1|0;d=1;while(1){if((d|0)>(a|0))break;h=~~(+B5()*+(g-d|0)+ +(d|0));e=b+(d<<2)|0;f=b+(h<<2)|0;if((d|0)!=(h|0)){h=c[e>>2]|0;c[e>>2]=c[f>>2];c[f>>2]=h;}d=d+1|0;}return}function rV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;g=a*5|0;j=g+1|0;l=JK(j<<2)|0;c[47388]=JK(j<<4)|0;c[47389]=JK((a*56|0)+56|0)|0;j=JK(a<<2)|0;c[47390]=j;k=0;while(1){if((k|0)>(g|0))break;if(tV(d+(k*72|0)|0,b)|0)break;k=k+1|0;}h=c[47388]|0;i=c[47389]|0;g=1;while(1){if((g|0)>(a|0))break;c[h+(g<<4)+8>>2]=c[b+(g*56|0)+48>>2];m=b+(g*56|0)+44|0;c[h+(g<<4)+4>>2]=c[m>>2];c[h+(g<<4)>>2]=g;n=i+(g*56|0)|0;o=b+(g*56|0)|0;c[n>>2]=c[o>>2];c[n+4>>2]=c[o+4>>2];c[n+8>>2]=c[o+8>>2];c[n+12>>2]=c[o+12>>2];c[i+(g*56|0)+16>>2]=c[m>>2];c[i+(g*56|0)+32>>2]=g;c[i+(g*56|0)+48>>2]=1;g=g+1|0;}c[47391]=a;c[47392]=0;c[j>>2]=1;g=c[d+(k*72|0)+40>>2]|0;if((g|0)<=0){g=c[d+(k*72|0)+48>>2]|0;if((g|0)>0)g=uV(l,f,0,b,d,0,k,g,e,2)|0;else g=0;}else g=uV(l,f,0,b,d,0,k,g,e,1)|0;U1(l);U1(c[47388]|0);U1(c[47389]|0);U1(c[47390]|0);return g|0}function sV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;g=+h[(+h[b>>3]>+h[c>>3]?b:c)>>3];f=+h[(+h[b+16>>3]<+h[c+16>>3]?b:c)+16>>3];h[a+16>>3]=f;h[a>>3]=g;e=+h[(+h[b+8>>3]>+h[c+8>>3]?b:c)+8>>3];d=+h[(+h[b+24>>3]<+h[c+24>>3]?b:c)+24>>3];h[a+24>>3]=d;h[a+8>>3]=e;return !(g>=f)&!(e>=d)&1|0}function tV(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[a+4>>2]|0;do if((c[a+68>>2]|0)!=2?!((f|0)<1|(c[a>>2]|0)<1):0){if(!((c[a+40>>2]|0)<1?(c[a+44>>2]|0)<1:0)){if((c[a+48>>2]|0)>=1){a=0;break}if((c[a+52>>2]|0)>=1){a=0;break}}d=+h[b+(f*56|0)+24>>3];e=+h[b+(f*56|0)+8>>3];if(!(d>e+1.0e-07))if(d>3]>+h[b+(f*56|0)>>3]&1;else a=1;}else a=0;while(0);return a|0}function uV(a,b,d,e,f,g,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0,K=0.0,L=0,M=0,N=0,O=0,P=0;D=(k|0)==0;C=i;a:while(1){y=f+(C*72|0)|0;if((C|0)<1)break;i=a+(C<<2)|0;if(c[i>>2]|0)break;c[i>>2]=1;v=f+(C*72|0)+8|0;t=f+(C*72|0)+16|0;p=+h[t>>3];w=f+(C*72|0)+24|0;x=f+(C*72|0)+32|0;o=+h[x>>3];if((p>o?(A=c[y>>2]|0,I=+h[e+(A*56|0)>>3],I==+h[e+(A*56|0)+16>>3]):0)?(A=c[f+(C*72|0)+4>>2]|0,K=+h[e+(A*56|0)>>3],K==+h[e+(A*56|0)+16>>3]):0){i=b+(d<<5)|0;if(D){h[i>>3]=I;q=p;p=K;}else {h[i>>3]=o;q=-I;o=-K;}h[b+(d<<5)+8>>3]=o;h[b+(d<<5)+16>>3]=p;h[b+(d<<5)+24>>3]=q;d=d+1|0;}i=f+(C*72|0)+40|0;z=c[i>>2]|0;do if((z|0)<1?(L=f+(C*72|0)+44|0,(c[L>>2]|0)<1):0){i=f+(C*72|0)+48|0;n=f+(C*72|0)+52|0;if((c[i>>2]|0)>0?(M=c[n>>2]|0,(M|0)>0):0){m=c[f+(M*72|0)>>2]|0;l=c[y>>2]|0;if((M|0)==(j|0)){l=vV(g,l,m)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,1)|0;g=l;l=1;break}else {l=vV(g,m,l)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,1)|0;g=l;i=n;l=1;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[L>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,1)|0;i=n;l=1;}else P=19;while(0);do if((P|0)==19){P=0;A=f+(C*72|0)+48|0;r=c[A>>2]|0;if((r|0)<1?(N=f+(C*72|0)+52|0,(c[N>>2]|0)<1):0){n=f+(C*72|0)+44|0;if((z|0)>0?(O=c[n>>2]|0,(O|0)>0):0){m=c[f+(C*72|0)+4>>2]|0;l=c[f+(z*72|0)+4>>2]|0;if((O|0)==(j|0)){l=vV(g,l,m)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,2)|0;g=l;l=2;break}else {l=vV(g,m,l)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;g=l;i=n;l=2;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;i=N;l=1;break}u=f+(C*72|0)+44|0;s=c[u>>2]|0;m=(s|0)>0;if((z|0)>0){if(m){if((r|0)>0?(E=f+(C*72|0)+52|0,F=c[E>>2]|0,(F|0)>0):0){n=c[f+(F*72|0)>>2]|0;m=c[f+(z*72|0)+4>>2]|0;if(!((l|0)==2&(F|0)==(j|0))?!((l|0)==1&(s|0)==(j|0)):0){l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[u>>2]|0,C,k,2)|0;g=l;i=E;l=1;break}l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[E>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}m=c[y>>2]|0;if(+B(+(+h[x>>3]-+h[e+(m*56|0)+24>>3]))<=1.0e-07?+B(+(+h[w>>3]-+h[e+(m*56|0)+16>>3]))<=1.0e-07:0){n=c[f+(z*72|0)+4>>2]|0;m=c[e+(m*56|0)+44>>2]|0;if((l|0)==1&(z|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[u>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+52|0;l=1;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;l=2;break}}n=c[f+(C*72|0)+4>>2]|0;m=c[f+(z*72|0)+4>>2]|0;if((l|0)==1&(s|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[A>>2]|0,C,k,1)|0;g=l;l=2;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=u;l=2;break}}}else if(!m)break a;if((r|0)>0?(G=f+(C*72|0)+52|0,H=c[G>>2]|0,(H|0)>0):0){n=c[y>>2]|0;if(+B(+(+h[t>>3]-+h[e+(n*56|0)+8>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(n*56|0)>>3]))<=1.0e-07:0){m=c[f+(H*72|0)>>2]|0;if((l|0)==2&(r|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;g=l;i=G;l=1;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[G>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}}m=c[f+(H*72|0)>>2]|0;n=c[e+((c[f+(C*72|0)+4>>2]|0)*56|0)+44>>2]|0;if((l|0)==2&(H|0)==(j|0)){l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[G>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}else {l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;g=l;i=G;l=1;break}}o=+h[t>>3];n=c[y>>2]|0;if(((+B(+(o-+h[e+(n*56|0)+8>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(n*56|0)>>3]))<=1.0e-07:0)?(J=c[f+(C*72|0)+4>>2]|0,+B(+(+h[x>>3]-+h[e+(J*56|0)+8>>3]))<=1.0e-07):0)?+B(+(+h[w>>3]-+h[e+(J*56|0)>>3]))<=1.0e-07:0)if((l|0)==1){l=vV(g,n,J)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=A;l=1;break}else {l=vV(g,J,n)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+44|0;l=2;break}j=c[f+(C*72|0)+4>>2]|0;if(((+B(+(o-+h[e+(j*56|0)+24>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(j*56|0)+16>>3]))<=1.0e-07:0)?+B(+(+h[x>>3]-+h[e+(n*56|0)+24>>3]))<=1.0e-07:0)?+B(+(+h[w>>3]-+h[e+(n*56|0)+16>>3]))<=1.0e-07:0){m=c[e+(j*56|0)+44>>2]|0;j=c[e+(n*56|0)+44>>2]|0;if((l|0)==1){l=vV(g,j,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=A;l=1;break}else {l=vV(g,m,j)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+44|0;l=2;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;i=f+(C*72|0)+52|0;l=1;}while(0);j=C;C=c[i>>2]|0;}return d|0}function vV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;f=l;l=l+16|0;r=f+4|0;i=f;e=(c[47392]|0)+1|0;c[47392]=e;m=c[47389]|0;wV(b,d,r,i);r=c[r>>2]|0;h=c[m+(b*56|0)+32+(r<<2)>>2]|0;i=c[m+(d*56|0)+32+(c[i>>2]<<2)>>2]|0;n=c[47391]|0;g=n+1|0;n=n+2|0;c[47391]=n;q=c[47388]|0;c[q+(g<<4)>>2]=b;c[q+(n<<4)>>2]=d;o=q+(h<<4)+4|0;p=q+(g<<4)+4|0;c[p>>2]=c[o>>2];c[q+(c[o>>2]<<4)+8>>2]=g;c[q+(g<<4)+8>>2]=n;c[q+(n<<4)+4>>2]=g;j=q+(i<<4)+8|0;c[q+(n<<4)+8>>2]=c[j>>2];c[q+(c[j>>2]<<4)+4>>2]=n;c[o>>2]=i;c[j>>2]=h;j=m+(b*56|0)+48|0;o=c[j>>2]|0;i=m+(d*56|0)+48|0;k=c[i>>2]|0;c[m+(b*56|0)+16+(r<<2)>>2]=d;c[m+(b*56|0)+32+(o<<2)>>2]=g;c[m+(b*56|0)+16+(o<<2)>>2]=c[q+(c[p>>2]<<4)>>2];c[m+(d*56|0)+32+(k<<2)>>2]=n;c[m+(d*56|0)+16+(k<<2)>>2]=b;c[j>>2]=(c[j>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+1;d=c[47390]|0;c[d+(a<<2)>>2]=h;c[d+(e<<2)>>2]=g;l=f;return e|0}function wV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,h=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0;l=c[47389]|0;m=l+(a*56|0)|0;n=l+(b*56|0)|0;f=0;g=-4.0;i=0;while(1){if((i|0)==4)break;h=c[l+(a*56|0)+16+(i<<2)>>2]|0;if((h|0)>=1?(j=+xV(m,l+(h*56|0)|0,n),j>g):0){f=i;g=j;}i=i+1|0;}c[d>>2]=f;f=0;i=0;g=-4.0;while(1){if((i|0)==4)break;h=c[l+(b*56|0)+16+(i<<2)>>2]|0;if((h|0)>=1?(k=+xV(n,l+(h*56|0)|0,m),k>g):0){f=i;g=k;}i=i+1|0;}c[e>>2]=f;return}function xV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;g=+h[a>>3];i=+h[b>>3]-g;d=+h[a+8>>3];f=+h[b+8>>3]-d;g=+h[c>>3]-g;d=+h[c+8>>3]-d;e=d*f+g*i;if(!(d*i-g*f>=0.0))d=-e/(+C(+(d*d+g*g))*+C(+(f*f+i*i)))+-2.0;else d=e/(+C(+(d*d+g*g))*+C(+(f*f+i*i)));return +d}function yV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,l=0.0;c[e>>2]=c[a>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];i=e+32|0;j=a+16|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];if(!d){f=a+8|0;g=j;i=a+24|0;d=a;}else {f=a+24|0;g=a;i=a+8|0;d=j;}k=+h[g>>3];l=+h[i>>3];h[e+16>>3]=+h[d>>3];h[e+24>>3]=l;h[e+48>>3]=k;h[e+56>>3]=+h[f>>3];a:do if(b|0){d=0;while(1){if((d|0)==4)break a;j=e+(d<<4)+8|0;l=+h[j>>3];b=e+(d<<4)|0;h[j>>3]=+h[b>>3];h[b>>3]=-l;d=d+1|0;}}while(0);return}function zV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=b+3|0;i=b+1|0;j=b+2|0;k=a+(b*56|0)+44|0;l=a+(h*56|0)+44|0;e=0;f=b;while(1){if((f|0)>(h|0))break;do if((f|0)!=(b|0))if((f|0)==(h|0)){c[l>>2]=b;g=j;break}else {c[a+(f*56|0)+44>>2]=f+1;g=f+-1|0;break}else {c[k>>2]=i;g=h;}while(0);c[a+(f*56|0)+48>>2]=g;c[a+(f*56|0)+32>>2]=0;n=a+(f*56|0)|0;m=d+(e<<4)|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];c[n+8>>2]=c[m+8>>2];c[n+12>>2]=c[m+12>>2];X6(a+(g*56|0)+16|0,m|0,16)|0;e=e+1|0;f=f+1|0;}return b+4|0}function AV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;c[47393]=e<<1;c[47394]=e;k=JK(e*80|0)|0;c[47395]=1;c[47396]=1;Y6(f|0,0,e*72|0)|0;g=BV(c[d+4>>2]|0,b,f,k)|0;e=1;while(1){if((e|0)>(a|0))break;c[b+(e*56|0)+40>>2]=g;c[b+(e*56|0)+36>>2]=g;e=e+1|0;}j=CV(a)|0;g=2;i=1;while(1){if((i|0)>(j|0))break;e=DV(a,i+-1|0)|0;h=DV(a,i)|0;while(1){if((e|0)>=(h|0)){e=1;break}EV(c[d+(g<<2)>>2]|0,b,f,k);e=e+1|0;g=g+1|0;}while(1){if((e|0)>(a|0))break;FV(e,b,f,k);e=e+1|0;}i=i+1|0;}e=DV(a,j)|0;while(1){if((e|0)>=(a|0))break;EV(c[d+(g<<2)>>2]|0,b,f,k);g=g+1|0;e=e+1|0;}U1(k);return c[47395]|0}function BV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=KV()|0;c[e+(f*40|0)>>2]=2;s=e+(f*40|0)+8|0;k=b+(a*56|0)|0;l=b+(a*56|0)+16|0;OV(s,k,l);n=KV()|0;c[e+(f*40|0)+36>>2]=n;c[e+(n*40|0)>>2]=3;c[e+(n*40|0)+28>>2]=f;j=KV()|0;c[e+(f*40|0)+32>>2]=j;c[e+(j*40|0)>>2]=2;r=e+(j*40|0)+8|0;PV(r,k,l);c[e+(j*40|0)+28>>2]=f;l=KV()|0;c[e+(j*40|0)+32>>2]=l;c[e+(l*40|0)>>2]=3;c[e+(l*40|0)+28>>2]=j;k=KV()|0;c[e+(j*40|0)+36>>2]=k;c[e+(k*40|0)>>2]=1;c[e+(k*40|0)+4>>2]=a;c[e+(k*40|0)+28>>2]=j;j=KV()|0;c[e+(k*40|0)+32>>2]=j;c[e+(j*40|0)>>2]=3;c[e+(j*40|0)+28>>2]=k;g=KV()|0;c[e+(k*40|0)+36>>2]=g;c[e+(g*40|0)>>2]=3;c[e+(g*40|0)+28>>2]=k;k=JV(d)|0;i=JV(d)|0;m=JV(d)|0;o=JV(d)|0;p=d+(k*72|0)+8|0;q=d+(i*72|0)+8|0;t=d+(o*72|0)+24|0;c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];X6(q|0,s|0,16)|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];p=d+(k*72|0)+24|0;q=d+(i*72|0)+24|0;s=d+(m*72|0)+8|0;c[s>>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];X6(q|0,r|0,16)|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];h[d+(o*72|0)+16>>3]=1073741824.0;h[d+(o*72|0)+8>>3]=1073741824.0;h[d+(m*72|0)+32>>3]=-1073741824.0;h[d+(m*72|0)+24>>3]=-1073741824.0;c[d+(i*72|0)>>2]=a;c[d+(k*72|0)+4>>2]=a;c[d+(i*72|0)+40>>2]=o;c[d+(k*72|0)+40>>2]=o;c[d+(i*72|0)+48>>2]=m;c[d+(k*72|0)+48>>2]=m;c[d+(m*72|0)+40>>2]=k;c[d+(o*72|0)+48>>2]=k;c[d+(m*72|0)+44>>2]=i;c[d+(o*72|0)+52>>2]=i;c[d+(k*72|0)+56>>2]=j;c[d+(i*72|0)+56>>2]=g;c[d+(m*72|0)+56>>2]=l;c[d+(o*72|0)+56>>2]=n;c[d+(i*72|0)+68>>2]=1;c[d+(k*72|0)+68>>2]=1;c[d+(o*72|0)+68>>2]=1;c[d+(m*72|0)+68>>2]=1;c[e+(n*40|0)+24>>2]=o;c[e+(l*40|0)+24>>2]=m;c[e+(j*40|0)+24>>2]=k;c[e+(g*40|0)+24>>2]=i;c[b+(a*56|0)+32>>2]=1;return f|0}function CV(a){a=a|0;var b=0.0;b=+(a|0);a=0;while(1){if(!(b>=1.0))break;b=+x2(b);a=a+1|0;}return a+-1|0}function DV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+(a|0);c=d;a=0;while(1){if((a|0)>=(b|0))break;c=+x2(c);a=a+1|0;}return ~~+N(+(d/c))|0}function EV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;W=l;l=l+96|0;S=W+32|0;f=W+16|0;T=W;s=S;k=b+(a*56|0)|0;r=s+56|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));U=S+16|0;V=S+24|0;i=+h[V>>3];H=S+8|0;j=+h[H>>3];do if(!(i>j+1.0e-07)){if(!(i>3]>+h[S>>3]:0){G=4;break}G=(IV(a,b,1)|0)==0;f=c[S+36>>2]|0;if(G){n=0;G=7;}else {f=GV(S,U,f,b,e)|0;G=20;}}else G=4;while(0);if((G|0)==4){c[f>>2]=c[S>>2];c[f+4>>2]=c[S+4>>2];c[f+8>>2]=c[S+8>>2];c[f+12>>2]=c[S+12>>2];c[S>>2]=c[U>>2];c[S+4>>2]=c[U+4>>2];c[S+8>>2]=c[U+8>>2];c[S+12>>2]=c[U+12>>2];c[U>>2]=c[f>>2];c[U+4>>2]=c[f+4>>2];c[U+8>>2]=c[f+8>>2];c[U+12>>2]=c[f+12>>2];E=S+36|0;F=c[E>>2]|0;G=S+40|0;f=c[G>>2]|0;c[E>>2]=f;c[G>>2]=F;if(!(IV(a,b,2)|0)){n=1;G=7;}else {f=GV(S,U,f,b,e)|0;G=19;}}if((G|0)==7){m=GV(S,U,f,b,e)|0;f=JV(d)|0;c[d+(f*72|0)+68>>2]=1;s=d+(f*72|0)|0;k=d+(m*72|0)|0;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));q=+h[H>>3];h[d+(f*72|0)+16>>3]=q;h[d+(m*72|0)+32>>3]=q;q=+h[S>>3];h[d+(f*72|0)+8>>3]=q;h[d+(m*72|0)+24>>3]=q;c[d+(m*72|0)+48>>2]=f;c[d+(m*72|0)+52>>2]=0;c[d+(f*72|0)+40>>2]=m;c[d+(f*72|0)+44>>2]=0;g=c[d+(f*72|0)+48>>2]|0;if((g|0)>0){k=d+(g*72|0)+40|0;if((c[k>>2]|0)==(m|0))c[k>>2]=f;g=d+(g*72|0)+44|0;if((c[g>>2]|0)==(m|0))c[g>>2]=f;}g=c[d+(f*72|0)+52>>2]|0;if((g|0)>0){k=d+(g*72|0)+40|0;if((c[k>>2]|0)==(m|0))c[k>>2]=f;g=d+(g*72|0)+44|0;if((c[g>>2]|0)==(m|0))c[g>>2]=f;}E=KV()|0;G=KV()|0;F=d+(m*72|0)+56|0;D=c[F>>2]|0;c[e+(D*40|0)>>2]=2;C=e+(D*40|0)+8|0;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[e+(D*40|0)+4>>2]=a;c[e+(D*40|0)+32>>2]=G;c[e+(D*40|0)+36>>2]=E;c[e+(E*40|0)>>2]=3;c[e+(E*40|0)+24>>2]=m;c[e+(E*40|0)+28>>2]=D;c[e+(G*40|0)>>2]=3;c[e+(G*40|0)+24>>2]=f;c[e+(G*40|0)+28>>2]=D;c[F>>2]=E;c[d+(f*72|0)+56>>2]=G;if(n)G=19;else G=20;}if((G|0)==19)if(!(IV(a,b,1)|0)){g=1;G=21;}else {g=1;G=32;}else if((G|0)==20)if(!(IV(a,b,2)|0)){g=0;G=21;}else {g=0;G=32;}if((G|0)==21){o=GV(U,S,c[S+40>>2]|0,b,e)|0;n=JV(d)|0;c[d+(n*72|0)+68>>2]=1;s=d+(n*72|0)|0;k=d+(o*72|0)|0;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));q=+h[V>>3];h[d+(n*72|0)+16>>3]=q;h[d+(o*72|0)+32>>3]=q;q=+h[U>>3];h[d+(n*72|0)+8>>3]=q;h[d+(o*72|0)+24>>3]=q;c[d+(o*72|0)+48>>2]=n;c[d+(o*72|0)+52>>2]=0;c[d+(n*72|0)+40>>2]=o;c[d+(n*72|0)+44>>2]=0;k=c[d+(n*72|0)+48>>2]|0;if((k|0)>0){m=d+(k*72|0)+40|0;if((c[m>>2]|0)==(o|0))c[m>>2]=n;k=d+(k*72|0)+44|0;if((c[k>>2]|0)==(o|0))c[k>>2]=n;}k=c[d+(n*72|0)+52>>2]|0;if((k|0)>0){m=d+(k*72|0)+40|0;if((c[m>>2]|0)==(o|0))c[m>>2]=n;k=d+(k*72|0)+44|0;if((c[k>>2]|0)==(o|0))c[k>>2]=n;}D=KV()|0;F=KV()|0;E=d+(o*72|0)+56|0;C=c[E>>2]|0;c[e+(C*40|0)>>2]=2;A=e+(C*40|0)+8|0;c[A>>2]=c[U>>2];c[A+4>>2]=c[U+4>>2];c[A+8>>2]=c[U+8>>2];c[A+12>>2]=c[U+12>>2];c[e+(C*40|0)+4>>2]=a;c[e+(C*40|0)+32>>2]=F;c[e+(C*40|0)+36>>2]=D;c[e+(D*40|0)>>2]=3;c[e+(D*40|0)+24>>2]=o;c[e+(D*40|0)+28>>2]=C;c[e+(F*40|0)>>2]=3;c[e+(F*40|0)+24>>2]=n;c[e+(F*40|0)+28>>2]=C;c[E>>2]=D;c[d+(n*72|0)+56>>2]=F;F=f;f=0;}else if((G|0)==32){F=f;o=GV(U,S,c[S+40>>2]|0,b,e)|0;f=1;}a:do if((F|0)>0){D=d+(o*72|0)+24|0;E=d+(o*72|0)+32|0;C=(f|0)!=0;y=g?b+(a*56|0)+48|0:b+(a*56|0)+44|0;z=T+8|0;g=0;f=0;x=F;b:while(1){k=d+(x*72|0)|0;v=d+(x*72|0)+24|0;if(!(LV(v,D)|0))break a;m=d+(x*72|0)+56|0;u=c[m>>2]|0;n=KV()|0;p=KV()|0;c[e+(u*40|0)>>2]=1;c[e+(u*40|0)+4>>2]=a;c[e+(u*40|0)+32>>2]=n;c[e+(u*40|0)+36>>2]=p;c[e+(n*40|0)>>2]=3;c[e+(n*40|0)+24>>2]=x;c[e+(n*40|0)+28>>2]=u;c[e+(p*40|0)>>2]=3;w=JV(d)|0;c[e+(p*40|0)+24>>2]=w;A=d+(w*72|0)|0;c[d+(w*72|0)+68>>2]=1;c[e+(p*40|0)+28>>2]=u;g=(x|0)==(F|0)?w:g;u=d+(x*72|0)+32|0;if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0)f=w;s=A;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));c[m>>2]=n;c[d+(w*72|0)+56>>2]=p;t=d+(x*72|0)+48|0;m=d+(x*72|0)+52|0;k=(c[m>>2]|0)<1;do if((c[t>>2]|0)<1){if(k)break b;s=d+(x*72|0)+40|0;k=c[s>>2]|0;do if((k|0)>0?(M=d+(x*72|0)+44|0,N=c[M>>2]|0,(N|0)>0):0){r=d+(x*72|0)+60|0;k=c[r>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=N;c[d+(w*72|0)+44>>2]=-1;c[M>>2]=-1;c[d+(N*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=N;c[M>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;p=w;n=N;}else {c[d+(w*72|0)+44>>2]=-1;t=d+(w*72|0)+40|0;c[t>>2]=c[M>>2];n=c[s>>2]|0;c[M>>2]=n;c[s>>2]=k;c[d+(k*72|0)+48>>2]=x;p=x;k=c[t>>2]|0;}c[d+(n*72|0)+48>>2]=p;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[r>>2]=0;}else G=77;while(0);do if((G|0)==77){G=0;n=d+(k*72|0)+48|0;p=c[n>>2]|0;k=d+(k*72|0)+52|0;if((p|0)>0?(c[k>>2]|0)>0:0){k=c[d+(p*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[s>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;break}c[n>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[y>>2]|0;if((k|0)>0?(HV(k,b,S)|0)!=0:0){c[d+((c[m>>2]|0)*72|0)+40>>2]=x;n=d+(w*72|0)+52|0;k=w;}else {c[d+((c[d+(w*72|0)+52>>2]|0)*72|0)+44>>2]=w;n=m;k=x;}c[n>>2]=-1;c[d+(k*72|0)+48>>2]=-1;k=c[m>>2]|0;break}k=c[m>>2]|0;m=d+(k*72|0)+40|0;n=c[m>>2]|0;p=d+(k*72|0)+44|0;if((n|0)>0?(O=c[p>>2]|0,P=(n|0)==(x|0),(O|0)>0):0){c[d+(k*72|0)+60>>2]=P?O:n;c[d+(k*72|0)+64>>2]=P?1:2;}c[m>>2]=x;c[p>>2]=w;}else {if(!k){i=+h[u>>3];j=+h[H>>3];q=i-j;if(!(+B(+q)<=1.0e-07)){h[z>>3]=i;i=+h[S>>3];h[T>>3]=(+h[U>>3]-i)*(q/(+h[V>>3]-j))+i;s=(MV(T,v)|0)!=0;}else s=+h[v>>3]>+h[S>>3];r=d+(x*72|0)+40|0;k=c[r>>2]|0;do if((k|0)>0?(Q=d+(x*72|0)+44|0,R=c[Q>>2]|0,(R|0)>0):0){p=d+(x*72|0)+60|0;k=c[p>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=R;c[d+(w*72|0)+44>>2]=-1;c[Q>>2]=-1;c[d+(R*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=R;c[Q>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[r>>2]|0)*72|0)+48>>2]=x;n=w;m=R;}else {c[d+(w*72|0)+44>>2]=-1;X=d+(w*72|0)+40|0;c[X>>2]=c[Q>>2];m=c[r>>2]|0;c[Q>>2]=m;c[r>>2]=k;c[d+(k*72|0)+48>>2]=x;n=x;k=c[X>>2]|0;}c[d+(m*72|0)+48>>2]=n;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[p>>2]=0;}else G=106;while(0);do if((G|0)==106){G=0;m=d+(k*72|0)+48|0;n=c[m>>2]|0;k=d+(k*72|0)+52|0;if((n|0)>0?(c[k>>2]|0)>0:0){k=c[d+(n*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[r>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[r>>2]|0)*72|0)+48>>2]=x;break}c[m>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[t>>2]|0;c[d+(k*72|0)+40>>2]=x;c[d+(k*72|0)+44>>2]=-1;k=d+(x*72|0)+52|0;X=c[k>>2]|0;c[d+(X*72|0)+40>>2]=w;c[d+(X*72|0)+44>>2]=-1;c[d+(w*72|0)+48>>2]=X;c[d+(w*72|0)+52>>2]=-1;c[k>>2]=-1;k=-1;}else G=116;do if((G|0)==116){G=0;k=c[t>>2]|0;c[d+(k*72|0)+40>>2]=x;m=d+(k*72|0)+44|0;if(s){c[m>>2]=w;X=d+(x*72|0)+52|0;v=c[X>>2]|0;c[d+(v*72|0)+40>>2]=w;c[d+(v*72|0)+44>>2]=-1;c[X>>2]=-1;break}else {c[m>>2]=-1;k=d+(x*72|0)+52|0;X=c[k>>2]|0;c[d+(X*72|0)+40>>2]=x;c[d+(X*72|0)+44>>2]=w;c[d+(w*72|0)+48>>2]=X;c[d+(w*72|0)+52>>2]=-1;k=c[k>>2]|0;break}}while(0);break}s=d+(x*72|0)+40|0;k=c[s>>2]|0;do if((k|0)>0?(I=d+(x*72|0)+44|0,J=c[I>>2]|0,(J|0)>0):0){r=d+(x*72|0)+60|0;k=c[r>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=J;c[d+(w*72|0)+44>>2]=-1;c[I>>2]=-1;c[d+(J*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=J;c[I>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;p=w;n=J;}else {c[d+(w*72|0)+44>>2]=-1;X=d+(w*72|0)+40|0;c[X>>2]=c[I>>2];n=c[s>>2]|0;c[I>>2]=n;c[s>>2]=k;c[d+(k*72|0)+48>>2]=x;p=x;k=c[X>>2]|0;}c[d+(n*72|0)+48>>2]=p;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[r>>2]=0;}else G=51;while(0);do if((G|0)==51){G=0;n=d+(k*72|0)+48|0;p=c[n>>2]|0;k=d+(k*72|0)+52|0;if((p|0)>0?(c[k>>2]|0)>0:0){k=c[d+(p*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[s>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;break}c[n>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[y>>2]|0;if((k|0)>0?(HV(k,b,S)|0)!=0:0){c[d+((c[t>>2]|0)*72|0)+40>>2]=x;m=d+(w*72|0)+52|0;k=w;}else {c[d+((c[d+(w*72|0)+48>>2]|0)*72|0)+44>>2]=w;k=x;}c[m>>2]=-1;c[d+(k*72|0)+48>>2]=-1;k=c[t>>2]|0;break}k=c[t>>2]|0;m=d+(k*72|0)+40|0;n=c[m>>2]|0;p=d+(k*72|0)+44|0;if((n|0)>0?(K=c[p>>2]|0,L=(n|0)==(x|0),(K|0)>0):0){c[d+(k*72|0)+60>>2]=L?K:n;c[d+(k*72|0)+64>>2]=L?1:2;}c[m>>2]=x;c[p>>2]=w;}while(0);c[A>>2]=a;c[d+(x*72|0)+4>>2]=a;if((k|0)>0)x=k;else break a}U4(138424,19,1,c[15712]|0)|0;}else {g=0;f=0;}while(0);NV(a,F,o,1,d,e);NV(a,g,f,2,d,e);c[b+(a*56|0)+32>>2]=1;l=W;return}function FV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(!(c[b+(a*56|0)+32>>2]|0)){f=b+(a*56|0)|0;g=b+(a*56|0)+16|0;h=b+(a*56|0)+36|0;c[h>>2]=c[d+((GV(f,g,c[h>>2]|0,b,e)|0)*72|0)+56>>2];a=b+(a*56|0)+40|0;c[a>>2]=c[d+((GV(g,f,c[a>>2]|0,b,e)|0)*72|0)+56>>2];}return}function GV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0,r=0;o=a+8|0;q=b+8|0;a:while(1){b:do switch(c[f+(d*40|0)>>2]|0){case 3:{r=3;break a}case 2:{g=+h[o>>3];i=f+(d*40|0)+8|0;j=+h[f+(d*40|0)+16>>3];k=j+1.0e-07;do if(!(g>k)){l=j+-1.0e-07;if(!(g>3]>+h[i>>3]:0)break;if(+B(+(g-j))<=1.0e-07?(m=+h[i>>3],+B(+(+h[a>>3]-m))<=1.0e-07):0){g=+h[q>>3];do if(!(g>k)){if(!(g>3]>m:0)break;d=f+(d*40|0)+32|0;break b}while(0);d=f+(d*40|0)+36|0;break b}d=f+(d*40|0)+32|0;break b}while(0);d=f+(d*40|0)+36|0;break}case 1:{g=+h[o>>3];i=c[f+(d*40|0)+4>>2]|0;if(+B(+(g-+h[e+(i*56|0)+8>>3]))<=1.0e-07?(n=+h[a>>3],+B(+(n-+h[e+(i*56|0)>>3]))<=1.0e-07):0)j=n;else r=19;do if((r|0)==19){r=0;if(+B(+(g-+h[e+(i*56|0)+24>>3]))<=1.0e-07?(p=+h[a>>3],+B(+(p-+h[e+(i*56|0)+16>>3]))<=1.0e-07):0){j=p;break}if(!(HV(i,e,a)|0)){d=f+(d*40|0)+36|0;break b}else {d=f+(d*40|0)+32|0;break b}}while(0);if(!(+B(+(g-+h[q>>3]))<=1.0e-07))if(!(HV(i,e,b)|0)){d=f+(d*40|0)+36|0;break b}else {d=f+(d*40|0)+32|0;break b}else if(+h[b>>3]>2]|0;}if((r|0)==3)return c[f+(d*40|0)+24>>2]|0;else if((r|0)==31){U4(138358,35,1,c[15712]|0)|0;qa(138394,138396,349,138408);}return 0}function HV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0.0;f=b+(a*56|0)+16|0;g=+h[b+(a*56|0)+24>>3];i=b+(a*56|0)|0;e=+h[b+(a*56|0)+8>>3];do if(!(g>e+1.0e-07)){if(!(g>3]>+h[i>>3]:0){j=4;break}d=+h[c+8>>3];if(+B(+(g-d))<=1.0e-07){d=+h[c>>3]<+h[f>>3]?1.0:-1.0;break}if(!(+B(+(e-d))<=1.0e-07)){k=+h[f>>3];d=(+h[i>>3]-k)*(d-g)-(+h[c>>3]-k)*(e-g);break}else {d=+h[c>>3]<+h[i>>3]?1.0:-1.0;break}}else j=4;while(0);do if((j|0)==4){d=+h[c+8>>3];if(+B(+(g-d))<=1.0e-07){d=+h[c>>3]<+h[f>>3]?1.0:-1.0;break}if(!(+B(+(e-d))<=1.0e-07)){k=+h[i>>3];d=(+h[f>>3]-k)*(d-e)-(+h[c>>3]-k)*(g-e);break}else {d=+h[c>>3]<+h[i>>3]?1.0:-1.0;break}}while(0);return d>0.0|0}function IV(a,b,d){a=a|0;b=b|0;d=d|0;return c[b+((c[((d|0)==1?b+(a*56|0)+48|0:b+(a*56|0)+44|0)>>2]|0)*56|0)+32>>2]|0}function JV(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=c[47395]|0;if((b|0)<(c[47394]|0)){c[a+(b*72|0)>>2]=-1;c[a+(b*72|0)+4>>2]=-1;c[a+(b*72|0)+68>>2]=1;c[47395]=b+1;l=e;return b|0}else {e=c[15712]|0;c[d>>2]=b;w4(e,138483,d)|0;qa(138394,138396,88,138521);}return 0}function KV(){var a=0;a=c[47396]|0;if((a|0)<(c[47393]|0)){c[47396]=a+1;return a|0}else {U4(138444,30,1,c[15712]|0)|0;qa(138394,138396,72,138475);}return 0}function LV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(c>d+1.0e-07))if(c>3]>=+h[b>>3]&1;else a=1;return a|0}function MV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(cd+1.0e-07)a=0;else a=+h[a>>3]<+h[b>>3]&1;else a=1;return a|0}function NV(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=f+(d*72|0)+24|0;p=(e|0)==1;a:while(1){o=f+(b*72|0)+24|0;j=f+(b*72|0)+48|0;k=f+(b*72|0)+52|0;l=f+(b*72|0)|0;m=f+(b*72|0)+4|0;n=f+(b*72|0)+56|0;if((b|0)<=0)break;while(1){if(!(LV(o,q)|0))break a;d=c[j>>2]|0;e=(d|0)>0;do if(p){if(e?(c[f+(d*72|0)+4>>2]|0)==(a|0):0)break;d=c[k>>2]|0;if((d|0)<=0){b=d;continue a}if((c[f+(d*72|0)+4>>2]|0)!=(a|0)){b=d;continue a}}else {if(e?(c[f+(d*72|0)>>2]|0)==(a|0):0)break;d=c[k>>2]|0;if((d|0)<=0){b=d;continue a}if((c[f+(d*72|0)>>2]|0)!=(a|0)){b=d;continue a}}while(0);if((c[l>>2]|0)!=(c[f+(d*72|0)>>2]|0)){b=d;continue a}if((c[m>>2]|0)!=(c[f+(d*72|0)+4>>2]|0)){b=d;continue a}r=c[f+(d*72|0)+56>>2]|0;e=c[g+(r*40|0)+28>>2]|0;h=g+(e*40|0)+32|0;i=c[n>>2]|0;if((c[h>>2]|0)==(r|0))c[h>>2]=i;else c[g+(e*40|0)+36>>2]=i;e=c[f+(d*72|0)+48>>2]|0;c[j>>2]=e;do if((e|0)>0){h=f+(e*72|0)+40|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=b;break}e=f+(e*72|0)+44|0;if((c[e>>2]|0)==(d|0))c[e>>2]=b;}while(0);e=c[f+(d*72|0)+52>>2]|0;c[k>>2]=e;do if((e|0)>0){h=f+(e*72|0)+40|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=b;break}e=f+(e*72|0)+44|0;if((c[e>>2]|0)==(d|0))c[e>>2]=b;}while(0);r=f+(d*72|0)+24|0;c[o>>2]=c[r>>2];c[o+4>>2]=c[r+4>>2];c[o+8>>2]=c[r+8>>2];c[o+12>>2]=c[r+12>>2];c[f+(d*72|0)+68>>2]=2;}}return}function OV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[d+8>>3];do if(!(e>f+1.0e-07)){if(!(+B(+(e-f))<=1.0e-07)){c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}if(+h[b>>3]>+h[d>>3]+1.0e-07){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}while(0);return}function PV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[d+8>>3];do if(!(e>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}if(+h[b>>3]<+h[d>>3]){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}while(0);return}function QV(a){a=a|0;var b=0;b=JK(8)|0;if(b|0){c[b+4>>2]=a;c[b>>2]=0;}return b|0}function RV(a,b){a=a|0;b=b|0;if(b){b=QV(b)|0;c[b>>2]=a;a=b;}return a|0}function SV(a){a=a|0;var b=0;do{b=a;a=c[a>>2]|0;U1(b);}while((a|0)!=0);return}function TV(){var a=0;a=JK(1992)|0;if(a|0)c[a>>2]=UV(a)|0;return a|0}function UV(a){a=a|0;var b=0;b=_V(a)|0;c[b+4>>2]=0;a=a+1972|0;c[a>>2]=(c[a>>2]|0)+1;return b|0}function VV(a){a=a|0;WV(a,c[a>>2]|0);U1(c[a>>2]|0);U1(a);return 0}function WV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=a+1980|0;h=a+1912|0;i=a+1936|0;a:do if((c[b+4>>2]|0)>0){d=0;while(1){if((d|0)==64)break a;e=b+8+(d*20|0)+16|0;f=c[e>>2]|0;if(f|0?(WV(a,f),U1(c[e>>2]|0),eW(b,d),c[g>>2]=(c[g>>2]|0)+-1,c[h>>2]|0):0)c[i>>2]=(c[i>>2]|0)+1;d=d+1|0;}}else {d=0;while(1){if((d|0)==64)break a;if(c[b+8+(d*20|0)+16>>2]|0?(eW(b,d),c[g>>2]=(c[g>>2]|0)+-1,c[h>>2]|0):0)c[i>>2]=(c[i>>2]|0)+1;d=d+1|0;}}while(0);return}function XV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;if(!b)qa(138879,138529,194,138537);e=c[b+4>>2]|0;if((e|0)<=-1)qa(138549,138529,195,138537);if(!d)qa(138821,138529,196,138537);i=a+1952|0;c[i>>2]=(c[i>>2]|0)+1;a:do if((e|0)>0){i=0;e=0;while(1){if((i|0)==64)break a;f=b+8+(i*20|0)+16|0;if((c[f>>2]|0)!=0?(jW(d,b+8+(i*20|0)|0)|0)!=0:0){g=XV(a,c[f>>2]|0,d)|0;if(!e)e=g;else {f=e;while(1){h=c[f>>2]|0;if(!h)break;else f=h;}c[f>>2]=g;}}i=i+1|0;}}else {g=0;e=0;while(1){if((g|0)==64)break a;f=b+8+(g*20|0)|0;if((c[b+8+(g*20|0)+16>>2]|0)!=0?(jW(d,f)|0)!=0:0)e=RV(e,f)|0;g=g+1|0;}}while(0);return e|0}function YV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;k=p+52|0;m=p+32|0;n=p+16|0;o=p;c[k>>2]=0;if(!((b|0)!=0&(e|0)!=0))qa(138735,138529,247,138563);if((f|0)>-1?(j=c[e>>2]|0,(c[j+4>>2]|0)>=(f|0)):0){g=0;while(1){if((g|0)>=2)break;if((c[b+(g<<2)>>2]|0)>(c[b+(g+2<<2)>>2]|0)){h=8;break}else g=g+1|0;}if((h|0)==8)qa(138610,138529,250,138563);i=a+1912|0;g=a+1908|0;h=c[g>>2]|0;if(c[i>>2]|0){q=h|0?a+1924|0:a+1916|0;c[q>>2]=(c[q>>2]|0)+1;}if(!h){q=a+1964|0;c[q>>2]=(c[q>>2]|0)+1;}if(!(ZV(a,b,d,j,k,f)|0))g=0;else {if(c[i>>2]|0){q=c[g>>2]|0?a+1948|0:a+1944|0;c[q>>2]=(c[q>>2]|0)+1;}g=_V(a)|0;q=a+1976|0;c[q>>2]=(c[q>>2]|0)+1;q=c[e>>2]|0;c[g+4>>2]=(c[q+4>>2]|0)+1;bW(n,q);c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];q=m+16|0;c[q>>2]=c[e>>2];dW(a,m,g,0)|0;bW(o,c[k>>2]|0);c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[q>>2]=c[k>>2];dW(a,m,g,0)|0;c[e>>2]=g;g=a+1980|0;c[g>>2]=(c[g>>2]|0)+2;g=1;}l=p;return g|0}qa(138575,138529,248,138563);return 0}function ZV(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+80|0;m=q+52|0;n=q+48|0;o=q+32|0;p=q+16|0;k=q;c[n>>2]=0;if(!((b|0)!=0&(e|0)!=0&(f|0)!=0))qa(138653,138529,311,138667);if((g|0)>-1?(i=e+4|0,h=c[i>>2]|0,(h|0)>=(g|0)):0){if(c[a+1912>>2]|0){h=c[a+1908>>2]|0?a+1948|0:a+1944|0;c[h>>2]=(c[h>>2]|0)+1;h=c[i>>2]|0;}do if((h|0)>(g|0)){i=cW(b,e)|0;h=e+8+(i*20|0)+16|0;i=e+8+(i*20|0)|0;if(!(ZV(a,b,d,c[h>>2]|0,n,g)|0)){iW(o,b,i);c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];j=0;break}else {bW(p,c[h>>2]|0);c[i>>2]=c[p>>2];c[i+4>>2]=c[p+4>>2];c[i+8>>2]=c[p+8>>2];c[i+12>>2]=c[p+12>>2];j=c[n>>2]|0;c[m+16>>2]=j;bW(k,j);c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];j=a+1980|0;c[j>>2]=(c[j>>2]|0)+1;j=dW(a,m,e,f)|0;break}}else if((h|0)==(g|0)){c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];c[m+16>>2]=d;j=a+1980|0;c[j>>2]=(c[j>>2]|0)+1;j=dW(a,m,e,f)|0;break}else qa(138712,138529,341,138667);while(0);l=q;return j|0}qa(138680,138529,312,138667);return 0}function _V(a){a=a|0;a=a+1968|0;c[a>>2]=(c[a>>2]|0)+1;a=T1(1288)|0;$V(a);return a|0}function $V(a){a=a|0;var b=0;c[a>>2]=0;c[a+4>>2]=-1;b=0;while(1){if((b|0)==64)break;aW(a+8+(b*20|0)|0);b=b+1|0;}return}function aW(a){a=a|0;fW(a);c[a+16>>2]=0;return}function bW(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;g=i+16|0;h=i;if(!b)qa(138879,138718,99,138725);fW(g);d=1;f=0;while(1){if((f|0)==64)break;do if(c[b+8+(f*20|0)+16>>2]|0){e=b+8+(f*20|0)|0;if(!d){iW(h,g,e);c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];c[g+8>>2]=c[h+8>>2];c[g+12>>2]=c[h+12>>2];d=0;break}else {c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];d=0;break}}while(0);f=f+1|0;}c[a>>2]=c[g>>2];c[a+4>>2]=c[g+4>>2];c[a+8>>2]=c[g+8>>2];c[a+12>>2]=c[g+12>>2];l=i;return}function cW(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;k=l;l=l+32|0;i=k+16|0;j=k;if(!((a|0)!=0&(b|0)!=0))qa(138735,138718,125,138742);d=0;e=0;f=0;g=1;h=0;while(1){if((h|0)==64)break;if(c[b+8+(h*20|0)+16>>2]|0){n=b+8+(h*20|0)|0;p=hW(n)|0;iW(j,a,n);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];n=(hW(i)|0)-p|0;m=(g|0)!=0|(n|0)<(f|0);o=m|(p|0)<(e|0)&(n|0)==(f|0);d=o?h:d;e=o?p:e;f=o?n:f;g=m?0:g;}h=h+1|0;}l=k;return d|0}function dW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(!b)qa(138901,138718,167,138753);if(!d)qa(138879,138718,168,138753);do if((c[d>>2]|0)<64){a=0;while(1){if((a|0)>=64){e=10;break}if(!(c[d+8+(a*20|0)+16>>2]|0)){e=8;break}a=a+1|0;}if((e|0)==8){f=d+8+(a*20|0)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];f=0;g=d;break}else if((e|0)==10)qa(138763,138718,178,138753);}else {if(c[a+1912>>2]|0){h=c[a+1908>>2]|0?a+1948|0:a+1944|0;c[h>>2]=(c[h>>2]|0)+1;}if(!e)qa(138776,138718,187,138753);else {kW(a,d,b,e);f=1;g=(c[d+4>>2]|0)==0?a+1972|0:a+1976|0;break}}while(0);c[g>>2]=(c[g>>2]|0)+1;return f|0}function eW(a,b){a=a|0;b=b|0;if(!((a|0)!=0&b>>>0<64))qa(138780,138718,201,138808);if(!(c[a+8+(b*20|0)+16>>2]|0))qa(139302,138718,202,138808);else {aW(a+8+(b*20|0)|0);c[a>>2]=(c[a>>2]|0)+-1;return}}function fW(a){a=a|0;var b=0;b=0;while(1){if((b|0)==4)break;c[a+(b<<2)>>2]=0;b=b+1|0;}return}function gW(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;c[d>>2]=1;c[d+8>>2]=-1;b=1;while(1){if((b|0)==2)break;c[d+(b+2<<2)>>2]=0;c[d+(b<<2)>>2]=0;b=b+1|0;}c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];l=e;return}function hW(a){a=a|0;var b=0,d=0,e=0;if(!a)qa(138821,138823,128,138835);a:do if((c[a>>2]|0)>(c[a+8>>2]|0))b=0;else {b=1;d=0;while(1){if((d|0)==2)break a;e=O(c[a+(d+2<<2)>>2]|0,b)|0;b=e-(c[a+(d<<2)>>2]|0)|0;d=d+1|0;}}while(0);return b|0}function iW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;g=l;l=l+16|0;f=g;if(!((b|0)!=0&(d|0)!=0))qa(138844,138823,195,138852);do if((c[b>>2]|0)>(c[b+8>>2]|0)){c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];}else {if((c[d>>2]|0)>(c[d+8>>2]|0)){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else e=0;while(1){if((e|0)==2)break;j=c[b+(e<<2)>>2]|0;h=c[d+(e<<2)>>2]|0;c[f+(e<<2)>>2]=(j|0)<(h|0)?j:h;h=e+2|0;j=c[b+(h<<2)>>2]|0;i=c[d+(h<<2)>>2]|0;c[f+(h<<2)>>2]=(j|0)>(i|0)?j:i;e=e+1|0;}c[a>>2]=c[f>>2];c[a+4>>2]=c[f+4>>2];c[a+8>>2]=c[f+8>>2];c[a+12>>2]=c[f+12>>2];}while(0);l=g;return}function jW(a,b){a=a|0;b=b|0;var d=0,e=0;if((a|0)!=0&(b|0)!=0)d=0;else qa(138864,138823,216,138871);while(1){if((d|0)>=2){d=1;break}e=d+2|0;if((c[a+(d<<2)>>2]|0)>(c[b+(e<<2)>>2]|0)){d=0;break}if((c[b+(d<<2)>>2]|0)>(c[a+(e<<2)>>2]|0)){d=0;break}else d=d+1|0;}return d|0}function kW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0;if(!b)qa(138879,138881,40,138891);if(!d)qa(138901,138881,41,138891);j=a+1912|0;if(c[j>>2]|0){i=c[a+1908>>2]|0?a+1932|0:a+1928|0;c[i>>2]=(c[i>>2]|0)+1;}h=b+4|0;i=c[h>>2]|0;lW(a,b,d);d=a+1324|0;mW(a);f=hW(a+1852|0)|0;f=(hW(a+1868|0)|0)+f|0;if(c[j>>2]|0?(f|0)!=0&(c[a+1908>>2]|0)==0:0){j=a+1960|0;g[j>>2]=+((c[a+1320>>2]|0)>>>0)/+(f|0)+ +g[j>>2];}j=_V(a)|0;c[e>>2]=j;c[h>>2]=i;c[j+4>>2]=i;nW(a,b,j,d);if(((c[c[e>>2]>>2]|0)+(c[b>>2]|0)|0)==65)return;else qa(138903,138881,86,138891);}function lW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+16|0;g=h;if(!b)qa(138879,138881,106,139290);if(!d)qa(138901,138881,107,139290);else e=0;while(1){if((e|0)>=64)break;if(!(c[b+8+(e*20|0)+16>>2]|0)){f=7;break}j=b+8+(e*20|0)|0;i=a+4+(e*20|0)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];c[i+16>>2]=c[j+16>>2];e=e+1|0;}if((f|0)==7)qa(139302,138881,111,139290);e=a+4|0;j=a+1284|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];c[j+16>>2]=c[d+16>>2];d=a+1304|0;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];e=1;while(1){if((e|0)==65)break;iW(g,d,a+4+(e*20|0)|0);c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];e=e+1|0;}c[a+1320>>2]=hW(d)|0;$V(b);l=h;return}function mW(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;u=l;l=l+48|0;i=u+32|0;k=u+16|0;m=u;oW(a);pW(a);q=a+1844|0;s=a+1848|0;t=a+1892|0;n=a+1852|0;o=a+1884|0;p=a+1868|0;j=a+1888|0;f=0;e=0;while(1){d=c[q>>2]|0;b=c[s>>2]|0;if((b+d|0)>=65)break;h=65-(c[t>>2]|0)|0;if((d|0)<(h|0)&(b|0)<(h|0)){g=-1;h=0;}else {r=12;break}while(1){if((h|0)==65)break;if(!(c[a+1584+(h<<2)>>2]|0)){v=a+4+(h*20|0)|0;iW(k,v,n);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];b=hW(i)|0;d=c[o>>2]|0;iW(m,v,p);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];v=hW(i)|0;b=v-(c[j>>2]|0)+(d-b)|0;d=(b|0)>-1;b=d?b:0-b|0;d=(d^1)&1;if((b|0)<=(g|0))if((b|0)==(g|0)){v=(c[a+1844+(d<<2)>>2]|0)<(c[a+1844+(f<<2)>>2]|0);b=g;d=v?d:f;e=v?h:e;}else {b=g;d=f;}else e=h;}else {b=g;d=f;}g=b;h=h+1|0;f=d;}qW(a,e,f);}if((r|0)==12){b=(d|0)>=(65-(c[t>>2]|0)|0)&1;d=0;while(1){if((d|0)==65)break;if(!(c[a+1584+(d<<2)>>2]|0))qW(a,d,b);d=d+1|0;}d=c[q>>2]|0;b=c[s>>2]|0;}if((b+d|0)!=65)qa(139046,138881,210,139132);v=c[t>>2]|0;if((d|0)<(v|0)|(b|0)<(v|0))qa(139143,138881,212,139132);else {l=u;return}}function nW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if(!b)qa(138879,138881,297,138943);if(!d)qa(138953,138881,298,138943);if(!e)qa(138955,138881,299,138943);else f=0;while(1){if((f|0)>=65){e=14;break}e=c[a+1324+(f<<2)>>2]|0;if(e>>>0>=2){e=9;break}switch(e|0){case 0:{dW(a,a+4+(f*20|0)|0,b,0)|0;break}case 1:{dW(a,a+4+(f*20|0)|0,d,0)|0;break}default:{}}f=f+1|0;}if((e|0)==9)qa(138957,138881,303,138943);else if((e|0)==14)return}function oW(a){a=a|0;var b=0,d=0,e=0,f=0;d=l;l=l+16|0;e=d;c[a+1848>>2]=0;c[a+1844>>2]=0;b=a+1852|0;f=a+1868|0;gW(e);c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[a+1888>>2]=0;c[a+1884>>2]=0;b=0;while(1){if((b|0)==65)break;c[a+1584+(b<<2)>>2]=0;c[a+1324+(b<<2)>>2]=-1;b=b+1|0;}l=d;return}function pW(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;o=l;l=l+304|0;k=o+32|0;m=o+16|0;n=o;b=0;while(1){if((b|0)==65)break;c[k+(b<<2)>>2]=hW(a+4+(b*20|0)|0)|0;b=b+1|0;}b=0;d=0;e=0;g=0;a:while(1){if((g|0)==64)break;i=g+1|0;j=a+4+(g*20|0)|0;h=k+(g<<2)|0;f=i;while(1){if((f|0)==65){g=i;continue a}iW(n,j,a+4+(f*20|0)|0);c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];p=hW(m)|0;p=p-(c[h>>2]|0)-(c[k+(f<<2)>>2]|0)|0;q=p>>>0>e>>>0;r=q?f:b;f=f+1|0;b=r;d=q?g:d;e=q?p:e;}}qW(a,d,0);qW(a,b,1);l=o;return}function qW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;e=a+1584+(b<<2)|0;if(c[e>>2]|0)qa(139246,138881,257,139281);c[a+1324+(b<<2)>>2]=d;c[e>>2]=1;g=a+1844+(d<<2)|0;f=a+1852+(d<<4)|0;e=a+4+(b*20|0)|0;if(!(c[g>>2]|0)){c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];}else {iW(h,e,f);c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];}c[a+1884+(d<<2)>>2]=hW(f)|0;c[g>>2]=(c[g>>2]|0)+1;l=i;return}function rW(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1200|0;r=t+800|0;g=t;c[47397]=0;c[47398]=-2;f=r;i=200;n=g;p=0;q=0;o=r;a:while(1){b[o>>1]=p;if((f+(i<<1)+-2|0)>>>0>o>>>0)k=i;else {m=o-f>>1;e=m+1|0;if(i>>>0>9999){s=95;break}k=i<<1;k=k>>>0<1e4?k:1e4;h=T1(k*6|3)|0;if(h){W6(h|0,f|0,e<<1|0)|0;i=h+(k>>>1<<2)|0;W6(i|0,n|0,e<<2|0)|0;if((f|0)==(r|0)){e=0;f=h;}else {U1(f);e=0;f=h;}}else {e=4;i=n;}j=(e|0)==0;h=f+(m<<1)|0;switch((j?((f+(k<<1)+-2|0)>>>0>h>>>0?0:9):e)&15){case 9:{e=1;s=96;break a}case 4:{s=95;break a}case 0:{g=j?i+(m<<2)|0:g;n=i;o=j?h:o;break}default:{e=0;break a}}}if((p|0)==31){e=0;s=96;break}e=b[65534+(p<<1)>>1]|0;j=e<<16>>16;do if(e<<16>>16!=-82){h=c[47398]|0;if((h|0)==-2){h=GX()|0;c[47398]=h;}if((h|0)>=1)if(h>>>0<296)i=d[139321+h>>0]|0;else i=2;else {c[47398]=0;i=0;}h=i+j|0;if(h>>>0<=271?(i|0)==(a[139617+h>>0]|0):0){p=a[139889+h>>0]|0;e=p<<24>>24;if(p<<24>>24<1){h=0-e|0;s=23;break}else {c[47398]=-2;g=g+4|0;c[g>>2]=c[47399];j=(q|0)==0?0:q+-1|0;h=o;break}}else s=22;}else s=22;while(0);if((s|0)==22){s=0;p=a[140161+p>>0]|0;h=p&255;if(!(p<<24>>24)){h=c[47398]|0;b:do switch(q|0){case 0:{c[47397]=(c[47397]|0)+1;MW(143761);h=o;break}case 3:if((h|0)<1)if(!h){e=1;s=96;break a}else {h=o;break b}else {c[47398]=-2;h=o;break b}default:h=o;}while(0);while(1){if(e<<16>>16==8)break;if((h|0)==(f|0)){e=1;s=96;break a}e=h+-2|0;g=g+-4|0;h=e;e=b[65534+(b[e>>1]<<1)>>1]|0;}g=g+4|0;c[g>>2]=c[47399];e=1;j=3;}else s=23;}do if((s|0)==23){s=0;j=d[140277+h>>0]|0;e=c[g+(1-j<<2)>>2]|0;do switch(h|0){case 4:{s=26;break a}case 2:{c[47400]=sW(c[g+-4>>2]|0,2)|0;break}case 3:{c[47400]=sW(c[g+-4>>2]|0,1)|0;break}case 5:{e=uW()|0;break}case 8:{vW(c[47401]|0);break}case 9:{wW(c[g>>2]|0);break}case 18:{xW(c[g>>2]|0);break}case 19:{yW();break}case 20:{xW(c[g>>2]|0);break}case 21:{yW();break}case 22:{xW(c[g>>2]|0);break}case 23:{yW();break}case 24:{xW(c[g>>2]|0);break}case 25:{yW();break}case 26:{xW(c[g>>2]|0);break}case 27:{yW();break}case 28:{xW(c[g>>2]|0);break}case 29:{yW();break}case 30:{xW(c[g>>2]|0);break}case 31:{yW();break}case 32:{xW(c[g>>2]|0);break}case 33:{yW();break}case 34:{e=c[g+-4>>2]|0;break}case 35:{e=c[g>>2]|0;break}case 38:{e=c[47401]|0;i=c[e+4>>2]|0;if(i>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;i=c[47401]|0;e=i;i=c[i+4>>2]|0;}a[i>>0]=0;p=c[e>>2]|0;c[e+4>>2]=p;if(zW(p)|0){s=51;break a}c[(c[g>>2]|0)+80>>2]=c[47402];e=Vz(56032,c[4580]|0)|0;c[(c[g>>2]|0)+84>>2]=e;c[47402]=c[g>>2];c[(c[g>>2]|0)+108>>2]=c[c[47403]>>2];e=c[g>>2]|0;break}case 39:{e=c[47401]|0;i=c[e+4>>2]|0;if(i>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;i=c[47401]|0;e=i;i=c[i+4>>2]|0;}a[i>>0]=0;p=c[e>>2]|0;c[e+4>>2]=p;if(zW(p)|0){s=56;break a}e=c[47402]|0;c[47402]=c[e+80>>2];break}case 40:{e=c[g>>2]|0;break}case 41:{e=c[g+-4>>2]|0;break}case 42:{e=c[g+-4>>2]|0;break}case 43:{e=c[g+-4>>2]|0;break}case 44:{e=c[g+-4>>2]|0;break}case 45:{e=c[g+-4>>2]|0;break}case 48:{e=c[g>>2]|0;break}case 49:{e=c[g>>2]|0;break}case 50:{a[(c[g+-8>>2]|0)+12>>0]=1;e=c[g>>2]|0;break}case 51:{AW();break}case 52:{e=BW()|0;break}case 53:{e=c[g>>2]|0;break}case 54:{e=c[g>>2]|0;break}case 55:{e=(c[g+-8>>2]|0)+100|0;a[e>>0]=a[e>>0]|1;e=c[g>>2]|0;break}case 56:{CW(c[g+-4>>2]|0,c[g>>2]|0,1);break}case 57:{e=c[g+-12>>2]|0;break}case 58:{CW(c[g+-4>>2]|0,c[g>>2]|0,2);break}case 59:{e=c[g+-12>>2]|0;break}case 60:{CW(c[g+-4>>2]|0,c[g>>2]|0,3);break}case 61:{e=c[g+-12>>2]|0;break}case 62:{CW(c[g>>2]|0,uW()|0,2);break}case 63:{e=c[g+-8>>2]|0;break}case 64:{e=c[g+-4>>2]|0;break}case 65:{e=c[g>>2]|0;break}default:{}}while(0);i=0-j|0;p=g+(i<<2)|0;i=o+(i<<1)|0;g=p+4|0;c[p+4>>2]=e;e=(d[140449+h>>0]|0)+-41|0;p=b[i>>1]|0;h=p+(b[65766+(e<<1)>>1]|0)|0;if(h>>>0<272?(a[139617+h>>0]|0)==(p|0):0){e=a[139889+h>>0]|0;j=q;h=i;break}e=a[140519+e>>0]|0;j=q;h=i;}while(0);i=k;p=e;q=j;o=h+2|0;}if((s|0)==26){tW();e=1;s=96;}else if((s|0)==51){MW(140347);tW();e=1;s=96;}else if((s|0)==56){MW(140398);tW();e=1;s=96;}else if((s|0)==95){MW(140558);e=2;s=96;}if((s|0)==96)if((f|0)!=(r|0))U1(f);l=t;return e|0}function sW(b,d){b=b|0;d=d|0;var e=0;e=JK(8)|0;a[e+4>>0]=d;c[e>>2]=b;return e|0}function tW(){var a=0,b=0;a=c[47402]|0;b=c[47400]|0;if(b|0){mU(b,1);c[47400]=0;}c[14021]=67;while(1){if(!a)break;b=c[a+80>>2]|0;GW(a);a=b;}c[14021]=56;c[14030]=68;b=c[47405]|0;nb[c[b>>2]&63](b,0,64)|0;c[14030]=56;c[14039]=69;b=c[47406]|0;nb[c[b>>2]&63](b,0,64)|0;c[14039]=56;JW();return}function uW(){var a=0,d=0,e=0,f=0,g=0,h=0;e=c[47406]|0;f=JK(40)|0;if(Xz(c[47405]|0)|0)wW(0);a=Xz(e)|0;b[f+4>>1]=a;a:do if(!a)a=e;else {c[f>>2]=JK(a*24|0)|0;a=0;d=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!d){a=e;break a}g=(c[f>>2]|0)+(a*24|0)|0;h=d+8|0;c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];c[g+8>>2]=c[h+8>>2];c[g+12>>2]=c[h+12>>2];c[g+16>>2]=c[h+16>>2];c[g+20>>2]=c[h+20>>2];a=a+1|0;d=nb[c[e>>2]&63](e,d,8)|0;}}while(0);nb[c[a>>2]&63](e,0,64)|0;return f|0}function vW(b){b=b|0;var d=0,e=0,f=0;e=JK(64)|0;f=b+4|0;d=c[f>>2]|0;if(d>>>0>=(c[b+8>>2]|0)>>>0){lA(b,1)|0;d=c[f>>2]|0;}a[d>>0]=0;b=c[b>>2]|0;c[f>>2]=b;c[e+8>>2]=D4(b)|0;c[e+12>>2]=c[c[47403]>>2];f=c[47405]|0;nb[c[f>>2]&63](f,e,1)|0;return}function wW(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=JK(32)|0;j=c[47405]|0;e=Xz(j)|0;k=i+8|0;a[i+14>>0]=d;a:do if(!e){c[k>>2]=JK(56)|0;b[i+12>>1]=1;h=D4(195059)|0;k=c[k>>2]|0;c[k>>2]=h;c[k+4>>2]=c[c[47403]>>2];}else {b[i+12>>1]=e;c[k>>2]=JK(e*56|0)|0;d=0;e=Tz(j)|0;while(1){if(!e)break a;f=(c[k>>2]|0)+(d*56|0)|0;g=e+8|0;h=f+56|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));d=d+1|0;e=c[e>>2]|0;}}while(0);nb[c[j>>2]&63](j,0,64)|0;k=c[47406]|0;nb[c[k>>2]&63](k,i,1)|0;return}function xW(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;g=j;i=JK(8)|0;f=c[c[47403]>>2]|0;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[g+16>>2]=c[a+16>>2];c[g+20>>2]=c[a+20>>2];c[g+24>>2]=c[a+24>>2];c[g+28>>2]=c[a+28>>2];if(f|0){a=g+4|0;if((c[a>>2]|0)==0?(b=c[f+4>>2]|0,b|0):0)c[a>>2]=b;a=g+16|0;if(+h[a>>3]<0.0?(d=+h[f+16>>3],d>=0.0):0)h[a>>3]=d;if((c[g>>2]|0)==0?(e=c[f>>2]|0,e|0):0)c[g>>2]=e;a=c[f+24>>2]&127;if(a|0){f=g+24|0;e=c[f>>2]|0;c[f>>2]=e&127|a|e&-128;}}f=c[(c[47404]|0)+144>>2]|0;c[i>>2]=nb[c[f>>2]&63](f,g,1)|0;c[i+4>>2]=c[47403];c[47403]=i;l=j;return}function yW(){var a=0,b=0;b=c[47403]|0;a=c[b+4>>2]|0;U1(b);c[47403]=a;return}function zW(b){b=b|0;var c=0;while(1){c=a[b>>0]|0;if(!(c<<24>>24)){b=0;break}if(c<<24>>24==32)b=b+1|0;else {b=1;break}}return b|0}function AW(){var b=0,d=0,e=0;e=Vz(56068,c[4580]|0)|0;b=c[47402]|0;d=JK(16)|0;c[d+8>>2]=e;if(a[b+112>>0]&2)a[d+12>>0]=1;e=c[b+84>>2]|0;nb[c[e>>2]&63](e,d,1)|0;return}function BW(){var a=0;a=c[(c[47402]|0)+84>>2]|0;return nb[c[a>>2]&63](a,0,256)|0}function CW(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=JK(16)|0;f=c[47402]|0;h=c[f+84>>2]|0;h=c[(nb[c[h>>2]&63](h,0,256)|0)+8>>2]|0;c[g+8>>2]=b;nb[c[h>>2]&63](h,g,1)|0;a[b+92>>0]=e;if(a[f+112>>0]&1)a[b+100>>0]=1;c[b+88>>2]=d;return}function DW(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function EW(a,b,d){a=a|0;b=b|0;d=d|0;Rz(c[b+8>>2]|0)|0;U1(b);return}function FW(a,b,d){a=a|0;b=b|0;d=d|0;KW(c[b+8>>2]|0);U1(b);return}function GW(a){a=a|0;Rz(c[a+84>>2]|0)|0;jU(a);U1(a);return}function HW(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+8>>2]|0);U1(b);return}function IW(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d+12|0;a=b[g>>1]|0;if(a<<16>>16){h=d+8|0;e=0;f=c[h>>2]|0;while(1){if((e|0)>=(a<<16>>16|0))break;U1(c[f>>2]|0);e=e+1|0;f=f+56|0;a=b[g>>1]|0;}U1(c[h>>2]|0);}U1(d);return}function JW(){var a=0,b=0;a=c[47403]|0;while(1){b=c[a+4>>2]|0;if(!b)break;U1(a);a=b;}return}function KW(b){b=b|0;var d=0;d=b+88|0;switch(a[b+92>>0]|0){case 1:{GW(c[d>>2]|0);break}case 2:{kU(c[d>>2]|0);break}default:{}}jU(b);U1(b);return}function LW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+160|0;e=f+8|0;g=f;c[g>>2]=0;c[g+4>>2]=0;c[47403]=g;c[47402]=0;c[47400]=0;c[47404]=c[(c[(c[d+52>>2]|0)+16>>2]|0)+144>>2];c[47405]=Vz(56104,c[4580]|0)|0;c[47406]=Vz(56140,c[4580]|0)|0;kA(e,128,f+24|0);c[47401]=e;if(!(PW(a,e,d)|0)){rW()|0;c[b>>2]=FX()|0;a=c[47400]|0;}Rz(c[47405]|0)|0;Rz(c[47406]|0)|0;c[47405]=0;c[47406]=0;c[47403]=0;oA(e);l=f;return a|0}function MW(b){b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;if(!(a[189661]|0)){a[189661]=1;f=NW()|0;c[d>>2]=b;c[d+4>>2]=f;gA(1,140575,d)|0;OW();}l=e;return}function NW(){return u_(c[47407]|0)|0}function OW(){var b=0,d=0,e=0,f=0;f=l;l=l+16|0;e=f;b=c[47410]|0;c[b+4>>2]=c[b>>2];d=c[47419]|0;if((d|0)>0){mA(b,c[47417]|0,d)|0;b=c[47410]|0;}mA(b,c[47416]|0,c[47418]|0)|0;d=c[47410]|0;b=c[d+4>>2]|0;if(b>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;b=c[47410]|0;d=b;b=c[b+4>>2]|0;}c[d+4>>2]=b+1;a[b>>0]=0;b=c[47410]|0;d=c[b>>2]|0;c[b+4>>2]=d;c[e>>2]=d;gA(3,140591,e)|0;l=f;return}function PW(b,e,f){b=b|0;e=e|0;f=f|0;c[47410]=e;kA(189644,128,0);c[47408]=b;a[189663]=0;a[189660]=0;a[189661]=0;c[47418]=0;c[47419]=0;a[189662]=1;f=f+52|0;e=UY(wK(d[(c[(c[f>>2]|0)+16>>2]|0)+115>>0]|0)|0)|0;c[47407]=e;h_(e,c[(c[(c[f>>2]|0)+16>>2]|0)+144>>2]|0);i_(c[47407]|0,70,27);j_(c[47407]|0,71);return 0}function QW(b,d,e){b=b|0;d=d|0;e=e|0;do if(!(c3(d,140603)|0)){c[47399]=UW(e)|0;a[189662]=0;c[47409]=286;}else {if(c3(d,140609)|0?c3(d,140612)|0:0){if(!(c3(d,140615)|0)){a[189662]=1;c[47399]=VW(e)|0;c[47409]=287;break}if(!(c3(d,140623)|0)){c[47399]=WW(b,e,0)|0;c[47409]=288;break}if(!(c3(d,140628)|0)){c[47399]=WW(b,0,1)|0;c[47409]=290;break}if(!(c3(d,140644)|0)){c[47399]=WW(b,0,32)|0;c[47409]=295;break}if(!(c3(d,140630)|0)){c[47399]=WW(b,0,4)|0;c[47409]=291;break}if(!(c3(d,140632)|0)){c[47399]=WW(b,0,64)|0;c[47409]=292;break}if(!(c3(d,140634)|0)){c[47399]=WW(b,0,2)|0;c[47409]=289;break}if(!(c3(d,140636)|0)){c[47399]=WW(b,0,8)|0;c[47409]=293;break}if(!(c3(d,140640)|0)){c[47399]=WW(b,0,16)|0;c[47409]=294;break}if(!(c3(d,140646)|0)){XW(e);c[47409]=283;break}if(!(c3(d,140649)|0)){c[47409]=277;break}if(!(c3(d,140652)|0)){c[47409]=280;break}if(!(c3(d,140655)|0)){c[47399]=YW(e)|0;c[47409]=285;break}if(!(c3(d,140618)|0)){c[47409]=262;break}else {TW(d);break}}a[189662]=0;c[47409]=260;}while(0);return}function RW(b,d){b=b|0;d=d|0;do if(!(c3(d,140603)|0)){c[47409]=264;a[189662]=1;}else {if(c3(d,140609)|0?c3(d,140612)|0:0){if(!(c3(d,140615)|0)){c[47409]=265;a[189662]=0;break}if(!(c3(d,140618)|0)){c[47409]=263;break}if(!(c3(d,140623)|0)){c[47409]=266;break}if(!(c3(d,140628)|0)){c[47409]=270;break}if(!(c3(d,140630)|0)){c[47409]=271;break}if(!(c3(d,140632)|0)){c[47409]=272;break}if(!(c3(d,140634)|0)){c[47409]=269;break}if(!(c3(d,140636)|0)){c[47409]=273;break}if(!(c3(d,140640)|0)){c[47409]=274;break}if(!(c3(d,140644)|0)){c[47409]=275;break}if(!(c3(d,140646)|0)){c[47409]=(c[47409]|0)==283?282:258;break}if(!(c3(d,140649)|0)){c[47409]=(c[47409]|0)==277?276:278;break}if(!(c3(d,140652)|0)){c[47409]=(c[47409]|0)==280?279:281;break}if(!(c3(d,140655)|0)){c[47409]=(c[47409]|0)==285?284:259;break}else {TW(d);break}}c[47409]=261;}while(0);return}function SW(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(a[189662]|0){b=0;while(1){if(!e)break;h=d+1|0;g=a[d>>0]|0;if((g&255)>31){d=c[47410]|0;f=c[d+4>>2]|0;if(f>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;f=c[47410]|0;d=f;f=c[f+4>>2]|0;}c[d+4>>2]=f+1;a[f>>0]=g;b=b+1|0;}d=h;e=e+-1|0;}if(b|0)c[47409]=267;}return}function TW(b){b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;c[47409]=268;a[189661]=1;f=NW()|0;c[e>>2]=b;c[e+4>>2]=f;gA(1,140659,e)|0;l=d;return}function UW(b){b=b|0;var d=0;d=JK(120)|0;c[d+100>>2]=-1;a[d+88>>0]=-1;ZW(d,56400,22,b,141611);return d|0}function VW(a){a=a|0;var c=0;c=JK(104)|0;b[c+80>>1]=1;b[c+82>>1]=1;ZW(c,56224,22,a,140965);return c|0}function WW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+32|0;e=f;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=0;c[e+28>>2]=0;h[e+16>>3]=-1.0;c[e+24>>2]=d&127;if(b|0)ZW(e,56200,3,b,140816);d=c[a+144>>2]|0;e=nb[c[d>>2]&63](d,e,1)|0;l=f;return e|0}function XW(a){a=a|0;c[47399]=0;ZW(189596,56192,1,a,140752);return}function YW(a){a=a|0;var b=0;b=JK(40)|0;ZW(b,56176,2,a,140698);return b|0}function ZW(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;m=o+8|0;while(1){k=c[g>>2]|0;if(!k)break;i=c[g+4>>2]|0;c[m>>2]=k;j=u5(m,e,f,8,104)|0;if(!j){c[n>>2]=k;c[n+4>>2]=h;gA(0,140704,n)|0;i=1;}else {i=lb[c[j+4>>2]&127](b,i)|0;i=(i|(d[189660]|0))&255;}a[189660]=i;g=g+8|0;}l=o;return}function _W(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function $W(a,b){a=a|0;b=b|0;c[a+36>>2]=D4(b)|0;return 0}function aX(a,b){a=a|0;b=b|0;c[a+32>>2]=D4(b)|0;return 0}function bX(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=(Y3(a[d>>0]|0)|0)<<24>>24;switch(f|0){case 82:{e=d+1|0;if(!(c3(e,140763)|0)){c[b>>2]=114;e=0;}else h=5;break}case 76:{h=6;break}default:{e=d+1|0;h=5;}}do if((h|0)==5)if(!(c3(e,140768)|0))h=6;else {if((f|0)!=67?(c3(e,140772)|0)==0:0){c[g>>2]=d;gA(0,140778,g)|0;e=1;break}c[b>>2]=110;e=0;}while(0);if((h|0)==6){c[b>>2]=108;e=0;}l=i;return e|0}function cX(a,b){a=a|0;b=b|0;c[a+4>>2]=b;return 0}function dX(a,b){a=a|0;b=b|0;c[a>>2]=b;return 0}function eX(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;if(!(fX(b,140845,0,255,d)|0)){h[a+16>>3]=+(c[d>>2]|0);a=0;}else a=1;l=e;return a|0}function fX(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+48|0;j=k+24|0;i=k+8|0;h=k;m=k+36|0;g=y4(a,m,10)|0;do if((c[m>>2]|0)!=(a|0)){if((g|0)>(e|0)){c[i>>2]=b;c[i+4>>2]=a;c[i+8>>2]=e;gA(0,140887,i)|0;a=1;break}if((g|0)<(d|0)){c[j>>2]=b;c[j+4>>2]=a;c[j+8>>2]=d;gA(0,140926,j)|0;a=1;break}else {c[f>>2]=g;a=0;break}}else {c[h>>2]=b;c[h+4>>2]=a;gA(0,140856,h)|0;a=1;}while(0);l=k;return a|0}function gX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|4;d=0;}else g=9;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|2;d=0;}else g=9;break}case 84:{if(!(c3(e+1|0,141563)|0)){d=d+36|0;b[d>>1]=b[d>>1]|6;d=0;}else g=9;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=9;break}default:g=9;}if((g|0)==9){c[f>>2]=e;gA(0,141567,f)|0;d=1;}l=h;return d|0}function hX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|512;d=0;}else g=7;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|256;d=0;}else g=7;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,141518,f)|0;d=1;}l=h;return d|0}function iX(a,b){a=a|0;b=b|0;c[a+20>>2]=D4(b)|0;return 0}function jX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141511,0,255,f)|0)){a[d+33>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|32;d=0;}else d=1;l=g;return d|0}function kX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141499,0,255,f)|0)){a[d+34>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|64;d=0;}else d=1;l=g;return d|0}function lX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141487,-128,127,f)|0)){a[d+32>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|128;d=0;}else d=1;l=g;return d|0}function mX(a,b){a=a|0;b=b|0;c[a+24>>2]=D4(b)|0;return 0}function nX(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=g+4|0;do if(!(fX(d,141442,0,65535,e)|0)){d=c[e>>2]|0;if(!d){gA(0,141450,f)|0;d=1;break}else {b[a+80>>1]=d;d=0;break}}else d=1;while(0);l=g;return d|0}function oX(a,e){a=a|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(d[e>>0]|0)|0)<<24>>24|0){case 84:{if(!(c3(e+1|0,141391)|0)){a=a+36|0;b[a>>1]=b[a>>1]|1;a=0;}else g=5;break}case 70:{if(!(c3(e+1|0,141395)|0))a=0;else g=5;break}default:g=5;}if((g|0)==5){c[f>>2]=e;gA(0,141400,f)|0;a=1;}l=h;return a|0}function pX(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;if(!(fX(b,141377,0,360,d)|0)){c[a+28>>2]=c[d>>2]&65535;a=0;}else a=1;l=e;return a|0}function qX(a,d){a=a|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141370,0,65535,e)|0)){b[a+40>>1]=c[e>>2];a=0;}else a=1;l=f;return a|0}function rX(a,b){a=a|0;b=b|0;c[a>>2]=D4(b)|0;return 0}function sX(a,b){a=a|0;b=b|0;c[a+16>>2]=D4(b)|0;return 0}function tX(a,b){a=a|0;b=b|0;c[a+4>>2]=D4(b)|0;return 0}function uX(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=g+4|0;do if(!(fX(d,141325,0,65535,e)|0)){d=c[e>>2]|0;if(!d){gA(0,141333,f)|0;d=1;break}else {b[a+82>>1]=d;d=0;break}}else d=1;while(0);l=g;return d|0}function vX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;i=k;h=0;a:while(1){b:while(1){g=e+1|0;e=a[e>>0]|0;if(!(e<<24>>24))break a;e=e<<24>>24;f=(d3(e)|0)+-98|0;switch(f>>>1|f<<31|0){case 5:{j=5;break b}case 9:{f=2048;break b}case 8:{j=6;break b}case 0:{j=7;break b}default:{}}c[i>>2]=e;c[i+4>>2]=e;gA(0,141272,i)|0;e=g;}if((j|0)==5){j=0;f=1024;}else if((j|0)==6){j=0;f=4096;}else if((j|0)==7){j=0;f=8192;}e=g;h=h|f;}if(h<<16>>16!=15360){j=d+36|0;b[j>>1]=b[j>>1]|h;}l=k;return 0}function wX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;h=D4(e)|0;g=d+42|0;f=0;e=h;while(1){d=A4(e,141182)|0;if(!d)break;if(((Y3(a[d>>0]|0)|0)&255|0)==82){e=d+1|0;if(!(c3(e,141185)|0)){b[g>>1]=b[g>>1]|4;d=f;e=0;f=d;continue}if(!(c3(e,141192)|0)){b[g>>1]=b[g>>1]|2;d=f;e=0;f=d;continue}else {c[i>>2]=d;gA(0,141198,i)|0;f=1;e=0;continue}}if(!(c3(d,141236)|0)){b[g>>1]=b[g>>1]&-385;d=f;e=0;f=d;continue}if(c3(d,141242)|0?c3(d,141252)|0:0){if(!(c3(d,141258)|0)){b[g>>1]=b[g>>1]|128;d=f;e=0;f=d;continue}if(!(c3(d,141265)|0)){b[g>>1]=b[g>>1]|256;d=f;e=0;f=d;continue}else {c[j>>2]=d;gA(0,141198,j)|0;f=1;e=0;continue}}b[g>>1]=b[g>>1]|32;d=f;e=0;f=d;}U1(h);l=k;return f|0}function xX(a,b){a=a|0;b=b|0;c[a+8>>2]=D4(b)|0;return 0}function yX(a,b){a=a|0;b=b|0;c[a+12>>2]=D4(b)|0;return 0}function zX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 66:{if(!(c3(e+1|0,141128)|0)){d=d+36|0;b[d>>1]=b[d>>1]|16;d=0;}else g=7;break}case 84:{if(!(c3(e+1|0,141134)|0)){d=d+36|0;b[d>>1]=b[d>>1]|8;d=0;}else g=7;break}case 77:{if(!(c3(e+1|0,141137)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,141143,f)|0;d=1;}l=h;return d|0}function AX(a,d){a=a|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141122,0,65535,e)|0)){b[a+38>>1]=c[e>>2];a=0;}else a=1;l=f;return a|0}function BX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|4;d=0;}else g=7;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|2;d=0;}else g=7;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,140778,f)|0;d=1;}l=h;return d|0}function CX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141720,0,127,e)|0)){a[b+88>>0]=c[e>>2];b=0;}else b=1;l=f;return b|0}function DX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((a[d>>0]|0)==42){b=b+112|0;a[b>>0]=a[b>>0]|1;b=0;}else {c[e>>2]=d;gA(0,141680,e)|0;b=1;}l=f;return b|0}function EX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((a[d>>0]|0)==42){b=b+112|0;a[b>>0]=a[b>>0]|2;b=0;}else {c[e>>2]=d;gA(0,141643,e)|0;b=1;}l=f;return b|0}function FX(){var b=0;b=(a[189661]|a[189660])<<24>>24;_Y(c[47407]|0);oA(189644);return b|0}function GX(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;c[47409]=0;d=0;a:do{b:do switch(a[189663]|0){case 2:{b=-1;break a}case 0:{a[189663]=1;h=6;b=141732;d=0;break}default:{b=c[47408]|0;if(!(a[b>>0]|0)){a[189663]=2;h=7;b=141739;break b}else {d=HX(b)|0;h=d-b|0;break b}}}while(0);c[47417]=c[47416];c[47419]=c[47418];c[47416]=b;c[47418]=h;e=c[47412]|0;f=e-(c[47411]|0)|0;g=c[47407]|0;if(!f)b=k_(g,b,h,(h|0)==0&1)|0;else {if(e>>>0<(c[47413]|0)>>>0)b=e;else {lA(189644,1)|0;b=c[47412]|0;}a[b>>0]=0;b=c[47411]|0;c[47412]=b;b=k_(g,b,f,0)|0;}if(!((b|0)!=0|(a[189661]|0)!=0)){g=v_(t_(c[47407]|0)|0)|0;h=NW()|0;c[i>>2]=g;c[i+4>>2]=h;gA(1,140575,i)|0;OW();a[189661]=1;c[47409]=268;}if(d|0)c[47408]=d;b=c[47409]|0;}while((b|0)==0);l=j;return b|0}function HX(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;d=b+1|0;e=a[b>>0]|0;a:do if(e<<24>>24==60){e=a[d>>0]|0;if(e<<24>>24==33)if(!(Q2(b+2|0,141747,2)|0)){e=IX(b+4|0)|0;d=e;e=a[e>>0]|0;g=8;}else {e=d;g=5;}else g=6;b:while(1)if((g|0)==5){d=e;e=a[e>>0]|0;g=6;continue}else if((g|0)==6){switch(e<<24>>24){case 62:case 0:{g=8;continue b}default:{}}e=d+1|0;g=5;continue}else if((g|0)==8)if(e<<24>>24==62){g=10;break}else {g=9;break}if((g|0)==9){gA(0,141750,f)|0;a[189660]=1;break}else if((g|0)==10){d=d+1|0;break}}else {d=b;b=e;while(1){switch(b<<24>>24){case 60:case 0:break a;case 38:{e=d+1|0;if((a[e>>0]|0)==35)g=15;else e=$P(e,189644)|0;break}default:g=15;}if((g|0)==15){g=0;e=c[47412]|0;if(e>>>0>=(c[47413]|0)>>>0){lA(189644,1)|0;e=c[47412]|0;}c[47412]=e+1;a[e>>0]=b;e=d+1|0;}d=e;b=a[e>>0]|0;}}while(0);l=h;return d|0}function IX(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;f=1;c=b;a:while(1){e=(f|0)==0;d=c;b:while(1){if(e)break a;g=d+1|0;switch(a[d>>0]|0){case 0:{c=g;break a}case 60:{h=5;break b}case 62:{c=-1;break b}default:d=g;}}if((h|0)==5){h=0;c=1;}f=f+c|0;c=g;}d=c+-1|0;do if(a[d>>0]|0){c=c+-3|0;if(c>>>0>=b>>>0?(Q2(c,141747,2)|0)==0:0)break;gA(0,141791,i)|0;a[189660]=1;}while(0);l=j;return d|0}function JX(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=T1(28)|0;if(!d)d=0;else {e=0;f=0;while(1){if((e|0)>=(b|0))break;r=(c[(c[a+(e<<2)>>2]|0)+4>>2]|0)+f|0;e=e+1|0;f=r;}o=d+8|0;c[o>>2]=KX(f<<4)|0;p=d+12|0;c[p>>2]=KX((b<<2)+4|0)|0;e=f<<2;q=d+16|0;c[q>>2]=KX(e)|0;e=KX(e)|0;r=d+20|0;c[r>>2]=e;c[d+4>>2]=f;c[d>>2]=b;f=0;h=0;while(1){c[(c[p>>2]|0)+(h<<2)>>2]=f;if((h|0)>=(b|0))break;j=a+(h<<2)|0;n=c[j>>2]|0;k=c[n+4>>2]|0;l=f+-1|0;g=0;i=f;m=k;while(1){if((g|0)>=(m|0))break;m=(c[o>>2]|0)+(i<<4)|0;e=(c[n>>2]|0)+(g<<4)|0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];m=i+1|0;c[(c[q>>2]|0)+(i<<2)>>2]=m;e=c[r>>2]|0;c[e+(i<<2)>>2]=i+-1;s=c[j>>2]|0;g=g+1|0;i=m;m=c[s+4>>2]|0;n=s;}s=l+k|0;c[(c[q>>2]|0)+(s<<2)>>2]=f;c[e+(f<<2)>>2]=s;f=i;h=h+1|0;}KY(d);}return d|0}function KX(a){a=a|0;if(!a)a=0;else a=T1(a)|0;return a|0}function LX(a){a=a|0;var b=0,d=0;U1(c[a+8>>2]|0);U1(c[a+12>>2]|0);U1(c[a+16>>2]|0);U1(c[a+20>>2]|0);d=a+24|0;b=c[d>>2]|0;if(b|0){U1(c[b>>2]|0);U1(c[d>>2]|0);}U1(a);return}function MX(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+32|0;m=p+16|0;j=p;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];n=RY(a,d,m)|0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];o=RY(a,f,m)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];m=AY(j,d,n,m,f,o,a)|0;d=c[a+4>>2]|0;j=d+1|0;f=1;h=d;while(1){h=c[m+(h<<2)>>2]|0;k=f+1|0;if((h|0)==(j|0))break;else f=k;}i=T1(k<<4)|0;h=i+(f<<4)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];a=a+8|0;while(1){d=c[m+(d<<2)>>2]|0;f=f+-1|0;h=i+(f<<4)|0;if((d|0)==(j|0))break;e=(c[a>>2]|0)+(d<<4)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];}c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];if(f|0)qa(141809,141816,148,141822);if(n|0)U1(n);if(o|0)U1(o);c[g+4>>2]=k;c[g>>2]=i;U1(m);l=p;return 1}function NX(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;j=l;l=l+48|0;h=j+32|0;g=j+16|0;f=j;i=c[a>>2]|0;d=c[a+4>>2]|0;e=d+-1|0;a=0;while(1){if((a|0)>=(d|0)){a=1;break}m=i+(((e+a|0)%(d|0)|0)<<4)|0;k=i+(a<<4)|0;c[f>>2]=c[m>>2];c[f+4>>2]=c[m+4>>2];c[f+8>>2]=c[m+8>>2];c[f+12>>2]=c[m+12>>2];c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];if((GY(f,g,h)|0)==1){a=0;break}else a=a+1|0;}l=j;return a|0}function OX(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;m=u+48|0;k=u+32|0;s=4;j=T1(40)|0;c[j>>2]=0;n=u+16|0;q=u;r=c[d>>2]|0;i=c[d+4>>2]|0;s=U6(189680,1,j|0,s|0)|0;j=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1)d=z;else d=0;while(1){if(d|0){d=-1;break}o=0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];ja(28,n|0,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue};c[e>>2]=c[n>>2];c[e+4>>2]=c[n+4>>2];c[e+8>>2]=c[n+8>>2];c[e+12>>2]=c[n+12>>2];h=e+16|0;o=0;c[m>>2]=c[h>>2];c[m+4>>2]=c[h+4>>2];c[m+8>>2]=c[h+8>>2];c[m+12>>2]=c[h+12>>2];ja(28,q|0,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue};c[h>>2]=c[q>>2];c[h+4>>2]=c[q+4>>2];c[h+8>>2]=c[q+8>>2];c[h+12>>2]=c[q+12>>2];c[47459]=0;o=0;ia(115,4);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue}g=c[47460]|0;d=c[47459]|0;c[47459]=d+1;d=g+(d<<4)|0;c[d>>2]=c[r>>2];c[d+4>>2]=c[r+4>>2];c[d+8>>2]=c[r+8>>2];c[d+12>>2]=c[r+12>>2];o=0;c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[m>>2]=c[h>>2];c[m+4>>2]=c[h+4>>2];c[m+8>>2]=c[h+8>>2];c[m+12>>2]=c[h+12>>2];d=fa(1,a|0,b|0,r|0,i|0,k|0,m|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,s|0,j|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1)d=z;else {t=8;break}}if((t|0)==8)if((d|0)==-1)d=-1;else {c[f+4>>2]=c[47459];c[f>>2]=c[47460];d=0;}U1(s|0);l=u;return d|0}function PX(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0.0,i=0.0;d=+h[b>>3];e=b+8|0;f=+h[e>>3];i=f*f+d*d;g=+C(+i);if(i>1.0e-06){h[b>>3]=d/g;h[e>>3]=f/g;};c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function QX(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47463]|0)<(a|0)){b=c[47460]|0;if(!b){e=T1(a<<4)|0;c[47460]=e;if(!e){e=c[15712]|0;c[d>>2]=141831;c[d+4>>2]=531;c[d+8>>2]=141966;w4(e,141839,d)|0;bb(189680,1);}}else {d=W1(b,a<<4)|0;c[47460]=d;if(!d){d=c[15712]|0;c[e>>2]=141831;c[e+4>>2]=537;c[e+8>>2]=141984;w4(d,141839,e)|0;bb(189680,1);}}c[47463]=a;}l=f;return}function RX(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0.0,U=0.0,V=0.0,W=0.0;R=l;l=l+336|0;J=R+320|0;I=R+304|0;w=R+144|0;q=R+128|0;G=R+112|0;H=R+96|0;Q=R+80|0;A=R+64|0;C=R+48|0;K=R+32|0;L=R+16|0;M=R;x=R+288|0;y=R+272|0;z=R+256|0;B=R+240|0;D=R+224|0;E=R+208|0;N=R+192|0;O=R+176|0;P=R+160|0;i=c[47462]|0;do if((c[47461]|0)<(e|0)){if(!i){i=T1(e*40|0)|0;c[47462]=i;if(!i){i=-1;break}}else {i=W1(i,e*40|0)|0;c[47462]=i;if(!i){i=-1;break}}c[47461]=e;k=6;}else k=6;while(0);if((k|0)==6){h[i>>3]=0.0;k=1;j=0.0;while(1){if((k|0)>=(e|0))break;n=d+(k<<4)|0;F=d+(k+-1<<4)|0;c[I>>2]=c[n>>2];c[I+4>>2]=c[n+4>>2];c[I+8>>2]=c[n+8>>2];c[I+12>>2]=c[n+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];v=+SX(I,J)+j;h[i+(k*40|0)>>3]=v;k=k+1|0;j=v;}F=e+-1|0;n=i+(F*40|0)|0;k=1;while(1){if((k|0)>=(e|0))break;S=i+(k*40|0)|0;h[S>>3]=+h[S>>3]/+h[n>>3];k=k+1|0;}k=0;while(1){if((k|0)>=(e|0))break;S=i+(k*40|0)+8|0;n=i+(k*40|0)|0;v=+TX(+h[n>>3]);c[J>>2]=c[f>>2];c[J+4>>2]=c[f+4>>2];c[J+8>>2]=c[f+8>>2];c[J+12>>2]=c[f+12>>2];UX(x,J,v);c[S>>2]=c[x>>2];c[S+4>>2]=c[x+4>>2];c[S+8>>2]=c[x+8>>2];c[S+12>>2]=c[x+12>>2];S=i+(k*40|0)+24|0;v=+VX(+h[n>>3]);c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];UX(y,J,v);c[S>>2]=c[y>>2];c[S+4>>2]=c[y+4>>2];c[S+8>>2]=c[y+8>>2];c[S+12>>2]=c[y+12>>2];k=k+1|0;}c[I>>2]=c[f>>2];c[I+4>>2]=c[f+4>>2];c[I+8>>2]=c[f+8>>2];c[I+12>>2]=c[f+12>>2];c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];WX(d,e,i,I,J,G,A,H,C);c[q>>2]=c[G>>2];c[q+4>>2]=c[G+4>>2];c[q+8>>2]=c[G+8>>2];c[q+12>>2]=c[G+12>>2];c[w>>2]=c[A>>2];c[w+4>>2]=c[A+4>>2];c[w+8>>2]=c[A+8>>2];c[w+12>>2]=c[A+12>>2];c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];if(!(XX(a,b,q,w,I,J,d,e)|0)){c[J>>2]=c[A>>2];c[J+4>>2]=c[A+4>>2];c[J+8>>2]=c[A+8>>2];c[J+12>>2]=c[A+12>>2];UX(z,J,.3333333333333333);c[I>>2]=c[G>>2];c[I+4>>2]=c[G+4>>2];c[I+8>>2]=c[G+8>>2];c[I+12>>2]=c[G+12>>2];c[J>>2]=c[z>>2];c[J+4>>2]=c[z+4>>2];c[J+8>>2]=c[z+8>>2];c[J+12>>2]=c[z+12>>2];YX(B,I,J);v=+h[B>>3];u=+h[B+8>>3];c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];UX(D,J,.3333333333333333);c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];c[J>>2]=c[D>>2];c[J+4>>2]=c[D+4>>2];c[J+8>>2]=c[D+8>>2];c[J+12>>2]=c[D+12>>2];ZX(E,I,J);t=+h[E>>3];p=+h[E+8>>3];q=c[47462]|0;r=+h[G>>3];s=+h[H>>3];o=+h[G+8>>3];m=+h[H+8>>3];n=Q+8|0;i=-1;j=-1.0;k=1;while(1){if((k|0)>=(F|0))break;T=+h[q+(k*40|0)>>3];U=+_X(T);V=+TX(T);W=+VX(T);T=+$X(T);h[Q>>3]=V*v+r*U+W*t+s*T;h[n>>3]=W*p+V*u+o*U+m*T;S=d+(k<<4)|0;c[I>>2]=c[Q>>2];c[I+4>>2]=c[Q+4>>2];c[I+8>>2]=c[Q+8>>2];c[I+12>>2]=c[Q+12>>2];c[J>>2]=c[S>>2];c[J+4>>2]=c[S+4>>2];c[J+8>>2]=c[S+8>>2];c[J+12>>2]=c[S+12>>2];T=+SX(I,J);S=T>j;i=S?k:i;j=S?T:j;k=k+1|0;}S=d+(i<<4)|0;Q=d+(i+-1<<4)|0;c[I>>2]=c[S>>2];c[I+4>>2]=c[S+4>>2];c[I+8>>2]=c[S+8>>2];c[I+12>>2]=c[S+12>>2];c[J>>2]=c[Q>>2];c[J+4>>2]=c[Q+4>>2];c[J+8>>2]=c[Q+8>>2];c[J+12>>2]=c[Q+12>>2];ZX(N,I,J);c[J>>2]=c[N>>2];c[J+4>>2]=c[N+4>>2];c[J+8>>2]=c[N+8>>2];c[J+12>>2]=c[N+12>>2];PX(L,J);Q=i+1|0;N=d+(Q<<4)|0;c[I>>2]=c[N>>2];c[I+4>>2]=c[N+4>>2];c[I+8>>2]=c[N+8>>2];c[I+12>>2]=c[N+12>>2];c[J>>2]=c[S>>2];c[J+4>>2]=c[S+4>>2];c[J+8>>2]=c[S+8>>2];c[J+12>>2]=c[S+12>>2];ZX(O,I,J);c[J>>2]=c[O>>2];c[J+4>>2]=c[O+4>>2];c[J+8>>2]=c[O+8>>2];c[J+12>>2]=c[O+12>>2];PX(M,J);c[I>>2]=c[L>>2];c[I+4>>2]=c[L+4>>2];c[I+8>>2]=c[L+8>>2];c[I+12>>2]=c[L+12>>2];c[J>>2]=c[M>>2];c[J+4>>2]=c[M+4>>2];c[J+8>>2]=c[M+8>>2];c[J+12>>2]=c[M+12>>2];YX(P,I,J);c[J>>2]=c[P>>2];c[J+4>>2]=c[P+4>>2];c[J+8>>2]=c[P+8>>2];c[J+12>>2]=c[P+12>>2];PX(K,J);c[I>>2]=c[f>>2];c[I+4>>2]=c[f+4>>2];c[I+8>>2]=c[f+8>>2];c[I+12>>2]=c[f+12>>2];c[J>>2]=c[K>>2];c[J+4>>2]=c[K+4>>2];c[J+8>>2]=c[K+8>>2];c[J+12>>2]=c[K+12>>2];RX(a,b,d,Q,I,J)|0;c[I>>2]=c[K>>2];c[I+4>>2]=c[K+4>>2];c[I+8>>2]=c[K+8>>2];c[I+12>>2]=c[K+12>>2];c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];RX(a,b,S,e-i|0,I,J)|0;i=0;}else i=0;}l=R;return i|0}function SX(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[b>>3]-+h[a>>3];d=+h[b+8>>3]-+h[a+8>>3];return +(+C(+(d*d+c*c)))}function TX(a){a=+a;var b=0.0;b=1.0-a;return +(b*b*(a*3.0))}function UX(a,b,d){a=a|0;b=b|0;d=+d;var e=0;h[b>>3]=+h[b>>3]*d;e=b+8|0;h[e>>3]=+h[e>>3]*d;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function VX(a){a=+a;return +(a*a*3.0*(1.0-a))}function WX(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0.0,J=0,K=0,L=0,M=0;G=l;l=l+128|0;B=G+112|0;v=G+80|0;u=G;r=G+96|0;s=G+64|0;t=G+48|0;C=G+32|0;D=G+16|0;E=a+(b+-1<<4)|0;q=0;w=0.0;x=0.0;y=0.0;z=0.0;A=0.0;while(1){if((q|0)>=(b|0))break;K=d+(q*40|0)+8|0;c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];H=+fY(v,B)+x;J=d+(q*40|0)+24|0;c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[J>>2];c[B+4>>2]=c[J+4>>2];c[B+8>>2]=c[J+8>>2];c[B+12>>2]=c[J+12>>2];p=+fY(v,B)+A;c[v>>2]=c[J>>2];c[v+4>>2]=c[J+4>>2];c[v+8>>2]=c[J+8>>2];c[v+12>>2]=c[J+12>>2];c[B>>2]=c[J>>2];c[B+4>>2]=c[J+4>>2];c[B+8>>2]=c[J+8>>2];c[B+12>>2]=c[J+12>>2];o=+fY(v,B)+y;L=a+(q<<4)|0;M=d+(q*40|0)|0;I=+gY(+h[M>>3]);c[B>>2]=c[a>>2];c[B+4>>2]=c[a+4>>2];c[B+8>>2]=c[a+8>>2];c[B+12>>2]=c[a+12>>2];UX(s,B,I);I=+hY(+h[M>>3]);c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];UX(t,B,I);c[v>>2]=c[s>>2];c[v+4>>2]=c[s+4>>2];c[v+8>>2]=c[s+8>>2];c[v+12>>2]=c[s+12>>2];c[B>>2]=c[t>>2];c[B+4>>2]=c[t+4>>2];c[B+8>>2]=c[t+8>>2];c[B+12>>2]=c[t+12>>2];YX(r,v,B);c[v>>2]=c[L>>2];c[v+4>>2]=c[L+4>>2];c[v+8>>2]=c[L+8>>2];c[v+12>>2]=c[L+12>>2];c[B>>2]=c[r>>2];c[B+4>>2]=c[r+4>>2];c[B+8>>2]=c[r+8>>2];c[B+12>>2]=c[r+12>>2];ZX(u,v,B);c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];I=+fY(v,B)+w;c[v>>2]=c[J>>2];c[v+4>>2]=c[J+4>>2];c[v+8>>2]=c[J+8>>2];c[v+12>>2]=c[J+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];q=q+1|0;w=I;x=H;y=o;z=+fY(v,B)+z;A=p;}o=y*x-A*A;p=o>=0.0?o:-o;if(!(p>=1.0e-06?(m=(y*w-A*z)/o,n=(x*z-A*w)/o,!(p<1.0e-06|m<=0.0|n<=0.0)):0))F=6;if((F|0)==6){c[v>>2]=c[a>>2];c[v+4>>2]=c[a+4>>2];c[v+8>>2]=c[a+8>>2];c[v+12>>2]=c[a+12>>2];c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];m=+SX(v,B)*.3333333333333333;n=m;};c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[B>>2]=c[e>>2];c[B+4>>2]=c[e+4>>2];c[B+8>>2]=c[e+8>>2];c[B+12>>2]=c[e+12>>2];UX(C,B,m);c[i>>2]=c[C>>2];c[i+4>>2]=c[C+4>>2];c[i+8>>2]=c[C+8>>2];c[i+12>>2]=c[C+12>>2];c[j>>2]=c[E>>2];c[j+4>>2]=c[E+4>>2];c[j+8>>2]=c[E+8>>2];c[j+12>>2]=c[E+12>>2];c[B>>2]=c[f>>2];c[B+4>>2]=c[f+4>>2];c[B+8>>2]=c[f+8>>2];c[B+12>>2]=c[f+12>>2];UX(D,B,n);c[k>>2]=c[D>>2];c[k+4>>2]=c[D+4>>2];c[k+8>>2]=c[D+8>>2];c[k+12>>2]=c[D+12>>2];l=G;return}function XX(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0,u=0.0,v=0,w=0.0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0.0,E=0;C=l;l=l+64|0;B=C;z=(j|0)==2;y=+h[d>>3];u=+h[d+8>>3];v=B+8|0;w=+h[e>>3];x=B+16|0;p=+h[e+8>>3];q=B+24|0;r=+h[f>>3];s=+h[g>>3];t=B+32|0;o=+h[f+8>>3];n=+h[g+8>>3];e=B+40|0;f=B+48|0;g=B+56|0;d=1;k=4.0;m=4.0;while(1){h[B>>3]=y;h[v>>3]=u;D=m*.3333333333333333;h[x>>3]=D*w+y;h[q>>3]=D*p+u;D=k*.3333333333333333;h[t>>3]=r-D*s;h[e>>3]=o-D*n;h[f>>3]=r;h[g>>3]=o;if(d?(D=+aY(B,4),D<+aY(i,j)+-.001):0){d=0;break}if(bY(a,b,B)|0){A=5;break}if(m==0.0&k==0.0){A=9;break}E=m>.01;d=0;k=E?k*.5:0.0;m=E?m*.5:0.0;}a:do if((A|0)==5){QX((c[47459]|0)+4|0);e=c[47460]|0;d=1;while(1){if((d|0)==4){d=1;break a}E=c[47459]|0;h[e+(E<<4)>>3]=+h[B+(d<<4)>>3];D=+h[B+(d<<4)+8>>3];c[47459]=E+1;h[e+(E<<4)+8>>3]=D;d=d+1|0;}}else if((A|0)==9)if(z){QX((c[47459]|0)+4|0);e=c[47460]|0;d=1;while(1){if((d|0)==4){d=1;break a}E=c[47459]|0;h[e+(E<<4)>>3]=+h[B+(d<<4)>>3];D=+h[B+(d<<4)+8>>3];c[47459]=E+1;h[e+(E<<4)+8>>3]=D;d=d+1|0;}}else d=0;while(0);l=C;return d|0}function YX(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]+ +h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]+ +h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function ZX(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]-+h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]-+h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function _X(a){a=+a;a=1.0-a;return +(a*a*a)}function $X(a){a=+a;return +(a*a*a)}function aY(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0,f=0.0,g=0;c=0.0;d=1;while(1){if((d|0)>=(b|0))break;g=d+-1|0;e=+h[a+(d<<4)>>3]-+h[a+(g<<4)>>3];f=+h[a+(d<<4)+8>>3]-+h[a+(g<<4)+8>>3];c=+C(+(f*f+e*e))+c;d=d+1|0;}return +c}function bY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0.0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0;C=l;l=l+64|0;t=C+32|0;u=C;w=u+16|0;y=d+16|0;z=d+32|0;A=d+48|0;B=d+8|0;g=d+24|0;i=d+40|0;j=d+56|0;k=u+8|0;m=u+24|0;f=0;a:while(1){if((f|0)>=(b|0)){e=1;break}n=a+(f<<5)|0;c[u>>2]=c[n>>2];c[u+4>>2]=c[n+4>>2];c[u+8>>2]=c[n+8>>2];c[u+12>>2]=c[n+12>>2];n=a+(f<<5)+16|0;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];n=cY(d,u,t)|0;b:do if((n|0)!=4){o=+h[u>>3];p=+h[k>>3];q=+h[w>>3];r=+h[m>>3];e=0;while(1){if((e|0)>=(n|0))break b;s=+h[t+(e<<3)>>3];if((!(s<1.0e-06|s>.999999)?(x=s*s*s,E=s*3.0,D=1.0-s,s=E*s*D,v=D*D,E=v*E,D=v*D,v=+h[y>>3]*E+ +h[d>>3]*D+ +h[z>>3]*s+ +h[A>>3]*x,x=+h[g>>3]*E+ +h[B>>3]*D+ +h[i>>3]*s+ +h[j>>3]*x,s=v-o,D=x-p,!(D*D+s*s<.001)):0)?(E=v-q,D=x-r,!(D*D+E*E<.001)):0){e=0;break a}e=e+1|0;}}while(0);f=f+1|0;}l=C;return e|0}function cY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+96|0;s=v+48|0;t=v+24|0;k=v;u=v+80|0;p=+h[b>>3];g=+h[b+16>>3]-p;q=+h[b+8>>3];j=+h[b+24>>3]-q;c[u>>2]=0;a:do if(!(g==0.0)){j=j/g;m=a+16|0;n=a+32|0;o=a+48|0;dY(+h[a+8>>3]-+h[a>>3]*j,+h[a+24>>3]-+h[m>>3]*j,+h[a+40>>3]-+h[n>>3]*j,+h[a+56>>3]-+h[o>>3]*j,s);h[s>>3]=j*p-q+ +h[s>>3];e=BY(s,t)|0;if((e|0)==4)b=4;else {f=s+8|0;i=s+16|0;k=s+24|0;g=1.0/g;b=0;while(1){if((b|0)>=(e|0))break;j=+h[t+(b<<3)>>3];if(j>=0.0&j<=1.0?(dY(+h[a>>3],+h[m>>3],+h[n>>3],+h[o>>3],s),q=(+h[s>>3]-p+((+h[k>>3]*j+ +h[i>>3])*j+ +h[f>>3])*j)*g,q>=0.0&q<=1.0):0)eY(j,d,u);b=b+1|0;}b=c[u>>2]|0;}}else {dY(+h[a>>3],+h[a+16>>3],+h[a+32>>3],+h[a+48>>3],s);h[s>>3]=+h[s>>3]-p;r=BY(s,t)|0;if(!(j==0.0)){if((r|0)==4){b=4;break}m=a+8|0;n=a+24|0;o=a+40|0;e=a+56|0;f=s+8|0;i=s+16|0;k=s+24|0;g=1.0/j;b=0;while(1){if((b|0)>=(r|0))break;j=+h[t+(b<<3)>>3];if(j>=0.0&j<=1.0?(dY(+h[m>>3],+h[n>>3],+h[o>>3],+h[e>>3],s),p=(+h[s>>3]-q+((+h[k>>3]*j+ +h[i>>3])*j+ +h[f>>3])*j)*g,p>=0.0&p<=1.0):0)eY(j,d,u);b=b+1|0;}b=c[u>>2]|0;break}dY(+h[a+8>>3],+h[a+24>>3],+h[a+40>>3],+h[a+56>>3],s);h[s>>3]=+h[s>>3]-q;i=BY(s,k)|0;b=(i|0)==4;b:do if((r|0)==4){if(b){b=4;break a}else b=0;while(1){if((b|0)>=(i|0))break b;eY(+h[k+(b<<3)>>3],d,u);b=b+1|0;}}else {if(b){b=0;while(1){if((b|0)>=(r|0))break b;eY(+h[t+(b<<3)>>3],d,u);b=b+1|0;}}else e=0;while(1){if((e|0)>=(r|0))break b;f=t+(e<<3)|0;b=0;while(1){if((b|0)>=(i|0))break;g=+h[f>>3];if(g==+h[k+(b<<3)>>3])eY(g,d,u);b=b+1|0;}e=e+1|0;}}while(0);b=c[u>>2]|0;}while(0);l=v;return b|0}function dY(a,b,c,d,e){a=+a;b=+b;c=+c;d=+d;e=e|0;h[e+24>>3]=d-a+(b-c)*3.0;h[e+16>>3]=(c+a)*3.0-b*6.0;h[e+8>>3]=(b-a)*3.0;h[e>>3]=a;return}function eY(a,b,d){a=+a;b=b|0;d=d|0;var e=0;if(a>=0.0&a<=1.0){e=c[d>>2]|0;h[b+(e<<3)>>3]=a;c[d>>2]=e+1;}return}function fY(a,b){a=a|0;b=b|0;return +(+h[b+8>>3]*+h[a+8>>3]+ +h[b>>3]*+h[a>>3])}function gY(a){a=+a;var b=0.0;b=1.0-a;return +(b*b*(b+a*3.0))}function hY(a){a=+a;return +(a*a*((1.0-a)*3.0+a))}function iY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0;H=l;l=l+112|0;E=H+80|0;D=H+64|0;C=H+48|0;G=4;F=T1(40)|0;c[F>>2]=0;w=H+32|0;x=H+16|0;y=H;A=H+96|0;G=U6(189856,1,F|0,G|0)|0;F=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1)e=z;else e=0;a:while(1){if(e|0){e=-2;break}g=a+4|0;o=0;ia(116,c[g>>2]|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}c[47503]=0;c[47504]=0;o=0;ia(117,c[g>>2]<<1|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}m=(c[47506]|0)/2|0;c[47507]=m;c[47508]=m+-1;m=c[g>>2]|0;g=c[a>>2]|0;e=0;f=-1;i=t;while(1){if((e|0)>=(m|0))break;I=+h[g+(e<<4)>>3];v=i>I;u=v?e:f;e=e+1|0;f=u;i=v?I:i;}v=g+(f<<4)|0;c[x>>2]=c[v>>2];c[x+4>>2]=c[v+4>>2];c[x+8>>2]=c[v+8>>2];c[x+12>>2]=c[v+12>>2];v=g+(((f|0)==0?m:f)+-1<<4)|0;c[w>>2]=c[v>>2];c[w+4>>2]=c[v+4>>2];c[w+8>>2]=c[v+8>>2];c[w+12>>2]=c[v+12>>2];v=g+(((f|0)==(m+-1|0)?0:f+1|0)<<4)|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];I=+h[x>>3];if((+h[w>>3]==I?I==+h[y>>3]:0)?+h[y+8>>3]>+h[x+8>>3]:0)v=15;else v=12;b:do if((v|0)==12){v=0;o=0;e=ca(36,w|0,x|0,y|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,G|0,F|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((e|0)==1){g=c[47510]|0;e=c[47511]|0;f=0;while(1){if((f|0)>=(m|0))break b;j=c[a>>2]|0;if(!(((f|0)>0?(B=f+-1|0,+h[j+(f<<4)>>3]==+h[j+(B<<4)>>3]):0)?+h[j+(f<<4)+8>>3]==+h[j+(B<<4)+8>>3]:0)){u=c[47503]|0;c[g+(u<<3)>>2]=j+(f<<4);c[g+(u<<3)+4>>2]=g+(((u|0)%(m|0)|0)<<3);c[e+(u<<2)>>2]=g+(u<<3);c[47503]=u+1;}f=f+1|0;}}else v=15;}while(0);c:do if((v|0)==15){v=0;j=c[47510]|0;e=c[47511]|0;g=m;while(1){f=g+-1|0;if((g|0)<=0)break c;k=c[a>>2]|0;if(((g|0)<(m|0)?+h[k+(f<<4)>>3]==+h[k+(g<<4)>>3]:0)?+h[k+(f<<4)+8>>3]==+h[k+(g<<4)+8>>3]:0){g=f;continue}g=c[47503]|0;c[j+(g<<3)>>2]=k+(f<<4);c[j+(g<<3)+4>>2]=j+(((g|0)%(m|0)|0)<<3);c[e+(g<<2)>>2]=j+(g<<3);c[47503]=g+1;g=f;}}while(0);o=0;ja(29,e|0,c[47503]|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}j=0;e=c[47504]|0;d:while(1){if((j|0)>=(e|0)){s=0;break}k=j+1|0;g=k;while(1){if((g|0)>=(e|0)){j=k;continue d}o=0;ja(30,j|0,g|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue a}g=g+1|0;e=c[47504]|0;}}while(1){if((s|0)>=(e|0))break;o=0;f=aa(105,s|0,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}if(f|0)break;s=s+1|0;}if((s|0)==(e|0)){e=c[15712]|0;o=0;c[C>>2]=141858;c[C+4>>2]=192;c[C+8>>2]=141869;ca(32,e|0,141839,C|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=41;break}}u=b+16|0;k=0;while(1){if((k|0)>=(e|0))break;o=0;f=aa(105,k|0,u|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}if(f|0)break;k=k+1|0;}if((k|0)==(e|0)){e=c[15712]|0;o=0;c[D>>2]=141858;c[D+4>>2]=200;c[D+8>>2]=141902;ca(32,e|0,141839,D|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=48;break}}o=0;e=aa(106,s|0,k|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,G|0,F|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue}if(!e){e=c[15712]|0;o=0;c[E>>2]=141858;c[E+4>>2]=207;c[E+8>>2]=141940;ca(32,e|0,141839,E|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}o=0;ia(118,2);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=53;break}}if((s|0)==(k|0)){o=0;ia(118,2);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=56;break}}c[A>>2]=b;c[A+4>>2]=0;f=A+8|0;c[f>>2]=u;c[A+12>>2]=0;o=0;ja(31,1,A|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue}c[47509]=c[47507];q=s;e:while(1){if((q|0)==-1){g=f;e=0;break}r=c[47513]|0;c[r+(q*52|0)>>2]=2;e=0;while(1){if((e|0)>=3){v=65;break}v=c[r+(q*52|0)+4+(e<<4)+12>>2]|0;if(v|0?(c[v>>2]|0)==1:0){v=68;break}e=e+1|0;}if((v|0)==65){v=0;if((e|0)==3){e=c[47505]|0;k=c[e+(c[47508]<<2)>>2]|0;o=0;e=ca(36,u|0,c[c[e+(c[47507]<<2)>>2]>>2]|0,c[k>>2]|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}j=(e|0)==1;n=j?f:k;j=j?k:f;}else v=68;}if((v|0)==68){v=0;k=c[r+(q*52|0)+4+(e<<4)>>2]|0;m=c[r+(q*52|0)+4+(e<<4)+4>>2]|0;o=0;e=ca(36,c[k>>2]|0,c[c[r+(q*52|0)+4+(((e+1|0)%3|0)<<4)+4>>2]>>2]|0,c[m>>2]|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}j=(e|0)==1;n=j?k:m;j=j?m:k;}do if((q|0)==(s|0)){o=0;ja(31,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,1,n|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}e=0;}else {m=c[47505]|0;if((c[m+(c[47507]<<2)>>2]|0)!=(n|0)?(c[m+(c[47508]<<2)>>2]|0)!=(n|0):0){o=0;j=$(34,n|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(32,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,1,n|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((j|0)<=(c[47509]|0)){e=0;break}c[47509]=j;e=0;break}o=0;k=$(34,j|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(32,1,k|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((k|0)>=(c[47509]|0)){e=0;break}c[47509]=k;e=0;}while(0);while(1){if((e|0)>=3){q=-1;continue e}g=c[r+(q*52|0)+4+(e<<4)+12>>2]|0;if(g|0?(c[g>>2]|0)==1:0)break;e=e+1|0;}q=(g-(c[47513]|0)|0)/52|0;}while(1){if(!g)break;g=c[g+4>>2]|0;e=e+1|0;}o=0;ia(118,e|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1)e=z;else {v=94;break}}if((v|0)==41)e=-1;else if((v|0)==48)e=-1;else if((v|0)==53){c[d+4>>2]=2;e=c[47512]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];F=e+16|0;c[F>>2]=c[u>>2];c[F+4>>2]=c[u+4>>2];c[F+8>>2]=c[u+8>>2];c[F+12>>2]=c[u+12>>2];c[d>>2]=e;e=0;}else if((v|0)==56){c[d+4>>2]=2;e=c[47512]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];F=e+16|0;c[F>>2]=c[u>>2];c[F+4>>2]=c[u+4>>2];c[F+8>>2]=c[u+8>>2];c[F+12>>2]=c[u+12>>2];c[d>>2]=e;e=0;}else if((v|0)==94){c[d+4>>2]=e;g=c[47512]|0;while(1){e=e+-1|0;if(!f)break;F=g+(e<<4)|0;E=c[f>>2]|0;c[F>>2]=c[E>>2];c[F+4>>2]=c[E+4>>2];c[F+8>>2]=c[E+8>>2];c[F+12>>2]=c[E+12>>2];f=c[f+4>>2]|0;}c[d>>2]=g;e=0;}U1(G|0);l=H;return e|0}function jY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+64|0;e=h+48|0;g=h+32|0;f=h+16|0;d=h;if((c[47516]|0)<(a|0)){b=c[47510]|0;if(!b){g=T1(a<<3)|0;c[47510]=g;if(!g){g=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=523;c[d+8>>2]=142108;w4(g,141839,d)|0;bb(189856,1);}g=T1(a<<2)|0;c[47511]=g;if(!g){g=c[15712]|0;c[f>>2]=141858;c[f+4>>2]=527;c[f+8>>2]=142127;w4(g,141839,f)|0;bb(189856,1);}}else {f=W1(b,a<<3)|0;c[47510]=f;if(!f){f=c[15712]|0;c[g>>2]=141858;c[g+4>>2]=533;c[g+8>>2]=142147;w4(f,141839,g)|0;bb(189856,1);}g=W1(c[47511]|0,a<<2)|0;c[47511]=g;if(!g){g=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=539;c[e+8>>2]=142167;w4(g,141839,e)|0;bb(189856,1);}}c[47516]=a;}l=h;return}function kY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47506]|0)<(a|0)){b=c[47505]|0;if(!b){e=T1(a<<2)|0;c[47505]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=573;c[d+8>>2]=142063;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a<<2)|0;c[47505]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=580;c[e+8>>2]=142085;w4(d,141839,e)|0;bb(189856,1);}}c[47506]=a;}l=f;return}function lY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];d=(+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d);return (d>0.0?1:d<0.0?2:3)|0}function mY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;a:while(1){if((b|0)>3)e=0;else {b=9;break}while(1){if((e|0)>=(b|0)){b=8;break a}f=e+1|0;d=(f|0)%(b|0)|0;g=(e+2|0)%(b|0)|0;if(!(uY(e,g,a,b)|0))e=f;else break}vY(c[a+(e<<2)>>2]|0,c[a+(d<<2)>>2]|0,c[a+(g<<2)>>2]|0);b=b+-1|0;while(1){if((d|0)>=(b|0))continue a;g=d+1|0;c[a+(d<<2)>>2]=c[a+(g<<2)>>2];d=g;}}if((b|0)==8){a=c[15712]|0;c[h>>2]=141858;c[h+4>>2]=324;c[h+8>>2]=142003;w4(a,141839,h)|0;}else if((b|0)==9)vY(c[a>>2]|0,c[a+4>>2]|0,c[a+8>>2]|0);l=i;return}function nY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=c[47513]|0;j=i+(a*52|0)|0;k=i+(b*52|0)|0;g=0;while(1){if((g|0)==3)break;l=i+(a*52|0)+4+(g<<4)|0;m=i+(a*52|0)+4+(g<<4)+4|0;n=i+(a*52|0)+4+(g<<4)+12|0;f=0;while(1){if((f|0)==3)break;o=c[c[l>>2]>>2]|0;h=c[c[i+(b*52|0)+4+(f<<4)>>2]>>2]|0;if((o|0)==(h|0)){d=c[c[i+(b*52|0)+4+(f<<4)+4>>2]>>2]|0;if((c[c[m>>2]>>2]|0)==(d|0))e=10;else e=8;}else {d=c[c[i+(b*52|0)+4+(f<<4)+4>>2]>>2]|0;e=8;}if(((e|0)==8?(e=0,(o|0)==(d|0)):0)?(c[c[m>>2]>>2]|0)==(h|0):0)e=10;if((e|0)==10){c[n>>2]=k;c[i+(b*52|0)+4+(f<<4)+12>>2]=j;}f=f+1|0;}g=g+1|0;}return}function oY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[47513]|0;d=0;e=0;while(1){if((e|0)==3)break;d=d+((lY(c[c[f+(a*52|0)+4+(e<<4)>>2]>>2]|0,c[c[f+(a*52|0)+4+(e<<4)+4>>2]>>2]|0,b)|0)!=2&1)|0;e=e+1|0;}return ((d|0)==3|(d|0)==0)&1|0}function pY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[47513]|0;e=d+(a*52|0)|0;a:do if(!(c[e>>2]|0)){c[e>>2]=1;if((a|0)==(b|0))d=1;else {f=0;while(1){if((f|0)>=3)break;e=c[d+(a*52|0)+4+(f<<4)+12>>2]|0;if(e){if(pY((e-d|0)/52|0,b)|0){d=1;break a}d=c[47513]|0;}f=f+1|0;}c[d+(a*52|0)>>2]=0;d=0;}}else d=0;while(0);return d|0}function qY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47514]|0)<(a|0)){b=c[47512]|0;if(!b){e=T1(a<<4)|0;c[47512]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=593;c[d+8>>2]=141966;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a<<4)|0;c[47512]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=599;c[e+8>>2]=141984;w4(d,141839,e)|0;bb(189856,1);}}c[47514]=a;}l=f;return}function rY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[47508]|0;e=c[47507]|0;f=(d|0)>=(e|0);if((a|0)==1)if(f){c[b+4>>2]=c[(c[47505]|0)+(e<<2)>>2];a=190028;d=-1;}else {a=190028;d=-1;}else if(f){c[b+4>>2]=c[(c[47505]|0)+(d<<2)>>2];a=190032;d=1;}else {a=190032;d=1;}f=(c[a>>2]|0)+d|0;c[a>>2]=f;c[(c[47505]|0)+(f<<2)>>2]=b;return}function sY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[47509]|0;g=c[47505]|0;b=c[47507]|0;while(1){if((b|0)>=(f|0)){e=4;break}d=b+1|0;if((lY(c[c[g+(d<<2)>>2]>>2]|0,c[c[g+(b<<2)>>2]>>2]|0,c[a>>2]|0)|0)==1)break;else b=d;}a:do if((e|0)==4){b=c[47508]|0;while(1){if((b|0)<=(f|0)){b=f;break a}d=b+-1|0;if((lY(c[c[g+(d<<2)>>2]>>2]|0,c[c[g+(b<<2)>>2]>>2]|0,c[a>>2]|0)|0)==2)break;else b=d;}}while(0);return b|0}function tY(a,b){a=a|0;b=b|0;c[((a|0)==1?190032:190028)>>2]=b;return}function uY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=c[c[d+(((a+-1+e|0)%(e|0)|0)<<2)>>2]>>2]|0;i=c[c[d+(a<<2)>>2]>>2]|0;g=c[c[d+(((a+1|0)%(e|0)|0)<<2)>>2]>>2]|0;k=(lY(f,i,g)|0)==1;j=c[c[d+(b<<2)>>2]>>2]|0;if(k)if((lY(i,j,f)|0)==1){f=lY(j,i,g)|0;g=1;h=5;}else f=0;else {f=lY(i,j,g)|0;g=2;h=5;}a:do if((h|0)==5)if((f|0)==(g|0)){f=0;while(1){if((f|0)>=(e|0)){f=1;break a}g=f;f=f+1|0;h=(f|0)%(e|0)|0;if((h|0)==(b|0)|((g|0)==(b|0)|((g|0)==(a|0)|(h|0)==(a|0))))continue;if(xY(i,j,c[c[d+(g<<2)>>2]>>2]|0,c[c[d+(h<<2)>>2]>>2]|0)|0){f=0;break}}}else f=0;while(0);return f|0}function vY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[47504]|0;f=c[47515]|0;if((e|0)<(f|0))h=e;else {wY(f+20|0);h=c[47504]|0;}g=c[47513]|0;c[47504]=h+1;f=g+(h*52|0)|0;c[f>>2]=0;c[g+(h*52|0)+4>>2]=a;c[g+(h*52|0)+8>>2]=b;c[g+(h*52|0)+16>>2]=0;c[g+(h*52|0)+20>>2]=b;c[g+(h*52|0)+24>>2]=d;c[g+(h*52|0)+32>>2]=0;c[g+(h*52|0)+36>>2]=d;c[g+(h*52|0)+40>>2]=a;c[g+(h*52|0)+48>>2]=0;e=0;while(1){if((e|0)==3)break;c[g+(h*52|0)+4+(e<<4)+8>>2]=f;e=e+1|0;}return}function wY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47515]|0)<(a|0)){b=c[47513]|0;if(!b){e=T1(a*52|0)|0;c[47513]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=552;c[d+8>>2]=142024;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a*52|0)|0;c[47513]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=558;c[e+8>>2]=142043;w4(d,141839,e)|0;bb(189856,1);}}c[47515]=a;}l=f;return}function xY(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=lY(a,b,c)|0;if((((f|0)!=3?(g=lY(a,b,d)|0,(g|0)!=3):0)?(h=lY(c,d,a)|0,(h|0)!=3):0)?(e=lY(c,d,b)|0,(e|0)!=3):0)return ((f|0)==1^(g|0)==1)&((h|0)==1^(e|0)==1)&1|0;if(((yY(a,b,c)|0)==0?(yY(a,b,d)|0)==0:0)?(yY(c,d,a)|0)==0:0)return (yY(c,d,b)|0)!=0|0;return 1}function yY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;e=+h[a>>3];g=+h[b>>3]-e;f=+h[a+8>>3];d=+h[b+8>>3]-f;e=+h[c>>3]-e;f=+h[c+8>>3]-f;if((lY(a,b,c)|0)==3?f*d+e*g>=0.0:0)a=f*f+e*e<=d*d+g*g&1;else a=0;return a|0}function zY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;m=T1(d<<2)|0;n=T1((d<<3)+8|0)|0;o=n+8|0;f=0;while(1){if((f|0)>=(d|0))break;c[m+(f<<2)>>2]=-1;h[o+(f<<3)>>3]=-2147483647.0;f=f+1|0;}h[n>>3]=-2147483648.0;a:while(1){if((a|0)==(b|0))break;l=o+(a<<3)|0;j=+h[l>>3];h[l>>3]=j==-2147483647.0?0.0:-j;k=0;f=-1;while(1){if((k|0)>=(d|0)){a=f;continue a}i=o+(k<<3)|0;g=+h[i>>3];if(g<0.0){q=(a|0)<(k|0);p=+h[(c[e+((q?k:a)<<2)>>2]|0)+((q?a:k)<<3)>>3];j=-(p+ +h[l>>3]);if(p!=0.0&g>3]=j;c[m+(k<<2)>>2]=a;g=j;}f=g>+h[o+(f<<3)>>3]?k:f;}k=k+1|0;}}U1(n);return m|0}function AY(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0;j=l;l=l+32|0;k=j+16|0;m=j;i=c[h+4>>2]|0;c[m>>2]=c[a>>2];c[m+4>>2]=c[a+4>>2];c[m+8>>2]=c[a+8>>2];c[m+12>>2]=c[a+12>>2];c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];if(!(TY(m,b,k,f,h)|0)){a=c[h+24>>2]|0;c[a+(i<<2)>>2]=g;m=i+1|0;c[a+(m<<2)>>2]=d;a=zY(m,i,i+2|0,a)|0;}else {a=T1((i<<2)+8|0)|0;m=i+1|0;c[a+(i<<2)>>2]=m;c[a+(m<<2)>>2]=-1;}l=j;return a|0}function BY(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0;d=+h[a+24>>3];a:do if(d<1.0e-07&d>-1.0e-07)a=CY(a,b)|0;else {g=+h[a+16>>3]/(d*3.0);f=+h[a+8>>3]/d;e=g*g;d=g*2.0*e-g*f+ +h[a>>3]/d;e=f*.3333333333333333-e;e=e*e*4.0*e;f=d*d+e;if(!(f<0.0)){i=(+C(+f)-d)*.5;e=+E2(i);d=+E2(-d-i)+e;h[b>>3]=d;if(f>0.0)a=1;else {d=d*-.5;h[b+16>>3]=d;a=1;c=7;}}else {i=+K(+(+C(+-f)),+-d);d=+E2(+C(+-e)*.5)*2.0;h[b>>3]=d*+E(+(i*.3333333333333333));h[b+8>>3]=+E(+((i+6.283185307179586)*.3333333333333333))*d;d=+E(+((i+-6.283185307179586)*.3333333333333333))*d;a=2;c=7;}if((c|0)==7){h[b+(a<<3)>>3]=d;a=3;}c=0;while(1){if((c|0)>=(a|0))break a;j=b+(c<<3)|0;h[j>>3]=+h[j>>3]-g;c=c+1|0;}}while(0);return a|0}function CY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+16>>3];do if(!(c<1.0e-07&c>-1.0e-07)){d=+h[a+8>>3]/(c*2.0);c=d*d-+h[a>>3]/c;if(!(c<0.0))if(c==0.0){h[b>>3]=-d;a=1;break}else {c=+C(+c)-d;h[b>>3]=c;h[b+8>>3]=d*-2.0-c;a=2;break}else a=0;}else a=DY(a,b)|0;while(0);return a|0}function DY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a+8>>3];c=+h[a>>3];if(d<1.0e-07&d>-1.0e-07)a=c<1.0e-07&c>-1.0e-07?4:0;else {h[b>>3]=-c/d;a=1;}return a|0}function EY(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function FY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=c[a+4>>2]|0;i=(e*3|0)+-2|0;d=c[47518]|0;if((i|0)>(c[47517]|0)){if(!d)d=T1(i<<4)|0;else d=W1(d,i<<4)|0;c[47518]=d;c[47517]=i;h=d;g=d;}else {h=d;g=d;}f=c[a>>2]|0;c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];X6(h+16|0,f|0,16)|0;e=e+-1|0;d=1;a=2;while(1){if((d|0)>=(e|0))break;j=h+(a+2<<4)|0;k=h+(a+1<<4)|0;m=h+(a<<4)|0;l=f+(d<<4)|0;c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];X6(k|0,l|0,16)|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];d=d+1|0;a=a+3|0;}l=h+(a<<4)|0;m=f+(d<<4)|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];X6(h+(a+1<<4)|0,m|0,16)|0;c[b+4>>2]=i;c[b>>2]=g;return}function GY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];d=(+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d);return (d>.0001?1:(d<-.0001)<<31>>31)|0}function HY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;e=+h[a>>3];f=+h[b>>3];if(e!=f){d=+h[c>>3];if(!(e>3];e=+h[c+8>>3];d=+h[b+8>>3];if(!(f>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];j=GY(g,h,i)|0;if((j|0)==0?(c[g>>2]=c[a>>2],c[g+4>>2]=c[a+4>>2],c[g+8>>2]=c[a+8>>2],c[g+12>>2]=c[a+12>>2],c[h>>2]=c[b>>2],c[h+4>>2]=c[b+4>>2],c[h+8>>2]=c[b+8>>2],c[h+12>>2]=c[b+12>>2],c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],(HY(g,h,i)|0)!=0):0)f=1;else k=3;do if((k|0)==3){c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];c[i>>2]=c[e>>2];c[i+4>>2]=c[e+4>>2];c[i+8>>2]=c[e+8>>2];c[i+12>>2]=c[e+12>>2];f=GY(g,h,i)|0;if((f|0)==0?(c[g>>2]=c[a>>2],c[g+4>>2]=c[a+4>>2],c[g+8>>2]=c[a+8>>2],c[g+12>>2]=c[a+12>>2],c[h>>2]=c[b>>2],c[h+4>>2]=c[b+4>>2],c[h+8>>2]=c[b+8>>2],c[h+12>>2]=c[b+12>>2],c[i>>2]=c[e>>2],c[i+4>>2]=c[e+4>>2],c[i+8>>2]=c[e+8>>2],c[i+12>>2]=c[e+12>>2],HY(g,h,i)|0):0){f=1;break};c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[i>>2]=c[a>>2];c[i+4>>2]=c[a+4>>2];c[i+8>>2]=c[a+8>>2];c[i+12>>2]=c[a+12>>2];a=GY(g,h,i)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];k=(O(f,j)|0)<0;f=(O(GY(g,h,i)|0,a)|0)>>>31;f=k?f:0;}while(0);l=m;return f|0}function JY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(d*d+c*c)}function KY(a){a=a|0;c[a+24>>2]=LY(c[a+4>>2]|0)|0;MY(a);return}function LY(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+2|0;f=T1(e<<2)|0;b=V1(O(a,a)|0,8)|0;d=0;while(1){if((d|0)>=(a|0))break;c[f+(d<<2)>>2]=b;b=b+(a<<3)|0;d=d+1|0;}while(1){if((a|0)>=(e|0))break;c[f+(a<<2)>>2]=0;a=a+1|0;}return f|0}function MY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;p=l;l=l+32|0;i=p+16|0;g=p;j=c[a+4>>2]|0;m=c[a+8>>2]|0;n=c[a+16>>2]|0;o=c[a+20>>2]|0;d=c[a+24>>2]|0;b=0;while(1){if((b|0)>=(j|0))break;q=c[o+(b<<2)>>2]|0;e=m+(b<<4)|0;f=m+(q<<4)|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];r=+NY(g,i);f=c[d+(b<<2)>>2]|0;h[f+(q<<3)>>3]=r;h[(c[d+(q<<2)>>2]|0)+(b<<3)>>3]=r;a=b+-1|0;a=(q|0)==(a|0)?b+-2|0:a;while(1){if((a|0)<=-1)break;if((OY(b,a,m,n,o)|0?OY(a,b,m,n,o)|0:0)?(k=m+(a<<4)|0,c[g>>2]=c[e>>2],c[g+4>>2]=c[e+4>>2],c[g+8>>2]=c[e+8>>2],c[g+12>>2]=c[e+12>>2],c[i>>2]=c[k>>2],c[i+4>>2]=c[k+4>>2],c[i+8>>2]=c[k+8>>2],c[i+12>>2]=c[k+12>>2],PY(g,i,j,j,j,m,n)|0):0){c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];r=+NY(g,i);h[f+(a<<3)>>3]=r;h[(c[d+(a<<2)>>2]|0)+(b<<3)>>3]=r;}a=a+-1|0;}b=b+1|0;}l=p;return}function NY(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0;e=l;l=l+32|0;f=e+16|0;g=e;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];d=+C(+(+JY(g,f)));l=e;return +d}function OY(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;g=l;l=l+64|0;h=g+48|0;i=g+32|0;j=g+16|0;k=g;n=d+(c[f+(a<<2)>>2]<<4)|0;m=d+(a<<4)|0;e=d+(c[e+(a<<2)>>2]<<4)|0;f=d+(b<<4)|0;c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];c[i>>2]=c[e>>2];c[i+4>>2]=c[e+4>>2];c[i+8>>2]=c[e+8>>2];c[i+12>>2]=c[e+12>>2];c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];f=QY(k,j,i,h)|0;l=g;return f|0}function PY(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+64|0;n=p+48|0;m=p+32|0;k=p+16|0;j=p;i=0;while(1){if((i|0)>=(d|0)){o=4;break}r=g+(i<<4)|0;q=g+(c[h+(i<<2)>>2]<<4)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[m>>2]=c[r>>2];c[m+4>>2]=c[r+4>>2];c[m+8>>2]=c[r+8>>2];c[m+12>>2]=c[r+12>>2];c[n>>2]=c[q>>2];c[n+4>>2]=c[q+4>>2];c[n+8>>2]=c[q+8>>2];c[n+12>>2]=c[q+12>>2];if(!(IY(j,k,m,n)|0))i=i+1|0;else {e=0;break}}a:do if((o|0)==4)while(1){if((e|0)>=(f|0)){e=1;break a}q=g+(e<<4)|0;r=g+(c[h+(e<<2)>>2]<<4)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[m>>2]=c[q>>2];c[m+4>>2]=c[q+4>>2];c[m+8>>2]=c[q+8>>2];c[m+12>>2]=c[q+12>>2];c[n>>2]=c[r>>2];c[n+4>>2]=c[r+4>>2];c[n+8>>2]=c[r+8>>2];c[n+12>>2]=c[r+12>>2];if(!(IY(j,k,m,n)|0)){e=e+1|0;o=4;}else {e=0;break}}while(0);l=p;return e|0}function QY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=l;l=l+48|0;h=g+32|0;i=g+16|0;j=g;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[i>>2]=c[a>>2];c[i+4>>2]=c[a+4>>2];c[i+8>>2]=c[a+8>>2];c[i+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];f=GY(j,i,h)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];e=GY(j,i,h)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];d=(GY(j,i,h)|0)>0;l=g;return (d?e|f:e&f)>>>31^1|0}function RY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;s=l;l=l+80|0;j=s+64|0;i=s+48|0;g=s+32|0;k=s+16|0;o=s;p=c[a+4>>2]|0;q=c[a+8>>2]|0;r=c[a+16>>2]|0;m=c[a+20>>2]|0;n=T1((p<<3)+16|0)|0;if((b|0)==-2222){c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];b=SY(a,j)|0;}if((b|0)>-1){a=c[a+12>>2]|0;f=c[a+(b+1<<2)>>2]|0;a=c[a+(b<<2)>>2]|0;}else {f=p;a=p;}b=0;while(1){if((b|0)>=(a|0)){b=a;break}u=q+(b<<4)|0;c[o>>2]=c[u>>2];c[o+4>>2]=c[u+4>>2];c[o+8>>2]=c[u+8>>2];c[o+12>>2]=c[u+12>>2];u=q+(c[m+(b<<2)>>2]<<4)|0;t=q+(c[r+(b<<2)>>2]<<4)|0;c[k>>2]=c[u>>2];c[k+4>>2]=c[u+4>>2];c[k+8>>2]=c[u+8>>2];c[k+12>>2]=c[u+12>>2];c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];if((QY(k,g,i,j)|0)!=0?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[j>>2]=c[o>>2],c[j+4>>2]=c[o+4>>2],c[j+8>>2]=c[o+8>>2],c[j+12>>2]=c[o+12>>2],(PY(i,j,a,f,p,q,r)|0)!=0):0){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];c[j+12>>2]=c[o+12>>2];e=+NY(i,j);}else e=0.0;h[n+(b<<3)>>3]=e;b=b+1|0;}while(1){if((b|0)>=(f|0)){b=f;break}h[n+(b<<3)>>3]=0.0;b=b+1|0;}while(1){if((b|0)>=(p|0))break;t=q+(b<<4)|0;c[o>>2]=c[t>>2];c[o+4>>2]=c[t+4>>2];c[o+8>>2]=c[t+8>>2];c[o+12>>2]=c[t+12>>2];t=q+(c[m+(b<<2)>>2]<<4)|0;u=q+(c[r+(b<<2)>>2]<<4)|0;c[k>>2]=c[t>>2];c[k+4>>2]=c[t+4>>2];c[k+8>>2]=c[t+8>>2];c[k+12>>2]=c[t+12>>2];c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];if((QY(k,g,i,j)|0)!=0?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[j>>2]=c[o>>2],c[j+4>>2]=c[o+4>>2],c[j+8>>2]=c[o+8>>2],c[j+12>>2]=c[o+12>>2],(PY(i,j,a,f,p,q,r)|0)!=0):0){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];c[j+12>>2]=c[o+12>>2];e=+NY(i,j);}else e=0.0;h[n+(b<<3)>>3]=e;b=b+1|0;}h[n+(p<<3)>>3]=0.0;h[n+(p+1<<3)>>3]=0.0;l=s;return n|0}function SY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;m=l;l=l+32|0;f=m+8|0;e=m;h=m+24|0;i=a+8|0;j=a+12|0;k=h+4|0;d=0;while(1){if((d|0)>=(c[a>>2]|0)){d=-1111;break}o=c[j>>2]|0;n=c[o+(d<<2)>>2]|0;c[h>>2]=(c[i>>2]|0)+(n<<4);g=d+1|0;c[k>>2]=(c[o+(g<<2)>>2]|0)-n;c[e>>2]=c[h>>2];c[e+4>>2]=c[h+4>>2];c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];if(!(NX(e,f)|0))d=g;else break}l=m;return d|0}function TY(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+64|0;n=t+48|0;m=t+32|0;p=t+16|0;o=t;r=c[f+4>>2]|0;s=c[f+8>>2]|0;q=c[f+16>>2]|0;g=(e|0)<0;do if((b|0)<0)if(g){g=0;i=0;f=0;h=0;}else {b=c[f+12>>2]|0;f=0;h=0;i=e;j=b;b=b+(e<<2)|0;k=9;}else {if(g){k=c[f+12>>2]|0;f=0;h=0;i=b;j=k;b=k+(b<<2)|0;k=9;break}g=c[f+12>>2]|0;if((b|0)>(e|0)){f=c[g+(e+1<<2)>>2]|0;h=c[g+(e<<2)>>2]|0;i=b;j=g;b=g+(b<<2)|0;k=9;break}else {f=c[g+(b+1<<2)>>2]|0;h=c[g+(b<<2)>>2]|0;i=e;j=g;b=g+(e<<2)|0;k=9;break}}while(0);if((k|0)==9){g=c[j+(i+1<<2)>>2]|0;i=c[b>>2]|0;}b=0;while(1){if((b|0)>=(h|0)){k=13;break}j=s+(b<<4)|0;e=s+(c[q+(b<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[j>>2];c[m+4>>2]=c[j+4>>2];c[m+8>>2]=c[j+8>>2];c[m+12>>2]=c[j+12>>2];c[n>>2]=c[e>>2];c[n+4>>2]=c[e+4>>2];c[n+8>>2]=c[e+8>>2];c[n+12>>2]=c[e+12>>2];if(!(IY(o,p,m,n)|0))b=b+1|0;else {g=0;break}}a:do if((k|0)==13){while(1){if((f|0)>=(i|0))break;e=s+(f<<4)|0;k=s+(c[q+(f<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];if(!(IY(o,p,m,n)|0)){f=f+1|0;k=13;}else {g=0;break a}}while(1){if((g|0)>=(r|0)){g=1;break a}e=s+(g<<4)|0;k=s+(c[q+(g<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];if(!(IY(o,p,m,n)|0))g=g+1|0;else {g=0;break}}}while(0);l=t;return g|0}function UY(a){a=a|0;return VY(a,0,0)|0}function VY(a,b,c){a=a|0;b=b|0;c=c|0;return WY(a,b,c,0)|0}function WY(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;if(!d){g=T1(496)|0;if(!g)g=0;else {c[g+12>>2]=35;c[g+16>>2]=107;c[g+20>>2]=105;d=35;h=6;}}else {g=kb[c[d>>2]&63](496)|0;if(!g)g=0;else {h=c[d>>2]|0;c[g+12>>2]=h;c[g+16>>2]=c[d+4>>2];c[g+20>>2]=c[d+8>>2];d=h;h=6;}}do if((h|0)==6){c[g+8>>2]=0;c[g+32>>2]=0;c[g+376>>2]=16;j=g+12|0;i=kb[d&63](256)|0;d=g+388|0;c[d>>2]=i;if(!i){tb[c[g+20>>2]&127](g);g=0;break}h=kb[c[j>>2]&63](1024)|0;i=g+44|0;c[i>>2]=h;if(!h){e=g+20|0;tb[c[e>>2]&127](c[d>>2]|0);tb[c[e>>2]&127](g);g=0;break}c[g+48>>2]=h+1024;if(!f){f=XY(j)|0;c[g+352>>2]=f;if(!f){e=g+20|0;tb[c[e>>2]&127](c[i>>2]|0);tb[c[e>>2]&127](c[d>>2]|0);tb[c[e>>2]&127](g);g=0;break}}else c[g+352>>2]=f;c[g+372>>2]=0;c[g+364>>2]=0;c[g+300>>2]=0;c[g+464>>2]=0;c[g+460>>2]=0;c[g+124>>2]=0;c[g+244>>2]=0;d=g+468|0;a[d>>0]=33;h=g+232|0;a[h>>0]=0;a[g+233>>0]=0;c[g+392>>2]=0;c[g+396>>2]=0;a[g+400>>0]=0;f=g+228|0;c[f>>2]=0;YY(g+412|0,j);YY(g+436|0,j);ZY(g,b);if(b|0?(c[f>>2]|0)==0:0){_Y(g);g=0;break}if(!e){c[g+224>>2]=i$()|0;break}else {a[h>>0]=1;c[g+224>>2]=O0()|0;a[d>>0]=a[e>>0]|0;break}}while(0);return g|0}function XY(b){b=b|0;var d=0;d=kb[c[b>>2]&63](188)|0;if(d|0){YY(d+80|0,b);YY(d+104|0,b);f_(d,b);f_(d+20|0,b);f_(d+40|0,b);f_(d+60|0,b);a[d+131>>0]=0;f_(d+132|0,b);c[d+152>>2]=0;c[d+156>>2]=0;a[d+160>>0]=0;b=d+164|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;a[d+128>>0]=1;a[d+129>>0]=0;a[d+130>>0]=0;}return d|0}function YY(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=b;return}function ZY(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;c[d+276>>2]=56;V0(d+252|0);if(e|0)c[d+228>>2]=gZ(e,d+12|0)|0;c[d+356>>2]=0;Y$(d+148|0,d+144|0,0)|0;c[d>>2]=0;c[d+4>>2]=0;e=d+116|0;g=d+52|0;h=g+64|0;do{c[g>>2]=0;g=g+4|0;}while((g|0)<(h|0));c[e>>2]=d;c[d+120>>2]=0;e=d+128|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;e=c[d+8>>2]|0;c[d+24>>2]=e;c[d+28>>2]=e;c[d+36>>2]=0;c[d+40>>2]=0;e=d+312|0;g=d+404|0;c[g>>2]=0;c[g+4>>2]=0;g=d+280|0;f=d+304|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;g=e;h=g+36|0;do{c[g>>2]=0;g=g+4|0;}while((g|0)<(h|0));b[e+36>>1]=0;a[f>>0]=1;c[d+308>>2]=0;c[d+360>>2]=0;c[d+368>>2]=0;c[d+380>>2]=0;c[d+236>>2]=0;c[d+248>>2]=0;c[d+240>>2]=0;c[d+472>>2]=0;c[d+476>>2]=0;a[d+484>>0]=0;a[d+485>>0]=0;c[d+488>>2]=0;c[d+492>>2]=0;return}function _Y(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;if(b|0){e=b+364|0;g=b+20|0;d=c[b+360>>2]|0;while(1){if(!d){d=c[e>>2]|0;if(!d)break;c[e>>2]=0;}h=c[d>>2]|0;tb[c[g>>2]&127](c[d+36>>2]|0);$Y(c[d+44>>2]|0,b);tb[c[g>>2]&127](d);d=h;}e=b+300|0;d=c[b+296>>2]|0;while(1){if(!d){d=c[e>>2]|0;if(!d)break;c[e>>2]=0;}h=c[d+8>>2]|0;tb[c[g>>2]&127](d);d=h;}$Y(c[b+372>>2]|0,b);$Y(c[b+368>>2]|0,b);aZ(b+412|0);aZ(b+436|0);d=b+12|0;tb[c[g>>2]&127](c[b+228>>2]|0);if((a[b+484>>0]|0)==0?(f=c[b+352>>2]|0,f|0):0)bZ(f,(c[b+472>>2]|0)==0&1,d);tb[c[g>>2]&127](c[b+388>>2]|0);tb[c[g>>2]&127](c[b+460>>2]|0);tb[c[g>>2]&127](c[b+8>>2]|0);tb[c[g>>2]&127](c[b+44>>2]|0);tb[c[g>>2]&127](c[b+392>>2]|0);tb[c[g>>2]&127](c[b+236>>2]|0);d=c[b+248>>2]|0;if(d|0)tb[d&127](c[b+240>>2]|0);tb[c[g>>2]&127](b);}return}function $Y(a,b){a=a|0;b=b|0;var d=0;b=b+20|0;while(1){if(!a)break;d=c[a+4>>2]|0;tb[c[b>>2]&127](c[a+16>>2]|0);tb[c[b>>2]&127](a);a=d;}return}function aZ(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;b=c[a>>2]|0;while(1){if(!b)break;e=c[b>>2]|0;tb[c[(c[d>>2]|0)+8>>2]&127](b);b=e;}b=c[a+4>>2]|0;while(1){if(!b)break;e=c[b>>2]|0;tb[c[(c[d>>2]|0)+8>>2]&127](b);b=e;}return}function bZ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=a+20|0;cZ(f,g);d=d+8|0;while(1){e=dZ(f)|0;if(!e)break;if(!(c[e+16>>2]|0))continue;tb[c[d>>2]&127](c[e+20>>2]|0);}eZ(a);eZ(a+132|0);eZ(g);eZ(a+40|0);eZ(a+60|0);aZ(a+80|0);aZ(a+104|0);if(b<<24>>24){tb[c[d>>2]&127](c[a+184>>2]|0);tb[c[d>>2]&127](c[a+164>>2]|0);}tb[c[d>>2]&127](a);l=h;return}function cZ(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;c[a>>2]=d;c[a+4>>2]=d+(c[b+8>>2]<<2);return}function dZ(a){a=a|0;var b=0,d=0,e=0;d=c[a+4>>2]|0;e=c[a>>2]|0;do{if((e|0)==(d|0)){b=0;break}b=e;e=e+4|0;c[a>>2]=e;b=c[b>>2]|0;}while(!(b|0));return b|0}function eZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=a+8|0;e=a+16|0;b=0;while(1){f=c[(c[e>>2]|0)+8>>2]|0;g=c[a>>2]|0;if(b>>>0>=(c[d>>2]|0)>>>0)break;tb[f&127](c[g+(b<<2)>>2]|0);b=b+1|0;}tb[f&127](g);return}function fZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=hZ(a)|0;if(!f){c[a+276>>2]=57;f=iZ(a,b,d,e)|0;}return f|0}function gZ(b,d){b=b|0;d=d|0;var e=0,f=0;e=0;do{f=e;e=e+1|0;}while((a[b+f>>0]|0)!=0);d=kb[c[d>>2]&63](e)|0;if(!d)d=0;else W6(d|0,b|0,e|0)|0;return d|0}function hZ(b){b=b|0;var d=0;d=b+228|0;if(!(nb[(a[b+232>>0]<<24>>24?38:37)&63](b+148|0,b+144|0,c[d>>2]|0)|0))b=e_(b,c[d>>2]|0)|0;else b=0;return b|0}function iZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=l;l=l+16|0;h=g;c[h>>2]=d;j=b+144|0;i=c[j>>2]|0;i=ob[c[i>>2]&127](i,d,e,h)|0;f=jZ(b,c[j>>2]|0,d,e,i,c[h>>2]|0,f,(a[b+480>>0]|0)==0&1)|0;l=g;return f|0}function jZ(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0;Ga=l;l=l+16|0;Da=Ga;c[Da>>2]=i;r=c[b+352>>2]|0;s=b+144|0;if((c[s>>2]|0)==(e|0)){p=b+284|0;q=b+288|0;na=b+296|0;}else {na=b+296|0;q=c[na>>2]|0;p=q;q=q+4|0;}t=k<<24>>24!=0;pa=b+252|0;u=b+80|0;v=b+476|0;w=b+84|0;x=b+320|0;y=b+412|0;z=b+316|0;A=b+424|0;B=b+428|0;C=b+324|0;ra=b+4|0;D=b+485|0;E=r+132|0;F=b+312|0;ta=r+129|0;G=r+128|0;H=r+80|0;I=r+92|0;J=r+96|0;K=b+136|0;L=b+88|0;M=b+488|0;va=b+112|0;wa=r+131|0;xa=b+116|0;ya=r+130|0;za=b+108|0;Aa=b+356|0;N=b+340|0;O=b+132|0;P=b+344|0;Q=b+348|0;R=b+328|0;S=b+349|0;T=b+420|0;U=r+120|0;V=r+116|0;W=b+92|0;X=b+472|0;Y=b+336|0;Z=b+332|0;_=b+96|0;$=b+256|0;aa=b+464|0;ba=b+460|0;ca=r+160|0;da=r+184|0;ea=r+180|0;fa=r+164|0;ga=b+128|0;ha=b+12|0;ia=b+16|0;ja=b+268|0;ka=b+120|0;la=r+176|0;ma=r+168|0;o=e;n=f;e=h;a:while(1){c[p>>2]=n;f=c[Da>>2]|0;c[q>>2]=f;i=f;b:do if((e|0)<1){if(t&(e|0)!=0){m=7;break a}switch(e|0){case -1:{i=5;m=280;break a}case 0:{m=9;break a}case -2:{i=6;break a}case -4:{m=10;break a}case -15:{e=15;break b}default:{}}c[Da>>2]=g;e=0-e|0;i=g;}while(0);h=pb[c[pa>>2]&127](pa,e,n,i,o)|0;c:do switch(h|0){case 2:{m=58;break a}case -1:{m=184;break a}case 1:{i=kZ(b,0,n,c[Da>>2]|0)|0;if(i|0){m=280;break a}i=c[s>>2]|0;break}case 4:{if(!(c[w>>2]|0))i=1;else {m=lZ(y,o,n,c[Da>>2]|0)|0;c[z>>2]=m;if(!m){i=1;m=280;break a}c[B>>2]=c[A>>2];c[C>>2]=0;i=0;}c[x>>2]=0;m=274;break}case 7:{i=c[w>>2]|0;if(!i)m=275;else {yb[i&15](c[ra>>2]|0,c[z>>2]|0,c[x>>2]|0,c[C>>2]|0,1);c[z>>2]=0;mZ(y);i=o;}break}case 57:{i=kZ(b,1,n,c[Da>>2]|0)|0;if(i|0){m=280;break a}i=c[s>>2]|0;break}case 6:{a[D>>0]=0;m=nZ(b,E,75395,36)|0;c[F>>2]=m;if(!m){i=1;m=280;break a}a[ta>>0]=1;if(!(c[w>>2]|0))m=33;else {if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break a}i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}oZ(i);c[B>>2]=c[A>>2];c[C>>2]=i;i=0;m=34;}break}case 14:{m=33;break}case 8:{i=c[z>>2]|0;if(!i)i=1;else {yb[c[w>>2]&15](c[ra>>2]|0,i,c[x>>2]|0,c[C>>2]|0,0);mZ(y);i=0;}if(!((c[x>>2]|0)==0?!(a[D>>0]|0):0)){f=a[ta>>0]|0;a[ta>>0]=1;do if(c[M>>2]|0?c[va>>2]|0:0){h=nZ(b,E,75395,36)|0;if(!h){i=1;m=280;break a}if(!(a[D>>0]|0))e=h+20|0;else {e=h+20|0;c[e>>2]=c[Aa>>2];}a[wa>>0]=0;if(!(pb[c[va>>2]&127](c[xa>>2]|0,0,c[e>>2]|0,c[h+16>>2]|0,c[h+24>>2]|0)|0)){i=21;m=280;break a}if(!(a[wa>>0]|0)){if(c[x>>2]|0)break;a[ta>>0]=f;break}if(((a[ya>>0]|0)==0?(oa=c[za>>2]|0,oa|0):0)?(kb[oa&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}}while(0);a[D>>0]=0;}e=c[L>>2]|0;if(!e)m=274;else {tb[e&127](c[ra>>2]|0);i=o;}break}case 34:{m=qZ(b,o,n,c[Da>>2]|0)|0;c[N>>2]=m;if(!m){i=1;m=280;break a}else m=80;break}case 22:{m=rZ(b,o,n,c[Da>>2]|0)|0;c[P>>2]=m;if(!m){i=1;m=280;break a}a[Q>>0]=0;c[R>>2]=0;a[S>>0]=0;m=80;break}case 23:{a[Q>>0]=1;c[R>>2]=142188;m=80;break}case 24:{a[S>>0]=1;c[R>>2]=142194;m=80;break}case 25:{c[R>>2]=142197;m=80;break}case 26:{c[R>>2]=142203;m=80;break}case 27:{c[R>>2]=142210;m=80;break}case 28:{c[R>>2]=142217;m=80;break}case 29:{c[R>>2]=142226;m=80;break}case 30:{c[R>>2]=142234;m=80;break}case 32:case 31:{if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0){if(!(sZ(y,(c[R>>2]|0)==0?((h|0)==32?142243:142253):142255)|0)){i=1;m=280;break a}if(!(tZ(y,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}c[R>>2]=c[B>>2];i=o;}else m=275;break}case 36:case 35:{if(a[G>>0]|0){if(!(uZ(c[N>>2]|0,c[P>>2]|0,a[Q>>0]|0,a[S>>0]|0,0,b)|0)){i=1;m=280;break a}if((c[O>>2]|0)!=0?(qa=c[R>>2]|0,(qa|0)!=0):0){switch(a[qa>>0]|0){case 40:{m=93;break}case 78:{if((a[qa+1>>0]|0)==79)m=93;break}default:{}}if((m|0)==93){m=0;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=41;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=0;c[R>>2]=c[B>>2];c[B>>2]=c[A>>2];}c[q>>2]=n;zb[c[O>>2]&15](c[ra>>2]|0,c[c[N>>2]>>2]|0,c[c[P>>2]>>2]|0,c[R>>2]|0,0,(h|0)==36&1);mZ(y);i=o;}else m=275;}else m=275;break}case 38:case 37:{if(a[G>>0]|0){i=c[o+64>>2]|0;i=wZ(b,o,a[Q>>0]|0,n+i|0,(c[Da>>2]|0)+(0-i)|0,H)|0;if(i|0){m=280;break a}e=c[J>>2]|0;c[J>>2]=c[I>>2];if(!(uZ(c[N>>2]|0,c[P>>2]|0,a[Q>>0]|0,0,e,b)|0)){i=1;m=280;break a}if((c[O>>2]|0)!=0?(sa=c[R>>2]|0,(sa|0)!=0):0){switch(a[sa>>0]|0){case 40:{m=108;break}case 78:{if((a[sa+1>>0]|0)==79)m=108;break}default:{}}if((m|0)==108){m=0;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=41;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=0;c[R>>2]=c[B>>2];c[B>>2]=c[A>>2];}c[q>>2]=n;zb[c[O>>2]&15](c[ra>>2]|0,c[c[N>>2]>>2]|0,c[c[P>>2]>>2]|0,c[R>>2]|0,e,(h|0)==38&1);mZ(y);i=o;}else m=275;}else m=275;break}case 12:{if(a[G>>0]|0){i=c[o+64>>2]|0;i=xZ(b,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;e=c[F>>2]|0;f=c[U>>2]|0;if(e){c[e+4>>2]=f;c[(c[F>>2]|0)+8>>2]=(c[V>>2]|0)-(c[U>>2]|0);c[U>>2]=c[V>>2];if(!(c[K>>2]|0))e=1;else {c[q>>2]=n;e=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[e>>2]|0,d[e+33>>0]|0,c[e+4>>2]|0,c[e+8>>2]|0,c[Aa>>2]|0,0,0,0);e=0;}}else {c[V>>2]=f;e=1;}if(!i){i=e;m=274;}else {m=280;break a}}else m=275;break}case 5:{a[D>>0]=0;a[ta>>0]=1;if(!(c[w>>2]|0)){c[x>>2]=75395;i=1;}else {m=c[o+64>>2]|0;m=lZ(y,o,n+m|0,(c[Da>>2]|0)+(0-m)|0)|0;c[x>>2]=m;if(!m){i=1;m=280;break a}c[B>>2]=c[A>>2];i=0;}if((((a[ya>>0]|0)==0?(c[M>>2]|0)==0:0)?(ua=c[za>>2]|0,ua|0):0)?(kb[ua&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}if(!(c[F>>2]|0)){e=nZ(b,E,75395,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}c[e+24>>2]=0;m=133;}else m=133;break}case 13:{i=1;m=133;break}case 15:{if(((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0)?(c[K>>2]|0)!=0:0){c[q>>2]=n;i=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[i>>2]|0,d[i+33>>0]|0,0,0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,0);i=o;}else m=275;break}case 16:{if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){h=lZ(H,o,n,c[Da>>2]|0)|0;c[(c[F>>2]|0)+28>>2]=h;if(!(c[(c[F>>2]|0)+28>>2]|0)){i=1;m=280;break a}c[J>>2]=c[I>>2];if(c[W>>2]|0){c[q>>2]=n;i=c[F>>2]|0;zb[c[W>>2]&15](c[ra>>2]|0,c[i>>2]|0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,c[i+28>>2]|0);i=o;break c}if(c[K>>2]|0){c[q>>2]=n;i=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[i>>2]|0,0,0,0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,c[i+28>>2]|0);i=o;}else m=275;}else m=275;break}case 9:{if(nb[c[o+44>>2]&63](o,n,c[Da>>2]|0)|0){c[F>>2]=0;m=275;break c}if(!(a[G>>0]|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}i=lZ(H,o,n,c[Da>>2]|0)|0;if(!i){i=1;m=280;break a}e=nZ(b,r,i,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}if((c[e>>2]|0)!=(i|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}c[J>>2]=c[I>>2];c[(c[F>>2]|0)+24>>2]=0;a[(c[F>>2]|0)+33>>0]=0;if(!(c[X>>2]|0))i=(c[na>>2]|0)!=0;else i=1;a[(c[F>>2]|0)+34>>0]=(i^1)&1;if(!(c[K>>2]|0))m=275;else i=o;break}case 10:{if(!(a[G>>0]|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}i=lZ(H,o,n,c[Da>>2]|0)|0;if(!i){i=1;m=280;break a}e=nZ(b,E,i,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}if((c[e>>2]|0)!=(i|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}c[J>>2]=c[I>>2];c[(c[F>>2]|0)+24>>2]=0;a[(c[F>>2]|0)+33>>0]=1;if(!(c[X>>2]|0))i=(c[na>>2]|0)!=0;else i=1;a[(c[F>>2]|0)+34>>0]=(i^1)&1;if(!(c[K>>2]|0))m=275;else i=o;break}case 18:{c[Y>>2]=0;c[Z>>2]=0;if(!(c[_>>2]|0))m=275;else {n=lZ(y,o,n,c[Da>>2]|0)|0;c[Z>>2]=n;if(!n){i=1;m=280;break a}c[B>>2]=c[A>>2];i=o;}break}case 21:{if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break a}if(!(c[Z>>2]|0))m=275;else {i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}oZ(i);c[Y>>2]=i;c[B>>2]=c[A>>2];i=o;}break}case 19:{if((c[Z>>2]|0)!=0?(c[_>>2]|0)!=0:0){i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}c[q>>2]=n;yb[c[_>>2]&15](c[ra>>2]|0,c[Z>>2]|0,c[Aa>>2]|0,i,c[Y>>2]|0);i=0;}else i=1;mZ(y);m=274;break}case 20:{if((c[Y>>2]|0)!=0?(c[_>>2]|0)!=0:0){c[q>>2]=n;yb[c[_>>2]&15](c[ra>>2]|0,c[Z>>2]|0,c[Aa>>2]|0,0,c[Y>>2]|0);i=0;}else i=1;mZ(y);m=274;break}case 58:{if(c[u>>2]|0)yZ(b,o,n,c[Da>>2]|0);i=zZ(b,o,Da,g,j,k)|0;if(i|0){m=280;break a}if(!(c[Da>>2]|0)){m=189;break a}else i=o;break}case 44:{i=c[aa>>2]|0;do if((c[$>>2]|0)>>>0>=i>>>0){if(!i){h=c[ha>>2]|0;c[aa>>2]=32;h=kb[h&63](32)|0;c[ba>>2]=h;if(!h){m=198;break a}else break}f=c[ia>>2]|0;h=c[ba>>2]|0;i=i<<1;c[aa>>2]=i;i=lb[f&127](h,i)|0;if(!i){m=193;break a}c[ba>>2]=i;i=c[da>>2]|0;if(i|0){i=lb[c[ia>>2]&127](i,c[aa>>2]<<2)|0;if(!i){i=1;m=280;break a}c[da>>2]=i;}}while(0);a[(c[ba>>2]|0)+(c[$>>2]|0)>>0]=0;if(a[ca>>0]|0){i=BZ(b)|0;if((i|0)<0){i=1;m=280;break a}c[(c[da>>2]|0)+(c[ea>>2]<<2)>>2]=i;c[ea>>2]=(c[ea>>2]|0)+1;c[(c[fa>>2]|0)+(i*28|0)>>2]=6;if(c[ga>>2]|0)i=o;else m=275;}else m=275;break}case 50:{i=(c[ba>>2]|0)+(c[$>>2]|0)|0;if((a[i>>0]|0)==124){i=2;m=280;break a}a[i>>0]=44;if((a[ca>>0]|0)!=0?(c[ga>>2]|0)!=0:0)i=o;else m=275;break}case 49:{f=c[ba>>2]|0;e=c[$>>2]|0;i=a[f+e>>0]|0;if(i<<24>>24==44){i=2;m=280;break a}if(i<<24>>24==0&(a[ca>>0]|0)!=0?(Ba=(c[fa>>2]|0)+((c[(c[da>>2]|0)+((c[ea>>2]|0)+-1<<2)>>2]|0)*28|0)|0,(c[Ba>>2]|0)!=3):0){c[Ba>>2]=5;i=(c[ga>>2]|0)==0&1;f=c[ba>>2]|0;e=c[$>>2]|0;}else i=1;a[f+e>>0]=124;m=274;break}case 59:case 60:{a[ta>>0]=1;if(c[M>>2]|0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;if(!e){i=1;m=280;break a}f=nZ(b,E,e,0)|0;c[I>>2]=c[J>>2];do if(c[ja>>2]|0){if(!(a[ya>>0]|0)){if(a[ta>>0]|0){m=219;break}}else if(c[na>>2]|0){m=219;break}if(!f){i=11;m=280;break a}if(!(a[f+34>>0]|0)){i=24;m=280;break a}}else m=219;while(0);if((m|0)==219?(m=0,(f|0)==0):0){a[G>>0]=a[ya>>0]|0;if((h|0)!=60){m=275;break c}i=c[ka>>2]|0;if(!i){m=275;break c}vb[i&127](c[ra>>2]|0,e,1);i=o;break c}i=f+32|0;if(a[i>>0]|0){i=12;m=280;break a}if(c[f+4>>2]|0){i=CZ(b,f,(h|0)==60&1)|0;e=(i|0)==0;if(e){i=(e^1)&1;m=274;break c}else {m=280;break a}}if(!(c[va>>2]|0)){a[G>>0]=a[ya>>0]|0;m=275;break c}a[wa>>0]=0;a[i>>0]=1;h=(pb[c[va>>2]&127](c[xa>>2]|0,0,c[f+20>>2]|0,c[f+16>>2]|0,c[f+24>>2]|0)|0)==0;a[i>>0]=0;if(h){i=21;m=280;break a}e=a[ya>>0]|0;if(!(a[wa>>0]|0)){a[G>>0]=e;i=o;break c}else i=0;}else {e=a[ya>>0]|0;a[G>>0]=e;i=1;}if((e<<24>>24==0?(Ca=c[za>>2]|0,(Ca|0)!=0):0)?(kb[Ca&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}else m=274;break}case 40:{if(!(c[ga>>2]|0))m=275;else {n=qZ(b,o,n,c[Da>>2]|0)|0;c[N>>2]=n;if(!n){i=1;m=280;break a}c[ea>>2]=0;c[la>>2]=0;a[ca>>0]=1;i=o;}break}case 42:case 41:{if(!(a[ca>>0]|0))m=275;else {if(!(c[ga>>2]|0))i=1;else {i=kb[c[ha>>2]&63](20)|0;if(!i){i=1;m=280;break a}m=i+4|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[i>>2]=(h|0)==41?2:1;c[q>>2]=n;vb[c[ga>>2]&127](c[ra>>2]|0,c[c[N>>2]>>2]|0,i);i=0;}a[ca>>0]=0;m=274;}break}case 43:{if((a[ca>>0]|0)!=0?(c[(c[fa>>2]|0)+((c[(c[da>>2]|0)+((c[ea>>2]|0)+-1<<2)>>2]|0)*28|0)>>2]=3,(c[ga>>2]|0)!=0):0)i=o;else m=275;break}case 51:{e=0;m=247;break}case 53:{e=1;m=247;break}case 52:{e=2;m=247;break}case 54:{e=3;m=247;break}case 45:{f=0;m=258;break}case 47:{f=1;m=258;break}case 46:{f=2;m=258;break}case 48:{f=3;m=258;break}case 55:{if(!(EZ(b,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}else i=o;break}case 56:{if(!(FZ(b,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}else i=o;break}case 0:{if((e|0)==14)i=o;else m=275;break}case 3:{if(!(c[w>>2]|0))m=275;else i=o;break}case 11:{if((a[G>>0]|0)!=0?(c[K>>2]|0)!=0:0)i=o;else m=275;break}case 17:{if(!(c[_>>2]|0))m=275;else i=o;break}case 33:{if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0)i=o;else m=275;break}case 39:{if(!(c[ga>>2]|0))m=275;else i=o;break}default:m=275;}while(0);if((m|0)==33)if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break}else {i=1;m=34;}else if((m|0)==80){m=0;if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0)i=o;else m=275;}else if((m|0)==133){m=0;if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;c[(c[F>>2]|0)+16>>2]=e;e=c[F>>2]|0;if(!(c[e+16>>2]|0)){i=1;m=280;break}c[e+20>>2]=c[Aa>>2];c[J>>2]=c[I>>2];if((h|0)==13&(c[K>>2]|0)!=0)i=o;else m=274;}else m=274;}else if((m|0)==247){m=0;if(a[ca>>0]|0){i=c[Da>>2]|0;if(e)i=i+(0-(c[o+64>>2]|0))|0;f=BZ(b)|0;if((f|0)<0){i=1;m=280;break}c[(c[fa>>2]|0)+(f*28|0)>>2]=4;c[(c[fa>>2]|0)+(f*28|0)+4>>2]=e;i=qZ(b,o,n,i)|0;if(!i){i=1;m=280;break}e=c[i>>2]|0;c[(c[fa>>2]|0)+(f*28|0)+8>>2]=e;i=0;do{h=i;i=i+1|0;}while((a[e+h>>0]|0)!=0);c[ma>>2]=(c[ma>>2]|0)+i;if(c[ga>>2]|0)i=o;else m=275;}else m=275;}else if((m|0)==258)if(a[ca>>0]|0){e=(c[ga>>2]|0)==0;i=e&1;m=(c[ea>>2]|0)+-1|0;c[ea>>2]=m;c[(c[fa>>2]|0)+((c[(c[da>>2]|0)+(m<<2)>>2]|0)*28|0)+4>>2]=f;if(!(c[ea>>2]|0)){if(!e){e=DZ(b)|0;if(!e){i=1;m=280;break}c[q>>2]=n;vb[c[ga>>2]&127](c[ra>>2]|0,c[c[N>>2]>>2]|0,e);}a[ca>>0]=0;c[ma>>2]=0;m=274;}else m=274;}else m=275;if((m|0)==34){m=0;if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;if(!e){i=1;m=280;break}oZ(e);c[(c[F>>2]|0)+24>>2]=e;c[J>>2]=c[I>>2];if((h|0)==14&(c[K>>2]|0)!=0)i=o;else m=274;}else m=274;}if((m|0)==274){m=0;if(!(i<<24>>24))i=o;else m=275;}if((m|0)==275){m=0;if(!(c[u>>2]|0))i=o;else {yZ(b,o,n,c[Da>>2]|0);i=o;}}switch(c[v>>2]|0){case 3:{m=278;break a}case 2:{i=35;m=280;break a}default:{}}e=c[Da>>2]|0;o=i;n=e;e=ob[c[i>>2]&127](i,e,g,Da)|0;}d:switch(m|0){case 7:{c[j>>2]=n;i=0;break}case 9:{c[p>>2]=f;i=4;break}case 10:{i=(o|0)==(c[s>>2]|0);if(!i?(a[(c[na>>2]|0)+20>>0]|0)==0:0){c[j>>2]=n;i=0;break}if((a[b+484>>0]|0)!=0|i^1)if((pb[c[pa>>2]&127](pa,-4,g,g,o)|0)==-1)i=29;else {c[j>>2]=n;i=0;}else i=3;break}case 58:{do if((a[D>>0]|0?(Ea=a[ta>>0]|0,a[ta>>0]=1,c[M>>2]|0):0)?c[va>>2]|0:0){i=nZ(b,E,75395,36)|0;if(!i){i=1;break d}Da=i+20|0;c[Da>>2]=c[Aa>>2];a[wa>>0]=0;if(!(pb[c[va>>2]&127](c[xa>>2]|0,0,c[Da>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0)|0)){i=21;break d}if(!(a[wa>>0]|0)){a[ta>>0]=Ea;break}if(((a[ya>>0]|0)==0?(Fa=c[za>>2]|0,Fa|0):0)?(kb[Fa&63](c[ra>>2]|0)|0)==0:0){i=22;break d}}while(0);c[b+276>>2]=58;i=pZ(b,n,g,j)|0;break}case 184:{i=(e|0)==28?10:(e|0)==12?17:2;break}case 189:{c[b+276>>2]=59;i=0;break}case 193:{c[aa>>2]=(c[aa>>2]|0)>>>1;i=1;break}case 198:{c[aa>>2]=0;i=1;break}case 278:{c[j>>2]=c[Da>>2];i=0;break}case 280:break}l=Ga;return i|0}function kZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+32|0;p=q+16|0;m=q+12|0;i=q+8|0;j=q+4|0;k=q;c[p>>2]=0;c[m>>2]=0;c[i>>2]=0;c[k>>2]=-1;n=b+144|0;o=b+284|0;g=(d|0)!=0;a:do if(rb[(a[b+232>>0]<<24>>24?2:1)&3](d,c[n>>2]|0,e,f,o,i,j,p,m,k)|0){if((c[k>>2]|0)==1&(g^1)?(a[(c[b+352>>2]|0)+130>>0]=1,h=b+488|0,(c[h>>2]|0)==1):0)c[h>>2]=0;h=b+140|0;if(!(c[h>>2]|0))if(!(c[b+80>>2]|0)){e=0;d=0;}else {yZ(b,c[n>>2]|0,e,f);e=0;d=0;}else {d=c[p>>2]|0;if(!d)d=0;else {f=c[n>>2]|0;d=lZ(b+436|0,f,d,d+(lb[c[f+28>>2]&127](f,d)|0)|0)|0;if(!d){d=1;break}c[b+452>>2]=c[b+448>>2];}g=c[i>>2]|0;if(g){i=c[n>>2]|0;g=lZ(b+436|0,i,g,(c[j>>2]|0)+(0-(c[i+64>>2]|0))|0)|0;if(!g){d=1;break}}else g=0;xb[c[h>>2]&31](c[b+4>>2]|0,g,d,c[k>>2]|0);e=g;}do if(!(c[b+228>>2]|0)){g=c[m>>2]|0;h=g;if(g|0){k=c[g+64>>2]|0;m=c[n>>2]|0;if((k|0)==(c[m+64>>2]|0)?(k|0)!=2|(g|0)==(m|0):0){c[n>>2]=h;break}c[o>>2]=c[p>>2];d=19;break a}g=c[p>>2]|0;if(g|0){h=b+436|0;if(!d){d=c[n>>2]|0;d=lZ(h,d,g,g+(lb[c[d+28>>2]&127](d,g)|0)|0)|0;if(!d){d=1;break a}}d=e_(b,d)|0;mZ(h);if((d|0)!=18)break a;c[o>>2]=c[p>>2];d=18;break a}}while(0);if((d|0)!=0|(e|0)!=0){mZ(b+436|0);d=0;}else d=0;}else d=g?31:30;while(0);l=q;return d|0}function lZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;do if(!(tZ(b,d,e,f)|0))d=0;else {e=b+12|0;d=c[e>>2]|0;if((d|0)==(c[b+8>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}d=c[e>>2]|0;}c[e>>2]=d+1;a[d>>0]=0;d=c[b+16>>2]|0;}while(0);return d|0}function mZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=a+4|0;b=c[e>>2]|0;a:do if(!b){c[e>>2]=c[a>>2];b=a;}else {d=c[a>>2]|0;while(1){if(!d){b=a;break a}g=c[d>>2]|0;c[d>>2]=b;c[e>>2]=d;f=d;d=g;b=f;}}while(0);c[b>>2]=0;c[a+16>>2]=0;c[a+12>>2]=0;c[a+8>>2]=0;return}function nZ(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;w=e+8|0;a:do if(!(c[w>>2]|0))if(g){a[e+4>>0]=6;c[w>>2]=64;h=e+16|0;i=kb[c[c[h>>2]>>2]&63](256)|0;c[e>>2]=i;if(!i){c[w>>2]=0;h=0;break}else {Y6(i|0,0,256)|0;j=c_(b,f)|0;j=(c[w>>2]|0)+-1&j;i=e;o=27;break}}else h=0;else {v=c_(b,f)|0;k=c[w>>2]|0;j=k+-1|0;l=c[e>>2]|0;m=v&0-k;u=e+4|0;n=j>>>2;i=0;j=j&v;while(1){h=c[l+(j<<2)>>2]|0;if(!h)break;if((d_(f,c[h>>2]|0)|0)<<24>>24)break a;if(!(i<<24>>24))h=(m>>>((d[u>>0]|0)+-1|0)&n|1)&255;else h=i;t=h&255;i=h;j=j-t+(j>>>0>>0?k:0)|0;}if(g){i=a[u>>0]|0;h=i&255;if(!((c[e+12>>2]|0)>>>(h+-1|0))){h=e+16|0;i=e;o=27;break}q=h+1&255;j=i+1&255;s=1<>2]>>2]&63](i)|0;if(t){Y6(t|0,0,i|0)|0;p=0-s|0;n=j+-1|0;o=r>>>2;m=0;while(1){if(m>>>0>=(c[w>>2]|0)>>>0)break;i=c[(c[e>>2]|0)+(m<<2)>>2]|0;if(i|0){i=c_(b,c[i>>2]|0)|0;k=((i&p)>>>n&o|1)&255;i=i&r;j=0;while(1){l=t+(i<<2)|0;if(!(c[l>>2]|0))break;l=j<<24>>24==0?k:j;x=l&255;i=i+(i>>>0>>0?s:0)-x|0;j=l;}c[l>>2]=c[(c[e>>2]|0)+(m<<2)>>2];}m=m+1|0;}tb[c[(c[h>>2]|0)+8>>2]&127](c[e>>2]|0);c[e>>2]=t;a[u>>0]=q;c[w>>2]=s;k=((v&p)>>>n&o|1)&255;i=r&v;j=0;while(1){if(!(c[t+(i<<2)>>2]|0)){j=i;i=e;o=27;break a}x=j<<24>>24==0?k:j;w=x&255;i=i+(i>>>0>>0?s:0)-w|0;j=x;}}else h=0;}else h=0;}while(0);if((o|0)==27){h=kb[c[c[h>>2]>>2]&63](g)|0;c[(c[i>>2]|0)+(j<<2)>>2]=h;h=c[(c[i>>2]|0)+(j<<2)>>2]|0;if(!h)h=0;else {Y6(h|0,0,g|0)|0;c[c[(c[i>>2]|0)+(j<<2)>>2]>>2]=f;h=e+12|0;c[h>>2]=(c[h>>2]|0)+1;h=c[(c[i>>2]|0)+(j<<2)>>2]|0;}}return h|0}function oZ(b){b=b|0;var c=0,d=0,e=0;e=b;c=b;while(1){d=a[e>>0]|0;if(!(d<<24>>24))break;switch(d<<24>>24|0){case 10:case 13:case 32:{if((c|0)!=(b|0)){if((a[c+-1>>0]|0)!=32){a[c>>0]=32;c=c+1|0;}}else c=b;break}default:{a[c>>0]=d;c=c+1|0;}}e=e+1|0;}if((c|0)!=(b|0)){b=c+-1|0;b=(a[b>>0]|0)==32?b:c;}a[b>>0]=0;return}function pZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;d=IZ(b,0,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;if((d|0)==0?(RZ(b)|0)<<24>>24==0:0)d=1;return d|0}function qZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[a+352>>2]|0;b=lZ(g+80|0,b,d,e)|0;do if((b|0)!=0?(f=nZ(a,g+20|0,b,24)|0,(f|0)!=0):0)if((c[f>>2]|0)==(b|0)){c[g+96>>2]=c[g+92>>2];if(!(TZ(a,f)|0)){f=0;break}}else c[g+92>>2]=c[g+96>>2];else f=0;while(0);return f|0}function rZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[b+352>>2]|0;k=m+80|0;n=m+92|0;h=c[n>>2]|0;l=m+88|0;if((h|0)==(c[l>>2]|0))if(!((vZ(k)|0)<<24>>24))g=0;else {h=c[n>>2]|0;i=4;}else i=4;a:do if((i|0)==4){c[n>>2]=h+1;a[h>>0]=0;d=lZ(k,d,e,f)|0;if((d|0)!=0?(j=d+1|0,g=nZ(b,m+40|0,j,12)|0,(g|0)!=0):0){if((c[g>>2]|0)!=(j|0)){c[n>>2]=c[m+96>>2];break}h=c[n>>2]|0;i=m+96|0;c[i>>2]=h;if(a[b+232>>0]|0){e=a[j>>0]|0;b:do if(e<<24>>24==120)if((((a[d+2>>0]|0)==109?(a[d+3>>0]|0)==108:0)?(a[d+4>>0]|0)==110:0)?(a[d+5>>0]|0)==115:0){switch(a[d+6>>0]|0){case 0:{h=m+152|0;break}case 58:{h=nZ(b,m+60|0,d+7|0,8)|0;break}default:{f=0;d=120;break b}}c[g+4>>2]=h;a[g+9>>0]=1;break a}else {f=0;d=120;}else {f=0;d=e;}while(0);c:while(1){switch(d<<24>>24){case 0:break a;case 58:{e=0;break c}default:{}}d=f+1|0;f=d;d=a[j+d>>0]|0;}while(1){d=(h|0)==(c[l>>2]|0);if((e|0)>=(f|0))break;if(d){if(!((vZ(k)|0)<<24>>24)){g=0;break a}h=c[n>>2]|0;}d=a[j+e>>0]|0;c[n>>2]=h+1;a[h>>0]=d;e=e+1|0;h=c[n>>2]|0;}if(d){if(!((vZ(k)|0)<<24>>24)){g=0;break}h=c[n>>2]|0;}c[n>>2]=h+1;a[h>>0]=0;h=nZ(b,m+60|0,c[i>>2]|0,8)|0;c[g+4>>2]=h;if(h){d=c[i>>2]|0;if((c[h>>2]|0)==(d|0)){c[i>>2]=c[n>>2];break}else {c[n>>2]=d;break}}else g=0;}}else g=0;}while(0);return g|0}function sZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=b+12|0;h=b+8|0;while(1){e=a[d>>0]|0;if(!(e<<24>>24)){i=7;break}f=c[g>>2]|0;if((f|0)==(c[h>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}f=c[g>>2]|0;e=a[d>>0]|0;}c[g>>2]=f+1;a[f>>0]=e;d=d+1|0;}if((i|0)==7)d=c[b+16>>2]|0;return d|0}function tZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;c[h>>2]=d;g=a+12|0;if((c[g>>2]|0)==0?(vZ(a)|0)<<24>>24==0:0)d=0;else f=3;a:do if((f|0)==3){d=b+56|0;f=a+8|0;while(1){if((pb[c[d>>2]&127](b,h,e,g,c[f>>2]|0)|0)>>>0<2)break;if(!((vZ(a)|0)<<24>>24)){d=0;break a}}d=c[a+16>>2]|0;}while(0);l=i;return d|0}function uZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;i=f<<24>>24==0;n=b+12|0;m=c[n>>2]|0;a:do if(!(i&(g|0)==0)){j=b+20|0;f=0;while(1){if((f|0)>=(m|0))break;if((c[(c[j>>2]|0)+(f*12|0)>>2]|0)==(d|0)){f=1;break a}else f=f+1|0;}if((!i?(k=b+8|0,(c[k>>2]|0)==0):0)?(a[d+9>>0]|0)==0:0){c[k>>2]=d;l=9;}else l=9;}else l=9;while(0);b:do if((l|0)==9){j=b+16|0;do if((m|0)==(c[j>>2]|0))if(!m){c[j>>2]=8;f=kb[c[h+12>>2]&63](96)|0;c[b+20>>2]=f;if(f|0)break;c[j>>2]=0;f=0;break b}else {i=b+20|0;f=lb[c[h+16>>2]&127](c[i>>2]|0,m*24|0)|0;if(!f){f=0;break b}c[j>>2]=m<<1;c[i>>2]=f;break}else f=c[b+20>>2]|0;while(0);h=c[n>>2]|0;c[f+(h*12|0)>>2]=d;c[f+(h*12|0)+8>>2]=g;a[f+(h*12|0)+4>>0]=e;if(!(e<<24>>24))a[d+8>>0]=1;c[n>>2]=(c[n>>2]|0)+1;f=1;}while(0);return f|0}function vZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;b=a+4|0;e=c[b>>2]|0;do if(e){f=a+16|0;g=c[f>>2]|0;if(!g){c[a>>2]=e;c[b>>2]=c[e>>2];c[e>>2]=0;l=c[a>>2]|0;b=l+8|0;c[f>>2]=b;c[a+8>>2]=(c[l+4>>2]|0)+(l+8);c[a+12>>2]=b;b=1;break}d=a+8|0;if(((c[d>>2]|0)-g|0)<(c[e+4>>2]|0)){k=c[e>>2]|0;c[e>>2]=c[a>>2];l=c[b>>2]|0;c[a>>2]=l;c[b>>2]=k;b=c[f>>2]|0;W6(l+8|0,b|0,(c[d>>2]|0)-b|0)|0;b=c[a>>2]|0;l=a+12|0;c[l>>2]=(c[l>>2]|0)-(c[f>>2]|0)+(b+8);c[f>>2]=b+8;c[d>>2]=(c[b+4>>2]|0)+(b+8);b=1;}else h=6;}else h=6;while(0);a:do if((h|0)==6){e=c[a>>2]|0;k=a+16|0;do if(!e){i=k;b=c[k>>2]|0;}else {j=c[k>>2]|0;b=j;if((j|0)!=(e+8|0)){i=k;break}f=a+8|0;g=(c[f>>2]|0)-b<<1;h=a+12|0;d=(c[h>>2]|0)-b|0;if((g|0)<0){b=0;break a}b=b_(g)|0;if(!b){b=0;break a}b=lb[c[(c[a+20>>2]|0)+4>>2]&127](e,b)|0;if(!b){b=0;break a}c[a>>2]=b;c[b+4>>2]=g;b=c[a>>2]|0;c[h>>2]=b+8+d;c[k>>2]=b+8;c[f>>2]=b+8+g;b=1;break a}while(0);j=a+8|0;b=(c[j>>2]|0)-b|0;if((b|0)>=0){if((b|0)>=1024){b=b<<1;if((b|0)<0){b=0;break}}else b=1024;d=b_(b)|0;if((d|0)!=0?(l=kb[c[c[a+20>>2]>>2]&63](d)|0,(l|0)!=0):0){c[l+4>>2]=b;c[l>>2]=c[a>>2];c[a>>2]=l;h=a+12|0;a=c[h>>2]|0;e=c[k>>2]|0;d=a;f=e;if((a|0)==(e|0)){g=l+8|0;e=f;}else {g=l+8|0;W6(g|0,e|0,d-f|0)|0;e=c[i>>2]|0;d=c[h>>2]|0;}c[h>>2]=l+8+(d-e);c[k>>2]=g;c[j>>2]=l+8+b;b=1;}else b=0;}else b=0;}while(0);return b|0}function wZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;b=a_(b,d,e,f,g,h)|0;do if(!b){d=h+12|0;b=c[d>>2]|0;if((e<<24>>24==0?(c[h+16>>2]|0)!=(b|0):0)?(i=b+-1|0,(a[i>>0]|0)==32):0){c[d>>2]=i;b=i;}if((b|0)==(c[h+8>>2]|0)){if(!((vZ(h)|0)<<24>>24)){b=1;break}b=c[d>>2]|0;}c[d>>2]=b+1;a[b>>0]=0;b=0;}while(0);return b|0}function xZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+16|0;B=H;C=H+4|0;g=c[b+352>>2]|0;D=g+104|0;F=b+272|0;E=c[F>>2]|0;c[F>>2]=1;if((c[D>>2]|0)==0?(vZ(D)|0)<<24>>24==0:0)g=1;else {n=d+20|0;o=b+484|0;p=b+144|0;q=b+412|0;r=d+64|0;s=g+132|0;t=b+428|0;u=b+424|0;v=b+224|0;w=b+112|0;m=g+130|0;x=g+128|0;y=g+131|0;z=b+116|0;A=g+112|0;j=g+116|0;k=d+40|0;a:while(1){b:do switch(ob[c[n>>2]&127](d,e,f,B)|0){case -4:{g=0;break a}case -1:{G=37;break a}case 0:{G=39;break a}case 28:{if((a[o>>0]|0)==0?(c[p>>2]|0)==(d|0):0){G=19;break a}g=c[r>>2]|0;g=lZ(q,d,e+g|0,(c[B>>2]|0)+(0-g)|0)|0;if(!g){g=1;break a}h=nZ(b,s,g,0)|0;c[u>>2]=c[t>>2];if(!h){G=9;break a}i=h+32|0;if(a[i>>0]|0){G=11;break a}g=h+16|0;if(!(c[g>>2]|0)){a[i>>0]=1;g=c[h+4>>2]|0;g=xZ(b,c[v>>2]|0,g,g+(c[h+8>>2]|0)|0)|0;a[i>>0]=0;if(!g)break b;else break a}if(c[w>>2]|0){a[y>>0]=0;a[i>>0]=1;h=(pb[c[w>>2]&127](c[z>>2]|0,0,c[h+20>>2]|0,c[g>>2]|0,c[h+24>>2]|0)|0)==0;a[i>>0]=0;if(h){g=21;break a}if(a[y>>0]|0)break b}a[x>>0]=a[m>>0]|0;break}case 6:case 9:{if(!(tZ(D,d,e,c[B>>2]|0)|0)){g=1;break a}break}case -3:{c[B>>2]=e+(c[r>>2]|0);G=22;break}case 7:{G=22;break}case 10:{g=lb[c[k>>2]&127](d,e)|0;if((g|0)<0){G=27;break a}h=x_(g,C)|0;e=0;while(1){if((e|0)>=(h|0))break;g=c[j>>2]|0;if((c[A>>2]|0)==(g|0)){if(!((vZ(D)|0)<<24>>24)){g=1;G=35;break a}g=c[j>>2]|0;}i=a[C+e>>0]|0;c[j>>2]=g+1;a[g>>0]=i;e=e+1|0;}break}default:{G=41;break a}}while(0);if((G|0)==22){G=0;g=c[j>>2]|0;if((c[A>>2]|0)==(g|0)){if(!((vZ(D)|0)<<24>>24)){g=1;break}g=c[j>>2]|0;}c[j>>2]=g+1;a[g>>0]=10;}e=c[B>>2]|0;}if((G|0)==9){a[x>>0]=a[m>>0]|0;g=0;}else if((G|0)==11)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=12;}else g=12;else if((G|0)==19){c[b+284>>2]=e;g=10;}else if((G|0)==27)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=14;G=35;}else {g=14;G=35;}else if((G|0)==37)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=4;}else g=4;else if((G|0)==39)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=c[B>>2];g=4;}else g=4;else if((G|0)==41)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=23;}else g=23;c[F>>2]=E;}l=H;return g|0}function yZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+16|0;n=p;o=p+4|0;c[n>>2]=e;if(!(a[d+68>>0]|0)){if((c[b+144>>2]|0)==(d|0)){g=b+288|0;h=b+284|0;}else {h=c[b+296>>2]|0;g=h+4|0;}i=b+44|0;j=d+56|0;k=b+48|0;m=b+80|0;e=b+4|0;do{c[o>>2]=c[i>>2];b=pb[c[j>>2]&127](d,n,f,o,c[k>>2]|0)|0;c[g>>2]=c[n>>2];q=c[i>>2]|0;vb[c[m>>2]&127](c[e>>2]|0,q,(c[o>>2]|0)-q|0);c[h>>2]=c[n>>2];}while(b>>>0>1)}else vb[c[b+80>>2]&127](c[b+4>>2]|0,e,f-e|0);l=p;return}function zZ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;j=m;k=c[d>>2]|0;if((c[a+144>>2]|0)==(b|0)){i=a+284|0;c[i>>2]=k;h=a+288|0;}else {i=c[a+296>>2]|0;h=i+4|0;}c[i>>2]=k;c[d>>2]=0;n=ob[c[b+12>>2]&127](b,k,e,j)|0;e=c[j>>2]|0;c[h>>2]=e;switch(n|0){case 42:{if(c[a+80>>2]|0){yZ(a,b,k,e);e=c[j>>2]|0;}c[d>>2]=e;c[f>>2]=e;e=(c[a+476>>2]|0)==2?35:0;break}case 0:{c[i>>2]=e;e=4;break}case -2:{if(!(g<<24>>24))e=6;else {c[f>>2]=k;e=0;}break}case -4:case -1:{if(!(g<<24>>24))e=2;else {c[f>>2]=k;e=0;}break}default:{c[i>>2]=e;e=23;}}l=m;return e|0}function AZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;c[g>>2]=d;d=zZ(b,c[b+144>>2]|0,g,e,f,(a[b+480>>0]|0)==0&1)|0;g=c[g>>2]|0;if(!((d|0)!=0|(g|0)==0)){c[b+276>>2]=57;d=iZ(b,g,e,f)|0;}l=h;return d|0}function BZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=c[a+352>>2]|0;j=i+184|0;if(!(c[j>>2]|0)){b=kb[c[a+12>>2]&63](c[a+464>>2]<<2)|0;c[j>>2]=b;if(!b)b=-1;else {c[b>>2]=0;d=4;}}else d=4;do if((d|0)==4){h=i+176|0;b=c[h>>2]|0;g=i+172|0;d=c[g>>2]|0;f=i+164|0;e=c[f>>2]|0;if(b>>>0>>0)g=e;else {if(!e){b=kb[c[a+12>>2]&63](896)|0;if(!b){b=-1;break}else {d=b;b=32;}}else {b=lb[c[a+16>>2]&127](e,d*56|0)|0;if(!b){b=-1;break}d=b;b=c[g>>2]<<1;}c[g>>2]=b;c[f>>2]=d;b=c[h>>2]|0;g=d;}c[h>>2]=b+1;d=c[i+180>>2]|0;if(d|0){a=c[(c[j>>2]|0)+(d+-1<<2)>>2]|0;f=g+(a*28|0)+16|0;d=c[f>>2]|0;if(d|0)c[g+(d*28|0)+24>>2]=b;d=g+(a*28|0)+20|0;e=c[d>>2]|0;if(!e)c[g+(a*28|0)+12>>2]=b;c[f>>2]=b;c[d>>2]=e+1;}j=g+(b*28|0)+12|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;}while(0);return b|0}function CZ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;o=b+300|0;f=c[o>>2]|0;if(!f){f=kb[c[b+12>>2]&63](24)|0;if(!f)f=1;else {m=f;g=4;}}else {c[o>>2]=c[f+8>>2];m=f;g=4;}do if((g|0)==4){h=d+32|0;a[h>>0]=1;i=d+12|0;c[i>>2]=0;j=b+296|0;k=m+8|0;c[k>>2]=c[j>>2];c[j>>2]=m;c[m+12>>2]=d;f=b+308|0;c[m+16>>2]=c[f>>2];a[m+20>>0]=e;c[m>>2]=0;c[m+4>>2]=0;g=c[d+4>>2]|0;e=g+(c[d+8>>2]|0)|0;c[n>>2]=g;if(!(a[d+33>>0]|0))f=IZ(b,c[f>>2]|0,c[b+224>>2]|0,g,e,n,0)|0;else {d=b+224|0;f=c[d>>2]|0;f=ob[c[f>>2]&127](f,g,e,n)|0;f=jZ(b,c[d>>2]|0,g,e,f,c[n>>2]|0,n,0)|0;}if(!f){f=c[n>>2]|0;if((e|0)!=(f|0)?(c[b+476>>2]|0)==3:0){c[i>>2]=f-g;c[b+276>>2]=60;f=0;break}a[h>>0]=0;c[j>>2]=c[k>>2];c[k>>2]=c[o>>2];c[o>>2]=m;f=0;}}while(0);l=p;return f|0}function DZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+16|0;d=g+4|0;e=g;b=c[a+352>>2]|0;f=b+176|0;b=kb[c[a+12>>2]&63](((c[f>>2]|0)*20|0)+(c[b+168>>2]|0)|0)|0;if(!b)b=0;else {c[e>>2]=b+((c[f>>2]|0)*20|0);c[d>>2]=b+20;HZ(a,0,b,d,e);}l=g;return b|0}function EZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=a+64|0;if(!(c[j>>2]|0))if(!(c[a+80>>2]|0))d=1;else {yZ(a,b,d,e);d=1;}else {h=b+64|0;g=d+(c[h>>2]<<1)|0;d=g+(lb[c[b+28>>2]&127](b,g)|0)|0;f=a+412|0;g=lZ(f,b,g,d)|0;if((g|0)!=0?(c[a+428>>2]=c[a+424>>2],i=lb[c[b+32>>2]&127](b,d)|0,i=lZ(f,b,i,e+(0-(c[h>>2]<<1))|0)|0,(i|0)!=0):0){GZ(i);vb[c[j>>2]&127](c[a+4>>2]|0,g,i);mZ(f);d=1;}else d=0;}return d|0}function FZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=a+68|0;if(!(c[g>>2]|0))if(!(c[a+80>>2]|0))b=1;else {yZ(a,b,d,e);b=1;}else {f=a+412|0;h=c[b+64>>2]|0;b=lZ(f,b,d+(h<<2)|0,e+(O(h,-3)|0)|0)|0;if(!b)b=0;else {GZ(b);ub[c[g>>2]&63](c[a+4>>2]|0,b);mZ(f);b=1;}}return b|0}function GZ(b){b=b|0;var c=0,d=0,e=0;a:while(1){switch(a[b>>0]|0){case 0:break a;case 13:{d=b;c=13;e=4;break a}default:{}}b=b+1|0;}if((e|0)==4){while(1){if(c<<24>>24==13){a[d>>0]=10;e=b+1|0;b=(a[e>>0]|0)==10?b+2|0:e;}else {a[d>>0]=c;b=b+1|0;}d=d+1|0;c=a[b>>0]|0;if(!(c<<24>>24))break;else e=4;}a[d>>0]=0;}return}function HZ(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=(c[b+352>>2]|0)+164|0;j=c[(c[k>>2]|0)+(d*28|0)>>2]|0;c[e>>2]=j;c[e+4>>2]=c[(c[k>>2]|0)+(d*28|0)+4>>2];if((j|0)==4){c[e+8>>2]=c[g>>2];d=c[(c[k>>2]|0)+(d*28|0)+8>>2]|0;while(1){j=a[d>>0]|0;k=c[g>>2]|0;c[g>>2]=k+1;a[k>>0]=j;if(!(a[d>>0]|0))break;else d=d+1|0;}c[e+12>>2]=0;c[e+16>>2]=0;}else {h=c[(c[k>>2]|0)+(d*28|0)+20>>2]|0;i=e+12|0;c[i>>2]=h;j=e+16|0;c[j>>2]=c[f>>2];c[f>>2]=(c[f>>2]|0)+(h*20|0);d=(c[k>>2]|0)+(d*28|0)+12|0;h=0;while(1){d=c[d>>2]|0;if(h>>>0>=(c[i>>2]|0)>>>0)break;HZ(b,d,(c[j>>2]|0)+(h*20|0)|0,f,g);d=(c[k>>2]|0)+(d*28|0)+24|0;h=h+1|0;}c[e+8>>2]=0;}return}function IZ(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0;ma=l;l=l+48|0;ja=ma+28|0;ea=ma+32|0;ka=ma+24|0;Z=ma;c[ja>>2]=f;_=c[b+352>>2]|0;if((c[b+144>>2]|0)==(e|0)){fa=b+284|0;Y=b+288|0;}else {Y=c[b+296>>2]|0;fa=Y;Y=Y+4|0;}c[fa>>2]=f;t=e+4|0;ga=b+80|0;u=b+476|0;v=e+44|0;w=e+64|0;x=_+80|0;y=_+96|0;z=_+92|0;A=_+129|0;B=b+112|0;C=b+116|0;D=b+428|0;E=b+424|0;F=b+304|0;G=b+120|0;ha=b+4|0;H=_+130|0;$=b+60|0;I=b+364|0;J=b+12|0;K=b+360|0;L=e+28|0;ia=b+308|0;aa=e+56|0;M=b+16|0;N=b+52|0;O=b+412|0;P=b+388|0;Q=b+56|0;R=b+232|0;S=b+233|0;T=b+468|0;U=b+104|0;V=b+372|0;W=e+40|0;X=b+72|0;ba=e+68|0;ca=b+44|0;da=b+48|0;a:while(1){s=c[ja>>2]|0;c[ea>>2]=s;s=ob[c[t>>2]&127](e,s,g,ea)|0;f=c[ea>>2]|0;c[Y>>2]=f;k=f;b:do switch(s|0){case -3:{la=6;break a}case -4:{la=15;break a}case 0:{la=20;break a}case -1:{la=21;break a}case -2:{la=23;break a}case 12:{f=17;break a}case -5:{la=134;break a}case 9:{s=c[w>>2]|0;s=(nb[c[v>>2]&63](e,(c[ja>>2]|0)+s|0,k+(0-s)|0)|0)&255;a[ka>>0]=s;do if(s<<24>>24){f=c[$>>2]|0;if(f|0){vb[f&127](c[ha>>2]|0,ka,1);break}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {j=c[w>>2]|0;j=lZ(x,e,(c[ja>>2]|0)+j|0,(c[ea>>2]|0)+(0-j)|0)|0;if(!j){f=1;la=56;break a}k=nZ(b,_,j,0)|0;c[z>>2]=c[y>>2];if((a[A>>0]|0)!=0?(a[H>>0]|0)==0:0){if(!k){f=c[G>>2]|0;if(f|0){vb[f&127](c[ha>>2]|0,j,0);break}if(!(c[ga>>2]|0))break;yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}}else {if(!k){f=11;la=56;break a}if(!(a[k+34>>0]|0)){f=24;la=56;break a}}f=k+32|0;if(a[f>>0]|0){f=12;la=56;break a}if(c[k+28>>2]|0){f=15;la=56;break a}if(!(c[k+4>>2]|0)){if(!(c[B>>2]|0)){if(!(c[ga>>2]|0))break;yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}a[f>>0]=1;j=KZ(b)|0;a[f>>0]=0;if(!j){f=1;la=56;break a}if(!(pb[c[B>>2]&127](c[C>>2]|0,j,c[k+20>>2]|0,c[k+16>>2]|0,c[k+24>>2]|0)|0)){f=21;la=56;break a}c[E>>2]=c[D>>2];break}if(a[F>>0]|0){f=CZ(b,k,0)|0;if(!f)break;else {la=58;break a}}f=c[G>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else vb[f&127](c[ha>>2]|0,c[k>>2]|0,0);break b}while(0);break}case 1:case 2:{f=c[I>>2]|0;if(!f){f=kb[c[J>>2]&63](48)|0;if(!f){f=1;la=75;break a}j=kb[c[J>>2]&63](32)|0;c[f+36>>2]=j;if(!j){la=63;break a}c[f+40>>2]=j+32;}else c[I>>2]=c[f>>2];o=f+44|0;c[o>>2]=0;c[f>>2]=c[K>>2];c[K>>2]=f;s=f+12|0;c[f+16>>2]=0;c[f+20>>2]=0;r=(c[ja>>2]|0)+(c[w>>2]|0)|0;q=f+4|0;c[q>>2]=r;p=f+8|0;c[p>>2]=lb[c[L>>2]&127](e,r)|0;c[ia>>2]=(c[ia>>2]|0)+1;q=c[q>>2]|0;p=q+(c[p>>2]|0)|0;c[Z>>2]=q;q=f+36|0;c[ka>>2]=c[q>>2];r=f+40|0;j=c[r>>2]|0;while(1){na=pb[c[aa>>2]&127](e,Z,p,ka,j+-1|0)|0;j=c[ka>>2]|0;m=c[q>>2]|0;k=m;n=j-k|0;if((na|0)==1?1:(c[Z>>2]|0)>>>0>=p>>>0)break;k=(c[r>>2]|0)-k<<1;j=lb[c[M>>2]&127](m,k)|0;if(!j){la=69;break a}c[q>>2]=j;na=j+k|0;c[r>>2]=na;c[ka>>2]=j+n;j=na;}c[f+24>>2]=n;c[s>>2]=k;a[j>>0]=0;f=LZ(b,e,c[ja>>2]|0,s,o)|0;if(f|0){la=75;break a}f=c[N>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else vb[f&127](c[ha>>2]|0,c[s>>2]|0,c[P>>2]|0);mZ(O);break}case 3:case 4:{na=(c[ja>>2]|0)+(c[w>>2]|0)|0;c[ka>>2]=0;na=lZ(O,e,na,na+(lb[c[L>>2]&127](e,na)|0)|0)|0;c[Z>>2]=na;if(!na){f=1;la=89;break a}c[D>>2]=c[E>>2];f=LZ(b,e,c[ja>>2]|0,Z,ka)|0;if(f|0){la=79;break a}c[D>>2]=c[E>>2];f=c[N>>2]|0;if(!f)j=1;else {vb[f&127](c[ha>>2]|0,c[Z>>2]|0,c[P>>2]|0);j=0;}f=c[Q>>2]|0;if(!f){if(j|0?c[ga>>2]|0:0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {if(c[N>>2]|0){c[fa>>2]=c[Y>>2];f=c[Q>>2]|0;}ub[f&63](c[ha>>2]|0,c[Z>>2]|0);}mZ(O);MZ(b,c[ka>>2]|0);if((c[ia>>2]|0)==0?(c[u>>2]&-2|0)!=2:0){la=92;break a}break}case 5:{if((c[ia>>2]|0)==(d|0)){f=13;break a}n=c[K>>2]|0;c[K>>2]=c[n>>2];c[n>>2]=c[I>>2];c[I>>2]=n;f=(c[ja>>2]|0)+(c[w>>2]<<1)|0;j=lb[c[L>>2]&127](e,f)|0;if((j|0)!=(c[n+8>>2]|0)){la=96;break a}if($3(c[n+4>>2]|0,f,j)|0){la=96;break a}c[ia>>2]=(c[ia>>2]|0)+-1;f=c[Q>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {j=c[n+16>>2]|0;m=n+12|0;if((j|0)!=0&(a[R>>0]|0)!=0){f=(c[m>>2]|0)+(c[n+28>>2]|0)|0;while(1){k=a[j>>0]|0;if(!(k<<24>>24))break;a[f>>0]=k;f=f+1|0;j=j+1|0;}j=c[n+20>>2]|0;c:do if((j|0)!=0&(a[S>>0]|0)!=0){a[f>>0]=a[T>>0]|0;while(1){f=f+1|0;k=a[j>>0]|0;if(!(k<<24>>24))break c;a[f>>0]=k;j=j+1|0;}}while(0);a[f>>0]=0;f=c[Q>>2]|0;}ub[f&63](c[ha>>2]|0,c[m>>2]|0);}k=n+44|0;while(1){m=c[k>>2]|0;if(!m)break;f=c[U>>2]|0;if(!f){f=m;j=m;}else {ub[f&63](c[ha>>2]|0,c[c[m>>2]>>2]|0);f=m;j=c[k>>2]|0;}c[k>>2]=c[j+4>>2];c[m+4>>2]=c[V>>2];c[V>>2]=m;c[(c[f>>2]|0)+4>>2]=c[m+8>>2];}if(!(c[ia>>2]|0)){la=117;break a}break}case 10:{f=lb[c[W>>2]&127](e,c[ja>>2]|0)|0;if((f|0)<0){f=14;break a}j=c[$>>2]|0;if(j|0){s=c[ha>>2]|0;na=x_(f,ka)|0;vb[j&127](s,ka,na);break b}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}case 7:{f=c[$>>2]|0;if(f|0){a[ka>>0]=10;vb[f&127](c[ha>>2]|0,ka,1);break b}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);break}case 8:{f=c[X>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);}else tb[f&127](c[ha>>2]|0);f=OZ(b,e,ea,g,h,i)|0;if(f|0)break a;if(!(c[ea>>2]|0)){la=133;break a}break}case 6:{j=c[$>>2]|0;if(!j){if(!(c[ga>>2]|0))break b;yZ(b,e,c[ja>>2]|0,k);break b}if(!(a[ba>>0]|0))f=k;else {na=c[ja>>2]|0;vb[j&127](c[ha>>2]|0,na,f-na|0);break b}while(1){c[ka>>2]=c[ca>>2];na=pb[c[aa>>2]&127](e,ja,f,ka,c[da>>2]|0)|0;c[Y>>2]=c[ja>>2];s=c[ca>>2]|0;vb[j&127](c[ha>>2]|0,s,(c[ka>>2]|0)-s|0);if(na>>>0<2)break;c[fa>>2]=c[ja>>2];f=c[ea>>2]|0;}break}case 11:{if(!(EZ(b,e,c[ja>>2]|0,k)|0)){f=1;break a}break}case 13:{if(!(FZ(b,e,c[ja>>2]|0,k)|0)){f=1;break a}break}default:if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);}while(0);na=c[ea>>2]|0;c[ja>>2]=na;c[fa>>2]=na;switch(c[u>>2]|0){case 2:{f=35;break a}case 3:{la=160;break a}default:{}}}switch(la|0){case 6:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}c[Y>>2]=g;f=c[$>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,g);}else {a[ka>>0]=10;vb[f&127](c[ha>>2]|0,ka,1);}if(d)if((c[ia>>2]|0)==(d|0)){c[h>>2]=g;f=0;}else f=13;else f=3;break}case 15:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}if((d|0)>0)if((c[ia>>2]|0)==(d|0)){c[h>>2]=c[ja>>2];f=0;}else f=13;else f=3;break}case 20:{c[fa>>2]=f;f=4;break}case 21:{if(!(i<<24>>24))f=5;else {c[h>>2]=c[ja>>2];f=0;}break}case 23:{if(!(i<<24>>24))f=6;else {c[h>>2]=c[ja>>2];f=0;}break}case 56:break;case 58:break;case 63:{tb[c[b+20>>2]&127](f);f=1;la=75;break}case 69:{f=1;la=75;break}case 79:{MZ(b,c[ka>>2]|0);la=89;break}case 92:{f=NZ(b,c[ea>>2]|0,g,h)|0;break}case 96:{c[fa>>2]=f;f=7;break}case 117:{f=NZ(b,c[ea>>2]|0,g,h)|0;break}case 133:{c[b+276>>2]=61;f=0;break}case 134:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}f=c[$>>2]|0;do if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,g);}else if(!(a[ba>>0]|0)){c[ka>>2]=c[ca>>2];pb[c[aa>>2]&127](e,ja,g,ka,c[da>>2]|0)|0;na=c[ca>>2]|0;vb[c[$>>2]&127](c[ha>>2]|0,na,(c[ka>>2]|0)-na|0);break}else {na=c[ja>>2]|0;vb[f&127](c[ha>>2]|0,na,g-na|0);break}while(0);if(!d){c[fa>>2]=g;f=3;break}if((c[ia>>2]|0)==(d|0)){c[h>>2]=g;f=0;break}else {c[fa>>2]=g;f=13;break}}case 160:{c[h>>2]=c[ea>>2];f=0;break}}l=ma;return f|0}function JZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+16|0;p=q;k=b+296|0;m=c[k>>2]|0;do if(m){n=c[m+12>>2]|0;h=n+4|0;j=c[h>>2]|0;i=n+12|0;g=j+(c[i>>2]|0)|0;j=j+(c[n+8>>2]|0)|0;c[p>>2]=g;o=n+33|0;if(!(a[o>>0]|0))g=IZ(b,c[m+16>>2]|0,c[b+224>>2]|0,g,j,p,0)|0;else {s=b+224|0;r=c[s>>2]|0;r=ob[c[r>>2]&127](r,g,j,p)|0;g=jZ(b,c[s>>2]|0,g,j,r,c[p>>2]|0,p,0)|0;}if(!g){g=c[p>>2]|0;if((j|0)!=(g|0)?(c[b+476>>2]|0)==3:0){c[i>>2]=g-(c[h>>2]|0);g=0;break}a[n+32>>0]=0;s=m+8|0;c[k>>2]=c[s>>2];g=b+300|0;c[s>>2]=c[g>>2];c[g>>2]=m;g=b+276|0;if(!(a[o>>0]|0)){c[g>>2]=58;g=IZ(b,(c[b+472>>2]|0)!=0&1,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;break}else {c[g>>2]=57;s=b+144|0;g=c[s>>2]|0;g=ob[c[g>>2]&127](g,d,e,p)|0;g=jZ(b,c[s>>2]|0,d,e,g,c[p>>2]|0,f,(a[b+480>>0]|0)==0&1)|0;break}}}else g=23;while(0);l=q;return g|0}function KZ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;n=q;m=c[b+352>>2]|0;h=m+156|0;o=b+412|0;p=b+424|0;a:do if(!(c[h>>2]|0)){d=0;i=b+420|0;k=b+468|0;j=12;}else {d=c[p>>2]|0;i=b+420|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=61;g=b+468|0;e=(c[(c[h>>2]|0)+20>>2]|0)+(((a[g>>0]|0)!=0)<<31>>31)|0;f=0;while(1){if((f|0)>=(e|0)){d=1;k=g;j=12;break a}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break a}d=c[p>>2]|0;}k=a[(c[(c[h>>2]|0)+16>>2]|0)+f>>0]|0;c[p>>2]=d+1;a[d>>0]=k;f=f+1|0;}}while(0);b:do if((j|0)==12){cZ(n,m+60|0);c:while(1){do{e=dZ(n)|0;if(!e)break c;h=e+4|0;}while(!(c[h>>2]|0));if(d<<24>>24){d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=12;}g=c[e>>2]|0;while(1){e=a[g>>0]|0;d=c[p>>2]|0;f=(d|0)==(c[i>>2]|0);if(!(e<<24>>24))break;if(f){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;e=a[g>>0]|0;}c[p>>2]=d+1;a[d>>0]=e;g=g+1|0;}if(f){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=61;f=(c[(c[h>>2]|0)+20>>2]|0)+(((a[k>>0]|0)!=0)<<31>>31)|0;e=0;while(1){if((e|0)>=(f|0)){d=1;continue c}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}j=a[(c[(c[h>>2]|0)+16>>2]|0)+e>>0]|0;c[p>>2]=d+1;a[d>>0]=j;e=e+1|0;}}cZ(n,m);d:while(1){do{e=dZ(n)|0;if(!e)break d}while(!(a[e+32>>0]|0));if(d<<24>>24){d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=12;}f=c[e>>2]|0;while(1){e=a[f>>0]|0;if(!(e<<24>>24)){d=1;continue d}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;e=a[f>>0]|0;}c[p>>2]=d+1;a[d>>0]=e;f=f+1|0;}}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=0;d=c[b+428>>2]|0;}while(0);l=q;return d|0}function LZ(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;O=l;l=l+80|0;K=O+16|0;L=O;M=c[b+352>>2]|0;k=M+20|0;i=nZ(b,k,c[g>>2]|0,0)|0;if(!i){i=SZ(M+80|0,c[g>>2]|0)|0;if((i|0)!=0?(j=nZ(b,k,i,24)|0,(j|0)!=0):0)if((a[b+232>>0]|0)!=0?(TZ(b,j)|0)==0:0)i=1;else A=6;else i=1;}else {j=i;A=6;}a:do if((A|0)==6){x=c[j+12>>2]|0;k=e+36|0;m=b+376|0;t=b+388|0;u=ob[c[k>>2]&127](e,f,c[m>>2]|0,c[t>>2]|0)|0;i=u+x|0;n=c[m>>2]|0;if((i|0)>(n|0)){i=i+16|0;c[m>>2]=i;i=lb[c[b+16>>2]&127](c[t>>2]|0,i<<4)|0;if(!i){c[m>>2]=n;i=1;break}c[t>>2]=i;if((u|0)>(n|0))ob[c[k>>2]&127](e,f,u,i)|0;}J=c[t>>2]|0;r=e+28|0;H=b+412|0;I=b+428|0;w=j+20|0;q=b+424|0;s=0;p=0;k=0;while(1){if((p|0)>=(u|0))break;o=c[(c[t>>2]|0)+(p<<4)>>2]|0;o=rZ(b,e,o,o+(lb[c[r>>2]&127](e,o)|0)|0)|0;if(!o){i=1;break a}i=(c[o>>2]|0)+-1|0;if(a[i>>0]|0){A=15;break}a[i>>0]=1;f=s+1|0;c[J+(s<<2)>>2]=c[o>>2];n=c[t>>2]|0;if(a[n+(p<<4)+12>>0]|0){G=lZ(H,e,c[n+(p<<4)+4>>2]|0,c[n+(p<<4)+8>>2]|0)|0;c[J+(f<<2)>>2]=G;if(!G){i=1;break a}}else {b:do if(!(a[o+8>>0]|0))i=1;else {i=0;while(1){if((i|0)>=(x|0)){i=1;break b}m=c[w>>2]|0;if((o|0)==(c[m+(i*12|0)>>2]|0))break;i=i+1|0;}i=a[m+(i*12|0)+4>>0]|0;}while(0);i=wZ(b,e,i,c[n+(p<<4)+4>>2]|0,c[n+(p<<4)+8>>2]|0,H)|0;if(i|0)break a;c[J+(f<<2)>>2]=c[I>>2];}c[I>>2]=c[q>>2];i=c[o+4>>2]|0;do if(i)if(a[o+9>>0]|0){i=UZ(b,i,o,c[J+(f<<2)>>2]|0,h)|0;if(!i){i=s;break}else break a}else {a[(c[o>>2]|0)+-1>>0]=2;k=k+1|0;i=s+2|0;break}else i=s+2|0;while(0);s=i;p=p+1|0;}if((A|0)==15){if((c[b+144>>2]|0)!=(e|0)){i=8;break}c[b+284>>2]=c[(c[t>>2]|0)+(p<<4)>>2];i=8;break}c[b+380>>2]=s;i=c[j+8>>2]|0;c:do if((i|0)!=0?(v=c[i>>2]|0,(a[v+-1>>0]|0)!=0):0){i=0;while(1){if((i|0)>=(s|0)){f=0;p=k;G=s;break c}if((c[J+(i<<2)>>2]|0)==(v|0)){A=37;break c}i=i+2|0;}}else {i=-1;A=37;}while(0);if((A|0)==37){c[b+384>>2]=i;f=0;p=k;G=s;}while(1){if((f|0)>=(x|0))break;i=c[w>>2]|0;n=i+(f*12|0)|0;k=c[n>>2]|0;m=(c[k>>2]|0)+-1|0;d:do if((a[m>>0]|0)==0?(y=i+(f*12|0)+8|0,z=c[y>>2]|0,(z|0)!=0):0){i=c[k+4>>2]|0;do if(i)if(a[k+9>>0]|0){i=UZ(b,i,k,z,h)|0;if(!i){i=p;k=G;break d}else break a}else {a[m>>0]=2;i=p+1|0;break}else {a[m>>0]=1;i=p;}while(0);c[J+(G<<2)>>2]=c[c[n>>2]>>2];c[J+(G+1<<2)>>2]=c[y>>2];k=G+2|0;}else {i=p;k=G;}while(0);f=f+1|0;p=i;G=k;}c[J+(G<<2)>>2]=0;e:do if(!p)i=0;else {o=b+396|0;n=c[o>>2]|0;F=b+400|0;f=a[F>>0]|0;i=f&255;do if(!(p<<1>>i)){i=1<>24;}while((p>>(E&255)|0)!=0);i=(i&255)>3?i:3;a[F>>0]=i;i=i&255;m=b+392|0;k=lb[c[b+16>>2]&127](c[m>>2]|0,12<>0]=f;i=1;break a}else {c[m>>2]=k;k=1<>2]|0)+(E*12|0)>>2]=-1;i=E;}}while(0);E=i+-1|0;c[o>>2]=E;w=M+40|0;x=b+424|0;y=b+420|0;z=k+-1|0;A=0-k|0;B=z>>>2;C=b+233|0;D=b+468|0;i=0;v=p;g:while(1){while(1){if((i|0)>=(G|0))break e;e=J+(i<<2)|0;n=c[e>>2]|0;f=n+-1|0;if((a[f>>0]|0)==2)break;a[f>>0]=0;i=i+2|0;}VZ(b,L);WZ(K,L);a[f>>0]=0;f=nZ(b,w,n,0)|0;if(!f){i=1;break}f=c[f+4>>2]|0;if(!f){i=1;break}u=c[f+4>>2]|0;if(!u){i=27;break}q=u+20|0;r=u+16|0;p=0;while(1){f=c[q>>2]|0;o=c[r>>2]|0;if((p|0)>=(f|0))break;o=a[o+p>>0]|0;f=c[x>>2]|0;if((f|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}f=c[x>>2]|0;}c[x>>2]=f+1;a[f>>0]=o;p=p+1|0;}XZ(K,o,f);do{t=n;n=n+1|0;}while((a[t>>0]|0)!=58);XZ(K,n,YZ(n)|0);while(1){f=c[x>>2]|0;if((f|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}f=c[x>>2]|0;}t=a[n>>0]|0;c[x>>2]=f+1;a[f>>0]=t;if(!(a[n>>0]|0))break;else n=n+1|0;}t=ZZ(K)|0;q=c[m>>2]|0;r=t&A;n=0;s=z&t;while(1){if((c[q+(s*12|0)>>2]|0)!=(E|0))break;if((c[q+(s*12|0)+4>>2]|0)==(t|0)){f=c[q+(s*12|0)+8>>2]|0;o=c[I>>2]|0;while(1){P=a[o>>0]|0;p=P<<24>>24==0;if(p|P<<24>>24!=(a[f>>0]|0))break;f=f+1|0;o=o+1|0;}if(p){i=8;break g}}if(!(n<<24>>24))n=(r>>>((d[F>>0]|0)+-1|0)&B|1)&255;P=n&255;s=s+((s|0)<(P|0)?k:0)-P|0;}if(a[C>>0]|0){a[(c[x>>2]|0)+-1>>0]=a[D>>0]|0;f=c[c[u>>2]>>2]|0;while(1){n=c[x>>2]|0;if((n|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}n=c[x>>2]|0;}P=a[f>>0]|0;c[x>>2]=n+1;a[n>>0]=P;if(!(a[f>>0]|0))break;else f=f+1|0;}}P=c[I>>2]|0;c[I>>2]=c[x>>2];c[e>>2]=P;c[(c[m>>2]|0)+(s*12|0)>>2]=E;c[(c[m>>2]|0)+(s*12|0)+4>>2]=t;c[(c[m>>2]|0)+(s*12|0)+8>>2]=P;v=v+-1|0;i=i+2|0;if(!v)break e}break a}while(0);while(1){if((i|0)>=(G|0)){i=h;break}a[(c[J+(i<<2)>>2]|0)+-1>>0]=0;i=i+2|0;}while(1){i=c[i>>2]|0;if(!i)break;a[(c[c[i+12>>2]>>2]|0)+-1>>0]=0;i=i+4|0;}if(!(a[b+232>>0]|0))i=0;else {i=c[j+4>>2]|0;if(!i){i=c[M+156>>2]|0;if(!i){i=0;break}k=c[g>>2]|0;}else {i=c[i+4>>2]|0;if(!i){i=27;break}j=c[g>>2]|0;while(1){k=j+1|0;if((a[j>>0]|0)==58)break;else j=k;}}if((a[b+233>>0]|0)!=0?(N=c[c[i>>2]>>2]|0,(N|0)!=0):0){j=0;while(1){m=j+1|0;if(!(a[N+j>>0]|0))break;else j=m;}}else m=0;c[g+4>>2]=k;p=i+20|0;c[g+16>>2]=c[p>>2];c[g+8>>2]=c[c[i>>2]>>2];c[g+20>>2]=m;q=0;while(1){r=q+1|0;if(!(a[k+q>>0]|0))break;else q=r;}j=c[p>>2]|0;n=r+m+j|0;f=i+24|0;if((n|0)>(c[f>>2]|0)){j=n+24|0;o=kb[c[b+12>>2]&63](j)|0;if(!o){i=1;break}c[f>>2]=j;f=i+16|0;W6(o|0,c[f>>2]|0,c[p>>2]|0)|0;j=b+360|0;while(1){j=c[j>>2]|0;if(!j)break;n=j+12|0;if((c[n>>2]|0)==(c[f>>2]|0))c[n>>2]=o;}tb[c[b+20>>2]&127](c[f>>2]|0);c[f>>2]=o;n=o;j=c[p>>2]|0;}else {n=i+16|0;f=n;n=c[n>>2]|0;}j=n+j|0;W6(j|0,k|0,r|0)|0;if(m|0){P=j+q|0;a[P>>0]=a[b+468>>0]|0;W6(P+1|0,c[c[i>>2]>>2]|0,m|0)|0;}c[g>>2]=c[f>>2];i=0;}}while(0);l=O;return i|0}function MZ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=a+104|0;f=a+372|0;d=a+4|0;while(1){if(!b)break;a=c[e>>2]|0;if(!a)a=b;else {ub[a&63](c[d>>2]|0,c[c[b>>2]>>2]|0);a=b;}h=b+4|0;g=c[h>>2]|0;c[h>>2]=c[f>>2];c[f>>2]=b;c[(c[a>>2]|0)+4>>2]=c[b+8>>2];b=g;}return}function NZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+16|0;j=q;c[b+276>>2]=62;k=b+284|0;c[k>>2]=d;m=b+144|0;n=b+288|0;o=b+80|0;i=b+476|0;g=d;a:while(1){c[j>>2]=0;r=c[m>>2]|0;r=ob[c[r>>2]&127](r,g,e,j)|0;d=c[j>>2]|0;c[n>>2]=d;h=d;switch(r|0){case -15:{p=3;break a}case -4:{p=7;break a}case 0:{p=12;break a}case -1:{p=13;break a}case -2:{p=15;break a}case 15:{if(c[o>>2]|0)yZ(b,c[m>>2]|0,g,h);break}case 11:{if(!(EZ(b,c[m>>2]|0,g,h)|0)){d=1;break a}break}case 13:{if(!(FZ(b,c[m>>2]|0,g,h)|0)){d=1;break a}break}default:{d=9;break a}}d=c[j>>2]|0;c[k>>2]=d;switch(c[i>>2]|0){case 2:{d=35;break a}case 3:{p=18;break a}default:{}}g=d;}do if((p|0)==3){if(c[o>>2]|0){yZ(b,c[m>>2]|0,g,h);if((c[i>>2]|0)==2){d=35;break}d=c[j>>2]|0;}c[f>>2]=d;d=0;}else if((p|0)==7){c[f>>2]=g;d=0;}else if((p|0)==12){c[k>>2]=d;d=4;}else if((p|0)==13)if(!(a[b+480>>0]|0)){c[f>>2]=g;d=0;}else d=5;else if((p|0)==15)if(!(a[b+480>>0]|0)){c[f>>2]=g;d=0;}else d=6;else if((p|0)==18){c[f>>2]=d;d=0;}while(0);l=q;return d|0}function OZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;B=l;l=l+16|0;y=B+8|0;z=B+4|0;x=B;i=c[e>>2]|0;c[y>>2]=i;if((c[b+144>>2]|0)==(d|0)){s=b+284|0;c[s>>2]=i;t=b+288|0;}else {t=c[b+296>>2]|0;s=t;t=t+4|0;}c[s>>2]=i;c[e>>2]=0;k=d+8|0;m=b+60|0;u=b+80|0;v=b+4|0;w=b+476|0;n=d+68|0;o=b+44|0;p=d+56|0;q=b+48|0;a:while(1){j=ob[c[k>>2]&127](d,c[y>>2]|0,f,z)|0;i=c[z>>2]|0;c[t>>2]=i;r=i;b:do switch(j|0){case 40:{A=6;break a}case 0:{A=23;break a}case -2:{A=24;break a}case -4:case -1:{A=26;break a}case 7:{i=c[m>>2]|0;if(i|0){a[x>>0]=10;vb[i&127](c[v>>2]|0,x,1);break b}if(c[u>>2]|0)yZ(b,d,c[y>>2]|0,r);break}case 6:{j=c[m>>2]|0;if(!j){if(!(c[u>>2]|0))break b;yZ(b,d,c[y>>2]|0,r);break b}if(!(a[n>>0]|0))i=r;else {r=c[y>>2]|0;vb[j&127](c[v>>2]|0,r,i-r|0);break b}while(1){c[x>>2]=c[o>>2];r=pb[c[p>>2]&127](d,y,i,x,c[q>>2]|0)|0;c[t>>2]=c[z>>2];i=c[o>>2]|0;vb[j&127](c[v>>2]|0,i,(c[x>>2]|0)-i|0);if(r>>>0<2)break;c[s>>2]=c[y>>2];i=c[z>>2]|0;}break}default:{A=28;break a}}while(0);r=c[z>>2]|0;c[y>>2]=r;c[s>>2]=r;switch(c[w>>2]|0){case 3:{A=30;break a}case 2:{i=35;break a}default:{}}}if((A|0)==6){i=c[b+76>>2]|0;if(!i){if(c[u>>2]|0)yZ(b,d,c[y>>2]|0,r);}else tb[i&127](c[v>>2]|0);i=c[z>>2]|0;c[e>>2]=i;c[g>>2]=i;i=(c[w>>2]|0)==2?35:0;}else if((A|0)==23){c[s>>2]=i;i=4;}else if((A|0)==24)if(!(h<<24>>24))i=6;else {c[g>>2]=c[y>>2];i=0;}else if((A|0)==26)if(!(h<<24>>24))i=20;else {c[g>>2]=c[y>>2];i=0;}else if((A|0)==28){c[s>>2]=i;i=23;}else if((A|0)==30){c[g>>2]=c[z>>2];i=0;}l=B;return i|0}function PZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;c[g>>2]=d;d=OZ(b,c[b+144>>2]|0,g,e,f,(a[b+480>>0]|0)==0&1)|0;g=c[g>>2]|0;do if(!((d|0)!=0|(g|0)==0)){d=b+276|0;if(!(c[b+472>>2]|0)){c[d>>2]=58;d=pZ(b,g,e,f)|0;break}else {c[d>>2]=63;d=QZ(b,g,e,f)|0;break}}while(0);l=h;return d|0}function QZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;d=IZ(b,1,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;if((d|0)==0?(RZ(b)|0)<<24>>24==0:0)d=1;return d|0}function RZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=a+16|0;a=a+360|0;while(1){a=c[a>>2]|0;if(!a){a=1;break}i=(c[a+24>>2]|0)+1|0;j=a+36|0;f=c[j>>2]|0;e=f+i|0;l=a+4|0;d=c[l>>2]|0;if((d|0)==(e|0)){a=1;break}k=a+8|0;b=c[k>>2]|0;g=b+i|0;h=a+40|0;if((g|0)>((c[h>>2]|0)-f|0)){e=lb[c[m>>2]&127](f,g)|0;if(!e){a=0;break}b=a+12|0;f=c[j>>2]|0;if((c[b>>2]|0)==(f|0))c[b>>2]=e;b=a+16|0;d=c[b>>2]|0;if(d|0)c[b>>2]=e+(d-f);c[j>>2]=e;c[h>>2]=e+g;e=e+i|0;d=c[l>>2]|0;b=c[k>>2]|0;}W6(e|0,d|0,b|0)|0;c[l>>2]=e;}return a|0}function SZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=b+12|0;g=b+8|0;while(1){e=c[f>>2]|0;if((e|0)==(c[g>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}e=c[f>>2]|0;}i=a[d>>0]|0;c[f>>2]=e+1;a[e>>0]=i;if(!(a[d>>0]|0)){h=6;break}else d=d+1|0;}if((h|0)==6){i=b+16|0;d=c[i>>2]|0;c[i>>2]=c[f>>2];}return d|0}function TZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=c[b+352>>2]|0;j=n+80|0;k=n+92|0;l=n+88|0;m=n+60|0;n=n+96|0;i=d+4|0;h=c[d>>2]|0;a:while(1){switch(a[h>>0]|0){case 0:{e=1;break a}case 58:{g=c[d>>2]|0;while(1){e=c[k>>2]|0;f=(e|0)==(c[l>>2]|0);if((g|0)==(h|0))break;if(f){if(!((vZ(j)|0)<<24>>24)){e=0;break a}e=c[k>>2]|0;}f=a[g>>0]|0;c[k>>2]=e+1;a[e>>0]=f;g=g+1|0;}if(f){if(!((vZ(j)|0)<<24>>24)){e=0;break a}e=c[k>>2]|0;}c[k>>2]=e+1;a[e>>0]=0;e=nZ(b,m,c[n>>2]|0,8)|0;if(!e){e=0;break a}f=c[n>>2]|0;if((c[e>>2]|0)==(f|0))c[n>>2]=c[k>>2];else c[k>>2]=f;c[i>>2]=e;break}default:{}}h=h+1|0;}return e|0}function UZ(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=a[f>>0]|0;i=c[d>>2]|0;h=(i|0)==0;do if(!(k<<24>>24))if(h){m=0;j=11;}else h=28;else if(((!h?(a[i>>0]|0)==120:0)?(a[i+1>>0]|0)==109:0)?(a[i+2>>0]|0)==108:0){h=a[i+3>>0]|0;if((h<<24>>24==110?(a[i+4>>0]|0)==115:0)?(a[i+5>>0]|0)==0:0){h=39;break}m=h<<24>>24==0&1;j=11;}else {m=0;j=11;}while(0);a:do if((j|0)==11){l=m<<24>>24!=0;h=1;i=1;n=0;while(1){j=i<<24>>24!=0;if(!(k<<24>>24))break;do if(j){if((n|0)<=36?k<<24>>24==(a[142257+n>>0]|0):0)break;i=0;}else i=0;while(0);do if(!(l|h<<24>>24==0)){if((n|0)<=29?k<<24>>24==(a[142294+n>>0]|0):0)break;h=0;}while(0);k=n+1|0;n=k;k=a[f+k>>0]|0;}if((m&255|0)!=(j&(n|0)==36&1|0)){h=l?38:40;break}if(!(h<<24>>24!=0&(n|0)==29)){o=b+468|0;n=n+((a[o>>0]|0)!=0&1)|0;h=b+372|0;j=c[h>>2]|0;do if(!j){h=b+12|0;i=kb[c[h>>2]&63](28)|0;if(!i){h=1;break a}j=n+24|0;m=kb[c[h>>2]&63](j)|0;c[i+16>>2]=m;if(!m){tb[c[b+20>>2]&127](i);h=1;break a}else {c[i+24>>2]=j;j=i;break}}else {i=j+24|0;if((n|0)>(c[i>>2]|0)){k=j+16|0;l=n+24|0;m=lb[c[b+16>>2]&127](c[k>>2]|0,l)|0;if(!m){h=1;break a}c[k>>2]=m;c[i>>2]=l;}c[h>>2]=c[j+4>>2];}while(0);c[j+20>>2]=n;i=j+16|0;W6(c[i>>2]|0,f|0,n|0)|0;h=a[o>>0]|0;if(h<<24>>24)a[(c[i>>2]|0)+(n+-1)>>0]=h;c[j>>2]=d;c[j+12>>2]=e;i=d+4|0;c[j+8>>2]=c[i>>2];if((a[f>>0]|0)==0?((c[b+352>>2]|0)+152|0)==(d|0):0)h=0;else h=j;c[i>>2]=h;c[j+4>>2]=c[g>>2];c[g>>2]=j;if((e|0)!=0?(p=c[b+100>>2]|0,(p|0)!=0):0){vb[p&127](c[b+4>>2]|0,c[d>>2]|0,c[i>>2]|0?f:0);h=0;}else h=0;}else h=40;}while(0);return h|0}function VZ(a,b){a=a|0;b=b|0;var d=0;d=b;c[d>>2]=0;c[d+4>>2]=0;b=b+8|0;c[b>>2]=$Z(a)|0;c[b+4>>2]=0;return}function WZ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=b;g=c[d+4>>2]^1936682341;e=a;c[e>>2]=c[d>>2]^1886610805;c[e+4>>2]=g;e=b+8|0;g=e;d=c[g+4>>2]^1685025377;f=a+8|0;c[f>>2]=c[g>>2]^1852075885;c[f+4>>2]=d;f=b;b=c[f+4>>2]^1819895653;d=a+16|0;c[d>>2]=c[f>>2]^1852142177;c[d+4>>2]=b;d=c[e+4>>2]^1952801890;b=a+24|0;c[b>>2]=c[e>>2]^2037671283;c[b+4>>2]=d;c[a+40>>2]=a+32;b=a+48|0;c[b>>2]=0;c[b+4>>2]=0;return}function XZ(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0;n=e+f|0;o=b+40|0;p=b+40|0;q=b+32|0;r=b+33|0;s=b+34|0;t=b+35|0;h=b+36|0;i=b+37|0;j=b+38|0;k=b+39|0;l=b+24|0;m=b+48|0;f=e;do{while(1){g=c[o>>2]|0;if(f>>>0>=n>>>0){e=0;break}if(g>>>0>=p>>>0){e=1;break}e=a[f>>0]|0;c[o>>2]=g+1;a[g>>0]=e;f=f+1|0;}if(g>>>0

>>0)break;A=d[q>>0]|0;B=R6(d[r>>0]|0|0,0,8)|0;g=z;y=R6(d[s>>0]|0|0,0,16)|0;g=g|z;w=R6(d[t>>0]|0|0,0,24)|0;g=g|z|(d[h>>0]|0);u=R6(d[i>>0]|0|0,0,40)|0;g=g|z;x=R6(d[j>>0]|0|0,0,48)|0;g=g|z;v=R6(d[k>>0]|0|0,0,56)|0;v=B|A|y|w|u|x|v;g=g|z;x=l;u=g^c[x+4>>2];w=l;c[w>>2]=v^c[x>>2];c[w+4>>2]=u;_Z(b,2);w=b;g=c[w+4>>2]^g;u=b;c[u>>2]=c[w>>2]^v;c[u+4>>2]=g;c[o>>2]=q;u=m;u=J6(c[u>>2]|0,c[u+4>>2]|0,8,0)|0;g=m;c[g>>2]=u;c[g+4>>2]=z;}while(e);return}function YZ(b){b=b|0;var c=0;c=0;while(1){if(!(a[b>>0]|0))break;c=c+1|0;b=b+1|0;}return c|0}function ZZ(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0;f=a+32|0;h=(c[a+40>>2]|0)-f|0;e=a+48|0;e=J6(c[e>>2]|0,c[e+4>>2]|0,h|0,0)|0;e=R6(e|0,z|0,56)|0;b=z;switch(h<<24>>24|0){case 7:{e=R6(d[a+38>>0]|0|0,0,48)|0|e;b=z|b;g=3;break}case 6:{g=3;break}case 5:{g=4;break}case 4:{g=5;break}case 3:{g=6;break}case 2:{g=7;break}case 1:{g=8;break}default:{}}if((g|0)==3){h=R6(d[a+37>>0]|0|0,0,40)|0;e=h|e;b=z|b;g=4;}if((g|0)==4){b=d[a+36>>0]|0|b;g=5;}if((g|0)==5){h=R6(d[a+35>>0]|0|0,0,24)|0;e=h|e;b=z|b;g=6;}if((g|0)==6){h=R6(d[a+34>>0]|0|0,0,16)|0;e=h|e;b=z|b;g=7;}if((g|0)==7){h=R6(d[a+33>>0]|0|0,0,8)|0;b=z|b;e=h|e;g=8;}if((g|0)==8)e=e|(d[f>>0]|0);h=a+24|0;i=h;g=c[i+4>>2]^b;f=h;c[f>>2]=c[i>>2]^e;c[f+4>>2]=g;_Z(a,2);f=a;b=c[f+4>>2]^b;g=a;c[g>>2]=c[f>>2]^e;c[g+4>>2]=b;g=a+16|0;b=g;e=c[b+4>>2]|0;f=g;c[f>>2]=c[b>>2]^255;c[f+4>>2]=e;_Z(a,4);f=a;a=a+8|0;z=c[a+4>>2]^c[f+4>>2]^c[g+4>>2]^c[h+4>>2];return c[a>>2]^c[f>>2]^c[g>>2]^c[h>>2]|0}function _Z(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=a+8|0;f=a+24|0;g=a+16|0;d=0;while(1){if((d|0)>=(b|0))break;h=e;n=c[h>>2]|0;h=c[h+4>>2]|0;o=a;o=J6(c[o>>2]|0,c[o+4>>2]|0,n|0,h|0)|0;k=z;m=R6(n|0,h|0,13)|0;l=z;h=Q6(n|0,h|0,51)|0;h=(m|h)^o;l=(l|z)^k;m=f;n=c[m>>2]|0;m=c[m+4>>2]|0;j=g;j=J6(c[j>>2]|0,c[j+4>>2]|0,n|0,m|0)|0;i=z;q=R6(n|0,m|0,16)|0;p=z;m=Q6(n|0,m|0,48)|0;m=(q|m)^j;p=(p|z)^i;o=J6(k|0,o|0,m|0,p|0)|0;k=z;q=a;c[q>>2]=o;c[q+4>>2]=k;q=R6(m|0,p|0,21)|0;n=z;p=Q6(m|0,p|0,43)|0;m=f;c[m>>2]=(q|p)^o;c[m+4>>2]=(n|z)^k;i=J6(j|0,i|0,h|0,l|0)|0;j=z;m=R6(h|0,l|0,17)|0;k=z;l=Q6(h|0,l|0,47)|0;h=e;c[h>>2]=(m|l)^i;c[h+4>>2]=(k|z)^j;h=g;c[h>>2]=j;c[h+4>>2]=i;d=d+1|0;}return}function $Z(a){a=a|0;var b=0;while(1){b=c[a+472>>2]|0;if(!b)break;else a=b;}return c[a+492>>2]|0}function a_(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;L=l;l=l+16|0;I=L;J=L+4|0;K=c[b+352>>2]|0;o=d+16|0;p=d+40|0;q=b+144|0;r=b+284|0;s=e<<24>>24==0;t=h+12|0;v=h+16|0;w=h+8|0;x=d+44|0;y=d+64|0;z=b+436|0;A=b+452|0;B=b+448|0;C=(K+80|0)==(h|0);D=b+268|0;E=K+130|0;F=K+129|0;G=b+296|0;H=b+224|0;i=0;a:while(1){b:while(1){switch(ob[c[o>>2]&127](d,f,g,I)|0){case -4:{i=0;n=61;break a}case 0:{n=4;break a}case -1:{n=6;break a}case 6:{n=21;break b}case -3:{n=22;break b}case 7:case 39:{n=23;break b}case 10:{j=lb[c[p>>2]&127](d,f)|0;c:do if((j|0)<0)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;j=1;i=14;}else {j=1;i=14;}else {if(s&(j|0)==32){k=c[t>>2]|0;if((c[v>>2]|0)==(k|0)){j=4;break}if((a[k+-1>>0]|0)==32){j=4;break}}m=x_(j,J)|0;k=0;while(1){if((k|0)>=(m|0)){j=0;break c}j=c[t>>2]|0;if((j|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){j=1;i=1;break c}j=c[t>>2]|0;}M=a[J+k>>0]|0;c[t>>2]=j+1;a[j>>0]=M;k=k+1|0;}}while(0);switch(j&7){case 4:case 0:break b;default:{}}break}case 9:{j=c[y>>2]|0;j=(nb[c[x>>2]&63](d,f+j|0,(c[I>>2]|0)+(0-j)|0)|0)&255;if(j<<24>>24){n=31;break b}j=c[y>>2]|0;j=lZ(z,d,f+j|0,(c[I>>2]|0)+(0-j)|0)|0;if(!j){i=1;n=61;break a}m=nZ(b,K,j,0)|0;c[B>>2]=c[A>>2];do if(C){if(!(c[D>>2]|0))if(!m)break b;else break;if(!(a[E>>0]|0)){j=(m|0)!=0;if(!(a[F>>0]|0)){n=45;break}else {u=j;n=47;break}}else {j=(m|0)!=0;if(!(c[G>>2]|0)){n=45;break}else {u=j;n=47;break}}}else if(!(a[F>>0]|0))if(!m){i=11;n=61;break a}else {n=46;break}else {j=(m|0)!=0;if(!(a[E>>0]|0)){u=j;n=47;break}else {n=45;break}}while(0);if((n|0)==45)if(j)n=46;else {i=11;n=61;break a}else if((n|0)==47?(n=0,!u):0)break b;if((n|0)==46?(n=0,(a[m+34>>0]|0)==0):0){i=24;n=61;break a}k=m+32|0;if(a[k>>0]|0){n=49;break a}if(c[m+28>>2]|0){n=52;break a}j=c[m+4>>2]|0;if(!j){n=55;break a}m=j+(c[m+8>>2]|0)|0;a[k>>0]=1;m=a_(b,c[H>>2]|0,e,j,m,h)|0;a[k>>0]=0;j=(m|0)==0;if(j)break b;else {j=(j^1)&1;i=m;}break}default:{n=58;break a}}if(j)break a}if((n|0)==21){n=0;if(!(tZ(h,d,f,c[I>>2]|0)|0)){i=1;n=61;break}}else if((n|0)==22){c[I>>2]=f+(c[y>>2]|0);n=23;}else if((n|0)==31){n=0;f=c[t>>2]|0;if((f|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){i=1;n=61;break}f=c[t>>2]|0;}c[t>>2]=f+1;a[f>>0]=j;}do if((n|0)==23){n=0;f=c[t>>2]|0;if(s){if((c[v>>2]|0)==(f|0))break;if((a[f+-1>>0]|0)==32)break}if((f|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){i=1;n=61;break a}f=c[t>>2]|0;}c[t>>2]=f+1;a[f>>0]=32;}while(0);f=c[I>>2]|0;}if((n|0)==4)if((c[q>>2]|0)==(d|0)){c[r>>2]=c[I>>2];i=4;n=61;}else {i=4;n=61;}else if((n|0)==6)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=4;n=61;}else {i=4;n=61;}else if((n|0)==49)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=12;n=61;}else {i=12;n=61;}else if((n|0)==52)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=15;n=61;}else {i=15;n=61;}else if((n|0)==55)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=16;n=61;}else {i=16;n=61;}else if((n|0)==58)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=23;n=61;}else {i=23;n=61;}l=L;return i|0}function b_(a){a=a|0;var b=0;b=a+8|0;return ((a|0)<1?0:(b|0)>0?b:0)|0}function c_(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=l;l=l+80|0;d=c+16|0;e=c;VZ(a,e);WZ(d,e);XZ(d,b,YZ(b)|0);b=ZZ(d)|0;l=c;return b|0}function d_(b,c){b=b|0;c=c|0;var d=0;while(1){d=a[b>>0]|0;if(d<<24>>24!=(a[c>>0]|0)){c=0;break}if(!(d<<24>>24)){c=1;break}c=c+1|0;b=b+1|0;}return c|0}function e_(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+1040|0;i=k;f=c[b+124>>2]|0;a:do if(!f)e=18;else {e=0;while(1){if((e|0)==256)break;c[i+(e<<2)>>2]=-1;e=e+1|0;}g=i+1028|0;c[g>>2]=0;j=i+1024|0;c[j>>2]=0;h=i+1032|0;c[h>>2]=0;do if(nb[f&63](c[b+244>>2]|0,d,i)|0){f=c[b+12>>2]|0;e=y_()|0;e=kb[f&63](e)|0;c[b+236>>2]=e;if(!e){e=c[h>>2]|0;if(!e)e=1;else {tb[e&127](c[j>>2]|0);e=1;}}else {e=ob[(a[b+232>>0]<<24>>24?65:64)&127](e,i,c[g>>2]|0,c[j>>2]|0)|0;if(!e)break;c[b+240>>2]=c[j>>2];c[b+248>>2]=c[h>>2];c[b+144>>2]=e;e=0;}break a}while(0);e=c[h>>2]|0;if(e|0)tb[e&127](c[j>>2]|0);e=18;}while(0);l=k;return e|0}function f_(b,d){b=b|0;d=d|0;a[b+4>>0]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b>>2]=0;c[b+16>>2]=d;return}function g_(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;l=c[b+352>>2]|0;m=b+424|0;n=b+420|0;o=b+412|0;p=b+428|0;q=l+152|0;r=b+368|0;j=l+60|0;k=l+80|0;a:while(1){h=d;b:while(1){if(!(a[d>>0]|0)){d=1;break a}f=a[h>>0]|0;switch(f<<24>>24){case 0:case 12:{s=5;break b}case 61:break b;default:{}}e=c[m>>2]|0;if((e|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break a}e=c[m>>2]|0;f=a[h>>0]|0;}c[m>>2]=e+1;a[e>>0]=f;h=h+1|0;}if((s|0)==5){s=0;d=c[m>>2]|0;if((d|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;d=nZ(b,l,c[p>>2]|0,0)|0;if(d|0)a[d+32>>0]=1;d=(a[h>>0]|0)==0?h:h+1|0;c[m>>2]=c[p>>2];continue}d=c[m>>2]|0;if((c[p>>2]|0)==(d|0))f=q;else {if((d|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;f=nZ(b,j,c[p>>2]|0,8)|0;if(!f){d=0;break}e=c[f>>2]|0;i=c[p>>2]|0;d=i;if((e|0)==(i|0)){i=SZ(k,e)|0;c[f>>2]=i;if(!i){d=0;break}d=c[p>>2]|0;}c[m>>2]=d;}c:while(1){i=h+1|0;e=a[i>>0]|0;g=(d|0)==(c[n>>2]|0);switch(e<<24>>24){case 0:case 12:break c;default:{}}if(g){if(!((vZ(o)|0)<<24>>24)){d=0;break a}d=c[m>>2]|0;e=a[i>>0]|0;}c[m>>2]=d+1;a[d>>0]=e;h=i;d=c[m>>2]|0;}if(g){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;if(UZ(b,f,0,c[p>>2]|0,r)|0){d=0;break}c[m>>2]=c[p>>2];d=(a[i>>0]|0)==0?i:h+2|0;}return d|0}function h_(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0?(d=a+4|0,e=(c[d>>2]|0)==(c[a>>2]|0),c[a>>2]=b,e):0)c[d>>2]=b;return}function i_(a,b,d){a=a|0;b=b|0;d=d|0;if(a|0){c[a+52>>2]=b;c[a+56>>2]=d;}return}function j_(a,b){a=a|0;b=b|0;if(a|0)c[a+60>>2]=b;return}function k_(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=(b|0)==0;a:do if(!(g|(e|0)<0)?!((d|0)==0&(e|0)!=0):0){h=b+476|0;switch(c[h>>2]|0){case 3:{c[b+280>>2]=33;g=0;break a}case 2:{c[b+280>>2]=36;g=0;break a}case 0:{if((c[b+472>>2]|0)==0?(l_(b)|0)<<24>>24==0:0){c[b+280>>2]=1;g=0;break a}break}default:{}}c[h>>2]=1;if(e|0){g=n_(b,e)|0;if(!g){g=0;break}W6(g|0,d|0,e|0)|0;g=o_(b,e,f)|0;break}a[b+480>>0]=f;if(!f)g=1;else {g=b+24|0;j=c[g>>2]|0;d=b+292|0;c[d>>2]=j;f=c[b+28>>2]|0;c[b+40>>2]=f;e=b+276|0;f=ob[c[e>>2]&127](b,j,f,g)|0;c[b+280>>2]=f;if(f|0){c[b+288>>2]=c[b+284>>2];c[e>>2]=66;g=0;break}switch(c[h>>2]|0){case 3:{j=c[b+144>>2]|0;xb[c[j+48>>2]&31](j,c[d>>2]|0,c[g>>2]|0,b+404|0);c[d>>2]=c[g>>2];g=2;break a}case 1:case 0:{c[h>>2]=2;g=1;break a}default:{g=1;break a}}}}else i=3;while(0);if((i|0)==3)if(g)g=0;else {c[b+280>>2]=41;g=0;}return g|0}function l_(b){b=b|0;var d=0;d=b+492|0;if(!(c[d>>2]|0))c[d>>2]=p_()|0;if(!(a[b+232>>0]|0))b=1;else b=g_(b,142324)|0;return b|0}function m_(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return c[a+280>>2]|0}function n_(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;a:do if(!a)d=0;else {if((b|0)<0){c[a+280>>2]=1;d=0;break}switch(c[a+476>>2]|0){case 3:{c[a+280>>2]=33;d=0;break a}case 2:{c[a+280>>2]=36;d=0;break a}default:{m=a+32|0;j=c[m>>2]|0;n=a+28|0;e=c[n>>2]|0;d=e;if((j-e|0)>=(b|0))break a;p=a+24|0;k=c[p>>2]|0;i=e-k|0;e=i+b|0;if((e|0)<0){c[a+280>>2]=1;d=0;break a}l=a+8|0;f=c[l>>2]|0;q=f;g=k-q|0;h=(g|0)>1024;b=h?1024:g;e=b+e|0;do if((e|0)>(j-q|0)){d=j-k|0;d=(d|0)==0?1024:d;do d=d<<1;while((d|0)<(e|0)&(d|0)>0);if((d|0)<1){c[a+280>>2]=1;d=0;break a}e=kb[c[a+12>>2]&63](d)|0;if(!e){c[a+280>>2]=1;d=0;break a}c[m>>2]=e+d;d=c[p>>2]|0;if(!d){d=e+(c[n>>2]|0)|0;c[n>>2]=d;c[l>>2]=e;o=22;break}else {q=d;o=q-(c[l>>2]|0)|0;o=(o|0)<1024?o:1024;W6(e|0,d+(0-o)|0,(c[n>>2]|0)-q+o|0)|0;tb[c[a+20>>2]&127](c[l>>2]|0);c[l>>2]=e;d=e+((c[n>>2]|0)-(c[p>>2]|0))+o|0;c[n>>2]=d;e=e+o|0;o=22;break}}else if(h){e=g-b|0;X6(f|0,f+e|0,b+i|0)|0;e=0-e|0;d=(c[n>>2]|0)+e|0;c[n>>2]=d;e=(c[p>>2]|0)+e|0;o=22;}while(0);if((o|0)==22)c[p>>2]=e;c[a+288>>2]=0;c[a+284>>2]=0;c[a+292>>2]=0;break a}}}while(0);return d|0}function o_(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;a:do if(!b)d=0;else {f=b+476|0;switch(c[f>>2]|0){case 3:{c[b+280>>2]=33;d=0;break a}case 2:{c[b+280>>2]=36;d=0;break a}case 0:{if((c[b+472>>2]|0)==0?(l_(b)|0)<<24>>24==0:0){c[b+280>>2]=1;d=0;break a}break}default:{}}c[f>>2]=1;g=b+24|0;j=c[g>>2]|0;h=b+292|0;c[h>>2]=j;k=b+28|0;i=(c[k>>2]|0)+d|0;c[k>>2]=i;c[b+40>>2]=i;k=b+36|0;c[k>>2]=(c[k>>2]|0)+d;a[b+480>>0]=e;d=b+276|0;i=ob[c[d>>2]&127](b,j,i,g)|0;c[b+280>>2]=i;if(i|0){c[b+288>>2]=c[b+284>>2];c[d>>2]=66;d=0;break}switch(c[f>>2]|0){case 3:{d=2;break}case 1:case 0:{if(!e)d=1;else {c[f>>2]=2;d=1;break a}break}default:d=1;}k=c[b+144>>2]|0;xb[c[k+48>>2]&31](k,c[h>>2]|0,c[g>>2]|0,b+404|0);c[h>>2]=c[g>>2];}while(0);return d|0}function p_(){var a=0,b=0,d=0;b=l;l=l+16|0;a=b;if(!(q_(a)|0)){d=s_()|0;d=(X4()|0)^d;c[a>>2]=d;a=r_(142378,O(d,2147483647)|0)|0;}else a=r_(142365,c[a>>2]|0)|0;l=b;return a|0}function q_(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=m2(142365,0,f)|0;if((e|0)<0)b=0;else {b=0;while(1){g=W4(e,a+b|0,4-b|0)|0;d=g+b|0;if((g|0)>0)if(d>>>0<4)b=d;else {b=1;break}if((c[(d2()|0)>>2]|0)!=4){b=0;break}}l4(e)|0;}l=f;return b|0}function r_(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=Ta(142443)|0;if(d|0?(s2(d,142463)|0)==0:0){d=c[15712]|0;c[e>>2]=a;c[e+4>>2]=8;c[e+8>>2]=b;c[e+12>>2]=4;w4(d,142465,e)|0;}l=f;return b|0}function s_(){var a=0,b=0;b=l;l=l+16|0;a=b;if(!(Ua(a|0,0)|0)){l=b;return c[a+4>>2]|0}else qa(142390,142412,819,142423);return 0}function t_(a){a=a|0;if(!a)a=41;else a=c[a+280>>2]|0;return a|0}function u_(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(!a)a=0;else {b=a+284|0;d=c[b>>2]|0;if(d|0?(e=a+292|0,f=c[e>>2]|0,d>>>0>=f>>>0):0){g=c[a+144>>2]|0;xb[c[g+48>>2]&31](g,f,d,a+404|0);c[e>>2]=c[b>>2];}a=(c[a+404>>2]|0)+1|0;}return a|0}function v_(a){a=a|0;do switch(a|0){case 41:{a=142502;break}case 1:{a=143774;break}case 2:{a=143761;break}case 3:{a=143744;break}case 4:{a=143712;break}case 5:{a=143697;break}case 6:{a=143679;break}case 7:{a=143664;break}case 8:{a=143644;break}case 9:{a=143616;break}case 10:{a=143581;break}case 11:{a=143564;break}case 12:{a=143537;break}case 13:{a=143517;break}case 14:{a=143479;break}case 15:{a=143452;break}case 16:{a=143410;break}case 17:{a=143363;break}case 18:{a=143346;break}case 19:{a=143295;break}case 20:{a=143272;break}case 21:{a=143226;break}case 22:{a=143199;break}case 23:{a=143148;break}case 24:{a=143112;break}case 25:{a=143060;break}case 26:{a=143015;break}case 27:{a=143e3;break}case 28:{a=142974;break}case 29:{a=142936;break}case 30:{a=142904;break}case 31:{a=142871;break}case 32:{a=142837;break}case 33:{a=142820;break}case 34:{a=142799;break}case 35:{a=142783;break}case 36:{a=142766;break}case 37:{a=142722;break}case 38:{a=142642;break}case 39:{a=142583;break}case 40:{a=142519;break}default:a=0;}while(0);return a|0}function w_(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0;e=c[b>>2]|0;f=0;a:while(1){if(e>>>0<=a>>>0)break;h=e+-1|0;g=d[h>>0]|0;do if((g&248|0)==240)if((f+1|0)>>>0>3){i=5;break a}else f=0;else {if((g&240|0)==224)if((f+1|0)>>>0>2){i=8;break a}else {f=0;break}if((g&224|0)==192)if((f+1|0)>>>0>1){i=11;break a}else {f=0;break}else if(!(g&128))break a;else break}while(0);e=h;f=f+1|0;}if((i|0)==5)e=e+3|0;else if((i|0)==8)e=e+2|0;else if((i|0)==11)e=e+1|0;c[b>>2]=e;return}function x_(b,c){b=b|0;c=c|0;do if((b|0)>=0){if((b|0)<128){a[c>>0]=b;b=1;break}if((b|0)<2048){a[c>>0]=b>>>6|192;a[c+1>>0]=b&63|128;b=2;break}if((b|0)<65536){a[c>>0]=b>>>12|224;a[c+1>>0]=b>>>6&63|128;a[c+2>>0]=b&63|128;b=3;break}if((b|0)<1114112){a[c>>0]=b>>>18|240;a[c+1>>0]=b>>>12&63|128;a[c+2>>0]=b>>>6&63|128;a[c+3>>0]=b&63|128;b=4;}else b=0;}else b=0;while(0);return b|0}function y_(){return 1908}function z_(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=0;while(1){if((i|0)==364){i=0;break}a[e+i>>0]=a[56576+i>>0]|0;i=i+1|0;}a:while(1){if((i|0)>=128){j=5;break}switch(a[56648+i>>0]|0){case 0:case 28:break;default:if((c[f+(i<<2)>>2]|0)!=(i|0)){e=0;break a}}i=i+1|0;}b:do if((j|0)==5){q=e+72|0;m=e+372|0;n=e+884|0;o=(g|0)==0;l=0;while(1){if((l|0)>=256)break;p=c[f+(l<<2)>>2]|0;do if((p|0)==-1){a[q+l>>0]=1;b[m+(l<<1)>>1]=-1;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=0;}else {if((p|0)<0){if(o|(p|0)<-4){e=0;break b}a[q+l>>0]=3-p;a[n+(l<<2)>>0]=0;b[m+(l<<1)>>1]=0;break}if((p|0)<128){i=a[56648+p>>0]|0;switch(i<<24>>24){case 0:case 28:break;default:if((p|0)!=(l|0)){e=0;break b}}a[q+l>>0]=i;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=p;b[m+(l<<1)>>1]=(p|0)==0?-1:p&65535;break}if((A_(p)|0)<0){a[q+l>>0]=0;b[m+(l<<1)>>1]=-1;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=0;break}if((p|0)>65535){e=0;break b}i=p>>>8;j=p>>>5&7;k=1<<(p&31);if(!(c[56940+((d[143788+i>>0]<<3|j)<<2)>>2]&k))a[q+l>>0]=c[56940+((d[144044+i>>0]<<3|j)<<2)>>2]&k|0?26:28;else a[q+l>>0]=22;a[n+(l<<2)>>0]=x_(p,n+(l<<2)+1|0)|0;b[m+(l<<1)>>1]=p;}while(0);l=l+1|0;}c[e+368>>2]=h;c[e+364>>2]=g;if(!o){c[e+328>>2]=108;c[e+332>>2]=108;c[e+336>>2]=108;c[e+340>>2]=109;c[e+344>>2]=109;c[e+348>>2]=109;c[e+352>>2]=110;c[e+356>>2]=110;c[e+360>>2]=110;}c[e+56>>2]=13;c[e+60>>2]=14;}while(0);return e|0}function A_(b){b=b|0;var c=0;switch(b>>8|0){case 223:case 222:case 221:case 220:case 219:case 218:case 217:case 216:{b=-1;break}case 0:{if(!(a[56648+b>>0]|0))b=-1;else c=4;break}case 255:{if((b|1|0)==65535)b=-1;else c=4;break}default:c=4;}return b|0}function B_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=0;else a=c[56940+(((d[144044+(a>>>8)>>0]|0)<<3|a>>>5&7)<<2)>>2]&1<<(a&31);return a|0}function C_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=0;else a=c[56940+(((d[143788+(a>>>8)>>0]|0)<<3|a>>>5&7)<<2)>>2]&1<<(a&31);return a|0}function D_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=1;else a=(A_(a)|0)>>>31;return a|0}function E_(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+16|0;m=q;n=b+364|0;o=b+884|0;p=b+368|0;k=b+72|0;while(1){i=c[e>>2]|0;if((i|0)==(f|0)){h=0;break}r=d[i>>0]|0;j=o+(r<<2)+1|0;r=a[o+(r<<2)>>0]|0;b=r<<24>>24;if(!(r<<24>>24)){b=x_(lb[c[n>>2]&127](c[p>>2]|0,i)|0,m)|0;if((b|0)>(h-(c[g>>2]|0)|0)){h=2;break}i=c[e>>2]|0;j=m;i=i+((d[k+(d[i>>0]|0)>>0]|0)+-3)|0;}else {if((h-(c[g>>2]|0)|0)<(b|0)){h=2;break}i=i+1|0;}c[e>>2]=i;W6(c[g>>2]|0,j|0,b|0)|0;c[g>>2]=(c[g>>2]|0)+b;}l=q;return h|0}function F_(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=a+372|0;n=a+364|0;o=a+368|0;l=a+72|0;while(1){k=c[e>>2]|0;a=k>>>0>>0;i=c[g>>2]|0;if(!(a&i>>>0>>0))break;a=b[m+((d[k>>0]|0)<<1)>>1]|0;if(!(a<<16>>16)){a=(lb[c[n>>2]&127](c[o>>2]|0,k)|0)&65535;i=c[e>>2]|0;j=(d[l+(d[i>>0]|0)>>0]|0)+-3|0;}else {j=1;i=k;}c[e>>2]=i+j;k=c[g>>2]|0;c[g>>2]=k+2;b[k>>1]=a;}return ((i|0)!=(h|0)|a^1?0:2)|0}function G_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:do if(e>>>0>>0){n=b+72|0;do switch(a[n+(d[e>>0]|0)>>0]|0){case 12:{h=f$(12,b,e+1|0,f,g)|0;break a}case 13:{h=f$(13,b,e+1|0,f,g)|0;break a}case 2:{h=e+1|0;if((f-h|0)<=0){h=-1;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 16:{h=g$(b,e+2|0,f,g)|0;break a}case 15:{h=b$(b,e+2|0,f,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;h=29;break a}default:{c[g>>2]=h;h=0;break a}}}case 9:{if((e+1|0)==(f|0)){c[g>>2]=f;h=-15;break a}else k=3;break}case 10:case 21:{k=3;break}case 30:{h=X_(b,e+1|0,f,g)|0;break a}case 35:{c[g>>2]=e+1;h=38;break a}case 20:{c[g>>2]=e+1;h=25;break a}case 4:{i=e+1|0;h=f-i|0;if((h|0)<=0){h=-26;break a}if((a[i>>0]|0)==93){if((h|0)<=1){h=-1;break a}if((a[e+2>>0]|0)==62){c[g>>2]=e+3;h=34;break a}}c[g>>2]=i;h=26;break a}case 31:{c[g>>2]=e+1;h=23;break a}case 32:{h=e+1|0;if((f-h|0)<=0){h=-24;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 33:{c[g>>2]=e+2;h=36;break a}case 15:{c[g>>2]=e+2;h=35;break a}case 34:{c[g>>2]=e+2;h=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;h=24;break a}default:{c[g>>2]=h;h=0;break a}}}case 36:{c[g>>2]=e+1;h=21;break a}case 11:{c[g>>2]=e+1;h=17;break a}case 19:{h=h$(b,e+1|0,f,g)|0;break a}case 5:{if((f-e|0)<2){h=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0))if(!(lb[c[b+328>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=2;}else {h=18;i=2;}break}case 6:{if((f-e|0)<3){h=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0))if(!(lb[c[b+332>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=3;}else {h=18;i=3;}break}case 7:{if((f-e|0)<4){h=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0))if(!(lb[c[b+336>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=4;}else {h=18;i=4;}break}case 24:case 22:{h=18;i=1;break}case 23:case 27:case 26:case 25:{h=19;i=1;break}default:{c[g>>2]=e;h=0;break a}}while(0);if((k|0)==3){j=f;i=e;b:while(1){h=i;i=i+1|0;if((j-i|0)<=0){k=18;break}switch(a[n+(d[i>>0]|0)>>0]|0){case 10:case 21:continue b;case 9:break;default:{k=17;break b}}if((h+2|0)==(f|0)){k=17;break}}if((k|0)==17){c[g>>2]=i;h=15;break}else if((k|0)==18){c[g>>2]=i;h=15;break}}k=b+328|0;l=b+332|0;m=b+336|0;j=e+i|0;c:while(1){i=f-j|0;if((i|0)<=0){k=99;break}switch(a[n+(d[j>>0]|0)>>0]|0){case 29:{k=56;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{k=70;break c}case 34:{k=89;break c}case 33:{k=92;break c}case 15:{k=95;break c}case 27:case 26:case 25:case 24:case 22:{e=h;j=j+1|0;h=e;continue c}case 5:{if((i|0)<2){h=-2;break a}if(!(lb[c[k>>2]&127](b,j)|0)){k=60;break c}e=h;j=j+2|0;h=e;continue c}case 6:{if((i|0)<3){h=-2;break a}if(!(lb[c[l>>2]&127](b,j)|0)){k=64;break c}e=h;j=j+3|0;h=e;continue c}case 7:{if((i|0)<4){h=-2;break a}if(!(lb[c[m>>2]&127](b,j)|0)){k=68;break c}e=h;j=j+4|0;h=e;continue c}case 23:{i=j+1|0;switch(h&63){case 18:break;case 41:{h=19;j=i;continue c}default:{e=h;j=i;h=e;continue c}}h=f-i|0;if((h|0)<=0){h=-1;break a}switch(a[n+(d[i>>0]|0)>>0]|0){case 29:{k=74;break c}case 27:case 26:case 25:case 24:case 22:{h=41;j=j+2|0;continue c}case 5:{if((h|0)<2){h=-2;break a}if(!(lb[c[k>>2]&127](b,i)|0)){k=78;break c}h=41;j=j+3|0;continue c}case 6:{if((h|0)<3){h=-2;break a}if(!(lb[c[l>>2]&127](b,i)|0)){k=82;break c}h=41;j=j+4|0;continue c}case 7:{if((h|0)<4){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){k=86;break c}h=41;j=j+5|0;continue c}default:{h=19;j=i;continue c}}}default:{k=98;break c}}}switch(k|0){case 56:{c[g>>2]=j;h=0;break a}case 60:{c[g>>2]=j;h=0;break a}case 64:{c[g>>2]=j;h=0;break a}case 68:{c[g>>2]=j;h=0;break a}case 70:{c[g>>2]=j;break a}case 74:{c[g>>2]=i;h=0;break a}case 78:{c[g>>2]=i;h=0;break a}case 82:{c[g>>2]=i;h=0;break a}case 86:{c[g>>2]=i;h=0;break a}case 89:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=32;break a}case 92:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=31;break a}case 95:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=30;break a}case 98:{c[g>>2]=j;h=0;break a}case 99:{h=0-h|0;break a}}}else h=-4;while(0);return h|0}function H_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){m=b+72|0;b:do switch(a[m+(d[e>>0]|0)>>0]|0){case 2:{h=__(b,e+1|0,f,g)|0;break a}case 3:{h=W_(b,e+1|0,f,g)|0;break a}case 9:{h=e+1|0;if((f-h|0)<=0){h=-3;break a}c[g>>2]=(a[m+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break a}case 10:{c[g>>2]=e+1;h=7;break a}case 4:{i=e+1|0;if((f-i|0)<=0){h=-5;break a}if((a[i>>0]|0)==93){h=e+2|0;if((f-h|0)<=0){h=-5;break a}if((a[h>>0]|0)==62){c[g>>2]=h;h=0;break a}else h=f;}else h=f;break}case 5:{h=f;if((h-e|0)<2){h=-2;break a}if(!(lb[c[b+352>>2]&127](b,e)|0)){i=e+2|0;break b}else {c[g>>2]=e;h=0;break a}}case 6:{h=f;if((h-e|0)<3){h=-2;break a}if(!(lb[c[b+356>>2]&127](b,e)|0)){i=e+3|0;break b}else {c[g>>2]=e;h=0;break a}}case 7:{h=f;if((h-e|0)<4){h=-2;break a}if(!(lb[c[b+360>>2]&127](b,e)|0)){i=e+4|0;break b}else {c[g>>2]=e;h=0;break a}}case 8:case 1:case 0:{c[g>>2]=e;h=0;break a}default:{i=e+1|0;h=f;}}while(0);j=b+352|0;k=b+356|0;l=b+360|0;c:while(1){f=h-i|0;if((f|0)<=0){f=49;break}switch(a[m+(d[i>>0]|0)>>0]|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{f=47;break c}case 5:{if((f|0)<2){f=32;break c}if(lb[c[j>>2]&127](b,i)|0){f=32;break c}i=i+2|0;continue c}case 6:{if((f|0)<3){f=36;break c}if(lb[c[k>>2]&127](b,i)|0){f=36;break c}i=i+3|0;continue c}case 7:{if((f|0)<4){f=40;break c}if(lb[c[l>>2]&127](b,i)|0){f=40;break c}i=i+4|0;continue c}case 4:{if((f|0)<=1){f=47;break c}e=i+1|0;if((a[e>>0]|0)!=93){i=e;continue c}if((f|0)<=2){f=47;break c}i=i+2|0;if((a[i>>0]|0)==62){f=46;break c}else {i=e;continue c}}default:{i=i+1|0;continue c}}}if((f|0)==32){c[g>>2]=i;h=6;break}else if((f|0)==36){c[g>>2]=i;h=6;break}else if((f|0)==40){c[g>>2]=i;h=6;break}else if((f|0)==46){c[g>>2]=i;h=0;break}else if((f|0)==47){c[g>>2]=i;h=6;break}else if((f|0)==49){c[g>>2]=i;h=6;break}}else h=-4;while(0);return h|0}function I_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;a:do if(e>>>0>>0){l=b+72|0;b:do switch(a[l+(d[e>>0]|0)>>0]|0){case 4:{i=e+1|0;h=f;if((h-i|0)<=0){h=-1;break a}if((a[i>>0]|0)==93){f=e+2|0;if((h-f|0)<=0){h=-1;break a}if((a[f>>0]|0)==62){c[g>>2]=e+3;h=40;break a}}break}case 9:{h=e+1|0;if((f-h|0)<=0){h=-1;break a}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break a}case 10:{c[g>>2]=e+1;h=7;break a}case 5:{h=f;if((h-e|0)<2){h=-2;break a}if(!(lb[c[b+352>>2]&127](b,e)|0)){i=e+2|0;break b}else {c[g>>2]=e;h=0;break a}}case 6:{h=f;if((h-e|0)<3){h=-2;break a}if(!(lb[c[b+356>>2]&127](b,e)|0)){i=e+3|0;break b}else {c[g>>2]=e;h=0;break a}}case 7:{h=f;if((h-e|0)<4){h=-2;break a}if(!(lb[c[b+360>>2]&127](b,e)|0)){i=e+4|0;break b}else {c[g>>2]=e;h=0;break a}}case 8:case 1:case 0:{c[g>>2]=e;h=0;break a}default:{i=e+1|0;h=f;}}while(0);e=b+352|0;j=b+356|0;k=b+360|0;c:while(1){f=h-i|0;if((f|0)<=0){f=39;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 4:case 10:case 9:case 8:case 1:case 0:{f=37;break c}case 5:{if((f|0)<2){f=30;break c}if(!(lb[c[e>>2]&127](b,i)|0))f=2;else {f=30;break c}break}case 6:{if((f|0)<3){f=33;break c}if(!(lb[c[j>>2]&127](b,i)|0))f=3;else {f=33;break c}break}case 7:{if((f|0)<4){f=36;break c}if(!(lb[c[k>>2]&127](b,i)|0))f=4;else {f=36;break c}break}default:f=1;}i=i+f|0;}if((f|0)==30){c[g>>2]=i;h=6;break}else if((f|0)==33){c[g>>2]=i;h=6;break}else if((f|0)==36){c[g>>2]=i;h=6;break}else if((f|0)==37){c[g>>2]=i;h=6;break}else if((f|0)==39){c[g>>2]=i;h=6;break}}else h=-4;while(0);return h|0} - function Ew(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;if(!((a|0)>-1&((b|0)>0&(d|0)>0)))qa(95162,94943,843,95188);j=zw(b,d,a,i,j,1)|0;if(!j)qa(95233,94943,847,95188);u=c[j+20>>2]|0;t=c[j+24>>2]|0;m=b+1|0;l=0;while(1){if((l|0)==(m|0))break;c[u+(l<<2)>>2]=0;l=l+1|0;}a:do switch(i|0){case 1:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){q=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=13;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=13;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==13)qa(138394,94943,862,95188);while(1){if((q|0)==(b|0)){l=0;break}s=q+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(q<<2)>>2]|0);q=s;}while(1){if((l|0)==(a|0))break;r=u+(c[e+(l<<2)>>2]<<2)|0;s=c[r>>2]|0;h[i+(s<<3)>>3]=+h[g+(l<<3)>>3];d=c[f+(l<<2)>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 2:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){r=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=25;break}q=c[f+(l<<2)>>2]|0;if(!((q|0)>-1&(q|0)<(d|0))){s=25;break}q=u+(m+1<<2)|0;c[q>>2]=(c[q>>2]|0)+1;l=l+1|0;}if((s|0)==25)qa(138394,94943,880,95188);while(1){if((r|0)==(b|0)){l=0;break}s=r+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(r<<2)>>2]|0);r=s;}while(1){if((l|0)==(a|0))break;r=u+(c[e+(l<<2)>>2]<<2)|0;s=c[r>>2]|0;d=s<<1;h[i+(d<<3)>>3]=+h[g>>3];h[i+((d|1)<<3)>>3]=+h[g+8>>3];d=c[f+(l<<2)>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+16|0;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 4:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){p=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=37;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=37;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==37)qa(138394,94943,899,95188);while(1){if((p|0)==(b|0)){l=0;break}s=p+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(p<<2)>>2]|0);p=s;}while(1){if((l|0)==(a|0))break;r=e+(l<<2)|0;c[i+(c[u+(c[r>>2]<<2)>>2]<<2)>>2]=c[g+(l<<2)>>2];d=c[f+(l<<2)>>2]|0;r=u+(c[r>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 8:{g=0;while(1){if((g|0)>=(a|0)){n=0;break}l=c[e+(g<<2)>>2]|0;if(!((l|0)>-1&(l|0)<(b|0))){s=48;break}r=c[f+(g<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=48;break}r=u+(l+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;g=g+1|0;}if((s|0)==48)qa(138394,94943,915,95188);while(1){if((n|0)==(b|0)){g=0;break}s=n+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(n<<2)>>2]|0);n=s;}while(1){if((g|0)==(a|0))break;d=c[f+(g<<2)>>2]|0;r=u+(c[e+(g<<2)>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 16:{l=0;while(1){if((l|0)>=(a|0)){o=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=59;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=59;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==59)qa(138394,94943,930,95188);while(1){if((o|0)==(b|0))break;s=o+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(o<<2)>>2]|0);o=s;}W6(c[j+28>>2]|0,g|0,O(c[j+40>>2]|0,a)|0)|0;g=0;while(1){if((g|0)==(a|0))break;d=c[f+(g<<2)>>2]|0;r=u+(c[e+(g<<2)>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}default:qa(138394,94943,944,95188);}while(0);c[u>>2]=0;c[j+8>>2]=a;if(k)j=Fw(j,k)|0;return j|0}function Fw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;t=c[a+20>>2]|0;u=c[a+24>>2]|0;e=c[a+16>>2]|0;r=c[a+4>>2]|0;a:do if(b){m=r<<2;n=KK(m)|0;d=0;while(1){if((d|0)>=(r|0))break;c[n+(d<<2)>>2]=-1;d=d+1|0;}b:do switch(e|0){case 1:{k=c[a+28>>2]|0;f=0;e=c[t>>2]|0;d=0;c:while(1){if((d|0)>=(c[a>>2]|0)){v=f;w=n;break b}l=d+1|0;m=t+(l<<2)|0;i=t+(d<<2)|0;d=f;while(1){b=c[m>>2]|0;if((e|0)>=(b|0))break;b=u+(e<<2)|0;f=c[b>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;h[k+(d<<3)>>3]=+h[k+(e<<3)>>3];c[n+(c[b>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break c;s=k+(g<<3)|0;h[s>>3]=+h[s>>3]+ +h[k+(e<<3)>>3];}e=e+1|0;}c[m>>2]=d;f=d;e=b;d=l;}qa(95235,94943,1792,95260);break}case 2:{s=c[a+28>>2]|0;switch(b|0){case 1:{b=c[t>>2]|0;e=0;d=0;d:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}k=e+1|0;l=t+(k<<2)|0;i=t+(e<<2)|0;while(1){e=c[l>>2]|0;if((b|0)>=(e|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;q=b<<1;r=d<<1;h[s+(r<<3)>>3]=+h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break d;q=b<<1;r=g<<1;p=s+(r<<3)|0;h[p>>3]=+h[p>>3]+ +h[s+(q<<3)>>3];r=s+((r|1)<<3)|0;h[r>>3]=+h[r>>3]+ +h[s+((q|1)<<3)>>3];}b=b+1|0;}c[l>>2]=d;b=e;e=k;}qa(95235,94943,1815,95260);break}case 4:{b=c[t>>2]|0;e=0;d=0;e:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}l=e+1|0;k=t+(l<<2)|0;i=t+(e<<2)|0;while(1){e=c[k>>2]|0;if((b|0)>=(e|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;q=b<<1;r=d<<1;h[s+(r<<3)>>3]=+h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break e;q=b<<1;r=g<<1;p=s+(r<<3)|0;h[p>>3]=+h[p>>3]+ +h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];}b=b+1|0;}c[k>>2]=d;b=e;e=l;}qa(95235,94943,1835,95260);break}case 2:{q=~~+h[s+8>>3];i=c[a>>2]|0;e=q;g=0;d=0;f:while(1){if((g|0)>=(i|0))break;k=g+1|0;l=c[t+(k<<2)>>2]|0;f=d;b=q;d=c[t+(g<<2)>>2]|0;while(1){if((d|0)>=(l|0)){q=b;g=k;d=f;continue f}q=~~+h[s+((f<<1|1)<<3)>>3];f=f+1|0;e=(e|0)>(q|0)?e:q;b=(b|0)<(q|0)?b:q;d=d+1|0;}}U1(n);p=e-q+1|0;o=KK(O(p,m)|0)|0;p=O(p,r)|0;d=0;while(1){if((d|0)>=(p|0))break;c[o+(d<<2)>>2]=-1;d=d+1|0;}d=0;b=c[t>>2]|0;e=0;g:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=o;break b}m=e+1|0;n=t+(m<<2)|0;l=t+(e<<2)|0;while(1){e=c[n>>2]|0;if((b|0)>=(e|0))break;e=c[u+(b<<2)>>2]|0;f=b<<1;j=+h[s+((f|1)<<3)>>3];g=(O(~~j-q|0,r)|0)+e|0;i=o+(g<<2)|0;k=c[i>>2]|0;if((k|0)<(c[l>>2]|0)){c[u+(d<<2)>>2]=e;k=d<<1;h[s+(k<<3)>>3]=+h[s+(f<<3)>>3];h[s+((k|1)<<3)>>3]=j;c[i>>2]=d;d=d+1|0;}else {if((g|0)>=(p|0)){d=55;break g}if((c[u+(k<<2)>>2]|0)!=(e|0)){d=57;break g}k=k<<1;i=s+(k<<3)|0;h[i>>3]=+h[i>>3]+ +h[s+(f<<3)>>3];h[s+((k|1)<<3)>>3]=j;}b=b+1|0;}c[n>>2]=d;b=e;e=m;}if((d|0)==55)qa(95292,94943,1869,95260);else if((d|0)==57)qa(95313,94943,1870,95260);break}case 3:{f=~~+h[s+8>>3];i=c[a>>2]|0;d=f;e=0;g=0;h:while(1){if((g|0)>=(i|0))break;k=g+1|0;l=c[t+(k<<2)>>2]|0;b=d;d=c[t+(g<<2)>>2]|0;while(1){if((d|0)>=(l|0)){d=b;g=k;continue h}q=~~+h[s+(e<<1<<3)>>3];b=(b|0)>(q|0)?b:q;f=(f|0)>(q|0)?f:q;e=e+1|0;d=d+1|0;}}U1(n);e=d-f+1|0;o=KK(O(e,m)|0)|0;e=O(e,r)|0;d=0;while(1){if((d|0)>=(e|0))break;c[o+(d<<2)>>2]=-1;d=d+1|0;}d=0;b=c[t>>2]|0;e=0;i:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=o;break b}m=e+1|0;n=t+(m<<2)|0;l=t+(e<<2)|0;while(1){e=c[n>>2]|0;if((b|0)>=(e|0))break;e=c[u+(b<<2)>>2]|0;g=b<<1;j=+h[s+(g<<3)>>3];i=o+((O(~~j-f|0,r)|0)+e<<2)|0;k=c[i>>2]|0;if((k|0)<(c[l>>2]|0)){c[u+(d<<2)>>2]=e;q=d<<1;h[s+(q<<3)>>3]=j;h[s+((q|1)<<3)>>3]=+h[s+((g|1)<<3)>>3];c[i>>2]=d;d=d+1|0;}else {if((c[u+(k<<2)>>2]|0)!=(e|0))break i;q=k<<1;h[s+(q<<3)>>3]=j;q=s+((q|1)<<3)|0;h[q>>3]=+h[q>>3]+ +h[s+((g|1)<<3)>>3];}b=b+1|0;}c[n>>2]=d;b=e;e=m;}qa(95313,94943,1905,95260);break}default:{v=0;w=n;break b}}break}case 4:{k=c[a+28>>2]|0;e=0;d=0;b=c[t>>2]|0;j:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}l=e+1|0;m=t+(l<<2)|0;i=t+(e<<2)|0;while(1){f=c[m>>2]|0;if((b|0)>=(f|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;c[k+(d<<2)>>2]=c[k+(b<<2)>>2];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break j;s=k+(g<<2)|0;c[s>>2]=(c[s>>2]|0)+(c[k+(b<<2)>>2]|0);}b=b+1|0;}c[m>>2]=d;e=l;b=f;}qa(95235,94943,1929,95260);break}case 8:{e=0;d=0;b=c[t>>2]|0;k:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}k=e+1|0;l=t+(k<<2)|0;i=t+(e<<2)|0;while(1){f=c[l>>2]|0;if((b|0)>=(f|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)>=(c[i>>2]|0)){if((c[u+(g<<2)>>2]|0)!=(f|0))break k}else {c[u+(d<<2)>>2]=f;c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}b=b+1|0;}c[l>>2]=d;e=k;b=f;}qa(95235,94943,1948,95260);break}default:{a=0;break a}}while(0);c[a+8>>2]=v;U1(w);}while(0);return a|0}function Gw(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;if(!d)Hw(a,c,e,g,b,f);else Iw(a,c,e,g,b,f);return}function Hw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0;if((c[a+32>>2]|0)!=1)qa(94919,94943,1121,95483);if((c[a+16>>2]|0)!=1)qa(95364,94943,1122,95483);p=c[a+28>>2]|0;q=c[a+20>>2]|0;r=c[a+24>>2]|0;s=c[a>>2]|0;o=c[a+4>>2]|0;a=c[d>>2]|0;i=(a|0)!=0;if(!f){if(!i)a=KK(O(e<<3,s)|0)|0;f=0;a:while(1){if((f|0)>=(s|0))break;n=O(f,e)|0;i=0;while(1){if((i|0)>=(e|0))break;h[a+(i+n<<3)>>3]=0.0;i=i+1|0;}l=f+1|0;m=c[q+(l<<2)>>2]|0;i=c[q+(f<<2)>>2]|0;while(1){if((i|0)>=(m|0)){f=l;continue a}j=p+(i<<3)|0;k=r+(i<<2)|0;f=0;while(1){if((f|0)>=(e|0))break;t=+h[b+((O(c[k>>2]|0,e)|0)+f<<3)>>3]*+h[j>>3];o=a+(f+n<<3)|0;h[o>>3]=+h[o>>3]+t;f=f+1|0;}i=i+1|0;}}if(g)Kw(a,s,e);}else {if(!i)a=KK(O(e<<3,o)|0)|0;f=O(o,e)|0;i=0;while(1){if((i|0)>=(f|0)){i=0;break}h[a+(i<<3)>>3]=0.0;i=i+1|0;}b:while(1){if((i|0)>=(s|0))break;l=i+1|0;m=c[q+(l<<2)>>2]|0;n=O(i,e)|0;i=c[q+(i<<2)>>2]|0;while(1){if((i|0)>=(m|0)){i=l;continue b}j=p+(i<<3)|0;k=r+(i<<2)|0;f=0;while(1){if((f|0)>=(e|0))break;u=a+((O(c[k>>2]|0,e)|0)+f<<3)|0;h[u>>3]=+h[u>>3]+ +h[b+(f+n<<3)>>3]*+h[j>>3];f=f+1|0;}i=i+1|0;}}if(g)Kw(a,o,e);}c[d>>2]=a;return}function Iw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;if((c[a+32>>2]|0)!=1)qa(94919,94943,1163,95335);if((c[a+16>>2]|0)!=1)qa(95364,94943,1164,95335);h=c[d>>2]|0;j=c[a>>2]|0;k=c[a+4>>2]|0;i=(h|0)!=0;if(!f){if(!i)h=KK(O(e<<3,j)|0)|0;i=0;while(1){if((i|0)>=(e|0))break;c[m>>2]=h+((O(i,j)|0)<<3);Jw(a,b+((O(i,k)|0)<<3)|0,m,0);i=i+1|0;}if(!g)Kw(h,e,j);}else {if(!i)h=KK(O(e<<3,k)|0)|0;i=0;while(1){if((i|0)>=(e|0))break;c[m>>2]=h+((O(i,k)|0)<<3);Jw(a,b+((O(i,j)|0)<<3)|0,m,f);i=i+1|0;}if(!g)Kw(h,e,k);}c[d>>2]=h;l=n;return}function Jw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0;if((c[a+32>>2]|0)!=1)qa(94919,94943,1222,95392);i=c[a+16>>2]|0;switch(i|0){case 4:case 1:break;default:qa(95421,94943,1223,95392);}n=c[a+20>>2]|0;m=c[a+24>>2]|0;o=c[a>>2]|0;k=c[a+4>>2]|0;j=c[d>>2]|0;a:do switch(i|0){case 1:{l=c[a+28>>2]|0;a=(e|0)!=0;f=(j|0)!=0;if(!b){if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;b:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue b}p=g+ +h[l+(a<<3)>>3];h[i>>3]=p;a=a+1|0;g=p;}}}if(!f)j=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[j+(a<<3)>>3]=0.0;a=a+1|0;}c:while(1){if((a|0)>=(o|0)){f=j;break a}f=a+1|0;i=c[n+(f<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(i|0)){a=f;continue c}b=j+(c[m+(a<<2)>>2]<<3)|0;h[b>>3]=+h[b>>3]+ +h[l+(a<<3)>>3];a=a+1|0;}}}else {if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;d:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue d}p=g+ +h[b+(c[m+(a<<2)>>2]<<3)>>3]*+h[l+(a<<3)>>3];h[i>>3]=p;a=a+1|0;g=p;}}}if(f)f=j;else f=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[f+(a<<3)>>3]=0.0;a=a+1|0;}e:while(1){if((a|0)>=(o|0))break a;i=a+1|0;j=c[n+(i<<2)>>2]|0;e=b+(a<<3)|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(j|0)){a=i;continue e}k=f+(c[m+(a<<2)>>2]<<3)|0;h[k>>3]=+h[k>>3]+ +h[e>>3]*+h[l+(a<<3)>>3];a=a+1|0;}}}}case 4:{l=c[a+28>>2]|0;a=(e|0)!=0;f=(j|0)!=0;if(!b){if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;f:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue f}p=g+ +(c[l+(a<<2)>>2]|0);h[i>>3]=p;a=a+1|0;g=p;}}}if(!f)j=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[j+(a<<3)>>3]=0.0;a=a+1|0;}g:while(1){if((a|0)>=(o|0)){f=j;break a}f=a+1|0;i=c[n+(f<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(i|0)){a=f;continue g}b=j+(c[m+(a<<2)>>2]<<3)|0;h[b>>3]=+h[b>>3]+ +(c[l+(a<<2)>>2]|0);a=a+1|0;}}}else {if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;h:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue h}p=g+ +h[b+(c[m+(a<<2)>>2]<<3)>>3]*+(c[l+(a<<2)>>2]|0);h[i>>3]=p;a=a+1|0;g=p;}}}if(f)f=j;else f=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[f+(a<<3)>>3]=0.0;a=a+1|0;}i:while(1){if((a|0)>=(o|0))break a;i=a+1|0;j=c[n+(i<<2)>>2]|0;e=b+(a<<3)|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(j|0)){a=i;continue i}k=f+(c[m+(a<<2)>>2]<<3)|0;h[k>>3]=+h[k>>3]+ +h[e>>3]*+(c[l+(a<<2)>>2]|0);a=a+1|0;}}}}default:qa(138394,94943,1315,95392);}while(0);c[d>>2]=f;return}function Kw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=O(b<<3,c)|0;f=KK(d)|0;W6(f|0,a|0,d|0)|0;d=0;while(1){if((d|0)>=(b|0))break;g=O(d,c)|0;e=0;while(1){if((e|0)>=(c|0))break;h[a+((O(e,b)|0)+d<<3)>>3]=+h[f+(e+g<<3)>>3];e=e+1|0;}d=d+1|0;}U1(f);return}function Lw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;x=c[a+20>>2]|0;y=c[a+24>>2]|0;z=c[b+20>>2]|0;A=c[b+24>>2]|0;w=c[a+32>>2]|0;if(!((w|0)==1?(w|0)==(c[b+32>>2]|0):0))qa(95005,94943,1408,95512);w=c[a>>2]|0;if(((c[a+4>>2]|0)==(c[b>>2]|0)?(n=c[a+16>>2]|0,(n|0)==(c[b+16>>2]|0)):0)?(m=b+4|0,B=KK(c[m>>2]<<2)|0,(B|0)!=0):0){d=0;while(1){if((d|0)>=(c[m>>2]|0)){e=0;d=0;break}c[B+(d<<2)>>2]=-1;d=d+1|0;}a:while(1){if((d|0)>=(w|0))break;j=d+1|0;k=x+(j<<2)|0;l=-2-d|0;i=c[x+(d<<2)>>2]|0;while(1){if((i|0)>=(c[k>>2]|0)){d=j;continue a}f=c[y+(i<<2)>>2]|0;g=z+(f+1<<2)|0;f=c[z+(f<<2)>>2]|0;while(1){if((f|0)>=(c[g>>2]|0))break;d=B+(c[A+(f<<2)>>2]<<2)|0;if((c[d>>2]|0)!=(l|0)){c[d>>2]=l;e=e+1|0;}f=f+1|0;}i=i+1|0;}}d=rw(w,c[m>>2]|0,e,n,1)|0;b:do if(!d)d=0;else {t=c[d+20>>2]|0;u=c[d+24>>2]|0;c:do switch(n|0){case 1:{r=c[a+28>>2]|0;n=c[b+28>>2]|0;b=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;d:while(1){if((e|0)>=(w|0)){v=f;break c}o=e+1|0;p=x+(o<<2)|0;q=t+(e<<2)|0;a=c[x+(e<<2)>>2]|0;while(1){if((a|0)>=(c[p>>2]|0))break;k=c[y+(a<<2)>>2]|0;l=z+(k+1<<2)|0;m=r+(a<<3)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[l>>2]|0))break;e=A+(k<<2)|0;g=c[e>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[q>>2]|0)){c[i>>2]=f;c[u+(f<<2)>>2]=c[e>>2];h[b+(f<<3)>>3]=+h[n+(k<<3)>>3]*+h[m>>3];f=f+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break d;s=b+(j<<3)|0;h[s>>3]=+h[s>>3]+ +h[n+(k<<3)>>3]*+h[m>>3];}k=k+1|0;}a=a+1|0;}c[t+(o<<2)>>2]=f;e=o;}qa(95534,94943,1468,95512);break}case 2:{s=c[a+28>>2]|0;b=c[b+28>>2]|0;o=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;e:while(1){if((e|0)>=(w|0)){v=f;break c}p=e+1|0;q=x+(p<<2)|0;r=t+(e<<2)|0;n=c[x+(e<<2)>>2]|0;while(1){if((n|0)>=(c[q>>2]|0))break;k=c[y+(n<<2)>>2]|0;l=z+(k+1<<2)|0;a=n<<1;m=s+(a<<3)|0;a=s+((a|1)<<3)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[l>>2]|0))break;e=A+(k<<2)|0;g=c[e>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[r>>2]|0)){c[i>>2]=f;c[u+(f<<2)>>2]=c[e>>2];i=k<<1;g=b+(i<<3)|0;i=b+((i|1)<<3)|0;j=f<<1;h[o+(j<<3)>>3]=+h[g>>3]*+h[m>>3]-+h[i>>3]*+h[a>>3];h[o+((j|1)<<3)>>3]=+h[g>>3]*+h[a>>3]+ +h[i>>3]*+h[m>>3];f=f+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break e;i=k<<1;g=b+(i<<3)|0;i=b+((i|1)<<3)|0;j=j<<1;e=o+(j<<3)|0;h[e>>3]=+h[e>>3]+ +h[g>>3]*+h[m>>3]-+h[i>>3]*+h[a>>3];j=o+((j|1)<<3)|0;h[j>>3]=+h[g>>3]*+h[a>>3]+ +h[i>>3]*+h[m>>3]+ +h[j>>3];}k=k+1|0;}n=n+1|0;}c[t+(p<<2)>>2]=f;e=p;}qa(95534,94943,1497,95512);break}case 4:{r=c[a+28>>2]|0;n=c[b+28>>2]|0;b=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;f:while(1){if((f|0)>=(w|0)){v=e;break c}o=f+1|0;p=x+(o<<2)|0;q=t+(f<<2)|0;l=c[x+(f<<2)>>2]|0;while(1){if((l|0)>=(c[p>>2]|0))break;k=c[y+(l<<2)>>2]|0;m=z+(k+1<<2)|0;a=r+(l<<2)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;f=A+(k<<2)|0;g=c[f>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[q>>2]|0)){c[i>>2]=e;c[u+(e<<2)>>2]=c[f>>2];c[b+(e<<2)>>2]=O(c[n+(k<<2)>>2]|0,c[a>>2]|0)|0;e=e+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break f;i=O(c[n+(k<<2)>>2]|0,c[a>>2]|0)|0;s=b+(j<<2)|0;c[s>>2]=(c[s>>2]|0)+i;}k=k+1|0;}l=l+1|0;}c[t+(o<<2)>>2]=e;f=o;}qa(95534,94943,1523,95512);break}case 8:{c[t>>2]=0;e=0;f=0;g:while(1){if((f|0)>=(w|0)){v=e;break c}a=f+1|0;n=x+(a<<2)|0;b=t+(f<<2)|0;l=c[x+(f<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;k=c[y+(l<<2)>>2]|0;m=z+(k+1<<2)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;f=A+(k<<2)|0;g=c[f>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)>=(c[b>>2]|0)){if((c[u+(j<<2)>>2]|0)!=(g|0))break g}else {c[i>>2]=e;c[u+(e<<2)>>2]=c[f>>2];e=e+1|0;}k=k+1|0;}l=l+1|0;}c[t+(a<<2)>>2]=e;f=a;}qa(95534,94943,1543,95512);break}default:{qw(d);d=0;break b}}while(0);c[d+8>>2]=v;}while(0);U1(B);}else d=0;return d|0}function Mw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0.0,L=0.0,M=0.0;F=c[a+20>>2]|0;G=c[a+24>>2]|0;H=c[b+20>>2]|0;B=c[b+24>>2]|0;C=c[d+20>>2]|0;D=c[d+24>>2]|0;E=c[a+32>>2]|0;if(!((E|0)==1?(E|0)==(c[b+32>>2]|0):0))qa(95005,94943,1574,95559);E=c[a>>2]|0;if(((((c[a+4>>2]|0)==(c[b>>2]|0)?(c[b+4>>2]|0)==(c[d>>2]|0):0)?(q=c[a+16>>2]|0,(q|0)==(c[b+16>>2]|0)):0)?(q|0)==(c[d+16>>2]|0):0)?(p=d+4|0,I=KK(c[p>>2]<<2)|0,(I|0)!=0):0){e=0;while(1){if((e|0)>=(c[p>>2]|0)){f=0;e=0;break}c[I+(e<<2)>>2]=-1;e=e+1|0;}a:while(1){if((e|0)>=(E|0))break;m=e+1|0;n=F+(m<<2)|0;o=-2-e|0;l=c[F+(e<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0)){e=m;continue a}j=c[G+(l<<2)>>2]|0;k=H+(j+1<<2)|0;j=c[H+(j<<2)>>2]|0;while(1){if((j|0)>=(c[k>>2]|0))break;g=c[B+(j<<2)>>2]|0;i=C+(g+1<<2)|0;g=c[C+(g<<2)>>2]|0;while(1){if((g|0)>=(c[i>>2]|0))break;e=I+(c[D+(g<<2)>>2]<<2)|0;if((c[e>>2]|0)!=(o|0)){c[e>>2]=o;f=f+1|0;}g=g+1|0;}j=j+1|0;}l=l+1|0;}}e=rw(E,c[p>>2]|0,f,q,1)|0;b:do if(!e)e=0;else {y=c[e+20>>2]|0;z=c[e+24>>2]|0;c:do switch(q|0){case 1:{v=c[a+28>>2]|0;u=c[b+28>>2]|0;d=c[d+28>>2]|0;r=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;d:while(1){if((f|0)>=(E|0)){A=g;break c}s=f+1|0;t=F+(s<<2)|0;b=y+(f<<2)|0;q=c[F+(f<<2)>>2]|0;while(1){if((q|0)>=(c[t>>2]|0))break;o=c[G+(q<<2)>>2]|0;p=H+(o+1<<2)|0;a=v+(q<<3)|0;o=c[H+(o<<2)>>2]|0;while(1){if((o|0)>=(c[p>>2]|0))break;l=c[B+(o<<2)>>2]|0;m=C+(l+1<<2)|0;n=u+(o<<3)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[m>>2]|0))break;f=D+(l<<2)|0;i=c[f>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[b>>2]|0)){c[j>>2]=g;c[z+(g<<2)>>2]=c[f>>2];h[r+(g<<3)>>3]=+h[n>>3]*+h[a>>3]*+h[d+(l<<3)>>3];g=g+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break d;x=r+(k<<3)|0;h[x>>3]=+h[x>>3]+ +h[n>>3]*+h[a>>3]*+h[d+(l<<3)>>3];}l=l+1|0;}o=o+1|0;}q=q+1|0;}c[y+(s<<2)>>2]=g;f=s;}qa(95582,94943,1642,95559);break}case 2:{x=c[a+28>>2]|0;w=c[b+28>>2]|0;r=c[d+28>>2]|0;s=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;e:while(1){if((g|0)>=(E|0)){A=f;break c}t=g+1|0;u=F+(t<<2)|0;v=y+(g<<2)|0;a=c[F+(g<<2)>>2]|0;while(1){if((a|0)>=(c[u>>2]|0))break;m=c[G+(a<<2)>>2]|0;q=H+(m+1<<2)|0;d=a<<1;b=x+(d<<3)|0;d=x+((d|1)<<3)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[q>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;p=m<<1;o=w+(p<<3)|0;p=w+((p|1)<<3)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[v>>2]|0)){c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];K=+h[b>>3];L=+h[o>>3];J=+h[d>>3];M=+h[p>>3];j=l<<1;i=r+(j<<3)|0;j=r+((j|1)<<3)|0;k=f<<1;h[s+(k<<3)>>3]=(L*K-M*J)*+h[i>>3]-(M*K+J*L)*+h[j>>3];L=+h[b>>3];J=+h[p>>3];K=+h[d>>3];M=+h[o>>3];h[s+((k|1)<<3)>>3]=(M*K+J*L)*+h[i>>3]+(M*L-K*J)*+h[j>>3];f=f+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break e;L=+h[b>>3];K=+h[o>>3];M=+h[d>>3];J=+h[p>>3];j=l<<1;i=r+(j<<3)|0;j=r+((j|1)<<3)|0;k=k<<1;g=s+(k<<3)|0;h[g>>3]=+h[g>>3]+(K*L-J*M)*+h[i>>3]-(J*L+M*K)*+h[j>>3];K=+h[b>>3];M=+h[p>>3];L=+h[d>>3];J=+h[o>>3];k=s+((k|1)<<3)|0;h[k>>3]=(J*L+M*K)*+h[i>>3]+(J*K-L*M)*+h[j>>3]+ +h[k>>3];}l=l+1|0;}m=m+1|0;}a=a+1|0;}c[y+(t<<2)>>2]=f;g=t;}qa(95582,94943,1674,95559);break}case 4:{v=c[a+28>>2]|0;u=c[b+28>>2]|0;b=c[d+28>>2]|0;d=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;f:while(1){if((g|0)>=(E|0)){A=f;break c}r=g+1|0;s=F+(r<<2)|0;t=y+(g<<2)|0;p=c[F+(g<<2)>>2]|0;while(1){if((p|0)>=(c[s>>2]|0))break;m=c[G+(p<<2)>>2]|0;a=H+(m+1<<2)|0;q=v+(p<<2)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[a>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;o=u+(m<<2)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[t>>2]|0)){c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];w=O(c[o>>2]|0,c[q>>2]|0)|0;w=O(w,c[b+(l<<2)>>2]|0)|0;x=d+(f<<2)|0;c[x>>2]=(c[x>>2]|0)+w;f=f+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break f;w=O(c[o>>2]|0,c[q>>2]|0)|0;w=O(w,c[b+(l<<2)>>2]|0)|0;x=d+(k<<2)|0;c[x>>2]=(c[x>>2]|0)+w;}l=l+1|0;}m=m+1|0;}p=p+1|0;}c[y+(r<<2)>>2]=f;g=r;}qa(95582,94943,1706,95559);break}case 8:{c[y>>2]=0;f=0;g=0;g:while(1){if((g|0)>=(E|0)){A=f;break c}a=g+1|0;q=F+(a<<2)|0;b=y+(g<<2)|0;o=c[F+(g<<2)>>2]|0;while(1){if((o|0)>=(c[q>>2]|0))break;m=c[G+(o<<2)>>2]|0;p=H+(m+1<<2)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[p>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)>=(c[b>>2]|0)){if((c[z+(k<<2)>>2]|0)!=(i|0))break g}else {c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];f=f+1|0;}l=l+1|0;}m=m+1|0;}o=o+1|0;}c[y+(a<<2)>>2]=f;g=a;}qa(95582,94943,1729,95559);break}default:{qw(e);e=0;break b}}while(0);c[e+8>>2]=A;}while(0);U1(I);}else e=0;return e|0}function Nw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;if((c[a+32>>2]|0)!=2)qa(95100,94943,1971,95607);if((b|0)>=1){h=c[a+8>>2]|0;g=h+b|0;if((g|0)>=(c[a+12>>2]|0))Ow(a,g+10|0)|0;i=h<<2;g=b<<2;W6((c[a+20>>2]|0)+i|0,d|0,g|0)|0;W6((c[a+24>>2]|0)+i|0,e|0,g|0)|0;g=c[a+40>>2]|0;if(g|0){i=O(g,b)|0;h=O(g,h)|0;W6((c[a+28>>2]|0)+h|0,f|0,i|0)|0;}f=a+4|0;h=0;while(1){if((h|0)>=(b|0))break;g=c[d+(h<<2)>>2]|0;if((g|0)>=(c[a>>2]|0))c[a>>2]=g+1;g=c[e+(h<<2)>>2]|0;if((g|0)>=(c[f>>2]|0))c[f>>2]=g+1;h=h+1|0;}i=a+8|0;c[i>>2]=(c[i>>2]|0)+b;}return a|0}function Ow(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if((c[a+32>>2]|0)==2){d=a+20|0;f=b<<2;c[d>>2]=MK(c[d>>2]|0,f)|0;d=a+24|0;c[d>>2]=MK(c[d>>2]|0,f)|0;d=c[a+40>>2]|0;if((d|0)>0){f=a+28|0;e=c[f>>2]|0;d=O(d,b)|0;if(!e)d=KK(d)|0;else d=MK(e,d)|0;c[f>>2]=d;}}else {d=a+24|0;c[d>>2]=MK(c[d>>2]|0,b<<2)|0;d=c[a+40>>2]|0;if((d|0)>0){f=a+28|0;e=c[f>>2]|0;d=O(d,b)|0;if(!e)d=KK(d)|0;else d=MK(e,d)|0;c[f>>2]=d;}}c[a+12>>2]=b;return a|0}function Pw(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;a:do if(!a)a=0;else {l=c[a+20>>2]|0;k=c[a+24>>2]|0;b:do switch(c[a+16>>2]|0){case 1:{i=c[a+28>>2]|0;e=c[a>>2]|0;b=0;c:while(1){if((b|0)>=(e|0))break b;f=b+1|0;g=c[l+(f<<2)>>2]|0;b=c[l+(b<<2)>>2]|0;d=1.0/+(g-b|0);while(1){if((b|0)>=(g|0)){b=f;continue c}k=i+(b<<3)|0;h[k>>3]=+h[k>>3]*d;b=b+1|0;}}}case 2:{f=c[a+28>>2]|0;g=c[a>>2]|0;b=0;d:while(1){if((b|0)>=(g|0))break b;i=b+1|0;j=c[l+(i<<2)>>2]|0;e=c[l+(b<<2)>>2]|0;d=1.0/+(j-e|0);while(1){if((e|0)>=(j|0)){b=i;continue d}if((c[k+(e<<2)>>2]|0)!=(b|0)){m=e<<1;n=f+(m<<3)|0;h[n>>3]=+h[n>>3]*d;m=f+((m|1)<<3)|0;h[m>>3]=+h[m>>3]*d;}e=e+1|0;}}}case 4:{qa(138394,94943,2192,95648);break}case 8:break;default:{a=0;break a}}while(0)}while(0);return a|0}function Qw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((a|0)!=0?(b=a+8|0,d=c[b>>2]|0,e=c[a+4>>2]|0,(e|0)==(c[a>>2]|0)):0){g=c[a+24>>2]|0;a=c[a+20>>2]|0;f=rw(e,e,d,8,1)|0;W6(c[f+20>>2]|0,a|0,(e<<2)+4|0)|0;W6(c[f+24>>2]|0,g|0,d<<2|0)|0;c[f+8>>2]=c[b>>2];a=vw(f,1)|0;qw(f);a=Bw(a)|0;e=a+8|0;d=KK(c[e>>2]<<3)|0;c[a+28>>2]=d;e=c[e>>2]|0;b=0;while(1){if((b|0)>=(e|0))break;h[d+(b<<3)>>3]=1.0;b=b+1|0;}c[a+16>>2]=1;c[a+40>>2]=8;}else a=0;return a|0}function Rw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;v=c[a+4>>2]|0;n=c[a>>2]|0;r=v<<2;s=KK(r)|0;t=KK(r+4|0)|0;u=KK(r)|0;r=KK(r)|0;o=t+4|0;a=0;while(1){if((a|0)>=(v|0))break;c[s+(a<<2)>>2]=0;a=a+1|0;}c[o>>2]=v;a=0;while(1){if((a|0)>=(v|0)){h=1;k=0;break}c[u+(a<<2)>>2]=-1;a=a+1|0;}a:while(1){if((k|0)>=(n|0))break;g=p+(k<<2)|0;l=k+1|0;m=p+(l<<2)|0;a=c[g>>2]|0;while(1){f=c[m>>2]|0;if((a|0)>=(f|0))break;j=o+(c[s+(c[q+(a<<2)>>2]<<2)>>2]<<2)|0;c[j>>2]=(c[j>>2]|0)+-1;a=a+1|0;}a=h;j=c[g>>2]|0;while(1){if((j|0)>=(f|0)){h=a;k=l;continue a}h=q+(j<<2)|0;f=s+(c[h>>2]<<2)|0;i=c[f>>2]|0;g=u+(i<<2)|0;if((c[g>>2]|0)<(k|0)){c[g>>2]=k;f=o+(i<<2)|0;if(!(c[f>>2]|0)){c[f>>2]=1;g=a;a=i;f=r+(i<<2)|0;}else {c[r+(i<<2)>>2]=a;c[o+(a<<2)>>2]=1;g=a+1|0;f=s+(c[h>>2]<<2)|0;}c[f>>2]=a;a=g;}else {i=r+(i<<2)|0;c[f>>2]=c[i>>2];i=o+(c[i>>2]<<2)|0;c[i>>2]=(c[i>>2]|0)+1;}j=j+1|0;f=c[m>>2]|0;}}c[t>>2]=0;a=0;f=0;while(1){if((a|0)>=(h|0))break;p=a+1|0;o=t+(p<<2)|0;q=(c[o>>2]|0)+f|0;c[o>>2]=q;a=p;f=q;}c[d>>2]=r;a=0;while(1){if((a|0)>=(v|0)){a=h;break}q=t+(c[s+(a<<2)>>2]<<2)|0;d=c[q>>2]|0;c[q>>2]=d+1;c[r+(d<<2)>>2]=a;a=a+1|0;}while(1){if((a|0)<=0)break;v=a+-1|0;c[t+(a<<2)>>2]=c[t+(v<<2)>>2];a=v;}c[t>>2]=0;c[e>>2]=t;c[b>>2]=h;U1(u);U1(s);return}function Sw(){return +(+(x5()|0)*4.656612875245797e-10)}function Tw(a){a=a|0;if((a|0)>1)return (x5()|0)%(a|0)|0|0;else qa(95682,95688,58,95698);return 0}function Uw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;a:do if((a|0)<1)b=0;else {b=KK(a<<2)|0;d=0;while(1){if((d|0)==(a|0))break;c[b+(d<<2)>>2]=d;d=d+1|0;}while(1){if((a|0)<=1)break a;e=Tw(a)|0;d=a+-1|0;g=b+(d<<2)|0;f=c[g>>2]|0;e=b+(e<<2)|0;c[g>>2]=c[e>>2];c[e>>2]=f;a=d;}}while(0);return b|0}function Vw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=0;while(1){if((d|0)>=(a|0))break;e=c+(d<<3)|0;h[e>>3]=+h[b+(d<<3)>>3]-+h[e>>3];d=d+1|0;}return c|0}function Ww(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0,f=0.0;d=0;e=0.0;while(1){if((d|0)>=(a|0))break;f=+h[c+(d<<3)>>3]*+h[b+(d<<3)>>3]+e;d=d+1|0;e=f;}return +e}function Xw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=c+(e<<3)|0;h[f>>3]=+h[f>>3]*d+ +h[b+(e<<3)>>3];e=e+1|0;}return c|0}function Yw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=b+(e<<3)|0;h[f>>3]=+h[c+(e<<3)>>3]*d+ +h[f>>3];e=e+1|0;}return b|0}function Zw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,g=0.0;f=O(c,b)|0;d=O(d,b)|0;e=0.0;c=0;while(1){if((c|0)>=(b|0))break;g=+h[a+(c+f<<3)>>3]-+h[a+(c+d<<3)>>3];e=g*g+e;c=c+1|0;}g=+C(+e);return +(g>1.0e-15?g:1.0e-15)}function _w(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,g=0.0;f=O(c,b)|0;d=O(d,b)|0;e=0.0;c=0;while(1){if((c|0)>=(b|0))break;g=+h[a+(c+f<<3)>>3]-+h[a+(c+d<<3)>>3];e=g*g+e;c=c+1|0;}return +(+C(+e))}function $w(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0.0;d=0.0;e=0;while(1){if((e|0)>=(c|0))break;f=+h[a+(e<<3)>>3]-+h[b+(e<<3)>>3];d=f*f+d;e=e+1|0;}return +(+C(+d))}function ax(a,b,c,d,e,f,g){a=+a;b=+b;c=+c;d=+d;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0.0;p=l;l=l+80|0;n=p+48|0;m=p+24|0;o=p;i=0;while(1){if((i|0)>=(f|0)){j=0;break}q=+h[g+(i<<3)>>3];h[n+(i<<3)>>3]=q;h[m+(i<<3)>>3]=q;i=i+1|0;}while(1){if((j|0)>=(e|0))break;k=O(j,f)|0;i=0;while(1){if((i|0)>=(f|0))break;s=+h[g+(i+k<<3)>>3];r=n+(i<<3)|0;q=+h[r>>3];h[r>>3]=s>3];h[r>>3]=s>q?s:q;i=i+1|0;}j=j+1|0;}q=+h[m>>3]-+h[n>>3];c=q!=0.0?(c-a)/q:1.0;q=+h[m+8>>3]-+h[n+8>>3];s=(d-b)/q;c=q!=0.0?(c>3]=a;h[o+8>>3]=b;h[o+16>>3]=0.0;j=0;while(1){if((j|0)>=(e|0))break;k=O(j,f)|0;i=0;while(1){if((i|0)>=(f|0))break;r=g+(i+k<<3)|0;h[r>>3]=(+h[r>>3]-+h[n+(i<<3)>>3])*c+ +h[o+(i<<3)>>3];i=i+1|0;}j=j+1|0;}l=p;return}function bx(a,b){a=a|0;b=b|0;if((tB(a)|0)==1){a=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}else {cx(a);if(!((dP(QA(b,95704)|0)|0)<<24>>24))b=My(a,186208)|0;else b=dx(a)|0;Vy(a,b,186208);ex(b);}return}function cx(a){a=a|0;var b=0;b=xC(c[c[(c[(jC(a)|0)+16>>2]|0)+112>>2]>>2]|0)|0;a=c[46925]|0;if((b|0)!=(a|0)){c[46555]=0;c[46925]=b;c[46926]=GA(b,0,95713,0)|0;c[46927]=GA(c[46925]|0,1,95721,0)|0;c[46928]=GA(c[46925]|0,1,95738,0)|0;a=c[46925]|0;}c[46929]=QA(a,95738)|0;Gy(186208);c[46554]=1;h[23280]=+_O(c[46925]|0,c[46926]|0,1.0,0.0);c[46556]=c[46927];c[46557]=c[46928];c[46558]=c[46929];return}function dx(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+144|0;e=f;d=f+8|0;b=c[46555]|0;c[46555]=b+1;c[e>>2]=b;m4(d,96234,e)|0;d=Hy(ND(a,d,1)|0)|0;e=d+8|0;b=jC(a)|0;while(1){if(!b)break;oC(c[e>>2]|0,b,1)|0;c[(c[(c[b+16>>2]|0)+112>>2]|0)+12>>2]=d;b=kC(a,b)|0;}l=f;return d|0}function ex(a){a=a|0;Uy(a);return}function fx(a,b){a=a|0;b=b|0;var d=0;d=KK(32)|0;c[d>>2]=4;h[d+8>>3]=.75;c[d+16>>2]=1073741824;c[d+20>>2]=1;c[d+24>>2]=a;c[d+28>>2]=b;return d|0}function gx(a){a=a|0;U1(a);return}function hx(a){a=a|0;var b=0,d=0;if(!a)return;d=c[a+8>>2]|0;do if(d|0){if(c[a>>2]|0){qw(d);b=c[a+12>>2]|0;if(!b)break;qw(b);break}if(c[a+36>>2]|0?(qw(d),b=c[a+12>>2]|0,b|0):0)qw(b);}while(0);qw(c[a+16>>2]|0);qw(c[a+20>>2]|0);b=c[a+24>>2]|0;if(b|0?(c[a>>2]|0)>0:0)U1(b);hx(c[a+28>>2]|0);U1(a);return}function ix(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0;v=l;l=l+32|0;n=v+16|0;o=v+12|0;p=v+8|0;q=v+4|0;r=v;c[n>>2]=a;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[i>>2]=0;c[j>>2]=0;c[b>>2]=0;c[g>>2]=0;c[e>>2]=0;s=k+28|0;t=k+8|0;u=+(c[a+4>>2]|0);f=d;do{jx(a,n,f,o,0,r,p,q,k,m);f=c[n>>2]|0;if(!f)break;d=c[f+4>>2]|0;f=c[i>>2]|0;if(!f){c[i>>2]=c[p>>2];c[j>>2]=c[q>>2];}else {a=Lw(f,c[p>>2]|0)|0;qw(c[i>>2]|0);qw(c[p>>2]|0);c[i>>2]=a;a=Lw(c[q>>2]|0,c[j>>2]|0)|0;qw(c[j>>2]|0);qw(c[q>>2]|0);c[j>>2]=a;}f=c[b>>2]|0;if(f|0)qw(f);c[b>>2]=c[n>>2];f=c[e>>2]|0;if(f|0)qw(f);f=c[o>>2]|0;c[e>>2]=f;a=c[g>>2]|0;if(a){U1(a);f=c[o>>2]|0;}c[g>>2]=c[r>>2];a=c[n>>2]|0;c[r>>2]=0;if(!(+h[t>>3]*u<+(d|0)))break}while((c[s>>2]|0)==1);l=v;return}function jx(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+32|0;D=H+28|0;q=H+24|0;B=H+20|0;E=H+16|0;o=H+12|0;F=H+8|0;G=H+4|0;v=H;c[D>>2]=0;c[q>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[b>>2]=0;c[e>>2]=0;c[i>>2]=0;c[j>>2]=0;C=c[a>>2]|0;p=k+24|0;c[m>>2]=c[p>>2];n=c[p>>2]|0;a:do switch(n|0){case 12:{c[p>>2]=3;c[m>>2]=3;jx(a,b,d,e,f,g,i,j,k,m);if((((c[b>>2]|0)==0?(c[p>>2]=4,c[m>>2]=4,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0)?(c[p>>2]=6,c[m>>2]=6,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0)?(c[p>>2]=9,c[m>>2]=9,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0){c[p>>2]=2;c[m>>2]=2;jx(a,b,d,e,f,g,i,j,k,m);}c[p>>2]=12;p=0;q=0;k=0;o=0;n=0;m=0;break}case 9:case 10:{d=c[k+20>>2]|0;if((n|0)==9)qx(a,d,E,o,B);else rx(a,d,E,o,B);u=c[a+20>>2]|0;v=c[a+24>>2]|0;t=c[o>>2]|0;if(!(c[k+28>>2]|0)){if((t|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(t|0)){p=0;q=0;k=0;o=0;n=0;m=0;break a}}else if((t|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break a}if((t|0)>=(c[k>>2]|0)){z=c[B>>2]|0;y=z<<2;x=KK(y)|0;y=KK(y)|0;z=KK(z<<3)|0;c[B>>2]=0;s=c[E>>2]|0;r=0;o=0;b:while(1){if((r|0)>=(C|0))break;d=s+(r<<2)|0;if((c[d>>2]|0)!=-1){c[x+(o<<2)>>2]=r;c[y+(c[B>>2]<<2)>>2]=c[d>>2];q=c[B>>2]|0;k=q+1|0;c[B>>2]=k;h[z+(q<<3)>>3]=1.0;r=r+1|0;o=k;continue}n=c[u+(r<<2)>>2]|0;q=r+1|0;k=u+(q<<2)|0;p=c[k>>2]|0;d=0;m=n;while(1){if((m|0)>=(p|0))break;d=((c[s+(c[v+(m<<2)>>2]<<2)>>2]|0)>>>31^1)+d|0;m=m+1|0;}w=1.0/+(d|0);d=p;while(1){if((n|0)>=(d|0)){r=q;continue b}m=v+(n<<2)|0;if((c[s+(c[m>>2]<<2)>>2]|0)>-1){c[x+(o<<2)>>2]=r;c[y+(c[B>>2]<<2)>>2]=c[s+(c[m>>2]<<2)>>2];d=c[B>>2]|0;m=d+1|0;c[B>>2]=m;h[z+(d<<3)>>3]=w;d=c[k>>2]|0;}else m=o;n=n+1|0;o=m;}}C=Dw(o,C,t,x,y,z,1,8)|0;c[i>>2]=C;C=pw(C)|0;c[j>>2]=C;i=Mw(C,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=z;q=y;k=x;o=x;n=y;m=z;}else {Jw(c[j>>2]|0,f,g,0);p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;c[e>>2]=0;p=z;q=y;k=x;o=x;n=y;m=z;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}break}case 5:{A=26;break}case 1:{m=k+20|0;nx(a,c[m>>2]|0,D,q);d=c[p>>2]|0;if((d|0)==2){d=m;A=24;}else A=25;break}case 2:{d=k+20|0;A=24;break}case 3:{kx(a,c[k+20>>2]|0,F,G,v);A=12;break}case 4:{lx(a,c[k+20>>2]|0,F,G,v);A=12;break}case 6:{mx(a,F,G,v);A=12;break}default:{p=0;q=0;k=0;o=0;n=0;m=0;}}while(0);do if((A|0)==12){r=c[v>>2]|0;if(!(c[k+28>>2]|0)){if((r|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(r|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}}else if((r|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}if((r|0)>=(c[k>>2]|0)){t=C<<2;s=KK(t)|0;t=KK(t)|0;u=KK(C<<3)|0;c[B>>2]=0;o=c[G>>2]|0;p=c[F>>2]|0;n=0;d=0;c:while(1){if((n|0)>=(c[v>>2]|0))break;q=n+1|0;k=o+(q<<2)|0;m=c[o+(n<<2)>>2]|0;while(1){if((m|0)>=(c[k>>2]|0)){n=q;continue c}c[s+(d<<2)>>2]=c[p+(m<<2)>>2];c[t+(c[B>>2]<<2)>>2]=n;y=c[B>>2]|0;z=y+1|0;c[B>>2]=z;h[u+(y<<3)>>3]=1.0;m=m+1|0;d=z;}}C=Dw(d,C,r,s,t,u,1,8)|0;c[i>>2]=C;c[j>>2]=pw(C)|0;c[e>>2]=0;i=Mw(c[j>>2]|0,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=u;q=t;k=s;o=s;n=t;m=u;}else {Jw(c[j>>2]|0,f,g,0);c[j>>2]=Pw(c[j>>2]|0)|0;p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;p=u;q=t;k=s;o=s;n=t;m=u;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}}else if((A|0)==24){ox(a,c[d>>2]|0,D,q);d=c[p>>2]|0;A=25;}while(0);if((A|0)==25)if((d|0)==5)A=26;else A=27;if((A|0)==26){px(a,c[k+20>>2]|0,D,q);A=27;}do if((A|0)==27){d=c[q>>2]|0;if(!(c[k+28>>2]|0)){if((d|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(d|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}}else if((d|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}if((d|0)>=(c[k>>2]|0)){s=C<<2;r=KK(s)|0;s=KK(s)|0;t=KK(C<<3)|0;c[B>>2]=0;q=c[D>>2]|0;d=0;p=0;while(1){if((p|0)>=(C|0))break;m=q+(p<<2)|0;n=c[m>>2]|0;if((n|0)>-1){c[r+(c[B>>2]<<2)>>2]=p;c[s+(c[B>>2]<<2)>>2]=d;A=c[B>>2]|0;o=A+1|0;c[B>>2]=o;h[t+(A<<3)>>3]=1.0;if((n|0)!=(p|0)){c[r+(o<<2)>>2]=c[m>>2];c[s+(c[B>>2]<<2)>>2]=d;A=c[B>>2]|0;c[B>>2]=A+1;h[t+(A<<3)>>3]=1.0;c[q+(c[m>>2]<<2)>>2]=-1;}c[m>>2]=-1;d=d+1|0;}p=p+1|0;}C=Dw(c[B>>2]|0,C,d,r,s,t,1,8)|0;c[i>>2]=C;C=pw(C)|0;c[j>>2]=C;i=Mw(C,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=t;q=s;k=r;o=r;n=s;m=t;}else {Jw(c[j>>2]|0,f,g,0);c[j>>2]=Pw(c[j>>2]|0)|0;p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;c[e>>2]=0;p=t;q=s;k=r;o=r;n=s;m=t;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}}while(0);d=c[D>>2]|0;if(d|0)U1(d);d=c[E>>2]|0;if(d|0)U1(d);if(k|0)U1(o);if(q|0)U1(n);if(p|0)U1(m);d=c[F>>2]|0;if(d|0)U1(d);d=c[G>>2]|0;if(d|0)U1(d);l=H;return}function kx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;t=c[a+20>>2]|0;u=c[a+24>>2]|0;w=c[a>>2]|0;v=w<<2;c[d>>2]=KK(v)|0;c[e>>2]=KK(v+4|0)|0;v=KK(v)|0;g=0;while(1){if((g|0)>=(w|0))break;c[v+(g<<2)>>2]=g;g=g+1|0;}c[f>>2]=0;r=c[e>>2]|0;c[r>>2]=0;s=c[a+28>>2]|0;a:do if(!b){g=0;a=0;b:while(1){while(1){if((a|0)>=(w|0)){a=0;j=0.0;b=0;break b}b=a;a=a+1|0;if((c[v+(b<<2)>>2]|0)==-1)continue;b=c[t+(b<<2)>>2]|0;if(((c[t+(a<<2)>>2]|0)-b|0)==1)break}l=c[u+(b<<2)>>2]|0;c[v+(l<<2)>>2]=-1;m=c[d>>2]|0;c[m+(g<<2)>>2]=l;n=t+(l+1<<2)|0;k=c[t+(l<<2)>>2]|0;g=g+1|0;while(1){if((k|0)>=(c[n>>2]|0))break;b=u+(k<<2)|0;i=c[b>>2]|0;if((l|0)!=(i|0)?((c[t+(i+1<<2)>>2]|0)-(c[t+(i<<2)>>2]|0)|0)==1:0){c[v+(i<<2)>>2]=-1;c[m+(g<<2)>>2]=c[b>>2];g=g+1|0;}k=k+1|0;}b=c[f>>2]|0;i=c[r+(b<<2)>>2]|0;if((g-i|0)<5){e=b+1|0;c[f>>2]=e;c[r+(e<<2)>>2]=g;continue}i=i+1|0;b=b+1|0;c[f>>2]=b;c[r+(b<<2)>>2]=i;b=i;while(1){if(!((i|0)<(g|0)&(b|0)<(g|0)))continue b;e=i+3|0;e=(g|0)<(e|0)?g:e;q=(c[f>>2]|0)+1|0;c[f>>2]=q;c[r+(q<<2)>>2]=e;b=b+1|0;i=e;}}c:while(1){do{n=b;while(1){if((n|0)>=(w|0)){a=0;break c}p=v+(n<<2)|0;i=c[p>>2]|0;if((i|0)!=-1)break;n=n+1|0;}b=n+1|0;q=c[t+(b<<2)>>2]|0;l=1;m=c[t+(n<<2)>>2]|0;while(1){if((m|0)>=(q|0))break;k=c[u+(m<<2)>>2]|0;if((n|0)!=(k|0)?(c[v+(k<<2)>>2]|0)!=-1:0)if((i|0)!=-1){o=+h[s+(m<<3)>>3];if((l|0)==0?!(o>j):0)l=0;else {l=0;a=k;j=o;}}else i=-1;m=m+1|0;}}while((l|0)!=0);c[v+(a<<2)>>2]=-1;c[p>>2]=-1;q=c[d>>2]|0;c[q+(g<<2)>>2]=n;e=g+2|0;c[q+(g+1<<2)>>2]=a;q=(c[f>>2]|0)+1|0;c[f>>2]=q;c[r+(q<<2)>>2]=e;g=e;}while(1){if((a|0)>=(w|0))break a;if((c[v+(a<<2)>>2]|0)==(a|0)){u=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[r+(g<<2)>>2]=u;g=u;}a=a+1|0;}}else {r=Uw(w)|0;n=0;g=0;while(1){if((n|0)>=(w|0)){q=0;a=0;j=0.0;break}a=c[r+(n<<2)>>2]|0;d:do if((c[v+(a<<2)>>2]|0)!=-1?(p=c[t+(a<<2)>>2]|0,((c[t+(a+1<<2)>>2]|0)-p|0)==1):0){k=c[u+(p<<2)>>2]|0;c[v+(k<<2)>>2]=-1;l=c[d>>2]|0;c[l+(g<<2)>>2]=k;m=t+(k+1<<2)|0;i=c[t+(k<<2)>>2]|0;g=g+1|0;while(1){if((i|0)>=(c[m>>2]|0))break;a=u+(i<<2)|0;b=c[a>>2]|0;if((k|0)!=(b|0)?((c[t+(b+1<<2)>>2]|0)-(c[t+(b<<2)>>2]|0)|0)==1:0){c[v+(b<<2)>>2]=-1;c[l+(g<<2)>>2]=c[a>>2];g=g+1|0;}i=i+1|0;}i=c[e>>2]|0;a=c[f>>2]|0;b=c[i+(a<<2)>>2]|0;if((g-b|0)<5){q=a+1|0;c[f>>2]=q;c[i+(q<<2)>>2]=g;break}b=b+1|0;a=a+1|0;c[f>>2]=a;c[i+(a<<2)>>2]=b;a=b;while(1){if(!((b|0)<(g|0)&(a|0)<(g|0)))break d;q=b+3|0;q=(g|0)<(q|0)?g:q;m=(c[f>>2]|0)+1|0;c[f>>2]=m;c[i+(m<<2)>>2]=q;a=a+1|0;b=q;}}while(0);n=n+1|0;}while(1){if((q|0)>=(w|0)){a=0;break}m=c[r+(q<<2)>>2]|0;n=v+(m<<2)|0;b=c[n>>2]|0;if((b|0)!=-1){p=c[t+(m+1<<2)>>2]|0;k=1;l=c[t+(m<<2)>>2]|0;while(1){if((l|0)>=(p|0))break;i=c[u+(l<<2)>>2]|0;if((m|0)!=(i|0)?(c[v+(i<<2)>>2]|0)!=-1:0)if((b|0)!=-1){o=+h[s+(l<<3)>>3];if((k|0)==0?!(o>j):0)k=0;else {k=0;a=i;j=o;}}else b=-1;l=l+1|0;}if(!k){c[v+(a<<2)>>2]=-1;c[n>>2]=-1;n=c[d>>2]|0;c[n+(g<<2)>>2]=m;p=g+2|0;c[n+(g+1<<2)>>2]=a;n=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[n+(g<<2)>>2]=p;g=p;}}q=q+1|0;}while(1){if((a|0)>=(w|0))break;if((c[v+(a<<2)>>2]|0)==(a|0)){u=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;t=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[t+(g<<2)>>2]=u;g=u;}a=a+1|0;}U1(r);}while(0);U1(v);return}function lx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+16|0;q=A+8|0;y=A+4|0;z=A;c[y>>2]=0;c[z>>2]=0;v=c[a+20>>2]|0;u=c[a+24>>2]|0;w=c[a>>2]|0;x=w<<2;c[d>>2]=KK(x)|0;c[e>>2]=KK(x+4|0)|0;x=KK(x)|0;g=0;while(1){if((g|0)>=(w|0))break;c[x+(g<<2)>>2]=g;g=g+1|0;}Rw(a,q,y,z);c[f>>2]=0;s=c[e>>2]|0;c[s>>2]=0;t=c[a+28>>2]|0;g=0;a=0;a:while(1){k=c[q>>2]|0;m=c[z>>2]|0;do{if((a|0)>=(k|0))break a;n=a;a=a+1|0;p=m+(a<<2)|0;j=c[p>>2]|0;n=c[m+(n<<2)>>2]|0;}while((j-n|0)<2);m=c[y>>2]|0;k=c[s+(c[f>>2]<<2)>>2]|0;while(1){if((n|0)>=(j|0))break;r=m+(n<<2)|0;c[x+(c[r>>2]<<2)>>2]=-1;j=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=c[r>>2];if((j-k|0)>3){g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[s+(g<<2)>>2]=j;g=j;}else g=k;k=g;n=n+1|0;g=j;j=c[p>>2]|0;}if((g|0)<=(k|0))continue;r=(c[f>>2]|0)+1|0;c[f>>2]=r;c[s+(r<<2)>>2]=g;}b:do if(!b){a=0;i=0.0;j=0;c:while(1){do{b=j;while(1){if((b|0)>=(w|0)){a=0;break c}q=x+(b<<2)|0;k=c[q>>2]|0;if((k|0)!=-1)break;b=b+1|0;}j=b+1|0;r=c[v+(j<<2)>>2]|0;n=1;p=c[v+(b<<2)>>2]|0;while(1){if((p|0)>=(r|0))break;m=c[u+(p<<2)>>2]|0;if((b|0)!=(m|0)?(c[x+(m<<2)>>2]|0)!=-1:0)if((k|0)!=-1){o=+h[t+(p<<3)>>3];if((n|0)==0?!(o>i):0)n=0;else {n=0;a=m;i=o;}}else k=-1;p=p+1|0;}}while((n|0)!=0);c[x+(a<<2)>>2]=-1;c[q>>2]=-1;r=c[d>>2]|0;c[r+(g<<2)>>2]=b;e=g+2|0;c[r+(g+1<<2)>>2]=a;r=(c[f>>2]|0)+1|0;c[f>>2]=r;c[s+(r<<2)>>2]=e;g=e;}while(1){if((a|0)>=(w|0))break b;if((c[x+(a<<2)>>2]|0)==(a|0)){v=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[s+(g<<2)>>2]=v;g=v;}a=a+1|0;}}else {s=Uw(w)|0;r=0;a=0;i=0.0;while(1){if((r|0)>=(w|0)){a=0;break}p=c[s+(r<<2)>>2]|0;b=x+(p<<2)|0;j=c[b>>2]|0;if((j|0)!=-1){q=c[v+(p+1<<2)>>2]|0;m=1;n=c[v+(p<<2)>>2]|0;while(1){if((n|0)>=(q|0))break;k=c[u+(n<<2)>>2]|0;if((p|0)!=(k|0)?(c[x+(k<<2)>>2]|0)!=-1:0)if((j|0)!=-1){o=+h[t+(n<<3)>>3];if((m|0)==0?!(o>i):0)m=0;else {m=0;a=k;i=o;}}else j=-1;n=n+1|0;}if(!m){c[x+(a<<2)>>2]=-1;c[b>>2]=-1;b=c[d>>2]|0;c[b+(g<<2)>>2]=p;q=g+2|0;c[b+(g+1<<2)>>2]=a;b=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[b+(g<<2)>>2]=q;g=q;}}r=r+1|0;}while(1){if((a|0)>=(w|0))break;if((c[x+(a<<2)>>2]|0)==(a|0)){v=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;u=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[u+(g<<2)>>2]=v;g=v;}a=a+1|0;}U1(s);}while(0);U1(c[y>>2]|0);U1(c[z>>2]|0);U1(x);l=A;return}function mx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;r=c[a+20>>2]|0;s=c[a+24>>2]|0;v=c[a>>2]|0;u=v<<2;c[b>>2]=KK(u)|0;c[d>>2]=KK(u+4|0)|0;u=KK(u)|0;q=KK(v<<4)|0;f=0;while(1){if((f|0)>=(v|0))break;c[u+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=0;c[c[d>>2]>>2]=0;p=c[a+28>>2]|0;t=Uw(v)|0;f=0;m=0;while(1){if((m|0)>=(v|0)){o=0;break}a=c[t+(m<<2)>>2]|0;a:do if((c[u+(a<<2)>>2]|0)!=-1?(n=c[r+(a<<2)>>2]|0,((c[r+(a+1<<2)>>2]|0)-n|0)==1):0){j=c[s+(n<<2)>>2]|0;c[u+(j<<2)>>2]=-1;k=c[b>>2]|0;c[k+(f<<2)>>2]=j;l=r+(j+1<<2)|0;i=c[r+(j<<2)>>2]|0;f=f+1|0;while(1){if((i|0)>=(c[l>>2]|0))break;a=s+(i<<2)|0;g=c[a>>2]|0;if((j|0)!=(g|0)?((c[r+(g+1<<2)>>2]|0)-(c[r+(g<<2)>>2]|0)|0)==1:0){c[u+(g<<2)>>2]=-1;c[k+(f<<2)>>2]=c[a>>2];f=f+1|0;}i=i+1|0;}i=c[d>>2]|0;a=c[e>>2]|0;g=c[i+(a<<2)>>2]|0;if((f-g|0)<5){o=a+1|0;c[e>>2]=o;c[i+(o<<2)>>2]=f;break}g=g+1|0;a=a+1|0;c[e>>2]=a;c[i+(a<<2)>>2]=g;a=g;while(1){if(!((g|0)<(f|0)&(a|0)<(f|0)))break a;o=g+3|0;o=(f|0)<(o|0)?f:o;l=(c[e>>2]|0)+1|0;c[e>>2]=l;c[i+(l<<2)>>2]=o;a=a+1|0;g=o;}}while(0);m=m+1|0;}while(1){if((o|0)>=(v|0)){a=0;break}m=c[t+(o<<2)>>2]|0;n=u+(m<<2)|0;a=c[n>>2]|0;if((a|0)!=-1){l=c[r+(m+1<<2)>>2]|0;g=0;k=c[r+(m<<2)>>2]|0;while(1){if((k|0)>=(l|0))break;j=c[s+(k<<2)>>2]|0;if((m|0)!=(j|0)?(c[u+(j<<2)>>2]|0)!=-1:0){i=g<<1;if((a|0)==-1)a=-1;else {h[q+(i<<3)>>3]=+(j|0);h[q+((i|1)<<3)>>3]=+h[p+(k<<3)>>3];g=g+1|0;}}k=k+1|0;}if((g|0)>0){o4(q,g,16,81);g=(g|0)<3?g:3;a=0;while(1){if((a|0)>=(g|0))break;l=~~+h[q+(a<<1<<3)>>3];c[u+(l<<2)>>2]=-1;c[(c[b>>2]|0)+(f<<2)>>2]=l;a=a+1|0;f=f+1|0;}c[n>>2]=-1;n=f+1|0;c[(c[b>>2]|0)+(f<<2)>>2]=m;m=c[d>>2]|0;f=(c[e>>2]|0)+1|0;c[e>>2]=f;c[m+(f<<2)>>2]=n;f=n;}}o=o+1|0;}while(1){if((a|0)>=(v|0))break;if((c[u+(a<<2)>>2]|0)==(a|0)){s=f+1|0;c[(c[b>>2]|0)+(f<<2)>>2]=a;r=c[d>>2]|0;f=(c[e>>2]|0)+1|0;c[e>>2]=f;c[r+(f<<2)>>2]=s;f=s;}a=a+1|0;}U1(t);U1(u);return}function nx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;r=c[a>>2]|0;f=c[a+4>>2]|0;k=KK(r<<2)|0;c[d>>2]=k;a=0;while(1){if((a|0)>=(r|0))break;c[k+(a<<2)>>2]=a;a=a+1|0;}c[e>>2]=f;a:do if(!b){f=0;b:while(1){if((f|0)>=(r|0))break a;b=f+1|0;g=p+(b<<2)|0;h=k+(f<<2)|0;i=k+(f<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[g>>2]|0)){f=b;continue b}j=q+(a<<2)|0;d=c[j>>2]|0;if(((f|0)!=(d|0)?(o=k+(d<<2)|0,(c[o>>2]|0)==(d|0)):0)?(c[h>>2]|0)==(f|0):0){c[o>>2]=f;c[i>>2]=c[j>>2];c[e>>2]=(c[e>>2]|0)+-1;}a=a+1|0;}}}else {b=Uw(r)|0;a=0;while(1){if((a|0)>=(r|0))break;g=c[b+(a<<2)>>2]|0;h=p+(g+1<<2)|0;f=c[p+(g<<2)>>2]|0;while(1){if((f|0)>=(c[h>>2]|0))break;i=q+(f<<2)|0;j=c[i>>2]|0;if(((g|0)!=(j|0)?(l=c[d>>2]|0,m=l+(j<<2)|0,(c[m>>2]|0)==(j|0)):0)?(n=l+(g<<2)|0,(c[n>>2]|0)==(g|0)):0){c[m>>2]=g;c[n>>2]=c[i>>2];c[e>>2]=(c[e>>2]|0)+-1;}f=f+1|0;}a=a+1|0;}U1(b);}while(0);return}function ox(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=c[a+20>>2]|0;s=c[a+24>>2]|0;t=c[a>>2]|0;g=c[a+4>>2]|0;o=KK(t<<2)|0;c[d>>2]=o;f=0;while(1){if((f|0)>=(t|0))break;c[o+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=g;q=c[a+28>>2]|0;a:do if(!b){f=0;i=0.0;k=0;while(1){if((k|0)>=(t|0))break a;l=k+1|0;m=c[r+(l<<2)>>2]|0;n=o+(k<<2)|0;g=1;b=c[r+(k<<2)>>2]|0;while(1){if((b|0)>=(m|0))break;a=c[s+(b<<2)>>2]|0;if(((k|0)!=(a|0)?(c[o+(a<<2)>>2]|0)==(a|0):0)?(c[n>>2]|0)==(k|0):0){j=+h[q+(b<<3)>>3];if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(g|0){k=l;continue}c[o+(f<<2)>>2]=k;c[o+(k<<2)>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;k=l;}}else {p=Uw(t)|0;o=0;f=0;i=0.0;while(1){if((o|0)>=(t|0))break;k=c[p+(o<<2)>>2]|0;l=c[d>>2]|0;m=l+(k<<2)|0;if((c[m>>2]|0)==(k|0)){n=c[r+(k+1<<2)>>2]|0;b=c[r+(k<<2)>>2]|0;g=1;while(1){if((b|0)>=(n|0))break;a=c[s+(b<<2)>>2]|0;if((k|0)!=(a|0)?(c[l+(a<<2)>>2]|0)==(a|0):0){j=+h[q+(b<<3)>>3];if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(!g){c[l+(f<<2)>>2]=k;c[m>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;}}o=o+1|0;}U1(p);}while(0);return}function px(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;s=c[a+20>>2]|0;t=c[a+24>>2]|0;u=c[a>>2]|0;g=c[a+4>>2]|0;p=KK(u<<2)|0;c[d>>2]=p;f=0;while(1){if((f|0)>=(u|0))break;c[p+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=g;r=c[a+28>>2]|0;a:do if(!b){f=0;i=0.0;k=0;while(1){if((k|0)>=(u|0))break a;b=c[s+(k<<2)>>2]|0;l=k+1|0;m=c[s+(l<<2)>>2]|0;n=p+(k<<2)|0;o=+(m-b|0);g=1;while(1){if((b|0)>=(m|0))break;a=c[t+(b<<2)>>2]|0;if(((k|0)!=(a|0)?(c[p+(a<<2)>>2]|0)==(a|0):0)?(c[n>>2]|0)==(k|0):0){j=+h[r+(b<<3)>>3]/(+((c[s+(a+1<<2)>>2]|0)-(c[s+(a<<2)>>2]|0)|0)*o);if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(g|0){k=l;continue}c[p+(f<<2)>>2]=k;c[p+(k<<2)>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;k=l;}}else {q=Uw(u)|0;p=0;f=0;i=0.0;while(1){if((p|0)>=(u|0))break;k=c[q+(p<<2)>>2]|0;l=c[d>>2]|0;m=l+(k<<2)|0;if((c[m>>2]|0)==(k|0)){b=c[s+(k<<2)>>2]|0;n=c[s+(k+1<<2)>>2]|0;o=+(n-b|0);g=1;while(1){if((b|0)>=(n|0))break;a=c[t+(b<<2)>>2]|0;if((k|0)!=(a|0)?(c[l+(a<<2)>>2]|0)==(a|0):0){j=+h[r+(b<<3)>>3]/(+((c[s+(a+1<<2)>>2]|0)-(c[s+(a<<2)>>2]|0)|0)*o);if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(!g){c[l+(f<<2)>>2]=k;c[m>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;}}p=p+1|0;}U1(q);}while(0);return}function qx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[a+20>>2]|0;n=c[a+24>>2]|0;l=c[a>>2]|0;j=KK(l<<2)|0;c[d>>2]=j;a=0;while(1){if((a|0)>=(l|0))break;c[j+(a<<2)>>2]=-100;a=a+1|0;}c[e>>2]=0;c[f>>2]=0;a:do if(!b){b=0;b:while(1){if((b|0)>=(l|0))break a;if((c[j+(b<<2)>>2]|0)!=-100){b=b+1|0;continue}g=c[e>>2]|0;c[e>>2]=g+1;c[j+(b<<2)>>2]=g;g=b+1|0;h=m+(g<<2)|0;a=c[m+(b<<2)>>2]|0;while(1){if((a|0)>=(c[h>>2]|0)){b=g;continue b}i=c[n+(a<<2)>>2]|0;if((b|0)!=(i|0)){c[j+(i<<2)>>2]=-1;c[f>>2]=(c[f>>2]|0)+1;}a=a+1|0;}}}else {i=Uw(l)|0;h=0;while(1){if((h|0)>=(l|0))break;j=c[i+(h<<2)>>2]|0;k=c[d>>2]|0;a=k+(j<<2)|0;c:do if((c[a>>2]|0)==-100){b=c[e>>2]|0;c[e>>2]=b+1;c[a>>2]=b;b=m+(j+1<<2)|0;a=c[m+(j<<2)>>2]|0;while(1){if((a|0)>=(c[b>>2]|0))break c;g=c[n+(a<<2)>>2]|0;if((j|0)!=(g|0)){c[k+(g<<2)>>2]=-1;c[f>>2]=(c[f>>2]|0)+1;}a=a+1|0;}}while(0);h=h+1|0;}U1(i);}while(0);c[f>>2]=(c[f>>2]|0)+(c[e>>2]|0);return}function rx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;n=q+4|0;o=q;p=c[a+20>>2]|0;m=c[a+24>>2]|0;h=c[a>>2]|0;a=KK(h<<2)|0;c[d>>2]=a;g=0;while(1){c[n>>2]=g;if((g|0)>=(h|0))break;c[a+(g<<2)>>2]=-100;g=(c[n>>2]|0)+1|0;}c[e>>2]=0;c[f>>2]=0;k=xx(h,(h<<1)+-2|0)|0;a:do if(!b){a=0;while(1){c[n>>2]=a;if((a|0)>=(h|0))break a;j=a+1|0;zx(k,a,(c[p+(j<<2)>>2]|0)-(c[p+(a<<2)>>2]|0)|0)|0;a=j;}}else {g=Uw(h)|0;a=0;while(1){if((a|0)>=(h|0))break;j=c[g+(a<<2)>>2]|0;c[n>>2]=j;zx(k,j,(c[p+(j+1<<2)>>2]|0)-(c[p+(j<<2)>>2]|0)|0)|0;a=a+1|0;}U1(g);}while(0);b:while(1){j=(Ax(k,n,o)|0)==0;a=c[e>>2]|0;if(j)break;c[e>>2]=a+1;c[(c[d>>2]|0)+(c[n>>2]<<2)>>2]=a;a=c[n>>2]|0;j=c[p+(a<<2)>>2]|0;while(1){if((j|0)>=(c[p+(a+1<<2)>>2]|0))continue b;i=c[m+(j<<2)>>2]|0;if((a|0)!=(i|0)){c:do if((c[(c[d>>2]|0)+(i<<2)>>2]|0)==-100){Cx(k,i)|0;c[(c[d>>2]|0)+(i<<2)>>2]=-1;g=p+(i+1<<2)|0;a=c[p+(i<<2)>>2]|0;while(1){if((a|0)>=(c[g>>2]|0))break c;b=m+(a<<2)|0;h=c[b>>2]|0;if((i|0)!=(h|0)?(c[(c[d>>2]|0)+(h<<2)>>2]|0)==-100:0){h=Bx(k,h)|0;c[o>>2]=h;zx(k,c[b>>2]|0,h+1|0)|0;}a=a+1|0;}}while(0);c[f>>2]=(c[f>>2]|0)+1;a=c[n>>2]|0;}j=j+1|0;}}c[f>>2]=(c[f>>2]|0)+a;yx(k);l=q;return}function sx(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a+8>>3];c=+h[b+8>>3];return (d>c?-1:d>2]|0)==1:0)f=a;else f=Qw(a)|0;do if(!b)b=0;else {if(ww(b,0)|0?(c[b+16>>2]|0)==1:0)break;b=Aw(b,0)|0;}while(0);d=ux(f,b,d)|0;b=vx(d,e)|0;if((f|0)!=(a|0))c[d+36>>2]=1;return b|0}function ux(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(!a)a=0;else {e=KK(44)|0;c[e>>2]=0;c[e+4>>2]=c[a+4>>2];c[e+8>>2]=a;c[e+12>>2]=b;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=d;c[e+28>>2]=0;c[e+32>>2]=0;c[e+36>>2]=0;a=e;}return a|0}function vx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;e=k+20|0;f=k+16|0;g=k+12|0;h=k+8|0;i=k+4|0;j=k;c[f>>2]=0;if((c[a>>2]|0)<((c[b+16>>2]|0)+-1|0)?(ix(c[a+8>>2]|0,i,c[a+12>>2]|0,j,0,f,g,h,b,e),d=c[i>>2]|0,d|0):0){i=c[j>>2]|0;j=ux(d,i,c[f>>2]|0)|0;c[a+28>>2]=j;c[j+40>>2]=c[e>>2];c[j>>2]=(c[a>>2]|0)+1;c[j+4>>2]=c[d>>2];c[j+8>>2]=d;c[j+12>>2]=i;c[j+16>>2]=c[g>>2];c[a+20>>2]=c[h>>2];c[j+32>>2]=a;vx(j,b)|0;}l=k;return a|0}function wx(a){a=a|0;var b=0;while(1){b=c[a+28>>2]|0;if(!b)break;else a=b;}return a|0}function xx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=KK(28)|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=b;c[f+12>>2]=-1;e=f+16|0;c[e>>2]=KK((b<<2)+4|0)|0;d=0;while(1){if((d|0)>(b|0))break;c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0;}b=(a<<2)+4|0;e=f+20|0;c[e>>2]=KK(b)|0;d=0;while(1){if((d|0)>(a|0))break;c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0;}b=KK(b)|0;c[f+24>>2]=b;d=0;while(1){if((d|0)>(a|0))break;c[b+(d<<2)>>2]=-999;d=d+1|0;}return f|0}function yx(a){a=a|0;var b=0,d=0,e=0,f=0;if(a|0){e=a+16|0;b=c[e>>2]|0;if(b|0){f=a+8|0;d=0;while(1){if((d|0)>(c[f>>2]|0))break;Cy(c[b+(d<<2)>>2]|0,105);d=d+1|0;b=c[e>>2]|0;}U1(b);}b=c[a+20>>2]|0;if(b|0)U1(b);U1(c[a+24>>2]|0);U1(a);}return}function zx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;g=a+8|0;j=a+20|0;i=a+24|0;k=a+16|0;if(!a)qa(138953,95743,69,95759);while(1){if((c[g>>2]|0)<(d|0)){h=4;break}e=(c[j>>2]|0)+(b<<2)|0;f=c[e>>2]|0;if(!f)break;l=c[(c[i>>2]|0)+(b<<2)>>2]|0;c[e>>2]=0;c[a>>2]=(c[a>>2]|0)+-1;Fy(f,105,(c[k>>2]|0)+(l<<2)|0);}if((h|0)==4)qa(95778,95743,70,95759);c[a>>2]=(c[a>>2]|0)+1;e=a+12|0;if((c[e>>2]|0)<(d|0))c[e>>2]=d;c[(c[i>>2]|0)+(b<<2)>>2]=d;e=KK(4)|0;c[e>>2]=b;f=c[(c[k>>2]|0)+(d<<2)>>2]|0;if(!f)e=By(e)|0;else e=Dy(f,e)|0;c[(c[j>>2]|0)+(b<<2)>>2]=e;c[(c[k>>2]|0)+(d<<2)>>2]=e;return a|0}function Ax(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((a|0)!=0?(c[a>>2]|0)>=1:0){f=a+12|0;e=c[f>>2]|0;c[d>>2]=e;c[a>>2]=(c[a>>2]|0)+-1;d=a+16|0;g=c[(c[d>>2]|0)+(e<<2)>>2]|0;c[b>>2]=c[(Ey(g)|0)>>2];Fy(g,105,(c[d>>2]|0)+(e<<2)|0);d=c[d>>2]|0;if(!(c[d+(e<<2)>>2]|0)){while(1){if((e|0)<=-1)break;if(c[d+(e<<2)>>2]|0)break;e=e+-1|0;}c[f>>2]=e;}e=c[b>>2]|0;c[(c[a+20>>2]|0)+(e<<2)>>2]=0;c[(c[a+24>>2]|0)+(e<<2)>>2]=-999;e=1;}else e=0;return e|0}function Bx(a,b){a=a|0;b=b|0;return c[(c[a+24>>2]|0)+(b<<2)>>2]|0}function Cx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;if((a|0)!=0?(e=c[a>>2]|0,(e|0)>=1):0){h=a+24|0;d=c[(c[h>>2]|0)+(b<<2)>>2]|0;c[a>>2]=e+-1;f=a+20|0;e=a+16|0;Fy(c[(c[f>>2]|0)+(b<<2)>>2]|0,105,(c[e>>2]|0)+(d<<2)|0);a=a+12|0;if((d|0)==(c[a>>2]|0)?(g=c[e>>2]|0,(c[g+(d<<2)>>2]|0)==0):0){while(1){if((d|0)<=-1)break;if(c[g+(d<<2)>>2]|0)break;d=d+-1|0;}c[a>>2]=d;}c[(c[f>>2]|0)+(b<<2)>>2]=0;c[(c[h>>2]|0)+(b<<2)>>2]=-999;d=1;}else d=0;return d|0}function Dx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;if(!(ww(a,0)|0))qa(95795,95831,260,95846);w=xw(a)|0;x=c[w+20>>2]|0;y=c[w+24>>2]|0;e=w+16|0;a=w+28|0;if((c[e>>2]|0)==1)v=c[a>>2]|0;else {U1(c[a>>2]|0);c[e>>2]=1;v=KK(c[w+8>>2]<<3)|0;c[a>>2]=v;}r=KK(c[w>>2]<<2)|0;a=0;while(1){e=c[w>>2]|0;if((a|0)>=(e|0)){q=0;a=e;break}c[r+(a<<2)>>2]=-1;a=a+1|0;}a:while(1){if((q|0)>=(a|0)){g=0.0;k=0.0;f=0;u=0;t=a;break}p=q+1|0;i=x+(p<<2)|0;m=x+(q<<2)|0;j=(c[i>>2]|0)-(c[m>>2]|0)|0;c[r+(q<<2)>>2]=q;e=c[m>>2]|0;while(1){o=c[i>>2]|0;if((e|0)>=(o|0))break;a=c[y+(e<<2)>>2]|0;if((q|0)!=(a|0))c[r+(a<<2)>>2]=q;e=e+1|0;}n=+(j|0);e=c[m>>2]|0;while(1){if((e|0)>=(o|0))break;a=c[y+(e<<2)>>2]|0;if((q|0)!=(a|0)){i=c[x+(a+1<<2)>>2]|0;a=c[x+(a<<2)>>2]|0;l=+(i-a|0)+n;while(1){if((a|0)>=(i|0))break;l=(c[r+(c[y+(a<<2)>>2]<<2)>>2]|0)==(q|0)?l+-1.0:l;a=a+1|0;}h[v+(e<<3)>>3]=l;if(!(l>0.0)){s=23;break a}}e=e+1|0;}q=p;a=c[w>>2]|0;}if((s|0)==23)qa(95868,95831,290,95846);while(1){if((u|0)>=(t|0))break;i=u+1|0;j=x+(i<<2)|0;e=c[x+(u<<2)>>2]|0;while(1){if((e|0)>=(c[j>>2]|0))break;a=c[y+(e<<2)>>2]|0;if((u|0)==(a|0))a=f;else {k=+_w(d,b,u,a)+k;g=+h[v+(e<<3)>>3]+g;a=f+1|0;}f=a;e=e+1|0;}u=i;t=c[w>>2]|0;}n=+(f|0);g=k/(g/n*n);a=0;b:while(1){if((a|0)>=(t|0))break;i=a+1|0;j=c[x+(i<<2)>>2]|0;e=c[x+(a<<2)>>2]|0;while(1){if((e|0)>=(j|0)){a=i;continue b}f=v+(e<<3)|0;if((a|0)!=(c[y+(e<<2)>>2]|0))h[f>>3]=+h[f>>3]*g;e=e+1|0;}}return w|0}function Ex(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0.0,S=0.0;L=c[a>>2]|0;M=c[a+20>>2]|0;N=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,333,95876);O=Dx(a,b,e)|0;P=KK(56)|0;Q=P+32|0;h[Q>>3]=1.0;c[P+20>>2]=0;c[P+24>>2]=0;h[P+40>>3]=.01;c[P+48>>2]=~~+C(+(+(c[a>>2]|0)));g=L<<3;I=KK(g)|0;c[P+12>>2]=I;a=0;while(1){if((a|0)>=(L|0))break;h[I+(a<<3)>>3]=d;a=a+1|0;}J=KK(L<<2)|0;H=KK(g)|0;j=0;while(1){if((j|0)>=(L|0)){n=0;break}k=H+(j<<3)|0;h[k>>3]=0.0;l=j+1|0;m=M+(l<<2)|0;i=c[M+(j<<2)>>2]|0;a=0;d=0.0;while(1){if((i|0)>=(c[m>>2]|0))break;g=c[N+(i<<2)>>2]|0;if((j|0)!=(g|0)){d=+_w(e,b,j,g);d=+h[k>>3]+d;h[k>>3]=d;a=a+1|0;}i=i+1|0;}if((a|0)<=0){p=14;break}h[k>>3]=d/+(a|0);j=l;}if((p|0)==14)qa(95908,95831,358,95876);while(1){if((n|0)>=(L|0)){a=0;l=0;break}c[J+(n<<2)>>2]=-1;n=n+1|0;}a:while(1){if((l|0)>=(L|0))break;c[J+(l<<2)>>2]=l;j=M+(l<<2)|0;m=l+1|0;n=M+(m<<2)|0;i=c[j>>2]|0;while(1){g=c[n>>2]|0;if((i|0)>=(g|0))break;g=J+(c[N+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(l|0)){c[g>>2]=l;a=a+1|0;}i=i+1|0;}k=c[j>>2]|0;while(1){if((k|0)>=(g|0)){l=m;continue a}i=c[N+(k<<2)>>2]|0;j=M+(i+1<<2)|0;i=c[M+(i<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break;g=J+(c[N+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(l|0)){c[g>>2]=l;a=a+1|0;}i=i+1|0;}k=k+1|0;g=c[n>>2]|0;}}g=a+L|0;F=P+4|0;c[F>>2]=rw(L,L,g,1,1)|0;g=rw(L,L,g,1,1)|0;G=P+8|0;c[G>>2]=g;a=c[F>>2]|0;do if(!((g|0)==0|(a|0)==0)){B=c[a+20>>2]|0;A=c[a+24>>2]|0;y=c[a+28>>2]|0;E=c[g+28>>2]|0;z=c[g+20>>2]|0;t=c[g+24>>2]|0;c[z>>2]=0;c[B>>2]=0;d=0.0;o=0.0;p=0;i=0;b:while(1){if((p|0)>=(L|0)){p=58;break}u=p+L|0;c[J+(p<<2)>>2]=u;k=M+(p<<2)|0;v=p+1|0;w=M+(v<<2)|0;x=H+(p<<3)|0;q=0.0;r=0.0;j=c[k>>2]|0;while(1){a=c[w>>2]|0;if((j|0)>=(a|0))break;g=c[N+(j<<2)>>2]|0;a=J+(g<<2)|0;if((c[a>>2]|0)!=(u|0)){c[a>>2]=u;c[A+(i<<2)>>2]=g;switch(f|0){case 0:{s=1.0;break}case 1:{s=(+h[H+(g<<3)>>3]+ +h[x>>3])*.5;break}case 2:{s=+D(+(+Zw(e,b,p,g)),.4);break}default:{p=42;break b}}S=-1.0/(s*s);h[y+(i<<3)>>3]=S;c[t+(i<<2)>>2]=g;R=S*s;n=E+(i<<3)|0;h[n>>3]=R;o=+_w(e,b,p,g)*R+o;R=+h[n>>3];i=i+1|0;q=S+q;r=R+r;d=R*s+d;}j=j+1|0;}n=c[k>>2]|0;while(1){if((n|0)>=(a|0))break;k=c[N+(n<<2)>>2]|0;l=M+(k+1<<2)|0;m=H+(k<<3)|0;j=c[M+(k<<2)>>2]|0;while(1){if((j|0)>=(c[l>>2]|0))break;g=N+(j<<2)|0;a=J+(c[g>>2]<<2)|0;if((c[a>>2]|0)!=(u|0)){c[a>>2]=u;switch(f|0){case 0:{s=2.0;break}case 1:{s=(+h[m>>3]*2.0+ +h[x>>3]+ +h[H+(c[g>>2]<<3)>>3])*.5;break}case 2:{s=+D(+(+Zw(e,b,p,c[g>>2]|0)),.4);break}default:{p=53;break b}}c[A+(i<<2)>>2]=c[g>>2];R=-1.0/(s*s);h[y+(i<<3)>>3]=R;c[t+(i<<2)>>2]=c[g>>2];S=R*s;a=E+(i<<3)|0;h[a>>3]=S;o=+_w(e,b,c[g>>2]|0,k)*S+o;S=+h[a>>3];i=i+1|0;q=R+q;r=S+r;d=S*s+d;}j=j+1|0;}n=n+1|0;a=c[w>>2]|0;}c[A+(i<<2)>>2]=p;x=I+(p<<3)|0;S=-(q*+h[x>>3]);h[x>>3]=S;h[y+(i<<3)>>3]=S-q;c[t+(i<<2)>>2]=p;h[E+(i<<3)>>3]=-r;i=i+1|0;c[B+(v<<2)>>2]=i;c[z+(v<<2)>>2]=i;p=v;}if((p|0)==42){U4(95915,29,1,c[15712]|0)|0;qa(138394,95831,418,95876);}else if((p|0)==53){U4(95915,29,1,c[15712]|0)|0;qa(138394,95831,460,95876);}else if((p|0)==58){d=o/d;a=0;while(1){if((a|0)>=(i|0))break;N=E+(a<<3)|0;h[N>>3]=+h[N>>3]*d;a=a+1|0;}h[Q>>3]=d;c[(c[F>>2]|0)+8>>2]=i;c[(c[G>>2]|0)+8>>2]=i;U1(J);U1(H);qw(O);K=P;break}}else {Fx(P);K=0;}while(0);return K|0}function Fx(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)qw(b);b=c[a+8>>2]|0;if(b|0)qw(b);b=c[a+12>>2]|0;if(b|0)U1(b);b=c[a+20>>2]|0;if(b|0)tb[c[a+16>>2]&127](b);U1(a);}return}function Gx(a,b,d,e,f,g){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0;K=c[a>>2]|0;if(ww(a,0)|0?(c[a+16>>2]|0)==1:0){k=O(K,b)|0;j=0.0;i=0;while(1){if((i|0)>=(k|0))break;q=+h[e+(i<<3)>>3];j=q*q+j;i=i+1|0;}a:do if(j==0.0){i=0;while(1){if((i|0)>=(k|0))break a;h[e+(i<<3)>>3]=+Sw()*72.0;i=i+1|0;}}while(0);F=c[a+20>>2]|0;G=c[a+24>>2]|0;H=c[a+28>>2]|0;i=KK(56)|0;J=i+32|0;h[J>>3]=1.0;c[i+20>>2]=0;c[i+24>>2]=0;c[i>>2]=a;h[i+40>>3]=.01;c[i+48>>2]=~~+C(+(+(c[a>>2]|0)));I=KK(K<<3)|0;c[i+12>>2]=I;k=0;while(1){if((k|0)>=(K|0))break;h[I+(k<<3)>>3]=d;k=k+1|0;}a=(c[a+8>>2]|0)+K|0;D=i+4|0;c[D>>2]=rw(K,K,a,1,1)|0;a=rw(K,K,a,1,1)|0;E=i+8|0;c[E>>2]=a;k=c[D>>2]|0;if(!((a|0)==0|(k|0)==0)){x=c[k+20>>2]|0;y=c[k+24>>2]|0;z=c[a+20>>2]|0;A=c[a+24>>2]|0;v=c[k+28>>2]|0;B=c[a+28>>2]|0;c[z>>2]=0;c[x>>2]=0;p=0.0;q=0.0;w=0;s=0;b:while(1){if((s|0)>=(K|0))break;t=s+1|0;u=F+(t<<2)|0;l=0.0;m=0.0;r=c[F+(s<<2)>>2]|0;o=p;d=q;a=w;while(1){if((r|0)>=(c[u>>2]|0))break;k=c[G+(r<<2)>>2]|0;if((k|0)==(s|0)){j=o;k=a;}else {c[y+(a<<2)>>2]=k;n=+h[H+(r<<3)>>3];switch(f|0){case 2:{j=n*n;j=j==0.0?-1.0e5:-1.0/j;break}case 1:{j=n*n==0.0?-1.0e5:-1.0/n;break}case 0:{j=-1.0;break}default:{L=23;break b}}h[v+(a<<3)>>3]=j;c[A+(a<<2)>>2]=k;M=j*n;N=B+(a<<3)|0;h[N>>3]=M;d=+_w(e,b,s,k)*M+d;M=+h[N>>3];l=j+l;m=M+m;j=M*n+o;k=a+1|0;}r=r+1|0;o=j;a=k;}c[y+(a<<2)>>2]=s;w=I+(s<<3)|0;p=-(l*+h[w>>3]);h[w>>3]=p;h[v+(a<<3)>>3]=p-l;c[A+(a<<2)>>2]=s;h[B+(a<<3)>>3]=-m;w=a+1|0;c[x+(t<<2)>>2]=w;c[z+(t<<2)>>2]=w;p=o;q=d;s=t;}if((L|0)==23)qa(138394,95831,591,96012);j=(g|0)==0?1.0:q/p;if(j==0.0)i=0;else {k=0;while(1){if((k|0)>=(w|0))break;N=B+(k<<3)|0;h[N>>3]=+h[N>>3]*j;k=k+1|0;}h[J>>3]=j;c[(c[D>>2]|0)+8>>2]=w;c[(c[E>>2]|0)+8>>2]=w;}}else {Fx(i);i=0;}return i|0}qa(95945,95831,525,96012);return 0}function Hx(a){a=a|0;Fx(a);return}function Ix(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;return +(+Jx(a,b,c,d,e))}function Jx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0;T=l;l=l+16|0;Q=T+12|0;S=T+8|0;n=T+4|0;k=T;m=c[a+4>>2]|0;i=c[a+8>>2]|0;c[Q>>2]=0;c[S>>2]=0;c[n>>2]=0;K=c[a+12>>2]|0;c[k>>2]=0;L=xw(i)|0;M=c[m>>2]|0;N=O(M,b)|0;g=N<<3;R=KK(g)|0;if((R|0)!=0?(P=O(b<<3,M)|0,W6(R|0,d|0,P|0)|0,J=KK(g)|0,c[S>>2]=J,(J|0)!=0):0){I=c[i+20>>2]|0;J=c[i+24>>2]|0;E=c[i+28>>2]|0;F=c[L+28>>2]|0;G=c[m+28>>2]|0;H=a+24|0;switch(c[H>>2]|0){case 1:{Kx(c[a+20>>2]|0,M,b,d,k,n);g=c[k>>2]|0;if(!g){A=0.0;B=0.0;g=0;}else {m=yw(m,g)|0;A=0.0;B=0.0;}break}case 2:{g=c[a+20>>2]|0;A=+h[g+8>>3];B=+h[g>>3];g=0;break}default:{A=0.0;B=0.0;g=0;}}y=(K|0)==0;z=a+40|0;x=a+48|0;i=c[n>>2]|0;j=1.0;k=0;a:while(1){w=k+1|0;if(!((k|0)<(e|0)&j>f))break;b:do if((c[H>>2]|0)==4){n=c[S>>2]|0;k=0;while(1){if((k|0)>=(M|0))break b;o=O(k,b)|0;a=0;while(1){if((a|0)>=(b|0))break;h[n+(a+o<<3)>>3]=0.0;a=a+1|0;}k=k+1|0;}}else {q=0;while(1){if((q|0)>=(M|0))break;u=q+1|0;v=I+(u<<2)|0;p=0.0;t=c[I+(q<<2)>>2]|0;k=-1;while(1){if((t|0)>=(c[v>>2]|0))break;n=J+(t<<2)|0;a=c[n>>2]|0;if((q|0)==(a|0))k=t;else {s=+_w(d,b,q,a);o=E+(t<<3)|0;r=+h[o>>3];if(r==0.0)r=0.0;else {if(s==0.0){r=r/+h[G+(t<<3)>>3]*.0001;a=0;while(1){if((a|0)>=(b|0))break;s=r*(+Sw()+.0001);U=d+((O(c[n>>2]|0,b)|0)+a<<3)|0;h[U>>3]=s+ +h[U>>3];a=a+1|0;}s=+_w(d,b,q,c[n>>2]|0);r=+h[o>>3];}r=r/s;}h[F+(t<<3)>>3]=r;p=r+p;}t=t+1|0;}if((k|0)<=-1){D=25;break a}h[F+(k<<3)>>3]=-p;q=u;}Gw(L,0,d,0,S,0,b);}while(0);c:do if(!y){n=c[S>>2]|0;k=0;while(1){if((k|0)>=(M|0))break c;o=K+(k<<3)|0;q=O(k,b)|0;a=0;while(1){if((a|0)>=(b|0))break;v=a+q|0;U=n+(v<<3)|0;h[U>>3]=+h[U>>3]+ +h[R+(v<<3)>>3]*+h[o>>3];a=a+1|0;}k=k+1|0;}}while(0);d:do switch(c[H>>2]|0){case 1:{k=c[S>>2]|0;a=0;while(1){if((a|0)>=(M|0)){D=50;break d}o=O(a,b)|0;n=0;while(1){if((n|0)>=(b|0))break;D=n+o|0;U=k+(D<<3)|0;h[U>>3]=+h[U>>3]+ +h[i+(D<<3)>>3];n=n+1|0;}a=a+1|0;}}case 2:{Lx(M,b,d,c[S>>2]|0,B,A);k=c[S>>2]|0;p=+h[z>>3];a=c[x>>2]|0;if((c[H>>2]|0)==2)Mx(m,B,b,d,k,p,a,Q);else D=51;break}default:{k=c[S>>2]|0;D=50;}}while(0);if((D|0)==50){p=+h[z>>3];a=c[x>>2]|0;D=51;}if((D|0)==51){D=0;+fy(m,b,d,k,p,a,0,Q);}if(c[Q>>2]|0)break;j=+Nx(M,b,d,c[S>>2]|0);j=j/+C(+(+Ww(N,d,d)));W6(d|0,c[S>>2]|0,P|0)|0;k=w;}if((D|0)==25)qa(96049,95831,895,96060);qw(L);if(g){qw(g);qw(m);}}else {qw(L);j=1.0;i=0;}U1(R);g=c[S>>2]|0;if(g|0)U1(g);if(i|0)U1(i);l=T;return +j}function Kx(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0,B=0.0;p=c[a+8>>2]|0;A=c[a+12>>2]|0;x=c[a+16>>2]|0;z=c[a+32>>2]|0;y=c[z+20>>2]|0;z=c[z+24>>2]|0;l=a+20|0;r=c[l>>2]|0;m=a+24|0;q=c[m>>2]|0;n=a+28|0;o=c[n>>2]|0;w=+h[a>>3];a:do if((p|2|0)==3){if(!r){if((q|0)!=0|(o|0)!=0)qa(96094,95831,692,96111);else {i=0;j=0;}while(1){if((i|0)>=(A|0))break;v=c[x+(i<<2)>>2]|0;s=+((c[y+(v+1<<2)>>2]|0)-(c[y+(v<<2)>>2]|0)|0)+1.0;i=i+1|0;j=j+~~(s*s)|0;}q=j<<2;r=KK(q)|0;c[l>>2]=r;q=KK(q)|0;c[m>>2]=q;o=KK(j<<3)|0;c[n>>2]=o;}u=0;a=0;while(1){if((u|0)>=(A|0))break;p=c[x+(u<<2)>>2]|0;t=y+(p<<2)|0;j=c[t>>2]|0;i=c[z+(j<<2)>>2]|0;j=c[z+(j+1<<2)>>2]|0;b:do if((i|0)!=(j|0)){B=+Zw(e,d,i,j);B=B*B;n=y+(p+1<<2)|0;s=+((c[n>>2]|0)-(c[t>>2]|0)|0);c[r+(a<<2)>>2]=p;c[q+(a<<2)>>2]=p;h[o+(a<<3)>>3]=w/B;k=s*s*B;s=-(w/(B*s));j=c[t>>2]|0;while(1){a=a+1|0;i=c[n>>2]|0;if((j|0)>=(i|0))break;c[r+(a<<2)>>2]=p;c[q+(a<<2)>>2]=c[z+(j<<2)>>2];h[o+(a<<3)>>3]=s;j=j+1|0;}k=w/k;m=c[t>>2]|0;while(1){if((m|0)>=(i|0))break b;l=c[z+(m<<2)>>2]|0;c[r+(a<<2)>>2]=l;c[q+(a<<2)>>2]=p;h[o+(a<<3)>>3]=s;j=c[t>>2]|0;while(1){a=a+1|0;i=c[n>>2]|0;if((j|0)>=(i|0))break;v=c[z+(j<<2)>>2]|0;c[r+(a<<2)>>2]=l;c[q+(a<<2)>>2]=v;h[o+(a<<3)>>3]=k;j=j+1|0;}m=m+1|0;}}while(0);u=u+1|0;}i=Dw(a,b,b,r,q,o,1,8)|0;a=0;}else {switch(p|0){case 2:case 4:break;default:{i=0;a=0;break a}}do if(!r)if((q|0)!=0|(o|0)!=0)qa(96094,95831,734,96111);else {u=A<<2;v=KK(u)|0;c[l>>2]=v;u=KK(u)|0;c[m>>2]=u;t=KK(A<<3)|0;c[n>>2]=t;break}else {t=o;u=q;v=r;}while(0);a=KK(O(b<<3,d)|0)|0;j=O(d,b)|0;i=0;while(1){if((i|0)>=(j|0)){o=0;break}h[a+(i<<3)>>3]=0.0;i=i+1|0;}while(1){if((o|0)>=(A|0))break;p=c[x+(o<<2)>>2]|0;l=y+(p<<2)|0;m=c[l>>2]|0;k=+Zw(e,d,c[z+(m<<2)>>2]|0,c[z+(m+1<<2)>>2]|0);c[v+(o<<2)>>2]=p;c[u+(o<<2)>>2]=p;k=w/k;h[t+(o<<3)>>3]=k;l=c[l>>2]|0;m=c[y+(p+1<<2)>>2]|0;p=O(p,d)|0;j=l;while(1){if((j|0)>=(m|0))break;n=O(c[z+(j<<2)>>2]|0,d)|0;i=0;while(1){if((i|0)>=(d|0))break;r=a+(i+p<<3)|0;h[r>>3]=+h[r>>3]+ +h[e+(i+n<<3)>>3];i=i+1|0;}j=j+1|0;}k=k*(1.0/+(m-l|0));i=0;while(1){if((i|0)>=(d|0))break;r=a+(i+p<<3)|0;h[r>>3]=k*+h[r>>3];i=i+1|0;}o=o+1|0;}i=Dw(o,b,b,v,u,t,1,8)|0;}while(0);c[f>>2]=i;c[g>>2]=a;return}function Lx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0;f=f*e;g=0;a:while(1){if((g|0)>=(a|0))break;l=g+1|0;m=O(g,b)|0;i=l;while(1){if((i|0)==(a|0)){g=l;continue a}k=O(i,b)|0;e=1.0/+Zw(c,b,g,i);j=0;while(1){if((j|0)>=(b|0))break;p=j+m|0;n=j+k|0;o=f*((+h[c+(p<<3)>>3]-+h[c+(n<<3)>>3])*e);p=d+(p<<3)|0;h[p>>3]=o+ +h[p>>3];n=d+(n<<3)|0;h[n>>3]=+h[n>>3]-o;j=j+1|0;}i=i+1|0;}}return}function Mx(a,b,d,e,f,g,h,i){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;i=i|0;var j=0,k=0;k=Wx(a,b)|0;j=$x(a,b)|0;+cy(k,j,c[a>>2]|0,d,e,f,g,h,i);return}function Nx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,l=0;f=0;i=0.0;while(1){if((f|0)>=(a|0))break;j=O(f,b)|0;e=0;g=0.0;while(1){if((e|0)>=(b|0))break;l=e+j|0;k=+h[d+(l<<3)>>3]-+h[c+(l<<3)>>3];e=e+1|0;g=k*k+g;}f=f+1|0;i=+C(+g)+i;}return +i}function Ox(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,E=0.0,F=0.0;A=c[a>>2]|0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,1034,96133);r=A<<3;B=KK(r)|0;j=0;while(1){if((j|0)>=(A|0))break;m=B+(j<<3)|0;h[m>>3]=0.0;n=j+1|0;o=p+(n<<2)|0;l=c[p+(j<<2)>>2]|0;g=0;k=0.0;while(1){if((l|0)>=(c[o>>2]|0))break;i=c[q+(l<<2)>>2]|0;if((j|0)!=(i|0)){k=+_w(e,b,j,i);k=+h[m>>3]+k;h[m>>3]=k;g=g+1|0;}l=l+1|0;}if((g|0)<=0){z=11;break}h[m>>3]=k/+(g|0);j=n;}if((z|0)==11)qa(95908,95831,1046,96133);g=KK(56)|0;y=g+32|0;h[y>>3]=1.0;c[g+20>>2]=0;c[g+24>>2]=0;h[g+40>>3]=.01;c[g+48>>2]=~~+C(+(+(c[a>>2]|0)));x=KK(r)|0;c[g+12>>2]=x;i=0;while(1){if((i|0)>=(A|0))break;h[x+(i<<3)>>3]=d;i=i+1|0;}do if((A|0)>2)if(!f){i=hy(A,b,e)|0;break}else {i=gy(A,b,e)|0;break}else i=xw(a)|0;while(0);f=g+4|0;c[f>>2]=yw(a,i)|0;qw(i);j=xw(c[f>>2]|0)|0;c[g+8>>2]=j;i=c[f>>2]|0;if((j|0)==0|(i|0)==0){Px(g);g=0;}else {r=c[i+20>>2]|0;q=c[i+24>>2]|0;p=c[i+28>>2]|0;f=c[j+28>>2]|0;v=0.0;w=0.0;m=0;while(1){if((m|0)>=(A|0))break;o=m+1|0;n=r+(o<<2)|0;u=0.0;d=0.0;j=-1;s=v;t=w;l=c[r+(m<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;i=c[q+(l<<2)>>2]|0;if((i|0)==(m|0)){k=u;i=l;}else {E=+D(+(+Zw(e,b,m,i)),.6);k=1.0/(E*E);h[p+(l<<3)>>3]=k;F=k*E;a=f+(l<<3)|0;h[a>>3]=F;t=F*+_w(e,b,m,i)+t;F=+h[a>>3];k=k+u;d=F+d;i=j;s=F*E+s;}u=k;j=i;l=l+1|0;}a=x+(m<<3)|0;k=-(u*+h[a>>3]);h[a>>3]=k;if((j|0)<=-1){z=31;break}h[p+(j<<3)>>3]=k-u;h[f+(j<<3)>>3]=-d;v=s;w=t;m=o;}if((z|0)==31)qa(96154,95831,1112,96133);k=w/v;j=c[r+(A<<2)>>2]|0;i=0;while(1){if((i|0)>=(j|0))break;A=f+(i<<3)|0;h[A>>3]=+h[A>>3]*k;i=i+1|0;}h[y>>3]=k;U1(B);}return g|0}function Px(a){a=a|0;Fx(a);return}function Qx(a,b,c){a=a|0;b=b|0;c=c|0;+Jx(a,b,c,50,.001);return}function Rx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;z=c[a>>2]|0;A=c[a+20>>2]|0;B=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,1149,96165);v=Dx(a,b,e)|0;w=c[v+28>>2]|0;a=KK(8)|0;x=KK(z<<2)|0;y=KK(z<<3)|0;i=0;while(1){if((i|0)>=(z|0)){o=0;break}l=y+(i<<3)|0;h[l>>3]=0.0;m=i+1|0;n=A+(m<<2)|0;j=c[A+(i<<2)>>2]|0;f=0;k=0.0;while(1){if((j|0)>=(c[n>>2]|0))break;g=c[B+(j<<2)>>2]|0;if((i|0)!=(g|0)){k=+_w(e,b,i,g);k=+h[l>>3]+k;h[l>>3]=k;f=f+1|0;}j=j+1|0;}if((f|0)<=0){p=11;break}h[l>>3]=k/+(f|0);i=m;}if((p|0)==11)qa(95908,95831,1167,96165);while(1){if((o|0)>=(z|0)){m=0;f=0;break}c[x+(o<<2)>>2]=-1;o=o+1|0;}a:while(1){if((m|0)>=(z|0))break;c[x+(m<<2)>>2]=m;j=A+(m<<2)|0;n=m+1|0;o=A+(n<<2)|0;i=c[j>>2]|0;while(1){g=c[o>>2]|0;if((i|0)>=(g|0))break;g=x+(c[B+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(m|0)){c[g>>2]=m;f=f+1|0;}i=i+1|0;}l=c[j>>2]|0;while(1){if((l|0)>=(g|0)){m=n;continue a}i=c[B+(l<<2)>>2]|0;j=A+(i+1<<2)|0;i=c[A+(i<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break;g=x+(c[B+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(m|0)){c[g>>2]=m;f=f+1|0;}i=i+1|0;}l=l+1|0;g=c[o>>2]|0;}}e=rw(z,z,f,1,1)|0;c[a>>2]=e;if(!e){Sx(a);a=0;}else {p=c[e+20>>2]|0;q=c[e+24>>2]|0;r=c[e+28>>2]|0;c[p>>2]=0;g=0;f=0;while(1){if((g|0)>=(z|0))break;s=g+z|0;c[x+(g<<2)>>2]=s;l=A+(g<<2)|0;t=g+1|0;u=A+(t<<2)|0;b=y+(g<<3)|0;j=c[l>>2]|0;while(1){g=c[u>>2]|0;if((j|0)>=(g|0))break;g=c[B+(j<<2)>>2]|0;i=x+(g<<2)|0;if((c[i>>2]|0)!=(s|0)){c[i>>2]=s;c[q+(f<<2)>>2]=g;o=r+(f<<3)|0;h[o>>3]=(+h[y+(g<<3)>>3]+ +h[b>>3])*.5;h[o>>3]=+h[w+(j<<3)>>3];f=f+1|0;}j=j+1|0;}o=c[l>>2]|0;while(1){if((o|0)>=(g|0))break;j=c[B+(o<<2)>>2]|0;l=A+(j+1<<2)|0;m=y+(j<<3)|0;n=w+(o<<3)|0;j=c[A+(j<<2)>>2]|0;while(1){if((j|0)>=(c[l>>2]|0))break;g=B+(j<<2)|0;i=x+(c[g>>2]<<2)|0;if((c[i>>2]|0)!=(s|0)){c[i>>2]=s;c[q+(f<<2)>>2]=c[g>>2];i=r+(f<<3)|0;h[i>>3]=(+h[m>>3]*2.0+ +h[b>>3]+ +h[y+(c[g>>2]<<3)>>3])*.5;h[i>>3]=+h[w+(j<<3)>>3]+ +h[n>>3];f=f+1|0;}j=j+1|0;}o=o+1|0;g=c[u>>2]|0;}c[p+(t<<2)>>2]=f;g=t;}c[e+8>>2]=f;A=Yp()|0;B=a+4|0;c[B>>2]=A;W6(A|0,d|0,168)|0;B=c[B>>2]|0;c[B+16>>2]=0;c[B+40>>2]=1;A=B+96|0;h[A>>3]=+h[A>>3]*.5;c[B+80>>2]=20;U1(x);U1(y);qw(v);}return a|0}function Sx(a){a=a|0;var b=0;if(a|0){b=c[a>>2]|0;if(b|0)qw(b);a=c[a+4>>2]|0;if(a|0)Zp(a);}return}function Tx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+16|0;h=g;c[h>>2]=0;sq(e,b,c[a>>2]|0,c[a+4>>2]|0,d,f,h);if(!(c[h>>2]|0)){l=g;return}else qa(96184,95831,1262,96190);}function Ux(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;c[g>>2]=0;g=c[d+120>>2]|0;a:do switch(g|0){case 5:case 6:{if((c[b>>2]|0)>2){b=Ox(b,a,0.0,f,(g|0)!=6&1)|0;Qx(b,a,f);Px(b);}break}case 4:{g=0;while(1){if((g|0)==1)break a;i=Rx(b,a,d,f)|0;Tx(i,b,e,a,f);Sx(i);g=g+1|0;}}case 1:{d=0;h=6;break}case 2:{d=1;h=6;break}case 3:{d=2;h=6;break}default:{}}while(0);b:do if((h|0)==6){g=0;while(1){if((g|0)==1)break b;i=Ex(b,a,.05,f,d)|0;+Jx(i,a,f,50,.001);Fx(i);g=g+1|0;}}while(0);return}function Vx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0,k=0;k=l;l=l+16|0;g=k;c[g>>2]=d;j=c[a>>2]|0;a=c[j+8>>2]|0;i=+h[j>>3];j=c[a>>2]|0;Jw(a,b,g,0);a=0;f=0.0;while(1){if((a|0)>=(j|0))break;e=+h[b+(a<<3)>>3]+f;a=a+1|0;f=e;}e=+(j|0);d=c[g>>2]|0;a=0;while(1){if((a|0)>=(j|0))break;g=d+(a<<3)|0;h[g>>3]=(+h[b+(a<<3)>>3]*e-f)*i+ +h[g>>3];a=a+1|0;}l=k;return d|0}function Wx(a,b){a=a|0;b=+b;var d=0,e=0;d=KK(8)|0;e=KK(16)|0;c[d>>2]=e;h[e>>3]=b;c[e+8>>2]=a;c[d+4>>2]=25;return d|0}function Xx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;c[e>>2]=d;Jw(c[a>>2]|0,b,e,0);l=f;return c[e>>2]|0}function Yx(a){a=a|0;var b=0;b=KK(8)|0;c[b>>2]=a;c[b+4>>2]=26;return b|0}function Zx(a){a=a|0;if(a|0)U1(a);return}function _x(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=c[a>>2]|0;e=~~+h[f>>3];f=f+8|0;a=0;while(1){if((a|0)>=(e|0))break;h[d+(a<<3)>>3]=+h[f+(a<<3)>>3]*+h[b+(a<<3)>>3];a=a+1|0;}return d|0}function $x(a,b){a=a|0;b=+b;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0.0,o=0,p=0,q=0.0;m=c[a>>2]|0;o=c[a+20>>2]|0;p=c[a+24>>2]|0;k=c[a+28>>2]|0;l=KK(8)|0;i=KK((m<<3)+8|0)|0;c[l>>2]=i;h[i>>3]=+(m|0);i=i+8|0;q=+(m+-1|0);j=1.0/q;b=q*b;a=0;a:while(1){if((a|0)>=(m|0))break;e=i+(a<<3)|0;h[e>>3]=j;f=a+1|0;g=c[o+(f<<2)>>2]|0;d=c[o+(a<<2)>>2]|0;while(1){if((d|0)>=(g|0)){a=f;continue a}if((a|0)==(c[p+(d<<2)>>2]|0)?(n=+h[k+(d<<3)>>3],(n>=0.0?n:-n)>0.0):0)h[e>>3]=1.0/(n+b);d=d+1|0;}}c[l+4>>2]=27;return l|0}function ay(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0;i=c[a>>2]|0;k=c[a+20>>2]|0;l=c[a+24>>2]|0;m=c[a+28>>2]|0;n=KK(8)|0;d=KK((c[a>>2]<<3)+8|0)|0;c[n>>2]=d;h[d>>3]=+(i|0);d=d+8|0;a=0;a:while(1){if((a|0)>=(i|0))break;e=d+(a<<3)|0;h[e>>3]=1.0;f=a+1|0;g=c[k+(f<<2)>>2]|0;b=c[k+(a<<2)>>2]|0;while(1){if((b|0)>=(g|0)){a=f;continue a}if((a|0)==(c[l+(b<<2)>>2]|0)?(j=+h[m+(b<<3)>>3],(j>=0.0?j:-j)>0.0):0)h[e>>3]=1.0/j;b=b+1|0;}}c[n+4>>2]=27;return n|0}function by(a){a=a|0;U1(c[a>>2]|0);if(a|0)U1(a);return}function cy(a,b,c,d,e,f,g,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;i=i|0;j=j|0;var k=0.0,l=0,m=0.0,n=0,o=0,p=0;o=c<<3;n=KK(o)|0;o=KK(o)|0;l=0;m=0.0;while(1){if((l|0)<(d|0))j=0;else break;while(1){if((j|0)>=(c|0))break;p=(O(j,d)|0)+l|0;h[n+(j<<3)>>3]=+h[e+(p<<3)>>3];h[o+(j<<3)>>3]=+h[f+(p<<3)>>3];j=j+1|0;}k=+dy(a,b,c,n,o,g,i);j=0;while(1){if((j|0)>=(c|0))break;h[f+((O(j,d)|0)+l<<3)>>3]=+h[n+(j<<3)>>3];j=j+1|0;}l=l+1|0;m=k+m;}U1(n);U1(o);return +m}function dy(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;var i=0,j=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0.0,t=0,u=0;r=c[a+4>>2]|0;p=c[b+4>>2]|0;q=d<<3;i=KK(q)|0;k=KK(q)|0;t=KK(q)|0;l=KK(q)|0;k=nb[r&63](a,e,k)|0;m=Vw(d,f,k)|0;o=+(d|0);s=+C(+(+Ww(d,m,m)))/o;n=s*g;o=1.0/o;m=0;f=t;j=1.0;g=s;while(1){if(!(g>n&(m|0)<(h|0)))break;i=nb[p&63](b,k,i)|0;g=+Ww(d,k,i);if((m|0)>0)Xw(d,i,f,g/j)|0;else W6(f|0,i|0,q|0)|0;u=nb[r&63](a,f,l)|0;j=g/+Ww(d,f,u);Yw(d,e,f,j)|0;t=Yw(d,k,u,-j)|0;m=m+1|0;j=g;l=u;g=+C(+(+Ww(d,t,t)))*o;}U1(i);U1(k);U1(f);U1(l);return +g}function ey(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+16|0;B=C;y=c[a+4>>2]|0;z=y<<3;A=KK(z)|0;u=KK(z)|0;v=KK(z)|0;w=c[a+20>>2]|0;x=c[a+24>>2]|0;s=c[a+28>>2]|0;t=c[15712]|0;r=0;while(1){if((r|0)<(b|0))g=0;else break;while(1){if((g|0)>=(y|0)){a=0;break}q=(O(g,b)|0)+r|0;h[A+(g<<3)>>3]=+h[d+(q<<3)>>3];h[v+(g<<3)>>3]=+h[e+(q<<3)>>3];g=g+1|0;}while(1){if((a|0)<(f|0))n=0;else {g=0;break}while(1){if((n|0)>=(y|0))break;o=c[w+(n<<2)>>2]|0;p=n+1|0;q=c[w+(p<<2)>>2]|0;m=o;j=0.0;i=0.0;while(1){if((m|0)>=(q|0))break;g=c[x+(m<<2)>>2]|0;k=+h[s+(m<<3)>>3];if((g|0)==(n|0))i=k;else j=+h[A+(g<<3)>>3]*k+j;m=m+1|0;}if(j==0.0){c[B>>2]=q-o;w4(t,96212,B)|0;}h[u+(n<<3)>>3]=(+h[v+(n<<3)>>3]-j)/i;n=p;}W6(A|0,u|0,z|0)|0;a=a+1|0;}while(1){if((g|0)>=(y|0))break;h[e+((O(g,b)|0)+r<<3)>>3]=+h[A+(g<<3)>>3];g=g+1|0;}r=r+1|0;}U1(A);U1(u);U1(v);l=C;return e|0}function fy(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=g|0;h=h|0;i=i|0;var j=0;j=c[a>>2]|0;c[i>>2]=0;switch(h|0){case 0:{h=Yx(a)|0;i=ay(a)|0;f=+cy(h,i,j,b,d,e,f,g,0);Zx(h);by(i);break}case 1:{ey(a,b,d,e,g,0)|0;f=0.0;break}default:f=0.0;}return +f}function gy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+32|0;k=o;m=o+20|0;f=o+16|0;g=o+12|0;i=o+8|0;h[k>>3]=1.0;j=a<<3;n=KK(j)|0;j=KK(j)|0;b=0;while(1){if((b|0)>=(a|0))break;e=b<<1;h[n+(b<<3)>>3]=+h[d+(e<<3)>>3];h[j+(b<<3)>>3]=+h[d+((e|1)<<3)>>3];b=b+1|0;}c[m>>2]=b;if((a|0)>2)d=Zr(n,j,a,i)|0;else {c[i>>2]=0;d=0;}e=rw(a,a,1,1,2)|0;b=0;while(1){c[m>>2]=b;if((b|0)>=(c[i>>2]|0))break;p=b<<1;c[f>>2]=c[d+(p<<2)>>2];c[g>>2]=c[d+((p|1)<<2)>>2];Nw(e,1,f,g,k)|0;b=(c[m>>2]|0)+1|0;}if((a|0)==2){c[f>>2]=0;c[g>>2]=1;Nw(e,1,f,g,k)|0;b=0;}else b=0;while(1){c[m>>2]=b;if((b|0)>=(a|0))break;Nw(e,1,m,m,k)|0;b=(c[m>>2]|0)+1|0;}a=Cw(e)|0;qw(e);p=vw(a,0)|0;qw(a);U1(d);U1(n);U1(j);l=o;return p|0}function hy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;g=m+8|0;i=m;h[i>>3]=1.0;k=a<<3;j=KK(k)|0;k=KK(k)|0;e=0;while(1){if((e|0)>=(a|0))break;f=O(e,b)|0;h[j+(e<<3)>>3]=+h[d+(f<<3)>>3];h[k+(e<<3)>>3]=+h[d+(f+1<<3)>>3];e=e+1|0;}c[g>>2]=e;e=_r(j,k,a,0)|0;f=rw(a,a,1,1,2)|0;b=0;while(1){c[g>>2]=b;if((b|0)<(a|0))d=1;else {b=0;break}while(1){if((d|0)>=(c[e+(b*12|0)>>2]|0))break;Nw(f,1,g,(c[e+(b*12|0)+4>>2]|0)+(d<<2)|0,i)|0;d=d+1|0;b=c[g>>2]|0;}b=b+1|0;}while(1){c[g>>2]=b;if((b|0)>=(a|0))break;Nw(f,1,g,g,i)|0;b=(c[g>>2]|0)+1|0;}i=vw(Cw(f)|0,0)|0;qw(f);U1(j);U1(k);$r(e);l=m;return i|0}function iy(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;jy(f,c);ky(a,b,c,f);ly(b,f,d);my(f);l=e;return}function jy(a,b){a=a|0;b=b|0;c[a>>2]=KK(b<<4)|0;c[a+4>>2]=b;c[a+8>>2]=0;return}function ky(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;D=l;l=l+64|0;r=D+32|0;u=D+48|0;v=D+16|0;w=D;t=b<<2;A=KK(t)|0;C=KK(t)|0;c[v>>2]=0;c[v+4>>2]=0;c[v+8>>2]=0;c[v+12>>2]=0;s=KK(t)|0;t=KK(t)|0;f=0;while(1){if((f|0)>=(b|0))break;c[s+(f<<2)>>2]=f;f=f+1|0;}q=b+-1|0;it(a,s,0,q);f=0;while(1){if((f|0)>=(b|0))break;c[t+(c[s+(f<<2)>>2]<<2)>>2]=f;f=f+1|0;}oy(u,a,s,b);f=1;while(1){if((f|0)>=(b|0)){f=0;break}c[A+(c[s+(f<<2)>>2]<<2)>>2]=c[s+(f+-1<<2)>>2];f=f+1|0;}while(1){if((f|0)>=(q|0))break;p=f+1|0;c[C+(c[s+(f<<2)>>2]<<2)>>2]=c[s+(p<<2)>>2];f=p;}k=e+8|0;m=e+4|0;n=v+4|0;o=w+4|0;p=w+8|0;j=0;while(1){if((j|0)>=(d|0))break;if(!((py(u,v)|0)<<24>>24))break;f=c[k>>2]|0;b=c[m>>2]|0;if((f|0)<(b|0))b=c[e>>2]|0;else {c[m>>2]=b<<1;b=W1(c[e>>2]|0,b<<5)|0;c[e>>2]=b;f=c[k>>2]|0;}c[k>>2]=f+1;f=b+(f<<4)|0;c[f>>2]=c[v>>2];c[f+4>>2]=c[v+4>>2];c[f+8>>2]=c[v+8>>2];c[f+12>>2]=c[v+12>>2];f=c[v>>2]|0;b=c[t+(f<<2)>>2]|0;g=c[n>>2]|0;i=c[t+(g<<2)>>2]|0;if((b|0)>0?(x=c[s+(b+-1<<2)>>2]|0,y=C+(x<<2)|0,(c[t+(c[y>>2]<<2)>>2]|0)<(i|0)):0){c[w>>2]=x;c[o>>2]=g;h[p>>3]=+h[a+(g<<3)>>3]-+h[a+(x<<3)>>3];c[r>>2]=c[w>>2];c[r+4>>2]=c[w+4>>2];c[r+8>>2]=c[w+8>>2];c[r+12>>2]=c[w+12>>2];qy(u,r);c[y>>2]=g;c[A+(g<<2)>>2]=x;}if((i|0)<(q|0)?(z=c[s+(i+1<<2)>>2]|0,B=A+(z<<2)|0,(c[t+(c[B>>2]<<2)>>2]|0)>(b|0)):0){c[w>>2]=f;c[o>>2]=z;h[p>>3]=+h[a+(z<<3)>>3]-+h[a+(f<<3)>>3];c[r>>2]=c[w>>2];c[r+4>>2]=c[w+4>>2];c[r+8>>2]=c[w+8>>2];c[r+12>>2]=c[w+12>>2];qy(u,r);c[B>>2]=f;c[C+(f<<2)>>2]=z;}j=j+1|0;}U1(A);U1(C);U1(s);U1(t);ry(u);l=D;return}function ly(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;k=KK(a<<2)|0;l=b+8|0;i=c[l>>2]|0;j=(i<<1)+a|0;h=j<<2;e=KK(h)|0;h=KK(h)|0;f=0;while(1){if((f|0)>=(a|0))break;c[k+(f<<2)>>2]=1;f=f+1|0;}f=0;while(1){if((f|0)>=(i|0)){f=0;break}n=c[b>>2]|0;m=c[n+(f<<4)+4>>2]|0;n=k+(c[n+(f<<4)>>2]<<2)|0;c[n>>2]=(c[n>>2]|0)+1;m=k+(m<<2)|0;c[m>>2]=(c[m>>2]|0)+1;f=f+1|0;}while(1){if((f|0)>=(j|0))break;g[h+(f<<2)>>2]=1.0;f=f+1|0;}i=KK(a*20|0)|0;c[d>>2]=i;f=0;while(1){if((f|0)>=(a|0))break;c[i+(f*20|0)>>2]=1;c[i+(f*20|0)+8>>2]=h;c[i+(f*20|0)+4>>2]=e;c[e>>2]=f;g[h>>2]=0.0;n=c[k+(f<<2)>>2]|0;h=h+(n<<2)|0;e=e+(n<<2)|0;f=f+1|0;}U1(k);while(1){e=c[l>>2]|0;if(!e)break;n=e+-1|0;c[l>>2]=n;m=c[b>>2]|0;ny(i,c[m+(n<<4)>>2]|0,c[m+(n<<4)+4>>2]|0);}return}function my(a){a=a|0;U1(c[a>>2]|0);return}function ny(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0;f=a+(b*20|0)|0;h=c[f>>2]|0;i=c[a+(b*20|0)+4>>2]|0;e=0;while(1){if((e|0)>=(h|0)){j=4;break}if((c[i+(e<<2)>>2]|0)==(d|0))break;else e=e+1|0;}if((j|0)==4?(c[f>>2]=h+1,c[i+(h<<2)>>2]=d,i=c[a+(d*20|0)+4>>2]|0,h=a+(d*20|0)|0,j=c[h>>2]|0,c[h>>2]=j+1,c[i+(j<<2)>>2]=b,c[a+8>>2]|0):0){j=c[a+(b*20|0)+8>>2]|0;g[j>>2]=+g[j>>2]+-1.0;j=c[a+(d*20|0)+8>>2]|0;g[j>>2]=+g[j>>2]+-1.0;}return}function oy(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0,k=0,l=0;f=e+-1|0;c[a+4>>2]=f;c[a+8>>2]=f;c[a>>2]=KK(f<<4)|0;e=0;while(1){if((e|0)>=(f|0))break;l=c[d+(e<<2)>>2]|0;g=e+1|0;k=c[d+(g<<2)>>2]|0;j=+h[b+(k<<3)>>3]-+h[b+(l<<3)>>3];i=c[a>>2]|0;c[i+(e<<4)>>2]=l;c[i+(e<<4)+4>>2]=k;h[i+(e<<4)+8>>3]=j;e=g;}e=(f|0)/2|0;while(1){if((e|0)<=-1)break;sy(a,e);e=e+-1|0;}return}function py(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+4|0;if(!(c[d>>2]|0))a=0;else {e=c[a>>2]|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];b=c[a>>2]|0;e=b+((c[d>>2]|0)+-1<<4)|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[d>>2]=(c[d>>2]|0)+-1;sy(a,0);a=1;}return a|0}function qy(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;j=a+4|0;g=c[j>>2]|0;d=a+8|0;if((g|0)==(c[d>>2]|0)){c[d>>2]=g<<1;d=W1(c[a>>2]|0,g<<5)|0;c[a>>2]=d;k=a;i=c[j>>2]|0;}else {k=a;i=g;d=c[a>>2]|0;}c[j>>2]=i+1;j=d+(g<<4)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];while(1){if((g|0)<=0)break;d=c[k>>2]|0;e=+h[d+(g<<4)+8>>3];a=g>>>1;f=+h[d+(a<<4)+8>>3];if(!(e>2]|0;}j=d+(g<<4)|0;c[m>>2]=c[j>>2];c[m+4>>2]=c[j+4>>2];c[m+8>>2]=c[j+8>>2];c[m+12>>2]=c[j+12>>2];b=d+(a<<4)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];j=(c[k>>2]|0)+(a<<4)|0;c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];g=a;}l=n;return}function ry(a){a=a|0;U1(c[a>>2]|0);return}function sy(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;i=m;j=a+4|0;while(1){d=b<<1;g=d|1;if((d|0)<(c[j>>2]|0)){n=c[a>>2]|0;e=+h[n+(d<<4)+8>>3];f=+h[n+(b<<4)+8>>3];if(!(e>2]|0)){n=c[a>>2]|0;e=+h[n+(g<<4)+8>>3];f=+h[n+(d<<4)+8>>3];if(!(e>2]|0;n=g+(d<<4)|0;c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];c[i+12>>2]=c[n+12>>2];g=g+(b<<4)|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];n=(c[a>>2]|0)+(b<<4)|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];b=d;}l=m;return}function ty(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=+d;e=+e;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0.0;l=(f|0)!=0;if(!l){f=KK(b<<3)|0;if(!(ju(a,b,f,b)|0))m=3;else {a=1;m=17;}}else m=3;if((m|0)==3){k=JK(b<<2)|0;c[g>>2]=k;a=0;while(1){if((a|0)>=(b|0))break;c[k+(a<<2)>>2]=a;a=a+1|0;}a=b+-1|0;it(f,k,0,a);n=+h[f+(c[k>>2]<<3)>>3];e=(+h[f+(c[k+(a<<2)>>2]<<3)>>3]-n)*e/+(a|0);e=e=(b|0))break;n=+h[f+(c[k+(g<<2)>>2]<<3)>>3];a=a+(n-d>e&1)|0;g=g+1|0;d=n;}c[j>>2]=a;a:do if(!a){k=KK(4)|0;c[i>>2]=k;c[k>>2]=b;}else {j=KK(a<<2)|0;c[i>>2]=j;a=0;g=1;while(1){if((g|0)>=(b|0))break a;if(+h[f+(c[k+(g<<2)>>2]<<3)>>3]-+h[f+(c[k+(g+-1<<2)>>2]<<3)>>3]>e){c[j+(a<<2)>>2]=g;a=a+1|0;}g=g+1|0;}}while(0);if(l)a=0;else {a=0;m=17;}}if((m|0)==17)U1(f);return a|0}function uy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=c[46930]|0;if(d|0)vn(d);c[46930]=un(b,b,0.0)|0;d=c[46931]|0;if(d|0)U1(d);c[46931]=JK(b<<2)|0;d=c[46932]|0;if(d|0)U1(d);n=JK(b<<3)|0;c[46932]=n;o=c[46930]|0;p=c[46931]|0;i=0;while(1){if((i|0)>=(b|0)){e=10;break}e=a+(i<<2)|0;g=o+(i<<2)|0;f=0.0;d=0;while(1){if((d|0)==(b|0))break;j=+h[(c[e>>2]|0)+(d<<3)>>3];h[(c[g>>2]|0)+(d<<3)>>3]=j;j=+B(+j);f=f>3]=1.0/f;c[p+(i<<2)>>2]=i;i=i+1|0;}a:do if((e|0)==10){m=b+-1|0;d=0;l=0;b:while(1){if((l|0)<(m|0)){e=l;k=d;f=0.0;}else break;while(1){if((e|0)>=(b|0))break;a=c[p+(e<<2)>>2]|0;j=+B(+(+h[(c[o+(a<<2)>>2]|0)+(l<<3)>>3]));j=+h[n+(a<<3)>>3]*j;a=f>2]|0;a=p+(k<<2)|0;c[d>>2]=c[a>>2];c[a>>2]=i;}g=c[o+(c[d>>2]<<2)>>2]|0;a=l+1|0;f=1.0/+h[g+(l<<3)>>3];e=a;while(1){if((e|0)>=(b|0)){d=k;l=a;continue b}i=c[o+(c[p+(e<<2)>>2]<<2)>>2]|0;d=i+(l<<3)|0;j=+h[d>>3]*f;h[d>>3]=j;c:do if(j!=0.0){d=a;while(1){if((d|0)>=(b|0))break c;q=i+(d<<3)|0;h[q>>3]=+h[q>>3]-+h[g+(d<<3)>>3]*j;d=d+1|0;}}while(0);e=e+1|0;}}d=+h[(c[o+(c[p+(m<<2)>>2]<<2)>>2]|0)+(m<<3)>>3]!=0.0&1;}else if((e|0)==15){h[n+(i<<3)>>3]=0.0;d=0;}while(0);return d|0}function vy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0;k=c[46930]|0;l=c[46931]|0;j=0;while(1){if((j|0)>=(d|0)){e=d;break}g=c[l+(j<<2)>>2]|0;i=k+(g<<2)|0;f=0.0;e=0;while(1){if((e|0)==(j|0))break;f=+h[a+(e<<3)>>3]*+h[(c[i>>2]|0)+(e<<3)>>3]+f;e=e+1|0;}h[a+(j<<3)>>3]=+h[b+(g<<3)>>3]-f;j=j+1|0;}while(1){b=e+-1|0;if((e|0)<=0)break;g=l+(b<<2)|0;f=0.0;while(1){if((e|0)>=(d|0))break;f=+h[a+(e<<3)>>3]*+h[(c[k+(c[g>>2]<<2)>>2]|0)+(e<<3)>>3]+f;e=e+1|0;}e=a+(b<<3)|0;h[e>>3]=(+h[e>>3]-f)/+h[(c[k+(c[g>>2]<<2)>>2]|0)+(b<<3)>>3];e=b;}return}function wy(a){a=a|0;var b=0;b=KK(8)|0;c[b>>2]=a;c[b+4>>2]=0;return b|0}function xy(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0)do{d=a;a=c[a+4>>2]|0;e=c[d>>2]|0;if(e|0)tb[b&127](e);U1(d);}while((a|0)!=0);return}function yy(a,b){a=a|0;b=b|0;b=wy(b)|0;c[b+4>>2]=a;return b|0}function zy(a){a=a|0;return c[a>>2]|0}function Ay(a){a=a|0;return c[a+4>>2]|0}function By(a){a=a|0;var b=0;b=KK(12)|0;c[b>>2]=a;c[b+4>>2]=0;c[b+8>>2]=0;return b|0}function Cy(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0)do{d=a;a=c[a+4>>2]|0;e=c[d>>2]|0;if(e|0)tb[b&127](e);U1(d);}while((a|0)!=0);return}function Dy(a,b){a=a|0;b=b|0;b=By(b)|0;if(a|0){c[b+4>>2]=a;c[a+8>>2]=b;}return b|0}function Ey(a){a=a|0;return c[a>>2]|0}function Fy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if(a|0){e=c[a+4>>2]|0;f=c[a+8>>2]|0;g=c[a>>2]|0;if(g|0)tb[b&127](g);U1(a);if(e|0)c[e+8>>2]=f;c[(f|0?f+4|0:d)>>2]=e;}return}function Gy(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;return}function Hy(a){a=a|0;var b=0;b=JK(64)|0;Gy(b+36|0);c[b+8>>2]=a;return b|0}function Iy(a){a=a|0;if(a|0){cz(c[a+32>>2]|0);U1(a);}return}function Jy(a){a=a|0;return tB(c[a+8>>2]|0)|0}function Ky(a,b){a=a|0;b=b|0;var d=0,e=0;c[b+4>>2]=0;d=a+4|0;e=c[d>>2]|0;c[((e|0)==0?a:e+4|0)>>2]=b;c[d>>2]=b;return}function Ly(a,b){a=a|0;b=b|0;var d=0;d=c[a>>2]|0;if(!d){c[a>>2]=b;a=a+4|0;}else c[b+4>>2]=d;c[a>>2]=b;return}function My(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;Ny(a,b);j=c[b>>2]|0;h=c[j+4>>2]|0;while(1){if(!h)break;k=c[h+8>>2]|0;i=jC(k)|0;d=c[(c[i+16>>2]|0)+112>>2]|0;a=c[d+16+4>>2]|0;d=c[d+8>>2]|0;f=i;i=kC(k,i)|0;while(1){if(!i)break;e=c[(c[i+16>>2]|0)+112>>2]|0;g=c[e+16+4>>2]|0;if((g|0)<(a|0)){f=i;d=c[e+8>>2]|0;a=g;}i=kC(k,i)|0;}i=c[(c[d+16>>2]|0)+112>>2]|0;k=i+4|0;c[k>>2]=c[k>>2]|8;c[h>>2]=f;k=c[h+4>>2]|0;Ky((c[i+12>>2]|0)+36|0,h);h=k;}Gy(b);return j|0}function Ny(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;g=i+8|0;e=c[b+24>>2]|0;if(!((e|0)!=0?(d=tC(a,e,0)|0,(d|0)!=0):0))f=3;a:do if((f|0)==3){e=b+20|0;b:do if(c[e>>2]|0){d=jC(a)|0;while(1){if(!d)break b;if((cP(c[c[(c[d+16>>2]|0)+112>>2]>>2]|0,c[e>>2]|0,0)|0)<<24>>24)break a;d=kC(a,d)|0;}}while(0);d=jC(a)|0;}while(0);if(0);c[g+4>>2]=0;c[g>>2]=0;Oy(a,d,b,1,g);l=i;return}function Oy(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;l=d+8|0;k=c[l>>2]|0;c[l>>2]=k+1;l=b+16|0;c[(c[(c[l>>2]|0)+112>>2]|0)+16+4>>2]=k;c[(c[(c[l>>2]|0)+112>>2]|0)+24>>2]=k;k=(e|0)==0;j=aB(a,b)|0;while(1){if(!j)break;e=c[j>>2]&3;g=c[((e|0)==2?j:j+-48|0)+40>>2]|0;if((g|0)==(b|0)){e=c[((e|0)==3?j:j+48|0)+40>>2]|0;g=c[(c[j+16>>2]|0)+120>>2]|0;if(!(c[g>>2]|0))c[g>>2]=-1;}else {e=c[(c[j+16>>2]|0)+120>>2]|0;if(!(c[e>>2]|0)){c[e>>2]=1;e=g;}else e=g;}g=e+16|0;h=c[(c[g>>2]|0)+112>>2]|0;i=c[h+16+4>>2]|0;do if(!i){c[h+8>>2]=b;Py(f,j);Oy(a,e,d,0,f);i=(c[(c[l>>2]|0)+112>>2]|0)+24|0;c[i>>2]=c[(c[(c[((c[i>>2]|0)<(c[(c[(c[g>>2]|0)+112>>2]|0)+24>>2]|0)?b:e)+16>>2]|0)+112>>2]|0)+24>>2];if((c[(c[(c[g>>2]|0)+112>>2]|0)+24>>2]|0)>=(c[(c[(c[l>>2]|0)+112>>2]|0)+16+4>>2]|0)){e=0;do{h=Qy(f)|0;g=(c[c[(c[h+16>>2]|0)+120>>2]>>2]|0)==1;g=c[((c[h>>2]&3|0)==((g?2:3)|0)?h:h+((g?-1:1)*48|0)|0)+40>>2]|0;if(!(c[(c[(c[g+16>>2]|0)+112>>2]|0)+12>>2]|0)){if(!e)e=Ry(a,d)|0;Sy(e,g);}}while((h|0)!=(j|0));if(e|0){if((c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==0?(Jy(e)|0)>1:0)Sy(e,b);if(!k?(c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==(e|0):0){Ly(d,e);break}Ky(d,e);}}}else {g=c[(c[l>>2]|0)+112>>2]|0;if((c[g+8>>2]|0)!=(e|0)){h=g+24|0;g=c[h>>2]|0;c[h>>2]=(g|0)<(i|0)?g:i;}}while(0);j=bB(a,j,b)|0;}if(!k?(c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==0:0){l=Ry(a,d)|0;Sy(l,b);Ly(d,l);}return}function Py(a,b){a=a|0;b=b|0;c[(c[(c[b+16>>2]|0)+120>>2]|0)+4>>2]=c[a>>2];c[a>>2]=b;b=a+4|0;c[b>>2]=(c[b>>2]|0)+1;return}function Qy(a){a=a|0;var b=0,d=0,e=0;b=c[a>>2]|0;if(!b)qa(138394,96254,65,96266);d=a+4|0;e=c[d>>2]|0;if((e|0)>0){c[a>>2]=c[(c[(c[b+16>>2]|0)+120>>2]|0)+4>>2];c[d>>2]=e+-1;return b|0}else qa(96244,96254,61,96266);return 0}function Ry(a,b){a=a|0;b=b|0;return Hy(Ty(a,b)|0)|0}function Sy(a,b){a=a|0;b=b|0;oC(c[a+8>>2]|0,b,1)|0;c[(c[(c[b+16>>2]|0)+112>>2]|0)+12>>2]=a;return}function Ty(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+144|0;f=d;e=d+8|0;g=b+12|0;b=c[g>>2]|0;c[g>>2]=b+1;c[f>>2]=b;m4(e,96234,f)|0;b=ND(a,e,1)|0;TC(b,137483,280,1)|0;l=d;return b|0}function Uy(a){a=a|0;var b=0,d=0;b=c[a+36>>2]|0;while(1){if(!b)break;d=c[b+4>>2]|0;Uy(b);b=d;}Iy(a);return}function Vy(a,b,c){a=a|0;b=b|0;c=c|0;Wy(a,b,+h[c+32>>3]);return}function Wy(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;e=b+36|0;f=0;while(1){e=c[e>>2]|0;if(!e)break;Wy(a,e,d);e=e+4|0;f=f+1|0;}e=mz(a,b,d)|0;c[b+32>>2]=e;a=jz(e)|0;if((f|0)>0)d=+Xy(f,a,e,b,d);else d=3.141592653589793;if((((a|0)==1?(g=c[b>>2]|0,g|0):0)?c[(c[(c[g+16>>2]|0)+112>>2]|0)+8>>2]|0:0)?(i=b+48|0,h[i>>3]=d,d<0.0):0)h[i>>3]=d+6.283185307179586;return}function Xy(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+48|0;t=v;u=JK(a*56|0)|0;c[t+40>>2]=c[e+36>>2];p=e+16|0;j=+h[p>>3];q=t+8|0;h[q>>3]=j;h[t>>3]=j;c[t+44>>2]=c[e>>2];j=6.283185307179586/+(b|0);h[t+16>>3]=j;r=t+24|0;h[r>>3]=-1.0;s=t+32|0;h[s>>3]=-1.0;k=0;o=0;g=0.0;while(1){i=c[d>>2]|0;if(!i)break;d=c[i>>2]|0;if(!(c[(c[(c[d+16>>2]|0)+112>>2]|0)+4>>2]&8))d=o;else {n=u+(o*56|0)|0;c[n>>2]=d;h[u+(o*56|0)+8>>3]=j*+(k|0);d=o+1|0;g=+Yy(n,t,f);}k=k+1|0;o=d;d=i+4|0;}a:do switch(o|0){case 1:{h[u+40>>3]=1.0;d=0;break}case 2:{j=+h[u+64>>3]-+h[u+8>>3];Zy(u,u+56|0,j>3.141592653589793?6.283185307179586-j:j);d=0;break}default:{n=u+8|0;m=u;d=0;while(1){if((d|0)>=(o|0)){d=0;break a}d=d+1|0;if((d|0)==(o|0)){i=u;j=+h[n>>3]+6.283185307179586-+h[m+8>>3];k=m+56|0;}else {k=m+56|0;i=k;j=+h[m+64>>3]-+h[m+8>>3];}Zy(m,i,j);m=k;}}}while(0);while(1){if((d|0)>=(o|0))break;_y(u+(d*56|0)|0,t,b,f);d=d+1|0;}U1(u);if((a|0)==1){f=g+f*.5;$y(e,-f,0.0,0.0);h[p>>3]=+h[p>>3]+f;u=e+56|0;c[u>>2]=c[u>>2]|1;}else h[p>>3]=+h[q>>3];l=v;return +((+h[s>>3]+ +h[r>>3])*.5+-3.141592653589793)}function Yy(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0.0,g=0.0,i=0,j=0,k=0.0;i=0;f=0.0;g=0.0;e=b+40|0;while(1){j=c[e>>2]|0;if(!j)break;e=c[j>>2]|0;if(!e)e=0;else e=c[(c[(c[e+16>>2]|0)+112>>2]|0)+8>>2]|0;if((e|0)==(c[a>>2]|0)){k=+h[j+16>>3];e=i+1|0;f=f+d+k*2.0;g=g>3]=f;c[a+48>>2]=i;h[a+16>>3]=g+d+ +h[b>>3];h[a+24>>3]=g;return +g}function Zy(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0.0;e=+h[b+16>>3];d=+h[a+16>>3];c=(d*+h[b+32>>3]+e*+h[a+32>>3])/(c*2.0*e*d);c=c<1.0?1.0:c;a=a+40|0;if(c>+h[a>>3])h[a>>3]=c;a=b+40|0;if(c>+h[a>>3])h[a>>3]=c;return}function _y(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0.0,g=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0.0,v=0.0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0.0,G=0.0;z=b+8|0;y=+h[z>>3];A=b+24|0;k=+h[A>>3];B=b+32|0;j=+h[B>>3];f=+h[a+16>>3]*+h[a+40>>3];x=(d|0)==1;if(x){v=+h[a+32>>3];g=v*.15915494309189535;g=f>g?f:g;f=g*6.283185307179586-v;if(f>0.0){e=f/+(c[a+48>>2]|0)+e;l=0.0;f=g;}else {l=0.0;f=g;}}else l=+h[a+8>>3]-+h[a+32>>3]/(f*2.0);q=+h[a+24>>3]+f;r=q>y;s=a+48|0;t=((c[s>>2]|0)+1|0)/2|0;u=1.0/f;v=e/f*.5;w=a+8|0;n=b+40|0;o=0;p=0.0;g=l;while(1){n=c[n>>2]|0;if(!n)break;i=c[n>>2]|0;if(!i)i=0;else i=c[(c[(c[i+16>>2]|0)+112>>2]|0)+8>>2]|0;if((i|0)==(c[a>>2]|0)?(jz(c[n+32>>2]|0)|0)>=1:0){l=+h[n+16>>3];m=l*u;do if(!x)if((c[s>>2]|0)==1){g=+h[w>>3];break}else {g=g+v+m;break}else {if(g!=0.0)g=(c[s>>2]|0)==2?3.141592653589793:m+g;j=g;k=k<0.0?g:k;}while(0);G=+E(+g)*f;D=+F(+g)*f;$y(n,G,D,+az(n,G,D,g));g=(x?(l+e)*u:m+v)+g;o=o+1|0;i=o;l=(o|0)==(t|0)?g:p;}else {i=o;l=p;}n=n+4|0;o=i;p=l;}f=r?q:y;if((d|0)>1?(C=c[a>>2]|0,(C|0)==(c[b+44>>2]|0)):0)h[(c[(c[C+16>>2]|0)+112>>2]|0)+24>>3]=p;h[z>>3]=f;h[A>>3]=k;h[B>>3]=j;return}function $y(a,b,d,e){a=a|0;b=+b;d=+d;e=+e;var f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0.0;m=c[a+8>>2]|0;n=e!=0.0;f=jC(m)|0;while(1){if(!f)break;k=c[(c[f+16>>2]|0)+132>>2]|0;i=+h[k>>3];l=k+8|0;g=+h[l>>3];if(n){o=+E(+e);p=+F(+e);j=o*i-p*g;g=p*i+o*g;}else j=i;h[k>>3]=j+b;h[l>>3]=g+d;f=kC(m,f)|0;}f=a+36|0;while(1){f=c[f>>2]|0;if(!f)break;$y(f,b,d,e);f=f+4|0;}return}function az(a,b,d,e){a=a|0;b=+b;d=+d;e=+e;var f=0.0,g=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0;m=c[a+8>>2]|0;f=+h[a+48>>3];do if(!(f>=0.0)){if((jz(c[a+32>>2]|0)|0)==2){f=e+-1.5707963267948966;break}l=c[a>>2]|0;n=l+16|0;i=c[(c[n>>2]|0)+132>>2]|0;f=+h[i>>3]+b;k=+h[i+8>>3]+d;f=k*k+f*f;i=jC(m)|0;g=l;while(1){if(!i)break;if((i|0)!=(l|0)?(o=c[(c[i+16>>2]|0)+132>>2]|0,j=+h[o>>3]+b,k=+h[o+8>>3]+d,j=k*k+j*j,j>3];k=+h[a+16>>3]-j;g=c[n>>2]|0;i=c[g+132>>2]|0;f=+h[i>>3];if(f>-k?(c[a+56>>2]&1|0)!=0:0){d=+C(+(d*d+b*b));b=+K(+(+h[i+8>>3]),+(f+k));f=+E(+b);f=e+1.5707963267948966-b-+I(+((k-j/f)/d*f));break}else {f=+K(+(+h[i+8>>3]),+f);f=e+3.141592653589793-f-+h[(c[g+112>>2]|0)+24>>3];f=f>6.283185307179586?f+-6.283185307179586:f;break}}else f=0.0;}else {f=3.141592653589793-f+e;f=f<0.0?f+6.283185307179586:f;}while(0);return +f}function bz(){return JK(12)|0}function cz(a){a=a|0;var b=0,d=0;if(a|0){b=c[a>>2]|0;while(1){if(!b)break;d=c[b+4>>2]|0;U1(b);b=d;}U1(a);}return}function dz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=ez(d)|0;d=a+8|0;c[d>>2]=(c[d>>2]|0)+1;d=a+4|0;e=c[d>>2]|0;if((b|0)==0|(e|0)==(b|0)){c[(e|0?e+4|0:a)>>2]=f;c[f+8>>2]=e;e=0;}else {e=b+4|0;d=c[e>>2]|0;c[e>>2]=f;c[f+8>>2]=b;e=d;d=d+8|0;}c[d>>2]=f;c[f+4>>2]=e;return}function ez(a){a=a|0;var b=0;b=JK(12)|0;c[b>>2]=a;return b|0}function fz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=c[a>>2]|0;d=b;while(1){if(!b)break;g=b+4|0;e=c[g>>2]|0;f=b+8|0;c[g>>2]=c[f>>2];c[f>>2]=e;b=e;}f=a+4|0;g=c[f>>2]|0;c[f>>2]=d;c[a>>2]=g;return a|0}function gz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[a>>2]|0;if((d|0)!=(b|0)){f=b+8|0;e=c[f>>2]|0;c[a>>2]=b;c[f>>2]=0;b=a+4|0;a=c[b>>2]|0;c[a+4>>2]=d;c[d+8>>2]=a;c[b>>2]=e;c[e+4>>2]=0;}return}function hz(a){a=a|0;var b=0,d=0,e=0;d=bz()|0;e=d+4|0;b=0;while(1){a=c[a>>2]|0;if(!a)break;dz(d,b,c[a>>2]|0);b=c[e>>2]|0;a=a+4|0;}return d|0}function iz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=a;while(1){j=c[f>>2]|0;if(!j){k=6;break}if((c[j>>2]|0)==(b|0))break;f=j+4|0;}if((k|0)==6)qa(96270,96277,217,96288);i=j+8|0;f=c[i>>2]|0;g=j+4|0;b=c[g>>2]|0;c[(f|0?f+4|0:a)>>2]=b;h=a+4|0;c[(b|0?b+8|0:h)>>2]=f;b=0;f=a;while(1){f=c[f>>2]|0;if(!f)break;if((c[f>>2]|0)==(d|0)){k=9;break}b=f;f=f+4|0;}if((k|0)==9){do if(!e)if((f|0)==(c[a>>2]|0)){c[a>>2]=j;c[g>>2]=f;c[i>>2]=0;f=f+8|0;break}else {c[b+4>>2]=j;c[i>>2]=b;c[g>>2]=f;f=f+8|0;break}else if((f|0)==(c[h>>2]|0)){c[h>>2]=j;c[g>>2]=0;c[i>>2]=f;f=f+4|0;break}else {c[i>>2]=f;f=f+4|0;c[g>>2]=c[f>>2];c[(c[f>>2]|0)+8>>2]=j;break}while(0);c[f>>2]=j;}return}function jz(a){a=a|0;return c[a+8>>2]|0}function kz(a,b){a=a|0;b=b|0;lz(a,fz(b)|0);U1(b);return}function lz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[b>>2]|0;if(d|0){e=a+4|0;f=c[e>>2]|0;c[f+4>>2]=d;c[d+8>>2]=f;c[e>>2]=c[b+4>>2];d=a+8|0;c[d>>2]=(c[d>>2]|0)+(c[b+8>>2]|0);}return}function mz(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0;m=c[b+8>>2]|0;nz(a,b);l=oz(m)|0;a=qz(pz(l)|0)|0;rz(m,a);m=sz(a,m)|0;a=jz(m)|0;j=+tz(m);k=(a|0)==1;f=+(a|0);i=f*.15915494309189535*(j+d);g=k?0.0:i;a=m;while(1){a=c[a>>2]|0;if(!a)break;if(c[(c[(c[(c[a>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&8|0){e=4;break}a=a+4|0;}if((e|0)==4)gz(m,a);d=1.0/f;e=0;a=m;while(1){a=c[a>>2]|0;if(!a)break;n=(c[a>>2]|0)+16|0;c[(c[(c[n>>2]|0)+112>>2]|0)+16>>2]=e;h[(c[(c[n>>2]|0)+112>>2]|0)+24>>3]=0.0;f=6.283185307179586*d*+(e|0);o=+E(+f)*g;n=c[(c[n>>2]|0)+132>>2]|0;h[n>>3]=o;h[n+8>>3]=+F(+f)*g;e=e+1|0;a=a+4|0;}o=k?j*.5:i;h[b+16>>3]=o;h[b+24>>3]=o;h[b+48>>3]=-1.0;sB(l)|0;return m|0}function nz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[b+8>>2]|0;d=jC(f)|0;while(1){if(!d)break;e=XA(a,d)|0;while(1){if(!e)break;if((c[(c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0)+12>>2]|0)==(b|0))mB(f,e,1)|0;e=ZA(a,e)|0;}d=kC(f,d)|0;}return}function oz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;g=k;f=zz(a,g)|0;g=c[g>>2]|0;i=tB(g)|0;h=Az(g)|0;i=i+-3|0;e=0;while(1){if((e|0)>=(i|0))break;j=Jz(h)|0;d=aB(g,j)|0;while(1){if(!d)break;b=c[d>>2]&3;a=c[((b|0)==2?d:d+-48|0)+40>>2]|0;if((j|0)==(a|0))a=c[((b|0)==3?d:d+48|0)+40>>2]|0;Iz(h,a);d=bB(g,d,j)|0;}Bz(g,j,f);d=aB(g,j)|0;while(1){if(!d)break;b=c[d>>2]&3;a=c[((b|0)==2?d:d+-48|0)+40>>2]|0;if((j|0)==(a|0))a=c[((b|0)==3?d:d+48|0)+40>>2]|0;b=(c[a+16>>2]|0)+236|0;c[b>>2]=(c[b>>2]|0)+-1;Hz(h,a);d=bB(g,d,j)|0;}wC(g,j)|0;e=e+1|0;}sB(g)|0;Gz(h);l=k;return f|0}function pz(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+144|0;b=f;e=f+8|0;d=c[46933]|0;c[46933]=d+1;c[b>>2]=d;m4(e,96303,b)|0;e=ND(a,e,1)|0;TC(e,137483,280,1)|0;b=jC(a)|0;while(1){if(!b)break;oC(e,b,1)|0;d=b+16|0;c[(c[(c[d>>2]|0)+112>>2]|0)+16+12>>2]=0;c[(c[(c[d>>2]|0)+112>>2]|0)+32>>2]=0;d=(c[(c[d>>2]|0)+112>>2]|0)+4|0;c[d>>2]=c[d>>2]&-2;b=kC(a,b)|0;}b=jC(a)|0;while(1){if(!b)break;d=c[(c[b+16>>2]|0)+112>>2]|0;if(!(c[d+4>>2]&1)){c[d+16>>2]=0;yz(a,b,e);}b=kC(a,b)|0;}l=f;return e|0}function qz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((tB(a)|0)!=1){d=jC(a)|0;while(1){if(!d)break;b=0;e=aB(a,d)|0;while(1){if(!e)break;b=b+1|0;e=bB(a,e,d)|0;}if((b|0)==1)xz(d,d,0,0);d=kC(a,d)|0;}b=0;f=0;d=jC(a)|0;while(1){if(!d)break;g=c[(c[d+16>>2]|0)+112>>2]|0;g=(c[g+32>>2]|0)+(c[g+16+12>>2]|0)|0;e=(g|0)>(b|0);b=e?g:b;f=e?d:f;d=kC(a,d)|0;}b=bz()|0;e=f+16|0;d=(c[(c[e>>2]|0)+112>>2]|0)+16+4|0;while(1){d=c[d>>2]|0;if((d|0)==(f|0))break;dz(b,0,d);d=c[(c[d+16>>2]|0)+112>>2]|0;g=d+4|0;c[g>>2]=c[g>>2]|16;d=d+16|0;}dz(b,0,f);g=c[(c[e>>2]|0)+112>>2]|0;a=g+4|0;c[a>>2]=c[a>>2]|16;if(c[g+32>>2]|0){a=bz()|0;d=(c[(c[e>>2]|0)+112>>2]|0)+24|0;while(1){d=c[d>>2]|0;if((d|0)==(f|0))break;dz(a,0,d);d=c[(c[d+16>>2]|0)+112>>2]|0;g=d+4|0;c[g>>2]=c[g>>2]|16;d=d+16|0;}kz(b,a);}}else {b=bz()|0;g=jC(a)|0;dz(b,0,g);g=(c[(c[g+16>>2]|0)+112>>2]|0)+4|0;c[g>>2]=c[g>>2]|16;}return b|0}function rz(a,b){a=a|0;b=b|0;var d=0;d=jC(a)|0;while(1){if(!d)break;if(!(c[(c[(c[d+16>>2]|0)+112>>2]|0)+4>>2]&16))wz(a,d,b);d=kC(a,d)|0;}return}function sz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;d=uz(a,b)|0;c[f>>2]=d;a:do if(d){e=0;while(1){if((e|0)>=10)break a;a=vz(a,b,f)|0;h=d;d=c[f>>2]|0;if((h|0)==(d|0)|(d|0)==0)break;else e=e+1|0;}}while(0);l=g;return a|0}function tz(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0;b=0.0;while(1){a=c[a>>2]|0;if(!a)break;f=c[(c[c[(c[(c[a>>2]|0)+16>>2]|0)+112>>2]>>2]|0)+16>>2]|0;d=+h[f+32>>3];d=d>b?d:b;e=+h[f+40>>3];b=e>d?e:d;a=a+4|0;}return +b}function uz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=Kz()|0;e=jC(b)|0;while(1){if(!e)break;d=XA(b,e)|0;while(1){if(!d)break;c[c[(c[d+16>>2]|0)+120>>2]>>2]=0;d=ZA(b,d)|0;}e=kC(b,e)|0;}j=1;d=0;while(1){h=c[a>>2]|0;if(!h)break;i=c[h>>2]|0;g=aB(b,i)|0;while(1){if(!g)break;f=g+16|0;if((c[c[(c[f>>2]|0)+120>>2]>>2]|0)>0){a=nb[c[k>>2]&63](k,0,128)|0;while(1){if(!a)break;e=c[a+8>>2]|0;if((c[c[(c[e+16>>2]|0)+120>>2]>>2]|0)>(c[c[(c[f>>2]|0)+120>>2]>>2]|0)?(l=c[e>>2]&3,(c[((l|0)==2?e:e+-48|0)+40>>2]|0)!=(i|0)):0)d=d+((c[((l|0)==3?e:e+48|0)+40>>2]|0)!=(i|0)&1)|0;a=nb[c[k>>2]&63](k,a,8)|0;}Qz(k,g);}g=bB(b,g,i)|0;}e=aB(b,i)|0;while(1){if(!e)break;a=c[(c[e+16>>2]|0)+120>>2]|0;if(!(c[a>>2]|0)){c[a>>2]=j;Pz(k,e);}e=bB(b,e,i)|0;}a=h+4|0;j=j+1|0;}Oz(k);return d|0}function vz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[d>>2]|0;k=jC(b)|0;a:while(1){if(!k)break;j=aB(b,k)|0;while(1){if(!j)break;g=c[j>>2]&3;f=c[((g|0)==3?j:j+48|0)+40>>2]|0;if((f|0)==(k|0))f=c[((g|0)==2?j:j+-48|0)+40>>2]|0;i=0;while(1){if((i|0)>=2)break;h=hz(a)|0;iz(a,k,f,i);g=uz(a,b)|0;if((g|0)<(e|0)){cz(h);if(!g){e=0;break a}else e=g;}else {cz(a);a=h;}i=i+1|0;}j=bB(b,j,k)|0;}k=kC(b,k)|0;}c[d>>2]=e;return a|0}function wz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=bz()|0;e=XA(a,b)|0;while(1){if(!e)break;f=e+-48|0;dz(h,0,c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0);f=(c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[f>>2]=c[f>>2]|32;e=ZA(a,e)|0;}e=_A(a,b)|0;while(1){if(!e)break;f=e+48|0;dz(h,0,c[((c[e>>2]&3|0)==3?e:f)+40>>2]|0);f=(c[(c[(c[((c[e>>2]&3|0)==3?e:f)+40>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[f>>2]=c[f>>2]|32;e=$A(a,e)|0;}a:do if((jz(h)|0)>1){f=d+4|0;a=d;while(1){e=c[a>>2]|0;if(!e){g=13;break a}a=e+4|0;if(!(c[(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32))continue;if(c[(c[(c[(c[c[((e|0)==(c[f>>2]|0)?d:a)>>2]>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32|0)break}dz(d,e,b);}else g=13;while(0);b:do if((g|0)==13){c:do if((jz(h)|0)>0){e=d;while(1){e=c[e>>2]|0;if(!e)break c;if(c[(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32|0)break;e=e+4|0;}dz(d,e,b);break b}while(0);dz(d,0,b);}while(0);e=h;while(1){e=c[e>>2]|0;if(!e)break;d=(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[d>>2]=c[d>>2]&-33;e=e+4|0;}cz(h);return}function xz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;while(1){g=c[(c[(c[b+16>>2]|0)+112>>2]|0)+16>>2]|0;if(!g)break;h=d+1|0;i=g+16|0;j=c[(c[i>>2]|0)+112>>2]|0;b=j+16|0;f=c[b+12>>2]|0;if(f){if((f|0)>(d|0)){k=11;break}b=c[b+4>>2]|0;f=b;if((b|0)==(e|0))b=j;else {d=j+24|0;if(!((c[j+32>>2]|0)!=0?(c[d>>2]|0)==(e|0):0))e=b;c[d>>2]=f;b=c[(c[i>>2]|0)+112>>2]|0;c[b+32>>2]=c[b+16+12>>2];b=c[(c[i>>2]|0)+112>>2]|0;}b=b+16|0;}c[b+4>>2]=a;c[(c[(c[i>>2]|0)+112>>2]|0)+16+12>>2]=h;b=g;d=h;}if((k|0)==11?(c[j+32>>2]|0)<=(d|0):0){c[j+24>>2]=a;c[(c[(c[i>>2]|0)+112>>2]|0)+32>>2]=h;}return}function yz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=(c[(c[b+16>>2]|0)+112>>2]|0)+4|0;c[g>>2]=c[g>>2]|1;g=aB(a,b)|0;while(1){if(!g)break;f=c[g>>2]&3;e=c[((f|0)==2?g:g+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((f|0)==3?g:g+48|0)+40>>2]|0;f=e+16|0;if(!(c[(c[(c[f>>2]|0)+112>>2]|0)+4>>2]&1)){mB(d,g,1)|0;c[(c[(c[f>>2]|0)+112>>2]|0)+16>>2]=b;yz(a,e,d);}g=bB(a,g,b)|0;}return}function zz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;k=l;l=l+144|0;j=k+8|0;i=k;e=k+16|0;h=c[46934]|0;c[46934]=h+1;c[i>>2]=h;m4(e,96312,i)|0;i=ND(b,e,1)|0;TC(i,137483,280,1)|0;h=c[46934]|0;c[46934]=h+1;c[j>>2]=h;m4(e,96312,j)|0;h=b+24|0;a[j>>0]=a[h>>0]|0;a[j+1>>0]=a[h+1>>0]|0;a[j+2>>0]=a[h+2>>0]|0;a[j+3>>0]=a[h+3>>0]|0;j=oB(e,j,0)|0;e=jC(b)|0;while(1){if(!e)break;oC(i,e,1)|0;h=tC(j,KB(e)|0,1)|0;TC(h,137447,304,1)|0;c[(c[(c[e+16>>2]|0)+112>>2]|0)+16>>2]=h;e=kC(b,e)|0;}f=jC(b)|0;while(1){if(!f)break;g=c[(c[(c[f+16>>2]|0)+112>>2]|0)+16>>2]|0;h=g+16|0;e=XA(b,f)|0;while(1){if(!e)break;mB(i,e,1)|0;m=c[(c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0)+16>>2]|0;n=iB(j,g,m,0,1)|0;TC(n,137460,176,1)|0;c[(c[n+16>>2]|0)+116>>2]=e;n=(c[h>>2]|0)+236|0;c[n>>2]=(c[n>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;e=ZA(b,e)|0;}f=kC(b,f)|0;}c[d>>2]=j;l=k;return i|0}function Az(a){a=a|0;var b=0,c=0;c=Cz()|0;b=jC(a)|0;while(1){if(!b)break;Hz(c,b);b=kC(a,b)|0;}return c|0}function Bz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=c[(c[b+16>>2]|0)+236>>2]|0;p=m<<2;o=KK(p)|0;p=KK(p)|0;i=0;l=aB(a,b)|0;n=0;f=0;while(1){if(!l)break;e=c[l>>2]&3;g=c[((e|0)==2?l:l+-48|0)+40>>2]|0;if((g|0)==(b|0))g=c[((e|0)==3?l:l+48|0)+40>>2]|0;h=0;k=aB(a,b)|0;j=i;while(1){if(!k)break;if((k|0)!=(l|0)){i=c[k>>2]&3;e=c[((i|0)==2?k:k+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((i|0)==3?k:k+48|0)+40>>2]|0;i=iB(a,g,e,0,0)|0;if(i)if(g>>>0>>0){e=j+1|0;h=i+16|0;i=c[(c[h>>2]|0)+116>>2]|0;if(!i)h=1;else {wC(d,i)|0;c[(c[h>>2]|0)+116>>2]=0;h=1;}}else {h=1;e=j;}else e=j;}else e=j;k=bB(a,k,b)|0;j=e;}if(!h){c[p+(n<<2)>>2]=g;e=n+1|0;}else {c[o+(f<<2)>>2]=g;e=n;f=f+1|0;}i=j;l=bB(a,l,b)|0;n=e;}e=m+-1-i|0;a:do if((e|0)>0){if((e|0)<(n|0))g=0;else {if((e|0)!=(n|0))break;f=c[o>>2]|0;g=f+16|0;e=0;while(1){if((e|0)>=(n|0))break a;m=c[p+(e<<2)>>2]|0;TC(iB(a,f,m,0,1)|0,137460,176,1)|0;d=(c[g>>2]|0)+236|0;c[d>>2]=(c[d>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;e=e+1|0;}}while(1){if((g|0)>=(n|0)){f=2;break}f=g|1;if((f|0)>=(n|0)){f=2;break}d=c[p+(g<<2)>>2]|0;m=c[p+(f<<2)>>2]|0;TC(iB(a,d,m,0,1)|0,137460,176,1)|0;d=(c[d+16>>2]|0)+236|0;c[d>>2]=(c[d>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;g=g+2|0;e=e+-1|0;}while(1){if((e|0)<=0)break a;m=c[p>>2]|0;n=c[p+(f<<2)>>2]|0;TC(iB(a,m,n,0,1)|0,137460,176,1)|0;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;n=(c[n+16>>2]|0)+236|0;c[n>>2]=(c[n>>2]|0)+1;f=f+1|0;e=e+-1|0;}}while(0);U1(p);U1(o);return}function Cz(){return Vz(18240,c[4581]|0)|0}function Dz(a,b,d){a=a|0;b=b|0;d=d|0;d=KK(16)|0;c[d+12>>2]=0;c[d+8>>2]=c[b+8>>2];return d|0}function Ez(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Fz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return ((b|0)<(e|0)?-1:(b|0)>(e|0)&1)|0}function Gz(a){a=a|0;Rz(a)|0;return}function Hz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;f=d;e=b+16|0;c[f+8>>2]=c[(c[e>>2]|0)+236>>2];a=(nb[c[a>>2]&63](a,f,1)|0)+12|0;c[(c[e>>2]|0)+164>>2]=c[a>>2];c[a>>2]=b;l=d;return}function Iz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=b+16|0;c[g+8>>2]=c[(c[f>>2]|0)+236>>2];g=nb[c[a>>2]&63](a,g,4)|0;if(!g)qa(96322,96325,107,96335);e=g+12|0;d=c[e>>2]|0;if((d|0)==(b|0)){b=c[(c[f>>2]|0)+164>>2]|0;c[e>>2]=b;if(!b)nb[c[a>>2]&63](a,g,2)|0;}else {do{a=(c[d+16>>2]|0)+164|0;d=c[a>>2]|0;e=(d|0)!=0;}while(e&(d|0)!=(b|0));if(e)c[a>>2]=c[(c[d+16>>2]|0)+164>>2];}l=h;return}function Jz(a){a=a|0;var b=0,d=0,e=0,f=0;d=nb[c[a>>2]&63](a,0,128)|0;if(d){f=d+12|0;b=c[f>>2]|0;e=c[(c[b+16>>2]|0)+164>>2]|0;c[f>>2]=e;if(!e)nb[c[a>>2]&63](a,d,2)|0;}else b=0;return b|0}function Kz(){return Vz(18276,c[4581]|0)|0}function Lz(a,b,d){a=a|0;b=b|0;d=d|0;d=KK(12)|0;c[d+8>>2]=c[b+8>>2];return d|0}function Mz(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Nz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return (b>>>0>e>>>0?1:(b>>>0>>0)<<31>>31)|0}function Oz(a){a=a|0;Rz(a)|0;return}function Pz(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e+8>>2]=b;nb[c[a>>2]&63](a,e,1)|0;l=d;return}function Qz(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e+8>>2]=b;nb[c[a>>2]&63](a,e,2)|0;l=d;return}function Rz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;do if((a|0)!=0?(c[a+24>>2]|0)<=0:0){h=c[a+4>>2]|0;g=h+32|0;b=c[g>>2]|0;if(b){b=ob[b&127](a,2,0,h)|0;if((b|0)<0){b=-1;break}}else b=0;if(c[a+28>>2]|0)_z(a,0)|0;f=(b|0)==0;if(f){nb[c[c[a+16>>2]>>2]&63](a,0,64)|0;if((Xz(a)|0)>0){b=-1;break}d=a+8|0;b=c[d>>2]|0;if((c[b+12>>2]|0)>0){e=a+12|0;ob[c[e>>2]&127](a,c[b+8>>2]|0,0,h)|0;b=c[d>>2]|0;}else e=a+12|0;ob[c[e>>2]&127](a,b,0,h)|0;}b=c[a+20>>2]|0;if(b){if(f&(b|0)==1)ob[c[a+12>>2]&127](a,a,0,h)|0;}else U1(a);b=c[g>>2]|0;if(!b)b=0;else {ob[b&127](a,6,0,h)|0;b=0;}}else b=-1;while(0);return b|0}function Sz(a){a=a|0;var b=0,d=0,e=0;e=a+8|0;b=c[e>>2]|0;d=c[b>>2]|0;a:do if(!(d&12)){if(!(d&3)){d=b+8|0;a=c[d>>2]|0;c[d>>2]=0;break}a=Tz(a)|0;d=c[e>>2]|0;b=c[d+8>>2]|0;d=b+(c[d+12>>2]<<2)|0;while(1){if(b>>>0>=d>>>0)break a;c[b>>2]=0;b=b+4|0;}}else a=c[b+4>>2]|0;while(0);e=c[e>>2]|0;c[e>>2]=c[e>>2]&-4097;c[e+16>>2]=0;c[e+4>>2]=0;return a|0}function Tz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=a+8|0;a=c[g>>2]|0;b=c[a>>2]|0;if(!(b&4096)){a:do if(!(b&3)){if(b&112|0){a=c[a+8>>2]|0;break}a=c[a+4>>2]|0;if(!a)a=0;else {while(1){b=a+4|0;d=c[b>>2]|0;if(!d){e=a;break}c[b>>2]=c[d>>2];c[d>>2]=a;a=d;}while(1){b=c[e>>2]|0;if(!b)break a;d=c[b+4>>2]|0;if(!d){e=b;continue}while(1){c[b+4>>2]=c[d>>2];c[d>>2]=b;b=c[d+4>>2]|0;if(!b)break;else {f=d;d=b;b=f;}}c[e>>2]=d;e=d;}}}else {e=c[a+8>>2]|0;f=e+(c[a+12>>2]<<2)|0;b=0;a=0;while(1){if(e>>>0>=f>>>0)break a;d=c[e>>2]|0;if(d){if(!b){b=d;a=d;}else c[b>>2]=d;while(1){d=c[b>>2]|0;if(!d)break;else b=d;}c[e>>2]=b;}e=e+4|0;}}while(0);g=c[g>>2]|0;c[g+4>>2]=a;c[g>>2]=c[g>>2]|4096;}else a=c[a+4>>2]|0;return a|0}function Uz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;s=a+8|0;if(c[c[s>>2]>>2]&4096|0)Wz(a,0)|0;r=c[a+4>>2]|0;m=c[r>>2]|0;n=c[r+4>>2]|0;q=r+8|0;u=c[q>>2]|0;o=c[r+20>>2]|0;p=a+20|0;f=c[p>>2]&-32769;c[p>>2]=f;a:do if(!b){if(d&384|0){f=c[s>>2]|0;e=c[f+8>>2]|0;if(!e){e=0;break}if(d&256){e=c[e+4>>2]|0;c[f+4>>2]=e;if(!e){e=0;break}}else c[f+4>>2]=e;if((u|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-u)|0;break}}if(d&4098|0){e=c[s>>2]|0;if(c[e>>2]&144|0){e=0;break}e=c[e+8>>2]|0;if(!e){e=0;break}else {h=e;t=84;break}}if(!(d&64))e=0;else {i=r+16|0;b:do if((c[i>>2]|0)!=0|(u|0)<0){j=a+12|0;k=(u|0)<0;f=0-u|0;e=c[(c[s>>2]|0)+8>>2]|0;while(1){if(!e)break b;g=c[e>>2]|0;h=c[i>>2]|0;if(h|0){if(k)b=c[e+8>>2]|0;else b=e+f|0;vb[h&127](a,b,r);}if((c[q>>2]|0)>=0){e=g;continue}ob[c[j>>2]&127](a,e,0,r)|0;e=g;}}while(0);e=c[s>>2]|0;c[e+4>>2]=0;c[e+8>>2]=0;c[(c[s>>2]|0)+16>>2]=0;e=0;}}else {if(d&2049|0){g=r+12|0;e=c[g>>2]|0;h=(d&1|0)==0;if(!(h|(e|0)==0)){e=nb[e&63](a,b,r)|0;if(!e){e=0;break}else f=e;}else f=b;do if((u|0)>-1)h=f+u|0;else {e=ob[c[a+12>>2]&127](a,0,12,r)|0;if(e|0){c[e+8>>2]=f;h=e;break}if(!(c[g>>2]|0)){e=0;break a}e=c[r+16>>2]|0;if(h|(e|0)==0){e=0;break a}vb[e&127](a,f,r);e=0;break a}while(0);g=c[s>>2]|0;e=c[g>>2]|0;do if(!(e&128)){if(!(e&16))if(!(e&32)){t=51;break}else {t=48;break}f=c[g+4>>2]|0;e=(f|0)!=0;if(!(d&8192)){if(!e){t=48;break}if((f|0)==(c[g+8>>2]|0)){t=48;break}r=f+4|0;a=c[r>>2]|0;c[h+4>>2]=a;c[a>>2]=h;c[h>>2]=f;c[r>>2]=h;break}else {if(!e){t=51;break}e=c[f>>2]|0;if(!e){t=51;break}c[h>>2]=e;c[e+4>>2]=h;c[h+4>>2]=f;c[f>>2]=h;break}}else if(!(d&8192))t=48;else t=51;while(0);if((t|0)==48){e=c[g+8>>2]|0;c[h>>2]=e;if(!e)e=h;else c[h+4>>2]=c[e+4>>2];c[e+4>>2]=h;c[(c[s>>2]|0)+8>>2]=h;}else if((t|0)==51){f=g+8|0;e=c[f>>2]|0;if(!e){c[f>>2]=h;e=h;}else {r=e+4|0;c[c[r>>2]>>2]=h;c[h+4>>2]=c[r>>2];}c[e+4>>2]=h;c[h>>2]=0;}e=c[s>>2]|0;f=e+16|0;g=c[f>>2]|0;if((g|0)>-1)c[f>>2]=g+1;c[e+4>>2]=h;if((u|0)<0){e=c[h+8>>2]|0;break}else {e=h+(0-u)|0;break}}h=c[s>>2]|0;do if(!(d&512)){e=c[h+4>>2]|0;if(e|0){if((u|0)<0)g=c[e+8>>2]|0;else g=e+(0-u)|0;if((g|0)==(b|0))break}e=b+m|0;if((n|0)<0){b=c[e>>2]|0;t=68;}else {b=e;t=68;}}else t=68;while(0);if((t|0)==68){g=(u|0)<0;i=(n|0)<0;j=(o|0)==0;k=(n|0)<1;l=0-u|0;e=h+8|0;do{e=c[e>>2]|0;if(!e){e=0;break a}if(g)f=c[e+8>>2]|0;else f=e+l|0;f=f+m|0;if(i)f=c[f>>2]|0;do if(j)if(k){f=s2(b,f)|0;break}else {f=$3(b,f,n)|0;break}else f=ob[o&127](a,b,f,r)|0;while(0)}while((f|0)!=0);f=c[p>>2]|0;}c[p>>2]=f|32768;if(!(d&4098)){do if(!(d&8)){f=c[s>>2]|0;if(!(d&16)){c[f+4>>2]=e;break}if((e|0)==(c[f+8>>2]|0)){c[f+4>>2]=0;e=0;break a}else {e=e+4|0;t=108;break}}else {f=c[s>>2]|0;t=108;}while(0);if((t|0)==108){e=c[e>>2]|0;c[f+4>>2]=e;if(!e){e=0;break}}if((u|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-u)|0;break}}else {h=e;t=84;}}while(0);if((t|0)==84){e=c[h>>2]|0;if(e){c[e+4>>2]=c[h+4>>2];e=c[h>>2]|0;}f=(c[s>>2]|0)+8|0;g=c[f>>2]|0;if((h|0)==(g|0)){c[f>>2]=e;e=c[(c[s>>2]|0)+8>>2]|0;if(e|0)c[e+4>>2]=c[h+4>>2];}else {f=h+4|0;c[c[f>>2]>>2]=e;e=g+4|0;if((h|0)==(c[e>>2]|0))c[e>>2]=c[f>>2];}e=c[s>>2]|0;f=e+4|0;if((h|0)==(c[f>>2]|0))g=c[h>>2]|0;else g=0;c[f>>2]=g;t=e+16|0;c[t>>2]=(c[t>>2]|0)+-1;if((u|0)<0)e=c[h+8>>2]|0;else e=h+(0-u)|0;f=c[r+16>>2]|0;if(!((d&2|0)==0|(f|0)==0))vb[f&127](a,e,r);if((c[q>>2]|0)<0)ob[c[a+12>>2]&127](a,h,0,r)|0;}return e|0}function Vz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;a:do if((a|0)!=0&(b|0)!=0?(f=T1(40)|0,(f|0)!=0):0){c[f>>2]=0;c[f+16>>2]=0;c[f+4>>2]=0;bA(f,a,0)|0;d=f+20|0;i=a+32|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;d=c[i>>2]|0;do if(d){c[g>>2]=0;d=ob[d&127](f,1,g,a)|0;if((d|0)>=0)if(d){e=c[g>>2]|0;if(e|0)if(!(c[b+4>>2]&c[e>>2])){d=f;h=12;break}else {d=f;break}d=a+28|0;if(!(c[d>>2]|0)){d=f;h=12;}else {U1(f);e=ob[c[d>>2]&127](0,0,40,a)|0;if(!e){d=0;break a}c[e>>2]=0;c[e+16>>2]=0;c[e+4>>2]=0;bA(e,a,0)|0;c[e+20>>2]=1;c[e+24>>2]=0;c[e+32>>2]=0;c[e+28>>2]=0;d=e;f=e;h=11;}}else {d=f;h=11;}else {d=f;h=12;}}else {d=f;h=11;}while(0);if((h|0)==11){e=ob[c[d+12>>2]&127](d,0,28,a)|0;c[g>>2]=e;if(!e){d=f;h=12;}else {c[e>>2]=c[b+4>>2];g=e+4|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;}}if((h|0)==12){U1(d);d=0;break}c[d+8>>2]=e;c[d>>2]=c[b>>2];c[d+16>>2]=b;e=c[i>>2]|0;if(e)ob[e&127](d,5,f,a)|0;}else d=0;while(0);l=j;return d|0}function Wz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=c[c[a+16>>2]>>2]|0;j=a+8|0;g=c[j>>2]|0;h=c[g>>2]|0;d=h&4096;if(!b)if(!d)b=-1;else {e=d;b=c[g+4>>2]|0;i=5;}else if(!(c[g+16>>2]|0)){e=0;i=5;}else b=-1;a:do if((i|0)==5){c[g>>2]=h&-4097;if(!(h&3)){d=g+4|0;if(!(h&12)){c[d>>2]=0;d=g+8|0;}c[d>>2]=b;if(e|0){b=0;break}c[(c[j>>2]|0)+16>>2]=-1;b=0;break}c[g+4>>2]=0;if(!e){c[g+16>>2]=0;while(1){if(!b){b=0;break a}j=c[b>>2]|0;nb[f&63](a,b,32)|0;b=j;}}e=c[g+8>>2]|0;a=e+(c[g+12>>2]<<2)|0;while(1){if(e>>>0>=a>>>0){b=0;break a}d=c[e>>2]|0;if(d){c[e>>2]=b;b=c[d>>2]|0;c[d>>2]=0;}e=e+4|0;}}while(0);return b|0}function Xz(a){a=a|0;var b=0,d=0,e=0;b=a+8|0;d=c[b>>2]|0;if(c[d>>2]&4096){Wz(a,0)|0;d=c[b>>2]|0;}e=d+16|0;a=c[e>>2]|0;do if((a|0)<0){b=c[d>>2]|0;if(b&12|0){a=Yz(c[d+4>>2]|0)|0;c[e>>2]=a;break}if(b&112){a=0;b=d+8|0;while(1){b=c[b>>2]|0;if(!b)break;a=a+1|0;}c[e>>2]=a;}}while(0);return a|0}function Yz(a){a=a|0;var b=0;if(!a)return 0;else {b=Yz(c[a+4>>2]|0)|0;return b+1+(Yz(c[a>>2]|0)|0)|0}return 0}function Zz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;G=l;l=l+128|0;z=G+120|0;r=G;F=a+8|0;e=c[F>>2]|0;if(c[e>>2]&4096){Wz(a,0)|0;e=c[F>>2]|0;}E=c[a+4>>2]|0;A=c[E>>2]|0;B=c[E+4>>2]|0;x=E+8|0;D=c[x>>2]|0;C=c[E+20>>2]|0;t=a+20|0;c[t>>2]=c[t>>2]&-32769;h=c[e+4>>2]|0;a:do if(!b)if((d&448|0)==0|(h|0)==0)e=0;else {if(!(d&64)){b:do if(!(d&256)){e=h;while(1){f=e+4|0;g=c[f>>2]|0;if(!g)break b;c[f>>2]=c[g>>2];c[g>>2]=e;e=g;}}else {e=h;while(1){f=c[e>>2]|0;if(!f)break b;a=f+4|0;c[e>>2]=c[a>>2];c[a>>2]=e;e=f;}}while(0);c[(c[F>>2]|0)+4>>2]=e;if((D|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-D)|0;break}}b=E+16|0;if((c[b>>2]|0)!=0|(D|0)<0){j=a+12|0;k=(D|0)<0;i=0-D|0;e=h;do{h=e;while(1){e=h+4|0;f=c[e>>2]|0;if(!f)break;c[e>>2]=c[f>>2];c[f>>2]=h;h=f;}e=c[h>>2]|0;f=c[b>>2]|0;if(f|0){if(k)g=c[h+8>>2]|0;else g=h+i|0;vb[f&127](a,g,E);}if((c[x>>2]|0)<0)ob[c[j>>2]&127](a,h,0,E)|0;}while((e|0)!=0);e=c[F>>2]|0;}c[e+16>>2]=0;c[e+4>>2]=0;e=0;}else {y=a+16|0;u=(d&4098|0)==0;c:do if(u|(c[(c[y>>2]|0)+4>>2]|0)!=8)v=45;else {k=(B|0)<0;e=b+A|0;if(k)e=c[e>>2]|0;i=(C|0)==0;j=(B|0)<1;g=nb[c[a>>2]&63](a,b,4)|0;while(1){if(!g){v=45;break c}f=g+A|0;if(k)f=c[f>>2]|0;do if(i)if(j){f=s2(e,f)|0;break}else {f=$3(e,f,B)|0;break}else f=ob[C&127](a,e,f,E)|0;while(0);if(f|0){v=45;break c}if((g|0)==(b|0))break;g=nb[c[a>>2]&63](a,g,8)|0;}h=c[(c[F>>2]|0)+4>>2]|0;c[z>>2]=c[h+4>>2];c[z+4>>2]=c[h>>2];e=z;v=180;}while(0);d:do if((v|0)==45){do if(!(d&2565)){if(d&32|0){if((D|0)<0)g=c[b+8>>2]|0;else g=b+(0-D)|0;e=g+A|0;if((B|0)<0)f=c[e>>2]|0;else f=e;if(!h){e=b;f=z;h=z;v=198;break}else {e=b;s=f;j=b;v=64;break}}if(h){if((D|0)<0)e=c[h+8>>2]|0;else e=h+(0-D)|0;if((e|0)!=(b|0)){f=b+A|0;if((B|0)<0){g=b;e=0;s=c[f>>2]|0;j=0;v=64;}else {g=b;e=0;s=f;j=0;v=64;}}else {e=0;g=b;f=z;k=z;j=0;v=141;}}else {e=0;g=b;f=z;h=z;v=198;}}else {if(!(d&512)){e=b+A|0;if((B|0)<0)f=c[e>>2]|0;else f=e;}else f=b;if(!h){e=0;g=b;f=z;h=z;v=198;}else {g=b;e=0;s=f;j=0;v=64;}}while(0);e:do if((v|0)==64){f:do if((c[(c[y>>2]|0)+4>>2]|0)==4?(q=c[(c[F>>2]|0)+24>>2]|0,!((d&516|0)==0|(q|0)==0)):0){b=(D|0)<0;m=(B|0)<0;n=(C|0)==0;o=(B|0)<1;p=0-D|0;k=0;f=h;while(1){if((k|0)>=(q|0)){f=z;k=z;m=0;break}if(b)i=c[f+8>>2]|0;else i=f+p|0;i=i+A|0;if(m)i=c[i>>2]|0;do if(n)if(o){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if(!i){v=80;break}c[r+(k<<2)>>2]=i;f=c[((i|0)<0?f+4|0:f)>>2]|0;if(!f){e=0;break a}else k=k+1|0;}if((v|0)==80)if(b){e=c[f+8>>2]|0;break a}else {e=f+p|0;break a}while(1){if((m|0)>=(q|0))break f;do if((c[r+(m<<2)>>2]|0)<0){i=h+4|0;b=c[i>>2]|0;if((c[r+((m|1)<<2)>>2]|0)<0){c[i>>2]=c[b>>2];c[b>>2]=h;c[f+4>>2]=b;f=b;h=k;i=b+4|0;break}else {c[k>>2]=b;c[f+4>>2]=h;f=h;h=b;i=b;break}}else {i=c[h>>2]|0;if((c[r+((m|1)<<2)>>2]|0)>0){p=i+4|0;c[h>>2]=c[p>>2];c[p>>2]=h;c[k>>2]=i;h=i;break}else {c[f+4>>2]=i;c[k>>2]=h;f=i;i=i+4|0;break}}while(0);k=h;m=m+2|0;h=c[i>>2]|0;}}else {f=z;k=z;}while(0);n=(D|0)<0;o=(B|0)<0;p=(C|0)!=0;q=(B|0)<1;r=0-D|0;i=h;g:while(1){h=i;while(1){if(n)i=c[h+8>>2]|0;else i=h+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if(!i){v=140;break g}if((i|0)>=0)break;b=h+4|0;m=c[b>>2]|0;if(!m){v=121;break g}if(n)i=c[m+8>>2]|0;else i=m+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if((i|0)>=0){v=118;break}c[b>>2]=c[m>>2];c[m>>2]=h;c[f+4>>2]=m;h=c[m+4>>2]|0;if(!h){f=m;h=k;v=198;break e}else f=m;}if((v|0)==118){v=0;if(!i){v=119;break}c[k>>2]=m;c[f+4>>2]=h;i=c[m>>2]|0;if(!i){f=h;h=m;v=198;break e}else {f=h;k=m;continue}}b=c[h>>2]|0;if(!b){v=139;break}if(n)i=c[b+8>>2]|0;else i=b+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if((i|0)>0){i=b+4|0;c[h>>2]=c[i>>2];c[i>>2]=h;c[k>>2]=b;i=c[b>>2]|0;if(!i){h=b;v=198;break e}else {k=b;continue}}if(!i){v=137;break}c[f+4>>2]=b;c[k>>2]=h;i=c[b+4>>2]|0;if(!i){f=b;v=198;break e}else {f=b;k=h;}}if((v|0)==119){c[f+4>>2]=h;f=h;h=m;v=141;break}else if((v|0)==121){c[f+4>>2]=h;f=h;h=k;v=198;break}else if((v|0)==137){c[k>>2]=h;k=h;h=b;v=141;break}else if((v|0)==139){c[k>>2]=h;v=198;break}else if((v|0)==140)if(!h){h=k;v=198;break}else {v=141;break}}while(0);do if((v|0)==141){c[t>>2]=c[t>>2]|32768;i=h+4|0;c[k>>2]=c[i>>2];c[f+4>>2]=c[h>>2];if(!(d&516)){if(d&8|0){c[i>>2]=c[z>>2];c[h>>2]=0;c[z>>2]=h;v=169;break}if(d&16|0){v=z+4|0;c[h>>2]=c[v>>2];c[i>>2]=0;c[v>>2]=h;v=175;break}if(!u){e=f;v=180;break d}if(d&2049|0){if(c[(c[y>>2]|0)+4>>2]&4|0){e=h;break}c[i>>2]=0;e=z+4|0;c[h>>2]=c[e>>2];c[e>>2]=h;e=h;v=205;break}if(!(d&32)){e=0;break a}if(!(c[(c[y>>2]|0)+4>>2]&4)){c[e+4>>2]=0;x=z+4|0;c[e>>2]=c[x>>2];c[x>>2]=j;e=(c[F>>2]|0)+16|0;c[e>>2]=(c[e>>2]|0)+1;e=h;break}e=c[E+16>>2]|0;if(e|0)vb[e&127](a,g,E);if((c[x>>2]|0)<0){ob[c[a+12>>2]&127](a,j,0,E)|0;e=h;}else e=h;}else e=h;}else if((v|0)==198){c[f+4>>2]=0;c[h>>2]=0;if(!(d&8))if(!(d&16)){if(d&516|0){e=f;break d}if(!(d&2049)){if(!(d&32)){g=0;e=f;break d}x=(c[F>>2]|0)+16|0;c[x>>2]=(c[x>>2]|0)+1;}else {e=0;v=205;}}else v=175;else v=169;}while(0);if((v|0)==169){h=z+4|0;e=c[h>>2]|0;if(!e){e=f;break}while(1){f=e+4|0;g=c[f>>2]|0;if(!g)break;c[f>>2]=c[g>>2];c[g>>2]=e;e=g;}c[h>>2]=c[e>>2];}else if((v|0)==175){e=c[z>>2]|0;if(!e){e=f;break}while(1){f=c[e>>2]|0;if(!f)break;x=f+4|0;c[e>>2]=c[x>>2];c[x>>2]=e;e=f;}c[z>>2]=c[e+4>>2];}else if((v|0)==205){i=E+12|0;h=c[i>>2]|0;j=(d&1|0)==0;if(!(j|(h|0)==0))g=nb[h&63](a,g,E)|0;do if(g){if((D|0)>-1){e=g+D|0;v=215;break}e=ob[c[a+12>>2]&127](a,0,12,E)|0;if(e|0){c[e+8>>2]=g;break}if((c[i>>2]|0)!=0?(w=c[E+16>>2]|0,!(j|(w|0)==0)):0){vb[w&127](a,g,E);v=215;}else v=215;}else v=215;while(0);if((v|0)==215)if(!e){e=f;break}f=(c[F>>2]|0)+16|0;g=c[f>>2]|0;if((g|0)>-1)c[f>>2]=g+1;}c[e+4>>2]=c[z>>2];c[e>>2]=c[z+4>>2];h:do if(!((d&516|0)==0?1:(c[(c[y>>2]|0)+4>>2]&8|0)==0)){m=(D|0)<0;if(m)f=c[e+8>>2]|0;else f=e+(0-D)|0;n=(B|0)<0;f=f+A|0;if(n)f=c[f>>2]|0;j=(C|0)==0;k=(B|0)<1;b=0-D|0;while(1){i=e+4|0;g=c[i>>2]|0;if(!g)break h;while(1){h=c[g>>2]|0;if(!h)break;z=h+4|0;c[g>>2]=c[z>>2];c[z>>2]=g;g=h;}c[i>>2]=g;if(m)h=c[g+8>>2]|0;else h=g+b|0;h=h+A|0;if(n)h=c[h>>2]|0;do if(j)if(k){h=s2(f,h)|0;break}else {h=$3(f,h,B)|0;break}else h=ob[C&127](a,f,h,E)|0;while(0);if(h|0)break h;c[i>>2]=c[g>>2];c[g>>2]=e;e=g;}}while(0);c[(c[F>>2]|0)+4>>2]=e;if((D|0)<0){e=c[e+8>>2]|0;break a}else {e=e+(0-D)|0;break a}}while(0);if((v|0)==180){if((D|0)<0)g=c[h+8>>2]|0;else g=h+(0-D)|0;f=c[E+16>>2]|0;if(!((d&2|0)==0|(f|0)==0))vb[f&127](a,g,E);if((c[x>>2]|0)<0)ob[c[a+12>>2]&127](a,h,0,E)|0;a=(c[F>>2]|0)+16|0;E=c[a>>2]|0;c[a>>2]=(E|0)<1?-1:E+-1|0;}do{f=e+4|0;e=c[f>>2]|0;}while((e|0)!=0);c[f>>2]=c[z>>2];c[(c[F>>2]|0)+4>>2]=c[z+4>>2];e=d&2|0?g:0;}while(0);l=G;return e|0}function _z(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(c[c[a+8>>2]>>2]&4096|0)Wz(a,0)|0;f=(b|0)!=0;if(f){if(c[c[b+8>>2]>>2]&4096|0)Wz(b,0)|0;if((c[b+16>>2]|0)==(c[a+16>>2]|0)){d=b;e=7;}else b=0;}else {d=0;e=7;}a:do if((e|0)==7){while(1){if(!d)break;if((d|0)==(a|0)){b=0;break a}d=c[d+28>>2]|0;e=7;}d=a+28|0;e=c[d>>2]|0;if(e|0){g=e+24|0;c[g>>2]=(c[g>>2]|0)+-1;}c[a+32>>2]=0;c[d>>2]=0;if(f){c[d>>2]=b;c[a>>2]=28;g=b+24|0;c[g>>2]=(c[g>>2]|0)+1;break}else {c[a>>2]=c[c[a+16>>2]>>2];b=e;break}}while(0);return b|0}function $z(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a:do if(!(d&99)){if((d&516|0)==0?(e=c[(c[a+16>>2]|0)+4>>2]|0,!((d&384|0)!=0&(e&12|0)==0)):0){if(e&12|0){if(!(d&408)){e=0;break}o=(d&136|0)!=0;p=(d&272|0)!=0;l=0;f=0;e=0;n=a;while(1){if(!n)break;m=nb[c[c[n+16>>2]>>2]&63](n,b,d)|0;do if(!m)g=l;else {h=c[n+4>>2]|0;i=c[h+4>>2]|0;j=c[h+20>>2]|0;g=m+(c[h>>2]|0)|0;if((i|0)<0)k=c[g>>2]|0;else k=g;if(e|0){do if(!j)if((i|0)<1){g=s2(k,f)|0;break}else {g=$3(k,f,i)|0;break}else g=ob[j&127](n,k,f,h)|0;while(0);if(!(o&(g|0)<0|p&(g|0)>0)){g=l;break}}g=n;f=k;e=m;}while(0);l=g;n=c[n+28>>2]|0;}c[a+32>>2]=l;break}if(!(d&24)){e=0;break}j=a+32|0;f=c[j>>2]|0;if(f){e=c[(c[f+4>>2]|0)+8>>2]|0;g=c[(c[f+8>>2]|0)+4>>2]|0;if((e|0)<0)e=c[g+8>>2]|0;else e=g+(0-e)|0;if((e|0)==(b|0))e=b;else {f=a;h=32;}}else {f=a;h=32;}do if((h|0)==32){while(1){if(!f){h=33;break}e=nb[c[c[f+16>>2]>>2]&63](f,b,4)|0;if(e|0){h=36;break}f=c[f+28>>2]|0;h=32;}if((h|0)==33){c[j>>2]=0;e=0;break a}else if((h|0)==36){c[j>>2]=f;break}}while(0);i=(d<<4&128^128)+128|0;e=nb[c[c[f+16>>2]>>2]&63](f,e,d)|0;while(1){h=f+16|0;while(1){if(!e)break;else g=a;while(1){if((g|0)==(f|0))break a;if(nb[c[c[g+16>>2]>>2]&63](g,e,4)|0)break;g=c[g+28>>2]|0;}e=nb[c[c[h>>2]>>2]&63](f,e,d)|0;}f=c[f+28>>2]|0;c[j>>2]=f;if(!f){e=0;break a}e=nb[c[c[f+16>>2]>>2]&63](f,0,i)|0;}}else f=a;while(1){if(!f){f=0;e=0;break}e=nb[c[c[f+16>>2]>>2]&63](f,b,d)|0;if(e|0)break;f=c[f+28>>2]|0;}c[a+32>>2]=f;}else e=nb[c[c[a+16>>2]>>2]&63](a,b,d)|0;while(0);return e|0}function aA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=a+32|0;f=nb[c[a>>2]&63](a,0,128)|0;do{if(!f){e=0;break}h=c[g>>2]|0;e=f;f=nb[c[a>>2]&63](a,f,8)|0;e=nb[b&63]((h|0)==0?a:h,e,d)|0;}while((e|0)>=0);return e|0}function bA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=a+4|0;n=c[f>>2]|0;a:do if(n)if(b){m=c[c[a+16>>2]>>2]|0;g=a+8|0;if(c[c[g>>2]>>2]&4096|0)Wz(a,0)|0;e=c[n+32>>2]|0;if(e|0?(ob[e&127](a,3,b,n)|0)<0:0){b=0;break}c[f>>2]=b;e=c[b+28>>2]|0;c[a+12>>2]=(e|0)==0?52:e;e=c[c[g>>2]>>2]|0;if(!(e&112)){do if(!(e&2))if(!(e&3))if(!(d&1))break;else {b=n;break a}else if((d&3|0)==3){b=n;break a}else break;else if(d&2|0){b=n;break a}while(0);h=Tz(a)|0;e=c[g>>2]|0;l=c[e>>2]|0;c[e>>2]=l&-4097;c[e+4>>2]=0;c[e+16>>2]=0;b:do if(l&3|0){l=c[e+8>>2]|0;f=l+(c[e+12>>2]<<2)|0;e=l;while(1){if(e>>>0>=f>>>0)break b;c[e>>2]=0;e=e+4|0;}}while(0);i=(d&2|0)==0;j=b+8|0;k=b+4|0;l=b+24|0;while(1){if(!h){b=n;break a}d=c[h>>2]|0;if(i){e=c[j>>2]|0;if((e|0)<0)e=c[h+8>>2]|0;else e=h+(0-e)|0;g=c[k>>2]|0;e=e+(c[b>>2]|0)|0;if((g|0)<0)e=c[e>>2]|0;f=c[l>>2]|0;if(!f)e=dA(0,e,g)|0;else e=nb[f&63](a,e,b)|0;c[h+4>>2]=e;}nb[m&63](a,h,32)|0;h=d;}}else b=n;}else b=n;else {c[f>>2]=b;n=c[b+28>>2]|0;c[a+12>>2]=(n|0)==0?52:n;}while(0);return b|0}function cA(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=(c|0)==0;do if(!b)if(a)a=0;else a=T1(c)|0;else if(a){U1(b);a=0;break}else {a=W1(b,c)|0;break}while(0);return a|0}function dA(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;g=c;if((e|0)>=1){h=c+e+-1|0;g=(h>>>0>>0?c:h)+(1-g)&-2;f=c;while(1){if(f>>>0>=h>>>0)break;b=O(((d[f>>0]|0)<<8)+b+(d[f+1>>0]|0)|0,17109811)|0;f=f+2|0;}f=c+g|0;if(f>>>0>h>>>0)c=e;else {c=e;b=O(((d[f>>0]|0)<<8)+b|0,17109811)|0;}}else {while(1){f=a[c>>0]|0;if(!(f<<24>>24))break;h=a[c+1>>0]|0;e=O(((f&255)<<8)+b+(h&255)|0,17109811)|0;b=e;c=c+(h<<24>>24?2:1)|0;}c=c-g|0;}return O(b+c|0,17109811)|0}function eA(a){a=a|0;var b=0;b=c[46935]|0;c[46935]=a;return b|0}function fA(a){a=a|0;var b=0;b=c[46936]|0;c[46936]=a;return b|0}function gA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=hA(a,b,f)|0;l=e;return d|0}function hA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=l;l=l+16|0;e=g;f=(a|0)==3;h=f?c[46938]|0:(a|0)==2?1:a;c[46938]=h;i=c[46939]|0;c[46939]=i>>>0>h>>>0?i:h;do if(h>>>0<(c[46936]|0)>>>0){a=c[46937]|0;if(!a){a=C6()|0;c[46937]=a;if(!a){a=1;break}}if(!f){F6(a)|0;a=c[46937]|0;}H3(a,b,d)|0;a=0;}else {if(c[46935]|0){iA(a,b,d);a=0;break}if(f)a=c[15712]|0;else {i=c[15712]|0;c[e>>2]=(a|0)==1?96349:96355;w4(i,96363,e)|0;a=i;}H3(a,b,d)|0;a=0;}while(0);l=g;return a|0}function iA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if((c[46940]|0)==0?(f=T1(c[4590]|0)|0,c[46940]=f,(f|0)==0):0)T4(96368,c[15712]|0)|0;else e=4;do if((e|0)==4){if((a|0)!=3){kb[c[46935]&63]((a|0)==1?96349:96355)|0;kb[c[46935]&63](97027)|0;}while(1){a=G3(c[46940]|0,c[4590]|0,b,d)|0;e=c[4590]|0;if((a|0)>-1&(a|0)<(e|0)){e=7;break}e=e<<1;f=a+1|0;f=(e|0)>(f|0)?e:f;c[4590]=f;if(!(W1(c[46940]|0,f)|0)){e=9;break}}if((e|0)==7){kb[c[46935]&63](c[46940]|0)|0;break}else if((e|0)==9){T4(96368,c[15712]|0)|0;break}}while(0);return}function jA(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;hA(1,a,e)|0;l=d;return}function kA(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!e){e=(d|0)==0?1024:d;d=e;e=T1(e)|0;f=1;}else f=0;c[b+12>>2]=f;c[b>>2]=e;c[b+8>>2]=e+d;c[b+4>>2]=e;a[e>>0]=0;return}function lA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=a+8|0;f=c[a>>2]|0;g=(c[h>>2]|0)-f|0;e=g<<1;g=g+b|0;e=g>>>0>e>>>0?g:e;g=a+4|0;b=f;f=(c[g>>2]|0)-f|0;d=a+12|0;if(!(c[d>>2]|0)){i=T1(e)|0;W6(i|0,b|0,f|0)|0;c[d>>2]=1;b=i;}else b=W1(b,e)|0;c[a>>2]=b;c[g>>2]=b+f;c[h>>2]=b+e;return 0}function mA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=a+4|0;e=c[f>>2]|0;if((e+d|0)>>>0>(c[a+8>>2]|0)>>>0){lA(a,d)|0;e=c[f>>2]|0;}W6(e|0,b|0,d|0)|0;c[f>>2]=(c[f>>2]|0)+d;return d|0}function nA(a,b){a=a|0;b=b|0;return mA(a,b,l2(b)|0)|0}function oA(a){a=a|0;if(c[a+12>>2]|0)U1(c[a>>2]|0);return}function pA(a){a=a|0;var b=0,e=0;b=a+4|0;e=c[b>>2]|0;if(e>>>0>(c[a>>2]|0)>>>0){c[b>>2]=e+-1;a=d[e>>0]|0;}else a=-1;return a|0}function qA(a,b,d){a=a|0;b=b|0;d=d|0;hD(c[46942]|0,c[b+8>>2]|0)|0;hD(c[46942]|0,c[b+12>>2]|0)|0;eC(c[46942]|0,b);return}function rA(a,b){a=a|0;b=b|0;var c=0;c=RC(a,96416,0)|0;if((b|0)!=0&(c|0)==0){sA(a);c=RC(a,96416,0)|0;}return c|0}function sA(a){a=a|0;var b=0,c=0,d=0;d=yC(a)|0;BE(d,d,107,0,1)|0;c=jC(d)|0;while(1){if(!c)break;uA(a,c);b=XA(d,c)|0;while(1){if(!b)break;vA(a,b);b=ZA(d,b)|0;}c=kC(d,c)|0;}return}function tA(b){b=b|0;var c=0;c=b+24|0;a[c>>0]=a[c>>0]|64;AA(b);c=QD(b)|0;xA((c|0)==0?b:c,b);return}function uA(a,b){a=a|0;b=b|0;var d=0;d=wA(b)|0;if(!((d|0)!=0?(c[d+8>>2]|0)!=0:0))xA(a,b);return}function vA(a,b){a=a|0;b=b|0;var d=0;d=wA(b)|0;if(!((d|0)!=0?(c[d+8>>2]|0)!=0:0))xA(a,b);return}function wA(a){a=a|0;return RC(a,96404,0)|0}function xA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=TC(b,96404,16,0)|0;f=yA(a,c[b>>2]&3)|0;e=d+8|0;a:do if(!(c[e>>2]|0)){a=yC(a)|0;c[e>>2]=yA(a,c[b>>2]&3)|0;a=zA(b)|0;d=d+12|0;c[d>>2]=dC(xC(b)|0,((a|0)>4?a:4)<<2)|0;a=nb[c[f>>2]&63](f,0,128)|0;while(1){if(!a)break a;e=xC(b)|0;e=fD(e,c[a+12>>2]|0)|0;c[(c[d>>2]|0)+(c[a+16>>2]<<2)>>2]=e;a=nb[c[f>>2]&63](f,a,8)|0;}}while(0);return}function yA(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;a=rA(a,0)|0;a:do if(!a)a=0;else switch(b|0){case 0:{a=c[a+16>>2]|0;break a}case 1:{a=c[a+8>>2]|0;break a}case 2:case 3:{a=c[a+12>>2]|0;break a}default:{c[d>>2]=b;gA(1,96429,d)|0;a=0;break a}}while(0);l=e;return a|0}function zA(a){a=a|0;var b=0;b=yC(xC(a)|0)|0;a=yA(b,c[a>>2]&3)|0;if(!a)a=0;else a=Xz(a)|0;return a|0}function AA(a){a=a|0;var b=0,d=0,e=0,f=0;d=TC(a,96416,20,0)|0;e=d+8|0;c[e>>2]=UD(a,18364,c[4589]|0)|0;f=d+12|0;c[f>>2]=UD(a,18364,c[4589]|0)|0;d=d+16|0;c[d>>2]=UD(a,18364,c[4589]|0)|0;b=QD(a)|0;if(!b){b=c[46941]|0;if(!((b|0)==0|(b|0)==(a|0))){b=rA(b,0)|0;BA(c[b+8>>2]|0,c[e>>2]|0,a,1);BA(c[b+12>>2]|0,c[f>>2]|0,a,2);BA(c[b+16>>2]|0,c[d>>2]|0,a,0);}}else {a=rA(b,0)|0;_z(c[e>>2]|0,c[a+8>>2]|0)|0;_z(c[f>>2]|0,c[a+12>>2]|0)|0;_z(c[d>>2]|0,c[a+16>>2]|0)|0;}return}function BA(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=nb[c[b>>2]&63](b,0,128)|0;while(1){if(!g)break;h=CA(e,c[g+8>>2]|0,c[g+12>>2]|0,c[g+16>>2]|0,f)|0;a[h+22>>0]=a[g+22>>0]|0;a[h+21>>0]=a[g+21>>0]|0;nb[c[d>>2]&63](d,h,1)|0;g=nb[c[b>>2]&63](b,g,8)|0;}return}function CA(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=dC(b,24)|0;a[h+20>>0]=g;c[h+8>>2]=fD(b,d)|0;c[h+12>>2]=fD(b,e)|0;c[h+16>>2]=f;return h|0}function DA(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+32|0;e=d;c[e+8>>2]=b;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function EA(a,b){a=a|0;b=b|0;var c=0;c=_z(a,0)|0;b=DA(a,b)|0;_z(a,c)|0;return b|0}function FA(a,b){a=a|0;b=b|0;a=wA(a)|0;if(!a)a=0;else a=DA(c[a+8>>2]|0,b)|0;return a|0}function GA(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;if(!b){b=c[46941]|0;if(!b){a[g>>0]=a[18400]|0;a[g+1>>0]=a[18401]|0;a[g+2>>0]=a[18402]|0;a[g+3>>0]=a[18403]|0;b=oB(0,g,0)|0;c[46941]=b;}}if(!f)b=IA(b,d,e)|0;else b=HA(b,d,e,f)|0;l=h;return b|0}function HA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yC(a)|0;rA(a,1)|0;g=yA(a,b)|0;f=EA(g,d)|0;a:do if(!f){f=DA(g,d)|0;if(f|0){f=CA(a,d,e,c[f+16>>2]|0,b)|0;nb[c[g>>2]&63](g,f,1)|0;h=16;break}g=yA(i,b)|0;f=CA(a,d,e,Xz(g)|0,b)|0;nb[c[g>>2]&63](g,f,1)|0;switch(b|0){case 0:{BE(i,i,57,f,1)|0;h=16;break a}case 1:{d=jC(i)|0;while(1){if(!d){h=16;break a}JA(a,d,f);d=kC(i,d)|0;}}case 2:case 3:{g=jC(i)|0;while(1){if(!g){h=16;break a}d=XA(i,g)|0;while(1){if(!d)break;JA(a,d,f);d=ZA(i,d)|0;}g=kC(i,g)|0;}}default:break a}}else {h=f+12|0;hD(a,c[h>>2]|0)|0;c[h>>2]=fD(a,e)|0;h=16;}while(0);if((h|0)==16)if((b|0)==0&(f|0)!=0)KA(a,f,e)|0;BC(a,a,f);return f|0}function IA(a,b,c){a=a|0;b=b|0;c=c|0;a=yA(a,b)|0;if(!a)a=0;else a=DA(a,c)|0;return a|0}function JA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;b=wA(b)|0;f=d+16|0;e=c[f>>2]|0;if((e|0)>3){g=c[a+64>>2]|0;b=b+12|0;e=e<<2;c[b>>2]=ob[c[(c[g>>2]|0)+8>>2]&127](c[g+12>>2]|0,c[b>>2]|0,e,e+4|0)|0;}else b=b+12|0;g=fD(a,c[d+12>>2]|0)|0;c[(c[b>>2]|0)+(c[f>>2]<<2)>>2]=g;return}function KA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=xC(a)|0;g=(wA(a)|0)+12|0;i=b+16|0;hD(h,c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]|0)|0;f=fD(h,d)|0;c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]=f;do if(!(c[a>>2]&3)){e=c[(rA(h,0)|0)+16>>2]|0;f=b+8|0;g=EA(e,c[f>>2]|0)|0;if(!g){i=CA(h,c[f>>2]|0,d,c[i>>2]|0,c[a>>2]&3)|0;nb[c[e>>2]&63](e,i,1)|0;break}else {i=g+12|0;hD(h,c[i>>2]|0)|0;c[i>>2]=fD(h,d)|0;break}}while(0);BC(h,a,b);return 0}function LA(a,b,d){a=a|0;b=b|0;d=d|0;a=yA(a,b)|0;do if(a){b=c[a>>2]|0;if(!d){a=nb[b&63](a,0,128)|0;break}else {a=nb[b&63](a,d,8)|0;break}}else a=0;while(0);return a|0}function MA(a){a=a|0;var b=0;c[46942]=a;b=wA(a)|0;if(b|0){NA(a,b);VC(a,c[b>>2]|0)|0;}b=rA(a,0)|0;if(b)if(((WD(a,c[b+8>>2]|0)|0)==0?(WD(a,c[b+12>>2]|0)|0)==0:0)?(WD(a,c[b+16>>2]|0)|0)==0:0){VC(a,c[b>>2]|0)|0;b=0;}else b=1;else b=0;return b|0}function NA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=xC(a)|0;e=zA(a)|0;b=b+12|0;a=0;while(1){d=c[b>>2]|0;if((a|0)>=(e|0))break;hD(f,c[d+(a<<2)>>2]|0)|0;a=a+1|0;}eC(f,d);return}function OA(a){a=a|0;var b=0;b=wA(a)|0;if(b|0){NA(a,b);VC(a,96404)|0;}return}function PA(a){a=a|0;var b=0;b=wA(a)|0;if(b|0){NA(a,b);VC(a,96404)|0;}return}function QA(a,b){a=a|0;b=b|0;b=FA(a,b)|0;if(!b)b=0;else {a=c[(wA(a)|0)+12>>2]|0;b=c[a+(c[b+16>>2]<<2)>>2]|0;}return b|0}function RA(a,b){a=a|0;b=b|0;a=c[(wA(a)|0)+12>>2]|0;return c[a+(c[b+16>>2]<<2)>>2]|0}function SA(a,b,c){a=a|0;b=b|0;c=c|0;b=FA(a,b)|0;if(!b)b=-1;else {KA(a,b,c)|0;b=0;}return b|0}function TA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=xC(a)|0;f=GA(f,c[a>>2]&3,b,0)|0;if(!f){f=xC(a)|0;f=GA(f,c[a>>2]&3,b,e)|0;}KA(a,f,d)|0;return 0}function UA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=xC(a)|0;f=c[a>>2]|0;a:do if(!((c[b>>2]^f)&3)){d=1;e=0;while(1){e=LA(g,f&3,e)|0;if(!e)break a;d=FA(b,c[e+8>>2]|0)|0;if(!d){d=1;break a}f=RA(a,e)|0;KA(b,d,f)|0;if(iD(f)|0)jD(RA(b,d)|0);d=0;f=c[a>>2]|0;}}else d=1;while(0);return d|0}function VA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;a=c[b+40>>2]|0;f=c[d+40>>2]|0;if((a|0)==(f|0)){e=(c[b>>2]|0)>>>4;a=(c[d>>2]|0)>>>4;if(e>>>0>=a>>>0)if(e>>>0>a>>>0)a=1;else g=6;else a=-1;}else {e=(c[a>>2]|0)>>>4;a=(c[f>>2]|0)>>>4;if(e>>>0>=a>>>0)if(e>>>0>a>>>0)a=1;else g=6;else a=-1;}if((g|0)==6)a=0;return a|0}function WA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a=(c[b+40>>2]|0)+8|0;g=c[a>>2]|0;a=c[a+4>>2]|0;f=(c[d+40>>2]|0)+8|0;e=c[f>>2]|0;f=c[f+4>>2]|0;do if(!(a>>>0>>0|(a|0)==(f|0)&g>>>0>>0))if(a>>>0>f>>>0|(a|0)==(f|0)&g>>>0>e>>>0)a=1;else {e=b+8|0;a=c[e>>2]|0;e=c[e+4>>2]|0;if(!((a|0)==0&(e|0)==0)?(i=d+8|0,h=c[i>>2]|0,i=c[i+4>>2]|0,!((h|0)==0&(i|0)==0)):0){if(e>>>0>>0|(e|0)==(i|0)&a>>>0>>0){a=-1;break}if(e>>>0>i>>>0|(e|0)==(i|0)&a>>>0>h>>>0){a=1;break}}a=0;}else a=-1;while(0);return a|0}function XA(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if(!b)b=0;else {d=a+44|0;a=b+32|0;Wz(c[d>>2]|0,c[a>>2]|0)|0;b=c[d>>2]|0;b=nb[c[b>>2]&63](b,0,128)|0;c[a>>2]=Sz(c[d>>2]|0)|0;}return b|0}function YA(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+48|0;d=e;if((c[b+24>>2]|0)==(a|0))a=b+28|0;else {c[d+16>>2]=b;a=c[a+40>>2]|0;a=nb[c[a>>2]&63](a,d,4)|0;}l=e;return a|0}function ZA(a,b){a=a|0;b=b|0;var d=0,e=0;d=YA(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;if(!d)a=0;else {e=a+44|0;d=d+32|0;Wz(c[e>>2]|0,c[d>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,b,8)|0;c[d>>2]=Sz(c[e>>2]|0)|0;}return a|0}function _A(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if(!b)b=0;else {d=a+44|0;a=b+28|0;Wz(c[d>>2]|0,c[a>>2]|0)|0;b=c[d>>2]|0;b=nb[c[b>>2]&63](b,0,128)|0;c[a>>2]=Sz(c[d>>2]|0)|0;}return b|0}function $A(a,b){a=a|0;b=b|0;var d=0,e=0;d=YA(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;if(!d)a=0;else {e=a+44|0;d=d+28|0;Wz(c[e>>2]|0,c[d>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,b,8)|0;c[d>>2]=Sz(c[e>>2]|0)|0;}return a|0}function aB(a,b){a=a|0;b=b|0;var c=0;c=XA(a,b)|0;if(!c)c=_A(a,b)|0;return c|0}function bB(a,b,d){a=a|0;b=b|0;d=d|0;a:do if((c[b>>2]&3|0)==2){b=ZA(a,b)|0;if(!b){b=0;do{if(!b)b=_A(a,d)|0;else b=$A(a,b)|0;if(!b){b=0;break a}}while((c[b+40>>2]|0)==(d|0))}}else do{b=$A(a,b)|0;if(!b){b=0;break a}}while((c[b+40>>2]|0)==(d|0));while(0);return b|0}function cB(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+32|0;f=h+16|0;g=h;if((zB(a)|0)!=0?(c[g>>2]=0,c[g+4>>2]=0,c[g+8>>2]=0,c[g+12>>2]=0,c[f>>2]=c[g>>2],c[f+4>>2]=c[g+4>>2],c[f+8>>2]=c[g+8>>2],c[f+12>>2]=c[g+12>>2],(gB(a,b,e,f)|0)!=0):0)f=0;else f=((d[a+24>>0]|0)>>>2&1^1)&255|(b|0)!=(e|0);l=h;return f|0}function dB(a,b){a=a|0;b=b|0;fB(a,b);return}function eB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;oC(b,d,1)|0;oC(b,e,1)|0;h=dC(b,96)|0;i=h+48|0;l=rB(b,2)|0;j=c[i>>2]|0;k=c[h>>2]|0;m=h+8|0;c[m>>2]=f;c[m+4>>2]=g;m=h+56|0;c[m>>2]=f;c[m+4>>2]=g;g=l<<4;c[h>>2]=k&12|g|2;c[i>>2]=j&12|g|3;c[h+88>>2]=d;c[h+40>>2]=e;fB(b,h);if(a[b+24>>0]&64){TC(h,96404,16,0)|0;vA(b,h);}zC(b,h);return h|0}function fB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;i=l;l=l+16|0;d=i;h=c[b>>2]&3;g=(h|0)==2?b:b+-48|0;h=(h|0)==3?b:b+48|0;e=c[h+40>>2]|0;f=c[g+40>>2]|0;while(1){if(!a)break;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];if(gB(a,e,f,d)|0)break;j=YA(a,e)|0;m=a+44|0;hB(c[m>>2]|0,j+32|0,g);k=a+48|0;hB(c[k>>2]|0,j+24|0,g);j=YA(a,f)|0;hB(c[m>>2]|0,j+28|0,h);hB(c[k>>2]|0,j+20|0,h);a=QD(a)|0;}l=i;return}function gB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+48|0;f=h;if(!((b|0)==0|(d|0)==0)?(c[f>>2]=c[e>>2],c[f+4>>2]=c[e+4>>2],c[f+8>>2]=c[e+8>>2],c[f+12>>2]=c[e+12>>2],c[f+40>>2]=b,g=YA(a,d)|0,(g|0)!=0):0){e=a+48|0;g=g+20|0;Wz(c[e>>2]|0,c[g>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,f,4)|0;c[g>>2]=Sz(c[e>>2]|0)|0;}else a=0;l=h;return a|0}function hB(a,b,d){a=a|0;b=b|0;d=d|0;Wz(a,c[b>>2]|0)|0;nb[c[a>>2]&63](a,d,1)|0;c[b>>2]=Sz(a)|0;return}function iB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+48|0;i=n+24|0;k=n+16|0;j=n;do if(!(HB(a,2,e,k,0)|0))if(!e){if(f|0?(zB(a)|0)==0:0){m=18;break};c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;m=7;}else m=17;else {o=j;c[o>>2]=0;c[o+4>>2]=0;o=k;g=c[o+4>>2]|0;m=j+8|0;c[m>>2]=c[o>>2];c[m+4>>2]=g;c[j>>2]=2;m=7;}while(0);a:do if((m|0)==7){c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(a,b,d,i)|0;b:do if(!g){if(yB(a)|0?(c[i>>2]=c[j>>2],c[i+4>>2]=c[j+4>>2],c[i+8>>2]=c[j+8>>2],c[i+12>>2]=c[j+12>>2],h=gB(a,d,b,i)|0,h|0):0){g=h;break}do if(f|0){g=yC(a)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(g,b,d,i)|0;if(!g){if(!(yB(a)|0))break;g=yC(a)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(g,d,b,i)|0;if(!g)break}dB(a,g);break b}while(0);m=17;break a}while(0)}while(0);if((m|0)==17)if(!f)g=0;else m=18;if((m|0)==18)if((cB(a,b,d)|0)!=0?(HB(a,2,e,k,1)|0)!=0:0){g=k;g=eB(a,b,d,c[g>>2]|0,c[g+4>>2]|0)|0;LB(a,2,g);}else g=0;l=n;return g|0}function jB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=(c[b>>2]&3|0)==3;g=d?b+-48|0:b;d=d?b:b+48|0;b=c[g+40>>2]|0;h=YA(a,c[d+40>>2]|0)|0;f=a+44|0;kB(c[f>>2]|0,h+32|0,g);e=a+48|0;kB(c[e>>2]|0,h+24|0,g);b=YA(a,b)|0;kB(c[f>>2]|0,b+28|0,d);kB(c[e>>2]|0,b+20|0,d);return}function kB(a,b,d){a=a|0;b=b|0;d=d|0;Wz(a,c[b>>2]|0)|0;nb[c[a>>2]&63](a,d,2)|0;c[b>>2]=Sz(a)|0;return}function lB(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;f=e;d=(c[d>>2]&3|0)==2?d:d+-48|0;g=c[d>>2]&3;h=c[((g|0)==3?d:d+48|0)+40>>2]|0;g=c[((g|0)==2?d:d+-48|0)+40>>2]|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];if(gB(b,h,g,f)|0){if((yC(b)|0)==(b|0)){if(a[b+24>>0]&64)PA(d);DC(b,d);$C(d);h=d+8|0;JB(b,2,c[h>>2]|0,c[h+4>>2]|0);}if(!(BE(b,d,58,0,0)|0))if((yC(b)|0)==(b|0)){eC(b,d);d=0;}else d=0;else d=-1;}else d=-1;l=e;return d|0}function mB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;e=h;f=oC(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0,d)|0;g=oC(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0,d)|0;do if((f|0)!=0&(g|0)!=0){c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];e=gB(a,f,g,e)|0;f=(e|0)==0;if(!((d|0)!=0&f)){if(f)break}else {fB(a,b);e=b;}d=c[e>>2]&3;l=h;return ((d|0)==(c[b>>2]&3|0)?e:e+(((d|0)==3?-1:1)*48|0)|0)|0}while(0);l=h;return 0}function nB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=b+8|0;e=d+8|0;e=K6(c[b>>2]|0,c[b+4>>2]|0,c[e>>2]|0,c[e+4>>2]|0)|0;return ((e|0)==0?0:e>>31|1)|0}function oB(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+16|0;g=h;j=pB(e)|0;f=lb[c[(c[j>>2]|0)+4>>2]&127](c[j+12>>2]|0,72)|0;c[f>>2]=c[f>>2]&-4;i=f+64|0;c[i>>2]=j;k=f+24|0;d=c[d>>2]|0;c[k>>2]=d;a[k>>0]=d&255|8;c[f+60>>2]=f;e=lb[c[c[j+4>>2]>>2]&127](f,e)|0;c[(c[i>>2]|0)+16>>2]=e;if(HB(f,0,b,g,1)|0){i=g;j=c[i+4>>2]|0;k=f+8|0;c[k>>2]=c[i>>2];c[k+4>>2]=j;}k=qB(f)|0;LB(k,0,f);l=h;return k|0}function pB(b){b=b|0;var d=0,e=0,f=0,g=0;d=(b|0)!=0;if(d){e=c[b>>2]|0;e=(e|0)==0?18736:e;}else e=18736;g=kb[c[e>>2]&63](b)|0;f=lb[c[e+4>>2]&127](g,80)|0;c[f>>2]=e;c[f+12>>2]=g;if(d){g=c[b+4>>2]|0;c[f+4>>2]=(g|0)==0?18612:g;b=c[b+8>>2]|0;b=(b|0)==0?18712:b;}else {c[f+4>>2]=18612;b=18712;}c[f+8>>2]=b;a[f+52>>0]=1;return f|0}function qB(b){b=b|0;var d=0,e=0;c[b+36>>2]=UD(b,18792,c[4589]|0)|0;c[b+40>>2]=UD(b,18756,c[4589]|0)|0;d=(yC(b)|0)==(b|0);c[b+44>>2]=UD(b,d?18404:18440,c[4589]|0)|0;d=(yC(b)|0)==(b|0);c[b+48>>2]=UD(b,d?18476:18512,c[4589]|0)|0;c[b+52>>2]=UD(b,18548,c[4589]|0)|0;d=QD(b)|0;if(!((d|0)!=0?(e=rB(d,0)|0,c[b>>2]=c[b>>2]&15|e<<4,e=c[d+52>>2]|0,nb[c[e>>2]&63](e,b,1)|0,!(a[d+24>>0]&64)):0))tA(b);zC(b,b);return b|0}function rB(a,b){a=a|0;b=b|0;var d=0;d=(c[a+64>>2]|0)+24+(b<<3)|0;b=d;b=J6(c[b>>2]|0,c[b+4>>2]|0,1,0)|0;a=z;c[d>>2]=b;c[d+4>>2]=a;z=a;return b|0}function sB(b){b=b|0;var d=0,e=0,f=0,g=0;f=QD(b)|0;g=(f|0)==0;if(g?(d=b+64|0,(c[(c[c[d>>2]>>2]|0)+16>>2]|0)!=0):0){DC(b,b);g=b+8|0;JB(b,0,c[g>>2]|0,c[g+4>>2]|0);d=c[d>>2]|0;tb[c[(c[d>>2]|0)+16>>2]&127](c[d+12>>2]|0);d=0;}else e=4;do if((e|0)==4){d=OD(b)|0;while(1){if(!d)break;e=PD(d)|0;sB(d)|0;d=e;}d=jC(b)|0;while(1){if(!d)break;e=kC(b,d)|0;vC(b,d)|0;d=e;}UB(b);DC(b,b);if(((((WD(b,c[b+40>>2]|0)|0)==0?(WD(b,c[b+36>>2]|0)|0)==0:0)?(WD(b,c[b+48>>2]|0)|0)==0:0)?(WD(b,c[b+44>>2]|0)|0)==0:0)?(WD(b,c[b+52>>2]|0)|0)==0:0){if(a[b+24>>0]&64?MA(b)|0:0){d=-1;break}$C(b);e=b+8|0;JB(b,0,c[e>>2]|0,c[e+4>>2]|0);if(!g){RD(f,b)|0;eC(f,b);d=0;break}d=b+64|0;while(1){e=c[d>>2]|0;f=c[e+48>>2]|0;if(!f)break;GC(b,c[f>>2]|0)|0;}tb[c[(c[e+4>>2]|0)+20>>2]&127](c[e+16>>2]|0);if(!(aD(b)|0)){d=c[d>>2]|0;g=c[d+12>>2]|0;f=(c[d>>2]|0)+12|0;ub[c[f>>2]&63](g,b);ub[c[f>>2]&63](g,d);d=0;}else d=-1;}else d=-1;}while(0);return d|0}function tB(a){a=a|0;return Xz(c[a+40>>2]|0)|0}function uB(a){a=a|0;var b=0,c=0,d=0;b=0;c=jC(a)|0;while(1){if(!c)break;d=(vB(a,c,0,1)|0)+b|0;b=d;c=kC(a,c)|0;}return b|0}function vB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=YA(a,b)|0;if(f){if(!e)b=0;else b=wB(c[a+44>>2]|0,f+32|0)|0;if(d)b=(wB(c[a+44>>2]|0,f+28|0)|0)+b|0;}else b=0;return b|0}function wB(a,b){a=a|0;b=b|0;var d=0;Wz(a,c[b>>2]|0)|0;d=Xz(a)|0;c[b>>2]=Sz(a)|0;return d|0}function xB(b){b=b|0;return a[b+24>>0]&1|0}function yB(a){a=a|0;return (xB(a)|0)==0|0}function zB(a){a=a|0;return (d[a+24>>0]|0)>>>1&1|0}function AB(a,b){a=a|0;b=b|0;return a|0}function BB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;if(!d){f=1392;d=c[f>>2]|0;f=c[f+4>>2]|0;c[e>>2]=d;c[e+4>>2]=f;f=J6(d|0,f|0,2,0)|0;e=1392;c[e>>2]=f;c[e+4>>2]=z;}else {if(!f)a=cD(a,d)|0;else a=fD(a,d)|0;c[e>>2]=a;c[e+4>>2]=0;}return 1}function CB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return 0}function DB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((c&1|0)==0&0==0)hD(a,c)|0;return}function EB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ((c&1|0)==0&0==0?c:0)|0}function FB(a){a=a|0;return}function GB(a,b,c){a=a|0;b=b|0;c=c|0;return}function HB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=(e|0)!=0;do if(i){if((a[e>>0]|0)!=37?(h=c[b+64>>2]|0,h=pb[c[(c[h+4>>2]|0)+4>>2]&127](c[h+16>>2]|0,d,e,f,g)|0,h|0):0)break;h=MB(b,d,e,f)|0;if(!h)j=5;}else j=5;while(0);if((j|0)==5)if(g){h=c[b+64>>2]|0;h=pb[c[(c[h+4>>2]|0)+4>>2]&127](c[h+16>>2]|0,d,0,f,g)|0;if(i&(h|0)!=0){j=f;NB(b,d,e,c[j>>2]|0,c[j+4>>2]|0);}}else h=0;return h|0}function IB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[a+64>>2]|0;return ob[c[(c[a+4>>2]|0)+8>>2]&127](c[a+16>>2]|0,b,d,e)|0}function JB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;SB(a,b,d,e)|0;a=c[a+64>>2]|0;xb[c[(c[a+4>>2]|0)+12>>2]&31](c[a+16>>2]|0,b,d,e);return}function KB(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;d=xC(a)|0;f=a+8|0;b=f;b=QB(d,c[a>>2]&3,c[b>>2]|0,c[b+4>>2]|0)|0;do if(!b){b=c[d+64>>2]|0;d=c[(c[b+4>>2]|0)+16>>2]|0;if(d|0?(e=f,e=ob[d&127](c[b+16>>2]|0,c[a>>2]&3,c[e>>2]|0,c[e+4>>2]|0)|0,e|0):0){b=e;break}if((c[a>>2]&3|0)==2)b=0;else {e=c[f>>2]|0;f=c[f+4>>2]|0;c[g>>2]=37;b=g+8|0;c[b>>2]=e;c[b+4>>2]=f;m4(194773,96456,g)|0;b=194773;}}while(0);l=h;return b|0}function LB(a,b,d){a=a|0;b=b|0;d=d|0;a=c[a+64>>2]|0;vb[c[(c[a+4>>2]|0)+24>>2]&127](c[a+16>>2]|0,b,d);return}function MB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i;b=c[(c[a+64>>2]|0)+56+(((b|0)==3?2:b)<<2)>>2]|0;if(((b|0)!=0?(f=cD(a,d)|0,(f|0)!=0):0)?(c[h+24>>2]=f,g=nb[c[b>>2]&63](b,h,4)|0,(g|0)!=0):0){d=g+16|0;h=c[d+4>>2]|0;b=e;c[b>>2]=c[d>>2];c[b+4>>2]=h;b=1;}else b=0;l=i;return b|0}function NB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=dC(a,32)|0;g=h+16|0;c[g>>2]=e;c[g+4>>2]=f;c[h+24>>2]=fD(a,d)|0;e=(b|0)==3?2:b;g=a+64|0;d=c[g>>2]|0;b=c[d+56+(e<<2)>>2]|0;if(!b){f=UD(a,18640,c[4589]|0)|0;c[(c[g>>2]|0)+56+(e<<2)>>2]=f;b=c[g>>2]|0;}else {f=b;b=d;}b=c[b+68+(e<<2)>>2]|0;if(!b){b=UD(a,18676,c[4589]|0)|0;c[(c[g>>2]|0)+68+(e<<2)>>2]=b;}nb[c[f>>2]&63](f,h,1)|0;nb[c[b>>2]&63](b,h,1)|0;return}function OB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=b+16|0;b=c[a>>2]|0;a=c[a+4>>2]|0;d=d+16|0;e=c[d>>2]|0;d=c[d+4>>2]|0;return (a>>>0>d>>>0|(a|0)==(d|0)&b>>>0>e>>>0?1:(a>>>0>>0|(a|0)==(d|0)&b>>>0>>0)<<31>>31)|0}function PB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b+24>>2]|0;e=c[d+24>>2]|0;return (b>>>0>e>>>0?1:(b>>>0>>0)<<31>>31)|0}function QB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=RB(a,b,d,e)|0;if(!a)a=0;else a=c[a+24>>2]|0;return a|0}function RB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;f=g;a=c[(c[a+64>>2]|0)+68+(((b|0)==3?2:b)<<2)>>2]|0;if(!a)a=0;else {b=f+16|0;c[b>>2]=d;c[b+4>>2]=e;a=nb[c[a>>2]&63](a,f,4)|0;}l=g;return a|0}function SB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=(b|0)==3?2:b;b=RB(a,f,d,e)|0;if(!b)b=0;else {e=a+64|0;d=c[(c[e>>2]|0)+56+(f<<2)>>2]|0;nb[c[d>>2]&63](d,b,2)|0;e=c[(c[e>>2]|0)+68+(f<<2)>>2]|0;nb[c[e>>2]&63](e,b,2)|0;hD(a,c[b+24>>2]|0)|0;eC(a,b);b=1;}return b|0}function TB(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;c[46942]=b;g=c[b+64>>2]|0;f=0;while(1){if((f|0)==3)break;h=g+56+(f<<2)|0;d=c[h>>2]|0;a:do if(d|0){d=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!d)break a;e=c[h>>2]|0;e=nb[c[e>>2]&63](e,d,8)|0;if((a[c[d+24>>2]>>0]|0)!=37){d=e;continue}i=d+16|0;SB(b,f,c[i>>2]|0,c[i+4>>2]|0)|0;d=e;}}while(0);f=f+1|0;}return}function UB(a){a=a|0;c[46942]=a;a=a+64|0;VB((c[a>>2]|0)+56|0);VB((c[a>>2]|0)+68|0);return}function VB(a){a=a|0;var b=0,d=0,e=0;b=0;while(1){if((b|0)==3)break;d=a+(b<<2)|0;e=c[d>>2]|0;if(e|0){Rz(e)|0;c[d>>2]=0;}b=b+1|0;}return}function WB(a,b,c){a=a|0;b=b|0;c=c|0;if(!(c4(b,c,a)|0))a=0;else a=l2(b)|0;return a|0}function XB(a,b){a=a|0;b=b|0;return T4(b,a)|0}function YB(a){a=a|0;return M4(a)|0}function ZB(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+32|0;e=b+12|0;d=b;c[4682]=c[4679];c[4683]=c[4680];c[e>>2]=a;c[e+4>>2]=l2(a)|0;c[e+8>>2]=0;c[d>>2]=18736;c[d+4>>2]=18612;c[d+8>>2]=18724;a=jF(e,d)|0;kD(0);l=b;return a|0}function _B(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if((e|0)!=0?(h=b+8|0,f=c[h>>2]|0,(f|0)<(c[b+4>>2]|0)):0){i=(c[b>>2]|0)+f|0;b=0;g=a[i>>0]|0;f=d;d=i;while(1){d=d+1|0;a[f>>0]=g;b=b+1|0;if(!(g<<24>>24!=10&(b|0)<(e|0)))break;g=a[d>>0]|0;if(!(g<<24>>24))break;else f=f+1|0;}c[h>>2]=(c[h>>2]|0)+b;}else b=0;return b|0}function $B(a){a=a|0;return 0}function aC(a,b){a=a|0;b=b|0;a=T1(b)|0;Y6(a|0,0,b|0)|0;return a|0}function bC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=W1(b,d)|0;if(d>>>0>c>>>0)Y6(a+c|0,0,d-c|0)|0;return a|0}function cC(a,b){a=a|0;b=b|0;U1(b);return}function dC(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;a=c[a+64>>2]|0;a=lb[c[(c[a>>2]|0)+4>>2]&127](c[a+12>>2]|0,b)|0;if(!a)gA(1,96462,d)|0;l=d;return a|0}function eC(a,b){a=a|0;b=b|0;if(b|0){a=c[a+64>>2]|0;ub[c[(c[a>>2]|0)+12>>2]&63](c[a+12>>2]|0,b);}return}function fC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=(c[b+16>>2]|0)+8|0;b=c[a>>2]|0;a=c[a+4>>2]|0;d=(c[d+16>>2]|0)+8|0;e=c[d>>2]|0;d=c[d+4>>2]|0;return (a>>>0>>0|(a|0)==(d|0)&b>>>0>>0?-1:(a>>>0>d>>>0|(a|0)==(d|0)&b>>>0>e>>>0)&1)|0}function gC(a,b,d){a=a|0;b=b|0;d=d|0;a=c[b+16>>2]|0;if((a+28|0)!=(b|0))eC(c[a+24>>2]|0,b);return}function hC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=(c[c[b+16>>2]>>2]|0)>>>4;e=(c[c[d+16>>2]>>2]|0)>>>4;return (b>>>0>>0?-1:b>>>0>e>>>0&1)|0}function iC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=186256;c[e>>2]=b;c[e+4>>2]=d;c[46947]=186248;a=c[a+40>>2]|0;a=nb[c[a>>2]&63](a,187772,4)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function jC(a){a=a|0;a=c[a+36>>2]|0;a=nb[c[a>>2]&63](a,0,128)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function kC(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if((b|0)!=0?(d=c[a+36>>2]|0,d=nb[c[d>>2]&63](d,b,8)|0,(d|0)!=0):0)b=c[d+16>>2]|0;else b=0;return b|0}function lC(a){a=a|0;a=c[a+36>>2]|0;a=nb[c[a>>2]&63](a,0,256)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function mC(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if((b|0)!=0?(d=c[a+36>>2]|0,d=nb[c[d>>2]&63](d,b,16)|0,(d|0)!=0):0)b=c[d+16>>2]|0;else b=0;return b|0}function nC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=iC(a,b,c)|0;do if((d|0)!=0&(e|0)==0){e=yC(a)|0;if((e|0)!=(a|0)?(f=iC(e,b,c)|0,f|0):0){oC(a,f,1)|0;e=f;break}if(!(IB(a,1,b,c)|0))e=0;else {e=rB(a,1)|0;e=pC(a,b,c,e,z)|0;qC(a,e);rC(a,e);}}while(0);return e|0}function oC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=yC(a)|0;if((e|0)==(c[b+24>>2]|0)){e=b+8|0;e=iC(a,c[e>>2]|0,c[e+4>>2]|0)|0;if((d|0)!=0&(e|0)==0){e=QD(a)|0;if(!e)e=0;else {d=oC(e,b,d)|0;sC(a,d);return d|0}}}else e=0;return e|0}function pC(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;g=dC(b,64)|0;h=c[g>>2]|0;i=g+8|0;c[i>>2]=d;c[i+4>>2]=e;c[g>>2]=h&12|f<<4|1;c[g+24>>2]=yC(b)|0;if(a[(yC(b)|0)+24>>0]&64)TC(g,96404,16,0)|0;return g|0}function qC(a,b){a=a|0;b=b|0;do{sC(a,b);a=QD(a)|0;}while((a|0)!=0);return}function rC(b,c){b=b|0;c=c|0;if(a[(yC(b)|0)+24>>0]&64)uA(b,c);zC(b,c);return}function sC(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+40|0;Xz(c[e>>2]|0)|0;if((yC(a)|0)==(a|0))d=b+28|0;else d=dC(a,36)|0;c[d+16>>2]=b;e=c[e>>2]|0;nb[c[e>>2]&63](e,d,1)|0;e=c[a+36>>2]|0;nb[c[e>>2]&63](e,d,1)|0;return}function tC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;h=yC(a)|0;if(HB(a,1,b,g,0)|0){e=g;e=iC(a,c[e>>2]|0,c[e+4>>2]|0)|0;if(!e)if(!((d|0)==0|(h|0)==(a|0))?(f=g,f=iC(h,c[f>>2]|0,c[f+4>>2]|0)|0,(f|0)!=0):0)e=oC(a,f,1)|0;else i=6;}else i=6;if((i|0)==6)if((d|0)!=0?(HB(a,1,b,g,1)|0)!=0:0){i=g;h=c[i>>2]|0;i=c[i+4>>2]|0;e=rB(a,1)|0;e=pC(a,h,i,e,z)|0;qC(a,e);rC(a,e);LB(a,1,e);}else e=0;l=j;return e|0}function uC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;c[46956]=b;d=aB(a,b)|0;while(1){if(!d)break;e=bB(a,d,b)|0;jB(a,d,0);d=e;}e=c[a+40>>2]|0;nb[c[e>>2]&63](e,187808,2)|0;e=c[a+36>>2]|0;nb[c[e>>2]&63](e,187808,2)|0;return}function vC(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d+8|0;e=f;if(iC(b,c[e>>2]|0,c[e+4>>2]|0)|0){if((yC(b)|0)==(b|0)){e=aB(b,d)|0;while(1){if(!e)break;g=bB(b,e,d)|0;lB(b,e)|0;e=g;}if(a[b+24>>0]&64)OA(d);DC(b,d);$C(d);g=f;JB(b,1,c[g>>2]|0,c[g+4>>2]|0);}if(!(BE(b,d,59,0,0)|0))if((yC(b)|0)==(b|0)){eC(b,d);e=0;}else e=0;else e=-1;}else e=-1;return e|0}function wC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;e=h;d=c[b>>2]|0;do if(!(d&3))if((QD(b)|0)==(a|0)){d=c[b>>2]|0;g=5;break}else {gA(1,96488,e)|0;f=-1;break}else g=5;while(0);a:do if((g|0)==5)switch(d&3){case 1:{f=vC(a,b)|0;break a}case 2:case 3:{f=lB(a,b)|0;break a}case 0:{f=sB(b)|0;break a}default:{}}while(0);l=h;return f|0}function xC(a){a=a|0;var b=0;switch(c[a>>2]&3){case 2:case 3:{b=c[(c[a+40>>2]|0)+24>>2]|0;break}case 1:{b=c[a+24>>2]|0;break}case 0:{b=a;break}default:{}}return b|0}function yC(a){a=a|0;var b=0;switch(c[a>>2]&3){case 2:case 3:{b=(c[a+40>>2]|0)+24|0;break}case 1:{b=a+24|0;break}case 0:{b=a+60|0;break}default:{}}return c[b>>2]|0}function zC(b,d){b=b|0;d=d|0;var e=0;e=c[b+64>>2]|0;if(!(a[e+52>>0]|0))JC(b,d,100,0);else AC(b,d,c[e+48>>2]|0);return}function AC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a:do if(d|0){AC(a,b,c[d+8>>2]|0);switch(c[b>>2]&3){case 0:{e=c[d>>2]|0;break}case 1:{e=(c[d>>2]|0)+12|0;break}case 2:{e=(c[d>>2]|0)+24|0;break}default:break a}e=c[e>>2]|0;if(e|0)vb[e&127](a,b,c[d+4>>2]|0);}while(0);return}function BC(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=c[b+64>>2]|0;if(!(a[f+52>>0]|0))JC(b,d,101,e);else CC(b,d,e,c[f+48>>2]|0);return}function CC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a:do if(e|0){CC(a,b,d,c[e+8>>2]|0);switch(c[b>>2]&3){case 0:{f=(c[e>>2]|0)+4|0;break}case 1:{f=(c[e>>2]|0)+16|0;break}case 2:{f=(c[e>>2]|0)+28|0;break}default:break a}f=c[f>>2]|0;if(f|0)xb[f&31](a,b,c[e+4>>2]|0,d);}while(0);return}function DC(b,d){b=b|0;d=d|0;var e=0;e=c[b+64>>2]|0;if(!(a[e+52>>0]|0))JC(b,d,102,0);else EC(b,d,c[e+48>>2]|0);return}function EC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a:do if(d|0){EC(a,b,c[d+8>>2]|0);switch(c[b>>2]&3){case 0:{e=(c[d>>2]|0)+8|0;break}case 1:{e=(c[d>>2]|0)+20|0;break}case 2:{e=(c[d>>2]|0)+32|0;break}default:break a}e=c[e>>2]|0;if(e|0)vb[e&127](a,b,c[d+4>>2]|0);}while(0);return}function FC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=dC(a,12)|0;c[e>>2]=b;c[e+4>>2]=d;d=(c[a+64>>2]|0)+48|0;c[e+8>>2]=c[d>>2];c[d>>2]=e;return}function GC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=(c[a+64>>2]|0)+48|0;d=c[e>>2]|0;a:do if(!d)d=-1;else {if((c[d>>2]|0)!=(b|0)){while(1){if(!d){d=-1;break a}e=d+8|0;f=c[e>>2]|0;if((c[f>>2]|0)==(b|0))break;else d=f;}if(f)c[e>>2]=c[f+8>>2];}else c[e>>2]=c[d+8>>2];eC(a,d);d=0;}while(0);return d|0}function HC(a,b){a=a|0;b=b|0;var d=0;d=yC(a)|0;a:do if((d|0)==(yC(b)|0))switch(c[b>>2]&3){case 0:{while(1){if((b|0)==(a|0)){b=1;break a}b=QD(b)|0;if(!b){b=0;break}}break}case 1:{b=b+8|0;b=(nC(a,c[b>>2]|0,c[b+4>>2]|0,0)|0)!=0;break a}default:{b=(mB(a,b,0)|0)!=0;break a}}else b=0;while(0);return b&1|0}function IC(a){a=a|0;return c[a>>2]&3|0}function JC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=TC(a,96512,44,0)|0;switch(c|0){case 100:{e=KC(f,b,100)|0;if(!(LC(e,b)|0))MC(e,a,b,d)|0;break}case 101:{if(((LC(KC(f,b,100)|0,b)|0)==0?(LC(KC(f,b,102)|0,b)|0)==0:0)?(e=KC(f,b,101)|0,(LC(e,b)|0)==0):0)MC(e,a,b,d)|0;break}case 102:{NC(KC(f,b,100)|0,b);NC(KC(f,b,101)|0,b);e=KC(f,b,102)|0;if(!(LC(e,b)|0))MC(e,a,b,d)|0;break}default:gA(1,96524,g)|0;}l=h;return}function KC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;e=g;a:do switch(c[b>>2]&3){case 0:switch(d|0){case 100:{d=a+8|0;break a}case 101:{d=a+20|0;break a}case 102:{d=a+32|0;break a}default:{f=14;break a}}case 1:switch(d|0){case 100:{d=a+12|0;break a}case 101:{d=a+24|0;break a}case 102:{d=a+36|0;break a}default:{f=14;break a}}case 2:switch(d|0){case 100:{d=a+16|0;break a}case 101:{d=a+28|0;break a}case 102:{d=a+40|0;break a}default:{f=14;break a}}default:f=14;}while(0);if((f|0)==14){gA(1,96558,e)|0;d=0;}a=c[d>>2]|0;if(!a){a=xC(b)|0;a=UD(a,18828,c[4589]|0)|0;c[d>>2]=a;}l=g;return a|0}function LC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;e=d;f=OC(b)|0;b=e+8|0;c[b>>2]=f;c[b+4>>2]=z;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function MC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=dC(xC(d)|0,32)|0;c[f+20>>2]=d;g=OC(d)|0;d=f+8|0;c[d>>2]=g;c[d+4>>2]=z;c[f+16>>2]=b;if(e|0){g=dC(b,8)|0;c[f+24>>2]=g;c[g>>2]=e;}nb[c[a>>2]&63](a,f,1)|0;return f|0}function NC(a,b){a=a|0;b=b|0;b=LC(a,b)|0;if(b|0)nb[c[a>>2]&63](a,b,2)|0;return}function OC(a){a=a|0;a=a+8|0;z=c[a+4>>2]|0;return c[a>>2]|0}function PC(a,b,d){a=a|0;b=b|0;d=d|0;QC(b);eC(c[b+16>>2]|0,b);return}function QC(a){a=a|0;var b=0,d=0;b=a+16|0;a=c[a+24>>2]|0;while(1){if(!a)break;d=c[a+4>>2]|0;eC(c[b>>2]|0,a);a=d;}return}function RC(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;i=k;h=c[b+16>>2]|0;f=h;while(1){if(!f){f=0;break}g=c[f>>2]|0;if((g|0)==(d|0)){j=7;break}if((a[d>>0]|0)==(a[g>>0]|0)?(s2(d,g)|0)==0:0){j=7;break}f=c[f+4>>2]|0;if((f|0)==(h|0)){f=0;break}}do if((j|0)==7){if(!(c[b>>2]&4)){if((f|0)==(h|0)&(e|0)==0){f=h;break}SC(b,f,e);break}if(e)if((h|0)==(f|0))f=h;else gA(1,96583,i)|0;}while(0);l=k;return f|0}function SC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;c[a+16>>2]=b;e=c[a>>2]|0;d=d<<2&4;c[a>>2]=e&-5|d;if(e&2|0){e=(e&3|0)==3?-1:1;c[a+(e*48|0)+16>>2]=b;e=a+(e*48|0)|0;c[e>>2]=c[e>>2]&-5|d;}return}function TC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=xC(a)|0;f=RC(a,b,0)|0;a:do if((d|0)!=0&(f|0)==0){d=dC(h,d)|0;c[d>>2]=fD(h,b)|0;switch(c[a>>2]&3){case 0:{UC(a,d);g=d;break a}case 1:{UC(a,d);g=d;break a}case 2:case 3:{UC(a,d);g=d;break a}default:{}}}else g=f;while(0);if(e|0)RC(a,b,1)|0;return g|0}function UC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[a+16>>2]|0;do if(d){e=d+4|0;f=c[e>>2]|0;if((f|0)==(d|0)){c[e>>2]=b;e=d;d=b;break}else {c[b+4>>2]=f;e=b;break}}else {e=b;d=b;}while(0);c[d+4>>2]=e;if(!(c[a>>2]&4))SC(a,b,0);return}function VC(a,b){a=a|0;b=b|0;var d=0,e=0;e=xC(a)|0;d=RC(a,b,0)|0;if(!d)b=-1;else {WC(a,d);if(!(c[a>>2]&3)){XC(e,a,d);b=d;}else {BE(yC(e)|0,a,60,d,0)|0;b=d;}hD(e,c[d>>2]|0)|0;eC(e,b);b=0;}return b|0}function WC(a,b){a=a|0;b=b|0;var d=0;a=c[a+16>>2]|0;do{d=a+4|0;a=c[d>>2]|0;}while((a|0)!=(b|0));c[d>>2]=c[b+4>>2];return}function XC(a,b,d){a=a|0;b=b|0;d=d|0;if((c[b+16>>2]|0)==(d|0)){a=c[d+4>>2]|0;SC(b,(a|0)==(d|0)?0:a,0);}return}function YC(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=(d|0)>-1;g=f?d:0-d|0;a:do switch(b|0){case 0:{TC(a,c,g,e)|0;if(!f){b=OD(a)|0;while(1){if(!b)break a;YC(b,0,c,d,e);b=PD(b)|0;}}break}case 3:case 2:case 1:{d=(b|0)==1;b=jC(a)|0;while(1){if(!b)break a;b:do if(d)TC(b,c,g,e)|0;else {f=XA(a,b)|0;while(1){if(!f)break b;TC(f,c,g,e)|0;f=ZA(a,f)|0;}}while(0);b=kC(a,b)|0;}}default:{}}while(0);return}function ZC(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;a:do switch(b|0){case 0:{BE(a,a,61,c,1)|0;break}case 3:case 2:case 1:{e=(b|0)==1;d=jC(a)|0;while(1){if(!d)break a;b:do if(e)VC(d,c)|0;else {b=XA(a,d)|0;while(1){if(!b)break b;VC(b,c)|0;b=ZA(a,b)|0;}}while(0);d=kC(a,d)|0;}}default:{}}while(0);return}function _C(a,b,c){a=a|0;b=b|0;c=c|0;VC(b,c)|0;return}function $C(a){a=a|0;var b=0,d=0,e=0;d=xC(a)|0;b=a+16|0;a=c[b>>2]|0;if(a|0)do{e=a;a=c[a+4>>2]|0;hD(d,c[e>>2]|0)|0;eC(d,e);}while((a|0)!=(c[b>>2]|0));c[b>>2]=0;return}function aD(a){a=a|0;return WD(a,bD(a)|0)|0}function bD(a){a=a|0;var b=0,d=0;if(!a)d=187844;else d=(c[a+64>>2]|0)+20|0;b=c[d>>2]|0;if(!b){b=UD(a,18864,c[4589]|0)|0;c[d>>2]=b;a=186312;c[a>>2]=-2147483648;c[a+4>>2]=0;a=186320;c[a>>2]=2147483647;c[a+4>>2]=-1;}return b|0}function cD(a,b){a=a|0;b=b|0;return dD(bD(a)|0,b)|0}function dD(a,b){a=a|0;b=b|0;a=eD(a,b)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function eD(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+32|0;e=d;c[e+16>>2]=b;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function fD(a,b){a=a|0;b=b|0;var d=0,e=0;if(!b)d=0;else {e=bD(a)|0;d=eD(e,b)|0;if(!d){d=(l2(b)|0)+24|0;if(!a)d=T1(d)|0;else d=dC(a,d)|0;a=d+8|0;c[a>>2]=1;c[a+4>>2]=0;a=d+20|0;r3(a,b)|0;c[d+16>>2]=a;nb[c[e>>2]&63](e,d,1)|0;}else {e=d+8|0;b=e;b=J6(c[b>>2]|0,c[b+4>>2]|0,1,0)|0;c[e>>2]=b;c[e+4>>2]=z;}d=c[d+16>>2]|0;}return d|0}function gD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!b)d=0;else {e=bD(a)|0;d=eD(e,b)|0;if(!d){d=(l2(b)|0)+24|0;if(!a)d=T1(d)|0;else d=dC(a,d)|0;g=186312;f=c[g+4>>2]|0;a=d+8|0;c[a>>2]=c[g>>2]|1;c[a+4>>2]=f;a=d+20|0;r3(a,b)|0;c[d+16>>2]=a;nb[c[e>>2]&63](e,d,1)|0;}else {g=d+8|0;f=g;f=J6(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;c[g>>2]=f;c[g+4>>2]=z;}d=c[d+16>>2]|0;}return d|0}function hD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if((b|0)!=0?(d=bD(a)|0,e=eD(d,b)|0,(e|0)!=0):0)if((c[e+16>>2]|0)==(b|0)?(b=e+8|0,g=b,g=J6(c[g>>2]|0,c[g+4>>2]|0,-1,-1)|0,f=z,b,c[b>>2]=g,c[b+4>>2]=f,b=186320,(g|0)==0&(f|0)==0|(c[b>>2]|0)==0&(c[b+4>>2]|0)==0):0){VD(a,d,e)|0;a=0;}else a=0;else a=-1;return a|0}function iD(a){a=a|0;var b=0;if(!a)a=0;else {a=a+-12|0;b=186312;a=c[b>>2]&c[a>>2];}return a|0}function jD(a){a=a|0;var b=0,d=0,e=0;if(a|0){d=186312;a=a+-12|0;e=a;b=c[e+4>>2]|c[d+4>>2];c[a>>2]=c[e>>2]|c[d>>2];c[a+4>>2]=b;}return}function kD(a){a=a|0;c[46966]=a;c[4725]=1;return}function lD(a,b){a=a|0;b=b|0;c[46967]=a;c[46968]=b;c[46969]=0;return}function mD(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(!(c[46970]|0)){c[46970]=1;if(!(c[46971]|0))c[46971]=1;if(!(c[46962]|0))c[46962]=c[15647];if(!(c[46963]|0))c[46963]=c[15679];k=c[46972]|0;if(!((k|0)!=0?(c[k>>2]|0)!=0:0)){nD();k=oD(c[46962]|0,16384)|0;c[c[46972]>>2]=k;}pD();}a:while(1){j=c[46973]|0;a[j>>0]=a[194805]|0;e=(c[(c[c[46972]>>2]|0)+28>>2]|0)+(c[46971]|0)|0;f=j;b:while(1){h=f;while(1){f=c[18904+(d[h>>0]<<2)>>2]|0;if(b[63856+(e<<1)>>1]|0){c[46974]=e;c[46975]=h;}c:while(1){g=f&255;do{f=g+(b[64042+(e<<1)>>1]|0)|0;if((e|0)==(b[64252+(f<<1)>>1]|0))break c;k=b[64788+(e<<1)>>1]|0;e=k<<16>>16;}while(k<<16>>16<=92);f=c[19928+(g<<2)>>2]|0;}e=b[64998+(f<<1)>>1]|0;f=h+1|0;if((b[64042+(e<<1)>>1]|0)==219)break;else h=f;}d:while(1){k=j;e:while(1){e=b[63856+(e<<1)>>1]|0;if(!(e<<16>>16)){e=b[63856+(c[46974]<<1)>>1]|0;f=c[46975]|0;}else e=e<<16>>16;c[46964]=j;i=f;c[46965]=i-k;a[194805]=a[f>>0]|0;a[f>>0]=0;c[46973]=f;f:while(1){switch(e|0){case 1:{m=27;break a}case 12:{m=53;break a}case 13:{m=55;break a}case 14:{m=57;break a}case 15:{m=61;break a}case 16:{m=65;break a}case 17:{m=67;break a}case 18:{m=69;break a}case 19:{m=72;break a}case 20:{m=75;break a}case 21:{m=78;break a}case 23:{m=86;break a}case 33:{m=118;break a}case 39:case 38:case 37:case 36:{l=0;break a}case 2:{m=29;break b}case 3:{m=32;break b}case 4:{m=35;break b}case 5:{m=37;break b}case 6:{m=39;break b}case 7:{m=42;break b}case 8:{m=44;break b}case 9:{m=47;break b}case 10:{m=49;break b}case 11:{m=51;break b}case 22:{m=83;break b}case 24:{m=89;break b}case 25:{m=92;break b}case 26:{m=95;break b}case 27:{m=98;break b}case 28:{m=101;break b}case 29:{m=104;break b}case 30:{m=109;break b}case 31:{m=112;break b}case 32:{m=115;break b}case 34:{m=121;break b}case 0:break f;case 35:break;default:{m=134;break a}}h=c[46964]|0;a[f>>0]=a[194805]|0;e=c[46972]|0;g=c[e>>2]|0;if(!(c[g+44>>2]|0)){n=c[g+16>>2]|0;c[46977]=n;c[g>>2]=c[46962];g=c[e>>2]|0;c[g+44>>2]=1;e=n;}else e=c[46977]|0;if((c[46973]|0)>>>0<=((c[g+4>>2]|0)+e|0)>>>0){m=128;break e}switch(yD()|0){case 0:{m=132;break d}case 2:{m=133;break e}case 1:break;default:continue a}c[46973]=c[46964];e=(((c[46971]|0)+-1|0)/2|0)+36|0;}a[f>>0]=a[194805]|0;f=c[46975]|0;e=c[46974]|0;}if((m|0)==128){m=0;g=i-h|0;h=c[46964]|0;f=h+(g+-1)|0;c[46973]=f;e=wD()|0;i=xD(e)|0;j=c[46964]|0;if(!i)continue;else {m=129;break}}else if((m|0)==133){m=0;f=(c[(c[c[46972]>>2]|0)+4>>2]|0)+(c[46977]|0)|0;c[46973]=f;e=wD()|0;j=c[46964]|0;continue}}if((m|0)==129){m=0;f=h+g|0;c[46973]=f;e=i;continue}else if((m|0)==132){m=0;f=(c[46964]|0)+(i-h+-1)|0;c[46973]=f;e=wD()|0;j=c[46964]|0;continue}}switch(m|0){case 29:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[4725]=(c[4725]|0)+1;continue a}case 32:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=3;continue a}case 35:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 37:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 39:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=1;continue a}case 42:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 44:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;qD();continue a}case 47:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 49:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 51:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 83:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=5;sD();continue a}case 89:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;uD(98744);continue a}case 92:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;uD(96616);continue a}case 95:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[4725]=(c[4725]|0)+1;continue a}case 98:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);continue a}case 101:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=7;c[46976]=1;sD();continue a}case 104:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;n=(c[46976]|0)+-1|0;c[46976]=n;if(!n){m=108;break a}uD(c[46964]|0);continue a}case 109:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;c[46976]=(c[46976]|0)+1;uD(e);continue a}case 112:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);c[4725]=(c[4725]|0)+1;continue a}case 115:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);continue a}case 121:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;U4(e,f,1,c[46963]|0)|0;continue a}}}switch(m|0){case 27:{e=c[46965]|0;if(!e)l=-1;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=-1;}break}case 53:{e=c[46965]|0;if(!e)l=259;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=259;}break}case 55:{e=c[46965]|0;if(!e)l=260;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=260;}break}case 57:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(!(c[46969]|0)){c[46969]=258;l=258;}else l=258;break}case 61:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(!(c[46969]|0)){c[46969]=261;l=261;}else l=261;break}case 65:{e=c[46965]|0;if(!e)l=263;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=263;}break}case 67:{e=c[46965]|0;if(!e)l=262;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=262;}break}case 69:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=(c[46969]|0)==261?264:45;break}case 72:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=(c[46969]|0)==258?264:45;break}case 75:{f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;c[46992]=fD(c[46942]|0,e)|0;l=267;break}case 78:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(rD()|0){m=(c[46965]|0)+-1|0;a[f>>0]=a[194805]|0;n=j+m|0;c[46973]=n;c[46964]=j;c[46965]=m;a[194805]=a[n>>0]|0;a[n>>0]=0;c[46973]=n;}c[46992]=fD(c[46942]|0,c[46964]|0)|0;l=267;break}case 86:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=1;tD();l=268;break}case 108:{c[46971]=1;vD();l=268;break}case 118:{f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;l=a[e>>0]|0;break}case 134:{zD(96619);break}}return l|0}function nD(){var a=0,b=0,d=0;b=c[46972]|0;do if(!b){a=GD(4)|0;c[46972]=a;if(!a)zD(96977);else {c[a>>2]=0;a=1;d=9;break}}else {a=c[46983]|0;if(0>=(a+-1|0)>>>0){a=a+8|0;b=AD(b,a<<2)|0;c[46972]=b;if(!b)zD(96977);else {d=b+(c[46983]<<2)|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+24>>2]=0;c[d+28>>2]=0;d=9;break}}}while(0);if((d|0)==9)c[46983]=a;return}function oD(a,b){a=a|0;b=b|0;var d=0;d=GD(48)|0;if(!d)zD(96932);c[d+12>>2]=b;b=GD(b+2|0)|0;c[d+4>>2]=b;if(!b)zD(96932);else {c[d+20>>2]=1;CD(d,a);return d|0}return 0}function pD(){var b=0,d=0;d=c[46972]|0;b=c[d>>2]|0;c[46977]=c[b+16>>2];b=c[b+8>>2]|0;c[46973]=b;c[46964]=b;c[46962]=c[c[d>>2]>>2];a[194805]=a[b>>0]|0;return}function qD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g;d=g+16|0;e=g+12|0;h=c[46964]|0;b=h+1|0;i=(Q2(b,96916,4)|0)==0;b=i?h+5|0:b;c[f>>2]=e;c[f+4>>2]=g+20;c[f+8>>2]=d;f=b5(b,96921,f)|0;if((f|0)>0?(c[4725]=(c[e>>2]|0)+-1,(f|0)!=1):0){d=b+(c[d>>2]|0)|0;b=d;a:while(1){e=a[b>>0]|0;switch(e<<24>>24){case 0:case 34:break a;default:{}}b=b+1|0;}if((b|0)!=(d|0)&e<<24>>24==34){a[b>>0]=0;FD(d,b-d|0);}}l=g;return}function rD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+2080|0;i=j+8|0;f=j;b=j+1056|0;d=j+32|0;h=j+16|0;k=a[(c[46964]|0)+((c[46965]|0)+-1)>>0]|0;e=k<<24>>24==46;if(e|((k&255)+-48|0)>>>0<10)if(e?(ED()|0)!=0:0)g=4;else b=0;else g=4;if((g|0)==4){k=c[46966]|0;kA(h,1024,b);nA(h,96827)|0;nA(h,c[46964]|0)|0;c[f>>2]=c[4725];m4(d,96871,f)|0;nA(h,d)|0;nA(h,(k|0)==0?96821:k)|0;nA(h,96888)|0;d=h+4|0;b=c[d>>2]|0;if(b>>>0>=(c[h+8>>2]|0)>>>0){lA(h,1)|0;b=c[d>>2]|0;}a[b>>0]=0;b=c[h>>2]|0;c[d>>2]=b;c[i>>2]=b;gA(0,96913,i)|0;oA(h);b=1;}l=j;return b|0}function sD(){var b=0;b=c[46978]|0;if(!b){b=T1(1024)|0;c[46978]=b;c[46980]=b+1024;}c[46979]=b;a[b>>0]=0;return}function tD(){c[46992]=fD(c[46942]|0,c[46978]|0)|0;a[c[46978]>>0]=0;return}function uD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=c[46979]|0;d=c[46978]|0;if(e>>>0>d>>>0){e=e+-1|0;f=3;}a:while(1){if((f|0)==3)c[46979]=e;f=c[46980]|0;g=f;do{h=b;b=b+1|0;h=a[h>>0]|0;i=e;e=e+1|0;a[i>>0]=h;if(!(h<<24>>24))break a}while(e>>>0>>0);c[46979]=e;f=d;i=g-f<<1;d=W1(d,i)|0;c[46978]=d;c[46980]=d+i;e=d+(e-f)|0;f=3;}c[46979]=e;return}function vD(){c[46992]=gD(c[46942]|0,c[46978]|0)|0;a[c[46978]>>0]=0;return}function wD(){var d=0,e=0,f=0,g=0,h=0;h=c[46973]|0;g=c[46964]|0;e=(c[(c[c[46972]>>2]|0)+28>>2]|0)+(c[46971]|0)|0;while(1){if(g>>>0>=h>>>0)break;d=a[g>>0]|0;if(!(d<<24>>24))d=1;else d=c[18904+((d&255)<<2)>>2]|0;if(b[63856+(e<<1)>>1]|0){c[46974]=e;c[46975]=g;}a:while(1){f=d&255;do{d=f+(b[64042+(e<<1)>>1]|0)|0;if((e|0)==(b[64252+(d<<1)>>1]|0))break a;d=b[64788+(e<<1)>>1]|0;e=d<<16>>16;}while(d<<16>>16<=92);d=c[19928+(f<<2)>>2]|0;}g=g+1|0;e=b[64998+(d<<1)>>1]|0;}return e|0}function xD(a){a=a|0;var d=0;if(b[63856+(a<<1)>>1]|0){d=c[46973]|0;c[46974]=a;c[46975]=d;}while(1){d=(b[64042+(a<<1)>>1]|0)+1|0;if((a|0)==(b[64252+(d<<1)>>1]|0))break;a=b[64788+(a<<1)>>1]|0;}d=b[64998+(d<<1)>>1]|0;return (d<<16>>16==92?0:d<<16>>16)|0}function yD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[46972]|0;g=c[j>>2]|0;i=c[g+4>>2]|0;f=c[46964]|0;l=c[46973]|0;k=l;if(l>>>0>(i+((c[46977]|0)+1)|0)>>>0)zD(96674);h=k-f|0;if(!(c[g+40>>2]|0))b=(h|0)==1?1:2;else {l=h+-1|0;h=i;g=0;while(1){if((g|0)>=(l|0))break;a[h>>0]=a[f>>0]|0;h=h+1|0;f=f+1|0;g=g+1|0;}f=c[j>>2]|0;do if((c[f+44>>2]|0)==2){c[46977]=0;c[f+16>>2]=0;e=f;m=17;}else {while(1){i=f+12|0;h=c[i>>2]|0;g=h-l+-1|0;if(g|0){m=16;break}g=f+4|0;j=c[g>>2]|0;if(!(c[f+20>>2]|0)){m=12;break}f=h<<1;f=(f|0)==0?(h>>>3)+h|0:f;c[i>>2]=f;f=AD(j,f+2|0)|0;c[g>>2]=f;if(!f)break;j=f+(k-j)|0;c[46973]=j;f=c[c[46972]>>2]|0;k=j;}if((m|0)==12)c[g>>2]=0;else if((m|0)==16){d=nb[c[c[(c[46967]|0)+8>>2]>>2]&63](c[46968]|0,(c[f+4>>2]|0)+l|0,g>>>0<8192?g:8192)|0;e=c[c[46972]>>2]|0;c[46977]=d;c[e+16>>2]=d;if(!d){m=17;break}else {b=0;break}}zD(96730);}while(0);do if((m|0)==17)if(!l){BD(c[46962]|0);b=1;d=c[46977]|0;e=c[c[46972]>>2]|0;break}else {c[e+44>>2]=2;b=2;d=0;break}while(0);f=d+l|0;do if(f>>>0>(c[e+12>>2]|0)>>>0){m=AD(c[e+4>>2]|0,f+(d>>>1)|0)|0;d=c[46972]|0;c[(c[d>>2]|0)+4>>2]=m;d=c[(c[d>>2]|0)+4>>2]|0;if(!d)zD(96774);else {n=c[46977]|0;o=d;break}}else {n=d;o=c[e+4>>2]|0;}while(0);n=n+l|0;c[46977]=n;a[o+n>>0]=0;o=c[46972]|0;a[(c[(c[o>>2]|0)+4>>2]|0)+((c[46977]|0)+1)>>0]=0;c[46964]=c[(c[o>>2]|0)+4>>2];}return b|0}function zD(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=c[15712]|0;c[b>>2]=a;w4(d,96670,b)|0;Sa(2);}function AD(a,b){a=a|0;b=b|0;return W1(a,b)|0}function BD(a){a=a|0;var b=0,d=0,e=0;d=c[46972]|0;if((d|0)!=0?(b=c[d>>2]|0,(b|0)!=0):0)e=4;else {nD();b=oD(c[46962]|0,16384)|0;d=c[46972]|0;c[d>>2]=b;if(!d)b=0;else e=4;}CD(b,a);pD();return}function CD(a,b){a=a|0;b=b|0;var d=0;d=c[(d2()|0)>>2]|0;DD(a);c[a>>2]=b;c[a+40>>2]=1;b=c[46972]|0;if(!b)b=0;else b=c[b>>2]|0;if((b|0)!=(a|0)){c[a+32>>2]=1;c[a+36>>2]=0;}c[a+24>>2]=0;c[(d2()|0)>>2]=d;return}function DD(b){b=b|0;var d=0;if(b|0){c[b+16>>2]=0;d=b+4|0;a[c[d>>2]>>0]=0;a[(c[d>>2]|0)+1>>0]=0;c[b+8>>2]=c[d>>2];c[b+28>>2]=1;c[b+44>>2]=0;d=c[46972]|0;if(!d)d=0;else d=c[d>>2]|0;if((d|0)==(b|0))pD();}return}function ED(){var b=0,d=0;d=c[46964]|0;b=(c[46965]|0)+-2|0;while(1){if((b|0)<=-1){b=0;break}if((a[d+b>>0]|0)==46){b=1;break}else b=b+-1|0;}return b|0}function FD(a,b){a=a|0;b=b|0;var d=0;d=c[46981]|0;if((d|0)<(b|0)){if(!d)d=T1(b+1|0)|0;else d=W1(c[46982]|0,b+1|0)|0;c[46982]=d;c[46981]=b;}else d=c[46982]|0;r3(d,a)|0;c[46966]=c[46982];return}function GD(a){a=a|0;return T1(a)|0}function HD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+2112|0;k=m+32|0;i=m+24|0;h=m+16|0;g=m+8|0;f=m;d=m+56|0;j=m+40|0;kA(j,1024,m+1080|0);e=c[46966]|0;if(e|0){nA(j,e)|0;nA(j,97027)|0;}nA(j,b)|0;c[f>>2]=c[4725];m4(d,97030,f)|0;nA(j,d)|0;a:do if(!(a[c[46964]>>0]|0))switch(((c[46971]|0)+-1|0)/2|0|0){case 2:{c[g>>2]=16384;m4(d,97050,g)|0;nA(j,d)|0;b=c[46978]|0;if(!(a[b>>0]|0))break a;i=l2(b)|0;nA(j,97112)|0;b=c[46978]|0;if((i|0)>80)a[b+80>>0]=0;nA(j,b)|0;break a}case 3:{c[h>>2]=16384;m4(d,97131,h)|0;nA(j,d)|0;b=c[46978]|0;if(!(a[b>>0]|0))break a;i=l2(b)|0;nA(j,97199)|0;b=c[46978]|0;if((i|0)>80)a[b+80>>0]=0;nA(j,b)|0;break a}case 1:{c[i>>2]=16384;m4(d,97218,i)|0;nA(j,d)|0;break a}default:break a}else {nA(j,97042)|0;nA(j,c[46964]|0)|0;d=j+4|0;b=c[d>>2]|0;if(b>>>0>=(c[j+8>>2]|0)>>>0){lA(j,1)|0;b=c[d>>2]|0;}c[d>>2]=b+1;a[b>>0]=39;}while(0);e=j+4|0;b=c[e>>2]|0;d=j+8|0;if(b>>>0>=(c[d>>2]|0)>>>0){lA(j,1)|0;b=c[e>>2]|0;}c[e>>2]=b+1;a[b>>0]=10;b=c[e>>2]|0;if(b>>>0>=(c[d>>2]|0)>>>0){lA(j,1)|0;b=c[e>>2]|0;}a[b>>0]=0;i=c[j>>2]|0;c[e>>2]=i;c[k>>2]=i;gA(1,96913,k)|0;oA(j);l=m;return}function ID(){JD(c[46964]|0);return}function JD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=c[46973]|0;a[j>>0]=a[194805]|0;i=c[46972]|0;e=c[i>>2]|0;d=c[e+4>>2]|0;if(j>>>0<(d+2|0)>>>0){f=d+((c[46977]|0)+2)|0;g=d+((c[e+12>>2]|0)+2)|0;k=d;h=e;while(1){if(f>>>0<=k>>>0)break;e=f+-1|0;k=g+-1|0;a[k>>0]=a[e>>0]|0;h=c[i>>2]|0;f=e;g=k;k=c[h+4>>2]|0;}e=g-f|0;d=j+e|0;j=c[h+12>>2]|0;c[46977]=j;c[h+16>>2]=j;if(d>>>0<(k+2|0)>>>0)zD(97277);else {l=b+e|0;m=d;}}else {l=b;m=j;}b=m+-1|0;a[b>>0]=64;c[46964]=l;a[194805]=a[b>>0]|0;c[46973]=b;return}function KD(){var a=0;a=c[46972]|0;if(!a)a=0;else a=c[a>>2]|0;DD(a);return}function LD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+80|0;f=e;g=a+52|0;XD(a,c[g>>2]|0,18548);a=f+8|0;c[a>>2]=b;c[a+4>>2]=d;d=c[g>>2]|0;d=nb[c[d>>2]&63](d,f,4)|0;l=e;return d|0}function MD(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=LD(b,d,e)|0;if(!f){f=dC(b,72)|0;c[f+64>>2]=c[b+64>>2];g=f+24|0;h=c[b+24>>2]|0;c[g>>2]=h;a[g>>0]=h&255&-9;c[f+56>>2]=b;c[f+60>>2]=c[b+60>>2];b=f+8|0;c[b>>2]=d;c[b+4>>2]=e;qB(f)|0;}return f|0}function ND(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;if(!(((b|0)!=0?(HB(a,0,b,f,0)|0)!=0:0)?(e=f,e=LD(a,c[e>>2]|0,c[e+4>>2]|0)|0,(e|0)!=0):0))if((d|0)!=0?(HB(a,0,b,f,1)|0)!=0:0){e=f;e=MD(a,c[e>>2]|0,c[e+4>>2]|0)|0;LB(a,0,e);}else e=0;l=g;return e|0}function OD(a){a=a|0;a=c[a+52>>2]|0;return nb[c[a>>2]&63](a,0,128)|0}function PD(a){a=a|0;var b=0;b=QD(a)|0;if(!b)a=0;else {b=c[b+52>>2]|0;a=nb[c[b>>2]&63](b,a,8)|0;}return a|0}function QD(a){a=a|0;return c[a+56>>2]|0}function RD(a,b){a=a|0;b=b|0;a=c[a+52>>2]|0;return nb[c[a>>2]&63](a,b,2)|0}function SD(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[46984]|0;e=(b|0)!=0;do if(!a)if(e){U1(b);a=0;break}else {a=T1(d)|0;break}else if(e){eC(a,b);a=0;break}else {a=dC(a,d)|0;break}while(0);return a|0}function TD(a,b,d){a=a|0;b=b|0;d=d|0;a=c[46984]|0;if(!a)U1(b);else eC(a,b);return}function UD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=b+28|0;f=c[e>>2]|0;c[e>>2]=7;c[46984]=a;d=Vz(b,d)|0;c[e>>2]=f;c[46984]=0;return d|0}function VD(a,b,d){a=a|0;b=b|0;d=d|0;c[46984]=a;return nb[c[b>>2]&63](b,d,2)|0}function WD(a,b){a=a|0;b=b|0;var d=0,e=0;d=(bA(b,0,0)|0)+28|0;e=c[d>>2]|0;c[d>>2]=7;c[46984]=a;if(!(Rz(b)|0)){c[d>>2]=e;c[46984]=0;a=0;}else a=1;return a|0}function XD(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0?(bA(b,0,0)|0)!=(c|0):0)bA(b,c,0)|0;return}function YD(a,b){a=a|0;b=b|0;if(!(iD(a)|0))b=_D(a,b)|0;else ZD(a,b)|0;return b|0}function ZD(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;a[c>>0]=60;e=c;while(1){d=e+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;a[d>>0]=f;b=b+1|0;e=d;}a[d>>0]=62;a[e+2>>0]=0;return c|0}function _D(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;a:do if((b|0)!=0?(a[b>>0]|0)!=0:0){a[d>>0]=34;l=a[b>>0]|0;q=0;g=((l+-45&255)<2|((l&255)+-48|0)>>>0<10)&1;h=0;i=0;j=0;e=d+1|0;f=b+1|0;b:while(1){k=e;while(1){if(!(l<<24>>24))break b;e=l&255;c:do if(l<<24>>24==34){a[k>>0]=92;m=g;n=1;k=k+1|0;}else {if(!g){n=l<<24>>24>-1&(l<<24>>24!=95&(a3(e)|0)==0);m=0;n=n?1:h;break}switch(l<<24>>24){case 45:{n=(j|0)==0;m=n?g:0;n=n?h:1;break c}case 46:{n=(i|0)==0;m=n?g:0;n=n?h:1;i=i+1|0;break c}default:{n=(e+-48|0)>>>0<10;m=n?g:0;n=n?h:1;break c}}}while(0);e=k+1|0;a[k>>0]=l;p=f+1|0;o=a[f>>0]|0;j=j+1|0;f=c[5031]|0;if(!f){g=m;h=n;k=e;f=p;l=o;continue}g=o&255;h=o<<24>>24!=0;if((q&h?!(l<<24>>24==92|l<<24>>24>-1&((l+-45&255)>1&(a3(l<<24>>24)|0)==0)^1):0)?!(o<<24>>24>-1&((o+-45&255)>1&(a3(g)|0)==0)):0)break;if((j|0)<(f|0)|h^1){g=m;h=n;k=e;f=p;l=o;continue}if(l<<24>>24==92|l<<24>>24>-1&((a3(l<<24>>24)|0)==0&(l+-45&255)>1)^1){q=1;g=m;h=n;l=o;f=p;continue b}if(o<<24>>24>-1&((o+-45&255)>1&(a3(g)|0)==0)){q=1;g=m;h=n;l=o;f=p;continue b}a[e>>0]=92;a[k+2>>0]=10;g=m;h=1;j=0;k=k+3|0;f=p;l=o;}a[e>>0]=92;a[k+2>>0]=10;q=0;g=m;h=1;j=0;l=o;e=k+3|0;f=p;}a[k>>0]=34;a[k+1>>0]=0;if(!h){if((j|0)==1?((a[b>>0]|0)+-45&255)<2:0){b=d;break}else e=20128;while(1){f=c[e>>2]|0;if(!f)break a;if(!(c3(f,b)|0)){b=d;break}else e=e+4|0;}}else b=d;}else b=97309;while(0);return b|0}function $D(a){a=a|0;return YD(a,aE(a)|0)|0}function aE(a){a=a|0;var b=0;b=((l2(a)|0)<<1)+2|0;b=b>>>0>1024?b:1024;a=c[46986]|0;if(b>>>0>(c[46985]|0)>>>0){if(!a)a=T1(b)|0;else a=W1(a,b)|0;c[46986]=a;c[46985]=b;}return a|0}function bE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=0;break}if((cE(a)|0)==0?oC(a,b,0)|0:0){a=1;break}a=PD(a)|0;}return a|0}function cE(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=KB(b)|0;if((h|0)!=0?(a[h>>0]|0)!=37:0)d=0;else e=3;a:do if((e|0)==3){d=wA(b)|0;b:do if(d|0?(f=wA(QD(b)|0)|0,f|0):0){h=Xz(c[(wA(yC(b)|0)|0)+8>>2]|0)|0;g=d+12|0;e=f+12|0;d=0;while(1){if((d|0)>=(h|0))break b;f=c[(c[g>>2]|0)+(d<<2)>>2]|0;if((f|0?(i=c[(c[e>>2]|0)+(d<<2)>>2]|0,i|0):0)?s2(f,i)|0:0){d=0;break a}d=d+1|0;}}while(0);d=rA(b,0)|0;if(d)if((Xz(c[d+8>>2]|0)|0)>0)d=0;else return (Xz(c[d+12>>2]|0)|0)<1|0;else d=1;}while(0);return d|0}function dE(b,d){b=b|0;d=d|0;var e=0,f=0;c[46987]=0;e=QA(b,97319)|0;if((e|0?((a[e>>0]|0)+-48|0)>>>0<10:0)?(f=y4(e,0,10)|0,(f|0)==0|(f|0)>59):0)c[5031]=f;eE(b,1);if(((fE(b,d,1)|0)!=-1?(gE(b,d)|0)!=-1:0)?(hE(b,d)|0)!=-1:0){c[5031]=128;b=kb[c[(c[(c[b+64>>2]|0)+8>>2]|0)+8>>2]&63](d)|0;}else b=-1;return b|0}function eE(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=c[a>>2]&-9;d=OD(a)|0;while(1){if(!d)break;eE(d,0);d=PD(d)|0;}a:do if(b|0){b=jC(a)|0;while(1){if(!b)break a;c[b>>2]=c[b>>2]&-9;d=XA(a,b)|0;while(1){if(!d)break;c[d>>2]=c[d>>2]&-9;d=ZA(a,d)|0;}b=kC(a,b)|0;}}while(0);return}function fE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;if((e|0)==0?(QD(b)|0)!=0:0){i=0;g=195059;k=109514;}else {k=(a[b+24>>0]&1)==0?195059:97363;g=(zB(b)|0)==0;c[46988]=GA(b,2,111455,0)|0;c[46989]=GA(b,2,111464,0)|0;i=1;g=g?195059:97366;}f=KB(b)|0;if((f|0)!=0?(a[f>>0]|0)!=37:0){h=1;j=102604;}else {h=0;j=195059;f=195059;}do if((iE(b,d)|0)!=-1?(jE(b,d,g)|0)!=-1:0){g=(h|0)==0;if(h|i|0){if((jE(b,d,k)|0)==-1){f=-1;break}if((jE(b,d,102597)|0)==-1){f=-1;break}}if(!g?(uE(b,d,f)|0)==-1:0){f=-1;break}if(((jE(b,d,j)|0)!=-1?(jE(b,d,97374)|0)!=-1:0)?(c[46987]=(c[46987]|0)+1,(zE(b,d,e)|0)!=-1):0){c[b>>2]=c[b>>2]|8;f=0;}else f=-1;}else f=-1;while(0);return f|0}function gE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:do if((kE(a,b)|0)==-1)d=-1;else {k=rA(yC(a)|0,0)|0;i=(k|0)==0;j=k+12|0;k=k+8|0;h=jC(a)|0;while(1){if(!h){d=0;break a}if(lE(a,h,(c[h>>2]|0)>>>4,0)|0){if(i)d=0;else d=c[k>>2]|0;if((mE(h,b,d)|0)==-1){d=-1;break a}}g=XA(a,h)|0;d=h;while(1){if(!g)break;f=g+-48|0;e=c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0;if((d|0)!=(e|0)?(lE(a,e,(c[h>>2]|0)>>>4,0)|0)!=0:0){if(i)d=0;else d=c[k>>2]|0;if((mE(c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0,b,d)|0)==-1){d=-1;break a}d=c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0;}if(nE(a,g)|0){if(i)e=0;else e=c[j>>2]|0;if((oE(g,b,e)|0)==-1){d=-1;break a}}g=ZA(a,g)|0;}h=kC(a,h)|0;}}while(0);return d|0}function hE(a,b){a=a|0;b=b|0;c[46987]=(c[46987]|0)+-1;if((iE(a,b)|0)==-1)a=-1;else a=((jE(a,b,111008)|0)==-1)<<31>>31;return a|0}function iE(a,b){a=a|0;b=b|0;var d=0;d=c[46987]|0;while(1){if((d|0)<=0){d=0;break}if((jE(a,b,153597)|0)==-1){d=-1;break}else d=d+-1|0;}return d|0}function jE(a,b,d){a=a|0;b=b|0;d=d|0;return lb[c[(c[(c[a+64>>2]|0)+8>>2]|0)+4>>2]&127](b,d)|0}function kE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=0;break}if(!(cE(a)|0)){if((fE(a,b,0)|0)==-1){a=-1;break}if((gE(a,b)|0)==-1){a=-1;break}if((hE(a,b)|0)==-1){a=-1;break}}else kE(a,b)|0;a=PD(a)|0;}return a|0}function lE(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;if((bE(a,b)|0)==0?(wE(a,b,c,d)|0)!=0:0)if((xE(a,b)|0)==0?(yE(b)|0)==0:0)e=5;else a=1;else e=5;if((e|0)==5)a=0;return a|0}function mE(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=xC(a)|0;do if((iE(d,b)|0)!=-1?(pE(a,b)|0)!=-1:0){if((rE(a)|0)==0?(sE(a,b,c)|0)==-1:0){a=-1;break}a=jE(d,b,97330)|0;}else a=-1;while(0);return a|0}function nE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=1;break}if((cE(a)|0)==0?mB(a,b,0)|0:0){a=0;break}a=PD(a)|0;}return a|0}function oE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=c[a>>2]&3;g=c[((e|0)==3?a:a+48|0)+40>>2]|0;e=c[((e|0)==2?a:a+-48|0)+40>>2]|0;f=xC(g)|0;do if((((((iE(f,b)|0)!=-1?(pE(g,b)|0)!=-1:0)?(qE(a,b,c[46988]|0)|0)!=-1:0)?(g=(xB(xC(g)|0)|0)!=0,(jE(f,b,g?100079:100084)|0)!=-1):0)?(pE(e,b)|0)!=-1:0)?(qE(a,b,c[46989]|0)|0)!=-1:0){if(!(rE(a)|0)){if((sE(a,b,d)|0)==-1){a=-1;break}}else if((tE(a,b,1)|0)==-1){a=-1;break}a=jE(f,b,97330)|0;}else a=-1;while(0);return a|0}function pE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;g=i;d=i+8|0;e=KB(a)|0;f=xC(a)|0;if(!e){j=a+8|0;a=c[j+4>>2]|0;e=g;c[e>>2]=c[j>>2];c[e+4>>2]=a;m4(d,97350,g)|0;if((jE(f,b,d)|0)==-1)a=-1;else h=4;}else if((uE(f,b,e)|0)==-1)a=-1;else h=4;if((h|0)==4)a=0;l=i;return a|0}function qE(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if((d|0)!=0?(e=xC(b)|0,f=RA(b,d)|0,(a[f>>0]|0)!=0):0)if((jE(e,c,107984)|0)==-1)b=-1;else {do if(iD(f)|0){if((uE(e,c,f)|0)==-1){b=-1;break a}}else {b=R2(f,58)|0;if(!b)if((vE(e,c,f,0)|0)==-1){b=-1;break a}else break;a[b>>0]=0;if((vE(e,c,f,0)|0)==-1){b=-1;break a}if((jE(e,c,107984)|0)==-1){b=-1;break a}if((vE(e,c,b+1|0,0)|0)==-1){b=-1;break a}a[b>>0]=58;}while(0);b=0;}else b=0;while(0);return b|0}function rE(a){a=a|0;return (c[a>>2]|0)>>>3&1|0}function sE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:do if(!(c[a>>2]&2)){e=0;k=4;}else {switch(tE(a,b,0)|0){case -1:{e=-1;break a}case 0:{e=0;k=4;break a}default:{}}e=1;k=4;}while(0);b:do if((k|0)==4){f=wA(a)|0;j=xC(a)|0;c:do if(f){i=f+12|0;h=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!h)break c;do if(c[a>>2]&2){g=c[46988]|0;if(g|0?(c[h+16>>2]|0)==(c[g+16>>2]|0):0)break;g=c[46989]|0;if(!((g|0)!=0?(c[h+16>>2]|0)==(c[g+16>>2]|0):0))k=12;}else k=12;while(0);if((k|0)==12){k=0;f=h+16|0;if((c[(c[i>>2]|0)+(c[f>>2]<<2)>>2]|0)!=(c[h+12>>2]|0)){g=e+1|0;if(e){if((jE(j,b,97345)|0)==-1){e=-1;break b}if((iE(j,b)|0)==-1){e=-1;break b}}else {if((iE(j,b)|0)==-1){e=-1;break b}if((jE(j,b,97342)|0)==-1){e=-1;break b}c[46987]=(c[46987]|0)+1;}if((uE(j,b,c[h+8>>2]|0)|0)==-1){e=-1;break b}if((jE(j,b,97348)|0)==-1){e=-1;break b}if((uE(j,b,c[(c[i>>2]|0)+(c[f>>2]<<2)>>2]|0)|0)==-1){e=-1;break b}else e=g;}}h=nb[c[d>>2]&63](d,h,8)|0;}}while(0);if((e|0)>0){if((jE(j,b,97340)|0)==-1){e=-1;break}c[46987]=(c[46987]|0)+-1;}c[a>>2]=c[a>>2]|8;e=0;}while(0);return e|0}function tE(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;e=KB(b)|0;b=xC(b)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0)if((jE(b,c,97333)|0)!=-1?(uE(b,c,e)|0)!=-1:0)if((d|0)!=0?(jE(b,c,97340)|0)==-1:0)b=-1;else {b=1;f=7;}else b=-1;else {b=0;f=7;}return b|0}function uE(a,b,c){a=a|0;b=b|0;c=c|0;return vE(a,b,c,1)|0}function vE(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(!d)c=_D(c,aE(c)|0)|0;else c=$D(c)|0;return jE(a,b,c)|0}function wE(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a:do if(0>>0|(0==(e|0)?(c[b>>2]|0)>>>4>>>0>>0:0))b=0;else {b=_A(a,b)|0;while(1){if(!b){b=1;break a}if(0>>0|(0==(e|0)?(c[c[b+40>>2]>>2]|0)>>>4>>>0>>0:0)){b=0;break a}b=$A(a,b)|0;}}while(0);return b|0}function xE(a,b){a=a|0;b=b|0;if(!(_A(a,b)|0))a=(XA(a,b)|0)==0&1;else a=0;return a|0}function yE(a){a=a|0;var b=0,d=0,e=0;a=wA(a)|0;a:do if(!a)a=0;else {d=a+8|0;e=c[d>>2]|0;b=a+12|0;a=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!a){a=0;break a}if((c[(c[b>>2]|0)+(c[a+16>>2]<<2)>>2]|0)!=(c[a+12>>2]|0)){a=1;break a}e=c[d>>2]|0;a=nb[c[e>>2]&63](e,a,8)|0;}}while(0);return a|0}function zE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=rA(a,0)|0;if(e)if(((AE(a,b,111494,c[e+16>>2]|0,d)|0)!=-1?(AE(a,b,111481,c[e+8>>2]|0,d)|0)!=-1:0)?(AE(a,b,111450,c[e+12>>2]|0,d)|0)!=-1:0)f=5;else a=-1;else f=5;if((f|0)==5)a=0;return a|0}function AE(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=(g|0)!=0;if(m)l=0;else l=_z(f,0)|0;k=(l|0)==0;j=nb[c[f>>2]&63](f,0,128)|0;g=0;while(1){if(!j){n=23;break}i=j+12|0;n=c[i>>2]|0;if((n|0)!=0?(a[n>>0]|0)!=0:0)n=12;else n=7;do if((n|0)==7){n=0;if(!(a[j+22>>0]|0)){if(!k){h=nb[c[l>>2]&63](l,j,4)|0;o=c[h+12>>2]|0;if(o|0?a[o>>0]|0:0){n=12;break}if(!(a[h+22>>0]|0))n=12;}}else n=12;}while(0);if((n|0)==12){n=0;h=g+1|0;if(g){if((jE(b,d,97345)|0)==-1){g=-1;break}if((iE(b,d)|0)==-1){g=-1;break}}else {if((iE(b,d)|0)==-1){g=-1;break}if((jE(b,d,e)|0)==-1){g=-1;break}if((jE(b,d,97342)|0)==-1){g=-1;break}c[46987]=(c[46987]|0)+1;}if((uE(b,d,c[j+8>>2]|0)|0)==-1){g=-1;break}if((jE(b,d,97348)|0)==-1){g=-1;break}if((uE(b,d,c[i>>2]|0)|0)==-1){g=-1;break}else g=h;}j=nb[c[f>>2]&63](f,j,8)|0;}do if((n|0)==23){if((g|0)>0){c[46987]=(c[46987]|0)+-1;if((g|0)!=1){if((jE(b,d,153599)|0)==-1){g=-1;break}if((iE(b,d)|0)==-1){g=-1;break}}g=(jE(b,d,97377)|0)==-1;if(m|g){g=g<<31>>31;break}}else if(m){g=0;break}_z(f,l)|0;g=0;}while(0);return g|0}function BE(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(c[b>>2]&3){case 0:{g=82;break}case 1:{g=83;break}case 3:case 2:{g=84;break}default:{}}b=lb[g&127](a,b)|0;if(!b)b=-1;else {FE(a,b,d,e,g,f);b=0;}return b|0}function CE(a,b){a=a|0;b=b|0;if((xC(b)|0)!=(a|0))b=mB(a,b,0)|0;return b|0}function DE(a,b){a=a|0;b=b|0;if((xC(b)|0)!=(a|0))b=oC(a,b,0)|0;return b|0}function EE(a,b){a=a|0;b=b|0;return a|0}function FE(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;h=(f|0)!=0;if(h)vb[c&127](a,b,d);g=OD(a)|0;while(1){if(!g)break;i=lb[e&127](g,b)|0;if(i|0)FE(g,i,c,d,e,f);g=PD(g)|0;}if(!h)vb[c&127](a,b,d);return}function GE(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1200|0;r=t+800|0;g=t;c[46990]=0;c[46991]=-2;f=r;i=200;n=g;p=0;q=0;o=r;a:while(1){b[o>>1]=p;if((f+(i<<1)+-2|0)>>>0>o>>>0)k=i;else {m=o-f>>1;e=m+1|0;if(i>>>0>9999){s=75;break}k=i<<1;k=k>>>0<1e4?k:1e4;h=T1(k*6|3)|0;if(h){W6(h|0,f|0,e<<1|0)|0;i=h+(k>>>1<<2)|0;W6(i|0,n|0,e<<2|0)|0;if((f|0)==(r|0)){e=0;f=h;}else {U1(f);e=0;f=h;}}else {e=4;i=n;}j=(e|0)==0;h=f+(m<<1)|0;switch((j?((f+(k<<1)+-2|0)>>>0>h>>>0?0:9):e)&15){case 9:{e=1;s=76;break a}case 4:{s=75;break a}case 0:{g=j?i+(m<<2)|0:g;n=i;o=j?h:o;break}default:{e=0;break a}}}if((p|0)==6){e=0;s=76;break}e=a[97381+p>>0]|0;j=e<<24>>24;do if(e<<24>>24!=-18){h=c[46991]|0;if((h|0)==-2){h=mD()|0;c[46991]=h;}if((h|0)>=1)if(h>>>0<269)i=d[97461+h>>0]|0;else i=2;else {c[46991]=0;i=0;}h=i+j|0;if(h>>>0<=59?(i|0)==(d[97730+h>>0]|0):0){p=a[97790+h>>0]|0;e=p<<24>>24;if(p<<24>>24<1){h=0-e|0;s=23;break}else {c[46991]=-2;g=g+4|0;c[g>>2]=c[46992];j=(q|0)==0?0:q+-1|0;h=o;break}}else s=22;}else s=22;while(0);if((s|0)==22){s=0;p=a[97850+p>>0]|0;h=p&255;if(!(p<<24>>24)){h=c[46991]|0;b:do switch(q|0){case 0:{c[46990]=(c[46990]|0)+1;HD(143761);h=o;break}case 3:if((h|0)<1)if(!h){e=1;s=76;break a}else {h=o;break b}else {c[46991]=-2;h=o;break b}default:h=o;}while(0);while(1){if(e<<24>>24==18)break;if((h|0)==(f|0)){e=1;s=76;break a}e=h+-2|0;g=g+-4|0;h=e;e=a[97381+(b[e>>1]|0)>>0]|0;}g=g+4|0;c[g>>2]=c[46992];e=1;j=3;}else s=23;}do if((s|0)==23){s=0;i=d[97930+h>>0]|0;e=c[g+(1-i<<2)>>2]|0;c:do switch(h|0){case 2:{HE();IE();break}case 3:{if(c[46993]|0){HE();IE();sB(c[46993]|0)|0;c[46942]=0;c[46993]=0;}break}case 6:{JE(c[g>>2]|0,c[g+-4>>2]|0,c[g+-8>>2]|0);break}case 7:{e=c[g>>2]|0;break}case 8:{e=0;break}case 9:{e=1;break}case 10:{e=0;break}case 11:{e=0;break}case 12:{e=1;break}case 21:if(!(c[g+-4>>2]|0)){LE();break c}else {KE();break c}case 24:{ME();break}case 25:{ME();break}case 26:{e=1;break}case 27:{e=0;break}case 30:{NE(c[g>>2]|0,0,0);break}case 31:{NE(c[g+-8>>2]|0,c[g>>2]|0,0);break}case 32:{NE(c[g+-16>>2]|0,c[g+-8>>2]|0,c[g>>2]|0);break}case 33:{OE(c[g+-8>>2]|0,c[g+-4>>2]|0);break}case 34:{OE(258,0);break}case 35:{e=258;break}case 36:{e=259;break}case 37:{e=260;break}case 38:{e=c[g+-4>>2]|0;break}case 39:{e=0;break}case 48:{PE(c[g+-8>>2]|0,c[g>>2]|0);break}case 49:{PE(c[g>>2]|0,0);break}case 51:{QE(c[g>>2]|0);break}case 52:{RE();break}case 53:{e=c[g>>2]|0;break}case 54:{e=0;break}case 55:{e=0;break}case 59:{e=c[g>>2]|0;break}case 60:{e=c[g>>2]|0;break}case 61:{e=c[g>>2]|0;break}case 62:{e=SE(c[g+-8>>2]|0,c[g>>2]|0)|0;break}default:{}}while(0);i=0-i|0;p=g+(i<<2)|0;i=o+(i<<1)|0;g=p+4|0;c[p+4>>2]=e;e=(d[97993+h>>0]|0)+-24|0;p=b[i>>1]|0;h=p+(a[98056+e>>0]|0)|0;if(h>>>0<60?(d[97730+h>>0]|0)==(p|0):0){e=a[97790+h>>0]|0;j=q;h=i;break}e=a[98091+e>>0]|0;j=q;h=i;}while(0);i=k;p=e;q=j;o=h+2|0;}if((s|0)==75){HD(140558);e=2;s=76;}if((s|0)==76)if((f|0)!=(r|0))U1(f);l=t;return e|0}function HE(){var a=0,b=0;a=c[46994]|0;while(1){if(!a)break;_E(a+8|0);_E((c[46994]|0)+24|0);_E((c[46994]|0)+16|0);b=TE(c[46994]|0)|0;c[46994]=b;a=b;}return}function IE(){ID();TB(c[46993]|0);return}function JE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=c[46993]|0;if(!f){a[187980]=d&1|(e&255)<<1&2|a[187980]&-12|8;f=c[46996]|0;a[g>>0]=a[187980]|0;a[g+1>>0]=a[187981]|0;a[g+2>>0]=a[187982]|0;a[g+3>>0]=a[187983]|0;f=oB(b,g,f)|0;c[46993]=f;}c[46942]=f;c[46994]=UE(c[46994]|0,f)|0;hD(0,b)|0;l=h;return}function KE(){var b=0,d=0,e=0,f=0,g=0,h=0;ZE(2);e=c[46994]|0;f=a[98126]|0;h=0;b=e+24|0;while(1){d=c[b>>2]|0;if(!d)break;if(((c[d>>2]|0)==267?(g=c[d+4>>2]|0,(a[g>>0]|0)==f<<24>>24):0)?(s2(g,98126)|0)==0:0)b=c[d+8>>2]|0;else b=h;h=b;b=d+12|0;}b=e+16|0;a:while(1){e=c[b>>2]|0;b=e+12|0;if(!(c[b>>2]|0))break;d=e+4|0;if((c[e>>2]|0)==262){e=c[d>>2]|0;d=jC(e)|0;while(1){if(!d)continue a;g=oC(c[c[46994]>>2]|0,d,0)|0;fF(g,0,c[b>>2]|0,h);d=kC(e,d)|0;}}else while(1){d=c[d>>2]|0;if(!d)continue a;fF(c[d+4>>2]|0,c[d+8>>2]|0,c[b>>2]|0,h);d=d+12|0;}}_E((c[46994]|0)+8|0);_E((c[46994]|0)+16|0);_E((c[46994]|0)+24|0);c[(c[46994]|0)+4>>2]=0;return}function LE(){var a=0;ZE(1);a=(c[46994]|0)+8|0;while(1){a=c[a>>2]|0;if(!a)break;eF(c[a+4>>2]|0);a=a+12|0;}_E((c[46994]|0)+8|0);_E((c[46994]|0)+24|0);_E((c[46994]|0)+16|0);c[(c[46994]|0)+4>>2]=0;return}function ME(){var a=0,b=0;a=c[46994]|0;b=c[a+8>>2]|0;if(!b){b=c[a+4>>2]|0;if(!b)b=0;else {b=dF(b)|0;a=c[46994]|0;}c[a+4>>2]=0;}else {b=cF(b)|0;a=c[46994]|0;c[a+12>>2]=0;c[a+8>>2]=0;}if(b|0)WE(a+16|0,b);return}function NE(a,b,d){a=a|0;b=b|0;d=d|0;if(d)b=aF(b,d)|0;d=bF(tC(c[c[46994]>>2]|0,a,1)|0,b)|0;WE((c[46994]|0)+8|0,d);hD(c[46993]|0,a)|0;return}function OE(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;if(d|0)YE();d=(c[46994]|0)+24|0;while(1){d=c[d>>2]|0;if(!d)break;if(!(c[d+8>>2]|0))YE();d=d+12|0;}g=(b|0)==260?2:(b|0)==259&1;ZE(g);b=c[46994]|0;d=b+24|0;while(1){f=c[d>>2]|0;if(!f)break;do if((c[f>>2]|0)!=267){d=c[f+4>>2]|0;e=c[b>>2]|0;if(!((a[d+21>>0]|0)!=0&(e|0)==(c[46993]|0))){d=GA(e,g,c[d+8>>2]|0,c[f+8>>2]|0)|0;b=c[46994]|0;if((c[b>>2]|0)!=(c[46993]|0))break}a[d+22>>0]=1;}while(0);d=f+12|0;}_E(b+24|0);return}function PE(a,b){a=a|0;b=b|0;b=VE(a,b)|0;WE((c[46994]|0)+24|0,b);return}function QE(a){a=a|0;var b=0;b=c[46994]|0;c[46994]=UE(b,ND(c[b>>2]|0,a,1)|0)|0;hD(c[46993]|0,a)|0;return}function RE(){var a=0,b=0;a=c[46994]|0;b=c[a>>2]|0;a=TE(a)|0;c[46994]=a;c[a+4>>2]=b;return}function SE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+1024|0;f=g;d=l2(a)|0;d=d+1+(l2(b)|0)|0;if(d>>>0<1025)d=f;else d=T1(d)|0;r3(d,a)|0;F4(d,b)|0;e=fD(c[46993]|0,d)|0;hD(c[46993]|0,a)|0;hD(c[46993]|0,b)|0;if((d|0)!=(f|0))U1(d);l=g;return e|0}function TE(a){a=a|0;var b=0;b=c[(c[46994]|0)+32>>2]|0;eC(c[46993]|0,a);return b|0}function UE(a,b){a=a|0;b=b|0;var d=0;d=dC(c[46993]|0,36)|0;c[d+32>>2]=a;c[d>>2]=b;return d|0}function VE(a,b){a=a|0;b=b|0;return XE(267,a,b)|0}function WE(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+4|0;e=c[d>>2]|0;if(e|0)c[e+12>>2]=b;c[d>>2]=b;if(!(c[a>>2]|0))c[a>>2]=b;return}function XE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=dC(c[46993]|0,16)|0;c[e>>2]=a;c[e+4>>2]=b;c[e+8>>2]=d;return e|0}function YE(){var a=0;a=l;l=l+16|0;gA(0,98130,a)|0;l=a;return}function ZE(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=(b|0)==2;d=(c[46994]|0)+24|0;while(1){d=c[d>>2]|0;if(!d)break;e=d+4|0;f=c[e>>2]|0;if(!((g?(a[f>>0]|0)==(a[98126]|0):0)?!(s2(f,98126)|0):0)){h=GA(c[c[46994]>>2]|0,b,f,0)|0;c[e>>2]=h;if(!h)c[e>>2]=GA(c[c[46994]>>2]|0,b,f,195059)|0;c[d>>2]=266;hD(c[46993]|0,f)|0;}d=d+12|0;}return}function _E(a){a=a|0;$E(c[a>>2]|0);c[a+4>>2]=0;c[a>>2]=0;return}function $E(a){a=a|0;var b=0;while(1){if(!a)break;b=c[a+12>>2]|0;switch(c[a>>2]|0){case 265:{$E(c[a+4>>2]|0);break}case 266:case 267:{hD(c[46993]|0,c[a+8>>2]|0)|0;break}default:{}}eC(c[46993]|0,a);a=b;}return}function aF(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+1040|0;f=h;g=h+8|0;d=l2(a)|0;d=d+2+(l2(b)|0)|0;if(d>>>0<1025)e=g;else e=T1(d)|0;c[f>>2]=a;c[f+4>>2]=b;m4(e,98163,f)|0;d=fD(c[46993]|0,e)|0;hD(c[46993]|0,a)|0;hD(c[46993]|0,b)|0;if((e|0)!=(g|0))U1(e);l=h;return d|0}function bF(a,b){a=a|0;b=b|0;return XE(259,a,b)|0}function cF(a){a=a|0;return XE(265,a,0)|0}function dF(a){a=a|0;return XE(262,a,0)|0}function eF(a){a=a|0;var b=0,d=0;b=(c[46994]|0)+24|0;while(1){b=c[b>>2]|0;if(!b)break;if((c[b>>2]|0)==266?(d=c[b+4>>2]|0,d|0):0)KA(a,d,c[b+8>>2]|0)|0;b=b+12|0;}return}function fF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=d+4|0;a:do if((c[d>>2]|0)==262){d=c[f>>2]|0;f=jC(d)|0;while(1){if(!f)break a;gF(a,b,oC(c[c[46994]>>2]|0,f,0)|0,0,e);f=kC(d,f)|0;}}else while(1){f=c[f>>2]|0;if(!f)break a;d=oC(c[c[46994]>>2]|0,c[f+4>>2]|0,0)|0;gF(a,b,d,c[f+8>>2]|0,e);f=f+12|0;}while(0);return}function gF(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;d=iB(c[c[46994]>>2]|0,a,d,f,1)|0;if(d|0){g=c[d>>2]&3;f=c[((g|0)==2?d:d+-48|0)+40>>2]|0;a=(f|0)==(a|0)?(c[((g|0)==3?d:d+48|0)+40>>2]|0)!=(f|0):0;hF(d,111455,a?e:b);hF(d,111464,a?b:e);eF(d);}return}function hF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(d|0){e=GA(c[c[46994]>>2]|0,2,b,0)|0;if(!e)e=GA(c[c[46994]>>2]|0,2,b,195059)|0;KA(a,e,d)|0;}return}function iF(a,b,d){a=a|0;b=b|0;d=d|0;c[46962]=b;c[46993]=a;c[46942]=0;a=d|0?d:18600;c[46996]=a;lD(a,b);GE()|0;a=c[46942]|0;if(!a){KD();a=c[46942]|0;}return a|0}function jF(a,b){a=a|0;b=b|0;return iF(0,a,b)|0}function kF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;d=c[b+76>>2]|0;f=c[b>>2]|0;if((d|0)!=0?(e=c[d>>2]|0,(e|0)!=0):0){tb[e&127](b);g=12;}else g=4;do if((g|0)==4)if((c[b+40>>2]|0)==0?(h=b+36|0,(c[h>>2]|0)==0):0){if(a[f+13>>0]|0)lF(b);d=b+32|0;e=c[d>>2]|0;if(!e){c[h>>2]=c[15679];g=12;break}f=$4(e,106512)|0;c[h>>2]=f;if(!f){j=c[(c[b+12>>2]|0)+16>>2]|0;h=c[d>>2]|0;d=t2(c[(d2()|0)>>2]|0)|0;c[i>>2]=h;c[i+4>>2]=d;ub[j&63](98169,i);d=1;}else g=12;}else g=12;while(0);if((g|0)==12)if(!(c[b+152>>2]&1024))d=0;else {ub[c[(c[b+12>>2]|0)+16>>2]&63](98207,j);d=1;}l=k;return d|0}function lF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+112|0;e=h;g=h+4|0;d=c[b+24>>2]|0;if(!d)a[g>>0]=0;else {c[e>>2]=d+1;m4(g,98225,e)|0;}e=c[b+20>>2]|0;e=e|0?e:98229;d=l2(e)|0;i=l2(g)|0;f=b+52|0;i=d+1+i+(l2(c[f>>2]|0)|0)|0;d=i+11|0;if((c[46997]|0)>>>0<(i+1|0)>>>0){c[46997]=d;d=W1(c[46998]|0,d)|0;c[46998]=d;}else d=c[46998]|0;r3(d,e)|0;F4(c[46998]|0,g)|0;d=c[46998]|0;d=d+(l2(d)|0)|0;a[d>>0]=46;a[d+1>>0]=0;d=D4(c[f>>2]|0)|0;f=c[46998]|0;while(1){e=E4(d,58)|0;if(!e)break;F4(f,e+1|0)|0;i=c[46998]|0;g=i+(l2(i)|0)|0;a[g>>0]=46;a[g+1>>0]=0;a[e>>0]=0;f=i;}F4(f,d)|0;U1(d);c[b+32>>2]=c[46998];l=h;return}function mF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h+8|0;f=h;if((b|0)!=0&(d|0)!=0){if(c[a+152>>2]&1024|0){ub[c[(c[a+12>>2]|0)+16>>2]&63](98207,f);Sa(1);}if((nF(a,b,d)|0)==(d|0))e=d;else {f=c[(c[a+12>>2]|0)+16>>2]|0;c[g>>2]=d;ub[f&63](98239,g);Sa(1);}}else e=0;l=h;return e|0}function nF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;f=c[(c[b>>2]|0)+104>>2]|0;do if(!f){j=b+40|0;h=c[j>>2]|0;if(!h){e=U4(d,1,e,c[b+36>>2]|0)|0;break}f=b+44|0;i=b+48|0;g=c[i>>2]|0;do if(((c[f>>2]|0)+-1-g|0)>>>0>>0){g=e+4096+g&-4096;c[f>>2]=g;f=W1(h,g)|0;c[j>>2]=f;if(!f){ub[c[(c[b+12>>2]|0)+16>>2]&63](98264,n);Sa(1);}else {k=f;m=c[i>>2]|0;break}}else {k=h;m=g;}while(0);W6(k+m|0,d|0,e|0)|0;n=(c[i>>2]|0)+e|0;c[i>>2]=n;a[(c[j>>2]|0)+n>>0]=0;}else e=nb[f&63](b,d,e)|0;while(0);l=o;return e|0}function oF(a,b){a=a|0;b=b|0;var c=0;c=l2(b)|0;b=(mF(a,b,c)|0)==(c|0);return (b?1:-1)|0}function pF(b,c){b=b|0;c=c|0;var d=0,e=0;d=l;l=l+16|0;e=d;a[e>>0]=c;b=(mF(b,e,1)|0)==1;l=d;return (b?c:-1)|0}function qF(b){b=b|0;var d=0;d=c[b+36>>2]|0;if(((d|0)!=0?(a[b+144>>0]|0)==0:0)?(c[(c[b>>2]|0)+104>>2]|0)==0:0)b=M4(d)|0;else b=0;return b|0}function rF(a){a=a|0;var b=0,d=0;b=c[a+76>>2]|0;if(b|0?(d=c[b+4>>2]|0,d|0):0)tb[d&127](a);qF(a)|0;return}function sF(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=c[a+76>>2]|0;if(c[a+152>>2]&1024|0){ub[c[(c[a+12>>2]|0)+16>>2]&63](98291,e);Sa(1);}if((d|0)!=0?(b=c[d+8>>2]|0,(b|0)!=0):0)tb[b&127](a);else {qF(a)|0;tF(a);}l=e;return}function tF(b){b=b|0;var d=0,e=0,f=0;d=b+32|0;if((c[d>>2]|0?(e=b+36|0,f=c[e>>2]|0,(f|0)!=(c[15679]|0)):0)?(a[b+144>>0]|0)==0:0){if(f|0){I4(f)|0;c[e>>2]=0;}c[d>>2]=0;}return}function uF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+1056|0;f=i;h=i+24|0;g=i+8|0;c[g>>2]=d;e=G3(h,1024,b,g)|0;if((e|0)>=0){if((e|0)>1023){e=KK(e+1|0)|0;c[g>>2]=d;f=e;e=n4(e,b,g)|0;}else f=h;mF(a,f,e)|0;if((f|0)!=(h|0))U1(f);}else {c[f>>2]=t2(c[(d2()|0)>>2]|0)|0;gA(1,98308,f)|0;}l=i;return}function vF(a,b){a=a|0;b=+b;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=wF(e,b)|0;mF(a,f,c[e>>2]|0)|0;l=d;return}function wF(b,d){b=b|0;d=+d;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!(d<-1.0e15))if(!(d>1.0e15)){d=d*1.0e4;f=~~((d<0.0?-.5:.5)+d);if(!f){f=138394;e=1;}else {l=(f|0)<0;k=4;i=0;e=194826;f=l?0-f|0:f;while(1){if(!((f|0)!=0|(k|0)>0))break;g=(f|0)%10|0;j=(f|0)/10|0;h=e+-1|0;if((g|0)==0&i<<24>>24==0)f=0;else {a[h>>0]=g|48;f=1;e=h;}if((k|0)==1)if(!(f<<24>>24))f=1;else {e=e+-1|0;a[e>>0]=46;f=1;}k=k+-1|0;i=f;f=j;}if(l){e=e+-1|0;a[e>>0]=45;}f=e;e=194826-e|0;}}else {f=98323;e=18;}else {f=98322;e=19;}c[b>>2]=e;return f|0}function xF(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=wF(e,+h[b>>3])|0;mF(a,f,c[e>>2]|0)|0;mF(a,102604,1)|0;b=wF(e,+h[b+8>>3])|0;mF(a,b,c[e>>2]|0)|0;l=d;return}function yF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;e=0;while(1){h=b+(e<<4)|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];xF(a,f);e=e+1|0;if((e|0)>=(d|0))break;mF(a,102604,1)|0;}l=g;return}function zF(a,b){a=a|0;b=b|0;var d=0;d=JK(392)|0;if(d|0){c[d>>2]=20156;c[d+16>>2]=23;c[d+32>>2]=a;c[d+36>>2]=b;}return d|0}function AF(a){a=a|0;var b=0,d=0,e=0,f=0;b=JK(392)|0;d=b;e=a;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));f=b+60|0;e=a+60|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[f+16>>2]=c[e+16>>2];f=b+80|0;e=a+80|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[f+16>>2]=c[e+16>>2];return b|0}function BF(a){a=a|0;IF(a);U1(a);return}function CF(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+160|0;d=c[e>>2]|0;if(d){e=c[46999]|0;if(e){d=c[e+4>>2]|0;if(!d){d=JK(632)|0;c[(c[46999]|0)+4>>2]=d;}}}else {d=JK(632)|0;c[e>>2]=d;c[a+164>>2]=d;}c[46999]=d;c[d+32>>2]=b;c[d>>2]=a;return}function DF(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+160|0;d=c[e>>2]|0;if(d){e=c[47e3]|0;if(e){d=c[e+4>>2]|0;if(!d){d=JK(632)|0;c[(c[47e3]|0)+4>>2]=d;}}}else {d=JK(632)|0;c[e>>2]=d;c[a+164>>2]=d;}c[47e3]=d;c[d+52>>2]=b;c[d>>2]=a;return (LF(a,3,b)|0)!=0|0}function EF(a){a=a|0;var b=0;b=c[a+160>>2]|0;c[a+164>>2]=b;return b|0}function FF(a){a=a|0;var b=0,d=0,e=0;a=a+164|0;b=c[a>>2]|0;d=c[b+4>>2]|0;if(d|0?(e=d+52|0,(c[e>>2]|0)==0):0)c[e>>2]=c[b+52>>2];c[a>>2]=d;return d|0}function GF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+8|0;f=b+10|0;if((c[e>>2]|0)>(b|0))a=c[a>>2]|0;else {c[e>>2]=f;f=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=f;a=f;}c[a+(b<<2)>>2]=d;return}function HF(a){a=a|0;var b=0;b=c[a>>2]|0;if(b|0)U1(b);c[a>>2]=0;c[a+8>>2]=0;c[a+4>>2]=0;return}function IF(a){a=a|0;var b=0,d=0,e=0;d=a+160|0;b=c[d>>2]|0;while(1){if(!b)break;e=c[b+4>>2]|0;HF(b+604|0);HF(b+592|0);U1(c[b+584>>2]|0);U1(c[b+588>>2]|0);U1(b);b=e;}c[47e3]=0;c[46999]=0;c[a+192>>2]=0;c[a+164>>2]=0;c[d>>2]=0;c[a+28>>2]=0;return}function JF(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0;n=l;l=l+128|0;k=n+64|0;m=n;i4(k,e,63)|0;i=R2(k,58)|0;if(i|0)a[i>>0]=0;b=b+60+(d<<2)|0;while(1){d=c[b>>2]|0;if(!d){d=b;b=0;break}i4(m,c[d+4>>2]|0,63)|0;d=R2(m,58)|0;if(d|0)a[d>>0]=0;if((s2(k,m)|0)<1){j=9;break}b=c[b>>2]|0;}while(1){if((j|0)==9){d=b;b=c[b>>2]|0;}if(!b)break;i4(m,c[b+4>>2]|0,63)|0;b=R2(m,58)|0;if(b|0)a[b>>0]=0;if(s2(k,m)|0)break;b=c[d>>2]|0;if((c[b+8>>2]|0)<=(f|0))break;j=9;}m=KK(20)|0;c[m>>2]=c[d>>2];c[d>>2]=m;c[m+4>>2]=e;c[m+8>>2]=f;c[m+12>>2]=g;c[m+16>>2]=h;l=n;return 1}function KF(a,b){a=a|0;b=b|0;b=l;l=l+16|0;gA(1,98396,b)|0;l=b;return 0}function LF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+144|0;r=s;o=s+80|0;p=s+16|0;n=(d+-3|0)>>>0<2?0:d;i4(o,e,63)|0;e=R2(o,58)|0;if(e){f=e+1|0;a[e>>0]=0;e=R2(f,58)|0;if(!e)m=0;else {a[e>>0]=0;m=e+1|0;}}else {m=0;f=0;}i=(f|0)!=0;j=(m|0)==0;k=(n|0)==(d|0);h=b+60+(d<<2)|0;a:while(1){e=c[h>>2]|0;if(!e){e=0;break}i4(p,c[e+4>>2]|0,63)|0;e=R2(p,58)|0;if(!e)e=0;else {a[e>>0]=0;e=e+1|0;}do if(!(s2(p,o)|0)){g=(e|0)!=0;if(i&g?s2(e,f)|0:0)break;if(!j?s2(m,c[(c[(c[h>>2]|0)+12>>2]|0)+8>>2]|0)|0:0)break;if(k|g^1){q=16;break a}if(LF(b,n,e)|0){q=16;break a}}while(0);h=c[h>>2]|0;}do if((q|0)==16){e=c[h>>2]|0;if(e){f=e+16|0;if((c[f>>2]|0)==0?(KF(0,0)|0,(c[f>>2]|0)==0):0){e=0;break}if((c[b+8>>2]|0)>0){q=c[15712]|0;o=c[e+4>>2]|0;p=c[(c[e+12>>2]|0)+8>>2]|0;c[r>>2]=c[20168+(d<<2)>>2];c[r+4>>2]=o;c[r+8>>2]=p;w4(q,98427,r)|0;}}else e=0;}while(0);c[b+80+(d<<2)>>2]=e;l=s;return e|0}function MF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;do if(!e)e=0;else {if(c[5047]|0){kA(188004,0,0);c[5047]=0;}h=D4(e)|0;e=R2(h,58)|0;if(e){a[e>>0]=0;f=b+60+(d<<2)|0;e=1;g=f;while(1){b=c[g>>2]|0;if(!b)break;d=D4(c[b+4>>2]|0)|0;b=R2(d,58)|0;if(b|0)a[b>>0]=0;if(!((a[h>>0]|0)!=0?(c3(h,d)|0)!=0:0)){e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=32;nA(188004,c[(c[g>>2]|0)+4>>2]|0)|0;e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=58;nA(188004,c[(c[(c[g>>2]|0)+12>>2]|0)+8>>2]|0)|0;e=0;}U1(d);g=c[g>>2]|0;}U1(h);if(e<<24>>24){g=0;i=19;}}else {U1(h);g=0;f=b+60+(d<<2)|0;e=1;i=19;}if((i|0)==19){while(1){b=c[f>>2]|0;if(!b)break;d=D4(c[b+4>>2]|0)|0;b=R2(d,58)|0;if(b|0)a[b>>0]=0;if(!((g|0)!=0?(c3(g,d)|0)==0:0)){e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=32;nA(188004,d)|0;e=0;}g=d;f=c[f>>2]|0;i=19;}if(e<<24>>24){e=195059;break}}e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}a[e>>0]=0;e=c[47001]|0;c[47002]=e;}while(0);return e|0}function NF(b){b=b|0;var d=0;if(!b)qa(111208,98444,573,98458);if(!(a[b>>0]|0))qa(111213,98444,574,98458);d=c[47005]|0;if(!d)b=0;else b=nb[c[d>>2]&63](d,b,512)|0;return b|0}function OF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;if(!b)qa(111312,98444,589,98475);g=b+8|0;e=c[g>>2]|0;if(!e)qa(111315,98444,590,98475);if(!(a[e>>0]|0))qa(111324,98444,591,98475);h=b+20|0;f=c[h>>2]|0;do if(!f){d=mP(e)|0;if(!d){c[i>>2]=c[g>>2];gA(0,98499,i)|0;d=0;break}i=$4(d,138821)|0;c[h>>2]=i;if(!i){c[j>>2]=t2(c[(d2()|0)>>2]|0)|0;c[j+4>>2]=d;gA(0,98524,j)|0;d=0;break}d=c[47006]|0;if((d|0)>49){a[b+17>>0]=1;d=1;break}else {c[47006]=d+1;d=1;break}}else {n5(f,0,0)|0;if(!(c[h>>2]|0))qa(98545,98444,614,98475);else d=1;}while(0);l=k;return d|0}function PF(b){b=b|0;var d=0,e=0;if(a[b+17>>0]|0?(d=b+20|0,e=c[d>>2]|0,e|0):0){I4(e)|0;c[d>>2]=0;}return}function QF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0;if(!b){e=-1;d=-1;}else {e=c[b+48>>2]|0;f=+(e|0);if(!e){g=+h[d>>3];f=+h[d+8>>3];}else {h[d+8>>3]=f;h[d>>3]=f;g=f;}e=~~(+((c[b+40>>2]|0)*72|0)/g);d=~~(+((c[b+44>>2]|0)*72|0)/f);}c[a>>2]=e;c[a+4>>2]=d;return}function RF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0.0;m=l;l=l+48|0;f=m+16|0;j=m;k=m+32|0;if((e|0)!=0?(a[e>>0]|0)!=0:0){if((0==0?(g=c[47133]|0,(c[47007]|0)!=(g|0)):0)?(c[47007]=g,i=c[47005]|0,i|0):0){Rz(i)|0;c[47005]=0;}n=+h[(c[(c[d+16>>2]|0)+8>>2]|0)+24>>3];n=!(n>=1.0)?96.0:n;h[j+8>>3]=n;h[j>>3]=n;d=SF(e)|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];QF(k,d,f);d=c[k>>2]|0;f=c[k+4>>2]|0;}else {d=-1;f=-1;}c[b>>2]=d;c[b+4>>2]=f;l=m;return}function SF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;e=f;if(!a)qa(111208,98444,638,98551);if(!(c[47005]|0))c[47005]=Vz(20192,c[4589]|0)|0;b=NF(a)|0;a:do if(!b){b=JK(64)|0;if(!b)b=0;else {d=b+8|0;c[d>>2]=fD(0,a)|0;if(!((OF(b)|0)<<24>>24)){TF(b);b=0;break}if(!(c[b+20>>2]|0))qa(98545,98444,653,98551);do switch(UF(b)|0){case 0:{a=iN(c[d>>2]|0)|0;c[b+52>>2]=a;if(!a){c[e>>2]=c[d>>2];gA(0,98568,e)|0;TF(b);b=0;break a}break}case 2:{VF(b);break}case 3:{WF(b);break}case 1:{XF(b);break}case 4:{YF(b);break}case 6:{ZF(b);break}case 11:{_F(b);break}case 8:{$F(b);break}case 5:{aG(b);break}case 12:{bG(b);break}default:{}}while(0);PF(b);e=c[47005]|0;nb[c[e>>2]&63](e,b,1)|0;}}else PF(b);while(0);l=f;return b|0}function TF(a){a=a|0;var b=0;b=c[a+8>>2]|0;if(b|0)hD(0,b)|0;U1(a);return}function UF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+224|0;f=j+200|0;g=j;h=a+20|0;b=c[h>>2]|0;a:do if((b|0)!=0?(x6(f,1,20,b)|0)==20:0){d=0;while(1){if(d>>>0>=10){i=13;break a}if(!($3(f,c[20228+(d<<4)>>2]|0,c[20228+(d<<4)+4>>2]|0)|0))break;d=d+1|0;}e=a+28|0;c[e>>2]=c[20228+(d<<4)+12>>2];b=c[20228+(d<<4)+8>>2]|0;a=a+24|0;c[a>>2]=b;switch(d|0){case 7:break;case 8:{if($3(f+8|0,98784,4)|0)break a;c[e>>2]=98789;c[a>>2]=11;b=11;break a}default:break a}while(1){if(!(c4(g,200,c[h>>2]|0)|0)){i=11;break}if(!($3(g,98779,4)|0)){i=8;break}}if((i|0)==8){c[e>>2]=101803;c[a>>2]=8;b=8;break}else if((i|0)==11){b=c[a>>2]|0;break}}else i=13;while(0);if((i|0)==13){c[a+28>>2]=98794;c[a+24>>2]=0;b=0;}l=j;return b|0}function VF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,6,0)|0;if((kG(c[e>>2]|0,2,b)|0)<<24>>24?(kG(c[e>>2]|0,2,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function WF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,16,0)|0;if((cG(c[e>>2]|0,4,b)|0)<<24>>24?(cG(c[e>>2]|0,4,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function XF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;b=h+12|0;d=h+8|0;e=h+4|0;f=h;c[a+48>>2]=0;g=a+20|0;n5(c[g>>2]|0,16,0)|0;if((((kG(c[g>>2]|0,2,b)|0)<<24>>24?(kG(c[g>>2]|0,2,d)|0)<<24>>24:0)?(kG(c[g>>2]|0,2,e)|0)<<24>>24:0)?(kG(c[g>>2]|0,2,f)|0)<<24>>24:0){c[a+40>>2]=c[b>>2]<<16|c[d>>2];c[a+44>>2]=c[e>>2]<<16|c[f>>2];}l=h;return}function YF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+32|0;b=m+16|0;e=m+12|0;f=m+8|0;h=m+4|0;i=m;c[a+48>>2]=0;j=a+20|0;while(1){if(!((cG(c[j>>2]|0,1,b)|0)<<24>>24))break;d=c[b>>2]|0;if((d|0)==255)continue;if(R2(98767,d)|0)continue;if((d|0)==192){k=6;break}g=c[j>>2]|0;if((d|0)==194){k=11;break}if(!((cG(g,2,e)|0)<<24>>24))break;n5(c[j>>2]|0,(c[e>>2]|0)+-2|0,1)|0;}if((k|0)==6){if(((cG(c[j>>2]|0,3,i)|0)<<24>>24?(cG(c[j>>2]|0,2,f)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,h)|0)<<24>>24:0){c[a+44>>2]=c[f>>2];c[a+40>>2]=c[h>>2];}}else if((((k|0)==11?(cG(g,3,i)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,f)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,h)|0)<<24>>24:0){c[a+44>>2]=c[f>>2];c[a+40>>2]=c[h>>2];}l=m;return}function ZF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+1056|0;j=m;b=m+32|0;e=m+28|0;f=m+24|0;g=m+20|0;h=m+16|0;c[a+48>>2]=72;i=a+20|0;n5(c[i>>2]|0,0,0)|0;while(1){if(!(c4(b,1024,c[i>>2]|0)|0))break;d=d4(b,98752)|0;if(!d)continue;c[j>>2]=e;c[j+4>>2]=f;c[j+8>>2]=g;c[j+12>>2]=h;if((b5(d,104311,j)|0)==4){k=5;break}}if((k|0)==5){j=c[e>>2]|0;c[a+32>>2]=j;k=c[f>>2]|0;c[a+36>>2]=k;c[a+40>>2]=(c[g>>2]|0)-j;c[a+44>>2]=(c[h>>2]|0)-k;}l=m;return}function _F(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;b=g+4|0;d=g;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,15,0)|0;h=(D6(c[e>>2]|0)|0)==88;f=c[e>>2]|0;if(h){n5(f,24,0)|0;if((kG(c[e>>2]|0,4,b)|0)<<24>>24?(kG(c[e>>2]|0,4,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}}else {n5(f,26,0)|0;if((kG(c[e>>2]|0,2,b)|0)<<24>>24?(kG(c[e>>2]|0,2,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}}l=g;return}function $F(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=l;l=l+352|0;C=F+80|0;B=F+72|0;E=F+64|0;D=F+56|0;A=F+48|0;d=F+40|0;s=F+32|0;t=F+24|0;u=F+16|0;v=F+8|0;w=F;x=F+328|0;y=F+128|0;z=F+96|0;if(!(c[47008]|0)){if(F5(188036,98637,1)|0){c[d>>2]=98637;gA(1,98664,d)|0;}c[47008]=188036;}m=b+20|0;n5(c[m>>2]|0,0,0)|0;n=z+12|0;o=z+20|0;p=z+8|0;q=z+16|0;r=z+4|0;d=0;g=0;f=0;e=0;a:while(1){if(!(c4(y,200,c[m>>2]|0)|0))break;if(g<<24>>24==0|d<<24>>24==0){i=y;k=e;}else break;b:while(1){j=f;c:while(1){while(1){if(r6(188036,i,4,z,0)|0){f=j;e=k;continue a}a[i+(c[n>>2]|0)>>0]=0;a[i+(c[o>>2]|0)>>0]=0;e=i+(c[p>>2]|0)|0;f=i+(c[q>>2]|0)|0;i=i+((c[r>>2]|0)+1)|0;if(!(s2(e,141116)|0))break;if(!(s2(e,141048)|0))break c;if(s2(e,98711)|0)continue;c[C>>2]=t;c[C+4>>2]=u;c[C+8>>2]=v;c[C+12>>2]=w;if((b5(f,98719,C)|0)==4)break b}c[A>>2]=s;c[A+4>>2]=x;if((b5(f,98701,A)|0)!=2){c[D>>2]=s;if((b5(f,101209,D)|0)==1){e=1;f=jG(+h[s>>3],98708)|0;}else {e=g;f=j;}}else {e=1;f=jG(+h[s>>3],x)|0;}if(!(d<<24>>24)){d=0;g=e;j=f;}else {g=e;e=k;continue a}}c[E>>2]=s;c[E+4>>2]=x;if((b5(f,98701,E)|0)!=2){c[B>>2]=s;if((b5(f,101209,B)|0)==1){d=1;e=jG(+h[s>>3],98708)|0;}else e=k;}else {d=1;e=jG(+h[s>>3],x)|0;}if(!(g<<24>>24)){g=0;f=j;k=e;}else {f=j;continue a}}d=1;g=1;f=~~(+h[v>>3]+1.0-+h[t>>3])>>>0;e=~~(+h[w>>3]+1.0-+h[u>>3])>>>0;}c[b+48>>2]=0;c[b+40>>2]=f;c[b+44>>2]=e;l=F;return}function aG(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0;d=l;l=l+32|0;b=d;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,0,0)|0;if(!(dG(c[e>>2]|0,b)|0)){g=+h[b>>3];c[a+32>>2]=~~g;f=+h[b+8>>3];c[a+36>>2]=~~f;c[a+40>>2]=~~(+h[b+16>>3]-g);c[a+44>>2]=~~(+h[b+24>>3]-f);}l=d;return}function bG(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,6,0)|0;if((cG(c[e>>2]|0,1,b)|0)<<24>>24?(cG(c[e>>2]|0,1,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function cG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[d>>2]=0;e=0;while(1){if(e>>>0>=b>>>0){e=1;break}f=D6(a)|0;if(H4(a)|0){e=0;break}c[d>>2]=c[d>>2]<<8|f;e=e+1|0;}return e|0}function dG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+1040|0;d=h;e=h+16|0;while(1){if(!(c4(e,1024,a)|0)){a=1;break}f=d4(e,98627)|0;if(f|0){g=4;break}}if((g|0)==4){c[d+4>>2]=e;c[d>>2]=f+9;c[d+8>>2]=a;a=eG(d,b)|0;}l=h;return a|0}function eG(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+1024|0;f=g;fG(b);e=a[c[b>>2]>>0]|0;if(!(e<<24>>24))e=(gG(b)|0)&255;else e=e<<24>>24;if((((e|0)==91?(c[b>>2]=(c[b>>2]|0)+1,hG(b,f),(iG(f,d)|0)==0):0)?(hG(b,f),(iG(f,d+8|0)|0)==0):0)?(hG(b,f),(iG(f,d+16|0)|0)==0):0){hG(b,f);e=(iG(f,d+24|0)|0)!=0&1;}else e=1;l=g;return e|0}function fG(b){b=b|0;var d=0;d=c[b>>2]|0;while(1){d=a[d>>0]|0;if(!(d<<24>>24))d=(gG(b)|0)&255;else d=d<<24>>24;if(!((d&255)<<24>>24))break;if(!(S2(d&255)|0))break;d=(c[b>>2]|0)+1|0;c[b>>2]=d;}return}function gG(b){b=b|0;var d=0;d=b+4|0;if(!(c4(c[d>>2]|0,1024,c[b+8>>2]|0)|0))b=0;else {d=c[d>>2]|0;c[b>>2]=d;b=a[d>>0]|0;}return b|0}function hG(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;fG(b);e=0;f=c[b>>2]|0;while(1){f=a[f>>0]|0;if(!(f<<24>>24))g=(gG(b)|0)&255;else g=f<<24>>24;f=g<<24>>24;if(!f)break;if(!((f|0)==46|(f+-48|0)>>>0<10))break;a[d+e>>0]=g;e=e+1|0;f=(c[b>>2]|0)+1|0;c[b>>2]=f;if((e|0)==1023){e=1023;break}}a[d+e>>0]=0;return}function iG(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0;e=l;l=l+16|0;f=e;d=+s5(a,f);if((c[f>>2]|0)==(a|0))a=1;else {h[b>>3]=d;a=0;}l=e;return a|0}function jG(a,b){a=+a;b=b|0;var c=0.0;do if(!(s2(b,98735)|0)){a=a*72.0;c=a;a=a>=0.0?.5:-.5;}else {if(!(s2(b,98738)|0)){a=a*.75;c=a;a=a>=0.0?.5:-.5;break}if(!(s2(b,98741)|0)){a=a*12.0;c=a;a=a>=0.0?.5:-.5;break}if(s2(b,98708)|0?s2(b,98744)|0:0)if(!(s2(b,98746)|0)){a=a*28.346456664;c=a;a=a>=0.0?.5:-.5;break}else {b=(s2(b,98749)|0)==0;c=a*2.8346456663999997;return (b?~~(c+(c>=0.0?.5:-.5)):0)|0}c=a>=0.0?.5:-.5;}while(0);return ~~(a+c)|0}function kG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[d>>2]=0;e=0;while(1){if(e>>>0>=b>>>0){e=1;break}f=D6(a)|0;if(H4(a)|0){e=0;break}c[d>>2]=c[d>>2]|f<<(e<<3);e=e+1|0;}return e|0}function lG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a=c[b+20>>2]|0;if(a|0)I4(a)|0;if(c[b+52>>2]|0?(e=c[b+60>>2]|0,e|0):0)tb[e&127](b);U1(b);return}function mG(){var a=0;GA(0,1,108224,105493)|0;a=zF(0,1)|0;aT(a,0);return a|0}function nG(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0;k=l;l=l+304|0;j=k+24|0;i=k+8|0;f=k;g=k+40|0;if((vS(b,e)|0)!=999)if((wS(b,d)|0)==-1)b=-1;else {b=c[d+16>>2]|0;e=b+16|0;if(!(a[(c[b+8>>2]|0)+81>>0]|0)){p=+h[e>>3];o=+h[b+24>>3];n=+h[b+32>>3];m=+h[b+40>>3];c[j>>2]=~~(p+(p>=0.0?.5:-.5));c[j+4>>2]=~~(o+(o>=0.0?.5:-.5));c[j+8>>2]=~~(n+(n>=0.0?.5:-.5));c[j+12>>2]=~~(m+(m>=0.0?.5:-.5));m4(g,98899,j)|0;}else {m=+h[b+24>>3];n=+h[e>>3];o=+h[b+40>>3];p=+h[b+32>>3];c[i>>2]=~~(m+(m>=0.0?.5:-.5));c[i+4>>2]=~~(n+(n>=0.0?.5:-.5));c[i+8>>2]=~~(o+(o>=0.0?.5:-.5));c[i+12>>2]=~~(p+(p>=0.0?.5:-.5));m4(g,98899,i)|0;}TA(d,102671,g,195059)|0;b=0;}else {b=MF(b,1,e)|0;c[f>>2]=e;c[f+4>>2]=b;gA(1,111233,f)|0;b=-1;}l=k;return b|0}function oG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=c[b+60>>2]|0;DF(a,d)|0;b=c[a+164>>2]|0;c[b+56>>2]=JR(b,c[b+52>>2]|0)|0;if((TC(f,137483,0,1)|0)!=0?(c[(c[f+16>>2]|0)+8>>2]|0)!=0:0)h=5;else if(!(c[b+152>>2]&67108864)){jA(98911,g);b=-1;}else h=5;if((h|0)==5){c[b+36>>2]=e;if(!e){h=b+152|0;c[h>>2]=c[h>>2]|134217728;}h=SJ(a,f)|0;LR(b);IF(a);b=h;}l=i;return b|0}function pG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=c[b+60>>2]|0;DF(a,d)|0;b=c[a+164>>2]|0;c[b+56>>2]=JR(b,c[b+52>>2]|0)|0;if((TC(f,137483,0,1)|0)!=0?(c[(c[f+16>>2]|0)+8>>2]|0)!=0:0)h=5;else if(!(c[b+152>>2]&67108864)){jA(98911,g);b=-1;}else h=5;if((h|0)==5){CF(a,e);h=SJ(a,f)|0;LR(b);sF(b);IF(a);b=h;}l=i;return b|0}function qG(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;h=m+8|0;g=m;b=c[b+60>>2]|0;DF(a,d)|0;j=c[a+164>>2]|0;c[j+56>>2]=JR(j,c[j+52>>2]|0)|0;if((TC(b,137483,0,1)|0)!=0?(c[(c[b+16>>2]|0)+8>>2]|0)!=0:0)k=5;else if(!(c[j+152>>2]&67108864)){jA(98911,g);b=-1;}else k=5;do if((k|0)==5){if(e|0?(i=T1(4096)|0,c[e>>2]=i,i|0):0){g=j+40|0;c[g>>2]=i;c[j+44>>2]=4096;d=j+48|0;c[d>>2]=0;b=SJ(a,b)|0;LR(j);if(!b){c[e>>2]=c[g>>2];c[f>>2]=c[d>>2];}IF(a);break}gA(1,98932,h)|0;b=-1;}while(0);l=m;return b|0}function rG(a,b){a=a|0;b=b|0;_S(a,0,b);return}function sG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+4288|0;E=H+8|0;D=H;F=4;G=T1(40)|0;c[G>>2]=0;A=H+4152|0;B=H+4148|0;C=H+4128|0;j=H+4112|0;k=H+16|0;o=0;i=$(24,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;a:do if((h|0)!=1){if(!i){c[d>>2]=0;g=0;break}o=0;n=ca(29,e|0,B|0,A|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;m=$(23,40)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;na(7,C|0,j|0,k|0,24,85);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){j=C+16|0;i=c[j>>2]|0;g=e;while(1){if(!g)break;o=0;aa(i|0,g|0,0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){y=0;x=j;w=m;v=n;g=z;m=15;break a}o=0;g=aa(86,b|0,g|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){y=0;x=j;w=m;v=n;g=z;m=15;break a}}G=U6(188068,1,G|0,F|0)|0;F=z;o=0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){y=m;x=j;w=m;v=n;g=z;m=15;}else {y=m;x=j;w=m;v=n;g=0;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=0;v=n;g=z;m=15;}}else {y=0;x=0;w=0;v=0;g=z;m=15;}while(0);do if((m|0)==15){b:while(1){c:do if(!g){o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}u=v+(c[B>>2]|0)|0;k=0;m=0;j=0;while(1){if(!e)break;o=0;g=aa(c[x>>2]|0,e|0,-1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){i=V6(c[h>>2]|0,G|0,F|0)|0;if(!i)bb(h|0,p|0);z=p;}else i=-1;if((i|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if((g|0)==0?(a[(c[e+16>>2]|0)+119>>0]|0)==3:0){if(!m){o=0;c[D>>2]=j;ca(30,u|0,137395,D|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;i=ca(31,b|0,v|0,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(53,i|0,137483,280,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}c[y+(j<<2)>>2]=i;k=1;j=j+1|0;}else i=m;o=0;da(54,b|0,e|0,i|0,C|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}}else i=m;o=0;e=aa(86,b|0,e|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}m=i;}o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}i=10;n=y;q=w;r=w;t=w;while(1){if(!e){m=0;i=r;e=t;break c}o=0;g=aa(c[x>>2]|0,e|0,-1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){m=V6(c[h>>2]|0,G|0,F|0)|0;if(!m)bb(h|0,p|0);z=p;}else m=-1;if((m|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if(!g){o=0;c[E>>2]=j;ca(30,u|0,137395,E|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;s=ca(31,b|0,v|0,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(53,s|0,137483,280,1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){g=V6(c[h>>2]|0,G|0,F|0)|0;if(!g)bb(h|0,p|0);z=p;}else g=-1;if((g|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(54,b|0,e|0,s|0,C|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if((j|0)==(i|0)){i=j<<1;o=0;m=aa(87,q|0,j<<3|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}g=m;q=m;r=m;h=m;}else {g=n;h=t;}c[g+(j<<2)>>2]=s;n=g;j=j+1|0;m=h;}else m=t;o=0;e=aa(86,b|0,e|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}t=m;}}else {m=1;k=0;n=y;j=0;i=w;e=w;}while(0);o=0;ia(108,C|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}if((v|0)!=(A|0)){o=0;ia(105,v|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}}if(!m){o=0;g=aa(87,e|0,j<<2|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}else {m=58;break}}c[d>>2]=0;g=0;while(1){if((g|0)>=(j|0))break;o=0;$(26,c[n+(g<<2)>>2]|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}g=g+1|0;}o=0;ia(105,i|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;}else {m=56;break}}if((m|0)==56){g=0;break}else if((m|0)==58){c[d>>2]=j;a[f>>0]=k;break}}while(0);U1(G|0);l=H;return g|0}function tG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if(!((a|0)!=0?(CG(a)|0)!=0:0))a=98988;e=l2(a)|0;if((e|0)>=104){d=KK(e+25|0)|0;if(!d)d=0;else f=6;}else f=6;if((f|0)==6){r3(d,a)|0;c[b>>2]=e;}return d|0}function uG(a,b){a=a|0;b=b|0;oC(b,a,1)|0;return}function vG(b,d){b=b|0;d=d|0;var e=0;b=(c[b+16>>2]|0)+157|0;e=a[b>>0]|0;if((d|0)>=0)a[b>>0]=d;return e|0}function wG(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[b>>2]=d;c[b+4>>2]=d+4096;c[b+12>>2]=0;c[b+8>>2]=0;c[a>>2]=b;c[a+4>>2]=b;c[a+8>>2]=d;c[a+12>>2]=e;c[a+16>>2]=f;return}function xG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;AG(e,b);i=e+12|0;j=e+16|0;b=0;a:while(1){k=BG(e)|0;if(!k)break;b=b+1|0;f=c[i>>2]|0;if(f|0)ub[f&63](k,d);h=aB(a,k)|0;while(1){if(!h)continue a;g=c[h>>2]&3;f=c[((g|0)==3?h:h+48|0)+40>>2]|0;if((f|0)==(k|0))f=c[((g|0)==2?h:h+-48|0)+40>>2]|0;if(!(lb[c[j>>2]&127](f,-1)|0))AG(e,f);h=bB(a,h,k)|0;}}return b|0}function yG(a){a=a|0;var b=0;a=c[(c[a>>2]|0)+12>>2]|0;while(1){if(!a)break;b=c[a+12>>2]|0;zG(a);a=b;}return}function zG(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function AG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;f=k;g=a+8|0;i=a+4|0;d=c[i>>2]|0;if((c[g>>2]|0)==(c[d+4>>2]|0)){d=c[d+12>>2]|0;do if(!d){e=KK(16)|0;if(!e){gA(1,98969,f)|0;bb(188068,1);}c[e+8>>2]=c[i>>2];c[e+12>>2]=0;d=KK(4e6)|0;c[e>>2]=d;if(!d){gA(1,98969,j)|0;bb(188068,1);}else {c[e+4>>2]=d+4e6;c[(c[i>>2]|0)+12>>2]=e;h=e;break}}else h=d;while(0);c[i>>2]=h;c[g>>2]=c[h>>2];}lb[c[a+16>>2]&127](b,1)|0;j=c[g>>2]|0;c[g>>2]=j+4;c[j>>2]=b;l=k;return}function BG(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+8|0;b=c[f>>2]|0;d=a+4|0;e=c[d>>2]|0;if((b|0)==(c[e>>2]|0))if((e|0)==(c[a>>2]|0))b=0;else {b=c[e+8>>2]|0;c[d>>2]=b;b=c[b+4>>2]|0;c[f>>2]=b;g=4;}else g=4;if((g|0)==4){b=b+-4|0;c[f>>2]=b;b=c[b>>2]|0;}return b|0}function CG(b){b=b|0;var c=0;a:while(1){c=b;b=b+1|0;c=a[c>>0]|0;switch(c<<24>>24){case 95:continue a;case 0:{b=1;break a}default:{}}if(!(a3(c&255)|0)){b=0;break}}return b|0}function DG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0;B=l;l=l+4272|0;x=B;y=4;A=T1(40)|0;c[A>>2]=0;u=B+4144|0;v=B+4140|0;w=B+4120|0;h=B+4104|0;i=B+8|0;o=0;f=$(24,a|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){e=V6(c[g>>2]|0,A|0,y|0)|0;if(!e)bb(g|0,p|0);z=p;}else e=-1;a:do if((e|0)!=1)if(f){o=0;k=ca(29,d|0,v|0,u|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;j=$(23,40)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;na(7,w|0,h|0,i|0,24,85);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;f=$(25,a|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){h=w+16|0;g=c[h>>2]|0;e=f;while(1){if(!e)break;o=0;aa(g|0,e|0,0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){t=h;s=j;r=k;e=z;j=14;break a}o=0;e=aa(86,a|0,e|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){t=h;s=j;r=k;e=z;j=14;break a}}A=U6(188068,1,A|0,y|0)|0;y=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){t=h;s=j;r=k;e=z;j=14;}else {t=h;s=j;r=k;e=0;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=0;r=k;e=z;j=14;}}else {d=0;e=0;}else {t=0;s=0;r=0;e=z;j=14;}while(0);b:do if((j|0)==14){c:while(1){if(e|0){o=0;ia(108,w|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}o=0;ia(105,s|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}if((r|0)==(u|0)){d=0;e=0;break b}o=0;ia(105,r|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}else {j=19;break}}o=0;f=$(25,a|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}q=r+(c[v>>2]|0)|0;h=10;k=s;e=0;j=s;n=s;while(1){if(!f)break;o=0;d=aa(c[t>>2]|0,f|0,-1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,A|0,y|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}if(!d){o=0;c[x>>2]=e;ca(30,q|0,137395,x|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;m=ca(31,a|0,r|0,1)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;da(53,m|0,137483,280,1)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;da(54,a|0,f|0,m|0,w|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}if((e|0)==(h|0)){h=e<<1;o=0;i=aa(87,j|0,e<<3|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}g=i;j=i;d=i;}else {g=k;d=n;}c[g+(e<<2)>>2]=m;e=e+1|0;k=g;i=d;}else i=n;o=0;f=aa(86,a|0,f|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}n=i;}o=0;ia(108,w|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}o=0;d=aa(87,n|0,e<<2|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,A|0,y|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}if((r|0)==(u|0))break b;o=0;ia(105,r|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,A|0,y|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;}else {j=39;break}}if((j|0)==19){d=0;e=0;break}else if((j|0)==39)break}while(0);c[b>>2]=e;U1(A|0);l=B;return d|0}function EG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=0;f=jC(a)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;if(oC(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,0)|0){mB(a,e,1)|0;d=d+1|0;}e=ZA(b,e)|0;}f=kC(a,f)|0;}return d|0}function FG(a){a=a|0;a=RC(a,98993,0)|0;if(!a)qa(98998,99001,529,99010);else return c[a+8>>2]|0;return 0}function GG(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;u=l;l=l+4320|0;s=u+24|0;r=u+8|0;q=u;t=u+4184|0;p=u+4160|0;f=u+40|0;if(tB(b)|0){YC(b,0,99019,-12,0);YC(b,1,99031,16,0);o=tG(e,f,t)|0;k=HG(b)|0;m=KK((tB(k)|0)<<2)|0;wG(p,u+4144|0,u+48|0,24,88);h=jC(k)|0;n=p+16|0;i=o+(c[f>>2]|0)|0;j=c[15712]|0;e=0;while(1){if(!h)break;if(!(lb[c[n>>2]&127](h,-1)|0)){c[q>>2]=e;m4(i,99933,q)|0;v=ND(k,o,1)|0;w=ND(b,o,1)|0;TC(w,99019,12,0)|0;a[(RC(w,99019,0)|0)+8>>0]=1;f=xG(k,h,v,p)|0;JG(v,w);g=KG(w)|0;LG(b,w);c[m+(e<<2)>>2]=w;wC(k,v)|0;if(0);e=e+1|0;}h=kC(k,h)|0;}if(0);sB(k)|0;ZC(b,0,99019);ZC(b,1,99031);yG(p);f=MK(m,e<<2)|0;if((o|0)!=(t|0))U1(o);}else {f=0;e=0;}c[d>>2]=e;l=u;return f|0}function HG(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;a[h>>0]=a[18596]|0;a[h+1>>0]=a[18597]|0;a[h+2>>0]=a[18598]|0;a[h+3>>0]=a[18599]|0;h=oB(99120,h,0)|0;OG(h,b);d=jC(b)|0;while(1){if(!d)break;if(!(c[(RC(d,99031,0)|0)+12>>2]|0)){g=tC(h,KB(d)|0,1)|0;TC(g,99031,16,1)|0;c[(c[g+16>>2]|0)+12>>2]=d;c[(RC(d,99031,0)|0)+12>>2]=g;}d=kC(b,d)|0;}e=jC(b)|0;while(1){if(!e)break;f=c[(RC(e,99031,0)|0)+12>>2]|0;d=XA(b,e)|0;while(1){if(!d)break;g=c[(RC(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,99031,0)|0)+12>>2]|0;do if((g|0)!=(f|0))if(g>>>0>f>>>0){iB(h,f,g,0,1)|0;break}else {iB(h,g,f,0,1)|0;break}while(0);d=ZA(b,d)|0;}e=kC(b,e)|0;}l=i;return h|0}function IG(b,d){b=b|0;d=d|0;var e=0;b=(c[b+16>>2]|0)+8|0;e=a[b>>0]|0;if((d|0)>=0)a[b>>0]=d;return e|0}function JG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=jC(a)|0;while(1){if(!e)break;f=c[(c[e+16>>2]|0)+12>>2]|0;a:do if((c[f>>2]&3|0)==1)oC(b,f,1)|0;else {d=jC(f)|0;while(1){if(!d)break a;oC(b,d,1)|0;d=kC(f,d)|0;}}while(0);e=kC(a,e)|0;}return}function KG(a){a=a|0;return EG(a,c[a+60>>2]|0)|0}function LG(a,b){a=a|0;b=b|0;MG(a,b,0);return}function MG(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;g=(d|0)==0;b=OD(b)|0;while(1){if(!b)break;if((a[(RC(b,99019,0)|0)+8>>0]|0)==0?(f=NG(b,c,d)|0,f|0):0){if(g)e=(Q2(KB(b)|0,108006,7)|0)==0;else e=1;MG(b,f,e&1);}b=PD(b)|0;}return}function NG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=0;g=jC(a)|0;while(1){if(!g)break;f=tC(b,KB(g)|0,0)|0;if(f){if(!e)e=ND(b,KB(a)|0,1)|0;oC(e,f,1)|0;}g=kC(a,g)|0;}if((d|0)!=0&(e|0)==0)e=ND(b,KB(a)|0,1)|0;if(e|0?(EG(e,a)|0,UA(a,e)|0,(Q2(KB(e)|0,108006,7)|0)==0):0)c[(TC(e,98993,12,0)|0)+8>>2]=a;return e|0}function OG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+16|0;g=h;d=OD(b)|0;e=c[15712]|0;while(1){if(!d)break;a:do if(!(Q2(KB(d)|0,108006,7)|0)){f=tC(a,KB(d)|0,1)|0;TC(f,99031,16,1)|0;c[(c[f+16>>2]|0)+12>>2]=d;b=jC(d)|0;while(1){if(!b)break a;if(c[(RC(b,99031,0)|0)+12>>2]|0){k=KB(b)|0;j=KB(d)|0;i=KB(c[(RC(b,99031,0)|0)+12>>2]|0)|0;c[g>>2]=k;c[g+4>>2]=j;c[g+8>>2]=i;w4(e,99123,g)|0;}c[(RC(b,99031,0)|0)+12>>2]=f;b=kC(d,b)|0;}}else OG(a,d);while(0);d=PD(d)|0;}l=h;return}function PG(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0.0;n=+h[a>>3];j=~~(n+(n>=0.0?.5:-.5));n=+h[a+8>>3];a=~~(n+(n>=0.0?.5:-.5));n=+h[b>>3];g=~~(n+(n>=0.0?.5:-.5));n=+h[b+8>>3];f=~~(n+(n>=0.0?.5:-.5));l=g-j|0;i=((l|0)>-1?l:0-l|0)<<1;l=l>>31|1;m=f-a|0;k=((m|0)>-1?m:0-m|0)<<1;m=m>>31|1;a:do if((i|0)>(k|0)){e=0-i|0;d=k-(i>>1)|0;b=j;while(1){QL(c,b,a);if((b|0)==(g|0))break a;j=(d|0)>-1;d=d+k+(j?e:0)|0;b=b+l|0;a=(j?m:0)+a|0;}}else {e=0-k|0;d=j;b=i-(k>>1)|0;while(1){QL(c,d,a);if((a|0)==(f|0))break a;k=(b|0)>-1;d=(k?l:0)+d|0;b=b+i+(k?e:0)|0;a=a+m|0;}}while(0);return}function QG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;j=n+4|0;do if((a|0)<1)d=0;else {f=e+16|0;if((c[f>>2]|0)>>>0<4){d=RG(a,b,d,e)|0;break}m=KK(a<<5)|0;d=0;while(1){if((d|0)==(a|0))break;g=c[b+(d<<2)>>2]|0;BP(g);h=m+(d<<5)|0;g=(c[g+16>>2]|0)+16|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];c[h+16>>2]=c[g+16>>2];c[h+20>>2]=c[g+20>>2];c[h+24>>2]=c[g+24>>2];c[h+28>>2]=c[g+28>>2];d=d+1|0;}if((c[f>>2]|0)==4){h=e+28|0;a:do if(c[h>>2]&2|0){f=e+24|0;c[f>>2]=JK(a<<2)|0;d=0;while(1){if((d|0)==(a|0))break a;g=QA(c[b+(d<<2)>>2]|0,99190)|0;if(g|0?(c[k>>2]=j,g=(b5(g,137395,k)|0)>0,i=c[j>>2]|0,g&(i|0)>-1):0)c[(c[f>>2]|0)+(d<<2)>>2]=i;d=d+1|0;}}while(0);d=SG(a,m,e)|0;if(c[h>>2]&2)U1(c[e+24>>2]|0);}else d=0;U1(m);}while(0);l=n;return d|0}function RG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0.0,J=0.0,K=0.0;G=l;l=l+144|0;B=G+136|0;A=G+64|0;F=G+48|0;v=G+40|0;u=G;t=G+120|0;x=G+104|0;C=G+96|0;D=c[f+20>>2]|0;c[x>>2]=0;c[x+4>>2]=0;c[x+8>>2]=0;c[x+12>>2]=0;a:do if((b|0)>=1){o=(D|0)==0;E=c[15712]|0;p=t+4|0;q=t+8|0;r=t+12|0;y=x+4|0;w=x+8|0;z=x+12|0;n=0;g=0;while(1){if((n|0)==(b|0))break;s=c[d+(n<<2)>>2]|0;BP(s);if(!o?(a[D+n>>0]|0)!=0:0){m=c[s+16>>2]|0;H=+h[m+16>>3];i=~~(H+(H>=0.0?.5:-.5));c[t>>2]=i;H=+h[m+24>>3];j=~~(H+(H>=0.0?.5:-.5));c[p>>2]=j;H=+h[m+32>>3];k=~~(H+(H>=0.0?.5:-.5));c[q>>2]=k;H=+h[m+40>>3];m=~~(H+(H>=0.0?.5:-.5));c[r>>2]=m;if(!g){c[x>>2]=c[t>>2];c[x+4>>2]=c[t+4>>2];c[x+8>>2]=c[t+8>>2];c[x+12>>2]=c[t+12>>2];}else {c[x>>2]=c[((c[x>>2]|0)>(i|0)?t:x)>>2];c[y>>2]=c[((c[y>>2]|0)>(j|0)?t:x)+4>>2];c[w>>2]=c[((c[w>>2]|0)<(k|0)?t:x)+8>>2];c[z>>2]=c[((c[z>>2]|0)<(m|0)?t:x)+12>>2];}g=g+1|0;}if(0>2);n=n+1|0;}q=KK(b<<5)|0;g=0;while(1){if((g|0)==(b|0))break;u=q+(g<<5)|0;t=(c[(c[d+(g<<2)>>2]|0)+16>>2]|0)+16|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[u+16>>2]=c[t+16>>2];c[u+20>>2]=c[t+20>>2];c[u+24>>2]=c[t+24>>2];c[u+28>>2]=c[t+28>>2];g=g+1|0;}o=f+8|0;p=VG(b,q,c[o>>2]|0)|0;if(0);if((p|0)>=1){n=(D|0)!=0;if(n){i=((c[w>>2]|0)+(c[x>>2]|0)|0)/2|0;g=((c[z>>2]|0)+(c[y>>2]|0)|0)/2|0;}else {i=0;g=0;}c[C+4>>2]=g;c[C>>2]=i;m=JK(b<<4)|0;k=f+16|0;g=0;while(1){if((g|0)>=(b|0))break;i=c[d+(g<<2)>>2]|0;j=m+(g<<4)|0;c[m+(g<<4)+12>>2]=g;if((c[k>>2]|0)==3){x=(c[i+16>>2]|0)+16|0;y=c[o>>2]|0;z=KB(i)|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];c[A+16>>2]=c[x+16>>2];c[A+20>>2]=c[x+20>>2];c[A+24>>2]=c[x+24>>2];c[A+28>>2]=c[x+28>>2];c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];WG(A,j,p,y,B,z);}else {c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];XG(e,i,j,p,f,B);}g=g+1|0;}j=JK(b<<2)|0;g=0;while(1){if((g|0)>=(b|0))break;c[j+(g<<2)>>2]=m+(g<<4);g=g+1|0;}o4(j,b,4,89);k=KL()|0;g=JK(b<<3)|0;b:do if(n){i=0;while(1){if((i|0)>=(b|0)){i=0;break}if(a[D+i>>0]|0){e=c[j+(i<<2)>>2]|0;f=g+(c[e+12>>2]<<3)|0;c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];ZG(e,k,f,B);}i=i+1|0;}while(1){if((i|0)>=(b|0))break b;if(!(a[D+i>>0]|0)){C=c[j+(i<<2)>>2]|0;_G(i,C,k,g+(c[C+12>>2]<<3)|0,p,c[o>>2]|0,q);}i=i+1|0;}}else {i=0;while(1){if((i|0)>=(b|0))break b;D=c[j+(i<<2)>>2]|0;_G(i,D,k,g+(c[D+12>>2]<<3)|0,p,c[o>>2]|0,q);i=i+1|0;}}while(0);U1(j);i=0;while(1){if((i|0)>=(b|0))break;U1(c[m+(i<<4)+4>>2]|0);i=i+1|0;}U1(m);NL(k);U1(q);if(0>1);}else g=0;}else g=0;while(0);l=G;return g|0}function SG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=l;l=l+16|0;g=z;x=JK(a<<3)|0;f=c[d+4>>2]|0;y=d+28|0;e=(f|0)>0;do if(!(c[y>>2]&1))if(e){k=1;w=(a+-1+f|0)/(f|0)|0;break}else {f=~~+N(+(+C(+(+(a|0)))));k=1;w=(a+-1+f|0)/(f|0)|0;break}else if(e){k=0;w=f;f=(a+-1+f|0)/(f|0)|0;break}else {f=~~+N(+(+C(+(+(a|0)))));k=0;w=f;f=(a+-1+f|0)/(f|0)|0;break}while(0);if(0);t=JK((f<<3)+8|0)|0;u=JK((w<<3)+8|0)|0;v=JK(a*24|0)|0;j=d+8|0;e=0;g=v;while(1){if((e|0)>=(a|0))break;p=+h[b+(e<<5)+8>>3];o=+h[b+(e<<5)+24>>3];q=+((c[j>>2]|0)>>>0);h[g>>3]=+h[b+(e<<5)+16>>3]-+h[b+(e<<5)>>3]+q;h[g+8>>3]=o-p+q;c[g+16>>2]=e;e=e+1|0;g=g+24|0;}s=JK(a<<2)|0;e=0;while(1){if((e|0)>=(a|0))break;c[s+(e<<2)>>2]=v+(e*24|0);e=e+1|0;}e=c[d+24>>2]|0;if(!e){if(!(c[y>>2]&64))o4(s,a,4,91);}else {c[47056]=e;o4(s,a,4,90);}r=(k|0)==0;e=0;g=0;j=0;while(1){if((j|0)>=(a|0)){i=0.0;e=0;break}k=c[s+(j<<2)>>2]|0;d=t+(g<<3)|0;q=+h[d>>3];p=+h[k>>3];h[d>>3]=q>p?q:p;d=u+(e<<3)|0;p=+h[d>>3];q=+h[k+8>>3];h[d>>3]=p>q?p:q;if(r){e=e+1|0;d=(e|0)==(w|0);e=d?0:e;g=g+(d&1)|0;}else {g=g+1|0;d=(g|0)==(f|0);e=e+(d&1)|0;g=d?0:g;}j=j+1|0;}while(1){if((e|0)>(f|0)){i=0.0;e=w;break}d=t+(e<<3)|0;q=+h[d>>3];h[d>>3]=i;i=q+i;e=e+1|0;}while(1){if((e|0)<=0)break;d=e+-1|0;q=+h[u+(d<<3)>>3];h[u+(e<<3)>>3]=i;i=q+i;e=d;}h[u>>3]=i;e=0;g=0;d=0;while(1){if((d|0)>=(a|0))break;k=c[(c[s+(d<<2)>>2]|0)+16>>2]|0;i=+h[b+(k<<5)>>3];m=-i;p=+h[b+(k<<5)+8>>3];q=-p;n=+h[b+(k<<5)+16>>3];o=+h[b+(k<<5)+24>>3];j=c[y>>2]|0;do if(!(j&4))if(!(j&8)){i=(m-n+ +h[t+(g<<3)>>3]+ +h[t+(g+1<<3)>>3])*.5;break}else {i=i-n+ +h[t+(g+1<<3)>>3];break}else i=+h[t+(g<<3)>>3];while(0);c[x+(k<<3)>>2]=~~i;do if(!(j&16))if(!(j&32)){i=(q-o+ +h[u+(e<<3)>>3]+ +h[u+(e+1<<3)>>3])*.5;break}else {i=+h[u+(e+1<<3)>>3];break}else i=p-o+ +h[u+(e<<3)>>3];while(0);c[x+(k<<3)+4>>2]=~~i;if(r){e=e+1|0;k=(e|0)==(w|0);e=k?0:e;g=g+(k&1)|0;}else {g=g+1|0;k=(g|0)==(f|0);e=e+(k&1)|0;g=k?0:g;}d=d+1|0;}U1(v);U1(s);U1(t);U1(u);l=z;return x|0}function TG(a,b){a=a|0;b=b|0;var d=0;d=c[47056]|0;a=c[d+(c[(c[a>>2]|0)+16>>2]<<2)>>2]|0;b=c[d+(c[(c[b>>2]|0)+16>>2]<<2)>>2]|0;return ((a|0)>(b|0)?1:((a|0)<(b|0))<<31>>31)|0}function UG(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a>>2]|0;b=c[b>>2]|0;e=+h[a>>3]+ +h[a+8>>3];d=+h[b>>3]+ +h[b+8>>3];return (ed)<<31>>31)|0}function VG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0;s=l;l=l+96|0;q=s+80|0;r=s+48|0;p=s+8|0;m=s;k=(a*100|0)+-1|0;e=+(d<<1|0);n=0.0;o=0.0;d=0;while(1){if((d|0)>=(a|0))break;j=+h[b+(d<<5)+16>>3]-+h[b+(d<<5)>>3]+e;i=+h[b+(d<<5)+24>>3]-+h[b+(d<<5)+8>>3]+e;n=n-j-i;o=o-i*j;d=d+1|0;}i=+(k|0);j=n*n-i*4.0*o;if(!(j<0.0)){e=+C(+j);g=i*2.0;f=(e-n)/g;g=(-n-e)/g;d=~~f;d=(d|0)==0?1:d;if(0>2);}else {h[m>>3]=j;gA(1,99417,m)|0;d=-1;}l=s;return d|0}function WG(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0.0;u=l;l=l+32|0;t=u+16|0;s=u;p=+h[a>>3];q=+h[a+8>>3];n=+h[a+16>>3];o=+h[a+24>>3];r=KL()|0;j=c[f>>2]|0;a=j-e|0;k=c[f+4>>2]|0;i=k-e|0;j=e-~~(p+(p>=0.0?.5:-.5))+j+~~(n+(n>=0.0?.5:-.5))|0;k=e-~~(q+(q>=0.0?.5:-.5))+k+~~(o+(o>=0.0?.5:-.5))|0;if((a|0)>-1)f=(a|0)/(d|0)|0;else f=((a+1|0)/(d|0)|0)+-1|0;if((i|0)>-1)m=(i|0)/(d|0)|0;else m=((i+1|0)/(d|0)|0)+-1|0;if((j|0)>-1)j=(j|0)/(d|0)|0;else j=((j+1|0)/(d|0)|0)+-1|0;if((k|0)>-1)i=(k|0)/(d|0)|0;else i=((k+1|0)/(d|0)|0)+-1|0;while(1){if((f|0)>(j|0))break;else a=m;while(1){if((a|0)>(i|0))break;QL(r,f,a);a=a+1|0;}f=f+1|0;}k=b+4|0;c[k>>2]=UL(r)|0;j=TL(r)|0;m=b+8|0;c[m>>2]=j;w=+(e<<1|0);v=+(d|0);i=~~+N(+((n+w-p)/v));a=~~+N(+((o+w-q)/v));c[b>>2]=a+i;a:do if(0>2);while(0);NL(r);l=u;return}function XG(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,O=0,P=0,Q=0.0,R=0.0;P=l;l=l+128|0;F=P+112|0;E=P+104|0;O=P+16|0;M=P;H=P+64|0;I=P+56|0;z=P+40|0;A=P+96|0;y=P+88|0;v=P+24|0;w=P+80|0;x=P+72|0;K=c[f+8>>2]|0;G=c[f+12>>2]|0;C=(a|0)==0?b:a;L=KL()|0;J=b+16|0;B=c[J>>2]|0;t=+h[B+16>>3];D=(c[g>>2]|0)-~~(t+(t>=0.0?.5:-.5))|0;t=+h[B+24>>3];B=(c[g+4>>2]|0)-~~(t+(t>=0.0?.5:-.5))|0;a:do if((c[f+16>>2]|0)==1){v=KK((tB(b)|0)<<2)|0;a=0;g=jC(b)|0;while(1){if(!g)break;x=g+16|0;c[v+(a<<2)>>2]=c[(c[x>>2]|0)+112>>2];c[(c[x>>2]|0)+112>>2]=0;a=a+1|0;g=kC(b,g)|0;}o=D-K|0;p=B-K|0;q=D+K|0;r=B+K|0;n=1;while(1){a=c[J>>2]|0;if((n|0)>(c[a+180>>2]|0))break;m=c[(c[a+184>>2]|0)+(n<<2)>>2]|0;i=c[m+16>>2]|0;t=+h[i+16>>3];a=~~(t+(t>=0.0?.5:-.5));t=+h[i+24>>3];g=~~(t+(t>=0.0?.5:-.5));t=+h[i+32>>3];f=~~(t+(t>=0.0?.5:-.5));t=+h[i+40>>3];i=~~(t+(t>=0.0?.5:-.5));b:do if((f|0)>(a|0)&(i|0)>(g|0)){a=o+a|0;j=p+g|0;f=q+f|0;k=r+i|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)j=(j|0)/(e|0)|0;else j=((j+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)i=(f|0)/(e|0)|0;else i=((f+1|0)/(e|0)|0)+-1|0;if((k|0)>-1)f=(k|0)/(e|0)|0;else f=((k+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=j;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}a=jC(m)|0;while(1){if(!a)break b;c[(c[a+16>>2]|0)+212>>2]=m;a=kC(m,a)|0;}}while(0);n=n+1|0;}r=z+8|0;s=H+4|0;t=+(K|0);u=I+4|0;q=A+4|0;p=y+4|0;o=jC(b)|0;while(1){if(!o)break;jP(z,o);R=+h[z>>3];Q=+h[r>>3];m=D+~~(R+(R>=0.0?.5:-.5))|0;c[H>>2]=m;n=B+~~(Q+(Q>=0.0?.5:-.5))|0;c[s>>2]=n;g=o+16|0;a=c[g>>2]|0;c:do if(!(c[a+212>>2]|0)){c[I>>2]=~~((+h[a+96>>3]+ +h[a+88>>3])*.5+t);c[u>>2]=~~(+h[a+80>>3]*.5+t);c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];aH(A,E,F);a=c[A>>2]|0;f=c[q>>2]|0;c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];bH(y,E,F);i=c[y>>2]|0;j=c[p>>2]|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)k=(f|0)/(e|0)|0;else k=((f+1|0)/(e|0)|0)+-1|0;if((i|0)>-1)i=(i|0)/(e|0)|0;else i=((i+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)f=(j|0)/(e|0)|0;else f=((j+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=k;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break c;c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);a=ZA(C,a)|0;}}else {if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break c;if((c[(c[g>>2]|0)+212>>2]|0)!=(c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)){c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);}a=ZA(C,a)|0;}}while(0);o=kC(b,o)|0;}a=0;g=jC(b)|0;while(1){if(!g)break;c[(c[g+16>>2]|0)+112>>2]=c[v+(a<<2)>>2];a=a+1|0;g=kC(b,g)|0;}U1(v);}else {r=v+8|0;s=H+4|0;t=+(K|0);u=I+4|0;q=w+4|0;p=x+4|0;o=jC(b)|0;while(1){if(!o)break a;jP(v,o);Q=+h[v>>3];R=+h[r>>3];m=D+~~(Q+(Q>=0.0?.5:-.5))|0;c[H>>2]=m;n=B+~~(R+(R>=0.0?.5:-.5))|0;c[s>>2]=n;a=c[o+16>>2]|0;c[I>>2]=~~((+h[a+96>>3]+ +h[a+88>>3])*.5+t);c[u>>2]=~~(+h[a+80>>3]*.5+t);c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];aH(w,E,F);a=c[w>>2]|0;f=c[q>>2]|0;c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];bH(x,E,F);i=c[x>>2]|0;j=c[p>>2]|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)k=(f|0)/(e|0)|0;else k=((f+1|0)/(e|0)|0)+-1|0;if((i|0)>-1)i=(i|0)/(e|0)|0;else i=((i+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)f=(j|0)/(e|0)|0;else f=((j+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=k;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break;c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);a=ZA(C,a)|0;}o=kC(b,o)|0;}}while(0);i=d+4|0;c[i>>2]=UL(L)|0;j=d+8|0;c[j>>2]=TL(L)|0;g=c[J>>2]|0;Q=+(K<<1|0);R=+(e|0);a=~~+N(+((+h[g+32>>3]+Q-+h[g+16>>3])/R));g=~~+N(+((+h[g+40>>3]+Q-+h[g+24>>3])/R));c[d>>2]=g+a;d:do if(0>2);while(0);NL(L);l=P;return}function YG(a,b){a=a|0;b=b|0;return (c[c[b>>2]>>2]|0)-(c[c[a>>2]>>2]|0)|0}function ZG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+32|0;h=j+16|0;i=j;k=c[a+4>>2]|0;g=c[a+8>>2]|0;c[d>>2]=0-(c[e>>2]|0);f=d+4|0;c[f>>2]=0-(c[e+4>>2]|0);a=0;e=k;while(1){if((a|0)>=(g|0))break;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];OL(b,h);a=a+1|0;e=e+8|0;}if(0>1);l=j;return}function _G(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;k=c[b+12>>2]|0;l=+h[i+(k<<5)>>3];m=+h[i+(k<<5)+8>>3];n=+h[i+(k<<5)+16>>3];o=+h[i+(k<<5)+24>>3];if(!((a|0)==0?(q=+(g<<1|0),p=+(f|0),($G((~~+N(+((q-l+n)/p))|0)/-2|0,(~~+N(+((q-m+o)/p))|0)/-2|0,b,d,e,f,i)|0)!=0):0))j=3;a:do if((j|0)==3?($G(0,0,b,d,e,f,i)|0)==0:0)if((~~+N(+(n-l))|0)<(~~+N(+(o-m))|0)){k=1;while(1){j=0-k|0;a=0;while(1){if((a|0)<=(j|0)){g=j;break}if($G(j,a,b,d,e,f,i)|0)break a;a=a+-1|0;}while(1){if((g|0)>=(k|0))break;if($G(g,a,b,d,e,f,i)|0)break a;g=g+1|0;}while(1){if((a|0)>=(k|0))break;if($G(g,a,b,d,e,f,i)|0)break a;a=a+1|0;}while(1){if((g|0)<=(j|0))break;if($G(g,a,b,d,e,f,i)|0)break a;g=g+-1|0;}while(1){if((a|0)<=0)break;if(!($G(g,a,b,d,e,f,i)|0))a=a+-1|0;else break a}k=k+1|0;}}else {k=1;while(1){j=0-k|0;a=0;while(1){if((a|0)>=(k|0)){g=j;break}if($G(a,j,b,d,e,f,i)|0)break a;a=a+1|0;}while(1){if((g|0)>=(k|0))break;if($G(a,g,b,d,e,f,i)|0)break a;g=g+1|0;}while(1){if((a|0)<=(j|0))break;if($G(a,g,b,d,e,f,i)|0)break a;a=a+-1|0;}while(1){if((g|0)<=(j|0))break;if($G(a,g,b,d,e,f,i)|0)break a;g=g+-1|0;}while(1){if((a|0)>=0)break;if(!($G(a,g,b,d,e,f,i)|0))a=a+1|0;else break a}k=k+1|0;}}while(0);return}function $G(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0;t=l;l=l+48|0;r=t+32|0;s=t+8|0;q=t;m=d+4|0;o=c[d+8>>2]|0;p=q+4|0;j=c[m>>2]|0;k=0;while(1){if((k|0)>=(o|0)){n=5;break}v=j;u=c[v+4>>2]|0;c[q>>2]=(c[v>>2]|0)+a;c[p>>2]=u+b;c[r>>2]=c[q>>2];c[r+4>>2]=c[q+4>>2];if(RL(e,r)|0){j=0;break}j=j+8|0;k=k+1|0;}if((n|0)==5){d=c[d+12>>2]|0;x=+h[i+(d<<5)>>3];w=+h[i+(d<<5)+8>>3];c[f>>2]=(O(g,a)|0)-~~(x+(x>=0.0?.5:-.5));d=f+4|0;c[d>>2]=(O(g,b)|0)-~~(w+(w>=0.0?.5:-.5));j=c[m>>2]|0;k=0;while(1){if((k|0)>=(o|0))break;u=j;v=c[u+4>>2]|0;c[q>>2]=(c[u>>2]|0)+a;c[p>>2]=v+b;c[r>>2]=c[q>>2];c[r+4>>2]=c[q+4>>2];OL(e,r);j=j+8|0;k=k+1|0;}if(0>1);else j=1;}l=t;return j|0}function aH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[b+4>>2]|0)-(c[d+4>>2]|0)|0;c[a>>2]=(c[b>>2]|0)-(c[d>>2]|0);c[a+4>>2]=e;return}function bH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[d+4>>2]|0)+(c[b+4>>2]|0)|0;c[a>>2]=(c[d>>2]|0)+(c[b>>2]|0);c[a+4>>2]=e;return}function cH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+112|0;x=A+96|0;w=A+80|0;r=A+48|0;s=A+32|0;y=A+16|0;z=A;n=A+64|0;h[y>>3]=+(c[b>>2]|0);t=y+8|0;h[t>>3]=+(c[b+4>>2]|0);a:do if((i|0)!=0?(u=a+16|0,m=c[(c[u>>2]|0)+8>>2]|0,(m|0)!=0):0){q=+(e|0);p=+(f|0);o=1.0/+(g|0);n=z+8|0;i=0;while(1){if((i|0)>=(c[m+4>>2]|0))break a;f=c[m>>2]|0;a=c[f+(i*48|0)>>2]|0;b=c[f+(i*48|0)+4>>2]|0;g=c[f+(i*48|0)+8>>2]|0;e=c[f+(i*48|0)+12>>2]|0;m=f+(i*48|0)+16|0;c[r>>2]=c[m>>2];c[r+4>>2]=c[m+4>>2];c[r+8>>2]=c[m+8>>2];c[r+12>>2]=c[m+12>>2];f=f+(i*48|0)+32|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];if(!g){c[y>>2]=c[a>>2];c[y+4>>2]=c[a+4>>2];c[y+8>>2]=c[a+8>>2];c[y+12>>2]=c[a+12>>2];m=a+16|0;c[z>>2]=c[m>>2];c[z+4>>2]=c[m+4>>2];c[z+8>>2]=c[m+8>>2];c[z+12>>2]=c[m+12>>2];m=2;}else {c[y>>2]=c[r>>2];c[y+4>>2]=c[r+4>>2];c[y+8>>2]=c[r+8>>2];c[y+12>>2]=c[r+12>>2];c[z>>2]=c[a>>2];c[z+4>>2]=c[a+4>>2];c[z+8>>2]=c[a+8>>2];c[z+12>>2]=c[a+12>>2];m=1;}j=+h[y>>3]+q;h[y>>3]=j;k=+h[t>>3]+p;h[t>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[y>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[t>>3]=j;j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);while(1){if((m|0)>=(b|0))break;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];g=a+(m<<4)|0;c[z>>2]=c[g>>2];c[z+4>>2]=c[g+4>>2];c[z+8>>2]=c[g+8>>2];c[z+12>>2]=c[g+12>>2];j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);m=m+1|0;}if(e|0){c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[z>>2]=c[s>>2];c[z+4>>2]=c[s+4>>2];c[z+8>>2]=c[s+8>>2];c[z+12>>2]=c[s+12>>2];j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);}i=i+1|0;m=c[(c[u>>2]|0)+8>>2]|0;}}else v=4;while(0);if((v|0)==4){jP(n,c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0);c[z>>2]=c[n>>2];c[z+4>>2]=c[n+4>>2];c[z+8>>2]=c[n+8>>2];c[z+12>>2]=c[n+12>>2];j=+h[z>>3]+ +(e|0);h[z>>3]=j;m=z+8|0;k=+h[m>>3]+ +(f|0);h[m>>3]=k;if(!(j>=0.0))j=(j+1.0)/+(g|0)+-1.0;else j=j/+(g|0);h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)/+(g|0)+-1.0;else j=k/+(g|0);h[m>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);}l=A;return}function dH(a,b,d){a=a|0;b=b|0;d=d|0;a:do if((a|0)<1)a=0;else switch(c[d+16>>2]|0){case 4:{a=SG(a,b,d)|0;break a}case 3:{a=eH(a,b,d)|0;break a}default:{a=0;break a}}while(0);return a|0}function eH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+80|0;g=n+64|0;f=n+24|0;m=n+8|0;e=n;h=n+56|0;j=d+8|0;k=VG(a,b,c[j>>2]|0)|0;if(0);a:do if((k|0)>=1){c[h+4>>2]=0;c[h>>2]=0;i=JK(a<<4)|0;d=0;while(1){if((d|0)>=(a|0))break;c[i+(d<<4)+12>>2]=d;o=b+(d<<5)|0;e=c[j>>2]|0;c[f>>2]=c[o>>2];c[f+4>>2]=c[o+4>>2];c[f+8>>2]=c[o+8>>2];c[f+12>>2]=c[o+12>>2];c[f+16>>2]=c[o+16>>2];c[f+20>>2]=c[o+20>>2];c[f+24>>2]=c[o+24>>2];c[f+28>>2]=c[o+28>>2];c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];WG(f,i+(d<<4)|0,k,e,g,195059);d=d+1|0;}f=JK(a<<2)|0;d=0;while(1){if((d|0)>=(a|0))break;c[f+(d<<2)>>2]=i+(d<<4);d=d+1|0;}o4(f,a,4,89);g=KL()|0;d=JK(a<<3)|0;e=0;while(1){if((e|0)>=(a|0))break;o=c[f+(e<<2)>>2]|0;_G(e,o,g,d+(c[o+12>>2]<<3)|0,k,c[j>>2]|0,b);e=e+1|0;}U1(f);e=0;while(1){if((e|0)>=(a|0))break;U1(c[i+(e<<4)+4>>2]|0);e=e+1|0;}U1(i);NL(g);if(0>1);}else d=0;while(0);l=n;return d|0}function fH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0;a:do if((a|0)<1)f=0-a|0;else {s=(e|0)==0;q=(f|0)==0;j=0;while(1){if((j|0)==(a|0)){f=0;break a}r=c[b+(j<<2)>>2]|0;g=s?r:e;k=c[d+(j<<3)>>2]|0;l=c[d+(j<<3)+4>>2]|0;m=+(k|0);n=m*.013888888888888888;o=+(l|0);p=o*.013888888888888888;i=jC(r)|0;while(1){if(!i)break;f=c[i+16>>2]|0;t=c[f+132>>2]|0;h[t>>3]=+h[t>>3]+n;t=t+8|0;h[t>>3]=+h[t>>3]+p;t=f+16|0;h[t>>3]=+h[t>>3]+m;t=f+24|0;h[t>>3]=+h[t>>3]+o;f=c[f+108>>2]|0;if(f|0){t=f+56|0;h[t>>3]=+h[t>>3]+m;t=f+64|0;h[t>>3]=+h[t>>3]+o;}b:do if(!q){f=XA(g,i)|0;while(1){if(!f)break b;gH(f,k,l);f=ZA(g,f)|0;}}while(0);i=kC(r,i)|0;}hH(r,k,l);j=j+1|0;}}while(0);return f|0}function gH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0,l=0.0,m=0,n=0;e=c[a+16>>2]|0;a=c[e+96>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+108>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+100>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+104>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}m=c[e+8>>2]|0;a:do if(m|0){l=+(b|0);j=+(d|0);b=c[m+4>>2]|0;a=0;while(1){if((a|0)>=(b|0))break a;k=c[m>>2]|0;d=c[k+(a*48|0)>>2]|0;f=c[k+(a*48|0)+4>>2]|0;g=c[k+(a*48|0)+8>>2]|0;i=c[k+(a*48|0)+12>>2]|0;e=0;while(1){if((e|0)>=(f|0))break;n=d+(e<<4)|0;h[n>>3]=+h[n>>3]+l;n=d+(e<<4)+8|0;h[n>>3]=+h[n>>3]+j;e=e+1|0;}if(g|0){n=k+(a*48|0)+16|0;h[n>>3]=+h[n>>3]+l;n=k+(a*48|0)+24|0;h[n>>3]=+h[n>>3]+j;}if(i|0){n=k+(a*48|0)+32|0;h[n>>3]=+h[n>>3]+l;n=k+(a*48|0)+40|0;h[n>>3]=+h[n>>3]+j;}a=a+1|0;}}while(0);return}function hH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0;j=b+16|0;b=c[j>>2]|0;o=b+16|0;m=b+24|0;f=b+32|0;b=b+40|0;g=+(d|0);l=+h[f>>3]+g;i=+(e|0);n=+h[m>>3]+i;k=+h[b>>3]+i;h[o>>3]=+h[o>>3]+g;h[m>>3]=n;h[f>>3]=l;h[b>>3]=k;b=c[j>>2]|0;f=c[b+12>>2]|0;if((f|0)!=0?(a[f+81>>0]|0)!=0:0){o=f+56|0;h[o>>3]=+h[o>>3]+g;f=f+64|0;h[f>>3]=+h[f>>3]+i;f=1;}else f=1;while(1){if((f|0)>(c[b+180>>2]|0))break;hH(c[(c[b+184>>2]|0)+(f<<2)>>2]|0,d,e);f=f+1|0;b=c[j>>2]|0;}return}function iH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=QG(a,b,d,e)|0;if(!f)a=1;else {a=fH(a,b,f,d,c[e+12>>2]|0)|0;U1(f);}return a|0}function jH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+32|0;o=p;n=iH(a,b,d,e)|0;if(!n){BP(d);m=(c[d+16>>2]|0)+16|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];c[o+16>>2]=c[m+16>>2];c[o+20>>2]=c[m+20>>2];c[o+24>>2]=c[m+24>>2];c[o+28>>2]=c[m+28>>2];f=o+8|0;g=o+16|0;i=o+24|0;e=0;while(1){if((e|0)>=(a|0))break;k=c[(c[b+(e<<2)>>2]|0)+16>>2]|0;j=c[k+180>>2]|0;k=k+184|0;d=1;while(1){if((d|0)>(j|0))break;r=(c[(c[(c[k>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+16|0;h[o>>3]=+h[(+h[o>>3]<+h[r>>3]?o:r)>>3];r=c[(c[(c[k>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;q=r+16|0;h[f>>3]=+h[(+h[f>>3]<+h[r+24>>3]?o:q)+8>>3];h[g>>3]=+h[(+h[g>>3]>+h[r+32>>3]?o:q)+16>>3];h[i>>3]=+h[(+h[i>>3]>+h[r+40>>3]?o:q)+24>>3];d=d+1|0;}e=e+1|0;}c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[m+16>>2]=c[o+16>>2];c[m+20>>2]=c[o+20>>2];c[m+24>>2]=c[o+24>>2];c[m+28>>2]=c[o+28>>2];}l=p;return n|0}function kH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=l;l=l+16|0;f=g;if(!e)qa(99534,99540,1400,99547);d=lH(a,d,d)|0;c[e+8>>2]=d;if(0);c[e+12>>2]=0;c[e+20>>2]=0;mH(a,b,e)|0;l=g;return c[e+16>>2]|0}function lH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;f=i+4|0;g=QA(b,99689)|0;a:do if(g){c[h>>2]=f;h=(b5(g,137395,h)|0)==1;b=c[f>>2]|0;if(h&(b|0)>-1)d=b;else {switch(a[g>>0]|0){case 84:case 116:break;default:break a}d=e;}}while(0);l=i;return d|0}function mH(a,b,c){a=a|0;b=b|0;c=c|0;return nH(QA(a,99572)|0,b,c)|0}function nH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+64|0;r=u+40|0;q=u+32|0;t=u+24|0;s=u+16|0;m=u+8|0;k=u;i=u+48|0;j=u+44|0;if(!e)qa(99534,99540,1292,99581);o=e+28|0;c[o>>2]=0;p=e+16|0;c[p>>2]=d;n=e+4|0;c[n>>2]=0;c[e+24>>2]=0;a:do if(b|0?(f=a[b>>0]|0,f<<24>>24):0)switch(f<<24>>24|0){case 97:if(!(Q2(b,99599,5)|0)){c[p>>2]=4;m=oH(b+5|0,e)|0;c[k>>2]=j;m=(b5(m,137395,k)|0)>0;d=c[j>>2]|0;if(!(m&(d|0)>0))break a;c[n>>2]=d;break a}else {if(Q2(b,99605,6)|0)break a;c[p>>2]=5;c[m>>2]=i;m=(b5(b+5|0,99612,m)|0)>0;v=+g[i>>2];g[e>>2]=m&v>0.0?v:1.0;break a}case 99:{if(f<<24>>24!=99)break a;if(s2(b,108006)|0)break a;c[p>>2]=1;break a}case 103:{if(f<<24>>24!=103)break a;if(s2(b,111494)|0)break a;c[p>>2]=3;break a}case 110:{if(f<<24>>24!=110)break a;if(s2(b,111481)|0)break a;c[p>>2]=2;break a}default:break a}while(0);if(0);l=u;return c[p>>2]|0}function oH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;a:do if((a[b>>0]|0)==95){f=d+28|0;e=1;while(1){b=b+1|0;b:while(1){if(!e)break a;d=a[b>>0]|0;if(!(d<<24>>24))break a;switch(d<<24>>24|0){case 99:{g=10;break b}case 105:{g=9;break b}case 117:{g=11;break b}case 116:{g=12;break b}case 98:{d=32;break b}case 108:{g=7;break b}case 114:{g=8;break b}default:e=0;}}if((g|0)==7){g=0;d=4;}else if((g|0)==8){g=0;d=8;}else if((g|0)==9){g=0;d=64;}else if((g|0)==10){g=0;d=1;}else if((g|0)==11){g=0;d=2;}else if((g|0)==12){g=0;d=16;}c[f>>2]=c[f>>2]|d;}}while(0);return b|0}function pH(a){a=a|0;switch(a|0){case 1:{a=108006;break}case 2:{a=111481;break}case 3:{a=111494;break}case 4:{a=99599;break}case 5:{a=99605;break}default:a=99679;}return a|0}function qH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+96|0;k=n;m=n+80|0;do if(a){if(!e){e=V1(1,20)|0;c[e+4>>2]=d>>>0>80?d:80;}d=c[e>>2]|0;j=c[e+4>>2]|0;if(!d){h=100;d=a;i=V1(100,j)|0;}else {h=d+100|0;i=W1(c[e+8>>2]|0,O(h,j)|0)|0;Y6(i+(O(j,d)|0)|0,0,j*100|0)|0;d=a;}while(1){d=rH(k,d,b,m)|0;if(!d)break;a=c[e>>2]|0;f=h<<1;g=O(h,j)|0;if((a|0)==(h|0)){i=W1(i,O(f,j)|0)|0;Y6(i+g|0,0,g|0)|0;a=c[e>>2]|0;}else f=h;a=i+(O(a,j)|0)|0;g=k;h=a+80|0;do{c[a>>2]=c[g>>2];a=a+4|0;g=g+4|0;}while((a|0)<(h|0));c[e>>2]=(c[e>>2]|0)+1;h=f;}if(c[m>>2]|0){m=e+16|0;c[m>>2]=c[m>>2]|1;}d=c[e>>2]|0;if(!d){U1(i);U1(e);e=0;break}else {c[e+8>>2]=W1(i,O(d,j)|0)|0;break}}while(0);l=n;return e|0}function rH(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+80|0;h=j+64|0;i=j;c[f>>2]=0;do{g=a[d>>0]|0;d=d+1|0;}while((S2(g)|0)!=0);a:do switch(g|0){case 69:{c[b>>2]=0;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e>>2];break}case 101:{c[b>>2]=1;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e>>2];break}case 80:{c[b>>2]=2;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+4>>2];break}case 112:{c[b>>2]=3;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+4>>2];break}case 98:{c[b>>2]=4;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+8>>2];break}case 66:{c[b>>2]=5;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+8>>2];break}case 99:{d=uH(d,h)|0;if(!d){c[f>>2]=1;d=0;break a}g=vH(c[h>>2]|0,i)|0;c[h>>2]=g;if(!g){c[f>>2]=1;d=0;break a}if(!(c[i>>2]|0)){c[b>>2]=9;c[b+8>>2]=c[i+8>>2];if(!e)break a;c[b+72>>2]=c[e+24>>2];break a}else {c[b>>2]=14;f=b+8|0;g=i;h=f+64|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));if(!e)break a;c[b+72>>2]=c[e+40>>2];break a}}case 67:{d=uH(d,h)|0;if(!d){c[f>>2]=1;d=0;break a}g=vH(c[h>>2]|0,i)|0;c[h>>2]=g;if(!g){c[f>>2]=1;d=0;break a}if(!(c[i>>2]|0)){c[b>>2]=8;c[b+8>>2]=c[i+8>>2];if(!e)break a;c[b+72>>2]=c[e+20>>2];break a}else {c[b>>2]=13;f=b+8|0;g=i;h=f+64|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));if(!e)break a;c[b+72>>2]=c[e+40>>2];break a}}case 76:{c[b>>2]=6;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+12>>2];break}case 84:{c[b>>2]=7;d=wH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=wH(d,b+16|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=xH(d,b+24|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=wH(d,b+32|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+40|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+16>>2];break}case 70:{c[b>>2]=10;d=wH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+16|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+28>>2];break}case 83:{c[b>>2]=11;d=uH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+32>>2];break}case 73:{c[b>>2]=12;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+40|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+36>>2];break}case 116:{c[b>>2]=15;d=yH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+44>>2];break}case 0:{d=0;break}default:{c[f>>2]=1;d=0;}}while(0);l=j;return d|0}function sH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0;i=l;l=l+16|0;e=i;h[b>>3]=+s5(a,e);f=c[e>>2]|0;if(((f|0)!=(a|0)?(h[b+8>>3]=+s5(f,e),g=c[e>>2]|0,(f|0)!=(g|0)):0)?(h[b+16>>3]=+s5(g,e),d=c[e>>2]|0,(g|0)!=(d|0)):0){h[b+24>>3]=+s5(d,e);a=c[e>>2]|0;a=(d|0)==(a|0)?0:a;}else a=0;l=i;return a|0}function tH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+4|0;g=k;a=zH(a,j)|0;do if(a){d=c[j>>2]|0;i=V1(d,24)|0;c[b>>2]=d;e=i;f=0;while(1){if((f|0)>=(d|0)){d=9;break}h[e>>3]=+s5(a,g);d=c[g>>2]|0;if((a|0)==(d|0)){d=5;break}h[e+8>>3]=+s5(d,g);a=c[g>>2]|0;if((d|0)==(a|0)){d=7;break}h[e+16>>3]=0.0;e=e+24|0;d=c[b>>2]|0;f=f+1|0;}if((d|0)==5){c[j>>2]=f;U1(i);a=0;break}else if((d|0)==7){c[j>>2]=f;U1(i);a=0;break}else if((d|0)==9){c[j>>2]=f;c[b+4>>2]=i;break}}else a=0;while(0);l=k;return a|0}function uH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;b=zH(b,i)|0;f=c[i>>2]|0;do if(!((b|0)==0|(f|0)<1)){while(1){h=a[b>>0]|0;e=h<<24>>24==0;if(e^h<<24>>24!=45)b=b+1|0;else break}if(!e){h=V1(f+1|0,1)|0;g=h;e=f;while(1){b=b+1|0;if((e|0)<=0){e=9;break}e=a[b>>0]|0;if(!(e<<24>>24)){e=8;break}a[g>>0]=e;e=(c[i>>2]|0)+-1|0;c[i>>2]=e;g=g+1|0;}if((e|0)==8){U1(h);b=0;break}else if((e|0)==9){a[g>>0]=0;c[d>>2]=h;break}}else b=0;}else b=0;while(0);l=j;return b|0}function vH(b,d){b=b|0;d=d|0;var e=0;e=a[b>>0]|0;switch(e|0){case 91:{b=AH(b+1|0,d)|0;break}case 40:{b=BH(b+1|0,d)|0;break}case 47:case 35:{c[d>>2]=0;c[d+8>>2]=b;break}default:if(!(a3(e)|0))b=0;else {c[d>>2]=0;c[d+8>>2]=b;}}return b|0}function wH(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0;f=l;l=l+16|0;d=f;e=+s5(a,d);d=c[d>>2]|0;if((d|0)==(a|0))d=0;else h[b>>3]=e;l=f;return d|0}function xH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;a=zH(a,e)|0;e=c[e>>2]|0;c[b>>2]=(e|0)<0?0:e|0?2:1;l=d;return a|0}function yH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[b>>2]=T2(a,e,10)|0;b=c[e>>2]|0;l=d;return ((b|0)==(a|0)?0:b)|0}function zH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[b>>2]=y4(a,e,10)|0;b=c[e>>2]|0;l=d;return ((b|0)==(a|0)?0:b)|0}function AH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;m=o;c[b>>2]=1;n=b+8|0;i=wH(a,n)|0;do if(((((i|0)!=0?(j=wH(i,b+16|0)|0,(j|0)!=0):0)?(e=wH(j,b+24|0)|0,(e|0)!=0):0)?(f=wH(e,b+32|0)|0,(f|0)!=0):0)?(k=b+40|0,d=zH(f,k)|0,(d|0)!=0):0){b=c[k>>2]|0;f=V1(b,8)|0;e=0;while(1){if((e|0)>=(b|0)){d=13;break}d=wH(d,m)|0;if(!d){d=9;break}g[f+(e<<3)>>2]=+h[m>>3];d=uH(d,f+(e<<3)+4|0)|0;if(!d){d=12;break}e=e+1|0;b=c[k>>2]|0;}if((d|0)==9){U1(f);a=0;break}else if((d|0)==12){U1(f);a=0;break}else if((d|0)==13){c[n+36>>2]=f;break}}else a=0;while(0);l=o;return a|0}function BH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;c[b>>2]=2;k=wH(a,b+8|0)|0;do if(((((((k|0)!=0?(m=wH(k,b+16|0)|0,(m|0)!=0):0)?(e=wH(m,b+24|0)|0,(e|0)!=0):0)?(f=wH(e,b+32|0)|0,(f|0)!=0):0)?(i=wH(f,b+40|0)|0,(i|0)!=0):0)?(j=wH(i,b+48|0)|0,(j|0)!=0):0)?(o=b+56|0,d=zH(j,o)|0,(d|0)!=0):0){e=c[o>>2]|0;i=V1(e,8)|0;f=0;while(1){if((f|0)>=(e|0)){d=15;break}d=wH(d,n)|0;if(!d){d=11;break}g[i+(f<<3)>>2]=+h[n>>3];d=uH(d,i+(f<<3)+4|0)|0;if(!d){d=14;break}f=f+1|0;e=c[o>>2]|0;}if((d|0)==11){U1(i);a=0;break}else if((d|0)==14){U1(i);a=0;break}else if((d|0)==15){c[b+60>>2]=i;break}}else a=0;while(0);l=p;return a|0}function CH(a,b,c){a=a|0;b=b|0;c=c|0;return qH(a,b,c,0)|0}function DH(a){a=a|0;return CH(a,0,0)|0}function EH(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=c[a+12>>2]|0;if(a|0){f=c[a+8>>2]|0;g=a+4|0;h=(e|0)==0;b=0;while(1){if((b|0)>=(c[a>>2]|0))break;d=f+(O(c[g>>2]|0,b)|0)|0;if(!h)tb[e&127](d);FH(d);b=b+1|0;}U1(f);U1(a);}return}function FH(a){a=a|0;switch(c[a>>2]|0){case 3:case 2:{U1(c[a+8+4>>2]|0);break}case 5:case 4:{U1(c[a+8+4>>2]|0);break}case 6:{U1(c[a+8+4>>2]|0);break}case 7:{U1(c[a+40>>2]|0);break}case 9:case 8:{U1(c[a+8>>2]|0);break}case 14:case 13:{GH(a+8|0);break}case 10:{U1(c[a+16>>2]|0);break}case 11:{U1(c[a+8>>2]|0);break}case 12:{U1(c[a+40>>2]|0);break}default:{}}return}function GH(a){a=a|0;var b=0,d=0,e=0;switch(c[a>>2]|0){case 1:{e=a+40|0;b=a+8+36|0;a=0;while(1){d=c[b>>2]|0;if((a|0)>=(c[e>>2]|0))break;U1(c[d+(a<<3)+4>>2]|0);a=a+1|0;}U1(d);break}case 2:{e=a+56|0;d=a+60|0;a=0;while(1){b=c[d>>2]|0;if((a|0)>=(c[e>>2]|0))break;U1(c[b+(a<<3)+4>>2]|0);a=a+1|0;}U1(b);break}default:{}}return}function HH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;k=o+4|0;n=o;c[d>>2]=0;c[e>>2]=(xB(xC(b)|0)|0)!=0&1;f=c[47184]|0;a:do if(f|0?(h=RA(b,f)|0,i=a[h>>0]|0,i<<24>>24):0){f=20388;while(1){g=c[f>>2]|0;if(!g)break a;if(i<<24>>24==(a[g>>0]|0)?(s2(h,g)|0)==0:0)break;f=f+12|0;}c[d>>2]=c[f+4>>2];c[e>>2]=c[f+8>>2];}while(0);f=c[47195]|0;if((f|0?(c[e>>2]|0)==1:0)?(j=RA(b,f)|0,a[j>>0]|0):0)IH(j,e);f=c[47196]|0;if((f|0?(c[d>>2]|0)==1:0)?(m=RA(b,f)|0,a[m>>0]|0):0)IH(m,d);if(a[(c[b+16>>2]|0)+153>>0]|0){j=b+-48|0;i=xC(c[((c[b>>2]&3|0)==2?b:j)+40>>2]|0)|0;m=c[b>>2]&3;HH(iB(i,c[((m|0)==2?b:j)+40>>2]|0,c[((m|0)==3?b:b+48|0)+40>>2]|0,0,0)|0,k,n);c[e>>2]=c[k>>2]|c[e>>2];c[d>>2]=c[n>>2]|c[d>>2];}l=o;return}function IH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;m=o;k=o+4|0;j=0;e=0;a:while(1){c[d>>2]=e;g=(j|0)<4;h=(j|0)==3;i=(j|0)==0;while(1){if(!(g&(a[b>>0]|0)!=0))break a;c[k>>2]=0;f=JH(b,k)|0;e=c[k>>2]|0;if(!e){n=5;break a}b=(e|0)==8;if(!(h&b)){if(!(i&b))break;if(a[f>>0]|0)break}c[k>>2]=0;b=f;}e=c[d>>2]|e<<(j<<3);j=j+1|0;b=f;}if((n|0)==5){c[m>>2]=b;gA(0,99694,m)|0;}l=o;return}function JH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;c[e>>2]=0;d=KH(a,20448,e)|0;if((d|0)==(a|0)){while(1){d=KH(a,20464,e)|0;if((a|0)==(d|0))break;else a=d;}d=KH(a,20512,e)|0;}a=c[e>>2]|0;if((a|0)!=0&(a&15|0)==0){a=a|1;c[e>>2]=a;}c[b>>2]=c[b>>2]|a;l=f;return d|0}function KH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;while(1){e=c[b>>2]|0;if(!e)break;f=l2(e)|0;if(!(Q2(a,e,f)|0)){g=4;break}b=b+8|0;}if((g|0)==4){c[d>>2]=c[d>>2]|c[b+4>>2];a=a+f|0;}return a|0}function LH(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0;g=0;d=0.0;while(1){if((g|0)==4)break;f=b>>(g<<3)&15;e=1400;while(1){if(!(c[e+16>>2]|0))break;if((f|0)==(c[e>>2]|0)){i=6;break}e=e+24|0;}if((i|0)==6){i=0;d=+h[e+8>>3]+d;}g=g+1|0;}return +(d*10.0*+_O(a,c[47188]|0,1.0,0.0))}function MH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0,n=0.0,o=0,p=0;p=l;l=l+96|0;m=p+80|0;o=p;k=f>4.0?f*.0875:.35;i=+h[d+8>>3];n=i*k;j=+h[d>>3];k=j*k;e=+h[b>>3];j=e+j;h[m>>3]=j;f=+h[b+8>>3];i=i+f;h[m+8>>3]=i;d=o+64|0;if(!(g&32)){c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];m=o+32|0;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];f=i;e=j;}else {c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];b=o+32|0;c[b>>2]=c[m>>2];c[b+4>>2]=c[m+4>>2];c[b+8>>2]=c[m+8>>2];c[b+12>>2]=c[m+12>>2];}h[o+16>>3]=e+n;h[o+24>>3]=f-k;h[o+48>>3]=e-n;h[o+56>>3]=f+k;do if(!(g&64))if(!(g&128)){nS(a,o+16|0,3,g>>>4&1^1);break}else {nS(a,o+32|0,3,g>>>4&1^1);break}else nS(a,o,3,g>>>4&1^1);while(0);l=p;return}function NH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0;x=l;l=l+160|0;n=x+144|0;w=x;q=e*4.0;y=(g&32|0)==0;q=!(q1.0)|y?0.0:(f+-1.0)*.05/e;u=+h[d+8>>3];r=-u;v=q*r;t=+h[d>>3];q=t*q;r=s*r;s=t*s;p=+h[b>>3];e=p+t;h[n>>3]=e;o=+h[b+8>>3];f=u+o;h[n+8>>3]=f;t=t*.5+p;u=u*.5+o;d=w+128|0;if(y){c[d>>2]=c[n>>2];c[d+4>>2]=c[n+4>>2];c[d+8>>2]=c[n+8>>2];c[d+12>>2]=c[n+12>>2];c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];y=w+64|0;c[y>>2]=c[b>>2];c[y+4>>2]=c[b+4>>2];c[y+8>>2]=c[b+8>>2];c[y+12>>2]=c[b+12>>2];i=o;j=p;k=o;m=p;f=o;e=p;}else {c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[w>>2]=c[b>>2];c[w+4>>2]=c[b+4>>2];c[w+8>>2]=c[b+8>>2];c[w+12>>2]=c[b+12>>2];y=w+64|0;c[y>>2]=c[n>>2];c[y+4>>2]=c[n+4>>2];c[y+8>>2]=c[n+8>>2];c[y+12>>2]=c[n+12>>2];i=f+s;j=e+r;k=f-s;m=e-r;}h[w+16>>3]=e-v;h[w+24>>3]=f-q;h[w+32>>3]=t-r;h[w+40>>3]=u-s;h[w+48>>3]=m;h[w+56>>3]=k;h[w+80>>3]=j;h[w+88>>3]=i;h[w+96>>3]=t+r;h[w+104>>3]=u+s;h[w+112>>3]=e+v;h[w+120>>3]=f+q;do if(!(g&64))if(!(g&128)){nS(a,w,9,1);break}else {nS(a,w+48|0,6,1);break}else nS(a,w,6,1);while(0);l=x;return}function OH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0;q=l;l=l+64|0;p=q;t=+h[d+8>>3];s=+h[d>>3];k=+h[b>>3];e=k+s;m=+h[b+8>>3];f=m+t;i=k+s*.2;j=m+t*.2;k=k+s*.6;m=m+t*.6;h[p>>3]=i-t;h[p+8>>3]=j+s;n=p+16|0;h[n>>3]=i+t;o=p+24|0;h[o>>3]=j-s;h[p+32>>3]=k+t;h[p+40>>3]=m-s;h[p+48>>3]=k-t;h[p+56>>3]=m+s;if(!(g&64)){if(g&128|0){d=2;g=1;r=3;}}else {d=3;g=0;r=3;}if((r|0)==3){h[p+(g<<4)>>3]=i;h[p+(g<<4)+8>>3]=j;h[p+(d<<4)>>3]=k;h[p+(d<<4)+8>>3]=m;}nS(a,p,4,1);c[p>>2]=c[b>>2];c[p+4>>2]=c[b+4>>2];c[p+8>>2]=c[b+8>>2];c[p+12>>2]=c[b+12>>2];h[n>>3]=e;h[o>>3]=f;qS(a,p,2);l=q;return}function PH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0;o=l;l=l+64|0;n=o;j=+h[d+8>>3];r=j*-.4;i=+h[d>>3];q=i*.4;t=+h[b>>3];e=t+i*.8;s=+h[b+8>>3];f=s+j*.8;i=t+i;j=s+j;h[n>>3]=t+r;k=n+8|0;h[k>>3]=s+q;d=n+16|0;h[d>>3]=t-r;m=n+24|0;h[m>>3]=s-q;h[n+32>>3]=e-r;h[n+40>>3]=f-q;h[n+48>>3]=e+r;h[n+56>>3]=f+q;if(!(g&64)){if(g&128|0){c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];d=2;p=5;}}else {c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];d=3;p=5;}if((p|0)==5){h[n+(d<<4)>>3]=e;h[n+(d<<4)+8>>3]=f;}nS(a,n,4,g>>>4&1^1);h[n>>3]=e;h[k>>3]=f;h[n+16>>3]=i;h[m>>3]=j;qS(a,n,2);l=o;return}function QH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;j=l;l=l+80|0;i=j;n=+h[d+8>>3];k=n*-.3333333333333333;p=+h[d>>3];f=p*.3333333333333333;q=+h[b>>3];m=q+p*.5;o=+h[b+8>>3];e=o+n*.5;d=i+64|0;h[i+64>>3]=q+p;h[i+72>>3]=o+n;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];h[i+16>>3]=m+k;h[i+24>>3]=e+f;d=i+32|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];h[i+48>>3]=m-k;h[i+56>>3]=e-f;do if(!(g&64)){d=g>>>4&1^1;if(!(g&128)){nS(a,i,4,d);break}else {nS(a,i,3,d);break}}else nS(a,d,3,g>>>4&1^1);while(0);l=j;return}function RH(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=+e;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0.0;g=l;l=l+32|0;i=g;k=+h[c>>3];e=+h[c+8>>3];d=+C(+(e*e+k*k))*.5;m=+h[b>>3];k=k*.5;h[i>>3]=m+k-d;j=+h[b+8>>3];e=e*.5;h[i+8>>3]=j-d+e;h[i+16>>3]=m+d+k;h[i+24>>3]=j+d+e;mS(a,i,2,f>>>4&1^1);l=g;return}function SH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0;t=l;l=l+112|0;q=t+48|0;r=t+16|0;s=t;n=f>4.0?f*.125:.5;p=+h[b>>3];o=+h[d>>3];i=+h[b+8>>3];m=+h[d+8>>3];e=m*n;f=o*n;c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];h[r+16>>3]=o+p;h[r+24>>3]=m+i;h[q>>3]=n*(o-m)+p;j=n*(m+o);k=j+i;h[q+8>>3]=k;h[q+48>>3]=j+p;i=n*(m-o)+i;h[q+56>>3]=i;o=e*-.95;m=o+f+p;n=f*1.3333333333333333;if(!(g&32)){e=e*1.3333333333333333;j=f*-.33333333333333326;i=i-e;f=k-e;e=m-n;}else {e=e*1.3333333333333333;j=f*2.333333333333333;i=i+e;f=k+e;e=m+n;}h[q+16>>3]=e;h[q+24>>3]=f;h[q+32>>3]=j-o+p;h[q+40>>3]=i;qS(a,r,2);if(!(g&64)){if(g&128|0)kP(s,q,3,.5,q,0);}else kP(s,q,3,.5,0,q);pS(a,q,4,0,0,0);l=t;return}function TH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0;g=l;l=l+32|0;i=g;e=+h[d>>3]+ +h[b>>3];f=+h[d+8>>3]+ +h[b+8>>3];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];h[i+16>>3]=e;h[i+24>>3]=f;qS(a,i,2);l=g;return}function UH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;n=l;l=l+80|0;j=n+72|0;k=n+8|0;m=n;i=+LH(a,g);i=i*i;h[m>>3]=i;c[f+12>>2]=g;g=f+32|0;a=e+3|0;f=b+(a<<4)|0;c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];if((e|0)>(d|0)?(o=+h[b+(e<<4)>>3]-+h[f>>3],p=+h[b+(e<<4)+8>>3]-+h[b+(a<<4)+8>>3],p*p+o*o>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];q=k+32|0;a=b+(e+1<<4)|0;c[q>>2]=c[a>>2];c[q+4>>2]=c[a+4>>2];c[q+8>>2]=c[a+8>>2];c[q+12>>2]=c[a+12>>2];f=k+16|0;d=b+(e+2<<4)|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];c[k>>2]=c[g>>2];c[k+4>>2]=c[g+4>>2];c[k+8>>2]=c[g+8>>2];c[k+12>>2]=c[g+12>>2];c[j>>2]=k;c[j+4>>2]=m;$N(j,92,k,1);c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];c[a>>2]=c[q>>2];c[a+4>>2]=c[q+4>>2];c[a+8>>2]=c[q+8>>2];c[a+12>>2]=c[q+12>>2];c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];m=b+(e+3<<4)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];l=n;return e|0}function VH(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[a>>2]|0;d=+h[b>>3]-+h[f>>3];e=+h[b+8>>3]-+h[f+8>>3];return e*e+d*d<=+h[c[a+4>>2]>>3]|0}function WH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0;o=l;l=l+80|0;k=o+72|0;m=o+8|0;n=o;j=+LH(a,g);j=j*j;h[n>>3]=j;c[f+8>>2]=g;f=f+16|0;a=b+(d<<4)|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];if(!((e|0)>(d|0)?(i=d+3|0,p=+h[a>>3]-+h[b+(i<<4)>>3],q=+h[b+(d<<4)+8>>3]-+h[b+(i<<4)+8>>3],q*q+p*p>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];g=m+16|0;d=b+(i+2<<4)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];r=m+32|0;a=b+(i+1<<4)|0;c[r>>2]=c[a>>2];c[r+4>>2]=c[a+4>>2];c[r+8>>2]=c[a+8>>2];c[r+12>>2]=c[a+12>>2];s=m+48|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];c[k>>2]=s;c[k+4>>2]=n;$N(k,92,m,0);n=b+(i<<4)|0;c[n>>2]=c[s>>2];c[n+4>>2]=c[s+4>>2];c[n+8>>2]=c[s+8>>2];c[n+12>>2]=c[s+12>>2];c[a>>2]=c[r>>2];c[a+4>>2]=c[r+4>>2];c[a+8>>2]=c[r+8>>2];c[a+12>>2]=c[r+12>>2];c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[e>>2]=c[m>>2];c[e+4>>2]=c[m+4>>2];c[e+8>>2]=c[m+8>>2];c[e+12>>2]=c[m+12>>2];l=o;return i|0}function XH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0,v=0,w=0;u=(g|0)!=0;l=(i|0)!=0;if(!((e|0)==(d|0)&(u&l))){if(l){j=+LH(a,i);k=+h[b+(e<<4)>>3];p=+h[b+(e<<4)+8>>3];l=e+3|0;r=b+(l<<4)|0;n=+h[r>>3];l=b+(l<<4)+8|0;o=+h[l>>3];t=k-n;s=p-o;t=+C(+(s*s+t*t))*.9;j=j>=t?t:j;if(p==o){m=(k>3]=k;h[b+(w<<4)+8>>3]=p;e=b+(e+2<<4)|0;h[r>>3]=m;h[l>>3]=j;c[e>>2]=c[r>>2];c[e+4>>2]=c[r+4>>2];c[e+8>>2]=c[r+8>>2];c[e+12>>2]=c[r+12>>2];c[f+12>>2]=i;h[f+32>>3]=n;h[f+40>>3]=o;}if(u){m=+LH(a,g);l=b+(d<<4)|0;k=+h[l>>3];j=+h[b+(d<<4)+8>>3];w=d+3|0;o=+h[b+(w<<4)>>3];p=+h[b+(w<<4)+8>>3];t=k-o;s=j-p;t=+C(+(s*s+t*t))*.9;m=m>=t?t:m;if(j==p){n=(k>3]=n;h[b+(w<<4)+8>>3]=m;c[l>>2]=c[v>>2];c[l+4>>2]=c[v+4>>2];c[l+8>>2]=c[v+8>>2];c[l+12>>2]=c[v+12>>2];v=d+2|0;h[b+(v<<4)>>3]=o;h[b+(v<<4)+8>>3]=p;v=16;}}else {r=b+(e<<4)|0;s=+h[r>>3];t=+h[b+(e<<4)+8>>3];l=e+3|0;u=b+(l<<4)|0;k=+h[u>>3];l=b+(l<<4)+8|0;j=+h[l>>3];m=+LH(a,g);q=+LH(a,i);n=s-k;p=t-j;n=+C(+(p*p+n*n));w=!(q+m>=n);n=n*.3333333333333333;m=w?m:n;n=w?q:n;if(t==j){w=s>3]=q;h[b+(w<<4)+8>>3]=o;c[r>>2]=c[v>>2];c[r+4>>2]=c[v+4>>2];c[r+8>>2]=c[v+8>>2];c[r+12>>2]=c[v+12>>2];v=b+(e+2<<4)|0;h[u>>3]=p;h[l>>3]=m;c[v>>2]=c[u>>2];c[v+4>>2]=c[u+4>>2];c[v+8>>2]=c[u+8>>2];c[v+12>>2]=c[u+12>>2];c[f+12>>2]=i;h[f+32>>3]=s;h[f+40>>3]=t;v=16;}if((v|0)==16){c[f+8>>2]=g;h[f+16>>3]=k;h[f+24>>3]=j;}return}function YH(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0;n=+h[b>>3];k=+h[c>>3]-n;o=+h[b+8>>3];l=+h[c+8>>3]-o;j=d*10.0/(+C(+(k*k+l*l))+.0001);k=j*((k>=0.0?.0001:-.0001)+k);j=((l>=0.0?.0001:-.0001)+l)*j;l=k*.5;m=j*.5;i=n-m;f=o-l;n=m+n;l=o+l;o=i+k;m=f+j;k=n+k;j=l+j;g=o>k?o:k;g=n>g?n:g;d=m>j?m:j;d=l>d?l:d;k=o>3]=i>3]=f>3]=i>g?i:g;h[a+24>>3]=f>d?f:d;return}function ZH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0;q=l;l=l+48|0;m=q+32|0;k=q+16|0;p=q;n=(c[a+16>>2]|0)+12|0;o=c[n>>2]|0;c[n>>2]=b;lS(a,c[(c[a>>2]|0)+336>>2]|0);uS(a,g);t=+h[e>>3]-+h[d>>3];b=e+8|0;s=+h[b>>3]-+h[d+8>>3];r=10.0/(+C(+(t*t+s*s))+.0001);h[e>>3]=r*((t>=0.0?.0001:-.0001)+t);h[b>>3]=((s>=0.0?.0001:-.0001)+s)*r;b=0;while(1){if((b|0)>=4)break;j=i>>(b<<3)&255;if(!j)break;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];_H(p,a,k,m,f,g,j);c[d>>2]=c[p>>2];c[d+4>>2]=c[p+4>>2];c[d+8>>2]=c[p+8>>2];c[d+12>>2]=c[p+12>>2];b=b+1|0;}c[n>>2]=o;l=q;return}function _H(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+32|0;m=q+16|0;k=q;n=i&15;j=1400;while(1){o=c[j>>2]|0;if(!o)break;if((n|0)==(o|0)){p=4;break}j=j+24|0;}if((p|0)==4){r=+h[j+8>>3]*f;h[e>>3]=r*+h[e>>3];o=e+8|0;h[o>>3]=r*+h[o>>3];p=c[j+16>>2]|0;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];wb[p&15](b,k,m,f,g,i);h[d>>3]=+h[e>>3]+ +h[d>>3];p=d+8|0;h[p>>3]=+h[o>>3]+ +h[p>>3];};c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];l=q;return}function $H(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i+8|0;f=i;d=QA(b,99796)|0;if((d|0)!=0?(a[d>>0]|0)!=0:0){e=d;h=5;}else {d=QA(b,99808)|0;if((d|0)!=0?(a[d>>0]|0)!=0:0){e=d;h=5;}else d=0;}if((h|0)==5){d=CH(e,0,120)|0;if(!d){c[f>>2]=KB(b)|0;gA(0,99815,f)|0;c[g>>2]=e;gA(3,99868,g)|0;}}l=i;return d|0}function aI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+16|0;f=JK(304)|0;if(!f)gA(1,99876,g)|0;e=a+16|0;a=c[e>>2]|0;c[f>>2]=a;c[e>>2]=f;if(!a){c[f+144>>2]=3;c[f+148>>2]=0;h[f+152>>3]=1.0;}else {b=f+16|0;d=a+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));b=f+56|0;d=a+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));c[f+144>>2]=c[a+144>>2];c[f+148>>2]=c[a+148>>2];h[f+152>>3]=+h[a+152>>3];c[f+136>>2]=c[a+136>>2];b=f+96|0;d=a+96|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0))}l=g;return f|0}function bI(a){a=a|0;var b=0;a=a+16|0;b=c[a>>2]|0;if(!b)qa(99902,99906,117,99913);else {U1(c[b+212>>2]|0);U1(c[b+208>>2]|0);U1(c[b+216>>2]|0);U1(c[b+220>>2]|0);U1(c[b+224>>2]|0);U1(c[b+228>>2]|0);U1(c[b+232>>2]|0);U1(c[b+236>>2]|0);U1(c[b+240>>2]|0);U1(c[b+244>>2]|0);U1(c[b+248>>2]|0);U1(c[b+252>>2]|0);U1(c[b+256>>2]|0);U1(c[b+272>>2]|0);U1(c[b+284>>2]|0);U1(c[b+280>>2]|0);c[a>>2]=c[b>>2];U1(b);return}}function cI(d,e,f,g,h,i,j){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;l=c[d+16>>2]|0;k=c[d+152>>2]|0;if((e|0)!=0&(k&32768|0)!=0)c[l+192>>2]=e;if(((k&65536|0)!=0?(c[l+212>>2]=EK(i,j)|0,(f|0)!=0):0)?(a[f>>0]|0)!=0:0){c[l+208>>2]=EK(f,j)|0;d=1;}else d=0;do if(k&4194304){if(g|0?a[g>>0]|0:0){c[l+228>>2]=EK(g,j)|0;d=l+260|0;b[d>>1]=b[d>>1]|1;d=1;break}e=c[l+192>>2]|0;if(e){c[l+228>>2]=D4(e)|0;d=1;}}while(0);if((h|0)!=0&(k&8388608|0)!=0?(a[h>>0]|0)!=0:0){c[l+244>>2]=EK(h,j)|0;d=1;}return d|0}function dI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+80|0;i=j;h=j+8|0;g=c[(c[b>>2]|0)+168>>2]|0;f=c[(c[(c[g+16>>2]|0)+8>>2]|0)+92>>2]|0;eI(b,e);b=QA(d,141060)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0){nA(e,b)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}a[b>>0]=0;b=c[e>>2]|0;c[f>>2]=b;}else {if((g|0)!=(d|0)&(f|0)!=0){nA(e,f)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}c[f>>2]=b+1;a[b>>0]=95;}switch(IC(d)|0){case 0:{f=(g|0)==(d|0)?111494:99927;b=(c[d>>2]|0)>>>4;break}case 1:{f=111481;b=(c[d>>2]|0)>>>4;break}case 2:{f=111450;b=(c[d>>2]|0)>>>4;break}default:{f=0;b=0;}}nA(e,f)|0;c[i>>2]=b;m4(h,99933,i)|0;nA(e,h)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}a[b>>0]=0;b=c[e>>2]|0;c[f>>2]=b;}l=j;return b|0}function eI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+144|0;h=i;g=i+8|0;e=c[b+160>>2]|0;if((e|0)>1?c[b+152>>2]&64|0:0){nA(d,c[(c[(c[b>>2]|0)+308>>2]|0)+(e<<2)>>2]|0)|0;f=d+4|0;e=c[f>>2]|0;if(e>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;e=c[f>>2]|0;}c[f>>2]=e+1;a[e>>0]=95;}f=c[b+196>>2]|0;e=c[b+200>>2]|0;if((f|0)>0|(e|0)>0){c[h>>2]=f;c[h+4>>2]=e;m4(g,99937,h)|0;nA(d,g)|0;}l=i;return}function fI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,i=0.0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0;s=l;l=l+48|0;p=s+16|0;f=s+32|0;q=s;r=+h[(c[a+16>>2]|0)+152>>3];o=gI(d,0,f)|0;if((o+-1|0)>>>0>=2){e=+h[b+16>>3];k=(e+ +h[b>>3])*.5;h[q>>3]=k;i=+h[b+24>>3];m=(i+ +h[b+8>>3])*.5;h[q+8>>3]=m;k=e-k;m=i-m;n=r>.5;if(n)uS(a,.5);j=c[f>>2]|0;i=0.0;f=c[j+8>>2]|0;while(1){d=c[f>>2]|0;if(!d)break;b=f+4|0;if(+g[b>>2]==0.0)e=i;else {jS(a,d);if(!(c[f+12>>2]|0))e=6.283185307179586;else e=+g[b>>2]*6.283185307179586+i;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];b=IT(p,k,m,i,e)|0;pS(a,c[b>>2]|0,c[b+4>>2]|0,0,0,1);EY(b);}i=e;f=f+12|0;}if(n)uS(a,r);hI(j);}l=s;return o|0}function gI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;o=r+8|0;n=r;q=JK(12)|0;i=D4(b)|0;a:do if(!d){d=1;f=i;while(1){switch(a[f>>0]|0){case 0:break a;case 58:{d=d+1|0;break}default:{}}f=f+1|0;}}while(0);c[q+4>>2]=i;p=JK((d*12|0)+12|0)|0;c[q+8>>2]=p;m=1.0;h=0;d=0;f=i;while(1){f=A4(f,107984)|0;if(!f){f=20;break}j=+iI(f);if(!(j>=0.0)){f=17;break}k=j-m;if(k>0.0)if((c[5156]|0)!=0?!(k<1.0e-05&k>-1.0e-05):0){c[n>>2]=b;gA(0,99948,n)|0;c[5156]=0;j=m;d=3;}else j=m;k=m-j;if(j>0.0)a[p+(h*12|0)+8>>0]=1;if(a[f>>0]|0)c[p+(h*12|0)>>2]=f;f=h+1|0;g[p+(h*12|0)+4>>2]=j;if(k<1.0e-05&k>-1.0e-05){h=f;f=30;break}else {m=k;h=f;f=0;}}b:do if((f|0)==17){if(!(c[5156]|0))d=1;else {c[o>>2]=b;gA(1,99983,o)|0;c[5156]=0;d=2;}hI(q);}else if((f|0)==20)if(m>0.0){f=0;i=0;while(1){if((f|0)>=(h|0))break;o=i+(+g[p+(f*12|0)+4>>2]==0.0&1)|0;f=f+1|0;i=o;}if((i|0)<=0){f=p+((h+-1|0)*12|0)+4|0;g[f>>2]=m+ +g[f>>2];f=30;break}j=m/+(i|0);f=0;while(1){if((f|0)>=(h|0)){f=30;break b}i=p+(f*12|0)+4|0;if(+g[i>>2]==0.0)g[i>>2]=j;f=f+1|0;}}else f=30;while(0);if((f|0)==30){while(1){f=h+-1|0;if((h|0)<=0)break;if(+g[p+(f*12|0)+4>>2]>0.0)break;else h=f;}c[p+(h*12|0)>>2]=0;c[q>>2]=h;c[e>>2]=q;}l=r;return d|0}function hI(a){a=a|0;U1(c[a+4>>2]|0);U1(c[a+8>>2]|0);U1(a);return}function iI(b){b=b|0;var d=0.0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;b=R2(b,59)|0;if(!b)d=0.0;else {g=b+1|0;a[b>>0]=0;d=+s5(g,e);d=(d>=0.0?(c[e>>2]|0)!=(g|0):0)?d:-1.0;}l=f;return +d}function jI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0;t=l;l=l+80|0;i=t+64|0;r=t;s=+h[(c[a+16>>2]|0)+152>>3];q=gI(d,0,i)|0;if((q+-1|0)>>>0>=2){if(!e){c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];p=r+16|0;o=b+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+32|0;o=b+32|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+48|0;o=b+48|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];}else {p=b+32|0;c[r>>2]=c[p>>2];c[r+4>>2]=c[p+4>>2];c[r+8>>2]=c[p+8>>2];c[r+12>>2]=c[p+12>>2];p=r+16|0;o=b+48|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+32|0;c[p>>2]=c[b>>2];c[p+4>>2]=c[b+4>>2];c[p+8>>2]=c[b+8>>2];c[p+12>>2]=c[b+12>>2];p=r+48|0;o=b+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];}k=r+16|0;m=+h[k>>3];f=+h[r>>3];n=m-f;o=r+32|0;h[o>>3]=f;h[k>>3]=f;p=s>.5;if(p)uS(a,.5);i=c[i>>2]|0;j=r+48|0;e=c[i+8>>2]|0;while(1){d=c[e>>2]|0;if(!d)break;b=e+4|0;if(!(+g[b>>2]==0.0)){jS(a,d);if(!(c[e+12>>2]|0))f=m;else f=n*+g[b>>2]+ +h[r>>3];h[o>>3]=f;h[k>>3]=f;nS(a,r,4,1);f=+h[k>>3];h[j>>3]=f;h[r>>3]=f;}e=e+12|0;}if(p)uS(a,s);hI(i);}l=t;return q|0}function kI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;g=f>>>16^2;c[d+264>>2]=g;h=d+268|0;c[h>>2]=g+2;g=d+272|0;U1(c[g>>2]|0);d=JK(c[h>>2]<<4)|0;c[g>>2]=d;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];g=d+16|0;b=b+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function lI(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0;q=l;l=l+144|0;c=q+80|0;e=q+16|0;f=q;k=+h[b>>3];o=a+16|0;m=+h[o>>3];if(!(((((((((!(k>m)?(n=+h[a>>3],!(k>3],i=+h[a+24>>3],!(d>i)):0)?(j=+h[a+8>>3],!(d>3],!(k>m|k>3],!(k>i|k>3],!(k>m|k>3],!(k>i|k>3],!(k>m|k>3],!(n>i|n>3];if(!(d>+h[o>>3])){if(d<+h[a>>3]){c=a;p=16;}}else {c=o;p=16;}if((p|0)==16){p=0;h[c>>3]=d;}d=+h[b+(e<<4)+8>>3];if(!(d>+h[f>>3])){if(d<+h[g>>3]){c=a;p=19;}}else {c=o;p=19;}if((p|0)==19){p=0;h[c+8>>3]=d;}e=e+1|0;}}while(0);l=q;return}function mI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,h=0,i=0;b=l;l=l+48|0;d=b+32|0;e=b+16|0;f=b;i=a+48|0;h=a+16|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];c[d>>2]=c[h>>2];c[d+4>>2]=c[h+4>>2];c[d+8>>2]=c[h+8>>2];c[d+12>>2]=c[h+12>>2];g=+oK(f,e,d);h=a+32|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];c[d>>2]=c[h>>2];c[d+4>>2]=c[h+4>>2];c[d+8>>2]=c[h+8>>2];c[d+12>>2]=c[h+12>>2];a=g<4.0&+oK(f,e,d)<4.0&1;l=b;return a|0}function nI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0;D=l;l=l+272|0;u=D+256|0;v=D+224|0;w=D+192|0;x=D+128|0;y=D+64|0;z=D;A=D+160|0;B=D+96|0;C=D+32|0;t=c[d+16>>2]|0;s=c[t+144>>2]|0;r=t+16|0;c[x>>2]=c[r>>2];c[x+4>>2]=c[r+4>>2];c[x+8>>2]=c[r+8>>2];c[x+12>>2]=c[r+12>>2];c[x+16>>2]=c[r+16>>2];c[x+20>>2]=c[r+20>>2];c[x+24>>2]=c[r+24>>2];c[x+28>>2]=c[r+28>>2];t=c[(c[t+8>>2]|0)+88>>2]|0;c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;c[z+12>>2]=0;c[z+16>>2]=0;c[z+20>>2]=0;c[z+24>>2]=0;c[z+28>>2]=0;if(!t){c[b>>2]=c[x>>2];c[b+4>>2]=c[x+4>>2];c[b+8>>2]=c[x+8>>2];c[b+12>>2]=c[x+12>>2];c[b+16>>2]=c[x+16>>2];c[b+20>>2]=c[x+20>>2];c[b+24>>2]=c[x+24>>2];c[b+28>>2]=c[x+28>>2];}else {d=x+16|0;if(+h[x>>3]==+h[d>>3]?(e=x+8|0,f=x+24|0,+h[e>>3]==+h[f>>3]):0){h[e>>3]=1797693134862315708145274.0e284;h[x>>3]=1797693134862315708145274.0e284;h[f>>3]=-1797693134862315708145274.0e284;h[d>>3]=-1797693134862315708145274.0e284;}j=v+8|0;k=v+16|0;m=v+24|0;n=y+16|0;o=y+24|0;p=s+144|0;q=w+16|0;r=t+12|0;d=0;f=c[t+8>>2]|0;e=0;g=0.0;i=0;while(1){if((i|0)>=(c[t>>2]|0))break;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[y+16>>2]=c[z+16>>2];c[y+20>>2]=c[z+20>>2];c[y+24>>2]=c[z+24>>2];c[y+28>>2]=c[z+28>>2];switch(c[f>>2]|0){case 1:case 0:{H=+h[f+8>>3];I=+h[f+24>>3];h[v>>3]=H-I;F=+h[f+16>>3];G=+h[f+32>>3];h[j>>3]=F-G;h[k>>3]=I+H;h[m>>3]=G+F;E=f+80|0;c[E>>2]=c[v>>2];c[E+4>>2]=c[v+4>>2];c[E+8>>2]=c[v+8>>2];c[E+12>>2]=c[v+12>>2];E=f+96|0;c[E>>2]=c[k>>2];c[E+4>>2]=c[k+4>>2];c[E+8>>2]=c[k+8>>2];c[E+12>>2]=c[k+12>>2];c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];oI(x,u);c[u>>2]=c[k>>2];c[u+4>>2]=c[k+4>>2];c[u+8>>2]=c[k+8>>2];c[u+12>>2]=c[k+12>>2];oI(x,u);break}case 3:case 2:{E=f+80|0;J=f+8|0;pI(A,c[J+4>>2]|0,c[J>>2]|0,x);c[E>>2]=c[A>>2];c[E+4>>2]=c[A+4>>2];c[E+8>>2]=c[A+8>>2];c[E+12>>2]=c[A+12>>2];c[E+16>>2]=c[A+16>>2];c[E+20>>2]=c[A+20>>2];c[E+24>>2]=c[A+24>>2];c[E+28>>2]=c[A+28>>2];break}case 5:case 4:{J=f+80|0;E=f+8|0;pI(B,c[E+4>>2]|0,c[E>>2]|0,x);c[J>>2]=c[B>>2];c[J+4>>2]=c[B+4>>2];c[J+8>>2]=c[B+8>>2];c[J+12>>2]=c[B+12>>2];c[J+16>>2]=c[B+16>>2];c[J+20>>2]=c[B+20>>2];c[J+24>>2]=c[B+24>>2];c[J+28>>2]=c[B+28>>2];break}case 6:{J=f+80|0;E=f+8|0;pI(C,c[E+4>>2]|0,c[E>>2]|0,x);c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];c[J+16>>2]=c[C+16>>2];c[J+20>>2]=c[C+20>>2];c[J+24>>2]=c[C+24>>2];c[J+28>>2]=c[C+28>>2];break}case 7:{J=f+112|0;c[J>>2]=JK(56)|0;E=D4(c[f+40>>2]|0)|0;K=c[J>>2]|0;c[K>>2]=E;a[K+48>>0]=a[100029+(c[f+24>>2]|0)>>0]|0;c[y>>2]=e;h[n>>3]=g;c[o>>2]=c[o>>2]&-128|d&127;K=c[p>>2]|0;K=nb[c[K>>2]&63](K,y,1)|0;E=c[J>>2]|0;c[E+4>>2]=K;LO(u,s,E);qI(w,+h[f+8>>3],+h[f+16>>3],c[J>>2]|0);J=f+80|0;c[J>>2]=c[w>>2];c[J+4>>2]=c[w+4>>2];c[J+8>>2]=c[w+8>>2];c[J+12>>2]=c[w+12>>2];c[J+16>>2]=c[w+16>>2];c[J+20>>2]=c[w+20>>2];c[J+24>>2]=c[w+24>>2];c[J+28>>2]=c[w+28>>2];c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];oI(x,u);c[u>>2]=c[q>>2];c[u+4>>2]=c[q+4>>2];c[u+8>>2]=c[q+8>>2];c[u+12>>2]=c[q+12>>2];oI(x,u);if(!(c[r>>2]|0))c[r>>2]=109;break}case 10:{e=c[f+16>>2]|0;g=+h[f+8>>3];break}case 15:{d=c[f+8>>2]|0;break}default:{}}f=f+120|0;i=i+1|0;}c[b>>2]=c[x>>2];c[b+4>>2]=c[x+4>>2];c[b+8>>2]=c[x+8>>2];c[b+12>>2]=c[x+12>>2];c[b+16>>2]=c[x+16>>2];c[b+20>>2]=c[x+20>>2];c[b+24>>2]=c[x+24>>2];c[b+28>>2]=c[x+28>>2];}l=D;return}function oI(a,b){a=a|0;b=b|0;var c=0.0,d=0;c=+h[b>>3];d=a+16|0;if(c>+h[d>>3])h[d>>3]=c;if(c<+h[a>>3])h[a>>3]=c;c=+h[b+8>>3];b=a+24|0;if(c>+h[b>>3])h[b>>3]=c;b=a+8|0;if(c<+h[b>>3])h[b>>3]=c;return}function pI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+48|0;k=r+32|0;n=r;f=+h[b>>3];o=n+16|0;h[o>>3]=f;h[n>>3]=f;f=+h[b+8>>3];p=n+24|0;h[p>>3]=f;m=n+8|0;h[m>>3]=f;j=1;while(1){if((j|0)>=(d|0))break;i=b+24|0;f=+h[i>>3];if(!(f<+h[n>>3])){if(f>+h[o>>3]){g=o;q=5;}}else {g=n;q=5;}if((q|0)==5){q=0;h[g>>3]=f;}f=+h[b+32>>3];if(!(f<+h[m>>3])){if(f>+h[p>>3]){b=o;q=8;}}else {b=n;q=8;}if((q|0)==8){q=0;h[b+8>>3]=f;}j=j+1|0;b=i;}c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];oI(e,k);c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];oI(e,k);c[a>>2]=c[n>>2];c[a+4>>2]=c[n+4>>2];c[a+8>>2]=c[n+8>>2];c[a+12>>2]=c[n+12>>2];c[a+16>>2]=c[n+16>>2];c[a+20>>2]=c[n+20>>2];c[a+24>>2]=c[n+24>>2];c[a+28>>2]=c[n+28>>2];l=r;return}function qI(b,c,d,e){b=b|0;c=+c;d=+d;e=e|0;var f=0.0,g=0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+16|0;i=n+8|0;j=n;f=+h[e+32>>3];k=+h[e+40>>3];switch(a[e+48>>0]|0){case 108:{h[i>>3]=c;f=f+c;g=j;m=5;break}case 110:{f=f*.5;h[i>>3]=c-f;f=f+c;g=j;m=5;break}case 114:{h[j>>3]=c;f=c-f;g=i;m=5;break}default:{c=0.0;f=0.0;}}if((m|0)==5){h[g>>3]=f;c=+h[i>>3];f=+h[j>>3];}d=+h[e+16>>3]+d;h[b>>3]=c;h[b+8>>3]=d-k;h[b+16>>3]=f;h[b+24>>3]=d;l=n;return}function rI(a){a=a|0;if((c[a>>2]|0)==7)BK(c[a+112>>2]|0,1);return}function sI(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0.0;m=l;l=l+16|0;k=m;j=c[b+152>>2]|0;n=+h[b+432>>3];i=+h[b+352>>3]*.013888888888888888;f=i*n;h[b+488>>3]=f;g=+h[b+440>>3];i=i*g;h[b+496>>3]=i;h[b+520>>3]=n*.013888888888888888;e=b+528|0;h[e>>3]=g*.013888888888888888;if(j&4096|0)h[e>>3]=g*-.013888888888888888;e=(c[b+360>>2]|0)==0;n=+((c[b+448>>2]|0)>>>0);g=+((c[b+452>>2]|0)>>>0);h[b+368>>3]=(e?n:g)/f;h[b+376>>3]=(e?g:n)/i;rS(b,aP(d,GA(d,0,101522,0)|0,195059)|0);c[b+160>>2]=0;tI(b,d);if(j&2|0)uI(b,d);e=jC(d)|0;while(1){if(!e)break;a[(c[e+16>>2]|0)+116>>0]=0;e=kC(d,e)|0;}vI(b,k);while(1){if(!((wI(b)|0)<<24>>24))break;if((xI(b)|0)>1)SR(b);yI(b);while(1){if(!((zI(b)|0)<<24>>24))break;AI(b,d);BI(b);}if((xI(b)|0)>1)TR(b);CI(b,k);}DI(b);l=m;return}function tI(a,b){a=a|0;b=b|0;var d=0;d=aI(a)|0;c[d+4>>2]=0;c[d+8>>2]=b;c[d+12>>2]=0;CJ(a,c[(c[b+16>>2]|0)+12>>2]|0,b);OR(a,b);return}function uI(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;jS(b,134800);d=QA(c,140977)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(c,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);OJ(b,c);g=jC(c)|0;while(1){if(!g)break;d=QA(g,140823)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(g,137729)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(g,101418)|0;do if(d|0?a[d>>0]|0:0){if(!(R2(d,58)|0)){hS(b,d);break}e=D4(d)|0;d=e;while(1){d=A4(d,107984)|0;if(!d)break;if(!(a[d>>0]|0)){d=0;continue}hS(b,d);d=0;}U1(e);}while(0);d=QA(g,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=XA(c,g)|0;while(1){if(!f)break;d=QA(f,140823)|0;do if(d|0?a[d>>0]|0:0){if(!(R2(d,58)|0)){hS(b,d);break}e=D4(d)|0;d=e;while(1){d=A4(d,107984)|0;if(!d)break;if(!(a[d>>0]|0)){d=0;continue}hS(b,d);d=0;}U1(e);}while(0);d=QA(f,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=ZA(c,f)|0;}g=kC(c,g)|0;}return}function vI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;e=i+8|0;g=i;h=c[a>>2]|0;d=c[h+312>>2]|0;f=a+156|0;c[f>>2]=d;h=c[h+316>>2]|0;if(!h)if((d|0)>1?(c[a+152>>2]&64|0)==0:0){c[e>>2]=c[a+52>>2];gA(0,100567,e)|0;c[f>>2]=1;e=1;d=0;}else {e=1;d=0;}else {d=h+4|0;if((c[h>>2]|0)>1?(c[a+152>>2]&64|0)==0:0){c[g>>2]=c[a+52>>2];gA(0,100567,g)|0;c[h+8>>2]=(c[f>>2]|0)+1;}e=c[d>>2]|0;d=h+8|0;}c[a+160>>2]=e;c[b>>2]=d;l=i;return}function wI(a){a=a|0;return (c[a+160>>2]|0)<=(c[a+156>>2]|0)|0}function xI(a){a=a|0;var b=0;b=c[(c[a>>2]|0)+316>>2]|0;return c[((b|0)==0?a+156|0:b)>>2]|0}function yI(a){a=a|0;var b=0,d=0;d=a+172|0;b=c[d+4>>2]|0;a=a+196|0;c[a>>2]=c[d>>2];c[a+4>>2]=b;return}function zI(a){a=a|0;var b=0,d=0;d=c[a+196>>2]|0;if(((d|0)>-1?(d|0)<(c[a+164>>2]|0):0)?(b=c[a+200>>2]|0,(b|0)>-1):0)a=(b|0)<(c[a+168>>2]|0)&1;else a=0;return a|0}function AI(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+176|0;k=p;f=p+48|0;m=p+32|0;n=c[d+16>>2]|0;o=c[d+152>>2]|0;if((c[d+160>>2]|0)<=1?(c[d+196>>2]|0)<=0:0)h=0;else {kA(m,128,f);g=n+212|0;h=c[g>>2]|0;eI(d,m);nA(m,h)|0;i=m+4|0;f=c[i>>2]|0;if(f>>>0>=(c[m+8>>2]|0)>>>0){lA(m,1)|0;f=c[i>>2]|0;}a[f>>0]=0;f=c[m>>2]|0;c[i>>2]=f;c[g>>2]=f;}HT(QA(e,100032)|0);FI(d);QR(d);hS(d,137314);jS(d,134800);do if(o&4259840|0){if((c[n+208>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;if(o&655360){i=o&131072;c[n+264>>2]=i>>>16^2;f=JK((i>>>12^32)+32|0)|0;g=d+288|0;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];c[f+8>>2]=c[g+8>>2];c[f+12>>2]=c[g+12>>2];g=f+16|0;q=d+304|0;c[g>>2]=c[q>>2];c[g+4>>2]=c[q+4>>2];c[g+8>>2]=c[q+8>>2];c[g+12>>2]=c[q+12>>2];if(!i){jK(f);g=4;}else g=2;}else {f=0;g=0;}if(!(o&8192))NR(d,f,f,g)|0;c[n+272>>2]=f;c[n+268>>2]=g;}while(0);if(o&32768|0?(j=c[(c[e+16>>2]|0)+12>>2]|0,j|0):0)c[n+192>>2]=c[j>>2];g=(o&4|0)!=0;do if(!g){f=n+208|0;if((c[f>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;q=d+256|0;c[k>>2]=c[q>>2];c[k+4>>2]=c[q+4>>2];c[k+8>>2]=c[q+8>>2];c[k+12>>2]=c[q+12>>2];c[k+16>>2]=c[q+16>>2];c[k+20>>2]=c[q+20>>2];c[k+24>>2]=c[q+24>>2];c[k+28>>2]=c[q+28>>2];kI(d,k);cS(d,c[f>>2]|0,c[n+228>>2]|0,c[n+244>>2]|0,c[n+212>>2]|0);}while(0);GI(d,e);f=c[(c[e+16>>2]|0)+12>>2]|0;if(f|0)DK(d,4,f);do if(!g){if((c[n+208>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;dS(d);}while(0);HI(d,e,o);RR(d);if(h|0){oA(m);c[n+212>>2]=h;}l=p;return}function BI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+32|0;d=h+24|0;b=h+16|0;j=h+8|0;f=h;g=a+196|0;i=a+188|0;c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[d>>2]=c[i>>2];c[d+4>>2]=c[i+4>>2];EI(j,b,d);i=c[j+4>>2]|0;e=g;c[e>>2]=c[j>>2];c[e+4>>2]=i;if(!((zI(a)|0)<<24>>24)){e=a+180|0;if(!(c[a+184>>2]|0))c[a+200>>2]=c[a+176>>2];else c[g>>2]=c[a+172>>2];c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];EI(f,b,d);i=c[f+4>>2]|0;j=g;c[j>>2]=c[f>>2];c[j+4>>2]=i;}l=h;return}function CI(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;if(!d){d=a+160|0;c[d>>2]=(c[d>>2]|0)+1;}else {c[a+160>>2]=c[d>>2];c[b>>2]=d+4;}return}function DI(a){a=a|0;PR(a);bI(a);return}function EI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[d+4>>2]|0)+(c[b+4>>2]|0)|0;c[a>>2]=(c[d>>2]|0)+(c[b>>2]|0);c[a+4>>2]=e;return}function FI(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0.0;t=l;l=l+48|0;n=t+32|0;f=t+24|0;j=t+8|0;k=t+16|0;m=t;r=a+196|0;q=c[r>>2]|0;r=c[r+4>>2]|0;p=f;c[p>>2]=q;c[p+4>>2]=r;p=a+164|0;i=c[p>>2]|0;p=c[p+4>>2]|0;s=j;c[s>>2]=i;c[s+4>>2]=p;s=a+360|0;if(!(c[s>>2]|0)){k=q;j=r;}else {c[n>>2]=c[f>>2];c[n+4>>2]=c[f+4>>2];NJ(k,n);r=k;k=c[r>>2]|0;r=c[r+4>>2]|0;p=f;c[p>>2]=k;c[p+4>>2]=r;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];NJ(m,n);p=m;i=c[p>>2]|0;p=c[p+4>>2]|0;c[j>>2]=i;c[j+4>>2]=p;j=r;}d=+h[a+320>>3];g=d*+(k|0)-+h[a+240>>3];h[a+288>>3]=g;e=+h[a+328>>3];o=e*+(j|0)-+h[a+248>>3];h[a+296>>3]=o;h[a+304>>3]=d+g;h[a+312>>3]=e+o;f=a+472|0;if(!(c[(c[a+12>>2]|0)+28>>2]|0)){r=a+456|0;c[f>>2]=c[r>>2];c[f+4>>2]=c[r+4>>2];c[f+8>>2]=c[r+8>>2];c[f+12>>2]=c[r+12>>2];}else {q=a+456|0;c[f>>2]=c[((c[f>>2]|0)<(c[q>>2]|0)?f:q)>>2];r=a+476|0;c[r>>2]=c[((c[r>>2]|0)<(c[a+460>>2]|0)?f:q)+4>>2];r=a+480|0;c[r>>2]=c[((c[r>>2]|0)>(c[a+464>>2]|0)?f:q)+8>>2];r=a+484|0;c[r>>2]=c[((c[r>>2]|0)>(c[a+468>>2]|0)?f:q)+12>>2];}m=c[a+152>>2]|0;b=+h[a+336>>3];if(!(m&128)){b=(+(k|0)-+(i|0)*.5)*d+b;h[a+256>>3]=b;g=(+(j|0)-+(p|0)*.5)*e+ +h[a+344>>3];o=g;d=d+b;g=g+e;}else {d=+h[a+368>>3]*.5;e=b-d;h[a+256>>3]=e;g=+h[a+344>>3];u=+h[a+376>>3]*.5;o=g-u;d=d+b;g=u+g;b=e;}h[a+264>>3]=o;h[a+272>>3]=d;h[a+280>>3]=g;if(!(c[s>>2]|0)){e=+h[a+352>>3];h[a+504>>3]=+h[a+384>>3]/e-b;if(!(m&4096)){d=+h[a+392>>3]/e;b=o;}else {d=-g;b=+h[a+392>>3]/e;}h[a+512>>3]=d-b;}else {f=a+384|0;e=+h[a+352>>3];h[a+512>>3]=-g-+h[a+392>>3]/e;if(!(m&4096))d=+h[f>>3]/e;else {d=-d;b=+h[f>>3]/e;}h[a+504>>3]=d-b;}l=t;return}function GI(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+48|0;q=s;o=s+40|0;p=s+36|0;r=s+32|0;e=QA(d,140977)|0;if(!e){j=1;e=137198;}else {i=(a[e>>0]|0)==0;j=i&1;e=i?137198:e;}h=c[b+152>>2]|0;i=(a[e>>0]|0)==116;if(!(h&256))if(i){m=(s2(e,137379)|0)==0;k=m?137198:e;m=m?1:j;n=8;}else {k=e;m=j;n=8;}else if(!(i?!(s2(e,137379)|0):0)){k=e;m=j;n=8;}if((n|0)==8?!((m|0)!=0&(h&33554432|0)!=0):0)if(!((JJ(k,o,p)|0)<<24>>24)){jS(b,k);hS(b,137379);r=b+256|0;c[q>>2]=c[r>>2];c[q+4>>2]=c[r+4>>2];c[q+8>>2]=c[r+8>>2];c[q+12>>2]=c[r+12>>2];c[q+16>>2]=c[r+16>>2];c[q+20>>2]=c[r+20>>2];c[q+24>>2]=c[r+24>>2];c[q+28>>2]=c[r+28>>2];oS(b,q,1);}else {c[r>>2]=0;i=c[o>>2]|0;jS(b,i);hS(b,137379);IJ(d,r)|0;e=c[o+4>>2]|0;h=ZO(d,c[47143]|0,0,0)|0;f=+g[p>>2];if(!e)kS(b,137314,h,f);else kS(b,e,h,f);r=(c[r>>2]|0)>>>1&1|2;p=b+256|0;c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];c[q+16>>2]=c[p+16>>2];c[q+20>>2]=c[p+20>>2];c[q+24>>2]=c[p+24>>2];c[q+28>>2]=c[p+28>>2];oS(b,q,r);U1(i);}e=c[(c[(c[d+16>>2]|0)+8>>2]|0)+88>>2]|0;if(e|0)LJ(b,e);l=s;return}function HI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=(c[a>>2]|0)+28|0;c[g>>2]=(c[g>>2]|0)+1;g=(d&4|0)!=0;if(!g)II(a,b,d);a:do if(!(d&1)){if(d&16|0){YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);WR(a);e=jC(b)|0;while(1){if(!e)break;JI(a,e);e=kC(b,e)|0;}XR(a);break}if(!(d&8)){f=jC(b)|0;while(1){if(!f)break a;JI(a,f);e=XA(b,f)|0;while(1){if(!e)break;JI(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0);KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}}WR(a);e=jC(b)|0;while(1){if(!e)break;if((LI(b,e)|0)<<24>>24)JI(a,e);e=kC(b,e)|0;}XR(a);YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;if((MI(b,e)|0)<<24>>24)KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);}else {WR(a);e=jC(b)|0;while(1){if(!e)break;JI(a,e);e=kC(b,e)|0;}XR(a);YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);}while(0);if(g)II(a,b,d);return}function II(e,f,i){e=e|0;f=f|0;i=i|0;var j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;P=l;l=l+128|0;w=P+72|0;N=P+64|0;H=P+112|0;I=P;J=P+104|0;K=f+16|0;L=(i&4|0)!=0;M=e+16|0;x=I+32|0;y=I+16|0;A=I+8|0;B=I+24|0;C=I+48|0;D=I+40|0;E=I+56|0;F=(i&8|0)==0;G=J+4|0;v=1;while(1){j=c[K>>2]|0;if((v|0)>(c[j+180>>2]|0))break;u=c[(c[j+184>>2]|0)+(v<<2)>>2]|0;if((GJ(e,u)|0)<<24>>24){if(L)II(e,u,i);HJ(e,u);r=c[M>>2]|0;s=r+208|0;if(!(c[s>>2]|0))t=(b[r+260>>1]&1)!=0;else t=1;HT(QA(u,100032)|0);if(!(L|t^1)){q=(c[u+16>>2]|0)+16|0;c[w>>2]=c[q>>2];c[w+4>>2]=c[q+4>>2];c[w+8>>2]=c[q+8>>2];c[w+12>>2]=c[q+12>>2];c[w+16>>2]=c[q+16>>2];c[w+20>>2]=c[q+20>>2];c[w+24>>2]=c[q+24>>2];c[w+28>>2]=c[q+28>>2];kI(e,w);cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);}c[H>>2]=0;j=IJ(u,H)|0;if(!j)p=0;else {lS(e,j);p=c[H>>2]&1;}q=u+16|0;j=d[(c[q>>2]|0)+112>>0]|0;do if(!(j&1)){if(j&2|0){j=bP(u,0,106256)|0;k=bP(u,0,106264)|0;O=29;break}if(j&8|0){j=bP(u,0,106272)|0;k=bP(u,0,106280)|0;O=29;break}if(j&4|0){j=bP(u,0,106288)|0;k=bP(u,0,106296)|0;O=29;break}j=QA(u,140823)|0;if(!j)k=0;else k=(a[j>>0]|0)==0?0:j;j=QA(u,137729)|0;if(!j)j=k;else j=(a[j>>0]|0)==0?k:j;m=QA(u,101418)|0;if(m)k=(a[m>>0]|0)==0?k:m;if(!((p|0)!=0&(k|0)!=0)){m=QA(u,140977)|0;if(m|0?a[m>>0]|0:0){k=m;O=29;break}j=(j|0)==0?137314:j;n=(k|0)==0?134800:k;c[J>>2]=0;if(!p)k=0;else O=31;}else O=29;}else {j=bP(u,0,106240)|0;k=bP(u,0,106248)|0;O=29;}while(0);if((O|0)==29){c[J>>2]=0;j=(j|0)==0?137314:j;n=(k|0)==0?134800:k;O=31;}if((O|0)==31){O=0;if(!((JJ(n,J,w)|0)<<24>>24)){jS(e,n);k=1;}else {jS(e,c[J>>2]|0);k=c[G>>2]|0;m=ZO(u,c[47143]|0,0,0)|0;o=+g[w>>2];if(!k)kS(e,137314,m,o);else kS(e,k,m,o);k=(c[H>>2]|0)>>>1&1|2;}}m=c[47142]|0;if((m|0?(z=RA(u,m)|0,z|0):0)?a[z>>0]|0:0)uS(e,+_O(u,c[47142]|0,1.0,0.0));p=c[H>>2]|0;do if(p&4){m=ZO(u,c[47141]|0,1,0)|0;if(m|k|0){n=c[q>>2]|0;Q=n+16|0;c[I>>2]=c[Q>>2];c[I+4>>2]=c[Q+4>>2];c[I+8>>2]=c[Q+8>>2];c[I+12>>2]=c[Q+12>>2];n=n+32|0;c[x>>2]=c[n>>2];c[x+4>>2]=c[n+4>>2];c[x+8>>2]=c[n+8>>2];c[x+12>>2]=c[n+12>>2];h[y>>3]=+h[x>>3];h[B>>3]=+h[A>>3];h[C>>3]=+h[I>>3];h[E>>3]=+h[D>>3];if(!m)hS(e,137379);else hS(e,j);TM(e,I,4,p,k);}}else {if(!(p&64)){if(ZO(u,c[47141]|0,1,0)|0){hS(e,j);Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,k);break}if(!k)break;hS(e,137379);Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,k);break}Q=c[q>>2]|0;p=Q+16|0;c[I>>2]=c[p>>2];c[I+4>>2]=c[p+4>>2];c[I+8>>2]=c[p+8>>2];c[I+12>>2]=c[p+12>>2];Q=Q+32|0;c[x>>2]=c[Q>>2];c[x+4>>2]=c[Q+4>>2];c[x+8>>2]=c[Q+8>>2];c[x+12>>2]=c[Q+12>>2];h[y>>3]=+h[x>>3];h[B>>3]=+h[A>>3];h[C>>3]=+h[I>>3];h[E>>3]=+h[D>>3];if(!(ZO(u,c[47141]|0,1,0)|0))hS(e,137379);else hS(e,j);if((jI(e,I,n,0)|0)>1){c[N>>2]=KB(u)|0;gA(3,100400,N)|0;}Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,0);}while(0);U1(c[J>>2]|0);j=c[(c[q>>2]|0)+12>>2]|0;if(j|0)DK(e,5,j);if(t){if(L){Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];kI(e,w);cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);}dS(e);}a:do if(!F){k=jC(u)|0;while(1){if(!k)break a;JI(e,k);j=XA(u,k)|0;while(1){if(!j)break;KI(e,j);j=ZA(u,j)|0;}k=kC(u,k)|0;}}while(0);KJ(e,f);if(!L)II(e,u,i);}v=v+1|0;}l=P;return}function JI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+32|0;e=j;h=c[b>>2]|0;i=d+16|0;a:do if(((c[(c[i>>2]|0)+8>>2]|0?(yJ(b,xC(d)|0,d)|0)<<24>>24:0)?(k=b+256|0,c[e>>2]=c[k>>2],c[e+4>>2]=c[k+4>>2],c[e+8>>2]=c[k+8>>2],c[e+12>>2]=c[k+12>>2],c[e+16>>2]=c[k+16>>2],c[e+20>>2]=c[k+20>>2],c[e+24>>2]=c[k+24>>2],c[e+28>>2]=c[k+28>>2],(zJ(d,e)|0)<<24>>24):0)?(f=(c[i>>2]|0)+116|0,g=c[h+28>>2]|0,(g|0)!=(a[f>>0]|0)):0){a[f>>0]=g;rS(b,KB(d)|0);e=aP(d,c[47169]|0,195059)|0;if(a[e>>0]|0)rS(b,e);e=aP(d,c[47157]|0,195059)|0;b:do if(a[e>>0]|0){PI(e)|0;e=188228;while(1){f=e;e=e+4|0;f=c[f>>2]|0;if(!f)break b;if((a[f>>0]|0)!=105)continue;if(!(s2(f,134335)|0))break a}}while(0);AJ(b,d);ub[c[(c[(c[(c[i>>2]|0)+8>>2]|0)+4>>2]|0)+20>>2]&63](b,d);e=c[(c[i>>2]|0)+108>>2]|0;if(e|0?a[e+81>>0]|0:0)DK(b,10,e);BJ(b);}while(0);l=j;return}function KI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;g=h;e=b+256|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[g+16>>2]=c[e+16>>2];c[g+20>>2]=c[e+20>>2];c[g+24>>2]=c[e+24>>2];c[g+28>>2]=c[e+28>>2];a:do if((NI(d,g)|0)<<24>>24?(f=d+-48|0,(OI(b,d)|0)<<24>>24):0){i=d+48|0;e=l2(KB(c[((c[d>>2]&3|0)==3?d:i)+40>>2]|0)|0)|0;e=T1(e+3+(l2(KB(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0)|0)|0;r3(e,KB(c[((c[d>>2]&3|0)==3?d:i)+40>>2]|0)|0)|0;i=(xB(xC(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0)==0;g=e+(l2(e)|0)|0;if(i){a[g>>0]=a[141747]|0;a[g+1>>0]=a[141748]|0;a[g+2>>0]=a[141749]|0;}else {a[g>>0]=a[137738]|0;a[g+1>>0]=a[137739]|0;a[g+2>>0]=a[137740]|0;}F4(e,KB(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0;rS(b,e);U1(e);e=aP(d,c[47191]|0,195059)|0;if(a[e>>0]|0)rS(b,e);e=aP(d,c[47185]|0,195059)|0;b:do if(!(a[e>>0]|0))e=0;else {PI(e)|0;e=188228;while(1){f=e;e=e+4|0;f=c[f>>2]|0;if(!f){e=188228;break b}if((a[f>>0]|0)!=105)continue;if(!(s2(f,134335)|0))break a}}while(0);QI(b,d,e);RI(b,d,e);SI(b);}while(0);l=h;return}function LI(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0)){a=1;break}if(!(HC(c[(c[e+184>>2]|0)+(a<<2)>>2]|0,b)|0))a=a+1|0;else {a=0;break}}return a|0}function MI(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0)){a=1;break}if(!(HC(c[(c[e+184>>2]|0)+(a<<2)>>2]|0,b)|0))a=a+1|0;else {a=0;break}}return a|0}function NI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+64|0;i=j+32|0;f=j;g=b+16|0;b=c[g>>2]|0;e=c[b+8>>2]|0;if((e|0)!=0?(e=e+8|0,c[f>>2]=c[e>>2],c[f+4>>2]=c[e+4>>2],c[f+8>>2]=c[e+8>>2],c[f+12>>2]=c[e+12>>2],c[f+16>>2]=c[e+16>>2],c[f+20>>2]=c[e+20>>2],c[f+24>>2]=c[e+24>>2],c[f+28>>2]=c[e+28>>2],c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[i+16>>2]=c[d+16>>2],c[i+20>>2]=c[d+20>>2],c[i+24>>2]=c[d+24>>2],c[i+28>>2]=c[d+28>>2],(xJ(f,i)|0)!=0):0)b=1;else h=3;do if((h|0)==3){e=c[b+96>>2]|0;if(e){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[i+16>>2]=c[d+16>>2];c[i+20>>2]=c[d+20>>2];c[i+24>>2]=c[d+24>>2];c[i+28>>2]=c[d+28>>2];if((iQ(e,i)|0)<<24>>24){b=1;break}b=c[g>>2]|0;}b=c[b+108>>2]|0;if((b|0?a[b+81>>0]|0:0)?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[i+16>>2]=c[d+16>>2],c[i+20>>2]=c[d+20>>2],c[i+24>>2]=c[d+24>>2],c[i+28>>2]=c[d+28>>2],(iQ(b,i)|0)<<24>>24):0){b=1;break}b=0;}while(0);l=j;return b|0}function OI(b,d){b=b|0;d=d|0;var e=0,f=0;a:do if((c[b+156>>2]|0)>=2?(e=aP(d,c[47190]|0,195059)|0,(tJ(b,e)|0)<<24>>24==0):0)if(!(a[e>>0]|0)){e=0;while(1){if((e|0)>=2){e=0;break a}f=(e|0)==1;f=aP(c[((c[d>>2]&3|0)==((f?2:3)|0)?d:d+((f?-1:1)*48|0)|0)+40>>2]|0,c[47167]|0,195059)|0;if(!(a[f>>0]|0)){e=1;break a}if(!((tJ(b,f)|0)<<24>>24))e=e+1|0;else {e=1;break}}}else e=0;else e=1;while(0);return e|0}function PI(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+192|0;o=p+24|0;n=p+16|0;m=p+8|0;k=p;g=p+48|0;j=p+32|0;if(a[100282]|0){kA(188492,128,194826);a[100282]=0;}kA(j,128,p+56|0);c[g>>2]=b;h=j+4|0;i=j+8|0;d=0;e=0;a:while(1){f=d;b:while(1)switch(rJ(g,j)|0){case 0:{d=21;break a}case 40:if(!(f<<24>>24)){f=1;continue b}else {d=7;break a}case 41:if(!(f<<24>>24)){d=9;break a}else {f=0;continue b}default:break b}if(!(f<<24>>24)){if((e|0)==63){d=12;break}d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}c[47124]=d+1;a[d>>0]=0;c[188228+(e<<2)>>2]=c[47124];e=e+1|0;}d=c[h>>2]|0;if(d>>>0>=(c[i>>2]|0)>>>0){lA(j,1)|0;d=c[h>>2]|0;}a[d>>0]=0;d=c[j>>2]|0;c[h>>2]=d;nA(188492,d)|0;d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}c[47124]=d+1;a[d>>0]=0;d=f;}do if((d|0)==7){c[k>>2]=b;gA(1,100283,k)|0;c[47057]=0;oA(j);}else if((d|0)==9){c[m>>2]=b;gA(1,100317,m)|0;c[47057]=0;oA(j);}else if((d|0)==12){c[n>>2]=b;gA(0,100345,n)|0;c[47120]=0;oA(j);}else if((d|0)==21){if(f<<24>>24){c[o>>2]=b;gA(1,100368,o)|0;c[47057]=0;oA(j);break}c[188228+(e<<2)>>2]=0;oA(j);d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}a[d>>0]=0;c[47124]=c[47123];}while(0);l=p;return 188228} - function Bb(a){a=a|0;var b=0;b=l;l=l+a|0;l=l+15&-16;return b|0}function Cb(){return l|0}function Db(a){a=a|0;l=a;}function Eb(a,b){a=a|0;b=b|0;l=a;m=b;}function Fb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b;}}function Gb(a){a=a|0;z=a;}function Hb(){return z|0}function Ib(a){a=a|0;c[46654]=a;return 0}function Jb(){return c[46654]|0}function Kb(a,b){a=a|0;b=b|0;Oa(0,a|0,b|0)|0;return}function Lb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i+4|0;g=i;c[f>>2]=0;h=mG()|0;rG(h,10976);rG(h,17220);rG(h,17440);fA(1)|0;eA(18)|0;while(1){a=ZB(a)|0;e=c[f>>2]|0;if(!a)break;if(e|0){a=195059;continue}nG(h,a,d)|0;qG(h,a,b,f,g)|0;a=195059;}l=i;return e|0}function Mb(a){a=a|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;d=g+4|0;e=g;f=c[(c[a+16>>2]|0)+8>>2]|0;a=a+64|0;switch(c[a>>2]|0){case 0:{JL(f);break}case 1:{if(b[(c[f+16>>2]|0)+136>>1]&1)UP(f);break}case 4:case 5:case 6:{GL(f,e,d);Pb(f,c[e>>2]|0,c[d>>2]|0,c[a>>2]|0);break}default:{}}l=g;return}function Nb(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[(c[a+16>>2]|0)+8>>2]|0;if(!(c[46655]|0)){c[46655]=c[4678];c[46656]=57;c[46657]=19;}e=d+64|0;f=(c[e>>2]|0)+8|0;b=c[f>>2]|0;c[f>>2]=186620;switch(c[a+64>>2]|0){case 2:{wL(a,d,a,0);break}case 3:{wL(a,d,a,1);break}case 1:case 0:{if(!(c[a+152>>2]&134217728))dE(d,a)|0;break}case 6:case 5:case 4:{Ob(d);if(!(c[a+152>>2]&134217728))dE(d,a)|0;break}default:{}}c[(c[e>>2]|0)+8>>2]=b;return}function Ob(b){b=b|0;var d=0,e=0;d=c[46659]|0;if((d|0)!=(c[46658]|0)){e=c[c[46690]>>2]|0;if(!e){e=_P(b,0,99808,195059)|0;c[c[46690]>>2]=e;d=c[46659]|0;}if(d>>>0>=(c[46660]|0)>>>0){lA(186632,1)|0;d=c[46659]|0;}a[d>>0]=0;d=c[46658]|0;c[46659]=d;KA(b,e,d)|0;}if(c[(c[b+16>>2]|0)+12>>2]|0){e=c[(c[46690]|0)+4>>2]|0;d=c[46675]|0;if(d>>>0>=(c[46676]|0)>>>0){lA(186696,1)|0;d=c[46675]|0;}a[d>>0]=0;d=c[46674]|0;c[46675]=d;KA(b,e,d)|0;}TA(b,66753,c[(c[46690]|0)+8236>>2]|0,195059)|0;d=0;while(1){if((d|0)==8)break;oA(186632+(d<<4)|0);d=d+1|0;}U1(c[46690]|0);h[1]=1.0;h[5]=1.0;c[46691]=0;c[46695]=0;return}function Pb(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=T1(8240)|0;c[46690]=i;a:do switch(g|0){case 6:{b[i+8232>>1]=14;g=66769;break}case 5:{b[i+8232>>1]=12;g=66773;break}default:{g=QA(d,66753)|0;if((g|0?a[g>>0]|0:0)?(h=Qb(g)|0,(h&65535)>10):0){i=c[46690]|0;b[i+8232>>1]=h;break a}g=Qb(66765)|0;i=c[46690]|0;b[i+8232>>1]=g;g=66765;}}while(0);c[i+8236>>2]=g;j=d+16|0;g=c[j>>2]|0;if(!(c[g+180>>2]|0))h=0;else {h=_P(d,0,99808,195059)|0;i=c[46690]|0;g=c[j>>2]|0;}c[i>>2]=h;if(!(a[g+113>>0]&8))g=0;else g=_P(d,0,66777,195059)|0;c[(c[46690]|0)+4>>2]=g;i=_P(d,1,99808,195059)|0;c[(c[46690]|0)+8>>2]=i;i=_P(d,1,66777,195059)|0;c[(c[46690]|0)+12>>2]=i;i=_P(d,2,99808,195059)|0;g=c[46690]|0;c[g+16>>2]=i;if(!f)h=0;else {h=_P(d,2,66785,195059)|0;g=c[46690]|0;}c[g+20>>2]=h;if(!e)h=0;else {h=_P(d,2,66793,195059)|0;g=c[46690]|0;}c[g+24>>2]=h;h=a[(c[j>>2]|0)+113>>0]|0;if(!(h&33))i=0;else {i=_P(d,2,66777,195059)|0;g=c[46690]|0;h=a[(c[j>>2]|0)+113>>0]|0;}c[g+28>>2]=i;if(!(h&2))i=0;else {i=_P(d,2,66801,195059)|0;g=c[46690]|0;h=a[(c[j>>2]|0)+113>>0]|0;}c[g+32>>2]=i;if(!(h&4))h=0;else {h=_P(d,2,66810,195059)|0;g=c[46690]|0;}c[g+36>>2]=h;g=0;while(1){if((g|0)==8)break;kA(186632+(g<<4)|0,1024,(c[46690]|0)+40+(g<<10)|0);g=g+1|0;}return}function Qb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+1040|0;h=j;g=j+8|0;f=0;d=b;a:while(1){do{e=d;d=d+1|0;e=a[e>>0]|0;if(!(e<<24>>24))break a}while(((e<<24>>24)+-48|0)>>>0>=10);if((f|0)>=1023){i=7;break}a[g+f>>0]=e;f=f+1|0;}if((i|0)==7){c[h>>2]=b;gA(0,66819,h)|0;}a[g+f>>0]=0;i=(q5(g)|0)&65535;l=j;return i|0}function Rb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;d=c[c[46690]>>2]|0;b=c[46663]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;if(c[(c[e+16>>2]|0)+12>>2]|0){d=c[(c[46690]|0)+4>>2]|0;b=c[46679]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}h[2]=1.0;h[6]=1.0;c[46692]=0;c[46696]=0;return}function Sb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;b=c[46663]|0;if((c[46662]|0)!=(b|0)){d=c[(c[46690]|0)+8>>2]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;}b=c[46679]|0;if((c[46678]|0)!=(b|0)){d=c[(c[46690]|0)+12>>2]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}h[9]=1.0;h[11]=1.0;c[46699]=0;c[46701]=0;return}function Tb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;b=c[46663]|0;if((c[46662]|0)!=(b|0)){d=c[(c[46690]|0)+16>>2]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;}b=c[46667]|0;if((c[46666]|0)!=(b|0)){d=c[(c[46690]|0)+24>>2]|0;if(b>>>0>=(c[46668]|0)>>>0){lA(186664,1)|0;b=c[46667]|0;}a[b>>0]=0;b=c[46666]|0;c[46667]=b;KA(e,d,b)|0;}b=c[46671]|0;if((c[46670]|0)!=(b|0)){d=c[(c[46690]|0)+20>>2]|0;if(b>>>0>=(c[46672]|0)>>>0){lA(186680,1)|0;b=c[46671]|0;}a[b>>0]=0;b=c[46670]|0;c[46671]=b;KA(e,d,b)|0;}b=c[46679]|0;if((c[46678]|0)!=(b|0)){d=c[(c[46690]|0)+28>>2]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}b=c[46683]|0;if((c[46682]|0)!=(b|0)){d=c[(c[46690]|0)+36>>2]|0;if(b>>>0>=(c[46684]|0)>>>0){lA(186728,1)|0;b=c[46683]|0;}a[b>>0]=0;b=c[46682]|0;c[46683]=b;KA(e,d,b)|0;}b=c[46687]|0;if((c[46686]|0)!=(b|0)){d=c[(c[46690]|0)+32>>2]|0;if(b>>>0>=(c[46688]|0)>>>0){lA(186744,1)|0;b=c[46687]|0;}a[b>>0]=0;b=c[46686]|0;c[46687]=b;KA(e,d,b)|0;}h[10]=1.0;h[12]=1.0;h[3]=1.0;h[4]=1.0;h[7]=1.0;h[8]=1.0;c[46700]=0;c[46702]=0;c[46693]=0;c[46694]=0;c[46697]=0;c[46698]=0;return}function Ub(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1056|0;j=t+16|0;s=t+8|0;r=t;k=t+32|0;o=c[(c[d+16>>2]|0)+12>>2]|0;p=c[11416+(o<<2)>>2]|0;nA(p,66916)|0;g=f+4|0;bc(k,+h[(c[g>>2]|0)+16>>3]);nA(p,k)|0;ec(d,195059,c[c[g>>2]>>2]|0);_b(d);q=a[f+48>>0]|0;q=q<<24>>24==108?-1:q<<24>>24==114&1;g=c[g>>2]|0;if(!g)g=0;else g=c[g+24>>2]&127;i=b[(c[46690]|0)+8232>>1]|0;if((i&65535)>14?(m=c[11464+((i&65535)+-15<<2)>>2]&g,n=186764+(o<<2)|0,(c[n>>2]|0)!=(m|0)):0){c[r>>2]=m;m4(k,66919,r)|0;nA(p,k)|0;c[n>>2]=m;}r=e+8|0;h[r>>3]=+h[r>>3]+ +h[f+24>>3];nA(p,66925)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];ac(p,j);c[s>>2]=q;m4(k,102220,s)|0;nA(p,k)|0;bc(k,+h[f+32>>3]);nA(p,k)|0;ec(d,195059,c[f>>2]|0);l=t;return}function Vb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;i=l;l=l+1040|0;f=i;g=i+16|0;e=c[(c[a+16>>2]|0)+12>>2]|0;Zb(a);_b(a);if(!d){a=c[11416+(e<<2)>>2]|0;nA(a,66913)|0;}else {if((d|1|0)==3)gc(a,d,b,2);else hc(a);a=c[11416+(e<<2)>>2]|0;nA(a,66910)|0;};c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];ac(a,f);bc(g,+h[b+16>>3]-+h[b>>3]);nA(a,g)|0;bc(g,+h[b+24>>3]-+h[b+8>>3]);nA(a,g)|0;l=i;return}function Wb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Zb(a);_b(a);if(!d)$b(a,112,b,c);else {if((d|1|0)==3)gc(a,d,b,c);else hc(a);$b(a,80,b,c);}return}function Xb(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Zb(a);_b(a);if(!f)$b(a,66,b,c);else {if((f|1|0)==3)gc(a,f,b,c);else hc(a);$b(a,98,b,c);}return}function Yb(a,b,c){a=a|0;b=b|0;c=c|0;Zb(a);_b(a);$b(a,76,b,c);return}function Zb(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+1184|0;i=n;f=n+24|0;m=n+8|0;kA(m,1024,n+152|0);j=b+16|0;d=c[j>>2]|0;g=+h[d+152>>3];e=8+(c[d+12>>2]<<3)|0;if(g!=+h[e>>3]){h[e>>3]=g;nA(m,66882)|0;h[i>>3]=+h[(c[j>>2]|0)+152>>3];m4(f,66896,i)|0;cc(f,0);nA(m,f)|0;f=m+4|0;d=c[f>>2]|0;e=m+8|0;if(d>>>0>=(c[e>>2]|0)>>>0){lA(m,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=41;d=c[f>>2]|0;if(d>>>0>=(c[e>>2]|0)>>>0){lA(m,1)|0;d=c[f>>2]|0;}a[d>>0]=0;d=c[m>>2]|0;c[f>>2]=d;ec(b,66901,d);d=c[j>>2]|0;}d=c[d+160>>2]|0;if(d|0){j=m+4|0;k=m+8|0;a:while(1){i=d+4|0;d=c[d>>2]|0;if(!d)break;switch(a[d>>0]|0){case 102:{if(!(s2(d,111101)|0)){d=i;continue a}break}case 98:{if(!(s2(d,111083)|0)){d=i;continue a}break}case 115:{if(!(s2(d,111088)|0)){d=i;continue a}break}default:{}}nA(m,d)|0;do{f=d;d=d+1|0;}while((a[f>>0]|0)!=0);if(a[d>>0]|0){e=c[j>>2]|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;e=c[j>>2]|0;}c[j>>2]=e+1;a[e>>0]=40;f=0;while(1){if(!(a[d>>0]|0))break;if(f|0){e=c[j>>2]|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;e=c[j>>2]|0;}c[j>>2]=e+1;a[e>>0]=44;}nA(m,d)|0;do{e=d;d=d+1|0;}while((a[e>>0]|0)!=0);f=f+1|0;}d=c[j>>2]|0;if(d>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=41;}d=c[j>>2]|0;if(d>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;d=c[j>>2]|0;}a[d>>0]=0;d=c[m>>2]|0;c[j>>2]=d;ec(b,66901,d);d=i;}oA(m);}l=n;return}function _b(a){a=a|0;dc((c[a+16>>2]|0)+16|0);ec(a,75834,193758);return}function $b(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+1040|0;j=k;i=k+16|0;h=c[11416+(c[(c[b+16>>2]|0)+12>>2]<<2)>>2]|0;g=h+4|0;b=c[g>>2]|0;if(b>>>0>=(c[h+8>>2]|0)>>>0){lA(h,1)|0;b=c[g>>2]|0;}c[g>>2]=b+1;a[b>>0]=d;c[j>>2]=f;m4(i,66846,j)|0;nA(h,i)|0;b=0;while(1){if((b|0)>=(f|0))break;i=e+(b<<4)|0;c[j>>2]=c[i>>2];c[j+4>>2]=c[i+4>>2];c[j+8>>2]=c[i+8>>2];c[j+12>>2]=c[i+12>>2];ac(h,j);b=b+1|0;}l=k;return}function ac(a,b){a=a|0;b=b|0;var c=0,d=0;c=l;l=l+1024|0;d=c;bc(d,+h[b>>3]);nA(a,d)|0;bc(d,+vL(+h[b+8>>3]));nA(a,d)|0;l=c;return}function bc(a,b){a=a|0;b=+b;var c=0,d=0;c=l;l=l+16|0;d=c;h[d>>3]=b>-1.0e-08&b<1.0e-08?0.0:b;m4(a,66851,d)|0;cc(a,1);l=c;return}function cc(b,c){b=b|0;c=c|0;var d=0,e=0;d=R2(b,46)|0;if(!d){if(c|0){d=b+(l2(b)|0)|0;e=10;}}else {while(1){b=d+1|0;if(!(a[b>>0]|0))break;else d=b;}a:while(1){switch(a[d>>0]|0){case 46:{e=5;break a}case 48:break;default:{e=6;break a}}a[d>>0]=0;d=d+-1|0;}if((e|0)==5)a[d>>0]=0;else if((e|0)==6)d=d+1|0;if(c|0)e=10;}if((e|0)==10){a[d>>0]=32;a[d+1>>0]=0;}return}function dc(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;i=j+16|0;h=j;e=a[b+3>>0]|0;f=d[b>>0]|0;g=d[b+1>>0]|0;b=d[b+2>>0]|0;if(e<<24>>24==-1){c[h>>2]=f;c[h+4>>2]=g;c[h+8>>2]=b;m4(193758,75714,h)|0;}else {c[i>>2]=f;c[i+4>>2]=g;c[i+8>>2]=b;c[i+12>>2]=e&255;m4(193758,66864,i)|0;}l=j;return}function ec(a,b,d){a=a|0;b=b|0;d=d|0;fc(c[11416+(c[(c[a+16>>2]|0)+12>>2]<<2)>>2]|0,b,d);return}function fc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+1040|0;h=f;g=f+8|0;i=l2(e)|0;c[h>>2]=d;c[h+4>>2]=i;m4(g,66857,h)|0;nA(b,g)|0;nA(b,e)|0;e=b+4|0;d=c[e>>2]|0;if(d>>>0>=(c[b+8>>2]|0)>>>0){lA(b,1)|0;d=c[e>>2]|0;}c[e>>2]=d+1;a[d>>0]=32;l=f;return}function gc(b,d,f,i){b=b|0;d=d|0;f=f|0;i=i|0;var j=0.0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0;x=l;l=l+1120|0;t=x+64|0;w=x+80|0;k=x+32|0;r=x+16|0;s=x;u=c[b+16>>2]|0;j=+(c[u+136>>2]|0)*.017453292519943295;if((e[(c[46690]|0)+8232>>1]|0)<14)hc(b);else {kA(w,1024,x+96|0);v=(d|0)==2;if(v){pQ(f,k,i,j,2);f=w+4|0;d=c[f>>2]|0;if(d>>>0>=(c[w+8>>2]|0)>>>0){lA(w,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=91;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];ac(w,t);s=k+16|0;c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];ac(w,t);}else {pQ(f,k,i,0.0,3);q=+h[k+24>>3];o=+h[k>>3];if(j==0.0){n=+h[k+8>>3];p=q*.25;j=n;m=o;}else {p=q*.25;y=p;m=+E(+j)*y+o;n=+h[k+8>>3];j=+F(+j)*y+n;}h[r>>3]=m;h[r+8>>3]=j;h[s>>3]=o;h[s+8>>3]=n;f=w+4|0;d=c[f>>2]|0;if(d>>>0>=(c[w+8>>2]|0)>>>0){lA(w,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=40;c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];ac(w,t);ic(w,p);c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];ac(w,t);ic(w,q);}nA(w,66907)|0;d=u+140|0;j=+g[d>>2];f=u+56|0;if(j>0.0){jc(w,j,f);jc(w,+g[d>>2],u+96|0);}else {jc(w,0.0,f);jc(w,1.0,u+96|0);}pA(w)|0;k=w+4|0;d=c[k>>2]|0;i=w+8|0;f=d>>>0>=(c[i>>2]|0)>>>0;if(v){if(f){lA(w,1)|0;d=c[k>>2]|0;}c[k>>2]=d+1;a[d>>0]=93;}else {if(f){lA(w,1)|0;d=c[k>>2]|0;}c[k>>2]=d+1;a[d>>0]=41;}d=c[k>>2]|0;if(d>>>0>=(c[i>>2]|0)>>>0){lA(w,1)|0;d=c[k>>2]|0;}a[d>>0]=0;v=c[w>>2]|0;c[k>>2]=v;ec(b,66904,v);oA(w);}l=x;return}function hc(a){a=a|0;dc((c[a+16>>2]|0)+56|0);ec(a,66904,193758);return}function ic(a,b){a=a|0;b=+b;var c=0,d=0;c=l;l=l+1024|0;d=c;bc(d,b);nA(a,d)|0;l=c;return}function jc(a,b,c){a=a|0;b=+b;c=c|0;var d=0,e=0,f=0;d=l;l=l+1040|0;f=d;e=d+8|0;h[f>>3]=b;m4(e,94168,f)|0;cc(e,1);dc(c);fc(a,e,193758);l=d;return}function kc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0;e=l;l=l+1040|0;i=e;f=e+16|0;g=c[11416+(c[(c[a+16>>2]|0)+12>>2]<<2)>>2]|0;nA(g,67013)|0;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];ac(g,i);bc(f,+h[d+16>>3]-+h[d>>3]);nA(g,f)|0;bc(f,+h[d+24>>3]-+h[d+8>>3]);nA(g,f)|0;ec(a,195059,c[b+8>>2]|0);l=e;return}function lc(a){a=a|0;var b=0;switch(c[a+64>>2]|0){case 0:{b=AF(c[a>>2]|0)|0;oG(b,c[(c[a+16>>2]|0)+8>>2]|0,67797,0)|0;BF(b);break}case 1:{JL(c[(c[a>>2]|0)+168>>2]|0);break}default:{}}return}function mc(b){b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;d=f;e=c[(c[b+16>>2]|0)+8>>2]|0;if(!(c[46703]|0)){c[46703]=c[4678];c[46704]=57;c[46705]=19;}c[(c[e+64>>2]|0)+8>>2]=186812;nc(e,1);c[d>>2]=0;a[d+4>>0]=(a[(c[e+16>>2]|0)+115>>0]|0)==1&1;g=c[b+64>>2]|0;a[d+5>>0]=((g|0)==0|(g|0)==3)&1;a[d+6>>0]=0;oc(e,b,1,d);l=f;return}function nc(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=c[a>>2]&-9;d=OD(a)|0;while(1){if(!d)break;nc(d,0);d=PD(d)|0;}a:do if(b|0){b=jC(a)|0;while(1){if(!b)break a;c[b>>2]=c[b>>2]&-9;d=XA(a,b)|0;while(1){if(!d)break;c[d>>2]=c[d>>2]&-9;d=ZA(a,d)|0;}b=kC(a,b)|0;}}while(0);return}function oc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q+8|0;o=q;n=(d|0)!=0;if(n){m=Vz(11836,c[4581]|0)|0;YC(a,1,141060,12,0);YC(a,2,141060,12,0);YC(a,0,141060,-12,0);f=pc(a,0,m)|0;j=jC(a)|0;i=0;g=0;while(1){if(!j)break;if(!(Q2(KB(j)|0,108006,7)|0)){k=g;g=qc(m,KB(j)|0)|0;}else {k=g+1|0;g=g+f|0;}c[(RC(j,141060,0)|0)+8>>2]=g;h=XA(a,j)|0;g=i;while(1){if(!h)break;c[(RC(h,141060,0)|0)+8>>2]=g;h=ZA(a,h)|0;g=g+1|0;}j=kC(a,j)|0;i=g;g=k;}Rz(m)|0;}else f=0;m=c[e>>2]|0;c[e>>2]=m+1;rc(b,m);oF(b,97374)|0;sc(a,b,d,e);tc(a,b,e);oF(b,97345)|0;rc(b,c[e>>2]|0);if(n){c[o>>2]=f;uF(b,67016,o);}else {c[p>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67036,p);}vc(a,b,d,uc(a,b,d,e)|0,e);wc(a,b,d,e);oF(b,153599)|0;p=(c[e>>2]|0)+-1|0;c[e>>2]=p;rc(b,p);if(n)oF(b,111008)|0;else oF(b,75357)|0;l=q;return}function pc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if((yC(a)|0)!=(a|0)){e=b+1|0;c[(RC(a,141060,0)|0)+8>>2]=b;if(!(Q2(KB(a)|0,108006,7)|0)){b=KB(a)|0;Ic(d,b,c[(RC(a,141060,0)|0)+8>>2]|0);b=e;}else b=e;}e=OD(a)|0;while(1){if(!e)break;a=pc(e,b,d)|0;e=PD(e)|0;b=a;}return b|0}function qc(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b,512)|0;if(!a)a=-1;else a=c[a+12>>2]|0;return a|0}function rc(a,b){a=a|0;b=b|0;while(1){if((b|0)<=0)break;oF(a,90574)|0;b=b+-1|0;}return}function sc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=l;l=l+32|0;g=h+16|0;f=h+8|0;i=h;j=KB(a)|0;rc(b,c[e>>2]|0);c[i>>2]=zc(j,e)|0;uF(b,67124,i);if(d|0){oF(b,97345)|0;rc(b,c[e>>2]|0);j=(xB(a)|0)!=0;c[f>>2]=j?107652:137308;uF(b,67738,f);rc(b,c[e>>2]|0);j=(zB(a)|0)!=0;c[g>>2]=j?107652:137308;uF(b,67755,g);}l=h;return}function tc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;m=o;i=yC(b)|0;j=c[b>>2]&3;f=LA(i,j,0)|0;a:do if(f|0){k=e+5|0;while(1){if(!f)break a;g=RA(b,f)|0;do if(g|0){h=f+8|0;if(!(a[g>>0]|0)){g=c[h>>2]|0;if((a[g>>0]|0)!=108)break;if(s2(g,108224)|0)break}oF(d,97345)|0;rc(d,c[e>>2]|0);c[m>>2]=zc(c[h>>2]|0,e)|0;uF(d,67174,m);if(a[k>>0]|0?Bc(c[h>>2]|0)|0:0){Cc(RA(b,f)|0,d,e);break}c[n>>2]=zc(RA(b,f)|0,e)|0;uF(d,67181,n);}while(0);f=LA(i,j,f)|0;}}while(0);l=o;return}function uc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;f=OD(a)|0;if(f){oF(b,97345)|0;g=c[e>>2]|0;c[e>>2]=g+1;rc(b,g);g=(d|0)!=0;if(g){oF(b,67098)|0;a=0;d=f;}else {oF(b,67158)|0;rc(b,c[e>>2]|0);a=0;d=f;}while(1){if(!d)break;if(!a)a=1;else oF(b,97345)|0;if(g)Ac(d,b,e);else {c[h>>2]=c[(RC(d,141060,0)|0)+8>>2];uF(b,137395,h);}d=PD(d)|0;}if(g)a=1;else {c[e>>2]=(c[e>>2]|0)+-1;oF(b,153599)|0;rc(b,c[e>>2]|0);oF(b,97340)|0;a=1;}}else a=0;l=i;return a|0}function vc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=jC(a)|0;if(!g){if((d|0)!=0&(e|0)!=0){c[f>>2]=(c[f>>2]|0)+-1;oF(b,153599)|0;rc(b,c[f>>2]|0);oF(b,97340)|0;}}else {oF(b,97345)|0;h=(d|0)!=0;if(h)if(!e){e=c[f>>2]|0;c[f>>2]=e+1;rc(b,e);oF(b,67098)|0;e=0;}else e=0;else {e=c[f>>2]|0;c[f>>2]=e+1;rc(b,e);oF(b,67112)|0;rc(b,c[f>>2]|0);e=0;}while(1){if(!g)break;if(Q2(KB(g)|0,108006,7)|0){do if(e)if(h){oF(b,97345)|0;break}else {oF(b,100999)|0;break}else e=1;while(0);yc(g,b,d,f);}g=kC(a,g)|0;}c[f>>2]=(c[f>>2]|0)+-1;oF(b,153599)|0;rc(b,c[f>>2]|0);oF(b,97340)|0;}return}function wc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=jC(a)|0;a:do if(f|0){while(1){if(!f)break a;if(XA(a,f)|0)break;f=kC(a,f)|0;}oF(b,97345)|0;i=c[e>>2]|0;c[e>>2]=i+1;rc(b,i);oF(b,67048)|0;i=(d|0)!=0;if(i)g=0;else {rc(b,c[e>>2]|0);g=0;}while(1){if(!f)break;h=XA(a,f)|0;while(1){if(!h)break;do if(g)if(i){oF(b,97345)|0;break}else {oF(b,100999)|0;break}else g=1;while(0);xc(h,b,d,e);h=ZA(a,h)|0;}f=kC(a,f)|0;}c[e>>2]=(c[e>>2]|0)+-1;oF(b,153599)|0;rc(b,c[e>>2]|0);oF(b,97340)|0;}while(0);return}function xc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;i=j+24|0;h=j+16|0;g=j+8|0;f=j;if(!d){c[i>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,137395,i);}else {i=c[e>>2]|0;c[e>>2]=i+1;rc(b,i);oF(b,97374)|0;rc(b,c[e>>2]|0);c[f>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67060,f);rc(b,c[e>>2]|0);c[g>>2]=c[(RC(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0,141060,0)|0)+8>>2];uF(b,67074,g);rc(b,c[e>>2]|0);c[h>>2]=c[(RC(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0,141060,0)|0)+8>>2];uF(b,67087,h);tc(a,b,e);oF(b,153599)|0;i=(c[e>>2]|0)+-1|0;c[e>>2]=i;rc(b,i);oF(b,75357)|0;}l=j;return}function yc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i+16|0;g=i+8|0;f=i;if(!d){c[h>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,137395,h);}else {h=c[e>>2]|0;c[e>>2]=h+1;rc(b,h);oF(b,97374)|0;rc(b,c[e>>2]|0);c[f>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67060,f);rc(b,c[e>>2]|0);c[g>>2]=zc(KB(a)|0,e)|0;uF(b,67124,g);tc(a,b,e);oF(b,153599)|0;h=(c[e>>2]|0)+-1|0;c[e>>2]=h;rc(b,h);oF(b,75357)|0;}l=i;return}function zc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=d+4|0;if(a[g>>0]|0)b=eQ(b)|0;if(!(c[46706]|0)){kA(186824,1024,0);e=b;}else e=b;a:while(1){f=a[e>>0]|0;switch(f<<24>>24){case 0:break a;case 34:{nA(186824,67137)|0;break}case 92:{nA(186824,96616)|0;break}case 47:{nA(186824,67140)|0;break}case 8:{nA(186824,67143)|0;break}case 12:{nA(186824,67146)|0;break}case 10:{nA(186824,67149)|0;break}case 13:{nA(186824,67152)|0;break}case 9:{nA(186824,67155)|0;break}default:{d=c[46707]|0;if(d>>>0>=(c[46708]|0)>>>0){lA(186824,1)|0;d=c[46707]|0;}c[46707]=d+1;a[d>>0]=f;}}e=e+1|0;}d=c[46707]|0;if(d>>>0>=(c[46708]|0)>>>0){lA(186824,1)|0;d=c[46707]|0;}a[d>>0]=0;d=c[46706]|0;c[46707]=d;if(a[g>>0]|0)U1(b);return d|0}function Ac(a,b,c){a=a|0;b=b|0;c=c|0;oc(a,b,0,c);a=OD(a)|0;while(1){if(!a)break;oF(b,97345)|0;Ac(a,b,c);a=PD(a)|0;}return}function Bc(b){b=b|0;var c=0;c=b+1|0;a:do if((a[b>>0]|0)==95){b=(a[c>>0]|0)+-100<<24>>24;switch(((b&255)>>>2|b<<6&255)<<24>>24){case 0:{if(!(s2(c,67695)|0)){b=1;break a}break}case 2:{if(!(s2(c,67701)|0)){b=1;break a}break}case 1:{if(!(s2(c,67708)|0)){b=1;break a}return (s2(c,67722)|0)==0|0}case 4:{if(!(s2(c,67715)|0)){b=1;break a}b=(s2(c,67730)|0)==0&1;break a}default:{b=0;break a}}b=0;}else b=0;while(0);return b|0}function Cc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i;do if(b|0?a[b>>0]|0:0){h=DH(b)|0;if(!h){c[f>>2]=b;gA(0,67186,f)|0;break}oF(d,153599)|0;g=c[e>>2]|0;c[e>>2]=g+1;rc(d,g);oF(d,67213)|0;g=h+8|0;b=0;f=0;while(1){if((f|0)>=(c[h>>2]|0))break;if(!b)b=1;else oF(d,97345)|0;Dc((c[g>>2]|0)+(f*80|0)|0,d,e);f=f+1|0;}c[e>>2]=(c[e>>2]|0)+-1;oF(d,153599)|0;rc(d,c[e>>2]|0);oF(d,97340)|0;EH(h);}while(0);l=i;return}function Dc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0;A=l;l=l+240|0;y=A+224|0;x=A+216|0;w=A+208|0;v=A+200|0;u=A+192|0;t=A+184|0;s=A+176|0;r=A+152|0;q=A+136|0;p=A+128|0;o=A+112|0;n=A+104|0;m=A+96|0;k=A+88|0;j=A+72|0;i=A+48|0;z=A+40|0;g=A+8|0;f=A;e=c[d>>2]|0;c[d>>2]=e+1;rc(b,e);oF(b,97374)|0;rc(b,c[d>>2]|0);e=c[a>>2]|0;a:do switch(e|0){case 1:case 0:{c[f>>2]=(e|0)==0?69:101;uF(b,67216,f);rc(b,c[d>>2]|0);D=+h[a+16>>3];C=+h[a+24>>3];B=+h[a+32>>3];h[g>>3]=+h[a+8>>3];h[g+8>>3]=D;h[g+16>>3]=C;h[g+24>>3]=B;uF(b,67229,g);break}case 3:case 2:{c[z>>2]=(e|0)==2?80:112;uF(b,67216,z);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 5:case 4:{c[i>>2]=(e|0)==4?66:98;uF(b,67216,i);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 6:{uF(b,67264,A+56|0);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 7:{uF(b,67276,A+64|0);rc(b,c[d>>2]|0);D=+h[a+16>>3];h[j>>3]=+h[a+8>>3];h[j+8>>3]=D;uF(b,67288,j);rc(b,c[d>>2]|0);z=c[a+24>>2]|0;c[k>>2]=(z|0)==0?108:(z|0)==1?99:114;uF(b,67310,k);rc(b,c[d>>2]|0);h[m>>3]=+h[a+32>>3];uF(b,67326,m);rc(b,c[d>>2]|0);c[n>>2]=zc(c[a+40>>2]|0,d)|0;uF(b,67343,n);break}case 9:case 8:{c[o>>2]=(e|0)==8?67:99;uF(b,67216,o);rc(b,c[d>>2]|0);uF(b,67357,A+120|0);rc(b,c[d>>2]|0);c[p>>2]=zc(c[a+8>>2]|0,d)|0;uF(b,67374,p);break}case 13:case 14:{c[q>>2]=(e|0)==13?67:99;uF(b,67216,q);rc(b,c[d>>2]|0);switch(c[a+8>>2]|0){case 0:{uF(b,67357,A+144|0);rc(b,c[d>>2]|0);c[r>>2]=zc(c[a+16>>2]|0,d)|0;uF(b,67374,r);break a}case 1:{uF(b,67389,A+160|0);rc(b,c[d>>2]|0);Fc(b,a+16|0,d);break a}default:{uF(b,67408,A+168|0);rc(b,c[d>>2]|0);Gc(b,a+16|0,d);break a}}}case 10:{uF(b,67427,s);rc(b,c[d>>2]|0);h[t>>3]=+h[a+8>>3];uF(b,67439,t);rc(b,c[d>>2]|0);c[u>>2]=zc(c[a+16>>2]|0,d)|0;uF(b,67455,u);break}case 11:{uF(b,67469,v);rc(b,c[d>>2]|0);c[w>>2]=zc(c[a+8>>2]|0,d)|0;uF(b,67481,w);break}case 15:{uF(b,67496,x);rc(b,c[d>>2]|0);c[y>>2]=c[a+8>>2];uF(b,67508,y);break}default:{}}while(0);z=(c[d>>2]|0)+-1|0;c[d>>2]=z;rc(b,z);oF(b,75357)|0;l=A;return}function Ec(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0.0;j=l;l=l+48|0;i=j+32|0;g=j+16|0;f=j+8|0;e=c[b>>2]|0;d=c[b+4>>2]|0;uF(a,67669,j);b=0;while(1){if((b|0)>=(e|0))break;if((b|0)>0)uF(a,100999,f);k=+h[d+(b*24|0)+8>>3];h[g>>3]=+h[d+(b*24|0)>>3];h[g+8>>3]=k;uF(a,67681,g);b=b+1|0;}uF(a,67622,i);l=j;return}function Fc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0;e=l;l=l+32|0;f=e+16|0;i=e;rc(a,c[d>>2]|0);g=+h[b+8>>3];h[i>>3]=+h[b>>3];h[i+8>>3]=g;uF(a,67625,i);rc(a,c[d>>2]|0);g=+h[b+24>>3];h[f>>3]=+h[b+16>>3];h[f+8>>3]=g;uF(a,67647,f);rc(a,c[d>>2]|0);Hc(a,c[b+32>>2]|0,c[b+36>>2]|0,d);l=e;return}function Gc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0;e=l;l=l+48|0;f=e+24|0;j=e;rc(a,c[d>>2]|0);g=+h[b+8>>3];i=+h[b+16>>3];h[j>>3]=+h[b>>3];h[j+8>>3]=g;h[j+16>>3]=i;uF(a,67524,j);rc(a,c[d>>2]|0);i=+h[b+32>>3];g=+h[b+40>>3];h[f>>3]=+h[b+24>>3];h[f+8>>3]=i;h[f+16>>3]=g;uF(a,67552,f);rc(a,c[d>>2]|0);Hc(a,c[b+48>>2]|0,c[b+52>>2]|0,d);l=e;return}function Hc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0.0;m=l;l=l+48|0;k=m+32|0;j=m+16|0;i=m+8|0;uF(a,67580,m);f=0;while(1){if((f|0)>=(b|0))break;if((f|0)>0)uF(a,100999,i);o=+g[d+(f<<3)>>2];n=zc(c[d+(f<<3)+4>>2]|0,e)|0;h[j>>3]=o;c[j+8>>2]=n;uF(a,67591,j);f=f+1|0;}uF(a,67622,k);l=m;return}function Ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=nb[c[a>>2]&63](a,b,512)|0;if(e){if((c[e+12>>2]|0)!=(d|0)){c[f>>2]=b;gA(0,67768,f)|0;}}else {f=V1(1,16)|0;c[f+8>>2]=D4(b)|0;c[f+12>>2]=d;nb[c[a>>2]&63](a,f,1)|0;}l=g;return}function Jc(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+8>>2]|0);U1(b);return}function Kc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;oF(a,68623)|0;j=c[c[a+12>>2]>>2]|0;i=c[j+4>>2]|0;h=c[j+8>>2]|0;c[g>>2]=c[j>>2];c[g+4>>2]=i;c[g+8>>2]=h;uF(a,68633,g);c[e>>2]=KB(c[f+8>>2]|0)|0;uF(a,68668,e);c[d>>2]=O(c[a+168>>2]|0,c[a+164>>2]|0)|0;uF(a,68681,d);oF(a,68694)|0;oF(a,68704)|0;oF(a,68712)|0;oF(a,68720)|0;oF(a,68728)|0;oF(a,68736)|0;oF(a,68744)|0;oF(a,68748)|0;oF(a,68753)|0;l=b;return}function Lc(a){a=a|0;oF(a,68604)|0;return}function Mc(a){a=a|0;c[46710]=2;return}function Nc(a){a=a|0;c[46710]=1;return}function Oc(a){a=a|0;c[46710]=2;return}function Pc(a){a=a|0;c[46710]=0;return}function Qc(a){a=a|0;c[46710]=2;return}function Rc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0;p=l;l=l+80|0;o=p;m=c[(c[b+16>>2]|0)+16>>2]|0;n=c[46710]|0;f=c[e+4>>2]|0;g=+h[b+352>>3]*+h[f+16>>3];i=c[b+360>>2]|0?1.5707963267948966:0.0;j=c[e>>2]|0;k=g*.3333333333333333*+((l2(j)|0)>>>0);f=c[f+8>>2]|0;if(!f)f=-1;else f=c[f+20>>2]|0;s=a[e+48>>0]|0;r=+h[d>>3];q=+h[d+8>>3];e=$c(j)|0;c[o>>2]=4;c[o+4>>2]=s<<24>>24==108?0:s<<24>>24==114?2:1;c[o+8>>2]=m;c[o+12>>2]=n;c[o+16>>2]=0;c[o+20>>2]=f;h[o+24>>3]=g;h[o+32>>3]=i;c[o+40>>2]=6;h[o+48>>3]=g;h[o+56>>3]=k;c[o+64>>2]=~~(r+(r>=0.0?.5:-.5));c[o+68>>2]=~~(q+(q+-72.0>=0.0?-71.5:-72.5));c[o+72>>2]=e;uF(b,68549,o);l=p;return}function Sc(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;j=n;i=n+20|0;m=e+32|0;a:do switch(c[m>>2]|0){case 5:{f=0;while(1){g=c[12724+(f<<2)>>2]|0;if((f|0)==8)break a;h=c[e>>2]|0;if((a[g>>0]|0)==(a[h>>0]|0)?(s2(g,h)|0)==0:0){k=10;break a}f=f+1|0;}}case 1:{g=e+1|0;h=e+2|0;f=(_c(i,d[e>>0]|0,d[g>>0]|0,d[h>>0]|0)|0)+32|0;if(!(c[i>>2]|0))k=10;else {o=d[e>>0]|0;i=d[g>>0]|0;k=d[h>>0]|0;c[j>>2]=0;c[j+4>>2]=f;c[j+8>>2]=o;c[j+12>>2]=i;c[j+16>>2]=k;uF(b,68492,j);k=10;}break}default:qa(138394,67889,163,67920);}while(0);if((k|0)==10)c[e>>2]=f;c[m>>2]=6;l=n;return}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+112|0;f=e+8|0;u=e+104|0;t=e;k=c[a+16>>2]|0;s=~~+h[k+152>>3];r=c[k+16>>2]|0;q=c[k+56>>2]|0;p=c[46710]|0;Yc(k,u,t);n=+h[b>>3];k=~~(n+(n>=0.0?.5:-.5));m=+h[b+8>>3];j=~~(m+(m>=0.0?.5:-.5));i=+h[b+16>>3];n=i-n;g=+h[b+24>>3];m=g-m;b=c[u>>2]|0;o=+h[t>>3];c[f>>2]=1;c[f+4>>2]=1;c[f+8>>2]=b;c[f+12>>2]=s;c[f+16>>2]=r;c[f+20>>2]=q;c[f+24>>2]=p;c[f+28>>2]=0;c[f+32>>2]=d|0?20:-1;h[f+40>>3]=o;c[f+48>>2]=0;h[f+56>>3]=0.0;c[f+64>>2]=k;c[f+68>>2]=j;c[f+72>>2]=~~(n+(n>=0.0?.5:-.5));c[f+76>>2]=~~(m+(m>=0.0?.5:-.5));c[f+80>>2]=k;c[f+84>>2]=j;c[f+88>>2]=~~(i+(i>=0.0?.5:-.5));c[f+92>>2]=~~(g+(g>=0.0?.5:-.5));uF(a,68427,f);l=e;return}function Uc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;f=l;l=l+96|0;g=f+8|0;o=f+80|0;p=f;q=c[a+16>>2]|0;n=~~+h[q+152>>3];m=c[q+16>>2]|0;k=c[q+56>>2]|0;j=c[46710]|0;Yc(q,o,p);o=c[o>>2]|0;i=+h[p>>3];c[g>>2]=2;c[g+4>>2]=3;c[g+8>>2]=o;c[g+12>>2]=n;c[g+16>>2]=m;c[g+20>>2]=k;c[g+24>>2]=j;c[g+28>>2]=0;c[g+32>>2]=e|0?20:-1;h[g+40>>3]=i;c[g+48>>2]=0;c[g+52>>2]=0;c[g+56>>2]=0;c[g+60>>2]=0;c[g+64>>2]=0;c[g+68>>2]=d+1;uF(a,68331,g);Zc(a,b,d,1);l=f;return}function Vc(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0;C=l;l=l+192|0;B=C+176|0;z=C+168|0;A=C+104|0;y=C+96|0;i=C+88|0;u=C+180|0;v=C+80|0;w=C+16|0;x=C;f=a+16|0;e=c[f>>2]|0;q=~~+h[e+152>>3];r=c[e+16>>2]|0;s=c[46710]|0;if((d|0)<=3)qa(67882,67889,360,67909);t=T1((d*140|0)+140|0)|0;Yc(e,u,v);if(!g){o=4;j=0;k=-1;}else {o=5;j=c[(c[f>>2]|0)+56>>2]|0;k=20;}E=+h[b>>3];n=w+48|0;h[n>>3]=E;D=+h[b+8>>3];h[w+56>>3]=D;c[i>>2]=~~(E+(E>=0.0?.5:-.5));c[i+4>>2]=~~(D+(D>=0.0?.5:-.5));m=x+8|0;e=t+(m4(t,81099,i)|0)|0;p=1;g=0;while(1){i=g+3|0;if((i|0)>=(d|0))break;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];f=1;while(1){if((f|0)==4){f=1;break}F=f+g|0;h[w+(f<<4)>>3]=+h[b+(F<<4)>>3];h[w+(f<<4)+8>>3]=+h[b+(F<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(x,w,3,+(f|0)*.16666666666666666,0,0);D=+h[x>>3];E=+h[m>>3];c[y>>2]=~~(D+(D>=0.0?.5:-.5));c[y+4>>2]=~~(E+(E>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,y)|0)|0;}p=p+6|0;g=i;}f=c[u>>2]|0;E=+h[v>>3];c[A>>2]=3;c[A+4>>2]=o;c[A+8>>2]=f;c[A+12>>2]=q;c[A+16>>2]=r;c[A+20>>2]=j;c[A+24>>2]=s;c[A+28>>2]=0;c[A+32>>2]=k;h[A+40>>3]=E;c[A+48>>2]=0;c[A+52>>2]=0;c[A+56>>2]=0;c[A+60>>2]=p;uF(a,68382,A);c[z>>2]=t;uF(a,81106,z);U1(t);f=p+-1|0;e=0;while(1){if((e|0)>=(p|0))break;c[B>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,B);e=e+1|0;}oF(a,153599)|0;l=C;return}function Wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;e=l;l=l+96|0;f=e+8|0;m=e+80|0;n=e;o=c[a+16>>2]|0;k=~~+h[o+152>>3];j=c[o+16>>2]|0;i=c[46710]|0;Yc(o,m,n);m=c[m>>2]|0;g=+h[n>>3];c[f>>2]=2;c[f+4>>2]=1;c[f+8>>2]=m;c[f+12>>2]=k;c[f+16>>2]=j;c[f+20>>2]=0;c[f+24>>2]=i;c[f+28>>2]=0;c[f+32>>2]=0;h[f+40>>3]=g;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=d;uF(a,68331,f);Zc(a,b,d,0);l=e;return}function Xc(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,68325,e);l=d;return}function Yc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function Zc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function _c(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[a>>2]=0;k=c[46711]|0;h=195075;g=0;i=-1;while(1){if((g|0)>=(k|0)){l=6;break}m=(b[190680+(g<<1)>>1]|0)-d|0;n=(b[191192+(g<<1)>>1]|0)-e|0;j=(b[191704+(g<<1)>>1]|0)-f|0;j=(O(n,n)|0)+(O(m,m)|0)+(O(j,j)|0)|0;if((j|0)<(h|0))if(!j)break;else {h=j;i=g;}g=g+1|0;}if((l|0)==6){c[46711]=k+1;if((k|0)==256)g=i;else {b[190680+(g<<1)>>1]=d;b[191192+(g<<1)>>1]=e;b[191704+(g<<1)>>1]=f;c[a>>2]=1;}}return g|0}function $c(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46712]|0;if(!d){c[46713]=64;d=T1(64)|0;c[46712]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46713]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46713]=d;d=W1(c[46712]|0,d)|0;c[46712]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46712]|0}function ad(b){b=b|0;var d=0,e=0,f=0;e=c[b+16>>2]|0;switch(c[b+64>>2]|0){case 0:{oF(b,68220)|0;d=e+208|0;e=c[d>>2]|0;if(e|0?a[e>>0]|0:0){oF(b,68234)|0;oF(b,FK(c[d>>2]|0)|0)|0;oF(b,153599)|0;}break}case 1:{d=e+208|0;f=c[d>>2]|0;if(f|0?a[f>>0]|0:0){oF(b,68234)|0;oF(b,FK(c[d>>2]|0)|0)|0;oF(b,102604)|0;oF(b,FK(KB(c[e+8>>2]|0)|0)|0)|0;oF(b,153599)|0;}break}case 3:{f=FK(KB(c[e+8>>2]|0)|0)|0;oF(b,68243)|0;oF(b,f)|0;oF(b,68253)|0;oF(b,f)|0;oF(b,68208)|0;break}default:{}}return}function bd(a){a=a|0;var b=0;b=c[a+16>>2]|0;switch(c[a+64>>2]|0){case 2:{dd(a,c[b+264>>2]|0,c[b+272>>2]|0,c[b+268>>2]|0,c[b+208>>2]|0,c[b+228>>2]|0,c[b+244>>2]|0,c[b+212>>2]|0);break}case 3:{dd(a,c[b+264>>2]|0,c[b+272>>2]|0,c[b+268>>2]|0,c[b+208>>2]|0,c[b+228>>2]|0,c[b+244>>2]|0,c[b+212>>2]|0);oF(a,68212)|0;break}default:{}}return}function cd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=c[a+16>>2]|0;dd(a,c[g+264>>2]|0,c[g+272>>2]|0,c[g+268>>2]|0,b,d,e,f);return}function dd(b,d,e,f,g,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0;y=l;l=l+128|0;x=y+120|0;u=y+112|0;t=y+96|0;s=y+80|0;r=y+56|0;w=y+48|0;q=y+40|0;v=y+24|0;p=y;a:do if((e|0)!=0&(f|0)!=0){m=f+10|0;if((c[46714]|0)<(f|0)){c[46714]=m;o=W1(c[46715]|0,m<<3)|0;c[46715]=o;}else o=c[46715]|0;m=0;while(1){if((m|0)>=(f|0))break;z=+h[e+(m<<4)>>3];c[o+(m<<3)>>2]=~~(z+(z>=0.0?.5:-.5));z=+h[e+(m<<4)+8>>3];c[o+(m<<3)+4>>2]=~~(z+(z>=0.0?.5:-.5));m=m+1|0;}n=b+64|0;m=c[n>>2]|0;e=(g|0)!=0;if(e&(m|0)==0){if(!(a[g>>0]|0))break;switch(d|0){case 0:{v=c[o>>2]|0;w=c[o+12>>2]|0;x=c[o+8>>2]|0;f=c[o+4>>2]|0;c[p>>2]=g;c[p+4>>2]=v;c[p+8>>2]=w;c[p+12>>2]=x;c[p+16>>2]=f;uF(b,67954,p);break a}case 1:{w=c[o>>2]|0;x=c[o+4>>2]|0;f=(c[o+8>>2]|0)-w|0;c[v>>2]=g;c[v+4>>2]=w;c[v+8>>2]=x;c[v+12>>2]=f;uF(b,67975,v);break a}case 2:{c[q>>2]=g;uF(b,67995,q);m=0;while(1){if((m|0)>=(f|0))break;v=c[46715]|0;x=c[v+(m<<3)+4>>2]|0;c[w>>2]=c[v+(m<<3)>>2];c[w+4>>2]=x;uF(b,68003,w);m=m+1|0;}oF(b,153599)|0;break a}default:qa(138394,68010,63,68030);}}if(e&(m|0)==1){if(!(a[g>>0]|0))break;if(!d){w=c[o+12>>2]|0;x=c[o+8>>2]|0;f=c[o+4>>2]|0;c[r>>2]=c[o>>2];c[r+4>>2]=w;c[r+8>>2]=x;c[r+12>>2]=f;c[r+16>>2]=g;c[r+20>>2]=i;uF(b,68047,r);break}else qa(138394,68010,75,68030);}if((m&-2|0)==2){switch(d|0){case 1:{oF(b,68080)|0;break}case 0:{oF(b,68101)|0;break}case 2:{oF(b,68120)|0;break}default:qa(138394,68010,91,68030);}if(k|0?a[k>>0]|0:0){oF(b,73600)|0;oF(b,IK(k)|0)|0;oF(b,98744)|0;}if(e?a[g>>0]|0:0){oF(b,68139)|0;oF(b,IK(g)|0)|0;oF(b,98744)|0;}if(j|0?a[j>>0]|0:0){oF(b,74559)|0;oF(b,FK(j)|0)|0;oF(b,98744)|0;}if(i|0?a[i>>0]|0:0){oF(b,68147)|0;oF(b,FK(i)|0)|0;oF(b,98744)|0;}oF(b,68156)|0;oF(b,68164)|0;b:do switch(d|0){case 1:{f=c[46715]|0;w=c[f>>2]|0;x=c[f+4>>2]|0;f=(c[f+8>>2]|0)-w|0;c[s>>2]=w;c[s+4>>2]=x;c[s+8>>2]=f;uF(b,68174,s);break}case 0:{v=c[46715]|0;w=c[v+12>>2]|0;x=c[v+8>>2]|0;f=c[v+4>>2]|0;c[t>>2]=c[v>>2];c[t+4>>2]=w;c[t+8>>2]=x;c[t+12>>2]=f;uF(b,68183,t);break}case 2:{w=c[46715]|0;m=c[w+4>>2]|0;c[u>>2]=c[w>>2];c[u+4>>2]=m;uF(b,68195,u);m=1;while(1){if((m|0)>=(f|0))break b;v=c[46715]|0;w=c[v+(m<<3)+4>>2]|0;c[x>>2]=c[v+(m<<3)>>2];c[x+4>>2]=w;uF(b,68201,x);m=m+1|0;}}default:{}}while(0);if((c[n>>2]|0)==3){oF(b,73424)|0;break}else {oF(b,68208)|0;break}}}while(0);l=y;return}function ed(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;oF(a,68623)|0;j=c[c[a+12>>2]>>2]|0;i=c[j+4>>2]|0;h=c[j+8>>2]|0;c[g>>2]=c[j>>2];c[g+4>>2]=i;c[g+8>>2]=h;uF(a,68633,g);c[e>>2]=KB(c[f+8>>2]|0)|0;uF(a,68668,e);c[d>>2]=O(c[a+168>>2]|0,c[a+164>>2]|0)|0;uF(a,68681,d);oF(a,68694)|0;oF(a,68704)|0;oF(a,68712)|0;oF(a,68720)|0;oF(a,68728)|0;oF(a,68736)|0;oF(a,68744)|0;oF(a,68748)|0;oF(a,68753)|0;l=b;return}function fd(a){a=a|0;oF(a,68604)|0;return}function gd(a){a=a|0;c[46716]=2;return}function hd(a){a=a|0;c[46716]=1;return}function id(a){a=a|0;c[46716]=2;return}function jd(a){a=a|0;c[46716]=0;return}function kd(a){a=a|0;c[46716]=2;return}function ld(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0;n=l;l=l+80|0;m=n;j=c[(c[b+16>>2]|0)+16>>2]|0;k=c[46716]|0;f=c[e+4>>2]|0;g=+h[b+352>>3]*+h[f+16>>3];i=c[b+360>>2]|0?1.5707963267948966:0.0;f=c[f+8>>2]|0;if(!f)f=-1;else f=c[f+20>>2]|0;q=a[e+48>>0]|0;p=+h[d>>3];o=+h[d+8>>3];e=vd(c[e>>2]|0)|0;c[m>>2]=4;c[m+4>>2]=q<<24>>24==108?0:q<<24>>24==114?2:1;c[m+8>>2]=j;c[m+12>>2]=k;c[m+16>>2]=0;c[m+20>>2]=f;h[m+24>>3]=g;h[m+32>>3]=i;c[m+40>>2]=4;h[m+48>>3]=0.0;h[m+56>>3]=0.0;c[m+64>>2]=~~(p+(p>=0.0?.5:-.5));c[m+68>>2]=~~(o+(o>=0.0?.5:-.5));c[m+72>>2]=e;uF(b,68549,m);l=n;return}function md(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;j=n;i=n+20|0;m=e+32|0;a:do switch(c[m>>2]|0){case 5:{f=0;while(1){g=c[12724+(f<<2)>>2]|0;if((f|0)==8)break a;h=c[e>>2]|0;if((a[g>>0]|0)==(a[h>>0]|0)?(s2(g,h)|0)==0:0){k=10;break a}f=f+1|0;}}case 1:{g=e+1|0;h=e+2|0;f=(ud(i,d[e>>0]|0,d[g>>0]|0,d[h>>0]|0)|0)+32|0;if(!(c[i>>2]|0))k=10;else {o=d[e>>0]|0;i=d[g>>0]|0;k=d[h>>0]|0;c[j>>2]=0;c[j+4>>2]=f;c[j+8>>2]=o;c[j+12>>2]=i;c[j+16>>2]=k;uF(b,68492,j);k=10;}break}case 0:{f=0;k=10;break}default:qa(138394,68513,168,68532);}while(0);if((k|0)==10)c[e>>2]=f;c[m>>2]=6;l=n;return}function nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+112|0;f=e+8|0;u=e+104|0;t=e;k=c[a+16>>2]|0;s=~~+h[k+152>>3];r=c[k+16>>2]|0;q=c[k+56>>2]|0;p=c[46716]|0;sd(k,u,t);n=+h[b>>3];k=~~(n+(n>=0.0?.5:-.5));m=+h[b+8>>3];j=~~(m+(m>=0.0?.5:-.5));i=+h[b+16>>3];n=i-n;g=+h[b+24>>3];m=g-m;b=c[u>>2]|0;o=+h[t>>3];c[f>>2]=1;c[f+4>>2]=1;c[f+8>>2]=b;c[f+12>>2]=s;c[f+16>>2]=r;c[f+20>>2]=q;c[f+24>>2]=p;c[f+28>>2]=0;c[f+32>>2]=d|0?20:-1;h[f+40>>3]=o;c[f+48>>2]=0;h[f+56>>3]=0.0;c[f+64>>2]=k;c[f+68>>2]=j;c[f+72>>2]=~~(n+(n>=0.0?.5:-.5));c[f+76>>2]=~~(m+(m>=0.0?.5:-.5));c[f+80>>2]=k;c[f+84>>2]=j;c[f+88>>2]=~~(i+(i>=0.0?.5:-.5));c[f+92>>2]=~~(g+(g>=0.0?.5:-.5));uF(a,68427,f);l=e;return}function od(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;f=l;l=l+96|0;g=f+8|0;o=f+80|0;p=f;q=c[a+16>>2]|0;n=~~+h[q+152>>3];m=c[q+16>>2]|0;k=c[q+56>>2]|0;j=c[46716]|0;sd(q,o,p);o=c[o>>2]|0;i=+h[p>>3];c[g>>2]=2;c[g+4>>2]=3;c[g+8>>2]=o;c[g+12>>2]=n;c[g+16>>2]=m;c[g+20>>2]=k;c[g+24>>2]=j;c[g+28>>2]=0;c[g+32>>2]=e|0?20:-1;h[g+40>>3]=i;c[g+48>>2]=0;c[g+52>>2]=0;c[g+56>>2]=0;c[g+60>>2]=0;c[g+64>>2]=0;c[g+68>>2]=d+1;uF(a,68331,g);td(a,b,d,1);l=f;return}function pd(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0;C=l;l=l+192|0;B=C+176|0;z=C+168|0;A=C+104|0;y=C+96|0;f=C+88|0;u=C+180|0;v=C+80|0;w=C+16|0;x=C;e=a+16|0;p=c[e>>2]|0;q=~~+h[p+152>>3];r=c[p+16>>2]|0;s=c[46716]|0;t=T1((d*140|0)+140|0)|0;sd(p,u,v);if(!g){o=4;j=0;k=-1;}else {o=5;j=c[(c[e>>2]|0)+56>>2]|0;k=20;}E=+h[b>>3];n=w+48|0;h[n>>3]=E;D=+h[b+8>>3];h[w+56>>3]=D;c[f>>2]=~~(E+(E>=0.0?.5:-.5));c[f+4>>2]=~~(D+(D>=0.0?.5:-.5));m=x+8|0;e=t+(m4(t,81099,f)|0)|0;p=1;g=0;while(1){i=g+3|0;if((i|0)>=(d|0))break;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];f=1;while(1){if((f|0)==4){f=1;break}F=f+g|0;h[w+(f<<4)>>3]=+h[b+(F<<4)>>3];h[w+(f<<4)+8>>3]=+h[b+(F<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(x,w,3,+(f|0)*.16666666666666666,0,0);D=+h[x>>3];E=+h[m>>3];c[y>>2]=~~(D+(D>=0.0?.5:-.5));c[y+4>>2]=~~(E+(E>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,y)|0)|0;}p=p+6|0;g=i;}f=c[u>>2]|0;E=+h[v>>3];c[A>>2]=3;c[A+4>>2]=o;c[A+8>>2]=f;c[A+12>>2]=q;c[A+16>>2]=r;c[A+20>>2]=j;c[A+24>>2]=s;c[A+28>>2]=0;c[A+32>>2]=k;h[A+40>>3]=E;c[A+48>>2]=0;c[A+52>>2]=0;c[A+56>>2]=0;c[A+60>>2]=p;uF(a,68382,A);c[z>>2]=t;uF(a,81106,z);U1(t);f=p+-1|0;e=0;while(1){if((e|0)>=(p|0))break;c[B>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,B);e=e+1|0;}oF(a,153599)|0;l=C;return}function qd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;e=l;l=l+96|0;f=e+8|0;m=e+80|0;n=e;o=c[a+16>>2]|0;k=~~+h[o+152>>3];j=c[o+16>>2]|0;i=c[46716]|0;sd(o,m,n);m=c[m>>2]|0;g=+h[n>>3];c[f>>2]=2;c[f+4>>2]=1;c[f+8>>2]=m;c[f+12>>2]=k;c[f+16>>2]=j;c[f+20>>2]=0;c[f+24>>2]=i;c[f+28>>2]=0;c[f+32>>2]=0;h[f+40>>3]=g;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=d;uF(a,68331,f);td(a,b,d,0);l=e;return}function rd(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,68325,e);l=d;return}function sd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function td(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function ud(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[a>>2]=0;k=c[46717]|0;h=195075;g=0;i=-1;while(1){if((g|0)>=(k|0)){l=6;break}m=(b[192216+(g<<1)>>1]|0)-d|0;n=(b[192728+(g<<1)>>1]|0)-e|0;j=(b[193240+(g<<1)>>1]|0)-f|0;j=(O(n,n)|0)+(O(m,m)|0)+(O(j,j)|0)|0;if((j|0)<(h|0))if(!j)break;else {h=j;i=g;}g=g+1|0;}if((l|0)==6){c[46717]=k+1;if((k|0)==256)g=i;else {b[192216+(g<<1)>>1]=d;b[192728+(g<<1)>>1]=e;b[193240+(g<<1)>>1]=f;c[a>>2]=1;}}return g|0}function vd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46718]|0;if(!d){c[46719]=64;d=T1(64)|0;c[46718]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46719]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46719]=d;d=W1(c[46718]|0,d)|0;c[46718]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46718]|0}function wd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=l;l=l+16|0;b=d;oF(a,73332)|0;if((c[a+64>>2]|0)==2)oF(a,73347)|0;else oF(a,153599)|0;g=c[c[a+12>>2]>>2]|0;f=c[g+4>>2]|0;e=c[g+8>>2]|0;c[b>>2]=c[g>>2];c[b+4>>2]=f;c[b+8>>2]=e;uF(a,73358,b);l=d;return}function xd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g+8|0;e=g;oF(a,73286)|0;d=a+64|0;b=a+12|0;if((c[d>>2]|0)!=2){c[e>>2]=c[(c[b>>2]|0)+28>>2];uF(a,73297,e);}if((c[(c[b>>2]|0)+20>>2]|0)==0?(c[d>>2]|0)!=2:0){b=c[a+476>>2]|0;d=c[a+480>>2]|0;e=c[a+484>>2]|0;c[f>>2]=c[a+472>>2];c[f+4>>2]=b;c[f+8>>2]=d;c[f+12>>2]=e;uF(a,69666,f);}oF(a,73312)|0;oF(a,73325)|0;l=g;return}function yd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;k=l;l=l+32|0;j=k+24|0;f=k+8|0;i=k;g=c[b+16>>2]|0;a[193768]=0;e=b+12|0;h=g+8|0;if(!(c[(c[e>>2]|0)+28>>2]|0)){c[i>>2]=KB(c[h>>2]|0)|0;uF(b,69597,i);d=b+64|0;if((c[d>>2]|0)==2)oF(b,69630)|0;else oF(b,69612)|0;do if(!(c[(c[e>>2]|0)+20>>2]|0))if((c[d>>2]|0)==2){n=c[b+460>>2]|0;m=c[b+464>>2]|0;d=c[b+468>>2]|0;c[f>>2]=c[b+456>>2];c[f+4>>2]=n;c[f+8>>2]=m;c[f+12>>2]=d;uF(b,69666,f);break}else {oF(b,69642)|0;break}while(0);oF(b,69696)|0;yM(b,c[(c[e>>2]|0)+24>>2]|0,13e3);AM(b);d=c[(c[e>>2]|0)+20>>2]|0;if(d|0){c[i>>2]=c[d>>2];c[i+4>>2]=0;yM(b,0,i);}}c[46720]=(a[(c[(c[h>>2]|0)+16>>2]|0)+115>>0]|0)==1?1:-1;if(!(a[193768]|0)){oF(b,69716)|0;a[193768]=1;}d=c[g+208>>2]|0;if(d|0){c[j>>2]=BM(d,c[46720]|0)|0;uF(b,69729,j);}l=k;return}function zd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;b=l;l=l+16|0;f=b;c[f>>2]=d;c[f+4>>2]=e;uF(a,69581,f);l=b;return}function Ad(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0.0,w=0.0;s=l;l=l+144|0;r=s+128|0;q=s+112|0;p=s+72|0;o=s+56|0;n=s+40|0;m=s+32|0;e=s+24|0;b=s+8|0;d=s;f=c[a+456>>2]|0;j=c[a+460>>2]|0;g=c[a+464>>2]|0;i=c[a+468>>2]|0;k=a+12|0;t=(c[(c[k>>2]|0)+28>>2]|0)+1|0;c[d>>2]=t;c[d+4>>2]=t;uF(a,69208,d);if(!(c[(c[k>>2]|0)+20>>2]|0)){c[b>>2]=f;c[b+4>>2]=j;c[b+8>>2]=g;c[b+12>>2]=i;uF(a,69225,b);}d=a+360|0;c[e>>2]=c[d>>2]|0?69259:69269;uF(a,69278,e);b=a+64|0;if((c[b>>2]|0)==1){c[m>>2]=g;c[m+4>>2]=i;uF(a,69303,m);}m=c[a+200>>2]|0;t=c[a+204>>2]|0;c[n>>2]=c[a+196>>2];c[n+4>>2]=m;c[n+8>>2]=t;uF(a,69342,n);if(!(c[(c[k>>2]|0)+20>>2]|0)){c[o>>2]=f;c[o+4>>2]=j;c[o+8>>2]=g-f;c[o+12>>2]=i-j;uF(a,69362,o);}w=+h[a+496>>3];t=c[d>>2]|0;v=+h[a+504>>3];u=+h[a+512>>3];h[p>>3]=+h[a+488>>3];h[p+8>>3]=w;c[p+16>>2]=t;h[p+24>>3]=v;h[p+32>>3]=u;uF(a,69402,p);if((c[b>>2]|0)==1){if((g|0)>14399|(i|0)>14399){t=c[(c[k>>2]|0)+16>>2]|0;c[q>>2]=g;c[q+4>>2]=i;c[q+8>>2]=14400;ub[t&63](69445,q);}c[r>>2]=f;c[r+4>>2]=j;c[r+8>>2]=g;c[r+12>>2]=i;uF(a,69540,r);}l=s;return}function Bd(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=a+12|0;if(c[(c[b>>2]|0)+20>>2]|0){oF(a,69132)|0;yM(a,0,(c[(c[b>>2]|0)+20>>2]|0)+4|0);}oF(a,69149)|0;oF(a,69176)|0;c[d>>2]=c[(c[b>>2]|0)+28>>2];uF(a,69191,d);l=e;return}function Cd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,69125,d);oF(a,69118)|0;l=b;return}function Dd(a){a=a|0;oF(a,84552)|0;return}function Ed(a){a=a|0;oF(a,69118)|0;return}function Fd(a){a=a|0;oF(a,84552)|0;return}function Gd(a){a=a|0;oF(a,69118)|0;return}function Hd(a){a=a|0;oF(a,84552)|0;return}function Id(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;e=l;l=l+16|0;d=e;if(b|0?(g=(c[a+16>>2]|0)+272|0,c[g>>2]|0):0){oF(a,69014)|0;yF(a,c[g>>2]|0,2);oF(a,69025)|0;c[d>>2]=BM(b,c[46720]|0)|0;uF(a,69029,d);}l=e;return}function Jd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+32|0;j=m+8|0;k=m;f=c[b+16>>2]|0;if(!(+h[f+40>>3]<.5)){Qd(b,f+16|0);i=e+4|0;vF(b,+h[(c[i>>2]|0)+16>>3]);c[j>>2]=c[c[i>>2]>>2];uF(b,68973,j);i=BM(c[e>>2]|0,c[46720]|0)|0;switch(a[e+48>>0]|0){case 114:{n=e+32|0;f=n;g=+h[n>>3];break}case 108:{f=e+32|0;g=0.0;break}default:{n=e+32|0;f=n;g=+h[n>>3]*.5;}}h[d>>3]=+h[d>>3]-g;n=d+8|0;h[n>>3]=+h[n>>3]+ +h[e+24>>3];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];xF(b,j);oF(b,68988)|0;vF(b,+h[f>>3]);c[k>>2]=i;uF(b,68997,k);}l=m;return}function Kd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+32|0;f=g;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];h[f+16>>3]=+h[b+16>>3]-+h[b>>3];h[f+24>>3]=+h[b+24>>3]-+h[b+8>>3];b=a+16|0;if(d|0?(e=c[b>>2]|0,+h[e+80>>3]>.5):0){Qd(a,e+56|0);yF(a,f,2);oF(a,68931)|0;}if(+h[(c[b>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[b>>2]|0)+16|0);yF(a,f,2);oF(a,68951)|0;}l=g;return}function Ld(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+16|0;i=j;g=a+16|0;if(e|0?(f=c[g>>2]|0,+h[f+80>>3]>.5):0){Qd(a,f+56|0);oF(a,68852)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];xF(a,i);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;f=b+(e<<4)|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];xF(a,i);oF(a,68870)|0;e=e+1|0;}oF(a,68897)|0;}if(+h[(c[g>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[g>>2]|0)+16|0);oF(a,68852)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];xF(a,i);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;g=b+(e<<4)|0;c[i>>2]=c[g>>2];c[i+4>>2]=c[g+4>>2];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];xF(a,i);oF(a,68870)|0;e=e+1|0;}oF(a,68913)|0;}l=j;return}function Md(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0;k=l;l=l+16|0;f=k;i=a+16|0;if(g|0?(j=c[i>>2]|0,+h[j+80>>3]>.5):0){Qd(a,j+56|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;yF(a,b+(e<<4)|0,3);oF(a,68887)|0;e=e+3|0;}oF(a,68897)|0;}if(+h[(c[i>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[i>>2]|0)+16|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;yF(a,b+(e<<4)|0,3);oF(a,68887)|0;e=e+3|0;}oF(a,68879)|0;}l=k;return}function Nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;g=l;l=l+16|0;f=g;e=a+16|0;if(+h[(c[e>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[e>>2]|0)+16|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;i=b+(e<<4)|0;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];xF(a,f);oF(a,68870)|0;e=e+1|0;}oF(a,68879)|0;}l=g;return}function Od(a,b){a=a|0;b=b|0;oF(a,68849)|0;oF(a,b)|0;oF(a,153599)|0;return}function Pd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;g=n+16|0;m=n+8|0;k=n;i=a+16|0;if(f|0?(j=c[i>>2]|0,+h[j+80>>3]>.5):0){Qd(a,j+56|0);oF(a,84447)|0;yF(a,d,e);oF(a,102604)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];xF(a,g);c[k>>2]=e;c[k+4>>2]=b;uF(a,68766,k);}if(+h[(c[i>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[i>>2]|0)+16|0);oF(a,84447)|0;yF(a,d,e);oF(a,102604)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];xF(a,g);c[m>>2]=e;c[m+4>>2]=b;uF(a,68782,m);}l=n;return}function Qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;f=l;l=l+32|0;e=f;if(b|0){switch(c[(c[a+16>>2]|0)+4>>2]|0){case 1:case 0:{d=111494;break}case 2:{d=111481;break}case 3:{d=111450;break}default:d=68818;}i=+h[b+8>>3];g=+h[b+16>>3];h[e>>3]=+h[b>>3];h[e+8>>3]=i;h[e+16>>3]=g;c[e+24>>2]=d;uF(a,68825,e);}l=f;return}function Rd(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;k=m+8|0;j=m;g=b+16|0;i=c[g>>2]|0;d=c[i+160>>2]|0;vF(b,+h[i+152>>3]);oF(b,68799)|0;while(1){if(!d)break;i=d+4|0;f=c[d>>2]|0;if(!f)break;if(!(s2(f,111088)|0)){d=i;continue}else e=f;while(1){d=e+1|0;if(!(a[e>>0]|0))break;else e=d;}a:while(1){if(!(a[d>>0]|0))break;c[j>>2]=d;uF(b,68814,j);while(1){e=d+1|0;if(!(a[d>>0]|0)){d=e;continue a}else d=e;}}if(!(s2(f,134335)|0))h[(c[g>>2]|0)+152>>3]=0.0;c[k>>2]=f;uF(b,96670,k);d=i;}l=m;return}function Sd(b){b=b|0;var d=0;oF(b,74838)|0;d=QA(c[(c[b>>2]|0)+168>>2]|0,74894)|0;if(d|0?a[d>>0]|0:0){oF(b,74905)|0;oF(b,d)|0;oF(b,74929)|0;}oF(b,74950)|0;oF(b,74998)|0;oF(b,75052)|0;d=b+12|0;oF(b,FK(c[c[c[d>>2]>>2]>>2]|0)|0)|0;oF(b,78181)|0;oF(b,FK(c[(c[c[d>>2]>>2]|0)+4>>2]|0)|0)|0;oF(b,78191)|0;oF(b,FK(c[(c[c[d>>2]>>2]|0)+8>>2]|0)|0)|0;oF(b,75434)|0;oF(b,75458)|0;return}function Td(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0;i=l;l=l+48|0;g=i+16|0;f=i+8|0;e=i;d=c[b+16>>2]|0;oF(b,74673)|0;d=d+8|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,75397)|0;oF(b,FK(KB(c[d>>2]|0)|0)|0)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,74678,e);e=c[b+452>>2]|0;c[f>>2]=c[b+448>>2];c[f+4>>2]=e;uF(b,74694,f);m=+h[b+392>>3];k=+h[b+400>>3];j=+h[b+408>>3];h[g>>3]=+h[b+384>>3];h[g+8>>3]=m;h[g+16>>3]=k;h[g+24>>3]=j;uF(b,74727,g);oF(b,74758)|0;oF(b,74794)|0;oF(b,76388)|0;l=i;return}function Ud(a){a=a|0;oF(a,74665)|0;return}function Vd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;qe(a,b,0,101510,c[(c[a+16>>2]|0)+8>>2]|0);oF(a,76388)|0;return}function Wd(a){a=a|0;oF(a,74513)|0;return}function Xd(b){b=b|0;var d=0,e=0,f=0,g=0;e=l;l=l+16|0;f=e;g=c[b+16>>2]|0;d=g+8|0;qe(b,c[g+212>>2]|0,0,111494,c[d>>2]|0);oF(b,74617)|0;vF(b,+h[b+488>>3]);oF(b,102604)|0;vF(b,+h[b+496>>3]);c[f>>2]=0-(c[b+360>>2]|0);uF(b,74636,f);vF(b,+h[b+504>>3]);oF(b,102604)|0;vF(b,-+h[b+512>>3]);oF(b,74660)|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,74569)|0;oF(b,FK(KB(c[d>>2]|0)|0)|0)|0;oF(b,74577)|0;}l=e;return}function Yd(a){a=a|0;oF(a,74513)|0;return}function Zd(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=d+8|0;qe(a,c[d+212>>2]|0,0,108006,c[b>>2]|0);oF(a,76388)|0;oF(a,74569)|0;oF(a,FK(KB(c[b>>2]|0)|0)|0)|0;oF(a,74577)|0;return}function _d(a){a=a|0;oF(a,74513)|0;return}function $d(a){a=a|0;var b=0,d=0,e=0;d=c[a+16>>2]|0;b=c[a+160>>2]|0;if((b|0)>1)b=c[(c[(c[a>>2]|0)+308>>2]|0)+(b<<2)>>2]|0;else b=0;e=d+8|0;qe(a,c[d+212>>2]|0,b,111481,c[e>>2]|0);oF(a,76388)|0;oF(a,74569)|0;oF(a,FK(KB(c[e>>2]|0)|0)|0)|0;oF(a,74577)|0;return}function ae(a){a=a|0;oF(a,74513)|0;return}function be(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=d+8|0;qe(a,c[d+212>>2]|0,0,111450,c[b>>2]|0);oF(a,76388)|0;oF(a,74569)|0;b=EK(102095,c[b>>2]|0)|0;oF(a,FK(b)|0)|0;U1(b);oF(a,74577)|0;return}function ce(a){a=a|0;oF(a,74513)|0;return}function de(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;oF(b,74519)|0;if(f|0){oF(b,74522)|0;oF(b,FK(f)|0)|0;oF(b,98744)|0;}oF(b,74412)|0;oF(b,76349)|0;if(c|0?a[c>>0]|0:0){oF(b,74530)|0;oF(b,c)|0;oF(b,98744)|0;}if(d|0?a[d>>0]|0:0){oF(b,74544)|0;oF(b,GK(d,1)|0)|0;oF(b,98744)|0;}if(e|0?a[e>>0]|0:0){oF(b,74559)|0;oF(b,FK(e)|0)|0;oF(b,98744)|0;}oF(b,76388)|0;return}function ee(a){a=a|0;oF(a,76343)|0;oF(a,74513)|0;return}function fe(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+176|0;L=M+160|0;K=M+152|0;F=M+136|0;J=M+128|0;E=M+120|0;D=M+112|0;C=M+104|0;B=M+96|0;A=M+88|0;y=M+80|0;w=M+72|0;v=M+64|0;u=M+56|0;t=M+48|0;i=M+40|0;q=M+32|0;s=M+24|0;r=M+16|0;p=M+8|0;o=M;I=c[e+16>>2]|0;oF(e,74044)|0;switch(a[g+48>>0]|0){case 108:{oF(e,74050)|0;break}case 114:{oF(e,74071)|0;break}default:oF(e,74090)|0;}H=f+8|0;G=+h[H>>3]+ +h[g+24>>3];h[H>>3]=G;H=I+260|0;if(!(b[H>>1]&512)){oF(e,74112)|0;vF(e,+h[f>>3]);oF(e,74117)|0;vF(e,-G);oF(e,98744)|0;}x=g+4|0;f=c[x>>2]|0;n=c[f+8>>2]|0;if(n){switch(c[(c[(c[(c[e>>2]|0)+168>>2]|0)+16>>2]|0)+244>>2]|0){case 1:{m=n;f=n+16|0;i=n+8|0;break}case 2:{m=n+24|0;f=n+32|0;i=n+28|0;break}default:{m=n+4|0;f=n+16|0;i=n+8|0;}}j=c[f>>2]|0;f=c[i>>2]|0;k=c[n+12>>2]|0;c[o>>2]=c[m>>2];uF(e,74123,o);i=c[n+24>>2]|0;if(i|0){c[p>>2]=i;uF(e,74140,p);}oF(e,98744)|0;if(f|0){c[r>>2]=f;uF(e,74144,r);}if(k|0){c[s>>2]=k;uF(e,74162,s);}if(!j)j=0;else {c[q>>2]=j;uF(e,74181,q);}}else {c[i>>2]=c[f>>2];uF(e,74198,i);j=0;f=0;}i=c[x>>2]|0;if(i|0?(z=c[i+24>>2]|0,z&127|0):0){if(!((f|0)!=0|(z&1|0)==0))uF(e,74216,t);if(!((j|0)!=0|(z&2|0)==0))uF(e,74236,u);if(z&100|0){uF(e,74257,v);if(!(z&4))f=0;else {uF(e,105986,w);f=1;}if(z&64){c[y>>2]=f|0?100999:195059;uF(e,74276,y);f=1;}if(z&32|0){c[A>>2]=f|0?100999:195059;uF(e,74287,A);}uF(e,98744,B);}if(z&8|0)uF(e,74302,C);if(z&16|0)uF(e,74326,D);}h[E>>3]=+h[(c[x>>2]|0)+16>>3];uF(e,74348,E);f=I+16|0;switch(c[I+48>>2]|0){case 5:{f=c[f>>2]|0;if(c3(f,137314)|0){c[J>>2]=f;uF(e,74366,J);}break}case 1:{E=d[f+1>>0]|0;J=d[f+2>>0]|0;c[F>>2]=d[f>>0];c[F+4>>2]=E;c[F+8>>2]=J;uF(e,74377,F);break}default:qa(138394,73558,486,74399);}oF(e,74412)|0;if(b[H>>1]&512){c[K>>2]=FK(c[I+212>>2]|0)|0;uF(e,74414,K);oF(e,74463)|0;vF(e,-G);oF(e,74481)|0;}oF(e,GK(c[g>>2]|0,1)|0)|0;if(b[H>>1]&512)uF(e,74484,L);oF(e,74504)|0;l=M;return}function ge(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;switch(c|0){case 2:{d=ne(a,b,2)|0;break}case 3:{d=oe(a)|0;break}default:d=0;}oF(a,74008)|0;le(a,c,d);oF(a,74017)|0;vF(a,+h[b>>3]);oF(a,74023)|0;c=b+8|0;vF(a,-+h[c>>3]);oF(a,74030)|0;vF(a,+h[b+16>>3]-+h[b>>3]);oF(a,74037)|0;vF(a,+h[b+24>>3]-+h[c>>3]);oF(a,73424)|0;return}function he(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;switch(d|0){case 2:{e=ne(a,b,c)|0;break}case 3:{e=oe(a)|0;break}default:e=0;}oF(a,73999)|0;le(a,d,e);oF(a,73414)|0;e=0;while(1){if((e|0)>=(c|0))break;vF(a,+h[b+(e<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(e<<4)+8>>3]);oF(a,102604)|0;e=e+1|0;}vF(a,+h[b>>3]);oF(a,100999)|0;vF(a,-+h[b+8>>3]);oF(a,73424)|0;return}function ie(a,d,e,f,g,h){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;g=c[a+16>>2]|0;switch(h|0){case 2:{f=ne(a,d,e)|0;break}case 3:{f=oe(a)|0;break}default:f=0;}oF(a,73594)|0;if(b[g+260>>1]&512){oF(a,73600)|0;oF(a,FK(c[g+212>>2]|0)|0)|0;oF(a,73606)|0;}le(a,h,f);oF(a,73611)|0;pe(a,d,e);oF(a,73424)|0;return}function je(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;oF(a,73404)|0;le(a,0,0);oF(a,73414)|0;d=0;while(1){if((d|0)>=(c|0))break;vF(a,+h[b+(d<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(d<<4)+8>>3]);oF(a,102604)|0;d=d+1|0;}oF(a,73424)|0;return}function ke(a,b){a=a|0;b=b|0;oF(a,73398)|0;oF(a,FK(b)|0)|0;oF(a,75458)|0;return}function le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+96|0;k=q+48|0;p=q+40|0;n=q+32|0;o=q+24|0;j=q+16|0;g=q+8|0;f=q;m=c[b+16>>2]|0;oF(b,73429)|0;a:do switch(d|0){case 2:{c[f>>2]=e;uF(b,73437,f);break}case 3:{c[g>>2]=e;uF(b,73448,g);break}case 0:{oF(b,135709)|0;break}default:{d=m+56|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);if((c[m+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:break a;default:{}}h[j>>3]=+(d&255)*.00392156862745098;uF(b,73459,j);}}}while(0);oF(b,73478)|0;e=m+16|0;f=k;g=e;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);d=m+152|0;if(+h[d>>3]!=1.0){oF(b,73489)|0;vF(b,+h[d>>3]);}switch(c[m+144>>2]|0){case 1:{c[o>>2]=73529;uF(b,73506,o);break}case 2:{c[n>>2]=73533;uF(b,73506,n);break}default:{}}b:do if((c[m+48>>2]|0)==1){d=a[e+3>>0]|0;switch(d<<24>>24){case -1:case 0:break b;default:{}}h[p>>3]=+(d&255)*.00392156862745098;uF(b,73537,p);}while(0);oF(b,98744)|0;l=q;return}function me(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,137379)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,73558,117,73578);}while(0);l=g;return}function ne(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+112|0;o=t+64|0;r=t+56|0;n=t+48|0;m=t+40|0;i=t+32|0;k=t;q=c[46722]|0;c[46722]=q+1;p=c[b+16>>2]|0;f=+(c[p+136>>2]|0)*.017453292519943295;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;pQ(d,k,e,f,0);c[o>>2]=q;uF(b,73831,o);oF(b,73896)|0;vF(b,+h[k>>3]);oF(b,73901)|0;vF(b,+h[k+8>>3]);oF(b,73908)|0;vF(b,+h[k+16>>3]);oF(b,73915)|0;vF(b,+h[k+24>>3]);oF(b,73922)|0;k=p+140|0;f=+g[k>>2];if(f>0.0){h[i>>3]=f+-.001;uF(b,73927,i);}else oF(b,73703)|0;d=p+56|0;e=o;i=d;j=e+40|0;do{c[e>>2]=c[i>>2];e=e+4|0;i=i+4|0;}while((e|0)<(j|0));me(b,o);oF(b,73739)|0;a:do if((c[p+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{s=7;break a}default:{}}h[m>>3]=+(d&255)*.00392156862745098;uF(b,99612,m);}else s=7;while(0);if((s|0)==7)oF(b,73754)|0;oF(b,73757)|0;f=+g[k>>2];if(f>0.0){h[n>>3]=f;uF(b,73927,n);}else oF(b,73763)|0;d=p+96|0;e=o;i=d;j=e+40|0;do{c[e>>2]=c[i>>2];e=e+4|0;i=i+4|0;}while((e|0)<(j|0));me(b,o);oF(b,73739)|0;b:do if((c[p+128>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{s=14;break b}default:{}}h[r>>3]=+(d&255)*.00392156862745098;uF(b,99612,r);}else s=14;while(0);if((s|0)==14)oF(b,73754)|0;oF(b,73967)|0;l=t;return q|0}function oe(b){b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+64|0;k=q+16|0;o=q+8|0;j=q;n=c[46721]|0;c[46721]=n+1;m=c[b+16>>2]|0;r=+(c[m+136>>2]|0)*.017453292519943295;e=r;if(r==0.0){f=50;d=50;}else {f=~~((+E(+e)+1.0)*50.0);d=~~((1.0-+F(+e))*50.0);}c[k>>2]=n;c[k+4>>2]=f;c[k+8>>2]=d;uF(b,73619,k);oF(b,73703)|0;d=m+56|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);oF(b,73739)|0;a:do if((c[m+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{p=6;break a}default:{}}h[j>>3]=+(d&255)*.00392156862745098;uF(b,99612,j);}else p=6;while(0);if((p|0)==6)oF(b,73754)|0;oF(b,73757)|0;oF(b,73763)|0;d=m+96|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);oF(b,73739)|0;b:do if((c[m+128>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{p=10;break b}default:{}}h[o>>3]=+(d&255)*.00392156862745098;uF(b,99612,o);}else p=10;while(0);if((p|0)==10)oF(b,73754)|0;oF(b,73799)|0;l=q;return n|0}function pe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;i=l;l=l+16|0;g=i;e=77;f=0;while(1){if((f|0)>=(d|0))break;c[g>>2]=e;uF(a,73616,g);vF(a,+h[b+(f<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(f<<4)+8>>3]);e=(f|0)==0?67:32;f=f+1|0;}l=i;return}function qe(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+16|0;i=j+8|0;h=j;oF(b,74587)|0;oF(b,FK(d)|0)|0;if(e|0){c[h>>2]=FK(e)|0;uF(b,74595,h);}c[i>>2]=f;uF(b,74599,i);d=QA(g,74611)|0;if(d|0?a[d>>0]|0:0){oF(b,102604)|0;oF(b,FK(d)|0)|0;}oF(b,98744)|0;l=j;return}function re(a){a=a|0;var b=0;oF(a,75418)|0;b=a+12|0;oF(a,Be(c[c[c[b>>2]>>2]>>2]|0)|0)|0;oF(a,78181)|0;oF(a,Be(c[(c[c[b>>2]>>2]|0)+4>>2]|0)|0)|0;oF(a,78191)|0;oF(a,Be(c[(c[c[b>>2]>>2]|0)+8>>2]|0)|0)|0;oF(a,75434)|0;return}function se(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=c[b+16>>2]|0;oF(b,75395)|0;d=d+8|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,75397)|0;oF(b,Be(KB(c[d>>2]|0)|0)|0)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,75406,e);c[46723]=0;l=f;return}function te(a){a=a|0;c[46723]=1;return}function ue(a){a=a|0;c[46723]=-1;return}function ve(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+48|0;i=n+8|0;m=n;f=c[b+16>>2]|0;if(c[f+144>>2]|0?(k=e+4|0,j=~~(+h[b+352>>3]*+h[(c[k>>2]|0)+16>>3]),j|0):0){Ce(b);oF(b,75334)|0;g=d+8|0;h[g>>3]=+h[g>>3]-+(j|0)*.55;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];xF(b,i);oF(b,75348)|0;oF(b,c[e>>2]|0)|0;oF(b,75357)|0;oF(b,75155)|0;g=i;d=f+16|0;f=g+40|0;do{c[g>>2]=c[d>>2];g=g+4|0;d=d+4|0;}while((g|0)<(f|0));De(b,i);oF(b,75359)|0;i=c[k>>2]|0;k=c[i+8>>2]|0;k=c[((k|0)==0?i:k+4|0)>>2]|0;oF(b,98744)|0;oF(b,k)|0;oF(b,98744)|0;c[m>>2]=j;uF(b,75368,m);switch(a[e+48>>0]|0){case 108:{oF(b,75373)|0;break}case 114:{oF(b,75384)|0;break}default:{}}Ee(b);oF(b,153599)|0;}l=n;return}function we(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0.0,m=0.0,n=0.0;j=l;l=l+48|0;f=j;g=c[a+16>>2]|0;i=g+144|0;if(c[i>>2]|0){n=+h[b>>3];m=+h[b+24>>3];e=b+8|0;k=+h[e>>3];h[b>>3]=n-+h[b+16>>3]+n;h[e>>3]=k-m+k;Ce(a);oF(a,75320)|0;yF(a,b,2);oF(a,75155)|0;do if(!d)if(!(c[46723]|0)){oF(a,97309)|0;break}else {oF(a,137198)|0;break}else {b=f;d=g+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);}while(0);if((c[46723]|0)==1)c[46723]=0;oF(a,75266)|0;vF(a,+h[g+152>>3]);oF(a,75309)|0;b=f;d=g+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);b=c[i>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[i>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=j;return}function xe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+48|0;f=j;g=c[a+16>>2]|0;i=g+144|0;if(c[i>>2]|0){Ce(a);oF(a,75292)|0;yF(a,b,d);oF(a,75155)|0;do if(!e)if(!(c[46723]|0)){oF(a,97309)|0;break}else {oF(a,137198)|0;break}else {b=f;d=g+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);}while(0);if((c[46723]|0)==1)c[46723]=0;oF(a,75266)|0;vF(a,+h[g+152>>3]);oF(a,75309)|0;b=f;d=g+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);b=c[i>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[i>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=j;return}function ye(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0;m=l;l=l+48|0;i=m;j=c[a+16>>2]|0;k=j+144|0;if(c[k>>2]|0){Ce(a);oF(a,75141)|0;yF(a,b,d);oF(a,75155)|0;e=i;f=j+16|0;g=e+40|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));De(a,i);oF(a,75266)|0;vF(a,+h[j+152>>3]);e=c[k>>2]|0;if((e|0)==1){oF(a,75163)|0;e=c[k>>2]|0;}if((e|0)==2)oF(a,75172)|0;oF(a,75275)|0;Ee(a);oF(a,153599)|0;}l=m;return}function ze(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;g=i;e=c[a+16>>2]|0;h=e+144|0;if(c[h>>2]|0){Ce(a);oF(a,75141)|0;yF(a,b,d);oF(a,75155)|0;f=g;b=e+16|0;d=f+40|0;do{c[f>>2]=c[b>>2];f=f+4|0;b=b+4|0;}while((f|0)<(d|0));De(a,g);b=c[h>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[h>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=i;return}function Ae(a,b){a=a|0;b=b|0;oF(a,75138)|0;oF(a,Be(b)|0)|0;oF(a,153599)|0;return}function Be(a){a=a|0;return a|0}function Ce(b){b=b|0;if(!(a[b+144>>0]|0))oF(b,75263)|0;else oF(b,c[b+148>>2]|0)|0;return}function De(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,97309)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,75181,49,75245);}while(0);l=g;return}function Ee(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=c[a+16>>2]|0;switch(c[f+12>>2]|0){case 8:{b=1;d=111481;e=f+8|0;break}case 10:{b=0;d=111481;e=f+8|0;break}case 3:case 2:case 9:{b=1;d=111450;e=f+8|0;break}case 7:case 6:case 11:{b=0;d=111450;e=f+8|0;break}case 0:{b=1;d=111494;e=f+8|0;break}case 4:{b=0;d=75217;e=f+8|0;break}case 1:{b=1;d=111494;e=f+8|0;break}case 5:{b=0;d=111494;e=f+8|0;break}default:qa(138394,75181,106,75200);}f=c[(c[e>>2]|0)+8>>2]|0;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=f;uF(a,75229,g);l=h;return}function Fe(a){a=a|0;var b=0;oF(a,78153)|0;oF(a,78161)|0;b=a+12|0;oF(a,Qe(c[c[c[b>>2]>>2]>>2]|0)|0)|0;oF(a,78181)|0;oF(a,Qe(c[(c[c[b>>2]>>2]|0)+4>>2]|0)|0)|0;oF(a,78191)|0;oF(a,Qe(c[(c[c[b>>2]>>2]|0)+8>>2]|0)|0)|0;oF(a,78194)|0;return}function Ge(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;i=j+24|0;g=j+16|0;f=j+8|0;e=j;d=c[b+16>>2]|0;c[46727]=~~(+h[b+232>>3]-+h[b+216>>3]);c[46726]=~~(+h[b+224>>3]-+h[b+208>>3]);oF(b,76840)|0;oF(b,76847)|0;d=KB(c[d+8>>2]|0)|0;if(a[d>>0]|0){oF(b,76916)|0;oF(b,Qe(d)|0)|0;oF(b,76924)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,76933,e);oF(b,76953)|0;oF(b,76988)|0;oF(b,77016)|0;oF(b,77022)|0;oF(b,77065)|0;oF(b,77106)|0;oF(b,77125)|0;oF(b,77142)|0;oF(b,77190)|0;oF(b,77243)|0;oF(b,77319)|0;oF(b,77395)|0;oF(b,77404)|0;oF(b,77427)|0;oF(b,77454)|0;oF(b,77507)|0;oF(b,77529)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77596)|0;oF(b,77622)|0;oF(b,77507)|0;oF(b,77674)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77718)|0;oF(b,77427)|0;oF(b,77454)|0;oF(b,77507)|0;oF(b,77674)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77596)|0;oF(b,77622)|0;oF(b,77507)|0;oF(b,77529)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77731)|0;oF(b,77739)|0;oF(b,77745)|0;oF(b,77759)|0;oF(b,77767)|0;oF(b,77800)|0;e=(c[46727]|0)+10|0;c[f>>2]=c[46726];c[f+4>>2]=e;uF(b,77877,f);oF(b,77907)|0;oF(b,77916)|0;oF(b,77974)|0;oF(b,77984)|0;oF(b,78049)|0;f=c[46727]|0;c[g>>2]=c[46726];c[g+4>>2]=f;uF(b,78086,g);g=c[46727]|0;c[i>>2]=c[46726];c[i+4>>2]=g;uF(b,78114,i);l=j;return}function He(a){a=a|0;oF(a,76391)|0;oF(a,76403)|0;oF(a,76411)|0;oF(a,76474)|0;oF(a,76403)|0;oF(a,76519)|0;oF(a,76568)|0;oF(a,76622)|0;oF(a,76403)|0;oF(a,76722)|0;oF(a,76771)|0;oF(a,76403)|0;oF(a,76823)|0;return}function Ie(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+32|0;i=j+16|0;h=j+8|0;g=j;oF(b,76349)|0;if(d|0?a[d>>0]|0:0){c[g>>2]=Qe(d)|0;uF(b,76352,g);}if(e|0?a[e>>0]|0:0){c[h>>2]=Qe(e)|0;uF(b,76363,h);}if(f|0?a[f>>0]|0:0){c[i>>2]=Qe(f)|0;uF(b,76375,i);}oF(b,76388)|0;l=j;return}function Je(a){a=a|0;oF(a,76343)|0;return}function Ke(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0;A=l;l=l+112|0;y=A+96|0;z=A+88|0;w=A+80|0;q=A+72|0;v=A+64|0;t=A+56|0;s=A+48|0;r=A+40|0;p=A+24|0;o=A+8|0;n=A;x=c[b+16>>2]|0;switch(a[f+48>>0]|0){case 108:{j=+h[e>>3];m=+h[f+32>>3];break}case 114:{m=+h[f+32>>3];j=+h[e>>3]-m;break}default:{m=+h[f+32>>3];j=+h[e>>3]-m*.5;}}g=f+40|0;i=+h[g>>3];u=f+4|0;k=+h[(c[u>>2]|0)+16>>3];if(i>3]=i;}B=j+-8.0;k=+((c[46727]|0)>>>0)-+h[e+8>>3]-i+k*.2+(k<12.0?1.4:2.0);uF(b,76005,n);h[o>>3]=B;h[o+8>>3]=k;uF(b,75942,o);h[p>>3]=j+8.0+m-B;h[p+8>>3]=i;uF(b,75966,p);oF(b,76040)|0;oF(b,76074)|0;g=c[u>>2]|0;e=c[g+8>>2]|0;if(e){c[r>>2]=c[e+4>>2];uF(b,76164,r);g=c[e+8>>2]|0;if(g|0){c[s>>2]=g;uF(b,76183,s);}g=c[e+12>>2]|0;if(g|0){c[t>>2]=g;uF(b,76200,t);}g=c[e+16>>2]|0;if(g|0){c[v>>2]=g;uF(b,76218,v);}}else {c[q>>2]=c[g>>2];uF(b,76164,q);}h[w>>3]=+h[(c[u>>2]|0)+16>>3];uF(b,76234,w);g=x+16|0;switch(c[x+48>>2]|0){case 5:{g=c[g>>2]|0;if(c3(g,137314)|0){c[z>>2]=g;uF(b,76254,z);}break}case 1:{x=d[g+1>>0]|0;z=d[g+2>>0]|0;c[y>>2]=d[g>>0];c[y+4>>2]=x;c[y+8>>2]=z;uF(b,76264,y);break}default:qa(138394,75728,438,76285);}oF(b,76298)|0;oF(b,Qe(c[f>>2]|0)|0)|0;oF(b,76309)|0;oF(b,76332)|0;l=A;return}function Le(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0;e=l;l=l+32|0;f=e+16|0;j=e;oF(a,75906)|0;m=+h[b>>3];i=+h[b+16>>3]-m;k=+h[b+24>>3];g=k-+h[b+8>>3];k=+((c[46727]|0)>>>0)-k;h[j>>3]=m-i;h[j+8>>3]=k;uF(a,75942,j);h[f>>3]=i*2.0;h[f+8>>3]=g*2.0;uF(a,75966,f);Ue(a,d);oF(a,75788)|0;Se(a);oF(a,75994)|0;l=e;return}function Me(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+24|0;j=m+8|0;g=m;oF(a,75511)|0;n=c[46727]|0;c[g>>2]=c[46726];c[g+4>>2]=n;uF(a,75764,g);Ue(a,e);oF(a,75788)|0;Se(a);oF(a,75791)|0;g=d+-1|0;e=0;while(1){if((e|0)>=(d|0))break;i=+h[b+(e<<4)>>3];f=+((c[46727]|0)>>>0)-+h[b+(e<<4)+8>>3];if(!e){oF(a,75818)|0;h[j>>3]=i;h[j+8>>3]=f;uF(a,75884,j);oF(a,75895)|0;}else {h[k>>3]=i;h[k+8>>3]=f;uF(a,75884,k);}if((e|0)==(g|0))oF(a,75898)|0;e=e+1|0;}oF(a,75627)|0;l=m;return}function Ne(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;f=l;l=l+16|0;e=f;oF(a,75511)|0;h=c[46727]|0;c[e>>2]=c[46726];c[e+4>>2]=h;uF(a,75764,e);Ue(a,g);oF(a,75788)|0;Se(a);oF(a,75791)|0;Ve(a,b,d);oF(a,75804)|0;l=f;return}function Oe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0.0;k=l;l=l+48|0;j=k+24|0;i=k+8|0;f=k;oF(a,75511)|0;g=c[46727]|0;c[f>>2]=c[46726];c[f+4>>2]=g;uF(a,75548,f);oF(a,75588)|0;f=d+-1|0;g=b+8|0;e=0;while(1){if((e|0)>=(d|0))break;if(!e){oF(a,75600)|0;m=+((c[46727]|0)>>>0)-+h[g>>3];h[i>>3]=+h[b>>3];h[i+8>>3]=m;uF(a,75604,i);oF(a,75615)|0;}else {m=+((c[46727]|0)>>>0)-+h[b+(e<<4)+8>>3];h[j>>3]=+h[b+(e<<4)>>3];h[j+8>>3]=m;uF(a,75604,j);}if((e|0)==(f|0))oF(a,75619)|0;e=e+1|0;}oF(a,75623)|0;Se(a);oF(a,75627)|0;l=k;return}function Pe(a,b){a=a|0;b=b|0;oF(a,75446)|0;oF(a,Qe(b)|0)|0;oF(a,75458)|0;return}function Qe(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+16|0;e=u;d=c[46724]|0;if(!d){c[46725]=64;d=KK(64)|0;c[46724]=d;}s=e+15|0;r=e+14|0;g=0;q=0;o=0;e=0;f=0;a:while(1){n=(o|0)!=0;k=g;p=b;j=e;b:while(1){if(!p){t=32;break a}e=a[p>>0]|0;if(!(e<<24>>24)){t=32;break a}b=c[46725]|0;if((q|0)>(b+-8|0)){d=b<<1;c[46725]=d;d=MK(c[46724]|0,d)|0;c[46724]=d;d=d+q|0;e=a[p>>0]|0;}switch(e<<24>>24){case 60:{e=4;b=102153;t=26;break b}case 62:{e=4;b=102136;t=27;break b}case 38:{t=10;break b}case 45:{e=5;b=102147;i=j;break b}default:{}}if(n&e<<24>>24==32){t=12;break}switch(e<<24>>24){case 34:{e=6;b=102116;t=26;break b}case 39:{e=5;b=102141;t=27;break b}default:{}}if(e<<24>>24<0){i=127;b=0;}else {e=1;b=p;t=26;break}while(1){g=i&255;h=e&255;if(g>>>0>=h>>>0)break;e=i&h&255;i=g>>>1;b=b+1|0;}if((b|0)<=1){g=R6(j|0,f|0,6)|0;g=J6(g|0,z|0,e&255|0,0)|0;f=z;m=k+-1|0;if((k|0)>1){b=m;e=g;}else {t=21;break}}else {b=b+-1|0;e=e&255;f=0;}k=b;p=p+1|0;j=e;}if((t|0)==10){t=0;b=(Re(p)|0)==0;e=b?5:1;b=b?102130:p;i=j;}else if((t|0)==12){t=0;b=(a[o>>0]|0)==32;e=b?6:1;b=b?102123:p;i=j;}else if((t|0)==21){t=0;a[s>>0]=59;e=3;h=r;i=g;j=f;while(1){b=O6(i|0,j|0,10,0)|0;g=h+-1|0;a[h>>0]=b|48;b=i;i=N6(i|0,j|0,10,0)|0;f=j;j=z;o=e;e=e+1|0;if((o|0)>11){t=23;break a}if(!(f>>>0>0|(f|0)==0&b>>>0>9))break;else h=g;}b=h+-2|0;a[g>>0]=35;a[b>>0]=38;k=m;f=j;}else if((t|0)==26){t=0;i=j;}else if((t|0)==27){t=0;i=j;}h=d+e|0;g=e;while(1){if(!g)break;a[d>>0]=a[b>>0]|0;g=g+-1|0;b=b+1|0;d=d+1|0;}g=k;b=p+1|0;q=e+q|0;o=p;d=h;e=i;}if((t|0)==23){U4(75464,46,1,c[15712]|0)|0;Sa(1);}else if((t|0)==32){a[d>>0]=0;l=u;return c[46724]|0}return 0}function Re(b){b=b|0;var c=0,d=0;d=b+1|0;c=a[d>>0]|0;a:do if(c<<24>>24==35){d=b+2|0;c=a[d>>0]|0;switch(c<<24>>24){case 88:case 120:break;default:{b=d;while(1){d=b+1|0;if((c+-48&255)>=10)break a;b=d;c=a[d>>0]|0;}}}d=b+3|0;while(1){c=a[d>>0]|0;if((c+-48&255)>=10)switch(c<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:break a}d=d+1|0;}}else while(1){b=d+1|0;if(((c&-33)+-65&255)>=26)break a;d=b;c=a[b>>0]|0;}while(0);return c<<24>>24==59|0}function Se(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;k=l;l=l+48|0;d=k+8|0;j=k;i=c[a+16>>2]|0;oF(a,75639)|0;e=d;f=i+16|0;g=e+40|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));Te(a,d);b=+h[i+152>>3];if(b!=1.0){h[j>>3]=b;uF(a,75657,j);}switch(c[i+144>>2]|0){case 1:{oF(a,75674)|0;break}case 2:{oF(a,75692)|0;break}default:{}}oF(a,75709)|0;l=k;return}function Te(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,135709)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,75728,94,75748);}while(0);l=g;return}function Ue(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g;if(!b)oF(a,75867)|0;else {d=c[a+16>>2]|0;oF(a,75837)|0;b=f;d=d+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));Te(a,f);oF(a,75864)|0;}l=g;return}function Ve(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0;i=l;l=l+32|0;g=i;e=75818;f=0;while(1){if((f|0)>=(d|0))break;k=+h[b+(f<<4)>>3];j=+((c[46727]|0)>>>0)-+h[b+(f<<4)+8>>3];c[g>>2]=e;h[g+8>>3]=k;h[g+16>>3]=j;uF(a,75821,g);e=(f|0)==0?75834:195059;f=f+1|0;}oF(a,98744)|0;l=i;return}function We(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;d=b+8|0;e=b;oF(a,80451)|0;oF(a,80466)|0;oF(a,80505)|0;oF(a,80554)|0;c[e>>2]=137314;c[e+4>>2]=80642;uF(a,80623,e);c[d>>2]=137198;c[d+4>>2]=80648;uF(a,80623,d);l=b;return}function Xe(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0;b=l;l=l+64|0;d=b+8|0;j=b;c[j>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,79404,j);i=+h[a+368>>3]*.5*+h[a+488>>3];g=+h[a+376>>3]*.5*+h[a+496>>3];f=+J(+(i*2.0000000949949026e-03))*180.0*.6366197723675814;e=+J(+(g*2.0000000949949026e-03))*180.0*.6366197723675814;h[d>>3]=i;h[d+8>>3]=g;h[d+16>>3]=-500.0;h[d+24>>3]=i;h[d+32>>3]=g;h[d+40>>3]=0.0;h[d+48>>3]=(f>e?f:e)*1.2;uF(a,79426,d);oF(a,79573)|0;oF(a,80403)|0;l=b;return}function Ye(a){a=a|0;oF(a,79387)|0;return}function Ze(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0;f=l;l=l+16|0;h=f;c[h>>2]=b;c[h+4>>2]=d;c[h+8>>2]=e;uF(a,79357,h);g[46728]=+(O(d,-10)|0);l=f;return}function _e(a){a=a|0;oF(a,79340)|0;return}function $e(a){a=a|0;oF(a,79322)|0;return}function af(a){a=a|0;oF(a,79306)|0;return}function bf(a){a=a|0;oF(a,79285)|0;g[46728]=+g[46728]+-2.0;return}function cf(a){a=a|0;oF(a,79266)|0;return}function df(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,79244,d);l=b;return}function ef(a){a=a|0;oF(a,79228)|0;return}function ff(a){a=a|0;oF(a,79210)|0;g[46728]=+g[46728]+-5.0;return}function gf(a){a=a|0;oF(a,79194)|0;g[46728]=+g[46728]+5.0;return}function hf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0;r=l;l=l+144|0;o=r+104|0;q=r+56|0;m=r+32|0;j=r+24|0;n=r;p=e+4|0;i=c[p>>2]|0;f=+h[i+16>>3];i=c[i>>2]|0;c[n>>2]=c[e>>2];h[n+8>>3]=f;c[n+16>>2]=i;uF(b,79040,n);g[46729]=+g[46728]+-9.0;switch(a[e+48>>0]|0){case 108:{f=+h[d>>3];break}case 114:{i=d;f=+h[d>>3]-+h[e+32>>3];k=5;break}default:{i=d;f=+h[d>>3]-+h[e+32>>3]*.5;k=5;}}if((k|0)==5)h[i>>3]=f;u=+h[b+488>>3];t=(+h[b+504>>3]+f)*u;s=(+h[b+512>>3]+ +h[d+8>>3])*+h[b+496>>3];h[j>>3]=+h[(c[p>>2]|0)+16>>3]*u;n=of(b,79092,j)|0;f=+(c[b+360>>2]|0);h[m>>3]=0.0;h[m+8>>3]=0.0;h[m+16>>3]=f;i=of(b,78309,m)|0;f=+g[46729];h[o>>3]=t;h[o+8>>3]=s;h[o+16>>3]=f;d=of(b,78341,o)|0;j=o;k=(c[b+16>>2]|0)+16|0;m=j+40|0;do{c[j>>2]=c[k>>2];j=j+4|0;k=k+4|0;}while((j|0)<(m|0));o=pf(b,o,0.0)|0;e=c[e>>2]|0;c[q>>2]=c[c[p>>2]>>2];h[q+8>>3]=.25;h[q+16>>3]=0.0;c[q+24>>2]=e;c[q+28>>2]=79179;c[q+32>>2]=n;c[q+36>>2]=i;c[q+40>>2]=d;c[q+44>>2]=o;q=of(b,79104,q)|0;oF(b,q)|0;U1(q);U1(i);U1(o);U1(d);U1(n);l=r;return}function jf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0;z=l;l=l+240|0;x=z+192|0;y=z+152|0;t=z+128|0;r=z+104|0;o=z+80|0;n=z+48|0;e=z+24|0;m=z;oF(a,78917)|0;g[46729]=+g[46728]+-6.0;i=+h[b>>3];j=+h[a+488>>3];p=(+h[a+504>>3]+i)*j;A=+h[b+8>>3];k=+h[a+496>>3];q=(+h[a+512>>3]+A)*k;j=(+h[b+16>>3]-i)*j;k=(+h[b+24>>3]-A)*k;s=a+16|0;A=k+j;i=+h[(c[s>>2]|0)+152>>3]/A*2.5;h[m>>3]=j;h[m+8>>3]=A*.25;h[m+16>>3]=k;b=of(a,78277,m)|0;m=a+360|0;A=+(c[m>>2]|0);h[e>>3]=90.0;h[e+8>>3]=0.0;h[e+16>>3]=A;e=of(a,78309,e)|0;A=+g[46729];h[x>>3]=p;h[x+8>>3]=q;h[x+16>>3]=A;f=of(a,78341,x)|0;u=x;v=(c[s>>2]|0)+16|0;w=u+40|0;do{c[u>>2]=c[v>>2];u=u+4|0;v=v+4|0;}while((u|0)<(w|0));v=pf(a,x,0.0)|0;h[n>>3]=1.0;h[n+8>>3]=i;c[n+16>>2]=b;c[n+20>>2]=e;c[n+24>>2]=f;c[n+28>>2]=v;w=of(a,78932,n)|0;oF(a,w)|0;U1(b);U1(e);U1(f);U1(v);U1(w);if(d|0){h[o>>3]=j;h[o+8>>3]=k;h[o+16>>3]=1.0;f=of(a,78277,o)|0;A=+(c[m>>2]|0);h[r>>3]=0.0;h[r+8>>3]=0.0;h[r+16>>3]=A;e=of(a,78309,r)|0;A=+g[46729];h[t>>3]=p;h[t+8>>3]=q;h[t+16>>3]=A;b=of(a,78341,t)|0;u=x;v=(c[s>>2]|0)+56|0;w=u+40|0;do{c[u>>2]=c[v>>2];u=u+4|0;v=v+4|0;}while((u|0)<(w|0));x=pf(a,x,0.0)|0;h[y>>3]=0.0;h[y+8>>3]=0.0;h[y+16>>3]=0.0;c[y+24>>2]=f;c[y+28>>2]=e;c[y+32>>2]=b;c[y+36>>2]=x;y=of(a,78978,y)|0;oF(a,y)|0;U1(f);U1(e);U1(b);U1(x);U1(y);}l=z;return}function kf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0,M=0,N=0.0;K=l;l=l+336|0;B=K+296|0;J=K+288|0;I=K+272|0;H=K+264|0;G=K+240|0;D=K+232|0;A=K+208|0;z=K+184|0;w=K+160|0;v=K+152|0;u=K+136|0;t=K+128|0;s=K+96|0;r=K+88|0;q=K+56|0;f=K+48|0;m=K+24|0;k=K;oF(a,78782)|0;g[46729]=+g[46728]+-2.0;o=a+488|0;p=a+496|0;L=+h[p>>3];h[k>>3]=+h[o>>3];h[k+8>>3]=L;h[k+16>>3]=1.0;k=of(a,78277,k)|0;y=a+360|0;L=+(c[y>>2]|0);h[m>>3]=0.0;h[m+8>>3]=0.0;h[m+16>>3]=L;m=of(a,78309,m)|0;L=+g[46729]+-2.0;h[B>>3]=0.0;h[B+8>>3]=0.0;h[B+16>>3]=L;n=of(a,78341,B)|0;C=a+16|0;i=B;j=(c[C>>2]|0)+16|0;x=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(x|0));j=pf(a,B,0.0)|0;c[f>>2]=78404;c[f+4>>2]=d+1;E=a+504|0;F=a+512|0;i=0;f=of(a,78373,f)|0;while(1){if((i|0)>=(d|0))break;N=+h[F>>3]+ +h[b+(i<<4)+8>>3];L=+h[(c[C>>2]|0)+152>>3];h[q>>3]=+h[E>>3]+ +h[b+(i<<4)>>3];h[q+8>>3]=N;h[q+16>>3]=0.0;h[q+24>>3]=L;M=of(a,78418,q)|0;c[r>>2]=f;c[r+4>>2]=M;x=of(a,78447,r)|0;U1(M);U1(f);i=i+1|0;f=x;}L=+h[F>>3]+ +h[b+8>>3];N=+h[(c[C>>2]|0)+152>>3];h[s>>3]=+h[E>>3]+ +h[b>>3];h[s+8>>3]=L;h[s+16>>3]=0.0;h[s+24>>3]=N;x=of(a,78418,s)|0;c[t>>2]=f;c[t+4>>2]=x;M=of(a,78447,t)|0;U1(x);U1(f);c[u>>2]=k;c[u+4>>2]=m;c[u+8>>2]=n;c[u+12>>2]=j;x=of(a,78797,u)|0;c[v>>2]=M;c[v+4>>2]=x;M=of(a,78502,v)|0;U1(x);oF(a,M)|0;U1(k);U1(m);U1(n);U1(j);U1(M);if(e|0){N=+h[p>>3];h[w>>3]=+h[o>>3];h[w+8>>3]=N;h[w+16>>3]=1.0;n=of(a,78277,w)|0;N=+(c[y>>2]|0);h[z>>3]=0.0;h[z+8>>3]=0.0;h[z+16>>3]=N;m=of(a,78309,z)|0;N=+g[46729]+-2.0;h[A>>3]=0.0;h[A+8>>3]=0.0;h[A+16>>3]=N;k=of(a,78341,A)|0;i=B;j=(c[C>>2]|0)+56|0;x=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(x|0));j=pf(a,B,.25)|0;c[D>>2]=d;i=0;f=of(a,78842,D)|0;while(1){if((i|0)>=(d|0))break;N=+h[F>>3]+ +h[b+(i<<4)+8>>3];h[G>>3]=+h[E>>3]+ +h[b+(i<<4)>>3];h[G+8>>3]=N;h[G+16>>3]=0.0;D=of(a,78857,G)|0;c[H>>2]=f;c[H+4>>2]=D;M=of(a,78879,H)|0;U1(D);U1(f);i=i+1|0;f=M;}c[I>>2]=n;c[I+4>>2]=m;c[I+8>>2]=k;c[I+12>>2]=j;I=of(a,78889,I)|0;c[J>>2]=f;c[J+4>>2]=I;M=of(a,78502,J)|0;U1(I);oF(a,M)|0;U1(n);U1(m);U1(k);U1(j);U1(M);}l=K;return}function lf(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0.0,D=0.0;B=l;l=l+208|0;e=B+160|0;A=B+152|0;z=B+136|0;y=B+128|0;x=B+96|0;w=B+88|0;v=B+56|0;k=B+48|0;s=B+24|0;r=B;oF(a,78709)|0;g[46729]=+g[46728]+-4.0;C=+h[a+496>>3];h[r>>3]=+h[a+488>>3];h[r+8>>3]=C;h[r+16>>3]=1.0;r=of(a,78277,r)|0;C=+(c[a+360>>2]|0);h[s>>3]=0.0;h[s+8>>3]=0.0;h[s+16>>3]=C;s=of(a,78309,s)|0;C=+g[46729]+-2.0;h[e>>3]=0.0;h[e+8>>3]=0.0;h[e+16>>3]=C;t=of(a,78341,e)|0;u=a+16|0;f=e;i=(c[u>>2]|0)+56|0;j=f+40|0;do{c[f>>2]=c[i>>2];f=f+4|0;i=i+4|0;}while((f|0)<(j|0));n=pf(a,e,0.0)|0;c[k>>2]=78723;c[k+4>>2]=d+2;o=a+504|0;p=a+512|0;q=d+-1|0;m=0;e=of(a,78373,k)|0;while(1){if((m|0)>=(d|0))break;f=b+(m<<4)|0;i=b+(m<<4)+8|0;D=+h[p>>3]+ +h[i>>3];C=+h[(c[u>>2]|0)+152>>3];h[v>>3]=+h[o>>3]+ +h[f>>3];h[v+8>>3]=D;h[v+16>>3]=0.0;h[v+24>>3]=C;k=of(a,78418,v)|0;c[w>>2]=e;c[w+4>>2]=k;j=of(a,78447,w)|0;U1(k);U1(e);if((m|0)==0|(m|0)==(q|0)){C=+h[p>>3]+ +h[i>>3];D=+h[(c[u>>2]|0)+152>>3];h[x>>3]=+h[o>>3]+ +h[f>>3];h[x+8>>3]=C;h[x+16>>3]=0.0;h[x+24>>3]=D;k=of(a,78418,x)|0;c[y>>2]=j;c[y+4>>2]=k;e=of(a,78447,y)|0;U1(k);U1(j);}else e=j;m=m+1|0;}c[z>>2]=r;c[z+4>>2]=s;c[z+8>>2]=t;c[z+12>>2]=n;b=of(a,78732,z)|0;c[A>>2]=e;c[A+4>>2]=b;d=of(a,78502,A)|0;U1(b);oF(a,d)|0;U1(r);U1(s);U1(t);U1(n);U1(d);l=B;return}function mf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0,y=0.0;v=l;l=l+160|0;e=v+120|0;u=v+112|0;t=v+96|0;s=v+88|0;r=v+56|0;m=v+48|0;n=v+24|0;q=v;oF(a,78261)|0;g[46729]=+g[46728]+-6.0;w=+h[a+496>>3];h[q>>3]=+h[a+488>>3];h[q+8>>3]=w;h[q+16>>3]=1.0;q=of(a,78277,q)|0;w=+(c[a+360>>2]|0);h[n>>3]=0.0;h[n+8>>3]=0.0;h[n+16>>3]=w;n=of(a,78309,n)|0;w=+g[46729];h[e>>3]=0.0;h[e+8>>3]=0.0;h[e+16>>3]=w;o=of(a,78341,e)|0;p=a+16|0;f=e;i=(c[p>>2]|0)+16|0;j=f+40|0;do{c[f>>2]=c[i>>2];f=f+4|0;i=i+4|0;}while((f|0)<(j|0));i=pf(a,e,0.0)|0;c[m>>2]=78404;c[m+4>>2]=d;j=a+504|0;k=a+512|0;f=0;e=of(a,78373,m)|0;while(1){if((f|0)>=(d|0))break;y=+h[k>>3]+ +h[b+(f<<4)+8>>3];w=+h[(c[p>>2]|0)+152>>3];h[r>>3]=+h[j>>3]+ +h[b+(f<<4)>>3];h[r+8>>3]=y;h[r+16>>3]=0.0;h[r+24>>3]=w;x=of(a,78418,r)|0;c[s>>2]=e;c[s+4>>2]=x;m=of(a,78447,s)|0;U1(x);U1(e);f=f+1|0;e=m;}c[t>>2]=q;c[t+4>>2]=n;c[t+8>>2]=o;c[t+12>>2]=i;t=of(a,78456,t)|0;c[u>>2]=e;c[u+4>>2]=t;x=of(a,78502,u)|0;U1(t);oF(a,x)|0;U1(q);U1(n);U1(o);U1(i);U1(x);l=v;return}function nf(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,78242,e);l=d;return}function of(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+1056|0;h=i;e=i+24|0;f=i+8|0;c[f>>2]=d;g=G3(e,1024,b,f)|0;do if((g|0)>=0)if((g|0)>1023){a=T1(g+1|0)|0;c[f>>2]=d;n4(a,b,f)|0;break}else {a=D4(e)|0;break}else {a=c[(c[a+12>>2]|0)+16>>2]|0;c[h>>2]=t2(c[(d2()|0)>>2]|0)|0;ub[a&63](78687,h);a=D4(195059)|0;}while(0);l=i;return a|0}function pf(a,b,e){a=a|0;b=b|0;e=+e;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0;q=l;l=l+112|0;o=q+104|0;j=q+96|0;i=q+64|0;n=q+48|0;p=q+32|0;m=q+16|0;k=q;g=c[b+32>>2]|0;a:do switch(g|0){case 5:{f=c[b>>2]|0;if(!(s2(f,136302)|0)){c[k>>2]=78524;h[k+8>>3]=e;f=of(a,78507,k)|0;break a}if(!(s2(f,133432)|0)){c[m>>2]=78528;h[m+8>>3]=e;f=of(a,78507,m)|0;break a}if(!(s2(f,131431)|0)){c[p>>2]=78534;h[p+8>>3]=e;f=of(a,78507,p)|0;break a}else {c[n>>2]=f;h[n+8>>3]=e;f=of(a,78507,n)|0;break a}}case 1:{s=+(d[b+1>>0]|0)*.00390625;r=+(d[b+2>>0]|0)*.00390625;h[i>>3]=+(d[b>>0]|0)*.00390625;h[i+8>>3]=s;h[i+16>>3]=r;h[i+24>>3]=e;f=of(a,78539,i)|0;break}default:{p=c[15712]|0;n=c[b>>2]|0;c[j>>2]=g;c[j+4>>2]=n;w4(p,78578,j)|0;qa(138394,78628,436,78648);}}while(0);c[o>>2]=f;p=of(a,78665,o)|0;U1(f);l=q;return p|0}function qf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;h=c[c[a+12>>2]>>2]|0;j=c[h>>2]|0;i=c[h+4>>2]|0;h=c[h+8>>2]|0;c[g>>2]=81094;c[g+4>>2]=j;c[g+8>>2]=i;c[g+12>>2]=h;uF(a,83704,g);f=KB(c[f+8>>2]|0)|0;c[e>>2]=81094;c[e+4>>2]=f;uF(a,83736,e);c[d>>2]=81094;uF(a,83750,d);l=b;return}function rf(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=81094;uF(a,83652,d);l=b;return}function sf(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;W=l;l=l+304|0;V=W+296|0;U=W+288|0;T=W+272|0;R=W+264|0;Q=W+256|0;P=W+248|0;O=W+240|0;N=W+232|0;M=W+224|0;L=W+216|0;K=W+208|0;J=W+200|0;I=W+192|0;H=W+184|0;G=W+176|0;F=W+168|0;E=W+160|0;C=W+152|0;A=W+144|0;z=W+136|0;y=W+128|0;x=W+120|0;w=W+112|0;v=W+104|0;u=W+96|0;t=W+88|0;s=W+80|0;r=W+72|0;q=W+64|0;p=W+56|0;o=W+48|0;S=W+40|0;B=W+24|0;n=W+16|0;m=W;g=c[a+456>>2]|0;i=c[a+460>>2]|0;j=c[a+464>>2]|0;k=c[a+468>>2]|0;f=a+360|0;a:do if(c[4025]|0){switch(c[f>>2]|0){case 90:case 0:break a;default:{}}Ef();c[4025]=0;}while(0);e=(+(k|0)-+(i|0))*.013888888888888888;b=(+(j|0)-+(g|0))*.013888888888888888;k=(c[f>>2]|0)==90;d=k?e:b;e=k?b:e;h[m>>3]=d;h[m+8>>3]=e;uF(a,81281,m);c[n>>2]=81094;uF(a,81296,n);if(d>0.0){b=+A2(d);h[19214]=b;b=b+3.0-+(~~b|0);}else b=3.0;b=+D(10.0,+b);h[19214]=b;h[B>>3]=b;h[B+8>>3]=b;uF(a,81465,B);c[S>>2]=81094;uF(a,81500,S);c[o>>2]=81094;uF(a,81558,o);c[p>>2]=81094;uF(a,81618,p);c[q>>2]=81094;uF(a,81667,q);c[r>>2]=81094;uF(a,81706,r);c[s>>2]=81094;uF(a,81757,s);c[t>>2]=81094;uF(a,81819,t);c[u>>2]=81094;uF(a,81929,u);c[v>>2]=81094;uF(a,82020,v);c[w>>2]=81094;uF(a,82074,w);c[x>>2]=81094;uF(a,82143,x);uF(a,82179,y);c[z>>2]=81094;uF(a,82304,z);c[A>>2]=81094;uF(a,82333,A);uF(a,82373,C);c[E>>2]=81094;uF(a,82466,E);c[F>>2]=81094;uF(a,82525,F);c[G>>2]=81094;uF(a,82606,G);uF(a,82676,H);c[I>>2]=81094;uF(a,82765,I);c[J>>2]=81094;uF(a,82870,J);c[K>>2]=81094;uF(a,82946,K);c[L>>2]=81094;uF(a,82985,L);c[M>>2]=81094;uF(a,83084,M);c[N>>2]=81094;uF(a,83130,N);uF(a,83219,O);c[P>>2]=81094;uF(a,83260,P);c[Q>>2]=81094;uF(a,83343,Q);c[R>>2]=81094;uF(a,83444,R);h[T>>3]=e;h[T+8>>3]=d;uF(a,83508,T);uF(a,83536,U);uF(a,83544,V);l=W;return}function tf(a){a=a|0;var b=0;b=l;l=l+16|0;uF(a,81274,b);l=b;return}function uf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0.0,o=0,p=0,q=0,r=0;r=l;l=l+48|0;q=r+24|0;p=r+8|0;o=r;switch(a[e+48>>0]|0){case 108:{k=d;i=+h[e+32>>3];j=+h[d>>3];break}case 114:{i=+h[e+32>>3];g=i;f=5;break}default:{i=+h[e+32>>3];g=i*.5;f=5;}}if((f|0)==5){j=+h[d>>3]-g;h[d>>3]=j;k=d;}m=e+4|0;f=c[m>>2]|0;g=+h[f+16>>3];d=d+8|0;n=+h[d>>3]+g*.004629629629629629;h[d>>3]=n;i=j+i*.006944444444444444;h[k>>3]=i;f=c[f>>2]|0;do if(f){d=c[46730]|0;if(d|0?(s2(d,f)|0)==0:0)break;c[o>>2]=Cf(f)|0;uF(b,81173,o);o=c[m>>2]|0;c[46730]=c[o>>2];g=+h[o+16>>3];}while(0);f=~~g;f=(f|0)>1?f:1;if((f|0)!=(c[46731]|0)){j=+h[19214];c[p>>2]=f;h[p+8>>3]=j;uF(b,81181,p);c[46731]=f;}c[q>>2]=Df(c[e>>2]|0)|0;h[q+8>>3]=i;h[q+16>>3]=n;uF(b,81202,q);l=r;return}function vf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=l;l=l+48|0;f=e;i=+h[b>>3];k=(+h[b+16>>3]-i)*.027777777777777776;g=+h[b+8>>3];j=(+h[b+24>>3]-g)*.027777777777777776;c[f>>2]=1;c[f+4>>2]=d|0?81115:195059;h[f+8>>3]=k;h[f+16>>3]=j;h[f+24>>3]=i*.013888888888888888;h[f+32>>3]=g*.013888888888888888;uF(a,81121,f);l=e;return}function wf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=l;l=l+16|0;Af(c[a+16>>2]|0,e+8|0,e);Bf(a,b,d,1);l=e;return}function xf(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0.0,w=0;t=l;l=l+128|0;s=t+112|0;q=t+104|0;p=t+96|0;e=t+88|0;n=t+16|0;o=t;k=c[a+16>>2]|0;j=T1((d*140|0)+140|0)|0;Af(k,t+116|0,t+80|0);v=+h[b>>3];k=n+48|0;h[k>>3]=v;u=+h[b+8>>3];h[n+56>>3]=u;c[e>>2]=~~(v+(v>=0.0?.5:-.5));c[e+4>>2]=~~(u+(u>=0.0?.5:-.5));i=o+8|0;e=j+(m4(j,81099,e)|0)|0;r=1;g=0;while(1){m=g+3|0;if((m|0)>=(d|0))break;c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];f=1;while(1){if((f|0)==4){f=1;break}w=f+g|0;h[n+(f<<4)>>3]=+h[b+(w<<4)>>3];h[n+(f<<4)+8>>3]=+h[b+(w<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(o,n,3,+(f|0)*.16666666666666666,0,0);u=+h[o>>3];v=+h[i>>3];c[p>>2]=~~(u+(u>=0.0?.5:-.5));c[p+4>>2]=~~(v+(v>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,p)|0)|0;}r=r+6|0;g=m;}c[q>>2]=j;uF(a,81106,q);U1(j);f=r+-1|0;e=0;while(1){if((e|0)>=(r|0))break;c[s>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,s);e=e+1|0;}oF(a,153599)|0;l=t;return}function yf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=l;l=l+16|0;Af(c[a+16>>2]|0,e+8|0,e);Bf(a,b,d,0);l=e;return}function zf(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=81094;c[e+4>>2]=b;uF(a,81087,e);l=d;return}function Af(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function Bf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function Cf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;a:while(1){d=15828;while(1){e=c[d+4>>2]|0;if(!e)break;if(!(s2(e,b)|0)){g=6;break a}d=d+8|0;}c[f>>2]=81255;c[f+4>>2]=b;gA(1,81229,f)|0;d=E4(b,45)|0;if(!d){d=81272;break}a[d>>0]=0;}l=h;return d|0}function Df(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46732]|0;if(!d){c[46733]=64;d=T1(64)|0;c[46732]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46733]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46733]=d;d=W1(c[46732]|0,d)|0;c[46732]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46732]|0}function Ef(){var a=0,b=0;a=l;l=l+16|0;b=a;c[b>>2]=81255;c[b+4>>2]=91269;gA(0,83634,b)|0;l=a;return}function Ff(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0;e=l;l=l+32|0;f=e+8|0;j=e;b=b+8|0;k=c[b>>2]|0;c[j>>2]=k;c[j+4>>2]=k;uF(a,84223,j);i=(+h[d>>3]+ +h[d+16>>3])*.5;g=(+h[d+8>>3]+ +h[d+24>>3])*.5;c[f>>2]=c[b>>2];h[f+8>>3]=i;h[f+16>>3]=g;uF(a,84265,f);l=e;return}function Gf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=l;l=l+48|0;f=e;i=+h[d>>3];k=+h[d+16>>3]-i;g=+h[d+24>>3];j=g-+h[d+8>>3];g=+(~~(+h[a+232>>3]-+h[a+216>>3])>>>0)-g;c[f>>2]=c[b+8>>2];h[f+8>>3]=k;h[f+16>>3]=j;h[f+24>>3]=i;h[f+32>>3]=g;uF(a,84310,f);oF(a,84402)|0;l=e;return}function Hf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return}function If(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0;t=l;l=l+160|0;s=t+152|0;r=t+136|0;q=t+120|0;k=t+112|0;n=t+104|0;m=t+88|0;j=t+72|0;i=t+64|0;o=t;if(!a)qa(111282,84407,212,84426);if(!b)qa(111312,84407,213,84426);p=b+8|0;if(!(c[p>>2]|0))qa(111315,84407,214,84426);if(c[b+52>>2]|0){c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];b=o+32|0;d=d+16|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];f=+h[o>>3];h[o+16>>3]=f;h[o+24>>3]=+h[o+40>>3];h[o+48>>3]=+h[b>>3];g=+h[o+8>>3];h[o+56>>3]=g;if(e<<24>>24){uF(a,84447,i);b=0;while(1){if((b|0)==4)break;u=+h[o+(b<<4)+8>>3];h[j>>3]=+h[o+(b<<4)>>3];h[j+8>>3]=u;uF(a,84450,j);b=b+1|0;}h[m>>3]=f;h[m+8>>3]=g;uF(a,84450,m);m=c[p>>2]|0;c[n>>2]=4;c[n+4>>2]=m;uF(a,84457,n);}uF(a,84447,k);b=0;while(1){if((b|0)==4)break;u=+h[o+(b<<4)+8>>3];h[q>>3]=+h[o+(b<<4)>>3];h[q+8>>3]=u;uF(a,84450,q);b=b+1|0;}h[r>>3]=f;h[r+8>>3]=g;uF(a,84450,r);r=c[p>>2]|0;c[s>>2]=4;c[s+4>>2]=r;uF(a,84472,s);}l=t;return}function Jf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+112|0;n=o+24|0;m=o+16|0;k=o;i=o+28|0;if(!b)qa(111282,84407,153,84488);if(!d)qa(111312,84407,154,84488);if(!(c[d+8>>2]|0))qa(111315,84407,155,84488);j=d+52|0;if(c[j>>2]|0){f=d+60|0;g=c[f>>2]|0;if((g|0)==100)g=18;else {tb[g&127](d);c[j>>2]=0;c[f>>2]=0;c[d+56>>2]=0;g=10;}}else g=10;do if((g|0)==10){if(!((OF(d)|0)<<24>>24))break;f=A6(c[d+20>>2]|0)|0;if((c[d+24>>2]&-2|0)==6){Z4(f,i)|0;i=c[i+36>>2]|0;c[d+56>>2]=i;f=j2(0,i,1,1,f,0)|0;c[j>>2]=f;a[d+16>>0]=1;}else f=c[j>>2]|0;if(f|0)c[d+60>>2]=100;PF(d);if(c[j>>2]|0)g=18;}while(0);if((g|0)==18){p=+h[e+8>>3]-+(c[d+36>>2]|0);h[k>>3]=+h[e>>3]-+(c[d+32>>2]|0);h[k+8>>3]=p;uF(b,84506,k);if(!(a[d+16>>0]|0)){c[m>>2]=c[d+12>>2];uF(b,84537,m);}else zM(b,d);uF(b,84552,n);}l=o;return}function Kf(a){a=a|0;h2(c[a+52>>2]|0,c[a+56>>2]|0)|0;return}function Lf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+80|0;f=g+48|0;if(!a)qa(111282,84407,121,84562);e=c[a+16>>2]|0;if(!e)qa(99902,84407,123,84562);if(!b)qa(111312,84407,124,84562);d=b+8|0;if(!(c[d>>2]|0))qa(111315,84407,125,84562);if(!(c[e+8>>2]|0))qa(138879,84407,128,84562);else {uF(a,84582,g);uF(a,84591,g+8|0);uF(a,84618,g+16|0);uF(a,84643,g+24|0);uF(a,84672,g+32|0);uF(a,84700,g+40|0);c[f>>2]=c[d>>2];uF(a,84707,f);uF(a,84746,g+56|0);uF(a,111008,g+64|0);l=g;return}}function Mf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0.0;i=l;l=l+128|0;g=i+80|0;f=i;if(!a)qa(111282,84407,97,84751);if(!b)qa(111312,84407,98,84751);e=c[b+8>>2]|0;if(!e)qa(111315,84407,99,84751);else {m=+h[d>>3];j=~~(m+(m>=0.0?.5:-.5));m=+h[d+8>>3];b=~~(m+(m>=0.0?.5:-.5));m=+h[d+16>>3];k=~~(m+(m>=0.0?.5:-.5));m=+h[d+24>>3];d=~~(m+(m>=0.0?.5:-.5));c[f>>2]=2;c[f+4>>2]=5;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=-1;c[f+24>>2]=1;c[f+28>>2]=-1;c[f+32>>2]=0;h[f+40>>3]=0.0;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=5;c[f+72>>2]=0;c[f+76>>2]=e;uF(a,84770,f);c[g>>2]=j;c[g+4>>2]=b;c[g+8>>2]=j;c[g+12>>2]=d;c[g+16>>2]=k;c[g+20>>2]=d;c[g+24>>2]=k;c[g+28>>2]=b;c[g+32>>2]=j;c[g+36>>2]=b;uF(a,84828,g);l=i;return}}function Nf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;o=l;l=l+96|0;n=o+56|0;m=o+32|0;k=o;i=+h[d>>3];j=+h[d+16>>3]-i;f=+h[d+24>>3];g=f-+h[d+8>>3];if(!a)qa(111282,84407,53,84860);if(!b)qa(111312,84407,54,84860);e=b+8|0;if(!(c[e>>2]|0))qa(111315,84407,55,84860);oF(a,84879)|0;oF(a,c[e>>2]|0)|0;e=a+360|0;f=-f;if(!(c[e>>2]|0)){h[n>>3]=j;h[n+8>>3]=g;h[n+16>>3]=i;h[n+24>>3]=f;uF(a,85008,n);}else {h[k>>3]=g;h[k+8>>3]=j;h[k+16>>3]=i;h[k+24>>3]=f;uF(a,84899,k);c[m>>2]=c[e>>2];h[m+8>>3]=i;h[m+16>>3]=f;uF(a,84978,m);}oF(a,85087)|0;l=o;return}function Of(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;Pf(b);b=kC(a,b)|0;}c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;Qf(b);b=ZA(a,b)|0;}c=kC(a,c)|0;}return}function Pf(a){a=a|0;var b=0,d=0;TC(a,137447,304,1)|0;sP(a);qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);a=a+16|0;c[(c[a>>2]|0)+176>>2]=0;b=JK(20)|0;d=c[a>>2]|0;c[d+172>>2]=b;c[d+184>>2]=0;d=JK(20)|0;b=c[a>>2]|0;c[b+180>>2]=d;c[b+200>>2]=0;b=JK(12)|0;d=c[a>>2]|0;c[d+196>>2]=b;c[d+192>>2]=0;d=JK(12)|0;b=c[a>>2]|0;c[b+188>>2]=d;c[b+208>>2]=0;b=JK(12)|0;a=c[a>>2]|0;c[a+204>>2]=b;c[a+216>>2]=1;return}function Qf(d){d=d|0;var e=0,f=0,g=0,h=0,i=0;TC(d,137460,176,1)|0;tP(d)|0;h=ZO(d,c[47174]|0,1,0)|0;g=d+16|0;c[(c[g>>2]|0)+156>>2]=h;h=aP(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,c[47168]|0,195059)|0;i=aP(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,c[47168]|0,195059)|0;e=c[g>>2]|0;f=e+154|0;b[f>>1]=1;b[e+168>>1]=1;if((h|0)==(i|0)&(a[h>>0]|0)!=0){b[f>>1]=1e3;i=e+156|0;c[i>>2]=(c[i>>2]|0)*100;}if(Mk(d)|0){i=c[g>>2]|0;b[i+154>>1]=0;c[i+156>>2]=0;}i=(ZO(d,c[47187]|0,0,0)|0)&255;a[(c[g>>2]|0)+152>>0]=i;i=(ZO(d,c[47175]|0,1,0)|0)&65535;b[(c[g>>2]|0)+170>>1]=i;return}function Rf(a){a=a|0;var b=0,d=0;Sf(c[(c[a+16>>2]|0)+192>>2]|0);d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}Tf(d);d=kC(a,d)|0;}Uf(a);return}function Sf(b){b=b|0;var d=0,e=0,f=0,g=0;while(1){if(!b)break;f=b+16|0;g=c[(c[f>>2]|0)+164>>2]|0;Vf(b);d=c[f>>2]|0;if((a[d+156>>0]|0)!=1){b=g;continue}e=c[d+180>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+172>>2]|0;if(e){U1(e);d=c[f>>2]|0;}U1(d);U1(b);b=g;}return}function Tf(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;b=c[e>>2]|0;d=c[b+172>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+180>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+188>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+196>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+204>>2]|0;if(d){U1(d);b=c[e>>2]|0;}CK(c[b+104>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);b=c[(c[e>>2]|0)+8>>2]|0;if(b|0)tb[c[(c[b+4>>2]|0)+4>>2]&127](a);VC(a,137447)|0;return}function Uf(a){a=a|0;var d=0,e=0,f=0;d=OD(a)|0;while(1){if(!d)break;Uf(d);d=PD(d)|0;}if(TC(a,137483,0,1)|0){f=a+16|0;d=c[f>>2]|0;e=c[d+184>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+268>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+216>>2]|0;if(e){U1(e);d=c[f>>2]|0;}do if(c[d+196>>2]|0){e=b[d+236>>1]|0;while(1){if((e|0)>(b[d+238>>1]|0))break;U1(c[(c[d+196>>2]|0)+(e<<6)+12>>2]|0);e=e+1|0;d=c[f>>2]|0;}e=c[d+196>>2]|0;if((b[d+236>>1]|0)==-1){U1(e+-64|0);break}else {U1(e);break}}while(0);if((yC(a)|0)!=(a|0)){CK(c[(c[f>>2]|0)+12>>2]|0);VC(a,137483)|0;}}return}function Vf(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;d=c[e>>2]|0;b=c[d+176>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;b=c[(c[d+172>>2]|0)+(a<<2)>>2]|0;ih(b);U1(c[b+16>>2]|0);U1(b);b=a;d=c[e>>2]|0;}b=c[d+184>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;b=c[(c[(c[e>>2]|0)+180>>2]|0)+(a<<2)>>2]|0;ih(b);U1(c[b+16>>2]|0);U1(b);b=a;}return}function Wf(a){a=a|0;if(tB(a)|0)Xf(a);tM(a);return}function Xf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+48|0;g=h+32|0;f=h;b=lH(a,-1,8)|0;d=mH(a,0,f)|0;kH(a,2,8,f)|0;d=(d|0)==0;e=(b|0)<0;if(e&d)Yf(a);else {if(d)c[f+16>>2]=3;else b=e?8:b;c[f+8>>2]=b;c[f+20>>2]=0;e=GG(a,g,0)|0;b=c[g>>2]|0;do if((b|0)==1){Yf(a);b=0;}else {if(c[(c[(c[a+16>>2]|0)+8>>2]|0)+84>>2]|0){Yf(a);b=0;break}c[f+12>>2]=1;d=0;while(1){if((d|0)>=(b|0))break;b=c[e+(d<<2)>>2]|0;Zf(b,a);Yf(b);d=d+1|0;b=c[g>>2]|0;}_f(a);jH(c[g>>2]|0,e,a,f)|0;$f(a);ag(c[g>>2]|0,e,a);b=0;}while(0);while(1){if((b|0)>=(c[g>>2]|0))break;f=e+(b<<2)|0;U1(c[(c[(c[f>>2]|0)+16>>2]|0)+8>>2]|0);Uf(c[f>>2]|0);wC(a,c[f>>2]|0)|0;b=b+1|0;}U1(e);}l=h;return}function Yf(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+40|0;e=m;i=ZO(a,GA(a,0,85102,0)|0,-1,1)|0;oQ(a,10);d=Lk(a,e)|0;cg(a,a);Of(a);f=(i|0)==1;g=e+32|0;h=(i|0)==2;i=(i|0)==3;j=e+28|0;e=e+24|0;while(1){xj(a,d);if(f){d=3;break}if(c[g>>2]|0){gA(0,85108,k)|0;c[e>>2]=0;d=0;}Hh(a,(d|0)!=0&1);if(h){d=7;break}Ki(a,d);if(i){d=9;break}n=(c[j>>2]|0)+-1|0;c[j>>2]=n;if(!((n|0)!=0&(c[e>>2]|0)!=0)){d=11;break}}if((d|0)==3)dg(a,1);else if((d|0)==7)dg(a,2);else if((d|0)==9)dg(a,2);else if((d|0)==11){if(b[(c[a+16>>2]|0)+136>>1]&16)eg(a);rk(a);ig(a);if((dP(QA(a,85199)|0)|0)<<24>>24)ll(a);}l=m;return}function Zf(b,d){b=b|0;d=d|0;var e=0,f=0;TC(b,137483,280,1)|0;e=JK(96)|0;b=c[b+16>>2]|0;c[b+8>>2]=e;d=c[d+16>>2]|0;f=c[d+8>>2]|0;h[e>>3]=+h[f>>3];h[e+24>>3]=+h[f+24>>3];c[b+144>>2]=c[d+144>>2];a[b+115>>0]=a[d+115>>0]|0;c[b+116>>2]=c[d+116>>2];c[b+248>>2]=c[d+248>>2];c[b+252>>2]=c[d+252>>2];c[b+244>>2]=c[d+244>>2];return}function _f(a){a=a|0;var b=0,d=0,e=0;b=JK((tB(a)|0)<<4)|0;d=jC(a)|0;while(1){if(!d)break;e=c[d+16>>2]|0;c[e+132>>2]=b;h[b>>3]=+h[e+16>>3]*.013888888888888888;h[b+8>>3]=+h[e+24>>3]*.013888888888888888;b=b+16|0;d=kC(a,d)|0;}return}function $f(a){a=a|0;var b=0,d=0,e=0,f=0;e=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;b=e;d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;c[f+132>>2]=0;h[f+16>>3]=+h[b>>3]*72.0;h[f+24>>3]=+h[b+8>>3]*72.0;b=b+16|0;d=kC(a,d)|0;}U1(e);return}function ag(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=0;f=0;while(1){if((e|0)>=(a|0))break;i=(c[(c[(c[b+(e<<2)>>2]|0)+16>>2]|0)+180>>2]|0)+f|0;e=e+1|0;f=i;}i=d+16|0;c[(c[i>>2]|0)+180>>2]=f;g=JK((f<<2)+4|0)|0;c[(c[i>>2]|0)+184>>2]=g;g=0;e=1;while(1){if((g|0)>=(a|0))break;h=(c[b+(g<<2)>>2]|0)+16|0;f=1;while(1){d=c[h>>2]|0;if((f|0)>(c[d+180>>2]|0))break;d=FG(c[(c[d+184>>2]|0)+(f<<2)>>2]|0)|0;c[(c[(c[i>>2]|0)+184>>2]|0)+(e<<2)>>2]=d;bg(c[(c[(c[h>>2]|0)+184>>2]|0)+(f<<2)>>2]|0,d);f=f+1|0;e=e+1|0;}g=g+1|0;}return}function bg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;TC(d,137483,280,1)|0;g=d+16|0;d=(c[g>>2]|0)+16|0;f=b+16|0;b=(c[f>>2]|0)+16|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[d+16>>2]=c[b+16>>2];c[d+20>>2]=c[b+20>>2];c[d+24>>2]=c[b+24>>2];c[d+28>>2]=c[b+28>>2];b=c[f>>2]|0;d=c[g>>2]|0;a[d+275>>0]=a[b+275>>0]|0;d=d+48|0;b=b+48|0;e=d+64|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0;}while((d|0)<(e|0));b=c[(c[f>>2]|0)+180>>2]|0;c[(c[g>>2]|0)+180>>2]=b;d=JK((b<<2)+4|0)|0;c[(c[g>>2]|0)+184>>2]=d;d=1;while(1){e=c[f>>2]|0;if((d|0)>(b|0))break;e=FG(c[(c[e+184>>2]|0)+(d<<2)>>2]|0)|0;c[(c[(c[g>>2]|0)+184>>2]|0)+(d<<2)>>2]=e;bg(c[(c[(c[f>>2]|0)+184>>2]|0)+(d<<2)>>2]|0,e);d=d+1|0;}f=e+12|0;c[(c[g>>2]|0)+12>>2]=c[f>>2];c[f>>2]=0;return}function cg(a,b){a=a|0;b=b|0;if((yC(a)|0)!=(a|0))TC(a,137483,280,1)|0;if((a|0)==(b|0))c[(c[(yC(a)|0)+16>>2]|0)+188>>2]=a;a=OD(a)|0;while(1){if(!a)break;cg(a,b);a=PD(a)|0;}return}function dg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+1040|0;k=m+8|0;j=m;e=m+16|0;f=GA(a,1,87171,195059)|0;g=GA(a,1,85242,195059)|0;h=(b|0)>0;d=(b|0)==1;b=jC(a)|0;while(1){if(!b)break;if(h?(i=b+16|0,c[j>>2]=c[(c[i>>2]|0)+232>>2],m4(e,137395,j)|0,KA(b,f,e)|0,!d):0){c[k>>2]=c[(c[i>>2]|0)+236>>2];m4(e,137395,k)|0;KA(b,g,e)|0;}b=kC(a,b)|0;}l=m;return}function eg(a){a=a|0;var b=0,c=0,d=0;c=ND(a,86675,0)|0;if(c|0){b=jC(c)|0;while(1){if(!b)break;d=kC(c,b)|0;qh(a,b);fg(a,b);Tf(b);vC(a,b)|0;b=d;}RD(a,c)|0;}return}function fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=c[(c[b+16>>2]|0)+232>>2]|0;i=a+16|0;a=c[(c[i>>2]|0)+196>>2]|0;d=c[a+(j<<6)>>2]|0;h=a+(j<<6)+4|0;g=0;e=0;while(1){if((e|0)>=(d|0)){f=7;break}f=c[(c[h>>2]|0)+(e<<2)>>2]|0;e=e+1|0;if((f|0)==(b|0)){f=4;break}else g=f;}if((f|0)==4){while(1){if((e|0)>=(d|0))break;f=c[a+(j<<6)+4>>2]|0;c[f+(e+-1<<2)>>2]=c[f+(e<<2)>>2];f=c[(c[i>>2]|0)+196>>2]|0;e=e+1|0;d=c[f+(j<<6)>>2]|0;a=f;f=4;}c[a+(j<<6)>>2]=d+-1;}else if((f|0)==7?(g|0)!=(b|0):0)qa(85208,85215,248,85225);return}function gg(a){a=a|0;return c[(c[(yC(a)|0)+16>>2]|0)+188>>2]|0}function hg(b,c){b=b|0;c=c|0;var d=0;d=a[b+28>>0]|0;if(a[c+28>>0]|0)if(d<<24>>24){d=~~(+h[b>>3]-+h[c>>3]);if(!d)d=~~(+h[b+8>>3]-+h[c+8>>3]);}else d=-1;else d=d<<24>>24!=0&1;return d|0}function ig(a){a=a|0;jg(a,1);return}function jg(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0.0;Z=l;l=l+656|0;O=Z+592|0;N=Z+552|0;f=Z+544|0;T=Z+96|0;U=Z;Y=Z+632|0;V=d+16|0;X=b[(c[V>>2]|0)+136>>1]&14;P=X&65535;Q=T+16|0;c[Q>>2]=Z+368;R=U+16|0;c[R>>2]=Z+192;do if(X<<16>>16){S=X<<16>>16==4;do if(S){kg(d);if(!(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1))A=9;else {gA(0,85248,f)|0;A=9;}}else if(X<<16>>16==8){kg(d);if(!(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1)){rQ(d,0);n=0;m=0;k=0;break}else {lg(d);rQ(d,1);n=0;m=0;k=0;break}}else A=9;while(0);if((A|0)==9){jl(d);if(FM()|0)break;W=JK(96)|0;K=c[(c[V>>2]|0)+248>>2]|0;c[Y+8>>2]=(K|0)/4|0;c[Y+12>>2]=K;k=JK(512)|0;F=Y+4|0;c[F>>2]=0;c[Y>>2]=0;j=c[V>>2]|0;C=b[j+236>>1]|0;D=0;L=0;M=k;E=k;m=k;n=k;o=k;H=0;I=0;a:while(1){if((C|0)>(b[j+238>>1]|0))break;p=c[j+196>>2]|0;i=c[p+(C<<6)>>2]|0;G=i+D|0;g=c[p+(C<<6)+4>>2]|0;f=c[g>>2]|0;if(!f)f=H;else {_=+(H|0);f=c[f+16>>2]|0;y=+h[f+16>>3]-+h[f+88>>3];f=~~(y>_?_:y);}if((i|0)!=0?(J=c[g+(i+-1<<2)>>2]|0,(J|0)!=0):0){y=+(I|0);g=c[J+16>>2]|0;_=+h[g+96>>3]+ +h[g+16>>3];g=~~(_=(i|0))break;k=c[(c[f+(C<<6)+4>>2]|0)+(x<<2)>>2]|0;w=k+16|0;f=c[w>>2]|0;i=c[f+112>>2]|0;if(i){i=i+16|0;j=c[(c[i>>2]|0)+96>>2]|0;if(!j){A=21;break a}s=j+56|0;f=f+16|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];a[(c[(c[i>>2]|0)+96>>2]|0)+81>>0]=1;f=c[w>>2]|0;}if((a[f+156>>0]|0)!=0?(kb[c[17300>>2]&63](k)|0)<<24>>24==0:0){q=t;f=r;j=u;k=v;i=o;}else {s=0;q=t;j=u;k=v;A=25;}b:do if((A|0)==25){while(1){A=0;p=c[w>>2]|0;i=c[(c[p+180>>2]|0)+(s<<2)>>2]|0;if(!i)break;switch(a[(c[i+16>>2]|0)+112>>0]|0){case 6:case 4:{f=q;i=r;break}default:{mg(i,1,16,64);f=q+1|0;c[r+(q<<2)>>2]=i;if(!(f&127)){g=MK(g,(q<<2)+516|0)|0;i=g;j=g;k=g;n=g;o=g;}else i=r;}}s=s+1|0;q=f;r=i;A=25;}f=c[p+188>>2]|0;c:do if(!f)i=o;else {s=0;i=o;while(1){f=c[f+(s<<2)>>2]|0;if(!f)break c;mg(f,2,0,128);o=q+1|0;c[r+(q<<2)>>2]=f;if(!(o&127)){g=MK(i,(q<<2)+516|0)|0;f=g;j=g;k=g;n=g;i=g;}else f=r;p=c[w>>2]|0;s=s+1|0;q=o;r=f;f=c[p+188>>2]|0;}}while(0);f=c[p+204>>2]|0;if(!f)f=r;else {if(!(a[p+156>>0]|0)){v=p+96|0;_=+h[v>>3];s=p+240|0;h[v>>3]=+h[s>>3];h[s>>3]=_;s=0;p=r;}else {s=0;p=r;}while(1){f=c[f+(s<<2)>>2]|0;if(!f){f=p;break b}mg(f,0,0,128);o=q+1|0;c[p+(q<<2)>>2]=f;if(!(o&127)){g=MK(n,(q<<2)+516|0)|0;f=g;j=g;k=g;n=g;i=g;}else f=p;s=s+1|0;q=o;p=f;f=c[(c[w>>2]|0)+204>>2]|0;}}}while(0);u=c[V>>2]|0;w=c[u+196>>2]|0;x=x+1|0;t=q;r=f;q=u;u=j;v=k;o=i;i=c[w+(C<<6)>>2]|0;f=w;}C=C+1|0;D=G;L=t;M=r;E=u;j=q;m=v;k=g;H=B;I=z;}if((A|0)==21)qa(85316,85329,313,85342);c[Y>>2]=H;c[F>>2]=I;o4(E,L,4,58);c[W+84>>2]=JK((D<<5)+11520|0)|0;c[Y+16>>2]=JK(C<<5)|0;d:do if(X<<16>>16==2){f=(c[V>>2]|0)+192|0;while(1){g=c[f>>2]|0;if(!g)break d;i=g+16|0;f=c[i>>2]|0;if((a[f+156>>0]|0)==1?(c[f+104>>2]|0)!=0:0){og(g);f=c[i>>2]|0;}f=f+164|0;}}while(0);z=U+48|0;A=U+-48|0;B=T+48|0;C=T+-48|0;y=+(K|0);x=0;e:while(1){if((x|0)>=(L|0))break;v=M+(x<<2)|0;r=c[v>>2]|0;s=pg(r)|0;t=r+16|0;g=c[t>>2]|0;if(!(a[g+44>>0]|0)){g=(a[g+84>>0]|0)==0?s:r;f=g;g=c[g+16>>2]|0;}else f=r;i=f+16|0;if(c[g+164>>2]&32){g=c[Q>>2]|0;W6(g|0,c[i>>2]|0,176)|0;n=T;o=f;p=n+48|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));c[Q>>2]=g;o=c[f>>2]&3;n=c[T>>2]&3;c[((n|0)==3?T:B)+40>>2]=c[((o|0)==2?f:f+-48|0)+40>>2];c[((n|0)==2?T:C)+40>>2]=c[((o|0)==3?f:f+48|0)+40>>2];n=g+16|0;o=(c[i>>2]|0)+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=g+56|0;o=(c[i>>2]|0)+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));a[g+112>>0]=1;c[g+116>>2]=f;f=T;}q=f+16|0;w=1;f=x;while(1){u=f+1|0;if((u|0)>=(L|0))break;j=M+(u<<2)|0;f=c[j>>2]|0;if((s|0)!=(pg(f)|0))break;if(!(a[(c[t>>2]|0)+113>>0]|0)){k=f+16|0;g=c[k>>2]|0;if(!(a[g+44>>0]|0)){g=(a[g+84>>0]|0)==0?s:f;f=g;g=c[g+16>>2]|0;}i=f+16|0;if(c[g+164>>2]&32){g=c[R>>2]|0;W6(g|0,c[i>>2]|0,176)|0;n=U;o=f;p=n+48|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));c[R>>2]=g;o=c[f>>2]&3;n=c[U>>2]&3;c[((n|0)==3?U:z)+40>>2]=c[((o|0)==2?f:f+-48|0)+40>>2];c[((n|0)==2?U:A)+40>>2]=c[((o|0)==3?f:f+48|0)+40>>2];n=g+16|0;o=(c[i>>2]|0)+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=g+56|0;o=(c[i>>2]|0)+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));a[g+112>>0]=1;c[g+116>>2]=f;}i=c[q>>2]|0;f=g+16|0;n=N;o=i+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=O;o=f;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));if(hg(N,O)|0)break;f=g+56|0;n=N;o=i+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=O;o=f;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));if(hg(N,O)|0)break;K=c[t>>2]|0;if((c[K+164>>2]&15|0)==2?(c[K+96>>2]|0)!=(c[(c[k>>2]|0)+96>>2]|0):0)break;if(c[(c[(c[j>>2]|0)+16>>2]|0)+164>>2]&64|0)break}w=w+1|0;f=u;}if(S){if((w|0)==1)f=O;else f=JK(w<<2)|0;c[f>>2]=pg(c[v>>2]|0)|0;g=1;while(1){if((g|0)>=(w|0))break;c[f+(g<<2)>>2]=c[v+(g<<2)>>2];g=g+1|0;}PM(d,f,w,P,17296);if((w|0)>1)U1(f);x=u;continue}f=c[r>>2]&3;K=c[((f|0)==3?r:r+48|0)+40>>2]|0;f=c[((f|0)==2?r:r+-48|0)+40>>2]|0;g=c[K+16>>2]|0;i=c[g+232>>2]|0;if((K|0)!=(f|0))if((i|0)==(c[(c[f+16>>2]|0)+232>>2]|0)){qg(d,Y,W,M,x,w,P);x=u;continue}else {rg(d,Y,W,M,x,w,P);x=u;continue}f=c[V>>2]|0;do if((i|0)==(b[f+238>>1]|0))if((i|0)>0){f=~~(+h[(c[(c[c[(c[f+196>>2]|0)+(i+-1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[g+24>>3]);break}else {f=~~+h[g+80>>3];break}else if((i|0)==(b[f+236>>1]|0)){f=~~(+h[g+24>>3]-+h[(c[(c[c[(c[f+196>>2]|0)+(i+1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]);break}else {f=c[f+196>>2]|0;_=+h[g+24>>3];K=~~(+h[(c[(c[c[f+(i+-1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-_);f=~~(_-+h[(c[(c[c[f+(i+1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]);f=(K|0)<(f|0)?K:f;break}while(0);lO(W,M,x,w,y,+((f|0)/2|0|0),17296);f=0;while(1){if((f|0)>=(w|0)){x=u;continue e}g=c[(c[(c[M+(f+x<<2)>>2]|0)+16>>2]|0)+96>>2]|0;if(g|0)zP(d,g);f=f+1|0;}}f=(c[V>>2]|0)+192|0;while(1){g=c[f>>2]|0;if(!g)break;i=g+16|0;f=c[i>>2]|0;if((a[f+156>>0]|0)==1?(c[f+104>>2]|0)!=0:0){og(g);zP(d,c[(c[i>>2]|0)+104>>2]|0);f=c[i>>2]|0;}f=f+164|0;}if(!e){n=W;k=W;}else {sg(d);n=W;k=W;}}f:do if((c[47197]|0)!=0|(c[47198]|0)!=0?(c[47203]|0)!=0|(c[47202]|0)!=0:0){j=jC(d)|0;while(1){if(!j)break f;g:do if(c[47197]|0){f=_A(d,j)|0;while(1){if(!f)break g;g=f+-48|0;i=(c[f>>2]&3|0)==2?f:g;if(c[(c[i+16>>2]|0)+100>>2]|0){tO(i,1)|0;zP(d,c[(c[((c[f>>2]&3|0)==2?f:g)+16>>2]|0)+100>>2]|0);}f=$A(d,f)|0;}}while(0);h:do if(c[47198]|0){f=XA(d,j)|0;while(1){if(!f)break h;g=f+16|0;if(c[(c[g>>2]|0)+104>>2]|0?tO(f,0)|0:0)zP(d,c[(c[g>>2]|0)+104>>2]|0);f=ZA(d,f)|0;}}while(0);j=kC(d,j)|0;}}while(0);switch(X&15){case 4:case 8:break;default:{U1(m);U1(c[n+84>>2]|0);U1(k);U1(c[Y+16>>2]|0);GM();}}c[47138]=1;c[47139]=1;}while(0);l=Z;return}function kg(a){a=a|0;var b=0,d=0,e=0.0,f=0;b=jC(a)|0;while(1){if(!b)break;d=c[b+16>>2]|0;if(c[d+204>>2]|0){f=d+96|0;e=+h[f>>3];d=d+240|0;h[f>>3]=+h[d>>3];h[d>>3]=e;}b=kC(a,b)|0;}return}function lg(b){b=b|0;var d=0,e=0,f=0,g=0;d=(c[b+16>>2]|0)+192|0;a:while(1){f=c[d>>2]|0;if(!f){d=12;break}g=f+16|0;d=c[g>>2]|0;do if((a[d+156>>0]|0)==1){e=c[d+112>>2]|0;if(!e){e=c[d+104>>2]|0;if(!e)break;og(f);d=e;}else {e=c[(c[e+16>>2]|0)+96>>2]|0;if(!e){d=6;break a}f=e+56|0;d=d+16|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];a[e+81>>0]=1;d=e;}zP(b,d);d=c[g>>2]|0;}while(0);d=d+164|0;}if((d|0)==6)qa(85516,85329,234,85535);else if((d|0)==12)return}function mg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;do if(!d){g=c[b>>2]&3;d=c[((g|0)==3?b:b+48|0)+40>>2]|0;g=c[((g|0)==2?b:b+-48|0)+40>>2]|0;if((d|0)!=(g|0)){d=(c[(c[d+16>>2]|0)+232>>2]|0)==(c[(c[g+16>>2]|0)+232>>2]|0)?2:1;break}d=c[b+16>>2]|0;if(!(a[d+44>>0]|0))d=(a[d+84>>0]|0)==0?8:4;else d=4;}while(0);a:do if(!e)switch(d|0){case 1:{e=c[b>>2]&3;e=(c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)<(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)?16:32;break a}case 2:{e=c[b>>2]&3;e=(c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)<(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)?16:32;break a}default:{e=16;break a}}while(0);c[(c[b+16>>2]|0)+164>>2]=d|f|e;return}function ng(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;D=l;l=l+624|0;z=D+584|0;y=D+544|0;s=D+368|0;e=D+192|0;t=D+96|0;v=D;u=t+16|0;c[u>>2]=s;w=v+16|0;c[w>>2]=e;C=c[b>>2]|0;B=c[d>>2]|0;x=C+16|0;q=c[x>>2]|0;d=c[q+164>>2]|0;f=d&15;A=B+16|0;b=c[A>>2]|0;g=c[b+164>>2]&15;do if((g|0)==(f|0)){p=pg(C)|0;r=pg(B)|0;n=c[p>>2]|0;g=n&3;f=c[(c[((g|0)==3?p:p+48|0)+40>>2]|0)+16>>2]|0;g=c[(c[((g|0)==2?p:p+-48|0)+40>>2]|0)+16>>2]|0;i=(c[f+232>>2]|0)-(c[g+232>>2]|0)|0;o=c[r>>2]|0;m=o&3;k=c[(c[((m|0)==3?r:r+48|0)+40>>2]|0)+16>>2]|0;m=c[(c[((m|0)==2?r:r+-48|0)+40>>2]|0)+16>>2]|0;j=(c[k+232>>2]|0)-(c[m+232>>2]|0)|0;i=(i|0)>-1?i:0-i|0;j=(j|0)>-1?j:0-j|0;if((i|0)!=(j|0)){b=i-j|0;break}g=~~(+h[f+16>>3]-+h[g+16>>3]);g=(g|0)>-1?g:0-g|0;f=~~(+h[k+16>>3]-+h[m+16>>3]);f=(f|0)>-1?f:0-f|0;if((g|0)!=(f|0)){b=g-f|0;break}g=n>>>4;f=o>>>4;if((g|0)!=(f|0)){b=g-f|0;break}if(!(a[q+44>>0]|0)){d=(a[q+84>>0]|0)==0?p:C;g=d;d=c[(c[d+16>>2]|0)+164>>2]|0;}else g=C;f=g+16|0;if(d&32){W6(s|0,c[f>>2]|0,176)|0;i=t;j=g;k=i+48|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));c[u>>2]=s;j=c[g>>2]&3;i=c[t>>2]&3;c[((i|0)==3?t:t+48|0)+40>>2]=c[((j|0)==2?g:g+-48|0)+40>>2];c[((i|0)==2?t:t+-48|0)+40>>2]=c[((j|0)==3?g:g+48|0)+40>>2];i=s+16|0;j=(c[f>>2]|0)+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=s+56|0;j=(c[f>>2]|0)+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));a[s+112>>0]=1;c[s+116>>2]=g;g=t;b=c[A>>2]|0;}if(!(a[b+44>>0]|0)){b=(a[b+84>>0]|0)==0?r:B;f=b;b=c[b+16>>2]|0;}else f=B;d=f+16|0;if(!(c[b+164>>2]&32))e=b;else {W6(e|0,c[d>>2]|0,176)|0;i=v;j=f;k=i+48|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));c[w>>2]=e;j=c[f>>2]&3;i=c[v>>2]&3;c[((i|0)==3?v:v+48|0)+40>>2]=c[((j|0)==2?f:f+-48|0)+40>>2];c[((i|0)==2?v:v+-48|0)+40>>2]=c[((j|0)==3?f:f+48|0)+40>>2];i=e+16|0;j=(c[d>>2]|0)+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=e+56|0;j=(c[d>>2]|0)+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));a[e+112>>0]=1;c[e+116>>2]=f;}d=c[g+16>>2]|0;b=e+16|0;i=y;j=d+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=z;j=b;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));b=hg(y,z)|0;if(!b){b=e+56|0;i=y;j=d+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=z;j=b;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));b=hg(y,z)|0;if(!b){d=c[(c[x>>2]|0)+164>>2]&192;b=c[(c[A>>2]|0)+164>>2]&192;if((d|0)==(b|0)){b=((c[C>>2]|0)>>>4)-((c[B>>2]|0)>>>4)|0;break}else {b=d-b|0;break}}}}else b=g-f|0;while(0);l=D;return b|0}function og(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;f=b+16|0;d=c[f>>2]|0;if(c[d+176>>2]|0){d=c[d+180>>2]|0;while(1){d=(c[d>>2]|0)+16|0;e=c[d>>2]|0;if(!(a[e+112>>0]|0))break;else d=e+116|0;}e=c[e+96>>2]|0;g=+h[e+24>>3];i=+h[e+32>>3];e=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)!=0;b=c[f>>2]|0;f=c[(c[d>>2]|0)+96>>2]|0;h[f+56>>3]=(e?i:g)*.5+ +h[b+16>>3];h[f+64>>3]=+h[b+24>>3];a[f+81>>0]=1;}return}function pg(a){a=a|0;var b=0,d=0;while(1){b=c[a+16>>2]|0;d=c[b+172>>2]|0;if(!d)break;else a=d;}while(1){b=c[b+116>>2]|0;if(!b)break;a=b;b=c[b+16>>2]|0;}return a|0}function qg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0;B=l;l=l+1712|0;x=B+1664|0;s=B+1488|0;t=B+1392|0;A=B+1696|0;y=B+696|0;z=B;p=t+16|0;c[p>>2]=s;q=c[f+(g<<2)>>2]|0;r=q+16|0;k=c[r>>2]|0;u=a[k+113>>0]|0;if(c[k+164>>2]&32){W6(s|0,k|0,176)|0;k=t;n=q;o=k+48|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));c[p>>2]=s;k=c[t>>2]&3;c[((k|0)==3?t:t+48|0)+40>>2]=c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2];c[((k|0)==2?t:t+-48|0)+40>>2]=c[((c[q>>2]&3|0)==3?q:q+48|0)+40>>2];k=s+16|0;n=(c[r>>2]|0)+56|0;o=k+40|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));k=s+56|0;n=(c[r>>2]|0)+16|0;o=k+40|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));a[s+112>>0]=1;c[s+116>>2]=q;q=t;}k=1;while(1){if((k|0)>=(i|0)){w=6;break}if(!(a[(c[(c[f+(k+g<<2)>>2]|0)+16>>2]|0)+113>>0]|0))k=k+1|0;else {w=7;break}}a:do if((w|0)==6)if(!(u<<24>>24)){k=c[q+16>>2]|0;if(c[k+96>>2]|0){Qg(b,d,e,q,j);break}if((j|0)==2){A=c[q>>2]&3;Rg(c[((A|0)==3?q:q+48|0)+40>>2]|0,c[((A|0)==2?q:q+-48|0)+40>>2]|0,f,g,i,2);break}t=a[k+49>>0]|0;u=a[k+89>>0]|0;if(!(t<<24>>24==1&u<<24>>24!=4)?!(t<<24>>24!=4&u<<24>>24==1):0){p=c[q>>2]&3;o=c[((p|0)==3?q:q+48|0)+40>>2]|0;p=c[((p|0)==2?q:q+-48|0)+40>>2]|0;k=c[o+16>>2]|0;n=c[k+232>>2]|0;if((n|0)>0){u=c[(c[b+16>>2]|0)+196>>2]|0;t=n+~(a[(c[(c[b+60>>2]|0)+16>>2]|0)+113>>0]&1)|0;m=+h[(c[(c[c[u+(t<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[u+(t<<6)+16>>3]-+h[k+24>>3]-+h[u+(n<<6)+24>>3];}else m=+(c[(c[b+16>>2]|0)+252>>2]|0);C=+(i+1|0);v=+(c[d+12>>2]|0)/C;m=m/C;Tg(b,d,e,o,q,y,1);Tg(b,d,e,p,q,z,0);s=y+52|0;t=z+52|0;p=(j|0)==10;q=e+80|0;k=0;while(1){if((k|0)>=(i|0))break a;r=c[f+(k+g<<2)>>2]|0;o=c[s>>2]|0;n=o+-1|0;G=+h[y+56+(n<<5)>>3];F=+h[y+56+(n<<5)+16>>3];E=+h[y+56+(n<<5)+24>>3];h[19215]=G;h[19216]=E;k=k+1|0;C=+(k|0);D=v*C;h[19217]=F+D;C=E+m*C;h[19218]=C;h[19219]=G;h[19220]=C;n=(c[t>>2]|0)+-1|0;G=+h[z+56+(n<<5)+16>>3];h[19221]=G;h[19222]=C+m;E=+h[z+56+(n<<5)>>3];F=+h[z+56+(n<<5)+24>>3];h[19225]=G;h[19224]=F;h[19223]=E-D;h[19226]=C;n=0;while(1){if((n|0)>=(o|0)){n=0;break}o=y+56+(n<<5)|0;c[x>>2]=c[o>>2];c[x+4>>2]=c[o+4>>2];c[x+8>>2]=c[o+8>>2];c[x+12>>2]=c[o+12>>2];c[x+16>>2]=c[o+16>>2];c[x+20>>2]=c[o+20>>2];c[x+24>>2]=c[o+24>>2];c[x+28>>2]=c[o+28>>2];fO(e,x);n=n+1|0;o=c[s>>2]|0;}while(1){if((n|0)==3)break;j=153720+(n<<5)|0;c[x>>2]=c[j>>2];c[x+4>>2]=c[j+4>>2];c[x+8>>2]=c[j+8>>2];c[x+12>>2]=c[j+12>>2];c[x+16>>2]=c[j+16>>2];c[x+20>>2]=c[j+20>>2];c[x+24>>2]=c[j+24>>2];c[x+28>>2]=c[j+28>>2];fO(e,x);n=n+1|0;}o=c[t>>2]|0;while(1){n=o+-1|0;if((o|0)<=0)break;o=z+56+(n<<5)|0;c[x>>2]=c[o>>2];c[x+4>>2]=c[o+4>>2];c[x+8>>2]=c[o+8>>2];c[x+12>>2]=c[o+12>>2];c[x+16>>2]=c[o+16>>2];c[x+20>>2]=c[o+20>>2];c[x+24>>2]=c[o+24>>2];c[x+28>>2]=c[o+28>>2];fO(e,x);o=n;}if(p)n=HM(e,A)|0;else n=NM(e,A)|0;o=c[A>>2]|0;if(!o)break a;dO(r,c[((c[r>>2]&3|0)==2?r:r+-48|0)+40>>2]|0,n,o,17296);c[q>>2]=0;}}Sg(b,d,e,f,g,i,q,(j|0)==10&1);}else w=7;while(0);if((w|0)==7)Pg(b,f,g,i,q,j);l=B;return}function rg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;ba=l;l=l+2576|0;S=ba+2528|0;_=ba+2568|0;k=ba+2352|0;n=ba+2176|0;t=ba+1904|0;Y=ba+1808|0;$=ba+1712|0;T=ba+1016|0;U=ba+320|0;V=ba+256|0;X=ba+2564|0;Z=ba+2560|0;z=ba+288|0;A=ba+224|0;L=ba+192|0;M=ba+160|0;N=ba+128|0;P=ba+96|0;Q=ba+64|0;R=ba+32|0;W=ba;s=t+16|0;c[s>>2]=k;o=Y+16|0;c[o>>2]=n;aa=$+16|0;c[aa>>2]=ba+2e3;if(!(c[46734]|0)){c[46734]=KK(32e3)|0;c[46735]=KK(32e3)|0;c[46736]=2e3;c[46737]=2e3;}u=c[f+(g<<2)>>2]|0;K=c[u>>2]&3;p=u+48|0;q=u+-48|0;K=(c[(c[(c[((K|0)==3?u:p)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((K|0)==2?u:q)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0;r=u+16|0;if((((K|0)>-1?K:0-K|0)|0)<=1){k=c[r>>2]|0;if(!(c[k+164>>2]&32)){K=u;n=0;}else {n=c[s>>2]|0;W6(n|0,k|0,176)|0;w=t;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[s>>2]=n;w=c[t>>2]&3;c[((w|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];c[((w|0)==2?t:t+-48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=n+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[s>>2]|0;w=k+56|0;x=(c[r>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;n=0;J=12;}}else {W6(k|0,c[r>>2]|0,176)|0;w=t;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));w=t+48|0;x=p;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[s>>2]=k;k=c[r>>2]|0;if(!(c[k+164>>2]&32)){W6(n|0,k|0,176)|0;w=Y;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[o>>2]=n;o=c[t>>2]|0;c[((o&3|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=Y+48|0;x=p;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0))}else {n=c[o>>2]|0;W6(n|0,k|0,176)|0;w=Y;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[o>>2]=n;w=c[Y>>2]&3;c[((w|0)==3?Y:Y+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];c[((w|0)==2?Y:Y+-48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=n+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[o>>2]|0;w=k+56|0;x=(c[r>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;c[k+116>>2]=u;o=c[t>>2]|0;c[((o&3|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];w=(c[s>>2]|0)+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0))}k=pg(u)|0;while(1){n=c[(c[k+16>>2]|0)+172>>2]|0;if(!n)break;else k=n;}c[((o&3|0)==2?t:t+-48|0)+40>>2]=c[((c[k>>2]&3|0)==2?k:k+-48|0)+40>>2];k=c[s>>2]|0;a[k+84>>0]=0;a[k+112>>0]=1;n=k+56|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;n=1;J=12;}if((J|0)==12){c[k+116>>2]=u;K=t;}H=(j|0)==2;if(H?(v=vg(b,K,c[46734]|0,_)|0,c[Z>>2]=v,(v|0)!=0):0)J=63;else J=15;a:do if((J|0)==15){G=(j|0)==10;c[Z>>2]=0;o=c[K>>2]&3;k=c[((o|0)==3?K:K+48|0)+40>>2]|0;o=c[((o|0)==2?K:K+-48|0)+40>>2]|0;c[_>>2]=o;wg(z,b,d,k,0,K);c[T>>2]=c[z>>2];c[T+4>>2]=c[z+4>>2];c[T+8>>2]=c[z+8>>2];c[T+12>>2]=c[z+12>>2];c[T+16>>2]=c[z+16>>2];c[T+20>>2]=c[z+20>>2];c[T+24>>2]=c[z+24>>2];c[T+28>>2]=c[z+28>>2];c[V>>2]=c[z>>2];c[V+4>>2]=c[z+4>>2];c[V+8>>2]=c[z+8>>2];c[V+12>>2]=c[z+12>>2];c[V+16>>2]=c[z+16>>2];c[V+20>>2]=c[z+20>>2];gO(e,K,1,T,xg(k)|0);B=T+52|0;I=(c[B>>2]|0)+-1|0;D=V+24|0;h[D>>3]=+h[T+56+(I<<5)+24>>3];E=V+8|0;h[E>>3]=+h[T+56+(I<<5)+8>>3];I=c[k+16>>2]|0;F=b+16|0;m=+h[I+24>>3]-+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[I+232>>2]<<6)+16>>3];c[S>>2]=c[V>>2];c[S+4>>2]=c[V+4>>2];c[S+8>>2]=c[V+8>>2];c[S+12>>2]=c[V+12>>2];c[S+16>>2]=c[V+16>>2];c[S+20>>2]=c[V+20>>2];c[S+24>>2]=c[V+24>>2];c[S+28>>2]=c[V+28>>2];yg(A,S,1,m);c[V>>2]=c[A>>2];c[V+4>>2]=c[A+4>>2];c[V+8>>2]=c[A+8>>2];c[V+12>>2]=c[A+12>>2];c[V+16>>2]=c[A+16>>2];c[V+20>>2]=c[A+20>>2];c[V+24>>2]=c[A+24>>2];c[V+28>>2]=c[A+28>>2];A=V+16|0;if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){I=c[B>>2]|0;c[B>>2]=I+1;I=T+56+(I<<5)|0;c[I>>2]=c[V>>2];c[I+4>>2]=c[V+4>>2];c[I+8>>2]=c[V+8>>2];c[I+12>>2]=c[V+12>>2];c[I+16>>2]=c[V+16>>2];c[I+20>>2]=c[V+20>>2];c[I+24>>2]=c[V+24>>2];c[I+28>>2]=c[V+28>>2];}w=b+60|0;C=U+52|0;x=e+56|0;y=e+69|0;j=e+16|0;z=e+29|0;I=K;q=0;r=-1;b:while(1){s=k;t=0;k=0;u=I;while(1){p=o;v=o;if((a[(c[p+16>>2]|0)+156>>0]|0)!=1)break b;if((kb[c[17300>>2]&63](p)|0)<<24>>24)break b;o=t|1;ca=153720+(t<<5)|0;zg(L,d,b,c[(c[s+16>>2]|0)+232>>2]|0);c[ca>>2]=c[L>>2];c[ca+4>>2]=c[L+4>>2];c[ca+8>>2]=c[L+8>>2];c[ca+12>>2]=c[L+12>>2];c[ca+16>>2]=c[L+16>>2];c[ca+20>>2]=c[L+20>>2];c[ca+24>>2]=c[L+24>>2];c[ca+28>>2]=c[L+28>>2];if(!k){q=Ag(p)|0;k=(q|0)<((a[(c[(c[w>>2]|0)+16>>2]|0)+113>>0]<<1&2)+3&255|0);q=k?q:q+-2|0;r=k?r:1;k=(k^1)&1;}if(!((k|0)==0|(r|0)>0))break;ca=153720+(o<<5)|0;wg(M,b,d,p,u,c[c[(c[p+16>>2]|0)+180>>2]>>2]|0);c[ca>>2]=c[M>>2];c[ca+4>>2]=c[M+4>>2];c[ca+8>>2]=c[M+8>>2];c[ca+12>>2]=c[M+12>>2];c[ca+16>>2]=c[M+16>>2];c[ca+20>>2]=c[M+20>>2];c[ca+24>>2]=c[M+24>>2];c[ca+28>>2]=c[M+28>>2];ca=c[c[(c[v+16>>2]|0)+180>>2]>>2]|0;o=c[ca>>2]&3;s=c[((o|0)==3?ca:ca+48|0)+40>>2]|0;o=c[((o|0)==2?ca:ca+-48|0)+40>>2]|0;c[_>>2]=o;t=t+2|0;r=r+-1|0;u=ca;}wg(N,b,d,p,u,c[c[(c[p+16>>2]|0)+180>>2]>>2]|0);c[U>>2]=c[N>>2];c[U+4>>2]=c[N+4>>2];c[U+8>>2]=c[N+8>>2];c[U+12>>2]=c[N+12>>2];c[U+16>>2]=c[N+16>>2];c[U+20>>2]=c[N+20>>2];c[U+24>>2]=c[N+24>>2];c[U+28>>2]=c[N+28>>2];jO(e,u,1,U,xg(c[((c[u>>2]&3|0)==2?u:u+-48|0)+40>>2]|0)|0);ca=U+56+((c[C>>2]|0)+-1<<5)|0;t=c[v+16>>2]|0;m=+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[t+232>>2]<<6)+24>>3]+ +h[t+24>>3];c[S>>2]=c[ca>>2];c[S+4>>2]=c[ca+4>>2];c[S+8>>2]=c[ca+8>>2];c[S+12>>2]=c[ca+12>>2];c[S+16>>2]=c[ca+16>>2];c[S+20>>2]=c[ca+20>>2];c[S+24>>2]=c[ca+24>>2];c[S+28>>2]=c[ca+28>>2];yg(V,S,4,m);if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[C>>2]|0;c[C>>2]=ca+1;ca=U+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}h[x>>3]=1.5707963267948966;a[y>>0]=1;Bg(e,I,u,T,U,o);if(!G){k=NM(e,X)|0;o=c[X>>2]|0;if(H&(o|0)>4){ca=k+16|0;c[ca>>2]=c[k>>2];c[ca+4>>2]=c[k+4>>2];c[ca+8>>2]=c[k+8>>2];c[ca+12>>2]=c[k+12>>2];ca=k+32|0;o=k+(o+-1<<4)|0;c[ca>>2]=c[o>>2];c[ca+4>>2]=c[o+4>>2];c[ca+8>>2]=c[o+8>>2];c[ca+12>>2]=c[o+12>>2];X6(k+48|0,o|0,16)|0;c[X>>2]=4;o=4;}else J=33;}else {k=HM(e,X)|0;o=c[X>>2]|0;J=33;}if((J|0)==33){J=0;if(!o)break a}u=c[Z>>2]|0;p=u+o|0;if((p|0)>(c[46736]|0)){c[46736]=p<<1;t=MK(c[46734]|0,p<<5)|0;c[46734]=t;o=c[X>>2]|0;}else t=c[46734]|0;s=0;p=u;while(1){if((s|0)>=(o|0))break;ca=t+(p<<4)|0;u=k+(s<<4)|0;c[ca>>2]=c[u>>2];c[ca+4>>2]=c[u+4>>2];c[ca+8>>2]=c[u+8>>2];c[ca+12>>2]=c[u+12>>2];s=s+1|0;p=p+1|0;}c[Z>>2]=p;o=Cg(c[c[(c[v+16>>2]|0)+180>>2]>>2]|0,q,t,Z)|0;Dg(I,e);p=c[o>>2]&3;k=c[((p|0)==3?o:o+48|0)+40>>2]|0;p=c[((p|0)==2?o:o+-48|0)+40>>2]|0;c[_>>2]=p;I=k+16|0;wg(P,b,d,k,c[c[(c[I>>2]|0)+172>>2]>>2]|0,o);c[T>>2]=c[P>>2];c[T+4>>2]=c[P+4>>2];c[T+8>>2]=c[P+8>>2];c[T+12>>2]=c[P+12>>2];c[T+16>>2]=c[P+16>>2];c[T+20>>2]=c[P+20>>2];c[T+24>>2]=c[P+24>>2];c[T+28>>2]=c[P+28>>2];gO(e,o,1,T,xg(k)|0);ca=T+56+((c[B>>2]|0)+-1<<5)|0;I=c[I>>2]|0;m=+h[I+24>>3]-+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[I+232>>2]<<6)+16>>3];c[S>>2]=c[ca>>2];c[S+4>>2]=c[ca+4>>2];c[S+8>>2]=c[ca+8>>2];c[S+12>>2]=c[ca+12>>2];c[S+16>>2]=c[ca+16>>2];c[S+20>>2]=c[ca+20>>2];c[S+24>>2]=c[ca+24>>2];c[S+28>>2]=c[ca+28>>2];yg(V,S,1,m);if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[B>>2]|0;c[B>>2]=ca+1;ca=T+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}h[j>>3]=-1.5707963267948966;a[z>>0]=1;I=o;o=p;}k=t|1;r=153720+(t<<5)|0;zg(Q,d,b,c[(c[s+16>>2]|0)+232>>2]|0);c[r>>2]=c[Q>>2];c[r+4>>2]=c[Q+4>>2];c[r+8>>2]=c[Q+8>>2];c[r+12>>2]=c[Q+12>>2];c[r+16>>2]=c[Q+16>>2];c[r+20>>2]=c[Q+20>>2];c[r+24>>2]=c[Q+24>>2];c[r+28>>2]=c[Q+28>>2];wg(R,b,d,p,u,0);c[U>>2]=c[R>>2];c[U+4>>2]=c[R+4>>2];c[U+8>>2]=c[R+8>>2];c[U+12>>2]=c[R+12>>2];c[U+16>>2]=c[R+16>>2];c[U+20>>2]=c[R+20>>2];c[U+24>>2]=c[R+24>>2];c[U+28>>2]=c[R+28>>2];c[V>>2]=c[R>>2];c[V+4>>2]=c[R+4>>2];c[V+8>>2]=c[R+8>>2];c[V+12>>2]=c[R+12>>2];c[V+16>>2]=c[R+16>>2];c[V+20>>2]=c[R+20>>2];c[V+24>>2]=c[R+24>>2];c[V+28>>2]=c[R+28>>2];r=(n|0)!=0;s=u+-48|0;jO(e,r?Y:u,1,U,xg(c[((c[u>>2]&3|0)==2?u:s)+40>>2]|0)|0);ca=(c[C>>2]|0)+-1|0;h[D>>3]=+h[U+56+(ca<<5)+24>>3];h[E>>3]=+h[U+56+(ca<<5)+8>>3];ca=c[v+16>>2]|0;m=+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[ca+232>>2]<<6)+24>>3]+ +h[ca+24>>3];c[S>>2]=c[V>>2];c[S+4>>2]=c[V+4>>2];c[S+8>>2]=c[V+8>>2];c[S+12>>2]=c[V+12>>2];c[S+16>>2]=c[V+16>>2];c[S+20>>2]=c[V+20>>2];c[S+24>>2]=c[V+24>>2];c[S+28>>2]=c[V+28>>2];yg(W,S,4,m);c[V>>2]=c[W>>2];c[V+4>>2]=c[W+4>>2];c[V+8>>2]=c[W+8>>2];c[V+12>>2]=c[W+12>>2];c[V+16>>2]=c[W+16>>2];c[V+20>>2]=c[W+20>>2];c[V+24>>2]=c[W+24>>2];c[V+28>>2]=c[W+28>>2];if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[C>>2]|0;c[C>>2]=ca+1;ca=U+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}Bg(e,I,u,T,U,k);if(G)q=HM(e,X)|0;else q=NM(e,X)|0;k=c[X>>2]|0;if(!(H&(k|0)>4)){if(!k)break}else {ca=q+16|0;c[ca>>2]=c[q>>2];c[ca+4>>2]=c[q+4>>2];c[ca+8>>2]=c[q+8>>2];c[ca+12>>2]=c[q+12>>2];ca=q+32|0;k=q+(k+-1<<4)|0;c[ca>>2]=c[k>>2];c[ca+4>>2]=c[k+4>>2];c[ca+8>>2]=c[k+8>>2];c[ca+12>>2]=c[k+12>>2];X6(q+48|0,k|0,16)|0;c[X>>2]=4;k=4;}o=c[Z>>2]|0;n=o+k|0;if((n|0)>(c[46736]|0)){c[46736]=n<<1;p=MK(c[46734]|0,n<<5)|0;c[46734]=p;k=c[X>>2]|0;}else p=c[46734]|0;n=0;while(1){if((n|0)>=(k|0))break;ca=p+(o<<4)|0;X=q+(n<<4)|0;c[ca>>2]=c[X>>2];c[ca+4>>2]=c[X+4>>2];c[ca+8>>2]=c[X+8>>2];c[ca+12>>2]=c[X+12>>2];n=n+1|0;o=o+1|0;}c[Z>>2]=o;Dg(I,e);if(r)k=(c[Y>>2]&3|0)==2?Y:Y+-48|0;else k=(c[u>>2]&3|0)==2?u:s;c[_>>2]=c[k+40>>2];v=o;J=63;}while(0);c:do if((J|0)==63){if((i|0)==1){dO(K,c[_>>2]|0,c[46734]|0,v,17296);break}t=d+12|0;u=v+-1|0;m=+((O(c[t>>2]|0,i+-1|0)|0)/2|0|0);n=c[46734]|0;k=1;while(1){if((k|0)>=(u|0))break;ca=n+(k<<4)|0;h[ca>>3]=+h[ca>>3]-m;k=k+1|0;}k=c[46736]|0;if((k|0)>(c[46737]|0)){c[46737]=k;o=MK(c[46735]|0,k<<4)|0;c[46735]=o;n=c[46734]|0;}else o=c[46735]|0;k=0;while(1){if((k|0)>=(v|0))break;ca=o+(k<<4)|0;d=n+(k<<4)|0;c[ca>>2]=c[d>>2];c[ca+4>>2]=c[d+4>>2];c[ca+8>>2]=c[d+8>>2];c[ca+12>>2]=c[d+12>>2];k=k+1|0;}dO(K,c[_>>2]|0,o,v,17296);r=$+48|0;s=$+-48|0;q=1;while(1){if((q|0)>=(i|0))break c;o=c[f+(q+g<<2)>>2]|0;p=o+16|0;k=c[p>>2]|0;if(c[k+164>>2]&32){n=c[aa>>2]|0;W6(n|0,k|0,176)|0;w=$;x=o;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[aa>>2]=n;w=c[$>>2]&3;c[((w|0)==3?$:r)+40>>2]=c[((c[o>>2]&3|0)==2?o:o+-48|0)+40>>2];c[((w|0)==2?$:s)+40>>2]=c[((c[o>>2]&3|0)==3?o:o+48|0)+40>>2];w=n+16|0;x=(c[p>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[aa>>2]|0;w=k+56|0;x=(c[p>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;c[k+116>>2]=o;o=$;}p=c[46734]|0;k=1;while(1){if((k|0)>=(u|0))break;ca=p+(k<<4)|0;h[ca>>3]=+h[ca>>3]+ +(c[t>>2]|0);k=k+1|0;}n=c[46735]|0;k=0;while(1){if((k|0)>=(v|0))break;ca=n+(k<<4)|0;_=p+(k<<4)|0;c[ca>>2]=c[_>>2];c[ca+4>>2]=c[_+4>>2];c[ca+8>>2]=c[_+8>>2];c[ca+12>>2]=c[_+12>>2];k=k+1|0;}dO(o,c[((c[o>>2]&3|0)==2?o:o+-48|0)+40>>2]|0,n,v,17296);q=q+1|0;}}while(0);l=ba;return}function sg(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;if((kb[c[4324]&63](d)|0)<<24>>24?(e=c[(c[d+16>>2]|0)+8>>2]|0,e|0):0)tg(e);d=ZA(a,d)|0;}b=kC(a,b)|0;}return}function tg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[a+4>>2]|0;g=KK(f*48|0)|0;b=g;d=0;e=(c[a>>2]|0)+((f+-1|0)*48|0)|0;while(1){if((d|0)>=(f|0)){b=0;break}ug(e,b);b=b+48|0;d=d+1|0;e=e+-48|0;}while(1){d=c[a>>2]|0;if((b|0)>=(f|0))break;U1(c[d+(b*48|0)>>2]|0);b=b+1|0;}U1(d);c[a>>2]=g;return}function ug(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;h=KK(g<<4)|0;d=h;e=0;f=(c[a>>2]|0)+(g+-1<<4)|0;while(1){if((e|0)>=(g|0))break;c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];d=d+16|0;e=e+1|0;f=f+-16|0;}c[b>>2]=h;c[b+4>>2]=g;c[b+8>>2]=c[a+12>>2];c[b+12>>2]=c[a+8>>2];h=b+16|0;g=a+32|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];h=b+32|0;g=a+16|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];return}function vg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+96|0;q=x+80|0;s=x+64|0;r=x+48|0;u=x+32|0;v=x+16|0;w=x;m=d;while(1){t=m+16|0;g=c[t>>2]|0;if(!(a[g+112>>0]|0))break;m=c[g+116>>2]|0;}g=c[m>>2]&3;o=c[((g|0)==2?m:m+-48|0)+40>>2]|0;g=c[((g|0)==3?m:m+48|0)+40>>2]|0;m=o+16|0;n=g+16|0;y=(c[(c[m>>2]|0)+232>>2]|0)-(c[(c[n>>2]|0)+232>>2]|0)|0;switch(((y|0)>-1?y:0-y|0)|0){case 1:{g=0;break}case 2:{if(!(a[(c[(c[b+60>>2]|0)+16>>2]|0)+113>>0]&1))p=6;else g=0;break}default:p=6;}do if((p|0)==6){if((c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)==(g|0)){c[f>>2]=o;y=(c[n>>2]|0)+16|0;p=(c[t>>2]|0)+16|0;c[s>>2]=c[y>>2];c[s+4>>2]=c[y+4>>2];c[s+8>>2]=c[y+8>>2];c[s+12>>2]=c[y+12>>2];c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];Ng(u,s,q);p=(c[m>>2]|0)+16|0;y=(c[t>>2]|0)+56|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];Ng(v,s,q);}else {c[f>>2]=g;y=(c[m>>2]|0)+16|0;p=(c[t>>2]|0)+56|0;c[s>>2]=c[y>>2];c[s+4>>2]=c[y+4>>2];c[s+8>>2]=c[y+8>>2];c[s+12>>2]=c[y+12>>2];c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];Ng(u,s,q);p=(c[n>>2]|0)+16|0;y=(c[t>>2]|0)+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];Ng(v,s,q);}g=c[(c[t>>2]|0)+96>>2]|0;if(!g){g=e+16|0;c[e>>2]=c[u>>2];c[e+4>>2]=c[u+4>>2];c[e+8>>2]=c[u+8>>2];c[e+12>>2]=c[u+12>>2];c[g>>2]=c[u>>2];c[g+4>>2]=c[u+4>>2];c[g+8>>2]=c[u+8>>2];c[g+12>>2]=c[u+12>>2];g=e+48|0;y=e+32|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];c[g>>2]=c[v>>2];c[g+4>>2]=c[v+4>>2];c[g+8>>2]=c[v+8>>2];c[g+12>>2]=c[v+12>>2];g=4;break}j=+h[g+24>>3];i=+h[g+32>>3];p=(c[(c[(xC(o)|0)+16>>2]|0)+116>>2]&1|0)==0;k=p?i:j;y=(c[(c[t>>2]|0)+96>>2]|0)+56|0;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[r>>2]=c[v>>2];c[r+4>>2]=c[v+4>>2];c[r+8>>2]=c[v+8>>2];c[r+12>>2]=c[v+12>>2];c[s>>2]=c[u>>2];c[s+4>>2]=c[u+4>>2];c[s+8>>2]=c[u+8>>2];c[s+12>>2]=c[u+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];y=(Og(r,s,q)|0)==0;i=(p?j:i)*.5;j=+h[w>>3];if(y){h[w>>3]=j-i;y=w+8|0;h[y>>3]=+h[y>>3]+k*.5;}else {h[w>>3]=j+i;y=w+8|0;h[y>>3]=+h[y>>3]-k*.5;}g=e+16|0;c[e>>2]=c[u>>2];c[e+4>>2]=c[u+4>>2];c[e+8>>2]=c[u+8>>2];c[e+12>>2]=c[u+12>>2];c[g>>2]=c[u>>2];c[g+4>>2]=c[u+4>>2];c[g+8>>2]=c[u+8>>2];c[g+12>>2]=c[u+12>>2];g=e+32|0;y=e+48|0;u=e+64|0;c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];c[g>>2]=c[w>>2];c[g+4>>2]=c[w+4>>2];c[g+8>>2]=c[w+8>>2];c[g+12>>2]=c[w+12>>2];g=e+80|0;y=e+96|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];c[g>>2]=c[v>>2];c[g+4>>2]=c[v+4>>2];c[g+8>>2]=c[v+8>>2];c[g+12>>2]=c[v+12>>2];g=7;}while(0);l=x;return g|0}function wg(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0,l=0,m=0.0,n=0,o=0.0,p=0.0,q=0;q=c[f+16>>2]|0;p=+h[q+16>>3];j=p-+h[q+88>>3];m=j+-4.0;l=Jg(d,f,g,i,-1)|0;if(!l){n=~~(j+(m>=0.0?-3.5:-4.5));k=c[e>>2]|0;k=(k|0)>(n|0)?n:k;}else {k=Kg(d,f,l)|0;do if(!k){n=c[l+16>>2]|0;j=+h[n+240>>3]+ +h[n+16>>3];if(!(a[n+156>>0]|0)){j=+(c[(c[d+16>>2]|0)+248>>2]|0)*.5+j;break}else {j=j+ +(c[e+8>>2]|0);break}}else j=+h[(c[k+16>>2]|0)+32>>3]+ +(c[e+8>>2]|0);while(0);o=j=0.0?.5:-.5));}o=+(k|0);n=(a[q+156>>0]|0)==1;if(n?(c[q+104>>2]|0)!=0:0)m=p+10.0;else m=p+4.0+ +h[q+96>>3];l=Jg(d,f,g,i,1)|0;if(!l){f=~~(m+(m>=0.0?.5:-.5));k=c[e+4>>2]|0;k=(k|0)<(f|0)?f:k;}else {k=Kg(d,f,l)|0;do if(!k){f=c[l+16>>2]|0;j=+h[f+16>>3]-+h[f+88>>3];if(!(a[f+156>>0]|0)){j=j-+(c[(c[d+16>>2]|0)+248>>2]|0)*.5;break}else {j=j-+(c[e+8>>2]|0);break}}else j=+h[(c[k+16>>2]|0)+16>>3]-+(c[e+8>>2]|0);while(0);m=j>m?j:m;k=~~(m+(m>=0.0?.5:-.5));}j=+(k|0);if(n?(c[q+104>>2]|0)!=0:0){j=j-+h[q+96>>3];if(j>3];d=c[(c[d+16>>2]|0)+196>>2]|0;q=c[q+232>>2]|0;m=p-+h[d+(q<<6)+16>>3];p=+h[d+(q<<6)+24>>3]+p;h[b>>3]=o;h[b+8>>3]=m;h[b+16>>3]=j;h[b+24>>3]=p;return}function xg(b){b=b|0;b=c[b+16>>2]|0;if((a[b+156>>0]|0)==1)if((c[b+176>>2]|0)>1)b=1;else b=(c[b+184>>2]|0)>1&1;else b=0;return b|0}function yg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,g=0;g=l;l=l+32|0;f=g;switch(d|0){case 1:{Ig(f,+h[b>>3],e,+h[b+16>>3],+h[b+8>>3]);break}case 4:{Ig(f,+h[b>>3],+h[b+24>>3],+h[b+16>>3],e);break}default:{}}c[a>>2]=c[f>>2];c[a+4>>2]=c[f+4>>2];c[a+8>>2]=c[f+8>>2];c[a+12>>2]=c[f+12>>2];c[a+16>>2]=c[f+16>>2];c[a+20>>2]=c[f+20>>2];c[a+24>>2]=c[f+24>>2];c[a+28>>2]=c[f+28>>2];l=g;return}function zg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0;l=c[b+16>>2]|0;k=l+(e<<5)|0;j=+h[k>>3];m=l+(e<<5)+8|0;g=+h[m>>3];n=l+(e<<5)+16|0;f=+h[n>>3];l=l+(e<<5)+24|0;i=+h[l>>3];if(j==f){d=c[(c[d+16>>2]|0)+196>>2]|0;o=e+1|0;j=+(c[b>>2]|0);g=+h[d+(o<<6)+24>>3]+ +h[(c[(c[c[d+(o<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];f=+(c[b+4>>2]|0);i=+h[(c[(c[c[d+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[d+(e<<6)+16>>3];h[k>>3]=j;h[m>>3]=g;h[n>>3]=f;h[l>>3]=i;}h[a>>3]=j;h[a+8>>3]=g;h[a+16>>3]=f;h[a+24>>3]=i;return}function Ag(b){b=b|0;var d=0,e=0;b=c[b+16>>2]|0;e=b+16|0;d=0;while(1){b=c[c[b+180>>2]>>2]|0;b=c[(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0;if((a[b+156>>0]|0)!=1)break;if((c[b+184>>2]|0)!=1)break;if((c[b+176>>2]|0)!=1)break;if(+h[b+16>>3]!=+h[e>>3])break;d=d+1|0;}return d|0}function Bg(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=l;l=l+32|0;j=k;h=Fg(b,-1)|0;b=Fg(b,1)|0;if(!((h|0)!=0?!(uO(h)|0):0))i=3;do if((i|0)==3){if(b|0?(uO(b)|0)==0:0)break;h=Gg(d,-1)|0;b=Gg(d,1)|0;if(h|0?(uO(h)|0)==0:0)break;if(b|0?(uO(b)|0)==0:0)break;h=e+52|0;b=0;while(1){if((b|0)>=(c[h>>2]|0))break;d=e+56+(b<<5)|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];c[j+16>>2]=c[d+16>>2];c[j+20>>2]=c[d+20>>2];c[j+24>>2]=c[d+24>>2];c[j+28>>2]=c[d+28>>2];fO(a,j);b=b+1|0;}h=c[a+80>>2]|0;i=g+-3|0;b=0;while(1){if((b|0)>=(g|0))break;e=153720+(b<<5)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[j+16>>2]=c[e+16>>2];c[j+20>>2]=c[e+20>>2];c[j+24>>2]=c[e+24>>2];c[j+28>>2]=c[e+28>>2];fO(a,j);b=b+1|0;}d=h+1|0;i=i+d|0;h=c[f+52>>2]|0;while(1){b=h+-1|0;if((h|0)<=0)break;h=f+56+(b<<5)|0;c[j>>2]=c[h>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];fO(a,j);h=b;}Hg(a,d,i);}while(0);l=k;return}function Cg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=c[e>>2]|0;while(1){if(!b)break;a=c[c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;b=b+-1|0;}c[e>>2]=f+1;g=d+(f<<4)|0;b=d+(f+-1<<4)|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];f=c[e>>2]|0;c[e>>2]=f+1;f=d+(f<<4)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];f=d+(c[e>>2]<<4)|0;e=(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+16|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];return a|0}function Dg(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,l=0,m=0;m=d+84|0;l=d+80|0;e=0;d=b;a:while(1){j=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;k=j+16|0;if((a[(c[k>>2]|0)+156>>0]|0)!=1)break;if((kb[c[17300>>2]&63](j)|0)<<24>>24)break;d=c[l>>2]|0;while(1){if((e|0)>=(d|0))break a;if(!(+h[(c[m>>2]|0)+(e<<5)+8>>3]>+h[(c[k>>2]|0)+24>>3]))break;e=e+1|0;}d=c[m>>2]|0;b=c[k>>2]|0;do if(!(+h[d+(e<<5)+24>>3]<+h[b+24>>3])){g=+h[d+(e<<5)>>3];i=~~g;f=+h[d+(e<<5)+16>>3];if(!(c[b+104>>2]|0)){Eg(j,i,~~((f+g)*.5),~~f);break}else {Eg(j,i,~~f,~~(+h[b+96>>3]+f));break}}while(0);d=c[c[(c[k>>2]|0)+180>>2]>>2]|0;}return}function Eg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[a+16>>2]|0;h[a+16>>3]=+(d|0);h[a+88>>3]=+(d-b|0);h[a+96>>3]=+(e-d|0);return}function Fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=c[(c[(c[((h|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+180>>2]|0;h=((h|0)==2?a:a+-48|0)+40|0;g=0;a=0;while(1){e=c[i+(g<<2)>>2]|0;if(!e)break;f=c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;do if((O(f-(c[(c[(c[h>>2]|0)+16>>2]|0)+236>>2]|0)|0,b)|0)>=1){d=c[e+16>>2]|0;if(!(c[d+8>>2]|0)){d=c[d+116>>2]|0;if(!d)break;if(!(c[(c[d+16>>2]|0)+8>>2]|0))break}if(a|0?(O((c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-f|0,b)|0)<=0:0)break;a=e;}while(0);g=g+1|0;}return a|0}function Gg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=c[(c[(c[((h|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+172>>2]|0;h=((h|0)==3?a:a+48|0)+40|0;g=0;a=0;while(1){e=c[i+(g<<2)>>2]|0;if(!e)break;f=c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;do if((O(f-(c[(c[(c[h>>2]|0)+16>>2]|0)+236>>2]|0)|0,b)|0)>=1){d=c[e+16>>2]|0;if(!(c[d+8>>2]|0)){d=c[d+116>>2]|0;if(!d)break;if(!(c[(c[d+16>>2]|0)+8>>2]|0))break}if(a|0?(O((c[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-f|0,b)|0)<=0:0)break;a=e;}while(0);g=g+1|0;}return a|0}function Hg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0;l=a+84|0;i=b+-1|0;while(1){if((i|0)>(d|0))break;f=c[l>>2]|0;j=f+(i<<5)|0;e=+h[j>>3];if(!(i-b&1)){f=f+(i<<5)+16|0;m=+h[f>>3];g=~~((m+e)*.5);if(e>=m){h[j>>3]=+(g+-8|0);h[f>>3]=+(g+8|0);}}else {f=f+(i<<5)+16|0;m=+h[f>>3];g=~~((m+e)*.5);if(e+16.0>m){h[j>>3]=+(g+-8|0);h[f>>3]=+(g+8|0);}}i=i+1|0;}k=(c[a+80>>2]|0)+-1|0;g=0;while(1){if((g|0)>=(k|0))break;i=c[l>>2]|0;f=i+(g<<5)|0;j=g+1|0;a=i+(j<<5)|0;if(!((g|0)<(b|0)|(g|0)>(d|0))?(g-b&1|0)==0:0){e=+h[f>>3]+16.0;f=i+(j<<5)+16|0;if(e>+h[f>>3])h[f>>3]=e;e=+h[i+(g<<5)+16>>3]+-16.0;if(!(e<+h[a>>3])){g=j;continue}h[a>>3]=e;g=j;continue}if(!((g|0)<(d|0)&(j|0)>=(b|0))){g=j;continue}if(j-b&1|0){g=j;continue}e=+h[i+(j<<5)+16>>3];if(+h[f>>3]+16.0>e)h[f>>3]=e+-16.0;f=i+(g<<5)+16|0;e=+h[a>>3];if(!(+h[f>>3]+-16.0>3]=e+16.0;g=j;}return}function Ig(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function Jg(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=c[(c[b+16>>2]|0)+196>>2]|0;h=c[d+16>>2]|0;j=c[h+232>>2]|0;i=k+(j<<6)|0;j=k+(j<<6)+4|0;h=c[h+236>>2]|0;a:do{h=h+g|0;if((h|0)<=-1){b=0;break}if((h|0)>=(c[i>>2]|0)){b=0;break}b=c[(c[j>>2]|0)+(h<<2)>>2]|0;k=c[b+16>>2]|0;switch(a[k+156>>0]|0){case 0:break a;case 1:{if(c[k+104>>2]|0)break a;break}default:{}}}while((Mg(b,d,e,f)|0)<<24>>24!=0);return b|0}function Kg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;d=c[d+16>>2]|0;if(!(a[d+156>>0]|0)){i=c[d+212>>2]|0;h=i;}else {i=c[(c[(c[c[d+180>>2]>>2]|0)+16>>2]|0)+116>>2]|0;g=c[i>>2]&3;h=c[(c[(c[((g|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;i=c[(c[(c[((g|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;}d=c[e+16>>2]|0;if(!(a[d+156>>0]|0)){e=c[d+212>>2]|0;e=(e|0)==(b|0)?0:e;return ((e|0)==(h|0)|((e|0)==0|(e|0)==(i|0))?0:e)|0}f=c[(c[(c[c[d+180>>2]>>2]|0)+16>>2]|0)+116>>2]|0;g=c[f>>2]&3;d=c[(c[(c[((g|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;d=(d|0)==(b|0)?0:d;if(!(!((d|0)==(h|0)|((d|0)==0|(d|0)==(i|0)))?(Lg(d,e)|0)!=0:0)){d=c[(c[(c[((g|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;d=(d|0)==(b|0)?0:d;if((d|0)==(h|0)|((d|0)==0|(d|0)==(i|0)))d=0;else {e=(Lg(d,e)|0)==0;return (e?0:d)|0}}return d|0}function Lg(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0;d=c[a+16>>2]|0;a=c[b+16>>2]|0;f=+h[a+16>>3];if((+h[d+16>>3]<=f?f<=+h[d+32>>3]:0)?(e=+h[a+24>>3],+h[d+24>>3]<=e):0)a=e<=+h[d+40>>3]&1;else a=0;return a|0}function Mg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=c[b+16>>2]|0;j=(c[i+236>>2]|0)>(c[(c[d+16>>2]|0)+236>>2]|0);a:do if((c[i+184>>2]|0)==1){b:do if(f|0){h=0;b=c[c[i+180>>2]>>2]|0;while(1){if((h|0)>=2)break b;b=c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0;d=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((b|0)==(d|0))break b;g=c[b+16>>2]|0;b=c[d+16>>2]|0;if(j^(c[g+236>>2]|0)>(c[b+236>>2]|0)){b=1;break a}if((c[g+184>>2]|0)!=1)break b;if(!(a[g+156>>0]|0))break b;if((c[b+184>>2]|0)!=1)break b;if(!(a[b+156>>0]|0))break b;h=h+1|0;f=c[c[b+180>>2]>>2]|0;b=c[c[g+180>>2]>>2]|0;}}while(0);if(e|0?(c[i+176>>2]|0)==1:0){g=0;d=e;b=c[c[i+172>>2]>>2]|0;while(1){if((g|0)>=2){b=0;break a}b=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;d=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((b|0)==(d|0)){b=0;break a}f=c[b+16>>2]|0;b=c[d+16>>2]|0;if(j^(c[f+236>>2]|0)>(c[b+236>>2]|0)){b=1;break a}if((c[f+176>>2]|0)!=1){b=0;break a}if(!(a[f+156>>0]|0)){b=0;break a}if((c[b+176>>2]|0)!=1){b=0;break a}if(!(a[b+156>>0]|0)){b=0;break a}g=g+1|0;d=c[c[b+172>>2]>>2]|0;b=c[c[f+172>>2]>>2]|0;}}else b=0;}else b=0;while(0);return b|0}function Ng(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function Og(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];return (~~((+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d))|0)>0|0}function Pg(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;R=l;l=l+256|0;D=R+232|0;C=R+216|0;P=R+88|0;O=R+80|0;K=R+64|0;L=R+200|0;M=R+184|0;N=R;E=R+168|0;F=R+152|0;G=R+136|0;H=R+120|0;I=R+104|0;B=c[g>>2]&3;J=c[((B|0)==3?g:g+48|0)+40>>2]|0;B=c[((B|0)==2?g:g+-48|0)+40>>2]|0;do if((WM(J)|0)!=2?(WM(B)|0)!=2:0){g=0;j=0;k=0;while(1){if((k|0)>=(f|0))break;A=c[(c[d+(k+e<<2)>>2]|0)+16>>2]|0;g=g+((c[A+96>>2]|0)!=0&1)|0;if(!((a[A+44>>0]|0)==0?(a[A+84>>0]|0)==0:0))j=1;k=k+1|0;}if(!j)if(!g){Rg(J,B,d,e,f,i);break}else {Wg(J,B,d,e,f,i,g);break}y=JK(156)|0;z=Xg(b,y)|0;t=ND(z,85478,1)|0;TC(t,137483,280,1)|0;SA(t,87171,87185)|0;m=+h[(c[B+16>>2]|0)+16>>3];s=+h[(c[J+16>>2]|0)+16>>3];A=b+16|0;q=(c[(c[A>>2]|0)+116>>2]&1|0)==0;r=q?B:J;q=q?J:B;t=Yg(t,q)|0;u=Yg(z,r)|0;g=0;p=0;while(1){if((p|0)>=(f|0))break;j=d+(p+e<<2)|0;while(1){o=c[j>>2]|0;n=o+16|0;j=c[n>>2]|0;if(!(a[j+112>>0]|0))break;else j=j+116|0;}if((c[((c[o>>2]&3|0)==3?o:o+48|0)+40>>2]|0)==(q|0))k=Zg(z,t,u,o)|0;else k=Zg(z,u,t,o)|0;j=c[n>>2]|0;c[j+120>>2]=k;if(!g)if((a[j+44>>0]|0)==0?(a[j+84>>0]|0)==0:0){c[(c[k+16>>2]|0)+120>>2]=o;g=k;}else g=0;p=p+1|0;}if(!g)x=iB(z,t,u,0,1)|0;else x=g;KA(x,c[47174]|0,85482)|0;g=z+16|0;n=c[g>>2]|0;c[n+144>>2]=c[(c[A>>2]|0)+144>>2];c[n+188>>2]=z;oQ(z,i);Of(z);xj(z,0);Hh(z,0);Ki(z,0);q=q+16|0;i=c[q>>2]|0;n=c[r+16>>2]|0;r=t+16|0;o=c[r>>2]|0;p=o+16|0;v=+(~~m|0);w=+(~~((+h[(c[u+16>>2]|0)+16>>3]+ +h[p>>3])*.5)|0);m=+(~~s|0);s=+(~~((+h[i+16>>3]-+h[i+96>>3]+ +h[n+16>>3]+ +h[n+88>>3])*.5)|0);n=o+24|0;g=(c[g>>2]|0)+192|0;while(1){j=c[g>>2]|0;if(!j)break;do if((j|0)!=(t|0)){g=c[j+16>>2]|0;k=g+24|0;if((j|0)==(u|0)){h[k>>3]=m;h[g+16>>3]=w;break}else {h[k>>3]=s;break}}else {h[n>>3]=v;h[p>>3]=w;g=o;}while(0);g=g+164|0;}rk(z);jg(z,0);tM(z);k=c[q>>2]|0;g=c[r>>2]|0;if(!(c[(c[A>>2]|0)+116>>2]&1)){j=g+16|0;m=+h[k+24>>3]-+h[g+24>>3];}else {j=g+24|0;m=+h[g+16>>3]+ +h[k+24>>3];}h[K>>3]=+h[k+16>>3]-+h[j>>3];h[K+8>>3]=m;i=N+16|0;t=N+32|0;u=N+48|0;r=0;while(1){if((r|0)>=(f|0))break;g=d+(r+e<<2)|0;while(1){j=c[g>>2]|0;q=j+16|0;g=c[q>>2]|0;if(!(a[g+112>>0]|0))break;else g=g+116|0;}o=c[g+120>>2]|0;p=o+16|0;g=c[p>>2]|0;if(!((o|0)==(x|0)&(c[g+120>>2]|0)==0)){n=c[c[g+8>>2]>>2]|0;o=n+4|0;j=cO(j,c[o>>2]|0)|0;c[j+8>>2]=c[n+8>>2];g=j+16|0;k=n+16|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(L,C,D,S);c[g>>2]=c[L>>2];c[g+4>>2]=c[L+4>>2];c[g+8>>2]=c[L+8>>2];c[g+12>>2]=c[L+12>>2];c[j+12>>2]=c[n+12>>2];g=j+32|0;S=n+32|0;k=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(M,C,D,k);c[g>>2]=c[M>>2];c[g+4>>2]=c[M+4>>2];c[g+8>>2]=c[M+8>>2];c[g+12>>2]=c[M+12>>2];g=0;while(1){if((g|0)>=(c[o>>2]|0))break;k=(c[j>>2]|0)+(g<<4)|0;T=(c[n>>2]|0)+(g<<4)|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[T>>2];c[C+4>>2]=c[T+4>>2];c[C+8>>2]=c[T+8>>2];c[C+12>>2]=c[T+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(E,C,D,S);c[k>>2]=c[E>>2];c[k+4>>2]=c[E+4>>2];c[k+8>>2]=c[E+8>>2];c[k+12>>2]=c[E+12>>2];c[N>>2]=c[E>>2];c[N+4>>2]=c[E+4>>2];c[N+8>>2]=c[E+8>>2];c[N+12>>2]=c[E+12>>2];k=g+1|0;if((k|0)>=(c[o>>2]|0)){Q=48;break}S=(c[j>>2]|0)+(k<<4)|0;k=(c[n>>2]|0)+(k<<4)|0;T=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(F,C,D,T);c[S>>2]=c[F>>2];c[S+4>>2]=c[F+4>>2];c[S+8>>2]=c[F+8>>2];c[S+12>>2]=c[F+12>>2];c[i>>2]=c[F>>2];c[i+4>>2]=c[F+4>>2];c[i+8>>2]=c[F+8>>2];c[i+12>>2]=c[F+12>>2];S=g+2|0;T=(c[j>>2]|0)+(S<<4)|0;S=(c[n>>2]|0)+(S<<4)|0;k=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(G,C,D,k);c[T>>2]=c[G>>2];c[T+4>>2]=c[G+4>>2];c[T+8>>2]=c[G+8>>2];c[T+12>>2]=c[G+12>>2];c[t>>2]=c[G>>2];c[t+4>>2]=c[G+4>>2];c[t+8>>2]=c[G+8>>2];c[t+12>>2]=c[G+12>>2];T=g+3|0;k=(c[n>>2]|0)+(T<<4)|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(H,C,D,S);c[u>>2]=c[H>>2];c[u+4>>2]=c[H+4>>2];c[u+8>>2]=c[H+8>>2];c[u+12>>2]=c[H+12>>2];lI((c[A>>2]|0)+16|0,N);g=T;}if((Q|0)==48)Q=0;g=c[(c[q>>2]|0)+96>>2]|0;if(g|0){T=g+56|0;p=(c[(c[p>>2]|0)+96>>2]|0)+56|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[p>>2];c[C+4>>2]=c[p+4>>2];c[C+8>>2]=c[p+8>>2];c[C+12>>2]=c[p+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(I,C,D,S);c[T>>2]=c[I>>2];c[T+4>>2]=c[I+4>>2];c[T+8>>2]=c[I+8>>2];c[T+12>>2]=c[I+12>>2];T=c[(c[q>>2]|0)+96>>2]|0;a[T+81>>0]=1;zP(b,T);}}r=r+1|0;}$g(z,y);}else Q=3;while(0);if((Q|0)==3?(c[46738]|0)==0:0){c[46738]=1;gA(0,85355,O)|0;Q=KB(J)|0;S=(xB(b)|0)!=0;T=KB(B)|0;c[P>>2]=Q;c[P+4>>2]=S?137738:141747;c[P+8>>2]=T;gA(3,85461,P)|0;}l=R;return}function Qg(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0;z=l;l=l+1600|0;u=z+1552|0;n=z+1536|0;t=z+840|0;v=z+144|0;w=z+1584|0;j=z+32|0;s=z+16|0;o=z;q=c[f>>2]&3;p=c[((q|0)==3?f:f+48|0)+40>>2]|0;x=f+-48|0;q=c[((q|0)==2?f:x)+40>>2]|0;r=f+16|0;k=c[r>>2]|0;i=c[k+172>>2]|0;while(1){m=c[(c[i+16>>2]|0)+172>>2]|0;if(!m)break;else i=m;}k=(c[k+96>>2]|0)+56|0;i=(c[((c[i>>2]&3|0)==3?i:i+48|0)+40>>2]|0)+16|0;m=(c[i>>2]|0)+16|0;c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];k=c[r>>2]|0;a[(c[k+96>>2]|0)+81>>0]=1;if((g|0)!=2){k=c[i>>2]|0;C=+h[k+16>>3];E=C-+h[k+88>>3];C=+h[k+96>>3]+C;B=+h[k+24>>3];D=+h[k+80>>3]*.5+B;k=c[(c[b+16>>2]|0)+196>>2]|0;m=c[p+16>>2]|0;j=c[m+232>>2]|0;B=+(~~(+(~~(B-+h[k+(j<<6)+16>>3]-+h[m+24>>3]+ +h[k+(j<<6)+24>>3])|0)*.16666666666666666)|0);B=D-(B<5.0?5.0:B);Tg(b,d,e,p,f,t,1);Tg(b,d,e,q,f,v,0);j=t+52|0;k=c[j>>2]|0;m=k+-1|0;A=+h[t+56+(m<<5)>>3];h[19215]=A;h[19216]=+h[t+56+(m<<5)+24>>3];h[19217]=E;h[19218]=B;h[19219]=A;h[19220]=B;m=v+52|0;i=(c[m>>2]|0)+-1|0;A=+h[v+56+(i<<5)+16>>3];h[19221]=A;h[19222]=D;h[19223]=C;h[19226]=B;h[19224]=+h[v+56+(i<<5)+24>>3];h[19225]=A;i=0;while(1){if((i|0)>=(k|0)){i=0;break}k=t+56+(i<<5)|0;c[u>>2]=c[k>>2];c[u+4>>2]=c[k+4>>2];c[u+8>>2]=c[k+8>>2];c[u+12>>2]=c[k+12>>2];c[u+16>>2]=c[k+16>>2];c[u+20>>2]=c[k+20>>2];c[u+24>>2]=c[k+24>>2];c[u+28>>2]=c[k+28>>2];fO(e,u);i=i+1|0;k=c[j>>2]|0;}while(1){if((i|0)==3)break;t=153720+(i<<5)|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[u+16>>2]=c[t+16>>2];c[u+20>>2]=c[t+20>>2];c[u+24>>2]=c[t+24>>2];c[u+28>>2]=c[t+28>>2];fO(e,u);i=i+1|0;}j=c[m>>2]|0;while(1){i=j+-1|0;if((j|0)<=0)break;j=v+56+(i<<5)|0;c[u>>2]=c[j>>2];c[u+4>>2]=c[j+4>>2];c[u+8>>2]=c[j+8>>2];c[u+12>>2]=c[j+12>>2];c[u+16>>2]=c[j+16>>2];c[u+20>>2]=c[j+20>>2];c[u+24>>2]=c[j+24>>2];c[u+28>>2]=c[j+28>>2];fO(e,u);j=i;}if((g|0)==10)j=HM(e,w)|0;else j=NM(e,w)|0;i=c[w>>2]|0;if(i|0)y=17;}else {i=(c[p+16>>2]|0)+16|0;v=k+16|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];Ng(s,n,u);v=(c[q+16>>2]|0)+16|0;i=(c[r>>2]|0)+56|0;c[n>>2]=c[v>>2];c[n+4>>2]=c[v+4>>2];c[n+8>>2]=c[v+8>>2];c[n+12>>2]=c[v+12>>2];c[u>>2]=c[i>>2];c[u+4>>2]=c[i+4>>2];c[u+8>>2]=c[i+8>>2];c[u+12>>2]=c[i+12>>2];Ng(o,n,u);i=c[(c[r>>2]|0)+96>>2]|0;D=+h[i+56>>3];E=+h[i+64>>3]-+h[i+32>>3]*.5;i=j+16|0;c[j>>2]=c[s>>2];c[j+4>>2]=c[s+4>>2];c[j+8>>2]=c[s+8>>2];c[j+12>>2]=c[s+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];i=j+32|0;v=j+48|0;y=j+64|0;h[j+64>>3]=D;h[j+72>>3]=E;c[v>>2]=c[y>>2];c[v+4>>2]=c[y+4>>2];c[v+8>>2]=c[y+8>>2];c[v+12>>2]=c[y+12>>2];c[i>>2]=c[y>>2];c[i+4>>2]=c[y+4>>2];c[i+8>>2]=c[y+8>>2];c[i+12>>2]=c[y+12>>2];i=j+80|0;y=j+96|0;c[y>>2]=c[o>>2];c[y+4>>2]=c[o+4>>2];c[y+8>>2]=c[o+8>>2];c[y+12>>2]=c[o+12>>2];c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];c[w>>2]=7;i=7;y=17;}if((y|0)==17)dO(f,c[((c[f>>2]&3|0)==2?f:x)+40>>2]|0,j,i,17296);l=z;return}function Rg(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;N=l;l=l+352|0;x=N+336|0;w=N+320|0;L=N+128|0;u=N+304|0;y=N+288|0;M=N+112|0;E=N+96|0;F=N+80|0;G=N+64|0;H=N+48|0;I=N+32|0;J=N+16|0;K=N;a=a+16|0;q=(c[a>>2]|0)+16|0;v=(c[d+(e<<2)>>2]|0)+16|0;s=(c[v>>2]|0)+16|0;c[w>>2]=c[q>>2];c[w+4>>2]=c[q+4>>2];c[w+8>>2]=c[q+8>>2];c[w+12>>2]=c[q+12>>2];c[x>>2]=c[s>>2];c[x+4>>2]=c[s+4>>2];c[x+8>>2]=c[s+8>>2];c[x+12>>2]=c[s+12>>2];Ng(u,w,x);C=+h[u>>3];D=+h[u+8>>3];u=(c[b+16>>2]|0)+16|0;v=(c[v>>2]|0)+56|0;c[w>>2]=c[u>>2];c[w+4>>2]=c[u+4>>2];c[w+8>>2]=c[u+8>>2];c[w+12>>2]=c[u+12>>2];c[x>>2]=c[v>>2];c[x+4>>2]=c[v+4>>2];c[x+8>>2]=c[v+8>>2];c[x+12>>2]=c[v+12>>2];Ng(y,w,x);A=+h[y>>3];B=+h[y+8>>3];if((f|0)>1){z=+h[(c[a>>2]|0)+80>>3];i=z*.5;z=z/+(f+-1|0);}else {i=0.0;z=0.0;}p=(g|8|0)==10;m=L+8|0;q=L+16|0;r=(A+C*2.0)*.3333333333333333;s=L+32|0;t=(A*2.0+C)*.3333333333333333;n=L+24|0;u=L+48|0;v=L+64|0;w=L+80|0;x=L+96|0;y=L+112|0;k=L+128|0;o=L+136|0;i=D-i;b=0;while(1){if((b|0)>=(f|0))break;j=c[d+(b+e<<2)>>2]|0;h[L>>3]=C;h[m>>3]=D;if(p){Vg(M,r,i);c[q>>2]=c[M>>2];c[q+4>>2]=c[M+4>>2];c[q+8>>2]=c[M+8>>2];c[q+12>>2]=c[M+12>>2];Vg(E,t,i);c[s>>2]=c[E>>2];c[s+4>>2]=c[E+4>>2];c[s+8>>2]=c[E+8>>2];c[s+12>>2]=c[E+12>>2];a=4;g=3;}else {h[q>>3]=C;h[n>>3]=D;Vg(F,r,i);c[s>>2]=c[F>>2];c[s+4>>2]=c[F+4>>2];c[s+8>>2]=c[F+8>>2];c[s+12>>2]=c[F+12>>2];Vg(G,r,i);c[u>>2]=c[G>>2];c[u+4>>2]=c[G+4>>2];c[u+8>>2]=c[G+8>>2];c[u+12>>2]=c[G+12>>2];Vg(H,r,i);c[v>>2]=c[H>>2];c[v+4>>2]=c[H+4>>2];c[v+8>>2]=c[H+8>>2];c[v+12>>2]=c[H+12>>2];Vg(I,t,i);c[w>>2]=c[I>>2];c[w+4>>2]=c[I+4>>2];c[w+8>>2]=c[I+8>>2];c[w+12>>2]=c[I+12>>2];Vg(J,t,i);c[x>>2]=c[J>>2];c[x+4>>2]=c[J+4>>2];c[x+8>>2]=c[J+8>>2];c[x+12>>2]=c[J+12>>2];Vg(K,t,i);c[y>>2]=c[K>>2];c[y+4>>2]=c[K+4>>2];c[y+8>>2]=c[K+8>>2];c[y+12>>2]=c[K+12>>2];h[k>>3]=A;h[o>>3]=B;a=10;g=9;}h[L+(g<<4)>>3]=A;h[L+(g<<4)+8>>3]=B;dO(j,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0,L,a,17296);i=i+z;b=b+1|0;}l=N;return}function Sg(a,d,e,f,g,i,j,k){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0;x=l;l=l+1440|0;t=x+1392|0;v=x+1424|0;w=x+696|0;u=x;r=c[j>>2]&3;q=c[((r|0)==3?j:j+48|0)+40>>2]|0;r=c[((r|0)==2?j:j+-48|0)+40>>2]|0;m=c[q+16>>2]|0;o=c[m+232>>2]|0;p=c[a+16>>2]|0;if((o|0)<(b[p+238>>1]|0)){y=c[p+196>>2]|0;p=o+1|0;n=+h[m+24>>3]-+h[y+(o<<6)+32>>3]-+h[(c[(c[c[y+(p<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[y+(p<<6)+40>>3];}else n=+(c[p+252>>2]|0);z=+(i+1|0);s=+(c[d+12>>2]|0)/z;n=n/z;Ug(a,d,e,q,j,w,1);Ug(a,d,e,r,j,u,0);r=w+52|0;j=u+52|0;a=(k|0)==0;d=e+80|0;m=0;while(1){if((m|0)>=(i|0))break;q=c[f+(m+g<<2)>>2]|0;p=c[r>>2]|0;o=p+-1|0;D=+h[w+56+(o<<5)>>3];B=+h[w+56+(o<<5)+8>>3];C=+h[w+56+(o<<5)+16>>3];h[19215]=D;h[19218]=B;m=m+1|0;z=+(m|0);A=s*z;h[19217]=C+A;z=B-n*z;h[19216]=z;h[19219]=D;h[19222]=z;o=(c[j>>2]|0)+-1|0;D=+h[u+56+(o<<5)+16>>3];h[19221]=D;h[19220]=z-n;B=+h[u+56+(o<<5)>>3];C=+h[u+56+(o<<5)+8>>3];h[19225]=D;h[19226]=C;h[19223]=B-A;h[19224]=z;o=0;while(1){if((o|0)>=(p|0)){o=0;break}p=w+56+(o<<5)|0;c[t>>2]=c[p>>2];c[t+4>>2]=c[p+4>>2];c[t+8>>2]=c[p+8>>2];c[t+12>>2]=c[p+12>>2];c[t+16>>2]=c[p+16>>2];c[t+20>>2]=c[p+20>>2];c[t+24>>2]=c[p+24>>2];c[t+28>>2]=c[p+28>>2];fO(e,t);o=o+1|0;p=c[r>>2]|0;}while(1){if((o|0)==3)break;y=153720+(o<<5)|0;c[t>>2]=c[y>>2];c[t+4>>2]=c[y+4>>2];c[t+8>>2]=c[y+8>>2];c[t+12>>2]=c[y+12>>2];c[t+16>>2]=c[y+16>>2];c[t+20>>2]=c[y+20>>2];c[t+24>>2]=c[y+24>>2];c[t+28>>2]=c[y+28>>2];fO(e,t);o=o+1|0;}p=c[j>>2]|0;while(1){o=p+-1|0;if((p|0)<=0)break;p=u+56+(o<<5)|0;c[t>>2]=c[p>>2];c[t+4>>2]=c[p+4>>2];c[t+8>>2]=c[p+8>>2];c[t+12>>2]=c[p+12>>2];c[t+16>>2]=c[p+16>>2];c[t+20>>2]=c[p+20>>2];c[t+24>>2]=c[p+24>>2];c[t+28>>2]=c[p+28>>2];fO(e,t);p=o;}if(a)o=NM(e,v)|0;else o=HM(e,v)|0;p=c[v>>2]|0;if(!p)break;dO(q,c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2]|0,o,p,17296);c[d>>2]=0;}l=x;return}function Tg(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+128|0;j=n+96|0;k=n+64|0;o=n+32|0;m=n;wg(o,a,b,e,0,f);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[g+16>>2]=c[o+16>>2];c[g+20>>2]=c[o+20>>2];c[g+24>>2]=c[o+24>>2];c[g+28>>2]=c[o+28>>2];c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];c[k+16>>2]=c[o+16>>2];c[k+20>>2]=c[o+20>>2];c[k+24>>2]=c[o+24>>2];c[k+28>>2]=c[o+28>>2];c[g+48>>2]=4;if(!(i<<24>>24))jO(d,f,2,g,0);else gO(d,f,2,g,0);b=g+52|0;f=(c[b>>2]|0)+-1|0;o=k+24|0;h[o>>3]=+h[g+56+(f<<5)+24>>3];i=k+8|0;h[i>>3]=+h[g+56+(f<<5)+8>>3];e=c[e+16>>2]|0;p=+h[(c[(c[a+16>>2]|0)+196>>2]|0)+(c[e+232>>2]<<6)+24>>3]+ +h[e+24>>3];c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];c[j+16>>2]=c[k+16>>2];c[j+20>>2]=c[k+20>>2];c[j+24>>2]=c[k+24>>2];c[j+28>>2]=c[k+28>>2];yg(m,j,4,p);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[k+16>>2]=c[m+16>>2];c[k+20>>2]=c[m+20>>2];c[k+24>>2]=c[m+24>>2];c[k+28>>2]=c[m+28>>2];if(+h[k>>3]<+h[k+16>>3]?+h[i>>3]<+h[o>>3]:0){o=c[b>>2]|0;c[b>>2]=o+1;o=g+56+(o<<5)|0;c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];c[o+16>>2]=c[k+16>>2];c[o+20>>2]=c[k+20>>2];c[o+24>>2]=c[k+24>>2];c[o+28>>2]=c[k+28>>2];}l=n;return}function Ug(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+128|0;j=n+96|0;k=n+64|0;o=n+32|0;m=n;wg(o,a,b,e,0,f);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[g+16>>2]=c[o+16>>2];c[g+20>>2]=c[o+20>>2];c[g+24>>2]=c[o+24>>2];c[g+28>>2]=c[o+28>>2];c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];c[k+16>>2]=c[o+16>>2];c[k+20>>2]=c[o+20>>2];c[k+24>>2]=c[o+24>>2];c[k+28>>2]=c[o+28>>2];c[g+48>>2]=1;if(!(i<<24>>24))jO(d,f,2,g,0);else gO(d,f,2,g,0);b=g+52|0;f=(c[b>>2]|0)+-1|0;o=k+24|0;h[o>>3]=+h[g+56+(f<<5)+24>>3];i=k+8|0;h[i>>3]=+h[g+56+(f<<5)+8>>3];e=c[e+16>>2]|0;p=+h[e+24>>3]-+h[(c[(c[a+16>>2]|0)+196>>2]|0)+(c[e+232>>2]<<6)+24>>3];c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];c[j+16>>2]=c[k+16>>2];c[j+20>>2]=c[k+20>>2];c[j+24>>2]=c[k+24>>2];c[j+28>>2]=c[k+28>>2];yg(m,j,1,p);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[k+16>>2]=c[m+16>>2];c[k+20>>2]=c[m+20>>2];c[k+24>>2]=c[m+24>>2];c[k+28>>2]=c[m+28>>2];if(+h[k>>3]<+h[k+16>>3]?+h[i>>3]<+h[o>>3]:0){o=c[b>>2]|0;c[b>>2]=o+1;o=g+56+(o<<5)|0;c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];c[o+16>>2]=c[k+16>>2];c[o+20>>2]=c[k+20>>2];c[o+24>>2]=c[k+24>>2];c[o+28>>2]=c[k+28>>2];}l=n;return}function Vg(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function Wg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0,A=0.0,B=0.0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0.0;Y=l;l=l+288|0;R=Y+256|0;Q=Y+240|0;P=Y+224|0;V=Y+280|0;W=Y+272|0;X=Y+32|0;S=Y+16|0;T=Y;m=Y+208|0;n=Y+192|0;o=c[e+(f<<2)>>2]|0;U=JK(g<<2)|0;k=0;while(1){if((k|0)>=(g|0))break;c[U+(k<<2)>>2]=c[e+(k+f<<2)>>2];k=k+1|0;}o4(U,g,4,59);e=b+16|0;f=(c[e>>2]|0)+16|0;o=o+16|0;C=(c[o>>2]|0)+16|0;c[Q>>2]=c[f>>2];c[Q+4>>2]=c[f+4>>2];c[Q+8>>2]=c[f+8>>2];c[Q+12>>2]=c[f+12>>2];c[R>>2]=c[C>>2];c[R+4>>2]=c[C+4>>2];c[R+8>>2]=c[C+8>>2];c[R+12>>2]=c[C+12>>2];Ng(m,Q,R);c[S>>2]=c[m>>2];c[S+4>>2]=c[m+4>>2];c[S+8>>2]=c[m+8>>2];c[S+12>>2]=c[m+12>>2];C=d+16|0;f=(c[C>>2]|0)+16|0;o=(c[o>>2]|0)+56|0;c[Q>>2]=c[f>>2];c[Q+4>>2]=c[f+4>>2];c[Q+8>>2]=c[f+8>>2];c[Q+12>>2]=c[f+12>>2];c[R>>2]=c[o>>2];c[R+4>>2]=c[o+4>>2];c[R+8>>2]=c[o+8>>2];c[R+12>>2]=c[o+12>>2];Ng(n,Q,R);c[T>>2]=c[n>>2];c[T+4>>2]=c[n+4>>2];c[T+8>>2]=c[n+8>>2];c[T+12>>2]=c[n+12>>2];w=+h[(c[e>>2]|0)+96>>3]+ +h[S>>3];x=+h[T>>3]-+h[(c[C>>2]|0)+88>>3];u=x+w;v=u*.5;C=c[U>>2]|0;c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];o=X+16|0;c[o>>2]=c[S>>2];c[o+4>>2]=c[S+4>>2];c[o+8>>2]=c[S+8>>2];c[o+12>>2]=c[S+12>>2];e=X+32|0;c[e>>2]=c[T>>2];c[e+4>>2]=c[T+4>>2];c[e+8>>2]=c[T+8>>2];c[e+12>>2]=c[T+12>>2];f=X+48|0;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];dO(C,c[((c[C>>2]&3|0)==2?C:C+-48|0)+40>>2]|0,X,4,17296);C=c[(c[C+16>>2]|0)+96>>2]|0;h[C+56>>3]=v;z=S+8|0;r=+h[z>>3];s=+h[C+32>>3];h[C+64>>3]=(s+6.0)*.5+r;a[C+81>>0]=1;r=r+3.0;B=+h[C+24>>3];A=(u-B)*.5;B=(B+u)*.5;C=X+24|0;D=X+40|0;E=X+56|0;F=X+64|0;G=T+8|0;H=X+72|0;I=X+80|0;J=X+88|0;K=X+96|0;L=X+104|0;M=X+112|0;N=X+120|0;O=V+4|0;n=(i|0)==6&1;q=0.0;p=0.0;s=s+r;m=1;while(1){if((m|0)>=(j|0)){y=6;break}d=c[U+(m<<2)>>2]|0;if(!(m&1)){c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=A;h[C>>3]=+h[z>>3];h[e>>3]=A;h[D>>3]=s;h[f>>3]=B;h[E>>3]=s;h[F>>3]=B;t=+h[G>>3];h[H>>3]=t;Z=+h[T>>3];h[I>>3]=Z;h[J>>3]=t;h[K>>3]=Z;Z=s+6.0;h[L>>3]=Z;h[M>>3]=+h[S>>3];h[N>>3]=Z;s=+h[(c[(c[d+16>>2]|0)+96>>2]|0)+32>>3];t=Z+s*.5;s=Z+s;}else {k=d+16|0;b=c[(c[k>>2]|0)+96>>2]|0;if((m|0)==1){p=+h[b+24>>3];q=(p+u)*.5;p=(u-p)*.5;}r=r+-6.0-+h[b+32>>3];c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=+h[S>>3];t=r+-6.0;h[C>>3]=t;h[e>>3]=+h[T>>3];h[D>>3]=t;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];h[F>>3]=q;h[H>>3]=+h[G>>3];h[I>>3]=q;h[J>>3]=r;h[K>>3]=p;h[L>>3]=r;h[M>>3]=p;h[N>>3]=+h[z>>3];t=+h[(c[(c[k>>2]|0)+96>>2]|0)+32>>3]*.5+r;}c[O>>2]=8;c[V>>2]=X;c[P>>2]=c[S>>2];c[P+4>>2]=c[S+4>>2];c[P+8>>2]=c[S+8>>2];c[P+12>>2]=c[S+12>>2];c[Q>>2]=c[T>>2];c[Q+4>>2]=c[T+4>>2];c[Q+8>>2]=c[T+8>>2];c[Q+12>>2]=c[T+12>>2];c[R>>2]=c[V>>2];c[R+4>>2]=c[V+4>>2];k=DM(P,Q,R,W,n)|0;b=c[W>>2]|0;if(!b)break;i=c[(c[d+16>>2]|0)+96>>2]|0;h[i+56>>3]=v;h[i+64>>3]=t;a[i+81>>0]=1;dO(d,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,k,b,17296);m=m+1|0;}a:do if((y|0)==6){v=(x+w*2.0)*.3333333333333333;u=(x*2.0+w)*.3333333333333333;while(1){if((m|0)>=(g|0))break;d=c[U+(m<<2)>>2]|0;if(!(m&1)){c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=A;h[C>>3]=+h[z>>3];h[e>>3]=A;h[D>>3]=s;h[f>>3]=B;h[E>>3]=s;h[F>>3]=B;t=+h[G>>3];h[H>>3]=t;Z=+h[T>>3];h[I>>3]=Z;h[J>>3]=t;h[K>>3]=Z;Z=s+6.0;h[L>>3]=Z;h[M>>3]=+h[S>>3];s=Z;t=p;p=Z;}else {y=(m|0)==1;t=y?v:p;q=y?u:q;p=r+-6.0;c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=+h[S>>3];r=r+-12.0;h[C>>3]=r;h[e>>3]=+h[T>>3];h[D>>3]=r;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];h[F>>3]=q;h[H>>3]=+h[G>>3];h[I>>3]=q;h[J>>3]=p;h[K>>3]=t;h[L>>3]=p;h[M>>3]=t;r=p;p=+h[z>>3];}h[N>>3]=p;c[O>>2]=8;c[V>>2]=X;c[P>>2]=c[S>>2];c[P+4>>2]=c[S+4>>2];c[P+8>>2]=c[S+8>>2];c[P+12>>2]=c[S+12>>2];c[Q>>2]=c[T>>2];c[Q+4>>2]=c[T+4>>2];c[Q+8>>2]=c[T+8>>2];c[Q+12>>2]=c[T+12>>2];c[R>>2]=c[V>>2];c[R+4>>2]=c[V+4>>2];k=DM(P,Q,R,W,n)|0;b=c[W>>2]|0;if(!b)break a;dO(d,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,k,b,17296);m=m+1|0;p=t;}U1(U);}while(0);l=Y;return}function Xg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0;g=l;l=l+16|0;f=g;j=(xB(b)|0)==0;j=j?18592:18584;a[f>>0]=a[j>>0]|0;a[f+1>>0]=a[j+1>>0]|0;a[f+2>>0]=a[j+2>>0]|0;a[f+3>>0]=a[j+3>>0]|0;f=oB(85493,f,0)|0;TC(f,137483,280,1)|0;GA(f,0,87171,195059)|0;j=JK(96)|0;e=c[f+16>>2]|0;c[e+8>>2]=j;i=c[b+16>>2]|0;k=c[i+8>>2]|0;h[j>>3]=+h[k>>3];h[j+24>>3]=+h[k+24>>3];a[e+115>>0]=a[i+115>>0]|0;c[e+116>>2]=c[i+116>>2]&1^1;c[e+248>>2]=c[i+248>>2];c[e+252>>2]=c[i+252>>2];e=LA(yC(b)|0,1,0)|0;while(1){if(!e)break;GA(f,1,c[e+8>>2]|0,c[e+12>>2]|0)|0;e=LA(yC(b)|0,1,e)|0;}e=LA(yC(b)|0,2,0)|0;while(1){if(!e)break;GA(f,2,c[e+8>>2]|0,c[e+12>>2]|0)|0;e=LA(yC(b)|0,2,e)|0;}if(!(GA(f,2,111464,0)|0))GA(f,2,111464,195059)|0;if(!(GA(f,2,111455,0)|0))GA(f,2,111455,195059)|0;ah(f,d);l=g;return f|0}function Yg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;a=tC(a,KB(b)|0,1)|0;TC(a,137447,304,1)|0;UA(b,a)|0;if((WM(b)|0)==2){f=b+16|0;b=KK((l2(c[c[(c[f>>2]|0)+104>>2]>>2]|0)|0)+3|0)|0;c[d>>2]=c[c[(c[f>>2]|0)+104>>2]>>2];m4(b,85488,d)|0;SA(a,108224,b)|0;}l=e;return a|0}function Zg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=iB(a,b,c,0,1)|0;TC(c,137460,176,1)|0;UA(d,c)|0;return c|0}function _g(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0;i=l;l=l+32|0;g=i+16|0;f=i;if(e|0){j=+h[b>>3];e=b+8|0;h[b>>3]=+h[e>>3];h[e>>3]=-j;};c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];Ng(a,f,g);l=i;return}function $g(a,b){a=a|0;b=b|0;c[47189]=c[b>>2];c[47193]=c[b+4>>2];c[47194]=c[b+8>>2];c[47174]=c[b+12>>2];c[47175]=c[b+16>>2];c[47181]=c[b+20>>2];c[47180]=c[b+24>>2];c[47179]=c[b+28>>2];c[47205]=c[b+32>>2];c[47197]=c[b+36>>2];c[47182]=c[b+40>>2];c[47192]=c[b+44>>2];c[47201]=c[b+48>>2];c[47200]=c[b+52>>2];c[47199]=c[b+56>>2];c[47204]=c[b+60>>2];c[47198]=c[b+64>>2];c[47183]=c[b+68>>2];c[47145]=c[b+72>>2];c[47146]=c[b+76>>2];c[47147]=c[b+80>>2];c[47157]=c[b+84>>2];c[47150]=c[b+88>>2];c[47151]=c[b+92>>2];c[47152]=c[b+96>>2];c[47154]=c[b+100>>2];c[47155]=c[b+104>>2];c[47158]=c[b+108>>2];c[47161]=c[b+112>>2];c[47159]=c[b+116>>2];c[47160]=c[b+120>>2];c[47163]=c[b+124>>2];c[47162]=c[b+128>>2];c[47164]=c[b+132>>2];c[47165]=c[b+136>>2];c[47156]=c[b+140>>2];c[47168]=c[b+144>>2];c[47140]=c[b+148>>2];c[47138]=c[b+152>>2];U1(b);Rf(a);sB(a)|0;return}function ah(a,b){a=a|0;b=b|0;c[b>>2]=c[47189];c[b+4>>2]=c[47193];c[b+8>>2]=c[47194];c[b+12>>2]=c[47174];c[b+16>>2]=c[47175];c[b+20>>2]=c[47181];c[b+24>>2]=c[47180];c[b+28>>2]=c[47179];c[b+32>>2]=c[47205];c[b+36>>2]=c[47197];c[b+40>>2]=c[47182];c[b+44>>2]=c[47192];c[b+48>>2]=c[47201];c[b+52>>2]=c[47200];c[b+56>>2]=c[47199];c[b+60>>2]=c[47204];c[b+64>>2]=c[47198];c[b+68>>2]=c[47183];c[b+72>>2]=c[47145];c[b+76>>2]=c[47146];c[b+80>>2]=c[47147];c[b+84>>2]=c[47157];c[b+88>>2]=c[47150];c[b+92>>2]=c[47151];c[b+96>>2]=c[47152];c[b+100>>2]=c[47154];c[b+104>>2]=c[47155];c[b+108>>2]=c[47158];c[b+112>>2]=c[47161];c[b+116>>2]=c[47159];c[b+120>>2]=c[47160];c[b+124>>2]=c[47163];c[b+128>>2]=c[47162];c[b+132>>2]=c[47164];c[b+136>>2]=c[47165];c[b+140>>2]=c[47156];c[b+144>>2]=c[47168];c[b+152>>2]=c[47138];c[b+148>>2]=c[47140];c[47189]=0;c[47193]=GA(a,2,87412,0)|0;c[47194]=GA(a,2,87421,0)|0;b=GA(a,2,101541,0)|0;c[47174]=b;if(!b)c[47174]=GA(a,2,101541,195059)|0;c[47175]=0;c[47181]=0;c[47180]=GA(a,2,101437,0)|0;c[47179]=GA(a,2,101428,0)|0;c[47205]=GA(a,2,101717,0)|0;c[47197]=0;c[47182]=GA(a,2,108224,0)|0;c[47192]=GA(a,2,85498,0)|0;c[47201]=0;c[47200]=GA(a,2,101617,0)|0;c[47199]=GA(a,2,101603,0)|0;c[47204]=GA(a,2,101708,0)|0;c[47198]=0;c[47183]=0;c[47145]=GA(a,1,141048,0)|0;c[47146]=GA(a,1,141116,0)|0;c[47147]=GA(a,1,108230,0)|0;c[47157]=0;c[47150]=GA(a,1,101428,0)|0;c[47151]=GA(a,1,101437,0)|0;c[47152]=0;c[47154]=GA(a,1,108224,0)|0;c[47155]=0;c[47158]=0;c[47161]=GA(a,1,101409,0)|0;c[47159]=GA(a,1,141076,0)|0;c[47160]=GA(a,1,101472,0)|0;c[47163]=GA(a,1,101484,0)|0;c[47162]=GA(a,1,101348,0)|0;c[47164]=GA(a,1,101489,0)|0;c[47165]=GA(a,1,85510,0)|0;c[47156]=0;c[47168]=0;c[47140]=GA(a,0,101409,0)|0;return}function bh(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0;d=c[(c[(c[a>>2]|0)+16>>2]|0)+96>>2]|0;a=c[(c[(c[b>>2]|0)+16>>2]|0)+96>>2]|0;b=(a|0)!=0;if(d)if(b?(f=+h[d+24>>3],i=+h[d+32>>3],e=+h[a+24>>3],g=+h[a+32>>3],!(f>e)):0)if(!(fg)a=-1;else a=i>2]|0)+116>>2]|0;if(!b)break;else a=b;}b=c[a>>2]&3;d=c[(c[((b|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0;e=c[d+232>>2]|0;a=c[(c[((b|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0;b=c[a+232>>2]|0;if((e|0)<=(b|0))if((e|0)<(b|0))a=1;else a=(c[d+236>>2]|0)<(c[a+236>>2]|0)&1;else a=0;return a|0}function dh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;e=d+8|0;f=d;h=(c[a+16>>2]|0)+180|0;g=(c[b+16>>2]|0)+172|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];b=eh(a,f,b,e)|0;l=d;return b|0}function eh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=c[b+4>>2]|0;a:do if((f|0)>0?(g=c[e+4>>2]|0,(g|0)>0):0)if((f|0)<(g|0)){f=c[b>>2]|0;e=0;while(1){b=c[f+(e<<2)>>2]|0;if(!b){b=0;break a}if((c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)==(d|0))break;else e=e+1|0;}}else {f=c[e>>2]|0;e=0;while(1){b=c[f+(e<<2)>>2]|0;if(!b){b=0;break a}if((c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)==(a|0))break;else e=e+1|0;}}else b=0;while(0);return b|0}function fh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;e=d+8|0;f=d;h=(c[a+16>>2]|0)+188|0;g=(c[b+16>>2]|0)+196|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];b=eh(a,f,b,e)|0;l=d;return b|0}function gh(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+48|0;d=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[d+180>>2]|0;if(!b)b=KK((c[d+184>>2]<<2)+8|0)|0;else b=MK(b,(c[d+184>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0)+180>>2]=b;f=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;d=c[f+180>>2]|0;f=f+184|0;b=c[f>>2]|0;c[f>>2]=b+1;c[d+(b<<2)>>2]=a;e=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;c[(c[e+180>>2]|0)+(c[e+184>>2]<<2)>>2]=0;e=a+-48|0;b=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;if(!d)b=KK((c[b+176>>2]<<2)+8|0)|0;else b=MK(d,(c[b+176>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0)+172>>2]=b;b=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;b=b+176|0;f=c[b>>2]|0;c[b>>2]=f+1;c[d+(f<<2)>>2]=a;f=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;c[(c[f+172>>2]|0)+(c[f+176>>2]<<2)>>2]=0;return a|0}function hh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=a+4|0;f=c[e>>2]|0;d=0;while(1){if((d|0)>=(f|0))break;g=c[a>>2]|0;h=g+(d<<2)|0;if((c[h>>2]|0)==(b|0)){i=4;break}else d=d+1|0;}if((i|0)==4){i=f+-1|0;c[e>>2]=i;c[h>>2]=c[g+(i<<2)>>2];c[(c[a>>2]|0)+(i<<2)>>2]=0;}return}function ih(a){a=a|0;if(!a)qa(85551,85561,117,85570);else {hh((c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+180|0,a);hh((c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+172|0,a);return}}function jh(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+48|0;d=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[d+204>>2]|0;if(!b)b=KK((c[d+208>>2]<<2)+8|0)|0;else b=MK(b,(c[d+208>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0)+204>>2]=b;f=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[f+204>>2]|0;f=f+208|0;d=c[f>>2]|0;c[f>>2]=d+1;c[b+(d<<2)>>2]=a;e=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;c[(c[e+204>>2]|0)+(c[e+208>>2]<<2)>>2]=0;return}function kh(a){a=a|0;lh(a,(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+204|0);return}function lh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=b+4|0;e=c[h>>2]|0;f=c[b>>2]|0;d=0;while(1){if((d|0)>=(e|0)){g=4;break}if((c[f+(d<<2)>>2]|0)==(a|0))break;else d=d+1|0;}if((g|0)==4){if(!f)d=KK((e<<2)+8|0)|0;else d=MK(f,(e<<2)+8|0)|0;c[b>>2]=d;f=c[h>>2]|0;g=f+1|0;c[h>>2]=g;c[d+(f<<2)>>2]=a;c[(c[b>>2]|0)+(g<<2)>>2]=0;}return}function mh(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=JK(96)|0;g=n+48|0;c[g>>2]=c[g>>2]|3;c[n>>2]=c[n>>2]&-4|2;h=JK(176)|0;m=n+16|0;c[m>>2]=h;c[((c[n>>2]&3|0)==3?n:g)+40>>2]=d;j=n+-48|0;c[((c[n>>2]&3|0)==2?n:j)+40>>2]=e;a[h+112>>0]=1;if(!f){c[h+156>>2]=1;b[h+154>>1]=1;b[h+168>>1]=1;b[h+170>>1]=1;}else {c[n>>2]=c[n>>2]&15|c[f>>2]&-16;c[g>>2]=c[g>>2]&15|c[f>>2]&-16;l=f+16|0;i=c[l>>2]|0;b[h+168>>1]=b[i+168>>1]|0;b[h+154>>1]=b[i+154>>1]|0;c[h+156>>2]=c[i+156>>2];b[h+170>>1]=b[i+170>>1]|0;d=c[((c[n>>2]&3|0)==3?n:g)+40>>2]|0;e=c[f>>2]&3;k=f+48|0;if((d|0)!=(c[((e|0)==3?f:k)+40>>2]|0)){g=f+-48|0;if((d|0)==(c[((e|0)==2?f:g)+40>>2]|0)){h=h+16|0;d=i+56|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}}else {h=h+16|0;d=i+16|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0));g=f+-48|0;}d=c[((c[n>>2]&3|0)==2?n:j)+40>>2]|0;e=c[f>>2]&3;if((d|0)!=(c[((e|0)==2?f:g)+40>>2]|0)){if((d|0)==(c[((e|0)==3?f:k)+40>>2]|0)){h=(c[m>>2]|0)+56|0;d=(c[l>>2]|0)+16|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}}else {h=(c[m>>2]|0)+56|0;d=(c[l>>2]|0)+56|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}d=(c[l>>2]|0)+172|0;if(!(c[d>>2]|0))c[d>>2]=n;c[(c[m>>2]|0)+116>>2]=f;}return n|0}function nh(a,b,c){a=a|0;b=b|0;c=c|0;return gh(mh(a,b,c)|0)|0}function oh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;a=(c[a+16>>2]|0)+192|0;f=c[a>>2]|0;d=c[b+16>>2]|0;c[d+164>>2]=f;e=f;if(f|0)c[(c[e+16>>2]|0)+168>>2]=b;c[a>>2]=b;c[d+168>>2]=0;if((e|0)==(b|0))qa(85587,85561,215,85603);else return}function ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if((a|0)==(b|0))qa(85613,85561,220,85620);f=c[b+16>>2]|0;d=f+164|0;if(c[d>>2]|0)qa(85633,85561,221,85620);e=(c[a+16>>2]|0)+164|0;c[d>>2]=c[e>>2];d=c[e>>2]|0;if(d|0)c[(c[d+16>>2]|0)+168>>2]=b;c[f+168>>2]=a;c[e>>2]=b;return}function qh(a,b){a=a|0;b=b|0;var d=0,e=0;if(!(rh(a,b)|0))qa(85652,85561,231,85673);b=c[b+16>>2]|0;d=c[b+164>>2]|0;e=d;b=b+168|0;if(d|0)c[(c[d+16>>2]|0)+168>>2]=c[b>>2];b=c[b>>2]|0;if(!b)c[(c[a+16>>2]|0)+192>>2]=e;else c[(c[b+16>>2]|0)+164>>2]=e;return}function rh(a,b){a=a|0;b=b|0;a=(c[a+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if((a|0)==0|(a|0)==(b|0))break;a=(c[a+16>>2]|0)+164|0;}return a|0}function sh(b){b=b|0;var d=0,e=0,f=0,g=0;d=JK(64)|0;c[d>>2]=c[d>>2]&-4|1;e=d+16|0;c[e>>2]=JK(304)|0;c[d+24>>2]=yC(b)|0;g=c[e>>2]|0;a[g+156>>0]=1;h[g+96>>3]=1.0;h[g+88>>3]=1.0;h[g+80>>3]=1.0;c[g+216>>2]=1;c[g+176>>2]=0;g=JK(20)|0;f=c[e>>2]|0;c[f+172>>2]=g;c[f+184>>2]=0;f=JK(20)|0;c[(c[e>>2]|0)+180>>2]=f;oh(b,d);b=(c[b+16>>2]|0)+232|0;c[b>>2]=(c[b>>2]|0)+1;return d|0}function th(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=d+48|0;e=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;f=c[e+188>>2]|0;if(!f)e=KK((c[e+192>>2]<<2)+8|0)|0;else e=MK(f,(c[e+192>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0)+188>>2]=e;h=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;f=c[h+188>>2]|0;h=h+192|0;e=c[h>>2]|0;c[h>>2]=e+1;c[f+(e<<2)>>2]=d;g=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;c[(c[g+188>>2]|0)+(c[g+192>>2]<<2)>>2]=0;g=d+-48|0;e=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;f=c[e+196>>2]|0;if(!f)e=KK((c[e+200>>2]<<2)+8|0)|0;else e=MK(f,(c[e+200>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0)+196>>2]=e;e=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;f=c[e+196>>2]|0;e=e+200|0;h=c[e>>2]|0;c[e>>2]=h+1;c[f+(h<<2)>>2]=d;h=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;c[(c[h+196>>2]|0)+(c[h+200>>2]<<2)>>2]=0;a[(c[b+16>>2]|0)+240>>0]=1;a[(c[(gg(b)|0)+16>>2]|0)+240>>0]=1;return}function uh(a){a=a|0;var b=0,d=0;if(!a)qa(85551,85561,269,85690);b=c[(c[a+16>>2]|0)+116>>2]|0;if(b|0?(d=(c[b+16>>2]|0)+172|0,(c[d>>2]|0)==(a|0)):0)c[d>>2]=0;hh((c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+188|0,a);hh((c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+196|0,a);return}function vh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;d=(c[a+16>>2]|0)+172|0;e=c[d>>2]|0;do if((e|0)!=(b|0))if(!e){c[d>>2]=b;wh(a,b);break}else qa(87593,85561,340,85728);else gA(0,85707,f)|0;while(0);l=f;return}function wh(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,i=0;f=(c[d+16>>2]|0)+170|0;i=c[a+16>>2]|0;a=b[i+170>>1]|0;if((e[f>>1]|0)<(a&65535))b[f>>1]=a;g=i+168|0;h=i+154|0;f=i+156|0;a=d;while(1){if(!a)break;d=c[a+16>>2]|0;i=d+168|0;b[i>>1]=(e[i>>1]|0)+(e[g>>1]|0);i=d+154|0;b[i>>1]=(e[i>>1]|0)+(e[h>>1]|0);i=d+156|0;c[i>>2]=(c[i>>2]|0)+(c[f>>2]|0);a=c[d+172>>2]|0;}return}function xh(d){d=d|0;var e=0,f=0,g=0,h=0;f=d+16|0;e=c[(c[f>>2]|0)+172>>2]|0;a:while(1){if(!e)break;yh(e,d);h=c[e+16>>2]|0;g=c[h+172>>2]|0;if(!(b[h+168>>1]|0))zh(e);while(1){if((a[(c[e+16>>2]|0)+112>>0]|0)!=1){e=g;continue a}e=c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){e=g;continue a}if((c[e+184>>2]|0)!=1){e=g;continue a}e=c[c[e+180>>2]>>2]|0;yh(e,d);}}c[(c[f>>2]|0)+172>>2]=0;return}function yh(a,d){a=a|0;d=d|0;var f=0;f=c[d+16>>2]|0;d=c[a+16>>2]|0;a=d+168|0;b[a>>1]=(e[a>>1]|0)-(e[f+168>>1]|0);a=d+154|0;b[a>>1]=(e[a>>1]|0)-(e[f+154>>1]|0);d=d+156|0;c[d>>2]=(c[d>>2]|0)-(c[f+156>>2]|0);return}function zh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(!a)qa(85551,85561,128,85741);g=a+48|0;d=0;while(1){b=c[a>>2]|0;e=(c[(c[((b&3|0)==3?a:g)+40>>2]|0)+16>>2]|0)+180|0;f=c[(c[e>>2]|0)+(d<<2)>>2]|0;if(!f)break;if((f|0)==(a|0))hh(e,a);d=d+1|0;}g=a+-48|0;f=0;while(1){d=(c[(c[((b&3|0)==2?a:g)+40>>2]|0)+16>>2]|0)+172|0;e=c[(c[d>>2]|0)+(f<<2)>>2]|0;if(!e)break;if((e|0)==(a|0)){hh(d,a);b=c[a>>2]|0;}f=f+1|0;}return}function Ah(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;p=l;l=l+1040|0;n=p+1032|0;o=p;m=p+8|0;k=d+16|0;d=c[k>>2]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;i=c[d+196>>2]|0;h=i+(j<<6)|0;i=i+(j<<6)+4|0;g=0;d=0;while(1){if((g|0)>=(c[h>>2]|0))break;e=c[(c[i>>2]|0)+(g<<2)>>2]|0;f=e+16|0;if(c[(c[f>>2]|0)+112>>2]|0){if(!d){a[n>>0]=a[18588]|0;a[n+1>>0]=a[18589]|0;a[n+2>>0]=a[18590]|0;a[n+3>>0]=a[18591]|0;d=oB(85763,n,0)|0;}c[o>>2]=g;m4(m,137395,o)|0;t=tC(d,m,1)|0;TC(t,91164,24,1)|0;q=c[(c[f>>2]|0)+180>>2]|0;r=c[q>>2]|0;r=c[(c[(c[((c[r>>2]&3|0)==2?r:r+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;q=c[q+4>>2]|0;q=c[(c[(c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;s=(r|0)>(q|0);f=c[t+16>>2]|0;c[f+12>>2]=s?q:r;c[f+16>>2]=s?r:q;c[f+20>>2]=e;}g=g+1|0;}if(d|0){if((tB(d)|0)>1)Bh(d,h);sB(d)|0;}j=j+1|0;d=c[k>>2]|0;}l=p;return}function Bh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=0;h=jC(a)|0;a:while(1){if(!h)break;i=kC(a,h)|0;j=h+16|0;g=i;while(1){if(!g){h=i;continue a}f=c[g+16>>2]|0;e=c[j>>2]|0;if((c[f+16>>2]|0)>(c[e+12>>2]|0)){if((c[e+16>>2]|0)<=(c[f+12>>2]|0))iB(a,h,g,0,1)|0;}else {iB(a,g,h,0,1)|0;d=1;}g=kC(a,g)|0;}}do if(d|0){h=ND(a,85766,1)|0;j=JK((tB(a)|0)<<2)|0;i=JK((tB(a)|0)<<2)|0;f=b+4|0;e=jC(a)|0;b:while(1){if(!e){d=23;break}if((c[(c[e+16>>2]|0)+8>>2]|0)==0?vB(a,e,1,1)|0:0){c:do if(Ch(a,e,h,i)|0){g=tB(h)|0;if((Dh(a,h,j)|0)!=(g|0)){d=17;break b}o4(i,g,4,60);d=0;while(1){if((d|0)>=(g|0))break c;b=i+(d<<2)|0;k=c[j+(d<<2)>>2]|0;c[(c[k+16>>2]|0)+236>>2]=c[b>>2];c[(c[f>>2]|0)+(c[b>>2]<<2)>>2]=k;d=d+1|0;}}while(0);Fh(h);}e=kC(a,e)|0;}if((d|0)==17)qa(85771,85781,265,85792);else if((d|0)==23){U1(j);break}}while(0);return}function Ch(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=c[b+16>>2]|0;c[h+8>>2]=1;h=c[(c[(c[h+20>>2]|0)+16>>2]|0)+236>>2]|0;c[e+((tB(d)|0)<<2)>>2]=h;oC(d,b,1)|0;h=XA(a,b)|0;f=0;while(1){if(!h)break;j=c[h>>2]&3;g=c[((j|0)==2?h:h+-48|0)+40>>2]|0;i=c[g+16>>2]|0;f=f+((c[(c[(c[i+20>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[(c[(c[((j|0)==3?h:h+48|0)+40>>2]|0)+16>>2]|0)+20>>2]|0)+16>>2]|0)+236>>2]|0)&1)|0;if(!(c[i+8>>2]|0))f=(Ch(a,g,d,e)|0)+f|0;h=ZA(a,h)|0;}h=_A(a,b)|0;while(1){if(!h)break;i=c[h>>2]&3;g=c[((i|0)==3?h:h+48|0)+40>>2]|0;j=c[g+16>>2]|0;f=f+((c[(c[(c[(c[(c[((i|0)==2?h:h+-48|0)+40>>2]|0)+16>>2]|0)+20>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[j+20>>2]|0)+16>>2]|0)+236>>2]|0)&1)|0;if(!(c[j+8>>2]|0))f=(Ch(a,g,d,e)|0)+f|0;h=$A(a,h)|0;}return f|0}function Dh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=0;while(1){e=Gh(a,b)|0;if(!e)break;c[d+(f<<2)>>2]=c[(c[e+16>>2]|0)+20>>2];vC(b,e)|0;e=XA(a,e)|0;while(1){if(!e)break;g=ZA(a,e)|0;lB(a,e)|0;e=g;}f=f+1|0;}return f|0}function Eh(a,b){a=a|0;b=b|0;return (c[a>>2]|0)-(c[b>>2]|0)|0}function Fh(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;c=kC(a,b)|0;vC(a,b)|0;b=c;}return}function Gh(a,b){a=a|0;b=b|0;var c=0;c=jC(b)|0;while(1){if(!c){c=0;break}if(!(vB(a,c,1,0)|0))break;c=kC(b,c)|0;}return c|0}function Hh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;Ih(b);i=b+16|0;f=0;e=0;while(1){if((f|0)>=(c[(c[i>>2]|0)+220>>2]|0))break;Jh(b,f);f=f+1|0;e=(Kh(b,0,d)|0)+e|0;}Lh(b);h=1;while(1){f=c[i>>2]|0;g=c[f+180>>2]|0;if((h|0)>(g|0))break;g=(Mh(c[(c[f+184>>2]|0)+(h<<2)>>2]|0,d)|0)+e|0;h=h+1|0;e=g;}do if((g|0)>0){f=QA(b,85806)|0;if(f|0?(dP(f)|0)<<24>>24==0:0)break;jl(b);a[193769]=1;e=Kh(b,2,d)|0;}while(0);Nh(b,e);return}function Ih(d){d=d|0;var e=0;if(0);a[193769]=0;c[46741]=d;e=((uB(gg(d)|0)|0)<<2)+4|0;c[46740]=JK(e)|0;c[46739]=JK(e)|0;Di(d);e=d+16|0;if(b[(c[e>>2]|0)+136>>1]&16)Ei(d);Sk(d);Gl(d,1);Fi(d);Uh(d);e=c[e>>2]|0;c[46742]=b[e+236>>1];c[46743]=b[e+238>>1];return}function Jh(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;a=c[a+16>>2]|0;c[a+192>>2]=c[(c[a+216>>2]|0)+(d<<2)>>2];a:do if((d|0)>0){d=b[a+238>>1]|0;e=a+196|0;a=b[a+236>>1]|0;while(1){if((a|0)>(d|0))break a;f=c[e>>2]|0;g=f+(a<<6)+4|0;f=f+(a<<6)|0;c[g>>2]=(c[g>>2]|0)+(c[f>>2]<<2);c[f>>2]=0;a=a+1|0;}}while(0);return}function Kh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+32|0;n=o;if((b|0)>1){e=ii(0)|0;ji(a);}else e=2147483647;m=c[15712]|0;k=b;f=0;b=e;while(1){if((k|0)>=3)break;f=c[47136]|0;if((k|0)==2)if((e|0)>(b|0)){li(a);e=b;}else e=b;else {e=(f|0)<4?f:4;if((gg(a)|0)==(a|0))ki(a,k);if(!k)Vh(a);Wh(a);g=ii(0)|0;if((g|0)>(b|0)){f=e;e=g;}else {ji(a);f=e;e=g;b=g;}}g=0;j=0;while(1){if((j|0)>=(f|0))break;if(0);i=g+1|0;if((e|0)==0|(g|0)>=(c[46744]|0))break;mi(a,j);e=ii(0)|0;if((e|0)>(b|0))g=i;else {ji(a);g=+h[23215]*+(b|0)>+(e|0)?0:i;b=e;}j=j+1|0;}if(!e){e=0;break}else k=k+1|0;}if((e|0)>(b|0))li(a);if((b|0)>0){ni(a,0);e=ii(0)|0;}else e=b;a:do if(d|0){b=0;while(1){if((b|0)>=(f|0))break a;oi(a);b=b+1|0;}}while(0);l=o;return e|0}function Lh(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;hi(a);k=a+16|0;d=c[k>>2]|0;m=c[15712]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;e=c[d+196>>2]|0;f=c[e+(j<<6)+8>>2]|0;c[e+(j<<6)>>2]=f;g=c[e+(j<<6)+12>>2]|0;c[e+(j<<6)+4>>2]=g;i=0;while(1){if((i|0)>=(f|0))break;h=c[g+(i<<2)>>2]|0;if(!h){o=6;break}c[(c[h+16>>2]|0)+236>>2]=i;i=i+1|0;}if((o|0)==6){o=0;if(0);c[e+(j<<6)>>2]=i;}j=j+1|0;}l=p;return}function Mh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;dl(a);Uh(a);Vh(a);Wh(a);f=a+16|0;d=Kh(a,2,b)|0;e=1;while(1){g=c[f>>2]|0;if((e|0)>(c[g+180>>2]|0))break;d=(Mh(c[(c[g+184>>2]|0)+(e<<2)>>2]|0,b)|0)+d|0;e=e+1|0;}Xh(a);return d|0}function Nh(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+16|0;p=q;f=c[46739]|0;if(f|0){U1(f);c[46739]=0;}f=c[46740]|0;if(f|0){U1(f);c[46740]=0;}o=d+16|0;f=1;while(1){g=c[o>>2]|0;if((f|0)>(c[g+180>>2]|0))break;Oh(c[(c[g+184>>2]|0)+(f<<2)>>2]|0);f=f+1|0;}n=b[g+236>>1]|0;f=g;while(1){if((n|0)>(b[f+238>>1]|0))break;else m=0;while(1){f=c[f+196>>2]|0;if((m|0)>=(c[f+(n<<6)>>2]|0))break;k=(c[(c[f+(n<<6)+4>>2]|0)+(m<<2)>>2]|0)+16|0;f=c[k>>2]|0;c[f+236>>2]=m;f=c[f+188>>2]|0;a:do if(f|0){g=0;while(1){i=c[f+(g<<2)>>2]|0;if(!i)break a;j=i+16|0;if((a[(c[j>>2]|0)+112>>0]|0)==4){uh(i);U1(c[j>>2]|0);U1(i);g=g+-1|0;f=c[(c[k>>2]|0)+188>>2]|0;}g=g+1|0;}}while(0);m=m+1|0;f=c[o>>2]|0;}Ph(c[f+(n<<6)+56>>2]|0);n=n+1|0;f=c[o>>2]|0;}if(0);l=q;return}function Oh(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;g=a+16|0;d=1;while(1){f=c[g>>2]|0;if((d|0)>(c[f+180>>2]|0))break;Oh(c[(c[f+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}a:do if(c[f+268>>2]|0){e=b[f+236>>1]|0;d=f;while(1){if((e|0)>(b[d+238>>1]|0))break a;j=c[(c[d+268>>2]|0)+(e<<2)>>2]|0;i=Qh(a,j,-1)|0;j=Qh(a,j,1)|0;c[(c[(c[g>>2]|0)+268>>2]|0)+(e<<2)>>2]=i;k=c[(c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0;i=c[(c[i+16>>2]|0)+236>>2]|0;f=c[g>>2]|0;h=c[f+196>>2]|0;c[h+(e<<6)+4>>2]=k+(i<<2);c[h+(e<<6)>>2]=(c[(c[j+16>>2]|0)+236>>2]|0)+1-i;e=e+1|0;d=f;}}while(0);return}function Ph(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function Qh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=b;while(1){b=Rh(b,c)|0;if(!b)break;if(Sh(a,b)|0){d=b;continue}e=(Th(a,b)|0)==0;d=e?d:b;}return d|0}function Rh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!a)qa(85856,85781,1023,85858);if((b|0)<0){a=c[a+16>>2]|0;e=c[a+236>>2]|0;if((e|0)>0){a=(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(c[a+232>>2]<<6)+4|0;d=e+-1|0;f=7;}else g=0;}else {a=c[a+16>>2]|0;e=c[a+236>>2]|0;a=(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(c[a+232>>2]<<6)+4|0;d=e+1|0;f=7;}if((f|0)==7){a=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(a)if((O((c[(c[a+16>>2]|0)+236>>2]|0)-e|0,b)|0)>0)g=a;else qa(85867,85781,1029,85858);else g=0;}return g|0}function Sh(b,d){b=b|0;d=d|0;if(!(a[(c[d+16>>2]|0)+156>>0]|0))b=(HC(b,d)|0)!=0&1;else b=0;return b|0}function Th(b,d){b=b|0;d=d|0;var e=0,f=0;d=c[d+16>>2]|0;if(((a[d+156>>0]|0)==1?(c[d+176>>2]|0)==1:0)?(c[d+184>>2]|0)==1:0){d=c[d+180>>2]|0;while(1){d=c[d>>2]|0;e=c[d+16>>2]|0;if(!(a[e+112>>0]|0))break;else d=e+116|0;}if(HC(b,d)|0)d=1;else f=7;}else f=7;if((f|0)==7)d=0;return d|0}function Uh(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=c[47140]|0;a:do if((d|0)!=0|(c[47161]|0)!=0){d=aP(b,d,0)|0;if(d|0){switch(a[d>>0]|0){case 0:break a;case 111:{if(!(s2(d,86069)|0)){ci(b,1);break a}break}case 105:{if(!(s2(d,98735)|0)){ci(b,0);break a}break}default:{}}c[e>>2]=d;gA(1,86073,e)|0;break}d=OD(b)|0;while(1){if(!d)break;if(!(Pj(d)|0))Uh(d);d=PD(d)|0;}if(c[47161]|0)di(b);}while(0);l=f;return}function Vh(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;e=c[k>>2]|0;j=b[e+236>>1]|0;while(1){if((j|0)>(b[e+238>>1]|0))break;else {f=0;i=0;}while(1){g=c[e+196>>2]|0;h=c[g+(j<<6)>>2]|0;if((i|0)>=(h|0))break;g=c[(c[(c[g+(j<<6)+4>>2]|0)+(i<<2)>>2]|0)+16>>2]|0;a[g+158>>0]=0;a[g+157>>0]=0;c[g+284>>2]=i;if((f|0)==0&(c[g+192>>2]|0)>0){f=ai(h,h)|0;e=c[k>>2]|0;c[(c[e+196>>2]|0)+(j<<6)+56>>2]=f;f=1;}i=i+1|0;}a:do if(f){i=0;f=h;while(1){if((i|0)>=(f|0))break a;h=c[(c[g+(j<<6)+4>>2]|0)+(i<<2)>>2]|0;if(!(a[(c[h+16>>2]|0)+157>>0]|0)){bi(d,h);e=c[k>>2]|0;f=c[e+196>>2]|0;g=f;f=c[f+(j<<6)>>2]|0;}i=i+1|0;}}while(0);j=j+1|0;}return}function Wh(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=d+16|0;e=c[s>>2]|0;if(a[e+240>>0]|0){h=0;r=b[e+236>>1]|0;q=0;i=0;a:while(1){if((r|0)>(b[e+238>>1]|0))break;f=c[e+196>>2]|0;g=c[f+(r<<6)>>2]|0;if(!g){g=q;f=i;}else {f=c[f+(r<<6)+4>>2]|0;o=c[(c[(c[f>>2]|0)+16>>2]|0)+236>>2]|0;e=0;while(1){if((e|0)>=(g|0))break;a[(c[(c[f+(e<<2)>>2]|0)+16>>2]|0)+157>>0]=0;e=e+1|0;}e=(e<<2)+4|0;if(!h)p=KK(e)|0;else p=MK(i,e)|0;m=0;n=0;while(1){e=c[s>>2]|0;f=c[e+196>>2]|0;g=c[f+(r<<6)>>2]|0;if((g|0)<=(n|0))break;j=c[(c[f+(r<<6)+4>>2]|0)+(((c[e+116>>2]&1|0)==0?g+~n|0:n)<<2)>>2]|0;l=j+16|0;e=0;k=0;while(1){i=c[l>>2]|0;if((e|0)>=(c[i+200>>2]|0)){f=0;g=0;e=i;break}i=k+((Yh(d,c[(c[i+196>>2]|0)+(e<<2)>>2]|0)|0)!=0&1)|0;e=e+1|0;k=i;}while(1){if((g|0)>=(c[e+192>>2]|0))break;i=f+((Yh(d,c[(c[e+188>>2]|0)+(g<<2)>>2]|0)|0)!=0&1)|0;f=i;g=g+1|0;e=c[l>>2]|0;}if(f|k)if((k|0)==0&(a[e+157>>0]|0)==0)e=(Zh(d,j,p+(m<<2)|0,r)|0)+m|0;else e=m;else {c[p+(m<<2)>>2]=j;e=m+1|0;}m=e;n=n+1|0;}b:do if(m){c:do if(!(c[e+116>>2]&1)){f=p;e=p+(m<<2)|0;while(1){e=e+-4|0;if(f>>>0>=e>>>0){g=0;break c}n=c[f>>2]|0;c[f>>2]=c[e>>2];c[e>>2]=n;f=f+4|0;}}else g=0;while(0);while(1){e=c[s>>2]|0;i=c[e+196>>2]|0;f=c[i+(r<<6)>>2]|0;if((g|0)>=(f|0)){m=0;g=i;break}n=c[p+(g<<2)>>2]|0;c[(c[i+(r<<6)+4>>2]|0)+(g<<2)>>2]=n;c[(c[n+16>>2]|0)+236>>2]=g+o;g=g+1|0;}while(1){if((m|0)>=(f|0))break b;l=(c[(c[g+(r<<6)+4>>2]|0)+(m<<2)>>2]|0)+16|0;i=c[(c[l>>2]|0)+188>>2]|0;if(i){k=0;f=i;while(1){g=c[f+(k<<2)>>2]|0;e=c[s>>2]|0;if(!g)break;j=c[g>>2]&3;i=c[(c[(c[((j|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;j=c[(c[(c[((j|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;if(!(c[e+116>>2]&1))if((i|0)<(j|0))t=36;else e=k;else if((i|0)>(j|0))t=36;else e=k;if((t|0)==36){t=0;if(Yh(d,g)|0){t=37;break a}uh(g);_h(d,g);e=k+-1|0;f=c[(c[l>>2]|0)+188>>2]|0;}k=e+1|0;}f=c[e+196>>2]|0;g=f;f=c[f+(r<<6)>>2]|0;}m=m+1|0;}}while(0);a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(r<<6)+49>>0]=0;h=p;g=p;f=p;}r=r+1|0;q=g;i=f;}if((t|0)==37)qa(85915,85781,1561,85954);if(h|0)U1(q);}return}function Xh(a){a=a|0;var d=0,e=0;e=a+16|0;a=c[e>>2]|0;a:do if(c[a+268>>2]|0){d=b[a+236>>1]|0;while(1){if((d|0)>(b[a+238>>1]|0))break a;c[(c[a+268>>2]|0)+(d<<2)>>2]=c[c[(c[a+196>>2]|0)+(d<<6)+4>>2]>>2];d=d+1|0;a=c[e>>2]|0;}}while(0);return}function Yh(a,b){a=a|0;b=b|0;if((c[(c[b+16>>2]|0)+156>>2]|0)!=0?($h(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)!=0:0)a=($h(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)!=0&1;else a=0;return a|0}function Zh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;l=d+16|0;g=c[l>>2]|0;a[g+157>>0]=1;a:do if((c[g+192>>2]|0)>0){h=0;j=0;while(1){i=c[(c[g+188>>2]|0)+(j<<2)>>2]|0;if(!i)break a;if((Yh(b,i)|0)!=0?(k=c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0,(a[(c[k+16>>2]|0)+157>>0]|0)==0):0)h=(Zh(b,k,e+(h<<2)|0,f)|0)+h|0;j=j+1|0;g=c[l>>2]|0;}}else h=0;while(0);if((c[g+232>>2]|0)==(f|0)){c[e+(h<<2)>>2]=d;return h+1|0}else qa(85967,85781,1490,85983);return 0}function _h(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;i=c[d>>2]&3;j=c[((i|0)==2?d:d+-48|0)+40>>2]|0;f=c[(c[j+16>>2]|0)+188>>2]|0;a:do if(!f){e=d+48|0;m=15;}else {l=d+48|0;g=((i|0)==3?d:l)+40|0;e=0;while(1){h=c[f+(e<<2)>>2]|0;if(!h){e=l;m=15;break a}if((c[((c[h>>2]&3|0)==2?h:h+-48|0)+40>>2]|0)==(c[g>>2]|0))break;else e=e+1|0;}vh(d,h);e=(c[d+16>>2]|0)+172|0;if(!(c[e>>2]|0))c[e>>2]=h;e=c[h+16>>2]|0;if((a[e+112>>0]|0)==4?(k=e+116|0,(c[k>>2]|0)==0):0)c[k>>2]=d;e=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;f=c[e+204>>2]|0;if(!f)e=KK((c[e+208>>2]<<2)+8|0)|0;else e=MK(f,(c[e+208>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0)+204>>2]=e;i=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;j=c[i+204>>2]|0;i=i+208|0;k=c[i>>2]|0;c[i>>2]=k+1;c[j+(k<<2)>>2]=d;d=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;c[(c[d+204>>2]|0)+(c[d+208>>2]<<2)>>2]=0;}while(0);if((m|0)==15){m=mh(j,c[((i|0)==3?d:e)+40>>2]|0,d)|0;l=c[d+16>>2]|0;d=c[m+16>>2]|0;a[d+112>>0]=(a[l+112>>0]|0)==4?4:3;c[d+96>>2]=c[l+96>>2];th(b,m);}return}function $h(a,b){a=a|0;b=b|0;var c=0;c=Sh(a,b)|0;return Th(a,b)|0|c|0}function ai(a,b){a=a|0;b=b|0;var d=0;d=JK(12)|0;c[d>>2]=a;c[d+4>>2]=b;c[d+8>>2]=JK(O(b,a)|0)|0;return d|0}function bi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;o=d+16|0;l=c[o>>2]|0;k=c[(c[(c[b+16>>2]|0)+196>>2]|0)+(c[l+232>>2]<<6)+56>>2]|0;a[l+157>>0]=1;a[l+158>>0]=1;l=(c[(c[(gg(b)|0)+16>>2]|0)+180>>2]|0)>0;e=c[o>>2]|0;f=c[e+188>>2]|0;a:do if(f){m=k+4|0;n=k+8|0;d=0;b:while(1){j=c[f+(d<<2)>>2]|0;if(!j){p=e;break a}if(l){if((HC(b,c[((c[j>>2]&3|0)==3?j:j+48|0)+40>>2]|0)|0)!=0?(HC(b,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)|0)!=0:0)q=7;}else q=7;do if((q|0)==7){q=0;h=j+16|0;if(c[(c[h>>2]|0)+156>>2]|0){e=c[j>>2]&3;g=j+-48|0;r=c[(c[((e|0)==2?j:g)+40>>2]|0)+16>>2]|0;i=c[r+284>>2]|0;f=(i|0)<(c[k>>2]|0);if((a[r+158>>0]|0)==1){if(!f){q=10;break b}e=c[(c[(c[((e|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+284>>2]|0;f=c[m>>2]|0;if((e|0)>=(f|0)){q=12;break b}a[(c[n>>2]|0)+((O(f,i)|0)+e)>>0]=1;uh(j);d=d+-1|0;if((a[(c[h>>2]|0)+112>>0]|0)==4)break;_h(b,j);break}else {if(!f){q=16;break b}e=c[(c[(c[((e|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+284>>2]|0;f=c[m>>2]|0;if((e|0)>=(f|0)){q=18;break b}a[(c[n>>2]|0)+((O(f,e)|0)+i)>>0]=1;e=c[((c[j>>2]&3|0)==2?j:g)+40>>2]|0;if(a[(c[e+16>>2]|0)+157>>0]|0)break;bi(b,e);break}}}while(0);f=c[o>>2]|0;d=d+1|0;e=f;f=c[f+188>>2]|0;}if((q|0)==10)qa(85993,85781,1251,86025);else if((q|0)==12)qa(86037,85781,1252,86025);else if((q|0)==16)qa(85993,85781,1260,86025);else if((q|0)==18)qa(86037,85781,1261,86025);}else p=e;while(0);a[p+158>>0]=0;return}function ci(a,b){a=a|0;b=b|0;var c=0;c=jC(a)|0;while(1){if(!c)break;ei(a,c,b);c=kC(a,c)|0;}return}function di(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;d=jC(b)|0;while(1){if(!d)break;e=aP(d,c[47161]|0,0)|0;a:do if(e|0){switch(a[e>>0]|0){case 0:break a;case 111:{if(!(s2(e,86069)|0)){ei(b,d,1);break a}break}case 105:{if(!(s2(e,98735)|0)){ei(b,d,0);break a}break}default:{}}h=KB(d)|0;c[f>>2]=e;c[f+4>>2]=h;gA(1,86104,f)|0;}while(0);d=kC(b,d)|0;}l=g;return}function ei(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=c[46740]|0;h=d+16|0;f=c[h>>2]|0;a:do if(!(c[f+212>>2]|0)){i=(e|0)!=0;b:do if(i){g=0;d=0;e=f;while(1){f=c[(c[e+180>>2]|0)+(g<<2)>>2]|0;if(!f)break b;if(!(fi(f)|0)){c[j+(d<<2)>>2]=f;d=d+1|0;e=c[h>>2]|0;}g=g+1|0;}}else {g=0;d=0;e=f;while(1){f=c[(c[e+172>>2]|0)+(g<<2)>>2]|0;if(!f)break b;if(!(fi(f)|0)){c[j+(d<<2)>>2]=f;d=d+1|0;e=c[h>>2]|0;}g=g+1|0;}}while(0);if((d|0)>=2){c[j+(d<<2)>>2]=0;o4(j,d,4,61);h=i?2:3;g=i?-1:1;f=1;while(1){d=c[j+(f<<2)>>2]|0;if(!d)break a;e=c[j+(f+-1<<2)>>2]|0;e=c[((c[e>>2]&3|0)==(h|0)?e:e+(g*48|0)|0)+40>>2]|0;d=c[((c[d>>2]&3|0)==(h|0)?d:d+(g*48|0)|0)+40>>2]|0;if(fh(e,d)|0)break a;i=mh(e,d,0)|0;a[(c[i+16>>2]|0)+112>>0]=4;th(b,i);f=f+1|0;}}}while(0);return}function fi(a){a=a|0;var b=0;while(1){b=c[(c[a+16>>2]|0)+116>>2]|0;if(!b)break;else a=b;}b=c[a>>2]&3;return (c[(c[(c[((b|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)!=(c[(c[(c[((b|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)|0}function gi(a,b){a=a|0;b=b|0;return ((c[c[a>>2]>>2]|0)>>>4)-((c[c[b>>2]>>2]|0)>>>4)|0}function hi(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=c[a+16>>2]|0;g=f+220|0;h=c[g>>2]|0;if((h|0)>=2){i=f+216|0;a=0;e=0;while(1){if((e|0)>=(h|0))break;d=c[(c[i>>2]|0)+(e<<2)>>2]|0;if(a|0)c[(c[a+16>>2]|0)+164>>2]=d;j=c[d+16>>2]|0;c[j+168>>2]=a;a=d;d=j;while(1){d=c[d+164>>2]|0;if(!d)break;a=d;d=c[d+16>>2]|0;}e=e+1|0;}c[g>>2]=1;c[f+192>>2]=c[c[f+216>>2]>>2];b[f+236>>1]=c[46742];b[f+238>>1]=c[46743];}return}function ii(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=c[46741]|0;j=i+16|0;f=c[j>>2]|0;g=0;h=b[f+236>>1]|0;while(1){if((h|0)>=(b[f+238>>1]|0))break;d=c[f+196>>2]|0;if(!(a[d+(h<<6)+49>>0]|0)){e=Bi(i,h)|0;d=c[j>>2]|0;f=c[d+196>>2]|0;c[f+(h<<6)+52>>2]=e;a[f+(h<<6)+49>>0]=1;}else {e=c[d+(h<<6)+52>>2]|0;d=f;}g=e+g|0;h=h+1|0;f=d;}return g|0}function ji(a){a=a|0;var d=0,e=0,f=0,g=0,i=0,j=0;a=c[a+16>>2]|0;g=b[a+238>>1]|0;i=a+196|0;a=b[a+236>>1]|0;while(1){if((a|0)>(g|0))break;f=c[i>>2]|0;e=c[f+(a<<6)>>2]|0;f=f+(a<<6)+4|0;d=0;while(1){if((d|0)>=(e|0))break;j=c[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;h[j+16>>3]=+(c[j+236>>2]|0);d=d+1|0;}a=a+1|0;}return}function ki(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;m=r;n=d+16|0;o=VO(c[(c[n>>2]|0)+232>>2]|0)|0;j=c[n>>2]|0;f=j+192|0;g=f;while(1){g=c[g>>2]|0;if(!g)break;g=c[g+16>>2]|0;a[g+157>>0]=0;g=g+164|0;}h=b[j+238>>1]|0;i=j+196|0;g=b[j+236>>1]|0;while(1){if((g|0)>(h|0))break;c[(c[i>>2]|0)+(g<<6)>>2]=0;g=g+1|0;}i=(e|0)==0;while(1){g=c[f>>2]|0;if(!g)break;h=g+16|0;f=c[h>>2]|0;if((c[c[(i?f+172|0:f+180|0)>>2]>>2]|0)==0?(k=f+157|0,(a[k>>0]|0)==0):0){a[k>>0]=1;XO(o,g);while(1){f=YO(o)|0;if(!f)break;if((a[(c[f+16>>2]|0)+159>>0]|0)==7){il(d,f,e,o);continue}else {zi(d,f);Ai(o,f,e);continue}}f=c[h>>2]|0;}f=f+164|0;}if(YO(o)|0)gA(1,86312,m)|0;f=c[n>>2]|0;j=b[f+236>>1]|0;while(1){if((j|0)>(b[f+238>>1]|0))break;a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(j<<6)+49>>0]=0;if((c[f+116>>2]&1|0)!=0?(p=c[f+196>>2]|0,q=c[p+(j<<6)>>2]|0,(q|0)>0):0){g=c[p+(j<<6)+4>>2]|0;h=q+-1|0;i=(h|0)/2|0;f=0;while(1){if((f|0)>(i|0))break;ti(c[g+(f<<2)>>2]|0,c[g+(h-f<<2)>>2]|0);f=f+1|0;}f=c[n>>2]|0;}j=j+1|0;}if((gg(d)|0)==(d|0)?(ii(0)|0)>0:0)ni(d,0);WO(o);l=r;return}function li(d){d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=d+16|0;d=c[n>>2]|0;f=b[d+236>>1]|0;e=b[d+238>>1]|0;l=e<<16>>16;m=d+196|0;g=f;while(1){if((g|0)>(l|0))break;k=c[m>>2]|0;j=c[k+(g<<6)>>2]|0;k=k+(g<<6)+4|0;i=0;while(1){if((i|0)>=(j|0))break;o=c[(c[(c[k>>2]|0)+(i<<2)>>2]|0)+16>>2]|0;c[o+236>>2]=~~+h[o+16>>3];i=i+1|0;}g=g+1|0;}while(1){if((f|0)>(e<<16>>16|0))break;a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(f<<6)+49>>0]=0;o=c[d+196>>2]|0;o4(c[o+(f<<6)+4>>2]|0,c[o+(f<<6)>>2]|0,4,62);o=c[n>>2]|0;f=f+1|0;e=b[o+238>>1]|0;d=o;}return}function mi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=((d|0)%4|0|0)<2&1;e=c[a+16>>2]|0;if(!(d&1)){d=b[e+236>>1]|0;f=1;e=b[e+238>>1]|0;d=(d<<16>>16<=(b[(c[(c[46741]|0)+16>>2]|0)+236>>1]|0)&1)+(d<<16>>16)|0;}else {d=b[e+238>>1]|0;f=-1;e=b[e+236>>1]|0;d=((d<<16>>16>=(b[(c[(c[46741]|0)+16>>2]|0)+238>>1]|0))<<31>>31)+(d<<16>>16)|0;}e=f+e|0;while(1){if((d|0)==(e|0))break;wi(a,d,g,(vi(a,d,d-f|0)|0)&255);d=d+f|0;}ni(a,g^1);return}function ni(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;g=c[k>>2]|0;i=b[g+236>>1]|0;j=b[g+238>>1]|0;h=g+196|0;f=i<<16>>16;while(1){if((f|0)>(j|0)){h=i;break}a[(c[h>>2]|0)+(f<<6)+48>>0]=1;f=f+1|0;}while(1){f=0;h=h<<16>>16;while(1){if((h|0)>(b[g+238>>1]|0))break;if(a[(c[g+196>>2]|0)+(h<<6)+48>>0]|0){f=(ui(d,h,e)|0)+f|0;g=c[k>>2]|0;}h=h+1|0;}if((f|0)<=0)break;h=b[g+236>>1]|0;}return}function oi(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=d+16|0;e=c[o>>2]|0;n=b[e+238>>1]|0;a:while(1){if((n|0)<(b[e+236>>1]|0)){e=16;break}f=c[e+196>>2]|0;a[f+(n<<6)+48>>0]=0;p=(n|0)>0;q=n+1|0;g=0;b:while(1){l=(c[f+(n<<6)>>2]|0)+-1|0;m=f+(n<<6)+4|0;k=f+(q<<6)|0;while(1){if((g|0)>=(l|0))break b;j=c[m>>2]|0;i=c[j+(g<<2)>>2]|0;g=g+1|0;j=c[j+(g<<2)>>2]|0;if((c[(c[i+16>>2]|0)+236>>2]|0)>=(c[(c[j+16>>2]|0)+236>>2]|0)){e=7;break a}if(pi(d,i,j)|0)continue;if(p){f=qi(i,j)|0;h=qi(j,i)|0;}else {f=0;h=0;}if((c[k>>2]|0)>0){f=(ri(i,j)|0)+f|0;h=(ri(j,i)|0)+h|0;}if((h|0)<=(f|0))break}si(d,n,i,j);e=c[o>>2]|0;f=c[e+196>>2]|0;}n=n+-1|0;}if((e|0)==7)qa(86263,85781,721,86289);else if((e|0)==16)return}function pi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=c[d+16>>2]|0;i=c[j+212>>2]|0;f=c[e+16>>2]|0;g=c[f+212>>2]|0;h=(i|0)!=(g|0);do if(!(a[193769]|0))if((g|0)==0|((i|0)==0|h^1))k=9;else {if((a[j+159>>0]|0)==7?(a[j+156>>0]|0)==1:0){b=0;break}if((a[f+159>>0]|0)==7?(a[f+156>>0]|0)==1:0){b=0;break}b=1;}else if(h)b=1;else k=9;while(0);if((k|0)==9){f=c[b+16>>2]|0;b=c[(c[f+196>>2]|0)+(c[j+232>>2]<<6)+56>>2]|0;if(!b)b=0;else {j=(c[f+116>>2]&1|0)==0;k=O(c[b+4>>2]|0,c[(c[(j?d:e)+16>>2]|0)+284>>2]|0)|0;b=a[(c[b+8>>2]|0)+((c[(c[(j?e:d)+16>>2]|0)+284>>2]|0)+k)>>0]|0;}}return b|0}function qi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;l=a+16|0;j=c[(c[d+16>>2]|0)+172>>2]|0;d=0;while(1){a=c[j>>2]|0;if(!a)break;i=c[a+16>>2]|0;k=b[i+154>>1]|0;g=c[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;i=i+16|0;f=c[(c[l>>2]|0)+172>>2]|0;a=d;while(1){d=c[f>>2]|0;if(!d)break;e=(c[(c[(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-g|0;if((e|0)<=0){if((e|0)==0?(m=c[d+16>>2]|0,+h[m+16>>3]>+h[i>>3]):0){d=m;n=9;}}else {d=c[d+16>>2]|0;n=9;}if((n|0)==9){n=0;a=(O(b[d+154>>1]|0,k)|0)+a|0;}f=f+4|0;}j=j+4|0;d=a;}return d|0}function ri(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;l=a+16|0;j=c[(c[d+16>>2]|0)+180>>2]|0;d=0;while(1){a=c[j>>2]|0;if(!a)break;i=c[a+16>>2]|0;k=b[i+154>>1]|0;g=c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;i=i+56|0;f=c[(c[l>>2]|0)+180>>2]|0;a=d;while(1){d=c[f>>2]|0;if(!d)break;e=(c[(c[(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-g|0;if((e|0)<=0){if((e|0)==0?(m=c[d+16>>2]|0,+h[m+56>>3]>+h[i>>3]):0){d=m;n=9;}}else {d=c[d+16>>2]|0;n=9;}if((n|0)==9){n=0;a=(O(b[d+154>>1]|0,k)|0)+a|0;}f=f+4|0;}j=j+4|0;d=a;}return d|0}function si(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=a[(c[e+16>>2]|0)+156>>0]|0;if(i<<24>>24!=(a[(c[f+16>>2]|0)+156>>0]|0)){j=b+16|0;l=c[(c[j>>2]|0)+196>>2]|0;k=c[l+(d<<6)>>2]|0;l=l+(d<<6)+4|0;b=0;g=0;h=0;while(1){if((b|0)>=(k|0))break;o=(a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)==0;b=b+1|0;g=g+(o&1)|0;h=h+((o^1)&1)|0;}i=i<<24>>24==0;h=(g|0)<(h|0)?(i?e:f):i?f:e;i=0;b=0;while(1){if((b|0)>=(k|0))break;i=(c[(c[l>>2]|0)+(b<<2)>>2]|0)==(h|0)?b:i;b=b+1|0;}o=(a[(c[h+16>>2]|0)+156>>0]|0)==0&1;n=0;g=i;while(1){b=g+-1|0;if((g|0)<=0){m=0;b=i;break}if((a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0)){m=0;b=i;break}n=n+1|0;g=b;}while(1){b=b+1|0;if((b|0)>=(k|0))break;if((a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0))break;m=m+1|0;}ti(e,f);j=c[(c[j>>2]|0)+196>>2]|0;k=c[j+(d<<6)>>2]|0;j=j+(d<<6)+4|0;b=0;while(1){if((b|0)>=(k|0)){h=0;g=i;break}i=(c[(c[j>>2]|0)+(b<<2)>>2]|0)==(h|0)?b:i;b=b+1|0;}while(1){b=g+-1|0;if((g|0)<=0){g=0;b=i;break}if((a[(c[(c[(c[j>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0)){g=0;b=i;break}h=h+1|0;g=b;}while(1){b=b+1|0;if((b|0)>=(k|0))break;if((a[(c[(c[(c[j>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0))break;g=g+1|0;}d=h-g|0;o=n-m|0;if((((d|0)>-1?d:0-d|0)|0)>(((o|0)>-1?o:0-o|0)|0))ti(e,f);}return}function ti(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+16>>2]|0;e=c[f+232>>2]|0;f=f+236|0;d=c[f>>2]|0;g=b+16|0;h=c[(c[g>>2]|0)+236>>2]|0;c[f>>2]=h;f=(c[46741]|0)+16|0;c[(c[(c[(c[f>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(h<<2)>>2]=a;c[(c[g>>2]|0)+236>>2]=d;c[(c[(c[(c[f>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(d<<2)>>2]=b;return}function ui(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=d+16|0;n=c[(c[q>>2]|0)+196>>2]|0;a[n+(e<<6)+48>>0]=0;r=(e|0)>0;s=e+1|0;o=(f|0)!=0;p=e+-1|0;g=0;i=0;f=n;a:while(1){l=(c[f+(e<<6)>>2]|0)+-1|0;m=f+(e<<6)+4|0;h=f+(s<<6)|0;n=g;while(1){if((n|0)>=(l|0)){f=17;break a}k=c[m>>2]|0;j=c[k+(n<<2)>>2]|0;n=n+1|0;k=c[k+(n<<2)>>2]|0;if((c[(c[j+16>>2]|0)+236>>2]|0)>=(c[(c[k+16>>2]|0)+236>>2]|0)){f=5;break a}if(pi(d,j,k)|0)continue;if(r){f=qi(j,k)|0;g=qi(k,j)|0;}else {f=0;g=0;}if((c[h>>2]|0)>0){f=(ri(j,k)|0)+f|0;g=(ri(k,j)|0)+g|0;}if((f|0)>(g|0))break;if((f|0)==(g|0)&(o&(f|0)>0)){f=g;break}}ti(j,k);i=f-g+i|0;g=c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0;a[g+(e<<6)+49>>0]=0;h=c[q>>2]|0;f=c[h+196>>2]|0;a[f+(e<<6)+48>>0]=1;if((b[h+236>>1]|0)<(e|0)){a[g+(p<<6)+49>>0]=0;a[f+(p<<6)+48>>0]=1;}if((b[h+238>>1]|0)<=(e|0)){g=n;continue}a[g+(s<<6)+49>>0]=0;a[f+(s<<6)+48>>0]=1;g=n;}if((f|0)==5)qa(86263,85781,770,86297);else if((f|0)==17)return i|0;return 0}function vi(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=c[46739]|0;q=a+16|0;a=c[(c[q>>2]|0)+196>>2]|0;r=c[a+(e<<6)+4>>2]|0;n=(f|0)>(e|0);o=p+4|0;m=0;while(1){f=c[a+(e<<6)>>2]|0;if((m|0)>=(f|0)){a=0;j=0;break}l=(c[r+(m<<2)>>2]|0)+16|0;a=c[l>>2]|0;a:do if(n){k=c[a+180>>2]|0;a=0;j=0;while(1){f=c[k+(j<<2)>>2]|0;if(!f)break a;g=c[f+16>>2]|0;if((b[g+154>>1]|0)>0){c[p+(a<<2)>>2]=c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]<<8|d[g+88>>0];a=a+1|0;}j=j+1|0;}}else {k=c[a+172>>2]|0;j=0;a=0;while(1){f=c[k+(j<<2)>>2]|0;if(!f)break a;g=c[f+16>>2]|0;if((b[g+154>>1]|0)>0){c[p+(a<<2)>>2]=c[(c[(c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+236>>2]<<8|d[g+48>>0];a=a+1|0;}j=j+1|0;}}while(0);b:do switch(a|0){case 0:{i=-1.0;break}case 1:{i=+(c[p>>2]|0);break}case 2:{i=+(((c[o>>2]|0)+(c[p>>2]|0)|0)/2|0|0);break}default:{o4(p,a,4,60);f=(a|0)/2|0;if(a&1|0){i=+(c[p+(f<<2)>>2]|0);break b}j=c[p+(f<<2)>>2]|0;g=(c[p+(a+-1<<2)>>2]|0)-j|0;a=c[p+(f+-1<<2)>>2]|0;f=a-(c[p>>2]|0)|0;if((f|0)==(g|0)){i=+((a+j|0)/2|0|0);break b}else {i=+(((O(f,j)|0)+(O(a,g)|0)|0)/(f+g|0)|0|0);break b}}}while(0);h[(c[l>>2]|0)+240>>3]=i;m=m+1|0;a=c[(c[q>>2]|0)+196>>2]|0;}while(1){if((j|0)>=(f|0))break;g=c[r+(j<<2)>>2]|0;p=c[g+16>>2]|0;if((c[p+184>>2]|0)==0?(c[p+176>>2]|0)==0:0){a=(xi(g)|0|a&255)&255;f=c[(c[(c[q>>2]|0)+196>>2]|0)+(e<<6)>>2]|0;}j=j+1|0;}return a|0}function wi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0;o=c[(c[b+16>>2]|0)+196>>2]|0;s=c[o+(d<<6)+4>>2]|0;o=c[o+(d<<6)>>2]|0;q=(e|0)!=0;p=(f|e|0)==0;f=0;e=o;o=s+(o<<2)|0;while(1){n=e+-1|0;if((e|0)>0)e=s;else break;a:while(1){b:while(1){if(e>>>0>=o>>>0)break a;while(1){if(e>>>0>=o>>>0)break a;l=c[e>>2]|0;m=+h[(c[l+16>>2]|0)+240>>3];if(!(m<0.0))break;e=e+4|0;}k=0;while(1){g=k<<24>>24==0;while(1){e=e+4|0;if(e>>>0>=o>>>0)break a;if(g){g=11;break}i=c[e>>2]|0;if(!(c[(c[i+16>>2]|0)+212>>2]|0)){g=13;break}}if((g|0)==11){i=c[e>>2]|0;j=i;}else if((g|0)==13)j=i;if(pi(b,l,j)|0)continue b;g=c[i+16>>2]|0;if(+h[g+240>>3]>=0.0)break;k=(c[g+212>>2]|0)==0?k:1;}g=~~m;k=~~+h[(c[i+16>>2]|0)+240>>3];if((g|0)>(k|0)|q&(g|0)==(k|0))break}ti(l,j);f=f+1|0;}e=n;o=p?o+-4|0:o;}if(f|0?(r=c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0,a[r+(d<<6)+49>>0]=0,(d|0)>0):0)a[r+(d+-1<<6)+49>>0]=0;return}function xi(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0;g=c[a+16>>2]|0;if((c[g+200>>2]|0)>0){f=c[g+196>>2]|0;a=c[f>>2]|0;a=c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0;d=1;while(1){e=c[f+(d<<2)>>2]|0;if(!e)break;e=c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0;a=(c[(c[e+16>>2]|0)+236>>2]|0)>(c[(c[a+16>>2]|0)+236>>2]|0)?e:a;d=d+1|0;}b=+h[(c[a+16>>2]|0)+240>>3];if(!(b>=0.0))a=1;else {h[g+240>>3]=b+1.0;a=0;}}else if((c[g+192>>2]|0)>0){e=c[g+188>>2]|0;d=c[e>>2]|0;a=1;d=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;while(1){f=c[e+(a<<2)>>2]|0;if(!f)break;f=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;a=a+1|0;d=(c[(c[f+16>>2]|0)+236>>2]|0)<(c[(c[d+16>>2]|0)+236>>2]|0)?f:d;}b=+h[(c[d+16>>2]|0)+240>>3];if(b>0.0){h[g+240>>3]=b+-1.0;a=0;}else a=1;}else a=1;return a|0}function yi(a,b){a=a|0;b=b|0;return (c[(c[(c[a>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[b>>2]|0)+16>>2]|0)+236>>2]|0)|0}function zi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+96|0;o=p+64|0;n=p+48|0;h=p+24|0;f=p;j=d+16|0;k=c[(c[j>>2]|0)+232>>2]|0;m=a+16|0;e=c[(c[m>>2]|0)+196>>2]|0;i=c[e+(k<<6)>>2]|0;do if((c[e+(k<<6)+8>>2]|0)>=1){c[(c[e+(k<<6)+4>>2]|0)+(i<<2)>>2]=d;c[(c[j>>2]|0)+236>>2]=i;a=c[m>>2]|0;f=c[a+196>>2]|0;e=f+(k<<6)|0;g=c[e>>2]|0;c[e>>2]=g+1;if((g|0)>=(c[f+(k<<6)+8>>2]|0))qa(86377,85781,1346,86413);g=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]|0;if((i|0)>(g|0)){m=KB(d)|0;n=c[(c[j>>2]|0)+236>>2]|0;o=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]|0;c[h>>2]=1359;c[h+4>>2]=m;c[h+8>>2]=n;c[h+12>>2]=k;c[h+16>>2]=o;gA(1,86429,h)|0;break}e=b[a+236>>1]|0;a=b[a+238>>1]|0;if((k|0)<(e|0)|(k|0)>(a<<16>>16|0)){c[n>>2]=1364;c[n+4>>2]=k;c[n+8>>2]=e;c[n+12>>2]=a<<16>>16;gA(1,86502,n)|0;break}if(((c[f+(k<<6)+4>>2]|0)+(i<<2)|0)>>>0>((c[f+(k<<6)+12>>2]|0)+(g<<2)|0)>>>0){i=KB(d)|0;n=c[(c[m>>2]|0)+196>>2]|0;m=(c[n+(k<<6)+4>>2]|0)+(c[(c[j>>2]|0)+236>>2]<<2)|0;n=(c[n+(k<<6)+12>>2]|0)+(c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]<<2)|0;c[o>>2]=1370;c[o+4>>2]=k;c[o+8>>2]=i;c[o+12>>2]=m;c[o+16>>2]=k;c[o+20>>2]=k;c[o+24>>2]=n;gA(1,86563,o)|0;}}else {n=KB(a)|0;o=KB(d)|0;c[f>>2]=1339;c[f+4>>2]=n;c[f+8>>2]=o;c[f+12>>2]=k;c[f+16>>2]=i;gA(1,86322,f)|0;}while(0);l=p;return}function Ai(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=d+16|0;a:do if(!e){g=0;while(1){d=c[h>>2]|0;if((g|0)>=(c[d+184>>2]|0))break a;d=c[(c[d+180>>2]|0)+(g<<2)>>2]|0;e=d+-48|0;f=(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;XO(b,c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0);}g=g+1|0;}}else {g=0;while(1){d=c[h>>2]|0;if((g|0)>=(c[d+176>>2]|0))break a;d=c[(c[d+172>>2]|0)+(g<<2)>>2]|0;e=d+48|0;f=(c[(c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0)+16>>2]|0)+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;XO(b,c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0);}g=g+1|0;}}while(0);return}function Bi(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;u=v;g=d+16|0;f=c[(c[g>>2]|0)+196>>2]|0;s=c[f+(e<<6)+4>>2]|0;t=e+1|0;d=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(t<<6)>>2]|0;if((c[46745]|0)>(d|0))q=c[46746]|0;else {d=d+1|0;c[46745]=d;f=c[46746]|0;if(!f)d=KK(d<<2)|0;else d=MK(f,d<<2)|0;c[46746]=d;f=c[(c[g>>2]|0)+196>>2]|0;q=d;}r=f+(t<<6)|0;d=0;while(1){if((d|0)>=(c[r>>2]|0))break;c[q+(d<<2)>>2]=0;d=d+1|0;}p=f+(e<<6)|0;o=0;h=0;d=0;j=q;while(1){k=c[p>>2]|0;if((o|0)>=(k|0))break;n=c[(c[(c[s+(o<<2)>>2]|0)+16>>2]|0)+180>>2]|0;a:do if((h|0)>0){m=0;while(1){g=c[n+(m<<2)>>2]|0;if(!g)break a;k=g+16|0;i=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;while(1){g=i+1|0;if((i|0)>=(h|0))break;i=g;d=(O(c[j+(g<<2)>>2]|0,b[(c[k>>2]|0)+154>>1]|0)|0)+d|0;}m=m+1|0;}}while(0);i=0;while(1){g=c[n+(i<<2)>>2]|0;if(!g)break;j=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;m=q+(j<<2)|0;c[m>>2]=(c[m>>2]|0)+(b[(c[g+16>>2]|0)+154>>1]|0);h=(j|0)>(h|0)?j:h;i=i+1|0;j=q;}o=o+1|0;}i=f+(e<<6)+4|0;h=0;while(1){if((h|0)>=(k|0))break;g=c[(c[(c[i>>2]|0)+(h<<2)>>2]|0)+16>>2]|0;if(a[g+145>>0]|0){e=g+180|0;c[u>>2]=c[e>>2];c[u+4>>2]=c[e+4>>2];d=(Ci(u,1)|0)+d|0;}h=h+1|0;}i=c[r>>2]|0;h=f+(t<<6)+4|0;g=0;while(1){if((g|0)>=(i|0))break;f=c[(c[(c[h>>2]|0)+(g<<2)>>2]|0)+16>>2]|0;if(a[f+145>>0]|0){t=f+172|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];d=(Ci(u,-1)|0)+d|0;}g=g+1|0;}l=v;return d|0}function Ci(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;n=(d|0)<1;l=c[a>>2]|0;d=0;a=0;a:while(1){m=c[l+(d<<2)>>2]|0;if(!m)break;d=d+1|0;if(n){j=m+48|0;k=m+16|0;i=d;while(1){e=c[l+(i<<2)>>2]|0;if(!e)continue a;f=c[e+16>>2]|0;g=c[k>>2]|0;if((+h[f+56>>3]-+h[g+56>>3])*+((c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[((c[m>>2]&3|0)==3?m:j)+40>>2]|0)+16>>2]|0)+236>>2]|0)|0)<0.0)a=(O(b[f+154>>1]|0,b[g+154>>1]|0)|0)+a|0;i=i+1|0;}}else {j=m+-48|0;k=m+16|0;i=d;while(1){e=c[l+(i<<2)>>2]|0;if(!e)continue a;f=c[e+16>>2]|0;g=c[k>>2]|0;if((+h[f+16>>3]-+h[g+16>>3])*+((c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[((c[m>>2]&3|0)==2?m:j)+40>>2]|0)+16>>2]|0)+236>>2]|0)|0)<0.0)a=(O(b[f+154>>1]|0,b[g+154>>1]|0)|0)+a|0;i=i+1|0;}}}return a|0}function Di(a){a=a|0;var b=0.0,d=0.0;c[46744]=8;c[47136]=24;h[23215]=.995;a=QA(a,86685)|0;if(a|0?(b=+r5(a),b>0.0):0){d=b*+(c[46744]|0);c[46744]=~~(d>1.0?d:1.0);b=b*+(c[47136]|0);c[47136]=~~(b>1.0?b:1.0);}return}function Ei(a){a=a|0;var d=0,e=0;e=(b[(c[a+16>>2]|0)+238>>1]|0)+2|0;d=JK(e<<2)|0;Gi(a,d,e,0)|0;U1(d);return}function Fi(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=a+16|0;i=JK((b[(c[h>>2]|0)+238>>1]<<2)+8|0)|0;g=jC(a)|0;while(1){if(!g)break;f=i+(c[(c[g+16>>2]|0)+232>>2]<<2)|0;c[f>>2]=(c[f>>2]|0)+1;f=XA(a,g)|0;while(1){if(!f)break;j=c[f>>2]&3;d=c[(c[(c[((j|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;j=c[(c[(c[((j|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;k=(d|0)>(j|0);e=k?d:j;d=k?j:d;while(1){d=d+1|0;if((d|0)>=(e|0))break;k=i+(d<<2)|0;c[k>>2]=(c[k>>2]|0)+1;}f=ZA(a,f)|0;}g=kC(a,g)|0;}f=JK((b[(c[h>>2]|0)+238>>1]<<6)+128|0)|0;e=c[h>>2]|0;c[e+196>>2]=f;d=b[e+236>>1]|0;while(1){if((d|0)>(b[e+238>>1]|0))break;j=i+(d<<2)|0;e=c[j>>2]|0;c[f+(d<<6)>>2]=e;c[f+(d<<6)+8>>2]=e;j=JK((c[j>>2]<<2)+4|0)|0;e=c[h>>2]|0;k=c[e+196>>2]|0;c[k+(d<<6)+4>>2]=j;c[k+(d<<6)+12>>2]=j;d=d+1|0;f=k;}U1(i);return}function Gi(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0;m=a+16|0;i=1;while(1){g=c[m>>2]|0;if((i|0)>(c[g+180>>2]|0))break;l=Gi(c[(c[g+184>>2]|0)+(i<<2)>>2]|0,d,e,f)|0;i=i+1|0;f=l;}a:do if((gg(a)|0)!=(a|0)){Y6(d|0,0,e<<2|0)|0;g=jC(a)|0;while(1){if(!g)break;k=g+16|0;c[d+(c[(c[k>>2]|0)+232>>2]<<2)>>2]=1;i=XA(a,g)|0;while(1){if(!i)break;l=i+-48|0;j=c[(c[k>>2]|0)+232>>2]|0;while(1){e=j+1|0;if((j|0)>=(c[(c[(c[((c[i>>2]&3|0)==2?i:l)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;c[d+(e<<2)>>2]=1;j=e;}i=ZA(a,i)|0;}g=kC(a,g)|0;}g=c[m>>2]|0;i=b[g+236>>1]|0;while(1){if((i|0)>(b[g+238>>1]|0))break a;if(!(c[d+(i<<2)>>2]|0)){if(!f)f=ND(gg(a)|0,86675,1)|0;g=tC(f,0,1)|0;TC(g,137447,304,1)|0;l=g+16|0;j=c[l>>2]|0;c[j+232>>2]=i;h[j+96>>3]=.5;h[j+88>>3]=.5;h[j+80>>3]=1.0;c[j+216>>2]=1;c[j+176>>2]=0;j=JK(20)|0;k=c[l>>2]|0;c[k+172>>2]=j;c[k+184>>2]=0;k=JK(20)|0;c[(c[l>>2]|0)+180>>2]=k;oC(a,g,1)|0;g=c[m>>2]|0;}i=i+1|0;}}while(0);return f|0}function Hi(a){a=a|0;var b=0,d=0;Xh(a);b=a+16|0;a=1;while(1){d=c[b>>2]|0;if((a|0)>(c[d+180>>2]|0))break;Hi(c[(c[d+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}return}function Ii(a){a=a|0;var b=0,d=0;b=c[a>>2]&3;d=Ji(c[((b|0)==3?a:a+48|0)+40>>2]|0)|0;b=c[17308+(d*12|0)+((Ji(c[((b|0)==2?a:a+-48|0)+40>>2]|0)|0)<<2)>>2]|0;a=(c[a+16>>2]|0)+156|0;c[a>>2]=O(c[a>>2]|0,b)|0;return}function Ji(b){b=b|0;b=c[b+16>>2]|0;if((a[b+156>>0]|0)==1)b=2;else b=(a[b+160>>0]|0)<2&1;return b|0}function Ki(b,d){b=b|0;d=d|0;if(c[(c[b+16>>2]|0)+192>>2]|0){jl(b);Li(b);if(a[194954]|0)xl(b);Mi(b);if(Pl(b)|0)Li(b);Ni(b);if(uL(b,2,Oi(b)|0)|0?(Pi(b),uL(b,2,Oi(b)|0)|0):0)qa(86693,86721,134,86732);Qi(b);Ri(b,d);Si(b);}return}function Li(d){d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0;v=d+16|0;e=c[v>>2]|0;w=c[e+196>>2]|0;t=b[e+236>>1]|0;while(1){if((t|0)>(b[e+238>>1]|0))break;n=w+(t<<6)|0;o=w+(t<<6)+4|0;p=w+(t<<6)+40|0;q=w+(t<<6)+24|0;r=w+(t<<6)+32|0;s=w+(t<<6)+16|0;m=0;while(1){if((m|0)>=(c[n>>2]|0))break;l=(c[(c[o>>2]|0)+(m<<2)>>2]|0)+16|0;e=c[l>>2]|0;j=+h[e+80>>3]*.5;i=c[e+204>>2]|0;a:do if(i){g=0;while(1){f=c[i+(g<<2)>>2]|0;if(!f)break a;x=c[f>>2]&3;if((c[((x|0)==3?f:f+48|0)+40>>2]|0)==(c[((x|0)==2?f:f+-48|0)+40>>2]|0)?(u=c[(c[f+16>>2]|0)+96>>2]|0,(u|0)!=0):0){k=+h[u+32>>3]*.5;j=j>k?j:k;}g=g+1|0;}}while(0);if(+h[p>>3]>3]=j;h[p>>3]=j;}if(+h[r>>3]>3]=j;h[r>>3]=j;}f=c[e+212>>2]|0;if(f|0){if((f|0)==(d|0))g=0;else {g=ZO(f,c[47144]|0,8,0)|0;e=c[l>>2]|0;}i=c[e+232>>2]|0;f=c[f+16>>2]|0;e=f+128|0;j=j+ +(g|0);if((i|0)==(b[f+236>>1]|0)){k=+h[e>>3];h[e>>3]=k>j?k:j;}e=f+120|0;if((i|0)==(b[f+238>>1]|0)){k=+h[e>>3];h[e>>3]=k>j?k:j;}}m=m+1|0;}t=t+1|0;e=c[v>>2]|0;}m=rj(d)|0;g=c[v>>2]|0;e=b[g+238>>1]|0;h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[w+(e<<6)+16>>3];f=b[g+236>>1]|0;i=g+252|0;k=0.0;while(1){l=e+-1|0;if((e|0)<=(f|0))break;y=+h[w+(l<<6)+32>>3]+ +h[w+(e<<6)+40>>3]+ +(c[i>>2]|0);j=+h[w+(e<<6)+24>>3]+8.0+ +h[w+(l<<6)+16>>3];j=y>j?y:j;if((c[w+(l<<6)>>2]|0)>0)h[(c[(c[c[w+(l<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+j;k=k>j?k:j;e=l;}b:do if((m|0)!=0?(c[g+116>>2]&1|0)!=0:0){sj(d,0);g=c[v>>2]|0;if(a[g+276>>0]|0){e=b[g+238>>1]|0;f=b[g+236>>1]|0;j=+h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];k=0.0;while(1){i=e+-1|0;if((e|0)<=(f|0))break b;z=+h[(c[(c[c[w+(i<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];y=z-j;j=z;k=k>y?k:y;e=i;}}}while(0);c:do if(a[g+276>>0]|0){i=b[g+236>>1]|0;f=b[g+238>>1]|0;while(1){e=f+-1|0;if((f|0)<=(i|0))break c;if((c[w+(e<<6)>>2]|0)<=0){f=e;continue}h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[(c[(c[c[w+(f<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+k;f=e;}}while(0);e=g+192|0;while(1){e=c[e>>2]|0;if(!e)break;e=c[e+16>>2]|0;h[e+24>>3]=+h[(c[(c[c[w+(c[e+232>>2]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];e=e+164|0;}return}function Mi(a){a=a|0;var b=0,d=0,e=0;nj(a);b=(c[a+16>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;e=b+16|0;b=c[e>>2]|0;d=c[b+224>>2]|0;if(d){oj(a,d);b=c[e>>2]|0;}d=c[b+228>>2]|0;if(!d)d=b;else {oj(a,d);d=c[e>>2]|0;}e=c[d+204>>2]|0;if(e|0){b=0;while(1)if(!(c[e+(b<<2)>>2]|0))break;else b=b+1|0;}b=d+164|0;}return}function Ni(a){a=a|0;$i(a);aj(a);bj(a);cj(a);dj(a);return}function Oi(a){a=a|0;var b=0,c=0.0;b=QA(a,86921)|0;if(!b)a=2147483647;else {c=+r5(b);a=~~(c*+(tB(a)|0));}return a|0}function Pi(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;r=d+16|0;e=c[r>>2]|0;q=b[e+236>>1]|0;while(1){p=b[e+238>>1]|0;if((q|0)>(p|0)){s=19;break}n=c[e+196>>2]|0;o=n+(q<<6)|0;m=c[o>>2]|0;n=n+(q<<6)+4|0;l=0;f=0;a:while(1){if((l|0)>=(m|0)){s=14;break}f=c[(c[n>>2]|0)+(l<<2)>>2]|0;h=c[f+16>>2]|0;i=c[h+256>>2]|0;b:do if(i|0){g=0;while(1){j=c[i+(g<<2)>>2]|0;if(!j)break b;k=c[j>>2]&3;if((c[(c[(c[((k|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;if((c[(c[(c[((k|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;else g=g+1|0;}}while(0);h=c[h+248>>2]|0;c:do if(h|0){g=0;while(1){i=c[h+(g<<2)>>2]|0;if(!i)break c;j=c[i>>2]&3;if((c[(c[(c[((j|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;if((c[(c[(c[((j|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;else g=g+1|0;}}while(0);l=l+1|0;}if((s|0)==14){s=0;if(f){f=c[c[n>>2]>>2]|0;e=c[c[o+(((q|0)<(p|0)?1:-1)<<6)+4>>2]>>2]|0;if(!e){s=16;break}o=sh(d)|0;p=o+16|0;a[(c[p>>2]|0)+156>>0]=2;Zi(o,f,0.0,0)|0;Zi(o,e,0.0,0)|0;c[(c[p>>2]|0)+232>>2]=c[(c[((c[(c[f+16>>2]|0)+232>>2]|0)<(c[(c[e+16>>2]|0)+232>>2]|0)?f:e)+16>>2]|0)+232>>2];e=c[r>>2]|0;}}q=q+1|0;}if((s|0)==16)qa(86829,86721,111,86832);else if((s|0)==19)return}function Qi(a){a=a|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0;a=c[a+16>>2]|0;i=c[a+196>>2]|0;e=b[a+238>>1]|0;a=b[a+236>>1]|0;while(1){if((a|0)>(e|0))break;f=c[i+(a<<6)>>2]|0;g=i+(a<<6)+4|0;d=0;while(1){if((d|0)>=(f|0))break;k=c[(c[(c[g>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;j=k+232|0;h[k+16>>3]=+(c[j>>2]|0);c[j>>2]=a;d=d+1|0;}a=a+1|0;}return}function Ri(a,d){a=a|0;d=d|0;var e=0,f=0.0,g=0,i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0;Ti(a,a);g=a+16|0;k=c[g>>2]|0;a:do if((b[k+238>>1]|0)>0?(j=c[k+8>>2]|0,e=c[j+84>>2]|0,e|0):0){o=~~(+h[k+32>>3]-+h[k+16>>3]);m=~~(+h[k+40>>3]-+h[k+24>>3]);p=(c[k+116>>2]&1|0)==0;n=p?m:o;m=p?o:m;if((e|0)==4){e=Ui(a)|0;k=c[g>>2]|0;j=c[k+8>>2]|0;}else e=(e|0)==2&1;b:do if(!(e<<24>>24)){switch(c[j+84>>2]|0){case 5:{f=+h[j+64>>3];if(f<=0.0)break a;i=f/+h[k+32>>3];l=+h[j+72>>3]/+h[k+40>>3];f=i1.0&l>1.0){l=f;break b}else break a}case 1:break;default:break a}i=+h[j+16>>3];f=+(n|0)/+(m|0);if(f>3];if(f<=0.0)break a;i=f/+(m|0);f=+h[j+72>>3]/+(n|0);if(i<1.0|f<1.0)if(i>2]&1|0)==0;i=e?f:l;f=e?l:f;e=k+192|0;while(1){e=c[e>>2]|0;if(!e)break;e=c[e+16>>2]|0;p=e+16|0;l=+h[p>>3]*f;h[p>>3]=+(~~(l+(l>=0.0?.5:-.5))|0);p=e+24|0;l=+h[p>>3]*i;h[p>>3]=+(~~(l+(l>=0.0?.5:-.5))|0);e=e+164|0;}Vi(a,f,i);}while(0);if(d|0)Wi(a,d);return}function Si(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=b+16|0;b=(c[h>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;g=b+16|0;d=0;while(1){b=c[g>>2]|0;f=c[b+180>>2]|0;e=c[f+(d<<2)>>2]|0;if(!e)break;U1(c[e+16>>2]|0);U1(e);d=d+1|0;}if(f){U1(f);b=c[g>>2]|0;}d=c[b+172>>2]|0;if(d){U1(d);b=c[g>>2]|0;}f=b+256|0;e=c[f+4>>2]|0;b=b+180|0;c[b>>2]=c[f>>2];c[b+4>>2]=e;b=c[g>>2]|0;e=b+248|0;f=c[e+4>>2]|0;b=b+172|0;c[b>>2]=c[e>>2];c[b+4>>2]=f;b=(c[g>>2]|0)+164|0;}b=0;d=c[(c[h>>2]|0)+192>>2]|0;a:while(1){g=(b|0)==0;f=b+16|0;b=d;while(1){if(!b)break a;e=c[b+16>>2]|0;d=c[e+164>>2]|0;if((a[e+156>>0]|0)!=2)continue a;if(g)c[(c[h>>2]|0)+192>>2]=d;else c[(c[f>>2]|0)+164>>2]=d;U1(e);U1(b);b=d;}}c[(c[(c[(c[h>>2]|0)+192>>2]|0)+16>>2]|0)+168>>2]=0;return}function Ti(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=a+16|0;d=1;while(1){f=c[e>>2]|0;if((d|0)>(c[f+180>>2]|0))break;Ti(c[(c[f+184>>2]|0)+(d<<2)>>2]|0,b);d=d+1|0;}Yi(a,b);return}function Ui(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0;s=l;l=l+80|0;e=s+64|0;d=s+48|0;f=s+16|0;m=s;r=s+32|0;a=a+16|0;b=c[(c[a>>2]|0)+8>>2]|0;t=b+48|0;c[f>>2]=c[t>>2];c[f+4>>2]=c[t+4>>2];c[f+8>>2]=c[t+8>>2];c[f+12>>2]=c[t+12>>2];if((!(+h[f>>3]<.001)?(g=f+8|0,!(+h[g>>3]<.001)):0)?(i=b+32|0,c[m>>2]=c[i>>2],c[m+4>>2]=c[i+4>>2],c[m+8>>2]=c[i+8>>2],c[m+12>>2]=c[i+12>>2],c[d>>2]=c[f>>2],c[d+4>>2]=c[f+4>>2],c[d+8>>2]=c[f+8>>2],c[d+12>>2]=c[f+12>>2],c[e>>2]=c[i>>2],c[e+4>>2]=c[i+4>>2],c[e+8>>2]=c[i+8>>2],c[e+12>>2]=c[i+12>>2],Xi(r,d,e),c[f>>2]=c[r>>2],c[f+4>>2]=c[r+4>>2],c[f+8>>2]=c[r+8>>2],c[f+12>>2]=c[r+12>>2],c[d>>2]=c[r>>2],c[d+4>>2]=c[r+4>>2],c[d+8>>2]=c[r+8>>2],c[d+12>>2]=c[r+12>>2],c[e>>2]=c[m>>2],c[e+4>>2]=c[m+4>>2],c[e+8>>2]=c[m+8>>2],c[e+12>>2]=c[m+12>>2],Xi(f,d,e),i=c[a>>2]|0,j=+h[i+32>>3],k=+h[i+40>>3],n=+h[f>>3],o=n/j,p=+h[g>>3],q=p/k,!(o>=1.0&q>=1.0)):0){o=o.5?o:.5;q=+N(+(o*k/p))*p/k;p=+N(+(o*j/n))*n/j*j;a=c[i+8>>2]|0;h[a+64>>3]=p;h[a+72>>3]=q*k;a=1;}else a=0;l=s;return a|0}function Vi(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;e=a+16|0;a=1;while(1){f=c[e>>2]|0;if((a|0)>(c[f+180>>2]|0))break;Vi(c[(c[f+184>>2]|0)+(a<<2)>>2]|0,b,d);a=a+1|0;}e=f+16|0;h[e>>3]=+h[e>>3]*b;e=f+24|0;h[e>>3]=+h[e>>3]*d;e=f+32|0;h[e>>3]=+h[e>>3]*b;f=f+40|0;h[f>>3]=+h[f>>3]*d;return}function Wi(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0;m=l;l=l+32|0;j=m+24|0;g=m+16|0;f=m;n=c[a+16>>2]|0;e=+h[n+32>>3]-+h[n+16>>3];d=+h[n+40>>3]-+h[n+24>>3];i=e/d;if(0);d=+h[b>>3];do if(!(i>d*1.1)){a=b+24|0;if(!(i<=d*.8)){c[a>>2]=0;k=9;break}c[a>>2]=-1;if(0);}else {c[b+24>>2]=~~(d*+((c[b+20>>2]|0)-(c[b+16>>2]|0)|0)/i);k=9;}while(0);if((k|0)==9?0:0){n=c[15712]|0;c[j>>2]=c[b+24>>2];w4(n,86815,j)|0;}l=m;return}function Xi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function Yi(d,e){d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;s=(gg(d)|0)==(d|0);v=d+16|0;w=c[v>>2]|0;a:do if(s){f=b[w+236>>1]|0;d=b[w+238>>1]|0;q=d<<16>>16;r=w+196|0;s=w+196|0;p=f<<16>>16;i=-2147483647.0;g=2147483647.0;while(1){if((p|0)>(q|0))break;j=c[r>>2]|0;o=c[j+(p<<6)>>2]|0;if((o|0)!=0?(t=c[j+(p<<6)+4>>2]|0,u=c[t>>2]|0,(u|0)!=0):0){l=1;j=u;while(1){j=c[j+16>>2]|0;k=a[j+156>>0]|0;if(!((l|0)<(o|0)&k<<24>>24!=0))break;j=c[t+(l<<2)>>2]|0;l=l+1|0;}if(!(k<<24>>24)){m=+h[j+16>>3]-+h[j+88>>3];n=g>2]|0)+(p<<6)+4>>2]|0;k=o+-2|0;j=o+-1|0;while(1){j=c[(c[l+(j<<2)>>2]|0)+16>>2]|0;if(!(a[j+156>>0]|0))break;else {j=k;k=k+-1|0;}}x=+h[j+96>>3]+ +h[j+16>>3];i=i>x?i:x;g=n?g:m;}}p=p+1|0;}k=c[w+180>>2]|0;l=w+184|0;j=1;while(1){if((j|0)>(k|0))break a;u=c[(c[(c[l>>2]|0)+(j<<2)>>2]|0)+16>>2]|0;x=+h[u+16>>3]+-8.0;m=+h[u+32>>3]+8.0;j=j+1|0;i=i>m?i:m;g=g>2]|0)+16>>2]|0)+232>>2]|0);g=+(c[(c[(c[w+256>>2]|0)+16>>2]|0)+232>>2]|0);f=b[w+236>>1]|0;d=b[w+238>>1]|0;}while(0);e=c[(c[e+16>>2]|0)+196>>2]|0;m=+h[(c[(c[c[e+(d<<16>>16<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[w+120>>3];x=+h[w+128>>3]+ +h[(c[(c[c[e+(f<<16>>16<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];h[w+16>>3]=g;h[w+24>>3]=m;e=c[v>>2]|0;h[e+32>>3]=i;h[e+40>>3]=x;return}function Zi(a,d,e,f){a=a|0;d=d|0;e=+e;f=f|0;var g=0,h=0,i=0,j=0;i=JK(96)|0;j=i+48|0;c[j>>2]=c[j>>2]|3;c[i>>2]=c[i>>2]&-4|2;g=JK(176)|0;h=i+16|0;c[h>>2]=g;c[((c[i>>2]&3|0)==3?i:j)+40>>2]=a;c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]=d;if(e>65535.0){_i(e);e=65535.0;g=c[h>>2]|0;}b[g+170>>1]=~~(e+(e>=0.0?.5:-.5));c[g+156>>2]=f;gh(i)|0;return i|0}function _i(a){a=+a;var b=0,d=0;b=l;l=l+16|0;d=b;h[d>>3]=a;c[d+8>>2]=65535;gA(1,86845,d)|0;l=b;return}function $i(a){a=a|0;var b=0,d=0,e=0,f=0;a=(c[a+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if(!a)break;f=a+16|0;e=c[f>>2]|0;a=e+172|0;d=c[a+4>>2]|0;e=e+248|0;c[e>>2]=c[a>>2];c[e+4>>2]=d;e=c[f>>2]|0;d=e+180|0;a=c[d+4>>2]|0;e=e+256|0;c[e>>2]=c[d>>2];c[e+4>>2]=a;e=c[f>>2]|0;a=c[e+180>>2]|0;d=0;while(1)if(!(c[a+(d<<2)>>2]|0))break;else d=d+1|0;b=c[e+172>>2]|0;a=0;while(1)if(!(c[b+(a<<2)>>2]|0))break;else a=a+1|0;c[e+176>>2]=0;a=JK((a+d<<2)+16|0)|0;e=c[f>>2]|0;c[e+172>>2]=a;c[e+184>>2]=0;e=JK(16)|0;a=c[f>>2]|0;c[a+180>>2]=e;a=a+164|0;}return}function aj(d){d=d|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0;z=l;l=l+16|0;w=z;x=d+16|0;u=c[x>>2]|0;y=c[u+196>>2]|0;d=(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1)!=0;v=c[u+248>>2]|0;c[w>>2]=v;c[w+4>>2]=d?5:v;v=b[u+236>>1]|0;d=u;while(1){if((v|0)>(b[d+238>>1]|0))break;r=y+(v<<6)+4|0;c[(c[(c[c[r>>2]>>2]|0)+16>>2]|0)+232>>2]=0;s=y+(v<<6)|0;t=+(c[w+((v&1)<<2)>>2]|0);p=0.0;k=0;a:while(1){if((k|0)>=(c[s>>2]|0))break;f=c[r>>2]|0;m=c[f+(k<<2)>>2]|0;u=m+16|0;d=c[u>>2]|0;i=+h[d+96>>3];h[d+240>>3]=i;if((c[d+208>>2]|0)>0){j=0;f=0;while(1){g=c[(c[d+204>>2]|0)+(j<<2)>>2]|0;if(!g)break;q=c[g>>2]&3;if((c[((q|0)==3?g:g+48|0)+40>>2]|0)==(c[((q|0)==2?g:g+-48|0)+40>>2]|0)){f=(kO(g)|0)+f|0;d=c[u>>2]|0;}j=j+1|0;}q=d+96|0;i=+h[q>>3]+ +(f|0);h[q>>3]=i;f=c[r>>2]|0;}q=k+1|0;f=c[f+(q<<2)>>2]|0;if(f){o=f+16|0;i=i+t+ +h[(c[o>>2]|0)+88>>3];Zi(m,f,i,0)|0;d=~~(i+p);c[(c[o>>2]|0)+232>>2]=d;p=+(d|0);d=c[u>>2]|0;}f=c[d+112>>2]|0;if(f){j=c[d+256>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;d=(c[(c[(c[((c[k>>2]&3|0)==2?k:k+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0);g=d?j:k;j=d?k:j;k=f+16|0;d=c[k>>2]|0;i=+((O(c[(c[x>>2]|0)+248>>2]|0,e[d+170>>1]|0)|0)/2|0|0);o=c[g>>2]&3;f=c[((o|0)==2?g:g+-48|0)+40>>2]|0;g=c[((o|0)==3?g:g+48|0)+40>>2]|0;if(!(lj(g,f)|0))Zi(f,g,+(~~(+h[(c[f+16>>2]|0)+96>>3]+i+ +h[(c[g+16>>2]|0)+88>>3])|0),c[d+156>>2]|0)|0;d=c[j>>2]&3;f=c[((d|0)==3?j:j+48|0)+40>>2]|0;d=c[((d|0)==2?j:j+-48|0)+40>>2]|0;if(!(lj(d,f)|0)){Zi(f,d,+(~~(+h[(c[f+16>>2]|0)+96>>3]+i+ +h[(c[d+16>>2]|0)+88>>3])|0),c[(c[k>>2]|0)+156>>2]|0)|0;o=0;}else o=0;}else o=0;while(1){d=c[u>>2]|0;if((o|0)>=(c[d+192>>2]|0)){k=q;continue a}m=c[(c[d+188>>2]|0)+(o<<2)>>2]|0;k=c[m>>2]&3;g=c[((k|0)==3?m:m+48|0)+40>>2]|0;k=c[((k|0)==2?m:m+-48|0)+40>>2]|0;j=(c[(c[g+16>>2]|0)+236>>2]|0)<(c[(c[k+16>>2]|0)+236>>2]|0);f=j?g:k;g=j?k:g;i=+h[(c[g+16>>2]|0)+88>>3]+ +h[(c[f+16>>2]|0)+96>>3];k=m+16|0;j=~~(i+ +(O(c[(c[x>>2]|0)+248>>2]|0,e[(c[k>>2]|0)+170>>1]|0)|0));n=dh(f,g)|0;if(!n){d=c[k>>2]|0;if(!(c[d+96>>2]|0))Zi(f,g,+(j|0),c[d+156>>2]|0)|0;}else {A=+(j|0);d=c[k>>2]|0;B=+h[d+136>>3];i=i+ +(c[(c[x>>2]|0)+248>>2]|0)+ +(~~(B+(B>=0.0?.5:-.5))|0);f=~~(i65535){_i(+(f|0));f=65535;d=c[k>>2]|0;}k=c[n+16>>2]|0;j=k+170|0;g=e[j>>1]|0;b[j>>1]=(f|0)<(g|0)?g:f;k=k+156|0;c[k>>2]=c[(c[((c[k>>2]|0)>(c[d+156>>2]|0)?n:m)+16>>2]|0)+156>>2];}o=o+1|0;}}v=v+1|0;d=c[x>>2]|0;}l=z;return}function bj(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;d=(c[b+16>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;g=d+16|0;d=c[g>>2]|0;e=c[d+256>>2]|0;a:do if(e){f=0;while(1){e=c[e+(f<<2)>>2]|0;if(!e)break a;n=sh(b)|0;d=n+16|0;a[(c[d>>2]|0)+156>>0]=2;l=e+16|0;k=c[l>>2]|0;i=~~(+h[k+56>>3]-+h[k+16>>3]);m=(i|0)>0;j=m?0:0-i|0;i=m?i:0;m=e+48|0;Zi(n,c[((c[e>>2]&3|0)==3?e:m)+40>>2]|0,+(i+1|0),c[k+156>>2]|0)|0;k=e+-48|0;Zi(n,c[((c[e>>2]&3|0)==2?e:k)+40>>2]|0,+(j+1|0),c[(c[l>>2]|0)+156>>2]|0)|0;l=c[e>>2]&3;i=(c[(c[(c[((l|0)==3?e:m)+40>>2]|0)+16>>2]|0)+232>>2]|0)-i|0;e=(c[(c[(c[((l|0)==2?e:k)+40>>2]|0)+16>>2]|0)+232>>2]|0)-j|0;c[(c[d>>2]|0)+232>>2]=((i|0)<(e|0)?i:e)+-1;d=c[g>>2]|0;f=f+1|0;e=c[d+256>>2]|0;}}while(0);d=d+164|0;}return}function cj(a){a=a|0;if((c[(c[a+16>>2]|0)+180>>2]|0)>0){gj(a);hj(a);ij(a);jj(a);}return}function dj(a){a=a|0;var b=0.0,d=0.0,e=0,f=0;e=a+16|0;f=c[(c[e>>2]|0)+8>>2]|0;if((c[f+84>>2]|0)==3?(b=+h[f+64>>3],d=+h[f+72>>3],!(d*b<=1.0)):0){ej(a);f=c[e>>2]|0;d=(c[f+116>>2]&1|0)==0?b:d;Zi(c[f+256>>2]|0,c[f+260>>2]|0,d<65535.0?d:65535.0,1e3)|0;}return}function ej(a){a=a|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;e=ZO(a,c[47144]|0,8,0)|0;fj(a);i=a+16|0;g=c[i>>2]|0;j=c[g+256>>2]|0;k=c[g+260>>2]|0;f=+(e|0);e=b[g+236>>1]|0;while(1){if((e|0)>(b[g+238>>1]|0))break;d=c[g+196>>2]|0;do if(c[d+(e<<6)>>2]|0){d=c[c[d+(e<<6)+4>>2]>>2]|0;if(!d){c[m>>2]=KB(a)|0;c[m+4>>2]=e;gA(1,86929,m)|0;break}else {Zi(j,d,+h[(c[d+16>>2]|0)+88>>3]+f+ +h[g+96>>3],0)|0;g=c[i>>2]|0;d=c[g+196>>2]|0;d=c[(c[d+(e<<6)+4>>2]|0)+((c[d+(e<<6)>>2]|0)+-1<<2)>>2]|0;Zi(d,k,+h[(c[d+16>>2]|0)+96>>3]+f+ +h[g+64>>3],0)|0;break}}while(0);e=e+1|0;g=c[i>>2]|0;}l=n;return}function fj(b){b=b|0;var d=0,e=0,f=0;d=b+16|0;if(!(c[(c[d>>2]|0)+256>>2]|0)){f=sh(gg(b)|0)|0;a[(c[f+16>>2]|0)+156>>0]=2;e=sh(gg(b)|0)|0;a[(c[e+16>>2]|0)+156>>0]=2;if((c[(c[d>>2]|0)+12>>2]|0?(gg(b)|0)!=(b|0):0)?(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0:0){b=c[d>>2]|0;Zi(f,e,+(~~+h[b+48+((+h[b+48>>3]>+h[b+80>>3]?0:2)<<4)>>3]|0),0)|0;}d=c[d>>2]|0;c[d+256>>2]=f;c[d+260>>2]=e;}return}function gj(a){a=a|0;var b=0,d=0;do if((gg(a)|0)!=(a|0)){ej(a);a=a+16|0;b=c[a>>2]|0;b=dh(c[b+256>>2]|0,c[b+260>>2]|0)|0;if(!b){d=c[a>>2]|0;Zi(c[d+256>>2]|0,c[d+260>>2]|0,1.0,128)|0;break}else {d=(c[b+16>>2]|0)+156|0;c[d>>2]=(c[d>>2]|0)+128;break}}else a=a+16|0;while(0);b=1;while(1){d=c[a>>2]|0;if((b|0)>(c[d+180>>2]|0))break;gj(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function hj(d){d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0;k=ZO(d,c[47144]|0,8,0)|0;o=d+16|0;e=c[o>>2]|0;m=+(k|0);k=b[e+236>>1]|0;while(1){if((k|0)>(b[e+238>>1]|0)){f=1;break}e=c[e+196>>2]|0;a:do if(c[e+(k<<6)>>2]|0?(l=c[c[e+(k<<6)+4>>2]>>2]|0,l|0):0){i=l+16|0;f=c[(c[i>>2]|0)+236>>2]|0;while(1){if((f|0)<=0)break;f=f+-1|0;j=c[(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)+4>>2]|0)+(f<<2)>>2]|0;g=j+16|0;e=c[g>>2]|0;if(!(a[e+156>>0]|0)){n=10;break}if(kj(d,j)|0){n=9;break}}if((n|0)==9){e=c[g>>2]|0;n=10;}if((n|0)==10){n=0;Zi(j,c[(c[o>>2]|0)+256>>2]|0,+h[e+96>>3]+m,0)|0;}f=(c[(c[(c[o>>2]|0)+196>>2]|0)+(k<<6)>>2]|0)+(c[(c[i>>2]|0)+236>>2]|0)|0;while(1){if((f|0)>=(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)>>2]|0))break a;i=c[(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)+4>>2]|0)+(f<<2)>>2]|0;g=i+16|0;e=c[g>>2]|0;if(!(a[e+156>>0]|0))break;if(!(kj(d,i)|0))f=f+1|0;else {n=15;break}}if((n|0)==15){n=0;e=c[g>>2]|0;}Zi(c[(c[o>>2]|0)+260>>2]|0,i,+h[e+88>>3]+m,0)|0;}while(0);k=k+1|0;e=c[o>>2]|0;}while(1){if((f|0)>(c[e+180>>2]|0))break;hj(c[(c[e+184>>2]|0)+(f<<2)>>2]|0);f=f+1|0;e=c[o>>2]|0;}return}function ij(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0;e=ZO(a,c[47144]|0,8,0)|0;fj(a);b=a+16|0;d=+(e|0);a=1;while(1){e=c[b>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[(c[e+184>>2]|0)+(a<<2)>>2]|0;fj(e);f=c[b>>2]|0;g=e+16|0;Zi(c[f+256>>2]|0,c[(c[g>>2]|0)+256>>2]|0,+h[f+96>>3]+d,0)|0;f=c[b>>2]|0;Zi(c[(c[g>>2]|0)+260>>2]|0,c[f+260>>2]|0,+h[f+64>>3]+d,0)|0;ij(e);a=a+1|0;}return}function jj(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0;d=ZO(a,c[47144]|0,8,0)|0;n=a+16|0;a=1;while(1){f=c[n>>2]|0;e=c[f+180>>2]|0;if((a|0)>(e|0))break;fj(c[(c[f+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}m=+(d|0);l=1;a=e;d=f;while(1){if((l|0)>(a|0))break;k=l+1|0;j=k;while(1){e=c[d+184>>2]|0;f=c[e+(l<<2)>>2]|0;if((j|0)>(a|0))break;e=c[e+(j<<2)>>2]|0;g=(b[(c[f+16>>2]|0)+236>>1]|0)>(b[(c[e+16>>2]|0)+236>>1]|0);i=g?e:f;e=g?f:e;f=c[i+16>>2]|0;g=c[e+16>>2]|0;o=b[g+236>>1]|0;h=o<<16>>16;if((b[f+238>>1]|0)>=o<<16>>16){a=(c[(c[(c[c[(c[f+196>>2]|0)+(h<<6)+4>>2]>>2]|0)+16>>2]|0)+236>>2]|0)<(c[(c[(c[c[(c[g+196>>2]|0)+(h<<6)+4>>2]>>2]|0)+16>>2]|0)+236>>2]|0);Zi(c[(c[(a?i:e)+16>>2]|0)+260>>2]|0,c[(c[(a?e:i)+16>>2]|0)+256>>2]|0,m,0)|0;a=c[n>>2]|0;d=a;a=c[a+180>>2]|0;}j=j+1|0;}jj(f);d=c[n>>2]|0;l=k;a=c[d+180>>2]|0;}return}function kj(b,d){b=b|0;d=d|0;var e=0;d=c[d+16>>2]|0;if((a[d+156>>0]|0)==1){d=c[c[d+256>>2]>>2]|0;while(1){e=c[(c[d+16>>2]|0)+116>>2]|0;if(!e)break;else d=e;}if(!(HC(b,c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0))d=(HC(b,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0)==0&1;else d=0;}else d=0;return d|0}function lj(a,b){a=a|0;b=b|0;return mj(a,b)|0}function mj(a,b){a=a|0;b=b|0;var d=0,e=0;a:do if((a|0)==(b|0))a=1;else {d=c[(c[a+16>>2]|0)+180>>2]|0;a=0;while(1){e=c[d+(a<<2)>>2]|0;if(!e){a=0;break a}if(!(mj(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,b)|0))a=a+1|0;else {a=1;break}}}while(0);return a|0}function nj(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;d=c[k>>2]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;h=c[d+196>>2]|0;g=c[h+(j<<6)>>2]|0;h=h+(j<<6)+4|0;i=0;f=0;while(1){if((f|0)>=(g|0))break;e=c[(c[(c[h>>2]|0)+(f<<2)>>2]|0)+16>>2]|0;c[e+236>>2]=i;if((a[e+159>>0]|0)==6)e=c[e+216>>2]|0;else e=1;i=e+i|0;f=f+1|0;}if((i|0)>(g|0)){d=c[h>>2]|0;if(!d)d=KK((i<<2)+4|0)|0;else d=MK(d,(i<<2)+4|0)|0;f=c[(c[k>>2]|0)+196>>2]|0;c[f+(j<<6)+4>>2]=d;e=c[f+(j<<6)>>2]|0;while(1){d=e+-1|0;if((e|0)<=0)break;h=c[f+(j<<6)+4>>2]|0;e=c[h+(d<<2)>>2]|0;c[h+(c[(c[e+16>>2]|0)+236>>2]<<2)>>2]=e;e=d;f=c[(c[k>>2]|0)+196>>2]|0;}c[f+(j<<6)>>2]=i;c[(c[f+(j<<6)+4>>2]|0)+(i<<2)>>2]=0;d=c[k>>2]|0;}j=j+1|0;}return}function oj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+48|0;n=o+32|0;m=o+8|0;d=o+24|0;k=o+16|0;j=o;e=b+16|0;f=c[e>>2]|0;a:do if((c[f+216>>2]|0)>=2){c[m>>2]=~~(+h[f+16>>3]-+h[f+88>>3]);c[m+4>>2]=~~+h[f+24>>3];c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];pj(d,b,n);g=d;i=c[g+4>>2]|0;d=m;c[d>>2]=c[g>>2];c[d+4>>2]=i;d=c[e>>2]|0;if((c[d+184>>2]|0)>0){j=c[c[d+180>>2]>>2]|0;d=(c[d+236>>2]|0)+1|0;j=_A(a,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)|0;while(1){if(!j)break a;i=(c[j>>2]&3|0)==2?j:j+-48|0;e=i+48|0;f=c[((c[i>>2]&3|0)==3?i:e)+40>>2]|0;if((f|0)!=(b|0)?(fP(f)|0)==(b|0):0){f=c[((c[i>>2]&3|0)==3?i:e)+40>>2]|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];qj(k,a,f,n,d);f=k;e=c[f+4>>2]|0;g=m;c[g>>2]=c[f>>2];c[g+4>>2]=e;xh(i);g=i+-48|0;e=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;f=c[e+172>>2]|0;if(!f)e=KK((c[e+176>>2]<<2)+8|0)|0;else e=MK(f,(c[e+176>>2]<<2)+8|0)|0;c[(c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0)+172>>2]=e;p=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;e=c[p+172>>2]|0;p=p+176|0;f=c[p>>2]|0;c[p>>2]=f+1;c[e+(f<<2)>>2]=i;i=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;c[(c[i+172>>2]|0)+(c[i+176>>2]<<2)>>2]=0;d=d+1|0;}j=$A(a,j)|0;}}else {i=c[c[d+172>>2]>>2]|0;d=(c[d+236>>2]|0)+1|0;i=XA(a,c[((c[i>>2]&3|0)==3?i:i+48|0)+40>>2]|0)|0;while(1){if(!i)break a;e=i+-48|0;f=c[((c[i>>2]&3|0)==2?i:e)+40>>2]|0;if((f|0)!=(b|0)?(fP(f)|0)==(b|0):0){f=c[((c[i>>2]&3|0)==2?i:e)+40>>2]|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];qj(j,a,f,n,d);f=j;e=c[f+4>>2]|0;g=m;c[g>>2]=c[f>>2];c[g+4>>2]=e;xh(i);g=i+48|0;e=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;f=c[e+180>>2]|0;if(!f)e=KK((c[e+184>>2]<<2)+8|0)|0;else e=MK(f,(c[e+184>>2]<<2)+8|0)|0;c[(c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0)+180>>2]=e;f=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;k=c[f+180>>2]|0;f=f+184|0;p=c[f>>2]|0;c[f>>2]=p+1;c[k+(p<<2)>>2]=i;p=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;c[(c[p+180>>2]|0)+(c[p+184>>2]<<2)>>2]=0;d=d+1|0;}i=ZA(a,i)|0;}}}while(0);l=o;return}function pj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0;qQ(b,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1);e=c[b+16>>2]|0;h[e+24>>3]=+(c[d+4>>2]|0);f=+h[e+88>>3]+ +(c[d>>2]|0);h[e+16>>3]=f;f=f+ +h[e+96>>3];c[d>>2]=~~(f+ +(c[(c[(xC(b)|0)+16>>2]|0)+248>>2]|0));e=d;b=c[e+4>>2]|0;d=a;c[d>>2]=c[e>>2];c[d+4>>2]=b;return}function qj(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=l;l=l+16|0;h=i;b=gg(b)|0;g=fP(d)|0;if((g|0)!=(d|0))ph(g,d);j=c[d+16>>2]|0;c[j+236>>2]=f;g=c[(c[g+16>>2]|0)+232>>2]|0;c[j+232>>2]=g;c[(c[(c[(c[b+16>>2]|0)+196>>2]|0)+(g<<6)+4>>2]|0)+(f<<2)>>2]=d;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];pj(a,d,h);l=i;return}function rj(a){a=a|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0.0;m=c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0;if((gg(a)|0)==(a|0))j=8.0;else j=+(ZO(a,c[47144]|0,8,0)|0);l=a+16|0;g=c[l>>2]|0;f=0;k=1;e=+h[g+120>>3];d=+h[g+128>>3];while(1){if((k|0)>(c[g+180>>2]|0))break;i=c[(c[g+184>>2]|0)+(k<<2)>>2]|0;f=rj(i)|0|f;i=c[i+16>>2]|0;g=c[l>>2]|0;if((b[i+238>>1]|0)==(b[g+238>>1]|0)){n=+h[i+120>>3]+j;e=e>n?e:n;}if((b[i+236>>1]|0)==(b[g+236>>1]|0)){n=+h[i+128>>3]+j;d=d>n?d:n;}k=k+1|0;}if((gg(a)|0)!=(a|0)?(c[(c[l>>2]|0)+12>>2]|0)!=0:0)if(!(c[(c[(yC(a)|0)+16>>2]|0)+116>>2]&1)){k=c[l>>2]|0;f=1;e=+h[k+56>>3]+e;d=+h[k+88>>3]+d;}else f=1;k=c[l>>2]|0;h[k+120>>3]=e;h[k+128>>3]=d;if((gg(a)|0)!=(a|0)){l=c[l>>2]|0;a=m+(b[l+236>>1]<<6)+24|0;n=+h[a>>3];h[a>>3]=n>d?n:d;m=m+(b[l+238>>1]<<6)+16|0;n=+h[m>>3];h[m>>3]=n>e?n:e;}return f|0}function sj(a,d){a=a|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0.0,q=0.0;o=c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0;if((gg(a)|0)==(a|0))e=0;else e=ZO(a,c[47144]|0,8,0)|0;l=a+16|0;i=c[l>>2]|0;m=e+d|0;k=+(e|0);j=1;f=+h[i+128>>3];g=+h[i+120>>3];e=i;while(1){if((j|0)>(c[e+180>>2]|0))break;i=c[(c[e+184>>2]|0)+(j<<2)>>2]|0;sj(i,m);i=c[i+16>>2]|0;e=c[l>>2]|0;if((b[i+238>>1]|0)==(b[e+238>>1]|0)){q=+h[i+120>>3]+k;g=g>q?g:q;}if((b[i+236>>1]|0)==(b[e+236>>1]|0)){q=+h[i+128>>3]+k;f=f>q?f:q;}j=j+1|0;}h[e+120>>3]=g;h[e+128>>3]=f;if(((gg(a)|0)!=(a|0)?(n=c[l>>2]|0,c[n+12>>2]|0):0)?(p=-g-f+ +h[n+48+((+h[n+104>>3]>+h[n+72>>3]?3:1)<<4)+8>>3]-+h[(c[(c[c[o+(b[n+236>>1]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+ +h[(c[(c[c[o+(b[n+238>>1]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3],p>0.0):0)tj(a,~~p,d);if((gg(a)|0)!=(a|0)){n=c[l>>2]|0;m=o+(b[n+236>>1]<<6)+24|0;q=+h[m>>3];p=+h[n+128>>3];h[m>>3]=q>p?q:p;o=o+(b[n+238>>1]<<6)+16|0;p=+h[o>>3];q=+h[n+120>>3];h[o>>3]=p>q?p:q;}return}function tj(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0;k=c[(gg(a)|0)+16>>2]|0;q=c[k+196>>2]|0;p=c[a+16>>2]|0;a=b[p+238>>1]|0;f=b[p+236>>1]|0;l=(d+1|0)/2|0;m=p+120|0;n=+h[m>>3];o=+(l|0);i=+(e|0);e=~~(o+i+n-+h[q+(a<<6)+16>>3]);if((e|0)>0){g=+(e|0);while(1){if((a|0)<(f|0))break;if((c[q+(a<<6)>>2]|0)>0){r=(c[(c[c[q+(a<<6)+4>>2]>>2]|0)+16>>2]|0)+24|0;h[r>>3]=+h[r>>3]+g;}a=a+-1|0;}j=+h[p+128>>3];a=e;g=j+ +(d-l|0);}else {j=+h[p+128>>3];a=d-l|0;g=j;}a=~~(+(a|0)+i+g-+h[q+(f<<6)+24>>3]);a:do if((a|0)>0){e=b[k+236>>1]|0;g=+(a|0);while(1){a=f+-1|0;if((f|0)<=(e|0))break a;if((c[q+(a<<6)>>2]|0)<=0){f=a;continue}f=(c[(c[c[q+(a<<6)+4>>2]>>2]|0)+16>>2]|0)+24|0;h[f>>3]=+h[f>>3]+g;f=a;}}while(0);h[p+128>>3]=j+ +(d-l|0);h[m>>3]=n+o;return}function uj(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b+16>>2]|0;f=a[e+84>>0]|0;b=c[d+16>>2]|0;do if(f<<24>>24==(a[b+84>>0]|0)){if(+h[e+56>>3]==+h[b+56>>3]){if(!(f<<24>>24==0?1:+h[e+64>>3]==+h[b+64>>3])){b=0;break}}else if(f<<24>>24){b=0;break}if(+h[e+16>>3]==+h[b+16>>3]?+h[e+24>>3]==+h[b+24>>3]:0){b=1;break}b=(a[e+44>>0]|0)==0&1;}else b=0;while(0);return b|0}function vj(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+16|0;d=c[i>>2]|0;b[d+236>>1]=32767;b[d+238>>1]=-1;d=0;h=jC(a)|0;while(1){e=c[i>>2]|0;if(!h)break;f=e+238|0;g=c[(c[h+16>>2]|0)+232>>2]|0;if((g|0)>(b[f>>1]|0))b[f>>1]=g;e=e+236|0;if((g|0)<(b[e>>1]|0))b[e>>1]=g;if(!d)d=h;else d=(g|0)<(c[(c[d+16>>2]|0)+232>>2]|0)?h:d;h=kC(a,h)|0;}c[e+264>>2]=d;return}function wj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0;b=QA(a,86974)|0;if(!b)b=2147483647;else {g=+r5(b);b=~~(g*+(tB(a)|0));}e=a+16|0;d=0;while(1){f=c[e>>2]|0;if((d|0)>=(c[f+220>>2]|0))break;c[f+192>>2]=c[(c[f+216>>2]|0)+(d<<2)>>2];uL(a,(c[f+180>>2]|0)==0&1,b)|0;d=d+1|0;}return}function xj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+16|0;e=f;if(!(QA(a,86983)|0))zj(a,d);else {g=(c[a+16>>2]|0)+136|0;b[g>>1]=b[g>>1]|16;yj(a,d);}if(0);l=f;return}function yj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0.0;i=l;l=l+16|0;h=i;c[46747]=0;a[h>>0]=a[18588]|0;a[h+1>>0]=a[18589]|0;a[h+2>>0]=a[18590]|0;a[h+3>>0]=a[18591]|0;h=oB(87201,h,0)|0;TC(h,87230,280,1)|0;FC(h,17404,17344);Aj(b);e=QA(b,86974)|0;if(!e)f=2147483647;else {j=+r5(e);f=~~(j*+(tB(b)|0));}Qj(b,0);Rj(b,h);Sj(b,h);Tj(b,h,0,0);Uj(h);g=Vj(h)|0;Wj(h);if(d|0){Kk(h);yk(h);}e=QA(b,102586)|0;if(!e)e=-1;else e=q5(e)|0;NK(h,1,f,e)|0;Xj(b,h,g);sB(h)|0;l=i;return}function zj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g+16|0;e=g+8|0;d=g;Aj(a);do if(!b){Bj(a,a);Nk(a);Cj(d,a);h=d;d=c[h+4>>2]|0;b=e;c[b>>2]=c[h>>2];c[b+4>>2]=d;Gl(a,0);b=0;}else {Kk(a);yk(a);Bj(a,a);Nk(a);Cj(d,a);i=d;d=c[i+4>>2]|0;h=e;c[h>>2]=c[i>>2];c[h+4>>2]=d;Gl(a,0);h=c[a+16>>2]|0;if((c[h+220>>2]|0)<=1?(c[h+180>>2]|0)<=0:0)break;c[b+32>>2]=1;b=0;}while(0);vk(a);c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];if(Dj(a,f)|0)Gl(a,0);if(!b)wj(a);else zk(a,b);Ej(a,b);Fj(a);l=g;return}function Aj(d){d=d|0;var f=0,g=0,h=0;if(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1){g=jC(d)|0;while(1){if(!g)break;f=XA(d,g)|0;while(1){if(!f)break;h=(c[f+16>>2]|0)+170|0;b[h>>1]=(e[h>>1]|0)<<1;f=ZA(d,f)|0;}g=kC(d,g)|0;}h=(c[d+16>>2]|0)+252|0;c[h>>2]=((c[h>>2]|0)+1|0)/2|0;}return}function Bj(a,b){a=a|0;b=b|0;var d=0;b=OD(b)|0;while(1){if(!b)break;d=Nj(b)|0;do if(d)if((d|0)==7&(c[47135]|0)==100){Jj(a,b);break}else {Oj(a,b,d);break}else Bj(a,b);while(0);b=PD(b)|0;}return}function Cj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=d+16|0;e=c[i>>2]|0;d=c[e+228>>2]|0;e=c[e+224>>2]|0;f=(e|0)==0;if(!d)if(f){j=0;k=0;}else g=4;else if(f)g=5;else g=4;if((g|0)==4){d=fP(e)|0;e=c[i>>2]|0;c[e+224>>2]=d;d=c[e+228>>2]|0;if(!d){h=0;d=e;g=12;}else g=5;}do if((g|0)==5){d=fP(d)|0;e=c[i>>2]|0;c[e+228>>2]=d;if(d){e=d+16|0;d=c[e>>2]|0;f=(a[d+159>>0]|0)==5&1;while(1){d=c[c[d+180>>2]>>2]|0;if(!d){g=11;break}h=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;if((h|0)!=(fP(h)|0)){g=9;break}uk(d);d=c[e>>2]|0;}if((g|0)==9)qa(87094,87034,346,87126);else if((g|0)==11){h=f;d=c[i>>2]|0;g=12;break}}else {h=0;d=e;g=12;}}while(0);a:do if((g|0)==12){d=c[d+224>>2]|0;if(!d){j=0;k=h;}else {e=d+16|0;d=c[e>>2]|0;f=(a[d+159>>0]|0)==3&1;while(1){d=c[c[d+172>>2]>>2]|0;if(!d){j=f;k=h;break a}i=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((i|0)!=(fP(i)|0))break;uk(d);d=c[e>>2]|0;}qa(87139,87034,353,87126);}}while(0);c[b>>2]=j;c[b+4>>2]=k;return}function Dj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;j=a+16|0;i=c[j>>2]|0;if((c[i+228>>2]|0)==0?(c[i+224>>2]|0)==0:0)d=0;else e=3;a:do if((e|0)==3){g=jC(a)|0;i=d+4|0;h=c[d>>2]&65535;d=0;while(1){if(!g)break a;if((g|0)==(fP(g)|0)){f=g+16|0;e=c[f>>2]|0;if((c[e+184>>2]|0)==0?(k=c[(c[j>>2]|0)+228>>2]|0,!((k|0)==0|(g|0)==(k|0))):0){d=nh(g,k,0)|0;e=c[d+16>>2]|0;b[e+170>>1]=c[i>>2];c[e+156>>2]=0;e=c[f>>2]|0;}if((c[e+176>>2]|0)==0?(l=c[(c[j>>2]|0)+224>>2]|0,!((l|0)==0|(g|0)==(l|0))):0){d=nh(l,g,0)|0;f=c[d+16>>2]|0;b[f+170>>1]=h;c[f+156>>2]=0;}}g=kC(a,g)|0;}}while(0);return (d|0)!=0|0}function Ej(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;g=jC(d)|0;k=d+16|0;f=c[k>>2]|0;a:do if(g){b[f+236>>1]=32767;b[f+238>>1]=-1;j=(e|0)==0;while(1){if(!g)break;f=fP(g)|0;i=c[g+16>>2]|0;e=c[i+232>>2]|0;do if((f|0)!=(g|0)){if(!j)if(!e)e=0;else break;e=e+(c[(c[f+16>>2]|0)+232>>2]|0)|0;c[i+232>>2]=e;}while(0);f=c[k>>2]|0;h=f+238|0;if((e|0)>(b[h>>1]|0))b[h>>1]=e;f=f+236|0;if((e|0)<(b[f>>1]|0))b[f>>1]=e;switch(a[i+159>>0]|0){case 6:case 0:break;default:hP(g);}g=kC(d,g)|0;}if((gg(d)|0)==(d|0)){if((c[47135]|0)==100)e=1;else {Ij(d);break}while(1){f=c[k>>2]|0;if((e|0)>(c[f+180>>2]|0))break a;Hj(c[(c[f+184>>2]|0)+(e<<2)>>2]|0);e=e+1|0;}}}else {b[f+238>>1]=0;b[f+236>>1]=0;}while(0);return}function Fj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=b+16|0;e=0;while(1){d=c[j>>2]|0;if((e|0)>=(c[d+220>>2]|0))break;i=c[(c[d+216>>2]|0)+(e<<2)>>2]|0;c[d+192>>2]=i;d=i;while(1){if(!d)break;i=d+16|0;Gj((c[i>>2]|0)+172|0);Gj((c[i>>2]|0)+180|0);i=c[i>>2]|0;a[i+157>>0]=0;d=c[i+164>>2]|0;}e=e+1|0;}i=jC(b)|0;while(1){if(!i)break;h=XA(b,i)|0;while(1){if(!h)break;f=h+16|0;d=c[f>>2]|0;g=c[d+172>>2]|0;if((g|0)!=0?(k=g+16|0,(h|0)==(c[(c[k>>2]|0)+116>>2]|0)):0){d=jC(b)|0;while(1){if(!d)break;e=XA(b,d)|0;while(1){if(!e)break;if((h|0)!=(e|0)?(l=(c[e+16>>2]|0)+172|0,m=c[l>>2]|0,(m|0)!=0&(g|0)==(m|0)):0)c[l>>2]=0;e=ZA(b,e)|0;}d=kC(b,d)|0;}U1(c[k>>2]|0);U1(g);d=c[f>>2]|0;}c[d+172>>2]=0;h=ZA(b,h)|0;}i=kC(b,i)|0;}U1(c[(c[j>>2]|0)+216>>2]|0);m=c[j>>2]|0;c[m+216>>2]=0;c[m+220>>2]=0;return}function Gj(a){a=a|0;var b=0,d=0;d=a+4|0;b=c[d>>2]|0;while(1){if((b|0)<=-1)break;c[(c[a>>2]|0)+(b<<2)>>2]=0;b=b+-1|0;}c[d>>2]=0;return}function Hj(a){a=a|0;var d=0,f=0,g=0;d=a+16|0;f=c[d>>2]|0;g=c[(c[(c[f+264>>2]|0)+16>>2]|0)+232>>2]|0;a=f+236|0;b[a>>1]=g+(e[a>>1]|0);a=f+238|0;b[a>>1]=g+(e[a>>1]|0);a=1;while(1){if((a|0)>(c[f+180>>2]|0))break;Hj(c[(c[f+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;f=c[d>>2]|0;}return}function Ij(b){b=b|0;var d=0;d=OD(gg(b)|0)|0;while(1){if(!d)break;if((a[(c[d+16>>2]|0)+274>>0]|0)==7)Jj(b,d);d=PD(d)|0;}return}function Jj(a,b){a=a|0;b=b|0;var d=0;d=(c[b+16>>2]|0)+200|0;do if((c[d>>2]|0)==0?(c[d>>2]=a,Kj(a,b),jC(b)|0):0){Lj(a,b);if((c[47135]|0)==100){zj(b,0);Mj(b);break}else {vj(b);break}}while(0);return}function Kj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=b+16|0;g=jC(d)|0;while(1){if(!g)break;i=kC(d,g)|0;j=g+16|0;if(!(a[(c[j>>2]|0)+159>>0]|0))f=1;else {wC(d,g)|0;g=i;continue}while(1){e=c[h>>2]|0;b=c[e+180>>2]|0;if((f|0)>=(b|0))break;if(HC(c[(c[e+184>>2]|0)+(f<<2)>>2]|0,g)|0){k=7;break}f=f+1|0;}if((k|0)==7){k=0;b=c[(c[h>>2]|0)+180>>2]|0;}if((f|0)<(b|0))wC(d,g)|0;c[(c[j>>2]|0)+212>>2]=0;g=i;}e=jC(d)|0;while(1){if(!e)break;b=XA(gg(d)|0,e)|0;while(1){if(!b)break;if(HC(d,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)mB(d,b,1)|0;b=ZA(gg(d)|0,b)|0;}e=kC(d,e)|0;}return}function Lj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+16|0;d=c[e>>2]|0;g=d+180|0;a=c[g>>2]|0;f=a+1|0;c[g>>2]=f;d=c[d+184>>2]|0;if(!d)a=JK((a<<2)+8|0)|0;else a=LK(d,a+2|0,4,f)|0;c[(c[e>>2]|0)+184>>2]=a;c[a+(f<<2)>>2]=b;uK(b);return}function Mj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[b+16>>2]|0;d=g+192|0;h=0;while(1){d=c[d>>2]|0;if(!d)break;f=c[d+16>>2]|0;if(!(c[f+232>>2]|0))e=(a[f+156>>0]|0)==0?d:h;else e=h;d=f+164|0;h=e;}if(!h)qa(87019,87034,238,87041);c[g+264>>2]=h;d=jC(b)|0;while(1){if(!d){d=13;break}e=d+16|0;if(!((d|0)==(h|0)?1:(c[(c[e>>2]|0)+216>>2]|0)<2)){d=11;break}gP(d,h)|0;a[(c[e>>2]|0)+159>>0]=7;d=kC(b,d)|0;}if((d|0)==11)qa(87056,87034,242,87041);else if((d|0)==13)return}function Nj(b){b=b|0;var d=0;if(!(Pj(b)|0)){d=pP(QA(b,87171)|0,17356,17380)|0;a[(c[b+16>>2]|0)+274>>0]=d;b=d;}else b=7;return b|0}function Oj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=jC(d)|0;a:do if(g|0){j=e&255;i=g+16|0;f=g;h=j;while(1){a[(c[f+16>>2]|0)+159>>0]=h;f=kC(d,f)|0;if(!f)break;gP(g,f)|0;h=a[(c[i>>2]|0)+159>>0]|0;}switch(e|0){case 3:case 2:{b=b+16|0;f=c[b>>2]|0;h=c[f+224>>2]|0;if(h){g=gP(h,g)|0;f=c[b>>2]|0;}c[f+224>>2]=g;break}case 5:case 4:{b=b+16|0;f=c[b>>2]|0;h=c[f+228>>2]|0;if(h){g=gP(h,g)|0;f=c[b>>2]|0;}c[f+228>>2]=g;break}default:break a}switch(e|0){case 3:{f=f+224|0;break}case 5:{f=f+228|0;break}default:break a}a[(c[(c[f>>2]|0)+16>>2]|0)+159>>0]=j;}while(0);return}function Pj(a){a=a|0;return (Q2(KB(a)|0,108006,7)|0)==0|0}function Qj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;g=m;if(!(jk(b)|0)){do if(FP(b)|0)if(!d){c[(c[b+16>>2]|0)+204>>2]=0;d=b;break}else {c[(c[b+16>>2]|0)+204>>2]=(c[(c[d+16>>2]|0)+204>>2]|0)+1;kk(b,d);d=b;break}while(0);e=OD(b)|0;while(1){if(!e)break;Qj(e,d);e=PD(e)|0;}a:do if(FP(b)|0){e=jC(b)|0;while(1){if(!e)break a;f=(c[e+16>>2]|0)+212|0;if(!(c[f>>2]|0))c[f>>2]=b;e=kC(b,e)|0;}}while(0);switch(lk(b)|0){case 3:{d=d+16|0;a[(c[d>>2]|0)+241>>0]=1;k=19;break}case 2:{d=d+16|0;k=19;break}case 5:{d=d+16|0;a[(c[d>>2]|0)+242>>0]=1;k=21;break}case 4:{d=d+16|0;k=21;break}case 1:{mk(b)|0;break}case 6:break;default:{e=KB(b)|0;f=QA(b,87171)|0;c[g>>2]=e;c[g+4>>2]=f;gA(0,87354,g)|0;}}if((k|0)==19){k=mk(b)|0;k=nk(k,c[(c[d>>2]|0)+208>>2]|0)|0;c[(c[d>>2]|0)+208>>2]=k;}else if((k|0)==21){k=mk(b)|0;k=nk(k,c[(c[d>>2]|0)+212>>2]|0)|0;c[(c[d>>2]|0)+212>>2]=k;}if((FP(b)|0?(h=b+16|0,i=c[h>>2]|0,j=c[i+208>>2]|0,j|0):0)?(j|0)==(c[i+212>>2]|0):0){j=mk(b)|0;k=c[h>>2]|0;c[k+208>>2]=j;c[k+212>>2]=j;}}l=m;return}function Rj(a,b){a=a|0;b=b|0;var d=0,e=0;c[46747]=0;d=jC(a)|0;while(1){if(!d)break;if((Yj(d)|0)==(d|0)){e=$j(b,KB(d)|0)|0;c[(c[d+16>>2]|0)+148>>2]=e;}d=kC(a,d)|0;}d=jC(a)|0;while(1){if(!d)break;b=d+16|0;if(!(c[(c[b>>2]|0)+148>>2]|0)){e=c[(c[(Yj(d)|0)+16>>2]|0)+148>>2]|0;c[(c[b>>2]|0)+148>>2]=e;}d=kC(a,d)|0;}return}function Sj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=jC(a)|0;while(1){if(!h)break;d=c[(c[h+16>>2]|0)+148>>2]|0;i=XA(a,h)|0;while(1){if(!i)break;do if((ek(i)|0)==0?(j=i+-48|0,k=c[(c[(Yj(c[((c[i>>2]&3|0)==2?i:j)+40>>2]|0)|0)+16>>2]|0)+148>>2]|0,(d|0)!=(k|0)):0){f=c[i>>2]&3;g=i+48|0;e=((f|0)==3?i:g)+40|0;f=c[(c[(c[((f|0)==2?i:j)+40>>2]|0)+16>>2]|0)+212>>2]|0;if(!(fk(i)|0)){if((dk(c[(c[(c[e>>2]|0)+16>>2]|0)+212>>2]|0)|0)==0?(dk(f)|0)==0:0){gk(b,d,k,i);break}hk(b,d,k,i);break}else {f=Yj(c[e>>2]|0)|0;e=c[i>>2]&3;if((f|0)!=(c[(c[(c[(c[(c[((e|0)==3?i:g)+40>>2]|0)+16>>2]|0)+212>>2]|0)+16>>2]|0)+212>>2]|0)?(g=Yj(c[((e|0)==2?i:j)+40>>2]|0)|0,(g|0)!=(c[(c[(c[(c[(c[((c[i>>2]&3|0)==2?i:j)+40>>2]|0)+16>>2]|0)+212>>2]|0)+16>>2]|0)+208>>2]|0)):0)e=k;else {e=d;d=k;}gk(b,d,e,i);break}}while(0);i=ZA(a,i)|0;}h=kC(a,h)|0;}return}function Tj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;if((FP(a)|0)!=0?(dk(a)|0)!=0:0){g=jC(a)|0;while(1){if(!g)break;if(!(_A(a,g)|0)){f=c[(c[(Yj(g)|0)+16>>2]|0)+148>>2]|0;if(!d)d=$j(b,87252)|0;iB(b,d,f,0,1)|0;}if(!(XA(a,g)|0)){f=c[(c[(Yj(g)|0)+16>>2]|0)+148>>2]|0;if(!e)e=$j(b,87257)|0;iB(b,f,e,0,1)|0;}g=kC(a,g)|0;}if((e|0)!=0&(d|0)!=0){ck(iB(b,d,e,0,1)|0,0,1e3);f=d;}else f=d;}else f=d;d=OD(a)|0;while(1){if(!d)break;Tj(d,b,f,e);d=PD(d)|0;}return}function Uj(b){b=b|0;var d=0,e=0;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;a[e+158>>0]=0;a[e+157>>0]=0;d=kC(b,d)|0;}d=jC(b)|0;while(1){if(!d)break;ak(b,d);d=kC(b,d)|0;}return}function Vj(a){a=a|0;var b=0,d=0,e=0,f=0;b=jC(a)|0;while(1){if(!b)break;c[(c[b+16>>2]|0)+128>>2]=0;b=kC(a,b)|0;}b=0;e=jC(a)|0;while(1){if(!e)break;d=b+1|0;if(!(c[(c[e+16>>2]|0)+128>>2]|0)){_j(a,e,d);b=d;}e=kC(a,e)|0;}a:do if((b|0)>1){f=$j(a,87246)|0;d=1;e=jC(a)|0;while(1){if(!e)break a;if((c[(c[e+16>>2]|0)+128>>2]|0)==(d|0)){iB(a,f,e,0,1)|0;d=d+1|0;}e=kC(a,e)|0;}}while(0);return b|0}function Wj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;g=jC(a)|0;while(1){if(!g)break;h=g+16|0;f=XA(a,g)|0;while(1){if(!f)break;b=c[h>>2]|0;d=c[b+180>>2]|0;if(!d)b=KK((c[b+184>>2]<<2)+8|0)|0;else b=MK(d,(c[b+184>>2]<<2)+8|0)|0;d=c[h>>2]|0;c[d+180>>2]=b;d=d+184|0;e=c[d>>2]|0;c[d>>2]=e+1;c[b+(e<<2)>>2]=f;e=c[h>>2]|0;c[(c[e+180>>2]|0)+(c[e+184>>2]<<2)>>2]=0;e=f+-48|0;b=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;if(!d)b=KK((c[b+176>>2]<<2)+8|0)|0;else b=MK(d,(c[b+176>>2]<<2)+8|0)|0;c[(c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0)+172>>2]=b;i=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;b=c[i+172>>2]|0;i=i+176|0;d=c[i>>2]|0;c[i>>2]=d+1;c[b+(d<<2)>>2]=f;e=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;c[(c[e+172>>2]|0)+(c[e+176>>2]<<2)>>2]=0;f=ZA(a,f)|0;}g=kC(a,g)|0;}return}function Xj(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=a+16|0;o=c[n>>2]|0;b[o+236>>1]=32767;b[o+238>>1]=-1;a:do if((f|0)>1){h=JK((f<<2)+4|0)|0;g=f+1|0;f=1;while(1){if((f|0)==(g|0)){m=h;o=h;break a}c[h+(f<<2)>>2]=32767;f=f+1|0;}}else {m=0;o=0;}while(0);i=(m|0)==0;h=jC(a)|0;while(1){if(!h)break;j=c[(c[(c[(Yj(h)|0)+16>>2]|0)+148>>2]|0)+16>>2]|0;k=c[j+232>>2]|0;l=c[h+16>>2]|0;c[l+232>>2]=k;f=c[n>>2]|0;g=f+238|0;if((k|0)>(b[g>>1]|0))b[g>>1]=k;f=f+236|0;if((k|0)<(b[f>>1]|0))b[f>>1]=k;if(!i){j=c[j+128>>2]|0;c[l+128>>2]=j;l=m+(j<<2)|0;j=c[l>>2]|0;c[l>>2]=(j|0)<(k|0)?j:k;}h=kC(a,h)|0;}j=(m|0)!=0;b:do if(!j){m=b[(c[n>>2]|0)+236>>1]|0;g=m<<16>>16;if(m<<16>>16>0){f=jC(a)|0;while(1){if(!f)break;m=(c[f+16>>2]|0)+232|0;c[m>>2]=(c[m>>2]|0)-g;f=kC(a,f)|0;}f=c[n>>2]|0;n=f+236|0;b[n>>1]=(e[n>>1]|0)-g;f=f+238|0;b[f>>1]=(e[f>>1]|0)-g;f=0;}else f=0;}else {f=jC(a)|0;while(1){if(!f){f=1;break b}l=c[f+16>>2]|0;n=l+232|0;c[n>>2]=(c[n>>2]|0)-(c[m+(c[l+128>>2]<<2)>>2]|0);f=kC(a,f)|0;}}while(0);Zj(a,f);i=jC(d)|0;while(1){if(!i)break;g=i+16|0;f=c[g>>2]|0;h=c[f+172>>2]|0;if(h){U1(h);f=c[g>>2]|0;}f=c[f+180>>2]|0;if(f|0)U1(f);i=kC(d,i)|0;}U1(c[(c[(jC(a)|0)+16>>2]|0)+112>>2]|0);f=jC(a)|0;while(1){if(!f)break;c[(c[f+16>>2]|0)+112>>2]=0;f=kC(a,f)|0;}if(j)U1(o);return}function Yj(a){a=a|0;var b=0,d=0,e=0;b=a+16|0;d=(c[b>>2]|0)+152|0;e=c[d>>2]|0;if(e){if((e|0)!=(a|0)){e=Yj(e)|0;c[(c[b>>2]|0)+152>>2]=e;return e|0}}else c[d>>2]=a;return a|0}function Zj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=a+16|0;e=1;while(1){f=c[i>>2]|0;if((e|0)>(c[f+180>>2]|0))break;Zj(c[(c[f+184>>2]|0)+(e<<2)>>2]|0,0);e=e+1|0;}if((d|0)!=0|(c[f+200>>2]|0)!=0){b[f+236>>1]=32767;b[f+238>>1]=-1;e=0;h=jC(a)|0;while(1){if(!h)break;g=c[(c[h+16>>2]|0)+232>>2]|0;d=c[i>>2]|0;f=d+238|0;if((g|0)>(b[f>>1]|0))b[f>>1]=g;d=d+236|0;if((g|0)<(b[d>>1]|0)){b[d>>1]=g;e=h;}h=kC(a,h)|0;}c[(c[i>>2]|0)+264>>2]=e;}return}function _j(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[b+16>>2]|0)+128|0;a:do if(!(c[e>>2]|0)){c[e>>2]=d;e=XA(a,b)|0;while(1){if(!e)break;_j(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,d);e=ZA(a,e)|0;}e=_A(a,b)|0;while(1){if(!e)break a;_j(a,c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0,d);e=$A(a,e)|0;}}while(0);return}function $j(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=tC(a,b,1)|0;b=f+16|0;c[(c[b>>2]|0)+176>>2]=0;e=JK(20)|0;d=c[b>>2]|0;c[d+172>>2]=e;c[d+184>>2]=0;d=JK(20)|0;b=c[b>>2]|0;c[b+180>>2]=d;d=c[46747]|0;e=b+168|0;if(!d){c[e>>2]=0;c[(c[a+16>>2]|0)+192>>2]=f;}else {c[e>>2]=d;c[(c[d+16>>2]|0)+164>>2]=f;}c[46747]=f;c[b+164>>2]=0;return f|0}function ak(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=d+16|0;e=c[h>>2]|0;f=e+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;a[e+158>>0]=1;d=XA(b,d)|0;while(1){if(!d)break;e=ZA(b,d)|0;f=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;g=c[f+16>>2]|0;if(a[g+158>>0]|0){bk(b,d);d=e;continue}if(a[g+157>>0]|0){d=e;continue}ak(b,f);d=e;}a[(c[h>>2]|0)+158>>0]=0;}return}function bk(a,b){a=a|0;b=b|0;var d=0,f=0,g=0;d=c[b>>2]&3;g=b+-48|0;f=b+48|0;d=iB(a,c[((d|0)==2?b:g)+40>>2]|0,c[((d|0)==3?b:f)+40>>2]|0,0,0)|0;if(!d){d=c[b>>2]&3;d=iB(a,c[((d|0)==2?b:g)+40>>2]|0,c[((d|0)==3?b:f)+40>>2]|0,0,1)|0;}g=c[b+16>>2]|0;ck(d,e[g+170>>1]|0,c[g+156>>2]|0);wC(a,b)|0;return}function ck(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0;a=c[a+16>>2]|0;g=a+170|0;h=e[g>>1]|0;b[g>>1]=(h|0)>(d|0)?h:d;d=a+156|0;c[d>>2]=(c[d>>2]|0)+f;return}function dk(a){a=a|0;return (eP(QA(a,87262)|0,0)|0)&255|0}function ek(b){b=b|0;var d=0,e=0;d=c[47189]|0;if((((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0)?(dP(e)|0)<<24>>24==0:0)b=1;else b=0;return b|0}function fk(a){a=a|0;var b=0,d=0;d=c[a>>2]&3;b=c[(c[(c[((d|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;a=c[(c[(c[((d|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;if((b|0)==(a|0))return 1;else {d=ik(b,a)|0;return ((d|0)==(b|0)|(d|0)==(a|0))&1|0}return 0}function gk(a,b,d,f){a=a|0;b=b|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;h=j;g=iB(a,b,d,0,0)|0;if(!g){g=iB(a,d,b,0,0)|0;if(!g){g=iB(a,b,d,0,1)|0;if(!g){b=KB(b)|0;f=KB(d)|0;c[h>>2]=b;c[h+4>>2]=f;gA(1,87279,h)|0;}else i=4;}else i=4;}else i=4;if((i|0)==4){i=c[f+16>>2]|0;ck(g,e[i+170>>1]|0,c[i+156>>2]|0);}l=j;return}function hk(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+112|0;j=m;i=m+4|0;h=_A(a,d)|0;while(1){if(!h){k=6;break}n=XA(a,c[((c[h>>2]&3|0)==3?h:h+48|0)+40>>2]|0)|0;if(n|0?(c[((c[n>>2]&3|0)==2?n:n+-48|0)+40>>2]|0)==(f|0):0)break;h=$A(a,h)|0;}if((k|0)==6){n=c[46748]|0;c[46748]=n+1;c[j>>2]=n;m4(i,87270,j)|0;i=$j(a,i)|0;n=iB(a,i,d,0,1)|0;i=iB(a,i,f,0,1)|0;f=c[g+16>>2]|0;k=f+156|0;n=(c[n+16>>2]|0)+156|0;c[n>>2]=(c[n>>2]|0)+((c[k>>2]|0)*1e3|0);n=c[i+16>>2]|0;j=n+170|0;b[j>>1]=b[(c[((e[j>>1]|0)>(e[f+170>>1]|0)?i:g)+16>>2]|0)+170>>1]|0;n=n+156|0;c[n>>2]=(c[n>>2]|0)+(c[k>>2]|0);}l=m;return}function ik(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;a:while(1){e=a+16|0;while(1){if((a|0)==(b|0))break a;f=c[e>>2]|0;d=c[b+16>>2]|0;if((c[f+204>>2]|0)>=(c[d+204>>2]|0))break;b=c[d+200>>2]|0;}a=c[f+200>>2]|0;}return a|0}function jk(a){a=a|0;return (jC(a)|0)==0|0}function kk(a,b){a=a|0;b=b|0;c[(c[a+16>>2]|0)+200>>2]=b;Lj(b,a);Kj(b,a);return}function lk(b){b=b|0;var c=0;b=QA(b,87171)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0)if(s2(b,87181)|0)if(s2(b,87185)|0)if(s2(b,87192)|0)if(s2(b,87196)|0)if(!(s2(b,87176)|0))b=1;else c=8;else b=5;else b=4;else b=3;else b=2;else c=8;if((c|0)==8)b=6;return b|0}function mk(a){a=a|0;var b=0,c=0;c=jC(a)|0;a:do if(!c)b=0;else {b=Yj(c)|0;while(1){c=kC(a,c)|0;if(!c)break a;nk(b,c)|0;}}while(0);return b|0}function nk(a,b){a=a|0;b=b|0;if(b){a=Yj(a)|0;c[(c[(Yj(b)|0)+16>>2]|0)+152>>2]=a;}return a|0}function ok(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87230,c[d>>2]|0,1)|0;return}function pk(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87397,c[d+4>>2]|0,1)|0;return}function qk(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87382,c[d+8>>2]|0,1)|0;return}function rk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+240|0;m=p+120|0;n=p;c[47193]=GA(b,2,87412,0)|0;k=GA(b,2,87421,0)|0;c[47194]=k;a:do if((k|0)!=0|(c[47193]|0)!=0){k=jC(b)|0;while(1){if(!k)break a;j=0;d=0;i=aB(b,k)|0;while(1){if(!i){f=0;break}e=c[i>>2]|0;g=e&3;f=c[((g|0)==2?i:i+-48|0)+40>>2]|0;h=i+48|0;b:do if((f|0)!=(c[((g|0)==3?i:h)+40>>2]|0)){g=c[47193]|0;do if((f|0)==(k|0)&(g|0)!=0){f=RA(i,g)|0;if(!(a[f>>0]|0)){e=c[i>>2]|0;break}else {e=j;d=sk(m,d,k,i,f)|0;break b}}while(0);f=c[47194]|0;if((f|0?(c[((e&3|0)==3?i:h)+40>>2]|0)==(k|0):0)?(o=RA(i,f)|0,(a[o>>0]|0)!=0):0)e=sk(n,j,k,i,o)|0;else e=j;}else e=j;while(0);j=e;i=bB(b,i,k)|0;}while(1){if((f|0)>=(d|0)){e=0;break}e=m+(f*24|0)+4|0;if((c[m+(f*24|0)+8>>2]|0)>1)tk(k,e);e=c[e>>2]|0;if(e|0)U1(e);f=f+1|0;}while(1){if((e|0)>=(j|0))break;d=n+(e*24|0)+4|0;if((c[n+(e*24|0)+8>>2]|0)>1)tk(k,d);d=c[d>>2]|0;if(d|0)U1(d);e=e+1|0;}k=kC(b,k)|0;}}while(0);l=p;return}function sk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;p=l;l=l+16|0;k=p;m=p+12|0;n=p+8|0;o=0;while(1){if((o|0)>=(d|0)){j=10;break}j=c[b+(o*24|0)>>2]|0;if((a[j>>0]|0)==(a[g>>0]|0)?(s2(j,g)|0)==0:0){j=5;break}o=o+1|0;}do if((j|0)==5){k=b+(o*24|0)+4|0;j=c[k>>2]|0;if(!j){j=b+(o*24|0)+8|0;g=j;j=KK((c[j>>2]<<2)+8|0)|0;}else {q=b+(o*24|0)+8|0;g=q;j=MK(j,(c[q>>2]<<2)+8|0)|0;}c[k>>2]=j;r=c[g>>2]|0;q=r+1|0;c[g>>2]=q;c[j+(r<<2)>>2]=f;c[(c[k>>2]|0)+(q<<2)>>2]=0;j=13;}else if((j|0)==10)if((d|0)>4){r=KB(e)|0;c[k>>2]=5;c[k+4>>2]=r;gA(1,87430,k)|0;break}else {s=b+(o*24|0)+8|0;c[s>>2]=0;k=JK(8)|0;r=b+(o*24|0)+4|0;c[r>>2]=k;q=c[s>>2]|0;j=q+1|0;c[s>>2]=j;c[k+(q<<2)>>2]=f;c[(c[r>>2]|0)+(j<<2)>>2]=0;c[b+(o*24|0)>>2]=g;c[b+(o*24|0)+12>>2]=0;h[b+(o*24|0)+16>>3]=0.0;d=d+1|0;j=13;break}while(0);if((j|0)==13){HH(f,m,n);j=(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)==(e|0)?c[n>>2]|0:c[m>>2]|0;if(j){r=b+(o*24|0)+12|0;s=c[r>>2]|0;c[r>>2]=s+1;if(!s)i=+LH(f,j);else i=0.0;h[b+(o*24|0)+16>>3]=i;}}l=p;return d|0}function tk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0;x=l;l=l+80|0;t=x+68|0;u=x+64|0;r=x;v=d+4|0;n=c[v>>2]|0;w=b+16|0;i=0;p=0.0;q=0.0;while(1){if((i|0)>=(n|0))break;f=c[(c[d>>2]|0)+(i<<2)>>2]|0;g=c[f>>2]&3;e=c[((g|0)==2?f:f+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((g|0)==3?f:f+48|0)+40>>2]|0;g=c[e+16>>2]|0;s=c[w>>2]|0;k=+h[g+16>>3]-+h[s+16>>3];m=+h[g+24>>3]-+h[s+24>>3];o=+L2(k,m);i=i+1|0;p=k/o+p;q=m/o+q;}j=+L2(p,q);s=c[w>>2]|0;k=+h[s+16>>3];m=+h[s+24>>3];y=+h[s+96>>3]+ +h[s+88>>3];o=+h[s+80>>3];s=y>o+ +(c[(c[(xC(b)|0)+16>>2]|0)+252>>2]|0);e=c[w>>2]|0;if(s)o=+h[e+96>>3]+ +h[e+88>>3];else {o=+h[e+80>>3];o=o+ +(c[(c[(xC(b)|0)+16>>2]|0)+252>>2]|0);e=c[w>>2]|0;}y=+h[e+16>>3]+o*(p/j);j=+h[e+24>>3]+o*(q/j);h[r>>3]=k;n=r+8|0;h[n>>3]=m;h[r+16>>3]=(y+k*2.0)*.3333333333333333;h[r+24>>3]=(j+m*2.0)*.3333333333333333;h[r+32>>3]=(y*2.0+k)*.3333333333333333;h[r+40>>3]=(j*2.0+m)*.3333333333333333;h[r+48>>3]=y;h[r+56>>3]=j;aO(b,r);s=c[w>>2]|0;j=+h[r>>3]-+h[s+16>>3];k=+h[n>>3]-+h[s+24>>3];j=+(~~(j+(j>=0.0?.5:-.5))|0);k=+(~~(k+(k>=0.0?.5:-.5))|0);y=+h[s+88>>3];s=~~((y+j)*256.0/(+h[s+96>>3]+y))&255;r=0;while(1){if((r|0)>=(c[v>>2]|0))break;n=c[(c[d>>2]|0)+(r<<2)>>2]|0;HH(n,t,u);while(1){if(!n)break;else g=n;while(1){if(!g){i=n;break}e=c[g>>2]|0;i=g+-48|0;if((c[((e&3|0)==2?g:i)+40>>2]|0)==(b|0)){e=c[g+16>>2]|0;h[e+56>>3]=j;h[e+64>>3]=k;h[e+72>>3]=0.0;c[e+80>>2]=0;a[e+84>>0]=1;a[e+85>>0]=0;a[e+86>>0]=0;a[e+87>>0]=0;a[e+88>>0]=s;a[e+89>>0]=0;c[e+92>>2]=0;e=c[g>>2]|0;}f=g+16|0;if((c[((e&3|0)==3?g:g+48|0)+40>>2]|0)==(b|0)){e=c[f>>2]|0;h[e+16>>3]=j;h[e+24>>3]=k;h[e+32>>3]=0.0;c[e+40>>2]=0;a[e+44>>0]=1;a[e+45>>0]=0;a[e+46>>0]=0;a[e+47>>0]=0;a[e+48>>0]=s;a[e+49>>0]=0;c[e+52>>2]=0;}if((a[(c[f>>2]|0)+112>>0]|0)!=1){g=0;continue}e=c[(c[((c[g>>2]&3|0)==2?g:i)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){g=0;continue}if((c[e+184>>2]|0)!=1){g=0;continue}g=c[c[e+180>>2]>>2]|0;}while(1){if(!i)break;e=c[i>>2]|0;if((c[((e&3|0)==2?i:i+-48|0)+40>>2]|0)==(b|0)){e=c[i+16>>2]|0;h[e+56>>3]=j;h[e+64>>3]=k;h[e+72>>3]=0.0;c[e+80>>2]=0;a[e+84>>0]=1;a[e+85>>0]=0;a[e+86>>0]=0;a[e+87>>0]=0;a[e+88>>0]=s;a[e+89>>0]=0;c[e+92>>2]=0;e=c[i>>2]|0;}f=i+48|0;g=i+16|0;if((c[((e&3|0)==3?i:f)+40>>2]|0)==(b|0)){e=c[g>>2]|0;h[e+16>>3]=j;h[e+24>>3]=k;h[e+32>>3]=0.0;c[e+40>>2]=0;a[e+44>>0]=1;a[e+45>>0]=0;a[e+46>>0]=0;a[e+47>>0]=0;a[e+48>>0]=s;a[e+49>>0]=0;c[e+52>>2]=0;}if((a[(c[g>>2]|0)+112>>0]|0)!=1){i=0;continue}e=c[(c[((c[i>>2]&3|0)==3?i:f)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){i=0;continue}if((c[e+176>>2]|0)!=1){i=0;continue}i=c[c[e+172>>2]>>2]|0;}n=c[(c[n+16>>2]|0)+172>>2]|0;}r=r+1|0;}a[(c[w>>2]|0)+145>>0]=1;l=x;return}function uk(a){a=a|0;var b=0,d=0,e=0;ih(a);b=c[a>>2]&3;d=a+-48|0;e=a+48|0;b=dh(c[((b|0)==2?a:d)+40>>2]|0,c[((b|0)==3?a:e)+40>>2]|0)|0;if(!b){b=c[a>>2]&3;nh(c[((b|0)==2?a:d)+40>>2]|0,c[((b|0)==3?a:e)+40>>2]|0,a)|0;}else vh(a,b);return}function vk(b){b=b|0;var d=0,e=0,f=0,g=0;f=b+16|0;e=0;while(1){b=c[f>>2]|0;if((e|0)>=(c[b+220>>2]|0))break;d=c[(c[b+216>>2]|0)+(e<<2)>>2]|0;c[b+192>>2]=d;b=d;d=b;while(1){if(!d)break;g=c[d+16>>2]|0;a[g+157>>0]=0;d=c[g+164>>2]|0;}while(1){if(!b)break;wk(b);b=c[(c[b+16>>2]|0)+164>>2]|0;}e=e+1|0;}return}function wk(b){b=b|0;var d=0,e=0,f=0,g=0;g=b+16|0;d=c[g>>2]|0;b=d+157|0;if(!(a[b>>0]|0)){a[b>>0]=1;a[d+158>>0]=1;b=0;while(1){f=c[(c[d+180>>2]|0)+(b<<2)>>2]|0;if(!f)break;d=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;e=c[d+16>>2]|0;if(!(a[e+158>>0]|0)){if(!(a[e+157>>0]|0))wk(d);}else {uk(f);b=b+-1|0;}b=b+1|0;d=c[g>>2]|0;}a[d+158>>0]=0;}return}function xk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=jC(a)|0;b=0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;g=c[d>>2]&3;h=c[(c[(c[((g|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;g=c[(c[(c[((g|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;f=h-g|0;d=ZA(a,d)|0;b=((h|0)==(g|0)?0:((f|0)>-1?f:0-f|0)+-1|0)+b|0;}e=kC(a,e)|0;}return b|0}function yk(b){b=b|0;var d=0,e=0,f=0,g=0;e=jC(b)|0;while(1){if(!e)break;g=c[e+16>>2]|0;f=c[g+176>>2]|0;g=g+172|0;d=0;while(1){if((d|0)>=(f|0))break;a[(c[(c[(c[g>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+112>>0]=0;d=d+1|0;}e=kC(b,e)|0;}return}function zk(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;o=q;j=c[b+24>>2]|0;Ak(a);k=(j|0)==-1;m=b+8|0;i=k^1;n=c[15712]|0;f=1797693134862315708145274.0e284;g=0;while(1){if(!(k|(g|0)<(j|0)))break;d=jC(a)|0;while(1){if(!d)break;c[(c[d+16>>2]|0)+232>>2]=0;d=kC(a,d)|0;}wj(a);e=+Bk(a);h[m>>3]=e;if(0);if(!(!(e<=+h[b>>3])&(!(f<=e)|i))){p=9;break}Ck(a);f=e;g=g+1|0;}if((p|0)==9){p=b+20|0;c[b+16>>2]=c[p>>2];c[p>>2]=g;}wj(a);Dk(a);Ek();h[m>>3]=+Bk(a);l=q;return}function Ak(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0;c[46752]=KK((tB(a)|0)*24|0)|0;c[46751]=0;b=jC(a)|0;while(1){if(!b)break;c[(c[b+16>>2]|0)+120>>2]=-1;b=kC(a,b)|0;}i=jC(a)|0;while(1){if(!i)break;j=i+16|0;do if(!(c[(c[j>>2]|0)+216>>2]|0)){f=JK(4)|0;g=c[46752]|0;k=c[46751]|0;c[g+(k*24|0)>>2]=f;c[f>>2]=i;c[g+(k*24|0)+4>>2]=1;j=c[j>>2]|0;h[g+(k*24|0)+8>>3]=+h[j+32>>3];h[g+(k*24|0)+16>>3]=+h[j+40>>3];c[j+120>>2]=k;c[46751]=k+1;}else {g=fP(i)|0;k=g+16|0;b=c[k>>2]|0;d=c[b+120>>2]|0;if((d|0)>-1){g=c[46752]|0;f=c[g+(d*24|0)>>2]|0;e=g+(d*24|0)+4|0;k=c[e>>2]|0;c[e>>2]=k+1;c[f+(k<<2)>>2]=i;k=c[j>>2]|0;j=g+(d*24|0)+8|0;h[j>>3]=+h[j>>3]+ +h[k+32>>3];j=g+(d*24|0)+16|0;l=+h[j>>3];m=+h[k+40>>3];h[j>>3]=l>2]=d;break}d=JK(c[b+216>>2]<<2)|0;e=c[46752]|0;f=c[46751]|0;b=e+(f*24|0)|0;c[b>>2]=d;c[d>>2]=g;if((g|0)==(i|0)){h[e+(f*24|0)+8>>3]=+h[(c[k>>2]|0)+32>>3];d=1;b=i;}else {c[(c[b>>2]|0)+4>>2]=i;n=c[k>>2]|0;b=c[j>>2]|0;h[e+(f*24|0)+8>>3]=+h[b+32>>3]+ +h[n+32>>3];d=2;b=+h[n+40>>3]<+h[b+40>>3]?i:g;}c[e+(f*24|0)+4>>2]=d;h[e+(f*24|0)+16>>3]=+h[(c[b+16>>2]|0)+40>>3];c[(c[k>>2]|0)+120>>2]=f;c[(c[j>>2]|0)+120>>2]=f;c[46751]=f+1;}while(0);i=kC(a,i)|0;}return}function Bk(a){a=a|0;var b=0.0,d=0.0,e=0,f=0,g=0,i=0.0,j=0.0;Dk(a);g=c[46749]|0;e=c[a+16>>2]|0;b=+(O(c[e+252>>2]|0,g+-1|0)|0);f=c[46750]|0;e=e+248|0;a=0;d=0.0;while(1){if((a|0)>=(g|0))break;i=+h[f+(a*40|0)+24>>3]+ +(O(c[e>>2]|0,c[f+(a*40|0)+16>>2]|0)|0);j=+h[f+(a*40|0)+32>>3]+b;a=a+1|0;b=j;d=d=(tB(a)|0))break;c[(c[46753]|0)+(b<<2)>>2]=b;b=b+1|0;}Dk(a);Fk(a);Gk(a);return}function Dk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0;c[46749]=0;b=c[46750]|0;if(b|0){e=0;while(1){if((e|0)>=(c[46751]|0))break;d=c[b+(e*40|0)+4>>2]|0;if(d){U1(d);b=c[46750]|0;}d=c[b+(e*40|0)+8>>2]|0;if(d){U1(d);b=c[46750]|0;}e=e+1|0;}U1(b);}c[46750]=JK((c[46751]|0)*40|0)|0;b=0;while(1){d=c[46751]|0;if((b|0)>=(d|0))break;k=JK(d<<2)|0;c[(c[46750]|0)+(b*40|0)+4>>2]=k;k=JK(c[46751]<<2)|0;l=c[46750]|0;c[l+(b*40|0)+8>>2]=k;c[l+(b*40|0)>>2]=b;c[l+(b*40|0)+12>>2]=0;c[l+(b*40|0)+16>>2]=0;l=l+(b*40|0)+24|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;b=b+1|0;}e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;i=c[d>>2]|0;f=d+-48|0;g=c[46750]|0;b=c[(c[(c[((i&3|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;while(1){b=b+1|0;if((b|0)>=(c[(c[(c[((i&3|0)==2?d:f)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;i=g+(b*40|0)+16|0;c[i>>2]=(c[i>>2]|0)+1;i=c[d>>2]|0;}d=ZA(a,d)|0;}e=kC(a,e)|0;}i=c[46751]|0;k=c[46752]|0;l=c[46750]|0;d=a+16|0;b=0;while(1){if((b|0)>=(i|0))break;e=(c[c[k+(b*24|0)>>2]>>2]|0)+16|0;f=c[(c[e>>2]|0)+232>>2]|0;if((f|0)>=(c[46749]|0))c[46749]=f+1;g=l+(f*40|0)+24|0;j=+h[g>>3];h[g>>3]=j+ +h[k+(b*24|0)+8>>3]*72.0+(j>0.0?+(c[(c[d>>2]|0)+248>>2]|0):0.0);g=l+(f*40|0)+32|0;j=+h[k+(b*24|0)+16>>3]*72.0;if(+h[g>>3]>3]=j;c[(c[l+(f*40|0)+4>>2]|0)+(c[l+(f*40|0)+12>>2]<<2)>>2]=k+(b*24|0);a=l+((c[(c[e>>2]|0)+232>>2]|0)*40|0)+12|0;c[a>>2]=(c[a>>2]|0)+1;b=b+1|0;}return}function Ek(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=c[46749]|0;l=c[46750]|0;j=0;b=0;a=0;while(1){if((j|0)>=(k|0))break;d=l+(j*40|0)|0;i=c[l+(j*40|0)+12>>2]|0;e=(b|0)==0;a:do if(i)if(!e){if((c[d>>2]|0)>(a|0)){f=l+(j*40|0)+4|0;d=0;while(1){if((d|0)>=(i|0))break a;g=c[(c[f>>2]|0)+(d<<2)>>2]|0;h=c[g+4>>2]|0;e=0;while(1){if((e|0)>=(h|0))break;m=(c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0)+232|0;c[m>>2]=(c[m>>2]|0)-b;e=e+1|0;}d=d+1|0;}}}else b=0;else {if(e)a=c[d>>2]|0;b=b+1|0;}while(0);j=j+1|0;}return}function Fk(a){a=a|0;var b=0;b=c[46753]|0;o4(b,tB(a)|0,4,63);return}function Gk(b){b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0;j=c[46749]|0;k=c[46750]|0;g=c[46753]|0;i=0;while(1){if((i|0)>=(j|0)){e=0;d=0.0;break}e=c[g+(i<<2)>>2]|0;f=i+1|0;if((c[k+(e*40|0)+12>>2]|0)<2)i=f;else {l=4;break}}if((l|0)==4)if((j|0)>(f|0))d=+h[k+((c[g+(f<<2)>>2]|0)*40|0)+24>>3];else d=0.0;a:do if((i|0)!=(j|0)){o4(c[k+(e*40|0)+4>>2]|0,c[k+(e*40|0)+12>>2]|0,4,64);g=c[46750]|0;r=+h[g+(e*40|0)+24>>3];r=!(d<=r*.25)&!(d>=r*.75)?d:r*.5;s=c[g+(e*40|0)+12>>2]|0;q=b+16|0;n=0;o=0;d=0.0;f=0;p=0;while(1){if((p|0)>=(f+s|0))break a;do if(!(c[(c[g+(e*40|0)+8>>2]|0)+(p<<2)>>2]|0)){l=c[(c[g+(e*40|0)+4>>2]|0)+(p<<2)>>2]|0;b=l+8|0;m=+h[b>>3]*72.0+d+(d>0.0?+(c[(c[q>>2]|0)+248>>2]|0):0.0);i=(o|0)!=0;if(!(i&!(m<=r))){j=i?n:l;i=i?o:1;d=m;break}j=n+4|0;k=l+4|0;i=0;while(1){if((i|0)<(c[j>>2]|0))g=0;else break;while(1){if((g|0)>=(c[k>>2]|0))break;a[(c[(nh(c[(c[n>>2]|0)+(i<<2)>>2]|0,c[(c[l>>2]|0)+(g<<2)>>2]|0,0)|0)+16>>2]|0)+112>>0]=1;g=g+1|0;}i=i+1|0;}g=c[46750]|0;c[(c[g+(e*40|0)+8>>2]|0)+(p<<2)>>2]=1;j=g+(e*40|0)+12|0;c[j>>2]=(c[j>>2]|0)+-1;j=g+(e*40|0)+16|0;c[j>>2]=(c[j>>2]|0)+1;j=g+(e*40|0)+24|0;h[j>>3]=+h[b>>3]*-72.0-+(c[(c[q>>2]|0)+248>>2]|0)+ +h[j>>3];j=n;i=o;}else {j=n;i=o;f=f+1|0;}while(0);n=j;o=i;p=p+1|0;}}while(0);return}function Hk(a,b){a=a|0;b=b|0;a=Ik(c[a>>2]|0)|0;b=Ik(c[b>>2]|0)|0;return ((b|0)<(a|0)&1)-((b|0)>(a|0)&1)|0}function Ik(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+4|0;d=0;b=0;while(1){if((d|0)>=(c[f>>2]|0))break;e=c[(c[a>>2]|0)+(d<<2)>>2]|0;g=xC(e)|0;e=XA(g,e)|0;while(1){if(!e)break;e=ZA(g,e)|0;b=b+1|0;}d=d+1|0;}return b|0}function Jk(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[46750]|0;e=+h[f+((c[b>>2]|0)*40|0)+24>>3];d=+h[f+((c[a>>2]|0)*40|0)+24>>3];return (e>d&1)-(e>2]|0)+216>>2]=0;b=kC(a,b)|0;}return}function Lk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g+16|0;e=g+8|0;d=g+20|0;c[d>>2]=5;a=QA(a,99605)|0;if(a|0?(c[e>>2]=g,c[e+4>>2]=d,(b5(a,87497,e)|0)>=1):0)gA(0,87504,f)|0;c[b+24>>2]=0;c[b+32>>2]=0;l=g;return 0}function Mk(b){b=b|0;var d=0,e=0;d=c[47189]|0;if((((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0)?(dP(e)|0)<<24>>24==0:0)b=1;else b=0;return b|0}function Nk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;gl(a);b=jC(a)|0;while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;do if(((c[(c[d+16>>2]|0)+172>>2]|0)==0?(Mk(d)|0)==0:0)?(e=d+48|0,f=fP(c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0)|0,g=d+-48|0,h=fP(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)|0,(f|0)!=(h|0)):0){if((c[(c[f+16>>2]|0)+212>>2]|0)==0?(c[(c[h+16>>2]|0)+212>>2]|0)==0:0){i=dh(f,h)|0;if(!i){nh(f,h,d)|0;break}else {vh(d,i);break}}i=c[d>>2]&3;Ok(a,c[((i|0)==3?d:e)+40>>2]|0,c[((i|0)==2?d:g)+40>>2]|0,d);}while(0);d=ZA(a,d)|0;}b=kC(a,b)|0;}return}function Ok(b,d,f,g){b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=c[g>>2]&3;h=c[(c[((j|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0;i=c[h+212>>2]|0;if(!i)k=0;else k=(c[h+232>>2]|0)-(c[(c[(c[(c[i+16>>2]|0)+264>>2]|0)+16>>2]|0)+232>>2]|0)|0;h=c[(c[((j|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0;i=c[h+212>>2]|0;if(!i)h=0;else h=(c[(c[(c[(c[i+16>>2]|0)+264>>2]|0)+16>>2]|0)+232>>2]|0)-(c[h+232>>2]|0)|0;j=g+16|0;k=h+k+(e[(c[j>>2]|0)+170>>1]|0)|0;b=sh(b)|0;a[(c[b+16>>2]|0)+156>>0]=2;i=fP(d)|0;d=fP(f)|0;f=Zi(b,i,(k|0)>0?0.0:+(0-k|0),(c[(c[j>>2]|0)+156>>2]|0)*10|0)|0;c[(c[(Zi(b,d,+(((k|0)>0?k:0)|0),c[(c[j>>2]|0)+156>>2]|0)|0)+16>>2]|0)+116>>2]=g;c[(c[f+16>>2]|0)+116>>2]=g;return}function Pk(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=c[d>>2]&3;i=(j|0)==3?d:d+48|0;j=(j|0)==2?d:d+-48|0;j=c[(c[(c[((c[(c[(c[i+40>>2]|0)+16>>2]|0)+232>>2]|0)>(c[(c[(c[j+40>>2]|0)+16>>2]|0)+232>>2]|0)?i:j)+40>>2]|0)+16>>2]|0)+232>>2]|0;i=d+16|0;d=(c[i>>2]|0)+172|0;if(c[d>>2]|0)qa(87593,87615,148,87624);c[d>>2]=f;h=(g|0)==0;do{d=c[i>>2]|0;if(h)g=c[f+16>>2]|0;else {g=c[f+16>>2]|0;k=g+168|0;b[k>>1]=(e[k>>1]|0)+(e[d+168>>1]|0);}k=g+154|0;b[k>>1]=(e[k>>1]|0)+(e[d+154>>1]|0);g=g+156|0;c[g>>2]=(c[g>>2]|0)+(c[d+156>>2]|0);d=f+-48|0;g=c[((c[f>>2]&3|0)==2?f:d)+40>>2]|0;if((c[(c[g+16>>2]|0)+232>>2]|0)==(j|0))break;Qk(a,g);f=c[c[(c[(c[((c[f>>2]&3|0)==2?f:d)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((f|0)!=0);return}function Qk(a,b){a=a|0;b=b|0;var d=0.0;d=+((c[(c[a+16>>2]|0)+248>>2]|0)/2|0|0);b=c[b+16>>2]|0;a=b+88|0;h[a>>3]=+h[a>>3]+d;b=b+96|0;h[b>>3]=+h[b>>3]+d;return}function Rk(a,b){a=a|0;b=b|0;var d=0,e=0;if(((((a|0)!=0&(b|0)!=0?(e=c[a>>2]&3,d=c[b>>2]&3,(c[((e|0)==3?a:a+48|0)+40>>2]|0)==(c[((d|0)==3?b:b+48|0)+40>>2]|0)):0)?(c[((e|0)==2?a:a+-48|0)+40>>2]|0)==(c[((d|0)==2?b:b+-48|0)+40>>2]|0):0)?(c[(c[a+16>>2]|0)+96>>2]|0)==(c[(c[b+16>>2]|0)+96>>2]|0):0)?(uj(a,b)|0)!=0:0)a=1;else a=0;return a|0}function Sk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b+16|0;d=c[r>>2]|0;c[d+192>>2]=0;c[d+232>>2]=0;gl(b);d=1;while(1){e=c[r>>2]|0;if((d|0)>(c[e+180>>2]|0))break;hl(b,c[(c[e+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}h=jC(b)|0;while(1){if(!h)break;g=XA(b,h)|0;while(1){if(!g)break;d=c[g>>2]|0;e=(c[(c[((d&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+160|0;f=a[e>>0]|0;if(f<<24>>24<3){a[e>>0]=f+1<<24>>24;d=c[g>>2]|0;}d=(c[(c[((d&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+160|0;e=a[d>>0]|0;if(e<<24>>24<3)a[d>>0]=e+1<<24>>24;g=ZA(b,g)|0;}h=kC(b,h)|0;}m=jC(b)|0;while(1){if(!m)break;if((c[(c[m+16>>2]|0)+212>>2]|0)==0?(m|0)==(fP(m)|0):0){oh(b,m);l=(c[r>>2]|0)+232|0;c[l>>2]=(c[l>>2]|0)+1;}d=0;l=XA(b,m)|0;while(1){if(!l)break;k=l+16|0;h=c[k>>2]|0;a:do if(!(c[h+172>>2]|0)){if(Tk(l)|0){if(!(Rk(d,l)|0)){Uk(b,l);d=l;break}e=c[(c[d+16>>2]|0)+172>>2]|0;if(e|0){Pk(b,l,e,0);jh(l);break}k=c[l>>2]&3;if((c[(c[(c[((k|0)==3?l:l+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)!=(c[(c[(c[((k|0)==2?l:l+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;vh(l,d);jh(l);break}if(d){i=c[l>>2]&3;e=l+48|0;f=c[((i|0)==3?l:e)+40>>2]|0;g=c[d>>2]&3;if((f|0)==(c[((g|0)==3?d:d+48|0)+40>>2]|0)?(n=c[((i|0)==2?l:l+-48|0)+40>>2]|0,(n|0)==(c[((g|0)==2?d:d+-48|0)+40>>2]|0)):0){if((c[(c[f+16>>2]|0)+232>>2]|0)==(c[(c[n+16>>2]|0)+232>>2]|0)){vh(l,d);jh(l);break}if(((c[h+96>>2]|0)==0?(o=d+16|0,(c[(c[o>>2]|0)+96>>2]|0)==0):0)?(uj(l,d)|0)!=0:0)if(!(a[194954]|0)){Pk(b,l,c[(c[o>>2]|0)+172>>2]|0,1);jh(l);break}else {a[(c[k>>2]|0)+112>>0]=6;break}else i=e;}else i=e;}else i=l+48|0;h=c[l>>2]&3;e=c[((h|0)==3?l:i)+40>>2]|0;j=l+-48|0;if((e|0)==(c[((h|0)==2?l:j)+40>>2]|0)){jh(l);d=l;break}e=fP(e)|0;f=fP(c[((c[l>>2]&3|0)==2?l:j)+40>>2]|0)|0;h=c[l>>2]&3;if((c[((h|0)==3?l:i)+40>>2]|0)==(e|0)?(c[((h|0)==2?l:j)+40>>2]|0)==(f|0):0){g=c[(c[e+16>>2]|0)+232>>2]|0;h=c[(c[f+16>>2]|0)+232>>2]|0;if((g|0)==(h|0)){th(b,l);d=l;break}if((h|0)>(g|0)){Vk(b,e,f,l);d=l;break}e=iB(b,f,e,0,0)|0;do if(e|0?(p=c[e>>2]&3,q=c[((p|0)==2?e:e+-48|0)+40>>2]|0,(q|0)!=(c[((c[l>>2]&3|0)==2?l:j)+40>>2]|0)):0){f=e+16|0;if(!(c[(c[f>>2]|0)+172>>2]|0))Vk(b,c[((p|0)==3?e:e+48|0)+40>>2]|0,q,e);if((c[(c[k>>2]|0)+96>>2]|0)==0?(c[(c[f>>2]|0)+96>>2]|0)==0:0){if(!(uj(l,e)|0))break;if(!(a[194954]|0)){jh(l);Pk(b,l,c[(c[f>>2]|0)+172>>2]|0,1);break a}else {a[(c[k>>2]|0)+112>>0]=6;a[(c[f>>2]|0)+153>>0]=1;break a}}}while(0);d=c[l>>2]&3;Vk(b,c[((d|0)==2?l:j)+40>>2]|0,c[((d|0)==3?l:i)+40>>2]|0,l);d=l;}}else d=l;while(0);l=ZA(b,l)|0;}m=kC(b,m)|0;}if((gg(b)|0)!=(b|0)){d=c[(c[r>>2]|0)+216>>2]|0;if(!d)d=KK(4)|0;else d=MK(d,4)|0;r=c[r>>2]|0;c[r+216>>2]=d;c[d>>2]=c[r+192>>2];}return}function Tk(b){b=b|0;var d=0;d=c[b>>2]&3;if((a[(c[(c[((d|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+159>>0]|0)==7)b=1;else b=(a[(c[(c[((d|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+159>>0]|0)==7&1;return b|0}function Uk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=Yk(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;g=Yk(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;i=(c[(c[f+16>>2]|0)+232>>2]|0)>(c[(c[g+16>>2]|0)+232>>2]|0);e=i?f:g;f=i?g:f;g=f+16|0;i=e+16|0;a:do if((c[(c[g>>2]|0)+212>>2]|0)!=(c[(c[i>>2]|0)+212>>2]|0)){h=dh(f,e)|0;if(h|0){Pk(b,d,h,1);break}if((c[(c[g>>2]|0)+232>>2]|0)!=(c[(c[i>>2]|0)+232>>2]|0)){Vk(b,f,e,d);e=(c[d+16>>2]|0)+172|0;while(1){e=c[e>>2]|0;if(!e)break a;f=e+-48|0;if((c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(c[(c[i>>2]|0)+232>>2]|0))break a;a[(c[e+16>>2]|0)+112>>0]=5;e=c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+180>>2]|0;}}}while(0);return}function Vk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=e+16|0;f=c[k>>2]|0;if(!(c[f+96>>2]|0))j=-1;else j=((c[(c[d+16>>2]|0)+232>>2]|0)+(c[(c[b+16>>2]|0)+232>>2]|0)|0)/2|0;if(c[f+172>>2]|0)qa(87636,87615,89,87661);i=d+16|0;h=c[(c[b+16>>2]|0)+232>>2]|0;while(1){g=h+1|0;f=c[(c[i>>2]|0)+232>>2]|0;if((h|0)>=(f|0))break;if((g|0)<(f|0)){if((g|0)==(j|0))f=Wk(a,e)|0;else f=Xk(a)|0;c[(c[f+16>>2]|0)+232>>2]=g;}else f=d;Ii(nh(b,f,e)|0);h=g;b=f;}if(!(c[(c[k>>2]|0)+172>>2]|0))qa(87672,87615,103,87661);else return}function Wk(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0.0;i=d+16|0;g=c[(c[i>>2]|0)+96>>2]|0;e=+h[g+24>>3];f=+h[g+32>>3];g=sh(b)|0;d=g+16|0;c[(c[d>>2]|0)+104>>2]=c[(c[i>>2]|0)+96>>2];j=+(c[(c[(yC(g)|0)+16>>2]|0)+248>>2]|0);h[(c[d>>2]|0)+88>>3]=j;if(!(a[(c[i>>2]|0)+114>>0]|0)){b=(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;i=c[d>>2]|0;h[i+80>>3]=b?f:e;h[i+96>>3]=b?e:f;}return g|0}function Xk(a){a=a|0;var b=0;b=sh(a)|0;Qk(a,b);return b|0}function Yk(b){b=b|0;var d=0;d=c[b+16>>2]|0;if((a[d+159>>0]|0)==7)b=c[(c[(c[(c[d+212>>2]|0)+16>>2]|0)+268>>2]|0)+(c[d+232>>2]<<2)>>2]|0;else b=fP(b)|0;return b|0}function Zk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=gg(a)|0;h=jC(a)|0;while(1){if(!h)break;b=aB(j,h)|0;i=0;while(1){if(!b)break;l=bB(j,b,h)|0;if(HC(a,b)|0){k=i;b=l;i=k;continue}k=(c[b>>2]&3|0)==2?b:b+-48|0;m=(Rk(i,k)|0)==0;e=c[k>>2]&3;b=c[((e|0)==3?k:k+48|0)+40>>2]|0;d=c[(c[b+16>>2]|0)+232>>2]|0;e=c[((e|0)==2?k:k+-48|0)+40>>2]|0;f=c[(c[e+16>>2]|0)+232>>2]|0;g=(d|0)==(f|0);if(!m){c[(c[k+16>>2]|0)+172>>2]=g?i:0;b=c[(c[i+16>>2]|0)+172>>2]|0;if(!b){m=i;b=l;i=m;continue}Pk(a,k,b,0);kh(k);m=i;b=l;i=m;continue}if(!g)if((f|0)>(d|0)){_k(b,e,k);b=l;i=k;continue}else {_k(e,b,k);b=l;i=k;continue}b=fh(b,e)|0;if(!b){th(j,k);b=l;i=k;continue}if((k|0)==(b|0)){m=i;b=l;i=m;continue}kh(k);if(c[(c[k+16>>2]|0)+172>>2]|0){m=i;b=l;i=m;continue}vh(k,b);m=i;b=l;i=m;}h=kC(a,h)|0;}return}function _k(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=$k(a)|0;e=$k(b)|0;al(f,e,d,c[(c[d+16>>2]|0)+172>>2]|0,(f|0)==(a|0)&(e|0)==(b|0)?1:5);return}function $k(b){b=b|0;var d=0,e=0,f=0;d=c[b+16>>2]|0;e=c[d+212>>2]|0;if((e|0)!=0?(f=c[e+16>>2]|0,(a[f+272>>0]|0)==0):0)b=c[(c[f+268>>2]|0)+(c[d+232>>2]<<2)>>2]|0;return b|0}function al(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=d+16|0;k=c[(c[n>>2]|0)+232>>2]|0;o=e+16|0;i=c[(c[o>>2]|0)+232>>2]|0;if((i|0)<=(k|0))qa(87697,87725,81,87735);m=c[g>>2]&3;if(!((c[((m|0)==3?g:g+48|0)+40>>2]|0)==(d|0)?(c[((m|0)==2?g:g+-48|0)+40>>2]|0)==(e|0):0))l=5;a:do if((l|0)==5){if((b[(c[g+16>>2]|0)+168>>1]|0)>1){c[(c[f+16>>2]|0)+172>>2]=0;if(((i-k|0)==1?(j=dh(d,e)|0,j|0):0)?uj(f,j)|0:0){vh(f,j);if(a[(c[n>>2]|0)+156>>0]|0)break;if(a[(c[o>>2]|0)+156>>0]|0)break;jh(f);break}m=h&255;h=d;l=c[(c[n>>2]|0)+232>>2]|0;while(1){i=c[(c[o>>2]|0)+232>>2]|0;if((l|0)>=(i|0))break a;if((l|0)<(i+-1|0)){i=gg(d)|0;j=g+-48|0;i=bl(i,c[((c[g>>2]&3|0)==2?g:j)+40>>2]|0)|0;k=g;}else {i=e;j=g+-48|0;k=g;}a[(c[(nh(h,i,f)|0)+16>>2]|0)+112>>0]=m;n=(c[g+16>>2]|0)+168|0;b[n>>1]=(b[n>>1]|0)+-1<<16>>16;h=i;l=l+1|0;g=c[c[(c[(c[((c[k>>2]&3|0)==2?g:j)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}}do if((i-k|0)==1){g=dh(d,e)|0;if(g|0?uj(f,g)|0:0){c[(c[f+16>>2]|0)+172>>2]=g;m=c[g+16>>2]|0;a[m+112>>0]=h;m=m+168|0;b[m>>1]=(b[m>>1]|0)+1<<16>>16;if(a[(c[n>>2]|0)+156>>0]|0)break;if(a[(c[o>>2]|0)+156>>0]|0)break;jh(f);break}c[(c[f+16>>2]|0)+172>>2]=0;g=nh(d,e,f)|0;a[(c[g+16>>2]|0)+112>>0]=h;}while(0);i=c[(c[o>>2]|0)+232>>2]|0;if((i-(c[(c[n>>2]|0)+232>>2]|0)|0)>1){if((c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)==(d|0))l=i;else {n=f+16|0;c[(c[n>>2]|0)+172>>2]=0;l=nh(d,c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0,f)|0;c[(c[n>>2]|0)+172>>2]=l;ih(g);g=l;l=c[(c[o>>2]|0)+232>>2]|0;}while(1){i=c[g>>2]&3;j=c[((i|0)==2?g:g+-48|0)+40>>2]|0;k=c[j+16>>2]|0;if((c[k+232>>2]|0)==(l|0))break;g=c[c[k+180>>2]>>2]|0;}if((j|0)!=(e|0)){a[(c[(nh(c[((i|0)==3?g:g+48|0)+40>>2]|0,e,f)|0)+16>>2]|0)+112>>0]=h;ih(g);}}}while(0);return}function bl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=b+16|0;b=c[d>>2]|0;e=c[b+232>>2]|0;cl(a,e,c[b+236>>2]|0,2);b=sh(a)|0;d=c[d>>2]|0;f=c[b+16>>2]|0;h[f+88>>3]=+h[d+88>>3];h[f+96>>3]=+h[d+96>>3];c[f+232>>2]=c[d+232>>2];d=(c[d+236>>2]|0)+1|0;c[f+236>>2]=d;c[(c[(c[(c[a+16>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(d<<2)>>2]=b;return b|0}function cl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=a+16|0;f=c[(c[h>>2]|0)+196>>2]|0;i=c[f+(b<<6)+4>>2]|0;a:do if((e|0)<1){d=d-e|0;while(1){g=d+1|0;a=c[f+(b<<6)>>2]|0;if((g|0)>=(a|0))break;a=c[i+(g<<2)>>2]|0;f=d+e|0;c[(c[a+16>>2]|0)+236>>2]=f;c[i+(f<<2)>>2]=a;d=g;f=c[(c[h>>2]|0)+196>>2]|0;}g=e+-1|0;d=g+a|0;while(1){if((d|0)>=(a|0))break a;c[i+(d<<2)>>2]=0;f=c[(c[h>>2]|0)+196>>2]|0;d=d+1|0;a=c[f+(b<<6)>>2]|0;}}else {g=e+-1|0;a=c[f+(b<<6)>>2]|0;while(1){a=a+-1|0;if((a|0)<=(d|0))break;j=c[i+(a<<2)>>2]|0;f=g+a|0;c[(c[j+16>>2]|0)+236>>2]=f;c[i+(f<<2)>>2]=j;}f=e+d|0;a=d;while(1){a=a+1|0;if((a|0)>=(f|0))break;c[i+(a<<2)>>2]=0;}a=c[(c[h>>2]|0)+196>>2]|0;f=a;a=c[a+(b<<6)>>2]|0;}while(0);c[f+(b<<6)>>2]=g+a;return}function dl(a){a=a|0;var b=0;Sk(a);b=c[a+16>>2]|0;c[b+220>>2]=1;c[c[b+216>>2]>>2]=c[b+192>>2];Fi(a);ki(a,0);el(a);Zk(a);fl(a);return}function el(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=gg(d)|0;l=d+16|0;f=c[l>>2]|0;j=b[f+236>>1]|0;e=j<<16>>16;m=k+16|0;if(j<<16>>16>0)a[(c[(c[m>>2]|0)+196>>2]|0)+(e+-1<<6)+49>>0]=0;j=e;while(1){if((j|0)>(b[f+238>>1]|0))break;i=c[(c[(c[(c[f+268>>2]|0)+(j<<2)>>2]|0)+16>>2]|0)+236>>2]|0;cl(k,j,i,c[(c[f+196>>2]|0)+(j<<6)>>2]|0);g=0;h=i;while(1){f=c[l>>2]|0;e=c[f+196>>2]|0;if((g|0)>=(c[e+(j<<6)>>2]|0))break;e=c[(c[e+(j<<6)+4>>2]|0)+(g<<2)>>2]|0;c[(c[(c[(c[m>>2]|0)+196>>2]|0)+(j<<6)+4>>2]|0)+(h<<2)>>2]=e;f=c[e+16>>2]|0;c[f+236>>2]=h;if((a[f+156>>0]|0)==1)c[e+24>>2]=yC(k)|0;qh(d,e);oh(k,e);f=(c[m>>2]|0)+232|0;c[f>>2]=(c[f>>2]|0)+1;g=g+1|0;h=h+1|0;}h=c[(c[m>>2]|0)+196>>2]|0;c[e+(j<<6)+4>>2]=(c[h+(j<<6)+4>>2]|0)+(i<<2);a[h+(j<<6)+49>>0]=0;j=j+1|0;}e=c[m>>2]|0;if((j|0)<(b[e+238>>1]|0))a[(c[e+196>>2]|0)+(j<<6)+49>>0]=0;a[f+272>>0]=1;return}function fl(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+16|0;d=c[i>>2]|0;h=b[d+236>>1]|0;while(1){if((h|0)>(b[d+238>>1]|0))break;f=c[(c[d+268>>2]|0)+(h<<2)>>2]|0;g=f+16|0;while(1){d=c[g>>2]|0;e=c[c[d+180>>2]>>2]|0;if(!e)break;ih(e);}while(1){d=c[c[d+172>>2]>>2]|0;if(!d)break;ih(d);d=c[g>>2]|0;}qh(gg(a)|0,f);c[(c[(c[i>>2]|0)+268>>2]|0)+(h<<2)>>2]=0;h=h+1|0;d=c[i>>2]|0;}return}function gl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;f=jC(b)|0;while(1){if(!f)break;e=f+16|0;d=c[e>>2]|0;if((a[d+159>>0]|0)==7){hP(f);d=c[e>>2]|0;}c[d+212>>2]=0;f=kC(b,f)|0;}m=b+16|0;k=1;while(1){d=c[m>>2]|0;if((k|0)>(c[d+180>>2]|0))break;h=c[(c[d+184>>2]|0)+(k<<2)>>2]|0;i=h+16|0;d=jC(h)|0;a:while(1){if(!d)break;j=kC(h,d)|0;e=d+16|0;if(a[(c[e>>2]|0)+159>>0]|0){f=KB(d)|0;g=KB(b)|0;c[n>>2]=f;c[n+4>>2]=g;gA(0,87744,n)|0;wC(h,d)|0;d=j;continue}iP(d,c[(c[i>>2]|0)+264>>2]|0);g=c[e>>2]|0;c[g+212>>2]=h;a[g+159>>0]=7;g=XA(h,d)|0;while(1){if(!g){d=j;continue a}d=c[(c[g+16>>2]|0)+172>>2]|0;b:do if(d|0)do{e=d+-48|0;f=c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break b;c[f+212>>2]=h;d=c[c[(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);g=ZA(h,g)|0;}}k=k+1|0;}l=o;return}function hl(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=e+16|0;g=JK((b[(c[k>>2]|0)+238>>1]<<2)+8|0)|0;f=c[k>>2]|0;c[f+268>>2]=g;g=0;h=b[f+236>>1]|0;while(1){if((h|0)>(b[f+238>>1]|0))break;f=sh(d)|0;c[(c[(c[k>>2]|0)+268>>2]|0)+(h<<2)>>2]=f;j=c[f+16>>2]|0;c[j+232>>2]=h;a[j+159>>0]=7;c[j+212>>2]=e;if(g|0){j=(c[(nh(g,f,0)|0)+16>>2]|0)+154|0;b[j>>1]=(b[j>>1]|0)*1e3;}g=f;h=h+1|0;f=c[k>>2]|0;}j=jC(e)|0;while(1){f=c[k>>2]|0;if(!j)break;h=(c[(c[f+268>>2]|0)+(c[(c[j+16>>2]|0)+232>>2]<<2)>>2]|0)+16|0;f=(c[h>>2]|0)+216|0;c[f>>2]=(c[f>>2]|0)+1;f=XA(e,j)|0;while(1){if(!f)break;i=c[f>>2]|0;d=f+-48|0;g=c[(c[(c[((i&3|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;while(1){if((g|0)>=(c[(c[(c[((i&3|0)==2?f:d)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;i=(c[(c[c[(c[h>>2]|0)+180>>2]>>2]|0)+16>>2]|0)+168|0;b[i>>1]=(b[i>>1]|0)+1<<16>>16;g=g+1|0;i=c[f>>2]|0;}f=ZA(e,f)|0;}j=kC(e,j)|0;}d=b[f+238>>1]|0;i=f+268|0;f=b[f+236>>1]|0;while(1){if((f|0)>(d|0))break;g=(c[(c[(c[i>>2]|0)+(f<<2)>>2]|0)+16>>2]|0)+216|0;h=c[g>>2]|0;if((h|0)>1)c[g>>2]=h+-1;f=f+1|0;}return}function il(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=(c[(c[e+16>>2]|0)+212>>2]|0)+16|0;e=c[k>>2]|0;j=f+1|0;if((j|0)!=(a[e+273>>0]|0)){i=b[e+236>>1]|0;while(1){h=b[e+238>>1]|0;if((i|0)>(h<<16>>16|0))break;zi(d,c[(c[e+268>>2]|0)+(i<<2)>>2]|0);i=i+1|0;e=c[k>>2]|0;}i=b[e+236>>1]|0;while(1){if((i|0)>(h<<16>>16|0))break;Ai(g,c[(c[e+268>>2]|0)+(i<<2)>>2]|0,f);d=c[k>>2]|0;i=i+1|0;h=b[d+238>>1]|0;e=d;}a[e+273>>0]=j;}return}function jl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=jC(b)|0;while(1){if(!h)break;c[(c[h+16>>2]|0)+212>>2]=0;g=XA(b,h)|0;while(1){if(!g)break;d=c[(c[g+16>>2]|0)+172>>2]|0;a:do if(d|0)do{e=d+-48|0;f=c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break a;c[f+212>>2]=0;d=c[c[(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);g=ZA(b,g)|0;}h=kC(b,h)|0;}kl(b);return}function kl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=b+16|0;d=1;while(1){f=c[e>>2]|0;if((d|0)>(c[f+180>>2]|0))break;kl(c[(c[f+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}i=jC(b)|0;while(1){if(!i)break;d=(c[i+16>>2]|0)+212|0;if(!(c[d>>2]|0))c[d>>2]=b;h=XA(b,i)|0;while(1){if(!h)break;d=c[(c[h+16>>2]|0)+172>>2]|0;a:do if(d|0)do{e=c[d>>2]|0;g=d+-48|0;f=c[(c[((e&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break a;f=f+212|0;if(!(c[f>>2]|0)){c[f>>2]=b;e=c[d>>2]|0;}d=c[c[(c[(c[((e&3|0)==2?d:g)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);h=ZA(b,h)|0;}i=kC(b,i)|0;}return}function ll(a){a=a|0;var b=0,c=0,d=0;d=IP(a)|0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;ml(b,d);b=ZA(a,b)|0;}c=kC(a,c)|0;}Rz(d)|0;return}function ml(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+320|0;H=M+296|0;G=M+280|0;x=M+136|0;w=M+120|0;n=M+104|0;i=M+88|0;f=M+80|0;E=M+16|0;z=M;j=M+264|0;k=M+248|0;m=M+232|0;o=M+216|0;A=M+200|0;B=M+184|0;y=M+168|0;D=M+152|0;g=nl(QA(a,87798)|0,b)|0;q=nl(QA(a,87804)|0,b)|0;r=(q|0)!=0;b=(g|0)!=0;do if(b|r?(L=a+16|0,e=c[(c[L>>2]|0)+8>>2]|0,e|0):0){if((c[e+4>>2]|0)>1){K=KB(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)|0;L=KB(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)|0;c[f>>2]=K;c[f+4>>2]=L;gA(0,87810,f)|0;break}I=c[e>>2]|0;e=c[I+4>>2]|0;p=c[a>>2]&3;s=a+-48|0;t=c[((p|0)==2?a:s)+40>>2]|0;u=a+48|0;p=c[((p|0)==3?a:u)+40>>2]|0;J=KK(48)|0;v=I+12|0;c[J+12>>2]=c[v>>2];C=I+8|0;c[J+8>>2]=c[C>>2];do if(b){h=(c[g+16>>2]|0)+16|0;g=(c[t+16>>2]|0)+16|0;c[H>>2]=c[g>>2];c[H+4>>2]=c[g+4>>2];c[H+8>>2]=c[g+8>>2];c[H+12>>2]=c[g+12>>2];if(!(ol(H,h)|0)){o=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;F=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87798)|0;c[i>>2]=o;c[i+4>>2]=F;c[i+8>>2]=K;gA(0,87851,i)|0;K=26;break}b=c[I>>2]|0;c[H>>2]=c[b>>2];c[H+4>>2]=c[b+4>>2];c[H+8>>2]=c[b+8>>2];c[H+12>>2]=c[b+12>>2];if(ol(H,h)|0){F=(c[p+16>>2]|0)+16|0;c[H>>2]=c[F>>2];c[H+4>>2]=c[F+4>>2];c[H+8>>2]=c[F+8>>2];c[H+12>>2]=c[F+12>>2];if(ol(H,h)|0){o=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;F=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87798)|0;c[n>>2]=o;c[n+4>>2]=F;c[n+8>>2]=K;gA(0,87894,n)|0;K=26;break}if(!(c[C>>2]|0))qa(87936,87947,369,87958);o=I+16|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];pl(z,G,H,h);F=(c[I>>2]|0)+48|0;c[F>>2]=c[z>>2];c[F+4>>2]=c[z+4>>2];c[F+8>>2]=c[z+8>>2];c[F+12>>2]=c[z+12>>2];F=(c[I>>2]|0)+16|0;c[G>>2]=c[z>>2];c[G+4>>2]=c[z+4>>2];c[G+8>>2]=c[z+8>>2];c[G+12>>2]=c[z+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];ql(j,G,H);c[F>>2]=c[j>>2];c[F+4>>2]=c[j+4>>2];c[F+8>>2]=c[j+8>>2];c[F+12>>2]=c[j+12>>2];F=c[I>>2]|0;b=F+16|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];ql(k,G,H);c[F>>2]=c[k>>2];c[F+4>>2]=c[k+4>>2];c[F+8>>2]=c[k+8>>2];c[F+12>>2]=c[k+12>>2];F=c[I>>2]|0;b=F+32|0;F=F+16|0;c[G>>2]=c[F>>2];c[G+4>>2]=c[F+4>>2];c[G+8>>2]=c[F+8>>2];c[G+12>>2]=c[F+12>>2];c[H>>2]=c[z>>2];c[H+4>>2]=c[z+4>>2];c[H+8>>2]=c[z+8>>2];c[H+12>>2]=c[z+12>>2];ql(m,G,H);c[b>>2]=c[m>>2];c[b+4>>2]=c[m+4>>2];c[b+8>>2]=c[m+8>>2];c[b+12>>2]=c[m+12>>2];b=c[v>>2]|0;if(!b){F=3;break}F=(UH(a,c[I>>2]|0,0,0,J,b)|0)+3|0;break}g=e+-1|0;b=0;while(1){if((b|0)>=(g|0))break;if(rl((c[I>>2]|0)+(b<<4)|0,h)|0)break;b=b+3|0;}e=c[v>>2]|0;f=(e|0)!=0;if((b|0)==(g|0))if(f){F=J+32|0;m=I+32|0;n=(c[I>>2]|0)+(g<<4)|0;c[G>>2]=c[m>>2];c[G+4>>2]=c[m+4>>2];c[G+8>>2]=c[m+8>>2];c[G+12>>2]=c[m+12>>2];c[H>>2]=c[n>>2];c[H+4>>2]=c[n+4>>2];c[H+8>>2]=c[n+8>>2];c[H+12>>2]=c[n+12>>2];pl(o,G,H,h);c[F>>2]=c[o>>2];c[F+4>>2]=c[o+4>>2];c[F+8>>2]=c[o+8>>2];c[F+12>>2]=c[o+12>>2];F=g;break}else qa(87975,87947,387,87958);else {if(f)b=UH(a,c[I>>2]|0,0,b,J,e)|0;F=b+3|0;break}}else K=26;while(0);if((K|0)==26){b=e+-1|0;if(!(c[v>>2]|0))F=b;else {F=J+32|0;o=I+32|0;c[F>>2]=c[o>>2];c[F+4>>2]=c[o+4>>2];c[F+8>>2]=c[o+8>>2];c[F+12>>2]=c[o+12>>2];F=b;}}do if(r){f=(c[q+16>>2]|0)+16|0;r=(c[p+16>>2]|0)+16|0;c[H>>2]=c[r>>2];c[H+4>>2]=c[r+4>>2];c[H+8>>2]=c[r+8>>2];c[H+12>>2]=c[r+12>>2];if(!(ol(H,f)|0)){G=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;H=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87804)|0;c[w>>2]=G;c[w+4>>2]=H;c[w+8>>2]=K;gA(0,87986,w)|0;K=52;break}b=(c[I>>2]|0)+(F<<4)|0;c[H>>2]=c[b>>2];c[H+4>>2]=c[b+4>>2];c[H+8>>2]=c[b+8>>2];c[H+12>>2]=c[b+12>>2];if(ol(H,f)|0){E=(c[t+16>>2]|0)+16|0;c[H>>2]=c[E>>2];c[H+4>>2]=c[E+4>>2];c[H+8>>2]=c[E+8>>2];c[H+12>>2]=c[E+12>>2];if(ol(H,f)|0){G=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;H=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87804)|0;c[x>>2]=G;c[x+4>>2]=H;c[x+8>>2]=K;gA(0,88029,x)|0;K=52;break}if(!(c[v>>2]|0))qa(87975,87947,429,87958);x=J+32|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];pl(z,G,H,f);d=F+-3|0;E=(c[I>>2]|0)+(d<<4)|0;c[E>>2]=c[z>>2];c[E+4>>2]=c[z+4>>2];c[E+8>>2]=c[z+8>>2];c[E+12>>2]=c[z+12>>2];E=F+-1|0;b=(c[I>>2]|0)+(E<<4)|0;c[G>>2]=c[z>>2];c[G+4>>2]=c[z+4>>2];c[G+8>>2]=c[z+8>>2];c[G+12>>2]=c[z+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];ql(A,G,H);c[b>>2]=c[A>>2];c[b+4>>2]=c[A+4>>2];c[b+8>>2]=c[A+8>>2];c[b+12>>2]=c[A+12>>2];b=c[I>>2]|0;D=b+(F<<4)|0;b=b+(E<<4)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];ql(B,G,H);c[D>>2]=c[B>>2];c[D+4>>2]=c[B+4>>2];c[D+8>>2]=c[B+8>>2];c[D+12>>2]=c[B+12>>2];D=c[I>>2]|0;b=D+(F+-2<<4)|0;E=D+(E<<4)|0;c[G>>2]=c[E>>2];c[G+4>>2]=c[E+4>>2];c[G+8>>2]=c[E+8>>2];c[G+12>>2]=c[E+12>>2];c[H>>2]=c[z>>2];c[H+4>>2]=c[z+4>>2];c[H+8>>2]=c[z+8>>2];c[H+12>>2]=c[z+12>>2];ql(y,G,H);c[b>>2]=c[y>>2];c[b+4>>2]=c[y+4>>2];c[b+8>>2]=c[y+8>>2];c[b+12>>2]=c[y+12>>2];b=c[C>>2]|0;if(!b)break;d=WH(a,c[I>>2]|0,d,d,J,b)|0;break}e=F;while(1){if((e|0)>0)b=0;else break;while(1){if((b|0)==4)break;B=E+(b<<4)|0;A=(c[I>>2]|0)+(e-b<<4)|0;c[B>>2]=c[A>>2];c[B+4>>2]=c[A+4>>2];c[B+8>>2]=c[A+8>>2];c[B+12>>2]=c[A+12>>2];b=b+1|0;}if(rl(E,f)|0){b=0;K=43;break}e=e+-3|0;}a:do if((K|0)==43)while(1){K=0;if((b|0)==4)break a;K=(c[I>>2]|0)+(e-b<<4)|0;B=E+(b<<4)|0;c[K>>2]=c[B>>2];c[K+4>>2]=c[B+4>>2];c[K+8>>2]=c[B+8>>2];c[K+12>>2]=c[B+12>>2];b=b+1|0;K=43;}while(0);if(e|0){d=e+-3|0;b=c[C>>2]|0;if(!b)break;d=WH(a,c[I>>2]|0,d,F+-3|0,J,b)|0;break}if(!(c[C>>2]|0))qa(87936,87947,452,87958);else {d=J+16|0;E=I+16|0;a=c[I>>2]|0;c[G>>2]=c[E>>2];c[G+4>>2]=c[E+4>>2];c[G+8>>2]=c[E+8>>2];c[G+12>>2]=c[E+12>>2];c[H>>2]=c[a>>2];c[H+4>>2]=c[a+4>>2];c[H+8>>2]=c[a+8>>2];c[H+12>>2]=c[a+12>>2];pl(D,G,H,f);c[d>>2]=c[D>>2];c[d+4>>2]=c[D+4>>2];c[d+8>>2]=c[D+8>>2];c[d+12>>2]=c[D+12>>2];d=0;break}}else K=52;while(0);if((K|0)==52)if(!(c[C>>2]|0))d=0;else {d=J+16|0;K=I+16|0;c[d>>2]=c[K>>2];c[d+4>>2]=c[K+4>>2];c[d+8>>2]=c[K+8>>2];c[d+12>>2]=c[K+12>>2];d=0;}b=F-d+1|0;e=J+4|0;c[e>>2]=b;c[J>>2]=KK(b<<4)|0;b=0;while(1){if((b|0)>=(c[e>>2]|0))break;K=(c[J>>2]|0)+(b<<4)|0;a=(c[I>>2]|0)+(d<<4)|0;c[K>>2]=c[a>>2];c[K+4>>2]=c[a+4>>2];c[K+8>>2]=c[a+8>>2];c[K+12>>2]=c[a+12>>2];d=d+1|0;b=b+1|0;}U1(c[I>>2]|0);U1(I);c[c[(c[L>>2]|0)+8>>2]>>2]=J;}while(0);l=M;return}function nl(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((b|0)!=0?(a[b>>0]|0)!=0:0){d=KP(d,b)|0;if(!d){c[e>>2]=b;gA(0,88149,e)|0;d=0;}}else d=0;l=f;return d|0}function ol(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a>>3];if((+h[b>>3]<=d?d<=+h[b+16>>3]:0)?(c=+h[a+8>>3],+h[b+8>>3]<=c):0)a=c<=+h[b+24>>3]&1;else a=0;return a|0}function pl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0;C=l;l=l+464|0;n=C+48|0;B=C+32|0;u=C+16|0;v=C;w=C+364|0;x=C+264|0;z=C+164|0;A=C+64|0;q=+h[b>>3];r=+h[b+8>>3];s=+h[d>>3];t=+h[d+8>>3];c[u>>2]=c[e>>2];c[u+4>>2]=c[e+4>>2];c[u+8>>2]=c[e+8>>2];c[u+12>>2]=c[e+12>>2];e=e+16|0;c[v>>2]=c[e>>2];c[v+4>>2]=c[e+4>>2];c[v+8>>2]=c[e+8>>2];c[v+12>>2]=c[e+12>>2];k=+h[u>>3];if((s=+h[u+8>>3]):0)?f<=+h[v+8>>3]:0){o=f;p=k;}else i=4;do if((i|0)==4){j=+h[v>>3];if(s>j){g=r+ +(~~((j-q)*(r-t)/(q-s))|0);f=+h[u+8>>3];if(g>=f?g<=+h[v+8>>3]:0){o=g;p=j;break}}else f=+h[u+8>>3];if(t=k)|!(m<=j))):0){o=f;p=m;break}f=+h[v+8>>3];if(t>f?(y=q+ +(~~((f-r)*(q-s)/(r-t))|0),!(!(y>=k)|!(y<=j))):0){o=f;p=y;break};c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];w=wl(n,w)|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];x=wl(n,x)|0;c[n>>2]=c[u>>2];c[n+4>>2]=c[u+4>>2];c[n+8>>2]=c[u+8>>2];c[n+12>>2]=c[u+12>>2];z=wl(n,z)|0;c[n>>2]=c[v>>2];c[n+4>>2]=c[v+4>>2];c[n+8>>2]=c[v+8>>2];c[n+12>>2]=c[v+12>>2];A=wl(n,A)|0;c[B>>2]=w;c[B+4>>2]=x;c[B+8>>2]=z;c[B+12>>2]=A;gA(1,88071,B)|0;qa(138394,87947,78,88123);}while(0);h[a>>3]=p;h[a+8>>3]=o;l=C;return}function ql(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function rl(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+80|0;j=m+16|0;k=m;e=0;while(1){if((e|0)==4)break;i=j+(e<<4)|0;g=a+(e<<4)|0;c[i>>2]=c[g>>2];c[i+4>>2]=c[g+4>>2];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];e=e+1|0;}e=b+8|0;i=b+24|0;d=+sl(a,0.0,1.0,+h[b>>3],+h[e>>3],+h[i>>3]);if(d>=0.0&d<2.0)kP(k,j,3,d,a,0);else d=2.0;g=b+16|0;f=+sl(a,0.0,d>1.0?1.0:d,+h[g>>3],+h[e>>3],+h[i>>3]);if(f>=0.0&f1.0?1.0:d,+h[e>>3],+h[b>>3],+h[g>>3]);if(f>=0.0&f1.0?1.0:d,+h[i>>3],+h[b>>3],+h[g>>3]);if(f>=0.0&f>3]-d))<=.005){b=+h[a+56>>3];b=!(b>=e)|!(b<=f)?-1.0:c;break a}break}default:{}}kP(i,a,3,.5,j,k);g=(c+b)*.5;b=+sl(j,b,g,d,e,f);if(!(b>=0.0))b=+sl(k,g,c,d,e,f);}while(0);l=m;return +b}function tl(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;var g=0.0,i=0,j=0,k=0,m=0;m=l;l=l+144|0;j=m+80|0;k=m+16|0;i=m;a:do if(!(b==c)){switch(ul(a,d)|0){case 0:{b=-1.0;break a}case 1:{if(+B(+(+h[a+56>>3]-d))<=.005){b=+h[a+48>>3];b=!(b>=e)|!(b<=f)?-1.0:c;break a}break}default:{}}kP(i,a,3,.5,j,k);g=(c+b)*.5;b=+tl(j,b,g,d,e,f);if(!(b>=0.0))b=+tl(k,g,c,d,e,f);}while(0);l=m;return +b}function ul(a,b){a=a|0;b=+b;var c=0,d=0,e=0,f=0.0,g=0,i=0;f=+h[a+8>>3];e=fb&1;c=1;d=e;e=(e|0)==0&1;while(1){if((c|0)==4)break;f=+h[a+(c<<4)+8>>3];i=fb&1;g=e+((d|0)!=0&(i|0)!=(d|0)&1)|0;c=c+1|0;d=i;e=g;}return e|0}function vl(a,b){a=a|0;b=+b;var c=0,d=0,e=0,f=0.0,g=0,i=0;f=+h[a>>3];e=fb&1;c=1;d=e;e=(e|0)==0&1;while(1){if((c|0)==4)break;f=+h[a+(c<<4)>>3];i=fb&1;g=e+((d|0)!=0&(i|0)!=(d|0)&1)|0;c=c+1|0;d=i;e=g;}return e|0}function wl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=l;l=l+16|0;d=c;e=+h[a+8>>3];h[d>>3]=+h[a>>3];h[d+8>>3]=e;m4(b,88137,d)|0;l=c;return b|0}function xl(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;s=v;u=4;t=T1(40)|0;c[t>>2]=0;r=a+16|0;e=c[r>>2]|0;a:do if(((b[e+238>>1]|0)-(b[e+236>>1]|0)|0)>=2){m=1;d=e;e=c[e+196>>2]|0;b:while(1){n=m+1|0;if(!(c[e+(n<<6)>>2]|0)){q=15;break}else k=0;while(1){h=c[e+(m<<6)>>2]|0;if((k|0)>=(h|0)){m=n;continue b}j=c[(c[e+(m<<6)+4>>2]|0)+(k<<2)>>2]|0;o=0;d=$(20,j|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,u|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;break b}if(d<<24>>24){i=k;d=h;while(1){g=i+1|0;if((g|0)>=(d|0))break;o=0;d=aa(65,j|0,c[(c[e+(m<<6)+4>>2]|0)+(g<<2)>>2]|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,t|0,u|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){d=z;break b}if(!(d<<24>>24))break;d=c[(c[r>>2]|0)+196>>2]|0;i=g;e=d;d=c[d+(m<<6)>>2]|0;}if((g-k|0)>1){o=0;na(6,a|0,m|0,k|0,i|0,1);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;break b}}}e=c[r>>2]|0;k=k+1|0;d=e;e=c[e+196>>2]|0;}}c:do if((q|0)==15){while(1){if((m|0)>0)k=0;else break;while(1){e=c[d+196>>2]|0;h=c[e+(m<<6)>>2]|0;if((k|0)>=(h|0))break;j=c[(c[e+(m<<6)+4>>2]|0)+(k<<2)>>2]|0;o=0;d=$(21,j|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,u|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;break c}if(d<<24>>24){i=k;d=h;while(1){g=i+1|0;if((g|0)>=(d|0))break;o=0;d=aa(66,j|0,c[(c[e+(m<<6)+4>>2]|0)+(g<<2)>>2]|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,t|0,u|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){d=z;break c}if(!(d<<24>>24))break;d=c[(c[r>>2]|0)+196>>2]|0;i=g;e=d;d=c[d+(m<<6)>>2]|0;}if((g-k|0)>1){o=0;na(6,a|0,m|0,k|0,i|0,0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;break c}}}k=k+1|0;d=c[r>>2]|0;}m=m+-1|0;q=15;}t=U6(187016,1,t|0,u|0)|0;u=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1)d=z;else d=0;}while(0);d:while(1){if(d){o=0;ca(20,3,88177,s|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}else break}else f=1;while(1){d=c[r>>2]|0;if((f|0)>(c[d+180>>2]|0))break a;o=0;ia(101,c[(c[d+184>>2]|0)+(f<<2)>>2]|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue d}f=f+1|0;}}}while(0);U1(t|0);l=v;return}function yl(b){b=b|0;b=c[b+16>>2]|0;if(((a[b+156>>0]|0)==1?(c[b+176>>2]|0)==1:0)?(c[b+184>>2]|0)==1:0)b=(c[b+104>>2]|0)==0&1;else b=0;return b|0}function zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;h=i+40|0;g=i;e=c[c[(c[a+16>>2]|0)+172>>2]>>2]|0;a=c[c[(c[b+16>>2]|0)+172>>2]>>2]|0;if(((yl(b)|0)<<24>>24!=0?(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)==(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0):0)?(Fl(e,a)|0)<<24>>24!=0:0){d=(c[a+16>>2]|0)+16|0;f=g;a=(c[e+16>>2]|0)+16|0;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));f=h;a=d;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));a=(hg(g,h)|0)==0&1;}else a=0;l=i;return a|0}function Al(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=a+16|0;q=c[(c[(c[(c[t>>2]|0)+196>>2]|0)+(b<<6)+4>>2]|0)+(d<<2)>>2]|0;p=d+1|0;m=(f|0)==1;n=q+16|0;l=p;while(1){if((l|0)>(e|0)){g=e;s=p;break}o=c[(c[(c[(c[t>>2]|0)+196>>2]|0)+(b<<6)+4>>2]|0)+(l<<2)>>2]|0;k=o+16|0;a:do if(m)while(1){d=c[k>>2]|0;j=c[c[d+180>>2]>>2]|0;if(!j)break a;h=c[(c[n>>2]|0)+180>>2]|0;i=j+-48|0;f=0;while(1){d=c[h+(f<<2)>>2]|0;if(!d){r=8;break}if((c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)==(c[((c[j>>2]&3|0)==2?j:i)+40>>2]|0))break;else f=f+1|0;}if((r|0)==8){r=0;d=nh(q,c[((c[j>>2]&3|0)==2?j:i)+40>>2]|0,j)|0;}while(1){f=c[c[(c[k>>2]|0)+172>>2]>>2]|0;if(!f)break;vh(f,d);ih(f);}ih(j);}else while(1){d=c[k>>2]|0;j=c[c[d+172>>2]>>2]|0;if(!j)break a;h=c[(c[n>>2]|0)+172>>2]|0;i=j+48|0;f=0;while(1){d=c[h+(f<<2)>>2]|0;if(!d){r=17;break}if((c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)==(c[((c[j>>2]&3|0)==3?j:i)+40>>2]|0))break;else f=f+1|0;}if((r|0)==17){r=0;d=nh(c[((c[j>>2]&3|0)==3?j:i)+40>>2]|0,q,j)|0;}while(1){f=c[c[(c[k>>2]|0)+180>>2]>>2]|0;if(!f)break;vh(f,d);ih(f);}ih(j);}while(0);if((c[d+176>>2]|0)!=(0-(c[d+184>>2]|0)|0)){r=23;break}qh(a,o);l=l+1|0;}if((r|0)==23)qa(88313,88357,115,88364);while(1){g=g+1|0;d=c[(c[t>>2]|0)+196>>2]|0;f=d+(b<<6)|0;if((g|0)>=(c[f>>2]|0))break;e=c[d+(b<<6)+4>>2]|0;r=c[e+(g<<2)>>2]|0;c[e+(s<<2)>>2]=r;c[(c[r+16>>2]|0)+236>>2]=s;s=s+1|0;}c[f>>2]=s;c[(c[d+(b<<6)+4>>2]|0)+(s<<2)>>2]=0;return}function Bl(b){b=b|0;b=c[b+16>>2]|0;if(((a[b+156>>0]|0)==1?(c[b+184>>2]|0)==1:0)?(c[b+176>>2]|0)==1:0)b=(c[b+104>>2]|0)==0&1;else b=0;return b|0}function Cl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;h=i+40|0;g=i;e=c[c[(c[a+16>>2]|0)+180>>2]>>2]|0;a=c[c[(c[b+16>>2]|0)+180>>2]>>2]|0;if(((Bl(b)|0)<<24>>24!=0?(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)==(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0):0)?(Fl(e,a)|0)<<24>>24!=0:0){d=(c[a+16>>2]|0)+56|0;f=g;a=(c[e+16>>2]|0)+56|0;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));f=h;a=d;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));a=(hg(g,h)|0)==0&1;}else a=0;l=i;return a|0}function Dl(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+32|0;p=r+16|0;o=r;m=d+16|0;f=c[m>>2]|0;e=b[f+236>>1]|0;while(1){if((e|0)>(b[f+238>>1]|0))break;c[(c[f+268>>2]|0)+(e<<2)>>2]=0;e=e+1|0;f=c[m>>2]|0;}vj(d);j=jC(d)|0;while(1){if(!j)break;El(d,j);i=XA(d,j)|0;while(1){if(!i)break;else f=i;while(1){e=c[(c[f+16>>2]|0)+172>>2]|0;if(!e)break;else f=e;}h=i+-48|0;while(1){e=f+-48|0;g=c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0;if((c[(c[g+16>>2]|0)+232>>2]|0)>=(c[(c[(c[((c[i>>2]&3|0)==2?i:h)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;El(d,g);f=c[c[(c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}i=ZA(d,i)|0;}j=kC(d,j)|0;}e=c[m>>2]|0;i=b[e+236>>1]|0;while(1){if((i|0)>(b[e+238>>1]|0)){k=1;n=e;break}e=c[(c[e+268>>2]|0)+(i<<2)>>2]|0;j=c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(i<<6)+4>>2]|0;f=e+16|0;if((c[j+(c[(c[f>>2]|0)+236>>2]<<2)>>2]|0)!=(e|0)){q=17;break}h=c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(i<<6)+4>>2]|0;e=c[m>>2]|0;f=c[e+196>>2]|0;c[f+(i<<6)+4>>2]=h+(c[(c[(c[(c[e+268>>2]|0)+(i<<2)>>2]|0)+16>>2]|0)+236>>2]<<2);e=-1;h=0;a:while(1){if((h|0)>=(c[f+(i<<6)>>2]|0))break;f=c[(c[f+(i<<6)+4>>2]|0)+(h<<2)>>2]|0;if(!f)break;g=c[f+16>>2]|0;b:do if(!(a[g+156>>0]|0))if(!(HC(d,f)|0))break a;else e=h;else {f=c[c[g+172>>2]>>2]|0;while(1){if(!f)break b;g=c[(c[f+16>>2]|0)+116>>2]|0;if(!g)break;else f=g;}if(HC(d,c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0)|0){j=(HC(d,c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)|0)==0;e=j?e:h;}}while(0);h=h+1|0;f=c[(c[m>>2]|0)+196>>2]|0;}if((e|0)==-1){c[p>>2]=KB(d)|0;c[p+4>>2]=i;gA(0,88277,p)|0;}j=c[m>>2]|0;c[(c[j+196>>2]|0)+(i<<6)>>2]=e+1;i=i+1|0;e=j;}if((q|0)==17){p=KB(e)|0;q=c[(c[f>>2]|0)+236>>2]|0;c[o>>2]=p;c[o+4>>2]=q;c[o+8>>2]=i;gA(1,88219,o)|0;bb(187016,1);}while(1){if((k|0)>(c[n+180>>2]|0))break;Dl(c[(c[n+184>>2]|0)+(k<<2)>>2]|0);k=k+1|0;n=c[m>>2]|0;}l=r;return}function El(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[b+16>>2]|0;a=(c[(c[a+16>>2]|0)+268>>2]|0)+(c[d+232>>2]<<2)|0;e=c[a>>2]|0;if(!((e|0)!=0?(c[(c[e+16>>2]|0)+236>>2]|0)<=(c[d+236>>2]|0):0))c[a>>2]=b;return}function Fl(b,d){b=b|0;d=d|0;var e=0,f=0;while(1){f=c[b+16>>2]|0;if(!(a[f+112>>0]|0))break;b=c[f+116>>2]|0;}while(1){e=c[d+16>>2]|0;if(!(a[e+112>>0]|0))break;d=c[e+116>>2]|0;}if((a[f+153>>0]|0)==0?(a[e+153>>0]|0)==0:0){f=c[d>>2]&3;e=c[b>>2]&3;b=(O((c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0,(c[(c[(c[((f|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((f|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)|0)>0&1;}else b=0;return b|0}function Gl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+544|0;j=k+528|0;Hl(j,k+512|0,k);e=(a[193770]|0)+1<<24>>24;a[193770]=e<<24>>24==0?1:e;e=c[b+16>>2]|0;c[e+220>>2]=0;c[e+232>>2]=0;e=(d|0)>0;d=jC(b)|0;while(1){if(!d)break;if(e?(h=c[d+16>>2]|0,i=c[h+212>>2]|0,(i|0)!=0):0){g=c[(c[(c[i+16>>2]|0)+268>>2]|0)+(c[h+232>>2]<<2)>>2]|0;f=7;}else f=6;if((f|0)==6?(f=0,(d|0)==(fP(d)|0)):0){g=d;f=7;}if((f|0)==7?(0,(a[(c[g+16>>2]|0)+157>>0]|0)!=(a[193770]|0)):0){Il(b);Jl(j,b,g);Kl(b);}d=kC(b,d)|0;}Ll(j);l=k;return}function Hl(a,b,d){a=a|0;b=b|0;d=d|0;c[b>>2]=d;c[b+4>>2]=d+512;c[b+12>>2]=0;c[b+8>>2]=0;c[a>>2]=b;c[a+4>>2]=b;c[a+8>>2]=d;return}function Il(a){a=a|0;c[(c[a+16>>2]|0)+192>>2]=0;c[46793]=0;return}function Jl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+32|0;p=q;Ml(b,e);k=p+8|0;m=p+16|0;n=p+24|0;a:while(1){o=Nl(b)|0;if(!o)break;e=o+16|0;if((a[(c[e>>2]|0)+157>>0]|0)==(a[193770]|0))continue;Ol(d,o);h=c[e>>2]|0;g=h+180|0;j=c[g+4>>2]|0;i=p;c[i>>2]=c[g>>2];c[i+4>>2]=j;i=h+172|0;j=c[i+4>>2]|0;g=k;c[g>>2]=c[i>>2];c[g+4>>2]=j;g=h+188|0;j=c[g+4>>2]|0;i=m;c[i>>2]=c[g>>2];c[i+4>>2]=j;h=h+196|0;i=c[h+4>>2]|0;j=n;c[j>>2]=c[h>>2];c[j+4>>2]=i;j=3;while(1){if((j|0)<=-1)continue a;e=c[p+(j<<3)>>2]|0;b:do if(e|0){i=(c[p+(j<<3)+4>>2]|0)+-1|0;h=e+(i<<2)|0;while(1){if((i|0)<=-1)break b;f=c[h>>2]|0;g=c[f>>2]&3;e=c[((g|0)==2?f:f+-48|0)+40>>2]|0;if((e|0)==(o|0))e=c[((g|0)==3?f:f+48|0)+40>>2]|0;if((a[(c[e+16>>2]|0)+157>>0]|0)!=(a[193770]|0)?(e|0)==(fP(e)|0):0)Ml(b,e);h=h+-4|0;i=i+-1|0;}}while(0);j=j+-1|0;}}l=q;return}function Kl(a){a=a|0;var b=0,d=0,e=0,f=0;d=a+16|0;b=c[d>>2]|0;f=b+220|0;e=c[f>>2]|0;a=e+1|0;c[f>>2]=a;b=c[b+216>>2]|0;if(!b)a=KK(a<<2)|0;else a=MK(b,a<<2)|0;f=c[d>>2]|0;c[f+216>>2]=a;c[a+(e<<2)>>2]=c[f+192>>2];return}function Ll(a){a=a|0;var b=0;a=c[(c[a>>2]|0)+12>>2]|0;while(1){if(!a)break;b=c[a+12>>2]|0;U1(c[a>>2]|0);U1(a);a=b;}return}function Ml(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;h=k+8|0;g=k;j=b+8|0;f=c[j>>2]|0;i=b+4|0;b=c[i>>2]|0;if((f|0)==(c[b+4>>2]|0)){f=c[b+12>>2]|0;if(!f){f=JK(16)|0;if(!f)gA(1,98969,g)|0;c[f+8>>2]=c[i>>2];c[f+12>>2]=0;b=JK(4e6)|0;c[f>>2]=b;if(!b){gA(1,88377,h)|0;b=c[f>>2]|0;}c[f+4>>2]=b+4e6;c[(c[i>>2]|0)+12>>2]=f;}c[i>>2]=f;f=c[f>>2]|0;c[j>>2]=f;}a[(c[e+16>>2]|0)+157>>0]=(d[193770]|0)+1;c[j>>2]=f+4;c[f>>2]=e;l=k;return}function Nl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+8|0;b=c[f>>2]|0;d=a+4|0;e=c[d>>2]|0;if((b|0)==(c[e>>2]|0))if((e|0)==(c[a>>2]|0))b=0;else {b=c[e+8>>2]|0;c[d>>2]=b;b=c[b+4>>2]|0;c[f>>2]=b;g=4;}else g=4;if((g|0)==4){b=b+-4|0;c[f>>2]=b;b=c[b>>2]|0;}return b|0}function Ol(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=c[b+16>>2]|0;g=f+232|0;c[g>>2]=(c[g>>2]|0)+1;g=c[d+16>>2]|0;a[g+157>>0]=a[193770]|0;b=c[46793]|0;e=g+168|0;if(!b){c[e>>2]=0;c[f+192>>2]=d;}else {c[e>>2]=b;c[(c[b+16>>2]|0)+164>>2]=d;}c[46793]=d;c[g+164>>2]=0;return}function Pl(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0;m=b+16|0;d=(c[m>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;g=d+16|0;d=c[g>>2]|0;e=c[d+188>>2]|0;a:do if(!e)f=0;else {f=0;while(1){e=c[e+(f<<2)>>2]|0;if(!e){f=0;break a}Ql(e);d=c[g>>2]|0;f=f+1|0;e=c[d+188>>2]|0;}}while(0);while(1){if((f|0)>=(c[d+208>>2]|0))break;e=c[(c[d+204>>2]|0)+(f<<2)>>2]|0;l=c[e>>2]&3;if((c[(c[(c[((l|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)==(c[(c[(c[((l|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)){Ql(e);d=c[g>>2]|0;}f=f+1|0;}d=d+164|0;}l=c[m>>2]|0;d=c[l+196>>2]|0;if(!((c[d+56>>2]|0)==0?(c[l+180>>2]|0)<=0:0))i=13;b:do if((i|0)==13){i=c[d+4>>2]|0;g=0;c:while(1){d=c[i+(g<<2)>>2]|0;if(!d)break b;e=c[(c[d+16>>2]|0)+196>>2]|0;d=0;while(1){f=c[e+(d<<2)>>2]|0;if(!f)break;l=c[f+16>>2]|0;if(c[l+96>>2]|0?(a[l+113>>0]|0)==0:0)break c;d=d+1|0;}g=g+1|0;}Rl(b);}while(0);Hi(b);e=0;d=(c[m>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;l=d+16|0;d=c[l>>2]|0;f=c[d+188>>2]|0;d:do if(f){k=0;while(1){g=c[f+(k<<2)>>2]|0;if(!g){k=0;break}i=c[g+16>>2]|0;j=c[i+96>>2]|0;do if(j)if(!(a[i+113>>0]|0)){Sl(g);f=c[l>>2]|0;e=1;d=f;f=c[f+188>>2]|0;break}else {h[i+136>>3]=+h[((c[(c[m>>2]|0)+116>>2]&1|0)==0?j+24|0:j+32|0)>>3];break}while(0);k=k+1|0;}while(1){if((k|0)>=(c[d+208>>2]|0))break d;i=c[(c[d+204>>2]|0)+(k<<2)>>2]|0;j=c[i>>2]&3;g=c[((j|0)==3?i:i+48|0)+40>>2]|0;j=c[((j|0)==2?i:i+-48|0)+40>>2]|0;do if(!((g|0)==(j|0)?1:(c[(c[g+16>>2]|0)+232>>2]|0)!=(c[(c[j+16>>2]|0)+232>>2]|0))){f=i;do{j=c[f+16>>2]|0;f=c[j+172>>2]|0;}while((f|0)!=0);f=a[j+113>>0]|0;g=c[i+16>>2]|0;a[g+113>>0]=f;g=c[g+96>>2]|0;if(g)if(!(f<<24>>24)){Sl(i);e=1;d=c[l>>2]|0;break}else {o=+h[((c[(c[m>>2]|0)+116>>2]&1|0)==0?g+24|0:g+32|0)>>3];j=j+136|0;n=+h[j>>3];h[j>>3]=o>n?o:n;break}}while(0);k=k+1|0;}}while(0);d=d+164|0;}if(e|0){Ah(b);Oh(b);}return e|0}function Ql(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[b>>2]&3;i=c[((d|0)==3?b:b+48|0)+40>>2]|0;f=i+16|0;g=c[(c[f>>2]|0)+236>>2]|0;d=c[(c[(c[((d|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;h=(g|0)<(d|0);e=h?d:g;i=c[(c[(gg(i)|0)+16>>2]|0)+196>>2]|0;f=i+(c[(c[f>>2]|0)+232>>2]<<6)+4|0;d=h?g:d;a:while(1){d=d+1|0;if((d|0)>=(e|0))break;g=c[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;switch(a[g+156>>0]|0){case 0:break a;case 1:break;default:continue a}if(c[g+104>>2]|0)break}if((d|0)==(e|0))do{i=c[b+16>>2]|0;a[i+113>>0]=1;b=c[i+172>>2]|0;}while((b|0)!=0);return}function Rl(a){a=a|0;var d=0,e=0,f=0,g=0;g=a+16|0;a=c[g>>2]|0;if(b[a+236>>1]|0)qa(88434,88417,190,88453);d=(b[a+238>>1]|0)+3|0;a=c[a+196>>2]|0;if(!a)a=KK(d<<6)|0;else a=MK(a,d<<6)|0;d=a+64|0;a=c[g>>2]|0;c[a+196>>2]=d;a=b[a+238>>1]|0;while(1){if((a|0)<=-1)break;f=a+-1|0;e=d+(a<<6)|0;a=d+(f<<6)|0;d=e+64|0;do{c[e>>2]=c[a>>2];e=e+4|0;a=a+4|0;}while((e|0)<(d|0));a=f;d=c[(c[g>>2]|0)+196>>2]|0;}c[d+(a<<6)+8>>2]=0;c[d+(a<<6)>>2]=0;e=JK(8)|0;g=c[g>>2]|0;f=c[g+196>>2]|0;c[f+(a<<6)+12>>2]=e;c[f+(a<<6)+4>>2]=e;c[f+(a<<6)+56>>2]=0;h[f+(a<<6)+24>>3]=1.0;h[f+(a<<6)+16>>3]=1.0;h[f+(a<<6)+40>>3]=1.0;h[f+(a<<6)+32>>3]=1.0;g=g+236|0;b[g>>1]=(b[g>>1]|0)+-1<<16>>16;return}function Sl(b){b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0;j=b+16|0;if(c[(c[j>>2]|0)+96>>2]|0){m=b+48|0;k=gg(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)|0;d=c[(c[(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)+16>>2]|0)+232>>2]|0;l=Tl(k,b)|0;n=k+16|0;e=c[n>>2]|0;g=c[e+196>>2]|0;o=d+-1|0;i=c[c[g+(o<<6)+4>>2]>>2]|0;if(!i)f=+h[g+(d<<6)+24>>3]+ +h[(c[(c[c[g+(d<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+ +(c[e+252>>2]|0);else f=+h[(c[i+16>>2]|0)+24>>3]-+h[g+(o<<6)+16>>3];d=Ul(k,o,l)|0;k=c[(c[j>>2]|0)+96>>2]|0;q=+h[k+24>>3];p=+h[k+32>>3];j=(c[(c[n>>2]|0)+116>>2]&1|0)==0;r=j?p:q;g=d+16|0;e=c[g>>2]|0;h[e+80>>3]=r;l=~~(r*.5);p=(j?q:p)*.5;h[e+96>>3]=p;h[e+88>>3]=p;c[e+104>>2]=k;h[e+24>>3]=+(l+~~f|0);e=nh(d,c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0,b)|0;e=c[e+16>>2]|0;h[e+16>>3]=-+h[(c[g>>2]|0)+88>>3];h[e+56>>3]=+h[(c[(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)+16>>2]|0)+96>>3];a[e+112>>0]=4;e=b+-48|0;d=nh(d,c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0,b)|0;g=c[g>>2]|0;d=c[d+16>>2]|0;h[d+16>>3]=+h[g+96>>3];h[d+56>>3]=+h[(c[(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)+16>>2]|0)+88>>3];a[d+112>>0]=4;d=c[(c[n>>2]|0)+196>>2]|0;e=d+(o<<6)+16|0;f=+(l|0);if(+h[e>>3]>3]=f;d=d+(o<<6)+24|0;if(+h[d>>3]>3]=f;c[g+112>>2]=b;}return} - function QI(d,f,g){d=d|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+160|0;y=A+24|0;w=A+20|0;v=A+16|0;o=A;p=A+32|0;x=c[d+152>>2]|0;c[y>>2]=0;c[w>>2]=0;c[v>>2]=0;z=aI(d)|0;c[z+4>>2]=3;c[z+8>>2]=f;c[z+12>>2]=9;t=f+16|0;n=c[(c[t>>2]|0)+96>>2]|0;if((n|0?(a[n+82>>0]|0)==0:0)?(eP(QA(f,100105)|0,0)|0)<<24>>24:0){n=z+260|0;b[n>>1]=b[n>>1]|512;}if(g|0?c[(c[t>>2]|0)+8>>2]|0:0)lS(d,g);g=c[47206]|0;if((g|0?(i=RA(f,g)|0,i|0):0)?a[i>>0]|0:0)uS(d,+_O(f,c[47206]|0,1.0,0.0));do if(x&16777216|0){g=f+48|0;if((e[(c[(xC(c[((c[f>>2]&3|0)==3?f:g)+40>>2]|0)|0)+16>>2]|0)+178>>1]|0)>2){m=+h[(c[(c[(c[((c[f>>2]&3|0)==3?f:g)+40>>2]|0)+16>>2]|0)+132>>2]|0)+16>>3]*72.0;h[z+176>>3]=+(~~(m+(m>=0.0?.5:-.5))|0);m=+h[(c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0)+16>>3]*72.0;h[z+184>>3]=+(~~(m+(m>=0.0?.5:-.5))|0);break}else {n=z+176|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;break}}while(0);if(x&32768|0){n=c[t>>2]|0;g=c[n+96>>2]|0;if(!g)g=c[z+192>>2]|0;else {g=c[g>>2]|0;c[z+192>>2]=g;}i=z+196|0;c[i>>2]=g;k=z+204|0;c[k>>2]=g;j=z+200|0;c[j>>2]=g;g=c[n+108>>2]|0;if(g|0)c[i>>2]=c[g>>2];g=c[n+104>>2]|0;if(g|0)c[j>>2]=c[g>>2];g=c[n+100>>2]|0;if(g|0)c[k>>2]=c[g>>2];}if(!(x&65536))j=0;else {kA(o,128,p);c[z+212>>2]=EK(dI(d,f,o)|0,f)|0;oA(o);g=QA(f,141055)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=31;else {g=QA(f,111477)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=31;else i=0;}if((q|0)==31)i=EK(g,f)|0;g=QA(f,100118)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=36;else q=34;do if((q|0)==34){g=QA(f,100127)|0;if(g|0?a[g>>0]|0:0){q=36;break}if(i|0){g=D4(i)|0;q=39;}}while(0);if((q|0)==36){g=EK(g,f)|0;q=39;}if((q|0)==39)c[z+208>>2]=g;g=QA(f,100135)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=44;else q=42;do if((q|0)==42){g=QA(f,100145)|0;if(g|0?a[g>>0]|0:0){q=44;break}if(i|0){g=D4(i)|0;q=47;}}while(0);if((q|0)==44){g=EK(g,f)|0;q=47;}if((q|0)==47)c[z+216>>2]=g;g=QA(f,100154)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=52;else q=50;do if((q|0)==50){g=QA(f,100163)|0;if(g|0?a[g>>0]|0:0){q=52;break}if(i|0)c[z+220>>2]=D4(i)|0;}while(0);if((q|0)==52){c[z+220>>2]=EK(g,f)|0;q=z+260|0;b[q>>1]=b[q>>1]|128;}g=QA(f,100171)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=59;else q=57;do if((q|0)==57){g=QA(f,100180)|0;if(g|0?a[g>>0]|0:0){q=59;break}if(i|0)c[z+224>>2]=D4(i)|0;}while(0);if((q|0)==59){c[z+224>>2]=EK(g,f)|0;q=z+260|0;b[q>>1]=b[q>>1]|256;}j=i;}do if(x&8388608){g=QA(f,141088)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)i=EK(g,f)|0;else i=0;g=QA(f,100188)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){q=z+260|0;b[q>>1]=b[q>>1]|64;g=EK(g,f)|0;q=72;}else q=70;if((q|0)==70?i|0:0){g=D4(i)|0;q=72;}if((q|0)==72)c[z+244>>2]=g;g=QA(f,100199)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){g=EK(g,f)|0;q=78;}else q=76;if((q|0)==76?i|0:0){g=D4(i)|0;q=78;}if((q|0)==78)c[z+248>>2]=g;g=QA(f,100211)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){c[z+252>>2]=EK(g,f)|0;p=z+260|0;b[p>>1]=b[p>>1]|16;}else q=82;if((q|0)==82?i|0:0)c[z+252>>2]=D4(i)|0;g=QA(f,100222)|0;if(g|0?a[g>>0]|0:0){q=z+260|0;b[q>>1]=b[q>>1]|32;c[z+256>>2]=EK(g,f)|0;break}if(i)c[z+256>>2]=D4(i)|0;else i=0;}else i=0;while(0);do if(x&4194304|0){g=QA(f,141101)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=94;else q=92;do if((q|0)==92){g=QA(f,100233)|0;if(g|0?a[g>>0]|0:0){q=94;break}g=c[z+192>>2]|0;if(g|0)c[z+228>>2]=D4(g)|0;}while(0);if((q|0)==94){p=jJ(g,f)|0;c[z+228>>2]=EK(p,f)|0;U1(p);p=z+260|0;b[p>>1]=b[p>>1]|1;}g=QA(f,100245)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){p=jJ(g,f)|0;c[z+232>>2]=EK(p,f)|0;U1(p);p=z+260|0;b[p>>1]=b[p>>1]|8;}else q=100;if((q|0)==100?(r=c[z+192>>2]|0,r|0):0)c[z+232>>2]=D4(r)|0;g=QA(f,100258)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){r=jJ(g,f)|0;c[z+236>>2]=EK(r,f)|0;U1(r);r=z+260|0;b[r>>1]=b[r>>1]|2;}else q=105;if((q|0)==105?(s=c[z+200>>2]|0,s|0):0)c[z+236>>2]=D4(s)|0;g=QA(f,100270)|0;if(g|0?a[g>>0]|0:0){s=jJ(g,f)|0;c[z+240>>2]=EK(s,f)|0;U1(s);s=z+260|0;b[s>>1]=b[s>>1]|4;break}g=c[z+204>>2]|0;if(g|0)c[z+240>>2]=D4(g)|0;}while(0);U1(j);U1(i);do if(x&4259840|0?(u=c[(c[t>>2]|0)+8>>2]|0,u|0):0){if(!(c[z+208>>2]|0)){if((x&524288|0)==0|(c[z+228>>2]|0)==0)break}else if(!(x&524288))break;m=+h[(c[d+16>>2]|0)+152>>3]*.5;m=m>2.0?m:2.0;i=c[u+4>>2]|0;g=0;while(1){if((g|0)>=(i|0))break;kJ(y,w,v,(c[u>>2]|0)+(g*48|0)|0,m);g=g+1|0;}j=c[v>>2]|0;c[z+276>>2]=j;k=c[w>>2]|0;c[z+280>>2]=k;if(!(x&8192)){g=0;i=0;while(1){if((i|0)>=(j|0))break;g=(c[k+(i<<2)>>2]|0)+g|0;i=i+1|0;}y=c[y>>2]|0;NR(d,y,y,g)|0;g=y;}else g=c[y>>2]|0;c[z+284>>2]=g;c[z+264>>2]=2;c[z+272>>2]=g;c[z+268>>2]=c[k>>2];}while(0);aS(d,f);g=c[z+208>>2]|0;if(!((g|0)==0?!(b[z+260>>1]&1):0))cS(d,g,c[z+228>>2]|0,c[z+244>>2]|0,c[z+212>>2]|0);l=A;return}function RI(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0,S=0;P=l;l=l+240|0;L=P+224|0;K=P+208|0;x=P+128|0;w=P+112|0;O=P+64|0;C=P+48|0;D=P+32|0;E=P+16|0;F=P;G=P+192|0;H=P+176|0;y=P+160|0;B=P+144|0;c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;M=+h[(c[b+16>>2]|0)+152>>3];HT(QA(e,100032)|0);J=e+16|0;a:do if(c[(c[J>>2]|0)+8>>2]|0){N=+_O(e,c[47188]|0,1.0,0.0);k=aP(e,c[47176]|0,195059)|0;v=(f|0)!=0;b:do if(v){g=f;while(1){i=g;g=g+4|0;i=c[i>>2]|0;if(!i){o=0;break b}if((a[i>>0]|0)!=116)continue;if(!(s2(i,111117)|0)){o=1;break}}}else o=0;while(0);j=k;q=0;i=0;c:while(1){switch(a[j>>0]|0){case 0:break c;case 58:{g=q+1|0;break}case 59:{g=q;i=i+1|0;break}default:g=q;}j=j+1|0;q=g;}n=(q|0)!=0;if((i|0)!=0&n)if(!(ZI(b,e,f,k,q+1|0,N,M)|0))break;else m=137314;else m=k;g=d[(c[J>>2]|0)+115>>0]|0;if(!(g&1))if(!(g&2))if(!(g&8))if(!(g&4)){i=m;j=bP(e,c[47177]|0,m)|0;}else {j=106296;g=106288;k=188712;i=188712;p=18;}else {j=106280;g=106272;k=188712;i=188712;p=18;}else {j=106264;g=106256;k=188712;i=188712;p=18;}else {j=106248;g=106240;k=188712;i=188712;p=18;}if((p|0)==18){i=c[i>>2]|0;i=bP(e,i,_I(m,g)|0)|0;g=bP(e,c[k>>2]|0,j)|0;if((i|0)==(m|0)){i=m;j=g;}else {hS(b,i);j=g;}}if((j|0)!=(m|0))jS(b,j);if(o<<24>>24){i=(a[i>>0]|0)==0?137314:i;g=(a[j>>0]|0)==0?137314:j;hS(b,137379);jS(b,i);u=O;r=c[c[(c[J>>2]|0)+8>>2]>>2]|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));J=zO(O,$I(e)|0,M,0,0)|0;nS(b,c[J+8>>2]|0,c[J>>2]|0,1);aJ(J);hS(b,i);if((g|0)!=(i|0))jS(b,g);g=c[O+8>>2]|0;if(g|0){I=O+16|0;J=c[O>>2]|0;c[K>>2]=c[I>>2];c[K+4>>2]=c[I+4>>2];c[K+8>>2]=c[I+8>>2];c[K+12>>2]=c[I+12>>2];c[L>>2]=c[J>>2];c[L+4>>2]=c[J+4>>2];c[L+8>>2]=c[J+8>>2];c[L+12>>2]=c[J+12>>2];ZH(b,2,K,L,N,M,g);}g=c[O+12>>2]|0;if(!g)break;J=O+32|0;O=(c[O>>2]|0)+((c[O+4>>2]|0)+-1<<4)|0;c[K>>2]=c[J>>2];c[K+4>>2]=c[J+4>>2];c[K+8>>2]=c[J+8>>2];c[K+12>>2]=c[J+12>>2];c[L>>2]=c[O>>2];c[L+4>>2]=c[O+4>>2];c[L+8>>2]=c[O+8>>2];c[L+12>>2]=c[O+12>>2];ZH(b,3,K,L,N,M,g);break}g=c[J>>2]|0;if(!n){do if(!(a[g+115>>0]&3)){if(a[i>>0]|0){hS(b,i);jS(b,j);break}hS(b,137314);if(!(a[j>>0]|0)){jS(b,137314);break}else {jS(b,j);break}}while(0);k=b+152|0;m=O+4|0;n=O+8|0;o=O+12|0;p=O+32|0;q=O+16|0;j=0;while(1){g=c[(c[J>>2]|0)+8>>2]|0;if((j|0)>=(c[g+4>>2]|0))break a;u=O;r=(c[g>>2]|0)+(j*48|0)|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));g=c[O>>2]|0;i=c[m>>2]|0;do if(!(c[k>>2]&16384)){pS(b,g,i,0,0,0);g=c[n>>2]|0;if(g|0){I=c[O>>2]|0;c[K>>2]=c[q>>2];c[K+4>>2]=c[q+4>>2];c[K+8>>2]=c[q+8>>2];c[K+12>>2]=c[q+12>>2];c[L>>2]=c[I>>2];c[L+4>>2]=c[I+4>>2];c[L+8>>2]=c[I+8>>2];c[L+12>>2]=c[I+12>>2];ZH(b,2,K,L,N,M,g);}g=c[o>>2]|0;if(g|0){I=(c[O>>2]|0)+((c[m>>2]|0)+-1<<4)|0;c[K>>2]=c[p>>2];c[K+4>>2]=c[p+4>>2];c[K+8>>2]=c[p+8>>2];c[K+12>>2]=c[p+12>>2];c[L>>2]=c[I>>2];c[L+4>>2]=c[I+4>>2];c[L+8>>2]=c[I+8>>2];c[L+12>>2]=c[I+12>>2];ZH(b,3,K,L,N,M,g);}if((c[(c[(c[J>>2]|0)+8>>2]|0)+4>>2]|0)>1){if(!(c[n>>2]|0)){if(!(v&(c[o>>2]|0)!=0))break}else if(!v)break;lS(b,f);}}else pS(b,g,i,c[n>>2]|0,c[o>>2]|0,0);while(0);j=j+1|0;}}I=c[(c[g+8>>2]|0)+4>>2]|0;A=I*48|0;z=T1(A)|0;A=T1(A)|0;t=+(q+2|0)*.5;v=O+4|0;p=C+8|0;q=D+8|0;e=E+8|0;f=F+8|0;o=0;while(1){if((o|0)>=(I|0))break;u=O;r=(c[c[(c[J>>2]|0)+8>>2]>>2]|0)+(o*48|0)|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));g=c[v>>2]|0;c[z+(o*48|0)+4>>2]=g;c[A+(o*48|0)+4>>2]=g;n=g<<4;m=T1(n)|0;c[z+(o*48|0)>>2]=m;n=T1(n)|0;c[A+(o*48|0)>>2]=n;k=c[O>>2]|0;c[F>>2]=c[k>>2];c[F+4>>2]=c[k+4>>2];c[F+8>>2]=c[k+8>>2];c[F+12>>2]=c[k+12>>2];k=0;while(1){if((k|0)>=(g+-1|0))break;c[C>>2]=c[F>>2];c[C+4>>2]=c[F+4>>2];c[C+8>>2]=c[F+8>>2];c[C+12>>2]=c[F+12>>2];g=k+1|0;j=(c[O>>2]|0)+(g<<4)|0;c[D>>2]=c[j>>2];c[D+4>>2]=c[j+4>>2];c[D+8>>2]=c[j+8>>2];c[D+12>>2]=c[j+12>>2];j=m+(k<<4)|0;if(!k){c[K>>2]=c[C>>2];c[K+4>>2]=c[C+4>>2];c[K+8>>2]=c[C+8>>2];c[K+12>>2]=c[C+12>>2];c[L>>2]=c[D>>2];c[L+4>>2]=c[D+4>>2];c[L+8>>2]=c[D+8>>2];c[L+12>>2]=c[D+12>>2];bJ(G,K,L);c[j>>2]=c[G>>2];c[j+4>>2]=c[G+4>>2];c[j+8>>2]=c[G+8>>2];c[j+12>>2]=c[G+12>>2];}else {c[K>>2]=c[E>>2];c[K+4>>2]=c[E+4>>2];c[K+8>>2]=c[E+8>>2];c[K+12>>2]=c[E+12>>2];c[L>>2]=c[D>>2];c[L+4>>2]=c[D+4>>2];c[L+8>>2]=c[D+8>>2];c[L+12>>2]=c[D+12>>2];bJ(H,K,L);c[j>>2]=c[H>>2];c[j+4>>2]=c[H+4>>2];c[j+8>>2]=c[H+8>>2];c[j+12>>2]=c[H+12>>2];}R=c[O>>2]|0;s=k+2|0;S=R+(s<<4)|0;c[E>>2]=c[S>>2];c[E+4>>2]=c[S+4>>2];c[E+8>>2]=c[S+8>>2];c[E+12>>2]=c[S+12>>2];u=k+3|0;R=R+(u<<4)|0;c[F>>2]=c[R>>2];c[F+4>>2]=c[R+4>>2];c[F+8>>2]=c[R+8>>2];c[F+12>>2]=c[R+12>>2];Q=m+(g<<4)|0;r=m+(s<<4)|0;c[w>>2]=c[C>>2];c[w+4>>2]=c[C+4>>2];c[w+8>>2]=c[C+8>>2];c[w+12>>2]=c[C+12>>2];c[x>>2]=c[D>>2];c[x+4>>2]=c[D+4>>2];c[x+8>>2]=c[D+8>>2];c[x+12>>2]=c[D+12>>2];c[K>>2]=c[S>>2];c[K+4>>2]=c[S+4>>2];c[K+8>>2]=c[S+8>>2];c[K+12>>2]=c[S+12>>2];c[L>>2]=c[R>>2];c[L+4>>2]=c[R+4>>2];c[L+8>>2]=c[R+8>>2];c[L+12>>2]=c[R+12>>2];cJ(y,w,x,K,L);c[r>>2]=c[y>>2];c[r+4>>2]=c[y+4>>2];c[r+8>>2]=c[y+8>>2];c[r+12>>2]=c[y+12>>2];c[Q>>2]=c[y>>2];c[Q+4>>2]=c[y+4>>2];c[Q+8>>2]=c[y+8>>2];c[Q+12>>2]=c[y+12>>2];h[n+(k<<4)>>3]=+h[C>>3]-+h[j>>3]*t;h[n+(k<<4)+8>>3]=+h[p>>3]-+h[m+(k<<4)+8>>3]*t;h[n+(g<<4)>>3]=+h[D>>3]-+h[Q>>3]*t;h[n+(g<<4)+8>>3]=+h[q>>3]-+h[m+(g<<4)+8>>3]*t;h[n+(s<<4)>>3]=+h[E>>3]-+h[r>>3]*t;h[n+(s<<4)+8>>3]=+h[e>>3]-+h[m+(s<<4)+8>>3]*t;k=u;g=c[v>>2]|0;}S=m+(k<<4)|0;c[K>>2]=c[E>>2];c[K+4>>2]=c[E+4>>2];c[K+8>>2]=c[E+8>>2];c[K+12>>2]=c[E+12>>2];c[L>>2]=c[F>>2];c[L+4>>2]=c[F+4>>2];c[L+8>>2]=c[F+8>>2];c[L+12>>2]=c[F+12>>2];bJ(B,K,L);c[S>>2]=c[B>>2];c[S+4>>2]=c[B+4>>2];c[S+8>>2]=c[B+8>>2];c[S+12>>2]=c[B+12>>2];h[n+(k<<4)>>3]=+h[F>>3]-+h[S>>3]*t;h[n+(k<<4)+8>>3]=+h[f>>3]-+h[m+(k<<4)+8>>3]*t;o=o+1|0;}s=D4(i)|0;f=0;r=i;g=i;j=i;i=s;while(1){i=A4(i,107984)|0;if(!i)break;e=(a[i>>0]|0)==0?137314:i;if((e|0)!=(j|0))if(!(a[(c[J>>2]|0)+115>>0]&3)){hS(b,e);jS(b,e);j=e;}else j=e;m=(f|0)==0;n=f>>>0<2;i=0;while(1){if((i|0)>=(I|0))break;o=c[A+(i*48|0)>>2]|0;p=c[z+(i*48|0)>>2]|0;q=c[A+(i*48|0)+4>>2]|0;k=0;while(1){if((k|0)>=(q|0))break;S=o+(k<<4)|0;h[S>>3]=+h[S>>3]+ +h[p+(k<<4)>>3];S=o+(k<<4)+8|0;h[S>>3]=+h[S>>3]+ +h[p+(k<<4)+8>>3];k=k+1|0;}pS(b,o,q,0,0,0);i=i+1|0;}f=f+1|0;r=m?e:r;g=n?e:g;i=0;}i=c[O+8>>2]|0;if(!i)i=0;else {if(g){if(!(a[(c[J>>2]|0)+115>>0]&3)){hS(b,g);jS(b,g);}}else g=0;R=O+16|0;S=c[O>>2]|0;c[K>>2]=c[R>>2];c[K+4>>2]=c[R+4>>2];c[K+8>>2]=c[R+8>>2];c[K+12>>2]=c[R+12>>2];c[L>>2]=c[S>>2];c[L+4>>2]=c[S+4>>2];c[L+8>>2]=c[S+8>>2];c[L+12>>2]=c[S+12>>2];ZH(b,2,K,L,N,M,i);i=g;}j=O+12|0;g=c[j>>2]|0;if(g|0){if((i|0)!=(r|0)?(a[(c[J>>2]|0)+115>>0]&3)==0:0){hS(b,r);jS(b,r);g=c[j>>2]|0;}R=O+32|0;S=(c[O>>2]|0)+((c[v>>2]|0)+-1<<4)|0;c[K>>2]=c[R>>2];c[K+4>>2]=c[R+4>>2];c[K+8>>2]=c[R+8>>2];c[K+12>>2]=c[R+12>>2];c[L>>2]=c[S>>2];c[L+4>>2]=c[S+4>>2];c[L+8>>2]=c[S+8>>2];c[L+12>>2]=c[S+12>>2];ZH(b,3,K,L,N,M,g);}U1(s);g=0;while(1){if((g|0)>=(I|0))break;U1(c[z+(g*48|0)>>2]|0);U1(c[A+(g*48|0)>>2]|0);g=g+1|0;}U1(z);U1(A);}while(0);l=P;return}function SI(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+64|0;r=x+48|0;u=x+32|0;t=x+16|0;s=x;w=c[a+16>>2]|0;v=c[w+8>>2]|0;q=w+208|0;if(!((c[q>>2]|0)==0?!(b[w+260>>1]&1):0))d=3;a:do if((d|0)==3?(dS(a),p=w+276|0,e=c[p>>2]|0,e|0):0){h=w+280|0;d=c[h>>2]|0;i=w+268|0;j=w+284|0;k=w+272|0;m=w+228|0;n=w+244|0;o=w+212|0;f=c[d>>2]|0;g=1;while(1){if((g|0)>=(e|0))break a;c[i>>2]=c[d+(g<<2)>>2];c[k>>2]=(c[j>>2]|0)+(f<<4);cS(a,c[q>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0);dS(a);y=c[h>>2]|0;f=(c[y+(g<<2)>>2]|0)+f|0;g=g+1|0;e=c[p>>2]|0;d=y;}}while(0);c[w+268>>2]=0;c[w+272>>2]=0;q=v+16|0;d=c[q>>2]|0;e=c[d+8>>2]|0;if(!e)f=w+260|0;else {p=c[e>>2]|0;d=c[p>>2]|0;y=c[p+8>>2]|0;o=p+16|0;c[t>>2]=c[o>>2];c[t+4>>2]=c[o+4>>2];c[t+8>>2]=c[o+8>>2];c[t+12>>2]=c[o+12>>2];p=p+32|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];if(!y){c[u>>2]=c[d>>2];c[u+4>>2]=c[d+4>>2];c[u+8>>2]=c[d+8>>2];c[u+12>>2]=c[d+12>>2];}else {c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];}f=w+260|0;p=b[f>>1]|0;o=c[w+220>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];TI(a,r,(p<<8&65535)<<16>>16>>15&255,o,(p<<14&65535)<<16>>16>>15&255);p=c[(c[q>>2]|0)+8>>2]|0;o=c[p>>2]|0;p=(c[p+4>>2]|0)+-1|0;d=c[o+(p*48|0)>>2]|0;e=c[o+(p*48|0)+4>>2]|0;y=c[o+(p*48|0)+12>>2]|0;n=o+(p*48|0)+16|0;c[t>>2]=c[n>>2];c[t+4>>2]=c[n+4>>2];c[t+8>>2]=c[n+8>>2];c[t+12>>2]=c[n+12>>2];t=o+(p*48|0)+32|0;c[s>>2]=c[t>>2];c[s+4>>2]=c[t+4>>2];c[s+8>>2]=c[t+8>>2];c[s+12>>2]=c[t+12>>2];if(!y){y=d+(e+-1<<4)|0;c[u>>2]=c[y>>2];c[u+4>>2]=c[y+4>>2];c[u+8>>2]=c[y+8>>2];c[u+12>>2]=c[y+12>>2];}else {c[u>>2]=c[s>>2];c[u+4>>2]=c[s+4>>2];c[u+8>>2]=c[s+8>>2];c[u+12>>2]=c[s+12>>2];}d=b[f>>1]|0;y=c[w+224>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];TI(a,r,(d<<7&65535)<<16>>16>>15&255,y,(d<<13&65535)<<16>>16>>15&255);d=c[q>>2]|0;}e=c[d+96>>2]|0;g=(b[f>>1]<<12&65535)<<16>>16>>15<<16>>16;m=w+216|0;h=c[m>>2]|0;n=w+232|0;i=c[n>>2]|0;o=w+248|0;j=c[o>>2]|0;p=w+212|0;k=c[p>>2]|0;if(!((dP(aP(v,c[47186]|0,137308)|0)|0)<<24>>24))d=0;else d=c[(c[q>>2]|0)+8>>2]|0;UI(a,e,11,g,h,i,j,k,d);j=c[(c[q>>2]|0)+108>>2]|0;k=(b[f>>1]<<12&65535)<<16>>16>>15<<16>>16;i=c[m>>2]|0;h=c[n>>2]|0;e=c[o>>2]|0;g=c[p>>2]|0;if(!((dP(aP(v,c[47186]|0,137308)|0)|0)<<24>>24))d=0;else d=c[(c[q>>2]|0)+8>>2]|0;UI(a,j,11,k,i,h,e,g,d);UI(a,c[(c[q>>2]|0)+100>>2]|0,7,(b[f>>1]<<13&65535)<<16>>16>>15<<16>>16,c[w+224>>2]|0,c[w+240>>2]|0,c[w+256>>2]|0,c[p>>2]|0,0);UI(a,c[(c[q>>2]|0)+104>>2]|0,6,(b[f>>1]<<14&65535)<<16>>16>>15<<16>>16,c[w+220>>2]|0,c[w+236>>2]|0,c[w+252>>2]|0,c[p>>2]|0,0);bS(a);bI(a);l=x;return}function TI(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+16|0;h=j;i=c[a+16>>2]|0;if(!(e<<24>>24))f=c[i+208>>2]|0;if(!(g<<24>>24==0?((f|0)==0?(b[i+260>>1]&1)==0:0):0)){c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];YI(a,h);}l=j;return}function UI(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;o=r;q=c[b+152>>2]|0;if(d|0?a[d+81>>0]|0:0){if(!j)n=0;else {n=JK((l2(j)|0)+11|0)|0;switch(e|0){case 11:{m=108224;break}case 7:{m=101583;break}case 6:{m=101593;break}default:qa(138394,99906,2730,100044);}c[o>>2]=j;c[o+4>>2]=m;m4(n,100060,o)|0;}o=b+16|0;j=(c[o>>2]|0)+12|0;p=c[j>>2]|0;c[j>>2]=e;j=(f|0)!=0|(g|0)!=0;m=(q&4|0)==0;if(j&m){VI(b,d);cS(b,g,h,i,n);}DK(b,e,d);if(k|0)WI(b,d,k);if(j){if(!m){VI(b,d);cS(b,g,h,i,n);}dS(b);}U1(n);c[(c[o>>2]|0)+12>>2]=p;}l=r;return}function VI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;i=f>>>16^2;c[d+264>>2]=i;j=d+268|0;c[j>>2]=i+2;i=d+272|0;U1(c[i>>2]|0);d=JK(c[j>>2]<<4)|0;c[i>>2]=d;i=b+56|0;j=b+24|0;h[d>>3]=+h[i>>3]-+h[j>>3]*.5;g=b+64|0;b=b+32|0;h[d+8>>3]=+h[g>>3]-+h[b>>3]*.5;h[d+16>>3]=+h[j>>3]*.5+ +h[i>>3];h[d+24>>3]=+h[b>>3]*.5+ +h[g>>3];if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function WI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+96|0;g=o+80|0;i=o+32|0;j=o+16|0;k=o;f=c[d>>2]|0;while(1){m=a[f>>0]|0;if(!(m<<24>>24))break;if(!(S2(m&255)|0)){n=4;break}else f=f+1|0;}if((n|0)==4){p=+h[d+24>>3];m=d+56|0;XI(i,+h[m>>3]+p*.5,+h[d+64>>3]-+h[d+32>>3]*.5);n=i+16|0;XI(j,+h[i>>3]-p,+h[i+8>>3]);c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];n=i+32|0;c[g>>2]=c[m>>2];c[g+4>>2]=c[m+4>>2];c[g+8>>2]=c[m+8>>2];c[g+12>>2]=c[m+12>>2];qP(k,e,g);c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];lS(b,c[(c[b>>2]|0)+336>>2]|0);hS(b,c[d+8>>2]|0);qS(b,i,3);}l=o;return}function XI(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function YI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;j=f>>>16^2;c[d+264>>2]=j;k=d+268|0;c[k>>2]=j+2;j=d+272|0;U1(c[j>>2]|0);d=JK(c[k>>2]<<4)|0;c[j>>2]=d;i=+h[b>>3];h[d>>3]=i+-3.0;g=+h[b+8>>3];h[d+8>>3]=g+-3.0;h[d+16>>3]=i+3.0;h[d+24>>3]=g+3.0;if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function ZI(a,b,d,e,f,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;i=+i;var j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;J=l;l=l+256|0;D=J+224|0;C=J+208|0;j=J+192|0;F=J+144|0;G=J+96|0;H=J+48|0;E=J;k=J+240|0;e=gI(e,f,k)|0;if((e|0)>1){z=b+48|0;A=xC(c[((c[b>>2]&3|0)==3?b:z)+40>>2]|0)|0;z=KB(c[((c[b>>2]&3|0)==3?b:z)+40>>2]|0)|0;A=(xB(A)|0)!=0;B=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[j>>2]=z;c[j+4>>2]=A?100079:100084;c[j+8>>2]=B;gA(3,100089,j)|0;if((e|0)==2)e=1;else I=4;}else if((e|0)==1)e=1;else I=4;if((I|0)==4){B=b+16|0;r=c[k>>2]|0;s=r+8|0;t=H+4|0;u=F+8|0;v=F+12|0;w=(d|0)!=0;q=(d|0)==0;x=F+32|0;y=F+4|0;z=F+16|0;A=E+4|0;e=0;p=0;while(1){f=c[(c[B>>2]|0)+8>>2]|0;if((p|0)>=(c[f+4>>2]|0))break;j=F;f=(c[f>>2]|0)+(p*48|0)|0;b=j+48|0;do{c[j>>2]=c[f>>2];j=j+4|0;f=f+4|0;}while((j|0)<(b|0));b=1;m=1.0;o=c[s>>2]|0;a:while(1){f=c[o>>2]|0;if(!f)break;k=o+4|0;n=+g[k>>2];do if(n<1.0e-05&n>-1.0e-05)f=b;else {hS(a,f);n=+g[k>>2];m=m-n;e=c[o>>2]|0;if(b|0){hJ(F,n,H,E);k=c[H>>2]|0;pS(a,k,c[t>>2]|0,0,0,0);U1(k);if(m<1.0e-05&m>-1.0e-05){I=11;break a}else {f=0;break}}if(m<1.0e-05&m>-1.0e-05){I=13;break a}j=G;f=E;b=j+48|0;do{c[j>>2]=c[f>>2];j=j+4|0;f=f+4|0;}while((j|0)<(b|0));n=+g[k>>2];hJ(G,n/(m+n),H,E);U1(c[G>>2]|0);f=c[H>>2]|0;pS(a,f,c[t>>2]|0,0,0,0);U1(f);f=0;}while(0);b=f;o=o+12|0;}if((I|0)==11){I=0;U1(c[E>>2]|0);}else if((I|0)==13){I=0;o=c[E>>2]|0;pS(a,o,c[A>>2]|0,0,0,0);U1(o);}if(c[u>>2]|0){hS(a,c[c[s>>2]>>2]|0);jS(a,c[c[s>>2]>>2]|0);k=c[F>>2]|0;o=c[u>>2]|0;c[C>>2]=c[z>>2];c[C+4>>2]=c[z+4>>2];c[C+8>>2]=c[z+8>>2];c[C+12>>2]=c[z+12>>2];c[D>>2]=c[k>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[D+12>>2]=c[k+12>>2];ZH(a,2,C,D,h,i,o);}if(c[v>>2]|0){hS(a,e);jS(a,e);k=(c[F>>2]|0)+((c[y>>2]|0)+-1<<4)|0;o=c[v>>2]|0;c[C>>2]=c[x>>2];c[C+4>>2]=c[x+4>>2];c[C+8>>2]=c[x+8>>2];c[C+12>>2]=c[x+12>>2];c[D>>2]=c[k>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[D+12>>2]=c[k+12>>2];ZH(a,3,C,D,h,i,o);}do if((c[(c[(c[B>>2]|0)+8>>2]|0)+4>>2]|0)>1){if(!(c[u>>2]|0)){if(!(w&(c[v>>2]|0)!=0))break}else if(q)break;lS(a,d);}while(0);p=p+1|0;}hI(r);e=0;}l=J;return e|0}function _I(b,d){b=b|0;d=d|0;var e=0,f=0;e=1;a:while(1){switch(a[b>>0]|0){case 0:break a;case 58:{e=e+1|0;break}default:{}}b=b+1|0;}f=O((l2(d)|0)+1|0,e)|0;b=f+10|0;if((c[47121]|0)<(f|0)){c[47121]=b;b=W1(c[47122]|0,b)|0;c[47122]=b;}else b=c[47122]|0;r3(b,d)|0;while(1){e=e+-1|0;b=c[47122]|0;if(!e)break;f=b+(l2(b)|0)|0;a[f>>0]=58;a[f+1>>0]=0;F4(b,d)|0;}return b|0}function $I(b){b=b|0;var d=0,e=0;d=c[47184]|0;a:do if(!d)e=7;else {d=RA(b,d)|0;switch(a[d>>0]|0){case 110:if(!(s2(d,135709)|0)){d=1;break a}else {e=7;break a}case 102:if(!(s2(d,100066)|0)){d=2;break a}else {e=7;break a}case 98:{if(!(s2(d,100074)|0)){d=3;break a}if(!(s2(d,111221)|0)){d=4;break a}else {e=7;break a}}default:{e=7;break a}}}while(0);if((e|0)==7){d=(xB(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)|0)!=0;d=d?2:1;}return d|0}function aJ(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function bJ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;e=+h[b>>3]-+h[c>>3];f=+h[b+8>>3]-+h[c+8>>3];d=2.0/+C(+(e*e+.0001+f*f));h[a>>3]=d*f;h[a+8>>3]=-(e*d);return}function cJ(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0;g=+h[c>>3]-+h[d>>3];i=+h[c+8>>3]-+h[d+8>>3];f=+C(+(i*i+g*g));if(f<.0001){j=+h[b>>3]-+h[e>>3];f=+h[b+8>>3]-+h[e+8>>3];i=f;g=j;f=+C(+(j*j+.0001+f*f));}j=2.0/f;h[a>>3]=i*j;h[a+8>>3]=-(j*g);return}function dJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5*(1.0-a/b))}function eJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5)}function fJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5*(a/b))}function gJ(a,b,c){a=+a;b=+b;c=+c;b=a/b;return +((!(b<=.5)?1.0-b:b)*c)}function hJ(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0;p=l;l=l+16|0;o=p;n=c[a+4>>2]|0;j=(n+-1|0)/3|0;if((n+-4|0)>>>0<3){c[d+4>>2]=4;c[d>>2]=JK(64)|0;c[e+4>>2]=4;n=JK(64)|0;c[e>>2]=n;kP(o,c[a>>2]|0,3,b,c[d>>2]|0,n);}else {n=JK(j<<3)|0;g=0;i=c[a>>2]|0;f=0.0;while(1){if((g|0)>=(j|0))break;q=+iJ(i);h[n+(g<<3)>>3]=q;g=g+1|0;i=i+48|0;f=q+f;}b=f*b;m=0;f=0.0;while(1){if((j|0)<=(m|0))break;f=+h[n+(m<<3)>>3]+f;if(f>=b)break;m=m+1|0;}k=m*3|0;g=k+4|0;i=d+4|0;c[i>>2]=g;c[d>>2]=JK(g<<4)|0;g=((j-m|0)*3|0)+1|0;j=e+4|0;c[j>>2]=g;c[e>>2]=JK(g<<4)|0;g=0;while(1){if((g|0)>=(c[i>>2]|0))break;r=(c[d>>2]|0)+(g<<4)|0;s=(c[a>>2]|0)+(g<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];g=g+1|0;}g=g+-4|0;i=0;while(1){if((i|0)>=(c[j>>2]|0))break;s=(c[e>>2]|0)+(i<<4)|0;r=(c[a>>2]|0)+(g<<4)|0;c[s>>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];g=g+1|0;i=i+1|0;}q=+h[n+(m<<3)>>3];kP(o,(c[a>>2]|0)+(k<<4)|0,3,(b-f+q)/q,(c[d>>2]|0)+(k<<4)|0,c[e>>2]|0);U1(n);}l=p;return}function iJ(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0;e=+h[a+16>>3];d=+h[a>>3]-e;f=+h[a+24>>3];b=+h[a+8>>3]-f;d=+C(+(b*b+d*d));b=+h[a+32>>3];e=e-b;c=+h[a+40>>3];f=f-c;d=+C(+(f*f+e*e))+d;b=b-+h[a+48>>3];c=c-+h[a+56>>3];return +(d+ +C(+(c*c+b*b)))}function jJ(b,d){b=b|0;d=d|0;d=yC(d)|0;if((a[(c[d+16>>2]|0)+115>>0]|0)==1)d=eQ(b)|0;else d=bQ(b,d)|0;return qJ(d)|0}function kJ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+1664|0;m=q+1600|0;n=q+800|0;o=q;p=KK(24)|0;c[p+16>>2]=1;j=((c[e+4>>2]|0)+-1|0)/3|0;h=0;i=p;while(1){if((h|0)>=(j|0))break;k=h*3|0;g=0;while(1){if((g|0)==4)break;r=m+(g<<4)|0;s=(c[e>>2]|0)+(g+k<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];g=g+1|0;}h=h+1|0;i=lJ(m,i)|0;}g=0;h=0;i=p;while(1){if(!i){h=p;g=p;break}j=c[i+16>>2]|0;k=n+(g<<4)|0;e=o+(g<<4)|0;mJ(h,i,j,k,e,f);g=g+1|0;if(!((g|0)==50|(j|0)==0)){h=i;i=j;continue}nJ(a,b,d,g,n,o);c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];h=i;g=1;i=j;}while(1){if(!h)break;s=c[h+16>>2]|0;U1(g);h=s;g=s;}l=q;return}function lJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+144|0;f=g+128|0;d=g+64|0;e=g;if(!(mI(a)|0)){kP(f,a,3,.5,d,e);d=lJ(e,lJ(d,b)|0)|0;}else {d=b+16|0;if((c[d>>2]|0)==1){c[d>>2]=0;c[b>>2]=c[a>>2];c[b+4>>2]=c[a+4>>2];c[b+8>>2]=c[a+8>>2];c[b+12>>2]=c[a+12>>2];}d=a+48|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];d=pJ(f,b)|0;}l=g;return d|0}function mJ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0;r=l;l=l+96|0;n=r+80|0;m=r+64|0;k=r+48|0;o=r+32|0;p=r+16|0;q=r;c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];do if(a){c[p>>2]=c[a>>2];c[p+4>>2]=c[a+4>>2];c[p+8>>2]=c[a+8>>2];c[p+12>>2]=c[a+12>>2];if(!d){i=+h[o>>3];h[q>>3]=i*2.0-+h[p>>3];j=+h[o+8>>3];h[q+8>>3]=j*2.0-+h[p+8>>3];break}else {c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];i=+h[o>>3];j=+h[o+8>>3];break}}else {c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];i=+h[o>>3];h[p>>3]=i*2.0-+h[q>>3];j=+h[o+8>>3];h[p+8>>3]=j*2.0-+h[q+8>>3];}while(0);c[k>>2]=c[p>>2];c[k+4>>2]=c[p+4>>2];c[k+8>>2]=c[p+8>>2];c[k+12>>2]=c[p+12>>2];c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[n>>2]=c[q>>2];c[n+4>>2]=c[q+4>>2];c[n+8>>2]=c[q+8>>2];c[n+12>>2]=c[q+12>>2];t=+oJ(k,m,n);s=+E(+t)*g;g=+F(+t)*g;h[e>>3]=i+s;h[e+8>>3]=j+g;h[f>>3]=i-s;h[f+8>>3]=j-g;l=r;return}function nJ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;i=e<<1;j=c[d>>2]|0;h=0;k=0;while(1){if((h|0)>=(j|0))break;l=(c[(c[b>>2]|0)+(h<<2)>>2]|0)+k|0;h=h+1|0;k=l;}l=j+1|0;c[d>>2]=l;l=MK(c[b>>2]|0,l<<2)|0;c[b>>2]=l;c[l+(h<<2)>>2]=i;c[a>>2]=MK(c[a>>2]|0,k+i<<4)|0;b=i+-1+k|0;h=0;while(1){if((h|0)>=(e|0))break;l=(c[a>>2]|0)+(h+k<<4)|0;j=f+(h<<4)|0;c[l>>2]=c[j>>2];c[l+4>>2]=c[j+4>>2];c[l+8>>2]=c[j+8>>2];c[l+12>>2]=c[j+12>>2];l=(c[a>>2]|0)+(b-h<<4)|0;j=g+(h<<4)|0;c[l>>2]=c[j>>2];c[l+4>>2]=c[j+4>>2];c[l+8>>2]=c[j+8>>2];c[l+12>>2]=c[j+12>>2];h=h+1|0;}return}function oJ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;f=+h[b+8>>3];d=+h[b>>3];e=+K(+(+h[c+8>>3]-f),+(+h[c>>3]-d));d=+K(+(+h[a+8>>3]-f),+(+h[a>>3]-d));e=e-d;return +((e>0.0?e+-6.283185307179586:e)*.5+d)}function pJ(a,b){a=a|0;b=b|0;var d=0;d=KK(24)|0;c[d+16>>2]=0;c[d>>2]=c[a>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];c[d+12>>2]=c[a+12>>2];c[b+16>>2]=d;return d|0}function qJ(b){b=b|0;var c=0,d=0,e=0,f=0,g=0;c=b;f=b;a:while(1){e=0;while(1){d=c;c=c+1|0;d=a[d>>0]|0;if(!(d<<24>>24))break a;if(e<<24>>24){g=5;break}if(d<<24>>24!=92)break;else e=1;}b:do if((g|0)==5){g=0;switch(d<<24>>24|0){case 114:{d=13;break b}case 108:case 110:{d=10;break b}default:break b}}while(0);a[f>>0]=d;f=f+1|0;}a[f>>0]=0;return b|0}function rJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=c[b>>2]|0;while(1){g=a[e>>0]|0;if(!(g<<24>>24)){f=0;break}f=g<<24>>24;if(!(g<<24>>24==44|(S2(f)|0)!=0)){h=5;break}e=e+1|0;}a:do if((h|0)==5){switch(f|0){case 0:{f=0;break a}case 41:case 40:{e=e+1|0;break a}default:{}}h=d+4|0;i=d+8|0;while(1){if((sJ(g<<24>>24)|0)<<24>>24){f=1;break a}f=c[h>>2]|0;if(f>>>0>=(c[i>>2]|0)>>>0){lA(d,1)|0;f=c[h>>2]|0;}c[h>>2]=f+1;a[f>>0]=g;f=e+1|0;e=f;g=a[f>>0]|0;}}while(0);c[b>>2]=e;return f|0}function sJ(a){a=a|0;switch(a|0){case 0:case 44:case 41:case 40:{a=1;break}default:a=0;}return a|0}function tJ(a,b){a=a|0;b=b|0;return uJ(c[a>>2]|0,c[a+160>>2]|0,c[a+156>>2]|0,b)|0}function uJ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+160|0;k=o+20|0;m=o+16|0;n=o;c[k>>2]=0;c[m>>2]=0;kA(n,128,o+24|0);nA(n,f)|0;g=n+4|0;f=c[g>>2]|0;if(f>>>0>=(c[n+8>>2]|0)>>>0){lA(n,1)|0;f=c[g>>2]|0;}a[f>>0]=0;h=c[n>>2]|0;c[g>>2]=h;i=b+300|0;j=b+296|0;f=0;g=h;a:while(1){if(f){f=1;break}f=C4(g,c[i>>2]|0,k)|0;if(!f){f=0;break}g=C4(f,c[j>>2]|0,m)|0;h=(g|0)!=0;if(h)f=C4(0,c[j>>2]|0,m)|0;else f=0;switch(((f|0)!=0&1)+(h&1)&3){case 2:{g=vJ(b,g,0)|0;f=vJ(b,f,e)|0;h=(g|0)>(f|0);f=(f&g|0)>-1&(((h?g:f)|0)>=(d|0)&((h?f:g)|0)<=(d|0));g=0;continue a}case 1:{f=(vJ(b,g,d)|0)==(d|0);g=0;continue a}default:{f=0;g=0;continue a}}}oA(n);l=o;return f|0}function vJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=a[d>>0]|0;if(!(h<<24>>24==97?(s2(d,100396)|0)==0:0))f=3;a:do if((f|0)==3){if((wJ(d)|0)<<24>>24){e=q5(d)|0;break}g=c[b+308>>2]|0;if(!g)e=-1;else {b=c[b+312>>2]|0;e=1;while(1){if((e|0)>(b|0)){e=-1;break a}f=c[g+(e<<2)>>2]|0;if(h<<24>>24==(a[f>>0]|0)?(s2(d,f)|0)==0:0)break a;e=e+1|0;}}}while(0);return e|0}function wJ(b){b=b|0;var c=0;while(1){c=a[b>>0]|0;if(!(c<<24>>24)){b=1;break}if(((c&255)+-48|0)>>>0<10)b=b+1|0;else {b=0;break}}return b|0}function xJ(a,b){a=a|0;b=b|0;if((+h[a+16>>3]>=+h[b>>3]?+h[b+16>>3]>=+h[a>>3]:0)?+h[a+24>>3]>=+h[b+8>>3]:0)a=+h[b+24>>3]>=+h[a+8>>3]&1;else a=0;return a|0}function yJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;a:do if((c[b+156>>2]|0)>=2?(f=aP(e,c[47167]|0,195059)|0,(tJ(b,f)|0)<<24>>24==0):0)if(!(a[f>>0]|0))if(!(aB(d,e)|0))f=1;else {f=aB(d,e)|0;while(1){if(!f){f=0;break a}g=aP(f,c[47190]|0,195059)|0;if(!(a[g>>0]|0)){f=1;break a}if((tJ(b,g)|0)<<24>>24){f=1;break a}f=bB(d,f,e)|0;}}else f=0;else f=1;while(0);return f|0}function zJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+64|0;e=d+32|0;f=d;a=(c[a+16>>2]|0)+48|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[f+16>>2]=c[a+16>>2];c[f+20>>2]=c[a+20>>2];c[f+24>>2]=c[a+24>>2];c[f+28>>2]=c[a+28>>2];c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];c[e+16>>2]=c[b+16>>2];c[e+20>>2]=c[b+20>>2];c[e+24>>2]=c[b+24>>2];c[e+28>>2]=c[b+28>>2];b=(xJ(f,e)|0)&255;l=d;return b|0}function AJ(a,d){a=a|0;d=d|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0.0,v=0.0;r=c[a+152>>2]|0;s=aI(a)|0;c[s+4>>2]=2;c[s+8>>2]=d;c[s+12>>2]=8;if(r&16777216|0){if((e[(c[(xC(d)|0)+16>>2]|0)+178>>1]|0)>2){f=+h[(c[(c[d+16>>2]|0)+132>>2]|0)+16>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);}else f=0.0;h[s+168>>3]=f;}k=d+16|0;CJ(a,c[(c[k>>2]|0)+104>>2]|0,d);do if(r&4259840|0){if((c[s+208>>2]|0)==0?(b[s+260>>1]&1)==0:0)break;p=WM(d)|0;l=c[k>>2]|0;f=+h[l+16>>3];q=+h[l+24>>3];l=DJ(d)|0;a:do if((p|2|0)==3){n=c[(c[k>>2]|0)+12>>2]|0;if(!((EJ(n)|0)<<24>>24))g=0;else g=(c[n+4>>2]|l|0)!=0;if(!((r&524288|0)==0|((n|0)==0|g))){i=n+8|0;o=c[i>>2]|0;o=(o|0)<3?1:o;j=n+4|0;m=c[j>>2]|0;m=(m|0)>1?m:1;p=c[n+44>>2]|0;g=QA(d,102705)|0;if(!g)g=0;else g=q5(g)|0;g=(g+-4|0)>>>0>56?20:g;if(!(c[j>>2]|l)){c[s+264>>2]=0;i=JK(32)|0;g=c[k>>2]|0;v=+h[g+88>>3];h[i>>3]=f-v;u=+h[g+80>>3]*.5;h[i+8>>3]=q-u;h[i+16>>3]=v+f;h[i+24>>3]=u+q;g=2;break}i=c[i>>2]|0;if(((i|0)<3?+h[n+32>>3]==0.0:0)?+h[n+24>>3]==0.0:0){i=s+264|0;if(c[n>>2]|0){c[i>>2]=1;i=JK(32)|0;h[i>>3]=f;h[i+8>>3]=q;g=(m<<1)+-1|0;h[i+16>>3]=+h[p+(g<<4)>>3]+f;h[i+24>>3]=+h[p+(g<<4)+8>>3]+q;g=2;break}c[i>>2]=2;i=(m<<1)+-1|0;i=FJ(+h[p+(i<<4)>>3],+h[p+(i<<4)+8>>3],g)|0;j=0;while(1){if((j|0)>=(g|0))break a;p=i+(j<<4)|0;h[p>>3]=+h[p>>3]+f;p=i+(j<<4)+8|0;h[p>>3]=+h[p>>3]+q;j=j+1|0;}}m=O(i,m+-1|0)|0;c[s+264>>2]=2;if((i|0)<(g|0)){i=JK(o<<4)|0;g=0;while(1){if((g|0)>=(o|0)){g=o;break a}n=g+m|0;h[i+(g<<4)>>3]=+h[p+(n<<4)>>3]+f;h[i+(g<<4)+8>>3]=+h[p+(n<<4)+8>>3]+q;g=g+1|0;}}else {l=(i|0)/(g|0)|0;i=JK(g<<4)|0;j=0;k=0;while(1){if((j|0)>=(g|0))break a;o=k+m|0;h[i+(j<<4)>>3]=+h[p+(o<<4)>>3]+f;h[i+(j<<4)+8>>3]=+h[p+(o<<4)+8>>3]+q;j=j+1|0;k=k+l|0;}}}else t=31;}else t=31;while(0);if((t|0)==31){c[s+264>>2]=0;i=JK(32)|0;g=c[k>>2]|0;h[i>>3]=f-+h[g+88>>3];v=+h[g+80>>3]*.5;h[i+8>>3]=q-v;h[i+16>>3]=+h[g+96>>3]+f;h[i+24>>3]=v+q;g=2;}if(!(r&8192))NR(a,i,i,g)|0;c[s+272>>2]=i;c[s+268>>2]=g;}while(0);HT(QA(d,100032)|0);_R(a,d);return}function BJ(a){a=a|0;$R(a);bI(a);return}function CJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+144|0;j=m;f=QA(e,141055)|0;i=QA(e,141101)|0;k=QA(e,141088)|0;kA(j,128,m+16|0);if(!d)h=0;else h=c[d>>2]|0;if(!((f|0)!=0?(a[f>>0]|0)!=0:0))f=QA(e,111477)|0;g=dI(b,e,j)|0;if(!i)d=0;else d=jJ(i,e)|0;cI(b,h,f,d,k,g,e)|0;U1(d);oA(j);l=m;return}function DJ(b){b=b|0;var d=0,e=0;b=bP(b,c[47157]|0,195059)|0;a:do if(!(a[b>>0]|0))b=0;else {PI(b)|0;b=0;d=188228;while(1){e=c[d>>2]|0;if(!e)break a;e=(s2(e,111101)|0)==0;b=e?1:b;d=d+4|0;}}while(0);return b|0}function EJ(a){a=a|0;var b=0.0;if(((c[a+8>>2]|0)==4?(b=+h[a+16>>3],((~~(b+(b>=0.0?.5:-.5))|0)%90|0|0)==0):0)?+h[a+24>>3]==0.0:0)a=+h[a+32>>3]==0.0&1;else a=0;return a|0}function FJ(a,b,c){a=+a;b=+b;c=c|0;var d=0.0,e=0,f=0.0,g=0;f=6.283185307179586/+(c|0);g=JK(c<<4)|0;d=0.0;e=0;while(1){if((e|0)>=(c|0))break;h[g+(e<<4)>>3]=+E(+d)*a;h[g+(e<<4)+8>>3]=+F(+d)*b;d=d+f;e=e+1|0;}return g|0}function GJ(b,d){b=b|0;d=d|0;var e=0;a:do if((c[b+156>>2]|0)>=2?(e=aP(d,GA(d,0,101510,0)|0,195059)|0,(tJ(b,e)|0)<<24>>24==0):0)if(!(a[e>>0]|0)){e=jC(d)|0;while(1){if(!e){e=0;break a}if((yJ(b,d,e)|0)<<24>>24){e=1;break a}e=kC(d,e)|0;}}else e=0;else e=1;while(0);return e|0}function HJ(a,b){a=a|0;b=b|0;var d=0;d=aI(a)|0;c[d+4>>2]=1;c[d+8>>2]=b;c[d+12>>2]=1;CJ(a,c[(c[b+16>>2]|0)+12>>2]|0,b);UR(a,b);return}function IJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;b=QA(b,141082)|0;a:do if((b|0)!=0?(a[b>>0]|0)!=0:0){PI(b)|0;e=188228;b=0;while(1){while(1){f=c[e>>2]|0;if(!f){e=188228;break a}if(!(s2(f,111101)|0)){g=10;break}if(!(s2(f,106334)|0)){f=e;g=12;break}if(!(s2(f,106341)|0)){f=e;g=14;break}if(!(s2(f,106316)|0)){f=e;g=16;break}e=e+4|0;}if((g|0)==10){e=e+4|0;b=b|1;continue}else if((g|0)==12){while(1){h=f;f=f+4|0;g=c[f>>2]|0;c[h>>2]=g;if(!g)break;else g=12;}b=b|3;continue}else if((g|0)==14){while(1){g=f;f=f+4|0;h=c[f>>2]|0;c[g>>2]=h;if(!h)break;else g=14;}b=b|64;continue}else if((g|0)==16){while(1){g=f;f=f+4|0;h=c[f>>2]|0;c[g>>2]=h;if(!h)break;else g=16;}b=b|4;continue}}}else {e=0;b=0;}while(0);c[d>>2]=b;return e|0}function JJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;i=k;j=k+4|0;c[j>>2]=0;m=(gI(b,0,j)|0)==0;j=c[j>>2]|0;if((m?(f=c[j>>2]|0,(f|0)>=2):0)?(h=j+8|0,(c[c[h>>2]>>2]|0)!=0):0){if((f|0)>2)gA(0,100415,i)|0;m=KK((l2(b)|0)+1|0)|0;c[d>>2]=m;r3(m,c[c[h>>2]>>2]|0)|0;if(!(c[(c[h>>2]|0)+12>>2]|0))c[d+4>>2]=0;else {m=c[d>>2]|0;m=m+((l2(m)|0)+1)|0;c[d+4>>2]=m;r3(m,c[(c[h>>2]|0)+12>>2]|0)|0;}b=c[h>>2]|0;do if(!(a[b+8>>0]|0))if(!(a[b+20>>0]|0)){g[e>>2]=0.0;break}else {g[e>>2]=1.0-+g[b+16>>2];break}else c[e>>2]=c[b+4>>2];while(0);hI(j);b=1;}else {c[d>>2]=0;hI(j);b=0;}l=k;return b|0}function KJ(a,b){a=a|0;b=b|0;VR(a,b);bI(a);return}function LJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;x=l;l=l+96|0;p=x+48|0;s=x+16|0;w=x+8|0;v=x;t=x+80|0;c[t>>2]=1e3;f=KK(16e3)|0;u=a+256|0;e=1;j=1;i=0;q=0;r=c[b+8>>2]|0;while(1){if((q|0)>=(c[b>>2]|0))break;d=c[r>>2]|0;a:do switch(d|0){case 1:case 0:{n=r+80|0;c[s>>2]=c[n>>2];c[s+4>>2]=c[n+4>>2];c[s+8>>2]=c[n+8>>2];c[s+12>>2]=c[n+12>>2];c[s+16>>2]=c[n+16>>2];c[s+20>>2]=c[n+20>>2];c[s+24>>2]=c[n+24>>2];c[s+28>>2]=c[n+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {z=r+8|0;A=r+24|0;h[f>>3]=+h[z>>3]-+h[A>>3];n=r+16|0;y=r+32|0;h[f+8>>3]=+h[n>>3]-+h[y>>3];h[f+16>>3]=+h[A>>3]+ +h[z>>3];h[f+24>>3]=+h[y>>3]+ +h[n>>3];mS(a,f,2,(d|0)==0?j:0);d=j;}break}case 3:case 2:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;nS(a,f,c[d>>2]|0,(c[r>>2]|0)==2?j:0);d=j;}break}case 5:case 4:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;pS(a,f,c[d>>2]|0,0,0,(c[r>>2]|0)==4?j&255:0);d=j;}break}case 6:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;qS(a,f,c[d>>2]|0);d=j;}break}case 7:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {h[f>>3]=+h[r+8>>3];h[f+8>>3]=+h[r+16>>3];d=c[r+112>>2]|0;c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];gS(a,p,d);d=j;}break}case 8:{jS(a,c[r+8>>2]|0);d=1;break}case 9:{hS(a,c[r+8>>2]|0);d=1;break}case 13:{if((c[r+8>>2]|0)!=2){d=r+16|0;z=c[d+36>>2]|0;A=c[z+12>>2]|0;o=+g[z+8>>2];d=~~(+K(+(+h[r+40>>3]-+h[r+24>>3]),+(+h[r+32>>3]-+h[d>>3]))*57.29577951308232);jS(a,c[z+4>>2]|0);kS(a,A,d,o);d=2;break a}A=c[r+68>>2]|0;j=c[A+4>>2]|0;n=c[A+12>>2]|0;o=+g[A+8>>2];k=+h[r+40>>3];m=+h[r+16>>3];if(k==m?+h[r+48>>3]==+h[r+24>>3]:0)d=0;else d=~~(+H(+((m-k)/+h[r+32>>3]))*57.29577951308232);jS(a,j);kS(a,n,d,o);d=3;break}case 14:{gA(0,100481,v)|0;d=j;break}case 12:{if(!e){e=0;d=j;}else {gA(0,100521,w)|0;e=0;d=j;}break}case 11:{PI(c[r+8>>2]|0)|0;lS(a,188228);i=188228;d=j;break}default:d=j;}while(0);j=d;q=q+1|0;r=r+120|0;}if(i|0)lS(a,c[(c[a>>2]|0)+336>>2]|0);U1(f);l=x;return}function MJ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[b>>2]|0;f=g<<1;f=(f|0)>(e|0)?f:e;if((g|0)<(e|0)){a=MK(a,f<<4)|0;c[b>>2]=f;}b=0;while(1){if((b|0)>=(e|0))break;h[a+(b<<4)>>3]=+h[d+(b*24|0)>>3];h[a+(b<<4)+8>>3]=+h[d+(b*24|0)+8>>3];b=b+1|0;}return a|0}function NJ(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;c[a>>2]=c[b+4>>2];c[a+4>>2]=d;return}function OJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=d+16|0;f=1;while(1){d=c[g>>2]|0;if((f|0)>(c[d+180>>2]|0))break;e=c[(c[d+184>>2]|0)+(f<<2)>>2]|0;OJ(b,e);d=QA(e,140823)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,137729)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,140977)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,101418)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(e,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=f+1|0;}return}function PJ(a){a=a|0;var b=0,d=0,e=0;b=c[47127]|0;if(!b){b=Vz(20628,c[4581]|0)|0;c[47127]=b;}if(!(nb[c[b>>2]&63](b,a,4)|0)){d=c[47127]|0;e=c[d>>2]|0;b=D4(a)|0;nb[e&63](d,b,1)|0;b=1;}else b=0;return b|0}function QJ(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function RJ(a){a=a|0;var b=0;b=c[47128]|0;if(!a){if((b|0)>0?(b=b+-1|0,c[47128]=b,(b|0)==0):0){Z3(1,c[47129]|0)|0;U1(c[47129]|0);}}else {c[47128]=b+1;if(!b){c[47129]=D4(Z3(1,0)|0)|0;Z3(1,153563)|0;}}return}function SJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+96|0;r=u+72|0;q=u+56|0;p=u+48|0;t=u+32|0;s=u+24|0;e=u+8|0;d=u;if(0);do if((TC(b,137483,0,1)|0)!=0?(o=b+16|0,(c[(c[o>>2]|0)+8>>2]|0)!=0):0){TJ(b);UJ(a,b);VJ(a,b);RJ(1);j=a+56|0;k=a+184|0;m=a+192|0;n=a+28|0;i=EF(a)|0;a:while(1){if(!i){g=33;break}d=c[j>>2]|0;if(!d){c[i+20>>2]=0;d=0;}else {c[i+20>>2]=c[d+8>>2];d=c[d+12>>2]|0;}c[i+24>>2]=d;c[i+12>>2]=a;c[i+28>>2]=c[k>>2];c[i+620>>2]=25764;c[i+624>>2]=14;if(!(c[(c[o>>2]|0)+8>>2]|0)){g=13;break}e=i+52|0;g=JR(i,c[e>>2]|0)|0;c[i+56>>2]=g;switch(g|0){case 999:{g=16;break a}case 21:{d=1;break}case 24:{d=520;break}default:d=WJ(b)|0;}f=i+152|0;c[f>>2]=c[f>>2]|d;d=c[m>>2]|0;do if(!d)g=24;else {if(c[d+152>>2]&32|0?(s2(c[e>>2]|0,c[d+52>>2]|0)|0)==0:0){d=c[47130]|0;if(!d){g=27;break}c[d+8>>2]=i;c[i+36>>2]=c[d+36>>2];g=29;break}LR(d);c[m>>2]=0;c[n>>2]=0;g=24;}while(0);if((g|0)==24){c[47130]=0;g=27;}if((g|0)==27?(g=0,(KR(i)|0)==0):0){c[m>>2]=i;g=29;}if((g|0)==29){c[i+8>>2]=0;c[i+104>>2]=25876;XJ(i);YJ(i);ZJ(i,b);_J(i,b);$J(i,b);if(!(c[f>>2]&128))sI(i,b);c[47130]=i;}i=FF(a)|0;}if((g|0)==13){gA(1,100679,s)|0;RJ(0);if(!0){d=-1;break}d=c[15712]|0;s=KB(b)|0;v=+UO();c[t>>2]=s;h[t+8>>3]=v;w4(d,100650,t)|0;d=-1;break}else if((g|0)==16){c[p>>2]=c[e>>2];gA(1,100700,p)|0;RJ(0);if(!0){d=-1;break}d=c[15712]|0;t=KB(b)|0;v=+UO();c[q>>2]=t;h[q+8>>3]=v;w4(d,100650,q)|0;d=-1;break}else if((g|0)==33){RJ(0);if(!0){d=0;break}d=c[15712]|0;t=KB(b)|0;v=+UO();c[r>>2]=t;h[r+8>>3]=v;w4(d,100650,r)|0;d=0;break}}else g=5;while(0);if((g|0)==5){gA(1,100602,d)|0;if(!0)d=-1;}l=u;return d|0}function TJ(a){a=a|0;var b=0;b=jC(a)|0;while(1){if(!b)break;eK(a,b);b=kC(a,b)|0;}return}function UJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+32|0;k=o+24|0;f=o+16|0;j=o+8|0;n=o;c[b+168>>2]=d;g=b+293|0;a[g>>0]=0;e=QA(d,105496)|0;if(e|0?(c[f>>2]=j,c[f+4>>2]=n,i=b5(e,105503,f)|0,(i|0)>0):0){p=+h[j>>3]*72.0;e=b+208|0;h[e>>3]=p;h[b+200>>3]=p;if((i|0)!=1)h[e>>3]=+h[n>>3]*72.0;a[g>>0]=1;}f=b+292|0;a[f>>0]=0;e=QA(d,101102)|0;if(e|0?(c[k>>2]=j,c[k+4>>2]=n,m=b5(e,105503,k)|0,(m|0)>0):0){p=+h[j>>3]*72.0;e=b+224|0;h[e>>3]=p;h[b+216>>3]=p;if((m|0)!=1)h[e>>3]=+h[n>>3]*72.0;a[f>>0]=1;}e=b+294|0;a[e>>0]=0;f=b+232|0;g=d+16|0;n=(c[(c[g>>2]|0)+8>>2]|0)+48|0;c[f>>2]=c[n>>2];c[f+4>>2]=c[n+4>>2];c[f+8>>2]=c[n+8>>2];c[f+12>>2]=c[n+12>>2];f=c[(c[g>>2]|0)+8>>2]|0;if(+h[f+48>>3]>.001?+h[f+56>>3]>.001:0)a[e>>0]=1;c[b+288>>2]=a[f+81>>0]|0?90:0;e=b+196|0;c[e>>2]=101106;f=QA(d,101109)|0;if(f|0?a[f>>0]|0:0)c[e>>2]=f;n=b+256|0;m=(c[g>>2]|0)+16|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];c[n+8>>2]=c[m+8>>2];c[n+12>>2]=c[m+12>>2];c[n+16>>2]=c[m+16>>2];c[n+20>>2]=c[m+20>>2];c[n+24>>2]=c[m+24>>2];c[n+28>>2]=c[m+28>>2];c[47141]=GA(d,0,101472,0)|0;c[47142]=GA(d,0,101463,0)|0;c[b+320>>2]=bP(0,c[47151]|0,107994)|0;h[b+328>>3]=+_O(0,c[47150]|0,14.0,1.0);c[b+336>>2]=20664;c[b+188>>2]=KB(d)|0;l=o;return}function VJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=b+304|0;f=c[e>>2]|0;if(f|0){U1(f);c[e>>2]=0;}f=b+308|0;e=c[f>>2]|0;if(e|0){U1(e);c[f>>2]=0;}g=b+316|0;e=c[g>>2]|0;if(e|0){U1(e);c[g>>2]=0;}e=QA(d,100853)|0;if(e){c[b+312>>2]=cK(b,d,e)|0;e=QA(d,100860)|0;if(e|0?a[e>>0]|0:0)c[g>>2]=dK(b,e)|0;}else {c[f>>2]=0;c[b+312>>2]=1;}return}function WJ(b){b=b|0;b=QA(b,100821)|0;a:do if(!b)b=0;else switch(a[b>>0]|0){case 110:{if(!(s2(b+1|0,100833)|0))b=1;else {b=0;break a}break}case 101:{if(!(s2(b+1|0,100843)|0))b=16;else {b=0;break a}break}default:{b=0;break a}}while(0);return b|0}function XJ(b){b=b|0;var d=0.0,e=0;e=c[b>>2]|0;if(!(a[e+292>>0]|0)){if((c[b+56>>2]|0)==300)d=+h[(c[b+68>>2]|0)+8>>3];else d=4.0;h[b+248>>3]=d;h[b+240>>3]=d;}else {b=b+240|0;e=e+216|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];}return}function YJ(b){b=b|0;var d=0;d=c[b>>2]|0;a:do if(!(a[d+293>>0]|0))switch(c[b+56>>2]|0){case 300:{d=b+416|0;b=(c[b+84>>2]|0)+8|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];break a}case 30:case 21:case 22:case 4:case 3:case 2:{h[b+424>>3]=36.0;h[b+416>>3]=36.0;break a}default:{d=b+416|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;break a}}else {b=b+416|0;d=d+200|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];}while(0);return}function ZJ(b,d){b=b|0;d=d|0;var e=0.0,f=0;f=c[(c[b>>2]|0)+192>>2]|0;e=+h[(c[(c[d+16>>2]|0)+8>>2]|0)+24>>3];do if(!(e!=0.0)){if(f|0?a[f+128>>0]|0:0){b=b+432|0;f=f+112|0;c[b>>2]=c[f>>2];c[b+4>>2]=c[f+4>>2];c[b+8>>2]=c[f+8>>2];c[b+12>>2]=c[f+12>>2];break}d=b+432|0;if((c[b+56>>2]|0)==300){b=(c[b+84>>2]|0)+40|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];break}else {h[b+440>>3]=96.0;h[d>>3]=96.0;break}}else {h[b+440>>3]=e;h[b+432>>3]=e;}while(0);return}function _J(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+112|0;t=A+80|0;u=A+56|0;s=A+40|0;v=A+32|0;w=A+24|0;x=A+16|0;y=A+8|0;z=A;m=c[b>>2]|0;o=+h[m+272>>3];q=+h[m+280>>3];p=+h[m+256>>3];r=+h[m+264>>3];f=+h[b+240>>3];e=p-f;h[b+208>>3]=e;i=+h[b+248>>3];j=r-i;h[b+216>>3]=j;f=f+o;h[b+224>>3]=f;i=i+q;h[b+232>>3]=i;e=f-e;j=i-j;h[x>>3]=1.0;g=c[(c[d+16>>2]|0)+8>>2]|0;i=+h[g+64>>3];do if(i>.001?(k=+h[g+72>>3],k>.001):0){e=e==0.0?i:e;f=j==0.0?k:j;if(!(if&(i>e&(a[g+80>>0]|0)!=0)):0){k=e;j=f;i=1.0;break}n=i/e>3]=i;k=e;j=f;}else {k=e;i=1.0;}while(0);f=(p+o)*.5;h[y>>3]=f;e=(r+q)*.5;h[z>>3]=e;c[b+360>>2]=c[m+288>>2];k=i*k;h[v>>3]=k;j=i*j;h[w>>3]=j;g=QA(d,100752)|0;if(g){m=T1((l2(g)|0)+1|0)|0;n=T1((l2(g)|0)+1|0)|0;c[s>>2]=v;c[s+4>>2]=w;c[s+8>>2]=x;c[s+12>>2]=m;do if((b5(g,100761,s)|0)==4){g=tC(c[d+60>>2]|0,m,0)|0;if(g|0){u=c[g+16>>2]|0;h[y>>3]=+h[u+16>>3];h[z>>3]=+h[u+24>>3];}}else {c[u>>2]=v;c[u+4>>2]=w;c[u+8>>2]=x;c[u+12>>2]=m;c[u+16>>2]=n;if((b5(g,100781,u)|0)!=4){c[t>>2]=v;c[t+4>>2]=w;c[t+8>>2]=x;c[t+12>>2]=y;c[t+16>>2]=z;b5(g,100801,t)|0;break}g=tC(c[d+60>>2]|0,m,0)|0;if(g|0){u=c[g+16>>2]|0;h[y>>3]=+h[u+16>>3];h[z>>3]=+h[u+24>>3];}}while(0);U1(m);U1(n);k=+h[v>>3];j=+h[w>>3];i=+h[x>>3];f=+h[y>>3];e=+h[z>>3];}h[b+368>>3]=k;h[b+376>>3]=j;h[b+352>>3]=i;h[b+336>>3]=f;h[b+344>>3]=e;l=A;return}function $J(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0,P=0.0,Q=0.0;M=l;l=l+224|0;J=M+200|0;z=M+168|0;E=M+144|0;I=M+120|0;F=M+96|0;G=M+64|0;e=M+184|0;v=M+176|0;w=M+160|0;y=M+136|0;x=M+112|0;A=M+80|0;B=M+48|0;C=M+32|0;D=M+16|0;K=M+8|0;L=M;u=c[b>>2]|0;c[G>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;c[G+12>>2]=0;H=b+368|0;c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];H=b+360|0;if(c[H>>2]|0){c[J>>2]=c[I>>2];c[J+4>>2]=c[I+4>>2];c[J+8>>2]=c[I+8>>2];c[J+12>>2]=c[I+12>>2];aK(e,J);c[I>>2]=c[e>>2];c[I+4>>2]=c[e+4>>2];c[I+8>>2]=c[e+8>>2];c[I+12>>2]=c[e+12>>2];}t=b+416|0;c[F>>2]=c[t>>2];c[F+4>>2]=c[t+4>>2];c[F+8>>2]=c[t+8>>2];c[F+12>>2]=c[t+12>>2];if((a[u+294>>0]|0)!=0?(c[b+152>>2]&32|0)!=0:0){i=+h[u+232>>3]-+h[F>>3]*2.0;h[E>>3]=i;k=+h[u+240>>3]-+h[F+8>>3]*2.0;p=E+8|0;h[p>>3]=k;if(!(i<.0001)){o=+h[I>>3];e=~~(o/i);f=b+164|0;c[f>>2]=e;if(o-i*+(e|0)>.0001){e=e+1|0;c[f>>2]=e;}}else {c[b+164>>2]=1;e=1;}if(!(k<.0001)){g=+h[I+8>>3];f=~~(g/k);j=b+168|0;c[j>>2]=f;if(g-k*+(f|0)>.0001){f=f+1|0;c[j>>2]=f;}}else {c[b+168>>2]=1;f=1;g=+h[I+8>>3];}c[b+204>>2]=O(f,e)|0;o=+h[(+h[I>>3]>3];h[I>>3]=o;e=p;f=I;m=+h[(g>3];g=o;j=21;}else {if(c[b+68>>2]|0){e=c[b+84>>2]|0;i=+h[e+24>>3]-+h[F>>3]*2.0;i=i<0.0?0.0:i;h[E>>3]=i;o=+h[e+32>>3]-+h[F+8>>3]*2.0;e=E+8|0;h[e>>3]=o;if(o<0.0){f=E;j=17;}else e=E;}else {h[E+8>>3]=0.0;f=E;e=E;j=17;}if((j|0)==17){h[e>>3]=0.0;e=f;i=+h[f>>3];}c[b+204>>2]=1;c[b+168>>2]=1;c[b+164>>2]=1;g=+h[I>>3];if(i>3]=g;i=g;}e=E+8|0;k=+h[e>>3];m=+h[I+8>>3];if(k>3]=m;r=e;m=+h[e>>3];}n=+h[F>>3];s=b+432|0;k=+h[s>>3]*.013888888888888888*(n*2.0+i);c[b+448>>2]=~~(k+(k>=0.0?.5:-.5));q=F+8|0;k=+h[q>>3];t=b+440|0;o=+h[t>>3]*.013888888888888888*(k*2.0+m);c[b+452>>2]=~~(o+(o>=0.0?.5:-.5));j=b+188|0;p=b+180|0;e=b+172|0;f=u+196|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;bK(v,b,a[c[f>>2]>>0]|0);u=v;v=c[u+4>>2]|0;e=p;c[e>>2]=c[u>>2];c[e+4>>2]=v;bK(w,b,a[(c[f>>2]|0)+1>>0]|0);e=w;w=c[e>>2]|0;e=c[e+4>>2]|0;v=j;c[v>>2]=w;c[v+4>>2]=e;w=(c[p>>2]|0)+w|0;if(!((((w|0)>-1?w:0-w|0)|0)==1?(w=(c[b+184>>2]|0)+e|0,(((w|0)>-1?w:0-w|0)|0)==1):0)){bK(y,b,66);v=y;y=c[v+4>>2]|0;w=p;c[w>>2]=c[v>>2];c[w+4>>2]=y;bK(x,b,76);w=x;x=c[w+4>>2]|0;y=j;c[y>>2]=c[w>>2];c[y+4>>2]=x;c[z>>2]=c[f>>2];gA(0,100732,z)|0;}if(a[(c[(c[d+16>>2]|0)+8>>2]|0)+82>>0]|0){if(i>g){m=(i-g)*.5;h[G>>3]=m;}else m=0.0;i=+h[r>>3];o=+h[I+8>>3];if(i>o){i=(i-o)*.5;h[G+8>>3]=i;}else i=0.0;}else {i=0.0;m=0.0;}if(!(c[H>>2]|0))j=1;else {c[J>>2]=c[I>>2];c[J+4>>2]=c[I+4>>2];c[J+8>>2]=c[I+8>>2];c[J+12>>2]=c[I+12>>2];aK(A,J);c[I>>2]=c[A>>2];c[I+4>>2]=c[A+4>>2];c[I+8>>2]=c[A+8>>2];c[I+12>>2]=c[A+12>>2];c[J>>2]=c[E>>2];c[J+4>>2]=c[E+4>>2];c[J+8>>2]=c[E+8>>2];c[J+12>>2]=c[E+12>>2];aK(B,J);c[E>>2]=c[B>>2];c[E+4>>2]=c[B+4>>2];c[E+8>>2]=c[B+8>>2];c[E+12>>2]=c[B+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];aK(C,J);c[F>>2]=c[C>>2];c[F+4>>2]=c[C+4>>2];c[F+8>>2]=c[C+8>>2];c[F+12>>2]=c[C+12>>2];c[J>>2]=c[G>>2];c[J+4>>2]=c[G+4>>2];c[J+8>>2]=c[G+8>>2];c[J+12>>2]=c[G+12>>2];aK(D,J);c[G>>2]=c[D>>2];c[G+4>>2]=c[D+4>>2];c[G+8>>2]=c[D+8>>2];c[G+12>>2]=c[D+12>>2];n=+h[F>>3];m=+h[G>>3];k=+h[q>>3];i=+h[G+8>>3];g=+h[I>>3];j=(c[H>>2]|0)==0;}o=m+n;h[b+384>>3]=o;P=i+k;h[b+392>>3]=P;N=m+n+g;h[b+400>>3]=N;Q=+h[I+8>>3];n=i+k+Q;h[b+408>>3]=n;m=+h[b+352>>3];h[b+320>>3]=g/m;h[b+328>>3]=Q/m;m=+h[s>>3];o=o*.013888888888888888*m;f=b+456|0;c[f>>2]=~~(o+(o>=0.0?.5:-.5));o=+h[t>>3];k=P*.013888888888888888*o;c[b+460>>2]=~~(k+(k>=0.0?.5:-.5));m=N*.013888888888888888*m;e=b+464|0;c[e>>2]=~~(m+(m>=0.0?.5:-.5));o=n*.013888888888888888*o;c[b+468>>2]=~~(o+(o>=0.0?.5:-.5));if(!j){c[J>>2]=c[f>>2];c[J+4>>2]=c[f+4>>2];NJ(K,J);I=K;K=c[I+4>>2]|0;b=f;c[b>>2]=c[I>>2];c[b+4>>2]=K;c[J>>2]=c[e>>2];c[J+4>>2]=c[e+4>>2];NJ(L,J);b=L;K=c[b+4>>2]|0;L=e;c[L>>2]=c[b>>2];c[L+4>>2]=K;}l=M;return}function aK(a,b){a=a|0;b=b|0;var c=0.0;c=+h[b>>3];h[a>>3]=+h[b+8>>3];h[a+8>>3]=c;return}function bK(a,b,d){a=a|0;b=b|0;d=d|0;d=(d<<24>>24)+-66|0;switch(d>>>1|d<<31|0){case 9:{c[b+176>>2]=(c[b+168>>2]|0)+-1;b=0;d=-1;break}case 0:{b=0;d=1;break}case 5:{b=1;d=0;break}case 8:{c[b+172>>2]=(c[b+164>>2]|0)+-1;b=-1;d=0;break}default:{b=0;d=0;}}c[a>>2]=b;c[a+4>>2]=d;return}function cK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;f=QA(d,100973)|0;i=b+296|0;c[i>>2]=(f|0)==0?100982:f;d=QA(d,100986)|0;f=b+300|0;d=(d|0)==0?100999:d;c[f>>2]=d;d=G4(c[i>>2]|0,d)|0;if(d|0){c[g>>2]=a[d>>0];gA(0,101001,g)|0;c[f>>2]=195059;}d=D4(e)|0;c[b+304>>2]=d;h=b+308|0;f=0;b=0;while(1){e=A4(d,c[i>>2]|0)|0;if(!e)break;g=b+1|0;if((b|0)<(f|0))d=c[h>>2]|0;else {f=f+128|0;d=c[h>>2]|0;if(!d)d=KK(f<<2)|0;else d=MK(d,f<<2)|0;c[h>>2]=d;}c[d+(g<<2)>>2]=e;b=g;d=0;}if(b|0){i=MK(c[h>>2]|0,(b<<2)+8|0)|0;c[h>>2]=i;c[i>>2]=0;c[(c[h>>2]|0)+(b+1<<2)>>2]=0;}l=j;return b|0}function dK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k;i=a+312|0;d=KK((c[i>>2]<<2)+8|0)|0;e=0;h=1;while(1){g=c[i>>2]|0;if((h|0)>(g|0))break;f=e+1|0;if((uJ(a,h,g,b)|0)<<24>>24){c[d+(f<<2)>>2]=h;e=f;}h=h+1|0;}if(!e){c[j>>2]=b;gA(0,100872,j)|0;U1(d);d=0;}else {c[d>>2]=e;c[d+(e+1<<2)>>2]=(c[i>>2]|0)+1;}l=k;return d|0}function eK(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0;d=c[b+16>>2]|0;g=+h[d+16>>3];h[d+48>>3]=g-+h[d+88>>3];e=+h[d+24>>3];f=+h[d+80>>3]*.5;h[d+56>>3]=e-f;h[d+64>>3]=+h[d+96>>3]+g;h[d+72>>3]=f+e;b=XA(a,b)|0;while(1){if(!b)break;fK(b);b=ZA(a,b)|0;}return}function fK(a){a=a|0;a=c[(c[a+16>>2]|0)+8>>2]|0;if(a|0)gK(a);return}function gK(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+240|0;v=C+192|0;u=C+176|0;w=C+64|0;x=C+32|0;y=C;z=C+144|0;A=C+112|0;B=a+4|0;if((c[B>>2]|0)<=0)qa(101140,99906,3994,101154);b=c[a>>2]|0;d=w;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));d=v;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));hK(x,v);i=x+8|0;j=y+8|0;k=x+16|0;m=y+16|0;n=x+24|0;o=y+24|0;p=w+8|0;q=w+12|0;r=w+32|0;s=w+4|0;t=w+16|0;g=0;while(1){if((g|0)>=(c[B>>2]|0))break;if((g|0)>0){b=(c[a>>2]|0)+(g*48|0)|0;d=w;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));d=v;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));hK(y,v);h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}b=c[p>>2]|0;if(b|0){f=c[w>>2]|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[v>>2]=c[f>>2];c[v+4>>2]=c[f+4>>2];c[v+8>>2]=c[f+8>>2];c[v+12>>2]=c[f+12>>2];YH(z,u,v,1.0,b);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[y+16>>2]=c[z+16>>2];c[y+20>>2]=c[z+20>>2];c[y+24>>2]=c[z+24>>2];c[y+28>>2]=c[z+28>>2];h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}b=c[q>>2]|0;if(b|0){f=(c[w>>2]|0)+((c[s>>2]|0)+-1<<4)|0;c[u>>2]=c[r>>2];c[u+4>>2]=c[r+4>>2];c[u+8>>2]=c[r+8>>2];c[u+12>>2]=c[r+12>>2];c[v>>2]=c[f>>2];c[v+4>>2]=c[f+4>>2];c[v+8>>2]=c[f+8>>2];c[v+12>>2]=c[f+12>>2];YH(A,u,v,1.0,b);c[y>>2]=c[A>>2];c[y+4>>2]=c[A+4>>2];c[y+8>>2]=c[A+8>>2];c[y+12>>2]=c[A+12>>2];c[y+16>>2]=c[A+16>>2];c[y+20>>2]=c[A+20>>2];c[y+24>>2]=c[A+24>>2];c[y+28>>2]=c[A+28>>2];h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}g=g+1|0;}B=a+8|0;c[B>>2]=c[x>>2];c[B+4>>2]=c[x+4>>2];c[B+8>>2]=c[x+8>>2];c[B+12>>2]=c[x+12>>2];c[B+16>>2]=c[x+16>>2];c[B+20>>2]=c[x+20>>2];c[B+24>>2]=c[x+24>>2];c[B+28>>2]=c[x+28>>2];l=C;return}function hK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0;n=l;l=l+48|0;i=n+32|0;j=n;k=c[b+4>>2]|0;if((k|0)<=0)qa(101170,99906,3968,101182);if(((k>>>0)%3|0|0)!=1)qa(101192,99906,3969,101182);m=j+16|0;d=c[b>>2]|0;c[m>>2]=c[d>>2];c[m+4>>2]=c[d+4>>2];c[m+8>>2]=c[d+8>>2];c[m+12>>2]=c[d+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];e=i+8|0;f=j+8|0;g=j+24|0;b=1;while(1){if((b|0)>=(k|0))break;p=+h[d+(b<<4)+8>>3];t=b+1|0;o=+h[d+(t<<4)+8>>3];r=(+h[d+(t<<4)>>3]+ +h[d+(b<<4)>>3])*.5;h[i>>3]=r;p=(o+p)*.5;h[e>>3]=p;o=+h[(+h[j>>3]>3];h[j>>3]=o;s=+h[(+h[f>>3]>3];h[f>>3]=s;r=+h[(+h[m>>3]>r?m:i)>>3];h[m>>3]=r;p=+h[(+h[g>>3]>p?m:i)+8>>3];h[g>>3]=p;t=d+(b+2<<4)|0;c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];q=+h[i>>3];h[j>>3]=+h[(o>3];o=+h[e>>3];h[f>>3]=+h[(s>3];h[m>>3]=+h[(r>q?m:i)>>3];h[g>>3]=+h[(p>o?m:i)+8>>3];b=b+3|0;}c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];c[a+16>>2]=c[j+16>>2];c[a+20>>2]=c[j+20>>2];c[a+24>>2]=c[j+24>>2];c[a+28>>2]=c[j+28>>2];l=n;return}function iK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0;q=+h[a>>3];r=+h[c>>3];k=!(q>=r);if((!k?q<=+h[c+16>>3]:0)?(e=+h[a+8>>3],e>=+h[c+8>>3]):0)i=e<=+h[c+24>>3];else i=0;e=+h[b>>3];if((e>=r?e<=+h[c+16>>3]:0)?(f=+h[b+8>>3],f>=+h[c+8>>3]):0){d=f<=+h[c+24>>3];if(!(i^d))if(i&d)d=1;else l=11;else d=0;}else if(i)d=0;else l=11;a:do if((l|0)==11){p=+h[a+8>>3];do if(q==e){r=+h[c+8>>3];if(!(k|p>=r^+h[b+8>>3]>=r^1)?q<=+h[c+16>>3]:0){d=0;break a}}else {j=+h[b+8>>3];if(p==j){if(!(q>=r^e>=r))break;if(!(p>=+h[c+8>>3]))break;if(!(p<=+h[c+24>>3]))break;else {d=0;break a}}o=(j-p)/(e-q);l=q>3];if(!(!(r>=g)|!(r<=e)|!(f>=m))?f<=+h[c+24>>3]:0){d=0;break a}n=+h[c+16>>3];f=(n-r)*o+f;if(f>=m?!(!(n<=e)|(n>=g?!(f<=+h[c+24>>3]):1)):0){d=0;break a}l=p=r?!(!(m<=f)|(!(m>=g)|!(e<=n))):0){d=0;break a}p=+h[c+24>>3];q=(p-m)/o+e;if(q>=r?!(!(p<=f)|(!(p>=g)|!(q<=n))):0){d=0;break a}}while(0);d=-1;}while(0);return d|0}function jK(a){a=a|0;var b=0,c=0.0;b=a+16|0;c=+h[b>>3];h[a+32>>3]=c;h[a+48>>3]=c;h[a+40>>3]=+h[a+24>>3];h[a+56>>3]=+h[a+8>>3];h[b>>3]=+h[a>>3];return}function kK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;if((c[47131]|0)!=(d|0)){N2(+(d|0)*.15915494309189535,186328,186336);c[47131]=d;}g=+h[b>>3];e=+h[23292];f=+h[b+8>>3];i=+h[23291];h[a>>3]=e*g-i*f;h[a+8>>3]=i*g+f*e;return}function lK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;f=k;e=+h[b>>3];i=b+8|0;g=+h[i>>3];a:do switch(d|0){case 0:{j=11;break}case 90:{h[b>>3]=g;e=-e;j=10;break}case 180:{e=-g;j=10;break}case 270:{h[b>>3]=g;j=10;break}default:{if((d|0)<0){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(a,f,0-d|0);break a}if((d|0)>360){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];lK(a,f,(d>>>0)%360|0);break a}else {c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];kK(a,f,d);break a}}}while(0);if((j|0)==10){h[i>>3]=e;j=11;}if((j|0)==11){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}l=k;return}function mK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;f=k;e=+h[b>>3];i=b+8|0;g=+h[i>>3];a:do switch(d|0){case 0:{j=11;break}case 90:{h[b>>3]=-g;j=10;break}case 180:{e=-g;j=10;break}case 270:{h[b>>3]=g;j=10;break}default:{if((d|0)<0){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];lK(a,f,0-d|0);break a}if((d|0)>360){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(a,f,(d>>>0)%360|0);break a}else {c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];kK(a,f,360-d|0);break a}}}while(0);if((j|0)==10){h[i>>3]=e;j=11;}if((j|0)==11){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}l=k;return}function nK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;g=+h[c>>3];d=+h[c+8>>3];f=d+ +h[b>>3];e=g+ +h[b+24>>3];d=d+ +h[b+16>>3];h[a>>3]=g+ +h[b+8>>3];h[a+8>>3]=f;h[a+16>>3]=e;h[a+24>>3]=d;return}function oK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;f=+h[a>>3];d=+h[b>>3]-f;g=+h[a+8>>3];e=+h[b+8>>3]-g;f=(+h[c+8>>3]-g)*d-(+h[c>>3]-f)*e;f=f*f;return +(f<1.0e-10?0.0:f/(e*e+d*d))}function pK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g+8|0;e=g;a=QA(a,b)|0;if(a|0?(c[f>>2]=e,(b5(a,101209,f)|0)>0):0)h[d>>3]=+h[e>>3];l=g;return}function qK(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;g=n+8|0;i=n;e=JK(96)|0;m=b+16|0;c[(c[m>>2]|0)+8>>2]=e;e=QA(b,101213)|0;if(!e){e=Ta(101222)|0;if(e|0)k=3;}else k=3;if((k|0)==3)cb(101234,e|0,1)|0;e=(rK(b)|0)&255;a[(c[m>>2]|0)+115>>0]=e;if(0==0?(e=QA(b,101245)|0,c[47133]=e,(e|0)==0):0)c[47133]=c[47132];f=+_O(b,GA(b,0,101255,0)|0,0.0,0.0);h[c[(c[m>>2]|0)+8>>2]>>3]=f;e=QA(b,101263)|0;a:do if(!e)e=0;else {switch(a[e>>0]|0){case 76:{if(!(s2(e,101271)|0)){e=1;break a}break}case 66:{if(!(s2(e,101274)|0)){e=2;break a}break}case 82:{e=(s2(e,101277)|0)==0;e=e?3:0;break a}default:{e=0;break a}}e=0;}while(0);c[(c[m>>2]|0)+116>>2]=e<<2|(d<<24>>24==0?0:e);f=+_O(b,GA(b,0,101280,0)|0,.25,.02);h[i>>3]=f;f=f*72.0;c[(c[m>>2]|0)+248>>2]=~~(f+(f>=0.0?.5:-.5));e=aP(b,GA(b,0,101288,0)|0,0)|0;if(e){c[g>>2]=i;if(b5(e,101209,g)|0){f=+h[i>>3];if(f<.02){h[i>>3]=.02;f=.02;}}else {h[i>>3]=.5;f=.5;}if(d4(e,101296)|0)a[(c[m>>2]|0)+276>>0]=1;}else {h[i>>3]=.5;f=.5;}f=f*72.0;c[(c[m>>2]|0)+252>>2]=~~(f+(f>=0.0?.5:-.5));i=(ZO(b,GA(b,0,101304,0)|0,0,0)|0)&255;a[(c[m>>2]|0)+243>>0]=i;i=pP(aP(b,GA(b,0,101314,0)|0,0)|0,20676,20692)|0;c[(c[m>>2]|0)+244>>2]=i;sK(b);i=tK(b,101324,(c[(c[m>>2]|0)+8>>2]|0)+64|0)|0;e=c[(c[m>>2]|0)+8>>2]|0;a[e+80>>0]=i;tK(b,101329,e+48|0)|0;e=dP(QA(b,101334)|0)|0;a[(c[(c[m>>2]|0)+8>>2]|0)+82>>0]=e;e=QA(b,101341)|0;do if(!e){e=QA(b,101348)|0;if(e|0){e=(a[e>>0]|32)<<24>>24==108&1;k=27;break}e=QA(b,101360)|0;if(e|0){e=dP(e)|0;k=27;}}else {e=(q5(e)|0)==90&1;k=27;}while(0);if((k|0)==27)a[(c[(c[m>>2]|0)+8>>2]|0)+81>>0]=e;c[47135]=pP(QA(b,101370)|0,20708,20724)|0;a[194954]=dP(QA(b,101382)|0)|0;c[47138]=0;c[47139]=0;h[(c[(c[m>>2]|0)+8>>2]|0)+24>>3]=0.0;e=QA(b,101394)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0)k=32;else k=30;if(((k|0)==30?(j=QA(b,101398)|0,j|0):0)?a[j>>0]|0:0){e=j;k=32;}if((k|0)==32){f=+r5(e);h[(c[(c[m>>2]|0)+8>>2]|0)+24>>3]=f;}uK(b);h[23295]=1.e+37;c[47140]=GA(b,0,101409,0)|0;c[47143]=GA(b,0,141034,0)|0;c[47144]=GA(b,0,105496,0)|0;c[47145]=GA(b,1,141048,0)|0;c[47146]=GA(b,1,141116,0)|0;c[47147]=GA(b,1,108230,0)|0;c[47148]=GA(b,1,140823,0)|0;c[47149]=GA(b,1,101418,0)|0;c[47157]=GA(b,1,141082,0)|0;c[47150]=GA(b,1,101428,0)|0;c[47151]=GA(b,1,101437,0)|0;c[47152]=GA(b,1,101446,0)|0;k=GA(b,1,108224,0)|0;c[47154]=k;if(!k)c[47154]=GA(b,1,108224,105493)|0;c[47155]=GA(b,1,101456,0)|0;c[47158]=GA(b,1,101304,0)|0;c[47172]=GA(b,1,101463,0)|0;c[47161]=GA(b,1,101409,0)|0;c[47153]=GA(b,1,105496,0)|0;c[47159]=GA(b,1,141076,0)|0;c[47160]=GA(b,1,101472,0)|0;c[47163]=GA(b,1,101484,0)|0;c[47162]=GA(b,1,101348,0)|0;c[47164]=GA(b,1,101489,0)|0;c[47165]=GA(b,1,141024,0)|0;c[47166]=GA(b,1,137297,0)|0;c[47156]=GA(b,1,101500,0)|0;c[47167]=GA(b,1,101510,0)|0;c[47168]=GA(b,1,101516,0)|0;c[47169]=GA(b,1,101522,0)|0;c[47170]=GA(b,1,101530,0)|0;c[47171]=GA(b,1,101539,0)|0;c[47173]=GA(b,1,141034,0)|0;c[47174]=GA(b,2,101541,0)|0;c[47176]=GA(b,2,140823,0)|0;c[47177]=GA(b,2,101418,0)|0;c[47179]=GA(b,2,101428,0)|0;c[47180]=GA(b,2,101437,0)|0;c[47181]=GA(b,2,101446,0)|0;c[47182]=GA(b,2,108224,0)|0;c[47183]=GA(b,2,101456,0)|0;c[47192]=GA(b,2,101548,0)|0;c[47184]=GA(b,2,101559,0)|0;c[47195]=GA(b,2,101563,0)|0;c[47196]=GA(b,2,101573,0)|0;c[47197]=GA(b,2,101583,0)|0;c[47198]=GA(b,2,101593,0)|0;c[47199]=GA(b,2,101603,0)|0;c[47200]=GA(b,2,101617,0)|0;c[47201]=GA(b,2,101631,0)|0;c[47202]=GA(b,2,101646,0)|0;c[47203]=GA(b,2,101660,0)|0;c[47175]=GA(b,2,101671,0)|0;c[47187]=GA(b,2,101304,0)|0;c[47185]=GA(b,2,141082,0)|0;c[47186]=GA(b,2,101678,0)|0;c[47188]=GA(b,2,101687,0)|0;c[47189]=GA(b,2,101697,0)|0;c[47190]=GA(b,2,101510,0)|0;c[47191]=GA(b,2,101522,0)|0;c[47204]=GA(b,2,101708,0)|0;c[47205]=GA(b,2,101717,0)|0;c[47206]=GA(b,2,101463,0)|0;e=$H(b)|0;c[(c[(c[m>>2]|0)+8>>2]|0)+88>>2]=e;e=QA(b,141060)|0;if(e|0?a[e>>0]|0:0){b=EK(e,b)|0;c[(c[(c[m>>2]|0)+8>>2]|0)+92>>2]=b;}l=n;return}function rK(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;a=bP(a,GA(a,0,101807,0)|0,101815)|0;if(((((((c3(a,101821)|0)!=0?(c3(a,101829)|0)!=0:0)?(c3(a,101836)|0)!=0:0)?(c3(a,101839)|0)!=0:0)?(c3(a,101850)|0)!=0:0)?(c3(a,101861)|0)!=0:0)?(c3(a,101871)|0)!=0:0)if((c3(a,101882)|0)!=0?(c3(a,101888)|0)!=0:0)if((c3(a,101815)|0)!=0?(c3(a,101893)|0)!=0:0){c[b>>2]=a;gA(0,101898,b)|0;a=0;}else a=0;else a=2;else a=1;l=d;return a|0}function sK(b){b=b|0;var d=0.0,e=0,f=0;e=QA(b,101765)|0;a:do if(e|0?(f=a[e>>0]|0,f<<24>>24):0)switch(f<<24>>24|0){case 97:{if(f<<24>>24!=97)break a;if(s2(e,101771)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=4;break a}case 99:{if(f<<24>>24!=99)break a;if(s2(e,101776)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=3;break a}case 101:{if(f<<24>>24!=101)break a;if(s2(e,101785)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=5;break a}case 102:{if(f<<24>>24!=102)break a;if(s2(e,101792)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=2;break a}default:{d=+r5(e);if(!(d>0.0))break a;b=c[(c[b+16>>2]|0)+8>>2]|0;c[b+84>>2]=1;h[b+16>>3]=d;break a}}while(0);return}function tK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+48|0;m=o+32|0;i=o+16|0;k=o+8|0;j=o;n=o+40|0;a[n>>0]=0;b=QA(b,d)|0;do if(b){c[i>>2]=k;c[i+4>>2]=j;c[i+8>>2]=n;i=(b5(b,101749,i)|0)>1;g=+h[k>>3];f=+h[j>>3];if(i&g>0.0&f>0.0){g=g*72.0;h[e>>3]=+(~~(g+(g>=0.0?.5:-.5))|0);g=f*72.0;h[e+8>>3]=+(~~(g+(g>=0.0?.5:-.5))|0);b=(a[n>>0]|0)==33;break}a[n>>0]=0;c[m>>2]=k;c[m+4>>2]=n;m=(b5(b,101759,m)|0)>0;f=+h[k>>3];if(m&f>0.0){g=f*72.0;g=+(~~(g+(g>=0.0?.5:-.5))|0);h[e>>3]=g;h[e+8>>3]=g;b=(a[n>>0]|0)==33;}else b=0;}else b=0;while(0);l=o;return b&1|0}function uK(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0;d=QA(b,108224)|0;do if(d|0?a[d>>0]|0:0){e=(c[(c[b+60>>2]|0)+16>>2]|0)+113|0;a[e>>0]=a[e>>0]|8;e=(iD(d)|0)!=0;g=+_O(b,GA(b,0,101428,0)|0,14.0,1.0);i=bP(b,GA(b,0,101437,0)|0,107994)|0;d=zK(b,d,e?2:0,g,i,bP(b,GA(b,0,101446,0)|0,137314)|0)|0;i=b+16|0;c[(c[i>>2]|0)+12>>2]=d;d=QA(b,105628)|0;e=(d|0)!=0;do if((yC(b)|0)==(b|0)){if(e?(a[d>>0]|0)==116:0){d=1;break}d=0;}else {if(e?(a[d>>0]|0)==98:0){d=0;break}d=1;}while(0);e=QA(b,101726)|0;a:do if(e)switch(a[e>>0]|0){case 108:{d=d|2;break a}case 114:{d=d|4;break a}default:break a}while(0);a[(c[i>>2]|0)+275>>0]=d;if((yC(b)|0)!=(b|0)){d=c[(c[i>>2]|0)+12>>2]|0;f=+h[d+24>>3]+16.0;g=+h[d+32>>3]+8.0;b=(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;d=c[i>>2]|0;e=a[d+275>>0]<<1&2;if(b){b=e&255;h[d+48+(b<<4)>>3]=f;h[d+48+(b<<4)+8>>3]=g;break}else {b=(e^3)&255;h[d+48+(b<<4)>>3]=g;h[d+48+(b<<4)+8>>3]=f;break}}}while(0);return}function vK(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;d=c[e>>2]|0;b=c[d+8>>2]|0;do if(!b)b=d;else {d=c[b+88>>2]|0;if(d){EH(d);d=c[e>>2]|0;b=c[d+8>>2]|0;if(!b){b=d;break}}U1(c[b+92>>2]|0);b=c[e>>2]|0;}while(0);U1(c[b+8>>2]|0);e=c[e>>2]|0;c[e+8>>2]=0;CK(c[e+12>>2]|0);ZC(a,0,137483);return}function wK(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;switch(a|0){case 0:{a=101971;break}case 1:{a=101839;break}case 2:{a=101977;break}default:{c[b>>2]=a;gA(1,101941,b)|0;a=101971;}}l=d;return a|0}function xK(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;f=c[d>>2]|0;l=d+24|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;if(a[f>>0]|0){i=KK((l2(f)|0)+1|0)|0;a[i>>0]=0;j=d+12|0;e=i;a:while(1){b:while(1){h=f+1|0;g=a[f>>0]|0;if(!(g<<24>>24))break a;if(!(g<<24>>24==-1|((g&255)<161|(c[j>>2]|0)!=2))){a[e>>0]=g;h=a[h>>0]|0;g=e+2|0;a[e+1>>0]=h;if(!(h<<24>>24)){e=g;break a}else {e=g;f=f+2|0;continue}}switch(g<<24>>24){case 92:break b;case 10:{k=12;break b}default:{}}a[e>>0]=g;e=e+1|0;f=h;}if((k|0)==12){k=0;f=e+1|0;a[e>>0]=0;yK(b,d,i,110);e=f;i=f;f=h;continue}g=a[h>>0]|0;switch(g<<24>>24|0){case 114:case 108:case 110:{g=e+1|0;a[e>>0]=0;yK(b,d,i,a[h>>0]|0);e=g;break}default:{a[e>>0]=g;e=e+1|0;g=i;}}i=g;f=(a[h>>0]|0)==0?h:f+2|0;}if((i|0)!=(e|0)){a[e>>0]=0;yK(b,d,i,110);}d=d+40|0;c[d>>2]=c[l>>2];c[d+4>>2]=c[l+4>>2];c[d+8>>2]=c[l+8>>2];c[d+12>>2]=c[l+12>>2];}return}function yK(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+32|0;q=s+16|0;p=s;r=e+76|0;k=b[r>>1]|0;o=e+72|0;m=c[o>>2]|0;if(!m)n=JK((k*56|0)+112|0)|0;else n=LK(m,k+2|0,56,k+1|0)|0;c[o>>2]=n;k=b[r>>1]|0;m=n+(k*56|0)|0;c[m>>2]=f;a[n+(k*56|0)+48>>0]=g;if((f|0)!=0?(a[f>>0]|0)!=0:0){c[46594]=c[e+4>>2];h[23299]=+h[e+16>>3];g=c[d+144>>2]|0;c[n+(k*56|0)+4>>2]=nb[c[g>>2]&63](g,186376,1)|0;LO(p,d,m);j=+h[p>>3];h[q>>3]=j;i=+h[p+8>>3];}else {h[q>>3]=0.0;i=+(~~(+h[e+16>>3]*1.2)|0);h[n+(k*56|0)+40>>3]=i;j=0.0;}b[r>>1]=(b[r>>1]|0)+1<<16>>16;r=e+24|0;h[r>>3]=+h[(+h[r>>3]>j?r:q)>>3];r=e+32|0;h[r>>3]=+h[r>>3]+i;l=s;return}function zK(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+32|0;r=u+16|0;q=u+8|0;p=u;t=JK(88)|0;switch(IC(b)|0){case 0:{m=0;s=c[b+60>>2]|0;n=b;o=0;break}case 1:{m=0;s=yC(xC(b)|0)|0;n=0;o=b;break}case 2:{m=b;s=yC(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)|0;n=0;o=0;break}default:{m=0;s=0;n=0;o=0;}}c[t+4>>2]=i;c[t+8>>2]=j;h[t+16>>3]=g;k=s+16|0;j=t+12|0;c[j>>2]=d[(c[k>>2]|0)+115>>0];a:do if(f&4){c[t>>2]=D4(e)|0;if(f&2|0)a[t+82>>0]=1;}else switch(f|0){case 2:{c[t>>2]=D4(e)|0;a[t+82>>0]=1;if(!(BU(b,t)|0))break a;switch(IC(b)|0){case 0:{c[p>>2]=KB(n)|0;gA(3,101983,p)|0;break a}case 1:{c[q>>2]=KB(o)|0;gA(3,102005,q)|0;break a}case 2:{p=KB(c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0)|0;q=(xB(s)|0)!=0;s=KB(c[((c[m>>2]&3|0)==2?m:m+-48|0)+40>>2]|0)|0;c[r>>2]=p;c[r+4>>2]=q?137738:141747;c[r+8>>2]=s;gA(3,102026,r)|0;break a}default:break a}}case 0:{i=AK(e,b,0)|0;c[t>>2]=i;if((c[j>>2]|0)==1)i=eQ(i)|0;else i=bQ(i,s)|0;U1(c[t>>2]|0);c[t>>2]=i;xK(c[(c[k>>2]|0)+144>>2]|0,t);break a}default:qa(102053,102069,166,102078);}while(0);l=u;return t|0}function AK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;switch(IC(d)|0){case 0:{i=KB(d)|0;g=l2(i)|0;f=c[(c[d+16>>2]|0)+12>>2]|0;if(f){f=c[f>>2]|0;if(!b){v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=2;w=f;x=102095;}else {v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=l2(f)|0;w=f;x=102095;}}else {v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}break}case 1:{i=KB(xC(d)|0)|0;g=l2(i)|0;j=KB(d)|0;h=l2(j)|0;f=c[(c[d+16>>2]|0)+104>>2]|0;if(f){f=c[f>>2]|0;if(!b){v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=2;w=f;x=102095;}else {v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=l2(f)|0;w=f;x=102095;}}else {v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}break}case 2:{h=d+48|0;i=KB(yC(xC(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0)|0)|0;g=l2(i)|0;l=KB(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0;k=l2(l)|0;f=d+16|0;q=c[(c[f>>2]|0)+52>>2]|0;if(!q)r=0;else r=l2(q)|0;m=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;f=c[f>>2]|0;o=c[f+92>>2]|0;if(!o)p=0;else p=l2(o)|0;j=l2(m)|0;f=c[f+96>>2]|0;if(f){f=c[f>>2]|0;if(!b)n=2;else n=l2(f)|0;}else {n=2;f=102089;}x=(xB(yC(xC(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0)|0)|0)==0;v=1;t=k;u=j;s=k+2+(r|0?r+1|0:0)+j+(p|0?p+1|0:0)|0;h=2;y=l;j=105493;w=f;x=x?141747:137738;break}default:{v=0;t=2;u=2;s=2;h=2;g=2;y=102101;m=102098;j=105493;i=102092;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}}e=(e|0)==0;l=0;f=b;a:while(1){d=f+1|0;b:do switch(a[f>>0]|0){case 0:break a;case 92:{f=f+2|0;switch(a[d>>0]|0){case 78:{k=h;break b}case 71:{k=g;break b}case 69:{k=s;break b}case 72:{k=u;break b}case 84:{k=t;break b}case 76:{k=n;break b}case 92:{if(!e){k=1;break b}break}default:{}}k=2;break}default:{k=1;f=d;}}while(0);l=l+k|0;}s=KK(l+1|0)|0;n=(v|0)==0;l=(r|0)==0;d=(p|0)==0;f=s;g=b;c:while(1){k=g+1|0;h=a[g>>0]|0;switch(h<<24>>24){case 0:break c;case 92:break;default:{a[f>>0]=h;f=f+1|0;g=k;continue c}}h=g+2|0;g=a[k>>0]|0;switch(g<<24>>24|0){case 71:{g=i;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 78:{g=j;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 69:{if(n){g=h;continue c}else g=y;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24))break;g=g+1|0;f=f+1|0;}if(l)g=x;else {a[f>>0]=58;g=q;while(1){f=f+1|0;b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=x;break}else g=g+1|0;}}while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=m;break}g=g+1|0;f=f+1|0;}while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24))break;g=g+1|0;f=f+1|0;}if(d){g=h;continue c}a[f>>0]=58;g=o;while(1){f=f+1|0;b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}else g=g+1|0;}}case 84:{g=y;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 72:{g=m;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}f=f+1|0;g=g+1|0;}}case 76:{g=w;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}f=f+1|0;g=g+1|0;}}case 92:{if(!e){a[f>>0]=92;f=f+1|0;g=h;continue c}break}default:{}}a[f>>0]=92;a[f+1>>0]=g;f=f+2|0;g=h;}a[f>>0]=0;return s|0}function BK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(a|0){d=a;e=0;while(1){if((e|0)>=(b|0))break;if(!e)U1(c[d>>2]|0);g=c[d+8>>2]|0;if(g|0?(f=c[d+12>>2]|0,f|0):0)tb[f&127](g);d=d+56|0;e=e+1|0;}U1(a);}return}function CK(d){d=d|0;var e=0;if(d|0){U1(c[d>>2]|0);e=d+72|0;if(a[d+82>>0]|0){e=c[e>>2]|0;if(e|0)mU(e,1);}else BK(c[e>>2]|0,b[d+76>>1]|0);U1(d);}return}function DK(d,e,f){d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+32|0;q=u+16|0;r=u;k=c[d+16>>2]|0;s=k+12|0;t=c[s>>2]|0;c[s>>2]=e;if(!(a[f+82>>0]|0)){p=f+76|0;if((b[p>>1]|0)>=1){eS(d,0);hS(d,c[f+8>>2]|0);switch(a[f+80>>0]|0){case 116:{j=+h[f+64>>3];g=+h[f+48>>3]*.5+j;break}case 98:{j=+h[f+64>>3];g=+h[f+48>>3]*-.5+j+ +h[f+32>>3];break}default:{j=+h[f+64>>3];g=+h[f+32>>3]*.5+j;}}g=g-+h[f+16>>3];o=r+8|0;h[o>>3]=g;if(b[k+260>>1]&512)h[o>>3]=g-j;m=f+72|0;n=f+56|0;i=f+40|0;e=0;while(1){if((e|0)>=(b[p>>1]|0))break;k=c[m>>2]|0;switch(a[k+(e*56|0)+48>>0]|0){case 108:{g=+h[n>>3]-+h[i>>3]*.5;break}case 114:{g=+h[i>>3]*.5+ +h[n>>3];break}default:g=+h[n>>3];}h[r>>3]=g;c[q>>2]=c[r>>2];c[q+4>>2]=c[r+4>>2];c[q+8>>2]=c[r+8>>2];c[q+12>>2]=c[r+12>>2];gS(d,q,k+(e*56|0)|0);h[o>>3]=+h[o>>3]-+h[(c[m>>2]|0)+(e*56|0)+40>>3];e=e+1|0;}fS(d);i=18;}}else {TT(d,c[f+72>>2]|0,f);i=18;}if((i|0)==18)c[s>>2]=t;l=u;return}function EK(a,b){a=a|0;b=b|0;return AK(a,b,1)|0}function FK(a){a=a|0;return GK(a,0)|0}function GK(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[47207]|0;if(!e){c[47208]=64;e=KK(64)|0;c[47207]=e;}j=d<<24>>24==0;i=0;f=0;h=b;while(1){if(!h)break;d=a[h>>0]|0;if(!(d<<24>>24))break;b=c[47208]|0;if((i|0)>(b+-8|0)){e=b<<1;c[47208]=e;e=MK(c[47207]|0,e)|0;c[47207]=e;e=e+i|0;d=a[h>>0]|0;}a:do switch(d<<24>>24){case 38:{if(j?(HK(h)|0)!=0:0)k=18;else {f=5;d=102130;}break}case 60:{f=4;d=102153;break}case 62:{f=4;d=102136;break}case 45:{f=5;d=102147;break}default:{if((f|0)!=0&d<<24>>24==32)if((a[f>>0]|0)==32){f=6;d=102123;break a}else {k=18;break a}switch(d<<24>>24){case 34:{f=6;d=102116;break a}case 39:{f=5;d=102141;break a}case 10:if(j){k=18;break a}else {f=5;d=102110;break a}default:{k=18;break a}}}}while(0);if((k|0)==18){k=0;d=j|d<<24>>24!=13;f=d?1:5;d=d?h:102104;}g=e+f|0;b=f;while(1){if(!b)break;a[e>>0]=a[d>>0]|0;b=b+-1|0;d=d+1|0;e=e+1|0;}b=h;i=f+i|0;e=g;h=h+1|0;f=b;}a[e>>0]=0;return c[47207]|0}function HK(b){b=b|0;var c=0,d=0;d=b+1|0;c=a[d>>0]|0;a:do if(c<<24>>24==35){d=b+2|0;c=a[d>>0]|0;switch(c<<24>>24){case 88:case 120:break;default:{b=d;while(1){d=b+1|0;if((c+-48&255)>=10)break a;b=d;c=a[d>>0]|0;}}}d=b+3|0;while(1){c=a[d>>0]|0;if((c+-48&255)>=10)switch(c<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:break a}d=d+1|0;}}else while(1){b=d+1|0;if(((c&-33)+-65&255)>=26)break a;d=b;c=a[b>>0]|0;}while(0);return c<<24>>24==59|0}function IK(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=c[47209]|0;if(!d){c[47210]=64;d=KK(64)|0;c[47209]=d;i=0;}else i=0;while(1){if(!b)break;e=a[b>>0]|0;if(!(e<<24>>24))break;f=c[47210]|0;if((i|0)>(f+-8|0)){d=f<<1;c[47210]=d;d=MK(c[47209]|0,d)|0;c[47209]=d;d=d+i|0;e=a[b>>0]|0;}switch(e<<24>>24){case 38:{if(!(HK(b)|0)){g=5;e=102130;}else j=12;break}case 60:{g=4;e=102153;break}case 62:{g=4;e=102136;break}case 34:{g=6;e=102116;break}case 39:{g=5;e=102141;break}default:j=12;}if((j|0)==12){j=0;g=1;e=b;}h=d+g|0;f=g;while(1){if(!f)break;a[d>>0]=a[e>>0]|0;f=f+-1|0;e=e+1|0;d=d+1|0;}i=g+i|0;d=h;b=b+1|0;}a[d>>0]=0;return c[47209]|0}function JK(a){a=a|0;var b=0;if(!a)a=0;else {b=KK(a)|0;Y6(b|0,0,a|0)|0;a=b;}return a|0}function KK(a){a=a|0;if(a){a=T1(a)|0;if(!a){U4(111740,14,1,c[15712]|0)|0;a=0;}}else a=0;return a|0}function LK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=W1(a,O(d,b)|0)|0;if(!((b|0)!=0&(a|0)==0)){if(b>>>0>e>>>0)Y6(a+(O(e,d)|0)|0,0,O(b-e|0,d)|0)|0;}else U4(111740,14,1,c[15712]|0)|0;return a|0}function MK(a,b){a=a|0;b=b|0;a=W1(a,b)|0;if((b|0)!=0&(a|0)==0)U4(111740,14,1,c[15712]|0)|0;return a|0}function NK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0,n=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+80|0;r=u+40|0;q=u+32|0;n=u+24|0;m=u;s=4;t=T1(40)|0;c[t>>2]=0;f=u+68|0;g=u+64|0;if(0);else j=6;do if((j|0)==6){o=0;f=$(27,a|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)!=1){if(!f){o=0;ha(2);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}}if((d|0)<1){o=0;ha(3);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}f=0;break}else {c[47211]=(e|0)>-1?e:30;t=U6(188848,1,t|0,s|0)|0;s=z;o=0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}f=0;j=15;break}}else {f=z;j=15;}}while(0);a:do if((j|0)==15){b:while(1){if(f|0){f=2;break a}o=0;ha(4);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue}a=c[15712]|0;m=0;while(1){o=0;j=_(2)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}if(!j)break;o=0;f=$(28,j|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){f=z;j=15;continue b}o=0;ja(25,j|0,f|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}m=m+1|0;do if(((m|0)%100|0|0)==0&0!=0){f=(m|0)%1e3|0;if((f|0)==100){o=0;aa(93,102202,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}o=0;c[n>>2]=m;ca(32,a|0,102220,n|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}o=0;c[q>>2]=m;ca(32,a|0,102220,q|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){f=z;j=15;continue b}if(!f){o=0;aa(94,10,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}}}while(0);if((m|0)>=(d|0))break}switch(b|0){case 1:{o=0;ha(5);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}case 2:{o=0;ha(6);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}default:{o=0;ha(7);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}o=0;ha(3);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}}}if(!0){f=0;break a}if((m|0)>99){o=0;aa(94,10,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue}}f=c[47251]|0;g=c[47252]|0;o=0;k=+X(1);i=o;o=0;if((i|0)!=0&(p|0)!=0){j=V6(c[i>>2]|0,t|0,s|0)|0;if(!j)bb(i|0,p|0);z=p;}else j=-1;if((j|0)==1){f=z;j=15;continue}o=0;c[r>>2]=102202;c[r+4>>2]=f;c[r+8>>2]=g;c[r+12>>2]=m;h[r+16>>3]=k;ca(32,a|0,102224,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;}else break}f=0;}while(0);U1(t|0);l=u;return f|0}function OK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;a=(c[a+16>>2]|0)+192|0;e=0;h=0;while(1){a=c[a>>2]|0;if(!a)break;g=c[a+16>>2]|0;f=c[g+180>>2]|0;a=0;while(1){if(!(c[f+(a<<2)>>2]|0))break;a=a+1|0;e=e+1|0;}a=g+164|0;h=h+1|0;}c[b>>2]=h;c[d>>2]=e;return}function PK(b){b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;c[47254]=b;c[47261]=0;c[47252]=0;c[47251]=0;i=b+16|0;b=(c[i>>2]|0)+192|0;h=0;f=0;while(1){b=c[b>>2]|0;if(!b)break;g=c[b+16>>2]|0;a[g+157>>0]=0;h=h+1|0;c[47251]=h;d=c[g+180>>2]|0;b=0;while(1){if(!(c[d+(b<<2)>>2]|0))break;k=f+1|0;c[47252]=k;b=b+1|0;f=k;}b=g+164|0;}b=c[47262]|0;if(!b)b=KK(h<<2)|0;else b=MK(b,h<<2)|0;c[47262]=b;c[47263]=0;b=c[47256]|0;if(!b)b=KK(c[47251]<<2)|0;else b=MK(b,c[47251]<<2)|0;c[47256]=b;c[47255]=0;d=1;b=(c[i>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;k=b+16|0;i=c[k>>2]|0;j=i+292|0;c[j>>2]=0;i=c[i+172>>2]|0;h=d;g=0;b=0;while(1){d=c[i+(g<<2)>>2]|0;if(!d)break;f=b+1|0;c[j>>2]=f;b=c[d+16>>2]|0;c[b+160>>2]=0;c[b+164>>2]=-1;if(!h)b=0;else {l=c[d>>2]&3;b=((c[(c[(c[((l|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((l|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)<(e[b+170>>1]|0|0)?0:h;}h=b;g=g+1|0;b=f;}b=JK((g<<2)+4|0)|0;d=c[k>>2]|0;c[d+264>>2]=b;c[d+268>>2]=0;d=c[d+180>>2]|0;b=0;do{l=b;b=b+1|0;}while((c[d+(l<<2)>>2]|0)!=0);d=JK(b<<2)|0;b=c[k>>2]|0;c[b+272>>2]=d;c[b+276>>2]=0;d=h;b=b+164|0;}return d|0}function QK(){var a=0,b=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;k=o;m=VO(c[47251]|0)|0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b){j=0;break}d=b+16|0;a=c[d>>2]|0;if(!(c[a+292>>2]|0)){XO(m,b);a=c[d>>2]|0;}a=a+164|0;}while(1){a=YO(m)|0;if(!a)break;i=a+16|0;a=c[i>>2]|0;f=a+232|0;c[f>>2]=0;d=c[a+172>>2]|0;b=0;h=0;while(1){g=c[d+(b<<2)>>2]|0;if(!g){f=0;break}g=(c[(c[(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)+(e[(c[g+16>>2]|0)+170>>1]|0)|0;g=(h|0)>(g|0)?h:g;c[f>>2]=g;b=b+1|0;h=g;}while(1){b=c[(c[a+180>>2]|0)+(f<<2)>>2]|0;if(!b)break;d=b+-48|0;g=(c[(c[((c[b>>2]&3|0)==2?b:d)+40>>2]|0)+16>>2]|0)+292|0;h=c[g>>2]|0;c[g>>2]=h+-1;if((h|0)<2){XO(m,c[((c[b>>2]&3|0)==2?b:d)+40>>2]|0);a=c[i>>2]|0;}f=f+1|0;}j=j+1|0;}a:do if((j|0)!=(c[47251]|0)){gA(1,102556,k)|0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b)break a;d=b+16|0;a=c[d>>2]|0;if(c[a+292>>2]|0){k=KB(b)|0;a=c[(c[d>>2]|0)+292>>2]|0;c[n>>2]=k;c[n+4>>2]=a;gA(3,102578,n)|0;a=c[d>>2]|0;}a=a+164|0;}}while(0);WO(m);l=o;return}function RK(){var b=0,d=0,e=0;b=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;e=b+16|0;b=c[e>>2]|0;d=c[b+264>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+272>>2]|0;if(d){U1(d);b=c[e>>2]|0;}a[b+157>>0]=0;b=b+164|0;}return}function SK(){var a=0,b=0,d=0,e=0,f=0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if(!a)break;a=c[a+16>>2]|0;c[a+280>>2]=0;a=a+164|0;}f=JK(c[47251]<<2)|0;e=0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b)break;d=b+16|0;a=c[d>>2]|0;if(!(c[a+280>>2]|0)){c[f+(e<<2)>>2]=dL(b)|0;b=e+1|0;a=c[d>>2]|0;}else b=e;e=b;a=a+164|0;}a=eL(f,e)|0;while(1){if((fL(a)|0)<=1)break;jL(a,c[(iL(hL(gL(a)|0)|0)|0)+8>>2]|0);}U1(a);a=0;while(1){if((a|0)>=(e|0))break;U1(c[f+(a<<2)>>2]|0);a=a+1|0;}U1(f);if((c[47255]|0)==((c[47251]|0)+-1|0)){kL();return}else qa(102301,102331,523,102336);}function TK(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=c[47261]|0;f=c[47255]|0;j=c[47256]|0;k=c[47211]|0;b=0;a=0;g=i;while(1){if((g|0)>=(f|0)){h=8;break}e=c[j+(g<<2)>>2]|0;d=c[(c[e+16>>2]|0)+160>>2]|0;if((d|0)<0){if(!a)a=e;else a=(c[(c[a+16>>2]|0)+160>>2]|0)>(d|0)?e:a;b=b+1|0;if((b|0)>=(k|0))break}e=g+1|0;c[47261]=e;g=e;}if((h|0)==8)if((i|0)>0){f=0;while(1){if((f|0)>=(i|0))break;d=c[j+(f<<2)>>2]|0;e=c[(c[d+16>>2]|0)+160>>2]|0;if((e|0)<0){if(!a)a=d;else a=(c[(c[a+16>>2]|0)+160>>2]|0)>(e|0)?d:a;b=b+1|0;if((b|0)>=(k|0))break}f=f+1|0;}c[47261]=f;}return a|0}function UK(a){a=a|0;var b=0,d=0;b=c[a>>2]&3;d=c[((b|0)==3?a:a+48|0)+40>>2]|0;a=c[((b|0)==2?a:a+-48|0)+40>>2]|0;b=(c[(c[d+16>>2]|0)+288>>2]|0)<(c[(c[a+16>>2]|0)+288>>2]|0);a=b?d:a;c[47257]=0;c[47258]=2147483647;d=c[a+16>>2]|0;c[47259]=c[d+284>>2];c[47260]=c[d+288>>2];if(b)cL(a);else bL(a);return c[47257]|0}function VK(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;g=c[b>>2]&3;m=b+-48|0;j=b+48|0;k=b+16|0;g=(c[(c[(c[((g|0)==2?b:m)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((g|0)==3?b:j)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[k>>2]|0)+170>>1]|0)|0;do if((g|0)>0){d=c[a>>2]&3;h=c[((d|0)==3?a:a+48|0)+40>>2]|0;i=c[h+16>>2]|0;if(((c[i+276>>2]|0)+(c[i+268>>2]|0)|0)==1){ZK(h,g);break}d=c[((d|0)==2?a:a+-48|0)+40>>2]|0;f=c[d+16>>2]|0;if(((c[f+276>>2]|0)+(c[f+268>>2]|0)|0)==1){ZK(d,0-g|0);break}if((c[i+288>>2]|0)<(c[f+288>>2]|0)){ZK(h,g);break}else {ZK(d,0-g|0);break}}while(0);d=a+16|0;f=c[(c[d>>2]|0)+160>>2]|0;g=c[b>>2]&3;g=_K(c[((g|0)==3?b:j)+40>>2]|0,c[((g|0)==2?b:m)+40>>2]|0,f,1)|0;i=c[b>>2]&3;if((_K(c[((i|0)==2?b:m)+40>>2]|0,c[((i|0)==3?b:j)+40>>2]|0,f,0)|0)==(g|0)){c[(c[k>>2]|0)+160>>2]=0-f;c[(c[d>>2]|0)+160>>2]=0;$K(a,b);n=c[g+16>>2]|0;aL(g,c[n+280>>2]|0,c[n+284>>2]|0)|0;l=o;return}else {gA(1,102262,n)|0;bb(188848,1);}}function WK(){var b=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;YK();m=JK((c[47253]<<2)+4|0)|0;d=c[47253]|0;b=0;while(1){if((b|0)>(d|0))break;c[m+(b<<2)>>2]=0;b=b+1|0;}b=(c[(c[47254]|0)+16>>2]|0)+192|0;d=b;while(1){d=c[d>>2]|0;if(!d)break;d=c[d+16>>2]|0;if(!(a[d+156>>0]|0)){l=m+(c[d+232>>2]<<2)|0;c[l>>2]=(c[l>>2]|0)+1;}d=d+164|0;}while(1){b=c[b>>2]|0;if(!b)break;l=b+16|0;b=c[l>>2]|0;if(!(a[b+156>>0]|0)){h=c[47253]|0;f=c[b+172>>2]|0;k=0;j=0;d=0;while(1){g=c[f+(d<<2)>>2]|0;if(!g)break;n=c[g+16>>2]|0;i=(c[(c[(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)+(e[n+170>>1]|0)|0;k=(c[n+156>>2]|0)+k|0;j=(j|0)>(i|0)?j:i;d=d+1|0;}g=c[b+180>>2]|0;i=0;d=0;while(1){f=c[g+(d<<2)>>2]|0;if(!f)break;o=c[f+16>>2]|0;n=(c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[o+170>>1]|0)|0;i=(c[o+156>>2]|0)+i|0;h=(h|0)<(n|0)?h:n;d=d+1|0;}d=(j|0)>0?j:0;if((k|0)==(i|0)){g=d;f=d;while(1){d=f+1|0;if((f|0)>=(h|0))break;g=(c[m+(d<<2)>>2]|0)<(c[m+(g<<2)>>2]|0)?d:g;f=d;}o=b+232|0;n=m+(c[o>>2]<<2)|0;c[n>>2]=(c[n>>2]|0)+-1;n=m+(g<<2)|0;c[n>>2]=(c[n>>2]|0)+1;c[o>>2]=g;}d=c[b+264>>2]|0;if(d){U1(d);b=c[l>>2]|0;}d=c[b+272>>2]|0;if(d){U1(d);b=c[l>>2]|0;}a[b+157>>0]=0;}b=b+164|0;}U1(m);return}function XK(){var a=0,b=0,d=0,f=0,g=0,h=0;b=0;while(1){if((b|0)>=(c[47255]|0))break;a=c[(c[47256]|0)+(b<<2)>>2]|0;do if(((c[(c[a+16>>2]|0)+160>>2]|0)==0?(d=UK(a)|0,d|0):0)?(f=c[d>>2]&3,f=(c[(c[(c[((f|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((f|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0,(f|0)>=2):0){h=c[a>>2]&3;g=c[((h|0)==3?a:a+48|0)+40>>2]|0;a=c[((h|0)==2?a:a+-48|0)+40>>2]|0;if((c[(c[g+16>>2]|0)+288>>2]|0)<(c[(c[a+16>>2]|0)+288>>2]|0)){ZK(g,f>>>1);break}else {ZK(a,(f|0)/-2|0);break}}while(0);b=b+1|0;}RK();return}function YK(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+16|0;h=i;c[h>>2]=0;c[h>>2]=2147483647;c[47253]=-2147483647;b=(c[(c[47254]|0)+16>>2]|0)+192|0;e=b;g=2147483647;f=-2147483647;while(1){d=c[e>>2]|0;if(!d)break;e=c[d+16>>2]|0;if(!(a[e+156>>0]|0)){j=c[e+232>>2]|0;d=(g|0)<(j|0)?g:j;c[h>>2]=d;f=(f|0)>(j|0)?f:j;c[47253]=f;}else d=g;e=e+164|0;g=d;}if(g|0){while(1){b=c[b>>2]|0;if(!b)break;b=c[b+16>>2]|0;j=b+232|0;c[j>>2]=(c[j>>2]|0)-g;b=b+164|0;}c[47253]=f-g;c[h>>2]=0;}l=i;return}function ZK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+16|0;a=c[f>>2]|0;e=a+232|0;c[e>>2]=(c[e>>2]|0)-b;e=0;while(1){d=c[(c[a+272>>2]|0)+(e<<2)>>2]|0;if(!d){e=0;break}if((d|0)!=(c[a+280>>2]|0)){ZK(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,b);a=c[f>>2]|0;}e=e+1|0;}while(1){d=c[(c[a+264>>2]|0)+(e<<2)>>2]|0;if(!d)break;if((d|0)!=(c[a+280>>2]|0)){ZK(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,b);a=c[f>>2]|0;}e=e+1|0;}return}function _K(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=(e|0)==0&1;h=0-d|0;f=c[(c[b+16>>2]|0)+288>>2]|0;b=a;while(1){a=c[b+16>>2]|0;if((c[a+284>>2]|0)<=(f|0)?(f|0)<=(c[a+288>>2]|0):0)break;a=c[a+280>>2]|0;i=a+48|0;j=(c[a+16>>2]|0)+160|0;c[j>>2]=(((b|0)==(c[((c[a>>2]&3|0)==3?a:i)+40>>2]|0)?e:g)|0?d:h)+(c[j>>2]|0);j=c[a>>2]&3;i=c[((j|0)==3?a:i)+40>>2]|0;a=c[((j|0)==2?a:a+-48|0)+40>>2]|0;b=(c[(c[i+16>>2]|0)+288>>2]|0)>(c[(c[a+16>>2]|0)+288>>2]|0)?i:a;}return b|0}function $K(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=a+16|0;e=(c[i>>2]|0)+164|0;c[(c[b+16>>2]|0)+164>>2]=c[e>>2];c[(c[47256]|0)+(c[e>>2]<<2)>>2]=b;c[(c[i>>2]|0)+164>>2]=-1;i=(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16|0;e=c[i>>2]|0;g=e+276|0;f=c[g>>2]|0;j=f+-1|0;c[g>>2]=j;g=e+272|0;h=0;while(1){if((h|0)>=(f|0)){k=3;break}d=c[g>>2]|0;if((c[d+(h<<2)>>2]|0)==(a|0))break;h=h+1|0;}if((k|0)==3)d=c[e+272>>2]|0;c[d+(h<<2)>>2]=c[d+(j<<2)>>2];c[(c[(c[i>>2]|0)+272>>2]|0)+(j<<2)>>2]=0;i=(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16|0;e=c[i>>2]|0;g=e+268|0;f=c[g>>2]|0;j=f+-1|0;c[g>>2]=j;g=e+264|0;h=0;while(1){if((h|0)>=(f|0)){k=8;break}d=c[g>>2]|0;if((c[d+(h<<2)>>2]|0)==(a|0))break;h=h+1|0;}if((k|0)==8)d=c[e+264>>2]|0;c[d+(h<<2)>>2]=c[d+(j<<2)>>2];c[(c[(c[i>>2]|0)+264>>2]|0)+(j<<2)>>2]=0;k=(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)+16|0;a=c[k>>2]|0;j=c[a+272>>2]|0;a=a+276|0;i=c[a>>2]|0;c[a>>2]=i+1;c[j+(i<<2)>>2]=b;k=c[k>>2]|0;c[(c[k+272>>2]|0)+(c[k+276>>2]<<2)>>2]=0;k=(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)+16|0;i=c[k>>2]|0;j=c[i+264>>2]|0;i=i+268|0;a=c[i>>2]|0;c[i>>2]=a+1;c[j+(a<<2)>>2]=b;k=c[k>>2]|0;c[(c[k+264>>2]|0)+(c[k+268>>2]<<2)>>2]=0;return}function aL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=a+16|0;a=c[g>>2]|0;c[a+280>>2]=b;c[a+284>>2]=d;f=0;while(1){e=c[(c[a+272>>2]|0)+(f<<2)>>2]|0;if(!e){f=0;break}if((e|0)!=(b|0)){d=aL(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,e,d)|0;a=c[g>>2]|0;}f=f+1|0;}while(1){e=c[(c[a+264>>2]|0)+(f<<2)>>2]|0;if(!e)break;if((e|0)!=(b|0)){d=aL(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0,e,d)|0;a=c[g>>2]|0;}f=f+1|0;}c[a+288>>2]=d;return d+1|0}function bL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0,j=0;i=a+16|0;g=0;while(1){a=c[i>>2]|0;d=c[(c[a+180>>2]|0)+(g<<2)>>2]|0;if(!d){d=0;break}f=c[d+16>>2]|0;if((c[f+164>>2]|0)<0){a=c[d>>2]&3;b=c[(c[((a|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0;j=c[b+288>>2]|0;if((c[47259]|0)>(j|0)|(j|0)>(c[47260]|0)?(h=(c[b+232>>2]|0)-(c[(c[(c[((a|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[f+170>>1]|0)|0,(h|0)<(c[47258]|0)|(c[47257]|0)==0):0){c[47257]=d;c[47258]=h;}}else {b=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0))bL(b);}g=g+1|0;}while(1){b=c[(c[a+264>>2]|0)+(d<<2)>>2]|0;if(!((b|0)!=0&(c[47258]|0)>0))break;b=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0)){bL(b);a=c[i>>2]|0;}d=d+1|0;}return}function cL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0,j=0;i=a+16|0;g=0;while(1){a=c[i>>2]|0;d=c[(c[a+172>>2]|0)+(g<<2)>>2]|0;if(!d){d=0;break}f=c[d+16>>2]|0;if((c[f+164>>2]|0)<0){a=c[d>>2]&3;b=c[(c[((a|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0;j=c[b+288>>2]|0;if((c[47259]|0)>(j|0)|(j|0)>(c[47260]|0)?(h=(c[(c[(c[((a|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[b+232>>2]|0)-(e[f+170>>1]|0)|0,(h|0)<(c[47258]|0)|(c[47257]|0)==0):0){c[47257]=d;c[47258]=h;}}else {b=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0))cL(b);}g=g+1|0;}while(1){b=c[(c[a+272>>2]|0)+(d<<2)>>2]|0;if(!((b|0)!=0&(c[47258]|0)>0))break;b=c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0)){cL(b);a=c[i>>2]|0;}d=d+1|0;}return}function dL(a){a=a|0;var b=0;b=JK(16)|0;c[b>>2]=a;c[b+4>>2]=tL(a,b)|0;c[b+12>>2]=b;return b|0}function eL(a,b){a=a|0;b=b|0;var d=0,e=0;e=JK(8)|0;c[e>>2]=a;c[e+4>>2]=b;d=0;while(1){if((d|0)>=(b|0))break;c[(c[a+(d<<2)>>2]|0)+8>>2]=d;d=d+1|0;}d=(b|0)/2|0;while(1){if((d|0)<=-1)break;jL(e,d);d=d+-1|0;}return e|0}function fL(a){a=a|0;return c[a+4>>2]|0}function gL(a){a=a|0;var b=0,d=0,e=0,f=0;f=c[a>>2]|0;b=c[f>>2]|0;c[b+8>>2]=-1;d=a+4|0;e=(c[d>>2]|0)+-1|0;c[f>>2]=c[f+(e<<2)>>2];f=c[a>>2]|0;c[(c[f>>2]|0)+8>>2]=0;c[f+(e<<2)>>2]=b;c[d>>2]=e;jL(a,0);return b|0}function hL(a){a=a|0;return sL(c[a>>2]|0,0,0)|0}function iL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0;b=a+16|0;if((c[(c[b>>2]|0)+164>>2]|0)>-1)qa(102350,102331,463,102364);g=a+48|0;d=oL(c[((c[a>>2]&3|0)==3?a:g)+40>>2]|0)|0;i=a+-48|0;f=oL(c[((c[a>>2]&3|0)==2?a:i)+40>>2]|0)|0;h=c[a>>2]&3;b=(c[(c[(c[((h|0)==2?a:i)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((h|0)==3?a:g)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[b>>2]|0)+170>>1]|0)|0;if((c[d+8>>2]|0)==-1)pL(c[d>>2]|0,0,b);else pL(c[f>>2]|0,0,0-b|0);qL(a);return rL(d,f)|0}function jL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]|0;g=c[a+4>>2]|0;while(1){a=b<<1;f=a+2|0;a=a|1;if(!((a|0)<(g|0)?(c[(c[h+(a<<2)>>2]|0)+4>>2]|0)<(c[(c[h+(b<<2)>>2]|0)+4>>2]|0):0))a=b;if((f|0)>=(g|0))break;d=h+(f<<2)|0;e=c[d>>2]|0;if((f|0)==(b|0)?1:(c[e+4>>2]|0)>=(c[(c[h+(a<<2)>>2]|0)+4>>2]|0))break;i=h+(b<<2)|0;a=c[i>>2]|0;c[i>>2]=e;c[d>>2]=a;c[(c[i>>2]|0)+8>>2]=b;c[a+8>>2]=f;b=f;}return}function kL(){aL(c[(c[(c[47254]|0)+16>>2]|0)+192>>2]|0,0,1)|0;lL(c[(c[(c[47254]|0)+16>>2]|0)+192>>2]|0,0);return}function lL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+16|0;d=0;while(1){a=c[f>>2]|0;e=c[(c[a+272>>2]|0)+(d<<2)>>2]|0;if(!e){e=0;break}if((e|0)!=(b|0))lL(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,e);d=d+1|0;}while(1){d=c[(c[a+264>>2]|0)+(e<<2)>>2]|0;if(!d)break;if((d|0)!=(b|0)){lL(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,d);a=c[f>>2]|0;}e=e+1|0;}if(b|0)mL(b);return}function mL(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=c[a>>2]&3;d=c[((b|0)==3?a:a+48|0)+40>>2]|0;e=c[d+16>>2]|0;if((c[e+280>>2]|0)==(a|0))i=1;else {e=c[((b|0)==2?a:a+-48|0)+40>>2]|0;i=-1;d=e;e=c[e+16>>2]|0;}g=c[e+180>>2]|0;b=0;f=0;while(1){h=c[g+(f<<2)>>2]|0;if(!h)break;b=(nL(h,d,i)|0)+b|0;f=f+1|0;}g=c[e+172>>2]|0;e=0;while(1){f=c[g+(e<<2)>>2]|0;if(!f)break;b=(nL(f,d,i)|0)+b|0;e=e+1|0;}c[(c[a+16>>2]|0)+160>>2]=b;return}function nL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=(h|0)==3?a:a+48|0;e=c[i+40>>2]|0;if((e|0)==(b|0))e=c[((h|0)==2?a:a+-48|0)+40>>2]|0;g=c[b+16>>2]|0;f=c[(c[e+16>>2]|0)+288>>2]|0;if((c[g+284>>2]|0)<=(f|0)?(f|0)<=(c[g+288>>2]|0):0){f=c[a+16>>2]|0;if((c[f+164>>2]|0)>-1)e=c[f+160>>2]|0;else e=0;g=1;e=e-(c[f+156>>2]|0)|0;}else {g=0;e=c[(c[a+16>>2]|0)+156>>2]|0;}i=(c[((d|0)>0?((h|0)==2?a:a+-48|0):i)+40>>2]|0)==(b|0)?1:-1;return (((g?i:0-i|0)|0)<0?0-e|0:e)|0}function oL(a){a=a|0;var b=0,d=0;a=c[(c[a+16>>2]|0)+280>>2]|0;while(1){b=a+12|0;d=c[b>>2]|0;if(!((d|0)!=(a|0)&(d|0)!=0))break;a=c[d+12>>2]|0;if(!a){a=d;continue}c[b>>2]=a;}return a|0}function pL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=a+16|0;e=c[h>>2]|0;g=e+232|0;c[g>>2]=(c[g>>2]|0)+d;g=0;while(1){f=c[(c[e+264>>2]|0)+(g<<2)>>2]|0;if(!f){g=0;break}f=c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0;if((f|0)!=(b|0)){pL(f,a,d);e=c[h>>2]|0;}g=g+1|0;}while(1){f=c[(c[e+272>>2]|0)+(g<<2)>>2]|0;if(!f)break;f=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((f|0)!=(b|0)){pL(f,a,d);e=c[h>>2]|0;}g=g+1|0;}return}function qL(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;d=(c[b+16>>2]|0)+164|0;if((c[d>>2]|0)>-1){gA(1,102453,h)|0;bb(188848,1);}g=c[47255]|0;c[d>>2]=g;d=c[47256]|0;c[47255]=g+1;c[d+(g<<2)>>2]=b;d=c[b>>2]|0;g=b+48|0;e=c[((d&3|0)==3?b:g)+40>>2]|0;if(!(a[(c[e+16>>2]|0)+157>>0]|0)){f=c[47262]|0;d=c[47263]|0;c[47263]=d+1;c[f+(d<<2)>>2]=e;d=c[b>>2]|0;}f=b+-48|0;e=c[((d&3|0)==2?b:f)+40>>2]|0;if(!(a[(c[e+16>>2]|0)+157>>0]|0)){i=c[47262]|0;d=c[47263]|0;c[47263]=d+1;c[i+(d<<2)>>2]=e;d=c[b>>2]|0;}i=(c[((d&3|0)==3?b:g)+40>>2]|0)+16|0;d=c[i>>2]|0;a[d+157>>0]=1;e=c[d+272>>2]|0;d=d+276|0;g=c[d>>2]|0;c[d>>2]=g+1;c[e+(g<<2)>>2]=b;g=c[i>>2]|0;c[(c[g+272>>2]|0)+(c[g+276>>2]<<2)>>2]=0;i=c[i>>2]|0;if(!(c[(c[i+180>>2]|0)+((c[i+276>>2]|0)+-1<<2)>>2]|0)){gA(1,102487,h+8|0)|0;bb(188848,1);}i=(c[((c[b>>2]&3|0)==2?b:f)+40>>2]|0)+16|0;e=c[i>>2]|0;a[e+157>>0]=1;f=c[e+264>>2]|0;e=e+268|0;g=c[e>>2]|0;c[e>>2]=g+1;c[f+(g<<2)>>2]=b;b=c[i>>2]|0;c[(c[b+264>>2]|0)+(c[b+268>>2]<<2)>>2]=0;i=c[i>>2]|0;if(!(c[(c[i+172>>2]|0)+((c[i+268>>2]|0)+-1<<2)>>2]|0)){gA(1,102522,h+16|0)|0;bb(188848,1);}else {l=h;return}}function rL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;while(1){g=a+12|0;d=c[g>>2]|0;if((d|0)==0|(d|0)==(a|0))break;else a=d;}while(1){f=b+12|0;d=c[f>>2]|0;if((d|0)==0|(d|0)==(b|0))break;else b=d;}if((a|0)!=(b|0)){e=c[a+8>>2]|0;d=c[b+8>>2]|0;do if((e|0)>-1)if((d|0)==-1)h=a;else j=10;else if((d|0)>-1)if((e|0)==-1){h=b;break}else {j=10;break}else qa(102376,102331,327,102423);while(0);if((j|0)==10)h=(c[b+4>>2]|0)<(c[a+4>>2]|0)?a:b;c[f>>2]=h;c[g>>2]=h;c[h+4>>2]=(c[b+4>>2]|0)+(c[a+4>>2]|0);if((c[h+8>>2]|0)>-1)i=h;else qa(102434,102331,335,102423);}else i=a;return i|0}function sL(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=oL(a)|0;if(d){k=c[d>>2]&3;if(((c[(c[(c[((k|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((k|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)!=(e[(c[d+16>>2]|0)+170>>1]|0|0))f=3;}else {d=0;f=3;}a:do if((f|0)==3){k=a+16|0;j=0;while(1){f=c[k>>2]|0;i=c[(c[f+180>>2]|0)+(j<<2)>>2]|0;if(!i){j=0;break}f=i+16|0;g=i+-48|0;h=c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0;do if((c[(c[f>>2]|0)+164>>2]|0)>-1){if((h|0)!=(b|0))d=sL(h,a,d)|0;}else if((oL(h)|0)!=(l|0)){if(d|0?(m=c[i>>2]&3,h=c[d>>2]&3,((c[(c[(c[((m|0)==2?i:g)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((m|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[f>>2]|0)+170>>1]|0)|0)>=((c[(c[(c[((h|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((h|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0)):0)break;d=i;}while(0);j=j+1|0;}while(1){f=c[(c[f+172>>2]|0)+(j<<2)>>2]|0;if(!f)break a;g=f+16|0;h=f+48|0;i=c[((c[f>>2]&3|0)==3?f:h)+40>>2]|0;do if((c[(c[g>>2]|0)+164>>2]|0)>-1){if((i|0)!=(b|0))d=sL(i,a,d)|0;}else if((oL(i)|0)!=(l|0)){if(d|0?(i=c[f>>2]&3,m=c[d>>2]&3,((c[(c[(c[((i|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((i|0)==3?f:h)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[g>>2]|0)+170>>1]|0)|0)>=((c[(c[(c[((m|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((m|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0)):0)break;d=f;}while(0);j=j+1|0;f=c[k>>2]|0;}}while(0);return d|0}function tL(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;l=a+16|0;d=c[l>>2]|0;c[d+280>>2]=b;a=1;h=0;while(1){g=c[(c[d+172>>2]|0)+(h<<2)>>2]|0;if(!g){h=0;break}f=c[g+16>>2]|0;if(((c[f+164>>2]|0)<=-1?(i=c[g>>2]&3,j=g+48|0,k=c[(c[((i|0)==3?g:j)+40>>2]|0)+16>>2]|0,(c[k+280>>2]|0)==0):0)?((c[(c[(c[((i|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[k+232>>2]|0)|0)==(e[f+170>>1]|0|0):0){qL(g);a=(tL(c[((c[g>>2]&3|0)==3?g:j)+40>>2]|0,b)|0)+a|0;d=c[l>>2]|0;}h=h+1|0;}while(1){f=c[(c[d+180>>2]|0)+(h<<2)>>2]|0;if(!f)break;g=c[f+16>>2]|0;if(((c[g+164>>2]|0)<=-1?(m=c[f>>2]&3,n=f+-48|0,o=c[(c[((m|0)==2?f:n)+40>>2]|0)+16>>2]|0,(c[o+280>>2]|0)==0):0)?((c[o+232>>2]|0)-(c[(c[(c[((m|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)==(e[g+170>>1]|0|0):0){qL(f);a=(tL(c[((c[f>>2]&3|0)==2?f:n)+40>>2]|0,b)|0)+a|0;d=c[l>>2]|0;}h=h+1|0;}return a|0}function uL(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=QA(a,102586)|0;if(!d)d=30;else d=q5(d)|0;return NK(a,b,c,d)|0}function vL(a){a=+a;return +(0==0?a:+h[23301]-a)}function wL(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0;r=l;l=l+16|0;q=r;c[47264]=c[(c[(c[d+64>>2]|0)+8>>2]|0)+4>>2];xL(d);i=c[d+16>>2]|0;t=+h[i+32>>3];s=+h[i+40>>3];yL(e,102597,+h[b+352>>3]);yL(e,102604,t*.013888888888888888);yL(e,102604,s*.013888888888888888);zL(e);i=jC(d)|0;while(1){if(!i)break;g=i+16|0;if(!(a[(c[g>>2]|0)+118>>0]|0)){AL(e,102606,$D(KB(i)|0)|0);p=(c[g>>2]|0)+16|0;c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];BL(e,q);if(!(a[(c[(c[g>>2]|0)+104>>2]|0)+82>>0]|0)){b=xC(i)|0;b=CL(b,c[c[(c[g>>2]|0)+104>>2]>>2]|0)|0;}else b=$D(RA(i,c[47154]|0)|0)|0;yL(e,102604,+h[(c[g>>2]|0)+32>>3]);yL(e,102604,+h[(c[g>>2]|0)+40>>3]);AL(e,102604,b);AL(e,102604,bP(i,c[47157]|0,111067)|0);AL(e,102604,c[c[(c[g>>2]|0)+8>>2]>>2]|0);AL(e,102604,bP(i,c[47148]|0,137314)|0);b=bP(i,c[47149]|0,195059)|0;if(!(a[b>>0]|0))b=bP(i,c[47148]|0,134800)|0;AL(e,102604,b);zL(e);}i=kC(d,i)|0;}o=f<<24>>24==0;n=jC(d)|0;while(1){if(!n)break;m=XA(d,n)|0;while(1){if(!m)break;if(o){f=195059;j=195059;}else {j=QA(m,111455)|0;f=QA(m,111464)|0;f=f|0?f:195059;j=j|0?j:195059;}p=m+16|0;b=c[p>>2]|0;k=c[b+8>>2]|0;a:do if(k){i=c[k+4>>2]|0;b=0;g=0;while(1){if((b|0)>=(i|0))break;u=(c[(c[k>>2]|0)+(b*48|0)+4>>2]|0)+g|0;b=b+1|0;g=u;}AL(e,0,111450);DL(e,c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0,j);DL(e,c[((c[m>>2]&3|0)==2?m:m+-48|0)+40>>2]|0,f);EL(e,g);f=0;while(1){b=c[p>>2]|0;g=c[b+8>>2]|0;if((f|0)>=(c[g+4>>2]|0))break a;i=c[g>>2]|0;g=c[i+(f*48|0)>>2]|0;i=c[i+(f*48|0)+4>>2]|0;b=0;while(1){if((b|0)>=(i|0))break;u=g+(b<<4)|0;c[q>>2]=c[u>>2];c[q+4>>2]=c[u+4>>2];c[q+8>>2]=c[u+8>>2];c[q+12>>2]=c[u+12>>2];BL(e,q);b=b+1|0;}f=f+1|0;}}while(0);if(c[b+96>>2]|0){u=xC(c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0)|0;AL(e,102604,CL(u,c[c[(c[p>>2]|0)+96>>2]>>2]|0)|0);u=(c[(c[p>>2]|0)+96>>2]|0)+56|0;c[q>>2]=c[u>>2];c[q+4>>2]=c[u+4>>2];c[q+8>>2]=c[u+8>>2];c[q+12>>2]=c[u+12>>2];BL(e,q);}AL(e,102604,bP(m,c[47185]|0,111067)|0);AL(e,102604,bP(m,c[47176]|0,137314)|0);zL(e);m=ZA(d,m)|0;}n=kC(d,n)|0;}FL(102612,e);l=r;return}function xL(a){a=a|0;var b=0.0;if(0);return}function yL(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0,f=0;f=l;l=l+1040|0;e=f;d=f+8|0;if(b|0)FL(b,a);h[e>>3]=c;m4(d,102618,e)|0;FL(d,a);l=f;return}function zL(b){b=b|0;a[194955]=10;lb[c[47264]&127](b,194955)|0;return}function AL(a,b,c){a=a|0;b=b|0;c=c|0;if(b|0)FL(b,a);FL(c,a);return}function BL(a,b){a=a|0;b=b|0;var c=0.0;yL(a,102604,+h[b>>3]*.013888888888888888);if(!0)c=+h[b+8>>3];yL(a,102604,c*.013888888888888888);return}function CL(a,b){a=a|0;b=b|0;var c=0;c=fD(a,b)|0;b=$D(c)|0;hD(a,c)|0;return b|0}function DL(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!(a[(c[d+16>>2]|0)+118>>0]|0))d=$D(KB(d)|0)|0;else {f=xC(d)|0;d=CL(f,(R2(KB(d)|0,58)|0)+1|0)|0;}AL(b,102604,d);if(e|0?a[e>>0]|0:0)AL(b,107984,$D(e)|0);return}function EL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+1040|0;f=d;e=d+8|0;FL(102604,a);c[f>>2]=b;m4(e,137395,f)|0;FL(e,a);l=d;return}function FL(a,b){a=a|0;b=b|0;lb[c[47264]&127](b,a)|0;return}function GL(d,f,g){d=d|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0.0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;Y=l;l=l+2288|0;W=Y+208|0;V=Y+192|0;U=Y+176|0;T=Y+160|0;S=Y+144|0;R=Y+128|0;P=Y+112|0;O=Y+96|0;N=Y+80|0;M=Y+64|0;L=Y+56|0;K=Y+48|0;X=Y+32|0;Q=Y+24|0;J=Y;G=Y+1264|0;H=Y+224|0;I=d+16|0;C=(e[(c[I>>2]|0)+178>>1]|0)>2;RJ(1);xL(d);kA(H,1024,Y+240|0);_P(d,1,102623,195059)|0;_P(d,1,102627,195059)|0;c[47146]=_P(d,1,141116,195059)|0;c[47145]=_P(d,1,141048,195059)|0;_P(d,2,102623,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;if(i&16){_P(d,1,102633,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&1){_P(d,2,102637,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&32){_P(d,2,102633,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&2){_P(d,2,102640,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&4){_P(d,2,102648,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(!(i&8)){v=0;w=0;x=0;}else {x=_P(d,0,102637,195059)|0;w=_P(d,0,102656,195059)|0;v=_P(d,0,102663,195059)|0;}z=_P(d,0,102671,195059)|0;A=H+4|0;B=H+8|0;u=0;i=0;y=jC(d)|0;while(1){if(!y)break;t=y+16|0;k=c[t>>2]|0;o=+h[k+16>>3];j=0==0;if(C){if(j)m=+h[k+24>>3];else m=+h[23301]-+h[k+24>>3];q=+h[(c[k+132>>2]|0)+16>>3]*72.0;h[J>>3]=o;h[J+8>>3]=m;h[J+16>>3]=q;m4(G,102674,J)|0;nA(H,G)|0;j=3;while(1){if((j|0)>=(e[(c[I>>2]|0)+178>>1]|0))break;h[Q>>3]=+h[(c[(c[t>>2]|0)+132>>2]|0)+(j<<3)>>3]*72.0;m4(G,102689,Q)|0;nA(H,G)|0;j=j+1|0;}j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;s=c[H>>2]|0;c[A>>2]=s;SA(y,102623,s)|0;s=y;}else {if(j)m=+h[k+24>>3];else m=+h[23301]-+h[k+24>>3];h[X>>3]=o;h[X+8>>3]=m;m4(G,102695,X)|0;SA(y,102623,G)|0;s=y;}h[K>>3]=+h[(c[t>>2]|0)+80>>3]*.013888888888888888;m4(G,102618,K)|0;KA(s,c[47145]|0,G)|0;j=c[t>>2]|0;h[L>>3]=(+h[j+96>>3]+ +h[j+88>>3])*.013888888888888888;m4(G,102618,L)|0;KA(s,c[47146]|0,G)|0;j=c[t>>2]|0;k=c[j+108>>2]|0;if((k|0)!=0?(a[k+81>>0]|0)!=0:0){q=+h[k+64>>3];q=0==0?q:+h[23301]-q;h[M>>3]=+h[k+56>>3];h[M+8>>3]=q;m4(G,102695,M)|0;SA(s,102633,G)|0;j=c[t>>2]|0;}if(s2(c[c[j+8>>2]>>2]|0,106220)|0){if(c[47170]|0?(hN(y)|0)<<24>>24:0){k=c[(c[t>>2]|0)+12>>2]|0;r=k+8|0;j=c[r>>2]|0;if((j|0)<3){j=QA(s,102705)|0;if(!j)j=8;else j=q5(j)|0;j=(j|0)<3?8:j;}p=k+44|0;q=1.0/+(j|0);n=0;while(1){if((n|0)>=(j|0))break;if((n|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=32;}if((c[r>>2]|0)>2){k=c[p>>2]|0;if(!0)m=+h[k+(n<<4)+8>>3]*.013888888888888888;h[N>>3]=+h[k+(n<<4)>>3]*.013888888888888888;h[N+8>>3]=m;m4(G,102718,N)|0;}else {k=c[t>>2]|0;m=q*+(n|0)*6.283185307179586;o=+h[k+32>>3]*.5*+E(+m);if(!0)m=+h[k+40>>3]*.5*+F(+m);h[O>>3]=o;h[O+8>>3]=m;m4(G,102718,O)|0;}nA(H,G)|0;n=n+1|0;}k=c[47170]|0;j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;t=c[H>>2]|0;c[A>>2]=t;KA(s,k,t)|0;}}else {HL(y,c[j+12>>2]|0,H);pA(H)|0;j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;t=c[H>>2]|0;c[A>>2]=t;SA(s,102627,t)|0;}a:do if((c[47138]|0)>0){t=XA(d,y)|0;j=u;while(1){if(!t)break a;s=t+16|0;k=c[s>>2]|0;do if((a[k+112>>0]|0)!=6?(D=c[k+8>>2]|0,(D|0)!=0):0){r=0;k=D;while(1){if((r|0)>=(c[k+4>>2]|0))break;if((r|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=59;k=c[(c[s>>2]|0)+8>>2]|0;}k=c[k>>2]|0;if(c[k+(r*48|0)+8>>2]|0){if(!0)m=+h[k+(r*48|0)+24>>3];h[P>>3]=+h[k+(r*48|0)+16>>3];h[P+8>>3]=m;m4(G,102728,P)|0;nA(H,G)|0;i=1;k=c[c[(c[s>>2]|0)+8>>2]>>2]|0;}if(c[k+(r*48|0)+12>>2]|0){if(!0)m=+h[k+(r*48|0)+40>>3];h[R>>3]=+h[k+(r*48|0)+32>>3];h[R+8>>3]=m;m4(G,102741,R)|0;nA(H,G)|0;j=1;}p=0;while(1){k=c[(c[s>>2]|0)+8>>2]|0;n=c[k>>2]|0;if((p|0)>=(c[n+(r*48|0)+4>>2]|0))break;if((p|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=32;k=c[c[(c[s>>2]|0)+8>>2]>>2]|0;}else k=n;u=c[k+(r*48|0)>>2]|0;q=+h[u+(p<<4)+8>>3];q=0==0?q:+h[23301]-q;h[S>>3]=+h[u+(p<<4)>>3];h[S+8>>3]=q;m4(G,102695,S)|0;nA(H,G)|0;p=p+1|0;}r=r+1|0;}k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}a[k>>0]=0;k=c[H>>2]|0;c[A>>2]=k;SA(t,102623,k)|0;k=c[s>>2]|0;n=c[k+96>>2]|0;if(n){q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[T>>3]=+h[n+56>>3];h[T+8>>3]=q;m4(G,102695,T)|0;SA(t,102637,G)|0;k=c[s>>2]|0;}n=c[k+108>>2]|0;do if(n){if(!(a[n+81>>0]|0))break;q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[U>>3]=+h[n+56>>3];h[U+8>>3]=q;m4(G,102695,U)|0;SA(t,102633,G)|0;k=c[s>>2]|0;}while(0);n=c[k+100>>2]|0;if(n){q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[V>>3]=+h[n+56>>3];h[V+8>>3]=q;m4(G,102695,V)|0;SA(t,102640,G)|0;k=c[s>>2]|0;}k=c[k+104>>2]|0;if(!k)break;q=+h[k+64>>3];q=0==0?q:+h[23301]-q;h[W>>3]=+h[k+56>>3];h[W+8>>3]=q;m4(G,102695,W)|0;SA(t,102648,G)|0;}while(0);t=ZA(d,t)|0;}}else j=u;while(0);u=j;y=kC(d,y)|0;}IL(d,z,x,w,v);oA(H);if(b[(c[I>>2]|0)+136>>1]&1)UP(d);c[f>>2]=i;c[g>>2]=u;RJ(0);l=Y;return}function HL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0.0;n=l;l=l+1056|0;k=n;j=n+32|0;m=b+48|0;if(!(c[m>>2]|0)){e=c[a+16>>2]|0;i=+h[e+16>>3];if(!0){g=+h[e+24>>3];f=g+ +h[b+24>>3];g=g+ +h[b+40>>3];}o=i+ +h[b+32>>3];h[k>>3]=i+ +h[b+16>>3];h[k+8>>3]=f;h[k+16>>3]=o;h[k+24>>3]=g;m4(j,102779,k)|0;nA(d,j)|0;}b=b+56|0;e=0;while(1){if((e|0)>=(c[m>>2]|0))break;HL(a,c[(c[b>>2]|0)+(e<<2)>>2]|0,d);e=e+1|0;}l=n;return}function IL(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0;s=l;l=l+1088|0;o=s+56|0;q=s+48|0;p=s+32|0;j=s;n=s+64|0;r=b+16|0;i=c[r>>2]|0;if(!0){k=+h[i+24>>3];m=+h[i+40>>3];}t=+h[i+32>>3];h[j>>3]=+h[i+16>>3];h[j+8>>3]=k;h[j+16>>3]=t;h[j+24>>3]=m;m4(n,102754,j)|0;KA(b,d,n)|0;i=c[(c[r>>2]|0)+12>>2]|0;if((i|0)!=0?(a[c[i>>2]>>0]|0)!=0:0){t=+h[i+64>>3];t=0==0?t:+h[23301]-t;h[p>>3]=+h[i+56>>3];h[p+8>>3]=t;m4(n,102695,p)|0;KA(b,e,n)|0;i=c[(c[r>>2]|0)+12>>2]|0;t=+h[i+32>>3];h[q>>3]=+h[i+24>>3]*.013888888888888888;m4(n,102774,q)|0;KA(b,f,n)|0;h[o>>3]=t*.013888888888888888;m4(n,102774,o)|0;KA(b,g,n)|0;i=1;}else i=1;while(1){j=c[r>>2]|0;if((i|0)>(c[j+180>>2]|0))break;IL(c[(c[j+184>>2]|0)+(i<<2)>>2]|0,d,e,f,g);i=i+1|0;}l=s;return}function JL(a){a=a|0;var b=0;b=l;l=l+16|0;GL(a,b,b+4|0);l=b;return}function KL(){return Vz(20740,c[4581]|0)|0}function LL(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function ML(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if((a|0)<=(e|0))if((a|0)<(e|0))a=-1;else {b=c[b+4>>2]|0;d=c[d+4>>2]|0;return ((b|0)>(d|0)?1:((b|0)<(d|0))<<31>>31)|0}else a=1;return a|0}function NL(a){a=a|0;Rz(a)|0;return}function OL(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];b=PL(e)|0;if((nb[c[a>>2]&63](a,b,1)|0)!=(b|0))U1(b);l=d;return}function PL(a){a=a|0;var b=0,d=0,e=0;b=JK(16)|0;e=a;d=c[e+4>>2]|0;a=b+8|0;c[a>>2]=c[e>>2];c[a+4>>2]=d;return b|0}function QL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e+8|0;g=e;c[g>>2]=b;c[g+4>>2]=d;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];b=PL(f)|0;if((nb[c[a>>2]&63](a,b,1)|0)!=(b|0))U1(b);l=e;return}function RL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;e=d;g=b;f=c[g+4>>2]|0;b=e+8|0;c[b>>2]=c[g>>2];c[b+4>>2]=f;b=(nb[c[a>>2]&63](a,e,4)|0)!=0&1;l=d;return b|0}function SL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f+8>>2]=b;c[f+12>>2]=d;d=(nb[c[a>>2]&63](a,f,4)|0)!=0&1;l=e;return d|0}function TL(a){a=a|0;return Xz(a)|0}function UL(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=JK((Xz(a)|0)<<3)|0;b=d;a=Tz(a)|0;while(1){if(!a)break;g=a+8|0;f=c[g+4>>2]|0;e=b;c[e>>2]=c[g>>2];c[e+4>>2]=f;b=b+8|0;a=c[a>>2]|0;}return d|0}function VL(){var a=0,b=0,d=0,e=0;a=KK(40)|0;b=a;d=20776;e=b+36|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));c[a+36>>2]=0;return Vz(a,c[4581]|0)|0}function WL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;d=d+36|0;a=c[d>>2]|0;if(!a)a=KK(20)|0;else c[d>>2]=c[a>>2];f=b+8|0;e=c[f+4>>2]|0;d=a+8|0;c[d>>2]=c[f>>2];c[d+4>>2]=e;c[a+16>>2]=c[b+16>>2];return a|0}function XL(a,b,d){a=a|0;b=b|0;d=d|0;d=d+36|0;c[b>>2]=c[d>>2];c[d>>2]=b;return}function YL(a){a=a|0;nb[c[a>>2]&63](a,0,64)|0;return}function ZL(a){a=a|0;var b=0,d=0;b=c[a+4>>2]|0;Rz(a)|0;a=c[b+36>>2]|0;while(1){if(!a)break;d=c[a>>2]|0;U1(a);a=d;}U1(b);return}function _L(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+32|0;g=f;c[g+8>>2]=b;c[g+12>>2]=d;c[g+16>>2]=e;e=c[(nb[c[a>>2]&63](a,g,1)|0)+16>>2]|0;l=f;return e|0}function $L(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+160|0;q=t+144|0;d=t+48|0;j=t+128|0;k=t+112|0;m=t+96|0;n=t+80|0;o=t+32|0;p=t+16|0;r=t;s=a+16|0;a=c[s>>2]|0;e=+h[a+16>>3];f=+h[a+24>>3];g=+h[a+32>>3];i=+h[a+40>>3];if((b+-1|0)>>>0<2){aM(j,e,i);c[q>>2]=c[j>>2];c[q+4>>2]=c[j+4>>2];c[q+8>>2]=c[j+8>>2];c[q+12>>2]=c[j+12>>2];bM(d,q);p=d+16|0;aM(k,g,f);c[q>>2]=c[k>>2];c[q+4>>2]=c[k+4>>2];c[q+8>>2]=c[k+8>>2];c[q+12>>2]=c[k+12>>2];bM(m,q);c[p>>2]=c[m>>2];c[p+4>>2]=c[m+4>>2];c[p+8>>2]=c[m+8>>2];c[p+12>>2]=c[m+12>>2];}else {aM(n,e,f);c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];bM(d,q);n=d+16|0;aM(o,g,i);c[q>>2]=c[o>>2];c[q+4>>2]=c[o+4>>2];c[q+8>>2]=c[o+8>>2];c[q+12>>2]=c[o+12>>2];bM(p,q);c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];}a=(c[s>>2]|0)+16|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];c[a+20>>2]=c[d+20>>2];c[a+24>>2]=c[d+24>>2];c[a+28>>2]=c[d+28>>2];a=c[(c[s>>2]|0)+12>>2]|0;if(!a)a=1;else {a=a+56|0;c[q>>2]=c[a>>2];c[q+4>>2]=c[a+4>>2];c[q+8>>2]=c[a+8>>2];c[q+12>>2]=c[a+12>>2];bM(r,q);c[a>>2]=c[r>>2];c[a+4>>2]=c[r+4>>2];c[a+8>>2]=c[r+8>>2];c[a+12>>2]=c[r+12>>2];a=1;}while(1){d=c[s>>2]|0;if((a|0)>(c[d+180>>2]|0))break;$L(c[(c[d+184>>2]|0)+(a<<2)>>2]|0,b);a=a+1|0;}l=t;return}function aM(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function bM(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+32|0;g=d+16|0;e=d;f=(c[47265]|0)*90|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];mK(e,g,f);c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];h[b>>3]=+h[b>>3]-+h[23303];e=b+8|0;h[e>>3]=+h[e>>3]-+h[23304];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];l=d;return}function cM(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+1168|0;s=w+144|0;v=w+96|0;u=w+64|0;t=w+48|0;o=w+32|0;p=w+16|0;q=w;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;r=b+16|0;m=c[(c[r>>2]|0)+116>>2]|0;c[47265]=m&3;m=m&1;a[194957]=m;if(!(m<<24>>24))eM(b);else dM(b);fM(b);m=c[r>>2]|0;e=c[m+12>>2]|0;do if(e|0?(a[e+81>>0]|0)==0:0){g=e+24|0;c[t>>2]=c[g>>2];c[t+4>>2]=c[g+4>>2];c[t+8>>2]=c[g+8>>2];c[t+12>>2]=c[g+12>>2];n=+h[t>>3]+16.0;h[t>>3]=n;g=t+8|0;f=+h[g>>3]+8.0;h[g>>3]=f;g=(a[m+275>>0]&1)!=0;if(a[194957]|0){if(g){i=m+32|0;h[i>>3]=+h[i>>3]+f;}else {i=m+16|0;h[i>>3]=+h[i>>3]-f;}g=m+40|0;f=+h[g>>3];i=m+24|0;j=+h[i>>3];k=f-j;if(!(n>k))break;n=(n-k)*.5;h[i>>3]=j-n;h[g>>3]=f+n;break}i=(c[47265]|0)==0;do if(g)if(i){i=m+40|0;h[i>>3]=+h[i>>3]+f;break}else {i=m+24|0;h[i>>3]=+h[i>>3]-f;break}else if(i){i=m+24|0;h[i>>3]=+h[i>>3]-f;break}else {i=m+40|0;h[i>>3]=+h[i>>3]+f;break}while(0);g=m+32|0;f=+h[g>>3];i=m+16|0;j=+h[i>>3];k=f-j;if(n>k){n=(n-k)*.5;h[i>>3]=j-n;h[g>>3]=f+n;}}while(0);if(d){switch(c[47265]|0){case 0:{q=m+16|0;c[46606]=c[q>>2];c[46607]=c[q+4>>2];c[46608]=c[q+8>>2];c[46609]=c[q+12>>2];break}case 1:{aM(o,-+h[m+40>>3],+h[m+16>>3]);c[46606]=c[o>>2];c[46607]=c[o+4>>2];c[46608]=c[o+8>>2];c[46609]=c[o+12>>2];break}case 2:{aM(p,+h[m+16>>3],-+h[m+40>>3]);c[46606]=c[p>>2];c[46607]=c[p+4>>2];c[46608]=c[p+8>>2];c[46609]=c[p+12>>2];break}case 3:{aM(q,+h[m+24>>3],+h[m+16>>3]);c[46606]=c[q>>2];c[46607]=c[q+4>>2];c[46608]=c[q+8>>2];c[46609]=c[q+12>>2];break}default:{}}gM(b);e=c[(c[r>>2]|0)+12>>2]|0;}if(e|0?(a[e+81>>0]|0)==0:0){c[s>>2]=c[t>>2];c[s+4>>2]=c[t+4>>2];c[s+8>>2]=c[t+8>>2];c[s+12>>2]=c[t+12>>2];hM(b,s);}if(!0){l=w;return}if(!(a[194957]|0)){n=+h[23304];k=+h[23303];h[v>>3]=n;h[v+8>>3]=k;h[v+16>>3]=n;h[v+24>>3]=k;h[v+32>>3]=-k;h[v+40>>3]=-n;m4(s,103015,v)|0;}else {k=+h[23303];n=+h[23304];h[u>>3]=k;h[u+8>>3]=n;h[u+16>>3]=k;h[u+24>>3]=n;m4(s,102800,u)|0;}D4(s)|0;ab();}function dM(b){b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0;j=b+16|0;if(((yC(b)|0)!=(b|0)?(g=c[j>>2]|0,i=c[g+12>>2]|0,(i|0)!=0):0)?(a[i+81>>0]|0)==0:0){d=a[g+275>>0]|0;if(!(d&1)){f=+h[g+16>>3]+ +h[g+96>>3]*.5;b=g+104|0;}else {f=+h[g+32>>3]-+h[g+64>>3]*.5;b=g+72|0;}e=+h[b>>3];b=d<<24>>24;do if(!(b&4))if(!(b&2)){e=(+h[g+40>>3]+ +h[g+24>>3])*.5;break}else {e=+h[g+40>>3]-e*.5;break}else e=+h[g+24>>3]+e*.5;while(0);h[i+56>>3]=f;h[i+64>>3]=e;a[(c[(c[j>>2]|0)+12>>2]|0)+81>>0]=1;b=1;}else b=1;while(1){d=c[j>>2]|0;if((b|0)>(c[d+180>>2]|0))break;dM(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function eM(b){b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0;k=b+16|0;if(((yC(b)|0)!=(b|0)?(i=c[k>>2]|0,j=c[i+12>>2]|0,(j|0)!=0):0)?(a[j+81>>0]|0)==0:0){d=a[i+275>>0]|0;if(!(d&1)){g=+h[i+24>>3]+ +h[i+56>>3]*.5;b=i+48|0;}else {g=+h[i+40>>3]-+h[i+88>>3]*.5;b=i+80|0;}f=+h[b>>3];b=d<<24>>24;do if(!(b&4)){e=+h[i+16>>3];if(!(b&2)){e=(+h[i+32>>3]+e)*.5;break}else {e=e+f*.5;break}}else e=+h[i+32>>3]-f*.5;while(0);h[j+56>>3]=e;h[j+64>>3]=g;a[(c[(c[k>>2]|0)+12>>2]|0)+81>>0]=1;b=1;}else b=1;while(1){d=c[k>>2]|0;if((b|0)>(c[d+180>>2]|0))break;eM(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function fM(e){e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;S=l;l=l+544|0;L=S+504|0;R=S+416|0;Q=S+376|0;K=S+352|0;J=S+312|0;I=S+288|0;H=S+248|0;M=S+200|0;B=S+152|0;O=S+96|0;p=S+488|0;C=S+456|0;D=S+424|0;E=S+384|0;F=S+360|0;G=S+320|0;w=S+296|0;x=S+256|0;y=S+232|0;z=S+168|0;A=S+136|0;f=S+56|0;N=S+16|0;P=S;o=e+16|0;u=c[o>>2]|0;g=b[u+136>>1]&14;u=d[u+113>>0]|0;if(!((u&54|0)==0?(u&1|0)==0|(c[47139]|0)!=0:0)){u=g<<16>>16==0;n=jC(e)|0;h=0;j=0;i=0;while(1){if(!n)break;g=c[(c[n+16>>2]|0)+108>>2]|0;do if(g)if(!(a[g+81>>0]|0)){i=i+1|0;break}else {h=h+1|0;break}while(0);m=XA(e,n)|0;g=j;while(1){if(!m)break;k=c[m+16>>2]|0;j=c[k+108>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+100>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+104>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+96>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);m=ZA(e,m)|0;}n=kC(e,n)|0;j=g;}if(!(a[(c[o>>2]|0)+113>>0]&8))o=0;else o=jM(e)|0;t=j+i|0;if(t|0){q=h+j+o+(tB(e)|0)|0;r=JK(q*40|0)|0;s=JK(t*40|0)|0;aM(M,2147483647.0,2147483647.0);g=M+16|0;aM(p,-2147483647.0,-2147483647.0);c[g>>2]=c[p>>2];c[g+4>>2]=c[p+4>>2];c[g+8>>2]=c[p+8>>2];c[g+12>>2]=c[p+12>>2];g=s;i=r;n=jC(e)|0;while(1){if(!n)break;c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];kM(C,n,i,L);c[M>>2]=c[C>>2];c[M+4>>2]=c[C+4>>2];c[M+8>>2]=c[C+8>>2];c[M+12>>2]=c[C+12>>2];c[M+16>>2]=c[C+16>>2];c[M+20>>2]=c[C+20>>2];c[M+24>>2]=c[C+24>>2];c[M+28>>2]=c[C+28>>2];h=c[(c[n+16>>2]|0)+108>>2]|0;do if(h)if(!(a[h+81>>0]|0)){c[L>>2]=c[B>>2];c[L+4>>2]=c[B+4>>2];c[L+8>>2]=c[B+8>>2];c[L+12>>2]=c[B+12>>2];mM(h,i,g,0,L);g=g+40|0;break}else {i=i+40|0;c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(D,h,i,L);c[M>>2]=c[D>>2];c[M+4>>2]=c[D+4>>2];c[M+8>>2]=c[D+8>>2];c[M+12>>2]=c[D+12>>2];c[M+16>>2]=c[D+16>>2];c[M+20>>2]=c[D+20>>2];c[M+24>>2]=c[D+24>>2];c[M+28>>2]=c[D+28>>2];break}while(0);m=XA(e,n)|0;i=i+40|0;while(1){if(!m)break;k=m+16|0;h=c[k>>2]|0;j=c[h+96>>2]|0;a:do if(!j)v=52;else {do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){vO(F,e,m);c[L>>2]=c[F>>2];c[L+4>>2]=c[F+4>>2];c[L+8>>2]=c[F+8>>2];c[L+12>>2]=c[F+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[H>>2]=c[j>>2];gA(0,103827,H)|0;break a}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(E,j,i,L);c[M>>2]=c[E>>2];c[M+4>>2]=c[E+4>>2];c[M+8>>2]=c[E+8>>2];c[M+12>>2]=c[E+12>>2];c[M+16>>2]=c[E+16>>2];c[M+20>>2]=c[E+20>>2];c[M+24>>2]=c[E+24>>2];c[M+28>>2]=c[E+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;v=52;}while(0);b:do if((v|0)==52){v=0;j=c[h+104>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){nM(w,m);c[L>>2]=c[w>>2];c[L+4>>2]=c[w+4>>2];c[L+8>>2]=c[w+8>>2];c[L+12>>2]=c[w+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[I>>2]=c[j>>2];gA(0,103862,I)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(G,j,i,L);c[M>>2]=c[G>>2];c[M+4>>2]=c[G+4>>2];c[M+8>>2]=c[G+8>>2];c[M+12>>2]=c[G+12>>2];c[M+16>>2]=c[G+16>>2];c[M+20>>2]=c[G+20>>2];c[M+24>>2]=c[G+24>>2];c[M+28>>2]=c[G+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;}j=c[h+100>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){oM(y,m);c[L>>2]=c[y>>2];c[L+4>>2]=c[y+4>>2];c[L+8>>2]=c[y+8>>2];c[L+12>>2]=c[y+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[J>>2]=c[j>>2];gA(0,103902,J)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(x,j,i,L);c[M>>2]=c[x>>2];c[M+4>>2]=c[x+4>>2];c[M+8>>2]=c[x+8>>2];c[M+12>>2]=c[x+12>>2];c[M+16>>2]=c[x+16>>2];c[M+20>>2]=c[x+20>>2];c[M+24>>2]=c[x+24>>2];c[M+28>>2]=c[x+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;}j=c[h+108>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){vO(A,e,m);c[L>>2]=c[A>>2];c[L+4>>2]=c[A+4>>2];c[L+8>>2]=c[A+8>>2];c[L+12>>2]=c[A+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[K>>2]=c[j>>2];gA(0,103942,K)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(z,j,i,L);c[M>>2]=c[z>>2];c[M+4>>2]=c[z+4>>2];c[M+8>>2]=c[z+8>>2];c[M+12>>2]=c[z+12>>2];c[M+16>>2]=c[z+16>>2];c[M+20>>2]=c[z+20>>2];c[M+24>>2]=c[z+24>>2];c[M+28>>2]=c[z+28>>2];}while(0);i=i+40|0;}}while(0);m=ZA(e,m)|0;}n=kC(e,n)|0;}if(o|0){c[f>>2]=c[M>>2];c[f+4>>2]=c[M+4>>2];c[f+8>>2]=c[M+8>>2];c[f+12>>2]=c[M+12>>2];c[f+16>>2]=c[M+16>>2];c[f+20>>2]=c[M+20>>2];c[f+24>>2]=c[M+24>>2];c[f+28>>2]=c[M+28>>2];c[f+32>>2]=i;h=L;g=h+40|0;do{c[h>>2]=c[f>>2];h=h+4|0;f=f+4|0;}while((h|0)<(g|0));pM(N,e,L);c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];c[M+16>>2]=c[N+16>>2];c[M+20>>2]=c[N+20>>2];c[M+24>>2]=c[N+24>>2];c[M+28>>2]=c[N+28>>2];}a[O+32>>0]=cP(e,GA(e,0,103978,0)|0,1)|0;c[O>>2]=c[M>>2];c[O+4>>2]=c[M+4>>2];c[O+8>>2]=c[M+8>>2];c[O+12>>2]=c[M+12>>2];c[O+16>>2]=c[M+16>>2];c[O+20>>2]=c[M+20>>2];c[O+24>>2]=c[M+24>>2];c[O+28>>2]=c[M+28>>2];hT(r,q,s,t,O)|0;if(0);f=0;g=0;h=s;while(1){if((g|0)>=(t|0))break;if(a[h+36>>0]|0){O=c[h+32>>2]|0;a[O+81>>0]=1;N=O+56|0;rM(P,h);c[N>>2]=c[P>>2];c[N+4>>2]=c[P+4>>2];c[N+8>>2]=c[P+8>>2];c[N+12>>2]=c[P+12>>2];zP(e,O);f=f+1|0;}g=g+1|0;h=h+40|0;}if(!0){if((f|0)!=(t|0)){c[R>>2]=f;c[R+4>>2]=t;gA(0,104023,R)|0;}}U1(r);U1(s);}}l=S;return}function gM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0;i=l;l=l+48|0;e=i+32|0;f=i+16|0;g=i;if(+h[23303]!=0.0|+h[23304]!=0.0|(c[47265]|0)!=0){d=jC(a)|0;while(1){if(!d)break;if(c[47265]|0)qQ(d,0);b=d+16|0;j=(c[b>>2]|0)+16|0;c[e>>2]=c[j>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[e+12>>2]=c[j+12>>2];bM(f,e);c[j>>2]=c[f>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];b=c[(c[b>>2]|0)+108>>2]|0;if(b|0){j=b+56|0;c[e>>2]=c[j>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[e+12>>2]=c[j+12>>2];bM(g,e);c[j>>2]=c[g>>2];c[j+4>>2]=c[g+4>>2];c[j+8>>2]=c[g+8>>2];c[j+12>>2]=c[g+12>>2];}a:do if((c[47138]|0)==1){b=XA(a,d)|0;while(1){if(!b)break a;iM(b);b=ZA(a,b)|0;}}while(0);d=kC(a,d)|0;}$L(a,c[(c[a+16>>2]|0)+116>>2]&3);}l=i;return}function hM(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0;i=b+16|0;j=c[i>>2]|0;g=a[j+275>>0]|0;b=g<<24>>24;do if(!(b&4)){e=+h[j+16>>3];if(!(b&2)){f=(+h[j+32>>3]+e)*.5;break}else {f=+h[d>>3]*.5+e;break}}else f=+h[j+32>>3]-+h[d>>3]*.5;while(0);if(!(g&1))e=+h[d+8>>3]*.5+ +h[j+24>>3];else e=+h[j+40>>3]-+h[d+8>>3]*.5;j=c[j+12>>2]|0;h[j+56>>3]=f;h[j+64>>3]=e;a[(c[(c[i>>2]|0)+12>>2]|0)+81>>0]=1;return}function iM(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=l;l=l+144|0;q=s+120|0;e=s+16|0;i=s+104|0;j=s+88|0;k=s+72|0;m=s+56|0;n=s+40|0;o=s+24|0;r=s;p=b+16|0;d=c[p>>2]|0;f=c[d+8>>2]|0;if(!f){if((a[194954]|0)==0?(a[d+112>>0]|0)!=6:0){q=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;r=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[e>>2]=q;c[e+4>>2]=r;gA(1,103810,e)|0;}}else {h=0;b=f;while(1){if((h|0)>=(c[b+4>>2]|0))break;g=c[b>>2]|0;b=c[g+(h*48|0)>>2]|0;e=c[g+(h*48|0)+4>>2]|0;f=c[g+(h*48|0)+8>>2]|0;g=c[g+(h*48|0)+12>>2]|0;d=0;while(1){if((d|0)>=(e|0))break;t=b+(d<<4)|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(i,q);c[t>>2]=c[i>>2];c[t+4>>2]=c[i+4>>2];c[t+8>>2]=c[i+8>>2];c[t+12>>2]=c[i+12>>2];d=d+1|0;}if(f|0){t=(c[c[(c[p>>2]|0)+8>>2]>>2]|0)+(h*48|0)+16|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(j,q);c[t>>2]=c[j>>2];c[t+4>>2]=c[j+4>>2];c[t+8>>2]=c[j+8>>2];c[t+12>>2]=c[j+12>>2];}if(g|0){t=(c[c[(c[p>>2]|0)+8>>2]>>2]|0)+(h*48|0)+32|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(k,q);c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];}d=c[p>>2]|0;h=h+1|0;b=c[d+8>>2]|0;}b=c[d+96>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(m,q);c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];d=c[p>>2]|0;}b=c[d+108>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(n,q);c[d>>2]=c[n>>2];c[d+4>>2]=c[n+4>>2];c[d+8>>2]=c[n+8>>2];c[d+12>>2]=c[n+12>>2];d=c[p>>2]|0;}b=c[d+100>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(o,q);c[d>>2]=c[o>>2];c[d+4>>2]=c[o+4>>2];c[d+8>>2]=c[o+8>>2];c[d+12>>2]=c[o+12>>2];d=c[p>>2]|0;}d=c[d+104>>2]|0;if(d|0){t=d+56|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(r,q);c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];}}l=s;return}function jM(b){b=b|0;var d=0,e=0,f=0;f=b+16|0;if((yC(b)|0)!=(b|0)?(d=c[(c[f>>2]|0)+12>>2]|0,(d|0)!=0):0){e=1;b=(a[d+81>>0]|0)!=0&1;}else {e=1;b=0;}while(1){d=c[f>>2]|0;if((e|0)>(c[d+180>>2]|0))break;d=(jM(c[(c[d+184>>2]|0)+(e<<2)>>2]|0)|0)+b|0;e=e+1|0;b=d;}return b|0}function kM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0;g=l;l=l+32|0;i=g;n=(a[194957]|0)==0;d=d+16|0;m=c[d>>2]|0;k=+h[(n?m+32|0:m+40|0)>>3];h[e+16>>3]=k*72.0;j=+h[(n?m+40|0:m+32|0)>>3];h[e+24>>3]=j*72.0;d=(c[d>>2]|0)+16|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];h[e>>3]=+h[e>>3]-k*36.0;d=e+8|0;h[d>>3]=+h[d>>3]-j*36.0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];sM(b,e,i);l=g;return}function lM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0;g=l;l=l+32|0;i=g;n=(a[194957]|0)==0;m=d+24|0;k=+h[(n?m:d+32|0)>>3];h[e+16>>3]=k;j=+h[(n?d+32|0:m)>>3];h[e+24>>3]=j;d=d+56|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];h[e>>3]=+h[e>>3]-k*.5;d=e+8|0;h[d>>3]=+h[d>>3]-j*.5;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];sM(b,e,i);l=g;return}function mM(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(f|0){f=d+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];}if(!(a[194957]|0)){g=b+24|0;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];}else {h[e>>3]=+h[b+32>>3];h[e+8>>3]=+h[b+24>>3];}c[e+32>>2]=b;a[e+36>>0]=0;c[d+32>>2]=e;return}function nM(a,b){a=a|0;b=b|0;b=uO(b)|0;do if(b){b=c[b>>2]|0;if(!(c[b+8>>2]|0)){b=c[b>>2]|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {b=b+16|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}}else {c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}while(0);return}function oM(a,b){a=a|0;b=b|0;var d=0;b=uO(b)|0;do if(b){d=c[b>>2]|0;b=(c[b+4>>2]|0)+-1|0;if(!(c[d+(b*48|0)+12>>2]|0)){d=(c[d+(b*48|0)>>2]|0)+((c[d+(b*48|0)+4>>2]|0)+-1<<4)|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}else {d=d+(b*48|0)+32|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}while(0);return}function pM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+112|0;k=q+72|0;n=q+32|0;o=q;p=d+16|0;j=1;while(1){f=c[p>>2]|0;if((j|0)>(c[f+180>>2]|0))break;f=c[(c[f+184>>2]|0)+(j<<2)>>2]|0;g=k;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));pM(n,f,k);g=e;h=n;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));j=j+1|0;}if(((yC(d)|0)!=(d|0)?(m=c[(c[p>>2]|0)+12>>2]|0,m|0):0)?a[m+81>>0]|0:0){p=e+32|0;n=c[p>>2]|0;c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[k+16>>2]=c[e+16>>2];c[k+20>>2]=c[e+20>>2];c[k+24>>2]=c[e+24>>2];c[k+28>>2]=c[e+28>>2];lM(o,m,n,k);c[e>>2]=c[o>>2];c[e+4>>2]=c[o+4>>2];c[e+8>>2]=c[o+8>>2];c[e+12>>2]=c[o+12>>2];c[e+16>>2]=c[o+16>>2];c[e+20>>2]=c[o+20>>2];c[e+24>>2]=c[o+24>>2];c[e+28>>2]=c[o+28>>2];c[p>>2]=(c[p>>2]|0)+40;}g=b;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));l=q;return}function qM(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+160|0;r=s+96|0;p=s+48|0;o=s;q=c[15712]|0;n=d[g+32>>0]|0;i=+h[g>>3];j=+h[g+8>>3];k=+h[g+16>>3];m=+h[g+24>>3];c[o>>2]=b;c[o+4>>2]=f;c[o+8>>2]=n;h[o+16>>3]=i;h[o+24>>3]=j;h[o+32>>3]=k;h[o+40>>3]=m;w4(q,104065,o)|0;a:do if(0>=2);while(0);l=s;return}function rM(a,b){a=a|0;b=b|0;var c=0.0;c=+h[b+8>>3]*.5+ +h[b+24>>3];h[a>>3]=+h[b>>3]*.5+ +h[b+16>>3];h[a+8>>3]=c;return}function sM(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0.0;e=l;l=l+16|0;f=e;j=+h[b>>3];h[d>>3]=+h[(+h[d>>3]>3];g=d+8|0;i=+h[b+8>>3];h[g>>3]=+h[(+h[g>>3]>3];j=+h[b+16>>3]+j;h[f>>3]=j;i=+h[b+24>>3]+i;h[f+8>>3]=i;g=d+16|0;h[g>>3]=+h[(+h[g>>3]>j?g:f)>>3];b=d+24|0;h[b>>3]=+h[(+h[b>>3]>i?g:f)+8>>3];c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];c[a+20>>2]=c[d+20>>2];c[a+24>>2]=c[d+24>>2];c[a+28>>2]=c[d+28>>2];l=e;return}function tM(a){a=a|0;cM(a,1);return}function uM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=l;l=l+16|0;d=e;b=mP(QA(a,105526)|0)|0;if(b){b=vM(b)|0;if(b|0){f=c[b+40>>2]|0;d=c[b+44>>2]|0;g=a+16|0;a=c[g>>2]|0;h[a+32>>3]=+(f|0)*.013888888888888888;h[a+40>>3]=+(d|0)*.013888888888888888;a=JK(12)|0;c[(c[g>>2]|0)+12>>2]=a;c[a>>2]=c[b+12>>2];c[a+4>>2]=((f|0)/-2|0)-(c[b+32>>2]|0);c[a+8>>2]=((d|0)/-2|0)-(c[b+36>>2]|0);}}else {c[d>>2]=KB(a)|0;gA(0,104234,d)|0;}l=e;return}function vM(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+1152|0;i=p+24|0;h=p+8|0;e=p;f=p+120|0;j=p+44|0;k=p+40|0;m=p+36|0;n=p+32|0;o=p+28|0;d=c[47266]|0;if(!d){d=Vz(20812,c[4581]|0)|0;c[47266]=d;}d=nb[c[d>>2]&63](d,b,512)|0;do if(!d){g=$4(b,138821)|0;if(!g){c[e>>2]=b;gA(0,104283,e)|0;d=0;break}else {d=0;e=0;}while(1){if(!(c4(f,1024,g)|0)){f=11;break}c[h>>2]=k;c[h+4>>2]=m;c[h+8>>2]=n;c[h+12>>2]=o;q=(b5(f,104311,h)|0)==4;e=q?1:e;if((a[f>>0]|0)!=37){q=(d4(f,104340)|0)==0;d=q?d:1;}if((e|0)!=0&(d|0)!=0){f=12;break}}if((f|0)==11)if(!e){c[i>>2]=b;gA(0,104345,i)|0;d=0;}else f=12;if((f|0)==12){q=KK(64)|0;k=c[k>>2]|0;c[q+32>>2]=k;m=c[m>>2]|0;c[q+40>>2]=(c[n>>2]|0)-k;c[q+36>>2]=(c[o>>2]|0)-m;c[q+8>>2]=b;o=c[47267]|0;c[47267]=o+1;c[q+12>>2]=o;Z4(A6(g)|0,j)|0;o=c[j+36>>2]|0;n=KK(o+1|0)|0;c[q+52>>2]=n;n5(g,0,0)|0;x6(n,o,1,g)|0;a[n+o>>0]=0;o=c[47266]|0;nb[c[o>>2]&63](o,q,1)|0;a[q+16>>0]=d;d=q;}I4(g)|0;}while(0);l=p;return d|0}function wM(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+52>>2]|0);return}function xM(a){a=a|0;U1(c[(c[a+16>>2]|0)+12>>2]|0);return}function yM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n+8|0;k=n;j=(d|0)!=0;a:do if(j){h=0;f=0;b:while(1)while(1){if(h)break a;g=c[d+(f<<2)>>2]|0;if(!g){i=6;break a}f=f+1|0;if(!(a[g>>0]|0)){h=1;continue b}}}else i=6;while(0);c:do if((i|0)==6)while(1){f=c[e>>2]|0;if(!f)break c;oF(b,f)|0;oF(b,153599)|0;e=e+4|0;i=6;}while(0);d:do if(j){h=0;while(1){f=c[d+(h<<2)>>2]|0;if(!f)break d;do if(a[f>>0]|0){e=mP(f)|0;if(!e){c[k>>2]=f;gA(0,104384,k)|0;break}g=$4(e,138821)|0;if(!g){c[m>>2]=e;gA(0,104412,m)|0;break}while(1){f=lP(g)|0;if(!f)break;oF(b,f)|0;}oF(b,153599)|0;I4(g)|0;}while(0);h=h+1|0;}}while(0);l=n;return}function zM(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;d=c[d+52>>2]|0;a:while(1){e=a[d>>0]|0;b:do switch(e<<24>>24){case 0:break a;case 37:{if((a[d+1>>0]|0)==37){e=d+2|0;if((((j3(e,104440,3)|0)!=0?(j3(e,104444,5)|0)!=0:0)?(j3(e,104450,3)|0)!=0:0)?(j3(e,104454,7)|0)!=0:0){e=37;break b}else g=37;c:while(1){switch(g<<24>>24){case 13:{f=10;break c}case 10:case 0:{f=12;break c}default:{}}g=d+1|0;d=g;g=a[g>>0]|0;}if((f|0)==10){e=d+1|0;if((a[e>>0]|0)==10){d=d+2|0;continue a}}else if((f|0)==12)e=d+1|0;d=g<<24>>24==0?d:e;continue a}else e=37;break}default:{}}while(0);d:while(1){switch(e<<24>>24){case 10:case 13:case 0:break d;default:{}}pF(b,e<<24>>24)|0;g=d+1|0;d=g;e=a[g>>0]|0;}f=d+1|0;if(e<<24>>24==13?(a[f>>0]|0)==10:0)d=d+2|0;else d=e<<24>>24==0?d:f;pF(b,10)|0;}return}function AM(b){b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;d=c[47266]|0;a:do if(d|0){d=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!d)break a;if(!(a[d+16>>0]|0)){c[e>>2]=c[d+12>>2];uF(b,104462,e);oF(b,104480)|0;zM(b,d);oF(b,104498)|0;oF(b,104513)|0;}g=c[47266]|0;d=nb[c[g>>2]&63](g,d,8)|0;}}while(0);l=f;return}function BM(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;e=g;a:do switch(d|0){case 0:{f=b;break}case 1:{f=fQ(b)|0;break}default:{switch(CM(b)|0){case 2:break;case 1:{f=fQ(b)|0;break a}default:{f=b;break a}}if(!(c[47268]|0)){gA(0,104525,e)|0;c[47268]=1;f=b;}else f=b;}}while(0);if(!(c[47269]|0))kA(189076,0,0);d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=40;e=f;b:while(1){switch(a[e>>0]|0){case 0:break b;case 92:case 41:case 40:{d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=92;break}default:{}}d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}h=a[e>>0]|0;c[47270]=d+1;a[d>>0]=h;e=e+1|0;}d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=41;if((f|0)!=(b|0))U1(f);d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}a[d>>0]=0;h=c[47269]|0;c[47270]=h;l=g;return h|0}function CM(b){b=b|0;var c=0,d=0;c=0;a:while(1){while(1){d=a[b>>0]|0;if(!(d<<24>>24))break a;if((d&255)<127)b=b+1|0;else break}if((d&-4)<<24>>24==-64){c=1;b=b+2|0;}else {c=2;break}}return c|0}function DM(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+96|0;i=n+80|0;j=n+72|0;m=n+64|0;g=n+32|0;k=n;h[g>>3]=+h[a>>3];h[g+8>>3]=+h[a+8>>3];h[g+16>>3]=+h[b>>3];h[g+24>>3]=+h[b+8>>3];do if((iY(d,g,j)|0)>=0){if(!f){b=d+4|0;a=c[b>>2]|0;f=c[47274]|0;if((a|0)>(c[47273]|0)){if(!f)a=KK(a<<5)|0;else a=MK(f,a<<5)|0;c[47274]=a;g=c[b>>2]|0;c[47273]=g;f=a;}else g=a;b=c[d>>2]|0;a=0;while(1){if((a|0)>=(g|0))break;o=f+(a<<5)|0;d=b+(a<<4)|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];o=f+(a<<5)+16|0;d=a+1|0;p=b+(((d|0)%(g|0)|0)<<4)|0;c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];a=d;}c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];if((OX(f,g,i,k,m)|0)<0){a=0;break}}else {c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];FY(i,m);}a=m+4|0;if(!(EM(c[a>>2]|0)|0)){g=c[a>>2]|0;a=c[47275]|0;f=c[m>>2]|0;b=0;while(1){if((b|0)>=(g|0))break;p=a+(b<<4)|0;o=f+(b<<4)|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];b=b+1|0;}c[e>>2]=g;}else a=0;}else a=0;while(0);l=n;return a|0}function EM(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=c[47276]|0;do if((b|0)<(a|0)){a=a+300-((a|0)%300|0)+b|0;b=MK(c[47275]|0,a<<4)|0;c[47275]=b;if(!b){gA(1,104615,d)|0;a=1;break}else {c[47276]=a;a=0;break}}else a=0;while(0);l=e;return a|0}function FM(){var a=0,b=0,d=0;b=l;l=l+16|0;a=b;d=c[47277]|0;c[47277]=d+1;do if((d|0)<=0){d=KK(4800)|0;c[47275]=d;if(!d){gA(1,104638,a)|0;a=1;break}c[47276]=300;c[47278]=0;c[47279]=0;if(0);else a=0;}else a=0;while(0);l=b;return a|0}function GM(){var a=0,b=0,d=0,e=0.0,f=0,g=0;b=l;l=l+16|0;a=b;d=c[47277]|0;c[47277]=d+-1;if((d|0)<=1?(U1(c[47275]|0),0):0){d=c[15712]|0;g=c[47278]|0;f=c[47279]|0;e=+UO();c[a>>2]=g;c[a+4>>2]=f;h[a+8>>3]=e;w4(d,104676,a)|0;}l=b;return}function HM(a,b){a=a|0;b=b|0;return IM(a,b,0)|0}function IM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;L=l;l=l+176|0;G=L+168|0;K=L+128|0;x=L+120|0;v=L+112|0;i=L+104|0;s=L+88|0;n=L+72|0;g=L+64|0;t=L+160|0;I=L+152|0;y=L+144|0;u=L+32|0;w=L;J=L+136|0;c[47278]=(c[47278]|0)+1;H=c[b+80>>2]|0;c[47279]=(c[47279]|0)+H;f=b+88|0;while(1){C=c[f>>2]|0;if(!C){D=4;break}f=c[C+16>>2]|0;if(!(a[f+112>>0]|0)){D=5;break}else f=f+116|0;}do if((D|0)==4){gA(1,104719,g)|0;f=0;}else if((D|0)==5){B=c[b+84>>2]|0;if(!(JM(H,B,b)|0)){g=H<<3;if((g|0)>(c[47280]|0)){f=c[47281]|0;if(!f)f=KK(H<<7)|0;else f=MK(f,H<<7)|0;c[47281]=f;c[47280]=g;}a:do if((H|0)>1?+h[B+8>>3]>+h[B+40>>3]:0){f=0;while(1){if((f|0)==(H|0)){p=1;break a}z=B+(f<<5)+24|0;m=+h[z>>3];A=B+(f<<5)+8|0;h[z>>3]=-+h[A>>3];h[A>>3]=-m;f=f+1|0;}}else p=0;while(0);r=c[C>>2]&3;z=C+48|0;f=c[((r|0)==3?C:z)+40>>2]|0;A=C+-48|0;if((f|0)==(c[((r|0)==2?C:A)+40>>2]|0)){c[i>>2]=KB(f)|0;gA(1,104826,i)|0;f=0;break}o=H+-1|0;q=c[47281]|0;r=q;f=0;j=0;b:while(1){if((j|0)>=(H|0)){j=o;n=f;break}if((j|0)>0)g=+h[B+(j<<5)+8>>3]>+h[B+(j+-1<<5)+8>>3]?-1:1;else g=0;if((j|0)<(o|0))i=+h[B+(j+1<<5)+8>>3]>+h[B+(j<<5)+8>>3]?1:-1;else i=0;c:do if((g|0)!=(i|0))if((g|0)==1|(i|0)==-1){g=B+(j<<5)|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+8|0;D=29;break}else {g=B+(j<<5)+16|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+24|0;D=29;break}else {switch(g|0){case -1:break c;case 0:break;default:{D=28;break b}}g=B+(j<<5)|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+8|0;D=29;}while(0);if((D|0)==29){D=0;h[q+(i<<4)+8>>3]=+h[g>>3];f=f+2|0;}j=j+1|0;}if((D|0)==28){c[n>>2]=g;c[n+4>>2]=g;c[n+8>>2]=480;gA(1,104761,n)|0;f=0;break}d:while(1){if((j|0)<=-1)break;if((j|0)<(o|0))f=+h[B+(j<<5)+8>>3]>+h[B+(j+1<<5)+8>>3]?-1:1;else f=0;if((j|0)>0)g=+h[B+(j+-1<<5)+8>>3]>+h[B+(j<<5)+8>>3]?1:-1;else g=0;e:do if((f|0)!=(g|0))if((f|0)==1|(g|0)==-1){f=B+(j<<5)|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+8|0;i=2;break}else {f=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+24|0;i=2;break}else switch(f|0){case 0:{f=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+24|0;i=2;break e}case -1:{N=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[N>>3];f=B+(j<<5)+8|0;i=n+1|0;h[q+(n<<4)+8>>3]=+h[f>>3];h[q+(i<<4)>>3]=+h[N>>3];N=B+(j<<5)+24|0;M=n+2|0;h[q+(i<<4)+8>>3]=+h[N>>3];i=B+(j<<5)|0;h[q+(M<<4)>>3]=+h[i>>3];g=n+3|0;h[q+(M<<4)+8>>3]=+h[N>>3];h[q+(g<<4)>>3]=+h[i>>3];i=4;break e}default:{D=42;break d}}while(0);h[q+(g<<4)+8>>3]=+h[f>>3];j=j+-1|0;n=n+i|0;}if((D|0)==42){c[s>>2]=f;c[s+4>>2]=f;c[s+8>>2]=513;gA(1,104761,s)|0;f=0;break}f:do if(!p)f=0;else {f=0;while(1){if((f|0)>=(H|0)){f=0;break}M=B+(f<<5)+24|0;m=+h[M>>3];N=B+(f<<5)+8|0;h[M>>3]=-+h[N>>3];h[N>>3]=-m;f=f+1|0;}while(1){if((f|0)>=(n|0)){f=0;break f}N=q+(f<<4)+8|0;h[N>>3]=-+h[N>>3];f=f+1|0;}}while(0);while(1){if((f|0)>=(H|0))break;h[B+(f<<5)>>3]=2147483647.0;h[B+(f<<5)+16>>3]=-2147483648.0;f=f+1|0;}c[t>>2]=r;i=t+4|0;c[i>>2]=n;h[u>>3]=+h[b>>3];h[u+8>>3]=+h[b+8>>3];h[u+16>>3]=+h[b+40>>3];h[u+24>>3]=+h[b+48>>3];if((iY(t,u,I)|0)<0){gA(1,104865,v)|0;f=0;break}if(!e){g=c[i>>2]|0;f=c[47274]|0;if((g|0)>(c[47273]|0)){if(!f)f=KK(g<<5)|0;else f=MK(f,g<<5)|0;c[47274]=f;g=c[i>>2]|0;c[47273]=g;}j=c[47281]|0;i=0;while(1){if((i|0)>=(g|0))break;M=f+(i<<5)|0;N=j+(i<<4)|0;c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];M=f+(i<<5)+16|0;N=i+1|0;v=j+(((N|0)%(g|0)|0)<<4)|0;c[M>>2]=c[v>>2];c[M+4>>2]=c[v+4>>2];c[M+8>>2]=c[v+8>>2];c[M+12>>2]=c[v+12>>2];i=N;}if(!(a[b+29>>0]|0)){k=0.0;m=0.0;}else {m=+h[b+16>>3];k=+E(+m);m=+F(+m);}h[w+8>>3]=m;h[w>>3]=k;if(!(a[b+69>>0]|0)){k=0.0;m=0.0;}else {m=+h[b+56>>3];k=-+E(+m);m=-+F(+m);}h[w+24>>3]=m;h[w+16>>3]=k;c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];if((OX(f,g,G,w,y)|0)<0){gA(1,104904,x)|0;f=0;break}}else {c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];FY(G,y);}n=y+4|0;if(!(EM(c[n>>2]|0)|0)){f=0;while(1){if((f|0)>=(H|0))break;h[B+(f<<5)>>3]=2147483647.0;h[B+(f<<5)+16>>3]=-2147483648.0;f=f+1|0;}i=c[n>>2]|0;j=c[47275]|0;g=c[y>>2]|0;f=0;while(1){if((f|0)>=(i|0)){i=1;f=10;g=0;break}N=j+(f<<4)|0;M=g+(f<<4)|0;c[N>>2]=c[M>>2];c[N+4>>2]=c[M+4>>2];c[N+8>>2]=c[M+8>>2];c[N+12>>2]=c[M+12>>2];f=f+1|0;}while(1){if(!((g|0)<15&i<<24>>24!=0))break;KM(B,H,c[47275]|0,c[n>>2]|0,f);j=0;while(1){if((j|0)>=(H|0))break;if(+h[B+(j<<5)>>3]==2147483647.0){D=82;break}if(+h[B+(j<<5)+16>>3]==-2147483648.0){D=82;break}j=j+1|0;}if((D|0)==82){D=0;N=f<<1;f=N;g=(N|0)>(2147483647/(H|0)|0|0)?15:g;}i=(j|0)==(H|0)?0:i;g=g+1|0;}if(i<<24>>24){M=KB(c[((c[C>>2]&3|0)==3?C:z)+40>>2]|0)|0;N=KB(c[((c[C>>2]&3|0)==2?C:A)+40>>2]|0)|0;c[K>>2]=M;c[K+4>>2]=N;gA(0,104942,K)|0;c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];FY(G,J);KM(B,H,c[J>>2]|0,c[J+4>>2]|0,10);U1(c[J>>2]|0);}c[d>>2]=c[n>>2];f=c[47275]|0;}else f=0;}else f=0;}while(0);l=L;return f|0}function JM(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0,L=0,M=0,N=0,O=0.0,P=0,Q=0,R=0;R=l;l=l+32|0;I=R+16|0;H=R+8|0;k=R;e=0;j=0;while(1){if((j|0)>=(a|0))break;i=b+(j<<5)|0;s=+h[b+(j<<5)+8>>3]-+h[b+(j<<5)+24>>3];if(!((s>=0.0?s:-s)<.01)?(s=+h[i>>3]-+h[b+(j<<5)+16>>3],!((s>=0.0?s:-s)<.01)):0){if((e|0)!=(j|0)){P=b+(e<<5)|0;c[P>>2]=c[i>>2];c[P+4>>2]=c[i+4>>2];c[P+8>>2]=c[i+8>>2];c[P+12>>2]=c[i+12>>2];c[P+16>>2]=c[i+16>>2];c[P+20>>2]=c[i+20>>2];c[P+24>>2]=c[i+24>>2];c[P+28>>2]=c[i+28>>2];}e=e+1|0;}j=j+1|0;}J=b+16|0;do if(!(+h[b>>3]>+h[J>>3])?(L=b+8|0,N=b+24|0,!(+h[L>>3]>+h[N>>3])):0){P=e+-1|0;M=c[15712]|0;w=0;while(1){if((w|0)>=(P|0))break;D=w+1|0;E=b+(D<<5)|0;f=+h[E>>3];F=b+(D<<5)+16|0;g=+h[F>>3];if(f>g){Q=16;break}A=b+(D<<5)+8|0;m=+h[A>>3];B=b+(D<<5)+24|0;n=+h[B>>3];if(m>n){Q=16;break}G=b+(w<<5)+16|0;v=+h[G>>3]>3]>g;a=u&1;z=b+(w<<5)+24|0;t=+h[z>>3]>3]>n;i=k&1;x=a+e+j+i|0;o=(x|0)!=0;if(!(0==0|o^1)){c[I>>2]=w;c[I+4>>2]=D;w4(M,105142,I)|0;LM(d);}a:do if(o){if(!v)if(!u)if(!t){if(k){k=0;o=e;e=B;i=y;Q=24;}}else {k=i;j=0;o=e;e=A;i=z;Q=24;}else {k=i;a=0;o=e;e=F;i=C;Q=24;}else {k=i;o=0;e=E;i=G;Q=24;}if((Q|0)==24){Q=0;w=~~+h[i>>3];h[i>>3]=+h[e>>3];h[e>>3]=+(w|0);i=k;e=o;}o=x+-1|0;k=0;while(1){if((k|0)>=(o|0))break a;do if((e|0)!=1){if((a|0)==1){s=+(~~((+h[F>>3]+ +h[C>>3])*.5+.5)|0);h[F>>3]=s;h[C>>3]=s;a=0;break}if((j|0)==1){s=+(~~((+h[A>>3]+ +h[z>>3])*.5+.5)|0);h[A>>3]=s;h[z>>3]=s;j=0;break}if((i|0)==1){s=+(~~((+h[B>>3]+ +h[y>>3])*.5+.5)|0);h[B>>3]=s;h[y>>3]=s;i=0;}}else {s=+(~~((+h[E>>3]+ +h[G>>3])*.5+.5)|0);h[E>>3]=s;h[G>>3]=s;e=0;}while(0);k=k+1|0;}}while(0);p=+h[C>>3];q=+h[G>>3];r=+h[E>>3];s=+h[F>>3];i=MM(~~p,~~q,~~r,~~s)|0;n=+h[y>>3];m=+h[z>>3];g=+h[A>>3];f=+h[B>>3];e=MM(~~n,~~m,~~g,~~f)|0;if(!((i|0)!=0&(e|0)!=0)){w=D;continue}if((i|0)<(e|0)){B=q-p>s-r;w=q>3]=B?(w?r:s):w?q:p;w=D;continue}else {B=m-n>f-g;w=m>3]=B?(w?g:f):w?m:n;w=D;continue}}if((Q|0)==16){c[H>>2]=D;gA(1,105096,H)|0;LM(d);e=1;break}f=+h[d>>3];g=+h[b>>3];if(!(((!(f+h[J>>3]):0)?(K=+h[d+8>>3],!(K<+h[L>>3])):0)?!(K>+h[N>>3]):0)){if(0);if(f>3]=g;else g=f;f=+h[J>>3];if(g>f)h[d>>3]=f;e=d+8|0;g=+h[e>>3];f=+h[L>>3];if(g>3]=f;g=f;}f=+h[N>>3];if(g>f)h[e>>3]=f;}i=d+40|0;f=+h[i>>3];e=b+(P<<5)|0;g=+h[e>>3];if(((!(f+h[b+(P<<5)+16>>3]):0)?(O=+h[d+48>>3],!(O<+h[b+(P<<5)+8>>3])):0)?!(O>+h[b+(P<<5)+24>>3]):0){e=0;break}if(0);if(f>3]=g;f=g;}g=+h[b+(P<<5)+16>>3];if(f>g)h[i>>3]=g;e=d+48|0;f=+h[e>>3];g=+h[b+(P<<5)+8>>3];if(f>3]=g;else g=f;f=+h[b+(P<<5)+24>>3];if(g>f){h[e>>3]=f;e=0;}else e=0;}else Q=12;while(0);if((Q|0)==12){gA(1,105051,k)|0;LM(d);e=1;}l=R;return e|0}function KM(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;s=O(e,b)|0;t=1.0/+(s|0);e=0;a:while(1){u=e+3|0;if((u|0)>=(d|0))break;o=c+(e<<4)|0;p=c+(e<<4)+8|0;r=e+1|0;q=c+(r<<4)|0;r=c+(r<<4)+8|0;j=e+2|0;i=c+(j<<4)|0;j=c+(j<<4)+8|0;k=c+(u<<4)|0;l=c+(u<<4)+8|0;g=0;while(1){if((g|0)>(s|0)){e=u;continue a}v=t*+(g|0);m=+h[o>>3];n=+h[p>>3];y=+h[q>>3];w=+h[r>>3];z=+h[i>>3];x=+h[j>>3];m=(y-m)*v+m;n=(w-n)*v+n;y=(z-y)*v+y;w=(x-w)*v+w;m=(y-m)*v+m;n=(w-n)*v+n;m=((z-y+(+h[k>>3]-z)*v)*v+y-m)*v+m;n=((x-w+(+h[l>>3]-x)*v)*v+w-n)*v+n;f=0;while(1){if((f|0)>=(b|0))break;if(n<=+h[a+(f<<5)+24>>3]+.0001?n>=+h[a+(f<<5)+8>>3]+-.0001:0){e=a+(f<<5)|0;if(+h[e>>3]>m)h[e>>3]=m;e=a+(f<<5)+16|0;if(+h[e>>3]>3]=m;}f=f+1|0;}g=g+1|0;}}return}function LM(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0;m=l;l=l+112|0;j=m+80|0;k=m+48|0;i=m+8|0;g=m;e=c[15712]|0;f=b+80|0;c[g>>2]=c[f>>2];w4(e,105268,g)|0;g=b+84|0;d=0;while(1){if((d|0)>=(c[f>>2]|0))break;r=c[g>>2]|0;q=+h[r+(d<<5)>>3];p=+h[r+(d<<5)+8>>3];o=+h[r+(d<<5)+16>>3];n=+h[r+(d<<5)+24>>3];c[i>>2]=d;h[i+8>>3]=q;h[i+16>>3]=p;h[i+24>>3]=o;h[i+32>>3]=n;w4(e,105279,i)|0;d=d+1|0;}q=+h[b+8>>3];p=+h[b+16>>3];r=a[b+29>>0]|0?105310:105322;h[k>>3]=+h[b>>3];h[k+8>>3]=q;h[k+16>>3]=p;c[k+24>>2]=r;w4(e,105338,k)|0;p=+h[b+48>>3];q=+h[b+56>>3];r=a[b+69>>0]|0?105310:105322;h[j>>3]=+h[b+40>>3];h[j+8>>3]=p;h[j+16>>3]=q;c[j+24>>2]=r;w4(e,105389,j)|0;l=m;return}function MM(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;do if((b|0)>(c|0)&(d|0)>(a|0)){if(!((c|0)>(a|0)|(d|0)<(a|0))){a=d-a|0;break}if((b|0)<(c|0)|(b|0)>(d|0)){b=b-a|0;a=d-c|0;a=(b|0)<(a|0)?b:a;break}else {a=b-c|0;break}}else a=0;while(0);return a|0}function NM(a,b){a=a|0;b=b|0;return IM(a,b,1)|0}function OM(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+80|0;g=j;i=1;f=b;while(1){h=f;f=c[(c[f+16>>2]|0)+172>>2]|0;if(!((f|0)!=0&(h|0)!=(f|0)))break;else i=i+1|0;}if((i|0)>=21)g=JK(i<<2)|0;h=0;f=b;while(1){if((h|0)>=(i|0))break;c[g+(h<<2)>>2]=f;h=h+1|0;f=c[(c[f+16>>2]|0)+172>>2]|0;}PM(a,g,i,d,e);if((i|0)>20)U1(g);l=j;return}function PM(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0,M=0.0,N=0.0,P=0,Q=0;K=l;l=l+304|0;A=K+272|0;z=K+208|0;G=K+96|0;H=K+32|0;I=K+16|0;J=K;r=K+192|0;y=K+176|0;i=K+160|0;B=K+296|0;D=K+288|0;j=c[d>>2]|0;w=c[j>>2]&3;k=j+-48|0;E=c[((w|0)==2?j:k)+40>>2]|0;t=G+16|0;w=(c[(c[((w|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+16|0;x=j+16|0;F=(c[x>>2]|0)+16|0;c[z>>2]=c[w>>2];c[z+4>>2]=c[w+4>>2];c[z+8>>2]=c[w+8>>2];c[z+12>>2]=c[w+12>>2];c[A>>2]=c[F>>2];c[A+4>>2]=c[F+4>>2];c[A+8>>2]=c[F+8>>2];c[A+12>>2]=c[F+12>>2];QM(r,z,A);c[G>>2]=c[r>>2];c[G+4>>2]=c[r+4>>2];c[G+8>>2]=c[r+8>>2];c[G+12>>2]=c[r+12>>2];c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];c[I>>2]=c[r>>2];c[I+4>>2]=c[r+4>>2];c[I+8>>2]=c[r+8>>2];c[I+12>>2]=c[r+12>>2];r=G+32|0;F=G+48|0;w=(c[E+16>>2]|0)+16|0;x=(c[x>>2]|0)+56|0;c[z>>2]=c[w>>2];c[z+4>>2]=c[w+4>>2];c[z+8>>2]=c[w+8>>2];c[z+12>>2]=c[w+12>>2];c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];QM(y,z,A);c[F>>2]=c[y>>2];c[F+4>>2]=c[y+4>>2];c[F+8>>2]=c[y+8>>2];c[F+12>>2]=c[y+12>>2];c[r>>2]=c[y>>2];c[r+4>>2]=c[y+4>>2];c[r+8>>2]=c[y+8>>2];c[r+12>>2]=c[y+12>>2];c[J>>2]=c[y>>2];c[J+4>>2]=c[y+4>>2];c[J+8>>2]=c[y+8>>2];c[J+12>>2]=c[y+12>>2];a:do if((e|0)!=1&(a[194954]|0)==0){m=+h[G>>3];n=+h[F>>3];L=m-n;o=+h[G+8>>3];p=+h[G+56>>3];s=o-p;q=s*s;if(q+L*L<1.0e-06){c[t>>2]=c[G>>2];c[t+4>>2]=c[G+4>>2];c[t+8>>2]=c[G+8>>2];c[t+12>>2]=c[G+12>>2];c[r>>2]=c[F>>2];c[r+4>>2]=c[F+4>>2];c[r+8>>2]=c[F+8>>2];c[r+12>>2]=c[F+12>>2];y=G+24|0;x=G+40|0;n=0.0;m=0.0;}else {M=n-m;L=+C(+(q+M*M));w=c[(c[(c[b+60>>2]|0)+16>>2]|0)+248>>2]|0;N=+((O(w,e+-1|0)|0)/2|0|0);q=s*N/L;h[t>>3]=q+m;m=M*N/L;y=G+24|0;h[y>>3]=m+o;h[r>>3]=q+n;x=G+40|0;h[x>>3]=p+m;m=+(0-w|0);n=M*m/L;m=s*m/L;}f=(f|0)==6;u=D+4|0;v=B+4|0;j=0;while(1){if((j|0)>=(e|0))break a;w=c[d+(j<<2)>>2]|0;k=w+-48|0;b:do if((c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0)==(E|0)){c[I>>2]=c[G>>2];c[I+4>>2]=c[G+4>>2];c[I+8>>2]=c[G+8>>2];c[I+12>>2]=c[G+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];i=0;while(1){if((i|0)==4)break b;P=H+(i<<4)|0;Q=G+(i<<4)|0;c[P>>2]=c[Q>>2];c[P+4>>2]=c[Q+4>>2];c[P+8>>2]=c[Q+8>>2];c[P+12>>2]=c[Q+12>>2];i=i+1|0;}}else {c[I>>2]=c[F>>2];c[I+4>>2]=c[F+4>>2];c[I+8>>2]=c[F+8>>2];c[I+12>>2]=c[F+12>>2];c[J>>2]=c[G>>2];c[J+4>>2]=c[G+4>>2];c[J+8>>2]=c[G+8>>2];c[J+12>>2]=c[G+12>>2];i=0;while(1){if((i|0)==4)break b;Q=H+(3-i<<4)|0;P=G+(i<<4)|0;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];i=i+1|0;}}while(0);if(f){c[u>>2]=4;c[D>>2]=z;i=0;while(1){if((i|0)==4)break;Q=z+(i<<4)|0;P=H+(i<<4)|0;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];i=i+1|0;}c[A>>2]=c[D>>2];c[A+4>>2]=c[D+4>>2];FY(A,B);dO(w,c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0,c[B>>2]|0,c[v>>2]|0,g);}else dO(w,c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0,H,4,g);c[z>>2]=c[I>>2];c[z+4>>2]=c[I+4>>2];c[z+8>>2]=c[I+8>>2];c[z+12>>2]=c[I+12>>2];c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];yO(b,w,z,A);h[t>>3]=+h[t>>3]+m;h[y>>3]=+h[y>>3]+n;h[r>>3]=+h[r>>3]+m;h[x>>3]=+h[x>>3]+n;j=j+1|0;}}else {if((f|0)==4){RM(i,b);c[A>>2]=c[i>>2];c[A+4>>2]=c[i+4>>2];c[A+8>>2]=c[i+8>>2];c[A+12>>2]=c[i+12>>2];SM(G,A);}dO(j,c[((c[j>>2]&3|0)==2?j:k)+40>>2]|0,G,4,g);c[z>>2]=c[I>>2];c[z+4>>2]=c[I+4>>2];c[z+8>>2]=c[I+8>>2];c[z+12>>2]=c[I+12>>2];c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];yO(b,j,z,A);}while(0);l=K;return}function QM(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function RM(a,b){a=a|0;b=b|0;b=c[b+16>>2]|0;h[23305]=(+h[b+32>>3]+ +h[b+16>>3])*.5;h[23306]=(+h[b+40>>3]+ +h[b+24>>3])*.5;c[a>>2]=c[46610];c[a+4>>2]=c[46611];c[a+8>>2]=c[46612];c[a+12>>2]=c[46613];return}function SM(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;f=+h[a>>3];d=+h[a+48>>3];i=(d+f)*.5;g=+h[a+8>>3];c=+h[a+56>>3];e=(c+g)*.5;f=d-f;g=c-g;f=+C(+(g*g+f*f))*.2;g=+h[b>>3]-i;c=+h[b+8>>3]-e;d=+C(+(c*c+g*g));if(!(d==0.0)){g=i-g/d*f;i=e-c/d*f;h[a+32>>3]=g;h[a+16>>3]=g;h[a+40>>3]=i;h[a+24>>3]=i;}return}function TM(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0.0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0.0,G=0,H=0.0,I=0.0,J=0.0;E=l;l=l+208|0;t=E+192|0;s=E+176|0;B=E+32|0;w=E+16|0;x=E;y=E+160|0;z=E+144|0;u=E+128|0;v=E+112|0;g=e&2130706432;A=(e&8|0)==0?((g|0)==0?4:g):8;if((A|0)==436207616)UM(a,b,d,f);else {D=JK((d<<6)+64|0)|0;p=d+-1|0;q=x+8|0;r=w+8|0;o=12.0;e=0;while(1){if((e|0)>=(d|0))break;n=b+(e<<4)|0;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];if((e|0)<(p|0)){e=e+1|0;n=b+(e<<4)|0;c[x>>2]=c[n>>2];c[x+4>>2]=c[n+4>>2];c[x+8>>2]=c[n+8>>2];c[x+12>>2]=c[n+12>>2];}else {c[x>>2]=c[b>>2];c[x+4>>2]=c[b+4>>2];c[x+8>>2]=c[b+8>>2];c[x+12>>2]=c[b+12>>2];e=e+1|0;}m=+h[x>>3]-+h[w>>3];F=+h[q>>3]-+h[r>>3];m=+C(+(F*F+m*m))*.3333333333333333;o=o=(d|0))break;g=b+(i<<4)|0;c[w>>2]=c[g>>2];c[w+4>>2]=c[g+4>>2];c[w+8>>2]=c[g+8>>2];c[w+12>>2]=c[g+12>>2];if((i|0)<(p|0)){g=b+(i+1<<4)|0;c[x>>2]=c[g>>2];c[x+4>>2]=c[g+4>>2];c[x+8>>2]=c[g+8>>2];c[x+12>>2]=c[g+12>>2];}else {c[x>>2]=c[b>>2];c[x+4>>2]=c[b+4>>2];c[x+8>>2]=c[b+8>>2];c[x+12>>2]=c[b+12>>2];}m=+h[x>>3]-+h[w>>3];F=+h[q>>3]-+h[r>>3];m=o/+C(+(F*F+m*m));m=k?m*.3333333333333333:j?m*.5:m;g=D+(e<<4)|0;if(n){c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(y,m*.5,s,t);c[g>>2]=c[y>>2];c[g+4>>2]=c[y+4>>2];c[g+8>>2]=c[y+8>>2];c[g+12>>2]=c[y+12>>2];}else {c[g>>2]=c[w>>2];c[g+4>>2]=c[w+4>>2];c[g+8>>2]=c[w+8>>2];c[g+12>>2]=c[w+12>>2];}g=D+(e+1<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(z,m,s,t);c[g>>2]=c[z>>2];c[g+4>>2]=c[z+4>>2];c[g+8>>2]=c[z+8>>2];c[g+12>>2]=c[z+12>>2];g=e+3|0;G=D+(e+2<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(u,1.0-m,s,t);c[G>>2]=c[u>>2];c[G+4>>2]=c[u+4>>2];c[G+8>>2]=c[u+8>>2];c[G+12>>2]=c[u+12>>2];if(n){G=D+(g<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(v,1.0-m*.5,s,t);c[G>>2]=c[v>>2];c[G+4>>2]=c[v+4>>2];c[G+8>>2]=c[v+8>>2];c[G+12>>2]=c[v+12>>2];e=e+4|0;}else e=g;i=i+1|0;}k=D+(e<<4)|0;c[k>>2]=c[D>>2];c[k+4>>2]=c[D+4>>2];c[k+8>>2]=c[D+8>>2];c[k+12>>2]=c[D+12>>2];k=D+(e+1<<4)|0;j=D+16|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];e=D+(e+2<<4)|0;k=D+32|0;c[e>>2]=c[k>>2];c[e+4>>2]=c[k+4>>2];c[e+8>>2]=c[k+8>>2];c[e+12>>2]=c[k+12>>2];e=A&2147483647;a:do if((e|0)<201326592){if((e|0)>=83886080){if((e|0)<134217728){if((e|0)<100663296){switch(e|0){case 83886080:break;default:break a}if((d|0)==4){G=JK(192)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];p=G+16|0;t=b+16|0;c[p>>2]=c[t>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[p+12>>2]=c[t+12>>2];p=D+48|0;t=D+64|0;o=+h[t>>3];n=G+32|0;h[n>>3]=o;q=D+56|0;r=D+72|0;H=+h[r>>3];z=G+40|0;h[z>>3]=H;F=+h[p>>3]+o-+h[k>>3];u=G+48|0;h[u>>3]=F;J=+h[q>>3]+H-+h[D+40>>3];x=G+56|0;h[x>>3]=J;I=+h[t>>3]+F-+h[p>>3];p=G+64|0;h[p>>3]=I;m=+h[r>>3]+J-+h[q>>3];q=G+72|0;h[q>>3]=m;r=G+80|0;h[r>>3]=o+I-F;h[G+88>>3]=H+m-J;t=D+96|0;v=D+80|0;J=+h[v>>3];d=G+144|0;h[d>>3]=J;w=D+104|0;s=D+88|0;m=+h[s>>3];h[G+152>>3]=m;H=+h[t>>3]+J-+h[D+112>>3];y=G+128|0;h[y>>3]=H;F=+h[w>>3]+m-+h[D+120>>3];A=G+136|0;h[A>>3]=F;I=+h[v>>3]+H-+h[t>>3];t=G+112|0;h[t>>3]=I;o=+h[s>>3]+F-+h[w>>3];w=G+120|0;h[w>>3]=o;s=G+96|0;h[s>>3]=J+I-H;v=G+104|0;h[v>>3]=m+o-F;k=G+160|0;j=b+32|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];k=G+176|0;b=b+48|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];nS(a,G,12,f);c[B>>2]=c[n>>2];c[B+4>>2]=c[n+4>>2];c[B+8>>2]=c[n+8>>2];c[B+12>>2]=c[n+12>>2];F=+h[n>>3];o=+h[u>>3];F=F+F-o;u=B+16|0;h[u>>3]=F;m=+h[z>>3];H=+h[x>>3];m=m+m-H;x=B+24|0;h[x>>3]=m;z=B+32|0;h[z>>3]=+h[p>>3]+F-o;b=B+40|0;h[b>>3]=+h[q>>3]+m-H;f=B+48|0;c[f>>2]=c[r>>2];c[f+4>>2]=c[r+4>>2];c[f+8>>2]=c[r+8>>2];c[f+12>>2]=c[r+12>>2];qS(a,B,4);c[B>>2]=c[s>>2];c[B+4>>2]=c[s+4>>2];c[B+8>>2]=c[s+8>>2];c[B+12>>2]=c[s+12>>2];H=+h[s>>3];m=+h[t>>3];H=H-(m-H);h[u>>3]=H;o=+h[v>>3];F=+h[w>>3];o=o-(F-o);h[x>>3]=o;h[z>>3]=+h[y>>3]+H-m;h[b>>3]=+h[A>>3]+o-F;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];qS(a,B,4);U1(G);break}else qa(105438,105449,737,105458);}if((e|0)<117440512){switch(e|0){case 100663296:break;default:break a}y=d+5|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];H=(+h[b>>3]-H)*.625+H;h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;v=D+48|0;w=D+56|0;x=D+72|0;J=(+h[d>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*1.5;h[G+8>>3]=J;I=+h[z>>3];I=(+h[b>>3]-I)*.25+I;h[G+16>>3]=I;h[G+24>>3]=J;h[G+32>>3]=I;F=+h[A>>3];h[G+40>>3]=(+h[d>>3]-F)*.5+F;I=(+h[k>>3]-+h[v>>3])*.5+I;h[G+48>>3]=I;F=+h[A>>3];h[G+56>>3]=(+h[d>>3]-F)*.5+F;h[G+64>>3]=I;I=+h[A>>3];I=(+h[d>>3]-I)*.5+I+(+h[w>>3]-+h[x>>3]);h[G+72>>3]=I;h[G+80>>3]=H;h[G+88>>3]=I;h[G+96>>3]=H;I=I-(+h[w>>3]-+h[x>>3])*.25;h[G+104>>3]=I;h[G+112>>3]=+h[k>>3]+H-+h[v>>3];h[G+120>>3]=(+h[w>>3]-+h[x>>3])*.5+I;h[G+128>>3]=+h[G>>3];h[G+136>>3]=(+h[w>>3]-+h[x>>3])*.25+J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 117440512:break;default:break a}d=d+1|0;G=JK(d<<4)|0;h[G>>3]=+h[j>>3];z=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[z>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[D+48>>3];J=+h[z>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];B=b+40|0;h[G+40>>3]=(+h[z>>3]-+h[A>>3])*.5+ +h[B>>3];h[G+48>>3]=+h[j>>3];h[G+56>>3]=(+h[z>>3]-+h[A>>3])*.5+ +h[B>>3];J=+h[b+8>>3];h[G+72>>3]=J-(J-+h[b+56>>3])*.5;h[G+64>>3]=+h[b>>3];nS(a,G,d,f);U1(G);break}}if((e|0)<167772160)if((e|0)<150994944){switch(e|0){case 134217728:break;default:break a}y=d+4|0;G=JK(y<<4)|0;z=b+16|0;F=+h[z>>3];x=D+48|0;F=(+h[b>>3]-F)*.5+F+(+h[k>>3]-+h[x>>3])*.25;h[G>>3]=F;A=b+40|0;J=+h[A>>3];d=b+24|0;J=(+h[d>>3]-J)*.5+J;h[G+8>>3]=J;h[G+16>>3]=F;v=D+56|0;w=D+72|0;H=(+h[v>>3]-+h[w>>3])*.5+J;h[G+24>>3]=H;F=(+h[k>>3]-+h[x>>3])*.5+F;h[G+32>>3]=F;h[G+40>>3]=H;h[G+48>>3]=F;F=(+h[v>>3]-+h[w>>3])*.5+H;h[G+56>>3]=F;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.75;h[G+64>>3]=I;h[G+72>>3]=F;h[G+80>>3]=I;h[G+88>>3]=H;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.25;h[G+96>>3]=I;h[G+104>>3]=H;h[G+112>>3]=I;h[G+120>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 150994944:break;default:break a}y=d+2|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];x=D+48|0;H=(+h[b>>3]-H)*.5+H+(+h[k>>3]-+h[x>>3])*.75;h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;J=(+h[d>>3]-J)*.5+J;h[G+8>>3]=J;h[G+16>>3]=H;v=D+56|0;w=D+72|0;H=(+h[v>>3]-+h[w>>3])*.25+J;h[G+24>>3]=H;I=+h[z>>3];h[G+32>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*.25;I=(+h[v>>3]-+h[w>>3])*.5+H;h[G+40>>3]=I;F=+h[z>>3];h[G+48>>3]=(+h[b>>3]-F)*.5+F+(+h[k>>3]-+h[x>>3])*-.25;h[G+56>>3]=I;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.75;h[G+64>>3]=I;h[G+72>>3]=H;h[G+80>>3]=I;h[G+88>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else if((e|0)<184549376){switch(e|0){case 167772160:break;default:break a}y=d+1|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];v=D+48|0;H=+h[k>>3]+H+(+h[b>>3]-H)*.5-+h[v>>3];h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;w=D+56|0;x=D+72|0;J=(+h[d>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*.25;h[G+8>>3]=J;H=H-+h[k>>3]+ +h[v>>3];h[G+16>>3]=H;h[G+24>>3]=+h[w>>3]+J-+h[x>>3];h[G+32>>3]=H;H=(+h[w>>3]-+h[x>>3])*.5+J;h[G+40>>3]=H;I=+h[z>>3];I=(+h[b>>3]-I)*.25+I;h[G+48>>3]=I;h[G+56>>3]=H;h[G+64>>3]=I;h[G+72>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 184549376:break;default:break a}z=d+4|0;G=JK(z<<4)|0;y=b+16|0;H=+h[y>>3];I=+h[b>>3]-H;u=D+48|0;I=I*.125+H+(+h[k>>3]-+h[u>>3]+I)*.5;h[G>>3]=I;w=b+40|0;H=+h[w>>3];x=b+24|0;d=D+56|0;v=D+72|0;H=(+h[x>>3]-H)*.5+H+(+h[d>>3]-+h[v>>3])*.25;h[G+8>>3]=H;J=+h[y>>3];J=(+h[b>>3]-J)*.375+J;h[G+16>>3]=J;h[G+24>>3]=H;h[G+32>>3]=J;H=(+h[d>>3]-+h[v>>3])*.5+H;h[G+40>>3]=H;J=J-(+h[k>>3]-+h[u>>3])*.5;h[G+48>>3]=J;h[G+56>>3]=H;A=G+64|0;h[A>>3]=J;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[d>>3]-+h[v>>3])*-.25;h[G+72>>3]=J;H=I-(+h[k>>3]-+h[u>>3])*.5;h[G+80>>3]=H;h[G+88>>3]=J;h[G+96>>3]=H;J=J-(+h[d>>3]-+h[v>>3])*.5;h[G+104>>3]=J;v=G+112|0;h[v>>3]=I;h[G+120>>3]=J;nS(a,G,z,f);h[B>>3]=+h[y>>3];J=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-J)*.5+J;z=B+16|0;h[z>>3]=+h[A>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);h[B>>3]=+h[v>>3];J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=+h[b>>3];h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<33554432){if((e|0)<8){switch(e|0){case 4:break;default:break a}i=KK((d*96|0)+32|0)|0;e=0;g=0;while(1){j=g|1;k=i+(g<<4)|0;if((e|0)>=(d|0))break;b=e<<2;G=D+(b<<4)|0;c[k>>2]=c[G>>2];c[k+4>>2]=c[G+4>>2];c[k+8>>2]=c[G+8>>2];c[k+12>>2]=c[G+12>>2];G=i+(j<<4)|0;B=D+((b|1)<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+2<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+3<<4)|0;B=D+((b|2)<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+4<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+5<<4)|0;b=D+((b|3)<<4)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];e=e+1|0;g=g+6|0;}c[k>>2]=c[i>>2];c[k+4>>2]=c[i+4>>2];c[k+8>>2]=c[i+8>>2];c[k+12>>2]=c[i+12>>2];d=i+(j<<4)|0;G=i+16|0;c[d>>2]=c[G>>2];c[d+4>>2]=c[G+4>>2];c[d+8>>2]=c[G+8>>2];c[d+12>>2]=c[G+12>>2];pS(a,G,j,0,0,f&255);U1(i);break}if((e|0)<16777216){switch(e|0){case 8:break;default:break a}nS(a,b,d,f);g=B+16|0;e=0;while(1){if((e|0)>=(d|0))break a;G=e*3|0;f=D+(G+2<<4)|0;c[B>>2]=c[f>>2];c[B+4>>2]=c[f+4>>2];c[B+8>>2]=c[f+8>>2];c[B+12>>2]=c[f+12>>2];G=D+(G+4<<4)|0;c[g>>2]=c[G>>2];c[g+4>>2]=c[G+4>>2];c[g+8>>2]=c[G+8>>2];c[g+12>>2]=c[G+12>>2];qS(a,B,2);e=e+1|0;}}switch(e|0){case 16777216:break;default:break a}g=d+1|0;i=JK(g<<4)|0;e=1;while(1){if((e|0)>=(d|0))break;G=i+(e<<4)|0;A=b+(e<<4)|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];e=e+1|0;}b=d*3|0;A=D+(b+1<<4)|0;c[i>>2]=c[A>>2];c[i+4>>2]=c[A+4>>2];c[i+8>>2]=c[A+8>>2];c[i+12>>2]=c[A+12>>2];d=i+(d<<4)|0;G=D+(b+-1<<4)|0;c[d>>2]=c[G>>2];c[d+4>>2]=c[G+4>>2];c[d+8>>2]=c[G+8>>2];c[d+12>>2]=c[G+12>>2];nS(a,i,g,f);U1(i);c[B>>2]=c[G>>2];c[B+4>>2]=c[G+4>>2];c[B+8>>2]=c[G+8>>2];c[B+12>>2]=c[G+12>>2];G=B+16|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];f=B+32|0;h[f>>3]=+h[B>>3]+ +h[G>>3]-+h[D+(b<<4)>>3];h[B+40>>3]=+h[B+8>>3]+ +h[B+24>>3]-+h[D+(b<<4)+8>>3];qS(a,G,2);c[G>>2]=c[f>>2];c[G+4>>2]=c[f+4>>2];c[G+8>>2]=c[f+8>>2];c[G+12>>2]=c[f+12>>2];qS(a,B,2);break}else {if((e|0)<50331648){switch(e|0){case 33554432:break;default:break a}g=d+2|0;i=JK(g<<4)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];j=i+16|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];j=D+48|0;d=D+64|0;h[i+32>>3]=(+h[j>>3]-+h[d>>3])*.3333333333333333+ +h[k>>3];G=D+56|0;e=D+72|0;h[i+40>>3]=(+h[G>>3]-+h[e>>3])*.3333333333333333+ +h[D+40>>3];J=+h[j>>3];h[i+48>>3]=(J-+h[d>>3])*.3333333333333333+J;J=+h[G>>3];h[i+56>>3]=(J-+h[e>>3])*.3333333333333333+J;e=4;while(1){if((e|0)>=(g|0))break;G=i+(e<<4)|0;d=b+(e+-2<<4)|0;c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];e=e+1|0;}nS(a,i,g,f);U1(i);c[B>>2]=c[j>>2];c[B+4>>2]=c[j+4>>2];c[B+8>>2]=c[j+8>>2];c[B+12>>2]=c[j+12>>2];G=B+16|0;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];c[G+8>>2]=c[k+8>>2];c[G+12>>2]=c[k+12>>2];qS(a,B,2);break}if((e|0)>=67108864){switch(e|0){case 67108864:break;default:break a}if((d|0)==4){G=JK(96)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];d=G+16|0;c[d>>2]=c[k>>2];c[d+4>>2]=c[k+4>>2];c[d+8>>2]=c[k+8>>2];c[d+12>>2]=c[k+12>>2];d=G+32|0;A=D+64|0;c[d>>2]=c[A>>2];c[d+4>>2]=c[A+4>>2];c[d+8>>2]=c[A+8>>2];c[d+12>>2]=c[A+12>>2];d=G+48|0;b=b+32|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];b=G+64|0;d=D+128|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=G+80|0;z=D+160|0;c[b>>2]=c[z>>2];c[b+4>>2]=c[z+4>>2];c[b+8>>2]=c[z+8>>2];c[b+12>>2]=c[z+12>>2];nS(a,G,6,f);U1(G);h[B>>3]=+h[D+176>>3]+ +h[j>>3]-+h[D>>3];h[B+8>>3]=+h[D+184>>3]+ +h[D+24>>3]-+h[D+8>>3];G=B+16|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];qS(a,B,2);c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];qS(a,B,2);c[G>>2]=c[D>>2];c[G+4>>2]=c[D+4>>2];c[G+8>>2]=c[D+8>>2];c[G+12>>2]=c[D+12>>2];qS(a,B,2);break}else qa(105438,105449,714,105458);}switch(e|0){case 50331648:break;default:break a}g=d+3|0;i=JK(g<<4)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];J=+h[b>>3];h[i+16>>3]=J-(J-+h[j>>3])*.25;e=D+56|0;J=(+h[e>>3]-+h[D+72>>3])*.3333333333333333+ +h[b+8>>3];h[i+24>>3]=J;I=+h[b>>3];h[i+32>>3]=I-(I-+h[j>>3])*2.0;h[i+40>>3]=J;J=+h[b>>3];h[i+48>>3]=J-(J-+h[j>>3])*2.25;h[i+56>>3]=+h[e>>3];h[i+64>>3]=+h[D+48>>3];h[i+72>>3]=+h[e>>3];e=4;while(1){if((e|0)>=(g|0))break;G=i+(e<<4)|0;d=b+(e+-3<<4)|0;c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];e=e+1|0;}nS(a,i,g,f);U1(i);break}}else if((e|0)<318767104){if((e|0)<251658240){if((e|0)<218103808){switch(e|0){case 201326592:break;default:break a}G=d<<4;u=JK(G)|0;v=b+16|0;J=+h[v>>3];h[u>>3]=J;z=b+40|0;I=+h[z>>3];A=b+24|0;y=D+48|0;w=D+56|0;x=D+72|0;I=(+h[A>>3]-I)*.5+I+(+h[w>>3]-+h[x>>3])*.125;h[u+8>>3]=I;H=(+h[k>>3]-+h[y>>3])*2.0+J;h[u+16>>3]=H;h[u+24>>3]=I;h[u+32>>3]=H;I=(+h[w>>3]-+h[x>>3])*.5+I;h[u+40>>3]=I;h[u+48>>3]=J;h[u+56>>3]=I;nS(a,u,d,f);U1(u);G=JK(G)|0;I=+h[k>>3]+ +h[v>>3]-+h[y>>3];h[G>>3]=I;J=+h[z>>3];J=(+h[A>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*-.625;h[G+8>>3]=J;H=+h[k>>3]-+h[y>>3]+I;y=G+16|0;h[y>>3]=H;h[G+24>>3]=J;h[G+32>>3]=H;J=(+h[w>>3]-+h[x>>3])*.5+J;h[G+40>>3]=J;h[G+48>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[y>>3];J=+h[z>>3];h[B+8>>3]=(+h[A>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}if((e|0)<234881024){switch(e|0){case 218103808:break;default:break a}G=d<<4;w=JK(G)|0;J=+h[b>>3];h[w>>3]=J;y=b+40|0;I=+h[y>>3];z=b+24|0;x=D+56|0;A=D+72|0;I=(+h[z>>3]-I)*.5+I+(+h[x>>3]-+h[A>>3])*.125;h[w+8>>3]=I;h[w+16>>3]=J;H=(+h[x>>3]-+h[A>>3])*.5+I;h[w+24>>3]=H;J=J-(+h[x>>3]-+h[A>>3])*2.0;h[w+32>>3]=J;h[w+40>>3]=H;h[w+48>>3]=J;h[w+56>>3]=I;nS(a,w,d,f);U1(w);G=JK(G)|0;I=+h[b>>3]-+h[k>>3]+ +h[D+48>>3];h[G>>3]=I;J=+h[y>>3];J=(+h[z>>3]-J)*.5+J+(+h[x>>3]-+h[A>>3])*-.625;h[G+8>>3]=J;h[G+16>>3]=I;H=(+h[x>>3]-+h[A>>3])*.5+J;h[G+24>>3]=H;I=I-(+h[x>>3]-+h[A>>3]);h[G+32>>3]=I;h[G+40>>3]=H;A=G+48|0;h[A>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[b+16>>3];J=+h[y>>3];h[B+8>>3]=(+h[z>>3]-J)*.5+J;h[B+16>>3]=+h[A>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 234881024:break;default:break a}G=d<<4;y=JK(G)|0;u=b+16|0;I=+h[u>>3];v=D+48|0;I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*-1.125;h[y>>3]=I;w=b+40|0;J=+h[w>>3];x=b+24|0;A=D+56|0;z=D+72|0;J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*.125;h[y+8>>3]=J;H=+h[k>>3]-+h[v>>3]+I;h[y+16>>3]=H;h[y+24>>3]=J;h[y+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[y+40>>3]=J;h[y+48>>3]=I;h[y+56>>3]=J;nS(a,y,d,f);U1(y);y=JK(G)|0;J=+h[u>>3];J=(+h[b>>3]-J)*.5+J+(+h[k>>3]-+h[v>>3])*-1.125;h[y>>3]=J;I=+h[w>>3];I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*-.625;h[y+8>>3]=I;H=+h[k>>3]-+h[v>>3]+J;h[y+16>>3]=H;h[y+24>>3]=I;h[y+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[y+40>>3]=I;h[y+48>>3]=J;h[y+56>>3]=I;nS(a,y,d,f);U1(y);y=JK(G)|0;I=+h[u>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*.125;h[y>>3]=I;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*-.625;h[y+8>>3]=J;H=+h[k>>3]-+h[v>>3]+I;h[y+16>>3]=H;h[y+24>>3]=J;h[y+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[y+40>>3]=J;h[y+48>>3]=I;h[y+56>>3]=J;nS(a,y,d,f);U1(y);G=JK(G)|0;J=+h[u>>3];J=(+h[b>>3]-J)*.5+J+(+h[k>>3]-+h[v>>3])*.125;h[G>>3]=J;I=+h[w>>3];I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*.125;h[G+8>>3]=I;H=+h[k>>3]-+h[v>>3]+J;y=G+16|0;h[y>>3]=H;h[G+24>>3]=I;h[G+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[G+40>>3]=I;h[G+48>>3]=J;h[G+56>>3]=I;nS(a,G,d,f);h[B>>3]=+h[y>>3];I=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-I)*.5+I;z=B+16|0;h[z>>3]=+h[b>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+I;qS(a,B,2);I=+h[u>>3];h[B>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*-1.125;J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=I;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<285212672)if((e|0)<268435456){switch(e|0){case 251658240:break;default:break a}G=d<<4;u=JK(G)|0;v=b+16|0;J=+h[v>>3];y=D+48|0;J=J-+h[k>>3]+(+h[b>>3]-J)*.5+ +h[y>>3];h[u>>3]=J;w=b+40|0;I=+h[w>>3];x=b+24|0;A=D+56|0;z=D+72|0;I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*.125;h[u+8>>3]=I;H=(+h[k>>3]-+h[y>>3])*2.0+J;h[u+16>>3]=H;h[u+24>>3]=I;h[u+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[u+40>>3]=I;h[u+48>>3]=J;h[u+56>>3]=I;nS(a,u,d,f);U1(u);G=JK(G)|0;I=+h[v>>3];I=I-+h[k>>3]+(+h[b>>3]-I)*.5+ +h[y>>3];h[G>>3]=I;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*-.625;h[G+8>>3]=J;H=(+h[k>>3]-+h[y>>3])*2.0+I;y=G+16|0;h[y>>3]=H;h[G+24>>3]=J;h[G+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[G+40>>3]=J;h[G+48>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[y>>3];J=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-J)*.5+J;z=B+16|0;h[z>>3]=+h[b>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);h[B>>3]=+h[v>>3];J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=+h[G>>3];h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 268435456:break;default:break a}G=JK(d<<4)|0;h[G>>3]=+h[b>>3];v=D+48|0;x=D+56|0;y=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[x>>3]-+h[y>>3])*.5;h[G+16>>3]=+h[v>>3];J=+h[x>>3];h[G+24>>3]=J-(J-+h[y>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=(+h[x>>3]-+h[y>>3])*.5+ +h[z>>3];h[G+48>>3]=+h[b>>3];h[G+56>>3]=(+h[x>>3]-+h[y>>3])*.5+ +h[z>>3];nS(a,G,d,f);w=b+16|0;J=(+h[k>>3]-+h[v>>3])*.25;I=J+ +h[w>>3];h[B>>3]=I;H=+h[z>>3];u=b+24|0;F=+h[x>>3]-+h[y>>3];H=(+h[u>>3]-H)*.5+H+F*.125;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J+I;f=B+24|0;h[f>>3]=H-F*.25;qS(a,B,2);F=(+h[k>>3]-+h[v>>3])*.25;H=F+ +h[w>>3];h[B>>3]=H;I=+h[z>>3];J=+h[x>>3]-+h[y>>3];I=(+h[u>>3]-I)*.5+I+J*-.125;h[A>>3]=I;h[d>>3]=F+H;h[f>>3]=J*.25+I;qS(a,B,2);I=(+h[k>>3]-+h[v>>3])*.25;h[B>>3]=I+ +h[w>>3];J=(+h[x>>3]-+h[y>>3])*.75+ +h[z>>3];h[A>>3]=J;h[d>>3]=+h[b>>3]-I;h[f>>3]=J;qS(a,B,2);U1(G);break}else if((e|0)<301989888){switch(e|0){case 285212672:break;default:break a}y=JK(d<<4)|0;v=b+16|0;I=+h[v>>3];z=D+48|0;I=(+h[k>>3]-+h[z>>3]+(+h[b>>3]-I))*.5+I;h[y>>3]=I;w=b+40|0;F=+h[w>>3];x=b+24|0;F=(+h[k>>3]-+h[z>>3]+(+h[x>>3]-F))*.5+F;h[y+8>>3]=F;h[y+16>>3]=I;I=+h[w>>3];o=+h[k>>3]-+h[z>>3];I=(+h[x>>3]-I-o)*.5+I;h[y+24>>3]=I;J=+h[v>>3];J=(+h[b>>3]-J-o)*.5+J;h[y+32>>3]=J;h[y+40>>3]=I;h[y+48>>3]=J;h[y+56>>3]=F;nS(a,y,d,f);U1(y);F=+h[v>>3];F=(+h[b>>3]-F)*.5+F;J=+h[k>>3]-+h[z>>3];I=J*.75;o=F+I;h[B>>3]=o;H=+h[w>>3];H=(+h[x>>3]-H)*.5+H;I=H+I;y=B+8|0;h[y>>3]=I;A=B+16|0;h[A>>3]=o;J=J*-.75;H=H+J;G=B+24|0;h[G>>3]=H;J=F+J;h[B+32>>3]=J;h[B+40>>3]=H;h[B+48>>3]=J;h[B+56>>3]=I;d=B+64|0;c[d>>2]=c[B>>2];c[d+4>>2]=c[B+4>>2];c[d+8>>2]=c[B+8>>2];c[d+12>>2]=c[B+12>>2];qS(a,B,5);I=+h[v>>3];J=+h[b>>3];h[B>>3]=(J-I)*.5+I+(+h[k>>3]-+h[z>>3])*.75;I=+h[w>>3];h[y>>3]=(+h[x>>3]-I)*.5+I;h[A>>3]=J;d=b+8|0;f=b+56|0;h[G>>3]=(+h[d>>3]-+h[f>>3])*.5+I;qS(a,B,2);I=+h[v>>3];h[B>>3]=I;J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[A>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[z>>3])*-.75;h[G>>3]=(+h[d>>3]-+h[f>>3])*.5+J;qS(a,B,2);break}else {switch(e|0){case 301989888:break;default:break a}A=d+12|0;G=JK(A<<4)|0;x=b+16|0;m=+h[x>>3];s=D+48|0;m=(+h[b>>3]-m)*.5+m+(+h[k>>3]-+h[s>>3])*.25;h[G>>3]=m;y=b+40|0;F=+h[y>>3];z=b+24|0;v=D+56|0;w=D+72|0;F=(+h[v>>3]-+h[w>>3]+(+h[z>>3]-F))*.5+F;u=G+8|0;h[u>>3]=F;h[G+16>>3]=m;F=(+h[v>>3]-+h[w>>3])*.125+F;t=G+24|0;h[t>>3]=F;H=m-(+h[k>>3]-+h[s>>3])*.125;d=G+32|0;h[d>>3]=H;o=(+h[v>>3]-+h[w>>3])*.125+F;h[G+40>>3]=o;h[G+48>>3]=m;I=(+h[v>>3]-+h[w>>3])*.125+o;h[G+56>>3]=I;h[G+64>>3]=m;m=(+h[v>>3]-+h[w>>3])*.125+I;h[G+72>>3]=m;h[G+80>>3]=H;h[G+88>>3]=m;H=+h[x>>3];H=(+h[b>>3]-H)*.5+H;h[G+96>>3]=H;h[G+104>>3]=I;J=H-(+h[k>>3]-+h[s>>3])*.125;h[G+112>>3]=J;h[G+120>>3]=m;J=J-(+h[k>>3]-+h[s>>3])*.125;h[G+128>>3]=J;h[G+136>>3]=m;h[G+144>>3]=J;h[G+152>>3]=I;I=(+h[k>>3]-+h[s>>3])*.125+J;h[G+160>>3]=I;h[G+168>>3]=o;h[G+176>>3]=J;h[G+184>>3]=F;h[G+192>>3]=J;J=+h[u>>3];h[G+200>>3]=J;h[G+208>>3]=I;h[G+216>>3]=J;u=G+224|0;h[u>>3]=H;h[G+232>>3]=+h[t>>3];h[G+240>>3]=+h[d>>3];h[G+248>>3]=J;nS(a,G,A,f);J=+h[u>>3];h[B>>3]=J;H=+h[y>>3];H=(+h[z>>3]-H)*.5+H;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J;f=B+24|0;h[f>>3]=(+h[v>>3]-+h[w>>3])*.125+H;qS(a,B,2);H=+h[u>>3];h[B>>3]=H;J=+h[y>>3];I=+h[v>>3]-+h[w>>3];J=(+h[z>>3]-J)*.5+J+I*.25;h[A>>3]=J;h[d>>3]=H;h[f>>3]=I*.125+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}}else {if((e|0)<369098752){if((e|0)<335544320){switch(e|0){case 318767104:break;default:break a}A=d+4|0;G=JK(A<<4)|0;x=b+16|0;H=+h[x>>3];d=D+48|0;H=(+h[b>>3]-H)*.5+H+(+h[k>>3]-+h[d>>3])*.125;h[G>>3]=H;y=b+40|0;J=+h[y>>3];z=b+24|0;v=D+56|0;w=D+72|0;J=(+h[v>>3]-+h[w>>3]+(+h[z>>3]-J))*.5+J;h[G+8>>3]=J;o=(+h[k>>3]-+h[d>>3])*.125+H;h[G+16>>3]=o;I=(+h[v>>3]-+h[w>>3])*.125+J;h[G+24>>3]=I;h[G+32>>3]=o;o=(+h[v>>3]-+h[w>>3])*.25+I;h[G+40>>3]=o;h[G+48>>3]=H;F=(+h[v>>3]-+h[w>>3])*.125+o;h[G+56>>3]=F;H=H-(+h[k>>3]-+h[d>>3])*.25;h[G+64>>3]=H;h[G+72>>3]=F;F=H-(+h[k>>3]-+h[d>>3])*.125;h[G+80>>3]=F;h[G+88>>3]=o;h[G+96>>3]=F;h[G+104>>3]=I;h[G+112>>3]=H;h[G+120>>3]=J;nS(a,G,A,f);J=+h[x>>3];J=(+h[b>>3]-J)*.5+J;h[B>>3]=J;H=+h[y>>3];H=(+h[z>>3]-H)*.5+H;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J;f=B+24|0;h[f>>3]=(+h[v>>3]-+h[w>>3])*.125+H;qS(a,B,2);H=+h[x>>3];H=(+h[b>>3]-H)*.5+H;h[B>>3]=H;J=+h[y>>3];I=+h[v>>3]-+h[w>>3];J=(+h[z>>3]-J)*.5+J+I*.25;h[A>>3]=J;h[d>>3]=H;h[f>>3]=I*.125+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}if((e|0)<352321536){switch(e|0){case 335544320:break;default:break a}x=d+12|0;G=JK(x<<4)|0;y=b+16|0;m=+h[y>>3];u=D+48|0;m=(+h[b>>3]-m)*.5+m+(+h[k>>3]-+h[u>>3])*.25;h[G>>3]=m;z=b+40|0;F=+h[z>>3];A=b+24|0;s=D+56|0;t=D+72|0;F=(+h[s>>3]-+h[t>>3]+(+h[A>>3]-F))*.5+F;d=G+8|0;h[d>>3]=F;h[G+16>>3]=m;F=(+h[s>>3]-+h[t>>3])*.125+F;v=G+24|0;h[v>>3]=F;I=m-(+h[k>>3]-+h[u>>3])*.125;w=G+32|0;h[w>>3]=I;o=(+h[s>>3]-+h[t>>3])*.125+F;h[G+40>>3]=o;h[G+48>>3]=m;H=(+h[s>>3]-+h[t>>3])*.125+o;h[G+56>>3]=H;h[G+64>>3]=m;m=(+h[s>>3]-+h[t>>3])*.125+H;h[G+72>>3]=m;h[G+80>>3]=I;h[G+88>>3]=m;I=+h[y>>3];I=(+h[b>>3]-I)*.5+I;h[G+96>>3]=I;h[G+104>>3]=H;J=I-(+h[k>>3]-+h[u>>3])*.125;h[G+112>>3]=J;h[G+120>>3]=m;J=J-(+h[k>>3]-+h[u>>3])*.125;h[G+128>>3]=J;h[G+136>>3]=m;h[G+144>>3]=J;h[G+152>>3]=H;H=(+h[k>>3]-+h[u>>3])*.125+J;h[G+160>>3]=H;h[G+168>>3]=o;h[G+176>>3]=J;h[G+184>>3]=F;h[G+192>>3]=J;J=+h[d>>3];h[G+200>>3]=J;h[G+208>>3]=H;h[G+216>>3]=J;d=G+224|0;h[d>>3]=I;h[G+232>>3]=+h[v>>3];h[G+240>>3]=+h[w>>3];h[G+248>>3]=J;nS(a,G,x,f);c[B>>2]=c[d>>2];c[B+4>>2]=c[d+4>>2];c[B+8>>2]=c[d+8>>2];c[B+12>>2]=c[d+12>>2];d=B+16|0;h[d>>3]=+h[B>>3];J=+h[z>>3];f=B+24|0;h[f>>3]=(+h[A>>3]-J)*.5+J;qS(a,B,2);h[B>>3]=+h[y>>3];J=+h[z>>3];h[B+8>>3]=(+h[A>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 352321536:break;default:break a}A=d+4|0;G=JK(A<<4)|0;x=b+16|0;I=+h[x>>3];w=D+48|0;I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[w>>3])*.125;h[G>>3]=I;y=b+40|0;J=+h[y>>3];z=b+24|0;u=D+56|0;v=D+72|0;J=(+h[u>>3]-+h[v>>3]+(+h[z>>3]-J))*.5+J;d=G+8|0;h[d>>3]=J;o=(+h[k>>3]-+h[w>>3])*.125+I;h[G+16>>3]=o;H=(+h[u>>3]-+h[v>>3])*.125+J;h[G+24>>3]=H;h[G+32>>3]=o;o=(+h[u>>3]-+h[v>>3])*.25+H;h[G+40>>3]=o;h[G+48>>3]=I;F=(+h[u>>3]-+h[v>>3])*.125+o;h[G+56>>3]=F;I=I-(+h[k>>3]-+h[w>>3])*.25;h[G+64>>3]=I;h[G+72>>3]=F;F=I-(+h[k>>3]-+h[w>>3])*.125;h[G+80>>3]=F;h[G+88>>3]=o;h[G+96>>3]=F;h[G+104>>3]=H;h[G+112>>3]=I;h[G+120>>3]=J;nS(a,G,A,f);J=+h[x>>3];J=(+h[b>>3]-J)*.5+J;h[B>>3]=J;A=B+8|0;h[A>>3]=+h[d>>3];d=B+16|0;h[d>>3]=J;J=+h[y>>3];f=B+24|0;h[f>>3]=(+h[z>>3]-J)*.5+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<402653184)if((e|0)<385875968){switch(e|0){case 369098752:break;default:break a}d=d+5|0;G=JK(d<<4)|0;B=D+48|0;h[G>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;y=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[y>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[B>>3];J=+h[y>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=+h[z>>3];J=+h[k>>3];h[G+48>>3]=(J-+h[B>>3])*.5+J;h[G+56>>3]=+h[z>>3];J=+h[k>>3];h[G+64>>3]=(J-+h[B>>3])*.5+J;h[G+72>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+80>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;h[G+88>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;z=b+56|0;h[G+104>>3]=+h[z>>3];A=b+8|0;J=+h[A>>3];h[G+120>>3]=J-(J-+h[z>>3])*.5;h[G+112>>3]=+h[b>>3];h[G+136>>3]=+h[A>>3];h[G+128>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;nS(a,G,d,f);U1(G);break}else {switch(e|0){case 385875968:break;default:break a}d=d+3|0;G=JK(d<<4)|0;B=D+48|0;h[G>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;y=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[y>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[B>>3];J=+h[y>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+48>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;h[G+56>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+64>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;z=b+56|0;h[G+72>>3]=+h[z>>3];A=b+8|0;J=+h[A>>3];h[G+88>>3]=J-(J-+h[z>>3])*.5;h[G+80>>3]=+h[b>>3];h[G+104>>3]=+h[A>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;nS(a,G,d,f);U1(G);break}else if((e|0)<419430400){switch(e|0){case 402653184:break;default:break a}d=d+3|0;G=JK(d<<4)|0;h[G>>3]=+h[b>>3];y=b+8|0;z=D+48|0;A=D+56|0;B=D+72|0;h[G+8>>3]=+h[y>>3]-(+h[A>>3]-+h[B>>3])*.5;J=+h[k>>3];h[G+16>>3]=(J-+h[z>>3])*.5+J;h[G+24>>3]=+h[y>>3]-(+h[A>>3]-+h[B>>3])*.5;J=+h[k>>3];h[G+32>>3]=(J-+h[z>>3])*.5+J;h[G+40>>3]=+h[D+40>>3];h[G+48>>3]=+h[b+16>>3];J=+h[b+24>>3];y=b+40|0;h[G+56>>3]=J-(J-+h[y>>3])*.5;J=+h[k>>3];h[G+64>>3]=(J-+h[z>>3])*.5+J;h[G+72>>3]=+h[y>>3];h[G+88>>3]=(+h[A>>3]-+h[B>>3])*.5+ +h[y>>3];J=+h[k>>3];h[G+80>>3]=(J-+h[z>>3])*.5+J;h[G+104>>3]=(+h[A>>3]-+h[B>>3])*.5+ +h[b+56>>3];h[G+96>>3]=+h[b>>3];nS(a,G,d,f);U1(G);break}else {switch(e|0){case 419430400:break;default:break a}d=d+5|0;G=JK(d<<4)|0;h[G>>3]=+h[b>>3];B=b+8|0;A=D+48|0;y=D+56|0;z=D+72|0;h[G+8>>3]=+h[B>>3]-(+h[y>>3]-+h[z>>3])*.5;J=+h[k>>3];h[G+16>>3]=(J-+h[A>>3])*.5+J;h[G+24>>3]=+h[B>>3]-(+h[y>>3]-+h[z>>3])*.5;J=+h[k>>3];h[G+32>>3]=(J-+h[A>>3])*.5+J;h[G+40>>3]=+h[D+40>>3];h[G+48>>3]=+h[b+16>>3];J=+h[b+24>>3];B=b+40|0;h[G+56>>3]=J-(J-+h[B>>3])*.5;J=+h[k>>3];h[G+64>>3]=(J-+h[A>>3])*.5+J;h[G+72>>3]=+h[B>>3];h[G+88>>3]=(+h[y>>3]-+h[z>>3])*.5+ +h[B>>3];J=+h[k>>3];h[G+80>>3]=(J-+h[A>>3])*.5+J;B=b+56|0;h[G+104>>3]=(+h[y>>3]-+h[z>>3])*.5+ +h[B>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[A>>3])*.5;h[G+112>>3]=+h[j>>3]-(+h[k>>3]-+h[A>>3])*.5;h[G+120>>3]=+h[B>>3];h[G+128>>3]=+h[b+48>>3];h[G+136>>3]=+h[B>>3];nS(a,G,d,f);U1(G);break}}while(0);U1(D);}l=E;return}function UM(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0;f=l;l=l+112|0;g=f;k=+h[b+8>>3]*2.0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];h[g+16>>3]=+h[b+16>>3];h[g+24>>3]=k-+h[b+24>>3];h[g+32>>3]=+h[b+32>>3];h[g+40>>3]=k-+h[b+40>>3];h[g+48>>3]=+h[b+48>>3];h[g+56>>3]=k-+h[b+56>>3];h[g+64>>3]=+h[b+64>>3];h[g+72>>3]=k-+h[b+72>>3];h[g+80>>3]=+h[b+80>>3];h[g+88>>3]=k-+h[b+88>>3];i=g+96|0;j=b+96|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];pS(a,b,d,0,0,e&255);pS(a,g,7,0,0,0);l=f;return}function VM(a,b,c,d){a=a|0;b=+b;c=c|0;d=d|0;var e=0.0,f=0.0;f=+h[c>>3];e=+h[c+8>>3];e=(+h[d+8>>3]-e)*b+e;h[a>>3]=(+h[d>>3]-f)*b+f;h[a+8>>3]=e;return}function WM(a){a=a|0;a=c[(c[a+16>>2]|0)+8>>2]|0;if(a){a=c[c[a+4>>2]>>2]|0;if((a|0)!=91)if((a|0)==94)a=2;else return ((a|0)==93?3:(a|0)==96?4:0)|0;else a=1;}else a=0;return a|0}function XM(b){b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0,D=0,G=0,H=0,I=0,J=0,L=0,M=0,N=0,P=0.0,Q=0.0,R=0,S=0,T=0.0,U=0.0,V=0.0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0.0;aa=l;l=l+144|0;J=aa+112|0;N=aa+104|0;G=aa+96|0;H=aa+88|0;i=aa+80|0;Y=aa+64|0;_=aa+48|0;R=aa+40|0;S=aa+32|0;j=aa+24|0;p=aa+16|0;D=aa+136|0;A=aa+128|0;L=aa;$=JK(48)|0;Z=b+16|0;W=c[(c[(c[Z>>2]|0)+8>>2]|0)+8>>2]|0;g=(W|0)==1616;X=c[W>>2]|0;d=c[W+4>>2]|0;e=c[W+8>>2]|0;m=+h[W+16>>3];n=+h[W+32>>3];o=+h[W+24>>3];X=X|(dP(QA(b,105511)|0)|0)&255;do if(!g){if(!X){W=c[Z>>2]|0;k=+h[W+32>>3]*72.0;f=+h[W+40>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);k=+(~~(k+(k>=0.0?.5:-.5))|0);break}k=+fN(b);if(k>0.0)f=k;else {W=c[Z>>2]|0;f=+h[W+32>>3];k=+h[W+40>>3];k=(f=0.0?.5:-.5))|0);f=k;}}else {f=0.0;k=0.0;}while(0);W=ZO(b,c[47160]|0,d,0)|0;V=+_O(b,c[47162]|0,0.0,-360.0)+m;if(!e){U=+_O(b,c[47163]|0,0.0,-100.0);I=ZO(b,c[47159]|0,4,0)|0;T=+_O(b,c[47164]|0,0.0,-100.0);}else {I=e;U=n;T=o;}d=c[(c[Z>>2]|0)+104>>2]|0;e=d+24|0;c[Y>>2]=c[e>>2];c[Y+4>>2]=c[e+4>>2];c[Y+8>>2]=c[e+8>>2];c[Y+12>>2]=c[e+12>>2];q=+h[Y>>3];if(q>0.0){if(!g)M=11;}else if(!(g|!(+h[Y+8>>3]>0.0)))M=11;if((M|0)==11){d=QA(b,105496)|0;do if(d){h[p>>3]=0.0;h[j>>3]=0.0;c[i>>2]=j;c[i+4>>2]=p;d=b5(d,105503,i)|0;m=+h[j>>3];if(m<0.0){h[j>>3]=0.0;m=0.0;}n=+h[p>>3];if(n<0.0){h[p>>3]=0.0;o=0.0;}else o=n;if((d|0)<=0){n=q+16.0;h[Y>>3]=n;m=8.0;break}m=m*72.0;m=+(~~(m+(m>=0.0?.5:-.5))<<1|0);n=q+m;h[Y>>3]=n;if((d|0)!=1){m=o*72.0;m=+(~~(m+(m>=0.0?.5:-.5))<<1|0);}}else {n=q+16.0;h[Y>>3]=n;m=8.0;}while(0);d=Y+8|0;h[d>>3]=+h[d>>3]+m;d=c[(c[Z>>2]|0)+104>>2]|0;q=n;}s=+h[d+24>>3];m=+h[c[(c[(xC(b)|0)+16>>2]|0)+8>>2]>>3];if(m>0.0){P=m*72.0;P=+(~~(P+(P>=0.0?.5:-.5))|0);Q=+gN(q,P);h[Y>>3]=Q;p=Y+8|0;h[p>>3]=+gN(+h[p>>3],P);}else Q=q;d=c[(c[Z>>2]|0)+8>>2]|0;do if(!(a[d+12>>0]|0)){e=QA(b,109025)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0){RF(A,xC(b)|0,e);d=c[A>>2]|0;g=c[A+4>>2]|0;if((g&d|0)==-1){d=KB(b)|0;c[G>>2]=e;c[G+4>>2]=d;gA(0,105587,G)|0;e=0;d=0;break}else {a[(c[(xC(b)|0)+16>>2]|0)+114>>0]=1;e=d+2|0;d=g+2|0;break}}else {e=0;d=0;}}else {d=c[d>>2]|0;if((a[d>>0]|0)==99?(s2(d,105519)|0)==0:0){e=QA(b,105526)|0;RF(D,xC(b)|0,e);d=c[D>>2]|0;g=c[D+4>>2]|0;if((g&d|0)==-1){d=KB(b)|0;c[H>>2]=e|0?e:105536;c[H+4>>2]=d;gA(0,105542,H)|0;e=0;d=0;break}else {a[(c[(xC(b)|0)+16>>2]|0)+114>>0]=1;e=d+2|0;d=g+2|0;break}}else {e=0;d=0;}}while(0);P=+(e|0);h[_>>3]=Q>P?Q:P;P=+h[Y+8>>3];r=+(d|0);d=_+8|0;h[d>>3]=P>r?P:r;e=(I|0)<3&(T!=0.0|U!=0.0)?120:I;g=QA(b,105628)|0;if(!g)i=99;else {i=a[g>>0]|0;i=i<<24>>24==116?116:i<<24>>24==98?98:99;}g=c[Z>>2]|0;a[(c[g+104>>2]|0)+80>>0]=i;if((e|0)==4?(T==0.0?((~~(V+(V>=0.0?.5:-.5))|0)%90|0|0)==0:0)&U==0.0:0)p=1;else M=39;do if((M|0)==39){g=c[(c[(c[g+8>>2]|0)+8>>2]|0)+44>>2]|0;if(g|0){p=c[g>>2]|0;c[J>>2]=c[_>>2];c[J+4>>2]=c[_+4>>2];c[J+8>>2]=c[_+8>>2];c[J+12>>2]=c[_+12>>2];ub[p&63](L,J);c[_>>2]=c[L>>2];c[_+4>>2]=c[L+4>>2];c[_+8>>2]=c[L+8>>2];c[_+12>>2]=c[L+12>>2];p=0;break}m=+h[d>>3];n=m*1.4142135623730951;if(f>n&i<<24>>24==99){o=m/f;o=+C(+(1.0/(1.0-o*o)));o=+h[_>>3]*o;h[_>>3]=o;}else {o=+h[_>>3]*1.4142135623730951;h[_>>3]=o;h[d>>3]=n;m=n;}if((e|0)>2){z=+E(+(3.141592653589793/+(e|0)));h[_>>3]=o/z;h[d>>3]=m/z;p=0;}else p=0;}while(0);m=+h[d>>3];g=aP(b,c[47165]|0,137308)|0;if((a[g>>0]|0)==115?(s2(g,108230)|0)==0:0){h[_>>3]=k;h[d>>3]=f;N=$+40|0;c[N>>2]=c[N>>2]|2048;}else {if(!((dP(g)|0)<<24>>24)){z=+h[_>>3];k=k>z?k:z;h[_>>3]=k;z=+h[d>>3];f=f>z?f:z;}else {M=c[(c[Z>>2]|0)+104>>2]|0;if(!(!(k<+h[M+24>>3])?!(f<+h[M+32>>3]):0)){L=KB(b)|0;M=KB(xC(b)|0)|0;c[N>>2]=L;c[N+4>>2]=M;gA(0,105637,N)|0;}h[_>>3]=k;}h[d>>3]=f;}if(!X){z=f;y=k;}else {y=k>f?k:f;h[d>>3]=y;h[_>>3]=y;z=y;}do if(!((dP(aP(b,c[47156]|0,137308)|0)|0)<<24>>24)){if(p){f=+h[(Q>+h[_>>3]?Y:_)>>3];break}f=+h[d>>3];if(P>3]*+C(+(1.0-P*P/(f*f)));f=Q>f?Q:f;}else f=Q;}else f=Q;while(0);g=c[(c[Z>>2]|0)+104>>2]|0;h[g+40>>3]=s-q+f;A=$+40|0;if(!(c[A>>2]&2048)){x=+h[d>>3]-m;h[g+48>>3]=(P1;g=j?W:1;a:do if((e|0)<3){g=JK(g<<5)|0;k=+h[_>>3]*.5;f=+h[d>>3]*.5;h[g>>3]=-k;h[g+8>>3]=-f;h[g+16>>3]=k;h[g+24>>3]=f;if(j){e=1;i=2;while(1){if((e|0)==(W|0))break;y=k+4.0;z=f+4.0;h[g+(i<<4)>>3]=-y;h[g+(i<<4)+8>>3]=-z;S=i|1;h[g+(S<<4)>>3]=y;h[g+(S<<4)+8>>3]=z;e=e+1|0;i=i+2|0;k=y;f=z;}h[_>>3]=k*2.0;h[d>>3]=f*2.0;e=2;}else e=2;}else {g=JK(O(g<<4,e)|0)|0;i=c[(c[(c[(c[Z>>2]|0)+8>>2]|0)+8>>2]|0)+44>>2]|0;b:do if(!i){q=6.283185307179586/+(e|0);t=q*.5;r=+F(+t);s=+L2(+B(+U)+ +B(+T),1.0);t=T*1.4142135623730951/+E(+t);u=U*.5;N2((q+-3.141592653589793)*.5,R,S);v=V*.017453292519943295;k=0.0;f=0.0;m=0.0;i=0;n=+h[S>>3]*.5;o=+h[R>>3]*.5;while(1){if((i|0)>=(e|0))break b;m=m+q;N2(m,R,S);n=+h[S>>3]*r+n;o=+h[R>>3]*r+o;x=(o*t+s)*n+u*o;N2(+K(+o,+x)+v,R,S);x=+L2(x,o);w=+h[S>>3]*x*+h[_>>3];x=+h[R>>3]*x*+h[d>>3];ba=+B(+w);f=ba>f?ba:f;ba=+B(+x);k=ba>k?ba:k;h[g+(i<<4)>>3]=w;h[g+(i<<4)+8>>3]=x;if(p)break;else i=i+1|0;}ba=-w;h[g+16>>3]=ba;h[g+24>>3]=x;h[g+32>>3]=ba;ba=-x;h[g+40>>3]=ba;h[g+48>>3]=w;h[g+56>>3]=ba;}else {ub[c[i+4>>2]&63](g,_);k=+h[d>>3]*.5;f=+h[_>>3]*.5;}while(0);f=f*2.0;k=k*2.0;y=y>f?y:f;h[_>>3]=y;ba=z>k?z:k;h[d>>3]=ba;f=y/f;k=ba/k;i=0;while(1){if((i|0)>=(e|0))break;N=g+(i<<4)|0;b=g+(i<<4)+8|0;ba=+h[b>>3]*k;h[N>>3]=+h[N>>3]*f;h[b>>3]=ba;i=i+1|0;}if(j){j=e+-1|0;k=+h[g>>3];m=+h[g+8>>3];f=+K(+(m-+h[g+(j<<4)+8>>3]),+(k-+h[g+(j<<4)>>3]));j=0;c:while(1){if((j|0)>=(e|0))break;p=j+1|0;i=(p|0)%(e|0)|0;n=+h[g+(i<<4)>>3];o=+h[g+(i<<4)+8>>3];q=+K(+(o-m),+(n-k));z=(f+3.141592653589793-q)*.5;ba=4.0/+F(+z);N2(f-z,R,S);h[R>>3]=+h[R>>3]*ba;h[S>>3]=+h[S>>3]*ba;i=1;f=m;while(1){if((i|0)==(W|0)){f=q;j=p;k=n;m=o;continue c}z=+h[S>>3]+k;ba=+h[R>>3]+f;b=(O(i,e)|0)+j|0;h[g+(b<<4)>>3]=z;h[g+(b<<4)+8>>3]=ba;i=i+1|0;k=z;f=ba;}}j=O(e,W+-1|0)|0;i=0;while(1){if((i|0)>=(e|0))break a;S=i+j|0;z=+h[g+(S<<4)+8>>3];y=+B(+(+h[g+(S<<4)>>3]))*2.0;ba=+h[_>>3];h[_>>3]=y>ba?y:ba;z=+B(+z)*2.0;ba=+h[d>>3];h[d>>3]=z>ba?z:ba;i=i+1|0;}}}while(0);c[$>>2]=X;c[$+4>>2]=W;c[$+8>>2]=e;h[$+16>>3]=V;h[$+32>>3]=U;h[$+24>>3]=T;c[$+44>>2]=g;f=+h[_>>3];if(!(c[A>>2]&2048)){e=c[Z>>2]|0;h[e+32>>3]=f*.013888888888888888;}else {e=c[Z>>2]|0;h[e+32>>3]=+h[(Q>f?Y:_)>>3]*.013888888888888888;d=(P>+h[d>>3]?Y:_)+8|0;}h[e+40>>3]=+h[d>>3]*.013888888888888888;c[e+12>>2]=$;l=aa;return}function YM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+64|0;j=o+40|0;e=o+32|0;k=o+16|0;n=o;d=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]|0)>>>2&1^1;m=a+16|0;f=c[c[(c[m>>2]|0)+104>>2]>>2]|0;c[47282]=f;f=l2(f)|0;f=JK(((f|0)>1?f:1)+1|0)|0;b=_M(a,d,1,f)|0;if(!b){c[e>>2]=c[c[(c[m>>2]|0)+104>>2]>>2];gA(1,105472,e)|0;c[47282]=105493;b=_M(a,d,1,f)|0;}U1(f);$M(j,a,b);d=c[m>>2]|0;i=+h[d+32>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))|0);h[n>>3]=i;g=+h[d+40>>3]*72.0;g=+(~~(g+(g>=0.0?.5:-.5))|0);d=n+8|0;h[d>>3]=g;if(!((dP(aP(a,c[47165]|0,137308)|0)|0)<<24>>24)){i=+h[(+h[b>>3]>i?b:n)>>3];h[n>>3]=i;e=b+8|0;g=+h[(+h[e>>3]>g?b:n)+8>>3];h[d>>3]=g;d=e;e=b;}else {d=b+8|0;e=b;}a=(dP(aP(a,c[47156]|0,137308)|0)|0)&255;c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];aN(b,j,a);bN(k,i*-.5,g*.5);c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];cN(b,j,15);n=c[m>>2]|0;h[n+32>>3]=+h[e>>3]*.013888888888888888;h[n+40>>3]=(+h[d>>3]+1.0)*.013888888888888888;c[n+12>>2]=b;l=o;return}function ZM(a){a=a|0;var b=0.0,d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0.0,m=0;j=JK(48)|0;k=a+16|0;g=c[(c[(c[(c[k>>2]|0)+8>>2]|0)+8>>2]|0)+4>>2]|0;f=+_O(a,c[47146]|0,1797693134862315708145274.0e284,0.0);b=+_O(a,c[47145]|0,1797693134862315708145274.0e284,0.0);f=f0.0?(f>.0003?f:.0003):f;i=c[k>>2]|0;h[i+40>>3]=f;h[i+32>>3]=f;b=f*72.0;g=ZO(a,c[47160]|0,g,0)|0;i=JK((g|0)<1?32:g<<5)|0;f=f*36.0;e=-f;h[i>>3]=e;h[i+8>>3]=e;h[i+16>>3]=f;h[i+24>>3]=f;if((g|0)>1){a=1;d=2;e=f;b=f;while(1){if((a|0)==(g|0))break;l=e+4.0;f=b+4.0;h[i+(d<<4)>>3]=-l;h[i+(d<<4)+8>>3]=-f;m=d|1;h[i+(m<<4)>>3]=l;h[i+(m<<4)+8>>3]=f;a=a+1|0;d=d+2|0;e=l;b=f;}b=e*2.0;}c[j>>2]=1;c[j+4>>2]=g;c[j+8>>2]=2;m=j+16|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[m+16>>2]=0;c[m+20>>2]=0;c[j+44>>2]=i;l=b*.013888888888888888;m=c[k>>2]|0;h[m+32>>3]=l;h[m+40>>3]=l;c[m+12>>2]=j;return}function _M(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;g=JK(72)|0;n=c[(c[b+16>>2]|0)+104>>2]|0;m=0;i=1;j=c[47282]|0;a:while(1){k=a[j>>0]|0;switch(k<<24>>24){case 0:break a;case 92:{j=j+1|0;k=a[j>>0]|0;switch(k<<24>>24){case 124:case 125:case 123:case 92:{l=m;break}default:E=4;}break}default:E=4;}if((E|0)==4){E=0;switch(k<<24>>24){case 123:{l=m+1|0;break}case 125:{l=m+-1|0;break}default:{l=m;i=i+((m|0)==0&k<<24>>24==124&1)|0;}}if((l|0)<0)break}m=l;j=j+1|0;}B=g+56|0;c[B>>2]=JK(i<<2)|0;a[g+64>>0]=d;y=(d|0)==0&1;z=n+82|0;A=f+1|0;v=(e|0)!=0;w=n+16|0;x=n+4|0;u=n+8|0;k=0;m=0;d=0;t=0;l=0;e=0;n=f;i=0;j=0;b:while(1){p=k;k=0;c:while(1){d:while(1){s=e;e:while(1){r=k;o=i;f:while(1){q=m;g:while(1){while(1){if(t){E=78;break b}m=c[47282]|0;i=a[m>>0]|0;if((i+-1&255)>=31)break;c[47282]=m+1;}switch(i<<24>>24|0){case 92:{E=53;break d}case 0:case 124:case 125:break e;case 60:break f;case 62:break g;case 123:break;default:{k=d;i=m;break d}}i=m+1|0;c[47282]=i;if(l|0){E=34;break b}if(!(a[i>>0]|0)){E=34;break b}e=_M(b,y,0,f)|0;c[(c[B>>2]|0)+(q<<2)>>2]=e;if(!e){E=36;break b}else {q=q+1|0;l=4;}}if(a[z>>0]|0){k=d;i=m;break d}if(!(l&16)){E=27;break b}if(o>>>0>A>>>0?(C=o+-1|0,(C|0)!=(s|0)):0)i=(a[C>>0]|0)==32?C:o;else i=o;a[i>>0]=0;r=D4(f)|0;c[47282]=(c[47282]|0)+1;m=q;l=l&-17;o=i;}if(l&6|0){E=22;break b}if(a[z>>0]|0){k=d;i=m;break d}c[47282]=m+1;m=q;l=l|18;k=r;s=f;i=f;}if(!((l&16|0)==0&(v|i<<24>>24!=0))){E=38;break b}if(!(l&4)){k=JK(72)|0;c[(c[B>>2]|0)+(q<<2)>>2]=k;m=q+1|0;}else {k=p;m=q;}if(r|0)c[k+60>>2]=r;if(!(l&5)){a[f+j>>0]=32;l=l|1;j=j+1|0;}i=f+j|0;if(l&1){if((j|0)>1?(D=i+-1|0,(D|0)!=(n|0)):0)i=(a[D>>0]|0)==32?D:i;a[i>>0]=0;n=D4(f)|0;c[k+52>>2]=zK(b,n,a[z>>0]|0?2:0,+h[w>>3],c[x>>2]|0,c[u>>2]|0)|0;a[k+64>>0]=1;n=f;j=0;}i=c[47282]|0;switch(a[i>>0]|0){case 0:{t=1;e=s;i=o;continue b}case 125:{E=51;break b}default:{}}c[47282]=i+1;p=k;l=0;k=0;e=s;i=o;}h:do if((E|0)==53){E=0;k=f+j|0;i=m+1|0;switch(a[i>>0]|0){case 0:{k=d;i=m;break h}case 62:case 60:case 124:case 125:case 123:{k=d;break}case 32:{if(!(a[z>>0]|0))k=1;else E=55;break}default:E=55;}if((E|0)==55){E=0;a[k>>0]=92;k=d;l=l|9;j=j+1|0;}c[47282]=i;}while(0);d=f+j|0;if(l&4|0?(a[i>>0]|0)!=32:0){E=59;break b}if(!(l&24))l=(a[i>>0]|0)==32?l:l|9;if(!(l&8))if(!(l&16))e=s;else {m=a[i>>0]|0;d=(k|0)!=0;if(!(d|m<<24>>24!=32))if((o|0)!=(f|0))if((a[o+-1>>0]|0)==32)m=o;else E=73;else m=f;else E=73;if((E|0)==73){E=0;a[o>>0]=m;m=o+1|0;i=c[47282]|0;}e=d?m+-1|0:s;o=m;}else {m=a[i>>0]|0;e=(k|0)!=0;if(!((!(e|m<<24>>24!=32)?(a[d+-1>>0]|0)==32:0)?(a[z>>0]|0)==0:0)){a[d>>0]=m;j=j+1|0;}if(e){e=s;n=f+j+-1|0;}else e=s;}i=i+1|0;c[47282]=i;while(1){if((a[i>>0]|0)>=0){m=q;d=k;k=r;i=o;continue c}s=i+1|0;c[47282]=s;a[f+j>>0]=a[i>>0]|0;j=j+1|0;i=s;}}}if((E|0)==22){dN(g,r);g=0;}else if((E|0)==27){dN(g,r);g=0;}else if((E|0)==34){dN(g,r);g=0;}else if((E|0)==36){dN(g,r);g=0;}else if((E|0)==38){dN(g,r);g=0;}else if((E|0)==51){c[47282]=i+1;c[g+48>>2]=m;}else if((E|0)==59){dN(g,r);g=0;}else if((E|0)==78)c[g+48>>2]=q;return g|0}function $M(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;k=u+48|0;m=u+40|0;n=u+32|0;t=u+16|0;s=u;j=c[e+52>>2]|0;a:do if(!j){n=t+8|0;o=e+48|0;p=e+56|0;q=e+64|0;r=s+8|0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;j=0;while(1){if((j|0)>=(c[o>>2]|0))break a;$M(s,d,c[(c[p>>2]|0)+(j<<2)>>2]|0);if(!(a[q>>0]|0)){h[n>>3]=+h[n>>3]+ +h[r>>3];k=t;m=+h[t>>3]>+h[s>>3]?t:s;}else {h[t>>3]=+h[t>>3]+ +h[s>>3];k=n;m=(+h[n>>3]>+h[r>>3]?t:s)+8|0;}h[k>>3]=+h[m>>3];j=j+1|0;}}else {g=+h[j+24>>3];f=+h[j+32>>3];if(g>0.0|f>0.0){j=QA(d,105496)|0;do if(j){c[k>>2]=m;c[k+4>>2]=n;j=b5(j,105503,k)|0;if((j|0)<=0){i=8.0;g=g+16.0;break}i=+h[m>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))<<1|0);g=g+i;if((j|0)!=1){i=+h[n>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))<<1|0);}}else {i=8.0;g=g+16.0;}while(0);f=i+f;}h[t>>3]=g;h[t+8>>3]=f;}while(0);c[e>>2]=c[t>>2];c[e+4>>2]=c[t+4>>2];c[e+8>>2]=c[t+8>>2];c[e+12>>2]=c[t+12>>2];c[b>>2]=c[t>>2];c[b+4>>2]=c[t+4>>2];c[b+8>>2]=c[t+8>>2];c[b+12>>2]=c[t+12>>2];l=u;return}function aN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0;s=l;l=l+32|0;o=s+16|0;p=s;q=+h[d>>3];i=q-+h[b>>3];r=+h[d+8>>3];f=r-+h[b+8>>3];c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];d=c[b+52>>2]|0;if(!((e|0)!=0|(d|0)==0)){n=d+40|0;h[n>>3]=+h[n>>3]+i;n=d+48|0;h[n>>3]=+h[n>>3]+f;}m=b+48|0;d=c[m>>2]|0;a:do if(d|0){n=b+64|0;f=((a[n>>0]|0)==0?f:i)/+(d|0);k=b+56|0;j=0;while(1){if((j|0)>=(d|0))break a;b=c[(c[k>>2]|0)+(j<<2)>>2]|0;g=j+1|0;d=~~(f*+(g|0))-~~(f*+(j|0))|0;if(!(a[n>>0]|0))bN(p,q,+h[b+8>>3]+ +(d|0));else bN(p,+h[b>>3]+ +(d|0),r);c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];aN(b,o,e);j=g;d=c[m>>2]|0;}}while(0);l=s;return}function bN(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function cN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0;q=l;l=l+48|0;j=q+32|0;n=q+16|0;m=q;a[b+65>>0]=e;k=b+16|0;s=+h[d>>3];p=d+8|0;r=+h[p>>3];bN(n,s,r-+h[b+8>>3]);c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];k=b+32|0;bN(m,+h[b>>3]+s,r);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];k=c[b+48>>2]|0;m=k+-1|0;n=(e|0)==0;o=b+56|0;i=b+64|0;g=0;while(1){if((g|0)>=(k|0))break;do if(!n){b=(g|0)==0;f=(g|0)==(m|0);if(!(a[i>>0]|0))if(b){b=f?15:14;break}else {b=f?11:10;break}else if(b){b=f?15:13;break}else {b=f?7:5;break}}else b=0;while(0);f=c[(c[o>>2]|0)+(g<<2)>>2]|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];cN(f,j,b&e);if(!(a[i>>0]|0))h[p>>3]=+h[p>>3]-+h[(c[(c[o>>2]|0)+(g<<2)>>2]|0)+8>>3];else h[d>>3]=+h[c[(c[o>>2]|0)+(g<<2)>>2]>>3]+ +h[d>>3];g=g+1|0;}l=q;return}function dN(a,b){a=a|0;b=b|0;eN(a);U1(b);return}function eN(a){a=a|0;var b=0,d=0,e=0;d=a+48|0;e=a+56|0;b=0;while(1){if((b|0)>=(c[d>>2]|0))break;eN(c[(c[e>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}U1(c[a+60>>2]|0);CK(c[a+52>>2]|0);U1(c[e>>2]|0);U1(a);return}function fN(a){a=a|0;var b=0.0,d=0.0;d=+_O(a,c[47146]|0,0.0,.01);b=+_O(a,c[47145]|0,0.0,.02);b=(d>b?d:b)*72.0;return +(+(~~(b+(b>=0.0?.5:-.5))|0))}function gN(a,b){a=+a;b=+b;var c=0;c=~~(a/b);return +(+((+(c|0)*b+1.0e-05>2]|0)+8>>2]|0;if(!a)a=0;else a=(c[c[a+4>>2]>>2]|0)==91&1;return a|0}function iN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[47283]|0;a:do if(!f)d=0;else {g=c[47284]|0;e=0;while(1){if((e|0)>=(g|0)){d=0;break a}d=c[f+(e<<2)>>2]|0;h=c[d>>2]|0;if((a[h>>0]|0)==(a[b>>0]|0)?(s2(h,b)|0)==0:0)break a;e=e+1|0;}}while(0);return d|0}function jN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;if(mP(QA(d,105526)|0)|0)if((a[b>>0]|0)==101?(s2(b,105685)|0)==0:0){d=101;g=6;}else {b=105519;g=4;}else g=4;if((g|0)==4){d=a[b>>0]|0;if(d<<24>>24==99)if(!(s2(b,105519)|0))g=11;else {d=99;g=6;}else g=6;}a:do if((g|0)==6){e=20848;while(1){f=c[e>>2]|0;if(!f){g=11;break a}if((a[f>>0]|0)==d<<24>>24?(s2(f,b)|0)==0:0){b=e;break a}e=e+16|0;}}while(0);if((g|0)==11)b=kN(b)|0;return b|0}function kN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;d=iN(b)|0;if(!d){f=c[47284]|0;d=f+1|0;c[47284]=d;e=c[47283]|0;if(!e)d=KK(d<<2)|0;else d=MK(e,d<<2)|0;c[47283]=d;d=JK(16)|0;c[(c[47283]|0)+(f<<2)>>2]=d;c[d>>2]=c[5212];c[d+4>>2]=c[5213];c[d+8>>2]=c[5214];c[d+12>>2]=c[5215];e=D4(b)|0;c[d>>2]=e;do if(!0){if((a[b>>0]|0)==99?(s2(b,105519)|0)==0:0){e=1;break}c[g>>2]=c[5212];c[g+4>>2]=e;gA(0,105690,g)|0;e=0;}while(0);a[d+12>>0]=e;}l=h;return d|0}function lN(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[b>>3]*.5257311121191336;c=+h[b+8>>3]*.8944271909999159;c=d>c?d:c;h[a>>3]=c*4.97979656976556;h[a+8>>3]=c*4.73606797749979;return}function mN(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0.0;d=+h[b>>3];k=b+8|0;e=+h[k>>3];c=e/d;if(!(c>.9510565162951536))if(c<.9510565162951536){j=d;e=d*.9510565162951536;}else j=d;else j=e*1.0514622242382672;d=j*.5257311121191336;g=j*.20081141588622725;i=j*.05020285397155681;c=.3141592653589793;f=0;while(1){if((f|0)>=10)break;h[a+(f<<4)>>3]=+E(+c)*d;h[a+(f<<4)+8>>3]=+F(+c)*d-i;m=c+.6283185307179586;l=f|1;h[a+(l<<4)>>3]=+E(+m)*g;h[a+(l<<4)+8>>3]=+F(+m)*g-i;c=c+1.2566370614359172;f=f+2|0;}h[b>>3]=j;h[k>>3]=e;return}function nN(a){a=a|0;a=c[(c[a+16>>2]|0)+12>>2]|0;if(a|0){U1(c[a+44>>2]|0);U1(a);}return}function oN(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+80|0;k=o+40|0;g=o;n=o+64|0;h=o+56|0;if(!(a[e>>0]|0)){g=4208;h=b+40|0;do{c[b>>2]=c[g>>2];b=b+4|0;g=g+4|0;}while((b|0)<(h|0))}else {i=(f|0)==0?106356:f;c[n>>2]=15;j=d+16|0;f=c[j>>2]|0;do if(a[(c[f+104>>2]|0)+82>>0]|0){f=pU(d,e,n)|0;if(!f){f=c[j>>2]|0;m=8;break}if(CN(d,f,g,i,c[n>>2]|0,0)|0){c[k>>2]=KB(d)|0;c[k+4>>2]=e;c[k+8>>2]=i;gA(0,106358,k)|0;}}else m=8;while(0);if((m|0)==8){if((c[(c[f+8>>2]|0)+8>>2]|0)==1664)h=0;else {c[h>>2]=d;c[h+4>>2]=0;}if(CN(d,0,g,e,c[n>>2]|0,h)|0)DN(d,e);}c[g+36>>2]=0;h=b+40|0;do{c[b>>2]=c[g>>2];b=b+4|0;g=g+4|0;}while((b|0)<(h|0))}l=o;return}function pN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0;r=l;l=l+112|0;n=r+96|0;m=r+80|0;p=r+64|0;k=r+48|0;q=r+32|0;o=r;f=r+16|0;if(!a){c[47287]=0;a=0;}else {g=c[a+4>>2]|0;a=c[a>>2]|0;i=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];mK(f,n,i);c[q>>2]=c[f>>2];c[q+4>>2]=c[f+4>>2];c[q+8>>2]=c[f+8>>2];c[q+12>>2]=c[f+12>>2];a:do if(g){d=+h[g+8>>3];e=+h[g+24>>3];s=+h[q>>3];if((+h[g>>3]<=s?s<=+h[g+16>>3]:0)?(j=+h[q+8>>3],d<=j):0)a=j<=e&1;else a=0;}else {if((a|0)==(c[47287]|0)){f=c[47288]|0;g=c[47290]|0;i=c[47289]|0;}else {g=c[(c[a+16>>2]|0)+12>>2]|0;c[47291]=g;i=c[g+44>>2]|0;c[47289]=i;f=c[g+8>>2]|0;c[47288]=f;g=O((c[g+4>>2]|0)+-1|0,f)|0;g=(g|0)>0?g:0;c[47290]=g;c[47287]=a;}a=0;b=0;while(1){if((a|0)>=(f|0)){a=1;break a}t=i+(g+a<<4)|0;c[o>>2]=c[t>>2];c[o+4>>2]=c[t+4>>2];c[o+8>>2]=c[t+8>>2];c[o+12>>2]=c[t+12>>2];t=i+(g+((a+4|0)%(f|0)|0)<<4)|0;c[k>>2]=c[q>>2];c[k+4>>2]=c[q+4>>2];c[k+8>>2]=c[q+8>>2];c[k+12>>2]=c[q+12>>2];c[p>>2]=c[46614];c[p+4>>2]=c[46615];c[p+8>>2]=c[46616];c[p+12>>2]=c[46617];c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];b=b+((BN(k,p,m,n)|0)==0&1)|0;if((b|0)==2){a=0;break}else a=a+2|0;}}while(0)}l=r;return a|0}function qN(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;e=c[b+16>>2]|0;if((a[(c[e+104>>2]|0)+82>>0]|0)!=0?(a[e+145>>0]|0)!=0:0)b=sU(b,d,0,f,g)|0;else b=0;return b|0}function rN(e,f){e=e|0;f=f|0;var i=0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0;P=l;l=l+48|0;H=P+24|0;G=P+16|0;A=P+8|0;z=P;L=P+32|0;n=P+28|0;M=c[e+16>>2]|0;N=M+208|0;i=c[N>>2]|0;if((i|0)==0?(b[M+260>>1]&1)==0:0)J=0;else E=4;if((E|0)==4)if(!(c[e+152>>2]&4)){cS(e,i,c[M+228>>2]|0,c[M+244>>2]|0,c[M+212>>2]|0);J=1;}else J=1;I=f+16|0;i=c[I>>2]|0;r=c[i+12>>2]|0;F=c[r+44>>2]|0;K=c[r+8>>2]|0;r=c[r+4>>2]|0;if((c[47285]|0)<(K|0)){i=K+5|0;c[47285]=i;j=c[47286]|0;if(!j)i=KK(i<<4)|0;else i=MK(j,i<<4)|0;c[47286]=i;i=c[I>>2]|0;}D=(c[i+104>>2]|0)+56|0;i=i+16|0;c[D>>2]=c[i>>2];c[D+4>>2]=c[i+4>>2];c[D+8>>2]=c[i+8>>2];c[D+12>>2]=c[i+12>>2];D=c[I>>2]|0;B=+h[D+32>>3]*72.0;B=(+h[D+96>>3]+ +h[D+88>>3])/+(~~(B+(B>=0.0?.5:-.5))|0);C=+h[D+40>>3]*72.0;C=+h[D+80>>3]/+(~~(C+(C>=0.0?.5:-.5))|0);D=sN(e,f)|0;c[L>>2]=0;i=d[(c[I>>2]|0)+117>>0]|0;do if(!(i&1)){if(i&2|0){s=bP(f,0,106256)|0;hS(e,s);jS(e,bP(f,0,106264)|0);j=0;i=1;break}if(i&8|0){s=bP(f,0,106272)|0;hS(e,s);jS(e,bP(f,0,106280)|0);j=0;i=1;break}if(i&4|0){s=bP(f,0,106288)|0;hS(e,s);jS(e,bP(f,0,106296)|0);j=0;i=1;break}if(!(D&1))if(!(D&576)){j=0;i=0;}else {j=tN(f)|0;i=1;}else {j=tN(f)|0;if(!((JJ(j,L,n)|0)<<24>>24)){jS(e,j);i=1;}else {jS(e,c[L>>2]|0);i=c[L+4>>2]|0;m=ZO(f,c[47173]|0,0,0)|0;k=+g[n>>2];if(!i)kS(e,137314,m,k);else kS(e,i,m,k);i=(D&2)>>>1|2;}}s=uN(e,f)|0;}else {s=bP(f,0,106240)|0;hS(e,s);jS(e,bP(f,0,106248)|0);j=0;i=1;}while(0);m=c[(c[I>>2]|0)+8>>2]|0;if(a[m+12>>0]|0){m=c[m>>2]|0;if((a[m>>0]|0)==99){m=(s2(m,105519)|0)==0;E=33;}else u=1;}else {m=1;E=33;}if((E|0)==33){m=m^1;if((r|0)!=0|i<<24>>24==0|m)u=m;else {hS(e,137379);r=1;u=0;}}v=(K|0)<3;w=(D&512|0)!=0;y=(D&8|0)==0;x=(D&64|0)==0;p=(D&1024|0)==0;q=(D&2130706444|0)==0;t=0;while(1){if((t|0)>=(r|0))break;n=O(t,K)|0;o=c[47286]|0;m=0;while(1){if((m|0)>=(K|0))break;R=m+n|0;k=+h[F+(R<<4)+8>>3];Q=c[I>>2]|0;h[o+(m<<4)>>3]=+h[Q+16>>3]+ +h[F+(R<<4)>>3]*B;h[o+(m<<4)+8>>3]=+h[Q+24>>3]+k*C;m=m+1|0;}do if(v){if(w&(t|0)==0?(R2(j,58)|0)!=0:0)if((fI(e,o,j)|0)>1){c[z>>2]=KB(f)|0;gA(3,106304,z)|0;i=0;}else i=0;mS(e,c[47286]|0,K,i&255);if(!y)vN(e,f);}else {if(!x){if((t|0)==0?(jI(e,o,j,1)|0)>1:0){c[A>>2]=KB(f)|0;gA(3,106304,A)|0;}nS(e,c[47286]|0,K,0);break}if(!p){hS(e,137379);nS(e,c[47286]|0,K,i&255);hS(e,s);qS(e,(c[47286]|0)+32|0,2);break}i=i&255;if(q){nS(e,o,K,i);break}else {TM(e,o,K,D,i);break}}while(0);t=t+1|0;i=0;}m=c[(c[I>>2]|0)+8>>2]|0;if(!(a[m+12>>0]|0)){m=QA(f,109025)|0;if(m|0?a[m>>0]|0:0){o=m;E=65;}}else {m=c[m>>2]|0;if((a[m>>0]|0)==99?(s2(m,105519)|0)==0:0){m=QA(f,105526)|0;if(m|0?a[m>>0]|0:0){o=m;E=65;}}else {o=m;E=65;}}if((E|0)==65){n=c[47286]|0;m=0;while(1){if((m|0)>=(K|0))break;k=+h[F+(m<<4)+8>>3];R=c[I>>2]|0;h[n+(m<<4)>>3]=+h[R+16>>3]+ +h[F+(m<<4)>>3]*B;h[n+(m<<4)+8>>3]=+h[R+24>>3]+k*C;m=m+1|0;}m=i&255;do if(!(u|i<<24>>24==0)){if(v){if(w&(t|0)==0?(R2(j,58)|0)!=0:0)if((fI(e,n,j)|0)>1){c[G>>2]=KB(f)|0;gA(3,106304,G)|0;i=0;}else i=0;mS(e,c[47286]|0,K,i&255);if(y)break;vN(e,f);break}if(x)if(!(D&12)){nS(e,n,K,m);break}else {TM(e,n,K,D,m);break}else {if((jI(e,n,j,1)|0)>1){c[H>>2]=KB(f)|0;gA(3,106304,H)|0;}nS(e,c[47286]|0,K,0);break}}while(0);R=c[47286]|0;sS(e,o,R,K,i,aP(f,c[47166]|0,137308)|0);}U1(c[L>>2]|0);DK(e,10,c[(c[I>>2]|0)+104>>2]|0);if(J){if(c[e+152>>2]&4|0)cS(e,c[N>>2]|0,c[M+228>>2]|0,c[M+244>>2]|0,c[M+212>>2]|0);dS(e);}l=P;return}function sN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;e=yN(d,f)|0;if(e|0)lS(b,e);e=c[47172]|0;if((e|0?(g=RA(d,e)|0,g|0):0)?a[g>>0]|0:0)uS(b,+_O(d,c[47172]|0,1.0,0.0));l=h;return c[f>>2]|0}function tN(a){a=a|0;return xN(a,134800)|0}function uN(b,d){b=b|0;d=d|0;d=bP(d,c[47148]|0,195059)|0;d=a[d>>0]|0?d:137314;hS(b,d);return d|0}function vN(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0.0,j=0,k=0,m=0;d=l;l=l+96|0;j=d+80|0;k=d+64|0;e=d+32|0;m=d+16|0;g=d;b=c[b+16>>2]|0;f=+h[b+80>>3];h[m+8>>3]=f*.375;i=+h[b+96>>3];h[m>>3]=i*.6614;b=b+16|0;c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];wN(g,k,j);c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];g=e+8|0;b=e+24|0;h[b>>3]=+h[g>>3];h[e+16>>3]=+h[e>>3]-i*1.3228;qS(a,e,2);f=+h[g>>3]-f*.75;h[g>>3]=f;h[b>>3]=f;qS(a,e,2);l=d;return}function wN(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function xN(b,d){b=b|0;d=d|0;var e=0;e=bP(b,c[47149]|0,195059)|0;if(!(a[e>>0]|0)){e=bP(b,c[47148]|0,195059)|0;return ((a[e>>0]|0)==0?d:e)|0}else return e|0;return 0}function yN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=bP(b,c[47157]|0,195059)|0;a:do if(!(a[e>>0]|0)){g=0;e=0;}else {g=PI(e)|0;h=g;e=0;b:while(1){f=c[h>>2]|0;if(!f)break a;switch(a[f>>0]|0){case 102:{if(!(s2(f,111101)|0)){h=h+4|0;e=e|1;continue b}break}case 114:{if(!(s2(f,106316)|0)){f=h;do{j=f;f=f+4|0;i=c[f>>2]|0;c[j>>2]=i;}while((i|0)!=0);j=h;e=e|4;h=j;continue b}if(!(s2(f,106334)|0)){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|3;h=j;continue b}break}case 100:{if(!(s2(f,106324)|0)){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|8;h=j;continue b}break}case 105:{if(!(s2(f,134335)|0)){h=h+4|0;e=e|32;continue b}break}case 115:{if((s2(f,106341)|0)==0?zN(b)|0:0){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|64;h=j;continue b}break}case 119:{if((s2(f,106349)|0)==0?AN(b)|0:0){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|512;h=j;continue b}break}default:{}}h=h+4|0;}}while(0);f=c[(c[(c[b+16>>2]|0)+8>>2]|0)+8>>2]|0;if(f)e=c[f+40>>2]|e;c[d>>2]=e;return g|0}function zN(a){a=a|0;var b=0.0;a=c[(c[(c[a+16>>2]|0)+8>>2]|0)+8>>2]|0;if((((a|0)!=0?(c[a+8>>2]|0)==4:0)?(b=+h[a+16>>3],((~~(b+(b>=0.0?.5:-.5))|0)%90|0|0)==0):0)?+h[a+24>>3]==0.0:0)a=+h[a+32>>3]==0.0&1;else a=0;return a|0}function AN(a){a=a|0;a=c[(c[(c[a+16>>2]|0)+8>>2]|0)+8>>2]|0;if(!a)a=0;else a=(c[a+8>>2]|0)<3&1;return a|0}function BN(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;i=+h[c+8>>3];g=-(+h[d+8>>3]-i);f=+h[c>>3];e=+h[d>>3]-f;f=e*i+f*g;return (+h[a+8>>3]*e+ +h[a>>3]*g-f>=0.0^+h[b>>3]*g-f+ +h[b+8>>3]*e>=0.0^1)&1|0}function CN(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;G=l;l=l+192|0;B=G+176|0;E=G+160|0;m=G+144|0;z=G+128|0;A=G+112|0;n=G+96|0;o=G+80|0;p=G+64|0;v=G+48|0;w=G+32|0;x=G+16|0;D=G;if(!d){c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;m=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;C=c[b+16>>2]|0;q=+h[C+80>>3]*.5;j=+h[C+88>>3];t=m?q:j;q=m?j:q;m=0;C=E;j=0.0;k=-q;r=t;F=E+8|0;s=0.0;t=-t;}else {k=+h[d>>3];t=+h[d+8>>3];q=+h[d+16>>3];r=+h[d+24>>3];bN(m,(q+k)*.5,(r+t)*.5);c[E>>2]=c[m>>2];c[E+4>>2]=c[m+4>>2];c[E+8>>2]=c[m+8>>2];c[E+12>>2]=c[m+12>>2];H=E+8|0;m=1;C=E;j=+h[E>>3];F=H;s=+h[H>>3];}u=(q>r?q:r)*4.0;a:do if((f|0)!=0?(y=a[f>>0]|0,y<<24>>24!=0):0){f=f+1|0;switch(y<<24>>24|0){case 99:{p=1;g=0;f=0;n=0;j=0.0;o=0;break a}case 101:{if(a[f>>0]|0){p=1;g=0;f=0;n=0;j=0.0;o=1;break a}if(!i)h[C>>3]=q;else {EN(z,i,s,u);c[E>>2]=c[z>>2];c[E+4>>2]=c[z+4>>2];c[E+8>>2]=c[z+8>>2];c[E+12>>2]=c[z+12>>2];}p=0;g=g&2;f=0;n=1;j=0.0;o=0;m=1;break a}case 115:{h[F>>3]=t;switch(a[f>>0]|0){case 0:{if(!i)h[C>>3]=j;else {EN(A,i,-u,j);c[E>>2]=c[A>>2];c[E+4>>2]=c[A+4>>2];c[E+8>>2]=c[A+8>>2];c[E+12>>2]=c[A+12>>2];}p=0;g=g&1;f=0;n=1;j=-1.5707963267948966;o=0;m=1;break a}case 101:{if(!i)h[C>>3]=q;else {EN(n,i,-u,u);c[E>>2]=c[n>>2];c[E+4>>2]=c[n+4>>2];c[E+8>>2]=c[n+8>>2];c[E+12>>2]=c[n+12>>2];}p=0;g=g&3;f=0;n=1;j=-.7853981633974483;o=0;m=1;break a}case 119:{if(!i)h[C>>3]=k;else {u=-u;EN(o,i,u,u);c[E>>2]=c[o>>2];c[E+4>>2]=c[o+4>>2];c[E+8>>2]=c[o+8>>2];c[E+12>>2]=c[o+12>>2];}p=0;g=g&9;f=0;n=1;j=-2.356194490192345;o=0;m=1;break a}default:{h[F>>3]=s;p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}case 119:{if(a[f>>0]|0){p=1;g=0;f=0;n=0;j=0.0;o=1;break a}if(!i)h[C>>3]=k;else {EN(p,i,s,-u);c[E>>2]=c[p>>2];c[E+4>>2]=c[p+4>>2];c[E+8>>2]=c[p+8>>2];c[E+12>>2]=c[p+12>>2];}p=0;g=g&8;f=0;n=1;j=3.141592653589793;o=0;m=1;break a}case 110:{h[F>>3]=r;switch(a[f>>0]|0){case 0:{if(!i)h[C>>3]=j;else {EN(v,i,u,j);c[E>>2]=c[v>>2];c[E+4>>2]=c[v+4>>2];c[E+8>>2]=c[v+8>>2];c[E+12>>2]=c[v+12>>2];}p=0;g=g&4;f=0;n=1;j=1.5707963267948966;o=0;m=1;break a}case 101:{if(!i)h[C>>3]=q;else {EN(w,i,u,u);c[E>>2]=c[w>>2];c[E+4>>2]=c[w+4>>2];c[E+8>>2]=c[w+8>>2];c[E+12>>2]=c[w+12>>2];}p=0;g=g&6;f=0;n=1;j=.7853981633974483;o=0;m=1;break a}case 119:{if(!i)h[C>>3]=k;else {EN(x,i,u,-u);c[E>>2]=c[x>>2];c[E+4>>2]=c[x+4>>2];c[E+8>>2]=c[x+8>>2];c[E+12>>2]=c[x+12>>2];}p=0;g=g&12;f=0;n=1;j=2.356194490192345;o=0;m=1;break a}default:{h[F>>3]=s;p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}case 95:{p=1;f=1;n=0;j=0.0;o=0;break a}default:{p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}else {p=1;g=0;f=0;n=0;j=0.0;o=0;}while(0);H=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3)*90|0;c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];lK(D,B,H);c[E>>2]=c[D>>2];c[E+4>>2]=c[D+4>>2];c[E+8>>2]=c[D+8>>2];c[E+12>>2]=c[D+12>>2];if(!(f<<24>>24))g=FN(g,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3)|0;a[e+33>>0]=g;c[e+24>>2]=d;k=+h[C>>3];h[e>>3]=+(~~(k+(k>=0.0?.5:-.5))|0);k=+h[F>>3];h[e+8>>3]=+(~~(k+(k>=0.0?.5:-.5))|0);h[e+16>>3]=+GN(j,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3);k=+h[C>>3];j=+h[F>>3];if(k==0.0&j==0.0)g=-128;else {u=+K(+j,+k);t=u+4.71238898038469;g=~~((!(t>=6.283185307179586)?t:u+-1.5707963267948966)*40.74366543152521)&255;}a[e+32>>0]=g;a[e+29>>0]=n;a[e+28>>0]=m;a[e+30>>0]=p;a[e+31>>0]=f;l=G;return o|0}function DN(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=KB(a)|0;c[e+4>>2]=b;gA(0,106419,e)|0;l=d;return}function EN(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+128|0;g=p+112|0;j=p+48|0;k=p+16|0;m=p+32|0;n=p;o=c[b>>2]|0;i=c[(c[(xC(o)|0)+16>>2]|0)+116>>2]&3;h[k>>3]=e;h[k+8>>3]=d;f=(i|0)!=0;if(f){c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];lK(m,g,i*90|0);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];}m=j+48|0;q=j+32|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;c[j+20>>2]=0;c[j+24>>2]=0;c[j+28>>2]=0;c[q>>2]=c[k>>2];c[q+4>>2]=c[k+4>>2];c[q+8>>2]=c[k+8>>2];c[q+12>>2]=c[k+12>>2];c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];$N(b,c[(c[(c[(c[o+16>>2]|0)+8>>2]|0)+4>>2]|0)+12>>2]|0,j,1);if(f){c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];mK(n,g,i*90|0);c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];};c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];l=p;return}function FN(a,b){a=a|0;b=b|0;a:do switch(b|0){case 3:switch(a|0){case 4:{a=2;break a}case 1:{a=8;break a}case 8:{a=1;break a}case 2:{a=4;break a}default:break a}case 2:switch(a|0){case 4:{a=1;break a}case 1:{a=4;break a}default:break a}case 1:switch(a|0){case 4:{a=2;break a}case 1:{a=8;break a}case 8:{a=4;break a}case 2:{a=1;break a}default:break a}default:{}}while(0);return a|0}function GN(a,b){a=+a;b=b|0;switch(b|0){case 3:{if(!(a==3.141592653589793))if(!(a==2.356194490192345))if(!(a==1.5707963267948966))if(!(a==0.0))if(!(a==-.7853981633974483)){if(a==-1.5707963267948966)a=3.141592653589793;}else a=2.356194490192345;else a=1.5707963267948966;else a=0.0;else a=-.7853981633974483;else a=-1.5707963267948966;break}case 2:{a=-a;break}case 1:{a=a+-1.5707963267948966;break}default:{}}return +a}function HN(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0.0,i=0,j=0,k=0;e=l;l=l+32|0;k=e+16|0;i=e;a=c[a>>2]|0;j=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];mK(i,k,j);d=+h[i>>3];g=+h[i+8>>3];a=c[a+16>>2]|0;f=+h[a+80>>3]*.5;if(!(!(g>=-f)|!(g<=f))?d>=-+h[a+88>>3]:0)a=d<=+h[a+96>>3]&1;else a=0;l=e;return a|0}function IN(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+32|0;m=n;i=c[a+16>>2]|0;j=i+208|0;g=c[j>>2]|0;if(!g)k=(b[i+260>>1]&1)!=0;else k=1;e=d+16|0;d=c[e>>2]|0;f=c[d+12>>2]|0;if(f|0){if(k?(c[a+152>>2]&4|0)==0:0){cS(a,g,c[i+228>>2]|0,c[i+244>>2]|0,c[i+212>>2]|0);d=c[e>>2]|0;}g=c[a+36>>2]|0;p=+h[d+24>>3]+ +(c[f+8>>2]|0);o=c[f>>2]|0;h[m>>3]=+h[d+16>>3]+ +(c[f+4>>2]|0);h[m+8>>3]=p;c[m+16>>2]=o;w4(g,106450,m)|0;g=c[e>>2]|0;m=(c[g+104>>2]|0)+56|0;g=g+16|0;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];c[m+12>>2]=c[g+12>>2];DK(a,10,c[(c[e>>2]|0)+104>>2]|0);if(k){if(c[a+152>>2]&4|0)cS(a,c[j>>2]|0,c[i+228>>2]|0,c[i+244>>2]|0,c[i+212>>2]|0);dS(a);}}l=n;return}function JN(a){a=a|0;eN(c[(c[a+16>>2]|0)+12>>2]|0);return}function KN(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0;m=l;l=l+64|0;k=m+40|0;h=m;if(!(a[f>>0]|0)){h=4208;g=b+40|0;do{c[b>>2]=c[h>>2];b=b+4|0;h=h+4|0;}while((b|0)<(g|0))}else {g=(g|0)==0?106356:g;i=c[(c[e+16>>2]|0)+12>>2]|0;j=QN(i,f)|0;if(!j){if(CN(e,i+16|0,h,f,15,0)|0)DN(e,f);}else if(CN(e,j+16|0,h,g,d[j+65>>0]|0,0)|0){c[k>>2]=KB(e)|0;c[k+4>>2]=f;c[k+8>>2]=g;gA(0,106358,k)|0;}g=b+40|0;do{c[b>>2]=c[h>>2];b=b+4|0;h=h+4|0;}while((b|0)<(g|0))}l=m;return}function LN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,m=0,n=0.0;k=l;l=l+32|0;m=k+16|0;i=k;f=c[a+4>>2]|0;a=c[a>>2]|0;g=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];mK(i,m,g);c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];if(!f){f=c[(c[a+16>>2]|0)+12>>2]|0;g=f+16|0;a=f+24|0;i=f+32|0;f=f+40|0;}else {g=f;a=f+8|0;i=f+16|0;f=f+24|0;}e=+h[a>>3];d=+h[f>>3];n=+h[b>>3];if((+h[g>>3]<=n?n<=+h[i>>3]:0)?(j=+h[b+8>>3],e<=j):0)a=j<=d&1;else a=0;l=k;return a|0}function MN(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0.0;u=l;l=l+80|0;r=u+64|0;q=u+32|0;t=u;a:do if(!(a[d+28>>0]|0))e=0;else {i=+h[d>>3];p=b+16|0;m=c[(c[p>>2]|0)+12>>2]|0;k=m+48|0;m=m+56|0;d=0;while(1){if((d|0)>=(c[k>>2]|0))break a;n=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;o=c[(c[m>>2]|0)+(d<<2)>>2]|0;j=+(~~+h[(n?o+16|0:o+24|0)>>3]|0);if(i>=j?(s=+(~~+h[(n?o+32|0:o+40|0)>>3]|0),i<=s):0)break;d=d+1|0;}if(!(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1)){t=c[p>>2]|0;v=+h[t+16>>3];h[f>>3]=v+j;j=+h[t+24>>3];i=+h[t+80>>3];h[f+8>>3]=j-i*.5;h[f+16>>3]=v+s;}else {o=(c[(c[m>>2]|0)+(d<<2)>>2]|0)+16|0;b=(c[p>>2]|0)+16|0;c[q>>2]=c[o>>2];c[q+4>>2]=c[o+4>>2];c[q+8>>2]=c[o+8>>2];c[q+12>>2]=c[o+12>>2];c[q+16>>2]=c[o+16>>2];c[q+20>>2]=c[o+20>>2];c[q+24>>2]=c[o+24>>2];c[q+28>>2]=c[o+28>>2];c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];nK(t,q,r);c[f>>2]=c[t>>2];c[f+4>>2]=c[t+4>>2];c[f+8>>2]=c[t+8>>2];c[f+12>>2]=c[t+12>>2];c[f+16>>2]=c[t+16>>2];c[f+20>>2]=c[t+20>>2];c[f+24>>2]=c[t+24>>2];c[f+28>>2]=c[t+28>>2];t=c[p>>2]|0;i=+h[t+80>>3];j=+h[t+24>>3];}h[f+24>>3]=i*.5+j;c[g>>2]=1;}while(0);l=u;return e|0}function NN(d,e){d=d|0;e=e|0;var f=0,i=0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;w=l;l=l+144|0;n=w+96|0;p=w+64|0;r=w;s=w+128|0;t=c[d+16>>2]|0;u=t+208|0;f=c[u>>2]|0;if(!f)v=(b[t+260>>1]&1)!=0;else v=1;m=e+16|0;q=c[m>>2]|0;o=c[q+12>>2]|0;j=o+16|0;c[p>>2]=c[j>>2];c[p+4>>2]=c[j+4>>2];c[p+8>>2]=c[j+8>>2];c[p+12>>2]=c[j+12>>2];c[p+16>>2]=c[j+16>>2];c[p+20>>2]=c[j+20>>2];c[p+24>>2]=c[j+24>>2];c[p+28>>2]=c[j+28>>2];x=+h[q+16>>3];h[p>>3]=+h[p>>3]+x;k=+h[q+24>>3];q=p+8|0;h[q>>3]=+h[q>>3]+k;q=p+16|0;h[q>>3]=+h[q>>3]+x;j=p+24|0;h[j>>3]=+h[j>>3]+k;if(v?(c[d+152>>2]&4|0)==0:0)cS(d,f,c[t+228>>2]|0,c[t+244>>2]|0,c[t+212>>2]|0);f=sN(d,e)|0;uN(d,e)|0;c[s>>2]=0;if(!(f&1))i=0;else {i=tN(e)|0;if(!((JJ(i,s,n)|0)<<24>>24)){jS(d,i);i=1;}else {jS(d,c[s>>2]|0);i=c[s+4>>2]|0;j=ZO(e,c[47173]|0,0,0)|0;k=+g[n>>2];if(!i)kS(d,137314,j,k);else kS(d,i,j,k);i=f>>>1&1|2;}}j=c[c[(c[m>>2]|0)+8>>2]>>2]|0;if((a[j>>0]|0)==77){m=(s2(j,106227)|0)==0;f=m?f|4:f;}if(!(f&2130706444)){c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];c[n+16>>2]=c[p+16>>2];c[n+20>>2]=c[p+20>>2];c[n+24>>2]=c[p+24>>2];c[n+28>>2]=c[p+28>>2];oS(d,n,i);}else {c[r>>2]=c[p>>2];c[r+4>>2]=c[p+4>>2];c[r+8>>2]=c[p+8>>2];c[r+12>>2]=c[p+12>>2];p=r+32|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];h[r+16>>3]=+h[p>>3];h[r+24>>3]=+h[r+8>>3];h[r+48>>3]=+h[r>>3];h[r+56>>3]=+h[r+40>>3];TM(d,r,4,f,i);}ON(d,e,o);U1(c[s>>2]|0);if(v){if(c[d+152>>2]&4|0)cS(d,c[u>>2]|0,c[t+228>>2]|0,c[t+244>>2]|0,c[t+212>>2]|0);dS(d);}l=w;return}function ON(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+144|0;p=u+128|0;o=u+112|0;q=u+16|0;r=u;g=u+96|0;i=u+80|0;s=u+64|0;t=u+48|0;j=e+52|0;f=c[j>>2]|0;if(!f)f=d+16|0;else {n=f+56|0;m=e+16|0;f=e+32|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];PN(g,o,p);f=d+16|0;m=(c[f>>2]|0)+16|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[p>>2]=c[m>>2];c[p+4>>2]=c[m+4>>2];c[p+8>>2]=c[m+8>>2];c[p+12>>2]=c[m+12>>2];wN(i,o,p);c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];DK(b,10,c[j>>2]|0);uN(b,d)|0;}k=(c[f>>2]|0)+16|0;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];c[r+8>>2]=c[k+8>>2];c[r+12>>2]=c[k+12>>2];k=e+48|0;m=e+64|0;n=q+16|0;j=e+56|0;e=q+16|0;i=0;while(1){if((i|0)>=(c[k>>2]|0))break;if((i|0)>0){f=(c[j>>2]|0)+(i<<2)|0;g=c[f>>2]|0;if(!(a[m>>0]|0)){g=g+32|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];h[q>>3]=+h[(c[f>>2]|0)+16>>3];f=n;g=0;}else {g=g+16|0;c[q>>2]=c[g>>2];c[q+4>>2]=c[g+4>>2];c[q+8>>2]=c[g+8>>2];c[q+12>>2]=c[g+12>>2];h[e>>3]=+h[q>>3];f=(c[f>>2]|0)+32|0;g=1;}h[q+(g<<4)+8>>3]=+h[f+8>>3];c[o>>2]=c[q>>2];c[o+4>>2]=c[q+4>>2];c[o+8>>2]=c[q+8>>2];c[o+12>>2]=c[q+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];wN(s,o,p);c[q>>2]=c[s>>2];c[q+4>>2]=c[s+4>>2];c[q+8>>2]=c[s+8>>2];c[q+12>>2]=c[s+12>>2];c[o>>2]=c[n>>2];c[o+4>>2]=c[n+4>>2];c[o+8>>2]=c[n+8>>2];c[o+12>>2]=c[n+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];wN(t,o,p);c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];qS(b,q,2);}ON(b,d,c[(c[j>>2]|0)+(i<<2)>>2]|0);i=i+1|0;}l=u;return}function PN(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function QN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=c[b+60>>2]|0;if(!(((e|0)!=0?(a[e>>0]|0)==(a[d>>0]|0):0)?(s2(e,d)|0)==0:0))f=4;a:do if((f|0)==4){g=b+56|0;f=c[b+48>>2]|0;e=0;while(1){if((e|0)>=(f|0)){b=0;break a}b=QN(c[(c[g>>2]|0)+(e<<2)>>2]|0,d)|0;if(!b)e=e+1|0;else break}}while(0);return b|0}function RN(a,b){a=a|0;b=b|0;var d=0;d=b+8|0;h[d>>3]=+h[d>>3]*1.375;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function SN(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;k=+h[b>>3];f=k*.5;m=+h[b+8>>3];i=m*.5;h[a>>3]=f;e=m*.40909090909090906;h[a+8>>3]=e;h[a+16>>3]=f;g=m*.4592530909090909;h[a+24>>3]=g;j=k*.275892;h[a+32>>3]=j;h[a+40>>3]=i;h[a+48>>3]=0.0;h[a+56>>3]=i;k=k*-.275892;h[a+64>>3]=k;h[a+72>>3]=i;l=-f;h[a+80>>3]=l;h[a+88>>3]=g;d=a+96|0;h[d>>3]=l;h[a+104>>3]=e;b=a+112|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=a+128|0;h[b>>3]=l;h[a+136>>3]=m*-.40909090909090906;d=a+144|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];h[a+160>>3]=l;g=-g;h[a+168>>3]=g;h[a+176>>3]=k;i=-i;h[a+184>>3]=i;h[a+192>>3]=0.0;h[a+200>>3]=i;h[a+208>>3]=j;h[a+216>>3]=i;h[a+224>>3]=f;h[a+232>>3]=g;d=a+240|0;h[d>>3]=f;h[a+248>>3]=-e;b=a+256|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=a+288|0;d=a+272|0;c[d>>2]=c[a>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];c[d+12>>2]=c[a+12>>2];c[b>>2]=c[a>>2];c[b+4>>2]=c[a+4>>2];c[b+8>>2]=c[a+8>>2];c[b+12>>2]=c[a+12>>2];return}function TN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+144|0;u=x+112|0;t=x+96|0;v=x+80|0;s=x+64|0;w=x+32|0;q=x+16|0;r=x;g=x+48|0;do if(a){j=c[a+4>>2]|0;k=c[a>>2]|0;o=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&3)*90|0;c[u>>2]=c[b>>2];c[u+4>>2]=c[b+4>>2];c[u+8>>2]=c[b+8>>2];c[u+12>>2]=c[b+12>>2];mK(g,u,o);c[w>>2]=c[g>>2];c[w+4>>2]=c[g+4>>2];c[w+8>>2]=c[g+8>>2];c[w+12>>2]=c[g+12>>2];if(j|0){d=+h[w>>3];if(!(+h[j>>3]<=d)){a=0;break}if(!(d<=+h[j+16>>3])){a=0;break}d=+h[w+8>>3];if(!(+h[j+8>>3]<=d)){a=0;break}a=d<=+h[j+24>>3];break}if((k|0)==(c[47292]|0)){d=+h[23309];e=+h[23310];i=+h[23311];}else {a=k+16|0;b=c[(c[a>>2]|0)+12>>2]|0;c[47293]=b;c[47294]=c[b+44>>2];c[47295]=c[b+8>>2];if(!(c[b+40>>2]&2048)){n=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&1|0)==0;o=c[a>>2]|0;h[(n?186496:186504)>>3]=+h[o+96>>3]+ +h[o+88>>3];h[(n?186504:186496)>>3]=+h[o+80>>3];i=+h[o+32>>3]*72.0;f=+h[o+40>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);i=+(~~(i+(i>=0.0?.5:-.5))|0);}else {yP(u,b);i=+h[u+16>>3]-+h[u>>3];f=+h[u+24>>3]-+h[u+8>>3];o=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&1|0)==0;h[(o?186496:186504)>>3]=i;h[(o?186504:186496)>>3]=f;}d=+h[23312];if(d==0.0){h[23312]=1.0;d=1.0;}e=+h[23313];if(e==0.0){h[23313]=1.0;e=1.0;}d=i/d;h[23309]=d;e=f/e;h[23310]=e;i=i*.5;h[23311]=i;h[23314]=f*.5;o=O((c[(c[47293]|0)+4>>2]|0)+-1|0,c[47295]|0)|0;c[47296]=(o|0)>0?o:0;c[47292]=k;}f=+h[w>>3]*d;h[w>>3]=f;o=w+8|0;d=+h[o>>3]*e;h[o>>3]=d;if(!(+B(+f)>i)?(e=+B(+d),p=+h[23314],!(e>p)):0){o=c[47295]|0;if((o|0)<3){a=+L2(f/i,d/p)<1.0;break}b=(c[47297]|0)%(o|0)|0;a=(b+1|0)%(o|0)|0;k=c[47294]|0;m=c[47296]|0;n=k+(m+b<<4)|0;c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];n=k+(m+a<<4)|0;c[r>>2]=c[n>>2];c[r+4>>2]=c[n+4>>2];c[r+8>>2]=c[n+8>>2];c[r+12>>2]=c[n+12>>2];c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[46630];c[v+4>>2]=c[46631];c[v+8>>2]=c[46632];c[v+12>>2]=c[46633];c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[u>>2]=c[n>>2];c[u+4>>2]=c[n+4>>2];c[u+8>>2]=c[n+8>>2];c[u+12>>2]=c[n+12>>2];if(BN(s,v,t,u)|0){c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[q>>2];c[v+4>>2]=c[q+4>>2];c[v+8>>2]=c[q+8>>2];c[v+12>>2]=c[q+12>>2];c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];c[u>>2]=c[46630];c[u+4>>2]=c[46631];c[u+8>>2]=c[46632];c[u+12>>2]=c[46633];n=(BN(s,v,t,u)|0)!=0;if(n?(c[s>>2]=c[w>>2],c[s+4>>2]=c[w+4>>2],c[s+8>>2]=c[w+8>>2],c[s+12>>2]=c[w+12>>2],c[v>>2]=c[r>>2],c[v+4>>2]=c[r+4>>2],c[v+8>>2]=c[r+8>>2],c[v+12>>2]=c[r+12>>2],c[t>>2]=c[46630],c[t+4>>2]=c[46631],c[t+8>>2]=c[46632],c[t+12>>2]=c[46633],c[u>>2]=c[q>>2],c[u+4>>2]=c[q+4>>2],c[u+8>>2]=c[q+8>>2],c[u+12>>2]=c[q+12>>2],(BN(s,v,t,u)|0)!=0):0){a=1;break}else {j=b;b=1;}while(1){if((b|0)>=(o|0)){b=31;break}if(n){g=a;a=(a+1|0)%(o|0)|0;}else {g=(j+-1+o|0)%(o|0)|0;a=j;}q=k+(m+g<<4)|0;r=k+(m+a<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[46630];c[v+4>>2]=c[46631];c[v+8>>2]=c[46632];c[v+12>>2]=c[46633];c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[u>>2]=c[r>>2];c[u+4>>2]=c[r+4>>2];c[u+8>>2]=c[r+8>>2];c[u+12>>2]=c[r+12>>2];if(!(BN(s,v,t,u)|0)){b=30;break}else {j=g;b=b+1|0;}}if((b|0)==30){c[47297]=g;a=0;break}else if((b|0)==31){c[47297]=j;a=1;break}}else a=0;}else a=0;}else {c[47292]=0;a=0;}while(0);l=x;return a&1|0}function UN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0;j=l;l=l+32|0;f=j+16|0;i=j;if(a){a=c[a>>2]|0;k=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(i,f,k);g=+h[i>>3];e=+h[i+8>>3];if((a|0)==(c[47300]|0))d=+h[23317];else {i=c[(c[a+16>>2]|0)+12>>2]|0;k=(c[i+4>>2]<<1)+-2|0;d=+h[(c[i+44>>2]|0)+((((k|0)>0?k:0)|1)<<4)>>3];h[23317]=d;c[47300]=a;}if(+B(+g)>d|+B(+e)>d)a=0;else a=+L2(g,e)<=d&1;}else {c[47300]=0;a=0;}l=j;return a|0}function VN(e,f){e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0,w=0;t=l;l=l+16|0;j=t;r=c[e+16>>2]|0;s=r+208|0;g=c[s>>2]|0;if((g|0)==0?(b[r+260>>1]&1)==0:0)q=0;else if(!(c[e+152>>2]&4)){cS(e,g,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);q=1;}else q=1;n=f+16|0;k=c[(c[n>>2]|0)+12>>2]|0;o=c[k+44>>2]|0;p=c[k+8>>2]|0;k=c[k+4>>2]|0;if((c[47298]|0)<(p|0)){g=p+2|0;c[47298]=g;i=c[47299]|0;if(!i)g=KK(g<<4)|0;else g=MK(i,g<<4)|0;c[47299]=g;}yN(f,j)|0;if(!(c[j>>2]&32))lS(e,22020);else lS(e,22016);g=c[47172]|0;if(g|0)uS(e,+_O(f,g,1.0,0.0));g=d[(c[n>>2]|0)+117>>0]|0;do if(!(g&1)){if(g&2|0){hS(e,bP(f,0,106256)|0);g=bP(f,0,106264)|0;jS(e,g);break}if(g&8|0){hS(e,bP(f,0,106272)|0);g=bP(f,0,106280)|0;jS(e,g);break}if(!(g&4)){g=xN(f,137314)|0;jS(e,g);uN(e,f)|0;break}else {hS(e,bP(f,0,106288)|0);g=bP(f,0,106296)|0;jS(e,g);break}}else {hS(e,bP(f,0,106240)|0);g=bP(f,0,106248)|0;jS(e,g);}while(0);if(!k)if(!(a[g>>0]|0))i=1;else {hS(e,g);i=1;}else i=k;j=1;f=0;while(1){if((f|0)>=(i|0))break;k=O(f,p)|0;m=c[47299]|0;g=0;while(1){if((g|0)>=(p|0))break;w=g+k|0;u=+h[o+(w<<4)+8>>3];v=c[n>>2]|0;h[m+(g<<4)>>3]=+h[v+16>>3]+ +h[o+(w<<4)>>3];h[m+(g<<4)+8>>3]=+h[v+24>>3]+u;g=g+1|0;}mS(e,m,p,j);j=0;f=f+1|0;}if(q){if(c[e+152>>2]&4|0)cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);dS(e);}l=t;return}function WN(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+48|0;h=g;e=XN(b,e,f)|0;c[h+36>>2]=c[f+36>>2];CN(b,c[f+24>>2]|0,h,e,d[f+33>>0]|0,0)|0;b=h;e=a+40|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0;}while((a|0)<(e|0));l=g;return}function XN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0;z=l;l=l+32|0;y=z;g=z+24|0;k=z+16|0;x=c[(c[(c[(xC(b)|0)+60>>2]|0)+16>>2]|0)+116>>2]&3;f=b+16|0;w=(c[f>>2]|0)+16|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];YN(g,y,x);w=(c[d+16>>2]|0)+16|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];YN(k,y,x);x=a[e+33>>0]|0;y=x&255;a:do switch(x<<24>>24){case 0:case 15:{d=0;break}default:{d=c[e+24>>2]|0;if(!d){x=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;w=c[f>>2]|0;B=+h[w+80>>3]*.5;A=-B;m=+h[w+88>>3];j=-m;n=x?j:A;i=x?m:B;m=x?B:m;j=x?A:j;}else {n=+h[d>>3];i=+h[d+16>>3];m=+h[d+24>>3];j=+h[d+8>>3];}x=c[g>>2]|0;v=c[g+4>>2]|0;w=c[k>>2]|0;s=c[k+4>>2]|0;t=~~j;u=~~((i+n)*.5);r=~~i;q=~~((m+j)*.5);p=~~m;o=~~n;g=0;k=0;d=0;e=0;b=0;while(1){if((k|0)==4)break a;if(1<>2]|0;else f=g;}else f=g;g=f;k=k+1|0;}}}while(0);l=z;return d|0}function YN(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;switch(d|0){case 0:{f=+h[b>>3];e=+h[b+8>>3];break}case 2:{f=+h[b>>3];e=-+h[b+8>>3];break}case 1:{f=-+h[b+8>>3];e=+h[b>>3];break}case 3:{f=+h[b+8>>3];e=+h[b>>3];break}default:{f=0.0;e=0.0;}}c[a>>2]=~~(f+(f>=0.0?.5:-.5));c[a+4>>2]=~~(e+(e>=0.0?.5:-.5));return}function ZN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;f=i+40|0;h=i;g=b+16|0;e=c[g>>2]|0;d=e+16|0;if(a[e+47>>0]|0){e=c[b>>2]&3;WN(f,c[((e|0)==3?b:b+48|0)+40>>2]|0,c[((e|0)==2?b:b+-48|0)+40>>2]|0,d);e=f;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));e=c[g>>2]|0;}d=e+56|0;if(a[e+87>>0]|0){e=c[b>>2]&3;WN(h,c[((e|0)==2?b:b+-48|0)+40>>2]|0,c[((e|0)==3?b:b+48|0)+40>>2]|0,d);e=h;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0))}l=i;return}function _N(){var a=0,b=0,d=0;a=l;l=l+32|0;b=a+16|0;d=a;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];TN(0,b)|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];UN(0,b)|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];pN(0,b)|0;l=a;return}function $N(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;z=l;l=l+192|0;s=z+176|0;x=z+112|0;y=z+48|0;t=z+32|0;u=z+24|0;v=z+16|0;w=z;if(!(e<<24>>24)){k=d+48|0;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];k=u;m=v;n=x;o=0;}else {c[t>>2]=c[d>>2];c[t+4>>2]=c[d+4>>2];c[t+8>>2]=c[d+8>>2];c[t+12>>2]=c[d+12>>2];k=v;m=u;n=0;o=x;}h[u>>3]=0.0;h[v>>3]=1.0;q=t+8|0;f=0.0;g=1.0;j=0;p=+h[t>>3];while(1){r=+h[q>>3];f=(f+g)*.5;kP(w,d,3,f,n,o);c[t>>2]=c[w>>2];c[t+4>>2]=c[w+4>>2];c[t+8>>2]=c[w+8>>2];c[t+12>>2]=c[w+12>>2];c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];a:do if(!((lb[b&127](a,s)|0)<<24>>24)){e=0;while(1){if((e|0)==4){e=k;j=1;break a}j=y+(e<<4)|0;A=x+(e<<4)|0;c[j>>2]=c[A>>2];c[j+4>>2]=c[A+4>>2];c[j+8>>2]=c[A+8>>2];c[j+12>>2]=c[A+12>>2];e=e+1|0;}}else e=m;while(0);h[e>>3]=f;i=+h[t>>3];p=p-i;if(!((p>=0.0?p:-p)>.5)?(r=r-+h[q>>3],!((r>=0.0?r:-r)>.5)):0)break;f=+h[u>>3];g=+h[v>>3];p=i;}b:do if(!(j<<24>>24)){e=0;while(1){if((e|0)==4)break b;A=d+(e<<4)|0;y=x+(e<<4)|0;c[A>>2]=c[y>>2];c[A+4>>2]=c[y+4>>2];c[A+8>>2]=c[y+8>>2];c[A+12>>2]=c[y+12>>2];e=e+1|0;}}else {e=0;while(1){if((e|0)==4)break b;A=d+(e<<4)|0;x=y+(e<<4)|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];e=e+1|0;}}while(0);l=z;return}function aO(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0;m=l;l=l+48|0;d=m+16|0;e=m;f=m+32|0;g=a+16|0;i=c[g>>2]|0;j=c[i+8>>2]|0;if(j|0?(k=j+4|0,c[(c[k>>2]|0)+12>>2]|0):0){c[f>>2]=a;c[f+4>>2]=0;n=+h[i+96>>3];h[e>>3]=+h[b>>3]-+h[i+16>>3];h[e+8>>3]=+h[b+8>>3]-+h[i+24>>3];k=c[(c[k>>2]|0)+12>>2]|0;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];k=lb[k&127](f,d)|0;h[(c[g>>2]|0)+96>>3]=n;bO(f,a,b,k);}l=m;return}function bO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+64|0;m=n;j=b+16|0;g=c[j>>2]|0;k=+h[g+96>>3];i=g+16|0;f=g+24|0;b=0;while(1){if((b|0)==4)break;h[m+(b<<4)>>3]=+h[d+(b<<4)>>3]-+h[i>>3];h[m+(b<<4)+8>>3]=+h[d+(b<<4)+8>>3]-+h[f>>3];b=b+1|0;}$N(a,c[(c[(c[g+8>>2]|0)+4>>2]|0)+12>>2]|0,m,e);b=0;while(1){if((b|0)==4)break;e=c[j>>2]|0;h[d+(b<<4)>>3]=+h[e+16>>3]+ +h[m+(b<<4)>>3];h[d+(b<<4)+8>>3]=+h[e+24>>3]+ +h[m+(b<<4)+8>>3];b=b+1|0;}h[(c[j>>2]|0)+96>>3]=k;l=n;return}function cO(b,d){b=b|0;d=d|0;var e=0,f=0;while(1){f=b+16|0;b=c[f>>2]|0;if(!(a[b+112>>0]|0))break;b=c[b+116>>2]|0;}b=c[b+8>>2]|0;if(!b){b=JK(40)|0;c[(c[f>>2]|0)+8>>2]=b;}e=c[b>>2]|0;if(!e)b=KK(((c[b+4>>2]|0)*48|0)+48|0)|0;else b=MK(e,((c[b+4>>2]|0)*48|0)+48|0)|0;f=c[(c[f>>2]|0)+8>>2]|0;c[f>>2]=b;f=f+4|0;e=c[f>>2]|0;c[f>>2]=e+1;f=b+(e*48|0)|0;c[f>>2]=JK(d<<4)|0;c[b+(e*48|0)+4>>2]=d;b=b+(e*48|0)+8|0;e=b+40|0;do{c[b>>2]=0;b=b+4|0;}while((b|0)<(e|0));return f|0}function dO(b,e,f,g,i){b=b|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0.0,F=0.0;D=l;l=l+96|0;A=D+16|0;u=D;x=D+92|0;y=D+88|0;v=D+80|0;m=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;z=xC(m)|0;B=cO(b,g)|0;n=b;while(1){o=c[n+16>>2]|0;if(!(a[o+112>>0]|0))break;n=c[o+116>>2]|0;}if((a[i+8>>0]|0)==0?(j=c[m+16>>2]|0,k=c[e+16>>2]|0,(c[j+232>>2]|0)==(c[k+232>>2]|0)):0){p=(c[j+236>>2]|0)>(c[k+236>>2]|0);w=p?m:e;m=p?e:m;}else w=e;if((m|0)==(c[((c[n>>2]&3|0)==3?n:n+48|0)+40>>2]|0)){j=o+80|0;k=o+40|0;p=d[o+86>>0]|0;e=d[o+46>>0]|0;}else {j=o+40|0;k=o+80|0;p=d[o+46>>0]|0;e=d[o+86>>0]|0;}o=c[j>>2]|0;j=c[k>>2]|0;if(((e|0)!=0?(r=m+16|0,q=c[(c[r>>2]|0)+8>>2]|0,(q|0)!=0):0)?(c[(c[q+4>>2]|0)+12>>2]|0)!=0:0){c[v>>2]=m;c[v+4>>2]=j;j=g+-4|0;e=u+8|0;k=0;while(1){if((k|0)>=(j|0))break;n=k+3|0;q=c[r>>2]|0;h[u>>3]=+h[f+(n<<4)>>3]-+h[q+16>>3];h[e>>3]=+h[f+(n<<4)+8>>3]-+h[q+24>>3];q=c[(c[(c[q+8>>2]|0)+4>>2]|0)+12>>2]|0;c[A>>2]=c[u>>2];c[A+4>>2]=c[u+4>>2];c[A+8>>2]=c[u+8>>2];c[A+12>>2]=c[u+12>>2];if(!((lb[q&127](v,A)|0)<<24>>24))break;else k=n;}c[x>>2]=k;bO(v,m,f+(k<<4)|0,1);}else {c[x>>2]=0;k=0;}if(((p|0)!=0?(t=w+16|0,s=c[(c[t>>2]|0)+8>>2]|0,(s|0)!=0):0)?(c[(c[s+4>>2]|0)+12>>2]|0)!=0:0){c[v>>2]=w;c[v+4>>2]=o;m=g+-4|0;e=u+8|0;j=m;while(1){if((j|0)<=0)break;g=c[t>>2]|0;h[u>>3]=+h[f+(j<<4)>>3]-+h[g+16>>3];h[e>>3]=+h[f+(j<<4)+8>>3]-+h[g+24>>3];g=c[(c[(c[g+8>>2]|0)+4>>2]|0)+12>>2]|0;c[A>>2]=c[u>>2];c[A+4>>2]=c[u+4>>2];c[A+8>>2]=c[u+8>>2];c[A+12>>2]=c[u+12>>2];if(!((lb[g&127](v,A)|0)<<24>>24))break;j=j+-3|0;}c[y>>2]=j;bO(v,w,f+(j<<4)|0,0);}else {m=g+-4|0;c[y>>2]=m;j=m;}while(1){if((k|0)>=(m|0))break;e=k+3|0;E=+h[f+(k<<4)>>3]-+h[f+(e<<4)>>3];F=+h[f+(k<<4)+8>>3]-+h[f+(e<<4)+8>>3];if(F*F+E*E<1.0e-06)k=e;else break}c[x>>2]=k;while(1){if((j|0)<=0)break;v=j+3|0;F=+h[f+(j<<4)>>3]-+h[f+(v<<4)>>3];E=+h[f+(j<<4)+8>>3]-+h[f+(v<<4)+8>>3];if(!(E*E+F*F<1.0e-06))break;j=j+-3|0;}c[y>>2]=j;eO(b,w,f,x,y,B,i);r=c[x>>2]|0;n=c[y>>2]|0;m=n+4|0;n=n+3|0;o=A+16|0;p=A+32|0;q=A+48|0;k=z+16|0;j=r;while(1){if((j|0)>=(m|0))break;z=(c[B>>2]|0)+(j-r<<4)|0;e=f+(j<<4)|0;c[z>>2]=c[e>>2];c[z+4>>2]=c[e+4>>2];c[z+8>>2]=c[e+8>>2];c[z+12>>2]=c[e+12>>2];c[A>>2]=c[e>>2];c[A+4>>2]=c[e+4>>2];c[A+8>>2]=c[e+8>>2];c[A+12>>2]=c[e+12>>2];e=j+1|0;if((j|0)>=(n|0)){C=38;break}y=(c[B>>2]|0)+(e-r<<4)|0;z=f+(e<<4)|0;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[o>>2]=c[z>>2];c[o+4>>2]=c[z+4>>2];c[o+8>>2]=c[z+8>>2];c[o+12>>2]=c[z+12>>2];z=j+2|0;y=(c[B>>2]|0)+(z-r<<4)|0;z=f+(z<<4)|0;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[p>>2]=c[z>>2];c[p+4>>2]=c[z+4>>2];c[p+8>>2]=c[z+8>>2];c[p+12>>2]=c[z+12>>2];z=j+3|0;y=f+(z<<4)|0;c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];lI((c[k>>2]|0)+16|0,A);j=z;}c[B+4>>2]=m-r;l=D;return}function eO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;m=p+4|0;n=p;o=b;while(1){j=c[(c[o+16>>2]|0)+116>>2]|0;if(!j)break;else o=j;}if(!(a[i+8>>0]|0))j=(kb[c[i>>2]&63](o)|0)&255;else j=0;HH(o,m,n);k=i+4|0;if((kb[c[k>>2]&63](d)|0)<<24>>24)c[n>>2]=0;if((kb[c[k>>2]&63](c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)<<24>>24)c[m>>2]=0;if(j|0){d=c[m>>2]|0;c[m>>2]=c[n>>2];c[n>>2]=d;}if(!(a[i+9>>0]|0)){j=c[m>>2]|0;if(j|0)c[f>>2]=WH(o,e,c[f>>2]|0,c[g>>2]|0,h,j)|0;j=c[n>>2]|0;if(j|0)c[g>>2]=UH(o,e,c[f>>2]|0,c[g>>2]|0,h,j)|0;}else {k=c[n>>2]|0;j=c[m>>2]|0;if(j|k|0)XH(o,e,c[f>>2]|0,c[g>>2]|0,h,j,k);}l=p;return}function fO(a,b){a=a|0;b=b|0;var d=0,e=0;if(+h[b>>3]<+h[b+16>>3]?+h[b+8>>3]<+h[b+24>>3]:0){d=c[a+84>>2]|0;e=a+80|0;a=c[e>>2]|0;c[e>>2]=a+1;a=d+(a<<5)|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];}return}function gO(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0;x=l;l=l+112|0;u=x+72|0;o=x+56|0;n=x+16|0;q=x;j=c[d>>2]&3;p=d+48|0;w=c[((j|0)==3?d:p)+40>>2]|0;t=d+16|0;r=c[t>>2]|0;i=r+16|0;if(a[r+47>>0]|0){WN(n,w,c[((j|0)==2?d:d+-48|0)+40>>2]|0,i);j=n;n=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(n|0))}r=w+16|0;j=c[r>>2]|0;i=c[j+8>>2]|0;if(!i)n=0;else n=c[(c[i+4>>2]|0)+16>>2]|0;i=j+16|0;j=(c[t>>2]|0)+16|0;c[o>>2]=c[i>>2];c[o+4>>2]=c[i+4>>2];c[o+8>>2]=c[i+8>>2];c[o+12>>2]=c[i+12>>2];c[u>>2]=c[j>>2];c[u+4>>2]=c[j+4>>2];c[u+8>>2]=c[j+8>>2];c[u+12>>2]=c[j+12>>2];hO(q,o,u);c[b>>2]=c[q>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];c[b+12>>2]=c[q+12>>2];if(!(g<<24>>24)){i=c[t>>2]|0;if(!(a[i+45>>0]|0))i=0;else {k=+h[i+32>>3];v=9;}}else {k=+iO(c[((c[d>>2]&3|0)==3?d:p)+40>>2]|0);v=9;}if((v|0)==9){h[b+16>>3]=k;i=1;}a[b+29>>0]=i;c[b+80>>2]=0;c[b+88>>2]=d;q=f+32|0;c[q>>2]=c[b>>2];c[q+4>>2]=c[b+4>>2];c[q+8>>2]=c[b+8>>2];c[q+12>>2]=c[b+12>>2];switch(e|0){case 1:{j=c[r>>2]|0;if((a[j+156>>0]|0)==0?(q=a[(c[t>>2]|0)+49>>0]|0,s=q&255,q<<24>>24!=0):0){c[u>>2]=c[f>>2];c[u+4>>2]=c[f+4>>2];c[u+8>>2]=c[f+8>>2];c[u+12>>2]=c[f+12>>2];c[u+16>>2]=c[f+16>>2];c[u+20>>2]=c[f+20>>2];c[u+24>>2]=c[f+24>>2];c[u+28>>2]=c[f+28>>2];do if(!(s&4)){if(s&1|0){c[f+48>>2]=1;i=u+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?u+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}i=f+48|0;if(!(s&8)){c[i>>2]=2;h[u>>3]=+h[b>>3];h[u+8>>3]=+h[j+24>>3]-+h[j+80>>3]*.5;h[u+24>>3]=+h[b+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}else {c[i>>2]=8;h[u+16>>3]=+h[b>>3];h[u+8>>3]=+h[j+24>>3]-+h[j+80>>3]*.5;h[u+24>>3]=+h[b+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}}else {c[f+48>>2]=4;k=+h[u>>3];if(+h[b>>3]<+h[j+16>>3]){z=k+-1.0;y=+h[b+8>>3];b=u+16|0;k=+h[b>>3];m=+h[j+80>>3]*.5+ +h[j+24>>3];m=m+ +((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[r>>2]|0;h[b>>3]=+h[i+16>>3]-+h[i+88>>3];h[u+24>>3]=y;h[u+8>>3]=+h[i+24>>3]-+h[i+80>>3]*.5;h[u>>3]=z;h[f+56>>3]=z;h[f+64>>3]=y;h[f+72>>3]=k;h[f+80>>3]=m;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}else {m=+h[b+8>>3];i=u+16|0;y=+h[i>>3]+1.0;z=+h[j+80>>3]*.5+ +h[j+24>>3];z=z+ +((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[r>>2]|0;h[u>>3]=+h[b+96>>3]+ +h[b+16>>3];h[u+24>>3]=m;h[u+8>>3]=+h[b+24>>3]-+h[b+80>>3]*.5;h[i>>3]=y;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=y;h[f+80>>3]=z;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((w|0)==(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)?i+16|0:i+56|0)+30>>0]=0;}else {j=1;v=47;}break}case 2:{s=a[(c[t>>2]|0)+49>>0]|0;j=s&255;if(!(s<<24>>24))v=46;else {c[u>>2]=c[f>>2];c[u+4>>2]=c[f+4>>2];c[u+8>>2]=c[f+8>>2];c[u+12>>2]=c[f+12>>2];c[u+16>>2]=c[f+16>>2];c[u+20>>2]=c[f+20>>2];c[u+24>>2]=c[f+24>>2];c[u+28>>2]=c[f+28>>2];do if(!(j&4)){if(j&1|0)if((c[f+48>>2]|0)==4){i=c[r>>2]|0;z=+h[i+24>>3]-+h[i+80>>3]*.5;i=u+16|0;y=+h[i>>3]+1.0;k=+h[b>>3];m=z-+((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[r>>2]|0;h[u>>3]=+h[b+96>>3]+ +h[b+16>>3];h[u+8>>3]=z;h[u+24>>3]=+h[b+80>>3]*.5+ +h[b+24>>3];h[i>>3]=y;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=y;h[f+80>>3]=z;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}else {i=u+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?u+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}k=+h[b>>3];if(!(j&8)){h[u>>3]=k;e=c[r>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[u+24>>3]=m+k;k=+h[b+8>>3];i=u;}else {h[u+8>>3]=k-m;k=+h[b+8>>3]+1.0;i=u+16|0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}else {i=u+16|0;h[i>>3]=k+1.0;e=c[r>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[u+24>>3]=m+k;k=+h[b+8>>3]+-1.0;i=u;}else {h[u+8>>3]=k-m;k=+h[b+8>>3]+1.0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}}else {i=u+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+8>>3]?u:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((w|0)==(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)?i+16|0:i+56|0)+30>>0]=0;c[f+48>>2]=j;}break}default:v=46;}if((v|0)==46){j=c[f+48>>2]|0;v=47;}a:do if((v|0)==47){if(n){d=f+56|0;i=f+52|0;j=pb[n&127](w,(c[t>>2]|0)+16|0,j,d,i)|0;if(j){c[f+48>>2]=j;break}}else {i=f+52|0;d=f+56|0;};c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];c[d+16>>2]=c[f+16>>2];c[d+20>>2]=c[f+20>>2];c[d+24>>2]=c[f+24>>2];c[d+28>>2]=c[f+28>>2];c[i>>2]=1;switch(e|0){case 8:{qa(138394,106514,569,106524);break}case 2:{h[((c[f+48>>2]|0)==4?f+56|0:f+72|0)+8>>3]=+h[b+8>>3];break a}case 1:{h[f+80>>3]=+h[b+8>>3];c[f+48>>2]=1;break a}default:break a}}while(0);l=x;return}function hO(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function iO(a){a=a|0;var b=0.0,d=0,e=0,f=0.0,g=0,i=0,j=0,k=0.0,l=0.0;i=c[a+16>>2]|0;j=c[i+172>>2]|0;f=0.0;g=0;while(1){a=c[j+(g<<2)>>2]|0;if(!a)break;f=+h[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+16>>3]+f;g=g+1|0;}e=c[i+180>>2]|0;b=0.0;a=0;while(1){d=c[e+(a<<2)>>2]|0;if(!d)break;b=+h[(c[(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+16>>3]+b;a=a+1|0;}k=+h[i+16>>3];l=+h[i+24>>3];j=c[j>>2]|0;f=+K(+(l-+h[(c[(c[((c[j>>2]&3|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+24>>3]),+(k-f/+(g|0)));j=c[e>>2]|0;return +((+K(+(+h[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+24>>3]-l),+(b/+(a|0)-k))+f)*.5)}function jO(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0;z=l;l=l+112|0;w=z+72|0;p=z+56|0;n=z+16|0;t=z;j=c[d>>2]&3;r=d+-48|0;y=c[((j|0)==2?d:r)+40>>2]|0;u=d+16|0;s=c[u>>2]|0;i=s+56|0;if(a[s+87>>0]|0){WN(n,y,c[((j|0)==3?d:d+48|0)+40>>2]|0,i);j=n;n=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(n|0))}s=y+16|0;j=c[s>>2]|0;i=c[j+8>>2]|0;if(!i)o=0;else o=c[(c[i+4>>2]|0)+16>>2]|0;n=b+40|0;i=j+16|0;j=(c[u>>2]|0)+56|0;c[p>>2]=c[i>>2];c[p+4>>2]=c[i+4>>2];c[p+8>>2]=c[i+8>>2];c[p+12>>2]=c[i+12>>2];c[w>>2]=c[j>>2];c[w+4>>2]=c[j+4>>2];c[w+8>>2]=c[j+8>>2];c[w+12>>2]=c[j+12>>2];hO(t,p,w);c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];if(!(g<<24>>24)){i=c[u>>2]|0;if(!(a[i+85>>0]|0))q=0;else {h[b+56>>3]=+h[i+72>>3];q=1;}}else {m=+iO(c[((c[d>>2]&3|0)==2?d:r)+40>>2]|0)+3.141592653589793;h[b+56>>3]=m;if(m<6.283185307179586)q=1;else qa(106534,106514,606,106558);}a[b+69>>0]=q;t=f+32|0;c[t>>2]=c[n>>2];c[t+4>>2]=c[n+4>>2];c[t+8>>2]=c[n+8>>2];c[t+12>>2]=c[n+12>>2];switch(e|0){case 1:{j=c[s>>2]|0;if((a[j+156>>0]|0)==0?(t=a[(c[u>>2]|0)+89>>0]|0,v=t&255,t<<24>>24!=0):0){c[w>>2]=c[f>>2];c[w+4>>2]=c[f+4>>2];c[w+8>>2]=c[f+8>>2];c[w+12>>2]=c[f+12>>2];c[w+16>>2]=c[f+16>>2];c[w+20>>2]=c[f+20>>2];c[w+24>>2]=c[f+24>>2];c[w+28>>2]=c[f+28>>2];do if(!(v&4))if(!(v&1)){i=f+48|0;if(!(v&8)){c[i>>2]=2;h[w>>3]=+h[n>>3];h[w+24>>3]=+h[j+80>>3]*.5+ +h[j+24>>3];h[w+8>>3]=+h[b+48>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}else {c[i>>2]=8;h[w+16>>3]=+h[n>>3];h[w+24>>3]=+h[j+80>>3]*.5+ +h[j+24>>3];h[w+8>>3]=+h[b+48>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}}else {c[f+48>>2]=1;k=+h[w>>3];if(+h[n>>3]<+h[j+16>>3]){B=k+-1.0;m=+h[b+48>>3];b=w+16|0;k=+h[b>>3];A=+h[j+80>>3]*-.5+ +h[j+24>>3];A=A-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[s>>2]|0;h[b>>3]=+h[i+16>>3]-+h[i+88>>3];h[w+8>>3]=m;h[w+24>>3]=+h[i+80>>3]*.5+ +h[i+24>>3];h[w>>3]=B;h[f+56>>3]=B;h[f+64>>3]=A;h[f+72>>3]=k;h[f+80>>3]=m;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}else {B=+h[b+48>>3];i=w+16|0;A=+h[i>>3]+1.0;m=+h[j+80>>3]*-.5+ +h[j+24>>3];m=m-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[s>>2]|0;h[w>>3]=+h[b+96>>3]+ +h[b+16>>3];h[w+8>>3]=B;h[w+24>>3]=+h[b+80>>3]*.5+ +h[b+24>>3];h[i>>3]=A;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=A;h[f+80>>3]=B;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}}else {c[f+48>>2]=4;i=w+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+48>>3]?w:n)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((y|0)==(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)?i+56|0:i+16|0)+30>>0]=0;c[f+48>>2]=v;}else {j=4;x=47;}break}case 2:{v=a[(c[u>>2]|0)+89>>0]|0;j=v&255;if(!(v<<24>>24))x=46;else {c[w>>2]=c[f>>2];c[w+4>>2]=c[f+4>>2];c[w+8>>2]=c[f+8>>2];c[w+12>>2]=c[f+12>>2];c[w+16>>2]=c[f+16>>2];c[w+20>>2]=c[f+20>>2];c[w+24>>2]=c[f+24>>2];c[w+28>>2]=c[f+28>>2];do if(!(j&4)){if(j&1|0)if((c[f+48>>2]|0)==4){k=+h[w>>3]+-1.0;i=c[s>>2]|0;B=+h[i+24>>3]-+h[i+80>>3]*.5;A=+h[n>>3];m=B-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[s>>2]|0;h[w+16>>3]=+h[i+16>>3]+-2.0-+h[i+88>>3];h[w+8>>3]=B;h[w+24>>3]=+h[i+80>>3]*.5+ +h[i+24>>3];h[w>>3]=k;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=A;h[f+80>>3]=B;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}else {i=w+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?w+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}k=+h[n>>3];if(!(j&8)){h[w>>3]=k+-1.0;e=c[s>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[w+24>>3]=m+k;k=+h[b+48>>3]+-1.0;i=w;}else {h[w+8>>3]=k-m;k=+h[b+48>>3];i=w+16|0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}else {i=w+16|0;h[i>>3]=k+1.0;e=c[s>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[w+24>>3]=m+k;k=+h[b+48>>3]+-1.0;i=w;}else {h[w+8>>3]=k-m;k=+h[b+48>>3]+1.0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}}else {i=w+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+48>>3]?w:n)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((y|0)==(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)?i+56|0:i+16|0)+30>>0]=0;c[f+48>>2]=j;}break}default:x=46;}if((x|0)==46){j=c[f+48>>2]|0;x=47;}a:do if((x|0)==47){if(o){d=f+56|0;i=f+52|0;j=pb[o&127](y,(c[u>>2]|0)+56|0,j,d,i)|0;if(j){c[f+48>>2]=j;break}}else {i=f+52|0;d=f+56|0;};c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];c[d+16>>2]=c[f+16>>2];c[d+20>>2]=c[f+20>>2];c[d+24>>2]=c[f+24>>2];c[d+28>>2]=c[f+28>>2];c[i>>2]=1;switch(e|0){case 8:{qa(138394,106514,765,106558);break}case 2:{h[((c[f+48>>2]|0)==4?f+56|0:f+72|0)+8>>3]=+h[b+48>>3];break a}case 1:{h[f+64>>3]=+h[b+48>>3];c[f+48>>2]=4;break a}default:break a}}while(0);l=z;return}function kO(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;g=c[b+16>>2]|0;i=c[g+96>>2]|0;if((a[g+44>>0]|0)==0?(a[g+84>>0]|0)==0:0)j=6;else {d=a[g+49>>0]|0;e=d&255;if(((e&8|0)==0?(f=a[g+89>>0]|0,(f&8)==0):0)?((e&5|0)==0?1:d<<24>>24!=f<<24>>24):0)j=6;else b=0;}if((j|0)==6)if(!i)b=18;else {b=(c[(c[(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)!=0;b=~~(+h[(b?i+32|0:i+24|0)>>3]+18.0);}return b|0}function lO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=+g;h=+h;i=i|0;var j=0,k=0,l=0,m=0;b=c[(c[d+(e<<2)>>2]|0)+16>>2]|0;if((a[b+44>>0]|0)==0?(a[b+84>>0]|0)==0:0)l=6;else l=3;do if((l|0)==3){j=a[b+49>>0]|0;k=j&255;if(!(k&8)){m=a[b+89>>0]|0;if((m&8)==0?((k&5|0)==0?1:j<<24>>24!=m<<24>>24):0){l=6;break}if(!(a[b+89>>0]&8)){if(k&4|0){nO(d,e,f,g,h,i);break}if(!(k&1))qa(138394,106514,1231,106566);else {pO(d,e,f,g,h,i);break}}}if((j&2)==0?(a[b+89>>0]&2)==0:0){oO(d,e,f,g,h,i);break}nO(d,e,f,g,h,i);}while(0);if((l|0)==6)mO(d,e,f,g,h,i);return}function mO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,C=0.0,D=0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;B=c[b+(e<<2)>>2]|0;n=i*.5/+(f|0);n=n>2.0?n:2.0;D=(c[((c[B>>2]&3|0)==3?B:B+48|0)+40>>2]|0)+16|0;A=c[D>>2]|0;C=+h[A+16>>3];H=+h[A+24>>3];B=c[B+16>>2]|0;m=+h[B+16>>3];E=m+C;F=+h[B+24>>3]+H;i=+h[B+56>>3];G=i+C;H=+h[B+64>>3]+H;k=!(F>=H)?-1:1;p=+h[A+96>>3];switch(qO(d[B+49>>0]|0,d[B+89>>0]|0)|0){case 65:case 32:{if(F==H)k=0-k|0;break}default:{}}Q=(p-m)*3.0;m=(p-i)*3.0;v=n*+(k|0);u=L+8|0;w=L+16|0;x=L+32|0;y=L+48|0;z=(H+F)*.5;A=L+64|0;B=L+80|0;s=L+96|0;t=L+104|0;r=0;o=0.0;i=p;n=p=(f|0))break;q=e+1|0;e=c[b+(e<<2)>>2]|0;p=i+g;n=n+g;m=m+g;o=o+v;h[L>>3]=E;h[u>>3]=F;Q=o+F;rO(M,n*.3333333333333333+E,Q);c[w>>2]=c[M>>2];c[w+4>>2]=c[M+4>>2];c[w+8>>2]=c[M+8>>2];c[w+12>>2]=c[M+12>>2];R=p+C;rO(N,R,Q);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];rO(O,R,z);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];Q=H-o;rO(J,R,Q);c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];rO(K,m*.3333333333333333+G,Q);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];h[s>>3]=G;h[t>>3]=H;k=e+16|0;if((c[(c[k>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,k=c[(c[k>>2]|0)+96>>2]|0,I=+h[(S?k+24|0:k+32|0)>>3],S=c[D>>2]|0,h[k+56>>3]=I*.5+p+ +h[S+16>>3],h[k+64>>3]=+h[S+24>>3],a[k+81>>0]=1,I>g):0)i=I+i;else i=p;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,L,7,j);e=q;r=r+1|0;}l=P;return}function nO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0.0,E=0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0.0,S=0;Q=l;l=l+16080|0;M=Q+80|0;N=Q+64|0;O=Q+48|0;P=Q+32|0;K=Q+16|0;L=Q;C=c[b+(e<<2)>>2]|0;q=g*.5/+(f|0);q=q>2.0?q:2.0;E=(c[((c[C>>2]&3|0)==3?C:C+48|0)+40>>2]|0)+16|0;m=c[E>>2]|0;H=+h[m+16>>3];D=+h[m+24>>3];C=c[C+16>>2]|0;k=+h[C+16>>3];p=+h[C+24>>3];F=k+H;G=p+D;g=+h[C+56>>3];o=+h[C+64>>3];H=g+H;I=o+D;n=!(F>=H)?-1.0:1.0;s=+h[m+80>>3]*.5;switch(qO(d[C+49>>0]|0,d[C+89>>0]|0)|0){case 15:{k=(q-g+ +h[m+96>>3])*n;break}case 38:{k=(g+q+ +h[m+88>>3])*n;break}case 41:{k=(q-k+ +h[m+96>>3])*n;break}case 48:{k=(q-k+ +h[m+96>>3])*n;break}case 58:case 57:case 51:case 47:case 37:case 14:{k=n*.3333333333333333*(k-g+ +h[m+88>>3]+ +h[m+96>>3]);break}case 73:{k=(k+q+ +h[m+88>>3])*n;break}case 83:{k=(+h[m+88>>3]+k)*n;break}case 84:{k=((k-g+ +h[m+88>>3]+ +h[m+96>>3])*.5+q)*n;break}case 85:case 75:case 74:{k=((k-g+ +h[m+88>>3]+ +h[m+96>>3])*.5+q*2.0)*n;break}default:k=0.0;}p=(s-p)*3.0;o=(s-o)*3.0;q=n*q;w=M+8|0;x=M+16|0;y=M+32|0;z=M+48|0;A=(H+F)*.5;B=M+64|0;C=M+80|0;u=M+96|0;v=M+104|0;t=0;g=s;p=s=(f|0))break;r=e+1|0;e=c[b+(e<<2)>>2]|0;o=g+i;p=p+i;n=n+i;k=k+q;h[M>>3]=F;h[w>>3]=G;s=k+F;rO(N,s,p*.3333333333333333+G);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];R=o+D;rO(O,s,R);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];rO(P,A,R);c[z>>2]=c[P>>2];c[z+4>>2]=c[P+4>>2];c[z+8>>2]=c[P+8>>2];c[z+12>>2]=c[P+12>>2];s=H-k;rO(K,s,R);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];rO(L,s,n*.3333333333333333+I);c[C>>2]=c[L>>2];c[C+4>>2]=c[L+4>>2];c[C+8>>2]=c[L+8>>2];c[C+12>>2]=c[L+12>>2];h[u>>3]=H;h[v>>3]=I;m=e+16|0;if((c[(c[m>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,m=c[(c[m>>2]|0)+96>>2]|0,J=+h[(S?m+32|0:m+24|0)>>3],S=c[E>>2]|0,h[m+64>>3]=J*.5+o+ +h[S+24>>3],h[m+56>>3]=+h[S+16>>3],a[m+81>>0]=1,J>i):0)g=J+g;else g=o;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,M,7,j);e=r;t=t+1|0;}l=Q;return}function oO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,C=0.0,D=0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;B=c[b+(e<<2)>>2]|0;n=i*.5/+(f|0);n=n>2.0?n:2.0;D=(c[((c[B>>2]&3|0)==3?B:B+48|0)+40>>2]|0)+16|0;A=c[D>>2]|0;C=+h[A+16>>3];H=+h[A+24>>3];B=c[B+16>>2]|0;m=+h[B+16>>3];E=m+C;F=+h[B+24>>3]+H;i=+h[B+56>>3];G=i+C;H=+h[B+64>>3]+H;k=!(F>=H)?-1:1;p=+h[A+88>>3];switch(qO(d[B+49>>0]|0,d[B+89>>0]|0)|0){case 67:case 12:{if(F==H)k=0-k|0;break}default:{}}Q=(m+p)*3.0;m=(i+p)*3.0;v=n*+(k|0);u=L+8|0;w=L+16|0;x=L+32|0;y=L+48|0;z=(H+F)*.5;A=L+64|0;B=L+80|0;s=L+96|0;t=L+104|0;r=0;o=0.0;i=p;n=p=(f|0))break;q=e+1|0;e=c[b+(e<<2)>>2]|0;p=i+g;n=n+g;m=m+g;o=o+v;h[L>>3]=E;h[u>>3]=F;Q=o+F;rO(M,E-n*.3333333333333333,Q);c[w>>2]=c[M>>2];c[w+4>>2]=c[M+4>>2];c[w+8>>2]=c[M+8>>2];c[w+12>>2]=c[M+12>>2];R=C-p;rO(N,R,Q);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];rO(O,R,z);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];Q=H-o;rO(J,R,Q);c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];rO(K,G-m*.3333333333333333,Q);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];h[s>>3]=G;h[t>>3]=H;k=e+16|0;if((c[(c[k>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,k=c[(c[k>>2]|0)+96>>2]|0,I=+h[(S?k+24|0:k+32|0)>>3],S=c[D>>2]|0,h[k+56>>3]=I*-.5-p+ +h[S+16>>3],h[k+64>>3]=+h[S+24>>3],a[k+81>>0]=1,I>g):0)i=I+i;else i=p;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,L,7,j);e=q;r=r+1|0;}l=P;return}function pO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0.0,G=0,H=0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;C=c[b+(e<<2)>>2]|0;B=g*.5/+(f|0);w=(c[((c[C>>2]&3|0)==3?C:C+48|0)+40>>2]|0)+16|0;D=c[w>>2]|0;z=+h[D+16>>3];v=+h[D+24>>3];C=c[C+16>>2]|0;m=+h[C+24>>3];x=+h[C+16>>3]+z;y=m+v;n=+h[C+64>>3];z=+h[C+56>>3]+z;A=n+v;u=!(x>=z)?-1:1;o=+h[D+80>>3]*.5;C=(qO(d[C+49>>0]|0,d[C+89>>0]|0)|0)==67;m=(m+o)*3.0;n=(n+o)*3.0;B=(B>2.0?B:2.0)*+((C?0-u|0:u)|0);u=L+8|0;C=L+16|0;D=L+32|0;E=L+48|0;F=(z+x)*.5;G=L+64|0;H=L+80|0;s=L+96|0;t=L+104|0;g=o;k=0.0;m=o=(f|0))break;r=e+1|0;p=c[b+(e<<2)>>2]|0;o=g+i;m=m+i;n=n+i;k=k+B;h[L>>3]=x;h[u>>3]=y;Q=k+x;rO(M,Q,y-m*.3333333333333333);c[C>>2]=c[M>>2];c[C+4>>2]=c[M+4>>2];c[C+8>>2]=c[M+8>>2];c[C+12>>2]=c[M+12>>2];R=v-o;rO(N,Q,R);c[D>>2]=c[N>>2];c[D+4>>2]=c[N+4>>2];c[D+8>>2]=c[N+8>>2];c[D+12>>2]=c[N+12>>2];rO(O,F,R);c[E>>2]=c[O>>2];c[E+4>>2]=c[O+4>>2];c[E+8>>2]=c[O+8>>2];c[E+12>>2]=c[O+12>>2];Q=z-k;rO(J,Q,R);c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];rO(K,Q,A-n*.3333333333333333);c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];h[s>>3]=z;h[t>>3]=A;e=p+16|0;if((c[(c[e>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[p>>2]&3|0)==3?p:p+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,e=c[(c[e>>2]|0)+96>>2]|0,I=+h[(S?e+32|0:e+24|0)>>3],S=c[w>>2]|0,h[e+64>>3]=I*-.5-o+ +h[S+24>>3],h[e+56>>3]=+h[S+16>>3],a[e+81>>0]=1,I>i):0)g=I+g;else g=o;dO(p,c[((c[p>>2]&3|0)==2?p:p+-48|0)+40>>2]|0,L,7,j);e=r;q=q+1|0;}l=P;return}function qO(a,b){a=a|0;b=b|0;var d=0;d=0;while(1){if((d|0)>=8){b=-1;break}if((c[22044+(d<<2)>>2]|0)==(b|0)){b=d;break}d=d+1|0;}d=0;while(1){if((d|0)>=8){d=-1;break}if((c[22044+(d<<2)>>2]|0)==(a|0))break;d=d+1|0;}if((d|b|0)<0)d=0;else d=c[22076+(d<<5)+(b<<2)>>2]|0;return d|0}function rO(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function sO(b){b=b|0;var d=0,e=0;if((c[47203]|0)!=0|(c[47202]|0)!=0){d=b+16|0;e=c[(c[d>>2]|0)+100>>2]|0;if((e|0?(a[e+81>>0]|0)==0:0)?tO(b,1)|0:0){e=xC(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;zP(e,c[(c[d>>2]|0)+100>>2]|0);}e=c[(c[d>>2]|0)+104>>2]|0;if((e|0?(a[e+81>>0]|0)==0:0)?tO(b,0)|0:0){e=xC(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;zP(e,c[(c[d>>2]|0)+104>>2]|0);}}return}function tO(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+96|0;o=q+32|0;m=q+16|0;n=q;i=b+16|0;do if((a[(c[i>>2]|0)+112>>0]|0)!=6){e=c[47203]|0;if(!((e|0)!=0?(a[(RA(b,e)|0)>>0]|0)!=0:0)){e=c[47202]|0;if(!e){e=0;break}if(!(a[(RA(b,e)|0)>>0]|0)){e=0;break}}d=d<<24>>24==0;p=c[i>>2]|0;p=c[(d?p+104|0:p+100|0)>>2]|0;e=uO(b)|0;if(e){k=c[e>>2]|0;do if(d){if(c[k+8>>2]|0){e=c[k>>2]|0;j=+h[e>>3];g=+h[k+16>>3];e=e+8|0;f=+h[k+24>>3];break}e=c[k>>2]|0;g=+h[e>>3];f=+h[e+8>>3];e=0;while(1){if((e|0)==4)break;n=o+(e<<4)|0;i=(c[k>>2]|0)+(e<<4)|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];e=e+1|0;}kP(m,o,3,.1,0,0);j=+h[m>>3];e=m+8|0;}else {d=(c[e+4>>2]|0)+-1|0;i=k+(d*48|0)|0;if(c[k+(d*48|0)+12>>2]|0){o=c[i>>2]|0;e=(c[k+(d*48|0)+4>>2]|0)+-1|0;j=+h[o+(e<<4)>>3];g=+h[k+(d*48|0)+32>>3];e=o+(e<<4)+8|0;f=+h[k+(d*48|0)+40>>3];break}m=c[i>>2]|0;d=k+(d*48|0)+4|0;e=(c[d>>2]|0)+-1|0;g=+h[m+(e<<4)>>3];f=+h[m+(e<<4)+8>>3];e=0;while(1){if((e|0)==4)break;m=o+(e<<4)|0;k=(c[i>>2]|0)+(e+-4+(c[d>>2]|0)<<4)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];e=e+1|0;}kP(n,o,3,.9,0,0);j=+h[n>>3];e=n+8|0;}while(0);r=+K(+(+h[e>>3]-f),+(j-g));r=+_O(b,c[47203]|0,-25.0,-180.0)*.017453292519943295+r;j=+_O(b,c[47202]|0,1.0,0.0)*10.0;h[p+56>>3]=j*+E(+r)+g;h[p+64>>3]=+F(+r)*j+f;a[p+81>>0]=1;e=1;}else e=0;}else e=0;while(0);l=q;return e|0}function uO(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;d=b;while(1){e=c[d+16>>2]|0;d=c[e+8>>2]|0;if(d|0)break;if(!(a[e+112>>0]|0)){g=5;break}d=c[e+116>>2]|0;}if((g|0)==5){g=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;d=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[f>>2]=g;c[f+4>>2]=d;gA(1,106579,f)|0;d=0;}l=h;return d|0}function vO(a,d,e){a=a|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0;s=l;l=l+96|0;m=s+80|0;n=s+64|0;o=s+48|0;p=s+32|0;q=s+16|0;r=s;k=b[(c[d+16>>2]|0)+136>>1]|0;d=e+16|0;wO(c[(c[d>>2]|0)+8>>2]|0,p,q);f=+h[p>>3];g=+h[q>>3];t=f-g;i=+h[p+8>>3];j=+h[q+8>>3];u=i-j;a:do if(u*u+t*t<1.0e-06){c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];}else switch(k&14){case 4:case 10:{h[n>>3]=(g+f)*.5;h[n+8>>3]=(j+i)*.5;q=c[(c[d>>2]|0)+8>>2]|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];qP(r,q,m);c[o>>2]=c[r>>2];c[o+4>>2]=c[r+4>>2];c[o+8>>2]=c[r+8>>2];c[o+12>>2]=c[r+12>>2];break a}default:{xO(o,c[(c[d>>2]|0)+8>>2]|0,p,q);break a}}while(0);c[a>>2]=c[o>>2];c[a+4>>2]=c[o+4>>2];c[a+8>>2]=c[o+8>>2];c[a+12>>2]=c[o+12>>2];l=s;return}function wO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+32|0;g=h+16|0;f=h;j=c[a>>2]|0;e=c[j>>2]|0;i=c[j+8>>2]|0;k=j+16|0;c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];j=j+32|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];if(!i){c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];}else {c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[b+8>>2]=c[g+8>>2];c[b+12>>2]=c[g+12>>2];}i=c[a>>2]|0;j=(c[a+4>>2]|0)+-1|0;e=c[i+(j*48|0)>>2]|0;a=c[i+(j*48|0)+4>>2]|0;k=c[i+(j*48|0)+12>>2]|0;b=i+(j*48|0)+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];j=i+(j*48|0)+32|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];if(!k){k=e+(a+-1<<4)|0;c[d>>2]=c[k>>2];c[d+4>>2]=c[k+4>>2];c[d+8>>2]=c[k+8>>2];c[d+12>>2]=c[k+12>>2];}else {c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];}l=h;return}function xO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0;r=c[b+4>>2]|0;g=0.0;f=0;while(1){if((f|0)>=(r|0))break;l=c[b>>2]|0;k=c[l+(f*48|0)>>2]|0;l=c[l+(f*48|0)+4>>2]|0;i=3;j=0;while(1){if((i|0)>=(l|0))break;q=+h[k+(j<<4)>>3]-+h[k+(i<<4)>>3];p=+h[k+(j<<4)+8>>3]-+h[k+(i<<4)+8>>3];i=i+3|0;j=j+3|0;g=+C(+(p*p+q*q))+g;}f=f+1|0;}l=0;g=g*.5;a:while(1){if((l|0)>=(r|0)){f=15;break}k=c[b>>2]|0;j=c[k+(l*48|0)>>2]|0;k=c[k+(l*48|0)+4>>2]|0;f=3;i=0;while(1){if((f|0)>=(k|0))break;m=+h[j+(i<<4)>>3];p=+h[j+(i<<4)+8>>3];n=+h[j+(f<<4)>>3];o=+h[j+(f<<4)+8>>3];q=m-n;s=p-o;q=+C(+(s*s+q*q));if(q>=g){f=12;break a}f=f+3|0;i=i+3|0;g=g-q;}l=l+1|0;}if((f|0)==12){h[d>>3]=m;h[d+8>>3]=p;h[e>>3]=n;h[e+8>>3]=o;s=q-g;h[a>>3]=(s*m+n*g)/q;h[a+8>>3]=(s*p+o*g)/q;return}else if((f|0)==15)qa(138712,106514,1316,106641);}function yO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;sO(b);return}function zO(b,d,e,f,g){b=b|0;d=d|0;e=+e;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0,G=0,H=0,I=0,J=0,K=0,L=0;J=AO(b)|0;I=c[J+4>>2]|0;K=c[J>>2]|0;H=I+-1|0;B=+h[K+(H<<6)+16>>3];C=+(I|0);D=(g|0)==2;G=(f|0)!=0;n=0;j=0.0;i=0.0;l=0.0;m=0.0;while(1){if((n|0)>=(I|0))break;b=~~+BO(+(n+-1|0),C);A=n+1|0;L=~~+BO(+(A|0),C);o=K+(n<<6)|0;m=+h[o>>3];z=K+(n<<6)+8|0;l=+h[z>>3];s=K+(n<<6)+16|0;t=+h[s>>3];u=K+(n<<6)+24|0;v=K+(n<<6)+32|0;w=K+(n<<6)+40|0;x=K+(n<<6)+48|0;y=K+(n<<6)+56|0;k=+CO(+h[K+(L<<6)+8>>3]-l,+h[K+(L<<6)>>3]-m);q=+CO(+h[K+(b<<6)+8>>3]-l,+h[K+(b<<6)>>3]-m);r=+hb[d&7](t,B,e);b=(n|0)==0;do if(b|(n|0)==(H|0))if(b){i=k+1.5707963267948966;if(!D){b=0;p=i;j=r;break}b=0;p=i;j=r;l=l-+F(+k)*r;m=m-+E(+k)*r;break}else {i=q+-1.5707963267948966;if(!D){b=0;p=i;j=r;break}b=0;p=i;j=r;l=l-+F(+q)*r;m=m-+E(+q)*r;break}else {p=k-q;p=1.5707963267948966-(p<0.0?p+6.283185307179586:p)*.5;j=+E(+p);j=j==0.0?0.0:r/j;i=k+1.5707963267948966;k=p+i;if(G|j>r*10.0){q=+BO(q+-1.5707963267948966,6.283185307179586);b=1;p=+BO(i,6.283185307179586);j=r;i=q;}else {b=0;p=k;i=k;}}while(0);h[o>>3]=m;h[z>>3]=l;h[s>>3]=t;a[u>>0]=108;h[v>>3]=i;h[w>>3]=j;c[x>>2]=b;h[y>>3]=p;n=A;}o=JK(12)|0;b=0;while(1){if((b|0)>=(I|0))break;m=+h[K+(b<<6)>>3];l=+h[K+(b<<6)+8>>3];i=+h[K+(b<<6)+32>>3];j=+h[K+(b<<6)+40>>3];L=c[K+(b<<6)+48>>2]|0;k=+h[K+(b<<6)+56>>3];DO(o,+E(+i)*j+m,+F(+i)*j+l);if(L|0)EO(m,l,j,1,i,k,f,o);b=b+1|0;}n=(g|0)==1;k=i+3.141592653589793;if(n)FO(o,m,l,j,i,k);else {DO(o,+E(+k)*j+m,+F(+k)*j+l);i=k;}b=I+-2|0;k=m;while(1){if((b|0)<=-1)break;m=+h[K+(b<<6)>>3];l=+h[K+(b<<6)+8>>3];j=+h[K+(b<<6)+40>>3];L=c[K+(b<<6)+48>>2]|0;i=+h[K+(b<<6)+32>>3]+3.141592653589793;k=+h[K+(b<<6)+56>>3]+3.141592653589793;DO(o,+E(+k)*j+m,+F(+k)*j+l);if(L|0)EO(m,l,j,0,i,k,f,o);b=b+-1|0;k=m;}if(n)FO(o,k,l,j,i,i+3.141592653589793);GO(J);return o|0}function AO(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0;q=l;l=l+144|0;i=q+128|0;h=q+112|0;j=q+96|0;k=q+64|0;m=q;n=q+80|0;o=HO()|0;p=c[a+4>>2]|0;f=c[a>>2]|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];IO(o,i,0.0);g=m+48|0;c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];d=0;b=0.0;a:while(1){e=d+3|0;if((e|0)>=(p|0))break;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];c[m+12>>2]=c[g+12>>2];a=1;while(1){if((a|0)==4)break;r=m+(a<<4)|0;s=f+(a+d<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];a=a+1|0;}c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];a=1;while(1){if((a|0)==21){d=e;continue a}kP(n,m,3,+(a|0)*.05,0,0);c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];c[h>>2]=c[j>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[h+12>>2]=c[j+12>>2];c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];c[i+12>>2]=c[n+12>>2];t=+JO(h,i)+b;c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];IO(o,i,t);c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];a=a+1|0;b=t;}}KO(o);l=q;return o|0}function BO(a,b){a=+a;b=+b;var c=0.0;c=a-+A(+(a/b))*b;return +(!(a<0.0)&!(a>=b)?a:c)}function CO(a,b){a=+a;b=+b;if(!(a==0.0&b==0.0)){a=+K(+a,+b);if(!(a>=0.0))a=a+6.283185307179586;}else a=0.0;return +a}function DO(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;e=c[a>>2]|0;f=a+4|0;if((e|0)<(c[f>>2]|0))f=c[a+8>>2]|0;else {c[f>>2]=2e3;e=a+8|0;f=MK(c[e>>2]|0,32e3)|0;c[e>>2]=f;e=c[a>>2]|0;}c[a>>2]=e+1;h[f+(e<<4)>>3]=b;h[f+(e<<4)+8>>3]=d;return}function EO(a,b,c,d,e,f,g,h){a=+a;b=+b;c=+c;d=d|0;e=+e;f=+f;g=g|0;h=h|0;var i=0.0;d=(d|0)==0;i=d?e:f;do if((g|0)==1){e=(d?f:e)-i;e=!(e<=1.7453292519943296e-03)?e:e+6.283185307179586;if(e<3.141592653589793){FO(h,a,b,c,e+i,i);break}else {DO(h,+E(+i)*c+a,+F(+i)*c+a);break}}else DO(h,+E(+i)*c+a,+F(+i)*c+a);while(0);return}function FO(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;var g=0,h=0.0;DO(a,+E(+e)*d+b,+F(+e)*d+c);a:do if(!(d==0.0)){while(1){if(!(f>e))break;f=f+-6.283185307179586;}f=e-f;while(1){if(!(f>6.283185307179586))break;f=f+-6.283185307179586;}f=f*.05263157894736842;g=1;while(1){if((g|0)==20)break a;h=e-f*+(g|0);DO(a,+E(+h)*d+b,+F(+h)*d+c);g=g+1|0;}}while(0);return}function GO(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function HO(){var a=0;a=JK(12)|0;c[a+4>>2]=0;c[a+8>>2]=2e3;c[a>>2]=JK(128e3)|0;return a|0}function IO(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;i=a+4|0;e=c[i>>2]|0;f=a+8|0;g=c[f>>2]|0;if((e|0)<(g|0))a=c[a>>2]|0;else {c[f>>2]=g<<1;e=MK(c[a>>2]|0,g<<7)|0;c[a>>2]=e;a=e;e=c[i>>2]|0;}h[a+(e<<6)>>3]=+h[b>>3];h[a+(e<<6)+8>>3]=+h[b+8>>3];c[i>>2]=e+1;h[a+(e<<6)+16>>3]=d;return}function JO(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(+C(+(d*d+c*c)))}function KO(a){a=a|0;var b=0;b=c[a+4>>2]|0;if((c[a+8>>2]|0)>(b|0))c[a>>2]=MK(c[a>>2]|0,b<<6)|0;return}function LO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;g=k+12|0;c[g>>2]=0;h=c[d+4>>2]|0;if(!h)qa(106658,106669,203,106680);e=c[h>>2]|0;if(!e)qa(106694,106669,206,106680);f=h+8|0;if(!(c[f>>2]|0))c[f>>2]=MO(e)|0;if(!0)e=0;if(!((dT(b,d,e)|0)<<24>>24))NO(d,e);do if(e|0){f=c[g>>2]|0;b=c[15712]|0;e=c[h>>2]|0;if(!f){c[j>>2]=e;w4(b,106737,j)|0;break}else {c[i>>2]=e;c[i+4>>2]=f;w4(b,106705,i)|0;break}}while(0);j=d+32|0;c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];l=k;return}function MO(a){a=a|0;var b=0;b=c[47301]|0;if((b|0)!=0?(c3(b,a)|0)==0:0)a=c[47310]|0;else {U1(b);c[47301]=D4(a)|0;a=u5(189204,22332,35,36,95)|0;c[47310]=a;}return a|0}function NO(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0.0,j=0,k=0.0;j=c[b+4>>2]|0;e=c[j>>2]|0;i=+h[j+16>>3];j=b+32|0;h[j>>3]=0.0;h[b+40>>3]=i*1.2;h[b+16>>3]=0.0;h[b+24>>3]=i*.1;c[b+8>>2]=0;c[b+12>>2]=0;if(j3(e,106771,4)|0)if((j3(e,106776,5)|0)!=0?(j3(e,106782,9)|0)!=0:0){g=4248;e=106792;}else {g=8344;e=106828;}else {g=6296;e=106809;}if(d|0)c[d>>2]=e;e=c[b>>2]|0;if(e|0){f=0.0;while(1){b=a[e>>0]|0;if(!(b<<24>>24))break;k=f+ +h[g+((b&255)<<3)>>3];h[j>>3]=k;e=e+1|0;f=k;}h[j>>3]=f*i;}return}function OO(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function PO(a){a=a|0;var b=0;b=a+108|0;c[b>>2]=0;c[a+112>>2]=32;c[a+116>>2]=-1;c[a+120>>2]=33;c[a+124>>2]=63;c[a+128>>2]=55;c[a+132>>2]=0;c[a+136>>2]=0;c[a+140>>2]=0;b=Vz(b,c[4581]|0)|0;c[a+144>>2]=b;return b|0}function QO(a,b,d){a=a|0;b=b|0;d=d|0;d=V1(1,32)|0;a=c[b>>2]|0;if(a|0)c[d>>2]=D4(a)|0;a=c[b+4>>2]|0;if(a|0)c[d+4>>2]=D4(a)|0;c[d+24>>2]=c[b+24>>2]&127;h[d+16>>3]=+h[b+16>>3];c[d+8>>2]=c[b+8>>2];return d|0}function RO(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b>>2]|0);U1(c[b+4>>2]|0);U1(b);return}function SO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0;a=c[b>>2]|0;e=c[d>>2]|0;i=(e|0)==0;if(!a)if(i)j=5;else a=-1;else if(!i){a=s2(a,e)|0;if(!a)j=5;}else a=1;do if((j|0)==5){a=c[b+4>>2]|0;e=c[d+4>>2]|0;i=(e|0)==0;if(!a){if(!i){a=-1;break}}else {if(i){a=1;break}a=s2(a,e)|0;if(a|0)break}a=(c[b+24>>2]&127)-(c[d+24>>2]&127)|0;if(!a){g=+h[b+16>>3];f=+h[d+16>>3];if(gf&1;}}while(0);return a|0}function TO(){eb(189244)|0;return}function UO(){var a=0,b=0;b=l;l=l+16|0;a=b;eb(a|0)|0;l=b;return +(+((c[a+4>>2]|0)+(c[a>>2]|0)-(c[47311]|0)-(c[47312]|0)|0)*.016666666666666666)}function VO(a){a=a|0;var b=0,d=0;b=JK(16)|0;a=(a|0)>2?a:2;d=JK(a<<2)|0;c[b>>2]=d;c[b+12>>2]=d;c[b+8>>2]=d;c[b+4>>2]=d+(a<<2);return b|0}function WO(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function XO(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+12|0;e=c[d>>2]|0;c[d>>2]=e+4;c[e>>2]=b;if((c[d>>2]|0)>>>0>=(c[a+4>>2]|0)>>>0)c[d>>2]=c[a>>2];return}function YO(a){a=a|0;var b=0,d=0,e=0;d=a+8|0;b=c[d>>2]|0;if((b|0)!=(c[a+12>>2]|0)){e=b+4|0;c[d>>2]=e;b=c[b>>2]|0;if(e>>>0>=(c[a+4>>2]|0)>>>0)c[d>>2]=c[a>>2];}else b=0;return b|0}function ZO(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=l;l=l+16|0;g=i;if(((d|0)!=0?(h=RA(b,d)|0,(h|0)!=0):0)?(a[h>>0]|0)!=0:0){d=y4(h,g,10)|0;e=(h|0)==(c[g>>2]|0)?e:(d|0)<(f|0)?f:d;}l=i;return e|0}function _O(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,h=0,i=0,j=0.0;i=l;l=l+16|0;g=i;if(((b|0)!=0&(d|0)!=0?(h=RA(b,d)|0,(h|0)!=0):0)?(a[h>>0]|0)!=0:0){j=+s5(h,g);e=(h|0)==(c[g>>2]|0)?e:j0.0)){b=+_O(a,GA(a,0,107638,0)|0,-1.0,0.0);b=b==0.0?72.0:b;}return +b}function aP(a,b,c){a=a|0;b=b|0;c=c|0;if((a|0)!=0&(b|0)!=0)c=RA(a,b)|0;return c|0}function bP(b,c,d){b=b|0;c=c|0;d=d|0;b=aP(b,c,d)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0)d=b;return d|0}function cP(a,b,c){a=a|0;b=b|0;c=c|0;if(!b)a=c&255;else a=dP(RA(a,b)|0)|0;return a|0}function dP(a){a=a|0;return eP(a,0)|0}function eP(b,c){b=b|0;c=c|0;var d=0;if((b|0)!=0?(d=a[b>>0]|0,d<<24>>24!=0):0)if((c3(b,137308)|0)!=0?(c3(b,107649)|0)!=0:0)if((c3(b,107652)|0)!=0?(c3(b,107657)|0)!=0:0){if(((d<<24>>24)+-48|0)>>>0<10)c=(q5(b)|0)&255;}else c=1;else c=0;return c|0}function fP(a){a=a|0;var b=0,d=0;while(1){b=(c[a+16>>2]|0)+220|0;d=c[b>>2]|0;if(!((d|0)!=(a|0)&(d|0)!=0))break;a=c[(c[d+16>>2]|0)+220>>2]|0;if(!a){a=d;continue}c[b>>2]=a;}return a|0}function gP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;if((a|0)!=(b|0)){d=c[a+16>>2]|0;e=d+220|0;if(!(c[e>>2]|0)){c[e>>2]=a;c[d+216>>2]=1;}else a=fP(a)|0;d=c[b+16>>2]|0;e=d+220|0;if(!(c[e>>2]|0)){c[e>>2]=b;c[d+216>>2]=1;}else {d=fP(b)|0;b=d;d=c[d+16>>2]|0;}g=a+16|0;e=c[g>>2]|0;f=b+16|0;h=(c[e+120>>2]|0)>(c[d+120>>2]|0);a=h?b:a;c[(h?e:d)+220>>2]=a;e=(c[(h?f:g)>>2]|0)+216|0;c[e>>2]=(c[e>>2]|0)+(c[(c[(h?g:f)>>2]|0)+216>>2]|0);}return a|0}function hP(b){b=b|0;b=c[b+16>>2]|0;c[b+216>>2]=1;c[b+220>>2]=0;a[b+159>>0]=0;return}function iP(a,b){a=a|0;b=b|0;if((fP(a)|0)==(a|0)){a=c[a+16>>2]|0;c[a+220>>2]=b;b=(c[b+16>>2]|0)+216|0;c[b>>2]=(c[b>>2]|0)+(c[a+216>>2]|0);return}else qa(107669,107661,194,107685);}function jP(a,b){a=a|0;b=b|0;var d=0.0;b=c[(c[b+16>>2]|0)+132>>2]|0;d=+h[b+8>>3]*72.0;h[a>>3]=+h[b>>3]*72.0;h[a+8>>3]=d;return}function kP(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0,p=0;o=l;l=l+576|0;n=o;i=0;while(1){if((i|0)>(d|0))break;k=n+(i<<4)|0;j=b+(i<<4)|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];i=i+1|0;}m=1.0-e;i=1;while(1){if((i|0)>(d|0))break;j=d-i|0;k=i+-1|0;b=0;while(1){if((b|0)>(j|0))break;p=b+1|0;h[n+(i*96|0)+(b<<4)>>3]=+h[n+(k*96|0)+(p<<4)>>3]*e+ +h[n+(k*96|0)+(b<<4)>>3]*m;h[n+(i*96|0)+(b<<4)+8>>3]=+h[n+(k*96|0)+(p<<4)+8>>3]*e+ +h[n+(k*96|0)+(b<<4)+8>>3]*m;b=p;}i=i+1|0;}a:do if(f|0){i=0;while(1){if((i|0)>(d|0))break a;p=f+(i<<4)|0;k=n+(i*96|0)|0;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];c[p+8>>2]=c[k+8>>2];c[p+12>>2]=c[k+12>>2];i=i+1|0;}}while(0);b:do if(g|0){i=0;while(1){if((i|0)>(d|0))break b;p=g+(i<<4)|0;f=n+((d-i|0)*96|0)+(i<<4)|0;c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];i=i+1|0;}}while(0);p=n+(d*96|0)|0;c[a>>2]=c[p>>2];c[a+4>>2]=c[p+4>>2];c[a+8>>2]=c[p+8>>2];c[a+12>>2]=c[p+12>>2];l=o;return}function lP(b){b=b|0;var d=0,e=0,f=0,g=0;e=0;do{d=c[47315]|0;f=d+1024|0;if((d-e|0)<1024){c[47315]=f;f=MK(c[47316]|0,f)|0;c[47316]=f;d=c[47315]|0;}else f=c[47316]|0;d=c4(f+e|0,d-e|0,b)|0;if(!d){g=6;break}e=(l2(d)|0)+e|0;d=c[47316]|0;}while((a[d+(e+-1)>>0]|0)!=10);if((g|0)==6)d=c[47316]|0;return ((e|0)>0?d:0)|0}function mP(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;do if((b|0)!=0?(a[b>>0]|0)!=0:0)if(!0){d=c[47133]|0;e=c[47318]|0;if((c[47317]|0)==(d|0))d=e;else {if(e){U1(c[e>>2]|0);U1(c[47318]|0);c[47318]=0;d=c[47133]|0;}c[47317]=d;if(!d)break;if(!(a[d>>0]|0))break;d=nP(d)|0;c[47318]=d;}if(!((a[b>>0]|0)!=47&(d|0)!=0))break;b=oP(d,c[47319]|0,b)|0;break}else ;else b=0;while(0);l=f;return b|0}function nP(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=0;f=0;g=0;b=D4(a)|0;d=0;while(1){b=A4(b,107984)|0;if(!b)break;a=(g<<2)+8|0;if(!f)a=KK(a)|0;else a=MK(d,a)|0;c[a+(g<<2)>>2]=b;f=l2(b)|0;e=e>>>0>f>>>0?e:f;f=a;g=g+1|0;b=0;d=a;}c[f+(g<<2)>>2]=0;c[47319]=e;return f|0}function oP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;e=g;h=c[47320]|0;c[47320]=W1(h,b+2+(l2(d)|0)|0)|0;while(1){b=c[a>>2]|0;if(!b){a=0;break}h=c[47320]|0;c[e>>2]=b;c[e+4>>2]=107982;c[e+8>>2]=d;m4(h,107975,e)|0;if(!(_4(c[47320]|0,4)|0)){f=4;break}else a=a+4|0;}if((f|0)==4)a=c[47320]|0;l=g;return a|0}function pP(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=(b|0)==0;f=0;while(1){h=c[d+(f<<2)>>2]|0;if(!h)break;if((!g?(a[b>>0]|0)==(a[h>>0]|0):0)?(s2(b,h)|0)==0:0)break;f=f+1|0;}return c[e+(f<<2)>>2]|0}function qP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0;z=l;l=l+80|0;x=z+16|0;y=z;u=c[b+4>>2]|0;v=c[b>>2]|0;w=d+8|0;f=0;e=-1;g=1.e+38;b=-1;while(1){if((f|0)>=(u|0))break;s=c[v+(f*48|0)>>2]|0;t=c[v+(f*48|0)+4>>2]|0;r=0;while(1){if((r|0)>=(t|0))break;q=+h[s+(r<<4)>>3]-+h[d>>3];p=+h[s+(r<<4)+8>>3]-+h[w>>3];q=p*p+q*q;A=(e|0)==-1|q>2]|0;e=e+(((e|0)==((c[v+(b*48|0)+4>>2]|0)+-1|0))<<31>>31)|0;e=e-((e|0)%3|0)|0;b=0;while(1){if((b|0)==4)break;C=b+e|0;h[x+(b<<4)>>3]=+h[f+(C<<4)>>3];h[x+(b<<4)+8>>3]=+h[f+(C<<4)+8>>3];b=b+1|0;}q=+h[d>>3];k=+h[x>>3]-q;o=+h[w>>3];p=+h[x+8>>3]-o;j=+h[x+48>>3]-q;n=+h[x+56>>3]-o;b=y+8|0;g=1.0;i=0.0;j=n*n+j*j;k=p*p+k*k;while(1){p=(g+i)*.5;kP(y,x,3,p,0,0);m=+h[y>>3];n=+h[b>>3];if(+B(+(k-j))<1.0)break;if(+B(+(g-i))<1.0e-05)break;C=k>3]=m;h[a+8>>3]=n;l=z;return}function rP(){return 0}function sP(b){b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;d=+_O(b,c[47146]|0,.75,.01);g=b+16|0;h[(c[g>>2]|0)+32>>3]=d;d=+_O(b,c[47145]|0,.5,.02);h[(c[g>>2]|0)+40>>3]=d;l=jN(bP(b,c[47147]|0,107986)|0,b)|0;c[(c[g>>2]|0)+8>>2]=l;l=RA(b,c[47154]|0)|0;d=+_O(b,c[47150]|0,14.0,1.0);e=bP(b,c[47151]|0,107994)|0;f=bP(b,c[47152]|0,137314)|0;i=(iD(l)|0)!=0;k=(WM(b)|0)==2;i=zK(b,l,(k?4:0)|(i?2:0),d,e,f)|0;c[(c[g>>2]|0)+104>>2]=i;i=c[47155]|0;if((i|0?(j=RA(b,i)|0,j|0):0)?a[j>>0]|0:0){l=(iD(j)|0)!=0;l=zK(b,j,l?2:0,d,e,f)|0;c[(c[g>>2]|0)+108>>2]=l;l=(c[(xC(b)|0)+16>>2]|0)+113|0;a[l>>0]=a[l>>0]|16;}k=(ZO(b,c[47158]|0,0,0)|0)&255;l=c[g>>2]|0;a[l+144>>0]=k;tb[c[c[(c[l+8>>2]|0)+4>>2]>>2]&127](b);return}function tP(b){b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+112|0;m=v+96|0;n=v+80|0;s=v+40|0;u=v;r=b+48|0;p=xC(c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0)|0;g=m+8|0;c[g>>2]=0;o=n+8|0;c[o>>2]=0;d=c[47182]|0;if(((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0){uP(b,m);t=(iD(e)|0)!=0;i=+h[m>>3];f=c[g>>2]|0;d=c[m+12>>2]|0;e=zK(b,e,t?2:0,i,f,d)|0;t=b+16|0;c[(c[t>>2]|0)+96>>2]=e;e=(c[p+16>>2]|0)+113|0;a[e>>0]=a[e>>0]|1;e=dP(aP(b,c[47192]|0,137308)|0)|0;a[(c[t>>2]|0)+114>>0]=e;t=1;e=f;}else {t=0;d=0;i=0.0;e=0;}f=c[47183]|0;if((f|0?(j=RA(b,f)|0,j|0):0)?a[j>>0]|0:0){if(!e){uP(b,m);i=+h[m>>3];e=c[g>>2]|0;d=c[m+12>>2]|0;}g=(iD(j)|0)!=0;j=zK(b,j,g?2:0,i,e,d)|0;c[(c[b+16>>2]|0)+108>>2]=j;j=(c[p+16>>2]|0)+113|0;a[j>>0]=a[j>>0]|32;}d=c[47197]|0;if(((d|0)!=0?(k=RA(b,d)|0,(k|0)!=0):0)?(a[k>>0]|0)!=0:0){vP(b,m,n);j=(iD(k)|0)!=0;i=+h[n>>3];d=c[o>>2]|0;e=c[n+12>>2]|0;k=zK(b,k,j?2:0,i,d,e)|0;c[(c[b+16>>2]|0)+100>>2]=k;k=(c[p+16>>2]|0)+113|0;a[k>>0]=a[k>>0]|2;}else {e=0;i=0.0;d=0;}f=c[47198]|0;if((f|0?(q=RA(b,f)|0,q|0):0)?a[q>>0]|0:0){if(!d){vP(b,m,n);e=c[n+12>>2]|0;i=+h[n>>3];d=c[o>>2]|0;}o=(iD(q)|0)!=0;q=zK(b,q,o?2:0,i,d,e)|0;c[(c[b+16>>2]|0)+104>>2]=q;q=(c[p+16>>2]|0)+113|0;a[q>>0]=a[q>>0]|4;}d=QA(b,111455)|0;d=d|0?d:195059;if(a[d>>0]|0)a[(c[(c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0)+16>>2]|0)+145>>0]=1;g=b+16|0;f=(c[g>>2]|0)+16|0;e=c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0;wP(s,c[(c[(c[(c[e+16>>2]|0)+8>>2]|0)+4>>2]|0)+8>>2]|0,e,d);d=s;e=f+40|0;do{c[f>>2]=c[d>>2];f=f+4|0;d=d+4|0;}while((f|0)<(e|0));if((xP(b,c[47204]|0)|0)<<24>>24)a[(c[g>>2]|0)+46>>0]=0;d=QA(b,111464)|0;d=d|0?d:195059;if(!(a[d>>0]|0))e=b+-48|0;else {e=b+-48|0;a[(c[(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)+16>>2]|0)+145>>0]=1;}f=(c[g>>2]|0)+56|0;e=c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0;wP(u,c[(c[(c[(c[e+16>>2]|0)+8>>2]|0)+4>>2]|0)+8>>2]|0,e,d);d=u;e=f+40|0;do{c[f>>2]=c[d>>2];f=f+4|0;d=d+4|0;}while((f|0)<(e|0));if((xP(b,c[47205]|0)|0)<<24>>24)a[(c[g>>2]|0)+86>>0]=0;l=v;return t|0}function uP(a,b){a=a|0;b=b|0;h[b>>3]=+_O(a,c[47179]|0,14.0,1.0);c[b+8>>2]=bP(a,c[47180]|0,107994)|0;c[b+12>>2]=bP(a,c[47181]|0,137314)|0;return}function vP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+8|0;if(!(c[e>>2]|0))uP(a,b);h[d>>3]=+_O(a,c[47199]|0,+h[b>>3],1.0);c[d+8>>2]=bP(a,c[47200]|0,c[e>>2]|0)|0;c[d+12>>2]=bP(a,c[47201]|0,c[b+12>>2]|0)|0;return}function wP(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+128|0;k=m+80|0;h=m+40|0;g=m;if((f|0)!=0?(j=R2(f,58)|0,(j|0)!=0):0){a[j>>0]=0;i=j+1|0;xb[d&31](h,e,f,i);e=k;g=h;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0));a[j>>0]=58;f=i;}else {xb[d&31](g,e,f,0);e=k;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0))}e=b;g=k;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0));c[b+36>>2]=f;l=m;return}function xP(b,c){b=b|0;c=c|0;var d=0;if(((c|0)!=0?(d=RA(b,c)|0,(d|0)!=0):0)?(a[d>>0]|0)!=0:0)b=(dP(d)|0)<<24>>24==0&1;else b=0;return b|0}function yP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;k=l;l=l+32|0;i=k;j=c[b+8>>2]|0;d=c[b+4>>2]|0;d=(c[b+44>>2]|0)+((O((d|0)>1?d+-1|0:0,j)|0)<<4)|0;e=i+16|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];f=i+8|0;g=i+24|0;b=1;while(1){if((b|0)>=(j|0))break;m=d+(b<<4)|0;o=+h[m>>3];h[i>>3]=+h[(+h[i>>3]>3];n=+h[m+8>>3];h[f>>3]=+h[(+h[f>>3]>3];h[e>>3]=+h[(+h[e>>3]>o?e:m)>>3];h[g>>3]=+h[(+h[g>>3]>n?e:m)+8>>3];b=b+1|0;}c[a>>2]=c[i>>2];c[a+4>>2]=c[i+4>>2];c[a+8>>2]=c[i+8>>2];c[a+12>>2]=c[i+12>>2];c[a+16>>2]=c[i+16>>2];c[a+20>>2]=c[i+20>>2];c[a+24>>2]=c[i+24>>2];c[a+28>>2]=c[i+28>>2];l=k;return}function zP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+64|0;g=d+32|0;e=d;f=c[a+16>>2]|0;a=f+16|0;f=c[f+116>>2]&1;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[g+16>>2]=c[a+16>>2];c[g+20>>2]=c[a+20>>2];c[g+24>>2]=c[a+24>>2];c[g+28>>2]=c[a+28>>2];AP(e,g,b,f);c[a>>2]=c[e>>2];c[a+4>>2]=c[e+4>>2];c[a+8>>2]=c[e+8>>2];c[a+12>>2]=c[e+12>>2];c[a+16>>2]=c[e+16>>2];c[a+20>>2]=c[e+20>>2];c[a+24>>2]=c[e+24>>2];c[a+28>>2]=c[e+28>>2];l=d;return}function AP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0.0;g=+h[d+56>>3];l=+h[d+64>>3];j=e<<24>>24==0;k=+h[d+24>>3];i=+h[d+32>>3];m=(j?k:i)*.5;f=g-m;g=m+g;if(f<+h[b>>3])h[b>>3]=f;e=b+16|0;if(g>+h[e>>3])h[e>>3]=g;g=(j?i:k)*.5;f=l-g;g=g+l;e=b+8|0;if(f<+h[e>>3])h[e>>3]=f;e=b+24|0;if(g>+h[e>>3])h[e>>3]=g;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];return}function BP(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0.0,O=0.0,P=0.0;L=l;l=l+448|0;H=L+416|0;t=L+384|0;u=L+304|0;K=L+256|0;G=L+192|0;B=L+144|0;C=L+96|0;d=L+400|0;e=L+368|0;f=L+352|0;g=L+336|0;v=L+288|0;w=L+224|0;x=L+160|0;y=L+112|0;z=L+64|0;A=L+32|0;I=L;J=b+16|0;if((tB(b)|0)==0?(c[(c[J>>2]|0)+180>>2]|0)==0:0){CP(d,0.0,0.0);c[K>>2]=c[d>>2];c[K+4>>2]=c[d+4>>2];c[K+8>>2]=c[d+8>>2];c[K+12>>2]=c[d+12>>2];K=K+16|0;CP(e,0.0,0.0);c[K>>2]=c[e>>2];c[K+4>>2]=c[e+4>>2];c[K+8>>2]=c[e+8>>2];c[K+12>>2]=c[e+12>>2];}else {CP(f,2147483647.0,2147483647.0);c[K>>2]=c[f>>2];c[K+4>>2]=c[f+4>>2];c[K+8>>2]=c[f+8>>2];c[K+12>>2]=c[f+12>>2];F=K+16|0;CP(g,-2147483647.0,-2147483647.0);c[F>>2]=c[g>>2];c[F+4>>2]=c[g+4>>2];c[F+8>>2]=c[g+8>>2];c[F+12>>2]=c[g+12>>2];o=C+8|0;p=u+16|0;D=K+8|0;q=u+8|0;E=K+24|0;r=u+24|0;s=B+8|0;n=jC(b)|0;while(1){if(!n)break;jP(B,n);d=n+16|0;m=c[d>>2]|0;h[C>>3]=(+h[m+96>>3]+ +h[m+88>>3])*.5;h[o>>3]=+h[m+80>>3]*.5;c[t>>2]=c[B>>2];c[t+4>>2]=c[B+4>>2];c[t+8>>2]=c[B+8>>2];c[t+12>>2]=c[B+12>>2];c[H>>2]=c[C>>2];c[H+4>>2]=c[C+4>>2];c[H+8>>2]=c[C+8>>2];c[H+12>>2]=c[C+12>>2];DP(u,t,H);c[t>>2]=c[B>>2];c[t+4>>2]=c[B+4>>2];c[t+8>>2]=c[B+8>>2];c[t+12>>2]=c[B+12>>2];c[H>>2]=c[C>>2];c[H+4>>2]=c[C+4>>2];c[H+8>>2]=c[C+8>>2];c[H+12>>2]=c[C+12>>2];EP(v,t,H);c[p>>2]=c[v>>2];c[p+4>>2]=c[v+4>>2];c[p+8>>2]=c[v+8>>2];c[p+12>>2]=c[v+12>>2];h[K>>3]=+h[(+h[K>>3]<+h[u>>3]?K:u)>>3];h[D>>3]=+h[(+h[D>>3]<+h[q>>3]?K:u)+8>>3];h[F>>3]=+h[(+h[F>>3]>+h[p>>3]?K:u)+16>>3];h[E>>3]=+h[(+h[E>>3]>+h[r>>3]?K:u)+24>>3];d=c[(c[d>>2]|0)+108>>2]|0;if(d|0?a[d+81>>0]|0:0){m=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(w,H,d,m);c[K>>2]=c[w>>2];c[K+4>>2]=c[w+4>>2];c[K+8>>2]=c[w+8>>2];c[K+12>>2]=c[w+12>>2];c[K+16>>2]=c[w+16>>2];c[K+20>>2]=c[w+20>>2];c[K+24>>2]=c[w+24>>2];c[K+28>>2]=c[w+28>>2];}m=XA(b,n)|0;while(1){if(!m)break;k=m+16|0;d=c[k>>2]|0;j=d+8|0;e=c[j>>2]|0;if(e|0){i=0;while(1){if((i|0)<(c[e+4>>2]|0))g=0;else break;while(1){f=c[e>>2]|0;if((g|0)>=(c[f+(i*48|0)+4>>2]|0))break;e=(c[f+(i*48|0)>>2]|0)+(g<<4)|0;c[B>>2]=c[e>>2];c[B+4>>2]=c[e+4>>2];c[B+8>>2]=c[e+8>>2];c[B+12>>2]=c[e+12>>2];N=+h[B>>3];h[K>>3]=+h[(+h[K>>3]>3];M=+h[s>>3];h[D>>3]=+h[(+h[D>>3]>3];h[F>>3]=+h[(+h[F>>3]>N?F:B)>>3];h[E>>3]=+h[(+h[E>>3]>M?F:B)+8>>3];g=g+1|0;e=c[j>>2]|0;}i=i+1|0;}e=c[d+96>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(x,H,e,d);c[K>>2]=c[x>>2];c[K+4>>2]=c[x+4>>2];c[K+8>>2]=c[x+8>>2];c[K+12>>2]=c[x+12>>2];c[K+16>>2]=c[x+16>>2];c[K+20>>2]=c[x+20>>2];c[K+24>>2]=c[x+24>>2];c[K+28>>2]=c[x+28>>2];d=c[k>>2]|0;}e=c[d+100>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(y,H,e,d);c[K>>2]=c[y>>2];c[K+4>>2]=c[y+4>>2];c[K+8>>2]=c[y+8>>2];c[K+12>>2]=c[y+12>>2];c[K+16>>2]=c[y+16>>2];c[K+20>>2]=c[y+20>>2];c[K+24>>2]=c[y+24>>2];c[K+28>>2]=c[y+28>>2];d=c[k>>2]|0;}e=c[d+104>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(z,H,e,d);c[K>>2]=c[z>>2];c[K+4>>2]=c[z+4>>2];c[K+8>>2]=c[z+8>>2];c[K+12>>2]=c[z+12>>2];c[K+16>>2]=c[z+16>>2];c[K+20>>2]=c[z+20>>2];c[K+24>>2]=c[z+24>>2];c[K+28>>2]=c[z+28>>2];d=c[k>>2]|0;}d=c[d+108>>2]|0;if(d|0?a[d+81>>0]|0:0){k=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(A,H,d,k);c[K>>2]=c[A>>2];c[K+4>>2]=c[A+4>>2];c[K+8>>2]=c[A+8>>2];c[K+12>>2]=c[A+12>>2];c[K+16>>2]=c[A+16>>2];c[K+20>>2]=c[A+20>>2];c[K+24>>2]=c[A+24>>2];c[K+28>>2]=c[A+28>>2];}}m=ZA(b,m)|0;}n=kC(b,n)|0;}d=c[J>>2]|0;f=c[d+180>>2]|0;g=d+184|0;i=G+8|0;j=G+16|0;k=G+24|0;e=1;while(1){if((e|0)>(f|0))break;P=+h[(c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0)+16>>3];h[G>>3]=P;C=c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0;O=+h[C+24>>3];h[i>>3]=O;M=+h[C+32>>3];h[j>>3]=M;N=+h[C+40>>3];h[k>>3]=N;h[K>>3]=+h[(+h[K>>3]>3];h[D>>3]=+h[(+h[D>>3]>3];h[F>>3]=+h[(+h[F>>3]>M?K:G)+16>>3];h[E>>3]=+h[(+h[E>>3]>N?K:G)+24>>3];e=e+1|0;}e=c[d+12>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[d+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(I,H,e,d);c[K>>2]=c[I>>2];c[K+4>>2]=c[I+4>>2];c[K+8>>2]=c[I+8>>2];c[K+12>>2]=c[I+12>>2];c[K+16>>2]=c[I+16>>2];c[K+20>>2]=c[I+20>>2];c[K+24>>2]=c[I+24>>2];c[K+28>>2]=c[I+28>>2];d=c[J>>2]|0;}J=d+16|0;c[J>>2]=c[K>>2];c[J+4>>2]=c[K+4>>2];c[J+8>>2]=c[K+8>>2];c[J+12>>2]=c[K+12>>2];c[J+16>>2]=c[K+16>>2];c[J+20>>2]=c[K+20>>2];c[J+24>>2]=c[K+24>>2];c[J+28>>2]=c[K+28>>2];}l=L;return}function CP(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function DP(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function EP(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function FP(a){a=a|0;if((c[a+60>>2]|0)==(a|0))a=1;else a=(j3(KB(a)|0,108006,7)|0)==0&1;return a|0}function GP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a:do if(!e)switch(IC(b)|0){case 0:{e=GA(a,0,c,195059)|0;break a}case 1:{e=GA(a,1,c,195059)|0;break a}case 2:{e=GA(a,2,c,195059)|0;break a}default:{e=0;break a}}while(0);KA(b,e,d)|0;return e|0}function HP(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+144|0;g=k;i=IP(d)|0;h=Vz(23592,c[4581]|0)|0;j=ND(d,108014,1)|0;TC(j,137483,280,1)|0;kA(g,128,k+16|0);e=jC(d)|0;while(1){if(!e)break;a:do if(!(a[(c[e+16>>2]|0)+118>>0]|0)){f=XA(d,e)|0;while(1){if(!f)break a;JP(f,j,g,h,i);f=ZA(d,f)|0;}}while(0);e=kC(d,e)|0;}oA(g);Rz(h)|0;f=tB(j)|0;e=jC(j)|0;while(1){if(!e)break;h=kC(j,e)|0;wC(d,e)|0;e=h;}sB(j)|0;if(f|0){j=(c[d+16>>2]|0)+136|0;b[j>>1]=b[j>>1]|1;}Rz(i)|0;l=k;return f|0}function IP(a){a=a|0;var b=0;b=Vz(23628,c[4581]|0)|0;SP(a,b);return b|0}function JP(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+48|0;q=t+32|0;p=t+24|0;s=t+16|0;r=t+8|0;k=t;n=c[b>>2]&3;m=c[((n|0)==3?b:b+48|0)+40>>2]|0;n=c[((n|0)==2?b:b+-48|0)+40>>2]|0;do if(!(a[(c[n+16>>2]|0)+118>>0]|0)){if(!(Q2(KB(m)|0,108006,7)|0))o=KP(g,KB(m)|0)|0;else o=0;if(!(Q2(KB(n)|0,108006,7)|0))i=KP(g,KB(n)|0)|0;else i=0;h=(o|0)!=0;j=(i|0)!=0;if(h|j){if((o|0)==(i|0)){r=KB(m)|0;s=KB(m)|0;c[k>>2]=r;c[k+4>>2]=s;gA(0,108029,k)|0;break}g=LP(f,b)|0;if(g|0){MP(b,c[g+16>>2]|0,c[g+20>>2]|0)|0;break}if(!j)if(!(HC(o,n)|0)){OP(f,m,n,MP(b,NP(m,o,e,d)|0,n)|0);break}else {r=KB(n)|0;s=KB(o)|0;c[q>>2]=r;c[q+4>>2]=s;gA(0,108184,q)|0;break}if(!h)if(!(HC(i,m)|0)){OP(f,m,n,MP(b,m,NP(n,i,e,d)|0)|0);break}else {r=KB(m)|0;s=KB(i)|0;c[p>>2]=r;c[p+4>>2]=s;gA(0,108147,p)|0;break}if(HC(i,o)|0){q=KB(o)|0;s=KB(i)|0;c[r>>2]=q;c[r+4>>2]=s;gA(0,108067,r)|0;break}if(!(HC(o,i)|0)){s=NP(m,o,e,d)|0;OP(f,m,n,MP(b,s,NP(n,i,e,d)|0)|0);break}else {q=KB(i)|0;r=KB(o)|0;c[s>>2]=q;c[s+4>>2]=r;gA(0,108107,s)|0;break}}}while(0);l=t;return}function KP(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b,512)|0;if(!a)a=0;else a=c[a+12>>2]|0;return a|0}function LP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=c[b>>2]&3;c[e>>2]=c[((f|0)==3?b:b+48|0)+40>>2];c[e+4>>2]=c[((f|0)==2?b:b+-48|0)+40>>2];b=nb[c[a>>2]&63](a,e,512)|0;l=d;return b|0}function MP(a,b,c){a=a|0;b=b|0;c=c|0;c=iB(xC(b)|0,b,c,0,1)|0;TC(c,137460,176,1)|0;UA(a,c)|0;return c|0}function NP(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+112|0;g=k;j=k+4|0;nA(e,108221)|0;i=c[47321]|0;c[47321]=i+1;c[g>>2]=i;m4(j,137395,g)|0;nA(e,j)|0;j=e+4|0;g=c[j>>2]|0;i=e+8|0;if(g>>>0>=(c[i>>2]|0)>>>0){lA(e,1)|0;g=c[j>>2]|0;}c[j>>2]=g+1;a[g>>0]=58;nA(e,KB(d)|0)|0;h=yC(d)|0;g=c[j>>2]|0;if(g>>>0>=(c[i>>2]|0)>>>0){lA(e,1)|0;g=c[j>>2]|0;}a[g>>0]=0;e=c[e>>2]|0;c[j>>2]=e;j=tC(h,e,1)|0;TC(j,137447,304,1)|0;a[(c[j+16>>2]|0)+118>>0]=1;oC(d,j,1)|0;oC(f,b,1)|0;f=xC(j)|0;c[47154]=GP(f,j,108224,195059,c[47154]|0)|0;f=xC(j)|0;c[47157]=GP(f,j,141082,134335,c[47157]|0)|0;f=xC(j)|0;c[47147]=GP(f,j,108230,108236,c[47147]|0)|0;l=k;return j|0}function OP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;f=l;l=l+32|0;g=f;n=g+8|0;c[n>>2]=b;m=g+12|0;c[m>>2]=d;o=c[e>>2]&3;i=e+48|0;j=g+16|0;c[j>>2]=c[((o|0)==3?e:i)+40>>2];k=e+-48|0;h=g+20|0;c[h>>2]=c[((o|0)==2?e:k)+40>>2];nb[c[a>>2]&63](a,g,1)|0;c[n>>2]=d;c[m>>2]=b;d=c[e>>2]&3;c[j>>2]=c[((d|0)==2?e:k)+40>>2];c[h>>2]=c[((d|0)==3?e:i)+40>>2];nb[c[a>>2]&63](a,g,1)|0;l=f;return}function PP(a,b,d){a=a|0;b=b|0;d=d|0;d=JK(24)|0;c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[d+16>>2]=c[b+16>>2];c[d+20>>2]=c[b+20>>2];return d|0}function QP(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function RP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if(a>>>0>=e>>>0)if(a>>>0>e>>>0)a=1;else {b=c[b+4>>2]|0;d=c[d+4>>2]|0;return (b>>>0>>0?-1:b>>>0>d>>>0&1)|0}else a=-1;return a|0}function SP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+16|0;g=h;f=a+16|0;e=1;while(1){a=c[f>>2]|0;if((e|0)>(c[a+180>>2]|0))break;a=c[(c[a+184>>2]|0)+(e<<2)>>2]|0;d=KB(a)|0;if(!(nb[c[b>>2]&63](b,d,512)|0)){i=JK(16)|0;c[i+8>>2]=d;c[i+12>>2]=a;nb[c[b>>2]&63](b,i,1)|0;}else {c[g>>2]=d;gA(0,108240,g)|0;}SP(a,b);e=e+1|0;}l=h;return}function TP(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function UP(a){a=a|0;var b=0,c=0,d=0;d=ND(a,108014,1)|0;TC(d,137483,280,1)|0;b=jC(a)|0;while(1){if(!b)break;c=XA(a,b)|0;while(1){if(!c)break;VP(c,d);c=ZA(a,c)|0;}b=kC(a,b)|0;}b=jC(d)|0;while(1){if(!b)break;c=kC(d,b)|0;WP(b);wC(a,b)|0;b=c;}sB(d)|0;return}function VP(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b>>2]&3;f=c[((e|0)==3?b:b+48|0)+40>>2]|0;e=c[((e|0)==2?b:b+-48|0)+40>>2]|0;if(!((a[(c[f+16>>2]|0)+118>>0]|0)==0?!(a[(c[e+16>>2]|0)+118>>0]|0):0)){f=XP(f,d)|0;e=MP(b,f,XP(e,d)|0)|0;f=c[b+16>>2]|0;d=f+8|0;e=c[e+16>>2]|0;c[e+8>>2]=c[d>>2];c[d>>2]=0;d=f+96|0;c[e+96>>2]=c[d>>2];c[d>>2]=0;d=f+108|0;c[e+108>>2]=c[d>>2];c[d>>2]=0;d=f+100|0;c[e+100>>2]=c[d>>2];c[d>>2]=0;f=f+104|0;c[e+104>>2]=c[f>>2];c[f>>2]=0;YP(b);}return}function WP(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;b=c[e>>2]|0;d=c[b+132>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+8>>2]|0;if(d){tb[c[(c[d+4>>2]|0)+4>>2]&127](a);b=c[e>>2]|0;}CK(c[b+104>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);VC(a,137447)|0;return}function XP(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=xC(b)|0;a:do if(a[(c[b+16>>2]|0)+118>>0]|0){oC(d,b,1)|0;b=R2(KB(b)|0,58)|0;if(!b)qa(111208,107661,1225,108292);d=b+1|0;b=tC(f,d,0)|0;if(!b){b=tC(f,d,1)|0;TC(b,137447,304,1)|0;d=LA(f,1,0)|0;while(1){if(!d)break a;g=RA(b,d)|0;e=c[d+12>>2]|0;if((g|0)!=(e|0))KA(b,d,e)|0;d=LA(f,1,d)|0;}}}while(0);return b|0}function YP(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+144>>2]|0);ZP(a);CK(c[(c[b>>2]|0)+96>>2]|0);CK(c[(c[b>>2]|0)+108>>2]|0);CK(c[(c[b>>2]|0)+100>>2]|0);CK(c[(c[b>>2]|0)+104>>2]|0);VC(a,137460)|0;return}function ZP(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;a=c[e>>2]|0;b=c[a+8>>2]|0;if(b){d=0;while(1){a=c[b>>2]|0;if((d|0)>=(c[b+4>>2]|0))break;U1(c[a+(d*48|0)>>2]|0);d=d+1|0;b=c[(c[e>>2]|0)+8>>2]|0;}U1(a);U1(c[(c[e>>2]|0)+8>>2]|0);a=c[e>>2]|0;}c[a+8>>2]=0;return}function _P(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=GA(a,b,c,0)|0;if(!e)e=GA(a,b,c,d)|0;return e|0}function $P(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+32|0;i=o;h=o+8|0;j=o+16|0;m=R2(b,59)|0;n=d+4|0;e=c[n>>2]|0;k=d+8|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;e=c[n>>2]|0;}c[n>>2]=e+1;a[e>>0]=38;if(((m|0)!=0?(f=m-b|0,(f+-2|0)>>>0<=6):0)?(i4(j,b,f)|0,a[j+f>>0]=0,c[h>>2]=j,g=u5(h,23664,252,8,96)|0,(g|0)!=0):0){c[i>>2]=c[g+4>>2];m4(j,137395,i)|0;b=c[n>>2]|0;if(b>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;b=c[n>>2]|0;}c[n>>2]=b+1;a[b>>0]=35;nA(d,j)|0;b=c[n>>2]|0;if(b>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;b=c[n>>2]|0;}c[n>>2]=b+1;a[b>>0]=59;b=m+1|0;}l=o;return b|0}function aQ(a,b){a=a|0;b=b|0;return s2(c[a>>2]|0,c[b>>2]|0)|0}function bQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+1072|0;k=q+8|0;j=q;i=q+16|0;o=q+24|0;c[i>>2]=b;if((c[47322]|0)!=(d|0)){c[47322]=d;a[194958]=0;}kA(o,1024,q+40|0);p=o+4|0;n=o+8|0;while(1){f=b+1|0;c[i>>2]=f;e=a[b>>0]|0;if(!(e<<24>>24))break;do if((e&255)<192)if(e<<24>>24==38){f=dQ(i)|0;if(!f)e=38;else {if(f>>>0<127){e=f&255;break}b=c[p>>2]|0;e=b>>>0>=(c[n>>2]|0)>>>0;if(f>>>0<2047){if(e){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>6|192;e=(f&63|128)&255;break}if(e){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>12|224;b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>6&63|128;e=(f&63|128)&255;}}else {h=0;m=9;}else if((e&255)>=224)if((e&255)>=240)if((e&255)<248){h=3;m=9;}else {if(!(a[194958]|0)){c[j>>2]=KB(d)|0;gA(0,109707,j)|0;a[194958]=1;}h=-1;e=cQ(e,o)|0;m=9;}else {h=2;m=9;}else {h=1;m=9;}while(0);do if((m|0)==9){m=0;g=0;while(1){if((g|0)>=(h|0)){m=34;break}if((a[f>>0]&-64)<<24>>24!=-128)break;b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=e;g=g+1|0;e=a[f>>0]|0;f=f+1|0;}if((m|0)==34){m=0;c[i>>2]=f;break}c[i>>2]=f;if(!(a[194958]|0)){g=KB(d)|0;c[k>>2]=h+1;c[k+4>>2]=g;gA(0,109828,k)|0;a[194958]=1;}e=cQ(e,o)|0;}while(0);b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=e;b=c[i>>2]|0;}b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}a[b>>0]=0;n=c[o>>2]|0;c[p>>2]=n;p=D4(n)|0;oA(o);l=q;return p|0}function cQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+16|0;g=j;a[g>>0]=b;a[g+1>>0]=0;g=eQ(g)|0;h=d+4|0;i=d+8|0;e=l2(g)|0;f=g;while(1){if((e|0)<=1)break;b=c[h>>2]|0;if(b>>>0>=(c[i>>2]|0)>>>0){lA(d,1)|0;b=c[h>>2]|0;}k=a[f>>0]|0;c[h>>2]=b+1;a[b>>0]=k;e=e+-1|0;f=f+1|0;}k=a[f>>0]|0;U1(g);l=j;return k|0}function dQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i;d=i+8|0;e=c[b>>2]|0;a:do if((a[e>>0]|0)!=35){c[h>>2]=d;g=0;b:while(1){if((g|0)>=8){d=0;break a}f=a[e+g>>0]|0;switch(f<<24>>24){case 0:{d=0;break a}case 59:break b;default:{}}a[d>>0]=f;d=d+1|0;g=g+1|0;}a[d>>0]=0;d=u5(h,23664,252,8,96)|0;if(!d)d=0;else {e=e+(g+1)|0;d=c[d+4>>2]|0;}}else {h=a[e+1>>0]|0;d=h&255;c:do if((h|32)<<24>>24==120){h=0;g=2;while(1){if((g|0)>=8){f=h;break c}f=a[e+g>>0]|0;d=f&255;if((f+-65&255)>=6)if((f+-97&255)>=6)if((f+-48&255)<10)f=-48;else {f=h;break c}else f=-87;else f=-55;d=f+d|0;h=d+(h<<4)|0;g=g+1|0;}}else {f=0;g=1;while(1){if((g|0)>=8)break c;h=a[e+g>>0]|0;d=h&255;if((h+-48&255)>=10)break c;f=(f*10|0)+-48+d|0;g=g+1|0;}}while(0);d=(d|0)==59;e=d?e+(g+1)|0:e;d=d?f:0;}while(0);c[b>>2]=e;l=i;return d|0}function eQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+1056|0;g=k;i=k+8|0;c[g>>2]=b;kA(i,1024,k+24|0);j=i+4|0;h=i+8|0;while(1){c[g>>2]=b+1;d=a[b>>0]|0;if(!(d<<24>>24))break;b=d&255;if(d<<24>>24==38){b=dQ(g)|0;if(!b){b=38;f=6;}else f=5;}else f=5;do if((f|0)==5){f=0;if(b>>>0<127)f=6;else {d=c[j>>2]|0;e=d>>>0>=(c[h>>2]|0)>>>0;if(b>>>0<2047){if(e){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>6|192;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}b=b&63|128;break}if(e){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>12|224;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>6&63|128;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}b=b&63|128;}}while(0);if((f|0)==6){d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}}c[j>>2]=d+1;a[d>>0]=b;b=c[g>>2]|0;}b=c[j>>2]|0;if(b>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;b=c[j>>2]|0;}a[b>>0]=0;h=c[i>>2]|0;c[j>>2]=h;j=D4(h)|0;oA(i);l=k;return j|0}function fQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+1040|0;g=i;kA(g,1024,i+16|0);h=g+4|0;f=g+8|0;while(1){d=b+1|0;e=a[b>>0]|0;if(!(e<<24>>24))break;if((e&255)<127){b=c[h>>2]|0;if(b>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;b=c[h>>2]|0;}c[h>>2]=b+1;a[b>>0]=e;b=d;continue}else {e=a[d>>0]&63|e<<6&255;d=c[h>>2]|0;if(d>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;d=c[h>>2]|0;}c[h>>2]=d+1;a[d>>0]=e;b=b+2|0;continue}}b=c[h>>2]|0;if(b>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;b=c[h>>2]|0;}a[b>>0]=0;f=c[g>>2]|0;c[h>>2]=f;h=D4(f)|0;oA(g);l=i;return h|0}function gQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+80|0;e=n+48|0;d=n+32|0;f=n+64|0;g=n+16|0;i=n;j=b+16|0;k=a+16|0;m=c[k>>2]|0;if(((+h[j>>3]>=+h[m+48>>3]?+h[m+64>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=+h[m+56>>3]:0)?+h[m+72>>3]>=+h[b+8>>3]:0){m=m+16|0;c[d>>2]=c[j>>2];c[d+4>>2]=c[j+4>>2];c[d+8>>2]=c[j+8>>2];c[d+12>>2]=c[j+12>>2];c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];hQ(g,d,e);c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];DP(i,d,e);c[f>>2]=a;c[f+4>>2]=0;d=c[(c[(c[(c[k>>2]|0)+8>>2]|0)+4>>2]|0)+12>>2]|0;c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];d=lb[d&127](f,e)|0;}else d=0;l=n;return d|0}function hQ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function iQ(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;e=l;l=l+80|0;j=e+64|0;k=e+48|0;m=e;n=e+32|0;g=e+16|0;h[m>>3]=+h[a+24>>3]*.5;h[m+8>>3]=+h[a+32>>3]*.5;a=a+56|0;c[k>>2]=c[a>>2];c[k+4>>2]=c[a+4>>2];c[k+8>>2]=c[a+8>>2];c[k+12>>2]=c[a+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];DP(n,k,j);i=+h[n>>3];f=+h[n+8>>3];c[k>>2]=c[a>>2];c[k+4>>2]=c[a+4>>2];c[k+8>>2]=c[a+8>>2];c[k+12>>2]=c[a+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];EP(g,k,j);d=+h[g+8>>3];if((+h[b+16>>3]>=i?+h[g>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=f:0)a=d>=+h[b+8>>3]&1;else a=0;l=e;return a|0}function jQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+80|0;k=n+48|0;j=n;h=a+16|0;a=c[h>>2]|0;i=c[a+8>>2]|0;a:do if((i|0)!=0?(g=i+8|0,c[j>>2]=c[g>>2],c[j+4>>2]=c[g+4>>2],c[j+8>>2]=c[g+8>>2],c[j+12>>2]=c[g+12>>2],c[j+16>>2]=c[g+16>>2],c[j+20>>2]=c[g+20>>2],c[j+24>>2]=c[g+24>>2],c[j+28>>2]=c[g+28>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(kQ(j,k)|0)!=0):0){d=i+4|0;a=0;while(1){if((a|0)>=(c[d>>2]|0))break;e=j;f=(c[i>>2]|0)+(a*48|0)|0;g=e+48|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[k+16>>2]=c[b+16>>2];c[k+20>>2]=c[b+20>>2];c[k+24>>2]=c[b+24>>2];c[k+28>>2]=c[b+28>>2];if(!((lQ(j,k)|0)<<24>>24))a=a+1|0;else {a=1;break a}}a=c[h>>2]|0;m=7;}else m=7;while(0);do if((m|0)==7){a=c[a+96>>2]|0;if(a|0?(c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(iQ(a,k)|0)<<24>>24):0){a=1;break}a=0;}while(0);l=n;return a|0}function kQ(a,b){a=a|0;b=b|0;if((+h[a+16>>3]>=+h[b>>3]?+h[b+16>>3]>=+h[a>>3]:0)?+h[a+24>>3]>=+h[b+8>>3]:0)a=+h[b+24>>3]>=+h[a+8>>3]&1;else a=0;return a|0}function lQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+96|0;k=n+64|0;j=n+48|0;i=n+32|0;f=n+16|0;g=n;m=a+4|0;d=c[m>>2]|0;if(!d)qa(109937,107661,1637,109945);e=c[a>>2]|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];e=1;while(1){if((e|0)>=(d|0)){h=7;break}d=(c[a>>2]|0)+(e<<4)|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[g>>2];c[j+4>>2]=c[g+4>>2];c[j+8>>2]=c[g+8>>2];c[j+12>>2]=c[g+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[k+16>>2]=c[b+16>>2];c[k+20>>2]=c[b+20>>2];c[k+24>>2]=c[b+24>>2];c[k+28>>2]=c[b+28>>2];if((iK(i,j,k)|0)!=-1){d=1;break};c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];e=e+1|0;d=c[m>>2]|0;}do if((h|0)==7){d=c[a+8>>2]|0;if(d|0?(g=a+16|0,h=c[a>>2]|0,c[i>>2]=c[g>>2],c[i+4>>2]=c[g+4>>2],c[i+8>>2]=c[g+8>>2],c[i+12>>2]=c[g+12>>2],c[j>>2]=c[h>>2],c[j+4>>2]=c[h+4>>2],c[j+8>>2]=c[h+8>>2],c[j+12>>2]=c[h+12>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(mQ(i,j,d,k)|0)<<24>>24):0){d=1;break}d=c[a+12>>2]|0;if(d|0?(h=a+32|0,m=(c[a>>2]|0)+((c[m>>2]|0)+-1<<4)|0,c[i>>2]=c[h>>2],c[i+4>>2]=c[h+4>>2],c[i+8>>2]=c[h+8>>2],c[i+12>>2]=c[h+12>>2],c[j>>2]=c[m>>2],c[j+4>>2]=c[m+4>>2],c[j+8>>2]=c[m+8>>2],c[j+12>>2]=c[m+12>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(mQ(i,j,d,k)|0)<<24>>24):0){d=1;break}d=0;}while(0);l=n;return d|0}function mQ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0;m=l;l=l+160|0;g=m+144|0;f=m+128|0;n=m+96|0;i=m+64|0;j=m+32|0;k=m;o=+h[e+16>>3];c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];YH(n,f,g,1.0,d);if(((o>=+h[n>>3]?(c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(i,f,g,1.0,d),+h[i+16>>3]>=+h[e>>3]):0)?(o=+h[e+24>>3],c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(j,f,g,1.0,d),o>=+h[j+8>>3]):0)?(c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(k,f,g,1.0,d),+h[k+24>>3]>=+h[e+8>>3]):0)f=1;else f=0;l=m;return f|0}function nQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;a:do if((b|0)!=0?(e=a[b>>0]|0,e<<24>>24!=0):0){do switch(e<<24>>24|0){case 48:{d=2;break a}case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:{d=10;break a}case 67:case 99:{e=b+1|0;if(!(c3(e,109960)|0)){d=4;break a}if(!(c3(e,109966)|0)){d=12;break a}break}case 70:case 102:{if(!(c3(b+1|0,109974)|0)){d=2;break a}break}case 76:case 108:{if(!(c3(b+1|0,109979)|0)){d=2;break a}break}case 78:case 110:{e=b+1|0;if(!(c3(e,109983)|0)){d=0;break a}if(!(c3(e,109987)|0)){d=2;break a}break}case 79:case 111:{if(!(c3(b+1|0,109989)|0)){d=8;break a}break}case 80:case 112:{if(!(c3(b+1|0,109994)|0)){d=6;break a}break}case 83:case 115:{if(!(c3(b+1|0,110002)|0)){d=10;break a}break}case 84:case 116:{if(!(c3(b+1|0,110008)|0)){d=10;break a}break}case 89:case 121:{if(!(c3(b+1|0,110012)|0)){d=10;break a}break}default:{}}while(0);c[f>>2]=b;gA(0,110015,f)|0;}while(0);l=g;return d|0}function oQ(d,f){d=d|0;f=f|0;var g=0;g=QA(d,110056)|0;if(g)if(!(a[g>>0]|0))f=0;else f=nQ(g,f)|0;d=(c[d+16>>2]|0)+136|0;b[d>>1]=f|e[d>>1];return}function pQ(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0;v=l;l=l+32|0;p=v+16|0;r=v;t=e&1;u=e&2;a:do if((c|0)==2){s=+h[a+16>>3];f=+h[a>>3];j=+h[a+24>>3];i=+h[a+8>>3];f=f-(s-f);h[p>>3]=f;h[r>>3]=s;i=i-(j-i);h[p+8>>3]=i;h[r+8>>3]=j;}else {g=+h[a>>3];h[r>>3]=g;h[p>>3]=g;j=+h[a+8>>3];m=r+8|0;h[m>>3]=j;n=p+8|0;h[n>>3]=j;e=0;f=g;i=j;while(1){if((e|0)>=(c|0)){s=g;break a}w=a+(e<<4)|0;q=+h[w>>3];k=+h[(q>3];h[p>>3]=k;s=+h[a+(e<<4)+8>>3];o=+h[(s>3];h[n>>3]=o;q=+h[(q>g?w:r)>>3];h[r>>3]=q;s=+h[(s>j?w:r)+8>>3];h[m>>3]=s;e=e+1|0;f=k;i=o;g=q;j=s;}}while(0);g=(s-f)*.5;q=g+f;o=(j-i)*.5;k=o+i;if(!t){f=j-k;j=d;i=+F(+j);j=+E(+j);if(!u){g=i*f-k;f=-k-o*i;}else {f=i*f;g=k-f;f=f+k;}h[b+8>>3]=g;h[b+24>>3]=f;d=j*(s-q);h[b>>3]=q-d;h[b+16>>3]=d+q;}else {d=+C(+(o*o+g*g));h[b+8>>3]=u|0?k:-k;h[b>>3]=q;h[b+16>>3]=d*.25;h[b+24>>3]=d;}l=v;return}function qQ(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0;e=a+16|0;f=c[e>>2]|0;if(!(b<<24>>24)){d=+h[f+32>>3]*36.0;h[f+88>>3]=d;a=f+40|0;}else {d=+h[f+40>>3]*36.0;h[f+88>>3]=d;a=f+32|0;}h[f+96>>3]=d;h[(c[e>>2]|0)+80>>3]=+h[a>>3]*72.0;return} - function Tl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;j=n+8|0;f=n+4|0;g=n;d=c[b>>2]&3;e=c[((d|0)==3?b:b+48|0)+40>>2]|0;k=(c[(c[e+16>>2]|0)+232>>2]|0)+-1|0;a=c[(c[a+16>>2]|0)+196>>2]|0;h=c[a+(k<<6)+4>>2]|0;a=c[a+(k<<6)>>2]|0;k=j+8|0;c[k>>2]=-1;c[j>>2]=-1;m=j+12|0;c[m>>2]=a;i=j+4|0;c[i>>2]=a;Vl(e,c[((d|0)==2?b:b+-48|0)+40>>2]|0,f,g);f=c[f>>2]|0;g=c[g>>2]|0;d=0;e=a;b=-1;while(1){if((d|0)>=(e|0))break;e=e+-1|0;Wl(c[h+(d<<2)>>2]|0,j,f,g);if((d|0)!=(e|0))Wl(c[h+(e<<2)>>2]|0,j,f,g);a=c[i>>2]|0;b=c[j>>2]|0;if((a-b|0)<2)break;else d=d+1|0;}if((b|0)>(a|0))a=(c[m>>2]|0)+(c[k>>2]|0)|0;else a=a+b|0;l=n;return (a+1|0)/2|0|0}function Ul(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=a+16|0;f=c[(c[g>>2]|0)+196>>2]|0;e=f+(b<<6)|0;f=c[f+(b<<6)+4>>2]|0;if(!f)f=KK((c[e>>2]<<2)+8|0)|0;else f=MK(f,(c[e>>2]<<2)+8|0)|0;e=c[(c[g>>2]|0)+196>>2]|0;c[e+(b<<6)+4>>2]=f;e=c[e+(b<<6)>>2]|0;while(1){if((e|0)<=(d|0))break;h=e+-1|0;i=c[f+(h<<2)>>2]|0;c[f+(e<<2)>>2]=i;i=(c[i+16>>2]|0)+236|0;c[i>>2]=(c[i>>2]|0)+1;e=h;}h=sh(a)|0;i=f+(d<<2)|0;c[i>>2]=h;h=c[h+16>>2]|0;c[h+236>>2]=d;c[h+232>>2]=b;g=(c[(c[g>>2]|0)+196>>2]|0)+(b<<6)|0;h=(c[g>>2]|0)+1|0;c[g>>2]=h;c[f+(h<<2)>>2]=0;return c[i>>2]|0}function Vl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a=c[(c[a+16>>2]|0)+236>>2]|0;b=c[(c[b+16>>2]|0)+236>>2]|0;f=(a|0)>(b|0);c[d>>2]=f?b:a;c[e>>2]=f?a:b;return}function Wl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;h=m+4|0;g=m;b=c[b+16>>2]|0;do if((a[b+156>>0]|0)==1){k=c[b+236>>2]|0;if(c[b+176>>2]|0){i=c[b+180>>2]|0;b=0;g=0;h=0;while(1){j=c[i+(h<<2)>>2]|0;if(!j)break;n=c[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;j=(n|0)>(e|0);b=j?((n|0)<(f|0)?b:1):b;g=j?g:1;h=h+1|0;}if(g<<24>>24!=0&b<<24>>24==0){c[d>>2]=k+1;break}if(!(g<<24>>24==0&b<<24>>24!=0))break;c[d+4>>2]=k+-1;break}if((c[b+184>>2]|0)!=2)qa(88397,88417,63,88424);i=c[b+180>>2]|0;n=c[i>>2]|0;i=c[i+4>>2]|0;Vl(c[((c[n>>2]&3|0)==2?n:n+-48|0)+40>>2]|0,c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0,h,g);i=c[g>>2]|0;if((i|0)<=(e|0)){c[d>>2]=k;c[d+8>>2]=k;break}b=c[h>>2]|0;if((b|0)>=(f|0)){c[d+4>>2]=k;c[d+12>>2]=k;break}g=(b|0)<(e|0);h=(i|0)>(f|0);if(!(h&g)){if(!(!g?!((i|0)<(f|0)&(b|0)==(e|0)):0))c[d+8>>2]=k;if(!h?!((i|0)==(f|0)&(b|0)>(e|0)):0)break;c[d+12>>2]=k;}}while(0);l=m;return}function Xl(a){a=a|0;c[47134]=1;pm(a);c[47134]=0;return}function Yl(a){a=a|0;c[47134]=2;pm(a);c[47134]=0;return}function Zl(a){a=a|0;var b=0;TC(a,137447,304,1)|0;sP(a);b=JK((e[(c[(xC(a)|0)+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[a+16>>2]|0)+132>>2]=b;qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);return}function _l(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0;s=l;l=l+64|0;j=s+48|0;o=s+40|0;k=s+24|0;i=s+8|0;q=s+56|0;m=s;do if((b|0)!=0?(r=e+16|0,p=c[(c[r>>2]|0)+132>>2]|0,g=RA(e,b)|0,(a[g>>0]|0)!=0):0){a[q>>0]=0;b=p+8|0;if((c[47137]|0)>2?(c[i>>2]=p,c[i+4>>2]=b,c[i+8>>2]=p+16,c[i+12>>2]=q,(b5(g,88535,i)|0)>2):0){a[(c[r>>2]|0)+119>>0]=1;g=c[47137]|0;a:do if(+h[23293]>0.0){b=0;while(1){if((b|0)>=(g|0))break a;o=p+(b<<3)|0;h[o>>3]=+h[o>>3]/+h[23293];b=b+1|0;}}while(0);if((g|0)>3)Fn(e,f,3);if((a[q>>0]|0)!=33){if(!d){b=1;break}if(!((dP(RA(e,d)|0)|0)<<24>>24)){b=1;break}}a[(c[r>>2]|0)+119>>0]=3;b=1;break}c[k>>2]=p;c[k+4>>2]=b;c[k+8>>2]=q;if((b5(g,101749,k)|0)<=1){c[j>>2]=KB(e)|0;c[j+4>>2]=g;gA(1,88549,j)|0;b=0;break}a[(c[r>>2]|0)+119>>0]=1;g=c[47137]|0;b:do if(+h[23293]>0.0){b=0;while(1){if((b|0)>=(g|0))break b;k=p+(b<<3)|0;h[k>>3]=+h[k>>3]/+h[23293];b=b+1|0;}}while(0);do if((g|0)>2){b=c[47171]|0;if((b|0?(n=RA(e,b)|0,n|0):0)?(c[o>>2]=m,(b5(n,101209,o)|0)==1):0){u=+h[23293];t=+h[m>>3];h[p+16>>3]=u>0.0?t/u:t;Fn(e,f,3);break}Gn(e,f);}while(0);if((a[q>>0]|0)!=33){if(!d){b=1;break}if(!((dP(RA(e,d)|0)|0)<<24>>24)){b=1;break}}a[(c[r>>2]|0)+119>>0]=3;b=1;}else b=0;while(0);l=s;return b|0}function $l(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}am(a);return}function am(a){a=a|0;if((c[47134]|0)!=0|(c[46795]|0)<0)Dn(a);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function bm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;m=q+32|0;o=q;k=GA(b,0,102637,0)|0;e=GA(b,0,102671,0)|0;p=(eP(QA(b,88593)|0,0)|0)<<24>>24!=0;if(!e)e=GA(b,0,102671,195059)|0;Cn(b)|0;n=b+16|0;i=0;while(1){j=c[(c[(c[n>>2]|0)+152>>2]|0)+(i<<2)>>2]|0;if(!j){f=12;break}g=j+16|0;f=c[g>>2]|0;if(!(a[f+119>>0]|0)){if(Q2(KB(j)|0,108006,7)|0){f=8;break}f=c[g>>2]|0;}f=c[f+108>>2]|0;if(f|0)cm(j,f,102633);i=i+1|0;}a:do if((f|0)==8){p=KB(j)|0;e=KB(b)|0;c[m>>2]=p;c[m+4>>2]=e;gA(1,88605,m)|0;e=-1;}else if((f|0)==12){dm(b,k,e);j=em(b)|0;e=c[(c[n>>2]|0)+8>>2]|0;if(!(c[e+88>>2]|0))e=0;else {c[e+84>>2]=0;e=1;}g=(d|0)!=0;i=(e|0)!=0;if(!(i|g&(c[47134]|0)==1^1)?(or(b)|0)!=0:0){f=c[(c[n>>2]|0)+12>>2]|0;if(!f)f=1;else {a[f+81>>0]=0;f=1;}}else f=0;BP(b);if(i){d=(c[n>>2]|0)+16|0;nI(o,b);c[d>>2]=c[o>>2];c[d+4>>2]=c[o+4>>2];c[d+8>>2]=c[o+8>>2];c[d+12>>2]=c[o+12>>2];c[d+16>>2]=c[o+16>>2];c[d+20>>2]=c[o+20>>2];c[d+24>>2]=c[o+24>>2];c[d+28>>2]=c[o+28>>2];}if(!g){c[47138]=1;f=jC(b)|0;while(1){if(!f)break a;p=c[f+16>>2]|0;o=c[p+132>>2]|0;h[p+16>>3]=+h[o>>3]*72.0;h[p+24>>3]=+h[o+8>>3]*72.0;f=kC(b,f)|0;}}do if(!(p|i)){p=c[n>>2]|0;if(!(+h[p+16>>3]!=0.0)?!(+h[p+24>>3]!=0.0):0)break;an(b);}while(0);if(!((j|0)!=0&(f|(_m(b)|0)<<24>>24!=0))){if((j|0)==2){c[47138]=1;break}}else fm(b);Zm(b,0);}while(0);l=q;return e|0}function cm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0;k=l;l=l+48|0;j=k+32|0;f=k+24|0;g=k+16|0;i=k;b=QA(b,e)|0;if(b|0?(c[j>>2]=f,c[j+4>>2]=g,(b5(b,105503,j)|0)==2):0){j=d+56|0;im(i,+h[f>>3],+h[g>>3]);c[j>>2]=c[i>>2];c[j+4>>2]=c[i+4>>2];c[j+8>>2]=c[i+8>>2];c[j+12>>2]=c[i+12>>2];a[d+81>>0]=1;}l=k;return}function dm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+32|0;f=m+24|0;g=m+16|0;i=m;j=b+16|0;if((d|0?(c[(c[j>>2]|0)+12>>2]|0)!=0:0)?(n=RA(b,d)|0,c[k>>2]=f,c[k+4>>2]=g,(b5(n,105503,k)|0)==2):0){n=(c[(c[j>>2]|0)+12>>2]|0)+56|0;im(i,+h[f>>3],+h[g>>3]);c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];a[(c[(c[j>>2]|0)+12>>2]|0)+81>>0]=1;}a:do if(e|0){f=OD(b)|0;while(1){if(!f)break a;jm(f,b,d,e);f=PD(f)|0;}}while(0);l=m;return}function em(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(uB(a)|0){f=GA(a,2,102623,0)|0;if(!((f|0)==0|(c[47134]|0)<2)){b=0;e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;g=b+((gm(f,d)|0)!=0&1)|0;d=ZA(a,d)|0;b=g;}e=kC(a,e)|0;}if(b){b=(b|0)==(uB(a)|0);b=b?2:1;}else b=0;}else b=0;}else b=2;return b|0}function fm(a){a=a|0;var b=0,d=0,e=0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;ZP(b);e=b+16|0;CK(c[(c[e>>2]|0)+96>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);CK(c[(c[e>>2]|0)+100>>2]|0);CK(c[(c[e>>2]|0)+104>>2]|0);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function gm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;B=l;l=l+96|0;z=B+72|0;x=B+56|0;A=B+48|0;y=B+32|0;w=B+16|0;r=B+88|0;s=B+8|0;t=B;u=B+84|0;v=B+80|0;b=RA(d,b)|0;do if(a[b>>0]|0){HH(d,u,v);q=1;f=0;e=0;j=0.0;i=0.0;k=0.0;g=0.0;a:while(1){c[w>>2]=s;c[w+4>>2]=t;c[w+8>>2]=r;if((b5(b,88642,w)|0)==2){p=1;b=b+(c[r>>2]|0)|0;i=+h[s>>3];g=+h[t>>3];}else p=e;c[y>>2]=s;c[y+4>>2]=t;c[y+8>>2]=r;if((b5(b,88654,y)|0)==2){o=1;b=b+(c[r>>2]|0)|0;j=+h[s>>3];k=+h[t>>3];}else o=f;m=hm(b)|0;if(!((m|0)>3&((m|0)%3|0|0)==1)){e=8;break}n=KK(m<<4)|0;e=n;f=m;while(1){if(!f)break;c[x>>2]=s;c[x+4>>2]=t;c[x+8>>2]=r;if((b5(b,88724,x)|0)<2){e=13;break a}C=b+(c[r>>2]|0)|0;h[e>>3]=+h[s>>3];h[e+8>>3]=+h[t>>3];e=e+16|0;f=f+-1|0;b=C;}while(1){e=a[b>>0]|0;f=b+1|0;if(!(S2(e<<24>>24)|0))break;else b=f;}C=e<<24>>24==0;b=C?b:f;q=C?0:q;f=cO(d,m)|0;if(p|0){c[f+8>>2]=c[u>>2];h[f+16>>3]=i;h[f+24>>3]=g;}if(o|0){c[f+12>>2]=c[v>>2];h[f+32>>3]=j;h[f+40>>3]=k;}e=0;while(1){if((e|0)>=(m|0))break;C=(c[f>>2]|0)+(e<<4)|0;D=n+(e<<4)|0;c[C>>2]=c[D>>2];c[C+4>>2]=c[D+4>>2];c[C+8>>2]=c[D+8>>2];c[C+12>>2]=c[D+12>>2];e=e+1|0;}U1(n);if(!q){e=26;break}else {f=o;e=p;}}if((e|0)==8){ZP(d);if(a[193771]|0){b=0;break}a[193771]=1;D=KB(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;b=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;c[A>>2]=D;c[A+4>>2]=b;gA(0,88667,A)|0;b=0;break}else if((e|0)==13){if(!(a[193771]|0)){a[193771]=1;C=KB(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;D=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;c[z>>2]=C;c[z+4>>2]=D;gA(0,88734,z)|0;}U1(n);ZP(d);b=0;break}else if((e|0)==26){f=d+16|0;b=c[f>>2]|0;e=c[b+96>>2]|0;if(e){cm(d,e,102637);b=c[f>>2]|0;}e=c[b+108>>2]|0;if(e){cm(d,e,102633);b=c[f>>2]|0;}e=c[b+100>>2]|0;if(e){cm(d,e,102640);b=c[f>>2]|0;}b=c[b+104>>2]|0;if(!b){b=1;break}cm(d,b,102648);b=1;break}}else b=0;while(0);l=B;return b|0}function hm(b){b=b|0;var c=0,d=0;d=0;do{while(1){c=a[b>>0]|0;if(!(S2(c&255)|0))break;else b=b+1|0;}a:do if(!(c<<24>>24))c=0;else {d=d+1|0;while(1){if(!(c<<24>>24)){c=0;break a}if(c<<24>>24==59|(S2(c&255)|0)!=0)break a;c=b+1|0;b=c;c=a[c>>0]|0;}}while(0)}while((S2(c&255)|0)!=0);return d|0}function im(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function jm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+32|0;f=h;if((Q2(KB(a)|0,108006,7)|0)==0?(km(a,e,f)|0)!=0:0){TC(a,137483,280,1)|0;i=(c[a+16>>2]|0)+16|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];lm(b,a);dm(a,d,e);}else g=4;a:do if((g|0)==4){a=OD(a)|0;while(1){if(!a)break a;jm(a,b,d,e);a=PD(a)|0;}}while(0);l=h;return}function km(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0;i=l;l=l+48|0;j=i+32|0;g=i;k=RA(a,b)|0;a=g+8|0;b=g+24|0;c[j>>2]=g;c[j+4>>2]=a;c[j+8>>2]=g+16;c[j+12>>2]=b;if((b5(k,88782,j)|0)==4){e=+h[a>>3];f=+h[b>>3];if(e>f){h[a>>3]=f;h[b>>3]=e;};c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[d+16>>2]=c[g+16>>2];c[d+20>>2]=c[g+20>>2];c[d+24>>2]=c[g+24>>2];c[d+28>>2]=c[g+28>>2];a=1;}else a=0;l=i;return a|0}function lm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+16|0;d=c[e>>2]|0;g=d+180|0;a=c[g>>2]|0;f=a+1|0;c[g>>2]=f;d=c[d+184>>2]|0;if(!d)a=JK((a<<2)+8|0)|0;else a=LK(d,a+2|0,4,f)|0;c[(c[e>>2]|0)+184>>2]=a;c[a+(f<<2)>>2]=b;uK(b);return}function mm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+48|0;m=n+8|0;k=n;i=n+16|0;j=n+12|0;h=QA(b,88798)|0;do if((h|0)!=0?(g=a[h>>0]|0,g<<24>>24!=0):0){g=g&255;if(!(b3(g)|0))if((e|0)==2|(g+-48|0)>>>0<10)e=h;else break;else {if(!(Q2(h,88804,4)|0)){e=0;break}if(!(Q2(h,105511,7)|0)){e=1;break}if(Q2(h,88809,6)|0)if((e|0)==2)e=h;else break;else e=h+6|0;}if(!(((d[e>>0]|0)+-48|0)>>>0<10?(c[k>>2]=j,(b5(e,99933,k)|0)>=1):0)){k=X4()|0;k=(db(0)|0)^k;c[j>>2]=k;c[m>>2]=k;m4(i,99933,m)|0;SA(b,88798,i)|0;}c[f>>2]=c[j>>2];e=2;}while(0);l=n;return e|0}function nm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f+4|0;c[e>>2]=1;d=mm(a,d,e)|0;if((d|0)!=2&(c[46796]|0)!=0)gA(0,88816,f)|0;if((d|0)==1)om(a,b);z5(c[e>>2]|0);l=f;return d|0}function om(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0.0;g=+(d|0);i=6.283185307179586/g;e=jC(b)|0;f=0.0;while(1){if(!e)break;l=+E(+f)*g;j=c[e+16>>2]|0;k=c[j+132>>2]|0;h[k>>3]=l;h[k+8>>3]=+F(+f)*g;a[j+119>>0]=1;if((c[47137]|0)>2)Gn(e,d);e=kC(b,e)|0;f=f+i;}return}function pm(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0;r=l;l=l+80|0;d=r+24|0;n=r+32|0;k=r;p=r+28|0;m=r+64|0;q=+h[23293];do if(c[47134]|0){h[23293]=72.0;qm(b);rm(b);if((bm(b,1)|0)<0){gA(3,88864,d)|0;break}else {cM(b,0);f=32;break}}else {o=eP(QA(b,88593)|0,0)|0;h[23293]=+$O(b);qm(b);g=sm(b)|0;Nq(b,k,0)|0;i=tm(b)|0;j=mH(b,0,n)|0;d=lH(b,-1,8)|0;c[46795]=d;e=(d|0)<0;do if(!j){if((g|0)!=0&e){c[46795]=8;c[n+16>>2]=2;f=11;break}c[n+16>>2]=2;if((d|0)<=-1){um(b,g,i);Qq(b,k)|0;rm(b);if(!(o<<24>>24)){fn(b);break}else {vm(b);break}}else f=11;}else if(e){c[46795]=8;f=11;}else f=11;while(0);if((f|0)==11){j=sG(b,p,88892,m)|0;d=c[p>>2]|0;do if((d|0)<=1){um(b,g,i);Qq(b,k)|0;if(!(o<<24>>24)){fn(b);break}else {vm(b);break}}else {f=o<<24>>24==0;e=0;while(1){if((e|0)>=(d|0))break;d=c[j+(e<<2)>>2]|0;KG(d)|0;um(d,g,i);Qq(d,k)|0;oQ(d,2);if(f)fn(d);else vm(d);e=e+1|0;d=c[p>>2]|0;}if(!(a[m>>0]|0))e=0;else {e=JK(d)|0;a[e>>0]=1;d=c[p>>2]|0;}c[n+8>>2]=c[46795];c[n+20>>2]=e;c[n+12>>2]=1;iH(d,j,b,n)|0;U1(e);}while(0);BP(b);rm(b);d=0;while(1){if((d|0)>=(c[p>>2]|0))break;n=c[j+(d<<2)>>2]|0;Dn(n);VC(n,137483)|0;wC(b,n)|0;d=d+1|0;}U1(j);}cM(b,o<<24>>24==0&1);f=32;}while(0);if((f|0)==32)h[23293]=q;l=r;return}function qm(a){a=a|0;var d=0,e=0,f=0,g=0;oQ(a,2);f=ZO(a,GA(a,0,91368,0)|0,2,2)|0;d=(ZO(a,GA(a,0,91374,0)|0,f,2)|0)&65535;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=d;d=c[(c[a+60>>2]|0)+16>>2]|0;g=d+176|0;e=b[g>>1]|0;e=(e&65535)<10?e:10;b[g>>1]=e;e=e&65535;c[47137]=e;b[d+178>>1]=(f|0)<(e|0)?f:e;Fm(a);return}function rm(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+1040|0;e=f;d=f+8|0;a:do if((c[47137]|0)>2&(c[47171]|0)!=0){b=jC(a)|0;while(1){if(!b)break a;h[e>>3]=+h[(c[(c[b+16>>2]|0)+132>>2]|0)+16>>3]*72.0;m4(d,101209,e)|0;KA(b,c[47171]|0,d)|0;b=kC(a,b)|0;}}while(0);l=f;return}function sm(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=QA(b,89577)|0;a:do if(!d)b=1;else {switch(a[d>>0]|0){case 0:{b=1;break a}case 75:{if(!(s2(d,89582)|0)){b=0;break a}break}case 109:{if(!(s2(d,89585)|0)){b=1;break a}break}case 104:{if(!(s2(d,89591)|0)){b=2;break a}break}default:{}}b=KB(b)|0;c[e>>2]=d;c[e+4>>2]=b;gA(0,89596,e)|0;b=1;}while(0);l=f;return b|0}function tm(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+32|0;g=h+16|0;f=h+8|0;e=h;d=QA(b,89360)|0;a:do if(!d)b=0;else {switch(a[d>>0]|0){case 0:{b=0;break a}case 99:{if(!(s2(d,89366)|0)){b=1;break a}break}case 115:{if(!(s2(d,89374)|0)){b=2;break a}if(!(s2(d,89381)|0)){b=0;break a}break}case 109:{if(!(s2(d,89391)|0)){if(GA(b,2,92493,0)|0){b=3;break a}c[e>>2]=KB(b)|0;gA(0,89395,e)|0;gA(3,89458,f)|0;b=0;break a}break}default:{}}b=KB(b)|0;c[g>>2]=d;c[g+4>>2]=b;gA(0,89515,g)|0;b=0;}while(0);l=h;return b|0}function um(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=QA(a,91061)|0;if(!e)if((b|0)==1)e=200;else e=(tB(a)|0)*100|0;else e=q5(e)|0;c[47136]=e;e=wn(a,b)|0;do if(!((e|0)<2|(c[47136]|0)<0))if(!b){xm(a,e,d);break}else {wm(a,e,b,d,c[47137]|0);break}while(0);return}function vm(a){a=a|0;BP(a);Zm(a,1);return}function wm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;r=u+40|0;o=u+24|0;n=u;p=u+48|0;t=u+44|0;q=(d|0)==2;i=nm(a,b,q?0:2)|0;j=Em(a)|0;k=j|4;s=KK(f<<2)|0;c[s>>2]=KK(O(b<<3,f)|0)|0;g=c[47137]|0;f=1;while(1){if((f|0)>=(g|0))break;c[s+(f<<2)>>2]=(c[s>>2]|0)+((O(f,b)|0)<<3);f=f+1|0;}g=(i|0)==0;f=g?k:j;if(0);n=Am(a,b,p,d,e,t)|0;if(0);if((d|0)!=1){m=+_O(a,GA(a,0,89279,0)|0,0.0,-1797693134862315708145274.0e284);if(q){f=Br(n,b,c[p>>2]|0,s,c[t>>2]|0,c[47137]|0,f,e,c[47136]|0,m)|0;g=12;}else g=14;}else {f=on(n,b,c[p>>2]|0,s,c[t>>2]|0,c[47137]|0,f,e,c[47136]|0)|0;g=12;}if((g|0)==12)if((f|0)<0)gA(3,89289,r)|0;else g=14;a:do if((g|0)==14){g=jC(a)|0;while(1){if(!g)break a;k=c[g+16>>2]|0;i=c[k+120>>2]|0;j=c[47137]|0;k=k+132|0;f=0;while(1){if((f|0)>=(j|0))break;h[(c[k>>2]|0)+(f<<3)>>3]=+h[(c[s+(f<<2)>>2]|0)+(i<<3)>>3];f=f+1|0;}g=kC(a,g)|0;}}while(0);as(n);U1(c[s>>2]|0);U1(s);U1(c[t>>2]|0);l=u;return}function xm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0;g=l;l=l+48|0;f=g+32|0;e=g;switch(d|0){case 2:{ym(a,b);break}case 1:{if(!(xr(a,b)|0)){c[e>>2]=KB(a)|0;gA(0,88902,e)|0;gA(3,93364,g+8|0)|0;gA(3,88954,g+16|0)|0;gA(3,89026,g+24|0)|0;Un(a,b);}break}default:{Un(a,b);if((d|0)==3)zm(a);}}In(a,b);Jn(a,b);if(0);Kn(a,b);l=g;return}function ym(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+16|0;g=Am(a,b,j,0,2,0)|0;i=ct(g,b)|0;e=a+16|0;a=0;while(1){if((a|0)>=(b|0))break;f=i+(a<<2)|0;d=0;while(1){if((d|0)==(b|0))break;h[(c[(c[(c[e>>2]|0)+160>>2]|0)+(a<<2)>>2]|0)+(d<<3)>>3]=+(c[(c[f>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}a=a+1|0;}U1(c[i>>2]|0);U1(i);as(g);l=j;return}function zm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0;f=a+16|0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;g=c[b>>2]&3;e=(c[c[((g|0)==3?b:b+48|0)+40>>2]>>2]|0)>>>4;g=(c[c[((g|0)==2?b:b+-48|0)+40>>2]>>2]|0)>>>4;if((e|0)!=(g|0)){j=+h[(c[b+16>>2]|0)+136>>3];i=c[(c[f>>2]|0)+160>>2]|0;h[(c[i+(g<<2)>>2]|0)+(e<<3)>>3]=j;h[(c[i+(e<<2)>>2]|0)+(g<<3)>>3]=j;}b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Am(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0;j=uB(a)|0;G=VL()|0;if((f|0)==2){k=0;D=0;}else {D=GA(a,2,92493,0)|0;k=(c[47174]|0)!=0&1;D=(D|0)!=0;}A=(e|1|0)==3;E=KK(b*20|0)|0;F=KK(b<<2)|0;l=(j<<1)+b<<2;m=KK(l)|0;z=A|D;if(z)f=KK(l)|0;else f=0;C=(k|0)!=0;if(C)j=KK(l)|0;else j=0;if(A)k=KK(l)|0;else k=0;l=0;x=jC(a)|0;y=0;while(1){if(!x)break;YL(G);if((c[(c[x+16>>2]|0)+120>>2]|0)!=(y|0)){B=12;break}c[F+(y<<2)>>2]=x;u=E+(y*20|0)+4|0;c[u>>2]=m;v=E+(y*20|0)+8|0;c[v>>2]=z?f:0;w=E+(y*20|0)+12|0;c[w>>2]=C?j:0;c[E+(y*20|0)+16>>2]=A?k:0;r=1;t=aB(a,x)|0;s=1;q=l;m=m+4|0;f=z?f+4|0:f;j=C?j+4|0:j;k=A?k+4|0:k;while(1){if(!t)break;n=c[t>>2]&3;p=t+-48|0;l=t+48|0;do if((c[((n|0)==2?t:p)+40>>2]|0)==(c[((n|0)==3?t:l)+40>>2]|0)){n=r;p=s;l=q;}else {n=Bm(G,t,r)|0;if((n|0)!=(r|0)){if(C){p=(c[w>>2]|0)+(n<<2)|0;g[p>>2]=+h[(c[t+16>>2]|0)+128>>3]+ +g[p>>2];}if(!D){n=r;p=s;l=q;break}n=(c[v>>2]|0)+(n<<2)|0;H=+h[(c[t+16>>2]|0)+136>>3];o=+(~~+g[n>>2]|0);g[n>>2]=H>o?H:o;n=r;p=s;l=q;break}I=c[t>>2]&3;l=(I|0)==3?t:l;q=q+1|0;n=r+1|0;r=m+4|0;c[m>>2]=c[(c[(c[((c[l+40>>2]|0)==(x|0)?((I|0)==2?t:p):l)+40>>2]|0)+16>>2]|0)+120>>2];if(C){g[j>>2]=+h[(c[t+16>>2]|0)+128>>3];j=j+4|0;}if(D){l=f+4|0;g[f>>2]=+h[(c[t+16>>2]|0)+136>>3];if(A){f=l;B=27;}else f=l;}else if(A){g[f>>2]=1.0;f=f+4|0;B=27;}if((B|0)==27){B=0;l=QA(t,101559)|0;if((l|0)!=0?(Q2(l,135709,4)|0)==0:0)o=0.0;else o=(x|0)==(c[((c[t>>2]&3|0)==2?t:p)+40>>2]|0)?1.0:-1.0;g[k>>2]=o;k=k+4|0;}p=s+1|0;l=q;m=r;}while(0);r=n;t=bB(a,t,x)|0;s=p;q=l;}c[E+(y*20|0)>>2]=s;c[c[u>>2]>>2]=y;l=q;x=kC(a,x)|0;y=y+1|0;}if((B|0)==12)qa(89103,89118,819,89130);if(A)Cm(E,b,e,F);n=(l|0)/2|0;a:do if((n|0)!=(uB(a)|0)){l=(n<<1)+b<<2;k=MK(c[E+4>>2]|0,l)|0;if(D)f=MK(c[E+8>>2]|0,l)|0;if(C){m=0;j=MK(c[E+12>>2]|0,l)|0;}else m=0;while(1){if((m|0)>=(b|0))break a;l=c[E+(m*20|0)>>2]|0;c[E+(m*20|0)+4>>2]=k;if(D){c[E+(m*20|0)+8>>2]=f;f=f+(l<<2)|0;}if(C){c[E+(m*20|0)+12>>2]=j;j=j+(l<<2)|0;}m=m+1|0;k=k+(l<<2)|0;}}while(0);c[d>>2]=n;if(!i)U1(F);else c[i>>2]=F;ZL(G);return E|0}function Bm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=c[b>>2]&3;e=c[(c[(c[((f|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+120>>2]|0;b=c[(c[(c[((f|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+120>>2]|0;f=(e|0)>(b|0);return _L(a,f?b:e,f?e:b,d)|0}function Cm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=0;while(1){if((g|0)>=(d|0)){g=0;break}h=c[(c[f+(g<<2)>>2]|0)+16>>2]|0;a[h+157>>0]=0;a[h+158>>0]=0;g=g+1|0;}while(1){if((g|0)>=(d|0))break;if(!(a[(c[(c[f+(g<<2)>>2]|0)+16>>2]|0)+157>>0]|0))Dm(b,g,e,f);g=g+1|0;}return}function Dm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0;q=(c[f+(d<<2)>>2]|0)+16|0;l=c[q>>2]|0;a[l+157>>0]=1;a[l+158>>0]=1;l=b+(d*20|0)|0;m=b+(d*20|0)+16|0;n=b+(d*20|0)+4|0;o=(e|0)==3?-1.0:1.0;k=1;a:while(1){if((k|0)>=(c[l>>2]|0)){h=14;break}h=(c[m>>2]|0)+(k<<2)|0;do if(!(+g[h>>2]==1.0)){p=c[(c[n>>2]|0)+(k<<2)>>2]|0;i=c[(c[f+(p<<2)>>2]|0)+16>>2]|0;if(!(a[i+158>>0]|0)){if(a[i+157>>0]|0)break;Dm(b,p,e,f);break}g[h>>2]=o;i=b+(p*20|0)+4|0;j=c[b+(p*20|0)>>2]|0;h=1;while(1){if((h|0)>=(j|0)){h=9;break a}if((c[(c[i>>2]|0)+(h<<2)>>2]|0)==(d|0))break;h=h+1|0;}g[(c[b+(p*20|0)+16>>2]|0)+(h<<2)>>2]=-1.0;}while(0);k=k+1|0;}if((h|0)==9)qa(89144,89118,721,89164);else if((h|0)==14){a[(c[q>>2]|0)+158>>0]=0;return}}function Em(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;a=ZO(a,GA(a,0,89305,0)|0,2,0)|0;if((a|0)==0|(a|0)>2){c[b>>2]=89305;gA(0,89314,b)|0;a=2;}l=d;return a|0}function Fm(a){a=a|0;var b=0,d=0,e=0;d=tB(a)|0;c[46796]=GA(a,1,102623,0)|0;e=GA(a,1,90660,0)|0;b=jC(a)|0;while(1){if(!b)break;Zl(b);_l(c[46796]|0,e,b,d)|0;b=kC(a,b)|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Gm(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Gm(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,1.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function Hm(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;a=JK(64)|0;e=a+8|0;f=d+8|0;g=e+48|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));d=c[d+56>>2]|0;c[a+56>>2]=d;b[(c[d+16>>2]|0)+168>>1]=1;return a|0}function Im(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Jm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if(a>>>0<=e>>>0)if(a>>>0>=e>>>0){e=c[b+24>>2]|0;a=c[d+24>>2]|0;if(e>>>0<=a>>>0)if(e>>>0>=a>>>0){a=~~(+h[b+8>>3]-+h[d+8>>3]);if(!a){a=~~(+h[b+16>>3]-+h[d+16>>3]);if(!a){a=~~(+h[b+32>>3]-+h[d+32>>3]);if(!a)a=~~(+h[b+40>>3]-+h[d+40>>3]);}}}else a=-1;else a=1;}else a=-1;else a=1;return a|0}function Km(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0.0;k=l;l=l+16|0;g=k;h=e+16|0;i=b[(c[h>>2]|0)+168>>1]|0;j=i<<16>>16;if(i<<16>>16!=1&(a[194954]|0)==0){i=KK(j<<2)|0;g=0;while(1){if((g|0)>=(j|0))break;c[i+(g<<2)>>2]=e;e=c[(c[e+16>>2]|0)+172>>2]|0;g=g+1|0;}m=+(f|0);lO(d,i,0,j,m,m,17792);e=0;while(1){if((e|0)>=(j|0))break;g=c[i+(e<<2)>>2]|0;h=g+16|0;if(c[(c[h>>2]|0)+96>>2]|0){f=xC(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)|0;zP(f,c[(c[h>>2]|0)+96>>2]|0);}sO(g);e=e+1|0;}U1(i);}else {c[g>>2]=e;m=+(f|0);lO(d,g,0,1,m,m,17792);if(c[(c[h>>2]|0)+96>>2]|0){j=xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0;zP(j,c[(c[h>>2]|0)+96>>2]|0);}sO(e);}l=k;return}function Lm(a){a=a|0;return 0}function Mm(a){a=a|0;return 0}function Nm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;Q=l;l=l+384|0;O=Q+368|0;P=Q+112|0;j=Q+32|0;r=Q+336|0;K=Q+320|0;L=Q+304|0;M=Q+288|0;N=Q+272|0;i=Q+256|0;H=Q+240|0;I=Q+224|0;J=Q+208|0;t=Q+192|0;u=Q+176|0;v=Q+160|0;z=Q+144|0;A=Q+128|0;B=Q+96|0;D=Q+16|0;G=Q;a:do switch(WM(b)|0){case 3:case 1:{f=JK(8)|0;z=b+16|0;b=c[z>>2]|0;i=c[b+12>>2]|0;do if(!(e<<24>>24)){b=c[i+8>>2]|0;if((b|0)>2){y=0.0;j=c[i+44>>2]|0;e=0;p=+g[d>>2];q=+g[d+4>>2];break}else {y=+B5()*.01;b=8;j=0;e=1;p=0.0;q=0.0;break}}else if(!(c[i+40>>2]&2048)){q=+h[b+88>>3];p=-q;y=+h[b+80>>3];x=y*-.5;h[j>>3]=p;h[j+8>>3]=x;h[j+16>>3]=q;h[j+24>>3]=x;y=y*.5;h[j+32>>3]=q;h[j+40>>3]=y;h[j+48>>3]=p;h[j+56>>3]=y;y=0.0;b=4;e=0;p=0.0;q=0.0;break}else {yP(r,i);p=+h[r>>3];x=+h[r+8>>3];q=+h[r+16>>3];y=+h[r+24>>3];h[j>>3]=p;h[j+8>>3]=x;h[j+16>>3]=q;h[j+24>>3]=x;h[j+32>>3]=q;h[j+40>>3]=y;h[j+48>>3]=p;h[j+56>>3]=y;y=0.0;b=4;e=0;p=0.0;q=0.0;break}while(0);c[f+4>>2]=b;r=JK(b<<4)|0;c[f>>2]=r;s=1.0/+(b|0);t=d+8|0;u=d+4|0;v=(b|0)==4;w=-p;x=-q;i=0;while(1){if((b|0)<=(i|0))break a;do if(e){k=+(i|0)*6.283185307179586*s+y;m=+E(+k);k=+F(+k);if(!(a[t>>0]|0)){P=c[z>>2]|0;n=k*+g[u>>2]*+h[P+80>>3];k=m*+g[d>>2]*(+h[P+96>>3]+ +h[P+88>>3]);}else {P=c[z>>2]|0;n=(+h[P+80>>3]+ +g[u>>2])*k;k=(+h[P+96>>3]+ +h[P+88>>3]+ +g[d>>2])*m;}o=k*.5;k=n*.5;}else {if(!(a[t>>0]|0)){o=+h[j+(i<<4)>>3]*p;k=+h[j+(i<<4)+8>>3]*q;break}if(!v){o=+h[j+(i<<4)>>3];k=+h[j+(i<<4)+8>>3];n=+C(+(k*k+o*o));o=(p/n+1.0)*o;k=(q/n+1.0)*k;break}switch(i|0){case 0:{m=q;k=p;break}case 1:{m=q;k=w;break}case 2:{m=x;k=w;break}case 3:{m=x;k=p;break}default:{m=0.0;k=0.0;}}o=+h[j+(i<<4)>>3]+k;k=+h[j+(i<<4)+8>>3]+m;}while(0);O=c[z>>2]|0;P=b-i+-1|0;h[r+(P<<4)>>3]=+h[O+16>>3]+o;h[r+(P<<4)+8>>3]=+h[O+24>>3]+k;i=i+1|0;}}case 2:{G=b+16|0;f=c[(c[G>>2]|0)+12>>2]|0;k=+h[f+16>>3];o=+h[f+24>>3];m=+h[f+32>>3];n=+h[f+40>>3];f=JK(8)|0;c[f+4>>2]=4;b=JK(64)|0;c[f>>2]=b;G=(c[G>>2]|0)+16|0;c[P>>2]=c[G>>2];c[P+4>>2]=c[G+4>>2];c[P+8>>2]=c[G+8>>2];c[P+12>>2]=c[G+12>>2];if(!(a[d+8>>0]|0)){c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(i,k,o,O,d);c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];N=(c[f>>2]|0)+16|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(H,k,n,O,d);c[N>>2]=c[H>>2];c[N+4>>2]=c[H+4>>2];c[N+8>>2]=c[H+8>>2];c[N+12>>2]=c[H+12>>2];N=(c[f>>2]|0)+32|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(I,m,n,O,d);c[N>>2]=c[I>>2];c[N+4>>2]=c[I+4>>2];c[N+8>>2]=c[I+8>>2];c[N+12>>2]=c[I+12>>2];N=(c[f>>2]|0)+48|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(J,m,o,O,d);c[N>>2]=c[J>>2];c[N+4>>2]=c[J+4>>2];c[N+8>>2]=c[J+8>>2];c[N+12>>2]=c[J+12>>2];break a}else {y=k-+g[d>>2];J=d+4|0;x=o-+g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(K,y,x,O);c[b>>2]=c[K>>2];c[b+4>>2]=c[K+4>>2];c[b+8>>2]=c[K+8>>2];c[b+12>>2]=c[K+12>>2];K=(c[f>>2]|0)+16|0;x=k-+g[d>>2];y=n+ +g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(L,x,y,O);c[K>>2]=c[L>>2];c[K+4>>2]=c[L+4>>2];c[K+8>>2]=c[L+8>>2];c[K+12>>2]=c[L+12>>2];L=(c[f>>2]|0)+32|0;y=m+ +g[d>>2];x=n+ +g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(M,y,x,O);c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];M=(c[f>>2]|0)+48|0;x=m+ +g[d>>2];y=o-+g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(N,x,y,O);c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];break a}}case 4:{b=b+16|0;f=JK(8)|0;c[f+4>>2]=4;i=JK(64)|0;c[f>>2]=i;j=c[b>>2]|0;N=j+16|0;c[P>>2]=c[N>>2];c[P+4>>2]=c[N+4>>2];c[P+8>>2]=c[N+8>>2];c[P+12>>2]=c[N+12>>2];k=-+h[j+88>>3];if(!(a[d+8>>0]|0)){x=-+h[j+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(A,k,x,O,d);c[i>>2]=c[A>>2];c[i+4>>2]=c[A+4>>2];c[i+8>>2]=c[A+8>>2];c[i+12>>2]=c[A+12>>2];N=(c[f>>2]|0)+16|0;M=c[b>>2]|0;x=-+h[M+88>>3];y=+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(B,x,y,O,d);c[N>>2]=c[B>>2];c[N+4>>2]=c[B+4>>2];c[N+8>>2]=c[B+8>>2];c[N+12>>2]=c[B+12>>2];N=(c[f>>2]|0)+32|0;M=c[b>>2]|0;y=+h[M+96>>3];x=+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(D,y,x,O,d);c[N>>2]=c[D>>2];c[N+4>>2]=c[D+4>>2];c[N+8>>2]=c[D+8>>2];c[N+12>>2]=c[D+12>>2];N=(c[f>>2]|0)+48|0;M=c[b>>2]|0;x=+h[M+96>>3];y=-+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(G,x,y,O,d);c[N>>2]=c[G>>2];c[N+4>>2]=c[G+4>>2];c[N+8>>2]=c[G+8>>2];c[N+12>>2]=c[G+12>>2];break a}else {y=k-+g[d>>2];M=d+4|0;x=-+h[j+80>>3]-+g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(t,y,x,O);c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];N=(c[f>>2]|0)+16|0;L=c[b>>2]|0;x=-+h[L+88>>3]-+g[d>>2];y=+h[L+80>>3]+ +g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(u,x,y,O);c[N>>2]=c[u>>2];c[N+4>>2]=c[u+4>>2];c[N+8>>2]=c[u+8>>2];c[N+12>>2]=c[u+12>>2];N=(c[f>>2]|0)+32|0;L=c[b>>2]|0;y=+h[L+96>>3]+ +g[d>>2];x=+h[L+80>>3]+ +g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(v,y,x,O);c[N>>2]=c[v>>2];c[N+4>>2]=c[v+4>>2];c[N+8>>2]=c[v+8>>2];c[N+12>>2]=c[v+12>>2];N=(c[f>>2]|0)+48|0;L=c[b>>2]|0;x=+h[L+96>>3]+ +g[d>>2];y=-+h[L+80>>3]-+g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(z,x,y,O);c[N>>2]=c[z>>2];c[N+4>>2]=c[z+4>>2];c[N+8>>2]=c[z+8>>2];c[N+12>>2]=c[z+12>>2];break a}}default:f=0;}while(0);l=Q;return f|0}function Om(a,b,c,d){a=a|0;b=+b;c=+c;d=d|0;c=+h[d+8>>3]+c;h[a>>3]=+h[d>>3]+b;h[a+8>>3]=c;return}function Pm(a,b,c,d,e){a=a|0;b=+b;c=+c;d=d|0;e=e|0;c=+g[e+4>>2]*c+ +h[d+8>>3];h[a>>3]=+g[e>>2]*b+ +h[d>>3];h[a+8>>3]=c;return}function Qm(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;o=l;l=l+112|0;j=o+88|0;i=o+72|0;k=o+32|0;m=o+16|0;n=o;f=o+56|0;g=o+40|0;h=b+48|0;r=(c[(c[((c[b>>2]&3|0)==3?b:h)+40>>2]|0)+16>>2]|0)+16|0;p=b+16|0;q=(c[p>>2]|0)+16|0;c[i>>2]=c[r>>2];c[i+4>>2]=c[r+4>>2];c[i+8>>2]=c[r+8>>2];c[i+12>>2]=c[r+12>>2];c[j>>2]=c[q>>2];c[j+4>>2]=c[q+4>>2];c[j+8>>2]=c[q+8>>2];c[j+12>>2]=c[q+12>>2];Rm(f,i,j);c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];f=b+-48|0;q=(c[(c[((c[b>>2]&3|0)==2?b:f)+40>>2]|0)+16>>2]|0)+16|0;p=(c[p>>2]|0)+56|0;c[i>>2]=c[q>>2];c[i+4>>2]=c[q+4>>2];c[i+8>>2]=c[q+8>>2];c[i+12>>2]=c[q+12>>2];c[j>>2]=c[p>>2];c[j+4>>2]=c[p+4>>2];c[j+8>>2]=c[p+8>>2];c[j+12>>2]=c[p+12>>2];Rm(g,i,j);c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];if(!e){g=-1111;f=-1111;}else {r=c[b>>2]&3;g=c[(c[(c[((r|0)==2?b:f)+40>>2]|0)+16>>2]|0)+288>>2]|0;f=c[(c[(c[((r|0)==3?b:h)+40>>2]|0)+16>>2]|0)+288>>2]|0;};c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];MX(d,i,f,j,g,k)|0;p=k;q=c[p+4>>2]|0;r=a;c[r>>2]=c[p>>2];c[r+4>>2]=q;l=o;return}function Rm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function Sm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;u=l;l=l+144|0;p=u+104|0;q=u+88|0;o=u+80|0;n=u+72|0;j=u+64|0;s=u+128|0;k=u+32|0;m=u+124|0;t=u+16|0;r=u;i=u+120|0;h=(c[b+16>>2]|0)+144|0;g=c[h>>2]|0;h=c[h+4>>2]|0;v=j;c[v>>2]=g;c[v+4>>2]=h;v=g;c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];h=g+(h+-1<<4)|0;c[r>>2]=c[h>>2];c[r+4>>2]=c[h+4>>2];c[r+8>>2]=c[h+8>>2];c[r+12>>2]=c[h+12>>2];a:do if(!(f<<24>>24)){g=-1111;f=-1111;}else {g=-1111;f=-1111;h=0;while(1){if((h|0)>=(e|0))break a;if((f|0)==-1111){f=c[d+(h<<2)>>2]|0;c[q>>2]=c[f>>2];c[q+4>>2]=c[f+4>>2];c[p>>2]=c[t>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[p+12>>2]=c[t+12>>2];f=(NX(q,p)|0)==0;f=f?-1111:h;}if((g|0)==-1111){g=c[d+(h<<2)>>2]|0;c[q>>2]=c[g>>2];c[q+4>>2]=c[g+4>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];g=(NX(q,p)|0)==0;g=g?-1111:h;}h=h+1|0;}}while(0);Tm(d,e,f,g,i,m);c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;h=c[i>>2]|0;v=c[m>>2]|0;c[p>>2]=c[j>>2];c[p+4>>2]=c[j+4>>2];if((OX(h,v,p,k,s)|0)<0){t=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;v=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[n>>2]=t;c[n+4>>2]=v;gA(1,89657,n)|0;}else {if(0>1);else {f=b+-48|0;g=b;}dO(b,c[((c[g>>2]&3|0)==2?b:f)+40>>2]|0,c[s>>2]|0,c[s+4>>2]|0,17792);U1(h);c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];yO(a,b,q,p);}l=u;return}function Tm(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=0;h=0;while(1){if((i|0)>=(b|0))break;if(!((i|0)==(d|0)|(i|0)==(e|0)))h=(c[(c[a+(i<<2)>>2]|0)+4>>2]|0)+h|0;i=i+1|0;}o=KK(h<<5)|0;i=0;n=0;while(1){if((n|0)>=(b|0))break;a:do if(!((n|0)==(d|0)|(n|0)==(e|0))){m=a+(n<<2)|0;l=0;while(1){j=c[m>>2]|0;k=c[j+4>>2]|0;if((l|0)>=(k|0))break a;p=l+1|0;q=o+(i<<5)|0;j=(c[j>>2]|0)+(l<<4)|0;c[q>>2]=c[j>>2];c[q+4>>2]=c[j+4>>2];c[q+8>>2]=c[j+8>>2];c[q+12>>2]=c[j+12>>2];j=o+(i<<5)+16|0;k=(c[c[m>>2]>>2]|0)+(((p|0)<(k|0)?p:0)<<4)|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];l=p;i=i+1|0;}}while(0);n=n+1|0;}if((i|0)==(h|0)){c[f>>2]=o;c[g>>2]=h;return}else qa(89719,89726,77,89741);}function Um(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+32|0;k=n+12|0;f=n;pr(f,a);c[k>>2]=c[f>>2];c[k+4>>2]=c[f+4>>2];c[k+8>>2]=c[f+8>>2];f=jC(a)|0;while(1){if(!f)break;g=XA(a,f)|0;while(1){if(!g)break;ZN(g);g=ZA(a,g)|0;}f=kC(a,f)|0;}h=Vz(17756,c[4581]|0)|0;f=jC(a)|0;while(1){if(!f)break;g=XA(a,f)|0;while(1){if(!g)break;if((c[47134]|0)>1?(i=c[g+16>>2]|0,(c[i+8>>2]|0)!=0):0){o=i+168|0;b[o>>1]=(b[o>>1]|0)+1<<16>>16;}else m=14;if((m|0)==14?(m=0,j=Vm(h,g)|0,(j|0)!=(g|0)):0){o=c[j+16>>2]|0;p=o+168|0;b[p>>1]=(b[p>>1]|0)+1<<16>>16;o=o+172|0;c[(c[g+16>>2]|0)+172>>2]=c[o>>2];c[o>>2]=g;}g=ZA(a,g)|0;}f=kC(a,f)|0;}Rz(h)|0;if(!(nb[d&63](a,k,e)|0)){c[47138]=1;f=0;}else f=1;l=n;return f|0}function Vm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0;q=l;l=l+64|0;p=q;e=c[b>>2]&3;i=c[((e|0)==3?b:b+48|0)+40>>2]|0;e=c[((e|0)==2?b:b+-48|0)+40>>2]|0;do if(i>>>0>=e>>>0){d=b+16|0;if(i>>>0>e>>>0){d=c[d>>2]|0;o=e;e=i;k=+h[d+16>>3];m=+h[d+24>>3];g=+h[d+56>>3];f=+h[d+64>>3];break}o=c[d>>2]|0;j=+h[o+56>>3];n=+h[o+64>>3];g=+h[o+16>>3];f=+h[o+24>>3];if(!(gj)){d=f>n;if(f>2]|0;o=i;k=+h[d+56>>3];m=+h[d+64>>3];g=+h[d+16>>3];f=+h[d+24>>3];}while(0);c[p+8>>2]=o;h[p+16>>3]=g;h[p+24>>3]=f;c[p+32>>2]=e;h[p+40>>3]=k;h[p+48>>3]=m;c[p+56>>2]=b;p=c[(nb[c[a>>2]&63](a,p,1)|0)+56>>2]|0;l=q;return p|0}function Wm(a,b){a=a|0;b=b|0;return Um(a,21,b)|0}function Xm(d,e,f){d=d|0;e=e|0;f=f|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0;F=l;l=l+112|0;B=F+88|0;A=F+72|0;t=F+40|0;q=F+8|0;p=F;u=F+64|0;C=F+48|0;D=F+24|0;i=(c[47134]|0)>1&1;do if((f|0)>5){s=JK((tB(d)|0)<<2)|0;o=(f|0)==8;n=o&1;m=jC(d)|0;r=0;while(1){if(!m)break;j=Nm(m,e,n)|0;k=(c[m+16>>2]|0)+288|0;if(!j){c[k>>2]=-1111;j=r;}else {c[k>>2]=r;c[s+(r<<2)>>2]=j;j=r+1|0;}m=kC(d,m)|0;r=j;}if(s){j=lt(s,r)|0;if(j|0){if(o){y=0;z=s;x=s;w=1;break}y=JX(s,r)|0;z=s;x=s;w=1;break}if(o){gA(0,89755,p)|0;j=0;y=0;z=s;x=s;w=1;break}else {G=+g[e+4>>2];h[q>>3]=+g[e>>2];h[q+8>>3]=G;gA(0,89833,q)|0;j=0;y=0;z=s;x=s;w=1;break}}else {j=0;y=0;z=0;x=0;w=0;}}else {j=0;y=0;z=0;r=0;x=0;w=0;}while(0);if(0);v=(y|0)!=0;a:do if(!v){if((f|0)==8&(j|0)!=0){rQ(d,0);i=1;}}else {k=jC(d)|0;while(1){if(!k)break a;j=XA(d,k)|0;while(1){if(!j)break;t=(c[j+16>>2]|0)+144|0;Qm(u,j,y,1,0,0);q=u;s=c[q+4>>2]|0;c[t>>2]=c[q>>2];c[t+4>>2]=s;j=ZA(d,j)|0;}k=kC(d,k)|0;}}while(0);p=(i|0)==0;q=d+60|0;s=(f|0)==10;i=0;o=jC(d)|0;j=0;while(1){if(!o)break;t=o+16|0;e=XA(d,o)|0;while(1){if(!e)break;n=c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0;k=e+16|0;m=c[k>>2]|0;if(!p?(c[m+8>>2]|0)!=0:0){H=(c[t>>2]|0)+16|0;u=m+16|0;c[A>>2]=c[H>>2];c[A+4>>2]=c[H+4>>2];c[A+8>>2]=c[H+8>>2];c[A+12>>2]=c[H+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];Rm(C,A,B);n=(c[n+16>>2]|0)+16|0;u=(c[k>>2]|0)+56|0;c[A>>2]=c[n>>2];c[A+4>>2]=c[n+4>>2];c[A+8>>2]=c[n+8>>2];c[A+12>>2]=c[n+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];Rm(D,A,B);c[A>>2]=c[C>>2];c[A+4>>2]=c[C+4>>2];c[A+8>>2]=c[C+8>>2];c[A+12>>2]=c[C+12>>2];c[B>>2]=c[D>>2];c[B+4>>2]=c[D+4>>2];c[B+8>>2]=c[D+8>>2];c[B+12>>2]=c[D+12>>2];yO(d,e,A,B);}else E=35;b:do if((E|0)==35){E=0;H=b[m+168>>1]|0;k=H<<16>>16;if(H<<16>>16){if((o|0)==(n|0)){if(!i){j=JK(96)|0;c[j+84>>2]=JK(((tB(d)|0)<<5)+11520|0)|0;i=j;}Km(i,e,c[(c[(c[q>>2]|0)+16>>2]|0)+248>>2]|0);break}if(!v){OM(d,e,f,17792);break}k=a[194954]|0?1:k;m=e;n=0;while(1){if((n|0)>=(k|0))break b;if(s)Sm(d,m,z,r,1);else Ym(d,m);m=c[(c[m+16>>2]|0)+172>>2]|0;n=n+1|0;}}}while(0);e=ZA(d,e)|0;}o=kC(d,o)|0;}if(v)LX(y);if(i|0){U1(c[i+84>>2]|0);U1(j);}if(w){i=0;while(1){if((i|0)>=(r|0))break;U1(c[z+(i<<2)>>2]|0);i=i+1|0;}U1(x);}l=F;return 0}function Ym(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;k=l;l=l+96|0;g=k+64|0;f=k+48|0;d=k+40|0;h=k+80|0;e=k+32|0;i=k+16|0;j=k;m=(c[b+16>>2]|0)+144|0;n=c[m>>2]|0;m=c[m+4>>2]|0;o=e;c[o>>2]=n;c[o+4>>2]=m;o=n;c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];m=n+(m+-1<<4)|0;c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];FY(g,h);if(0>1);else {d=b+-48|0;e=b;}dO(b,c[((c[e>>2]&3|0)==2?b:d)+40>>2]|0,c[h>>2]|0,c[h+4>>2]|0,17792);c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];yO(a,b,f,g);l=k;return}function Zm(a,d){a=a|0;d=d|0;var e=0;e=b[(c[a+16>>2]|0)+136>>1]&14;if(d<<24>>24)_m(a)|0;if(e<<16>>16)Wm(a,e&65535)|0;return}function _m(a){a=a|0;var b=0,d=0,e=0,f=0;d=$m(a)|0;b=jC(a)|0;while(1){if(!b)break;e=c[b+16>>2]|0;f=c[e+132>>2]|0;h[e+16>>3]=+h[f>>3]*72.0;h[e+24>>3]=+h[f+8>>3]*72.0;b=kC(a,b)|0;}return d|0}function $m(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0,i=0.0,j=0,k=0;a:do if((c[a+60>>2]|0)==(a|0)?(d=a+16|0,e=c[d>>2]|0,(c[(c[e+8>>2]|0)+84>>2]|0)!=0):0){if(!(+h[e+16>>3]!=0.0)?!(+h[e+24>>3]!=0.0):0)b=0;else {an(a);b=1;e=c[d>>2]|0;}j=(c[e+116>>2]&1|0)==0;if(!j){k=e+32|0;i=+h[k>>3];d=e+40|0;h[k>>3]=+h[d>>3];h[d>>3]=i;}d=c[e+8>>2]|0;b:do switch(c[d+84>>2]|0){case 2:{f=+h[d+64>>3];if(f<=0.0)break a;g=f/+h[e+32>>3];f=+h[d+72>>3]/+h[e+40>>3];if(g<1.0|f<1.0)if(g>3];if(f<=0.0)break a;g=f/+h[e+32>>3];f=+h[d+72>>3]/+h[e+40>>3];if(!(g>1.0&f>1.0))break a;f=g>3];f=+h[e+40>>3]/+h[e+32>>3];if(f1){d=jC(a)|0;while(1){if(!d)break c;b=XA(a,d)|0;while(1){if(!b)break;if(c[(c[b+16>>2]|0)+8>>2]|0)bn(b,f,g);b=ZA(a,b)|0;}d=kC(a,d)|0;}}while(0);b=jC(a)|0;while(1){if(!b)break;k=c[(c[b+16>>2]|0)+132>>2]|0;h[k>>3]=+h[k>>3]*f;k=k+8|0;h[k>>3]=+h[k>>3]*g;b=kC(a,b)|0;}cn(a,f,g);b=1;}else b=0;while(0);return b|0}function an(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;k=n+16|0;m=n;d=(c[b+16>>2]|0)+16|0;c[m>>2]=c[d>>2];c[m+4>>2]=c[d+4>>2];c[m+8>>2]=c[d+8>>2];c[m+12>>2]=c[d+12>>2];f=+h[m>>3];g=f*.013888888888888888;i=+h[m+8>>3];j=i*.013888888888888888;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;o=c[e+132>>2]|0;h[o>>3]=+h[o>>3]-g;o=o+8|0;h[o>>3]=+h[o>>3]-j;e=c[e+108>>2]|0;if(e|0?a[e+81>>0]|0:0){o=e+56|0;h[o>>3]=+h[o>>3]-f;o=e+64|0;h[o>>3]=+h[o>>3]-i;}d=kC(b,d)|0;}e=jC(b)|0;while(1){if(!e)break;d=XA(b,e)|0;while(1){if(!d)break;if(c[(c[d+16>>2]|0)+8>>2]|0){c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];dn(d,k);}d=ZA(b,d)|0;}e=kC(b,e)|0;}c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];en(b,k);l=n;return}function bn(b,d,e){b=b|0;d=+d;e=+e;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0;p=c[b>>2]&3;i=c[(c[(c[((p|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;s=(d+-1.0)*72.0;q=s*+h[i>>3];t=(e+-1.0)*72.0;r=t*+h[i+8>>3];p=c[(c[(c[((p|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;s=s*+h[p>>3];t=t*+h[p+8>>3];p=c[b+16>>2]|0;i=c[p+8>>2]|0;j=c[i+4>>2]|0;k=j+-1|0;b=0;i=c[i>>2]|0;while(1){if((b|0)>=(j|0))break;l=c[i+4>>2]|0;m=l+-1|0;n=(b|0)==(k|0);f=0;g=c[i>>2]|0;while(1){if((f|0)>=(l|0))break;do if(f|b){o=+h[g>>3];if((f|0)==(m|0)&n){h[g>>3]=o+q;u=g+8|0;h[u>>3]=+h[u>>3]+r;break}else {h[g>>3]=o*d;u=g+8|0;h[u>>3]=+h[u>>3]*e;break}}else {h[g>>3]=+h[g>>3]+s;u=g+8|0;h[u>>3]=+h[u>>3]+t;}while(0);f=f+1|0;g=g+16|0;}if(c[i+8>>2]|0){u=i+16|0;h[u>>3]=+h[u>>3]+s;u=i+24|0;h[u>>3]=+h[u>>3]+t;}if(c[i+12>>2]|0){u=i+32|0;h[u>>3]=+h[u>>3]+q;u=i+40|0;h[u>>3]=+h[u>>3]+r;}b=b+1|0;i=i+48|0;}b=c[p+96>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]*d;u=b+64|0;h[u>>3]=+h[u>>3]*e;}b=c[p+100>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]+q;u=b+64|0;h[u>>3]=+h[u>>3]+r;}b=c[p+104>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]+s;u=b+64|0;h[u>>3]=+h[u>>3]+t;}return}function cn(b,d,e){b=b|0;d=+d;e=+e;var f=0,g=0,i=0;i=b+16|0;g=c[i>>2]|0;b=g+32|0;h[b>>3]=+h[b>>3]*d;b=g+40|0;h[b>>3]=+h[b>>3]*e;b=g+16|0;h[b>>3]=+h[b>>3]*d;b=g+24|0;h[b>>3]=+h[b>>3]*e;b=c[g+12>>2]|0;if((b|0)!=0?(a[b+81>>0]|0)!=0:0){f=b+56|0;h[f>>3]=+h[f>>3]*d;f=b+64|0;h[f>>3]=+h[f>>3]*e;f=1;b=g;}else {f=1;b=g;}while(1){if((f|0)>(c[b+180>>2]|0))break;cn(c[(c[b+184>>2]|0)+(f<<2)>>2]|0,d,e);f=f+1|0;b=c[i>>2]|0;}return}function dn(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0;k=c[b+16>>2]|0;b=c[k+8>>2]|0;j=c[b+4>>2]|0;l=d+8|0;b=c[b>>2]|0;g=0;while(1){if((g|0)>=(j|0))break;i=c[b+4>>2]|0;e=c[b>>2]|0;f=0;while(1){if((f|0)>=(i|0))break;h[e>>3]=+h[e>>3]-+h[d>>3];m=e+8|0;h[m>>3]=+h[m>>3]-+h[l>>3];e=e+16|0;f=f+1|0;}if(c[b+8>>2]|0){m=b+16|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+24|0;h[m>>3]=+h[m>>3]-+h[l>>3];}if(c[b+12>>2]|0){m=b+32|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+40|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=b+48|0;g=g+1|0;}b=c[k+96>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+108>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+100>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+104>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}return}function en(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;j=k;g=+h[d>>3];i=b+16|0;b=c[i>>2]|0;e=b+32|0;h[e>>3]=+h[e>>3]-g;f=+h[d+8>>3];e=b+40|0;h[e>>3]=+h[e>>3]-f;e=b+16|0;h[e>>3]=+h[e>>3]-g;e=b+24|0;h[e>>3]=+h[e>>3]-f;e=c[b+12>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){m=e+56|0;h[m>>3]=+h[m>>3]-g;e=e+64|0;h[e>>3]=+h[e>>3]-f;e=1;}else e=1;while(1){if((e|0)>(c[b+180>>2]|0))break;m=c[(c[b+184>>2]|0)+(e<<2)>>2]|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];en(m,j);e=e+1|0;b=c[i>>2]|0;}l=k;return}function fn(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0,i=0,j=0;i=l;l=l+16|0;d=i;BP(a);e=a+16|0;b=c[e>>2]|0;f=+h[b+16>>3]*.013888888888888888;g=+h[b+24>>3]*.013888888888888888;b=jC(a)|0;while(1){if(!b)break;j=c[(c[b+16>>2]|0)+132>>2]|0;h[j>>3]=+h[j>>3]-f;j=j+8|0;h[j>>3]=+h[j>>3]-g;b=kC(a,b)|0;}j=(c[e>>2]|0)+16|0;c[d>>2]=c[j>>2];c[d+4>>2]=c[j+4>>2];c[d+8>>2]=c[j+8>>2];c[d+12>>2]=c[j+12>>2];gn(a,d);Zm(a,1);l=i;return}function gn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0.0;g=l;l=l+16|0;f=g;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[(c[e+184>>2]|0)+(a<<2)>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];gn(e,f);a=a+1|0;}j=+h[b>>3];f=e+32|0;h[f>>3]=+h[f>>3]-j;i=+h[b+8>>3];b=e+40|0;h[b>>3]=+h[b>>3]-i;b=e+16|0;h[b>>3]=+h[b>>3]-j;b=e+24|0;h[b>>3]=+h[b>>3]-i;l=g;return}function hn(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;p=(e|0)>2;n=0;o=0;j=c[f+4>>2]|0;b=c[f>>2]|0;while(1){if((o|0)>=(d|0)){b=0;break}i=c[(c[g+(o<<2)>>2]|0)+16>>2]|0;l=a[i+119>>0]|0;a:do if(!(l<<24>>24)){k=b+8|0;h[b>>3]=+B5();i=j+8|0;h[j>>3]=+B5();if(p){b=2;while(1){if((b|0)==(e|0)){j=n;b=k;break a}q=+B5();h[(c[f+(b<<2)>>2]|0)+(o<<3)>>3]=q;b=b+1|0;}}else {j=n;b=k;}}else {k=c[i+132>>2]|0;m=b+8|0;h[b>>3]=+h[k>>3];i=j+8|0;h[j>>3]=+h[k+8>>3];b:do if(p){j=2;b=k+16|0;while(1){if((j|0)==(e|0))break b;h[(c[f+(j<<2)>>2]|0)+(o<<3)>>3]=+h[b>>3];j=j+1|0;b=b+8|0;}}while(0);j=(l&255)>1?1:n;b=m;}while(0);n=j;o=o+1|0;j=i;}while(1){if((b|0)>=(e|0))break;Ht(d,c[f+(b<<2)>>2]|0);b=b+1|0;}return n|0}function jn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0;d=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;n=un(b,b,0.0)|0;o=un(b,b,0.0)|0;a:do if(!(c[a+8>>2]|0)){e=0;while(1){if((e|0)>=(b|0))break a;i=c[a+(e*20|0)>>2]|0;j=a+(e*20|0)+4|0;k=n+(e<<2)|0;f=1;while(1){if((f|0)>=(i|0))break;m=c[(c[j>>2]|0)+(f<<2)>>2]|0;h[(c[n+(m<<2)>>2]|0)+(e<<3)>>3]=-1.0;h[(c[k>>2]|0)+(m<<3)>>3]=-1.0;f=f+1|0;}e=e+1|0;}}else {e=0;while(1){if((e|0)>=(b|0))break a;i=c[a+(e*20|0)>>2]|0;j=a+(e*20|0)+4|0;k=a+(e*20|0)+8|0;m=n+(e<<2)|0;f=1;while(1){if((f|0)>=(i|0))break;p=c[(c[j>>2]|0)+(f<<2)>>2]|0;l=-1.0/+g[(c[k>>2]|0)+(f<<2)>>2];h[(c[n+(p<<2)>>2]|0)+(e<<3)>>3]=l;h[(c[m>>2]|0)+(p<<3)>>3]=l;f=f+1|0;}e=e+1|0;}}while(0);b:do if(!(wr(b,n,o)|0)){U1(d);d=0;}else {f=0;j=0;m=b;while(1){if((j|0)>=(b|0))break b;k=o+(j<<2)|0;e=j;i=f;while(1){if((e|0)==(b|0))break;if((j|0)==(e|0))l=0.0;else {p=c[k>>2]|0;l=+h[(c[o+(e<<2)>>2]|0)+(e<<3)>>3]+ +h[p+(j<<3)>>3]+ +h[p+(e<<3)>>3]*-2.0;}g[d+(i<<2)>>2]=l;e=e+1|0;i=i+1|0;}f=f+m|0;j=j+1|0;m=m+-1|0;}}while(0);vn(n);vn(o);return d|0}function kn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+16|0;q=r;if(c[a+8>>2]|0){d=ln(a,b)|0;f=0.0;e=0;p=0;while(1){if((p|0)>=(b|0))break;e=e+p|0;o=c[a+(p*20|0)>>2]|0;k=a+(p*20|0)+4|0;m=(O(p,b)|0)-e|0;n=a+(p*20|0)+8|0;j=1;while(1){if((j|0)>=(o|0))break;i=c[(c[k>>2]|0)+(j<<2)>>2]|0;if((i|0)>=(p|0)){i=d+(m+i<<2)|0;s=+g[(c[n>>2]|0)+(j<<2)>>2];f=f+ +B(+(+g[i>>2]-s));g[i>>2]=s;}j=j+1|0;}p=p+1|0;}if(0);}else d=0;l=r;return d|0}function ln(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;h=m;i=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;j=JK(b<<2)|0;ur(h,b);d=0;f=0;k=b;while(1){if((d|0)>=(b|0))break;hs(d,a,b,j);e=d;g=f;while(1){if((e|0)==(b|0))break;c[i+(g<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;g=g+1|0;}d=d+1|0;f=f+k|0;k=k+-1|0;}U1(j);vr(h);l=m;return i|0}function mn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;i=n;j=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;k=JK(b<<2)|0;ur(i,b);d=0;f=0;m=b;while(1){if((d|0)>=(b|0))break;qr(d,a,b,k,i);e=d;h=f;while(1){if((e|0)==(b|0))break;g[j+(h<<2)>>2]=+(c[k+(e<<2)>>2]|0);e=e+1|0;h=h+1|0;}d=d+1|0;f=f+m|0;m=m+-1|0;}U1(k);vr(i);l=n;return j|0}function nn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=a+8|0;d=c[r>>2]|0;e=0;f=0;while(1){if((f|0)>=(b|0))break;e=(c[a+(f*20|0)>>2]|0)+e|0;f=f+1|0;}f=JK(e<<2)|0;q=JK(b<<2)|0;e=0;while(1){if((e|0)>=(b|0))break;c[q+(e<<2)>>2]=0;e=e+1|0;}if(!(c[r>>2]|0)){h=0;while(1){if((h|0)>=(b|0))break;c[a+(h*20|0)+8>>2]=f;Zs(a,h,q);i=a+(h*20|0)|0;j=c[i>>2]|0;k=a+(h*20|0)+4|0;l=+(j+-1|0);e=1;while(1){if((e|0)>=(j|0))break;p=c[(c[k>>2]|0)+(e<<2)>>2]|0;s=+((c[a+(p*20|0)>>2]|0)+-1|0)+l;g[f+(e<<2)>>2]=s-+((Ys(a,h,p,q)|0)<<1|0);e=e+1|0;}_s(a,h,q);f=f+(c[i>>2]<<2)|0;h=h+1|0;}f=mn(a,b)|0;}else {j=0;while(1){if((j|0)>=(b|0))break;Zs(a,j,q);k=a+(j*20|0)|0;m=c[k>>2]|0;n=a+(j*20|0)+4|0;o=m+-2|0;p=a+(j*20|0)+8|0;i=1;while(1){if((i|0)>=(m|0))break;e=c[(c[n>>2]|0)+(i<<2)>>2]|0;h=o+(c[a+(e*20|0)>>2]|0)|0;s=+(h-((Ys(a,j,e,q)|0)<<1)|0);l=+g[(c[p>>2]|0)+(i<<2)>>2];if(l>2]=l;i=i+1|0;}_s(a,j,q);c[p>>2]=f;f=f+(c[k>>2]<<2)|0;j=j+1|0;}f=ln(a,b)|0;}U1(q);U1(c[r>>2]|0);c[r>>2]=0;a:do if(d|0){e=0;while(1){if((e|0)>=(b|0))break a;c[a+(e*20|0)+8>>2]=d;d=d+(c[a+(e*20|0)>>2]<<2)|0;e=e+1|0;}}while(0);return f|0}function on(a,b,e,f,i,j,k,m,n){a=a|0;b=b|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0.0,w=0,x=0.0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0,P=0.0;M=l;l=l+80|0;L=M+56|0;K=M+48|0;A=M+40|0;u=M+32|0;t=M+24|0;s=M+16|0;p=M+8|0;o=M;q=k&4;J=k&3;a:do if((n|0)<0)e=0;else {if(0);k=(m|0)==2;b:do if(k){if(0);e=nn(a,b)|0;w=14;}else {switch(m|0){case 1:{e=jn(a,b)|0;if(e|0){I=e;break b}gA(0,93315,o)|0;gA(3,93364,p)|0;w=15;break b}case 3:break;default:{w=15;break b}}if(0);e=kn(a,b)|0;w=14;}while(0);if((w|0)==14)if(!e)w=15;else I=e;do if((w|0)==15){if(0);if(!(c[a+8>>2]|0)){I=mn(a,b)|0;break}else {I=ln(a,b)|0;break}}while(0);if(0);c:do if((b|0)>1&(q|0)!=0)if((pn(a,b,f,j,q,J,k&1)|0)<0){u=0;t=0;e=-1;a=0;s=0;q=0;p=0;o=0;m=0;k=0;}else {k=0;while(1){if((k|0)>=(j|0)){y=0;w=35;break c}m=f+(k<<2)|0;r=1.0;e=0;while(1){if((e|0)==(b|0))break;x=+B(+(+h[(c[m>>2]|0)+(e<<3)>>3]));r=x>r?x:r;e=e+1|0;}r=1.0/r;e=0;while(1){if((e|0)==(b|0)){e=0;break}H=(c[m>>2]|0)+(e<<3)|0;h[H>>3]=+h[H>>3]*r;e=e+1|0;}while(1){if((e|0)==(b|0))break;x=(+B5()+-.5)*1.0e-06;H=(c[m>>2]|0)+(e<<3)|0;h[H>>3]=+h[H>>3]+x;e=e+1|0;}Ht(b,c[m>>2]|0);k=k+1|0;}}else {y=hn(0,b,j,f,i)|0;w=35;}while(0);d:do if((w|0)==35){if(0);if((b|0)==1|(n|0)==0){e=0;break a}if(0);s=j<<2;H=JK(s)|0;t=b<<2;a=O(t,j)|0;G=JK(a)|0;e=0;while(1){if((e|0)>=(j|0))break;m=G+((O(e,b)|0)<<2)|0;c[H+(e<<2)>>2]=m;o=f+(e<<2)|0;k=0;while(1){if((k|0)>=(b|0))break;g[m+(k<<2)>>2]=+h[(c[o>>2]|0)+(k<<3)>>3];k=k+1|0;}e=e+1|0;}e:do if(!J){p=b+-1|0;e=0;r=0.0;o=0;while(1){if((o|0)>=(p|0))break e;q=b-o|0;m=e;k=1;while(1){e=m+1|0;if((k|0)>=(q|0))break;m=e;r=+g[I+(e<<2)>>2]+r;k=k+1|0;}o=o+1|0;}}else r=+(b|0)*.5*+(b+-1|0);while(0);C=(O(b+1|0,b)|0)/2|0;D=(J|0)==2;if(D)bu(C,I);cu(C,I);E=b<<3;m=JK(E)|0;Y6(m|0,0,E|0)|0;F=b+-1|0;e=0;o=0;while(1){if((o|0)>=(F|0)){e=b;k=0;o=0;break}p=b-o|0;v=0.0;k=1;while(1){e=e+1|0;if((k|0)>=(p|0))break;x=+g[I+(e<<2)>>2];z=m+(k+o<<3)|0;h[z>>3]=+h[z>>3]-x;v=v+x;k=k+1|0;}z=m+(o<<3)|0;h[z>>3]=+h[z>>3]-v;o=o+1|0;}while(1){if((k|0)>=(b|0))break;g[I+(o<<2)>>2]=+h[m+(k<<3)>>3];z=e+o|0;e=e+-1|0;k=k+1|0;o=z;}z=JK(s)|0;c[z>>2]=JK(a)|0;e=1;while(1){if((e|0)>=(j|0))break;c[z+(e<<2)>>2]=(c[z>>2]|0)+((O(e,b)|0)<<2);e=e+1|0;}p=JK(t)|0;o=JK(t)|0;k=JK(C<<2)|0;if(0);w=(y|0)==0;y=c[15712]|0;e=0;q=0;x=1797693134862315708145274.0e284;while(1){if(!(q<<24>>24==0&(e|0)<(n|0)))break;Y6(m|0,0,E|0)|0;if(D){du(C,I,k);u=0;a=0;}else {u=0;a=0;}while(1){if((u|0)>=(F|0)){q=b;s=0;a=0;break}t=b-u+-1|0;$t(t,0.0,o);q=0;while(1){if((q|0)>=(j|0))break;A=H+(q<<2)|0;$t(t,+g[(c[A>>2]|0)+(u<<2)>>2],p);Wt(t,p,-1.0,(c[A>>2]|0)+(u<<2)+4|0);bu(t,p);Vt(t,p,o,o);q=q+1|0;}eu(t,o);q=0;while(1){if((q|0)>=(t|0))break;s=o+(q<<2)|0;v=+g[s>>2];if(v>=3402823466385288598117041.0e14|v<0.0)g[s>>2]=0.0;q=q+1|0;}q=a+1|0;a=u+1|0;f:do if(D){v=0.0;s=0;while(1){if((s|0)>=(t|0))break f;A=k+(q<<2)|0;N=+g[A>>2]*+g[o+(s<<2)>>2];g[A>>2]=N;A=m+(a+s<<3)|0;h[A>>3]=+h[A>>3]-N;v=v+N;q=q+1|0;s=s+1|0;}}else {v=0.0;s=0;while(1){if((s|0)>=(t|0))break f;N=+g[o+(s<<2)>>2];g[k+(q<<2)>>2]=N;A=m+(a+s<<3)|0;h[A>>3]=+h[A>>3]-N;v=v+N;q=q+1|0;s=s+1|0;}}while(0);A=m+(u<<3)|0;h[A>>3]=+h[A>>3]-v;u=a;a=q;}while(1){if((s|0)>=(b|0)){q=0;break}g[k+(a<<2)>>2]=+h[m+(s<<3)>>3];A=q+a|0;q=q+-1|0;s=s+1|0;a=A;}while(1){if((q|0)>=(j|0)){v=0.0;q=0;break}Tt(k,b,c[H+(q<<2)>>2]|0,c[z+(q<<2)>>2]|0);q=q+1|0;}while(1){if((q|0)>=(j|0))break;v=+Zt(b,c[H+(q<<2)>>2]|0,c[z+(q<<2)>>2]|0)+v;q=q+1|0;}v=v*2.0+r;q=0;while(1){if((q|0)>=(j|0))break;A=H+(q<<2)|0;Tt(I,b,c[A>>2]|0,p);v=v-+Zt(b,c[A>>2]|0,p);q=q+1|0;}P=x-v;N=+h[23294];q=(v=0.0?P:-P)/x=(j|0))break;t=H+(a<<2)|0;s=c[t>>2]|0;g:do if(w){if((Ar(I,s,c[z+(a<<2)>>2]|0,b,.001,b)|0)<0){u=z;t=I;e=-1;a=G;s=H;q=z;break d}}else {Yt(b,s,p);if((Ar(I,p,c[z+(a<<2)>>2]|0,b,.001,b)|0)<0){u=z;t=I;e=-1;a=G;s=H;q=z;break d}else s=0;while(1){if((s|0)>=(b|0))break g;if((d[(c[(c[i+(s<<2)>>2]|0)+16>>2]|0)+119>>0]|0)<=1)c[(c[t>>2]|0)+(s<<2)>>2]=c[p+(s<<2)>>2];s=s+1|0;}}while(0);a=a+1|0;}if(((e|0)%5|0|0)==0&0!=0?(h[K>>3]=v,w4(y,90371,K)|0,((e+5|0)%50|0|0)==0):0)E6(10,y)|0;e=e+1|0;x=v;}if(!0)q=0;while(1){if((q|0)>=(j|0)){u=z;t=I;a=G;s=H;q=z;break d}a=H+(q<<2)|0;t=f+(q<<2)|0;s=0;while(1){if((s|0)>=(b|0))break;h[(c[t>>2]|0)+(s<<3)>>3]=+g[(c[a>>2]|0)+(s<<2)>>2];s=s+1|0;}q=q+1|0;}}while(0);U1(a);U1(s);U1(t);if(u|0){U1(c[u>>2]|0);U1(q);}U1(p);U1(o);U1(m);U1(k);}while(0);l=M;return e|0}function pn(b,d,e,f,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0.0,q=0,r=0,s=0.0,t=0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0;R=l;l=l+32|0;o=R+24|0;Q=R+8|0;H=R+4|0;N=R;M=(d|0)<50?d:50;P=KK(M<<2)|0;G=d<<3;n=KK(O(G,M)|0)|0;m=0;while(1){if((m|0)>=(M|0))break;c[P+(m<<2)>>2]=n+((O(m,d)|0)<<3);m=m+1|0;}E=M<<1;E=(E|0)>50?E:50;E=(E|0)>(d|0)?d:E;c[o>>2]=0;rs(b,d,E,o,k);ss(c[o>>2]|0,d,E);mu(c[o>>2]|0,E,d,P,M);U1(c[c[o>>2]>>2]|0);U1(c[o>>2]|0);E=d<<2;L=KK(E)|0;m=0;while(1){if((m|0)>=(d|0))break;c[L+(m<<2)>>2]=-1;m=m+1|0;}ur(Q,d);J=c[b+8>>2]|0;I=(k|0)!=0;if(I)dt(b,d);C=KK(E)|0;K=KK(160)|0;n=KK(d*160|0)|0;D=KK(160)|0;m=0;while(1){if((m|0)==40)break;c[D+(m<<2)>>2]=n+((O(m,d)|0)<<2);m=m+1|0;}m=(x5()|0)%(d|0)|0;c[L+(m<<2)>>2]=0;c[K>>2]=m;n=c[D>>2]|0;if(I){bs(m,b,d,n);n=0;o=0;}else {qr(m,b,d,n,Q);n=0;o=0;}while(1){if((o|0)>=(d|0)){r=1;break}F=c[(c[D>>2]|0)+(o<<2)>>2]|0;c[C+(o<<2)>>2]=F;A=(F|0)>(n|0);m=A?o:m;n=A?F:n;o=o+1|0;}while(1){if((r|0)==40){m=0;break}c[L+(m<<2)>>2]=r;c[K+(r<<2)>>2]=m;t=D+(r<<2)|0;n=c[t>>2]|0;if(I){bs(m,b,d,n);q=0;n=0;}else {qr(m,b,d,n,Q);q=0;n=0;}while(1){if((q|0)>=(d|0))break;o=C+(q<<2)|0;F=c[o>>2]|0;k=c[(c[t>>2]|0)+(q<<2)>>2]|0;k=(F|0)<(k|0)?F:k;c[o>>2]=k;if((k|0)<=(n|0)){if((k|0)==(n|0)?((x5()|0)%(q+1|0)|0|0)==0:0){n=c[o>>2]|0;m=q;}}else {n=k;m=q;}q=q+1|0;}r=r+1|0;}while(1){if((m|0)>=(d|0))break;c[C+(m<<2)>>2]=-1;m=m+1|0;}w=KK(E)|0;F=KK(d<<4)|0;x=d+-1|0;y=x<<2;A=0;o=0;k=0;n=0;z=0;while(1){if((z|0)>=(d|0))break;m=L+(z<<2)|0;a:do if((c[m>>2]|0)>-1){t=F+(z<<4)+4|0;c[t>>2]=KK(y)|0;v=KK(y)|0;c[F+(z<<4)+8>>2]=v;c[F+(z<<4)>>2]=x;a[F+(z<<4)+12>>0]=1;r=D+(c[m>>2]<<2)|0;m=0;while(1){if((m|0)==(z|0)){q=z;break}c[(c[t>>2]|0)+(m<<2)>>2]=m;c[v+(m<<2)>>2]=c[(c[r>>2]|0)+(m<<2)>>2];m=m+1|0;}while(1){m=q+1|0;if((q|0)==(x|0)){m=x;break a}c[(c[t>>2]|0)+(q<<2)>>2]=m;c[v+(q<<2)>>2]=c[(c[r>>2]|0)+(m<<2)>>2];q=m;}}else {if((n|0)<40){k=KK(E)|0;o=KK(E)|0;n=d;m=1;}else m=0;a[F+(z<<4)+12>>0]=m;c[F+(z<<4)+4>>2]=k;c[F+(z<<4)+8>>2]=o;c[F+(z<<4)>>2]=40;m=0;while(1){if((m|0)==40)break;c[k+(m<<2)>>2]=c[K+(m<<2)>>2];c[o+(m<<2)>>2]=c[(c[D+(m<<2)>>2]|0)+(z<<2)>>2];m=m+1|0;}o=o+160|0;k=k+160|0;n=n+-40|0;m=40;}while(0);A=m+A|0;z=z+1|0;}U1(C);U1(w);if(D|0){U1(c[D>>2]|0);U1(D);}D=KK(d*20|0)|0;q=A+d<<2;r=KK(q)|0;v=(j|0)==2;q=KK(q)|0;t=0;while(1){if((t|0)>=(d|0))break;c[D+(t*20|0)+4>>2]=r;c[D+(t*20|0)+8>>2]=q;m=(c[F+(t<<4)>>2]|0)+1|0;w=D+(t*20|0)|0;c[w>>2]=m;o=(c[F+(t<<4)+8>>2]|0)+-4|0;k=F+(t<<4)+4|0;b:do if(v){p=0.0;n=1;while(1){if((n|0)>=(m|0))break b;c[r+(n<<2)>>2]=c[(c[k>>2]|0)+(n+-1<<2)>>2];u=+(c[o+(n<<2)>>2]|0);u=-1.0/(u*u);g[q+(n<<2)>>2]=u;p=p-u;n=n+1|0;m=c[w>>2]|0;}}else {p=0.0;n=1;while(1){if((n|0)>=(m|0))break b;c[r+(n<<2)>>2]=c[(c[k>>2]|0)+(n+-1<<2)>>2];u=-1.0/+(c[o+(n<<2)>>2]|0);g[q+(n<<2)>>2]=u;p=p-u;n=n+1|0;m=c[w>>2]|0;}}while(0);c[r>>2]=t;g[q>>2]=p;E=c[w>>2]|0;q=q+(E<<2)|0;r=r+(E<<2)|0;t=t+1|0;}C=KK(f<<2)|0;c[C>>2]=KK(O(f<<3,M)|0)|0;m=1;while(1){if((m|0)>=(f|0))break;c[C+(m<<2)>>2]=(c[C>>2]|0)+((O(m,M)|0)<<3);m=m+1|0;}c:do if(i){m=0;while(1){if((m|0)>=(f|0))break;o=C+(m<<2)|0;n=0;while(1){if((n|0)>=(M|0))break;h[(c[o>>2]|0)+(n<<3)>>3]=0.0;n=n+1|0;}m=m+1|0;}if((f|0)!=2){m=0;while(1){if((m|0)>=(f|0)){m=0;break c}h[(c[C+(m<<2)>>2]|0)+(m<<3)>>3]=1.0;m=m+1|0;}}h[c[C>>2]>>3]=1.0;m=C+4|0;if(!((nu(P,M,d,c[m>>2]|0)|0)<<24>>24)){n=c[m>>2]|0;m=0;while(1){if((m|0)>=(M|0))break;h[n+(m<<3)>>3]=0.0;m=m+1|0;}h[n+8>>3]=1.0;m=0;}else m=0;}else {n=0;while(1){if((n|0)>=(f|0)){m=0;break c}o=C+(n<<2)|0;m=0;while(1){if((m|0)>=(M|0))break;u=+(x5()|0)*4.656612875245797e-10;h[(c[o>>2]|0)+(m<<3)>>3]=u;m=m+1|0;}n=n+1|0;}}while(0);while(1){if((m|0)>=(f|0))break;Rt(P,d,M,c[C+(m<<2)>>2]|0,c[e+(m<<2)>>2]|0);m=m+1|0;}c[H>>2]=0;c[N>>2]=0;Gt(D,P,d,M,H);Et(P,c[H>>2]|0,M,d,M,N);U1(c[c[H>>2]>>2]|0);U1(c[H>>2]|0);z=KK(G)|0;A=KK(M<<3)|0;m=0;n=0;p=+rn(e,F,f,d,j);d:while(1){if((n|0)<50&m<<24>>24==0)x=0;else break;while(1){if((x|0)>=(f|0))break;y=e+(x<<2)|0;o=0;while(1){if((o|0)>=(d|0))break;q=z+(o<<3)|0;h[q>>3]=0.0;r=(c[F+(o<<4)+8>>2]|0)+-4|0;t=c[D+(o*20|0)+4>>2]|0;v=c[D+(o*20|0)+8>>2]|0;w=D+(o*20|0)|0;s=0.0;k=1;while(1){if((k|0)>=(c[w>>2]|0))break;m=c[t+(k<<2)>>2]|0;u=+ft(e,f,o,m);if(u>1.0e-30){u=-(+g[v+(k<<2)>>2]*+(c[r+(k<<2)>>2]|0))/u;h[q>>3]=u*+h[(c[y>>2]|0)+(m<<3)>>3]+ +h[q>>3];s=s-u;}k=k+1|0;}h[q>>3]=+h[q>>3]+ +h[(c[y>>2]|0)+(o<<3)>>3]*s;o=o+1|0;}Dt(P,M,d,z,A);m=C+(x<<2)|0;if(zr(c[N>>2]|0,c[m>>2]|0,A,M,.001,M,0)|0){n=-1;break d}Rt(P,d,M,c[m>>2]|0,c[y>>2]|0);x=x+1|0;}if(!(n&1)){u=+rn(e,F,f,d,j);p=+B(+(u-p))/(u+1.0e-10);m=p<+h[23294]&1;p=u;}else m=0;n=n+1|0;}U1(A);U1(z);if(I){et(b,d,J);m=0;}else m=0;while(1){if((m|0)>=(d|0))break;if(a[F+(m<<4)+12>>0]|0){U1(c[F+(m<<4)+4>>2]|0);U1(c[F+(m<<4)+8>>2]|0);}m=m+1|0;}U1(F);U1(c[D+4>>2]|0);U1(c[D+8>>2]|0);U1(D);U1(L);U1(K);U1(c[C>>2]|0);U1(C);m=c[N>>2]|0;if(m|0){U1(c[m>>2]|0);U1(c[N>>2]|0);}U1(c[P>>2]|0);U1(P);vr(Q);l=R;return n|0}function qn(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0;q=e+-1|0;o=(f|0)==2;h=0.0;f=0;m=0;while(1){if((m|0)>=(q|0))break;p=e-m|0;n=1;while(1){f=f+1|0;if((n|0)>=(p|0))break;k=n+m|0;i=0.0;j=0;while(1){if((j|0)>=(d|0))break;r=c[a+(j<<2)>>2]|0;l=+g[r+(m<<2)>>2]-+g[r+(k<<2)>>2];i=i+l*l;j=j+1|0;}i=+C(+i);l=+g[b+(f<<2)>>2];if(o){i=1.0/+C(+l)-i;i=i*i;}else {i=1.0/l-i;i=i*i;}n=n+1|0;h=i*l+h;}m=m+1|0;}return +h}function rn(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;a:do if((f|0)==2){g=0.0;l=0;while(1){if((l|0)>=(e|0))break a;n=c[b+(l<<4)>>2]|0;o=b+(l<<4)+4|0;m=b+(l<<4)+8|0;k=0;while(1){if((k|0)>=(n|0))break;j=c[(c[o>>2]|0)+(k<<2)>>2]|0;if((j|0)>(l|0)){i=0.0;f=0;while(1){if((f|0)>=(d|0))break;q=c[a+(f<<2)>>2]|0;p=+h[q+(l<<3)>>3]-+h[q+(j<<3)>>3];i=p*p+i;f=f+1|0;}i=+C(+i);p=+(c[(c[m>>2]|0)+(k<<2)>>2]|0);i=p-i;g=i*i/(p*p)+g;}k=k+1|0;}l=l+1|0;}}else {l=0;g=0.0;while(1){if((l|0)>=(e|0))break a;m=c[b+(l<<4)>>2]|0;n=b+(l<<4)+4|0;o=b+(l<<4)+8|0;k=0;while(1){if((k|0)>=(m|0))break;j=c[(c[n>>2]|0)+(k<<2)>>2]|0;if((j|0)>(l|0)){i=0.0;f=0;while(1){if((f|0)>=(d|0))break;q=c[a+(f<<2)>>2]|0;p=+h[q+(l<<3)>>3]-+h[q+(j<<3)>>3];i=p*p+i;f=f+1|0;}i=+C(+i);p=+(c[(c[o>>2]|0)+(k<<2)>>2]|0);i=p-i;g=i*i/p+g;}k=k+1|0;}l=l+1|0;}}while(0);return +g}function sn(a){a=+a;return +(+C(+a)*a)}function tn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0;g=c[47137]|0;e=0.0;f=0;while(1){if((f|0)>=(g|0))break;i=+h[a+(f<<3)>>3]-+h[b+(f<<3)>>3];h[d+(f<<3)>>3]=i;e=i*i+e;f=f+1|0;}return +(+C(+e))}function un(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;i=JK(a<<2)|0;f=0;g=JK(O(a<<3,b)|0)|0;while(1){if((f|0)>=(a|0))break;c[i+(f<<2)>>2]=g;e=0;while(1){if((e|0)>=(b|0))break;h[g+(e<<3)>>3]=d;e=e+1|0;}f=f+1|0;g=g+(b<<3)|0;}return i|0}function vn(a){a=a|0;if(a|0){U1(c[a>>2]|0);U1(a);}return}function wn(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+16|0;n=tB(b)|0;m=uB(b)|0;k=GA(b,2,92493,0)|0;a:do if(!d){h[23294]=+(n|0)*.0001;pK(b,108886,186352);g=QA(c[b+60>>2]|0,90100)|0;if(!g)e=.99;else e=+r5(g);h[23296]=e;g=JK((n<<2)+4|0)|0;j=b+16|0;c[(c[j>>2]|0)+152>>2]=g;g=0;e=0.0;i=jC(b)|0;while(1){if(!i)break a;c[(c[(c[j>>2]|0)+152>>2]|0)+(g<<2)>>2]=i;p=c[i+16>>2]|0;c[p+120>>2]=g;c[p+124>>2]=-1;f=+zn(b,i,k)+e;g=g+1|0;e=f;i=kC(b,i)|0;}}else {h[23294]=.0001;pK(b,108886,186352);g=0;e=0.0;i=jC(b)|0;while(1){if(!i)break a;c[(c[i+16>>2]|0)+120>>2]=g;f=+zn(b,i,k)+e;g=g+1|0;e=f;i=kC(b,i)|0;}}while(0);g=QA(b,90108)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){e=+h[23294];f=+r5(g);if(!(e>f))e=f;}else e=e/+(((m|0)>1?m:1)|0)*+C(+(+(n|0)))+1.0;h[23295]=e;if(!(c[47134]|d)){d=un(n,n,e)|0;p=b+16|0;c[(c[p>>2]|0)+160>>2]=d;d=un(n,n,1.0)|0;c[(c[p>>2]|0)+164>>2]=d;d=un(n,c[47137]|0,1.0)|0;c[(c[p>>2]|0)+168>>2]=d;d=An(n,n,c[47137]|0)|0;c[(c[p>>2]|0)+172>>2]=d;}l=o;return n|0}function xn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=0;e=0;j=aB(a,b)|0;a:while(1){if(!j)break;h=c[j>>2]&3;g=c[((h|0)==2?j:j+-48|0)+40>>2]|0;h=c[((h|0)==3?j:j+48|0)+40>>2]|0;do if((g|0)!=(h|0)){i=(h|0)==(b|0);if((e|0)!=1){f=i?g:h;c[d>>2]=f;e=e+1|0;break}if(!((g|0)==(f|0)&i)?!((g|0)==(b|0)&(h|0)==(f|0)):0){e=2;break a}else e=1;}while(0);j=bB(a,j,b)|0;}return e|0}function yn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=a+60|0;a:while(1){b:while(1){if(!b)break a;switch(xn(a,b,f)|0){case 0:{e=5;break b}case 1:{e=8;break b}default:b=0;}}if((e|0)==5){if((d|0)==(b|0))d=kC(a,d)|0;wC(c[g>>2]|0,b)|0;b=0;continue}else if((e|0)==8){if((d|0)==(b|0))d=kC(a,d)|0;wC(c[g>>2]|0,b)|0;b=c[f>>2]|0;continue}}l=h;return d|0}function zn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0;k=l;l=l+32|0;i=k+8|0;g=k;b=XA(a,b)|0;e=0.0;while(1){if(!b)break;switch(Bn(b,d,g)|0){case 0:{f=+h[g>>3];break}case 2:{c[i>>2]=KB(a)|0;h[i+8>>3]=1.0;gA(3,90120,i)|0;j=6;break}default:j=6;}if((j|0)==6){j=0;h[g>>3]=1.0;f=1.0;}h[(c[b+16>>2]|0)+136>>3]=f;b=ZA(a,b)|0;e=f+e;}l=k;return +e}function An(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0;j=JK((a<<2)+4|0)|0;k=(b<<2)+4|0;l=d<<3;g=0;while(1){if((g|0)>=(a|0))break;i=j+(g<<2)|0;c[i>>2]=JK(k)|0;f=0;while(1){if((f|0)>=(b|0))break;e=JK(l)|0;c[(c[i>>2]|0)+(f<<2)>>2]=e;e=0;while(1){if((e|0)>=(d|0))break;h[(c[(c[i>>2]|0)+(f<<2)>>2]|0)+(e<<3)>>3]=0.0;e=e+1|0;}f=f+1|0;}c[(c[i>>2]|0)+(f<<2)>>2]=0;g=g+1|0;}c[j+(g<<2)>>2]=0;return j|0}function Bn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;do if((d|0)!=0?(f=RA(b,d)|0,(a[f>>0]|0)!=0):0){c[i>>2]=e;if(((b5(f,101209,i)|0)>=1?(g=+h[e>>3],!(g<0.0)):0)?g!=0.0|(c[47134]|0)!=0:0){b=0;break}c[j>>2]=f;gA(0,90147,j)|0;b=2;}else b=1;while(0);l=k;return b|0}function Cn(a){a=a|0;return wn(a,0)|0}function Dn(a){a=a|0;a=a+16|0;U1(c[(c[a>>2]|0)+152>>2]|0);if(!(c[47134]|0)){vn(c[(c[a>>2]|0)+160>>2]|0);vn(c[(c[a>>2]|0)+164>>2]|0);vn(c[(c[a>>2]|0)+168>>2]|0);En(c[(c[a>>2]|0)+172>>2]|0);c[(c[a>>2]|0)+172>>2]=0;}return}function En(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(a|0){f=0;while(1){g=a+(f<<2)|0;b=c[g>>2]|0;if(!b)break;else e=0;while(1){d=c[b+(e<<2)>>2]|0;if(!d)break;U1(d);e=e+1|0;b=c[g>>2]|0;}U1(b);f=f+1|0;}U1(a);}return}function Fn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+(b|0);b=a+16|0;while(1){if((d|0)>=(c[47137]|0))break;f=+B5()*e;h[(c[(c[b>>2]|0)+132>>2]|0)+(d<<3)>>3]=f;d=d+1|0;}return}function Gn(a,b){a=a|0;b=b|0;Fn(a,b,2);return}function Hn(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0;e=+(b|0);f=+B5()*e;d=a+16|0;h[c[(c[d>>2]|0)+132>>2]>>3]=f;e=+B5()*e;h[(c[(c[d>>2]|0)+132>>2]|0)+8>>3]=e;if((c[47137]|0)>2)Gn(a,b);return}function In(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(0);d=nm(b,d,2)|0;a:do if((d|0)!=1){if(!(c[46797]|d)){gA(0,90192,e)|0;c[46797]=1;}e=b+16|0;d=0;while(1){b=c[(c[(c[e>>2]|0)+152>>2]|0)+(d<<2)>>2]|0;if(!b)break a;if(!(a[(c[b+16>>2]|0)+119>>0]|0))Hn(b,1);d=d+1|0;}}while(0);l=f;return}function Jn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+96|0;p=q+80|0;n=q;if(0);o=a+16|0;f=c[o>>2]|0;k=c[f+164>>2]|0;f=c[f+160>>2]|0;m=0;while(1){if((m|0)>=(b|0))break;i=f+(m<<2)|0;j=k+(m<<2)|0;e=0;while(1){if((e|0)==(m|0))break;g=+h[(c[i>>2]|0)+(e<<3)>>3];g=1.0/(g*g);d=c[(c[o>>2]|0)+152>>2]|0;d=iB(a,c[d+(m<<2)>>2]|0,c[d+(e<<2)>>2]|0,0,0)|0;if(d)g=+h[(c[d+16>>2]|0)+128>>3]*g;h[(c[k+(e<<2)>>2]|0)+(m<<3)>>3]=g;h[(c[j>>2]|0)+(e<<3)>>3]=g;e=e+1|0;}m=m+1|0;}a=c[47137]|0;e=0;while(1){if((e|0)<(b|0))d=0;else break;while(1){if((d|0)>=(a|0))break;h[(c[(c[(c[o>>2]|0)+168>>2]|0)+(e<<2)>>2]|0)+(d<<3)>>3]=0.0;d=d+1|0;}e=e+1|0;}i=0;while(1){d=c[(c[(c[o>>2]|0)+152>>2]|0)+(i<<2)>>2]|0;if(!d)break;a=d+16|0;d=0;while(1){if((d|0)>=(b|0))break;a:do if((i|0)!=(d|0)){g=+tn(c[(c[a>>2]|0)+132>>2]|0,c[(c[(c[(c[(c[o>>2]|0)+152>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+132>>2]|0,n);f=c[47137]|0;g=1.0/g;e=0;while(1){if((e|0)>=(f|0))break a;m=c[o>>2]|0;r=+h[n+(e<<3)>>3];r=(r-+h[(c[(c[m+160>>2]|0)+(i<<2)>>2]|0)+(d<<3)>>3]*r*g)*+h[(c[(c[m+164>>2]|0)+(i<<2)>>2]|0)+(d<<3)>>3];h[(c[(c[(c[m+172>>2]|0)+(i<<2)>>2]|0)+(d<<2)>>2]|0)+(e<<3)>>3]=r;m=(c[(c[m+168>>2]|0)+(i<<2)>>2]|0)+(e<<3)|0;h[m>>3]=+h[m>>3]+r;e=e+1|0;}}while(0);d=d+1|0;}i=i+1|0;}if(0);l=q;return}function Kn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0;i=l;l=l+32|0;g=i+24|0;f=i+8|0;e=i;j=+h[23294];h[23216]=j*j;while(1){d=Ln(a,b)|0;if(!d)break;Mn(a,b,d);}if(!0)b=a+16|0;b=c[(c[b>>2]|0)+156>>2]|0;if((b|0)==(c[47136]|0)){k=KB(a)|0;c[g>>2]=b;c[g+4>>2]=k;gA(0,90320,g)|0;}l=i;return}function Ln(a,b){a=a|0;b=b|0;var e=0.0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+16|0;q=r;o=(c[46799]|0)+1|0;c[46799]=o;a=c[a+16>>2]|0;if((c[a+156>>2]|0)<(c[47136]|0)){m=c[47137]|0;n=a+152|0;k=a+168|0;a=0;e=0.0;j=0;while(1){if((j|0)>=(b|0))break;g=c[(c[n>>2]|0)+(j<<2)>>2]|0;if((d[(c[g+16>>2]|0)+119>>0]|0)<=1){i=0.0;f=0;while(1){if((f|0)>=(m|0))break;s=+h[(c[(c[k>>2]|0)+(j<<2)>>2]|0)+(f<<3)>>3];i=s*s+i;f=f+1|0;}if(i>e){a=g;e=i;}}j=j+1|0;}if(!(e<+h[23216])){if(0!=0&((o|0)%100|0|0)==0?(p=c[15712]|0,h[q>>3]=+C(+e),w4(p,90371,q)|0,((c[46799]|0)%1e3|0|0)==0):0)E6(10,p)|0;}else a=0;}else a=0;l=r;return a|0}function Mn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;k=d+16|0;m=c[(c[k>>2]|0)+120>>2]|0;f=c[46798]|0;if(!f){g=c[47137]|0;g=KK(O(g<<3,g)|0)|0;}else {g=c[47137]|0;g=MK(f,O(g<<3,g)|0)|0;}c[46798]=g;On(a,b,m,g);i=c[47137]|0;j=a+16|0;f=0;while(1){if((f|0)>=(i|0))break;h[185736+(f<<3)>>3]=-+h[(c[(c[(c[j>>2]|0)+168>>2]|0)+(m<<2)>>2]|0)+(f<<3)>>3];f=f+1|0;}Xu(g,185816,185736,i);f=0;while(1){if((f|0)>=(c[47137]|0))break;e=+h[23296];e=(1.0-e)*2.0*+B5()+e;i=185816+(f<<3)|0;e=e*+h[i>>3];h[i>>3]=e;i=(c[(c[k>>2]|0)+132>>2]|0)+(f<<3)|0;h[i>>3]=+h[i>>3]+e;f=f+1|0;}k=(c[j>>2]|0)+156|0;c[k>>2]=(c[k>>2]|0)+1;Pn(a,b,m);if(rP()|0);l=o;return}function Nn(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=b+-1|0;n=a+16|0;o=c[47137]|0;g=0;d=0.0;a:while(1){if((g|0)>=(q|0))break;m=c[n>>2]|0;p=c[m+152>>2]|0;j=g+1|0;k=(c[p+(g<<2)>>2]|0)+16|0;l=m+164|0;m=m+160|0;i=j;while(1){if((i|0)>=(b|0)){g=j;continue a}f=(c[p+(i<<2)>>2]|0)+16|0;a=0;e=0.0;while(1){if((a|0)>=(o|0))break;r=+h[(c[(c[k>>2]|0)+132>>2]|0)+(a<<3)>>3]-+h[(c[(c[f>>2]|0)+132>>2]|0)+(a<<3)>>3];a=a+1|0;e=r*r+e;}r=+h[(c[(c[m>>2]|0)+(g<<2)>>2]|0)+(i<<3)>>3];r=((+C(+e)*-2.0+r)*r+e)*+h[(c[(c[l>>2]|0)+(g<<2)>>2]|0)+(i<<3)>>3]+d;i=i+1|0;d=r;}}return +d}function On(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+80|0;w=x;v=c[a+16>>2]|0;k=c[v+164>>2]|0;m=c[v+160>>2]|0;v=c[v+152>>2]|0;j=c[v+(d<<2)>>2]|0;g=c[47137]|0;a=0;while(1){if((a|0)>=(g|0))break;i=O(g,a)|0;f=0;while(1){if((f|0)==(g|0))break;h[e+(i+f<<3)>>3]=0.0;f=f+1|0;}a=a+1|0;}u=c[47137]|0;t=j+16|0;s=k+(d<<2)|0;k=m+(d<<2)|0;j=0;while(1){if((j|0)>=(b|0))break;a:do if((j|0)!=(d|0)){f=(c[v+(j<<2)>>2]|0)+16|0;r=0.0;a=0;while(1){if((a|0)>=(u|0))break;q=+h[(c[(c[t>>2]|0)+132>>2]|0)+(a<<3)>>3]-+h[(c[(c[f>>2]|0)+132>>2]|0)+(a<<3)>>3];h[w+(a<<3)>>3]=q;r=q*q+r;a=a+1|0;}n=1.0/+sn(r);i=0;while(1){if((i|0)>=(u|0))break a;f=(c[s>>2]|0)+(j<<3)|0;g=(c[k>>2]|0)+(j<<3)|0;o=+h[w+(i<<3)>>3];a=0;while(1){p=+h[f>>3];q=+h[g>>3];if((a|0)==(i|0))break;m=e+((O(u,a)|0)+i<<3)|0;h[m>>3]=+h[m>>3]+p*n*q*o*+h[w+(a<<3)>>3];a=a+1|0;}m=e+((O(u,i)|0)+i<<3)|0;h[m>>3]=(1.0-q*n*(r-o*o))*p+ +h[m>>3];i=i+1|0;}}while(0);j=j+1|0;}f=c[47137]|0;i=1;while(1){if((i|0)>=(f|0))break;g=O(f,i)|0;a=0;while(1){if((a|0)==(i|0))break;h[e+(g+a<<3)>>3]=+h[e+((O(f,a)|0)+i<<3)>>3];a=a+1|0;}i=i+1|0;}l=x;return}function Pn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;m=l;l=l+80|0;k=m;j=a+16|0;f=c[j>>2]|0;g=c[(c[f+152>>2]|0)+(d<<2)>>2]|0;e=c[47137]|0;f=f+168|0;a=0;while(1){if((a|0)>=(e|0))break;h[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3]=0.0;a=a+1|0;}f=g+16|0;a=0;while(1){if((a|0)>=(b|0))break;a:do if((a|0)!=(d|0)){i=+tn(c[(c[f>>2]|0)+132>>2]|0,c[(c[(c[(c[(c[j>>2]|0)+152>>2]|0)+(a<<2)>>2]|0)+16>>2]|0)+132>>2]|0,k);g=c[47137]|0;i=1.0/i;e=0;while(1){if((e|0)>=(g|0))break a;n=c[j>>2]|0;q=c[n+172>>2]|0;r=(c[(c[q+(d<<2)>>2]|0)+(a<<2)>>2]|0)+(e<<3)|0;o=+h[k+(e<<3)>>3];o=(o-+h[(c[(c[n+160>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3]*o*i)*+h[(c[(c[n+164>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3];h[r>>3]=o;n=c[n+168>>2]|0;s=(c[n+(d<<2)>>2]|0)+(e<<3)|0;h[s>>3]=+h[s>>3]+o;q=(c[(c[q+(a<<2)>>2]|0)+(d<<2)>>2]|0)+(e<<3)|0;o=+h[q>>3];p=-+h[r>>3];h[q>>3]=p;n=(c[n+(a<<2)>>2]|0)+(e<<3)|0;h[n>>3]=p-o+ +h[n>>3];e=e+1|0;}}while(0);a=a+1|0;}l=m;return}function Qn(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0;d=a+16|0;g=c[46800]|0;b=c[(c[d>>2]|0)+124>>2]|0;while(1){if((b|0)<=0)break;i=(b+-1|0)/2|0;j=g+(i<<2)|0;e=c[j>>2]|0;f=e+16|0;if(+h[(c[f>>2]|0)+136>>3]<=+h[(c[d>>2]|0)+136>>3])break;c[j>>2]=a;c[(c[d>>2]|0)+124>>2]=i;c[g+(b<<2)>>2]=e;c[(c[f>>2]|0)+124>>2]=b;b=i;}return}function Rn(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;i=a+16|0;j=c[46801]|0;k=c[46800]|0;g=c[(c[i>>2]|0)+124>>2]|0;while(1){e=g<<1|1;if((e|0)>=(j|0))break;d=e+1|0;if((d|0)<(j|0)){f=c[k+(d<<2)>>2]|0;b=c[k+(e<<2)>>2]|0;if(+h[(c[f+16>>2]|0)+136>>3]<+h[(c[b+16>>2]|0)+136>>3]){e=d;b=f;}else l=6;}else {b=c[k+(e<<2)>>2]|0;l=6;}if((l|0)==6)l=0;d=b+16|0;if(+h[(c[i>>2]|0)+136>>3]<=+h[(c[d>>2]|0)+136>>3])break;c[k+(e<<2)>>2]=a;c[(c[i>>2]|0)+124>>2]=e;c[k+(g<<2)>>2]=b;c[(c[d>>2]|0)+124>>2]=g;g=e;}return}function Sn(a){a=a|0;var b=0,d=0;b=(c[a+16>>2]|0)+124|0;if((c[b>>2]|0)>=0)qa(90377,90397,643,90405);d=c[46801]|0;c[46801]=d+1;c[b>>2]=d;c[(c[46800]|0)+(d<<2)>>2]=a;if((d|0)>0)Qn(a);return}function Tn(){var a=0,b=0,d=0,e=0;b=c[46801]|0;if(!b)a=0;else {e=c[46800]|0;a=c[e>>2]|0;d=b+-1|0;c[46801]=d;d=c[e+(d<<2)>>2]|0;c[e>>2]=d;c[(c[d+16>>2]|0)+124>>2]=0;if((b|0)>2)Rn(d);c[(c[a+16>>2]|0)+124>>2]=-1;}return a|0}function Un(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;c[46800]=JK((b<<2)+4|0)|0;if(0);b=jC(a)|0;while(1){if(!b)break;Vn(a,b);b=kC(a,b)|0;}if(0);U1(c[46800]|0);l=e;return}function Vn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0;e=c[(c[a+16>>2]|0)+152>>2]|0;f=+h[23295];d=0;while(1){g=c[e+(d<<2)>>2]|0;if(!g)break;h[(c[g+16>>2]|0)+136>>3]=f;d=d+1|0;}c[46802]=b;k=c[b+16>>2]|0;h[k+136>>3]=0.0;c[k+128>>2]=0;Sn(b);a:while(1){k=Tn()|0;if(!k)break;d=c[46802]|0;j=k+16|0;if((k|0)!=(d|0))Wn(a,d,k,+h[(c[j>>2]|0)+136>>3]);i=aB(a,k)|0;while(1){if(!i)continue a;d=c[i>>2]&3;b=c[((d|0)==3?i:i+48|0)+40>>2]|0;if((b|0)==(k|0))b=c[((d|0)==2?i:i+-48|0)+40>>2]|0;d=c[j>>2]|0;f=+h[(c[i+16>>2]|0)+136>>3]+ +h[d+136>>3];e=c[b+16>>2]|0;g=e+136|0;do if(+h[g>>3]>f){h[g>>3]=f;if((c[e+124>>2]|0)>-1){Qn(b);break}else {c[e+128>>2]=(c[d+128>>2]|0)+1;Sn(b);break}}while(0);i=bB(a,i,k)|0;}}return}function Wn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;b=c[(c[b+16>>2]|0)+120>>2]|0;d=c[(c[d+16>>2]|0)+120>>2]|0;a=c[(c[a+16>>2]|0)+160>>2]|0;h[(c[a+(d<<2)>>2]|0)+(b<<3)>>3]=e;h[(c[a+(b<<2)>>2]|0)+(d<<3)>>3]=e;return}function Xn(a){a=a|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;Yn(a);return}function Yn(a){a=a|0;var b=0,d=0,e=0,f=0;b=tB(a)|0;e=JK(b*56|0)|0;b=JK((b<<2)+4|0)|0;f=a+16|0;c[(c[f>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;Zl(b);c[(c[b+16>>2]|0)+112>>2]=e+(d*56|0);c[(c[(c[f>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;b=kC(a,b)|0;d=d+1|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Zn(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Zn(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,0.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function _n(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+80|0;m=u+32|0;i=u+24|0;g=u+16|0;j=u;t=u+72|0;p=u+40|0;if(tB(b)|0){Xn(b);f=QA(b,95738)|0;if(f)if(a[f>>0]|0){d=tC(b,f,0)|0;if(!d){c[g>>2]=f;gA(0,90448,g)|0;gA(3,90488,i)|0;d=0;s=1;}else s=0;}else {d=0;s=1;}else {d=0;s=0;}n=GA(b,1,95738,0)|0;o=(n|0)!=0;f=QA(b,140742)|0;if((f|0?a[f>>0]|0:0)?(k=j+8|0,c[m>>2]=j,c[m+4>>2]=k,(b5(f,105503,m)|0)==1):0)h[k>>3]=+h[j>>3];if(tB(b)|0){m=DG(b,t,0)|0;if((c[t>>2]|0)==1){g=(d|0)!=0;do if(g)e=d;else {if(o?(e=$n(b,n)|0,e|0):0)break;e=0;}while(0);f=Zu(b,e)|0;if(!((e|0)!=0|o^1))KA(f,n,142463)|0;r=(jC(b)|0)+16|0;U1(c[(c[r>>2]|0)+112>>2]|0);c[(c[r>>2]|0)+112>>2]=0;or(b)|0;fn(b);d=(s|0)==0|g?d:f;}else {kH(b,2,8,p)|0;c[p+12>>2]=0;k=(s|0)==0;j=0;while(1){if((j|0)>=(c[t>>2]|0))break;g=c[m+(j<<2)>>2]|0;e=(d|0)!=0;if(e?(HC(g,d)|0)!=0:0)f=d;else r=23;do if((r|0)==23){r=0;if(o?(q=$n(g,n)|0,q|0):0){f=q;break}f=0;}while(0);KG(g)|0;i=Zu(g,f)|0;d=k|e?d:i;if(o?(f|0)==0|(f|0)==(d|0):0)KA(i,n,142463)|0;or(g)|0;j=j+1|0;}r=(jC(b)|0)+16|0;U1(c[(c[r>>2]|0)+112>>2]|0);c[(c[r>>2]|0)+112>>2]=0;jH(c[t>>2]|0,m,b,p)|0;fn(b);}e=0;while(1){if((e|0)>=(c[t>>2]|0))break;wC(b,c[m+(e<<2)>>2]|0)|0;e=e+1|0;}U1(m);}if(s|0)SA(b,95738,KB(d)|0)|0;tM(b);}l=u;return}function $n(a,b){a=a|0;b=b|0;var c=0;c=jC(a)|0;while(1){if(!c){c=0;break}if((dP(RA(c,b)|0)|0)<<24>>24)break;c=kC(a,c)|0;}return c|0}function ao(a){a=a|0;var b=0,c=0;b=jC(a)|0;if(b|0){while(1){if(!b)break;c=XA(a,b)|0;while(1){if(!c)break;YP(c);c=ZA(a,c)|0;}WP(b);b=kC(a,b)|0;}bo(a);}return}function bo(a){a=a|0;U1(c[(c[a+16>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function co(a){a=a|0;eo(a);if(!((tB(a)|0)==0?!(c[(c[a+16>>2]|0)+180>>2]|0):0)){nv(a);tM(a);}return}function eo(a){a=a|0;c[47147]=GA(a,1,108230,108236)|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;fo(a,0);go(a);return}function fo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;h=(b|0)==0;if(h){jo(g);b=g;}d=OD(a)|0;while(1){if(!d)break;if(!(Q2(KB(d)|0,108006,7)|0)){TC(d,137483,280,1)|0;ko(b,d);fo(d,0);}else fo(d,b);d=PD(d)|0;}if(h?(e=c[g+8>>2]|0,f=a+16|0,c[(c[f>>2]|0)+180>>2]=e,e|0):0){h=MK(c[g>>2]|0,(e<<2)+4|0)|0;c[(c[f>>2]|0)+184>>2]=h;}l=i;return}function go(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=JK((tB(a)|0)<<2)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;g=a+16|0;c[(c[g>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;TC(b,137447,304,1)|0;c[(c[b+16>>2]|0)+112>>2]=f+(d<<2);c[(c[(c[g>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;ho(b);e=XA(a,b)|0;while(1){if(!e)break;io(e);e=ZA(a,e)|0;}b=kC(a,b)|0;d=d+1|0;}return}function ho(a){a=a|0;SA(a,108230,108236)|0;return}function io(a){a=a|0;TC(a,137460,304,1)|0;return}function jo(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function ko(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function lo(a){a=a|0;var b=0,d=0;b=jC(a)|0;if(b|0){U1(c[(c[b+16>>2]|0)+112>>2]|0);while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;YP(d);d=ZA(a,d)|0;}WP(b);b=kC(a,b)|0;}mo(a);}return}function mo(a){a=a|0;U1(c[(c[a+16>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function no(a){a=a|0;var d=0,e=0,f=0;oo(a);po(a,0);qo(a,0);ro(a,0);d=c[a+16>>2]|0;if(!(c[(c[d+8>>2]|0)+84>>2]|0)){d=b[d+136>>1]&14;if(d<<16>>16)Wm(a,d&65535)|0;}else {d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;e=c[f+132>>2]|0;h[e>>3]=+h[f+16>>3]*.013888888888888888;h[e+8>>3]=+h[f+24>>3]*.013888888888888888;d=kC(a,d)|0;}Zm(a,1);}tM(a);return}function oo(a){a=a|0;var d=0,e=0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;d=jC(a)|0;while(1){if(!d)break;Zl(d);d=kC(a,d)|0;}e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;TC(d,137460,176,1)|0;tP(d)|0;d=ZA(a,d)|0;}e=kC(a,e)|0;}return}function po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;h=(b|0)==0;if(h){wo(g);b=g;}d=OD(a)|0;while(1){if(!d)break;if(!(Q2(KB(d)|0,108006,7)|0)){TC(d,137483,280,1)|0;uK(d);xo(b,d);po(d,0);}else po(d,b);d=PD(d)|0;}if(h?(e=c[g+8>>2]|0,f=a+16|0,c[(c[f>>2]|0)+180>>2]=e,e|0):0){h=MK(c[g>>2]|0,(e<<2)+4|0)|0;c[(c[f>>2]|0)+184>>2]=h;}l=i;return}function qo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;Q=l;l=l+448|0;G=Q+400|0;F=Q+384|0;P=Q+344|0;O=Q+304|0;N=Q+248|0;D=Q+192|0;x=Q+152|0;y=Q+96|0;o=Q+72|0;d=Q+64|0;I=Q+32|0;J=Q;B=Q+416|0;u=Q+328|0;w=Q+288|0;K=Q+232|0;L=Q+176|0;M=Q+136|0;H=Q+80|0;n=c[a+60>>2]|0;if(0>1);E=a+16|0;f=b+1|0;d=1;e=0;while(1){g=c[E>>2]|0;if((d|0)>(c[g+180>>2]|0))break;C=c[(c[g+184>>2]|0)+(d<<2)>>2]|0;qo(C,f);d=d+1|0;e=(tB(C)|0)+e|0;}p=(tB(a)|0)-e|0;d=c[E>>2]|0;C=(c[d+180>>2]|0)+p|0;v=(C|0)==0;if(v?(c[d+12>>2]|0)==0:0){P=d+16|0;c[P>>2]=0;c[P+4>>2]=0;c[P+8>>2]=0;c[P+12>>2]=0;h[d+40>>3]=18.0;h[d+32>>3]=18.0;}else {d=B+16|0;do if((kH(a,4,4,B)|0)>>>0>=3)if((c[d>>2]|0)==4?(c[B+28>>2]&2|0)!=0:0){e=GA(n,0,99190,0)|0;d=GA(n,1,99190,0)|0;if((e|0)!=0|(d|0)!=0){c[B+24>>2]=JK(C<<2)|0;break}else {c[o>>2]=KB(a)|0;gA(0,90577,o)|0;d=0;e=0;break}}else {d=0;e=0;}else {c[d>>2]=3;d=0;e=0;}while(0);z=JK(C<<5)|0;A=JK(C<<2)|0;s=B+24|0;n=(e|0)!=0;r=0;g=1;while(1){f=c[E>>2]|0;if((g|0)>(c[f+180>>2]|0))break;f=c[(c[f+184>>2]|0)+(g<<2)>>2]|0;t=z+(r<<5)|0;q=(c[f+16>>2]|0)+16|0;c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[t+16>>2]=c[q+16>>2];c[t+20>>2]=c[q+20>>2];c[t+24>>2]=c[q+24>>2];c[t+28>>2]=c[q+28>>2];if(n&(c[s>>2]|0)!=0){t=ZO(f,e,0,0)|0;c[(c[s>>2]|0)+(r<<2)>>2]=t;}c[A+(r<<2)>>2]=f;r=r+1|0;g=g+1|0;}a:do if((p|0)>0){o=I+16|0;p=I+24|0;q=(d|0)!=0;n=jC(a)|0;e=r;while(1){if(!n)break a;f=c[n+16>>2]|0;g=f+112|0;if(!(c[g>>2]|0)){c[g>>2]=a;c[I>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;c[I+12>>2]=0;h[o>>3]=+h[f+96>>3]+ +h[f+88>>3];h[p>>3]=+h[f+80>>3];t=z+(e<<5)|0;c[t>>2]=c[I>>2];c[t+4>>2]=c[I+4>>2];c[t+8>>2]=c[I+8>>2];c[t+12>>2]=c[I+12>>2];c[t+16>>2]=c[I+16>>2];c[t+20>>2]=c[I+20>>2];c[t+24>>2]=c[I+24>>2];c[t+28>>2]=c[I+28>>2];if(q&(c[s>>2]|0)!=0){t=ZO(n,d,0,0)|0;c[(c[s>>2]|0)+(e<<2)>>2]=t;}c[A+(e<<2)>>2]=n;e=e+1|0;}n=kC(a,n)|0;}}while(0);t=dH(C,z,B)|0;d=c[s>>2]|0;if(d|0)U1(d);to(J,2147483647.0,2147483647.0);s=J+16|0;to(u,-2147483647.0,-2147483647.0);c[s>>2]=c[u>>2];c[s+4>>2]=c[u+4>>2];c[s+8>>2]=c[u+8>>2];c[s+12>>2]=c[u+12>>2];g=I+16|0;n=I+8|0;o=I+24|0;p=J+8|0;q=J+24|0;r=c[15712]|0;d=0;while(1){if((d|0)>=(C|0))break;j=+(c[t+(d<<3)>>2]|0);m=+(c[t+(d<<3)+4>>2]|0);e=z+(d<<5)|0;c[I>>2]=c[e>>2];c[I+4>>2]=c[e+4>>2];c[I+8>>2]=c[e+8>>2];c[I+12>>2]=c[e+12>>2];c[I+16>>2]=c[e+16>>2];c[I+20>>2]=c[e+20>>2];c[I+24>>2]=c[e+24>>2];c[I+28>>2]=c[e+28>>2];i=+h[I>>3]+j;h[I>>3]=i;j=+h[g>>3]+j;h[g>>3]=j;k=+h[n>>3]+m;h[n>>3]=k;m=+h[o>>3]+m;h[o>>3]=m;h[J>>3]=+h[(+h[J>>3]>3];h[p>>3]=+h[(+h[p>>3]>3];h[s>>3]=+h[(+h[s>>3]>j?J:I)+16>>3];h[q>>3]=+h[(+h[q>>3]>m?J:I)+24>>3];e=c[A+(d<<2)>>2]|0;f=e+16|0;if((d|0)<(c[(c[E>>2]|0)+180>>2]|0)){u=(c[f>>2]|0)+16|0;c[u>>2]=c[I>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[u+12>>2]=c[I+12>>2];c[u+16>>2]=c[I+16>>2];c[u+20>>2]=c[I+20>>2];c[u+24>>2]=c[I+24>>2];c[u+28>>2]=c[I+28>>2];if(0>1);}else {u=(c[f>>2]|0)+16|0;c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];c[F+8>>2]=c[I+8>>2];c[F+12>>2]=c[I+12>>2];c[G>>2]=c[g>>2];c[G+4>>2]=c[g+4>>2];c[G+8>>2]=c[g+8>>2];c[G+12>>2]=c[g+12>>2];uo(w,F,G);c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];if(0>1);}d=d+1|0;}e=c[E>>2]|0;d=c[e+12>>2]|0;if(d|0){i=+h[d+24>>3];if(v){j=+h[d+32>>3];c[J>>2]=0;c[J+4>>2]=0;c[J+8>>2]=0;c[J+12>>2]=0;h[s>>3]=i;h[q>>3]=j;j=0.0;k=i;}else {j=+h[J>>3];k=+h[s>>3];}m=i-(k-j);i=m*.5;if(m>0.0){h[J>>3]=j-i;h[s>>3]=k+i;}}if((b|0)>0)i=+((c[B+8>>2]|0)>>>0)*.5;else i=0.0;j=+h[J>>3]-i;h[J>>3]=j;k=+h[s>>3]+i;h[s>>3]=k;m=-i-+h[e+56>>3]+ +h[p>>3];h[p>>3]=m;i=+h[e+88>>3]+i+ +h[q>>3];h[q>>3]=i;if(0>1);d=0;while(1){if((d|0)>=(C|0))break;e=c[A+(d<<2)>>2]|0;f=e+16|0;if((d|0)<(c[(c[E>>2]|0)+180>>2]|0)){D=(c[f>>2]|0)+16|0;c[I>>2]=c[D>>2];c[I+4>>2]=c[D+4>>2];c[I+8>>2]=c[D+8>>2];c[I+12>>2]=c[D+12>>2];c[I+16>>2]=c[D+16>>2];c[I+20>>2]=c[D+20>>2];c[I+24>>2]=c[D+24>>2];c[I+28>>2]=c[D+28>>2];c[F>>2]=c[D>>2];c[F+4>>2]=c[D+4>>2];c[F+8>>2]=c[D+8>>2];c[F+12>>2]=c[D+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(I,F,G);c[F>>2]=c[g>>2];c[F+4>>2]=c[g+4>>2];c[F+8>>2]=c[g+8>>2];c[F+12>>2]=c[g+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(K,F,G);c[g>>2]=c[K>>2];c[g+4>>2]=c[K+4>>2];c[g+8>>2]=c[K+8>>2];c[g+12>>2]=c[K+12>>2];D=(c[f>>2]|0)+16|0;c[D>>2]=c[I>>2];c[D+4>>2]=c[I+4>>2];c[D+8>>2]=c[I+8>>2];c[D+12>>2]=c[I+12>>2];c[D+16>>2]=c[I+16>>2];c[D+20>>2]=c[I+20>>2];c[D+24>>2]=c[I+24>>2];c[D+28>>2]=c[I+28>>2];if(0>1);}else {D=(c[f>>2]|0)+16|0;c[F>>2]=c[D>>2];c[F+4>>2]=c[D+4>>2];c[F+8>>2]=c[D+8>>2];c[F+12>>2]=c[D+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(L,F,G);c[D>>2]=c[L>>2];c[D+4>>2]=c[L+4>>2];c[D+8>>2]=c[L+8>>2];c[D+12>>2]=c[L+12>>2];if(0>1);}d=d+1|0;}c[F>>2]=c[s>>2];c[F+4>>2]=c[s+4>>2];c[F+8>>2]=c[s+8>>2];c[F+12>>2]=c[s+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(M,F,G);c[s>>2]=c[M>>2];c[s+4>>2]=c[M+4>>2];c[s+8>>2]=c[M+8>>2];c[s+12>>2]=c[M+12>>2];c[F>>2]=c[J>>2];c[F+4>>2]=c[J+4>>2];c[F+8>>2]=c[J+8>>2];c[F+12>>2]=c[J+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(H,F,G);c[J>>2]=c[H>>2];c[J+4>>2]=c[H+4>>2];c[J+8>>2]=c[H+8>>2];c[J+12>>2]=c[H+12>>2];O=(c[E>>2]|0)+16|0;c[O>>2]=c[J>>2];c[O+4>>2]=c[J+4>>2];c[O+8>>2]=c[J+8>>2];c[O+12>>2]=c[J+12>>2];c[O+16>>2]=c[J+16>>2];c[O+20>>2]=c[J+20>>2];c[O+24>>2]=c[J+24>>2];c[O+28>>2]=c[J+28>>2];if(0>1);U1(z);U1(A);U1(t);}l=Q;return}function ro(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0;t=l;l=l+80|0;s=t+32|0;i=t+8|0;d=t;r=a+16|0;o=c[r>>2]|0;p=+h[o+16>>3];q=+h[o+24>>3];if(0>1);o=(b|0)!=0;a:do if(o){d=jC(a)|0;e=c[15712]|0;while(1){if(!d)break a;f=d+16|0;g=c[f>>2]|0;if((c[g+112>>2]|0)==(a|0)?(u=g+16|0,h[u>>3]=+h[u>>3]+p,g=g+24|0,h[g>>3]=+h[g>>3]+q,0>1):0){so(b);u=KB(d)|0;g=c[f>>2]|0;m=+h[g+16>>3];n=+h[g+24>>3];c[i>>2]=u;h[i+8>>3]=m;h[i+16>>3]=n;w4(e,90544,i)|0;}d=kC(a,d)|0;}}else e=c[15712]|0;while(0);i=b+1|0;a=1;while(1){d=c[r>>2]|0;if((a|0)>(c[d+180>>2]|0))break;g=c[(c[d+184>>2]|0)+(a<<2)>>2]|0;if(o){f=g+16|0;d=c[f>>2]|0;j=+h[d+16>>3]+p;k=+h[d+24>>3]+q;m=+h[d+32>>3]+p;n=+h[d+40>>3]+q;if(0>1);h[d+16>>3]=j;h[d+24>>3]=k;h[d+32>>3]=m;h[d+40>>3]=n;}ro(g,i);a=a+1|0;}l=t;return}function so(a){a=a|0;var b=0;b=c[15712]|0;while(1){if((a|0)<=0)break;T4(90574,b)|0;a=a+-1|0;}return}function to(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function uo(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function vo(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function wo(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function xo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function yo(a){a=a|0;var b=0;b=jC(a)|0;while(1){if(!b)break;WP(b);b=kC(a,b)|0;}zo(a);return}function zo(a){a=a|0;var b=0,d=0,e=0;b=a+16|0;a=1;while(1){e=c[b>>2]|0;d=c[e+184>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[d+(a<<2)>>2]|0;CK(c[(c[e+16>>2]|0)+12>>2]|0);zo(e);a=a+1|0;}U1(d);return}function Ao(a){a=a|0;var b=0,d=0,e=0;YC(a,1,137447,304,1);HP(a)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;e=a+16|0;c[(c[e>>2]|0)+152>>2]=b;b=0;d=jC(a)|0;while(1){if(!d)break;Bo(d);c[(c[(c[e>>2]|0)+152>>2]|0)+(b<<2)>>2]=d;c[(c[d+16>>2]|0)+120>>2]=b;b=b+1|0;d=kC(a,d)|0;}e=GA(a,2,92493,0)|0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Co(b,e);b=ZA(a,b)|0;}d=kC(a,d)|0;}Do(a);return}function Bo(a){a=a|0;var b=0;sP(a);b=JK((e[(c[(xC(a)|0)+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[a+16>>2]|0)+132>>2]=b;qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);return}function Co(a,b){a=a|0;b=b|0;var d=0,e=0.0;TC(a,137460,176,1)|0;e=+_O(a,c[47174]|0,1.0,0.0);d=a+16|0;h[(c[d>>2]|0)+128>>3]=e;e=+_O(a,b,+h[1371],0.0);h[(c[d>>2]|0)+136>>3]=e;tP(a)|0;return}function Do(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;r=l;l=l+32|0;q=r+16|0;p=r;m=r+24|0;n=GA(b,1,102623,0)|0;a:do if(n|0){o=GA(b,1,90660,0)|0;i=b+16|0;j=(o|0)==0;k=c[15712]|0;g=0;while(1){e=c[(c[(c[i>>2]|0)+152>>2]|0)+(g<<2)>>2]|0;if(!e)break a;b=RA(e,n)|0;do if(a[b>>0]|0){f=e+16|0;d=c[(c[f>>2]|0)+132>>2]|0;a[m>>0]=0;c[p>>2]=d;c[p+4>>2]=d+8;c[p+8>>2]=m;if((b5(b,101749,p)|0)<=1){c[q>>2]=KB(e)|0;c[q+4>>2]=b;w4(k,90664,q)|0;break}b:do if(+h[23293]>0.0){b=0;while(1){if((b|0)==2)break b;s=d+(b<<3)|0;h[s>>3]=+h[s>>3]/+h[23293];b=b+1|0;}}while(0);b=c[f>>2]|0;a[b+119>>0]=1;if((a[m>>0]|0)!=33){if(j)break;if(!((dP(RA(e,o)|0)|0)<<24>>24))break;b=c[f>>2]|0;}a[b+119>>0]=3;}while(0);g=g+1|0;}}while(0);l=r;return}function Eo(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}Fo(a);return}function Fo(a){a=a|0;Go(a);a=a+16|0;U1(c[(c[a>>2]|0)+152>>2]|0);U1(c[(c[a>>2]|0)+140>>2]|0);return}function Go(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=a+16|0;f=1;while(1){e=c[g>>2]|0;b=c[e+184>>2]|0;if((f|0)>(c[e+180>>2]|0))break;e=c[b+(f<<2)>>2]|0;b=e+16|0;CK(c[(c[b>>2]|0)+12>>2]|0);d=c[(c[b>>2]|0)+140>>2]|0;if(d|0){U1(c[d>>2]|0);U1(c[(c[b>>2]|0)+140>>2]|0);}Go(e);f=f+1|0;}U1(b);if((yC(a)|0)!=(a|0))VC(a,137483)|0;return}function Ho(a,b){a=a|0;b=b|0;c[b+4>>2]=GA(a,0,90716,0)|0;c[b+8>>2]=GA(a,0,141116,0)|0;c[b+12>>2]=GA(a,0,141048,0)|0;c[b>>2]=a;c[b+16>>2]=0;c[b+36>>2]=kH(a,2,4,b+20|0)|0;return}function Io(a){a=a|0;var d=0,e=0;oQ(a,2);d=JK(56)|0;e=a+16|0;c[(c[e>>2]|0)+140>>2]=d;d=(ZO(a,GA(a,0,91374,0)|0,2,2)|0)&65535;d=(d&65535)<10?d:10;b[(c[e>>2]|0)+176>>1]=d;c[47137]=d&65535;Jo(a,0,a);fp(a);Ao(a);return}function Jo(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;m=l;l=l+16|0;j=m;k=(d|0)==0;if(k){Ko(j);d=j;}g=e+16|0;f=OD(a)|0;while(1){if(!f)break;if(!(Q2(KB(f)|0,108006,7)|0)){TC(f,137483,280,1)|0;n=JK(56)|0;p=c[f+16>>2]|0;c[p+140>>2]=n;o=c[g>>2]|0;b[p+176>>1]=b[o+176>>1]|0;c[n+44>>2]=(c[(c[o+140>>2]|0)+44>>2]|0)+1;c[n+48>>2]=e;Lo(d,f);Jo(f,0,f);}else Jo(f,d,e);f=PD(f)|0;}if(k?(h=c[j+8>>2]|0,i=a+16|0,c[(c[i>>2]|0)+180>>2]=h,h|0):0){p=MK(c[j>>2]|0,(h<<2)+4|0)|0;c[(c[i>>2]|0)+184>>2]=p;}l=m;return}function Ko(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function Lo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function Mo(a){a=a|0;var b=0,c=0;b=l;l=l+64|0;c=b;Ho(a,c);No(a,c);Oo(a);Po(a,a);Qo(a);l=b;return}function No(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0,w=0.0,x=0.0;s=l;l=l+64|0;r=s+48|0;e=s+40|0;o=s+56|0;n=s+52|0;m=s;if(0);e=jC(b)|0;while(1){if(!e)break;c[(c[e+16>>2]|0)+164>>2]=0;e=kC(b,e)|0;}p=Ro(b,d)|0;q=Iv(p,o,n)|0;e=q;while(1){k=e+4|0;f=c[e>>2]|0;if(!f)break;gp(f,m);e=jC(f)|0;while(1){if(!e)break;g=kC(f,e)|0;i=e+16|0;j=c[i>>2]|0;if(c[j+212>>2]|0){v=So(e,f)|0;No(v,d);v=c[(c[v+16>>2]|0)+140>>2]|0;u=+h[v+24>>3];j=c[i>>2]|0;h[j+32>>3]=u;t=+h[v+32>>3];h[j+40>>3]=t;u=u*36.0;h[j+88>>3]=u;h[j+96>>3]=u;h[j+80>>3]=t*72.0;e=g;continue}if(c[(c[j+112>>2]|0)+8>>2]|0){e=g;continue}wC(f,e)|0;e=g;}if((tB(f)|0)<=1){e=k;continue}if((c[d>>2]|0)==(b|0))Lq(f)|0;tp(f,m);e=k;}e=c[o>>2]|0;if((e|0)<=1)if((e|0)==1){BP(c[q>>2]|0);e=0;}else e=0;else {if(!(c[n>>2]|0))f=0;else {f=JK(e)|0;a[f>>0]=1;e=c[o>>2]|0;}c[d+40>>2]=f;e=QG(e,q,0,d+20|0)|0;U1(f);}To(p,c[o>>2]|0,q,e,b,d);U1(e);f=jC(p)|0;while(1){if(!f)break;g=c[f+16>>2]|0;e=c[g+212>>2]|0;if(!e){e=c[(c[g+112>>2]|0)+8>>2]|0;if(e|0){o=c[g+132>>2]|0;v=c[(c[e+16>>2]|0)+132>>2]|0;h[v>>3]=+h[o>>3];h[v+8>>3]=+h[o+8>>3];}}else {o=c[g+132>>2]|0;x=+h[g+32>>3];w=+h[o>>3]-x*.5;v=c[(c[e+16>>2]|0)+140>>2]|0;h[v+8>>3]=w;t=+h[g+40>>3];u=+h[o+8>>3]-t*.5;h[v+16>>3]=u;h[v+24>>3]=x+w;h[v+32>>3]=t+u;}f=kC(p,f)|0;}v=(c[(c[b+16>>2]|0)+140>>2]|0)+8|0;o=(c[(c[p+16>>2]|0)+140>>2]|0)+8|0;c[v>>2]=c[o>>2];c[v+4>>2]=c[o+4>>2];c[v+8>>2]=c[o+8>>2];c[v+12>>2]=c[o+12>>2];c[v+16>>2]=c[o+16>>2];c[v+20>>2]=c[o+20>>2];c[v+24>>2]=c[o+24>>2];c[v+28>>2]=c[o+28>>2];Uo(p,q);U1(q);if(0);l=s;return}function Oo(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;if(a[e+118>>0]|0){k=c[(c[(c[e+212>>2]|0)+16>>2]|0)+140>>2]|0;j=+h[k+24>>3]-+h[k+8>>3];i=+h[k+32>>3]-+h[k+16>>3];g=j*36.0;f=i*36.0;k=c[e+132>>2]|0;h[k>>3]=j*.5;h[k+8>>3]=i*.5;h[e+32>>3]=j;h[e+40>>3]=i;h[e+96>>3]=g;h[e+88>>3]=g;h[e+80>>3]=i*72.0;e=c[(c[e+12>>2]|0)+44>>2]|0;h[e>>3]=g;h[e+8>>3]=f;i=-g;h[e+16>>3]=i;h[e+24>>3]=f;h[e+32>>3]=i;f=-f;h[e+40>>3]=f;h[e+48>>3]=g;h[e+56>>3]=f;}d=kC(b,d)|0;}return}function Po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0,k=0.0,l=0,m=0.0,n=0,o=0.0,p=0;i=a+16|0;j=c[(c[i>>2]|0)+140>>2]|0;f=+h[j+8>>3];g=+h[j+16>>3];j=(a|0)!=(b|0);a:do if(j){d=jC(a)|0;while(1){if(!d){a=1;break a}e=c[d+16>>2]|0;if((c[e+212>>2]|0)==(a|0)){e=c[e+132>>2]|0;h[e>>3]=+h[e>>3]+f;e=e+8|0;h[e>>3]=+h[e>>3]+g;}d=kC(a,d)|0;}}else a=1;while(0);while(1){d=c[i>>2]|0;if((a|0)>(c[d+180>>2]|0))break;d=c[(c[d+184>>2]|0)+(a<<2)>>2]|0;if(j){e=c[(c[d+16>>2]|0)+140>>2]|0;p=e+8|0;n=e+16|0;l=e+24|0;e=e+32|0;o=+h[n>>3]+g;m=+h[l>>3]+f;k=+h[e>>3]+g;h[p>>3]=+h[p>>3]+f;h[n>>3]=o;h[l>>3]=m;h[e>>3]=k;}Po(d,b);a=a+1|0;}return}function Qo(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0;b=a+16|0;a=c[b>>2]|0;d=c[a+140>>2]|0;g=+h[d+16>>3]*72.0;f=+h[d+24>>3]*72.0;e=+h[d+32>>3]*72.0;h[a+16>>3]=+h[d+8>>3]*72.0;h[a+24>>3]=g;h[a+32>>3]=f;h[a+40>>3]=e;a=1;while(1){d=c[b>>2]|0;if((a|0)>(c[d+180>>2]|0))break;Qo(c[(c[d+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}return}function Ro(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+160|0;s=y+24|0;t=y+8|0;g=y;f=y+56|0;w=e+16|0;x=c[w>>2]|0;c[w>>2]=x+1;c[s>>2]=x;m4(f,90796,s)|0;if(0>1);;a[s>>0]=a[18588]|0;a[s+1>>0]=a[18589]|0;a[s+2>>0]=a[18590]|0;a[s+3>>0]=a[18591]|0;x=oB(91156,s,0)|0;TC(x,137483,280,1)|0;v=JK(56)|0;w=x+16|0;o=c[w>>2]|0;c[o+140>>2]=v;v=d+16|0;b[o+176>>1]=b[(c[v>>2]|0)+176>>1]|0;_o(d,x,92507);_o(d,x,93112);_o(d,x,91202);o=e+4|0;p=s+16|0;q=s+8|0;r=s+24|0;j=0;n=1;while(1){f=c[v>>2]|0;if((n|0)>(c[f+180>>2]|0))break;c[s>>2]=c[332];c[s+4>>2]=c[333];c[s+8>>2]=c[334];c[s+12>>2]=c[335];c[s+16>>2]=c[336];c[s+20>>2]=c[337];c[s+24>>2]=c[338];c[s+28>>2]=c[339];g=c[(c[f+184>>2]|0)+(n<<2)>>2]|0;uK(g);i=$o(x,KB(g)|0)|0;k=i+16|0;f=c[k>>2]|0;c[f+212>>2]=g;m=j+1|0;c[f+120>>2]=j;if(c[o>>2]|0)ap(g,i,e,s);f=jC(g)|0;while(1){if(!f)break;c[(c[f+16>>2]|0)+164>>2]=i;f=kC(g,f)|0;}f=c[k>>2]|0;if(a[f+119>>0]|0){k=c[f+132>>2]|0;h[k>>3]=(+h[p>>3]+ +h[s>>3])*.5;h[k+8>>3]=(+h[r>>3]+ +h[q>>3])*.5;}j=m;n=n+1|0;}k=jC(d)|0;while(1){if(!k)break;f=k+16|0;g=c[f>>2]|0;if(!(c[g+164>>2]|0)){i=g+212|0;s=c[i>>2]|0;if(s|0?(s|0)!=(c[(c[(c[v>>2]|0)+140>>2]|0)+48>>2]|0):0){u=18;break}c[i>>2]=d;if(!(a[g+118>>0]|0)){i=$o(x,KB(k)|0)|0;g=c[f>>2]|0;c[g+164>>2]=i;i=c[i+16>>2]|0;c[i+120>>2]=j;h[i+32>>3]=+h[g+32>>3];h[i+40>>3]=+h[g+40>>3];h[i+88>>3]=+h[g+88>>3];h[i+96>>3]=+h[g+96>>3];h[i+80>>3]=+h[g+80>>3];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];f=a[g+119>>0]|0;if(f<<24>>24){e=c[g+132>>2]|0;s=c[i+132>>2]|0;h[s>>3]=+h[e>>3];h[s+8>>3]=+h[e+8>>3];a[i+119>>0]=f;}c[(c[i+112>>2]|0)+8>>2]=k;f=j+1|0;}else f=j;}else f=j;k=kC(d,k)|0;j=f;}if((u|0)==18){e=KB(k)|0;s=KB(d)|0;u=KB(c[(c[f>>2]|0)+212>>2]|0)|0;c[t>>2]=e;c[t+4>>2]=s;c[t+8>>2]=u;gA(1,90826,t)|0;bb(187212,1);}m=jC(d)|0;while(1){if(!m)break;n=c[(c[m+16>>2]|0)+164>>2]|0;o=n+16|0;i=XA(d,m)|0;while(1){if(!i)break;f=c[(c[(c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+164>>2]|0;if((f|0)!=(n|0)){if(f>>>0>n>>>0)k=iB(x,n,f,0,1)|0;else k=iB(x,f,n,0,1)|0;TC(k,137460,176,1)|0;g=c[i+16>>2]|0;u=c[k+16>>2]|0;h[u+136>>3]=+h[g+136>>3];h[u+128>>3]=+h[g+128>>3];f=c[(c[f+16>>2]|0)+112>>2]|0;g=f+4|0;c[g>>2]=(c[g>>2]|0)+1;g=c[(c[o>>2]|0)+112>>2]|0;t=g+4|0;c[t>>2]=(c[t>>2]|0)+1;if(!(c[u+172>>2]|0)){c[f>>2]=(c[f>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+1;}bp(k,i);}i=ZA(d,i)|0;}m=kC(d,m)|0;}f=c[(c[v>>2]|0)+140>>2]|0;g=c[f>>2]|0;if(g|0){i=JK((c[f+4>>2]<<4)+16|0)|0;c[c[(c[w>>2]|0)+140>>2]>>2]=i;f=0;while(1){if(!(c[g>>2]|0))break;m=c[(c[(c[g+4>>2]|0)+16>>2]|0)+164>>2]|0;if(m){cp(d,g);n=$o(x,193772)|0;o=n+16|0;c[(c[o>>2]|0)+120>>2]=j;if(n>>>0>m>>>0)k=iB(x,m,n,0,1)|0;else k=iB(x,n,m,0,1)|0;TC(k,137460,176,1)|0;u=c[g>>2]|0;t=c[u+16>>2]|0;v=c[k+16>>2]|0;h[v+136>>3]=+h[t+136>>3];h[v+128>>3]=+h[t+128>>3];bp(k,u);u=c[(c[o>>2]|0)+112>>2]|0;v=u+4|0;c[v>>2]=(c[v>>2]|0)+1;v=c[(c[m+16>>2]|0)+112>>2]|0;t=v+4|0;c[t>>2]=(c[t>>2]|0)+1;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+1;c[i+4>>2]=n;h[i+8>>3]=+h[g+8>>3];c[i>>2]=k;f=f+1|0;i=i+16|0;j=j+1|0;}g=g+16|0;}c[(c[(c[w>>2]|0)+140>>2]|0)+4>>2]=f;}l=y;return x|0}function So(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;l=c[a+16>>2]|0;k=c[l+212>>2]|0;l=c[(c[l+112>>2]|0)+4>>2]|0;do if(l|0){j=JK((l<<4)+16|0)|0;f=Xo(a,b)|0;g=f+8|0;b=0;e=f;while(1){if(!(c[e>>2]|0))break;i=e+24|0;if(!(c[i>>2]|0))d=+h[g>>3]+6.283185307179586;else d=+h[e+32>>3];b=Yo(a,e,j,b,d)|0;e=i;}if((b|0)==(l|0)){a=c[(c[k+16>>2]|0)+140>>2]|0;c[a>>2]=j;c[a+4>>2]=l;U1(f);break}else qa(90742,90752,766,90761);}while(0);return k|0}function To(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0.0;B=l;l=l+32|0;x=B+16|0;A=B;m=c[g+8>>2]|0;j=c[g+12>>2]|0;y=(c[g>>2]|0)==(f|0);z=(b|0)!=0;a:do if(z){p=c[(c[d>>2]|0)+16>>2]|0;k=+h[p+16>>3];m=~~(k+(k>=0.0?.5:-.5));c[A>>2]=m;k=+h[p+24>>3];g=~~(k+(k>=0.0?.5:-.5));u=A+4|0;c[u>>2]=g;k=+h[p+32>>3];n=~~(k+(k>=0.0?.5:-.5));v=A+8|0;c[v>>2]=n;k=+h[p+40>>3];p=~~(k+(k>=0.0?.5:-.5));w=A+12|0;c[w>>2]=p;if((b|0)>1){q=c[e>>2]|0;t=c[e+4>>2]|0;m=q+m|0;c[A>>2]=m;b=t+g|0;c[u>>2]=b;n=q+n|0;c[v>>2]=n;q=x+4|0;r=x+8|0;s=x+12|0;o=e;g=d;t=t+p|0;p=b;while(1){g=g+4|0;j=o+8|0;c[w>>2]=t;b=c[g>>2]|0;if(!b){j=0;r=p;s=t;break a}E=c[b+16>>2]|0;G=+h[E+16>>3];i=+h[E+24>>3];k=+h[E+32>>3];H=+h[E+40>>3];E=~~(H+(H>=0.0?.5:-.5));c[s>>2]=E;b=c[j>>2]|0;F=c[o+12>>2]|0;D=b+~~(G+(G>=0.0?.5:-.5))|0;c[x>>2]=D;C=F+~~(i+(i>=0.0?.5:-.5))|0;c[q>>2]=C;b=b+~~(k+(k>=0.0?.5:-.5))|0;c[r>>2]=b;E=F+E|0;c[s>>2]=E;D=c[((m|0)<(D|0)?A:x)>>2]|0;c[A>>2]=D;C=c[((p|0)<(C|0)?A:x)+4>>2]|0;c[u>>2]=C;b=c[((n|0)>(b|0)?A:x)+8>>2]|0;c[v>>2]=b;o=j;t=c[((t|0)>(E|0)?A:x)+12>>2]|0;m=D;p=C;n=b;}}else {j=0;r=g;s=p;}}else {c[A>>2]=0;c[A+4>>2]=0;n=ZO(f,m,54,3)|0;c[A+8>>2]=n;s=ZO(f,j,36,3)|0;c[A+12>>2]=s;j=1;m=0;r=0;}while(0);b=f+16|0;o=c[b>>2]|0;g=c[o+12>>2]|0;if(g){H=+h[g+24>>3];g=m-n+~~(H+(H>=0.0?.5:-.5))|0;if((g|0)>0){g=g>>>1;m=m-g|0;c[A>>2]=m;n=n+g|0;c[A+8>>2]=n;g=0;}else g=0;}else g=j;if(y|(g|0)!=0){j=0;g=o;}else {j=ZO(a,c[47144]|0,8,0)|0;g=c[b>>2]|0;}q=j-m|0;p=~~(+h[g+56>>3]+ +(j-r|0));c[A>>2]=0;c[A+4>>2]=0;o=q+j+n|0;c[A+8>>2]=o;b=~~(+h[g+88>>3]+ +(j+p|0)+ +(s|0));c[A+12>>2]=b;b:do if(z){g=e;c:while(1){n=d+4|0;j=c[d>>2]|0;if(!j)break b;if(!g){m=0;d=q;g=p;}else {m=g+8|0;d=(c[g>>2]|0)+q|0;g=(c[g+4>>2]|0)+p|0;}k=+(d|0)*.013888888888888888;i=+(g|0)*.013888888888888888;d=jC(j)|0;while(1){if(!d){d=n;g=m;continue c}F=c[(c[d+16>>2]|0)+132>>2]|0;h[F>>3]=+h[F>>3]+k;F=F+8|0;h[F>>3]=+h[F>>3]+i;d=kC(j,d)|0;}}}while(0);F=c[(c[a+16>>2]|0)+140>>2]|0;E=F+8|0;c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;h[F+24>>3]=+(o|0)*.013888888888888888;h[F+32>>3]=+(b|0)*.013888888888888888;l=B;return}function Uo(a,b){a=a|0;b=b|0;var d=0,e=0;while(1){d=c[b>>2]|0;if(!d)break;Vo(d);VC(d,137483)|0;b=b+4|0;}b=c[c[(c[a+16>>2]|0)+140>>2]>>2]|0;if(b|0)U1(b);Vo(a);VC(a,137483)|0;d=jC(a)|0;while(1){if(!d)break;e=kC(a,d)|0;b=XA(a,d)|0;while(1){if(!b)break;U1(c[(c[b+16>>2]|0)+172>>2]|0);VC(b,137460)|0;b=ZA(a,b)|0;}Wo(d);d=e;}sB(a)|0;return}function Vo(a){a=a|0;U1(c[(c[a+16>>2]|0)+140>>2]|0);return}function Wo(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+112>>2]|0);U1(c[(c[b>>2]|0)+132>>2]|0);VC(a,137447)|0;return}function Xo(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0.0,i=0,j=0,k=0,l=0,m=0;k=a+16|0;l=c[c[(c[k>>2]|0)+112>>2]>>2]|0;m=JK((l*24|0)+24|0)|0;i=0;j=aB(b,a)|0;while(1){if(!j)break;f=c[j>>2]&3;e=c[((f|0)==2?j:j+-48|0)+40>>2]|0;if((e|0)==(a|0))e=c[((f|0)==3?j:j+48|0)+40>>2]|0;e=c[(c[e+16>>2]|0)+132>>2]|0;f=c[(c[k>>2]|0)+132>>2]|0;g=+h[e>>3]-+h[f>>3];d=+h[e+8>>3]-+h[f+8>>3];c[m+(i*24|0)>>2]=j;h[m+(i*24|0)+8>>3]=+K(+d,+g);h[m+(i*24|0)+16>>3]=d*d+g*g;i=i+1|0;j=bB(b,j,a)|0;}if((i|0)!=(l|0))qa(90775,90752,642,90784);o4(m,l,24,67);a:do if((l|0)>1){j=l+-1|0;e=0;b:while(1){if((e|0)>=(j|0))break a;g=+h[m+(e*24|0)+8>>3];f=e+1|0;i=f;while(1){if((i|0)>=(l|0))break;if(!(+h[m+(i*24|0)+8>>3]==g))break;i=i+1|0;}if((i|0)==(f|0)){e=f;continue}if((i|0)==(l|0))d=3.141592653589793;else d=+h[m+(i*24|0)+8>>3];d=(d-g)/+(i-e|0);d=d>.03490658503988659?.03490658503988659:d;g=0.0;while(1){if((e|0)>=(i|0))continue b;k=m+(e*24|0)+8|0;h[k>>3]=+h[k>>3]+g;g=g+d;e=e+1|0;}}}while(0);return m|0}function Yo(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0.0,q=0;k=c[d>>2]|0;n=c[k+16>>2]|0;m=b[n+168>>1]|0;o=m<<16>>16;j=c[k>>2]&3;i=c[((j|0)==2?k:k+-48|0)+40>>2]|0;if((i|0)==(a|0))i=c[((j|0)==3?k:k+48|0)+40>>2]|0;p=+h[d+8>>3];g=(g-p)/+(m<<16>>16);g=g>.03490658503988659?.03490658503988659:g;m=i>>>0>a>>>0;l=m?g:-g;d=m?1:-1;k=0;i=c[n+172>>2]|0;j=m?f:f+-1+o|0;g=m?p:g*+(o+-1|0)+p;while(1){if((k|0)>=(o|0))break;n=c[i>>2]|0;c[e+(j<<4)>>2]=n;m=c[n>>2]&3;q=(m|0)==3?n:n+48|0;c[e+(j<<4)+4>>2]=c[((c[(c[(c[q+40>>2]|0)+16>>2]|0)+164>>2]|0)==(a|0)?q:(m|0)==2?n:n+-48|0)+40>>2];h[e+(j<<4)+8>>3]=g;k=k+1|0;i=i+4|0;j=j+d|0;g=g+l;}return o+f|0}function Zo(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(c>d))if(!(c>3];c=+h[b+16>>3];if(d>c)a=1;else a=(d>31;}else a=-1;else a=1;return a|0}function _o(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=GA(a,0,c,0)|0;do if(d|0){a=RA(a,d)|0;d=GA(b,0,c,0)|0;if(!d){GA(b,0,c,a)|0;break}else {KA(b,d,a)|0;break}}while(0);return}function $o(a,b){a=a|0;b=b|0;var d=0,f=0;b=tC(a,b,1)|0;TC(b,137447,304,1)|0;f=JK(32)|0;d=b+16|0;c[(c[d>>2]|0)+112>>2]=f;a=KK((e[(c[a+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[d>>2]|0)+132>>2]=a;return b|0}function ap(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+80|0;n=q+56|0;m=q+32|0;p=q;o=q+64|0;i=c[e+4>>2]|0;k=RA(b,i)|0;do if(a[k>>0]|0){if((c[e>>2]|0)!=(b|0)){e=RA(QD(b)|0,i)|0;if((e|0)==(k|0))break;if(!(s2(k,e)|0))break}a[o>>0]=0;e=p+8|0;i=p+16|0;j=p+24|0;c[m>>2]=p;c[m+4>>2]=e;c[m+8>>2]=i;c[m+12>>2]=j;c[m+16>>2]=o;if((b5(k,90937,m)|0)<=3){c[n>>2]=KB(b)|0;c[n+4>>2]=k;gA(0,90955,n)|0;break}g=+h[23293];if(g>0.0){h[p>>3]=+h[p>>3]/g;h[e>>3]=+h[e>>3]/g;h[i>>3]=+h[i>>3]/g;h[j>>3]=+h[j>>3]/g;}e=a[o>>0]|0;if(e<<24>>24==33)a[(c[d+16>>2]|0)+119>>0]=3;else a[(c[d+16>>2]|0)+119>>0]=e<<24>>24==63?2:1;c[f>>2]=c[p>>2];c[f+4>>2]=c[p+4>>2];c[f+8>>2]=c[p+8>>2];c[f+12>>2]=c[p+12>>2];c[f+16>>2]=c[p+16>>2];c[f+20>>2]=c[p+20>>2];c[f+24>>2]=c[p+24>>2];c[f+28>>2]=c[p+28>>2];}while(0);l=q;return}function bp(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=a+16|0;f=c[g>>2]|0;a=b[f+168>>1]|0;f=c[f+172>>2]|0;if(!f){a=a<<16>>16;e=a;a=KK((a<<2)+4|0)|0;}else {a=a<<16>>16;e=a;a=MK(f,(a<<2)+4|0)|0;}c[a+(e<<2)>>2]=d;d=c[g>>2]|0;c[d+172>>2]=a;d=d+168|0;b[d>>1]=(b[d>>1]|0)+1<<16>>16;return}function cp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+48|0;h=i+24|0;g=i;e=c[b>>2]|0;d=c[e>>2]&3;f=c[((d|0)==2?e:e+-48|0)+40>>2]|0;d=c[((d|0)==3?e:e+48|0)+40>>2]|0;b=l2(KB(a)|0)|0;j=l2(KB(f)|0)|0;j=(b+8+j+(l2(KB(d)|0)|0)|0)>999;b=KB(a)|0;if(j){d=KB(d)|0;j=KB(f)|0;h=(c[e>>2]|0)>>>4;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=j;j=g+16|0;c[j>>2]=h;c[j+4>>2]=0;m4(193772,90895,g)|0;}else {d=c[(c[d+16>>2]|0)+120>>2]|0;j=c[(c[f+16>>2]|0)+120>>2]|0;g=(c[e>>2]|0)>>>4;c[h>>2]=b;c[h+4>>2]=d;c[h+8>>2]=j;j=h+16|0;c[j>>2]=g;c[j+4>>2]=0;m4(193772,90914,h)|0;}l=i;return}function dp(a){a=a|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0,k=0;j=4;i=T1(40)|0;c[i>>2]=0;g=+h[23293];o=0;f=+Z(1,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){h[23293]=f;o=0;ia(102,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){i=U6(187212,1,i|0,j|0)|0;j=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,i|0,j|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1)d=0;else d=z;}else d=z;}else d=z;while(1){if(d|0)break;o=0;ia(103,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}o=0;$(22,a|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}if(b[(c[a+16>>2]|0)+136>>1]&14){o=0;ia(104,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}}o=0;ja(22,a|0,0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1)d=z;else {k=12;break}}if((k|0)==12)h[23293]=g;U1(i|0);return}function ep(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;e=a+16|0;f=b[(c[e>>2]|0)+136>>1]&14;d=f&65535;if((f&65535)>8){if(f<<16>>16==12){if(Um(a,22,10)|0){c[47134]=2;h=5;}}else h=5;do if((h|0)==5)if(!(b[(c[e>>2]|0)+136>>1]&1)){Wm(a,d)|0;break}else {gA(0,90998,g)|0;d=2;break}while(0);c[47134]=0;}if((c[47138]|0)<1)Wm(a,d)|0;l=i;return}function fp(a){a=a|0;var b=0.0,d=0.0,e=0;e=l;l=l+16|0;c[46474]=1;c[46475]=1;c[46477]=-1;c[46479]=50;h[23245]=0.0;h[23240]=0.0;h[23241]=1.0;c[46478]=ZO(a,GA(a,0,91061,0)|0,600,0)|0;d=+_O(a,GA(a,0,91202,0)|0,.3,0.0);h[23242]=d;h[1371]=d;if(-1.0==-1.0)b=+_O(a,GA(a,0,91069,0)|0,-1.0,0.0);h[23243]=b;c[46476]=1;a=mm(a,2,185904)|0;c[46488]=a;if(!a){gA(0,91072,e)|0;c[46476]=2;}c[46504]=(O(c[46478]|0,c[46479]|0)|0)/100|0;d=+h[23242];h[23247]=d*d;if(c[46474]|0){b=+h[23245];if(b<=0.0){b=d*3.0;h[23245]=b;}h[23246]=b*b;}l=e;return}function gp(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0;j=l;l=l+16|0;d=j;g=c[c[(c[a+16>>2]|0)+140>>2]>>2]|0;i=hp(a,b)|0;ip(d,a,g);e=+h[d>>3];f=+h[d+8>>3];a:do if(!(c[46474]|0)){b=0;while(1){if((b|0)>=(c[46505]|0))break a;lp(a,+jp(b),g);b=b+1|0;}}else {d=Kv(tB(a)|0)|0;Pv(d,tB(a)|0);b=0;while(1){if((b|0)>=(c[46505]|0))break;kp(a,+jp(b),g,d);b=b+1|0;}Rv(d);}while(0);b:do if(e!=0.0|f!=0.0){b=jC(a)|0;while(1){if(!b)break b;g=c[(c[b+16>>2]|0)+132>>2]|0;h[g>>3]=+h[g>>3]+e;g=g+8|0;h[g>>3]=+h[g>>3]+f;b=kC(a,b)|0;}}while(0);if(i|0)mp();l=j;return}function hp(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0;if(+h[23243]==-1.0){i=tB(a)|0;d=+h[23242];h[23243]=+h[23241]*.2*d*+C(+(+(i|0)));i=1;}else {i=0;d=+h[23242];}g=c[46504]|0;h[b+8>>3]=+jp(g);h[b+16>>3]=d;h[b+24>>3]=+h[23240];e=c[46478]|0;a=e-g|0;c[b>>2]=a;f=c[46477]|0;do if((f|0)>-1){if((f|0)<=(g|0)){c[46505]=f;a=0;j=10;break}if((f|0)<=(e|0)){c[46505]=g;a=f-g|0;j=10;}}else {c[46505]=g;j=10;}while(0);if((j|0)==10)c[b+32>>2]=a;return i|0}function ip(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0.0,t=0.0,u=0,v=0,w=0.0,x=0,y=0,z=0;v=tB(d)|0;x=c[(c[(c[d+16>>2]|0)+140>>2]|0)+4>>2]|0;u=jC(d)|0;q=0;r=0;g=0;k=0;n=0;while(1){if(!u)break;f=c[u+16>>2]|0;if(!(a[f+119>>0]|0))f=r;else {f=c[f+132>>2]|0;i=+h[f>>3];if(!q){k=~~i;g=~~+h[f+8>>3];n=g;f=k;}else {p=+(r|0);s=+h[f+8>>3];t=+(g|0);w=+(k|0);o=+(n|0);n=~~(s>o?s:o);f=~~(iw?i:w);}q=q+1|0;}u=kC(d,u)|0;r=f;}i=+h[23242]*(+C(+(+(v-x|0)))+1.0);s=i*.6;h[23249]=s;h[23248]=s;if((q|0)!=1)if((q|0)>1){t=+(k+r|0)*.5;w=+(n+g|0)*.5;o=+(k-r|0);p=o*1.2;l=+(n-g|0);m=l*1.2;i=i*2.4*s;j=m*p/i;do if(!(j>=1.0)){if(j>0.0){i=+C(+j)*2.0;j=p/i;h[23248]=j;i=m/i;z=20;break}if(p>0.0){j=o*.6;h[23248]=j;i=i/p*.5;z=20;break}if(m>0.0){j=i/m*.5;h[23248]=j;i=l*.6;z=20;}else {i=s;j=s;}}else {j=o*.6;h[23248]=j;i=l*.6;z=20;}while(0);if((z|0)==20)h[23249]=i;s=+K(+i,+j);j=j/+E(+s);h[23248]=j;i=i/+F(+s);h[23249]=i;}else {t=0.0;w=0.0;j=s;i=s;}else {t=+(r|0);w=+(g|0);j=s;i=s;}h[23250]=j*j;h[23251]=i*i;if((c[46488]|0)==2)f=c[46476]|0;else {f=X4()|0;f=(db(0)|0)^f;}z5(f);a:do if(!e){e=jC(d)|0;if(!q)while(1){if(!e)break a;s=+h[23248];s=(+B5()*2.0+-1.0)*s;z=e+16|0;h[c[(c[z>>2]|0)+132>>2]>>3]=s;s=+h[23249];s=(+B5()*2.0+-1.0)*s;h[(c[(c[z>>2]|0)+132>>2]|0)+8>>3]=s;e=kC(d,e)|0;}while(1){if(!e)break a;f=e+16|0;g=c[f>>2]|0;if(!(a[g+119>>0]|0)){s=+h[23248];s=(+B5()*2.0+-1.0)*s;h[c[(c[f>>2]|0)+132>>2]>>3]=s;s=+h[23249];s=(+B5()*2.0+-1.0)*s;h[(c[(c[f>>2]|0)+132>>2]|0)+8>>3]=s;}else {z=c[g+132>>2]|0;h[z>>3]=+h[z>>3]-t;z=z+8|0;h[z>>3]=+h[z>>3]-w;}e=kC(d,e)|0;}}else {while(1){if(!(c[e>>2]|0))break;u=e+8|0;s=+E(+(+h[u>>3]))*+h[23248]+t;x=c[(c[e+4>>2]|0)+16>>2]|0;v=c[x+132>>2]|0;h[v>>3]=s;h[v+8>>3]=+F(+(+h[u>>3]))*+h[23249]+w;a[x+119>>0]=1;e=e+16|0;}l=t*.1;m=w*.1;r=jC(d)|0;while(1){if(!r)break a;q=r+16|0;e=c[q>>2]|0;if(!((c[(c[e+112>>2]|0)+8>>2]|0)==0?!(c[e+212>>2]|0):0))z=32;do if((z|0)==32){z=0;if(a[e+119>>0]|0){x=c[e+132>>2]|0;h[x>>3]=+h[x>>3]-t;x=x+8|0;h[x>>3]=+h[x>>3]-w;break}n=aB(d,r)|0;e=0;j=0.0;i=0.0;while(1){if(!n)break;k=c[n>>2]&3;f=(k|0)==2?n:n+-48|0;g=c[f+40>>2]|0;k=(k|0)==3?n:n+48|0;do if((g|0)!=(c[k+40>>2]|0)?(y=c[(c[((g|0)==(r|0)?k:f)+40>>2]|0)+16>>2]|0,(a[y+119>>0]|0)!=0):0)if(!e){x=c[y+132>>2]|0;e=1;j=+h[x>>3];i=+h[x+8>>3];break}else {p=+(e|0);x=c[y+132>>2]|0;e=e+1|0;s=+(e|0);j=(+h[x>>3]+j*p)/s;i=(+h[x+8>>3]+i*p)/s;break}while(0);n=bB(d,n,r)|0;}do if((e|0)<=1)if((e|0)==1){f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=j*.98+l;i=i*.9+m;break}else {i=+B5()*6.283185307179586;s=+B5()*.9;p=s*+h[23248]*+E(+i);f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=p;i=+h[23249]*s*+F(+i);break}else {f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=j;}while(0);h[e+8>>3]=i;a[f+119>>0]=1;}while(0);r=kC(d,r)|0;}}while(0);h[b>>3]=t;h[b+8>>3]=w;return}function jp(a){a=a|0;var b=0;b=c[46478]|0;return +(+h[23243]*+(b-a|0)/+(b|0))}function kp(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0;if(!(b<=0.0)){Qv(e);f=jC(a)|0;while(1){if(!f)break;i=c[f+16>>2]|0;g=(c[i+112>>2]|0)+16|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;i=c[i+132>>2]|0;j=+h[23245];g=~~+A(+(+h[i>>3]/j));Tv(e,g,~~+A(+(+h[i+8>>3]/j)),f);f=kC(a,f)|0;}g=jC(a)|0;while(1){if(!g)break;f=XA(a,g)|0;while(1){if(!f)break;i=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((g|0)!=(i|0))op(g,i,f);f=ZA(a,f)|0;}g=kC(a,g)|0;}Vv(e,23);pp(a,b,d);}return}function lp(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0,g=0;if(!(b<=0.0)){e=jC(a)|0;while(1){if(!e)break;g=(c[(c[e+16>>2]|0)+112>>2]|0)+16|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;e=kC(a,e)|0;}g=jC(a)|0;while(1){if(!g)break;else e=g;while(1){e=kC(a,e)|0;if(!e)break;np(g,e);}e=XA(a,g)|0;while(1){if(!e)break;f=c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0;if((g|0)!=(f|0))op(g,f,e);e=ZA(a,e)|0;}g=kC(a,g)|0;}pp(a,b,d);}return}function mp(){h[23243]=-1.0;return}function np(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0;g=c[(c[b+16>>2]|0)+132>>2]|0;f=c[(c[a+16>>2]|0)+132>>2]|0;d=+h[g>>3]-+h[f>>3];e=+h[g+8>>3]-+h[f+8>>3];qp(a,b,d,e,e*e+d*d);return}function op(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0;j=b+16|0;k=c[(c[j>>2]|0)+132>>2]|0;a=a+16|0;b=c[(c[a>>2]|0)+132>>2]|0;e=+h[k>>3]-+h[b>>3];f=+h[k+8>>3]-+h[b+8>>3];g=e;i=f;e=e*e;f=f*f;while(1){e=e+f;if(!(e==0.0))break;e=+(5-((x5()|0)%10|0)|0);f=+(5-((x5()|0)%10|0)|0);g=e;i=f;e=e*e;f=f*f;}f=+C(+e);b=c[d+16>>2]|0;e=+h[b+128>>3];if(!(c[46475]|0))e=e*f/+h[b+136>>3];else e=(f-+h[b+136>>3])*e/f;g=e*g;k=c[(c[j>>2]|0)+112>>2]|0;j=k+16|0;h[j>>3]=+h[j>>3]-g;i=e*i;k=k+24|0;h[k>>3]=+h[k>>3]-i;k=c[(c[a>>2]|0)+112>>2]|0;j=k+16|0;h[j>>3]=+h[j>>3]+g;k=k+24|0;h[k>>3]=+h[k>>3]+i;return}function pp(b,d,e){b=b|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0;o=d*d;n=(e|0)==0;m=jC(b)|0;while(1){if(!m)break;l=c[m+16>>2]|0;if(!(a[l+119>>0]&2)){k=c[l+112>>2]|0;f=+h[k+16>>3];i=+h[k+24>>3];g=i*i+f*f;if(g>2]|0;j=+h[e>>3]+f;f=+h[e+8>>3]+i;}else {g=d/+C(+g);e=c[l+132>>2]|0;j=+h[e>>3]+g*f;f=+h[e+8>>3]+g*i;}do if(!n){g=+C(+(f*f/+h[23251]+j*j/+h[23250]));if((c[k+8>>2]|0)==0?(c[l+212>>2]|0)==0:0){h[e>>3]=j/g;f=f/g;break}if(!(g>=1.0)){h[e>>3]=j;break}else {h[e>>3]=j*.95/g;f=f*.95/g;break}}else h[e>>3]=j;while(0);h[e+8>>3]=f;}m=kC(b,m)|0;}return}function qp(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=+e;f=+f;var g=0.0,i=0,j=0;g=d;d=f;while(1){if(!(d==0.0))break;d=+(5-((x5()|0)%10|0)|0);e=+(5-((x5()|0)%10|0)|0);g=d;d=e*e+d*d;}if(!(c[46475]|0))d=+h[23247]/d;else {f=+C(+d);d=+h[23247]/(f*d);}j=c[a+16>>2]|0;a=c[j+112>>2]|0;if(((c[a+8>>2]|0)==0?(c[j+212>>2]|0)==0:0)?(i=c[b+16>>2]|0,(c[(c[i+112>>2]|0)+8>>2]|0)==0):0)d=(c[i+212>>2]|0)==0?d*10.0:d;f=d*g;j=c[(c[b+16>>2]|0)+112>>2]|0;b=j+16|0;h[b>>3]=+h[b>>3]+f;g=d*e;j=j+24|0;h[j>>3]=+h[j>>3]+g;j=a+16|0;h[j>>3]=+h[j>>3]-f;j=a+24|0;h[j>>3]=+h[j>>3]-g;return}function rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;f=c[b+8>>2]|0;g=c[b>>2]|0;e=c[b+4>>2]|0;b=f;while(1){if(!b)break;a=f;while(1){if(!a)break;if((b|0)!=(a|0))np(c[b>>2]|0,c[a>>2]|0);a=c[a+4>>2]|0;}b=c[b+4>>2]|0;}h=g+-1|0;a=e+-1|0;sp(d,h,a,f);sp(d,h,e,f);b=e+1|0;sp(d,h,b,f);sp(d,g,a,f);sp(d,g,b,f);g=g+1|0;sp(d,g,a,f);sp(d,g,e,f);sp(d,g,b,f);return 0}function sp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0;a=Wv(a,b,d)|0;if((e|0)!=0&(a|0)!=0){k=a+8|0;do{d=c[e>>2]|0;j=d+16|0;a=k;while(1){a=c[a>>2]|0;if(!a)break;b=c[a>>2]|0;m=c[(c[b+16>>2]|0)+132>>2]|0;l=c[(c[j>>2]|0)+132>>2]|0;f=+h[m>>3]-+h[l>>3];g=+h[m+8>>3]-+h[l+8>>3];i=g*g+f*f;if(i<+h[23246])qp(d,b,f,g,i);a=a+4|0;}e=c[e+4>>2]|0;}while((e|0)!=0)}return}function tp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+16|0;g=h;e=QA(b,92507)|0;if(0);if(!((e|0)!=0?(a[e>>0]|0)!=0:0))e=91125;f=R2(e,58)|0;do if(!f)f=0;else {if((f|0)!=(e|0)?((a[e>>0]|0)+-48|0)>>>0>=10:0){f=0;break}i=q5(e)|0;e=f+1|0;f=(i|0)>0?i:0;}while(0);if(0);if(!((f|0)!=0?!(up(b,d,f)|0):0))nr(b,e)|0;l=h;return}function up(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0;t=l;l=l+64|0;r=t;j=t+40|0;s=tB(b)|0;k=uB(b)|0;lr(j,b);c[46842]=c[j>>2];c[46843]=c[j+4>>2];c[46844]=c[j+8>>2];if(a[187376]|0){g[46842]=+g[46842]*.013888888888888888;g[46843]=+g[46843]*.013888888888888888;}f=vp(b)|0;a:do if(!f)f=0;else {j=r;i=j+40|0;do{c[j>>2]=c[d>>2];j=j+4|0;d=d+4|0;}while((j|0)<(i|0));j=r+16|0;q=+h[j>>3];o=+(k|0)*2.0;p=1.0/+(O(s+-1|0,s)|0);i=0;n=q;while(1){if(!((f|0)!=0&(i|0)<(e|0)))break a;wp(s,r);m=+h[23253]*+h[170];h[23254]=m;h[23255]=o*m*p;d=0;while(1){if((d|0)>=(c[46512]|0))break;m=+xp(d);if(m<=0.0)break;f=yp(b,m)|0;if(!f){f=0;break}else d=d+1|0;}m=n+q;h[j>>3]=m;i=i+1|0;n=m;}}while(0);l=t;return f|0}function vp(a){a=a|0;var b=0,c=0,d=0,e=0;b=0;e=jC(a)|0;while(1){if(!e)break;else d=e;while(1){c=kC(a,d)|0;if(!c)break;d=c;b=(Bp(e,c)|0)+b|0;}e=kC(a,e)|0;}return b|0}function wp(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0;e=+h[b+16>>3];h[171]=e;c[344]=c[b>>2];f=+h[b+8>>3];h[23257]=f;c[46512]=c[b+32>>2];d=+h[b+24>>3];if(d>0.0)h[170]=d;h[23253]=e*e;if(f==0.0)h[23257]=+C(+(+(a|0)))*.2*e;return}function xp(a){a=a|0;var b=0;b=c[344]|0;return +(+h[23257]*+(b-a|0)/+(b|0))}function yp(b,d){b=b|0;d=+d;var e=0,f=0,g=0,i=0.0,j=0,k=0.0,l=0.0,m=0.0;e=jC(b)|0;while(1){if(!e)break;j=(c[(c[e+16>>2]|0)+112>>2]|0)+16|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;e=kC(b,e)|0;}e=0;j=jC(b)|0;while(1){if(!j)break;else g=j;while(1){f=kC(b,g)|0;if(!f)break;g=f;e=(zp(j,f)|0)+e|0;}f=XA(b,j)|0;while(1){if(!f)break;Ap(j,c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0);f=ZA(b,f)|0;}j=kC(b,j)|0;}a:do if(!e)e=0;else {m=d*d;g=jC(b)|0;while(1){if(!g)break a;f=c[g+16>>2]|0;if((a[f+119>>0]|0)!=3){j=c[f+112>>2]|0;k=+h[j+16>>3];i=+h[j+24>>3];l=i*i+k*k;if(l>2]|0;h[f>>3]=+h[f>>3]+k;}else {l=+C(+l);f=c[f+132>>2]|0;h[f>>3]=+h[f>>3]+k*d/l;i=i*d/l;}j=f+8|0;h[j>>3]=+h[j>>3]+i;}g=kC(b,g)|0;}}while(0);return e|0}function zp(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0;g=c[(c[b+16>>2]|0)+132>>2]|0;f=c[(c[a+16>>2]|0)+132>>2]|0;d=+h[g>>3]-+h[f>>3];e=+h[g+8>>3]-+h[f+8>>3];return Dp(a,b,d,e,e*e+d*d)|0}function Ap(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0.0,k=0.0,l=0,m=0;if(!(Bp(a,b)|0)){i=c[b+16>>2]|0;m=c[i+132>>2]|0;f=c[a+16>>2]|0;l=c[f+132>>2]|0;e=+h[m>>3]-+h[l>>3];d=+h[m+8>>3]-+h[l+8>>3];g=+C(+(d*d+e*e));j=+Cp(a);j=+Cp(b)+j;k=g-j;g=k*k/((+h[171]+j)*g);e=g*e;b=c[i+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]-e;d=g*d;b=b+24|0;h[b>>3]=+h[b>>3]-d;b=c[f+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]+e;b=b+24|0;h[b>>3]=+h[b>>3]+d;}return}function Bp(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,i=0.0,j=0.0,k=0,l=0;k=c[d+16>>2]|0;l=c[k+132>>2]|0;d=c[b+16>>2]|0;b=c[d+132>>2]|0;i=+h[l>>3]-+h[b>>3];j=+h[l+8>>3]-+h[b+8>>3];j=j<0.0?-j:j;b=(a[187376]|0)==0;e=+h[d+32>>3];if(b){f=+g[46842];e=e*.5*f;f=+h[k+32>>3]*.5*f;}else {f=+g[46842];e=e*.5+f;f=+h[k+32>>3]*.5+f;}if(!((i<0.0?-i:i)<=f+e))d=0;else {e=+h[d+40>>3];if(b){i=+g[46843];f=e*.5*i;e=+h[k+40>>3]*.5*i;}else {i=+g[46843];f=e*.5+i;e=+h[k+40>>3]*.5+i;}d=j<=e+f&1;}return d|0}function Cp(b){b=b|0;var d=0.0,e=0.0;b=c[b+16>>2]|0;d=+h[b+32>>3];if(!(a[187376]|0)){e=d*.5*+g[46842];d=+h[b+40>>3]*.5*+g[46843];}else {e=d*.5+ +g[46842];d=+h[b+40>>3]*.5+ +g[46843];}return +(+C(+(d*d+e*e)))}function Dp(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=+e;f=+f;var g=0,i=0;while(1){if(!(f==0.0))break;f=+(5-((x5()|0)%10|0)|0);e=+(5-((x5()|0)%10|0)|0);d=f;f=e*e+f*f;}g=Bp(a,b)|0;f=((g|0)==0?+h[23255]:+h[23254])/f;d=f*d;b=c[(c[b+16>>2]|0)+112>>2]|0;i=b+16|0;h[i>>3]=+h[i>>3]+d;f=f*e;b=b+24|0;h[b>>3]=+h[b>>3]+f;b=c[(c[a+16>>2]|0)+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]-d;b=b+24|0;h[b>>3]=+h[b>>3]-f;return g|0}function Ep(a){a=a|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;Fp(a);return}function Fp(a){a=a|0;var b=0,d=0,e=0,f=0;e=JK((tB(a)|0)<<2)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;f=a+16|0;c[(c[f>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;Zl(b);c[(c[b+16>>2]|0)+112>>2]=e+(d<<2);c[(c[(c[f>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;b=kC(a,b)|0;d=d+1|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Gp(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Gp(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,0.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function Hp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n+4|0;k=n;a[m>>0]=a[18596]|0;a[m+1>>0]=a[18597]|0;a[m+2>>0]=a[18598]|0;a[m+3>>0]=a[18599]|0;m=oB(91156,m,0)|0;TC(m,91164,280,1)|0;c[(c[b+16>>2]|0)+140>>2]=m;e=jC(b)|0;while(1){if(!e)break;f=e+16|0;if(!(c[c[(c[f>>2]|0)+112>>2]>>2]|0)){j=Ip(m,KB(e)|0,e)|0;c[c[(c[f>>2]|0)+112>>2]>>2]=j;}e=kC(b,e)|0;}f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;h=c[e>>2]&3;g=c[c[(c[(c[((h|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;h=c[c[(c[(c[((h|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;if((g|0)!=(h|0))TC(iB(m,g,h,0,1)|0,137460,176,1)|0;e=ZA(b,e)|0;}f=kC(b,f)|0;}j=DG(m,k,0)|0;f=0;while(1){if((f|0)>=(c[k>>2]|0))break;h=c[j+(f<<2)>>2]|0;e=jC(h)|0;while(1){if(!e)break;g=XA(b,c[c[(c[e+16>>2]|0)+112>>2]>>2]|0)|0;while(1){if(!g)break;i=c[c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;if((e|0)!=(i|0)){i=iB(m,e,i,0,1)|0;TC(i,137460,176,1)|0;mB(h,i,1)|0;}g=ZA(b,g)|0;}e=kC(h,e)|0;}f=f+1|0;}e=jC(m)|0;while(1){if(!e)break;f=XA(m,e)|0;while(1){if(!f)break;b=JK(8)|0;c[(c[f+16>>2]|0)+120>>2]=b;f=ZA(m,f)|0;}e=kC(m,e)|0;}c[d>>2]=c[k>>2];l=n;return j|0}function Ip(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;b=tC(a,b,1)|0;TC(b,137447,304,1)|0;e=JK(40)|0;a=b+16|0;c[(c[a>>2]|0)+112>>2]=e;e=JK(c[47137]<<3)|0;a=c[a>>2]|0;c[a+132>>2]=e;e=c[d+16>>2]|0;h[a+88>>3]=+h[e+88>>3];h[a+96>>3]=+h[e+96>>3];h[a+80>>3]=+h[e+80>>3];c[c[a+112>>2]>>2]=d;return b|0}function Jp(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+48|0;b=h+32|0;e=h;if(tB(a)|0){g=Hp(a,b)|0;f=c[b>>2]|0;b=c[g>>2]|0;if((f|0)==1){bx(b,a);Kp(c[g>>2]|0);or(a)|0;}else {d=c[b+60>>2]|0;kH(a,2,8,e)|0;b=0;while(1){if((b|0)>=(f|0))break;i=c[g+(b<<2)>>2]|0;bx(i,a);or(i)|0;b=b+1|0;}jH(f,g,d,e)|0;b=0;while(1){if((b|0)>=(f|0))break;Kp(c[g+(b<<2)>>2]|0);b=b+1|0;}}U1(g);}l=h;return}function Kp(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;while(1){if(!b)break;d=c[b+16>>2]|0;e=c[d+132>>2]|0;d=c[(c[(c[c[d+112>>2]>>2]|0)+16>>2]|0)+132>>2]|0;h[d>>3]=+h[e>>3];h[d+8>>3]=+h[e+8>>3];b=kC(a,b)|0;}return}function Lp(a){a=a|0;if(tB(a)|0){Ep(a);Jp(a);U1(c[(c[(jC(a)|0)+16>>2]|0)+112>>2]|0);fn(a);tM(a);}return}function Mp(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;if(b|0){e=a+16|0;Np(c[(c[e>>2]|0)+140>>2]|0);while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;YP(d);d=ZA(a,d)|0;}WP(b);b=kC(a,b)|0;}U1(c[(c[e>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);}return}function Np(a){a=a|0;var b=0,d=0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;U1(c[(c[b+16>>2]|0)+120>>2]|0);b=ZA(a,b)|0;}b=d+16|0;U1(c[(c[b>>2]|0)+112>>2]|0);U1(c[(c[b>>2]|0)+132>>2]|0);d=kC(a,d)|0;}sB(a)|0;return}function Op(b){b=b|0;var d=0,e=0.0,f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+112|0;m=s+40|0;n=s+16|0;r=s+100|0;o=s;j=s+88|0;p=s+56|0;Pp(b);i=(c[47137]|0)==2;d=i&1;if(tB(b)|0){q=Yp()|0;Qp(b,q);Nq(b,n,0)|0;if(i&(c[n>>2]|0)==18){c[q+124>>2]=c[n+8>>2];h[q+144>>3]=+h[n+16>>3];lr(j,b);if(!(a[j+8>>0]|0)){f=.05555555555555555;e=.05555555555555555;}else {f=+g[j+4>>2]*.013888888888888888;e=+g[j>>2]*.013888888888888888;}h[o>>3]=e;h[o+8>>3]=f;d=0;}else c[q+124>>2]=-1;if(0);k=DG(b,r,0)|0;if((c[r>>2]|0)==1){c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];Rp(b,q,m);if(d|0)Qq(b,n)|0;fn(b);d=0;}else {kH(b,2,8,p)|0;c[p+12>>2]=1;j=(d|0)==0;i=0;while(1){d=c[r>>2]|0;if((i|0)>=(d|0))break;d=c[k+(i<<2)>>2]|0;KG(d)|0;c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];Rp(d,q,m);if(!j)Qq(d,n)|0;oQ(d,2);fn(d);i=i+1|0;}jH(d,k,b,p)|0;d=0;}while(1){if((d|0)>=(c[r>>2]|0))break;wC(b,c[k+(d<<2)>>2]|0)|0;d=d+1|0;}U1(k);Zp(q);}tM(b);l=s;return}function Pp(a){a=a|0;var d=0,f=0;oQ(a,2);d=ZO(a,GA(a,0,91368,0)|0,2,2)|0;f=(ZO(a,GA(a,0,91374,0)|0,d,2)|0)&65535;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=f;if((e[(c[(yC(a)|0)+16>>2]|0)+176>>1]|0)<10)f=b[(c[(yC(a)|0)+16>>2]|0)+176>>1]|0;else f=10;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=f;f=f&65535;c[47137]=f;b[(c[(yC(a)|0)+16>>2]|0)+178>>1]=(d|0)<(f|0)?d:f;Vp(a);return}function Qp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;f=g+8|0;d=g+12|0;e=b+108|0;c[d>>2]=c[e>>2];if((mm(a,2,d)|0)!=2)gA(0,91169,g)|0;c[e>>2]=c[d>>2];h[b+24>>3]=+_O(a,GA(a,0,91202,0)|0,-1.0,0.0);h[b>>3]=-+_O(a,GA(a,0,91204,0)|0,1.0001234,0.0);c[b+40>>2]=ZO(a,GA(a,0,91219,0)|0,2147483647,0)|0;c[b+120>>2]=Tp(a,GA(a,0,91226,0)|0)|0;c[b+132>>2]=Up(a,GA(a,0,91236,0)|0)|0;c[b+136>>2]=0;c[b+112>>2]=(eP(QA(a,91245)|0,0)|0)&255;c[b+128>>2]=(eP(QA(a,91254)|0,1)|0)&255;h[b+152>>3]=+_O(a,GA(a,0,91269,0)|0,0.0,-1797693134862315708145274.0e284);d=ZO(a,GA(a,0,91278,0)|0,0,0)|0;a=b+160|0;c[a>>2]=d;if((d|0)>4){c[f>>2]=d;gA(0,91291,f)|0;c[a>>2]=0;}l=g;return}function Rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;f=q;n=q+32|0;j=q+28|0;g=q+24|0;p=q+20|0;o=q+16|0;c[g>>2]=0;c[p>>2]=0;c[o>>2]=0;i=b+136|0;e=c[47137]|0;if((c[i>>2]|0)==1)m=Kq(a,e,o)|0;else m=Kq(a,e,0)|0;do if((c[b+124>>2]|0)>-1)if((c[b+160>>2]|0)>0){c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];k=Jq(a,f,g,p)|0;break}else {c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];k=Jq(a,f,0,0)|0;break}else k=0;while(0);e=Sp(a)|0;c[n>>2]=e;switch(c[i>>2]|0){case 1:case 0:{wq(c[47137]|0,m,c[o>>2]|0,b,0,k,e,c[g>>2]|0,c[p>>2]|0,j);break}case 5:{Iq(c[47137]|0,m,e,j);break}case 4:{e=c[o>>2]|0;if(!e)e=Qw(m)|0;else e=Aw(e,0)|0;c[o>>2]=e;Dq(c[47137]|0,m,e,n,1,200,.001,j);break}default:{}}e=jC(a)|0;while(1){if(!e)break;d=c[47137]|0;g=c[e+16>>2]|0;b=(c[n>>2]|0)+((O(c[g+120>>2]|0,d)|0)<<3)|0;g=g+132|0;f=0;while(1){if((f|0)>=(d|0))break;h[(c[g>>2]|0)+(f<<3)>>3]=+h[b+(f<<3)>>3];f=f+1|0;}e=kC(a,e)|0;}U1(k);U1(c[n>>2]|0);qw(m);e=c[o>>2]|0;if(e|0)qw(e);e=c[p>>2]|0;if(e|0)U1(e);l=q;return}function Sp(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=c[47137]|0;j=JK(O(j<<3,tB(b)|0)|0)|0;a:do if(GA(b,1,102623,0)|0){f=jC(b)|0;while(1){if(!f)break a;d=c[f+16>>2]|0;b:do if(a[d+119>>0]|0){g=c[47137]|0;i=O(g,c[d+120>>2]|0)|0;e=d+132|0;d=0;while(1){if((d|0)>=(g|0))break b;h[j+(i+d<<3)>>3]=+h[(c[e>>2]|0)+(d<<3)>>3];d=d+1|0;}}while(0);f=kC(b,f)|0;}}while(0);return j|0}function Tp(b,c){b=b|0;c=c|0;do if(c){b=RA(b,c)|0;c=a[b>>0]|0;if((c+-48|0)>>>0<10){b=q5(b)|0;b=(b|0)<5?b:0;break}if(b3(c)|0)if(c3(b,91330)|0)if(c3(b,91339)|0)if(c3(b,135709)|0)if(!(c3(b,91350)|0))b=3;else {b=(c3(b,91361)|0)==0;b=b?4:0;}else b=0;else b=1;else b=2;else b=0;}else b=0;while(0);return b|0}function Up(b,c){b=b|0;c=c|0;do if(c){b=RA(b,c)|0;c=a[b>>0]|0;if((c+-48|0)>>>0<10){b=q5(b)|0;b=b>>>0<3?b:1;break}if(b3(c)|0)if((c3(b,135709)|0)!=0?(c3(b,137308)|0)!=0:0)if(((c3(b,99730)|0)!=0?(c3(b,107652)|0)!=0:0)?(c3(b,107657)|0)!=0:0){b=(c3(b,91325)|0)==0;b=b?2:1;}else b=1;else b=0;else b=1;}else b=1;while(0);return b|0}function Vp(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;Zl(b);b=kC(a,b)|0;}c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;Wp(b);b=ZA(a,b)|0;}c=kC(a,c)|0;}return}function Wp(a){a=a|0;TC(a,137460,176,1)|0;tP(a)|0;return}function Xp(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}return}function Yp(){var a=0,b=0;a=KK(168)|0;h[a>>3]=-1.0001234;h[a+8>>3]=1.0;c[a+16>>2]=1;h[a+24>>3]=-1.0;h[a+32>>3]=.2;c[a+40>>2]=0;c[a+44>>2]=4;c[a+48>>2]=1;c[a+52>>2]=45;c[a+56>>2]=10;h[a+64>>3]=.6;h[a+72>>3]=.001;c[a+80>>2]=500;h[a+88>>3]=.9;h[a+96>>3]=.1;c[a+104>>2]=1;c[a+108>>2]=123;b=a+112|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[a+128>>2]=1;c[a+132>>2]=3;c[a+136>>2]=0;h[a+144>>3]=-4.0;h[a+152>>3]=0.0;c[a+160>>2]=0;return a|0}function Zp(a){a=a|0;U1(a);return}function _p(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;b=l;l=l+176|0;d=b+160|0;f=b+152|0;g=b+128|0;k=b+112|0;j=b+88|0;m=b+64|0;n=b+56|0;o=b+40|0;q=b+24|0;p=b+16|0;r=b;e=c[15712]|0;U4(91378,27,1,e)|0;i=+h[a+8>>3];h[r>>3]=+h[a>>3];h[r+8>>3]=i;w4(e,91406,r)|0;r=c[a+108>>2]|0;c[p>>2]=c[a+16>>2];c[p+4>>2]=r;w4(e,91457,p)|0;i=+h[a+32>>3];h[q>>3]=+h[a+24>>3];h[q+8>>3]=i;w4(e,91484,q)|0;q=c[a+44>>2]|0;p=c[a+48>>2]|0;c[o>>2]=c[a+40>>2];c[o+4>>2]=q;c[o+8>>2]=p;w4(e,91507,o)|0;o=c[a+56>>2]|0;c[n>>2]=c[a+52>>2];c[n+4>>2]=o;w4(e,91558,n)|0;i=+h[a+72>>3];n=c[a+80>>2]|0;h[m>>3]=+h[a+64>>3];h[m+8>>3]=i;c[m+16>>2]=n;w4(e,91591,m)|0;i=+h[a+96>>3];m=c[a+104>>2]|0;h[j>>3]=+h[a+88>>3];h[j+8>>3]=i;c[j+16>>2]=m;w4(e,91649,j)|0;j=c[a+116>>2]|0;i=+h[a+152>>3];c[k>>2]=c[a+112>>2];c[k+4>>2]=j;h[k+8>>3]=i;w4(e,91695,k)|0;k=c[a+124>>2]|0;j=c[a+128>>2]|0;i=+h[a+144>>3];c[g>>2]=c[17804+(c[a+120>>2]<<2)>>2];c[g+4>>2]=k;c[g+8>>2]=j;h[g+16>>3]=i;w4(e,91748,g)|0;g=c[17848+(c[a+136>>2]<<2)>>2]|0;c[f>>2]=c[17832+(c[a+132>>2]<<2)>>2];c[f+4>>2]=g;w4(e,91813,f)|0;c[d>>2]=c[a+160>>2];w4(e,91843,d)|0;l=b;return}function $p(a){a=a|0;U1(a);return}function aq(a){a=a|0;var b=0;b=KK(184)|0;c[b>>2]=a;c[b+176>>2]=0;return b|0}function bq(a,b){a=a|0;b=+b;var d=0,e=0,f=0;e=c[a>>2]|0;h[a+8+(e<<3)>>3]=b;f=a+176|0;a:do switch(c[f>>2]|0){case 0:{d=c[a>>2]|0;if((d|0)==20){c[f>>2]=-1;d=19;}else {c[f>>2]=1;d=(d|0)>19?20:d+1|0;}c[a>>2]=d;break}case 1:{d=c[a>>2]|0;if((d|0)<20?+h[a+8+(e+-1<<3)>>3]>b:0){c[a>>2]=d+1;break a}else {c[a>>2]=d+-1;c[f>>2]=-1;break a}}default:{d=c[a>>2]|0;if((d|0)>0?+h[a+8+(e+1<<3)>>3]>b:0){c[a>>2]=d+-1;break a}else {c[a>>2]=d+1;c[f>>2]=1;break a}}}while(0);return}function cq(a){a=a|0;return c[a>>2]|0}function dq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;o=c[a+20>>2]|0;p=c[a+24>>2]|0;m=c[a>>2]|0;n=c[o+(m<<2)>>2]|0;if(!n)e=1.0;else {a=0;e=0.0;a:while(1){if((a|0)>=(m|0))break;j=a+1|0;k=c[o+(j<<2)>>2]|0;l=O(a,b)|0;i=c[o+(a<<2)>>2]|0;while(1){if((i|0)>=(k|0)){a=j;continue a}g=p+(i<<2)|0;a=0;f=0.0;while(1){if((a|0)>=(b|0))break;q=+h[d+(a+l<<3)>>3]-+h[d+((O(c[g>>2]|0,b)|0)<<3)>>3];a=a+1|0;f=q*q+f;}i=i+1|0;e=+C(+f)+e;}}e=e/+(n|0);}return +e}function eq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+10|0;if((c[d>>2]|0)<=(b|0)){c[d>>2]=e;c[a>>2]=MK(c[a>>2]|0,e<<3)|0;}return}function fq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+10|0;if((c[d>>2]|0)<=(b|0)){c[d>>2]=e;c[a>>2]=MK(c[a>>2]|0,e<<2)|0;}return}function gq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;j=k;i=O(d,b)|0;b=O(c,b)|0;d=0;while(1){if((d|0)==2)break;h[j+(d<<3)>>3]=+h[a+(d+i<<3)>>3]-+h[a+(d+b<<3)>>3];d=d+1|0;}g=+h[j>>3];f=+h[j+8>>3];do if(!((g>=0.0?g:-g)<=(f>=0.0?f:-f)*1.0e-05)){e=+J(+(f/g));if(g>0.0){if(!(f<0.0))break;e=e+6.283185307179586;break}else {if(!(g<0.0))break;e=e+3.141592653589793;break}}else e=f>0.0?1.5707963267948966:4.71238898038469;while(0);l=k;return +e}function hq(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a>>3];c=+h[b>>3];return (d>c?1:(d>31)|0}function iq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0.0,B=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0,P=0,Q=0,R=0.0,S=0,T=0.0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0.0;_=l;l=l+80|0;Z=_+32|0;Y=_;p=+h[d>>3];m=d+24|0;n=+h[m>>3];o=d+32|0;j=+h[o>>3];R=+h[d+72>>3];S=c[d+80>>2]|0;T=+h[d+88>>3];q=+h[d+96>>3];U=c[d+104>>2]|0;V=d+56|0;i=c[V>>2]|0;do if(!((b|0)==0|(S|0)<1)?(W=c[b+4>>2]|0,!((a|0)<1|(W|0)<1)):0){Q=c[b>>2]|0;X=aq(i)|0;c[g>>2]=0;if((Q|0)!=(W|0)){c[g>>2]=-100;$p(X);c[V>>2]=i;break}N=vw(b,1)|0;P=c[N+20>>2]|0;Q=c[N+24>>2]|0;a:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);k=O(W,a)|0;i=0;while(1){if((i|0)>=(k|0))break a;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(n<0.0){n=+dq(N,a,f);h[m>>3]=n;}if(j<0.0){h[o>>3]=.2;j=.2;}if(p>=0.0){h[d>>3]=-1.0;p=-1.0;}M=+D(+n,+(1.0-p));A=+D(+j,+((2.0-p)*.3333333333333333))/n;B=O(W,a<<3)|0;E=KK(B)|0;F=KK(B)|0;G=d+116|0;H=d+64|0;I=c[15712]|0;J=N+8|0;K=Y+8|0;L=Y+16|0;y=0;z=0.0;v=q;while(1){W6(E|0,f|0,B|0)|0;w=cq(X)|0;x=hw(a,W,w,f,(c[G>>2]|0)==0?0:e)|0;cw(x,F,f,+h[H>>3],p,M,Y,g);m=0;b:while(1){if((m|0)>=(W|0)){q=0.0;k=0;break}o=O(m,a)|0;r=F+(o<<3)|0;s=m+1|0;t=P+(s<<2)|0;k=c[P+(m<<2)>>2]|0;while(1){if((k|0)>=(c[t>>2]|0)){m=s;continue b}u=Q+(k<<2)|0;i=c[u>>2]|0;c:do if((i|0)!=(m|0)){j=+_w(f,a,m,i)*A;i=0;while(1){if((i|0)>=(a|0))break c;q=j*(+h[f+(i+o<<3)>>3]-+h[f+((O(c[u>>2]|0,a)|0)+i<<3)>>3]);$=r+(i<<3)|0;h[$>>3]=+h[$>>3]-q;i=i+1|0;}}while(0);k=k+1|0;}}while(1){if((k|0)>=(W|0))break;m=O(k,a)|0;o=F+(m<<3)|0;j=0.0;i=0;while(1){if((i|0)>=(a|0))break;aa=+h[o+(i<<3)>>3];j=aa*aa+j;i=i+1|0;}j=+C(+j);q=j+q;d:do if(j>0.0){j=1.0/j;i=0;while(1){if((i|0)>=(a|0)){i=0;break d}$=o+(i<<3)|0;h[$>>3]=+h[$>>3]*j;i=i+1|0;}}else i=0;while(0);while(1){if((i|0)>=(a|0))break;$=f+(i+m<<3)|0;h[$>>3]=+h[$>>3]+ +h[o+(i<<3)>>3]*v;i=i+1|0;}k=k+1|0;}y=y+1|0;if(!x){if(0);}else {ow(x);bq(X,+h[K>>3]*.85+ +h[Y>>3]+ +h[L>>3]*3.3);}v=+jq(U,v,q,z,T);if(!((y|0)<(S|0)&v>R))break;else z=q;}if(c[d+112>>2]|0)kq(a,N,f);$p(X);c[V>>2]=w;U1(E);if((N|0)!=(b|0))qw(N);U1(F);}while(0);l=_;return}function jq(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;do if(a){if(c>=d){b=e*b;break}if(!(d*.95>2]|0;C=c[b+20>>2]|0;t=c[b+24>>2]|0;c[v>>2]=10;c[A>>2]=10;u=KK(B<<2)|0;f=KK(80)|0;c[y>>2]=f;e=KK(40)|0;c[z>>2]=e;b=0;while(1){if((b|0)>=(B|0)){n=0;r=f;k=e;o=e;m=f;break}c[u+(b<<2)>>2]=0;b=b+1|0;}while(1){if((n|0)>=(B|0))break;b=c[C+(n<<2)>>2]|0;a:do if((((c[C+(n+1<<2)>>2]|0)-b|0)==1?(c[u+(n<<2)>>2]|0)==0:0)?(w=c[t+(b<<2)>>2]|0,x=u+(w<<2)|0,(c[x>>2]|0)==0):0){c[x>>2]=1;q=C+(w+1<<2)|0;n=0;s=0;g=0.0;p=c[C+(w<<2)>>2]|0;k=o;b=r;while(1){if((p|0)>=(c[q>>2]|0))break;e=t+(p<<2)|0;f=c[e>>2]|0;if(((c[C+(f+1<<2)>>2]|0)-(c[C+(f<<2)>>2]|0)|0)==1){c[u+(f<<2)>>2]=1;fq(z,s,v);g=+_w(d,a,w,c[e>>2]|0)+g;k=c[z>>2]|0;c[k+(s<<2)>>2]=c[e>>2];e=n;f=s+1|0;}else {eq(y,n,A);j=+gq(d,a,w,c[e>>2]|0);b=c[y>>2]|0;h[b+(n<<3)>>3]=j;e=n+1|0;f=s;m=b;}n=e;s=f;p=p+1|0;}j=g/+(s|0);if((n|0)>0){lq(n,m);b=m;}g=(s|0)>1?6.283185307179586/+(s+-1|0):0.0;e=0;i=0.0;while(1){if((e|0)>=(s|0)){o=k;f=k;break a}mq(d,a,j,i,w,c[k+(e<<2)>>2]|0);e=e+1|0;i=i+g;}}else {e=n;f=k;b=r;}while(0);n=e+1|0;r=b;k=f;}U1(u);U1(r);U1(k);l=D;return}function lq(a,b){a=a|0;b=b|0;o4(b,a,8,68);return}function mq(a,b,c,d,e,f){a=a|0;b=b|0;c=+c;d=+d;e=e|0;f=f|0;var g=0.0;g=+E(+d)*c;e=O(e,b)|0;f=O(f,b)|0;h[a+(f<<3)>>3]=g+ +h[a+(e<<3)>>3];d=+F(+d)*c;h[a+(f+1<<3)>>3]=d+ +h[a+(e+1<<3)>>3];return}function nq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0,B=0.0,E=0.0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0.0,Q=0,R=0.0,S=0,T=0,U=0,V=0,W=0.0;o=+h[d>>3];m=d+24|0;l=+h[m>>3];n=d+32|0;k=+h[n>>3];P=+h[d+72>>3];Q=c[d+80>>2]|0;R=+h[d+88>>3];r=+h[d+96>>3];S=c[d+104>>2]|0;i=c[d+56>>2]|0;U4(92198,32,1,c[15712]|0)|0;if(!((b|0)==0|(Q|0)<1)?(T=c[b>>2]|0,j=c[b+4>>2]|0,!((a|0)<1|(j|0)<1)):0){p=a<<3;U=KK(O(p,j)|0)|0;if((j|0)<(c[d+52>>2]|0)){I=0;J=0;K=0;L=0;M=0;N=0;}else {aq(i)|0;L=KK(a*80|0)|0;M=KK(80)|0;N=KK(80)|0;I=N;J=M;K=L;}c[g>>2]=0;if((T|0)==(j|0)){F=vw(b,1)|0;G=c[F+20>>2]|0;H=c[F+24>>2]|0;a:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);j=O(T,a)|0;i=0;while(1){if((i|0)>=(j|0))break a;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(l<0.0){l=+dq(F,a,f);h[m>>3]=l;}if(k<0.0){h[n>>3]=.2;k=.2;}if(o>=0.0){h[d>>3]=-1.0;o=-1.0;}B=1.0-o;E=+D(+l,+B);z=+D(+k,+((2.0-o)*.3333333333333333))/l;A=KK(p)|0;u=O(T,p)|0;v=KK(u)|0;w=O(T,a)|0;x=d+116|0;y=(e|0)!=0;t=o==-1.0;s=0;o=0.0;while(1){i=0;while(1){if((i|0)>=(w|0))break;h[U+(i<<3)>>3]=0.0;i=i+1|0;}W6(v|0,f|0,u|0)|0;p=0;while(1){if((p|0)<(T|0))i=0;else {n=0;break}while(1){if((i|0)>=(a|0))break;h[A+(i<<3)>>3]=0.0;i=i+1|0;}n=O(p,a)|0;b:do if(y&(c[x>>2]|0)!=0){i=0;while(1){if((i|0)==(T|0)){i=0;break b}c:do if((i|0)!=(p|0)){l=+Zw(f,a,p,i);g=e+(i<<3)|0;m=O(i,a)|0;k=+D(+l,+B);k=1.0/(t?l*l:k);j=0;while(1){if((j|0)>=(a|0))break c;q=A+(j<<3)|0;h[q>>3]=+h[g>>3]*E*(+h[f+(j+n<<3)>>3]-+h[f+(j+m<<3)>>3])*k+ +h[q>>3];j=j+1|0;}}while(0);i=i+1|0;}}else {i=0;while(1){if((i|0)==(T|0)){i=0;break b}d:do if((i|0)!=(p|0)){l=+Zw(f,a,p,i);g=O(i,a)|0;k=+D(+l,+B);k=1.0/(t?l*l:k);j=0;while(1){if((j|0)>=(a|0))break d;q=A+(j<<3)|0;h[q>>3]=(+h[f+(j+n<<3)>>3]-+h[f+(j+g<<3)>>3])*E*k+ +h[q>>3];j=j+1|0;}}while(0);i=i+1|0;}}while(0);while(1){if((i|0)>=(a|0))break;q=U+(i+n<<3)|0;h[q>>3]=+h[q>>3]+ +h[A+(i<<3)>>3];i=i+1|0;}p=p+1|0;}e:while(1){if((n|0)<(T|0))i=0;else {l=0.0;j=0;break}while(1){if((i|0)>=(a|0))break;h[A+(i<<3)>>3]=0.0;i=i+1|0;}p=n+1|0;g=G+(p<<2)|0;q=O(n,a)|0;j=c[G+(n<<2)>>2]|0;while(1){if((j|0)>=(c[g>>2]|0)){i=0;break}m=H+(j<<2)|0;i=c[m>>2]|0;f:do if((i|0)!=(n|0)){k=+_w(f,a,n,i)*z;i=0;while(1){if((i|0)>=(a|0))break f;l=k*(+h[f+(i+q<<3)>>3]-+h[f+((O(c[m>>2]|0,a)|0)+i<<3)>>3]);V=A+(i<<3)|0;h[V>>3]=+h[V>>3]-l;i=i+1|0;}}while(0);j=j+1|0;}while(1){if((i|0)>=(a|0)){n=p;continue e}V=U+(i+q<<3)|0;h[V>>3]=+h[V>>3]+ +h[A+(i<<3)>>3];i=i+1|0;}}while(1){if((j|0)>=(T|0))break;g=O(j,a)|0;i=0;while(1){if((i|0)>=(a|0)){k=0.0;i=0;break}h[A+(i<<3)>>3]=+h[U+(i+g<<3)>>3];i=i+1|0;}while(1){if((i|0)>=(a|0))break;W=+h[A+(i<<3)>>3];k=W*W+k;i=i+1|0;}k=+C(+k);l=k+l;g:do if(k>0.0){k=1.0/k;i=0;while(1){if((i|0)>=(a|0)){i=0;break g}V=A+(i<<3)|0;h[V>>3]=+h[V>>3]*k;i=i+1|0;}}else i=0;while(0);while(1){if((i|0)>=(a|0))break;V=f+(i+g<<3)|0;h[V>>3]=+h[V>>3]+ +h[A+(i<<3)>>3]*r;i=i+1|0;}j=j+1|0;}s=s+1|0;r=+jq(S,r,l,o,R);if(!((s|0)<(Q|0)&r>P))break;else o=l;}if(c[d+112>>2]|0)kq(a,F,f);U1(v);if((F|0)!=(b|0))qw(F);U1(A);}else c[g>>2]=-100;if(K|0)U1(L);if(J|0)U1(M);if(I|0)U1(N);U1(U);}return}function oq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,E=0.0,F=0,G=0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0.0,P=0.0,Q=0,R=0,S=0,T=0,U=0,V=0.0,W=0,X=0.0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0.0,ia=0;ga=l;l=l+32|0;_=ga+24|0;$=ga+20|0;da=ga+16|0;ea=ga+12|0;fa=ga+8|0;U=ga;s=+h[d>>3];k=d+24|0;r=+h[k>>3];m=d+32|0;q=+h[m>>3];V=+h[d+72>>3];W=c[d+80>>2]|0;X=+h[d+88>>3];t=+h[d+96>>3];Y=c[d+104>>2]|0;c[_>>2]=0;c[$>>2]=10;c[da>>2]=0;c[ea>>2]=0;c[fa>>2]=0;h[U>>3]=0.0;ca=d+56|0;n=c[ca>>2]|0;if(!((b|0)==0|(W|0)<1)?(Z=c[b>>2]|0,i=c[b+4>>2]|0,!((a|0)<1|(i|0)<1)):0){if((i|0)<(c[d+52>>2]|0)){ba=0;aa=0;}else {ba=aq(n)|0;c[da>>2]=KK(a*80|0)|0;c[ea>>2]=KK(80)|0;c[fa>>2]=KK(80)|0;aa=1;}c[g>>2]=0;a:do if((Z|0)==(i|0)){o=vw(b,1)|0;Q=c[o+20>>2]|0;R=c[o+24>>2]|0;b:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);j=O(Z,a)|0;i=0;while(1){if((i|0)>=(j|0))break b;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(r<0.0){r=+dq(o,a,f);h[k>>3]=r;}if(q<0.0){h[m>>3]=.2;q=.2;}if(s>=0.0){h[d>>3]=-1.0;s=-1.0;}N=1.0-s;P=+D(+r,+N);I=+D(+q,+((2.0-s)*.3333333333333333))/r;J=a<<3;S=KK(J)|0;J=O(Z,J)|0;T=KK(J)|0;K=(aa|0)!=0;L=d+116|0;M=d+64|0;F=s==-1.0;G=(e|0)!=0;H=1.0/+(Z|0);i=0;B=0;E=0.0;while(1){B=B+1|0;W6(T|0,f|0,J|0)|0;if(K){i=cq(ba)|0;n=i;i=hw(a,Z,i,f,(c[L>>2]|0)==0?0:e)|0;}u=0.0;s=0.0;v=0;r=0.0;c:while(1){if((v|0)<(Z|0))j=0;else break;while(1){if((j|0)>=(a|0))break;h[S+(j<<3)>>3]=0.0;j=j+1|0;}z=v+1|0;m=Q+(z<<2)|0;A=O(v,a)|0;k=c[Q+(v<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;p=R+(k<<2)|0;j=c[p>>2]|0;d:do if((j|0)!=(v|0)){q=+_w(f,a,v,j)*I;j=0;while(1){if((j|0)>=(a|0))break d;ha=q*(+h[f+(j+A<<3)>>3]-+h[f+((O(c[p>>2]|0,a)|0)+j<<3)>>3]);y=S+(j<<3)|0;h[y>>3]=+h[y>>3]-ha;j=j+1|0;}}while(0);k=k+1|0;}e:do if(!K)if(G&(c[L>>2]|0)!=0){j=0;while(1){if((j|0)==(Z|0))break e;f:do if((j|0)!=(v|0)){ha=+Zw(f,a,v,j);m=e+(j<<3)|0;p=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break f;y=S+(k<<3)|0;h[y>>3]=+h[m>>3]*P*(+h[f+(k+A<<3)>>3]-+h[f+(k+p<<3)>>3])*q+ +h[y>>3];k=k+1|0;}}while(0);j=j+1|0;}}else {j=0;while(1){if((j|0)==(Z|0))break e;g:do if((j|0)!=(v|0)){ha=+Zw(f,a,v,j);m=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break g;y=S+(k<<3)|0;h[y>>3]=(+h[f+(k+A<<3)>>3]-+h[f+(k+m<<3)>>3])*P*q+ +h[y>>3];k=k+1|0;}}while(0);j=j+1|0;}}else {bw(i,+h[M>>3],f+(A<<3)|0,v,_,$,da,ea,fa,U,g);u=+h[U>>3]+u;y=c[_>>2]|0;s=s+ +(y|0);if(c[g>>2]|0){m=S;k=T;i=S;j=T;p=67;break a}m=c[fa>>2]|0;p=c[ea>>2]|0;v=c[da>>2]|0;j=0;while(1){if((j|0)>=(y|0))break e;ha=+h[m+(j<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;w=p+(j<<3)|0;x=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break;ia=S+(k<<3)|0;h[ia>>3]=+h[w>>3]*P*(+h[f+(k+A<<3)>>3]-+h[v+(k+x<<3)>>3])*q+ +h[ia>>3];k=k+1|0;}j=j+1|0;}}while(0);q=0.0;j=0;while(1){if((j|0)>=(a|0))break;ha=+h[S+(j<<3)>>3];q=ha*ha+q;j=j+1|0;}q=+C(+q);r=q+r;h:do if(q>0.0){q=1.0/q;j=0;while(1){if((j|0)>=(a|0)){j=0;break h}ia=S+(j<<3)|0;h[ia>>3]=+h[ia>>3]*q;j=j+1|0;}}else j=0;while(0);while(1){if((j|0)>=(a|0)){v=z;continue c}ia=f+(j+A<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[S+(j<<3)>>3]*t;j=j+1|0;}}if(i|0){ow(i);bq(ba,s*H*5.0+u*H);}t=+jq(Y,t,r,E,X);if(!((B|0)<(W|0)&t>V))break;else E=r;}if(!(c[d+112>>2]|0)){m=S;k=T;j=T;i=S;p=66;}else {kq(a,o,f);m=S;k=T;j=T;i=S;p=66;}}else {c[g>>2]=-100;o=b;m=0;k=0;j=0;i=0;p=66;}while(0);if((p|0)==66)if(aa)p=67;if((p|0)==67){$p(ba);c[ca>>2]=n;}if(k|0)U1(j);if((o|0)!=(b|0))qw(o);if(m|0)U1(i);i=c[da>>2]|0;if(i|0)U1(i);i=c[ea>>2]|0;if(i|0)U1(i);i=c[fa>>2]|0;if(i|0)U1(i);}l=ga;return}function pq(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=+i;j=j|0;var k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0.0,z=0,A=0,B=0.0,E=0,F=0.0,G=0.0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0.0,Z=0,_=0.0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0.0,ia=0;ga=l;l=l+48|0;o=ga+8|0;ba=ga+40|0;ca=ga+36|0;W=ga+32|0;ea=ga+28|0;fa=ga+24|0;X=ga;p=+h[e>>3];q=e+32|0;r=+h[q>>3];Y=+h[e+72>>3];Z=c[e+80>>2]|0;_=+h[e+88>>3];t=+h[e+96>>3];$=c[e+104>>2]|0;c[ba>>2]=0;c[ca>>2]=10;c[W>>2]=0;c[ea>>2]=0;c[fa>>2]=0;h[X>>3]=0.0;if(!((b|0)==0|(Z|0)<1)?(aa=c[b>>2]|0,n=c[b+4>>2]|0,!((a|0)<1|(n|0)<1)):0){if((c[e+132>>2]|0)!=0?(n|0)>=(c[e+52>>2]|0):0){m=KK(a*80|0)|0;c[W>>2]=m;c[ea>>2]=KK(80)|0;c[fa>>2]=KK(80)|0;s=1;k=m;}else {s=0;k=0;m=0;}c[j>>2]=0;if((aa|0)==(n|0)){V=vw(b,1)|0;if(!d){U=0;k=V;}else {U=c[d+28>>2]|0;k=d;}T=c[k+24>>2]|0;S=c[k+20>>2]|0;if(i<0.0){G=+qq(aa,S,U);F=+(c[S+(aa<<2)>>2]|0);B=+(aa|0);i=F/(B*B-F)*i/+D(+G,+(p+1.0));R=c[15712]|0;h[o>>3]=G;h[o+8>>3]=i;w4(R,92231,o)|0;}a:do if(c[e+16>>2]|0){U4(92253,24,1,c[15712]|0)|0;w5(c[e+108>>2]|0);m=O(aa,a)|0;k=0;while(1){if((k|0)>=(m|0))break a;h[g+(k<<3)>>3]=+Sw();k=k+1|0;}}while(0);rq(aa,a,g,S,T,U);if(r<0.0)h[q>>3]=.2;if(p>=0.0){h[e>>3]=-1.0;p=-1.0;}Q=a<<3;P=KK(Q)|0;Q=O(aa,Q)|0;R=KK(Q)|0;I=(s|0)!=0;J=e+116|0;K=(U|0)==0;L=e+8|0;M=(f|0)!=0;N=p==-1.0;G=1.0-p;H=e+64|0;k=0;E=0;F=0.0;p=1.0;B=t;b:while(1){E=E+1|0;W6(R|0,g|0,Q|0)|0;if(I)k=hw(a,aa,10,g,(c[J>>2]|0)==0?0:f)|0;s=0;t=0.0;c:while(1){if((s|0)<(aa|0))m=0;else break;while(1){if((m|0)>=(a|0))break;h[P+(m<<3)>>3]=0.0;m=m+1|0;}A=s+1|0;q=S+(A<<2)|0;z=O(s,a)|0;o=c[S+(s<<2)>>2]|0;while(1){if((o|0)>=(c[q>>2]|0))break;d=T+(o<<2)|0;m=c[d>>2]|0;d:do if((m|0)!=(s|0)){y=+Zw(g,a,s,m);if(!K)p=+h[U+(o<<3)>>3];r=+h[L>>3];e:do if(!(r==2.0))if(r==1.0){r=(y-p)*(1.0/(p*p));u=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;v=r*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*u;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-v;m=m+1|0;}}else {r=1.0/+D(+p,+(r+1.0));u=y-p;v=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;ha=+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3];ha=r*ha*+D(+u,+(+h[L>>3]))*v;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}else {r=y-p;r=r*r*(1.0/(p*p*p));u=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;ha=r*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*u;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}while(0);if(M&(c[J>>2]|0)!=0){n=f+(o<<3)|0;r=+D(+y,+G);r=1.0/(N?y*y:r);m=0;while(1){if((m|0)>=(a|0))break d;ha=+h[n>>3]*i*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*r;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}else {r=+D(+y,+G);r=1.0/(N?y*y:r);m=0;while(1){if((m|0)>=(a|0))break d;ha=(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*i*r;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}}while(0);o=o+1|0;}f:do if(!I)if(M&(c[J>>2]|0)!=0){m=0;while(1){if((m|0)==(aa|0)){r=0.0;m=0;break f}g:do if((m|0)!=(s|0)){ha=+Zw(g,a,s,m);d=f+(m<<3)|0;o=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break g;x=P+(n<<3)|0;h[x>>3]=+h[d>>3]*i*(+h[g+(n+z<<3)>>3]-+h[g+(n+o<<3)>>3])*r+ +h[x>>3];n=n+1|0;}}while(0);m=m+1|0;}}else {m=0;while(1){if((m|0)==(aa|0)){r=0.0;m=0;break f}h:do if((m|0)!=(s|0)){ha=+Zw(g,a,s,m);d=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break h;x=P+(n<<3)|0;h[x>>3]=(+h[g+(n+z<<3)>>3]-+h[g+(n+d<<3)>>3])*i*r+ +h[x>>3];n=n+1|0;}}while(0);m=m+1|0;}}else {bw(k,+h[H>>3],g+(z<<3)|0,s,ba,ca,W,ea,fa,X,j);d=c[ba>>2]|0;if(c[j>>2]|0)break b;o=c[fa>>2]|0;q=c[ea>>2]|0;s=c[W>>2]|0;m=0;while(1){if((m|0)>=(d|0)){r=0.0;m=0;break f}ha=+h[o+(m<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;w=q+(m<<3)|0;x=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break;ia=P+(n<<3)|0;h[ia>>3]=+h[w>>3]*i*(+h[g+(n+z<<3)>>3]-+h[s+(n+x<<3)>>3])*r+ +h[ia>>3];n=n+1|0;}m=m+1|0;}}while(0);while(1){if((m|0)>=(a|0))break;ha=+h[P+(m<<3)>>3];r=ha*ha+r;m=m+1|0;}r=+C(+r);t=r+t;i:do if(r>0.0){r=1.0/r;m=0;while(1){if((m|0)>=(a|0)){m=0;break i}ia=P+(m<<3)|0;h[ia>>3]=+h[ia>>3]*r;m=m+1|0;}}else m=0;while(0);while(1){if((m|0)>=(a|0)){s=A;continue c}ia=g+(m+z<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[P+(m<<3)>>3]*B;m=m+1|0;}}if(k|0)ow(k);B=+jq($,B,t,F,_);if(!((E|0)<(Z|0)&B>Y)){da=83;break}else F=t;}if((da|0)==83?c[e+112>>2]|0:0)kq(a,V,g);U1(R);if((V|0)!=(b|0))qw(V);U1(P);k=c[W>>2]|0;m=k;}else c[j>>2]=-100;if(m|0)U1(k);k=c[ea>>2]|0;if(k|0)U1(k);k=c[fa>>2]|0;if(k|0)U1(k);}l=ga;return}function qq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0.0;if(!d)e=1.0;else {f=0;e=0.0;a:while(1){if((f|0)>=(a|0))break;g=f+1|0;i=c[b+(g<<2)>>2]|0;f=c[b+(f<<2)>>2]|0;while(1){if((f|0)>=(i|0)){f=g;continue a}j=+h[d+(f<<3)>>3]+e;f=f+1|0;e=j;}}e=e/+(c[b+(a<<2)>>2]|0);}return +e}function rq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0;v=l;l=l+16|0;u=v;t=(g|0)==0;k=0.0;m=0.0;n=1.0;j=0;a:while(1){if((j|0)>=(a|0))break;r=j+1|0;s=e+(r<<2)|0;q=c[e+(j<<2)>>2]|0;while(1){if((q|0)>=(c[s>>2]|0)){j=r;continue a}i=c[f+(q<<2)>>2]|0;b:do if((i|0)!=(j|0)){o=+Zw(d,b,j,i);if(!t)n=+h[g+(q<<3)>>3];w=1.0/(n*n);p=n*o*w;o=o*o*w;i=0;while(1){if((i|0)>=(b|0))break b;i=i+1|0;k=k+o;m=m+p;}}while(0);q=q+1|0;}}k=m/k;j=O(b,a)|0;i=0;while(1){if((i|0)>=(j|0))break;b=d+(i<<3)|0;h[b>>3]=+h[b>>3]*k;i=i+1|0;}d=c[15712]|0;h[u>>3]=k;w4(d,92278,u)|0;l=v;return}function sq(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,E=0,F=0,G=0.0,H=0,I=0.0,J=0,K=0,L=0,M=0.0,N=0.0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0.0,X=0,Y=0.0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0.0,ha=0.0,ia=0;fa=l;l=l+32|0;$=fa+24|0;aa=fa+20|0;ba=fa+16|0;da=fa+12|0;ea=fa+8|0;V=fa;r=+h[e>>3];p=e+24|0;o=+h[p>>3];q=e+32|0;n=+h[q>>3];W=+h[e+72>>3];X=c[e+80>>2]|0;Y=+h[e+88>>3];v=+h[e+96>>3];Z=c[e+104>>2]|0;c[$>>2]=0;c[aa>>2]=10;c[ba>>2]=0;c[da>>2]=0;c[ea>>2]=0;h[V>>3]=0.0;if(!((b|0)==0|(X|0)<1)?(_=c[b>>2]|0,m=c[b+4>>2]|0,!((a|0)<1|(m|0)<1)):0){if((m|0)<(c[e+52>>2]|0)){s=0;j=0;k=0;}else {k=KK(a*80|0)|0;c[ba>>2]=k;c[da>>2]=KK(80)|0;c[ea>>2]=KK(80)|0;s=1;j=k;}c[i>>2]=0;if((_|0)==(m|0)){Q=vw(b,1)|0;R=c[Q+20>>2]|0;S=c[Q+24>>2]|0;T=c[d+20>>2]|0;U=c[d+24>>2]|0;P=c[d+28>>2]|0;a:do if(c[e+16>>2]|0){w5(c[e+108>>2]|0);k=O(_,a)|0;j=0;while(1){if((j|0)>=(k|0))break a;h[g+(j<<3)>>3]=+Sw();j=j+1|0;}}while(0);if(o<0.0){o=+dq(Q,a,g);h[p>>3]=o;}if(n<0.0){h[q>>3]=.2;n=.2;}if(r>=0.0){h[e>>3]=-1.0;r=-1.0;}M=1.0-r;N=+D(+o,+M);I=+D(+n,+((2.0-r)*.3333333333333333))/o;K=a<<3;J=KK(K)|0;K=O(_,K)|0;L=KK(K)|0;E=(s|0)!=0;F=e+116|0;G=I*.2;H=e+64|0;A=r==-1.0;B=(f|0)!=0;j=0;y=0;z=0.0;b:while(1){y=y+1|0;W6(L|0,g|0,K|0)|0;if(E)j=hw(a,_,10,g,(c[F>>2]|0)==0?0:f)|0;s=0;o=0.0;c:while(1){if((s|0)<(_|0))k=0;else break;while(1){if((k|0)>=(a|0))break;h[J+(k<<3)>>3]=0.0;k=k+1|0;}w=s+1|0;d=R+(w<<2)|0;x=O(s,a)|0;m=c[R+(s<<2)>>2]|0;while(1){if((m|0)>=(c[d>>2]|0))break;p=S+(m<<2)|0;k=c[p>>2]|0;d:do if((k|0)!=(s|0)){n=+_w(g,a,s,k)*I;k=0;while(1){if((k|0)>=(a|0))break d;r=n*(+h[g+(k+x<<3)>>3]-+h[g+((O(c[p>>2]|0,a)|0)+k<<3)>>3]);u=J+(k<<3)|0;h[u>>3]=+h[u>>3]-r;k=k+1|0;}}while(0);m=m+1|0;}p=T+(w<<2)|0;d=c[T+(s<<2)>>2]|0;while(1){if((d|0)>=(c[p>>2]|0))break;q=U+(d<<2)|0;k=c[q>>2]|0;e:do if((k|0)!=(s|0)){n=+Zw(g,a,s,k);m=P+(d<<3)|0;r=1.0/n;k=0;while(1){if((k|0)>=(a|0))break e;ha=+h[m>>3];ga=n-ha;ga=ga*ga*G*(+h[g+(k+x<<3)>>3]-+h[g+((O(c[q>>2]|0,a)|0)+k<<3)>>3])*r;u=J+(k<<3)|0;h[u>>3]=(n>3];k=k+1|0;}}while(0);d=d+1|0;}f:do if(!E)if(B&(c[F>>2]|0)!=0){k=0;while(1){if((k|0)==(_|0)){n=0.0;k=0;break f}g:do if((k|0)!=(s|0)){ha=+Zw(g,a,s,k);d=f+(k<<3)|0;p=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break g;u=J+(m<<3)|0;h[u>>3]=+h[d>>3]*N*(+h[g+(m+x<<3)>>3]-+h[g+(m+p<<3)>>3])*n+ +h[u>>3];m=m+1|0;}}while(0);k=k+1|0;}}else {k=0;while(1){if((k|0)==(_|0)){n=0.0;k=0;break f}h:do if((k|0)!=(s|0)){ha=+Zw(g,a,s,k);d=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break h;u=J+(m<<3)|0;h[u>>3]=(+h[g+(m+x<<3)>>3]-+h[g+(m+d<<3)>>3])*N*n+ +h[u>>3];m=m+1|0;}}while(0);k=k+1|0;}}else {bw(j,+h[H>>3],g+(x<<3)|0,s,$,aa,ba,da,ea,V,i);d=c[$>>2]|0;if(c[i>>2]|0)break b;p=c[ea>>2]|0;q=c[da>>2]|0;s=c[ba>>2]|0;k=0;while(1){if((k|0)>=(d|0)){n=0.0;k=0;break f}ha=+h[p+(k<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;t=q+(k<<3)|0;u=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break;ia=J+(m<<3)|0;h[ia>>3]=+h[t>>3]*N*(+h[g+(m+x<<3)>>3]-+h[s+(m+u<<3)>>3])*n+ +h[ia>>3];m=m+1|0;}k=k+1|0;}}while(0);while(1){if((k|0)>=(a|0))break;ha=+h[J+(k<<3)>>3];n=ha*ha+n;k=k+1|0;}n=+C(+n);o=n+o;i:do if(n>0.0){n=1.0/n;k=0;while(1){if((k|0)>=(a|0)){k=0;break i}ia=J+(k<<3)|0;h[ia>>3]=+h[ia>>3]*n;k=k+1|0;}}else k=0;while(0);while(1){if((k|0)>=(a|0)){s=w;continue c}ia=g+(k+x<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[J+(k<<3)>>3]*v;k=k+1|0;}}if(j|0)ow(j);v=+jq(Z,v,o,z,Y);if(!((y|0)<(X|0)&v>W)){ca=70;break}else z=o;}if((ca|0)==70?c[e+112>>2]|0:0)kq(a,Q,g);U1(L);if((Q|0)!=(b|0))qw(Q);U1(J);j=c[ba>>2]|0;k=j;}else c[i>>2]=-100;if(k|0)U1(j);j=c[da>>2]|0;if(j|0)U1(j);j=c[ea>>2]|0;if(j|0)U1(j);}l=fa;return}function tq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=c[b+20>>2]|0;o=c[b+24>>2]|0;p=KK(a<<3)|0;m=c[b>>2]|0;k=0;a:while(1){if((k|0)<(m|0))b=0;else break;while(1){if((b|0)>=(a|0))break;h[p+(b<<3)>>3]=0.0;b=b+1|0;}l=k+1|0;j=c[n+(l<<2)>>2]|0;i=c[n+(k<<2)>>2]|0;b=0;while(1){if((i|0)>=(j|0))break;e=c[o+(i<<2)>>2]|0;if((e|0)!=(k|0)){g=O(e,a)|0;e=0;while(1){if((e|0)>=(a|0))break;q=p+(e<<3)|0;h[q>>3]=+h[q>>3]+ +h[d+(g+e<<3)>>3];e=e+1|0;}b=b+1|0;}i=i+1|0;}if((b|0)<=0){k=l;continue}f=.5/+(b|0);e=O(k,a)|0;b=0;while(1){if((b|0)>=(a|0)){k=l;continue a}q=d+(b+e<<3)|0;h[q>>3]=+h[p+(b<<3)>>3]*f+ +h[q>>3]*.5;b=b+1|0;}}U1(p);return}function uq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0.0;i=c[a+20>>2]|0;j=c[a+24>>2]|0;h=c[a>>2]|0;k=KK((h<<2)+4|0)|0;a=0;while(1){if((a|0)>(h|0)){d=0;e=0;break}c[k+(a<<2)>>2]=0;a=a+1|0;}while(1){if((e|0)>=(h|0))break;f=e+1|0;g=c[i+(f<<2)>>2]|0;a=0;b=c[i+(e<<2)>>2]|0;while(1){if((b|0)>=(g|0))break;a=a+((e|0)!=(c[j+(b<<2)>>2]|0)&1)|0;b=b+1|0;}g=k+(a<<2)|0;e=(c[g>>2]|0)+1|0;c[g>>2]=e;d=(d|0)>(e|0)?d:e;e=f;}l=+(c[k+4>>2]|0);if(+(d|0)*.8=(g|0)){e=0;break}h[n+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((e|0)>=(b|0)){g=0;break}h[j+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=j+(e<<3)|0;h[m>>3]=+h[m>>3]+ +h[c+(e+i<<3)>>3];e=e+1|0;}g=g+1|0;}d=1.0/+(a|0);e=0;while(1){if((e|0)>=(b|0)){g=0;break}m=j+(e<<3)|0;h[m>>3]=+h[m>>3]*d;e=e+1|0;}while(1){if((g|0)>=(a|0)){i=0;break}i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=c+(e+i<<3)|0;h[m>>3]=+h[m>>3]-+h[j+(e<<3)>>3];e=e+1|0;}g=g+1|0;}while(1){if((i|0)>=(a|0))break;j=O(i,b)|0;g=0;while(1){if((g|0)>=(b|0))break;k=c+(g+j<<3)|0;m=O(g,b)|0;e=0;while(1){if((e|0)==(b|0))break;p=n+(e+m<<3)|0;h[p>>3]=+h[p>>3]+ +h[c+(e+j<<3)>>3]*+h[k>>3];e=e+1|0;}g=g+1|0;}i=i+1|0;}d=+h[n+8>>3];if(d==0.0)d=0.0;else {q=+h[n>>3];f=+h[n+24>>3];d=-(f-q-+C(+(q*q+d*d*4.0+(q*-2.0+f)*f)))/(d*2.0);}f=+C(+(d*d+1.0));d=d/f;f=1.0/f;e=0;while(1){if((e|0)>=(a|0))break;p=O(e,b)|0;n=c+(p<<3)|0;q=+h[n>>3];p=c+(p+1<<3)|0;r=+h[p>>3];h[n>>3]=r*f+q*d;h[p>>3]=r*d-q*f;e=e+1|0;}l=o;return}function wq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;xq(a,b,c,d,e,f,g,h,i,j);return}function xq(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+192|0;I=M+176|0;H=M+168|0;K=M;W6(K|0,e|0,168)|0;c[m>>2]=0;do if(b|0?(L=c[b+4>>2]|0,!((a|0)<1|(L|0)<1)):0){if((ww(b,0)|0)!=0?(c[b+16>>2]|0)==1:0){if((c[e+136>>2]|0)==1)o=Bw(d)|0;else o=d;J=Bw(b)|0;}else t=5;do if((t|0)==5)if((c[e+136>>2]|0)==1){J=Aw(b,0)|0;o=Aw(d,0)|0;break}else {J=Qw(b)|0;o=d;break}while(0);G=e+160|0;p=c[G>>2]|0;if((p|0)==3){if((j|0)>0)t=14;}else if((j|0)>0&(p|0)==4)t=14;if((t|0)==14){d=KK(O(a<<3,c[J>>2]|0)|0)|0;L=yq(J,j,k)|0;wq(a,L,0,e,0,0,d,0,0,m);zq(a,J,j,k,i,d);lu(a,J,i,g,c[e+124>>2]|0,+h[e+144>>3],c[G>>2]|0,j,k);qw(L);U1(d);if((J|0)==(b|0))break;qw(J);break}E=fx(c[e+44>>2]|0,c[e+48>>2]|0)|0;c[E+16>>2]=c[e+40>>2];F=tx(J,o,f,E)|0;q=wx(F)|0;if(!(c[q+32>>2]|0))r=i;else r=KK(O(a<<3,c[q+4>>2]|0)|0)|0;p=uq(J)|0;if(+h[e>>3]==-1.0001234)h[e>>3]=(p|0)==0?-1.0:-1.8;v=e+136|0;w=e+24|0;x=e+16|0;y=e+104|0;z=e+96|0;A=a<<3;B=e+132|0;C=c[15712]|0;D=e+80|0;while(1){a:do switch(c[v>>2]|0){case 0:{switch(c[B>>2]|0){case 0:{nq(a,c[q+8>>2]|0,e,c[q+24>>2]|0,r,m);break a}case 2:{p=q+8|0;t=29;break}case 3:{p=q+8|0;s=c[p>>2]|0;if((c[s>>2]|0)>1e4)if(!0)t=29;else;else t=30;break}default:{s=c[q+8>>2]|0;t=30;}}if((t|0)==29){iq(a,c[p>>2]|0,e,c[q+24>>2]|0,r,m);break a}else if((t|0)==30){oq(a,s,e,c[q+24>>2]|0,r,m);break a}break}case 1:{h[z>>3]=1.0;c[y>>2]=1;u=(c[q+28>>2]|0)==0;n=u?.5:.05;c[D>>2]=u?500:100;u=(c[q+32>>2]|0)==0;p=q+8|0;s=q+12|0;t=q+24|0;pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n,m);if(u){c[x>>2]=0;h[z>>3]=.05;c[y>>2]=0;pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.5,m);pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.125,m);pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.03125,m);}break}default:{}}while(0);t=c[q+32>>2]|0;if(!t){t=39;break}if(c[m>>2]|0){t=35;break}u=c[q+16>>2]|0;p=c[q+40>>2]|0;if(!(c[t+32>>2]|0))s=i;else s=KK(O(A,c[t+4>>2]|0)|0)|0;Aq(a,c[t+8>>2]|0,u,c[t+20>>2]|0,r,s,p,+h[w>>3]*.001);U1(r);c[x>>2]=0;h[w>>3]=+h[w>>3]*.75;c[y>>2]=0;h[z>>3]=((c[(c[t+28>>2]|0)+40>>2]|0)+-9|0)>>>0<2?1.0:.1;q=t;r=s;}if((t|0)==35)U1(r);else if((t|0)==39){Ux(a,J,e,f,i,m);if(0);if((a|0)==2)vq(L,2,i);n=+h[e+152>>3];if(n!=0.0)Bq(L,a,i,n);lu(a,J,i,g,c[e+124>>2]|0,+h[e+144>>3],c[G>>2]|0,j,k);}W6(e|0,K|0,168)|0;if((J|0)!=(b|0))qw(J);if(!((o|0)==0|(o|0)==(d|0)))qw(o);gx(E);hx(F);}while(0);l=M;return}function yq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;x=y;u=c[a+20>>2]|0;v=c[a+24>>2]|0;w=KK(c[a>>2]<<2)|0;e=0;while(1){if((e|0)>=(c[a>>2]|0)){e=0;break}c[w+(e<<2)>>2]=1;e=e+1|0;}while(1){if((e|0)>=(b|0)){e=0;d=0;break}c[w+(c[d+(e<<2)>>2]<<2)>>2]=-1;e=e+1|0;}while(1){m=c[a>>2]|0;if((d|0)>=(m|0)){d=0;b=0;break}b=w+(d<<2)|0;if((c[b>>2]|0)>0){c[b>>2]=e;e=e+1|0;}d=d+1|0;}a:while(1){while(1){if((b|0)>=(m|0))break a;if((c[w+(b<<2)>>2]|0)>=0)break;b=b+1|0;}j=b+1|0;k=c[u+(j<<2)>>2]|0;i=c[u+(b<<2)>>2]|0;while(1){if((i|0)>=(k|0)){b=j;continue a}f=c[v+(i<<2)>>2]|0;b:do if((c[w+(f<<2)>>2]|0)>-1)d=d+1|0;else {h=c[u+(f+1<<2)>>2]|0;g=c[u+(f<<2)>>2]|0;while(1){if((g|0)>=(h|0))break b;f=c[v+(g<<2)>>2]|0;if((f|0)!=(b|0))d=((c[w+(f<<2)>>2]|0)>>>31^1)+d|0;g=g+1|0;}}while(0);i=i+1|0;}}b=d<<2;if((d|0)>0){r=KK(b)|0;s=KK(b)|0;p=s;q=r;}else {p=0;q=0;r=0;s=0;}t=c[15712]|0;b=0;f=0;c:while(1){d=c[a>>2]|0;while(1){if((b|0)>=(d|0))break c;o=w+(b<<2)|0;if((c[o>>2]|0)>=0)break;b=b+1|0;}m=b+1|0;n=u+(m<<2)|0;k=c[u+(b<<2)>>2]|0;d=f;while(1){if((k|0)>=(c[n>>2]|0)){b=m;f=d;continue c}f=v+(k<<2)|0;g=c[f>>2]|0;d:do if((c[w+(g<<2)>>2]|0)>-1){c[q+(d<<2)>>2]=c[o>>2];c[p+(d<<2)>>2]=c[w+(c[f>>2]<<2)>>2];d=d+1|0;}else {j=u+(g+1<<2)|0;i=c[u+(g<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break d;f=v+(i<<2)|0;h=c[f>>2]|0;do if((h|0)!=(b|0)?(c[w+(h<<2)>>2]|0)>-1:0){c[q+(d<<2)>>2]=c[o>>2];h=d+1|0;c[p+(d<<2)>>2]=c[w+(c[f>>2]<<2)>>2];g=c[o>>2]|0;d=c[w+(c[f>>2]<<2)>>2]|0;if((g|0)!=68)if((d|0)==68)d=68;else {d=h;break}c[x>>2]=g;c[x+4>>2]=d;w4(t,92380,x)|0;d=h;}while(0);i=i+1|0;}}while(0);k=k+1|0;}}x=Dw(f,e,e,q,p,0,8,8)|0;U1(r);U1(s);U1(w);l=y;return x|0}function zq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0;p=KK(c[b>>2]<<2)|0;i=0;while(1){if((i|0)>=(c[b>>2]|0)){i=0;break}c[p+(i<<2)>>2]=1;i=i+1|0;}while(1){if((i|0)>=(d|0)){i=0;l=0;break}j=c[e+(i<<2)>>2]|0;if((j|0)>-1?(j|0)<(c[b>>2]|0):0)c[p+(j<<2)>>2]=-1;i=i+1|0;}while(1){n=c[b>>2]|0;if((l|0)>=(n|0)){l=0;break}j=p+(l<<2)|0;if((c[j>>2]|0)>-1){c[j>>2]=i;i=i+1|0;}l=l+1|0;}while(1){if((l|0)>=(n|0))break;i=c[p+(l<<2)>>2]|0;a:do if((i|0)>-1){m=O(l,a)|0;j=O(i,a)|0;i=0;while(1){if((i|0)>=(a|0))break a;h[f+(i+m<<3)>>3]=+h[g+(j+i<<3)>>3];i=i+1|0;}}while(0);l=l+1|0;}o=b+20|0;g=b+24|0;n=0;while(1){if((n|0)>=(d|0))break;b=c[e+(n<<2)>>2]|0;i=c[o>>2]|0;l=c[i+(b+1<<2)>>2]|0;i=c[i+(b<<2)>>2]|0;m=l-i|0;b=O(b,a)|0;j=0;while(1){if((j|0)>=(a|0))break;h[f+(j+b<<3)>>3]=0.0;j=j+1|0;}while(1){if((i|0)<(l|0))j=0;else break;while(1){if((j|0)>=(a|0))break;k=+h[f+((O(c[(c[g>>2]|0)+(i<<2)>>2]|0,a)|0)+j<<3)>>3];q=f+(j+b<<3)|0;h[q>>3]=+h[q>>3]+k;j=j+1|0;}i=i+1|0;}k=1.0/+(m|0);i=0;while(1){if((i|0)>=(a|0))break;q=f+(i+b<<3)|0;h[q>>3]=+h[q>>3]*k;i=i+1|0;}n=n+1|0;}U1(p);return}function Aq(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=+j;var k=0,m=0,n=0,o=0,p=0,q=0.0;o=l;l=l+16|0;n=o;c[n>>2]=g;Gw(d,0,f,0,n,0,a);a:do if((i+-1|0)>>>0<6){tq(a,b,c[n>>2]|0);k=c[e>>2]|0;m=c[e+20>>2]|0;g=c[e+24>>2]|0;b=0;b:while(1){if((b|0)>=(k|0))break a;i=b+1|0;e=m+(i<<2)|0;b=c[m+(b<<2)>>2]|0;c:while(1){b=b+1|0;if((b|0)>=(c[e>>2]|0)){b=i;continue b}f=g+(b<<2)|0;d=0;while(1){if((d|0)>=(a|0))continue c;q=(+Sw()+-.5)*j;p=(c[n>>2]|0)+((O(c[f>>2]|0,a)|0)+d<<3)|0;h[p>>3]=+h[p>>3]+q;d=d+1|0;}}}}while(0);l=o;return}function Bq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;k=l;l=l+16|0;j=k;e=0;while(1){if((e|0)>=(b|0)){g=0;break}h[j+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=j+(e<<3)|0;h[m>>3]=+h[m>>3]+ +h[c+(e+i<<3)>>3];e=e+1|0;}g=g+1|0;}f=1.0/+(a|0);e=0;while(1){if((e|0)>=(b|0)){g=0;break}m=j+(e<<3)|0;h[m>>3]=+h[m>>3]*f;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=c+(e+i<<3)|0;h[m>>3]=+h[m>>3]-+h[j+(e<<3)>>3];e=e+1|0;}g=g+1|0;}d=d*-.017453277777777776;f=+E(+d);d=+F(+d);e=0;while(1){if((e|0)>=(a|0))break;m=O(e,b)|0;j=c+(m<<3)|0;n=+h[j>>3];m=c+(m+1<<3)|0;o=+h[m>>3];h[j>>3]=o*d+n*f;h[m>>3]=o*f-n*d;e=e+1|0;}l=k;return}function Cq(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;i=i|0;var j=0,k=0,l=0,m=0;m=(ww(b,0)|0)==0;j=(c[b+16>>2]|0)==1;if(m)if(j)j=Bw(vw(b,0)|0)|0;else k=5;else if(j)j=b;else k=5;if((k|0)==5)j=Qw(b)|0;m=Bw(j)|0;c[i>>2]=0;j=c[m>>2]|0;if(!d){KK(O(a<<3,j)|0)|0;ab();}l=Gx(m,a,0.0,c[d>>2]|0,(e|0)==0?0:2,1)|0;if(!l)c[i>>2]=-1;else {h[l+40>>3]=.1;c[l+24>>2]=5;+Ix(l,a,c[d>>2]|0,f,g);k=O(j,a)|0;e=l+32|0;j=0;while(1){if((j|0)>=(k|0))break;i=(c[d>>2]|0)+(j<<3)|0;h[i>>3]=+h[i>>3]/+h[e>>3];j=j+1|0;}Hx(l);}if((m|0)!=(b|0))qw(m);return}function Dq(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;Cq(a,c,d,e,f,g,h);return}function Eq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;v=c[b>>2]|0;w=c[b+20>>2]|0;t=c[b+24>>2]|0;u=c[b+28>>2]|0;if(!(ww(b,0)|0))qa(95795,92387,37,92404);a=KK(56)|0;k=a+20|0;c[k>>2]=0;c[a+24>>2]=2;c[a+12>>2]=0;j=KK(16)|0;c[k>>2]=j;h[j>>3]=e;h[j+8>>3]=f;c[a+16>>2]=105;h[a+40>>3]=.01;c[a+48>>2]=~~+C(+(+(c[b>>2]|0)));j=b+8|0;k=a+4|0;c[k>>2]=rw(v,v,(c[j>>2]|0)+v|0,1,1)|0;j=rw(v,v,(c[j>>2]|0)+v|0,1,1)|0;c[a+8>>2]=j;k=c[k>>2]|0;l=c[k+28>>2]|0;m=c[j+28>>2]|0;if((j|0)==0|(k|0)==0){Fx(a);a=0;}else {n=c[k+20>>2]|0;o=c[k+24>>2]|0;p=c[j+20>>2]|0;q=c[j+24>>2]|0;c[p>>2]=0;c[n>>2]=0;b=0;d=0;while(1){if((b|0)>=(v|0))break;r=b+1|0;s=w+(r<<2)|0;e=0.0;f=0.0;i=c[w+(b<<2)>>2]|0;while(1){if((i|0)>=(c[s>>2]|0))break;g=c[t+(i<<2)>>2]|0;if((g|0)!=(b|0)){x=+h[u+(i<<3)>>3];x=x>=0.0?x:-x;x=x>.01?x:.01;c[o+(d<<2)>>2]=g;c[q+(d<<2)>>2]=g;g=l+(d<<3)|0;h[g>>3]=-1.0;h[m+(d<<3)>>3]=-x;e=+h[g>>3]+e;f=f-x;d=d+1|0;}i=i+1|0;}c[o+(d<<2)>>2]=b;c[q+(d<<2)>>2]=b;h[l+(d<<3)>>3]=-e;h[m+(d<<3)>>3]=-f;d=d+1|0;c[n+(r<<2)>>2]=d;c[p+(r<<2)>>2]=d;b=r;}c[k+8>>2]=d;c[j+8>>2]=d;}return a|0}function Fq(a){a=a|0;Fx(a);return}function Gq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +(+Jx(a,b,c,d,.001))}function Hq(a,b){a=a|0;b=+b;var d=0,e=0,f=0,g=0;if((c[a+16>>2]|0)==1)d=vw(a,0)|0;else d=Qw(a)|0;f=c[d+28>>2]|0;a:do if(b!=1.0){e=c[d+8>>2]|0;a=0;while(1){if((a|0)>=(e|0))break a;g=f+(a<<3)|0;h[g>>3]=+h[g>>3]*b;a=a+1|0;}}while(0);return d|0}function Iq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0.0;j=c[b>>2]|0;c[e>>2]=0;k=O(j,a)|0;e=0;while(1){if((e|0)>=(k|0)){e=1;f=1;break}h[d+(e<<3)>>3]=+Sw()*100.0;e=e+1|0;}while(1){if((f|0)>=(j|0))break;i=O(f,a)|0;g=0;while(1){if((g|0)>=(a|0))break;l=+h[d+(g<<3)>>3]-+h[d+(g+i<<3)>>3];if((l>=0.0?l:-l)>1.0e-16){e=0;f=j;break}else g=g+1|0;}f=f+1|0;}a:do if(e|0){w5(1);e=0;while(1){if((e|0)>=(k|0))break a;h[d+(e<<3)>>3]=+Sw()*100.0;e=e+1|0;}}while(0);e=Hq(b,1.0)|0;if(!(ww(e,0)|0))qa(92430,92387,164,92466);else {k=Eq(0,e,0,101.0e5,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,101.0e3,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,1010.0,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,10.1,100.0,0)|0;+Gq(k,a,d,300);Fq(k);ax(0.0,0.0,490.0,700.0,c[b>>2]|0,a,d);qw(e);return}}function Jq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0;k=KK((tB(a)|0)<<4)|0;i=(e|0)!=0;j=b+8|0;g=jC(a)|0;f=0;while(1){if(!g)break;if(i)f=f+((Q2(KB(g)|0,92481,11)|0)==0&1)|0;m=c[g+16>>2]|0;l=c[m+120>>2]<<1;h[k+(l<<3)>>3]=+h[m+32>>3]*.5+ +h[b>>3];h[k+((l|1)<<3)>>3]=+h[m+40>>3]*.5+ +h[j>>3];g=kC(a,g)|0;}if(i&(f|0)!=0){b=KK(f<<2)|0;g=jC(a)|0;f=0;while(1){if(!g)break;if(!(Q2(KB(g)|0,92481,11)|0)){c[b+(f<<2)>>2]=c[(c[g+16>>2]|0)+120>>2];f=f+1|0;}g=kC(a,g)|0;}c[e>>2]=b;c[d>>2]=f;}return k|0}function Kq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;z=l;l=l+32|0;w=z+16|0;v=z+8|0;u=z;if(a){x=tB(a)|0;y=uB(a)|0;b=jC(a)|0;e=0;while(1){if(!b)break;c[(c[b+16>>2]|0)+120>>2]=e;b=kC(a,b)|0;e=e+1|0;}r=y<<2;q=KK(r)|0;r=KK(r)|0;b=y<<3;s=KK(b)|0;o=GA(a,2,101541,0)|0;t=(d|0)!=0;if(t){e=GA(a,2,92493,0)|0;p=JK(b)|0;n=p;}else {n=0;e=0;p=0;}j=(o|0)==0;k=(e|0)==0;i=jC(a)|0;b=0;while(1){if(!i)break;m=c[(c[i+16>>2]|0)+120>>2]|0;g=XA(a,i)|0;while(1){if(!g)break;c[q+(b<<2)>>2]=m;c[r+(b<<2)>>2]=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+120>>2];if(!j?(A=RA(g,o)|0,c[v>>2]=u,(b5(A,101209,v)|0)==1):0)f=+h[u>>3];else {h[u>>3]=1.0;f=1.0;}h[s+(b<<3)>>3]=f;if(!k){A=RA(g,e)|0;c[w>>2]=u;if((b5(A,101209,w)|0)==1)f=+h[u>>3];else {h[u>>3]=1.0;f=1.0;}h[n+(b<<3)>>3]=f;}g=ZA(a,g)|0;b=b+1|0;}i=kC(a,i)|0;}b=Dw(y,x,x,q,r,s,1,8)|0;if(t)c[d>>2]=Dw(y,x,x,q,r,p,1,8)|0;U1(q);U1(r);U1(s);if(n)U1(p);}else b=0;l=z;return b|0}function Lq(a){a=a|0;var b=0,d=0,e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0.0,p=0.0;m=l;l=l+16|0;k=m;a:do if(Mq(a,k)|0){b=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;g=+h[b>>3];e=+h[b+8>>3];b=jC(a)|0;while(1){if(!b)break;f=c[(c[b+16>>2]|0)+132>>2]|0;h[f>>3]=+h[f>>3]-g;f=f+8|0;h[f>>3]=+h[f>>3]-e;b=kC(a,b)|0;}b=(g!=0.0|e!=0.0)&1;d=jC(a)|0;while(1){if(!d)break a;f=XA(a,d)|0;if(f|0)break;d=kC(a,d)|0;}n=c[f>>2]&3;d=c[(c[(c[((n|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;f=c[(c[(c[((n|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;i=+h[f+8>>3];j=+h[f>>3];e=+K(+(+h[d+8>>3]-i),+(+h[d>>3]-j));e=+h[k>>3]-e;h[k>>3]=e;if(e!=0.0){g=+E(+e);e=+F(+e);b=jC(a)|0;while(1){if(!b){b=1;break a}k=c[(c[b+16>>2]|0)+132>>2]|0;p=+h[k>>3]-j;n=k+8|0;o=+h[n>>3]-i;h[k>>3]=p*g+j-o*e;h[n>>3]=p*e+i+o*g;b=kC(a,b)|0;}}}else b=0;while(0);l=m;return b|0}function Mq(b,d){b=b|0;d=d|0;var e=0.0,f=0,g=0;g=l;l=l+16|0;f=g;b=QA(b,92497)|0;do if((b|0)!=0?(a[b>>0]|0)!=0:0){e=+s5(b,f);if((c[f>>2]|0)==(b|0))if(!((dP(b)|0)<<24>>24)){b=0;break}else e=0.0;while(1){if(!(e>180.0))break;e=e+-360.0;}while(1){if(!(e<=-180.0))break;e=e+360.0;}h[d>>3]=e*.017453292519943295;b=1;}else b=0;while(0);l=g;return b|0}function Nq(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=QA(a,92507)|0;return Oq(a,(d|0)==0?(c|0?c:195059):d,b)|0}function Oq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0;n=l;l=l+32|0;m=n+16|0;j=n+8|0;i=n;if((d|0)!=0?(a[d>>0]|0)!=0:0){f=17896;while(1){g=c[f+4>>2]|0;if(!g)break;if(!(j3(d,g,c[f+8>>2]|0)|0)){k=6;break}f=f+16|0;}if((k|0)==6){if(!(c[f+12>>2]|0)){c[i>>2]=g;gA(0,92515,i)|0;f=17896;}i=c[f>>2]|0;c[e>>2]=i;c[e+4>>2]=c[f+12>>2];if((i|0)==18)Pq(b,d+(c[f+8>>2]|0)|0,e);}if(!(c[f+4>>2]|0)){f=eP(d,63)|0;if(f<<24>>24==63){c[j>>2]=d;gA(0,92557,j)|0;f=0;}else f=f&255;f=(f|0)==0;c[e>>2]=f&1;f=f?92604:135709;k=15;}}else {c[e>>2]=0;f=135709;k=15;}if((k|0)==15)c[e+4>>2]=f;if(0);l=n;return e|0}function Pq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e;g=e+4|0;c[f>>2]=g;f=(b5(b,137395,f)|0)>0;b=c[g>>2]|0;c[d+8>>2]=f&(b|0)>-1?b:1e3;h[d+16>>3]=+_O(a,GA(a,0,92648,0)|0,-4.0,-1.0e10);l=e;return}function Qq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+16|0;g=h+8|0;f=h;do if((tB(a)|0)>=2){d=Lq(a)|0;d=(Rq(a)|0)+d|0;e=c[b>>2]|0;if(e){if(0);if(e>>>0>2){switch(e|0){case 3:{e=Sr(a,1)|0;break}case 4:{e=Sr(a,0)|0;break}case 6:case 5:{e=0;break}case 10:case 9:case 7:case 8:case 14:case 13:case 11:case 12:{Cr(a,e)|0;e=0;break}case 15:{e=Sr(a,-1)|0;break}default:{c[g>>2]=c[b+4>>2];gA(0,93e3,g)|0;e=0;}}d=e+d|0;break}if(Sq(a)|0){Tq();U1(c[46845]|0);c[46845]=0;break}Uq(a);if((c[b>>2]|0)==2)e=Vq()|0;else e=Wq()|0;if(e|0)Xq();Tq();U1(c[46845]|0);c[46845]=0;d=e+d|0;}}else d=0;while(0);l=h;return d|0}function Rq(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0;m=l;l=l+48|0;i=m+24|0;f=m+16|0;j=m;b=QA(a,140742)|0;a:do if(((b|0)!=0?(k=j+8|0,c[f>>2]=j,c[f+4>>2]=k,e=b5(b,105503,f)|0,(e|0)!=0):0)?(g=+h[j>>3],!(+B(+g)<1.0e-09)):0){if((e|0)!=1){d=+h[k>>3];if(+B(+d)<1.0e-09){b=0;break}}else {h[k>>3]=g;d=g;}if(!(d==1.0&g==1.0)){if(0);b=jC(a)|0;while(1){if(!b){b=1;break a}i=c[(c[b+16>>2]|0)+132>>2]|0;h[i>>3]=+h[i>>3]*+h[j>>3];i=i+8|0;h[i>>3]=+h[i>>3]*+h[k>>3];b=kC(a,b)|0;}}else b=0;}else b=0;while(0);l=m;return b|0}function Sq(b){b=b|0;var d=0,e=0,f=0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;n=l;l=l+16|0;k=n;c[46854]=tB(b)|0;ts();c[46869]=KK((c[46854]|0)*96|0)|0;f=jC(b)|0;d=c[46869]|0;lr(k,b);i=+g[k>>2];j=+g[k+4>>2];k=(a[k+8>>0]|0)==0;j=k?j:j*.013888888888888888;i=k?i:i*.013888888888888888;k=k?2:1;e=0;while(1){if((e|0)>=(c[46854]|0)){d=0;break}o=c[(c[f+16>>2]|0)+132>>2]|0;h[d+8>>3]=+h[o>>3];h[d+16>>3]=+h[o+8>>3];if(mb[k&3](d+40|0,f,i,j)|0){m=4;break}c[d+24>>2]=e;c[d+28>>2]=1;c[d>>2]=f;c[d+88>>2]=0;d=d+96|0;e=e+1|0;f=kC(b,f)|0;}if((m|0)==4){U1(c[46869]|0);c[46869]=0;d=1;}l=n;return d|0}function Tq(){var a=0,b=0;a=c[46869]|0;b=0;while(1){if((b|0)>=(c[46854]|0))break;pu(a+40|0);a=a+96|0;b=b+1|0;}ou();Vs();U1(c[46869]|0);return}function Uq(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0;o=l;l=l+32|0;m=o+16|0;n=o;p=c[46869]|0;i=+h[p+8>>3];k=+h[p+16>>3];f=c[46854]|0;d=p;e=1;g=+h[p+40>>3]+i;i=+h[p+56>>3]+i;j=+h[p+48>>3]+k;k=+h[p+64>>3]+k;while(1){if((e|0)>=(f|0))break;s=+h[d+104>>3];q=+h[d+112>>3];t=+h[d+136>>3]+s;r=+h[d+144>>3]+q;s=+h[d+152>>3]+s;q=+h[d+160>>3]+q;d=d+96|0;e=e+1|0;g=ti?s:i;j=rk?q:k;}d=QA(b,93100)|0;if(d|0?a[d>>0]|0:0)h[173]=+r5(d);s=+h[173];t=s*(k-j);s=s*(i-g);h[m>>3]=g-s;h[m+8>>3]=j-t;h[n>>3]=s+i;h[n+8>>3]=t+k;dr(m,n);l=o;return}function Vq(){var a=0,b=0,d=0,e=0;d=l;l=l+16|0;b=d;if(Yq(0)|0){Zq();a=0;do{kr();a=a+1|0;}while((Yq(a)|0)!=0);if(!0)a=1;}else a=0;l=d;return a|0}function Wq(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i+8|0;g=i;b=Yq(0)|0;if(!b)a=0;else {Zq();_q(0);Yu(0,1);a=0;e=0;d=0;while(1){ar();d=d+1|0;f=Yq(d)|0;if(!f)break;b=(f|0)<(b|0)?0:e+1|0;c[46846]=1;if(b){br();a=a+1|0;}_q(1);Yu(0,1);e=b;b=f;}if(0);cr();a=1;}l=i;return a|0}function Xq(){var a=0,b=0,d=0,e=0;d=c[46854]|0;a=c[46869]|0;b=0;while(1){if((b|0)>=(d|0))break;e=c[(c[(c[a>>2]|0)+16>>2]|0)+132>>2]|0;h[e>>3]=+h[a+8>>3];h[e+8>>3]=+h[a+16>>3];a=a+96|0;b=b+1|0;}return}function Yq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;o=q+24|0;n=q+8|0;p=q;d=c[46869]|0;e=c[46854]|0;b=0;while(1){if((b|0)>=(e|0)){f=0;b=0;break}c[d+(b*96|0)+32>>2]=0;b=b+1|0;}a:while(1){if((b|0)>=(e+-1|0))break;m=d+96|0;b=b+1|0;j=d+8|0;k=d+40|0;i=d+32|0;g=m;h=b;while(1){if((h|0)>=(e|0)){d=m;continue a}e=g+8|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];if(!(yu(n,k,o,g+40|0)|0))d=f;else {c[i>>2]=1;c[g+32>>2]=1;d=f+1|0;}g=g+96|0;h=h+1|0;f=d;e=c[46854]|0;}}if(0>1);l=q;return f|0}function Zq(){var a=0,b=0,d=0,e=0.0,f=0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0;ir();k=c[46848]|0;l=c[46869]|0;a=c[46845]|0;a:while(1){i=a;if(a>>>0>=k>>>0)break;b=a+4|0;if(b>>>0>=k>>>0){a=b;continue}f=c[b>>2]|0;d=c[a>>2]|0;g=+h[d>>3];if(+h[f>>3]!=g){a=b;continue}e=+h[d+8>>3];if(+h[f+8>>3]!=e){a=b;continue}j=a+8|0;f=2;while(1){if(j>>>0>=k>>>0)break;d=c[j>>2]|0;if(!(+h[d>>3]==g)){m=11;break}if(!(+h[d+8>>3]==e)){m=11;break}j=j+4|0;f=f+1|0;}if((m|0)==11){m=0;d=c[j>>2]|0;if(+h[d+8>>3]==e){e=(+h[d>>3]-g)/+(f|0);d=(((j>>>0>b>>>0?j:b)+-1+(0-i)|0)>>>2)+1|0;a=1;while(1){if((a|0)==(d|0)){a=j;continue a}i=c[b>>2]|0;h[i>>3]=+h[i>>3]+e*+(a|0);a=a+1|0;b=b+4|0;}}}while(1){if(b>>>0>=j>>>0){a=j;continue a}f=c[a>>2]|0;n=c[f+16>>2]|0;i=c[b>>2]|0;d=c[i+16>>2]|0;h[i>>3]=(+h[l+(n*96|0)+56>>3]-+h[l+(n*96|0)+40>>3]+ +h[l+(d*96|0)+56>>3]-+h[l+(d*96|0)+40>>3])*.5+ +h[f>>3];b=b+4|0;a=a+4|0;}}return}function _q(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0;if(a|0)ir();i=c[46845]|0;j=c[i>>2]|0;d=+h[j>>3];h[23272]=d;k=c[46854]|0;f=1;g=+h[j>>3];while(1){if((f|0)>=(k|0))break;a=c[i+(f<<2)>>2]|0;b=+h[a>>3];if(b>3];}else {e=b;b=d;}f=f+1|0;d=b;g=e>g?e:g;}e=+h[j+8>>3];h[23273]=e;h[23275]=+h[(c[i+(k+-1<<2)>>2]|0)+8>>3]-e;h[23274]=g-d;return}function $q(){var a=0;a=c[46847]|0;if(a>>>0<(c[46848]|0)>>>0){c[46847]=a+4;a=c[a>>2]|0;}else a=0;return a|0}function ar(){var a=0,b=0,d=0;a=c[46869]|0;er();d=(c[46846]|0)==0;b=0;while(1){if((b|0)>=(c[46854]|0))break;if(!(d?!(c[a+32>>2]|0):0))fr(a);a=a+96|0;b=b+1|0;}return}function br(){var a=0,b=0,c=0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0;a=l;l=l+32|0;c=a+16|0;b=a;j=+h[23268];i=+h[23266];g=+h[23269];e=+h[23267];d=(i-e)*.05;f=(j-g)*.05;h[b>>3]=f+j;h[b+8>>3]=i+d;h[c>>3]=g-f;h[c+8>>3]=e-d;dr(c,b);l=a;return}function cr(){Gs();Is();Ku();ms();return}function dr(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0.0;f=+h[a>>3];h[23269]=f;e=+h[b>>3];h[23268]=e;c=+h[a+8>>3];h[23267]=c;d=+h[b+8>>3];h[23266]=d;h[23258]=f;h[23260]=f;h[23262]=e;h[23264]=e;h[23265]=d;h[23261]=d;h[23263]=c;h[23259]=c;return}function er(){var a=0,b=0.0,d=0.0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0;m=c[46869]|0;g=m+8|0;f=+us(g,186064);e=+us(g,186080);d=+us(g,186096);a=1;b=+us(g,186112);g=m;i=m;j=m;k=m;while(1){l=m+96|0;if((a|0)>=(c[46854]|0))break;q=m+104|0;r=+us(q,186064);n=r>2]|0;o=k+8|0;b=0.0;d=0.0;e=0.0;k=c[k>>2]|0;while(1){f=c[k>>2]|0;if(!f)break;s=k+8|0;r=f+8|0;c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];q=+gr(g,i,j);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];hr(g,i,j,m,n);b=+h[n>>3]*q+b;d=+h[m>>3]*q+d;e=q+e;k=f;}h[a+8>>3]=d/e;h[a+16>>3]=b/e;l=p;return}function gr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;d=+h[b+8>>3];f=+h[c+8>>3];e=+h[a+8>>3];return +(+B(+((f-e)*+h[b>>3]+(d-f)*+h[a>>3]+ +h[c>>3]*(e-d)))*.5)}function hr(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;h[d>>3]=(+h[b>>3]+ +h[a>>3]+ +h[c>>3])*.3333333333333333;h[e>>3]=(+h[b+8>>3]+ +h[a+8>>3]+ +h[c+8>>3])*.3333333333333333;return}function ir(){var a=0,b=0,d=0,e=0;a=c[46845]|0;if(!a){a=KK(c[46854]<<2)|0;c[46845]=a;c[46848]=a+(c[46854]<<2);}d=c[46869]|0;Vs();e=c[46854]|0;b=0;while(1){if((b|0)>=(e|0))break;c[a>>2]=d+8;c[d+88>>2]=0;c[d+28>>2]=1;d=d+96|0;a=a+4|0;b=b+1|0;}o4(c[46845]|0,e,4,69);c[46847]=c[46845];return}function jr(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a>>2]|0;b=c[b>>2]|0;d=+h[a+8>>3];e=+h[b+8>>3];if(!(de)){e=+h[a>>3];d=+h[b>>3];if(ed&1;}else a=1;else a=-1;return a|0}function kr(){var a=0,b=0,d=0,e=0;d=c[46854]|0;a=0;b=c[46869]|0;while(1){if((a|0)>=(d|0))break;e=b+8|0;h[e>>3]=+h[e>>3]*1.05;e=b+16|0;h[e>>3]=+h[e>>3]*1.05;a=a+1|0;b=b+96|0;}return}function lr(b,e){b=b|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+48|0;k=m;j=m+24|0;f=QA(e,93112)|0;if(!((f|0)!=0?(mr(f,j,1.0,0.0)|0)!=0:0))i=3;do if((i|0)==3){e=QA(e,93116)|0;if(e|0?mr(e,j,.800000011920929,4.0)|0:0)break;g[j+4>>2]=4.0;g[j>>2]=4.0;a[j+8>>0]=1;}while(0);if(0);;c[b>>2]=c[j>>2];c[b+4>>2]=c[j+4>>2];c[b+8>>2]=c[j+8>>2];l=m;return}function mr(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0;o=l;l=l+16|0;m=o;j=o+12|0;k=o+8|0;while(1){h=a[b>>0]|0;i=b+1|0;if(!(S2(h<<24>>24)|0))break;else b=i;}p=h<<24>>24==43;h=d+8|0;a[h>>0]=p&1;c[m>>2]=j;c[m+4>>2]=k;switch(b5(p?i:b,93154,m)|0){case 0:{b=0;break}case 1:{c[k>>2]=c[j>>2];n=5;break}default:n=5;}if((n|0)==5){do if(a[h>>0]|0){if(e>1.0){q=+g[j>>2]/e;g[d>>2]=q>f?f:q;e=+g[k>>2]/e;e=e>f?f:e;break}if(e<1.0){q=+g[j>>2]/e;g[d>>2]=q>2]/e;e=e>2]=c[j>>2];e=+g[k>>2];break}}else {g[d>>2]=+g[j>>2]/e+1.0;e=+g[k>>2]/e+1.0;}while(0);g[d+4>>2]=e;b=1;}l=o;return b|0}function nr(a,b){a=a|0;b=b|0;var c=0,d=0;d=l;l=l+32|0;c=d;if((tB(a)|0)<2)a=0;else {Oq(a,b,c)|0;a=Qq(a,c)|0;}l=d;return a|0}function or(a){a=a|0;return nr(a,QA(a,92507)|0)|0}function pr(b,e){b=b|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+48|0;k=m;j=m+24|0;f=QA(e,93116)|0;if(!((f|0)!=0?(mr(f,j,1.0,0.0)|0)!=0:0))i=3;do if((i|0)==3){e=QA(e,93112)|0;if(e|0?mr(e,j,1.25,3.200000047683716)|0:0)break;g[j+4>>2]=3.200000047683716;g[j>>2]=3.200000047683716;a[j+8>>0]=1;}while(0);if(0);;c[b>>2]=c[j>>2];c[b+4>>2]=c[j+4>>2];c[b+8>>2]=c[j+8>>2];l=m;return}function qr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;o=p;h=0;while(1){if((h|0)>=(d|0))break;c[e+(h<<2)>>2]=-1;h=h+1|0;}c[e+(a<<2)>>2]=0;rr(f,a);a:do if(!(c[b+8>>2]|0)){h=2147483647;b:while(1){if(!((sr(f,o)|0)<<24>>24))break a;j=c[o>>2]|0;h=c[e+(j<<2)>>2]|0;i=b+(j*20|0)|0;j=b+(j*20|0)+4|0;k=h+1|0;a=1;while(1){if((a|0)>=(c[i>>2]|0))continue b;m=c[(c[j>>2]|0)+(a<<2)>>2]|0;n=e+(m<<2)|0;if((c[n>>2]|0)<0){c[n>>2]=k;tr(f,m)|0;}a=a+1|0;}}}else {h=2147483647;c:while(1){if(!((sr(f,o)|0)<<24>>24))break a;k=c[o>>2]|0;h=c[e+(k<<2)>>2]|0;i=b+(k*20|0)|0;j=b+(k*20|0)+4|0;k=b+(k*20|0)+8|0;a=1;while(1){if((a|0)>=(c[i>>2]|0))continue c;m=c[(c[j>>2]|0)+(a<<2)>>2]|0;n=e+(m<<2)|0;if((c[n>>2]|0)<0){c[n>>2]=h+~~+g[(c[k>>2]|0)+(a<<2)>>2];tr(f,m)|0;}a=a+1|0;}}}while(0);a=h+10|0;h=0;while(1){if((h|0)>=(d|0))break;i=e+(h<<2)|0;if((c[i>>2]|0)<0)c[i>>2]=a;h=h+1|0;}l=p;return}function rr(a,b){a=a|0;b=b|0;c[c[a>>2]>>2]=b;c[a+12>>2]=0;c[a+8>>2]=1;return}function sr(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+12|0;e=c[d>>2]|0;if((e|0)<(c[a+8>>2]|0)){a=c[a>>2]|0;c[d>>2]=e+1;c[b>>2]=c[a+(e<<2)>>2];a=1;}else a=0;return a|0}function tr(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+8|0;e=c[d>>2]|0;if((e|0)<(c[a+4>>2]|0)){a=c[a>>2]|0;c[d>>2]=e+1;c[a+(e<<2)>>2]=b;a=1;}else a=0;return a|0}function ur(a,b){a=a|0;b=b|0;c[a>>2]=KK(b<<2)|0;c[a+4>>2]=b;c[a+8>>2]=0;c[a+12>>2]=0;return}function vr(a){a=a|0;U1(c[a>>2]|0);return}function wr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0;if(!0)g=0;while(1){if((g|0)>=(a|0))break;i=b+(g<<2)|0;f=0;e=0.0;while(1){if((f|0)==(a|0))break;if((g|0)!=(f|0))e=+h[(c[i>>2]|0)+(f<<3)>>3]+e;f=f+1|0;}h[(c[i>>2]|0)+(g<<3)>>3]=-e;g=g+1|0;}return wt(b,d,a+-1|0)|0}function xr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0.0;j=un(b,b,0.0)|0;k=un(b,b,0.0)|0;e=jC(a)|0;while(1){if(!e)break;d=aB(a,e)|0;while(1){if(!d)break;g=c[d>>2]&3;f=(c[c[((g|0)==3?d:d+48|0)+40>>2]>>2]|0)>>>4;g=(c[c[((g|0)==2?d:d+-48|0)+40>>2]>>2]|0)>>>4;if((f|0)!=(g|0)){l=-1.0/+h[(c[d+16>>2]|0)+136>>3];h[(c[j+(g<<2)>>2]|0)+(f<<3)>>3]=l;h[(c[j+(f<<2)>>2]|0)+(g<<3)>>3]=l;}d=bB(a,d,e)|0;}e=kC(a,e)|0;}i=wr(b,j,k)|0;a:do if(i|0){f=a+16|0;e=0;while(1){if((e|0)>=(b|0))break a;g=k+(e<<2)|0;d=0;while(1){if((d|0)==(b|0))break;a=c[g>>2]|0;h[(c[(c[(c[f>>2]|0)+160>>2]|0)+(e<<2)>>2]|0)+(d<<3)>>3]=+h[(c[k+(d<<2)>>2]|0)+(d<<3)>>3]+ +h[a+(e<<3)>>3]+ +h[a+(d<<3)>>3]*-2.0;d=d+1|0;}e=e+1|0;}}while(0);vn(j);vn(k);return i|0}function yr(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;j=s;n=d<<3;o=KK(n)|0;p=KK(n)|0;q=KK(n)|0;k=KK(n)|0;m=KK(n)|0;n=KK(n)|0;Ot(d,c,n);Ht(d,n);Ht(d,b);Jt(a,d,b,k);Lt(d,n,k,o);Ot(d,o,p);i=f+-1|0;c=0;g=+Pt(d,o,o);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+Qt(d,o)>e)){c=0;break}Jt(a,d,p,q);h=+Pt(d,p,q);if(h==0.0){c=0;break}h=g/h;Nt(d,p,h,m);Mt(d,b,m,b);if((c|0)<(i|0)){Nt(d,q,h,q);Lt(d,o,q,o);h=+Pt(d,o,o);if(g==0.0){r=7;break}Nt(d,p,h/g,p);Mt(d,o,p,p);g=h;}c=c+1|0;}if((r|0)==7){gA(1,93242,j)|0;c=1;}U1(o);U1(p);U1(q);U1(k);U1(m);U1(n);l=s;return c|0}function zr(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;g=g|0;var h=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;j=s;o=d<<3;p=KK(o)|0;q=KK(o)|0;k=KK(o)|0;m=KK(o)|0;n=KK(o)|0;o=KK(o)|0;Ot(d,c,o);if(g<<24>>24){Ht(d,o);Ht(d,b);}Kt(a,d,b,m);Lt(d,o,m,p);Ot(d,p,q);g=f+-1|0;c=0;h=+Pt(d,p,p);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+Qt(d,p)>e)){c=0;break}Kt(a,d,q,k);i=+Pt(d,q,k);if(i==0.0){c=0;break}i=h/i;Nt(d,q,i,n);Mt(d,b,n,b);if((c|0)<(g|0)){Nt(d,k,i,k);Lt(d,p,k,p);i=+Pt(d,p,p);if(h==0.0){r=9;break}Nt(d,q,i/h,q);Mt(d,p,q,q);h=i;}c=c+1|0;}if((r|0)==9){gA(1,93242,j)|0;c=1;}U1(p);U1(q);U1(k);U1(m);U1(n);U1(o);l=s;return c|0}function Ar(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;j=q;k=d<<2;m=JK(k)|0;n=JK(k)|0;o=JK(k)|0;k=JK(k)|0;St(d,b);St(d,c);Tt(a,d,b,k);St(d,k);Ut(d,c,k,m);Yt(d,m,n);i=f+-1|0;c=0;g=+Zt(d,m,m);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+au(d,m)>e)){c=0;break}St(d,n);St(d,b);St(d,m);Tt(a,d,n,o);St(d,o);h=+Zt(d,n,o);if(h==0.0){c=0;break}h=g/h;Wt(d,b,h,n);if((c|0)<(i|0)){Wt(d,m,-h,o);h=+Zt(d,m,m);if(g==0.0){p=7;break}Xt(d,n,h/g,n);Vt(d,m,n,n);g=h;}c=c+1|0;}if((p|0)==7){gA(1,93242,j)|0;c=1;}U1(m);U1(n);U1(o);U1(k);l=q;return c|0}function Br(a,b,d,e,f,i,j,k,m,n){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;m=m|0;n=+n;var o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0.0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0;M=l;l=l+48|0;F=M+24|0;E=M+16|0;D=M+8|0;C=M;J=M+40|0;K=M+36|0;H=M+32|0;s=j&4;c[J>>2]=0;c[K>>2]=0;a:do if(c[a+16>>2]|0){p=0;o=0;while(1){if((p|0)>=(b|0))break;t=c[a+(p*20|0)>>2]|0;u=a+(p*20|0)+16|0;r=1;while(1){if((r|0)>=(t|0))break;if(!(o<<24>>24))o=+g[(c[u>>2]|0)+(r<<2)>>2]!=0.0;else o=1;r=r+1|0;o=o&1;}p=p+1|0;}if(o<<24>>24){z=(s|0)!=0;if(z){r=e+4|0;b:do if((i|0)>2){o=i+-1|0;if((on(a,b,d,r,f,o,j,k,15)|0)<0){o=-1;break a}p=e+(o<<2)|0;o=0;while(1){if((o|0)>=(b|0))break b;h[(c[p>>2]|0)+(o<<3)>>3]=+h[(c[r>>2]|0)+(o<<3)>>3];o=o+1|0;}}while(0);y=c[e>>2]|0;w=c[r>>2]|0;if((ju(a,b,w,b)|0)==0?(ty(a,b,.01,.1,w,J,K,H)|0)==0:0){x=c[H>>2]|0;if((x|0)<1){o=on(a,b,d,e,f,i,j,k,m)|0;break}c:do if(n>0.0){s=c[J>>2]|0;t=c[K>>2]|0;u=x+-1|0;q=0.0;r=0;while(1){if((r|0)>=(x|0))break c;o=c[t+(r<<2)>>2]|0;A=n-q-+h[w+(c[s+(o<<2)>>2]<<3)>>3]+ +h[w+(c[s+(o+-1<<2)>>2]<<3)>>3];q=(A<0.0?0.0:A)+q;if((r|0)<(u|0))p=c[t+(r+1<<2)>>2]|0;else p=b;while(1){if((o|0)>=(p|0))break;I=w+(c[s+(o<<2)>>2]<<3)|0;h[I>>3]=+h[I>>3]+q;o=o+1|0;}r=r+1|0;}}while(0);if((i|0)==2?(Qu(a,b,w,y,+h[23294])|0)!=0:0){p=0;o=-1;}else L=33;}else {p=0;o=-1;}}else {hn(a,b,i,e,f)|0;if(!(ty(a,b,.01,.1,0,J,K,H)|0))L=33;else {p=0;o=-1;}}d:do if((L|0)==33){if((b|0)==1){o=0;break a}I=KK(c[H>>2]<<2)|0;if(!m){o=0;break a}if(0);switch(k|0){case 2:{if(0);o=nn(a,b)|0;L=46;break}case 1:{o=jn(a,b)|0;if(!o){gA(0,93315,C)|0;gA(3,93364,D)|0;L=47;}else G=o;break}case 3:{if(0);o=kn(a,b)|0;L=46;break}default:L=47;}if((L|0)==46)if(!o)L=47;else G=o;if((L|0)==47){if(0);G=mn(a,b)|0;}if(0);a=b+-1|0;y=(O(a,b)|0)/2|0;E=y+b|0;e:do if(!z){q=1.0;p=0;while(1){if((p|0)>=(i|0))break;r=e+(p<<2)|0;o=0;while(1){if((o|0)>=(b|0))break;A=+B(+(+h[(c[r>>2]|0)+(o<<3)>>3]));q=A>q?A:q;o=o+1|0;}p=p+1|0;}q=1.0/q;p=0;while(1){if((p|0)>=(i|0))break e;r=e+(p<<2)|0;o=0;while(1){if((o|0)>=(b|0))break;D=(c[r>>2]|0)+(o<<3)|0;h[D>>3]=+h[D>>3]*(10.0*q);o=o+1|0;}p=p+1|0;}}while(0);f:do if(n>0.0){v=+(y|0);o=0;q=0.0;s=0;g:while(1){if((s|0)>=(a|0))break;t=s+1|0;r=o;p=t;while(1){o=r+1|0;if((p|0)>=(b|0)){s=t;continue g}A=+ft(e,i,s,p);r=o;q=A/+g[G+(o<<2)>>2]+q;p=p+1|0;}}q=q/v;o=0;while(1){if((o|0)>=(E|0)){o=0;break f}D=G+(o<<2)|0;g[D>>2]=+g[D>>2]*q;o=o+1|0;}}else o=0;while(0);while(1){if((o|0)>=(i|0))break;Ht(b,c[e+(o<<2)>>2]|0);o=o+1|0;}p=c[e+4>>2]|0;q=+h[p>>3];o=0;while(1){if((o|0)>=(b|0))break;D=p+(o<<3)|0;h[D>>3]=+h[D>>3]-q;o=o+1|0;}u=i<<2;D=KK(u)|0;x=b<<2;w=O(x,i)|0;r=KK(w)|0;o=0;while(1){if((o|0)>=(i|0))break;s=r+((O(o,b)|0)<<2)|0;c[D+(o<<2)>>2]=s;t=e+(o<<2)|0;p=0;while(1){if((p|0)>=(b|0))break;g[s+(p<<2)>>2]=+h[(c[t>>2]|0)+(p<<3)>>3];p=p+1|0;}o=o+1|0;}v=+(y|0);if(0);bu(E,G);cu(E,G);C=KK(b<<3)|0;_t(b,0.0,C);o=0;r=0;while(1){if((r|0)>=(a|0)){o=b;p=0;r=0;break}s=b-r|0;q=0.0;p=1;while(1){o=o+1|0;if((p|0)>=(s|0))break;A=+g[G+(o<<2)>>2];F=C+(p+r<<3)|0;h[F>>3]=+h[F>>3]-A;q=q+A;p=p+1|0;}F=C+(r<<3)|0;h[F>>3]=+h[F>>3]-q;r=r+1|0;}while(1){if((p|0)>=(b|0))break;g[G+(r<<2)>>2]=+h[C+(p<<3)>>3];F=o+r|0;o=o+-1|0;p=p+1|0;r=F;}k=KK(u)|0;c[k>>2]=KK(w)|0;o=1;while(1){if((o|0)>=(i|0))break;c[k+(o<<2)>>2]=(c[k>>2]|0)+((O(o,b)|0)<<2);o=o+1|0;}z=KK(x)|0;f=KK(x)|0;j=KK(E<<2)|0;p=Eu(G,b)|0;d=Ju(G,b,c[J>>2]|0,c[K>>2]|0,c[H>>2]|0)|0;y=k+4|0;r=0;A=1797693134862315708145274.0e284;o=0;while(1){if(!(r<<24>>24==0&(o|0)<(m|0)))break;_t(b,0.0,C);du(E,G,j);w=0;t=0;while(1){if((w|0)>=(a|0)){r=0;s=b;t=0;break}x=b-w+-1|0;$t(b,0.0,f);r=0;while(1){if((r|0)>=(i|0))break;H=D+(r<<2)|0;$t(x,+g[(c[H>>2]|0)+(w<<2)>>2],z);Wt(x,z,-1.0,(c[H>>2]|0)+(w<<2)+4|0);bu(x,z);Vt(x,z,f,f);r=r+1|0;}eu(x,f);r=0;while(1){if((r|0)>=(x|0))break;s=f+(r<<2)|0;q=+g[s>>2];if(q>=3402823466385288598117041.0e14|q<0.0)g[s>>2]=0.0;r=r+1|0;}u=w+1|0;q=0.0;r=t;s=0;while(1){r=r+1|0;if((s|0)>=(x|0))break;H=j+(r<<2)|0;N=+g[H>>2]*+g[f+(s<<2)>>2];g[H>>2]=N;H=C+(u+s<<3)|0;h[H>>3]=+h[H>>3]-N;q=q+N;s=s+1|0;}t=C+(w<<3)|0;h[t>>3]=+h[t>>3]-q;w=u;t=r;}while(1){if((r|0)>=(b|0)){r=0;break}g[j+(t<<2)>>2]=+h[C+(r<<3)>>3];H=s+t|0;r=r+1|0;s=s+-1|0;t=H;}while(1){if((r|0)>=(i|0)){q=0.0;r=0;break}Tt(j,b,c[D+(r<<2)>>2]|0,c[k+(r<<2)>>2]|0);r=r+1|0;}while(1){if((r|0)>=(i|0))break;q=+Zt(b,c[D+(r<<2)>>2]|0,c[k+(r<<2)>>2]|0)+q;r=r+1|0;}q=q*2.0+v;r=0;while(1){if((r|0)>=(i|0))break;H=D+(r<<2)|0;Tt(G,b,c[H>>2]|0,z);q=q-+Zt(b,c[H>>2]|0,z);r=r+1|0;}N=+B(+(q-A))/+B(+(A+1.0e-10));r=((o|0)>1&q>A|N<+h[23294])&1;s=0;while(1){if((s|0)>=(i|0))break;if((s|0)!=1){if(Ar(G,c[D+(s<<2)>>2]|0,c[k+(s<<2)>>2]|0,b,.001,b)|0){o=-1;break d}}else Fu(d,c[y>>2]|0,D,i,1,15,I,n)|0;s=s+1|0;}A=q;o=o+1|0;}U1(I);Iu(d);if(D|0){r=0;while(1){if((r|0)>=(i|0))break;t=D+(r<<2)|0;u=e+(r<<2)|0;s=0;while(1){if((s|0)>=(b|0))break;h[(c[u>>2]|0)+(s<<3)>>3]=+g[(c[t>>2]|0)+(s<<2)>>2];s=s+1|0;}r=r+1|0;}U1(c[D>>2]|0);U1(D);}if(k|0){U1(c[k>>2]|0);U1(k);}U1(z);U1(f);U1(C);U1(G);U1(j);}while(0);U1(c[J>>2]|0);U1(c[K>>2]|0);if(p){U1(c[p>>2]|0);U1(p);}}else L=10;}else L=10;while(0);if((L|0)==10)o=on(a,b,d,e,f,i,j,k,m)|0;l=M;return o|0}function Cr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+48|0;f=m+24|0;g=m+12|0;d=m;i=tB(a)|0;k=KK(i*48|0)|0;lr(d,a);c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];d=jC(a)|0;e=k;while(1){if(!d)break;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];c[f+8>>2]=c[g+8>>2];Dr(d,e,f);d=kC(a,d)|0;e=e+48|0;}a:do if(!(Er(k,i)|0))d=0;else {switch(b|0){case 9:{Gr(a,k,i,70,1);Ir(a,k,i,71,1);d=0;e=k;break}case 10:{Ir(a,k,i,71,1);Gr(a,k,i,70,1);d=0;e=k;break}case 7:{Gr(a,k,i,72,1);Ir(a,k,i,71,1);j=9;break}case 8:{j=9;break}case 13:{j=10;break}case 14:{Ir(a,k,i,71,0);Gr(a,k,i,70,0);d=0;e=k;break}case 12:{Ir(a,k,i,73,0);Gr(a,k,i,70,0);d=0;e=k;break}default:{Gr(a,k,i,72,0);Ir(a,k,i,71,0);d=0;e=k;}}if((j|0)==9){Ir(a,k,i,73,1);Gr(a,k,i,70,1);j=10;}if((j|0)==10){Gr(a,k,i,70,0);Ir(a,k,i,71,0);d=0;e=k;}while(1){if((d|0)>=(i|0)){d=1;break a}g=c[e+16>>2]|0;j=c[(c[(c[e+20>>2]|0)+16>>2]|0)+132>>2]|0;h[j>>3]=+(c[e+12>>2]|0)*1.3888888888888887e-03;h[j+8>>3]=+(g|0)*1.3888888888888887e-03;d=d+1|0;e=e+48|0;}}while(0);U1(k);l=m;return d|0}function Dr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,l=0.0,m=0.0;f=c[b+16>>2]|0;k=c[f+132>>2]|0;l=+h[k>>3]*720.0;j=~~(l+(l>=0.0?.5:-.5));l=+h[k+8>>3]*720.0;k=~~(l+(l>=0.0?.5:-.5));if(!(a[e+8>>0]|0)){m=+h[f+32>>3]*72.0*(+g[e>>2]*5.0);l=+h[f+40>>3]*72.0*(+g[e+4>>2]*5.0);i=~~(m+(m>=0.0?.5:-.5));f=~~(l+(l>=0.0?.5:-.5));}else {l=+h[f+32>>3]*36.0;m=+h[f+40>>3]*36.0;i=~~((+g[e>>2]+ +(~~(l+(l>=0.0?.5:-.5))|0))*10.0);f=~~((+g[e+4>>2]+ +(~~(m+(m>=0.0?.5:-.5))|0))*10.0);}c[d+12>>2]=j;c[d+16>>2]=k;c[d+20>>2]=b;c[d+32>>2]=j-i;c[d+36>>2]=k-f;c[d+40>>2]=i+j;c[d+44>>2]=f+k;return}function Er(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=b+-1|0;d=0;a:while(1){if((d|0)>=(k|0)){a=0;break}j=a+48|0;d=d+1|0;g=a+32|0;h=a+40|0;i=a+36|0;f=a+44|0;a=j;e=d;while(1){if((e|0)>=(b|0)){a=j;continue a}if((((c[g>>2]|0)<=(c[a+40>>2]|0)?(c[a+32>>2]|0)<=(c[h>>2]|0):0)?(c[i>>2]|0)<=(c[a+44>>2]|0):0)?(c[a+36>>2]|0)<=(c[f>>2]|0):0){a=1;break a}a=a+48|0;e=e+1|0;}}return a|0}function Fr(a,b){a=a|0;b=b|0;if((c[a+36>>2]|0)>(c[b+44>>2]|0))a=0;else a=(c[b+36>>2]|0)<=(c[a+44>>2]|0)&1;return a|0}function Gr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=Vz(18168,c[4584]|0)|0;g=b;h=0;while(1){if((h|0)>=(d|0))break;c[g+8>>2]=c[g+12>>2];nb[c[i>>2]&63](i,g,1)|0;g=g+48|0;h=h+1|0;}if(!f)h=Or(a,i,e,74)|0;else h=Nr(i,e,74)|0;uL(h,2,2147483647)|0;g=0;while(1){if((g|0)>=(d|0))break;f=b+12|0;a=c[(c[(c[b+24>>2]|0)+16>>2]|0)+232>>2]|0;e=a-(c[f>>2]|0)|0;c[f>>2]=a;f=b+32|0;c[f>>2]=(c[f>>2]|0)+e;f=b+40|0;c[f>>2]=(c[f>>2]|0)+e;b=b+48|0;g=g+1|0;}Pr(h);Rz(i)|0;return}function Hr(a,b){a=a|0;b=b|0;if((c[a+32>>2]|0)>(c[b+40>>2]|0))a=0;else a=(c[b+32>>2]|0)<=(c[a+40>>2]|0)&1;return a|0}function Ir(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=Vz(18168,c[4584]|0)|0;g=b;h=0;while(1){if((h|0)>=(d|0))break;c[g+8>>2]=c[g+16>>2];nb[c[i>>2]&63](i,g,1)|0;g=g+48|0;h=h+1|0;}if(!f)h=Or(a,i,e,75)|0;else h=Nr(i,e,75)|0;uL(h,2,2147483647)|0;g=0;while(1){if((g|0)>=(d|0))break;f=b+16|0;a=c[(c[(c[b+24>>2]|0)+16>>2]|0)+232>>2]|0;e=a-(c[f>>2]|0)|0;c[f>>2]=a;f=b+36|0;c[f>>2]=(c[f>>2]|0)+e;f=b+44|0;c[f>>2]=(c[f>>2]|0)+e;b=b+48|0;g=g+1|0;}Pr(h);Rz(i)|0;return}function Jr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+32|0;e=b+32|0;if((c[a+36>>2]|0)<=(c[b+44>>2]|0)?(c[b+36>>2]|0)<=(c[a+44>>2]|0):0)if((c[a+40>>2]|0)<(c[e>>2]|0))a=1;else {g=Mr(d,e)|0;g=g-(c[b+12>>2]|0)+(c[a+12>>2]|0)|0;b=c[b+16>>2]|0;a=c[a+16>>2]|0;f=(b|0)<(a|0);e=Lr(d,e)|0;a=(g|0)<=(e-(f?a:b)+(f?b:a)|0)&1;}else a=0;return a|0}function Kr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+32|0;e=b+32|0;if((c[d>>2]|0)<=(c[b+40>>2]|0)?(c[e>>2]|0)<=(c[a+40>>2]|0):0)if((c[a+44>>2]|0)<(c[b+36>>2]|0))a=1;else {g=Lr(d,e)|0;g=g-(c[b+16>>2]|0)+(c[a+16>>2]|0)|0;b=c[b+12>>2]|0;a=c[a+12>>2]|0;f=(b|0)<(a|0);e=Mr(d,e)|0;a=(g|0)<=(e-(f?a:b)+(f?b:a)|0)&1;}else a=0;return a|0}function Lr(a,b){a=a|0;b=b|0;return ((c[a+12>>2]|0)-(c[a+4>>2]|0)+(c[b+12>>2]|0)-(c[b+4>>2]|0)|0)/2|0|0}function Mr(a,b){a=a|0;b=b|0;return ((c[a+8>>2]|0)-(c[a>>2]|0)+(c[b+8>>2]|0)-(c[b>>2]|0)|0)/2|0|0}function Nr(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+16|0;v=x;a[v>>0]=a[18588]|0;a[v+1>>0]=a[18589]|0;a[v+2>>0]=a[18590]|0;a[v+3>>0]=a[18591]|0;w=oB(93515,v,0)|0;TC(w,137483,280,1)|0;g=Tz(d)|0;h=-2147483647;u=0;while(1){if(!g)break;s=c[g+8>>2]|0;t=u+((h|0)!=(s|0)&1)|0;g=c[g>>2]|0;h=s;u=t;}s=w+16|0;t=(u<<3)+-4|0;n=0;j=0;g=0;h=0;m=0;r=Tz(d)|0;i=-2147483647;while(1){if(!r)break;q=c[r+8>>2]|0;if((i|0)!=(q|0)){p=tC(w,KB(c[r+20>>2]|0)|0,1)|0;TC(p,137447,304,1)|0;o=p+16|0;g=c[o>>2]|0;c[g+112>>2]=r;if(!h){c[(c[s>>2]|0)+192>>2]=p;n=p;}else {c[(c[n+16>>2]|0)+164>>2]=p;n=h;}c[g+176>>2]=0;k=j+1|0;i=JK(k<<2)|0;c[(c[o>>2]|0)+172>>2]=i;if(!m){j=k;k=p;m=p;g=p;h=n;i=q;}else {i=m+16|0;c[(c[i>>2]|0)+184>>2]=0;j=JK((m|0)==(n|0)?t:u-j<<2)|0;c[(c[i>>2]|0)+180>>2]=j;j=iB(w,m,p,0,1)|0;TC(j,137460,176,1)|0;g=c[j+16>>2]|0;b[g+170>>1]=10;c[g+156>>2]=1;g=c[i>>2]|0;h=c[g+180>>2]|0;if(!h)g=KK((c[g+184>>2]<<2)+8|0)|0;else g=MK(h,(c[g+184>>2]<<2)+8|0)|0;m=c[i>>2]|0;c[m+180>>2]=g;m=m+184|0;h=c[m>>2]|0;c[m>>2]=h+1;c[g+(h<<2)>>2]=j;g=c[i>>2]|0;c[(c[g+180>>2]|0)+(c[g+184>>2]<<2)>>2]=0;g=c[o>>2]|0;h=c[g+172>>2]|0;if(!h)g=KK((c[g+176>>2]<<2)+8|0)|0;else g=MK(h,(c[g+176>>2]<<2)+8|0)|0;h=c[o>>2]|0;c[h+172>>2]=g;h=h+176|0;m=c[h>>2]|0;c[h>>2]=m+1;c[g+(m<<2)>>2]=j;j=c[o>>2]|0;c[(c[j+172>>2]|0)+(c[j+176>>2]<<2)>>2]=0;j=k;k=p;m=p;g=p;h=n;i=q;}}else {k=g;g=n;}c[r+24>>2]=k;n=g;g=k;r=c[r>>2]|0;}m=m+16|0;c[(c[m>>2]|0)+184>>2]=0;g=JK(4)|0;c[(c[m>>2]|0)+180>>2]=g;a[v>>0]=a[18588]|0;a[v+1>>0]=a[18589]|0;a[v+2>>0]=a[18590]|0;a[v+3>>0]=a[18591]|0;m=oB(93562,v,0)|0;g=Tz(d)|0;while(1){if(!g)break;v=tC(m,KB(c[g+20>>2]|0)|0,1)|0;TC(v,137447,304,1)|0;c[g+28>>2]=v;c[(c[v+16>>2]|0)+112>>2]=g;g=c[g>>2]|0;}g=0;k=Tz(d)|0;h=-2147483647;a:while(1){if(!k)break;j=c[k+8>>2]|0;b:do if((h|0)==(j|0))j=h;else {g=k;while(1){g=c[g>>2]|0;if(!g)break a;if((c[g+8>>2]|0)!=(j|0))break b}}while(0);i=k+28|0;h=g;while(1){if(!h)break;if(lb[e&127](k,h)|0)iB(m,c[i>>2]|0,c[h+28>>2]|0,0,1)|0;h=c[h>>2]|0;}k=c[k>>2]|0;h=j;}Qr(m,w,f);sB(m)|0;l=x;return w|0}function Or(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=l;l=l+16|0;r=s;a[r>>0]=a[18588]|0;a[r+1>>0]=a[18589]|0;a[r+2>>0]=a[18590]|0;a[r+3>>0]=a[18591]|0;r=oB(93515,r,0)|0;TC(r,137483,280,1)|0;k=r+16|0;h=Tz(e)|0;i=0;while(1){if(!h)break;j=tC(r,KB(c[h+20>>2]|0)|0,1)|0;TC(j,137447,304,1)|0;p=j+16|0;n=c[p>>2]|0;c[n+112>>2]=h;c[h+24>>2]=j;c[n+176>>2]=0;n=JK(4)|0;o=c[p>>2]|0;c[o+172>>2]=n;c[o+184>>2]=0;o=JK(4)|0;c[(c[p>>2]|0)+180>>2]=o;if(!i)c[(c[k>>2]|0)+192>>2]=j;else c[(c[i+16>>2]|0)+164>>2]=j;h=c[h>>2]|0;i=j;}m=Tz(e)|0;a:while(1){if(!m)break;n=m+32|0;o=m+24|0;p=m+20|0;h=m;while(1){h=c[h>>2]|0;if(!h)break;if(lb[f&127](m,h)|0){i=lb[g&127](n,h+32|0)|0;j=iB(r,c[o>>2]|0,c[h+24>>2]|0,0,1)|0;TC(j,137460,176,1)|0;if((i|0)>=65536){q=13;break a}k=j+16|0;t=c[k>>2]|0;b[t+170>>1]=i;c[t+156>>2]=1;if(j|0?iB(d,c[p>>2]|0,c[h+20>>2]|0,0,0)|0:0)c[(c[k>>2]|0)+156>>2]=100;}}m=c[m>>2]|0;}if((q|0)==13)qa(93518,93534,254,93547);m=Tz(e)|0;while(1){if(!m)break;k=c[m+24>>2]|0;n=k+16|0;k=XA(r,k)|0;while(1){if(!k)break;h=c[n>>2]|0;i=c[h+180>>2]|0;if(!i)h=KK((c[h+184>>2]<<2)+8|0)|0;else h=MK(i,(c[h+184>>2]<<2)+8|0)|0;i=c[n>>2]|0;c[i+180>>2]=h;i=i+184|0;j=c[i>>2]|0;c[i>>2]=j+1;c[h+(j<<2)>>2]=k;j=c[n>>2]|0;c[(c[j+180>>2]|0)+(c[j+184>>2]<<2)>>2]=0;j=k+-48|0;h=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;i=c[h+172>>2]|0;if(!i)h=KK((c[h+176>>2]<<2)+8|0)|0;else h=MK(i,(c[h+176>>2]<<2)+8|0)|0;c[(c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0)+172>>2]=h;g=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;q=c[g+172>>2]|0;g=g+176|0;t=c[g>>2]|0;c[g>>2]=t+1;c[q+(t<<2)>>2]=k;t=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;c[(c[t+172>>2]|0)+(c[t+176>>2]<<2)>>2]=0;k=ZA(r,k)|0;}m=c[m>>2]|0;}l=s;return r|0}function Pr(a){a=a|0;var b=0,d=0,e=0,f=0;f=jC(a)|0;while(1){if(!f)break;d=f+16|0;b=c[d>>2]|0;e=c[b+172>>2]|0;if(e){U1(e);b=c[d>>2]|0;}b=c[b+180>>2]|0;if(b|0)U1(b);f=kC(a,f)|0;}sB(a)|0;return}function Qr(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=jC(a)|0;while(1){if(!k)break;n=c[(c[k+16>>2]|0)+112>>2]|0;m=c[n+24>>2]|0;n=n+32|0;o=m+16|0;l=XA(a,k)|0;while(1){if(!l)break;h=c[(c[(c[((c[l>>2]&3|0)==2?l:l+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;p=lb[e&127](n,h+32|0)|0;h=c[h+24>>2]|0;i=iB(d,m,h,0,1)|0;TC(i,137460,176,1)|0;j=i+16|0;f=c[j>>2]|0;c[f+156>>2]=1;g=b[f+170>>1]|0;if((p|0)>(g&65535|0)){if(!(g<<16>>16)){f=c[o>>2]|0;g=c[f+180>>2]|0;if(!g)f=KK((c[f+184>>2]<<2)+8|0)|0;else f=MK(g,(c[f+184>>2]<<2)+8|0)|0;q=c[o>>2]|0;c[q+180>>2]=f;q=q+184|0;g=c[q>>2]|0;c[q>>2]=g+1;c[f+(g<<2)>>2]=i;f=c[o>>2]|0;c[(c[f+180>>2]|0)+(c[f+184>>2]<<2)>>2]=0;h=h+16|0;f=c[h>>2]|0;g=c[f+172>>2]|0;if(!g)f=KK((c[f+176>>2]<<2)+8|0)|0;else f=MK(g,(c[f+176>>2]<<2)+8|0)|0;g=c[h>>2]|0;c[g+172>>2]=f;g=g+176|0;q=c[g>>2]|0;c[g>>2]=q+1;c[f+(q<<2)>>2]=i;f=c[h>>2]|0;c[(c[f+172>>2]|0)+(c[f+176>>2]<<2)>>2]=0;f=c[j>>2]|0;}b[f+170>>1]=p;}l=ZA(a,l)|0;}k=kC(a,k)|0;}return}function Rr(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return (c[b>>2]|0)-(c[d>>2]|0)|0}function Sr(b,d){b=b|0;d=d|0;var e=0,f=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0;y=l;l=l+64|0;u=y+24|0;s=y+16|0;r=y+52|0;q=y+40|0;t=y;w=tB(b)|0;x=KK(w*72|0)|0;lr(q,b);k=+g[q>>2];m=+g[q+4>>2];q=(a[q+8>>0]|0)!=0;k=q?k*.013888888888888888:k;m=q?m*.013888888888888888:m;n=k*.5;o=m*.5;e=x;f=jC(b)|0;while(1){if(!f)break;p=c[f+16>>2]|0;i=+h[p+32>>3];if(q){j=+h[p+40>>3]*.5+m;i=i*.5+k;}else {j=o*+h[p+40>>3];i=n*i;}p=c[p+132>>2]|0;A=+h[p>>3];h[e>>3]=A;z=+h[p+8>>3];h[e+8>>3]=z;h[e+16>>3]=A-i;h[e+24>>3]=z-j;h[e+32>>3]=A+i;h[e+40>>3]=z+j;h[e+48>>3]=i;h[e+56>>3]=j;c[e+64>>2]=f;e=e+72|0;f=kC(b,f)|0;}do if((d|0)<0){i=+Tr(x,w);if(i==0.0){U1(x);e=0;break}if(!0){k=i;j=i;v=19;}}else {f=Ur(x,w,r)|0;e=c[r>>2]|0;if(!e){U1(f);U1(x);e=0;break}if(!d){Wr(t,f,e);i=+h[t>>3];j=+h[t+8>>3];}else {j=+Vr(f,e);i=j;}U1(f);if(!0){k=i;v=19;}}while(0);if((v|0)==19){e=0;f=x;while(1){if((e|0)>=(w|0))break;v=c[(c[(c[f+64>>2]|0)+16>>2]|0)+132>>2]|0;h[v>>3]=+h[f>>3]*k;h[v+8>>3]=+h[f+8>>3]*j;e=e+1|0;f=f+72|0;}U1(x);e=1;}l=y;return e|0}function Tr(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;c=0.0;d=0;a:while(1){if((d|0)>=(b|0))break;r=a+72|0;d=d+1|0;m=a+16|0;n=a+8|0;o=a+56|0;p=a+48|0;q=a+32|0;k=a+24|0;l=a+40|0;i=d;j=r;while(1){if((i|0)>=(b|0)){a=r;continue a}if(((+h[m>>3]<=+h[j+32>>3]?+h[j+16>>3]<=+h[q>>3]:0)?+h[k>>3]<=+h[j+40>>3]:0)?+h[j+24>>3]<=+h[l>>3]:0){c=0.0;break a}e=+h[a>>3];f=+h[j>>3];if(e==f)g=t;else {g=+B(+(e-f));g=(+h[j+48>>3]+ +h[p>>3])/g;}e=+h[n>>3];f=+h[j+8>>3];if(e==f)e=t;else {e=+B(+(e-f));e=(+h[j+56>>3]+ +h[o>>3])/e;}g=ec?g:c;}}return +c}function Ur(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;k=KK((b<<4)+16|0)|0;m=0;e=0;n=k;o=b;i=k;a:while(1){if((e|0)>=(b|0))break;z=a+72|0;e=e+1|0;y=a+16|0;r=a+32|0;s=a+24|0;u=a+40|0;v=a+8|0;w=a+56|0;x=a+48|0;p=e;q=z;l=i;while(1){if((p|0)==(b|0)){a=z;i=l;continue a}if(((+h[y>>3]<=+h[q+32>>3]?+h[q+16>>3]<=+h[r>>3]:0)?+h[s>>3]<=+h[q+40>>3]:0)?+h[q+24>>3]<=+h[u>>3]:0){i=o+b|0;if((m|0)==(o|0)){k=MK(k,(i<<4)+16|0)|0;n=k;l=k;}else i=o;f=+h[a>>3];g=+h[q>>3];if(!(f==g)){f=(+h[q+48>>3]+ +h[x>>3])/+B(+(f-g));if(f<1.0){f=1.0;A=13;}}else {f=t;A=13;}if((A|0)==13)A=0;g=+h[v>>3];j=+h[q+8>>3];if(!(g==j)){g=(+h[q+56>>3]+ +h[w>>3])/+B(+(g-j));if(g<1.0){g=1.0;A=16;}}else {g=t;A=16;}if((A|0)==16)A=0;m=m+1|0;h[n+(m<<4)>>3]=f;h[n+(m<<4)+8>>3]=g;}else i=o;p=p+1|0;q=q+72|0;o=i;}}A=MK(i,(m<<4)+16|0)|0;c[d>>2]=m;return A|0}function Vr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0,f=0.0,g=0.0;d=1;e=0.0;while(1){c=a+16|0;if((d|0)>(b|0))break;g=+h[c>>3];f=+h[a+24>>3];f=ge?f:e;a=c;}return +e}function Wr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,i=0.0;h[b>>3]=1.0;h[b+8>>3]=t;o4(b+16|0,c,16,76);g=KK((c<<4)+16|0)|0;h[g+(c<<4)>>3]=+h[b+(c<<4)>>3];f=c;d=1.0;while(1){h[g+(f<<4)+8>>3]=d;e=f+-1|0;if((f|0)<=0){d=t;e=0;f=0;break}h[g+(e<<4)>>3]=+h[b+(e<<4)>>3];i=+h[(+h[b+(f<<4)+8>>3]>d?b:g)+(f<<4)+8>>3];f=e;d=i;}while(1){if((f|0)>(c|0))break;i=+h[g+(f<<4)+8>>3]*+h[g+(f<<4)>>3];b=i>3];h[a>>3]=+h[g+(e<<4)>>3];h[a+8>>3]=i;return}else qa(93596,93534,832,93616);}function Xr(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3];d=+h[b>>3];if(!(cd)){d=+h[a+8>>3];c=+h[b+8>>3];if(dc&1;}else a=1;else a=-1;return a|0}function Yr(a,b,d){a=a|0;b=b|0;d=d|0;d=l;l=l+16|0;b=d;c[b>>2]=93631;gA(1,93681,b)|0;l=d;return 0}function Zr(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=l;l=l+16|0;d=e;c[d>>2]=93631;gA(1,93709,d)|0;l=e;return 0}function _r(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a:do switch(d|0){case 2:{e=KK(16)|0;f=KK(24)|0;c[f+8>>2]=0;c[f+4>>2]=e;c[f>>2]=2;c[e>>2]=0;c[e+4>>2]=1;d=e+8|0;c[f+16>>2]=d;c[f+20>>2]=0;c[f+12>>2]=2;c[d>>2]=1;c[e+12>>2]=0;break}case 1:{e=KK(4)|0;f=KK(12)|0;c[f+8>>2]=0;c[f+4>>2]=e;c[f>>2]=1;c[e>>2]=0;break}default:{Yr(0,0,0)|0;a=(d|0)>0;if(!e){if(!a){f=0;break a}ab();}else {if(!a){f=0;break a}ab();}}}while(0);return f|0}function $r(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)U1(b);b=c[a+8>>2]|0;if(b|0)U1(b);U1(a);}return}function as(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)U1(b);b=c[a+8>>2]|0;if(b|0)U1(b);b=c[a+16>>2]|0;if(b|0)U1(b);U1(a);}return}function bs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;m=o;k=W1(c[46849]|0,d<<2)|0;c[46849]=k;f=0;while(1){if((f|0)>=(d|0))break;c[e+(f<<2)>>2]=2147483647;f=f+1|0;}c[e+(a<<2)>>2]=0;h=b+(a*20|0)|0;i=b+(a*20|0)+8|0;j=b+(a*20|0)+4|0;f=1;while(1){if((f|0)>=(c[h>>2]|0))break;c[e+(c[(c[j>>2]|0)+(f<<2)>>2]<<2)>>2]=~~+g[(c[i>>2]|0)+(f<<2)>>2];f=f+1|0;}cs(n,a,k,e,d);i=-2147483639;while(1){if(!((ds(n,m,c[46849]|0,e)|0)<<24>>24)){f=0;break}f=c[m>>2]|0;a=c[e+(f<<2)>>2]|0;if((a|0)==2147483647){f=0;break}i=b+(f*20|0)|0;j=b+(f*20|0)+4|0;h=b+(f*20|0)+8|0;f=1;while(1){if((f|0)>=(c[i>>2]|0))break;es(n,c[(c[j>>2]|0)+(f<<2)>>2]|0,a+~~+g[(c[h>>2]|0)+(f<<2)>>2]|0,c[46849]|0,e);f=f+1|0;}i=a+10|0;}while(1){if((f|0)>=(d|0))break;h=e+(f<<2)|0;if((c[h>>2]|0)==2147483647)c[h>>2]=i;f=f+1|0;}fs(n);l=o;return}function cs(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;if((f|0)==1)i=0;else i=KK((f<<2)+-4|0)|0;c[a>>2]=i;j=f+-1|0;c[a+4>>2]=j;g=0;h=0;while(1){if((h|0)>=(f|0))break;if((h|0)!=(b|0)){c[i+(g<<2)>>2]=h;c[d+(h<<2)>>2]=g;g=g+1|0;}h=h+1|0;}g=(j|0)/2|0;while(1){if((g|0)<=-1)break;gs(a,g,d,e);g=g+-1|0;}return}function ds(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=a+4|0;if(!(c[f>>2]|0))a=0;else {g=c[a>>2]|0;c[b>>2]=c[g>>2];b=c[g+((c[f>>2]|0)+-1<<2)>>2]|0;c[g>>2]=b;c[d+(b<<2)>>2]=0;c[f>>2]=(c[f>>2]|0)+-1;gs(a,0,d,e);a=1;}return a|0}function es(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=f+(b<<2)|0;if((c[g>>2]|0)>(d|0)){j=e+(b<<2)|0;i=c[j>>2]|0;c[g>>2]=d;g=c[a>>2]|0;a=i;while(1){if((a|0)<=0)break;h=a>>>1;i=c[g+(h<<2)>>2]|0;if((c[f+(i<<2)>>2]|0)<=(d|0))break;c[g+(a<<2)>>2]=i;c[e+(i<<2)>>2]=a;a=h;}c[g+(a<<2)>>2]=b;c[j>>2]=a;}return}function fs(a){a=a|0;a=c[a>>2]|0;if(a|0)U1(a);return}function gs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;i=a+4|0;while(1){f=b<<1;g=f|1;h=c[i>>2]|0;if(!((f|0)<(h|0)?(j=c[a>>2]|0,(c[e+(c[j+(f<<2)>>2]<<2)>>2]|0)<(c[e+(c[j+(b<<2)>>2]<<2)>>2]|0)):0))f=b;if((g|0)<(h|0)){j=c[a>>2]|0;f=(c[e+(c[j+(g<<2)>>2]<<2)>>2]|0)<(c[e+(c[j+(f<<2)>>2]<<2)>>2]|0)?g:f;}if((f|0)==(b|0))break;j=c[a>>2]|0;h=j+(f<<2)|0;g=c[h>>2]|0;j=j+(b<<2)|0;c[h>>2]=c[j>>2];c[j>>2]=g;c[d+(c[h>>2]<<2)>>2]=f;c[d+(c[j>>2]<<2)>>2]=b;b=f;}return}function hs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0.0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;m=p+8|0;n=p;c[n>>2]=0;o=KK(d<<2)|0;f=0;while(1){if((f|0)>=(d|0))break;g[e+(f<<2)>>2]=3402823466385288598117041.0e14;f=f+1|0;}g[e+(a<<2)>>2]=0.0;h=c[b+(a*20|0)>>2]|0;i=b+(a*20|0)+8|0;j=b+(a*20|0)+4|0;f=1;while(1){if((f|0)>=(h|0))break;c[e+(c[(c[j>>2]|0)+(f<<2)>>2]<<2)>>2]=c[(c[i>>2]|0)+(f<<2)>>2];f=f+1|0;}is(m,a,o,e,d);a:while(1){if(!((js(m,n,o,e)|0)<<24>>24))break;f=c[n>>2]|0;k=+g[e+(f<<2)>>2];if(k==3402823466385288598117041.0e14)break;i=b+(f*20|0)|0;j=b+(f*20|0)+4|0;h=b+(f*20|0)+8|0;f=1;while(1){if((f|0)>=(c[i>>2]|0))continue a;ks(m,c[(c[j>>2]|0)+(f<<2)>>2]|0,+g[(c[h>>2]|0)+(f<<2)>>2]+k,o,e);f=f+1|0;}}fs(m);U1(o);l=p;return}function is(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=f+-1|0;j=KK(i<<2)|0;c[a>>2]=j;c[a+4>>2]=i;g=0;h=0;while(1){if((h|0)>=(f|0))break;if((h|0)!=(b|0)){c[j+(g<<2)>>2]=h;c[d+(h<<2)>>2]=g;g=g+1|0;}h=h+1|0;}g=(i|0)/2|0;while(1){if((g|0)<=-1)break;ls(a,g,d,e);g=g+-1|0;}return}function js(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=a+4|0;if(!(c[f>>2]|0))a=0;else {g=c[a>>2]|0;c[b>>2]=c[g>>2];b=c[g+((c[f>>2]|0)+-1<<2)>>2]|0;c[g>>2]=b;c[d+(b<<2)>>2]=0;c[f>>2]=(c[f>>2]|0)+-1;ls(a,0,d,e);a=1;}return a|0}function ks(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var h=0,i=0,j=0,k=0;h=f+(b<<2)|0;if(!(+g[h>>2]<=d)){k=e+(b<<2)|0;j=c[k>>2]|0;g[h>>2]=d;h=c[a>>2]|0;a=j;while(1){if((a|0)<=0)break;i=a>>>1;j=c[h+(i<<2)>>2]|0;if(!(+g[f+(j<<2)>>2]>d))break;c[h+(a<<2)>>2]=j;c[e+(j<<2)>>2]=a;a=i;}c[h+(a<<2)>>2]=b;c[k>>2]=a;}return}function ls(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0;j=a+4|0;while(1){f=b<<1;h=f|1;i=c[j>>2]|0;if(!((f|0)<(i|0)?(k=c[a>>2]|0,+g[e+(c[k+(f<<2)>>2]<<2)>>2]<+g[e+(c[k+(b<<2)>>2]<<2)>>2]):0))f=b;if((h|0)<(i|0)?(k=c[a>>2]|0,+g[e+(c[k+(h<<2)>>2]<<2)>>2]<+g[e+(c[k+(f<<2)>>2]<<2)>>2]):0)f=h;if((f|0)==(b|0))break;k=c[a>>2]|0;i=k+(f<<2)|0;h=c[i>>2]|0;k=k+(b<<2)|0;c[i>>2]=c[k>>2];c[k>>2]=h;c[d+(c[i>>2]<<2)>>2]=f;c[d+(c[k>>2]<<2)>>2]=b;b=f;}return}function ms(){fu(187400,48);c[46853]=0;return}function ns(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0;i=hu(187400)|0;c[i+32>>2]=a;c[i+36>>2]=b;Pu(a);Pu(b);c[i+24>>2]=0;c[i+28>>2]=0;f=+h[a>>3];g=+h[b>>3]-f;e=+h[a+8>>3];d=+h[b+8>>3]-e;f=d*e+g*f+(d*d+g*g)*.5;b=i+16|0;h[b>>3]=f;if((g>0.0?g:-g)>(d>0.0?d:-d)){h[i>>3]=1.0;e=d/g;d=g;a=i+8|0;}else {h[i+8>>3]=1.0;e=g/d;a=i;}h[a>>3]=e;h[b>>3]=f/d;b=c[46853]|0;c[i+40>>2]=b;c[46853]=b+1;return i|0}function os(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0;l=+h[a>>3];a:do if(l==1.0){if(!(+h[a+8>>3]>=0.0)){b=c[a+28>>2]|0;d=c[a+24>>2]|0;if(!d)m=9;else m=5;}else {b=c[a+24>>2]|0;d=c[a+28>>2]|0;if(!d)m=9;else m=5;}do if((m|0)==5){e=+h[d+8>>3];if(e>+h[23266])break a;f=+h[23267];if(!(e>=f)){i=f;e=+h[a+16>>3]-+h[a+8>>3]*f;break}else {i=e;e=+h[d>>3];break}}else if((m|0)==9){f=+h[23267];i=f;e=+h[a+16>>3]-+h[a+8>>3]*f;}while(0);do if(b){g=+h[b+8>>3];if(g>3]-+h[a+8>>3]*f;break}else {f=+h[b>>3];break}}else {f=+h[23266];g=f;f=+h[a+16>>3]-+h[a+8>>3]*f;}while(0);j=+h[23268];b=e>j;d=f>j;k=+h[23269];if(!(b&d|e>3]-j)/+h[a+8>>3];e=j;}if(e>3]-k)/+h[a+8>>3];e=k;}if(d){g=(+h[a+16>>3]-j)/+h[a+8>>3];f=j;}if(f>3]-k)/+h[a+8>>3];f=k;m=46;}else m=46;}}else {d=c[a+28>>2]|0;b=c[a+24>>2]|0;do if(b){e=+h[b>>3];if(e>+h[23268])break a;g=+h[23269];if(!(e>=g)){i=+h[a+16>>3]-g*l;e=g;break}else {i=+h[b+8>>3];break}}else {g=+h[23269];i=+h[a+16>>3]-g*l;e=g;}while(0);do if(d){f=+h[d>>3];if(f>3]-l*j;f=j;break}else {g=+h[d+8>>3];break}}else {f=+h[23268];g=+h[a+16>>3]-l*f;}while(0);j=+h[23266];b=i>j;d=g>j;k=+h[23267];if(!(b&d|i>3]-j)/l;}if(i>3]-k)/l;}if(d){g=j;f=(+h[a+16>>3]-j)/l;}if(g>3]-k)/l;m=46;}else m=46;}}while(0);if((m|0)==46)ps(a,e,i,f,g);return}function ps(a,b,d,e,f){a=a|0;b=+b;d=+d;e=+e;f=+f;var g=0;g=a+32|0;Ws(c[g>>2]|0,b,d);Ws(c[g>>2]|0,e,f);a=a+36|0;Ws(c[a>>2]|0,b,d);Ws(c[a>>2]|0,e,f);return}function qs(a,b,d){a=a|0;b=b|0;d=d|0;c[a+24+(b<<2)>>2]=d;Pu(d);if(c[a+24+(1-b<<2)>>2]|0){os(a);Ou(c[a+32>>2]|0);Ou(c[a+36>>2]|0);iu(a,187400);}return}function rs(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;p=l;l=l+16|0;o=p;m=b<<2;h=KK(O(m,d)|0)|0;g=c[e>>2]|0;m=KK(m)|0;n=c[a+8>>2]|0;if(g|0){U1(c[g>>2]|0);U1(g);}k=KK(d<<2)|0;c[e>>2]=k;g=0;while(1){if((g|0)>=(d|0))break;c[k+(g<<2)>>2]=h+((O(g,b)|0)<<2);g=g+1|0;}j=(f|0)!=0;if(j)dt(a,b);e=(x5()|0)%(b|0)|0;ur(o,b);g=c[k>>2]|0;if(j){bs(e,a,b,g);f=0;g=0;}else {qr(e,a,b,g,o);f=0;g=0;}while(1){if((g|0)>=(b|0)){i=1;break}h=c[(c[k>>2]|0)+(g<<2)>>2]|0;c[m+(g<<2)>>2]=h;i=(h|0)>(f|0);f=i?h:f;e=i?g:e;g=g+1|0;}while(1){if((i|0)>=(d|0))break;h=k+(i<<2)|0;g=c[h>>2]|0;if(j){bs(e,a,b,g);g=0;f=0;}else {qr(e,a,b,g,o);g=0;f=0;}while(1){if((g|0)>=(b|0))break;s=m+(g<<2)|0;q=c[s>>2]|0;r=c[(c[h>>2]|0)+(g<<2)>>2]|0;r=(q|0)<(r|0)?q:r;c[s>>2]=r;s=(r|0)>(f|0);q=s?g:e;g=g+1|0;f=s?r:f;e=q;}i=i+1|0;}U1(m);if(j)et(a,b,n);l=p;return}function ss(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0.0,j=0,k=0;i=1.0/+(b|0);h=0;while(1){if((h|0)>=(d|0))break;j=a+(h<<2)|0;e=0.0;f=0;while(1){if((f|0)>=(b|0))break;e=e+ +(c[(c[j>>2]|0)+(f<<2)>>2]|0);f=f+1|0;}g=~~(e*i);f=0;while(1){if((f|0)>=(b|0))break;k=(c[j>>2]|0)+(f<<2)|0;c[k>>2]=(c[k>>2]|0)-g;f=f+1|0;}h=h+1|0;}return}function ts(){c[46855]=~~+C(+(+((c[46854]|0)+4|0)));return}function us(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(d*d+c*c)}function vs(a,b,c){a=a|0;b=b|0;c=c|0;h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=+h[b+8>>3]-+h[c+8>>3];return}function ws(a,b,c){a=a|0;b=b|0;c=c|0;h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=+h[c+8>>3]+ +h[b+8>>3];return}function xs(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];return +((+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d))}function ys(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+48|0;f=e+32|0;g=e+16|0;h=e;c[h>>2]=c[a>>2];c[h+4>>2]=c[a+4>>2];c[h+8>>2]=c[a+8>>2];c[h+12>>2]=c[a+12>>2];c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];d=+xs(h,g,f)>0.0&1;l=e;return d|0}function zs(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;o=+h[a>>3];p=+h[d+8>>3];q=+h[c+8>>3];m=(p-q)*o;n=+h[b>>3];l=+h[d>>3];k=+h[b+8>>3];i=+h[a+8>>3];j=k-i;f=+h[c>>3];g=m+n*(q-p)+j*l+f*(i-k);if(g==0.0)d=0;else {p=(f*(i-p)+m+(q-i)*l)/g;q=-(f*j+((q-k)*o+(i-q)*n))/g;h[e>>3]=p*(n-o)+o;h[e+8>>3]=j*p+i;d=q<=1.0&(q>=0.0&(p>=0.0&p<=1.0))&1;}return d|0}function As(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0.0,i=0;c[a+20>>2]=b;Pu(b);i=a+24|0;h[i>>3]=+h[b+8>>3]+d;e=c[46856]|0;e=e+((Bs(a)|0)*40|0)|0;while(1){f=e+32|0;e=c[f>>2]|0;if(!e)break;d=+h[i>>3];g=+h[e+24>>3];if(d>g)continue;if(!(d==g))break;if(!(+h[b>>3]>+h[c[e+20>>2]>>3]))break}c[a+32>>2]=e;c[f>>2]=a;c[46857]=(c[46857]|0)+1;return}function Bs(a){a=a|0;var b=0.0,d=0,e=0.0;d=c[46858]|0;e=+(d|0);b=(+h[a+24>>3]-+h[23273])/+h[23275]*e;do if(!(b<0.0))if(!(b>=e)){a=~~b;break}else {a=d+-1|0;break}else a=0;while(0);if((a|0)<(c[46859]|0))c[46859]=a;return a|0}function Cs(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;if(c[d>>2]|0){b=c[46856]|0;b=b+((Bs(a)|0)*40|0)|0;do{e=b+32|0;b=c[e>>2]|0;}while((b|0)!=(a|0));c[e>>2]=c[a+32>>2];c[46857]=(c[46857]|0)+-1;Ou(c[d>>2]|0);c[d>>2]=0;}return}function Ds(){return (c[46857]|0)==0|0}function Es(a){a=a|0;var b=0,d=0,e=0,f=0.0;b=c[46856]|0;d=c[46859]|0;while(1){e=c[b+(d*40|0)+32>>2]|0;if(e|0)break;e=d+1|0;c[46859]=e;d=e;}f=+h[e+24>>3];h[a>>3]=+h[c[e+20>>2]>>3];h[a+8>>3]=f;return}function Fs(){var a=0,b=0;b=(c[46856]|0)+((c[46859]|0)*40|0)+32|0;a=c[b>>2]|0;c[b>>2]=c[a+32>>2];c[46857]=(c[46857]|0)+-1;return a|0}function Gs(){U1(c[46856]|0);c[46856]=0;return}function Hs(){var a=0,b=0,d=0;c[46857]=0;c[46859]=0;a=c[46855]|0;b=a<<2;c[46858]=b;d=c[46856]|0;if(!d){d=KK(a*160|0)|0;c[46856]=d;b=c[46858]|0;}a=0;while(1){if((a|0)>=(b|0))break;c[d+(a*40|0)+32>>2]=0;a=a+1|0;}return}function Is(){fu(187448,40);U1(c[46865]|0);c[46865]=0;return}function Js(){var a=0,b=0,d=0;fu(187448,40);a=c[46855]|0;b=a<<1;c[46866]=b;d=c[46865]|0;if(!d){d=KK(a<<3)|0;c[46865]=d;b=c[46866]|0;}a=0;while(1){if((a|0)>=(b|0))break;c[d+(a<<2)>>2]=0;a=a+1|0;}c[46860]=Ks(0,0)|0;c[46861]=Ks(0,0)|0;c[c[46860]>>2]=0;d=c[46861]|0;b=c[46860]|0;c[b+4>>2]=d;c[d>>2]=b;c[(c[46861]|0)+4>>2]=0;d=c[46865]|0;c[d>>2]=c[46860];c[d+((c[46866]|0)+-1<<2)>>2]=c[46861];return}function Ks(b,d){b=b|0;d=d|0;var e=0;e=hu(187448)|0;c[e+8>>2]=b;a[e+16>>0]=d;c[e+32>>2]=0;c[e+20>>2]=0;c[e+12>>2]=0;return e|0}function Ls(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0;i=c[b+8>>2]|0;k=c[d+8>>2]|0;do if((!((i|0)==0|(k|0)==0)?(o=c[i+36>>2]|0,e=c[k+36>>2]|0,(o|0)!=(e|0)):0)?(j=+h[i>>3],f=+h[k+8>>3],g=+h[i+8>>3],l=+h[k>>3],m=f*j-l*g,!(m>-1.0e-10&m<1.0e-10)):0){p=+h[i+16>>3];q=+h[k+16>>3];n=(p*f-q*g)/m;j=(q*j-p*l)/m;f=+h[o+8>>3];g=+h[e+8>>3];do if(f>3]<+h[e>>3]:0){e=o;break}b=d;}while(0);b=a[b+16>>0]|0;if(!(n>=+h[e>>3])){if(b<<24>>24==1){b=0;break}}else if(!(b<<24>>24)){b=0;break}b=Lu()|0;c[b+20>>2]=0;h[b>>3]=n;h[b+8>>3]=j;}else b=0;while(0);return b|0}function Ms(b,d){b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0,n=0,o=0.0,p=0;n=c[b+8>>2]|0;k=c[n+36>>2]|0;l=+h[d>>3];o=+h[k>>3];m=l>o;p=a[b+16>>0]|0;if(m)if(!(p<<24>>24))b=1;else f=4;else if(p<<24>>24==1)b=0;else f=4;if((f|0)==4){e=+h[n>>3];a:do if(e==1.0){e=+h[d+8>>3];g=e-+h[k+8>>3];i=l-o;j=+h[n+8>>3];d=j<0.0;do if(m?j>=0.0:d){if(g>=j*i){b=1;break a}}else {b=j*e+l>+h[n+16>>3];if(d)if(b){b=0;break a}else break;else if(b)break;else {b=0;break a}}while(0);o=o-+h[c[n+32>>2]>>3];b=j*(i*i-g*g)>3]-l*e;j=+h[d+8>>3]-i;o=l-o;l=i-+h[k+8>>3];b=j*j>l*l+o*o;}while(0);b=(b^p<<24>>24!=0)&1;}return b|0}function Ns(a,b){a=a|0;b=b|0;c[b>>2]=a;a=a+4|0;c[b+4>>2]=c[a>>2];c[c[a>>2]>>2]=b;c[a>>2]=b;return}function Os(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[46866]|0;b=~~((+h[a>>3]-+h[23272])/+h[23274]*+(f|0));b=(b|0)>0?b:0;f=(b|0)<(f|0)?b:f+-1|0;b=Ps(f)|0;if(!b){d=1;while(1){b=Ps(f-d|0)|0;if(b|0)break;b=Ps(d+f|0)|0;if(b|0)break;d=d+1|0;}c[46867]=(c[46867]|0)+d;}c[46868]=(c[46868]|0)+1;e=c[46860]|0;d=c[46861]|0;a:do if((b|0)==(e|0))g=9;else {if((b|0)!=(d|0)?(Ms(b,a)|0)!=0:0){g=9;break}while(1){b=c[b>>2]|0;if((b|0)==(e|0))break a;if(Ms(b,a)|0){e=b;break}}}while(0);if((g|0)==9){while(1){b=c[b+4>>2]|0;if((b|0)==(d|0))break;if(!(Ms(b,a)|0))break;else g=9;}e=c[b>>2]|0;}if((f|0)>0?(f|0)<((c[46866]|0)+-1|0):0){b=(c[46865]|0)+(f<<2)|0;d=c[b>>2]|0;if(d|0){g=d+12|0;c[g>>2]=(c[g>>2]|0)+-1;}c[b>>2]=e;g=e+12|0;c[g>>2]=(c[g>>2]|0)+1;}return e|0}function Ps(a){a=a|0;var b=0,d=0;if((a|0)>-1&(c[46866]|0)>(a|0)?(d=(c[46865]|0)+(a<<2)|0,b=c[d>>2]|0,(b|0)!=0):0){if((c[b+8>>2]|0)==(-2|0)){c[d>>2]=0;a=b+12|0;d=(c[a>>2]|0)+-1|0;c[a>>2]=d;if(!d){iu(b,187448);b=0;}else b=0;}}else b=0;return b|0}function Qs(a){a=a|0;var b=0,d=0;b=a+4|0;d=c[a>>2]|0;c[d+4>>2]=c[b>>2];c[c[b>>2]>>2]=d;c[a+8>>2]=-2;return}function Rs(a){a=a|0;return c[a+4>>2]|0}function Ss(a){a=a|0;return c[a>>2]|0}function Ts(b){b=b|0;var d=0;d=c[b+8>>2]|0;if(!d)b=187672;else b=(a[b+16>>0]|0)==0?d+32|0:d+36|0;return c[b>>2]|0}function Us(b){b=b|0;var d=0;d=c[b+8>>2]|0;if(!d)b=187672;else b=(a[b+16>>0]|0)==0?d+36|0:d+32|0;return c[b>>2]|0}function Vs(){fu(187480,24);return}function Ws(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;i=j;g=(c[46869]|0)+((c[a+16>>2]|0)*96|0)+88|0;f=c[g>>2]|0;h[i+8>>3]=b;h[i+16>>3]=d;e=Xs(a,i,f)|0;do if(e|0){if((e|0)<0){i=hu(187480)|0;h[i+8>>3]=b;h[i+16>>3]=d;c[i>>2]=f;c[g>>2]=i;break}while(1){e=c[f>>2]|0;g=Xs(a,i,e)|0;if((g|0)>0)f=e;else break}if(g|0){i=hu(187480)|0;h[i+8>>3]=b;h[i+16>>3]=d;c[f>>2]=i;c[i>>2]=e;}}while(0);l=j;return}function Xs(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0;do if(c){e=+h[b+8>>3];i=+h[c+8>>3];d=+h[b+16>>3];f=+h[c+16>>3];if(!(e==i&d==f)){k=+h[a>>3];j=e-k;e=+h[a+8>>3];g=d-e;i=i-k;d=f-e;if(!(j>=0.0)){if(i>=0.0){b=1;break}e=d/i;d=g/j;if(de){b=1;break}b=j>i?-1:1;break}if(!(i<0.0)){b=i>0.0;if(!(j>0.0)){if(b){b=!(g<=0.0)?1:-1;break}if(g0.0?-1:1;break}e=d/i;d=g/j;if(de){b=1;break}b=j>2]|0;d=a+(d*20|0)+4|0;b=1;a=0;while(1){if((b|0)>=(f|0))break;g=a+((c[e+(c[(c[d>>2]|0)+(b<<2)>>2]<<2)>>2]|0)>0&1)|0;b=b+1|0;a=g;}return a|0}function Zs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+(b*20|0)|0;b=a+(b*20|0)+4|0;a=1;while(1){if((a|0)>=(c[e>>2]|0))break;c[d+(c[(c[b>>2]|0)+(a<<2)>>2]<<2)>>2]=1;a=a+1|0;}return}function _s(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+(b*20|0)|0;b=a+(b*20|0)+4|0;a=1;while(1){if((a|0)>=(c[e>>2]|0))break;c[d+(c[(c[b>>2]|0)+(a<<2)>>2]<<2)>>2]=0;a=a+1|0;}return}function $s(a,b){a=a|0;b=b|0;if(!(c[a+8>>2]|0))a=bt(a,b)|0;else a=at(a,b)|0;return a|0}function at(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=b<<2;e=KK(O(f,b)|0)|0;f=KK(f)|0;d=0;while(1){if((d|0)>=(b|0)){d=0;break}c[f+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}while(1){if((d|0)>=(b|0))break;bs(d,a,b,c[f+(d<<2)>>2]|0);d=d+1|0;}return f|0}function bt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=b<<2;e=KK(O(g,b)|0)|0;g=KK(g)|0;d=0;while(1){if((d|0)>=(b|0))break;c[g+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}ur(f,b);d=0;while(1){if((d|0)>=(b|0))break;qr(d,a,b,c[g+(d<<2)>>2]|0,f);d=d+1|0;}vr(f);l=h;return g|0}function ct(a,b){a=a|0;b=b|0;var d=0,e=0;e=c[a+8>>2]|0;dt(a,b);d=at(a,b)|0;et(a,b,e);return d|0}function dt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=KK(b<<2)|0;d=0;e=0;while(1){if((d|0)>=(b|0))break;k=(c[a+(d*20|0)>>2]|0)+e|0;d=d+1|0;e=k;}e=KK(e<<2)|0;d=0;while(1){if((d|0)>=(b|0))break;c[l+(d<<2)>>2]=0;d=d+1|0;}f=0;while(1){if((f|0)>=(b|0))break;c[a+(f*20|0)+8>>2]=e;Zs(a,f,l);h=a+(f*20|0)|0;i=c[h>>2]|0;j=a+(f*20|0)+4|0;k=i+-2|0;d=1;while(1){if((d|0)>=(i|0))break;m=c[(c[j>>2]|0)+(d<<2)>>2]|0;n=c[a+(m*20|0)>>2]|0;g[e+(d<<2)>>2]=+(k+n-((Ys(a,0,m,l)|0)<<1)|0);d=d+1|0;}_s(a,f,l);e=e+(c[h>>2]<<2)|0;f=f+1|0;}U1(l);return}function et(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+8|0;U1(c[e>>2]|0);c[e>>2]=0;a:do if(d|0){e=0;while(1){if((e|0)>=(b|0))break a;c[a+(e*20|0)+8>>2]=d;f=d+(c[a+(e*20|0)>>2]<<2)|0;e=e+1|0;d=f;}}while(0);return}function ft(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0;f=0;g=0.0;while(1){if((f|0)>=(b|0))break;j=c[a+(f<<2)>>2]|0;i=+h[j+(d<<3)>>3]-+h[j+(e<<3)>>3];f=f+1|0;g=i*i+g;}return +(+C(+g))}function gt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if((e|0)>(d|0)){c[46873]=a;o4(b+(d<<2)|0,1-d+e|0,4,77);}return}function ht(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[46873]|0;e=+g[f+(c[a>>2]<<2)>>2];d=+g[f+(c[b>>2]<<2)>>2];return (ed&1)|0}function it(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;if((d|0)<(e|0)){jt(a,b,d,e,f);g=c[f>>2]|0;f=g+-1|0;it(a,b,d,f);g=g+1|0;it(a,b,g,e);if(!(kt(a,b,d,f)|0))it(a,b,d,f);if(!(kt(a,b,g,e)|0))it(a,b,g,e);}l=h;return}function jt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0.0,m=0,n=0;g=x5()|0;g=b+(((((x5()|0)<<16|g)>>>0)%((1-d+e|0)>>>0)|0)+d<<2)|0;j=c[g>>2]|0;k=b+(d<<2)|0;c[g>>2]=c[k>>2];c[k>>2]=j;l=+h[a+(j<<3)>>3];g=d+1|0;d=e;a:while(1){if((g|0)>=(d|0))break;while(1){if((g|0)>=(d|0))break;if(!(+h[a+(c[b+(g<<2)>>2]<<3)>>3]<=l))break;g=g+1|0;}while(1){if((g|0)>=(d|0))continue a;e=b+(d<<2)|0;i=c[e>>2]|0;if(!(+h[a+(i<<3)>>3]>l))break;d=d+-1|0;}n=b+(g<<2)|0;m=c[n>>2]|0;c[n>>2]=i;c[e>>2]=m;g=g+1|0;d=d+-1|0;}n=g+((+h[a+(c[b+(g<<2)>>2]<<3)>>3]>l)<<31>>31)|0;c[f>>2]=n;n=b+(n<<2)|0;c[k>>2]=c[n>>2];c[n>>2]=j;return}function kt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=1;while(1){f=d+1|0;if(!((d|0)<(e|0)&(g|0)!=0))break;g=+h[a+(c[b+(d<<2)>>2]<<3)>>3]>+h[a+(c[b+(f<<2)>>2]<<3)>>3]?0:g;d=f;}return g|0}function lt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,A=0.0;x=l;l=l+16|0;v=4;w=T1(40)|0;c[w>>2]=0;t=x;o=0;u=$(23,b*40|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){d=0;r=0;while(1){if((d|0)>=(b|0))break;s=(c[(c[a+(d<<2)>>2]|0)+4>>2]|0)+r|0;d=d+1|0;r=s;}o=0;s=$(23,r*24|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){d=0;m=0;while(1){if((m|0)>=(b|0))break;n=u+(m*40|0)|0;c[n>>2]=s+(d*24|0);q=a+(m<<2)|0;f=0;g=1797693134862315708145274.0e284;i=-1797693134862315708145274.0e284;j=-1797693134862315708145274.0e284;k=1797693134862315708145274.0e284;while(1){e=c[q>>2]|0;if((f|0)>=(c[e+4>>2]|0))break;e=c[e>>2]|0;A=+h[e+(f<<4)>>3];y=+h[e+(f<<4)+8>>3];h[s+(d*24|0)>>3]=A;h[s+(d*24|0)+8>>3]=y;c[s+(d*24|0)+16>>2]=n;c[s+(d*24|0)+20>>2]=0;f=f+1|0;d=d+1|0;g=gA?i:A;j=j>y?j:y;k=k>2]=s+((d+-1|0)*24|0);h[u+(m*40|0)+8>>3]=g;h[u+(m*40|0)+16>>3]=k;h[u+(m*40|0)+24>>3]=i;h[u+(m*40|0)+32>>3]=j;m=m+1|0;}c[t>>2]=r;c[t+4>>2]=b;w=U6(187496,1,w|0,v|0)|0;v=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;q=s;m=s;n=u;}else {d=0;q=s;m=s;n=u;}}else {d=z;q=0;m=s;n=u;}}else {d=z;q=0;m=0;n=0;}while(1){if(d|0){o=0;ia(105,u|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}o=0;ia(105,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}else {e=17;break}}o=0;d=aa(78,q|0,t|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}if(!d){o=0;d=ca(24,a|0,b|0,n|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}}o=0;ia(105,u|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}o=0;ia(105,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;}else {e=24;break}}if((e|0)==17)d=0;else if((e|0)==24)d=(d|0)==0&1;U1(w|0);l=x;return d|0}function mt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;q=v;o=v+8|0;p=v+4|0;c[b+8>>2]=0;u=KK(c[b>>2]<<2)|0;f=c[b>>2]|0;e=0;while(1){if((e|0)>=(f|0))break;c[u+(e<<2)>>2]=a+(e*24|0);e=e+1|0;}o4(u,f,4,79);m=0;g=0;f=0;h=0;a:while(1){if((m|0)>=(c[b>>2]|0)){s=0;d=g;t=h;break}n=u+(m<<2)|0;e=c[n>>2]|0;c[o>>2]=e;a=c[e+16>>2]|0;if((c[a>>2]|0)==(e|0))e=c[a+4>>2]|0;else e=e+-24|0;c[p>>2]=e;k=0;a=g;j=h;while(1){if((k|0)>=2)break;switch(ot(o,p)|0){case -1:{g=0;h=a;while(1){if((g|0)>=(j|0))break;i=pt(c[h>>2]|0,e)|0;if(i|0){s=i;d=a;t=j;break a}g=g+1|0;h=c[h+4>>2]|0;}g=KK(12)|0;if(!j){f=0;a=g;}else c[f+4>>2]=g;c[g+8>>2]=f;c[g>>2]=e;c[g+4>>2]=0;c[e+20>>2]=g;h=j+1|0;break}case 1:{e=e+20|0;g=c[e>>2]|0;if(!g){r=19;break a}do if((j|0)!=1){if((g|0)==(a|0)){a=c[a+4>>2]|0;c[a+8>>2]=0;break}if((g|0)==(f|0)){f=c[f+8>>2]|0;c[f+4>>2]=0;break}else {i=g+4|0;h=c[g+8>>2]|0;c[h+4>>2]=c[i>>2];c[(c[i>>2]|0)+8>>2]=h;break}}else {a=0;f=0;}while(0);U1(g);c[e>>2]=0;g=f;h=j+-1|0;break}default:{g=f;h=j;}}e=c[n>>2]|0;f=c[e+16>>2]|0;if((e|0)==(c[f+4>>2]|0))f=c[f>>2]|0;else f=e+24|0;c[p>>2]=f;k=k+1|0;f=g;j=h;}m=m+1|0;g=a;h=j;}if((r|0)==19){gA(1,93727,q)|0;bb(187496,1);}e=0;while(1){if((e|0)>=(t|0))break;r=c[d+4>>2]|0;U1(d);e=e+1|0;d=r;}U1(u);l=v;return s|0}function nt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0.0;D=l;l=l+48|0;o=D+24|0;n=D+16|0;u=D;e=0;a:while(1){if((e|0)>=(b|0)){e=0;break}z=c[a+(e<<2)>>2]|0;A=c[z>>2]|0;c[u>>2]=c[A>>2];c[u+4>>2]=c[A+4>>2];c[u+8>>2]=c[A+8>>2];c[u+12>>2]=c[A+12>>2];A=e+1|0;B=d+(e*40|0)+8|0;p=d+(e*40|0)+24|0;q=d+(e*40|0)+32|0;g=d+(e*40|0)+16|0;e=A;while(1){if((e|0)>=(b|0)){e=A;continue a}i=c[a+(e<<2)>>2]|0;j=+h[B>>3];k=+h[d+(e*40|0)+24>>3];m=!(j<=k);f=+h[d+(e*40|0)+8>>3];if((((!(m|!(j>=f))?(r=+h[g>>3],s=+h[d+(e*40|0)+32>>3],r<=s):0)?(t=+h[d+(e*40|0)+16>>3],r>=t):0)?(E=+h[p>>3],!(!(E<=k)|!(E>=f))):0)?(E=+h[q>>3],!(!(E<=s)|!(E>=t))):0){c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[o>>2]=c[u>>2];c[o+4>>2]=c[u+4>>2];c[o+8>>2]=c[u+8>>2];c[o+12>>2]=c[u+12>>2];if(NX(n,o)|0){e=1;break a}}else C=11;if((((((C|0)==11?(C=0,v=+h[p>>3],!(!(f<=v)|!(f>=j))):0)?(w=+h[d+(e*40|0)+16>>3],x=+h[q>>3],w<=x):0)?(y=+h[g>>3],!(!(w>=y)|(!(k<=v)|m))):0)?(E=+h[d+(e*40|0)+32>>3],!(!(E<=x)|!(E>=y))):0)?(m=c[i>>2]|0,c[n>>2]=c[z>>2],c[n+4>>2]=c[z+4>>2],c[o>>2]=c[m>>2],c[o+4>>2]=c[m+4>>2],c[o+8>>2]=c[m+8>>2],c[o+12>>2]=c[m+12>>2],NX(n,o)|0):0){e=1;break a}e=e+1|0;}}l=D;return e|0}function ot(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=c[a>>2]|0;a=c[b>>2]|0;d=+h[e>>3]-+h[a>>3];if(!(d!=0.0)){d=+h[e+8>>3]-+h[a+8>>3];if(d==0.0)a=0;else a=d>0.0?1:-1;}else a=d>0.0?1:-1;return a|0}function pt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+64|0;g=m+32|0;i=m+24|0;j=m+16|0;k=m;f=m+48|0;qt(a,b,f);d=f+8|0;e=c[d>>2]|0;do if((e|0)>0)d=0;else {if((e|0)<0){qt(b,a,f);d=c[d>>2]|0;if((d|0)>0){d=0;break}if((d|0)<0)d=3;else {d=c[f>>2]|0;d=rt(b,a,(d|0)>-1?d:0-d|0)|0;}if(!(st(a,b,i,j,d)|0)){d=0;break}}else {d=c[f>>2]|0;if((d|0)==(c[f+4>>2]|0)){d=rt(a,b,0)|0;d=(rt(a,b,(d|0)<=(rt(a,b,1)|0)&1)|0)<<1;}else d=rt(a,b,(d|0)>-1?d:0-d|0)|0;if(!(st(a,b,i,j,d)|0)){d=0;break}}h[k>>3]=+h[i>>3];h[k+8>>3]=+h[j>>3];c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];d=tt(a,b,g)|0;}while(0);l=m;return d|0}function qt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0;i=+h[a>>3];j=+h[a+8>>3];e=c[a+16>>2]|0;if((c[e+4>>2]|0)==(a|0)){a=c[e>>2]|0;e=a;}else {e=a+24|0;a=a+24|0;}g=+h[e>>3]-i;f=+h[a+8>>3]-j;e=c[b+16>>2]|0;if((c[e+4>>2]|0)==(b|0)){a=c[e>>2]|0;e=a;}else {e=b+24|0;a=b+24|0;}k=+h[e>>3]-i;l=+h[a+8>>3]-j;j=(+h[b+8>>3]-j)*g-(+h[b>>3]-i)*f;b=j==0.0?0:j>0.0?1:-1;c[d>>2]=b;j=l*g-k*f;a=j==0.0?0:j>0.0?1:-1;c[d+4>>2]=a;c[d+8>>2]=O(a,b)|0;return}function rt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0;k=+h[a>>3];l=+h[a+8>>3];f=c[a+16>>2]|0;if((c[f+4>>2]|0)==(a|0))a=c[f>>2]|0;else a=a+24|0;j=+h[a>>3];i=+h[a+8>>3];do if(d){a=c[b+16>>2]|0;if((c[a+4>>2]|0)==(b|0)){b=c[a>>2]|0;break}else {b=b+24|0;break}}while(0);g=+h[b>>3];e=+h[b+8>>3];if(k==j)if(k==g)b=(vt(l,e,i)|0)!=-1&1;else b=0;else b=vt(k,g,j)|0;return b|0}function st(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;a:do if((f|0)<1)g=0;else {n=+h[a>>3];p=+h[a+8>>3];g=c[a+16>>2]|0;if((c[g+4>>2]|0)==(a|0))g=c[g>>2]|0;else g=a+24|0;l=+h[g>>3];j=+h[g+8>>3];m=+h[b>>3];o=+h[b+8>>3];g=c[b+16>>2]|0;if((c[g+4>>2]|0)==(b|0))g=c[g>>2]|0;else g=b+24|0;k=+h[g>>3];i=+h[g+8>>3];b:do switch(f|0){case 3:{if(n==l){h[d>>3]=n;i=(o-i)/(m-k)*(n-k)+i;break b}if(m==k){h[d>>3]=m;i=(p-j)/(n-l)*(m-l)+j;break b}else {k=(o-i)/(m-k);l=(p-j)/(n-l);o=o-k*m;p=p-l*n;i=k-l;h[d>>3]=(p-o)/i;i=(k*p-o*l)/i;break b}}case 2:{if((rt(a,b,0)|0)==-1)if((rt(b,a,1)|0)==-1){f=(rt(b,a,0)|0)==-1;l=f?l:n;k=m;j=f?j:p;i=o;}else {l=k;k=m;j=i;i=o;}else if((rt(a,b,1)|0)!=-1)if((rt(b,a,0)|0)==-1){k=n;i=p;}else {g=0;break a}else {l=m;j=o;}h[d>>3]=(k+l)*.5;i=(i+j)*.5;break}case 1:if((o-p)*(n-l)==(m-n)*(p-j)){h[d>>3]=m;i=o;break b}else {h[d>>3]=k;break b}default:{g=1;break a}}while(0);h[e>>3]=i;g=1;}while(0);return g|0}function tt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;o=+h[a>>3];p=+h[a+8>>3];e=c[a+16>>2]|0;if((c[e+4>>2]|0)==(a|0))e=c[e>>2]|0;else e=a+24|0;m=+h[e>>3];j=+h[e+8>>3];k=+h[b>>3];n=+h[b+8>>3];e=c[b+16>>2]|0;if((c[e+4>>2]|0)==(b|0))e=c[e>>2]|0;else e=b+24|0;i=+h[e>>3];g=+h[e+8>>3];a:do if(!(o!=m&k!=i)){do if(o==m){f=+h[d>>3];if(o==f?p==+h[d+8>>3]:0)break;if(!(m==f)){r=18;break a}if(!(j==+h[d+8>>3])){r=18;break a}}while(0);if(k==i){f=+h[d>>3];if(k==f?n==+h[d+8>>3]:0){e=0;break}if(i==f?g==+h[d+8>>3]:0)e=0;else r=18;}else e=0;}else r=18;while(0);if((r|0)==18)if(0>1);else e=1;l=s;return e|0}function ut(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0;k=l;l=l+48|0;j=k;f=c[15712]|0;g=+h[b>>3];i=+h[b+8>>3];d=c[b+16>>2]|0;if((c[d+4>>2]|0)==(b|0)){d=c[d>>2]|0;e=d;}else {e=b+24|0;d=b+24|0;}n=+h[e>>3];m=+h[d+8>>3];c[j>>2]=a;h[j+8>>3]=g;h[j+16>>3]=i;h[j+24>>3]=n;h[j+32>>3]=m;w4(f,93784,j)|0;l=k;return}function vt(a,b,c){a=+a;b=+b;c=+c;return (a==b|b==c?0:(a>3]=0.0;e=e+1|0;}h[f+(a<<3)>>3]=1.0;vy(c[b+(a<<2)>>2]|0,f,d);a=a+1|0;}U1(f);f=0;while(1){if((f|0)>=(d|0)){a=1;break a}e=b+(f<<2)|0;a=0;while(1){if((a|0)==(f|0))break;j=(c[e>>2]|0)+(a<<3)|0;i=+h[j>>3];g=(c[b+(a<<2)>>2]|0)+(f<<3)|0;h[j>>3]=+h[g>>3];h[g>>3]=i;a=a+1|0;}f=f+1|0;}}while(0);return a|0}function xt(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=b<<3;p=KK(q)|0;q=KK(q)|0;r=b*30|0;n=(d|0)<(b|0)?d:b;o=b+-1|0;m=(g|0)==0;d=0;i=0;a:while(1){if((i|0)>=(n|0))break;k=c[e+(i<<2)>>2]|0;do{b:do if(m)d=0;else {d=0;while(1){if((d|0)==(b|0)){d=0;break b}h[k+(d<<3)>>3]=+((x5()|0)%100|0|0);d=d+1|0;}}while(0);while(1){if((d|0)==(i|0))break;g=c[e+(d<<2)>>2]|0;zt(k,0,o,-+yt(g,0,o,k),g);d=d+1|0;}j=+At(k,0,o);}while(j<1.0e-10);Bt(k,0,o,1.0/j,k);d=0;do{Ct(q,0,o,k);Dt(a,b,b,k,p);Ct(k,0,o,p);g=0;while(1){if((g|0)==(i|0))break;s=c[e+(g<<2)>>2]|0;zt(k,0,o,-+yt(s,0,o,k),s);g=g+1|0;}s=d;d=d+1|0;j=+At(k,0,o);if(!((s|0)<(r|0)&!(j<1.0e-10)))break a;Bt(k,0,o,1.0/j,k);l=+yt(k,0,o,q);}while(+B(+l)<.999);h[f+(i<<3)>>3]=l*j;i=i+1|0;}while(1){if((i|0)>=(n|0))break;k=c[e+(i<<2)>>2]|0;g=0;while(1){if((g|0)>=(b|0)){g=0;break}h[k+(g<<3)>>3]=+((x5()|0)%100|0|0);g=g+1|0;}while(1){if((g|0)>=(i|0))break;s=c[e+(g<<2)>>2]|0;zt(k,0,o,-+yt(s,0,o,k),s);g=g+1|0;}Bt(k,0,o,1.0/+At(k,0,o),k);h[f+(i<<3)>>3]=0.0;i=i+1|0;}m=n+-1|0;i=0;while(1){if((i|0)>=(m|0))break;a=f+(i<<3)|0;b=i+1|0;j=+h[a>>3];g=i;k=b;while(1){if((k|0)>=(n|0))break;l=+h[f+(k<<3)>>3];s=j>2]|0);s=e+(g<<2)|0;Ct(c[k>>2]|0,0,o,c[s>>2]|0);Ct(c[s>>2]|0,0,o,p);h[f+(g<<3)>>3]=+h[a>>3];h[a>>3]=j;i=b;}U1(p);U1(q);return (d|0)<=(r|0)|0}function yt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0;f=0.0;e=1-b+c|0;d=d+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!e)break;f=+h[d>>3]*+h[c>>3]+f;e=e+-1|0;d=d+8|0;c=c+8|0;}return +f}function zt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0;f=1-b+c|0;e=e+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!f)break;h[c>>3]=+h[c>>3]+ +h[e>>3]*d;f=f+-1|0;e=e+8|0;c=c+8|0;}return}function At(a,b,c){a=a|0;b=b|0;c=c|0;return +(+C(+(+yt(a,b,c,a))))}function Bt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0;f=1-b+c|0;e=e+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!f)break;h[c>>3]=+h[e>>3]*d;f=f+-1|0;e=e+8|0;c=c+8|0;}return}function Ct(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=1-b+c|0;d=d+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!e)break;h[c>>3]=+h[d>>3];e=e+-1|0;d=d+8|0;c=c+8|0;}return}function Dt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0;j=0;while(1){if((j|0)>=(b|0))break;k=a+(j<<2)|0;g=0.0;i=0;while(1){if((i|0)>=(d|0))break;g=+h[e+(i<<3)>>3]*+h[(c[k>>2]|0)+(i<<3)>>3]+g;i=i+1|0;}h[f+(j<<3)>>3]=g;j=j+1|0;}return}function Et(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0.0,m=0,n=0,o=0,p=0.0;k=c[i>>2]|0;if(!k){o=d<<2;j=T1(O(o,f)|0)|0;o=T1(o)|0;}else {o=d<<2;j=W1(c[k>>2]|0,O(o,f)|0)|0;o=W1(k,o)|0;}c[i>>2]=o;k=0;while(1){if((k|0)>=(d|0)){i=0;break}c[o+(k<<2)>>2]=j;k=k+1|0;j=j+(f<<2)|0;}while(1){if((i|0)>=(d|0))break;m=a+(i<<2)|0;n=o+(i<<2)|0;k=0;while(1){if((k|0)<(f|0)){j=0;l=0.0;}else break;while(1){if((j|0)>=(e|0))break;p=+h[(c[m>>2]|0)+(j<<3)>>3]*+g[(c[b+(j<<2)>>2]|0)+(k<<2)>>2]+l;j=j+1|0;l=p;}g[(c[n>>2]|0)+(k<<2)>>2]=l;k=k+1|0;}i=i+1|0;}return}function Ft(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0.0,m=0,n=0,o=0;k=c[i>>2]|0;if(!k){j=T1(O(d<<3,f)|0)|0;o=T1(d<<2)|0;}else {j=W1(c[k>>2]|0,O(d<<3,f)|0)|0;o=W1(k,d<<2)|0;}c[i>>2]=o;k=0;while(1){if((k|0)>=(d|0)){i=0;break}c[o+(k<<2)>>2]=j;k=k+1|0;j=j+(f<<3)|0;}while(1){if((i|0)>=(d|0))break;m=a+(i<<2)|0;n=o+(i<<2)|0;k=0;while(1){if((k|0)<(f|0)){l=0.0;j=0;}else break;while(1){if((j|0)>=(e|0))break;l=+h[(c[m>>2]|0)+(j<<3)>>3]*+g[(c[b+(j<<2)>>2]|0)+(k<<2)>>2]+l;j=j+1|0;}h[(c[n>>2]|0)+(k<<3)>>3]=l;k=k+1|0;}i=i+1|0;}return}function Gt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0;j=c[f>>2]|0;if(!j){i=T1(O(d*20|0,e)|0)|0;q=T1(d<<2)|0;}else {i=W1(c[j>>2]|0,O(d*20|0,e)|0)|0;q=W1(j,d<<2)|0;}c[f>>2]=q;j=0;while(1){if((j|0)>=(d|0)){f=0;break}c[q+(j<<2)>>2]=i;j=j+1|0;i=i+(e<<2)|0;}while(1){if((f|0)>=(d|0))break;l=c[a+(f*20|0)+4>>2]|0;m=c[a+(f*20|0)+8>>2]|0;n=c[a+(f*20|0)>>2]|0;o=q+(f<<2)|0;i=0;while(1){if((i|0)>=(e|0))break;p=b+(i<<2)|0;k=0.0;j=0;while(1){if((j|0)>=(n|0))break;k=+h[(c[p>>2]|0)+(c[l+(j<<2)>>2]<<3)>>3]*+g[m+(j<<2)>>2]+k;j=j+1|0;}g[(c[o>>2]|0)+(i<<2)>>2]=k;i=i+1|0;}f=f+1|0;}return}function Ht(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0;c=0.0;d=b;e=a;while(1){if(!e)break;c=+h[d>>3]+c;d=d+8|0;e=e+-1|0;}c=c/+(a|0);while(1){if(!a)break;h[b>>3]=+h[b>>3]-c;b=b+8|0;a=a+-1|0;}return}function It(a,b){a=a|0;b=b|0;var c=0;c=0;while(1){if((c|0)>=(a|0))break;h[b+(c<<3)>>3]=+((x5()|0)%500|0|0);c=c+1|0;}Ht(a,b);return}function Jt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,l=0,m=0;j=0;while(1){if((j|0)>=(b|0))break;k=c[a+(j*20|0)>>2]|0;l=a+(j*20|0)+8|0;m=a+(j*20|0)+4|0;f=0.0;i=0;while(1){if((i|0)>=(k|0))break;f=+h[d+(c[(c[m>>2]|0)+(i<<2)>>2]<<3)>>3]*+g[(c[l>>2]|0)+(i<<2)>>2]+f;i=i+1|0;}h[e+(j<<3)>>3]=f;j=j+1|0;}return}function Kt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0;j=0;while(1){if((j|0)>=(b|0))break;k=a+(j<<2)|0;f=0.0;i=0;while(1){if((i|0)==(b|0))break;f=+h[d+(i<<3)>>3]*+g[(c[k>>2]|0)+(i<<2)>>2]+f;i=i+1|0;}h[e+(j<<3)>>3]=f;j=j+1|0;}return}function Lt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[b+(e<<3)>>3]-+h[c+(e<<3)>>3];e=e+1|0;}return}function Mt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[c+(e<<3)>>3]+ +h[b+(e<<3)>>3];e=e+1|0;}return}function Nt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[b+(e<<3)>>3]*c;e=e+1|0;}return}function Ot(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;h[c+(d<<3)>>3]=+h[b+(d<<3)>>3];d=d+1|0;}return}function Pt(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0;d=0.0;e=0;while(1){if((e|0)>=(a|0))break;d=+h[c+(e<<3)>>3]*+h[b+(e<<3)>>3]+d;e=e+1|0;}return +d}function Qt(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0;c=0;d=-1.e+50;while(1){if((c|0)>=(a|0))break;e=+B(+(+h[b+(c<<3)>>3]));c=c+1|0;d=e>d?e:d;}return +d}function Rt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0;j=0;while(1){if((j|0)<(b|0)){g=0.0;i=0;}else break;while(1){if((i|0)>=(d|0))break;g=+h[e+(i<<3)>>3]*+h[(c[a+(i<<2)>>2]|0)+(j<<3)>>3]+g;i=i+1|0;}h[f+(j<<3)>>3]=g;j=j+1|0;}return}function St(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0;c=0.0;d=b;e=a;while(1){if(!e)break;c=+g[d>>2]+c;d=d+4|0;e=e+-1|0;}c=c/+(a|0);while(1){if(!a)break;g[b>>2]=+g[b>>2]-c;b=b+4|0;a=a+-1|0;}return}function Tt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0,l=0.0,m=0,n=0.0,o=0,p=0.0;e=0;while(1){if((e|0)>=(b|0)){h=0;j=0;m=b;break}g[d+(e<<2)>>2]=0.0;e=e+1|0;}while(1){if((j|0)>=(b|0))break;l=+g[c+(j<<2)>>2];k=j+1|0;f=+g[a+(h<<2)>>2]*l;i=k;e=h;while(1){e=e+1|0;if((i|0)==(b|0))break;p=+g[a+(e<<2)>>2];n=+g[c+(i<<2)>>2]*p+f;o=d+(i<<2)|0;g[o>>2]=+g[o>>2]+p*l;f=n;i=i+1|0;}o=d+(j<<2)|0;g[o>>2]=+g[o>>2]+f;h=h+m|0;j=k;m=m+-1|0;}return}function Ut(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[b+(e<<2)>>2]-+g[c+(e<<2)>>2];e=e+1|0;}return}function Vt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[c+(e<<2)>>2]+ +g[b+(e<<2)>>2];e=e+1|0;}return}function Wt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=b+(e<<2)|0;g[f>>2]=+g[d+(e<<2)>>2]*c+ +g[f>>2];e=e+1|0;}return}function Xt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[b+(e<<2)>>2]*c;e=e+1|0;}return}function Yt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;c[d+(e<<2)>>2]=c[b+(e<<2)>>2];e=e+1|0;}return}function Zt(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0;d=0.0;e=0;while(1){if((e|0)>=(a|0))break;d=d+ +g[c+(e<<2)>>2]*+g[b+(e<<2)>>2];e=e+1|0;}return +d}function _t(a,b,c){a=a|0;b=+b;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;h[c+(d<<3)>>3]=b;d=d+1|0;}return}function $t(a,b,c){a=a|0;b=+b;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;g[c+(d<<2)>>2]=b;d=d+1|0;}return}function au(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0;c=-1000000015047466219876688.0e6;d=0;while(1){if((d|0)>=(a|0))break;e=+B(+(+g[b+(d<<2)>>2]));c=e>c?e:c;d=d+1|0;}return +c}function bu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];g[d>>2]=e*e;c=c+1|0;}return}function cu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];if(e!=0.0)g[d>>2]=1.0/e;c=c+1|0;}return}function du(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0;d=0;while(1){if((d|0)>=(a|0))break;e=+g[b+(d<<2)>>2];if(e>=0.0)g[c+(d<<2)>>2]=+C(+e);d=d+1|0;}return}function eu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];if(e>0.0)g[d>>2]=1.0/+C(+e);c=c+1|0;}return}function fu(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=0;if(b&3)if(!(4%(b>>>0)|0))b=4;else b=O(4/((gu(b)|0)>>>0)|0,b)|0;c[a+8>>2]=b;a=a+4|0;b=c[a>>2]|0;a:do if(b|0)while(1){if(!b)break a;d=c[b>>2]|0;U1(c[b+4>>2]|0);U1(b);b=d;}while(0);c[a>>2]=0;return}function gu(a){a=a|0;var b=0,c=0;c=4;a:while(1){b=c;while(1){if((b|0)==(a|0))break a;if((b|0)<=(a|0))break;b=b-a|0;}c=b;a=a-b|0;}return a|0}function hu(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;if(!b){d=c[a+8>>2]|0;e=KK(8)|0;f=KK(O(c[46855]|0,d)|0)|0;c[e+4>>2]=f;b=0;while(1){if((b|0)>=(c[46855]|0))break;iu(f+(O(b,d)|0)|0,a);b=b+1|0;}b=a+4|0;c[e>>2]=c[b>>2];c[b>>2]=e;b=c[a>>2]|0;}c[a>>2]=c[b>>2];return b|0}function iu(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[b>>2]=a;return}function ju(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0;m=JK(b<<3)|0;l=a+8|0;f=c[l>>2]|0;ku(a,b,m);It(b,d);h=0;i=0;while(1){if((i|0)>=(b|0))break;h=(c[a+(i*20|0)>>2]|0)+h|0;i=i+1|0;}h=KK(h<<2)|0;j=0;while(1){if((j|0)>=(b|0))break;c[a+(j*20|0)+8>>2]=h;k=c[a+(j*20|0)>>2]|0;g[h>>2]=+(1-k|0);i=1;while(1){if((i|0)>=(k|0))break;g[h+(i<<2)>>2]=1.0;i=i+1|0;}h=h+(k<<2)|0;j=j+1|0;}i=yr(a,d,m,b,.001,e)|0;U1(c[l>>2]|0);h=0;while(1){if((h|0)>=(b|0))break;c[a+(h*20|0)+8>>2]=f;f=f+(c[a+(h*20|0)>>2]<<2)|0;h=h+1|0;}U1(m);return i>>>31|0}function ku(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,i=0,j=0,k=0,l=0,m=0;k=a+16|0;i=0;while(1){if((i|0)>=(b|0))break;if(c[k>>2]|0){l=c[a+(i*20|0)>>2]|0;m=a+(i*20|0)+8|0;j=a+(i*20|0)+16|0;e=0.0;f=1;while(1){if((f|0)>=(l|0))break;e=e+ +g[(c[j>>2]|0)+(f<<2)>>2]*+g[(c[m>>2]|0)+(f<<2)>>2];f=f+1|0;}h[d+(i<<3)>>3]=e;}i=i+1|0;}return}function lu(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=+h;i=i|0;j=j|0;a=l;l=l+16|0;if(!(c[46913]|0)){c[46913]=1;gA(1,93820,a)|0;}l=a;return}function mu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=KK(f<<2)|0;i=b<<3;g=0;while(1){if((g|0)>=(f|0))break;c[r+(g<<2)>>2]=KK(i)|0;g=g+1|0;}p=KK(f<<3)|0;q=KK(b<<2)|0;g=KK(O(i,b)|0)|0;i=0;while(1){if((i|0)>=(b|0))break;c[q+(i<<2)>>2]=g;g=g+(b<<3)|0;i=i+1|0;}k=0;o=1;while(1){if((k|0)>=(b|0))break;l=a+(k<<2)|0;m=q+(k<<2)|0;i=0;while(1){if((i|0)==(o|0))break;n=a+(i<<2)|0;g=0;j=0.0;while(1){if((g|0)>=(d|0))break;s=j+ +(O(c[(c[n>>2]|0)+(g<<2)>>2]|0,c[(c[l>>2]|0)+(g<<2)>>2]|0)|0);g=g+1|0;j=s;}h[(c[q+(i<<2)>>2]|0)+(k<<3)>>3]=j;h[(c[m>>2]|0)+(i<<3)>>3]=j;i=i+1|0;}k=k+1|0;o=o+1|0;}xt(q,b,f,r,p,1)|0;i=0;while(1){if((i|0)>=(f|0)){g=0;break}l=r+(i<<2)|0;m=e+(i<<2)|0;k=0;while(1){if((k|0)<(d|0)){g=0;j=0.0;}else break;while(1){if((g|0)>=(b|0))break;s=+h[(c[l>>2]|0)+(g<<3)>>3]*+(c[(c[a+(g<<2)>>2]|0)+(k<<2)>>2]|0)+j;g=g+1|0;j=s;}h[(c[m>>2]|0)+(k<<3)>>3]=j;k=k+1|0;}i=i+1|0;}while(1){if((g|0)>=(f|0))break;U1(c[r+(g<<2)>>2]|0);g=g+1|0;}U1(r);U1(p);U1(c[q>>2]|0);U1(q);return}function nu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+32|0;g=f+16|0;j=f+20|0;i=f+12|0;h=f+8|0;c[g>>2]=e;c[i>>2]=0;c[h>>2]=0;iy(c[a>>2]|0,d,d<<2,j);Gt(c[j>>2]|0,a,d,b,i);Ft(a,c[i>>2]|0,b,d,b,h);U1(c[c[i>>2]>>2]|0);U1(c[i>>2]|0);e=(xt(c[h>>2]|0,b,1,g,f,1)|0)&255;l=f;return e|0}function ou(){c[46914]=0;U1(c[46915]|0);U1(c[46916]|0);U1(c[46917]|0);c[46915]=0;c[46916]=0;c[46917]=0;return}function pu(a){a=a|0;U1(c[a+36>>2]|0);return}function qu(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0;r=l;l=l+80|0;o=r+64|0;q=r+68|0;i=r+48|0;j=r+32|0;k=r+16|0;m=r;n=d+16|0;g=c[n>>2]|0;a:do if(!(c[g+212>>2]|0))switch(WM(d)|0){case 1:{g=c[n>>2]|0;j=c[g+12>>2]|0;k=c[j+8>>2]|0;c[q>>2]=k;g=c[c[g+8>>2]>>2]|0;switch(a[g>>0]|0){case 98:{if(!(s2(g,108236)|0))p=11;else p=8;break}case 112:{if((s2(g,105721)|0)==0?(ru(c[j+44>>2]|0,k)|0)!=0:0)p=11;else p=8;break}default:p=8;}do if((p|0)==8)if((k|0)<3){c[b+40>>2]=(c[j>>2]|0)==0?0:2;p=17;break}else {g=b+40|0;c[g>>2]=0;break}else if((p|0)==11){g=b+40|0;c[g>>2]=1;if((k|0)<=2)p=17;}while(0);if((p|0)==17){i=su(d,q,e,f)|0;p=21;break a}i=KK(k<<4)|0;j=j+44|0;if((c[g>>2]|0)==1){p=c[j>>2]|0;s=e;h[i>>3]=+h[p>>3]*.013888888888888888+s;e=f;h[i+8>>3]=+h[p+8>>3]*.013888888888888888+e;h[i+16>>3]=+h[p+16>>3]*.013888888888888888-s;h[i+24>>3]=+h[p+24>>3]*.013888888888888888+e;h[i+32>>3]=+h[p+32>>3]*.013888888888888888-s;h[i+40>>3]=+h[p+40>>3]*.013888888888888888-e;h[i+48>>3]=+h[p+48>>3]*.013888888888888888+s;h[i+56>>3]=+h[p+56>>3]*.013888888888888888-e;p=21;break a}g=0;while(1){if((g|0)>=(k|0)){p=21;break a}p=c[j>>2]|0;u=+h[p+(g<<4)>>3];s=+h[p+(g<<4)+8>>3];t=+C(+(s*s+u*u));h[i+(g<<4)>>3]=(e/t+1.0)*u*.013888888888888888;h[i+(g<<4)+8>>3]=(f/t+1.0)*s*.013888888888888888;g=g+1|0;}}case 2:{c[q>>2]=4;p=KK(64)|0;d=c[(c[n>>2]|0)+12>>2]|0;v=+h[d+32>>3];t=+h[d+40>>3];o=~~+h[d+16>>3];d=~~+h[d+24>>3];u=-e;s=-f;tu(i,o,d,u,s);c[p>>2]=c[i>>2];c[p+4>>2]=c[i+4>>2];c[p+8>>2]=c[i+8>>2];c[p+12>>2]=c[i+12>>2];i=p+16|0;n=~~v;tu(j,n,d,e,s);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];i=p+32|0;d=~~t;tu(k,n,d,e,f);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];i=p+48|0;tu(m,o,d,u,f);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[b+40>>2]=1;i=p;p=21;break a}case 3:{c[b+40>>2]=2;i=su(d,q,e,f)|0;p=21;break a}default:{c[o>>2]=c[c[(c[n>>2]|0)+8>>2]>>2];gA(1,93883,o)|0;g=1;break a}}else {c[q>>2]=4;u=+h[g+32>>3]*.5+e;v=+h[g+40>>3]*.5+f;c[b+40>>2]=1;i=KK(64)|0;h[i>>3]=u;h[i+8>>3]=v;t=-u;h[i+16>>3]=t;h[i+24>>3]=v;h[i+32>>3]=t;v=-v;h[i+40>>3]=v;h[i+48>>3]=u;h[i+56>>3]=v;p=21;}while(0);if((p|0)==21){c[b+36>>2]=i;g=c[q>>2]|0;c[b+32>>2]=g;uu(i,g,b,b+16|0);if((g|0)>(c[46914]|0)){c[46914]=g;g=0;}else g=0;}l=r;return g|0}function ru(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;do if((b|0)==4){c=+h[a+8>>3];b=a+16|0;d=+h[a+24>>3];if(c==d){if(!(+h[a+40>>3]==+h[a+56>>3])){b=0;break}if(!(+h[a>>3]==+h[a+48>>3])){b=0;break}b=+h[b>>3]==+h[a+32>>3];break}if((+h[a>>3]==+h[b>>3]?+h[a+32>>3]==+h[a+48>>3]:0)?c==+h[a+56>>3]:0)b=d==+h[a+40>>3];else b=0;}else b=0;while(0);return b&1|0}function su(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0.0,i=0,j=0,k=0.0,l=0;f=QA(a,102705)|0;if(!f)f=0;else f=q5(f)|0;i=(f|0)<3?20:f;j=KK(i<<4)|0;a=a+16|0;g=1.0/+(i|0);f=0;while(1){if((f|0)>=(i|0))break;l=c[a>>2]|0;k=g*+(f|0)*6.283185307179586;h[j+(f<<4)>>3]=(+h[l+32>>3]*.5+d)*+E(+k);h[j+(f<<4)+8>>3]=(+h[l+40>>3]*.5+e)*+F(+k);f=f+1|0;}c[b>>2]=i;return j|0}function tu(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=+e;h[a>>3]=+(b|0)*.013888888888888888+d;h[a+8>>3]=+(c|0)*.013888888888888888+e;return}function uu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0.0;j=+h[a>>3];i=+h[a+8>>3];e=1;f=i;g=j;while(1){if((e|0)>=(b|0))break;k=a+16|0;l=+h[k>>3];m=+h[a+24>>3];e=e+1|0;f=m>f?m:f;g=l>g?l:g;i=m>3]=j;h[c+8>>3]=i;h[d>>3]=g;h[d+8>>3]=f;return}function vu(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0;r=l;l=l+80|0;n=r+64|0;p=r+68|0;i=r+48|0;j=r+32|0;k=r+16|0;m=r;o=d+16|0;g=c[o>>2]|0;a:do if(!(c[g+212>>2]|0))switch(WM(d)|0){case 1:{m=c[(c[o>>2]|0)+12>>2]|0;n=m+8|0;k=c[n>>2]|0;c[p>>2]=k;b:do if((k|0)>2){i=KK(k<<4)|0;j=m+44|0;g=0;while(1){if((g|0)>=(k|0))break b;d=c[j>>2]|0;h[i+(g<<4)>>3]=+h[d+(g<<4)>>3]*.013888888888888888;h[i+(g<<4)+8>>3]=+h[d+(g<<4)+8>>3]*.013888888888888888;g=g+1|0;}}else i=su(d,p,0.0,0.0)|0;while(0);g=c[c[(c[o>>2]|0)+8>>2]>>2]|0;switch(a[g>>0]|0){case 98:{if(!(s2(g,108236)|0))g=1;else q=13;break}case 112:{if((s2(g,105721)|0)==0?(ru(i,c[p>>2]|0)|0)!=0:0)g=1;else q=13;break}default:q=13;}do if((q|0)==13){if((c[n>>2]|0)<3?c[m>>2]|0:0){g=2;break}g=0;}while(0);c[b+40>>2]=g;q=20;break a}case 2:{c[p>>2]=4;q=KK(64)|0;o=c[(c[o>>2]|0)+12>>2]|0;t=+h[o+16>>3];v=+h[o+24>>3];u=+h[o+32>>3];s=+h[o+40>>3];wu(i,t,v);c[q>>2]=c[i>>2];c[q+4>>2]=c[i+4>>2];c[q+8>>2]=c[i+8>>2];c[q+12>>2]=c[i+12>>2];i=q+16|0;wu(j,u,v);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];i=q+32|0;wu(k,u,s);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];i=q+48|0;wu(m,t,s);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[b+40>>2]=1;i=q;q=20;break a}case 3:{c[b+40>>2]=2;i=su(d,p,0.0,0.0)|0;q=20;break a}default:{c[n>>2]=c[c[(c[o>>2]|0)+8>>2]>>2];gA(1,93919,n)|0;g=1;break a}}else {c[p>>2]=4;u=+h[g+32>>3]*.5;v=+h[g+40>>3]*.5;c[b+40>>2]=1;i=KK(64)|0;h[i>>3]=u;h[i+8>>3]=v;t=-u;h[i+16>>3]=t;h[i+24>>3]=v;h[i+32>>3]=t;v=-v;h[i+40>>3]=v;h[i+48>>3]=u;h[i+56>>3]=v;q=20;}while(0);if((q|0)==20){g=c[p>>2]|0;if(e!=1.0|f!=1.0)xu(i,g,e,f);c[b+36>>2]=i;c[b+32>>2]=g;uu(i,g,b,b+16|0);if((g|0)>(c[46914]|0)){c[46914]=g;g=0;}else g=0;}l=r;return g|0}function wu(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b*.013888888888888888;h[a+8>>3]=c*.013888888888888888;return}function xu(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(b|0))break;h[a>>3]=+h[a>>3]*c;f=a+8|0;h[f>>3]=+h[f>>3]*d;a=a+16|0;e=e+1|0;}return}function yu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0;r=l;l=l+128|0;o=r+112|0;n=r+96|0;m=r+80|0;f=r+64|0;p=r+48|0;q=r+32|0;j=r+16|0;k=r;c[n>>2]=c[a>>2];c[n+4>>2]=c[a+4>>2];c[n+8>>2]=c[a+8>>2];c[n+12>>2]=c[a+12>>2];c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];ws(p,n,o);g=b+16|0;c[n>>2]=c[a>>2];c[n+4>>2]=c[a+4>>2];c[n+8>>2]=c[a+8>>2];c[n+12>>2]=c[a+12>>2];c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];ws(q,n,o);c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];ws(j,n,o);i=e+16|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[o>>2]=c[i>>2];c[o+4>>2]=c[i+4>>2];c[o+8>>2]=c[i+8>>2];c[o+12>>2]=c[i+12>>2];ws(k,n,o);c[f>>2]=c[p>>2];c[f+4>>2]=c[p+4>>2];c[f+8>>2]=c[p+8>>2];c[f+12>>2]=c[p+12>>2];c[m>>2]=c[q>>2];c[m+4>>2]=c[q+4>>2];c[m+8>>2]=c[q+8>>2];c[m+12>>2]=c[q+12>>2];c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];do if(zu(f,m,n,o)|0){f=c[b+40>>2]|0;if(f&1|0?c[e+40>>2]&1|0:0){f=1;break}if(f&2|0?c[e+40>>2]&2|0:0){s=+h[g>>3]-+h[b>>3]+ +h[i>>3]-+h[e>>3];t=+h[a>>3]-+h[d>>3];u=+h[a+8>>3]-+h[d+8>>3];f=!(u*u+t*t>s*s*.25);break}f=c[46915]|0;if(!f){c[46915]=KK(c[46914]<<4)|0;i=KK(c[46914]<<4)|0;c[46916]=i;f=c[46915]|0;}else i=c[46916]|0;v=c[b+36>>2]|0;b=b+32|0;g=c[b>>2]|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];Au(v,g,o,f);a=c[e+36>>2]|0;g=e+32|0;e=c[g>>2]|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];Au(a,e,o,i);if(!(Bu(f,i,c[b>>2]|0,c[g>>2]|0)|0)){f=c[46915]|0;c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];if(Cu(m,n,o)|0?(k=c[46916]|0,v=c[g>>2]|0,c[o>>2]=c[f>>2],c[o+4>>2]=c[f+4>>2],c[o+8>>2]=c[f+8>>2],c[o+12>>2]=c[f+12>>2],Du(k,v,o)|0):0){f=1;break}f=c[46916]|0;c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];c[o>>2]=c[q>>2];c[o+4>>2]=c[q+4>>2];c[o+8>>2]=c[q+8>>2];c[o+12>>2]=c[q+12>>2];if(!(Cu(m,n,o)|0))f=0;else {q=c[46915]|0;v=c[b>>2]|0;c[o>>2]=c[f>>2];c[o+4>>2]=c[f+4>>2];c[o+8>>2]=c[f+8>>2];c[o+12>>2]=c[f+12>>2];f=(Du(q,v,o)|0)!=0;}}else f=1;}else f=0;while(0);l=r;return f&1|0}function zu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((+h[a>>3]<=+h[d>>3]?+h[c>>3]<=+h[b>>3]:0)?+h[a+8>>3]<=+h[d+8>>3]:0)a=+h[c+8>>3]<=+h[b+8>>3]&1;else a=0;return a|0}function Au(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;f=c+8|0;e=0;while(1){if((e|0)>=(b|0))break;h[d>>3]=+h[c>>3]+ +h[a>>3];h[d+8>>3]=+h[f>>3]+ +h[a+8>>3];e=e+1|0;a=a+16|0;d=d+16|0;}return}function Bu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;A=l;l=l+112|0;s=A+96|0;r=A+80|0;q=A+64|0;p=A+48|0;u=A+32|0;v=A+16|0;w=A;x=d+-1|0;y=e+-1|0;z=d<<1;t=e<<1;f=0;g=0;h=0;i=0;while(1){B=a+(f<<4)|0;C=a+(((x+f|0)%(d|0)|0)<<4)|0;c[r>>2]=c[B>>2];c[r+4>>2]=c[B+4>>2];c[r+8>>2]=c[B+8>>2];c[r+12>>2]=c[B+12>>2];c[s>>2]=c[C>>2];c[s+4>>2]=c[C+4>>2];c[s+8>>2]=c[C+8>>2];c[s+12>>2]=c[C+12>>2];vs(u,r,s);o=b+(g<<4)|0;n=b+(((y+g|0)%(e|0)|0)<<4)|0;c[r>>2]=c[o>>2];c[r+4>>2]=c[o+4>>2];c[r+8>>2]=c[o+8>>2];c[r+12>>2]=c[o+12>>2];c[s>>2]=c[n>>2];c[s+4>>2]=c[n+4>>2];c[s+8>>2]=c[n+8>>2];c[s+12>>2]=c[n+12>>2];vs(v,r,s);c[q>>2]=c[46540];c[q+4>>2]=c[46541];c[q+8>>2]=c[46542];c[q+12>>2]=c[46543];c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];c[s>>2]=c[v>>2];c[s+4>>2]=c[v+4>>2];c[s+8>>2]=c[v+8>>2];c[s+12>>2]=c[v+12>>2];j=+xs(q,r,s);c[q>>2]=c[C>>2];c[q+4>>2]=c[C+4>>2];c[q+8>>2]=c[C+8>>2];c[q+12>>2]=c[C+12>>2];c[r>>2]=c[B>>2];c[r+4>>2]=c[B+4>>2];c[r+8>>2]=c[B+8>>2];c[r+12>>2]=c[B+12>>2];c[s>>2]=c[o>>2];c[s+4>>2]=c[o+4>>2];c[s+8>>2]=c[o+8>>2];c[s+12>>2]=c[o+12>>2];k=ys(q,r,s)|0;c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];c[r>>2]=c[o>>2];c[r+4>>2]=c[o+4>>2];c[r+8>>2]=c[o+8>>2];c[r+12>>2]=c[o+12>>2];c[s>>2]=c[B>>2];c[s+4>>2]=c[B+4>>2];c[s+8>>2]=c[B+8>>2];c[s+12>>2]=c[B+12>>2];m=ys(q,r,s)|0;c[p>>2]=c[C>>2];c[p+4>>2]=c[C+4>>2];c[p+8>>2]=c[C+8>>2];c[p+12>>2]=c[C+12>>2];c[q>>2]=c[B>>2];c[q+4>>2]=c[B+4>>2];c[q+8>>2]=c[B+8>>2];c[q+12>>2]=c[B+12>>2];c[r>>2]=c[n>>2];c[r+4>>2]=c[n+4>>2];c[r+8>>2]=c[n+8>>2];c[r+12>>2]=c[n+12>>2];c[s>>2]=c[o>>2];c[s+4>>2]=c[o+4>>2];c[s+8>>2]=c[o+8>>2];c[s+12>>2]=c[o+12>>2];if(zs(p,q,r,s,w)|0){f=1;break}n=(k|0)==0;o=(m|0)==0;do if(j!=0.0|(m|k|0)!=0)if(!(j>=0.0))if(o){f=(f+1|0)%(d|0)|0;h=h+1|0;break}else {g=(g+1|0)%(e|0)|0;i=i+1|0;break}else if(n){g=(g+1|0)%(e|0)|0;i=i+1|0;break}else {f=(f+1|0)%(d|0)|0;h=h+1|0;break}else {f=(f+1|0)%(d|0)|0;h=h+1|0;}while(0);if(!((i|0)<(t|0)&((h|0)<(z|0)&((i|0)<(e|0)|(h|0)<(d|0))))){f=0;break}}l=A;return f|0}function Cu(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;e=+h[a>>3];if((e<=+h[c>>3]?e>=+h[b>>3]:0)?(d=+h[a+8>>3],d<=+h[c+8>>3]):0)a=d>=+h[b+8>>3]&1;else a=0;return a|0}function Du(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,l=0;e=c[46917]|0;if(!e){e=KK(c[46914]<<4)|0;c[46917]=e;}i=d+8|0;g=0;while(1){if((g|0)>=(b|0))break;h[e+(g<<4)>>3]=+h[a+(g<<4)>>3]-+h[d>>3];h[e+(g<<4)+8>>3]=+h[a+(g<<4)+8>>3]-+h[i>>3];g=g+1|0;}d=b+-1|0;f=0.0;a=0;a:while(1){if((a|0)>=(b|0)){l=19;break}g=(d+a|0)%(b|0)|0;j=+h[e+(a<<4)+8>>3];i=j==0.0;if(i?+h[e+(g<<4)+8>>3]==0.0:0){if(+h[e+(g<<4)>>3]*+h[e+(a<<4)>>3]<0.0){e=1;break}}else l=11;do if((l|0)==11){l=0;k=+h[e+(g<<4)+8>>3];if(!(j>=0.0)|!(k<=0.0)?!(k>=0.0)|!(j<=0.0):0)break;j=(k*+h[e+(a<<4)>>3]-j*+h[e+(g<<4)>>3])/(k-j);if(j==0.0){e=1;break a}if(j>0.0)if(k==0.0|i){f=f+.5;break}else {f=f+1.0;break}}while(0);a=a+1|0;}if((l|0)==19)e=((~~f|0)%2|0|0)==1&1;return e|0}function Eu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=KK(b<<2)|0;i=O(b,b)|0;d=KK(i<<2)|0;c[j>>2]=d;$t(i,0.0,d);d=1;while(1){if((d|0)>=(b|0)){d=0;g=0;i=b;break}c[j+(d<<2)>>2]=(c[j>>2]|0)+((O(d,b)|0)<<2);d=d+1|0;}while(1){if((g|0)>=(b|0))break;h=j+(g<<2)|0;e=g;f=d;while(1){if((e|0)==(b|0))break;k=c[a+(f<<2)>>2]|0;c[(c[h>>2]|0)+(e<<2)>>2]=k;c[(c[j+(e<<2)>>2]|0)+(g<<2)>>2]=k;e=e+1|0;f=f+1|0;}d=d+i|0;g=g+1|0;i=i+-1|0;}return j|0}function Fu(a,b,d,e,f,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=+j;var k=0.0,l=0.0,m=0.0,n=0,o=0,p=0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0;M=c[d+(f<<2)>>2]|0;C=c[a+4>>2]|0;D=c[a>>2]|0;E=c[a+48>>2]|0;F=c[a+52>>2]|0;G=c[a+56>>2]|0;a:do if((h|0)<1)d=0;else {Hu(M,C,E,F,G,j);H=c[a+28>>2]|0;I=c[a+32>>2]|0;J=c[a+36>>2]|0;K=c[a+12>>2]|0;L=c[a+16>>2]|0;f=0;e=0;d=-1;while(1){if((f|0)>=(C|0))break;if((f|0)>=(e|0)){d=d+1|0;if((d|0)==(G|0)){e=C;d=G;}else e=c[F+(d<<2)>>2]|0;}c[L+(c[E+(f<<2)>>2]<<2)>>2]=d;f=f+1|0;}z=c[a+40>>2]|0;A=I+(C+-1<<2)|0;d=0;e=0;while(1){if(e<<24>>24==0&(d|0)<(h|0)){k=-1.0e9;f=0;e=1;}else break a;b:while(1){x=f;while(1){if((x|0)>=(C|0))break b;f=c[E+(x<<2)>>2]|0;y=+g[M+(f<<2)>>2];l=y;w=x;m=0.0;while(1){g[z+(f<<2)>>2]=m;f=w+1|0;if((f|0)>=(C|0)){v=0;break}l=(c[L+(f<<2)>>2]|0)>(c[L+(w<<2)>>2]|0)?l+j:l;a=c[E+(f<<2)>>2]|0;m=+g[M+(a<<2)>>2];if(+B(+(m-l))>1.0e-09){v=1;break}w=f;m=m-y;f=a;}n=x;while(1){if((n|0)>(w|0)){a=0;o=x;break}o=c[E+(n<<2)>>2]|0;p=c[D+(o<<2)>>2]|0;a=0;l=-+g[b+(o<<2)>>2];while(1){if((a|0)>=(C|0))break;if((a|0)!=(o|0))l=+g[M+(a<<2)>>2]*+g[p+(a<<2)>>2]+l;a=a+1|0;}g[H+(o<<2)>>2]=l/-+g[p+(o<<2)>>2]-+g[z+(o<<2)>>2];n=n+1|0;}c:while(1){if((o|0)>(w|0)){m=0.0;q=0.0;r=0;break}n=c[L+(c[E+(o<<2)>>2]<<2)>>2]|0;if((n|0)==(G|0))r=f;else {r=c[F+(n<<2)>>2]|0;r=(f|0)<(r|0)?f:r;}p=o;while(1){if((p|0)>=(r|0)){p=o;break}n=c[E+(p<<2)>>2]|0;if(+g[H+(n<<2)>>2]>2]=n;a=a+1|0;}p=p+1|0;}while(1){if((p|0)>=(r|0))break;n=c[E+(p<<2)>>2]|0;if(+g[H+(n<<2)>>2]==y){c[K+(a<<2)>>2]=n;a=a+1|0;}p=p+1|0;}while(1){if((o|0)>=(r|0)){o=r;continue c}n=c[E+(o<<2)>>2]|0;if(+g[H+(n<<2)>>2]>y){c[K+(a<<2)>>2]=n;a=a+1|0;}o=o+1|0;}}while(1){if((r|0)>=(a|0))break;o=c[K+(r<<2)>>2]|0;p=c[D+(o<<2)>>2]|0;l=0.0;n=0;while(1){if((n|0)==(r|0))break;l=l-+g[p+(c[K+(n<<2)>>2]<<2)>>2];n=n+1|0;}N=l*2.0;u=p+(o<<2)|0;s=+g[u>>2];l=N+m;s=(N*y+m*q-+g[H+(o<<2)>>2]*s)/(l-s);g[I+(r<<2)>>2]=s;m=l-+g[u>>2];q=s;r=r+1|0;}p=(a|0)==(C|0);if(p)g[A>>2]=y;u=a+-1|0;m=0.0;q=0.0;o=u;while(1){if((o|0)<=-1)break;r=c[K+(o<<2)>>2]|0;t=c[D+(r<<2)>>2]|0;l=0.0;n=o;while(1){n=n+1|0;if((n|0)>=(a|0))break;l=l-+g[t+(c[K+(n<<2)>>2]<<2)>>2];}l=l*2.0;t=t+(r<<2)|0;N=+g[t>>2];s=l+m;N=(l*y+m*q-+g[H+(r<<2)>>2]*N)/(s-N);g[J+(o<<2)>>2]=N;m=s-+g[t>>2];q=N;o=o+-1|0;}if(p){g[J>>2]=y;s=0.0;n=-1;p=0;}else {s=0.0;n=-1;p=0;}while(1){if((a|0)<=(p|0))break;q=+g[J+(p<<2)>>2];if((p|0)>0)l=+g[I+(p+-1<<2)>>2];else l=q;do if(qy;if(qs;s=t?N:s;n=t?p:n;p=p+1|0;}if((n|0)>-1)break;if(v?(c[L+(c[E+(f<<2)>>2]<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0):0){k=+g[M+(c[K+(u<<2)>>2]<<2)>>2]+j;x=f;continue}k=+g[M+(c[K+(u<<2)>>2]<<2)>>2];x=f;}m=+g[J+(n<<2)>>2];if(!n)q=m;else q=+g[I+(n+-1<<2)>>2];if(v){t=c[E+(f<<2)>>2]|0;l=+g[M+(t<<2)>>2];l=((c[L+(t<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0)?l-j:l)-+g[z+(c[K+(u<<2)>>2]<<2)>>2];}else l=1.0e9;l=mk?q:k;do if(ly;if(l=(n|0))break;t=c[K+(o<<2)>>2]|0;g[M+(t<<2)>>2]=+g[z+(t<<2)>>2]+l;o=o+1|0;}while(1){if((n|0)>=(a|0))break;t=c[K+(n<<2)>>2]|0;g[M+(t<<2)>>2]=+g[z+(t<<2)>>2]+m;n=n+1|0;}if(v?(c[L+(c[E+(f<<2)>>2]<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0):0)k=+g[M+(c[K+(u<<2)>>2]<<2)>>2]+j;else k=+g[M+(c[K+(u<<2)>>2]<<2)>>2];a=x;while(1){if((a|0)>(w|0))break;c[E+(a<<2)>>2]=c[K+(a-x<<2)>>2];a=a+1|0;}if(e<<24>>24!=0?+B(+(l-y))<.01:0)e=+B(+(m-y))<.01;else e=0;e=e&1;}St(C,M);Gu(M,E,F,G,i);d=d+1|0;}}while(0);return d|0}function Gu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=0;while(1){if((g|0)>=(e|0))break;c[f+(g<<2)>>2]=c[a+(c[b+((c[d+(g<<2)>>2]|0)+-1<<2)>>2]<<2)>>2];g=g+1|0;}return}function Hu(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;var i=0.0,j=0,k=0,l=0,m=0;i=-1.0e9;k=0;j=-1;m=0;while(1){if((m|0)>=(b|0))break;if((m|0)<(k|0))l=k;else {j=j+1|0;if((j|0)==(f|0))k=b;else k=c[e+(j<<2)>>2]|0;if((m|0)>0)i=+g[a+(c[d+(m+-1<<2)>>2]<<2)>>2]+h;else i=-1.0e9;gt(a,d,m,k+-1|0);l=k;}k=a+(c[d+(m<<2)>>2]<<2)|0;if(+g[k>>2]>2]=i;k=l;m=m+1|0;}return}function Iu(a){a=a|0;U1(c[c[a>>2]>>2]|0);U1(c[a>>2]|0);U1(c[a+8>>2]|0);U1(c[a+28>>2]|0);U1(c[a+32>>2]|0);U1(c[a+36>>2]|0);U1(c[a+40>>2]|0);U1(c[a+12>>2]|0);U1(c[a+16>>2]|0);U1(c[a+20>>2]|0);U1(c[a+24>>2]|0);U1(a);return}function Ju(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;k=KK(60)|0;c[k>>2]=0;l=k+4|0;c[l>>2]=b;c[k+48>>2]=d;c[k+52>>2]=e;c[k+56>>2]=f;c[k>>2]=Eu(a,b)|0;i=b<<2;j=KK(i)|0;c[k+8>>2]=j;h=0;b=0;a=-1;while(1){if((h|0)>=(c[l>>2]|0))break;g=a+1|0;if((h|0)>=(b|0)){b=c[((g|0)==(f|0)?l:e+(g<<2)|0)>>2]|0;a=g;}c[j+(c[d+(h<<2)>>2]<<2)>>2]=a;h=h+1|0;}c[k+28>>2]=KK(i)|0;c[k+32>>2]=KK(i)|0;c[k+36>>2]=KK(i)|0;c[k+40>>2]=KK(i)|0;c[k+12>>2]=KK(i)|0;c[k+16>>2]=KK(i)|0;c[k+20>>2]=KK(i)|0;c[k+24>>2]=KK(i)|0;return k|0}function Ku(){fu(187676,24);c[46922]=0;return}function Lu(){return hu(187676)|0}function Mu(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(+C(+(d*d+c*c)))}function Nu(a){a=a|0;var b=0;b=c[46922]|0;c[a+16>>2]=b;c[46922]=b+1;return}function Ou(a){a=a|0;var b=0,d=0;d=a+20|0;b=(c[d>>2]|0)+-1|0;c[d>>2]=b;if(!b)iu(a,187676);return}function Pu(a){a=a|0;a=a+20|0;c[a>>2]=(c[a>>2]|0)+1;return}function Qu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var i=0.0,j=0,k=0,m=0,n=0.0,o=0,p=0.0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+16|0;o=x;c[o>>2]=e;q=b<<2;v=KK(q)|0;m=b<<3;w=KK(m)|0;u=$s(a,b)|0;a=0;while(1){if((a|0)>=(b|0))break;k=u+(a<<2)|0;j=0;while(1){if((j|0)==(b|0))break;s=(c[k>>2]|0)+(j<<2)|0;c[s>>2]=c[s>>2]<<8;j=j+1|0;}a=a+1|0;}if(!d)qa(93952,93960,283,93974);s=KK(m)|0;a=0;while(1){if((a|0)>=(b|0))break;h[s+(a<<3)>>3]=+h[d+(a<<3)>>3];a=a+1|0;}Ru(s,b);i=0.0;n=0.0;m=1;while(1){if((m|0)>=(b|0))break;j=u+(m<<2)|0;k=d+(m<<3)|0;a=0;while(1){if((a|0)==(m|0))break;y=c[(c[j>>2]|0)+(a<<2)>>2]|0;r=+h[k>>3]-+h[d+(a<<3)>>3];i=r*r*(1.0/+(O(y,y)|0))+i;n=+B(+r)*(1.0/+(y|0))+n;a=a+1|0;}m=m+1|0;}r=n/i;a=0;while(1){if((a|0)>=(b|0))break;y=d+(a<<3)|0;h[y>>3]=+h[y>>3]*r;a=a+1|0;}Su(b,o,f,d,u);k=KK(O(q,b)|0)|0;j=0;while(1){if((j|0)>=(b|0)){k=1;break}m=k+((O(j,b)|0)<<2)|0;c[v+(j<<2)>>2]=m;o=u+(j<<2)|0;i=0.0;a=0;while(1){if((a|0)==(b|0))break;if((a|0)!=(j|0)){p=+(c[(c[o>>2]|0)+(a<<2)>>2]|0);p=-1.0/(p*p);g[m+(a<<2)>>2]=p;i=i-p;}a=a+1|0;}g[m+(j<<2)>>2]=i;j=j+1|0;}while(1){if((k|0)>=(b|0)){j=0;break}i=+h[d+(k<<3)>>3];j=u+(k<<2)|0;a=0;while(1){if((a|0)==(k|0))break;y=(c[j>>2]|0)+(a<<2)|0;n=+(c[y>>2]|0);p=i-+h[d+(a<<3)>>3];p=n*n-p*p;q=~~+C(+p);q=p>0.0?q:0;c[(c[u+(a<<2)>>2]|0)+(k<<2)>>2]=q;c[y>>2]=q;a=a+1|0;}k=k+1|0;}while(1){if((j|0)>=(b|0)){q=0;a=0;break}n=+h[e+(j<<3)>>3];m=w+(j<<3)|0;h[m>>3]=0.0;o=u+(j<<2)|0;k=v+(j<<2)|0;a=0;i=0.0;while(1){if((a|0)==(b|0))break;if((a|0)!=(j|0)){p=+g[(c[k>>2]|0)+(a<<2)>>2]*+(c[(c[o>>2]|0)+(a<<2)>>2]|0);i=i+(n>=+h[e+(a<<3)>>3]?-p:p);h[m>>3]=i;}a=a+1|0;}j=j+1|0;}while(1){if(!(a<<24>>24==0&(q|0)<200)){t=42;break}if((zr(v,e,w,b,f,b,1)|0)<0){a=1;break}else {a=1;o=0;}while(1){if((o|0)>=(b|0))break;p=+h[e+(o<<3)>>3];k=u+(o<<2)|0;m=v+(o<<2)|0;i=0.0;j=0;while(1){if((j|0)==(b|0))break;do if((j|0)!=(o|0)){n=+g[(c[m>>2]|0)+(j<<2)>>2]*+(c[(c[k>>2]|0)+(j<<2)>>2]|0);if(!(p>=+h[e+(j<<3)>>3])){i=i+n;break}else {i=i+-n;break}}while(0);j=j+1|0;}j=w+(o<<3)|0;p=+h[j>>3];if(i!=p?+B(+(1.0-i/p))>1.0e-05:0){h[j>>3]=i;a=0;}o=o+1|0;}q=q+1|0;}a:do if((t|0)==42){i=1.0/r;a=0;while(1){if((a|0)>=(b|0)){a=0;break a}y=d+(a<<3)|0;h[y>>3]=+h[y>>3]*i;y=e+(a<<3)|0;h[y>>3]=+h[y>>3]*i;a=a+1|0;}}while(0);U1(c[u>>2]|0);U1(u);U1(c[v>>2]|0);U1(v);U1(s);U1(w);l=x;return a|0}function Ru(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0;c=0;d=0.0;while(1){if((c|0)>=(b|0))break;e=+h[a+(c<<3)>>3]+d;c=c+1|0;d=e;}d=d/+(b|0);c=0;while(1){if((c|0)>=(b|0))break;f=a+(c<<3)|0;h[f>>3]=+h[f>>3]-d;c=c+1|0;}f=b+-1|0;Bt(a,0,f,1.0/+At(a,0,f),a);return}function Su(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0;k=Tu(f,a)|0;l=KK(8)|0;if(!e){f=0;j=0;}else {g=KK(a<<3)|0;f=0;while(1){if((f|0)>=(a|0))break;h[g+(f<<3)>>3]=+h[e+(f<<3)>>3];f=f+1|0;}Ru(g,a);f=g;j=g;}Uu(k,a,b,l,f,d);e=0;while(1){if((e|0)==1)break;g=l+(e<<3)|0;i=b+(e<<2)|0;f=0;while(1){if((f|0)>=(a|0))break;d=+C(+(+B(+(+h[g>>3]))));m=(c[i>>2]|0)+(f<<3)|0;h[m>>3]=+h[m>>3]*d;f=f+1|0;}e=e+1|0;}U1(c[k>>2]|0);U1(k);U1(l);U1(j);return}function Tu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+16|0;f=o;n=b<<2;e=KK(O(n,b)|0)|0;n=KK(n)|0;d=0;while(1){if((d|0)>=(b|0))break;c[n+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}m=Wu(a,b,f)|0;h=+g[f>>2];e=0;k=1;while(1){if((e|0)>=(b|0))break;f=a+(e<<2)|0;i=m+(e<<2)|0;j=n+(e<<2)|0;d=0;while(1){if((d|0)==(k|0))break;p=+(c[(c[f>>2]|0)+(d<<2)>>2]|0);p=+g[m+(d<<2)>>2]+ +g[i>>2]-p*p-h;g[(c[j>>2]|0)+(d<<2)>>2]=p;g[(c[n+(d<<2)>>2]|0)+(e<<2)>>2]=p;d=d+1|0;}e=e+1|0;k=k+1|0;}U1(m);l=o;return n|0}function Uu(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0;r=b<<3;q=KK(r)|0;r=KK(r)|0;n=1.0-g;o=(b|0)<1?b:1;p=b+-1|0;k=(f|0)==0;j=0;a:while(1){if((j|0)>=(o|0))break;l=c[d+(j<<2)>>2]|0;do{i=0;while(1){if((i|0)==(b|0))break;h[l+(i<<3)>>3]=+((x5()|0)%100|0|0);i=i+1|0;}if(k)i=0;else {zt(l,0,p,-+yt(f,0,p,l),f);i=0;}while(1){if((i|0)==(j|0))break;s=d+(i<<2)|0;m=-+yt(c[s>>2]|0,0,p,l);zt(l,0,p,m,c[s>>2]|0);i=i+1|0;}g=+At(l,0,p);}while(g<1.0e-10);Bt(l,0,p,1.0/g,l);do{Ct(r,0,p,l);Vu(a,b,b,l,q,f);Ct(l,0,p,q);i=0;while(1){if((i|0)==(j|0))break;s=d+(i<<2)|0;m=-+yt(c[s>>2]|0,0,p,l);zt(l,0,p,m,c[s>>2]|0);i=i+1|0;}g=+At(l,0,p);if(g<1.0e-10)break a;Bt(l,0,p,1.0/g,l);m=+yt(l,0,p,r);}while(+B(+m)>3]=m*g;j=j+1|0;}while(1){if((j|0)>=(o|0))break;k=c[d+(j<<2)>>2]|0;i=0;while(1){if((i|0)>=(b|0)){i=0;break}h[k+(i<<3)>>3]=+((x5()|0)%100|0|0);i=i+1|0;}while(1){if((i|0)>=(j|0))break;s=d+(i<<2)|0;n=-+yt(c[s>>2]|0,0,p,k);zt(k,0,p,n,c[s>>2]|0);i=i+1|0;}Bt(k,0,p,1.0/+At(k,0,p),k);h[e+(j<<3)>>3]=0.0;j=j+1|0;}l=o+-1|0;j=0;while(1){if((j|0)>=(l|0))break;a=e+(j<<3)|0;f=j+1|0;g=+h[a>>3];i=j;k=f;while(1){if((k|0)>=(o|0))break;n=+h[e+(k<<3)>>3];s=g>2]|0);s=d+(i<<2)|0;Ct(c[b>>2]|0,0,p,c[s>>2]|0);Ct(c[s>>2]|0,0,p,q);h[e+(i<<3)>>3]=+h[a>>3];h[a>>3]=g;j=f;}U1(q);U1(r);return}function Vu(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0.0,l=0,m=0;j=0;while(1){if((j|0)>=(b|0))break;m=a+(j<<2)|0;k=0.0;l=0;while(1){if((l|0)>=(d|0))break;k=+h[e+(l<<3)>>3]*+g[(c[m>>2]|0)+(l<<2)>>2]+k;l=l+1|0;}h[f+(j<<3)>>3]=k;j=j+1|0;}j=b+-1|0;if(i|0)zt(f,0,j,-+yt(f,0,j,i),i);return}function Wu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0,j=0,k=0.0,l=0,m=0.0;j=KK(b<<2)|0;k=1.0/+(b|0);e=0.0;i=0;while(1){if((i|0)>=(b|0))break;l=a+(i<<2)|0;f=0.0;h=0;while(1){if((h|0)==(b|0))break;m=+(c[(c[l>>2]|0)+(h<<2)>>2]|0);m=m*m;f=m+f;h=h+1|0;e=m+e;}g[j+(i<<2)>>2]=k*f;i=i+1|0;}g[d>>2]=e/+(O(b,b)|0);return j|0}function Xu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0;q=O(d,d)|0;r=KK(q<<3)|0;s=KK(d<<3)|0;e=0;while(1){if((e|0)>=(d|0))break;h[s+(e<<3)>>3]=+h[c+(e<<3)>>3];e=e+1|0;}e=0;while(1){if((e|0)>=(q|0))break;h[r+(e<<3)>>3]=+h[a+(e<<3)>>3];e=e+1|0;}p=d+-1|0;g=0;o=0;a:while(1){if((o|0)<(p|0)){f=0.0;e=o;}else {l=21;break}while(1){if((e|0)>=(d|0))break;t=+B(+(+h[a+((O(e,d)|0)+o<<3)>>3]));m=t=(d|0))break;l=a+(e+i<<3)|0;t=+h[l>>3];m=a+(e+n<<3)|0;h[l>>3]=+h[m>>3];h[m>>3]=t;e=e+1|0;}m=c+(g<<3)|0;t=+h[m>>3];j=c+(o<<3)|0;h[m>>3]=+h[j>>3];h[j>>3]=t;m=o+1|0;k=a+(n+o<<3)|0;e=m;while(1){if((e|0)>=(d|0)){o=m;continue a}l=O(e,d)|0;f=+h[a+(l+o<<3)>>3]/+h[k>>3];i=c+(e<<3)|0;h[i>>3]=+h[i>>3]-+h[j>>3]*f;i=0;while(1){if((i|0)>=(d|0))break;u=a+(i+l<<3)|0;h[u>>3]=+h[u>>3]-+h[a+(i+n<<3)>>3]*f;i=i+1|0;}e=e+1|0;}}if((l|0)==21){f=+h[a+(q+-1<<3)>>3];if(+B(+f)<1.0e-10)l=33;else {h[b+(p<<3)>>3]=+h[c+(p<<3)>>3]/f;e=0;while(1){if((e|0)>=(p|0)){e=0;break}g=d-e|0;i=g+-2|0;f=+h[c+(i<<3)>>3];j=b+(i<<3)|0;h[j>>3]=f;k=O(i,d)|0;g=g+-1|0;while(1){if((g|0)>=(d|0))break;t=f-+h[b+(g<<3)>>3]*+h[a+(g+k<<3)>>3];h[j>>3]=t;g=g+1|0;f=t;}h[j>>3]=f/+h[a+(k+i<<3)>>3];e=e+1|0;}while(1){if((e|0)>=(d|0)){e=0;break}h[c+(e<<3)>>3]=+h[s+(e<<3)>>3];e=e+1|0;}while(1){if((e|0)>=(q|0))break;h[a+(e<<3)>>3]=+h[r+(e<<3)>>3];e=e+1|0;}U1(r);U1(s);}}if((l|0)==33){B6(93989)|0;U1(r);U1(s);}return}function Yu(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;s=l;l=l+16|0;r=s;ms();Ku();Hs();c[46918]=jb[d&3]()|0;Js();q=r+8|0;p=jb[d&3]()|0;e=0.0;f=0.0;a:while(1){n=(p|0)==0;o=p+8|0;while(1){if(!(Ds()|0)){Es(r);e=+h[r>>3];f=+h[q>>3];}if(!n){if(Ds()|0)break;g=+h[o>>3];if(g>3]>2]|0;Nu(j);qs(c[t+8>>2]|0,a[t+16>>0]|0,j);qs(c[v+8>>2]|0,a[v+16>>0]|0,j);Qs(t);Cs(v);Qs(v);v=+h[m+8>>3]>+h[u+8>>3];t=v&1;k=v?u:m;u=ns(k,v?m:u)|0;m=Ks(u,t)|0;Ns(b,m);qs(u,(t^1)&255,j);Ou(j);j=Ls(b,m)|0;if(j|0){Cs(b);As(b,j,+Mu(j,k));}b=Ls(m,i)|0;if(!b)continue;As(m,b,+Mu(b,k));}b=Os(p)|0;k=Rs(b)|0;i=ns(Us(b)|0,p)|0;m=Ks(i,0)|0;Ns(b,m);j=Ls(b,m)|0;if(j|0){Cs(b);As(b,j,+Mu(j,p));}i=Ks(i,1)|0;Ns(m,i);b=Ls(i,k)|0;if(b|0)As(i,b,+Mu(b,p));p=jb[d&3]()|0;}b=c[46860]|0;while(1){b=Rs(b)|0;if((b|0)==(c[46861]|0))break;os(c[b+8>>2]|0);}l=s;return}function Zu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g+8|0;e=g;do if((tB(a)|0)!=1){_u(a);if(!b)b=$u(a)|0;d=av(a,b)|0;if(0);if((d|0)<0){gA(1,94039,f)|0;break}else {bv(a);cv(a,b);dv(a,b);ev(a,d);break}}else {h=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;}while(0);l=g;return b|0}function _u(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=tB(a)|0;d=O(d,d)|0;b=jC(a)|0;while(1){if(!b)break;e=b+16|0;f=c[(c[e>>2]|0)+112>>2]|0;g=f+24|0;c[g>>2]=d;c[g+4>>2]=0;h[f+48>>3]=10.0;f=(mv(a,b)|0)==0;e=c[(c[e>>2]|0)+112>>2]|0;c[e>>2]=f?d:0;c[e+4>>2]=f?0:0;b=kC(a,b)|0;}return}function $u(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=(tB(a)|0)<3;b=jC(a)|0;a:do if(!e){while(1){if(!b)break;e=c[(c[b+16>>2]|0)+112>>2]|0;if((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)lv(a,b,0);b=kC(a,b)|0;}d=0;b=0;e=jC(a)|0;while(1){if(!e)break a;h=c[(c[e+16>>2]|0)+112>>2]|0;g=c[h>>2]|0;h=c[h+4>>2]|0;f=((d|0)<0)<<31>>31;f=h>>>0>f>>>0|(h|0)==(f|0)&g>>>0>d>>>0;d=f?g:d;b=f?e:b;e=kC(a,e)|0;}}while(0);return b|0}function av(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[(c[b+16>>2]|0)+112>>2]|0;f=d+24|0;e=c[f>>2]|0;c[f>>2]=0;c[f+4>>2]=0;c[d+32>>2]=0;iv(a,b);d=jC(a)|0;e=P6(0,e|0,32)|0;f=z;b=0;while(1){if(!d)break;h=(c[(c[d+16>>2]|0)+112>>2]|0)+24|0;g=c[h>>2]|0;h=c[h+4>>2]|0;if((g|0)==(e|0)&(h|0)==(f|0)){b=-1;break}i=((b|0)<0)<<31>>31;b=h>>>0>i>>>0|(h|0)==(i|0)&g>>>0>b>>>0?g:b;d=kC(a,d)|0;}return b|0}function bv(a){a=a|0;var b=0,d=0,e=0,f=0;d=jC(a)|0;while(1){if(!d)break;b=c[(c[d+16>>2]|0)+112>>2]|0;e=b+16|0;a:do if((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)while(1){e=b+8|0;f=e;f=J6(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;c[e>>2]=f;c[e+4>>2]=z;b=c[b+32>>2]|0;if(!b)break a;b=c[(c[b+16>>2]|0)+112>>2]|0;}while(0);d=kC(a,d)|0;}return}function cv(a,b){a=a|0;b=b|0;h[(c[(c[b+16>>2]|0)+112>>2]|0)+40>>3]=6.283185307179586;hv(a,b);return}function dv(a,b){a=a|0;b=b|0;h[(c[(c[b+16>>2]|0)+112>>2]|0)+48>>3]=0.0;gv(a,b);return}function ev(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0;i=l;l=l+16|0;f=i;g=fv(a,b)|0;if(0);d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;e=c[f+112>>2]|0;j=+h[g+(c[e+24>>2]<<3)>>3];e=e+48|0;k=+E(+(+h[e>>3]))*j;f=c[f+132>>2]|0;h[f>>3]=k;h[f+8>>3]=+F(+(+h[e>>3]))*j;d=kC(a,d)|0;}U1(g);l=i;return}function fv(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;m=JK((d<<3)+8|0)|0;b=aP(b,GA(c[b+60>>2]|0,0,101288,0)|0,0)|0;a:do if(!b){f=1.0;e=0.0;b=1;}else {i=0.0;e=0.0;g=1;b:while(1){if((g|0)>(d|0)){f=i;b=g;break a}f=+s5(b,k);if(!(f>0.0)){f=i;b=g;break a}i=f>.02?f:.02;e=i+e;j=g+1|0;h[m+(g<<3)>>3]=e;b=c[k>>2]|0;while(1){g=a[b>>0]|0;if(!(g<<24>>24)){g=j;continue b}if(!(g<<24>>24==58|(S2(g<<24>>24)|0)!=0)){g=j;continue b}b=b+1|0;}}}while(0);while(1){if((b|0)>(d|0))break;i=e+f;h[m+(b<<3)>>3]=i;b=b+1|0;e=i;}l=n;return m|0}function gv(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0.0;d=c[(c[b+16>>2]|0)+112>>2]|0;if(!(c[d+32>>2]|0))e=0.0;else e=+h[d+48>>3]-+h[d+40>>3]*.5;g=aB(a,b)|0;while(1){if(!g)break;d=c[g>>2]&3;f=c[((d|0)==3?g:g+48|0)+40>>2]|0;if((f|0)==(b|0))f=c[((d|0)==2?g:g+-48|0)+40>>2]|0;d=c[(c[f+16>>2]|0)+112>>2]|0;if((c[d+32>>2]|0)==(b|0)?(i=d+48|0,!(+h[i>>3]!=10.0)):0){j=+h[d+40>>3];h[i>>3]=j*.5+e;e=j+e;d=d+16|0;if(!((c[d>>2]|0)==0&(c[d+4>>2]|0)==0))gv(a,f);}g=bB(a,g,b)|0;}return}function hv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0;e=c[(c[b+16>>2]|0)+112>>2]|0;f=e+8|0;g=+h[e+40>>3]/(+((c[f>>2]|0)>>>0)+4294967296.0*+((c[f+4>>2]|0)>>>0));f=aB(a,b)|0;while(1){if(!f)break;e=c[f>>2]&3;d=c[((e|0)==3?f:f+48|0)+40>>2]|0;if((d|0)==(b|0))d=c[((e|0)==2?f:f+-48|0)+40>>2]|0;e=c[(c[d+16>>2]|0)+112>>2]|0;if(((c[e+32>>2]|0)==(b|0)?(i=e+40|0,!(+h[i>>3]!=0.0)):0)?(j=e+8|0,h[i>>3]=g*(+((c[j>>2]|0)>>>0)+4294967296.0*+((c[j+4>>2]|0)>>>0)),e=e+16|0,!((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)):0)hv(a,d);f=bB(a,f,b)|0;}return}function iv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+16|0;n=p;o=GA(b,2,101541,0)|0;c[n+4>>2]=0;c[n>>2]=0;jv(n,d);j=(o|0)==0;a:while(1){k=kv(n)|0;if(!k)break;m=k+16|0;h=c[(c[(c[m>>2]|0)+112>>2]|0)+24>>2]|0;g=aB(b,k)|0;h=J6(0,h|0,0,1)|0;h=P6(h|0,z|0,32)|0;i=z;while(1){if(!g)continue a;if(!((!j?(a[(RA(g,o)|0)>>0]|0)==48:0)?!(s2(RA(g,o)|0,138394)|0):0)){d=c[g>>2]&3;e=c[((d|0)==3?g:g+48|0)+40>>2]|0;if((e|0)==(k|0))e=c[((d|0)==2?g:g+-48|0)+40>>2]|0;d=c[(c[e+16>>2]|0)+112>>2]|0;f=d+24|0;q=f;r=c[q+4>>2]|0;if(i>>>0>>0|((i|0)==(r|0)?h>>>0<(c[q>>2]|0)>>>0:0)){r=f;c[r>>2]=h;c[r+4>>2]=i;c[d+32>>2]=k;r=(c[(c[m>>2]|0)+112>>2]|0)+16|0;q=r;q=J6(c[q>>2]|0,c[q+4>>2]|0,1,0)|0;c[r>>2]=q;c[r+4>>2]=z;jv(n,e);}}g=bB(b,g,k)|0;}}l=p;return}function jv(a,b){a=a|0;b=b|0;var d=0,e=0;d=JK(8)|0;c[d>>2]=b;b=a+4|0;e=c[b>>2]|0;c[((e|0)==0?a:e+4|0)>>2]=d;c[b>>2]=d;return}function kv(a){a=a|0;var b=0,d=0;d=c[a>>2]|0;if(d){b=c[d>>2]|0;c[a>>2]=c[d+4>>2];U1(d);if(!(c[a>>2]|0))c[a+4>>2]=0;}else b=0;return b|0}function lv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=c[c[(c[b+16>>2]|0)+112>>2]>>2]|0;g=aB(a,b)|0;h=J6(0,h|0,0,1)|0;h=P6(h|0,z|0,32)|0;i=z;while(1){if(!g)break;f=c[g>>2]&3;e=c[((f|0)==3?g:g+48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((f|0)==2?g:g+-48|0)+40>>2]|0;if((e|0)!=(d|0)?(j=c[(c[e+16>>2]|0)+112>>2]|0,f=j,k=c[f+4>>2]|0,i>>>0>>0|((i|0)==(k|0)?h>>>0<(c[f>>2]|0)>>>0:0)):0){k=j;c[k>>2]=h;c[k+4>>2]=i;lv(a,e,b);}g=bB(a,g,b)|0;}return}function mv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=0;g=aB(a,b)|0;while(1){if(!g){d=1;break}e=c[g>>2]&3;d=c[((e|0)==3?g:g+48|0)+40>>2]|0;if((d|0)==(b|0))d=c[((e|0)==2?g:g+-48|0)+40>>2]|0;if((d|0)!=(b|0)){if(f)if((f|0)==(d|0))d=f;else {d=0;break}}else d=f;f=d;g=bB(a,g,b)|0;}return d|0}function nv(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0;b=l;l=l+32|0;e=b;d=GA(a,1,94122,0)|0;g=GA(a,0,94122,0)|0;a=ov(a,g,d,GA(a,0,94127,0)|0)|0;d=a+16|0;f=+C(+(+h[a>>3]+.1));zv(e,0.0,0.0,f,f);c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];c[d+16>>2]=c[e+16>>2];c[d+20>>2]=c[e+20>>2];c[d+24>>2]=c[e+24>>2];c[d+28>>2]=c[e+28>>2];pv(a);qv(a);rv(a);l=b;return}function ov(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=JK(72)|0;c[o+60>>2]=0;c[o+56>>2]=a;k=a+16|0;f=0.0;l=0;i=1;j=0;m=0;while(1){g=c[k>>2]|0;if((i|0)>(c[g+180>>2]|0))break;g=ov(c[(c[g+184>>2]|0)+(i<<2)>>2]|0,b,d,e)|0;f=+h[g>>3]+f;if(j|0)c[j+52>>2]=g;l=l+1|0;i=i+1|0;j=g;m=(m|0)==0?g:m;}n=jC(a)|0;g=m;while(1){if(!n)break;i=n+16|0;if(!(c[c[(c[i>>2]|0)+112>>2]>>2]|0)){k=uv(n,d)|0;f=+h[k>>3]+f;if(j|0)c[j+52>>2]=k;c[c[(c[i>>2]|0)+112>>2]>>2]=a;i=l+1|0;j=k;g=(g|0)==0?k:g;}else i=l;n=kC(a,n)|0;l=i;}c[o+64>>2]=l;if(!l)f=+wv(a,b);else {h[o+8>>3]=f;f=+vv(o,e);}h[o>>3]=f;c[o+48>>2]=g;return o|0}function pv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0;p=l;l=l+176|0;f=p+144|0;n=p+64|0;k=p+32|0;i=p;o=c[a+64>>2]|0;a:do if(o|0){m=JK(o<<2)|0;b=a+48|0;e=0;d=b;while(1){d=c[d>>2]|0;if((e|0)>=(o|0))break;c[m+(e<<2)>>2]=d;e=e+1|0;d=d+52|0;}o4(m,o,4,80);j=JK(o<<3)|0;d=0;while(1){if((d|0)>=(o|0))break;h[j+(d<<3)>>3]=+h[c[m+(d<<2)>>2]>>3];d=d+1|0;}g=+h[a+8>>3];if(+h[a>>3]==g){i=a+16|0;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[f+16>>2]=c[i+16>>2];c[f+20>>2]=c[i+20>>2];c[f+24>>2]=c[i+24>>2];c[f+28>>2]=c[i+28>>2];i=xv(o,j,f)|0;}else {q=+h[a+40>>3];r=+h[a+32>>3];h[i>>3]=+h[a+16>>3];h[i+8>>3]=+h[a+24>>3];s=q-r;g=(r+q-+C(+(g*4.0+s*s)))*.5;h[i+16>>3]=r-g;h[i+24>>3]=q-g;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[f+16>>2]=c[i+16>>2];c[f+20>>2]=c[i+20>>2];c[f+24>>2]=c[i+24>>2];c[f+28>>2]=c[i+28>>2];i=xv(o,j,f)|0;}if(0);e=c[15712]|0;d=0;while(1){if((d|0)>=(o|0))break;k=(c[m+(d<<2)>>2]|0)+16|0;f=i+(d<<5)|0;c[k>>2]=c[f>>2];c[k+4>>2]=c[f+4>>2];c[k+8>>2]=c[f+8>>2];c[k+12>>2]=c[f+12>>2];c[k+16>>2]=c[f+16>>2];c[k+20>>2]=c[f+20>>2];c[k+24>>2]=c[f+24>>2];c[k+28>>2]=c[f+28>>2];if(0);d=d+1|0;}U1(m);U1(j);U1(i);d=0;while(1){b=c[b>>2]|0;if((d|0)>=(o|0))break a;if(!(c[b+60>>2]|0))pv(b);b=b+52|0;d=d+1|0;}}while(0);l=p;return}function qv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0;f=l;l=l+48|0;e=f;if(c[a+60>>2]|0){k=+h[a+24>>3];i=+h[a+32>>3];g=+h[a+40>>3];b=c[a+56>>2]|0;d=b+16|0;j=c[d>>2]|0;h[j+16>>3]=+h[a+16>>3];h[j+24>>3]=k;a=c[d>>2]|0;h[a+32>>3]=i*.013888888888888888;h[a+40>>3]=g*.013888888888888888;qQ(b,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1);sv(b);if(0);}else {b=a+48|0;while(1){b=c[b>>2]|0;if(!b)break;qv(b);b=b+52|0;}i=+h[a+32>>3];m=+h[a+40>>3];g=+h[a+16>>3]-i*.5;k=+h[a+24>>3]-m*.5;j=c[(c[a+56>>2]|0)+16>>2]|0;h[j+16>>3]=g;h[j+24>>3]=k;h[j+32>>3]=g+i;h[j+40>>3]=k+m;}l=f;return}function rv(a){a=a|0;var b=0,d=0,e=0;e=c[a+64>>2]|0;b=a+48|0;d=0;while(1){b=c[b>>2]|0;if((d|0)>=(e|0))break;rv(b);b=b+52|0;d=d+1|0;}U1(a);return}function sv(b){b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g;d=g+8|0;e=c[47150]|0;if(e|0?(a[(RA(b,e)|0)>>0]|0)==0:0){h[f>>3]=+h[(c[b+16>>2]|0)+80>>3]*.7;m4(d,94168,f)|0;KA(b,c[47150]|0,d)|0;}sP(b);l=g;return}function tv(a,b){a=a|0;b=b|0;var d=0.0;d=+h[c[a>>2]>>3]-+h[c[b>>2]>>3];return (d<0.0?1:(d>0.0)<<31>>31)|0}function uv(a,b){a=a|0;b=b|0;var d=0;d=JK(72)|0;h[d>>3]=+wv(a,b);c[d+60>>2]=1;c[d+56>>2]=a;return d|0}function vv(a,b){a=a|0;b=b|0;var d=0.0;d=+_O(c[a+56>>2]|0,b,0.0,0.0);if(d==0.0)d=+h[a+8>>3];else {d=+C(+(+h[a+8>>3]))+d*2.0;d=d*d;}return +d}function wv(a,b){a=a|0;b=b|0;var c=0.0;c=+_O(a,b,1.0,0.0);return +(c==0.0?1.0e3:c*1.0e3)}function xv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0;i=l;l=l+32|0;g=i;e=0;f=0.0;while(1){if((e|0)>=(a|0))break;j=+h[b+(e<<3)>>3]+f;e=e+1|0;f=j;}if(f>+h[d+24>>3]*+h[d+16>>3]+.001)e=0;else {e=JK(a<<5)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[g+16>>2]=c[d+16>>2];c[g+20>>2]=c[d+20>>2];c[g+24>>2]=c[d+24>>2];c[g+28>>2]=c[d+28>>2];yv(a,b,e,0,0.0,1.0,0.0,1.0,g);}l=i;return e|0}function yv(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=+i;j=+j;k=k|0;var m=0,n=0.0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0.0;z=l;l=l+112|0;y=z+72|0;u=z+40|0;p=z+32|0;m=z;w=k+16|0;q=+h[w>>3];x=k+24|0;r=+h[x>>3];v=+h[k+16+((!(q>3];do if((a|0)>=1){if(0);if(!e){i=+h[b>>3];B=v*v;v=i/B;B=B/i;c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a,b,d,1,i,i,i,v>B?v:B,y);break}if((a|0)>(e|0)?(t=+h[b+(e<<3)>>3],n=tg?g:t,t=t+i,o=t/v,o=o*o,B=o/s,o=n/o,o=B>o?B:o,o<=j):0){c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a,b,d,e+1|0,n,s,t,o,y);break}q=i/v;if(0);n=+h[w>>3];if(v==n){o=1.0/q;p=k+8|0;n=+h[k>>3]-n*.5;m=0;while(1){if((m|0)>=(e|0))break;h[d+(m<<5)+24>>3]=q;B=+h[b+(m<<3)>>3]*o;h[d+(m<<5)+16>>3]=B;h[d+(m<<5)+8>>3]=(+h[x>>3]-q)*.5+ +h[p>>3];h[d+(m<<5)>>3]=B*.5+n;n=B+n;m=m+1|0;}h[p>>3]=+h[p>>3]-q*.5;m=1;}else {o=1.0/q;n=+h[x>>3]*.5+ +h[k+8>>3];m=0;while(1){if((m|0)>=(e|0))break;h[d+(m<<5)+16>>3]=q;B=+h[b+(m<<3)>>3]*o;h[d+(m<<5)+24>>3]=B;h[d+(m<<5)>>3]=(q-+h[w>>3])*.5+ +h[k>>3];h[d+(m<<5)+8>>3]=n-B*.5;n=n-B;m=m+1|0;}h[k>>3]=+h[k>>3]+q*.5;m=0;}A=k+16+(m<<3)|0;h[A>>3]=+h[A>>3]-q;c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a-e|0,b+(e<<3)|0,d+(e<<5)|0,0,0.0,0.0,0.0,1.0,y);}while(0);l=z;return}function zv(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function Av(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;D=l;l=l+96|0;C=D+48|0;B=D+24|0;A=D+16|0;z=D+8|0;u=D+80|0;v=D;w=a+16|0;x=d+4|0;y=u+4|0;s=jC(a)|0;e=0;f=0;i=0;j=0;while(1){if(!s)break;t=XA(a,s)|0;q=e;r=j;while(1){if(!t)break;e=(b[(c[t+16>>2]|0)+168>>1]|0)==0;do if((s|0)==(c[((c[t>>2]&3|0)==2?t:t+-48|0)+40>>2]|0))if(e){j=q;e=r;}else {if(!f){e=JK(96)|0;c[e+84>>2]=JK(((tB(a)|0)<<5)+11520|0)|0;f=e;}else e=r;Km(f,t,c[(c[w>>2]|0)+248>>2]|0);j=q;}else if(!e){i=Bv(t,d)|0;j=i+8|0;if(lt(c[j>>2]|0,c[i>>2]|0)|0){k=JX(c[j>>2]|0,c[i>>2]|0)|0;if(!k){gA(0,94352,z)|0;j=1;e=r;break}else e=t;while(1){if(!e)break;E=e+16|0;F=(c[E>>2]|0)+144|0;Qm(v,e,k,0,c[j>>2]|0,c[i>>2]|0);H=v;G=c[H+4>>2]|0;c[F>>2]=c[H>>2];c[F+4>>2]=G;Sm(a,e,c[j>>2]|0,c[i>>2]|0,0);e=c[(c[E>>2]|0)+172>>2]|0;}Cv(i);j=q;e=r;break}if(!q){lr(u,a);e=lH(a,8,8)|0;gA(0,94436,A)|0;n=+(e|0);o=+g[d>>2];p=+g[x>>2];if(!(o>=n)&!(p>=n)){m=+g[u>>2];n=+g[y>>2];if(!(!(m<=o)&!(n<=p))){h[C>>3]=m;h[C+8>>3]=n;h[C+16>>3]=o;h[C+24>>3]=p;gA(3,94552,C)|0;}}else {c[B>>2]=e;h[B+8>>3]=o;h[B+16>>3]=p;gA(3,94502,B)|0;}j=1;e=r;}else {j=q;e=r;}}else {j=q;e=r;}while(0);t=ZA(a,t)|0;q=j;r=e;}s=kC(a,s)|0;e=q;j=r;}Dv(i);if(f|0){U1(c[f+84>>2]|0);U1(j);}l=D;return e|0}function Bv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+16|0;m=p+4|0;n=p;e=c[b>>2]&3;f=c[((e|0)==2?b:b+-48|0)+40>>2]|0;e=c[((e|0)==3?b:b+48|0)+40>>2]|0;q=f+16|0;h=c[(c[q>>2]|0)+212>>2]|0;c[m>>2]=h;i=e+16|0;g=c[(c[i>>2]|0)+212>>2]|0;c[n>>2]=g;k=JK(12)|0;b=h;j=g;if(a[(c[q>>2]|0)+118>>0]|0){b=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2]|0;c[m>>2]=b;f=h;h=b;}if(!(a[(c[i>>2]|0)+118>>0]|0))i=j;else {i=c[(c[(c[j+16>>2]|0)+140>>2]|0)+48>>2]|0;c[n>>2]=i;e=g;g=i;}h=c[(c[(c[h+16>>2]|0)+140>>2]|0)+44>>2]|0;g=c[(c[(c[g+16>>2]|0)+140>>2]|0)+44>>2]|0;if((h|0)<=(g|0))if((g|0)>(h|0)){Ev(k,g,e,h,n,d);b=c[n>>2]|0;g=b;e=n;o=11;}else h=i;else {Ev(k,h,f,g,m,d);b=c[m>>2]|0;f=b;g=e;e=m;o=11;}while(1){if((o|0)==11){c[e>>2]=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2];e=g;b=c[m>>2]|0;h=c[n>>2]|0;}if((b|0)==(h|0))break;Fv(k,b,0,f,d);Fv(k,h,e,0,d);c[m>>2]=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2];f=b;g=h;e=n;b=h;o=11;}Fv(k,h,e,f,d);l=p;return k|0}function Cv(a){a=a|0;c[a>>2]=0;return}function Dv(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function Ev(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=f;while(1){h=c[i>>2]|0;if((b|0)<=(e|0))break;Fv(a,h,d,0,g);b=b+-1|0;i=(c[(c[h+16>>2]|0)+140>>2]|0)+48|0;d=h;}c[f>>2]=d;return}function Fv(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=jC(d)|0;while(1){if(!h)break;i=c[h+16>>2]|0;if(!((h|0)==(f|0)|((h|0)==(e|0)?1:(c[i+212>>2]|0)!=(d|0)))?(a[i+118>>0]|0)==0:0)Gv(b,Nm(h,g,0)|0);h=kC(d,h)|0;}i=d+16|0;d=1;while(1){h=c[i>>2]|0;if((d|0)>(c[h+180>>2]|0))break;h=c[(c[h+184>>2]|0)+(d<<2)>>2]|0;if(!((h|0)==(e|0)|(h|0)==(f|0)))Gv(b,Hv(h,g)|0);d=d+1|0;}return}function Gv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+4|0;f=c[e>>2]|0;g=a+8|0;d=c[g>>2]|0;do if((f|0)==(c[a>>2]|0))if(!d){d=KK(400)|0;c[g>>2]=d;c[e>>2]=100;break}else {c[e>>2]=f<<1;d=MK(d,f<<3)|0;c[g>>2]=d;break}while(0);g=c[a>>2]|0;c[a>>2]=g+1;c[d+(g<<2)>>2]=b;return}function Hv(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0.0;m=JK(8)|0;b=c[b+16>>2]|0;e=+h[b+16>>3];l=+h[b+24>>3];f=+h[b+32>>3];k=+h[b+40>>3];c[m+4>>2]=4;b=JK(64)|0;c[m>>2]=b;if(!(a[d+8>>0]|0)){p=+g[d>>2];o=+g[d+4>>2];i=(f+e)*.5*(p+-1.0);n=(k+l)*.5*(o+-1.0);j=e*p-i;i=f*p-i;f=k*o-n;e=l*o-n;}else {i=+g[d>>2];p=+g[d+4>>2];j=e-i;i=f+i;f=k+p;e=l-p;}h[b>>3]=j;h[b+8>>3]=e;h[b+16>>3]=j;h[b+24>>3]=f;h[b+32>>3]=i;h[b+40>>3]=f;h[b+48>>3]=i;h[b+56>>3]=e;return m|0}function Iv(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+160|0;n=o+16|0;j=o+8|0;g=o;k=o+24|0;m=JK(tB(b)|0)|0;h=b+16|0;f=c[c[(c[h>>2]|0)+140>>2]>>2]|0;a:do if(!f){g=0;f=0;}else {p=KB(b)|0;i=c[46923]|0;c[g>>2]=p;c[g+4>>2]=i;m4(k,94612,g)|0;i=ND(b,k,1)|0;TC(i,137483,280,1)|0;g=JK(56)|0;c[(c[i+16>>2]|0)+140>>2]=g;c[g>>2]=f;c[g+4>>2]=c[(c[(c[h>>2]|0)+140>>2]|0)+4>>2];while(1){g=c[f+4>>2]|0;if(!g){g=i;f=1;break a}if(!(a[m+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0))Jv(b,g,i,m);f=f+16|0;}}while(0);h=0;i=jC(b)|0;while(1){if(!i)break;p=c[i+16>>2]|0;if((a[m+(c[p+120>>2]|0)>>0]|0)==0?(a[p+119>>0]|0)==3:0){if(!g){p=KB(b)|0;g=(c[46923]|0)+f|0;c[j>>2]=p;c[j+4>>2]=g;m4(k,94612,j)|0;g=ND(b,k,1)|0;TC(g,137483,280,1)|0;p=JK(56)|0;c[(c[g+16>>2]|0)+140>>2]=p;f=f+1|0;}Jv(b,i,g,m);h=1;}i=kC(b,i)|0;}if(g|0)KG(g)|0;g=jC(b)|0;while(1){if(!g)break;if(!(a[m+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0)){j=KB(b)|0;p=(c[46923]|0)+f|0;c[n>>2]=j;c[n+4>>2]=p;m4(k,94620,n)|0;p=ND(b,k,1)|0;TC(p,137483,280,1)|0;j=JK(56)|0;c[(c[p+16>>2]|0)+140>>2]=j;Jv(b,g,p,m);KG(p)|0;f=f+1|0;}g=kC(b,g)|0;}U1(m);c[46923]=(c[46923]|0)+f;if(d|0)c[d>>2]=f;if(e|0)c[e>>2]=h;i=JK((f<<2)+4|0)|0;h=i;g=OD(b)|0;while(1){if(!g)break;c[h>>2]=g;h=h+4|0;g=PD(g)|0;f=f+-1|0;}if(!f){c[h>>2]=0;l=o;return i|0}else qa(94628,94639,134,94646);return 0}function Jv(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a[f+(c[(c[d+16>>2]|0)+120>>2]|0)>>0]=1;oC(e,d,1)|0;i=aB(b,d)|0;while(1){if(!i)break;h=c[i>>2]&3;g=c[((h|0)==3?i:i+48|0)+40>>2]|0;if((g|0)==(d|0))g=c[((h|0)==2?i:i+-48|0)+40>>2]|0;if(!(a[f+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0))Jv(b,g,e,f);i=bB(b,i,d)|0;}return}function Kv(a){a=a|0;var b=0;b=KK(24)|0;c[46924]=b;c[b>>2]=Vz(18204,c[4581]|0)|0;c[b+16>>2]=0;c[b+12>>2]=0;c[b+4>>2]=Lv(a)|0;return b|0}function Lv(a){a=a|0;var b=0,d=0;b=KK(16)|0;c[b+12>>2]=0;d=KK(a*20|0)|0;c[b>>2]=d;c[b+8>>2]=d+(a*20|0);c[b+4>>2]=d;return b|0}function Mv(a,b,d){a=a|0;b=b|0;d=d|0;d=Ov(c[46924]|0)|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=0;return d|0}function Nv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=(c[b>>2]|0)-(c[d>>2]|0)|0;if(!a)a=(c[b+4>>2]|0)-(c[d+4>>2]|0)|0;return a|0}function Ov(a){a=a|0;var b=0,d=0,e=0,f=0;f=a+8|0;a=c[f>>2]|0;b=c[a+4>>2]|0;if((b|0)==(c[a+8>>2]|0)){d=a+12|0;e=c[d>>2]|0;if(!e){a=Lv(((b-(c[a>>2]|0)|0)/20|0)<<1)|0;c[d>>2]=a;}else a=e;c[f>>2]=a;b=c[a>>2]|0;c[a+4>>2]=b;}c[a+4>>2]=b+20;return b|0}function Pv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+12|0;d=c[f>>2]|0;if((d|0)<(b|0)){e=d<<1;e=(e|0)<(b|0)?b:e;b=a+16|0;d=c[b>>2]|0;if(d|0)U1(d);c[b>>2]=KK(e<<3)|0;c[f>>2]=e;}return}function Qv(a){a=a|0;var b=0;b=c[a>>2]|0;nb[c[b>>2]&63](b,0,64)|0;c[a+20>>2]=c[a+16>>2];b=c[a+4>>2]|0;c[a+8>>2]=b;c[b+4>>2]=c[b>>2];return}function Rv(a){a=a|0;Rz(c[a>>2]|0)|0;Sv(c[a+4>>2]|0);U1(c[a+16>>2]|0);U1(a);return}function Sv(a){a=a|0;var b=0;while(1){if(!a)break;b=c[a+12>>2]|0;U1(c[a>>2]|0);U1(a);a=b;}return}function Tv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g;h=g+12|0;c[h>>2]=b;c[h+4>>2]=d;i=c[a>>2]|0;h=(nb[c[i>>2]&63](i,h,1)|0)+8|0;c[h>>2]=Uv(a,e,c[h>>2]|0)|0;if(0>2);l=g;return}function Uv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+20|0;a=c[e>>2]|0;c[e>>2]=a+8;c[a>>2]=b;c[a+4>>2]=d;return a|0}function Vv(a,b){a=a|0;b=b|0;aA(c[a>>2]|0,b,a)|0;return}function Wv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+32|0;f=e;c[f>>2]=b;c[f+4>>2]=d;d=c[a>>2]|0;d=nb[c[d>>2]&63](d,f,4)|0;l=e;return d|0}function Xv(a){a=a|0;U1(c[a+8>>2]|0);U1(a);return}function Yv(a){a=a|0;return +(+h[a>>3])}function Zv(a){a=a|0;return c[a+8>>2]|0}function _v(a){a=a|0;return ~~+h[a+16>>3]|0}function $v(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;b=c[b>>2]|0;if((b|0)>=(c[d>>2]|0)){b=b+10|0;c[d>>2]=b;c[e>>2]=MK(c[e>>2]|0,O(a<<3,b)|0)|0;c[f>>2]=MK(c[f>>2]|0,c[d>>2]<<3)|0;c[g>>2]=MK(c[g>>2]|0,c[d>>2]<<3)|0;}return}function aw(a,b,d,e,f,g,i,j,k,l,m){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0.0;h[l>>3]=+h[l>>3]+1.0;a:do if(a|0){q=c[a+16>>2]|0;n=c[a+40>>2]|0;if(n|0)do{$v(q,f,g,i,j,k);if((_v(zy(n)|0)|0)!=(e|0)){p=Zv(zy(n)|0)|0;o=0;while(1){if((o|0)>=(q|0))break;h[(c[i>>2]|0)+((O(c[f>>2]|0,q)|0)+o<<3)>>3]=+h[p+(o<<3)>>3];o=o+1|0;}r=+Yv(zy(n)|0);h[(c[j>>2]|0)+(c[f>>2]<<3)>>3]=r;r=+$w(d,p,q);p=c[f>>2]|0;h[(c[k>>2]|0)+(p<<3)>>3]=r;c[f>>2]=p+1;}n=Ay(n)|0;}while((n|0)!=0);p=a+36|0;if(c[p>>2]|0){r=+$w(c[a+20>>2]|0,d,q);if(!(+h[a+24>>3]=(o|0))break a;aw(c[(c[p>>2]|0)+(n<<2)>>2]|0,b,d,e,f,g,i,j,k,l,m);n=n+1|0;}}$v(q,f,g,i,j,k);o=a+32|0;n=0;while(1){if((n|0)>=(q|0))break;h[(c[i>>2]|0)+((O(c[f>>2]|0,q)|0)+n<<3)>>3]=+h[(c[o>>2]|0)+(n<<3)>>3];n=n+1|0;}h[(c[j>>2]|0)+(c[f>>2]<<3)>>3]=+h[a+8>>3];r=+$w(c[o>>2]|0,d,q);j=c[f>>2]|0;h[(c[k>>2]|0)+(j<<3)>>3]=r;c[f>>2]=j+1;}}while(0);return}function bw(a,b,d,e,f,g,i,j,k,l,m){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0;n=c[a+16>>2]|0;h[l>>3]=0.0;c[f>>2]=0;c[m>>2]=0;c[g>>2]=10;if(!(c[i>>2]|0))c[i>>2]=KK(n*80|0)|0;if(!(c[j>>2]|0))c[j>>2]=KK(c[g>>2]<<3)|0;if(!(c[k>>2]|0))c[k>>2]=KK(c[g>>2]<<3)|0;aw(a,b,d,e,f,g,i,j,k,l,m);return}function cw(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=+g;i=i|0;j=j|0;var k=0,l=0,m=0;m=c[a>>2]|0;l=c[a+16>>2]|0;k=0;while(1){if((k|0)==4)break;h[i+(k<<3)>>3]=0.0;k=k+1|0;}c[j>>2]=0;l=O(l,m)|0;k=0;while(1){if((k|0)>=(l|0))break;h[b+(k<<3)>>3]=0.0;k=k+1|0;}dw(a,a,d,b,e,f,g,i);ew(a,b,i);e=1.0/+(m|0);k=0;while(1){if((k|0)==4)break;m=i+(k<<3)|0;h[m>>3]=+h[m>>3]*e;k=k+1|0;}return}function dw(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=+i;j=j|0;var k=0,l=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0;a:do if((a|0)!=0&(b|0)!=0){if((c[a>>2]|0)>0?(c[b>>2]|0)>0:0){w=c[a+16>>2]|0;p=c[a+40>>2]|0;v=b+40|0;o=c[v>>2]|0;k=a+32|0;m=b+32|0;r=+$w(c[k>>2]|0,c[m>>2]|0,w);l=+h[a+24>>3];n=+h[b+24>>3];if(n+l>3]=+h[j>>3]+1.0;q=c[k>>2]|0;n=+h[a+8>>3];p=fw(a,w)|0;o=c[m>>2]|0;l=+h[b+8>>3];m=fw(b,w)|0;if(!(r>0.0))qa(94798,94681,191,94764);n=n*i*l;l=+D(+r,+(1.0-g));l=1.0/(g==-1.0?r*r:l);k=0;while(1){if((k|0)>=(w|0))break a;i=n*(+h[q+(k<<3)>>3]-+h[o+(k<<3)>>3])*l;e=p+(k<<3)|0;h[e>>3]=i+ +h[e>>3];e=m+(k<<3)|0;h[e>>3]=+h[e>>3]-i;k=k+1|0;}}m=(p|0)!=0;k=(o|0)!=0;u=(a|0)==(b|0);if(m&k){s=j+8|0;t=g==-1.0;f=1.0-g;m=p;while(1){if(!m)break a;p=Zv(zy(m)|0)|0;r=+Yv(zy(m)|0);q=_v(zy(m)|0)|0;a=gw(e,q,m,w)|0;r=r*i;o=c[v>>2]|0;while(1){if(!o)break;b=Zv(zy(o)|0)|0;l=+Yv(zy(o)|0);k=_v(zy(o)|0)|0;j=gw(e,k,o,w)|0;b:do if(!((q|0)==(k|0)|u&(k|0)<(q|0))){h[s>>3]=+h[s>>3]+1.0;g=+Zw(d,w,q,k);l=r*l;n=+D(+g,+f);n=1.0/(t?g*g:n);k=0;while(1){if((k|0)>=(w|0))break b;g=l*(+h[p+(k<<3)>>3]-+h[b+(k<<3)>>3])*n;x=a+(k<<3)|0;h[x>>3]=g+ +h[x>>3];x=j+(k<<3)|0;h[x>>3]=+h[x>>3]-g;k=k+1|0;}}while(0);o=Ay(o)|0;}m=Ay(m)|0;}}if(u){q=1<=(q|0))break a;p=c[(c[o>>2]|0)+(m<<2)>>2]|0;k=m;while(1){if((k|0)==(q|0))break;dw(p,c[(c[o>>2]|0)+(k<<2)>>2]|0,d,e,f,g,i,j);k=k+1|0;}m=m+1|0;}}if(!(m|!(l>n))){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,b,d,e,f,g,i,j);k=k+1|0;}}if(!(k|!(n>l))){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,a,d,e,f,g,i,j);k=k+1|0;}}if(!m){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,b,d,e,f,g,i,j);k=k+1|0;}}if(k)qa(138394,94681,273,94764);o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,a,d,e,f,g,i,j);k=k+1|0;}}qa(94739,94681,175,94764);}while(0);return}function ew(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0;e=c[a+40>>2]|0;m=c[a+16>>2]|0;g=+h[a+8>>3];n=fw(a,m)|0;if(!(g>0.0))qa(94673,94681,289,94692);l=d+16|0;h[l>>3]=+h[l>>3]+1.0;a:do if(!e){l=1<=(l|0))break a;f=c[(c[k>>2]|0)+(a<<2)>>2]|0;if(f|0){if((c[f>>2]|0)<=0)break;j=fw(f,m)|0;i=+h[f+8>>3]*g;e=0;while(1){if((e|0)>=(m|0))break;o=j+(e<<3)|0;h[o>>3]=+h[o>>3]+ +h[n+(e<<3)>>3]*i;e=e+1|0;}ew(f,b,d);}a=a+1|0;}qa(94728,94681,307,94692);}else {i=1.0/g;while(1){if(!e)break a;f=gw(b,_v(zy(e)|0)|0,e,m)|0;g=+Yv(zy(e)|0)*i;a=0;while(1){if((a|0)>=(m|0))break;o=f+(a<<3)|0;h[o>>3]=+h[o>>3]+ +h[n+(a<<3)>>3]*g;a=a+1|0;}e=Ay(e)|0;}}while(0);return}function fw(a,b){a=a|0;b=b|0;var d=0;d=a+48|0;a=c[d>>2]|0;a:do if(!a){a=KK(b<<3)|0;c[d>>2]=a;d=0;while(1){if((d|0)>=(b|0))break a;h[a+(d<<3)>>3]=0.0;d=d+1|0;}}while(0);return a|0}function gw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[(zy(d)|0)+24>>2]|0;if(!f){f=a+((O(e,b)|0)<<3)|0;c[(zy(d)|0)+24>>2]=f;f=c[(zy(d)|0)+24>>2]|0;}return f|0}function hw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0;m=a<<3;k=KK(m)|0;l=KK(m)|0;m=KK(m)|0;if((k|0)!=0&(l|0)!=0&(m|0)!=0){f=0;while(1){if((f|0)>=(a|0)){f=0;break}h[k+(f<<3)>>3]=+h[d+(f<<3)>>3];f=f+1|0;}while(1){if((f|0)>=(a|0)){g=1;break}h[l+(f<<3)>>3]=+h[d+(f<<3)>>3];f=f+1|0;}while(1){if((g|0)>=(b|0))break;j=O(g,a)|0;f=0;while(1){if((f|0)>=(a|0))break;n=k+(f<<3)|0;i=+h[n>>3];p=d+(f+j<<3)|0;o=+h[p>>3];h[n>>3]=i>3];i=+h[p>>3];h[n>>3]=o>i?o:i;f=f+1|0;}g=g+1|0;}i=+h[l>>3]-+h[k>>3];f=0;while(1){if((f|0)>=(a|0))break;p=k+(f<<3)|0;n=l+(f<<3)|0;h[m+(f<<3)>>3]=(+h[n>>3]+ +h[p>>3])*.5;o=+h[n>>3]-+h[p>>3];i=i>o?i:o;f=f+1|0;}f=iw(a,m,i==0.0?5.2e-06:i*.52,c)|0;a:do if(!e){g=0;while(1){if((g|0)>=(b|0))break a;f=jw(f,d+((O(g,a)|0)<<3)|0,1.0,g)|0;g=g+1|0;}}else {g=0;while(1){if((g|0)>=(b|0))break a;p=d+((O(g,a)|0)<<3)|0;f=jw(f,p,+h[e+(g<<3)>>3],g)|0;g=g+1|0;}}while(0);U1(k);U1(l);U1(m);}else {U1(k);U1(l);U1(m);f=0;}return f|0}function iw(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;var f=0,g=0,i=0;g=KK(56)|0;c[g+16>>2]=a;c[g>>2]=0;i=KK(a<<3)|0;c[g+20>>2]=i;f=0;while(1){if((f|0)>=(a|0))break;h[i+(f<<3)>>3]=+h[b+(f<<3)>>3];f=f+1|0;}if(d>0.0){h[g+24>>3]=d;h[g+8>>3]=0.0;c[g+32>>2]=0;c[g+36>>2]=0;c[g+40>>2]=0;c[g+44>>2]=e;c[g+48>>2]=0;return g|0}else qa(94896,94681,410,94906);return 0}function jw(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;if(!a)a=0;else kw(a,b,c,d,0)|0;return a|0}function kw(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=a+16|0;r=c[t>>2]|0;s=c[a+44>>2]|0;m=c[a>>2]|0;do if(!m){c[a>>2]=1;h[a+8>>3]=d;j=KK(r<<3)|0;c[a+32>>2]=j;i=c[t>>2]|0;g=0;while(1){if((g|0)>=(i|0))break;h[j+(g<<3)>>3]=+h[b+(g<<3)>>3];g=g+1|0;}g=lw(i,d,b,e)|0;i=a+40|0;if(!(c[i>>2]|0)){c[i>>2]=wy(g)|0;break}else qa(94807,94681,502,94815);}else {if((s|0)<=(f|0)){if(c[a+36>>2]|0)qa(94881,94681,541,94815);g=m+1|0;c[a>>2]=g;i=a+8|0;h[i>>3]=+h[i>>3]+d;i=a+32|0;k=+(g|0);l=1.0/+(m+2|0);g=0;while(1){if((g|0)>=(r|0))break;q=(c[i>>2]|0)+(g<<3)|0;h[q>>3]=(+h[q>>3]*k+ +h[b+(g<<3)>>3])*l;g=g+1|0;}g=lw(r,d,b,e)|0;i=a+40|0;j=c[i>>2]|0;if(!j)qa(94891,94681,547,94815);else {c[i>>2]=yy(j,g)|0;break}}i=a+8|0;h[i>>3]=+h[i>>3]+d;i=a+32|0;l=+(m|0);k=1.0/+(m+1|0);g=0;while(1){if((g|0)>=(r|0))break;q=(c[i>>2]|0)+(g<<3)|0;h[q>>3]=(+h[q>>3]*l+ +h[b+(g<<3)>>3])*k;g=g+1|0;}q=a+36|0;p=1<>2]|0)){c[q>>2]=KK(p<<2)|0;g=0;while(1){if((g|0)>=(p|0))break a;c[(c[q>>2]|0)+(g<<2)>>2]=0;g=g+1|0;}}while(0);n=a+20|0;g=c[n>>2]|0;j=mw(r,g,b)|0;if(!((j|0)<(p|0)&(j|0)>-1))qa(94837,94681,515,94815);i=c[(c[q>>2]|0)+(j<<2)>>2]|0;if(!i){i=nw(c[t>>2]|0,g,+h[a+24>>3]*.5,s,j)|0;c[(c[q>>2]|0)+(j<<2)>>2]=i;i=c[(c[q>>2]|0)+(j<<2)>>2]|0;}o=f+1|0;e=kw(i,b,d,e,o)|0;c[(c[q>>2]|0)+(j<<2)>>2]=e;if(!(c[(c[q>>2]|0)+(j<<2)>>2]|0))qa(94860,94681,519,94815);b=a+40|0;g=c[b>>2]|0;do if(g|0){m=_v(zy(g)|0)|0;if((c[a>>2]|0)!=1)qa(94871,94681,523,94815);f=Zv(zy(c[b>>2]|0)|0)|0;k=+Yv(zy(c[b>>2]|0)|0);i=c[n>>2]|0;j=mw(r,i,f)|0;if(!((j|0)<(p|0)&(j|0)>-1))qa(94837,94681,527,94815);g=c[(c[q>>2]|0)+(j<<2)>>2]|0;if(!g){g=nw(c[t>>2]|0,i,+h[a+24>>3]*.5,s,j)|0;c[(c[q>>2]|0)+(j<<2)>>2]=g;g=c[(c[q>>2]|0)+(j<<2)>>2]|0;}t=kw(g,f,k,m,o)|0;c[(c[q>>2]|0)+(j<<2)>>2]=t;if(!(c[(c[q>>2]|0)+(j<<2)>>2]|0))qa(94860,94681,532,94815);else {xy(c[b>>2]|0,106);c[b>>2]=0;break}}while(0);c[a>>2]=(c[a>>2]|0)+1;}while(0);return a|0}function lw(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0,g=0;g=KK(32)|0;h[g>>3]=b;f=KK(a<<3)|0;c[g+8>>2]=f;h[g+16>>3]=+(e|0);e=0;while(1){if((e|0)>=(a|0))break;h[f+(e<<3)>>3]=+h[d+(e<<3)>>3];e=e+1|0;}c[g+24>>2]=0;return g|0}function mw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=0;while(1){d=a+-1|0;if((a|0)<=0)break;a=d;e=e<<1|!(+h[c+(d<<3)>>3]-+h[b+(d<<3)>>3]<0.0)&1;}return e|0}function nw(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0.0;g=iw(a,b,d,e)|0;i=c[g+20>>2]|0;j=-d;e=0;b=f;while(1){if((e|0)>=(a|0))break;f=i+(e<<3)|0;h[f>>3]=+h[f>>3]+((b&1|0)==0?j:d);e=e+1|0;b=(b|0)/2|0;}return g|0}function ow(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(a|0){b=c[a+16>>2]|0;U1(c[a+20>>2]|0);U1(c[a+32>>2]|0);U1(c[a+48>>2]|0);g=a+36|0;e=c[g>>2]|0;if(e|0){f=1<=(f|0))break;ow(c[b+(d<<2)>>2]|0);d=d+1|0;b=c[g>>2]|0;}U1(b);}xy(c[a+40>>2]|0,106);U1(a);}return}function pw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0;a:do if(!a)b=0;else {l=c[a+20>>2]|0;m=c[a+24>>2]|0;d=c[a+8>>2]|0;n=c[a>>2]|0;e=c[a+4>>2]|0;i=a+16|0;if((c[a+32>>2]|0)!=1)qa(94919,94943,76,94958);b=rw(e,n,d,c[i>>2]|0,1)|0;c[b+8>>2]=d;o=c[b+20>>2]|0;k=c[b+24>>2]|0;d=0;while(1){if((d|0)>(e|0)){d=0;break}c[o+(d<<2)>>2]=0;d=d+1|0;}b:while(1){if((d|0)>=(n|0)){d=0;break}f=d+1|0;g=l+(f<<2)|0;d=c[l+(d<<2)>>2]|0;while(1){if((d|0)>=(c[g>>2]|0)){d=f;continue b}j=o+((c[m+(d<<2)>>2]|0)+1<<2)|0;c[j>>2]=(c[j>>2]|0)+1;d=d+1|0;}}while(1){if((d|0)>=(e|0))break;j=d+1|0;g=o+(j<<2)|0;c[g>>2]=(c[g>>2]|0)+(c[o+(d<<2)>>2]|0);d=j;}c:do switch(c[i>>2]|0){case 1:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;d:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue d}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;q=+h[g+(d<<3)>>3];r=o+(c[r>>2]<<2)|0;p=c[r>>2]|0;c[r>>2]=p+1;h[a+(p<<3)>>3]=q;d=d+1|0;}}}case 2:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;e:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue e}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;t=d<<1;r=o+(c[r>>2]<<2)|0;p=c[r>>2]|0;s=p<<1;h[a+(s<<3)>>3]=+h[g+(t<<3)>>3];h[a+((s|1)<<3)>>3]=+h[g+((t|1)<<3)>>3];c[r>>2]=p+1;d=d+1|0;}}}case 4:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;f:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue f}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;s=c[g+(d<<2)>>2]|0;r=o+(c[r>>2]<<2)|0;t=c[r>>2]|0;c[r>>2]=t+1;c[a+(t<<2)>>2]=s;d=d+1|0;}}}case 8:{f=0;g:while(1){if((f|0)>=(n|0))break c;g=f+1|0;a=l+(g<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[a>>2]|0)){f=g;continue g}s=o+(c[m+(d<<2)>>2]<<2)|0;t=c[s>>2]|0;c[s>>2]=t+1;c[k+(t<<2)>>2]=f;d=d+1|0;}}}case 16:{qw(b);b=0;break a}default:{qw(b);b=0;break a}}while(0);while(1){d=e+-1|0;if((e|0)<=0)break;c[o+(e<<2)>>2]=c[o+(d<<2)>>2];e=d;}c[o>>2]=0;}while(0);return b|0}function qw(a){a=a|0;var b=0;if(a|0){b=c[a+20>>2]|0;if(b|0)U1(b);b=c[a+24>>2]|0;if(b|0)U1(b);U1(c[a+28>>2]|0);U1(a);}return}function rw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a=tw(a,b,d,sw(d)|0,e)|0;if((c|0)>0)uw(a,c)|0;return a|0}function sw(a){a=a|0;switch(a|0){case 1:{a=8;break}case 2:{a=16;break}case 4:{a=4;break}case 8:{a=0;break}case 16:{a=0;break}default:a=0;}return a|0}function tw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=KK(44)|0;c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=d;c[g+40>>2]=e;if((f|0)==2)a=0;else a=KK((a<<2)+4|0)|0;c[g+20>>2]=a;c[g+24>>2]=0;c[g+28>>2]=0;c[g+32>>2]=f;c[g+36>>2]=0;return g|0}function uw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=c[a+32>>2]|0;f=a+28|0;c[f>>2]=0;d=b<<2;e=KK(d)|0;if((h|0)!=2){c[a+24>>2]=e;d=c[a+40>>2]|0;if((b|0)!=0&(d|0)>0)g=4;}else {c[a+20>>2]=e;c[a+24>>2]=KK(d)|0;d=c[a+40>>2]|0;g=4;}if((g|0)==4)c[f>>2]=KK(O(d,b)|0)|0;c[a+12>>2]=b;return a|0}function vw(a,b){a=a|0;b=b|0;if(!(ww(a,b)|0)){b=pw(a)|0;if(!b)b=0;else {a=yw(a,b)|0;qw(b);b=a+36|0;c[b>>2]=c[b>>2]|3;b=a;}}else b=xw(a)|0;return b|0}function ww(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0;if(a){if((c[a+32>>2]|0)!=1)qa(94919,94943,187,95074);s=a+36|0;d=c[s>>2]|0;if((d&2|0)==0?(p=(b|0)!=0,(d&1|0)==0|p^1):0)if((c[a>>2]|0)==(c[a+4>>2]|0)?(t=pw(a)|0,(t|0)!=0):0){k=c[a+20>>2]|0;l=c[a+24>>2]|0;m=c[t+20>>2]|0;n=c[t+24>>2]|0;o=c[a>>2]|0;q=KK(o<<2)|0;b=0;while(1){if((b|0)>=(o|0))break;c[q+(b<<2)>>2]=-1;b=b+1|0;}a:do switch((p?8:c[a+16>>2]|0)|0){case 1:{g=c[a+28>>2]|0;i=c[t+28>>2]|0;b=0;while(1){if((b|0)>(o|0)){d=0;break}if((c[k+(b<<2)>>2]|0)==(c[m+(b<<2)>>2]|0))b=b+1|0;else {b=0;break a}}b:while(1){if((d|0)>=(o|0)){r=54;break a}e=k+(d<<2)|0;f=d+1|0;a=k+(f<<2)|0;b=c[e>>2]|0;while(1){if((b|0)>=(c[a>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}b=c[m+(d<<2)>>2]|0;a=c[m+(f<<2)>>2]|0;d=b;while(1){if((d|0)>=(a|0))break;if((c[q+(c[n+(d<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else d=d+1|0;}while(1){if((b|0)>=(a|0)){d=f;continue b}u=+h[i+(b<<3)>>3]-+h[g+(c[q+(c[n+(b<<2)>>2]<<2)>>2]<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}else b=b+1|0;}}}case 2:{i=c[a+28>>2]|0;j=c[t+28>>2]|0;b=0;while(1){if((b|0)>(o|0)){d=0;break}if((c[k+(b<<2)>>2]|0)==(c[m+(b<<2)>>2]|0))b=b+1|0;else {b=0;break a}}c:while(1){if((d|0)>=(o|0)){r=54;break a}f=k+(d<<2)|0;g=d+1|0;a=k+(g<<2)|0;b=c[f>>2]|0;while(1){if((b|0)>=(c[a>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}d=c[m+(d<<2)>>2]|0;e=c[m+(g<<2)>>2]|0;b=d;while(1){if((b|0)>=(e|0)){b=d;break}if((c[q+(c[n+(b<<2)>>2]<<2)>>2]|0)<(c[f>>2]|0)){b=0;break a}else b=b+1|0;}while(1){if((b|0)>=(e|0)){d=g;continue c}d=b<<1;a=c[q+(c[n+(b<<2)>>2]<<2)>>2]<<1;u=+h[j+(d<<3)>>3]-+h[i+(a<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}u=+h[j+((d|1)<<3)>>3]-+h[i+((a|1)<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}else b=b+1|0;}}}case 4:{f=c[a+28>>2]|0;g=c[t+28>>2]|0;b=0;d:while(1){if((b|0)>=(o|0)){r=54;break a}e=k+(b<<2)|0;i=b+1|0;a=k+(i<<2)|0;d=c[e>>2]|0;while(1){if((d|0)>=(c[a>>2]|0))break;c[q+(c[l+(d<<2)>>2]<<2)>>2]=d;d=d+1|0;}b=c[m+(b<<2)>>2]|0;a=c[m+(i<<2)>>2]|0;d=b;while(1){if((d|0)>=(a|0))break;if((c[q+(c[n+(d<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else d=d+1|0;}while(1){if((b|0)>=(a|0)){b=i;continue d}if((c[g+(b<<2)>>2]|0)==(c[f+(c[q+(c[n+(b<<2)>>2]<<2)>>2]<<2)>>2]|0))b=b+1|0;else {b=0;break a}}}}case 8:{a=0;e:while(1){if((a|0)>=(o|0)){r=54;break a}e=k+(a<<2)|0;f=a+1|0;d=k+(f<<2)|0;b=c[e>>2]|0;while(1){if((b|0)>=(c[d>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}d=c[m+(f<<2)>>2]|0;b=c[m+(a<<2)>>2]|0;while(1){if((b|0)>=(d|0)){a=f;continue e}if((c[q+(c[n+(b<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else b=b+1|0;}}}default:b=0;}while(0);if((r|0)==54){d=c[s>>2]|0;if(p)b=1;else {c[s>>2]=d|2;b=3;}c[s>>2]=b|d;b=1;}U1(q);qw(t);}else b=0;else b=1;}else b=0;return b|0}function xw(a){a=a|0;var b=0,d=0,e=0,f=0;if(!a)b=0;else {e=a+8|0;f=a+40|0;b=zw(c[a>>2]|0,c[a+4>>2]|0,c[e>>2]|0,c[a+16>>2]|0,c[f>>2]|0,c[a+32>>2]|0)|0;d=a+20|0;W6(c[b+20>>2]|0,c[d>>2]|0,(c[a>>2]<<2)+4|0)|0;W6(c[b+24>>2]|0,c[a+24>>2]|0,c[(c[d>>2]|0)+(c[a>>2]<<2)>>2]<<2|0)|0;d=c[a+28>>2]|0;if(d|0)W6(c[b+28>>2]|0,d|0,O(c[e>>2]|0,c[f>>2]|0)|0)|0;c[b+36>>2]=c[a+36>>2];c[b+8>>2]=c[e>>2];}return b|0}function yw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;p=c[a+20>>2]|0;r=c[a+24>>2]|0;s=c[b+20>>2]|0;t=c[b+24>>2]|0;if(!((a|0)!=0&(b|0)!=0))qa(94981,94943,973,94988);q=c[a+32>>2]|0;if(!((q|0)==1?(q|0)==(c[b+32>>2]|0):0))qa(95005,94943,974,94988);e=a+16|0;d=c[e>>2]|0;if((d|0)!=(c[b+16>>2]|0))qa(95055,94943,975,94988);o=c[a>>2]|0;f=c[a+4>>2]|0;if(((o|0)==(c[b>>2]|0)?(f|0)==(c[b+4>>2]|0):0)?(u=rw(o,f,(c[b+8>>2]|0)+(c[a+8>>2]|0)|0,d,1)|0,u|0):0){m=c[u+20>>2]|0;n=c[u+24>>2]|0;q=KK(f<<2)|0;d=0;while(1){if((d|0)>=(f|0))break;c[q+(d<<2)>>2]=-1;d=d+1|0;}c[m>>2]=0;a:do switch(c[e>>2]|0){case 1:{l=c[a+28>>2]|0;i=c[b+28>>2]|0;j=c[u+28>>2]|0;d=0;f=0;while(1){if((f|0)>=(o|0))break a;k=f+1|0;e=p+(k<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;g=r+(a<<2)|0;c[q+(c[g>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[g>>2];h[j+(d<<3)>>3]=+h[l+(a<<3)>>3];a=a+1|0;d=d+1|0;}b=s+(k<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;h[j+(d<<3)>>3]=+h[i+(f<<3)>>3];d=d+1|0;}else {e=j+(e<<3)|0;h[e>>3]=+h[e>>3]+ +h[i+(f<<3)>>3];}f=f+1|0;}c[m+(k<<2)>>2]=d;f=k;}}case 2:{l=c[a+28>>2]|0;k=c[b+28>>2]|0;i=c[u+28>>2]|0;f=0;d=0;while(1){if((f|0)>=(o|0))break a;j=f+1|0;e=p+(j<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;b=r+(a<<2)|0;c[q+(c[b>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[b>>2];b=a<<1;g=d<<1;h[i+(g<<3)>>3]=+h[l+(b<<3)>>3];h[i+((g|1)<<3)>>3]=+h[l+((b|1)<<3)>>3];a=a+1|0;d=d+1|0;}b=s+(j<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;a=f<<1;e=d<<1;h[i+(e<<3)>>3]=+h[k+(a<<3)>>3];h[i+((e|1)<<3)>>3]=+h[k+((a|1)<<3)>>3];d=d+1|0;}else {a=f<<1;e=e<<1;v=i+(e<<3)|0;h[v>>3]=+h[v>>3]+ +h[k+(a<<3)>>3];e=i+((e|1)<<3)|0;h[e>>3]=+h[e>>3]+ +h[k+((a|1)<<3)>>3];}f=f+1|0;}c[m+(j<<2)>>2]=d;f=j;}}case 4:{l=c[a+28>>2]|0;i=c[b+28>>2]|0;j=c[u+28>>2]|0;f=0;d=0;while(1){if((f|0)>=(o|0))break a;k=f+1|0;e=p+(k<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;v=r+(a<<2)|0;c[q+(c[v>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[v>>2];c[j+(d<<2)>>2]=c[l+(a<<2)>>2];a=a+1|0;d=d+1|0;}b=s+(k<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;c[j+(d<<2)>>2]=c[i+(f<<2)>>2];d=d+1|0;}else {v=j+(e<<2)|0;c[v>>2]=(c[v>>2]|0)+(c[i+(f<<2)>>2]|0);}f=f+1|0;}c[m+(k<<2)>>2]=d;f=k;}}case 8:{d=0;f=0;while(1){if((f|0)>=(o|0))break a;i=f+1|0;e=p+(i<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;v=r+(a<<2)|0;c[q+(c[v>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[v>>2];d=d+1|0;a=a+1|0;}b=s+(i<<2)|0;g=m+(f<<2)|0;e=c[s+(f<<2)>>2]|0;while(1){if((e|0)>=(c[b>>2]|0))break;a=c[t+(e<<2)>>2]|0;if((c[q+(a<<2)>>2]|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;d=d+1|0;}e=e+1|0;}c[m+(i<<2)>>2]=d;f=i;}}default:d=0;}while(0);c[u+8>>2]=d;U1(q);return u|0}return 0}function zw(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;a=tw(a,b,d,e,f)|0;if((c|0)>0)uw(a,c)|0;return a|0}function Aw(a,b){a=a|0;b=b|0;var d=0;if(!(ww(a,b)|0)){b=pw(a)|0;if(!b)b=0;else {d=yw(a,b)|0;qw(b);b=d+36|0;c[b>>2]=c[b>>2]|3;b=d;d=5;}}else {b=xw(a)|0;d=5;}if((d|0)==5)b=Bw(b)|0;return b|0}function Bw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0;a:do if(!a)a=0;else {k=c[a+20>>2]|0;l=c[a+24>>2]|0;d=c[k>>2]|0;b:do switch(c[a+16>>2]|0){case 1:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;h[j+(b<<3)>>3]=+h[j+(d<<3)>>3];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 2:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;m=d<<1;e=b<<1;h[j+(e<<3)>>3]=+h[j+(m<<3)>>3];h[j+((e|1)<<3)>>3]=+h[j+((m|1)<<3)>>3];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 4:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;c[j+(b<<2)>>2]=c[j+(d<<2)>>2];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 8:{i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}default:{a=0;break a}}while(0);c[a+8>>2]=b;}while(0);return a|0}function Cw(a){a=a|0;if((c[a+32>>2]|0)==2)return Dw(c[a+8>>2]|0,c[a>>2]|0,c[a+4>>2]|0,c[a+20>>2]|0,c[a+24>>2]|0,c[a+28>>2]|0,c[a+16>>2]|0,c[a+40>>2]|0)|0;else qa(95100,94943,803,95126);return 0}function Dw(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;return Ew(a,b,c,d,e,f,g,h,1)|0} - function J_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=b+72|0;k=b+352|0;l=b+356|0;m=b+360|0;i=0;a:while(1){h=f-e|0;if((h|0)<=0){f=-1;break}switch(a[j+(d[e>>0]|0)>>0]|0){case 8:case 1:case 0:{n=16;break a}case 5:{if((h|0)<2){f=-2;break a}if(lb[c[k>>2]&127](b,e)|0){n=6;break a}h=i;e=e+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}if(lb[c[l>>2]&127](b,e)|0){n=10;break a}h=i;e=e+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}if(lb[c[m>>2]&127](b,e)|0){n=14;break a}h=i;e=e+4|0;i=h;continue a}case 2:{h=e+1|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=33){o=i;e=h;i=o;continue a}h=e+2|0;if((f-h|0)<=0){f=-1;break a}o=(a[h>>0]|0)==91;i=i+(o&1)|0;e=o?e+3|0:h;continue a}case 4:{h=e+1|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=93){o=i;e=h;i=o;continue a}h=e+2|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=62){o=i;e=h;i=o;continue a}e=e+3|0;if(!i){n=26;break a}i=i+-1|0;continue a}default:{o=i;e=e+1|0;i=o;continue a}}}if((n|0)==6){c[g>>2]=e;f=0;}else if((n|0)==10){c[g>>2]=e;f=0;}else if((n|0)==14){c[g>>2]=e;f=0;}else if((n|0)==16){c[g>>2]=e;f=0;}else if((n|0)==26){c[g>>2]=e;f=42;}return f|0}function K_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>0){l=b+72|0;i=e;a:while(1){if((k-i|0)<=0){j=24;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 3:{j=8;break a}case 2:{j=11;break a}case 10:{j=12;break a}case 9:{j=15;break a}case 21:{j=19;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=1;}i=i+h|0;}if((j|0)==8)if((i|0)==(e|0)){h=W_(b,e+1|0,f,g)|0;break}else {c[g>>2]=i;h=6;break}else if((j|0)==11){c[g>>2]=i;h=0;break}else if((j|0)==12)if((i|0)==(e|0)){c[g>>2]=e+1;h=7;break}else {c[g>>2]=i;h=6;break}else if((j|0)==15){if((i|0)!=(e|0)){c[g>>2]=i;h=6;break}h=e+1|0;if((k-h|0)<=0){h=-3;break}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break}else if((j|0)==19)if((i|0)==(e|0)){c[g>>2]=e+1;h=39;break}else {c[g>>2]=i;h=6;break}else if((j|0)==24){c[g>>2]=i;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function L_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>0){l=b+72|0;i=e;a:while(1){if((k-i|0)<=0){j=23;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 3:{j=8;break a}case 30:{j=11;break a}case 10:{j=14;break a}case 9:{j=17;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=1;}i=i+h|0;}if((j|0)==8)if((i|0)==(e|0)){h=W_(b,e+1|0,f,g)|0;break}else {c[g>>2]=i;h=6;break}else if((j|0)==11)if((i|0)==(e|0)){h=X_(b,e+1|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=i;h=6;break}else if((j|0)==14)if((i|0)==(e|0)){c[g>>2]=e+1;h=7;break}else {c[g>>2]=i;h=6;break}else if((j|0)==17){if((i|0)!=(e|0)){c[g>>2]=i;h=6;break}h=e+1|0;if((k-h|0)<=0){h=-3;break}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break}else if((j|0)==23){c[g>>2]=i;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function M_(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=6;break}if((f-b|0)<1){b=0;break}if((a[b>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+1|0;}if((g|0)==6)b=(b|0)==(d|0)&1;return b|0}function N_(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;b=c;a:while(1){switch(a[f+(d[b>>0]|0)>>0]|0){case 5:{e=2;break}case 6:{e=3;break}case 7:{e=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{e=1;break}default:break a}b=b+e|0;}return b-c|0}function O_(b,c){b=b|0;c=c|0;b=b+72|0;a:while(1){switch(a[b+(d[c>>0]|0)>>0]|0){case 21:case 9:case 10:break;default:break a}c=c+1|0;}return c|0}function P_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;l=b+72|0;j=0;k=0;b=1;a:while(1){h=e+1|0;i=a[h>>0]|0;do switch(a[l+(i&255)>>0]|0){case 5:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+2|0;k=h;j=i;continue a}case 6:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+3|0;k=h;j=i;continue a}case 7:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+4|0;k=h;j=i;continue a}case 24:case 22:case 29:{if(b|0){o=b;n=k;i=j;e=h;b=o;k=n;j=i;continue a}if((k|0)>=(f|0)){n=k;o=j;b=1;e=h;k=n;j=o;continue a}c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;n=k;o=j;b=1;e=h;k=n;j=o;continue a}case 12:{if((b|0)!=2){if((k|0)>=(f|0)){o=k;j=12;b=2;e=h;k=o;continue a}c[g+(k<<4)+4>>2]=e+2;o=k;j=12;b=2;e=h;k=o;continue a}if((j|0)!=12){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if((k|0)<(f|0))c[g+(k<<4)+8>>2]=h;j=12;k=k+1|0;b=0;e=h;continue a}case 13:{if((b|0)!=2){if((k|0)>=(f|0)){o=k;j=13;b=2;e=h;k=o;continue a}c[g+(k<<4)+4>>2]=e+2;o=k;j=13;b=2;e=h;k=o;continue a}if((j|0)!=13){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if((k|0)<(f|0))c[g+(k<<4)+8>>2]=h;j=13;k=k+1|0;b=0;e=h;continue a}case 3:{if((k|0)>=(f|0)){i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}a[g+(k<<4)+12>>0]=0;i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}case 21:{switch(b|0){case 1:{n=k;o=j;b=0;e=h;k=n;j=o;continue a}case 2:break;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}if((k|0)>=(f|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}b=g+(k<<4)+12|0;if(!(a[b>>0]|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if(((i<<24>>24==32?(h|0)!=(c[g+(k<<4)+4>>2]|0):0)?(m=a[e+2>>0]|0,m<<24>>24!=32):0)?(j|0)!=(d[l+(m&255)>>0]|0):0){n=k;o=j;b=2;e=h;k=n;j=o;continue a}a[b>>0]=0;n=k;o=j;b=2;e=h;k=n;j=o;continue a}case 10:case 9:{switch(b|0){case 1:{n=k;o=j;b=0;e=h;k=n;j=o;continue a}case 2:break;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}if((k|0)>=(f|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}a[g+(k<<4)+12>>0]=0;n=k;o=j;b=2;e=h;k=n;j=o;continue a}case 17:case 11:if((b|0)==2){n=k;o=j;b=2;e=h;k=n;j=o;continue a}else break a;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}while(0)}return k|0}function Q_(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+2|0;d=a[b>>0]|0;a:do if(d<<24>>24==120){d=c+3|0;b=0;while(1){b:while(1){e=a[d>>0]|0;c=e<<24>>24;if(e<<24>>24==59){e=14;break a}switch(c|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=7;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=8;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=9;break b}default:{}}d=d+1|0;}if((e|0)==7){e=0;b=c+-48|b<<4;}else if((e|0)==8){e=0;b=(b<<4)+-55+c|0;}else if((e|0)==9){e=0;b=(b<<4)+-87+c|0;}if((b|0)<1114112)d=d+1|0;else {b=-1;break}}}else {c=b;b=0;while(1){if(d<<24>>24==59){e=14;break a}b=(d<<24>>24)+-48+(b*10|0)|0;if((b|0)>=1114112){b=-1;break a}d=c+1|0;c=d;d=a[d>>0]|0;}}while(0);if((e|0)==14)b=A_(b)|0;return b|0}function R_(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch(d-c|0){case 2:{if((a[c+1>>0]|0)==116){b=a[c>>0]|0;b=b<<24>>24==108?60:b<<24>>24==103?62:0;}else e=14;break}case 3:{if(((a[c>>0]|0)==97?(a[c+1>>0]|0)==109:0)?(a[c+2>>0]|0)==112:0)b=38;else e=14;break}case 4:switch(a[c>>0]|0){case 113:{if((a[c+1>>0]|0)!=117){e=14;break a}if((a[c+2>>0]|0)!=111){e=14;break a}if((a[c+3>>0]|0)==116){b=34;break a}else {e=14;break a}}case 97:{if((a[c+1>>0]|0)!=112){e=14;break a}if((a[c+2>>0]|0)!=111){e=14;break a}if((a[c+3>>0]|0)==115){b=39;break a}else {e=14;break a}}default:{e=14;break a}}default:e=14;}while(0);if((e|0)==14)b=0;return b|0}function S_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=b+72|0;i=g+4|0;while(1){if((f-e|0)<=0)break;switch(a[h+(d[e>>0]|0)>>0]|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[i>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+1|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;b=e+1|0;if((f-b|0)>0)e=(a[h+(d[b>>0]|0)>>0]|0)==10?e+2|0:b;else e=b;c[i>>2]=-1;break}default:e=e+1|0;}c[i>>2]=(c[i>>2]|0)+1;}return}function T_(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=e+-1|0;b=b+72|0;a:while(1){d=d+1|0;if((g-d|0)<=0){d=1;break}e=a[d>>0]|0;switch(a[b+(e&255)>>0]|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:continue a;case 21:if(e<<24>>24==9){h=7;break a}else continue a;case 22:case 26:{if(e<<24>>24>=0)continue a;break}default:{}}switch(e<<24>>24|0){case 64:case 36:break;default:{h=7;break a}}}if((h|0)==7){c[f>>2]=d;d=0;}return d|0}function U_(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;i=h;while(1){j=c[e>>2]|0;if((j|0)==(f|0)){b=0;break}k=d[j>>0]|0;b=c[g>>2]|0;if(!(k&128)){if((b|0)==(h|0)){b=2;break}c[e>>2]=j+1;j=a[j>>0]|0;k=c[g>>2]|0;c[g>>2]=k+1;a[k>>0]=j;continue}else {if((i-b|0)<2){b=2;break}c[g>>2]=b+1;a[b>>0]=k>>>6|192;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=k&63|128;c[e>>2]=(c[e>>2]|0)+1;continue}}return b|0}function V_(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;while(1){a=c[e>>2]|0;i=a>>>0>>0;j=c[g>>2]|0;if(!(i&j>>>0>>0))break;c[e>>2]=a+1;i=d[a>>0]|0;j=c[g>>2]|0;c[g>>2]=j+2;b[j>>1]=i;}return ((j|0)!=(h|0)|i^1?0:2)|0}function W_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;h=k-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{f=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=4;break}case 19:{f=Y_(b,e+1|0,f,g)|0;break a}default:{c[g>>2]=e;f=0;break a}}h=b+328|0;i=b+332|0;j=b+336|0;e=e+f|0;b:while(1){f=k-e|0;if((f|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=18;break b}case 18:{h=29;break b}case 27:case 26:case 25:case 24:case 22:{f=1;break}case 5:{if((f|0)<2){f=-2;break a}if(!(lb[c[h>>2]&127](b,e)|0)){h=21;break b}else f=2;break}case 6:{if((f|0)<3){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=24;break b}else f=3;break}case 7:{if((f|0)<4){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=27;break b}else f=4;break}default:{h=30;break b}}e=e+f|0;}if((h|0)==18){c[g>>2]=e;f=0;break}else if((h|0)==21){c[g>>2]=e;f=0;break}else if((h|0)==24){c[g>>2]=e;f=0;break}else if((h|0)==27){c[g>>2]=e;f=0;break}else if((h|0)==29){c[g>>2]=e+1;f=9;break}else if((h|0)==30){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function X_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;e=e+h|0;b:while(1){h=f-e|0;if((h|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=18;break b}case 18:{h=29;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=21;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=24;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,e)|0)){h=27;break b}else h=4;break}default:{h=30;break b}}e=e+h|0;}if((h|0)==18){c[g>>2]=e;f=0;break}else if((h|0)==21){c[g>>2]=e;f=0;break}else if((h|0)==24){c[g>>2]=e;f=0;break}else if((h|0)==27){c[g>>2]=e;f=0;break}else if((h|0)==29){c[g>>2]=e+1;f=28;break}else if((h|0)==30){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function Y_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=f;a:do if((i-e|0)>0){h=a[e>>0]|0;if(h<<24>>24==120){b=Z_(b,e+1|0,f,g)|0;break}f=b+72|0;if((a[f+(h&255)>>0]|0)!=25){c[g>>2]=e;b=0;break}b:while(1){b=e+1|0;if((i-b|0)<=0){b=-1;break a}switch(a[f+(d[b>>0]|0)>>0]|0){case 25:{e=b;break}case 18:{f=8;break b}default:{f=9;break b}}}if((f|0)==8){c[g>>2]=e+2;b=10;break}else if((f|0)==9){c[g>>2]=b;b=0;break}}else b=-1;while(0);return b|0}function Z_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0;a:do if((f-e|0)>0){b=b+72|0;if((a[b+(d[e>>0]|0)>>0]&-2)<<24>>24!=24){c[g>>2]=e;f=0;break}b:while(1){h=e+1|0;if((f-h|0)<=0){f=-1;break a}switch(a[b+(d[h>>0]|0)>>0]|0){case 24:case 25:{e=h;break}case 18:{b=6;break b}default:{b=7;break b}}}if((b|0)==6){c[g>>2]=e+2;f=10;break}else if((b|0)==7){c[g>>2]=h;f=0;break}}else f=-1;while(0);return f|0}function __(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=f;h=q-e|0;a:do if((h|0)>0){p=b+72|0;switch(a[p+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;h=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){h=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=2;break}case 6:{if((h|0)<3){h=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=3;break}case 7:{if((h|0)<4){h=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=4;break}case 16:{h=e+1|0;if((q-h|0)<=0){h=-1;break a}switch(a[p+(d[h>>0]|0)>>0]|0){case 27:{h=$_(b,e+2|0,f,g)|0;break a}case 20:{h=a$(e+2|0,f,g)|0;break a}default:{c[g>>2]=h;h=0;break a}}}case 15:{h=b$(b,e+1|0,f,g)|0;break a}case 17:{h=c$(b,e+1|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}j=b+328|0;k=b+332|0;l=b+336|0;m=b+340|0;n=b+344|0;o=b+348|0;i=0;h=e+h|0;b:while(1){e=q-h|0;if((e|0)<=0){h=-1;break a}c:do switch(a[p+(d[h>>0]|0)>>0]|0){case 29:{r=24;break b}case 10:case 9:case 21:{r=50;break b}case 11:{r=64;break b}case 17:break b;case 27:case 26:case 25:case 24:case 22:{e=1;break}case 5:{if((e|0)<2){h=-2;break a}if(!(lb[c[j>>2]&127](b,h)|0)){r=27;break b}else e=2;break}case 6:{if((e|0)<3){h=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){r=30;break b}else e=3;break}case 7:{if((e|0)<4){h=-2;break a}if(!(lb[c[l>>2]&127](b,h)|0)){r=33;break b}else e=4;break}case 23:{if(i|0){r=35;break b}i=h+1|0;e=q-i|0;if((e|0)<=0){h=-1;break a}switch(a[p+(d[i>>0]|0)>>0]|0){case 29:{r=38;break b}case 24:case 22:{i=1;e=2;break c}case 5:{if((e|0)<2){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){r=42;break b}else {i=1;e=3;break c}}case 6:{if((e|0)<3){h=-2;break a}if(!(lb[c[n>>2]&127](b,i)|0)){r=45;break b}else {i=1;e=4;break c}}case 7:{if((e|0)<4){h=-2;break a}if(!(lb[c[o>>2]&127](b,i)|0)){r=48;break b}else {i=1;e=5;break c}}default:{r=49;break b}}}default:{r=69;break b}}while(0);h=h+e|0;}d:switch(r|0){case 24:{c[g>>2]=h;h=0;break a}case 27:{c[g>>2]=h;h=0;break a}case 30:{c[g>>2]=h;h=0;break a}case 33:{c[g>>2]=h;h=0;break a}case 35:{c[g>>2]=h;h=0;break a}case 38:{c[g>>2]=i;h=0;break a}case 42:{c[g>>2]=i;h=0;break a}case 45:{c[g>>2]=i;h=0;break a}case 48:{c[g>>2]=i;h=0;break a}case 49:{c[g>>2]=i;h=0;break a}case 50:{e:while(1){r=0;i=h+1|0;e=q-i|0;if((e|0)<=0){h=-1;break a}switch(a[p+(d[i>>0]|0)>>0]|0){case 11:{h=i;r=64;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;r=50;break}case 29:{r=52;break e}case 24:case 22:{i=2;break e}case 5:{r=53;break e}case 6:{r=56;break e}case 7:{r=59;break e}default:{r=62;break e}}}if((r|0)==52){c[g>>2]=i;h=0;break a}else if((r|0)==53){if((e|0)<2){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=3;}else if((r|0)==56){if((e|0)<3){h=-2;break a}if(!(lb[c[n>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=4;}else if((r|0)==59){if((e|0)<4){h=-2;break a}if(!(lb[c[o>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=5;}else if((r|0)==62){c[g>>2]=i;h=0;break a}h=d$(b,h+i|0,f,g)|0;break a}case 69:{c[g>>2]=h;h=0;break a}}if((r|0)==64){c[g>>2]=h+1;h=2;break}i=h+1|0;if((q-i|0)>0)if((a[i>>0]|0)==62){c[g>>2]=h+2;h=4;break}else {c[g>>2]=i;h=0;break}else h=-1;}else h=-1;while(0);return h|0}function $_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;a:do if((f-e|0)>0){if((a[e>>0]|0)!=45){c[g>>2]=e;f=0;break}h=b+72|0;i=b+352|0;j=b+356|0;k=b+360|0;l=e+1|0;b:while(1){e=f-l|0;if((e|0)<=0){f=-1;break a}switch(a[h+(d[l>>0]|0)>>0]|0){case 8:case 1:case 0:{e=19;break b}case 5:{if((e|0)<2){f=-2;break a}if(lb[c[i>>2]&127](b,l)|0){e=9;break b}l=l+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}if(lb[c[j>>2]&127](b,l)|0){e=13;break b}l=l+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}if(lb[c[k>>2]&127](b,l)|0){e=17;break b}l=l+4|0;continue b}case 27:{e=l+1|0;if((f-e|0)<=0){f=-1;break a}if((a[e>>0]|0)==45){e=22;break b}else {l=e;continue b}}default:{l=l+1|0;continue b}}}if((e|0)==9){c[g>>2]=l;f=0;break}else if((e|0)==13){c[g>>2]=l;f=0;break}else if((e|0)==17){c[g>>2]=l;f=0;break}else if((e|0)==19){c[g>>2]=l;f=0;break}else if((e|0)==22){e=l+2|0;if((f-e|0)<=0){f=-1;break}if((a[e>>0]|0)==62){c[g>>2]=l+3;f=13;break}else {c[g>>2]=e;f=0;break}}}else f=-1;while(0);return f|0}function a$(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>5){d=0;while(1){if((d|0)>=6){d=8;break}if((a[b>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+1|0;}c[e>>2]=b;}else d=-1;return d|0}function b$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;f=o-e|0;a:do if((f|0)>0){n=b+72|0;switch(a[n+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{f=1;break}case 5:{if((f|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=2;break}case 6:{if((f|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=3;break}case 7:{if((f|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;f=e+f|0;b:while(1){h=o-f|0;if((h|0)<=0){f=-1;break a}switch(a[n+(d[f>>0]|0)>>0]|0){case 29:{m=17;break b}case 10:case 9:case 21:{m=28;break b}case 15:{m=50;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,f)|0)){m=20;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,f)|0)){m=23;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,f)|0)){m=26;break b}else h=4;break}default:break b}f=f+h|0;}if((m|0)==17){c[g>>2]=f;f=0;break}else if((m|0)==20){c[g>>2]=f;f=0;break}else if((m|0)==23){c[g>>2]=f;f=0;break}else if((m|0)==26){c[g>>2]=f;f=0;break}else if((m|0)==28){if(!(e$(e,f,p)|0)){c[g>>2]=f;f=0;break}i=b+352|0;j=b+356|0;k=b+360|0;h=f+1|0;c:while(1){f=o-h|0;if((f|0)<=0){f=-1;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 8:case 1:case 0:{m=45;break c}case 5:{if((f|0)<2){f=-2;break a}if(lb[c[i>>2]&127](b,h)|0){m=35;break c}h=h+2|0;continue c}case 6:{if((f|0)<3){f=-2;break a}if(lb[c[j>>2]&127](b,h)|0){m=39;break c}h=h+3|0;continue c}case 7:{if((f|0)<4){f=-2;break a}if(lb[c[k>>2]&127](b,h)|0){m=43;break c}h=h+4|0;continue c}case 15:{f=h+1|0;if((o-f|0)<=0){f=-1;break a}if((a[f>>0]|0)==62){m=48;break c}else {h=f;continue c}}default:{h=h+1|0;continue c}}}if((m|0)==35){c[g>>2]=h;f=0;break}else if((m|0)==39){c[g>>2]=h;f=0;break}else if((m|0)==43){c[g>>2]=h;f=0;break}else if((m|0)==45){c[g>>2]=h;f=0;break}else if((m|0)==48){c[g>>2]=h+2;f=c[p>>2]|0;break}}else if((m|0)==50){if(!(e$(e,f,p)|0)){c[g>>2]=f;f=0;break}h=f+1|0;if((o-h|0)<=0){f=-1;break}if((a[h>>0]|0)==62){c[g>>2]=f+2;f=c[p>>2]|0;break}else f=h;}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function c$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;h=e+h|0;b:while(1){e=f-h|0;if((e|0)<=0){f=-1;break a}switch(a[l+(d[h>>0]|0)>>0]|0){case 29:{i=17;break b}case 10:case 9:case 21:{i=27;break b}case 11:{i=32;break b}case 23:case 27:case 26:case 25:case 24:case 22:{e=1;break}case 5:{if((e|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,h)|0)){i=20;break b}else e=2;break}case 6:{if((e|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,h)|0)){i=23;break b}else e=3;break}case 7:{if((e|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){i=26;break b}else e=4;break}default:{i=33;break b}}h=h+e|0;}if((i|0)==17){c[g>>2]=h;f=0;break}else if((i|0)==20){c[g>>2]=h;f=0;break}else if((i|0)==23){c[g>>2]=h;f=0;break}else if((i|0)==26){c[g>>2]=h;f=0;break}else if((i|0)==27){c:while(1){e=h+1|0;if((f-e|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 10:case 9:case 21:{h=e;i=27;break}case 11:{i=29;break c}default:{i=30;break c}}}if((i|0)==29){c[g>>2]=h+2;f=5;break}else if((i|0)==30){c[g>>2]=e;f=0;break}}else if((i|0)==32){c[g>>2]=h+1;f=5;break}else if((i|0)==33){c[g>>2]=h;f=0;break}}else f=-1;while(0);return f|0}function d$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;v=y;c[v>>2]=e;w=f;r=b+72|0;s=b+328|0;t=b+332|0;u=b+336|0;k=b+340|0;m=b+344|0;n=b+348|0;o=b+352|0;p=b+356|0;q=b+360|0;i=0;a:while(1){h=w-e|0;if((h|0)<=0){e=-1;break}b:do switch(a[r+(d[e>>0]|0)>>0]|0){case 29:{x=4;break a}case 27:case 26:case 25:case 24:case 22:{h=e+1|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 5:{if((h|0)<2){e=-2;break a}if(!(lb[c[s>>2]&127](b,e)|0)){x=8;break a}h=e+2|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 6:{if((h|0)<3){e=-2;break a}if(!(lb[c[t>>2]&127](b,e)|0)){x=12;break a}h=e+3|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 7:{if((h|0)<4){e=-2;break a}if(!(lb[c[u>>2]&127](b,e)|0)){x=16;break a}h=e+4|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 23:{if(i|0){x=19;break a}h=e+1|0;c[v>>2]=h;i=w-h|0;if((i|0)<=0){e=-1;break a}switch(a[r+(d[h>>0]|0)>>0]|0){case 29:{x=22;break a}case 24:case 22:{j=e+2|0;c[v>>2]=j;i=1;e=j;continue a}case 5:{if((i|0)<2){e=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){x=26;break a}j=e+3|0;c[v>>2]=j;i=1;e=j;continue a}case 6:{if((i|0)<3){e=-2;break a}if(!(lb[c[m>>2]&127](b,h)|0)){x=30;break a}j=e+4|0;c[v>>2]=j;i=1;e=j;continue a}case 7:{if((i|0)<4){e=-2;break a}if(!(lb[c[n>>2]&127](b,h)|0)){x=34;break a}j=e+5|0;c[v>>2]=j;i=1;e=j;continue a}default:{x=36;break a}}}case 10:case 9:case 21:while(1){e=e+1|0;c[v>>2]=e;if((w-e|0)<=0){e=-1;break a}switch(a[r+(d[e>>0]|0)>>0]|0){case 14:break b;case 9:case 10:case 21:break;default:{x=39;break a}}}case 14:break;default:{x=92;break a}}while(0);while(1){h=e+1|0;c[v>>2]=h;if((w-h|0)<=0){e=-1;break a}j=a[r+(d[h>>0]|0)>>0]|0;if((j|1)<<24>>24==13)break;switch(j<<24>>24){case 9:case 10:case 21:{e=h;break}default:{x=43;break a}}}e=e+2|0;c[v>>2]=e;c:while(1){h=w-e|0;if((h|0)<=0){e=-1;break a}i=a[r+(d[e>>0]|0)>>0]|0;if(i<<24>>24==j<<24>>24)break;switch(i<<24>>24){case 8:case 1:case 0:{x=60;break a}case 2:{x=65;break a}case 5:{if((h|0)<2){e=-2;break a}if(lb[c[o>>2]&127](b,e)|0){x=50;break a}i=e+2|0;c[v>>2]=i;e=i;continue c}case 6:{if((h|0)<3){e=-2;break a}if(lb[c[p>>2]&127](b,e)|0){x=54;break a}i=e+3|0;c[v>>2]=i;e=i;continue c}case 7:{if((h|0)<4){e=-2;break a}if(lb[c[q>>2]&127](b,e)|0){x=58;break a}i=e+4|0;c[v>>2]=i;e=i;continue c}case 3:{e=W_(b,e+1|0,f,v)|0;if((e|0)<1){x=63;break a}e=c[v>>2]|0;continue c}default:{i=e+1|0;c[v>>2]=i;e=i;continue c}}}h=e+1|0;c[v>>2]=h;if((w-h|0)<=0){e=-1;break}switch(a[r+(d[h>>0]|0)>>0]|0){case 11:{x=86;break a}case 17:{x=87;break a}case 10:case 9:case 21:{e=h;break}default:{x=69;break a}}d:while(1){h=e+1|0;c[v>>2]=h;i=w-h|0;if((i|0)<=0){e=-1;break a}switch(a[r+(d[h>>0]|0)>>0]|0){case 29:{x=72;break a}case 11:{x=86;break a}case 17:{x=87;break a}case 10:case 9:case 21:{e=h;break}case 24:case 22:{x=73;break d}case 5:{x=74;break d}case 6:{x=78;break d}case 7:{x=82;break d}default:{x=91;break a}}}if((x|0)==73){x=0;e=e+2|0;c[v>>2]=e;i=0;continue}else if((x|0)==74){x=0;if((i|0)<2){e=-2;break}if(!(lb[c[k>>2]&127](b,h)|0)){x=76;break}e=e+3|0;c[v>>2]=e;i=0;continue}else if((x|0)==78){x=0;if((i|0)<3){e=-2;break}if(!(lb[c[m>>2]&127](b,h)|0)){x=80;break}e=e+4|0;c[v>>2]=e;i=0;continue}else if((x|0)==82){x=0;if((i|0)<4){e=-2;break}if(!(lb[c[n>>2]&127](b,h)|0)){x=84;break}e=e+5|0;c[v>>2]=e;i=0;continue}}switch(x|0){case 4:{c[g>>2]=e;e=0;break}case 8:{c[g>>2]=e;e=0;break}case 12:{c[g>>2]=e;e=0;break}case 16:{c[g>>2]=e;e=0;break}case 19:{c[g>>2]=e;e=0;break}case 22:{c[g>>2]=h;e=0;break}case 26:{c[g>>2]=h;e=0;break}case 30:{c[g>>2]=h;e=0;break}case 34:{c[g>>2]=h;e=0;break}case 36:{c[g>>2]=h;e=0;break}case 39:{c[g>>2]=e;e=0;break}case 43:{c[g>>2]=h;e=0;break}case 50:{c[g>>2]=e;e=0;break}case 54:{c[g>>2]=e;e=0;break}case 58:{c[g>>2]=e;e=0;break}case 60:{c[g>>2]=e;e=0;break}case 63:{if(!e){c[g>>2]=c[v>>2];e=0;}break}case 65:{c[g>>2]=e;e=0;break}case 69:{c[g>>2]=h;e=0;break}case 72:{c[g>>2]=h;e=0;break}case 76:{c[g>>2]=h;e=0;break}case 80:{c[g>>2]=h;e=0;break}case 84:{c[g>>2]=h;e=0;break}case 86:{c[g>>2]=e+2;e=1;break}case 87:{e=h+1|0;c[v>>2]=e;if((w-e|0)>0)if((a[e>>0]|0)==62){c[g>>2]=h+2;e=3;break}else {c[g>>2]=e;e=0;break}else e=-1;break}case 91:{c[g>>2]=h;e=0;break}case 92:{c[g>>2]=e;e=0;break}}l=y;return e|0}function e$(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==3){switch(a[b>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}switch(a[b+1>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}switch(a[b+2>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;while(0);return d|0}function f$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=e+72|0;l=e+352|0;m=e+356|0;n=e+360|0;a:while(1){i=g-f|0;if((i|0)<=0){g=-1;break}j=a[k+(d[f>>0]|0)>>0]|0;switch(j<<24>>24){case 8:case 1:case 0:{o=16;break a}case 5:{if((i|0)<2){g=-2;break a}if(lb[c[l>>2]&127](e,f)|0){o=6;break a}f=f+2|0;continue a}case 6:{if((i|0)<3){g=-2;break a}if(lb[c[m>>2]&127](e,f)|0){o=10;break a}f=f+3|0;continue a}case 7:{if((i|0)<4){g=-2;break a}if(lb[c[n>>2]&127](e,f)|0){o=14;break a}f=f+4|0;continue a}case 13:case 12:{f=f+1|0;if((j&255|0)==(b|0)){o=18;break a}else continue a}default:{f=f+1|0;continue a}}}b:do if((o|0)==6){c[h>>2]=f;g=0;}else if((o|0)==10){c[h>>2]=f;g=0;}else if((o|0)==14){c[h>>2]=f;g=0;}else if((o|0)==16){c[h>>2]=f;g=0;}else if((o|0)==18)if((g-f|0)>0){c[h>>2]=f;switch(a[k+(d[f>>0]|0)>>0]|0){case 20:case 30:case 11:case 10:case 9:case 21:{g=27;break b}default:{}}g=0;}else g=-27;while(0);return g|0}function g$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;h=f;a:do if((h-e|0)>0){i=b+72|0;switch(a[i+(d[e>>0]|0)>>0]|0){case 27:{b=$_(b,e+1|0,f,g)|0;break a}case 20:{c[g>>2]=e+1;b=33;break a}case 24:case 22:{b:while(1){b=e+1|0;f=h-b|0;if((f|0)<=0){b=-1;break a}switch(a[i+(d[b>>0]|0)>>0]|0){case 24:case 22:{e=b;break}case 30:{j=8;break b}case 10:case 9:case 21:break b;default:{j=12;break b}}}if((j|0)==12){c[g>>2]=b;b=0;break a}c:do if((j|0)==8){if((f|0)<=1){b=-1;break a}switch(a[i+(d[e+2>>0]|0)>>0]|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=b;b=0;break a}while(0);c[g>>2]=b;b=16;break a}default:{c[g>>2]=e;b=0;break a}}}else b=-1;while(0);return b|0}function h$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;e=e+h|0;b:while(1){h=f-e|0;if((h|0)<=0){f=-20;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=17;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=28;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=20;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=23;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,e)|0)){h=26;break b}else h=4;break}default:{h=29;break b}}e=e+h|0;}if((h|0)==17){c[g>>2]=e;f=0;break}else if((h|0)==20){c[g>>2]=e;f=0;break}else if((h|0)==23){c[g>>2]=e;f=0;break}else if((h|0)==26){c[g>>2]=e;f=0;break}else if((h|0)==28){c[g>>2]=e;f=20;break}else if((h|0)==29){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function i$(){return 58220}function j$(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=l;l=l+16|0;g=i;c[g>>2]=d;h=c[b>>2]|0;a=f-(c[e>>2]|0)|0;if((d-h|0)>(a|0)){a=h+a|0;c[g>>2]=a;f=1;}else {f=0;a=d;}w_(h,g);h=c[g>>2]|0;d=c[b>>2]|0;g=h-d|0;W6(c[e>>2]|0,d|0,g|0)|0;c[b>>2]=(c[b>>2]|0)+g;c[e>>2]=(c[e>>2]|0)+g;l=i;return (f?2:h>>>0>>0&1)|0}function k$(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=d+72|0;k=f;l=h;m=c[e>>2]|0;n=c[g>>2]|0;a:while(1){d=m>>>0>>0;if(!(n>>>0>>0&d)){o=12;break}d=a[m>>0]|0;i=d&255;switch(a[j+i>>0]|0){case 5:{if((k-m|0)<2){d=1;break a}b[n>>1]=(d&31)<<6|a[m+1>>0]&63;m=m+2|0;n=n+2|0;continue a}case 6:{if((k-m|0)<3){d=1;break a}b[n>>1]=(a[m+1>>0]&63)<<6|i<<12|a[m+2>>0]&63;m=m+3|0;n=n+2|0;continue a}case 7:{if((l-n|0)<4){d=2;break a}if((k-m|0)<4){d=1;break a}i=((a[m+1>>0]&63)<<12|(d&7)<<18|(a[m+2>>0]&63)<<6|a[m+3>>0]&63)+-65536|0;b[n>>1]=i>>>10|55296;b[n+2>>1]=i&1023|56320;m=m+4|0;n=n+4|0;continue a}default:{b[n>>1]=d<<24>>24;m=m+1|0;n=n+2|0;continue a}}}if((o|0)==12)d=d?2:0;c[e>>2]=m;c[g>>2]=n;return d|0}function l$(a,b){a=a|0;b=b|0;a=d[b>>0]|0;b=d[b+1>>0]|0;return 1<<(b&31)&c[56940+(((d[144044+(a>>>2&7)>>0]|0)<<3|a<<1&6|b>>>5&1)<<2)>>2]|0}function m$(b,e){b=b|0;e=e|0;var f=0;f=d[e+1>>0]|0;b=d[e+2>>0]|0;return 1<<(b&31)&c[56940+(((d[144044+(f>>>2&15|a[e>>0]<<4&255)>>0]|0)<<3|f<<1&6|b>>>5&1)<<2)>>2]|0}function n$(a,b){a=a|0;b=b|0;return 0}function o$(a,b){a=a|0;b=b|0;a=d[b>>0]|0;b=d[b+1>>0]|0;return 1<<(b&31)&c[56940+(((d[143788+(a>>>2&7)>>0]|0)<<3|a<<1&6|b>>>5&1)<<2)>>2]|0}function p$(b,e){b=b|0;e=e|0;var f=0;f=d[e+1>>0]|0;b=d[e+2>>0]|0;return 1<<(b&31)&c[56940+(((d[143788+(f>>>2&15|a[e>>0]<<4&255)>>0]|0)<<3|f<<1&6|b>>>5&1)<<2)>>2]|0}function q$(a,b){a=a|0;b=b|0;if((d[b>>0]|0)<194)return 1;else {b=d[b+1>>0]|0;return b>>>7^1|(b&192|0)==192|0}return 0}function r$(b,c){b=b|0;c=c|0;var d=0;b=a[c+2>>0]|0;do if(b<<24>>24>-1)b=1;else {d=a[c>>0]|0;if(d<<24>>24==-17?(a[c+1>>0]|0)==-65:0)if((b&255)>189){b=1;break}else {b=191;c=-65;}else {if((b&255)>191){b=1;break}c=a[c+1>>0]|0;b=c&255;if(d<<24>>24==-32){b=(c&255)<160|(b&192|0)==192;break}}b=(b&128|0)==0?1:d<<24>>24==-19?(c&255)>159:(b&192|0)==192;}while(0);return b&1|0}function s$(b,c){b=b|0;c=c|0;var e=0;e=d[c+3>>0]|0;do if(!((e&128|0)==0|(e&192|0)==192)?(e=d[c+2>>0]|0,!((e&128|0)==0|(e&192|0)==192)):0){e=a[c>>0]|0;b=a[c+1>>0]|0;c=b&255;if(e<<24>>24==-16){b=(b&255)<144|(c&192|0)==192;break}else {b=(c&128|0)==0?1:e<<24>>24==-12?(b&255)>143:(c&192|0)==192;break}}else b=1;while(0);return b&1|0}function t$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){i=e;m=f-i|0;k=(m&1|0)==0;m=m&-2;l=(m|0)==0;m=k|l?f:e+m|0;if(k|l^1){f=a[e+1>>0]|0;if(!(f<<24>>24)){h=a[e>>0]|0;j=h;h=d[b+72+(h&255)>>0]|0;}else {h=a[e>>0]|0;j=h;h=J$(f,h)|0;}do switch(h|0){case 12:{f=V$(12,b,e+2|0,m,g)|0;break a}case 13:{f=V$(13,b,e+2|0,m,g)|0;break a}case 2:{h=e+2|0;if((m-h|0)<=1){f=-1;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;switch(f|0){case 16:{f=W$(b,e+4|0,m,g)|0;break a}case 15:{f=R$(b,e+4|0,m,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;f=29;break a}default:{c[g>>2]=h;f=0;break a}}}case 9:{if((e+2|0)==(m|0)){c[g>>2]=m;f=-15;break a}else i=7;break}case 10:case 21:{i=7;break}case 30:{f=L$(b,e+2|0,m,g)|0;break a}case 35:{c[g>>2]=e+2;f=38;break a}case 20:{c[g>>2]=e+2;f=25;break a}case 4:{h=e+2|0;f=m-h|0;if((f|0)<=1){f=-26;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){if((f|0)<=3){f=-1;break a}if((a[e+5>>0]|0)==0?(a[e+4>>0]|0)==62:0){c[g>>2]=e+6;f=34;break a}}c[g>>2]=h;f=26;break a}case 31:{c[g>>2]=e+2;f=23;break a}case 32:{h=e+2|0;if((m-h|0)<=1){f=-24;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;switch(f|0){case 33:{c[g>>2]=e+4;f=36;break a}case 15:{c[g>>2]=e+4;f=35;break a}case 34:{c[g>>2]=e+4;f=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;f=24;break a}default:{c[g>>2]=h;f=0;break a}}}case 36:{c[g>>2]=e+2;f=21;break a}case 11:{c[g>>2]=e+2;f=17;break a}case 19:{f=X$(b,e+2|0,m,g)|0;break a}case 5:{if((m-i|0)<2){f=-2;break a}c[g>>2]=e;f=0;break a}case 6:{if((m-i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((m-i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 24:case 22:{f=18;i=61;break}case 23:case 27:case 26:case 25:{f=19;i=61;break}case 29:{i=f&255;h=j&255;f=h>>>5;h=1<<(h&31);if(!(h&c[56940+((f|d[143788+i>>0]<<3)<<2)>>2]))if(!(c[56940+((d[144044+i>>0]<<3|f)<<2)>>2]&h))i=64;else {f=19;i=61;}else {f=18;i=61;}break}default:i=64;}while(0);if((i|0)==7){k=m;b=b+72|0;j=e;b:while(1){i=j;j=j+2|0;if((k-j|0)<=1){i=28;break}f=a[i+3>>0]|0;h=a[j>>0]|0;if(!(f<<24>>24))f=d[b+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 21:continue b;case 9:break;default:{i=27;break b}}if((i+4|0)==(m|0)){i=27;break}}if((i|0)==27){c[g>>2]=j;f=15;break}else if((i|0)==28){c[g>>2]=j;f=15;break}}else if((i|0)==61){l=b+72|0;h=e+2|0;c:while(1){e=f&255;d:while(1){k=m-h|0;if((k|0)<=1){i=104;break c}i=a[h+1>>0]|0;j=a[h>>0]|0;if(!(i<<24>>24))b=d[l+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 5:{i=73;break c}case 6:{i=74;break c}case 7:{i=76;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{i=78;break c}case 34:{i=94;break c}case 33:{i=97;break c}case 15:{i=100;break c}case 29:{k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){i=71;break c}break}case 27:case 26:case 25:case 24:case 22:break;case 23:{k=h+2|0;switch(e&63){case 41:{f=19;h=k;continue c}case 18:break d;default:{h=k;continue d}}}default:{i=103;break c}}h=h+2|0;}b=m-k|0;if((b|0)<=1){f=-1;break a}f=a[h+3>>0]|0;i=a[k>>0]|0;if(!(f<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(f,i)|0;switch(j|0){case 5:{i=89;break c}case 6:{i=90;break c}case 7:{i=92;break c}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(f&255)>>0]<<3)<<2)>>2])){i=87;break c}break}case 27:case 26:case 25:case 24:case 22:break;default:{f=19;h=k;continue c}}f=41;h=h+4|0;}switch(i|0){case 71:{c[g>>2]=h;f=0;break a}case 73:{c[g>>2]=h;f=0;break a}case 74:{if((k|0)<3){f=-2;break a}c[g>>2]=h;f=0;break a}case 76:{if((k|0)<4){f=-2;break a}c[g>>2]=h;f=0;break a}case 78:{c[g>>2]=h;break a}case 87:{c[g>>2]=k;f=0;break a}case 89:{c[g>>2]=k;f=0;break a}case 90:{if((b|0)<3){f=-2;break a}c[g>>2]=k;f=0;break a}case 92:{if((b|0)<4){f=-2;break a}c[g>>2]=k;f=0;break a}case 94:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=32;break a}case 97:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=31;break a}case 100:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=30;break a}case 103:{c[g>>2]=h;f=0;break a}case 104:{f=0-f|0;break a}}}else if((i|0)==64){c[g>>2]=e;f=0;break}}else f=-1;}else f=-4;while(0);return f|0}function u$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e+1>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e>>0]|0)>>0]|0;else f=J$(f,a[e>>0]|0)|0;do switch(f|0){case 2:{f=O$(b,e+2|0,i,g)|0;break a}case 3:{f=K$(b,e+2|0,i,g)|0;break a}case 9:{h=e+2|0;if((i-h|0)<=1){f=-3;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 4:{h=e+2|0;if((i-h|0)<=1){f=-5;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-5;break a}if((a[e+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=f;f=0;break a}else f=i;}else f=i;break}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:{h=e+2|0;f=i;}}while(0);j=b+72|0;b=h;b:while(1){e=f-b|0;if((e|0)<=1){h=52;break}h=a[b+1>>0]|0;i=a[b>>0]|0;if(!(h<<24>>24))h=d[j+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{h=50;break b}case 5:{b=b+2|0;continue b}case 6:{if((e|0)<3){h=38;break b}b=b+3|0;continue b}case 7:{if((e|0)<4){h=41;break b}b=b+4|0;continue b}case 4:{if((e|0)<=3){h=50;break b}h=b+2|0;if(a[b+3>>0]|0){b=h;continue b}if((a[h>>0]|0)!=93){b=h;continue b}if((e|0)<=5){h=50;break b}i=b+4|0;if(a[b+5>>0]|0){b=h;continue b}if((a[i>>0]|0)==62){h=49;break b}else {b=h;continue b}}default:{b=b+2|0;continue b}}}if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==41){c[g>>2]=b;f=6;break}else if((h|0)==49){c[g>>2]=i;f=0;break}else if((h|0)==50){c[g>>2]=b;f=6;break}else if((h|0)==52){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function v$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e+1>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e>>0]|0)>>0]|0;else f=J$(f,a[e>>0]|0)|0;switch(f|0){case 4:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-1;break a}if((a[e+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=e+6;f=40;break a}}break}case 9:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;i=f;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;i=f;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;i=f;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:h=e+2|0;}j=b+72|0;b=h;b:while(1){e=i-b|0;if((e|0)<=1){h=40;break}f=a[b+1>>0]|0;h=a[b>>0]|0;if(!(f<<24>>24))f=d[j+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 9:case 8:case 1:case 0:case 4:{h=38;break b}case 6:{if((e|0)<3){h=35;break b}else f=3;break}case 7:{if((e|0)<4){h=37;break b}else f=4;break}default:f=2;}b=b+f|0;}if((h|0)==35){c[g>>2]=b;f=6;break}else if((h|0)==37){c[g>>2]=b;f=6;break}else if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==40){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function w$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f-e|0;k=(k&1|0)==0?f:e+(k&-2)|0;j=b+72|0;i=0;f=e;a:while(1){h=k-f|0;if((h|0)<=1){f=-1;break}b=a[f+1>>0]|0;e=a[f>>0]|0;if(!(b<<24>>24))b=d[j+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 8:case 1:case 0:{l=12;break a}case 5:{h=i;f=f+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}h=i;f=f+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}h=i;f=f+4|0;i=h;continue a}case 2:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[f+3>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=33){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[f+5>>0]|0){h=i;f=b;i=h;continue a}h=(a[b>>0]|0)==91;i=i+(h&1)|0;f=h?f+6|0:b;continue a}case 4:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[f+3>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=93){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[f+5>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=62){h=i;f=b;i=h;continue a}f=f+6|0;if(!i){l=26;break a}i=i+-1|0;continue a}default:{h=i;f=f+2|0;i=h;continue a}}}if((l|0)==12){c[g>>2]=f;f=0;}else if((l|0)==26){c[g>>2]=f;f=42;}return f|0}function x$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=30;break}h=a[j+1>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 2:{i=14;break a}case 10:{i=15;break a}case 9:{i=18;break a}case 21:{i=25;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=K$(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14){c[g>>2]=j;h=0;break}else if((i|0)==15)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==18){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==25)if((j|0)==(e|0)){c[g>>2]=e+2;h=39;break}else {c[g>>2]=j;h=6;break}else if((i|0)==30){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function y$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=29;break}h=a[j+1>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 30:{i=14;break a}case 10:{i=17;break a}case 9:{i=20;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=K$(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14)if((j|0)==(e|0)){h=L$(b,e+2|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=j;h=6;break}else if((i|0)==17)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==20){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==29){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function z$(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=7;break}if((f-b|0)<2){b=0;break}if(a[b+1>>0]|0){b=0;break}if((a[b>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+2|0;}if((g|0)==7)b=(b|0)==(d|0)&1;return b|0}function A$(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=b+72|0;f=c;a:while(1){b=a[f+1>>0]|0;e=a[f>>0]|0;if(!(b<<24>>24))b=d[g+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 5:{b=2;break}case 6:{b=3;break}case 7:{b=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{b=2;break}default:break a}f=f+b|0;}return f-c|0}function B$(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;a:while(1){b=a[c+1>>0]|0;e=a[c>>0]|0;if(!(b<<24>>24))b=d[f+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 21:case 9:case 10:break;default:break a}c=c+2|0;}return c|0}function C$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=b+72|0;m=0;n=0;b=1;a:while(1){l=e+2|0;i=e+3|0;h=a[i>>0]|0;j=h<<24>>24==0;k=a[l>>0]|0;if(j)h=d[o+(k&255)>>0]|0;else h=J$(h,k)|0;do switch(h|0){case 5:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 6:{if(b|0){j=b;k=n;l=m;e=i;b=j;n=k;m=l;continue a}if((n|0)>=(f|0)){k=n;l=m;b=1;e=i;n=k;m=l;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;k=n;l=m;b=1;e=i;n=k;m=l;continue a}case 7:{if(!b)if((n|0)<(f|0)){c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;b=1;}else b=1;k=n;l=m;e=e+4|0;n=k;m=l;continue a}case 24:case 22:case 29:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 12:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=12;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=12;b=2;e=l;n=k;continue a}if((m|0)!=12){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=12;n=n+1|0;b=0;e=l;continue a}case 13:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=13;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=13;b=2;e=l;n=k;continue a}if((m|0)!=13){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=13;n=n+1|0;b=0;e=l;continue a}case 3:{if((n|0)>=(f|0)){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}case 21:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}i=g+(n<<4)+12|0;if(!(a[i>>0]|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}do if(j&(l|0)!=(c[g+(n<<4)+4>>2]|0)&k<<24>>24==32){h=a[e+5>>0]|0;b=a[e+4>>0]|0;if(!(h<<24>>24)){if(b<<24>>24==32)break;b=d[o+(b&255)>>0]|0;}else b=J$(h,b)|0;if((b|0)!=(m|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}}while(0);a[i>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 10:case 9:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 17:case 11:if((b|0)==2){j=n;k=m;b=2;e=l;n=j;m=k;continue a}else break a;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}while(0)}return n|0}function D$(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+4|0;a:do if((a[c+5>>0]|0)==0?(a[b>>0]|0)==120:0){c=c+6|0;b=0;while(1){b:while(1){if(!(a[c+1>>0]|0)){d=a[c>>0]|0;if(d<<24>>24==59){e=17;break a}d=d<<24>>24;switch(d|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=8;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=9;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=10;break b}default:{}}}c=c+2|0;}if((e|0)==8){e=0;b=d+-48|b<<4;}else if((e|0)==9){e=0;b=(b<<4)+-55+d|0;}else if((e|0)==10){e=0;b=(b<<4)+-87+d|0;}if((b|0)<1114112)c=c+2|0;else {b=-1;break}}}else {d=b;b=0;e=13;}while(0);c:do if((e|0)==13)while(1){e=0;if(!(a[d+1>>0]|0)){c=a[d>>0]|0;if(c<<24>>24==59){e=17;break c}c=c<<24>>24;}else c=-1;b=(b*10|0)+-48+c|0;if((b|0)>=1114112){b=-1;break}else {d=d+2|0;e=13;}}while(0);if((e|0)==17)b=A_(b)|0;return b|0}function E$(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch((d-c|0)/2|0|0){case 2:{if((a[c+3>>0]|0)==0?(a[c+2>>0]|0)==116:0){if(!(a[c+1>>0]|0))b=a[c>>0]|0;else b=-1;b=(b|0)==108?60:(b|0)==103?62:0;}else e=27;break}case 3:{if((((((a[c+1>>0]|0)==0?(a[c>>0]|0)==97:0)?(a[c+3>>0]|0)==0:0)?(a[c+2>>0]|0)==109:0)?(a[c+5>>0]|0)==0:0)?(a[c+4>>0]|0)==112:0)b=38;else e=27;break}case 4:{if(!(a[c+1>>0]|0))switch(a[c>>0]|0){case 113:{if(a[c+3>>0]|0){e=27;break a}if((a[c+2>>0]|0)!=117){e=27;break a}if(a[c+5>>0]|0){e=27;break a}if((a[c+4>>0]|0)!=111){e=27;break a}if(a[c+7>>0]|0){e=27;break a}if((a[c+6>>0]|0)==116){b=34;break a}else {e=27;break a}}case 97:{if(a[c+3>>0]|0){e=27;break a}if((a[c+2>>0]|0)!=112){e=27;break a}if(a[c+5>>0]|0){e=27;break a}if((a[c+4>>0]|0)!=111){e=27;break a}if(a[c+7>>0]|0){e=27;break a}if((a[c+6>>0]|0)==115){b=39;break a}else {e=27;break a}}default:{e=27;break a}}else e=27;break}default:e=27;}while(0);if((e|0)==27)b=0;return b|0}function F$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=b+72|0;k=g+4|0;while(1){if((f-e|0)<=1)break;b=a[e+1>>0]|0;h=a[e>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;switch(b|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[k>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+2|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;i=e+2|0;if((f-i|0)>1){b=a[e+3>>0]|0;h=a[i>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;e=(b|0)==10?e+4|0:i;}else e=i;c[k>>2]=-1;break}default:e=e+2|0;}c[k>>2]=(c[k>>2]|0)+1;}return}function G$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f+-2|0;i=b+72|0;f=e;a:while(1){h=f+2|0;if((j-h|0)<=1){f=1;break}f=a[f+3>>0]|0;b=f<<24>>24==0;e=a[h>>0]|0;if(b)f=d[i+(e&255)>>0]|0;else f=J$(f,e)|0;switch(f|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:{f=h;continue a}case 21:if(b&e<<24>>24==9){k=12;break a}else {f=h;continue a}case 22:case 26:{if(!b){k=12;break a}if(e<<24>>24>=0){f=h;continue a}break}default:if(!b){k=12;break a}}switch(e<<24>>24|0){case 64:case 36:{f=h;break}default:{k=12;break a}}}if((k|0)==12){c[g>>2]=h;f=0;}return f|0}function H$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[e>>2]|0;k=j+(f-j&-2)|0;l=k;m=h;a:while(1){if(j>>>0>=k>>>0){b=0;break}i=a[j>>0]|0;b=a[j+1>>0]|0;f=b&255;switch(b<<24>>24){case 0:{if(i<<24>>24>-1){b=c[g>>2]|0;if((b|0)==(h|0)){b=2;break a}c[g>>2]=b+1;a[b>>0]=i;b=j;}else n=7;break}case 7:case 6:case 5:case 4:case 3:case 2:case 1:{n=7;break}case -37:case -38:case -39:case -40:{b=c[g>>2]|0;if((m-b|0)<4){b=2;break a}if((l-j|0)<4){b=1;break a}o=i&255;i=(f<<2&12|o>>>6)+1|0;c[g>>2]=b+1;a[b>>0]=i>>>2|240;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>2&15|i<<4&48|128;b=j+2|0;i=d[b>>0]|0;f=(o<<4&48|i>>>6|a[j+3>>0]<<2&12|128)&255;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=f;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=i&63|128;break}default:{b=c[g>>2]|0;if((m-b|0)<3){b=2;break a}c[g>>2]=b+1;a[b>>0]=f>>>4|224;o=i&255;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2&60|128;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}}if((n|0)==7){n=0;b=c[g>>2]|0;if((m-b|0)<2){b=2;break}o=i&255;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2|192;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}j=b+2|0;}c[e>>2]=j;return b|0}function I$(e,f,g,h,i){e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0;j=c[f>>2]|0;l=g-j&-2;e=j+l|0;if((l|0)>(i-(c[h>>2]|0)|0)){k=e+-2|0;g=(a[k+1>>0]&-8)<<24>>24==-40;l=g&1;e=g?k:e;}else l=0;g=j;while(1){j=g>>>0>>0;k=c[h>>2]|0;if(!(j&k>>>0>>0))break;j=((d[g+1>>0]|0)<<8|(d[g>>0]|0))&65535;c[h>>2]=k+2;b[k>>1]=j;k=(c[f>>2]|0)+2|0;c[f>>2]=k;g=k;}return ((k|0)!=(i|0)|j^1?l:2)|0}function J$(a,b){a=a|0;b=b|0;var c=0;switch(a<<24>>24){case -37:case -38:case -39:case -40:{a=7;break}case -33:case -34:case -35:case -36:{a=8;break}case -1:{if((b&255)>253)a=0;else c=4;break}default:c=4;}if((c|0)==4)a=29;return a|0}function K$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=f;j=l-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;b=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;b=0;break a}case 6:{if((j|0)<3){b=-2;break a}c[g>>2]=e;b=0;break a}case 7:{if((j|0)<4){b=-2;break a}c[g>>2]=e;b=0;break a}case 19:{b=M$(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;b=0;break a}}k=b+72|0;j=e;b:while(1){i=j+2|0;e=l-i|0;if((e|0)<=1){b=-1;break a}b=a[j+3>>0]|0;h=a[i>>0]|0;if(!(b<<24>>24))f=d[k+(h&255)>>0]|0;else f=J$(b,h)|0;switch(f|0){case 27:case 26:case 25:case 24:case 22:{j=i;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=h&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(b&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else j=i;}if((h|0)==22){c[g>>2]=i;b=0;break}else if((h|0)==23){c[g>>2]=i;b=0;break}else if((h|0)==24){if((e|0)<3){b=-2;break}c[g>>2]=i;b=0;break}else if((h|0)==26){if((e|0)<4){b=-2;break}c[g>>2]=i;b=0;break}else if((h|0)==28){c[g>>2]=j+4;b=9;break}else if((h|0)==29){c[g>>2]=i;b=0;break}}else b=-1;while(0);return b|0}function L$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){k=b+2|0;e=f-k|0;if((e|0)<=1){f=-1;break a}h=a[b+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:{b=k;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else b=k;}if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){c[g>>2]=k;f=0;break}else if((h|0)==24){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==26){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==28){c[g>>2]=b+4;f=28;break}else if((h|0)==29){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function M$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=f;a:do if((k-e|0)>1){i=a[e+1>>0]|0;h=a[e>>0]|0;do if(!(i<<24>>24))if(h<<24>>24==120){h=N$(b,e+2|0,f,g)|0;break a}else {h=d[b+72+(h&255)>>0]|0;break}else h=J$(i,h)|0;while(0);if((h|0)!=25){c[g>>2]=e;h=0;break}j=b+72|0;b=e;b:while(1){i=b+2|0;if((k-i|0)<=1){h=-1;break a}h=a[b+3>>0]|0;f=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(f&255)>>0]|0;else h=J$(h,f)|0;switch(h|0){case 25:{b=i;break}case 18:{f=15;break b}default:{f=16;break b}}}if((f|0)==15){c[g>>2]=b+4;h=10;break}else if((f|0)==16){c[g>>2]=i;h=0;break}}else h=-1;while(0);return h|0}function N$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;a:do if((f-e|0)>1){h=a[e+1>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e>>0]|0)>>0]|0;else h=J$(h,a[e>>0]|0)|0;if((h&-2|0)!=24){c[g>>2]=e;f=0;break}j=b+72|0;b:while(1){i=e+2|0;if((f-i|0)<=1){f=-1;break a}h=a[e+3>>0]|0;b=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 25:{e=i;break}case 18:{h=13;break b}default:{h=14;break b}}}if((h|0)==13){c[g>>2]=e+4;f=10;break}else if((h|0)==14){c[g>>2]=i;f=0;break}}else f=-1;while(0);return f|0}function O$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=f;j=o-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;h=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;h=0;break a}case 6:{if((j|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 7:{if((j|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 16:{i=e+2|0;if((o-i|0)<=1){h=-1;break a}h=a[e+3>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[i>>0]|0)>>0]|0;else h=J$(h,a[i>>0]|0)|0;switch(h|0){case 27:{h=P$(b,e+4|0,f,g)|0;break a}case 20:{h=Q$(e+4|0,f,g)|0;break a}default:{c[g>>2]=i;h=0;break a}}}case 15:{h=R$(b,e+2|0,f,g)|0;break a}case 17:{h=S$(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}m=b+72|0;l=0;h=e+2|0;b:while(1){c:while(1){i=o-h|0;if((i|0)<=1){h=-1;break a}j=a[h+1>>0]|0;k=a[h>>0]|0;if(!(j<<24>>24))e=d[m+(k&255)>>0]|0;else e=J$(j,k)|0;switch(e|0){case 5:{n=34;break b}case 6:{n=35;break b}case 7:{n=37;break b}case 10:case 9:case 21:{n=55;break b}case 11:{n=69;break b}case 17:break b;case 23:break c;case 29:{e=k&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(j&255)>>0]<<3)<<2)>>2])){n=32;break b}break}case 27:case 26:case 25:case 24:case 22:break;default:{n=75;break b}}h=h+2|0;}if(l|0){n=40;break}k=h+2|0;e=o-k|0;if((e|0)<=1){h=-1;break a}l=a[h+3>>0]|0;i=a[k>>0]|0;if(!(l<<24>>24))j=d[m+(i&255)>>0]|0;else j=J$(l,i)|0;switch(j|0){case 5:{n=49;break b}case 6:{n=50;break b}case 7:{n=52;break b}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[143788+(l&255)>>0]<<3)<<2)>>2])){n=47;break b}break}case 24:case 22:break;default:{n=54;break b}}l=1;h=h+4|0;}d:switch(n|0){case 32:{c[g>>2]=h;h=0;break a}case 34:{c[g>>2]=h;h=0;break a}case 35:{if((i|0)<3){h=-2;break a}c[g>>2]=h;h=0;break a}case 37:{if((i|0)<4){h=-2;break a}c[g>>2]=h;h=0;break a}case 40:{c[g>>2]=h;h=0;break a}case 47:{c[g>>2]=k;h=0;break a}case 49:{c[g>>2]=k;h=0;break a}case 50:{if((e|0)<3){h=-2;break a}c[g>>2]=k;h=0;break a}case 52:{if((e|0)<4){h=-2;break a}c[g>>2]=k;h=0;break a}case 54:{c[g>>2]=k;h=0;break a}case 55:{e:while(1){n=0;i=h+2|0;j=o-i|0;if((j|0)<=1){h=-1;break a}k=a[h+3>>0]|0;e=a[i>>0]|0;if(!(k<<24>>24))l=d[m+(e&255)>>0]|0;else l=J$(k,e)|0;switch(l|0){case 11:{h=i;n=69;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;n=55;break}case 29:{n=60;break e}case 24:case 22:break e;case 5:{n=63;break e}case 6:{n=64;break e}case 7:{n=66;break e}default:{n=68;break e}}}if((n|0)==60){o=e&255;if(!(1<<(o&31)&c[56940+((o>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=i;h=0;break a}}else if((n|0)==63){c[g>>2]=i;h=0;break a}else if((n|0)==64){if((j|0)<3){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==66){if((j|0)<4){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==68){c[g>>2]=i;h=0;break a}h=T$(b,h+4|0,f,g)|0;break a}case 75:{c[g>>2]=h;h=0;break a}}if((n|0)==69){c[g>>2]=h+2;h=2;break}i=h+2|0;if((o-i|0)>1){if((a[h+3>>0]|0)==0?(a[i>>0]|0)==62:0){c[g>>2]=h+4;h=4;break}c[g>>2]=i;h=0;}else h=-1;}else h=-1;while(0);return h|0}function P$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f;a:do if((j-e|0)>1){if((a[e+1>>0]|0)==0?(a[e>>0]|0)==45:0){i=b+72|0;h=e+2|0;b:while(1){e=j-h|0;if((e|0)<=1){f=-1;break a}f=a[h+1>>0]|0;b=a[h>>0]|0;if(!(f<<24>>24))f=d[i+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 8:case 1:case 0:{k=16;break b}case 5:{h=h+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}h=h+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}h=h+4|0;continue b}case 27:{f=h+2|0;if((j-f|0)<=1){f=-1;break a}if(a[h+3>>0]|0){h=f;continue b}if((a[f>>0]|0)==45)break b;else {h=f;continue b}}default:{h=h+2|0;continue b}}}if((k|0)==16){c[g>>2]=h;f=0;break}f=h+4|0;if((j-f|0)<=1){f=-1;break}if((a[h+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=h+6;f=13;break}c[g>>2]=f;f=0;break}c[g>>2]=e;f=0;}else f=-1;while(0);return f|0}function Q$(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>11){d=0;while(1){if((d|0)>=6){d=8;break}if(a[b+1>>0]|0){d=0;break}if((a[b>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+2|0;}c[e>>2]=b;}else d=-1;return d|0}function R$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;j=o-e|0;a:do if((j|0)>1){f=a[e+1>>0]|0;if(!(f<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(f,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(f&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}m=b+72|0;k=e;b:while(1){f=k+2|0;h=o-f|0;if((h|0)<=1){f=-1;break a}i=a[k+3>>0]|0;j=a[f>>0]|0;if(!(i<<24>>24))b=d[m+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 27:case 26:case 25:case 24:case 22:{k=f;continue b}case 5:{n=22;break b}case 6:{n=23;break b}case 7:{n=25;break b}case 10:case 9:case 21:{n=27;break b}case 15:{n=46;break b}case 29:break;default:break b}k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){n=21;break}else k=f;}if((n|0)==21){c[g>>2]=f;f=0;break}else if((n|0)==22){c[g>>2]=f;f=0;break}else if((n|0)==23){if((h|0)<3){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==25){if((h|0)<4){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==27){if(!(U$(e,f,p)|0)){c[g>>2]=f;f=0;break}j=k+4|0;c:while(1){i=o-j|0;if((i|0)<=1){f=-1;break a}f=a[j+1>>0]|0;h=a[j>>0]|0;if(!(f<<24>>24))f=d[m+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 8:case 1:case 0:{n=40;break c}case 5:{j=j+2|0;continue c}case 6:{if((i|0)<3){f=-2;break a}j=j+3|0;continue c}case 7:{if((i|0)<4){f=-2;break a}j=j+4|0;continue c}case 15:{f=j+2|0;if((o-f|0)<=1){f=-1;break a}if(a[j+3>>0]|0){j=f;continue c}if((a[f>>0]|0)==62){n=44;break c}else {j=f;continue c}}default:{j=j+2|0;continue c}}}if((n|0)==40){c[g>>2]=j;f=0;break}else if((n|0)==44){c[g>>2]=j+4;f=c[p>>2]|0;break}}else if((n|0)==46){if(!(U$(e,f,p)|0)){c[g>>2]=f;f=0;break}f=k+4|0;if((o-f|0)<=1){f=-1;break}if((a[k+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=k+6;f=c[p>>2]|0;break}}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function S$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){j=b+2|0;e=f-j|0;if((e|0)<=1){f=-1;break a}h=a[b+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))k=d[l+(i&255)>>0]|0;else k=J$(h,i)|0;switch(k|0){case 23:case 27:case 26:case 25:case 24:case 22:{b=j;continue b}case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 10:case 9:case 21:{h=27;break b}case 11:{h=34;break b}case 29:break;default:{h=35;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}else b=j;}if((h|0)==21){c[g>>2]=j;f=0;break}else if((h|0)==22){c[g>>2]=j;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==27){c:while(1){k=j+2|0;if((f-k|0)<=1){f=-1;break a}h=a[j+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 21:{j=k;h=27;break}case 11:{h=32;break c}default:{h=33;break c}}}if((h|0)==32){c[g>>2]=j+4;f=5;break}else if((h|0)==33){c[g>>2]=k;f=0;break}}else if((h|0)==34){c[g>>2]=b+4;f=5;break}else if((h|0)==35){c[g>>2]=j;f=0;break}}else f=-1;while(0);return f|0}function T$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;c[q>>2]=e;r=f;o=b+72|0;h=0;a:while(1){b:while(1){m=r-e|0;if((m|0)<=1){e=-1;break a}i=a[e+1>>0]|0;j=a[e>>0]|0;if(!(i<<24>>24))k=d[o+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{p=11;break a}case 6:{p=12;break a}case 7:{p=14;break a}case 23:{p=16;break b}case 10:case 9:case 21:{p=31;break b}case 14:{p=37;break b}case 29:{n=j&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){p=9;break a}break}case 27:case 26:case 25:case 24:case 22:break;default:{p=89;break a}}n=e+2|0;c[q>>2]=n;e=n;}c:do if((p|0)==16){p=0;if(h|0){p=17;break a}h=e+2|0;c[q>>2]=h;i=h;j=r-i|0;if((j|0)<=1){e=-1;break a}k=a[e+3>>0]|0;m=a[h>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=25;break a}case 6:{p=26;break a}case 7:{p=28;break a}case 24:case 22:{h=1;break c}case 29:break;default:{p=30;break a}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=24;break a}else h=1;}else if((p|0)==31)while(1){p=0;i=e+2|0;c[q>>2]=i;j=i;if((r-j|0)<=1){e=-1;break a}e=a[e+3>>0]|0;h=a[i>>0]|0;if(!(e<<24>>24))e=d[o+(h&255)>>0]|0;else e=J$(e,h)|0;switch(e|0){case 14:{e=i;p=37;break c}case 9:case 10:case 21:{e=i;p=31;break}default:{p=36;break a}}}while(0);d:do if((p|0)==37){while(1){p=0;j=e+2|0;c[q>>2]=j;k=j;if((r-k|0)<=1){e=-1;break a}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))m=d[o+(i&255)>>0]|0;else m=J$(h,i)|0;if((m|1|0)==13)break;switch(m|0){case 9:case 10:case 21:{e=j;p=37;break}default:{p=43;break a}}}e=e+4|0;c[q>>2]=e;e:while(1){j=r-e|0;if((j|0)<=1){e=-1;break a}h=a[e+1>>0]|0;i=a[e>>0]|0;if(!(h<<24>>24))h=d[o+(i&255)>>0]|0;else h=J$(h,i)|0;if((h|0)==(m|0))break;switch(h|0){case 8:case 1:case 0:{p=56;break a}case 2:{p=61;break a}case 5:{n=e+2|0;c[q>>2]=n;e=n;continue e}case 6:{if((j|0)<3){e=-2;break a}n=e+3|0;c[q>>2]=n;e=n;continue e}case 7:{if((j|0)<4){e=-2;break a}n=e+4|0;c[q>>2]=n;e=n;continue e}case 3:{e=K$(b,e+2|0,f,q)|0;if((e|0)<1){p=59;break a}e=c[q>>2]|0;continue e}default:{n=e+2|0;c[q>>2]=n;e=n;continue e}}}i=e+2|0;c[q>>2]=i;k=i;if((r-k|0)<=1){e=-1;break a}h=a[e+3>>0]|0;j=a[i>>0]|0;if(!(h<<24>>24))h=d[o+(j&255)>>0]|0;else h=J$(h,j)|0;switch(h|0){case 11:{p=81;break a}case 17:{p=82;break a}case 10:case 9:case 21:{e=i;break}default:{p=68;break a}}f:while(1){i=e+2|0;c[q>>2]=i;h=i;j=r-h|0;if((j|0)<=1){e=-1;break a}k=a[e+3>>0]|0;m=a[i>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=76;break a}case 6:{p=77;break a}case 7:{p=79;break a}case 11:{p=81;break a}case 17:{p=82;break a}case 24:case 22:{h=0;break d}case 10:case 9:case 21:{e=i;break}case 29:break f;default:{p=87;break a}}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=75;break a}else h=0;}while(0);e=e+4|0;c[q>>2]=e;}switch(p|0){case 9:{c[g>>2]=e;e=0;break}case 11:{c[g>>2]=e;e=0;break}case 12:{if((m|0)<3)e=-2;else {c[g>>2]=e;e=0;}break}case 14:{if((m|0)<4)e=-2;else {c[g>>2]=e;e=0;}break}case 17:{c[g>>2]=e;e=0;break}case 24:{c[g>>2]=h;e=0;break}case 25:{c[g>>2]=h;e=0;break}case 26:{if((j|0)<3)e=-2;else {c[g>>2]=h;e=0;}break}case 28:{if((j|0)<4)e=-2;else {c[g>>2]=h;e=0;}break}case 30:{c[g>>2]=i;e=0;break}case 36:{c[g>>2]=j;e=0;break}case 43:{c[g>>2]=k;e=0;break}case 56:{c[g>>2]=e;e=0;break}case 59:{if(!e){c[g>>2]=c[q>>2];e=0;}break}case 61:{c[g>>2]=e;e=0;break}case 68:{c[g>>2]=k;e=0;break}case 75:{c[g>>2]=i;e=0;break}case 76:{c[g>>2]=i;e=0;break}case 77:{if((j|0)<3)e=-2;else {c[g>>2]=i;e=0;}break}case 79:{if((j|0)<4)e=-2;else {c[g>>2]=i;e=0;}break}case 81:{c[g>>2]=e+4;e=1;break}case 82:{h=i+2|0;c[q>>2]=h;e=h;if((r-e|0)>1){if((a[i+3>>0]|0)==0?(a[h>>0]|0)==62:0){c[g>>2]=i+4;e=3;break}c[g>>2]=e;e=0;}else e=-1;break}case 87:{c[g>>2]=h;e=0;break}case 89:{c[g>>2]=e;e=0;break}}l=s;return e|0}function U$(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==6?(a[b+1>>0]|0)==0:0){switch(a[b>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}if(!(a[b+3>>0]|0)){switch(a[b+2>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}if(!(a[b+5>>0]|0)){switch(a[b+4>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;}else d=1;}else d=1;while(0);return d|0}function V$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;k=e+72|0;a:while(1){b:while(1){j=g-f|0;if((j|0)<=1){f=-1;break a}e=a[f+1>>0]|0;i=a[f>>0]|0;if(!(e<<24>>24))e=d[k+(i&255)>>0]|0;else e=J$(e,i)|0;switch(e|0){case 8:case 1:case 0:{l=10;break a}case 6:{l=9;break b}case 7:{l=19;break b}case 5:{f=f+2|0;continue b}case 13:case 12:{i=f+2|0;if((e|0)==(b|0)){l=12;break a}else {f=i;continue b}}default:{f=f+2|0;continue b}}}if((l|0)==9){l=0;if((j|0)<3){f=-2;break}else {f=f+3|0;continue}}else if((l|0)==19){l=0;if((j|0)<4){f=-2;break}else {f=f+4|0;continue}}}c:do if((l|0)==10){c[h>>2]=f;f=0;}else if((l|0)==12)if((g-i|0)>1){c[h>>2]=i;g=a[f+3>>0]|0;f=a[i>>0]|0;if(!(g<<24>>24))f=d[k+(f&255)>>0]|0;else f=J$(g,f)|0;switch(f|0){case 20:case 30:case 11:case 10:case 9:case 21:{f=27;break c}default:{}}f=0;}else f=-27;while(0);return f|0}function W$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;a:do if((k-e|0)>1){h=a[e+1>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e>>0]|0)>>0]|0;else h=J$(h,a[e>>0]|0)|0;switch(h|0){case 27:{h=P$(b,e+2|0,f,g)|0;break a}case 20:{c[g>>2]=e+2;h=33;break a}case 24:case 22:{j=b+72|0;b:while(1){i=e+2|0;f=k-i|0;if((f|0)<=1){h=-1;break a}h=a[e+3>>0]|0;b=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 22:{e=i;break}case 30:{l=15;break b}case 10:case 9:case 21:break b;default:{l=22;break b}}}if((l|0)==22){c[g>>2]=i;h=0;break a}c:do if((l|0)==15){if((f|0)<=3){h=-1;break a}b=a[e+5>>0]|0;h=a[e+4>>0]|0;if(!(b<<24>>24))h=d[j+(h&255)>>0]|0;else h=J$(b,h)|0;switch(h|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=i;h=0;break a}while(0);c[g>>2]=i;h=16;break a}default:{c[g>>2]=e;h=0;break a}}}else h=-1;while(0);return h|0}function X$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}b=b+72|0;k=e;b:while(1){h=k;k=k+2|0;e=f-k|0;if((e|0)<=1){f=-20;break a}h=a[h+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))j=d[b+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:continue b;case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=27;break b}case 29:break;default:{h=28;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}}if((h|0)==21){c[g>>2]=k;f=0;break}else if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==27){c[g>>2]=k;f=20;break}else if((h|0)==28){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function Y$(b,d,e){b=b|0;d=d|0;e=e|0;e=Z$(e)|0;if((e|0)==-1)e=0;else {a[b+69>>0]=e;c[b>>2]=67;c[b+4>>2]=68;c[b+48>>2]=31;c[b+72>>2]=d;c[d>>2]=b;e=1;}return e|0}function Z$(a){a=a|0;var b=0;a:do if(!a)b=6;else {b=0;while(1){if((b|0)>=6){b=-1;break a}if(H0(a,c[60068+(b<<2)>>2]|0)|0)break a;b=b+1|0;}}while(0);return b|0}function _$(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(58948,a,0,b,c,d)|0}function $$(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(58948,a,1,b,c,d)|0}function a0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S_(58584,b,c,d);return}function b0(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;a:do if(f>>>0>>0){l=c[d+72>>2]|0;i=f+1|0;b:do if((i|0)==(g|0)){i=a[d+69>>0]|0;if(((i<<24>>24)+-3|0)>>>0<3){i=-1;break a}switch(a[f>>0]|0){case 60:case 0:{i=-1;break a}case -17:case -1:case -2:break;default:break b}if(!((e|0)==1&i<<24>>24==0)){i=-1;break a}}else {k=a[f>>0]|0;i=a[i>>0]|0;j=((k&255)<<8|i&255)&65535;c:do if(j<<16>>16<-2){if(j<<16>>16>=-257){switch(j<<16>>16){case -257:break;default:break c}if((e|0)==1&(a[d+69>>0]|0)==0)break b;c[h>>2]=f+2;c[l>>2]=c[b+16>>2];i=14;break a}switch(j<<16>>16){case -4165:break;default:break c}if((e|0)==1)switch(a[d+69>>0]|0){case 0:case 3:case 4:case 5:break b;default:{}}i=f+2|0;if((i|0)==(g|0)){i=-1;break a}if((a[i>>0]|0)!=-65)break b;c[h>>2]=f+3;c[l>>2]=c[b+8>>2];i=14;break a}else {if(j<<16>>16<15360){switch(j<<16>>16){case -2:break;default:break c}if((e|0)==1&(a[d+69>>0]|0)==0)break b;c[h>>2]=f+2;c[l>>2]=c[b+20>>2];i=14;break a}switch(j<<16>>16){case 15360:break;default:break c}i=a[d+69>>0]|0;if(i<<24>>24==4){if((e|0)==1)break b}else if((e|0)==1&i<<24>>24==3)break b;i=c[b+20>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}while(0);if(k<<24>>24){if((e|0)==1|i<<24>>24!=0)break;i=c[b+20>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}if((e|0)==1?(a[d+69>>0]|0)==5:0)break;i=c[b+16>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}while(0);i=c[b+(a[d+69>>0]<<2)>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;}else i=-4;while(0);return i|0}function c0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){i=e;m=f-i|0;k=(m&1|0)==0;m=m&-2;l=(m|0)==0;m=k|l?f:e+m|0;if(k|l^1){f=a[e>>0]|0;if(!(f<<24>>24)){h=a[e+1>>0]|0;j=h;h=d[b+72+(h&255)>>0]|0;}else {h=a[e+1>>0]|0;j=h;h=J$(f,h)|0;}do switch(h|0){case 12:{f=D0(12,b,e+2|0,m,g)|0;break a}case 13:{f=D0(13,b,e+2|0,m,g)|0;break a}case 2:{h=e+2|0;if((m-h|0)<=1){f=-1;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;switch(f|0){case 16:{f=E0(b,e+4|0,m,g)|0;break a}case 15:{f=z0(b,e+4|0,m,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;f=29;break a}default:{c[g>>2]=h;f=0;break a}}}case 9:{if((e+2|0)==(m|0)){c[g>>2]=m;f=-15;break a}else i=7;break}case 10:case 21:{i=7;break}case 30:{f=t0(b,e+2|0,m,g)|0;break a}case 35:{c[g>>2]=e+2;f=38;break a}case 20:{c[g>>2]=e+2;f=25;break a}case 4:{h=e+2|0;f=m-h|0;if((f|0)<=1){f=-26;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){if((f|0)<=3){f=-1;break a}if((a[e+4>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=e+6;f=34;break a}}c[g>>2]=h;f=26;break a}case 31:{c[g>>2]=e+2;f=23;break a}case 32:{h=e+2|0;if((m-h|0)<=1){f=-24;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;switch(f|0){case 33:{c[g>>2]=e+4;f=36;break a}case 15:{c[g>>2]=e+4;f=35;break a}case 34:{c[g>>2]=e+4;f=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;f=24;break a}default:{c[g>>2]=h;f=0;break a}}}case 36:{c[g>>2]=e+2;f=21;break a}case 11:{c[g>>2]=e+2;f=17;break a}case 19:{f=F0(b,e+2|0,m,g)|0;break a}case 5:{if((m-i|0)<2){f=-2;break a}c[g>>2]=e;f=0;break a}case 6:{if((m-i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((m-i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 24:case 22:{f=18;i=61;break}case 23:case 27:case 26:case 25:{f=19;i=61;break}case 29:{i=f&255;h=j&255;f=h>>>5;h=1<<(h&31);if(!(h&c[56940+((f|d[143788+i>>0]<<3)<<2)>>2]))if(!(c[56940+((d[144044+i>>0]<<3|f)<<2)>>2]&h))i=64;else {f=19;i=61;}else {f=18;i=61;}break}default:i=64;}while(0);if((i|0)==7){k=m;b=b+72|0;j=e;b:while(1){i=j;j=j+2|0;if((k-j|0)<=1){i=28;break}f=a[j>>0]|0;h=a[i+3>>0]|0;if(!(f<<24>>24))f=d[b+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 21:continue b;case 9:break;default:{i=27;break b}}if((i+4|0)==(m|0)){i=27;break}}if((i|0)==27){c[g>>2]=j;f=15;break}else if((i|0)==28){c[g>>2]=j;f=15;break}}else if((i|0)==61){l=b+72|0;h=e+2|0;c:while(1){e=f&255;d:while(1){k=m-h|0;if((k|0)<=1){i=104;break c}i=a[h>>0]|0;j=a[h+1>>0]|0;if(!(i<<24>>24))b=d[l+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 5:{i=73;break c}case 6:{i=74;break c}case 7:{i=76;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{i=78;break c}case 34:{i=94;break c}case 33:{i=97;break c}case 15:{i=100;break c}case 29:{k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){i=71;break c}break}case 27:case 26:case 25:case 24:case 22:break;case 23:{k=h+2|0;switch(e&63){case 41:{f=19;h=k;continue c}case 18:break d;default:{h=k;continue d}}}default:{i=103;break c}}h=h+2|0;}b=m-k|0;if((b|0)<=1){f=-1;break a}f=a[k>>0]|0;i=a[h+3>>0]|0;if(!(f<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(f,i)|0;switch(j|0){case 5:{i=89;break c}case 6:{i=90;break c}case 7:{i=92;break c}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(f&255)>>0]<<3)<<2)>>2])){i=87;break c}break}case 27:case 26:case 25:case 24:case 22:break;default:{f=19;h=k;continue c}}f=41;h=h+4|0;}switch(i|0){case 71:{c[g>>2]=h;f=0;break a}case 73:{c[g>>2]=h;f=0;break a}case 74:{if((k|0)<3){f=-2;break a}c[g>>2]=h;f=0;break a}case 76:{if((k|0)<4){f=-2;break a}c[g>>2]=h;f=0;break a}case 78:{c[g>>2]=h;break a}case 87:{c[g>>2]=k;f=0;break a}case 89:{c[g>>2]=k;f=0;break a}case 90:{if((b|0)<3){f=-2;break a}c[g>>2]=k;f=0;break a}case 92:{if((b|0)<4){f=-2;break a}c[g>>2]=k;f=0;break a}case 94:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=32;break a}case 97:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=31;break a}case 100:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=30;break a}case 103:{c[g>>2]=h;f=0;break a}case 104:{f=0-f|0;break a}}}else if((i|0)==64){c[g>>2]=e;f=0;break}}else f=-1;}else f=-4;while(0);return f|0}function d0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+1>>0]|0)>>0]|0;else f=J$(f,a[e+1>>0]|0)|0;do switch(f|0){case 2:{f=w0(b,e+2|0,i,g)|0;break a}case 3:{f=s0(b,e+2|0,i,g)|0;break a}case 9:{h=e+2|0;if((i-h|0)<=1){f=-3;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 4:{h=e+2|0;if((i-h|0)<=1){f=-5;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-5;break a}if((a[f>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=f;f=0;break a}else f=i;}else f=i;break}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:{h=e+2|0;f=i;}}while(0);j=b+72|0;b=h;b:while(1){e=f-b|0;if((e|0)<=1){h=52;break}h=a[b>>0]|0;i=a[b+1>>0]|0;if(!(h<<24>>24))h=d[j+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{h=50;break b}case 5:{b=b+2|0;continue b}case 6:{if((e|0)<3){h=38;break b}b=b+3|0;continue b}case 7:{if((e|0)<4){h=41;break b}b=b+4|0;continue b}case 4:{if((e|0)<=3){h=50;break b}h=b+2|0;if(a[h>>0]|0){b=h;continue b}if((a[b+3>>0]|0)!=93){b=h;continue b}if((e|0)<=5){h=50;break b}i=b+4|0;if(a[i>>0]|0){b=h;continue b}if((a[b+5>>0]|0)==62){h=49;break b}else {b=h;continue b}}default:{b=b+2|0;continue b}}}if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==41){c[g>>2]=b;f=6;break}else if((h|0)==49){c[g>>2]=i;f=0;break}else if((h|0)==50){c[g>>2]=b;f=6;break}else if((h|0)==52){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function e0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+1>>0]|0)>>0]|0;else f=J$(f,a[e+1>>0]|0)|0;switch(f|0){case 4:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-1;break a}if((a[f>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=e+6;f=40;break a}}break}case 9:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;i=f;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;i=f;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;i=f;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:h=e+2|0;}j=b+72|0;b=h;b:while(1){e=i-b|0;if((e|0)<=1){h=40;break}f=a[b>>0]|0;h=a[b+1>>0]|0;if(!(f<<24>>24))f=d[j+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 9:case 8:case 1:case 0:case 4:{h=38;break b}case 6:{if((e|0)<3){h=35;break b}else f=3;break}case 7:{if((e|0)<4){h=37;break b}else f=4;break}default:f=2;}b=b+f|0;}if((h|0)==35){c[g>>2]=b;f=6;break}else if((h|0)==37){c[g>>2]=b;f=6;break}else if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==40){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function f0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f-e|0;k=(k&1|0)==0?f:e+(k&-2)|0;j=b+72|0;i=0;f=e;a:while(1){h=k-f|0;if((h|0)<=1){f=-1;break}b=a[f>>0]|0;e=a[f+1>>0]|0;if(!(b<<24>>24))b=d[j+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 8:case 1:case 0:{l=12;break a}case 5:{h=i;f=f+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}h=i;f=f+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}h=i;f=f+4|0;i=h;continue a}case 2:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+3>>0]|0)!=33){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}h=(a[f+5>>0]|0)==91;i=i+(h&1)|0;f=h?f+6|0:b;continue a}case 4:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+3>>0]|0)!=93){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+5>>0]|0)!=62){h=i;f=b;i=h;continue a}f=f+6|0;if(!i){l=26;break a}i=i+-1|0;continue a}default:{h=i;f=f+2|0;i=h;continue a}}}if((l|0)==12){c[g>>2]=f;f=0;}else if((l|0)==26){c[g>>2]=f;f=42;}return f|0}function g0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=30;break}h=a[j>>0]|0;i=a[j+1>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 2:{i=14;break a}case 10:{i=15;break a}case 9:{i=18;break a}case 21:{i=25;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=s0(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14){c[g>>2]=j;h=0;break}else if((i|0)==15)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==18){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==25)if((j|0)==(e|0)){c[g>>2]=e+2;h=39;break}else {c[g>>2]=j;h=6;break}else if((i|0)==30){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function h0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=29;break}h=a[j>>0]|0;i=a[j+1>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 30:{i=14;break a}case 10:{i=17;break a}case 9:{i=20;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=s0(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14)if((j|0)==(e|0)){h=t0(b,e+2|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=j;h=6;break}else if((i|0)==17)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==20){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==29){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function i0(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=7;break}if((f-b|0)<2){b=0;break}if(a[b>>0]|0){b=0;break}if((a[b+1>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+2|0;}if((g|0)==7)b=(b|0)==(d|0)&1;return b|0}function j0(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=b+72|0;f=c;a:while(1){b=a[f>>0]|0;e=a[f+1>>0]|0;if(!(b<<24>>24))b=d[g+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 5:{b=2;break}case 6:{b=3;break}case 7:{b=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{b=2;break}default:break a}f=f+b|0;}return f-c|0}function k0(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;a:while(1){b=a[c>>0]|0;e=a[c+1>>0]|0;if(!(b<<24>>24))b=d[f+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 21:case 9:case 10:break;default:break a}c=c+2|0;}return c|0}function l0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=b+72|0;m=0;n=0;b=1;a:while(1){l=e+2|0;h=a[l>>0]|0;j=h<<24>>24==0;i=e+3|0;k=a[i>>0]|0;if(j)h=d[o+(k&255)>>0]|0;else h=J$(h,k)|0;do switch(h|0){case 5:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 6:{if(b|0){j=b;k=n;l=m;e=i;b=j;n=k;m=l;continue a}if((n|0)>=(f|0)){k=n;l=m;b=1;e=i;n=k;m=l;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;k=n;l=m;b=1;e=i;n=k;m=l;continue a}case 7:{if(!b)if((n|0)<(f|0)){c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;b=1;}else b=1;k=n;l=m;e=e+4|0;n=k;m=l;continue a}case 24:case 22:case 29:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 12:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=12;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=12;b=2;e=l;n=k;continue a}if((m|0)!=12){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=12;n=n+1|0;b=0;e=l;continue a}case 13:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=13;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=13;b=2;e=l;n=k;continue a}if((m|0)!=13){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=13;n=n+1|0;b=0;e=l;continue a}case 3:{if((n|0)>=(f|0)){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}case 21:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}i=g+(n<<4)+12|0;if(!(a[i>>0]|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}do if(j&(l|0)!=(c[g+(n<<4)+4>>2]|0)&k<<24>>24==32){h=a[e+4>>0]|0;b=a[e+5>>0]|0;if(!(h<<24>>24)){if(b<<24>>24==32)break;b=d[o+(b&255)>>0]|0;}else b=J$(h,b)|0;if((b|0)!=(m|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}}while(0);a[i>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 10:case 9:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 17:case 11:if((b|0)==2){j=n;k=m;b=2;e=l;n=j;m=k;continue a}else break a;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}while(0)}return n|0}function m0(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+4|0;a:do if(!(a[b>>0]|0))if((a[c+5>>0]|0)==120){c=c+6|0;b=0;while(1){b:while(1){if(!(a[c>>0]|0)){d=a[c+1>>0]|0;if(d<<24>>24==59){e=18;break a}d=d<<24>>24;switch(d|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=8;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=9;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=10;break b}default:{}}}c=c+2|0;}if((e|0)==8)b=d+-48|b<<4;else if((e|0)==9)b=(b<<4)+-55+d|0;else if((e|0)==10)b=(b<<4)+-87+d|0;if((b|0)<1114112)c=c+2|0;else {b=-1;e=19;break}}}else {c=b;b=0;e=13;}else {d=b;b=0;c=-1;e=16;}while(0);while(1)if((e|0)==13){if(a[c>>0]|0){d=c;c=-1;e=16;continue}if((a[c+1>>0]|0)==59){e=18;continue}d=c;c=a[c+1>>0]|0;e=16;continue}else if((e|0)==16){b=(b*10|0)+-48+c|0;if((b|0)>=1114112){b=-1;e=19;continue}c=d+2|0;e=13;continue}else if((e|0)==18){b=A_(b)|0;e=19;continue}else if((e|0)==19)return b|0;return 0}function n0(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch((d-c|0)/2|0|0){case 2:{if((a[c+2>>0]|0)==0?(a[c+3>>0]|0)==116:0){if(!(a[c>>0]|0))b=a[c+1>>0]|0;else b=-1;b=(b|0)==108?60:(b|0)==103?62:0;}else e=27;break}case 3:{if((((((a[c>>0]|0)==0?(a[c+1>>0]|0)==97:0)?(a[c+2>>0]|0)==0:0)?(a[c+3>>0]|0)==109:0)?(a[c+4>>0]|0)==0:0)?(a[c+5>>0]|0)==112:0)b=38;else e=27;break}case 4:{if(!(a[c>>0]|0))switch(a[c+1>>0]|0){case 113:{if(a[c+2>>0]|0){e=27;break a}if((a[c+3>>0]|0)!=117){e=27;break a}if(a[c+4>>0]|0){e=27;break a}if((a[c+5>>0]|0)!=111){e=27;break a}if(a[c+6>>0]|0){e=27;break a}if((a[c+7>>0]|0)==116){b=34;break a}else {e=27;break a}}case 97:{if(a[c+2>>0]|0){e=27;break a}if((a[c+3>>0]|0)!=112){e=27;break a}if(a[c+4>>0]|0){e=27;break a}if((a[c+5>>0]|0)!=111){e=27;break a}if(a[c+6>>0]|0){e=27;break a}if((a[c+7>>0]|0)==115){b=39;break a}else {e=27;break a}}default:{e=27;break a}}else e=27;break}default:e=27;}while(0);if((e|0)==27)b=0;return b|0}function o0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=b+72|0;k=g+4|0;while(1){if((f-e|0)<=1)break;b=a[e>>0]|0;h=a[e+1>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;switch(b|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[k>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+2|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;i=e+2|0;if((f-i|0)>1){b=a[i>>0]|0;h=a[e+3>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;e=(b|0)==10?e+4|0:i;}else e=i;c[k>>2]=-1;break}default:e=e+2|0;}c[k>>2]=(c[k>>2]|0)+1;}return}function p0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f+-2|0;j=b+72|0;a:while(1){h=e+2|0;if((k-h|0)<=1){f=1;break}f=a[h>>0]|0;i=f<<24>>24==0;b=a[e+3>>0]|0;if(i)f=d[j+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:{e=h;continue a}case 21:if(i&b<<24>>24==9){l=12;break a}else {e=h;continue a}case 22:case 26:{if(!i){l=12;break a}if(b<<24>>24>=0){e=h;continue a}break}default:if(!i){l=12;break a}}switch(b<<24>>24|0){case 64:case 36:{e=h;break}default:{l=12;break a}}}if((l|0)==12){c[g>>2]=h;f=0;}return f|0}function q0(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[e>>2]|0;k=j+(f-j&-2)|0;l=k;m=h;a:while(1){if(j>>>0>=k>>>0){b=0;break}i=a[j+1>>0]|0;b=a[j>>0]|0;f=b&255;switch(b<<24>>24){case 0:{if(i<<24>>24>-1){b=c[g>>2]|0;if((b|0)==(h|0)){b=2;break a}c[g>>2]=b+1;a[b>>0]=i;b=j;}else n=7;break}case 7:case 6:case 5:case 4:case 3:case 2:case 1:{n=7;break}case -37:case -38:case -39:case -40:{b=c[g>>2]|0;if((m-b|0)<4){b=2;break a}if((l-j|0)<4){b=1;break a}o=i&255;i=(f<<2&12|o>>>6)+1|0;c[g>>2]=b+1;a[b>>0]=i>>>2|240;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>2&15|i<<4&48|128;b=j+2|0;i=d[j+3>>0]|0;f=(o<<4&48|i>>>6|a[b>>0]<<2&12|128)&255;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=f;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=i&63|128;break}default:{b=c[g>>2]|0;if((m-b|0)<3){b=2;break a}c[g>>2]=b+1;a[b>>0]=f>>>4|224;o=i&255;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2&60|128;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}}if((n|0)==7){n=0;b=c[g>>2]|0;if((m-b|0)<2){b=2;break}o=i&255;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2|192;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}j=b+2|0;}c[e>>2]=j;return b|0}function r0(e,f,g,h,i){e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0;j=c[f>>2]|0;l=g-j&-2;e=j+l|0;if((l|0)>(i-(c[h>>2]|0)|0)){k=e+-2|0;g=(a[k>>0]&-8)<<24>>24==-40;l=g&1;e=g?k:e;}else l=0;g=j;while(1){j=g>>>0>>0;k=c[h>>2]|0;if(!(j&k>>>0>>0))break;j=((d[g>>0]|0)<<8|(d[g+1>>0]|0))&65535;c[h>>2]=k+2;b[k>>1]=j;k=(c[f>>2]|0)+2|0;c[f>>2]=k;g=k;}return ((k|0)!=(i|0)|j^1?l:2)|0}function s0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=f;j=l-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;b=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;b=0;break a}case 6:{if((j|0)<3){b=-2;break a}c[g>>2]=e;b=0;break a}case 7:{if((j|0)<4){b=-2;break a}c[g>>2]=e;b=0;break a}case 19:{b=u0(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;b=0;break a}}k=b+72|0;j=e;b:while(1){i=j+2|0;e=l-i|0;if((e|0)<=1){b=-1;break a}b=a[i>>0]|0;f=a[j+3>>0]|0;if(!(b<<24>>24))h=d[k+(f&255)>>0]|0;else h=J$(b,f)|0;switch(h|0){case 27:case 26:case 25:case 24:case 22:{j=i;continue b}case 5:{f=23;break b}case 6:{f=24;break b}case 7:{f=26;break b}case 18:{f=28;break b}case 29:break;default:{f=29;break b}}e=f&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(b&255)>>0]|0)<<3)<<2)>>2])){f=22;break}else j=i;}if((f|0)==22){c[g>>2]=i;b=0;break}else if((f|0)==23){c[g>>2]=i;b=0;break}else if((f|0)==24){if((e|0)<3){b=-2;break}c[g>>2]=i;b=0;break}else if((f|0)==26){if((e|0)<4){b=-2;break}c[g>>2]=i;b=0;break}else if((f|0)==28){c[g>>2]=j+4;b=9;break}else if((f|0)==29){c[g>>2]=i;b=0;break}}else b=-1;while(0);return b|0}function t0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){k=b+2|0;e=f-k|0;if((e|0)<=1){f=-1;break a}h=a[k>>0]|0;i=a[b+3>>0]|0;if(!(h<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:{b=k;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else b=k;}if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){c[g>>2]=k;f=0;break}else if((h|0)==24){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==26){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==28){c[g>>2]=b+4;f=28;break}else if((h|0)==29){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function u0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=f;a:do if((k-e|0)>1){i=a[e>>0]|0;h=a[e+1>>0]|0;do if(!(i<<24>>24))if(h<<24>>24==120){h=v0(b,e+2|0,f,g)|0;break a}else {h=d[b+72+(h&255)>>0]|0;break}else h=J$(i,h)|0;while(0);if((h|0)!=25){c[g>>2]=e;h=0;break}j=b+72|0;b=e;b:while(1){i=b+2|0;if((k-i|0)<=1){h=-1;break a}h=a[i>>0]|0;f=a[b+3>>0]|0;if(!(h<<24>>24))h=d[j+(f&255)>>0]|0;else h=J$(h,f)|0;switch(h|0){case 25:{b=i;break}case 18:{f=15;break b}default:{f=16;break b}}}if((f|0)==15){c[g>>2]=b+4;h=10;break}else if((f|0)==16){c[g>>2]=i;h=0;break}}else h=-1;while(0);return h|0}function v0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;a:do if((f-e|0)>1){h=a[e>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+1>>0]|0)>>0]|0;else h=J$(h,a[e+1>>0]|0)|0;if((h&-2|0)!=24){c[g>>2]=e;f=0;break}j=b+72|0;b:while(1){i=e+2|0;if((f-i|0)<=1){f=-1;break a}h=a[i>>0]|0;b=a[e+3>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 25:{e=i;break}case 18:{h=13;break b}default:{h=14;break b}}}if((h|0)==13){c[g>>2]=e+4;f=10;break}else if((h|0)==14){c[g>>2]=i;f=0;break}}else f=-1;while(0);return f|0}function w0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=f;j=o-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;h=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;h=0;break a}case 6:{if((j|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 7:{if((j|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 16:{i=e+2|0;if((o-i|0)<=1){h=-1;break a}h=a[i>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+3>>0]|0)>>0]|0;else h=J$(h,a[e+3>>0]|0)|0;switch(h|0){case 27:{h=x0(b,e+4|0,f,g)|0;break a}case 20:{h=y0(e+4|0,f,g)|0;break a}default:{c[g>>2]=i;h=0;break a}}}case 15:{h=z0(b,e+2|0,f,g)|0;break a}case 17:{h=A0(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}m=b+72|0;l=0;h=e+2|0;b:while(1){c:while(1){i=o-h|0;if((i|0)<=1){h=-1;break a}j=a[h>>0]|0;k=a[h+1>>0]|0;if(!(j<<24>>24))e=d[m+(k&255)>>0]|0;else e=J$(j,k)|0;switch(e|0){case 5:{n=34;break b}case 6:{n=35;break b}case 7:{n=37;break b}case 10:case 9:case 21:{n=55;break b}case 11:{n=69;break b}case 17:break b;case 23:break c;case 29:{e=k&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(j&255)>>0]<<3)<<2)>>2])){n=32;break b}break}case 27:case 26:case 25:case 24:case 22:break;default:{n=75;break b}}h=h+2|0;}if(l|0){n=40;break}e=h+2|0;l=o-e|0;if((l|0)<=1){h=-1;break a}i=a[e>>0]|0;j=a[h+3>>0]|0;if(!(i<<24>>24))k=d[m+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{n=49;break b}case 6:{n=50;break b}case 7:{n=52;break b}case 29:{l=j&255;if(!(1<<(l&31)&c[56940+((l>>>5|d[143788+(i&255)>>0]<<3)<<2)>>2])){n=47;break b}break}case 24:case 22:break;default:{n=54;break b}}l=1;h=h+4|0;}d:switch(n|0){case 32:{c[g>>2]=h;h=0;break a}case 34:{c[g>>2]=h;h=0;break a}case 35:{if((i|0)<3){h=-2;break a}c[g>>2]=h;h=0;break a}case 37:{if((i|0)<4){h=-2;break a}c[g>>2]=h;h=0;break a}case 40:{c[g>>2]=h;h=0;break a}case 47:{c[g>>2]=e;h=0;break a}case 49:{c[g>>2]=e;h=0;break a}case 50:{if((l|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 52:{if((l|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 54:{c[g>>2]=e;h=0;break a}case 55:{e:while(1){n=0;i=h+2|0;j=o-i|0;if((j|0)<=1){h=-1;break a}k=a[i>>0]|0;e=a[h+3>>0]|0;if(!(k<<24>>24))l=d[m+(e&255)>>0]|0;else l=J$(k,e)|0;switch(l|0){case 11:{h=i;n=69;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;n=55;break}case 29:{n=60;break e}case 24:case 22:break e;case 5:{n=63;break e}case 6:{n=64;break e}case 7:{n=66;break e}default:{n=68;break e}}}if((n|0)==60){o=e&255;if(!(1<<(o&31)&c[56940+((o>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=i;h=0;break a}}else if((n|0)==63){c[g>>2]=i;h=0;break a}else if((n|0)==64){if((j|0)<3){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==66){if((j|0)<4){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==68){c[g>>2]=i;h=0;break a}h=B0(b,h+4|0,f,g)|0;break a}case 75:{c[g>>2]=h;h=0;break a}}if((n|0)==69){c[g>>2]=h+2;h=2;break}i=h+2|0;if((o-i|0)>1){if((a[i>>0]|0)==0?(a[h+3>>0]|0)==62:0){c[g>>2]=h+4;h=4;break}c[g>>2]=i;h=0;}else h=-1;}else h=-1;while(0);return h|0}function x0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f;a:do if((j-e|0)>1){if((a[e>>0]|0)==0?(a[e+1>>0]|0)==45:0){i=b+72|0;h=e+2|0;b:while(1){e=j-h|0;if((e|0)<=1){f=-1;break a}f=a[h>>0]|0;b=a[h+1>>0]|0;if(!(f<<24>>24))f=d[i+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 8:case 1:case 0:{k=16;break b}case 5:{h=h+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}h=h+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}h=h+4|0;continue b}case 27:{f=h+2|0;if((j-f|0)<=1){f=-1;break a}if(a[f>>0]|0){h=f;continue b}if((a[h+3>>0]|0)==45)break b;else {h=f;continue b}}default:{h=h+2|0;continue b}}}if((k|0)==16){c[g>>2]=h;f=0;break}f=h+4|0;if((j-f|0)<=1){f=-1;break}if((a[f>>0]|0)==0?(a[h+5>>0]|0)==62:0){c[g>>2]=h+6;f=13;break}c[g>>2]=f;f=0;break}c[g>>2]=e;f=0;}else f=-1;while(0);return f|0}function y0(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>11){d=0;while(1){if((d|0)>=6){d=8;break}if(a[b>>0]|0){d=0;break}if((a[b+1>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+2|0;}c[e>>2]=b;}else d=-1;return d|0}function z0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;i=o-e|0;a:do if((i|0)>1){j=a[e>>0]|0;if(!(j<<24>>24)){h=a[e+1>>0]|0;f=d[b+72+(h&255)>>0]|0;}else {h=a[e+1>>0]|0;f=J$(j,h)|0;}switch(f|0){case 29:{m=h&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(j&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}m=b+72|0;k=e;b:while(1){f=k+2|0;h=o-f|0;if((h|0)<=1){f=-1;break a}i=a[f>>0]|0;j=a[k+3>>0]|0;if(!(i<<24>>24))b=d[m+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 27:case 26:case 25:case 24:case 22:{k=f;continue b}case 5:{n=22;break b}case 6:{n=23;break b}case 7:{n=25;break b}case 10:case 9:case 21:{n=27;break b}case 15:{n=46;break b}case 29:break;default:break b}k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){n=21;break}else k=f;}if((n|0)==21){c[g>>2]=f;f=0;break}else if((n|0)==22){c[g>>2]=f;f=0;break}else if((n|0)==23){if((h|0)<3){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==25){if((h|0)<4){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==27){if(!(C0(e,f,p)|0)){c[g>>2]=f;f=0;break}j=k+4|0;c:while(1){i=o-j|0;if((i|0)<=1){f=-1;break a}f=a[j>>0]|0;h=a[j+1>>0]|0;if(!(f<<24>>24))f=d[m+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 8:case 1:case 0:{n=40;break c}case 5:{j=j+2|0;continue c}case 6:{if((i|0)<3){f=-2;break a}j=j+3|0;continue c}case 7:{if((i|0)<4){f=-2;break a}j=j+4|0;continue c}case 15:{f=j+2|0;if((o-f|0)<=1){f=-1;break a}if(a[f>>0]|0){j=f;continue c}if((a[j+3>>0]|0)==62){n=44;break c}else {j=f;continue c}}default:{j=j+2|0;continue c}}}if((n|0)==40){c[g>>2]=j;f=0;break}else if((n|0)==44){c[g>>2]=j+4;f=c[p>>2]|0;break}}else if((n|0)==46){if(!(C0(e,f,p)|0)){c[g>>2]=f;f=0;break}f=k+4|0;if((o-f|0)<=1){f=-1;break}if((a[f>>0]|0)==0?(a[k+5>>0]|0)==62:0){c[g>>2]=k+6;f=c[p>>2]|0;break}}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function A0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){j=b+2|0;e=f-j|0;if((e|0)<=1){f=-1;break a}h=a[j>>0]|0;i=a[b+3>>0]|0;if(!(h<<24>>24))k=d[l+(i&255)>>0]|0;else k=J$(h,i)|0;switch(k|0){case 23:case 27:case 26:case 25:case 24:case 22:{b=j;continue b}case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 10:case 9:case 21:{h=27;break b}case 11:{h=34;break b}case 29:break;default:{h=35;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}else b=j;}if((h|0)==21){c[g>>2]=j;f=0;break}else if((h|0)==22){c[g>>2]=j;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==27){c:while(1){k=j+2|0;if((f-k|0)<=1){f=-1;break a}h=a[k>>0]|0;i=a[j+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 21:{j=k;h=27;break}case 11:{h=32;break c}default:{h=33;break c}}}if((h|0)==32){c[g>>2]=j+4;f=5;break}else if((h|0)==33){c[g>>2]=k;f=0;break}}else if((h|0)==34){c[g>>2]=b+4;f=5;break}else if((h|0)==35){c[g>>2]=j;f=0;break}}else f=-1;while(0);return f|0}function B0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;c[q>>2]=e;r=f;o=b+72|0;h=0;a:while(1){b:while(1){m=r-e|0;if((m|0)<=1){e=-1;break a}i=a[e>>0]|0;j=a[e+1>>0]|0;if(!(i<<24>>24))k=d[o+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{p=11;break a}case 6:{p=12;break a}case 7:{p=14;break a}case 23:{p=16;break b}case 10:case 9:case 21:{p=31;break b}case 14:{p=37;break b}case 29:{n=j&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){p=9;break a}break}case 27:case 26:case 25:case 24:case 22:break;default:{p=89;break a}}n=e+2|0;c[q>>2]=n;e=n;}c:do if((p|0)==16){p=0;if(h|0){p=17;break a}h=e+2|0;c[q>>2]=h;i=h;j=r-i|0;if((j|0)<=1){e=-1;break a}k=a[h>>0]|0;m=a[e+3>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=25;break a}case 6:{p=26;break a}case 7:{p=28;break a}case 24:case 22:{h=1;break c}case 29:break;default:{p=30;break a}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=24;break a}else h=1;}else if((p|0)==31)while(1){p=0;i=e+2|0;c[q>>2]=i;j=i;if((r-j|0)<=1){e=-1;break a}h=a[i>>0]|0;e=a[e+3>>0]|0;if(!(h<<24>>24))e=d[o+(e&255)>>0]|0;else e=J$(h,e)|0;switch(e|0){case 14:{e=i;p=37;break c}case 9:case 10:case 21:{e=i;p=31;break}default:{p=36;break a}}}while(0);d:do if((p|0)==37){while(1){p=0;j=e+2|0;c[q>>2]=j;k=j;if((r-k|0)<=1){e=-1;break a}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))m=d[o+(i&255)>>0]|0;else m=J$(h,i)|0;if((m|1|0)==13)break;switch(m|0){case 9:case 10:case 21:{e=j;p=37;break}default:{p=43;break a}}}e=e+4|0;c[q>>2]=e;e:while(1){j=r-e|0;if((j|0)<=1){e=-1;break a}h=a[e>>0]|0;i=a[e+1>>0]|0;if(!(h<<24>>24))h=d[o+(i&255)>>0]|0;else h=J$(h,i)|0;if((h|0)==(m|0))break;switch(h|0){case 8:case 1:case 0:{p=56;break a}case 2:{p=61;break a}case 5:{n=e+2|0;c[q>>2]=n;e=n;continue e}case 6:{if((j|0)<3){e=-2;break a}n=e+3|0;c[q>>2]=n;e=n;continue e}case 7:{if((j|0)<4){e=-2;break a}n=e+4|0;c[q>>2]=n;e=n;continue e}case 3:{e=s0(b,e+2|0,f,q)|0;if((e|0)<1){p=59;break a}e=c[q>>2]|0;continue e}default:{n=e+2|0;c[q>>2]=n;e=n;continue e}}}i=e+2|0;c[q>>2]=i;k=i;if((r-k|0)<=1){e=-1;break a}h=a[i>>0]|0;j=a[e+3>>0]|0;if(!(h<<24>>24))h=d[o+(j&255)>>0]|0;else h=J$(h,j)|0;switch(h|0){case 11:{p=81;break a}case 17:{p=82;break a}case 10:case 9:case 21:{e=i;break}default:{p=68;break a}}f:while(1){i=e+2|0;c[q>>2]=i;h=i;j=r-h|0;if((j|0)<=1){e=-1;break a}k=a[i>>0]|0;m=a[e+3>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=76;break a}case 6:{p=77;break a}case 7:{p=79;break a}case 11:{p=81;break a}case 17:{p=82;break a}case 24:case 22:{h=0;break d}case 10:case 9:case 21:{e=i;break}case 29:break f;default:{p=87;break a}}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=75;break a}else h=0;}while(0);e=e+4|0;c[q>>2]=e;}switch(p|0){case 9:{c[g>>2]=e;e=0;break}case 11:{c[g>>2]=e;e=0;break}case 12:{if((m|0)<3)e=-2;else {c[g>>2]=e;e=0;}break}case 14:{if((m|0)<4)e=-2;else {c[g>>2]=e;e=0;}break}case 17:{c[g>>2]=e;e=0;break}case 24:{c[g>>2]=h;e=0;break}case 25:{c[g>>2]=h;e=0;break}case 26:{if((j|0)<3)e=-2;else {c[g>>2]=h;e=0;}break}case 28:{if((j|0)<4)e=-2;else {c[g>>2]=h;e=0;}break}case 30:{c[g>>2]=i;e=0;break}case 36:{c[g>>2]=j;e=0;break}case 43:{c[g>>2]=k;e=0;break}case 56:{c[g>>2]=e;e=0;break}case 59:{if(!e){c[g>>2]=c[q>>2];e=0;}break}case 61:{c[g>>2]=e;e=0;break}case 68:{c[g>>2]=k;e=0;break}case 75:{c[g>>2]=i;e=0;break}case 76:{c[g>>2]=i;e=0;break}case 77:{if((j|0)<3)e=-2;else {c[g>>2]=i;e=0;}break}case 79:{if((j|0)<4)e=-2;else {c[g>>2]=i;e=0;}break}case 81:{c[g>>2]=e+4;e=1;break}case 82:{h=i+2|0;c[q>>2]=h;e=h;if((r-e|0)>1){if((a[h>>0]|0)==0?(a[i+3>>0]|0)==62:0){c[g>>2]=i+4;e=3;break}c[g>>2]=e;e=0;}else e=-1;break}case 87:{c[g>>2]=h;e=0;break}case 89:{c[g>>2]=e;e=0;break}}l=s;return e|0}function C0(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==6?(a[b>>0]|0)==0:0){switch(a[b+1>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}if(!(a[b+2>>0]|0)){switch(a[b+3>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}if(!(a[b+4>>0]|0)){switch(a[b+5>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;}else d=1;}else d=1;while(0);return d|0}function D0(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;k=e+72|0;a:while(1){b:while(1){j=g-f|0;if((j|0)<=1){f=-1;break a}e=a[f>>0]|0;i=a[f+1>>0]|0;if(!(e<<24>>24))i=d[k+(i&255)>>0]|0;else i=J$(e,i)|0;switch(i|0){case 8:case 1:case 0:{l=10;break a}case 6:{l=9;break b}case 7:{l=19;break b}case 5:{f=f+2|0;continue b}case 13:case 12:{e=f+2|0;if((i|0)==(b|0)){l=12;break a}else {f=e;continue b}}default:{f=f+2|0;continue b}}}if((l|0)==9){l=0;if((j|0)<3){f=-2;break}else {f=f+3|0;continue}}else if((l|0)==19){l=0;if((j|0)<4){f=-2;break}else {f=f+4|0;continue}}}c:do if((l|0)==10){c[h>>2]=f;f=0;}else if((l|0)==12)if((g-e|0)>1){c[h>>2]=e;g=a[e>>0]|0;f=a[f+3>>0]|0;if(!(g<<24>>24))f=d[k+(f&255)>>0]|0;else f=J$(g,f)|0;switch(f|0){case 20:case 30:case 11:case 10:case 9:case 21:{f=27;break c}default:{}}f=0;}else f=-27;while(0);return f|0}function E0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;a:do if((k-e|0)>1){h=a[e>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+1>>0]|0)>>0]|0;else h=J$(h,a[e+1>>0]|0)|0;switch(h|0){case 27:{h=x0(b,e+2|0,f,g)|0;break a}case 20:{c[g>>2]=e+2;h=33;break a}case 24:case 22:{j=b+72|0;b:while(1){i=e+2|0;f=k-i|0;if((f|0)<=1){h=-1;break a}h=a[i>>0]|0;b=a[e+3>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 22:{e=i;break}case 30:{l=15;break b}case 10:case 9:case 21:break b;default:{l=22;break b}}}if((l|0)==22){c[g>>2]=i;h=0;break a}c:do if((l|0)==15){if((f|0)<=3){h=-1;break a}b=a[e+4>>0]|0;h=a[e+5>>0]|0;if(!(b<<24>>24))h=d[j+(h&255)>>0]|0;else h=J$(b,h)|0;switch(h|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=i;h=0;break a}while(0);c[g>>2]=i;h=16;break a}default:{c[g>>2]=e;h=0;break a}}}else h=-1;while(0);return h|0}function F0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}b=b+72|0;k=e;b:while(1){h=k;k=k+2|0;e=f-k|0;if((e|0)<=1){f=-20;break a}j=a[k>>0]|0;h=a[h+3>>0]|0;if(!(j<<24>>24))i=d[b+(h&255)>>0]|0;else i=J$(j,h)|0;switch(i|0){case 27:case 26:case 25:case 24:case 22:continue b;case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=27;break b}case 29:break;default:{h=28;break b}}e=h&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(j&255)>>0]|0)<<3)<<2)>>2])){h=21;break}}if((h|0)==21){c[g>>2]=k;f=0;break}else if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==27){c[g>>2]=k;f=20;break}else if((h|0)==28){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function G0(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;while(1){b=c[d>>2]|0;h=b>>>0>>0;i=c[f>>2]|0;if(!(h&i>>>0>>0))break;c[d>>2]=b+1;h=a[b>>0]|0;i=c[f>>2]|0;c[f>>2]=i+1;a[i>>0]=h;}return ((i|0)!=(g|0)|h^1?0:2)|0}function H0(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;a:while(1){f=a[b>>0]|0;g=a[c>>0]|0;f=(f+-97&255)<26?(f&255)+224&255:f;switch((f<<24>>24==((g+-97&255)<26?(g&255)+224&255:g)<<24>>24?(f<<24>>24==0?2:0):1)&3){case 0:{c=c+1|0;b=b+1|0;break}case 1:{e=3;break a}case 2:{d=1;break a}default:{e=5;break a}}}if((e|0)==3)d=0;return d|0}function I0(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return K0(39,a,b,c,d,e,f,g,h,i,j)|0}function J0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+144|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+127|0)|0;do if((c[i>>2]|0)==(e|0)){a[c[g>>2]>>0]=0;if(H0(f,144315)|0?(c[b+64>>2]|0)==2:0)break;b=Z$(f)|0;if((b|0)!=-1)b=c[58948+(b<<2)>>2]|0;else b=0;}else b=0;while(0);l=h;return b|0}function K0(a,b,d,e,f,g,h,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;t=v+8|0;q=v+12|0;o=v+4|0;p=v;c[q>>2]=0;c[o>>2]=0;c[p>>2]=0;u=d+64|0;s=c[u>>2]|0;r=e+(s*5|0)|0;c[t>>2]=r;s=f+(0-(s<<1))|0;r=(L0(d,r,s,o,p,q,t)|0)!=0;n=c[o>>2]|0;e=n;a:do if(r&(n|0)!=0){r=d+24|0;f=c[p>>2]|0;do if(!(ob[c[r>>2]&127](d,n,f,144340)|0)){if(!b){c[g>>2]=e;e=0;break a}}else {if(h|0)c[h>>2]=c[q>>2];if(!i)e=c[t>>2]|0;else {e=c[t>>2]|0;c[i>>2]=e;}if(!(L0(d,e,s,o,p,q,t)|0)){c[g>>2]=c[t>>2];e=0;break a}f=c[o>>2]|0;if(f|0){e=f;n=f;f=c[p>>2]|0;break}if(!b){e=1;break a}c[g>>2]=c[t>>2];e=0;break a}while(0);if(ob[c[r>>2]&127](d,n,f,144348)|0){f=c[q>>2]|0;e=f;if((((M0(d,f,s)|0)&-33)+-65|0)>>>0>=26){c[g>>2]=e;e=0;break}if(j|0)c[j>>2]=e;e=c[t>>2]|0;if(k|0)c[k>>2]=nb[a&63](d,f,e+(0-(c[u>>2]|0))|0)|0;if(!(L0(d,e,s,o,p,q,t)|0)){c[g>>2]=c[t>>2];e=0;break}e=c[o>>2]|0;if(!e){e=1;break}n=e;f=c[p>>2]|0;}if((b|0)!=0|(ob[c[r>>2]&127](d,n,f,144357)|0)==0){c[g>>2]=e;e=0;break}f=c[q>>2]|0;e=c[t>>2]|0;n=f;if(!(ob[c[r>>2]&127](d,f,e+(0-(c[u>>2]|0))|0,107657)|0)){if(!(ob[c[r>>2]&127](d,f,e+(0-(c[u>>2]|0))|0,107649)|0)){c[g>>2]=n;e=0;break}if(m)c[m>>2]=0;}else if(m)c[m>>2]=1;while(1){if(!(N0(M0(d,e,s)|0)|0))break;e=e+(c[u>>2]|0)|0;}c[t>>2]=e;if((e|0)==(s|0))e=1;else {c[g>>2]=e;e=0;}}else {c[g>>2]=c[t>>2];e=0;}while(0);l=v;return e|0}function L0(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;a:do if((b|0)!=(d|0)){if(!(N0(M0(a,b,d)|0)|0)){c[h>>2]=b;b=0;break}j=a+64|0;do b=b+(c[j>>2]|0)|0;while((N0(M0(a,b,d)|0)|0)!=0);if((b|0)==(d|0)){c[e>>2]=0;b=1;break}c[e>>2]=b;b:while(1){i=M0(a,b,d)|0;switch(i|0){case -1:{i=11;break b}case 61:{i=12;break b}default:{}}if(N0(i)|0){i=14;break}b=b+(c[j>>2]|0)|0;}if((i|0)==11){c[h>>2]=b;b=0;break}else if((i|0)==12)c[f>>2]=b;else if((i|0)==14){c[f>>2]=b;do{b=b+(c[j>>2]|0)|0;i=M0(a,b,d)|0;}while((N0(i)|0)!=0);if((i|0)!=61){c[h>>2]=b;b=0;break}}if((b|0)==(c[e>>2]|0)){c[h>>2]=b;b=0;break}do{b=b+(c[j>>2]|0)|0;i=M0(a,b,d)|0;}while((N0(i)|0)!=0);switch(i|0){case 34:case 39:break;default:{c[h>>2]=b;b=0;break a}}f=b+(c[j>>2]|0)|0;c[g>>2]=f;b=i<<24>>24;c:while(1){i=M0(a,f,d)|0;if((i|0)==(b|0)){i=30;break}if((i+-48|0)>>>0>9&((i&-33)+-65|0)>>>0>25)switch(i|0){case 45:case 46:case 95:break;default:{i=28;break c}}f=f+(c[j>>2]|0)|0;}if((i|0)==28){c[h>>2]=f;b=0;break}else if((i|0)==30){c[h>>2]=f+(c[j>>2]|0);b=1;break}}else {c[e>>2]=0;b=1;}while(0);return b|0}function M0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+16|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+1|0)|0;l=h;return ((c[g>>2]|0)==(f|0)?-1:a[f>>0]|0)|0}function N0(a){a=a|0;switch(a|0){case 9:case 10:case 13:case 32:{a=1;break}default:a=0;}return a|0}function O0(){return 60092}function P0(b,d,e){b=b|0;d=d|0;e=e|0;e=Z$(e)|0;if((e|0)==-1)e=0;else {a[b+69>>0]=e;c[b>>2]=69;c[b+4>>2]=70;c[b+48>>2]=31;c[b+72>>2]=d;c[d>>2]=b;e=1;}return e|0}function Q0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(60456,a,0,b,c,d)|0}function R0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(60456,a,1,b,c,d)|0}function S0(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return K0(40,a,b,c,d,e,f,g,h,i,j)|0}function T0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+144|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+127|0)|0;do if((c[i>>2]|0)==(e|0)){a[c[g>>2]>>0]=0;if(H0(f,144315)|0?(c[b+64>>2]|0)==2:0)break;b=Z$(f)|0;if((b|0)!=-1)b=c[60456+(b<<2)>>2]|0;else b=0;}else b=0;while(0);l=h;return b|0}function U0(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;b=z_(b,c,d,e)|0;if(b|0)a[b+72+58>>0]=23;return b|0}function V0(a){a=a|0;c[a>>2]=15;c[a+16>>2]=1;c[a+12>>2]=0;c[a+20>>2]=0;return}function W0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{c[a>>2]=16;a=0;break}case 12:{c[a>>2]=16;a=1;break}case 11:{c[a>>2]=16;a=55;break}case 13:{c[a>>2]=16;a=56;break}case 14:{a=0;break}case 16:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]<<1)|0,e,144368)|0))g=9;else {c[a>>2]=17;a=3;}break}case 29:{c[a>>2]=18;a=2;break}default:g=9;}if((g|0)==9)a=_0(a,b)|0;return a|0}function X0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 14:case 15:{a=0;break}case 11:{a=55;break}case 13:{a=56;break}case 16:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]<<1)|0,e,144368)|0))g=7;else {c[a>>2]=17;a=3;}break}case 29:{c[a>>2]=18;a=2;break}default:g=7;}if((g|0)==7)a=_0(a,b)|0;return a|0}function Y0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 41:case 18:{c[a>>2]=19;a=4;break}default:a=_0(a,b)|0;}return a|0}function Z0(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0}function _0(a,b){a=a|0;b=b|0;if((b|0)==28&(c[a+16>>2]|0)==0)a=59;else {c[a>>2]=18;a=-1;}return a|0}function $0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=3;break}case 25:{c[a>>2]=20;a=7;break}case 17:{c[a>>2]=21;a=8;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=22;a=3;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=8;else {c[a>>2]=23;a=3;}break}default:h=8;}while(0);if((h|0)==8)a=_0(a,b)|0;return a|0}function a1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a:do switch(b|0){case -4:case 15:{a=0;break}case 16:{g=f+24|0;h=f+64|0;if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144390)|0){c[a>>2]=24;a=11;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144397)|0){c[a>>2]=25;a=33;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144405)|0){c[a>>2]=26;a=39;break a}if(!(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144413)|0))i=14;else {c[a>>2]=27;a=17;}break}case 11:{a=55;break}case 13:{a=56;break}case 28:{a=60;break}case 26:{c[a>>2]=28;a=3;break}default:i=14;}while(0);if((i|0)==14)a=_0(a,b)|0;return a|0}function b1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;f=b+-11|0;switch(f>>>1|f<<31|0){case 2:{a=0;break}case 0:{a=55;break}case 1:{a=56;break}case 9:{c[a>>2]=18;a=2;break}default:a=_0(a,b)|0;}return a|0}function c1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 27:{c[a>>2]=29;a=5;break}default:a=_0(a,b)|0;}return a|0}function d1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 27:{c[a>>2]=22;a=6;break}default:a=_0(a,b)|0;}return a|0}function e1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 25:{c[a>>2]=20;a=7;break}case 17:{c[a>>2]=21;a=8;break}default:a=_0(a,b)|0;}return a|0}function f1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 22:{c[a>>2]=30;a=11;break}case 18:{c[a>>2]=31;a=9;break}default:a=_0(a,b)|0;}return a|0}function g1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 41:case 18:{c[a>>2]=32;a=34;break}default:a=_0(a,b)|0;}return a|0}function h1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 41:case 18:{c[a>>2]=33;a=40;break}default:a=_0(a,b)|0;}return a|0}function i1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 18:{c[a>>2]=34;a=18;break}default:a=_0(a,b)|0;}return a|0}function j1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 17:{c[a>>2]=21;a=8;break}default:a=_0(a,b)|0;}return a|0}function k1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=17;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=35;a=17;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=6;else {c[a>>2]=36;a=17;}break}default:h=6;}while(0);if((h|0)==6)a=_0(a,b)|0;return a|0}function l1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=37;c[a+8>>2]=17;a=19;break}default:a=_0(a,b)|0;}return a|0}function m1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=38;a=21;break}default:a=_0(a,b)|0;}return a|0}function n1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=37;c[a+8>>2]=17;a=19;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=20;break}default:a=_0(a,b)|0;}return a|0}function o1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=c[a+8>>2]|0;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=c[a+8>>2]|0;break}default:a=_0(a,b)|0;}return a|0}function p1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 33:{c[a>>2]=40;d=0;break}case 34:{d=a+12|0;e=c[d>>2]|0;if(!e)g=7;else {c[d>>2]=e+-1;d=0;}break}case 15:{d=0;break}case 26:{g=7;break}case -4:{if(!(c[a+12>>2]|0))d=0;else g=7;break}default:d=a1(a,b,d,e,f)|0;}if((g|0)==7)d=_0(a,b)|0;return d|0}function q1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=0;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144422)|0){c[a>>2]=41;a=0;break a}if(!(ob[c[g>>2]&127](f,d,e,144430)|0))h=6;else {c[a>>2]=42;a=0;}break}default:h=6;}while(0);if((h|0)==6)a=_0(a,b)|0;return a|0}function r1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=0;break}case 25:{c[a>>2]=39;a=a+12|0;c[a>>2]=(c[a>>2]|0)+1;a=0;break}default:a=_0(a,b)|0;}return a|0}function s1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=0;break}case 25:{c[a>>2]=39;a=58;break}default:a=_0(a,b)|0;}return a|0}function t1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=39;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144437)|0){c[a>>2]=37;c[a+8>>2]=39;a=42;break a}if(!(ob[c[g>>2]&127](f,d,e,144443)|0))h=7;else {c[a>>2]=37;c[a+8>>2]=39;a=41;}break}case 23:{c[a>>2]=43;c[a+4>>2]=1;a=44;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function u1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{a=39;break}case 20:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]|0)|0,e,144447)|0))g=9;else {c[a>>2]=44;a=43;}break}case 23:{c[a+4>>2]=2;c[a>>2]=45;a=44;break}case 41:case 18:{c[a>>2]=46;a=51;break}case 30:{c[a>>2]=46;a=53;break}case 31:{c[a>>2]=46;a=52;break}case 32:{c[a>>2]=46;a=54;break}default:g=9;}if((g|0)==9)a=_0(a,b)|0;return a|0}function v1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 24:{c[a>>2]=37;c[a+8>>2]=39;a=45;break}case 36:{c[a>>2]=37;c[a+8>>2]=39;a=46;break}case 21:{c[a>>2]=47;a=39;break}default:a=_0(a,b)|0;}return a|0}function w1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 23:{a=a+4|0;c[a>>2]=(c[a>>2]|0)+1;a=44;break}case 41:case 18:{c[a>>2]=46;a=51;break}case 30:{c[a>>2]=46;a=53;break}case 31:{c[a>>2]=46;a=52;break}case 32:{c[a>>2]=46;a=54;break}default:a=_0(a,b)|0;}return a|0}function x1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 24:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=45;}else a=45;break}case 36:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=46;}else a=46;break}case 35:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=47;}else a=47;break}case 37:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=48;}else a=48;break}case 38:{c[a>>2]=45;a=50;break}case 21:{c[a>>2]=45;a=49;break}default:a=_0(a,b)|0;}return a|0}function y1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 41:case 18:{c[a>>2]=48;a=51;break}default:a=_0(a,b)|0;}return a|0}function z1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 36:{c[a>>2]=37;c[a+8>>2]=39;a=46;break}case 21:{c[a>>2]=47;a=39;break}default:a=_0(a,b)|0;}return a|0}function A1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=33;break}case 41:case 18:{c[a>>2]=49;a=22;break}default:a=_0(a,b)|0;}return a|0}function B1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;a:do switch(b|0){case 15:{g=33;break}case 18:{h=f+24|0;g=0;while(1){i=c[h>>2]|0;if((g|0)>=8)break;if(ob[i&127](f,d,e,c[62304+(g<<2)>>2]|0)|0){j=6;break}g=g+1|0;}if((j|0)==6){c[a>>2]=50;g=g+23|0;break a}if(!(ob[i&127](f,d,e,144413)|0))j=10;else {c[a>>2]=51;g=33;}break}case 23:{c[a>>2]=52;g=33;break}default:j=10;}while(0);if((j|0)==10)g=_0(a,b)|0;return g|0}function C1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a:do switch(b|0){case 15:{a=33;break}case 20:{g=f+24|0;h=f+64|0;if(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144454)|0){c[a>>2]=32;a=35;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144462)|0){c[a>>2]=32;a=36;break a}if(!(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144471)|0))i=9;else {c[a>>2]=53;a=33;}break}case 27:{c[a>>2]=32;a=37;break}default:i=9;}while(0);if((i|0)==9)a=_0(a,b)|0;return a|0}function D1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 23:{c[a>>2]=54;a=33;break}default:a=_0(a,b)|0;}return a|0}function E1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 41:case 18:case 19:{c[a>>2]=55;a=31;break}default:a=_0(a,b)|0;}return a|0}function F1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 24:{c[a>>2]=50;a=33;break}case 21:{c[a>>2]=52;a=33;break}default:a=_0(a,b)|0;}return a|0}function G1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 18:{c[a>>2]=56;a=32;break}default:a=_0(a,b)|0;}return a|0}function H1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 24:{c[a>>2]=50;a=33;break}case 21:{c[a>>2]=54;a=33;break}default:a=_0(a,b)|0;}return a|0}function I1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 27:{c[a>>2]=32;a=38;break}default:a=_0(a,b)|0;}return a|0}function J1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 18:{c[a>>2]=57;a=10;break}default:a=_0(a,b)|0;}return a|0}function K1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=11;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=58;a=11;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=7;else {c[a>>2]=59;a=11;}break}case 27:{c[a>>2]=37;c[a+8>>2]=11;a=12;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function L1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=60;a=13;break}default:a=_0(a,b)|0;}return a|0}function M1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=58;a=14;break}default:a=_0(a,b)|0;}return a|0}function N1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{a=11;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=15;break}case 18:{if(!(ob[c[f+24>>2]&127](f,d,e,144525)|0))g=5;else {c[a>>2]=61;a=11;}break}default:g=5;}if((g|0)==5)a=_0(a,b)|0;return a|0}function O1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 18:{c[a>>2]=37;c[a+8>>2]=11;a=16;break}default:a=_0(a,b)|0;}return a|0}function P1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=11;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=62;a=11;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=7;else {c[a>>2]=63;a=11;}break}case 27:{c[a>>2]=37;c[a+8>>2]=11;a=12;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function Q1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=64;a=13;break}default:a=_0(a,b)|0;}return a|0}function R1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=62;a=14;break}default:a=_0(a,b)|0;}return a|0}function S1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=15;break}default:a=_0(a,b)|0;}return a|0}function T1(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+16|0;p=x;do if(a>>>0<245){m=a>>>0<11?16:a+11&-8;a=m>>>3;o=c[47519]|0;d=o>>>a;if(d&3|0){b=(d&1^1)+a|0;a=190116+(b<<1<<2)|0;d=a+8|0;e=c[d>>2]|0;f=e+8|0;g=c[f>>2]|0;if((g|0)==(a|0))c[47519]=o&~(1<>2]=a;c[d>>2]=g;}w=b<<3;c[e+4>>2]=w|3;w=e+w+4|0;c[w>>2]=c[w>>2]|1;w=f;l=x;return w|0}n=c[47521]|0;if(m>>>0>n>>>0){if(d|0){b=2<>>12&16;b=b>>>i;d=b>>>5&8;b=b>>>d;g=b>>>2&4;b=b>>>g;a=b>>>1&2;b=b>>>a;e=b>>>1&1;e=(d|i|g|a|e)+(b>>>e)|0;b=190116+(e<<1<<2)|0;a=b+8|0;g=c[a>>2]|0;i=g+8|0;d=c[i>>2]|0;if((d|0)==(b|0)){a=o&~(1<>2]=b;c[a>>2]=d;a=o;}w=e<<3;h=w-m|0;c[g+4>>2]=m|3;f=g+m|0;c[f+4>>2]=h|1;c[g+w>>2]=h;if(n|0){e=c[47524]|0;b=n>>>3;d=190116+(b<<1<<2)|0;b=1<>2]|0;}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d;}c[47521]=h;c[47524]=f;w=i;l=x;return w|0}j=c[47520]|0;if(j){d=(j&0-j)+-1|0;i=d>>>12&16;d=d>>>i;h=d>>>5&8;d=d>>>h;k=d>>>2&4;d=d>>>k;e=d>>>1&2;d=d>>>e;a=d>>>1&1;a=c[190380+((h|i|k|e|a)+(d>>>a)<<2)>>2]|0;d=(c[a+4>>2]&-8)-m|0;e=c[a+16+(((c[a+16>>2]|0)==0&1)<<2)>>2]|0;if(!e){k=a;h=d;}else {do{i=(c[e+4>>2]&-8)-m|0;k=i>>>0>>0;d=k?i:d;a=k?e:a;e=c[e+16+(((c[e+16>>2]|0)==0&1)<<2)>>2]|0;}while((e|0)!=0);k=a;h=d;}i=k+m|0;if(i>>>0>k>>>0){f=c[k+24>>2]|0;b=c[k+12>>2]|0;do if((b|0)==(k|0)){a=k+20|0;b=c[a>>2]|0;if(!b){a=k+16|0;b=c[a>>2]|0;if(!b){d=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;d=b;}else {d=c[k+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b;}while(0);do if(f|0){b=c[k+28>>2]|0;a=190380+(b<<2)|0;if((k|0)==(c[a>>2]|0)){c[a>>2]=d;if(!d){c[47520]=j&~(1<>2]|0)!=(k|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=f;b=c[k+16>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d;}b=c[k+20>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d;}}while(0);if(h>>>0<16){w=h+m|0;c[k+4>>2]=w|3;w=k+w+4|0;c[w>>2]=c[w>>2]|1;}else {c[k+4>>2]=m|3;c[i+4>>2]=h|1;c[i+h>>2]=h;if(n|0){e=c[47524]|0;b=n>>>3;d=190116+(b<<1<<2)|0;b=1<>2]|0;}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d;}c[47521]=h;c[47524]=i;}w=k+8|0;l=x;return w|0}else n=m;}else n=m;}else n=m;}else if(a>>>0<=4294967231){a=a+11|0;m=a&-8;k=c[47520]|0;if(k){e=0-m|0;a=a>>>8;if(a)if(m>>>0>16777215)j=31;else {o=(a+1048320|0)>>>16&8;v=a<>>16&4;v=v<>>16&2;j=14-(n|o|j)+(v<>>15)|0;j=m>>>(j+7|0)&1|j<<1;}else j=0;d=c[190380+(j<<2)>>2]|0;a:do if(!d){d=0;a=0;v=57;}else {a=0;i=d;h=m<<((j|0)==31?0:25-(j>>>1)|0);d=0;while(1){f=(c[i+4>>2]&-8)-m|0;if(f>>>0>>0)if(!f){e=0;d=i;a=i;v=61;break a}else {a=i;e=f;}f=c[i+20>>2]|0;i=c[i+16+(h>>>31<<2)>>2]|0;d=(f|0)==0|(f|0)==(i|0)?d:f;f=(i|0)==0;if(f){v=57;break}else h=h<<((f^1)&1);}}while(0);if((v|0)==57){if((d|0)==0&(a|0)==0){a=2<>>12&16;o=o>>>i;h=o>>>5&8;o=o>>>h;j=o>>>2&4;o=o>>>j;n=o>>>1&2;o=o>>>n;d=o>>>1&1;a=0;d=c[190380+((h|i|j|n|d)+(o>>>d)<<2)>>2]|0;}if(!d){i=a;h=e;}else v=61;}if((v|0)==61)while(1){v=0;n=(c[d+4>>2]&-8)-m|0;o=n>>>0>>0;e=o?n:e;a=o?d:a;d=c[d+16+(((c[d+16>>2]|0)==0&1)<<2)>>2]|0;if(!d){i=a;h=e;break}else v=61;}if((i|0)!=0?h>>>0<((c[47521]|0)-m|0)>>>0:0){g=i+m|0;if(g>>>0<=i>>>0){w=0;l=x;return w|0}f=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){a=i+20|0;b=c[a>>2]|0;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){b=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;}else {w=c[i+8>>2]|0;c[w+12>>2]=b;c[b+8>>2]=w;}while(0);do if(f){a=c[i+28>>2]|0;d=190380+(a<<2)|0;if((i|0)==(c[d>>2]|0)){c[d>>2]=b;if(!b){e=k&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=b;if(!b){e=k;break}}c[b+24>>2]=f;a=c[i+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b;}a=c[i+20>>2]|0;if(a){c[b+20>>2]=a;c[a+24>>2]=b;e=k;}else e=k;}else e=k;while(0);do if(h>>>0>=16){c[i+4>>2]=m|3;c[g+4>>2]=h|1;c[g+h>>2]=h;b=h>>>3;if(h>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=g;c[b+12>>2]=g;c[g+8>>2]=b;c[g+12>>2]=d;break}b=h>>>8;if(b)if(h>>>0>16777215)b=31;else {v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;b=14-(u|v|b)+(w<>>15)|0;b=h>>>(b+7|0)&1|b<<1;}else b=0;d=190380+(b<<2)|0;c[g+28>>2]=b;a=g+16|0;c[a+4>>2]=0;c[a>>2]=0;a=1<>2]=g;c[g+24>>2]=d;c[g+12>>2]=g;c[g+8>>2]=g;break}a=h<<((b|0)==31?0:25-(b>>>1)|0);d=c[d>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(h|0)){v=97;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=96;break}else {a=a<<1;d=b;}}if((v|0)==96){c[e>>2]=g;c[g+24>>2]=d;c[g+12>>2]=g;c[g+8>>2]=g;break}else if((v|0)==97){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=g;c[v>>2]=g;c[g+8>>2]=w;c[g+12>>2]=d;c[g+24>>2]=0;break}}else {w=h+m|0;c[i+4>>2]=w|3;w=i+w+4|0;c[w>>2]=c[w>>2]|1;}while(0);w=i+8|0;l=x;return w|0}else n=m;}else n=m;}else n=-1;while(0);d=c[47521]|0;if(d>>>0>=n>>>0){b=d-n|0;a=c[47524]|0;if(b>>>0>15){w=a+n|0;c[47524]=w;c[47521]=b;c[w+4>>2]=b|1;c[a+d>>2]=b;c[a+4>>2]=n|3;}else {c[47521]=0;c[47524]=0;c[a+4>>2]=d|3;w=a+d+4|0;c[w>>2]=c[w>>2]|1;}w=a+8|0;l=x;return w|0}i=c[47522]|0;if(i>>>0>n>>>0){u=i-n|0;c[47522]=u;w=c[47525]|0;v=w+n|0;c[47525]=v;c[v+4>>2]=u|1;c[w+4>>2]=n|3;w=w+8|0;l=x;return w|0}if(!(c[47637]|0)){c[47639]=4096;c[47638]=4096;c[47640]=-1;c[47641]=-1;c[47642]=0;c[47630]=0;c[47637]=p&-16^1431655768;a=4096;}else a=c[47639]|0;j=n+48|0;k=n+47|0;h=a+k|0;f=0-a|0;m=h&f;if(m>>>0<=n>>>0){w=0;l=x;return w|0}a=c[47629]|0;if(a|0?(o=c[47627]|0,p=o+m|0,p>>>0<=o>>>0|p>>>0>a>>>0):0){w=0;l=x;return w|0}b:do if(!(c[47630]&4)){d=c[47525]|0;c:do if(d){e=190524;while(1){a=c[e>>2]|0;if(a>>>0<=d>>>0?(s=e+4|0,(a+(c[s>>2]|0)|0)>>>0>d>>>0):0)break;a=c[e+8>>2]|0;if(!a){v=118;break c}else e=a;}b=h-i&f;if(b>>>0<2147483647){a=Z6(b|0)|0;if((a|0)==((c[e>>2]|0)+(c[s>>2]|0)|0)){if((a|0)!=(-1|0)){h=b;g=a;v=135;break b}}else {e=a;v=126;}}else b=0;}else v=118;while(0);do if((v|0)==118){d=Z6(0)|0;if((d|0)!=(-1|0)?(b=d,q=c[47638]|0,r=q+-1|0,b=((r&b|0)==0?0:(r+b&0-q)-b|0)+m|0,q=c[47627]|0,r=b+q|0,b>>>0>n>>>0&b>>>0<2147483647):0){s=c[47629]|0;if(s|0?r>>>0<=q>>>0|r>>>0>s>>>0:0){b=0;break}a=Z6(b|0)|0;if((a|0)==(d|0)){h=b;g=d;v=135;break b}else {e=a;v=126;}}else b=0;}while(0);do if((v|0)==126){d=0-b|0;if(!(j>>>0>b>>>0&(b>>>0<2147483647&(e|0)!=(-1|0))))if((e|0)==(-1|0)){b=0;break}else {h=b;g=e;v=135;break b}a=c[47639]|0;a=k-b+a&0-a;if(a>>>0>=2147483647){h=b;g=e;v=135;break b}if((Z6(a|0)|0)==(-1|0)){Z6(d|0)|0;b=0;break}else {h=a+b|0;g=e;v=135;break b}}while(0);c[47630]=c[47630]|4;v=133;}else {b=0;v=133;}while(0);if(((v|0)==133?m>>>0<2147483647:0)?(g=Z6(m|0)|0,s=Z6(0)|0,t=s-g|0,u=t>>>0>(n+40|0)>>>0,!((g|0)==(-1|0)|u^1|g>>>0>>0&((g|0)!=(-1|0)&(s|0)!=(-1|0))^1)):0){h=u?t:b;v=135;}if((v|0)==135){b=(c[47627]|0)+h|0;c[47627]=b;if(b>>>0>(c[47628]|0)>>>0)c[47628]=b;j=c[47525]|0;do if(j){b=190524;while(1){a=c[b>>2]|0;d=b+4|0;e=c[d>>2]|0;if((g|0)==(a+e|0)){v=143;break}f=c[b+8>>2]|0;if(!f)break;else b=f;}if(((v|0)==143?(c[b+12>>2]&8|0)==0:0)?g>>>0>j>>>0&a>>>0<=j>>>0:0){c[d>>2]=e+h;w=(c[47522]|0)+h|0;u=j+8|0;u=(u&7|0)==0?0:0-u&7;v=j+u|0;u=w-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[j+w+4>>2]=40;c[47526]=c[47641];break}if(g>>>0<(c[47523]|0)>>>0)c[47523]=g;a=g+h|0;b=190524;while(1){if((c[b>>2]|0)==(a|0)){v=151;break}b=c[b+8>>2]|0;if(!b){a=190524;break}}if((v|0)==151)if(!(c[b+12>>2]&8)){c[b>>2]=g;m=b+4|0;c[m>>2]=(c[m>>2]|0)+h;m=g+8|0;m=g+((m&7|0)==0?0:0-m&7)|0;b=a+8|0;b=a+((b&7|0)==0?0:0-b&7)|0;k=m+n|0;i=b-m-n|0;c[m+4>>2]=n|3;do if((j|0)!=(b|0)){if((c[47524]|0)==(b|0)){w=(c[47521]|0)+i|0;c[47521]=w;c[47524]=k;c[k+4>>2]=w|1;c[k+w>>2]=w;break}a=c[b+4>>2]|0;if((a&3|0)==1){h=a&-8;e=a>>>3;d:do if(a>>>0<256){a=c[b+8>>2]|0;d=c[b+12>>2]|0;if((d|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=a;break}}else {g=c[b+24>>2]|0;a=c[b+12>>2]|0;do if((a|0)==(b|0)){e=b+16|0;d=e+4|0;a=c[d>>2]|0;if(!a){a=c[e>>2]|0;if(!a){a=0;break}else d=e;}while(1){e=a+20|0;f=c[e>>2]|0;if(f|0){a=f;d=e;continue}e=a+16|0;f=c[e>>2]|0;if(!f)break;else {a=f;d=e;}}c[d>>2]=0;}else {w=c[b+8>>2]|0;c[w+12>>2]=a;c[a+8>>2]=w;}while(0);if(!g)break;d=c[b+28>>2]|0;e=190380+(d<<2)|0;do if((c[e>>2]|0)!=(b|0)){c[g+16+(((c[g+16>>2]|0)!=(b|0)&1)<<2)>>2]=a;if(!a)break d}else {c[e>>2]=a;if(a|0)break;c[47520]=c[47520]&~(1<>2]=g;d=b+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a;}d=c[d+4>>2]|0;if(!d)break;c[a+20>>2]=d;c[d+24>>2]=a;}while(0);b=b+h|0;f=h+i|0;}else f=i;b=b+4|0;c[b>>2]=c[b>>2]&-2;c[k+4>>2]=f|1;c[k+f>>2]=f;b=f>>>3;if(f>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=k;c[b+12>>2]=k;c[k+8>>2]=b;c[k+12>>2]=d;break}b=f>>>8;do if(!b)b=0;else {if(f>>>0>16777215){b=31;break}v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;b=14-(u|v|b)+(w<>>15)|0;b=f>>>(b+7|0)&1|b<<1;}while(0);e=190380+(b<<2)|0;c[k+28>>2]=b;a=k+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[47520]|0;d=1<>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}a=f<<((b|0)==31?0:25-(b>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){v=192;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=191;break}else {a=a<<1;d=b;}}if((v|0)==191){c[e>>2]=k;c[k+24>>2]=d;c[k+12>>2]=k;c[k+8>>2]=k;break}else if((v|0)==192){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=k;c[v>>2]=k;c[k+8>>2]=w;c[k+12>>2]=d;c[k+24>>2]=0;break}}else {w=(c[47522]|0)+i|0;c[47522]=w;c[47525]=k;c[k+4>>2]=w|1;}while(0);w=m+8|0;l=x;return w|0}else a=190524;while(1){b=c[a>>2]|0;if(b>>>0<=j>>>0?(w=b+(c[a+4>>2]|0)|0,w>>>0>j>>>0):0)break;a=c[a+8>>2]|0;}f=w+-47|0;a=f+8|0;a=f+((a&7|0)==0?0:0-a&7)|0;f=j+16|0;a=a>>>0>>0?j:a;b=a+8|0;d=h+-40|0;u=g+8|0;u=(u&7|0)==0?0:0-u&7;v=g+u|0;u=d-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[g+d+4>>2]=40;c[47526]=c[47641];d=a+4|0;c[d>>2]=27;c[b>>2]=c[47631];c[b+4>>2]=c[47632];c[b+8>>2]=c[47633];c[b+12>>2]=c[47634];c[47631]=g;c[47632]=h;c[47634]=0;c[47633]=b;b=a+24|0;do{v=b;b=b+4|0;c[b>>2]=7;}while((v+8|0)>>>0>>0);if((a|0)!=(j|0)){g=a-j|0;c[d>>2]=c[d>>2]&-2;c[j+4>>2]=g|1;c[a>>2]=g;b=g>>>3;if(g>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=j;c[b+12>>2]=j;c[j+8>>2]=b;c[j+12>>2]=d;break}b=g>>>8;if(b)if(g>>>0>16777215)d=31;else {v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;d=14-(u|v|d)+(w<>>15)|0;d=g>>>(d+7|0)&1|d<<1;}else d=0;e=190380+(d<<2)|0;c[j+28>>2]=d;c[j+20>>2]=0;c[f>>2]=0;b=c[47520]|0;a=1<>2]=j;c[j+24>>2]=e;c[j+12>>2]=j;c[j+8>>2]=j;break}a=g<<((d|0)==31?0:25-(d>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(g|0)){v=213;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=212;break}else {a=a<<1;d=b;}}if((v|0)==212){c[e>>2]=j;c[j+24>>2]=d;c[j+12>>2]=j;c[j+8>>2]=j;break}else if((v|0)==213){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=j;c[v>>2]=j;c[j+8>>2]=w;c[j+12>>2]=d;c[j+24>>2]=0;break}}}else {w=c[47523]|0;if((w|0)==0|g>>>0>>0)c[47523]=g;c[47631]=g;c[47632]=h;c[47634]=0;c[47528]=c[47637];c[47527]=-1;c[47532]=190116;c[47531]=190116;c[47534]=190124;c[47533]=190124;c[47536]=190132;c[47535]=190132;c[47538]=190140;c[47537]=190140;c[47540]=190148;c[47539]=190148;c[47542]=190156;c[47541]=190156;c[47544]=190164;c[47543]=190164;c[47546]=190172;c[47545]=190172;c[47548]=190180;c[47547]=190180;c[47550]=190188;c[47549]=190188;c[47552]=190196;c[47551]=190196;c[47554]=190204;c[47553]=190204;c[47556]=190212;c[47555]=190212;c[47558]=190220;c[47557]=190220;c[47560]=190228;c[47559]=190228;c[47562]=190236;c[47561]=190236;c[47564]=190244;c[47563]=190244;c[47566]=190252;c[47565]=190252;c[47568]=190260;c[47567]=190260;c[47570]=190268;c[47569]=190268;c[47572]=190276;c[47571]=190276;c[47574]=190284;c[47573]=190284;c[47576]=190292;c[47575]=190292;c[47578]=190300;c[47577]=190300;c[47580]=190308;c[47579]=190308;c[47582]=190316;c[47581]=190316;c[47584]=190324;c[47583]=190324;c[47586]=190332;c[47585]=190332;c[47588]=190340;c[47587]=190340;c[47590]=190348;c[47589]=190348;c[47592]=190356;c[47591]=190356;c[47594]=190364;c[47593]=190364;w=h+-40|0;u=g+8|0;u=(u&7|0)==0?0:0-u&7;v=g+u|0;u=w-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[g+w+4>>2]=40;c[47526]=c[47641];}while(0);b=c[47522]|0;if(b>>>0>n>>>0){u=b-n|0;c[47522]=u;w=c[47525]|0;v=w+n|0;c[47525]=v;c[v+4>>2]=u|1;c[w+4>>2]=n|3;w=w+8|0;l=x;return w|0}}c[(d2()|0)>>2]=12;w=0;l=x;return w|0}function U1(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!a)return;d=a+-8|0;f=c[47523]|0;a=c[a+-4>>2]|0;b=a&-8;j=d+b|0;do if(!(a&1)){e=c[d>>2]|0;if(!(a&3))return;h=d+(0-e)|0;g=e+b|0;if(h>>>0>>0)return;if((c[47524]|0)==(h|0)){a=j+4|0;b=c[a>>2]|0;if((b&3|0)!=3){i=h;b=g;break}c[47521]=g;c[a>>2]=b&-2;c[h+4>>2]=g|1;c[h+g>>2]=g;return}d=e>>>3;if(e>>>0<256){a=c[h+8>>2]|0;b=c[h+12>>2]|0;if((b|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=b;c[b+8>>2]=a;i=h;b=g;break}}f=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){d=h+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){a=0;break}else b=d;}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else {a=e;b=d;}}c[b>>2]=0;}else {i=c[h+8>>2]|0;c[i+12>>2]=a;c[a+8>>2]=i;}while(0);if(f){b=c[h+28>>2]|0;d=190380+(b<<2)|0;if((c[d>>2]|0)==(h|0)){c[d>>2]=a;if(!a){c[47520]=c[47520]&~(1<>2]|0)!=(h|0)&1)<<2)>>2]=a;if(!a){i=h;b=g;break}}c[a+24>>2]=f;b=h+16|0;d=c[b>>2]|0;if(d|0){c[a+16>>2]=d;c[d+24>>2]=a;}b=c[b+4>>2]|0;if(b){c[a+20>>2]=b;c[b+24>>2]=a;i=h;b=g;}else {i=h;b=g;}}else {i=h;b=g;}}else {i=d;h=d;}while(0);if(h>>>0>=j>>>0)return;a=j+4|0;e=c[a>>2]|0;if(!(e&1))return;if(!(e&2)){if((c[47525]|0)==(j|0)){j=(c[47522]|0)+b|0;c[47522]=j;c[47525]=i;c[i+4>>2]=j|1;if((i|0)!=(c[47524]|0))return;c[47524]=0;c[47521]=0;return}if((c[47524]|0)==(j|0)){j=(c[47521]|0)+b|0;c[47521]=j;c[47524]=h;c[i+4>>2]=j|1;c[h+j>>2]=j;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){b=c[j+8>>2]|0;a=c[j+12>>2]|0;if((a|0)==(b|0)){c[47519]=c[47519]&~(1<>2]=a;c[a+8>>2]=b;break}}else {g=c[j+24>>2]|0;a=c[j+12>>2]|0;do if((a|0)==(j|0)){d=j+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){d=0;break}else b=d;}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else {a=e;b=d;}}c[b>>2]=0;d=a;}else {d=c[j+8>>2]|0;c[d+12>>2]=a;c[a+8>>2]=d;d=a;}while(0);if(g|0){a=c[j+28>>2]|0;b=190380+(a<<2)|0;if((c[b>>2]|0)==(j|0)){c[b>>2]=d;if(!d){c[47520]=c[47520]&~(1<>2]|0)!=(j|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=g;a=j+16|0;b=c[a>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d;}a=c[a+4>>2]|0;if(a|0){c[d+20>>2]=a;c[a+24>>2]=d;}}}while(0);c[i+4>>2]=f|1;c[h+f>>2]=f;if((i|0)==(c[47524]|0)){c[47521]=f;return}}else {c[a>>2]=e&-2;c[i+4>>2]=b|1;c[h+b>>2]=b;f=b;}a=f>>>3;if(f>>>0<256){d=190116+(a<<1<<2)|0;b=c[47519]|0;a=1<>2]|0;}c[b>>2]=i;c[a+12>>2]=i;c[i+8>>2]=a;c[i+12>>2]=d;return}a=f>>>8;if(a)if(f>>>0>16777215)a=31;else {h=(a+1048320|0)>>>16&8;j=a<>>16&4;j=j<>>16&2;a=14-(g|h|a)+(j<>>15)|0;a=f>>>(a+7|0)&1|a<<1;}else a=0;e=190380+(a<<2)|0;c[i+28>>2]=a;c[i+20>>2]=0;c[i+16>>2]=0;b=c[47520]|0;d=1<>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){a=73;break}e=d+16+(b>>>31<<2)|0;a=c[e>>2]|0;if(!a){a=72;break}else {b=b<<1;d=a;}}if((a|0)==72){c[e>>2]=i;c[i+24>>2]=d;c[i+12>>2]=i;c[i+8>>2]=i;break}else if((a|0)==73){h=d+8|0;j=c[h>>2]|0;c[j+12>>2]=i;c[h>>2]=i;c[i+8>>2]=j;c[i+12>>2]=d;c[i+24>>2]=0;break}}else {c[47520]=b|d;c[e>>2]=i;c[i+24>>2]=e;c[i+12>>2]=i;c[i+8>>2]=i;}while(0);j=(c[47527]|0)+-1|0;c[47527]=j;if(!j)a=190532;else return;while(1){a=c[a>>2]|0;if(!a)break;else a=a+8|0;}c[47527]=-1;return}function V1(a,b){a=a|0;b=b|0;var d=0;if(a){d=O(b,a)|0;if((b|a)>>>0>65535)d=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1;}else d=0;a=T1(d)|0;if(!a)return a|0;if(!(c[a+-4>>2]&3))return a|0;Y6(a|0,0,d|0)|0;return a|0}function W1(a,b){a=a|0;b=b|0;var d=0,e=0;if(!a){b=T1(b)|0;return b|0}if(b>>>0>4294967231){c[(d2()|0)>>2]=12;b=0;return b|0}d=X1(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(d|0){b=d+8|0;return b|0}d=T1(b)|0;if(!d){b=0;return b|0}e=c[a+-4>>2]|0;e=(e&-8)-((e&3|0)==0?8:4)|0;W6(d|0,a|0,(e>>>0>>0?e:b)|0)|0;U1(a);b=d;return b|0}function X1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=a+4|0;m=c[l>>2]|0;d=m&-8;i=a+d|0;if(!(m&3)){if(b>>>0<256){a=0;return a|0}if(d>>>0>=(b+4|0)>>>0?(d-b|0)>>>0<=c[47639]<<1>>>0:0)return a|0;a=0;return a|0}if(d>>>0>=b>>>0){d=d-b|0;if(d>>>0<=15)return a|0;k=a+b|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|3;m=i+4|0;c[m>>2]=c[m>>2]|1;Y1(k,d);return a|0}if((c[47525]|0)==(i|0)){k=(c[47522]|0)+d|0;d=k-b|0;e=a+b|0;if(k>>>0<=b>>>0){a=0;return a|0}c[l>>2]=m&1|b|2;c[e+4>>2]=d|1;c[47525]=e;c[47522]=d;return a|0}if((c[47524]|0)==(i|0)){e=(c[47521]|0)+d|0;if(e>>>0>>0){a=0;return a|0}d=e-b|0;if(d>>>0>15){k=a+b|0;e=a+e|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|1;c[e>>2]=d;e=e+4|0;c[e>>2]=c[e>>2]&-2;e=k;}else {c[l>>2]=m&1|e|2;e=a+e+4|0;c[e>>2]=c[e>>2]|1;e=0;d=0;}c[47521]=d;c[47524]=e;return a|0}e=c[i+4>>2]|0;if(e&2|0){a=0;return a|0}j=(e&-8)+d|0;if(j>>>0>>0){a=0;return a|0}k=j-b|0;f=e>>>3;do if(e>>>0<256){e=c[i+8>>2]|0;d=c[i+12>>2]|0;if((d|0)==(e|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=e;break}}else {h=c[i+24>>2]|0;d=c[i+12>>2]|0;do if((d|0)==(i|0)){f=i+16|0;e=f+4|0;d=c[e>>2]|0;if(!d){d=c[f>>2]|0;if(!d){f=0;break}else g=f;}else g=e;while(1){f=d+20|0;e=c[f>>2]|0;if(e|0){d=e;g=f;continue}e=d+16|0;f=c[e>>2]|0;if(!f)break;else {d=f;g=e;}}c[g>>2]=0;f=d;}else {f=c[i+8>>2]|0;c[f+12>>2]=d;c[d+8>>2]=f;f=d;}while(0);if(h|0){d=c[i+28>>2]|0;e=190380+(d<<2)|0;if((c[e>>2]|0)==(i|0)){c[e>>2]=f;if(!f){c[47520]=c[47520]&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=f;if(!f)break}c[f+24>>2]=h;d=i+16|0;e=c[d>>2]|0;if(e|0){c[f+16>>2]=e;c[e+24>>2]=f;}d=c[d+4>>2]|0;if(d|0){c[f+20>>2]=d;c[d+24>>2]=f;}}}while(0);if(k>>>0<16){c[l>>2]=j|m&1|2;m=a+j+4|0;c[m>>2]=c[m>>2]|1;return a|0}else {i=a+b|0;c[l>>2]=m&1|b|2;c[i+4>>2]=k|3;m=a+j+4|0;c[m>>2]=c[m>>2]|1;Y1(i,k);return a|0}return 0}function Y1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+b|0;d=c[a+4>>2]|0;do if(!(d&1)){f=c[a>>2]|0;if(!(d&3))return;h=a+(0-f)|0;b=f+b|0;if((c[47524]|0)==(h|0)){a=i+4|0;d=c[a>>2]|0;if((d&3|0)!=3)break;c[47521]=b;c[a>>2]=d&-2;c[h+4>>2]=b|1;c[i>>2]=b;return}e=f>>>3;if(f>>>0<256){a=c[h+8>>2]|0;d=c[h+12>>2]|0;if((d|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=a;break}}g=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){e=h+16|0;d=e+4|0;a=c[d>>2]|0;if(!a){a=c[e>>2]|0;if(!a){a=0;break}else d=e;}while(1){e=a+20|0;f=c[e>>2]|0;if(f|0){a=f;d=e;continue}e=a+16|0;f=c[e>>2]|0;if(!f)break;else {a=f;d=e;}}c[d>>2]=0;}else {f=c[h+8>>2]|0;c[f+12>>2]=a;c[a+8>>2]=f;}while(0);if(g){d=c[h+28>>2]|0;e=190380+(d<<2)|0;if((c[e>>2]|0)==(h|0)){c[e>>2]=a;if(!a){c[47520]=c[47520]&~(1<>2]|0)!=(h|0)&1)<<2)>>2]=a;if(!a)break}c[a+24>>2]=g;d=h+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a;}d=c[d+4>>2]|0;if(d){c[a+20>>2]=d;c[d+24>>2]=a;}}}else h=a;while(0);a=i+4|0;e=c[a>>2]|0;if(!(e&2)){if((c[47525]|0)==(i|0)){i=(c[47522]|0)+b|0;c[47522]=i;c[47525]=h;c[h+4>>2]=i|1;if((h|0)!=(c[47524]|0))return;c[47524]=0;c[47521]=0;return}if((c[47524]|0)==(i|0)){i=(c[47521]|0)+b|0;c[47521]=i;c[47524]=h;c[h+4>>2]=i|1;c[h+i>>2]=i;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){a=c[i+8>>2]|0;b=c[i+12>>2]|0;if((b|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=b;c[b+8>>2]=a;break}}else {g=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){d=i+16|0;a=d+4|0;b=c[a>>2]|0;if(!b){b=c[d>>2]|0;if(!b){d=0;break}else a=d;}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;d=b;}else {d=c[i+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b;}while(0);if(g|0){b=c[i+28>>2]|0;a=190380+(b<<2)|0;if((c[a>>2]|0)==(i|0)){c[a>>2]=d;if(!d){c[47520]=c[47520]&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=g;b=i+16|0;a=c[b>>2]|0;if(a|0){c[d+16>>2]=a;c[a+24>>2]=d;}b=c[b+4>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d;}}}while(0);c[h+4>>2]=f|1;c[h+f>>2]=f;if((h|0)==(c[47524]|0)){c[47521]=f;return}}else {c[a>>2]=e&-2;c[h+4>>2]=b|1;c[h+b>>2]=b;f=b;}b=f>>>3;if(f>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=h;c[b+12>>2]=h;c[h+8>>2]=b;c[h+12>>2]=d;return}b=f>>>8;if(b)if(f>>>0>16777215)b=31;else {g=(b+1048320|0)>>>16&8;i=b<>>16&4;i=i<>>16&2;b=14-(e|g|b)+(i<>>15)|0;b=f>>>(b+7|0)&1|b<<1;}else b=0;e=190380+(b<<2)|0;c[h+28>>2]=b;c[h+20>>2]=0;c[h+16>>2]=0;a=c[47520]|0;d=1<>2]=h;c[h+24>>2]=e;c[h+12>>2]=h;c[h+8>>2]=h;return}a=f<<((b|0)==31?0:25-(b>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){b=69;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){b=68;break}else {a=a<<1;d=b;}}if((b|0)==68){c[e>>2]=h;c[h+24>>2]=d;c[h+12>>2]=h;c[h+8>>2]=h;return}else if((b|0)==69){g=d+8|0;i=c[g>>2]|0;c[i+12>>2]=h;c[g>>2]=h;c[h+8>>2]=i;c[h+12>>2]=d;c[h+24>>2]=0;return}}function Z1(a,b){a=a|0;b=b|0;if(a>>>0<9){b=T1(b)|0;return b|0}else {b=_1(a,b)|0;return b|0}return 0}function _1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;a=a>>>0>16?a:16;if(a+-1&a){d=16;while(1)if(d>>>0>>0)d=d<<1;else {a=d;break}}if((-64-a|0)>>>0<=b>>>0){c[(d2()|0)>>2]=12;h=0;return h|0}g=b>>>0<11?16:b+11&-8;d=T1(g+12+a|0)|0;if(!d){h=0;return h|0}f=d+-8|0;do if(a+-1&d){e=(d+a+-1&0-a)+-8|0;b=f;e=(e-b|0)>>>0>15?e:e+a|0;b=e-b|0;a=d+-4|0;i=c[a>>2]|0;d=(i&-8)-b|0;if(!(i&3)){c[e>>2]=(c[f>>2]|0)+b;c[e+4>>2]=d;a=e;b=e;break}else {i=e+4|0;c[i>>2]=d|c[i>>2]&1|2;d=e+d+4|0;c[d>>2]=c[d>>2]|1;c[a>>2]=b|c[a>>2]&1|2;c[i>>2]=c[i>>2]|1;Y1(f,b);a=e;b=e;break}}else {a=f;b=f;}while(0);a=a+4|0;d=c[a>>2]|0;if(d&3|0?(h=d&-8,h>>>0>(g+16|0)>>>0):0){i=h-g|0;f=b+g|0;c[a>>2]=g|d&1|2;c[f+4>>2]=i|3;h=b+h+4|0;c[h>>2]=c[h>>2]|1;Y1(f,i);}i=b+8|0;return i|0}function $1(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=e2(c[a+60>>2]|0)|0;a=c2(Ja(6,d|0)|0)|0;l=b;return a|0}function a2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+32|0;f=k;i=k+16|0;c[i>>2]=d;g=i+4|0;j=b+48|0;m=c[j>>2]|0;c[g>>2]=e-((m|0)!=0&1);h=b+44|0;c[i+8>>2]=c[h>>2];c[i+12>>2]=m;c[f>>2]=c[b+60>>2];c[f+4>>2]=i;c[f+8>>2]=2;f=c2(ya(145,f|0)|0)|0;if((f|0)>=1){i=c[g>>2]|0;if(f>>>0>i>>>0){g=c[h>>2]|0;h=b+4|0;c[h>>2]=g;c[b+8>>2]=g+(f-i);if(!(c[j>>2]|0))f=e;else {c[h>>2]=g+1;a[d+(e+-1)>>0]=a[g>>0]|0;f=e;}}}else c[b>>2]=c[b>>2]|f&48^16;l=k;return f|0}function b2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+32|0;g=f;e=f+20|0;c[g>>2]=c[a+60>>2];c[g+4>>2]=0;c[g+8>>2]=b;c[g+12>>2]=e;c[g+16>>2]=d;if((c2(xa(140,g|0)|0)|0)<0){c[e>>2]=-1;a=-1;}else a=c[e>>2]|0;l=f;return a|0}function c2(a){a=a|0;if(a>>>0>4294963200){c[(d2()|0)>>2]=0-a;a=-1;}return a|0}function d2(){return 190572}function e2(a){a=a|0;return a|0}function f2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;f=g;c[b+36>>2]=18;if((c[b>>2]&64|0)==0?(c[f>>2]=c[b+60>>2],c[f+4>>2]=21523,c[f+8>>2]=g+16,Ia(54,f|0)|0):0)a[b+75>>0]=-1;f=g2(b,d,e)|0;l=g;return f|0}function g2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+48|0;k=n+16|0;g=n;f=n+32|0;i=a+28|0;e=c[i>>2]|0;c[f>>2]=e;j=a+20|0;e=(c[j>>2]|0)-e|0;c[f+4>>2]=e;c[f+8>>2]=b;c[f+12>>2]=d;e=e+d|0;h=a+60|0;c[g>>2]=c[h>>2];c[g+4>>2]=f;c[g+8>>2]=2;g=c2(za(146,g|0)|0)|0;a:do if((e|0)!=(g|0)){b=2;while(1){if((g|0)<0)break;e=e-g|0;p=c[f+4>>2]|0;o=g>>>0>p>>>0;f=o?f+8|0:f;b=b+(o<<31>>31)|0;p=g-(o?p:0)|0;c[f>>2]=(c[f>>2]|0)+p;o=f+4|0;c[o>>2]=(c[o>>2]|0)-p;c[k>>2]=c[h>>2];c[k+4>>2]=f;c[k+8>>2]=b;g=c2(za(146,k|0)|0)|0;if((e|0)==(g|0)){m=3;break a}}c[a+16>>2]=0;c[i>>2]=0;c[j>>2]=0;c[a>>2]=c[a>>2]|32;if((b|0)==2)d=0;else d=d-(c[f+4>>2]|0)|0;}else m=3;while(0);if((m|0)==3){p=c[a+44>>2]|0;c[a+16>>2]=p+(c[a+48>>2]|0);c[i>>2]=p;c[j>>2]=p;}l=n;return d|0}function h2(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=a;c[e+4>>2]=b;b=c2(Ka(91,e|0)|0)|0;l=d;return b|0}function i2(){return}function j2(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=l;l=l+32|0;h=i;do if((g&4095|0)==0&(((g|0)<0)<<31>>31&-4096|0)==0){if(b>>>0>2147483646){c[(d2()|0)>>2]=12;a=-1;break}c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=d;c[h+12>>2]=e;c[h+16>>2]=f;c[h+20>>2]=g>>12;a=c2(Aa(192,h|0)|0)|0;}else {c[(d2()|0)>>2]=22;a=-1;}while(0);l=i;return a|0}function k2(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d&255;a:do if(!f)b=b+(l2(b)|0)|0;else {if(b&3){e=d&255;do{g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break a;b=b+1|0;}while((b&3|0)!=0)}f=O(f,16843009)|0;e=c[b>>2]|0;b:do if(!((e&-2139062144^-2139062144)&e+-16843009))do{g=e^f;if((g&-2139062144^-2139062144)&g+-16843009|0)break b;b=b+4|0;e=c[b>>2]|0;}while(!((e&-2139062144^-2139062144)&e+-16843009|0));while(0);e=d&255;while(1){g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break;else b=b+1|0;}}while(0);return b|0}function l2(b){b=b|0;var d=0,e=0,f=0;f=b;a:do if(!(f&3))e=4;else {d=f;while(1){if(!(a[b>>0]|0)){b=d;break a}b=b+1|0;d=b;if(!(d&3)){e=4;break}}}while(0);if((e|0)==4){while(1){d=c[b>>2]|0;if(!((d&-2139062144^-2139062144)&d+-16843009))b=b+4|0;else break}if((d&255)<<24>>24)do b=b+1|0;while((a[b>>0]|0)!=0)}return b-f|0}function m2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+48|0;g=h+16|0;f=h;e=h+32|0;if(!(b&4194368))e=0;else {c[e>>2]=d;i=(c[e>>2]|0)+(4-1)&~(4-1);d=c[i>>2]|0;c[e>>2]=i+4;e=d;}c[f>>2]=a;c[f+4>>2]=b|32768;c[f+8>>2]=e;e=Ha(5,f|0)|0;if(!((b&524288|0)==0|(e|0)<0)){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;}i=c2(e)|0;l=h;return i|0}function n2(b,e){b=b|0;e=e|0;var f=0,g=0;g=0;while(1){if((d[144531+g>>0]|0)==(b|0)){b=2;break}f=g+1|0;if((f|0)==87){f=144619;g=87;b=5;break}else g=f;}if((b|0)==2)if(!g)f=144619;else {f=144619;b=5;}if((b|0)==5)while(1){do{b=f;f=f+1|0;}while((a[b>>0]|0)!=0);g=g+-1|0;if(!g)break;else b=5;}return o2(f,c[e+20>>2]|0)|0}function o2(a,b){a=a|0;b=b|0;return p2(a,b)|0}function p2(a,b){a=a|0;b=b|0;if(!b)b=0;else b=q2(c[b>>2]|0,c[b+4>>2]|0,a)|0;return (b|0?b:a)|0}function q2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=(c[b>>2]|0)+1794895138|0;h=r2(c[b+8>>2]|0,o)|0;f=r2(c[b+12>>2]|0,o)|0;g=r2(c[b+16>>2]|0,o)|0;a:do if((h>>>0>>2>>>0?(n=d-(h<<2)|0,f>>>0>>0&g>>>0>>0):0)?((g|f)&3|0)==0:0){n=f>>>2;m=g>>>2;l=0;while(1){j=h>>>1;k=l+j|0;i=k<<1;g=i+n|0;f=r2(c[b+(g<<2)>>2]|0,o)|0;g=r2(c[b+(g+1<<2)>>2]|0,o)|0;if(!(g>>>0>>0&f>>>0<(d-g|0)>>>0)){f=0;break a}if(a[b+(g+f)>>0]|0){f=0;break a}f=s2(e,b+g|0)|0;if(!f)break;f=(f|0)<0;if((h|0)==1){f=0;break a}else {l=f?l:k;h=f?j:h-j|0;}}f=i+m|0;g=r2(c[b+(f<<2)>>2]|0,o)|0;f=r2(c[b+(f+1<<2)>>2]|0,o)|0;if(f>>>0>>0&g>>>0<(d-f|0)>>>0)f=(a[b+(f+g)>>0]|0)==0?b+f|0:0;else f=0;}else f=0;while(0);return f|0}function r2(a,b){a=a|0;b=b|0;var c=0;c=T6(a|0)|0;return ((b|0)==0?a:c)|0}function s2(b,c){b=b|0;c=c|0;var d=0,e=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24)b=e;else {do{b=b+1|0;c=c+1|0;d=a[b>>0]|0;e=a[c>>0]|0;}while(!(d<<24>>24==0?1:d<<24>>24!=e<<24>>24));b=e;}return (d&255)-(b&255)|0}function t2(a){a=a|0;return n2(a,c[(u2()|0)+188>>2]|0)|0}function u2(){return v2()|0}function v2(){return 62976}function w2(a,b,c){a=+a;b=+b;c=c|0;var d=0.0,e=0.0,f=0.0;f=a*a;d=f*(f*f)*(f*1.58969099521155e-10+-2.5050760253406863e-08)+(f*(f*2.7557313707070068e-06+-1.984126982985795e-04)+.00833333333332249);e=f*a;if(!c)a=e*(f*d+-.16666666666666632)+a;else a=a-(e*.16666666666666632+(f*(b*.5-e*d)-b));return +a}function x2(a){a=+a;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,k=0.0,l=0.0,m=0.0;h[j>>3]=a;b=c[j>>2]|0;d=c[j+4>>2]|0;e=(d|0)<0;do if(e|d>>>0<1048576){if((b|0)==0&(d&2147483647|0)==0){a=-1.0/(a*a);break}if(e){a=(a-a)/0.0;break}else {h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;e=-1077;b=c[j>>2]|0;f=9;break}}else if(d>>>0<=2146435071)if((b|0)==0&0==0&(d|0)==1072693248)a=0.0;else {e=-1023;f=9;}while(0);if((f|0)==9){f=d+614242|0;c[j>>2]=b;c[j+4>>2]=(f&1048575)+1072079006;m=+h[j>>3]+-1.0;k=m*(m*.5);i=m/(m+2.0);l=i*i;g=l*l;h[j>>3]=m-k;d=c[j+4>>2]|0;c[j>>2]=0;c[j+4>>2]=d;a=+h[j>>3];g=m-a-k+i*(k+(g*(g*(g*.15313837699209373+.22222198432149784)+.3999999999940942)+l*(g*(g*(g*.14798198605116586+.1818357216161805)+.2857142874366239)+.6666666666666735)));l=a*1.4426950407214463;k=+(e+(f>>>20)|0);i=l+k;a=i+(l+(k-i)+(g*1.4426950407214463+(g+a)*1.6751713164886512e-10));}return +a}function y2(a,b){a=+a;b=b|0;var d=0,e=0,f=0;h[j>>3]=a;d=c[j>>2]|0;e=c[j+4>>2]|0;f=Q6(d|0,e|0,52)|0;switch(f&2047){case 0:{if(a!=0.0){a=+y2(a*18446744073709551616.0,b);d=(c[b>>2]|0)+-64|0;}else d=0;c[b>>2]=d;break}case 2047:break;default:{c[b>>2]=(f&2047)+-1022;c[j>>2]=d;c[j+4>>2]=e&-2146435073|1071644672;a=+h[j>>3];}}return +a}function z2(a,b){a=+a;b=+b;var c=0.0,d=0.0,e=0.0,f=0.0;c=a*a;d=c*c;e=c*.5;f=1.0-e;return +(f+(1.0-f-e+(c*(c*(c*(c*2.480158728947673e-05+-.001388888888887411)+.0416666666666666)+d*d*(c*(2.087572321298175e-09-c*1.1359647557788195e-11)+-2.7557314351390663e-07))-a*b)))}function A2(a){a=+a;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,k=0.0,l=0.0,m=0.0;h[j>>3]=a;b=c[j>>2]|0;d=c[j+4>>2]|0;e=(d|0)<0;do if(e|d>>>0<1048576){if((b|0)==0&(d&2147483647|0)==0){a=-1.0/(a*a);break}if(e){a=(a-a)/0.0;break}else {h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;e=-1077;b=c[j>>2]|0;f=9;break}}else if(d>>>0<=2146435071)if((b|0)==0&0==0&(d|0)==1072693248)a=0.0;else {e=-1023;f=9;}while(0);if((f|0)==9){f=d+614242|0;c[j>>2]=b;c[j+4>>2]=(f&1048575)+1072079006;k=+h[j>>3]+-1.0;i=k*(k*.5);l=k/(k+2.0);m=l*l;g=m*m;h[j>>3]=k-i;d=c[j+4>>2]|0;c[j>>2]=0;c[j+4>>2]=d;a=+h[j>>3];g=k-a-i+l*(i+(g*(g*(g*.15313837699209373+.22222198432149784)+.3999999999940942)+m*(g*(g*(g*.14798198605116586+.1818357216161805)+.2857142874366239)+.6666666666666735)));m=a*.4342944818781689;i=+(e+(f>>>20)|0);l=i*.30102999566361177;k=l+m;a=k+(m+(l-k)+(g*.4342944818781689+(i*3.694239077158931e-13+(g+a)*2.5082946711645275e-11)));}return +a}function B2(a,b){a=+a;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+48|0;m=r+16|0;n=r;h[j>>3]=a;d=c[j>>2]|0;i=c[j+4>>2]|0;o=Q6(d|0,i|0,63)|0;q=i&2147483647;do if(q>>>0<1074752123)if((i&1048575|0)!=598523){d=(o|0)!=0;if(q>>>0<1073928573)if(d){g=a+1.5707963267341256;k=g+6.077100506506192e-11;h[b>>3]=k;h[b+8>>3]=g-k+6.077100506506192e-11;d=-1;break}else {g=a+-1.5707963267341256;k=g+-6.077100506506192e-11;h[b>>3]=k;h[b+8>>3]=g-k+-6.077100506506192e-11;d=1;break}else if(d){g=a+3.1415926534682512;k=g+1.2154201013012384e-10;h[b>>3]=k;h[b+8>>3]=g-k+1.2154201013012384e-10;d=-2;break}else {g=a+-3.1415926534682512;k=g+-1.2154201013012384e-10;h[b>>3]=k;h[b+8>>3]=g-k+-1.2154201013012384e-10;d=2;break}}else p=21;else {if(q>>>0<1075594812)if(q>>>0<1075183037){if((q|0)==1074977148){p=21;break}if(!o){g=a+-4.712388980202377;k=g+-1.8231301519518578e-10;h[b>>3]=k;h[b+8>>3]=g-k+-1.8231301519518578e-10;d=3;break}else {g=a+4.712388980202377;k=g+1.8231301519518578e-10;h[b>>3]=k;h[b+8>>3]=g-k+1.8231301519518578e-10;d=-3;break}}else {if((q|0)==1075388923){p=21;break}if(!o){g=a+-6.2831853069365025;k=g+-2.430840202602477e-10;h[b>>3]=k;h[b+8>>3]=g-k+-2.430840202602477e-10;d=4;break}else {g=a+6.2831853069365025;k=g+2.430840202602477e-10;h[b>>3]=k;h[b+8>>3]=g-k+2.430840202602477e-10;d=-4;break}}if(q>>>0>=1094263291){if(q>>>0>2146435071){k=a-a;h[b+8>>3]=k;h[b>>3]=k;d=0;break}c[j>>2]=d;c[j+4>>2]=i&1048575|1096810496;a=+h[j>>3];d=0;do{k=+(~~a|0);h[m+(d<<3)>>3]=k;a=(a-k)*16777216.0;d=d+1|0;}while((d|0)!=2);h[m+16>>3]=a;if(a==0.0){d=1;while(1)if(+h[m+(d<<3)>>3]==0.0)d=d+-1|0;else break}else d=2;d=C2(m,n,(q>>>20)+-1046|0,d+1|0,1)|0;a=+h[n>>3];if(!o){h[b>>3]=a;h[b+8>>3]=+h[n+8>>3];break}else {h[b>>3]=-a;h[b+8>>3]=-+h[n+8>>3];d=0-d|0;break}}else p=21;}while(0);if((p|0)==21){g=a*.6366197723675814+6755399441055744.0+-6755399441055744.0;d=~~g;e=a-g*1.5707963267341256;f=g*6.077100506506192e-11;a=e-f;h[b>>3]=a;h[j>>3]=a;p=Q6(c[j>>2]|0,c[j+4>>2]|0,52)|0;i=q>>>20;if((i-(p&2047)|0)>16){f=g*6.077100506303966e-11;k=e-f;f=g*2.0222662487959506e-21-(e-k-f);a=k-f;h[b>>3]=a;h[j>>3]=a;q=Q6(c[j>>2]|0,c[j+4>>2]|0,52)|0;s=g*2.0222662487111665e-21;e=k-s;g=g*8.4784276603689e-32-(k-e-s);if((i-(q&2047)|0)>49){a=e-g;h[b>>3]=a;f=g;}else e=k;}h[b+8>>3]=e-a-f;}l=r;return d|0}function C2(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0;H=l;l=l+560|0;C=H+480|0;z=H+320|0;G=H+160|0;E=H;D=c[63220+(f<<2)>>2]|0;p=e+-1|0;y=(d+-3|0)/24|0;y=(y|0)>0?y:0;B=O(y,-24)|0;j=d+-24+B|0;if((D+p|0)>=0){n=D+e|0;k=y-p|0;m=0;while(1){if((k|0)<0)g=0.0;else g=+(c[63236+(k<<2)>>2]|0);h[z+(m<<3)>>3]=g;m=m+1|0;if((m|0)==(n|0))break;else k=k+1|0;}}o=(e|0)>0;n=0;while(1){if(o){m=n+p|0;g=0.0;k=0;do{g=g+ +h[a+(k<<3)>>3]*+h[z+(m-k<<3)>>3];k=k+1|0;}while((k|0)!=(e|0))}else g=0.0;h[E+(n<<3)>>3]=g;if((n|0)<(D|0))n=n+1|0;else break}t=(j|0)>0;u=24-j|0;v=23-j|0;w=(e|0)>0;x=(j|0)==0;k=D;a:while(1){g=+h[E+(k<<3)>>3];o=(k|0)>0;if(o){m=k;n=0;while(1){i=+(~~(g*5.9604644775390625e-08)|0);c[C+(n<<2)>>2]=~~(g-i*16777216.0);s=m;m=m+-1|0;g=+h[E+(m<<3)>>3]+i;if((s|0)<=1)break;else n=n+1|0;}}g=+D2(g,j);g=g-+A(+(g*.125))*8.0;m=~~g;g=g-+(m|0);do if(!t)if(!x)if(!(g>=.5)){p=0;s=m;break}else {n=2;F=20;break}else {n=c[C+(k+-1<<2)>>2]>>23;F=19;break}else {s=C+(k+-1<<2)|0;n=c[s>>2]|0;F=n>>u;n=n-(F<>2]=n;n=n>>v;m=F+m|0;F=19;}while(0);if((F|0)==19){F=0;if((n|0)>0)F=20;else {p=n;s=m;}}if((F|0)==20){F=0;s=m+1|0;if(o){m=0;r=0;do{p=C+(r<<2)|0;q=c[p>>2]|0;if(!m)if(!q)m=0;else {m=1;o=16777216;F=23;}else {o=16777215;F=23;}if((F|0)==23){F=0;c[p>>2]=o-q;}r=r+1|0;}while((r|0)!=(k|0))}else m=0;b:do if(t){switch(j|0){case 1:{o=8388607;break}case 2:{o=4194303;break}default:break b}r=C+(k+-1<<2)|0;c[r>>2]=c[r>>2]&o;}while(0);if((n|0)==2){g=1.0-g;if(!m)p=2;else {p=2;g=g-+D2(1.0,j);}}else p=n;}if(!(g==0.0)){F=42;break}if((k|0)>(D|0)){m=0;n=k;do{n=n+-1|0;m=c[C+(n<<2)>>2]|m;}while((n|0)>(D|0));if(m){F=41;break}else m=1;}else m=1;while(1)if(!(c[C+(D-m<<2)>>2]|0))m=m+1|0;else break;o=m+k|0;if((m|0)<=0){k=o;continue}while(1){n=k+1|0;m=k+e|0;h[z+(m<<3)>>3]=+(c[63236+(n+y<<2)>>2]|0);if(w){g=0.0;k=0;do{g=g+ +h[a+(k<<3)>>3]*+h[z+(m-k<<3)>>3];k=k+1|0;}while((k|0)!=(e|0))}else g=0.0;h[E+(n<<3)>>3]=g;if((n|0)<(o|0))k=n;else {k=o;continue a}}}if((F|0)==41)while(1){F=0;j=j+-24|0;k=k+-1|0;if(!(c[C+(k<<2)>>2]|0))F=41;else {o=k;break}}else if((F|0)==42){g=+D2(g,0-j|0);if(g>=16777216.0){i=+(~~(g*5.9604644775390625e-08)|0);c[C+(k<<2)>>2]=~~(g-i*16777216.0);j=B+d|0;k=k+1|0;g=i;}c[C+(k<<2)>>2]=~~g;o=k;}n=(o|0)>-1;if(n){g=+D2(1.0,j);j=o;while(1){h[E+(j<<3)>>3]=g*+(c[C+(j<<2)>>2]|0);if((j|0)>0){g=g*5.9604644775390625e-08;j=j+-1|0;}else break}if(n){k=o;while(1){m=o-k|0;j=0;g=0.0;while(1){g=g+ +h[10904+(j<<3)>>3]*+h[E+(j+k<<3)>>3];if((j|0)>=(D|0)|(j|0)>=(m|0))break;else j=j+1|0;}h[G+(m<<3)>>3]=g;if((k|0)>0)k=k+-1|0;else break}}}switch(f|0){case 0:{if(n){g=0.0;j=o;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)>0)j=j+-1|0;else break}}else g=0.0;i=(p|0)==0?g:-g;F=73;break}case 2:case 1:{if(n){g=0.0;j=o;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)>0)j=j+-1|0;else break}}else g=0.0;k=(p|0)==0;h[b>>3]=k?g:-g;g=+h[G>>3]-g;if((o|0)>=1){j=1;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)==(o|0))break;else j=j+1|0;}}i=k?g:-g;b=b+8|0;F=73;break}case 3:{if((o|0)>0){j=o;g=+h[G+(o<<3)>>3];do{F=j;j=j+-1|0;E=G+(j<<3)|0;i=+h[E>>3];I=g;g=i+g;h[G+(F<<3)>>3]=I+(i-g);h[E>>3]=g;}while((F|0)>1);k=(o|0)>1;if(k){j=o;g=+h[G+(o<<3)>>3];do{F=j;j=j+-1|0;E=G+(j<<3)|0;I=+h[E>>3];i=g;g=I+g;h[G+(F<<3)>>3]=i+(I-g);h[E>>3]=g;}while((F|0)>2);if(k){j=o;i=0.0;while(1){i=i+ +h[G+(j<<3)>>3];if((j|0)>2)j=j+-1|0;else break}}else i=0.0;}else i=0.0;}else i=0.0;g=+h[G>>3];if(!p){h[b>>3]=g;g=+h[G+8>>3];}else {h[b>>3]=-g;i=-i;g=-+h[G+8>>3];}h[b+8>>3]=g;b=b+16|0;F=73;break}default:{}}if((F|0)==73)h[b>>3]=i;l=H;return s&7|0}function D2(a,b){a=+a;b=b|0;var d=0,e=0;if((b|0)<=1023){if((b|0)<-1022){a=a*2.2250738585072014e-308;e=(b|0)<-2044;d=b+2044|0;a=e?a*2.2250738585072014e-308:a;b=e?((d|0)>-1022?d:-1022):b+1022|0;}}else {a=a*8988465674311579538646525.0e283;d=(b|0)>2046;e=b+-2046|0;a=d?a*8988465674311579538646525.0e283:a;b=d?((e|0)<1023?e:1023):b+-1023|0;}d=R6(b+1023|0,0,52)|0;e=z;c[j>>2]=d;c[j+4>>2]=e;return +(a*+h[j>>3])}function E2(a){a=+a;var b=0,d=0,e=0,f=0.0,g=0.0;h[j>>3]=a;d=c[j+4>>2]|0;b=d&2147483647;do if(b>>>0>2146435071)a=a+a;else {if(b>>>0<1048576){h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;b=d&2147483647;if(!b)break;else e=696219795;}else e=715094163;c[j>>2]=0;c[j+4>>2]=((b>>>0)/3|0)+e|d&-2147483648;f=+h[j>>3];g=f*f*(f/a);h[j>>3]=(g*(g*g)*(g*.14599619288661245+-.758397934778766)+(g*(g*1.6214297201053545+-1.8849797954337717)+1.87595182427177))*f;d=J6(c[j>>2]|0,c[j+4>>2]|0,-2147483648,0)|0;e=z;c[j>>2]=d&-1073741824;c[j+4>>2]=e;f=+h[j>>3];a=a/(f*f);a=(a-f)/(f+f+a)*f+f;}while(0);return +a}function F2(a,b){a=+a;b=+b;var d=0,e=0;h[j>>3]=a;e=c[j>>2]|0;d=c[j+4>>2]|0;h[j>>3]=b;d=c[j+4>>2]&-2147483648|d&2147483647;c[j>>2]=e;c[j+4>>2]=d;return +(+h[j>>3])}function G2(a,b){a=+a;b=+b;return +(+F2(a,b))}function H2(a,b){a=+a;b=b|0;return +(+D2(a,b))}function I2(a,b){a=+a;b=+b;return +(+J2(a,b))}function J2(a,b){a=+a;b=+b;var d=0,e=0,f=0,g=0,i=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h[j>>3]=a;i=c[j>>2]|0;l=c[j+4>>2]|0;h[j>>3]=b;n=c[j>>2]|0;o=c[j+4>>2]|0;e=Q6(i|0,l|0,52)|0;e=e&2047;m=Q6(n|0,o|0,52)|0;m=m&2047;p=l&-2147483648;g=R6(n|0,o|0,1)|0;k=z;a:do if(!((g|0)==0&(k|0)==0)?(f=K2(b)|0,d=z&2147483647,!((e|0)==2047|(d>>>0>2146435072|(d|0)==2146435072&f>>>0>0))):0){d=R6(i|0,l|0,1)|0;f=z;if(!(f>>>0>k>>>0|(f|0)==(k|0)&d>>>0>g>>>0))return +((d|0)==(g|0)&(f|0)==(k|0)?a*0.0:a);if(!e){d=R6(i|0,l|0,12)|0;f=z;if((f|0)>-1|(f|0)==-1&d>>>0>4294967295){e=0;do{e=e+-1|0;d=R6(d|0,f|0,1)|0;f=z;}while((f|0)>-1|(f|0)==-1&d>>>0>4294967295)}else e=0;i=R6(i|0,l|0,1-e|0)|0;g=z;}else g=l&1048575|1048576;if(!m){f=R6(n|0,o|0,12)|0;k=z;if((k|0)>-1|(k|0)==-1&f>>>0>4294967295){d=0;do{d=d+-1|0;f=R6(f|0,k|0,1)|0;k=z;}while((k|0)>-1|(k|0)==-1&f>>>0>4294967295)}else d=0;n=R6(n|0,o|0,1-d|0)|0;m=d;l=z;}else l=o&1048575|1048576;f=K6(i|0,g|0,n|0,l|0)|0;d=z;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;b:do if((e|0)>(m|0)){while(1){if(k){if((f|0)==0&(d|0)==0)break}else {f=i;d=g;}i=R6(f|0,d|0,1)|0;g=z;e=e+-1|0;f=K6(i|0,g|0,n|0,l|0)|0;d=z;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;if((e|0)<=(m|0))break b}b=a*0.0;break a}while(0);if(k){if((f|0)==0&(d|0)==0){b=a*0.0;break}}else {d=g;f=i;}if(d>>>0<1048576|(d|0)==1048576&f>>>0<0)do{f=R6(f|0,d|0,1)|0;d=z;e=e+-1|0;}while(d>>>0<1048576|(d|0)==1048576&f>>>0<0);if((e|0)>0){o=J6(f|0,d|0,0,-1048576)|0;d=z;e=R6(e|0,0,52)|0;d=d|z;e=o|e;}else {e=Q6(f|0,d|0,1-e|0)|0;d=z;}c[j>>2]=e;c[j+4>>2]=d|p;b=+h[j>>3];}else q=3;while(0);if((q|0)==3){b=a*b;b=b/b;}return +b}function K2(a){a=+a;var b=0;h[j>>3]=a;b=c[j>>2]|0;z=c[j+4>>2]|0;return b|0}function L2(a,b){a=+a;b=+b;var d=0.0,e=0,f=0,g=0,i=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;q=l;l=l+32|0;m=q+24|0;n=q+16|0;o=q+8|0;p=q;h[j>>3]=a;t=c[j>>2]|0;g=c[j+4>>2]|0;h[j>>3]=b;e=c[j>>2]|0;g=g&2147483647;f=c[j+4>>2]&2147483647;i=g>>>0>>0|(g|0)==(f|0)&t>>>0>>0;s=i?e:t;r=i?f:g;e=i?t:e;f=i?g:f;g=Q6(s|0,r|0,52)|0;i=Q6(e|0,f|0,52)|0;c[j>>2]=s;c[j+4>>2]=r;a=+h[j>>3];c[j>>2]=e;c[j+4>>2]=f;k=+h[j>>3];do if((i|0)!=2047){if(!((e|0)==0&(f|0)==0|(g|0)==2047)){if((g-i|0)>64){a=a+k;break}if((g|0)>1533){d=5260135901548373507240989.0e186;b=a*1.90109156629516e-211;a=k*1.90109156629516e-211;}else {t=(i|0)<573;d=t?1.90109156629516e-211:1.0;b=t?a*5260135901548373507240989.0e186:a;a=t?k*5260135901548373507240989.0e186:k;}M2(m,n,b);M2(o,p,a);a=d*+C(+(+h[p>>3]+ +h[n>>3]+ +h[o>>3]+ +h[m>>3]));}}else a=k;while(0);l=q;return +a}function M2(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0.0;e=c*134217729.0;e=e+(c-e);d=c-e;c=c*c;h[a>>3]=c;h[b>>3]=d*d+(e*e-c+e*2.0*d);return}function N2(a,b,d){a=+a;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0,k=0,m=0;k=l;l=l+16|0;g=k;h[j>>3]=a;f=c[j+4>>2]&2147483647;do if(f>>>0<1072243196)if(f>>>0<1044816030){h[b>>3]=a;h[d>>3]=1.0;break}else {h[b>>3]=+w2(a,0.0,0);h[d>>3]=+z2(a,0.0);break}else {if(f>>>0>2146435071){i=a-a;h[d>>3]=i;h[b>>3]=i;break}f=B2(a,g)|0;m=g+8|0;e=+w2(+h[g>>3],+h[m>>3],1);a=+z2(+h[g>>3],+h[m>>3]);switch(f&3){case 0:{h[b>>3]=e;i=a;break}case 1:{h[b>>3]=a;i=-e;break}case 2:{h[b>>3]=-e;i=-a;break}case 3:{h[b>>3]=-a;i=e;break}default:{}}h[d>>3]=i;}while(0);l=k;return}function O2(a,b){a=+a;b=b|0;return +(+y2(a,b))}function P2(a){a=a|0;if(a>>>0<131072)a=(d[146423+((d[146423+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=0;return a|0}function Q2(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0;if(!e)f=0;else {f=a[b>>0]|0;a:do if(!(f<<24>>24))f=0;else while(1){e=e+-1|0;g=a[c>>0]|0;if(!(f<<24>>24==g<<24>>24&((e|0)!=0&g<<24>>24!=0)))break a;b=b+1|0;c=c+1|0;f=a[b>>0]|0;if(!(f<<24>>24)){f=0;break}}while(0);f=(f&255)-(d[c>>0]|0)|0;}return f|0}function R2(b,c){b=b|0;c=c|0;b=k2(b,c)|0;return ((a[b>>0]|0)==(c&255)<<24>>24?b:0)|0}function S2(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function T2(a,b,c){a=a|0;b=b|0;c=c|0;c=V2(a,b,c,-1,0)|0;return c|0}function U2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=d&255;f=(e|0)!=0;a:do if(f&(b&3|0)!=0){g=d&255;while(1){if((a[b>>0]|0)==g<<24>>24){i=6;break a}b=b+1|0;e=e+-1|0;f=(e|0)!=0;if(!(f&(b&3|0)!=0)){i=5;break}}}else i=5;while(0);if((i|0)==5)if(f)i=6;else e=0;b:do if((i|0)==6){g=d&255;if((a[b>>0]|0)!=g<<24>>24){f=O(h,16843009)|0;c:do if(e>>>0>3)while(1){h=c[b>>2]^f;if((h&-2139062144^-2139062144)&h+-16843009|0)break;b=b+4|0;e=e+-4|0;if(e>>>0<=3){i=11;break c}}else i=11;while(0);if((i|0)==11)if(!e){e=0;break}while(1){if((a[b>>0]|0)==g<<24>>24)break b;b=b+1|0;e=e+-1|0;if(!e){e=0;break}}}}while(0);return (e|0?b:0)|0}function V2(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+128|0;h=j;c[h>>2]=0;i=h+4|0;c[i>>2]=a;c[h+44>>2]=a;g=h+8|0;c[g>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;W2(h,0);d=X2(h,d,1,e,f)|0;if(b|0)c[b>>2]=a+((c[i>>2]|0)+(c[h+108>>2]|0)-(c[g>>2]|0));l=j;return d|0}function W2(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;c[a+104>>2]=b;d=c[a+8>>2]|0;e=c[a+4>>2]|0;f=d-e|0;c[a+108>>2]=f;c[a+100>>2]=(b|0)!=0&(f|0)>(b|0)?e+b|0:d;return}function X2(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a:do if(e>>>0>36){c[(d2()|0)>>2]=22;h=0;g=0;}else {r=b+4|0;q=b+100|0;do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while((S2(i)|0)!=0);b:do switch(i|0){case 43:case 45:{i=((i|0)==45)<<31>>31;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;p=i;i=d[j>>0]|0;break b}else {p=i;i=Y2(b)|0;break b}}default:p=0;}while(0);j=(e|0)==0;do if((e|16|0)==16&(i|0)==48){i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((i|32|0)!=120)if(j){e=8;n=46;break}else {n=32;break}i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((d[149592+i>>0]|0)>15){g=(c[q>>2]|0)==0;if(!g)c[r>>2]=(c[r>>2]|0)+-1;if(!f){W2(b,0);h=0;g=0;break a}if(g){h=0;g=0;break a}c[r>>2]=(c[r>>2]|0)+-1;h=0;g=0;break a}else {e=16;n=46;}}else {e=j?10:e;if(e>>>0>(d[149592+i>>0]|0)>>>0)n=32;else {if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;W2(b,0);c[(d2()|0)>>2]=22;h=0;g=0;break a}}while(0);c:do if((n|0)==32)if((e|0)==10){e=i+-48|0;if(e>>>0<10){i=0;j=e;do{i=(i*10|0)+j|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;j=e+-48|0;}while(j>>>0<10&i>>>0<429496729);f=0;}else {e=i;i=0;f=0;}k=e+-48|0;if(k>>>0<10){j=e;do{e=I6(i|0,f|0,10,0)|0;l=z;m=((k|0)<0)<<31>>31;o=~m;if(l>>>0>o>>>0|(l|0)==(o|0)&e>>>0>~k>>>0){e=10;n=72;break c}i=J6(e|0,l|0,k|0,m|0)|0;f=z;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0;}else j=Y2(b)|0;k=j+-48|0;}while(k>>>0<10&(f>>>0<429496729|(f|0)==429496729&i>>>0<2576980378));if(k>>>0>9){j=p;e=f;}else {e=10;n=72;}}else {j=p;e=f;}}else n=46;while(0);d:do if((n|0)==46){if(!(e+-1&e)){n=a[149848+((e*23|0)>>>5&7)>>0]|0;f=a[149592+i>>0]|0;j=f&255;if(e>>>0>j>>>0){i=0;k=j;do{i=k|i<>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;k=f&255;}while(i>>>0<134217728&e>>>0>k>>>0);k=0;}else {j=i;k=0;i=0;}l=Q6(-1,-1,n|0)|0;m=z;if(e>>>0<=(f&255)>>>0|(m>>>0>>0|(m|0)==(k|0)&l>>>0>>0)){f=k;n=72;break}else j=k;while(1){i=R6(i|0,j|0,n|0)|0;k=z;i=i|f&255;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;if(e>>>0<=(f&255)>>>0|(k>>>0>m>>>0|(k|0)==(m|0)&i>>>0>l>>>0)){f=k;n=72;break d}else j=k;}}f=a[149592+i>>0]|0;j=f&255;if(e>>>0>j>>>0){i=0;k=j;do{i=k+(O(i,e)|0)|0;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;k=f&255;}while(i>>>0<119304647&e>>>0>k>>>0);k=0;}else {j=i;i=0;k=0;}if(e>>>0>(f&255)>>>0){n=N6(-1,-1,e|0,0)|0;o=z;m=k;while(1){if(m>>>0>o>>>0|(m|0)==(o|0)&i>>>0>n>>>0){f=m;n=72;break d}k=I6(i|0,m|0,e|0,0)|0;l=z;f=f&255;if(l>>>0>4294967295|(l|0)==-1&k>>>0>~f>>>0){f=m;n=72;break d}i=J6(k|0,l|0,f|0,0)|0;k=z;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;if(e>>>0<=(f&255)>>>0){f=k;n=72;break}else m=k;}}else {f=k;n=72;}}while(0);if((n|0)==72)if(e>>>0>(d[149592+j>>0]|0)>>>0){do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while(e>>>0>(d[149592+i>>0]|0)>>>0);c[(d2()|0)>>2]=34;j=(g&1|0)==0&0==0?p:0;e=h;i=g;}else {j=p;e=f;}if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;if(!(e>>>0>>0|(e|0)==(h|0)&i>>>0>>0)){if(!((g&1|0)!=0|0!=0|(j|0)!=0)){c[(d2()|0)>>2]=34;g=J6(g|0,h|0,-1,-1)|0;h=z;break}if(e>>>0>h>>>0|(e|0)==(h|0)&i>>>0>g>>>0){c[(d2()|0)>>2]=34;break}}g=((j|0)<0)<<31>>31;g=K6(i^j|0,e^g|0,j|0,g|0)|0;h=z;}while(0);z=h;return g|0}function Y2(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=b+104|0;h=c[f>>2]|0;if((h|0)!=0?(c[b+108>>2]|0)>=(h|0):0)i=4;else {e=Z2(b)|0;if((e|0)>=0){g=c[f>>2]|0;f=b+8|0;if(g){j=c[f>>2]|0;h=c[b+4>>2]|0;f=g-(c[b+108>>2]|0)|0;g=j;if((j-h|0)<(f|0))f=g;else f=h+(f+-1)|0;}else {g=c[f>>2]|0;f=g;}c[b+100>>2]=f;f=b+4|0;if(!g)f=c[f>>2]|0;else {f=c[f>>2]|0;j=b+108|0;c[j>>2]=g+1-f+(c[j>>2]|0);}f=f+-1|0;if((e|0)!=(d[f>>0]|0|0))a[f>>0]=e;}else i=4;}if((i|0)==4){c[b+100>>2]=0;e=-1;}return e|0}function Z2(a){a=a|0;var b=0,e=0;e=l;l=l+16|0;b=e;if((_2(a)|0)==0?(nb[c[a+32>>2]&63](a,b,1)|0)==1:0)a=d[b>>0]|0;else a=-1;l=e;return a|0}function _2(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=b+20|0;e=b+28|0;if((c[d>>2]|0)>>>0>(c[e>>2]|0)>>>0)nb[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[e>>2]=0;c[d>>2]=0;d=c[b>>2]|0;if(!(d&4)){e=(c[b+44>>2]|0)+(c[b+48>>2]|0)|0;c[b+8>>2]=e;c[b+4>>2]=e;d=d<<27>>31;}else {c[b>>2]=d|32;d=-1;}return d|0}function $2(a){a=a|0;return (a+-48|0)>>>0<10|0}function a3(a){a=a|0;return ((a+-48|0)>>>0<10|(b3(a)|0)!=0)&1|0}function b3(a){a=a|0;return ((a|32)+-97|0)>>>0<26|0}function c3(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;e=a[b>>0]|0;a:do if(!(e<<24>>24))e=0;else {g=e&255;while(1){f=a[c>>0]|0;if(!(f<<24>>24))break a;if(e<<24>>24!=f<<24>>24?(g=d3(g)|0,(g|0)!=(d3(f&255)|0)):0)break a;b=b+1|0;c=c+1|0;e=a[b>>0]|0;if(!(e<<24>>24)){e=0;break}else g=e&255;}}while(0);g=d3(e&255)|0;return g-(d3(d[c>>0]|0)|0)|0}function d3(a){a=a|0;var b=0;b=(e3(a)|0)==0;return (b?a:a|32)|0}function e3(a){a=a|0;return (a+-65|0)>>>0<26|0}function f3(a){a=a|0;return g3(a,0)|0}function g3(c,f){c=c|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=(f<<1)+-1|0;l=f+-1|0;a:do if(!((c+-43008|0)>>>0<22272|((c+-11776|0)>>>0<30784|((c+-1536|0)>>>0<2560|(h3(c)|0)==0)))){g=(f|0)!=0;if(g&(c+-4256|0)>>>0<46){if((c|0)>4293)switch(c|0){case 4295:case 4301:break;default:break a}c=c+7264|0;break}if((c+-11520|0)>>>0<38&(g^1)){c=c+-7264|0;break}else g=0;do{i=a[66346+(g<<2)+2>>0]|0;j=i<<24>>24;h=c-(e[66346+(g<<2)>>1]|0)|0;if((h-(l&j)|0)>>>0<(d[66346+(g<<2)+3>>0]|0)>>>0){m=11;break}g=g+1|0;}while((g|0)!=61);if((m|0)==11)if(i<<24>>24==1){c=f+c-(h&1)|0;break}else {c=(O(k,j)|0)+c|0;break}i=1-f|0;g=b[65858+(i<<1)>>1]|0;b:do if(g<<16>>16){h=0;while(1){if((g&65535|0)==(c|0))break;h=h+1|0;g=b[65858+(h<<2)+(i<<1)>>1]|0;if(!(g<<16>>16))break b}c=e[65858+(h<<2)+(f<<1)>>1]|0;break a}while(0);return ((c+-66600+(f*40|0)|0)>>>0<40?c+-40+(f*80|0)|0:c)|0}while(0);return c|0}function h3(a){a=a|0;if(a>>>0<131072)a=(d[149857+((d[149857+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=a>>>0<196606&1;return a|0}function i3(a){a=a|0;var b=0;b=a;while(1)if(!(c[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function j3(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;if(!e)b=0;else {f=a[b>>0]|0;a:do if(!(f<<24>>24))b=0;else {h=b;b=f;f=f&255;while(1){e=e+-1|0;g=a[c>>0]|0;if(!((e|0)!=0&g<<24>>24!=0))break a;if(b<<24>>24!=g<<24>>24?(f=d3(f)|0,(f|0)!=(d3(g&255)|0)):0)break a;h=h+1|0;c=c+1|0;f=a[h>>0]|0;if(!(f<<24>>24)){b=0;break}else {b=f;f=f&255;}}}while(0);b=d3(b&255)|0;b=b-(d3(d[c>>0]|0)|0)|0;}return b|0}function k3(a){a=a|0;if(a>>>0>=255)if((a+-57344|0)>>>0<8185|(a>>>0<8232|(a+-8234|0)>>>0<47062))a=1;else return (a&65534|0)!=65534&(a+-65532|0)>>>0<1048580&1|0;else a=(a+1&127)>>>0>32&1;return a|0}function l3(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;g=k;i=(f|0)==0?190640:f;f=c[i>>2]|0;a:do if(!d)if(!f)f=0;else j=17;else {h=(b|0)==0?g:b;if(!e)f=-2;else {if(!f){f=a[d>>0]|0;if(f<<24>>24>-1){c[h>>2]=f&255;f=f<<24>>24!=0&1;break}g=(c[c[(p3()|0)+188>>2]>>2]|0)==0;f=a[d>>0]|0;if(g){c[h>>2]=f<<24>>24&57343;f=1;break}f=(f&255)+-194|0;if(f>>>0>50){j=17;break}f=c[62384+(f<<2)>>2]|0;g=e+-1|0;if(g){d=d+1|0;j=11;}}else {g=e;j=11;}b:do if((j|0)==11){b=a[d>>0]|0;m=(b&255)>>>3;if((m+-16|m+(f>>26))>>>0>7){j=17;break a}while(1){d=d+1|0;f=(b&255)+-128|f<<6;g=g+-1|0;if((f|0)>=0)break;if(!g)break b;b=a[d>>0]|0;if((b&-64)<<24>>24!=-128){j=17;break a}}c[i>>2]=0;c[h>>2]=f;f=e-g|0;break a}while(0);c[i>>2]=f;f=-2;}}while(0);if((j|0)==17){c[i>>2]=0;c[(d2()|0)>>2]=84;f=-1;}l=k;return f|0}function m3(a,b){a=a|0;b=b|0;if(!a)a=0;else a=n3(a,b,0)|0;return a|0}function n3(b,d,e){b=b|0;d=d|0;e=e|0;do if(b){if(d>>>0<128){a[b>>0]=d;b=1;break}if(!(c[c[(o3()|0)+188>>2]>>2]|0))if((d&-128|0)==57216){a[b>>0]=d;b=1;break}else {c[(d2()|0)>>2]=84;b=-1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;b=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;b=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=d>>>18|240;a[b+1>>0]=d>>>12&63|128;a[b+2>>0]=d>>>6&63|128;a[b+3>>0]=d&63|128;b=4;break}else {c[(d2()|0)>>2]=84;b=-1;break}}else b=1;while(0);return b|0}function o3(){return v2()|0}function p3(){return v2()|0}function q3(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+272|0;n=p+8|0;o=p;do if(!(a[d>>0]|0)){d=Ta(152833)|0;if(d|0?a[d>>0]|0:0)break;d=Ta(152840+(b*12|0)|0)|0;if(d|0?a[d>>0]|0:0)break;d=Ta(152912)|0;if(d|0?a[d>>0]|0:0)break;d=152917;}while(0);e=0;a:do{switch(a[d+e>>0]|0){case 47:case 0:break a;default:{}}e=e+1|0;}while(e>>>0<15);f=a[d>>0]|0;if(f<<24>>24!=46?(a[d+e>>0]|0)==0:0)if(f<<24>>24==67)m=15;else {k=d;m=16;}else {d=152917;m=15;}if((m|0)==15)if(!(a[d+1>>0]|0))m=18;else {k=d;m=16;}b:do if((m|0)==16)if((s2(k,152917)|0)!=0?(s2(k,152925)|0)!=0:0){d=c[47661]|0;if(d|0)do{if(!(s2(k,d+8|0)|0))break b;d=c[d+24>>2]|0;}while((d|0)!=0);ta(190648);d=c[47661]|0;c:do if(d|0){while(1){if(!(s2(k,d+8|0)|0))break;d=c[d+24>>2]|0;if(!d)break c}La(190648);break b}while(0);d:do if(((c[47646]|0)==0?(g=Ta(152931)|0,(g|0)!=0):0)?(a[g>>0]|0)!=0:0){i=254-e|0;j=e+1|0;f=g;while(1){h=k2(f,58)|0;d=a[h>>0]|0;g=h-f+((d<<24>>24!=0)<<31>>31)|0;if(g>>>0>>0){W6(n|0,f|0,g|0)|0;f=n+g|0;a[f>>0]=47;W6(f+1|0,k|0,e|0)|0;a[n+(j+g)>>0]=0;f=ua(n|0,o|0)|0;if(f|0)break;d=a[h>>0]|0;}f=h+(d<<24>>24!=0&1)|0;if(!(a[f>>0]|0)){m=41;break d}}d=T1(28)|0;if(!d){h2(f,c[o>>2]|0)|0;m=41;break}else {c[d>>2]=f;c[d+4>>2]=c[o>>2];o=d+8|0;W6(o|0,k|0,e|0)|0;a[o+e>>0]=0;c[d+24>>2]=c[47661];c[47661]=d;break}}else m=41;while(0);if((m|0)==41){d=T1(28)|0;if(d){c[d>>2]=c[15584];c[d+4>>2]=c[15585];o=d+8|0;W6(o|0,k|0,e|0)|0;a[o+e>>0]=0;c[d+24>>2]=c[47661];c[47661]=d;}}La(190648);d=(b|0)==0&(d|0)==0?62336:d;}else {d=k;m=18;}while(0);do if((m|0)==18){if((b|0)==0?(a[d+1>>0]|0)==46:0){d=62336;break}d=0;}while(0);l=p;return d|0}function r3(a,b){a=a|0;b=b|0;s3(a,b)|0;return a|0}function s3(b,d){b=b|0;d=d|0;var e=0,f=0;e=d;a:do if(!((e^b)&3)){if(e&3)do{e=a[d>>0]|0;a[b>>0]=e;if(!(e<<24>>24))break a;d=d+1|0;b=b+1|0;}while((d&3|0)!=0);e=c[d>>2]|0;if(!((e&-2139062144^-2139062144)&e+-16843009)){f=b;while(1){d=d+4|0;b=f+4|0;c[f>>2]=e;e=c[d>>2]|0;if((e&-2139062144^-2139062144)&e+-16843009|0)break;else f=b;}}f=8;}else f=8;while(0);if((f|0)==8){f=a[d>>0]|0;a[b>>0]=f;if(f<<24>>24)do{d=d+1|0;b=b+1|0;f=a[d>>0]|0;a[b>>0]=f;}while(f<<24>>24!=0)}return b|0}function t3(a){a=a|0;return ((a|0)==32|(a|0)==9)&1|0}function u3(a){a=a|0;if(!a)a=0;else a=(v3(63500,a)|0)!=0&1;return a|0}function v3(a,b){a=a|0;b=b|0;var d=0;if(!b)a=a+((i3(a)|0)<<2)|0;else {while(1){d=c[a>>2]|0;if((d|0)==0|(d|0)==(b|0))break;else a=a+4|0;}a=d|0?a:0;}return a|0}function w3(a,b){a=a|0;b=b|0;do switch(b|0){case 1:{a=x3(a)|0;break}case 2:{a=h3(a)|0;break}case 3:{a=y3(a)|0;break}case 4:{a=z3(a)|0;break}case 5:{a=$2(a)|0;break}case 6:{a=A3(a)|0;break}case 7:{a=B3(a)|0;break}case 8:{a=k3(a)|0;break}case 9:{a=P2(a)|0;break}case 10:{a=u3(a)|0;break}case 11:{a=C3(a)|0;break}case 12:{a=D3(a)|0;break}default:a=0;}while(0);return a|0}function x3(a){a=a|0;if(!($2(a)|0))a=(h3(a)|0)!=0&1;else a=1;return a|0}function y3(a){a=a|0;return t3(a)|0}function z3(a){a=a|0;return ((a+-65529|0)>>>0<3|((a&-2|0)==8232|(a>>>0<32|(a+-127|0)>>>0<33)))&1|0}function A3(a){a=a|0;if(!(u3(a)|0))a=(k3(a)|0)!=0&1;else a=0;return a|0}function B3(a){a=a|0;return (f3(a)|0)!=(a|0)|0}function C3(a){a=a|0;return (E3(a)|0)!=(a|0)|0}function D3(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function E3(a){a=a|0;return g3(a,1)|0}function F3(a){a=a|0;return (a+-97|0)>>>0<26|0}function G3(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+128|0;g=n+124|0;m=n;h=m;i=63588;j=h+124|0;do{c[h>>2]=c[i>>2];h=h+4|0;i=i+4|0;}while((h|0)<(j|0));if((d+-1|0)>>>0>2147483646)if(!d){b=g;d=1;k=4;}else {c[(d2()|0)>>2]=75;d=-1;}else k=4;if((k|0)==4){k=-2-b|0;k=d>>>0>k>>>0?k:d;c[m+48>>2]=k;g=m+20|0;c[g>>2]=b;c[m+44>>2]=b;d=b+k|0;b=m+16|0;c[b>>2]=d;c[m+28>>2]=d;d=H3(m,e,f)|0;if(k){m=c[g>>2]|0;a[m+(((m|0)==(c[b>>2]|0))<<31>>31)>>0]=0;}}l=n;return d|0}function H3(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+224|0;n=s+120|0;p=s+80|0;q=s;r=s+136|0;f=p;g=f+40|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));c[n>>2]=c[e>>2];if((I3(0,d,n,q,p)|0)<0)e=-1;else {if((c[b+76>>2]|0)>-1)o=J3(b)|0;else o=0;e=c[b>>2]|0;m=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;f=b+48|0;if(!(c[f>>2]|0)){g=b+44|0;h=c[g>>2]|0;c[g>>2]=r;i=b+28|0;c[i>>2]=r;j=b+20|0;c[j>>2]=r;c[f>>2]=80;k=b+16|0;c[k>>2]=r+80;e=I3(b,d,n,q,p)|0;if(h){nb[c[b+36>>2]&63](b,0,0)|0;e=(c[j>>2]|0)==0?-1:e;c[g>>2]=h;c[f>>2]=0;c[k>>2]=0;c[i>>2]=0;c[j>>2]=0;}}else e=I3(b,d,n,q,p)|0;f=c[b>>2]|0;c[b>>2]=f|m;if(o|0)K3(b);e=(f&32|0)==0?e:-1;}l=s;return e|0}function I3(d,e,f,g,i){d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+64|0;D=H+16|0;E=H;B=H+24|0;F=H+8|0;G=H+20|0;c[D>>2]=e;x=(d|0)!=0;y=B+40|0;A=y;B=B+39|0;C=F+4|0;k=0;j=0;p=0;a:while(1){do if((j|0)>-1)if((k|0)>(2147483647-j|0)){c[(d2()|0)>>2]=75;j=-1;break}else {j=k+j|0;break}while(0);k=a[e>>0]|0;if(!(k<<24>>24)){w=86;break}else m=e;b:while(1){switch(k<<24>>24){case 37:{k=m;w=9;break b}case 0:{k=m;break b}default:{}}v=m+1|0;c[D>>2]=v;k=a[v>>0]|0;m=v;}c:do if((w|0)==9)while(1){w=0;if((a[m+1>>0]|0)!=37)break c;k=k+1|0;m=m+2|0;c[D>>2]=m;if((a[m>>0]|0)==37)w=9;else break}while(0);k=k-e|0;if(x)L3(d,e,k);if(k|0){e=m;continue}n=m+1|0;k=(a[n>>0]|0)+-48|0;if(k>>>0<10){v=(a[m+2>>0]|0)==36;t=v?k:-1;p=v?1:p;n=v?m+3|0:n;}else t=-1;c[D>>2]=n;k=a[n>>0]|0;v=(k<<24>>24)+-32|0;if(v>>>0>31|(1<>24)+-32|m;n=n+1|0;c[D>>2]=n;k=a[n>>0]|0;v=(k<<24>>24)+-32|0;}while(!(v>>>0>31|(1<>24==42){o=n+1|0;k=(a[o>>0]|0)+-48|0;if(k>>>0<10?(a[n+2>>0]|0)==36:0){c[i+(k<<2)>>2]=10;k=c[g+((a[o>>0]|0)+-48<<3)>>2]|0;p=1;n=n+3|0;}else {if(p|0){j=-1;break}if(x){p=(c[f>>2]|0)+(4-1)&~(4-1);k=c[p>>2]|0;c[f>>2]=p+4;p=0;n=o;}else {k=0;p=0;n=o;}}c[D>>2]=n;u=(k|0)<0;k=u?0-k|0:k;u=u?m|8192:m;}else {k=M3(D)|0;if((k|0)<0){j=-1;break}u=m;n=c[D>>2]|0;}do if((a[n>>0]|0)==46){if((a[n+1>>0]|0)!=42){c[D>>2]=n+1;m=M3(D)|0;n=c[D>>2]|0;break}o=n+2|0;m=(a[o>>0]|0)+-48|0;if(m>>>0<10?(a[n+3>>0]|0)==36:0){c[i+(m<<2)>>2]=10;m=c[g+((a[o>>0]|0)+-48<<3)>>2]|0;n=n+4|0;c[D>>2]=n;break}if(p|0){j=-1;break a}if(x){v=(c[f>>2]|0)+(4-1)&~(4-1);m=c[v>>2]|0;c[f>>2]=v+4;}else m=0;c[D>>2]=o;n=o;}else m=-1;while(0);s=0;while(1){if(((a[n>>0]|0)+-65|0)>>>0>57){j=-1;break a}v=n+1|0;c[D>>2]=v;o=a[(a[n>>0]|0)+-65+(152944+(s*58|0))>>0]|0;q=o&255;if((q+-1|0)>>>0<8){s=q;n=v;}else break}if(!(o<<24>>24)){j=-1;break}r=(t|0)>-1;do if(o<<24>>24==19)if(r){j=-1;break a}else w=48;else {if(r){c[i+(t<<2)>>2]=q;r=g+(t<<3)|0;t=c[r+4>>2]|0;w=E;c[w>>2]=c[r>>2];c[w+4>>2]=t;w=48;break}if(!x){j=0;break a}N3(E,q,f);}while(0);if((w|0)==48?(w=0,!x):0){k=0;e=v;continue}n=a[n>>0]|0;n=(s|0)!=0&(n&15|0)==3?n&-33:n;t=u&-65537;u=(u&8192|0)==0?u:t;d:do switch(n|0){case 110:switch((s&255)<<24>>24){case 0:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 1:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 2:{k=c[E>>2]|0;c[k>>2]=j;c[k+4>>2]=((j|0)<0)<<31>>31;k=0;e=v;continue a}case 3:{b[c[E>>2]>>1]=j;k=0;e=v;continue a}case 4:{a[c[E>>2]>>0]=j;k=0;e=v;continue a}case 6:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 7:{k=c[E>>2]|0;c[k>>2]=j;c[k+4>>2]=((j|0)<0)<<31>>31;k=0;e=v;continue a}default:{k=0;e=v;continue a}}case 112:{n=120;m=m>>>0>8?m:8;e=u|8;w=60;break}case 88:case 120:{e=u;w=60;break}case 111:{n=E;e=c[n>>2]|0;n=c[n+4>>2]|0;r=P3(e,n,y)|0;s=A-r|0;o=0;q=153408;m=(u&8|0)==0|(m|0)>(s|0)?m:s+1|0;s=u;w=66;break}case 105:case 100:{n=E;e=c[n>>2]|0;n=c[n+4>>2]|0;if((n|0)<0){e=K6(0,0,e|0,n|0)|0;n=z;o=E;c[o>>2]=e;c[o+4>>2]=n;o=1;q=153408;w=65;break d}else {o=(u&2049|0)!=0&1;q=(u&2048|0)==0?((u&1|0)==0?153408:153410):153409;w=65;break d}}case 117:{n=E;o=0;q=153408;e=c[n>>2]|0;n=c[n+4>>2]|0;w=65;break}case 99:{a[B>>0]=c[E>>2];e=B;o=0;q=153408;r=y;n=1;m=t;break}case 109:{n=t2(c[(d2()|0)>>2]|0)|0;w=70;break}case 115:{n=c[E>>2]|0;n=n|0?n:153418;w=70;break}case 67:{c[F>>2]=c[E>>2];c[C>>2]=0;c[E>>2]=F;r=-1;n=F;w=74;break}case 83:{e=c[E>>2]|0;if(!m){R3(d,32,k,0,u);e=0;w=83;}else {r=m;n=e;w=74;}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{k=S3(d,+h[E>>3],k,m,u,n)|0;e=v;continue a}default:{o=0;q=153408;r=y;n=m;m=u;}}while(0);e:do if((w|0)==60){u=E;t=c[u>>2]|0;u=c[u+4>>2]|0;r=O3(t,u,y,n&32)|0;q=(e&8|0)==0|(t|0)==0&(u|0)==0;o=q?0:2;q=q?153408:153408+(n>>4)|0;s=e;e=t;n=u;w=66;}else if((w|0)==65){r=Q3(e,n,y)|0;s=u;w=66;}else if((w|0)==70){w=0;u=U2(n,0,m)|0;s=(u|0)==0;e=n;o=0;q=153408;r=s?n+m|0:u;n=s?m:u-n|0;m=t;}else if((w|0)==74){w=0;q=n;e=0;m=0;while(1){o=c[q>>2]|0;if(!o)break;m=m3(G,o)|0;if((m|0)<0|m>>>0>(r-e|0)>>>0)break;e=m+e|0;if(r>>>0>e>>>0)q=q+4|0;else break}if((m|0)<0){j=-1;break a}R3(d,32,k,e,u);if(!e){e=0;w=83;}else {o=0;while(1){m=c[n>>2]|0;if(!m){w=83;break e}m=m3(G,m)|0;o=m+o|0;if((o|0)>(e|0)){w=83;break e}L3(d,G,m);if(o>>>0>=e>>>0){w=83;break}else n=n+4|0;}}}while(0);if((w|0)==66){w=0;n=(e|0)!=0|(n|0)!=0;u=(m|0)!=0|n;n=A-r+((n^1)&1)|0;e=u?r:y;r=y;n=u?((m|0)>(n|0)?m:n):m;m=(m|0)>-1?s&-65537:s;}else if((w|0)==83){w=0;R3(d,32,k,e,u^8192);k=(k|0)>(e|0)?k:e;e=v;continue}t=r-e|0;s=(n|0)<(t|0)?t:n;u=s+o|0;k=(k|0)<(u|0)?u:k;R3(d,32,k,u,m);L3(d,q,o);R3(d,48,k,u,m^65536);R3(d,48,s,t,0);L3(d,e,t);R3(d,32,k,u,m^8192);e=v;}f:do if((w|0)==86)if(!d)if(p){j=1;while(1){e=c[i+(j<<2)>>2]|0;if(!e)break;N3(g+(j<<3)|0,e,f);e=j+1|0;if((j|0)<9)j=e;else {j=e;break}}if((j|0)<10)while(1){if(c[i+(j<<2)>>2]|0){j=-1;break f}if((j|0)<9)j=j+1|0;else {j=1;break}}else j=1;}else j=0;while(0);l=H;return j|0}function J3(a){a=a|0;return 0}function K3(a){a=a|0;return}function L3(a,b,d){a=a|0;b=b|0;d=d|0;if(!(c[a>>2]&32))U3(b,d,a)|0;return}function M3(b){b=b|0;var d=0,e=0,f=0;e=c[b>>2]|0;f=(a[e>>0]|0)+-48|0;if(f>>>0<10){d=0;do{d=f+(d*10|0)|0;e=e+1|0;c[b>>2]=e;f=(a[e>>0]|0)+-48|0;}while(f>>>0<10)}else d=0;return d|0}function N3(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=b;break a}case 10:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=((b|0)<0)<<31>>31;break a}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=0;break a}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);b=e;f=c[b>>2]|0;b=c[b+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=f;c[e+4>>2]=b;break a}case 13:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&65535)<<16>>16;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 14:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&65535;c[f+4>>2]=0;break a}case 15:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&255)<<24>>24;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 16:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&255;c[f+4>>2]=0;break a}case 17:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}case 18:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}default:break a}while(0);while(0);return}function O3(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;if(!((b|0)==0&(c|0)==0))do{e=e+-1|0;a[e>>0]=d[153456+(b&15)>>0]|0|f;b=Q6(b|0,c|0,4)|0;c=z;}while(!((b|0)==0&(c|0)==0));return e|0}function P3(b,c,d){b=b|0;c=c|0;d=d|0;if(!((b|0)==0&(c|0)==0))do{d=d+-1|0;a[d>>0]=b&7|48;b=Q6(b|0,c|0,3)|0;c=z;}while(!((b|0)==0&(c|0)==0));return d|0}function Q3(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){while(1){e=O6(b|0,c|0,10,0)|0;d=d+-1|0;a[d>>0]=e&255|48;e=b;b=N6(b|0,c|0,10,0)|0;if(!(c>>>0>9|(c|0)==9&e>>>0>4294967295))break;else c=z;}c=b;}else c=b;if(c)while(1){d=d+-1|0;a[d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0;}return d|0}function R3(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+256|0;f=g;if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;Y6(f|0,b|0,(e>>>0<256?e:256)|0)|0;if(e>>>0>255){b=c-d|0;do{L3(a,f,256);e=e+-256|0;}while(e>>>0>255);e=b&255;}L3(a,f,e);}l=g;return}function S3(b,e,f,g,h,i){b=b|0;e=+e;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+560|0;m=H+8|0;u=H;G=H+524|0;F=G;n=H+512|0;c[u>>2]=0;E=n+12|0;T3(e)|0;if((z|0)<0){e=-e;C=1;B=153425;}else {C=(h&2049|0)!=0&1;B=(h&2048|0)==0?((h&1|0)==0?153426:153431):153428;}T3(e)|0;do if(0==0&(z&2146435072|0)==2146435072){G=(i&32|0)!=0;j=C+3|0;R3(b,32,f,j,h&-65537);L3(b,B,C);L3(b,e!=e|0.0!=0.0?(G?153593:153452):G?153444:153448,3);R3(b,32,f,j,h^8192);}else {r=+O2(e,u)*2.0;j=r!=0.0;if(j)c[u>>2]=(c[u>>2]|0)+-1;w=i|32;if((w|0)==97){p=i&32;s=(p|0)==0?B:B+9|0;q=C|2;j=12-g|0;do if(!(g>>>0>11|(j|0)==0)){e=8.0;do{j=j+-1|0;e=e*16.0;}while((j|0)!=0);if((a[s>>0]|0)==45){e=-(e+(-r-e));break}else {e=r+e-e;break}}else e=r;while(0);k=c[u>>2]|0;j=(k|0)<0?0-k|0:k;j=Q3(j,((j|0)<0)<<31>>31,E)|0;if((j|0)==(E|0)){j=n+11|0;a[j>>0]=48;}a[j+-1>>0]=(k>>31&2)+43;o=j+-2|0;a[o>>0]=i+15;m=(g|0)<1;n=(h&8|0)==0;j=G;do{D=~~e;k=j+1|0;a[j>>0]=p|d[153456+D>>0];e=(e-+(D|0))*16.0;if((k-F|0)==1?!(n&(m&e==0.0)):0){a[k>>0]=46;j=j+2|0;}else j=k;}while(e!=0.0);if((g|0)!=0?(-2-F+j|0)<(g|0):0){k=j-F|0;j=g+2|0;}else {j=j-F|0;k=j;}E=E-o|0;F=E+q+j|0;R3(b,32,f,F,h);L3(b,s,q);R3(b,48,f,F,h^65536);L3(b,G,k);R3(b,48,j-k|0,0,0);L3(b,o,E);R3(b,32,f,F,h^8192);j=F;break}k=(g|0)<0?6:g;if(j){j=(c[u>>2]|0)+-28|0;c[u>>2]=j;e=r*268435456.0;}else {e=r;j=c[u>>2]|0;}D=(j|0)<0?m:m+288|0;m=D;do{y=~~e>>>0;c[m>>2]=y;m=m+4|0;e=(e-+(y>>>0))*1.0e9;}while(e!=0.0);if((j|0)>0){n=D;p=m;while(1){o=(j|0)<29?j:29;j=p+-4|0;if(j>>>0>=n>>>0){m=0;do{x=R6(c[j>>2]|0,0,o|0)|0;x=J6(x|0,z|0,m|0,0)|0;y=z;v=O6(x|0,y|0,1e9,0)|0;c[j>>2]=v;m=N6(x|0,y|0,1e9,0)|0;j=j+-4|0;}while(j>>>0>=n>>>0);if(m){n=n+-4|0;c[n>>2]=m;}}m=p;while(1){if(m>>>0<=n>>>0)break;j=m+-4|0;if(!(c[j>>2]|0))m=j;else break}j=(c[u>>2]|0)-o|0;c[u>>2]=j;if((j|0)>0)p=m;else break}}else n=D;if((j|0)<0){g=((k+25|0)/9|0)+1|0;t=(w|0)==102;do{s=0-j|0;s=(s|0)<9?s:9;if(n>>>0>>0){o=(1<>>s;q=0;j=n;do{y=c[j>>2]|0;c[j>>2]=(y>>>s)+q;q=O(y&o,p)|0;j=j+4|0;}while(j>>>0>>0);j=(c[n>>2]|0)==0?n+4|0:n;if(!q){n=j;j=m;}else {c[m>>2]=q;n=j;j=m+4|0;}}else {n=(c[n>>2]|0)==0?n+4|0:n;j=m;}m=t?D:n;m=(j-m>>2|0)>(g|0)?m+(g<<2)|0:j;j=(c[u>>2]|0)+s|0;c[u>>2]=j;}while((j|0)<0);j=n;g=m;}else {j=n;g=m;}y=D;if(j>>>0>>0){m=(y-j>>2)*9|0;o=c[j>>2]|0;if(o>>>0>=10){n=10;do{n=n*10|0;m=m+1|0;}while(o>>>0>=n>>>0)}}else m=0;t=(w|0)==103;v=(k|0)!=0;n=k-((w|0)!=102?m:0)+((v&t)<<31>>31)|0;if((n|0)<(((g-y>>2)*9|0)+-9|0)){n=n+9216|0;s=D+4+(((n|0)/9|0)+-1024<<2)|0;n=(n|0)%9|0;if((n|0)<8){o=10;while(1){o=o*10|0;if((n|0)<7)n=n+1|0;else break}}else o=10;p=c[s>>2]|0;q=(p>>>0)%(o>>>0)|0;n=(s+4|0)==(g|0);if(!(n&(q|0)==0)){r=(((p>>>0)/(o>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;x=(o|0)/2|0;e=q>>>0>>0?.5:n&(q|0)==(x|0)?1.0:1.5;if(C){x=(a[B>>0]|0)==45;e=x?-e:e;r=x?-r:r;}n=p-q|0;c[s>>2]=n;if(r+e!=r){x=n+o|0;c[s>>2]=x;if(x>>>0>999999999){m=s;while(1){n=m+-4|0;c[m>>2]=0;if(n>>>0>>0){j=j+-4|0;c[j>>2]=0;}x=(c[n>>2]|0)+1|0;c[n>>2]=x;if(x>>>0>999999999)m=n;else break}}else n=s;m=(y-j>>2)*9|0;p=c[j>>2]|0;if(p>>>0>=10){o=10;do{o=o*10|0;m=m+1|0;}while(p>>>0>=o>>>0)}}else n=s;}else n=s;n=n+4|0;n=g>>>0>n>>>0?n:g;x=j;}else {n=g;x=j;}w=n;while(1){if(w>>>0<=x>>>0){u=0;break}j=w+-4|0;if(!(c[j>>2]|0))w=j;else {u=1;break}}g=0-m|0;do if(t){j=k+((v^1)&1)|0;if((j|0)>(m|0)&(m|0)>-5){o=i+-1|0;k=j+-1-m|0;}else {o=i+-2|0;k=j+-1|0;}j=h&8;if(!j){if(u?(A=c[w+-4>>2]|0,(A|0)!=0):0)if(!((A>>>0)%10|0)){n=0;j=10;do{j=j*10|0;n=n+1|0;}while(!((A>>>0)%(j>>>0)|0|0))}else n=0;else n=9;j=((w-y>>2)*9|0)+-9|0;if((o|32|0)==102){s=j-n|0;s=(s|0)>0?s:0;k=(k|0)<(s|0)?k:s;s=0;break}else {s=j+m-n|0;s=(s|0)>0?s:0;k=(k|0)<(s|0)?k:s;s=0;break}}else s=j;}else {o=i;s=h&8;}while(0);t=k|s;p=(t|0)!=0&1;q=(o|32|0)==102;if(q){v=0;j=(m|0)>0?m:0;}else {j=(m|0)<0?g:m;j=Q3(j,((j|0)<0)<<31>>31,E)|0;n=E;if((n-j|0)<2)do{j=j+-1|0;a[j>>0]=48;}while((n-j|0)<2);a[j+-1>>0]=(m>>31&2)+43;j=j+-2|0;a[j>>0]=o;v=j;j=n-j|0;}j=C+1+k+p+j|0;R3(b,32,f,j,h);L3(b,B,C);R3(b,48,f,j,h^65536);if(q){o=x>>>0>D>>>0?D:x;s=G+9|0;p=s;q=G+8|0;n=o;do{m=Q3(c[n>>2]|0,0,s)|0;if((n|0)==(o|0)){if((m|0)==(s|0)){a[q>>0]=48;m=q;}}else if(m>>>0>G>>>0){Y6(G|0,48,m-F|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}L3(b,m,p-m|0);n=n+4|0;}while(n>>>0<=D>>>0);if(t|0)L3(b,153472,1);if(n>>>0>>0&(k|0)>0)while(1){m=Q3(c[n>>2]|0,0,s)|0;if(m>>>0>G>>>0){Y6(G|0,48,m-F|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}L3(b,m,(k|0)<9?k:9);n=n+4|0;m=k+-9|0;if(!(n>>>0>>0&(k|0)>9)){k=m;break}else k=m;}R3(b,48,k+9|0,9,0);}else {t=u?w:x+4|0;if((k|0)>-1){u=G+9|0;s=(s|0)==0;g=u;p=0-F|0;q=G+8|0;o=x;do{m=Q3(c[o>>2]|0,0,u)|0;if((m|0)==(u|0)){a[q>>0]=48;m=q;}do if((o|0)==(x|0)){n=m+1|0;L3(b,m,1);if(s&(k|0)<1){m=n;break}L3(b,153472,1);m=n;}else {if(m>>>0<=G>>>0)break;Y6(G|0,48,m+p|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}while(0);F=g-m|0;L3(b,m,(k|0)>(F|0)?F:k);k=k-F|0;o=o+4|0;}while(o>>>0>>0&(k|0)>-1)}R3(b,48,k+18|0,18,0);L3(b,v,E-v|0);}R3(b,32,f,j,h^8192);}while(0);l=H;return ((j|0)<(f|0)?f:j)|0}function T3(a){a=+a;var b=0;h[j>>3]=a;b=c[j>>2]|0;z=c[j+4>>2]|0;return b|0}function U3(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(V3(e)|0)){g=c[f>>2]|0;h=5;}else f=0;else h=5;a:do if((h|0)==5){j=e+20|0;i=c[j>>2]|0;f=i;if((g-i|0)>>>0>>0){f=nb[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)>-1){i=d;while(1){if(!i){h=0;g=b;break b}g=i+-1|0;if((a[b+g>>0]|0)==10)break;else i=g;}f=nb[c[e+36>>2]&63](e,b,i)|0;if(f>>>0>>0)break a;h=i;g=b+i|0;d=d-i|0;f=c[j>>2]|0;}else {h=0;g=b;}while(0);W6(f|0,g|0,d|0)|0;c[j>>2]=(c[j>>2]|0)+d;f=h+d|0;}while(0);return f|0}function V3(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=c[b>>2]|0;if(!(d&8)){c[b+8>>2]=0;c[b+4>>2]=0;e=c[b+44>>2]|0;c[b+28>>2]=e;c[b+20>>2]=e;c[b+16>>2]=e+(c[b+48>>2]|0);b=0;}else {c[b>>2]=d|32;b=-1;}return b|0}function W3(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+20|0;f=c[e>>2]|0;a=(c[a+16>>2]|0)-f|0;a=a>>>0>d>>>0?d:a;W6(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function X3(b){b=b|0;var c=0,d=0,e=0,f=0;e=a[b>>0]|0;c=1;d=153474;f=97;while(1){if(e<<24>>24==f<<24>>24?(s2(b,d)|0)==0:0)break;d=d+6|0;f=a[d>>0]|0;if(!(f<<24>>24)){c=0;break}else c=c+1|0;}return c|0}function Y3(a){a=a|0;var b=0;b=(F3(a)|0)==0;return (b?a:a&95)|0}function Z3(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;do if(b>>>0>6)d=0;else {ta(190656);if((b|0)!=6){d=_3(b,d)|0;La(190656);break}if(!d){d=197132;b=0;}else {b=g;e=153547;f=b+16|0;do{a[b>>0]=a[e>>0]|0;b=b+1|0;e=e+1|0;}while((b|0)<(f|0));f=0;do{b=k2(d,59)|0;e=b-d|0;if((e|0)<16){W6(g|0,d|0,e|0)|0;a[g+e>>0]=0;d=(a[b>>0]|0)==0?d:b+1|0;}_3(f,g)|0;f=f+1|0;}while((f|0)!=6);d=197132;b=0;}while(1){f=c[190616+(b<<2)>>2]|0;f=f|0?f+8|0:153563;e=l2(f)|0;W6(d|0,f|0,e|0)|0;f=d+e|0;a[f>>0]=59;b=b+1|0;if((b|0)==6)break;else d=d+(e+1)|0;}a[f>>0]=0;La(190656);d=197132;}while(0);l=h;return d|0}function _3(a,b){a=a|0;b=b|0;if(!b)a=c[190616+(a<<2)>>2]|0;else {b=q3(a,b)|0;c[190616+(a<<2)>>2]=b;a=b;}return (a|0?a+8|0:153563)|0}function $3(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if(!d)b=0;else {while(1){e=a[b>>0]|0;f=a[c>>0]|0;if(e<<24>>24!=f<<24>>24)break;d=d+-1|0;if(!d){b=0;break a}else {b=b+1|0;c=c+1|0;}}b=(e&255)-(f&255)|0;}while(0);return b|0}function a4(a){a=a|0;return b4(a)|0}function b4(a){a=a|0;return S6(a|0)|0}function c4(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if((c[f+76>>2]|0)>-1)m=J3(f)|0;else m=0;g=e+-1|0;if((e|0)<2){n=f+74|0;l=a[n>>0]|0;a[n>>0]=l+255|l;if(m|0)K3(f);if(!g)a[b>>0]=0;else b=0;}else {a:do if(g){k=f+4|0;l=f+8|0;e=b;while(1){h=c[k>>2]|0;o=h;p=(c[l>>2]|0)-o|0;i=U2(h,10,p)|0;j=(i|0)==0;i=j?p:1-o+i|0;i=i>>>0>>0?i:g;W6(e|0,h|0,i|0)|0;h=(c[k>>2]|0)+i|0;c[k>>2]=h;e=e+i|0;i=g-i|0;if(!(j&(i|0)!=0)){n=17;break a}if(h>>>0>=(c[l>>2]|0)>>>0){g=Z2(f)|0;if((g|0)<0)break;else j=g;}else {c[k>>2]=h+1;j=d[h>>0]|0;}g=i+-1|0;h=e+1|0;a[e>>0]=j;if(!((g|0)!=0&(j&255|0)!=10)){e=h;n=17;break a}else e=h;}if((e|0)!=(b|0)?(c[f>>2]&16|0)!=0:0)n=17;else b=0;}else {e=b;n=17;}while(0);if((n|0)==17)if(!b)b=0;else a[e>>0]=0;if(m)K3(f);}return b|0}function d4(b,c){b=b|0;c=c|0;var d=0;d=a[c>>0]|0;do if(d<<24>>24){b=R2(b,d<<24>>24)|0;if(b){if(a[c+1>>0]|0)if(a[b+1>>0]|0){if(!(a[c+2>>0]|0)){b=e4(b,c)|0;break}if(a[b+2>>0]|0){if(!(a[c+3>>0]|0)){b=f4(b,c)|0;break}if(a[b+3>>0]|0)if(!(a[c+4>>0]|0)){b=g4(b,c)|0;break}else {b=h4(b,c)|0;break}else b=0;}else b=0;}else b=0;}else b=0;}while(0);return b|0}function e4(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=(d[c>>0]|0)<<8|(d[c+1>>0]|0);f=d[b>>0]|0;while(1){c=b+1|0;e=a[c>>0]|0;if(!(e<<24>>24))break;f=f<<8&65280|e&255;if((f|0)==(g|0))break;else b=c;}return (e<<24>>24?b:0)|0}function f4(b,c){b=b|0;c=c|0;var e=0,f=0;f=(d[c+1>>0]|0)<<16|(d[c>>0]|0)<<24|(d[c+2>>0]|0)<<8;e=b+2|0;c=a[e>>0]|0;b=(d[b+1>>0]|0)<<16|(d[b>>0]|0)<<24|(c&255)<<8;if(!((b|0)==(f|0)|c<<24>>24==0))do{e=e+1|0;c=a[e>>0]|0;b=(b|c&255)<<8;}while(!((b|0)==(f|0)|c<<24>>24==0));return (c<<24>>24?e+-2|0:0)|0}function g4(b,c){b=b|0;c=c|0;var e=0,f=0;f=(d[c+1>>0]|0)<<16|(d[c>>0]|0)<<24|(d[c+2>>0]|0)<<8|(d[c+3>>0]|0);c=b+3|0;e=a[c>>0]|0;b=(d[b+1>>0]|0)<<16|(d[b>>0]|0)<<24|(d[b+2>>0]|0)<<8|e&255;if(!(e<<24>>24==0|(b|0)==(f|0)))do{c=c+1|0;e=a[c>>0]|0;b=b<<8|e&255;}while(!(e<<24>>24==0|(b|0)==(f|0)));return (e<<24>>24?c+-3|0:0)|0}function h4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+1056|0;t=v+1024|0;u=v;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;c[t+20>>2]=0;c[t+24>>2]=0;c[t+28>>2]=0;e=a[d>>0]|0;a:do if(e<<24>>24){s=0;do{if(!(a[b+s>>0]|0)){e=0;break a}r=t+(((e&255)>>>5&255)<<2)|0;c[r>>2]=c[r>>2]|1<<(e&31);s=s+1|0;c[u+((e&255)<<2)>>2]=s;e=a[d+s>>0]|0;}while(e<<24>>24!=0);m=s>>>0>1;if(m){f=0;k=-1;g=1;b:while(1){h=1;e=f;while(1){f=g;c:while(1){j=1;while(1){g=a[d+(j+k)>>0]|0;i=a[d+f>>0]|0;if(g<<24>>24!=i<<24>>24)break c;if((j|0)==(h|0))break;j=j+1|0;f=j+e|0;if(f>>>0>=s>>>0){n=h;e=k;break b}}e=h+e|0;f=e+1|0;if(f>>>0>=s>>>0){n=h;e=k;break b}}h=f-k|0;if((g&255)<=(i&255))break;g=f+1|0;if(g>>>0>=s>>>0){n=h;e=k;break b}else e=f;}g=e+2|0;if(g>>>0>=s>>>0){n=1;break}else {f=e+1|0;k=e;}}if(m){h=0;m=-1;i=1;while(1){f=1;g=h;while(1){h=i;d:while(1){k=1;while(1){i=a[d+(k+m)>>0]|0;j=a[d+h>>0]|0;if(i<<24>>24!=j<<24>>24)break d;if((k|0)==(f|0))break;k=k+1|0;h=k+g|0;if(h>>>0>=s>>>0){i=n;g=m;h=26;break a}}g=f+g|0;h=g+1|0;if(h>>>0>=s>>>0){i=n;g=m;h=26;break a}}f=h-m|0;if((i&255)>=(j&255))break;i=h+1|0;if(i>>>0>=s>>>0){i=n;g=m;h=26;break a}else g=h;}i=g+2|0;if(i>>>0>=s>>>0){i=n;f=1;h=26;break}else {h=g+1|0;m=g;}}}else {i=n;f=1;g=-1;h=26;}}else {i=1;e=-1;f=1;g=-1;h=26;}}else {i=1;e=-1;s=0;f=1;g=-1;h=26;}while(0);e:do if((h|0)==26){q=(g+1|0)>>>0>(e+1|0)>>>0;f=q?f:i;q=q?g:e;r=q+1|0;if(!($3(d,d+f|0,r)|0))p=s-f|0;else {f=s-q+-1|0;p=0;f=(q>>>0>f>>>0?q:f)+1|0;}k=s|63;m=s+-1|0;n=(p|0)!=0;o=s-f|0;e=b;j=0;g=b;while(1){h=e;do if((g-h|0)>>>0>>0){i=U2(g,0,k)|0;if(i)if((i-h|0)>>>0>>0){e=0;break e}else break;else {i=g+k|0;break}}else i=g;while(0);g=a[e+m>>0]|0;f:do if(!(1<<(g&31)&c[t+(((g&255)>>>5&255)<<2)>>2])){h=0;g=s;}else {g=s-(c[u+((g&255)<<2)>>2]|0)|0;if(g|0){h=0;g=n&(j|0)!=0&g>>>0>>0?o:g;break}g=r>>>0>j>>>0?r:j;h=a[d+g>>0]|0;g:do if(!(h<<24>>24))g=r;else {while(1){if(h<<24>>24!=(a[e+g>>0]|0))break;g=g+1|0;h=a[d+g>>0]|0;if(!(h<<24>>24)){g=r;break g}}h=0;g=g-q|0;break f}while(0);while(1){if(g>>>0<=j>>>0)break e;g=g+-1|0;if((a[d+g>>0]|0)!=(a[e+g>>0]|0)){h=p;g=f;break}}}while(0);e=e+g|0;j=h;g=i;}}while(0);l=v;return e|0}function i4(a,b,c){a=a|0;b=b|0;c=c|0;j4(a,b,c)|0;return a|0}function j4(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d;a:do if(!((g^b)&3)){f=(e|0)!=0;if(f&(g&3|0)!=0)do{g=a[d>>0]|0;a[b>>0]=g;if(!(g<<24>>24))break a;e=e+-1|0;d=d+1|0;b=b+1|0;f=(e|0)!=0;}while(f&(d&3|0)!=0);if(f){if(a[d>>0]|0){b:do if(e>>>0>3){f=d;while(1){d=c[f>>2]|0;if((d&-2139062144^-2139062144)&d+-16843009|0){d=f;break b}c[b>>2]=d;e=e+-4|0;d=f+4|0;b=b+4|0;if(e>>>0>3)f=d;else break}}while(0);h=11;}}else e=0;}else h=11;while(0);c:do if((h|0)==11)if(!e)e=0;else while(1){h=a[d>>0]|0;a[b>>0]=h;if(!(h<<24>>24))break c;e=e+-1|0;b=b+1|0;if(!e){e=0;break}else d=d+1|0;}while(0);Y6(b|0,0,e|0)|0;return b|0}function k4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+32|0;f=g;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;e=a[d>>0]|0;do if(!(e<<24>>24))d=0;else {if(!(a[d+1>>0]|0)){d=b;while(1)if((a[d>>0]|0)==e<<24>>24)d=d+1|0;else break;d=d-b|0;break}do{h=f+(((e&255)>>>5&255)<<2)|0;c[h>>2]=c[h>>2]|1<<(e&31);d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0);e=a[b>>0]|0;a:do if(!(e<<24>>24))d=b;else {d=b;do{if(!(c[f+(((e&255)>>>5&255)<<2)>>2]&1<<(e&31)))break a;d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0)}while(0);d=d-b|0;}while(0);l=g;return d|0}function l4(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=e2(a)|0;a=Ja(6,d|0)|0;a=c2((a|0)==-4?0:a)|0;l=b;return a|0}function m4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=n4(a,b,f)|0;l=e;return d|0}function n4(a,b,c){a=a|0;b=b|0;c=c|0;return G3(a,2147483647,b,c)|0}function o4(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+208|0;j=m+8|0;k=m;h=O(d,b)|0;i=k;c[i>>2]=1;c[i+4>>2]=0;a:do if(h|0){i=0-d|0;c[j+4>>2]=d;c[j>>2]=d;f=2;b=d;g=d;while(1){b=b+d+g|0;c[j+(f<<2)>>2]=b;if(b>>>0>>0){n=g;f=f+1|0;g=b;b=n;}else break}g=a+h+i|0;if(g>>>0>a>>>0){h=g;f=1;b=1;do{do if((b&3|0)!=3){b=f+-1|0;if((c[j+(b<<2)>>2]|0)>>>0<(h-a|0)>>>0)p4(a,d,e,f,j);else r4(a,d,e,k,f,0,j);if((f|0)==1){s4(k,1);f=0;break}else {s4(k,b);f=1;break}}else {p4(a,d,e,f,j);q4(k,2);f=f+2|0;}while(0);b=c[k>>2]|1;c[k>>2]=b;a=a+d|0;}while(a>>>0>>0)}else {f=1;b=1;}r4(a,d,e,k,f,0,j);g=k+4|0;while(1){if((f|0)==1&(b|0)==1){if(!(c[g>>2]|0))break a}else if((f|0)>=2){s4(k,2);n=f+-2|0;c[k>>2]=c[k>>2]^7;q4(k,1);r4(a+(0-(c[j+(n<<2)>>2]|0))+i|0,d,e,k,f+-1|0,1,j);s4(k,1);b=c[k>>2]|1;c[k>>2]=b;h=a+i|0;r4(h,d,e,k,n,1,j);a=h;f=n;continue}b=t4(k)|0;q4(k,b);a=a+i|0;f=b+f|0;b=c[k>>2]|0;}}while(0);l=m;return}function p4(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+240|0;m=n;c[m>>2]=a;a:do if((e|0)>1){k=0-b|0;g=a;j=e;e=1;while(1){h=g+k|0;i=j+-2|0;g=h+(0-(c[f+(i<<2)>>2]|0))|0;if((lb[d&127](a,g)|0)>-1?(lb[d&127](a,h)|0)>-1:0)break a;a=e+1|0;e=m+(e<<2)|0;if((lb[d&127](g,h)|0)>-1){c[e>>2]=g;e=j+-1|0;}else {c[e>>2]=h;g=h;e=i;}if((e|0)<=1){e=a;break a}j=e;e=a;a=c[m>>2]|0;}}else e=1;while(0);v4(b,m,e);l=n;return}function q4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[f>>2]|0;c[a>>2]=e;c[f>>2]=0;b=b+-32|0;d=0;}else {d=c[f>>2]|0;e=c[a>>2]|0;}c[a>>2]=d<<32-b|e>>>b;c[f>>2]=d>>>b;return}function r4(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+240|0;n=p+232|0;o=p;q=c[e>>2]|0;c[n>>2]=q;j=c[e+4>>2]|0;k=n+4|0;c[k>>2]=j;c[o>>2]=a;a:do if((q|0)!=1|(j|0)!=0?(m=0-b|0,i=a+(0-(c[h+(f<<2)>>2]|0))|0,(lb[d&127](i,a)|0)>=1):0){e=1;g=(g|0)==0;j=i;while(1){if(g&(f|0)>1){g=a+m|0;i=c[h+(f+-2<<2)>>2]|0;if((lb[d&127](g,j)|0)>-1){i=10;break a}if((lb[d&127](g+(0-i)|0,j)|0)>-1){i=10;break a}}g=e+1|0;c[o+(e<<2)>>2]=j;q=t4(n)|0;q4(n,q);f=q+f|0;if(!((c[n>>2]|0)!=1|(c[k>>2]|0)!=0)){e=g;a=j;i=10;break a}a=j+(0-(c[h+(f<<2)>>2]|0))|0;if((lb[d&127](a,c[o>>2]|0)|0)<1){a=j;e=g;g=0;i=9;break}else {q=j;e=g;g=1;j=a;a=q;}}}else {e=1;i=9;}while(0);if((i|0)==9?(g|0)==0:0)i=10;if((i|0)==10){v4(b,o,e);p4(a,b,d,f,h);}l=p;return}function s4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[a>>2]|0;c[f>>2]=e;c[a>>2]=0;b=b+-32|0;d=0;}else {d=c[a>>2]|0;e=c[f>>2]|0;}c[f>>2]=d>>>(32-b|0)|e<>2]=d<>2]|0)+-1|0)|0;if(!b){b=u4(c[a+4>>2]|0)|0;return ((b|0)==0?0:b+32|0)|0}else return b|0;return 0}function u4(a){a=a|0;var b=0;if(a)if(!(a&1)){b=a;a=0;do{a=a+1|0;b=b>>>1;}while(!(b&1|0))}else a=0;else a=32;return a|0}function v4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+256|0;e=h;a:do if((d|0)>=2?(g=b+(d<<2)|0,c[g>>2]=e,a|0):0)while(1){f=a>>>0<256?a:256;W6(e|0,c[b>>2]|0,f|0)|0;e=0;do{i=b+(e<<2)|0;e=e+1|0;W6(c[i>>2]|0,c[b+(e<<2)>>2]|0,f|0)|0;c[i>>2]=(c[i>>2]|0)+f;}while((e|0)!=(d|0));a=a-f|0;if(!a)break a;e=c[g>>2]|0;}while(0);l=h;return}function w4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=H3(a,b,f)|0;l=e;return d|0}function x4(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;sa(0,e|0)|0;d=0;e=(c[e+4>>2]|0)*65537^(e>>>4)+b;while(1){a[b+d>>0]=(e&15)+65|e<<1&32;d=d+1|0;if((d|0)==6)break;else e=e>>>5;}l=f;return b|0}function y4(a,b,c){a=a|0;b=b|0;c=c|0;c=V2(a,b,c,-2147483648,0)|0;return c|0}function z4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;f=h;e=a[d>>0]|0;a:do if(e<<24>>24!=0?(a[d+1>>0]|0)!=0:0){c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;do{i=f+(((e&255)>>>5&255)<<2)|0;c[i>>2]=c[i>>2]|1<<(e&31);d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0);e=a[b>>0]|0;if(!(e<<24>>24))d=b;else {d=b;do{if(c[f+(((e&255)>>>5&255)<<2)>>2]&1<<(e&31)|0)break a;d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0)}}else g=3;while(0);if((g|0)==3)d=k2(b,e<<24>>24)|0;l=h;return d-b|0}function A4(b,d){b=b|0;d=d|0;var e=0;if(!b){b=c[47666]|0;if(!b)b=0;else e=3;}else e=3;do if((e|0)==3){b=b+(k4(b,d)|0)|0;if(!(a[b>>0]|0)){c[47666]=0;b=0;break}d=b+(z4(b,d)|0)|0;c[47666]=d;if(!(a[d>>0]|0)){c[47666]=0;break}else {c[47666]=d+1;a[d>>0]=0;break}}while(0);return b|0}function B4(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;e=c&255;do{if(!d){c=0;break}d=d+-1|0;c=b+d|0;}while((a[c>>0]|0)!=e<<24>>24);return c|0}function C4(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!b){b=c[e>>2]|0;if(!b)b=0;else f=3;}else f=3;do if((f|0)==3){b=b+(k4(b,d)|0)|0;if(!(a[b>>0]|0)){c[e>>2]=0;b=0;break}d=b+(z4(b,d)|0)|0;c[e>>2]=d;if(!(a[d>>0]|0)){c[e>>2]=0;break}else {c[e>>2]=d+1;a[d>>0]=0;break}}while(0);return b|0}function D4(a){a=a|0;var b=0,c=0;c=(l2(a)|0)+1|0;b=T1(c)|0;if(!b)b=0;else W6(b|0,a|0,c|0)|0;return b|0}function E4(a,b){a=a|0;b=b|0;return B4(a,b,(l2(a)|0)+1|0)|0}function F4(a,b){a=a|0;b=b|0;r3(a+(l2(a)|0)|0,b)|0;return a|0}function G4(b,c){b=b|0;c=c|0;c=b+(z4(b,c)|0)|0;return (a[c>>0]|0?c:0)|0}function H4(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(J3(a)|0)==0;a=(c[a>>2]|0)>>>4&1;}else a=(c[a>>2]|0)>>>4&1;return a|0}function I4(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((c[a+76>>2]|0)>-1)f=J3(a)|0;else f=0;J4(a);g=(c[a>>2]&1|0)!=0;if(!g){e=K4()|0;d=c[a+52>>2]|0;b=a+56|0;if(d|0)c[d+56>>2]=c[b>>2];b=c[b>>2]|0;if(b|0)c[b+52>>2]=d;if((c[e>>2]|0)==(a|0))c[e>>2]=b;L4();}b=M4(a)|0;b=kb[c[a+12>>2]&63](a)|0|b;d=c[a+92>>2]|0;if(d|0)U1(d);if(g){if(f|0)K3(a);}else U1(a);return b|0}function J4(a){a=a|0;var b=0;if(c[a+68>>2]|0){b=c[a+116>>2]|0;a=a+112|0;if(b|0)c[b+112>>2]=c[a>>2];a=c[a>>2]|0;if(!a)a=(O4()|0)+232|0;else a=a+116|0;c[a>>2]=b;}return}function K4(){ta(190668);return 190676}function L4(){La(190668);return}function M4(a){a=a|0;var b=0,d=0;do if(a){if((c[a+76>>2]|0)<=-1){b=N4(a)|0;break}d=(J3(a)|0)==0;b=N4(a)|0;if(!d)K3(a);}else {if(!(c[15711]|0))b=0;else b=M4(c[15711]|0)|0;a=c[(K4()|0)>>2]|0;if(a)do{if((c[a+76>>2]|0)>-1)d=J3(a)|0;else d=0;if((c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0)b=N4(a)|0|b;if(d|0)K3(a);a=c[a+56>>2]|0;}while((a|0)!=0);L4();}while(0);return b|0}function N4(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;h=a+28|0;if((c[b>>2]|0)>>>0>(c[h>>2]|0)>>>0?(nb[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)a=-1;else {d=a+4|0;e=c[d>>2]|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>>0)nb[c[a+40>>2]&63](a,e-g|0,1)|0;c[a+16>>2]=0;c[h>>2]=0;c[b>>2]=0;c[f>>2]=0;c[d>>2]=0;a=0;}return a|0}function O4(){return v2()|0}function P4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+64|0;n=o+40|0;k=o+24|0;j=o+16|0;g=o;m=o+56|0;f=a[d>>0]|0;if(U2(153580,f<<24>>24,4)|0){e=T1(1156)|0;if(!e)e=0;else {h=e;i=h+124|0;do{c[h>>2]=0;h=h+4|0;}while((h|0)<(i|0));if(!(R2(d,43)|0))c[e>>2]=f<<24>>24==114?8:4;if(R2(d,101)|0){c[g>>2]=b;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;f=a[d>>0]|0;}if(f<<24>>24==97){c[j>>2]=b;c[j+4>>2]=3;f=Ea(221,j|0)|0;if(!(f&1024)){c[k>>2]=b;c[k+4>>2]=4;c[k+8>>2]=f|1024;Ea(221,k|0)|0;}d=c[e>>2]|128;c[e>>2]=d;}else d=c[e>>2]|0;c[e+60>>2]=b;c[e+44>>2]=e+132;c[e+48>>2]=1024;f=e+75|0;a[f>>0]=-1;if((d&8|0)==0?(c[n>>2]=b,c[n+4>>2]=21523,c[n+8>>2]=m,(Ia(54,n|0)|0)==0):0)a[f>>0]=10;c[e+32>>2]=15;c[e+36>>2]=18;c[e+40>>2]=16;c[e+12>>2]=17;if(!(c[47645]|0))c[e+76>>2]=-1;Q4(e)|0;}}else {c[(d2()|0)>>2]=22;e=0;}l=o;return e|0}function Q4(a){a=a|0;var b=0,d=0;b=K4()|0;c[a+56>>2]=c[b>>2];d=c[b>>2]|0;if(d|0)c[d+52>>2]=a;c[b>>2]=a;L4();return a|0}function R4(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;a:do if(!e)b=0;else {do if(f|0){i=(b|0)==0?g:b;b=a[e>>0]|0;if(b<<24>>24>-1){c[i>>2]=b&255;b=b<<24>>24!=0&1;break a}h=(c[c[(S4()|0)+188>>2]>>2]|0)==0;b=a[e>>0]|0;if(h){c[i>>2]=b<<24>>24&57343;b=1;break a}b=(b&255)+-194|0;if(b>>>0<=50){g=e+1|0;h=c[62384+(b<<2)>>2]|0;if(f>>>0<4?h&-2147483648>>>((f*6|0)+-6|0)|0:0)break;b=d[g>>0]|0;f=b>>>3;if((f+-16|f+(h>>26))>>>0<=7){b=b+-128|h<<6;if((b|0)>=0){c[i>>2]=b;b=2;break a}g=(d[e+2>>0]|0)+-128|0;if(g>>>0<=63){g=g|b<<6;if((g|0)>=0){c[i>>2]=g;b=3;break a}b=(d[e+3>>0]|0)+-128|0;if(b>>>0<=63){c[i>>2]=b|g<<6;b=4;break a}}}}}while(0);c[(d2()|0)>>2]=84;b=-1;}while(0);l=j;return b|0}function S4(){return v2()|0}function T4(a,b){a=a|0;b=b|0;var c=0;c=l2(a)|0;return ((U4(a,1,c,b)|0)!=(c|0))<<31>>31|0}function U4(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=O(d,b)|0;d=(b|0)==0?0:d;if((c[e+76>>2]|0)>-1){g=(J3(e)|0)==0;a=U3(a,f,e)|0;if(!g)K3(e);}else a=U3(a,f,e)|0;if((a|0)!=(f|0))d=(a>>>0)/(b>>>0)|0;return d|0}function V4(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;j=m;k=e&255;a[j>>0]=k;g=b+16|0;h=c[g>>2]|0;if(!h)if(!(V3(b)|0)){h=c[g>>2]|0;i=4;}else f=-1;else i=4;do if((i|0)==4){i=b+20|0;g=c[i>>2]|0;if(g>>>0>>0?(f=e&255,(f|0)!=(a[b+75>>0]|0)):0){c[i>>2]=g+1;a[g>>0]=k;break}if((nb[c[b+36>>2]&63](b,j,1)|0)==1)f=d[j>>0]|0;else f=-1;}while(0);l=m;return f|0}function W4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=c2(Fa(3,f|0)|0)|0;l=e;return d|0}function X4(){var a=0,b=0;b=l;l=l+16|0;a=Da(20,b|0)|0;l=b;return a|0}function Y4(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;d=b;e=153565;f=d+15|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0;}while((d|0)<(f|0));if(!c){a[b+14>>0]=48;a[b+15>>0]=0;}else {e=c;d=14;while(1){d=d+1|0;if(e>>>0<10)break;else e=(e>>>0)/10|0;}a[b+d>>0]=0;while(1){d=d+-1|0;a[b+d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0;}}return}function Z4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g+40|0;e=g+8|0;d=g;c[d>>2]=a;c[d+4>>2]=b;d=Ca(197,d|0)|0;if((d|0)==-9?(c[e>>2]=a,c[e+4>>2]=1,(Ea(221,e|0)|0)>=0):0){Y4(e,a);c[f>>2]=e;c[f+4>>2]=b;b=c2(Ba(195,f|0)|0)|0;}else b=c2(d)|0;l=g;return b|0}function _4(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=a;c[e+4>>2]=b;b=c2(Ga(33,e|0)|0)|0;l=d;return b|0}function $4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;h=i+32|0;g=i+16|0;e=i;if(U2(153580,a[d>>0]|0,4)|0){f=a5(d)|0;c[e>>2]=b;c[e+4>>2]=f|32768;c[e+8>>2]=438;e=c2(Ha(5,e|0)|0)|0;if((e|0)>=0){if(f&524288|0){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;}b=P4(e,d)|0;if(!b){c[h>>2]=e;Ja(6,h|0)|0;b=0;}}else b=0;}else {c[(d2()|0)>>2]=22;b=0;}l=i;return b|0}function a5(b){b=b|0;var c=0,d=0,e=0;d=(R2(b,43)|0)==0;c=a[b>>0]|0;d=d?c<<24>>24!=114&1:2;e=(R2(b,120)|0)==0;d=e?d:d|128;b=(R2(b,101)|0)==0;b=b?d:d|524288;b=c<<24>>24==114?b:b|64;b=c<<24>>24==119?b|512:b;return (c<<24>>24==97?b|1024:b)|0}function b5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c5(a,b,f)|0;l=e;return d|0}function c5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+128|0;e=g;f=e;h=f+124|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(h|0));c[e+32>>2]=41;c[e+44>>2]=a;c[e+76>>2]=-1;c[e+84>>2]=a;h=e5(e,b,d)|0;l=g;return h|0}function d5(a,b,c){a=a|0;b=b|0;c=c|0;return m5(a,b,c)|0}function e5(b,e,f){b=b|0;e=e|0;f=f|0;var i=0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;P=l;l=l+288|0;J=P+8|0;K=P+17|0;L=P;M=P+16|0;if((c[b+76>>2]|0)>-1)O=J3(b)|0;else O=0;i=a[e>>0]|0;a:do if(i<<24>>24){B=b+4|0;C=b+100|0;D=b+108|0;E=b+8|0;F=K+10|0;G=K+33|0;A=J+4|0;H=K+1|0;I=K+1|0;m=e;t=0;e=0;k=0;j=0;b:while(1){c:do if(!(S2(i&255)|0)){i=i<<24>>24==37;d:do if(i){p=m+1|0;n=a[p>>0]|0;e:do switch(n<<24>>24){case 37:break d;case 42:{y=0;m=m+2|0;break}default:{i=(n&255)+-48|0;if(i>>>0<10?(a[m+2>>0]|0)==36:0){y=f5(f,i)|0;m=m+3|0;break e}m=(c[f>>2]|0)+(4-1)&~(4-1);y=c[m>>2]|0;c[f>>2]=m+4;m=p;}}while(0);i=a[m>>0]|0;n=i&255;if((n+-48|0)>>>0<10){p=0;do{p=(p*10|0)+-48+n|0;m=m+1|0;i=a[m>>0]|0;n=i&255;}while((n+-48|0)>>>0<10)}else p=0;i=i<<24>>24==109;x=(y|0)!=0;k=i?0:k;j=i?0:j;m=i?m+1|0:m;i=x&i;n=m+1|0;switch(a[m>>0]|0){case 104:{w=(a[n>>0]|0)==104;q=w?-2:-1;m=w?m+2|0:n;break}case 108:{w=(a[n>>0]|0)==108;q=w?3:1;m=w?m+2|0:n;break}case 106:{q=3;m=n;break}case 116:case 122:{q=1;m=n;break}case 76:{q=2;m=n;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{q=0;break}default:{N=135;break b}}s=d[m>>0]|0;u=(s&47|0)==3;s=u?s|32:s;u=u?1:q;r=s&255;switch(r<<24>>24){case 99:{p=(p|0)>1?p:1;w=t;break}case 91:{w=t;break}case 110:{g5(y,u,t,((t|0)<0)<<31>>31);n=t;break c}default:{W2(b,0);do{n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;}while((S2(n)|0)!=0);if(!(c[C>>2]|0))n=c[B>>2]|0;else {n=(c[B>>2]|0)+-1|0;c[B>>2]=n;}w=(c[D>>2]|0)+t+n-(c[E>>2]|0)|0;}}W2(b,p);n=c[B>>2]|0;q=c[C>>2]|0;if(n>>>0>>0)c[B>>2]=n+1;else {if((Y2(b)|0)<0){N=135;break b}q=c[C>>2]|0;}if(q|0)c[B>>2]=(c[B>>2]|0)+-1;f:do switch(r<<24>>24){case 91:case 99:case 115:{v=(s|0)==99;g:do if((s|16|0)==115){Y6(H|0,-1,256)|0;a[K>>0]=0;if((s|0)==115){a[G>>0]=0;a[F>>0]=0;a[F+1>>0]=0;a[F+2>>0]=0;a[F+3>>0]=0;a[F+4>>0]=0;}}else {s=m+1|0;n=(a[s>>0]|0)==94;t=n&1;m=n?m+2|0:s;Y6(I|0,n&1|0,256)|0;a[K>>0]=0;n=a[m>>0]|0;switch(n<<24>>24){case 45:{n=46;N=63;break}case 93:{n=94;N=63;break}default:{}}while(1){if((N|0)==63){N=0;a[K+n>>0]=t^1;n=m+1|0;m=n;n=a[n>>0]|0;}h:do switch(n<<24>>24){case 0:{N=135;break b}case 93:break g;case 45:{s=m+1|0;n=a[s>>0]|0;switch(n<<24>>24){case 93:case 0:{n=45;break h}default:{}}m=a[m+-1>>0]|0;if((m&255)<(n&255)){r=(t^1)&255;m=m&255;do{m=m+1|0;a[K+m>>0]=r;n=a[s>>0]|0;}while((m|0)<(n&255|0));m=s;}else m=s;break}default:{}}while(0);n=(n&255)+1|0;N=63;}}while(0);n=v?p+1|0:31;s=(u|0)==1;i:do if(s){if(i){j=T1(n<<2)|0;if(!j){k=0;j=0;i=1;N=135;break b}}else j=y;c[J>>2]=0;c[A>>2]=0;r=n;k=0;j:while(1){q=(j|0)==0;do{k:while(1){n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;if(!(a[K+(n+1)>>0]|0))break j;a[M>>0]=n;switch(l3(L,M,1,J)|0){case -1:{k=0;N=135;break b}case -2:break;default:break k}}if(!q){c[j+(k<<2)>>2]=c[L>>2];k=k+1|0;}}while(!(i&(k|0)==(r|0)));k=r<<1|1;n=W1(j,k<<2)|0;if(!n){k=0;i=1;N=135;break b}else {u=r;r=k;j=n;k=u;}}if(!(h5(J)|0)){k=0;N=135;break b}else {n=k;k=0;r=j;}}else {if(i){k=T1(n)|0;if(!k){k=0;j=0;i=1;N=135;break b}else {q=n;j=0;}while(1){do{n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;if(!(a[K+(n+1)>>0]|0)){n=j;r=0;j=0;break i}a[k+j>>0]=n;j=j+1|0;}while((j|0)!=(q|0));j=q<<1|1;n=W1(k,j)|0;if(!n){j=0;i=1;N=135;break b}else {u=q;q=j;k=n;j=u;}}}if(!y){k=q;while(1){j=c[B>>2]|0;if(j>>>0>>0){c[B>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;if(!(a[K+(j+1)>>0]|0)){n=0;k=0;r=0;j=0;break i}k=c[C>>2]|0;}}else {n=0;k=q;while(1){j=c[B>>2]|0;if(j>>>0>>0){c[B>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;if(!(a[K+(j+1)>>0]|0)){k=y;r=0;j=0;break i}a[y+n>>0]=j;n=n+1|0;k=c[C>>2]|0;}}}while(0);if(!(c[C>>2]|0))q=c[B>>2]|0;else {q=(c[B>>2]|0)+-1|0;c[B>>2]=q;}q=q-(c[E>>2]|0)+(c[D>>2]|0)|0;if(!q){N=137;break b}if(!((q|0)==(p|0)|v^1)){N=137;break b}do if(i)if(s){c[y>>2]=r;break}else {c[y>>2]=k;break}while(0);if(!v){if(r|0)c[r+(n<<2)>>2]=0;if(!k){k=0;break f}a[k+n>>0]=0;}break}case 120:case 88:case 112:{n=16;N=123;break}case 111:{n=8;N=123;break}case 117:case 100:{n=10;N=123;break}case 105:{n=0;N=123;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{o=+i5(b,u,0);if((c[D>>2]|0)==((c[E>>2]|0)-(c[B>>2]|0)|0)){N=137;break b}if(y)switch(u|0){case 0:{g[y>>2]=o;break f}case 1:{h[y>>3]=o;break f}case 2:{h[y>>3]=o;break f}default:break f}break}default:{}}while(0);do if((N|0)==123){N=0;n=X2(b,n,0,-1,-1)|0;if((c[D>>2]|0)==((c[E>>2]|0)-(c[B>>2]|0)|0)){N=137;break b}if(x&(s|0)==112){c[y>>2]=n;break}else {g5(y,u,n,z);break}}while(0);e=e+(x&1)|0;n=(c[D>>2]|0)+w+(c[B>>2]|0)-(c[E>>2]|0)|0;break c}while(0);m=m+(i&1)|0;W2(b,0);i=c[B>>2]|0;if(i>>>0<(c[C>>2]|0)>>>0){c[B>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((i|0)!=(d[m>>0]|0)){N=22;break b}n=t+1|0;}else {while(1){i=m+1|0;if(!(S2(d[i>>0]|0)|0))break;else m=i;}W2(b,0);do{i=c[B>>2]|0;if(i>>>0<(c[C>>2]|0)>>>0){c[B>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while((S2(i)|0)!=0);if(!(c[C>>2]|0))i=c[B>>2]|0;else {i=(c[B>>2]|0)+-1|0;c[B>>2]=i;}n=(c[D>>2]|0)+t+i-(c[E>>2]|0)|0;}while(0);m=m+1|0;i=a[m>>0]|0;if(!(i<<24>>24))break a;else t=n;}if((N|0)==22){if(c[C>>2]|0)c[B>>2]=(c[B>>2]|0)+-1;if((e|0)!=0|(i|0)>-1)break;else {i=0;N=136;}}else if((N|0)==135){i=i&1;if(!e)N=136;}else if((N|0)==137)i=i&1;if((N|0)==136)e=-1;if(i){U1(k);U1(j);}}else e=0;while(0);if(O|0)K3(b);l=P;return e|0}function f5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;c[d>>2]=c[a>>2];while(1){f=(c[d>>2]|0)+(4-1)&~(4-1);a=c[f>>2]|0;c[d>>2]=f+4;if(b>>>0>1)b=b+-1|0;else break}l=e;return a|0}function g5(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;a:do if(d|0)switch(e|0){case -2:{a[d>>0]=f;break a}case -1:{b[d>>1]=f;break a}case 0:{c[d>>2]=f;break a}case 1:{c[d>>2]=f;break a}case 3:{e=d;c[e>>2]=f;c[e+4>>2]=g;break a}default:break a}while(0);return}function h5(a){a=a|0;if(!a)a=1;else a=(c[a>>2]|0)==0&1;return a|0}function i5(b,e,f){b=b|0;e=e|0;f=f|0;var g=0.0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;switch(e|0){case 0:{l=-149;m=24;j=4;break}case 1:{l=-1074;m=53;j=4;break}case 2:{l=-1074;m=53;j=4;break}default:g=0.0;}a:do if((j|0)==4){o=b+4|0;n=b+100|0;do{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;}while((S2(e)|0)!=0);b:do switch(e|0){case 43:case 45:{i=1-(((e|0)==45&1)<<1)|0;e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;h=d[e>>0]|0;break b}else {h=Y2(b)|0;break b}}default:{h=e;i=1;}}while(0);e=0;do{if((h|32|0)!=(a[153584+e>>0]|0))break;do if(e>>>0<7){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else {h=Y2(b)|0;break}}while(0);e=e+1|0;}while(e>>>0<8);c:do switch(e|0){case 8:break;case 3:{j=23;break}default:{k=(f|0)!=0;if(k&e>>>0>3)if((e|0)==8)break c;else {j=23;break c}d:do if(!e){e=0;do{if((h|32|0)!=(a[153593+e>>0]|0))break d;do if(e>>>0<2){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else {h=Y2(b)|0;break}}while(0);e=e+1|0;}while(e>>>0<3)}while(0);switch(e|0){case 3:{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;if((e|0)==40)e=1;else {if(!(c[n>>2]|0)){g=s;break a}c[o>>2]=(c[o>>2]|0)+-1;g=s;break a}while(1){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;}else h=Y2(b)|0;if(!((h+-48|0)>>>0<10|(h+-65|0)>>>0<26)?!((h|0)==95|(h+-97|0)>>>0<26):0)break;e=e+1|0;}if((h|0)==41){g=s;break a}h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!k){c[(d2()|0)>>2]=22;W2(b,0);g=0.0;break a}if(!e){g=s;break a}while(1){e=e+-1|0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!e){g=s;break a}}}case 0:{if((h|0)==48){e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;if((e|32|0)==120){g=+j5(b,m,l,i,f);break a}if(!(c[n>>2]|0))e=48;else {c[o>>2]=(c[o>>2]|0)+-1;e=48;}}else e=h;g=+k5(b,e,m,l,i,f);break a}default:{if(c[n>>2]|0)c[o>>2]=(c[o>>2]|0)+-1;c[(d2()|0)>>2]=22;W2(b,0);g=0.0;break a}}}}while(0);if((j|0)==23){h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if((f|0)!=0&e>>>0>3)do{if(!h)c[o>>2]=(c[o>>2]|0)+-1;e=e+-1|0;}while(e>>>0>3)}g=+(i|0)*t;}while(0);return +g}function j5(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0.0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=a+4|0;i=c[y>>2]|0;x=a+100|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;l=0;}else {j=Y2(a)|0;l=0;}a:while(1){switch(j|0){case 46:{w=8;break a}case 48:break;default:{s=0;n=0;o=1.0;h=0.0;i=0;m=j;t=l;v=0;u=0;l=0;j=0;break a}}i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;l=1;continue}else {j=Y2(a)|0;l=1;continue}}if((w|0)==8){i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;}else j=Y2(a)|0;if((j|0)==48){l=0;j=0;do{i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;m=d[i>>0]|0;}else m=Y2(a)|0;l=J6(l|0,j|0,-1,-1)|0;j=z;}while((m|0)==48);s=1;n=0;o=1.0;h=0.0;i=0;t=1;v=0;u=0;}else {s=1;n=0;o=1.0;h=0.0;i=0;m=j;t=l;v=0;u=0;l=0;j=0;}}while(1){q=m+-48|0;p=m|32;if(q>>>0>=10){r=(m|0)==46;if(!(r|(p+-97|0)>>>0<6))break;if(r)if(!s){s=1;k=o;r=t;l=u;j=v;q=u;p=v;}else {m=46;break}else w=20;}else w=20;if((w|0)==20){w=0;m=(m|0)>57?p+-87|0:q;do if(!((v|0)<0|(v|0)==0&u>>>0<8))if((v|0)<0|(v|0)==0&u>>>0<14){o=o*.0625;k=o;h=h+o*+(m|0);break}else {t=(n|0)!=0|(m|0)==0;n=t?n:1;k=o;h=t?h:h+o*.5;break}else {k=o;i=m+(i<<4)|0;}while(0);q=J6(u|0,v|0,1,0)|0;r=1;p=z;}m=c[y>>2]|0;if(m>>>0<(c[x>>2]|0)>>>0){c[y>>2]=m+1;o=k;m=d[m>>0]|0;t=r;v=p;u=q;continue}else {o=k;m=Y2(a)|0;t=r;v=p;u=q;continue}}do if(!t){i=(c[x>>2]|0)==0;if(!i)c[y>>2]=(c[y>>2]|0)+-1;if(g){if(!i)c[y>>2]=(c[y>>2]|0)+-1;if(!((s|0)==0|i))c[y>>2]=(c[y>>2]|0)+-1;}else W2(a,0);h=+(f|0)*0.0;}else {p=(s|0)==0;q=p?u:l;p=p?v:j;if((v|0)<0|(v|0)==0&u>>>0<8){l=u;j=v;while(1){i=i<<4;w=l;l=J6(l|0,j|0,1,0)|0;if(!((j|0)<0|(j|0)==0&w>>>0<7)){n=i;break}else j=z;}}else n=i;if((m|32|0)==112){j=l5(a,g)|0;i=z;if((j|0)==0&(i|0)==-2147483648){if(!g){W2(a,0);h=0.0;break}if(!(c[x>>2]|0)){j=0;i=0;}else {c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0;}}}else if(!(c[x>>2]|0)){j=0;i=0;}else {c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0;}l=R6(q|0,p|0,2)|0;l=J6(l|0,z|0,-32,-1)|0;l=J6(l|0,z|0,j|0,i|0)|0;i=z;if(!n){h=+(f|0)*0.0;break}y=0-e|0;g=((y|0)<0)<<31>>31;if((i|0)>(g|0)|(i|0)==(g|0)&l>>>0>y>>>0){c[(d2()|0)>>2]=34;h=+(f|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}y=e+-106|0;g=((y|0)<0)<<31>>31;if((i|0)<(g|0)|(i|0)==(g|0)&l>>>0>>0){c[(d2()|0)>>2]=34;h=+(f|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if((n|0)>-1){j=n;do{y=!(h>=.5);j=j<<1|(y^1)&1;h=h+(y?h:h+-1.0);l=J6(l|0,i|0,-1,-1)|0;i=z;}while((j|0)>-1);o=h;m=j;}else {o=h;m=n;}y=((b|0)<0)<<31>>31;e=K6(32,0,e|0,((e|0)<0)<<31>>31|0)|0;i=J6(e|0,z|0,l|0,i|0)|0;e=z;if((e|0)<(y|0)|(e|0)==(y|0)&i>>>0>>0)if((i|0)>0)w=59;else {j=0;i=84;w=61;}else {i=b;w=59;}if((w|0)==59)if((i|0)<53){j=i;i=84-i|0;w=61;}else {k=0.0;h=+(f|0);}if((w|0)==61){h=+(f|0);k=+G2(+D2(1.0,i),h);i=j;}f=(m&1|0)==0&(o!=0.0&(i|0)<32);h=(f?0.0:o)*h+(k+h*+((m+(f&1)|0)>>>0))-k;if(!(h!=0.0))c[(d2()|0)>>2]=34;h=+H2(h,l);}while(0);return +h}function k5(a,b,e,f,g,h){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0;J=l;l=l+512|0;G=J;H=f+e|0;I=0-H|0;D=a+4|0;E=a+100|0;k=0;a:while(1){switch(b|0){case 46:{A=6;break a}case 48:break;default:{v=0;p=k;q=0;o=0;break a}}b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;k=1;continue}else {b=Y2(a)|0;k=1;continue}}if((A|0)==6){b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;if((b|0)==48){k=0;b=0;while(1){k=J6(k|0,b|0,-1,-1)|0;o=z;b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;if((b|0)==48)b=o;else {v=1;p=1;q=k;break}}}else {v=1;p=k;q=0;o=0;}}c[G>>2]=0;n=b+-48|0;m=(b|0)==46;b:do if(m|n>>>0<10){C=G+496|0;w=0;k=0;u=0;x=v;y=p;A=n;p=0;n=0;c:while(1){do if(m)if(!x){x=1;q=p;o=n;}else break c;else {p=J6(p|0,n|0,1,0)|0;n=z;v=(b|0)!=48;if((k|0)>=125){if(!v)break;c[C>>2]=c[C>>2]|1;break}m=G+(k<<2)|0;if(!w)b=A;else b=b+-48+((c[m>>2]|0)*10|0)|0;c[m>>2]=b;w=w+1|0;y=(w|0)==9;w=y?0:w;k=k+(y&1)|0;u=v?p:u;y=1;}while(0);b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;A=b+-48|0;m=(b|0)==46;if(!(m|A>>>0<10)){v=x;m=y;A=29;break b}}b=w;m=(y|0)!=0;A=37;}else {w=0;k=0;u=0;m=p;p=0;n=0;A=29;}while(0);do if((A|0)==29){C=(v|0)==0;q=C?p:q;o=C?n:o;m=(m|0)!=0;if(!(m&(b|32|0)==101))if((b|0)>-1){b=w;A=37;break}else {b=w;A=39;break}m=l5(a,h)|0;b=z;if((m|0)==0&(b|0)==-2147483648){if(!h){W2(a,0);i=0.0;break}if(!(c[E>>2]|0)){m=0;b=0;}else {c[D>>2]=(c[D>>2]|0)+-1;m=0;b=0;}}y=J6(m|0,b|0,q|0,o|0)|0;b=w;o=z;A=41;}while(0);if((A|0)==37)if(c[E>>2]|0){c[D>>2]=(c[D>>2]|0)+-1;if(m){y=q;A=41;}else A=40;}else A=39;if((A|0)==39)if(m){y=q;A=41;}else A=40;do if((A|0)==40){c[(d2()|0)>>2]=22;W2(a,0);i=0.0;}else if((A|0)==41){m=c[G>>2]|0;if(!m){i=+(g|0)*0.0;break}if(((n|0)<0|(n|0)==0&p>>>0<10)&((y|0)==(p|0)&(o|0)==(n|0))?(e|0)>30|(m>>>e|0)==0:0){i=+(g|0)*+(m>>>0);break}a=(f|0)/-2|0;E=((a|0)<0)<<31>>31;if((o|0)>(E|0)|(o|0)==(E|0)&y>>>0>a>>>0){c[(d2()|0)>>2]=34;i=+(g|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}a=f+-106|0;E=((a|0)<0)<<31>>31;if((o|0)<(E|0)|(o|0)==(E|0)&y>>>0>>0){c[(d2()|0)>>2]=34;i=+(g|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if(b){if((b|0)<9){n=G+(k<<2)|0;m=c[n>>2]|0;while(1){m=m*10|0;if((b|0)>=8)break;else b=b+1|0;}c[n>>2]=m;}k=k+1|0;}if((u|0)<9?(u|0)<=(y|0)&(y|0)<18:0){if((y|0)==9){i=+(g|0)*+((c[G>>2]|0)>>>0);break}if((y|0)<9){i=+(g|0)*+((c[G>>2]|0)>>>0)/+(c[63712+(8-y<<2)>>2]|0);break}a=e+27+(O(y,-3)|0)|0;b=c[G>>2]|0;if((a|0)>30|(b>>>a|0)==0){i=+(g|0)*+(b>>>0)*+(c[63712+(y+-10<<2)>>2]|0);break}}b=(y|0)%9|0;if(!b){b=0;n=0;}else {u=(y|0)>-1?b:b+9|0;p=c[63712+(8-u<<2)>>2]|0;if(k){q=1e9/(p|0)|0;n=0;o=0;m=y;b=0;do{D=G+(b<<2)|0;E=c[D>>2]|0;a=((E>>>0)/(p>>>0)|0)+n|0;c[D>>2]=a;n=O(q,(E>>>0)%(p>>>0)|0)|0;a=(b|0)==(o|0)&(a|0)==0;m=a?m+-9|0:m;o=a?o+1&127:o;b=b+1|0;}while((b|0)!=(k|0));if(!n)n=o;else {c[G+(k<<2)>>2]=n;n=o;k=k+1|0;}}else {n=0;k=0;m=y;}b=0;y=9-u+m|0;}d:while(1){u=(y|0)<18;v=(y|0)==18;w=G+(n<<2)|0;while(1){if(!u){if(!v){m=y;break d}if((c[w>>2]|0)>>>0>=9007199){m=18;break d}}m=0;x=k;k=k+127|0;while(1){o=k&127;p=G+(o<<2)|0;k=R6(c[p>>2]|0,0,29)|0;k=J6(k|0,z|0,m|0,0)|0;m=z;if(m>>>0>0|(m|0)==0&k>>>0>1e9){q=N6(k|0,m|0,1e9,0)|0;k=O6(k|0,m|0,1e9,0)|0;}else q=0;c[p>>2]=k;a=(o|0)==(n|0);x=(k|0)==0&(((o|0)!=(x+127&127|0)|a)^1)?o:x;if(a)break;else {m=q;k=o+-1|0;}}b=b+-29|0;if(q|0)break;else k=x;}n=n+127&127;k=x+127&127;m=G+((x+126&127)<<2)|0;if((n|0)==(x|0))c[m>>2]=c[m>>2]|c[G+(k<<2)>>2];else k=x;c[G+(n<<2)>>2]=q;y=y+9|0;}e:while(1){w=k+1&127;x=G+((k+127&127)<<2)|0;while(1){q=(m|0)==18;v=(m|0)>27?9:1;y=n;while(1){p=0;while(1){n=p+y&127;if((n|0)==(k|0)){F=2;A=88;break}n=c[G+(n<<2)>>2]|0;o=c[63744+(p<<2)>>2]|0;if(n>>>0>>0){F=2;A=88;break}if(n>>>0>o>>>0)break;n=p+1|0;if((p|0)<1)p=n;else {F=n;A=88;break}}if((A|0)==88?(A=0,q&(F|0)==2):0){i=0.0;o=0;break e}b=v+b|0;if((y|0)==(k|0))y=k;else break}q=(1<>>v;p=0;n=y;o=y;do{D=G+(o<<2)|0;E=c[D>>2]|0;a=(E>>>v)+p|0;c[D>>2]=a;p=O(E&q,u)|0;a=(o|0)==(n|0)&(a|0)==0;m=a?m+-9|0:m;n=a?n+1&127:n;o=o+1&127;}while((o|0)!=(k|0));if(!p)continue;if((w|0)!=(n|0))break;c[x>>2]=c[x>>2]|1;}c[G+(k<<2)>>2]=p;k=w;}do{n=o+y&127;m=k+1&127;if((n|0)==(k|0)){c[G+(m+-1<<2)>>2]=0;k=m;}i=i*1.0e9+ +((c[G+(n<<2)>>2]|0)>>>0);o=o+1|0;}while((o|0)!=2);t=+(g|0);j=i*t;o=b+53|0;p=o-f|0;q=(p|0)<(e|0);n=q?((p|0)>0?p:0):e;if((n|0)<53){K=+G2(+D2(1.0,105-n|0),j);r=+I2(j,+D2(1.0,53-n|0));s=K;i=r;r=K+(j-r);}else {s=0.0;i=0.0;r=j;}m=y+2&127;if((m|0)!=(k|0)){m=c[G+(m<<2)>>2]|0;do if(m>>>0>=5e8){if((m|0)!=5e8){i=t*.75+i;break}if((y+3&127|0)==(k|0)){i=t*.5+i;break}else {i=t*.75+i;break}}else {if((m|0)==0?(y+3&127|0)==(k|0):0)break;i=t*.25+i;}while(0);if((53-n|0)>1?!(+I2(i,1.0)!=0.0):0)j=i+1.0;else j=i;}else j=i;i=r+j-s;do if((o&2147483647|0)>(-2-H|0)){H=!(+B(+i)>=9007199254740992.0);b=b+((H^1)&1)|0;i=H?i:i*.5;if((b+50|0)<=(I|0)?!(j!=0.0&(q&((n|0)!=(p|0)|H))):0)break;c[(d2()|0)>>2]=34;}while(0);i=+H2(i,b);}while(0);l=J;return +i}function l5(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0;h=a+4|0;e=c[h>>2]|0;i=a+100|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;switch(e|0){case 43:case 45:{f=(e|0)==45&1;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;if((b|0)!=0&(e+-48|0)>>>0>9?(c[i>>2]|0)!=0:0)c[h>>2]=(c[h>>2]|0)+-1;break}default:f=0;}if((e+-48|0)>>>0>9)if(!(c[i>>2]|0)){f=-2147483648;e=0;}else {c[h>>2]=(c[h>>2]|0)+-1;f=-2147483648;e=0;}else {g=0;do{g=e+-48+(g*10|0)|0;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10&(g|0)<214748364);b=((g|0)<0)<<31>>31;if((e+-48|0)>>>0<10)do{b=I6(g|0,b|0,10,0)|0;g=z;e=J6(e|0,((e|0)<0)<<31>>31|0,-48,-1)|0;g=J6(e|0,z|0,b|0,g|0)|0;b=z;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&g>>>0<2061584302));if((e+-48|0)>>>0<10)do{e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10);if(c[i>>2]|0)c[h>>2]=(c[h>>2]|0)+-1;i=(f|0)!=0;e=K6(0,0,g|0,b|0)|0;f=i?z:b;e=i?e:g;}z=f;return e|0}function m5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=a+84|0;g=c[e>>2]|0;h=d+256|0;f=U2(g,0,h)|0;f=(f|0)==0?h:f-g|0;d=f>>>0>>0?f:d;W6(b|0,g|0,d|0)|0;c[a+4>>2]=g+d;b=g+f|0;c[a+8>>2]=b;c[e>>2]=b;return d|0}function n5(a,b,c){a=a|0;b=b|0;c=c|0;return o5(a,b,c)|0}function o5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if((c[a+76>>2]|0)>-1){e=(J3(a)|0)==0;b=p5(a,b,d)|0;if(!e)K3(a);}else b=p5(a,b,d)|0;return b|0}function p5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if((d|0)==1)b=b-(c[a+8>>2]|0)+(c[a+4>>2]|0)|0;e=a+20|0;f=a+28|0;if((c[e>>2]|0)>>>0>(c[f>>2]|0)>>>0?(nb[c[a+36>>2]&63](a,0,0)|0,(c[e>>2]|0)==0):0)b=-1;else {c[a+16>>2]=0;c[f>>2]=0;c[e>>2]=0;if((nb[c[a+40>>2]&63](a,b,d)|0)<0)b=-1;else {c[a+8>>2]=0;c[a+4>>2]=0;c[a>>2]=c[a>>2]&-17;b=0;}}return b|0}function q5(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;while(1){e=a[b>>0]|0;c=e<<24>>24;f=b+1|0;if(!(S2(c)|0))break;else b=f;}switch(c|0){case 45:{b=1;g=5;break}case 43:{b=0;g=5;break}default:{h=0;d=b;b=e;}}if((g|0)==5){h=b;d=f;b=a[f>>0]|0;}c=(b<<24>>24)+-48|0;if(c>>>0<10){b=0;do{d=d+1|0;b=(b*10|0)-c|0;c=(a[d>>0]|0)+-48|0;}while(c>>>0<10)}else b=0;return (h|0?b:0-b|0)|0}function r5(a){a=a|0;return +(+s5(a,0))}function s5(a,b){a=a|0;b=b|0;return +(+t5(a,b,1))}function t5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0;i=l;l=l+128|0;h=i;f=h;g=f+124|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));f=h+4|0;c[f>>2]=a;g=h+8|0;c[g>>2]=-1;c[h+44>>2]=a;c[h+76>>2]=-1;W2(h,0);e=+i5(h,d,1);d=(c[f>>2]|0)-(c[g>>2]|0)+(c[h+108>>2]|0)|0;if(b|0)c[b>>2]=d|0?a+d|0:a;l=i;return +e}function u5(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if(!c)b=0;else {h=b;while(1){g=c>>>1;b=h+(O(g,d)|0)|0;f=lb[e&127](a,b)|0;if(!f)break a;if((c|0)==1){b=0;break a}f=(f|0)<0;c=f?g:c-g|0;if(!c){b=0;break}else h=f?h:b;}}while(0);return b|0}function v5(a,c){a=a|0;c=c|0;var d=0,f=0,g=0;g=a+2|0;f=a+4|0;d=I6((e[c+2>>1]|0)<<16|(e[c>>1]|0)|0,e[c+4>>1]|0|0,(e[g>>1]|0)<<16|(e[a>>1]|0)|0,e[f>>1]|0|0)|0;c=J6(d|0,z|0,e[c+6>>1]|0|0,0)|0;d=z;b[a>>1]=c;a=Q6(c|0,d|0,16)|0;b[g>>1]=a;b[f>>1]=d;z=d&65535;return c|0}function w5(a){a=a|0;var b=0;b=186608;c[b>>2]=a+-1;c[b+4>>2]=0;return}function x5(){var a=0,b=0,d=0;b=186608;b=I6(c[b>>2]|0,c[b+4>>2]|0,1284865837,1481765933)|0;b=J6(b|0,z|0,1,0)|0;a=z;d=186608;c[d>>2]=b;c[d+4>>2]=a;a=Q6(b|0,a|0,33)|0;return a|0}function y5(a){a=a|0;b[96876]=b[32922]|0;b[96877]=b[32923]|0;b[96878]=b[32924]|0;b[32922]=b[a>>1]|0;b[32923]=b[a+2>>1]|0;b[32924]=b[a+4>>1]|0;return 193752}function z5(a){a=a|0;var c=0,d=0;c=l;l=l+16|0;d=c;b[d>>1]=13070;b[d+2>>1]=a;b[d+4>>1]=a>>>16;y5(d)|0;l=c;return}function A5(a){a=a|0;var b=0;b=v5(a,65850)|0;b=R6(b|0,z|0,4)|0;a=z|1072693248;c[j>>2]=b;c[j+4>>2]=a;return +(+h[j>>3]+-1.0)}function B5(){return +(+A5(65844))}function C5(a,b){a=a|0;b=b|0;if(!a)b=V1(1,24)|0;else {c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;}return b|0}function D5(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(b|0)do{U1(c[b>>2]|0);d=b;b=c[b+4>>2]|0;U1(d);}while((b|0)!=0);U1(a);return}function E5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;h=a+16|0;a:do if(!(c[h>>2]|0)){k=a+12|0;g=c[k>>2]|0;if(g>>>0>>0){do if(b)if(!d){c[h>>2]=1;b=0;break a}else {h=a+8|0;c[h>>2]=d;g=1024;b=d;break}else {g=f<<3;g=g>>>0>1024?g:1024;j=T1(8)|0;if(!j){c[h>>2]=1;b=0;break a}b=T1(g)|0;c[j>>2]=b;d=b;if(!b){U1(j);c[h>>2]=1;b=0;break a}c[j+4>>2]=0;h=a+4|0;i=c[h>>2]|0;if(i|0)c[i+4>>2]=j;if(!(c[a>>2]|0))c[a>>2]=j;c[h>>2]=j;h=a+8|0;c[h>>2]=d;}while(0);c[k>>2]=g;}else {h=a+8|0;b=c[h>>2]|0;d=b;}d=d+f&3;d=((d|0)==0?0:4-d|0)+f|0;c[h>>2]=b+d;c[k>>2]=g-d;if(e)Y6(b|0,0,d|0)|0;}else b=0;while(0);return b|0}function F5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;v=l;l=l+48|0;i=v;t=G5()|0;a:do if(!t)b=12;else {u=C5(0,0)|0;if(!u){H5(t);b=12;break}e=i+8|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[i>>2]=u;c[i+4>>2]=t;c[i+16>>2]=b;c[i+32>>2]=d;e=i+28|0;c[e>>2]=-1;b=I5(i)|0;b:do if(!b){h=i+20|0;f=c[h>>2]|0;c[a>>2]=f+-1;j=c[i+8>>2]|0;b=c[e>>2]|0;if((b|0)<(f|0)){g=V1(1,68)|0;if(g){r=b>>>31^1;c[g+60>>2]=r;c[g+28>>2]=f;if((d&8|0)==0|(r|0)!=0){b=J5(0,t,j,g)|0;if(b|0){h=0;i=0;f=0;e=0;break}f=c[g+40>>2]|0;if((f|0)>0){b=(f<<2)+4|0;e=T1(b)|0;if(!e){h=0;i=0;b=12;f=0;e=0;break}c[g+32>>2]=e;Y6(e|0,-1,b|0)|0;}else e=0;r=V1(f<<1|1,4)|0;c[g+36>>2]=r;if(!r){h=0;i=0;b=12;f=0;e=0;break}b=V1(c[h>>2]|0,12)|0;if(!b){h=0;i=0;b=12;f=0;e=0;break}c[g+16>>2]=b;b=J5(u,t,j,g)|0;if(!b)b=e;else {h=0;i=0;f=0;e=0;break}}else b=0;r=i+24|0;b=K5(u,t,j,r,b)|0;if(!b){b=c[r>>2]|0;c[r>>2]=b+1;b=L5(u,0,0,b)|0;if((b|0)!=0?(s=M5(u,j,b)|0,(s|0)!=0):0){b=N5(u,t,s)|0;if(!b){e=c[r>>2]|0;b=e<<2;p=T1(b)|0;if(p){q=T1(b)|0;if(q){if((e|0)>0)Y6(p|0,0,e<<2|0)|0;O5(s,0,p,0)|0;f=c[r>>2]|0;if((f|0)>0){b=0;e=0;do{c[q+(e<<2)>>2]=b;o=p+(e<<2)|0;b=b+1+(c[o>>2]|0)|0;c[o>>2]=0;e=e+1|0;}while((e|0)<(f|0));m=b;}else m=0;n=V1(m+1|0,32)|0;if(n){c[g>>2]=n;o=g+4|0;c[o>>2]=m;b=O5(s,n,p,q)|0;if(!b){c[g+20>>2]=0;f=s+24|0;b=c[f>>2]|0;e=0;while(1){e=e+1|0;if((c[b>>2]|0)<=-1)break;else b=b+32|0;}k=V1(e,32)|0;if(!k){h=p;i=q;b=12;f=p;e=q;}else {c[g+8>>2]=k;e=c[f>>2]|0;f=c[e>>2]|0;if((f|0)>-1){b=0;do{c[k+(b<<5)+8>>2]=n+(c[q+(f<<2)>>2]<<5);c[k+(b<<5)+12>>2]=f;i=k+(b<<5)+16|0;c[i>>2]=0;j=e+12|0;h=c[j>>2]|0;if(h|0){f=0;do{w=f;f=f+1|0;}while((c[h+(w<<2)>>2]|0)>-1);f=f<<2;h=T1(f)|0;c[i>>2]=h;if(!h){h=p;i=q;b=12;f=p;e=q;break b}W6(h|0,c[j>>2]|0,f|0)|0;}c[k+(b<<5)+20>>2]=c[e+16>>2];b=b+1|0;e=e+32|0;f=c[e>>2]|0;}while((f|0)>-1)}else b=0;c[k+(b<<5)+8>>2]=0;c[o>>2]=m;c[g+12>>2]=n+(c[q+(c[c[s+28>>2]>>2]<<2)>>2]<<5);c[g+52>>2]=c[r>>2];c[g+56>>2]=d;D5(u);H5(t);U1(p);U1(q);c[a+4>>2]=g;b=0;break a}}else {h=p;i=q;f=p;e=q;}}else {h=p;i=q;b=12;f=p;e=q;}}else {h=p;i=q;b=12;f=p;e=0;}}else {h=p;i=0;b=12;f=0;e=0;}}else {h=0;i=0;f=0;e=0;}}else {h=0;i=0;b=12;f=0;e=0;}}else {h=0;i=0;f=0;e=0;}}else {h=0;i=0;b=12;f=0;e=0;}}else {g=0;h=0;i=0;b=6;f=0;e=0;}}else {g=0;h=0;i=0;f=0;e=0;}while(0);D5(u);H5(t);if(h|0)U1(f);if(i|0)U1(e);c[a+4>>2]=g;P5(a);}while(0);l=v;return b|0}function G5(){var a=0,b=0;a=T1(20)|0;do if(a){b=T1(2048)|0;c[a+16>>2]=b;if(!b){U1(a);a=0;break}else {c[a>>2]=512;c[a+4>>2]=1024e3;c[a+8>>2]=128;c[a+12>>2]=0;break}}while(0);return a|0}function H5(a){a=a|0;U1(c[a+16>>2]|0);U1(a);return}function I5(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+16|0;p=u+4|0;q=u;r=c[b+32>>2]&1;s=b+16|0;e=c[s>>2]|0;t=c[b+4>>2]|0;d=T5(t,0)|0;a:do if(!d){m=(r|0)!=0;n=b+8|0;o=b+12|0;d=0;k=1;b:while(1){g=0;h=d;f=0;c:while(1){d=a[e>>0]|0;if(m){if(d<<24>>24==40)break;if((h|0)!=0&d<<24>>24==41)j=13;else j=14;}else if(d<<24>>24==92)switch(a[e+1>>0]|0){case 40:break c;case 41:{j=13;break}default:j=14;}else j=14;if((j|0)==13){j=0;i=L5(c[b>>2]|0,-1,-1,-1)|0;c[n>>2]=i;if(!i){d=12;break a}else i=f;}else if((j|0)==14){j=0;d=g6(b,e)|0;if(d|0)break a;i=f;e=c[o>>2]|0;}d:while(1){e:while(1){d=a[e>>0]|0;switch(d<<24>>24){case 42:case 92:break;default:{if(!m)break e;switch(d<<24>>24){case 123:case 63:case 43:break;default:break e}}}d=d<<24>>24==92;if(m&d)break;f=e+1|0;if(d)switch(a[f>>0]|0){case 123:case 63:case 43:break;default:break e}e=d?f:e;if((!m?(e|0)==((c[s>>2]|0)+1|0):0)?(a[e+-1>>0]|0)==94:0)break;if((a[e>>0]|0)==123){e=h6(e+1|0,r,p,q)|0;if(!e){j=28;break b}d=c[q>>2]|0;f=c[b>>2]|0;if(!d)d=L5(f,-1,-1,-1)|0;else j=36;}else {c[p>>2]=0;c[q>>2]=-1;d=a[e>>0]|0;if(d<<24>>24==43){c[p>>2]=1;d=a[e>>0]|0;}if(d<<24>>24==63){c[q>>2]=1;d=1;}else d=-1;e=e+1|0;f=c[b>>2]|0;j=36;}if((j|0)==36){j=0;d=b6(f,c[n>>2]|0,c[p>>2]|0,d,0)|0;}c[n>>2]=d;if(!d){d=12;break a}}d=M5(c[b>>2]|0,g,c[n>>2]|0)|0;f=a[e>>0]|0;f:do if(m){if(f<<24>>24==124){j=40;break d}if((h|0)!=0&f<<24>>24==41|f<<24>>24==0)j=47;else {g=d;f=i;continue c}}else {switch(f<<24>>24){case 0:{j=47;break f}case 92:break;default:{g=d;f=i;continue c}}switch(a[e+1>>0]|0){case 124:case 41:break;default:{g=d;f=i;continue c}}d=c6(c[b>>2]|0,i,d)|0;if((a[e+1>>0]|0)==124){f=2;break d}if(!h){d=8;break a}e=e+2|0;f=92;}while(0);if((j|0)==47){j=0;d=c6(c[b>>2]|0,i,d)|0;e=f<<24>>24==41?e+1|0:e;}d=i6(b,d,U5(t)|0)|0;if(d|0)break a;d=f<<24>>24==0;f=(h|0)<1;if(f&d){j=50;break b}if(f|d){d=8;break a}g=V5(t)|0;h=h+-1|0;i=V5(t)|0;}if((j|0)==40){f=1;d=c6(c[b>>2]|0,i,d)|0;}g=0;e=e+f|0;f=d;}d=S5(t,f)|0;if(d|0)break a;d=S5(t,g)|0;if(d|0)break a;d=T5(t,k)|0;if(d|0)break a;d=h+1|0;k=k+1|0;e=m?e+1|0:e+2|0;}if((j|0)==28){d=10;break}else if((j|0)==50){c[b+20>>2]=k;d=0;break}}while(0);l=u;return d|0}function J5(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;x=R5(d)|0;y=(b|0)==0|(f|0)==0;if(!y){c[f+48>>2]=0;c[c[f+36>>2]>>2]=-1;}h=c[f+28>>2]|0;z=T1((h<<3)+8|0)|0;do if(!z)g=12;else {c[z>>2]=-1;A=T1((h<<2)+4|0)|0;if(!A){U1(z);g=12;break}c[A>>2]=-1;g=0;while(1)if(g>>>0>h>>>0)break;else g=g+1|0;S5(d,e)|0;g=T5(d,0)|0;a:do if((g|0)!=0|(R5(d)|0)<=(x|0)){e=z;n=0;h=0;m=0;l=-1;}else {u=f+32|0;v=f+36|0;w=f+16|0;e=z;n=0;h=0;m=0;t=1;l=-1;s=0;while(1){b:do switch(U5(d)|0){case 6:{i=U5(d)|0;g=0;do{j=e+(g<<2)|0;g=g+1|0;}while((c[j>>2]|0)>-1);c[j>>2]=i<<1|1;c[e+(g<<2)>>2]=-1;g=0;while(1)if((c[A+(g<<2)>>2]|0)>-1)g=g+1|0;else break;c[A+(g+-1<<2)>>2]=-1;g=0;j=t;i=s;break}case 0:{q=V5(d)|0;r=q+12|0;j=c[r>>2]|0;if((j|0)>-1){g=0;do{i=e+(g<<2)|0;g=g+1|0;}while((c[i>>2]|0)>-1);c[i>>2]=j<<1;c[e+(g<<2)>>2]=-1;if(!y){g=0;while(1)if((c[A+(g<<2)>>2]|0)>-1)g=g+1|0;else break;i=(c[w>>2]|0)+(j*12|0)+8|0;c[i>>2]=0;if((g|0)>0){g=T1((g<<2)+4|0)|0;if(!g){g=12;j=t;i=s;break b}c[i>>2]=g;i=c[A>>2]|0;if((i|0)>-1){k=0;j=g;do{c[j>>2]=i;k=k+1|0;i=c[A+(k<<2)>>2]|0;j=g+(k<<2)|0;}while((i|0)>-1);g=j;}c[g>>2]=-1;}}g=T5(d,c[r>>2]|0)|0;if(g|0){j=t;i=s;break b}g=T5(d,6)|0;if(g|0){j=t;i=s;break b}}c:do switch(c[q>>2]|0){case 0:{p=c[c[q+4>>2]>>2]|0;if((p|0)>-1|(p|0)==-4?(c[e>>2]|0)>-1:0){if(y){c[q+20>>2]=1;g=0;}else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=s;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;p=t+1|0;o=s;n=n+1|0;m=t;}else {p=t;g=0;o=s;}break}case 1:{j=c[q+4>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;g=S5(d,q)|0;if(!g){g=T5(d,5)|0;if(!g){g=S5(d,j)|0;if(!g){g=T5(d,0)|0;if(!g){i=k+20|0;g=T5(d,(c[i>>2]|0)+t|0)|0;if(!g){if((c[i>>2]|0)>0){i=(c[j+20>>2]|0)>0;g=i?t:-1;i=t+(i&1)|0;}else {g=-1;i=t;}g=T5(d,g)|0;if(!g){g=T5(d,4)|0;if(!g){g=S5(d,k)|0;if(!g){p=i;g=T5(d,0)|0;o=s;}else {p=i;o=s;}}else {p=i;o=s;}}else {p=i;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}case 2:{i=c[q+4>>2]|0;if(y){if((c[e>>2]|0)>-1)g=1;else g=(a[i+12>>0]&1)!=0;g=T5(d,g&1)|0;if(g|0){p=t;o=s;break c}}else {g=T5(d,m)|0;if(g|0){p=t;o=s;break c}g=T5(d,a[i+12>>0]&1)|0;if(g|0){p=t;o=s;break c}}g=S5(d,q)|0;if(!g){g=T5(d,1)|0;if(!g){g=S5(d,c[i>>2]|0)|0;if(!g){g=T5(d,0)|0;if(!g){if((c[e>>2]|0)<=-1?(a[i+12>>0]&1)==0:0){p=t;g=0;o=0;break c}if(y)g=0;else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=(a[i+12>>0]&1)==0?s:1;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;p=t+1|0;o=0;n=n+1|0;m=t;}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}case 3:{j=c[q+4>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;i=(c[e>>2]|0)>-1;p=t+1|0;g=T5(d,i?p:t)|0;if(!g){g=T5(d,i?t:m)|0;if(!g){g=S5(d,e)|0;if(!g){g=T5(d,(c[e>>2]|0)>>>31^1)|0;if(!g){g=S5(d,q)|0;if(!g){g=S5(d,j)|0;if(!g){g=S5(d,k)|0;if(!g){g=T5(d,3)|0;if(!g){g=S5(d,j)|0;if(!g){g=T5(d,0)|0;if(!g){g=T5(d,2)|0;if(g|0){p=t;o=s;break c}g=S5(d,k)|0;if(g|0){p=t;o=s;break c}g=T5(d,0)|0;if(g|0){p=t;o=s;break c}if((c[e>>2]|0)>-1){if(y)g=0;else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=s;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;n=n+1|0;m=t;i=p;}else {g=0;i=t;}t=(c[q+16>>2]|0)>0;p=t?i+2|0:i;o=s;m=t?i+1|0:m;}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}default:{p=t;g=0;o=s;}}while(0);j=c[r>>2]|0;if((j|0)>-1){i=0;do{k=A+(i<<2)|0;i=i+1|0;}while((c[k>>2]|0)>-1);c[k>>2]=j;c[A+(i<<2)>>2]=-1;j=p;i=o;}else {j=p;i=o;}break}case 1:{g=V5(d)|0;if(y){i=c[(c[c[g+4>>2]>>2]|0)+20>>2]|0;c[g+20>>2]=(U5(d)|0)+i;i=0;l=-1;}else {q=U5(d)|0;r=U5(d)|0;i=q;l=(q|0)==0?l:r;}g=0;j=t;i=y?s:(i|0)==0&1;break}case 4:{i=U5(d)|0;j=U5(d)|0;g=0;m=(i|0)>-1?i:m;i=s;break}case 5:{g=V5(d)|0;if(y){j=c[g+4>>2]|0;c[g+20>>2]=(c[(c[j+4>>2]|0)+20>>2]|0)+(c[(c[j>>2]|0)+20>>2]|0);g=0;j=t;i=s;}else {g=0;j=t;i=s;}break}case 2:{while(1)if((c[e>>2]|0)>-1)e=e+4|0;else {g=0;j=t;i=s;break}break}case 3:{j=V5(d)|0;o=V5(d)|0;g=V5(d)|0;e=U5(d)|0;if(y){r=c[g+4>>2]|0;s=g+16|0;c[g+20>>2]=(c[(c[r>>2]|0)+20>>2]|0)+e+(c[(c[r+4>>2]|0)+20>>2]|0)+((c[s>>2]|0)>0?2:0);g=s;}else g=g+16|0;e=V5(d)|0;i=U5(d)|0;k=U5(d)|0;if((c[g>>2]|0)>0){if(y)g=0;else {g=f6(b,j,i)|0;c[(c[u>>2]|0)+(i<<2)>>2]=1;if(!g)g=f6(b,o,k)|0;c[(c[u>>2]|0)+(k<<2)>>2]=1;}n=n+2|0;j=t;i=1;}else {g=0;j=t;i=1;}break}default:{g=0;j=t;i=s;}}while(0);if((g|0)!=0|(R5(d)|0)<=(x|0))break a;else {t=j;s=i;}}}while(0);if(!y?(e6(e,f,m),(l|0)>-1):0){i=c[f+36>>2]|0;e=0;while(1){j=i+(e<<2)|0;k=e+1|0;if((c[j>>2]|0)>-1)e=k;else break}c[j>>2]=m;c[i+(k<<2)>>2]=l;c[i+(e+2<<2)>>2]=-1;h=h+1|0;}c[f+48>>2]=n;c[f+40>>2]=n;c[f+44>>2]=h;U1(z);U1(A);}while(0);return g|0}function K5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;t=y+12|0;x=y+8|0;u=y+4|0;v=y;w=R5(b)|0;c[t>>2]=0;c[x>>2]=0;d=S5(b,d)|0;a:do if(!d){d=T5(b,0)|0;if(!d){b:do if((R5(b)|0)>(w|0)){g=0;i=0;j=0;c:while(1){q=U5(b)|0;r=V5(b)|0;d:do switch(q|0){case 0:{switch(c[r>>2]|0){case 0:{d=c[r+4>>2]|0;r=c[d>>2]|0;if(!((r|0)>-1|(r|0)==-4)){d=j;break d}r=d+8|0;d=(c[r>>2]|0)+j|0;c[r>>2]=d;if((d|0)<=(c[x>>2]|0)){d=j;break d}c[x>>2]=d;d=j;break d}case 3:{h=c[r+4>>2]|0;d=S5(b,c[h+4>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;break}case 1:{h=c[r+4>>2]|0;d=S5(b,c[h+4>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;break}case 2:{h=c[r+4>>2]|0;d=T5(b,j)|0;if(d|0)break b;d=S5(b,r)|0;if(d|0)break b;d=T5(b,1)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;if((c[h+4>>2]|0)<=1?(c[h+8>>2]|0)<=1:0)d=j;else {c[t>>2]=0;d=0;}i=i+1|0;break d}default:{d=j;break d}}d=T5(b,0)|0;if(!d)d=j;else break b;break}case 1:{p=r+4|0;o=c[p>>2]|0;q=U5(b)|0;c[t>>2]=q;n=o+4|0;j=c[n>>2]|0;if((j|0)<=1)if((c[o+8>>2]|0)>1){c[u>>2]=0;if((j|0)>0)s=30;else {d=q;h=0;s=37;}}else d=q;else {c[u>>2]=0;s=30;}e:do if((s|0)==30){d=a6(a,b,c[o>>2]|0,(j|0)>1?1:2,t,f,v,x)|0;if(!d){h=0;k=q;m=1;}else {s=34;break c}while(1){d=c[v>>2]|0;if(!h)h=d;else h=M5(a,h,d)|0;if(!h){d=12;s=34;break c}j=c[n>>2]|0;if((m|0)>=(j|0)){d=k;s=37;break e}k=c[t>>2]|0;m=m+1|0;d=a6(a,b,c[o>>2]|0,(m|0)<(j|0)?1:2,t,f,v,x)|0;if(d|0){s=34;break c}}}while(0);if((s|0)==37){s=0;n=o+8|0;k=c[n>>2]|0;if((k|0)==-1){k=c[t>>2]|0;d=a6(a,b,c[o>>2]|0,0,t,0,u,x)|0;if(d|0)break c;j=b6(a,c[u>>2]|0,0,-1,0)|0;c[u>>2]=j;if(!j){d=12;break c}else d=k;}else if((j|0)<(k|0)){k=j;j=0;while(1){m=c[t>>2]|0;d=a6(a,b,c[o>>2]|0,0,t,0,v,x)|0;if(d|0){s=49;break c}if(!j){d=c[v>>2]|0;c[u>>2]=d;}else {d=M5(a,c[v>>2]|0,j)|0;c[u>>2]=d;}if(!d){d=12;s=49;break c}j=L5(a,-1,-1,-1)|0;if(!j){d=12;s=49;break c}j=c6(a,j,d)|0;c[u>>2]=j;if(!j){d=12;s=49;break c}k=k+1|0;if((k|0)>=(c[n>>2]|0)){d=m;break}}}else j=0;c[t>>2]=d;if(h){if(j){h=M5(a,h,j)|0;s=54;}}else {h=j;s=54;}if((s|0)==54){s=0;if(!h){d=12;break c}}c[p>>2]=c[h+4>>2];c[r>>2]=c[h>>2];}i=i+-1|0;h=d-q+g|0;if(!i){c[t>>2]=h;g=h;i=0;d=h;}else g=h;break}default:d=j;}while(0);if((R5(b)|0)>(w|0))j=d;else {d=0;break b}}break a}else {d=0;g=0;}while(0);w=(c[e>>2]|0)+g|0;x=c[x>>2]|0;c[e>>2]=(x|0)>(w|0)?x:w;}}while(0);l=y;return d|0}function L5(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=E5(a,0,0,1,20)|0;a=$5(a,0,f)|0;if(!a)a=0;else {c[f>>2]=b;c[f+4>>2]=d;c[f+8>>2]=e;}return a|0}function M5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(b){e=E5(a,0,0,1,8)|0;a=$5(a,1,e)|0;if(!a)d=0;else {c[e>>2]=b;c[e+4>>2]=d;c[a+16>>2]=(c[d+16>>2]|0)+(c[b+16>>2]|0);d=a;}}return d|0}function N5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;j=o+4|0;k=o;m=R5(b)|0;d=S5(b,d)|0;a:do if(!d){d=T5(b,0)|0;if(!d)if((R5(b)|0)>(m|0)){b:while(1){h=U5(b)|0;i=V5(b)|0;c:do switch(h|0){case 0:switch(c[i>>2]|0){case 0:{g=c[i+4>>2]|0;f=c[g>>2]|0;if((f|0)==-4){c[i+8>>2]=0;d=g+8|0;h=W5(a,c[d>>2]|0,0,1114111,0,0,-1)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=W5(a,c[d>>2]|0,0,1114111,0,0,c[g+4>>2]|0)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}d=i+8|0;if((f|0)<0){c[d>>2]=1;h=X5(a)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=X5(a)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}else {c[d>>2]=0;d=g+8|0;e=g+4|0;h=W5(a,c[d>>2]|0,f,c[e>>2]|0,0,0,-1)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=W5(a,c[d>>2]|0,c[g>>2]|0,c[e>>2]|0,c[g+12>>2]|0,c[g+16>>2]|0,-1)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}}case 3:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,1)|0;if(d|0)break a;e=i+4|0;d=S5(b,c[(c[e>>2]|0)+4>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(d|0)break a;d=S5(b,c[c[e>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}case 1:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,2)|0;if(d|0)break a;e=i+4|0;d=S5(b,c[(c[e>>2]|0)+4>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(d|0)break a;d=S5(b,c[c[e>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}case 2:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,3)|0;if(d|0)break a;d=S5(b,c[c[i+4>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}default:break c}case 1:{d=c[i+4>>2]|0;e=c[d>>2]|0;f=d+4|0;g=c[f>>2]|0;if(!(c[e+8>>2]|0))h=(c[g+8>>2]|0)!=0;else h=1;c[i+8>>2]=h&1;h=Y5(a,c[e+24>>2]|0,c[g+24>>2]|0,0,0)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=Y5(a,c[(c[d>>2]|0)+28>>2]|0,c[(c[f>>2]|0)+28>>2]|0,0,0)|0;c[i+28>>2]=h;if(!h){d=12;break a}break}case 3:{h=c[i+4>>2]|0;d=c[h>>2]|0;if(!(c[h+4>>2]|0))e=1;else e=(c[d+8>>2]|0)!=0&1;c[i+8>>2]=e;c[i+24>>2]=c[d+24>>2];c[i+28>>2]=c[d+28>>2];break}case 2:{g=c[i+4>>2]|0;d=c[g>>2]|0;e=d+8|0;if(!(c[e>>2]|0))f=0;else f=(c[(c[g+4>>2]|0)+8>>2]|0)!=0;c[i+8>>2]=f&1;if(c[e>>2]|0){d=Z5(b,d,0,0,j)|0;if(d|0)break b;e=T1((c[j>>2]<<2)+4|0)|0;if(!e){d=12;break b}c[e>>2]=-1;c[k>>2]=0;d=Z5(b,c[g>>2]|0,e,k,0)|0;if(d|0){n=45;break b}d=g+4|0;h=i+24|0;c[h>>2]=Y5(a,c[(c[d>>2]|0)+24>>2]|0,c[(c[g>>2]|0)+24>>2]|0,e,c[k>>2]|0)|0;U1(e);if(!(c[h>>2]|0)){d=12;break b}else f=d;}else {c[i+24>>2]=c[d+24>>2];f=g+4|0;}d=c[f>>2]|0;if(c[d+8>>2]|0){d=Z5(b,d,0,0,j)|0;if(d|0)break b;e=T1((c[j>>2]<<2)+4|0)|0;if(!e){d=12;break b}c[e>>2]=-1;c[k>>2]=0;d=Z5(b,c[f>>2]|0,e,k,0)|0;if(d|0){n=52;break b}i=i+28|0;c[i>>2]=Y5(a,c[(c[g>>2]|0)+28>>2]|0,c[(c[f>>2]|0)+28>>2]|0,e,c[k>>2]|0)|0;U1(e);if(!(c[i>>2]|0)){d=12;break b}}else c[i+28>>2]=c[d+28>>2];break}default:{}}while(0);if((R5(b)|0)<=(m|0)){d=0;break a}}if((n|0)==45)U1(e);else if((n|0)==52)U1(e);}else d=0;}while(0);l=o;return d|0}function O5(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:while(1){switch(c[a>>2]|0){case 2:{a=c[a+4>>2]|0;if((c[a+8>>2]|0)==-1?(h=c[a>>2]|0,h=Q5(c[h+28>>2]|0,c[h+24>>2]|0,b,d,e)|0,(h|0)!=0):0){a=h;break a}break}case 3:{f=c[a+4>>2]|0;a=O5(c[f>>2]|0,b,d,e)|0;if(a|0)break a;a=f+4|0;break}case 1:{f=c[a+4>>2]|0;g=f+4|0;a=Q5(c[(c[f>>2]|0)+28>>2]|0,c[(c[g>>2]|0)+24>>2]|0,b,d,e)|0;if(a|0)break a;a=O5(c[f>>2]|0,b,d,e)|0;if(!a)a=g;else break a;break}default:{a=0;break a}}a=c[a>>2]|0;}return a|0}function P5(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=c[a+4>>2]|0;if(h|0){e=h+4|0;a=c[h>>2]|0;if(c[e>>2]|0){d=0;do{if(c[a+(d<<5)+8>>2]|0){b=c[a+(d<<5)+16>>2]|0;if(b){U1(b);a=c[h>>2]|0;}b=c[a+(d<<5)+28>>2]|0;if(b){U1(b);a=c[h>>2]|0;}}d=d+1|0;}while(d>>>0<(c[e>>2]|0)>>>0)}if(a|0)U1(a);d=h+8|0;a=c[d>>2]|0;if(a|0){if(c[a+8>>2]|0){while(1){b=c[a+16>>2]|0;if(b|0)U1(b);if(!(c[a+40>>2]|0))break;else a=a+32|0;}a=c[d>>2]|0;}U1(a);}f=h+16|0;a=c[f>>2]|0;if(a|0){g=h+28|0;b=c[g>>2]|0;if(b){e=0;do{d=c[a+(e*12|0)+8>>2]|0;if(d){U1(d);b=c[g>>2]|0;a=c[f>>2]|0;}e=e+1|0;}while(e>>>0>>0)}U1(a);}a=c[h+32>>2]|0;if(a|0)U1(a);a=c[h+20>>2]|0;if(a|0)U1(a);a=c[h+36>>2]|0;if(a|0)U1(a);U1(h);}return}function Q5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=c[a>>2]|0;h=(g|0)>-1;a:do if(!d)if(h){h=b+32|0;do{if((c[b>>2]|0)>-1?(y=e+(g<<2)|0,c[y>>2]=(c[y>>2]|0)+1,(c[h>>2]|0)>-1):0){g=h;do{y=e+(c[a>>2]<<2)|0;c[y>>2]=(c[y>>2]|0)+1;g=g+32|0;}while((c[g>>2]|0)>-1)}a=a+32|0;g=c[a>>2]|0;}while((g|0)>-1);g=0;}else g=0;else if(h)while(1){h=c[b>>2]|0;b:do if((h|0)>-1){p=a+4|0;q=a+8|0;r=a+16|0;s=a+20|0;t=a+24|0;u=a+28|0;v=a+12|0;e=-1;g=b;while(1){o=h;while(1){if((o|0)!=(e|0))break;g=g+32|0;h=c[g>>2]|0;if((h|0)>-1)o=h;else break b}l=d+(c[f+(c[a>>2]<<2)>>2]<<5)|0;while(1){h=l+8|0;if(!(c[h>>2]|0))break;else l=l+32|0;}c[l+40>>2]=0;c[l>>2]=c[p>>2];c[l+4>>2]=c[q>>2];c[h>>2]=d+(c[f+(o<<2)>>2]<<5);c[l+12>>2]=o;h=c[s>>2]|0;e=c[g+16>>2]|c[r>>2]|(h|0?4:0)|(c[t>>2]|0?8:0);i=l+20|0;c[i>>2]=e;j=c[u>>2]|0;if((j|0)>-1){c[i>>2]=e|256;h=j;}c[l+24>>2]=h;e=c[t>>2]|0;if(!e)c[l+28>>2]=0;else {h=0;do{n=h;h=h+1|0;}while((c[e+(n<<2)>>2]|0)!=0);h=T1(h<<2)|0;c[l+28>>2]=h;if(!h){g=12;break a}k=c[t>>2]|0;e=c[k>>2]|0;if(e){j=0;i=h;do{c[i>>2]=e;j=j+1|0;e=c[k+(j<<2)>>2]|0;i=h+(j<<2)|0;}while((e|0)!=0);h=i;}c[h>>2]=0;}e=c[v>>2]|0;if(!e)h=0;else {h=0;while(1)if((c[e+(h<<2)>>2]|0)>-1)h=h+1|0;else break}k=g+12|0;i=c[k>>2]|0;if(!i)e=0;else {e=0;while(1)if((c[i+(e<<2)>>2]|0)>-1)e=e+1|0;else break}j=l+16|0;i=c[j>>2]|0;if(i|0)U1(i);c[j>>2]=0;h=e+h|0;if((h|0)>0){n=T1((h<<2)+4|0)|0;c[j>>2]=n;if(!n){g=12;break a}e=c[v>>2]|0;if((e|0)!=0?(w=c[e>>2]|0,(w|0)>-1):0){h=0;i=w;do{c[n+(h<<2)>>2]=i;h=h+1|0;i=c[e+(h<<2)>>2]|0;}while((i|0)>-1);m=h;}else m=0;j=c[k>>2]|0;if((j|0)!=0?(x=c[j>>2]|0,(x|0)>-1):0){k=(m|0)>0;h=m;i=0;l=x;do{c:do if(k){e=0;while(1){if((c[n+(e<<2)>>2]|0)==(l|0))break c;e=e+1|0;if((e|0)>=(m|0)){y=39;break}}}else y=39;while(0);if((y|0)==39){y=0;c[n+(h<<2)>>2]=l;h=h+1|0;}i=i+1|0;l=c[j+(i<<2)>>2]|0;}while((l|0)>-1)}else h=m;c[n+(h<<2)>>2]=-1;}g=g+32|0;h=c[g>>2]|0;if((h|0)<=-1)break;else e=o;}}while(0);a=a+32|0;if((c[a>>2]|0)<=-1){g=0;break}}else g=0;while(0);return g|0}function R5(a){a=a|0;return c[a+12>>2]|0}function S5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d+4|0;f=d;c[f>>2]=b;c[e>>2]=c[f>>2];b=_5(a,e)|0;l=d;return b|0}function T5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d+4|0;f=d;c[f>>2]=b;c[e>>2]=c[f>>2];b=_5(a,e)|0;l=d;return b|0}function U5(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;d=a+12|0;a=(c[d>>2]|0)+-1|0;c[d>>2]=a;return c[b+(a<<2)>>2]|0}function V5(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;d=a+12|0;a=(c[d>>2]|0)+-1|0;c[d>>2]=a;return c[b+(a<<2)>>2]|0}function W5(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;a=E5(a,0,0,1,64)|0;if(!a)a=0;else {c[a>>2]=b;c[a+4>>2]=d;c[a+8>>2]=e;c[a+20>>2]=f;c[a+24>>2]=g;c[a+28>>2]=h;c[a+32>>2]=-1;c[a+36>>2]=-1;c[a+40>>2]=-1;}return a|0}function X5(a){a=a|0;a=E5(a,0,0,1,32)|0;if(!a)a=0;else {c[a>>2]=-1;c[a+4>>2]=-1;c[a+8>>2]=-1;}return a|0}function Y5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=(e|0)==0;if(o)n=0;else {g=0;while(1)if((c[e+(g<<2)>>2]|0)>-1)g=g+1|0;else {n=g;break}}h=0;while(1)if((c[b+(h<<5)>>2]|0)>-1)h=h+1|0;else {g=0;break}while(1)if((c[d+(g<<5)>>2]|0)>-1)g=g+1|0;else break;g=E5(a,0,0,1,(g+h<<5)+32|0)|0;a:do if(!g)g=0;else {h=c[b>>2]|0;if((h|0)>-1){m=(n|0)>0;i=0;while(1){c[g+(i<<5)>>2]=h;c[g+(i<<5)+4>>2]=c[b+(i<<5)+4>>2];c[g+(i<<5)+8>>2]=c[b+(i<<5)+8>>2];c[g+(i<<5)+16>>2]=c[b+(i<<5)+16>>2]|f;c[g+(i<<5)+20>>2]=c[b+(i<<5)+20>>2];c[g+(i<<5)+24>>2]=c[b+(i<<5)+24>>2];c[g+(i<<5)+28>>2]=c[b+(i<<5)+28>>2];l=b+(i<<5)+12|0;j=c[l>>2]|0;h=(j|0)==0;if(o&h)h=0;else {if(h)k=0;else {h=0;while(1)if((c[j+(h<<2)>>2]|0)>-1)h=h+1|0;else {k=h;break}}h=E5(a,0,0,0,(k+n<<2)+4|0)|0;if(!h){g=0;break a}if((k|0)>0){l=c[l>>2]|0;j=0;do{c[h+(j<<2)>>2]=c[l+(j<<2)>>2];j=j+1|0;}while((j|0)!=(k|0))}else k=0;if(m){j=0;do{c[h+(j+k<<2)>>2]=c[e+(j<<2)>>2];j=j+1|0;}while((j|0)!=(n|0));j=n;}else j=0;c[h+(j+k<<2)>>2]=-1;}c[g+(i<<5)+12>>2]=h;i=i+1|0;h=c[b+(i<<5)>>2]|0;if((h|0)<=-1){n=i;break}}}else n=0;i=c[d>>2]|0;h=g+(n<<5)|0;if((i|0)>-1){m=0;l=n;do{c[h>>2]=i;c[g+(l<<5)+4>>2]=c[d+(m<<5)+4>>2];c[g+(l<<5)+8>>2]=c[d+(m<<5)+8>>2];c[g+(l<<5)+16>>2]=c[d+(m<<5)+16>>2];c[g+(l<<5)+20>>2]=c[d+(m<<5)+20>>2];c[g+(l<<5)+24>>2]=c[d+(m<<5)+24>>2];c[g+(l<<5)+28>>2]=c[d+(m<<5)+28>>2];j=d+(m<<5)+12|0;h=c[j>>2]|0;if(!h)h=0;else {i=0;while(1)if((c[h+(i<<2)>>2]|0)>-1)i=i+1|0;else break;h=E5(a,0,0,0,(i<<2)+4|0)|0;if(!h){g=0;break a}if((i|0)>0){k=c[j>>2]|0;j=0;do{c[h+(j<<2)>>2]=c[k+(j<<2)>>2];j=j+1|0;}while((j|0)!=(i|0))}else i=0;c[h+(i<<2)>>2]=-1;}c[g+(l<<5)+12>>2]=h;m=m+1|0;i=c[d+(m<<5)>>2]|0;l=m+n|0;h=g+(l<<5)|0;}while((i|0)>-1)}c[h>>2]=-1;}while(0);return g|0}function Z5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=R5(a)|0;p=(f|0)!=0;if(p)c[f>>2]=0;b=S5(a,b)|0;a:do if(!b){m=(d|0)==0;l=(e|0)==0;if((R5(a)|0)>(o|0))while(1){b=V5(a)|0;b:do switch(c[b>>2]|0){case 0:{b=c[b+4>>2]|0;switch(c[b>>2]|0){case -3:break;case -2:{if(l)break b;c[e>>2]=c[e>>2]|c[b+4>>2];break b}default:break b}h=c[b+4>>2]|0;if((h|0)>-1){c:do if(!m){b=0;while(1){i=d+(b<<2)|0;j=c[i>>2]|0;if((j|0)<=-1)break;if((j|0)==(h|0))break c;else b=b+1|0;}c[i>>2]=h;c[d+(b+1<<2)>>2]=-1;}while(0);if(p)c[f>>2]=(c[f>>2]|0)+1;}break}case 3:{b=c[b+4>>2]|0;h=c[b>>2]|0;if(c[h+8>>2]|0){k=h;n=6;break b}b=c[b+4>>2]|0;if(c[b+8>>2]|0){k=b;n=6;}break}case 1:{b=c[b+4>>2]|0;h=S5(a,c[b>>2]|0)|0;if(h|0){g=h;break a}k=c[b+4>>2]|0;n=6;break}case 2:{b=c[c[b+4>>2]>>2]|0;if(c[b+8>>2]|0){k=b;n=6;}break}default:{}}while(0);if((n|0)==6?(n=0,g=S5(a,k)|0,g|0):0)break a;if((R5(a)|0)<=(o|0)){g=0;break a}}else g=0;}else g=b;while(0);return g|0}function _5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;g=k;d=a+12|0;e=c[d>>2]|0;j=c[a>>2]|0;if((e|0)>=(j|0)){d=c[a+4>>2]|0;if((j|0)<(d|0)?(f=(c[a+8>>2]|0)+j|0,f=(f|0)>(d|0)?d:f,h=a+16|0,i=W1(c[h>>2]|0,f<<2)|0,(i|0)!=0):0){c[a>>2]=f;c[h>>2]=i;c[g>>2]=c[b>>2];_5(a,g)|0;d=0;}else d=12;}else {c[(c[a+16>>2]|0)+(e<<2)>>2]=c[b>>2];c[d>>2]=(c[d>>2]|0)+1;d=0;}l=k;return d|0}function $5(a,b,d){a=a|0;b=b|0;d=d|0;a=E5(a,0,0,1,32)|0;if((d|0)!=0&(a|0)!=0){c[a+4>>2]=d;c[a>>2]=b;c[a+8>>2]=-1;c[a+12>>2]=-1;}else a=0;return a|0}function a6(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=R5(d)|0;S5(d,e)|0;e=T5(d,0)|0;a:do if(!e){q=(f&1|0)==0;p=(f&2|0)!=0;o=0;l=1;e=i;while(1){if((R5(d)|0)>(r|0))n=e;else {f=o;e=0;break a}b:while(1){c:while(1){switch(U5(d)|0){case 1:{i=7;break c}case 0:{e=V5(d)|0;switch(c[e>>2]|0){case 0:{i=9;break b}case 3:{i=19;break b}case 1:{i=26;break b}case 2:{i=33;break c}default:{}}break}default:{}}if((R5(d)|0)<=(r|0)){f=o;e=0;break a}}if((i|0)==7)e=V5(d)|0;else if((i|0)==33){f=c[e+4>>2]|0;e=S5(d,c[f>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=b6(b,c[f>>2]|0,c[f+4>>2]|0,c[f+8>>2]|0,a[f+12>>0]&1)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}e=c[e+4>>2]|0;}if((R5(d)|0)>(r|0))n=e;else {f=o;e=0;break a}}if((i|0)==9){m=c[e+4>>2]|0;i=c[m+8>>2]|0;f=c[m>>2]|0;e=c[m+4>>2]|0;if(!((f|0)>-1|(f|0)==-4))if(q|(f|0)!=-3)if((f|0)==-3)if(p&(l|0)!=0){c[h+(e<<2)>>2]=1;f=-3;k=o;l=0;}else {f=-3;k=o;}else k=o;else {e=-1;f=-1;i=-1;k=o;}else {i=(c[g>>2]|0)+i|0;k=o+1|0;}e=L5(b,f,e,i)|0;c[n>>2]=e;if(!e)e=12;else {e=c[e+4>>2]|0;c[e+12>>2]=c[m+12>>2];c[e+16>>2]=c[m+16>>2];e=0;}if((i|0)>(c[j>>2]|0)){c[j>>2]=i;f=n;}else f=n;}else if((i|0)==19){i=c[e+4>>2]|0;f=i+4|0;e=c6(b,c[i>>2]|0,c[f>>2]|0)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}m=c[e+4>>2]|0;e=S5(d,c[f>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=S5(d,m+4|0)|0;if(e|0){f=o;break a}e=T5(d,1)|0;if(e|0){f=o;break a}e=S5(d,c[i>>2]|0)|0;if(e|0){f=o;break a}k=o;f=m;e=T5(d,0)|0;}else if((i|0)==26){m=c[e+4>>2]|0;i=m+4|0;e=M5(b,c[m>>2]|0,c[i>>2]|0)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}f=c[e+4>>2]|0;c[f>>2]=0;k=f+4|0;c[k>>2]=0;e=S5(d,c[i>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=S5(d,k)|0;if(e|0){f=o;break a}e=T5(d,1)|0;if(e|0){f=o;break a}e=S5(d,c[m>>2]|0)|0;if(e|0){f=o;break a}k=o;e=T5(d,0)|0;}if(!e){o=k;e=f;}else {f=k;break}}}else f=0;while(0);c[g>>2]=(c[g>>2]|0)+f;return e|0}function b6(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=E5(b,0,0,1,16)|0;b=$5(b,2,h)|0;if(!b)b=0;else {c[h>>2]=d;c[h+4>>2]=e;c[h+8>>2]=f;h=h+12|0;a[h>>0]=a[h>>0]&-2|g&1;c[b+16>>2]=c[d+16>>2];}return b|0}function c6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(b){e=E5(a,0,0,1,8)|0;a=$5(a,3,e)|0;if((d|0)!=0&(a|0)!=0){c[e>>2]=b;c[e+4>>2]=d;c[a+16>>2]=(c[d+16>>2]|0)+(c[b+16>>2]|0);d=a;}else d=0;}return d|0}function d6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=E5(a,0,0,0,8)|0;if(((e|0)!=0?(d=L5(a,-3,d,-1)|0,c[e>>2]=d,(d|0)!=0):0)?(f=E5(a,0,0,0,32)|0,c[e+4>>2]=f,(f|0)!=0):0){a=b+4|0;c[f+4>>2]=c[a>>2];c[f>>2]=c[b>>2];c[f+8>>2]=-1;c[f+12>>2]=-1;f=f+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[a>>2]=e;c[b>>2]=1;a=0;}else a=12;return a|0}function e6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=c[a>>2]|0;if((f|0)>-1){g=c[b+16>>2]|0;e=0;b=f;do{f=b>>>1;c[((b&1|0)==0?g+(f*12|0)|0:g+(f*12|0)+4|0)>>2]=d;e=e+1|0;b=c[a+(e<<2)>>2]|0;}while((b|0)>-1)}c[a>>2]=-1;return}function f6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=E5(a,0,0,0,8)|0;if(((e|0)!=0?(d=L5(a,-3,d,-1)|0,c[e+4>>2]=d,(d|0)!=0):0)?(f=E5(a,0,0,0,32)|0,c[e>>2]=f,(f|0)!=0):0){a=b+4|0;c[f+4>>2]=c[a>>2];c[f>>2]=c[b>>2];c[f+8>>2]=-1;c[f+12>>2]=-1;f=f+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[a>>2]=e;c[b>>2]=1;a=0;}else a=12;return a|0}function g6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;j=m;i=b+32|0;h=c[i>>2]|0;g=h&1;a:do switch(a[d>>0]|0){case 91:{e=k6(b,d+1|0)|0;break}case 92:{e=d+1|0;f=l6(e)|0;if(f|0){e=g6(b,f)|0;c[b+12>>2]=d+2;break a}f=a[e>>0]|0;switch(f|0){case 0:{e=5;break a}case 98:{f=L5(c[b>>2]|0,-2,64,-1)|0;break}case 66:{f=L5(c[b>>2]|0,-2,128,-1)|0;break}case 60:{f=L5(c[b>>2]|0,-2,16,-1)|0;break}case 62:{f=L5(c[b>>2]|0,-2,32,-1)|0;break}case 120:{h=d+2|0;i=(a[h>>0]|0)==123;g=i?8:2;h=i?d+3|0:h;e=0;f=0;do{d=m6(a[h+e>>0]|0)|0;if((d|0)<0)break;f=d+(f<<4)|0;e=e+1|0;}while((f|0)<1114112&(e|0)<(g|0));e=h+e|0;if(i){if((a[e>>0]|0)!=125){e=9;break a}e=e+1|0;}j=c[b>>2]|0;i=b+24|0;k=c[i>>2]|0;c[i>>2]=k+1;f=L5(j,f,f,k)|0;e=e+-1|0;break}case 63:case 43:case 123:if(!g){e=13;break a}else {k=37;break a}case 124:{if(g|0){k=37;break a}e=L5(c[b>>2]|0,-1,-1,-1)|0;k=45;break a}default:{if(!((g|0)==0&(f+-49|0)>>>0<9)){k=37;break a}j=f+-48|0;k=c[b>>2]|0;i=b+24|0;f=c[i>>2]|0;c[i>>2]=f+1;f=L5(k,-4,j,f)|0;k=b+28|0;i=c[k>>2]|0;c[k>>2]=(j|0)<(i|0)?i:j;}}d=e+1|0;e=f;k=45;break}case 46:{e=c[b>>2]|0;g=b+24|0;f=c[g>>2]|0;c[g>>2]=f+1;if(h&4){f=L5(e,0,9,f)|0;k=c[b>>2]|0;e=c[g>>2]|0;c[g>>2]=e+1;e=L5(k,11,1114111,e)|0;if((f|0)!=0&(e|0)!=0)e=c6(c[b>>2]|0,f,e)|0;else e=0;}else e=L5(e,0,1114111,f)|0;d=d+1|0;k=45;break}case 94:{if((g|0)==0?(c[b+16>>2]|0)!=(d|0):0){e=d;k=37;break a}d=d+1|0;e=L5(c[b>>2]|0,-2,1,-1)|0;k=45;break}case 36:{e=d+1|0;if((g|0)==0?a[e>>0]|0:0){e=d;k=37;break a}d=e;e=L5(c[b>>2]|0,-2,2,-1)|0;k=45;break}case 63:case 43:case 123:case 42:{if(!g){e=d;k=37;}else e=13;break}case 124:{if(!g){e=d;k=37;}else k=36;break}case 0:{k=36;break}default:{e=d;k=37;}}while(0);if((k|0)==36){e=L5(c[b>>2]|0,-1,-1,-1)|0;k=45;}else if((k|0)==37){h=R4(j,e,-1)|0;if((h|0)<0)e=2;else {do if(c[i>>2]&2){if((C3(c[j>>2]|0)|0)==0?(B3(c[j>>2]|0)|0)==0:0){k=43;break}i=c[b>>2]|0;n=f3(c[j>>2]|0)|0;g=f3(c[j>>2]|0)|0;f=b+24|0;g=L5(i,n,g,c[f>>2]|0)|0;n=c[b>>2]|0;i=E3(c[j>>2]|0)|0;d=E3(c[j>>2]|0)|0;d=L5(n,i,d,c[f>>2]|0)|0;if((g|0)!=0&(d|0)!=0)g=c6(c[b>>2]|0,g,d)|0;else g=0;}else k=43;while(0);if((k|0)==43){g=c[j>>2]|0;f=b+24|0;g=L5(c[b>>2]|0,g,g,c[f>>2]|0)|0;}c[f>>2]=(c[f>>2]|0)+1;d=e+h|0;e=g;k=45;}}if((k|0)==45)if(!e)e=12;else {c[b+8>>2]=e;c[b+12>>2]=d;e=0;}l=m;return e|0}function h6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j+4|0;g=j;b=j6(b,i)|0;if((a[b>>0]|0)==44){b=j6(b+1|0,g)|0;h=c[g>>2]|0;g=c[i>>2]|0;}else {i=c[i>>2]|0;c[g>>2]=i;h=i;g=i;}do if(!(g>>>0>255|((h|0)>255|(h|0)>-1&(h|0)<(g|0)))){if(!d)if((a[b>>0]|0)==92)b=b+1|0;else {b=0;break}if((a[b>>0]|0)==125){c[e>>2]=g;c[f>>2]=h;b=b+1|0;}else b=0;}else b=0;while(0);l=j;return b|0}function i6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((c[b+12>>2]|0)>-1){e=L5(c[a>>2]|0,-1,-1,-1)|0;if((e|0)!=0?(f=M5(c[a>>2]|0,e,b)|0,(f|0)!=0):0){e=c[b+16>>2]|0;c[f+16>>2]=e;g=6;}else e=12;}else {f=b;e=c[b+16>>2]|0;g=6;}if((g|0)==6){c[f+12>>2]=d;c[f+16>>2]=e+1;c[a+8>>2]=f;e=0;}return e|0}function j6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;c[d>>2]=-1;if(((a[b>>0]|0)+-48|0)>>>0<10){c[d>>2]=0;e=b;g=0;f=a[b>>0]|0;while(1){g=(g*10|0)+-48+(f<<24>>24)|0;c[d>>2]=g;b=e+1|0;f=a[b>>0]|0;if((g|0)>255|((f<<24>>24)+-48|0)>>>0>9)break;else e=b;}}return b|0}function k6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+288|0;e=s+264|0;g=s;c[e>>2]=c[b>>2];h=e+8|0;c[h>>2]=0;c[e+12>>2]=32;p=T1(128)|0;r=e+4|0;c[r>>2]=p;if(!p)d=12;else {f=g+4|0;c[f>>2]=0;p=(a[d>>0]|0)==94;c[g>>2]=p&1;d=n6(b,p?d+1|0:d,e,g)|0;a:do if(!d){p=(c[g>>2]|0)==0;if(!p){o4(c[r>>2]|0,c[h>>2]|0,4,111);d=p6(e)|0;if(!d){d=12;e=0;break}c[d>>2]=1114112;c[d+4>>2]=1114112;c[d+8>>2]=-1;d=c[f>>2]|0;if(d){e=d<<2;f=E5(c[b>>2]|0,0,0,0,e+4|0)|0;if(!f){d=12;e=0;break}W6(f|0,g+8|0,e|0)|0;c[f+(d<<2)>>2]=0;}else f=0;}else f=0;m=c[h>>2]|0;if((m|0)>0){n=c[r>>2]|0;o=b+24|0;e=0;d=0;k=0;while(1){j=c[n+(k<<2)>>2]|0;g=c[j>>2]|0;h=j+4|0;i=c[h>>2]|0;do if(!p)if((g|0)>(d|0)){c[j>>2]=d;c[h>>2]=g+-1;d=i+1|0;q=14;break}else {j=i+1|0;d=(j|0)>=(d|0)?j:d;break}else q=14;while(0);if((q|0)==14){q=0;c[j+8>>2]=c[o>>2];c[j+16>>2]=f;j=$5(c[b>>2]|0,0,j)|0;e=c6(c[b>>2]|0,e,j)|0;if(!e){d=12;e=0;break a}}k=k+1|0;if((k|0)>=(m|0)){d=0;break}}}else {d=0;e=0;}}else e=0;while(0);U1(c[r>>2]|0);r=b+24|0;c[r>>2]=(c[r>>2]|0)+1;c[b+8>>2]=e;}l=s;return d|0}function l6(b){b=b|0;var d=0;d=a[b>>0]|0;b=0;while(1){if((a[63752+(b<<3)>>0]|0)==d<<24>>24)break;b=b+1|0;if((b|0)==12){b=12;break}}return c[63752+(b<<3)+4>>2]|0}function m6(a){a=a|0;var b=0;b=a+-48|0;if(b>>>0<10)return b|0;else {b=a|32;return ((b+-97|0)>>>0<6?b+-87|0:-1)|0}return 0}function n6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+32|0;o=t;q=t+4|0;i=R4(o,d,-1)|0;g=a[d>>0]|0;a:do if((i|0)>=1){r=f+4|0;n=b+32|0;h=d;j=i;b:while(1){i=(h|0)==(d|0);if(!(i|g<<24>>24!=93)){s=5;break}c:do if(!(i|g<<24>>24!=45)){switch(a[h+1>>0]|0){case 93:break c;case 45:break;default:{g=11;break a}}if((a[h+2>>0]|0)==93){g=11;break a}}while(0);d:do if(g<<24>>24==91){switch(a[h+1>>0]|0){case 61:case 46:{g=3;break a}case 58:break;default:{s=17;break d}}i=h+2|0;g=0;e:while(1){switch(a[i+g>>0]|0){case 0:{s=16;break b}case 58:break e;default:{}}if((g|0)<13)g=g+1|0;else {s=16;break b}}W6(q|0,i|0,g|0)|0;a[q+g>>0]=0;j=X3(q)|0;if(!j){s=16;break b}h=i+(g+2)|0;if((a[i+(g+1)>>0]|0)!=93){s=16;break b}if(!(c[f>>2]|0)){g=1114111;m=0;k=1;s=25;}else {g=c[r>>2]|0;if((g|0)>63){g=12;break a}c[r>>2]=g+1;c[f+8+(g<<2)>>2]=j;}}else s=17;while(0);if((s|0)==17){s=0;i=c[o>>2]|0;h=h+j|0;if((a[h>>0]|0)==45?(p=h+1|0,(a[p>>0]|0)!=93):0){h=R4(o,p,-1)|0;g=c[o>>2]|0;if((h|0)<1|(i|0)>(g|0)){g=11;break a}j=0;m=i;h=p+h|0;k=0;s=25;}else {j=0;g=i;m=i;k=0;s=25;}}if((s|0)==25){s=0;i=p6(e)|0;if(!i){g=12;break a}c[i>>2]=m;c[i+4>>2]=g;c[i+12>>2]=j;c[i+8>>2]=-1;if(!(k|(c[n>>2]&2|0)==0)?(q6(e,m,g)|0)!=0:0){g=12;break a}}j=R4(o,h,-1)|0;g=a[h>>0]|0;if((j|0)<1){s=3;break a}}if((s|0)==5){c[b+12>>2]=h+1;g=0;break}else if((s|0)==16){g=4;break}}else s=3;while(0);if((s|0)==3)g=g<<24>>24?2:7;l=t;return g|0}function o6(a,b){a=a|0;b=b|0;return (c[c[a>>2]>>2]|0)-(c[c[b>>2]>>2]|0)|0}function p6(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;h=a+8|0;d=c[h>>2]|0;e=a+12|0;f=c[e>>2]|0;if((d|0)>=(f|0))if((f|0)<=32767?(c[e>>2]=f<<1,g=a+4|0,b=W1(c[g>>2]|0,f<<3)|0,(b|0)!=0):0){c[g>>2]=b;d=c[h>>2]|0;i=6;}else b=0;else {b=c[a+4>>2]|0;i=6;}if((i|0)==6){c[h>>2]=d+1;i=E5(c[a>>2]|0,0,0,1,20)|0;c[b+(d<<2)>>2]=i;b=i;}return b|0}function q6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;a:do if((b|0)>(d|0))b=0;else while(1){b:do if(!(B3(b)|0)){if(!(C3(b)|0)){b=b+1|0;break}f=E3(b)|0;e=f;while(1){g=b+1|0;e=e+1|0;if((b|0)>=(d|0)){h=f;b=g;g=12;break b}if((E3(g)|0)==(e|0))b=g;else {h=f;b=g;g=12;break}}}else {f=f3(b)|0;e=f;while(1){g=b+1|0;e=e+1|0;if((b|0)>=(d|0)){h=f;b=g;g=12;break b}if((f3(g)|0)==(e|0))b=g;else {h=f;b=g;g=12;break}}}while(0);if((g|0)==12){g=0;f=p6(a)|0;if(!f){b=-1;break a}c[f>>2]=h;c[f+4>>2]=e+-1;c[f+8>>2]=-1;}if((b|0)>(d|0)){b=0;break}}while(0);return b|0}function r6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;i=c[a+4>>2]|0;j=i+56|0;h=(c[j>>2]&8|0)==0?d:0;a=c[i+40>>2]|0;if((a|0)>0&(h|0)!=0){a=T1(a<<2)|0;if(!a)a=12;else {g=a;d=a;m=3;}}else {g=0;d=0;m=3;}if((m|0)==3){if(!(c[i+60>>2]|0))a=t6(i,b,g,f,k)|0;else a=s6(i,b,g,f,k)|0;if(!a)u6(h,e,c[j>>2]|0,i,g,c[k>>2]|0);if(g)U1(d);}l=n;return a|0}function s6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0;V=l;l=l+16|0;T=V;c[T>>2]=0;o=e&1;R=e&2;S=a+56|0;n=c[S>>2]&4;U=C5(0,0)|0;a:do if(U){p=E5(U,0,0,0,32)|0;if(!p){D5(U);e=12;break}c[p+24>>2]=0;c[p+28>>2]=0;Q=a+40|0;q=c[Q>>2]|0;if(q){e=T1(q<<2)|0;if(!e){m=0;k=0;j=e;e=12;i=0;h=0;g=0;}else {j=e;i=e;C=6;}}else {j=0;i=0;C=6;}b:do if((C|0)==6){e=c[a+28>>2]|0;if(e){e=T1(e<<3)|0;if(!e){m=e;k=0;e=12;h=0;g=0;break}else {m=e;h=e;}}else {m=0;h=0;}P=a+52|0;e=c[P>>2]|0;if(e){e=T1(e<<2)|0;if(!e){k=e;e=12;g=0;break}else {k=e;g=e;}}else {k=0;g=0;}K=a+8|0;L=a+12|0;M=(d|0)==0;N=(d|0)!=0;O=a+32|0;J=(n|0)!=0;I=(o|0)==0;s=b;e=1;r=-1;v=-1;n=q;B=0;c:while(1){if((n|0)>0){o=0;do{c[j+(o<<2)>>2]=-1;if(!M){c[d+(o<<2)>>2]=-1;n=c[Q>>2]|0;}o=o+1|0;}while((o|0)<(n|0))}n=c[P>>2]|0;if((n|0)>0)Y6(g|0,0,n<<2|0)|0;G=e+r|0;e=R4(T,s,4)|0;if((e|0)<1)if((e|0)<0){e=1;break b}else e=1;F=s+e|0;H=c[T>>2]|0;n=c[K>>2]|0;o=n+8|0;if(c[o>>2]|0){w=(G|0)!=0;x=(B|0)==95;y=(G|0)==0;A=J&(B|0)==10;z=(G|0)<1&I;u=n;n=0;t=0;s=o;while(1){r=u+20|0;o=c[r>>2]|0;d:do if(o)if((o&1|0)==0|z|A){if(o&2|0?(E=c[T>>2]|0,!((E|R|0)==0|J&(E|0)==10)):0){q=t;break}do if(o&16|0){if(x){q=t;break d}if(x3(B)|0){q=t;break d}o=c[T>>2]|0;if((o|0)==95)break;if(!(x3(o)|0)){q=t;break d}}while(0);o=c[r>>2]|0;if(o&32){if(x){o=c[T>>2]|0;if((o|0)==95){q=t;break}}else {E=(x3(B)|0)==0;o=c[T>>2]|0;if(E|(o|0)==95){q=t;break}}if(x3(o)|0){q=t;break}o=c[r>>2]|0;}q=c[T>>2]|0;do if((q|0)!=0&(w&(o&64|0)!=0)){if(x)o=1;else {o=(x3(B)|0)!=0;q=c[T>>2]|0;}if((q|0)==95)if(o){q=t;break d}else break;else if(o^(x3(q)|0)!=0)break;else {q=t;break d}}while(0);if(!(c[r>>2]&128)){C=49;break}o=c[T>>2]|0;if(y|(o|0)==0){q=t;break}if(x)q=1;else {q=(x3(B)|0)!=0;o=c[T>>2]|0;}if((o|0)==95)if(q){C=49;break}else {q=t;break}else if(q^(x3(o)|0)!=0){q=t;break}else {C=49;break}}else q=t;else C=49;while(0);do if((C|0)==49){C=0;if(!t){n=c[u+16>>2]|0;q=c[s>>2]|0;break}q=p+28|0;o=c[q>>2]|0;if(!o){o=E5(U,0,0,0,32)|0;if(!o){C=53;break c}c[o+24>>2]=p;c[o+28>>2]=0;E=E5(U,0,0,0,c[Q>>2]<<2)|0;c[o+20>>2]=E;if(!E){C=60;break c}c[q>>2]=o;p=o;}else p=o;c[p>>2]=G;c[p+4>>2]=F;c[p+8>>2]=c[s>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[T>>2];if((c[Q>>2]|0)>0){q=c[p+20>>2]|0;o=0;do{c[q+(o<<2)>>2]=c[j+(o<<2)>>2];o=o+1|0;}while((o|0)<(c[Q>>2]|0))}o=c[u+16>>2]|0;if(!o)q=t;else {q=c[o>>2]|0;if((q|0)<=-1){q=t;break}r=c[p+20>>2]|0;do{o=o+4|0;c[r+(q<<2)>>2]=G;q=c[o>>2]|0;}while((q|0)>-1);q=t;}}while(0);s=u+40|0;if(!(c[s>>2]|0))break;else {u=u+32|0;t=q;}}if(n){o=c[n>>2]|0;if((o|0)>-1)do{c[j+(o<<2)>>2]=G;n=n+4|0;o=c[n>>2]|0;}while((o|0)>-1)}else n=0;if(!q)C=171;else {s=G;r=F;w=q;x=n;C=79;}}else {n=0;C=171;}e:while(1){if((C|0)==79){if((w|0)==(c[L>>2]|0)){if((v|0)>=(s|0)){if(!(N&(v|0)==(s|0))){n=x;C=171;continue}n=c[Q>>2]|0;if(!(w6(n,c[O>>2]|0,j,d)|0)){n=x;C=171;continue}}else {if(M){v=s;n=x;C=171;continue}n=c[Q>>2]|0;}if((n|0)>0)n=0;else {v=s;n=x;C=171;continue}while(1){c[d+(n<<2)>>2]=c[j+(n<<2)>>2];n=n+1|0;if((n|0)>=(c[Q>>2]|0)){v=s;n=x;C=171;continue e}}}u=w+8|0;if((c[u>>2]|0)!=0?(c[w+20>>2]&256|0)!=0:0){o=c[w+24>>2]|0;u6(o+1|0,m,c[S>>2]&-9,a,j,s);E=c[m+(o<<3)>>2]|0;o=(c[m+(o<<3)+4>>2]|0)-E|0;if(Q2(b+E|0,r+-1|0,o)|0){n=x;C=171;continue}E=(o|0)==0;n=E&1;q=c[w+12>>2]|0;if(E?c[k+(q<<2)>>2]|0:0){n=x;C=171;continue}c[k+(q<<2)>>2]=n;o=o+-1|0;r=r+o|0;o=o+s|0;q=c[T>>2]|0;n=R4(T,r,4)|0;if((n|0)<1)if((n|0)<0){e=1;break b}else n=1;D=r+n|0;E=n;}else {q=c[T>>2]|0;if(!q){n=x;C=171;continue}n=R4(T,r,4)|0;if((n|0)<1)if((n|0)<0){e=1;break b}else n=1;o=s;D=r+n|0;E=n;}s=o+e|0;if(!(c[u>>2]|0)){e=E;n=x;C=171;continue}y=(s|0)!=0;z=(q|0)==95;A=(s|0)==0;C=J&(q|0)==10;B=(s|0)<1&I;t=0;n=x;while(1){f:do if((c[w>>2]|0)>>>0<=q>>>0){if((c[w+4>>2]|0)>>>0>>0)break;r=w+20|0;e=c[r>>2]|0;do if(e|0){if(!((e&1|0)==0|B|C))break f;if(e&2|0?(x=c[T>>2]|0,!((x|R|0)==0|J&(x|0)==10)):0)break f;do if(e&16|0){if(z)break f;if(x3(q)|0)break f;e=c[T>>2]|0;if((e|0)==95)break;if(!(x3(e)|0))break f}while(0);e=c[r>>2]|0;if(e&32){if(z){e=c[T>>2]|0;if((e|0)==95)break f}else {x=(x3(q)|0)==0;e=c[T>>2]|0;if(x|(e|0)==95)break f}if(x3(e)|0)break f;e=c[r>>2]|0;}o=c[T>>2]|0;do if((o|0)!=0&(y&(e&64|0)!=0)){if(z)e=1;else {e=(x3(q)|0)!=0;o=c[T>>2]|0;}if((o|0)==95)if(e)break f;else break;else if(e^(x3(o)|0)!=0)break;else break f}while(0);do if(c[r>>2]&128|0){e=c[T>>2]|0;if(A|(e|0)==0)break f;if(z)o=1;else {o=(x3(q)|0)!=0;e=c[T>>2]|0;}if((e|0)==95)if(o)break;else break f;else if(o^(x3(e)|0)!=0)break f;else break}while(0);e=c[r>>2]|0;do if(e&4){if(c[S>>2]&2|0)break;if(!(w3(q,c[w+24>>2]|0)|0))break f;e=c[r>>2]|0;}while(0);do if(e&4|0){if(!(c[S>>2]&2))break;x=E3(q)|0;e=w+24|0;if(w3(x,c[e>>2]|0)|0)break;x=f3(q)|0;if(!(w3(x,c[e>>2]|0)|0))break f}while(0);if(!(c[r>>2]&8))break;if(v6(c[w+28>>2]|0,q,c[S>>2]&2)|0)break f}while(0);if(!t){t=c[u>>2]|0;n=c[w+16>>2]|0;break}o=p+28|0;e=c[o>>2]|0;if(!e){e=E5(U,0,0,0,32)|0;if(!e){C=145;break c}c[e+24>>2]=p;c[e+28>>2]=0;x=E5(U,0,0,0,c[Q>>2]<<2)|0;c[e+20>>2]=x;if(!x){C=152;break c}c[o>>2]=e;p=e;}else p=e;c[p>>2]=s;c[p+4>>2]=D;c[p+8>>2]=c[u>>2];c[p+12>>2]=c[w+12>>2];c[p+16>>2]=c[T>>2];if((c[Q>>2]|0)>0){o=c[p+20>>2]|0;e=0;do{c[o+(e<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;}while((e|0)<(c[Q>>2]|0))}e=c[w+16>>2]|0;if(!e)break;o=c[e>>2]|0;if((o|0)<=-1)break;r=c[p+20>>2]|0;do{c[r+(o<<2)>>2]=s;e=e+4|0;o=c[e>>2]|0;}while((o|0)>-1)}while(0);u=w+40|0;if(!(c[u>>2]|0))break;else w=w+32|0;}if(!t){e=E;C=171;continue}if(n){e=c[n>>2]|0;if((e|0)>-1){do{n=n+4|0;c[j+(e<<2)>>2]=s;e=c[n>>2]|0;}while((e|0)>-1);q=v;o=D;e=E;}else {q=v;o=D;e=E;}}else {q=v;o=D;e=E;n=0;}}else if((C|0)==171){C=0;r=c[p+24>>2]|0;if(!r)break;t=c[p+8>>2]|0;if(c[t+20>>2]&256|0)c[k+(c[p+12>>2]<<2)>>2]=0;s=c[p>>2]|0;u=c[p+4>>2]|0;c[T>>2]=c[p+16>>2];q=c[Q>>2]|0;if((q|0)>0){p=c[p+20>>2]|0;o=0;do{c[j+(o<<2)>>2]=c[p+(o<<2)>>2];o=o+1|0;}while((o|0)<(q|0));p=r;q=v;o=u;}else {p=r;q=v;o=u;}}r=o;v=q;w=t;x=n;C=79;}n=(v|0)>-1;if(n|(c[T>>2]|0)==0){C=180;break}c[T>>2]=H;s=F;r=G;n=c[Q>>2]|0;B=H;}if((C|0)==53){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==60){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==145){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==152){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==180){c[f>>2]=v;e=(n^1)&1;break}}while(0);D5(U);if(j|0)U1(i);if(m|0)U1(h);if(k)U1(g);}else e=12;while(0);l=V;return e|0}function t6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;W=l;l=l+16|0;T=W;c[T>>2]=0;k=e&1;Q=e&2;R=a+56|0;j=c[R>>2]&4;if(!d)N=0;else N=c[a+40>>2]|0;P=N<<2;i=c[a+52>>2]|0;h=i<<3;g=h+8|0;e=P+12+h+(g+(O(P,i)|0)<<1)|0;U=T1(e)|0;if(!U)e=12;else {Y6(U|0,0,e|0)|0;e=U+P|0;m=e&3;m=e+((m|0)==0?0:4-m|0)|0;e=m+g|0;n=e&3;n=e+((n|0)==0?0:4-n|0)|0;e=n+g|0;M=e&3;M=e+((M|0)==0?0:4-M|0)|0;e=M+h|0;g=e&3;h=(i|0)>0;if(h){e=e+((g|0)==0?0:4-g|0)|0;g=0;while(1){c[n+(g<<3)+4>>2]=e;e=e+P|0;c[m+(g<<3)+4>>2]=e;g=g+1|0;if((g|0)>=(i|0))break;else e=e+P|0;}if(h){e=0;do{c[M+(e<<3)>>2]=-1;e=e+1|0;}while((e|0)<(i|0))}}e=R4(T,b,4)|0;if((e|0)<1)if((e|0)<0)e=1;else {i=1;V=11;}else {i=e;V=11;}a:do if((V|0)==11){L=a+8|0;K=(j|0)!=0;E=(k|0)==0;F=(N|0)>0;G=a+12|0;H=(N|0)<1;I=a+44|0;J=a+32|0;C=a+36|0;D=(N|0)==0;h=0;v=b+i|0;u=0;j=0;e=-1;g=m;A=U;x=m;w=n;while(1){if((e|0)<0){a=c[L>>2]|0;k=a+8|0;b:do if(c[k>>2]|0){p=(u|0)!=0;q=(h|0)==95;r=(u|0)==0;t=K&(h|0)==10;s=(u|0)<1&E;while(1){c:while(1){o=a+12|0;if((c[M+(c[o>>2]<<3)>>2]|0)>=(u|0))break;n=a+20|0;b=c[n>>2]|0;if(!b){V=46;break}d:do if((b&1|0)==0|s|t){if(b&2|0?(B=c[T>>2]|0,!((B|Q|0)==0|K&(B|0)==10)):0)break;do if(b&16|0){if(q)break d;if(x3(h)|0)break d;b=c[T>>2]|0;if((b|0)==95)break;if(!(x3(b)|0))break d}while(0);b=c[n>>2]|0;if(b&32){if(q){b=c[T>>2]|0;if((b|0)==95)break}else {B=(x3(h)|0)==0;b=c[T>>2]|0;if(B|(b|0)==95)break}if(x3(b)|0)break;b=c[n>>2]|0;}m=c[T>>2]|0;do if((m|0)!=0&(p&(b&64|0)!=0)){if(q)b=1;else {b=(x3(h)|0)!=0;m=c[T>>2]|0;}if((m|0)==95)if(b)break d;else break;else if(b^(x3(m)|0)!=0)break;else break d}while(0);if(!(c[n>>2]&128)){V=46;break c}b=c[T>>2]|0;if(r|(b|0)==0)break;if(q)m=1;else {m=(x3(h)|0)!=0;b=c[T>>2]|0;}if((b|0)==95)if(m){V=46;break c}else break;else if(m^(x3(b)|0)!=0)break;else {V=46;break c}}while(0);k=a+40|0;if(!(c[k>>2]|0))break b;else a=a+32|0;}if((V|0)==46){V=0;c[g>>2]=c[k>>2];if(F)Y6(c[g+4>>2]|0,-1,P|0)|0;k=c[a+16>>2]|0;if(k|0?(S=c[k>>2]|0,(S|0)>-1):0){m=g+4|0;b=S;do{if((b|0)<(N|0))c[(c[m>>2]|0)+(b<<2)>>2]=u;k=k+4|0;b=c[k>>2]|0;}while((b|0)>-1)}k=(c[g>>2]|0)!=(c[G>>2]|0);if(k|H){j=k?j:1;e=k?e:u;k=g+4|0;}else {k=g+4|0;j=c[k>>2]|0;e=0;do{c[d+(e<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;}while((e|0)!=(N|0));j=1;e=u;}B=c[o>>2]|0;c[M+(B<<3)>>2]=u;c[M+(B<<3)+4>>2]=k;g=g+8|0;}k=a+40|0;if(!(c[k>>2]|0))break;else a=a+32|0;}}while(0);c[g>>2]=0;g=c[T>>2]|0;if(!g)break;else h=g;}else {if(D)break;h=c[T>>2]|0;if(!((g|0)!=(x|0)&(h|0)!=0))break}B=u+i|0;g=R4(T,v,4)|0;if((g|0)<1)if((g|0)<0){e=1;break a}else i=1;else i=g;z=v+i|0;if((j|0)!=0&(c[I>>2]|0)!=0){if(!(c[x>>2]|0))g=w;else {o=c[C>>2]|0;p=c[o>>2]|0;q=(p|0)>-1;n=x;g=w;do{m=n+4|0;e:do if(q){k=0;b=p;do{a=c[o+((k|1)<<2)>>2]|0;if((b|0)>=(N|0))break e;j=c[m>>2]|0;if((c[j+(a<<2)>>2]|0)==(c[d+(a<<2)>>2]|0)?(c[j+(b<<2)>>2]|0)<(c[d+(b<<2)>>2]|0):0)break e;k=k+2|0;b=c[o+(k<<2)>>2]|0;}while((b|0)>-1);k=m;V=75;}else {k=m;j=c[m>>2]|0;V=75;}while(0);if((V|0)==75){V=0;c[g>>2]=c[n>>2];v=g+4|0;y=c[v>>2]|0;c[v>>2]=j;c[k>>2]=y;g=g+8|0;}n=n+8|0;}while((c[n>>2]|0)!=0)}c[g>>2]=0;y=x;j=0;}else {y=w;w=x;}k=c[w>>2]|0;if(!k){k=A;g=y;}else {r=(B|0)!=0;s=(h|0)==95;t=(B|0)==0;v=K&(h|0)==10;u=(B|0)<1&E;q=w;a=A;g=y;while(1){b=k+8|0;if(c[b>>2]|0){p=q+4|0;o=a;n=b;while(1){f:do if((c[k>>2]|0)>>>0<=h>>>0?(c[k+4>>2]|0)>>>0>=h>>>0:0){m=k+20|0;a=c[m>>2]|0;do if(a|0){if(!((a&1|0)==0|u|v)){a=o;break f}if(a&2|0?(A=c[T>>2]|0,!((A|Q|0)==0|K&(A|0)==10)):0){a=o;break f}do if(a&16|0){if(s){a=o;break f}if(x3(h)|0){a=o;break f}a=c[T>>2]|0;if((a|0)==95)break;if(!(x3(a)|0)){a=o;break f}}while(0);a=c[m>>2]|0;if(a&32){if(s){a=c[T>>2]|0;if((a|0)==95){a=o;break f}}else {A=(x3(h)|0)==0;a=c[T>>2]|0;if(A|(a|0)==95){a=o;break f}}if(x3(a)|0){a=o;break f}a=c[m>>2]|0;}b=c[T>>2]|0;do if((b|0)!=0&(r&(a&64|0)!=0)){if(s)a=1;else {a=(x3(h)|0)!=0;b=c[T>>2]|0;}if((b|0)==95)if(a){a=o;break f}else break;else if(a^(x3(b)|0)!=0)break;else {a=o;break f}}while(0);do if(c[m>>2]&128|0){a=c[T>>2]|0;if(t|(a|0)==0){a=o;break f}if(s)b=1;else {b=(x3(h)|0)!=0;a=c[T>>2]|0;}if((a|0)==95)if(b)break;else {a=o;break f}else if(b^(x3(a)|0)!=0){a=o;break f}else break}while(0);a=c[m>>2]|0;do if(a&4){if(c[R>>2]&2|0)break;if(!(w3(h,c[k+24>>2]|0)|0)){a=o;break f}a=c[m>>2]|0;}while(0);do if(a&4|0){if(!(c[R>>2]&2))break;A=E3(h)|0;a=k+24|0;if(w3(A,c[a>>2]|0)|0)break;A=f3(h)|0;if(!(w3(A,c[a>>2]|0)|0)){a=o;break f}}while(0);if(!(c[m>>2]&8))break;if(v6(c[k+28>>2]|0,h,c[R>>2]&2)|0){a=o;break f}}while(0);if(F){b=c[p>>2]|0;a=0;do{c[o+(a<<2)>>2]=c[b+(a<<2)>>2];a=a+1|0;}while((a|0)!=(N|0))}a=c[k+16>>2]|0;do if(a|0){b=c[a>>2]|0;if((b|0)<=-1)break;do{if((b|0)<(N|0))c[o+(b<<2)>>2]=B;a=a+4|0;b=c[a>>2]|0;}while((b|0)>-1)}while(0);a=c[k+12>>2]|0;b=M+(a<<3)|0;if((c[b>>2]|0)>=(B|0)){a=c[M+(a<<3)+4>>2]|0;b=c[a>>2]|0;if(!(w6(N,c[J>>2]|0,o,b)|0)){a=o;break}c[a>>2]=o;if((c[n>>2]|0)!=(c[G>>2]|0)){a=b;break}if(F)e=0;else {j=1;a=b;e=B;break}while(1){c[d+(e<<2)>>2]=c[o+(e<<2)>>2];e=e+1|0;if((e|0)==(N|0)){j=1;a=b;e=B;break f}}}A=c[n>>2]|0;c[g>>2]=A;x=g+4|0;m=c[x>>2]|0;c[x>>2]=o;c[b>>2]=B;c[M+(a<<3)+4>>2]=x;do if((c[G>>2]|0)==(A|0)){if((e|0)==-1)if(F)e=0;else {e=B;j=1;break}else {if(!F)break;if((c[o>>2]|0)>(c[d>>2]|0))break;else e=0;}do{c[d+(e<<2)>>2]=c[o+(e<<2)>>2];e=e+1|0;}while((e|0)<(N|0));e=B;j=1;}while(0);a=m;g=g+8|0;}else a=o;while(0);n=k+40|0;if(!(c[n>>2]|0))break;else {k=k+32|0;o=a;}}}q=q+8|0;k=c[q>>2]|0;if(!k){k=a;break}}}c[g>>2]=0;v=z;u=B;A=k;x=y;}c[f>>2]=e;e=e>>>31;}while(0);U1(U);}l=W;return e|0}function u6(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if((d&8|0)==0&(g|0)>-1?(m=c[e+16>>2]|0,n=c[e+28>>2]|0,l=(a|0)!=0&(n|0)!=0,l):0){k=c[e+48>>2]|0;j=0;do{d=c[m+(j*12|0)>>2]|0;if((d|0)==(k|0))i=g;else i=c[f+(d<<2)>>2]|0;h=b+(j<<3)|0;c[h>>2]=i;d=c[m+(j*12|0)+4>>2]|0;if((d|0)==(k|0))d=g;else d=c[f+(d<<2)>>2]|0;e=b+(j<<3)+4|0;c[e>>2]=d;if((d|0)==-1|(i|0)==-1){c[e>>2]=-1;c[h>>2]=-1;}j=j+1|0;}while(j>>>0>>0&j>>>0>>0);if(l){d=0;do{i=b+(d<<3)+4|0;j=c[m+(d*12|0)+8>>2]|0;if(j|0?(o=c[j>>2]|0,(o|0)>-1):0){k=b+(d<<3)|0;h=0;f=o;e=c[k>>2]|0;do{if(!((e|0)>=(c[b+(f<<3)>>2]|0)?(c[i>>2]|0)<=(c[b+(f<<3)+4>>2]|0):0)){c[i>>2]=-1;c[k>>2]=-1;e=-1;}h=h+1|0;f=c[j+(h<<2)>>2]|0;}while((f|0)>-1)}d=d+1|0;}while(d>>>0>>0&d>>>0>>0)}else d=0;}else d=0;if(d>>>0>>0)Y6(b+(d<<3)|0,-1,a-d<<3|0)|0;return}function v6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=c[a>>2]|0;a:do if(!e)d=0;else {f=(d|0)==0;d=e;while(1){if(f){if(w3(b,d)|0){d=1;break a}}else {e=f3(b)|0;if(w3(e,c[a>>2]|0)|0){d=1;break a}e=E3(b)|0;if(w3(e,c[a>>2]|0)|0){d=1;break a}}a=a+4|0;d=c[a>>2]|0;if(!d){d=0;break}}}while(0);return d|0}function w6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if((a|0)>0){f=0;while(1){h=c[d+(f<<2)>>2]|0;g=c[e+(f<<2)>>2]|0;if(!(c[b+(f<<2)>>2]|0)){if((h|0)<(g|0)){f=1;break a}if((h|0)>(g|0)){f=0;break a}}else {if((h|0)>(g|0)){f=1;break a}if((h|0)<(g|0)){f=0;break a}}f=f+1|0;if((f|0)>=(a|0)){f=0;break}}}else f=0;while(0);return f|0}function x6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=O(e,d)|0;e=(d|0)==0?0:e;if((c[f+76>>2]|0)>-1)j=J3(f)|0;else j=0;g=f+74|0;h=a[g>>0]|0;a[g>>0]=h+255|h;g=f+4|0;h=c[g>>2]|0;m=(c[f+8>>2]|0)-h|0;i=m>>>0>>0?m:k;if((m|0)>0){W6(b|0,h|0,i|0)|0;c[g>>2]=h+i;g=k-i|0;b=b+i|0;}else g=k;a:do if(!g)l=13;else {i=f+32|0;while(1){if(_2(f)|0)break;h=nb[c[i>>2]&63](f,b,g)|0;if((h+1|0)>>>0<2)break;g=g-h|0;if(!g){l=13;break a}else b=b+h|0;}if(j|0)K3(f);e=((k-g|0)>>>0)/(d>>>0)|0;}while(0);if((l|0)==13)if(j)K3(f);return e|0}function y6(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(J3(a)|0)==0;a=z6(a)|0;}else a=z6(a)|0;return a|0}function z6(a){a=a|0;var b=0;if(!(c[a>>2]&128))b=1;else b=(c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0?2:1;b=nb[c[a+40>>2]&63](a,0,b)|0;if((b|0)>=0)b=b-(c[a+8>>2]|0)+(c[a+4>>2]|0)+(c[a+20>>2]|0)-(c[a+28>>2]|0)|0;return b|0}function A6(a){a=a|0;(c[a+76>>2]|0)>-1?J3(a)|0:0;return c[a+60>>2]|0}function B6(b){b=b|0;var d=0,e=0,f=0,g=0;f=c[15679]|0;if((c[f+76>>2]|0)>-1)g=J3(f)|0;else g=0;do if((T4(b,f)|0)<0)b=-1;else {if((a[f+75>>0]|0)!=10?(d=f+20|0,e=c[d>>2]|0,e>>>0<(c[f+16>>2]|0)>>>0):0){c[d>>2]=e+1;a[e>>0]=10;b=0;break}b=(V4(f,10)|0)>>31;}while(0);if(g|0)K3(f);return b|0}function C6(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+48|0;i=k+24|0;h=k+16|0;g=k;d=k+28|0;b=d;e=153686;f=b+20|0;do{a[b>>0]=a[e>>0]|0;b=b+1|0;e=e+1|0;}while((b|0)<(f|0));e=d+13|0;b=0;while(1){x4(e)|0;c[g>>2]=d;c[g+4>>2]=32962;c[g+8>>2]=384;f=c2(Ha(5,g|0)|0)|0;if((f|0)>-1){j=4;break}if((b|0)<99)b=b+1|0;else {b=0;break}}if((j|0)==4){c[h>>2]=d;wa(10,h|0)|0;b=P4(f,153706)|0;if(!b){c[i>>2]=f;Ja(6,i|0)|0;b=0;}}l=k;return b|0}function D6(a){a=a|0;var b=0,e=0,f=0;if((c[a+76>>2]|0)>=0?(J3(a)|0)!=0:0){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0;}else b=Z2(a)|0;}else f=3;do if((f|0)==3){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0;break}else {b=Z2(a)|0;break}}while(0);return b|0}function E6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;if((c[d+76>>2]|0)>=0?(J3(d)|0)!=0:0){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(i=d+20|0,j=c[i>>2]|0,j>>>0<(c[d+16>>2]|0)>>>0):0){c[i>>2]=j+1;a[j>>0]=f;}else e=V4(d,b)|0;K3(d);}else k=3;do if((k|0)==3){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(g=d+20|0,h=c[g>>2]|0,h>>>0<(c[d+16>>2]|0)>>>0):0){c[g>>2]=h+1;a[h>>0]=f;break}e=V4(d,b)|0;}while(0);return e|0}function F6(a){a=a|0;return y6(a)|0}function G6(){}function H6(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=O(e,f)|0;d=a>>>16;a=(c>>>16)+(O(e,d)|0)|0;e=b>>>16;b=O(e,f)|0;return (z=(a>>>16)+(O(e,d)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|c&65535|0)|0}function I6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;c=H6(e,f)|0;a=z;return (z=(O(b,f)|0)+(O(d,e)|0)+a|a&0,c|0|0)|0}function J6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (z=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function K6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (z=d,a-c>>>0|0)|0}function L6(b){b=b|0;var c=0;c=a[n+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[n+(b>>>24)>>0]|0)+24|0} - function M6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=a;j=b;k=j;h=d;n=e;i=n;if(!k){g=(f|0)!=0;if(!i){if(g){c[f>>2]=(l>>>0)%(h>>>0);c[f+4>>2]=0;}n=0;f=(l>>>0)/(h>>>0)>>>0;return (z=n,f)|0}else {if(!g){n=0;f=0;return (z=n,f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;f=0;return (z=n,f)|0}}g=(i|0)==0;do if(h){if(!g){g=(R(i|0)|0)-(R(k|0)|0)|0;if(g>>>0<=31){m=g+1|0;i=31-g|0;b=g-31>>31;h=m;a=l>>>(m>>>0)&b|k<>>(m>>>0)&b;g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;n=0;f=0;return (z=n,f)|0}g=h-1|0;if(g&h|0){i=(R(h|0)|0)+33-(R(k|0)|0)|0;p=64-i|0;m=32-i|0;j=m>>31;o=i-32|0;b=o>>31;h=i;a=m-1>>31&k>>>(o>>>0)|(k<>>(i>>>0))&b;b=b&k>>>(i>>>0);g=l<>>(o>>>0))&j|l<>31;break}if(f|0){c[f>>2]=g&l;c[f+4>>2]=0;}if((h|0)==1){o=j|b&0;p=a|0|0;return (z=o,p)|0}else {p=L6(h|0)|0;o=k>>>(p>>>0)|0;p=k<<32-p|l>>>(p>>>0)|0;return (z=o,p)|0}}else {if(g){if(f|0){c[f>>2]=(k>>>0)%(h>>>0);c[f+4>>2]=0;}o=0;p=(k>>>0)/(h>>>0)>>>0;return (z=o,p)|0}if(!l){if(f|0){c[f>>2]=0;c[f+4>>2]=(k>>>0)%(i>>>0);}o=0;p=(k>>>0)/(i>>>0)>>>0;return (z=o,p)|0}g=i-1|0;if(!(g&i)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=g&k|b&0;}o=0;p=k>>>((L6(i|0)|0)>>>0);return (z=o,p)|0}g=(R(i|0)|0)-(R(k|0)|0)|0;if(g>>>0<=30){b=g+1|0;i=31-g|0;h=b;a=k<>>(b>>>0);b=k>>>(b>>>0);g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;o=0;p=0;return (z=o,p)|0}while(0);if(!h){k=i;j=0;i=0;}else {m=d|0|0;l=n|e&0;k=J6(m|0,l|0,-1,-1)|0;d=z;j=i;i=0;do{e=j;j=g>>>31|j<<1;g=i|g<<1;e=a<<1|e>>>31|0;n=a>>>31|b<<1|0;K6(k|0,d|0,e|0,n|0)|0;p=z;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;a=K6(e|0,n|0,o&m|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l|0)|0;b=z;h=h-1|0;}while((h|0)!=0);k=j;j=0;}h=0;if(f|0){c[f>>2]=a;c[f+4>>2]=b;}o=(g|0)>>>31|(k|h)<<1|(h<<1|g>>>31)&0|j;p=(g<<1|0>>>31)&-2|i;return (z=o,p)|0}function N6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return M6(a,b,c,d,0)|0}function O6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g|0;M6(a,b,d,e,f)|0;l=g;return (z=c[f+4>>2]|0,c[f>>2]|0)|0}function P6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b>>c;return a>>>c|(b&(1<>c-32|0}function Q6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b>>>c;return a>>>c|(b&(1<>>c-32|0}function R6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b<>>32-c;return a<>8&255|0}function T6(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function U6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;q=q+1|0;c[a>>2]=q;while((f|0)<(e|0)){if(!(c[d+(f<<3)>>2]|0)){c[d+(f<<3)>>2]=q;c[d+((f<<3)+4)>>2]=b;c[d+((f<<3)+8)>>2]=0;z=e;return d|0}f=f+1|0;}e=e*2|0;d=W1(d|0,8*(e+1|0)|0)|0;d=U6(a|0,b|0,d|0,e|0)|0;z=e;return d|0}function V6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;while((f|0)<(d|0)){e=c[b+(f<<3)>>2]|0;if(!e)break;if((e|0)==(a|0))return c[b+((f<<3)+4)>>2]|0;f=f+1|0;}return 0}function W6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192)return Ra(b|0,d|0,e|0)|0;h=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return h|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0;}e=g&-4|0;f=e-64|0;while((b|0)<=(f|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0;}while((b|0)<(e|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}}else {e=g-4|0;while((b|0)<(e|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0;}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;}return h|0}function X6(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0;}b=e;}else W6(b,c,d)|0;return b|0}function Y6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0;}f=h&-4|0;g=f-64|0;i=d|d<<8|d<<16|d<<24;while((b|0)<=(g|0)){c[b>>2]=i;c[b+4>>2]=i;c[b+8>>2]=i;c[b+12>>2]=i;c[b+16>>2]=i;c[b+20>>2]=i;c[b+24>>2]=i;c[b+28>>2]=i;c[b+32>>2]=i;c[b+36>>2]=i;c[b+40>>2]=i;c[b+44>>2]=i;c[b+48>>2]=i;c[b+52>>2]=i;c[b+56>>2]=i;c[b+60>>2]=i;b=b+64|0;}while((b|0)<(f|0)){c[b>>2]=i;b=b+4|0;}}while((b|0)<(h|0)){a[b>>0]=d;b=b+1|0;}return h-e|0}function Z6(a){a=a|0;var b=0,d=0;d=a+15&-16|0;b=c[i>>2]|0;a=b+d|0;if((d|0)>0&(a|0)<(b|0)|(a|0)<0){W()|0;va(12);return -1}c[i>>2]=a;if((a|0)>(V()|0)?(U()|0)==0:0){c[i>>2]=b;va(12);return -1}return b|0}function _6(a){a=a|0;return +gb[a&1]()}function $6(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;return +hb[a&7](+b,+c,+d)}function a7(a,b){a=a|0;b=b|0;return +ib[a&1](b|0)}function b7(a){a=a|0;return jb[a&3]()|0}function c7(a,b){a=a|0;b=b|0;return kb[a&63](b|0)|0}function d7(a,b,c){a=a|0;b=b|0;c=c|0;return lb[a&127](b|0,c|0)|0}function e7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=+e;return mb[a&3](b|0,c|0,+d,+e)|0}function f7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nb[a&63](b|0,c|0,d|0)|0}function g7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return ob[a&127](b|0,c|0,d|0,e|0)|0}function h7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return pb[a&127](b|0,c|0,d|0,e|0,f|0)|0}function i7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return qb[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function j7(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;return rb[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)|0}function k7(a){a=a|0;sb[a&15]();}function l7(a,b){a=a|0;b=b|0;tb[a&127](b|0);}function m7(a,b,c){a=a|0;b=b|0;c=c|0;ub[a&63](b|0,c|0);}function n7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;vb[a&127](b|0,c|0,d|0);}function o7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;g=g|0;wb[a&15](b|0,c|0,d|0,+e,+f,g|0);}function p7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;xb[a&31](b|0,c|0,d|0,e|0);}function q7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;yb[a&15](b|0,c|0,d|0,e|0,f|0);}function r7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;zb[a&15](b|0,c|0,d|0,e|0,f|0,g|0);}function s7(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;Ab[a&0](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0);}function t7(){S(0);return 0.0}function u7(a,b,c){a=+a;b=+b;c=+c;S(1);return 0.0}function v7(a){a=a|0;S(2);return 0.0}function w7(){S(3);return 0}function x7(a){a=a|0;S(4);return 0}function y7(a,b){a=a|0;b=b|0;S(5);return 0}function z7(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;S(6);return 0}function A7(a,b,c){a=a|0;b=b|0;c=c|0;S(7);return 0}function B7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S(8);return 0}function C7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;S(9);return 0}function D7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;S(10);return 0}function E7(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;S(11);return 0}function F7(){S(12);}function G7(a){a=a|0;S(13);}function H7(a,b){a=a|0;b=b|0;S(14);}function I7(a,b,c){a=a|0;b=b|0;c=c|0;S(15);}function J7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=+e;f=f|0;S(16);}function K7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S(17);}function L7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;S(18);}function M7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;S(19);}function N7(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;S(20);} - - // EMSCRIPTEN_END_FUNCS - var gb=[t7,UO];var hb=[u7,eJ,dJ,fJ,gJ,u7,u7,u7];var ib=[v7,$O];var jb=[w7,$q,TK,KL];var kb=[x7,ch,xg,Lm,Mm,YB,$B,HQ,IQ,zS,AS,BS,CS,DS,ES,FS,GS,$1,Ib,qF,yl,Bl,_m,KK,tB,jC,sB,PK,UK,uB,tQ,JK,yQ,zQ,sY,T1,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7];var lb=[y7,AB,XB,aC,TN,UN,LN,HN,pN,$W,aX,bX,cX,dX,eX,gX,hX,iX,jX,kX,lX,mX,nX,oX,pX,qX,rX,sX,tX,uX,vX,wX,xX,yX,zX,AX,BX,CX,DX,EX,N_,O_,Q_,l$,m$,n$,o$,p$,q$,r$,s$,j0,k0,m0,A$,B$,D$,oF,ng,bh,Eh,gi,yi,Jk,Hk,zl,Cl,Zo,hq,jr,Fr,Hr,Jr,Kr,Mr,Lr,Xr,ht,mt,ot,tv,sx,EE,DE,CE,vG,kC,MK,IG,YG,TG,UG,VH,T4,E6,OO,aQ,QA,eV,XA,ZA,uQ,s2,FT,_W,oY,pY,W1,B_,C_,D_,o6,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7];var mb=[z7,qu,vu,z7];var nb=[A7,Hm,Mv,Dz,Lz,Uz,Zz,WB,_B,WL,PP,QU,R_,n0,E$,a2,b2,f2,g2,W3,gA,Xm,Av,rp,nt,Vx,Xx,_x,$z,tG,m4,ND,w4,QO,SL,HR,lY,Y$,P0,J0,T0,d5,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7];var ob=[B7,Jm,Rr,Nv,Fz,Nz,VA,SD,WA,nB,CB,EB,PB,OB,bC,fC,hC,ML,RP,iR,gR,eT,SU,mV,lV,G_,H_,I_,J_,K_,L_,M_,P_,T_,c0,d0,e0,f0,g0,h0,i0,l0,p0,t$,u$,v$,w$,x$,y$,z$,C$,G$,cA,TC,xG,SO,fZ,iZ,pZ,AZ,JZ,PZ,NZ,QZ,z_,U0,m_,_$,$$,Q0,R0,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7];var pb=[C7,BB,qN,MN,U_,V_,j$,k$,G0,q0,r0,H$,I$,E_,F_,W0,X0,Y0,Z0,$0,a1,b1,c1,d1,f1,g1,h1,i1,j1,e1,J1,K1,A1,t1,k1,l1,m1,o1,n1,p1,q1,r1,s1,u1,v1,w1,x1,y1,z1,B1,C1,D1,E1,I1,G1,F1,H1,P1,L1,M1,N1,O1,Q1,R1,S1,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7];var qb=[D7,RX];var rb=[E7,I0,S0,E7];var sb=[F7,TO,QK,RK,SK,WK,XK,YK,WU,F7,F7,F7,F7,F7,F7,F7];var tb=[G7,Mb,Nb,Rb,Sb,Tb,lc,mc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,ad,bd,ed,fd,gd,hd,id,jd,kd,wd,xd,yd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Sd,Td,Ud,Wd,Xd,Yd,Zd,_d,$d,ae,be,ce,ee,re,se,te,ue,Fe,Ge,He,Je,We,Xe,Ye,_e,$e,af,bf,cf,df,ef,ff,gf,qf,rf,sf,tf,Wf,Rf,pm,$l,dp,Eo,Op,Xp,_n,ao,Lp,Mp,Xl,Yl,co,lo,no,yo,FB,XM,nN,ZM,YM,JN,uM,xM,HS,MS,Kf,Dl,Io,Mo,ep,U1,Xv,tA,yG,rI,VU,AR,BQ,NL,nV,QX,jY,kY,qY,G7,G7,G7,G7,G7,G7,G7,G7,G7];var ub=[H7,Sc,Xc,md,rd,Od,ke,Ae,Pe,nf,zf,cC,rN,VN,NN,IN,lN,mN,RN,SN,KS,OS,cM,jA,uG,VK,sQ,RW,PX,mY,nY,rY,tY,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7];var vb=[I7,Ub,Vb,Yb,Jc,Rc,Tc,Wc,ld,nd,qd,Jd,Kd,Nd,fe,ge,je,ve,we,ze,Ke,Le,Oe,hf,jf,mf,uf,vf,yf,ok,pk,qk,Im,Ez,Mz,qA,GB,gC,PC,TD,lG,QJ,LL,XL,wM,QP,TP,hR,fR,IS,JS,LS,NS,PS,RU,EW,DW,JA,jB,uC,XC,_C,OK,RO,QL,wQ,AQ,FW,HW,IW,QW,SW,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7];var wb=[J7,MH,NH,OH,PH,QH,RH,SH,TH,J7,J7,J7,J7,J7,J7,J7];var xb=[K7,Wb,Uc,od,zd,Ld,Vd,he,xe,Me,Ze,kf,wf,Nf,Mf,Lf,Jf,If,Hf,kc,Gf,Ff,DB,oN,KN,S_,o0,F$,o4,vQ,xQ,a0];var yb=[L7,cd,Id,Pd,de,Ie,Al,wG,CQ,L7,L7,L7,L7,L7,L7,L7];var zb=[M7,Xb,Vc,pd,Md,ie,ye,Ne,lf,xf,DQ,M7,M7,M7,M7,M7];var Ab=[N7];return {___errno_location:d2,___muldi3:I6,___udivdi3:N6,___uremdi3:O6,_bitshift64Ashr:P6,_bitshift64Lshr:Q6,_bitshift64Shl:R6,_dtextract:Sz,_free:U1,_htons:a4,_i64Add:J6,_i64Subtract:K6,_llvm_bswap_i16:S6,_llvm_bswap_i32:T6,_malloc:T1,_memalign:Z1,_memcpy:W6,_memmove:X6,_memset:Y6,_realloc:W1,_saveSetjmp:U6,_sbrk:Z6,_testSetjmp:V6,_vizCreateFile:Kb,_vizLastErrorMessage:Jb,_vizRenderFromString:Lb,dynCall_d:_6,dynCall_dddd:$6,dynCall_di:a7,dynCall_i:b7,dynCall_ii:c7,dynCall_iii:d7,dynCall_iiidd:e7,dynCall_iiii:f7,dynCall_iiiii:g7,dynCall_iiiiii:h7,dynCall_iiiiiii:i7,dynCall_iiiiiiiiiii:j7,dynCall_v:k7,dynCall_vi:l7,dynCall_vii:m7,dynCall_viii:n7,dynCall_viiiddi:o7,dynCall_viiii:p7,dynCall_viiiii:q7,dynCall_viiiiii:r7,dynCall_viiiiiiiii:s7,establishStackSpace:Eb,getTempRet0:Hb,runPostSets:G6,setTempRet0:Gb,setThrew:Fb,stackAlloc:Bb,stackRestore:Db,stackSave:Cb}}) - - - // EMSCRIPTEN_END_ASM - (Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["___errno_location"]=asm["___errno_location"];Module["___muldi3"]=asm["___muldi3"];Module["___udivdi3"]=asm["___udivdi3"];Module["___uremdi3"]=asm["___uremdi3"];Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];Module["_bitshift64Shl"]=asm["_bitshift64Shl"];Module["_dtextract"]=asm["_dtextract"];var _free=Module["_free"]=asm["_free"];Module["_htons"]=asm["_htons"];Module["_i64Add"]=asm["_i64Add"];Module["_i64Subtract"]=asm["_i64Subtract"];Module["_llvm_bswap_i16"]=asm["_llvm_bswap_i16"];Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memalign=Module["_memalign"]=asm["_memalign"];Module["_memcpy"]=asm["_memcpy"];Module["_memmove"]=asm["_memmove"];var _memset=Module["_memset"]=asm["_memset"];Module["_realloc"]=asm["_realloc"];Module["_saveSetjmp"]=asm["_saveSetjmp"];Module["_sbrk"]=asm["_sbrk"];Module["_testSetjmp"]=asm["_testSetjmp"];Module["_vizCreateFile"]=asm["_vizCreateFile"];Module["_vizLastErrorMessage"]=asm["_vizLastErrorMessage"];Module["_vizRenderFromString"]=asm["_vizRenderFromString"];Module["establishStackSpace"]=asm["establishStackSpace"];Module["getTempRet0"]=asm["getTempRet0"];Module["runPostSets"]=asm["runPostSets"];Module["setTempRet0"]=asm["setTempRet0"];Module["setThrew"]=asm["setThrew"];var stackAlloc=Module["stackAlloc"]=asm["stackAlloc"];var stackRestore=Module["stackRestore"]=asm["stackRestore"];var stackSave=Module["stackSave"]=asm["stackSave"];Module["dynCall_d"]=asm["dynCall_d"];Module["dynCall_dddd"]=asm["dynCall_dddd"];Module["dynCall_di"]=asm["dynCall_di"];Module["dynCall_i"]=asm["dynCall_i"];Module["dynCall_ii"]=asm["dynCall_ii"];Module["dynCall_iii"]=asm["dynCall_iii"];Module["dynCall_iiidd"]=asm["dynCall_iiidd"];Module["dynCall_iiii"]=asm["dynCall_iiii"];Module["dynCall_iiiii"]=asm["dynCall_iiiii"];Module["dynCall_iiiiii"]=asm["dynCall_iiiiii"];Module["dynCall_iiiiiii"]=asm["dynCall_iiiiiii"];Module["dynCall_iiiiiiiiiii"]=asm["dynCall_iiiiiiiiiii"];Module["dynCall_v"]=asm["dynCall_v"];Module["dynCall_vi"]=asm["dynCall_vi"];Module["dynCall_vii"]=asm["dynCall_vii"];Module["dynCall_viii"]=asm["dynCall_viii"];Module["dynCall_viiiddi"]=asm["dynCall_viiiddi"];Module["dynCall_viiii"]=asm["dynCall_viiii"];Module["dynCall_viiiii"]=asm["dynCall_viiiii"];Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];Module["dynCall_viiiiiiiii"]=asm["dynCall_viiiiiiiii"];Module["asm"]=asm;Module["ccall"]=ccall;Module["Pointer_stringify"]=Pointer_stringify;Module["UTF8ToString"]=UTF8ToString;if(memoryInitializer){if(!isDataURI(memoryInitializer)){if(typeof Module["locateFile"]==="function"){memoryInitializer=Module["locateFile"](memoryInitializer);}else if(Module["memoryInitializerPrefixURL"]){memoryInitializer=Module["memoryInitializerPrefixURL"]+memoryInitializer;}}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=Module["readBinary"](memoryInitializer);HEAPU8.set(data,GLOBAL_BASE);}else {addRunDependency();var applyMemoryInitializer=(function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,GLOBAL_BASE);if(Module["memoryInitializerRequest"])delete Module["memoryInitializerRequest"].response;removeRunDependency();});function doBrowserLoad(){Module["readAsync"](memoryInitializer,applyMemoryInitializer,(function(){throw "could not load memory initializer "+memoryInitializer}));}var memoryInitializerBytes=tryParseAsDataURI(memoryInitializer);if(memoryInitializerBytes){applyMemoryInitializer(memoryInitializerBytes.buffer);}else if(Module["memoryInitializerRequest"]){function useRequest(){var request=Module["memoryInitializerRequest"];var response=request.response;if(request.status!==200&&request.status!==0){var data=tryParseAsDataURI(Module["memoryInitializerRequestURL"]);if(data){response=data.buffer;}else {console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+request.status+", retrying "+memoryInitializer);doBrowserLoad();return}}applyMemoryInitializer(response);}if(Module["memoryInitializerRequest"].response){setTimeout(useRequest,0);}else {Module["memoryInitializerRequest"].addEventListener("load",useRequest);}}else {doBrowserLoad();}}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller;};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("");}),1);doRun();}),1);}else {doRun();}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]);else {ABORT=true;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status);}if(ENVIRONMENT_IS_NODE){process["exit"](status);}Module["quit"](status,new ExitStatus(status));}Module["exit"]=exit;function abort(what){if(Module["onAbort"]){Module["onAbort"](what);}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what);}else {what="";}ABORT=true;throw "abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()();}}Module["noExitRuntime"]=true;run(); - - - - - return Module; - }; - function Viz(src) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var format = options.format === undefined ? "svg" : options.format; - var engine = options.engine === undefined ? "dot" : options.engine; - var scale = options.scale; - var totalMemory = options.totalMemory; - var files = options.files === undefined ? [] : options.files; - var images = options.images === undefined ? [] : options.images; - var i; - - for (i = 0; i < images.length; i++) { - files.push({ path: images[i].path, data: "\n\n" }); - } - - if (format == "png-image-element") { - return Viz.svgXmlToPngImageElement(render(src, "svg", engine, totalMemory, files), scale); - } else { - return render(src, format, engine, totalMemory, files); - } - } - - function render(src, format, engine, totalMemory, files) { - var graphviz = Module({ TOTAL_MEMORY: totalMemory }); - var i; - - for (i = 0; i < files.length; i++) { - graphviz["ccall"]("vizCreateFile", "number", ["string", "string"], [files[i].path, files[i].data]); - } - - var resultPointer = graphviz["ccall"]("vizRenderFromString", "number", ["string", "string", "string"], [src, format, engine]); - var resultString = graphviz["Pointer_stringify"](resultPointer); - - var errorMessagePointer = graphviz["ccall"]("vizLastErrorMessage", "number", [], []); - var errorMessageString = graphviz["Pointer_stringify"](errorMessagePointer); - - if (errorMessageString != "") { - throw new Error(errorMessageString); - } - - return resultString; - } - - // https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding - function b64EncodeUnicode(str) { - return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { - return String.fromCharCode('0x' + p1); - })); - } - - Viz.svgXmlToPngImageElement = function(svgXml, scale, callback) { - if (scale === undefined) { - if ("devicePixelRatio" in window && window.devicePixelRatio > 1) { - scale = window.devicePixelRatio; - } else { - scale = 1; - } - } - - var pngImage = new Image(); - - try { - if (typeof fabric === "object" && fabric.loadSVGFromString) { - fabric.loadSVGFromString(svgXml, function(objects, options) { - // If there's something wrong with the SVG, Fabric may return an empty array of objects. Graphviz appears to give us at least one element back even given an empty graph, so we will assume an error in this case. - if (objects.length == 0) { - if (callback !== undefined) { - callback(new Error("Error loading SVG with Fabric")); - return; - } else { - throw new Error("Error loading SVG with Fabric"); - } - } - - var element = document.createElement("canvas"); - element.width = options.width; - element.height = options.height; - - var canvas = new fabric.Canvas(element, { enableRetinaScaling: false }); - var obj = fabric.util.groupSVGElements(objects, options); - canvas.add(obj).renderAll(); - - pngImage.src = canvas.toDataURL({ multiplier: scale }); - pngImage.width = options.width; - pngImage.height = options.height; - - if (callback !== undefined) { - callback(null, pngImage); - } - }); - } else { - var svgImage = new Image(); - - svgImage.onload = function() { - var canvas = document.createElement("canvas"); - canvas.width = svgImage.width * scale; - canvas.height = svgImage.height * scale; - - var context = canvas.getContext("2d"); - context.drawImage(svgImage, 0, 0, canvas.width, canvas.height); - - pngImage.src = canvas.toDataURL("image/png"); - pngImage.width = svgImage.width; - pngImage.height = svgImage.height; - - if (callback !== undefined) { - callback(null, pngImage); - } - }; - - svgImage.onerror = function(e) { - var error; - - if ('error' in e) { - error = e.error; - } else { - error = new Error('Error loading SVG'); - } - - if (callback !== undefined) { - callback(error); - } else { - throw error; - } - }; - - svgImage.src = "data:image/svg+xml;base64," + b64EncodeUnicode(svgXml); - } - } catch (e) { - if (callback !== undefined) { - callback(e); - } else { - throw e; - } - } - - if (callback === undefined) { - return pngImage; - } - }; - - Viz.svgXmlToPngBase64 = function(svgXml, scale, callback) { - Viz.svgXmlToPngImageElement(svgXml, scale, function(err, image) { - if (err) { - callback(err); - } else { - callback(null, image.src.slice("data:image/png;base64,".length)); - } - }); - }; - { - module.exports = Viz; - } - - })(); - }(viz)); - - function formatDecimal(x) { - return Math.abs(x = Math.round(x)) >= 1e21 - ? x.toLocaleString("en").replace(/,/g, "") - : x.toString(10); - } - - // Computes the decimal coefficient and exponent of the specified number x with - // significant digits p, where x is positive and p is in [1, 21] or undefined. - // For example, formatDecimalParts(1.23) returns ["123", 0]. - function formatDecimalParts(x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - var i, coefficient = x.slice(0, i); - - // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x.slice(i + 1) - ]; - } - - function exponent(x) { - return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; - } - - function formatGroup(grouping, thousands) { - return function(value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - - return t.reverse().join(thousands); - }; - } - - function formatNumerals(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; - } - - // [[fill]align][sign][symbol][0][width][,][.precision][~][type] - var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - - function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); - } - - formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof - - function FormatSpecifier(specifier) { - this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; - this.align = specifier.align === undefined ? ">" : specifier.align + ""; - this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? "" : specifier.type + ""; - } - - FormatSpecifier.prototype.toString = function() { - return this.fill - + this.align - + this.sign - + this.symbol - + (this.zero ? "0" : "") - + (this.width === undefined ? "" : Math.max(1, this.width | 0)) - + (this.comma ? "," : "") - + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) - + (this.trim ? "~" : "") - + this.type; - }; - - // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. - function formatTrim(s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": i0 = i1 = i; break; - case "0": if (i0 === 0) i0 = i; i1 = i; break; - default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; - } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; - } - - var prefixExponent; - - function formatPrefixAuto(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient - : i > n ? coefficient + new Array(i - n + 1).join("0") - : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) - : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! - } - - function formatRounded(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient - : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) - : coefficient + new Array(exponent - coefficient.length + 2).join("0"); - } - - var formatTypes = { - "%": function(x, p) { return (x * 100).toFixed(p); }, - "b": function(x) { return Math.round(x).toString(2); }, - "c": function(x) { return x + ""; }, - "d": formatDecimal, - "e": function(x, p) { return x.toExponential(p); }, - "f": function(x, p) { return x.toFixed(p); }, - "g": function(x, p) { return x.toPrecision(p); }, - "o": function(x) { return Math.round(x).toString(8); }, - "p": function(x, p) { return formatRounded(x * 100, p); }, - "r": formatRounded, - "s": formatPrefixAuto, - "X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, - "x": function(x) { return Math.round(x).toString(16); } - }; - - function identity$1(x) { - return x; - } - - var map = Array.prototype.map, - prefixes$1 = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; - - function formatLocale(locale) { - var group = locale.grouping === undefined || locale.thousands === undefined ? identity$1 : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), - currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", - currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", - decimal = locale.decimal === undefined ? "." : locale.decimal + "", - numerals = locale.numerals === undefined ? identity$1 : formatNumerals(map.call(locale.numerals, String)), - percent = locale.percent === undefined ? "%" : locale.percent + "", - minus = locale.minus === undefined ? "-" : locale.minus + "", - nan = locale.nan === undefined ? "NaN" : locale.nan + ""; - - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; - - // The "n" type is an alias for ",g". - if (type === "n") comma = true, type = "g"; - - // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; - - // If zero fill is specified, padding goes after sign and before digits. - if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; - - // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; - - // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); - - // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - precision = precision === undefined ? 6 - : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) - : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, n, c; - - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - - // Determine the sign. -0 is not less than 0, but 1 / -0 is! - var valueNegative = value < 0 || 1 / value < 0; - - // Perform the initial formatting. - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - - // Trim insignificant zeros. - if (trim) value = formatTrim(value); - - // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; - - // Compute the prefix and suffix. - valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes$1[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); - - // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - - // If the fill character is not "0", grouping is applied before padding. - if (comma && !zero) value = group(value, Infinity); - - // Compute the padding. - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; - - // If the fill character is "0", grouping is applied after padding. - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; - - // Reconstruct the final output based on the desired alignment. - switch (align) { - case "<": value = valuePrefix + value + valueSuffix + padding; break; - case "=": value = valuePrefix + padding + value + valueSuffix; break; - case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; - default: value = padding + valuePrefix + value + valueSuffix; break; - } - - return numerals(value); - } - - format.toString = function() { - return specifier + ""; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes$1[8 + e / 3]; - return function(value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix - }; - } - - var locale; - var format$6; - var formatPrefix; - - defaultLocale({ - decimal: ".", - thousands: ",", - grouping: [3], - currency: ["$", ""], - minus: "-" - }); - - function defaultLocale(definition) { - locale = formatLocale(definition); - format$6 = locale.format; - formatPrefix = locale.formatPrefix; - return locale; - } - - function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); - } - - function precisionPrefix(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); - } - - function precisionRound(step, max) { - step = Math.abs(step), max = Math.abs(max) - step; - return Math.max(0, exponent(max) - exponent(step)) + 1; - } - - var src$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - formatDefaultLocale: defaultLocale, - get format () { return format$6; }, - get formatPrefix () { return formatPrefix; }, - formatLocale: formatLocale, - formatSpecifier: formatSpecifier, - FormatSpecifier: FormatSpecifier, - precisionFixed: precisionFixed, - precisionPrefix: precisionPrefix, - precisionRound: precisionRound - }); - - var require$$7 = /*@__PURE__*/getAugmentedNamespace(src$5); - - var pi = Math.PI, - tau = 2 * pi, - epsilon = 1e-6, - tauEpsilon = tau - epsilon; - - function Path$a() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; // end of current subpath - this._ = ""; - } - - function path$h() { - return new Path$a; - } - - Path$a.prototype = path$h.prototype = { - constructor: Path$a, - moveTo: function(x, y) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y); - }, - closePath: function() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._ += "Z"; - } - }, - lineTo: function(x, y) { - this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y); - }, - quadraticCurveTo: function(x1, y1, x, y) { - this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - bezierCurveTo: function(x1, y1, x2, y2, x, y) { - this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - arcTo: function(x1, y1, x2, y2, r) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; - var x0 = this._x1, - y0 = this._y1, - x21 = x2 - x1, - y21 = y2 - y1, - x01 = x0 - x1, - y01 = y0 - y1, - l01_2 = x01 * x01 + y01 * y01; - - // Is the radius negative? Error. - if (r < 0) throw new Error("negative radius: " + r); - - // Is this path empty? Move to (x1,y1). - if (this._x1 === null) { - this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); - } - - // Or, is (x1,y1) coincident with (x0,y0)? Do nothing. - else if (!(l01_2 > epsilon)); - - // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? - // Equivalently, is (x1,y1) coincident with (x2,y2)? - // Or, is the radius zero? Line to (x1,y1). - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } - - // Otherwise, draw an arc! - else { - var x20 = x2 - x0, - y20 = y2 - y0, - l21_2 = x21 * x21 + y21 * y21, - l20_2 = x20 * x20 + y20 * y20, - l21 = Math.sqrt(l21_2), - l01 = Math.sqrt(l01_2), - l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), - t01 = l / l01, - t21 = l / l21; - - // If the start tangent is not coincident with (x0,y0), line to. - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } - - this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); - } - }, - arc: function(x, y, r, a0, a1, ccw) { - x = +x, y = +y, r = +r, ccw = !!ccw; - var dx = r * Math.cos(a0), - dy = r * Math.sin(a0), - x0 = x + dx, - y0 = y + dy, - cw = 1 ^ ccw, - da = ccw ? a0 - a1 : a1 - a0; - - // Is the radius negative? Error. - if (r < 0) throw new Error("negative radius: " + r); - - // Is this path empty? Move to (x0,y0). - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } - - // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). - else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } - - // Is this arc empty? We’re done. - if (!r) return; - - // Does the angle go the wrong way? Flip the direction. - if (da < 0) da = da % tau + tau; - - // Is this a complete circle? Draw two arcs to complete the circle. - if (da > tauEpsilon) { - this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); - } - - // Is this arc non-empty? Draw an arc! - else if (da > epsilon) { - this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); - } - }, - rect: function(x, y, w, h) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z"; - }, - toString: function() { - return this._; - } - }; - - var src$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - path: path$h - }); - - var require$$8 = /*@__PURE__*/getAugmentedNamespace(src$4); - - (function (module, exports) { - (function (global, factory) { - factory(exports, require$$0$3, require$$1$2, require$$2$1, require$$3, require$$4, require$$5$1, viz.exports, require$$7, require$$8) ; - }(commonjsGlobal, (function (exports,d3,d3Dispatch,d3Transition,d3Timer,d3Interpolate,d3Zoom,Viz,d3Format,d3Path) { - Viz = Viz && Viz.hasOwnProperty('default') ? Viz['default'] : Viz; - - function extractElementData(element) { - - var datum = {}; - var tag = element.node().nodeName; - datum.tag = tag; - if (tag == '#text') { - datum.text = element.text(); - } else if (tag == '#comment') { - datum.comment = element.text(); - } - datum.attributes = {}; - var attributes = element.node().attributes; - if (attributes) { - for (var i = 0; i < attributes.length; i++) { - var attribute = attributes[i]; - var name = attribute.name; - var value = attribute.value; - datum.attributes[name] = value; - } - } - var transform = element.node().transform; - if (transform && transform.baseVal.numberOfItems != 0) { - var matrix = transform.baseVal.consolidate().matrix; - datum.translation = { x: matrix.e, y: matrix.f }; - datum.scale = matrix.a; - } - if (tag == 'ellipse') { - datum.center = { - x: datum.attributes.cx, - y: datum.attributes.cy - }; - } - if (tag == 'polygon') { - var points = element.attr('points').split(' '); - var x = points.map(function (p) { - return p.split(',')[0]; - }); - var y = points.map(function (p) { - return p.split(',')[1]; - }); - var xmin = Math.min.apply(null, x); - var xmax = Math.max.apply(null, x); - var ymin = Math.min.apply(null, y); - var ymax = Math.max.apply(null, y); - var bbox = { - x: xmin, - y: ymin, - width: xmax - xmin, - height: ymax - ymin - }; - datum.bbox = bbox; - datum.center = { - x: (xmin + xmax) / 2, - y: (ymin + ymax) / 2 - }; - } - if (tag == 'path') { - var d = element.attr('d'); - var points = d.split(/[A-Z ]/); - points.shift(); - var x = points.map(function (p) { - return +p.split(',')[0]; - }); - var y = points.map(function (p) { - return +p.split(',')[1]; - }); - var xmin = Math.min.apply(null, x); - var xmax = Math.max.apply(null, x); - var ymin = Math.min.apply(null, y); - var ymax = Math.max.apply(null, y); - var bbox = { - x: xmin, - y: ymin, - width: xmax - xmin, - height: ymax - ymin - }; - datum.bbox = bbox; - datum.center = { - x: (xmin + xmax) / 2, - y: (ymin + ymax) / 2 - }; - datum.totalLength = element.node().getTotalLength(); - } - if (tag == 'text') { - datum.center = { - x: element.attr('x'), - y: element.attr('y') - }; - } - if (tag == '#text') { - datum.text = element.text(); - } else if (tag == '#comment') { - datum.comment = element.text(); - } - return datum; - } - - function extractAllElementsData(element) { - - var datum = extractElementData(element); - datum.children = []; - var children = d3.selectAll(element.node().childNodes); - children.each(function () { - var childData = extractAllElementsData(d3.select(this)); - childData.parent = datum; - datum.children.push(childData); - }); - return datum; - } - - function createElement(data) { - - if (data.tag == '#text') { - return document.createTextNode(""); - } else if (data.tag == '#comment') { - return document.createComment(data.comment); - } else { - return document.createElementNS('http://www.w3.org/2000/svg', data.tag); - } - } - - function createElementWithAttributes(data) { - - var elementNode = createElement(data); - var element = d3.select(elementNode); - var attributes = data.attributes; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var attributeName = _step.value; - - var attributeValue = attributes[attributeName]; - element.attr(attributeName, attributeValue); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return elementNode; - } - - function replaceElement(element, data) { - var parent = d3.select(element.node().parentNode); - var newElementNode = createElementWithAttributes(data); - var newElement = parent.insert(function () { - return newElementNode; - }, function () { - return element.node(); - }); - element.remove(); - return newElement; - } - - function insertElementData(element, datum) { - element.datum(datum); - element.data([datum], function (d) { - return d.key; - }); - } - - function insertAllElementsData(element, datum) { - insertElementData(element, datum); - var children = d3.selectAll(element.node().childNodes); - children.each(function (d, i) { - insertAllElementsData(d3.select(this), datum.children[i]); - }); - } - - function insertChildren(element, index) { - var children = element.selectAll(function () { - return element.node().childNodes; - }); - - children = children.data(function (d) { - return d.children; - }, function (d) { - return d.tag + '-' + index; - }); - var childrenEnter = children.enter().append(function (d) { - return createElement(d); - }); - - var childrenExit = children.exit(); - childrenExit = childrenExit.remove(); - children = childrenEnter.merge(children); - var childTagIndexes = {}; - children.each(function (childData) { - var childTag = childData.tag; - if (childTagIndexes[childTag] == null) { - childTagIndexes[childTag] = 0; - } - var childIndex = childTagIndexes[childTag]++; - attributeElement.call(this, childData, childIndex); - }); - } - - function attributeElement(data) { - var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var element = d3.select(this); - data.tag; - var attributes = data.attributes; - var currentAttributes = element.node().attributes; - if (currentAttributes) { - for (var i = 0; i < currentAttributes.length; i++) { - var currentAttribute = currentAttributes[i]; - var name = currentAttribute.name; - if (name.split(':')[0] != 'xmlns' && currentAttribute.namespaceURI) { - var namespaceURIParts = currentAttribute.namespaceURI.split('/'); - var namespace = namespaceURIParts[namespaceURIParts.length - 1]; - name = namespace + ':' + name; - } - if (!(name in attributes)) { - attributes[name] = null; - } - } - } - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = Object.keys(attributes)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attributeName = _step2.value; - - element.attr(attributeName, attributes[attributeName]); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - if (data.text) { - element.text(data.text); - } - insertChildren(element, index); - } - - function shallowCopyObject(obj) { - return Object.assign({}, obj); - } - - function roundTo4Decimals(x) { - return Math.round(x * 10000.0) / 10000.0; - } - - var zoom$1 = function (enable) { - - this._options.zoom = enable; - - if (this._options.zoom && !this._zoomBehavior) { - createZoomBehavior.call(this); - } - - return this; - }; - - function createZoomBehavior() { - - function zoomed() { - var g = d3.select(svg.node().querySelector("g")); - g.attr('transform', d3.event.transform); - } - - var root = this._selection; - var svg = d3.select(root.node().querySelector("svg")); - if (svg.size() == 0) { - return this; - } - this._zoomSelection = svg; - var zoomBehavior = d3Zoom.zoom().scaleExtent(this._options.zoomScaleExtent).translateExtent(this._options.zoomTranslateExtent).interpolate(d3Interpolate.interpolate).on("zoom", zoomed); - this._zoomBehavior = zoomBehavior; - var g = d3.select(svg.node().querySelector("g")); - svg.call(zoomBehavior); - if (!this._active) { - translateZoomBehaviorTransform.call(this, g); - } - this._originalTransform = d3Zoom.zoomTransform(svg.node()); - - return this; - } - - function getTranslatedZoomTransform(selection$$1) { - - // Get the current zoom transform for the top level svg and - // translate it uniformly with the given selection, using the - // difference between the translation specified in the selection's - // data and it's saved previous translation. The selection is - // normally the top level g element of the graph. - var oldTranslation = this._translation; - var oldScale = this._scale; - var newTranslation = selection$$1.datum().translation; - var newScale = selection$$1.datum().scale; - var t = d3Zoom.zoomTransform(this._zoomSelection.node()); - if (oldTranslation) { - t = t.scale(1 / oldScale); - t = t.translate(-oldTranslation.x, -oldTranslation.y); - } - t = t.translate(newTranslation.x, newTranslation.y); - t = t.scale(newScale); - return t; - } - - function translateZoomBehaviorTransform(selection$$1) { - - // Translate the current zoom transform for the top level svg - // uniformly with the given selection, using the difference - // between the translation specified in the selection's data and - // it's saved previous translation. The selection is normally the - // top level g element of the graph. - this._zoomBehavior.transform(this._zoomSelection, getTranslatedZoomTransform.call(this, selection$$1)); - - // Save the selections's new translation and scale. - this._translation = selection$$1.datum().translation; - this._scale = selection$$1.datum().scale; - - // Set the original zoom transform to the translation and scale specified in - // the selection's data. - this._originalTransform = d3Zoom.zoomIdentity.translate(selection$$1.datum().translation.x, selection$$1.datum().translation.y).scale(selection$$1.datum().scale); - } - - function resetZoom(transition$$1) { - - // Reset the zoom transform to the original zoom transform. - var selection$$1 = this._zoomSelection; - if (transition$$1) { - selection$$1 = selection$$1.transition(transition$$1); - } - selection$$1.call(this._zoomBehavior.transform, this._originalTransform); - - return this; - } - - function zoomScaleExtent(extent) { - - this._options.zoomScaleExtent = extent; - - return this; - } - - function zoomTranslateExtent(extent) { - - this._options.zoomTranslateExtent = extent; - - return this; - } - - function zoomBehavior() { - return this._zoomBehavior || null; - } - - function zoomSelection() { - return this._zoomSelection || null; - } - - function pathTween(points, d1) { - return function () { - var pointInterpolators = points.map(function (p) { - return d3Interpolate.interpolate([p[0][0], p[0][1]], [p[1][0], p[1][1]]); - }); - return function (t) { - return t < 1 ? "M" + pointInterpolators.map(function (p) { - return p(t); - }).join("L") : d1; - }; - }; - } - - function pathTweenPoints(node, d1, precision, precisionIsRelative) { - var path0 = node; - var path1 = path0.cloneNode(); - var n0 = path0.getTotalLength(); - var n1 = (path1.setAttribute("d", d1), path1).getTotalLength(); - - // Uniform sampling of distance based on specified precision. - var distances = [0]; - var i = 0; - var dt = precisionIsRelative ? precision : precision / Math.max(n0, n1); - while ((i += dt) < 1) { - distances.push(i); - } - distances.push(1); - - // Compute point-interpolators at each distance. - var points = distances.map(function (t) { - var p0 = path0.getPointAtLength(t * n0); - var p1 = path1.getPointAtLength(t * n1); - return [[p0.x, p0.y], [p1.x, p1.y]]; - }); - return points; - } - - var data = function () { - return this._data || null; - }; - - function isEdgeElementParent(datum) { - return datum.attributes.class == 'edge' || datum.tag == 'a' && datum.parent.tag == 'g' && datum.parent.parent.attributes.class == 'edge'; - } - - function isEdgeElement(datum) { - return datum.parent && isEdgeElementParent(datum.parent); - } - - function getEdgeGroup(datum) { - if (datum.parent.attributes.class == 'edge') { - return datum.parent; - } else { - // datum.parent.tag == 'g' && datum.parent.parent.tag == 'g' && datum.parent.parent.parent.attributes.class == 'edge' - return datum.parent.parent.parent; - } - } - - function getEdgeTitle(datum) { - return getEdgeGroup(datum).children.find(function (e) { - return e.tag == 'title'; - }); - } - - var render = function (callback) { - - if (this._busy) { - this._queue.push(this.render.bind(this, callback)); - return this; - } - this._dispatch.call('renderStart', this); - - if (this._transitionFactory) { - d3Timer.timeout(function () { - // Decouple from time spent. See https://github.com/d3/d3-timer/issues/27 - this._transition = d3Transition.transition(this._transitionFactory()); - _render.call(this, callback); - }.bind(this), 0); - } else { - _render.call(this, callback); - } - return this; - }; - - function _render(callback) { - - var transitionInstance = this._transition; - var fade = this._options.fade && transitionInstance != null; - var tweenPaths = this._options.tweenPaths; - var tweenShapes = this._options.tweenShapes; - var convertEqualSidedPolygons = this._options.convertEqualSidedPolygons; - var growEnteringEdges = this._options.growEnteringEdges && transitionInstance != null; - var attributer = this._attributer; - var graphvizInstance = this; - - function insertChildren(element) { - var children = element.selectAll(function () { - return element.node().childNodes; - }); - - children = children.data(function (d) { - return d.children; - }, function (d) { - return d.key; - }); - var childrenEnter = children.enter().append(function (d) { - var element = createElement(d); - if (d.tag == '#text' && fade) { - element.nodeValue = d.text; - } - return element; - }); - - if (fade || growEnteringEdges && isEdgeElementParent(element.datum())) { - var childElementsEnter = childrenEnter.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).each(function (d) { - var childEnter = d3.select(this); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(d.attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var attributeName = _step.value; - - var attributeValue = d.attributes[attributeName]; - childEnter.attr(attributeName, attributeValue); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }); - childElementsEnter.filter(function (d) { - return d.tag == 'svg' || d.tag == 'g' ? null : this; - }).style("opacity", 0.0); - } - var childrenExit = children.exit(); - if (attributer) { - childrenExit.each(attributer); - } - if (transitionInstance) { - childrenExit = childrenExit.transition(transitionInstance); - if (fade) { - childrenExit.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).style("opacity", 0.0); - } - } - childrenExit = childrenExit.remove(); - children = childrenEnter.merge(children); - children.each(attributeElement$$1); - } - - function attributeElement$$1(data$$1) { - var element = d3.select(this); - if (data$$1.tag == "svg") { - var options = graphvizInstance._options; - if (options.width != null || options.height != null) { - var width = options.width; - var height = options.height; - if (width == null) { - width = data$$1.attributes.width.replace('pt', '') * 4 / 3; - } else { - element.attr("width", width); - data$$1.attributes.width = width; - } - if (height == null) { - height = data$$1.attributes.height.replace('pt', '') * 4 / 3; - } else { - element.attr("height", height); - data$$1.attributes.height = height; - } - if (!options.fit) { - element.attr("viewBox", "0 0 " + width * 3 / 4 / options.scale + " " + height * 3 / 4 / options.scale); - data$$1.attributes.viewBox = "0 0 " + width * 3 / 4 / options.scale + " " + height * 3 / 4 / options.scale; - } - } - if (options.scale != 1 && (options.fit || options.width == null && options.height == null)) { - width = data$$1.attributes.viewBox.split(' ')[2]; - height = data$$1.attributes.viewBox.split(' ')[3]; - element.attr("viewBox", "0 0 " + width / options.scale + " " + height / options.scale); - data$$1.attributes.viewBox = "0 0 " + width / options.scale + " " + height / options.scale; - } - } - if (attributer) { - element.each(attributer); - } - var tag = data$$1.tag; - var attributes = data$$1.attributes; - var currentAttributes = element.node().attributes; - if (currentAttributes) { - for (var i = 0; i < currentAttributes.length; i++) { - var currentAttribute = currentAttributes[i]; - var name = currentAttribute.name; - if (name.split(':')[0] != 'xmlns' && currentAttribute.namespaceURI) { - var namespaceURIParts = currentAttribute.namespaceURI.split('/'); - var namespace = namespaceURIParts[namespaceURIParts.length - 1]; - name = namespace + ':' + name; - } - if (!(name in attributes)) { - attributes[name] = null; - } - } - } - var convertShape = false; - var convertPrevShape = false; - if (tweenShapes && transitionInstance) { - if ((this.nodeName == 'polygon' || this.nodeName == 'ellipse') && data$$1.alternativeOld) { - convertPrevShape = true; - } - if ((tag == 'polygon' || tag == 'ellipse') && data$$1.alternativeNew) { - convertShape = true; - } - if (this.nodeName == 'polygon' && tag == 'polygon') { - var prevData = extractElementData(element); - var prevPoints = prevData.attributes.points; - if (!convertEqualSidedPolygons) { - var nPrevPoints = prevPoints.split(' ').length; - var points = data$$1.attributes.points; - var nPoints = points.split(' ').length; - if (nPoints == nPrevPoints) { - convertShape = false; - convertPrevShape = false; - } - } - } - if (convertPrevShape) { - var prevPathData = data$$1.alternativeOld; - var pathElement = replaceElement(element, prevPathData); - pathElement.data([data$$1], function () { - return data$$1.key; - }); - element = pathElement; - } - if (convertShape) { - var newPathData = data$$1.alternativeNew; - tag = 'path'; - attributes = newPathData.attributes; - } - } - var elementTransition = element; - if (transitionInstance) { - elementTransition = elementTransition.transition(transitionInstance); - if (fade) { - elementTransition.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).style("opacity", 1.0); - } - elementTransition.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).on("end", function () { - d3.select(this).attr('style', null); - }); - } - var growThisPath = growEnteringEdges && tag == 'path' && data$$1.offset; - if (growThisPath) { - var totalLength = data$$1.totalLength; - element.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).attr('transform', 'translate(' + data$$1.offset.x + ',' + data$$1.offset.y + ')'); - attributes["stroke-dashoffset"] = 0; - attributes['transform'] = 'translate(0,0)'; - elementTransition.attr("stroke-dashoffset", attributes["stroke-dashoffset"]).attr('transform', attributes['transform']).on("start", function () { - d3.select(this).style('opacity', null); - }).on("end", function () { - d3.select(this).attr('stroke-dashoffset', null).attr('stroke-dasharray', null).attr('transform', null); - }); - } - var moveThisPolygon = growEnteringEdges && tag == 'polygon' && isEdgeElement(data$$1) && data$$1.offset; - if (moveThisPolygon) { - var edgePath = d3.select(element.node().parentNode.querySelector("path")); - var p0 = edgePath.node().getPointAtLength(0); - var p1 = edgePath.node().getPointAtLength(data$$1.totalLength); - var p2 = edgePath.node().getPointAtLength(data$$1.totalLength - 1); - var angle1 = Math.atan2(p1.y - p2.y, p1.x - p2.x) * 180 / Math.PI; - var x = p0.x - p1.x + data$$1.offset.x; - var y = p0.y - p1.y + data$$1.offset.y; - element.attr('transform', 'translate(' + x + ',' + y + ')'); - elementTransition.attrTween("transform", function () { - return function (t) { - var p = edgePath.node().getPointAtLength(data$$1.totalLength * t); - var p2 = edgePath.node().getPointAtLength(data$$1.totalLength * t + 1); - var angle = Math.atan2(p2.y - p.y, p2.x - p.x) * 180 / Math.PI - angle1; - x = p.x - p1.x + data$$1.offset.x * (1 - t); - y = p.y - p1.y + data$$1.offset.y * (1 - t); - return 'translate(' + x + ',' + y + ') rotate(' + angle + ' ' + p1.x + ' ' + p1.y + ')'; - }; - }).on("start", function () { - d3.select(this).style('opacity', null); - }).on("end", function () { - d3.select(this).attr('transform', null); - }); - } - var tweenThisPath = tweenPaths && transitionInstance && tag == 'path' && element.attr('d') != null; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = Object.keys(attributes)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attributeName = _step2.value; - - var attributeValue = attributes[attributeName]; - if (tweenThisPath && attributeName == 'd') { - var points = (data$$1.alternativeOld || data$$1).points; - if (points) { - elementTransition.attrTween("d", pathTween(points, attributeValue)); - } - } else { - if (attributeName == 'transform' && data$$1.translation) { - if (transitionInstance) { - var onEnd = elementTransition.on("end"); - elementTransition.on("start", function () { - if (graphvizInstance._zoomBehavior) { - // Update the transform to transition to, just before the transition starts - // in order to catch changes between the transition scheduling to its start. - elementTransition.tween("attr.transform", function () { - var node = this; - return function (t) { - node.setAttribute("transform", d3Interpolate.interpolateTransformSvg(d3Zoom.zoomTransform(graphvizInstance._zoomSelection.node()).toString(), getTranslatedZoomTransform.call(graphvizInstance, element).toString())(t)); - }; - }); - } - }).on("end", function () { - onEnd.call(this); - // Update the zoom transform to the new translated transform - if (graphvizInstance._zoomBehavior) { - translateZoomBehaviorTransform.call(graphvizInstance, element); - } - }); - } else { - if (graphvizInstance._zoomBehavior) { - // Update the transform attribute to set with the current pan translation - attributeValue = getTranslatedZoomTransform.call(graphvizInstance, element).toString(); - } - } - } - elementTransition.attr(attributeName, attributeValue); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - if (convertShape) { - elementTransition.on("end", function (d, i, nodes) { - pathElement = d3.select(this); - var newElement = replaceElement(pathElement, d); - newElement.data([d], function () { - return d.key; - }); - }); - } - if (data$$1.text) { - elementTransition.text(data$$1.text); - } - insertChildren(element); - } - - var root = this._selection; - - if (transitionInstance != null) { - // Ensure original SVG shape elements are restored after transition before rendering new graph - var jobs = this._jobs; - if (graphvizInstance._active) { - jobs.push(null); - return this; - } else { - root.transition(transitionInstance).transition().duration(0).on("end", function () { - graphvizInstance._active = false; - if (jobs.length != 0) { - jobs.shift(); - graphvizInstance.render(); - } - }); - this._active = true; - } - } - - if (transitionInstance != null) { - root.transition(transitionInstance).on("start", function () { - graphvizInstance._dispatch.call('transitionStart', graphvizInstance); - }).on("end", function () { - graphvizInstance._dispatch.call('transitionEnd', graphvizInstance); - }).transition().duration(0).on("start", function () { - graphvizInstance._dispatch.call('restoreEnd', graphvizInstance); - graphvizInstance._dispatch.call('end', graphvizInstance); - if (callback) { - callback.call(graphvizInstance); - } - }); - } - - var data$$1 = this._data; - - var svg = root.selectAll("svg").data([data$$1], function (d) { - return d.key; - }); - svg = svg.enter().append("svg").merge(svg); - - attributeElement$$1.call(svg.node(), data$$1); - - if (this._options.zoom && !this._zoomBehavior) { - createZoomBehavior.call(this); - } - - graphvizInstance._dispatch.call('renderEnd', graphvizInstance); - - if (transitionInstance == null) { - this._dispatch.call('end', this); - if (callback) { - callback.call(this); - } - } - - return this; - } - - function convertToPathData(originalData, guideData) { - if (originalData.tag == 'polygon') { - var newData = shallowCopyObject(originalData); - newData.tag = 'path'; - var originalAttributes = originalData.attributes; - var newAttributes = shallowCopyObject(originalAttributes); - var newPointsString = originalAttributes.points; - if (guideData.tag == 'polygon') { - var bbox = originalData.bbox; - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - var pointsString = originalAttributes.points; - var pointStrings = pointsString.split(' '); - var normPoints = pointStrings.map(function (p) { - var xy = p.split(',');return [xy[0] - bbox.cx, xy[1] - bbox.cy]; - }); - var x0 = normPoints[normPoints.length - 1][0]; - var y0 = normPoints[normPoints.length - 1][1]; - for (var i = 0; i < normPoints.length; i++, x0 = x1, y0 = y1) { - var x1 = normPoints[i][0]; - var y1 = normPoints[i][1]; - var dx = x1 - x0; - var dy = y1 - y0; - if (dy == 0) { - continue; - } else { - var x2 = x0 - y0 * dx / dy; - } - if (0 <= x2 && x2 < Infinity && (x0 <= x2 && x2 <= x1 || x1 <= x2 && x2 <= x0)) { - break; - } - } - var newPointStrings = [[bbox.cx + x2, bbox.cy + 0].join(',')]; - newPointStrings = newPointStrings.concat(pointStrings.slice(i)); - newPointStrings = newPointStrings.concat(pointStrings.slice(0, i)); - newPointsString = newPointStrings.join(' '); - } - newAttributes['d'] = 'M' + newPointsString + 'z'; - delete newAttributes.points; - newData.attributes = newAttributes; - } else /* if (originalData.tag == 'ellipse') */{ - var newData = shallowCopyObject(originalData); - newData.tag = 'path'; - var originalAttributes = originalData.attributes; - var newAttributes = shallowCopyObject(originalAttributes); - var cx = originalAttributes.cx; - var cy = originalAttributes.cy; - var rx = originalAttributes.rx; - var ry = originalAttributes.ry; - if (guideData.tag == 'polygon') { - var bbox = guideData.bbox; - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - var p = guideData.attributes.points.split(' ')[0].split(','); - var sx = p[0]; - var sy = p[1]; - var dx = sx - bbox.cx; - var dy = sy - bbox.cy; - var l = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); - var cosA = dx / l; - var sinA = -dy / l; - } else { - // if (guideData.tag == 'path') { - // FIXME: add support for getting start position from path - var cosA = 1; - var sinA = 0; - } - var x1 = rx * cosA; - var y1 = -ry * sinA; - var x2 = rx * -cosA; - var y2 = -ry * -sinA; - var dx = x2 - x1; - var dy = y2 - y1; - newAttributes['d'] = 'M ' + cx + ' ' + cy + ' m ' + x1 + ',' + y1 + ' a ' + rx + ',' + ry + ' 0 1,0 ' + dx + ',' + dy + ' a ' + rx + ',' + ry + ' 0 1,0 ' + -dx + ',' + -dy + 'z'; - delete newAttributes.cx; - delete newAttributes.cy; - delete newAttributes.rx; - delete newAttributes.ry; - newData.attributes = newAttributes; - } - return newData; - } - - function translatePointsAttribute(pointsString, x, y) { - var pointStrings = pointsString.split(' '); - var points = pointStrings.map(function (p) { - return p.split(','); - }); - var points = pointStrings.map(function (p) { - return [roundTo4Decimals(+x + +p.split(',')[0]), roundTo4Decimals(+y + +p.split(',')[1])]; - }); - var pointStrings = points.map(function (p) { - return p.join(','); - }); - var pointsString = pointStrings.join(' '); - pointsString = pointsString.replace(/-0\./g, '-.').replace(/ 0\./g, ' .'); - return pointsString; - } - - function translateDAttribute(d, x, y) { - var pointStrings = d.split(/[A-Z ]/); - pointStrings.shift(); - var commands = d.split(/[^[A-Z ]+/); - var points = pointStrings.map(function (p) { - return p.split(','); - }); - var points = pointStrings.map(function (p) { - return [roundTo4Decimals(+x + +p.split(',')[0]), roundTo4Decimals(+y + +p.split(',')[1])]; - }); - var pointStrings = points.map(function (p) { - return p.join(','); - }); - d = commands.reduce(function (arr, v, i) { - return arr.concat(v, pointStrings[i]); - }, []).join(''); - d = d.replace(/-0\./g, '-.').replace(/ 0\./g, ' .'); - return d; - } - - function initViz() { - // force JIT compilation of Viz.js - if (this._worker == null) { - Viz(""); - this._dispatch.call("initEnd", this); - } else { - var vizURL = this._vizURL; - var graphvizInstance = this; - this._worker.onmessage = function (event$$1) { - graphvizInstance._dispatch.call("initEnd", this); - }; - if (!vizURL.match(/^https?:\/\/|^\/\//i)) { - // Local URL. Prepend with local domain to be usable in web worker - vizURL = new window.URL(vizURL, document.location.href).href; - } - this._worker.postMessage({ dot: "", vizURL: vizURL }); - } - } - - var dot = function (src, callback) { - - var graphvizInstance = this; - var worker = this._worker; - var engine = this._options.engine; - var images = this._images; - var totalMemory = this._options.totalMemory; - var keyMode = this._options.keyMode; - var tweenPaths = this._options.tweenPaths; - var tweenShapes = this._options.tweenShapes; - if (typeof this._options.tweenPrecision == 'string' && this._options.tweenPrecision.includes('%')) { - var tweenPrecision = +this._options.tweenPrecision.split('%')[0] / 100; - var tweenPrecisionIsRelative = this._options.tweenPrecision.includes('%'); - } else { - var tweenPrecision = this._options.tweenPrecision; - var tweenPrecisionIsRelative = false; - } - var growEnteringEdges = this._options.growEnteringEdges; - var dictionary = {}; - var prevDictionary = this._dictionary || {}; - var nodeDictionary = {}; - var prevNodeDictionary = this._nodeDictionary || {}; - - function setKey(datum, index) { - var tag = datum.tag; - if (keyMode == 'index') { - datum.key = index; - } else if (tag[0] != '#') { - if (keyMode == 'id') { - datum.key = datum.attributes.id; - } else if (keyMode == 'title') { - var title = datum.children.find(function (childData) { - return childData.tag == 'title'; - }); - if (title) { - if (title.children.length > 0) { - datum.key = title.children[0].text; - } else { - datum.key = ''; - } - } - } - } - if (datum.key == null) { - if (tweenShapes) { - if (tag == 'ellipse' || tag == 'polygon') { - tag = 'path'; - } - } - datum.key = tag + '-' + index; - } - } - - function setId(datum, parentData) { - var id = (parentData ? parentData.id + '.' : '') + datum.key; - datum.id = id; - } - - function addToDictionary(datum) { - dictionary[datum.id] = datum; - } - - function calculateAlternativeShapeData(datum, prevDatum) { - if (tweenShapes && datum.id in prevDictionary) { - if ((prevDatum.tag == 'polygon' || prevDatum.tag == 'ellipse' || prevDatum.tag == 'path') && (prevDatum.tag != datum.tag || datum.tag == 'polygon')) { - if (prevDatum.tag != 'path') { - datum.alternativeOld = convertToPathData(prevDatum, datum); - } - if (datum.tag != 'path') { - datum.alternativeNew = convertToPathData(datum, prevDatum); - } - } - } - } - - function calculatePathTweenPoints(datum, prevDatum) { - if (tweenPaths && prevDatum && (prevDatum.tag == 'path' || datum.alternativeOld && datum.alternativeOld.tag == 'path')) { - var attribute_d = (datum.alternativeNew || datum).attributes.d; - if (datum.alternativeOld) { - var oldNode = createElementWithAttributes(datum.alternativeOld); - } else { - var oldNode = createElementWithAttributes(prevDatum); - } - (datum.alternativeOld || (datum.alternativeOld = {})).points = pathTweenPoints(oldNode, attribute_d, tweenPrecision, tweenPrecisionIsRelative); - } - } - - function postProcessDataPass1Local(datum) { - var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var parentData = arguments[2]; - - setKey(datum, index); - setId(datum, parentData); - var id = datum.id; - var prevDatum = prevDictionary[id]; - addToDictionary(datum); - calculateAlternativeShapeData(datum, prevDatum); - calculatePathTweenPoints(datum, prevDatum); - var childTagIndexes = {}; - datum.children.forEach(function (childData) { - var childTag = childData.tag; - if (childTag == 'ellipse' || childTag == 'polygon') { - childTag = 'path'; - } - if (childTagIndexes[childTag] == null) { - childTagIndexes[childTag] = 0; - } - var childIndex = childTagIndexes[childTag]++; - postProcessDataPass1Local(childData, childIndex, datum); - }); - } - - function addToNodeDictionary(datum) { - var tag = datum.tag; - if (growEnteringEdges && datum.parent) { - if (datum.parent.attributes.class == 'node') { - if (tag == 'title') { - if (datum.children.length > 0) { - var child = datum.children[0]; - var nodeId = child.text; - } else { - var nodeId = ''; - } - nodeDictionary[nodeId] = datum.parent; - } - } - } - } - - function extractGrowingEdgesData(datum) { - var id = datum.id; - var tag = datum.tag; - var prevDatum = prevDictionary[id]; - if (growEnteringEdges && !prevDatum && datum.parent) { - if (isEdgeElement(datum)) { - if (tag == 'path' || tag == 'polygon') { - if (tag == 'polygon') { - var path$$1 = datum.parent.children.find(function (e) { - return e.tag == 'path'; - }); - datum.totalLength = path$$1.totalLength; - } - var title = getEdgeTitle(datum); - var child = title.children[0]; - var nodeIds = child.text.split('->'); - if (nodeIds.length != 2) { - nodeIds = child.text.split('--'); - } - var startNodeId = nodeIds[0]; - var startNode = nodeDictionary[startNodeId]; - var prevStartNode = prevNodeDictionary[startNodeId]; - if (prevStartNode) { - var i = startNode.children.findIndex(function (element, index) { - return element.tag == 'g'; - }); - if (i >= 0) { - var j = startNode.children[i].children.findIndex(function (element, index) { - return element.tag == 'a'; - }); - startNode = startNode.children[i].children[j]; - } - var i = prevStartNode.children.findIndex(function (element, index) { - return element.tag == 'g'; - }); - if (i >= 0) { - var j = prevStartNode.children[i].children.findIndex(function (element, index) { - return element.tag == 'a'; - }); - prevStartNode = prevStartNode.children[i].children[j]; - } - var startShapes = startNode.children; - for (var i = 0; i < startShapes.length; i++) { - if (startShapes[i].tag == 'polygon' || startShapes[i].tag == 'ellipse' || startShapes[i].tag == 'path' || startShapes[i].tag == 'text') { - var startShape = startShapes[i]; - break; - } - } - var prevStartShapes = prevStartNode.children; - for (var i = 0; i < prevStartShapes.length; i++) { - if (prevStartShapes[i].tag == 'polygon' || prevStartShapes[i].tag == 'ellipse' || prevStartShapes[i].tag == 'path' || prevStartShapes[i].tag == 'text') { - var prevStartShape = prevStartShapes[i]; - break; - } - } - if (prevStartShape && startShape) { - datum.offset = { - x: prevStartShape.center.x - startShape.center.x, - y: prevStartShape.center.y - startShape.center.y - }; - } else { - datum.offset = { x: 0, y: 0 }; - } - } - } - } - } - } - - function postProcessDataPass2Global(datum) { - addToNodeDictionary(datum); - extractGrowingEdgesData(datum); - datum.children.forEach(function (childData) { - postProcessDataPass2Global(childData); - }); - } - - this._dispatch.call("start", this); - this._busy = true; - this._dispatch.call("layoutStart", this); - var vizOptions = { - format: "svg", - engine: engine, - images: images, - totalMemory: totalMemory - }; - if (this._worker) { - worker.postMessage({ - dot: src, - options: vizOptions - }); - - worker.onmessage = function (event$$1) { - switch (event$$1.data.type) { - case "done": - return layoutDone.call(graphvizInstance, event$$1.data.svg); - case "error": - if (graphvizInstance._onerror) { - graphvizInstance._onerror(event$$1.data.error); - } else { - throw event$$1.data.error; - } - break; - } - }; - } else { - try { - var svgDoc = Viz(src, vizOptions); - } catch (error) { - if (graphvizInstance._onerror) { - graphvizInstance._onerror(error.message); - return this; - } else { - throw error.message; - } - } - layoutDone.call(this, svgDoc); - } - - function layoutDone(svgDoc) { - this._dispatch.call("layoutEnd", this); - - var newDoc = d3.select(document.createDocumentFragment()).append('div'); - - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - - newDoc.append(function () { - return doc.documentElement; - }); - - var newSvg = newDoc.select('svg'); - - var data$$1 = extractAllElementsData(newSvg); - this._dispatch.call('dataExtractEnd', this); - postProcessDataPass1Local(data$$1); - this._dispatch.call('dataProcessPass1End', this); - postProcessDataPass2Global(data$$1); - this._dispatch.call('dataProcessPass2End', this); - this._data = data$$1; - this._dictionary = dictionary; - this._nodeDictionary = nodeDictionary; - - this._extractData = function (element, childIndex, parentData) { - var data$$1 = extractAllElementsData(element); - postProcessDataPass1Local(data$$1, childIndex, parentData); - postProcessDataPass2Global(data$$1); - return data$$1; - }; - this._busy = false; - this._dispatch.call('dataProcessEnd', this); - if (callback) { - callback.call(this); - } - if (this._queue.length > 0) { - var job = this._queue.shift(); - job.call(this); - } - } - - return this; - }; - - var renderDot = function (src, callback) { - - var graphvizInstance = this; - - this.dot(src, render); - - function render() { - graphvizInstance.render(callback); - } - - return this; - }; - - var transition$1 = function (name) { - - if (name instanceof Function) { - this._transitionFactory = name; - } else { - this._transition = d3Transition.transition(name); - } - - return this; - }; - - function active$1(name) { - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - if (svg.size() != 0) { - return d3Transition.active(svg.node(), name); - } else { - return null; - } - } - - var options = function (options) { - - if (typeof options == 'undefined') { - return Object.assign({}, this._options); - } else { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var option = _step.value; - - this._options[option] = options[option]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return this; - } - }; - - var width = function (width) { - - this._options.width = width; - - return this; - }; - - var height = function (height) { - - this._options.height = height; - - return this; - }; - - var scale = function (scale) { - - this._options.scale = scale; - - return this; - }; - - var fit = function (fit) { - - this._options.fit = fit; - - return this; - }; - - var attributer = function (callback) { - - this._attributer = callback; - - return this; - }; - - var engine = function (engine) { - - this._options.engine = engine; - - return this; - }; - - var images = function (path$$1, width, height) { - - this._images.push({ path: path$$1, width: width, height: height }); - - return this; - }; - - var totalMemory = function (size) { - - this._options.totalMemory = size; - - return this; - }; - - var keyMode = function (keyMode) { - - if (!this._keyModes.has(keyMode)) { - throw Error('Illegal keyMode: ' + keyMode); - } - if (keyMode != this._options.keyMode && this._data != null) { - throw Error('Too late to change keyMode'); - } - this._options.keyMode = keyMode; - - return this; - }; - - var fade = function (enable) { - - this._options.fade = enable; - - return this; - }; - - var tweenPaths = function (enable) { - - this._options.tweenPaths = enable; - - return this; - }; - - var tweenShapes = function (enable) { - - this._options.tweenShapes = enable; - if (enable) { - this._options.tweenPaths = true; - } - - return this; - }; - - var convertEqualSidedPolygons = function (enable) { - - this._options.convertEqualSidedPolygons = enable; - - return this; - }; - - var tweenPrecision = function (precision) { - - this._options.tweenPrecision = precision; - - return this; - }; - - var growEnteringEdges = function (enable) { - - this._options.growEnteringEdges = enable; - - return this; - }; - - var on = function (typenames, callback) { - - this._dispatch.on(typenames, callback); - - return this; - }; - - var onerror = function (callback) { - - this._onerror = callback; - - return this; - }; - - var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } - }; - - var logEvents = function (enable) { - var _this = this; - - var t0 = Date.now(); - var times = {}; - var eventTypes = this._eventTypes; - var maxEventTypeLength = Math.max.apply(Math, toConsumableArray(eventTypes.map(function (eventType) { - return eventType.length; - }))); - - var _loop = function _loop(i) { - var eventType = eventTypes[i]; - times[eventType] = []; - graphvizInstance = _this; - - _this.on(eventType + '.log', enable ? function () { - var t = Date.now(); - var seqNo = times[eventType].length; - times[eventType].push(t); - var string = ''; - string += 'Event '; - string += d3Format.format(' >2')(i) + ' '; - string += eventType + ' '.repeat(maxEventTypeLength - eventType.length); - string += d3Format.format(' >5')(t - t0) + ' '; - if (eventType != 'initEnd') { - string += d3Format.format(' >5')(t - times['start'][seqNo]); - } - if (eventType == 'dataProcessEnd') { - string += ' prepare ' + d3Format.format(' >5')(t - times['layoutEnd'][seqNo]); - } - if (eventType == 'renderEnd' && graphvizInstance._transition) { - string += ' transition start margin ' + d3Format.format(' >5')(graphvizInstance._transition.delay() - (t - times['renderStart'][seqNo])); - expectedDelay = graphvizInstance._transition.delay(); - expectedDuration = graphvizInstance._transition.duration(); - } - if (eventType == 'transitionStart') { - var actualDelay = t - times['renderStart'][seqNo]; - string += ' transition delay ' + d3Format.format(' >5')(t - times['renderStart'][seqNo]); - string += ' expected ' + d3Format.format(' >5')(expectedDelay); - string += ' diff ' + d3Format.format(' >5')(actualDelay - expectedDelay); - } - if (eventType == 'transitionEnd') { - var actualDuration = t - times['transitionStart'][seqNo]; - string += ' transition duration ' + d3Format.format(' >5')(actualDuration); - string += ' expected ' + d3Format.format(' >5')(expectedDuration); - string += ' diff ' + d3Format.format(' >5')(actualDuration - expectedDuration); - } - console.log(string); - t0 = t; - } : null); - }; - - for (var i in eventTypes) { - var graphvizInstance; - var expectedDelay; - var expectedDuration; - - _loop(i); - } - return this; - }; - - function rotate(x, y, cosA, sinA) { - // (x + j * y) * (cosA + j * sinA) = x * cosA - y * sinA + j * (x * sinA + y * cosA) - y = -y; - sinA = -sinA; - var _ref = [x * cosA - y * sinA, x * sinA + y * cosA]; - x = _ref[0]; - y = _ref[1]; - - y = -y; - return [x, y]; - } - - function drawEdge(x1, y1, x2, y2, attributes) { - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; - - attributes = Object.assign({}, attributes); - if (attributes.style && attributes.style.includes('invis')) { - var newEdge = d3.select(null); - } else { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var newEdge0 = createEdge(attributes); - var edgeData = extractAllElementsData(newEdge0); - var newEdge = graph0.append('g').data([edgeData]); - attributeElement.call(newEdge.node(), edgeData); - _updateEdge(newEdge, x1, y1, x2, y2, attributes, options); - } - this._drawnEdge = { - g: newEdge, - x1: x1, - y1: y1, - x2: x2, - y2: y2, - attributes: attributes - }; - - return this; - } - - function updateDrawnEdge(x1, y1, x2, y2) { - var attributes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - var edge = this._drawnEdge.g; - attributes = Object.assign(this._drawnEdge.attributes, attributes); - this._drawnEdge.x1 = x1; - this._drawnEdge.y1 = y1; - this._drawnEdge.x2 = x2; - this._drawnEdge.y2 = y2; - if (edge.empty() && !(attributes.style && attributes.style.includes('invis'))) { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var edge = graph0.append('g'); - this._drawnEdge.g = edge; - } - if (!edge.empty()) { - _updateEdge(edge, x1, y1, x2, y2, attributes, options); - } - - return this; - } - - function _updateEdge(edge, x1, y1, x2, y2, attributes, options) { - - var newEdge = createEdge(attributes); - var edgeData = extractAllElementsData(newEdge); - edge.data([edgeData]); - attributeElement.call(edge.node(), edgeData); - _moveEdge(edge, x1, y1, x2, y2, attributes, options); - } - - function _moveEdge(edge, x1, y1, x2, y2, attributes, options) { - - var shortening = options.shortening || 0; - var arrowHeadLength = 10; - var arrowHeadWidth = 7; - var margin = 0.174; - - var arrowHeadPoints = [[0, -arrowHeadWidth / 2], [arrowHeadLength, 0], [0, arrowHeadWidth / 2], [0, -arrowHeadWidth / 2]]; - - var dx = x2 - x1; - var dy = y2 - y1; - var length = Math.sqrt(dx * dx + dy * dy); - if (length == 0) { - var cosA = 1; - var sinA = 0; - } else { - var cosA = dx / length; - var sinA = dy / length; - } - x2 = x1 + (length - shortening - arrowHeadLength - margin) * cosA; - y2 = y1 + (length - shortening - arrowHeadLength - margin) * sinA; - - if (attributes.URL || attributes.tooltip) { - var a = edge.selectWithoutDataPropagation("g").selectWithoutDataPropagation("a"); - var line = a.selectWithoutDataPropagation("path"); - var arrowHead = a.selectWithoutDataPropagation("polygon"); - } else { - var line = edge.selectWithoutDataPropagation("path"); - var arrowHead = edge.selectWithoutDataPropagation("polygon"); - } - - var path1 = d3Path.path(); - path1.moveTo(x1, y1); - path1.lineTo(x2, y2); - - line.attr("d", path1); - - x2 = x1 + (length - shortening - arrowHeadLength) * cosA; - y2 = y1 + (length - shortening - arrowHeadLength) * sinA; - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - arrowHeadPoints[i] = rotate(point[0], point[1], cosA, sinA); - } - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - arrowHeadPoints[i] = [x2 + point[0], y2 + point[1]]; - } - var allPoints = []; - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - allPoints.push(point.join(',')); - } - var pointsAttr = allPoints.join(' '); - - arrowHead.attr("points", pointsAttr); - - return this; - } - - function moveDrawnEdgeEndPoint(x2, y2) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - var edge = this._drawnEdge.g; - var x1 = this._drawnEdge.x1; - var y1 = this._drawnEdge.y1; - var attributes = this._drawnEdge.attributes; - - this._drawnEdge.x2 = x2; - this._drawnEdge.y2 = y2; - _moveEdge(edge, x1, y1, x2, y2, attributes, options); - - return this; - } - - function removeDrawnEdge() { - - if (!this._drawnEdge) { - return this; - } - - var edge = this._drawnEdge.g; - - edge.remove(); - - this._drawnEdge = null; - - return this; - } - - function insertDrawnEdge(name) { - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - - var edge = this._drawnEdge.g; - if (edge.empty()) { - return this; - } - this._drawnEdge.attributes; - - var title = edge.selectWithoutDataPropagation("title"); - title.text(name); - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var graph0Datum = graph0.datum(); - var edgeData = this._extractData(edge, graph0Datum.children.length, graph0.datum()); - graph0Datum.children.push(edgeData); - - insertAllElementsData(edge, edgeData); - - this._drawnEdge = null; - - return this; - } - - function drawnEdgeSelection() { - - if (this._drawnEdge) { - return this._drawnEdge.g; - } else { - return d3.select(null); - } - } - - function createEdge(attributes) { - var attributesString = ''; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var name = _step.value; - - if (attributes[name] != null) { - attributesString += ' "' + name + '"="' + attributes[name] + '"'; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var dotSrc = 'digraph {a -> b [' + attributesString + ']}'; - var svgDoc = Viz(dotSrc, { format: 'svg' }); - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - var newDoc = d3.select(document.createDocumentFragment()).append(function () { - return doc.documentElement; - }); - var edge = newDoc.select('.edge'); - - return edge; - } - - function drawNode(x, y, nodeId) { - var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - attributes = Object.assign({}, attributes); - if (attributes.style && attributes.style.includes('invis')) { - var newNode = d3.select(null); - } else { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var newNode0 = createNode(nodeId, attributes); - var nodeData = extractAllElementsData(newNode0); - var newNode = graph0.append('g').data([nodeData]); - attributeElement.call(newNode.node(), nodeData); - _updateNode(newNode, x, y, nodeId, attributes); - } - this._drawnNode = { - g: newNode, - nodeId: nodeId, - x: x, - y: y, - attributes: attributes - }; - - return this; - } - - function updateDrawnNode(x, y, nodeId) { - var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - - var node = this._drawnNode.g; - if (nodeId == null) { - nodeId = this._drawnNode.nodeId; - } - attributes = Object.assign(this._drawnNode.attributes, attributes); - this._drawnNode.nodeId = nodeId; - this._drawnNode.x = x; - this._drawnNode.y = y; - if (node.empty() && !(attributes.style && attributes.style.includes('invis'))) { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var node = graph0.append('g'); - this._drawnNode.g = node; - } - if (!node.empty()) { - _updateNode(node, x, y, nodeId, attributes); - } - - return this; - } - - function _updateNode(node, x, y, nodeId, attributes, options) { - - var newNode = createNode(nodeId, attributes); - var nodeData = extractAllElementsData(newNode); - node.data([nodeData]); - attributeElement.call(node.node(), nodeData); - _moveNode(node, x, y, attributes); - - return this; - } - - function _moveNode(node, x, y, attributes, options) { - if (attributes.URL || attributes.tooltip) { - var subParent = node.selectWithoutDataPropagation("g").selectWithoutDataPropagation("a"); - } else { - var subParent = node; - } - var svgElements = subParent.selectAll('ellipse,polygon,path,polyline'); - var text = node.selectWithoutDataPropagation("text"); - - if (svgElements.size() != 0) { - var bbox = svgElements.node().getBBox(); - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - } else if (text.size() != 0) { - bbox = { - x: +text.attr('x'), - y: +text.attr('y'), - width: 0, - height: 0, - cx: +text.attr('x'), - cy: +text.attr('y') - }; - } - svgElements.each(function (data, index) { - var svgElement = d3.select(this); - if (svgElement.attr("cx")) { - svgElement.attr("cx", roundTo4Decimals(x)).attr("cy", roundTo4Decimals(y)); - } else if (svgElement.attr("points")) { - var pointsString = svgElement.attr('points').trim(); - svgElement.attr("points", translatePointsAttribute(pointsString, x - bbox.cx, y - bbox.cy)); - } else { - var d = svgElement.attr('d'); - svgElement.attr("d", translateDAttribute(d, x - bbox.cx, y - bbox.cy)); - } - }); - - if (text.size() != 0) { - text.attr("x", roundTo4Decimals(+text.attr("x") + x - bbox.cx)).attr("y", roundTo4Decimals(+text.attr("y") + y - bbox.cy)); - } - return this; - } - - function moveDrawnNode(x, y) { - - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - var node = this._drawnNode.g; - var attributes = this._drawnNode.attributes; - - this._drawnNode.x = x; - this._drawnNode.y = y; - - if (!node.empty()) { - _moveNode(node, x, y, attributes); - } - - return this; - } - - function removeDrawnNode() { - - if (!this._drawnNode) { - return this; - } - - var node = this._drawnNode.g; - - if (!node.empty()) { - node.remove(); - } - - this._drawnNode = null; - - return this; - } - - function insertDrawnNode(nodeId) { - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - - if (nodeId == null) { - nodeId = this._drawnNode.nodeId; - } - var node = this._drawnNode.g; - if (node.empty()) { - return this; - } - var attributes = this._drawnNode.attributes; - - var title = node.selectWithoutDataPropagation("title"); - title.text(nodeId); - if (attributes.URL || attributes.tooltip) { - var ga = node.selectWithoutDataPropagation("g"); - var a = ga.selectWithoutDataPropagation("a"); - a.selectWithoutDataPropagation('ellipse,polygon,path,polyline'); - var text = a.selectWithoutDataPropagation('text'); - } else { - node.selectWithoutDataPropagation('ellipse,polygon,path,polyline'); - var text = node.selectWithoutDataPropagation('text'); - } - text.text(attributes.label || nodeId); - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var graph0Datum = graph0.datum(); - var nodeData = this._extractData(node, graph0Datum.children.length, graph0.datum()); - graph0Datum.children.push(nodeData); - - insertAllElementsData(node, nodeData); - - this._drawnNode = null; - - return this; - } - - function drawnNodeSelection() { - - if (this._drawnNode) { - return this._drawnNode.g; - } else { - return d3.select(null); - } - } - - function createNode(nodeId, attributes) { - var attributesString = ''; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var name = _step.value; - - if (attributes[name] != null) { - attributesString += ' "' + name + '"="' + attributes[name] + '"'; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var dotSrc = 'graph {"' + nodeId + '" [' + attributesString + ']}'; - var svgDoc = Viz(dotSrc, { format: 'svg' }); - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - var newDoc = d3.select(document.createDocumentFragment()).append(function () { - return doc.documentElement; - }); - var node = newDoc.select('.node'); - - return node; - } - - var _graphviz$prototype; - - function Graphviz(selection$$1, options$$1) { - this._options = { - useWorker: true, - engine: 'dot', - totalMemory: undefined, - keyMode: 'title', - fade: true, - tweenPaths: true, - tweenShapes: true, - convertEqualSidedPolygons: true, - tweenPrecision: 1, - growEnteringEdges: true, - zoom: true, - zoomScaleExtent: [0.1, 10], - zoomTranslateExtent: [[-Infinity, -Infinity], [+Infinity, +Infinity]], - width: null, - height: null, - scale: 1, - fit: false - }; - if (options$$1 instanceof Object) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(options$$1)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var option = _step.value; - - this._options[option] = options$$1[option]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } else if (typeof options$$1 == 'boolean') { - this._options.useWorker = options$$1; - } - var useWorker = this._options.useWorker; - if (typeof Worker == 'undefined') { - useWorker = false; - } - if (useWorker) { - var scripts = d3.selectAll('script'); - var vizScript = scripts.filter(function () { - return d3.select(this).attr('type') == 'javascript/worker' || d3.select(this).attr('src') && d3.select(this).attr('src').match(/.*\/viz.js$/); - }); - if (vizScript.size() == 0) { - console.warn('No script tag of type "javascript/worker" was found and "useWorker" is true. Not using web worker.'); - useWorker = false; - } else { - this._vizURL = vizScript.attr('src'); - if (!this._vizURL) { - console.warn('No "src" attribute of was found on the "javascript/worker" script tag and "useWorker" is true. Not using web worker.'); - useWorker = false; - } - } - } - if (useWorker) { - var js = "\n onmessage = function(event) {\n if (event.data.vizURL) {\n importScripts(event.data.vizURL);\n }\n try {\n var svg = Viz(event.data.dot, event.data.options);\n }\n catch(error) {\n postMessage({\n type: \"error\",\n error: error.message,\n });\n return;\n }\n if (svg) {\n postMessage({\n type: \"done\",\n svg: svg,\n });\n } else {\n postMessage({\n type: \"skip\",\n });\n }\n }\n "; - var blob = new Blob([js]); - var blobURL = window.URL.createObjectURL(blob); - this._worker = new Worker(blobURL); - } - this._selection = selection$$1; - this._active = false; - this._busy = false; - this._jobs = []; - this._queue = []; - this._keyModes = new Set(['title', 'id', 'tag-index', 'index']); - this._images = []; - this._translation = undefined; - this._scale = undefined; - this._eventTypes = ['initEnd', 'start', 'layoutStart', 'layoutEnd', 'dataExtractEnd', 'dataProcessPass1End', 'dataProcessPass2End', 'dataProcessEnd', 'renderStart', 'renderEnd', 'transitionStart', 'transitionEnd', 'restoreEnd', 'end']; - this._dispatch = d3Dispatch.dispatch.apply(undefined, toConsumableArray(this._eventTypes)); - initViz.call(this); - selection$$1.node().__graphviz__ = this; - } - - function graphviz(selector, options$$1) { - var g = d3.select(selector).graphviz(options$$1); - return g; - } - - Graphviz.prototype = graphviz.prototype = (_graphviz$prototype = { - constructor: Graphviz, - engine: engine, - addImage: images, - totalMemory: totalMemory, - keyMode: keyMode, - fade: fade, - tweenPaths: tweenPaths, - tweenShapes: tweenShapes, - convertEqualSidedPolygons: convertEqualSidedPolygons, - tweenPrecision: tweenPrecision, - growEnteringEdges: growEnteringEdges, - zoom: zoom$1, - resetZoom: resetZoom, - zoomBehavior: zoomBehavior, - zoomSelection: zoomSelection, - zoomScaleExtent: zoomScaleExtent, - zoomTranslateExtent: zoomTranslateExtent, - render: render, - dot: dot, - data: data, - renderDot: renderDot, - transition: transition$1, - active: active$1, - options: options, - width: width, - height: height, - scale: scale, - fit: fit, - attributer: attributer, - on: on, - onerror: onerror, - logEvents: logEvents, - drawEdge: drawEdge, - updateDrawnEdge: updateDrawnEdge, - moveDrawnEdgeEndPoint: moveDrawnEdgeEndPoint, - insertDrawnEdge: insertDrawnEdge, - removeDrawnEdge: removeDrawnEdge }, defineProperty(_graphviz$prototype, "removeDrawnEdge", removeDrawnEdge), defineProperty(_graphviz$prototype, "drawnEdgeSelection", drawnEdgeSelection), defineProperty(_graphviz$prototype, "drawnEdgeSelection", drawnEdgeSelection), defineProperty(_graphviz$prototype, "drawNode", drawNode), defineProperty(_graphviz$prototype, "updateDrawnNode", updateDrawnNode), defineProperty(_graphviz$prototype, "moveDrawnNode", moveDrawnNode), defineProperty(_graphviz$prototype, "insertDrawnNode", insertDrawnNode), defineProperty(_graphviz$prototype, "removeDrawnNode", removeDrawnNode), defineProperty(_graphviz$prototype, "removeDrawnNode", removeDrawnNode), defineProperty(_graphviz$prototype, "drawnNodeSelection", drawnNodeSelection), defineProperty(_graphviz$prototype, "drawnNodeSelection", drawnNodeSelection), _graphviz$prototype); - - var selection_graphviz = function (options) { - - var g = this.node().__graphviz__; - if (g) { - g.options(options); - g._dispatch.call("initEnd", this); - } else { - g = new Graphviz(this, options); - } - return g; - }; - - var selection_selectWithoutDataPropagation = function (name) { - - return d3.select(this.size() > 0 ? this.node().querySelector(name) : null); - }; - - d3.selection.prototype.graphviz = selection_graphviz; - d3.selection.prototype.selectWithoutDataPropagation = selection_selectWithoutDataPropagation; - - exports.graphviz = graphviz; - - Object.defineProperty(exports, '__esModule', { value: true }); - - }))); - }(d3Graphviz, d3Graphviz.exports)); - - var lodash_merge = {exports: {}}; - - /** - * Lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - (function (module, exports) { - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeMax = Math.max, - nativeNow = Date.now; - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } - - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; - } - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); - - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ - function constant(value) { - return function() { - return value; - }; - } - - /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ - function identity(value) { - return value; - } - - /** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ - function stubFalse() { - return false; - } - - module.exports = merge; - }(lodash_merge, lodash_merge.exports)); - - var hasOwn$1 = Object.prototype.hasOwnProperty; - var toString$i = Object.prototype.toString; - - var foreach$1 = function forEach (obj, fn, ctx) { - if (toString$i.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn$1.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } - }; - - var each$1 = foreach$1; - var jsonPointer$1 = api$1; - - - /** - * Convenience wrapper around the api. - * Calls `.get` when called with an `object` and a `pointer`. - * Calls `.set` when also called with `value`. - * If only supplied `object`, returns a partially applied function, mapped to the object. - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - * @returns {*} - */ - - function api$1 (obj, pointer, value) { - // .set() - if (arguments.length === 3) { - return api$1.set(obj, pointer, value); - } - // .get() - if (arguments.length === 2) { - return api$1.get(obj, pointer); - } - // Return a partially applied function on `obj`. - var wrapped = api$1.bind(api$1, obj); - - // Support for oo style - for (var name in api$1) { - if (api$1.hasOwnProperty(name)) { - wrapped[name] = api$1[name].bind(wrapped, obj); - } - } - return wrapped; - } - - - /** - * Lookup a json pointer in an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @returns {*} - */ - api$1.get = function get (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer); - - for (var i = 0; i < refTokens.length; ++i) { - var tok = refTokens[i]; - if (!(typeof obj == 'object' && tok in obj)) { - throw new Error('Invalid reference token: ' + tok); - } - obj = obj[tok]; - } - return obj; - }; - - /** - * Sets a value on an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - */ - api$1.set = function set (obj, pointer, value) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer), - nextTok = refTokens[0]; - - if (refTokens.length === 0) { - throw Error('Can not set the root object'); - } - - for (var i = 0; i < refTokens.length - 1; ++i) { - var tok = refTokens[i]; - if (typeof tok !== 'string' && typeof tok !== 'number') { - tok = String(tok); - } - if (tok === "__proto__" || tok === "constructor" || tok === "prototype") { - continue - } - if (tok === '-' && Array.isArray(obj)) { - tok = obj.length; - } - nextTok = refTokens[i + 1]; - - if (!(tok in obj)) { - if (nextTok.match(/^(\d+|-)$/)) { - obj[tok] = []; - } else { - obj[tok] = {}; - } - } - obj = obj[tok]; - } - if (nextTok === '-' && Array.isArray(obj)) { - nextTok = obj.length; - } - obj[nextTok] = value; - return this; - }; - - /** - * Removes an attribute - * - * @param {Object} obj - * @param {String|Array} pointer - */ - api$1.remove = function (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer); - var finalToken = refTokens[refTokens.length -1]; - if (finalToken === undefined) { - throw new Error('Invalid JSON pointer for remove: "' + pointer + '"'); - } - - var parent = api$1.get(obj, refTokens.slice(0, -1)); - if (Array.isArray(parent)) { - var index = +finalToken; - if (finalToken === '' && isNaN(index)) { - throw new Error('Invalid array index: "' + finalToken + '"'); - } - - Array.prototype.splice.call(parent, index, 1); - } else { - delete parent[finalToken]; - } - }; - - /** - * Returns a (pointer -> value) dictionary for an object - * - * @param obj - * @param {function} descend - * @returns {} - */ - api$1.dict = function dict (obj, descend) { - var results = {}; - api$1.walk(obj, function (value, pointer) { - results[pointer] = value; - }, descend); - return results; - }; - - /** - * Iterates over an object - * Iterator: function (value, pointer) {} - * - * @param obj - * @param {function} iterator - * @param {function} descend - */ - api$1.walk = function walk (obj, iterator, descend) { - var refTokens = []; - - descend = descend || function (value) { - var type = Object.prototype.toString.call(value); - return type === '[object Object]' || type === '[object Array]'; - }; - - (function next (cur) { - each$1(cur, function (value, key) { - refTokens.push(String(key)); - if (descend(value)) { - next(value); - } else { - iterator(value, api$1.compile(refTokens)); - } - refTokens.pop(); - }); - }(obj)); - }; - - /** - * Tests if an object has a value for a json pointer - * - * @param obj - * @param pointer - * @returns {boolean} - */ - api$1.has = function has (obj, pointer) { - try { - api$1.get(obj, pointer); - } catch (e) { - return false; - } - return true; - }; - - /** - * Escapes a reference token - * - * @param str - * @returns {string} - */ - api$1.escape = function escape (str) { - return str.toString().replace(/~/g, '~0').replace(/\//g, '~1'); - }; - - /** - * Unescapes a reference token - * - * @param str - * @returns {string} - */ - api$1.unescape = function unescape (str) { - return str.replace(/~1/g, '/').replace(/~0/g, '~'); - }; - - /** - * Converts a json pointer into a array of reference tokens - * - * @param pointer - * @returns {Array} - */ - api$1.parse = function parse (pointer) { - if (pointer === '') { return []; } - if (pointer.charAt(0) !== '/') { throw new Error('Invalid JSON pointer: ' + pointer); } - return pointer.substring(1).split(/\//).map(api$1.unescape); - }; - - /** - * Builds a json pointer from a array of reference tokens - * - * @param refTokens - * @returns {string} - */ - api$1.compile = function compile (refTokens) { - if (refTokens.length === 0) { return ''; } - return '/' + refTokens.map(api$1.escape).join('/'); - }; - - var duplex = {}; - - var helpers = {}; - - /*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017 Joachim Wester - * MIT license - */ - - var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(helpers, "__esModule", { value: true }); - var _hasOwnProperty = Object.prototype.hasOwnProperty; - function hasOwnProperty$3(obj, key) { - return _hasOwnProperty.call(obj, key); - } - helpers.hasOwnProperty = hasOwnProperty$3; - function _objectKeys(obj) { - if (Array.isArray(obj)) { - var keys = new Array(obj.length); - for (var k = 0; k < keys.length; k++) { - keys[k] = "" + k; - } - return keys; - } - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var i in obj) { - if (hasOwnProperty$3(obj, i)) { - keys.push(i); - } - } - return keys; - } - helpers._objectKeys = _objectKeys; - /** - * Deeply clone the object. - * https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy) - * @param {any} obj value to clone - * @return {any} cloned obj - */ - function _deepClone(obj) { - switch (typeof obj) { - case "object": - return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5 - case "undefined": - return null; //this is how JSON.stringify behaves for array items - default: - return obj; //no need to clone primitives - } - } - helpers._deepClone = _deepClone; - //3x faster than cached /^\d+$/.test(str) - function isInteger$1(str) { - var i = 0; - var len = str.length; - var charCode; - while (i < len) { - charCode = str.charCodeAt(i); - if (charCode >= 48 && charCode <= 57) { - i++; - continue; - } - return false; - } - return true; - } - helpers.isInteger = isInteger$1; - /** - * Escapes a json pointer path - * @param path The raw pointer - * @return the Escaped path - */ - function escapePathComponent(path) { - if (path.indexOf('/') === -1 && path.indexOf('~') === -1) - return path; - return path.replace(/~/g, '~0').replace(/\//g, '~1'); - } - helpers.escapePathComponent = escapePathComponent; - /** - * Unescapes a json pointer path - * @param path The escaped pointer - * @return The unescaped path - */ - function unescapePathComponent(path) { - return path.replace(/~1/g, '/').replace(/~0/g, '~'); - } - helpers.unescapePathComponent = unescapePathComponent; - function _getPathRecursive(root, obj) { - var found; - for (var key in root) { - if (hasOwnProperty$3(root, key)) { - if (root[key] === obj) { - return escapePathComponent(key) + '/'; - } - else if (typeof root[key] === 'object') { - found = _getPathRecursive(root[key], obj); - if (found != '') { - return escapePathComponent(key) + '/' + found; - } - } - } - } - return ''; - } - helpers._getPathRecursive = _getPathRecursive; - function getPath(root, obj) { - if (root === obj) { - return '/'; - } - var path = _getPathRecursive(root, obj); - if (path === '') { - throw new Error("Object not found in root"); - } - return '/' + path; - } - helpers.getPath = getPath; - /** - * Recursively checks whether an object has any undefined values inside. - */ - function hasUndefined(obj) { - if (obj === undefined) { - return true; - } - if (obj) { - if (Array.isArray(obj)) { - for (var i = 0, len = obj.length; i < len; i++) { - if (hasUndefined(obj[i])) { - return true; - } - } - } - else if (typeof obj === "object") { - var objKeys = _objectKeys(obj); - var objKeysLength = objKeys.length; - for (var i = 0; i < objKeysLength; i++) { - if (hasUndefined(obj[objKeys[i]])) { - return true; - } - } - } - } - return false; - } - helpers.hasUndefined = hasUndefined; - function patchErrorMessageFormatter(message, args) { - var messageParts = [message]; - for (var key in args) { - var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print - if (typeof value !== 'undefined') { - messageParts.push(key + ": " + value); - } - } - return messageParts.join('\n'); - } - var PatchError = /** @class */ (function (_super) { - __extends(PatchError, _super); - function PatchError(message, name, index, operation, tree) { - var _newTarget = this.constructor; - var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this; - _this.name = name; - _this.index = index; - _this.operation = operation; - _this.tree = tree; - Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359 - _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree }); - return _this; - } - return PatchError; - }(Error)); - helpers.PatchError = PatchError; - - var core$2 = {}; - - var isArray$h = Array.isArray; - var keyList = Object.keys; - var hasProp = Object.prototype.hasOwnProperty; - - var fastDeepEqual = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - var arrA = isArray$h(a) - , arrB = isArray$h(b) - , i - , length - , key; - - if (arrA && arrB) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - if (arrA != arrB) return false; - - var dateA = a instanceof Date - , dateB = b instanceof Date; - if (dateA != dateB) return false; - if (dateA && dateB) return a.getTime() == b.getTime(); - - var regexpA = a instanceof RegExp - , regexpB = b instanceof RegExp; - if (regexpA != regexpB) return false; - if (regexpA && regexpB) return a.toString() == b.toString(); - - var keys = keyList(a); - length = keys.length; - - if (length !== keyList(b).length) - return false; - - for (i = length; i-- !== 0;) - if (!hasProp.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - key = keys[i]; - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - return a!==a && b!==b; - }; - - (function (exports) { - Object.defineProperty(exports, "__esModule", { value: true }); - var areEquals = fastDeepEqual; - var helpers_1 = helpers; - exports.JsonPatchError = helpers_1.PatchError; - exports.deepClone = helpers_1._deepClone; - /* We use a Javascript hash to store each - function. Each hash entry (property) uses - the operation identifiers specified in rfc6902. - In this way, we can map each patch operation - to its dedicated function in efficient way. - */ - /* The operations applicable to an object */ - var objOps = { - add: function (obj, key, document) { - obj[key] = this.value; - return { newDocument: document }; - }, - remove: function (obj, key, document) { - var removed = obj[key]; - delete obj[key]; - return { newDocument: document, removed: removed }; - }, - replace: function (obj, key, document) { - var removed = obj[key]; - obj[key] = this.value; - return { newDocument: document, removed: removed }; - }, - move: function (obj, key, document) { - /* in case move target overwrites an existing value, - return the removed value, this can be taxing performance-wise, - and is potentially unneeded */ - var removed = getValueByPointer(document, this.path); - if (removed) { - removed = helpers_1._deepClone(removed); - } - var originalValue = applyOperation(document, { op: "remove", path: this.from }).removed; - applyOperation(document, { op: "add", path: this.path, value: originalValue }); - return { newDocument: document, removed: removed }; - }, - copy: function (obj, key, document) { - var valueToCopy = getValueByPointer(document, this.from); - // enforce copy by value so further operations don't affect source (see issue #177) - applyOperation(document, { op: "add", path: this.path, value: helpers_1._deepClone(valueToCopy) }); - return { newDocument: document }; - }, - test: function (obj, key, document) { - return { newDocument: document, test: areEquals(obj[key], this.value) }; - }, - _get: function (obj, key, document) { - this.value = obj[key]; - return { newDocument: document }; - } - }; - /* The operations applicable to an array. Many are the same as for the object */ - var arrOps = { - add: function (arr, i, document) { - if (helpers_1.isInteger(i)) { - arr.splice(i, 0, this.value); - } - else { // array props - arr[i] = this.value; - } - // this may be needed when using '-' in an array - return { newDocument: document, index: i }; - }, - remove: function (arr, i, document) { - var removedList = arr.splice(i, 1); - return { newDocument: document, removed: removedList[0] }; - }, - replace: function (arr, i, document) { - var removed = arr[i]; - arr[i] = this.value; - return { newDocument: document, removed: removed }; - }, - move: objOps.move, - copy: objOps.copy, - test: objOps.test, - _get: objOps._get - }; - /** - * Retrieves a value from a JSON document by a JSON pointer. - * Returns the value. - * - * @param document The document to get the value from - * @param pointer an escaped JSON pointer - * @return The retrieved value - */ - function getValueByPointer(document, pointer) { - if (pointer == '') { - return document; - } - var getOriginalDestination = { op: "_get", path: pointer }; - applyOperation(document, getOriginalDestination); - return getOriginalDestination.value; - } - exports.getValueByPointer = getValueByPointer; - /** - * Apply a single JSON Patch Operation on a JSON document. - * Returns the {newDocument, result} of the operation. - * It modifies the `document` and `operation` objects - it gets the values by reference. - * If you would like to avoid touching your values, clone them: - * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`. - * - * @param document The document to patch - * @param operation The operation to apply - * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation. - * @param mutateDocument Whether to mutate the original document or clone it before applying - * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`. - * @return `{newDocument, result}` after the operation - */ - function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) { - if (validateOperation === void 0) { validateOperation = false; } - if (mutateDocument === void 0) { mutateDocument = true; } - if (banPrototypeModifications === void 0) { banPrototypeModifications = true; } - if (index === void 0) { index = 0; } - if (validateOperation) { - if (typeof validateOperation == 'function') { - validateOperation(operation, 0, document, operation.path); - } - else { - validator(operation, 0); - } - } - /* ROOT OPERATIONS */ - if (operation.path === "") { - var returnValue = { newDocument: document }; - if (operation.op === 'add') { - returnValue.newDocument = operation.value; - return returnValue; - } - else if (operation.op === 'replace') { - returnValue.newDocument = operation.value; - returnValue.removed = document; //document we removed - return returnValue; - } - else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root - returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field - if (operation.op === 'move') { // report removed item - returnValue.removed = document; - } - return returnValue; - } - else if (operation.op === 'test') { - returnValue.test = areEquals(document, operation.value); - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - returnValue.newDocument = document; - return returnValue; - } - else if (operation.op === 'remove') { // a remove on root - returnValue.removed = document; - returnValue.newDocument = null; - return returnValue; - } - else if (operation.op === '_get') { - operation.value = document; - return returnValue; - } - else { /* bad operation */ - if (validateOperation) { - throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document); - } - else { - return returnValue; - } - } - } /* END ROOT OPERATIONS */ - else { - if (!mutateDocument) { - document = helpers_1._deepClone(document); - } - var path = operation.path || ""; - var keys = path.split('/'); - var obj = document; - var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift - var len = keys.length; - var existingPathFragment = undefined; - var key = void 0; - var validateFunction = void 0; - if (typeof validateOperation == 'function') { - validateFunction = validateOperation; - } - else { - validateFunction = validator; - } - while (true) { - key = keys[t]; - if (banPrototypeModifications && key == '__proto__') { - throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README'); - } - if (validateOperation) { - if (existingPathFragment === undefined) { - if (obj[key] === undefined) { - existingPathFragment = keys.slice(0, t).join('/'); - } - else if (t == len - 1) { - existingPathFragment = operation.path; - } - if (existingPathFragment !== undefined) { - validateFunction(operation, 0, document, existingPathFragment); - } - } - } - t++; - if (Array.isArray(obj)) { - if (key === '-') { - key = obj.length; - } - else { - if (validateOperation && !helpers_1.isInteger(key)) { - throw new exports.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document); - } // only parse key when it's an integer for `arr.prop` to work - else if (helpers_1.isInteger(key)) { - key = ~~key; - } - } - if (t >= len) { - if (validateOperation && operation.op === "add" && key > obj.length) { - throw new exports.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index, operation, document); - } - var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return returnValue; - } - } - else { - if (key && key.indexOf('~') != -1) { - key = helpers_1.unescapePathComponent(key); - } - if (t >= len) { - var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return returnValue; - } - } - obj = obj[key]; - } - } - } - exports.applyOperation = applyOperation; - /** - * Apply a full JSON Patch array on a JSON document. - * Returns the {newDocument, result} of the patch. - * It modifies the `document` object and `patch` - it gets the values by reference. - * If you would like to avoid touching your values, clone them: - * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`. - * - * @param document The document to patch - * @param patch The patch to apply - * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation. - * @param mutateDocument Whether to mutate the original document or clone it before applying - * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`. - * @return An array of `{newDocument, result}` after the patch - */ - function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) { - if (mutateDocument === void 0) { mutateDocument = true; } - if (banPrototypeModifications === void 0) { banPrototypeModifications = true; } - if (validateOperation) { - if (!Array.isArray(patch)) { - throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY'); - } - } - if (!mutateDocument) { - document = helpers_1._deepClone(document); - } - var results = new Array(patch.length); - for (var i = 0, length_1 = patch.length; i < length_1; i++) { - // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true` - results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i); - document = results[i].newDocument; // in case root was replaced - } - results.newDocument = document; - return results; - } - exports.applyPatch = applyPatch; - /** - * Apply a single JSON Patch Operation on a JSON document. - * Returns the updated document. - * Suitable as a reducer. - * - * @param document The document to patch - * @param operation The operation to apply - * @return The updated document - */ - function applyReducer(document, operation, index) { - var operationResult = applyOperation(document, operation); - if (operationResult.test === false) { // failed test - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return operationResult.newDocument; - } - exports.applyReducer = applyReducer; - /** - * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error. - * @param {object} operation - operation object (patch) - * @param {number} index - index of operation in the sequence - * @param {object} [document] - object where the operation is supposed to be applied - * @param {string} [existingPathFragment] - comes along with `document` - */ - function validator(operation, index, document, existingPathFragment) { - if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) { - throw new exports.JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document); - } - else if (!objOps[operation.op]) { - throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document); - } - else if (typeof operation.path !== 'string') { - throw new exports.JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document); - } - else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) { - // paths that aren't empty string should start with "/" - throw new exports.JsonPatchError('Operation `path` property must start with "/"', 'OPERATION_PATH_INVALID', index, operation, document); - } - else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') { - throw new exports.JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document); - } - else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) { - throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document); - } - else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && helpers_1.hasUndefined(operation.value)) { - throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document); - } - else if (document) { - if (operation.op == "add") { - var pathLen = operation.path.split("/").length; - var existingPathLen = existingPathFragment.split("/").length; - if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) { - throw new exports.JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document); - } - } - else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') { - if (operation.path !== existingPathFragment) { - throw new exports.JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document); - } - } - else if (operation.op === 'move' || operation.op === 'copy') { - var existingValue = { op: "_get", path: operation.from, value: undefined }; - var error = validate([existingValue], document); - if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') { - throw new exports.JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document); - } - } - } - } - exports.validator = validator; - /** - * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document. - * If error is encountered, returns a JsonPatchError object - * @param sequence - * @param document - * @returns {JsonPatchError|undefined} - */ - function validate(sequence, document, externalValidator) { - try { - if (!Array.isArray(sequence)) { - throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY'); - } - if (document) { - //clone document and sequence so that we can safely try applying operations - applyPatch(helpers_1._deepClone(document), helpers_1._deepClone(sequence), externalValidator || true); - } - else { - externalValidator = externalValidator || validator; - for (var i = 0; i < sequence.length; i++) { - externalValidator(sequence[i], i, document, undefined); - } - } - } - catch (e) { - if (e instanceof exports.JsonPatchError) { - return e; - } - else { - throw e; - } - } - } - exports.validate = validate; - /** - * Default export for backwards compat - */ - exports.default = { - JsonPatchError: exports.JsonPatchError, - deepClone: exports.deepClone, - getValueByPointer: getValueByPointer, - applyOperation: applyOperation, - applyPatch: applyPatch, - applyReducer: applyReducer, - validator: validator, - validate: validate - }; - }(core$2)); - - var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - Object.defineProperty(duplex, "__esModule", { value: true }); - /*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017 Joachim Wester - * MIT license - */ - var helpers_1 = helpers; - var core_1 = core$2; - /* export all core functions and types */ - var core_2 = core$2; - duplex.applyOperation = core_2.applyOperation; - duplex.applyPatch = core_2.applyPatch; - duplex.applyReducer = core_2.applyReducer; - duplex.getValueByPointer = core_2.getValueByPointer; - duplex.validate = core_2.validate; - duplex.validator = core_2.validator; - /* export some helpers */ - var helpers_2 = helpers; - duplex.JsonPatchError = helpers_2.PatchError; - duplex.deepClone = helpers_2._deepClone; - duplex.escapePathComponent = helpers_2.escapePathComponent; - duplex.unescapePathComponent = helpers_2.unescapePathComponent; - var beforeDict = new WeakMap(); - var Mirror = /** @class */ (function () { - function Mirror(obj) { - this.observers = new Map(); - this.obj = obj; - } - return Mirror; - }()); - var ObserverInfo = /** @class */ (function () { - function ObserverInfo(callback, observer) { - this.callback = callback; - this.observer = observer; - } - return ObserverInfo; - }()); - function getMirror(obj) { - return beforeDict.get(obj); - } - function getObserverFromMirror(mirror, callback) { - return mirror.observers.get(callback); - } - function removeObserverFromMirror(mirror, observer) { - mirror.observers.delete(observer.callback); - } - /** - * Detach an observer from an object - */ - function unobserve(root, observer) { - observer.unobserve(); - } - duplex.unobserve = unobserve; - /** - * Observes changes made to an object, which can then be retrieved using generate - */ - function observe(obj, callback) { - var patches = []; - var observer; - var mirror = getMirror(obj); - if (!mirror) { - mirror = new Mirror(obj); - beforeDict.set(obj, mirror); - } - else { - var observerInfo = getObserverFromMirror(mirror, callback); - observer = observerInfo && observerInfo.observer; - } - if (observer) { - return observer; - } - observer = {}; - mirror.value = helpers_1._deepClone(obj); - if (callback) { - observer.callback = callback; - observer.next = null; - var dirtyCheck = function () { - generate(observer); - }; - var fastCheck = function () { - clearTimeout(observer.next); - observer.next = setTimeout(dirtyCheck); - }; - if (typeof window !== 'undefined') { //not Node - window.addEventListener('mouseup', fastCheck); - window.addEventListener('keyup', fastCheck); - window.addEventListener('mousedown', fastCheck); - window.addEventListener('keydown', fastCheck); - window.addEventListener('change', fastCheck); - } - } - observer.patches = patches; - observer.object = obj; - observer.unobserve = function () { - generate(observer); - clearTimeout(observer.next); - removeObserverFromMirror(mirror, observer); - if (typeof window !== 'undefined') { - window.removeEventListener('mouseup', fastCheck); - window.removeEventListener('keyup', fastCheck); - window.removeEventListener('mousedown', fastCheck); - window.removeEventListener('keydown', fastCheck); - window.removeEventListener('change', fastCheck); - } - }; - mirror.observers.set(callback, new ObserverInfo(callback, observer)); - return observer; - } - duplex.observe = observe; - /** - * Generate an array of patches from an observer - */ - function generate(observer, invertible) { - if (invertible === void 0) { invertible = false; } - var mirror = beforeDict.get(observer.object); - _generate(mirror.value, observer.object, observer.patches, "", invertible); - if (observer.patches.length) { - core_1.applyPatch(mirror.value, observer.patches); - } - var temp = observer.patches; - if (temp.length > 0) { - observer.patches = []; - if (observer.callback) { - observer.callback(temp); - } - } - return temp; - } - duplex.generate = generate; - // Dirty check if obj is different from mirror, generate patches and update mirror - function _generate(mirror, obj, patches, path, invertible) { - if (obj === mirror) { - return; - } - if (typeof obj.toJSON === "function") { - obj = obj.toJSON(); - } - var newKeys = helpers_1._objectKeys(obj); - var oldKeys = helpers_1._objectKeys(mirror); - var deleted = false; - //if ever "move" operation is implemented here, make sure this test runs OK: "should not generate the same patch twice (move)" - for (var t = oldKeys.length - 1; t >= 0; t--) { - var key = oldKeys[t]; - var oldVal = mirror[key]; - if (helpers_1.hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) { - var newVal = obj[key]; - if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null) { - _generate(oldVal, newVal, patches, path + "/" + helpers_1.escapePathComponent(key), invertible); - } - else { - if (oldVal !== newVal) { - if (invertible) { - patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) }); - } - patches.push({ op: "replace", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(newVal) }); - } - } - } - else if (Array.isArray(mirror) === Array.isArray(obj)) { - if (invertible) { - patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) }); - } - patches.push({ op: "remove", path: path + "/" + helpers_1.escapePathComponent(key) }); - deleted = true; // property has been deleted - } - else { - if (invertible) { - patches.push({ op: "test", path: path, value: mirror }); - } - patches.push({ op: "replace", path: path, value: obj }); - } - } - if (!deleted && newKeys.length == oldKeys.length) { - return; - } - for (var t = 0; t < newKeys.length; t++) { - var key = newKeys[t]; - if (!helpers_1.hasOwnProperty(mirror, key) && obj[key] !== undefined) { - patches.push({ op: "add", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(obj[key]) }); - } - } - } - /** - * Create an array of patches from the differences in two objects - */ - function compare$k(tree1, tree2, invertible) { - if (invertible === void 0) { invertible = false; } - var patches = []; - _generate(tree1, tree2, patches, '', invertible); - return patches; - } - duplex.compare = compare$k; - /** - * Default export for backwards compat - */ - // import just to re-export as default - var core$1 = core$2; - var helpers_3 = helpers; - duplex.default = __assign({}, core$1, { - // duplex - unobserve: unobserve, - observe: observe, - generate: generate, - compare: compare$k, - // helpers - JsonPatchError: helpers_3.PatchError, deepClone: helpers_1._deepClone, escapePathComponent: helpers_1.escapePathComponent, - unescapePathComponent: helpers_3.unescapePathComponent }); - - const crypto$o = require$$0__default["default"]; - - /** - * Simple interaction with 256-bit spaces. - */ - class Hash256$9 { - /** - * Create an instance of a `Hash256` object by calling `new Hash256()`, - * where `settings` can be provided to supply a particular input object. - * - * If the `settings` is not a string, `input` must be provided. - * @param {Object} settings - * @param {String} settings.input Input string to map as 256-bit hash. - */ - constructor (settings = {}) { - if (typeof settings === 'string') settings = { input: settings }; - if (!settings.input) settings.input = crypto$o.randomBytes(32).toString('hex'); - - this.settings = Object.assign({ - hash: Hash256$9.digest(settings.input) - }, settings); - } - - /** - * Produce a SHA256 digest of some input data. - * @param {String|Buffer} input Content to digest. - * @returns {String} `SHA256(input)` as a hexadecimal string. - */ - static digest (input) { - if (typeof input !== 'string' && !(input instanceof Buffer)) { - throw new Error(`Input to process must be of type "String" or "Buffer" to digest.`); - } - - // consume and output as string - return crypto$o.createHash('sha256').update(input).digest('hex'); - } - - // TODO: document `hash256.value` - get value () { - return Hash256$9.digest(this.settings.input); - } - - /** - * Reverses the bytes of the digest. - */ - static reverse (input = '') { - return Buffer.from(input, 'hex').reverse().toString('hex'); - } - - reverse (input = this.value) { - return Hash256$9.reverse(input); - } - } - - var hash256$l = Hash256$9; - - /** - * Create a new {@link Object} with sorted properties. - * @param {Object} [state] Object to sort. - * @returns {Object} Re-sorted instance of `state` as provided. - */ - - var _sortKeys$1 = function _sortKeys (state = {}) { - return Object.keys(state).sort().reduce((obj, key) => { - obj[key] = state[key]; - return obj; - }, {}); - }; - - // Dependencies - const crypto$n = require$$0__default["default"]; - const { EventEmitter: EventEmitter$w } = require$$1__default$1["default"]; - - // - const monitor$6 = duplex; - const pointer$6 = jsonPointer$1; - - // Fabric Types - const Hash256$8 = hash256$l; - - // Fabric Functions - const _sortKeys = _sortKeys$1; - - /** - * Generic Fabric Actor. - * @access protected - * @emits message Fabric {@link Message} objects. - * @property {String} id Unique identifier for this Actor (id === SHA256(preimage)). - * @property {String} preimage Input hash for the `id` property (preimage === SHA256(ActorState)). - */ - class Actor$g extends EventEmitter$w { - /** - * Creates an {@link Actor}, which emits messages for other - * Actors to subscribe to. You can supply certain parameters - * for the actor, including key material [!!!] — be mindful of - * what you share with others! - * @param {Object} [actor] Object to use as the actor. - * @param {String} [actor.seed] BIP24 Mnemonic to use as a seed phrase. - * @param {Buffer} [actor.public] Public key. - * @param {Buffer} [actor.private] Private key. - * @returns {Actor} Instance of the Actor. Call {@link Actor#sign} to emit a {@link Signature}. - */ - constructor (actor = {}) { - super(actor); - - this.commits = []; - // this.signature = Buffer.alloc(64); - this.value = this._readObject(actor); // TODO: use Buffer? - - // Internal State - this._state = { - type: 'Actor', - data: this.value, - status: 'PAUSED', - content: this.value || {} - }; - - // this.observer = monitor.observe(this._state.content, this._handleMonitorChanges.bind(this)); - - // Chainable - return this; - /* return new Proxy(this, { - get: function (obj, name) { - return Object.hasOwnProperty.call(obj, name) ? obj[name] : obj._getField(name); - } - }); */ - } - - static fromAny (input = {}) { - let state = null; - - if (typeof input === 'string') { - state = { content: input }; - } else if (input instanceof Buffer) { - state = { content: input.toString('hex') }; - } else { - state = Object.assign({}, input); - } - - return new Actor$g(state); - } - - static fromJSON (input) { - let result = null; - - if (typeof input === 'string' && input.length) { - console.log('trying to parse as JSON:', input); - try { - result = JSON.parse(input); - } catch (E) { - console.error('Failure in fromJSON:', E); - } - } else { - console.trace('Invalid input:', typeof input); - } - - return result; - } - - static randomBytes (count = 32) { - return crypto$n.randomBytes(count); - } - - get id () { - const buffer = Buffer.from(this.preimage, 'hex'); - return Hash256$8.digest(buffer); - } - - get preimage () { - const input = { - 'type': 'FabricActorState', - 'object': this.toObject() - }; - - // console.log('input:', input['object']); - - const string = JSON.stringify(input, null, ' '); - const buffer = Buffer.from(string, 'utf8'); - - return Hash256$8.digest(buffer); - } - - get state () { - return Object.assign({}, this._state.content); - } - - get status () { - return this._state.status; - } - - get type () { - return this._state['@type']; - } - - set state (value) { - this._state.content = value; - } - - set status (value) { - this._state.status = value; - } - - /** - * Resolve the current state to a commitment. - * @emits Actor Current malleable state. - * @returns {String} 32-byte ID - */ - commit () { - const state = new Actor$g(this.state); - const changes = monitor$6.generate(this.observer); - const parent = this.history[this.history.length - 1].state; - const commit = new Actor$g({ - changes: changes, - parent: parent, - state: state.id - }); - - this.history.push(commit); - this.emit('commit', commit); - return commit.id; - } - - debug (...params) { - this.emit('debug', params); - } - - get (path) { - return pointer$6.get(this._state.content, path); - } - - log (...params) { - this.emit('log', ...params); - } - - mutate (seed) { - if (seed === 0 || !seed) seed = this.randomBytes(32).toString('hex'); - - const patches = [ - { op: 'replace', path: '/seed', value: seed } - ]; - - monitor$6.applyPatch(this._state.content, patches); - console.log('new state:', this._state.content); - this.commit(); - - return this; - } - - set (path, value) { - pointer$6.set(this._state.content, path, value); - this.commit(); - return this; - } - - /** - * Casts the Actor to a normalized Buffer. - * @returns {Buffer} - */ - toBuffer () { - return Buffer.from(this.serialize(), 'utf8'); - } - - /** - * Returns the Actor's current state as an {@link Object}. - * @returns {Object} - */ - toObject () { - // console.log('toObject() state:', this.state); - return _sortKeys(this.state); - } - - toString (format = 'json') { - switch (format) { - case 'hex': - return Buffer.from(this.serialize(), 'utf8').toString('hex'); - case 'json': - default: - return this.serialize(); - } - } - - pause () { - this.status = 'PAUSING'; - this.commit(); - return this; - } - - randomBytes (count = 32) { - return crypto$n.randomBytes(count); - } - - /** - * Serialize the Actor's current state into a JSON-formatted string. - * @returns {String} - */ - serialize () { - let json = null; - - try { - json = JSON.stringify(this.toObject(), null, ' '); - } catch (exception) { - json = JSON.stringify({ - type: 'Error', - content: `Exception serializing: ${exception}` - }, null, ' '); - } - - return json; - } - - sha256 (value) { - return Hash256$8.digest(value); - } - - /** - * Signs the Actor. - * @returns {Actor} - */ - sign () { - throw new Error('Unimplemented on this branch. Use @fabric/core/types/signer instead.'); - /* this.signature = this.key._sign(this.toBuffer()); - this.emit('signature', this.signature); - return this; */ - } - - /** - * Toggles `status` property to unpaused. - * @ - * @returns {Actor} - */ - unpause () { - this.status = 'UNPAUSING'; - this.commit(); - this.status = 'UNPAUSED'; - return this; - } - - _getField (name) { - return this._state.content[name]; - } - - /** - * Incurs 1 SYSCALL - * @access private - * @returns {Object} - */ - _getState () { - return this.state; - } - - _handleMonitorChanges (changes) { - console.log('got monitor changes from actor:', changes); - // TODO: emit global state event here - // after verify, commit - } - - /** - * Parse an Object into a corresponding Fabric state. - * @param {Object} input Object to read as input. - * @returns {Object} Fabric state. - */ - _readObject (input = {}) { - let state = {}; - - if (typeof input === 'string') { - state = Object.assign(state, { - type: 'String', - size: input.length, - content: input, - encoding: 'utf8' - }); - } else if (input instanceof Buffer) { - state = Object.assign(state, { - type: 'Buffer', - size: input.length, - content: input.toString('hex'), - encoding: 'hex' - }); - } else { - state = Object.assign(state, input); - } - - return state; - } - } - - var actor = Actor$g; - - var pluralize$5 = {exports: {}}; - - /* global define */ - - (function (module, exports) { - (function (root, pluralize) { - /* istanbul ignore else */ - if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { - // Node. - module.exports = pluralize(); - } else { - // Browser global. - root.pluralize = pluralize(); - } - })(commonjsGlobal, function () { - // Rule storage - pluralize and singularize need to be run sequentially, - // while other rules can be optimized using an object for instant lookups. - var pluralRules = []; - var singularRules = []; - var uncountables = {}; - var irregularPlurals = {}; - var irregularSingles = {}; - - /** - * Sanitize a pluralization rule to a usable regular expression. - * - * @param {(RegExp|string)} rule - * @return {RegExp} - */ - function sanitizeRule (rule) { - if (typeof rule === 'string') { - return new RegExp('^' + rule + '$', 'i'); - } - - return rule; - } - - /** - * Pass in a word token to produce a function that can replicate the case on - * another word. - * - * @param {string} word - * @param {string} token - * @return {Function} - */ - function restoreCase (word, token) { - // Tokens are an exact match. - if (word === token) return token; - - // Lower cased words. E.g. "hello". - if (word === word.toLowerCase()) return token.toLowerCase(); - - // Upper cased words. E.g. "WHISKY". - if (word === word.toUpperCase()) return token.toUpperCase(); - - // Title cased words. E.g. "Title". - if (word[0] === word[0].toUpperCase()) { - return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); - } - - // Lower cased words. E.g. "test". - return token.toLowerCase(); - } - - /** - * Interpolate a regexp string. - * - * @param {string} str - * @param {Array} args - * @return {string} - */ - function interpolate (str, args) { - return str.replace(/\$(\d{1,2})/g, function (match, index) { - return args[index] || ''; - }); - } - - /** - * Replace a word using a rule. - * - * @param {string} word - * @param {Array} rule - * @return {string} - */ - function replace (word, rule) { - return word.replace(rule[0], function (match, index) { - var result = interpolate(rule[1], arguments); - - if (match === '') { - return restoreCase(word[index - 1], result); - } - - return restoreCase(match, result); - }); - } - - /** - * Sanitize a word by passing in the word and sanitization rules. - * - * @param {string} token - * @param {string} word - * @param {Array} rules - * @return {string} - */ - function sanitizeWord (token, word, rules) { - // Empty string or doesn't need fixing. - if (!token.length || uncountables.hasOwnProperty(token)) { - return word; - } - - var len = rules.length; - - // Iterate over the sanitization rules and use the first one to match. - while (len--) { - var rule = rules[len]; - - if (rule[0].test(word)) return replace(word, rule); - } - - return word; - } - - /** - * Replace a word with the updated word. - * - * @param {Object} replaceMap - * @param {Object} keepMap - * @param {Array} rules - * @return {Function} - */ - function replaceWord (replaceMap, keepMap, rules) { - return function (word) { - // Get the correct token and case restoration functions. - var token = word.toLowerCase(); - - // Check against the keep object map. - if (keepMap.hasOwnProperty(token)) { - return restoreCase(word, token); - } - - // Check against the replacement map for a direct word replacement. - if (replaceMap.hasOwnProperty(token)) { - return restoreCase(word, replaceMap[token]); - } - - // Run all the rules against the word. - return sanitizeWord(token, word, rules); - }; - } - - /** - * Check if a word is part of the map. - */ - function checkWord (replaceMap, keepMap, rules, bool) { - return function (word) { - var token = word.toLowerCase(); - - if (keepMap.hasOwnProperty(token)) return true; - if (replaceMap.hasOwnProperty(token)) return false; - - return sanitizeWord(token, token, rules) === token; - }; - } - - /** - * Pluralize or singularize a word based on the passed in count. - * - * @param {string} word The word to pluralize - * @param {number} count How many of the word exist - * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks) - * @return {string} - */ - function pluralize (word, count, inclusive) { - var pluralized = count === 1 - ? pluralize.singular(word) : pluralize.plural(word); - - return (inclusive ? count + ' ' : '') + pluralized; - } - - /** - * Pluralize a word. - * - * @type {Function} - */ - pluralize.plural = replaceWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Check if a word is plural. - * - * @type {Function} - */ - pluralize.isPlural = checkWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Singularize a word. - * - * @type {Function} - */ - pluralize.singular = replaceWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Check if a word is singular. - * - * @type {Function} - */ - pluralize.isSingular = checkWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Add a pluralization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addPluralRule = function (rule, replacement) { - pluralRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add a singularization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addSingularRule = function (rule, replacement) { - singularRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add an uncountable word rule. - * - * @param {(string|RegExp)} word - */ - pluralize.addUncountableRule = function (word) { - if (typeof word === 'string') { - uncountables[word.toLowerCase()] = true; - return; - } - - // Set singular and plural references for the word. - pluralize.addPluralRule(word, '$0'); - pluralize.addSingularRule(word, '$0'); - }; - - /** - * Add an irregular word definition. - * - * @param {string} single - * @param {string} plural - */ - pluralize.addIrregularRule = function (single, plural) { - plural = plural.toLowerCase(); - single = single.toLowerCase(); - - irregularSingles[single] = plural; - irregularPlurals[plural] = single; - }; - - /** - * Irregular rules. - */ - [ - // Pronouns. - ['I', 'we'], - ['me', 'us'], - ['he', 'they'], - ['she', 'they'], - ['them', 'them'], - ['myself', 'ourselves'], - ['yourself', 'yourselves'], - ['itself', 'themselves'], - ['herself', 'themselves'], - ['himself', 'themselves'], - ['themself', 'themselves'], - ['is', 'are'], - ['was', 'were'], - ['has', 'have'], - ['this', 'these'], - ['that', 'those'], - // Words ending in with a consonant and `o`. - ['echo', 'echoes'], - ['dingo', 'dingoes'], - ['volcano', 'volcanoes'], - ['tornado', 'tornadoes'], - ['torpedo', 'torpedoes'], - // Ends with `us`. - ['genus', 'genera'], - ['viscus', 'viscera'], - // Ends with `ma`. - ['stigma', 'stigmata'], - ['stoma', 'stomata'], - ['dogma', 'dogmata'], - ['lemma', 'lemmata'], - ['schema', 'schemata'], - ['anathema', 'anathemata'], - // Other irregular rules. - ['ox', 'oxen'], - ['axe', 'axes'], - ['die', 'dice'], - ['yes', 'yeses'], - ['foot', 'feet'], - ['eave', 'eaves'], - ['goose', 'geese'], - ['tooth', 'teeth'], - ['quiz', 'quizzes'], - ['human', 'humans'], - ['proof', 'proofs'], - ['carve', 'carves'], - ['valve', 'valves'], - ['looey', 'looies'], - ['thief', 'thieves'], - ['groove', 'grooves'], - ['pickaxe', 'pickaxes'], - ['passerby', 'passersby'] - ].forEach(function (rule) { - return pluralize.addIrregularRule(rule[0], rule[1]); - }); - - /** - * Pluralization rules. - */ - [ - [/s?$/i, 's'], - [/[^\u0000-\u007F]$/i, '$0'], - [/([^aeiou]ese)$/i, '$1'], - [/(ax|test)is$/i, '$1es'], - [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'], - [/(e[mn]u)s?$/i, '$1s'], - [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], - [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], - [/(seraph|cherub)(?:im)?$/i, '$1im'], - [/(her|at|gr)o$/i, '$1oes'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], - [/sis$/i, 'ses'], - [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], - [/([^aeiouy]|qu)y$/i, '$1ies'], - [/([^ch][ieo][ln])ey$/i, '$1ies'], - [/(x|ch|ss|sh|zz)$/i, '$1es'], - [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], - [/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'], - [/(pe)(?:rson|ople)$/i, '$1ople'], - [/(child)(?:ren)?$/i, '$1ren'], - [/eaux$/i, '$0'], - [/m[ae]n$/i, 'men'], - ['thou', 'you'] - ].forEach(function (rule) { - return pluralize.addPluralRule(rule[0], rule[1]); - }); - - /** - * Singularization rules. - */ - [ - [/s$/i, ''], - [/(ss)$/i, '$1'], - [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], - [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], - [/ies$/i, 'y'], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'], - [/\b(mon|smil)ies$/i, '$1ey'], - [/\b((?:tit)?m|l)ice$/i, '$1ouse'], - [/(seraph|cherub)im$/i, '$1'], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'], - [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'], - [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'], - [/(test)(?:is|es)$/i, '$1is'], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], - [/(alumn|alg|vertebr)ae$/i, '$1a'], - [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], - [/(matr|append)ices$/i, '$1ix'], - [/(pe)(rson|ople)$/i, '$1rson'], - [/(child)ren$/i, '$1'], - [/(eau)x?$/i, '$1'], - [/men$/i, 'man'] - ].forEach(function (rule) { - return pluralize.addSingularRule(rule[0], rule[1]); - }); - - /** - * Uncountable rules. - */ - [ - // Singular words with no plurals. - 'adulthood', - 'advice', - 'agenda', - 'aid', - 'aircraft', - 'alcohol', - 'ammo', - 'analytics', - 'anime', - 'athletics', - 'audio', - 'bison', - 'blood', - 'bream', - 'buffalo', - 'butter', - 'carp', - 'cash', - 'chassis', - 'chess', - 'clothing', - 'cod', - 'commerce', - 'cooperation', - 'corps', - 'debris', - 'diabetes', - 'digestion', - 'elk', - 'energy', - 'equipment', - 'excretion', - 'expertise', - 'firmware', - 'flounder', - 'fun', - 'gallows', - 'garbage', - 'graffiti', - 'hardware', - 'headquarters', - 'health', - 'herpes', - 'highjinks', - 'homework', - 'housework', - 'information', - 'jeans', - 'justice', - 'kudos', - 'labour', - 'literature', - 'machinery', - 'mackerel', - 'mail', - 'media', - 'mews', - 'moose', - 'music', - 'mud', - 'manga', - 'news', - 'only', - 'personnel', - 'pike', - 'plankton', - 'pliers', - 'police', - 'pollution', - 'premises', - 'rain', - 'research', - 'rice', - 'salmon', - 'scissors', - 'series', - 'sewage', - 'shambles', - 'shrimp', - 'software', - 'species', - 'staff', - 'swine', - 'tennis', - 'traffic', - 'transportation', - 'trout', - 'tuna', - 'wealth', - 'welfare', - 'whiting', - 'wildebeest', - 'wildlife', - 'you', - /pok[eé]mon$/i, - // Regexes. - /[^aeiou]ese$/i, // "chinese", "japanese" - /deer$/i, // "deer", "reindeer" - /fish$/i, // "fish", "blowfish", "angelfish" - /measles$/i, - /o[iu]s$/i, // "carnivorous" - /pox$/i, // "chickpox", "smallpox" - /sheep$/i - ].forEach(pluralize.addUncountableRule); - - return pluralize; - }); - }(pluralize$5)); - - const crypto$m = require$$0__default["default"]; - const { EventEmitter: EventEmitter$v } = require$$1__default$1["default"]; - - /** - * Live instance of an ARC in Fabric. - * @type {Object} - */ - class Entity$8 extends EventEmitter$v { - /** - * Generic template for virtual objects. - * @param {Object} [data={}] Pass an object to use. - * @return {Entity} Instance of the {@link Entity}. - */ - constructor (data = {}) { - super(data); - - // allow this entity to be run without the new keyword - if (!(this instanceof Entity$8)) return new Entity$8(data); - - // set internal properties - this.settings = { - verbosity: 2 // Information && Warnings - }; - - // configure defaults - this.actor = Object.assign({}, this._downsample(data)); - this.data = Object.assign({}, data); - - // TODO: use getters/setters to restrict access to these elements - // remove EventEmitter cruft - Object.defineProperty(this, '_events', { enumerable: false }); - Object.defineProperty(this, '_eventsCount', { enumerable: false }); - Object.defineProperty(this, '_maxListeners', { enumerable: false }); - - // remove mutable variables - Object.defineProperty(this, 'actor', { enumerable: false }); - // Object.defineProperty(this, 'machine', { enumerable: false }); - - // return instance - return this; - } - - get version () { - return 1; - } - - set state (state) { - if (!state) throw new Error('State must be provided.'); - this._state = state; - } - - get state () { - return Object.assign({}, this._state); - } - - get buffer () { - let entity = this; - return function buffer () { - return Buffer.from(entity.toJSON(), 'utf8'); - } - } - - get id () { - let data = this.toJSON(); - let hash = crypto$m.createHash('sha256').update(data).digest('hex'); - if (this.settings.verbosity >= 5) console.log('[FABRIC:ENTITY (pending upstream!)]', 'hash:', hash, 'data:', data); - return hash; - } - - serialize () { - return this.toJSON(); - } - - toBuffer () { - return Buffer.from(this.toString(), 'utf8'); - } - - /** - * Produces a string of JSON, representing the entity. - * @return {String} JSON-encoded object. - */ - toJSON () { - let result = null; - - switch (this.actor['@type']) { - default: - result = JSON.stringify(this.toObject()); - break; - case 'Function': - result = this._downsample(); - break; - case 'Buffer': - case 'String': - result = JSON.stringify(this.toString()); - break; - } - - return result; - } - - toString () { - let result = null; - - switch (this.actor['@type']) { - default: - result = JSON.stringify(this.actor['@data']); - break; - case 'Buffer': - new Uint8Array(this.data); - const values = Object.values(this.data); - result = JSON.stringify(values); - break; - case 'String': - // TODO: write up longer-form explanation as to why we use an Array here - result = this.actor['@data'].map(x => String.fromCharCode(x)).join(''); - // console.log('was string in array? now:', result); - break; - } - - return result; - } - - toObject () { - return this.actor['@data']; - } - - /** - * As a {@link Buffer}. - * @return {Buffer} Slice of memory. - */ - toRaw () { - return Buffer.from(this.toJSON(), 'utf8'); - } - - /** - * Return a {@link Fabric}-labeled {@link Object} for this {@link Entity}. - * @param {Mixed} [input] Input to downsample. If not provided, current Entity will be used. - */ - _downsample (input = this.data) { - let result = {}; - - if (typeof input === 'string') { - result = { - '@type': 'String', - '@data': input.split('').map(x => x.charCodeAt(0)) - }; - } else if (input instanceof Array) { - result = { - '@type': 'Array', - '@data': input - }; - } else if (input instanceof Buffer) { - result = { - '@type': 'Buffer', - '@data': JSON.parse(JSON.stringify(input))[0] - }; - } else if (input instanceof Function) { - try { - result = { - '@type': 'Function', - '@data': JSON.stringify(input) - }; - } catch (E) { - console.error('Something could not be converted:', E, input); - process.exit(); - } - } else { - try { - result = { - '@type': 'Entity', - '@data': JSON.parse(JSON.stringify(input)) - }; - } catch (E) { - console.error('Something could not be converted:', E, input); - process.exit(); - } - } - - return result; - } - } - - var entity = Entity$8; - - /** - * Parse input to a JSON string. - * @param {Object} [input] Any input object. - * @returns {String} - */ - - var json$1 = function (input) { - return JSON.stringify(input, null, ' '); - }; - - // Constants - const { - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$2 - } = constants$1; - - // Dependencies - const crypto$l = require$$0__default["default"]; - const monitor$5 = duplex; - const pointer$5 = jsonPointer$1; - - // Fabric Types - const Actor$f = actor; - - // Local Services - const json = json$1; - - /** - * The {@link State} is the core of most {@link User}-facing interactions. To - * interact with the {@link User}, simply propose a change in the state by - * committing to the outcome. This workflow keeps app design quite simple! - * @access protected - * @augments EventEmitter - * @property {Number} size Size of state in bytes. - * @property {Buffer} @buffer Byte-for-byte memory representation of state. - * @property {String} @type Named type. - * @property {Mixed} @data Local instance of the state. - * @property {String} @id Unique identifier for this data. - */ - class State$9 extends Actor$f { - /** - * Creates a snapshot of some information. - * @param {Mixed} data Input data. - * @return {State} Resulting state. - */ - constructor (data = {}) { - super(data); - - this['@input'] = data || null; - this['@data'] = data || {}; - this['@meta'] = {}; - this['@encoding'] = 'json'; - - // Literal Entity Structure - this['@entity'] = { - '@type': 'State', - '@data': data - }; - - // TODO: test and document memory alignment - // this['@buffer'] = Buffer.alloc(Constants.MAX_MESSAGE_SIZE); - this['@allocation'] = Buffer.alloc(MAX_MESSAGE_SIZE$2); - this['@buffer'] = Buffer.from(this.serialize(this['@entity']['@data'])); - - // if not destined to be an object... - if (typeof this['@data'] === 'string') { - this['@entity']['@type'] = 'String'; - this['@entity']['@data'] = this['@data'].split('').map(x => x.charCodeAt(0)); - } else if (this['@data'] instanceof Array) { - this['@entity']['@type'] = 'Array'; - } else if (this['@data'] instanceof Buffer) { - this['@entity']['@type'] = 'Buffer'; - } else if ( - this['@data'] && - this['@data']['@type'] && - this['@data']['@data'] - ) { - switch (this['@data']['@type']) { - default: - this['@entity']['@type'] = this['@data']['@type']; - this['@entity']['@data'] = this['@data']['@data']; - break; - } - } else { - this['@entity']['@type'] = 'Object'; - this['@entity']['@data'] = data; - } - - // start at zero - this._clock = 0; - - // set various #meta - this['@type'] = this['@entity']['@type']; - // this['@id'] = null; - // this['@id'] = this.id; - - // set internal data - this.services = { json }; - this.name = this['@entity'].name || this.id; - - if (this['@entity']['@data']) { - try { - this.observer = monitor$5.observe(this['@entity']['@data']); - } catch (E) { - console.error('Could not create observer:', E, this['@entity']['@data']); - } - } - - this.value = {}; - - // TODO: document hidden properties - // Remove various undesired clutter from output - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, 'key', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - Object.defineProperty(this, 'size', { - enumerable: true, - get: function count () { - return this['@buffer'].length; - } - }); - - Object.defineProperty(this, 'domain', { - enumerable: false - }); - - Object.defineProperty(this, '_events', { - enumerable: false - }); - - Object.defineProperty(this, '_eventsCount', { - enumerable: false - }); - - Object.defineProperty(this, '_maxListeners', { - enumerable: false - }); - - return this; - } - - static get json () { - return json; - } - - static get html () { - return json; - } - - static get pointer () { - return pointer$5; - } - - get path () { - return `/entities/${this.id}`; - } - - get state () { - return this.value; - // TODO: re-enable the below, map security considerations - // return Object.assign({}, this.value); - } - - set path (value) { - return this.path; - } - - set state (value) { - this.value = value; - } - - /** - * Marshall an input into an instance of a {@link State}. States have - * absolute authority over their own domain, so choose your States wisely. - * @param {String} input Arbitrary input. - * @return {State} Resulting instance of the {@link State}. - */ - static fromJSON (input) { - let result = null; - - if (typeof input === 'string') { - try { - result = JSON.parse(input); - } catch (E) { - console.error('Failure in fromJSON:', E); - } - } - - return result; - } - - static fromHex (input) { - if (typeof input !== 'string') return null; - return this.fromJSON(Buffer.from(input, 'hex').toString('utf8')); - } - - static fromString (input) { - if (typeof input !== 'string') return null; - return this.fromJSON(input); - } - - sha256 (value) { - return crypto$l.createHash('sha256').update(value).digest('hex'); - } - - async _applyChanges (ops) { - try { - monitor$5.applyPatch(this['@data'], ops); - - await this.commit(); - } catch (E) { - this.error('Error applying changes:', E); - } - - return this; - } - - fingerprint () { - const map = {}; - map['@method'] = 'sha256'; - map['@input'] = this.serialize(this['@entity']['@data']); - map['@buffer'] = crypto$l.createHash('sha256').update(map['@input'], 'utf8'); - map['@output'] = map['@buffer'].digest('hex'); - return map['@output']; - } - - isRoot () { - return this['@parent'] === this.id; - } - - toBuffer () { - if (this['@data'] instanceof Buffer) return this['@data']; - if (this['@data']) return this.serialize(); - - return Buffer.from(this['@data']['@data']); - } - - /** Converts the State to an HTML document. */ - toHTML () { - const state = this; - const solution = state['@output'].toString('utf8'); - const confirmed = String(solution); - const raw = `X-Claim-ID: ${this.id} -X-Claim-Integrity: sha256 -X-Claim-Type: Response -X-Claim-Result: ${state.id} -Body: -# STOP! -Here is your opportunity to read the documentation: https://dev.fabric.pub - -Document ID: ${this.id} -Document Type (local JSON): ${this.constructor.name} -Document Path: ${this.path} -Document Name: ${this.name} -Document Integrity: sha256:${this.id} -Document Data (local JSON, <${confirmed.length}> bytes: ${confirmed} -Document Source: -\`\`\` -${confirmed} -\`\`\` - -## Source Code -### Free as in _freedom_. -Labs: https://github.com/FabricLabs - -To edit this message, visit this URL: https://github.com/FabricLabs/fabric/edit/master/types/state.js - -## Onboarding -When you're ready to continue, visit the following URL: https://dev.fabric.pub/WELCOME.html -`; - - return raw; - } - - /** - * Unmarshall an existing state to an instance of a {@link Blob}. - * @return {String} Serialized {@link Blob}. - */ - toString () { - return this.serialize(); - } - - overlay (data) { - let state = new State$9(data); - this['@parent'] = this['@id']; - this['@data'] = Object.assign({}, this['@data'], state['@data']); - this['@did'] = `did:fabric:${this.id}`; - this['@id'] = this.id; - return this; - } - - pack (data) { - if (!data) data = this['@data']; - return json(data); - } - - /** - * Convert to {@link Buffer}. - * @param {Mixed} [input] Input to serialize. - * @return {Buffer} {@link Store}-able blob. - */ - serialize (input = this.state, encoding = 'json') { - let result = null; - - if (typeof input === 'string') { - return Buffer.from(`${json(input)}`, 'utf8'); - } else if (input instanceof Array) { - result = Buffer.from(`${JSON.stringify(input)}`, 'utf8'); - } else if (input instanceof Buffer) { - result = input; - } else if (input['@type'] && input['@data']) { - return this.serialize(input['@data']); - } else { - switch (input.constructor.name) { - case 'Function': - result = Buffer.from(input.toString('utf8')); - break; - case 'Boolean': - result = Buffer.from(JSON.stringify(input)); - break; - case 'Buffer': - result = Buffer.from(JSON.stringify(input.toString('utf8'))); - break; - case 'Object': - result = Buffer.from(JSON.stringify(input)); - break; - default: - result = input.toString('utf8'); - break; - } - - // strip special fields - // TODO: order? - for (const name in input) { - if (name.charAt(0) === '@') { - continue; - } - } - } - - return JSON.parse(json(result)); - } - - /** - * Take a hex-encoded input and convert to a {@link State} object. - * @param {String} input [description] - * @return {State} [description] - */ - deserialize (input) { - let output = null; - - if (typeof input === 'string') { - // Let's create a state object... - try { - let state = new State$9(input); - // Assign our output to the state data - output = state['@data']; - } catch (E) { - this.error('Could not parse string as Buffer:', E); - } - - return output; - } else { - this.log('WARNING:', `input not a string`, input); - } - - if (!output) return null; - - switch (output['@type']) { - case 'String': - output = output['@buffer'].toString(output['@encoding']); - break; - } - - return output; - } - - flatten () { - let map = {}; - - for (let k in this['@data']) { - map[k] = this.serialize(this['@data'][k]); - } - - return map; - } - - /** - * Creates a new child {@link State}, with `@parent` set to - * the current {@link State} by immutable identifier. - * @returns {State} - */ - fork () { - let data = Object.assign({ - '@parent': this.id - }, this['@data']); - return new State$9(data); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path = '') { - // return pointer.get(this.state, path); - let result = null; - try { - result = pointer$5.get(this['@entity']['@data'], path); - } catch (exception) { - console.error('[FABRIC:STATE]', 'Could not retrieve path:', path, pointer$5.get(this['@entity']['@data'], '/'), exception); - } - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - // console.log('setting:', path, value); - pointer$5.set(this.value, path, value); - pointer$5.set(this['@entity']['@data'], path, value); - const result = pointer$5.set(this.value, path, value); - this.commit(); - return result; - } - - /** - * Increment the vector clock, broadcast all changes as a transaction. - */ - commit () { - ++this._clock; - - this['@parent'] = this.id; - this['@preimage'] = this.toString(); - this['@constructor'] = this.constructor; - - if (this.observer) { - this['@changes'] = monitor$5.generate(this.observer); - } - - this['@id'] = this.id; - - if (this['@changes'] && this['@changes'].length) { - this.emit('changes', this['@changes']); - this.emit('state', this['@state']); - this.emit('message', { - '@type': 'Transaction', - '@data': { - 'changes': this['@changes'], - 'state': this['@changes'] - } - }); - } - - return this; - } - - /** - * Compose a JSON string for network consumption. - * @return {String} JSON-encoded {@link String}. - */ - render () { - this['@id'] = this.id; - this['@encoding'] = 'json'; - this['@output'] = this.serialize(this['@entity']['@data'], 'json'); - this['@commit'] = this.commit(); - - return this['@output'].toString('utf8'); - } - } - - var state$2 = State$9; - - var dist$1 = {}; - - var bufferReverse = function reverse (src) { - var buffer = new Buffer(src.length); - - for (var i = 0, j = src.length - 1; i <= j; ++i, --j) { - buffer[i] = src[j]; - buffer[j] = src[i]; - } - - return buffer - }; - - var cryptoJs = {exports: {}}; - - var core = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(); - } - }(commonjsGlobal, function () { - - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined$1) { - /* - * Local polyfil of Object.create - */ - var create = Object.create || (function () { - function F() {} - return function (obj) { - var subtype; - - F.prototype = obj; - - subtype = new F(); - - F.prototype = null; - - return subtype; - }; - }()); - - /** - * CryptoJS namespace. - */ - var C = {}; - - /** - * Library namespace. - */ - var C_lib = C.lib = {}; - - /** - * Base object for prototypal inheritance. - */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); - - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } - - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; - - // Reference supertype - subtype.$super = this; - - return subtype; - }, - - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); - - return instance; - }, - - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, - - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } - } - - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; - } - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); - } - }; - }()); - - /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined$1) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } - }, - - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, - - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; - - // Clamp excess bits - this.clamp(); - - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var i = 0; i < thatSigBytes; i += 4) { - thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - var r = (function (m_w) { - var m_w = m_w; - var m_z = 0x3ade68b1; - var mask = 0xffffffff; - - return function () { - m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; - m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; - var result = ((m_z << 0x10) + m_w) & mask; - result /= 0x100000000; - result += 0.5; - return result * (Math.random() > .5 ? 1 : -1); - } - }); - - for (var i = 0, rcache; i < nBytes; i += 4) { - var _r = r((rcache || Math.random()) * 0x100000000); - - rcache = _r() * 0x3ade67b7; - words.push((_r() * 0x100000000) | 0); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - var processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512/32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - return CryptoJS; - - })); - }(core)); - - var x64Core = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; - - /** - * x64 namespace. - */ - var C_x64 = C.x64 = {}; - - /** - * A 64-bit word. - */ - C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } - - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, - - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, - - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; - - // return X64Word.create(high, low); - // } - }); - - /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - C_x64.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined$1) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; - } - }, - - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { - // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, - - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - - // Clone "words" array - var words = clone.words = this.words.slice(0); - - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); - } - - return clone; - } - }); - }()); - - - return CryptoJS; - - })); - }(x64Core)); - - var libTypedarrays = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Check if typed arrays are supported - if (typeof ArrayBuffer != 'function') { - return; - } - - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - - // Reference original init - var superInit = WordArray.init; - - // Augment WordArray.init to handle typed arrays - var subInit = WordArray.init = function (typedArray) { - // Convert buffers to uint8 - if (typedArray instanceof ArrayBuffer) { - typedArray = new Uint8Array(typedArray); - } - - // Convert other array views to uint8 - if ( - typedArray instanceof Int8Array || - (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || - typedArray instanceof Int16Array || - typedArray instanceof Uint16Array || - typedArray instanceof Int32Array || - typedArray instanceof Uint32Array || - typedArray instanceof Float32Array || - typedArray instanceof Float64Array - ) { - typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); - } - - // Handle Uint8Array - if (typedArray instanceof Uint8Array) { - // Shortcut - var typedArrayByteLength = typedArray.byteLength; - - // Extract bytes - var words = []; - for (var i = 0; i < typedArrayByteLength; i++) { - words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); - } - - // Initialize this word array - superInit.call(this, words, typedArrayByteLength); - } else { - // Else call normal init - superInit.apply(this, arguments); - } - }; - - subInit.prototype = WordArray; - }()); - - - return CryptoJS.lib.WordArray; - - })); - }(libTypedarrays)); - - var encUtf16 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * UTF-16 BE encoding strategy. - */ - C_enc.Utf16 = C_enc.Utf16BE = { - /** - * Converts a word array to a UTF-16 BE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 BE string. - * - * @static - * - * @example - * - * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 BE string to a word array. - * - * @param {string} utf16Str The UTF-16 BE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - /** - * UTF-16 LE encoding strategy. - */ - C_enc.Utf16LE = { - /** - * Converts a word array to a UTF-16 LE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 LE string. - * - * @static - * - * @example - * - * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 LE string to a word array. - * - * @param {string} utf16Str The UTF-16 LE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - function swapEndian(word) { - return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); - } - }()); - - - return CryptoJS.enc.Utf16; - - })); - }(encUtf16)); - - var encBase64 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64 encoding strategy. - */ - C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); - */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); - - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; - - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); - - - return CryptoJS.enc.Base64; - - })); - }(encBase64)); - - var md5 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); - - /** - * MD5 hash algorithm. - */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working varialbes - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); - - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); - - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); - - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); - - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; - - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); - */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); - - - return CryptoJS.MD5; - - })); - }(md5)); - - var sha1$4 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Reusable object - var W = []; - - /** - * SHA-1 hash algorithm. - */ - var SHA1 = C_algo.SHA1 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476, - 0xc3d2e1f0 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - // Computation - for (var i = 0; i < 80; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = (n << 1) | (n >>> 31); - } - - var t = ((a << 5) | (a >>> 27)) + e + W[i]; - if (i < 20) { - t += ((b & c) | (~b & d)) + 0x5a827999; - } else if (i < 40) { - t += (b ^ c ^ d) + 0x6ed9eba1; - } else if (i < 60) { - t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; - } else /* if (i < 80) */ { - t += (b ^ c ^ d) - 0x359d3e2a; - } - - e = d; - d = c; - c = (b << 30) | (b >>> 2); - b = a; - a = t; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA1('message'); - * var hash = CryptoJS.SHA1(wordArray); - */ - C.SHA1 = Hasher._createHelper(SHA1); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA1(message, key); - */ - C.HmacSHA1 = Hasher._createHmacHelper(SHA1); - }()); - - - return CryptoJS.SHA1; - - })); - }(sha1$4)); - - var sha256$b = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Initialization and round constants tables - var H = []; - var K = []; - - // Compute constants - (function () { - function isPrime(n) { - var sqrtN = Math.sqrt(n); - for (var factor = 2; factor <= sqrtN; factor++) { - if (!(n % factor)) { - return false; - } - } - - return true; - } - - function getFractionalBits(n) { - return ((n - (n | 0)) * 0x100000000) | 0; - } - - var n = 2; - var nPrime = 0; - while (nPrime < 64) { - if (isPrime(n)) { - if (nPrime < 8) { - H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); - } - K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); - - nPrime++; - } - - n++; - } - }()); - - // Reusable object - var W = []; - - /** - * SHA-256 hash algorithm. - */ - var SHA256 = C_algo.SHA256 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init(H.slice(0)); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - var f = H[5]; - var g = H[6]; - var h = H[7]; - - // Computation - for (var i = 0; i < 64; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var gamma0x = W[i - 15]; - var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ - ((gamma0x << 14) | (gamma0x >>> 18)) ^ - (gamma0x >>> 3); - - var gamma1x = W[i - 2]; - var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ - ((gamma1x << 13) | (gamma1x >>> 19)) ^ - (gamma1x >>> 10); - - W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; - } - - var ch = (e & f) ^ (~e & g); - var maj = (a & b) ^ (a & c) ^ (b & c); - - var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); - var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); - - var t1 = h + sigma1 + ch + K[i] + W[i]; - var t2 = sigma0 + maj; - - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - H[5] = (H[5] + f) | 0; - H[6] = (H[6] + g) | 0; - H[7] = (H[7] + h) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA256('message'); - * var hash = CryptoJS.SHA256(wordArray); - */ - C.SHA256 = Hasher._createHelper(SHA256); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA256(message, key); - */ - C.HmacSHA256 = Hasher._createHmacHelper(SHA256); - }(Math)); - - - return CryptoJS.SHA256; - - })); - }(sha256$b)); - - var sha224 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha256$b.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA256 = C_algo.SHA256; - - /** - * SHA-224 hash algorithm. - */ - var SHA224 = C_algo.SHA224 = SHA256.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - ]); - }, - - _doFinalize: function () { - var hash = SHA256._doFinalize.call(this); - - hash.sigBytes -= 4; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA224('message'); - * var hash = CryptoJS.SHA224(wordArray); - */ - C.SHA224 = SHA256._createHelper(SHA224); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA224(message, key); - */ - C.HmacSHA224 = SHA256._createHmacHelper(SHA224); - }()); - - - return CryptoJS.SHA224; - - })); - }(sha224)); - - var sha512$6 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - - function X64Word_create() { - return X64Word.create.apply(X64Word, arguments); - } - - // Constants - var K = [ - X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), - X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), - X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), - X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), - X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), - X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), - X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), - X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), - X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), - X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), - X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), - X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), - X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), - X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), - X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), - X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), - X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), - X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), - X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), - X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), - X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), - X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), - X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), - X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), - X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), - X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), - X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), - X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), - X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), - X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), - X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), - X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), - X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), - X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), - X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), - X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), - X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), - X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), - X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), - X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) - ]; - - // Reusable objects - var W = []; - (function () { - for (var i = 0; i < 80; i++) { - W[i] = X64Word_create(); - } - }()); - - /** - * SHA-512 hash algorithm. - */ - var SHA512 = C_algo.SHA512 = Hasher.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), - new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), - new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), - new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var H = this._hash.words; - - var H0 = H[0]; - var H1 = H[1]; - var H2 = H[2]; - var H3 = H[3]; - var H4 = H[4]; - var H5 = H[5]; - var H6 = H[6]; - var H7 = H[7]; - - var H0h = H0.high; - var H0l = H0.low; - var H1h = H1.high; - var H1l = H1.low; - var H2h = H2.high; - var H2l = H2.low; - var H3h = H3.high; - var H3l = H3.low; - var H4h = H4.high; - var H4l = H4.low; - var H5h = H5.high; - var H5l = H5.low; - var H6h = H6.high; - var H6l = H6.low; - var H7h = H7.high; - var H7l = H7.low; - - // Working variables - var ah = H0h; - var al = H0l; - var bh = H1h; - var bl = H1l; - var ch = H2h; - var cl = H2l; - var dh = H3h; - var dl = H3l; - var eh = H4h; - var el = H4l; - var fh = H5h; - var fl = H5l; - var gh = H6h; - var gl = H6l; - var hh = H7h; - var hl = H7l; - - // Rounds - for (var i = 0; i < 80; i++) { - // Shortcut - var Wi = W[i]; - - // Extend message - if (i < 16) { - var Wih = Wi.high = M[offset + i * 2] | 0; - var Wil = Wi.low = M[offset + i * 2 + 1] | 0; - } else { - // Gamma0 - var gamma0x = W[i - 15]; - var gamma0xh = gamma0x.high; - var gamma0xl = gamma0x.low; - var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); - var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); - - // Gamma1 - var gamma1x = W[i - 2]; - var gamma1xh = gamma1x.high; - var gamma1xl = gamma1x.low; - var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); - var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); - - // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] - var Wi7 = W[i - 7]; - var Wi7h = Wi7.high; - var Wi7l = Wi7.low; - - var Wi16 = W[i - 16]; - var Wi16h = Wi16.high; - var Wi16l = Wi16.low; - - var Wil = gamma0l + Wi7l; - var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); - var Wil = Wil + gamma1l; - var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); - var Wil = Wil + Wi16l; - var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); - - Wi.high = Wih; - Wi.low = Wil; - } - - var chh = (eh & fh) ^ (~eh & gh); - var chl = (el & fl) ^ (~el & gl); - var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); - var majl = (al & bl) ^ (al & cl) ^ (bl & cl); - - var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); - var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); - var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); - var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); - - // t1 = h + sigma1 + ch + K[i] + W[i] - var Ki = K[i]; - var Kih = Ki.high; - var Kil = Ki.low; - - var t1l = hl + sigma1l; - var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); - var t1l = t1l + chl; - var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); - var t1l = t1l + Kil; - var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); - var t1l = t1l + Wil; - var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - - // t2 = sigma0 + maj - var t2l = sigma0l + majl; - var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); - - // Update working variables - hh = gh; - hl = gl; - gh = fh; - gl = fl; - fh = eh; - fl = el; - el = (dl + t1l) | 0; - eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; - dh = ch; - dl = cl; - ch = bh; - cl = bl; - bh = ah; - bl = al; - al = (t1l + t2l) | 0; - ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; - } - - // Intermediate hash value - H0l = H0.low = (H0l + al); - H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); - H1l = H1.low = (H1l + bl); - H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); - H2l = H2.low = (H2l + cl); - H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); - H3l = H3.low = (H3l + dl); - H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); - H4l = H4.low = (H4l + el); - H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); - H5l = H5.low = (H5l + fl); - H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); - H6l = H6.low = (H6l + gl); - H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); - H7l = H7.low = (H7l + hl); - H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Convert hash to 32-bit word array before returning - var hash = this._hash.toX32(); - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - }, - - blockSize: 1024/32 - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA512('message'); - * var hash = CryptoJS.SHA512(wordArray); - */ - C.SHA512 = Hasher._createHelper(SHA512); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA512(message, key); - */ - C.HmacSHA512 = Hasher._createHmacHelper(SHA512); - }()); - - - return CryptoJS.SHA512; - - })); - }(sha512$6)); - - var sha384 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports, sha512$6.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - var SHA512 = C_algo.SHA512; - - /** - * SHA-384 hash algorithm. - */ - var SHA384 = C_algo.SHA384 = SHA512.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), - new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), - new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), - new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) - ]); - }, - - _doFinalize: function () { - var hash = SHA512._doFinalize.call(this); - - hash.sigBytes -= 16; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA384('message'); - * var hash = CryptoJS.SHA384(wordArray); - */ - C.SHA384 = SHA512._createHelper(SHA384); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA384(message, key); - */ - C.HmacSHA384 = SHA512._createHmacHelper(SHA384); - }()); - - - return CryptoJS.SHA384; - - })); - }(sha384)); - - var sha3 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; - - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; - - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } - - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; - } - } - - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } - - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } - } - - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); - - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); - } - }()); - - /** - * SHA-3 hash algorithm. - */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ - /** - * Configuration options. - * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 - */ - cfg: Hasher.cfg.extend({ - outputLength: 512 - }), - - _doReset: function () { - var state = this._state = []; - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; - - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; - - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); - - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } - - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } - - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; - - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } - - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; - - // Rotate lanes - if (rhoOffset < 32) { - var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } - - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } - - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; - - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } - - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low; } - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; - - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; - - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); - - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } - - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, - - clone: function () { - var clone = Hasher.clone.call(this); - - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); - - - return CryptoJS.SHA3; - - })); - }(sha3)); - - var ripemd160$4 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var _zl = WordArray.create([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); - var _zr = WordArray.create([ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); - var _sl = WordArray.create([ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); - var _sr = WordArray.create([ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); - - var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); - var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); - - /** - * RIPEMD160 hash algorithm. - */ - var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ - _doReset: function () { - this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); - }, - - _doProcessBlock: function (M, offset) { - - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - // Swap - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - // Shortcut - var H = this._hash.words; - var hl = _hl.words; - var hr = _hr.words; - var zl = _zl.words; - var zr = _zr.words; - var sl = _sl.words; - var sr = _sr.words; - - // Working variables - var al, bl, cl, dl, el; - var ar, br, cr, dr, er; - - ar = al = H[0]; - br = bl = H[1]; - cr = cl = H[2]; - dr = dl = H[3]; - er = el = H[4]; - // Computation - var t; - for (var i = 0; i < 80; i += 1) { - t = (al + M[offset+zl[i]])|0; - if (i<16){ - t += f1(bl,cl,dl) + hl[0]; - } else if (i<32) { - t += f2(bl,cl,dl) + hl[1]; - } else if (i<48) { - t += f3(bl,cl,dl) + hl[2]; - } else if (i<64) { - t += f4(bl,cl,dl) + hl[3]; - } else {// if (i<80) { - t += f5(bl,cl,dl) + hl[4]; - } - t = t|0; - t = rotl(t,sl[i]); - t = (t+el)|0; - al = el; - el = dl; - dl = rotl(cl, 10); - cl = bl; - bl = t; - - t = (ar + M[offset+zr[i]])|0; - if (i<16){ - t += f5(br,cr,dr) + hr[0]; - } else if (i<32) { - t += f4(br,cr,dr) + hr[1]; - } else if (i<48) { - t += f3(br,cr,dr) + hr[2]; - } else if (i<64) { - t += f2(br,cr,dr) + hr[3]; - } else {// if (i<80) { - t += f1(br,cr,dr) + hr[4]; - } - t = t|0; - t = rotl(t,sr[i]) ; - t = (t+er)|0; - ar = er; - er = dr; - dr = rotl(cr, 10); - cr = br; - br = t; - } - // Intermediate hash value - t = (H[1] + cl + dr)|0; - H[1] = (H[2] + dl + er)|0; - H[2] = (H[3] + el + ar)|0; - H[3] = (H[4] + al + br)|0; - H[4] = (H[0] + bl + cr)|0; - H[0] = t; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | - (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) - ); - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 5; i++) { - // Shortcut - var H_i = H[i]; - - // Swap - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - - function f1(x, y, z) { - return ((x) ^ (y) ^ (z)); - - } - - function f2(x, y, z) { - return (((x)&(y)) | ((~x)&(z))); - } - - function f3(x, y, z) { - return (((x) | (~(y))) ^ (z)); - } - - function f4(x, y, z) { - return (((x) & (z)) | ((y)&(~(z)))); - } - - function f5(x, y, z) { - return ((x) ^ ((y) |(~(z)))); - - } - - function rotl(x,n) { - return (x<>>(32-n)); - } - - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.RIPEMD160('message'); - * var hash = CryptoJS.RIPEMD160(wordArray); - */ - C.RIPEMD160 = Hasher._createHelper(RIPEMD160); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacRIPEMD160(message, key); - */ - C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); - }()); - - - return CryptoJS.RIPEMD160; - - })); - }(ripemd160$4)); - - var hmac$2 = {exports: {}}; - - (function (module, exports) { - (function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var C_algo = C.algo; - - /** - * HMAC algorithm. - */ - C_algo.HMAC = Base.extend({ - /** - * Initializes a newly created HMAC. - * - * @param {Hasher} hasher The hash algorithm to use. - * @param {WordArray|string} key The secret key. - * - * @example - * - * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); - */ - init: function (hasher, key) { - // Init hasher - hasher = this._hasher = new hasher.init(); - - // Convert string to WordArray, else assume WordArray already - if (typeof key == 'string') { - key = Utf8.parse(key); - } - - // Shortcuts - var hasherBlockSize = hasher.blockSize; - var hasherBlockSizeBytes = hasherBlockSize * 4; - - // Allow arbitrary length keys - if (key.sigBytes > hasherBlockSizeBytes) { - key = hasher.finalize(key); - } - - // Clamp excess bits - key.clamp(); - - // Clone key for inner and outer pads - var oKey = this._oKey = key.clone(); - var iKey = this._iKey = key.clone(); - - // Shortcuts - var oKeyWords = oKey.words; - var iKeyWords = iKey.words; - - // XOR keys with pad constants - for (var i = 0; i < hasherBlockSize; i++) { - oKeyWords[i] ^= 0x5c5c5c5c; - iKeyWords[i] ^= 0x36363636; - } - oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; - - // Set initial values - this.reset(); - }, - - /** - * Resets this HMAC to its initial state. - * - * @example - * - * hmacHasher.reset(); - */ - reset: function () { - // Shortcut - var hasher = this._hasher; - - // Reset - hasher.reset(); - hasher.update(this._iKey); - }, - - /** - * Updates this HMAC with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {HMAC} This HMAC instance. - * - * @example - * - * hmacHasher.update('message'); - * hmacHasher.update(wordArray); - */ - update: function (messageUpdate) { - this._hasher.update(messageUpdate); - - // Chainable - return this; - }, - - /** - * Finalizes the HMAC computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The HMAC. - * - * @example - * - * var hmac = hmacHasher.finalize(); - * var hmac = hmacHasher.finalize('message'); - * var hmac = hmacHasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Shortcut - var hasher = this._hasher; - - // Compute HMAC - var innerHash = hasher.finalize(messageUpdate); - hasher.reset(); - var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); - - return hmac; - } - }); - }()); - - - })); - }(hmac$2)); - - var pbkdf2$8 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha1$4.exports, hmac$2.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; - - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: SHA1, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); - - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); - - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; - - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); - - // Shortcut - var intermediateWords = intermediate.words; - - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } - - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); - - - return CryptoJS.PBKDF2; - - })); - }(pbkdf2$8)); - - var evpkdf = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha1$4.exports, hmac$2.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var MD5 = C_algo.MD5; - - /** - * This key derivation function is meant to conform with EVP_BytesToKey. - * www.openssl.org/docs/crypto/EVP_BytesToKey.html - */ - var EvpKDF = C_algo.EvpKDF = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hash algorithm to use. Default: MD5 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: MD5, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.EvpKDF.create(); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init hasher - var hasher = cfg.hasher.create(); - - // Initial values - var derivedKey = WordArray.create(); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - if (block) { - hasher.update(block); - } - var block = hasher.update(password).finalize(salt); - hasher.reset(); - - // Iterations - for (var i = 1; i < iterations; i++) { - block = hasher.finalize(block); - hasher.reset(); - } - - derivedKey.concat(block); - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.EvpKDF(password, salt); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.EvpKDF = function (password, salt, cfg) { - return EvpKDF.create(cfg).compute(password, salt); - }; - }()); - - - return CryptoJS.EvpKDF; - - })); - }(evpkdf)); - - var cipherCore = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, evpkdf.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Cipher core components. - */ - CryptoJS.lib.Cipher || (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; - var C_enc = C.enc; - C_enc.Utf8; - var Base64 = C_enc.Base64; - var C_algo = C.algo; - var EvpKDF = C_algo.EvpKDF; - - /** - * Abstract base cipher template. - * - * @property {number} keySize This cipher's key size. Default: 4 (128 bits) - * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) - * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. - * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. - */ - var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - * - * @property {WordArray} iv The IV to use for this operation. - */ - cfg: Base.extend(), - - /** - * Creates this cipher in encryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); - */ - createEncryptor: function (key, cfg) { - return this.create(this._ENC_XFORM_MODE, key, cfg); - }, - - /** - * Creates this cipher in decryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); - */ - createDecryptor: function (key, cfg) { - return this.create(this._DEC_XFORM_MODE, key, cfg); - }, - - /** - * Initializes a newly created cipher. - * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @example - * - * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); - */ - init: function (xformMode, key, cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Store transform mode and key - this._xformMode = xformMode; - this._key = key; - - // Set initial values - this.reset(); - }, - - /** - * Resets this cipher to its initial state. - * - * @example - * - * cipher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-cipher logic - this._doReset(); - }, - - /** - * Adds data to be encrypted or decrypted. - * - * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. - * - * @return {WordArray} The data after processing. - * - * @example - * - * var encrypted = cipher.process('data'); - * var encrypted = cipher.process(wordArray); - */ - process: function (dataUpdate) { - // Append - this._append(dataUpdate); - - // Process available blocks - return this._process(); - }, - - /** - * Finalizes the encryption or decryption process. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. - * - * @return {WordArray} The data after final processing. - * - * @example - * - * var encrypted = cipher.finalize(); - * var encrypted = cipher.finalize('data'); - * var encrypted = cipher.finalize(wordArray); - */ - finalize: function (dataUpdate) { - // Final data update - if (dataUpdate) { - this._append(dataUpdate); - } - - // Perform concrete-cipher logic - var finalProcessedData = this._doFinalize(); - - return finalProcessedData; - }, - - keySize: 128/32, - - ivSize: 128/32, - - _ENC_XFORM_MODE: 1, - - _DEC_XFORM_MODE: 2, - - /** - * Creates shortcut functions to a cipher's object interface. - * - * @param {Cipher} cipher The cipher to create a helper for. - * - * @return {Object} An object with encrypt and decrypt shortcut functions. - * - * @static - * - * @example - * - * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); - */ - _createHelper: (function () { - function selectCipherStrategy(key) { - if (typeof key == 'string') { - return PasswordBasedCipher; - } else { - return SerializableCipher; - } - } - - return function (cipher) { - return { - encrypt: function (message, key, cfg) { - return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); - }, - - decrypt: function (ciphertext, key, cfg) { - return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); - } - }; - }; - }()) - }); - - /** - * Abstract base stream cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) - */ - C_lib.StreamCipher = Cipher.extend({ - _doFinalize: function () { - // Process partial blocks - var finalProcessedBlocks = this._process(!!'flush'); - - return finalProcessedBlocks; - }, - - blockSize: 1 - }); - - /** - * Mode namespace. - */ - var C_mode = C.mode = {}; - - /** - * Abstract base block cipher mode template. - */ - var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ - /** - * Creates this mode for encryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); - */ - createEncryptor: function (cipher, iv) { - return this.Encryptor.create(cipher, iv); - }, - - /** - * Creates this mode for decryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); - */ - createDecryptor: function (cipher, iv) { - return this.Decryptor.create(cipher, iv); - }, - - /** - * Initializes a newly created mode. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @example - * - * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); - */ - init: function (cipher, iv) { - this._cipher = cipher; - this._iv = iv; - } - }); - - /** - * Cipher Block Chaining mode. - */ - var CBC = C_mode.CBC = (function () { - /** - * Abstract base CBC mode. - */ - var CBC = BlockCipherMode.extend(); - - /** - * CBC encryptor. - */ - CBC.Encryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // XOR and encrypt - xorBlock.call(this, words, offset, blockSize); - cipher.encryptBlock(words, offset); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - /** - * CBC decryptor. - */ - CBC.Decryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - // Decrypt and XOR - cipher.decryptBlock(words, offset); - xorBlock.call(this, words, offset, blockSize); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function xorBlock(words, offset, blockSize) { - // Shortcut - var iv = this._iv; - - // Choose mixing block - if (iv) { - var block = iv; - - // Remove IV for subsequent blocks - this._iv = undefined$1; - } else { - var block = this._prevBlock; - } - - // XOR blocks - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= block[i]; - } - } - - return CBC; - }()); - - /** - * Padding namespace. - */ - var C_pad = C.pad = {}; - - /** - * PKCS #5/7 padding strategy. - */ - var Pkcs7 = C_pad.Pkcs7 = { - /** - * Pads data using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to pad. - * @param {number} blockSize The multiple that the data should be padded to. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.pad(wordArray, 4); - */ - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Create padding word - var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; - - // Create padding - var paddingWords = []; - for (var i = 0; i < nPaddingBytes; i += 4) { - paddingWords.push(paddingWord); - } - var padding = WordArray.create(paddingWords, nPaddingBytes); - - // Add padding - data.concat(padding); - }, - - /** - * Unpads data that had been padded using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to unpad. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.unpad(wordArray); - */ - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - /** - * Abstract base block cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) - */ - C_lib.BlockCipher = Cipher.extend({ - /** - * Configuration options. - * - * @property {Mode} mode The block mode to use. Default: CBC - * @property {Padding} padding The padding strategy to use. Default: Pkcs7 - */ - cfg: Cipher.cfg.extend({ - mode: CBC, - padding: Pkcs7 - }), - - reset: function () { - // Reset cipher - Cipher.reset.call(this); - - // Shortcuts - var cfg = this.cfg; - var iv = cfg.iv; - var mode = cfg.mode; - - // Reset block mode - if (this._xformMode == this._ENC_XFORM_MODE) { - var modeCreator = mode.createEncryptor; - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - var modeCreator = mode.createDecryptor; - // Keep at least one block in the buffer for unpadding - this._minBufferSize = 1; - } - - if (this._mode && this._mode.__creator == modeCreator) { - this._mode.init(this, iv && iv.words); - } else { - this._mode = modeCreator.call(mode, this, iv && iv.words); - this._mode.__creator = modeCreator; - } - }, - - _doProcessBlock: function (words, offset) { - this._mode.processBlock(words, offset); - }, - - _doFinalize: function () { - // Shortcut - var padding = this.cfg.padding; - - // Finalize - if (this._xformMode == this._ENC_XFORM_MODE) { - // Pad data - padding.pad(this._data, this.blockSize); - - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - - // Unpad data - padding.unpad(finalProcessedBlocks); - } - - return finalProcessedBlocks; - }, - - blockSize: 128/32 - }); - - /** - * A collection of cipher parameters. - * - * @property {WordArray} ciphertext The raw ciphertext. - * @property {WordArray} key The key to this ciphertext. - * @property {WordArray} iv The IV used in the ciphering operation. - * @property {WordArray} salt The salt used with a key derivation function. - * @property {Cipher} algorithm The cipher algorithm. - * @property {Mode} mode The block mode used in the ciphering operation. - * @property {Padding} padding The padding scheme used in the ciphering operation. - * @property {number} blockSize The block size of the cipher. - * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. - */ - var CipherParams = C_lib.CipherParams = Base.extend({ - /** - * Initializes a newly created cipher params object. - * - * @param {Object} cipherParams An object with any of the possible cipher parameters. - * - * @example - * - * var cipherParams = CryptoJS.lib.CipherParams.create({ - * ciphertext: ciphertextWordArray, - * key: keyWordArray, - * iv: ivWordArray, - * salt: saltWordArray, - * algorithm: CryptoJS.algo.AES, - * mode: CryptoJS.mode.CBC, - * padding: CryptoJS.pad.PKCS7, - * blockSize: 4, - * formatter: CryptoJS.format.OpenSSL - * }); - */ - init: function (cipherParams) { - this.mixIn(cipherParams); - }, - - /** - * Converts this cipher params object to a string. - * - * @param {Format} formatter (Optional) The formatting strategy to use. - * - * @return {string} The stringified cipher params. - * - * @throws Error If neither the formatter nor the default formatter is set. - * - * @example - * - * var string = cipherParams + ''; - * var string = cipherParams.toString(); - * var string = cipherParams.toString(CryptoJS.format.OpenSSL); - */ - toString: function (formatter) { - return (formatter || this.formatter).stringify(this); - } - }); - - /** - * Format namespace. - */ - var C_format = C.format = {}; - - /** - * OpenSSL formatting strategy. - */ - var OpenSSLFormatter = C_format.OpenSSL = { - /** - * Converts a cipher params object to an OpenSSL-compatible string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The OpenSSL-compatible string. - * - * @static - * - * @example - * - * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); - */ - stringify: function (cipherParams) { - // Shortcuts - var ciphertext = cipherParams.ciphertext; - var salt = cipherParams.salt; - - // Format - if (salt) { - var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); - } else { - var wordArray = ciphertext; - } - - return wordArray.toString(Base64); - }, - - /** - * Converts an OpenSSL-compatible string to a cipher params object. - * - * @param {string} openSSLStr The OpenSSL-compatible string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); - */ - parse: function (openSSLStr) { - // Parse base64 - var ciphertext = Base64.parse(openSSLStr); - - // Shortcut - var ciphertextWords = ciphertext.words; - - // Test for salt - if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { - // Extract salt - var salt = WordArray.create(ciphertextWords.slice(2, 4)); - - // Remove salt from ciphertext - ciphertextWords.splice(0, 4); - ciphertext.sigBytes -= 16; - } - - return CipherParams.create({ ciphertext: ciphertext, salt: salt }); - } - }; - - /** - * A cipher wrapper that returns ciphertext as a serializable cipher params object. - */ - var SerializableCipher = C_lib.SerializableCipher = Base.extend({ - /** - * Configuration options. - * - * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL - */ - cfg: Base.extend({ - format: OpenSSLFormatter - }), - - /** - * Encrypts a message. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Encrypt - var encryptor = cipher.createEncryptor(key, cfg); - var ciphertext = encryptor.finalize(message); - - // Shortcut - var cipherCfg = encryptor.cfg; - - // Create and return serializable cipher params - return CipherParams.create({ - ciphertext: ciphertext, - key: key, - iv: cipherCfg.iv, - algorithm: cipher, - mode: cipherCfg.mode, - padding: cipherCfg.padding, - blockSize: cipher.blockSize, - formatter: cfg.format - }); - }, - - /** - * Decrypts serialized ciphertext. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Decrypt - var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - - return plaintext; - }, - - /** - * Converts serialized ciphertext to CipherParams, - * else assumed CipherParams already and returns ciphertext unchanged. - * - * @param {CipherParams|string} ciphertext The ciphertext. - * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. - * - * @return {CipherParams} The unserialized ciphertext. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); - */ - _parse: function (ciphertext, format) { - if (typeof ciphertext == 'string') { - return format.parse(ciphertext, this); - } else { - return ciphertext; - } - } - }); - - /** - * Key derivation function namespace. - */ - var C_kdf = C.kdf = {}; - - /** - * OpenSSL key derivation function. - */ - var OpenSSLKdf = C_kdf.OpenSSL = { - /** - * Derives a key and IV from a password. - * - * @param {string} password The password to derive from. - * @param {number} keySize The size in words of the key to generate. - * @param {number} ivSize The size in words of the IV to generate. - * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. - * - * @return {CipherParams} A cipher params object with the key, IV, and salt. - * - * @static - * - * @example - * - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); - */ - execute: function (password, keySize, ivSize, salt) { - // Generate random salt - if (!salt) { - salt = WordArray.random(64/8); - } - - // Derive key and IV - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - - // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; - - // Return params - return CipherParams.create({ key: key, iv: iv, salt: salt }); - } - }; - - /** - * A serializable cipher wrapper that derives the key from a password, - * and returns ciphertext as a serializable cipher params object. - */ - var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ - /** - * Configuration options. - * - * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL - */ - cfg: SerializableCipher.cfg.extend({ - kdf: OpenSSLKdf - }), - - /** - * Encrypts a message using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Encrypt - var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); - - // Mix in derived params - ciphertext.mixIn(derivedParams); - - return ciphertext; - }, - - /** - * Decrypts serialized ciphertext using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Decrypt - var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); - - return plaintext; - } - }); - }()); - - - })); - }(cipherCore)); - - var modeCfb = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Cipher Feedback block mode. - */ - CryptoJS.mode.CFB = (function () { - var CFB = CryptoJS.lib.BlockCipherMode.extend(); - - CFB.Encryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - CFB.Decryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { - // Shortcut - var iv = this._iv; - - // Generate keystream - if (iv) { - var keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var keystream = this._prevBlock; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - - return CFB; - }()); - - - return CryptoJS.mode.CFB; - - })); - }(modeCfb)); - - var modeCtr = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Counter block mode. - */ - CryptoJS.mode.CTR = (function () { - var CTR = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = CTR.Encryptor = CTR.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Increment counter - counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0; - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTR.Decryptor = Encryptor; - - return CTR; - }()); - - - return CryptoJS.mode.CTR; - - })); - }(modeCtr)); - - var modeCtrGladman = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - */ - CryptoJS.mode.CTRGladman = (function () { - var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - - function incWord(word) - { - if (((word >> 24) & 0xff) === 0xff) { //overflow - var b1 = (word >> 16)&0xff; - var b2 = (word >> 8)&0xff; - var b3 = word & 0xff; - - if (b1 === 0xff) // overflow b1 - { - b1 = 0; - if (b2 === 0xff) - { - b2 = 0; - if (b3 === 0xff) - { - b3 = 0; - } - else - { - ++b3; - } - } - else - { - ++b2; - } - } - else - { - ++b1; - } - - word = 0; - word += (b1 << 16); - word += (b2 << 8); - word += b3; - } - else - { - word += (0x01 << 24); - } - return word; - } - - function incCounter(counter) - { - if ((counter[0] = incWord(counter[0])) === 0) - { - // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 - counter[1] = incWord(counter[1]); - } - return counter; - } - - var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - - incCounter(counter); - - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTRGladman.Decryptor = Encryptor; - - return CTRGladman; - }()); - - - - - return CryptoJS.mode.CTRGladman; - - })); - }(modeCtrGladman)); - - var modeOfb = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Output Feedback block mode. - */ - CryptoJS.mode.OFB = (function () { - var OFB = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = OFB.Encryptor = OFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var keystream = this._keystream; - - // Generate keystream - if (iv) { - keystream = this._keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - OFB.Decryptor = Encryptor; - - return OFB; - }()); - - - return CryptoJS.mode.OFB; - - })); - }(modeOfb)); - - var modeEcb = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Electronic Codebook block mode. - */ - CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); - - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); - - return ECB; - }()); - - - return CryptoJS.mode.ECB; - - })); - }(modeEcb)); - - var padAnsix923 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * ANSI X.923 padding strategy. - */ - CryptoJS.pad.AnsiX923 = { - pad: function (data, blockSize) { - // Shortcuts - var dataSigBytes = data.sigBytes; - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; - - // Compute last byte position - var lastBytePos = dataSigBytes + nPaddingBytes - 1; - - // Pad - data.clamp(); - data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); - data.sigBytes += nPaddingBytes; - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - return CryptoJS.pad.Ansix923; - - })); - }(padAnsix923)); - - var padIso10126 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * ISO 10126 padding strategy. - */ - CryptoJS.pad.Iso10126 = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Pad - data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). - concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - return CryptoJS.pad.Iso10126; - - })); - }(padIso10126)); - - var padIso97971 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * ISO/IEC 9797-1 Padding Method 2. - */ - CryptoJS.pad.Iso97971 = { - pad: function (data, blockSize) { - // Add 0x80 byte - data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); - - // Zero pad the rest - CryptoJS.pad.ZeroPadding.pad(data, blockSize); - }, - - unpad: function (data) { - // Remove zero padding - CryptoJS.pad.ZeroPadding.unpad(data); - - // Remove one more byte -- the 0x80 byte - data.sigBytes--; - } - }; - - - return CryptoJS.pad.Iso97971; - - })); - }(padIso97971)); - - var padZeropadding = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * Zero padding strategy. - */ - CryptoJS.pad.ZeroPadding = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Pad - data.clamp(); - data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); - }, - - unpad: function (data) { - // Shortcut - var dataWords = data.words; - - // Unpad - var i = data.sigBytes - 1; - while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { - i--; - } - data.sigBytes = i + 1; - } - }; - - - return CryptoJS.pad.ZeroPadding; - - })); - }(padZeropadding)); - - var padNopadding = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - /** - * A noop padding strategy. - */ - CryptoJS.pad.NoPadding = { - pad: function () { - }, - - unpad: function () { - } - }; - - - return CryptoJS.pad.NoPadding; - - })); - }(padNopadding)); - - var formatHex = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var CipherParams = C_lib.CipherParams; - var C_enc = C.enc; - var Hex = C_enc.Hex; - var C_format = C.format; - - C_format.Hex = { - /** - * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The hexadecimally encoded string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.format.Hex.stringify(cipherParams); - */ - stringify: function (cipherParams) { - return cipherParams.ciphertext.toString(Hex); - }, - - /** - * Converts a hexadecimally encoded ciphertext string to a cipher params object. - * - * @param {string} input The hexadecimally encoded string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.Hex.parse(hexString); - */ - parse: function (input) { - var ciphertext = Hex.parse(input); - return CipherParams.create({ ciphertext: ciphertext }); - } - }; - }()); - - - return CryptoJS.format.Hex; - - })); - }(formatHex)); - - var aes$6 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Lookup tables - var SBOX = []; - var INV_SBOX = []; - var SUB_MIX_0 = []; - var SUB_MIX_1 = []; - var SUB_MIX_2 = []; - var SUB_MIX_3 = []; - var INV_SUB_MIX_0 = []; - var INV_SUB_MIX_1 = []; - var INV_SUB_MIX_2 = []; - var INV_SUB_MIX_3 = []; - - // Compute lookup tables - (function () { - // Compute double table - var d = []; - for (var i = 0; i < 256; i++) { - if (i < 128) { - d[i] = i << 1; - } else { - d[i] = (i << 1) ^ 0x11b; - } - } - - // Walk GF(2^8) - var x = 0; - var xi = 0; - for (var i = 0; i < 256; i++) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; - SBOX[x] = sx; - INV_SBOX[sx] = x; - - // Compute multiplication - var x2 = d[x]; - var x4 = d[x2]; - var x8 = d[x4]; - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100); - SUB_MIX_0[x] = (t << 24) | (t >>> 8); - SUB_MIX_1[x] = (t << 16) | (t >>> 16); - SUB_MIX_2[x] = (t << 8) | (t >>> 24); - SUB_MIX_3[x] = t; - - // Compute inv sub bytes, inv mix columns tables - var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); - INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); - INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); - INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); - INV_SUB_MIX_3[sx] = t; - - // Compute next counter - if (!x) { - x = xi = 1; - } else { - x = x2 ^ d[d[d[x8 ^ x2]]]; - xi ^= d[d[xi]]; - } - } - }()); - - // Precomputed Rcon lookup - var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; - - /** - * AES block cipher algorithm. - */ - var AES = C_algo.AES = BlockCipher.extend({ - _doReset: function () { - // Skip reset of nRounds has been set before and key did not change - if (this._nRounds && this._keyPriorReset === this._key) { - return; - } - - // Shortcuts - var key = this._keyPriorReset = this._key; - var keyWords = key.words; - var keySize = key.sigBytes / 4; - - // Compute number of rounds - var nRounds = this._nRounds = keySize + 6; - - // Compute number of key schedule rows - var ksRows = (nRounds + 1) * 4; - - // Compute key schedule - var keySchedule = this._keySchedule = []; - for (var ksRow = 0; ksRow < ksRows; ksRow++) { - if (ksRow < keySize) { - keySchedule[ksRow] = keyWords[ksRow]; - } else { - var t = keySchedule[ksRow - 1]; - - if (!(ksRow % keySize)) { - // Rot word - t = (t << 8) | (t >>> 24); - - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - - // Mix Rcon - t ^= RCON[(ksRow / keySize) | 0] << 24; - } else if (keySize > 6 && ksRow % keySize == 4) { - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - } - - keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; - } - } - - // Compute inv key schedule - var invKeySchedule = this._invKeySchedule = []; - for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { - var ksRow = ksRows - invKsRow; - - if (invKsRow % 4) { - var t = keySchedule[ksRow]; - } else { - var t = keySchedule[ksRow - 4]; - } - - if (invKsRow < 4 || ksRow <= 4) { - invKeySchedule[invKsRow] = t; - } else { - invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ - INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; - } - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); - }, - - decryptBlock: function (M, offset) { - // Swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - - this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); - - // Inv swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - }, - - _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { - // Shortcut - var nRounds = this._nRounds; - - // Get input, add round key - var s0 = M[offset] ^ keySchedule[0]; - var s1 = M[offset + 1] ^ keySchedule[1]; - var s2 = M[offset + 2] ^ keySchedule[2]; - var s3 = M[offset + 3] ^ keySchedule[3]; - - // Key schedule row counter - var ksRow = 4; - - // Rounds - for (var round = 1; round < nRounds; round++) { - // Shift rows, sub bytes, mix columns, add round key - var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; - var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; - var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; - var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; - - // Update state - s0 = t0; - s1 = t1; - s2 = t2; - s3 = t3; - } - - // Shift rows, sub bytes, add round key - var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; - var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; - var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; - var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; - - // Set output - M[offset] = t0; - M[offset + 1] = t1; - M[offset + 2] = t2; - M[offset + 3] = t3; - }, - - keySize: 256/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); - */ - C.AES = BlockCipher._createHelper(AES); - }()); - - - return CryptoJS.AES; - - })); - }(aes$6)); - - var tripledes = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Permuted Choice 1 constants - var PC1 = [ - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, 27, 19, 11, 3, - 60, 52, 44, 36, 63, 55, 47, 39, - 31, 23, 15, 7, 62, 54, 46, 38, - 30, 22, 14, 6, 61, 53, 45, 37, - 29, 21, 13, 5, 28, 20, 12, 4 - ]; - - // Permuted Choice 2 constants - var PC2 = [ - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 - ]; - - // Cumulative bit shift constants - var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; - - // SBOXes and round permutation constants - var SBOX_P = [ - { - 0x0: 0x808200, - 0x10000000: 0x8000, - 0x20000000: 0x808002, - 0x30000000: 0x2, - 0x40000000: 0x200, - 0x50000000: 0x808202, - 0x60000000: 0x800202, - 0x70000000: 0x800000, - 0x80000000: 0x202, - 0x90000000: 0x800200, - 0xa0000000: 0x8200, - 0xb0000000: 0x808000, - 0xc0000000: 0x8002, - 0xd0000000: 0x800002, - 0xe0000000: 0x0, - 0xf0000000: 0x8202, - 0x8000000: 0x0, - 0x18000000: 0x808202, - 0x28000000: 0x8202, - 0x38000000: 0x8000, - 0x48000000: 0x808200, - 0x58000000: 0x200, - 0x68000000: 0x808002, - 0x78000000: 0x2, - 0x88000000: 0x800200, - 0x98000000: 0x8200, - 0xa8000000: 0x808000, - 0xb8000000: 0x800202, - 0xc8000000: 0x800002, - 0xd8000000: 0x8002, - 0xe8000000: 0x202, - 0xf8000000: 0x800000, - 0x1: 0x8000, - 0x10000001: 0x2, - 0x20000001: 0x808200, - 0x30000001: 0x800000, - 0x40000001: 0x808002, - 0x50000001: 0x8200, - 0x60000001: 0x200, - 0x70000001: 0x800202, - 0x80000001: 0x808202, - 0x90000001: 0x808000, - 0xa0000001: 0x800002, - 0xb0000001: 0x8202, - 0xc0000001: 0x202, - 0xd0000001: 0x800200, - 0xe0000001: 0x8002, - 0xf0000001: 0x0, - 0x8000001: 0x808202, - 0x18000001: 0x808000, - 0x28000001: 0x800000, - 0x38000001: 0x200, - 0x48000001: 0x8000, - 0x58000001: 0x800002, - 0x68000001: 0x2, - 0x78000001: 0x8202, - 0x88000001: 0x8002, - 0x98000001: 0x800202, - 0xa8000001: 0x202, - 0xb8000001: 0x808200, - 0xc8000001: 0x800200, - 0xd8000001: 0x0, - 0xe8000001: 0x8200, - 0xf8000001: 0x808002 - }, - { - 0x0: 0x40084010, - 0x1000000: 0x4000, - 0x2000000: 0x80000, - 0x3000000: 0x40080010, - 0x4000000: 0x40000010, - 0x5000000: 0x40084000, - 0x6000000: 0x40004000, - 0x7000000: 0x10, - 0x8000000: 0x84000, - 0x9000000: 0x40004010, - 0xa000000: 0x40000000, - 0xb000000: 0x84010, - 0xc000000: 0x80010, - 0xd000000: 0x0, - 0xe000000: 0x4010, - 0xf000000: 0x40080000, - 0x800000: 0x40004000, - 0x1800000: 0x84010, - 0x2800000: 0x10, - 0x3800000: 0x40004010, - 0x4800000: 0x40084010, - 0x5800000: 0x40000000, - 0x6800000: 0x80000, - 0x7800000: 0x40080010, - 0x8800000: 0x80010, - 0x9800000: 0x0, - 0xa800000: 0x4000, - 0xb800000: 0x40080000, - 0xc800000: 0x40000010, - 0xd800000: 0x84000, - 0xe800000: 0x40084000, - 0xf800000: 0x4010, - 0x10000000: 0x0, - 0x11000000: 0x40080010, - 0x12000000: 0x40004010, - 0x13000000: 0x40084000, - 0x14000000: 0x40080000, - 0x15000000: 0x10, - 0x16000000: 0x84010, - 0x17000000: 0x4000, - 0x18000000: 0x4010, - 0x19000000: 0x80000, - 0x1a000000: 0x80010, - 0x1b000000: 0x40000010, - 0x1c000000: 0x84000, - 0x1d000000: 0x40004000, - 0x1e000000: 0x40000000, - 0x1f000000: 0x40084010, - 0x10800000: 0x84010, - 0x11800000: 0x80000, - 0x12800000: 0x40080000, - 0x13800000: 0x4000, - 0x14800000: 0x40004000, - 0x15800000: 0x40084010, - 0x16800000: 0x10, - 0x17800000: 0x40000000, - 0x18800000: 0x40084000, - 0x19800000: 0x40000010, - 0x1a800000: 0x40004010, - 0x1b800000: 0x80010, - 0x1c800000: 0x0, - 0x1d800000: 0x4010, - 0x1e800000: 0x40080010, - 0x1f800000: 0x84000 - }, - { - 0x0: 0x104, - 0x100000: 0x0, - 0x200000: 0x4000100, - 0x300000: 0x10104, - 0x400000: 0x10004, - 0x500000: 0x4000004, - 0x600000: 0x4010104, - 0x700000: 0x4010000, - 0x800000: 0x4000000, - 0x900000: 0x4010100, - 0xa00000: 0x10100, - 0xb00000: 0x4010004, - 0xc00000: 0x4000104, - 0xd00000: 0x10000, - 0xe00000: 0x4, - 0xf00000: 0x100, - 0x80000: 0x4010100, - 0x180000: 0x4010004, - 0x280000: 0x0, - 0x380000: 0x4000100, - 0x480000: 0x4000004, - 0x580000: 0x10000, - 0x680000: 0x10004, - 0x780000: 0x104, - 0x880000: 0x4, - 0x980000: 0x100, - 0xa80000: 0x4010000, - 0xb80000: 0x10104, - 0xc80000: 0x10100, - 0xd80000: 0x4000104, - 0xe80000: 0x4010104, - 0xf80000: 0x4000000, - 0x1000000: 0x4010100, - 0x1100000: 0x10004, - 0x1200000: 0x10000, - 0x1300000: 0x4000100, - 0x1400000: 0x100, - 0x1500000: 0x4010104, - 0x1600000: 0x4000004, - 0x1700000: 0x0, - 0x1800000: 0x4000104, - 0x1900000: 0x4000000, - 0x1a00000: 0x4, - 0x1b00000: 0x10100, - 0x1c00000: 0x4010000, - 0x1d00000: 0x104, - 0x1e00000: 0x10104, - 0x1f00000: 0x4010004, - 0x1080000: 0x4000000, - 0x1180000: 0x104, - 0x1280000: 0x4010100, - 0x1380000: 0x0, - 0x1480000: 0x10004, - 0x1580000: 0x4000100, - 0x1680000: 0x100, - 0x1780000: 0x4010004, - 0x1880000: 0x10000, - 0x1980000: 0x4010104, - 0x1a80000: 0x10104, - 0x1b80000: 0x4000004, - 0x1c80000: 0x4000104, - 0x1d80000: 0x4010000, - 0x1e80000: 0x4, - 0x1f80000: 0x10100 - }, - { - 0x0: 0x80401000, - 0x10000: 0x80001040, - 0x20000: 0x401040, - 0x30000: 0x80400000, - 0x40000: 0x0, - 0x50000: 0x401000, - 0x60000: 0x80000040, - 0x70000: 0x400040, - 0x80000: 0x80000000, - 0x90000: 0x400000, - 0xa0000: 0x40, - 0xb0000: 0x80001000, - 0xc0000: 0x80400040, - 0xd0000: 0x1040, - 0xe0000: 0x1000, - 0xf0000: 0x80401040, - 0x8000: 0x80001040, - 0x18000: 0x40, - 0x28000: 0x80400040, - 0x38000: 0x80001000, - 0x48000: 0x401000, - 0x58000: 0x80401040, - 0x68000: 0x0, - 0x78000: 0x80400000, - 0x88000: 0x1000, - 0x98000: 0x80401000, - 0xa8000: 0x400000, - 0xb8000: 0x1040, - 0xc8000: 0x80000000, - 0xd8000: 0x400040, - 0xe8000: 0x401040, - 0xf8000: 0x80000040, - 0x100000: 0x400040, - 0x110000: 0x401000, - 0x120000: 0x80000040, - 0x130000: 0x0, - 0x140000: 0x1040, - 0x150000: 0x80400040, - 0x160000: 0x80401000, - 0x170000: 0x80001040, - 0x180000: 0x80401040, - 0x190000: 0x80000000, - 0x1a0000: 0x80400000, - 0x1b0000: 0x401040, - 0x1c0000: 0x80001000, - 0x1d0000: 0x400000, - 0x1e0000: 0x40, - 0x1f0000: 0x1000, - 0x108000: 0x80400000, - 0x118000: 0x80401040, - 0x128000: 0x0, - 0x138000: 0x401000, - 0x148000: 0x400040, - 0x158000: 0x80000000, - 0x168000: 0x80001040, - 0x178000: 0x40, - 0x188000: 0x80000040, - 0x198000: 0x1000, - 0x1a8000: 0x80001000, - 0x1b8000: 0x80400040, - 0x1c8000: 0x1040, - 0x1d8000: 0x80401000, - 0x1e8000: 0x400000, - 0x1f8000: 0x401040 - }, - { - 0x0: 0x80, - 0x1000: 0x1040000, - 0x2000: 0x40000, - 0x3000: 0x20000000, - 0x4000: 0x20040080, - 0x5000: 0x1000080, - 0x6000: 0x21000080, - 0x7000: 0x40080, - 0x8000: 0x1000000, - 0x9000: 0x20040000, - 0xa000: 0x20000080, - 0xb000: 0x21040080, - 0xc000: 0x21040000, - 0xd000: 0x0, - 0xe000: 0x1040080, - 0xf000: 0x21000000, - 0x800: 0x1040080, - 0x1800: 0x21000080, - 0x2800: 0x80, - 0x3800: 0x1040000, - 0x4800: 0x40000, - 0x5800: 0x20040080, - 0x6800: 0x21040000, - 0x7800: 0x20000000, - 0x8800: 0x20040000, - 0x9800: 0x0, - 0xa800: 0x21040080, - 0xb800: 0x1000080, - 0xc800: 0x20000080, - 0xd800: 0x21000000, - 0xe800: 0x1000000, - 0xf800: 0x40080, - 0x10000: 0x40000, - 0x11000: 0x80, - 0x12000: 0x20000000, - 0x13000: 0x21000080, - 0x14000: 0x1000080, - 0x15000: 0x21040000, - 0x16000: 0x20040080, - 0x17000: 0x1000000, - 0x18000: 0x21040080, - 0x19000: 0x21000000, - 0x1a000: 0x1040000, - 0x1b000: 0x20040000, - 0x1c000: 0x40080, - 0x1d000: 0x20000080, - 0x1e000: 0x0, - 0x1f000: 0x1040080, - 0x10800: 0x21000080, - 0x11800: 0x1000000, - 0x12800: 0x1040000, - 0x13800: 0x20040080, - 0x14800: 0x20000000, - 0x15800: 0x1040080, - 0x16800: 0x80, - 0x17800: 0x21040000, - 0x18800: 0x40080, - 0x19800: 0x21040080, - 0x1a800: 0x0, - 0x1b800: 0x21000000, - 0x1c800: 0x1000080, - 0x1d800: 0x40000, - 0x1e800: 0x20040000, - 0x1f800: 0x20000080 - }, - { - 0x0: 0x10000008, - 0x100: 0x2000, - 0x200: 0x10200000, - 0x300: 0x10202008, - 0x400: 0x10002000, - 0x500: 0x200000, - 0x600: 0x200008, - 0x700: 0x10000000, - 0x800: 0x0, - 0x900: 0x10002008, - 0xa00: 0x202000, - 0xb00: 0x8, - 0xc00: 0x10200008, - 0xd00: 0x202008, - 0xe00: 0x2008, - 0xf00: 0x10202000, - 0x80: 0x10200000, - 0x180: 0x10202008, - 0x280: 0x8, - 0x380: 0x200000, - 0x480: 0x202008, - 0x580: 0x10000008, - 0x680: 0x10002000, - 0x780: 0x2008, - 0x880: 0x200008, - 0x980: 0x2000, - 0xa80: 0x10002008, - 0xb80: 0x10200008, - 0xc80: 0x0, - 0xd80: 0x10202000, - 0xe80: 0x202000, - 0xf80: 0x10000000, - 0x1000: 0x10002000, - 0x1100: 0x10200008, - 0x1200: 0x10202008, - 0x1300: 0x2008, - 0x1400: 0x200000, - 0x1500: 0x10000000, - 0x1600: 0x10000008, - 0x1700: 0x202000, - 0x1800: 0x202008, - 0x1900: 0x0, - 0x1a00: 0x8, - 0x1b00: 0x10200000, - 0x1c00: 0x2000, - 0x1d00: 0x10002008, - 0x1e00: 0x10202000, - 0x1f00: 0x200008, - 0x1080: 0x8, - 0x1180: 0x202000, - 0x1280: 0x200000, - 0x1380: 0x10000008, - 0x1480: 0x10002000, - 0x1580: 0x2008, - 0x1680: 0x10202008, - 0x1780: 0x10200000, - 0x1880: 0x10202000, - 0x1980: 0x10200008, - 0x1a80: 0x2000, - 0x1b80: 0x202008, - 0x1c80: 0x200008, - 0x1d80: 0x0, - 0x1e80: 0x10000000, - 0x1f80: 0x10002008 - }, - { - 0x0: 0x100000, - 0x10: 0x2000401, - 0x20: 0x400, - 0x30: 0x100401, - 0x40: 0x2100401, - 0x50: 0x0, - 0x60: 0x1, - 0x70: 0x2100001, - 0x80: 0x2000400, - 0x90: 0x100001, - 0xa0: 0x2000001, - 0xb0: 0x2100400, - 0xc0: 0x2100000, - 0xd0: 0x401, - 0xe0: 0x100400, - 0xf0: 0x2000000, - 0x8: 0x2100001, - 0x18: 0x0, - 0x28: 0x2000401, - 0x38: 0x2100400, - 0x48: 0x100000, - 0x58: 0x2000001, - 0x68: 0x2000000, - 0x78: 0x401, - 0x88: 0x100401, - 0x98: 0x2000400, - 0xa8: 0x2100000, - 0xb8: 0x100001, - 0xc8: 0x400, - 0xd8: 0x2100401, - 0xe8: 0x1, - 0xf8: 0x100400, - 0x100: 0x2000000, - 0x110: 0x100000, - 0x120: 0x2000401, - 0x130: 0x2100001, - 0x140: 0x100001, - 0x150: 0x2000400, - 0x160: 0x2100400, - 0x170: 0x100401, - 0x180: 0x401, - 0x190: 0x2100401, - 0x1a0: 0x100400, - 0x1b0: 0x1, - 0x1c0: 0x0, - 0x1d0: 0x2100000, - 0x1e0: 0x2000001, - 0x1f0: 0x400, - 0x108: 0x100400, - 0x118: 0x2000401, - 0x128: 0x2100001, - 0x138: 0x1, - 0x148: 0x2000000, - 0x158: 0x100000, - 0x168: 0x401, - 0x178: 0x2100400, - 0x188: 0x2000001, - 0x198: 0x2100000, - 0x1a8: 0x0, - 0x1b8: 0x2100401, - 0x1c8: 0x100401, - 0x1d8: 0x400, - 0x1e8: 0x2000400, - 0x1f8: 0x100001 - }, - { - 0x0: 0x8000820, - 0x1: 0x20000, - 0x2: 0x8000000, - 0x3: 0x20, - 0x4: 0x20020, - 0x5: 0x8020820, - 0x6: 0x8020800, - 0x7: 0x800, - 0x8: 0x8020000, - 0x9: 0x8000800, - 0xa: 0x20800, - 0xb: 0x8020020, - 0xc: 0x820, - 0xd: 0x0, - 0xe: 0x8000020, - 0xf: 0x20820, - 0x80000000: 0x800, - 0x80000001: 0x8020820, - 0x80000002: 0x8000820, - 0x80000003: 0x8000000, - 0x80000004: 0x8020000, - 0x80000005: 0x20800, - 0x80000006: 0x20820, - 0x80000007: 0x20, - 0x80000008: 0x8000020, - 0x80000009: 0x820, - 0x8000000a: 0x20020, - 0x8000000b: 0x8020800, - 0x8000000c: 0x0, - 0x8000000d: 0x8020020, - 0x8000000e: 0x8000800, - 0x8000000f: 0x20000, - 0x10: 0x20820, - 0x11: 0x8020800, - 0x12: 0x20, - 0x13: 0x800, - 0x14: 0x8000800, - 0x15: 0x8000020, - 0x16: 0x8020020, - 0x17: 0x20000, - 0x18: 0x0, - 0x19: 0x20020, - 0x1a: 0x8020000, - 0x1b: 0x8000820, - 0x1c: 0x8020820, - 0x1d: 0x20800, - 0x1e: 0x820, - 0x1f: 0x8000000, - 0x80000010: 0x20000, - 0x80000011: 0x800, - 0x80000012: 0x8020020, - 0x80000013: 0x20820, - 0x80000014: 0x20, - 0x80000015: 0x8020000, - 0x80000016: 0x8000000, - 0x80000017: 0x8000820, - 0x80000018: 0x8020820, - 0x80000019: 0x8000020, - 0x8000001a: 0x8000800, - 0x8000001b: 0x0, - 0x8000001c: 0x20800, - 0x8000001d: 0x820, - 0x8000001e: 0x20020, - 0x8000001f: 0x8020800 - } - ]; - - // Masks that select the SBOX input - var SBOX_MASK = [ - 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, - 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f - ]; - - /** - * DES block cipher algorithm. - */ - var DES = C_algo.DES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Select 56 bits according to PC1 - var keyBits = []; - for (var i = 0; i < 56; i++) { - var keyBitPos = PC1[i] - 1; - keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; - } - - // Assemble 16 subkeys - var subKeys = this._subKeys = []; - for (var nSubKey = 0; nSubKey < 16; nSubKey++) { - // Create subkey - var subKey = subKeys[nSubKey] = []; - - // Shortcut - var bitShift = BIT_SHIFTS[nSubKey]; - - // Select 48 bits according to PC2 - for (var i = 0; i < 24; i++) { - // Select from the left 28 key bits - subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); - - // Select from the right 28 key bits - subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); - } - - // Since each subkey is applied to an expanded 32-bit input, - // the subkey can be broken into 8 values scaled to 32-bits, - // which allows the key to be used without expansion - subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); - for (var i = 1; i < 7; i++) { - subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); - } - subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); - } - - // Compute inverse subkeys - var invSubKeys = this._invSubKeys = []; - for (var i = 0; i < 16; i++) { - invSubKeys[i] = subKeys[15 - i]; - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._subKeys); - }, - - decryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._invSubKeys); - }, - - _doCryptBlock: function (M, offset, subKeys) { - // Get input - this._lBlock = M[offset]; - this._rBlock = M[offset + 1]; - - // Initial permutation - exchangeLR.call(this, 4, 0x0f0f0f0f); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeRL.call(this, 2, 0x33333333); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeLR.call(this, 1, 0x55555555); - - // Rounds - for (var round = 0; round < 16; round++) { - // Shortcuts - var subKey = subKeys[round]; - var lBlock = this._lBlock; - var rBlock = this._rBlock; - - // Feistel function - var f = 0; - for (var i = 0; i < 8; i++) { - f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; - } - this._lBlock = rBlock; - this._rBlock = lBlock ^ f; - } - - // Undo swap from last round - var t = this._lBlock; - this._lBlock = this._rBlock; - this._rBlock = t; - - // Final permutation - exchangeLR.call(this, 1, 0x55555555); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeRL.call(this, 2, 0x33333333); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeLR.call(this, 4, 0x0f0f0f0f); - - // Set output - M[offset] = this._lBlock; - M[offset + 1] = this._rBlock; - }, - - keySize: 64/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - // Swap bits across the left and right words - function exchangeLR(offset, mask) { - var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; - this._rBlock ^= t; - this._lBlock ^= t << offset; - } - - function exchangeRL(offset, mask) { - var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; - this._lBlock ^= t; - this._rBlock ^= t << offset; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); - */ - C.DES = BlockCipher._createHelper(DES); - - /** - * Triple-DES block cipher algorithm. - */ - var TripleDES = C_algo.TripleDES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Create DES instances - this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); - this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); - this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); - }, - - encryptBlock: function (M, offset) { - this._des1.encryptBlock(M, offset); - this._des2.decryptBlock(M, offset); - this._des3.encryptBlock(M, offset); - }, - - decryptBlock: function (M, offset) { - this._des3.decryptBlock(M, offset); - this._des2.encryptBlock(M, offset); - this._des1.decryptBlock(M, offset); - }, - - keySize: 192/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); - */ - C.TripleDES = BlockCipher._createHelper(TripleDES); - }()); - - - return CryptoJS.TripleDES; - - })); - }(tripledes)); - - var rc4 = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - /** - * RC4 stream cipher algorithm. - */ - var RC4 = C_algo.RC4 = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - var keySigBytes = key.sigBytes; - - // Init sbox - var S = this._S = []; - for (var i = 0; i < 256; i++) { - S[i] = i; - } - - // Key setup - for (var i = 0, j = 0; i < 256; i++) { - var keyByteIndex = i % keySigBytes; - var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; - - j = (j + S[i] + keyByte) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - } - - // Counters - this._i = this._j = 0; - }, - - _doProcessBlock: function (M, offset) { - M[offset] ^= generateKeystreamWord.call(this); - }, - - keySize: 256/32, - - ivSize: 0 - }); - - function generateKeystreamWord() { - // Shortcuts - var S = this._S; - var i = this._i; - var j = this._j; - - // Generate keystream word - var keystreamWord = 0; - for (var n = 0; n < 4; n++) { - i = (i + 1) % 256; - j = (j + S[i]) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - - keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); - } - - // Update counters - this._i = i; - this._j = j; - - return keystreamWord; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); - */ - C.RC4 = StreamCipher._createHelper(RC4); - - /** - * Modified RC4 stream cipher algorithm. - */ - var RC4Drop = C_algo.RC4Drop = RC4.extend({ - /** - * Configuration options. - * - * @property {number} drop The number of keystream words to drop. Default 192 - */ - cfg: RC4.cfg.extend({ - drop: 192 - }), - - _doReset: function () { - RC4._doReset.call(this); - - // Drop - for (var i = this.cfg.drop; i > 0; i--) { - generateKeystreamWord.call(this); - } - } - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); - */ - C.RC4Drop = StreamCipher._createHelper(RC4Drop); - }()); - - - return CryptoJS.RC4; - - })); - }(rc4)); - - var rabbit = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm - */ - var Rabbit = C_algo.Rabbit = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Swap endian - for (var i = 0; i < 4; i++) { - K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | - (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); - } - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); - * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); - */ - C.Rabbit = StreamCipher._createHelper(Rabbit); - }()); - - - return CryptoJS.Rabbit; - - })); - }(rabbit)); - - var rabbitLegacy = {exports: {}}; - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm. - * - * This is a legacy version that neglected to convert the key to little-endian. - * This error doesn't affect the cipher's security, - * but it does affect its compatibility with other implementations. - */ - var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); - */ - C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); - }()); - - - return CryptoJS.RabbitLegacy; - - })); - }(rabbitLegacy)); - - (function (module, exports) { - (function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, md5.exports, sha1$4.exports, sha256$b.exports, sha224.exports, sha512$6.exports, sha384.exports, sha3.exports, ripemd160$4.exports, hmac$2.exports, pbkdf2$8.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes$6.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports); - } - }(commonjsGlobal, function (CryptoJS) { - - return CryptoJS; - - })); - }(cryptoJs)); - - var treeify = {exports: {}}; - - (function (module, exports) { - // treeify.js - // Luke Plaster - // https://github.com/notatestuser/treeify.js - - // do the universal module definition dance - (function (root, factory) { - - { - module.exports = factory(); - } - - }(commonjsGlobal, function() { - - function makePrefix(key, last) { - var str = (last ? '└' : '├'); - if (key) { - str += '─ '; - } else { - str += '──┐'; - } - return str; - } - - function filterKeys(obj, hideFunctions) { - var keys = []; - for (var branch in obj) { - // always exclude anything in the object's prototype - if (!obj.hasOwnProperty(branch)) { - continue; - } - // ... and hide any keys mapped to functions if we've been told to - if (hideFunctions && ((typeof obj[branch])==="function")) { - continue; - } - keys.push(branch); - } - return keys; - } - - function growBranch(key, root, last, lastStates, showValues, hideFunctions, callback) { - var line = '', index = 0, lastKey, circular, lastStatesCopy = lastStates.slice(0); - - if (lastStatesCopy.push([ root, last ]) && lastStates.length > 0) { - // based on the "was last element" states of whatever we're nested within, - // we need to append either blankness or a branch to our line - lastStates.forEach(function(lastState, idx) { - if (idx > 0) { - line += (lastState[1] ? ' ' : '│') + ' '; - } - if ( ! circular && lastState[0] === root) { - circular = true; - } - }); - - // the prefix varies based on whether the key contains something to show and - // whether we're dealing with the last element in this collection - line += makePrefix(key, last) + key; - - // append values and the circular reference indicator - showValues && (typeof root !== 'object' || root instanceof Date) && (line += ': ' + root); - circular && (line += ' (circular ref.)'); - - callback(line); - } - - // can we descend into the next item? - if ( ! circular && typeof root === 'object') { - var keys = filterKeys(root, hideFunctions); - keys.forEach(function(branch){ - // the last key is always printed with a different prefix, so we'll need to know if we have it - lastKey = ++index === keys.length; - - // hold your breath for recursive action - growBranch(branch, root[branch], lastKey, lastStatesCopy, showValues, hideFunctions, callback); - }); - } - } - // -------------------- - - var Treeify = {}; - - // Treeify.asLines - // -------------------- - // Outputs the tree line-by-line, calling the lineCallback when each one is available. - - Treeify.asLines = function(obj, showValues, hideFunctions, lineCallback) { - /* hideFunctions and lineCallback are curried, which means we don't break apps using the older form */ - var hideFunctionsArg = typeof hideFunctions !== 'function' ? hideFunctions : false; - growBranch('.', obj, false, [], showValues, hideFunctionsArg, lineCallback || hideFunctions); - }; - - // Treeify.asTree - // -------------------- - // Outputs the entire tree, returning it as a string with line breaks. - - Treeify.asTree = function(obj, showValues, hideFunctions) { - var tree = ''; - growBranch('.', obj, false, [], showValues, hideFunctions, function(line) { - tree += line + '\n'; - }); - return tree; - }; - - // -------------------- - - return Treeify; - - })); - }(treeify)); - - (function (exports) { - exports.__esModule = true; - var reverse = bufferReverse; - var CryptoJS = cryptoJs.exports; - var treeify$1 = treeify.exports; - /** - * Class reprensenting a Merkle Tree - * @namespace MerkleTree - */ - var MerkleTree = /** @class */ (function () { - /** - * @desc Constructs a Merkle Tree. - * All nodes and leaves are stored as Buffers. - * Lonely leaf nodes are promoted to the next level up without being hashed again. - * @param {Buffer[]} leaves - Array of hashed leaves. Each leaf must be a Buffer. - * @param {Function} hashAlgorithm - Algorithm used for hashing leaves and nodes - * @param {Object} options - Additional options - * @example - *```js - *const MerkleTree = require('merkletreejs') - *const crypto = require('crypto') - * - *function sha256(data) { - * // returns Buffer - * return crypto.createHash('sha256').update(data).digest() - *} - * - *const leaves = ['a', 'b', 'c'].map(x => keccak(x)) - * - *const tree = new MerkleTree(leaves, sha256) - *``` - */ - function MerkleTree(leaves, hashAlgorithm, options) { - if (options === void 0) { options = {}; } - this.isBitcoinTree = !!options.isBitcoinTree; - this.hashLeaves = !!options.hashLeaves; - this.sortLeaves = !!options.sortLeaves; - this.sortPairs = !!options.sortPairs; - this.sort = !!options.sort; - if (this.sort) { - this.sortLeaves = true; - this.sortPairs = true; - } - this.duplicateOdd = !!options.duplicateOdd; - this.hashAlgo = bufferifyFn(hashAlgorithm); - if (this.hashLeaves) { - leaves = leaves.map(this.hashAlgo); - } - this.leaves = leaves.map(bufferify); - if (this.sortLeaves) { - this.leaves = this.leaves.sort(Buffer.compare); - } - this.layers = [this.leaves]; - this.createHashes(this.leaves); - } - // TODO: documentation - MerkleTree.prototype.createHashes = function (nodes) { - while (nodes.length > 1) { - var layerIndex = this.layers.length; - this.layers.push([]); - for (var i = 0; i < nodes.length; i += 2) { - if (i + 1 === nodes.length) { - if (nodes.length % 2 === 1) { - var data_1 = nodes[nodes.length - 1]; - var hash_1 = data_1; - // is bitcoin tree - if (this.isBitcoinTree) { - // Bitcoin method of duplicating the odd ending nodes - data_1 = Buffer.concat([reverse(data_1), reverse(data_1)]); - hash_1 = this.hashAlgo(data_1); - hash_1 = reverse(this.hashAlgo(hash_1)); - this.layers[layerIndex].push(hash_1); - continue; - } - else { - if (!this.duplicateOdd) { - this.layers[layerIndex].push(nodes[i]); - continue; - } - } - } - } - var left = nodes[i]; - var right = i + 1 == nodes.length ? left : nodes[i + 1]; - var data = null; - var combined = null; - if (this.isBitcoinTree) { - combined = [reverse(left), reverse(right)]; - } - else { - combined = [left, right]; - } - if (this.sortPairs) { - combined.sort(Buffer.compare); - } - data = Buffer.concat(combined); - var hash = this.hashAlgo(data); - // double hash if bitcoin tree - if (this.isBitcoinTree) { - hash = reverse(this.hashAlgo(hash)); - } - this.layers[layerIndex].push(hash); - } - nodes = this.layers[layerIndex]; - } - }; - /** - * getLeaves - * @desc Returns array of leaves of Merkle Tree. - * @return {Buffer[]} - * @example - *```js - *const leaves = tree.getLeaves() - *``` - */ - MerkleTree.prototype.getLeaves = function () { - return this.leaves; - }; - /** - * getLayers - * @desc Returns array of all layers of Merkle Tree, including leaves and root. - * @return {Buffer[]} - * @example - *```js - *const layers = tree.getLayers() - *``` - */ - MerkleTree.prototype.getLayers = function () { - return this.layers; - }; - /** - * getRoot - * @desc Returns the Merkle root hash as a Buffer. - * @return {Buffer} - * @example - *```js - *const root = tree.getRoot() - *``` - */ - MerkleTree.prototype.getRoot = function () { - return this.layers[this.layers.length - 1][0] || Buffer.from([]); - }; - // TODO: documentation - MerkleTree.prototype.getHexRoot = function () { - return bufferToHex(this.getRoot()); - }; - /** - * getProof - * @desc Returns the proof for a target leaf. - * @param {Buffer} leaf - Target leaf - * @param {Number} [index] - Target leaf index in leaves array. - * Use if there are leaves containing duplicate data in order to distinguish it. - * @return {Object[]} - Array of objects containing a position property of type string - * with values of 'left' or 'right' and a data property of type Buffer. - *@example - * ```js - *const proof = tree.getProof(leaves[2]) - *``` - * - * @example - *```js - *const leaves = ['a', 'b', 'a'].map(x => keccak(x)) - *const tree = new MerkleTree(leaves, keccak) - *const proof = tree.getProof(leaves[2], 2) - *``` - */ - MerkleTree.prototype.getProof = function (leaf, index) { - leaf = bufferify(leaf); - var proof = []; - if (typeof index !== 'number') { - index = -1; - for (var i = 0; i < this.leaves.length; i++) { - if (Buffer.compare(leaf, this.leaves[i]) === 0) { - index = i; - } - } - } - if (index <= -1) { - return []; - } - if (this.isBitcoinTree && index === (this.leaves.length - 1)) { - // Proof Generation for Bitcoin Trees - for (var i = 0; i < this.layers.length - 1; i++) { - var layer = this.layers[i]; - var isRightNode = index % 2; - var pairIndex = (isRightNode ? index - 1 : index); - if (pairIndex < layer.length) { - proof.push({ - data: layer[pairIndex] - }); - } - // set index to parent index - index = (index / 2) | 0; - } - return proof; - } - else { - // Proof Generation for Non-Bitcoin Trees - for (var i = 0; i < this.layers.length; i++) { - var layer = this.layers[i]; - var isRightNode = index % 2; - var pairIndex = (isRightNode ? index - 1 : index + 1); - if (pairIndex < layer.length) { - proof.push({ - position: isRightNode ? 'left' : 'right', - data: layer[pairIndex] - }); - } - // set index to parent index - index = (index / 2) | 0; - } - return proof; - } - }; - // TODO: documentation - MerkleTree.prototype.getHexProof = function (leaf, index) { - return this.getProof(leaf, index).map(function (x) { return bufferToHex(x.data); }); - }; - /** - * verify - * @desc Returns true if the proof path (array of hashes) can connect the target node - * to the Merkle root. - * @param {Object[]} proof - Array of proof objects that should connect - * target node to Merkle root. - * @param {Buffer} targetNode - Target node Buffer - * @param {Buffer} root - Merkle root Buffer - * @return {Boolean} - * @example - *```js - *const root = tree.getRoot() - *const proof = tree.getProof(leaves[2]) - *const verified = tree.verify(proof, leaves[2], root) - *``` - */ - MerkleTree.prototype.verify = function (proof, targetNode, root) { - var hash = bufferify(targetNode); - root = bufferify(root); - if (!Array.isArray(proof) || - !proof.length || - !targetNode || - !root) { - return false; - } - for (var i = 0; i < proof.length; i++) { - var node = proof[i]; - var data = null; - var isLeftNode = null; - // NOTE: case for when proof is hex values only - if (typeof node === 'string') { - data = bufferify(node); - isLeftNode = true; - } - else { - data = node.data; - isLeftNode = (node.position === 'left'); - } - var buffers = []; - if (this.isBitcoinTree) { - buffers.push(reverse(hash)); - buffers[isLeftNode ? 'unshift' : 'push'](reverse(data)); - hash = this.hashAlgo(Buffer.concat(buffers)); - hash = reverse(this.hashAlgo(hash)); - } - else { - if (this.sortPairs) { - if (Buffer.compare(hash, data) === -1) { - buffers.push(hash, data); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - else { - buffers.push(data, hash); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - } - else { - buffers.push(hash); - buffers[isLeftNode ? 'unshift' : 'push'](data); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - } - } - return Buffer.compare(hash, root) === 0; - }; - // TODO: documentation - MerkleTree.prototype.getLayersAsObject = function () { - var _a; - var layers = this.getLayers().map(function (x) { return x.map(function (x) { return x.toString('hex'); }); }); - var objs = []; - for (var i = 0; i < layers.length; i++) { - var arr = []; - for (var j = 0; j < layers[i].length; j++) { - var obj = (_a = {}, _a[layers[i][j]] = null, _a); - if (objs.length) { - obj[layers[i][j]] = {}; - var a = objs.shift(); - var akey = Object.keys(a)[0]; - obj[layers[i][j]][akey] = a[akey]; - if (objs.length) { - var b = objs.shift(); - var bkey = Object.keys(b)[0]; - obj[layers[i][j]][bkey] = b[bkey]; - } - } - arr.push(obj); - } - objs.push.apply(objs, arr); - } - return objs[0]; - }; - // TODO: documentation - MerkleTree.prototype.print = function () { - MerkleTree.print(this); - }; - // TODO: documentation - MerkleTree.prototype.toTreeString = function () { - var obj = this.getLayersAsObject(); - return treeify$1.asTree(obj, true); - }; - // TODO: documentation - MerkleTree.prototype.toString = function () { - return this.toTreeString(); - }; - // TODO: documentation - MerkleTree.bufferify = function (x) { - return bufferify(x); - }; - // TODO: documentation - MerkleTree.print = function (tree) { - console.log(tree.toString()); - }; - return MerkleTree; - }()); - exports.MerkleTree = MerkleTree; - function bufferToHex(value) { - return '0x' + value.toString('hex'); - } - function bufferify(x) { - if (!Buffer.isBuffer(x)) { - // crypto-js support - if (typeof x === 'object' && x.words) { - return Buffer.from(x.toString(CryptoJS.enc.Hex), 'hex'); - } - else if (isHexStr(x)) { - return Buffer.from(x.replace(/^0x/, ''), 'hex'); - } - else if (typeof x === 'string') { - return Buffer.from(x); - } - } - return x; - } - function bufferifyFn(f) { - return function (x) { - var v = f(x); - if (Buffer.isBuffer(v)) { - return v; - } - if (isHexStr(v)) { - return Buffer.from(v, 'hex'); - } - // crypto-js support - return Buffer.from(f(CryptoJS.enc.Hex.parse(x.toString('hex'))).toString(CryptoJS.enc.Hex), 'hex'); - }; - } - function isHexStr(v) { - return (typeof v === 'string' && /^(0x)?[0-9A-Fa-f]*$/.test(v)); - } - exports["default"] = MerkleTree; - }(dist$1)); - - const { - MAX_MEMORY_ALLOC, - MAX_FRAME_SIZE - } = constants$1; - - const State$8 = state$2; - const { MerkleTree: MerkleTree$1 } = dist$1; - - /** - * Manage stacks of data. - */ - class Stack$a extends State$8 { - /** - * Create a {@link Stack} instance. - * @param {Array} [list=[]] Genesis state for the {@link Stack} instance. - * @return {Stack} Instance of the {@link Stack}. - */ - constructor (list = []) { - super(list); - - this.limit = MAX_MEMORY_ALLOC; - this.frame = Buffer.alloc(MAX_FRAME_SIZE); - this.config = list || []; - - // Patch for new Collection inheritance - this.settings = Object.assign({ - verbosity: 2 - }, list); - - this['@type'] = this.config['@type']; - this['@entity'].frames = {}; - this['@entity'].states = {}; - this['@states'] = {}; - this['@data'] = []; - - if (list instanceof Array) { - for (let i in list) { - this.push(list[i]); - } - } - - this['@entity']['@type'] = this['@type']; - this['@entity']['@data'] = this['@data']; - this['@id'] = this.id; - - return this; - } - - get size () { - return this['@data'].length; - } - - /** - * Push data onto the stack. Changes the {@link Stack#frame} and - * {@link Stack#id}. - * @param {Mixed} data Treated as a {@link State}. - * @return {Number} Resulting size of the stack. - */ - push (data) { - let state = new State$8(data); - - this['@entity'].states[this.id] = this['@data']; - this['@entity'].states[state.id] = state['@data']; - this['@entity'].frames[this.id] = this['@data']; - this['@entity'].frames[state.id] = state['@data']; - - // write the frame - // NOTE: no garbage collection - this.frame = Buffer.from(state.id); - - // push frame onto stack - this['@data'].push(this.frame); - this['@type'] = 'Stack'; - this['@size'] = this['@data'].length * MAX_FRAME_SIZE; - - this.commit(); - - return this['@data'].length; - } - - dedupe () { - return new Stack$a([...new Set(this.asArray())]); - } - - pop () { - let element = this['@data'].pop(); - return element; - } - - asArray () { - return Array.from(this['@data']); - } - - asMerkleTree () { - return new MerkleTree$1(this.asArray(), this.sha256, { - isBitcoinTree: true - }); - } - - snapshot () { - return this.id || { '@id': `${this.sha256(this.state['@data'])}` }; - } - - commit () { - let stack = this; - let changes = super.commit(); - - if (changes.length) { - let data = Object.assign({}, { - parent: stack.tip, - changes: changes - }); - - stack.state['@data'] = data; - stack.history.push(stack.state.id); - } - - // TODO: return Transaction - return changes; - } - } - - var stack$2 = Stack$a; - - const pluralize$4 = pluralize$5.exports; - const monitor$4 = duplex; - const pointer$4 = jsonPointer$1; - - const Entity$7 = entity; - const Stack$9 = stack$2; - const State$7 = state$2; - - /** - * The {@link Collection} type maintains an ordered list of {@link State} items. - * @property {Object} @entity Fabric-bound entity object. - */ - class Collection$6 extends Stack$9 { - /** - * Create a list of {@link Entity}-like objects for later retrieval. - * @param {Object} [configuration={}] Configuration object. - * @return {Collection} Configured instance of the the {@link Collection}. - */ - constructor (configuration = {}) { - super(configuration); - - // TODO: document `listeners` handler (currently only `create`) - this.settings = Object.assign({ - atomic: true, - type: Entity$7, - deterministic: true, - name: '@fabric/store', - path: `./collections`, - fields: { id: 'id' }, - key: 'id' - }, configuration); - - this['@type'] = 'Collection'; - this['@entity']['@type'] = 'Collection'; - - // Set name to plural version, define path for storage - this.name = pluralize$4(this.settings.name); - this.path = `/` + this.name.toLowerCase(); - - this._state = {}; - this.value = {}; - - this.set(`${this.path}`, this.settings.data || {}); - this.observer = monitor$4.observe(this.value); - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - get routes () { - return this.settings.routes; - } - - /** - * Current elements of the collection as a {@link MerkleTree}. - * @returns {MerkleTree} - */ - asMerkleTree () { - let list = pointer$4.get(this.value, this.path); - let stack = new Stack$9(Object.keys(list)); - return stack.asMerkleTree(); - } - - /** - * Sets the `key` property of collection settings. - * @param {String} name Value to set the `key` setting to. - */ - _setKey (name) { - this.settings.key = name; - } - - /** - * Retrieve an element from the collection by ID. - * @param {String} id Document identifier. - */ - getByID (id) { - if (!id) return null; - - let result = null; - - try { - if (this.settings.verbosity >= 5) console.log(`getting ${this.path}/${id} from:`, this.value); - result = pointer$4.get(this.value, `${this.path}/${id}`); - } catch (E) { - // console.debug('[FABRIC:COLLECTION]', `@${this.name}`, Date.now(), `Could not find ID "${id}" in tree ${this.asMerkleTree()}`); - } - - result = this._wrapResult(result); - - return result; - } - - /** - * Retrieve the most recent element in the collection. - */ - getLatest () { - let items = pointer$4.get(this.value, this.path); - return items[items.length - 1]; - } - - /** - * Find a document by specific field. - * @param {String} name Name of field to search. - * @param {String} value Value to match. - */ - findByField (name, value) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - if (items[id][name] === value) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - /** - * Find a document by the "name" field. - * @param {String} name Name to search for. - */ - findByName (name) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - if (items[id].name === name) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - /** - * Find a document by the "symbol" field. - * @param {String} symbol Value to search for. - */ - findBySymbol (symbol) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - // TODO: fix bug here (check for symbol) - if (items[id].symbol === symbol) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - // TODO: deep search, consider GraphQL (!!!: to discuss) - match (query = {}) { - let result = null; - let items = pointer$4.get(this.value, this.path); - let list = Object.keys(items).map((x) => { - return items[x]; - }); - - try { - result = list.filter((x) => { - for (let field in query) { - if (x[field] !== query[field]) return false; - } - return true; - }); - } catch (E) { - console.error('Could not match:', E); - } - - return result; - } - - _wrapResult (result) { - // TODO: enable upstream specification via pure JSON - if (this.settings.type.name !== 'Entity') { - let Type = this.settings.type; - result = new Type(result || {}); - } - - // TODO: validation of result by calling result.validate() - // TODO: signing of result by calling result.signWith() - return result; - } - - /** - * Modify a target document using an array of atomic updates. - * @param {String} path Path to the document to modify. - * @param {Array} patches List of operations to apply. - */ - async _patchTarget (path, patches) { - let link = `${path}`; - let result = null; - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'Patching target:', path, patches); - - try { - result = monitor$4.applyPatch(this.value, patches.map((op) => { - op.path = `${link}${op.path}`; - return op; - })).newDocument; - } catch (E) { - console.error('Could not patch target:', E, path, patches); - } - - await this.commit(); - - return result; - } - - /** - * Adds an {@link Entity} to the {@link Collection}. - * @param {Mixed} data {@link Entity} to add. - * @return {Number} Length of the collection. - */ - async push (data, commit = true) { - super.push(data); - - let state = new State$7(data); - - this['@entity'].states[this.id] = this['@data']; - this['@entity'].states[state.id] = state['@data']; - - this['@entity']['@data'] = this['@data'].map(x => x.toString()); - this['@data'] = this['@entity']['@data']; - - this['@id'] = this.id; - - if (commit) { - try { - this['@commit'] = await this.commit(); - } catch (E) { - console.error('Could not commit.', E); - } - } - - return this['@data'].length; - } - - async populate () { - return Promise.all(this['@entity']['@data'].map(id => { - return this['@entity'].states[id.toString('hex')]; - })); - } - - async query (path) { - return this.get(path); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path) { - let result = null; - - try { - result = pointer$4.get(this['@entity']['@data'], path); - } catch (exception) { - this.emit('warning', `[FABRIC:COLLECTION] Could not retrieve path: ${path} ${JSON.stringify(exception)}`); - // console.error('[FABRIC:COLLECTION]', 'Could not retrieve path:', path, exception); - } - - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - pointer$4.set(this._state, path, value); - pointer$4.set(this.value, path, value); - pointer$4.set(this['@entity']['@data'], path, value); - - this.commit(); - return true; - } - - /** - * Generate a list of elements in the collection. - * @deprecated - * @returns {Array} - */ - list () { - let map = this.map(); - let ids = Object.keys(map); - // TODO: `list()` should return an Array - let result = {}; - - for (let i = 0; i < ids.length; i++) { - result[ids[i]] = this._wrapResult(map[ids[i]]); - } - - return result; - } - - /** - * Provides the {@link Collection} as an {@link Array} of typed - * elements. The type of these elments are defined by the collection's - * type, supplied in the constructor. - */ - toTypedArray () { - let map = this.map(); - let ids = Object.keys(map); - return ids.map((x) => this._wrapResult(map[ids[x]])); - } - - typedMap () { - let map = this.map(); - let ids = Object.keys(map); - // TODO: `list()` should return an Array - let result = {}; - - for (let i = 0; i < ids.length; i++) { - result[ids[i]] = this._wrapResult(map[ids[i]]); - } - - return result; - } - - /** - * Generate a hashtable of elements in the collection. - * @returns {Array} - */ - map () { - return Collection$6.pointer.get(this.value, `${this.path}`); - } - - /** - * Create an instance of an {@link Entity}. - * @param {Object} entity Object with properties. - * @return {Promise} Resolves with instantiated {@link Entity}. - */ - async create (input, commit = true) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:COLLECTION]', 'Creating object:', input); - if (!this.settings.deterministic) input.created = Date.now(); - - let result = null; - let entity = new Entity$7(input); - let link = `${this.path}/${entity.id}`; - // TODO: enable specifying names (again) - // let link = `${this.path}/${(entity.data[this.settings.fields.id] || entity.id)}`; - // TODO: handle duplicates (when desired, i.e., "unique" in settings) - let current = await this.getByID(entity.id); - if (current) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:COLLECTION]', 'Exact entity exists:', current); - } - - if (this.settings.methods && this.settings.methods.create) { - result = await this.settings.methods.create.call(this, input); - } else { - result = entity; - } - - pointer$4.set(this._state, link, result.data); - - this.set(link, result.data || result); - - this.emit('message', { - '@type': 'Create', - '@data': Object.assign({}, result.data, { - id: entity.id - }) - }); - - if (commit) { - try { - this['@commit'] = await this.commit(); - this.emit('commit', this['@commit']); - } catch (E) { - console.error('Could not commit.', E); - } - } - - if (this.settings.listeners && this.settings.listeners.create) { - await this.settings.listeners.create(entity.data); - } - - result = result.data || entity.data; - result.id = entity.id; - - return result; - } - - /** - * Loads {@link State} into memory. - * @param {State} state State to import. - * @param {Boolean} commit Whether or not to commit the result. - * @emits message Will emit one {@link Snapshot} message. - */ - async import (input, commit = true) { - if (input['@data']) input = input['@data']; - - let result = null; - let size = await this.push(input, false); - let state = this['@entity'].states[this['@data'][size - 1]]; - let entity = new Entity$7(state); - let link = `${this.path}/${input.id || entity.id}`; - - if (this.settings.verbosity >= 4) console.log('state.data:', state.data); - if (this.settings.verbosity >= 4) console.log('state:', state); - if (this.settings.verbosity >= 4) console.log('link:', link); - - this.set(link, state.data || state); - - if (commit) { - try { - this['@commit'] = await this.commit(); - } catch (E) { - console.error('Could not commit.', E); - } - } - - result = state.data || entity.data; - result.id = input.id || entity.id; - - // TODO: ensure updates sent on subscriber channels - // ESPECIALLY when an ID is supplied... - // TODO: test upstream attack vectors - if (this.settings.verbosity >= 4) console.log('input.id', input.id); - - this.emit('message', { - '@type': 'Snapshot', - '@data': { - path: this.path, - state: pointer$4.get(this.value, this.path) - } - }); - - return result; - } - - async importList (list) { - let ids = []; - - for (let i = 0; i < list.length; i++) { - let item = await this.import(list[i]); - ids.push(item.id); - } - - return ids; - } - - async importMap (map) { - return this.importList(Object.values(map)); - } - - commit () { - if (this.settings.verbosity >= 4) this.emit('debug', '[FABRIC:COLLECTION] Committing...'); - const patches = monitor$4.generate(this.observer); - - if (patches && patches.length) { - const body = { - changes: patches, - state: this.value - }; - - this.emit('transaction', body); - this.emit('patches', patches); - this.emit('message', { - '@type': 'Transaction', - '@data': body - }); - } - } - - get len () { - return Object.keys(this.list()).length; - } - } - - var collection$1 = Collection$6; - - var deferredLeveldown = {exports: {}}; - - var abstractLeveldown$1 = {}; - - var levelSupports = function supports (...manifests) { - const manifest = manifests.reduce((acc, m) => Object.assign(acc, m), {}); - - return Object.assign(manifest, { - // Features of abstract-leveldown - bufferKeys: manifest.bufferKeys || false, - snapshots: manifest.snapshots || false, - permanence: manifest.permanence || false, - seek: manifest.seek || false, - clear: manifest.clear || false, - getMany: manifest.getMany || false, - keyIterator: manifest.keyIterator || false, - valueIterator: manifest.valueIterator || false, - iteratorNextv: manifest.iteratorNextv || false, - iteratorAll: manifest.iteratorAll || false, - - // Features of abstract-leveldown that levelup doesn't have - status: manifest.status || false, - idempotentOpen: manifest.idempotentOpen || false, - passiveOpen: manifest.passiveOpen || false, - serialize: manifest.serialize || false, - - // Features of disk-based implementations - createIfMissing: manifest.createIfMissing || false, - errorIfExists: manifest.errorIfExists || false, - - // Features of level(up) that abstract-leveldown doesn't have yet - deferredOpen: manifest.deferredOpen || false, - openCallback: manifest.openCallback || false, - promises: manifest.promises || false, - streams: manifest.streams || false, - encodings: maybeObject(manifest.encodings), - events: maybeObject(manifest.events), - - // Methods that are not part of abstract-leveldown or levelup - additionalMethods: Object.assign({}, manifest.additionalMethods) - }) - }; - - function maybeObject (value) { - return !value ? false : Object.assign({}, value) - } - - /*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - - var isBuffer$h = function isBuffer (obj) { - return obj != null && obj.constructor != null && - typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) - }; - - var catering$3 = {}; - - var nextTick$5 = process.nextTick.bind(process); - - var nextTick$4 = nextTick$5; - - catering$3.fromCallback = function (callback, symbol) { - if (callback === undefined) { - var promise = new Promise(function (resolve, reject) { - callback = function (err, res) { - if (err) reject(err); - else resolve(res); - }; - }); - - callback[symbol !== undefined ? symbol : 'promise'] = promise; - } else if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function') - } - - return callback - }; - - catering$3.fromPromise = function (promise, callback) { - if (callback === undefined) return promise - - promise - .then(function (res) { nextTick$4(() => callback(null, res)); }) - .catch(function (err) { nextTick$4(() => callback(err)); }); - }; - - var nextTick$3 = process.nextTick; - - function AbstractIterator$4 (db) { - if (typeof db !== 'object' || db === null) { - throw new TypeError('First argument must be an abstract-leveldown compliant store') - } - - this.db = db; - this._ended = false; - this._nexting = false; - } - - AbstractIterator$4.prototype.next = function (callback) { - // In callback mode, we return `this` - let ret = this; - - if (callback === undefined) { - ret = new Promise(function (resolve, reject) { - callback = function (err, key, value) { - if (err) reject(err); - else if (key === undefined && value === undefined) resolve(); - else resolve([key, value]); - }; - }); - } else if (typeof callback !== 'function') { - throw new Error('next() requires a callback argument') - } - - if (this._ended) { - this._nextTick(callback, new Error('cannot call next() after end()')); - return ret - } - - if (this._nexting) { - this._nextTick(callback, new Error('cannot call next() before previous next() has completed')); - return ret - } - - this._nexting = true; - this._next((err, ...rest) => { - this._nexting = false; - callback(err, ...rest); - }); - - return ret - }; - - AbstractIterator$4.prototype._next = function (callback) { - this._nextTick(callback); - }; - - AbstractIterator$4.prototype.seek = function (target) { - if (this._ended) { - throw new Error('cannot call seek() after end()') - } - if (this._nexting) { - throw new Error('cannot call seek() before next() has completed') - } - - target = this.db._serializeKey(target); - this._seek(target); - }; - - AbstractIterator$4.prototype._seek = function (target) {}; - - AbstractIterator$4.prototype.end = function (callback) { - let promise; - - if (callback === undefined) { - promise = new Promise(function (resolve, reject) { - callback = function (err) { - if (err) reject(err); - else resolve(); - }; - }); - } else if (typeof callback !== 'function') { - throw new Error('end() requires a callback argument') - } - - if (this._ended) { - this._nextTick(callback, new Error('end() already called on iterator')); - return promise - } - - this._ended = true; - this._end(callback); - - return promise - }; - - AbstractIterator$4.prototype._end = function (callback) { - this._nextTick(callback); - }; - - AbstractIterator$4.prototype[Symbol.asyncIterator] = async function * () { - try { - let kv; - - while ((kv = (await this.next())) !== undefined) { - yield kv; - } - } finally { - if (!this._ended) await this.end(); - } - }; - - // Expose browser-compatible nextTick for dependents - AbstractIterator$4.prototype._nextTick = nextTick$3; - - var abstractIterator = AbstractIterator$4; - - const emptyOptions = Object.freeze({}); - - function AbstractChainedBatch$4 (db) { - if (typeof db !== 'object' || db === null) { - throw new TypeError('First argument must be an abstract-leveldown compliant store') - } - - this.db = db; - this._operations = []; - this._written = false; - } - - AbstractChainedBatch$4.prototype._checkWritten = function () { - if (this._written) { - throw new Error('write() already called on this batch') - } - }; - - AbstractChainedBatch$4.prototype.put = function (key, value, options) { - this._checkWritten(); - - const err = this.db._checkKey(key) || this.db._checkValue(value); - if (err) throw err - - key = this.db._serializeKey(key); - value = this.db._serializeValue(value); - - this._put(key, value, options != null ? options : emptyOptions); - - return this - }; - - AbstractChainedBatch$4.prototype._put = function (key, value, options) { - this._operations.push({ ...options, type: 'put', key, value }); - }; - - AbstractChainedBatch$4.prototype.del = function (key, options) { - this._checkWritten(); - - const err = this.db._checkKey(key); - if (err) throw err - - key = this.db._serializeKey(key); - this._del(key, options != null ? options : emptyOptions); - - return this - }; - - AbstractChainedBatch$4.prototype._del = function (key, options) { - this._operations.push({ ...options, type: 'del', key }); - }; - - AbstractChainedBatch$4.prototype.clear = function () { - this._checkWritten(); - this._clear(); - - return this - }; - - AbstractChainedBatch$4.prototype._clear = function () { - this._operations = []; - }; - - AbstractChainedBatch$4.prototype.write = function (options, callback) { - this._checkWritten(); - - if (typeof options === 'function') { - callback = options; - } - if (typeof callback !== 'function') { - throw new Error('write() requires a callback argument') - } - if (typeof options !== 'object' || options === null) { - options = {}; - } - - this._written = true; - this._write(options, callback); - }; - - AbstractChainedBatch$4.prototype._write = function (options, callback) { - this.db._batch(this._operations, options, callback); - }; - - // Expose browser-compatible nextTick for dependents - AbstractChainedBatch$4.prototype._nextTick = nextTick$3; - - var abstractChainedBatch = AbstractChainedBatch$4; - - var common$A = {}; - - common$A.getCallback = function (options, callback) { - return typeof options === 'function' ? options : callback - }; - - common$A.getOptions = function (options) { - return typeof options === 'object' && options !== null ? options : {} - }; - - const supports$1 = levelSupports; - const isBuffer$g = isBuffer$h; - const catering$2 = catering$3; - const AbstractIterator$3 = abstractIterator; - const AbstractChainedBatch$3 = abstractChainedBatch; - const getCallback$4 = common$A.getCallback; - const getOptions$2 = common$A.getOptions; - - const hasOwnProperty$2 = Object.prototype.hasOwnProperty; - const rangeOptions$1 = ['lt', 'lte', 'gt', 'gte']; - - function AbstractLevelDOWN$3 (manifest) { - this.status = 'new'; - - // TODO (next major): make this mandatory - this.supports = supports$1(manifest, { - status: true - }); - } - - AbstractLevelDOWN$3.prototype.open = function (options, callback) { - const oldStatus = this.status; - - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('open() requires a callback argument') - } - - if (typeof options !== 'object' || options === null) options = {}; - - options.createIfMissing = options.createIfMissing !== false; - options.errorIfExists = !!options.errorIfExists; - - this.status = 'opening'; - this._open(options, (err) => { - if (err) { - this.status = oldStatus; - return callback(err) - } - this.status = 'open'; - callback(); - }); - }; - - AbstractLevelDOWN$3.prototype._open = function (options, callback) { - this._nextTick(callback); - }; - - AbstractLevelDOWN$3.prototype.close = function (callback) { - const oldStatus = this.status; - - if (typeof callback !== 'function') { - throw new Error('close() requires a callback argument') - } - - this.status = 'closing'; - this._close((err) => { - if (err) { - this.status = oldStatus; - return callback(err) - } - this.status = 'closed'; - callback(); - }); - }; - - AbstractLevelDOWN$3.prototype._close = function (callback) { - this._nextTick(callback); - }; - - AbstractLevelDOWN$3.prototype.get = function (key, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('get() requires a callback argument') - } - - const err = this._checkKey(key); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - - if (typeof options !== 'object' || options === null) options = {}; - - options.asBuffer = options.asBuffer !== false; - - this._get(key, options, callback); - }; - - AbstractLevelDOWN$3.prototype._get = function (key, options, callback) { - this._nextTick(function () { callback(new Error('NotFound')); }); - }; - - AbstractLevelDOWN$3.prototype.getMany = function (keys, options, callback) { - callback = getCallback$4(options, callback); - callback = catering$2.fromCallback(callback); - options = getOptions$2(options); - - if (maybeError$1(this, callback)) { - return callback.promise - } - - if (!Array.isArray(keys)) { - this._nextTick(callback, new Error('getMany() requires an array argument')); - return callback.promise - } - - if (keys.length === 0) { - this._nextTick(callback, null, []); - return callback.promise - } - - if (typeof options.asBuffer !== 'boolean') { - options = { ...options, asBuffer: true }; - } - - const serialized = new Array(keys.length); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const err = this._checkKey(key); - - if (err) { - this._nextTick(callback, err); - return callback.promise - } - - serialized[i] = this._serializeKey(key); - } - - this._getMany(serialized, options, callback); - return callback.promise - }; - - AbstractLevelDOWN$3.prototype._getMany = function (keys, options, callback) { - this._nextTick(callback, null, new Array(keys.length).fill(undefined)); - }; - - AbstractLevelDOWN$3.prototype.put = function (key, value, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('put() requires a callback argument') - } - - const err = this._checkKey(key) || this._checkValue(value); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - value = this._serializeValue(value); - - if (typeof options !== 'object' || options === null) options = {}; - - this._put(key, value, options, callback); - }; - - AbstractLevelDOWN$3.prototype._put = function (key, value, options, callback) { - this._nextTick(callback); - }; - - AbstractLevelDOWN$3.prototype.del = function (key, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('del() requires a callback argument') - } - - const err = this._checkKey(key); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - - if (typeof options !== 'object' || options === null) options = {}; - - this._del(key, options, callback); - }; - - AbstractLevelDOWN$3.prototype._del = function (key, options, callback) { - this._nextTick(callback); - }; - - AbstractLevelDOWN$3.prototype.batch = function (array, options, callback) { - if (!arguments.length) return this._chainedBatch() - - if (typeof options === 'function') callback = options; - - if (typeof array === 'function') callback = array; - - if (typeof callback !== 'function') { - throw new Error('batch(array) requires a callback argument') - } - - if (!Array.isArray(array)) { - return this._nextTick(callback, new Error('batch(array) requires an array argument')) - } - - if (array.length === 0) { - return this._nextTick(callback) - } - - if (typeof options !== 'object' || options === null) options = {}; - - const serialized = new Array(array.length); - - for (let i = 0; i < array.length; i++) { - if (typeof array[i] !== 'object' || array[i] === null) { - return this._nextTick(callback, new Error('batch(array) element must be an object and not `null`')) - } - - const e = Object.assign({}, array[i]); - - if (e.type !== 'put' && e.type !== 'del') { - return this._nextTick(callback, new Error("`type` must be 'put' or 'del'")) - } - - const err = this._checkKey(e.key); - if (err) return this._nextTick(callback, err) - - e.key = this._serializeKey(e.key); - - if (e.type === 'put') { - const valueErr = this._checkValue(e.value); - if (valueErr) return this._nextTick(callback, valueErr) - - e.value = this._serializeValue(e.value); - } - - serialized[i] = e; - } - - this._batch(serialized, options, callback); - }; - - AbstractLevelDOWN$3.prototype._batch = function (array, options, callback) { - this._nextTick(callback); - }; - - AbstractLevelDOWN$3.prototype.clear = function (options, callback) { - if (typeof options === 'function') { - callback = options; - } else if (typeof callback !== 'function') { - throw new Error('clear() requires a callback argument') - } - - options = cleanRangeOptions(this, options); - options.reverse = !!options.reverse; - options.limit = 'limit' in options ? options.limit : -1; - - this._clear(options, callback); - }; - - AbstractLevelDOWN$3.prototype._clear = function (options, callback) { - // Avoid setupIteratorOptions, would serialize range options a second time. - options.keys = true; - options.values = false; - options.keyAsBuffer = true; - options.valueAsBuffer = true; - - const iterator = this._iterator(options); - const emptyOptions = {}; - - const next = (err) => { - if (err) { - return iterator.end(function () { - callback(err); - }) - } - - iterator.next((err, key) => { - if (err) return next(err) - if (key === undefined) return iterator.end(callback) - - // This could be optimized by using a batch, but the default _clear - // is not meant to be fast. Implementations have more room to optimize - // if they override _clear. Note: using _del bypasses key serialization. - this._del(key, emptyOptions, next); - }); - }; - - next(); - }; - - AbstractLevelDOWN$3.prototype._setupIteratorOptions = function (options) { - options = cleanRangeOptions(this, options); - - options.reverse = !!options.reverse; - options.keys = options.keys !== false; - options.values = options.values !== false; - options.limit = 'limit' in options ? options.limit : -1; - options.keyAsBuffer = options.keyAsBuffer !== false; - options.valueAsBuffer = options.valueAsBuffer !== false; - - return options - }; - - function cleanRangeOptions (db, options) { - const result = {}; - - for (const k in options) { - if (!hasOwnProperty$2.call(options, k)) continue - - if (k === 'start' || k === 'end') { - throw new Error('Legacy range options ("start" and "end") have been removed') - } - - let opt = options[k]; - - if (isRangeOption(k)) { - // Note that we don't reject nullish and empty options here. While - // those types are invalid as keys, they are valid as range options. - opt = db._serializeKey(opt); - } - - result[k] = opt; - } - - return result - } - - function isRangeOption (k) { - return rangeOptions$1.indexOf(k) !== -1 - } - - AbstractLevelDOWN$3.prototype.iterator = function (options) { - if (typeof options !== 'object' || options === null) options = {}; - options = this._setupIteratorOptions(options); - return this._iterator(options) - }; - - AbstractLevelDOWN$3.prototype._iterator = function (options) { - return new AbstractIterator$3(this) - }; - - AbstractLevelDOWN$3.prototype._chainedBatch = function () { - return new AbstractChainedBatch$3(this) - }; - - AbstractLevelDOWN$3.prototype._serializeKey = function (key) { - return key - }; - - AbstractLevelDOWN$3.prototype._serializeValue = function (value) { - return value - }; - - AbstractLevelDOWN$3.prototype._checkKey = function (key) { - if (key === null || key === undefined) { - return new Error('key cannot be `null` or `undefined`') - } else if (isBuffer$g(key) && key.length === 0) { // TODO: replace with typed array check - return new Error('key cannot be an empty Buffer') - } else if (key === '') { - return new Error('key cannot be an empty String') - } else if (Array.isArray(key) && key.length === 0) { - return new Error('key cannot be an empty Array') - } - }; - - AbstractLevelDOWN$3.prototype._checkValue = function (value) { - if (value === null || value === undefined) { - return new Error('value cannot be `null` or `undefined`') - } - }; - - // TODO: docs and tests - AbstractLevelDOWN$3.prototype.isOperational = function () { - return this.status === 'open' || this._isOperational() - }; - - // Implementation may accept operations in other states too - AbstractLevelDOWN$3.prototype._isOperational = function () { - return false - }; - - // Expose browser-compatible nextTick for dependents - // TODO: rename _nextTick to _queueMicrotask - // TODO: after we drop node 10, also use queueMicrotask in node - AbstractLevelDOWN$3.prototype._nextTick = nextTick$3; - - var abstractLeveldown = AbstractLevelDOWN$3; - - function maybeError$1 (db, callback) { - if (!db.isOperational()) { - db._nextTick(callback, new Error('Database is not open')); - return true - } - - return false - } - - abstractLeveldown$1.AbstractLevelDOWN = abstractLeveldown; - abstractLeveldown$1.AbstractIterator = abstractIterator; - abstractLeveldown$1.AbstractChainedBatch = abstractChainedBatch; - - var inherits$9 = {exports: {}}; - - var inherits_browser = {exports: {}}; - - if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - inherits_browser.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; - } else { - // old school shim for old browsers - inherits_browser.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; - } - - try { - var util$D = require('util'); - /* istanbul ignore next */ - if (typeof util$D.inherits !== 'function') throw ''; - inherits$9.exports = util$D.inherits; - } catch (e) { - /* istanbul ignore next */ - inherits$9.exports = inherits_browser.exports; - } - - var util$C = {}; - - util$C.getCallback = function (args, symbol, map) { - let callback = args[args.length - 1]; - - if (typeof callback !== 'function') { - const promise = new Promise((resolve, reject) => { - args.push(callback = function (err, ...results) { - if (err) reject(err); - else resolve(map ? map(...results) : results[0]); - }); - }); - - callback[symbol] = promise; - } - - return callback - }; - - const { AbstractIterator: AbstractIterator$2 } = abstractLeveldown$1; - const inherits$8 = inherits$9.exports; - const getCallback$3 = util$C.getCallback; - - const kOptions = Symbol('options'); - const kIterator = Symbol('iterator'); - const kOperations$2 = Symbol('operations'); - const kPromise$1 = Symbol('promise'); - - function DeferredIterator$1 (db, options) { - AbstractIterator$2.call(this, db); - - this[kOptions] = options; - this[kIterator] = null; - this[kOperations$2] = []; - } - - inherits$8(DeferredIterator$1, AbstractIterator$2); - - DeferredIterator$1.prototype.setDb = function (db) { - this[kIterator] = db.iterator(this[kOptions]); - - for (const op of this[kOperations$2].splice(0, this[kOperations$2].length)) { - this[kIterator][op.method](...op.args); - } - }; - - DeferredIterator$1.prototype.next = function (...args) { - if (this.db.status === 'open') { - return this[kIterator].next(...args) - } - - const callback = getCallback$3(args, kPromise$1, function map (key, value) { - if (key === undefined && value === undefined) { - return undefined - } else { - return [key, value] - } - }); - - if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'next', args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise$1] || this - }; - - DeferredIterator$1.prototype.seek = function (...args) { - if (this.db.status === 'open') { - this[kIterator].seek(...args); - } else if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'seek', args }); - } else { - throw new Error('Database is not open') - } - }; - - DeferredIterator$1.prototype.end = function (...args) { - if (this.db.status === 'open') { - return this[kIterator].end(...args) - } - - const callback = getCallback$3(args, kPromise$1); - - if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'end', args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise$1] || this - }; - - for (const method of ['next', 'seek', 'end']) { - DeferredIterator$1.prototype['_' + method] = function () { - /* istanbul ignore next: assertion */ - throw new Error('Did not expect private method to be called: ' + method) - }; - } - - var deferredIterator = DeferredIterator$1; - - const { AbstractChainedBatch: AbstractChainedBatch$2 } = abstractLeveldown$1; - const kOperations$1 = Symbol('operations'); - - var deferredChainedBatch = class DeferredChainedBatch extends AbstractChainedBatch$2 { - constructor (db) { - super(db); - this[kOperations$1] = []; - } - - _put (key, value, options) { - this[kOperations$1].push({ ...options, type: 'put', key, value }); - } - - _del (key, options) { - this[kOperations$1].push({ ...options, type: 'del', key }); - } - - _clear () { - this[kOperations$1] = []; - } - - _write (options, callback) { - // AbstractChainedBatch would call _batch(), we call batch() - this.db.batch(this[kOperations$1], options, callback); - } - }; - - const { AbstractLevelDOWN: AbstractLevelDOWN$2 } = abstractLeveldown$1; - const inherits$7 = inherits$9.exports; - const DeferredIterator = deferredIterator; - const DeferredChainedBatch = deferredChainedBatch; - const getCallback$2 = util$C.getCallback; - - const deferrables = ['put', 'get', 'getMany', 'del', 'batch', 'clear']; - const optionalDeferrables = ['approximateSize', 'compactRange']; - - const kInnerDb = Symbol('innerDb'); - const kOperations = Symbol('operations'); - const kPromise = Symbol('promise'); - - function DeferredLevelDOWN$1 (db) { - AbstractLevelDOWN$2.call(this, db.supports || {}); - - // TODO (future major): remove this fallback; db must have manifest that - // declares approximateSize and compactRange in additionalMethods. - for (const m of optionalDeferrables) { - if (typeof db[m] === 'function' && !this.supports.additionalMethods[m]) { - this.supports.additionalMethods[m] = true; - } - } - - this[kInnerDb] = db; - this[kOperations] = []; - - implement(this); - } - - inherits$7(DeferredLevelDOWN$1, AbstractLevelDOWN$2); - - DeferredLevelDOWN$1.prototype.type = 'deferred-leveldown'; - - // Backwards compatibility for reachdown and subleveldown - Object.defineProperty(DeferredLevelDOWN$1.prototype, '_db', { - enumerable: true, - get () { - return this[kInnerDb] - } - }); - - DeferredLevelDOWN$1.prototype._open = function (options, callback) { - const onopen = (err) => { - if (err || this[kInnerDb].status !== 'open') { - // TODO: reject scheduled operations - return callback(err || new Error('Database is not open')) - } - - const operations = this[kOperations]; - this[kOperations] = []; - - for (const op of operations) { - if (op.iterator) { - op.iterator.setDb(this[kInnerDb]); - } else { - this[kInnerDb][op.method](...op.args); - } - } - - /* istanbul ignore if: assertion */ - if (this[kOperations].length > 0) { - throw new Error('Did not expect further operations') - } - - callback(); - }; - - if (this[kInnerDb].status === 'new' || this[kInnerDb].status === 'closed') { - this[kInnerDb].open(options, onopen); - } else { - this._nextTick(onopen); - } - }; - - DeferredLevelDOWN$1.prototype._close = function (callback) { - this[kInnerDb].close(callback); - }; - - DeferredLevelDOWN$1.prototype._isOperational = function () { - return this.status === 'opening' - }; - - function implement (self) { - const additionalMethods = Object.keys(self.supports.additionalMethods); - - for (const method of deferrables.concat(additionalMethods)) { - // Override the public rather than private methods to cover cases where abstract-leveldown - // has a fast-path like on db.batch([]) which bypasses _batch() because the array is empty. - self[method] = function (...args) { - if (method === 'batch' && args.length === 0) { - return new DeferredChainedBatch(this) - } else if (this.status === 'open') { - return this[kInnerDb][method](...args) - } - - const callback = getCallback$2(args, kPromise); - - if (this.status === 'opening') { - this[kOperations].push({ method, args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise] - }; - } - - self.iterator = function (options) { - if (this.status === 'open') { - return this[kInnerDb].iterator(options) - } else if (this.status === 'opening') { - const iterator = new DeferredIterator(this, options); - this[kOperations].push({ iterator }); - return iterator - } else { - throw new Error('Database is not open') - } - }; - - for (const method of deferrables.concat(['iterator'])) { - self['_' + method] = function () { - /* istanbul ignore next: assertion */ - throw new Error('Did not expect private method to be called: ' + method) - }; - } - } - - deferredLeveldown.exports = DeferredLevelDOWN$1; - deferredLeveldown.exports.DeferredIterator = DeferredIterator; - - var readable = {exports: {}}; - - var stream$2 = require$$2__default["default"]; - - function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - - function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } - - function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - var _require$2 = require$$0__default$2["default"], - Buffer$7 = _require$2.Buffer; - - var _require2 = require$$0__default$3["default"], - inspect$5 = _require2.inspect; - - var custom$9 = inspect$5 && inspect$5.custom || 'inspect'; - - function copyBuffer(src, target, offset) { - Buffer$7.prototype.copy.call(src, target, offset); - } - - var buffer_list = - /*#__PURE__*/ - function () { - function BufferList() { - _classCallCheck$1(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass$1(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer$7.alloc(0); - var ret = Buffer$7.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer$7.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom$9, - value: function value(_, options) { - return inspect$5(this, _objectSpread$1({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; - }(); - - function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - - - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - - return this; - } - - function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); - } - - function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); - } - - function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } - } - - function emitErrorNT(self, err) { - self.emit('error', err); - } - - function errorOrDestroy$2(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); - } - - var destroy_1 = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy$2 - }; - - var errors$6 = {}; - - const codes$4 = {}; - - function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes$4[code] = NodeError; - } - - // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } - } - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; - } - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; - } - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } - } - - createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' - }, TypeError); - createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; - }, TypeError); - createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); - createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' - }); - createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); - createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; - }); - createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); - createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); - createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); - createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); - createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg - }, TypeError); - createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - - errors$6.codes = codes$4; - - var ERR_INVALID_OPT_VALUE = errors$6.codes.ERR_INVALID_OPT_VALUE; - - function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; - } - - function getHighWaterMark$2(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; - } - - var state$1 = { - getHighWaterMark: getHighWaterMark$2 - }; - - /** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - - var node$4 = require$$0__default$3["default"].deprecate; - - var _stream_writable = Writable$1; - // there will be only 2 of these for each stream - - - function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function () { - onCorkedFinish(_this, state); - }; - } - /* */ - - /**/ - - - var Duplex$3; - /**/ - - Writable$1.WritableState = WritableState; - /**/ - - var internalUtil = { - deprecate: node$4 - }; - /**/ - - /**/ - - var Stream$4 = stream$2; - /**/ - - - var Buffer$6 = require$$0__default$2["default"].Buffer; - - var OurUint8Array$1 = commonjsGlobal.Uint8Array || function () {}; - - function _uint8ArrayToBuffer$1(chunk) { - return Buffer$6.from(chunk); - } - - function _isUint8Array$1(obj) { - return Buffer$6.isBuffer(obj) || obj instanceof OurUint8Array$1; - } - - var destroyImpl$1 = destroy_1; - - var _require$1 = state$1, - getHighWaterMark$1 = _require$1.getHighWaterMark; - - var _require$codes$3 = errors$6.codes, - ERR_INVALID_ARG_TYPE$2 = _require$codes$3.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED$2 = _require$codes$3.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK$1 = _require$codes$3.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes$3.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED$1 = _require$codes$3.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes$3.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes$3.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes$3.ERR_UNKNOWN_ENCODING; - - var errorOrDestroy$1 = destroyImpl$1.errorOrDestroy; - - inherits$9.exports(Writable$1, Stream$4); - - function nop$3() {} - - function WritableState(options, stream, isDuplex) { - Duplex$3 = Duplex$3 || _stream_duplex; - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex$3; // object stream flag to indicate whether or not this stream - // contains buffers or objects. - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - - this.highWaterMark = getHighWaterMark$1(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. - - this.needDrain = false; // at the start of calling end() - - this.ending = false; // when end() has been called, and returned - - this.ended = false; // when 'finish' is emitted - - this.finished = false; // has it been destroyed - - this.destroyed = false; // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - - this.length = 0; // a flag to see when we're in the middle of a write. - - this.writing = false; // when true all writes will be buffered until .uncork() call - - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - - this.sync = true; // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - - - this.writecb = null; // the amount that is being written when _write is called. - - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - - this.prefinished = false; // True if the error was already emitted and should not be thrown again - - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - - this.corkedRequestsFree = new CorkedRequest(this); - } - - WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - - while (current) { - out.push(current); - current = current.next; - } - - return out; - }; - - (function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} - })(); // Test _writableState for inheritance to account for Duplex streams, - // whose prototype chain only points to Readable. - - - var realHasInstance; - - if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable$1, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable$1) return false; - return object && object._writableState instanceof WritableState; - } - }); - } else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; - } - - function Writable$1(options) { - Duplex$3 = Duplex$3 || _stream_duplex; // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex$3; - if (!isDuplex && !realHasInstance.call(Writable$1, this)) return new Writable$1(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - - Stream$4.call(this); - } // Otherwise people can pipe Writable streams, which is just wrong. - - - Writable$1.prototype.pipe = function () { - errorOrDestroy$1(this, new ERR_STREAM_CANNOT_PIPE()); - }; - - function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - - errorOrDestroy$1(stream, er); - process.nextTick(cb, er); - } // Checks that a user-supplied chunk is valid, especially for the particular - // mode the stream is in. Currently this means that `null` is never accepted - // and undefined/non-string values are only allowed in object mode. - - - function validChunk(stream, state, chunk, cb) { - var er; - - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE$2('chunk', ['string', 'Buffer'], chunk); - } - - if (er) { - errorOrDestroy$1(stream, er); - process.nextTick(cb, er); - return false; - } - - return true; - } - - Writable$1.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - var isBuf = !state.objectMode && _isUint8Array$1(chunk); - - if (isBuf && !Buffer$6.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer$1(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop$3; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; - }; - - Writable$1.prototype.cork = function () { - this._writableState.corked++; - }; - - Writable$1.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } - }; - - Writable$1.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - - Object.defineProperty(Writable$1.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer$6.from(chunk, encoding); - } - - return chunk; - } - - Object.defineProperty(Writable$1.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); // if we're already writing something, then just put this - // in the queue, and wait our turn. Otherwise, call _write - // If we return false, then we need a drain event, so set that flag. - - function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; - } - - function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED$1('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; - } - - function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error - - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy$1(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy$1(stream, er); // this can emit finish, but finish must - // always follow error - - finishMaybe(stream, state); - } - } - - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - - function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK$1(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } - } - - function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); - } // Must force callback to be called on nextTick, so that we don't - // emit 'drain' before the write() consumer gets the 'false' return - // value, and has a chance to attach a 'drain' listener. - - - function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } - } // if there's something in the buffer waiting, then process it - - - function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - - state.pendingcb++; - state.lastBufferedRequest = null; - - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - - Writable$1.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED$2('_write()')); - }; - - Writable$1.prototype._writev = null; - - Writable$1.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. - - - if (!state.ending) endWritable(this, state, cb); - return this; - }; - - Object.defineProperty(Writable$1.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); - - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - - function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - - if (err) { - errorOrDestroy$1(stream, err); - } - - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); - } - - function prefinish$1(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } - } - - function finishMaybe(stream, state) { - var need = needFinish(state); - - if (need) { - prefinish$1(stream, state); - - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - - return need; - } - - function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - - state.ended = true; - stream.writable = false; - } - - function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; - } - - Object.defineProperty(Writable$1.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._writableState.destroyed = value; - } - }); - Writable$1.prototype.destroy = destroyImpl$1.destroy; - Writable$1.prototype._undestroy = destroyImpl$1.undestroy; - - Writable$1.prototype._destroy = function (err, cb) { - cb(err); - }; - - /**/ - - var objectKeys = Object.keys || function (obj) { - var keys = []; - - for (var key in obj) { - keys.push(key); - } - - return keys; - }; - /**/ - - - var _stream_duplex = Duplex$2; - - var Readable$2 = _stream_readable; - - var Writable = _stream_writable; - - inherits$9.exports(Duplex$2, Readable$2); - - { - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex$2.prototype[method]) Duplex$2.prototype[method] = Writable.prototype[method]; - } - } - - function Duplex$2(options) { - if (!(this instanceof Duplex$2)) return new Duplex$2(options); - Readable$2.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } - } - - Object.defineProperty(Duplex$2.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); - Object.defineProperty(Duplex$2.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - Object.defineProperty(Duplex$2.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); // the no-half-open enforcer - - function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. - - process.nextTick(onEndNT, this); - } - - function onEndNT(self) { - self.end(); - } - - Object.defineProperty(Duplex$2.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } - }); - - var ERR_STREAM_PREMATURE_CLOSE = errors$6.codes.ERR_STREAM_PREMATURE_CLOSE; - - function once$1(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; - } - - function noop$1() {} - - function isRequest$1(stream) { - return stream.setHeader && typeof stream.abort === 'function'; - } - - function eos$1(stream, opts, callback) { - if (typeof opts === 'function') return eos$1(stream, null, opts); - if (!opts) opts = {}; - callback = once$1(callback || noop$1); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest$1(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; - } - - var endOfStream = eos$1; - - var _Object$setPrototypeO; - - function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - var finished = endOfStream; - - var kLastResolve = Symbol('lastResolve'); - var kLastReject = Symbol('lastReject'); - var kError = Symbol('error'); - var kEnded = Symbol('ended'); - var kLastPromise = Symbol('lastPromise'); - var kHandlePromise = Symbol('handlePromise'); - var kStream = Symbol('stream'); - - function createIterResult(value, done) { - return { - value: value, - done: done - }; - } - - function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } - } - - function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); - } - - function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; - } - - var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); - var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } - }, _defineProperty$1(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; - }), _defineProperty$1(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); - }), _Object$setPrototypeO), AsyncIteratorPrototype); - - var createReadableStreamAsyncIterator$1 = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty$1(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty$1(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty$1(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; - }; - - var async_iterator = createReadableStreamAsyncIterator$1; - - function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - - function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - - function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$g(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - - function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - var ERR_INVALID_ARG_TYPE$1 = errors$6.codes.ERR_INVALID_ARG_TYPE; - - function from$1(Readable, iterable, opts) { - var iterator; - - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE$1('iterable', ['Iterable'], iterable); - - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); // Reading boolean to protect against _read - // being called before last iteration completion. - - var reading = false; - - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - - function next() { - return _next2.apply(this, arguments); - } - - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), - value = _ref.value, - done = _ref.done; - - if (done) { - readable.push(null); - } else if (readable.push((yield value))) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - - return readable; - } - - var from_1 = from$1; - - var _stream_readable = Readable$1; - /**/ - - var Duplex$1; - /**/ - - Readable$1.ReadableState = ReadableState; - /**/ - - require$$1__default$1["default"].EventEmitter; - - var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; - }; - /**/ - - /**/ - - - var Stream$3 = stream$2; - /**/ - - - var Buffer$5 = require$$0__default$2["default"].Buffer; - - var OurUint8Array = commonjsGlobal.Uint8Array || function () {}; - - function _uint8ArrayToBuffer(chunk) { - return Buffer$5.from(chunk); - } - - function _isUint8Array(obj) { - return Buffer$5.isBuffer(obj) || obj instanceof OurUint8Array; - } - /**/ - - - var debugUtil = require$$0__default$3["default"]; - - var debug; - - if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); - } else { - debug = function debug() {}; - } - /**/ - - - var BufferList = buffer_list; - - var destroyImpl = destroy_1; - - var _require = state$1, - getHighWaterMark = _require.getHighWaterMark; - - var _require$codes$2 = errors$6.codes, - ERR_INVALID_ARG_TYPE = _require$codes$2.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes$2.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED$1 = _require$codes$2.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes$2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - - var StringDecoder$3; - var createReadableStreamAsyncIterator; - var from; - - inherits$9.exports(Readable$1, Stream$3); - - var errorOrDestroy = destroyImpl.errorOrDestroy; - var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - - function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; - } - - function ReadableState(options, stream, isDuplex) { - Duplex$1 = Duplex$1 || _stream_duplex; - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex$1; // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - - this.readingMore = false; - this.decoder = null; - this.encoding = null; - - if (options.encoding) { - if (!StringDecoder$3) StringDecoder$3 = require$$10__default["default"].StringDecoder; - this.decoder = new StringDecoder$3(options.encoding); - this.encoding = options.encoding; - } - } - - function Readable$1(options) { - Duplex$1 = Duplex$1 || _stream_duplex; - if (!(this instanceof Readable$1)) return new Readable$1(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex$1; - this._readableState = new ReadableState(options, this, isDuplex); // legacy - - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream$3.call(this); - } - - Object.defineProperty(Readable$1.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - } - }); - Readable$1.prototype.destroy = destroyImpl.destroy; - Readable$1.prototype._undestroy = destroyImpl.undestroy; - - Readable$1.prototype._destroy = function (err, cb) { - cb(err); - }; // Manually shove something into the read() buffer. - // This returns true if the highWaterMark has not been hit yet, - // similar to how Writable.write() returns true if you should - // write() some more. - - - Readable$1.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - - if (encoding !== state.encoding) { - chunk = Buffer$5.from(chunk, encoding); - encoding = ''; - } - - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); - }; // Unshift should *always* be something directly out of read() - - - Readable$1.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); - }; - - function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$5.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - - - return !state.ended && (state.length < state.highWaterMark || state.length === 0); - } - - function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - - maybeReadMore(stream, state); - } - - function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - - return er; - } - - Readable$1.prototype.isPaused = function () { - return this._readableState.flowing === false; - }; // backwards compatibility. - - - Readable$1.prototype.setEncoding = function (enc) { - if (!StringDecoder$3) StringDecoder$3 = require$$10__default["default"].StringDecoder; - var decoder = new StringDecoder$3(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; - }; // Don't raise the hwm > 1GB - - - var MAX_HWM = 0x40000000; - - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - - return n; - } // This function is designed to be inlinable, so please take care when making - // changes to the function body. - - - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - - if (!state.ended) { - state.needReadable = true; - return 0; - } - - return state.length; - } // you can override either this method, or the async _read(n) below. - - - Readable$1.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - - - var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some - - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - - - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - - this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - return ret; - }; - - function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - - if (state.decoder) { - var chunk = state.decoder.end(); - - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } - } // Don't emit readable right away in sync mode, because this can trigger - // another read() call => stack overflow. This way, it might trigger - // a nextTick recursion warning, but that's not so bad. - - - function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } - } - - function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); - } // at this point, the user has presumably seen the 'readable' event, - // and called read() to consume some data. that may have triggered - // in turn another _read(n) call, in which case reading = true if - // it's in progress. - // However, if we're not ended, or reading, and the length < hwm, - // then go ahead and try to read some more preemptively. - - - function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } - } - - function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } - - state.readingMore = false; - } // abstract method. to be overridden in specific implementation classes. - // call cb(er, data) where data is <= n in length. - // for virtual (non-string, non-buffer) streams, "length" is somewhat - // arbitrary, and perhaps not very meaningful. - - - Readable$1.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED$1('_read()')); - }; - - Readable$1.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - - case 1: - state.pipes = [state.pipes, dest]; - break; - - default: - state.pipes.push(dest); - break; - } - - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - - - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - - - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - - - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. - - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - - dest.once('close', onclose); - - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to - - - dest.emit('pipe', src); // start the flow if it hasn't been started already. - - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; - }; - - function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; - } - - Readable$1.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. - - if (state.pipesCount === 0) return this; // just one destination. most common case. - - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. - - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } // slow case. multiple pipe destinations. - - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - - - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; - }; // set up data events if they are asked for - // Ensure readable listeners eventually get something - - - Readable$1.prototype.on = function (ev, fn) { - var res = Stream$3.prototype.on.call(this, ev, fn); - var state = this._readableState; - - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - - return res; - }; - - Readable$1.prototype.addListener = Readable$1.prototype.on; - - Readable$1.prototype.removeListener = function (ev, fn) { - var res = Stream$3.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; - }; - - Readable$1.prototype.removeAllListeners = function (ev) { - var res = Stream$3.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; - }; - - function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } - } - - function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); - } // pause() and resume() are remnants of the legacy readable stream API - // If the user uses them, then switch into old mode. - - - Readable$1.prototype.resume = function () { - var state = this._readableState; - - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; - resume(this, state); - } - - state.paused = false; - return this; - }; - - function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } - } - - function resume_(stream, state) { - debug('resume', state.reading); - - if (!state.reading) { - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); - } - - Readable$1.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - - this._readableState.paused = true; - return this; - }; - - function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - - while (state.flowing && stream.read() !== null) { - } - } // wrap an old-style stream as the async data source. - // This is *not* part of the readable stream interface. - // It is an ugly unfortunate mess of history. - - - Readable$1.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. - - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. - - - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - - - this._read = function (n) { - debug('wrapped _read', n); - - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; - }; - - if (typeof Symbol === 'function') { - Readable$1.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = async_iterator; - } - - return createReadableStreamAsyncIterator(this); - }; - } - - Object.defineProperty(Readable$1.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } - }); - Object.defineProperty(Readable$1.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } - }); - Object.defineProperty(Readable$1.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } - }); // exposed for testing purposes only. - - Readable$1._fromList = fromList; - Object.defineProperty(Readable$1.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } - }); // Pluck off n bytes from an array of buffers. - // Length is the combined lengths of all the buffers in the list. - // This function is designed to be inlinable, so please take care when making - // changes to the function body. - - function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; - } - - function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } - } - - function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } - } - - if (typeof Symbol === 'function') { - Readable$1.from = function (iterable, opts) { - if (from === undefined) { - from = from_1; - } - - return from(Readable$1, iterable, opts); - }; - } - - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - - return -1; - } - - var _stream_transform = Transform$1; - - var _require$codes$1 = errors$6.codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes$1.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes$1.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0; - - var Duplex = _stream_duplex; - - inherits$9.exports(Transform$1, Duplex); - - function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - - ts.writechunk = null; - ts.writecb = null; - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } - } - - function Transform$1(options) { - if (!(this instanceof Transform$1)) return new Transform$1(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; // start out asking for a readable event once data is transformed. - - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. - - - this.on('prefinish', prefinish); - } - - function prefinish() { - var _this = this; - - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } - } - - Transform$1.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); - }; // This is the part where you do stuff! - // override this function in implementation classes. - // 'chunk' is an input chunk. - // - // Call `push(newChunk)` to pass along transformed output - // to the readable side. You may call 'push' zero or more times. - // - // Call `cb(err)` when you are done with this chunk. If you pass - // an error, then that'll put the hurt on the whole operation. If you - // never call cb(), then you'll never get another chunk. - - - Transform$1.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); - }; - - Transform$1.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } - }; // Doesn't matter what the args are here. - // _transform does all the work. - // That we got here means that the readable side wants more data. - - - Transform$1.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } - }; - - Transform$1.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); - }; - - function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); - } - - var _stream_passthrough = PassThrough; - - var Transform = _stream_transform; - - inherits$9.exports(PassThrough, Transform); - - function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); - } - - PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); - }; - - var eos; - - function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; - } - - var _require$codes = errors$6.codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - - function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; - } - - function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; - } - - function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = endOfStream; - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; - } - - function call$2(fn) { - fn(); - } - - function pipe(from, to) { - return from.pipe(to); - } - - function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); - } - - function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call$2); - if (reading) return; - destroys.forEach(call$2); - callback(error); - }); - }); - return streams.reduce(pipe); - } - - var pipeline_1 = pipeline; - - (function (module, exports) { - var Stream = require$$2__default["default"]; - if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; - } else { - exports = module.exports = _stream_readable; - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = _stream_writable; - exports.Duplex = _stream_duplex; - exports.Transform = _stream_transform; - exports.PassThrough = _stream_passthrough; - exports.finished = endOfStream; - exports.pipeline = pipeline_1; - } - }(readable, readable.exports)); - - const inherits$6 = inherits$9.exports; - const { Readable } = readable.exports; - - var levelIteratorStream = ReadStream; - inherits$6(ReadStream, Readable); - - function ReadStream (iterator, options) { - if (!(this instanceof ReadStream)) return new ReadStream(iterator, options) - options = options || {}; - Readable.call(this, Object.assign({}, options, { - objectMode: true - })); - this._iterator = iterator; - this._options = options; - this.on('end', this.destroy.bind(this, null, null)); - } - - ReadStream.prototype._read = function () { - if (this.destroyed) return - - this._iterator.next((err, key, value) => { - if (this.destroyed) return - if (err) return this.destroy(err) - - if (key === undefined && value === undefined) { - this.push(null); - } else if (this._options.keys !== false && this._options.values === false) { - this.push(key); - } else if (this._options.keys === false && this._options.values !== false) { - this.push(value); - } else { - this.push({ key, value }); - } - }); - }; - - ReadStream.prototype._destroy = function (err, callback) { - this._iterator.end(function (err2) { - callback(err || err2); - }); - }; - - var errors$5 = {exports: {}}; - - (function (module) { - - function createError (type, Proto) { - const Err = function (message, cause) { - if (typeof message === 'object' && message !== null) { - // Can be passed just a cause - cause = cause || message; - message = message.message || message.name; - } - - message = message || ''; - cause = cause || undefined; - - // If input is already of type, return as-is to keep its stack trace. - // Avoid instanceof, for when node_modules has multiple copies of level-errors. - if (typeof cause === 'object' && cause.type === type && cause.message === message) { - return cause - } - - Object.defineProperty(this, 'type', { value: type, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'name', { value: type, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'cause', { value: cause, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'message', { value: message, enumerable: false, writable: true, configurable: true }); - - Error.call(this); - - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, Err); - } - }; - - Err.prototype = new Proto(); - return Err - } - - const LevelUPError = createError('LevelUPError', Error); - - module.exports = { - LevelUPError: LevelUPError, - InitializationError: createError('InitializationError', LevelUPError), - OpenError: createError('OpenError', LevelUPError), - ReadError: createError('ReadError', LevelUPError), - WriteError: createError('WriteError', LevelUPError), - NotFoundError: createError('NotFoundError', LevelUPError), - EncodingError: createError('EncodingError', LevelUPError) - }; - - module.exports.NotFoundError.prototype.notFound = true; - module.exports.NotFoundError.prototype.status = 404; - }(errors$5)); - - var common$z = {}; - - common$z.getCallback = function (options, callback) { - return typeof options === 'function' ? options : callback - }; - - common$z.getOptions = function (options) { - return typeof options === 'object' && options !== null ? options : {} - }; - - const WriteError$1 = errors$5.exports.WriteError; - const catering$1 = catering$3; - const getCallback$1 = common$z.getCallback; - const getOptions$1 = common$z.getOptions; - - function Batch$5 (levelup) { - this.db = levelup; - this.batch = levelup.db.batch(); - this.ops = []; - this.length = 0; - } - - Batch$5.prototype.put = function (key, value, options) { - try { - this.batch.put(key, value, options); - } catch (e) { - throw new WriteError$1(e) - } - - this.ops.push({ ...options, type: 'put', key, value }); - this.length++; - - return this - }; - - Batch$5.prototype.del = function (key, options) { - try { - this.batch.del(key, options); - } catch (err) { - throw new WriteError$1(err) - } - - this.ops.push({ ...options, type: 'del', key }); - this.length++; - - return this - }; - - Batch$5.prototype.clear = function () { - try { - this.batch.clear(); - } catch (err) { - throw new WriteError$1(err) - } - - this.ops = []; - this.length = 0; - - return this - }; - - Batch$5.prototype.write = function (options, callback) { - const levelup = this.db; - const ops = this.ops; - - callback = getCallback$1(options, callback); - callback = catering$1.fromCallback(callback); - options = getOptions$1(options); - - try { - this.batch.write(options, function (err) { - if (err) { return callback(new WriteError$1(err)) } - levelup.emit('batch', ops); - callback(); - }); - } catch (err) { - throw new WriteError$1(err) - } - - return callback.promise - }; - - var batch = Batch$5; - - var nextTick$2 = process.nextTick; - - const EventEmitter$u = require$$1__default$1["default"].EventEmitter; - const inherits$5 = require$$0__default$3["default"].inherits; - const DeferredLevelDOWN = deferredLeveldown.exports; - const IteratorStream = levelIteratorStream; - const Batch$4 = batch; - const errors$4 = errors$5.exports; - const supports = levelSupports; - const catering = catering$3; - const getCallback = common$z.getCallback; - const getOptions = common$z.getOptions; - - // TODO: after we drop node 10, also use queueMicrotask() in node - const nextTick$1 = nextTick$2; - - const WriteError = errors$4.WriteError; - const ReadError = errors$4.ReadError; - const NotFoundError = errors$4.NotFoundError; - const OpenError = errors$4.OpenError; - const InitializationError = errors$4.InitializationError; - - function LevelUP (db, options, callback) { - if (!(this instanceof LevelUP)) { - return new LevelUP(db, options, callback) - } - - let error; - - EventEmitter$u.call(this); - this.setMaxListeners(Infinity); - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - options = options || {}; - - if (!db || typeof db !== 'object') { - error = new InitializationError('First argument must be an abstract-leveldown compliant store'); - if (typeof callback === 'function') { - return nextTick$1(callback, error) - } - throw error - } - - if (typeof db.status !== 'string') { - throw new Error('.status required, old abstract-leveldown') - } - - this.options = getOptions(options); - this._db = db; - this.db = null; - this.open(callback || ((err) => { - if (err) this.emit('error', err); - })); - - // Create manifest based on deferred-leveldown's - this.supports = supports(this.db.supports, { - status: true, - deferredOpen: true, - openCallback: true, - promises: true, - streams: true - }); - - // Experimental: enrich levelup interface - for (const method of Object.keys(this.supports.additionalMethods)) { - if (this[method] != null) continue - - // Don't do this.db[method].bind() because this.db is dynamic. - this[method] = function (...args) { - return this.db[method](...args) - }; - } - } - - LevelUP.prototype.emit = EventEmitter$u.prototype.emit; - LevelUP.prototype.once = EventEmitter$u.prototype.once; - inherits$5(LevelUP, EventEmitter$u); - - // TODO: tests - Object.defineProperty(LevelUP.prototype, 'status', { - enumerable: true, - get () { - return this.db.status - } - }); - - // TODO: tests - LevelUP.prototype.isOperational = function () { - return this.db.status === 'open' || this.db.status === 'opening' - }; - - LevelUP.prototype.open = function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = null; - } - - callback = catering.fromCallback(callback); - - if (!opts) { - opts = this.options; - } - - // 1) Don't check db.status until levelup has opened, - // in order for levelup events to be consistent - if (this.db && this.isOpen()) { - nextTick$1(callback, null, this); - return callback.promise - } - - if (this.db && this._isOpening()) { - this.once('open', () => { callback(null, this); }); - return callback.promise - } - - // 2) Instead let deferred-leveldown handle already-open cases. - // TODO: ideally though, levelup would have its own status - this.db = new DeferredLevelDOWN(this._db); - this.emit('opening'); - - this.db.open(opts, (err) => { - if (err) { - return callback(new OpenError(err)) - } - this.db = this._db; - callback(null, this); - this.emit('open'); - this.emit('ready'); - }); - - return callback.promise - }; - - LevelUP.prototype.close = function (callback) { - callback = catering.fromCallback(callback); - - if (this.isOpen()) { - this.db.close((err, ...rest) => { - this.emit('closed'); - callback(err, ...rest); - }); - this.emit('closing'); - } else if (this.isClosed()) { - nextTick$1(callback); - } else if (this.db.status === 'closing') { - this.once('closed', callback); - } else if (this._isOpening()) { - this.once('open', () => { - this.close(callback); - }); - } - - return callback.promise - }; - - // TODO: remove in future major - LevelUP.prototype.isOpen = function () { - return this.db.status === 'open' - }; - - // TODO: remove in future major - LevelUP.prototype._isOpening = function () { - return this.db.status === 'opening' - }; - - // TODO: remove in future major - LevelUP.prototype.isClosed = function () { - return (/^clos|new/).test(this.db.status) - }; - - LevelUP.prototype.get = function (key, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.get(key, options, function (err, value) { - if (err) { - if ((/notfound/i).test(err) || err.notFound) { - err = new NotFoundError('Key not found in database [' + key + ']', err); - } else { - err = new ReadError(err); - } - return callback(err) - } - callback(null, value); - }); - - return callback.promise - }; - - LevelUP.prototype.getMany = function (keys, options, callback) { - return this.db.getMany(keys, options, callback) - }; - - LevelUP.prototype.put = function (key, value, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.put(key, value, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('put', key, value); - callback(); - }); - - return callback.promise - }; - - LevelUP.prototype.del = function (key, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.del(key, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('del', key); - callback(); - }); - - return callback.promise - }; - - LevelUP.prototype.batch = function (arr, options, callback) { - if (!arguments.length) { - return new Batch$4(this) - } - - if (typeof arr === 'function') callback = arr; - else callback = getCallback(options, callback); - - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.batch(arr, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('batch', arr); - callback(); - }); - - return callback.promise - }; - - LevelUP.prototype.iterator = function (options) { - return this.db.iterator(options) - }; - - LevelUP.prototype.clear = function (options, callback) { - callback = getCallback(options, callback); - options = getOptions(options); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - this.db.clear(options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('clear', options); - callback(); - }); - - return callback.promise - }; - - LevelUP.prototype.readStream = - LevelUP.prototype.createReadStream = function (options) { - options = Object.assign({ keys: true, values: true }, options); - if (typeof options.limit !== 'number') { options.limit = -1; } - return new IteratorStream(this.db.iterator(options), options) - }; - - LevelUP.prototype.keyStream = - LevelUP.prototype.createKeyStream = function (options) { - return this.createReadStream(Object.assign({}, options, { keys: true, values: false })) - }; - - LevelUP.prototype.valueStream = - LevelUP.prototype.createValueStream = function (options) { - return this.createReadStream(Object.assign({}, options, { keys: false, values: true })) - }; - - LevelUP.prototype.toString = function () { - return 'LevelUP' - }; - - LevelUP.prototype.type = 'levelup'; - - // Expose nextTick for API parity with abstract-leveldown - LevelUP.prototype._nextTick = nextTick$1; - - function maybeError (db, callback) { - if (!db.isOperational()) { - nextTick$1(callback, new ReadError('Database is not open')); - return true - } - - return false - } - - LevelUP.errors = errors$4; - var levelup$1 = LevelUP; - - var encodings$1 = {}; - - (function (exports) { - - const { Buffer } = require$$0__default$2["default"]; - - exports.utf8 = exports['utf-8'] = { - encode: function (data) { - return isBinary(data) ? data : String(data) - }, - decode: identity, - buffer: false, - type: 'utf8' - }; - - exports.json = { - encode: JSON.stringify, - decode: JSON.parse, - buffer: false, - type: 'json' - }; - - exports.binary = { - encode: function (data) { - return isBinary(data) ? data : Buffer.from(data) - }, - decode: identity, - buffer: true, - type: 'binary' - }; - - exports.none = { - encode: identity, - decode: identity, - buffer: false, - type: 'id' - }; - - exports.id = exports.none; - - const bufferEncodings = [ - 'hex', - 'ascii', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le' - ]; - - for (const type of bufferEncodings) { - exports[type] = { - encode: function (data) { - return isBinary(data) ? data : Buffer.from(data, type) - }, - decode: function (buffer) { - return buffer.toString(type) - }, - buffer: true, - type: type - }; - } - - function identity (value) { - return value - } - - function isBinary (data) { - return data === undefined || data === null || Buffer.isBuffer(data) - } - }(encodings$1)); - - const encodings = encodings$1; - const rangeOptions = new Set(['lt', 'gt', 'lte', 'gte']); - - var levelCodec = Codec$3; - - function Codec$3 (opts) { - if (!(this instanceof Codec$3)) { - return new Codec$3(opts) - } - this.opts = opts || {}; - this.encodings = encodings; - } - - Codec$3.prototype._encoding = function (encoding) { - if (typeof encoding === 'string') encoding = encodings[encoding]; - if (!encoding) encoding = encodings.id; - return encoding - }; - - Codec$3.prototype._keyEncoding = function (opts, batchOpts) { - return this._encoding((batchOpts && batchOpts.keyEncoding) || - (opts && opts.keyEncoding) || - this.opts.keyEncoding) - }; - - Codec$3.prototype._valueEncoding = function (opts, batchOpts) { - return this._encoding((batchOpts && (batchOpts.valueEncoding || batchOpts.encoding)) || - (opts && (opts.valueEncoding || opts.encoding)) || - (this.opts.valueEncoding || this.opts.encoding)) - }; - - Codec$3.prototype.encodeKey = function (key, opts, batchOpts) { - return this._keyEncoding(opts, batchOpts).encode(key) - }; - - Codec$3.prototype.encodeValue = function (value, opts, batchOpts) { - return this._valueEncoding(opts, batchOpts).encode(value) - }; - - Codec$3.prototype.decodeKey = function (key, opts) { - return this._keyEncoding(opts).decode(key) - }; - - Codec$3.prototype.decodeValue = function (value, opts) { - return this._valueEncoding(opts).decode(value) - }; - - Codec$3.prototype.encodeBatch = function (ops, opts) { - return ops.map((_op) => { - const op = { - type: _op.type, - key: this.encodeKey(_op.key, opts, _op) - }; - if (this.keyAsBuffer(opts, _op)) op.keyEncoding = 'binary'; - if (_op.prefix) op.prefix = _op.prefix; - if ('value' in _op) { - op.value = this.encodeValue(_op.value, opts, _op); - if (this.valueAsBuffer(opts, _op)) op.valueEncoding = 'binary'; - } - return op - }) - }; - - Codec$3.prototype.encodeLtgt = function (ltgt) { - const ret = {}; - - for (const key of Object.keys(ltgt)) { - if (key === 'start' || key === 'end') { - throw new Error('Legacy range options ("start" and "end") have been removed') - } - - ret[key] = rangeOptions.has(key) - ? this.encodeKey(ltgt[key], ltgt) - : ltgt[key]; - } - - return ret - }; - - Codec$3.prototype.createStreamDecoder = function (opts) { - if (opts.keys && opts.values) { - return (key, value) => { - return { - key: this.decodeKey(key, opts), - value: this.decodeValue(value, opts) - } - } - } else if (opts.keys) { - return (key) => { - return this.decodeKey(key, opts) - } - } else if (opts.values) { - return (_, value) => { - return this.decodeValue(value, opts) - } - } else { - return function () {} - } - }; - - Codec$3.prototype.keyAsBuffer = function (opts) { - return this._keyEncoding(opts).buffer - }; - - Codec$3.prototype.valueAsBuffer = function (opts) { - return this._valueEncoding(opts).buffer - }; - - const AbstractLevelDOWN$1 = abstractLeveldown$1.AbstractLevelDOWN; - const AbstractChainedBatch$1 = abstractLeveldown$1.AbstractChainedBatch; - const AbstractIterator$1 = abstractLeveldown$1.AbstractIterator; - const inherits$4 = inherits$9.exports; - const Codec$2 = levelCodec; - const EncodingError$6 = errors$5.exports.EncodingError; - const rangeMethods = ['approximateSize', 'compactRange']; - - var encodingDown = DB$2; - - function DB$2 (db, opts) { - if (!(this instanceof DB$2)) return new DB$2(db, opts) - - const manifest = db.supports || {}; - const additionalMethods = manifest.additionalMethods || {}; - - AbstractLevelDOWN$1.call(this, manifest); - - this.supports.encodings = true; - this.supports.additionalMethods = {}; - - rangeMethods.forEach(function (m) { - // TODO (future major): remove this fallback - const fallback = typeof db[m] === 'function'; - - if (additionalMethods[m] || fallback) { - this.supports.additionalMethods[m] = true; - - this[m] = function (start, end, opts, cb) { - start = this.codec.encodeKey(start, opts); - end = this.codec.encodeKey(end, opts); - return this.db[m](start, end, opts, cb) - }; - } - }, this); - - opts = opts || {}; - if (typeof opts.keyEncoding === 'undefined') opts.keyEncoding = 'utf8'; - if (typeof opts.valueEncoding === 'undefined') opts.valueEncoding = 'utf8'; - - this.db = db; - this.codec = new Codec$2(opts); - } - - inherits$4(DB$2, AbstractLevelDOWN$1); - - DB$2.prototype.type = 'encoding-down'; - - DB$2.prototype._serializeKey = - DB$2.prototype._serializeValue = function (datum) { - return datum - }; - - DB$2.prototype._open = function (opts, cb) { - this.db.open(opts, cb); - }; - - DB$2.prototype._close = function (cb) { - this.db.close(cb); - }; - - DB$2.prototype._put = function (key, value, opts, cb) { - key = this.codec.encodeKey(key, opts); - value = this.codec.encodeValue(value, opts); - this.db.put(key, value, opts, cb); - }; - - DB$2.prototype._get = function (key, opts, cb) { - key = this.codec.encodeKey(key, opts); - opts.asBuffer = this.codec.valueAsBuffer(opts); - - this.db.get(key, opts, (err, value) => { - if (err) return cb(err) - - try { - value = this.codec.decodeValue(value, opts); - } catch (err) { - return cb(new EncodingError$6(err)) - } - - cb(null, value); - }); - }; - - DB$2.prototype._getMany = function (keys, opts, cb) { - keys = keys.map((key) => this.codec.encodeKey(key, opts)); - opts.asBuffer = this.codec.valueAsBuffer(opts); - - this.db.getMany(keys, opts, (err, values) => { - if (err) return cb(err) - - const decoded = new Array(values.length); - - for (let i = 0; i < values.length; i++) { - if (values[i] === undefined) { - decoded[i] = undefined; - continue - } - - try { - decoded[i] = this.codec.decodeValue(values[i], opts); - } catch (err) { - return cb(new EncodingError$6(err)) - } - } - - cb(null, decoded); - }); - }; - - DB$2.prototype._del = function (key, opts, cb) { - key = this.codec.encodeKey(key, opts); - this.db.del(key, opts, cb); - }; - - DB$2.prototype._chainedBatch = function () { - return new Batch$3(this) - }; - - DB$2.prototype._batch = function (ops, opts, cb) { - ops = this.codec.encodeBatch(ops, opts); - this.db.batch(ops, opts, cb); - }; - - DB$2.prototype._iterator = function (opts) { - opts.keyAsBuffer = this.codec.keyAsBuffer(opts); - opts.valueAsBuffer = this.codec.valueAsBuffer(opts); - return new Iterator$5(this, opts) - }; - - DB$2.prototype._clear = function (opts, callback) { - opts = this.codec.encodeLtgt(opts); - this.db.clear(opts, callback); - }; - - function Iterator$5 (db, opts) { - AbstractIterator$1.call(this, db); - this.codec = db.codec; - this.keys = opts.keys; - this.values = opts.values; - this.opts = this.codec.encodeLtgt(opts); - this.it = db.db.iterator(this.opts); - } - - inherits$4(Iterator$5, AbstractIterator$1); - - Iterator$5.prototype._next = function (cb) { - this.it.next((err, key, value) => { - if (err) return cb(err) - - try { - if (this.keys && typeof key !== 'undefined') { - key = this.codec.decodeKey(key, this.opts); - } else { - key = undefined; - } - - if (this.values && typeof value !== 'undefined') { - value = this.codec.decodeValue(value, this.opts); - } else { - value = undefined; - } - } catch (err) { - return cb(new EncodingError$6(err)) - } - - cb(null, key, value); - }); - }; - - Iterator$5.prototype._seek = function (key) { - key = this.codec.encodeKey(key, this.opts); - this.it.seek(key); - }; - - Iterator$5.prototype._end = function (cb) { - this.it.end(cb); - }; - - function Batch$3 (db, codec) { - AbstractChainedBatch$1.call(this, db); - this.codec = db.codec; - this.batch = db.db.batch(); - } - - inherits$4(Batch$3, AbstractChainedBatch$1); - - Batch$3.prototype._put = function (key, value, options) { - key = this.codec.encodeKey(key, options); - value = this.codec.encodeValue(value, options); - this.batch.put(key, value); - }; - - Batch$3.prototype._del = function (key, options) { - key = this.codec.encodeKey(key, options); - this.batch.del(key); - }; - - Batch$3.prototype._clear = function () { - this.batch.clear(); - }; - - Batch$3.prototype._write = function (opts, cb) { - this.batch.write(opts, cb); - }; - - const levelup = levelup$1; - const encode$7 = encodingDown; - - function packager (leveldown) { - function Level (location, options, callback) { - if (typeof location === 'function') { - callback = location; - } else if (typeof options === 'function') { - callback = options; - } - - if (!isObject(options)) { - options = isObject(location) ? location : {}; - } - - return levelup(encode$7(leveldown(location, options), options), options, callback) - } - - function isObject (o) { - return typeof o === 'object' && o !== null - } - - for (const m of ['destroy', 'repair']) { - if (typeof leveldown[m] === 'function') { - Level[m] = function (...args) { - leveldown[m](...args); - }; - } - } - - Level.errors = levelup.errors; - - return Level - } - - var levelPackager = packager; - - var fs$l = require$$0__default$1["default"]; - var path$g = require$$1__default["default"]; - var os$2 = require$$1__default$2["default"]; - - // Workaround to fix webpack's build warnings: 'the request of a dependency is an expression' - var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire; // eslint-disable-line - - var vars = (process.config && process.config.variables) || {}; - var prebuildsOnly = !!process.env.PREBUILDS_ONLY; - var abi = process.versions.modules; // TODO: support old node where this is undef - var runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node'); - - var arch = os$2.arch(); - var platform = os$2.platform(); - var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc'); - var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''; - var uv = (process.versions.uv || '').split('.')[0]; - - var nodeGypBuild = load$2; - - function load$2 (dir) { - return runtimeRequire(load$2.path(dir)) - } - - load$2.path = function (dir) { - dir = path$g.resolve(dir || '.'); - - try { - var name = runtimeRequire(path$g.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_'); - if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']; - } catch (err) {} - - if (!prebuildsOnly) { - var release = getFirst(path$g.join(dir, 'build/Release'), matchBuild); - if (release) return release - - var debug = getFirst(path$g.join(dir, 'build/Debug'), matchBuild); - if (debug) return debug - } - - var prebuild = resolve(dir); - if (prebuild) return prebuild - - var nearby = resolve(path$g.dirname(process.execPath)); - if (nearby) return nearby - - var target = [ - 'platform=' + platform, - 'arch=' + arch, - 'runtime=' + runtime, - 'abi=' + abi, - 'uv=' + uv, - armv ? 'armv=' + armv : '', - 'libc=' + libc, - 'node=' + process.versions.node, - process.versions.electron ? 'electron=' + process.versions.electron : '', - typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line - ].filter(Boolean).join(' '); - - throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n') - - function resolve (dir) { - // Find matching "prebuilds/-" directory - var tuples = readdirSync$1(path$g.join(dir, 'prebuilds')).map(parseTuple); - var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]; - if (!tuple) return - - // Find most specific flavor first - var prebuilds = path$g.join(dir, 'prebuilds', tuple.name); - var parsed = readdirSync$1(prebuilds).map(parseTags); - var candidates = parsed.filter(matchTags(runtime, abi)); - var winner = candidates.sort(compareTags(runtime))[0]; - if (winner) return path$g.join(prebuilds, winner.file) - } - }; - - function readdirSync$1 (dir) { - try { - return fs$l.readdirSync(dir) - } catch (err) { - return [] - } - } - - function getFirst (dir, filter) { - var files = readdirSync$1(dir).filter(filter); - return files[0] && path$g.join(dir, files[0]) - } - - function matchBuild (name) { - return /\.node$/.test(name) - } - - function parseTuple (name) { - // Example: darwin-x64+arm64 - var arr = name.split('-'); - if (arr.length !== 2) return - - var platform = arr[0]; - var architectures = arr[1].split('+'); - - if (!platform) return - if (!architectures.length) return - if (!architectures.every(Boolean)) return - - return { name, platform, architectures } - } - - function matchTuple (platform, arch) { - return function (tuple) { - if (tuple == null) return false - if (tuple.platform !== platform) return false - return tuple.architectures.includes(arch) - } - } - - function compareTuples (a, b) { - // Prefer single-arch prebuilds over multi-arch - return a.architectures.length - b.architectures.length - } - - function parseTags (file) { - var arr = file.split('.'); - var extension = arr.pop(); - var tags = { file: file, specificity: 0 }; - - if (extension !== 'node') return - - for (var i = 0; i < arr.length; i++) { - var tag = arr[i]; - - if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') { - tags.runtime = tag; - } else if (tag === 'napi') { - tags.napi = true; - } else if (tag.slice(0, 3) === 'abi') { - tags.abi = tag.slice(3); - } else if (tag.slice(0, 2) === 'uv') { - tags.uv = tag.slice(2); - } else if (tag.slice(0, 4) === 'armv') { - tags.armv = tag.slice(4); - } else if (tag === 'glibc' || tag === 'musl') { - tags.libc = tag; - } else { - continue - } - - tags.specificity++; - } - - return tags - } - - function matchTags (runtime, abi) { - return function (tags) { - if (tags == null) return false - if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false - if (tags.abi !== abi && !tags.napi) return false - if (tags.uv && tags.uv !== uv) return false - if (tags.armv && tags.armv !== armv) return false - if (tags.libc && tags.libc !== libc) return false - - return true - } - } - - function runtimeAgnostic (tags) { - return tags.runtime === 'node' && tags.napi - } - - function compareTags (runtime) { - // Precedence: non-agnostic runtime, abi over napi, then by specificity. - return function (a, b) { - if (a.runtime !== b.runtime) { - return a.runtime === runtime ? -1 : 1 - } else if (a.abi !== b.abi) { - return a.abi ? -1 : 1 - } else if (a.specificity !== b.specificity) { - return a.specificity > b.specificity ? -1 : 1 - } else { - return 0 - } - } - } - - function isNwjs () { - return !!(process.versions && process.versions.nw) - } - - function isElectron () { - if (process.versions && process.versions.electron) return true - if (process.env.ELECTRON_RUN_AS_NODE) return true - return typeof window !== 'undefined' && window.process && window.process.type === 'renderer' - } - - function isAlpine (platform) { - return platform === 'linux' && fs$l.existsSync('/etc/alpine-release') - } - - // Exposed for unit tests - // TODO: move to lib - load$2.parseTags = parseTags; - load$2.matchTags = matchTags; - load$2.compareTags = compareTags; - load$2.parseTuple = parseTuple; - load$2.matchTuple = matchTuple; - load$2.compareTuples = compareTuples; - - var binding$k = nodeGypBuild(__dirname); - - const util$B = require$$0__default$3["default"]; - const AbstractChainedBatch = abstractLeveldown$1.AbstractChainedBatch; - const binding$j = binding$k; - - function ChainedBatch$1 (db) { - AbstractChainedBatch.call(this, db); - this.context = binding$j.batch_init(db.context); - } - - ChainedBatch$1.prototype._put = function (key, value) { - binding$j.batch_put(this.context, key, value); - }; - - ChainedBatch$1.prototype._del = function (key) { - binding$j.batch_del(this.context, key); - }; - - ChainedBatch$1.prototype._clear = function () { - binding$j.batch_clear(this.context); - }; - - ChainedBatch$1.prototype._write = function (options, callback) { - binding$j.batch_write(this.context, options, callback); - }; - - util$B.inherits(ChainedBatch$1, AbstractChainedBatch); - - var chainedBatch = ChainedBatch$1; - - const util$A = require$$0__default$3["default"]; - const AbstractIterator = abstractLeveldown$1.AbstractIterator; - const binding$i = binding$k; - - function Iterator$4 (db, options) { - AbstractIterator.call(this, db); - - this.context = binding$i.iterator_init(db.context, options); - this.cache = null; - this.finished = false; - } - - util$A.inherits(Iterator$4, AbstractIterator); - - Iterator$4.prototype._seek = function (target) { - if (target.length === 0) { - throw new Error('cannot seek() to an empty target') - } - - this.cache = null; - binding$i.iterator_seek(this.context, target); - this.finished = false; - }; - - Iterator$4.prototype._next = function (callback) { - if (this.cache && this.cache.length) { - process.nextTick(callback, null, this.cache.pop(), this.cache.pop()); - } else if (this.finished) { - process.nextTick(callback); - } else { - binding$i.iterator_next(this.context, (err, array, finished) => { - if (err) return callback(err) - - this.cache = array; - this.finished = finished; - this._next(callback); - }); - } - - return this - }; - - Iterator$4.prototype._end = function (callback) { - delete this.cache; - binding$i.iterator_end(this.context, callback); - }; - - var iterator = Iterator$4; - - const util$z = require$$0__default$3["default"]; - const AbstractLevelDOWN = abstractLeveldown$1.AbstractLevelDOWN; - const binding$h = binding$k; - const ChainedBatch = chainedBatch; - const Iterator$3 = iterator; - - function LevelDOWN$1 (location) { - if (!(this instanceof LevelDOWN$1)) { - return new LevelDOWN$1(location) - } - - if (typeof location !== 'string') { - throw new Error('constructor requires a location string argument') - } - - AbstractLevelDOWN.call(this, { - bufferKeys: true, - snapshots: true, - permanence: true, - seek: true, - clear: true, - getMany: true, - createIfMissing: true, - errorIfExists: true, - additionalMethods: { - approximateSize: true, - compactRange: true - } - }); - - this.location = location; - this.context = binding$h.db_init(); - } - - util$z.inherits(LevelDOWN$1, AbstractLevelDOWN); - - LevelDOWN$1.prototype._open = function (options, callback) { - binding$h.db_open(this.context, this.location, options, callback); - }; - - LevelDOWN$1.prototype._close = function (callback) { - binding$h.db_close(this.context, callback); - }; - - LevelDOWN$1.prototype._serializeKey = function (key) { - return Buffer.isBuffer(key) ? key : String(key) - }; - - LevelDOWN$1.prototype._serializeValue = function (value) { - return Buffer.isBuffer(value) ? value : String(value) - }; - - LevelDOWN$1.prototype._put = function (key, value, options, callback) { - binding$h.db_put(this.context, key, value, options, callback); - }; - - LevelDOWN$1.prototype._get = function (key, options, callback) { - binding$h.db_get(this.context, key, options, callback); - }; - - LevelDOWN$1.prototype._getMany = function (keys, options, callback) { - binding$h.db_get_many(this.context, keys, options, callback); - }; - - LevelDOWN$1.prototype._del = function (key, options, callback) { - binding$h.db_del(this.context, key, options, callback); - }; - - LevelDOWN$1.prototype._clear = function (options, callback) { - binding$h.db_clear(this.context, options, callback); - }; - - LevelDOWN$1.prototype._chainedBatch = function () { - return new ChainedBatch(this) - }; - - LevelDOWN$1.prototype._batch = function (operations, options, callback) { - binding$h.batch_do(this.context, operations, options, callback); - }; - - LevelDOWN$1.prototype.approximateSize = function (start, end, callback) { - if (start == null || - end == null || - typeof start === 'function' || - typeof end === 'function') { - throw new Error('approximateSize() requires valid `start` and `end` arguments') - } - - if (typeof callback !== 'function') { - throw new Error('approximateSize() requires a callback argument') - } - - start = this._serializeKey(start); - end = this._serializeKey(end); - - binding$h.db_approximate_size(this.context, start, end, callback); - }; - - LevelDOWN$1.prototype.compactRange = function (start, end, callback) { - if (start == null || - end == null || - typeof start === 'function' || - typeof end === 'function') { - throw new Error('compactRange() requires valid `start` and `end` arguments') - } - - if (typeof callback !== 'function') { - throw new Error('compactRange() requires a callback argument') - } - - start = this._serializeKey(start); - end = this._serializeKey(end); - - binding$h.db_compact_range(this.context, start, end, callback); - }; - - LevelDOWN$1.prototype.getProperty = function (property) { - if (typeof property !== 'string') { - throw new Error('getProperty() requires a valid `property` argument') - } - - return binding$h.db_get_property(this.context, property) - }; - - LevelDOWN$1.prototype._iterator = function (options) { - if (this.status !== 'open') { - // Prevent segfault - throw new Error('cannot call iterator() before open()') - } - - return new Iterator$3(this, options) - }; - - LevelDOWN$1.destroy = function (location, callback) { - if (arguments.length < 2) { - throw new Error('destroy() requires `location` and `callback` arguments') - } - if (typeof location !== 'string') { - throw new Error('destroy() requires a location string argument') - } - if (typeof callback !== 'function') { - throw new Error('destroy() requires a callback function argument') - } - - binding$h.destroy_db(location, callback); - }; - - LevelDOWN$1.repair = function (location, callback) { - if (arguments.length < 2) { - throw new Error('repair() requires `location` and `callback` arguments') - } - if (typeof location !== 'string') { - throw new Error('repair() requires a location string argument') - } - if (typeof callback !== 'function') { - throw new Error('repair() requires a callback function argument') - } - - binding$h.repair_db(location, callback); - }; - - var leveldown = LevelDOWN$1; - - var level$4 = levelPackager(leveldown); - - // Dependencies - const level$3 = level$4; - const crypto$k = require$$0__default["default"]; - const pointer$3 = jsonPointer$1; - - // Fabric Types - const Actor$e = actor; - const Collection$5 = collection$1; - const Entity$6 = entity; - const Stack$8 = stack$2; - - /** - * Long-term storage. - * @property {Mixed} settings Current configuration. - */ - class Store$4 extends Actor$e { - /** - * Create an instance of a {@link Store} to manage long-term storage, which is - * particularly useful when building a user-facing {@link Product}. - * @param {Object} [settings={}] configuration object. - * @return {Store} Instance of the Store, ready to start. - */ - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - name: '@fabric/store', - path: './stores/store', - type: 'leveldb', - persistent: true, - verbosity: 2, // 0 none, 1 error, 2 warning, 3 notice, 4 debug - }, settings); - - this['@entity'] = { - '@type': 'Store', - '@data': {} - }; - - this.keys = {}; - this.commits = new Collection$5({ - type: 'State' - }); - - this._state = { - actors: {}, - collections: {}, - content: {}, - documents: {}, - metadata: {}, - indices: {}, - routes: {}, - status: 'PAUSED', - tips: {} - }; - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - _getPathForKey (key) { - const path = pointer$3.escape(key); - return this.sha256(path); - } - - async _errorHandler (err) { - console.error('[FABRIC:STORE]', 'Error condition:', err); - } - - async _setEncrypted (path, value, passphrase = '') { - const secret = value; // TODO: encrypt value - const name = crypto$k.createHash('sha256').createHash(path).digest('hex'); - return this.set(`/secrets/${name}`, secret); - } - - async _getEncrypted (path, passphrase = '') { - const name = crypto$k.createHash('sha256').createHash(path).digest('hex'); - const secret = this.get(`/secrets/${name}`); - const decrypted = secret; // TODO: decrypt value - return decrypted; - } - - /** - * Registers an {@link Actor}. Necessary to store in a collection. - * @param {Object} obj Instance of the object to store. - * @return {Vector} Returned from `storage.set` - */ - async _REGISTER (obj) { - const actor = new Actor$e(obj); - await this._GET(`/entities/${actor.id}`); - - store.log('[STORE]', '_REGISTER', vector.id, vector['@type']); - - try { - let item = await this._GET(`/entities/${vector.id}`); - } catch (E) { - this.warn('[STORE]', '_REGISTER', `Could not read from store:`, E); - } - - try { - await this._SET(`/types/${vector.id}`, vector['@type']); - } catch (E) { - this.error('Error creating object:', E, obj); - } - - try { - result = await this._SET(`/entities/${vector.id}`, vector['@data']); - } catch (E) { - this.error('Error creating object:', E, obj); - } - - return result; - } - - async _GET (key) { - let result = null; - - if (this.settings.verbosity >= 5) this.log('[STORE]', '_GET', key); - - try { - result = await this.get(key); - } catch (E) { - if (this.settings.verbosity >= 5) this.warn('[STORE]', '[_GET]', '[FAILURE]', E); - } - - return result; - } - - async _SET (key, value) { - return this.set(key, value); - } - - async _PUT (key, value) { - return this.set(key, value); - } - - async _DELETE (key) { - await this._PUT(key, null); - return null; - } - - async _PATCH (key, patch) { - this.log('[STORE]', '_PATCH', 'patch:', key, typeof patch, patch); - - const root = {}; - const current = await this._GET(key); - - if (this.settings.verbosity >= 3) console.warn('current value, no typecheck:', typeof current, current); - const result = Object.assign(root, current || {}, patch); - if (this.settings.verbosity >= 5) console.log('[STORE]', 'Patch result:', result); - - try { - let action = await this._PUT(key, result); - } catch (E) { - console.error('Could not modify:', E); - } - - return result; - } - - /** - * Insert something into a collection. - * @param {String} key Path to add data to. - * @param {Mixed} value Object to store. - * @return {Promise} Resolves on success with a String pointer. - */ - async _POST (key, value) { - if (this.settings.verbosity >= 5) console.log('[STORE]', '_POST', key, typeof value, value); - - this['@method'] = '_POST'; - - // preamble - let self = this; - let path = pointer$3.escape(key); - let router = this.sha256(path); - let address = `/collections/${router}`; - - if (!this.keys[address]) { - // TODO: store metadata - this.keys[address] = { - path: key, - address: address - }; - } - - // TODO: check for commit state - self['@entity']['@data'].addresses[router] = address; - - let state = new State(value); - let serial = state.serialize(); - this.sha256(serial); - - if (!self.db) { - await self.open().catch(self._errorHandler.bind(self)); - } - - let family = null; - let origin = null; - let entity = null; - - // TODO: use ._GET - try { - entity = await self.db.get(address); - // console.log('loading entity:', entity.toString('utf8')); - } catch (E) { - if (this.settings.verbosity >= 3) console.warn('Creating new collection:', E); - } - - if (entity) { - try { - entity = JSON.parse(entity); - } catch (E) { - console.warn(`Couldn't parse: ${entity}`, E); - } - } - - try { - if (entity) { - family = await self.populate(entity); - if (this.settings.verbosity >= 5) console.warn('WARNING:', 'family exists, expecting restoration:', family); - origin = new Collection$5(family); - } else { - origin = new Collection$5(); - } - - // Add Element to Collection - let height = origin.push(value); - - // Store the object at an entity locale - let object = await self._PUT(`/entities/${state.id}`, value); - let serialized = await origin.serialize(); - - // Write serialized Collection to disk - let answer = await self.db.put(address, serialized.toString()); - } catch (E) { - console.log('Could not POST:', key, value, E); - return false; - } - - return state.link; - } - - async _PUSH (key, data) { - let id = pointer$3.escape(key); - let path = `/stacks/${id}`; - let list = await this._GET(path); - if (!list) list = []; - let vector = new State(data); - let stack = new Stack$8(list); - stack.push(vector.id); - await this._REGISTER(data); - await this._PUT(`/blobs/${vector.id}`, vector['@data']); - await this._SET(path, stack['@data']); - await this.commit(); - let output = await this._GET(`/blobs/${vector.id}`); - return output; - } - - async encodeValue (value) { - if (!(value instanceof String)) { - switch (value.constructor.name) { - default: - value = JSON.stringify(value); - break; - } - } - - return Buffer.from(value, 'utf8').toString('hex'); - } - - async getDataInfo (value) { - let type = null; - let size = null; - let hash = null; - - switch (value.constructor.name) { - case 'String': - type = 'JSONString'; - size = value.length; - hash = this.sha256(value); - break; - default: - console.error('unhandled type:', value.constructor.name); - type = 'Unhandled'; - break; - } - - return { - hash, - size, - type - }; - } - - async getRouteInfo (path) { - if (path.substring(0, 1) !== '/') path = '/' + path; - - const id = pointer$3.escape(path); - const router = this.sha256(id); - - return { - path: path, - pointer: id, - index: router - }; - } - - async populate (element) { - let map = []; - - for (let i = 0; i < element.length; i++) { - map[i] = await this._GET(`/entities/${element[i]}`); - } - - return map; - } - - /** - * Barebones getter. - * @param {String} key Name of data to retrieve. - * @return {Promise} Resolves on complete. `null` if not found. - */ - async get (key) { - const route = await this.getRouteInfo(key); - const result = pointer$3.get(this._state.content, route.path); - const type = this._state.metadata[route.index].type; - - let output = null; - - switch (type) { - default: - output = result; - break; - } - - return output; - } - - /** - * Set a `key` to a specific `value`. - * @param {String} key Address of the information. - * @param {Mixed} value Content to store at `key`. - */ - async set (key, value) { - const route = await this.getRouteInfo(key); - const info = await this.getDataInfo(value); - const data = await this.encodeValue(value); - - // Let's use the document's key as the identifying value. - // This is what defines our key => value store. - // All functions can be run as a map of an original input vector, allowing - // binary scoping across trees of varying complexity. - const hash = this.sha256(value); - const actor = new Actor$e({ - type: 'FabricDocument', - content: data, - encoding: 'json', - original: value - }); - - this._state.actors[actor.id] = actor; - this._state.documents[hash] = value; - this._state.indices[route.index] = route.pointer; - this._state.metadata[route.index] = info; - - pointer$3.set(this._state.content, route.path, value); - - this.commit(); - - return this.get(key); - } - - async open () { - // await super.open(); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opening:', this.settings.path); - // if (this.db) return this; - - try { - this.db = level$3(this.settings.path); - this.trust(this.db); - this.status = 'opened'; - await this.commit(); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opened!'); - } catch (E) { - console.error('[FABRIC:STORE]', E); - this.status = 'error'; - } - - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opened!'); - - return this; - } - - async close () { - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Closing:', this.settings.path); - if (this.db) { - try { - await this.db.close(); - } catch (E) { - this.error('[STORE]', 'closing store:', this.settings.path, E); - } - } - - // await super.close(); - return this; - } - - /** - * Implicitly trust an {@link Event} source. - * @param {EventEmitter} source Event-emitting source. - * @return {Store} Resulting instance of {@link Store} with new trust. - */ - trust (source) { - let store = this; - let name = `/sources/${store.id}`; - - source.on('put', function (key, value) { - // store.log('[TRUST:SOURCE]', source.constructor.name, 'emitted a put event', name, key, value.constructor.name, value); - if (store.settings.verbosity >= 5) console.log('[TRUST:SOURCE]', source.constructor.name, 'emitted a put event', name, key, value.constructor.name, value); - - let id = pointer$3.escape(key); - let router = store.sha256(id); - let state = new State(value); - - pointer$3.set(store['@entity']['@data'], `${name}`, value); - pointer$3.set(store['@entity']['@data'], `/states/${state.id}`, value); - pointer$3.set(store['@entity']['@data'], `/blobs/${state.id}`, state.serialize()); - pointer$3.set(store['@entity']['@data'], `/types/${state.id}`, value.constructor.name); - pointer$3.set(store['@entity']['@data'], `/tips/${router}`, state.id); - pointer$3.set(store['@entity']['@data'], `/names/${router}`, id); - - store.emit('source/events', { - '@type': 'Request', - '@method': 'put', - '@actor': '~level', - '@object': state['@link'], - '@target': key, - '@data': value - }); - }); - - return this; - } - - /** - * Remove a {@link Value} by {@link Path}. - * @param {Path} key Key to remove. - */ - async del (key) { - if (!this.db) { - await this.open(); - } - - const deleted = await this.db.del(key); - return deleted; - } - - async batch (ops) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:STORE]', 'Batching:', ops); - let result = null; - - if (!this.db || this.db._status === 'closed') { - await this.open(); - } - - // Core function - try { - result = await this.db.batch(ops); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Batched:', result); - } catch (E) { - console.error('[FABRIC:STORE]', 'Could not batch updates:', E); - } - - return result; - } - - async commit () { - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:STORE]', 'Committing:', this.state); - const entity = new Entity$6(this.state.state); - this.emit('commit', entity.id, entity.data); - // TODO: document re-opening of store - return entity; - } - - createReadStream () { - return this.db.createReadStream(); - } - - /** - * Wipes the storage. - */ - async flush () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:STORE]', 'Flushing database...'); - - for (let name in this['@entity']['@data'].addresses) { - let address = this['@entity']['@data'].addresses[name]; - if (this.settings.verbosity >= 3) console.log('found address:', address); - if (address) await this.del(address); - } - - try { - await this.del(`/collections`); - await this.commit(); - } catch (E) { - console.error('Could not wipe database:', E); - } - - return this; - } - - noop () { - this.emit('noop'); - return this; - } - - rotate () { - return this; - } - - /** - * Start running the process. - * @return {Promise} Resolves on complete. - */ - async start () { - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Starting:', this.settings.path); - this.status = 'starting'; - - try { - await this.open(); - this.status = 'started'; - // await this.commit(); - } catch (E) { - console.error('[FABRIC:STORE]', 'Could not open db:', E); - } - - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Started on path:', this.settings.path); - return this; - } - - async stop () { - this.status = 'stopping'; - - if (this.settings.persistent !== true) { - await this.flush(); - } - - try { - await this.close(); - } catch (E) { - console.error('Could not stop store:', E); - } - - this.status = 'stopped'; - - return this; - } - } - - var store_1 = Store$4; - - const crypto$j = require$$0__default["default"]; - const pluralize$3 = pluralize$5.exports; - - const State$6 = state$2; - const Store$3 = store_1; - - /** - * Generic interface for collections of digital objects. - * @param {Object} definition Initial parameters - * @constructor - */ - class Resource$6 extends Store$3 { - constructor (definition = {}) { - super(definition); - - if (!(this instanceof Resource$6)) { - return new Resource$6(definition); - } - - this['@data'] = definition; - this.name = definition.name || 'Radical'; - this.names = [ this.name, pluralize$3(this.name) ]; - this.definition = definition; - - this.routes = Object.assign({ - list: `/${this.names[1].toLowerCase()}`, // TODO: unpin, offer larger name list - view: `/${this.names[1].toLowerCase()}/:id` - }, definition.routes); - - this.components = Object.assign({ - list: [this.name.toLowerCase(), 'list'].join('-'), - view: [this.name.toLowerCase(), 'view'].join('-') - }, definition.components); - - return this; - } - - static asStruct () { - var obj = this.prototype; - obj.name = this.name; - return obj; - } - - get hash () { - return crypto$j.createHash('sha256').update(this.render()).digest('hex'); - } - - attach (app) { - this.store = app.stash; - } - - async list () { - return this.store.get(this.routes.list); - } - - async describe () { - this.http.put(this.routes.set, this.router); - this.http.get(this.routes.get, this.router); - this.http.post(this.routes.insert, this.router); - this.http.patch(this.routes.update, this.router); - this.http.delete(this.routes.delete, this.router); - this.http.options(this.routes.options, this.router); - } - - /** - * Create an instance of the Resource's type. - * @param {Object} obj Map of the instance's properties and values. - * @return {Vector} Resulting Vector with deterministic identifier. - */ - async create (obj) { - let self = this; - let vector = new State$6(obj); - await self.store._POST(self.routes.list, vector['@data']); - return vector; - } - - /** - * Modify an existing instance of a Resource by its unique identifier. Produces a new instance. - * @param {String} id Unique ID to update. - * @param {Object} update Map of change to make (keys -> values). - * @return {Vector} Resulting Vector instance with updated identifier. - */ - async update (id, update) { - let self = this; - let path = `${self.routes.list}/${id}`; - new State$6(update); - self.store._PATCH(path, update); - let result = self.store._GET(path); - return result; - } - - async query (inquiry) { - let self = this; - let collection = await self.store._GET(self.routes.list); - return collection; - } - - render () { - return `${JSON.stringify(this.definition)}`; - } - } - - var resource$1 = Resource$6; - - var dist = {exports: {}}; - - (function (module, exports) { - (function(f){{module.exports=f();}})(function(){return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof commonjsRequire=="function"&&commonjsRequire;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r);}return n[o].exports}var i=typeof commonjsRequire=="function"&&commonjsRequire;for(var o=0;o 32) { - throw new Error('Generator.bits()\'s bitCount parameter must be in the range [1 - 32]. Provided bitCount=' + bitCount); - } - // Use the higher bits as the lower bits have a low period. I haven't looked into the exact - // math of why, but in my tests in masking off the lower bits and graphing them it tended - // to loop very quickly. - // TODO: Test the above concern and in general do some analysis of the quality of generated - // numbers using different places of the number. - return this._state >>> 32 - bitCount; - } - - // Move the generators internal state - // forward one step - - }, { - key: 'next', - get: function get() { - this._state = lcg(this._state); - return this; - } - - // Move the generators internal state - // forward one step - - }, { - key: 'prev', - get: function get() { - this._state = rlcg(this._state); - return this; - } - - // Set the state of the generator. Must be a valid u32 integer - - }, { - key: 'state', - set: function set(state) { - if (state < 0 || state >= _MaxU2.default) { - throw new Error('Generator.state must be a number between 0 and (2^32 - 1). Provided state was ' + state + '.'); - } - this._state = state; - } - - // Get the current internal state - , - get: function get() { - return this._state; - } - }]); - - return Generator; - }(); - - exports.default = Generator; - - - function lcg(state) { - state = (a * state + c) % m; - return state; - } - - function rlcg(state) { - var result = _Long2.default.fromInt(aInverse).multiply(_Long2.default.fromNumber(state - 1013904223)); // - var pow2to32 = new _Long2.default(0, 1); - - // Modulo doesn't work as we want (negatives stay negatives, we want wrapping around ) - if (result.isNegative()) { - result = pow2to32.add(result.modulo(pow2to32)); - } else { - result = result.modulo(pow2to32); - } - - result = result.toNumber(); - state = result; - return state; - } - - },{"./Long":2,"./MaxU32":3}],2:[function(require,module,exports){ - - Object.defineProperty(exports, "__esModule", { - value: true - }); - // Copyright 2009 The Closure Library Authors. All Rights Reserved. - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS-IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - - /** - * @fileoverview Defines a Long class for representing a 64-bit two's-complement - * integer value, which faithfully simulates the behavior of a Java "long". This - * implementation is derived from LongLib in GWT. - * - */ - - /** - * Constructs a 64-bit two's-complement integer, given its low and high 32-bit - * values as *signed* integers. See the from* functions below for more - * convenient ways of constructing Longs. - * - * The internal representation of a long is the two given signed, 32-bit values. - * We use 32-bit pieces because these are the size of integers on which - * Javascript performs bit-operations. For operations like addition and - * multiplication, we split each number into 16-bit pieces, which can easily be - * multiplied within Javascript's floating-point representation without overflow - * or change in sign. - * - * In the algorithms below, we frequently reduce the negative case to the - * positive case by negating the input(s) and then post-processing the result. - * Note that we must ALWAYS check specially whether those values are MIN_VALUE - * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as - * a positive number, it overflows back into a negative). Not handling this - * case would often result in infinite recursion. - * - * @param {number} low The low (signed) 32 bits of the long. - * @param {number} high The high (signed) 32 bits of the long. - * @struct - * @constructor - * @final - */ - var Long = function Long(low, high) { - /** - * @type {number} - * @private - */ - this.low_ = low | 0; // force into 32 signed bits. - - /** - * @type {number} - * @private - */ - this.high_ = high | 0; // force into 32 signed bits. - }; - - /** - * Returns a Long representing the given (32-bit) integer value. - * @param {number} value The 32-bit integer in question. - * @return {!Long} The corresponding Long value. - */ - Long.fromInt = function (value) { - return new Long(value | 0, value < 0 ? -1 : 0); - }; - - /** - * Returns a Long representing the given value. - * NaN will be returned as zero. Infinity is converted to max value and - * -Infinity to min value. - * @param {number} value The number in question. - * @return {!Long} The corresponding Long value. - */ - Long.fromNumber = function (value) { - if (isNaN(value)) { - return Long.getZero(); - } else if (value <= -Long.TWO_PWR_63_DBL_) { - return Long.getMinValue(); - } else if (value + 1 >= Long.TWO_PWR_63_DBL_) { - return Long.getMaxValue(); - } else if (value < 0) { - return Long.fromNumber(-value).negate(); - } else { - return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0); - } - }; - - /** - * Returns a Long representing the 64-bit integer that comes by concatenating - * the given high and low bits. Each is assumed to use 32 bits. - * @param {number} lowBits The low 32-bits. - * @param {number} highBits The high 32-bits. - * @return {!Long} The corresponding Long value. - */ - Long.fromBits = function (lowBits, highBits) { - return new Long(lowBits, highBits); - }; - - /** - * Returns a Long representation of the given string, written using the given - * radix. - * @param {string} str The textual representation of the Long. - * @param {number=} opt_radix The radix in which the text is written. - * @return {!Long} The corresponding Long value. - */ - Long.fromString = function (str, opt_radix) { - if (str.length == 0) { - throw Error('number format error: empty string'); - } - - var radix = opt_radix || 10; - if (radix < 2 || 36 < radix) { - throw Error('radix out of range: ' + radix); - } - - if (str.charAt(0) == '-') { - return Long.fromString(str.substring(1), radix).negate(); - } else if (str.indexOf('-') >= 0) { - throw Error('number format error: interior "-" character: ' + str); - } - - // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = Long.fromNumber(Math.pow(radix, 8)); - - var result = Long.getZero(); - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i); - var value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = Long.fromNumber(Math.pow(radix, size)); - result = result.multiply(power).add(Long.fromNumber(value)); - } else { - result = result.multiply(radixToPower); - result = result.add(Long.fromNumber(value)); - } - } - return result; - }; - - // NOTE: the compiler should inline these constant values below and then remove - // these variables, so there should be no runtime penalty for these. - - - /** - * Number used repeated below in calculations. This must appear before the - * first call to any from* function below. - * @type {number} - * @private - */ - Long.TWO_PWR_16_DBL_ = 1 << 16; - - /** - * @type {number} - * @private - */ - Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_; - - /** - * @type {number} - * @private - */ - Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_; - - /** - * @type {number} - * @private - */ - Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2; - - /** - * @return {!Long} - * @public - */ - Long.getZero = function () { - return Long.fromInt(0); - }; - - /** - * @return {!Long} - * @public - */ - Long.getOne = function () { - return Long.fromInt(1); - }; - - /** - * @return {!Long} - * @public - */ - Long.getNegOne = function () { - return Long.fromInt(-1); - }; - - /** - * @return {!Long} - * @public - */ - Long.getMaxValue = function () { - return Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0); - }; - - /** - * @return {!Long} - * @public - */ - Long.getMinValue = function () { - return Long.fromBits(0, 0x80000000 | 0); - }; - - /** - * @return {!Long} - * @public - */ - Long.getTwoPwr24 = function () { - return Long.fromInt(1 << 24); - }; - - /** @return {number} The value, assuming it is a 32-bit integer. */ - Long.prototype.toInt = function () { - return this.low_; - }; - - /** @return {number} The closest floating-point representation to this value. */ - Long.prototype.toNumber = function () { - return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned(); - }; - - /** - * @param {number=} opt_radix The radix in which the text should be written. - * @return {string} The textual representation of this value. - * @override - */ - Long.prototype.toString = function (opt_radix) { - var radix = opt_radix || 10; - if (radix < 2 || 36 < radix) { - throw Error('radix out of range: ' + radix); - } - - if (this.isZero()) { - return '0'; - } - - if (this.isNegative()) { - if (this.equals(Long.getMinValue())) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = Long.fromNumber(radix); - var div = this.div(radixLong); - var rem = div.multiply(radixLong).subtract(this); - return div.toString(radix) + rem.toInt().toString(radix); - } else { - return '-' + this.negate().toString(radix); - } - } - - // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = Long.fromNumber(Math.pow(radix, 6)); - - var rem = this; - var result = ''; - while (true) { - var remDiv = rem.div(radixToPower); - // The right shifting fixes negative values in the case when - // intval >= 2^31; for more details see - // https://github.com/google/closure-library/pull/498 - var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0; - var digits = intval.toString(radix); - - rem = remDiv; - if (rem.isZero()) { - return digits + result; - } else { - while (digits.length < 6) { - digits = '0' + digits; - } - result = '' + digits + result; - } - } - }; - - /** @return {number} The high 32-bits as a signed value. */ - Long.prototype.getHighBits = function () { - return this.high_; - }; - - /** @return {number} The low 32-bits as a signed value. */ - Long.prototype.getLowBits = function () { - return this.low_; - }; - - /** @return {number} The low 32-bits as an unsigned value. */ - Long.prototype.getLowBitsUnsigned = function () { - return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_; - }; - - /** - * @return {number} Returns the number of bits needed to represent the absolute - * value of this Long. - */ - Long.prototype.getNumBitsAbs = function () { - if (this.isNegative()) { - if (this.equals(Long.getMinValue())) { - return 64; - } else { - return this.negate().getNumBitsAbs(); - } - } else { - var val = this.high_ != 0 ? this.high_ : this.low_; - for (var bit = 31; bit > 0; bit--) { - if ((val & 1 << bit) != 0) { - break; - } - } - return this.high_ != 0 ? bit + 33 : bit + 1; - } - }; - - /** @return {boolean} Whether this value is zero. */ - Long.prototype.isZero = function () { - return this.high_ == 0 && this.low_ == 0; - }; - - /** @return {boolean} Whether this value is negative. */ - Long.prototype.isNegative = function () { - return this.high_ < 0; - }; - - /** @return {boolean} Whether this value is odd. */ - Long.prototype.isOdd = function () { - return (this.low_ & 1) == 1; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long equals the other. - */ - Long.prototype.equals = function (other) { - return this.high_ == other.high_ && this.low_ == other.low_; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long does not equal the other. - */ - Long.prototype.notEquals = function (other) { - return this.high_ != other.high_ || this.low_ != other.low_; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is less than the other. - */ - Long.prototype.lessThan = function (other) { - return this.compare(other) < 0; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is less than or equal to the other. - */ - Long.prototype.lessThanOrEqual = function (other) { - return this.compare(other) <= 0; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is greater than the other. - */ - Long.prototype.greaterThan = function (other) { - return this.compare(other) > 0; - }; - - /** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is greater than or equal to the other. - */ - Long.prototype.greaterThanOrEqual = function (other) { - return this.compare(other) >= 0; - }; - - /** - * Compares this Long with the given one. - * @param {Long} other Long to compare against. - * @return {number} 0 if they are the same, 1 if the this is greater, and -1 - * if the given one is greater. - */ - Long.prototype.compare = function (other) { - if (this.equals(other)) { - return 0; - } - - var thisNeg = this.isNegative(); - var otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) { - return -1; - } - if (!thisNeg && otherNeg) { - return 1; - } - - // at this point, the signs are the same, so subtraction will not overflow - if (this.subtract(other).isNegative()) { - return -1; - } else { - return 1; - } - }; - - /** @return {!Long} The negation of this value. */ - Long.prototype.negate = function () { - if (this.equals(Long.getMinValue())) { - return Long.getMinValue(); - } else { - return this.not().add(Long.getOne()); - } - }; - - /** - * Returns the sum of this and the given Long. - * @param {Long} other Long to add to this one. - * @return {!Long} The sum of this and the given Long. - */ - Long.prototype.add = function (other) { - // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high_ >>> 16; - var a32 = this.high_ & 0xFFFF; - var a16 = this.low_ >>> 16; - var a00 = this.low_ & 0xFFFF; - - var b48 = other.high_ >>> 16; - var b32 = other.high_ & 0xFFFF; - var b16 = other.low_ >>> 16; - var b00 = other.low_ & 0xFFFF; - - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32); - }; - - /** - * Returns the difference of this and the given Long. - * @param {Long} other Long to subtract from this. - * @return {!Long} The difference of this and the given Long. - */ - Long.prototype.subtract = function (other) { - return this.add(other.negate()); - }; - - /** - * Returns the product of this and the given long. - * @param {Long} other Long to multiply with this. - * @return {!Long} The product of this and the other. - */ - Long.prototype.multiply = function (other) { - if (this.isZero()) { - return Long.getZero(); - } else if (other.isZero()) { - return Long.getZero(); - } - - if (this.equals(Long.getMinValue())) { - return other.isOdd() ? Long.getMinValue() : Long.getZero(); - } else if (other.equals(Long.getMinValue())) { - return this.isOdd() ? Long.getMinValue() : Long.getZero(); - } - - if (this.isNegative()) { - if (other.isNegative()) { - return this.negate().multiply(other.negate()); - } else { - return this.negate().multiply(other).negate(); - } - } else if (other.isNegative()) { - return this.multiply(other.negate()).negate(); - } - - // If both longs are small, use float multiplication - if (this.lessThan(Long.getTwoPwr24()) && other.lessThan(Long.getTwoPwr24())) { - return Long.fromNumber(this.toNumber() * other.toNumber()); - } - - // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high_ >>> 16; - var a32 = this.high_ & 0xFFFF; - var a16 = this.low_ >>> 16; - var a00 = this.low_ & 0xFFFF; - - var b48 = other.high_ >>> 16; - var b32 = other.high_ & 0xFFFF; - var b16 = other.low_ >>> 16; - var b00 = other.low_ & 0xFFFF; - - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32); - }; - - /** - * Returns this Long divided by the given one. - * @param {Long} other Long by which to divide. - * @return {!Long} This Long divided by the given one. - */ - Long.prototype.div = function (other) { - if (other.isZero()) { - throw Error('division by zero'); - } else if (this.isZero()) { - return Long.getZero(); - } - - if (this.equals(Long.getMinValue())) { - if (other.equals(Long.getOne()) || other.equals(Long.getNegOne())) { - return Long.getMinValue(); // recall -MIN_VALUE == MIN_VALUE - } else if (other.equals(Long.getMinValue())) { - return Long.getOne(); - } else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shiftRight(1); - var approx = halfThis.div(other).shiftLeft(1); - if (approx.equals(Long.getZero())) { - return other.isNegative() ? Long.getOne() : Long.getNegOne(); - } else { - var rem = this.subtract(other.multiply(approx)); - var result = approx.add(rem.div(other)); - return result; - } - } - } else if (other.equals(Long.getMinValue())) { - return Long.getZero(); - } - - if (this.isNegative()) { - if (other.isNegative()) { - return this.negate().div(other.negate()); - } else { - return this.negate().div(other).negate(); - } - } else if (other.isNegative()) { - return this.div(other.negate()).negate(); - } - - // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - var res = Long.getZero(); - var rem = this; - while (rem.greaterThanOrEqual(other)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber())); - - // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - var log2 = Math.ceil(Math.log(approx) / Math.LN2); - var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); - - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - var approxRes = Long.fromNumber(approx); - var approxRem = approxRes.multiply(other); - while (approxRem.isNegative() || approxRem.greaterThan(rem)) { - approx -= delta; - approxRes = Long.fromNumber(approx); - approxRem = approxRes.multiply(other); - } - - // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - if (approxRes.isZero()) { - approxRes = Long.getOne(); - } - - res = res.add(approxRes); - rem = rem.subtract(approxRem); - } - return res; - }; - - /** - * Returns this Long modulo the given one. - * @param {Long} other Long by which to mod. - * @return {!Long} This Long modulo the given one. - */ - Long.prototype.modulo = function (other) { - return this.subtract(this.div(other).multiply(other)); - }; - - /** @return {!Long} The bitwise-NOT of this value. */ - Long.prototype.not = function () { - return Long.fromBits(~this.low_, ~this.high_); - }; - - /** - * Returns the bitwise-AND of this Long and the given one. - * @param {Long} other The Long with which to AND. - * @return {!Long} The bitwise-AND of this and the other. - */ - Long.prototype.and = function (other) { - return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_); - }; - - /** - * Returns the bitwise-OR of this Long and the given one. - * @param {Long} other The Long with which to OR. - * @return {!Long} The bitwise-OR of this and the other. - */ - Long.prototype.or = function (other) { - return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_); - }; - - /** - * Returns the bitwise-XOR of this Long and the given one. - * @param {Long} other The Long with which to XOR. - * @return {!Long} The bitwise-XOR of this and the other. - */ - Long.prototype.xor = function (other) { - return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_); - }; - - /** - * Returns this Long with bits shifted to the left by the given amount. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the left by the given amount. - */ - Long.prototype.shiftLeft = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var low = this.low_; - if (numBits < 32) { - var high = this.high_; - return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits); - } else { - return Long.fromBits(0, low << numBits - 32); - } - } - }; - - /** - * Returns this Long with bits shifted to the right by the given amount. - * The new leading bits match the current sign bit. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the right by the given amount. - */ - Long.prototype.shiftRight = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var high = this.high_; - if (numBits < 32) { - var low = this.low_; - return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits); - } else { - return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1); - } - } - }; - - /** - * Returns this Long with bits shifted to the right by the given amount, with - * zeros placed into the new leading bits. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the right by the given amount, with - * zeros placed into the new leading bits. - */ - Long.prototype.shiftRightUnsigned = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var high = this.high_; - if (numBits < 32) { - var low = this.low_; - return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits); - } else if (numBits == 32) { - return Long.fromBits(high, 0); - } else { - return Long.fromBits(high >>> numBits - 32, 0); - } - } - }; - - /** - * @enum {number} Ids of commonly requested Long instances. - * @private - */ - Long.ValueCacheId_ = { - MAX_VALUE: 1, - MIN_VALUE: 2, - ZERO: 3, - ONE: 4, - NEG_ONE: 5, - TWO_PWR_24: 6 - }; - - exports.default = Long; - - },{}],3:[function(require,module,exports){ - - Object.defineProperty(exports, "__esModule", { - value: true - }); - var MAX_U32 = Math.pow(2, 32); - - exports.default = MAX_U32; - - },{}],4:[function(require,module,exports){ - - /* - **Francois**: - Based on an implementation that's based on further implementations, most significant - change is removing the use of Buffers and ArrayBuffers. Original implementation was forked - here (hopefully the original repo still exists, to play it safe I've forked it) - https://github.com/francoislaberge/node-skip32 - - ** Original Comments in skip32.js's implementation ** - Skip32PureJS.js - public domain javascript implementation of: - - SKIP32 -- 32 bit block cipher based on SKIPJACK. - Written by Greg Rose, QUALCOMM Australia, 1999/04/27. - - In common: F-table, G-permutation, key schedule. - Different: 24 round feistel structure. - Based on: Unoptimized test implementation of SKIPJACK algorithm - Panu Rissanen - - SKIPJACK and KEA Algorithm Specifications - Version 2.0 - 29 May 1998 - - Not copyright, no rights reserved. - */ - function Skip32() { - // Francois: I have modified the code to have a hardcoded key. values - // were taken from the example code in the node-skip32 project: - // https://github.com/0x4139/node-skip32#example - this.key = [0x9b, 0x21, 0x96, 0xe, 0x1a, 0xcf, 0x24, 0x5f, 0x14, 0x93]; - } - Skip32.prototype.init = function () {}; - - // Francois: I have modified the code to remove the use of Buffers and ArrayBuffers - // so that the code is more portable to other browsers and environments - var ftable = [0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, 0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e, 0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28, 0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68, 0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53, 0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19, 0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2, 0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b, 0xee, 0xb4, 0x1a, 0xea, 0xd0, 0x91, 0x2f, 0xb8, 0x55, 0xb9, 0xda, 0x85, 0x3f, 0x41, 0xbf, 0xe0, 0x5a, 0x58, 0x80, 0x5f, 0x66, 0x0b, 0xd8, 0x90, 0x35, 0xd5, 0xc0, 0xa7, 0x33, 0x06, 0x65, 0x69, 0x45, 0x00, 0x94, 0x56, 0x6d, 0x98, 0x9b, 0x76, 0x97, 0xfc, 0xb2, 0xc2, 0xb0, 0xfe, 0xdb, 0x20, 0xe1, 0xeb, 0xd6, 0xe4, 0xdd, 0x47, 0x4a, 0x1d, 0x42, 0xed, 0x9e, 0x6e, 0x49, 0x3c, 0xcd, 0x43, 0x27, 0xd2, 0x07, 0xd4, 0xde, 0xc7, 0x67, 0x18, 0x89, 0xcb, 0x30, 0x1f, 0x8d, 0xc6, 0x8f, 0xaa, 0xc8, 0x74, 0xdc, 0xc9, 0x5d, 0x5c, 0x31, 0xa4, 0x70, 0x88, 0x61, 0x2c, 0x9f, 0x0d, 0x2b, 0x87, 0x50, 0x82, 0x54, 0x64, 0x26, 0x7d, 0x03, 0x40, 0x34, 0x4b, 0x1c, 0x73, 0xd1, 0xc4, 0xfd, 0x3b, 0xcc, 0xfb, 0x7f, 0xab, 0xe6, 0x3e, 0x5b, 0xa5, 0xad, 0x04, 0x23, 0x9c, 0x14, 0x51, 0x22, 0xf0, 0x29, 0x79, 0x71, 0x7e, 0xff, 0x8c, 0x0e, 0xe2, 0x0c, 0xef, 0xbc, 0x72, 0x75, 0x6f, 0x37, 0xa1, 0xec, 0xd3, 0x8e, 0x62, 0x8b, 0x86, 0x10, 0xe8, 0x08, 0x77, 0x11, 0xbe, 0x92, 0x4f, 0x24, 0xc5, 0x32, 0x36, 0x9d, 0xcf, 0xf3, 0xa6, 0xbb, 0xac, 0x5e, 0x6c, 0xa9, 0x13, 0x57, 0x25, 0xb5, 0xe3, 0xbd, 0xa8, 0x3a, 0x01, 0x05, 0x59, 0x2a, 0x46]; - - Skip32.prototype.round16 = function (k, n) { - var g1, g2, g3, g4, g5, g6; - g1 = n >> 8 & 0xff; - g2 = n >> 0 & 0xff; - g3 = ftable[g2 ^ this.key[(4 * k + 0) % 10]] ^ g1; - g4 = ftable[g3 ^ this.key[(4 * k + 1) % 10]] ^ g2; - g5 = ftable[g4 ^ this.key[(4 * k + 2) % 10]] ^ g3; - g6 = ftable[g5 ^ this.key[(4 * k + 3) % 10]] ^ g4; - return (g5 << 8) + g6; - }; - - Skip32.prototype.core = function (n, k, d) { - var i, k, wl, wr; - wl = ((n >> 24 & 0xff) << 8) + ((n >> 16 & 0xff) << 0); - wr = ((n >> 8 & 0xff) << 8) + ((n >> 0 & 0xff) << 0); - for (i = 0; i < 24 / 2; i++) { - wr ^= this.round16(k, wl) ^ k; - k += d; - wl ^= this.round16(k, wr) ^ k; - k += d; - } - return (wr << 16 | wl) >>> 0; - }; - - Skip32.prototype.encrypt = function (n) { - return this.core(n, 0, 1); - }; - - Skip32.prototype.decrypt = function (n) { - return this.core(n, 23, -1); - }; - - module.exports.Skip32 = Skip32; - - },{}],5:[function(require,module,exports){ - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _Generator = require('./Generator'); - - var _Generator2 = _interopRequireDefault(_Generator); - - var _scrambler = require('./scrambler'); - - var _MaxU = require('./MaxU32'); - - var _MaxU2 = _interopRequireDefault(_MaxU); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var arbitrary = { - MAX_U32: _MaxU2.default, - Generator: _Generator2.default, - scramble: _scrambler.scramble, - descramble: _scrambler.descramble - }; - - exports.default = arbitrary; - - },{"./Generator":1,"./MaxU32":3,"./scrambler":6}],6:[function(require,module,exports){ - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.scramble = scramble; - exports.descramble = descramble; - var Skip32 = require('./Skip32PureJS').Skip32; - var cypher = new Skip32(); - - /* - * Takes a unsigned 32 bit integer and returns an unsigned 32 bit integer - * with it's bits scrambled. - * - * Ideal for taking a series of incrementing numbers and creating a pseudo random version. - * Is reversible via calling descramble() on a scrambled number. - */ - function scramble(number) { - return cypher.encrypt(number); - } - - /* - * Takes a scrambled unsigned 32 bit integer and returns the unscrambled unsigned 32 bit - * integer version. - * - * Ideal for taking a series of incrementing numbers and creating a pseudo random version. - * Use this to figure out the original number crated from calls to scramble() - */ - function descramble(scrambledNumber) { - return cypher.decrypt(scrambledNumber); - } - - },{"./Skip32PureJS":4}]},{},[5])(5) - }); - - - }(dist)); - - var bn$2 = {exports: {}}; - - (function (module) { - (function (module, exports) { - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { - Buffer = window.Buffer; - } else { - Buffer = require('buffer').Buffer; - } - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - this.negative = 1; - } - - if (start < number.length) { - if (base === 16) { - this._parseHex(number, start, endian); - } else { - this._parseBase(number, base, start); - if (endian === 'le') { - this._initArray(this.toArray(), base, endian); - } - } - } - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex4Bits (string, index) { - var c = string.charCodeAt(index); - // 'A' - 'F' - if (c >= 65 && c <= 70) { - return c - 55; - // 'a' - 'f' - } else if (c >= 97 && c <= 102) { - return c - 87; - // '0' - '9' - } else { - return (c - 48) & 0xf; - } - } - - function parseHexByte (string, lowerBound, index) { - var r = parseHex4Bits(string, index); - if (index - 1 >= lowerBound) { - r |= parseHex4Bits(string, index - 1) << 4; - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start, endian) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - // 24-bits chunks - var off = 0; - var j = 0; - - var w; - if (endian === 'be') { - for (i = number.length - 1; i >= start; i -= 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number.length - start; - for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } - - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - this.strip(); - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - var groupSizes = [ - 0, 0, - 25, 16, 12, 11, 10, 9, 8, - 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - if (r.strip !== undefined) { - // r is BN v4 instance - r.strip(); - } else { - // r is BN v5 instance - r._strip(); - } - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1).toRed(this); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; - })(module, commonjsGlobal); - }(bn$2)); - - var elliptic$2 = {}; - - var _args$1 = [ - [ - "elliptic@6.5.4", - "/Users/eric/fabric" - ] - ]; - var _from$1 = "elliptic@6.5.4"; - var _id$1 = "elliptic@6.5.4"; - var _inBundle$1 = false; - var _integrity$1 = "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ=="; - var _location$1 = "/elliptic"; - var _phantomChildren$1 = { - }; - var _requested$1 = { - type: "version", - registry: true, - raw: "elliptic@6.5.4", - name: "elliptic", - escapedName: "elliptic", - rawSpec: "6.5.4", - saveSpec: null, - fetchSpec: "6.5.4" - }; - var _requiredBy$1 = [ - "/", - "/@fabric/core", - "/browserify-sign", - "/create-ecdh", - "/eccrypto", - "/secp256k1" - ]; - var _resolved$1 = "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz"; - var _spec$1 = "6.5.4"; - var _where$1 = "/Users/eric/fabric"; - var author$1 = { - name: "Fedor Indutny", - email: "fedor@indutny.com" - }; - var bugs$1 = { - url: "https://github.com/indutny/elliptic/issues" - }; - var dependencies$1 = { - "bn.js": "^4.11.9", - brorand: "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - inherits: "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }; - var description$2 = "EC cryptography"; - var devDependencies$1 = { - brfs: "^2.0.2", - coveralls: "^3.1.0", - eslint: "^7.6.0", - grunt: "^1.2.1", - "grunt-browserify": "^5.3.0", - "grunt-cli": "^1.3.2", - "grunt-contrib-connect": "^3.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "^5.0.0", - "grunt-mocha-istanbul": "^5.0.2", - "grunt-saucelabs": "^9.0.1", - istanbul: "^0.4.5", - mocha: "^8.0.1" - }; - var files = [ - "lib" - ]; - var homepage$1 = "https://github.com/indutny/elliptic"; - var keywords$1 = [ - "EC", - "Elliptic", - "curve", - "Cryptography" - ]; - var license$1 = "MIT"; - var main$4 = "lib/elliptic.js"; - var name$2 = "elliptic"; - var repository$1 = { - type: "git", - url: "git+ssh://git@github.com/indutny/elliptic.git" - }; - var scripts$1 = { - lint: "eslint lib test", - "lint:fix": "npm run lint -- --fix", - test: "npm run lint && npm run unit", - unit: "istanbul test _mocha --reporter=spec test/index.js", - version: "grunt dist && git add dist/" - }; - var version$2 = "6.5.4"; - var require$$0$2 = { - _args: _args$1, - _from: _from$1, - _id: _id$1, - _inBundle: _inBundle$1, - _integrity: _integrity$1, - _location: _location$1, - _phantomChildren: _phantomChildren$1, - _requested: _requested$1, - _requiredBy: _requiredBy$1, - _resolved: _resolved$1, - _spec: _spec$1, - _where: _where$1, - author: author$1, - bugs: bugs$1, - dependencies: dependencies$1, - description: description$2, - devDependencies: devDependencies$1, - files: files, - homepage: homepage$1, - keywords: keywords$1, - license: license$1, - main: main$4, - name: name$2, - repository: repository$1, - scripts: scripts$1, - version: version$2 - }; - - var utils$n = {}; - - var minimalisticAssert = assert$3d; - - function assert$3d(val, msg) { - if (!val) - throw new Error(msg || 'Assertion failed'); - } - - assert$3d.equal = function assertEqual(l, r, msg) { - if (l != r) - throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); - }; - - var utils$m = {}; - - (function (exports) { - - var utils = exports; - - function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg !== 'string') { - for (var i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - return res; - } - if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (var i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } else { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } - return res; - } - utils.toArray = toArray; - - function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; - } - utils.zero2 = zero2; - - function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; - } - utils.toHex = toHex; - - utils.encode = function encode(arr, enc) { - if (enc === 'hex') - return toHex(arr); - else - return arr; - }; - }(utils$m)); - - (function (exports) { - - var utils = exports; - var BN = bn$2.exports; - var minAssert = minimalisticAssert; - var minUtils = utils$m; - - utils.assert = minAssert; - utils.toArray = minUtils.toArray; - utils.zero2 = minUtils.zero2; - utils.toHex = minUtils.toHex; - utils.encode = minUtils.encode; - - // Represent num in a w-NAF form - function getNAF(num, w, bits) { - var naf = new Array(Math.max(num.bitLength(), bits) + 1); - naf.fill(0); - - var ws = 1 << (w + 1); - var k = num.clone(); - - for (var i = 0; i < naf.length; i++) { - var z; - var mod = k.andln(ws - 1); - if (k.isOdd()) { - if (mod > (ws >> 1) - 1) - z = (ws >> 1) - mod; - else - z = mod; - k.isubn(z); - } else { - z = 0; - } - - naf[i] = z; - k.iushrn(1); - } - - return naf; - } - utils.getNAF = getNAF; - - // Represent k1, k2 in a Joint Sparse Form - function getJSF(k1, k2) { - var jsf = [ - [], - [], - ]; - - k1 = k1.clone(); - k2 = k2.clone(); - var d1 = 0; - var d2 = 0; - var m8; - while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { - // First phase - var m14 = (k1.andln(3) + d1) & 3; - var m24 = (k2.andln(3) + d2) & 3; - if (m14 === 3) - m14 = -1; - if (m24 === 3) - m24 = -1; - var u1; - if ((m14 & 1) === 0) { - u1 = 0; - } else { - m8 = (k1.andln(7) + d1) & 7; - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - jsf[0].push(u1); - - var u2; - if ((m24 & 1) === 0) { - u2 = 0; - } else { - m8 = (k2.andln(7) + d2) & 7; - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - jsf[1].push(u2); - - // Second phase - if (2 * d1 === u1 + 1) - d1 = 1 - d1; - if (2 * d2 === u2 + 1) - d2 = 1 - d2; - k1.iushrn(1); - k2.iushrn(1); - } - - return jsf; - } - utils.getJSF = getJSF; - - function cachedProperty(obj, name, computer) { - var key = '_' + name; - obj.prototype[name] = function cachedProperty() { - return this[key] !== undefined ? this[key] : - this[key] = computer.call(this); - }; - } - utils.cachedProperty = cachedProperty; - - function parseBytes(bytes) { - return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : - bytes; - } - utils.parseBytes = parseBytes; - - function intFromLE(bytes) { - return new BN(bytes, 'hex', 'le'); - } - utils.intFromLE = intFromLE; - }(utils$n)); - - var brorand = {exports: {}}; - - var r$2; - - brorand.exports = function rand(len) { - if (!r$2) - r$2 = new Rand(null); - - return r$2.generate(len); - }; - - function Rand(rand) { - this.rand = rand; - } - brorand.exports.Rand = Rand; - - Rand.prototype.generate = function generate(len) { - return this._rand(len); - }; - - // Emulate crypto API using randy - Rand.prototype._rand = function _rand(n) { - if (this.rand.getBytes) - return this.rand.getBytes(n); - - var res = new Uint8Array(n); - for (var i = 0; i < res.length; i++) - res[i] = this.rand.getByte(); - return res; - }; - - if (typeof self === 'object') { - if (self.crypto && self.crypto.getRandomValues) { - // Modern browsers - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.crypto.getRandomValues(arr); - return arr; - }; - } else if (self.msCrypto && self.msCrypto.getRandomValues) { - // IE - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.msCrypto.getRandomValues(arr); - return arr; - }; - - // Safari's WebWorkers do not have `crypto` - } else if (typeof window === 'object') { - // Old junk - Rand.prototype._rand = function() { - throw new Error('Not implemented yet'); - }; - } - } else { - // Node.js or Web worker with no crypto support - try { - var crypto$i = require('crypto'); - if (typeof crypto$i.randomBytes !== 'function') - throw new Error('Not supported'); - - Rand.prototype._rand = function _rand(n) { - return crypto$i.randomBytes(n); - }; - } catch (e) { - } - } - - var curve$1 = {}; - - var BN$j = bn$2.exports; - var utils$l = utils$n; - var getNAF$1 = utils$l.getNAF; - var getJSF$1 = utils$l.getJSF; - var assert$3c = utils$l.assert; - - function BaseCurve(type, conf) { - this.type = type; - this.p = new BN$j(conf.p, 16); - - // Use Montgomery, when there is no fast reduction for the prime - this.red = conf.prime ? BN$j.red(conf.prime) : BN$j.mont(this.p); - - // Useful for many curves - this.zero = new BN$j(0).toRed(this.red); - this.one = new BN$j(1).toRed(this.red); - this.two = new BN$j(2).toRed(this.red); - - // Curve configuration, optional - this.n = conf.n && new BN$j(conf.n, 16); - this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); - - // Temporary arrays - this._wnafT1 = new Array(4); - this._wnafT2 = new Array(4); - this._wnafT3 = new Array(4); - this._wnafT4 = new Array(4); - - this._bitLength = this.n ? this.n.bitLength() : 0; - - // Generalized Greg Maxwell's trick - var adjustCount = this.n && this.p.div(this.n); - if (!adjustCount || adjustCount.cmpn(100) > 0) { - this.redN = null; - } else { - this._maxwellTrick = true; - this.redN = this.n.toRed(this.red); - } - } - var base$2 = BaseCurve; - - BaseCurve.prototype.point = function point() { - throw new Error('Not implemented'); - }; - - BaseCurve.prototype.validate = function validate() { - throw new Error('Not implemented'); - }; - - BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { - assert$3c(p.precomputed); - var doubles = p._getDoubles(); - - var naf = getNAF$1(k, 1, this._bitLength); - var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); - I /= 3; - - // Translate into more windowed form - var repr = []; - var j; - var nafW; - for (j = 0; j < naf.length; j += doubles.step) { - nafW = 0; - for (var l = j + doubles.step - 1; l >= j; l--) - nafW = (nafW << 1) + naf[l]; - repr.push(nafW); - } - - var a = this.jpoint(null, null, null); - var b = this.jpoint(null, null, null); - for (var i = I; i > 0; i--) { - for (j = 0; j < repr.length; j++) { - nafW = repr[j]; - if (nafW === i) - b = b.mixedAdd(doubles.points[j]); - else if (nafW === -i) - b = b.mixedAdd(doubles.points[j].neg()); - } - a = a.add(b); - } - return a.toP(); - }; - - BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { - var w = 4; - - // Precompute window - var nafPoints = p._getNAFPoints(w); - w = nafPoints.wnd; - var wnd = nafPoints.points; - - // Get NAF form - var naf = getNAF$1(k, w, this._bitLength); - - // Add `this`*(N+1) for every w-NAF index - var acc = this.jpoint(null, null, null); - for (var i = naf.length - 1; i >= 0; i--) { - // Count zeroes - for (var l = 0; i >= 0 && naf[i] === 0; i--) - l++; - if (i >= 0) - l++; - acc = acc.dblp(l); - - if (i < 0) - break; - var z = naf[i]; - assert$3c(z !== 0); - if (p.type === 'affine') { - // J +- P - if (z > 0) - acc = acc.mixedAdd(wnd[(z - 1) >> 1]); - else - acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); - } else { - // J +- J - if (z > 0) - acc = acc.add(wnd[(z - 1) >> 1]); - else - acc = acc.add(wnd[(-z - 1) >> 1].neg()); - } - } - return p.type === 'affine' ? acc.toP() : acc; - }; - - BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, - points, - coeffs, - len, - jacobianResult) { - var wndWidth = this._wnafT1; - var wnd = this._wnafT2; - var naf = this._wnafT3; - - // Fill all arrays - var max = 0; - var i; - var j; - var p; - for (i = 0; i < len; i++) { - p = points[i]; - var nafPoints = p._getNAFPoints(defW); - wndWidth[i] = nafPoints.wnd; - wnd[i] = nafPoints.points; - } - - // Comb small window NAFs - for (i = len - 1; i >= 1; i -= 2) { - var a = i - 1; - var b = i; - if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { - naf[a] = getNAF$1(coeffs[a], wndWidth[a], this._bitLength); - naf[b] = getNAF$1(coeffs[b], wndWidth[b], this._bitLength); - max = Math.max(naf[a].length, max); - max = Math.max(naf[b].length, max); - continue; - } - - var comb = [ - points[a], /* 1 */ - null, /* 3 */ - null, /* 5 */ - points[b], /* 7 */ - ]; - - // Try to avoid Projective points, if possible - if (points[a].y.cmp(points[b].y) === 0) { - comb[1] = points[a].add(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].add(points[b].neg()); - } else { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } - - var index = [ - -3, /* -1 -1 */ - -1, /* -1 0 */ - -5, /* -1 1 */ - -7, /* 0 -1 */ - 0, /* 0 0 */ - 7, /* 0 1 */ - 5, /* 1 -1 */ - 1, /* 1 0 */ - 3, /* 1 1 */ - ]; - - var jsf = getJSF$1(coeffs[a], coeffs[b]); - max = Math.max(jsf[0].length, max); - naf[a] = new Array(max); - naf[b] = new Array(max); - for (j = 0; j < max; j++) { - var ja = jsf[0][j] | 0; - var jb = jsf[1][j] | 0; - - naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; - naf[b][j] = 0; - wnd[a] = comb; - } - } - - var acc = this.jpoint(null, null, null); - var tmp = this._wnafT4; - for (i = max; i >= 0; i--) { - var k = 0; - - while (i >= 0) { - var zero = true; - for (j = 0; j < len; j++) { - tmp[j] = naf[j][i] | 0; - if (tmp[j] !== 0) - zero = false; - } - if (!zero) - break; - k++; - i--; - } - if (i >= 0) - k++; - acc = acc.dblp(k); - if (i < 0) - break; - - for (j = 0; j < len; j++) { - var z = tmp[j]; - if (z === 0) - continue; - else if (z > 0) - p = wnd[j][(z - 1) >> 1]; - else if (z < 0) - p = wnd[j][(-z - 1) >> 1].neg(); - - if (p.type === 'affine') - acc = acc.mixedAdd(p); - else - acc = acc.add(p); - } - } - // Zeroify references - for (i = 0; i < len; i++) - wnd[i] = null; - - if (jacobianResult) - return acc; - else - return acc.toP(); - }; - - function BasePoint(curve, type) { - this.curve = curve; - this.type = type; - this.precomputed = null; - } - BaseCurve.BasePoint = BasePoint; - - BasePoint.prototype.eq = function eq(/*other*/) { - throw new Error('Not implemented'); - }; - - BasePoint.prototype.validate = function validate() { - return this.curve.validate(this); - }; - - BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - bytes = utils$l.toArray(bytes, enc); - - var len = this.p.byteLength(); - - // uncompressed, hybrid-odd, hybrid-even - if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && - bytes.length - 1 === 2 * len) { - if (bytes[0] === 0x06) - assert$3c(bytes[bytes.length - 1] % 2 === 0); - else if (bytes[0] === 0x07) - assert$3c(bytes[bytes.length - 1] % 2 === 1); - - var res = this.point(bytes.slice(1, 1 + len), - bytes.slice(1 + len, 1 + 2 * len)); - - return res; - } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && - bytes.length - 1 === len) { - return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); - } - throw new Error('Unknown point format'); - }; - - BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { - return this.encode(enc, true); - }; - - BasePoint.prototype._encode = function _encode(compact) { - var len = this.curve.p.byteLength(); - var x = this.getX().toArray('be', len); - - if (compact) - return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); - - return [ 0x04 ].concat(x, this.getY().toArray('be', len)); - }; - - BasePoint.prototype.encode = function encode(enc, compact) { - return utils$l.encode(this._encode(compact), enc); - }; - - BasePoint.prototype.precompute = function precompute(power) { - if (this.precomputed) - return this; - - var precomputed = { - doubles: null, - naf: null, - beta: null, - }; - precomputed.naf = this._getNAFPoints(8); - precomputed.doubles = this._getDoubles(4, power); - precomputed.beta = this._getBeta(); - this.precomputed = precomputed; - - return this; - }; - - BasePoint.prototype._hasDoubles = function _hasDoubles(k) { - if (!this.precomputed) - return false; - - var doubles = this.precomputed.doubles; - if (!doubles) - return false; - - return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); - }; - - BasePoint.prototype._getDoubles = function _getDoubles(step, power) { - if (this.precomputed && this.precomputed.doubles) - return this.precomputed.doubles; - - var doubles = [ this ]; - var acc = this; - for (var i = 0; i < power; i += step) { - for (var j = 0; j < step; j++) - acc = acc.dbl(); - doubles.push(acc); - } - return { - step: step, - points: doubles, - }; - }; - - BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { - if (this.precomputed && this.precomputed.naf) - return this.precomputed.naf; - - var res = [ this ]; - var max = (1 << wnd) - 1; - var dbl = max === 1 ? null : this.dbl(); - for (var i = 1; i < max; i++) - res[i] = res[i - 1].add(dbl); - return { - wnd: wnd, - points: res, - }; - }; - - BasePoint.prototype._getBeta = function _getBeta() { - return null; - }; - - BasePoint.prototype.dblp = function dblp(k) { - var r = this; - for (var i = 0; i < k; i++) - r = r.dbl(); - return r; - }; - - var utils$k = utils$n; - var BN$i = bn$2.exports; - var inherits$3 = inherits$9.exports; - var Base$2 = base$2; - - var assert$3b = utils$k.assert; - - function ShortCurve$1(conf) { - Base$2.call(this, 'short', conf); - - this.a = new BN$i(conf.a, 16).toRed(this.red); - this.b = new BN$i(conf.b, 16).toRed(this.red); - this.tinv = this.two.redInvm(); - - this.zeroA = this.a.fromRed().cmpn(0) === 0; - this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; - - // If the curve is endomorphic, precalculate beta and lambda - this.endo = this._getEndomorphism(conf); - this._endoWnafT1 = new Array(4); - this._endoWnafT2 = new Array(4); - } - inherits$3(ShortCurve$1, Base$2); - var short = ShortCurve$1; - - ShortCurve$1.prototype._getEndomorphism = function _getEndomorphism(conf) { - // No efficient endomorphism - if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) - return; - - // Compute beta and lambda, that lambda * P = (beta * Px; Py) - var beta; - var lambda; - if (conf.beta) { - beta = new BN$i(conf.beta, 16).toRed(this.red); - } else { - var betas = this._getEndoRoots(this.p); - // Choose the smallest beta - beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; - beta = beta.toRed(this.red); - } - if (conf.lambda) { - lambda = new BN$i(conf.lambda, 16); - } else { - // Choose the lambda that is matching selected beta - var lambdas = this._getEndoRoots(this.n); - if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { - lambda = lambdas[0]; - } else { - lambda = lambdas[1]; - assert$3b(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); - } - } - - // Get basis vectors, used for balanced length-two representation - var basis; - if (conf.basis) { - basis = conf.basis.map(function(vec) { - return { - a: new BN$i(vec.a, 16), - b: new BN$i(vec.b, 16), - }; - }); - } else { - basis = this._getEndoBasis(lambda); - } - - return { - beta: beta, - lambda: lambda, - basis: basis, - }; - }; - - ShortCurve$1.prototype._getEndoRoots = function _getEndoRoots(num) { - // Find roots of for x^2 + x + 1 in F - // Root = (-1 +- Sqrt(-3)) / 2 - // - var red = num === this.p ? this.red : BN$i.mont(num); - var tinv = new BN$i(2).toRed(red).redInvm(); - var ntinv = tinv.redNeg(); - - var s = new BN$i(3).toRed(red).redNeg().redSqrt().redMul(tinv); - - var l1 = ntinv.redAdd(s).fromRed(); - var l2 = ntinv.redSub(s).fromRed(); - return [ l1, l2 ]; - }; - - ShortCurve$1.prototype._getEndoBasis = function _getEndoBasis(lambda) { - // aprxSqrt >= sqrt(this.n) - var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); - - // 3.74 - // Run EGCD, until r(L + 1) < aprxSqrt - var u = lambda; - var v = this.n.clone(); - var x1 = new BN$i(1); - var y1 = new BN$i(0); - var x2 = new BN$i(0); - var y2 = new BN$i(1); - - // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) - var a0; - var b0; - // First vector - var a1; - var b1; - // Second vector - var a2; - var b2; - - var prevR; - var i = 0; - var r; - var x; - while (u.cmpn(0) !== 0) { - var q = v.div(u); - r = v.sub(q.mul(u)); - x = x2.sub(q.mul(x1)); - var y = y2.sub(q.mul(y1)); - - if (!a1 && r.cmp(aprxSqrt) < 0) { - a0 = prevR.neg(); - b0 = x1; - a1 = r.neg(); - b1 = x; - } else if (a1 && ++i === 2) { - break; - } - prevR = r; - - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - } - a2 = r.neg(); - b2 = x; - - var len1 = a1.sqr().add(b1.sqr()); - var len2 = a2.sqr().add(b2.sqr()); - if (len2.cmp(len1) >= 0) { - a2 = a0; - b2 = b0; - } - - // Normalize signs - if (a1.negative) { - a1 = a1.neg(); - b1 = b1.neg(); - } - if (a2.negative) { - a2 = a2.neg(); - b2 = b2.neg(); - } - - return [ - { a: a1, b: b1 }, - { a: a2, b: b2 }, - ]; - }; - - ShortCurve$1.prototype._endoSplit = function _endoSplit(k) { - var basis = this.endo.basis; - var v1 = basis[0]; - var v2 = basis[1]; - - var c1 = v2.b.mul(k).divRound(this.n); - var c2 = v1.b.neg().mul(k).divRound(this.n); - - var p1 = c1.mul(v1.a); - var p2 = c2.mul(v2.a); - var q1 = c1.mul(v1.b); - var q2 = c2.mul(v2.b); - - // Calculate answer - var k1 = k.sub(p1).sub(p2); - var k2 = q1.add(q2).neg(); - return { k1: k1, k2: k2 }; - }; - - ShortCurve$1.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN$i(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - // XXX Is there any way to tell if the number is odd without converting it - // to non-red form? - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); - }; - - ShortCurve$1.prototype.validate = function validate(point) { - if (point.inf) - return true; - - var x = point.x; - var y = point.y; - - var ax = this.a.redMul(x); - var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); - return y.redSqr().redISub(rhs).cmpn(0) === 0; - }; - - ShortCurve$1.prototype._endoWnafMulAdd = - function _endoWnafMulAdd(points, coeffs, jacobianResult) { - var npoints = this._endoWnafT1; - var ncoeffs = this._endoWnafT2; - for (var i = 0; i < points.length; i++) { - var split = this._endoSplit(coeffs[i]); - var p = points[i]; - var beta = p._getBeta(); - - if (split.k1.negative) { - split.k1.ineg(); - p = p.neg(true); - } - if (split.k2.negative) { - split.k2.ineg(); - beta = beta.neg(true); - } - - npoints[i * 2] = p; - npoints[i * 2 + 1] = beta; - ncoeffs[i * 2] = split.k1; - ncoeffs[i * 2 + 1] = split.k2; - } - var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); - - // Clean-up references to points and coefficients - for (var j = 0; j < i * 2; j++) { - npoints[j] = null; - ncoeffs[j] = null; - } - return res; - }; - - function Point$3(curve, x, y, isRed) { - Base$2.BasePoint.call(this, curve, 'affine'); - if (x === null && y === null) { - this.x = null; - this.y = null; - this.inf = true; - } else { - this.x = new BN$i(x, 16); - this.y = new BN$i(y, 16); - // Force redgomery representation when loading from JSON - if (isRed) { - this.x.forceRed(this.curve.red); - this.y.forceRed(this.curve.red); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - this.inf = false; - } - } - inherits$3(Point$3, Base$2.BasePoint); - - ShortCurve$1.prototype.point = function point(x, y, isRed) { - return new Point$3(this, x, y, isRed); - }; - - ShortCurve$1.prototype.pointFromJSON = function pointFromJSON(obj, red) { - return Point$3.fromJSON(this, obj, red); - }; - - Point$3.prototype._getBeta = function _getBeta() { - if (!this.curve.endo) - return; - - var pre = this.precomputed; - if (pre && pre.beta) - return pre.beta; - - var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); - if (pre) { - var curve = this.curve; - var endoMul = function(p) { - return curve.point(p.x.redMul(curve.endo.beta), p.y); - }; - pre.beta = beta; - beta.precomputed = { - beta: null, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(endoMul), - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(endoMul), - }, - }; - } - return beta; - }; - - Point$3.prototype.toJSON = function toJSON() { - if (!this.precomputed) - return [ this.x, this.y ]; - - return [ this.x, this.y, this.precomputed && { - doubles: this.precomputed.doubles && { - step: this.precomputed.doubles.step, - points: this.precomputed.doubles.points.slice(1), - }, - naf: this.precomputed.naf && { - wnd: this.precomputed.naf.wnd, - points: this.precomputed.naf.points.slice(1), - }, - } ]; - }; - - Point$3.fromJSON = function fromJSON(curve, obj, red) { - if (typeof obj === 'string') - obj = JSON.parse(obj); - var res = curve.point(obj[0], obj[1], red); - if (!obj[2]) - return res; - - function obj2point(obj) { - return curve.point(obj[0], obj[1], red); - } - - var pre = obj[2]; - res.precomputed = { - beta: null, - doubles: pre.doubles && { - step: pre.doubles.step, - points: [ res ].concat(pre.doubles.points.map(obj2point)), - }, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: [ res ].concat(pre.naf.points.map(obj2point)), - }, - }; - return res; - }; - - Point$3.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; - }; - - Point$3.prototype.isInfinity = function isInfinity() { - return this.inf; - }; - - Point$3.prototype.add = function add(p) { - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P = 2P - if (this.eq(p)) - return this.dbl(); - - // P + (-P) = O - if (this.neg().eq(p)) - return this.curve.point(null, null); - - // P + Q = O - if (this.x.cmp(p.x) === 0) - return this.curve.point(null, null); - - var c = this.y.redSub(p.y); - if (c.cmpn(0) !== 0) - c = c.redMul(this.x.redSub(p.x).redInvm()); - var nx = c.redSqr().redISub(this.x).redISub(p.x); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); - }; - - Point$3.prototype.dbl = function dbl() { - if (this.inf) - return this; - - // 2P = O - var ys1 = this.y.redAdd(this.y); - if (ys1.cmpn(0) === 0) - return this.curve.point(null, null); - - var a = this.curve.a; - - var x2 = this.x.redSqr(); - var dyinv = ys1.redInvm(); - var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); - - var nx = c.redSqr().redISub(this.x.redAdd(this.x)); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); - }; - - Point$3.prototype.getX = function getX() { - return this.x.fromRed(); - }; - - Point$3.prototype.getY = function getY() { - return this.y.fromRed(); - }; - - Point$3.prototype.mul = function mul(k) { - k = new BN$i(k, 16); - if (this.isInfinity()) - return this; - else if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else if (this.curve.endo) - return this.curve._endoWnafMulAdd([ this ], [ k ]); - else - return this.curve._wnafMul(this, k); - }; - - Point$3.prototype.mulAdd = function mulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2); - }; - - Point$3.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs, true); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2, true); - }; - - Point$3.prototype.eq = function eq(p) { - return this === p || - this.inf === p.inf && - (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); - }; - - Point$3.prototype.neg = function neg(_precompute) { - if (this.inf) - return this; - - var res = this.curve.point(this.x, this.y.redNeg()); - if (_precompute && this.precomputed) { - var pre = this.precomputed; - var negate = function(p) { - return p.neg(); - }; - res.precomputed = { - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(negate), - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(negate), - }, - }; - } - return res; - }; - - Point$3.prototype.toJ = function toJ() { - if (this.inf) - return this.curve.jpoint(null, null, null); - - var res = this.curve.jpoint(this.x, this.y, this.curve.one); - return res; - }; - - function JPoint$1(curve, x, y, z) { - Base$2.BasePoint.call(this, curve, 'jacobian'); - if (x === null && y === null && z === null) { - this.x = this.curve.one; - this.y = this.curve.one; - this.z = new BN$i(0); - } else { - this.x = new BN$i(x, 16); - this.y = new BN$i(y, 16); - this.z = new BN$i(z, 16); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z === this.curve.one; - } - inherits$3(JPoint$1, Base$2.BasePoint); - - ShortCurve$1.prototype.jpoint = function jpoint(x, y, z) { - return new JPoint$1(this, x, y, z); - }; - - JPoint$1.prototype.toP = function toP() { - if (this.isInfinity()) - return this.curve.point(null, null); - - var zinv = this.z.redInvm(); - var zinv2 = zinv.redSqr(); - var ax = this.x.redMul(zinv2); - var ay = this.y.redMul(zinv2).redMul(zinv); - - return this.curve.point(ax, ay); - }; - - JPoint$1.prototype.neg = function neg() { - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); - }; - - JPoint$1.prototype.add = function add(p) { - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // 12M + 4S + 7A - var pz2 = p.z.redSqr(); - var z2 = this.z.redSqr(); - var u1 = this.x.redMul(pz2); - var u2 = p.x.redMul(z2); - var s1 = this.y.redMul(pz2.redMul(p.z)); - var s2 = p.y.redMul(z2.redMul(this.z)); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype.mixedAdd = function mixedAdd(p) { - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - // 8M + 3S + 7A - var z2 = this.z.redSqr(); - var u1 = this.x; - var u2 = p.x.redMul(z2); - var s1 = this.y; - var s2 = p.y.redMul(z2).redMul(this.z); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(h); - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype.dblp = function dblp(pow) { - if (pow === 0) - return this; - if (this.isInfinity()) - return this; - if (!pow) - return this.dbl(); - - var i; - if (this.curve.zeroA || this.curve.threeA) { - var r = this; - for (i = 0; i < pow; i++) - r = r.dbl(); - return r; - } - - // 1M + 2S + 1A + N * (4S + 5M + 8A) - // N = 1 => 6M + 6S + 9A - var a = this.curve.a; - var tinv = this.curve.tinv; - - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - // Reuse results - var jyd = jy.redAdd(jy); - for (i = 0; i < pow; i++) { - var jx2 = jx.redSqr(); - var jyd2 = jyd.redSqr(); - var jyd4 = jyd2.redSqr(); - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var t1 = jx.redMul(jyd2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - var dny = c.redMul(t2); - dny = dny.redIAdd(dny).redISub(jyd4); - var nz = jyd.redMul(jz); - if (i + 1 < pow) - jz4 = jz4.redMul(jyd4); - - jx = nx; - jz = nz; - jyd = dny; - } - - return this.curve.jpoint(jx, jyd.redMul(tinv), jz); - }; - - JPoint$1.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - if (this.curve.zeroA) - return this._zeroDbl(); - else if (this.curve.threeA) - return this._threeDbl(); - else - return this._dbl(); - }; - - JPoint$1.prototype._zeroDbl = function _zeroDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 14A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // T = M ^ 2 - 2*S - var t = m.redSqr().redISub(s).redISub(s); - - // 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2*Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-dbl-2009-l - // 2M + 5S + 13A - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = B^2 - var c = b.redSqr(); - // D = 2 * ((X1 + B)^2 - A - C) - var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); - d = d.redIAdd(d); - // E = 3 * A - var e = a.redAdd(a).redIAdd(a); - // F = E^2 - var f = e.redSqr(); - - // 8 * C - var c8 = c.redIAdd(c); - c8 = c8.redIAdd(c8); - c8 = c8.redIAdd(c8); - - // X3 = F - 2 * D - nx = f.redISub(d).redISub(d); - // Y3 = E * (D - X3) - 8 * C - ny = e.redMul(d.redISub(nx)).redISub(c8); - // Z3 = 2 * Y1 * Z1 - nz = this.y.redMul(this.z); - nz = nz.redIAdd(nz); - } - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype._threeDbl = function _threeDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 15A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a - var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); - // T = M^2 - 2 * S - var t = m.redSqr().redISub(s).redISub(s); - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2 * Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S - - // delta = Z1^2 - var delta = this.z.redSqr(); - // gamma = Y1^2 - var gamma = this.y.redSqr(); - // beta = X1 * gamma - var beta = this.x.redMul(gamma); - // alpha = 3 * (X1 - delta) * (X1 + delta) - var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); - alpha = alpha.redAdd(alpha).redIAdd(alpha); - // X3 = alpha^2 - 8 * beta - var beta4 = beta.redIAdd(beta); - beta4 = beta4.redIAdd(beta4); - var beta8 = beta4.redAdd(beta4); - nx = alpha.redSqr().redISub(beta8); - // Z3 = (Y1 + Z1)^2 - gamma - delta - nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - var ggamma8 = gamma.redSqr(); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); - } - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype._dbl = function _dbl() { - var a = this.curve.a; - - // 4M + 6S + 10A - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - var jx2 = jx.redSqr(); - var jy2 = jy.redSqr(); - - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var jxd4 = jx.redAdd(jx); - jxd4 = jxd4.redIAdd(jxd4); - var t1 = jxd4.redMul(jy2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - - var jyd8 = jy2.redSqr(); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - var ny = c.redMul(t2).redISub(jyd8); - var nz = jy.redAdd(jy).redMul(jz); - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype.trpl = function trpl() { - if (!this.curve.zeroA) - return this.dbl().add(this); - - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl - // 5M + 10S + ... - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // ZZ = Z1^2 - var zz = this.z.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // M = 3 * XX + a * ZZ2; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // MM = M^2 - var mm = m.redSqr(); - // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM - var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - e = e.redIAdd(e); - e = e.redAdd(e).redIAdd(e); - e = e.redISub(mm); - // EE = E^2 - var ee = e.redSqr(); - // T = 16*YYYY - var t = yyyy.redIAdd(yyyy); - t = t.redIAdd(t); - t = t.redIAdd(t); - t = t.redIAdd(t); - // U = (M + E)^2 - MM - EE - T - var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); - // X3 = 4 * (X1 * EE - 4 * YY * U) - var yyu4 = yy.redMul(u); - yyu4 = yyu4.redIAdd(yyu4); - yyu4 = yyu4.redIAdd(yyu4); - var nx = this.x.redMul(ee).redISub(yyu4); - nx = nx.redIAdd(nx); - nx = nx.redIAdd(nx); - // Y3 = 8 * Y1 * (U * (T - U) - E * EE) - var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - // Z3 = (Z1 + E)^2 - ZZ - EE - var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); - - return this.curve.jpoint(nx, ny, nz); - }; - - JPoint$1.prototype.mul = function mul(k, kbase) { - k = new BN$i(k, kbase); - - return this.curve._wnafMul(this, k); - }; - - JPoint$1.prototype.eq = function eq(p) { - if (p.type === 'affine') - return this.eq(p.toJ()); - - if (this === p) - return true; - - // x1 * z2^2 == x2 * z1^2 - var z2 = this.z.redSqr(); - var pz2 = p.z.redSqr(); - if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) - return false; - - // y1 * z2^3 == y2 * z1^3 - var z3 = z2.redMul(this.z); - var pz3 = pz2.redMul(p.z); - return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; - }; - - JPoint$1.prototype.eqXToP = function eqXToP(x) { - var zs = this.z.redSqr(); - var rx = x.toRed(this.curve.red).redMul(zs); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(zs); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } - }; - - JPoint$1.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; - }; - - JPoint$1.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; - }; - - var BN$h = bn$2.exports; - var inherits$2 = inherits$9.exports; - var Base$1 = base$2; - - var utils$j = utils$n; - - function MontCurve$1(conf) { - Base$1.call(this, 'mont', conf); - - this.a = new BN$h(conf.a, 16).toRed(this.red); - this.b = new BN$h(conf.b, 16).toRed(this.red); - this.i4 = new BN$h(4).toRed(this.red).redInvm(); - this.two = new BN$h(2).toRed(this.red); - this.a24 = this.i4.redMul(this.a.redAdd(this.two)); - } - inherits$2(MontCurve$1, Base$1); - var mont = MontCurve$1; - - MontCurve$1.prototype.validate = function validate(point) { - var x = point.normalize().x; - var x2 = x.redSqr(); - var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); - var y = rhs.redSqrt(); - - return y.redSqr().cmp(rhs) === 0; - }; - - function Point$2(curve, x, z) { - Base$1.BasePoint.call(this, curve, 'projective'); - if (x === null && z === null) { - this.x = this.curve.one; - this.z = this.curve.zero; - } else { - this.x = new BN$h(x, 16); - this.z = new BN$h(z, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } - } - inherits$2(Point$2, Base$1.BasePoint); - - MontCurve$1.prototype.decodePoint = function decodePoint(bytes, enc) { - return this.point(utils$j.toArray(bytes, enc), 1); - }; - - MontCurve$1.prototype.point = function point(x, z) { - return new Point$2(this, x, z); - }; - - MontCurve$1.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point$2.fromJSON(this, obj); - }; - - Point$2.prototype.precompute = function precompute() { - // No-op - }; - - Point$2.prototype._encode = function _encode() { - return this.getX().toArray('be', this.curve.p.byteLength()); - }; - - Point$2.fromJSON = function fromJSON(curve, obj) { - return new Point$2(curve, obj[0], obj[1] || curve.one); - }; - - Point$2.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; - }; - - Point$2.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; - }; - - Point$2.prototype.dbl = function dbl() { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A - - // A = X1 + Z1 - var a = this.x.redAdd(this.z); - // AA = A^2 - var aa = a.redSqr(); - // B = X1 - Z1 - var b = this.x.redSub(this.z); - // BB = B^2 - var bb = b.redSqr(); - // C = AA - BB - var c = aa.redSub(bb); - // X3 = AA * BB - var nx = aa.redMul(bb); - // Z3 = C * (BB + A24 * C) - var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); - return this.curve.point(nx, nz); - }; - - Point$2.prototype.add = function add() { - throw new Error('Not supported on Montgomery curve'); - }; - - Point$2.prototype.diffAdd = function diffAdd(p, diff) { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 - // 4M + 2S + 6A - - // A = X2 + Z2 - var a = this.x.redAdd(this.z); - // B = X2 - Z2 - var b = this.x.redSub(this.z); - // C = X3 + Z3 - var c = p.x.redAdd(p.z); - // D = X3 - Z3 - var d = p.x.redSub(p.z); - // DA = D * A - var da = d.redMul(a); - // CB = C * B - var cb = c.redMul(b); - // X5 = Z1 * (DA + CB)^2 - var nx = diff.z.redMul(da.redAdd(cb).redSqr()); - // Z5 = X1 * (DA - CB)^2 - var nz = diff.x.redMul(da.redISub(cb).redSqr()); - return this.curve.point(nx, nz); - }; - - Point$2.prototype.mul = function mul(k) { - var t = k.clone(); - var a = this; // (N / 2) * Q + Q - var b = this.curve.point(null, null); // (N / 2) * Q - var c = this; // Q - - for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) - bits.push(t.andln(1)); - - for (var i = bits.length - 1; i >= 0; i--) { - if (bits[i] === 0) { - // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q - a = a.diffAdd(b, c); - // N * Q = 2 * ((N / 2) * Q + Q)) - b = b.dbl(); - } else { - // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) - b = a.diffAdd(b, c); - // N * Q + Q = 2 * ((N / 2) * Q + Q) - a = a.dbl(); - } - } - return b; - }; - - Point$2.prototype.mulAdd = function mulAdd() { - throw new Error('Not supported on Montgomery curve'); - }; - - Point$2.prototype.jumlAdd = function jumlAdd() { - throw new Error('Not supported on Montgomery curve'); - }; - - Point$2.prototype.eq = function eq(other) { - return this.getX().cmp(other.getX()) === 0; - }; - - Point$2.prototype.normalize = function normalize() { - this.x = this.x.redMul(this.z.redInvm()); - this.z = this.curve.one; - return this; - }; - - Point$2.prototype.getX = function getX() { - // Normalize coordinates - this.normalize(); - - return this.x.fromRed(); - }; - - var utils$i = utils$n; - var BN$g = bn$2.exports; - var inherits$1 = inherits$9.exports; - var Base = base$2; - - var assert$3a = utils$i.assert; - - function EdwardsCurve$1(conf) { - // NOTE: Important as we are creating point in Base.call() - this.twisted = (conf.a | 0) !== 1; - this.mOneA = this.twisted && (conf.a | 0) === -1; - this.extended = this.mOneA; - - Base.call(this, 'edwards', conf); - - this.a = new BN$g(conf.a, 16).umod(this.red.m); - this.a = this.a.toRed(this.red); - this.c = new BN$g(conf.c, 16).toRed(this.red); - this.c2 = this.c.redSqr(); - this.d = new BN$g(conf.d, 16).toRed(this.red); - this.dd = this.d.redAdd(this.d); - - assert$3a(!this.twisted || this.c.fromRed().cmpn(1) === 0); - this.oneC = (conf.c | 0) === 1; - } - inherits$1(EdwardsCurve$1, Base); - var edwards = EdwardsCurve$1; - - EdwardsCurve$1.prototype._mulA = function _mulA(num) { - if (this.mOneA) - return num.redNeg(); - else - return this.a.redMul(num); - }; - - EdwardsCurve$1.prototype._mulC = function _mulC(num) { - if (this.oneC) - return num; - else - return this.c.redMul(num); - }; - - // Just for compatibility with Short curve - EdwardsCurve$1.prototype.jpoint = function jpoint(x, y, z, t) { - return this.point(x, y, z, t); - }; - - EdwardsCurve$1.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN$g(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var x2 = x.redSqr(); - var rhs = this.c2.redSub(this.a.redMul(x2)); - var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); - - var y2 = rhs.redMul(lhs.redInvm()); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); - }; - - EdwardsCurve$1.prototype.pointFromY = function pointFromY(y, odd) { - y = new BN$g(y, 16); - if (!y.red) - y = y.toRed(this.red); - - // x^2 = (y^2 - c^2) / (c^2 d y^2 - a) - var y2 = y.redSqr(); - var lhs = y2.redSub(this.c2); - var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); - var x2 = lhs.redMul(rhs.redInvm()); - - if (x2.cmp(this.zero) === 0) { - if (odd) - throw new Error('invalid point'); - else - return this.point(this.zero, y); - } - - var x = x2.redSqrt(); - if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - if (x.fromRed().isOdd() !== odd) - x = x.redNeg(); - - return this.point(x, y); - }; - - EdwardsCurve$1.prototype.validate = function validate(point) { - if (point.isInfinity()) - return true; - - // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) - point.normalize(); - - var x2 = point.x.redSqr(); - var y2 = point.y.redSqr(); - var lhs = x2.redMul(this.a).redAdd(y2); - var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); - - return lhs.cmp(rhs) === 0; - }; - - function Point$1(curve, x, y, z, t) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && y === null && z === null) { - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - } else { - this.x = new BN$g(x, 16); - this.y = new BN$g(y, 16); - this.z = z ? new BN$g(z, 16) : this.curve.one; - this.t = t && new BN$g(t, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - this.zOne = this.z === this.curve.one; - - // Use extended coordinates - if (this.curve.extended && !this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redMul(this.z.redInvm()); - } - } - } - inherits$1(Point$1, Base.BasePoint); - - EdwardsCurve$1.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point$1.fromJSON(this, obj); - }; - - EdwardsCurve$1.prototype.point = function point(x, y, z, t) { - return new Point$1(this, x, y, z, t); - }; - - Point$1.fromJSON = function fromJSON(curve, obj) { - return new Point$1(curve, obj[0], obj[1], obj[2]); - }; - - Point$1.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; - }; - - Point$1.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.x.cmpn(0) === 0 && - (this.y.cmp(this.z) === 0 || - (this.zOne && this.y.cmp(this.curve.c) === 0)); - }; - - Point$1.prototype._extDbl = function _extDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #doubling-dbl-2008-hwcd - // 4M + 4S - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = 2 * Z1^2 - var c = this.z.redSqr(); - c = c.redIAdd(c); - // D = a * A - var d = this.curve._mulA(a); - // E = (X1 + Y1)^2 - A - B - var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - // G = D + B - var g = d.redAdd(b); - // F = G - C - var f = g.redSub(c); - // H = D - B - var h = d.redSub(b); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); - }; - - Point$1.prototype._projDbl = function _projDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #doubling-dbl-2008-bbjlp - // #doubling-dbl-2007-bl - // and others - // Generally 3M + 4S or 2M + 4S - - // B = (X1 + Y1)^2 - var b = this.x.redAdd(this.y).redSqr(); - // C = X1^2 - var c = this.x.redSqr(); - // D = Y1^2 - var d = this.y.redSqr(); - - var nx; - var ny; - var nz; - var e; - var h; - var j; - if (this.curve.twisted) { - // E = a * C - e = this.curve._mulA(c); - // F = E + D - var f = e.redAdd(d); - if (this.zOne) { - // X3 = (B - C - D) * (F - 2) - nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F^2 - 2 * F - nz = f.redSqr().redSub(f).redSub(f); - } else { - // H = Z1^2 - h = this.z.redSqr(); - // J = F - 2 * H - j = f.redSub(h).redISub(h); - // X3 = (B-C-D)*J - nx = b.redSub(c).redISub(d).redMul(j); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F * J - nz = f.redMul(j); - } - } else { - // E = C + D - e = c.redAdd(d); - // H = (c * Z1)^2 - h = this.curve._mulC(this.z).redSqr(); - // J = E - 2 * H - j = e.redSub(h).redSub(h); - // X3 = c * (B - E) * J - nx = this.curve._mulC(b.redISub(e)).redMul(j); - // Y3 = c * E * (C - D) - ny = this.curve._mulC(e).redMul(c.redISub(d)); - // Z3 = E * J - nz = e.redMul(j); - } - return this.curve.point(nx, ny, nz); - }; - - Point$1.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - // Double in extended coordinates - if (this.curve.extended) - return this._extDbl(); - else - return this._projDbl(); - }; - - Point$1.prototype._extAdd = function _extAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #addition-add-2008-hwcd-3 - // 8M - - // A = (Y1 - X1) * (Y2 - X2) - var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - // B = (Y1 + X1) * (Y2 + X2) - var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - // C = T1 * k * T2 - var c = this.t.redMul(this.curve.dd).redMul(p.t); - // D = Z1 * 2 * Z2 - var d = this.z.redMul(p.z.redAdd(p.z)); - // E = B - A - var e = b.redSub(a); - // F = D - C - var f = d.redSub(c); - // G = D + C - var g = d.redAdd(c); - // H = B + A - var h = b.redAdd(a); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); - }; - - Point$1.prototype._projAdd = function _projAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #addition-add-2008-bbjlp - // #addition-add-2007-bl - // 10M + 1S - - // A = Z1 * Z2 - var a = this.z.redMul(p.z); - // B = A^2 - var b = a.redSqr(); - // C = X1 * X2 - var c = this.x.redMul(p.x); - // D = Y1 * Y2 - var d = this.y.redMul(p.y); - // E = d * C * D - var e = this.curve.d.redMul(c).redMul(d); - // F = B - E - var f = b.redSub(e); - // G = B + E - var g = b.redAdd(e); - // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) - var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); - var nx = a.redMul(f).redMul(tmp); - var ny; - var nz; - if (this.curve.twisted) { - // Y3 = A * G * (D - a * C) - ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); - // Z3 = F * G - nz = f.redMul(g); - } else { - // Y3 = A * G * (D - C) - ny = a.redMul(g).redMul(d.redSub(c)); - // Z3 = c * F * G - nz = this.curve._mulC(f).redMul(g); - } - return this.curve.point(nx, ny, nz); - }; - - Point$1.prototype.add = function add(p) { - if (this.isInfinity()) - return p; - if (p.isInfinity()) - return this; - - if (this.curve.extended) - return this._extAdd(p); - else - return this._projAdd(p); - }; - - Point$1.prototype.mul = function mul(k) { - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else - return this.curve._wnafMul(this, k); - }; - - Point$1.prototype.mulAdd = function mulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); - }; - - Point$1.prototype.jmulAdd = function jmulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); - }; - - Point$1.prototype.normalize = function normalize() { - if (this.zOne) - return this; - - // Normalize coordinates - var zi = this.z.redInvm(); - this.x = this.x.redMul(zi); - this.y = this.y.redMul(zi); - if (this.t) - this.t = this.t.redMul(zi); - this.z = this.curve.one; - this.zOne = true; - return this; - }; - - Point$1.prototype.neg = function neg() { - return this.curve.point(this.x.redNeg(), - this.y, - this.z, - this.t && this.t.redNeg()); - }; - - Point$1.prototype.getX = function getX() { - this.normalize(); - return this.x.fromRed(); - }; - - Point$1.prototype.getY = function getY() { - this.normalize(); - return this.y.fromRed(); - }; - - Point$1.prototype.eq = function eq(other) { - return this === other || - this.getX().cmp(other.getX()) === 0 && - this.getY().cmp(other.getY()) === 0; - }; - - Point$1.prototype.eqXToP = function eqXToP(x) { - var rx = x.toRed(this.curve.red).redMul(this.z); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(this.z); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } - }; - - // Compatibility with BaseCurve - Point$1.prototype.toP = Point$1.prototype.normalize; - Point$1.prototype.mixedAdd = Point$1.prototype.add; - - (function (exports) { - - var curve = exports; - - curve.base = base$2; - curve.short = short; - curve.mont = mont; - curve.edwards = edwards; - }(curve$1)); - - var curves$3 = {}; - - var hash$3 = {}; - - var utils$h = {}; - - var assert$39 = minimalisticAssert; - var inherits = inherits$9.exports; - - utils$h.inherits = inherits; - - function isSurrogatePair(msg, i) { - if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) { - return false; - } - if (i < 0 || i + 1 >= msg.length) { - return false; - } - return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00; - } - - function toArray$1(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg === 'string') { - if (!enc) { - // Inspired by stringToUtf8ByteArray() in closure-library by Google - // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143 - // Apache License 2.0 - // https://github.com/google/closure-library/blob/master/LICENSE - var p = 0; - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - if (c < 128) { - res[p++] = c; - } else if (c < 2048) { - res[p++] = (c >> 6) | 192; - res[p++] = (c & 63) | 128; - } else if (isSurrogatePair(msg, i)) { - c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF); - res[p++] = (c >> 18) | 240; - res[p++] = ((c >> 12) & 63) | 128; - res[p++] = ((c >> 6) & 63) | 128; - res[p++] = (c & 63) | 128; - } else { - res[p++] = (c >> 12) | 224; - res[p++] = ((c >> 6) & 63) | 128; - res[p++] = (c & 63) | 128; - } - } - } else if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } - } else { - for (i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - } - return res; - } - utils$h.toArray = toArray$1; - - function toHex$2(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; - } - utils$h.toHex = toHex$2; - - function htonl(w) { - var res = (w >>> 24) | - ((w >>> 8) & 0xff00) | - ((w << 8) & 0xff0000) | - ((w & 0xff) << 24); - return res >>> 0; - } - utils$h.htonl = htonl; - - function toHex32(msg, endian) { - var res = ''; - for (var i = 0; i < msg.length; i++) { - var w = msg[i]; - if (endian === 'little') - w = htonl(w); - res += zero8(w.toString(16)); - } - return res; - } - utils$h.toHex32 = toHex32; - - function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; - } - utils$h.zero2 = zero2; - - function zero8(word) { - if (word.length === 7) - return '0' + word; - else if (word.length === 6) - return '00' + word; - else if (word.length === 5) - return '000' + word; - else if (word.length === 4) - return '0000' + word; - else if (word.length === 3) - return '00000' + word; - else if (word.length === 2) - return '000000' + word; - else if (word.length === 1) - return '0000000' + word; - else - return word; - } - utils$h.zero8 = zero8; - - function join32(msg, start, end, endian) { - var len = end - start; - assert$39(len % 4 === 0); - var res = new Array(len / 4); - for (var i = 0, k = start; i < res.length; i++, k += 4) { - var w; - if (endian === 'big') - w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; - else - w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; - res[i] = w >>> 0; - } - return res; - } - utils$h.join32 = join32; - - function split32(msg, endian) { - var res = new Array(msg.length * 4); - for (var i = 0, k = 0; i < msg.length; i++, k += 4) { - var m = msg[i]; - if (endian === 'big') { - res[k] = m >>> 24; - res[k + 1] = (m >>> 16) & 0xff; - res[k + 2] = (m >>> 8) & 0xff; - res[k + 3] = m & 0xff; - } else { - res[k + 3] = m >>> 24; - res[k + 2] = (m >>> 16) & 0xff; - res[k + 1] = (m >>> 8) & 0xff; - res[k] = m & 0xff; - } - } - return res; - } - utils$h.split32 = split32; - - function rotr32$1(w, b) { - return (w >>> b) | (w << (32 - b)); - } - utils$h.rotr32 = rotr32$1; - - function rotl32$6(w, b) { - return (w << b) | (w >>> (32 - b)); - } - utils$h.rotl32 = rotl32$6; - - function sum32$3(a, b) { - return (a + b) >>> 0; - } - utils$h.sum32 = sum32$3; - - function sum32_3$1(a, b, c) { - return (a + b + c) >>> 0; - } - utils$h.sum32_3 = sum32_3$1; - - function sum32_4$2(a, b, c, d) { - return (a + b + c + d) >>> 0; - } - utils$h.sum32_4 = sum32_4$2; - - function sum32_5$2(a, b, c, d, e) { - return (a + b + c + d + e) >>> 0; - } - utils$h.sum32_5 = sum32_5$2; - - function sum64$2(buf, pos, ah, al) { - var bh = buf[pos]; - var bl = buf[pos + 1]; - - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - buf[pos] = hi >>> 0; - buf[pos + 1] = lo; - } - utils$h.sum64 = sum64$2; - - function sum64_hi$2(ah, al, bh, bl) { - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - return hi >>> 0; - } - utils$h.sum64_hi = sum64_hi$2; - - function sum64_lo$2(ah, al, bh, bl) { - var lo = al + bl; - return lo >>> 0; - } - utils$h.sum64_lo = sum64_lo$2; - - function sum64_4_hi$2(ah, al, bh, bl, ch, cl, dh, dl) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - - var hi = ah + bh + ch + dh + carry; - return hi >>> 0; - } - utils$h.sum64_4_hi = sum64_4_hi$2; - - function sum64_4_lo$2(ah, al, bh, bl, ch, cl, dh, dl) { - var lo = al + bl + cl + dl; - return lo >>> 0; - } - utils$h.sum64_4_lo = sum64_4_lo$2; - - function sum64_5_hi$2(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - lo = (lo + el) >>> 0; - carry += lo < el ? 1 : 0; - - var hi = ah + bh + ch + dh + eh + carry; - return hi >>> 0; - } - utils$h.sum64_5_hi = sum64_5_hi$2; - - function sum64_5_lo$2(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var lo = al + bl + cl + dl + el; - - return lo >>> 0; - } - utils$h.sum64_5_lo = sum64_5_lo$2; - - function rotr64_hi$2(ah, al, num) { - var r = (al << (32 - num)) | (ah >>> num); - return r >>> 0; - } - utils$h.rotr64_hi = rotr64_hi$2; - - function rotr64_lo$2(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; - } - utils$h.rotr64_lo = rotr64_lo$2; - - function shr64_hi$2(ah, al, num) { - return ah >>> num; - } - utils$h.shr64_hi = shr64_hi$2; - - function shr64_lo$2(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; - } - utils$h.shr64_lo = shr64_lo$2; - - var common$y = {}; - - var utils$g = utils$h; - var assert$38 = minimalisticAssert; - - function BlockHash$4() { - this.pending = null; - this.pendingTotal = 0; - this.blockSize = this.constructor.blockSize; - this.outSize = this.constructor.outSize; - this.hmacStrength = this.constructor.hmacStrength; - this.padLength = this.constructor.padLength / 8; - this.endian = 'big'; - - this._delta8 = this.blockSize / 8; - this._delta32 = this.blockSize / 32; - } - common$y.BlockHash = BlockHash$4; - - BlockHash$4.prototype.update = function update(msg, enc) { - // Convert message to array, pad it, and join into 32bit blocks - msg = utils$g.toArray(msg, enc); - if (!this.pending) - this.pending = msg; - else - this.pending = this.pending.concat(msg); - this.pendingTotal += msg.length; - - // Enough data, try updating - if (this.pending.length >= this._delta8) { - msg = this.pending; - - // Process pending data in blocks - var r = msg.length % this._delta8; - this.pending = msg.slice(msg.length - r, msg.length); - if (this.pending.length === 0) - this.pending = null; - - msg = utils$g.join32(msg, 0, msg.length - r, this.endian); - for (var i = 0; i < msg.length; i += this._delta32) - this._update(msg, i, i + this._delta32); - } - - return this; - }; - - BlockHash$4.prototype.digest = function digest(enc) { - this.update(this._pad()); - assert$38(this.pending === null); - - return this._digest(enc); - }; - - BlockHash$4.prototype._pad = function pad() { - var len = this.pendingTotal; - var bytes = this._delta8; - var k = bytes - ((len + this.padLength) % bytes); - var res = new Array(k + this.padLength); - res[0] = 0x80; - for (var i = 1; i < k; i++) - res[i] = 0; - - // Append length - len <<= 3; - if (this.endian === 'big') { - for (var t = 8; t < this.padLength; t++) - res[i++] = 0; - - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = (len >>> 24) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = len & 0xff; - } else { - res[i++] = len & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 24) & 0xff; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - - for (t = 8; t < this.padLength; t++) - res[i++] = 0; - } - - return res; - }; - - var sha = {}; - - var common$x = {}; - - var utils$f = utils$h; - var rotr32 = utils$f.rotr32; - - function ft_1$2(s, x, y, z) { - if (s === 0) - return ch32$2(x, y, z); - if (s === 1 || s === 3) - return p32$1(x, y, z); - if (s === 2) - return maj32$2(x, y, z); - } - common$x.ft_1 = ft_1$2; - - function ch32$2(x, y, z) { - return (x & y) ^ ((~x) & z); - } - common$x.ch32 = ch32$2; - - function maj32$2(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); - } - common$x.maj32 = maj32$2; - - function p32$1(x, y, z) { - return x ^ y ^ z; - } - common$x.p32 = p32$1; - - function s0_256$1(x) { - return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); - } - common$x.s0_256 = s0_256$1; - - function s1_256$1(x) { - return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); - } - common$x.s1_256 = s1_256$1; - - function g0_256$1(x) { - return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); - } - common$x.g0_256 = g0_256$1; - - function g1_256$1(x) { - return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); - } - common$x.g1_256 = g1_256$1; - - var utils$e = utils$h; - var common$w = common$y; - var shaCommon$1 = common$x; - - var rotl32$5 = utils$e.rotl32; - var sum32$2 = utils$e.sum32; - var sum32_5$1 = utils$e.sum32_5; - var ft_1$1 = shaCommon$1.ft_1; - var BlockHash$3 = common$w.BlockHash; - - var sha1_K = [ - 0x5A827999, 0x6ED9EBA1, - 0x8F1BBCDC, 0xCA62C1D6 - ]; - - function SHA1$2() { - if (!(this instanceof SHA1$2)) - return new SHA1$2(); - - BlockHash$3.call(this); - this.h = [ - 0x67452301, 0xefcdab89, 0x98badcfe, - 0x10325476, 0xc3d2e1f0 ]; - this.W = new Array(80); - } - - utils$e.inherits(SHA1$2, BlockHash$3); - var _1 = SHA1$2; - - SHA1$2.blockSize = 512; - SHA1$2.outSize = 160; - SHA1$2.hmacStrength = 80; - SHA1$2.padLength = 64; - - SHA1$2.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - - for(; i < W.length; i++) - W[i] = rotl32$5(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - - for (i = 0; i < W.length; i++) { - var s = ~~(i / 20); - var t = sum32_5$1(rotl32$5(a, 5), ft_1$1(s, b, c, d), e, W[i], sha1_K[s]); - e = d; - d = c; - c = rotl32$5(b, 30); - b = a; - a = t; - } - - this.h[0] = sum32$2(this.h[0], a); - this.h[1] = sum32$2(this.h[1], b); - this.h[2] = sum32$2(this.h[2], c); - this.h[3] = sum32$2(this.h[3], d); - this.h[4] = sum32$2(this.h[4], e); - }; - - SHA1$2.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$e.toHex32(this.h, 'big'); - else - return utils$e.split32(this.h, 'big'); - }; - - var utils$d = utils$h; - var common$v = common$y; - var shaCommon = common$x; - var assert$37 = minimalisticAssert; - - var sum32$1 = utils$d.sum32; - var sum32_4$1 = utils$d.sum32_4; - var sum32_5 = utils$d.sum32_5; - var ch32$1 = shaCommon.ch32; - var maj32$1 = shaCommon.maj32; - var s0_256 = shaCommon.s0_256; - var s1_256 = shaCommon.s1_256; - var g0_256 = shaCommon.g0_256; - var g1_256 = shaCommon.g1_256; - - var BlockHash$2 = common$v.BlockHash; - - var sha256_K = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]; - - function SHA256$8() { - if (!(this instanceof SHA256$8)) - return new SHA256$8(); - - BlockHash$2.call(this); - this.h = [ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]; - this.k = sha256_K; - this.W = new Array(64); - } - utils$d.inherits(SHA256$8, BlockHash$2); - var _256 = SHA256$8; - - SHA256$8.blockSize = 512; - SHA256$8.outSize = 256; - SHA256$8.hmacStrength = 192; - SHA256$8.padLength = 64; - - SHA256$8.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - for (; i < W.length; i++) - W[i] = sum32_4$1(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - var f = this.h[5]; - var g = this.h[6]; - var h = this.h[7]; - - assert$37(this.k.length === W.length); - for (i = 0; i < W.length; i++) { - var T1 = sum32_5(h, s1_256(e), ch32$1(e, f, g), this.k[i], W[i]); - var T2 = sum32$1(s0_256(a), maj32$1(a, b, c)); - h = g; - g = f; - f = e; - e = sum32$1(d, T1); - d = c; - c = b; - b = a; - a = sum32$1(T1, T2); - } - - this.h[0] = sum32$1(this.h[0], a); - this.h[1] = sum32$1(this.h[1], b); - this.h[2] = sum32$1(this.h[2], c); - this.h[3] = sum32$1(this.h[3], d); - this.h[4] = sum32$1(this.h[4], e); - this.h[5] = sum32$1(this.h[5], f); - this.h[6] = sum32$1(this.h[6], g); - this.h[7] = sum32$1(this.h[7], h); - }; - - SHA256$8.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$d.toHex32(this.h, 'big'); - else - return utils$d.split32(this.h, 'big'); - }; - - var utils$c = utils$h; - var SHA256$7 = _256; - - function SHA224() { - if (!(this instanceof SHA224)) - return new SHA224(); - - SHA256$7.call(this); - this.h = [ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; - } - utils$c.inherits(SHA224, SHA256$7); - var _224 = SHA224; - - SHA224.blockSize = 512; - SHA224.outSize = 224; - SHA224.hmacStrength = 192; - SHA224.padLength = 64; - - SHA224.prototype._digest = function digest(enc) { - // Just truncate output - if (enc === 'hex') - return utils$c.toHex32(this.h.slice(0, 7), 'big'); - else - return utils$c.split32(this.h.slice(0, 7), 'big'); - }; - - var utils$b = utils$h; - var common$u = common$y; - var assert$36 = minimalisticAssert; - - var rotr64_hi$1 = utils$b.rotr64_hi; - var rotr64_lo$1 = utils$b.rotr64_lo; - var shr64_hi$1 = utils$b.shr64_hi; - var shr64_lo$1 = utils$b.shr64_lo; - var sum64$1 = utils$b.sum64; - var sum64_hi$1 = utils$b.sum64_hi; - var sum64_lo$1 = utils$b.sum64_lo; - var sum64_4_hi$1 = utils$b.sum64_4_hi; - var sum64_4_lo$1 = utils$b.sum64_4_lo; - var sum64_5_hi$1 = utils$b.sum64_5_hi; - var sum64_5_lo$1 = utils$b.sum64_5_lo; - - var BlockHash$1 = common$u.BlockHash; - - var sha512_K = [ - 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, - 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, - 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, - 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, - 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, - 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, - 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, - 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, - 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, - 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, - 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, - 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, - 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, - 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, - 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, - 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, - 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, - 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, - 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, - 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, - 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, - 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, - 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, - 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, - 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, - 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, - 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, - 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, - 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, - 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, - 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, - 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, - 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, - 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, - 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, - 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, - 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, - 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, - 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, - 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 - ]; - - function SHA512$3() { - if (!(this instanceof SHA512$3)) - return new SHA512$3(); - - BlockHash$1.call(this); - this.h = [ - 0x6a09e667, 0xf3bcc908, - 0xbb67ae85, 0x84caa73b, - 0x3c6ef372, 0xfe94f82b, - 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, - 0x9b05688c, 0x2b3e6c1f, - 0x1f83d9ab, 0xfb41bd6b, - 0x5be0cd19, 0x137e2179 ]; - this.k = sha512_K; - this.W = new Array(160); - } - utils$b.inherits(SHA512$3, BlockHash$1); - var _512 = SHA512$3; - - SHA512$3.blockSize = 1024; - SHA512$3.outSize = 512; - SHA512$3.hmacStrength = 192; - SHA512$3.padLength = 128; - - SHA512$3.prototype._prepareBlock = function _prepareBlock(msg, start) { - var W = this.W; - - // 32 x 32bit words - for (var i = 0; i < 32; i++) - W[i] = msg[start + i]; - for (; i < W.length; i += 2) { - var c0_hi = g1_512_hi$1(W[i - 4], W[i - 3]); // i - 2 - var c0_lo = g1_512_lo$1(W[i - 4], W[i - 3]); - var c1_hi = W[i - 14]; // i - 7 - var c1_lo = W[i - 13]; - var c2_hi = g0_512_hi$1(W[i - 30], W[i - 29]); // i - 15 - var c2_lo = g0_512_lo$1(W[i - 30], W[i - 29]); - var c3_hi = W[i - 32]; // i - 16 - var c3_lo = W[i - 31]; - - W[i] = sum64_4_hi$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - W[i + 1] = sum64_4_lo$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - } - }; - - SHA512$3.prototype._update = function _update(msg, start) { - this._prepareBlock(msg, start); - - var W = this.W; - - var ah = this.h[0]; - var al = this.h[1]; - var bh = this.h[2]; - var bl = this.h[3]; - var ch = this.h[4]; - var cl = this.h[5]; - var dh = this.h[6]; - var dl = this.h[7]; - var eh = this.h[8]; - var el = this.h[9]; - var fh = this.h[10]; - var fl = this.h[11]; - var gh = this.h[12]; - var gl = this.h[13]; - var hh = this.h[14]; - var hl = this.h[15]; - - assert$36(this.k.length === W.length); - for (var i = 0; i < W.length; i += 2) { - var c0_hi = hh; - var c0_lo = hl; - var c1_hi = s1_512_hi$1(eh, el); - var c1_lo = s1_512_lo$1(eh, el); - var c2_hi = ch64_hi$1(eh, el, fh, fl, gh); - var c2_lo = ch64_lo$1(eh, el, fh, fl, gh, gl); - var c3_hi = this.k[i]; - var c3_lo = this.k[i + 1]; - var c4_hi = W[i]; - var c4_lo = W[i + 1]; - - var T1_hi = sum64_5_hi$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - var T1_lo = sum64_5_lo$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - - c0_hi = s0_512_hi$1(ah, al); - c0_lo = s0_512_lo$1(ah, al); - c1_hi = maj64_hi$1(ah, al, bh, bl, ch); - c1_lo = maj64_lo$1(ah, al, bh, bl, ch, cl); - - var T2_hi = sum64_hi$1(c0_hi, c0_lo, c1_hi, c1_lo); - var T2_lo = sum64_lo$1(c0_hi, c0_lo, c1_hi, c1_lo); - - hh = gh; - hl = gl; - - gh = fh; - gl = fl; - - fh = eh; - fl = el; - - eh = sum64_hi$1(dh, dl, T1_hi, T1_lo); - el = sum64_lo$1(dl, dl, T1_hi, T1_lo); - - dh = ch; - dl = cl; - - ch = bh; - cl = bl; - - bh = ah; - bl = al; - - ah = sum64_hi$1(T1_hi, T1_lo, T2_hi, T2_lo); - al = sum64_lo$1(T1_hi, T1_lo, T2_hi, T2_lo); - } - - sum64$1(this.h, 0, ah, al); - sum64$1(this.h, 2, bh, bl); - sum64$1(this.h, 4, ch, cl); - sum64$1(this.h, 6, dh, dl); - sum64$1(this.h, 8, eh, el); - sum64$1(this.h, 10, fh, fl); - sum64$1(this.h, 12, gh, gl); - sum64$1(this.h, 14, hh, hl); - }; - - SHA512$3.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$b.toHex32(this.h, 'big'); - else - return utils$b.split32(this.h, 'big'); - }; - - function ch64_hi$1(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ ((~xh) & zh); - if (r < 0) - r += 0x100000000; - return r; - } - - function ch64_lo$1(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ ((~xl) & zl); - if (r < 0) - r += 0x100000000; - return r; - } - - function maj64_hi$1(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); - if (r < 0) - r += 0x100000000; - return r; - } - - function maj64_lo$1(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); - if (r < 0) - r += 0x100000000; - return r; - } - - function s0_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 28); - var c1_hi = rotr64_hi$1(xl, xh, 2); // 34 - var c2_hi = rotr64_hi$1(xl, xh, 7); // 39 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; - } - - function s0_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 28); - var c1_lo = rotr64_lo$1(xl, xh, 2); // 34 - var c2_lo = rotr64_lo$1(xl, xh, 7); // 39 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; - } - - function s1_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 14); - var c1_hi = rotr64_hi$1(xh, xl, 18); - var c2_hi = rotr64_hi$1(xl, xh, 9); // 41 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; - } - - function s1_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 14); - var c1_lo = rotr64_lo$1(xh, xl, 18); - var c2_lo = rotr64_lo$1(xl, xh, 9); // 41 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; - } - - function g0_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 1); - var c1_hi = rotr64_hi$1(xh, xl, 8); - var c2_hi = shr64_hi$1(xh, xl, 7); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; - } - - function g0_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 1); - var c1_lo = rotr64_lo$1(xh, xl, 8); - var c2_lo = shr64_lo$1(xh, xl, 7); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; - } - - function g1_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 19); - var c1_hi = rotr64_hi$1(xl, xh, 29); // 61 - var c2_hi = shr64_hi$1(xh, xl, 6); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; - } - - function g1_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 19); - var c1_lo = rotr64_lo$1(xl, xh, 29); // 61 - var c2_lo = shr64_lo$1(xh, xl, 6); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; - } - - var utils$a = utils$h; - - var SHA512$2 = _512; - - function SHA384() { - if (!(this instanceof SHA384)) - return new SHA384(); - - SHA512$2.call(this); - this.h = [ - 0xcbbb9d5d, 0xc1059ed8, - 0x629a292a, 0x367cd507, - 0x9159015a, 0x3070dd17, - 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, - 0x8eb44a87, 0x68581511, - 0xdb0c2e0d, 0x64f98fa7, - 0x47b5481d, 0xbefa4fa4 ]; - } - utils$a.inherits(SHA384, SHA512$2); - var _384 = SHA384; - - SHA384.blockSize = 1024; - SHA384.outSize = 384; - SHA384.hmacStrength = 192; - SHA384.padLength = 128; - - SHA384.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$a.toHex32(this.h.slice(0, 12), 'big'); - else - return utils$a.split32(this.h.slice(0, 12), 'big'); - }; - - sha.sha1 = _1; - sha.sha224 = _224; - sha.sha256 = _256; - sha.sha384 = _384; - sha.sha512 = _512; - - var ripemd = {}; - - var utils$9 = utils$h; - var common$t = common$y; - - var rotl32$4 = utils$9.rotl32; - var sum32 = utils$9.sum32; - var sum32_3 = utils$9.sum32_3; - var sum32_4 = utils$9.sum32_4; - var BlockHash = common$t.BlockHash; - - function RIPEMD160$3() { - if (!(this instanceof RIPEMD160$3)) - return new RIPEMD160$3(); - - BlockHash.call(this); - - this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; - this.endian = 'little'; - } - utils$9.inherits(RIPEMD160$3, BlockHash); - ripemd.ripemd160 = RIPEMD160$3; - - RIPEMD160$3.blockSize = 512; - RIPEMD160$3.outSize = 160; - RIPEMD160$3.hmacStrength = 192; - RIPEMD160$3.padLength = 64; - - RIPEMD160$3.prototype._update = function update(msg, start) { - var A = this.h[0]; - var B = this.h[1]; - var C = this.h[2]; - var D = this.h[3]; - var E = this.h[4]; - var Ah = A; - var Bh = B; - var Ch = C; - var Dh = D; - var Eh = E; - for (var j = 0; j < 80; j++) { - var T = sum32( - rotl32$4( - sum32_4(A, f$1(j, B, C, D), msg[r$1[j] + start], K$4(j)), - s$1[j]), - E); - A = E; - E = D; - D = rotl32$4(C, 10); - C = B; - B = T; - T = sum32( - rotl32$4( - sum32_4(Ah, f$1(79 - j, Bh, Ch, Dh), msg[rh$1[j] + start], Kh$1(j)), - sh$1[j]), - Eh); - Ah = Eh; - Eh = Dh; - Dh = rotl32$4(Ch, 10); - Ch = Bh; - Bh = T; - } - T = sum32_3(this.h[1], C, Dh); - this.h[1] = sum32_3(this.h[2], D, Eh); - this.h[2] = sum32_3(this.h[3], E, Ah); - this.h[3] = sum32_3(this.h[4], A, Bh); - this.h[4] = sum32_3(this.h[0], B, Ch); - this.h[0] = T; - }; - - RIPEMD160$3.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$9.toHex32(this.h, 'little'); - else - return utils$9.split32(this.h, 'little'); - }; - - function f$1(j, x, y, z) { - if (j <= 15) - return x ^ y ^ z; - else if (j <= 31) - return (x & y) | ((~x) & z); - else if (j <= 47) - return (x | (~y)) ^ z; - else if (j <= 63) - return (x & z) | (y & (~z)); - else - return x ^ (y | (~z)); - } - - function K$4(j) { - if (j <= 15) - return 0x00000000; - else if (j <= 31) - return 0x5a827999; - else if (j <= 47) - return 0x6ed9eba1; - else if (j <= 63) - return 0x8f1bbcdc; - else - return 0xa953fd4e; - } - - function Kh$1(j) { - if (j <= 15) - return 0x50a28be6; - else if (j <= 31) - return 0x5c4dd124; - else if (j <= 47) - return 0x6d703ef3; - else if (j <= 63) - return 0x7a6d76e9; - else - return 0x00000000; - } - - var r$1 = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 - ]; - - var rh$1 = [ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 - ]; - - var s$1 = [ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 - ]; - - var sh$1 = [ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 - ]; - - var utils$8 = utils$h; - var assert$35 = minimalisticAssert; - - function Hmac(hash, key, enc) { - if (!(this instanceof Hmac)) - return new Hmac(hash, key, enc); - this.Hash = hash; - this.blockSize = hash.blockSize / 8; - this.outSize = hash.outSize / 8; - this.inner = null; - this.outer = null; - - this._init(utils$8.toArray(key, enc)); - } - var hmac$1 = Hmac; - - Hmac.prototype._init = function init(key) { - // Shorten key, if needed - if (key.length > this.blockSize) - key = new this.Hash().update(key).digest(); - assert$35(key.length <= this.blockSize); - - // Add padding to key - for (var i = key.length; i < this.blockSize; i++) - key.push(0); - - for (i = 0; i < key.length; i++) - key[i] ^= 0x36; - this.inner = new this.Hash().update(key); - - // 0x36 ^ 0x5c = 0x6a - for (i = 0; i < key.length; i++) - key[i] ^= 0x6a; - this.outer = new this.Hash().update(key); - }; - - Hmac.prototype.update = function update(msg, enc) { - this.inner.update(msg, enc); - return this; - }; - - Hmac.prototype.digest = function digest(enc) { - this.outer.update(this.inner.digest()); - return this.outer.digest(enc); - }; - - (function (exports) { - var hash = exports; - - hash.utils = utils$h; - hash.common = common$y; - hash.sha = sha; - hash.ripemd = ripemd; - hash.hmac = hmac$1; - - // Proxy hash functions to the main object - hash.sha1 = hash.sha.sha1; - hash.sha256 = hash.sha.sha256; - hash.sha224 = hash.sha.sha224; - hash.sha384 = hash.sha.sha384; - hash.sha512 = hash.sha.sha512; - hash.ripemd160 = hash.ripemd.ripemd160; - }(hash$3)); - - (function (exports) { - - var curves = exports; - - var hash = hash$3; - var curve = curve$1; - var utils = utils$n; - - var assert = utils.assert; - - function PresetCurve(options) { - if (options.type === 'short') - this.curve = new curve.short(options); - else if (options.type === 'edwards') - this.curve = new curve.edwards(options); - else - this.curve = new curve.mont(options); - this.g = this.curve.g; - this.n = this.curve.n; - this.hash = options.hash; - - assert(this.g.validate(), 'Invalid curve'); - assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); - } - curves.PresetCurve = PresetCurve; - - function defineCurve(name, options) { - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - get: function() { - var curve = new PresetCurve(options); - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - value: curve, - }); - return curve; - }, - }); - } - - defineCurve('p192', { - type: 'short', - prime: 'p192', - p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', - b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', - n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', - hash: hash.sha256, - gRed: false, - g: [ - '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', - '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811', - ], - }); - - defineCurve('p224', { - type: 'short', - prime: 'p224', - p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', - b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', - n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', - hash: hash.sha256, - gRed: false, - g: [ - 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', - 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34', - ], - }); - - defineCurve('p256', { - type: 'short', - prime: null, - p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', - a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', - b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', - n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', - hash: hash.sha256, - gRed: false, - g: [ - '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5', - ], - }); - - defineCurve('p384', { - type: 'short', - prime: null, - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 ffffffff', - a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 fffffffc', - b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + - '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', - n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + - 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', - hash: hash.sha384, - gRed: false, - g: [ - 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + - '5502f25d bf55296c 3a545e38 72760ab7', - '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f', - ], - }); - - defineCurve('p521', { - type: 'short', - prime: null, - p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff', - a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff fffffffc', - b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + - '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + - '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', - n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + - 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', - hash: hash.sha512, - gRed: false, - g: [ - '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + - '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + - 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', - '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + - '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + - '3fad0761 353c7086 a272c240 88be9476 9fd16650', - ], - }); - - defineCurve('curve25519', { - type: 'mont', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '76d06', - b: '1', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '9', - ], - }); - - defineCurve('ed25519', { - type: 'edwards', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '-1', - c: '1', - // -121665 * (121666^(-1)) (mod P) - d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', - - // 4/5 - '6666666666666666666666666666666666666666666666666666666666666658', - ], - }); - - var pre; - try { - pre = require('./precomputed/secp256k1'); - } catch (e) { - pre = undefined; - } - - defineCurve('secp256k1', { - type: 'short', - prime: 'k256', - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', - a: '0', - b: '7', - n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', - h: '1', - hash: hash.sha256, - - // Precomputed endomorphism - beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', - lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3', - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15', - }, - ], - - gRed: false, - g: [ - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', - pre, - ], - }); - }(curves$3)); - - var hash$2 = hash$3; - var utils$7 = utils$m; - var assert$34 = minimalisticAssert; - - function HmacDRBG$4(options) { - if (!(this instanceof HmacDRBG$4)) - return new HmacDRBG$4(options); - this.hash = options.hash; - this.predResist = !!options.predResist; - - this.outLen = this.hash.outSize; - this.minEntropy = options.minEntropy || this.hash.hmacStrength; - - this._reseed = null; - this.reseedInterval = null; - this.K = null; - this.V = null; - - var entropy = utils$7.toArray(options.entropy, options.entropyEnc || 'hex'); - var nonce = utils$7.toArray(options.nonce, options.nonceEnc || 'hex'); - var pers = utils$7.toArray(options.pers, options.persEnc || 'hex'); - assert$34(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - this._init(entropy, nonce, pers); - } - var hmacDrbg$3 = HmacDRBG$4; - - HmacDRBG$4.prototype._init = function init(entropy, nonce, pers) { - var seed = entropy.concat(nonce).concat(pers); - - this.K = new Array(this.outLen / 8); - this.V = new Array(this.outLen / 8); - for (var i = 0; i < this.V.length; i++) { - this.K[i] = 0x00; - this.V[i] = 0x01; - } - - this._update(seed); - this._reseed = 1; - this.reseedInterval = 0x1000000000000; // 2^48 - }; - - HmacDRBG$4.prototype._hmac = function hmac() { - return new hash$2.hmac(this.hash, this.K); - }; - - HmacDRBG$4.prototype._update = function update(seed) { - var kmac = this._hmac() - .update(this.V) - .update([ 0x00 ]); - if (seed) - kmac = kmac.update(seed); - this.K = kmac.digest(); - this.V = this._hmac().update(this.V).digest(); - if (!seed) - return; - - this.K = this._hmac() - .update(this.V) - .update([ 0x01 ]) - .update(seed) - .digest(); - this.V = this._hmac().update(this.V).digest(); - }; - - HmacDRBG$4.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { - // Optional entropy enc - if (typeof entropyEnc !== 'string') { - addEnc = add; - add = entropyEnc; - entropyEnc = null; - } - - entropy = utils$7.toArray(entropy, entropyEnc); - add = utils$7.toArray(add, addEnc); - - assert$34(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - - this._update(entropy.concat(add || [])); - this._reseed = 1; - }; - - HmacDRBG$4.prototype.generate = function generate(len, enc, add, addEnc) { - if (this._reseed > this.reseedInterval) - throw new Error('Reseed is required'); - - // Optional encoding - if (typeof enc !== 'string') { - addEnc = add; - add = enc; - enc = null; - } - - // Optional additional data - if (add) { - add = utils$7.toArray(add, addEnc || 'hex'); - this._update(add); - } - - var temp = []; - while (temp.length < len) { - this.V = this._hmac().update(this.V).digest(); - temp = temp.concat(this.V); - } - - var res = temp.slice(0, len); - this._update(add); - this._reseed++; - return utils$7.encode(res, enc); - }; - - var BN$f = bn$2.exports; - var utils$6 = utils$n; - var assert$33 = utils$6.assert; - - function KeyPair$3(ec, options) { - this.ec = ec; - this.priv = null; - this.pub = null; - - // KeyPair(ec, { priv: ..., pub: ... }) - if (options.priv) - this._importPrivate(options.priv, options.privEnc); - if (options.pub) - this._importPublic(options.pub, options.pubEnc); - } - var key$3 = KeyPair$3; - - KeyPair$3.fromPublic = function fromPublic(ec, pub, enc) { - if (pub instanceof KeyPair$3) - return pub; - - return new KeyPair$3(ec, { - pub: pub, - pubEnc: enc, - }); - }; - - KeyPair$3.fromPrivate = function fromPrivate(ec, priv, enc) { - if (priv instanceof KeyPair$3) - return priv; - - return new KeyPair$3(ec, { - priv: priv, - privEnc: enc, - }); - }; - - KeyPair$3.prototype.validate = function validate() { - var pub = this.getPublic(); - - if (pub.isInfinity()) - return { result: false, reason: 'Invalid public key' }; - if (!pub.validate()) - return { result: false, reason: 'Public key is not a point' }; - if (!pub.mul(this.ec.curve.n).isInfinity()) - return { result: false, reason: 'Public key * N != O' }; - - return { result: true, reason: null }; - }; - - KeyPair$3.prototype.getPublic = function getPublic(compact, enc) { - // compact is optional argument - if (typeof compact === 'string') { - enc = compact; - compact = null; - } - - if (!this.pub) - this.pub = this.ec.g.mul(this.priv); - - if (!enc) - return this.pub; - - return this.pub.encode(enc, compact); - }; - - KeyPair$3.prototype.getPrivate = function getPrivate(enc) { - if (enc === 'hex') - return this.priv.toString(16, 2); - else - return this.priv; - }; - - KeyPair$3.prototype._importPrivate = function _importPrivate(key, enc) { - this.priv = new BN$f(key, enc || 16); - - // Ensure that the priv won't be bigger than n, otherwise we may fail - // in fixed multiplication method - this.priv = this.priv.umod(this.ec.curve.n); - }; - - KeyPair$3.prototype._importPublic = function _importPublic(key, enc) { - if (key.x || key.y) { - // Montgomery points only have an `x` coordinate. - // Weierstrass/Edwards points on the other hand have both `x` and - // `y` coordinates. - if (this.ec.curve.type === 'mont') { - assert$33(key.x, 'Need x coordinate'); - } else if (this.ec.curve.type === 'short' || - this.ec.curve.type === 'edwards') { - assert$33(key.x && key.y, 'Need both x and y coordinate'); - } - this.pub = this.ec.curve.point(key.x, key.y); - return; - } - this.pub = this.ec.curve.decodePoint(key, enc); - }; - - // ECDH - KeyPair$3.prototype.derive = function derive(pub) { - if(!pub.validate()) { - assert$33(pub.validate(), 'public point not validated'); - } - return pub.mul(this.priv).getX(); - }; - - // ECDSA - KeyPair$3.prototype.sign = function sign(msg, enc, options) { - return this.ec.sign(msg, this, enc, options); - }; - - KeyPair$3.prototype.verify = function verify(msg, signature) { - return this.ec.verify(msg, signature, this); - }; - - KeyPair$3.prototype.inspect = function inspect() { - return ''; - }; - - var BN$e = bn$2.exports; - - var utils$5 = utils$n; - var assert$32 = utils$5.assert; - - function Signature$3(options, enc) { - if (options instanceof Signature$3) - return options; - - if (this._importDER(options, enc)) - return; - - assert$32(options.r && options.s, 'Signature without r or s'); - this.r = new BN$e(options.r, 16); - this.s = new BN$e(options.s, 16); - if (options.recoveryParam === undefined) - this.recoveryParam = null; - else - this.recoveryParam = options.recoveryParam; - } - var signature$1 = Signature$3; - - function Position() { - this.place = 0; - } - - function getLength(buf, p) { - var initial = buf[p.place++]; - if (!(initial & 0x80)) { - return initial; - } - var octetLen = initial & 0xf; - - // Indefinite length or overflow - if (octetLen === 0 || octetLen > 4) { - return false; - } - - var val = 0; - for (var i = 0, off = p.place; i < octetLen; i++, off++) { - val <<= 8; - val |= buf[off]; - val >>>= 0; - } - - // Leading zeroes - if (val <= 0x7f) { - return false; - } - - p.place = off; - return val; - } - - function rmPadding(buf) { - var i = 0; - var len = buf.length - 1; - while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { - i++; - } - if (i === 0) { - return buf; - } - return buf.slice(i); - } - - Signature$3.prototype._importDER = function _importDER(data, enc) { - data = utils$5.toArray(data, enc); - var p = new Position(); - if (data[p.place++] !== 0x30) { - return false; - } - var len = getLength(data, p); - if (len === false) { - return false; - } - if ((len + p.place) !== data.length) { - return false; - } - if (data[p.place++] !== 0x02) { - return false; - } - var rlen = getLength(data, p); - if (rlen === false) { - return false; - } - var r = data.slice(p.place, rlen + p.place); - p.place += rlen; - if (data[p.place++] !== 0x02) { - return false; - } - var slen = getLength(data, p); - if (slen === false) { - return false; - } - if (data.length !== slen + p.place) { - return false; - } - var s = data.slice(p.place, slen + p.place); - if (r[0] === 0) { - if (r[1] & 0x80) { - r = r.slice(1); - } else { - // Leading zeroes - return false; - } - } - if (s[0] === 0) { - if (s[1] & 0x80) { - s = s.slice(1); - } else { - // Leading zeroes - return false; - } - } - - this.r = new BN$e(r); - this.s = new BN$e(s); - this.recoveryParam = null; - - return true; - }; - - function constructLength(arr, len) { - if (len < 0x80) { - arr.push(len); - return; - } - var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); - arr.push(octets | 0x80); - while (--octets) { - arr.push((len >>> (octets << 3)) & 0xff); - } - arr.push(len); - } - - Signature$3.prototype.toDER = function toDER(enc) { - var r = this.r.toArray(); - var s = this.s.toArray(); - - // Pad values - if (r[0] & 0x80) - r = [ 0 ].concat(r); - // Pad values - if (s[0] & 0x80) - s = [ 0 ].concat(s); - - r = rmPadding(r); - s = rmPadding(s); - - while (!s[0] && !(s[1] & 0x80)) { - s = s.slice(1); - } - var arr = [ 0x02 ]; - constructLength(arr, r.length); - arr = arr.concat(r); - arr.push(0x02); - constructLength(arr, s.length); - var backHalf = arr.concat(s); - var res = [ 0x30 ]; - constructLength(res, backHalf.length); - res = res.concat(backHalf); - return utils$5.encode(res, enc); - }; - - var BN$d = bn$2.exports; - var HmacDRBG$3 = hmacDrbg$3; - var utils$4 = utils$n; - var curves$2 = curves$3; - var rand$1 = brorand.exports; - var assert$31 = utils$4.assert; - - var KeyPair$2 = key$3; - var Signature$2 = signature$1; - - function EC$1(options) { - if (!(this instanceof EC$1)) - return new EC$1(options); - - // Shortcut `elliptic.ec(curve-name)` - if (typeof options === 'string') { - assert$31(Object.prototype.hasOwnProperty.call(curves$2, options), - 'Unknown curve ' + options); - - options = curves$2[options]; - } - - // Shortcut for `elliptic.ec(elliptic.curves.curveName)` - if (options instanceof curves$2.PresetCurve) - options = { curve: options }; - - this.curve = options.curve.curve; - this.n = this.curve.n; - this.nh = this.n.ushrn(1); - this.g = this.curve.g; - - // Point on curve - this.g = options.curve.g; - this.g.precompute(options.curve.n.bitLength() + 1); - - // Hash for function for DRBG - this.hash = options.hash || options.curve.hash; - } - var ec$1 = EC$1; - - EC$1.prototype.keyPair = function keyPair(options) { - return new KeyPair$2(this, options); - }; - - EC$1.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { - return KeyPair$2.fromPrivate(this, priv, enc); - }; - - EC$1.prototype.keyFromPublic = function keyFromPublic(pub, enc) { - return KeyPair$2.fromPublic(this, pub, enc); - }; - - EC$1.prototype.genKeyPair = function genKeyPair(options) { - if (!options) - options = {}; - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG$3({ - hash: this.hash, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - entropy: options.entropy || rand$1(this.hash.hmacStrength), - entropyEnc: options.entropy && options.entropyEnc || 'utf8', - nonce: this.n.toArray(), - }); - - var bytes = this.n.byteLength(); - var ns2 = this.n.sub(new BN$d(2)); - for (;;) { - var priv = new BN$d(drbg.generate(bytes)); - if (priv.cmp(ns2) > 0) - continue; - - priv.iaddn(1); - return this.keyFromPrivate(priv); - } - }; - - EC$1.prototype._truncateToN = function _truncateToN(msg, truncOnly) { - var delta = msg.byteLength() * 8 - this.n.bitLength(); - if (delta > 0) - msg = msg.ushrn(delta); - if (!truncOnly && msg.cmp(this.n) >= 0) - return msg.sub(this.n); - else - return msg; - }; - - EC$1.prototype.sign = function sign(msg, key, enc, options) { - if (typeof enc === 'object') { - options = enc; - enc = null; - } - if (!options) - options = {}; - - key = this.keyFromPrivate(key, enc); - msg = this._truncateToN(new BN$d(msg, 16)); - - // Zero-extend key to provide enough entropy - var bytes = this.n.byteLength(); - var bkey = key.getPrivate().toArray('be', bytes); - - // Zero-extend nonce to have the same byte size as N - var nonce = msg.toArray('be', bytes); - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG$3({ - hash: this.hash, - entropy: bkey, - nonce: nonce, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - }); - - // Number of bytes to generate - var ns1 = this.n.sub(new BN$d(1)); - - for (var iter = 0; ; iter++) { - var k = options.k ? - options.k(iter) : - new BN$d(drbg.generate(this.n.byteLength())); - k = this._truncateToN(k, true); - if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) - continue; - - var kp = this.g.mul(k); - if (kp.isInfinity()) - continue; - - var kpX = kp.getX(); - var r = kpX.umod(this.n); - if (r.cmpn(0) === 0) - continue; - - var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); - s = s.umod(this.n); - if (s.cmpn(0) === 0) - continue; - - var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | - (kpX.cmp(r) !== 0 ? 2 : 0); - - // Use complement of `s`, if it is > `n / 2` - if (options.canonical && s.cmp(this.nh) > 0) { - s = this.n.sub(s); - recoveryParam ^= 1; - } - - return new Signature$2({ r: r, s: s, recoveryParam: recoveryParam }); - } - }; - - EC$1.prototype.verify = function verify(msg, signature, key, enc) { - msg = this._truncateToN(new BN$d(msg, 16)); - key = this.keyFromPublic(key, enc); - signature = new Signature$2(signature, 'hex'); - - // Perform primitive values validation - var r = signature.r; - var s = signature.s; - if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) - return false; - if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) - return false; - - // Validate signature - var sinv = s.invm(this.n); - var u1 = sinv.mul(msg).umod(this.n); - var u2 = sinv.mul(r).umod(this.n); - var p; - - if (!this.curve._maxwellTrick) { - p = this.g.mulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - return p.getX().umod(this.n).cmp(r) === 0; - } - - // NOTE: Greg Maxwell's trick, inspired by: - // https://git.io/vad3K - - p = this.g.jmulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - // Compare `p.x` of Jacobian point with `r`, - // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the - // inverse of `p.z^2` - return p.eqXToP(r); - }; - - EC$1.prototype.recoverPubKey = function(msg, signature, j, enc) { - assert$31((3 & j) === j, 'The recovery param is more than two bits'); - signature = new Signature$2(signature, enc); - - var n = this.n; - var e = new BN$d(msg); - var r = signature.r; - var s = signature.s; - - // A set LSB signifies that the y-coordinate is odd - var isYOdd = j & 1; - var isSecondKey = j >> 1; - if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) - throw new Error('Unable to find sencond key candinate'); - - // 1.1. Let x = r + jn. - if (isSecondKey) - r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); - else - r = this.curve.pointFromX(r, isYOdd); - - var rInv = signature.r.invm(n); - var s1 = n.sub(e).mul(rInv).umod(n); - var s2 = s.mul(rInv).umod(n); - - // 1.6.1 Compute Q = r^-1 (sR - eG) - // Q = r^-1 (sR + -eG) - return this.g.mulAdd(s1, r, s2); - }; - - EC$1.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { - signature = new Signature$2(signature, enc); - if (signature.recoveryParam !== null) - return signature.recoveryParam; - - for (var i = 0; i < 4; i++) { - var Qprime; - try { - Qprime = this.recoverPubKey(e, signature, i); - } catch (e) { - continue; - } - - if (Qprime.eq(Q)) - return i; - } - throw new Error('Unable to find valid recovery factor'); - }; - - var utils$3 = utils$n; - var assert$30 = utils$3.assert; - var parseBytes$2 = utils$3.parseBytes; - var cachedProperty$1 = utils$3.cachedProperty; - - /** - * @param {EDDSA} eddsa - instance - * @param {Object} params - public/private key parameters - * - * @param {Array} [params.secret] - secret seed bytes - * @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) - * @param {Array} [params.pub] - public key point encoded as bytes - * - */ - function KeyPair$1(eddsa, params) { - this.eddsa = eddsa; - this._secret = parseBytes$2(params.secret); - if (eddsa.isPoint(params.pub)) - this._pub = params.pub; - else - this._pubBytes = parseBytes$2(params.pub); - } - - KeyPair$1.fromPublic = function fromPublic(eddsa, pub) { - if (pub instanceof KeyPair$1) - return pub; - return new KeyPair$1(eddsa, { pub: pub }); - }; - - KeyPair$1.fromSecret = function fromSecret(eddsa, secret) { - if (secret instanceof KeyPair$1) - return secret; - return new KeyPair$1(eddsa, { secret: secret }); - }; - - KeyPair$1.prototype.secret = function secret() { - return this._secret; - }; - - cachedProperty$1(KeyPair$1, 'pubBytes', function pubBytes() { - return this.eddsa.encodePoint(this.pub()); - }); - - cachedProperty$1(KeyPair$1, 'pub', function pub() { - if (this._pubBytes) - return this.eddsa.decodePoint(this._pubBytes); - return this.eddsa.g.mul(this.priv()); - }); - - cachedProperty$1(KeyPair$1, 'privBytes', function privBytes() { - var eddsa = this.eddsa; - var hash = this.hash(); - var lastIx = eddsa.encodingLength - 1; - - var a = hash.slice(0, eddsa.encodingLength); - a[0] &= 248; - a[lastIx] &= 127; - a[lastIx] |= 64; - - return a; - }); - - cachedProperty$1(KeyPair$1, 'priv', function priv() { - return this.eddsa.decodeInt(this.privBytes()); - }); - - cachedProperty$1(KeyPair$1, 'hash', function hash() { - return this.eddsa.hash().update(this.secret()).digest(); - }); - - cachedProperty$1(KeyPair$1, 'messagePrefix', function messagePrefix() { - return this.hash().slice(this.eddsa.encodingLength); - }); - - KeyPair$1.prototype.sign = function sign(message) { - assert$30(this._secret, 'KeyPair can only verify'); - return this.eddsa.sign(message, this); - }; - - KeyPair$1.prototype.verify = function verify(message, sig) { - return this.eddsa.verify(message, sig, this); - }; - - KeyPair$1.prototype.getSecret = function getSecret(enc) { - assert$30(this._secret, 'KeyPair is public only'); - return utils$3.encode(this.secret(), enc); - }; - - KeyPair$1.prototype.getPublic = function getPublic(enc) { - return utils$3.encode(this.pubBytes(), enc); - }; - - var key$2 = KeyPair$1; - - var BN$c = bn$2.exports; - var utils$2 = utils$n; - var assert$2$ = utils$2.assert; - var cachedProperty = utils$2.cachedProperty; - var parseBytes$1 = utils$2.parseBytes; - - /** - * @param {EDDSA} eddsa - eddsa instance - * @param {Array|Object} sig - - * @param {Array|Point} [sig.R] - R point as Point or bytes - * @param {Array|bn} [sig.S] - S scalar as bn or bytes - * @param {Array} [sig.Rencoded] - R point encoded - * @param {Array} [sig.Sencoded] - S scalar encoded - */ - function Signature$1(eddsa, sig) { - this.eddsa = eddsa; - - if (typeof sig !== 'object') - sig = parseBytes$1(sig); - - if (Array.isArray(sig)) { - sig = { - R: sig.slice(0, eddsa.encodingLength), - S: sig.slice(eddsa.encodingLength), - }; - } - - assert$2$(sig.R && sig.S, 'Signature without R or S'); - - if (eddsa.isPoint(sig.R)) - this._R = sig.R; - if (sig.S instanceof BN$c) - this._S = sig.S; - - this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; - this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; - } - - cachedProperty(Signature$1, 'S', function S() { - return this.eddsa.decodeInt(this.Sencoded()); - }); - - cachedProperty(Signature$1, 'R', function R() { - return this.eddsa.decodePoint(this.Rencoded()); - }); - - cachedProperty(Signature$1, 'Rencoded', function Rencoded() { - return this.eddsa.encodePoint(this.R()); - }); - - cachedProperty(Signature$1, 'Sencoded', function Sencoded() { - return this.eddsa.encodeInt(this.S()); - }); - - Signature$1.prototype.toBytes = function toBytes() { - return this.Rencoded().concat(this.Sencoded()); - }; - - Signature$1.prototype.toHex = function toHex() { - return utils$2.encode(this.toBytes(), 'hex').toUpperCase(); - }; - - var signature = Signature$1; - - var hash$1 = hash$3; - var curves$1 = curves$3; - var utils$1 = utils$n; - var assert$2_ = utils$1.assert; - var parseBytes = utils$1.parseBytes; - var KeyPair = key$2; - var Signature = signature; - - function EDDSA(curve) { - assert$2_(curve === 'ed25519', 'only tested with ed25519 so far'); - - if (!(this instanceof EDDSA)) - return new EDDSA(curve); - - curve = curves$1[curve].curve; - this.curve = curve; - this.g = curve.g; - this.g.precompute(curve.n.bitLength() + 1); - - this.pointClass = curve.point().constructor; - this.encodingLength = Math.ceil(curve.n.bitLength() / 8); - this.hash = hash$1.sha512; - } - - var eddsa = EDDSA; - - /** - * @param {Array|String} message - message bytes - * @param {Array|String|KeyPair} secret - secret bytes or a keypair - * @returns {Signature} - signature - */ - EDDSA.prototype.sign = function sign(message, secret) { - message = parseBytes(message); - var key = this.keyFromSecret(secret); - var r = this.hashInt(key.messagePrefix(), message); - var R = this.g.mul(r); - var Rencoded = this.encodePoint(R); - var s_ = this.hashInt(Rencoded, key.pubBytes(), message) - .mul(key.priv()); - var S = r.add(s_).umod(this.curve.n); - return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); - }; - - /** - * @param {Array} message - message bytes - * @param {Array|String|Signature} sig - sig bytes - * @param {Array|String|Point|KeyPair} pub - public key - * @returns {Boolean} - true if public key matches sig of message - */ - EDDSA.prototype.verify = function verify(message, sig, pub) { - message = parseBytes(message); - sig = this.makeSignature(sig); - var key = this.keyFromPublic(pub); - var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); - var SG = this.g.mul(sig.S()); - var RplusAh = sig.R().add(key.pub().mul(h)); - return RplusAh.eq(SG); - }; - - EDDSA.prototype.hashInt = function hashInt() { - var hash = this.hash(); - for (var i = 0; i < arguments.length; i++) - hash.update(arguments[i]); - return utils$1.intFromLE(hash.digest()).umod(this.curve.n); - }; - - EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { - return KeyPair.fromPublic(this, pub); - }; - - EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { - return KeyPair.fromSecret(this, secret); - }; - - EDDSA.prototype.makeSignature = function makeSignature(sig) { - if (sig instanceof Signature) - return sig; - return new Signature(this, sig); - }; - - /** - * * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 - * - * EDDSA defines methods for encoding and decoding points and integers. These are - * helper convenience methods, that pass along to utility functions implied - * parameters. - * - */ - EDDSA.prototype.encodePoint = function encodePoint(point) { - var enc = point.getY().toArray('le', this.encodingLength); - enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; - return enc; - }; - - EDDSA.prototype.decodePoint = function decodePoint(bytes) { - bytes = utils$1.parseBytes(bytes); - - var lastIx = bytes.length - 1; - var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); - var xIsOdd = (bytes[lastIx] & 0x80) !== 0; - - var y = utils$1.intFromLE(normed); - return this.curve.pointFromY(y, xIsOdd); - }; - - EDDSA.prototype.encodeInt = function encodeInt(num) { - return num.toArray('le', this.encodingLength); - }; - - EDDSA.prototype.decodeInt = function decodeInt(bytes) { - return utils$1.intFromLE(bytes); - }; - - EDDSA.prototype.isPoint = function isPoint(val) { - return val instanceof this.pointClass; - }; - - (function (exports) { - - var elliptic = exports; - - elliptic.version = require$$0$2.version; - elliptic.utils = utils$n; - elliptic.rand = brorand.exports; - elliptic.curve = curve$1; - elliptic.curves = curves$3; - - // Protocols - elliptic.ec = ec$1; - elliptic.eddsa = eddsa; - }(elliptic$2)); - - const HEX_STRINGS = "0123456789abcdefABCDEF"; - HEX_STRINGS.split("").map((c) => c.codePointAt(0)); - Array(256) - .fill(true) - .map((_, i) => { - const s = String.fromCodePoint(i); - const index = HEX_STRINGS.indexOf(s); - // ABCDEF will use 10 - 15 - return index < 0 ? undefined : index < 16 ? index : index - 6; - }); - new TextEncoder(); - new TextDecoder("ascii"); - // Same behavior as Buffer.compare() - function compare$j(v1, v2) { - const minLength = Math.min(v1.length, v2.length); - for (let i = 0; i < minLength; ++i) { - if (v1[i] !== v2[i]) { - return v1[i] < v2[i] ? -1 : 1; - } - } - return v1.length === v2.length ? 0 : v1.length > v2.length ? 1 : -1; - } - - const ERROR_BAD_PRIVATE = 0; - const ERROR_BAD_POINT = 1; - const ERROR_BAD_TWEAK = 2; - const ERROR_BAD_HASH = 3; - const ERROR_BAD_SIGNATURE = 4; - const ERROR_BAD_EXTRA_DATA = 5; - const ERROR_BAD_PARITY = 6; - const ERROR_BAD_RECOVERY_ID = 7; - const ERRORS_MESSAGES = { - [ERROR_BAD_PRIVATE.toString()]: "Expected Private", - [ERROR_BAD_POINT.toString()]: "Expected Point", - [ERROR_BAD_TWEAK.toString()]: "Expected Tweak", - [ERROR_BAD_HASH.toString()]: "Expected Hash", - [ERROR_BAD_SIGNATURE.toString()]: "Expected Signature", - [ERROR_BAD_EXTRA_DATA.toString()]: "Expected Extra Data (32 bytes)", - [ERROR_BAD_PARITY.toString()]: "Expected Parity (1 | 0)", - [ERROR_BAD_RECOVERY_ID.toString()]: "Bad Recovery Id", - }; - function throwError(errcode) { - const message = ERRORS_MESSAGES[errcode.toString()] || `Unknow error code: ${errcode}`; - throw new TypeError(message); - } - - var validate_error = /*#__PURE__*/Object.freeze({ - __proto__: null, - ERROR_BAD_PRIVATE: ERROR_BAD_PRIVATE, - ERROR_BAD_POINT: ERROR_BAD_POINT, - ERROR_BAD_TWEAK: ERROR_BAD_TWEAK, - ERROR_BAD_HASH: ERROR_BAD_HASH, - ERROR_BAD_SIGNATURE: ERROR_BAD_SIGNATURE, - ERROR_BAD_EXTRA_DATA: ERROR_BAD_EXTRA_DATA, - ERROR_BAD_PARITY: ERROR_BAD_PARITY, - ERROR_BAD_RECOVERY_ID: ERROR_BAD_RECOVERY_ID, - throwError: throwError - }); - - const PRIVATE_KEY_SIZE = 32; - const PUBLIC_KEY_COMPRESSED_SIZE = 33; - const PUBLIC_KEY_UNCOMPRESSED_SIZE = 65; - const X_ONLY_PUBLIC_KEY_SIZE = 32; - const TWEAK_SIZE = 32; - const HASH_SIZE = 32; - const EXTRA_DATA_SIZE = 32; - const SIGNATURE_SIZE = 64; - const BN32_ZERO = new Uint8Array(32); - const BN32_N = new Uint8Array([ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 254, 186, 174, 220, 230, 175, 72, 160, 59, 191, 210, 94, 140, 208, 54, 65, 65, - ]); - // Difference between field and order - const BN32_P_MINUS_N = new Uint8Array([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 69, 81, 35, 25, 80, 183, 95, - 196, 64, 45, 161, 114, 47, 201, 186, 238, - ]); - function isUint8Array(value) { - return value instanceof Uint8Array; - } - function cmpBN32(data1, data2) { - for (let i = 0; i < 32; ++i) { - if (data1[i] !== data2[i]) { - return data1[i] < data2[i] ? -1 : 1; - } - } - return 0; - } - function isZero(x) { - return cmpBN32(x, BN32_ZERO) === 0; - } - function isPrivate$1(x) { - return (isUint8Array(x) && - x.length === PRIVATE_KEY_SIZE && - cmpBN32(x, BN32_ZERO) > 0 && - cmpBN32(x, BN32_N) < 0); - } - function isPoint$1(p) { - return (isUint8Array(p) && - (p.length === PUBLIC_KEY_COMPRESSED_SIZE || - p.length === PUBLIC_KEY_UNCOMPRESSED_SIZE || - p.length === X_ONLY_PUBLIC_KEY_SIZE)); - } - function isXOnlyPoint$1(p) { - return isUint8Array(p) && p.length === X_ONLY_PUBLIC_KEY_SIZE; - } - function isDERPoint(p) { - return (isUint8Array(p) && - (p.length === PUBLIC_KEY_COMPRESSED_SIZE || - p.length === PUBLIC_KEY_UNCOMPRESSED_SIZE)); - } - function isPointCompressed$1(p) { - return isUint8Array(p) && p.length === PUBLIC_KEY_COMPRESSED_SIZE; - } - function isTweak(tweak) { - return (isUint8Array(tweak) && - tweak.length === TWEAK_SIZE && - cmpBN32(tweak, BN32_N) < 0); - } - function isHash(h) { - return isUint8Array(h) && h.length === HASH_SIZE; - } - function isExtraData(e) { - return e === undefined || (isUint8Array(e) && e.length === EXTRA_DATA_SIZE); - } - function isSignature(signature) { - return (isUint8Array(signature) && - signature.length === 64 && - cmpBN32(signature.subarray(0, 32), BN32_N) < 0 && - cmpBN32(signature.subarray(32, 64), BN32_N) < 0); - } - function isSigrLessThanPMinusN(signature) { - return (isUint8Array(signature) && - signature.length === 64 && - cmpBN32(signature.subarray(0, 32), BN32_P_MINUS_N) < 0); - } - function validateParity(p) { - if (p !== 0 && p !== 1) - throwError(ERROR_BAD_PARITY); - } - function validatePrivate(d) { - if (!isPrivate$1(d)) - throwError(ERROR_BAD_PRIVATE); - } - function validatePoint(p) { - if (!isPoint$1(p)) - throwError(ERROR_BAD_POINT); - } - function validateXOnlyPoint(p) { - if (!isXOnlyPoint$1(p)) - throwError(ERROR_BAD_POINT); - } - function validateTweak(tweak) { - if (!isTweak(tweak)) - throwError(ERROR_BAD_TWEAK); - } - function validateHash(h) { - if (!isHash(h)) - throwError(ERROR_BAD_HASH); - } - function validateExtraData(e) { - if (!isExtraData(e)) - throwError(ERROR_BAD_EXTRA_DATA); - } - function validateSignature$1(signature) { - if (!isSignature(signature)) - throwError(ERROR_BAD_SIGNATURE); - } - function validateSignatureCustom(validatorFn) { - if (!validatorFn()) - throwError(ERROR_BAD_SIGNATURE); - } - function validateSignatureNonzeroRS(signature) { - if (isZero(signature.subarray(0, 32))) - throwError(ERROR_BAD_SIGNATURE); - if (isZero(signature.subarray(32, 64))) - throwError(ERROR_BAD_SIGNATURE); - } - function validateSigrPMinusN(signature) { - if (!isSigrLessThanPMinusN(signature)) - throwError(ERROR_BAD_RECOVERY_ID); - } - - function path$f(wasmFilename) { - const url = new require$$4$1.URL(wasmFilename, (document.currentScript && document.currentScript.src || new URL('fabric.http.js', document.baseURI).href)); - return require$$4$1.fileURLToPath(url); - } - - function generateInt32() { - return require$$0$4.randomBytes(4).readInt32BE(0); - } - - var rand = /*#__PURE__*/Object.freeze({ - __proto__: null, - generateInt32: generateInt32 - }); - - const binary$5 = require$$0$5.readFileSync(path$f("secp256k1.wasm")); - const imports = { - "./rand.js": rand, - "./validate_error.js": validate_error, - }; - const mod$1 = new WebAssembly.Module(binary$5); - const instance = new WebAssembly.Instance(mod$1, imports); - var wasm = instance.exports; - - const WASM_BUFFER = new Uint8Array(wasm.memory.buffer); - const WASM_PRIVATE_KEY_PTR = wasm.PRIVATE_INPUT.value; - const WASM_PUBLIC_KEY_INPUT_PTR = wasm.PUBLIC_KEY_INPUT.value; - const WASM_PUBLIC_KEY_INPUT_PTR2 = wasm.PUBLIC_KEY_INPUT2.value; - const WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR = wasm.X_ONLY_PUBLIC_KEY_INPUT.value; - const WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR = wasm.X_ONLY_PUBLIC_KEY_INPUT2.value; - const WASM_TWEAK_INPUT_PTR = wasm.TWEAK_INPUT.value; - const WASM_HASH_INPUT_PTR = wasm.HASH_INPUT.value; - const WASM_EXTRA_DATA_INPUT_PTR = wasm.EXTRA_DATA_INPUT.value; - const WASM_SIGNATURE_INPUT_PTR = wasm.SIGNATURE_INPUT.value; - const PRIVATE_KEY_INPUT = WASM_BUFFER.subarray(WASM_PRIVATE_KEY_PTR, WASM_PRIVATE_KEY_PTR + PRIVATE_KEY_SIZE); - const PUBLIC_KEY_INPUT = WASM_BUFFER.subarray(WASM_PUBLIC_KEY_INPUT_PTR, WASM_PUBLIC_KEY_INPUT_PTR + PUBLIC_KEY_UNCOMPRESSED_SIZE); - const PUBLIC_KEY_INPUT2 = WASM_BUFFER.subarray(WASM_PUBLIC_KEY_INPUT_PTR2, WASM_PUBLIC_KEY_INPUT_PTR2 + PUBLIC_KEY_UNCOMPRESSED_SIZE); - const X_ONLY_PUBLIC_KEY_INPUT = WASM_BUFFER.subarray(WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR, WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR + X_ONLY_PUBLIC_KEY_SIZE); - const X_ONLY_PUBLIC_KEY_INPUT2 = WASM_BUFFER.subarray(WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR, WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR + X_ONLY_PUBLIC_KEY_SIZE); - const TWEAK_INPUT = WASM_BUFFER.subarray(WASM_TWEAK_INPUT_PTR, WASM_TWEAK_INPUT_PTR + TWEAK_SIZE); - const HASH_INPUT = WASM_BUFFER.subarray(WASM_HASH_INPUT_PTR, WASM_HASH_INPUT_PTR + HASH_SIZE); - const EXTRA_DATA_INPUT = WASM_BUFFER.subarray(WASM_EXTRA_DATA_INPUT_PTR, WASM_EXTRA_DATA_INPUT_PTR + EXTRA_DATA_SIZE); - const SIGNATURE_INPUT = WASM_BUFFER.subarray(WASM_SIGNATURE_INPUT_PTR, WASM_SIGNATURE_INPUT_PTR + SIGNATURE_SIZE); - function assumeCompression(compressed, p) { - if (compressed === undefined) { - return p !== undefined ? p.length : PUBLIC_KEY_COMPRESSED_SIZE; - } - return compressed - ? PUBLIC_KEY_COMPRESSED_SIZE - : PUBLIC_KEY_UNCOMPRESSED_SIZE; - } - function _isPoint(p) { - try { - PUBLIC_KEY_INPUT.set(p); - return wasm.isPoint(p.length) === 1; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - } - } - function __initializeContext() { - wasm.initializeContext(); - } - function isPoint(p) { - return isDERPoint(p) && _isPoint(p); - } - function isPointCompressed(p) { - return isPointCompressed$1(p) && _isPoint(p); - } - function isXOnlyPoint(p) { - return isXOnlyPoint$1(p) && _isPoint(p); - } - function isPrivate(d) { - return isPrivate$1(d); - } - function pointAdd(pA, pB, compressed) { - validatePoint(pA); - validatePoint(pB); - const outputlen = assumeCompression(compressed, pA); - try { - PUBLIC_KEY_INPUT.set(pA); - PUBLIC_KEY_INPUT2.set(pB); - return wasm.pointAdd(pA.length, pB.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - PUBLIC_KEY_INPUT2.fill(0); - } - } - function pointAddScalar(p, tweak, compressed) { - validatePoint(p); - validateTweak(tweak); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - return wasm.pointAddScalar(p.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } - } - function pointCompress(p, compressed) { - validatePoint(p); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - wasm.pointCompress(p.length, outputlen); - return PUBLIC_KEY_INPUT.slice(0, outputlen); - } - finally { - PUBLIC_KEY_INPUT.fill(0); - } - } - function pointFromScalar(d, compressed) { - validatePrivate(d); - const outputlen = assumeCompression(compressed); - try { - PRIVATE_KEY_INPUT.set(d); - return wasm.pointFromScalar(outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - } - } - function xOnlyPointFromScalar(d) { - validatePrivate(d); - try { - PRIVATE_KEY_INPUT.set(d); - wasm.xOnlyPointFromScalar(); - return X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - } - finally { - PRIVATE_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - } - } - function xOnlyPointFromPoint(p) { - validatePoint(p); - try { - PUBLIC_KEY_INPUT.set(p); - wasm.xOnlyPointFromPoint(p.length); - return X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - } - finally { - PUBLIC_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - } - } - function pointMultiply(p, tweak, compressed) { - validatePoint(p); - validateTweak(tweak); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - return wasm.pointMultiply(p.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } - } - function privateAdd(d, tweak) { - validatePrivate(d); - validateTweak(tweak); - try { - PRIVATE_KEY_INPUT.set(d); - TWEAK_INPUT.set(tweak); - return wasm.privateAdd() === 1 - ? PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } - } - function privateSub(d, tweak) { - validatePrivate(d); - validateTweak(tweak); - // We can not pass zero tweak to WASM, because WASM use `secp256k1_ec_seckey_negate` for tweak negate. - // (zero is not valid seckey) - if (isZero(tweak)) { - return new Uint8Array(d); - } - try { - PRIVATE_KEY_INPUT.set(d); - TWEAK_INPUT.set(tweak); - return wasm.privateSub() === 1 - ? PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } - } - function privateNegate(d) { - validatePrivate(d); - try { - PRIVATE_KEY_INPUT.set(d); - wasm.privateNegate(); - return PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE); - } - finally { - PRIVATE_KEY_INPUT.fill(0); - } - } - function xOnlyPointAddTweak(p, tweak) { - validateXOnlyPoint(p); - validateTweak(tweak); - try { - X_ONLY_PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - const parity = wasm.xOnlyPointAddTweak(); - return parity !== -1 - ? { - parity, - xOnlyPubkey: X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE), - } - : null; - } - finally { - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } - } - function xOnlyPointAddTweakCheck(point, tweak, resultToCheck, tweakParity) { - validateXOnlyPoint(point); - validateXOnlyPoint(resultToCheck); - validateTweak(tweak); - const hasParity = tweakParity !== undefined; - if (hasParity) - validateParity(tweakParity); - try { - X_ONLY_PUBLIC_KEY_INPUT.set(point); - X_ONLY_PUBLIC_KEY_INPUT2.set(resultToCheck); - TWEAK_INPUT.set(tweak); - if (hasParity) { - return wasm.xOnlyPointAddTweakCheck(tweakParity) === 1; - } - else { - wasm.xOnlyPointAddTweak(); - const newKey = X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - return compare$j(newKey, resultToCheck) === 0; - } - } - finally { - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT2.fill(0); - TWEAK_INPUT.fill(0); - } - } - function sign$1(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - wasm.sign(e === undefined ? 0 : 1); - return SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } - } - function signRecoverable$1(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - const recoveryId = wasm.signRecoverable(e === undefined ? 0 : 1); - const signature = SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - return { - signature, - recoveryId, - }; - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } - } - function signSchnorr(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - wasm.signSchnorr(e === undefined ? 0 : 1); - return SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } - } - function verify$1(h, Q, signature, strict = false) { - validateHash(h); - validatePoint(Q); - validateSignature$1(signature); - try { - HASH_INPUT.set(h); - PUBLIC_KEY_INPUT.set(Q); - SIGNATURE_INPUT.set(signature); - return wasm.verify(Q.length, strict === true ? 1 : 0) === 1 ? true : false; - } - finally { - HASH_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } - } - function recover$1(h, signature, recoveryId, compressed = false) { - validateHash(h); - validateSignature$1(signature); - validateSignatureNonzeroRS(signature); - if (recoveryId & 2) { - validateSigrPMinusN(signature); - } - validateSignatureCustom(() => isXOnlyPoint(signature.subarray(0, 32))); - const outputlen = assumeCompression(compressed); - try { - HASH_INPUT.set(h); - SIGNATURE_INPUT.set(signature); - return wasm.recover(outputlen, recoveryId) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - HASH_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - } - } - function verifySchnorr(h, Q, signature) { - validateHash(h); - validateXOnlyPoint(Q); - validateSignature$1(signature); - try { - HASH_INPUT.set(h); - X_ONLY_PUBLIC_KEY_INPUT.set(Q); - SIGNATURE_INPUT.set(signature); - return wasm.verifySchnorr() === 1 ? true : false; - } - finally { - HASH_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } - } - - var lib = /*#__PURE__*/Object.freeze({ - __proto__: null, - __initializeContext: __initializeContext, - isPoint: isPoint, - isPointCompressed: isPointCompressed, - isXOnlyPoint: isXOnlyPoint, - isPrivate: isPrivate, - pointAdd: pointAdd, - pointAddScalar: pointAddScalar, - pointCompress: pointCompress, - pointFromScalar: pointFromScalar, - xOnlyPointFromScalar: xOnlyPointFromScalar, - xOnlyPointFromPoint: xOnlyPointFromPoint, - pointMultiply: pointMultiply, - privateAdd: privateAdd, - privateSub: privateSub, - privateNegate: privateNegate, - xOnlyPointAddTweak: xOnlyPointAddTweak, - xOnlyPointAddTweakCheck: xOnlyPointAddTweakCheck, - sign: sign$1, - signRecoverable: signRecoverable$1, - signSchnorr: signSchnorr, - verify: verify$1, - recover: recover$1, - verifySchnorr: verifySchnorr - }); - - var require$$5 = /*@__PURE__*/getAugmentedNamespace(lib); - - var src$3 = {}; - - var bip32$1 = {}; - - var crypto$h = {}; - - var createHash$3 = require$$0__default["default"].createHash; - - var createHmac$2 = require$$0__default["default"].createHmac; - - Object.defineProperty(crypto$h, "__esModule", { value: true }); - const createHash$2 = createHash$3; - const createHmac$1 = createHmac$2; - function hash160$a(buffer) { - const sha256Hash = createHash$2('sha256') - .update(buffer) - .digest(); - try { - return createHash$2('rmd160') - .update(sha256Hash) - .digest(); - } - catch (err) { - return createHash$2('ripemd160') - .update(sha256Hash) - .digest(); - } - } - crypto$h.hash160 = hash160$a; - function hmacSHA512(key, data) { - return createHmac$1('sha512', key) - .update(data) - .digest(); - } - crypto$h.hmacSHA512 = hmacSHA512; - - var testecc = {}; - - Object.defineProperty(testecc, "__esModule", { value: true }); - const h = (hex) => Buffer.from(hex, 'hex'); - function testEcc(ecc) { - assert$2Z(ecc.isPoint(h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))); - assert$2Z(!ecc.isPoint(h('030000000000000000000000000000000000000000000000000000000000000005'))); - assert$2Z(ecc.isPrivate(h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))); - // order - 1 - assert$2Z(ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))); - // 0 - assert$2Z(!ecc.isPrivate(h('0000000000000000000000000000000000000000000000000000000000000000'))); - // order - assert$2Z(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'))); - // order + 1 - assert$2Z(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142'))); - assert$2Z(Buffer.from(ecc.pointFromScalar(h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'))).equals(h('02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99'))); - assert$2Z(Buffer.from(ecc.pointAddScalar(h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('0000000000000000000000000000000000000000000000000000000000000003'))).equals(h('02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5'))); - assert$2Z(Buffer.from(ecc.privateAdd(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'), h('0000000000000000000000000000000000000000000000000000000000000002'))).equals(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))); - assert$2Z(Buffer.from(ecc.sign(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))).equals(h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5'))); - assert$2Z(ecc.verify(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5'))); - if (ecc.signSchnorr) { - assert$2Z(Buffer.from(ecc.signSchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9'), h('c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906'))).equals(h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7'))); - } - if (ecc.verifySchnorr) { - assert$2Z(ecc.verifySchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8'), h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7'))); - } - } - testecc.testEcc = testEcc; - function assert$2Z(bool) { - if (!bool) - throw new Error('ecc library invalid'); - } - - var safeBuffer = {exports: {}}; - - /*! safe-buffer. MIT License. Feross Aboukhadijeh */ - - (function (module, exports) { - /* eslint-disable node/no-deprecated-api */ - var buffer = require$$0__default$2["default"]; - var Buffer = buffer.Buffer; - - // alternative to using Object.keys for old browsers - function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer; - } else { - // Copy properties from require('buffer') - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; - } - - function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) - } - - SafeBuffer.prototype = Object.create(Buffer.prototype); - - // Copy static methods from Buffer - copyProps(Buffer, SafeBuffer); - - SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) - }; - - SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size); - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf - }; - - SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) - }; - - SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) - }; - }(safeBuffer, safeBuffer.exports)); - - // base-x encoding / decoding - // Copyright (c) 2018 base-x contributors - // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) - // Distributed under the MIT software license, see the accompanying - // file LICENSE or http://www.opensource.org/licenses/mit-license.php. - // @ts-ignore - var _Buffer$1 = safeBuffer.exports.Buffer; - function base$1 (ALPHABET) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer$1.from(source); } - if (!_Buffer$1.isBuffer(source)) { throw new TypeError('Expected Buffer') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return _Buffer$1.alloc(0) } - var psz = 0; - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = _Buffer$1.allocUnsafe(zeroes + (size - it4)); - vch.fill(0x00, 0, zeroes); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error('Non-base' + BASE + ' character') - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } - } - var src$2 = base$1; - - var basex = src$2; - var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - var bs58 = basex(ALPHABET); - - var base58$a = bs58; - var Buffer$4 = safeBuffer.exports.Buffer; - - var base = function (checksumFn) { - // Encode a buffer as a base58-check encoded string - function encode (payload) { - var checksum = checksumFn(payload); - - return base58$a.encode(Buffer$4.concat([ - payload, - checksum - ], payload.length + 4)) - } - - function decodeRaw (buffer) { - var payload = buffer.slice(0, -4); - var checksum = buffer.slice(-4); - var newChecksum = checksumFn(payload); - - if (checksum[0] ^ newChecksum[0] | - checksum[1] ^ newChecksum[1] | - checksum[2] ^ newChecksum[2] | - checksum[3] ^ newChecksum[3]) return - - return payload - } - - // Decode a base58-check encoded string to a buffer, no result if checksum is wrong - function decodeUnsafe (string) { - var buffer = base58$a.decodeUnsafe(string); - if (!buffer) return - - return decodeRaw(buffer) - } - - function decode (string) { - var buffer = base58$a.decode(string); - var payload = decodeRaw(buffer); - if (!payload) throw new Error('Invalid checksum') - return payload - } - - return { - encode: encode, - decode: decode, - decodeUnsafe: decodeUnsafe - } - }; - - var createHash$1 = createHash$3; - var bs58checkBase = base; - - // SHA256(SHA256(buffer)) - function sha256x2 (buffer) { - var tmp = createHash$1('sha256').update(buffer).digest(); - return createHash$1('sha256').update(tmp).digest() - } - - var bs58check$2 = bs58checkBase(sha256x2); - - var types$e = { - Array: function (value) { return value !== null && value !== undefined && value.constructor === Array }, - Boolean: function (value) { return typeof value === 'boolean' }, - Function: function (value) { return typeof value === 'function' }, - Nil: function (value) { return value === undefined || value === null }, - Number: function (value) { return typeof value === 'number' }, - Object: function (value) { return typeof value === 'object' }, - String: function (value) { return typeof value === 'string' }, - '': function () { return true } - }; - - // TODO: deprecate - types$e.Null = types$e.Nil; - - for (var typeName$2 in types$e) { - types$e[typeName$2].toJSON = function (t) { - return t - }.bind(null, typeName$2); - } - - var native$2 = types$e; - - var native$1 = native$2; - - function getTypeName (fn) { - return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1] - } - - function getValueTypeName$1 (value) { - return native$1.Nil(value) ? '' : getTypeName(value.constructor) - } - - function getValue (value) { - if (native$1.Function(value)) return '' - if (native$1.String(value)) return JSON.stringify(value) - if (value && native$1.Object(value)) return '' - return value - } - - function captureStackTrace (e, t) { - if (Error.captureStackTrace) { - Error.captureStackTrace(e, t); - } - } - - function tfJSON$1 (type) { - if (native$1.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type) - if (native$1.Array(type)) return 'Array' - if (type && native$1.Object(type)) return 'Object' - - return type !== undefined ? type : '' - } - - function tfErrorString (type, value, valueTypeName) { - var valueJson = getValue(value); - - return 'Expected ' + tfJSON$1(type) + ', got' + - (valueTypeName !== '' ? ' ' + valueTypeName : '') + - (valueJson !== '' ? ' ' + valueJson : '') - } - - function TfTypeError$1 (type, value, valueTypeName) { - valueTypeName = valueTypeName || getValueTypeName$1(value); - this.message = tfErrorString(type, value, valueTypeName); - - captureStackTrace(this, TfTypeError$1); - this.__type = type; - this.__value = value; - this.__valueTypeName = valueTypeName; - } - - TfTypeError$1.prototype = Object.create(Error.prototype); - TfTypeError$1.prototype.constructor = TfTypeError$1; - - function tfPropertyErrorString (type, label, name, value, valueTypeName) { - var description = '" of type '; - if (label === 'key') description = '" with key type '; - - return tfErrorString('property "' + tfJSON$1(name) + description + tfJSON$1(type), value, valueTypeName) - } - - function TfPropertyTypeError$1 (type, property, label, value, valueTypeName) { - if (type) { - valueTypeName = valueTypeName || getValueTypeName$1(value); - this.message = tfPropertyErrorString(type, label, property, value, valueTypeName); - } else { - this.message = 'Unexpected property "' + property + '"'; - } - - captureStackTrace(this, TfTypeError$1); - this.__label = label; - this.__property = property; - this.__type = type; - this.__value = value; - this.__valueTypeName = valueTypeName; - } - - TfPropertyTypeError$1.prototype = Object.create(Error.prototype); - TfPropertyTypeError$1.prototype.constructor = TfTypeError$1; - - function tfCustomError (expected, actual) { - return new TfTypeError$1(expected, {}, actual) - } - - function tfSubError$1 (e, property, label) { - // sub child? - if (e instanceof TfPropertyTypeError$1) { - property = property + '.' + e.__property; - - e = new TfPropertyTypeError$1( - e.__type, property, e.__label, e.__value, e.__valueTypeName - ); - - // child? - } else if (e instanceof TfTypeError$1) { - e = new TfPropertyTypeError$1( - e.__type, property, label, e.__value, e.__valueTypeName - ); - } - - captureStackTrace(e); - return e - } - - var errors$3 = { - TfTypeError: TfTypeError$1, - TfPropertyTypeError: TfPropertyTypeError$1, - tfCustomError: tfCustomError, - tfSubError: tfSubError$1, - tfJSON: tfJSON$1, - getValueTypeName: getValueTypeName$1 - }; - - var NATIVE$1 = native$2; - var ERRORS$1 = errors$3; - - function _Buffer (value) { - return Buffer.isBuffer(value) - } - - function Hex (value) { - return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value) - } - - function _LengthN (type, length) { - var name = type.toJSON(); - - function Length (value) { - if (!type(value)) return false - if (value.length === length) return true - - throw ERRORS$1.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')') - } - Length.toJSON = function () { return name }; - - return Length - } - - var _ArrayN = _LengthN.bind(null, NATIVE$1.Array); - var _BufferN = _LengthN.bind(null, _Buffer); - var _HexN = _LengthN.bind(null, Hex); - var _StringN = _LengthN.bind(null, NATIVE$1.String); - - function Range (a, b, f) { - f = f || NATIVE$1.Number; - function _range (value, strict) { - return f(value, strict) && (value > a) && (value < b) - } - _range.toJSON = function () { - return `${f.toJSON()} between [${a}, ${b}]` - }; - return _range - } - - var INT53_MAX = Math.pow(2, 53) - 1; - - function Finite (value) { - return typeof value === 'number' && isFinite(value) - } - function Int8 (value) { return ((value << 24) >> 24) === value } - function Int16 (value) { return ((value << 16) >> 16) === value } - function Int32 (value) { return (value | 0) === value } - function Int53 (value) { - return typeof value === 'number' && - value >= -INT53_MAX && - value <= INT53_MAX && - Math.floor(value) === value - } - function UInt8 (value) { return (value & 0xff) === value } - function UInt16 (value) { return (value & 0xffff) === value } - function UInt32 (value) { return (value >>> 0) === value } - function UInt53 (value) { - return typeof value === 'number' && - value >= 0 && - value <= INT53_MAX && - Math.floor(value) === value - } - - var types$d = { - ArrayN: _ArrayN, - Buffer: _Buffer, - BufferN: _BufferN, - Finite: Finite, - Hex: Hex, - HexN: _HexN, - Int8: Int8, - Int16: Int16, - Int32: Int32, - Int53: Int53, - Range: Range, - StringN: _StringN, - UInt8: UInt8, - UInt16: UInt16, - UInt32: UInt32, - UInt53: UInt53 - }; - - for (var typeName$1 in types$d) { - types$d[typeName$1].toJSON = function (t) { - return t - }.bind(null, typeName$1); - } - - var extra$2 = types$d; - - var ERRORS = errors$3; - var NATIVE = native$2; - - // short-hand - var tfJSON = ERRORS.tfJSON; - var TfTypeError = ERRORS.TfTypeError; - var TfPropertyTypeError = ERRORS.TfPropertyTypeError; - var tfSubError = ERRORS.tfSubError; - var getValueTypeName = ERRORS.getValueTypeName; - - var TYPES = { - arrayOf: function arrayOf (type, options) { - type = compile$3(type); - options = options || {}; - - function _arrayOf (array, strict) { - if (!NATIVE.Array(array)) return false - if (NATIVE.Nil(array)) return false - if (options.minLength !== undefined && array.length < options.minLength) return false - if (options.maxLength !== undefined && array.length > options.maxLength) return false - if (options.length !== undefined && array.length !== options.length) return false - - return array.every(function (value, i) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - throw tfSubError(e, i) - } - }) - } - _arrayOf.toJSON = function () { - var str = '[' + tfJSON(type) + ']'; - if (options.length !== undefined) { - str += '{' + options.length + '}'; - } else if (options.minLength !== undefined || options.maxLength !== undefined) { - str += '{' + - (options.minLength === undefined ? 0 : options.minLength) + ',' + - (options.maxLength === undefined ? Infinity : options.maxLength) + '}'; - } - return str - }; - - return _arrayOf - }, - - maybe: function maybe (type) { - type = compile$3(type); - - function _maybe (value, strict) { - return NATIVE.Nil(value) || type(value, strict, maybe) - } - _maybe.toJSON = function () { return '?' + tfJSON(type) }; - - return _maybe - }, - - map: function map (propertyType, propertyKeyType) { - propertyType = compile$3(propertyType); - if (propertyKeyType) propertyKeyType = compile$3(propertyKeyType); - - function _map (value, strict) { - if (!NATIVE.Object(value)) return false - if (NATIVE.Nil(value)) return false - - for (var propertyName in value) { - try { - if (propertyKeyType) { - typeforce$1(propertyKeyType, propertyName, strict); - } - } catch (e) { - throw tfSubError(e, propertyName, 'key') - } - - try { - var propertyValue = value[propertyName]; - typeforce$1(propertyType, propertyValue, strict); - } catch (e) { - throw tfSubError(e, propertyName) - } - } - - return true - } - - if (propertyKeyType) { - _map.toJSON = function () { - return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}' - }; - } else { - _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }; - } - - return _map - }, - - object: function object (uncompiled) { - var type = {}; - - for (var typePropertyName in uncompiled) { - type[typePropertyName] = compile$3(uncompiled[typePropertyName]); - } - - function _object (value, strict) { - if (!NATIVE.Object(value)) return false - if (NATIVE.Nil(value)) return false - - var propertyName; - - try { - for (propertyName in type) { - var propertyType = type[propertyName]; - var propertyValue = value[propertyName]; - - typeforce$1(propertyType, propertyValue, strict); - } - } catch (e) { - throw tfSubError(e, propertyName) - } - - if (strict) { - for (propertyName in value) { - if (type[propertyName]) continue - - throw new TfPropertyTypeError(undefined, propertyName) - } - } - - return true - } - _object.toJSON = function () { return tfJSON(type) }; - - return _object - }, - - anyOf: function anyOf () { - var types = [].slice.call(arguments).map(compile$3); - - function _anyOf (value, strict) { - return types.some(function (type) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - return false - } - }) - } - _anyOf.toJSON = function () { return types.map(tfJSON).join('|') }; - - return _anyOf - }, - - allOf: function allOf () { - var types = [].slice.call(arguments).map(compile$3); - - function _allOf (value, strict) { - return types.every(function (type) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - return false - } - }) - } - _allOf.toJSON = function () { return types.map(tfJSON).join(' & ') }; - - return _allOf - }, - - quacksLike: function quacksLike (type) { - function _quacksLike (value) { - return type === getValueTypeName(value) - } - _quacksLike.toJSON = function () { return type }; - - return _quacksLike - }, - - tuple: function tuple () { - var types = [].slice.call(arguments).map(compile$3); - - function _tuple (values, strict) { - if (NATIVE.Nil(values)) return false - if (NATIVE.Nil(values.length)) return false - if (strict && (values.length !== types.length)) return false - - return types.every(function (type, i) { - try { - return typeforce$1(type, values[i], strict) - } catch (e) { - throw tfSubError(e, i) - } - }) - } - _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }; - - return _tuple - }, - - value: function value (expected) { - function _value (actual) { - return actual === expected - } - _value.toJSON = function () { return expected }; - - return _value - } - }; - - // TODO: deprecate - TYPES.oneOf = TYPES.anyOf; - - function compile$3 (type) { - if (NATIVE.String(type)) { - if (type[0] === '?') return TYPES.maybe(type.slice(1)) - - return NATIVE[type] || TYPES.quacksLike(type) - } else if (type && NATIVE.Object(type)) { - if (NATIVE.Array(type)) { - if (type.length !== 1) throw new TypeError('Expected compile() parameter of type Array of length 1') - return TYPES.arrayOf(type[0]) - } - - return TYPES.object(type) - } else if (NATIVE.Function(type)) { - return type - } - - return TYPES.value(type) - } - - function typeforce$1 (type, value, strict, surrogate) { - if (NATIVE.Function(type)) { - if (type(value, strict)) return true - - throw new TfTypeError(surrogate || type, value) - } - - // JIT - return typeforce$1(compile$3(type), value, strict) - } - - // assign types to typeforce function - for (var typeName in NATIVE) { - typeforce$1[typeName] = NATIVE[typeName]; - } - - for (typeName in TYPES) { - typeforce$1[typeName] = TYPES[typeName]; - } - - var EXTRA = extra$2; - for (typeName in EXTRA) { - typeforce$1[typeName] = EXTRA[typeName]; - } - - typeforce$1.compile = compile$3; - typeforce$1.TfTypeError = TfTypeError; - typeforce$1.TfPropertyTypeError = TfPropertyTypeError; - - var typeforce_1 = typeforce$1; - - var bs58check$1 = bs58check$2; - - function decodeRaw (buffer, version) { - // check version only if defined - if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version') - - // uncompressed - if (buffer.length === 33) { - return { - version: buffer[0], - privateKey: buffer.slice(1, 33), - compressed: false - } - } - - // invalid length - if (buffer.length !== 34) throw new Error('Invalid WIF length') - - // invalid compression flag - if (buffer[33] !== 0x01) throw new Error('Invalid compression flag') - - return { - version: buffer[0], - privateKey: buffer.slice(1, 33), - compressed: true - } - } - - function encodeRaw (version, privateKey, compressed) { - var result = new Buffer(compressed ? 34 : 33); - - result.writeUInt8(version, 0); - privateKey.copy(result, 1); - - if (compressed) { - result[33] = 0x01; - } - - return result - } - - function decode$5 (string, version) { - return decodeRaw(bs58check$1.decode(string), version) - } - - function encode$6 (version, privateKey, compressed) { - if (typeof version === 'number') return bs58check$1.encode(encodeRaw(version, privateKey, compressed)) - - return bs58check$1.encode( - encodeRaw( - version.version, - version.privateKey, - version.compressed - ) - ) - } - - var wif$1 = { - decode: decode$5, - decodeRaw: decodeRaw, - encode: encode$6, - encodeRaw: encodeRaw - }; - - Object.defineProperty(bip32$1, "__esModule", { value: true }); - const crypto$g = crypto$h; - const testecc_1 = testecc; - const bs58check = bs58check$2; - const typeforce = typeforce_1; - const wif = wif$1; - function BIP32Factory(ecc) { - testecc_1.testEcc(ecc); - const UINT256_TYPE = typeforce.BufferN(32); - const NETWORK_TYPE = typeforce.compile({ - wif: typeforce.UInt8, - bip32: { - public: typeforce.UInt32, - private: typeforce.UInt32, - }, - }); - const BITCOIN = { - messagePrefix: '\x18Bitcoin Signed Message:\n', - bech32: 'bc', - bip32: { - public: 0x0488b21e, - private: 0x0488ade4, - }, - pubKeyHash: 0x00, - scriptHash: 0x05, - wif: 0x80, - }; - const HIGHEST_BIT = 0x80000000; - const UINT31_MAX = Math.pow(2, 31) - 1; - function BIP32Path(value) { - return (typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/) !== null); - } - function UInt31(value) { - return typeforce.UInt32(value) && value <= UINT31_MAX; - } - class BIP32 { - constructor(__D, __Q, chainCode, network, __DEPTH = 0, __INDEX = 0, __PARENT_FINGERPRINT = 0x00000000) { - this.__D = __D; - this.__Q = __Q; - this.chainCode = chainCode; - this.network = network; - this.__DEPTH = __DEPTH; - this.__INDEX = __INDEX; - this.__PARENT_FINGERPRINT = __PARENT_FINGERPRINT; - typeforce(NETWORK_TYPE, network); - this.lowR = false; - } - get depth() { - return this.__DEPTH; - } - get index() { - return this.__INDEX; - } - get parentFingerprint() { - return this.__PARENT_FINGERPRINT; - } - get publicKey() { - if (this.__Q === undefined) - this.__Q = Buffer.from(ecc.pointFromScalar(this.__D, true)); - return this.__Q; - } - get privateKey() { - return this.__D; - } - get identifier() { - return crypto$g.hash160(this.publicKey); - } - get fingerprint() { - return this.identifier.slice(0, 4); - } - get compressed() { - return true; - } - // Private === not neutered - // Public === neutered - isNeutered() { - return this.__D === undefined; - } - neutered() { - return fromPublicKeyLocal(this.publicKey, this.chainCode, this.network, this.depth, this.index, this.parentFingerprint); - } - toBase58() { - const network = this.network; - const version = !this.isNeutered() - ? network.bip32.private - : network.bip32.public; - const buffer = Buffer.allocUnsafe(78); - // 4 bytes: version bytes - buffer.writeUInt32BE(version, 0); - // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, .... - buffer.writeUInt8(this.depth, 4); - // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key) - buffer.writeUInt32BE(this.parentFingerprint, 5); - // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized. - // This is encoded in big endian. (0x00000000 if master key) - buffer.writeUInt32BE(this.index, 9); - // 32 bytes: the chain code - this.chainCode.copy(buffer, 13); - // 33 bytes: the public key or private key data - if (!this.isNeutered()) { - // 0x00 + k for private keys - buffer.writeUInt8(0, 45); - this.privateKey.copy(buffer, 46); - // 33 bytes: the public key - } - else { - // X9.62 encoding for public keys - this.publicKey.copy(buffer, 45); - } - return bs58check.encode(buffer); - } - toWIF() { - if (!this.privateKey) - throw new TypeError('Missing private key'); - return wif.encode(this.network.wif, this.privateKey, true); - } - // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions - derive(index) { - typeforce(typeforce.UInt32, index); - const isHardened = index >= HIGHEST_BIT; - const data = Buffer.allocUnsafe(37); - // Hardened child - if (isHardened) { - if (this.isNeutered()) - throw new TypeError('Missing private key for hardened child key'); - // data = 0x00 || ser256(kpar) || ser32(index) - data[0] = 0x00; - this.privateKey.copy(data, 1); - data.writeUInt32BE(index, 33); - // Normal child - } - else { - // data = serP(point(kpar)) || ser32(index) - // = serP(Kpar) || ser32(index) - this.publicKey.copy(data, 0); - data.writeUInt32BE(index, 33); - } - const I = crypto$g.hmacSHA512(this.chainCode, data); - const IL = I.slice(0, 32); - const IR = I.slice(32); - // if parse256(IL) >= n, proceed with the next value for i - if (!ecc.isPrivate(IL)) - return this.derive(index + 1); - // Private parent key -> private child key - let hd; - if (!this.isNeutered()) { - // ki = parse256(IL) + kpar (mod n) - const ki = Buffer.from(ecc.privateAdd(this.privateKey, IL)); - // In case ki == 0, proceed with the next value for i - if (ki == null) - return this.derive(index + 1); - hd = fromPrivateKeyLocal(ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0)); - // Public parent key -> public child key - } - else { - // Ki = point(parse256(IL)) + Kpar - // = G*IL + Kpar - const Ki = Buffer.from(ecc.pointAddScalar(this.publicKey, IL, true)); - // In case Ki is the point at infinity, proceed with the next value for i - if (Ki === null) - return this.derive(index + 1); - hd = fromPublicKeyLocal(Ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0)); - } - return hd; - } - deriveHardened(index) { - typeforce(UInt31, index); - // Only derives hardened private keys by default - return this.derive(index + HIGHEST_BIT); - } - derivePath(path) { - typeforce(BIP32Path, path); - let splitPath = path.split('/'); - if (splitPath[0] === 'm') { - if (this.parentFingerprint) - throw new TypeError('Expected master, got child'); - splitPath = splitPath.slice(1); - } - return splitPath.reduce((prevHd, indexStr) => { - let index; - if (indexStr.slice(-1) === `'`) { - index = parseInt(indexStr.slice(0, -1), 10); - return prevHd.deriveHardened(index); - } - else { - index = parseInt(indexStr, 10); - return prevHd.derive(index); - } - }, this); - } - sign(hash, lowR) { - if (!this.privateKey) - throw new Error('Missing private key'); - if (lowR === undefined) - lowR = this.lowR; - if (lowR === false) { - return Buffer.from(ecc.sign(hash, this.privateKey)); - } - else { - let sig = Buffer.from(ecc.sign(hash, this.privateKey)); - const extraData = Buffer.alloc(32, 0); - let counter = 0; - // if first try is lowR, skip the loop - // for second try and on, add extra entropy counting up - while (sig[0] > 0x7f) { - counter++; - extraData.writeUIntLE(counter, 0, 6); - sig = Buffer.from(ecc.sign(hash, this.privateKey, extraData)); - } - return sig; - } - } - signSchnorr(hash) { - if (!this.privateKey) - throw new Error('Missing private key'); - if (!ecc.signSchnorr) - throw new Error('signSchnorr not supported by ecc library'); - return Buffer.from(ecc.signSchnorr(hash, this.privateKey)); - } - verify(hash, signature) { - return ecc.verify(hash, this.publicKey, signature); - } - verifySchnorr(hash, signature) { - if (!ecc.verifySchnorr) - throw new Error('verifySchnorr not supported by ecc library'); - return ecc.verifySchnorr(hash, this.publicKey.subarray(1, 33), signature); - } - } - function fromBase58(inString, network) { - const buffer = bs58check.decode(inString); - if (buffer.length !== 78) - throw new TypeError('Invalid buffer length'); - network = network || BITCOIN; - // 4 bytes: version bytes - const version = buffer.readUInt32BE(0); - if (version !== network.bip32.private && version !== network.bip32.public) - throw new TypeError('Invalid network version'); - // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ... - const depth = buffer[4]; - // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key) - const parentFingerprint = buffer.readUInt32BE(5); - if (depth === 0) { - if (parentFingerprint !== 0x00000000) - throw new TypeError('Invalid parent fingerprint'); - } - // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized. - // This is encoded in MSB order. (0x00000000 if master key) - const index = buffer.readUInt32BE(9); - if (depth === 0 && index !== 0) - throw new TypeError('Invalid index'); - // 32 bytes: the chain code - const chainCode = buffer.slice(13, 45); - let hd; - // 33 bytes: private key data (0x00 + k) - if (version === network.bip32.private) { - if (buffer.readUInt8(45) !== 0x00) - throw new TypeError('Invalid private key'); - const k = buffer.slice(46, 78); - hd = fromPrivateKeyLocal(k, chainCode, network, depth, index, parentFingerprint); - // 33 bytes: public key data (0x02 + X or 0x03 + X) - } - else { - const X = buffer.slice(45, 78); - hd = fromPublicKeyLocal(X, chainCode, network, depth, index, parentFingerprint); - } - return hd; - } - function fromPrivateKey(privateKey, chainCode, network) { - return fromPrivateKeyLocal(privateKey, chainCode, network); - } - function fromPrivateKeyLocal(privateKey, chainCode, network, depth, index, parentFingerprint) { - typeforce({ - privateKey: UINT256_TYPE, - chainCode: UINT256_TYPE, - }, { privateKey, chainCode }); - network = network || BITCOIN; - if (!ecc.isPrivate(privateKey)) - throw new TypeError('Private key not in range [1, n)'); - return new BIP32(privateKey, undefined, chainCode, network, depth, index, parentFingerprint); - } - function fromPublicKey(publicKey, chainCode, network) { - return fromPublicKeyLocal(publicKey, chainCode, network); - } - function fromPublicKeyLocal(publicKey, chainCode, network, depth, index, parentFingerprint) { - typeforce({ - publicKey: typeforce.BufferN(33), - chainCode: UINT256_TYPE, - }, { publicKey, chainCode }); - network = network || BITCOIN; - // verify the X coordinate is a point on the curve - if (!ecc.isPoint(publicKey)) - throw new TypeError('Point is not on the curve'); - return new BIP32(undefined, publicKey, chainCode, network, depth, index, parentFingerprint); - } - function fromSeed(seed, network) { - typeforce(typeforce.Buffer, seed); - if (seed.length < 16) - throw new TypeError('Seed should be at least 128 bits'); - if (seed.length > 64) - throw new TypeError('Seed should be at most 512 bits'); - network = network || BITCOIN; - const I = crypto$g.hmacSHA512(Buffer.from('Bitcoin seed', 'utf8'), seed); - const IL = I.slice(0, 32); - const IR = I.slice(32); - return fromPrivateKey(IL, IR, network); - } - return { - fromSeed, - fromBase58, - fromPublicKey, - fromPrivateKey, - }; - } - bip32$1.BIP32Factory = BIP32Factory; - - Object.defineProperty(src$3, "__esModule", { value: true }); - var bip32_1 = bip32$1; - src$3.default = bip32_1.BIP32Factory; - src$3.BIP32Factory = bip32_1.BIP32Factory; - - var src$1 = {}; - - var pbkdf2$7 = {}; - - var MAX_ALLOC = Math.pow(2, 30) - 1; // default in iojs - - var precondition = function (iterations, keylen) { - if (typeof iterations !== 'number') { - throw new TypeError('Iterations not a number') - } - - if (iterations < 0) { - throw new TypeError('Bad iterations') - } - - if (typeof keylen !== 'number') { - throw new TypeError('Key length not a number') - } - - if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ - throw new TypeError('Bad key length') - } - }; - - var defaultEncoding$3; - /* istanbul ignore next */ - if (commonjsGlobal.process && commonjsGlobal.process.browser) { - defaultEncoding$3 = 'utf-8'; - } else if (commonjsGlobal.process && commonjsGlobal.process.version) { - var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10); - - defaultEncoding$3 = pVersionMajor >= 6 ? 'utf-8' : 'binary'; - } else { - defaultEncoding$3 = 'utf-8'; - } - var defaultEncoding_1 = defaultEncoding$3; - - var Buffer$3 = safeBuffer.exports.Buffer; - - var toBuffer$8 = function (thing, encoding, name) { - if (Buffer$3.isBuffer(thing)) { - return thing - } else if (typeof thing === 'string') { - return Buffer$3.from(thing, encoding) - } else if (ArrayBuffer.isView(thing)) { - return Buffer$3.from(thing.buffer) - } else { - throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView') - } - }; - - var sizes = { - md5: 16, - sha1: 20, - sha224: 28, - sha256: 32, - sha384: 48, - sha512: 64, - rmd160: 20, - ripemd160: 20 - }; - - var createHmac = createHmac$2; - var Buffer$2 = safeBuffer.exports.Buffer; - - var checkParameters$2 = precondition; - var defaultEncoding$2 = defaultEncoding_1; - var toBuffer$7 = toBuffer$8; - - function pbkdf2$6 (password, salt, iterations, keylen, digest) { - checkParameters$2(iterations, keylen); - password = toBuffer$7(password, defaultEncoding$2, 'Password'); - salt = toBuffer$7(salt, defaultEncoding$2, 'Salt'); - - digest = digest || 'sha1'; - - var DK = Buffer$2.allocUnsafe(keylen); - var block1 = Buffer$2.allocUnsafe(salt.length + 4); - salt.copy(block1, 0, 0, salt.length); - - var destPos = 0; - var hLen = sizes[digest]; - var l = Math.ceil(keylen / hLen); - - for (var i = 1; i <= l; i++) { - block1.writeUInt32BE(i, salt.length); - - var T = createHmac(digest, password).update(block1).digest(); - var U = T; - - for (var j = 1; j < iterations; j++) { - U = createHmac(digest, password).update(U).digest(); - for (var k = 0; k < hLen; k++) T[k] ^= U[k]; - } - - T.copy(DK, destPos); - destPos += hLen; - } - - return DK - } - - var sync$1 = pbkdf2$6; - - var Buffer$1 = safeBuffer.exports.Buffer; - - var checkParameters$1 = precondition; - var defaultEncoding$1 = defaultEncoding_1; - var sync = sync$1; - var toBuffer$6 = toBuffer$8; - - var ZERO_BUF; - var subtle$1 = commonjsGlobal.crypto && commonjsGlobal.crypto.subtle; - var toBrowser = { - sha: 'SHA-1', - 'sha-1': 'SHA-1', - sha1: 'SHA-1', - sha256: 'SHA-256', - 'sha-256': 'SHA-256', - sha384: 'SHA-384', - 'sha-384': 'SHA-384', - 'sha-512': 'SHA-512', - sha512: 'SHA-512' - }; - var checks = []; - function checkNative (algo) { - if (commonjsGlobal.process && !commonjsGlobal.process.browser) { - return Promise.resolve(false) - } - if (!subtle$1 || !subtle$1.importKey || !subtle$1.deriveBits) { - return Promise.resolve(false) - } - if (checks[algo] !== undefined) { - return checks[algo] - } - ZERO_BUF = ZERO_BUF || Buffer$1.alloc(8); - var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) - .then(function () { - return true - }).catch(function () { - return false - }); - checks[algo] = prom; - return prom - } - var nextTick; - function getNextTick () { - if (nextTick) { - return nextTick - } - if (commonjsGlobal.process && commonjsGlobal.process.nextTick) { - nextTick = commonjsGlobal.process.nextTick; - } else if (commonjsGlobal.queueMicrotask) { - nextTick = commonjsGlobal.queueMicrotask; - } else if (commonjsGlobal.setImmediate) { - nextTick = commonjsGlobal.setImmediate; - } else { - nextTick = commonjsGlobal.setTimeout; - } - return nextTick - } - function browserPbkdf2 (password, salt, iterations, length, algo) { - return subtle$1.importKey( - 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits'] - ).then(function (key) { - return subtle$1.deriveBits({ - name: 'PBKDF2', - salt: salt, - iterations: iterations, - hash: { - name: algo - } - }, key, length << 3) - }).then(function (res) { - return Buffer$1.from(res) - }) - } - - function resolvePromise (promise, callback) { - promise.then(function (out) { - getNextTick()(function () { - callback(null, out); - }); - }, function (e) { - getNextTick()(function () { - callback(e); - }); - }); - } - var async = function (password, salt, iterations, keylen, digest, callback) { - if (typeof digest === 'function') { - callback = digest; - digest = undefined; - } - - digest = digest || 'sha1'; - var algo = toBrowser[digest.toLowerCase()]; - - if (!algo || typeof commonjsGlobal.Promise !== 'function') { - getNextTick()(function () { - var out; - try { - out = sync(password, salt, iterations, keylen, digest); - } catch (e) { - return callback(e) - } - callback(null, out); - }); - return - } - - checkParameters$1(iterations, keylen); - password = toBuffer$6(password, defaultEncoding$1, 'Password'); - salt = toBuffer$6(salt, defaultEncoding$1, 'Salt'); - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - resolvePromise(checkNative(algo).then(function (resp) { - if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo) - - return sync(password, salt, iterations, keylen, digest) - }), callback); - }; - - var native = require$$0__default["default"]; - - var checkParameters = precondition; - var defaultEncoding = defaultEncoding_1; - var toBuffer$5 = toBuffer$8; - - function nativePBKDF2 (password, salt, iterations, keylen, digest, callback) { - checkParameters(iterations, keylen); - password = toBuffer$5(password, defaultEncoding, 'Password'); - salt = toBuffer$5(salt, defaultEncoding, 'Salt'); - - if (typeof digest === 'function') { - callback = digest; - digest = 'sha1'; - } - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - return native.pbkdf2(password, salt, iterations, keylen, digest, callback) - } - - function nativePBKDF2Sync (password, salt, iterations, keylen, digest) { - checkParameters(iterations, keylen); - password = toBuffer$5(password, defaultEncoding, 'Password'); - salt = toBuffer$5(salt, defaultEncoding, 'Salt'); - digest = digest || 'sha1'; - return native.pbkdf2Sync(password, salt, iterations, keylen, digest) - } - - /* istanbul ignore next */ - if (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) { - pbkdf2$7.pbkdf2Sync = sync$1; - pbkdf2$7.pbkdf2 = async; - - // native - } else { - pbkdf2$7.pbkdf2Sync = nativePBKDF2Sync; - pbkdf2$7.pbkdf2 = nativePBKDF2; - } - - var randombytes = require$$0__default["default"].randomBytes; - - var _wordlists = {}; - - Object.defineProperty(_wordlists, "__esModule", { value: true }); - // browserify by default only pulls in files that are hard coded in requires - // In order of last to first in this file, the default wordlist will be chosen - // based on what is present. (Bundles may remove wordlists they don't need) - const wordlists = {}; - _wordlists.wordlists = wordlists; - let _default; - var _default_1 = _wordlists._default = _default; - try { - _default_1 = _wordlists._default = _default = require('./wordlists/czech.json'); - wordlists.czech = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/chinese_simplified.json'); - wordlists.chinese_simplified = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/chinese_traditional.json'); - wordlists.chinese_traditional = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/korean.json'); - wordlists.korean = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/french.json'); - wordlists.french = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/italian.json'); - wordlists.italian = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/spanish.json'); - wordlists.spanish = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/japanese.json'); - wordlists.japanese = _default; - wordlists.JA = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/portuguese.json'); - wordlists.portuguese = _default; - } - catch (err) { } - try { - _default_1 = _wordlists._default = _default = require('./wordlists/english.json'); - wordlists.english = _default; - wordlists.EN = _default; - } - catch (err) { } - - Object.defineProperty(src$1, "__esModule", { value: true }); - const createHash = createHash$3; - const pbkdf2_1 = pbkdf2$7; - const randomBytes$2 = randombytes; - const _wordlists_1 = _wordlists; - let DEFAULT_WORDLIST = _wordlists_1._default; - const INVALID_MNEMONIC = 'Invalid mnemonic'; - const INVALID_ENTROPY = 'Invalid entropy'; - const INVALID_CHECKSUM = 'Invalid mnemonic checksum'; - const WORDLIST_REQUIRED = 'A wordlist is required but a default could not be found.\n' + - 'Please pass a 2048 word array explicitly.'; - function pbkdf2Promise(password, saltMixin, iterations, keylen, digest) { - return Promise.resolve().then(() => new Promise((resolve, reject) => { - const callback = (err, derivedKey) => { - if (err) { - return reject(err); - } - else { - return resolve(derivedKey); - } - }; - pbkdf2_1.pbkdf2(password, saltMixin, iterations, keylen, digest, callback); - })); - } - function normalize$4(str) { - return (str || '').normalize('NFKD'); - } - function lpad(str, padString, length) { - while (str.length < length) { - str = padString + str; - } - return str; - } - function binaryToByte(bin) { - return parseInt(bin, 2); - } - function bytesToBinary(bytes) { - return bytes.map((x) => lpad(x.toString(2), '0', 8)).join(''); - } - function deriveChecksumBits(entropyBuffer) { - const ENT = entropyBuffer.length * 8; - const CS = ENT / 32; - const hash = createHash('sha256') - .update(entropyBuffer) - .digest(); - return bytesToBinary(Array.from(hash)).slice(0, CS); - } - function salt(password) { - return 'mnemonic' + (password || ''); - } - function mnemonicToSeedSync(mnemonic, password) { - const mnemonicBuffer = Buffer.from(normalize$4(mnemonic), 'utf8'); - const saltBuffer = Buffer.from(salt(normalize$4(password)), 'utf8'); - return pbkdf2_1.pbkdf2Sync(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512'); - } - src$1.mnemonicToSeedSync = mnemonicToSeedSync; - function mnemonicToSeed(mnemonic, password) { - return Promise.resolve().then(() => { - const mnemonicBuffer = Buffer.from(normalize$4(mnemonic), 'utf8'); - const saltBuffer = Buffer.from(salt(normalize$4(password)), 'utf8'); - return pbkdf2Promise(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512'); - }); - } - src$1.mnemonicToSeed = mnemonicToSeed; - function mnemonicToEntropy(mnemonic, wordlist) { - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - const words = normalize$4(mnemonic).split(' '); - if (words.length % 3 !== 0) { - throw new Error(INVALID_MNEMONIC); - } - // convert word indices to 11 bit binary strings - const bits = words - .map((word) => { - const index = wordlist.indexOf(word); - if (index === -1) { - throw new Error(INVALID_MNEMONIC); - } - return lpad(index.toString(2), '0', 11); - }) - .join(''); - // split the binary string into ENT/CS - const dividerIndex = Math.floor(bits.length / 33) * 32; - const entropyBits = bits.slice(0, dividerIndex); - const checksumBits = bits.slice(dividerIndex); - // calculate the checksum and compare - const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte); - if (entropyBytes.length < 16) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length > 32) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length % 4 !== 0) { - throw new Error(INVALID_ENTROPY); - } - const entropy = Buffer.from(entropyBytes); - const newChecksum = deriveChecksumBits(entropy); - if (newChecksum !== checksumBits) { - throw new Error(INVALID_CHECKSUM); - } - return entropy.toString('hex'); - } - src$1.mnemonicToEntropy = mnemonicToEntropy; - function entropyToMnemonic(entropy, wordlist) { - if (!Buffer.isBuffer(entropy)) { - entropy = Buffer.from(entropy, 'hex'); - } - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - // 128 <= ENT <= 256 - if (entropy.length < 16) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length > 32) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length % 4 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - const entropyBits = bytesToBinary(Array.from(entropy)); - const checksumBits = deriveChecksumBits(entropy); - const bits = entropyBits + checksumBits; - const chunks = bits.match(/(.{1,11})/g); - const words = chunks.map((binary) => { - const index = binaryToByte(binary); - return wordlist[index]; - }); - return wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093' // Japanese wordlist - ? words.join('\u3000') - : words.join(' '); - } - src$1.entropyToMnemonic = entropyToMnemonic; - function generateMnemonic(strength, rng, wordlist) { - strength = strength || 128; - if (strength % 32 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - rng = rng || randomBytes$2; - return entropyToMnemonic(rng(strength / 8), wordlist); - } - src$1.generateMnemonic = generateMnemonic; - function validateMnemonic(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } - catch (e) { - return false; - } - return true; - } - src$1.validateMnemonic = validateMnemonic; - function setDefaultWordlist(language) { - const result = _wordlists_1.wordlists[language]; - if (result) { - DEFAULT_WORDLIST = result; - } - else { - throw new Error('Could not find wordlist for language "' + language + '"'); - } - } - src$1.setDefaultWordlist = setDefaultWordlist; - function getDefaultWordlist() { - if (!DEFAULT_WORDLIST) { - throw new Error('No Default Wordlist set'); - } - return Object.keys(_wordlists_1.wordlists).filter((lang) => { - if (lang === 'JA' || lang === 'EN') { - return false; - } - return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]); - })[0]; - } - src$1.getDefaultWordlist = getDefaultWordlist; - var _wordlists_2 = _wordlists; - src$1.wordlists = _wordlists_2.wordlists; - - // Constants - const { - FABRIC_KEY_DERIVATION_PATH - } = constants$1; - - // Node Modules - const crypto$f = require$$0__default["default"]; - - // Dependencies - const Generator = dist.exports.default.Generator; - const BN$b = bn$2.exports; - const EC = elliptic$2.ec; - const ec = new EC('secp256k1'); - const ecc = require$$5; - - // External Dependencies - // TODO: remove all external dependencies - const BIP32 = src$3.default; - const bip32 = new BIP32(ecc); - const bip39 = src$1; - - /** - * Represents a cryptographic key. - */ - class Key$9 { - /** - * Create an instance of a Fabric Key, either restoring from some known - * values or from prior knowledge. For instance, you can call `new Key()` - * to create a fresh keypair, or `new Key({ public: 'deadbeef...' })` to - * create it from a known public key. - * @param {Object} [settings] Initialization for the key. - * @param {String} [settings.network] Network string. - * @param {String} [settings.seed] Mnemonic seed for initializing the key. - * @param {String} [settings.public] Public key in hex. - * @param {String} [settings.private] Private key in hex. - */ - constructor (input = {}) { - this.settings = Object.assign({ - debug: false, - network: 'main', - curve: 'secp256k1', - derivation: FABRIC_KEY_DERIVATION_PATH, - mode: 'aes-256-cbc', - prefix: '00', - public: null, - private: null, - bits: 256, - hd: true, - seed: null, - password: null, - index: 0, - cipher: { - iv: { - size: 16 - } - }, - witness: true - }, input); - - this.clock = 0; - this.master = null; - this.private = null; - this.public = null; - - // Configure Deterministic Random - // WARNING: this will currently loop after 2^32 bits - // TODO: evaluate compression when treating seed phrase as ascii - // TODO: consider using sha256(masterprivkey) or sha256(sha256(...))? - this._starseed = this.settings.seed || crypto$f.randomBytes(4).readUInt32BE(); - - // TODO: design state machine for input (configuration) - if (this.settings.seed) { - this._mode = 'FROM_SEED'; - } else if (this.settings.private) { - this._mode = 'FROM_PRIVATE_KEY'; - } else if (this.settings.xprv) { - this._mode = 'FROM_XPRV'; - } else if (this.settings.xpub) { - this._mode = 'FROM_XPUB'; - } else if (this.settings.pubkey || this.settings.public) { - this._mode = 'FROM_PUBLIC_KEY'; - } else { - this._mode = 'FROM_RANDOM'; - } - - if (this.settings.debug) console.debug('mode:', this._mode, crypto$f.createHash('sha256').update(this.settings.seed).digest('hex'), this.settings.seed); - - switch (this._mode) { - case 'FROM_SEED': - const seed = bip39.mnemonicToSeedSync(this.settings.seed); - const root = bip32.fromSeed(seed); - this.xprv = root.toBase58(); - this.xpub = root.neutered().toBase58(); - this.master = root; - this.keypair = ec.keyFromPrivate(root.privateKey); - // this.address = this.keyring.getAddress().toString(); - this.status = 'seeded'; - break; - case 'FROM_XPRV': - const restored = bip32.fromBase58(this.settings.xprv); - this.xprv = restored.toBase58(); - this.xpub = restored.neutered().toBase58(); - this.master = restored; - this.keypair = ec.keyFromPrivate(restored.privateKey); - break; - case 'FROM_XPUB': - const xpub = bip32.fromBase58(this.settings.xpub); - this.keypair = ec.keyFromPublic(xpub.publicKey); - break; - case 'FROM_PRIVATE_KEY': - // Key is private - (this.settings.private instanceof Buffer) ? this.settings.private : Buffer.from(this.settings.private, 'hex'); - this.keypair = ec.keyFromPrivate(this.settings.private); - break; - case 'FROM_PUBLIC_KEY': - const pubkey = this.settings.pubkey || this.settings.public; - // Key is only public - this.keypair = ec.keyFromPublic((pubkey instanceof Buffer) ? pubkey : Buffer.from(pubkey, 'hex')); - break; - case 'FROM_RANDOM': - const mnemonic = bip39.generateMnemonic(); - const interim = bip39.mnemonicToSeedSync(mnemonic); - this.master = bip32.fromSeed(interim); - this.keypair = ec.keyFromPrivate(this.master.privateKey); - break; - } - - // Read the pair - this.private = ( - !this.settings.seed && - !this.settings.private && - !this.settings.xprv - ) ? false : this.keypair.getPrivate(); - - this.public = this.keypair.getPublic(true); - - // TODO: determine if this makes sense / needs to be private - this.privkey = (this.private) ? this.private.toString() : null; - - // STANDARD BEGINS HERE - this.pubkey = this.public.encodeCompressed('hex'); - - // BELOW THIS NON-STANDARD - // DO NOT USE IN PRODUCTION - // this.pubkeyhash = this.keyring.getKeyHash('hex'); - this.pubkeyhash = ''; - this.generator = new Generator(parseInt(this._starseed, 10)); - - this['@data'] = { - type: 'Key', - public: this.pubkey, - address: this.address - }; - - this._state = { - pubkey: this.pubkey - }; - - // Object.defineProperty(this, 'keyring', { enumerable: false }); - Object.defineProperty(this, 'keypair', { enumerable: false }); - Object.defineProperty(this, 'private', { enumerable: false }); - - return this; - } - - static Mnemonic (seed) { - return new Key$9({ seed }); - } - - get id () { - return this.pubkeyhash; - } - - get iv () { - const self = this; - const bits = new BN$b([...Array(128)].map(() => { - return self.bit().toString(); - }).join(''), 2).toString(16); - return Buffer.from(bits.toString(16), 'hex'); - } - - bit () { - return this.generator.next.bits(1); - } - - encrypt (value) { - try { - const ivbuff = Buffer.from(this.iv, 'hex'); - const cipher = crypto$f.createCipheriv(this.settings.mode, this.private.toBuffer(), ivbuff); - let encrypted = cipher.update(value); - encrypted = Buffer.concat([ - encrypted, - cipher.final() - ]); - return ivbuff.toString('hex') + ':' + encrypted.toString('hex'); - } catch (exception) { - console.error('err:', exception); - } - } - - decrypt (text) { - if (text instanceof Buffer) text = text.toString('utf8'); - - try { - const parts = text.split(':'); - const iv = Buffer.from(parts.shift(), 'hex'); - const blob = Buffer.from(parts.join(':'), 'hex'); - const decipher = crypto$f.createDecipheriv(this.settings.mode, this.private.toBuffer(), iv); - let decrypted = decipher.update(blob); - decrypted = Buffer.concat([ - decrypted, - decipher.final() - ]); - return decrypted.toString(); - } catch (exception) { - console.error('err:', exception); - } - } - - _sign (msg) { - if (typeof msg !== 'string') msg = JSON.stringify(msg); - const hmac = crypto$f.createHash('sha256').update(msg).digest('hex'); - return this.keypair.sign(hmac).toDER(); - } - - _verify (msg, sig) { - const hmac = crypto$f.createHash('sha256').update(msg).digest('hex'); - const valid = this.keypair.verify(hmac, sig); - return valid; - } - - derive (path = this.settings.derivation) { - if (!this.master) throw new Error('You cannot derive without a master key. Provide a seed phrase or an xprv.'); - const derived = this.master.derivePath(path); - const options = { - private: derived.privateKey.encodeCompressed('hex'), - public: derived.publicKey.encodeCompressed('hex') - }; - - return new Key$9(options); - } - } - - var key$1 = Key$9; - - var struct$3 = {exports: {}}; - - /** - * Default export `Struct`. - */ - - (function (module, exports) { - // export default Struct; - module.exports = exports = Struct; - - // compatibility - exports.Struct = Struct; - - function boolField(p, offset, length) { - this.length = length; - this.offset = offset; - this.get = function() { - return (p.buf[offset] > 0); - }; - this.set = function (val) { - p.buf[offset] = val ? 1 : 0; - }; - } - - function intField(p, offset, length, le, signed) { - this.length = length; - this.offset = offset; - - function bec(cb) { - for (var i = 0; i < length; i++) - cb(i, length - i - 1); - } - - function lec(cb) { - for (var i = 0; i < length; i++) - cb(i, i); - } - - function getUVal(bor) { - var val = 0; - bor(function (i, o) { - val += Math.pow(256, o) * p.buf[offset + i]; - }); - return val; - } - - function getSVal(bor) { - - var val = getUVal(bor); - if ((p.buf[offset + (le ? (length - 1) : 0)] & 0x80) == 0x80) { - val -= Math.pow(256, length); - } - return val; - } - - function setVal(bor, val) { - bor(function (i, o) { - p.buf[offset + i] = Math.floor(val / Math.pow(256, o)) & 0xff; - }); - } - - var - nativeSuff = (signed?'':'U') + 'Int' + (length * 8) + (le?'LE':'BE'), - readMethod = Buffer.prototype['read' + nativeSuff], writeMethod = Buffer.prototype['write' + nativeSuff]; - - - if (!readMethod) { - this.get = function () { - var bor = le ? lec : bec; - return (signed ? getSVal(bor) : getUVal(bor)); - }; - } - else { - this.get = function () { - return readMethod.call(p.buf, offset); - }; - } - - - if (!writeMethod) { - this.set = function (val) { - var bor = le ? lec : bec; - setVal(bor, val); - }; - } - else { - this.set = function (val) { - writeMethod.call(p.buf, val, offset); - }; - } - - } - - function floatField(p, offset, le) { - this.length = 4; - this.offset = offset; - this.get = function () { - return le ? p.buf.readFloatLE(offset) : p.buf.readFloatBE(offset); - }; - this.set = function (val) { - return le ? p.buf.writeFloatLE(val, offset) : p.buf.writeFloatBE(val, offset); - }; - } - - function doubleField(p, offset, le) { - this.length = 8; - this.offset = offset; - this.get = function () { - return le ? p.buf.readDoubleLE(offset) : p.buf.readDoubleBE(offset); - }; - this.set = function (val) { - return le ? p.buf.writeDoubleLE(val, offset) : p.buf.writeDoubleBE(val, offset); - }; - } - - function charField(p, offset, length, encoding, secure) { - var self = this; - self.length = length; - self.offset = offset; - self.encoding = encoding; - self.secure = secure; - self.get = function () { - if (!length) - return; - - var result = p.buf.toString(self.encoding, offset, (offset + length)); - var strlen = result.indexOf("\0"); - if (strlen == -1) { - return result; - } else { - return result.slice(0, strlen); - } - }; - self.set = function (val) { - if (!length) - return; - - // Be string is terminated with the null char, else troncate it - if (secure === true) { - - // Append \0 to the string - val += "\0"; - if (val.length >= length) { - val = val.substring(0, length - 1); - val += "\0"; - } - - // Write to buffer - p.buf.write(val, offset, val.length, self.encoding); - - // Fill rest of the buffer with \0 - var remainSpace = (length - val.length); - if (remainSpace > 0) { - p.buf.fill(0, (offset + val.length), offset + length); - } - - } else { - // Trust Buffer class to write the string into the buffer - p.buf.write(val, offset, length, self.encoding); - } - }; - } - - function structField(p, offset, struct) { - this.length = struct.length(); - this.offset = offset; - this.get = function () { - return struct; - }; - this.set = function (val) { - struct.set(val); - }; - this.allocate = function () { - struct._setBuff(p.buf.slice(offset, offset + struct.length())); - }; - } - - function arrayField(p, offset, len, type) { - var as = Struct(); - var args = [].slice.call(arguments, 4); - args.unshift(0); - for (var i = 0; i < len; i++) { - if (type instanceof Struct) { - as.struct(i, type.clone()); - } else if (type in as) { - args[0] = i; - as[type].apply(as, args); - } - } - this.length = as.length(); - this.offset = offset; - this.allocate = function () { - as._setBuff(p.buf.slice(offset, offset + as.length())); - }; - this.get = function () { - return as; - }; - this.set = function (val) { - as.set(val); - }; - } - - function Struct() { - if (!(this instanceof Struct)) - return new Struct; - - var priv = { - buf : {}, - allocated : false, - len : 0, - fields : {}, - closures : [] - }, self = this; - - function checkAllocated() { - if (priv.allocated) - throw new Error('Cant change struct after allocation'); - } - - // Create handlers for various float Field Variants - [true, false].forEach(function (le) { - self['float' + (le ? 'le' : 'be')] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - var n = 4; - p.fields[key] = new floatField(p, p.len, le); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various double Field Variants - [true, false].forEach(function (le) { - self['double' + (le ? 'le' : 'be')] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - var n = 8; - p.fields[key] = new doubleField(p, p.len, le); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various Bool Field Variants - [1, 2, 3, 4].forEach(function (n) { - self['bool' + (n == 1 ? '' : n)] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new boolField(p, p.len, n); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various Integer Field Variants - [1, 2, 3, 4, 6, 8].forEach(function (n) { - [true, false].forEach(function (le) { - [true, false].forEach(function (signed) { - var name = 'word' + (n * 8) + (signed ? 'S' : 'U') + (le ? 'le' : 'be'); - self[name] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new intField(p, p.len, n, le, signed); - p.len += n; - }); - return this; - }; - }); - }); - }); - this.word8 = this.word8Ule; - - ['chars', 'charsnt'].forEach(function (c) { - self[c] = function (key, length, encoding) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new charField(p, p.len, length, encoding || 'ascii', (c == 'charsnt')); - p.len += length; - }); - return this; - }; - }); - - this.struct = function (key, struct) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new structField(p, p.len, struct.clone()); - p.len += p.fields[key].length; - }); - return this; - }; - function construct(constructor, args) { - function F() { - return constructor.apply(this, args); - } - - F.prototype = constructor.prototype; - return new F(); - } - - - this.array = function (key, length, type) { - checkAllocated(); - var args = [].slice.call(arguments, 1); - args.unshift(null); - args.unshift(null); - priv.closures.push(function (p) { - args[0] = p; - args[1] = p.len; - p.fields[key] = construct(arrayField, args); - p.len += p.fields[key].length; - }); - - return this; - }; - var beenHere = false; - - function applyClosures(p) { - if (beenHere) - return; - p.closures.forEach(function (el) { - el(p); - }); - beenHere = true; - } - - function allocateFields() { - for (var key in priv.fields) { - if ('allocate' in priv.fields[key]) - priv.fields[key].allocate(); - } - } - - this._setBuff = this.setBuffer = function (buff, buffLength) { - applyClosures(priv); - if (typeof (buffLength) === 'number') { - if (buffLength > buff.length) { - throw new Error('Invalid specified buffer size !'); - } - priv.buf = buff.slice(0, buffLength); - } else { - priv.buf = buff; - } - if (priv.buf.length < priv.len) { - throw new Error('Buffer size too small for struct layout !'); - } - allocateFields(); - priv.allocated = true; - }; - - this.allocate = function () { - applyClosures(priv); - if (Buffer.alloc) { - priv.buf = Buffer.alloc(priv.len); - } else { - priv.buf = new Buffer(priv.len); - priv.buf.fill(0); - } - allocateFields(); - priv.allocated = true; - return this; - }; - - this._getPriv = function () { - return priv; - }; - - this.getOffset = function (field) { - if (priv.fields[field]) return priv.fields[field].offset; - }; - - this.clone = function () { - var c = new Struct; - var p = c._getPriv(); - p.closures = priv.closures.slice(0); - return c; - }; - - this.length = function () { - applyClosures(priv); - return priv.len; - }; - - this.get = function (key) { - if (key in priv.fields) { - return priv.fields[key].get(); - } else - throw new Error('Can not find field ' + key); - }; - - this.set = function (key, val) { - if (arguments.length == 2) { - if (key in priv.fields) { - priv.fields[key].set(val); - } else - throw new Error('Can not find field ' + key); - } else if (Buffer.isBuffer(key)) { - this._setBuff(key); - } else { - for (var k in key) { - this.set(k, key[k]); - } - } - }; - this.buffer = function () { - return priv.buf; - }; - - - function getFields() { - var fields = {}; - Object.keys(priv.fields).forEach(function (key) { - var setFunc, getFunc; - if (priv.fields[key] instanceof structField || - priv.fields[key] instanceof arrayField) { - getFunc = function () { - return priv.fields[key].get().fields; - }; - setFunc = function (newVal) { - self.set(key, newVal); - }; - } - else { - getFunc = priv.fields[key].get; - setFunc = priv.fields[key].set; - } - Object.defineProperty(fields, key, { - get : getFunc, - set : setFunc, - enumerable : true - }); - }); - return fields; - } - var _fields; - Object.defineProperty(this, 'fields', { - get : function () { - if (_fields) - return _fields; - return (_fields = getFields()); - }, - enumerable : true, - configurable : true - }); - - } - }(struct$3, struct$3.exports)); - - const Actor$d = actor; - const Hash256$7 = hash256$l; - - class Label$2 extends Actor$d { - constructor (input = '') { - super(input); - if (typeof input != 'string') input = super.serialize(input); - this._id = Hash256$7.digest(`@labels/${input}`); - return this; - } - } - - var label = Label$2; - - var padDigits$1 = function padDigits (number, digits) { - return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; - }; - - const { - MAGIC_BYTES: MAGIC_BYTES$1, - VERSION_NUMBER, - HEADER_SIZE: HEADER_SIZE$1, - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$1, - OP_CYCLE, - GENERIC_MESSAGE_TYPE, - LOG_MESSAGE_TYPE, - GENERIC_LIST_TYPE, - P2P_GENERIC, - P2P_IDENT_REQUEST: P2P_IDENT_REQUEST$1, - P2P_IDENT_RESPONSE: P2P_IDENT_RESPONSE$1, - P2P_ROOT: P2P_ROOT$1, - P2P_PING: P2P_PING$1, - P2P_PONG: P2P_PONG$1, - P2P_START_CHAIN: P2P_START_CHAIN$1, - P2P_INSTRUCTION: P2P_INSTRUCTION$1, - P2P_BASE_MESSAGE: P2P_BASE_MESSAGE$1, - P2P_CHAIN_SYNC_REQUEST, - P2P_STATE_ROOT: P2P_STATE_ROOT$1, - P2P_STATE_COMMITTMENT: P2P_STATE_COMMITTMENT$1, - P2P_STATE_CHANGE: P2P_STATE_CHANGE$1, - P2P_STATE_REQUEST, - P2P_TRANSACTION, - P2P_CALL, - CHAT_MESSAGE, - DOCUMENT_PUBLISH_TYPE, - DOCUMENT_REQUEST_TYPE, - BLOCK_CANDIDATE, - PEER_CANDIDATE, - SESSION_START - } = constants$1; - - // Dependencies - const crypto$e = require$$0__default["default"]; - const struct$2 = struct$3.exports; - - // Fabric Types - const Actor$c = actor; - const Label$1 = label; - - // Function Definitions - const padDigits = padDigits$1; - - // Type Labels - const TYPE_ETHEREUM_BLOCK = parseInt((new Label$1('types/EthereumBlock'))._id, 16); - const TYPE_ETHEREUM_BLOCK_NUMBER = parseInt((new Label$1('types/EthereumBlockNumber'))._id, 16); - - /** - * The {@link Message} type defines the Application Messaging Protocol, or AMP. - * Each {@link Actor} in the network receives and broadcasts messages, - * selectively disclosing new routes to peers which may have open circuits. - * @type {Object} - */ - class Message$5 extends Actor$c { - /** - * The `Message` type is standardized in {@link Fabric} as a {@link Array}, which can be added to any other vector to compute a resulting state. - * @param {Object} message Message vector. Will be serialized by {@link Array#_serialize}. - * @return {Message} Instance of the message. - */ - constructor (input = {}) { - super(input); - - this.raw = { - magic: Buffer.alloc(4), - version: Buffer.alloc(4), - parent: Buffer.alloc(32), - type: Buffer.alloc(4), // TODO: 8, 32 - size: Buffer.alloc(4), // TODO: 8, 32 - hash: Buffer.alloc(32), - signature: Buffer.alloc(64), - data: null - }; - - this.raw.magic.write(MAGIC_BYTES$1.toString(16), 'hex'); - this.raw.version.write(padDigits(VERSION_NUMBER.toString(16), 8), 'hex'); - - if (input.data && input.type) { - this.type = input.type; - - if (typeof input.data !== 'string') { - this.data = JSON.stringify(input.data); - } else { - this.data = input.data; - } - } - - // Set various properties to be unenumerable - for (let name of [ - '@input', - '@entity', - '_state', - 'config', - 'settings', - 'stack', - 'observer' - ]) Object.defineProperty(this, name, { enumerable: false }); - - return this; - } - - get body () { - return this.raw.data.toString('utf8'); - } - - get byte () { - const input = 0 + ''; - const num = Buffer.from(`0x${padDigits(input, 8)}`, 'hex'); - return num; - } - - get tu16 () { - return parseInt(0); - } - - get tu32 () { - return parseInt(0); - } - - get tu64 () { - return parseInt(0); - } - - get Uint256 () { - // 256 bits - return Buffer.from((this.raw && this.raw.hash) ? `0x${padDigits(this.raw.hash, 8)}` : crypto$e.randomBytes(32)); - } - - set signature (value) { - if (value instanceof Buffer) value = value.toString('hex'); - this.raw.signature.write(value, 'hex'); - } - - toBuffer () { - return this.asRaw(); - } - - /** - * Returns a {@link Buffer} of the complete message. - * @return {Buffer} Buffer of the encoded {@link Message}. - */ - asRaw () { - console.log('header:', this.header); - console.log('data:', this.raw.data); - return Buffer.concat([this.header, this.raw.data]); - } - - toRaw () { - return this.asRaw(); - } - - asTypedArray () { - return new Uint8Array(this.asRaw()); - // TODO: Node 12 - // return new TypedArray(this.asRaw()); - } - - asBlob () { - return this.asRaw().map(byte => parseInt(byte, 16)); - } - - toObject () { - return { - headers: { - magic: parseInt(`${this.raw.magic.toString('hex')}`, 16), - version: parseInt(`${this.raw.version.toString('hex')}`, 16), - parent: this.raw.parent.toString('hex'), - type: parseInt(`${this.raw.type.toString('hex')}`, 16), - size: parseInt(`${this.raw.size.toString('hex')}`, 16), - signature: this.raw.signature.toString('hex'), - hash: this.raw.hash.toString('hex') - }, - type: this.type, - data: this.data - }; - } - - fromObject (input) { - return new Message$5(input); - } - - static parseBuffer (buffer) { - const message = struct$2() - .charsnt('magic', 4, 'hex') - .charsnt('version', 4, 'hex') - .charsnt('parent', 32, 'hex') - .charsnt('type', 4, 'hex') - .charsnt('size', 4, 'hex') - .charsnt('hash', 32, 'hex') - .charsnt('signature', 64, 'hex') - .charsnt('data', buffer.length - HEADER_SIZE$1); - - message.allocate(); - message._setBuff(buffer); - - return message; - } - - static parseRawMessage (buffer) { - const message = { - magic: buffer.slice(0, 4), - version: buffer.slice(4, 8), - parent: buffer.slice(8, 40), - type: buffer.slice(40, 44), - size: buffer.slice(44, 48), - hash: buffer.slice(48, 80), - signature: buffer.slice(80, 144) - }; - - if (buffer.length >= 144) { - message.data = buffer.slice(144, buffer.length); - } - - return message; - }; - - static fromBuffer (buffer) { - return Message$5.fromRaw(buffer); - } - - static fromRaw (input) { - if (!input) return null; - if (!(input instanceof Buffer)) throw new Error('Input must be a buffer.'); - // if (input.length < HEADER_SIZE) return null; - // if (input.length > MAX_MESSAGE_SIZE) return new Error('Input too large.'); - - const message = new Message$5(); - - message.raw = { - magic: input.slice(0, 4), - version: input.slice(4, 8), - parent: input.slice(8, 40), - type: input.slice(40, 44), - size: input.slice(40, 48), - hash: input.slice(40, 80), - signature: input.slice(0, 144) - }; - - message.data = input.slice(HEADER_SIZE$1); - - console.log('raw:', message.raw); - - return message; - } - - static fromVector (vector = ['LogMessage', 'No vector provided.']) { - let message = null; - - try { - message = new Message$5({ - type: vector[0], - data: vector[1] - }); - } catch (exception) { - console.error('[FABRIC:MESSAGE]', 'Could not construct Message:', exception); - } - - return message; - } - - /* get [Symbol.toStringTag] () { - return ``; - } */ - - get id () { - return crypto$e.createHash('sha256').update(this.asRaw()).digest('hex'); - } - - get types () { - // Message Types - return { - 'GenericMessage': GENERIC_MESSAGE_TYPE, - 'GenericLogMessage': LOG_MESSAGE_TYPE, - 'GenericList': GENERIC_LIST_TYPE, - 'GenericQueue': GENERIC_LIST_TYPE, - 'FabricLogMessage': LOG_MESSAGE_TYPE, - 'FabricServiceLogMessage': LOG_MESSAGE_TYPE, - 'GenericTransferQueue': GENERIC_LIST_TYPE, - // TODO: document Generic type - // P2P Commands - 'Generic': P2P_GENERIC, - 'Cycle': OP_CYCLE, - 'IdentityRequest': P2P_IDENT_REQUEST$1, - 'IdentityResponse': P2P_IDENT_RESPONSE$1, - 'ChainSyncRequest': P2P_CHAIN_SYNC_REQUEST, - // TODO: restore this type - // 'StateRoot': P2P_ROOT, - 'Ping': P2P_PING$1, - 'Pong': P2P_PONG$1, - 'DocumentRequest': DOCUMENT_REQUEST_TYPE, - 'DocumentPublish': DOCUMENT_PUBLISH_TYPE, - 'BlockCandidate': BLOCK_CANDIDATE, - 'PeerCandidate': PEER_CANDIDATE, - 'PeerInstruction': P2P_INSTRUCTION$1, - 'PeerMessage': P2P_BASE_MESSAGE$1, - 'StartSession': SESSION_START, - 'ChatMessage': CHAT_MESSAGE, - 'StartChain': P2P_START_CHAIN$1, - // TODO: restore above StateRoot type - 'StateRoot': P2P_STATE_ROOT$1, - 'StateCommitment': P2P_STATE_COMMITTMENT$1, - 'StateChange': P2P_STATE_CHANGE$1, - 'StateRequest': P2P_STATE_REQUEST, - 'Transaction': P2P_TRANSACTION, - 'Call': P2P_CALL, - 'LogMessage': LOG_MESSAGE_TYPE, - 'EthereumBlock': TYPE_ETHEREUM_BLOCK, - 'EthereumBlockNumber': TYPE_ETHEREUM_BLOCK_NUMBER - }; - } - - get codes () { - return Object.entries(this.types).reduce((ret, entry) => { - const [ key, value ] = entry; - ret[ value ] = key; - return ret; - }, {}); - } - - get magic () { - return this.raw.magic; - } - - get signature () { - return parseInt(Buffer.from(this.raw.signature, 'hex')); - } - - get size () { - return parseInt(Buffer.from(this.raw.size, 'hex')); - } - - get version () { - return parseInt(Buffer.from(this.raw.version)); - } - - get header () { - const parts = [ - Buffer.from(this.raw.magic, 'hex'), - Buffer.from(this.raw.version, 'hex'), - Buffer.from(this.raw.type, 'hex'), - Buffer.from(this.raw.size, 'hex'), - Buffer.from(this.raw.signature, 'hex'), - Buffer.from(this.raw.hash, 'hex') - ]; - - return Buffer.concat(parts); - } - } - - Object.defineProperty(Message$5.prototype, 'type', { - get () { - const code = parseInt(this.raw.type.toString('hex'), 16); - switch (code) { - case GENERIC_MESSAGE_TYPE: - return 'GenericMessage'; - case LOG_MESSAGE_TYPE: - return 'GenericLogMessage'; - case GENERIC_LIST_TYPE: - return 'GenericList'; - case DOCUMENT_PUBLISH_TYPE: - return 'DocumentPublish'; - case DOCUMENT_REQUEST_TYPE: - return 'DocumentRequest'; - case BLOCK_CANDIDATE: - return 'BlockCandidate'; - case OP_CYCLE: - return 'Cycle'; - case P2P_PING$1: - return 'Ping'; - case P2P_PONG$1: - return 'Pong'; - case P2P_GENERIC: - return 'Generic'; - case P2P_CHAIN_SYNC_REQUEST: - return 'ChainSyncRequest'; - case P2P_IDENT_REQUEST$1: - return 'IdentityRequest'; - case P2P_IDENT_RESPONSE$1: - return 'IdentityResponse'; - case P2P_BASE_MESSAGE$1: - return 'PeerMessage'; - case P2P_STATE_ROOT$1: - return 'StateRoot'; - case P2P_STATE_CHANGE$1: - return 'StateChange'; - case P2P_STATE_REQUEST: - return 'StateRequest'; - case P2P_TRANSACTION: - return 'Transaction'; - case P2P_CALL: - return 'Call'; - case PEER_CANDIDATE: - return 'PeerCandidate'; - case SESSION_START: - return 'StartSession'; - case CHAT_MESSAGE: - return 'ChatMessage'; - case P2P_START_CHAIN$1: - return 'StartChain'; - case TYPE_ETHEREUM_BLOCK: - return 'EthereumBlock'; - case TYPE_ETHEREUM_BLOCK_NUMBER: - return 'EthereumBlockNumber'; - default: - return 'GenericMessage'; - } - }, - set (value) { - let code = this.types[value]; - // Default to GenericMessage; - if (!code) { - this.emit('warning', `Unknown message type: ${value}`); - code = this.types['GenericMessage']; - } - - const padded = padDigits(code.toString(16), 8); - this['@type'] = value; - this.raw.type.write(padded, 'hex'); - } - }); - - Object.defineProperty(Message$5.prototype, 'data', { - get () { - if (!this.raw.data) return ''; - return this.raw.data.toString('utf8'); - }, - set (value) { - if (!value) value = ''; - const hash = crypto$e.createHash('sha256').update(value.toString('utf8')); - this.raw.hash = hash.digest(); - this.raw.data = Buffer.from(value); - this.raw.size.write(padDigits(this.raw.data.byteLength.toString(16), 8), 'hex'); - } - }); - - var message$1 = Message$5; - - // Dependencies - const crypto$d = require$$0__default["default"]; - const stream$1 = require$$2__default["default"]; - const path$e = require$$1__default["default"]; - - // Public modules - // TODO: remove - const merge$8 = lodash_merge.exports; - const pointer$2 = jsonPointer$1; - const manager = duplex; - - // Fabric Types - const Actor$b = actor; - const Collection$4 = collection$1; - const Resource$5 = resource$1; - const Entity$5 = entity; - const Hash256$6 = hash256$l; - const Key$8 = key$1; - const Message$4 = message$1; - const Store$2 = store_1; - - /** - * The "Service" is a simple model for processing messages in a distributed - * system. {@link Service} instances are public interfaces for outside systems, - * and typically advertise their presence to the network. - * - * To implement a Service, you will typically need to implement all methods from - * this prototype. In general, `connect` and `send` are the highest-priority - * jobs, and by default the `fabric` property will serve as an I/O stream using - * familiar semantics. - * @access protected - * @property map The "map" is a hashtable of "key" => "value" pairs. - */ - class Service$8 extends Actor$b { - /** - * Create an instance of a Service. - * @param {Object} settings Configuration for this service. - * @param {Boolean} [settings.networking=true] Whether or not to connect to the network. - * @param {Object} [settings.@data] Internal data to assign. - */ - constructor (settings = {}) { - // Initialize Scribe, our logging tool - super(settings); - - // Configure (with defaults) - this.settings = merge$8({ - name: 'service', - path: './stores/service', - networking: true, - persistent: false, - interval: 60000, // Mandatory Checkpoint Interval - verbosity: 2, // 0 none, 1 error, 2 warning, 3 notice, 4 debug - // TODO: export this as the default data in `inputs/fabric.json` - // If the sha256(JSON.stringify(this.data)) is equal to this, it's - // considered a valid Fabric object (for now!) - /* '@data': { - channels: {}, - messages: {}, - members: {} - } */ - }, this.settings, settings); - - // Reserve a place for ourselves - this.agent = null; - this.actor = null; - this.name = this.settings.name; - - this.collections = {}; - this.definitions = {}; - this.resources = {}; - this.services = {}; - this.methods = {}; - this.clients = {}; - this.targets = []; - this.history = []; - this.origin = ''; - - // TODO: fix this - // 2) RPG Lite - // Canvas - // can draw a canvas: - // Error: Not implemented yet - this.key = new Key$8(this.settings.key); - - if (this.settings.persistent) { - try { - this.store = new Store$2(this.settings); - } catch (E) { - console.error('Error:', E); - } - } - - // set local state to whatever configuration supplies... - /* this.state = Object.assign({ - messages: {} // always define a list of messages for Fabric services - }, this.config['@data']); */ - this._state = { - clock: 0, - epochs: {}, // snapshots of history (by ID) - history: [], // list of ... - services: {}, // stores sub-service state - status: 'PAUSED', - content: {}, - version: 0 // TODO: change to 1 for 0.1.0 - }; - - // Keeps track of changes - this.observer = null; - - /* if (this.settings.networking) { - this.swarm = new Swarm(this.settings); - } */ - - // Remove mutable variables - Object.defineProperty(this, '@version', { enumerable: false }); - Object.defineProperty(this, '@input', { enumerable: false }); - Object.defineProperty(this, '@data', { enumerable: false }); - Object.defineProperty(this, '@meta', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@entity', { enumerable: false }); - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - - // Remove sensitive objects - // Object.defineProperty(this, 'store', { enumerable: false }); - Object.defineProperty(this, 'observer', { enumerable: false }); - - // Provide the instance - return this; - } - - get clock () { - return parseInt(this._state.clock); - } - - get heartbeat () { - return this._heart; - } - - get status () { - return this._state.status; - } - - get members () { - return this['@data'].members; - } - - get targets () { - return this._targets; - } - - get state () { - return Object.assign({}, this._state.content); - } - - set clock (value) { - this._state.clock = parseInt(value); - } - - set state (value) { - // console.trace('[FABRIC:SERVICE]', 'Setting state:', value); - this._state = value; - } - - set status (value) { - if (!value) return this.status; - if (!this._state.status) this._state.status = 'PAUSED'; - this._state.status = value.toUpperCase(); - return this.status; - } - - set targets (value) { - this._targets = value; - } - - static fromName (name) { - let local = `services/${name}`; - let deep = `/../node_modules/@fabric/core/${local}.js`; - let fallback = path$e.dirname(require.main.filename) + deep; - let plugin = null; - - try { - plugin = commonjsRequire(local); - } catch (E) { - console.log('could not load main:', E); - try { - plugin = commonjsRequire(fallback); - } catch (E) { - console.log('Fallback service failed to load:', E); - } - } - - return plugin; - } - - alert (msg) { - // TODO: promise - // return Promise.all(Object.entries(this.services).filter().map()) - for (const [name, service] of Object.entries(this.services)) { - if (!this.settings.services.includes(name)) continue; - if (!service.alert) { - console.error('Service', name, 'does not have an alert function?'); - continue; - } - - service.alert(msg); - } - } - - identify () { - this.emit('auth', this.key.pubkey); - return this.key.pubkey; - } - - /** - * Called by Web Components. - * TODO: move to @fabric/http/types/spa - */ - init () { - this.components = {}; - } - - /** - * Move forward one clock cycle. - * @returns {Number} - */ - tick () { - return this.beat(); - } - - beat () { - const now = (new Date()).toISOString(); - - // Increment clock - ++this._clock; - - // TODO: remove async, use local state instead - // i.e., queue worker job - const beat = Message$4.fromVector(['Generic', { - clock: this._clock, - created: now, - state: this._state - }]); - - if (!beat) { - this.emit('error', 'Beat could not construct a Message!'); - console.trace(); - process.exit(); - } - - // TODO: parse JSON types in @fabric/core/types/message - let data = beat.data; - - try { - const parsed = JSON.parse(data); - data = JSON.stringify(parsed, null, ' '); - } catch (exception) { - this.emit('error', `Exception parsing beat: ${exception}`); - } - - this.emit('beat', beat); - this.commit(); - - return this; - } - - append (block) { - if (this.best !== block.parent) throw new Error(`Block does not attach to current chain. Block ID: ${block.id} Block Parent: ${block.parent} Current Best: ${this.best}`); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path = '') { - let result = null; - try { - result = pointer$2.get(this._state.content, path); - } catch (exception) { - console.error('[FABRIC:STATE]', 'Could not retrieve path:', path, pointer$2.get(this['@entity']['@data'], '/'), exception); - } - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - const result = pointer$2.set(this._state.content, path, value); - this.commit(); - return result; - } - - /** - * Explicitly trust all events from a known source. - * @param {EventEmitter} source Emitter of events. - * @return {Service} Instance of Service after binding events. - */ - trust (source, name = source.constructor.name) { - // Constants - const self = this; - - // Attach Event Listeners - if (source.settings && source.settings.debug) source.on('debug', this._handleTrustedDebug.bind(this)); - if (source.settings && source.settings.verbosity >= 0) { - source.on('audit', async function _handleTrustedAudit (audit) { - /* - const now = (new Date()).toISOString(); - const template = { - content: audit, - created: now, - type: 'Audit' - }; - - const actor = new Actor(template); - // TODO: transaction log - */ - }); - } - - return { - _handleActor: source.on('actor', async function (actor) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted actor:`, actor); - }), - _handleAlert: source.on('alert', async function (alert) { - self.alert(`[FABRIC:SERVICE] [ALERT] [!!!] ${name} alerted: ${alert}`); - }), - _handleBeat: source.on('beat', async function (beat) { - self.emit('debug', `[FABRIC:SERVICE] Source "${name}" emitted beat: ${JSON.stringify(beat, null, ' ')}`); - const ops = [ - { op: 'replace', path: `/services/${name}`, value: beat.state } - ]; - - try { - manager.applyPatch(self._state, ops); - await self.commit(); - } catch (exception) { - self.emit('error', `Could not process beat: ${exception}`); - } - }), - _handleChanges: source.on('changes', async function (changes) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted changes:`, changes); - }), - _handleChannel: source.on('channel', async function (channel) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted channel:`, channel); - }), - _handleCommit: source.on('commit', async function (commit) { - console.log(`[FABRIC:SERVICE] Source "${name}" committed:`, commit); - }), - _handleError: source.on('error', async function _handleTrustedError (error) { - console.error(`[FABRIC:SERVICE] Source "${name}" emitted error:`, error); - }), - _handleLog: source.on('log', async function _handleTrustedLog (log) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted log:`, log); - }), - _handleMessage: source.on('message', async function (message) { - self.emit('debug', `[FABRIC:SERVICE] Source "${name}" emitted message: ${JSON.stringify(message.toObject ? message.toObject() : message, null, ' ')}`); - await self._handleTrustedMessage(message); - }), - _handlePatches: source.on('patches', async function (patches) { - self.emit('debug', `[FABRIC:SERVICE] [${name}] Service State:`, source._state); - // TODO: apply changes to parent (self) - }), - _handleReady: source.on('ready', async function _handleTrustedReady (info) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted ready:`, info); - }), - _handleTip: source.on('tip', async function (hash) { - self.alert(`[FABRIC:SERVICE] New ${name} chaintip: ${hash}`); - }), - _handleWarning: source.on('warning', async function _handleTrustedWarning (warning) { - console.warn(`[FABRIC:SERVICE] Source "${name}" emitted warning:`, warning); - }) - }; - } - - define (name, value) { - this.definitions[name] = Object.assign({ - data: {}, - handler: function handler (msg) { - return null; - } - }, value); - - return this; - } - - ready () { - this.emit('ready'); - } - - replay (list = []) { - for (let i = 0; i < list.length; i++) { - this.route(list[i]); - } - - return this; - } - - toString () { - let entity = new Entity$5(this.state); - return entity.toString(); - } - - /** - * Default route handler for an incoming message. Follows the Activity - * Streams 2.0 spec: https://www.w3.org/TR/activitystreams-core/ - * @param {Activity} message Message object. - * @return {Service} Chainable method. - */ - handler (message) { - try { - this.emit('message', { - actor: message.actor, - target: message.target, - object: message.object - }); - } catch (E) { - this.error('Malformed message:', message); - } - - return this; - } - - /** - * Attempt to acquire a lock for `duration` seconds. - * @param {Number} [duration=1000] Number of milliseconds to hold lock. - * @returns {Boolean} true if locked, false if unable to lock. - */ - lock (duration = 1000) { - if (this._state.status === 'LOCKED') return false; - this._state.status = 'LOCKED'; - this.locker = new Actor$b({ - created: (new Date()).toISOString(), - contract: (setTimeout(() => { - delete this.locker; - this._state.status = 'UNLOCKED'; - }, duration)) - }); - - return true; - } - - _defineResource (name, definition) { - const resource = Object.assign({ name }, definition); - this.resources[name] = new Resource$5(resource); - this.emit('resource', this.resources[name]); - } - - _handleTrustedDebug (message) { - this.emit('debug', `[FABRIC:SERVICE] Trusted Source emitted debug: ${message}`); - } - - _handleTrustedMessage (message) { - this.emit('message', message); - } - - async process () { - console.log('process created'); - } - - async broadcast (msg) { - if (!msg['@type']) throw new Error('Message must have a @type property.'); - if (!msg['@data']) throw new Error('Message must have a @data property.'); - - for (let name in this.clients) { - let target = this.clients[name]; - console.log('[FABRIC:SERVICE]', 'Sending broadcast to client:', target); - } - - this.emit('message', msg); - } - - /** - * Resolve a {@link State} from a particular {@link Message} object. - * @param {Message} msg Explicit Fabric {@link Message}. - * @return {Promise} Resolves with resulting {@link State}. - */ - async route (msg) { - console.log('[FABRIC:SERVICE]', 'routing message:', msg); - console.log('[FABRIC:SERVICE]', 'definitions:', Object.keys(this.definitions)); - - let result = null; - - if (this.definitions[msg.type]) { - console.log('[FABRIC:SERVICE]', this.name, 'received a well-defined message type from message in requested route:', msg); - - let handler = this.definitions[msg.type].handler; - let state = handler.apply(this.state, [msg]); - - console.log('sample:', state); - console.log('sample.channels:', state.channels); - console.log('sample.messages:', state.messages); - - result = state; - - let commit = await this.commit(); - console.log('commit:', commit); - } - - return result; - } - - /** - * Start the service, including the initiation of an outbound connection - * to any peers designated in the service's configuration. - */ - async start () { - this.emit('debug', `[FABRIC:SERVICE] Starting as ${this.id}...`); - - const service = this; - - // Assign status and process - this.status = 'starting'; - - // Define an Actor with all current settings - this.actor = new Actor$b(this.settings); - - /* await this.define('message', { - name: 'message', - handler: this.process.bind(this.state), - exclusive: true // override all previous types - }); */ - - for (const name in this.settings.resources) { - const resource = this.settings.resources[name]; - const attribute = resource.routes.list.split('/')[1]; - const key = crypto$d.createHash('sha256').update(resource.routes.list).digest('hex'); - - // Assign collection - this.collections[key] = new Collection$4(resource); - - // Add to targets - this.targets.push(this.collections[key].routes.list); - - // Define mappings - Object.defineProperty(this, attribute, { - get: function () { - return this.collections[key]; - } - }); - - // Attach events - this.collections[key].on('commit', (commit) => { - service.broadcast({ - '@type': 'StateUpdate', - '@data': service.state - }); - }); - - this.collections[key].on('message', (message) => { - console.log('[FABRIC:SERVICE]', 'Internal message:', key, message); - }); - - this.collections[key].on('transaction', (transaction) => { - console.log('[FABRIC:SERVICE]', 'Internal transaction:', key, transaction); - }); - - this.collections[key].on('changes', (changes) => { - service._applyChanges(changes); - service.emit('change', { - type: 'Change', - data: changes - }); - }); - } - - if (this.settings.persistent) { - try { - await this.store.start(); - } catch (E) { - console.error('[FABRIC:SERVICE]', 'Could not start store:', E); - } - } - - await this._startAllServices(); - - if (this.settings.networking) { - await this.connect(); - } - - // TODO: re-re-evaluate a better approach... oh how I long for Object.observe! - // this.observer = manager.observe(this.state, this._handleStateChange.bind(this)); - this.observer = manager.observe(this._state); - - // Set a heartbeat - await this._startHeart(); - - this.status = 'ready'; - this.emit('log', '[FABRIC:SERVICE] Started!'); - this.ready(); - - return this; - } - - async stop () { - if (this.settings.networking) { - await this.disconnect(); - } - - if (this._heart) { - clearInterval(this._heart); - } - - if (this.settings.persistent) { - try { - await this.store.stop(); - } catch (E) { - console.error('[FABRIC:SERVICE]', 'Exception stopping store:', E); - } - } - - return this; - } - - /** - * Retrieve a value from the Service's state. - * @param {String} path Path of the value to retrieve. - * @return {Promise} Resolves with the result. - */ - async _GET (path) { - let result = null; - if (typeof path !== 'string') return null; - - let parts = path.split('/'); - let list = `/${parts[1]}`; - let name = crypto$d.createHash('sha256').update(list).digest('hex'); - - if (path === '/') return this.state; - if (this.collections[name]) { - if (parts[2]) { - let inner = this.collections[name].filter((x) => { - return (x.address === parts[2]); - })[0]; - return inner; - } - } - - try { - result = pointer$2.get(this.state, path); - } catch (E) { - console.trace(`Could not _GET() ${path}:`, E); - } - - return result; - } - - /** - * Store a value in the Service's state. - * @param {String} path Path to store the value at. - * @param {Object} value Document to store. - * @param {Boolean} [commit=false] Sign the resulting state. - * @return {Promise} Resolves with with stored document. - */ - async _PUT (path, value, commit = true) { - let result = null; - - if (path === '/') { - this.state = value; - } else { - try { - result = pointer$2.set(this.state, path, value); - } catch (E) { - this.error(`Could not _PUT() ${path}:`, E); - } - } - - if (commit) { - await this.commit(); - } - - return result; - } - - async _POST (path, data, commit = true) { - if (!path) throw new Error('Path must be provided.'); - if (!data) throw new Error('Data must be provided.'); - - const name = crypto$d.createHash('sha256').update(path).digest('hex'); - const hash = crypto$d.createHash('sha256').update(JSON.stringify(data)).digest('hex'); - - let result = null; - - // always use locally computed values - data.address = hash; - - let object = new Entity$5(data); - let collection = null; - let memory = null; - - try { - memory = await pointer$2.get(this.state, path); - } catch (E) { - this.emit('warning', `[FABRIC:SERVICE] posting to unloaded collection: ${path}`); - memory = []; - } - - try { - collection = new Collection$4(memory); - } catch (E) { - console.error('Could not create collection:', E, memory); - } - - // TODO: use Resource definition to de-deuplicate by fields.id - collection.push(object.toObject()); - this.collections[name] = await collection.populate(); - - // TODO: reduce storage to references - try { - await this._PUT(path, await collection.populate()); - await this.set(path, await collection.populate()); - result = `${path}/${data.address}`; - } catch (E) { - console.log('NOPE:', E); - } - - if (commit) await this.commit(); - - return result; - } - - /** - * Attach to network. - * @param {Boolean} notify Commit to changes. - * @return {Promise} Resolves to {@link Fabric}. - */ - async connect (notify = true) { - // TODO: implement a basic Stream - this.status = 'connecting'; - - // stub for a transform stream - this.fabric = new stream$1.Transform({ - transform (chunk, encoding, callback) { - callback(null, chunk); - } - }); - - if (this.store) { - try { - const prior = await this.store.get('/'); - this.state = JSON.parse(prior); - } catch (exception) { - this.emit('warning', `[FABRIC:SERVICE] Could not restore state: ${exception}`); - } - } - - if (this.settings.networking && this.swarm) { - await this.swarm.start(); - } - - this.connection = null; - this.status = 'connected'; - - if (notify) { - await this.ready(); - } - - return this.fabric; - } - - async disconnect () { - this.status = 'disconnecting'; - // if (this.status !== 'active') return this; - if (this.settings.networking && this.swarm) await this.swarm.stop(); - this.status = 'disconnected'; - return this; - } - - async subscribe (actorID, channelID) { - if (!actorID) throw new Error('Must provide actor ID.'); - if (!channelID) throw new Error('Must provide channel ID.'); - - const label = Hash256$6.digest(actorID + channelID); - const actor = await this._getActor(actorID); - const channel = await this._getChannel(channelID); - - if (!actor) throw new Error(`Actor does not exist: ${actorID}`); - if (!channel) throw new Error(`Channel does not exist: ${channelID}`); - - const link = await this._POST('/subscriptions', { label }); - - await this._applyChanges([ - { op: 'add', value: channelID, path: `/actors/${actor.id}/subscriptions/0` }, - { op: 'add', value: channelID, path: `/channels/${channel.id}/members/0` } - ]); - - await this.commit(); - - const result = await this._GET(link); - this.emit('subscription', result); - - return result; - } - - async join (id) { - this.log('join() is not yet implemented for this service.'); - } - - async whisper (target, message) { - this.log('The "whisper" function is not yet implemented.'); - return this; - } - - /** - * Send a message to a channel. - * @param {String} channel Channel name to which the message will be sent. - * @param {String} message Content of the message to send. - * @return {Service} Chainable method. - */ - async send (channel, message, extra) { - if (this.debug) console.log('[SERVICE]', 'send()', 'Sending:', channel, message, extra); - - const path = Buffer.alloc(256); - const payload = Buffer.alloc(2048); - const checksum = Buffer.alloc(64); - const entropy = Buffer.alloc(1726); // fill to 4096 - - path.write(channel); - payload.write(message); - - const msg = Buffer.concat([ path, payload ]); - const hash = crypto$d.createHash('sha256').update(msg).digest('hex'); - - checksum.write(hash); - - const block = Buffer.concat([ - Buffer.from([0x01]), // version byte - Buffer.from([0x00]), // placeholder - checksum, - msg, - entropy - ]); - - this.fabric.write(block); - - return this; - } - - commit () { - if (this.settings.verbosity >= 4) this.emit('log', '[FABRIC:SERVICE] Committing...'); - - const self = this; - const ops = []; - - // assemble all necessary info, emit Snapshot regardless of storage status - try { - ops.push({ type: 'put', key: 'snapshot', value: self.state }); - this.emit('debug', JSON.stringify({ - '@data': self.state, - '@from': 'COMMIT', - '@type': 'Snapshot' - })); - } catch (E) { - console.error('Error saving state:', self.state); - console.error('Could not commit to state:', E); - } - - if (this.settings.persistent) { - // TODO: add robust + convenient database opener - this.store.batch(ops, function shareChanges () { - // TODO: notify status? - }).catch((exception) => { - self.emit('error', `Could not write to store: ${exception}`); - }).then((output) => { - self.emit('commit', { output }); - }); - } - - const commit = new Actor$b({ - type: 'Commit', - state: self.state - }); - - this.emit('commit', { ...commit.toObject(), id: commit.id }); - - return commit.id; - } - - async _handleBitcoinCommit (commit) { - console.log('[FABRIC:SERVICE] Handling (Bitcoin?) commit:', commit); - } - - async _attachBindings (emitter) { - const service = this; - - emitter.on('attached', function () { - service.emit('attached', { - type: 'Notification', - message: 'Bindings complete!' - }); - }); - - emitter.emit('attached'); - - return service; - } - - async _bindStore (store) { - this.store = store; - return this; - } - - async _getActor (id) { - if (!id) return this.error('Parameter "id" is required.'); - let path = pointer$2.escape(id); - return this._GET(`/actors/${path}`); - } - - async _getChannel (id) { - if (!id) return this.error('Parameter "id" is required.'); - let target = pointer$2.escape(id); - return this._GET(`/channels/${target}`); - } - - /** - * Register an {@link Actor} with the {@link Service}. - * @param {Object} actor Instance of the {@link Actor}. - * @return {Promise} Resolves upon successful registration. - */ - async _registerActor (actor = {}) { - if (!actor.id) { - const entity = new Actor$b(actor); - actor = { ...entity.toObject(), id: entity.id }; - } - - const id = pointer$2.escape(actor.id); - const path = `/actors/${id}`; - - try { - await this._PUT(path, merge$8({ - name: actor.id, - subscriptions: [] - }, actor, { id })); - } catch (E) { - return this.error('Something went wrong saving:', E); - } - - await this.commit(); - - const registration = await this._GET(path); - this.emit('actor', registration); - - return registration; - } - - async _registerChannel (channel) { - if (!channel.id) { - const entity = new Actor$b(channel); - channel = merge$8({ - id: entity.id, - members: [] - }, channel); - } - - const target = pointer$2.escape(channel.id); - const path = `/channels/${target}`; - - try { - this._PUT(path, merge$8({ - members: [] - }, channel)); - } catch (E) { - this.log(`Failed to register channel "${channel.id}":`, E); - } - - await this.commit(); - - const registration = await this._GET(path); - this.emit('channel', registration); - - return registration; - } - - async _addMemberToChannel (memberID, channelID) { - return this.subscribe(memberID, channelID); - } - - async _registerMethod (name, method) { - this.methods[name] = method.bind(this); - } - - async _updatePresence (id, status) { - const target = pointer$2.escape(id); - const presence = (status === 'online') ? 'online' : 'offline'; - return this._PUT(`/actors/${target}/presence`, presence); - } - - async _getPresence (id) { - const member = await this._GET(`/actors/${id}`); - return member.presence || null; - } - - async _getMembers (id) { - const channel = await this._GET(`/channels/${id}`); - if (!channel) throw new Error(`No such channel: ${id}`); - return channel.members || null; - } - - async _getSubscriptions (id) { - const member = await this._GET(`/actors/${id}`); - return member.subscriptions || null; - } - - async _listActors () { - return Object.values(await this._GET('/actors')); - } - - async _listChannels () { - return Object.values(await this._GET('/channels')); - } - - async _applyChanges (changes) { - let result = null; - - try { - // TODO: allow configurable validators - result = manager.applyPatch(this.state, changes, function isValid () { - return true; - }, true /* mutate doc (1st param) */); - } catch (exception) { - console.error('Could not apply changes:', changes, exception); - } - - await this.commit(); - - return result; - } - - async _handleStateChange (changes) { - console.log('MAGIC HANDLER:', changes); - this.emit('message', { - '@type': 'Transaction', - '@data': { - // TODO: update this in constructor - parent: this.origin, - changes: changes - } - }); - } - - async _heartbeat () { - return this.tick(); - } - - /** - * Sends a message. - * @param {Mixed} message Message to send. - */ - async _send (message) { - const entity = new Entity$5(message); - await this._PUT(`/messages/${entity.id}`, message); - return entity.id; - } - - async _registerService (name, Service) { - const self = this; - const settings = merge$8({}, this.settings, this.settings[name]); - const service = new Service(settings); - - if (this.services[name]) { - return this._appendWarning(`Service already registered: ${name}`); - } - - this.services[name] = service; - this.services[name].on('error', function (msg) { - self.emit('error', `Service "${name}" emitted error: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('warning', function (msg) { - self.emit('warning', `Service warning from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('message', function (msg) { - self.emit('message', `Service message from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.on('identity', async function _registerActor (identity) { - if (self.settings.services && self.settings.services.includes(name)) { - self.emit('log', `Registering actor on service "${name}": ${JSON.stringify(identity)}`); - - try { - let registration = await self.services[name]._registerActor(identity); - self.emit('log', `Registered Actor: ${JSON.stringify(registration, null, ' ')}`); - } catch (exception) { - self.emit('error', `Error from service "${name}" during _registerActor: ${exception}`); - } - } - }); - - if (service.routes && service.routes.length) { - for (let i = 0; i < service.routes.length; i++) { - const route = service.routes[i]; - this.http._addRoute(route.method, route.path, route.handler); - } - } - - await this.commit(); - - return this; - } - - async _startAllServices () { - if (!this.services) return this.emit('warning', 'Tried to start subservices, but none existed.'); - // Start all Services - for (const [name, service] of Object.entries(this.services)) { - // TODO: re-evaluate inclusion on Service itself - if (this.settings.services && this.settings.services.includes(name)) { - this.emit('debug', `Starting service "${name}" (with trust)`); - // TODO: evaluate @fabric/core/types/store - // TODO: isomorphic @fabric/core/types/store - // await this.services[name]._bindStore(this.store); - this.trust(this.services[name], name); - - try { - await this.services[name].start(); - } catch (exception) { - this.emit('warning', `Could not start the "${name}" service due to exception: ${JSON.stringify(exception, null, ' ')}`); - } - } - } - - return this; - } - - async _startHeart () { - this._heart = setInterval(this.beat.bind(this), this.settings.interval); - } - } - - var service_1 = Service$8; - - /* - * Generated by PEG.js 0.10.0. - * - * http://pegjs.org/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - } - - function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; - - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } - } - - peg$subclass(peg$SyntaxError, Error); - - peg$SyntaxError.buildMessage = function(expected, found) { - var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - "class": function(expectation) { - var escapedParts = "", - i; - - for (i = 0; i < expectation.parts.length; i++) { - escapedParts += expectation.parts[i] instanceof Array - ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) - : classEscape(expectation.parts[i]); - } - - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, - - any: function(expectation) { - return "any character"; - }, - - end: function(expectation) { - return "end of input"; - }, - - other: function(expectation) { - return expectation.description; - } - }; - - function hex(ch) { - return ch.charCodeAt(0).toString(16).toUpperCase(); - } - - function literalEscape(s) { - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\0/g, '\\0') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); - } - - function classEscape(s) { - return s - .replace(/\\/g, '\\\\') - .replace(/\]/g, '\\]') - .replace(/\^/g, '\\^') - .replace(/-/g, '\\-') - .replace(/\0/g, '\\0') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); - } - - function describeExpectation(expectation) { - return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); - } - - function describeExpected(expected) { - var descriptions = new Array(expected.length), - i, j; - - for (i = 0; i < expected.length; i++) { - descriptions[i] = describeExpectation(expected[i]); - } - - descriptions.sort(); - - if (descriptions.length > 0) { - for (i = 1, j = 1; i < descriptions.length; i++) { - if (descriptions[i - 1] !== descriptions[i]) { - descriptions[j] = descriptions[i]; - j++; - } - } - descriptions.length = j; - } - - switch (descriptions.length) { - case 1: - return descriptions[0]; - - case 2: - return descriptions[0] + " or " + descriptions[1]; - - default: - return descriptions.slice(0, -1).join(", ") - + ", or " - + descriptions[descriptions.length - 1]; - } - } - - function describeFound(found) { - return found ? "\"" + literalEscape(found) + "\"" : "end of input"; - } - - return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; - }; - - function peg$parse(input, options) { - options = options !== void 0 ? options : {}; - - var peg$FAILED = {}, - - peg$startRuleFunctions = { start: peg$parsestart }, - peg$startRuleFunction = peg$parsestart, - - peg$c0 = "strict", - peg$c1 = peg$literalExpectation("strict", true), - peg$c2 = "graph", - peg$c3 = peg$literalExpectation("graph", true), - peg$c4 = "digraph", - peg$c5 = peg$literalExpectation("digraph", true), - peg$c6 = "{", - peg$c7 = peg$literalExpectation("{", false), - peg$c8 = "}", - peg$c9 = peg$literalExpectation("}", false), - peg$c10 = function(strict, type, id, children) { - if (children === null) children = []; - var ret = {type:type.toLowerCase(), children:children}; - if (strict) { ret.strict = true; } - if (id) { ret.id = id; } - return ret; - }, - peg$c11 = ";", - peg$c12 = peg$literalExpectation(";", false), - peg$c13 = function(s, other) { return other; }, - peg$c14 = function(s, e) { return [s].concat(e); }, - peg$c15 = "=", - peg$c16 = peg$literalExpectation("=", false), - peg$c17 = function(left, right) { - return { - type:'attr_stmt', - target:'graph', - attr_list:[{ - type:'attr', - id:left, - eq:right - }] - }; - }, - peg$c18 = "node", - peg$c19 = peg$literalExpectation("node", true), - peg$c20 = "edge", - peg$c21 = peg$literalExpectation("edge", true), - peg$c22 = function(target, attr) { - return { - type:'attr_stmt', - target:target, - attr_list:attr - }; - }, - peg$c23 = "[", - peg$c24 = peg$literalExpectation("[", false), - peg$c25 = "]", - peg$c26 = peg$literalExpectation("]", false), - peg$c27 = function(list, rest) { - return (list || []).concat(rest || []); - }, - peg$c28 = function(id, v) {return v}, - peg$c29 = ",", - peg$c30 = peg$literalExpectation(",", false), - peg$c31 = function(id, eq, rest) { - return [{ - type:'attr', - id:id, - eq: eq - }].concat(rest || []); - }, - peg$c32 = function(id, rhs, attr) { - var edge_list = [id]; - edge_list = edge_list.concat(rhs.map(function(v){return v.id})); - - return { - type:'edge_stmt', - edge_list:edge_list, - attr_list:attr || [] - }; - }, - peg$c33 = "->", - peg$c34 = peg$literalExpectation("->", false), - peg$c35 = "--", - peg$c36 = peg$literalExpectation("--", false), - peg$c37 = function(edgeop, id, rest) { - return [{ - type:'edgeRHS', - edgeop:edgeop, - id:id - }].concat(rest || []); - }, - peg$c38 = function(id, attr) { - return { - type:'node_stmt', - node_id:id, - attr_list:attr || [] - }; - }, - peg$c39 = function(id, port) { - return port ? { - type:'node_id', id:id, port:port - } : { - type:'node_id', id:id - }; - }, - peg$c40 = peg$otherExpectation("port"), - peg$c41 = ":", - peg$c42 = peg$literalExpectation(":", false), - peg$c43 = function(id, pt) {return pt}, - peg$c44 = function(id, pt) { - return { - type:'port', - id:id, - compass_pt:pt || null - }; - }, - peg$c45 = function(pt) { - return { - type:'port', - compass_pt:pt || null - } - }, - peg$c46 = "subgraph", - peg$c47 = peg$literalExpectation("subgraph", true), - peg$c48 = function(id) { - return id ? { - type:'subgraph', id:id - } : { - type:'subgraph' - } - }, - peg$c49 = function(g, s) { - g = g || { - type:'subgraph' - }; - g.children = s || []; - return g; - }, - peg$c50 = "n", - peg$c51 = peg$literalExpectation("n", false), - peg$c52 = "ne", - peg$c53 = peg$literalExpectation("ne", false), - peg$c54 = "e", - peg$c55 = peg$literalExpectation("e", false), - peg$c56 = "se", - peg$c57 = peg$literalExpectation("se", false), - peg$c58 = "s", - peg$c59 = peg$literalExpectation("s", false), - peg$c60 = "sw", - peg$c61 = peg$literalExpectation("sw", false), - peg$c62 = "w", - peg$c63 = peg$literalExpectation("w", false), - peg$c64 = "nw", - peg$c65 = peg$literalExpectation("nw", false), - peg$c66 = peg$otherExpectation("UNICODE_STRING"), - peg$c67 = function(first, rest) { - return first + rest.join(''); - }, - peg$c68 = "$", - peg$c69 = peg$literalExpectation("$", false), - peg$c70 = "_", - peg$c71 = peg$literalExpectation("_", false), - peg$c72 = peg$otherExpectation("NUMBER"), - peg$c73 = "-", - peg$c74 = peg$literalExpectation("-", false), - peg$c75 = ".", - peg$c76 = peg$literalExpectation(".", false), - peg$c77 = /^[0-9]/, - peg$c78 = peg$classExpectation([["0", "9"]], false, false), - peg$c79 = function(n) { - return parseFloat(text()); - }, - peg$c80 = function(v) { - return { - type:'id', - value:v.slice(1,v.length-1), - html:true - }; - }, - peg$c81 = "<", - peg$c82 = peg$literalExpectation("<", false), - peg$c83 = ">", - peg$c84 = peg$literalExpectation(">", false), - peg$c85 = function(v) { - return '<' + v.join('') + '>'; - }, - peg$c86 = peg$anyExpectation(), - peg$c87 = function(v) { return v; }, - peg$c88 = function(v) { return v.join(""); }, - peg$c89 = "\"", - peg$c90 = peg$literalExpectation("\"", false), - peg$c91 = function(chars) { return chars.join(""); }, - peg$c92 = function() { return text(); }, - peg$c93 = "\\", - peg$c94 = peg$literalExpectation("\\", false), - peg$c95 = function(v) { return v[1] === '"' ? '"' : v[0] + v[1]; }, - peg$c96 = function() { return ""; }, - peg$c97 = /^[\n\r\u2028\u2029]/, - peg$c98 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false), - peg$c99 = peg$otherExpectation("end of line"), - peg$c100 = "\n", - peg$c101 = peg$literalExpectation("\n", false), - peg$c102 = "\r\n", - peg$c103 = peg$literalExpectation("\r\n", false), - peg$c104 = "\r", - peg$c105 = peg$literalExpectation("\r", false), - peg$c106 = "\u2028", - peg$c107 = peg$literalExpectation("\u2028", false), - peg$c108 = "\u2029", - peg$c109 = peg$literalExpectation("\u2029", false), - peg$c116 = peg$otherExpectation("COMMENT"), - peg$c117 = peg$otherExpectation("BLOCK_COMMENT"), - peg$c118 = "/*", - peg$c119 = peg$literalExpectation("/*", false), - peg$c120 = "*/", - peg$c121 = peg$literalExpectation("*/", false), - peg$c122 = function(v) {return v;}, - peg$c123 = function(v) { return v.join('') }, - peg$c124 = peg$otherExpectation("C_COMMENT"), - peg$c125 = "//", - peg$c126 = peg$literalExpectation("//", false), - peg$c127 = /^[\n]/, - peg$c128 = peg$classExpectation(["\n"], false, false), - peg$c129 = function(v) { return v.join(''); }, - peg$c130 = peg$otherExpectation("MACRO_COMMENT"), - peg$c131 = "#", - peg$c132 = peg$literalExpectation("#", false), - peg$c133 = peg$otherExpectation("WHITESPACE"), - peg$c134 = /^[\n\r]/, - peg$c135 = peg$classExpectation(["\n", "\r"], false, false), - peg$c136 = /^[ \t]/, - peg$c137 = peg$classExpectation([" ", "\t"], false, false), - peg$c138 = /^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/, - peg$c139 = peg$classExpectation([["a", "z"], "\xB5", ["\xDF", "\xF6"], ["\xF8", "\xFF"], "\u0101", "\u0103", "\u0105", "\u0107", "\u0109", "\u010B", "\u010D", "\u010F", "\u0111", "\u0113", "\u0115", "\u0117", "\u0119", "\u011B", "\u011D", "\u011F", "\u0121", "\u0123", "\u0125", "\u0127", "\u0129", "\u012B", "\u012D", "\u012F", "\u0131", "\u0133", "\u0135", ["\u0137", "\u0138"], "\u013A", "\u013C", "\u013E", "\u0140", "\u0142", "\u0144", "\u0146", ["\u0148", "\u0149"], "\u014B", "\u014D", "\u014F", "\u0151", "\u0153", "\u0155", "\u0157", "\u0159", "\u015B", "\u015D", "\u015F", "\u0161", "\u0163", "\u0165", "\u0167", "\u0169", "\u016B", "\u016D", "\u016F", "\u0171", "\u0173", "\u0175", "\u0177", "\u017A", "\u017C", ["\u017E", "\u0180"], "\u0183", "\u0185", "\u0188", ["\u018C", "\u018D"], "\u0192", "\u0195", ["\u0199", "\u019B"], "\u019E", "\u01A1", "\u01A3", "\u01A5", "\u01A8", ["\u01AA", "\u01AB"], "\u01AD", "\u01B0", "\u01B4", "\u01B6", ["\u01B9", "\u01BA"], ["\u01BD", "\u01BF"], "\u01C6", "\u01C9", "\u01CC", "\u01CE", "\u01D0", "\u01D2", "\u01D4", "\u01D6", "\u01D8", "\u01DA", ["\u01DC", "\u01DD"], "\u01DF", "\u01E1", "\u01E3", "\u01E5", "\u01E7", "\u01E9", "\u01EB", "\u01ED", ["\u01EF", "\u01F0"], "\u01F3", "\u01F5", "\u01F9", "\u01FB", "\u01FD", "\u01FF", "\u0201", "\u0203", "\u0205", "\u0207", "\u0209", "\u020B", "\u020D", "\u020F", "\u0211", "\u0213", "\u0215", "\u0217", "\u0219", "\u021B", "\u021D", "\u021F", "\u0221", "\u0223", "\u0225", "\u0227", "\u0229", "\u022B", "\u022D", "\u022F", "\u0231", ["\u0233", "\u0239"], "\u023C", ["\u023F", "\u0240"], "\u0242", "\u0247", "\u0249", "\u024B", "\u024D", ["\u024F", "\u0293"], ["\u0295", "\u02AF"], "\u0371", "\u0373", "\u0377", ["\u037B", "\u037D"], "\u0390", ["\u03AC", "\u03CE"], ["\u03D0", "\u03D1"], ["\u03D5", "\u03D7"], "\u03D9", "\u03DB", "\u03DD", "\u03DF", "\u03E1", "\u03E3", "\u03E5", "\u03E7", "\u03E9", "\u03EB", "\u03ED", ["\u03EF", "\u03F3"], "\u03F5", "\u03F8", ["\u03FB", "\u03FC"], ["\u0430", "\u045F"], "\u0461", "\u0463", "\u0465", "\u0467", "\u0469", "\u046B", "\u046D", "\u046F", "\u0471", "\u0473", "\u0475", "\u0477", "\u0479", "\u047B", "\u047D", "\u047F", "\u0481", "\u048B", "\u048D", "\u048F", "\u0491", "\u0493", "\u0495", "\u0497", "\u0499", "\u049B", "\u049D", "\u049F", "\u04A1", "\u04A3", "\u04A5", "\u04A7", "\u04A9", "\u04AB", "\u04AD", "\u04AF", "\u04B1", "\u04B3", "\u04B5", "\u04B7", "\u04B9", "\u04BB", "\u04BD", "\u04BF", "\u04C2", "\u04C4", "\u04C6", "\u04C8", "\u04CA", "\u04CC", ["\u04CE", "\u04CF"], "\u04D1", "\u04D3", "\u04D5", "\u04D7", "\u04D9", "\u04DB", "\u04DD", "\u04DF", "\u04E1", "\u04E3", "\u04E5", "\u04E7", "\u04E9", "\u04EB", "\u04ED", "\u04EF", "\u04F1", "\u04F3", "\u04F5", "\u04F7", "\u04F9", "\u04FB", "\u04FD", "\u04FF", "\u0501", "\u0503", "\u0505", "\u0507", "\u0509", "\u050B", "\u050D", "\u050F", "\u0511", "\u0513", "\u0515", "\u0517", "\u0519", "\u051B", "\u051D", "\u051F", "\u0521", "\u0523", "\u0525", "\u0527", ["\u0561", "\u0587"], ["\u1D00", "\u1D2B"], ["\u1D6B", "\u1D77"], ["\u1D79", "\u1D9A"], "\u1E01", "\u1E03", "\u1E05", "\u1E07", "\u1E09", "\u1E0B", "\u1E0D", "\u1E0F", "\u1E11", "\u1E13", "\u1E15", "\u1E17", "\u1E19", "\u1E1B", "\u1E1D", "\u1E1F", "\u1E21", "\u1E23", "\u1E25", "\u1E27", "\u1E29", "\u1E2B", "\u1E2D", "\u1E2F", "\u1E31", "\u1E33", "\u1E35", "\u1E37", "\u1E39", "\u1E3B", "\u1E3D", "\u1E3F", "\u1E41", "\u1E43", "\u1E45", "\u1E47", "\u1E49", "\u1E4B", "\u1E4D", "\u1E4F", "\u1E51", "\u1E53", "\u1E55", "\u1E57", "\u1E59", "\u1E5B", "\u1E5D", "\u1E5F", "\u1E61", "\u1E63", "\u1E65", "\u1E67", "\u1E69", "\u1E6B", "\u1E6D", "\u1E6F", "\u1E71", "\u1E73", "\u1E75", "\u1E77", "\u1E79", "\u1E7B", "\u1E7D", "\u1E7F", "\u1E81", "\u1E83", "\u1E85", "\u1E87", "\u1E89", "\u1E8B", "\u1E8D", "\u1E8F", "\u1E91", "\u1E93", ["\u1E95", "\u1E9D"], "\u1E9F", "\u1EA1", "\u1EA3", "\u1EA5", "\u1EA7", "\u1EA9", "\u1EAB", "\u1EAD", "\u1EAF", "\u1EB1", "\u1EB3", "\u1EB5", "\u1EB7", "\u1EB9", "\u1EBB", "\u1EBD", "\u1EBF", "\u1EC1", "\u1EC3", "\u1EC5", "\u1EC7", "\u1EC9", "\u1ECB", "\u1ECD", "\u1ECF", "\u1ED1", "\u1ED3", "\u1ED5", "\u1ED7", "\u1ED9", "\u1EDB", "\u1EDD", "\u1EDF", "\u1EE1", "\u1EE3", "\u1EE5", "\u1EE7", "\u1EE9", "\u1EEB", "\u1EED", "\u1EEF", "\u1EF1", "\u1EF3", "\u1EF5", "\u1EF7", "\u1EF9", "\u1EFB", "\u1EFD", ["\u1EFF", "\u1F07"], ["\u1F10", "\u1F15"], ["\u1F20", "\u1F27"], ["\u1F30", "\u1F37"], ["\u1F40", "\u1F45"], ["\u1F50", "\u1F57"], ["\u1F60", "\u1F67"], ["\u1F70", "\u1F7D"], ["\u1F80", "\u1F87"], ["\u1F90", "\u1F97"], ["\u1FA0", "\u1FA7"], ["\u1FB0", "\u1FB4"], ["\u1FB6", "\u1FB7"], "\u1FBE", ["\u1FC2", "\u1FC4"], ["\u1FC6", "\u1FC7"], ["\u1FD0", "\u1FD3"], ["\u1FD6", "\u1FD7"], ["\u1FE0", "\u1FE7"], ["\u1FF2", "\u1FF4"], ["\u1FF6", "\u1FF7"], "\u210A", ["\u210E", "\u210F"], "\u2113", "\u212F", "\u2134", "\u2139", ["\u213C", "\u213D"], ["\u2146", "\u2149"], "\u214E", "\u2184", ["\u2C30", "\u2C5E"], "\u2C61", ["\u2C65", "\u2C66"], "\u2C68", "\u2C6A", "\u2C6C", "\u2C71", ["\u2C73", "\u2C74"], ["\u2C76", "\u2C7B"], "\u2C81", "\u2C83", "\u2C85", "\u2C87", "\u2C89", "\u2C8B", "\u2C8D", "\u2C8F", "\u2C91", "\u2C93", "\u2C95", "\u2C97", "\u2C99", "\u2C9B", "\u2C9D", "\u2C9F", "\u2CA1", "\u2CA3", "\u2CA5", "\u2CA7", "\u2CA9", "\u2CAB", "\u2CAD", "\u2CAF", "\u2CB1", "\u2CB3", "\u2CB5", "\u2CB7", "\u2CB9", "\u2CBB", "\u2CBD", "\u2CBF", "\u2CC1", "\u2CC3", "\u2CC5", "\u2CC7", "\u2CC9", "\u2CCB", "\u2CCD", "\u2CCF", "\u2CD1", "\u2CD3", "\u2CD5", "\u2CD7", "\u2CD9", "\u2CDB", "\u2CDD", "\u2CDF", "\u2CE1", ["\u2CE3", "\u2CE4"], "\u2CEC", "\u2CEE", "\u2CF3", ["\u2D00", "\u2D25"], "\u2D27", "\u2D2D", "\uA641", "\uA643", "\uA645", "\uA647", "\uA649", "\uA64B", "\uA64D", "\uA64F", "\uA651", "\uA653", "\uA655", "\uA657", "\uA659", "\uA65B", "\uA65D", "\uA65F", "\uA661", "\uA663", "\uA665", "\uA667", "\uA669", "\uA66B", "\uA66D", "\uA681", "\uA683", "\uA685", "\uA687", "\uA689", "\uA68B", "\uA68D", "\uA68F", "\uA691", "\uA693", "\uA695", "\uA697", "\uA723", "\uA725", "\uA727", "\uA729", "\uA72B", "\uA72D", ["\uA72F", "\uA731"], "\uA733", "\uA735", "\uA737", "\uA739", "\uA73B", "\uA73D", "\uA73F", "\uA741", "\uA743", "\uA745", "\uA747", "\uA749", "\uA74B", "\uA74D", "\uA74F", "\uA751", "\uA753", "\uA755", "\uA757", "\uA759", "\uA75B", "\uA75D", "\uA75F", "\uA761", "\uA763", "\uA765", "\uA767", "\uA769", "\uA76B", "\uA76D", "\uA76F", ["\uA771", "\uA778"], "\uA77A", "\uA77C", "\uA77F", "\uA781", "\uA783", "\uA785", "\uA787", "\uA78C", "\uA78E", "\uA791", "\uA793", "\uA7A1", "\uA7A3", "\uA7A5", "\uA7A7", "\uA7A9", "\uA7FA", ["\uFB00", "\uFB06"], ["\uFB13", "\uFB17"], ["\uFF41", "\uFF5A"]], false, false), - peg$c140 = /^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uAA70\uAADD\uAAF3-\uAAF4\uFF70\uFF9E-\uFF9F]/, - peg$c141 = peg$classExpectation([["\u02B0", "\u02C1"], ["\u02C6", "\u02D1"], ["\u02E0", "\u02E4"], "\u02EC", "\u02EE", "\u0374", "\u037A", "\u0559", "\u0640", ["\u06E5", "\u06E6"], ["\u07F4", "\u07F5"], "\u07FA", "\u081A", "\u0824", "\u0828", "\u0971", "\u0E46", "\u0EC6", "\u10FC", "\u17D7", "\u1843", "\u1AA7", ["\u1C78", "\u1C7D"], ["\u1D2C", "\u1D6A"], "\u1D78", ["\u1D9B", "\u1DBF"], "\u2071", "\u207F", ["\u2090", "\u209C"], ["\u2C7C", "\u2C7D"], "\u2D6F", "\u2E2F", "\u3005", ["\u3031", "\u3035"], "\u303B", ["\u309D", "\u309E"], ["\u30FC", "\u30FE"], "\uA015", ["\uA4F8", "\uA4FD"], "\uA60C", "\uA67F", ["\uA717", "\uA71F"], "\uA770", "\uA788", ["\uA7F8", "\uA7F9"], "\uA9CF", "\uAA70", "\uAADD", ["\uAAF3", "\uAAF4"], "\uFF70", ["\uFF9E", "\uFF9F"]], false, false), - peg$c142 = /^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58-\u0C59\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, - peg$c143 = peg$classExpectation(["\xAA", "\xBA", "\u01BB", ["\u01C0", "\u01C3"], "\u0294", ["\u05D0", "\u05EA"], ["\u05F0", "\u05F2"], ["\u0620", "\u063F"], ["\u0641", "\u064A"], ["\u066E", "\u066F"], ["\u0671", "\u06D3"], "\u06D5", ["\u06EE", "\u06EF"], ["\u06FA", "\u06FC"], "\u06FF", "\u0710", ["\u0712", "\u072F"], ["\u074D", "\u07A5"], "\u07B1", ["\u07CA", "\u07EA"], ["\u0800", "\u0815"], ["\u0840", "\u0858"], "\u08A0", ["\u08A2", "\u08AC"], ["\u0904", "\u0939"], "\u093D", "\u0950", ["\u0958", "\u0961"], ["\u0972", "\u0977"], ["\u0979", "\u097F"], ["\u0985", "\u098C"], ["\u098F", "\u0990"], ["\u0993", "\u09A8"], ["\u09AA", "\u09B0"], "\u09B2", ["\u09B6", "\u09B9"], "\u09BD", "\u09CE", ["\u09DC", "\u09DD"], ["\u09DF", "\u09E1"], ["\u09F0", "\u09F1"], ["\u0A05", "\u0A0A"], ["\u0A0F", "\u0A10"], ["\u0A13", "\u0A28"], ["\u0A2A", "\u0A30"], ["\u0A32", "\u0A33"], ["\u0A35", "\u0A36"], ["\u0A38", "\u0A39"], ["\u0A59", "\u0A5C"], "\u0A5E", ["\u0A72", "\u0A74"], ["\u0A85", "\u0A8D"], ["\u0A8F", "\u0A91"], ["\u0A93", "\u0AA8"], ["\u0AAA", "\u0AB0"], ["\u0AB2", "\u0AB3"], ["\u0AB5", "\u0AB9"], "\u0ABD", "\u0AD0", ["\u0AE0", "\u0AE1"], ["\u0B05", "\u0B0C"], ["\u0B0F", "\u0B10"], ["\u0B13", "\u0B28"], ["\u0B2A", "\u0B30"], ["\u0B32", "\u0B33"], ["\u0B35", "\u0B39"], "\u0B3D", ["\u0B5C", "\u0B5D"], ["\u0B5F", "\u0B61"], "\u0B71", "\u0B83", ["\u0B85", "\u0B8A"], ["\u0B8E", "\u0B90"], ["\u0B92", "\u0B95"], ["\u0B99", "\u0B9A"], "\u0B9C", ["\u0B9E", "\u0B9F"], ["\u0BA3", "\u0BA4"], ["\u0BA8", "\u0BAA"], ["\u0BAE", "\u0BB9"], "\u0BD0", ["\u0C05", "\u0C0C"], ["\u0C0E", "\u0C10"], ["\u0C12", "\u0C28"], ["\u0C2A", "\u0C33"], ["\u0C35", "\u0C39"], "\u0C3D", ["\u0C58", "\u0C59"], ["\u0C60", "\u0C61"], ["\u0C85", "\u0C8C"], ["\u0C8E", "\u0C90"], ["\u0C92", "\u0CA8"], ["\u0CAA", "\u0CB3"], ["\u0CB5", "\u0CB9"], "\u0CBD", "\u0CDE", ["\u0CE0", "\u0CE1"], ["\u0CF1", "\u0CF2"], ["\u0D05", "\u0D0C"], ["\u0D0E", "\u0D10"], ["\u0D12", "\u0D3A"], "\u0D3D", "\u0D4E", ["\u0D60", "\u0D61"], ["\u0D7A", "\u0D7F"], ["\u0D85", "\u0D96"], ["\u0D9A", "\u0DB1"], ["\u0DB3", "\u0DBB"], "\u0DBD", ["\u0DC0", "\u0DC6"], ["\u0E01", "\u0E30"], ["\u0E32", "\u0E33"], ["\u0E40", "\u0E45"], ["\u0E81", "\u0E82"], "\u0E84", ["\u0E87", "\u0E88"], "\u0E8A", "\u0E8D", ["\u0E94", "\u0E97"], ["\u0E99", "\u0E9F"], ["\u0EA1", "\u0EA3"], "\u0EA5", "\u0EA7", ["\u0EAA", "\u0EAB"], ["\u0EAD", "\u0EB0"], ["\u0EB2", "\u0EB3"], "\u0EBD", ["\u0EC0", "\u0EC4"], ["\u0EDC", "\u0EDF"], "\u0F00", ["\u0F40", "\u0F47"], ["\u0F49", "\u0F6C"], ["\u0F88", "\u0F8C"], ["\u1000", "\u102A"], "\u103F", ["\u1050", "\u1055"], ["\u105A", "\u105D"], "\u1061", ["\u1065", "\u1066"], ["\u106E", "\u1070"], ["\u1075", "\u1081"], "\u108E", ["\u10D0", "\u10FA"], ["\u10FD", "\u1248"], ["\u124A", "\u124D"], ["\u1250", "\u1256"], "\u1258", ["\u125A", "\u125D"], ["\u1260", "\u1288"], ["\u128A", "\u128D"], ["\u1290", "\u12B0"], ["\u12B2", "\u12B5"], ["\u12B8", "\u12BE"], "\u12C0", ["\u12C2", "\u12C5"], ["\u12C8", "\u12D6"], ["\u12D8", "\u1310"], ["\u1312", "\u1315"], ["\u1318", "\u135A"], ["\u1380", "\u138F"], ["\u13A0", "\u13F4"], ["\u1401", "\u166C"], ["\u166F", "\u167F"], ["\u1681", "\u169A"], ["\u16A0", "\u16EA"], ["\u1700", "\u170C"], ["\u170E", "\u1711"], ["\u1720", "\u1731"], ["\u1740", "\u1751"], ["\u1760", "\u176C"], ["\u176E", "\u1770"], ["\u1780", "\u17B3"], "\u17DC", ["\u1820", "\u1842"], ["\u1844", "\u1877"], ["\u1880", "\u18A8"], "\u18AA", ["\u18B0", "\u18F5"], ["\u1900", "\u191C"], ["\u1950", "\u196D"], ["\u1970", "\u1974"], ["\u1980", "\u19AB"], ["\u19C1", "\u19C7"], ["\u1A00", "\u1A16"], ["\u1A20", "\u1A54"], ["\u1B05", "\u1B33"], ["\u1B45", "\u1B4B"], ["\u1B83", "\u1BA0"], ["\u1BAE", "\u1BAF"], ["\u1BBA", "\u1BE5"], ["\u1C00", "\u1C23"], ["\u1C4D", "\u1C4F"], ["\u1C5A", "\u1C77"], ["\u1CE9", "\u1CEC"], ["\u1CEE", "\u1CF1"], ["\u1CF5", "\u1CF6"], ["\u2135", "\u2138"], ["\u2D30", "\u2D67"], ["\u2D80", "\u2D96"], ["\u2DA0", "\u2DA6"], ["\u2DA8", "\u2DAE"], ["\u2DB0", "\u2DB6"], ["\u2DB8", "\u2DBE"], ["\u2DC0", "\u2DC6"], ["\u2DC8", "\u2DCE"], ["\u2DD0", "\u2DD6"], ["\u2DD8", "\u2DDE"], "\u3006", "\u303C", ["\u3041", "\u3096"], "\u309F", ["\u30A1", "\u30FA"], "\u30FF", ["\u3105", "\u312D"], ["\u3131", "\u318E"], ["\u31A0", "\u31BA"], ["\u31F0", "\u31FF"], ["\u3400", "\u4DB5"], ["\u4E00", "\u9FCC"], ["\uA000", "\uA014"], ["\uA016", "\uA48C"], ["\uA4D0", "\uA4F7"], ["\uA500", "\uA60B"], ["\uA610", "\uA61F"], ["\uA62A", "\uA62B"], "\uA66E", ["\uA6A0", "\uA6E5"], ["\uA7FB", "\uA801"], ["\uA803", "\uA805"], ["\uA807", "\uA80A"], ["\uA80C", "\uA822"], ["\uA840", "\uA873"], ["\uA882", "\uA8B3"], ["\uA8F2", "\uA8F7"], "\uA8FB", ["\uA90A", "\uA925"], ["\uA930", "\uA946"], ["\uA960", "\uA97C"], ["\uA984", "\uA9B2"], ["\uAA00", "\uAA28"], ["\uAA40", "\uAA42"], ["\uAA44", "\uAA4B"], ["\uAA60", "\uAA6F"], ["\uAA71", "\uAA76"], "\uAA7A", ["\uAA80", "\uAAAF"], "\uAAB1", ["\uAAB5", "\uAAB6"], ["\uAAB9", "\uAABD"], "\uAAC0", "\uAAC2", ["\uAADB", "\uAADC"], ["\uAAE0", "\uAAEA"], "\uAAF2", ["\uAB01", "\uAB06"], ["\uAB09", "\uAB0E"], ["\uAB11", "\uAB16"], ["\uAB20", "\uAB26"], ["\uAB28", "\uAB2E"], ["\uABC0", "\uABE2"], ["\uAC00", "\uD7A3"], ["\uD7B0", "\uD7C6"], ["\uD7CB", "\uD7FB"], ["\uF900", "\uFA6D"], ["\uFA70", "\uFAD9"], "\uFB1D", ["\uFB1F", "\uFB28"], ["\uFB2A", "\uFB36"], ["\uFB38", "\uFB3C"], "\uFB3E", ["\uFB40", "\uFB41"], ["\uFB43", "\uFB44"], ["\uFB46", "\uFBB1"], ["\uFBD3", "\uFD3D"], ["\uFD50", "\uFD8F"], ["\uFD92", "\uFDC7"], ["\uFDF0", "\uFDFB"], ["\uFE70", "\uFE74"], ["\uFE76", "\uFEFC"], ["\uFF66", "\uFF6F"], ["\uFF71", "\uFF9D"], ["\uFFA0", "\uFFBE"], ["\uFFC2", "\uFFC7"], ["\uFFCA", "\uFFCF"], ["\uFFD2", "\uFFD7"], ["\uFFDA", "\uFFDC"]], false, false), - peg$c144 = /^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/, - peg$c145 = peg$classExpectation(["\u01C5", "\u01C8", "\u01CB", "\u01F2", ["\u1F88", "\u1F8F"], ["\u1F98", "\u1F9F"], ["\u1FA8", "\u1FAF"], "\u1FBC", "\u1FCC", "\u1FFC"], false, false), - peg$c146 = /^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A]/, - peg$c147 = peg$classExpectation([["A", "Z"], ["\xC0", "\xD6"], ["\xD8", "\xDE"], "\u0100", "\u0102", "\u0104", "\u0106", "\u0108", "\u010A", "\u010C", "\u010E", "\u0110", "\u0112", "\u0114", "\u0116", "\u0118", "\u011A", "\u011C", "\u011E", "\u0120", "\u0122", "\u0124", "\u0126", "\u0128", "\u012A", "\u012C", "\u012E", "\u0130", "\u0132", "\u0134", "\u0136", "\u0139", "\u013B", "\u013D", "\u013F", "\u0141", "\u0143", "\u0145", "\u0147", "\u014A", "\u014C", "\u014E", "\u0150", "\u0152", "\u0154", "\u0156", "\u0158", "\u015A", "\u015C", "\u015E", "\u0160", "\u0162", "\u0164", "\u0166", "\u0168", "\u016A", "\u016C", "\u016E", "\u0170", "\u0172", "\u0174", "\u0176", ["\u0178", "\u0179"], "\u017B", "\u017D", ["\u0181", "\u0182"], "\u0184", ["\u0186", "\u0187"], ["\u0189", "\u018B"], ["\u018E", "\u0191"], ["\u0193", "\u0194"], ["\u0196", "\u0198"], ["\u019C", "\u019D"], ["\u019F", "\u01A0"], "\u01A2", "\u01A4", ["\u01A6", "\u01A7"], "\u01A9", "\u01AC", ["\u01AE", "\u01AF"], ["\u01B1", "\u01B3"], "\u01B5", ["\u01B7", "\u01B8"], "\u01BC", "\u01C4", "\u01C7", "\u01CA", "\u01CD", "\u01CF", "\u01D1", "\u01D3", "\u01D5", "\u01D7", "\u01D9", "\u01DB", "\u01DE", "\u01E0", "\u01E2", "\u01E4", "\u01E6", "\u01E8", "\u01EA", "\u01EC", "\u01EE", "\u01F1", "\u01F4", ["\u01F6", "\u01F8"], "\u01FA", "\u01FC", "\u01FE", "\u0200", "\u0202", "\u0204", "\u0206", "\u0208", "\u020A", "\u020C", "\u020E", "\u0210", "\u0212", "\u0214", "\u0216", "\u0218", "\u021A", "\u021C", "\u021E", "\u0220", "\u0222", "\u0224", "\u0226", "\u0228", "\u022A", "\u022C", "\u022E", "\u0230", "\u0232", ["\u023A", "\u023B"], ["\u023D", "\u023E"], "\u0241", ["\u0243", "\u0246"], "\u0248", "\u024A", "\u024C", "\u024E", "\u0370", "\u0372", "\u0376", "\u0386", ["\u0388", "\u038A"], "\u038C", ["\u038E", "\u038F"], ["\u0391", "\u03A1"], ["\u03A3", "\u03AB"], "\u03CF", ["\u03D2", "\u03D4"], "\u03D8", "\u03DA", "\u03DC", "\u03DE", "\u03E0", "\u03E2", "\u03E4", "\u03E6", "\u03E8", "\u03EA", "\u03EC", "\u03EE", "\u03F4", "\u03F7", ["\u03F9", "\u03FA"], ["\u03FD", "\u042F"], "\u0460", "\u0462", "\u0464", "\u0466", "\u0468", "\u046A", "\u046C", "\u046E", "\u0470", "\u0472", "\u0474", "\u0476", "\u0478", "\u047A", "\u047C", "\u047E", "\u0480", "\u048A", "\u048C", "\u048E", "\u0490", "\u0492", "\u0494", "\u0496", "\u0498", "\u049A", "\u049C", "\u049E", "\u04A0", "\u04A2", "\u04A4", "\u04A6", "\u04A8", "\u04AA", "\u04AC", "\u04AE", "\u04B0", "\u04B2", "\u04B4", "\u04B6", "\u04B8", "\u04BA", "\u04BC", "\u04BE", ["\u04C0", "\u04C1"], "\u04C3", "\u04C5", "\u04C7", "\u04C9", "\u04CB", "\u04CD", "\u04D0", "\u04D2", "\u04D4", "\u04D6", "\u04D8", "\u04DA", "\u04DC", "\u04DE", "\u04E0", "\u04E2", "\u04E4", "\u04E6", "\u04E8", "\u04EA", "\u04EC", "\u04EE", "\u04F0", "\u04F2", "\u04F4", "\u04F6", "\u04F8", "\u04FA", "\u04FC", "\u04FE", "\u0500", "\u0502", "\u0504", "\u0506", "\u0508", "\u050A", "\u050C", "\u050E", "\u0510", "\u0512", "\u0514", "\u0516", "\u0518", "\u051A", "\u051C", "\u051E", "\u0520", "\u0522", "\u0524", "\u0526", ["\u0531", "\u0556"], ["\u10A0", "\u10C5"], "\u10C7", "\u10CD", "\u1E00", "\u1E02", "\u1E04", "\u1E06", "\u1E08", "\u1E0A", "\u1E0C", "\u1E0E", "\u1E10", "\u1E12", "\u1E14", "\u1E16", "\u1E18", "\u1E1A", "\u1E1C", "\u1E1E", "\u1E20", "\u1E22", "\u1E24", "\u1E26", "\u1E28", "\u1E2A", "\u1E2C", "\u1E2E", "\u1E30", "\u1E32", "\u1E34", "\u1E36", "\u1E38", "\u1E3A", "\u1E3C", "\u1E3E", "\u1E40", "\u1E42", "\u1E44", "\u1E46", "\u1E48", "\u1E4A", "\u1E4C", "\u1E4E", "\u1E50", "\u1E52", "\u1E54", "\u1E56", "\u1E58", "\u1E5A", "\u1E5C", "\u1E5E", "\u1E60", "\u1E62", "\u1E64", "\u1E66", "\u1E68", "\u1E6A", "\u1E6C", "\u1E6E", "\u1E70", "\u1E72", "\u1E74", "\u1E76", "\u1E78", "\u1E7A", "\u1E7C", "\u1E7E", "\u1E80", "\u1E82", "\u1E84", "\u1E86", "\u1E88", "\u1E8A", "\u1E8C", "\u1E8E", "\u1E90", "\u1E92", "\u1E94", "\u1E9E", "\u1EA0", "\u1EA2", "\u1EA4", "\u1EA6", "\u1EA8", "\u1EAA", "\u1EAC", "\u1EAE", "\u1EB0", "\u1EB2", "\u1EB4", "\u1EB6", "\u1EB8", "\u1EBA", "\u1EBC", "\u1EBE", "\u1EC0", "\u1EC2", "\u1EC4", "\u1EC6", "\u1EC8", "\u1ECA", "\u1ECC", "\u1ECE", "\u1ED0", "\u1ED2", "\u1ED4", "\u1ED6", "\u1ED8", "\u1EDA", "\u1EDC", "\u1EDE", "\u1EE0", "\u1EE2", "\u1EE4", "\u1EE6", "\u1EE8", "\u1EEA", "\u1EEC", "\u1EEE", "\u1EF0", "\u1EF2", "\u1EF4", "\u1EF6", "\u1EF8", "\u1EFA", "\u1EFC", "\u1EFE", ["\u1F08", "\u1F0F"], ["\u1F18", "\u1F1D"], ["\u1F28", "\u1F2F"], ["\u1F38", "\u1F3F"], ["\u1F48", "\u1F4D"], "\u1F59", "\u1F5B", "\u1F5D", "\u1F5F", ["\u1F68", "\u1F6F"], ["\u1FB8", "\u1FBB"], ["\u1FC8", "\u1FCB"], ["\u1FD8", "\u1FDB"], ["\u1FE8", "\u1FEC"], ["\u1FF8", "\u1FFB"], "\u2102", "\u2107", ["\u210B", "\u210D"], ["\u2110", "\u2112"], "\u2115", ["\u2119", "\u211D"], "\u2124", "\u2126", "\u2128", ["\u212A", "\u212D"], ["\u2130", "\u2133"], ["\u213E", "\u213F"], "\u2145", "\u2183", ["\u2C00", "\u2C2E"], "\u2C60", ["\u2C62", "\u2C64"], "\u2C67", "\u2C69", "\u2C6B", ["\u2C6D", "\u2C70"], "\u2C72", "\u2C75", ["\u2C7E", "\u2C80"], "\u2C82", "\u2C84", "\u2C86", "\u2C88", "\u2C8A", "\u2C8C", "\u2C8E", "\u2C90", "\u2C92", "\u2C94", "\u2C96", "\u2C98", "\u2C9A", "\u2C9C", "\u2C9E", "\u2CA0", "\u2CA2", "\u2CA4", "\u2CA6", "\u2CA8", "\u2CAA", "\u2CAC", "\u2CAE", "\u2CB0", "\u2CB2", "\u2CB4", "\u2CB6", "\u2CB8", "\u2CBA", "\u2CBC", "\u2CBE", "\u2CC0", "\u2CC2", "\u2CC4", "\u2CC6", "\u2CC8", "\u2CCA", "\u2CCC", "\u2CCE", "\u2CD0", "\u2CD2", "\u2CD4", "\u2CD6", "\u2CD8", "\u2CDA", "\u2CDC", "\u2CDE", "\u2CE0", "\u2CE2", "\u2CEB", "\u2CED", "\u2CF2", "\uA640", "\uA642", "\uA644", "\uA646", "\uA648", "\uA64A", "\uA64C", "\uA64E", "\uA650", "\uA652", "\uA654", "\uA656", "\uA658", "\uA65A", "\uA65C", "\uA65E", "\uA660", "\uA662", "\uA664", "\uA666", "\uA668", "\uA66A", "\uA66C", "\uA680", "\uA682", "\uA684", "\uA686", "\uA688", "\uA68A", "\uA68C", "\uA68E", "\uA690", "\uA692", "\uA694", "\uA696", "\uA722", "\uA724", "\uA726", "\uA728", "\uA72A", "\uA72C", "\uA72E", "\uA732", "\uA734", "\uA736", "\uA738", "\uA73A", "\uA73C", "\uA73E", "\uA740", "\uA742", "\uA744", "\uA746", "\uA748", "\uA74A", "\uA74C", "\uA74E", "\uA750", "\uA752", "\uA754", "\uA756", "\uA758", "\uA75A", "\uA75C", "\uA75E", "\uA760", "\uA762", "\uA764", "\uA766", "\uA768", "\uA76A", "\uA76C", "\uA76E", "\uA779", "\uA77B", ["\uA77D", "\uA77E"], "\uA780", "\uA782", "\uA784", "\uA786", "\uA78B", "\uA78D", "\uA790", "\uA792", "\uA7A0", "\uA7A2", "\uA7A4", "\uA7A6", "\uA7A8", "\uA7AA", ["\uFF21", "\uFF3A"]], false, false), - peg$c148 = /^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/, - peg$c149 = peg$classExpectation([["\u16EE", "\u16F0"], ["\u2160", "\u2182"], ["\u2185", "\u2188"], "\u3007", ["\u3021", "\u3029"], ["\u3038", "\u303A"], ["\uA6E6", "\uA6EF"]], false, false), - peg$c150 = /^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/, - peg$c151 = peg$classExpectation([["0", "9"], ["\u0660", "\u0669"], ["\u06F0", "\u06F9"], ["\u07C0", "\u07C9"], ["\u0966", "\u096F"], ["\u09E6", "\u09EF"], ["\u0A66", "\u0A6F"], ["\u0AE6", "\u0AEF"], ["\u0B66", "\u0B6F"], ["\u0BE6", "\u0BEF"], ["\u0C66", "\u0C6F"], ["\u0CE6", "\u0CEF"], ["\u0D66", "\u0D6F"], ["\u0E50", "\u0E59"], ["\u0ED0", "\u0ED9"], ["\u0F20", "\u0F29"], ["\u1040", "\u1049"], ["\u1090", "\u1099"], ["\u17E0", "\u17E9"], ["\u1810", "\u1819"], ["\u1946", "\u194F"], ["\u19D0", "\u19D9"], ["\u1A80", "\u1A89"], ["\u1A90", "\u1A99"], ["\u1B50", "\u1B59"], ["\u1BB0", "\u1BB9"], ["\u1C40", "\u1C49"], ["\u1C50", "\u1C59"], ["\uA620", "\uA629"], ["\uA8D0", "\uA8D9"], ["\uA900", "\uA909"], ["\uA9D0", "\uA9D9"], ["\uAA50", "\uAA59"], ["\uABF0", "\uABF9"], ["\uFF10", "\uFF19"]], false, false), - - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1 }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, - - peg$result; - - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } - - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } - - function text() { - return input.substring(peg$savedPos, peg$currPos); - } - - function peg$literalExpectation(text, ignoreCase) { - return { type: "literal", text: text, ignoreCase: ignoreCase }; - } - - function peg$classExpectation(parts, inverted, ignoreCase) { - return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; - } - - function peg$anyExpectation() { - return { type: "any" }; - } - - function peg$endExpectation() { - return { type: "end" }; - } - - function peg$otherExpectation(description) { - return { type: "other", description: description }; - } - - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], p; - - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; - } - - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column - }; - - while (p < pos) { - if (input.charCodeAt(p) === 10) { - details.line++; - details.column = 1; - } else { - details.column++; - } - - p++; - } - - peg$posDetailsCache[pos] = details; - return details; - } - } - - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); - - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } - - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } - - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } - - peg$maxFailExpected.push(expected); - } - - function peg$buildStructuredError(expected, found, location) { - return new peg$SyntaxError( - peg$SyntaxError.buildMessage(expected, found), - expected, - found, - location - ); - } - - function peg$parsestart() { - var s0, s1; - - s0 = []; - s1 = peg$parsegraph(); - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsegraph(); - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsegraph() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c0) { - s2 = input.substr(peg$currPos, 6); - peg$currPos += 6; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c1); } - } - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c2) { - s4 = input.substr(peg$currPos, 5); - peg$currPos += 5; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } - } - if (s4 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c4) { - s4 = input.substr(peg$currPos, 7); - peg$currPos += 7; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parseID(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 123) { - s8 = peg$c6; - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s8 !== peg$FAILED) { - s9 = peg$parsestmt_list(); - if (s9 === peg$FAILED) { - s9 = null; - } - if (s9 !== peg$FAILED) { - s10 = peg$parse_(); - if (s10 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s11 = peg$c8; - peg$currPos++; - } else { - s11 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } - } - if (s11 !== peg$FAILED) { - s12 = peg$parse_(); - if (s12 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s2, s4, s6, s9); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsestmt_list() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parsestmt(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s4 = peg$c11; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$currPos; - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parsestmt(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_(); - if (s9 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s10 = peg$c11; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c13(s2, s8); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$currPos; - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parsestmt(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_(); - if (s9 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s10 = peg$c11; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c13(s2, s8); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c14(s2, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsestmt() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c15; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseID(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c17(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseattr_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$parseedge_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$parsesubgraph(); - if (s0 === peg$FAILED) { - s0 = peg$parsenode_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s2 = peg$c15; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parseID(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - } - } - } - } - - return s0; - } - - function peg$parseattr_stmt() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c2) { - s1 = input.substr(peg$currPos, 5); - peg$currPos += 5; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c18) { - s1 = input.substr(peg$currPos, 4); - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c20) { - s1 = input.substr(peg$currPos, 4); - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseattr_list(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c22(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseattr_list() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 91) { - s2 = peg$c23; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c24); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsea_list(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 93) { - s6 = peg$c25; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parseattr_list(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c27(s4, s8); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsea_list() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parseID(); - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s5 = peg$c15; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseID(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c28(s2, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c29; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } - } - if (s5 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s5 = peg$c11; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - } - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsea_list(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c31(s2, s3, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseedge_stmt() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsesubgraph(); - if (s1 === peg$FAILED) { - s1 = peg$parsenode_id(); - } - if (s1 !== peg$FAILED) { - s2 = peg$parseedgeRHS(); - if (s2 !== peg$FAILED) { - s3 = peg$parseattr_list(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c32(s1, s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseedgeRHS() { - var s0, s1, s2, s3, s4, s5, s6; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c33) { - s2 = peg$c33; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } - } - if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c35) { - s2 = peg$c35; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } - } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsesubgraph(); - if (s4 === peg$FAILED) { - s4 = peg$parsenode_id(); - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parseedgeRHS(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c37(s2, s4, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsenode_stmt() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parsenode_id(); - if (s1 !== peg$FAILED) { - s2 = peg$parseattr_list(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c38(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsenode_id() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - s2 = peg$parseport(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c39(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseport() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c41; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseID(); - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s4 = peg$c41; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parsecompass_pt(); - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c43(s2, s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c44(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c41; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsecompass_pt(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c45(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } - } - - return s0; - } - - function peg$parsesubgraph() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c46) { - s2 = input.substr(peg$currPos, 8); - peg$currPos += 8; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parseID(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - peg$savedPos = s1; - s2 = peg$c48(s4); - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 === peg$FAILED) { - s1 = null; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 123) { - s2 = peg$c6; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsestmt_list(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s5 = peg$c8; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c49(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsecompass_pt() { - var s0; - - if (input.charCodeAt(peg$currPos) === 110) { - s0 = peg$c50; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c52) { - s0 = peg$c52; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 101) { - s0 = peg$c54; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c56) { - s0 = peg$c56; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 115) { - s0 = peg$c58; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c60) { - s0 = peg$c60; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 119) { - s0 = peg$c62; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c64) { - s0 = peg$c64; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } - } - } - } - } - } - } - } - } - - return s0; - } - - function peg$parseID() { - var s0; - - s0 = peg$parseSTRING(); - if (s0 === peg$FAILED) { - s0 = peg$parseNUMBER(); - if (s0 === peg$FAILED) { - s0 = peg$parseQUOTED_STRING(); - if (s0 === peg$FAILED) { - s0 = peg$parseHTML_STRING(); - } - } - } - - return s0; - } - - function peg$parseSTRING() { - var s0, s1, s2, s3; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parseStringStart(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseStringPart(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseStringPart(); - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c67(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } - } - - return s0; - } - - function peg$parseStringStart() { - var s0; - - s0 = peg$parseUnicodeLetter(); - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 36) { - s0 = peg$c68; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c70; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } - } - } - } - - return s0; - } - - function peg$parseStringPart() { - var s0; - - s0 = peg$parseStringStart(); - if (s0 === peg$FAILED) { - s0 = peg$parseNd(); - } - - return s0; - } - - function peg$parseNUMBER() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 45) { - s2 = peg$c73; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } - } - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s4 = peg$c75; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } - } - if (s4 !== peg$FAILED) { - s5 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s6 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - if (peg$c77.test(input.charAt(peg$currPos))) { - s6 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - } else { - s5 = peg$FAILED; - } - if (s5 !== peg$FAILED) { - s4 = [s4, s5]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; - s4 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - if (s5 !== peg$FAILED) { - while (s5 !== peg$FAILED) { - s4.push(s5); - if (peg$c77.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - } else { - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - s5 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s6 = peg$c75; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } - } - if (s6 !== peg$FAILED) { - s7 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - while (s8 !== peg$FAILED) { - s7.push(s8); - if (peg$c77.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - if (s7 !== peg$FAILED) { - s6 = [s6, s7]; - s5 = s6; - } else { - peg$currPos = s5; - s5 = peg$FAILED; - } - } else { - peg$currPos = s5; - s5 = peg$FAILED; - } - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s4 = [s4, s5]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c79(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } - } - - return s0; - } - - function peg$parseHTML_STRING() { - var s0, s1; - - s0 = peg$currPos; - s1 = peg$parsehtml_raw_string(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c80(s1); - } - s0 = s1; - - return s0; - } - - function peg$parsehtml_raw_string() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c81; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parsehtml_char(); - if (s3 === peg$FAILED) { - s3 = peg$parsehtml_raw_string(); - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsehtml_char(); - if (s3 === peg$FAILED) { - s3 = peg$parsehtml_raw_string(); - } - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 62) { - s3 = peg$c83; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c85(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsehtml_char() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - s1 = []; - s2 = peg$currPos; - s3 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 62) { - s4 = peg$c83; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s4 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s4 = peg$c81; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - } - peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = void 0; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - if (input.length > peg$currPos) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c87(s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$currPos; - s3 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 62) { - s4 = peg$c83; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s4 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s4 = peg$c81; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - } - peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = void 0; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - if (input.length > peg$currPos) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c87(s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c88(s1); - } - s0 = s1; - - return s0; - } - - function peg$parseQUOTED_STRING() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c89; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseDoubleStringCharacter(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseDoubleStringCharacter(); - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c89; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c91(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseDoubleStringCharacter() { - var s0, s1, s2; - - s0 = peg$parseQuoteEscape(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c89; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s2 === peg$FAILED) { - s2 = peg$parseLineTerminator(); - } - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseSourceCharacter(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c92(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseLineContinuation(); - } - } - - return s0; - } - - function peg$parseQuoteEscape() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c93; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } - } - if (s2 !== peg$FAILED) { - if (input.length > peg$currPos) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c95(s1); - } - s0 = s1; - - return s0; - } - - function peg$parseLineContinuation() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c93; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseLineTerminatorSequence(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c96(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseLineTerminator() { - var s0; - - if (peg$c97.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } - } - - return s0; - } - - function peg$parseLineTerminatorSequence() { - var s0; - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c100; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c102) { - s0 = peg$c102; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c104; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c105); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 8232) { - s0 = peg$c106; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 8233) { - s0 = peg$c108; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } - } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - if (peg$silentFails === 0) { peg$fail(peg$c99); } - } - - return s0; - } - - function peg$parseSourceCharacter() { - var s0; - - if (input.length > peg$currPos) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - - return s0; - } - - function peg$parseCOMMENT() { - var s0; - - peg$silentFails++; - s0 = peg$parseBLOCK_COMMENT(); - if (s0 === peg$FAILED) { - s0 = peg$parseC_COMMENT(); - if (s0 === peg$FAILED) { - s0 = peg$parseMACRO_COMMENT(); - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - if (peg$silentFails === 0) { peg$fail(peg$c116); } - } - - return s0; - } - - function peg$parseBLOCK_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c118) { - s1 = peg$c118; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c120) { - s5 = peg$c120; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c122(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c120) { - s5 = peg$c120; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c122(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c120) { - s3 = peg$c120; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c123(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } - } - - return s0; - } - - function peg$parseC_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c125) { - s1 = peg$c125; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c126); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (peg$c127.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c129(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c124); } - } - - return s0; - } - - function peg$parseMACRO_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c131; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (peg$c127.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c129(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c130); } - } - - return s0; - } - - function peg$parse_() { - var s0, s1; - - peg$silentFails++; - s0 = []; - s1 = peg$parseWHITESPACE(); - if (s1 === peg$FAILED) { - s1 = peg$parseCOMMENT(); - } - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parseWHITESPACE(); - if (s1 === peg$FAILED) { - s1 = peg$parseCOMMENT(); - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c133); } - } - - return s0; - } - - function peg$parseNEWLINE() { - var s0, s1; - - s0 = []; - if (peg$c134.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c135); } - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c134.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c135); } - } - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseWHITESPACE() { - var s0, s1; - - s0 = []; - if (peg$c136.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c137); } - } - if (s1 === peg$FAILED) { - s1 = peg$parseNEWLINE(); - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c136.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c137); } - } - if (s1 === peg$FAILED) { - s1 = peg$parseNEWLINE(); - } - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseUnicodeLetter() { - var s0; - - s0 = peg$parseLu(); - if (s0 === peg$FAILED) { - s0 = peg$parseLl(); - if (s0 === peg$FAILED) { - s0 = peg$parseLt(); - if (s0 === peg$FAILED) { - s0 = peg$parseLm(); - if (s0 === peg$FAILED) { - s0 = peg$parseLo(); - if (s0 === peg$FAILED) { - s0 = peg$parseNl(); - } - } - } - } - } - - return s0; - } - - function peg$parseLl() { - var s0; - - if (peg$c138.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c139); } - } - - return s0; - } - - function peg$parseLm() { - var s0; - - if (peg$c140.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c141); } - } - - return s0; - } - - function peg$parseLo() { - var s0; - - if (peg$c142.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } - } - - return s0; - } - - function peg$parseLt() { - var s0; - - if (peg$c144.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } - } - - return s0; - } - - function peg$parseLu() { - var s0; - - if (peg$c146.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } - } - - return s0; - } - - function peg$parseNl() { - var s0; - - if (peg$c148.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } - } - - return s0; - } - - function peg$parseNd() { - var s0; - - if (peg$c150.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c151); } - } - - return s0; - } - - peg$result = peg$startRuleFunction(); - - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail(peg$endExpectation()); - } - - throw peg$buildStructuredError( - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); - } - } - - var dot = { - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; - - var parser$5 = dot; - var dotparser = parser$5.parse; - - var visualize$1 = {exports: {}}; - - (function (module, exports) { - (function webpackUniversalModuleDefinition(root, factory) { - module.exports = factory(); - })(commonjsGlobal, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) { - /******/ return installedModules[moduleId].exports; - /******/ } - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ i: moduleId, - /******/ l: false, - /******/ exports: {} - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.l = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // identity function for calling harmony imports with the correct context - /******/ __webpack_require__.i = function(value) { return value; }; - /******/ - /******/ // define getter function for harmony exports - /******/ __webpack_require__.d = function(exports, name, getter) { - /******/ if(!__webpack_require__.o(exports, name)) { - /******/ Object.defineProperty(exports, name, { - /******/ configurable: false, - /******/ enumerable: true, - /******/ get: getter - /******/ }); - /******/ } - /******/ }; - /******/ - /******/ // getDefaultExport function for compatibility with non-harmony modules - /******/ __webpack_require__.n = function(module) { - /******/ var getter = module && module.__esModule ? - /******/ function getDefault() { return module['default']; } : - /******/ function getModuleExports() { return module; }; - /******/ __webpack_require__.d(getter, 'a', getter); - /******/ return getter; - /******/ }; - /******/ - /******/ // Object.prototype.hasOwnProperty.call - /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(__webpack_require__.s = 1); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ (function(module, exports, __webpack_require__) { - - - module.exports = function(target, sources) { - var n, source, key; - for(n = 1 ; n < arguments.length ; n++) { - source = arguments[n]; - for(key in source) { - if (source.hasOwnProperty(key)) - target[key] = source[key]; - } - } - return target; - }; - - - /***/ }), - /* 1 */ - /***/ (function(module, exports, __webpack_require__) { - - - //------------------------------------------------------------------------------------------------- - - var mixin = __webpack_require__(0); - - //------------------------------------------------------------------------------------------------- - - function visualize(fsm, options) { - return dotify(dotcfg(fsm, options)); - } - - //------------------------------------------------------------------------------------------------- - - function dotcfg(fsm, options) { - - options = options || {}; - - var config = dotcfg.fetch(fsm), - name = options.name, - rankdir = dotcfg.rankdir(options.orientation), - states = dotcfg.states(config, options), - transitions = dotcfg.transitions(config, options), - result = { }; - - if (name) - result.name = name; - - if (rankdir) - result.rankdir = rankdir; - - if (states && states.length > 0) - result.states = states; - - if (transitions && transitions.length > 0) - result.transitions = transitions; - - return result - } - - //------------------------------------------------------------------------------------------------- - - dotcfg.fetch = function(fsm) { - return (typeof fsm === 'function') ? fsm.prototype._fsm.config - : fsm._fsm.config - }; - - dotcfg.rankdir = function(orientation) { - if (orientation === 'horizontal') - return 'LR'; - else if (orientation === 'vertical') - return 'TB'; - }; - - dotcfg.states = function(config, options) { - var index, states = config.states; - if (!options.init) { // if not showing init transition, then slice out the implied init :from state - index = states.indexOf(config.init.from); - states = states.slice(0, index).concat(states.slice(index+1)); - } - return states; - }; - - dotcfg.transitions = function(config, options) { - var n, max, transition, - init = config.init, - transitions = config.options.transitions || [], // easier to visualize using the ORIGINAL transition declarations rather than our run-time mapping - output = []; - if (options.init && init.active) - dotcfg.transition(init.name, init.from, init.to, init.dot, config, options, output); - for (n = 0, max = transitions.length ; n < max ; n++) { - transition = config.options.transitions[n]; - dotcfg.transition(transition.name, transition.from, transition.to, transition.dot, config, options, output); - } - return output - }; - - dotcfg.transition = function(name, from, to, dot, config, options, output) { - var n, max, wildcard = config.defaults.wildcard; - - if (Array.isArray(from)) { - for(n = 0, max = from.length ; n < max ; n++) - dotcfg.transition(name, from[n], to, dot, config, options, output); - } - else if (from === wildcard || from === undefined) { - for(n = 0, max = config.states.length ; n < max ; n++) - dotcfg.transition(name, config.states[n], to, dot, config, options, output); - } - else if (to === wildcard || to === undefined) { - dotcfg.transition(name, from, from, dot, config, options, output); - } - else if (typeof to === 'function') ; - else { - output.push(mixin({}, { from: from, to: to, label: pad(name) }, dot || {})); - } - - }; - - //------------------------------------------------------------------------------------------------- - - function pad(name) { - return " " + name + " " - } - - function quote(name) { - return "\"" + name + "\"" - } - - function dotify(dotcfg) { - - dotcfg = dotcfg || {}; - - var name = dotcfg.name || 'fsm', - states = dotcfg.states || [], - transitions = dotcfg.transitions || [], - rankdir = dotcfg.rankdir, - output = [], - n, max; - - output.push("digraph " + quote(name) + " {"); - if (rankdir) - output.push(" rankdir=" + rankdir + ";"); - for(n = 0, max = states.length ; n < max ; n++) - output.push(dotify.state(states[n])); - for(n = 0, max = transitions.length ; n < max ; n++) - output.push(dotify.edge(transitions[n])); - output.push("}"); - return output.join("\n") - - } - - dotify.state = function(state) { - return " " + quote(state) + ";" - }; - - dotify.edge = function(edge) { - return " " + quote(edge.from) + " -> " + quote(edge.to) + dotify.edge.attr(edge) + ";" - }; - - dotify.edge.attr = function(edge) { - var n, max, key, keys = Object.keys(edge).sort(), output = []; - for(n = 0, max = keys.length ; n < max ; n++) { - key = keys[n]; - if (key !== 'from' && key !== 'to') - output.push(key + "=" + quote(edge[key])); - } - return output.length > 0 ? " [ " + output.join(" ; ") + " ]" : "" - }; - - //------------------------------------------------------------------------------------------------- - - visualize.dotcfg = dotcfg; - visualize.dotify = dotify; - - //------------------------------------------------------------------------------------------------- - - module.exports = visualize; - - //------------------------------------------------------------------------------------------------- - - - /***/ }) - /******/ ]); - }); - }(visualize$1)); - - var stateMachine = {exports: {}}; - - (function (module, exports) { - (function webpackUniversalModuleDefinition(root, factory) { - module.exports = factory(); - })(commonjsGlobal, function() { - return /******/ (function(modules) { // webpackBootstrap - /******/ // The module cache - /******/ var installedModules = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ - /******/ // Check if module is in cache - /******/ if(installedModules[moduleId]) { - /******/ return installedModules[moduleId].exports; - /******/ } - /******/ // Create a new module (and put it into the cache) - /******/ var module = installedModules[moduleId] = { - /******/ i: moduleId, - /******/ l: false, - /******/ exports: {} - /******/ }; - /******/ - /******/ // Execute the module function - /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - /******/ - /******/ // Flag the module as loaded - /******/ module.l = true; - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /******/ - /******/ // expose the modules object (__webpack_modules__) - /******/ __webpack_require__.m = modules; - /******/ - /******/ // expose the module cache - /******/ __webpack_require__.c = installedModules; - /******/ - /******/ // identity function for calling harmony imports with the correct context - /******/ __webpack_require__.i = function(value) { return value; }; - /******/ - /******/ // define getter function for harmony exports - /******/ __webpack_require__.d = function(exports, name, getter) { - /******/ if(!__webpack_require__.o(exports, name)) { - /******/ Object.defineProperty(exports, name, { - /******/ configurable: false, - /******/ enumerable: true, - /******/ get: getter - /******/ }); - /******/ } - /******/ }; - /******/ - /******/ // getDefaultExport function for compatibility with non-harmony modules - /******/ __webpack_require__.n = function(module) { - /******/ var getter = module && module.__esModule ? - /******/ function getDefault() { return module['default']; } : - /******/ function getModuleExports() { return module; }; - /******/ __webpack_require__.d(getter, 'a', getter); - /******/ return getter; - /******/ }; - /******/ - /******/ // Object.prototype.hasOwnProperty.call - /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; - /******/ - /******/ // __webpack_public_path__ - /******/ __webpack_require__.p = ""; - /******/ - /******/ // Load entry module and return exports - /******/ return __webpack_require__(__webpack_require__.s = 5); - /******/ }) - /************************************************************************/ - /******/ ([ - /* 0 */ - /***/ (function(module, exports, __webpack_require__) { - - - module.exports = function(target, sources) { - var n, source, key; - for(n = 1 ; n < arguments.length ; n++) { - source = arguments[n]; - for(key in source) { - if (source.hasOwnProperty(key)) - target[key] = source[key]; - } - } - return target; - }; - - - /***/ }), - /* 1 */ - /***/ (function(module, exports, __webpack_require__) { - - - //------------------------------------------------------------------------------------------------- - - var mixin = __webpack_require__(0); - - //------------------------------------------------------------------------------------------------- - - module.exports = { - - build: function(target, config) { - var n, max, plugin, plugins = config.plugins; - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - if (plugin.methods) - mixin(target, plugin.methods); - if (plugin.properties) - Object.defineProperties(target, plugin.properties); - } - }, - - hook: function(fsm, name, additional) { - var n, max, method, plugin, - plugins = fsm.config.plugins, - args = [fsm.context]; - - if (additional) - args = args.concat(additional); - - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - method = plugins[n][name]; - if (method) - method.apply(plugin, args); - } - } - - }; - - //------------------------------------------------------------------------------------------------- - - - /***/ }), - /* 2 */ - /***/ (function(module, exports, __webpack_require__) { - - - //------------------------------------------------------------------------------------------------- - - function camelize(label) { - - if (label.length === 0) - return label; - - var n, result, words = label.split(/[_-]/); - - // single word with first character already lowercase, return untouched - if ((words.length === 1) && (words[0][0].toLowerCase() === words[0][0])) - return label; - - result = words[0].toLowerCase(); - for(n = 1 ; n < words.length ; n++) { - result = result + words[n].charAt(0).toUpperCase() + words[n].substring(1).toLowerCase(); - } - - return result; - } - - //------------------------------------------------------------------------------------------------- - - camelize.prepended = function(prepend, label) { - label = camelize(label); - return prepend + label[0].toUpperCase() + label.substring(1); - }; - - //------------------------------------------------------------------------------------------------- - - module.exports = camelize; - - - /***/ }), - /* 3 */ - /***/ (function(module, exports, __webpack_require__) { - - - //------------------------------------------------------------------------------------------------- - - var mixin = __webpack_require__(0), - camelize = __webpack_require__(2); - - //------------------------------------------------------------------------------------------------- - - function Config(options, StateMachine) { - - options = options || {}; - - this.options = options; // preserving original options can be useful (e.g visualize plugin) - this.defaults = StateMachine.defaults; - this.states = []; - this.transitions = []; - this.map = {}; - this.lifecycle = this.configureLifecycle(); - this.init = this.configureInitTransition(options.init); - this.data = this.configureData(options.data); - this.methods = this.configureMethods(options.methods); - - this.map[this.defaults.wildcard] = {}; - - this.configureTransitions(options.transitions || []); - - this.plugins = this.configurePlugins(options.plugins, StateMachine.plugin); - - } - - //------------------------------------------------------------------------------------------------- - - mixin(Config.prototype, { - - addState: function(name) { - if (!this.map[name]) { - this.states.push(name); - this.addStateLifecycleNames(name); - this.map[name] = {}; - } - }, - - addStateLifecycleNames: function(name) { - this.lifecycle.onEnter[name] = camelize.prepended('onEnter', name); - this.lifecycle.onLeave[name] = camelize.prepended('onLeave', name); - this.lifecycle.on[name] = camelize.prepended('on', name); - }, - - addTransition: function(name) { - if (this.transitions.indexOf(name) < 0) { - this.transitions.push(name); - this.addTransitionLifecycleNames(name); - } - }, - - addTransitionLifecycleNames: function(name) { - this.lifecycle.onBefore[name] = camelize.prepended('onBefore', name); - this.lifecycle.onAfter[name] = camelize.prepended('onAfter', name); - this.lifecycle.on[name] = camelize.prepended('on', name); - }, - - mapTransition: function(transition) { - var name = transition.name, - from = transition.from, - to = transition.to; - this.addState(from); - if (typeof to !== 'function') - this.addState(to); - this.addTransition(name); - this.map[from][name] = transition; - return transition; - }, - - configureLifecycle: function() { - return { - onBefore: { transition: 'onBeforeTransition' }, - onAfter: { transition: 'onAfterTransition' }, - onEnter: { state: 'onEnterState' }, - onLeave: { state: 'onLeaveState' }, - on: { transition: 'onTransition' } - }; - }, - - configureInitTransition: function(init) { - if (typeof init === 'string') { - return this.mapTransition(mixin({}, this.defaults.init, { to: init, active: true })); - } - else if (typeof init === 'object') { - return this.mapTransition(mixin({}, this.defaults.init, init, { active: true })); - } - else { - this.addState(this.defaults.init.from); - return this.defaults.init; - } - }, - - configureData: function(data) { - if (typeof data === 'function') - return data; - else if (typeof data === 'object') - return function() { return data; } - else - return function() { return {}; } - }, - - configureMethods: function(methods) { - return methods || {}; - }, - - configurePlugins: function(plugins, builtin) { - plugins = plugins || []; - var n, max, plugin; - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - if (typeof plugin === 'function') - plugins[n] = plugin = plugin(); - if (plugin.configure) - plugin.configure(this); - } - return plugins - }, - - configureTransitions: function(transitions) { - var i, n, transition, from, to, wildcard = this.defaults.wildcard; - for(n = 0 ; n < transitions.length ; n++) { - transition = transitions[n]; - from = Array.isArray(transition.from) ? transition.from : [transition.from || wildcard]; - to = transition.to || wildcard; - for(i = 0 ; i < from.length ; i++) { - this.mapTransition({ name: transition.name, from: from[i], to: to }); - } - } - }, - - transitionFor: function(state, transition) { - var wildcard = this.defaults.wildcard; - return this.map[state][transition] || - this.map[wildcard][transition]; - }, - - transitionsFor: function(state) { - var wildcard = this.defaults.wildcard; - return Object.keys(this.map[state]).concat(Object.keys(this.map[wildcard])); - }, - - allStates: function() { - return this.states; - }, - - allTransitions: function() { - return this.transitions; - } - - }); - - //------------------------------------------------------------------------------------------------- - - module.exports = Config; - - //------------------------------------------------------------------------------------------------- - - - /***/ }), - /* 4 */ - /***/ (function(module, exports, __webpack_require__) { - - - var mixin = __webpack_require__(0), - Exception = __webpack_require__(6), - plugin = __webpack_require__(1), - UNOBSERVED = [ null, [] ]; - - //------------------------------------------------------------------------------------------------- - - function JSM(context, config) { - this.context = context; - this.config = config; - this.state = config.init.from; - this.observers = [context]; - } - - //------------------------------------------------------------------------------------------------- - - mixin(JSM.prototype, { - - init: function(args) { - mixin(this.context, this.config.data.apply(this.context, args)); - plugin.hook(this, 'init'); - if (this.config.init.active) - return this.fire(this.config.init.name, []); - }, - - is: function(state) { - return Array.isArray(state) ? (state.indexOf(this.state) >= 0) : (this.state === state); - }, - - isPending: function() { - return this.pending; - }, - - can: function(transition) { - return !this.isPending() && !!this.seek(transition); - }, - - cannot: function(transition) { - return !this.can(transition); - }, - - allStates: function() { - return this.config.allStates(); - }, - - allTransitions: function() { - return this.config.allTransitions(); - }, - - transitions: function() { - return this.config.transitionsFor(this.state); - }, - - seek: function(transition, args) { - var wildcard = this.config.defaults.wildcard, - entry = this.config.transitionFor(this.state, transition), - to = entry && entry.to; - if (typeof to === 'function') - return to.apply(this.context, args); - else if (to === wildcard) - return this.state - else - return to - }, - - fire: function(transition, args) { - return this.transit(transition, this.state, this.seek(transition, args), args); - }, - - transit: function(transition, from, to, args) { - - var lifecycle = this.config.lifecycle, - changed = this.config.options.observeUnchangedState || (from !== to); - - if (!to) - return this.context.onInvalidTransition(transition, from, to); - - if (this.isPending()) - return this.context.onPendingTransition(transition, from, to); - - this.config.addState(to); // might need to add this state if it's unknown (e.g. conditional transition or goto) - - this.beginTransit(); - - args.unshift({ // this context will be passed to each lifecycle event observer - transition: transition, - from: from, - to: to, - fsm: this.context - }); - - return this.observeEvents([ - this.observersForEvent(lifecycle.onBefore.transition), - this.observersForEvent(lifecycle.onBefore[transition]), - changed ? this.observersForEvent(lifecycle.onLeave.state) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onLeave[from]) : UNOBSERVED, - this.observersForEvent(lifecycle.on.transition), - changed ? [ 'doTransit', [ this ] ] : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onEnter.state) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onEnter[to]) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.on[to]) : UNOBSERVED, - this.observersForEvent(lifecycle.onAfter.transition), - this.observersForEvent(lifecycle.onAfter[transition]), - this.observersForEvent(lifecycle.on[transition]) - ], args); - }, - - beginTransit: function() { this.pending = true; }, - endTransit: function(result) { this.pending = false; return result; }, - failTransit: function(result) { this.pending = false; throw result; }, - doTransit: function(lifecycle) { this.state = lifecycle.to; }, - - observe: function(args) { - if (args.length === 2) { - var observer = {}; - observer[args[0]] = args[1]; - this.observers.push(observer); - } - else { - this.observers.push(args[0]); - } - }, - - observersForEvent: function(event) { // TODO: this could be cached - var n = 0, max = this.observers.length, observer, result = []; - for( ; n < max ; n++) { - observer = this.observers[n]; - if (observer[event]) - result.push(observer); - } - return [ event, result, true ] - }, - - observeEvents: function(events, args, previousEvent, previousResult) { - if (events.length === 0) { - return this.endTransit(previousResult === undefined ? true : previousResult); - } - - var event = events[0][0], - observers = events[0][1], - pluggable = events[0][2]; - - args[0].event = event; - if (event && pluggable && event !== previousEvent) - plugin.hook(this, 'lifecycle', args); - - if (observers.length === 0) { - events.shift(); - return this.observeEvents(events, args, event, previousResult); - } - else { - var observer = observers.shift(), - result = observer[event].apply(observer, args); - if (result && typeof result.then === 'function') { - return result.then(this.observeEvents.bind(this, events, args, event)) - .catch(this.failTransit.bind(this)) - } - else if (result === false) { - return this.endTransit(false); - } - else { - return this.observeEvents(events, args, event, result); - } - } - }, - - onInvalidTransition: function(transition, from, to) { - throw new Exception("transition is invalid in current state", transition, from, to, this.state); - }, - - onPendingTransition: function(transition, from, to) { - throw new Exception("transition is invalid while previous transition is still in progress", transition, from, to, this.state); - } - - }); - - //------------------------------------------------------------------------------------------------- - - module.exports = JSM; - - //------------------------------------------------------------------------------------------------- - - - /***/ }), - /* 5 */ - /***/ (function(module, exports, __webpack_require__) { - - - //----------------------------------------------------------------------------------------------- - - var mixin = __webpack_require__(0), - camelize = __webpack_require__(2), - plugin = __webpack_require__(1), - Config = __webpack_require__(3), - JSM = __webpack_require__(4); - - //----------------------------------------------------------------------------------------------- - - var PublicMethods = { - is: function(state) { return this._fsm.is(state) }, - can: function(transition) { return this._fsm.can(transition) }, - cannot: function(transition) { return this._fsm.cannot(transition) }, - observe: function() { return this._fsm.observe(arguments) }, - transitions: function() { return this._fsm.transitions() }, - allTransitions: function() { return this._fsm.allTransitions() }, - allStates: function() { return this._fsm.allStates() }, - onInvalidTransition: function(t, from, to) { return this._fsm.onInvalidTransition(t, from, to) }, - onPendingTransition: function(t, from, to) { return this._fsm.onPendingTransition(t, from, to) }, - }; - - var PublicProperties = { - state: { - configurable: false, - enumerable: true, - get: function() { - return this._fsm.state; - }, - set: function(state) { - throw Error('use transitions to change state') - } - } - }; - - //----------------------------------------------------------------------------------------------- - - function StateMachine(options) { - return apply(this || {}, options); - } - - function factory() { - var cstor, options; - if (typeof arguments[0] === 'function') { - cstor = arguments[0]; - options = arguments[1] || {}; - } - else { - cstor = function() { this._fsm.apply(this, arguments); }; - options = arguments[0] || {}; - } - var config = new Config(options, StateMachine); - build(cstor.prototype, config); - cstor.prototype._fsm.config = config; // convenience access to shared config without needing an instance - return cstor; - } - - //------------------------------------------------------------------------------------------------- - - function apply(instance, options) { - var config = new Config(options, StateMachine); - build(instance, config); - instance._fsm(); - return instance; - } - - function build(target, config) { - if ((typeof target !== 'object') || Array.isArray(target)) - throw Error('StateMachine can only be applied to objects'); - plugin.build(target, config); - Object.defineProperties(target, PublicProperties); - mixin(target, PublicMethods); - mixin(target, config.methods); - config.allTransitions().forEach(function(transition) { - target[camelize(transition)] = function() { - return this._fsm.fire(transition, [].slice.call(arguments)) - }; - }); - target._fsm = function() { - this._fsm = new JSM(this, config); - this._fsm.init(arguments); - }; - } - - //----------------------------------------------------------------------------------------------- - - StateMachine.version = '3.0.1'; - StateMachine.factory = factory; - StateMachine.apply = apply; - StateMachine.defaults = { - wildcard: '*', - init: { - name: 'init', - from: 'none' - } - }; - - //=============================================================================================== - - module.exports = StateMachine; - - - /***/ }), - /* 6 */ - /***/ (function(module, exports, __webpack_require__) { - - - module.exports = function(message, transition, from, to, current) { - this.message = message; - this.transition = transition; - this.from = from; - this.to = to; - this.current = current; - }; - - - /***/ }) - /******/ ]); - }); - }(stateMachine)); - - // Dependencies - const arbitrary = dist.exports; - const monitor$3 = duplex; - const BN$a = bn$2.exports; - - // Fabric Types - const Hash256$5 = hash256$l; - const Actor$a = actor; - const State$5 = state$2; - - /** - * General-purpose state machine with {@link Vector}-based instructions. - */ - class Machine$6 extends Actor$a { - /** - * Create a Machine. - * @param {Object} settings Run-time configuration. - */ - constructor (settings) { - super(settings); - - this.settings = Object.assign({ - path: './stores/machine', - clock: 0, - debug: false, - deterministic: true, - frequency: 1, // Hz - script: [], - seed: 1, // TODO: select seed for production - type: 'x86' - }, settings); - - // internal clock - this.clock = this.settings.clock; - - // define integer field - this.seed = Hash256$5.digest(this.settings.seed + ''); - this.q = parseInt(this.seed.substring(0, 4), 16); - - // deterministic entropy and RNG - this.generator = new arbitrary.default.Generator(this.q); - this.entropy = this.sip(); - - this.known = {}; // definitions - this.script = this.settings.script; // input - this.stack = []; // output - this.history = []; // State tree - - this._state = { - content: { - clock: this.clock - }, - status: 'PAUSED' - }; - - this.observer = monitor$3.observe(this._state.content); - - // Tip - Object.defineProperty(this, 'tip', function (val) { - this.log(`tip requested: ${val}`); - this.log(`tip requested, history: ${JSON.stringify(this.history)}`); - return this.history[this.history.length - 1] || null; - }); - - return this; - } - - bit () { - return this.generator.next.bits(1); - } - - /** - * Get `n` bits of deterministic random data. - * @param {Number} [n=128] Number of bits to retrieve. - * @return {Number} Random bits from {@link Generator}. - */ - sip (n = 128) { - const self = this; - return new BN$a([...Array(n)].map(() => { - return self.bit().toString(); - }).join(''), 2).toString(16); - } - - /** - * Get `n` bytes of deterministic random data. - * @param {Number} [n=32] Number of bytes to retrieve. - * @return {Number} Random bytes from {@link Generator}. - */ - slurp (n = 32) { - const self = this; - return new BN$a([...Array(n * 8)].map(() => { - return self.bit(); - }).join(''), 2).toString(16); - } - - /** - * Computes the next "step" for our current Vector. Analagous to `sum`. - * The top item on the stack is always the memory held at current position, - * so counts should always begin with 0. - * @param {Vector} input - Input state, undefined if desired. - * @return {Promise} - */ - async compute (input) { - this._state.content.clock = ++this.clock; - - this.emit('tick', this.clock); - - for (const i in this.script) { - const instruction = this.script[i]; - console.log('known:', this.known); - if (this.known[instruction]) { - const op = new State$5({ - '@type': 'Cycle', - parent: this.id, - state: this.state, - known: this.known, - input: input - }); - const data = this.known[instruction].call(op, input); - this.stack.push(data); - } else { - this.stack.push(instruction | 0); - } - } - - if (this.stack.length > 1) ; - - // this.state['@data'] = this.stack; - // this.state['@id'] = this.id; - - console.log('stack:', this.stack); - this._state.content = this.stack[this.stack.length - 1]; - - this.commit(); - - return this.state; - } - - asBuffer () { - const data = this.serialize(this.state['@data']); - return Buffer.from(data); - } - - // register a local function - define (name, op) { - this.known[name] = op.bind(this); - } - - applyOperation (op) { - monitor$3.applyOperation(this.state, op); - } - - commit () { - const self = this; - if (!self.observer) return false; - - const changes = monitor$3.generate(self.observer); - - if (changes && changes.length) { - let vector = new State$5({ - '@type': 'Change', - '@data': changes, - method: 'patch', - parent: self.id, - params: changes - }); - - if (!self.history) self.history = []; - self.history.push(vector); - - self.emit('transaction', vector); - self.emit('changes', changes); - } - - return changes; - } - - async start () { - this.status = 'STARTING'; - this._governor = setInterval(this.compute.bind(this), this.settings.frequency * 1000); - this.status = 'STARTED'; - return this; - } - - async stop () { - this.status = 'STOPPING'; - if (this._governor) clearInterval(this._governor); - this.status = 'STOPPED'; - return this; - } - } - - var machine = Machine$6; - - // External dependencies - const crypto$c = require$$0__default["default"]; - const parser$4 = dotparser; - const visualize = visualize$1.exports; - const StateMachine = stateMachine.exports; - - // Fabric Types - const Machine$5 = machine; - const Actor$9 = actor; - - /** - * The {@link Circuit} is the mechanism through which {@link Fabric} - * operates, a computable directed graph describing a network of - * {@link Peer} components and their interactions (side effects). - * See also {@link Swarm} for deeper *inspection of {@link Machine} - * mechanics. - */ - class Circuit$3 extends Actor$9 { - constructor (config = {}) { - super(config); - - this.settings = Object.assign({ - edges: [], - gates: [], - loops: [], - nodes: [], - wires: [], - methods: {} - }, config); - - this['@data'] = this.settings; - - this.gates = []; - this.transitions = []; - this.methods = {}; - - // External State - this.state = { - edges: [], - nodes: [] - }; - - for (let i in this.settings.gates) { - this.transitions.push({ - name: `step`, - from: 'cycle()', - to: `${this.settings.gates[i]}` - }); - } - - for (let i in this.settings.wires) { - let wire = this.settings.wires[i]; - this.transitions.push({ name: wire.name, from: wire.from, to: wire.to }); - } - - this.graph = new StateMachine({ - init: 'start()', - data: this.state, - transitions: this.transitions, - methods: this.methods - }); - - // Internal State - this._state = { - steps: [ - 'load', // load from storage - 'bootstrap', // configure memory - 'step', // single cycle before start - 'start', // create services - 'listen' // listen for input - ] - }; - - return this; - } - - get hash () { - return crypto$c.createHash('sha256').update(this.dot).digest('hex'); - } - - get dot () { - // TODO: generate polynomial for circuit - return visualize(this.graph, { - orientation: 'horizontal' - }); - } - - _registerMethod (name, method) { - this.methods[name] = method; - } - - toObject () { - return parser$4(this.dot); - } - - parse (input) { - return parser$4(input); - } - - compute (input) { - let output = input; - - // empty resolves to Identity function f(x) = x - - return output; - } - - scramble () { - let key = crypto$c.randomBytes(32); - let machine = new Machine$5({ seed: key }); - machine.sip(); - let gates = []; - - for (let i = 0; i < this._state.steps.length; i++) { - gates.push({ - name: this._state.steps[i], - seed: machine.sip() - }); - } - - gates.sort((a, b) => { - return a.seed - b.seed; - }); - - return gates; - } - - render () { - let hash = crypto$c.createHash('sha256').update(this.dot).digest('base64'); - return ` - ${this.dot} - - - - - - - - - - - - - - - - -`; - } - - _draw () { - return this; - } - - async _step () { - let circuit = this; - let origin = circuit.hash + ''; - - console.log('[CIRCUIT:STEP]', this.graph); - console.log('[CIRCUIT:STEP]', 'woo:', this.toObject()); - console.log('[CIRCUIT:STEP]', 'zkc:', this.toObject().map((x) => { - return x.children.filter(x => { - return x.type === 'edge_stmt'; - }).map((y) => { - return y.edge_list.map(z => { - return z.id; - }); - }); - })[0]); - - console.log('[CIRCUIT:STEP]', 'fsm:', this.graph._fsm); - console.log('[CIRCUIT:STEP]', 'origin:', origin); - console.log('[CIRCUIT:STEP]', 'origin hash:', this.hash); - console.log('[CIRCUIT:STEP]', 'origin data:', this.dot); - console.log('[CIRCUIT:STEP]', 'current:', this.graph.state); - - switch (this.graph.state) { - default: - console.error('unhandled state:', this.graph.state); - break; - case 'init': - this.graph.ready(); - break; - case 'ready': - this.graph.step1(); - break; - case '1': - this.graph.step2(); - break; - case '2': - this.graph.step3(); - break; - case '3': - this.graph.done(); - break; - case 'complete': - console.log('#winning'); - this.emit('complete'); - break; - } - - console.log('[CIRCUIT:STEP]', 'after:', this.graph.state); - - this.emit(origin, this.dot); - - await this._PUT(`/output`, Buffer.alloc((256 ** 3) / 8), false); - await this._PUT(`/source`, this.dot, false); - await this._PUT(`/status`, this.graph.state, false); - - let commit = await this.commit(); - - console.log('commit:', commit); - - return commit; - } - - async start () { - return this; - } - } - - var circuit = Circuit$3; - - var isarray = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; - }; - - /** - * Expose `pathToRegexp`. - */ - var pathToRegexp_1 = pathToRegexp$2; - var parse_1 = parse$2; - var compile_1 = compile$2; - var tokensToFunction_1 = tokensToFunction$1; - var tokensToRegExp_1 = tokensToRegExp; - - /** - * The main path matching regexp utility. - * - * @type {RegExp} - */ - var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))' - ].join('|'), 'g'); - - /** - * Parse a string for the raw tokens. - * - * @param {String} str - * @return {Array} - */ - function parse$2 (str) { - var tokens = []; - var key = 0; - var index = 0; - var path = ''; - var res; - - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0]; - var escaped = res[1]; - var offset = res.index; - path += str.slice(index, offset); - index = offset + m.length; - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1]; - continue - } - - // Push the current path onto the tokens. - if (path) { - tokens.push(path); - path = ''; - } - - var prefix = res[2]; - var name = res[3]; - var capture = res[4]; - var group = res[5]; - var suffix = res[6]; - var asterisk = res[7]; - - var repeat = suffix === '+' || suffix === '*'; - var optional = suffix === '?' || suffix === '*'; - var delimiter = prefix || '/'; - var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?'); - - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - pattern: escapeGroup(pattern) - }); - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index); - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path); - } - - return tokens - } - - /** - * Compile a string to a template function for the path. - * - * @param {String} str - * @return {Function} - */ - function compile$2 (str) { - return tokensToFunction$1(parse$2(str)) - } - - /** - * Expose a method for transforming tokens into the path function. - */ - function tokensToFunction$1 (tokens) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length); - - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^' + tokens[i].pattern + '$'); - } - } - - return function (obj) { - var path = ''; - var data = obj || {}; - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - - if (typeof token === 'string') { - path += token; - - continue - } - - var value = data[token.name]; - var segment; - - if (value == null) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received "' + value + '"') - } - - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } - } - - for (var j = 0; j < value.length; j++) { - segment = encodeURIComponent(value[j]); - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += (j === 0 ? token.prefix : token.delimiter) + segment; - } - - continue - } - - segment = encodeURIComponent(value); - - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += token.prefix + segment; - } - - return path - } - } - - /** - * Escape a regular expression string. - * - * @param {String} str - * @return {String} - */ - function escapeString$1 (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/])/g, '\\$1') - } - - /** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {String} group - * @return {String} - */ - function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') - } - - /** - * Attach the keys as a property of the regexp. - * - * @param {RegExp} re - * @param {Array} keys - * @return {RegExp} - */ - function attachKeys (re, keys) { - re.keys = keys; - return re - } - - /** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {String} - */ - function flags$1 (options) { - return options.sensitive ? '' : 'i' - } - - /** - * Pull out keys from a regexp. - * - * @param {RegExp} path - * @param {Array} keys - * @return {RegExp} - */ - function regexpToRegexp$1 (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g); - - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - pattern: null - }); - } - } - - return attachKeys(path, keys) - } - - /** - * Transform an array into a regexp. - * - * @param {Array} path - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ - function arrayToRegexp$1 (path, keys, options) { - var parts = []; - - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp$2(path[i], keys, options).source); - } - - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags$1(options)); - - return attachKeys(regexp, keys) - } - - /** - * Create a path regexp from string input. - * - * @param {String} path - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ - function stringToRegexp$1 (path, keys, options) { - var tokens = parse$2(path); - var re = tokensToRegExp(tokens, options); - - // Attach keys back to the regexp. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] !== 'string') { - keys.push(tokens[i]); - } - } - - return attachKeys(re, keys) - } - - /** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {Array} tokens - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ - function tokensToRegExp (tokens, options) { - options = options || {}; - - var strict = options.strict; - var end = options.end !== false; - var route = ''; - var lastToken = tokens[tokens.length - 1]; - var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken); - - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - - if (typeof token === 'string') { - route += escapeString$1(token); - } else { - var prefix = escapeString$1(token.prefix); - var capture = token.pattern; - - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*'; - } - - if (token.optional) { - if (prefix) { - capture = '(?:' + prefix + '(' + capture + '))?'; - } else { - capture = '(' + capture + ')?'; - } - } else { - capture = prefix + '(' + capture + ')'; - } - - route += capture; - } - } - - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; - } - - if (end) { - route += '$'; - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithSlash ? '' : '(?=\\/|$)'; - } - - return new RegExp('^' + route, flags$1(options)) - } - - /** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(String|RegExp|Array)} path - * @param {Array} [keys] - * @param {Object} [options] - * @return {RegExp} - */ - function pathToRegexp$2 (path, keys, options) { - keys = keys || []; - - if (!isarray(keys)) { - options = keys; - keys = []; - } else if (!options) { - options = {}; - } - - if (path instanceof RegExp) { - return regexpToRegexp$1(path, keys) - } - - if (isarray(path)) { - return arrayToRegexp$1(path, keys, options) - } - - return stringToRegexp$1(path, keys, options) - } - - pathToRegexp_1.parse = parse_1; - pathToRegexp_1.compile = compile_1; - pathToRegexp_1.tokensToFunction = tokensToFunction_1; - pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; - - /** - * Module dependencies. - */ - - - - /** - * Short-cuts for global-object checks - */ - - var hasDocument = ('undefined' !== typeof document); - var hasWindow = ('undefined' !== typeof window); - var hasHistory = ('undefined' !== typeof history); - var hasProcess = typeof process !== 'undefined'; - - /** - * Detect click event - */ - var clickEvent = hasDocument && document.ontouchstart ? 'touchstart' : 'click'; - - /** - * To work properly with the URL - * history.location generated polyfill in https://github.com/devote/HTML5-History-API - */ - - var isLocation = hasWindow && !!(window.history.location || window.location); - - /** - * The page instance - * @api private - */ - function Page() { - // public things - this.callbacks = []; - this.exits = []; - this.current = ''; - this.len = 0; - - // private things - this._decodeURLComponents = true; - this._base = ''; - this._strict = false; - this._running = false; - this._hashbang = false; - - // bound functions - this.clickHandler = this.clickHandler.bind(this); - this._onpopstate = this._onpopstate.bind(this); - } - - /** - * Configure the instance of page. This can be called multiple times. - * - * @param {Object} options - * @api public - */ - - Page.prototype.configure = function(options) { - var opts = options || {}; - - this._window = opts.window || (hasWindow && window); - this._decodeURLComponents = opts.decodeURLComponents !== false; - this._popstate = opts.popstate !== false && hasWindow; - this._click = opts.click !== false && hasDocument; - this._hashbang = !!opts.hashbang; - - var _window = this._window; - if(this._popstate) { - _window.addEventListener('popstate', this._onpopstate, false); - } else if(hasWindow) { - _window.removeEventListener('popstate', this._onpopstate, false); - } - - if (this._click) { - _window.document.addEventListener(clickEvent, this.clickHandler, false); - } else if(hasDocument) { - _window.document.removeEventListener(clickEvent, this.clickHandler, false); - } - - if(this._hashbang && hasWindow && !hasHistory) { - _window.addEventListener('hashchange', this._onpopstate, false); - } else if(hasWindow) { - _window.removeEventListener('hashchange', this._onpopstate, false); - } - }; - - /** - * Get or set basepath to `path`. - * - * @param {string} path - * @api public - */ - - Page.prototype.base = function(path) { - if (0 === arguments.length) return this._base; - this._base = path; - }; - - /** - * Gets the `base`, which depends on whether we are using History or - * hashbang routing. - - * @api private - */ - Page.prototype._getBase = function() { - var base = this._base; - if(!!base) return base; - var loc = hasWindow && this._window && this._window.location; - - if(hasWindow && this._hashbang && loc && loc.protocol === 'file:') { - base = loc.pathname; - } - - return base; - }; - - /** - * Get or set strict path matching to `enable` - * - * @param {boolean} enable - * @api public - */ - - Page.prototype.strict = function(enable) { - if (0 === arguments.length) return this._strict; - this._strict = enable; - }; - - - /** - * Bind with the given `options`. - * - * Options: - * - * - `click` bind to click events [true] - * - `popstate` bind to popstate [true] - * - `dispatch` perform initial dispatch [true] - * - * @param {Object} options - * @api public - */ - - Page.prototype.start = function(options) { - var opts = options || {}; - this.configure(opts); - - if (false === opts.dispatch) return; - this._running = true; - - var url; - if(isLocation) { - var window = this._window; - var loc = window.location; - - if(this._hashbang && ~loc.hash.indexOf('#!')) { - url = loc.hash.substr(2) + loc.search; - } else if (this._hashbang) { - url = loc.search + loc.hash; - } else { - url = loc.pathname + loc.search + loc.hash; - } - } - - this.replace(url, null, true, opts.dispatch); - }; - - /** - * Unbind click and popstate event handlers. - * - * @api public - */ - - Page.prototype.stop = function() { - if (!this._running) return; - this.current = ''; - this.len = 0; - this._running = false; - - var window = this._window; - this._click && window.document.removeEventListener(clickEvent, this.clickHandler, false); - hasWindow && window.removeEventListener('popstate', this._onpopstate, false); - hasWindow && window.removeEventListener('hashchange', this._onpopstate, false); - }; - - /** - * Show `path` with optional `state` object. - * - * @param {string} path - * @param {Object=} state - * @param {boolean=} dispatch - * @param {boolean=} push - * @return {!Context} - * @api public - */ - - Page.prototype.show = function(path, state, dispatch, push) { - var ctx = new Context(path, state, this), - prev = this.prevContext; - this.prevContext = ctx; - this.current = ctx.path; - if (false !== dispatch) this.dispatch(ctx, prev); - if (false !== ctx.handled && false !== push) ctx.pushState(); - return ctx; - }; - - /** - * Goes back in the history - * Back should always let the current route push state and then go back. - * - * @param {string} path - fallback path to go back if no more history exists, if undefined defaults to page.base - * @param {Object=} state - * @api public - */ - - Page.prototype.back = function(path, state) { - var page = this; - if (this.len > 0) { - var window = this._window; - // this may need more testing to see if all browsers - // wait for the next tick to go back in history - hasHistory && window.history.back(); - this.len--; - } else if (path) { - setTimeout(function() { - page.show(path, state); - }); - } else { - setTimeout(function() { - page.show(page._getBase(), state); - }); - } - }; - - /** - * Register route to redirect from one path to other - * or just redirect to another route - * - * @param {string} from - if param 'to' is undefined redirects to 'from' - * @param {string=} to - * @api public - */ - Page.prototype.redirect = function(from, to) { - var inst = this; - - // Define route from a path to another - if ('string' === typeof from && 'string' === typeof to) { - page$1.call(this, from, function(e) { - setTimeout(function() { - inst.replace(/** @type {!string} */ (to)); - }, 0); - }); - } - - // Wait for the push state and replace it with another - if ('string' === typeof from && 'undefined' === typeof to) { - setTimeout(function() { - inst.replace(from); - }, 0); - } - }; - - /** - * Replace `path` with optional `state` object. - * - * @param {string} path - * @param {Object=} state - * @param {boolean=} init - * @param {boolean=} dispatch - * @return {!Context} - * @api public - */ - - - Page.prototype.replace = function(path, state, init, dispatch) { - var ctx = new Context(path, state, this), - prev = this.prevContext; - this.prevContext = ctx; - this.current = ctx.path; - ctx.init = init; - ctx.save(); // save before dispatching, which may redirect - if (false !== dispatch) this.dispatch(ctx, prev); - return ctx; - }; - - /** - * Dispatch the given `ctx`. - * - * @param {Context} ctx - * @api private - */ - - Page.prototype.dispatch = function(ctx, prev) { - var i = 0, j = 0, page = this; - - function nextExit() { - var fn = page.exits[j++]; - if (!fn) return nextEnter(); - fn(prev, nextExit); - } - - function nextEnter() { - var fn = page.callbacks[i++]; - - if (ctx.path !== page.current) { - ctx.handled = false; - return; - } - if (!fn) return unhandled.call(page, ctx); - fn(ctx, nextEnter); - } - - if (prev) { - nextExit(); - } else { - nextEnter(); - } - }; - - /** - * Register an exit route on `path` with - * callback `fn()`, which will be called - * on the previous context when a new - * page is visited. - */ - Page.prototype.exit = function(path, fn) { - if (typeof path === 'function') { - return this.exit('*', path); - } - - var route = new Route$2(path, null, this); - for (var i = 1; i < arguments.length; ++i) { - this.exits.push(route.middleware(arguments[i])); - } - }; - - /** - * Handle "click" events. - */ - - /* jshint +W054 */ - Page.prototype.clickHandler = function(e) { - if (1 !== this._which(e)) return; - - if (e.metaKey || e.ctrlKey || e.shiftKey) return; - if (e.defaultPrevented) return; - - // ensure link - // use shadow dom when available if not, fall back to composedPath() - // for browsers that only have shady - var el = e.target; - var eventPath = e.path || (e.composedPath ? e.composedPath() : null); - - if(eventPath) { - for (var i = 0; i < eventPath.length; i++) { - if (!eventPath[i].nodeName) continue; - if (eventPath[i].nodeName.toUpperCase() !== 'A') continue; - if (!eventPath[i].href) continue; - - el = eventPath[i]; - break; - } - } - - // continue ensure link - // el.nodeName for svg links are 'a' instead of 'A' - while (el && 'A' !== el.nodeName.toUpperCase()) el = el.parentNode; - if (!el || 'A' !== el.nodeName.toUpperCase()) return; - - // check if link is inside an svg - // in this case, both href and target are always inside an object - var svg = (typeof el.href === 'object') && el.href.constructor.name === 'SVGAnimatedString'; - - // Ignore if tag has - // 1. "download" attribute - // 2. rel="external" attribute - if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') return; - - // ensure non-hash for the same path - var link = el.getAttribute('href'); - if(!this._hashbang && this._samePath(el) && (el.hash || '#' === link)) return; - - // Check for mailto: in the href - if (link && link.indexOf('mailto:') > -1) return; - - // check target - // svg target is an object and its desired value is in .baseVal property - if (svg ? el.target.baseVal : el.target) return; - - // x-origin - // note: svg links that are not relative don't call click events (and skip page.js) - // consequently, all svg links tested inside page.js are relative and in the same origin - if (!svg && !this.sameOrigin(el.href)) return; - - // rebuild path - // There aren't .pathname and .search properties in svg links, so we use href - // Also, svg href is an object and its desired value is in .baseVal property - var path = svg ? el.href.baseVal : (el.pathname + el.search + (el.hash || '')); - - path = path[0] !== '/' ? '/' + path : path; - - // strip leading "/[drive letter]:" on NW.js on Windows - if (hasProcess && path.match(/^\/[a-zA-Z]:\//)) { - path = path.replace(/^\/[a-zA-Z]:\//, '/'); - } - - // same page - var orig = path; - var pageBase = this._getBase(); - - if (path.indexOf(pageBase) === 0) { - path = path.substr(pageBase.length); - } - - if (this._hashbang) path = path.replace('#!', ''); - - if (pageBase && orig === path && (!isLocation || this._window.location.protocol !== 'file:')) { - return; - } - - e.preventDefault(); - this.show(orig); - }; - - /** - * Handle "populate" events. - * @api private - */ - - Page.prototype._onpopstate = (function () { - var loaded = false; - if ( ! hasWindow ) { - return function () {}; - } - if (hasDocument && document.readyState === 'complete') { - loaded = true; - } else { - window.addEventListener('load', function() { - setTimeout(function() { - loaded = true; - }, 0); - }); - } - return function onpopstate(e) { - if (!loaded) return; - var page = this; - if (e.state) { - var path = e.state.path; - page.replace(path, e.state); - } else if (isLocation) { - var loc = page._window.location; - page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); - } - }; - })(); - - /** - * Event button. - */ - Page.prototype._which = function(e) { - e = e || (hasWindow && this._window.event); - return null == e.which ? e.button : e.which; - }; - - /** - * Convert to a URL object - * @api private - */ - Page.prototype._toURL = function(href) { - var window = this._window; - if(typeof URL === 'function' && isLocation) { - return new URL(href, window.location.toString()); - } else if (hasDocument) { - var anc = window.document.createElement('a'); - anc.href = href; - return anc; - } - }; - - /** - * Check if `href` is the same origin. - * @param {string} href - * @api public - */ - Page.prototype.sameOrigin = function(href) { - if(!href || !isLocation) return false; - - var url = this._toURL(href); - var window = this._window; - - var loc = window.location; - - /* - When the port is the default http port 80 for http, or 443 for - https, internet explorer 11 returns an empty string for loc.port, - so we need to compare loc.port with an empty string if url.port - is the default port 80 or 443. - Also the comparition with `port` is changed from `===` to `==` because - `port` can be a string sometimes. This only applies to ie11. - */ - return loc.protocol === url.protocol && - loc.hostname === url.hostname && - (loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line - }; - - /** - * @api private - */ - Page.prototype._samePath = function(url) { - if(!isLocation) return false; - var window = this._window; - var loc = window.location; - return url.pathname === loc.pathname && - url.search === loc.search; - }; - - /** - * Remove URL encoding from the given `str`. - * Accommodates whitespace in both x-www-form-urlencoded - * and regular percent-encoded form. - * - * @param {string} val - URL component to decode - * @api private - */ - Page.prototype._decodeURLEncodedURIComponent = function(val) { - if (typeof val !== 'string') { return val; } - return this._decodeURLComponents ? decodeURIComponent(val.replace(/\+/g, ' ')) : val; - }; - - /** - * Create a new `page` instance and function - */ - function createPage() { - var pageInstance = new Page(); - - function pageFn(/* args */) { - return page$1.apply(pageInstance, arguments); - } - - // Copy all of the things over. In 2.0 maybe we use setPrototypeOf - pageFn.callbacks = pageInstance.callbacks; - pageFn.exits = pageInstance.exits; - pageFn.base = pageInstance.base.bind(pageInstance); - pageFn.strict = pageInstance.strict.bind(pageInstance); - pageFn.start = pageInstance.start.bind(pageInstance); - pageFn.stop = pageInstance.stop.bind(pageInstance); - pageFn.show = pageInstance.show.bind(pageInstance); - pageFn.back = pageInstance.back.bind(pageInstance); - pageFn.redirect = pageInstance.redirect.bind(pageInstance); - pageFn.replace = pageInstance.replace.bind(pageInstance); - pageFn.dispatch = pageInstance.dispatch.bind(pageInstance); - pageFn.exit = pageInstance.exit.bind(pageInstance); - pageFn.configure = pageInstance.configure.bind(pageInstance); - pageFn.sameOrigin = pageInstance.sameOrigin.bind(pageInstance); - pageFn.clickHandler = pageInstance.clickHandler.bind(pageInstance); - - pageFn.create = createPage; - - Object.defineProperty(pageFn, 'len', { - get: function(){ - return pageInstance.len; - }, - set: function(val) { - pageInstance.len = val; - } - }); - - Object.defineProperty(pageFn, 'current', { - get: function(){ - return pageInstance.current; - }, - set: function(val) { - pageInstance.current = val; - } - }); - - // In 2.0 these can be named exports - pageFn.Context = Context; - pageFn.Route = Route$2; - - return pageFn; - } - - /** - * Register `path` with callback `fn()`, - * or route `path`, or redirection, - * or `page.start()`. - * - * page(fn); - * page('*', fn); - * page('/user/:id', load, user); - * page('/user/' + user.id, { some: 'thing' }); - * page('/user/' + user.id); - * page('/from', '/to') - * page(); - * - * @param {string|!Function|!Object} path - * @param {Function=} fn - * @api public - */ - - function page$1(path, fn) { - // - if ('function' === typeof path) { - return page$1.call(this, '*', path); - } - - // route to - if ('function' === typeof fn) { - var route = new Route$2(/** @type {string} */ (path), null, this); - for (var i = 1; i < arguments.length; ++i) { - this.callbacks.push(route.middleware(arguments[i])); - } - // show with [state] - } else if ('string' === typeof path) { - this['string' === typeof fn ? 'redirect' : 'show'](path, fn); - // start [options] - } else { - this.start(path); - } - } - - /** - * Unhandled `ctx`. When it's not the initial - * popstate then redirect. If you wish to handle - * 404s on your own use `page('*', callback)`. - * - * @param {Context} ctx - * @api private - */ - function unhandled(ctx) { - if (ctx.handled) return; - var current; - var page = this; - var window = page._window; - - if (page._hashbang) { - current = isLocation && this._getBase() + window.location.hash.replace('#!', ''); - } else { - current = isLocation && window.location.pathname + window.location.search; - } - - if (current === ctx.canonicalPath) return; - page.stop(); - ctx.handled = false; - isLocation && (window.location.href = ctx.canonicalPath); - } - - /** - * Escapes RegExp characters in the given string. - * - * @param {string} s - * @api private - */ - function escapeRegExp(s) { - return s.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1'); - } - - /** - * Initialize a new "request" `Context` - * with the given `path` and optional initial `state`. - * - * @constructor - * @param {string} path - * @param {Object=} state - * @api public - */ - - function Context(path, state, pageInstance) { - var _page = this.page = pageInstance || page$1; - var window = _page._window; - var hashbang = _page._hashbang; - - var pageBase = _page._getBase(); - if ('/' === path[0] && 0 !== path.indexOf(pageBase)) path = pageBase + (hashbang ? '#!' : '') + path; - var i = path.indexOf('?'); - - this.canonicalPath = path; - var re = new RegExp('^' + escapeRegExp(pageBase)); - this.path = path.replace(re, '') || '/'; - if (hashbang) this.path = this.path.replace('#!', '') || '/'; - - this.title = (hasDocument && window.document.title); - this.state = state || {}; - this.state.path = path; - this.querystring = ~i ? _page._decodeURLEncodedURIComponent(path.slice(i + 1)) : ''; - this.pathname = _page._decodeURLEncodedURIComponent(~i ? path.slice(0, i) : path); - this.params = {}; - - // fragment - this.hash = ''; - if (!hashbang) { - if (!~this.path.indexOf('#')) return; - var parts = this.path.split('#'); - this.path = this.pathname = parts[0]; - this.hash = _page._decodeURLEncodedURIComponent(parts[1]) || ''; - this.querystring = this.querystring.split('#')[0]; - } - } - - /** - * Push state. - * - * @api private - */ - - Context.prototype.pushState = function() { - var page = this.page; - var window = page._window; - var hashbang = page._hashbang; - - page.len++; - if (hasHistory) { - window.history.pushState(this.state, this.title, - hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); - } - }; - - /** - * Save the context state. - * - * @api public - */ - - Context.prototype.save = function() { - var page = this.page; - if (hasHistory) { - page._window.history.replaceState(this.state, this.title, - page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); - } - }; - - /** - * Initialize `Route` with the given HTTP `path`, - * and an array of `callbacks` and `options`. - * - * Options: - * - * - `sensitive` enable case-sensitive routes - * - `strict` enable strict matching for trailing slashes - * - * @constructor - * @param {string} path - * @param {Object=} options - * @api private - */ - - function Route$2(path, options, page) { - var _page = this.page = page || globalPage; - var opts = options || {}; - opts.strict = opts.strict || _page._strict; - this.path = (path === '*') ? '(.*)' : path; - this.method = 'GET'; - this.regexp = pathToRegexp_1(this.path, this.keys = [], opts); - } - - /** - * Return route middleware with - * the given callback `fn()`. - * - * @param {Function} fn - * @return {Function} - * @api public - */ - - Route$2.prototype.middleware = function(fn) { - var self = this; - return function(ctx, next) { - if (self.match(ctx.path, ctx.params)) { - ctx.routePath = self.path; - return fn(ctx, next); - } - next(); - }; - }; - - /** - * Check if this route matches `path`, if so - * populate `params`. - * - * @param {string} path - * @param {Object} params - * @return {boolean} - * @api private - */ - - Route$2.prototype.match = function(path, params) { - var keys = this.keys, - qsIndex = path.indexOf('?'), - pathname = ~qsIndex ? path.slice(0, qsIndex) : path, - m = this.regexp.exec(decodeURIComponent(pathname)); - - if (!m) return false; - - delete params[0]; - - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - var val = this.page._decodeURLEncodedURIComponent(m[i]); - if (val !== undefined || !(hasOwnProperty.call(params, key.name))) { - params[key.name] = val; - } - } - - return true; - }; - - - /** - * Module exports. - */ - - var globalPage = createPage(); - var page_js = globalPage; - var default_1 = globalPage; - - page_js.default = default_1; - - var page$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': page_js - }); - - var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(page$2); - - var pluralize$2 = {exports: {}}; - - /* global define */ - - (function (module, exports) { - (function (root, pluralize) { - /* istanbul ignore else */ - if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { - // Node. - module.exports = pluralize(); - } else { - // Browser global. - root.pluralize = pluralize(); - } - })(commonjsGlobal, function () { - // Rule storage - pluralize and singularize need to be run sequentially, - // while other rules can be optimized using an object for instant lookups. - var pluralRules = []; - var singularRules = []; - var uncountables = {}; - var irregularPlurals = {}; - var irregularSingles = {}; - - /** - * Sanitize a pluralization rule to a usable regular expression. - * - * @param {(RegExp|string)} rule - * @return {RegExp} - */ - function sanitizeRule (rule) { - if (typeof rule === 'string') { - return new RegExp('^' + rule + '$', 'i'); - } - - return rule; - } - - /** - * Pass in a word token to produce a function that can replicate the case on - * another word. - * - * @param {string} word - * @param {string} token - * @return {Function} - */ - function restoreCase (word, token) { - // Tokens are an exact match. - if (word === token) return token; - - // Upper cased words. E.g. "HELLO". - if (word === word.toUpperCase()) return token.toUpperCase(); - - // Title cased words. E.g. "Title". - if (word[0] === word[0].toUpperCase()) { - return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); - } - - // Lower cased words. E.g. "test". - return token.toLowerCase(); - } - - /** - * Interpolate a regexp string. - * - * @param {string} str - * @param {Array} args - * @return {string} - */ - function interpolate (str, args) { - return str.replace(/\$(\d{1,2})/g, function (match, index) { - return args[index] || ''; - }); - } - - /** - * Replace a word using a rule. - * - * @param {string} word - * @param {Array} rule - * @return {string} - */ - function replace (word, rule) { - return word.replace(rule[0], function (match, index) { - var result = interpolate(rule[1], arguments); - - if (match === '') { - return restoreCase(word[index - 1], result); - } - - return restoreCase(match, result); - }); - } - - /** - * Sanitize a word by passing in the word and sanitization rules. - * - * @param {string} token - * @param {string} word - * @param {Array} rules - * @return {string} - */ - function sanitizeWord (token, word, rules) { - // Empty string or doesn't need fixing. - if (!token.length || uncountables.hasOwnProperty(token)) { - return word; - } - - var len = rules.length; - - // Iterate over the sanitization rules and use the first one to match. - while (len--) { - var rule = rules[len]; - - if (rule[0].test(word)) return replace(word, rule); - } - - return word; - } - - /** - * Replace a word with the updated word. - * - * @param {Object} replaceMap - * @param {Object} keepMap - * @param {Array} rules - * @return {Function} - */ - function replaceWord (replaceMap, keepMap, rules) { - return function (word) { - // Get the correct token and case restoration functions. - var token = word.toLowerCase(); - - // Check against the keep object map. - if (keepMap.hasOwnProperty(token)) { - return restoreCase(word, token); - } - - // Check against the replacement map for a direct word replacement. - if (replaceMap.hasOwnProperty(token)) { - return restoreCase(word, replaceMap[token]); - } - - // Run all the rules against the word. - return sanitizeWord(token, word, rules); - }; - } - - /** - * Check if a word is part of the map. - */ - function checkWord (replaceMap, keepMap, rules, bool) { - return function (word) { - var token = word.toLowerCase(); - - if (keepMap.hasOwnProperty(token)) return true; - if (replaceMap.hasOwnProperty(token)) return false; - - return sanitizeWord(token, token, rules) === token; - }; - } - - /** - * Pluralize or singularize a word based on the passed in count. - * - * @param {string} word - * @param {number} count - * @param {boolean} inclusive - * @return {string} - */ - function pluralize (word, count, inclusive) { - var pluralized = count === 1 - ? pluralize.singular(word) : pluralize.plural(word); - - return (inclusive ? count + ' ' : '') + pluralized; - } - - /** - * Pluralize a word. - * - * @type {Function} - */ - pluralize.plural = replaceWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Check if a word is plural. - * - * @type {Function} - */ - pluralize.isPlural = checkWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Singularize a word. - * - * @type {Function} - */ - pluralize.singular = replaceWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Check if a word is singular. - * - * @type {Function} - */ - pluralize.isSingular = checkWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Add a pluralization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addPluralRule = function (rule, replacement) { - pluralRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add a singularization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addSingularRule = function (rule, replacement) { - singularRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add an uncountable word rule. - * - * @param {(string|RegExp)} word - */ - pluralize.addUncountableRule = function (word) { - if (typeof word === 'string') { - uncountables[word.toLowerCase()] = true; - return; - } - - // Set singular and plural references for the word. - pluralize.addPluralRule(word, '$0'); - pluralize.addSingularRule(word, '$0'); - }; - - /** - * Add an irregular word definition. - * - * @param {string} single - * @param {string} plural - */ - pluralize.addIrregularRule = function (single, plural) { - plural = plural.toLowerCase(); - single = single.toLowerCase(); - - irregularSingles[single] = plural; - irregularPlurals[plural] = single; - }; - - /** - * Irregular rules. - */ - [ - // Pronouns. - ['I', 'we'], - ['me', 'us'], - ['he', 'they'], - ['she', 'they'], - ['them', 'them'], - ['myself', 'ourselves'], - ['yourself', 'yourselves'], - ['itself', 'themselves'], - ['herself', 'themselves'], - ['himself', 'themselves'], - ['themself', 'themselves'], - ['is', 'are'], - ['was', 'were'], - ['has', 'have'], - ['this', 'these'], - ['that', 'those'], - // Words ending in with a consonant and `o`. - ['echo', 'echoes'], - ['dingo', 'dingoes'], - ['volcano', 'volcanoes'], - ['tornado', 'tornadoes'], - ['torpedo', 'torpedoes'], - // Ends with `us`. - ['genus', 'genera'], - ['viscus', 'viscera'], - // Ends with `ma`. - ['stigma', 'stigmata'], - ['stoma', 'stomata'], - ['dogma', 'dogmata'], - ['lemma', 'lemmata'], - ['schema', 'schemata'], - ['anathema', 'anathemata'], - // Other irregular rules. - ['ox', 'oxen'], - ['axe', 'axes'], - ['die', 'dice'], - ['yes', 'yeses'], - ['foot', 'feet'], - ['eave', 'eaves'], - ['goose', 'geese'], - ['tooth', 'teeth'], - ['quiz', 'quizzes'], - ['human', 'humans'], - ['proof', 'proofs'], - ['carve', 'carves'], - ['valve', 'valves'], - ['looey', 'looies'], - ['thief', 'thieves'], - ['groove', 'grooves'], - ['pickaxe', 'pickaxes'], - ['whiskey', 'whiskies'] - ].forEach(function (rule) { - return pluralize.addIrregularRule(rule[0], rule[1]); - }); - - /** - * Pluralization rules. - */ - [ - [/s?$/i, 's'], - [/[^\u0000-\u007F]$/i, '$0'], - [/([^aeiou]ese)$/i, '$1'], - [/(ax|test)is$/i, '$1es'], - [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'], - [/(e[mn]u)s?$/i, '$1s'], - [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], - [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], - [/(seraph|cherub)(?:im)?$/i, '$1im'], - [/(her|at|gr)o$/i, '$1oes'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], - [/sis$/i, 'ses'], - [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], - [/([^aeiouy]|qu)y$/i, '$1ies'], - [/([^ch][ieo][ln])ey$/i, '$1ies'], - [/(x|ch|ss|sh|zz)$/i, '$1es'], - [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], - [/(m|l)(?:ice|ouse)$/i, '$1ice'], - [/(pe)(?:rson|ople)$/i, '$1ople'], - [/(child)(?:ren)?$/i, '$1ren'], - [/eaux$/i, '$0'], - [/m[ae]n$/i, 'men'], - ['thou', 'you'] - ].forEach(function (rule) { - return pluralize.addPluralRule(rule[0], rule[1]); - }); - - /** - * Singularization rules. - */ - [ - [/s$/i, ''], - [/(ss)$/i, '$1'], - [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], - [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], - [/ies$/i, 'y'], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'], - [/\b(mon|smil)ies$/i, '$1ey'], - [/(m|l)ice$/i, '$1ouse'], - [/(seraph|cherub)im$/i, '$1'], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'], - [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'], - [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'], - [/(test)(?:is|es)$/i, '$1is'], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], - [/(alumn|alg|vertebr)ae$/i, '$1a'], - [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], - [/(matr|append)ices$/i, '$1ix'], - [/(pe)(rson|ople)$/i, '$1rson'], - [/(child)ren$/i, '$1'], - [/(eau)x?$/i, '$1'], - [/men$/i, 'man'] - ].forEach(function (rule) { - return pluralize.addSingularRule(rule[0], rule[1]); - }); - - /** - * Uncountable rules. - */ - [ - // Singular words with no plurals. - 'adulthood', - 'advice', - 'agenda', - 'aid', - 'alcohol', - 'ammo', - 'anime', - 'athletics', - 'audio', - 'bison', - 'blood', - 'bream', - 'buffalo', - 'butter', - 'carp', - 'cash', - 'chassis', - 'chess', - 'clothing', - 'cod', - 'commerce', - 'cooperation', - 'corps', - 'debris', - 'diabetes', - 'digestion', - 'elk', - 'energy', - 'equipment', - 'excretion', - 'expertise', - 'flounder', - 'fun', - 'gallows', - 'garbage', - 'graffiti', - 'headquarters', - 'health', - 'herpes', - 'highjinks', - 'homework', - 'housework', - 'information', - 'jeans', - 'justice', - 'kudos', - 'labour', - 'literature', - 'machinery', - 'mackerel', - 'mail', - 'media', - 'mews', - 'moose', - 'music', - 'manga', - 'news', - 'pike', - 'plankton', - 'pliers', - 'pollution', - 'premises', - 'rain', - 'research', - 'rice', - 'salmon', - 'scissors', - 'series', - 'sewage', - 'shambles', - 'shrimp', - 'species', - 'staff', - 'swine', - 'tennis', - 'traffic', - 'transporation', - 'trout', - 'tuna', - 'wealth', - 'welfare', - 'whiting', - 'wildebeest', - 'wildlife', - 'you', - // Regexes. - /[^aeiou]ese$/i, // "chinese", "japanese" - /deer$/i, // "deer", "reindeer" - /fish$/i, // "fish", "blowfish", "angelfish" - /measles$/i, - /o[iu]s$/i, // "carnivorous" - /pox$/i, // "chickpox", "smallpox" - /sheep$/i - ].forEach(pluralize.addUncountableRule); - - return pluralize; - }); - }(pluralize$2)); - - var js = {exports: {}}; - - var src = {}; - - var javascript = {exports: {}}; - - var beautifier$2 = {}; - - var output$1 = {}; - - /*jshint node:true */ - - function OutputLine(parent) { - this.__parent = parent; - this.__character_count = 0; - // use indent_count as a marker for this.__lines that have preserved indentation - this.__indent_count = -1; - this.__alignment_count = 0; - this.__wrap_point_index = 0; - this.__wrap_point_character_count = 0; - this.__wrap_point_indent_count = -1; - this.__wrap_point_alignment_count = 0; - - this.__items = []; - } - - OutputLine.prototype.clone_empty = function() { - var line = new OutputLine(this.__parent); - line.set_indent(this.__indent_count, this.__alignment_count); - return line; - }; - - OutputLine.prototype.item = function(index) { - if (index < 0) { - return this.__items[this.__items.length + index]; - } else { - return this.__items[index]; - } - }; - - OutputLine.prototype.has_match = function(pattern) { - for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) { - if (this.__items[lastCheckedOutput].match(pattern)) { - return true; - } - } - return false; - }; - - OutputLine.prototype.set_indent = function(indent, alignment) { - if (this.is_empty()) { - this.__indent_count = indent || 0; - this.__alignment_count = alignment || 0; - this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count); - } - }; - - OutputLine.prototype._set_wrap_point = function() { - if (this.__parent.wrap_line_length) { - this.__wrap_point_index = this.__items.length; - this.__wrap_point_character_count = this.__character_count; - this.__wrap_point_indent_count = this.__parent.next_line.__indent_count; - this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count; - } - }; - - OutputLine.prototype._should_wrap = function() { - return this.__wrap_point_index && - this.__character_count > this.__parent.wrap_line_length && - this.__wrap_point_character_count > this.__parent.next_line.__character_count; - }; - - OutputLine.prototype._allow_wrap = function() { - if (this._should_wrap()) { - this.__parent.add_new_line(); - var next = this.__parent.current_line; - next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count); - next.__items = this.__items.slice(this.__wrap_point_index); - this.__items = this.__items.slice(0, this.__wrap_point_index); - - next.__character_count += this.__character_count - this.__wrap_point_character_count; - this.__character_count = this.__wrap_point_character_count; - - if (next.__items[0] === " ") { - next.__items.splice(0, 1); - next.__character_count -= 1; - } - return true; - } - return false; - }; - - OutputLine.prototype.is_empty = function() { - return this.__items.length === 0; - }; - - OutputLine.prototype.last = function() { - if (!this.is_empty()) { - return this.__items[this.__items.length - 1]; - } else { - return null; - } - }; - - OutputLine.prototype.push = function(item) { - this.__items.push(item); - var last_newline_index = item.lastIndexOf('\n'); - if (last_newline_index !== -1) { - this.__character_count = item.length - last_newline_index; - } else { - this.__character_count += item.length; - } - }; - - OutputLine.prototype.pop = function() { - var item = null; - if (!this.is_empty()) { - item = this.__items.pop(); - this.__character_count -= item.length; - } - return item; - }; - - - OutputLine.prototype._remove_indent = function() { - if (this.__indent_count > 0) { - this.__indent_count -= 1; - this.__character_count -= this.__parent.indent_size; - } - }; - - OutputLine.prototype._remove_wrap_indent = function() { - if (this.__wrap_point_indent_count > 0) { - this.__wrap_point_indent_count -= 1; - } - }; - OutputLine.prototype.trim = function() { - while (this.last() === ' ') { - this.__items.pop(); - this.__character_count -= 1; - } - }; - - OutputLine.prototype.toString = function() { - var result = ''; - if (this.is_empty()) { - if (this.__parent.indent_empty_lines) { - result = this.__parent.get_indent_string(this.__indent_count); - } - } else { - result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count); - result += this.__items.join(''); - } - return result; - }; - - function IndentStringCache(options, baseIndentString) { - this.__cache = ['']; - this.__indent_size = options.indent_size; - this.__indent_string = options.indent_char; - if (!options.indent_with_tabs) { - this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char); - } - - // Set to null to continue support for auto detection of base indent - baseIndentString = baseIndentString || ''; - if (options.indent_level > 0) { - baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string); - } - - this.__base_string = baseIndentString; - this.__base_string_length = baseIndentString.length; - } - - IndentStringCache.prototype.get_indent_size = function(indent, column) { - var result = this.__base_string_length; - column = column || 0; - if (indent < 0) { - result = 0; - } - result += indent * this.__indent_size; - result += column; - return result; - }; - - IndentStringCache.prototype.get_indent_string = function(indent_level, column) { - var result = this.__base_string; - column = column || 0; - if (indent_level < 0) { - indent_level = 0; - result = ''; - } - column += indent_level * this.__indent_size; - this.__ensure_cache(column); - result += this.__cache[column]; - return result; - }; - - IndentStringCache.prototype.__ensure_cache = function(column) { - while (column >= this.__cache.length) { - this.__add_column(); - } - }; - - IndentStringCache.prototype.__add_column = function() { - var column = this.__cache.length; - var indent = 0; - var result = ''; - if (this.__indent_size && column >= this.__indent_size) { - indent = Math.floor(column / this.__indent_size); - column -= indent * this.__indent_size; - result = new Array(indent + 1).join(this.__indent_string); - } - if (column) { - result += new Array(column + 1).join(' '); - } - - this.__cache.push(result); - }; - - function Output$c(options, baseIndentString) { - this.__indent_cache = new IndentStringCache(options, baseIndentString); - this.raw = false; - this._end_with_newline = options.end_with_newline; - this.indent_size = options.indent_size; - this.wrap_line_length = options.wrap_line_length; - this.indent_empty_lines = options.indent_empty_lines; - this.__lines = []; - this.previous_line = null; - this.current_line = null; - this.next_line = new OutputLine(this); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; - // initialize - this.__add_outputline(); - } - - Output$c.prototype.__add_outputline = function() { - this.previous_line = this.current_line; - this.current_line = this.next_line.clone_empty(); - this.__lines.push(this.current_line); - }; - - Output$c.prototype.get_line_number = function() { - return this.__lines.length; - }; - - Output$c.prototype.get_indent_string = function(indent, column) { - return this.__indent_cache.get_indent_string(indent, column); - }; - - Output$c.prototype.get_indent_size = function(indent, column) { - return this.__indent_cache.get_indent_size(indent, column); - }; - - Output$c.prototype.is_empty = function() { - return !this.previous_line && this.current_line.is_empty(); - }; - - Output$c.prototype.add_new_line = function(force_newline) { - // never newline at the start of file - // otherwise, newline only if we didn't just add one or we're forced - if (this.is_empty() || - (!force_newline && this.just_added_newline())) { - return false; - } - - // if raw output is enabled, don't print additional newlines, - // but still return True as though you had - if (!this.raw) { - this.__add_outputline(); - } - return true; - }; - - Output$c.prototype.get_code = function(eol) { - this.trim(true); - - // handle some edge cases where the last tokens - // has text that ends with newline(s) - var last_item = this.current_line.pop(); - if (last_item) { - if (last_item[last_item.length - 1] === '\n') { - last_item = last_item.replace(/\n+$/g, ''); - } - this.current_line.push(last_item); - } - - if (this._end_with_newline) { - this.__add_outputline(); - } - - var sweet_code = this.__lines.join('\n'); - - if (eol !== '\n') { - sweet_code = sweet_code.replace(/[\n]/g, eol); - } - return sweet_code; - }; - - Output$c.prototype.set_wrap_point = function() { - this.current_line._set_wrap_point(); - }; - - Output$c.prototype.set_indent = function(indent, alignment) { - indent = indent || 0; - alignment = alignment || 0; - - // Next line stores alignment values - this.next_line.set_indent(indent, alignment); - - // Never indent your first output indent at the start of the file - if (this.__lines.length > 1) { - this.current_line.set_indent(indent, alignment); - return true; - } - - this.current_line.set_indent(); - return false; - }; - - Output$c.prototype.add_raw_token = function(token) { - for (var x = 0; x < token.newlines; x++) { - this.__add_outputline(); - } - this.current_line.set_indent(-1); - this.current_line.push(token.whitespace_before); - this.current_line.push(token.text); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; - }; - - Output$c.prototype.add_token = function(printable_token) { - this.__add_space_before_token(); - this.current_line.push(printable_token); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = this.current_line._allow_wrap(); - }; - - Output$c.prototype.__add_space_before_token = function() { - if (this.space_before_token && !this.just_added_newline()) { - if (!this.non_breaking_space) { - this.set_wrap_point(); - } - this.current_line.push(' '); - } - }; - - Output$c.prototype.remove_indent = function(index) { - var output_length = this.__lines.length; - while (index < output_length) { - this.__lines[index]._remove_indent(); - index++; - } - this.current_line._remove_wrap_indent(); - }; - - Output$c.prototype.trim = function(eat_newlines) { - eat_newlines = (eat_newlines === undefined) ? false : eat_newlines; - - this.current_line.trim(); - - while (eat_newlines && this.__lines.length > 1 && - this.current_line.is_empty()) { - this.__lines.pop(); - this.current_line = this.__lines[this.__lines.length - 1]; - this.current_line.trim(); - } - - this.previous_line = this.__lines.length > 1 ? - this.__lines[this.__lines.length - 2] : null; - }; - - Output$c.prototype.just_added_newline = function() { - return this.current_line.is_empty(); - }; - - Output$c.prototype.just_added_blankline = function() { - return this.is_empty() || - (this.current_line.is_empty() && this.previous_line.is_empty()); - }; - - Output$c.prototype.ensure_empty_line_above = function(starts_with, ends_with) { - var index = this.__lines.length - 2; - while (index >= 0) { - var potentialEmptyLine = this.__lines[index]; - if (potentialEmptyLine.is_empty()) { - break; - } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && - potentialEmptyLine.item(-1) !== ends_with) { - this.__lines.splice(index + 1, 0, new OutputLine(this)); - this.previous_line = this.__lines[this.__lines.length - 2]; - break; - } - index--; - } - }; - - output$1.Output = Output$c; - - var token = {}; - - /*jshint node:true */ - - function Token$2(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; - } - - - token.Token = Token$2; - - var acorn$2 = {}; - - /* jshint node: true, curly: false */ - - (function (exports) { - - // acorn used char codes to squeeze the last bit of performance out - // Beautifier is okay without that, so we're using regex - // permit # (23), $ (36), and @ (64). @ is used in ES7 decorators. - // 65 through 91 are uppercase letters. - // permit _ (95). - // 97 through 123 are lowercase letters. - var baseASCIIidentifierStartChars = "\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"; - - // inside an identifier @ is not allowed but 0-9 are. - var baseASCIIidentifierChars = "\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a"; - - // Big ugly regular expressions that match characters in the - // whitespace, identifier, and identifier-start categories. These - // are only applied when a character is found to actually have a - // code point above 128. - var nonASCIIidentifierStartChars = "\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc"; - var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f"; - //var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - //var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - - var identifierStart = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; - var identifierChars = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; - - exports.identifier = new RegExp(identifierStart + identifierChars, 'g'); - exports.identifierStart = new RegExp(identifierStart); - exports.identifierMatch = new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); - - // Whether a single character denotes a newline. - - exports.newline = /[\n\r\u2028\u2029]/; - - // Matches a whole line break (where CRLF is considered a single - // line break). Used to count lines. - - // in javascript, these two differ - // in python they are the same, different methods are called on them - exports.lineBreak = new RegExp('\r\n|' + exports.newline.source); - exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); - }(acorn$2)); - - var options$4 = {}; - - var options$3 = {}; - - /*jshint node:true */ - - function Options$9(options, merge_child_field) { - this.raw_options = _mergeOpts(options, merge_child_field); - - // Support passing the source text back with no change - this.disabled = this._get_boolean('disabled'); - - this.eol = this._get_characters('eol', 'auto'); - this.end_with_newline = this._get_boolean('end_with_newline'); - this.indent_size = this._get_number('indent_size', 4); - this.indent_char = this._get_characters('indent_char', ' '); - this.indent_level = this._get_number('indent_level'); - - this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); - if (!this.preserve_newlines) { - this.max_preserve_newlines = 0; - } - - this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t'); - if (this.indent_with_tabs) { - this.indent_char = '\t'; - - // indent_size behavior changed after 1.8.6 - // It used to be that indent_size would be - // set to 1 for indent_with_tabs. That is no longer needed and - // actually doesn't make sense - why not use spaces? Further, - // that might produce unexpected behavior - tabs being used - // for single-column alignment. So, when indent_with_tabs is true - // and indent_size is 1, reset indent_size to 4. - if (this.indent_size === 1) { - this.indent_size = 4; - } - } - - // Backwards compat with 1.3.x - this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); - - this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - - // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] - // For now, 'auto' = all off for javascript, all on for html (and inline javascript). - // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); - } - - Options$9.prototype._get_array = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || []; - if (typeof option_value === 'object') { - if (option_value !== null && typeof option_value.concat === 'function') { - result = option_value.concat(); - } - } else if (typeof option_value === 'string') { - result = option_value.split(/[^a-zA-Z0-9_\/\-]+/); - } - return result; - }; - - Options$9.prototype._get_boolean = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = option_value === undefined ? !!default_value : !!option_value; - return result; - }; - - Options$9.prototype._get_characters = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || ''; - if (typeof option_value === 'string') { - result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t'); - } - return result; - }; - - Options$9.prototype._get_number = function(name, default_value) { - var option_value = this.raw_options[name]; - default_value = parseInt(default_value, 10); - if (isNaN(default_value)) { - default_value = 0; - } - var result = parseInt(option_value, 10); - if (isNaN(result)) { - result = default_value; - } - return result; - }; - - Options$9.prototype._get_selection = function(name, selection_list, default_value) { - var result = this._get_selection_list(name, selection_list, default_value); - if (result.length !== 1) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result[0]; - }; - - - Options$9.prototype._get_selection_list = function(name, selection_list, default_value) { - if (!selection_list || selection_list.length === 0) { - throw new Error("Selection list cannot be empty."); - } - - default_value = default_value || [selection_list[0]]; - if (!this._is_valid_selection(default_value, selection_list)) { - throw new Error("Invalid Default Value!"); - } - - var result = this._get_array(name, default_value); - if (!this._is_valid_selection(result, selection_list)) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result; - }; - - Options$9.prototype._is_valid_selection = function(result, selection_list) { - return result.length && selection_list.length && - !result.some(function(item) { return selection_list.indexOf(item) === -1; }); - }; - - - // merges child options up with the parent options object - // Example: obj = {a: 1, b: {a: 2}} - // mergeOpts(obj, 'b') - // - // Returns: {a: 2} - function _mergeOpts(allOptions, childFieldName) { - var finalOpts = {}; - allOptions = _normalizeOpts(allOptions); - var name; - - for (name in allOptions) { - if (name !== childFieldName) { - finalOpts[name] = allOptions[name]; - } - } - - //merge in the per type settings for the childFieldName - if (childFieldName && allOptions[childFieldName]) { - for (name in allOptions[childFieldName]) { - finalOpts[name] = allOptions[childFieldName][name]; - } - } - return finalOpts; - } - - function _normalizeOpts(options) { - var convertedOpts = {}; - var key; - - for (key in options) { - var newKey = key.replace(/-/g, "_"); - convertedOpts[newKey] = options[key]; - } - return convertedOpts; - } - - options$3.Options = Options$9; - options$3.normalizeOpts = _normalizeOpts; - options$3.mergeOpts = _mergeOpts; - - /*jshint node:true */ - - var BaseOptions$2 = options$3.Options; - - var validPositionValues$1 = ['before-newline', 'after-newline', 'preserve-newline']; - - function Options$8(options) { - BaseOptions$2.call(this, options, 'js'); - - // compatibility, re - var raw_brace_style = this.raw_options.brace_style || null; - if (raw_brace_style === "expand-strict") { //graceful handling of deprecated option - this.raw_options.brace_style = "expand"; - } else if (raw_brace_style === "collapse-preserve-inline") { //graceful handling of deprecated option - this.raw_options.brace_style = "collapse,preserve-inline"; - } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option - this.raw_options.brace_style = this.raw_options.braces_on_own_line ? "expand" : "collapse"; - // } else if (!raw_brace_style) { //Nothing exists to set it - // raw_brace_style = "collapse"; - } - - //preserve-inline in delimited string will trigger brace_preserve_inline, everything - //else is considered a brace_style and the last one only will have an effect - - var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); - - this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option - this.brace_style = "collapse"; - - for (var bs = 0; bs < brace_style_split.length; bs++) { - if (brace_style_split[bs] === "preserve-inline") { - this.brace_preserve_inline = true; - } else { - this.brace_style = brace_style_split[bs]; - } - } - - this.unindent_chained_methods = this._get_boolean('unindent_chained_methods'); - this.break_chained_methods = this._get_boolean('break_chained_methods'); - this.space_in_paren = this._get_boolean('space_in_paren'); - this.space_in_empty_paren = this._get_boolean('space_in_empty_paren'); - this.jslint_happy = this._get_boolean('jslint_happy'); - this.space_after_anon_function = this._get_boolean('space_after_anon_function'); - this.space_after_named_function = this._get_boolean('space_after_named_function'); - this.keep_array_indentation = this._get_boolean('keep_array_indentation'); - this.space_before_conditional = this._get_boolean('space_before_conditional', true); - this.unescape_strings = this._get_boolean('unescape_strings'); - this.e4x = this._get_boolean('e4x'); - this.comma_first = this._get_boolean('comma_first'); - this.operator_position = this._get_selection('operator_position', validPositionValues$1); - - // For testing of beautify preserve:start directive - this.test_output_raw = this._get_boolean('test_output_raw'); - - // force this._options.space_after_anon_function to true if this._options.jslint_happy - if (this.jslint_happy) { - this.space_after_anon_function = true; - } - - } - Options$8.prototype = new BaseOptions$2(); - - - - options$4.Options = Options$8; - - var tokenizer$2 = {}; - - var inputscanner = {}; - - /*jshint node:true */ - - var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky'); - - function InputScanner$3(input_string) { - this.__input = input_string || ''; - this.__input_length = this.__input.length; - this.__position = 0; - } - - InputScanner$3.prototype.restart = function() { - this.__position = 0; - }; - - InputScanner$3.prototype.back = function() { - if (this.__position > 0) { - this.__position -= 1; - } - }; - - InputScanner$3.prototype.hasNext = function() { - return this.__position < this.__input_length; - }; - - InputScanner$3.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__input.charAt(this.__position); - this.__position += 1; - } - return val; - }; - - InputScanner$3.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__input_length) { - val = this.__input.charAt(index); - } - return val; - }; - - // This is a JavaScript only helper function (not in python) - // Javascript doesn't have a match method - // and not all implementation support "sticky" flag. - // If they do not support sticky then both this.match() and this.test() method - // must get the match and check the index of the match. - // If sticky is supported and set, this method will use it. - // Otherwise it will check that global is set, and fall back to the slower method. - InputScanner$3.prototype.__match = function(pattern, index) { - pattern.lastIndex = index; - var pattern_match = pattern.exec(this.__input); - - if (pattern_match && !(regexp_has_sticky && pattern.sticky)) { - if (pattern_match.index !== index) { - pattern_match = null; - } - } - - return pattern_match; - }; - - InputScanner$3.prototype.test = function(pattern, index) { - index = index || 0; - index += this.__position; - - if (index >= 0 && index < this.__input_length) { - return !!this.__match(pattern, index); - } else { - return false; - } - }; - - InputScanner$3.prototype.testChar = function(pattern, index) { - // test one character regex match - var val = this.peek(index); - pattern.lastIndex = 0; - return val !== null && pattern.test(val); - }; - - InputScanner$3.prototype.match = function(pattern) { - var pattern_match = this.__match(pattern, this.__position); - if (pattern_match) { - this.__position += pattern_match[0].length; - } else { - pattern_match = null; - } - return pattern_match; - }; - - InputScanner$3.prototype.read = function(starting_pattern, until_pattern, until_after) { - var val = ''; - var match; - if (starting_pattern) { - match = this.match(starting_pattern); - if (match) { - val += match[0]; - } - } - if (until_pattern && (match || !starting_pattern)) { - val += this.readUntil(until_pattern, until_after); - } - return val; - }; - - InputScanner$3.prototype.readUntil = function(pattern, until_after) { - var val = ''; - var match_index = this.__position; - pattern.lastIndex = this.__position; - var pattern_match = pattern.exec(this.__input); - if (pattern_match) { - match_index = pattern_match.index; - if (until_after) { - match_index += pattern_match[0].length; - } - } else { - match_index = this.__input_length; - } - - val = this.__input.substring(this.__position, match_index); - this.__position = match_index; - return val; - }; - - InputScanner$3.prototype.readUntilAfter = function(pattern) { - return this.readUntil(pattern, true); - }; - - InputScanner$3.prototype.get_regexp = function(pattern, match_from) { - var result = null; - var flags = 'g'; - if (match_from && regexp_has_sticky) { - flags = 'y'; - } - // strings are converted to regexp - if (typeof pattern === "string" && pattern !== '') { - // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags); - result = new RegExp(pattern, flags); - } else if (pattern) { - result = new RegExp(pattern.source, flags); - } - return result; - }; - - InputScanner$3.prototype.get_literal_regexp = function(literal_string) { - return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')); - }; - - /* css beautifier legacy helpers */ - InputScanner$3.prototype.peekUntilAfter = function(pattern) { - var start = this.__position; - var val = this.readUntilAfter(pattern); - this.__position = start; - return val; - }; - - InputScanner$3.prototype.lookBack = function(testVal) { - var start = this.__position - 1; - return start >= testVal.length && this.__input.substring(start - testVal.length, start) - .toLowerCase() === testVal; - }; - - inputscanner.InputScanner = InputScanner$3; - - var tokenizer$1 = {}; - - var tokenstream = {}; - - /*jshint node:true */ - - function TokenStream$1(parent_token) { - // private - this.__tokens = []; - this.__tokens_length = this.__tokens.length; - this.__position = 0; - this.__parent_token = parent_token; - } - - TokenStream$1.prototype.restart = function() { - this.__position = 0; - }; - - TokenStream$1.prototype.isEmpty = function() { - return this.__tokens_length === 0; - }; - - TokenStream$1.prototype.hasNext = function() { - return this.__position < this.__tokens_length; - }; - - TokenStream$1.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__tokens[this.__position]; - this.__position += 1; - } - return val; - }; - - TokenStream$1.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__tokens_length) { - val = this.__tokens[index]; - } - return val; - }; - - TokenStream$1.prototype.add = function(token) { - if (this.__parent_token) { - token.parent = this.__parent_token; - } - this.__tokens.push(token); - this.__tokens_length += 1; - }; - - tokenstream.TokenStream = TokenStream$1; - - var whitespacepattern = {}; - - var pattern = {}; - - /*jshint node:true */ - - function Pattern$4(input_scanner, parent) { - this._input = input_scanner; - this._starting_pattern = null; - this._match_pattern = null; - this._until_pattern = null; - this._until_after = false; - - if (parent) { - this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true); - this._match_pattern = this._input.get_regexp(parent._match_pattern, true); - this._until_pattern = this._input.get_regexp(parent._until_pattern); - this._until_after = parent._until_after; - } - } - - Pattern$4.prototype.read = function() { - var result = this._input.read(this._starting_pattern); - if (!this._starting_pattern || result) { - result += this._input.read(this._match_pattern, this._until_pattern, this._until_after); - } - return result; - }; - - Pattern$4.prototype.read_match = function() { - return this._input.match(this._match_pattern); - }; - - Pattern$4.prototype.until_after = function(pattern) { - var result = this._create(); - result._until_after = true; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; - }; - - Pattern$4.prototype.until = function(pattern) { - var result = this._create(); - result._until_after = false; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; - }; - - Pattern$4.prototype.starting_with = function(pattern) { - var result = this._create(); - result._starting_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; - }; - - Pattern$4.prototype.matching = function(pattern) { - var result = this._create(); - result._match_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; - }; - - Pattern$4.prototype._create = function() { - return new Pattern$4(this._input, this); - }; - - Pattern$4.prototype._update = function() {}; - - pattern.Pattern = Pattern$4; - - /*jshint node:true */ - - var Pattern$3 = pattern.Pattern; - - function WhitespacePattern$1(input_scanner, parent) { - Pattern$3.call(this, input_scanner, parent); - if (parent) { - this._line_regexp = this._input.get_regexp(parent._line_regexp); - } else { - this.__set_whitespace_patterns('', ''); - } - - this.newline_count = 0; - this.whitespace_before_token = ''; - } - WhitespacePattern$1.prototype = new Pattern$3(); - - WhitespacePattern$1.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) { - whitespace_chars += '\\t '; - newline_chars += '\\n\\r'; - - this._match_pattern = this._input.get_regexp( - '[' + whitespace_chars + newline_chars + ']+', true); - this._newline_regexp = this._input.get_regexp( - '\\r\\n|[' + newline_chars + ']'); - }; - - WhitespacePattern$1.prototype.read = function() { - this.newline_count = 0; - this.whitespace_before_token = ''; - - var resulting_string = this._input.read(this._match_pattern); - if (resulting_string === ' ') { - this.whitespace_before_token = ' '; - } else if (resulting_string) { - var matches = this.__split(this._newline_regexp, resulting_string); - this.newline_count = matches.length - 1; - this.whitespace_before_token = matches[this.newline_count]; - } - - return resulting_string; - }; - - WhitespacePattern$1.prototype.matching = function(whitespace_chars, newline_chars) { - var result = this._create(); - result.__set_whitespace_patterns(whitespace_chars, newline_chars); - result._update(); - return result; - }; - - WhitespacePattern$1.prototype._create = function() { - return new WhitespacePattern$1(this._input, this); - }; - - WhitespacePattern$1.prototype.__split = function(regexp, input_string) { - regexp.lastIndex = 0; - var start_index = 0; - var result = []; - var next_match = regexp.exec(input_string); - while (next_match) { - result.push(input_string.substring(start_index, next_match.index)); - start_index = next_match.index + next_match[0].length; - next_match = regexp.exec(input_string); - } - - if (start_index < input_string.length) { - result.push(input_string.substring(start_index, input_string.length)); - } else { - result.push(''); - } - - return result; - }; - - - - whitespacepattern.WhitespacePattern = WhitespacePattern$1; - - /*jshint node:true */ - - var InputScanner$2 = inputscanner.InputScanner; - var Token$1 = token.Token; - var TokenStream = tokenstream.TokenStream; - var WhitespacePattern = whitespacepattern.WhitespacePattern; - - var TOKEN$4 = { - START: 'TK_START', - RAW: 'TK_RAW', - EOF: 'TK_EOF' - }; - - var Tokenizer$4 = function(input_string, options) { - this._input = new InputScanner$2(input_string); - this._options = options || {}; - this.__tokens = null; - - this._patterns = {}; - this._patterns.whitespace = new WhitespacePattern(this._input); - }; - - Tokenizer$4.prototype.tokenize = function() { - this._input.restart(); - this.__tokens = new TokenStream(); - - this._reset(); - - var current; - var previous = new Token$1(TOKEN$4.START, ''); - var open_token = null; - var open_stack = []; - var comments = new TokenStream(); - - while (previous.type !== TOKEN$4.EOF) { - current = this._get_next_token(previous, open_token); - while (this._is_comment(current)) { - comments.add(current); - current = this._get_next_token(previous, open_token); - } - - if (!comments.isEmpty()) { - current.comments_before = comments; - comments = new TokenStream(); - } - - current.parent = open_token; - - if (this._is_opening(current)) { - open_stack.push(open_token); - open_token = current; - } else if (open_token && this._is_closing(current, open_token)) { - current.opened = open_token; - open_token.closed = current; - open_token = open_stack.pop(); - current.parent = open_token; - } - - current.previous = previous; - previous.next = current; - - this.__tokens.add(current); - previous = current; - } - - return this.__tokens; - }; - - - Tokenizer$4.prototype._is_first_token = function() { - return this.__tokens.isEmpty(); - }; - - Tokenizer$4.prototype._reset = function() {}; - - Tokenizer$4.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - this._readWhitespace(); - var resulting_string = this._input.read(/.+/g); - if (resulting_string) { - return this._create_token(TOKEN$4.RAW, resulting_string); - } else { - return this._create_token(TOKEN$4.EOF, ''); - } - }; - - Tokenizer$4.prototype._is_comment = function(current_token) { // jshint unused:false - return false; - }; - - Tokenizer$4.prototype._is_opening = function(current_token) { // jshint unused:false - return false; - }; - - Tokenizer$4.prototype._is_closing = function(current_token, open_token) { // jshint unused:false - return false; - }; - - Tokenizer$4.prototype._create_token = function(type, text) { - var token = new Token$1(type, text, - this._patterns.whitespace.newline_count, - this._patterns.whitespace.whitespace_before_token); - return token; - }; - - Tokenizer$4.prototype._readWhitespace = function() { - return this._patterns.whitespace.read(); - }; - - - - tokenizer$1.Tokenizer = Tokenizer$4; - tokenizer$1.TOKEN = TOKEN$4; - - var directives = {}; - - /*jshint node:true */ - - function Directives$3(start_block_pattern, end_block_pattern) { - start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source; - end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source; - this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g'); - this.__directive_pattern = / (\w+)[:](\w+)/g; - - this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g'); - } - - Directives$3.prototype.get_directives = function(text) { - if (!text.match(this.__directives_block_pattern)) { - return null; - } - - var directives = {}; - this.__directive_pattern.lastIndex = 0; - var directive_match = this.__directive_pattern.exec(text); - - while (directive_match) { - directives[directive_match[1]] = directive_match[2]; - directive_match = this.__directive_pattern.exec(text); - } - - return directives; - }; - - Directives$3.prototype.readIgnored = function(input) { - return input.readUntilAfter(this.__directives_end_ignore_pattern); - }; - - - directives.Directives = Directives$3; - - var templatablepattern = {}; - - /*jshint node:true */ - - var Pattern$2 = pattern.Pattern; - - - var template_names = { - django: false, - erb: false, - handlebars: false, - php: false, - smarty: false - }; - - // This lets templates appear anywhere we would do a readUntil - // The cost is higher but it is pay to play. - function TemplatablePattern$2(input_scanner, parent) { - Pattern$2.call(this, input_scanner, parent); - this.__template_pattern = null; - this._disabled = Object.assign({}, template_names); - this._excluded = Object.assign({}, template_names); - - if (parent) { - this.__template_pattern = this._input.get_regexp(parent.__template_pattern); - this._excluded = Object.assign(this._excluded, parent._excluded); - this._disabled = Object.assign(this._disabled, parent._disabled); - } - var pattern = new Pattern$2(input_scanner); - this.__patterns = { - handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/), - handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/), - handlebars: pattern.starting_with(/{{/).until_after(/}}/), - php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/), - erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/), - // django coflicts with handlebars a bit. - django: pattern.starting_with(/{%/).until_after(/%}/), - django_value: pattern.starting_with(/{{/).until_after(/}}/), - django_comment: pattern.starting_with(/{#/).until_after(/#}/), - smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/), - smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/), - smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/) - }; - } - TemplatablePattern$2.prototype = new Pattern$2(); - - TemplatablePattern$2.prototype._create = function() { - return new TemplatablePattern$2(this._input, this); - }; - - TemplatablePattern$2.prototype._update = function() { - this.__set_templated_pattern(); - }; - - TemplatablePattern$2.prototype.disable = function(language) { - var result = this._create(); - result._disabled[language] = true; - result._update(); - return result; - }; - - TemplatablePattern$2.prototype.read_options = function(options) { - var result = this._create(); - for (var language in template_names) { - result._disabled[language] = options.templating.indexOf(language) === -1; - } - result._update(); - return result; - }; - - TemplatablePattern$2.prototype.exclude = function(language) { - var result = this._create(); - result._excluded[language] = true; - result._update(); - return result; - }; - - TemplatablePattern$2.prototype.read = function() { - var result = ''; - if (this._match_pattern) { - result = this._input.read(this._starting_pattern); - } else { - result = this._input.read(this._starting_pattern, this.__template_pattern); - } - var next = this._read_template(); - while (next) { - if (this._match_pattern) { - next += this._input.read(this._match_pattern); - } else { - next += this._input.readUntil(this.__template_pattern); - } - result += next; - next = this._read_template(); - } - - if (this._until_after) { - result += this._input.readUntilAfter(this._until_pattern); - } - return result; - }; - - TemplatablePattern$2.prototype.__set_templated_pattern = function() { - var items = []; - - if (!this._disabled.php) { - items.push(this.__patterns.php._starting_pattern.source); - } - if (!this._disabled.handlebars) { - items.push(this.__patterns.handlebars._starting_pattern.source); - } - if (!this._disabled.erb) { - items.push(this.__patterns.erb._starting_pattern.source); - } - if (!this._disabled.django) { - items.push(this.__patterns.django._starting_pattern.source); - // The starting pattern for django is more complex because it has different - // patterns for value, comment, and other sections - items.push(this.__patterns.django_value._starting_pattern.source); - items.push(this.__patterns.django_comment._starting_pattern.source); - } - if (!this._disabled.smarty) { - items.push(this.__patterns.smarty._starting_pattern.source); - } - - if (this._until_pattern) { - items.push(this._until_pattern.source); - } - this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')'); - }; - - TemplatablePattern$2.prototype._read_template = function() { - var resulting_string = ''; - var c = this._input.peek(); - if (c === '<') { - var peek1 = this._input.peek(1); - //if we're in a comment, do something special - // We treat all comments as literals, even more than preformatted tags - // we just look for the appropriate close tag - if (!this._disabled.php && !this._excluded.php && peek1 === '?') { - resulting_string = resulting_string || - this.__patterns.php.read(); - } - if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') { - resulting_string = resulting_string || - this.__patterns.erb.read(); - } - } else if (c === '{') { - if (!this._disabled.handlebars && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.handlebars_comment.read(); - resulting_string = resulting_string || - this.__patterns.handlebars_unescaped.read(); - resulting_string = resulting_string || - this.__patterns.handlebars.read(); - } - if (!this._disabled.django) { - // django coflicts with handlebars a bit. - if (!this._excluded.django && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.django_value.read(); - } - if (!this._excluded.django) { - resulting_string = resulting_string || - this.__patterns.django_comment.read(); - resulting_string = resulting_string || - this.__patterns.django.read(); - } - } - if (!this._disabled.smarty) { - // smarty cannot be enabled with django or handlebars enabled - if (this._disabled.django && this._disabled.handlebars) { - resulting_string = resulting_string || - this.__patterns.smarty_comment.read(); - resulting_string = resulting_string || - this.__patterns.smarty_literal.read(); - resulting_string = resulting_string || - this.__patterns.smarty.read(); - } - } - } - return resulting_string; - }; - - - templatablepattern.TemplatablePattern = TemplatablePattern$2; - - /*jshint node:true */ - - var InputScanner$1 = inputscanner.InputScanner; - var BaseTokenizer$1 = tokenizer$1.Tokenizer; - var BASETOKEN$1 = tokenizer$1.TOKEN; - var Directives$2 = directives.Directives; - var acorn$1 = acorn$2; - var Pattern$1 = pattern.Pattern; - var TemplatablePattern$1 = templatablepattern.TemplatablePattern; - - - function in_array$2(what, arr) { - return arr.indexOf(what) !== -1; - } - - - var TOKEN$3 = { - START_EXPR: 'TK_START_EXPR', - END_EXPR: 'TK_END_EXPR', - START_BLOCK: 'TK_START_BLOCK', - END_BLOCK: 'TK_END_BLOCK', - WORD: 'TK_WORD', - RESERVED: 'TK_RESERVED', - SEMICOLON: 'TK_SEMICOLON', - STRING: 'TK_STRING', - EQUALS: 'TK_EQUALS', - OPERATOR: 'TK_OPERATOR', - COMMA: 'TK_COMMA', - BLOCK_COMMENT: 'TK_BLOCK_COMMENT', - COMMENT: 'TK_COMMENT', - DOT: 'TK_DOT', - UNKNOWN: 'TK_UNKNOWN', - START: BASETOKEN$1.START, - RAW: BASETOKEN$1.RAW, - EOF: BASETOKEN$1.EOF - }; - - - var directives_core$2 = new Directives$2(/\/\*/, /\*\//); - - var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/; - - var digit = /[0-9]/; - - // Dot "." must be distinguished from "..." and decimal - var dot_pattern = /[^\d\.]/; - - var positionable_operators$1 = ( - ">>> === !== &&= ??= ||= " + - "<< && >= ** != == <= >> || ?? |> " + - "< / - + > : & % ? ^ | *").split(' '); - - // IMPORTANT: this must be sorted longest to shortest or tokenizing many not work. - // Also, you must update possitionable operators separately from punct - var punct = - ">>>= " + - "... >>= <<= === >>> !== **= &&= ??= ||= " + - "=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> " + - "= ! ? > < : / ^ - + * & % ~ |"; - - punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&"); - // ?. but not if followed by a number - punct = '\\?\\.(?!\\d) ' + punct; - punct = punct.replace(/ /g, '|'); - - var punct_pattern = new RegExp(punct); - - // words which should always start on new line. - var line_starters$1 = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(','); - var reserved_words = line_starters$1.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']); - var reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$'); - - // var template_pattern = /(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g; - - var in_html_comment; - - var Tokenizer$3 = function(input_string, options) { - BaseTokenizer$1.call(this, input_string, options); - - this._patterns.whitespace = this._patterns.whitespace.matching( - /\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source, - /\u2028\u2029/.source); - - var pattern_reader = new Pattern$1(this._input); - var templatable = new TemplatablePattern$1(this._input) - .read_options(this._options); - - this.__patterns = { - template: templatable, - identifier: templatable.starting_with(acorn$1.identifier).matching(acorn$1.identifierMatch), - number: pattern_reader.matching(number_pattern), - punct: pattern_reader.matching(punct_pattern), - // comment ends just before nearest linefeed or end of file - comment: pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/), - // /* ... */ comment ends with nearest */ or end of file - block_comment: pattern_reader.starting_with(/\/\*/).until_after(/\*\//), - html_comment_start: pattern_reader.matching(//), - include: pattern_reader.starting_with(/#include/).until_after(acorn$1.lineBreak), - shebang: pattern_reader.starting_with(/#!/).until_after(acorn$1.lineBreak), - xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/), - single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), - double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), - template_text: templatable.until(/[`\\$]/), - template_expression: templatable.until(/[`}\\]/) - }; - - }; - Tokenizer$3.prototype = new BaseTokenizer$1(); - - Tokenizer$3.prototype._is_comment = function(current_token) { - return current_token.type === TOKEN$3.COMMENT || current_token.type === TOKEN$3.BLOCK_COMMENT || current_token.type === TOKEN$3.UNKNOWN; - }; - - Tokenizer$3.prototype._is_opening = function(current_token) { - return current_token.type === TOKEN$3.START_BLOCK || current_token.type === TOKEN$3.START_EXPR; - }; - - Tokenizer$3.prototype._is_closing = function(current_token, open_token) { - return (current_token.type === TOKEN$3.END_BLOCK || current_token.type === TOKEN$3.END_EXPR) && - (open_token && ( - (current_token.text === ']' && open_token.text === '[') || - (current_token.text === ')' && open_token.text === '(') || - (current_token.text === '}' && open_token.text === '{'))); - }; - - Tokenizer$3.prototype._reset = function() { - in_html_comment = false; - }; - - Tokenizer$3.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - var token = null; - this._readWhitespace(); - var c = this._input.peek(); - - if (c === null) { - return this._create_token(TOKEN$3.EOF, ''); - } - - token = token || this._read_non_javascript(c); - token = token || this._read_string(c); - token = token || this._read_word(previous_token); - token = token || this._read_singles(c); - token = token || this._read_comment(c); - token = token || this._read_regexp(c, previous_token); - token = token || this._read_xml(c, previous_token); - token = token || this._read_punctuation(); - token = token || this._create_token(TOKEN$3.UNKNOWN, this._input.next()); - - return token; - }; - - Tokenizer$3.prototype._read_word = function(previous_token) { - var resulting_string; - resulting_string = this.__patterns.identifier.read(); - if (resulting_string !== '') { - resulting_string = resulting_string.replace(acorn$1.allLineBreaks, '\n'); - if (!(previous_token.type === TOKEN$3.DOT || - (previous_token.type === TOKEN$3.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) && - reserved_word_pattern.test(resulting_string)) { - if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators - return this._create_token(TOKEN$3.OPERATOR, resulting_string); - } - return this._create_token(TOKEN$3.RESERVED, resulting_string); - } - return this._create_token(TOKEN$3.WORD, resulting_string); - } - - resulting_string = this.__patterns.number.read(); - if (resulting_string !== '') { - return this._create_token(TOKEN$3.WORD, resulting_string); - } - }; - - Tokenizer$3.prototype._read_singles = function(c) { - var token = null; - if (c === '(' || c === '[') { - token = this._create_token(TOKEN$3.START_EXPR, c); - } else if (c === ')' || c === ']') { - token = this._create_token(TOKEN$3.END_EXPR, c); - } else if (c === '{') { - token = this._create_token(TOKEN$3.START_BLOCK, c); - } else if (c === '}') { - token = this._create_token(TOKEN$3.END_BLOCK, c); - } else if (c === ';') { - token = this._create_token(TOKEN$3.SEMICOLON, c); - } else if (c === '.' && dot_pattern.test(this._input.peek(1))) { - token = this._create_token(TOKEN$3.DOT, c); - } else if (c === ',') { - token = this._create_token(TOKEN$3.COMMA, c); - } - - if (token) { - this._input.next(); - } - return token; - }; - - Tokenizer$3.prototype._read_punctuation = function() { - var resulting_string = this.__patterns.punct.read(); - - if (resulting_string !== '') { - if (resulting_string === '=') { - return this._create_token(TOKEN$3.EQUALS, resulting_string); - } else if (resulting_string === '?.') { - return this._create_token(TOKEN$3.DOT, resulting_string); - } else { - return this._create_token(TOKEN$3.OPERATOR, resulting_string); - } - } - }; - - Tokenizer$3.prototype._read_non_javascript = function(c) { - var resulting_string = ''; - - if (c === '#') { - if (this._is_first_token()) { - resulting_string = this.__patterns.shebang.read(); - - if (resulting_string) { - return this._create_token(TOKEN$3.UNKNOWN, resulting_string.trim() + '\n'); - } - } - - // handles extendscript #includes - resulting_string = this.__patterns.include.read(); - - if (resulting_string) { - return this._create_token(TOKEN$3.UNKNOWN, resulting_string.trim() + '\n'); - } - - c = this._input.next(); - - // Spidermonkey-specific sharp variables for circular references. Considered obsolete. - var sharp = '#'; - if (this._input.hasNext() && this._input.testChar(digit)) { - do { - c = this._input.next(); - sharp += c; - } while (this._input.hasNext() && c !== '#' && c !== '='); - if (c === '#') ; else if (this._input.peek() === '[' && this._input.peek(1) === ']') { - sharp += '[]'; - this._input.next(); - this._input.next(); - } else if (this._input.peek() === '{' && this._input.peek(1) === '}') { - sharp += '{}'; - this._input.next(); - this._input.next(); - } - return this._create_token(TOKEN$3.WORD, sharp); - } - - this._input.back(); - - } else if (c === '<' && this._is_first_token()) { - resulting_string = this.__patterns.html_comment_start.read(); - if (resulting_string) { - while (this._input.hasNext() && !this._input.testChar(acorn$1.newline)) { - resulting_string += this._input.next(); - } - in_html_comment = true; - return this._create_token(TOKEN$3.COMMENT, resulting_string); - } - } else if (in_html_comment && c === '-') { - resulting_string = this.__patterns.html_comment_end.read(); - if (resulting_string) { - in_html_comment = false; - return this._create_token(TOKEN$3.COMMENT, resulting_string); - } - } - - return null; - }; - - Tokenizer$3.prototype._read_comment = function(c) { - var token = null; - if (c === '/') { - var comment = ''; - if (this._input.peek(1) === '*') { - // peek for comment /* ... */ - comment = this.__patterns.block_comment.read(); - var directives = directives_core$2.get_directives(comment); - if (directives && directives.ignore === 'start') { - comment += directives_core$2.readIgnored(this._input); - } - comment = comment.replace(acorn$1.allLineBreaks, '\n'); - token = this._create_token(TOKEN$3.BLOCK_COMMENT, comment); - token.directives = directives; - } else if (this._input.peek(1) === '/') { - // peek for comment // ... - comment = this.__patterns.comment.read(); - token = this._create_token(TOKEN$3.COMMENT, comment); - } - } - return token; - }; - - Tokenizer$3.prototype._read_string = function(c) { - if (c === '`' || c === "'" || c === '"') { - var resulting_string = this._input.next(); - this.has_char_escapes = false; - - if (c === '`') { - resulting_string += this._read_string_recursive('`', true, '${'); - } else { - resulting_string += this._read_string_recursive(c); - } - - if (this.has_char_escapes && this._options.unescape_strings) { - resulting_string = unescape_string(resulting_string); - } - - if (this._input.peek() === c) { - resulting_string += this._input.next(); - } - - resulting_string = resulting_string.replace(acorn$1.allLineBreaks, '\n'); - - return this._create_token(TOKEN$3.STRING, resulting_string); - } - - return null; - }; - - Tokenizer$3.prototype._allow_regexp_or_xml = function(previous_token) { - // regex and xml can only appear in specific locations during parsing - return (previous_token.type === TOKEN$3.RESERVED && in_array$2(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) || - (previous_token.type === TOKEN$3.END_EXPR && previous_token.text === ')' && - previous_token.opened.previous.type === TOKEN$3.RESERVED && in_array$2(previous_token.opened.previous.text, ['if', 'while', 'for'])) || - (in_array$2(previous_token.type, [TOKEN$3.COMMENT, TOKEN$3.START_EXPR, TOKEN$3.START_BLOCK, TOKEN$3.START, - TOKEN$3.END_BLOCK, TOKEN$3.OPERATOR, TOKEN$3.EQUALS, TOKEN$3.EOF, TOKEN$3.SEMICOLON, TOKEN$3.COMMA - ])); - }; - - Tokenizer$3.prototype._read_regexp = function(c, previous_token) { - - if (c === '/' && this._allow_regexp_or_xml(previous_token)) { - // handle regexp - // - var resulting_string = this._input.next(); - var esc = false; - - var in_char_class = false; - while (this._input.hasNext() && - ((esc || in_char_class || this._input.peek() !== c) && - !this._input.testChar(acorn$1.newline))) { - resulting_string += this._input.peek(); - if (!esc) { - esc = this._input.peek() === '\\'; - if (this._input.peek() === '[') { - in_char_class = true; - } else if (this._input.peek() === ']') { - in_char_class = false; - } - } else { - esc = false; - } - this._input.next(); - } - - if (this._input.peek() === c) { - resulting_string += this._input.next(); - - // regexps may have modifiers /regexp/MOD , so fetch those, too - // Only [gim] are valid, but if the user puts in garbage, do what we can to take it. - resulting_string += this._input.read(acorn$1.identifier); - } - return this._create_token(TOKEN$3.STRING, resulting_string); - } - return null; - }; - - Tokenizer$3.prototype._read_xml = function(c, previous_token) { - - if (this._options.e4x && c === "<" && this._allow_regexp_or_xml(previous_token)) { - var xmlStr = ''; - var match = this.__patterns.xml.read_match(); - // handle e4x xml literals - // - if (match) { - // Trim root tag to attempt to - var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}'); - var isCurlyRoot = rootTag.indexOf('{') === 0; - var depth = 0; - while (match) { - var isEndTag = !!match[1]; - var tagName = match[2]; - var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA["); - if (!isSingletonTag && - (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) { - if (isEndTag) { - --depth; - } else { - ++depth; - } - } - xmlStr += match[0]; - if (depth <= 0) { - break; - } - match = this.__patterns.xml.read_match(); - } - // if we didn't close correctly, keep unformatted. - if (!match) { - xmlStr += this._input.match(/[\s\S]*/g)[0]; - } - xmlStr = xmlStr.replace(acorn$1.allLineBreaks, '\n'); - return this._create_token(TOKEN$3.STRING, xmlStr); - } - } - - return null; - }; - - function unescape_string(s) { - // You think that a regex would work for this - // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) { - // return String.fromCharCode(parseInt(val, 16)); - // }) - // However, dealing with '\xff', '\\xff', '\\\xff' makes this more fun. - var out = '', - escaped = 0; - - var input_scan = new InputScanner$1(s); - var matched = null; - - while (input_scan.hasNext()) { - // Keep any whitespace, non-slash characters - // also keep slash pairs. - matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g); - - if (matched) { - out += matched[0]; - } - - if (input_scan.peek() === '\\') { - input_scan.next(); - if (input_scan.peek() === 'x') { - matched = input_scan.match(/x([0-9A-Fa-f]{2})/g); - } else if (input_scan.peek() === 'u') { - matched = input_scan.match(/u([0-9A-Fa-f]{4})/g); - } else { - out += '\\'; - if (input_scan.hasNext()) { - out += input_scan.next(); - } - continue; - } - - // If there's some error decoding, return the original string - if (!matched) { - return s; - } - - escaped = parseInt(matched[1], 16); - - if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) { - // we bail out on \x7f..\xff, - // leaving whole string escaped, - // as it's probably completely binary - return s; - } else if (escaped >= 0x00 && escaped < 0x20) { - // leave 0x00...0x1f escaped - out += '\\' + matched[0]; - continue; - } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) { - // single-quote, apostrophe, backslash - escape these - out += '\\' + String.fromCharCode(escaped); - } else { - out += String.fromCharCode(escaped); - } - } - } - - return out; - } - - // handle string - // - Tokenizer$3.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) { - var current_char; - var pattern; - if (delimiter === '\'') { - pattern = this.__patterns.single_quote; - } else if (delimiter === '"') { - pattern = this.__patterns.double_quote; - } else if (delimiter === '`') { - pattern = this.__patterns.template_text; - } else if (delimiter === '}') { - pattern = this.__patterns.template_expression; - } - - var resulting_string = pattern.read(); - var next = ''; - while (this._input.hasNext()) { - next = this._input.next(); - if (next === delimiter || - (!allow_unescaped_newlines && acorn$1.newline.test(next))) { - this._input.back(); - break; - } else if (next === '\\' && this._input.hasNext()) { - current_char = this._input.peek(); - - if (current_char === 'x' || current_char === 'u') { - this.has_char_escapes = true; - } else if (current_char === '\r' && this._input.peek(1) === '\n') { - this._input.next(); - } - next += this._input.next(); - } else if (start_sub) { - if (start_sub === '${' && next === '$' && this._input.peek() === '{') { - next += this._input.next(); - } - - if (start_sub === next) { - if (delimiter === '`') { - next += this._read_string_recursive('}', allow_unescaped_newlines, '`'); - } else { - next += this._read_string_recursive('`', allow_unescaped_newlines, '${'); - } - if (this._input.hasNext()) { - next += this._input.next(); - } - } - } - next += pattern.read(); - resulting_string += next; - } - - return resulting_string; - }; - - tokenizer$2.Tokenizer = Tokenizer$3; - tokenizer$2.TOKEN = TOKEN$3; - tokenizer$2.positionable_operators = positionable_operators$1.slice(); - tokenizer$2.line_starters = line_starters$1.slice(); - - /*jshint node:true */ - - var Output$b = output$1.Output; - var Token = token.Token; - var acorn = acorn$2; - var Options$7 = options$4.Options; - var Tokenizer$2 = tokenizer$2.Tokenizer; - var line_starters = tokenizer$2.line_starters; - var positionable_operators = tokenizer$2.positionable_operators; - var TOKEN$2 = tokenizer$2.TOKEN; - - - function in_array$1(what, arr) { - return arr.indexOf(what) !== -1; - } - - function ltrim(s) { - return s.replace(/^\s+/g, ''); - } - - function generateMapFromStrings(list) { - var result = {}; - for (var x = 0; x < list.length; x++) { - // make the mapped names underscored instead of dash - result[list[x].replace(/-/g, '_')] = list[x]; - } - return result; - } - - function reserved_word(token, word) { - return token && token.type === TOKEN$2.RESERVED && token.text === word; - } - - function reserved_array(token, words) { - return token && token.type === TOKEN$2.RESERVED && in_array$1(token.text, words); - } - // Unsure of what they mean, but they work. Worth cleaning up in future. - var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']; - - var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; - - // Generate map from array - var OPERATOR_POSITION = generateMapFromStrings(validPositionValues); - - var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline]; - - var MODE = { - BlockStatement: 'BlockStatement', // 'BLOCK' - Statement: 'Statement', // 'STATEMENT' - ObjectLiteral: 'ObjectLiteral', // 'OBJECT', - ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]', - ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)', - Conditional: 'Conditional', //'(COND-EXPRESSION)', - Expression: 'Expression' //'(EXPRESSION)' - }; - - function remove_redundant_indentation(output, frame) { - // This implementation is effective but has some issues: - // - can cause line wrap to happen too soon due to indent removal - // after wrap points are calculated - // These issues are minor compared to ugly indentation. - - if (frame.multiline_frame || - frame.mode === MODE.ForInitializer || - frame.mode === MODE.Conditional) { - return; - } - - // remove one indent from each line inside this section - output.remove_indent(frame.start_line_index); - } - - // we could use just string.split, but - // IE doesn't like returning empty strings - function split_linebreaks(s) { - //return s.split(/\x0d\x0a|\x0a/); - - s = s.replace(acorn.allLineBreaks, '\n'); - var out = [], - idx = s.indexOf("\n"); - while (idx !== -1) { - out.push(s.substring(0, idx)); - s = s.substring(idx + 1); - idx = s.indexOf("\n"); - } - if (s.length) { - out.push(s); - } - return out; - } - - function is_array(mode) { - return mode === MODE.ArrayLiteral; - } - - function is_expression(mode) { - return in_array$1(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]); - } - - function all_lines_start_with(lines, c) { - for (var i = 0; i < lines.length; i++) { - var line = lines[i].trim(); - if (line.charAt(0) !== c) { - return false; - } - } - return true; - } - - function each_line_matches_indent(lines, indent) { - var i = 0, - len = lines.length, - line; - for (; i < len; i++) { - line = lines[i]; - // allow empty lines to pass through - if (line && line.indexOf(indent) !== 0) { - return false; - } - } - return true; - } - - - function Beautifier$5(source_text, options) { - options = options || {}; - this._source_text = source_text || ''; - - this._output = null; - this._tokens = null; - this._last_last_text = null; - this._flags = null; - this._previous_flags = null; - - this._flag_store = null; - this._options = new Options$7(options); - } - - Beautifier$5.prototype.create_flags = function(flags_base, mode) { - var next_indent_level = 0; - if (flags_base) { - next_indent_level = flags_base.indentation_level; - if (!this._output.just_added_newline() && - flags_base.line_indent_level > next_indent_level) { - next_indent_level = flags_base.line_indent_level; - } - } - - var next_flags = { - mode: mode, - parent: flags_base, - last_token: flags_base ? flags_base.last_token : new Token(TOKEN$2.START_BLOCK, ''), // last token text - last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed - declaration_statement: false, - declaration_assignment: false, - multiline_frame: false, - inline_frame: false, - if_block: false, - else_block: false, - do_block: false, - do_while: false, - import_block: false, - in_case_statement: false, // switch(..){ INSIDE HERE } - in_case: false, // we're on the exact line with "case 0:" - case_body: false, // the indented case-action block - case_block: false, // the indented case-action block is wrapped with {} - indentation_level: next_indent_level, - alignment: 0, - line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level, - start_line_index: this._output.get_line_number(), - ternary_depth: 0 - }; - return next_flags; - }; - - Beautifier$5.prototype._reset = function(source_text) { - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - this._last_last_text = ''; // pre-last token text - this._output = new Output$b(this._options, baseIndentString); - - // If testing the ignore directive, start with output disable set to true - this._output.raw = this._options.test_output_raw; - - - // Stack of parsing/formatting states, including MODE. - // We tokenize, parse, and output in an almost purely a forward-only stream of token input - // and formatted output. This makes the beautifier less accurate than full parsers - // but also far more tolerant of syntax errors. - // - // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type - // MODE.BlockStatement on the the stack, even though it could be object literal. If we later - // encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";", - // most full parsers would die, but the beautifier gracefully falls back to - // MODE.BlockStatement and continues on. - this._flag_store = []; - this.set_mode(MODE.BlockStatement); - var tokenizer = new Tokenizer$2(source_text, this._options); - this._tokens = tokenizer.tokenize(); - return source_text; - }; - - Beautifier$5.prototype.beautify = function() { - // if disabled, return the input unchanged. - if (this._options.disabled) { - return this._source_text; - } - - var sweet_code; - var source_text = this._reset(this._source_text); - - var eol = this._options.eol; - if (this._options.eol === 'auto') { - eol = '\n'; - if (source_text && acorn.lineBreak.test(source_text || '')) { - eol = source_text.match(acorn.lineBreak)[0]; - } - } - - var current_token = this._tokens.next(); - while (current_token) { - this.handle_token(current_token); - - this._last_last_text = this._flags.last_token.text; - this._flags.last_token = current_token; - - current_token = this._tokens.next(); - } - - sweet_code = this._output.get_code(eol); - - return sweet_code; - }; - - Beautifier$5.prototype.handle_token = function(current_token, preserve_statement_flags) { - if (current_token.type === TOKEN$2.START_EXPR) { - this.handle_start_expr(current_token); - } else if (current_token.type === TOKEN$2.END_EXPR) { - this.handle_end_expr(current_token); - } else if (current_token.type === TOKEN$2.START_BLOCK) { - this.handle_start_block(current_token); - } else if (current_token.type === TOKEN$2.END_BLOCK) { - this.handle_end_block(current_token); - } else if (current_token.type === TOKEN$2.WORD) { - this.handle_word(current_token); - } else if (current_token.type === TOKEN$2.RESERVED) { - this.handle_word(current_token); - } else if (current_token.type === TOKEN$2.SEMICOLON) { - this.handle_semicolon(current_token); - } else if (current_token.type === TOKEN$2.STRING) { - this.handle_string(current_token); - } else if (current_token.type === TOKEN$2.EQUALS) { - this.handle_equals(current_token); - } else if (current_token.type === TOKEN$2.OPERATOR) { - this.handle_operator(current_token); - } else if (current_token.type === TOKEN$2.COMMA) { - this.handle_comma(current_token); - } else if (current_token.type === TOKEN$2.BLOCK_COMMENT) { - this.handle_block_comment(current_token, preserve_statement_flags); - } else if (current_token.type === TOKEN$2.COMMENT) { - this.handle_comment(current_token, preserve_statement_flags); - } else if (current_token.type === TOKEN$2.DOT) { - this.handle_dot(current_token); - } else if (current_token.type === TOKEN$2.EOF) { - this.handle_eof(current_token); - } else if (current_token.type === TOKEN$2.UNKNOWN) { - this.handle_unknown(current_token, preserve_statement_flags); - } else { - this.handle_unknown(current_token, preserve_statement_flags); - } - }; - - Beautifier$5.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) { - var newlines = current_token.newlines; - var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode); - - if (current_token.comments_before) { - var comment_token = current_token.comments_before.next(); - while (comment_token) { - // The cleanest handling of inline comments is to treat them as though they aren't there. - // Just continue formatting and the behavior should be logical. - // Also ignore unknown tokens. Again, this should result in better behavior. - this.handle_whitespace_and_comments(comment_token, preserve_statement_flags); - this.handle_token(comment_token, preserve_statement_flags); - comment_token = current_token.comments_before.next(); - } - } - - if (keep_whitespace) { - for (var i = 0; i < newlines; i += 1) { - this.print_newline(i > 0, preserve_statement_flags); - } - } else { - if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) { - newlines = this._options.max_preserve_newlines; - } - - if (this._options.preserve_newlines) { - if (newlines > 1) { - this.print_newline(false, preserve_statement_flags); - for (var j = 1; j < newlines; j += 1) { - this.print_newline(true, preserve_statement_flags); - } - } - } - } - - }; - - var newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield']; - - Beautifier$5.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) { - force_linewrap = (force_linewrap === undefined) ? false : force_linewrap; - - // Never wrap the first token on a line - if (this._output.just_added_newline()) { - return; - } - - var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap; - var operatorLogicApplies = in_array$1(this._flags.last_token.text, positionable_operators) || - in_array$1(current_token.text, positionable_operators); - - if (operatorLogicApplies) { - var shouldPrintOperatorNewline = ( - in_array$1(this._flags.last_token.text, positionable_operators) && - in_array$1(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE) - ) || - in_array$1(current_token.text, positionable_operators); - shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline; - } - - if (shouldPreserveOrForce) { - this.print_newline(false, true); - } else if (this._options.wrap_line_length) { - if (reserved_array(this._flags.last_token, newline_restricted_tokens)) { - // These tokens should never have a newline inserted - // between them and the following expression. - return; - } - this._output.set_wrap_point(); - } - }; - - Beautifier$5.prototype.print_newline = function(force_newline, preserve_statement_flags) { - if (!preserve_statement_flags) { - if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN$2.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) { - var next_token = this._tokens.peek(); - while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && reserved_word(next_token, 'else')) && - !this._flags.do_block) { - this.restore_mode(); - } - } - } - - if (this._output.add_new_line(force_newline)) { - this._flags.multiline_frame = true; - } - }; - - Beautifier$5.prototype.print_token_line_indentation = function(current_token) { - if (this._output.just_added_newline()) { - if (this._options.keep_array_indentation && - current_token.newlines && - (current_token.text === '[' || is_array(this._flags.mode))) { - this._output.current_line.set_indent(-1); - this._output.current_line.push(current_token.whitespace_before); - this._output.space_before_token = false; - } else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) { - this._flags.line_indent_level = this._flags.indentation_level; - } - } - }; - - Beautifier$5.prototype.print_token = function(current_token) { - if (this._output.raw) { - this._output.add_raw_token(current_token); - return; - } - - if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN$2.COMMA && - this._output.just_added_newline()) { - if (this._output.previous_line.last() === ',') { - var popped = this._output.previous_line.pop(); - // if the comma was already at the start of the line, - // pull back onto that line and reprint the indentation - if (this._output.previous_line.is_empty()) { - this._output.previous_line.push(popped); - this._output.trim(true); - this._output.current_line.pop(); - this._output.trim(); - } - - // add the comma in front of the next token - this.print_token_line_indentation(current_token); - this._output.add_token(','); - this._output.space_before_token = true; - } - } - - this.print_token_line_indentation(current_token); - this._output.non_breaking_space = true; - this._output.add_token(current_token.text); - if (this._output.previous_token_wrapped) { - this._flags.multiline_frame = true; - } - }; - - Beautifier$5.prototype.indent = function() { - this._flags.indentation_level += 1; - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - }; - - Beautifier$5.prototype.deindent = function() { - if (this._flags.indentation_level > 0 && - ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) { - this._flags.indentation_level -= 1; - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - } - }; - - Beautifier$5.prototype.set_mode = function(mode) { - if (this._flags) { - this._flag_store.push(this._flags); - this._previous_flags = this._flags; - } else { - this._previous_flags = this.create_flags(null, mode); - } - - this._flags = this.create_flags(this._previous_flags, mode); - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - }; - - - Beautifier$5.prototype.restore_mode = function() { - if (this._flag_store.length > 0) { - this._previous_flags = this._flags; - this._flags = this._flag_store.pop(); - if (this._previous_flags.mode === MODE.Statement) { - remove_redundant_indentation(this._output, this._previous_flags); - } - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - } - }; - - Beautifier$5.prototype.start_of_object_property = function() { - return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && ( - (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set']))); - }; - - Beautifier$5.prototype.start_of_statement = function(current_token) { - var start = false; - start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN$2.WORD; - start = start || reserved_word(this._flags.last_token, 'do'); - start = start || (!(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement)) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines; - start = start || reserved_word(this._flags.last_token, 'else') && - !(reserved_word(current_token, 'if') && !current_token.comments_before); - start = start || (this._flags.last_token.type === TOKEN$2.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); - start = start || (this._flags.last_token.type === TOKEN$2.WORD && this._flags.mode === MODE.BlockStatement && - !this._flags.in_case && - !(current_token.text === '--' || current_token.text === '++') && - this._last_last_text !== 'function' && - current_token.type !== TOKEN$2.WORD && current_token.type !== TOKEN$2.RESERVED); - start = start || (this._flags.mode === MODE.ObjectLiteral && ( - (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set']))); - - if (start) { - this.set_mode(MODE.Statement); - this.indent(); - - this.handle_whitespace_and_comments(current_token, true); - - // Issue #276: - // If starting a new statement with [if, for, while, do], push to a new line. - // if (a) if (b) if(c) d(); else e(); else f(); - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token, - reserved_array(current_token, ['do', 'for', 'if', 'while'])); - } - return true; - } - return false; - }; - - Beautifier$5.prototype.handle_start_expr = function(current_token) { - // The conditional starts the statement if appropriate. - if (!this.start_of_statement(current_token)) { - this.handle_whitespace_and_comments(current_token); - } - - var next_mode = MODE.Expression; - if (current_token.text === '[') { - - if (this._flags.last_token.type === TOKEN$2.WORD || this._flags.last_token.text === ')') { - // this is array index specifier, break immediately - // a[x], fn()[x] - if (reserved_array(this._flags.last_token, line_starters)) { - this._output.space_before_token = true; - } - this.print_token(current_token); - this.set_mode(next_mode); - this.indent(); - if (this._options.space_in_paren) { - this._output.space_before_token = true; - } - return; - } - - next_mode = MODE.ArrayLiteral; - if (is_array(this._flags.mode)) { - if (this._flags.last_token.text === '[' || - (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { - // ], [ goes to new line - // }, [ goes to new line - if (!this._options.keep_array_indentation) { - this.print_newline(); - } - } - } - - if (!in_array$1(this._flags.last_token.type, [TOKEN$2.START_EXPR, TOKEN$2.END_EXPR, TOKEN$2.WORD, TOKEN$2.OPERATOR, TOKEN$2.DOT])) { - this._output.space_before_token = true; - } - } else { - if (this._flags.last_token.type === TOKEN$2.RESERVED) { - if (this._flags.last_token.text === 'for') { - this._output.space_before_token = this._options.space_before_conditional; - next_mode = MODE.ForInitializer; - } else if (in_array$1(this._flags.last_token.text, ['if', 'while', 'switch'])) { - this._output.space_before_token = this._options.space_before_conditional; - next_mode = MODE.Conditional; - } else if (in_array$1(this._flags.last_word, ['await', 'async'])) { - // Should be a space between await and an IIFE, or async and an arrow function - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') { - this._output.space_before_token = false; - } else if (in_array$1(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') { - this._output.space_before_token = true; - } - } else if (this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - // Support of this kind of newline preservation. - // a = (b && - // (c || d)); - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } else if (this._flags.last_token.type === TOKEN$2.WORD) { - this._output.space_before_token = false; - - // function name() vs function name () - // function* name() vs function* name () - // async name() vs async name () - // In ES6, you can also define the method properties of an object - // var obj = {a: function() {}} - // It can be abbreviated - // var obj = {a() {}} - // var obj = { a() {}} vs var obj = { a () {}} - // var obj = { * a() {}} vs var obj = { * a () {}} - var peek_back_two = this._tokens.peek(-3); - if (this._options.space_after_named_function && peek_back_two) { - // peek starts at next character so -1 is current token - var peek_back_three = this._tokens.peek(-4); - if (reserved_array(peek_back_two, ['async', 'function']) || - (peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) { - this._output.space_before_token = true; - } else if (this._flags.mode === MODE.ObjectLiteral) { - if ((peek_back_two.text === '{' || peek_back_two.text === ',') || - (peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) { - this._output.space_before_token = true; - } - } - } - } else { - // Support preserving wrapped arrow function expressions - // a.b('c', - // () => d.e - // ) - this.allow_wrap_or_preserved_newline(current_token); - } - - // function() vs function () - // yield*() vs yield* () - // function*() vs function* () - if ((this._flags.last_token.type === TOKEN$2.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || - (this._flags.last_token.text === '*' && - (in_array$1(this._last_last_text, ['function', 'yield']) || - (this._flags.mode === MODE.ObjectLiteral && in_array$1(this._last_last_text, ['{', ',']))))) { - this._output.space_before_token = this._options.space_after_anon_function; - } - } - - if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN$2.START_BLOCK) { - this.print_newline(); - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN$2.COMMA) { - // do nothing on (( and )( and ][ and ]( and .( - // TODO: Consider whether forcing this is required. Review failing tests when removed. - this.allow_wrap_or_preserved_newline(current_token, current_token.newlines); - } - - this.print_token(current_token); - this.set_mode(next_mode); - if (this._options.space_in_paren) { - this._output.space_before_token = true; - } - - // In all cases, if we newline while inside an expression it should be indented. - this.indent(); - }; - - Beautifier$5.prototype.handle_end_expr = function(current_token) { - // statements inside expressions are not valid syntax, but... - // statements must all be closed when their container closes - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - this.handle_whitespace_and_comments(current_token); - - if (this._flags.multiline_frame) { - this.allow_wrap_or_preserved_newline(current_token, - current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation); - } - - if (this._options.space_in_paren) { - if (this._flags.last_token.type === TOKEN$2.START_EXPR && !this._options.space_in_empty_paren) { - // () [] no inner space in empty parens like these, ever, ref #320 - this._output.trim(); - this._output.space_before_token = false; - } else { - this._output.space_before_token = true; - } - } - this.deindent(); - this.print_token(current_token); - this.restore_mode(); - - remove_redundant_indentation(this._output, this._previous_flags); - - // do {} while () // no statement required after - if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) { - this._previous_flags.mode = MODE.Expression; - this._flags.do_block = false; - this._flags.do_while = false; - - } - }; - - Beautifier$5.prototype.handle_start_block = function(current_token) { - this.handle_whitespace_and_comments(current_token); - - // Check if this is should be treated as a ObjectLiteral - var next_token = this._tokens.peek(); - var second_token = this._tokens.peek(1); - if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN$2.END_EXPR) { - this.set_mode(MODE.BlockStatement); - this._flags.in_case_statement = true; - } else if (this._flags.case_body) { - this.set_mode(MODE.BlockStatement); - } else if (second_token && ( - (in_array$1(second_token.text, [':', ',']) && in_array$1(next_token.type, [TOKEN$2.STRING, TOKEN$2.WORD, TOKEN$2.RESERVED])) || - (in_array$1(next_token.text, ['get', 'set', '...']) && in_array$1(second_token.type, [TOKEN$2.WORD, TOKEN$2.RESERVED])) - )) { - // We don't support TypeScript,but we didn't break it for a very long time. - // We'll try to keep not breaking it. - if (in_array$1(this._last_last_text, ['class', 'interface']) && !in_array$1(second_token.text, [':', ','])) { - this.set_mode(MODE.BlockStatement); - } else { - this.set_mode(MODE.ObjectLiteral); - } - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR && this._flags.last_token.text === '=>') { - // arrow function: (param1, paramN) => { statements } - this.set_mode(MODE.BlockStatement); - } else if (in_array$1(this._flags.last_token.type, [TOKEN$2.EQUALS, TOKEN$2.START_EXPR, TOKEN$2.COMMA, TOKEN$2.OPERATOR]) || - reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default']) - ) { - // Detecting shorthand function syntax is difficult by scanning forward, - // so check the surrounding context. - // If the block is being returned, imported, export default, passed as arg, - // assigned with = or assigned in a nested object, treat as an ObjectLiteral. - this.set_mode(MODE.ObjectLiteral); - } else { - this.set_mode(MODE.BlockStatement); - } - - var empty_braces = !next_token.comments_before && next_token.text === '}'; - var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' && - this._flags.last_token.type === TOKEN$2.END_EXPR; - - if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so - { - // search forward for a newline wanted inside this block - var index = 0; - var check_token = null; - this._flags.inline_frame = true; - do { - index += 1; - check_token = this._tokens.peek(index - 1); - if (check_token.newlines) { - this._flags.inline_frame = false; - break; - } - } while (check_token.type !== TOKEN$2.EOF && - !(check_token.type === TOKEN$2.END_BLOCK && check_token.opened === current_token)); - } - - if ((this._options.brace_style === "expand" || - (this._options.brace_style === "none" && current_token.newlines)) && - !this._flags.inline_frame) { - if (this._flags.last_token.type !== TOKEN$2.OPERATOR && - (empty_anonymous_function || - this._flags.last_token.type === TOKEN$2.EQUALS || - (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) { - this._output.space_before_token = true; - } else { - this.print_newline(false, true); - } - } else { // collapse || inline_frame - if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.COMMA)) { - if (this._flags.last_token.type === TOKEN$2.COMMA || this._options.space_in_paren) { - this._output.space_before_token = true; - } - - if (this._flags.last_token.type === TOKEN$2.COMMA || (this._flags.last_token.type === TOKEN$2.START_EXPR && this._flags.inline_frame)) { - this.allow_wrap_or_preserved_newline(current_token); - this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame; - this._flags.multiline_frame = false; - } - } - if (this._flags.last_token.type !== TOKEN$2.OPERATOR && this._flags.last_token.type !== TOKEN$2.START_EXPR) { - if (this._flags.last_token.type === TOKEN$2.START_BLOCK && !this._flags.inline_frame) { - this.print_newline(); - } else { - this._output.space_before_token = true; - } - } - } - this.print_token(current_token); - this.indent(); - - // Except for specific cases, open braces are followed by a new line. - if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) { - this.print_newline(); - } - }; - - Beautifier$5.prototype.handle_end_block = function(current_token) { - // statements must all be closed when their container closes - this.handle_whitespace_and_comments(current_token); - - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - var empty_braces = this._flags.last_token.type === TOKEN$2.START_BLOCK; - - if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first - this._output.space_before_token = true; - } else if (this._options.brace_style === "expand") { - if (!empty_braces) { - this.print_newline(); - } - } else { - // skip {} - if (!empty_braces) { - if (is_array(this._flags.mode) && this._options.keep_array_indentation) { - // we REALLY need a newline here, but newliner would skip that - this._options.keep_array_indentation = false; - this.print_newline(); - this._options.keep_array_indentation = true; - - } else { - this.print_newline(); - } - } - } - this.restore_mode(); - this.print_token(current_token); - }; - - Beautifier$5.prototype.handle_word = function(current_token) { - if (current_token.type === TOKEN$2.RESERVED) { - if (in_array$1(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) { - current_token.type = TOKEN$2.WORD; - } else if (current_token.text === 'import' && in_array$1(this._tokens.peek().text, ['(', '.'])) { - current_token.type = TOKEN$2.WORD; - } else if (in_array$1(current_token.text, ['as', 'from']) && !this._flags.import_block) { - current_token.type = TOKEN$2.WORD; - } else if (this._flags.mode === MODE.ObjectLiteral) { - var next_token = this._tokens.peek(); - if (next_token.text === ':') { - current_token.type = TOKEN$2.WORD; - } - } - } - - if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN$2.WORD) { - this._flags.declaration_statement = true; - } - } else if (current_token.newlines && !is_expression(this._flags.mode) && - (this._flags.last_token.type !== TOKEN$2.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) && - this._flags.last_token.type !== TOKEN$2.EQUALS && - (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) { - this.handle_whitespace_and_comments(current_token); - this.print_newline(); - } else { - this.handle_whitespace_and_comments(current_token); - } - - if (this._flags.do_block && !this._flags.do_while) { - if (reserved_word(current_token, 'while')) { - // do {} ## while () - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; - this._flags.do_while = true; - return; - } else { - // do {} should always have while as the next word. - // if we don't see the expected while, recover - this.print_newline(); - this._flags.do_block = false; - } - } - - // if may be followed by else, or not - // Bare/inline ifs are tricky - // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e(); - if (this._flags.if_block) { - if (!this._flags.else_block && reserved_word(current_token, 'else')) { - this._flags.else_block = true; - } else { - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - this._flags.if_block = false; - this._flags.else_block = false; - } - } - - if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) { - this.print_newline(); - if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) { - // switch cases following one another - this.deindent(); - } - this._flags.case_body = false; - - this.print_token(current_token); - this._flags.in_case = true; - return; - } - - if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } - - if (reserved_word(current_token, 'function')) { - if (in_array$1(this._flags.last_token.text, ['}', ';']) || - (this._output.just_added_newline() && !(in_array$1(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN$2.OPERATOR))) { - // make sure there is a nice clean space of at least one blank line - // before a new function definition - if (!this._output.just_added_blankline() && !current_token.comments_before) { - this.print_newline(); - this.print_newline(true); - } - } - if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD) { - if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) || - reserved_array(this._flags.last_token, newline_restricted_tokens)) { - this._output.space_before_token = true; - } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') { - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'declare') { - // accomodates Typescript declare function formatting - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR || this._flags.last_token.text === '=') { - // foo = function - this._output.space_before_token = true; - } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) ; else { - this.print_newline(); - } - - this.print_token(current_token); - this._flags.last_word = current_token.text; - return; - } - - var prefix = 'NONE'; - - if (this._flags.last_token.type === TOKEN$2.END_BLOCK) { - - if (this._previous_flags.inline_frame) { - prefix = 'SPACE'; - } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) { - prefix = 'NEWLINE'; - } else { - if (this._options.brace_style === "expand" || - this._options.brace_style === "end-expand" || - (this._options.brace_style === "none" && current_token.newlines)) { - prefix = 'NEWLINE'; - } else { - prefix = 'SPACE'; - this._output.space_before_token = true; - } - } - } else if (this._flags.last_token.type === TOKEN$2.SEMICOLON && this._flags.mode === MODE.BlockStatement) { - // TODO: Should this be for STATEMENT as well? - prefix = 'NEWLINE'; - } else if (this._flags.last_token.type === TOKEN$2.SEMICOLON && is_expression(this._flags.mode)) { - prefix = 'SPACE'; - } else if (this._flags.last_token.type === TOKEN$2.STRING) { - prefix = 'NEWLINE'; - } else if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD || - (this._flags.last_token.text === '*' && - (in_array$1(this._last_last_text, ['function', 'yield']) || - (this._flags.mode === MODE.ObjectLiteral && in_array$1(this._last_last_text, ['{', ',']))))) { - prefix = 'SPACE'; - } else if (this._flags.last_token.type === TOKEN$2.START_BLOCK) { - if (this._flags.inline_frame) { - prefix = 'SPACE'; - } else { - prefix = 'NEWLINE'; - } - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR) { - this._output.space_before_token = true; - prefix = 'NEWLINE'; - } - - if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { - if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') { - prefix = 'SPACE'; - } else { - prefix = 'NEWLINE'; - } - - } - - if (reserved_array(current_token, ['else', 'catch', 'finally'])) { - if ((!(this._flags.last_token.type === TOKEN$2.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || - this._options.brace_style === "expand" || - this._options.brace_style === "end-expand" || - (this._options.brace_style === "none" && current_token.newlines)) && - !this._flags.inline_frame) { - this.print_newline(); - } else { - this._output.trim(true); - var line = this._output.current_line; - // If we trimmed and there's something other than a close block before us - // put a newline back in. Handles '} // comment' scenario. - if (line.last() !== '}') { - this.print_newline(); - } - this._output.space_before_token = true; - } - } else if (prefix === 'NEWLINE') { - if (reserved_array(this._flags.last_token, special_words)) { - // no newline between 'return nnn' - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) { - // accomodates Typescript declare formatting - this._output.space_before_token = true; - } else if (this._flags.last_token.type !== TOKEN$2.END_EXPR) { - if ((this._flags.last_token.type !== TOKEN$2.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') { - // no need to force newline on 'var': for (var x = 0...) - if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) { - // no newline for } else if { - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } - } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { - this.print_newline(); - } - } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') { - this.print_newline(); // }, in lists get a newline treatment - } else if (prefix === 'SPACE') { - this._output.space_before_token = true; - } - if (current_token.previous && (current_token.previous.type === TOKEN$2.WORD || current_token.previous.type === TOKEN$2.RESERVED)) { - this._output.space_before_token = true; - } - this.print_token(current_token); - this._flags.last_word = current_token.text; - - if (current_token.type === TOKEN$2.RESERVED) { - if (current_token.text === 'do') { - this._flags.do_block = true; - } else if (current_token.text === 'if') { - this._flags.if_block = true; - } else if (current_token.text === 'import') { - this._flags.import_block = true; - } else if (this._flags.import_block && reserved_word(current_token, 'from')) { - this._flags.import_block = false; - } - } - }; - - Beautifier$5.prototype.handle_semicolon = function(current_token) { - if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - // Semicolon can be the start (and end) of a statement - this._output.space_before_token = false; - } else { - this.handle_whitespace_and_comments(current_token); - } - - var next_token = this._tokens.peek(); - while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && reserved_word(next_token, 'else')) && - !this._flags.do_block) { - this.restore_mode(); - } - - // hacky but effective for the moment - if (this._flags.import_block) { - this._flags.import_block = false; - } - this.print_token(current_token); - }; - - Beautifier$5.prototype.handle_string = function(current_token) { - if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN$2.WORD)) ; else if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - // One difference - strings want at least a space before - this._output.space_before_token = true; - } else { - this.handle_whitespace_and_comments(current_token); - if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD || this._flags.inline_frame) { - this._output.space_before_token = true; - } else if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN$2.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) { - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } - this.print_token(current_token); - }; - - Beautifier$5.prototype.handle_equals = function(current_token) { - if (this.start_of_statement(current_token)) ; else { - this.handle_whitespace_and_comments(current_token); - } - - if (this._flags.declaration_statement) { - // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done - this._flags.declaration_assignment = true; - } - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; - }; - - Beautifier$5.prototype.handle_comma = function(current_token) { - this.handle_whitespace_and_comments(current_token, true); - - this.print_token(current_token); - this._output.space_before_token = true; - if (this._flags.declaration_statement) { - if (is_expression(this._flags.parent.mode)) { - // do not break on comma, for(var a = 1, b = 2) - this._flags.declaration_assignment = false; - } - - if (this._flags.declaration_assignment) { - this._flags.declaration_assignment = false; - this.print_newline(false, true); - } else if (this._options.comma_first) { - // for comma-first, we want to allow a newline before the comma - // to turn into a newline after the comma, which we will fixup later - this.allow_wrap_or_preserved_newline(current_token); - } - } else if (this._flags.mode === MODE.ObjectLiteral || - (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) { - if (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - if (!this._flags.inline_frame) { - this.print_newline(); - } - } else if (this._options.comma_first) { - // EXPR or DO_BLOCK - // for comma-first, we want to allow a newline before the comma - // to turn into a newline after the comma, which we will fixup later - this.allow_wrap_or_preserved_newline(current_token); - } - }; - - Beautifier$5.prototype.handle_operator = function(current_token) { - var isGeneratorAsterisk = current_token.text === '*' && - (reserved_array(this._flags.last_token, ['function', 'yield']) || - (in_array$1(this._flags.last_token.type, [TOKEN$2.START_BLOCK, TOKEN$2.COMMA, TOKEN$2.END_BLOCK, TOKEN$2.SEMICOLON])) - ); - var isUnary = in_array$1(current_token.text, ['-', '+']) && ( - in_array$1(this._flags.last_token.type, [TOKEN$2.START_BLOCK, TOKEN$2.START_EXPR, TOKEN$2.EQUALS, TOKEN$2.OPERATOR]) || - in_array$1(this._flags.last_token.text, line_starters) || - this._flags.last_token.text === ',' - ); - - if (this.start_of_statement(current_token)) ; else { - var preserve_statement_flags = !isGeneratorAsterisk; - this.handle_whitespace_and_comments(current_token, preserve_statement_flags); - } - - if (reserved_array(this._flags.last_token, special_words)) { - // "return" had a special handling in TK_WORD. Now we need to return the favor - this._output.space_before_token = true; - this.print_token(current_token); - return; - } - - // hack for actionscript's import .*; - if (current_token.text === '*' && this._flags.last_token.type === TOKEN$2.DOT) { - this.print_token(current_token); - return; - } - - if (current_token.text === '::') { - // no spaces around exotic namespacing syntax operator - this.print_token(current_token); - return; - } - - // Allow line wrapping between operators when operator_position is - // set to before or preserve - if (this._flags.last_token.type === TOKEN$2.OPERATOR && in_array$1(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { - this.allow_wrap_or_preserved_newline(current_token); - } - - if (current_token.text === ':' && this._flags.in_case) { - this.print_token(current_token); - - this._flags.in_case = false; - this._flags.case_body = true; - if (this._tokens.peek().type !== TOKEN$2.START_BLOCK) { - this.indent(); - this.print_newline(); - this._flags.case_block = false; - } else { - this._flags.case_block = true; - this._output.space_before_token = true; - } - return; - } - - var space_before = true; - var space_after = true; - var in_ternary = false; - if (current_token.text === ':') { - if (this._flags.ternary_depth === 0) { - // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant. - space_before = false; - } else { - this._flags.ternary_depth -= 1; - in_ternary = true; - } - } else if (current_token.text === '?') { - this._flags.ternary_depth += 1; - } - - // let's handle the operator_position option prior to any conflicting logic - if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array$1(current_token.text, positionable_operators)) { - var isColon = current_token.text === ':'; - var isTernaryColon = (isColon && in_ternary); - var isOtherColon = (isColon && !in_ternary); - - switch (this._options.operator_position) { - case OPERATOR_POSITION.before_newline: - // if the current token is : and it's not a ternary statement then we set space_before to false - this._output.space_before_token = !isOtherColon; - - this.print_token(current_token); - - if (!isColon || isTernaryColon) { - this.allow_wrap_or_preserved_newline(current_token); - } - - this._output.space_before_token = true; - return; - - case OPERATOR_POSITION.after_newline: - // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement, - // then print a newline. - - this._output.space_before_token = true; - - if (!isColon || isTernaryColon) { - if (this._tokens.peek().newlines) { - this.print_newline(false, true); - } else { - this.allow_wrap_or_preserved_newline(current_token); - } - } else { - this._output.space_before_token = false; - } - - this.print_token(current_token); - - this._output.space_before_token = true; - return; - - case OPERATOR_POSITION.preserve_newline: - if (!isOtherColon) { - this.allow_wrap_or_preserved_newline(current_token); - } - - // if we just added a newline, or the current token is : and it's not a ternary statement, - // then we set space_before to false - space_before = !(this._output.just_added_newline() || isOtherColon); - - this._output.space_before_token = space_before; - this.print_token(current_token); - this._output.space_before_token = true; - return; - } - } - - if (isGeneratorAsterisk) { - this.allow_wrap_or_preserved_newline(current_token); - space_before = false; - var next_token = this._tokens.peek(); - space_after = next_token && in_array$1(next_token.type, [TOKEN$2.WORD, TOKEN$2.RESERVED]); - } else if (current_token.text === '...') { - this.allow_wrap_or_preserved_newline(current_token); - space_before = this._flags.last_token.type === TOKEN$2.START_BLOCK; - space_after = false; - } else if (in_array$1(current_token.text, ['--', '++', '!', '~']) || isUnary) { - // unary operators (and binary +/- pretending to be unary) special cases - if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR) { - this.allow_wrap_or_preserved_newline(current_token); - } - - space_before = false; - space_after = false; - - // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1 - // if there is a newline between -- or ++ and anything else we should preserve it. - if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) { - this.print_newline(false, true); - } - - if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) { - // for (;; ++i) - // ^^^ - space_before = true; - } - - if (this._flags.last_token.type === TOKEN$2.RESERVED) { - space_before = true; - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR) { - space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++')); - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR) { - // a++ + ++b; - // a - -b - space_before = in_array$1(current_token.text, ['--', '-', '++', '+']) && in_array$1(this._flags.last_token.text, ['--', '-', '++', '+']); - // + and - are not unary when preceeded by -- or ++ operator - // a-- + b - // a * +b - // a - -b - if (in_array$1(current_token.text, ['+', '-']) && in_array$1(this._flags.last_token.text, ['--', '++'])) { - space_after = true; - } - } - - - if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) && - (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) { - // { foo; --i } - // foo(); --bar; - this.print_newline(); - } - } - - this._output.space_before_token = this._output.space_before_token || space_before; - this.print_token(current_token); - this._output.space_before_token = space_after; - }; - - Beautifier$5.prototype.handle_block_comment = function(current_token, preserve_statement_flags) { - if (this._output.raw) { - this._output.add_raw_token(current_token); - if (current_token.directives && current_token.directives.preserve === 'end') { - // If we're testing the raw output behavior, do not allow a directive to turn it off. - this._output.raw = this._options.test_output_raw; - } - return; - } - - if (current_token.directives) { - this.print_newline(false, preserve_statement_flags); - this.print_token(current_token); - if (current_token.directives.preserve === 'start') { - this._output.raw = true; - } - this.print_newline(false, true); - return; - } - - // inline block - if (!acorn.newline.test(current_token.text) && !current_token.newlines) { - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; - return; - } else { - this.print_block_commment(current_token, preserve_statement_flags); - } - }; - - Beautifier$5.prototype.print_block_commment = function(current_token, preserve_statement_flags) { - var lines = split_linebreaks(current_token.text); - var j; // iterator for this case - var javadoc = false; - var starless = false; - var lastIndent = current_token.whitespace_before; - var lastIndentLength = lastIndent.length; - - // block comment starts with a new line - this.print_newline(false, preserve_statement_flags); - - // first line always indented - this.print_token_line_indentation(current_token); - this._output.add_token(lines[0]); - this.print_newline(false, preserve_statement_flags); - - - if (lines.length > 1) { - lines = lines.slice(1); - javadoc = all_lines_start_with(lines, '*'); - starless = each_line_matches_indent(lines, lastIndent); - - if (javadoc) { - this._flags.alignment = 1; - } - - for (j = 0; j < lines.length; j++) { - if (javadoc) { - // javadoc: reformat and re-indent - this.print_token_line_indentation(current_token); - this._output.add_token(ltrim(lines[j])); - } else if (starless && lines[j]) { - // starless: re-indent non-empty content, avoiding trim - this.print_token_line_indentation(current_token); - this._output.add_token(lines[j].substring(lastIndentLength)); - } else { - // normal comments output raw - this._output.current_line.set_indent(-1); - this._output.add_token(lines[j]); - } - - // for comments on their own line or more than one line, make sure there's a new line after - this.print_newline(false, preserve_statement_flags); - } - - this._flags.alignment = 0; - } - }; - - - Beautifier$5.prototype.handle_comment = function(current_token, preserve_statement_flags) { - if (current_token.newlines) { - this.print_newline(false, preserve_statement_flags); - } else { - this._output.trim(true); - } - - this._output.space_before_token = true; - this.print_token(current_token); - this.print_newline(false, preserve_statement_flags); - }; - - Beautifier$5.prototype.handle_dot = function(current_token) { - if (this.start_of_statement(current_token)) ; else { - this.handle_whitespace_and_comments(current_token, true); - } - - if (reserved_array(this._flags.last_token, special_words)) { - this._output.space_before_token = false; - } else { - // allow preserved newlines before dots in general - // force newlines on dots after close paren when break_chained - for bar().baz() - this.allow_wrap_or_preserved_newline(current_token, - this._flags.last_token.text === ')' && this._options.break_chained_methods); - } - - // Only unindent chained method dot if this dot starts a new line. - // Otherwise the automatic extra indentation removal will handle the over indent - if (this._options.unindent_chained_methods && this._output.just_added_newline()) { - this.deindent(); - } - - this.print_token(current_token); - }; - - Beautifier$5.prototype.handle_unknown = function(current_token, preserve_statement_flags) { - this.print_token(current_token); - - if (current_token.text[current_token.text.length - 1] === '\n') { - this.print_newline(false, preserve_statement_flags); - } - }; - - Beautifier$5.prototype.handle_eof = function(current_token) { - // Unwind any open statements - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - this.handle_whitespace_and_comments(current_token); - }; - - beautifier$2.Beautifier = Beautifier$5; - - /*jshint node:true */ - - var Beautifier$4 = beautifier$2.Beautifier, - Options$6 = options$4.Options; - - function js_beautify$1(js_source_text, options) { - var beautifier = new Beautifier$4(js_source_text, options); - return beautifier.beautify(); - } - - javascript.exports = js_beautify$1; - javascript.exports.defaultOptions = function() { - return new Options$6(); - }; - - var css = {exports: {}}; - - var beautifier$1 = {}; - - var options$2 = {}; - - /*jshint node:true */ - - var BaseOptions$1 = options$3.Options; - - function Options$5(options) { - BaseOptions$1.call(this, options, 'css'); - - this.selector_separator_newline = this._get_boolean('selector_separator_newline', true); - this.newline_between_rules = this._get_boolean('newline_between_rules', true); - var space_around_selector_separator = this._get_boolean('space_around_selector_separator'); - this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator; - - var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); - this.brace_style = 'collapse'; - for (var bs = 0; bs < brace_style_split.length; bs++) { - if (brace_style_split[bs] !== 'expand') { - // default to collapse, as only collapse|expand is implemented for now - this.brace_style = 'collapse'; - } else { - this.brace_style = brace_style_split[bs]; - } - } - } - Options$5.prototype = new BaseOptions$1(); - - - - options$2.Options = Options$5; - - /*jshint node:true */ - - var Options$4 = options$2.Options; - var Output$a = output$1.Output; - var InputScanner = inputscanner.InputScanner; - var Directives$1 = directives.Directives; - - var directives_core$1 = new Directives$1(/\/\*/, /\*\//); - - var lineBreak$1 = /\r\n|[\r\n]/; - var allLineBreaks$1 = /\r\n|[\r\n]/g; - - // tokenizer - var whitespaceChar = /\s/; - var whitespacePattern = /(?:\s|\n)+/g; - var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g; - var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g; - - function Beautifier$3(source_text, options) { - this._source_text = source_text || ''; - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - this._options = new Options$4(options); - this._ch = null; - this._input = null; - - // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule - this.NESTED_AT_RULE = { - "@page": true, - "@font-face": true, - "@keyframes": true, - // also in CONDITIONAL_GROUP_RULE below - "@media": true, - "@supports": true, - "@document": true - }; - this.CONDITIONAL_GROUP_RULE = { - "@media": true, - "@supports": true, - "@document": true - }; - this.NON_SEMICOLON_NEWLINE_PROPERTY = [ - "grid-template" - ]; - - } - - Beautifier$3.prototype.eatString = function(endChars) { - var result = ''; - this._ch = this._input.next(); - while (this._ch) { - result += this._ch; - if (this._ch === "\\") { - result += this._input.next(); - } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") { - break; - } - this._ch = this._input.next(); - } - return result; - }; - - // Skips any white space in the source text from the current position. - // When allowAtLeastOneNewLine is true, will output new lines for each - // newline character found; if the user has preserve_newlines off, only - // the first newline will be output - Beautifier$3.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { - var result = whitespaceChar.test(this._input.peek()); - var newline_count = 0; - while (whitespaceChar.test(this._input.peek())) { - this._ch = this._input.next(); - if (allowAtLeastOneNewLine && this._ch === '\n') { - if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { - newline_count++; - this._output.add_new_line(true); - } - } - } - return result; - }; - - // Nested pseudo-class if we are insideRule - // and the next special character found opens - // a new block - Beautifier$3.prototype.foundNestedPseudoClass = function() { - var openParen = 0; - var i = 1; - var ch = this._input.peek(i); - while (ch) { - if (ch === "{") { - return true; - } else if (ch === '(') { - // pseudoclasses can contain () - openParen += 1; - } else if (ch === ')') { - if (openParen === 0) { - return false; - } - openParen -= 1; - } else if (ch === ";" || ch === "}") { - return false; - } - i++; - ch = this._input.peek(i); - } - return false; - }; - - Beautifier$3.prototype.print_string = function(output_string) { - this._output.set_indent(this._indentLevel); - this._output.non_breaking_space = true; - this._output.add_token(output_string); - }; - - Beautifier$3.prototype.preserveSingleSpace = function(isAfterSpace) { - if (isAfterSpace) { - this._output.space_before_token = true; - } - }; - - Beautifier$3.prototype.indent = function() { - this._indentLevel++; - }; - - Beautifier$3.prototype.outdent = function() { - if (this._indentLevel > 0) { - this._indentLevel--; - } - }; - - /*_____________________--------------------_____________________*/ - - Beautifier$3.prototype.beautify = function() { - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak$1.test(source_text || '')) { - eol = source_text.match(lineBreak$1)[0]; - } - } - - - // HACK: newline parsing inconsistent. This brute force normalizes the this._input. - source_text = source_text.replace(allLineBreaks$1, '\n'); - - // reset - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - this._output = new Output$a(this._options, baseIndentString); - this._input = new InputScanner(source_text); - this._indentLevel = 0; - this._nestedLevel = 0; - - this._ch = null; - var parenLevel = 0; - - var insideRule = false; - // This is the value side of a property value pair (blue in the following ex) - // label { content: blue } - var insidePropertyValue = false; - var enteringConditionalGroup = false; - var insideAtExtend = false; - var insideAtImport = false; - var insideScssMap = false; - var topCharacter = this._ch; - var insideNonSemiColonValues = false; - var whitespace; - var isAfterSpace; - var previous_ch; - - while (true) { - whitespace = this._input.read(whitespacePattern); - isAfterSpace = whitespace !== ''; - previous_ch = topCharacter; - this._ch = this._input.next(); - if (this._ch === '\\' && this._input.hasNext()) { - this._ch += this._input.next(); - } - topCharacter = this._ch; - - if (!this._ch) { - break; - } else if (this._ch === '/' && this._input.peek() === '*') { - // /* css comment */ - // Always start block comments on a new line. - // This handles scenarios where a block comment immediately - // follows a property definition on the same line or where - // minified code is being beautified. - this._output.add_new_line(); - this._input.back(); - - var comment = this._input.read(block_comment_pattern); - - // Handle ignore directive - var directives = directives_core$1.get_directives(comment); - if (directives && directives.ignore === 'start') { - comment += directives_core$1.readIgnored(this._input); - } - - this.print_string(comment); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - - // Block comments are followed by a new line so they don't - // share a line with other properties - this._output.add_new_line(); - } else if (this._ch === '/' && this._input.peek() === '/') { - // // single line comment - // Preserves the space before a comment - // on the same line as a rule - this._output.space_before_token = true; - this._input.back(); - this.print_string(this._input.read(comment_pattern)); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - } else if (this._ch === '@' || this._ch === '$') { - this.preserveSingleSpace(isAfterSpace); - - // deal with less propery mixins @{...} - if (this._input.peek() === '{') { - this.print_string(this._ch + this.eatString('}')); - } else { - this.print_string(this._ch); - - // strip trailing space, if present, for hash property checks - var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); - - if (variableOrRule.match(/[ :]$/)) { - // we have a variable or pseudo-class, add it and insert one space before continuing - variableOrRule = this.eatString(": ").replace(/\s$/, ''); - this.print_string(variableOrRule); - this._output.space_before_token = true; - } - - variableOrRule = variableOrRule.replace(/\s$/, ''); - - if (variableOrRule === 'extend') { - insideAtExtend = true; - } else if (variableOrRule === 'import') { - insideAtImport = true; - } - - // might be a nesting at-rule - if (variableOrRule in this.NESTED_AT_RULE) { - this._nestedLevel += 1; - if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { - enteringConditionalGroup = true; - } - // might be less variable - } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { - insidePropertyValue = true; - this.indent(); - } - } - } else if (this._ch === '#' && this._input.peek() === '{') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString('}')); - } else if (this._ch === '{') { - if (insidePropertyValue) { - insidePropertyValue = false; - this.outdent(); - } - - // when entering conditional groups, only rulesets are allowed - if (enteringConditionalGroup) { - enteringConditionalGroup = false; - insideRule = (this._indentLevel >= this._nestedLevel); - } else { - // otherwise, declarations are also allowed - insideRule = (this._indentLevel >= this._nestedLevel - 1); - } - if (this._options.newline_between_rules && insideRule) { - if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') { - this._output.ensure_empty_line_above('/', ','); - } - } - - this._output.space_before_token = true; - - // The difference in print_string and indent order is necessary to indent the '{' correctly - if (this._options.brace_style === 'expand') { - this._output.add_new_line(); - this.print_string(this._ch); - this.indent(); - this._output.set_indent(this._indentLevel); - } else { - // inside mixin and first param is object - if (previous_ch === '(') { - this._output.space_before_token = false; - } else if (previous_ch !== ',') { - this.indent(); - } - this.print_string(this._ch); - } - - this.eatWhitespace(true); - this._output.add_new_line(); - } else if (this._ch === '}') { - this.outdent(); - this._output.add_new_line(); - if (previous_ch === '{') { - this._output.trim(true); - } - insideAtImport = false; - insideAtExtend = false; - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - this.print_string(this._ch); - insideRule = false; - if (this._nestedLevel) { - this._nestedLevel--; - } - - this.eatWhitespace(true); - this._output.add_new_line(); - - if (this._options.newline_between_rules && !this._output.just_added_blankline()) { - if (this._input.peek() !== '}') { - this._output.add_new_line(true); - } - } - if (this._input.peek() === ')') { - this._output.trim(true); - if (this._options.brace_style === "expand") { - this._output.add_new_line(true); - } - } - } else if (this._ch === ":") { - - for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) { - if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) { - insideNonSemiColonValues = true; - break; - } - } - - if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel === 0) { - // 'property: value' delimiter - // which could be in a conditional group query - this.print_string(':'); - if (!insidePropertyValue) { - insidePropertyValue = true; - this._output.space_before_token = true; - this.eatWhitespace(true); - this.indent(); - } - } else { - // sass/less parent reference don't use a space - // sass nested pseudo-class don't use a space - - // preserve space before pseudoclasses/pseudoelements, as it means "in any child" - if (this._input.lookBack(" ")) { - this._output.space_before_token = true; - } - if (this._input.peek() === ":") { - // pseudo-element - this._ch = this._input.next(); - this.print_string("::"); - } else { - // pseudo-class - this.print_string(':'); - } - } - } else if (this._ch === '"' || this._ch === '\'') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString(this._ch)); - this.eatWhitespace(true); - } else if (this._ch === ';') { - insideNonSemiColonValues = false; - if (parenLevel === 0) { - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - insideAtExtend = false; - insideAtImport = false; - this.print_string(this._ch); - this.eatWhitespace(true); - - // This maintains single line comments on the same - // line. Block comments are also affected, but - // a new line is always output before one inside - // that section - if (this._input.peek() !== '/') { - this._output.add_new_line(); - } - } else { - this.print_string(this._ch); - this.eatWhitespace(true); - this._output.space_before_token = true; - } - } else if (this._ch === '(') { // may be a url - if (this._input.lookBack("url")) { - this.print_string(this._ch); - this.eatWhitespace(); - parenLevel++; - this.indent(); - this._ch = this._input.next(); - if (this._ch === ')' || this._ch === '"' || this._ch === '\'') { - this._input.back(); - } else if (this._ch) { - this.print_string(this._ch + this.eatString(')')); - if (parenLevel) { - parenLevel--; - this.outdent(); - } - } - } else { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - - // handle scss/sass map - if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) { - this._output.add_new_line(); - insideScssMap = true; - } else { - this.eatWhitespace(); - parenLevel++; - this.indent(); - } - } - } else if (this._ch === ')') { - if (parenLevel) { - parenLevel--; - this.outdent(); - } - if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) { - insideScssMap = false; - this.outdent(); - this._output.add_new_line(); - } - this.print_string(this._ch); - } else if (this._ch === ',') { - this.print_string(this._ch); - this.eatWhitespace(true); - if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideAtImport && !insideAtExtend) { - this._output.add_new_line(); - } else { - this._output.space_before_token = true; - } - } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) { - //handle combinator spacing - if (this._options.space_around_combinator) { - this._output.space_before_token = true; - this.print_string(this._ch); - this._output.space_before_token = true; - } else { - this.print_string(this._ch); - this.eatWhitespace(); - // squash extra whitespace - if (this._ch && whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } - } else if (this._ch === ']') { - this.print_string(this._ch); - } else if (this._ch === '[') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - } else if (this._ch === '=') { // no whitespace before or after - this.eatWhitespace(); - this.print_string('='); - if (whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important - this.print_string(' '); - this.print_string(this._ch); - } else { - var preserveAfterSpace = previous_ch === '"' || previous_ch === '\''; - this.preserveSingleSpace(preserveAfterSpace || isAfterSpace); - this.print_string(this._ch); - - if (!this._output.just_added_newline() && this._input.peek() === '\n' && insideNonSemiColonValues) { - this._output.add_new_line(); - } - } - } - - var sweetCode = this._output.get_code(eol); - - return sweetCode; - }; - - beautifier$1.Beautifier = Beautifier$3; - - /*jshint node:true */ - - var Beautifier$2 = beautifier$1.Beautifier, - Options$3 = options$2.Options; - - function css_beautify$1(source_text, options) { - var beautifier = new Beautifier$2(source_text, options); - return beautifier.beautify(); - } - - css.exports = css_beautify$1; - css.exports.defaultOptions = function() { - return new Options$3(); - }; - - var html = {exports: {}}; - - var beautifier = {}; - - var options$1 = {}; - - /*jshint node:true */ - - var BaseOptions = options$3.Options; - - function Options$2(options) { - BaseOptions.call(this, options, 'html'); - if (this.templating.length === 1 && this.templating[0] === 'auto') { - this.templating = ['django', 'erb', 'handlebars', 'php']; - } - - this.indent_inner_html = this._get_boolean('indent_inner_html'); - this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true); - this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true); - - this.indent_handlebars = this._get_boolean('indent_handlebars', true); - this.wrap_attributes = this._get_selection('wrap_attributes', - ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple', 'preserve', 'preserve-aligned']); - this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size); - this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']); - - // Block vs inline elements - // https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements - // https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements - // https://www.w3.org/TR/html5/dom.html#phrasing-content - this.inline = this._get_array('inline', [ - 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite', - 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', - 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript', - 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small', - 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var', - 'video', 'wbr', 'text', - // obsolete inline tags - 'acronym', 'big', 'strike', 'tt' - ]); - this.void_elements = this._get_array('void_elements', [ - // HTLM void elements - aka self-closing tags - aka singletons - // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements - 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', - 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr', - // NOTE: Optional tags are too complex for a simple list - // they are hard coded in _do_optional_end_element - - // Doctype and xml elements - '!doctype', '?xml', - - // obsolete tags - // basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm - // isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex - 'basefont', 'isindex' - ]); - this.unformatted = this._get_array('unformatted', []); - this.content_unformatted = this._get_array('content_unformatted', [ - 'pre', 'textarea' - ]); - this.unformatted_content_delimiter = this._get_characters('unformatted_content_delimiter'); - this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']); - - } - Options$2.prototype = new BaseOptions(); - - - - options$1.Options = Options$2; - - var tokenizer = {}; - - /*jshint node:true */ - - var BaseTokenizer = tokenizer$1.Tokenizer; - var BASETOKEN = tokenizer$1.TOKEN; - var Directives = directives.Directives; - var TemplatablePattern = templatablepattern.TemplatablePattern; - var Pattern = pattern.Pattern; - - var TOKEN$1 = { - TAG_OPEN: 'TK_TAG_OPEN', - TAG_CLOSE: 'TK_TAG_CLOSE', - ATTRIBUTE: 'TK_ATTRIBUTE', - EQUALS: 'TK_EQUALS', - VALUE: 'TK_VALUE', - COMMENT: 'TK_COMMENT', - TEXT: 'TK_TEXT', - UNKNOWN: 'TK_UNKNOWN', - START: BASETOKEN.START, - RAW: BASETOKEN.RAW, - EOF: BASETOKEN.EOF - }; - - var directives_core = new Directives(/<\!--/, /-->/); - - var Tokenizer$1 = function(input_string, options) { - BaseTokenizer.call(this, input_string, options); - this._current_tag_name = ''; - - // Words end at whitespace or when a tag starts - // if we are indenting handlebars, they are considered tags - var templatable_reader = new TemplatablePattern(this._input).read_options(this._options); - var pattern_reader = new Pattern(this._input); - - this.__patterns = { - word: templatable_reader.until(/[\n\r\t <]/), - single_quote: templatable_reader.until_after(/'/), - double_quote: templatable_reader.until_after(/"/), - attribute: templatable_reader.until(/[\n\r\t =>]|\/>/), - element_name: templatable_reader.until(/[\n\r\t >\/]/), - - handlebars_comment: pattern_reader.starting_with(/{{!--/).until_after(/--}}/), - handlebars: pattern_reader.starting_with(/{{/).until_after(/}}/), - handlebars_open: pattern_reader.until(/[\n\r\t }]/), - handlebars_raw_close: pattern_reader.until(/}}/), - comment: pattern_reader.starting_with(//), - cdata: pattern_reader.starting_with(//), - // https://en.wikipedia.org/wiki/Conditional_comment - conditional_comment: pattern_reader.starting_with(//), - processing: pattern_reader.starting_with(/<\?/).until_after(/\?>/) - }; - - if (this._options.indent_handlebars) { - this.__patterns.word = this.__patterns.word.exclude('handlebars'); - } - - this._unformatted_content_delimiter = null; - - if (this._options.unformatted_content_delimiter) { - var literal_regexp = this._input.get_literal_regexp(this._options.unformatted_content_delimiter); - this.__patterns.unformatted_content_delimiter = - pattern_reader.matching(literal_regexp) - .until_after(literal_regexp); - } - }; - Tokenizer$1.prototype = new BaseTokenizer(); - - Tokenizer$1.prototype._is_comment = function(current_token) { // jshint unused:false - return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN; - }; - - Tokenizer$1.prototype._is_opening = function(current_token) { - return current_token.type === TOKEN$1.TAG_OPEN; - }; - - Tokenizer$1.prototype._is_closing = function(current_token, open_token) { - return current_token.type === TOKEN$1.TAG_CLOSE && - (open_token && ( - ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') || - (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{'))); - }; - - Tokenizer$1.prototype._reset = function() { - this._current_tag_name = ''; - }; - - Tokenizer$1.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - var token = null; - this._readWhitespace(); - var c = this._input.peek(); - - if (c === null) { - return this._create_token(TOKEN$1.EOF, ''); - } - - token = token || this._read_open_handlebars(c, open_token); - token = token || this._read_attribute(c, previous_token, open_token); - token = token || this._read_close(c, open_token); - token = token || this._read_raw_content(c, previous_token, open_token); - token = token || this._read_content_word(c); - token = token || this._read_comment_or_cdata(c); - token = token || this._read_processing(c); - token = token || this._read_open(c, open_token); - token = token || this._create_token(TOKEN$1.UNKNOWN, this._input.next()); - - return token; - }; - - Tokenizer$1.prototype._read_comment_or_cdata = function(c) { // jshint unused:false - var token = null; - var resulting_string = null; - var directives = null; - - if (c === '<') { - var peek1 = this._input.peek(1); - // We treat all comments as literals, even more than preformatted tags - // we only look for the appropriate closing marker - if (peek1 === '!') { - resulting_string = this.__patterns.comment.read(); - - // only process directive on html comments - if (resulting_string) { - directives = directives_core.get_directives(resulting_string); - if (directives && directives.ignore === 'start') { - resulting_string += directives_core.readIgnored(this._input); - } - } else { - resulting_string = this.__patterns.cdata.read(); - } - } - - if (resulting_string) { - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - token.directives = directives; - } - } - - return token; - }; - - Tokenizer$1.prototype._read_processing = function(c) { // jshint unused:false - var token = null; - var resulting_string = null; - var directives = null; - - if (c === '<') { - var peek1 = this._input.peek(1); - if (peek1 === '!' || peek1 === '?') { - resulting_string = this.__patterns.conditional_comment.read(); - resulting_string = resulting_string || this.__patterns.processing.read(); - } - - if (resulting_string) { - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - token.directives = directives; - } - } - - return token; - }; - - Tokenizer$1.prototype._read_open = function(c, open_token) { - var resulting_string = null; - var token = null; - if (!open_token) { - if (c === '<') { - - resulting_string = this._input.next(); - if (this._input.peek() === '/') { - resulting_string += this._input.next(); - } - resulting_string += this.__patterns.element_name.read(); - token = this._create_token(TOKEN$1.TAG_OPEN, resulting_string); - } - } - return token; - }; - - Tokenizer$1.prototype._read_open_handlebars = function(c, open_token) { - var resulting_string = null; - var token = null; - if (!open_token) { - if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') { - if (this._input.peek(2) === '!') { - resulting_string = this.__patterns.handlebars_comment.read(); - resulting_string = resulting_string || this.__patterns.handlebars.read(); - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - } else { - resulting_string = this.__patterns.handlebars_open.read(); - token = this._create_token(TOKEN$1.TAG_OPEN, resulting_string); - } - } - } - return token; - }; - - - Tokenizer$1.prototype._read_close = function(c, open_token) { - var resulting_string = null; - var token = null; - if (open_token) { - if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) { - resulting_string = this._input.next(); - if (c === '/') { // for close tag "/>" - resulting_string += this._input.next(); - } - token = this._create_token(TOKEN$1.TAG_CLOSE, resulting_string); - } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') { - this._input.next(); - this._input.next(); - token = this._create_token(TOKEN$1.TAG_CLOSE, '}}'); - } - } - - return token; - }; - - Tokenizer$1.prototype._read_attribute = function(c, previous_token, open_token) { - var token = null; - var resulting_string = ''; - if (open_token && open_token.text[0] === '<') { - - if (c === '=') { - token = this._create_token(TOKEN$1.EQUALS, this._input.next()); - } else if (c === '"' || c === "'") { - var content = this._input.next(); - if (c === '"') { - content += this.__patterns.double_quote.read(); - } else { - content += this.__patterns.single_quote.read(); - } - token = this._create_token(TOKEN$1.VALUE, content); - } else { - resulting_string = this.__patterns.attribute.read(); - - if (resulting_string) { - if (previous_token.type === TOKEN$1.EQUALS) { - token = this._create_token(TOKEN$1.VALUE, resulting_string); - } else { - token = this._create_token(TOKEN$1.ATTRIBUTE, resulting_string); - } - } - } - } - return token; - }; - - Tokenizer$1.prototype._is_content_unformatted = function(tag_name) { - // void_elements have no content and so cannot have unformatted content - // script and style tags should always be read as unformatted content - // finally content_unformatted and unformatted element contents are unformatted - return this._options.void_elements.indexOf(tag_name) === -1 && - (this._options.content_unformatted.indexOf(tag_name) !== -1 || - this._options.unformatted.indexOf(tag_name) !== -1); - }; - - - Tokenizer$1.prototype._read_raw_content = function(c, previous_token, open_token) { // jshint unused:false - var resulting_string = ''; - if (open_token && open_token.text[0] === '{') { - resulting_string = this.__patterns.handlebars_raw_close.read(); - } else if (previous_token.type === TOKEN$1.TAG_CLOSE && - previous_token.opened.text[0] === '<' && previous_token.text[0] !== '/') { - // ^^ empty tag has no content - var tag_name = previous_token.opened.text.substr(1).toLowerCase(); - if (tag_name === 'script' || tag_name === 'style') { - // Script and style tags are allowed to have comments wrapping their content - // or just have regular content. - var token = this._read_comment_or_cdata(c); - if (token) { - token.type = TOKEN$1.TEXT; - return token; - } - resulting_string = this._input.readUntil(new RegExp('', 'ig')); - } else if (this._is_content_unformatted(tag_name)) { - - resulting_string = this._input.readUntil(new RegExp('', 'ig')); - } - } - - if (resulting_string) { - return this._create_token(TOKEN$1.TEXT, resulting_string); - } - - return null; - }; - - Tokenizer$1.prototype._read_content_word = function(c) { - var resulting_string = ''; - if (this._options.unformatted_content_delimiter) { - if (c === this._options.unformatted_content_delimiter[0]) { - resulting_string = this.__patterns.unformatted_content_delimiter.read(); - } - } - - if (!resulting_string) { - resulting_string = this.__patterns.word.read(); - } - if (resulting_string) { - return this._create_token(TOKEN$1.TEXT, resulting_string); - } - }; - - tokenizer.Tokenizer = Tokenizer$1; - tokenizer.TOKEN = TOKEN$1; - - /*jshint node:true */ - - var Options$1 = options$1.Options; - var Output$9 = output$1.Output; - var Tokenizer = tokenizer.Tokenizer; - var TOKEN = tokenizer.TOKEN; - - var lineBreak = /\r\n|[\r\n]/; - var allLineBreaks = /\r\n|[\r\n]/g; - - var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions - - this.indent_level = 0; - this.alignment_size = 0; - this.max_preserve_newlines = options.max_preserve_newlines; - this.preserve_newlines = options.preserve_newlines; - - this._output = new Output$9(options, base_indent_string); - - }; - - Printer.prototype.current_line_has_match = function(pattern) { - return this._output.current_line.has_match(pattern); - }; - - Printer.prototype.set_space_before_token = function(value, non_breaking) { - this._output.space_before_token = value; - this._output.non_breaking_space = non_breaking; - }; - - Printer.prototype.set_wrap_point = function() { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.set_wrap_point(); - }; - - - Printer.prototype.add_raw_token = function(token) { - this._output.add_raw_token(token); - }; - - Printer.prototype.print_preserved_newlines = function(raw_token) { - var newlines = 0; - if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) { - newlines = raw_token.newlines ? 1 : 0; - } - - if (this.preserve_newlines) { - newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1; - } - for (var n = 0; n < newlines; n++) { - this.print_newline(n > 0); - } - - return newlines !== 0; - }; - - Printer.prototype.traverse_whitespace = function(raw_token) { - if (raw_token.whitespace_before || raw_token.newlines) { - if (!this.print_preserved_newlines(raw_token)) { - this._output.space_before_token = true; - } - return true; - } - return false; - }; - - Printer.prototype.previous_token_wrapped = function() { - return this._output.previous_token_wrapped; - }; - - Printer.prototype.print_newline = function(force) { - this._output.add_new_line(force); - }; - - Printer.prototype.print_token = function(token) { - if (token.text) { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.add_token(token.text); - } - }; - - Printer.prototype.indent = function() { - this.indent_level++; - }; - - Printer.prototype.get_full_indent = function(level) { - level = this.indent_level + (level || 0); - if (level < 1) { - return ''; - } - - return this._output.get_indent_string(level); - }; - - var get_type_attribute = function(start_token) { - var result = null; - var raw_token = start_token.next; - - // Search attributes for a type attribute - while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) { - if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') { - if (raw_token.next && raw_token.next.type === TOKEN.EQUALS && - raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) { - result = raw_token.next.next.text; - } - break; - } - raw_token = raw_token.next; - } - - return result; - }; - - var get_custom_beautifier_name = function(tag_check, raw_token) { - var typeAttribute = null; - var result = null; - - if (!raw_token.closed) { - return null; - } - - if (tag_check === 'script') { - typeAttribute = 'text/javascript'; - } else if (tag_check === 'style') { - typeAttribute = 'text/css'; - } - - typeAttribute = get_type_attribute(raw_token) || typeAttribute; - - // For script and style tags that have a type attribute, only enable custom beautifiers for matching values - // For those without a type attribute use default; - if (typeAttribute.search('text/css') > -1) { - result = 'css'; - } else if (typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/) > -1) { - result = 'javascript'; - } else if (typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/) > -1) { - result = 'html'; - } else if (typeAttribute.search(/test\/null/) > -1) { - // Test only mime-type for testing the beautifier when null is passed as beautifing function - result = 'null'; - } - - return result; - }; - - function in_array(what, arr) { - return arr.indexOf(what) !== -1; - } - - function TagFrame(parent, parser_token, indent_level) { - this.parent = parent || null; - this.tag = parser_token ? parser_token.tag_name : ''; - this.indent_level = indent_level || 0; - this.parser_token = parser_token || null; - } - - function TagStack(printer) { - this._printer = printer; - this._current_frame = null; - } - - TagStack.prototype.get_parser_token = function() { - return this._current_frame ? this._current_frame.parser_token : null; - }; - - TagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object - var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level); - this._current_frame = new_frame; - }; - - TagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer - var parser_token = null; - - if (frame) { - parser_token = frame.parser_token; - this._printer.indent_level = frame.indent_level; - this._current_frame = frame.parent; - } - - return parser_token; - }; - - TagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._current_frame; - - while (frame) { //till we reach '' (the initial value); - if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it - break; - } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) { - frame = null; - break; - } - frame = frame.parent; - } - - return frame; - }; - - TagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._get_frame([tag], stop_list); - return this._try_pop_frame(frame); - }; - - TagStack.prototype.indent_to_tag = function(tag_list) { - var frame = this._get_frame(tag_list); - if (frame) { - this._printer.indent_level = frame.indent_level; - } - }; - - function Beautifier$1(source_text, options, js_beautify, css_beautify) { - //Wrapper function to invoke all the necessary constructors and deal with the output. - this._source_text = source_text || ''; - options = options || {}; - this._js_beautify = js_beautify; - this._css_beautify = css_beautify; - this._tag_stack = null; - - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - var optionHtml = new Options$1(options, 'html'); - - this._options = optionHtml; - - this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force'; - this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline'); - this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned'); - this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple'); - this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, 'preserve'.length) === 'preserve'; - this._is_wrap_attributes_preserve_aligned = (this._options.wrap_attributes === 'preserve-aligned'); - } - - Beautifier$1.prototype.beautify = function() { - - // if disabled, return the input unchanged. - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (this._options.eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak.test(source_text)) { - eol = source_text.match(lineBreak)[0]; - } - } - - // HACK: newline parsing inconsistent. This brute force normalizes the input. - source_text = source_text.replace(allLineBreaks, '\n'); - - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - var last_token = { - text: '', - type: '' - }; - - var last_tag_token = new TagOpenParserToken(); - - var printer = new Printer(this._options, baseIndentString); - var tokens = new Tokenizer(source_text, this._options).tokenize(); - - this._tag_stack = new TagStack(printer); - - var parser_token = null; - var raw_token = tokens.next(); - while (raw_token.type !== TOKEN.EOF) { - - if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) { - parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token); - last_tag_token = parser_token; - } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) || - (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) { - parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens); - } else if (raw_token.type === TOKEN.TAG_CLOSE) { - parser_token = this._handle_tag_close(printer, raw_token, last_tag_token); - } else if (raw_token.type === TOKEN.TEXT) { - parser_token = this._handle_text(printer, raw_token, last_tag_token); - } else { - // This should never happen, but if it does. Print the raw token - printer.add_raw_token(raw_token); - } - - last_token = parser_token; - - raw_token = tokens.next(); - } - var sweet_code = printer._output.get_code(eol); - - return sweet_code; - }; - - Beautifier$1.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - printer.alignment_size = 0; - last_tag_token.tag_complete = true; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else { - if (last_tag_token.tag_start_char === '<') { - printer.set_space_before_token(raw_token.text[0] === '/', true); // space before />, no space before > - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) { - printer.print_newline(false); - } - } - printer.print_token(raw_token); - - } - - if (last_tag_token.indent_content && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.indent(); - - // only indent once per opened tag - last_tag_token.indent_content = false; - } - - if (!last_tag_token.is_inline_element && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.set_wrap_point(); - } - - return parser_token; - }; - - Beautifier$1.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) { - var wrapped = last_tag_token.has_wrapped_attrs; - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else if (last_tag_token.tag_start_char === '{' && raw_token.type === TOKEN.TEXT) { - // For the insides of handlebars allow newlines or a single space between open and contents - if (printer.print_preserved_newlines(raw_token)) { - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - } else { - printer.print_token(raw_token); - } - } else { - if (raw_token.type === TOKEN.ATTRIBUTE) { - printer.set_space_before_token(true); - last_tag_token.attr_count += 1; - } else if (raw_token.type === TOKEN.EQUALS) { //no space before = - printer.set_space_before_token(false); - } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value - printer.set_space_before_token(false); - } - - if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === '<') { - if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) { - printer.traverse_whitespace(raw_token); - wrapped = wrapped || raw_token.newlines !== 0; - } - - - if (this._is_wrap_attributes_force) { - var force_attr_wrap = last_tag_token.attr_count > 1; - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) { - var is_only_attribute = true; - var peek_index = 0; - var peek_token; - do { - peek_token = tokens.peek(peek_index); - if (peek_token.type === TOKEN.ATTRIBUTE) { - is_only_attribute = false; - break; - } - peek_index += 1; - } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE); - - force_attr_wrap = !is_only_attribute; - } - - if (force_attr_wrap) { - printer.print_newline(false); - wrapped = true; - } - } - } - printer.print_token(raw_token); - wrapped = wrapped || printer.previous_token_wrapped(); - last_tag_token.has_wrapped_attrs = wrapped; - } - return parser_token; - }; - - Beautifier$1.prototype._handle_text = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: 'TK_CONTENT' - }; - if (last_tag_token.custom_beautifier_name) { //check if we need to format javascript - this._print_custom_beatifier_text(printer, raw_token, last_tag_token); - } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) { - printer.add_raw_token(raw_token); - } else { - printer.traverse_whitespace(raw_token); - printer.print_token(raw_token); - } - return parser_token; - }; - - Beautifier$1.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) { - var local = this; - if (raw_token.text !== '') { - - var text = raw_token.text, - _beautifier, - script_indent_level = 1, - pre = '', - post = ''; - if (last_tag_token.custom_beautifier_name === 'javascript' && typeof this._js_beautify === 'function') { - _beautifier = this._js_beautify; - } else if (last_tag_token.custom_beautifier_name === 'css' && typeof this._css_beautify === 'function') { - _beautifier = this._css_beautify; - } else if (last_tag_token.custom_beautifier_name === 'html') { - _beautifier = function(html_source, options) { - var beautifier = new Beautifier$1(html_source, options, local._js_beautify, local._css_beautify); - return beautifier.beautify(); - }; - } - - if (this._options.indent_scripts === "keep") { - script_indent_level = 0; - } else if (this._options.indent_scripts === "separate") { - script_indent_level = -printer.indent_level; - } - - var indentation = printer.get_full_indent(script_indent_level); - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - // Handle the case where content is wrapped in a comment or cdata. - if (last_tag_token.custom_beautifier_name !== 'html' && - text[0] === '<' && text.match(/^(|]]>)$/.exec(text); - - // if we start to wrap but don't finish, print raw - if (!matched) { - printer.add_raw_token(raw_token); - return; - } - - pre = indentation + matched[1] + '\n'; - text = matched[4]; - if (matched[5]) { - post = indentation + matched[5]; - } - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - if (matched[2] || matched[3].indexOf('\n') !== -1) { - // if the first line of the non-comment text has spaces - // use that as the basis for indenting in null case. - matched = matched[3].match(/[ \t]+$/); - if (matched) { - raw_token.whitespace_before = matched[0]; - } - } - } - - if (text) { - if (_beautifier) { - - // call the Beautifier if avaliable - var Child_options = function() { - this.eol = '\n'; - }; - Child_options.prototype = this._options.raw_options; - var child_options = new Child_options(); - text = _beautifier(indentation + text, child_options); - } else { - // simply indent the string otherwise - var white = raw_token.whitespace_before; - if (white) { - text = text.replace(new RegExp('\n(' + white + ')?', 'g'), '\n'); - } - - text = indentation + text.replace(/\n/g, '\n' + indentation); - } - } - - if (pre) { - if (!text) { - text = pre + post; - } else { - text = pre + text + '\n' + post; - } - } - - printer.print_newline(false); - if (text) { - raw_token.text = text; - raw_token.whitespace_before = ''; - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - printer.print_newline(true); - } - } - }; - - Beautifier$1.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) { - var parser_token = this._get_tag_open_token(raw_token); - - if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) && - !last_tag_token.is_empty_element && - raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - } else { - tag_check_match = raw_token.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - - // handle "{{#> myPartial}} - if (raw_token.text === '{{#>' && this.tag_check === '>' && raw_token.next !== null) { - this.tag_check = raw_token.next.text.split(' ')[0]; - } - } - this.tag_check = this.tag_check.toLowerCase(); - - if (raw_token.type === TOKEN.COMMENT) { - this.tag_complete = true; - } - - this.is_start_tag = this.tag_check.charAt(0) !== '/'; - this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check; - this.is_end_tag = !this.is_start_tag || - (raw_token.closed && raw_token.closed.text === '/>'); - - // handlebars tags that don't start with # or ^ are single_tags, and so also start and end. - this.is_end_tag = this.is_end_tag || - (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\^]/.test(this.text.charAt(2))))); - } - }; - - Beautifier$1.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type - var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token); - - parser_token.alignment_size = this._options.wrap_attributes_indent_size; - - parser_token.is_end_tag = parser_token.is_end_tag || - in_array(parser_token.tag_check, this._options.void_elements); - - parser_token.is_empty_element = parser_token.tag_complete || - (parser_token.is_start_tag && parser_token.is_end_tag); - - parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted); - parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted); - parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{'; - - return parser_token; - }; - - Beautifier$1.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) { - - if (!parser_token.is_empty_element) { - if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors - } else { // it's a start-tag - // check if this tag is starting an element that has optional end element - // and do an ending needed - if (this._do_optional_end_element(parser_token)) { - if (!parser_token.is_inline_element) { - printer.print_newline(false); - } - } - - this._tag_stack.record_tag(parser_token); //push it on the tag stack - - if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') && - !(parser_token.is_unformatted || parser_token.is_content_unformatted)) { - parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token); - } - } - } - - if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line - printer.print_newline(false); - if (!printer._output.just_added_blankline()) { - printer.print_newline(true); - } - } - - if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /) - - // if you hit an else case, reset the indent level if you are inside an: - // 'if', 'unless', or 'each' block. - if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') { - this._tag_stack.indent_to_tag(['if', 'unless', 'each']); - parser_token.indent_content = true; - // Don't add a newline if opening {{#if}} tag is on the current line - var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/); - if (!foundIfOnCurrentLine) { - printer.print_newline(false); - } - } - - // Don't add a newline before elements that should remain where they are. - if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE && - last_tag_token.is_end_tag && parser_token.text.indexOf('\n') === -1) ; else { - if (!(parser_token.is_inline_element || parser_token.is_unformatted)) { - printer.print_newline(false); - } - this._calcluate_parent_multiline(printer, parser_token); - } - } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - var do_end_expand = false; - - // deciding whether a block is multiline should not be this hard - do_end_expand = parser_token.start_tag_token && parser_token.start_tag_token.multiline_content; - do_end_expand = do_end_expand || (!parser_token.is_inline_element && - !(last_tag_token.is_inline_element || last_tag_token.is_unformatted) && - !(last_token.type === TOKEN.TAG_CLOSE && parser_token.start_tag_token === last_tag_token) && - last_token.type !== 'TK_CONTENT' - ); - - if (parser_token.is_content_unformatted || parser_token.is_unformatted) { - do_end_expand = false; - } - - if (do_end_expand) { - printer.print_newline(false); - } - } else { // it's a start-tag - parser_token.indent_content = !parser_token.custom_beautifier_name; - - if (parser_token.tag_start_char === '<') { - if (parser_token.tag_name === 'html') { - parser_token.indent_content = this._options.indent_inner_html; - } else if (parser_token.tag_name === 'head') { - parser_token.indent_content = this._options.indent_head_inner_html; - } else if (parser_token.tag_name === 'body') { - parser_token.indent_content = this._options.indent_body_inner_html; - } - } - - if (!(parser_token.is_inline_element || parser_token.is_unformatted) && - (last_token.type !== 'TK_CONTENT' || parser_token.is_content_unformatted)) { - printer.print_newline(false); - } - - this._calcluate_parent_multiline(printer, parser_token); - } - }; - - Beautifier$1.prototype._calcluate_parent_multiline = function(printer, parser_token) { - if (parser_token.parent && printer._output.just_added_newline() && - !((parser_token.is_inline_element || parser_token.is_unformatted) && parser_token.parent.is_inline_element)) { - parser_token.parent.multiline_content = true; - } - }; - - //To be used for

tag special case: - var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul']; - var p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video']; - - Beautifier$1.prototype._do_optional_end_element = function(parser_token) { - var result = null; - // NOTE: cases of "if there is no more content in the parent element" - // are handled automatically by the beautifier. - // It assumes parent or ancestor close tag closes all children. - // https://www.w3.org/TR/html5/syntax.html#optional-tags - if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) { - return; - - } - - if (parser_token.tag_name === 'body') { - // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment. - result = result || this._tag_stack.try_pop('head'); - - //} else if (parser_token.tag_name === 'body') { - // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment. - - } else if (parser_token.tag_name === 'li') { - // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element. - result = result || this._tag_stack.try_pop('li', ['ol', 'ul']); - - } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') { - // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element. - // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element. - result = result || this._tag_stack.try_pop('dt', ['dl']); - result = result || this._tag_stack.try_pop('dd', ['dl']); - - - } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) { - // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method - // check for the parent element is an HTML element that is not an ,

Index of ${title}

\n`; - body += '
    \n'; - body += `
  • ../
  • \n`; - - const list = await fsReaddir(parent); - const dirs = []; - const files = []; - - for (const file of list) { - const path = Path$6.join(parent, file); - const stat = await fsStat(path); - - if (stat.isDirectory()) - dirs.push(file); - else - files.push(file); - } - - for (const file of dirs.sort()) { - const name = escapeHTML(file); - const href = `${prefix}${name}`; - body += `
  • ${name}/
  • \n`; - } - - for (const file of files.sort()) { - const name = escapeHTML(file); - const href = `${prefix}${name}`; - body += `
  • ${name}
  • \n`; - } - - body += '
\n'; - body += ' \n'; - body += '\n'; - - return body; - } - - /* - * Expose - */ - - var file_1 = fileServer; - - /*! - * jsonrpc.js - json-rpc middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - - const assert$u = assert_1$1; - - /** - * JSON rpc middleware. - * @param {Object} rpc - * @returns {Function} - */ - - function jsonRPC(rpc) { - assert$u(rpc && typeof rpc === 'object'); - assert$u(typeof rpc.call === 'function'); - - return async (req, res) => { - if (req.method !== 'POST') - return; - - if (req.pathname !== '/') - return; - - if (req.body instanceof Array) { - for (const request of req.body) { - if (typeof request.method !== 'string') - return; - } - } else { - if (typeof req.body.method !== 'string') - return; - } - - let json = await rpc.call(req.body, req.query); - - if (json == null) - json = null; - - json = JSON.stringify(json); - json += '\n'; - - res.setHeader('X-Long-Polling', '/?longpoll=1'); - - res.send(200, json, 'application/json'); - }; - } - - /* - * Expose - */ - - var jsonrpc = jsonRPC; - - /*! - * router.js - router middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - - const assert$t = assert_1$1; - - /** - * Router middleware. - * @returns {Function} - */ - - function router$2(routes) { - assert$t(routes && typeof routes === 'object'); - assert$t(typeof routes.handle === 'function'); - return async (req, res) => { - return routes.handle(req, res); - }; - } - - /* - * Expose - */ - - var router_1 = router$2; - - /*! - * middleware.js - middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - - middleware$2.basicAuth = basicauth; - middleware$2.bodyParser = bodyparser; - middleware$2.cookieParser = cookie; - middleware$2.cors = cors_1; - middleware$2.fileServer = file_1; - middleware$2.jsonRPC = jsonrpc; - middleware$2.router = router_1; - - /*! - * server.js - http server for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - - const assert$s = assert_1$1; - const fs$3 = require$$0__default$1["default"]; - const Path$5 = require$$1__default["default"]; - const EventEmitter$3 = require$$1__default$1["default"]; - const bsock = bsock$1; - const Request = request; - const Response = response; - const Router$6 = router$3; - const Hook = hook; - const RPC$6 = rpc$2; - const middleware$1 = middleware$2; - - /** - * HTTP Server - * @extends EventEmitter - */ - - class Server$3 extends EventEmitter$3 { - /** - * Create an http server. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super(); - - this.options = options || {}; - this.config = new ServerOptions(options); - this.config.load(); - - const http = this.config.getBackend(); - const opt = this.config.toHTTP(); - - this.http = http.createServer(opt); - this.io = bsock.server(); - this.rpc = new RPC$6(); - this.routes = new Router$6(); - this.mounts = []; - this.stack = []; - this.opened = false; - this.mounted = false; - this.parent = null; - this.bound = false; - this._reject = null; - } - - /** - * Bind to events. - * @private - */ - - _bind() { - if (this.bound) - return; - - this.bound = true; - - this.http.on('close', () => { - this.emit('close'); - }); - - this.http.on('connection', (socket) => { - socket.on('error', (err) => { - if (err.message === 'Parse Error') { - let msg = 'HttpParser execute failure'; - msg += ` (parsed=${err.bytesParsed || -1}`; - msg += ` code=${err.code})`; - err = new Error(msg); - } - - this.emit('error', err); - - try { - socket.destroy(); - } catch (e) { - this.emit('error', e); - } - }); - }); - - this.http.on('error', (err) => { - const reject = this._reject; - - if (reject) { - this._reject = null; - reject(err); - return; - } - - this.emit('error', err); - }); - - this.http.on('listening', () => { - this.emit('listening', this.address()); - }); - - this.http.on('request', async (hreq, hres) => { - let req = null; - let res = null; - - try { - hreq.on('error', e => this.emit('error', e)); - hreq.pause(); - req = new Request(hreq, hres, hreq.url); - res = new Response(hreq, hres); - } catch (e) { - this.emit('error', e); - try { - hres.destroy(); - } catch (e) { - this.emit('error', e); - } - return; - } - - try { - await this._handleRequest(req, res); - } catch (e) { - await this._handleError(e, req, res); - } - }); - - if (this.config.sockets) - this.io.attach(this.http); - - this.io.on('error', (err) => { - this.emit('error', err); - }); - - this.io.on('socket', (socket) => { - socket.on('error', (err) => { - this.emit('error', err); - }); - - this.handleSocket(socket); - this.emit('socket', socket); - }); - - this.rpc.on('error', (err) => { - this.emit('error', err); - }); - - this.rpc.on('call', (cmd, query) => { - this.handleCall(cmd, query); - this.emit('call', cmd, query); - }); - } - - /** - * Handle an error. - * @private - * @param {Error} err - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleError(err, req, res) { - const code = err.statusCode || 500; - - if (code === 500) - this.emit('error', err); - - if (res.sent) - return; - - if (!this.onError) { - res.send(code, `HTTP Error: ${code}.`); - return; - } - - try { - await this.onError(err, req, res); - } catch (e) { - this.emit('error', e); - res.send(500, 'Internal Server Error.'); - } - } - - /** - * Handle a request. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleRequest(req, res) { - if (await this._handleMounts(req, res)) - return undefined; - - this.emit('request', req, res); - - if (await this._handleStack(req, res)) - return undefined; - - const err = new Error('Not found.'); - err.statusCode = 404; - - return this._handleError(err, req, res); - } - - /** - * Handle mount stack. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleMounts(req, res) { - const url = req.url; - - for (const hook of this.mounts) { - const server = hook.handler; - - if (!hook.isPrefix(req.pathname)) - continue; - - const uri = url.substring(hook.path.length); - - req.navigate(uri); - - try { - await server._handleRequest(req, res); - } catch (e) { - try { - await server._handleError(e, req, res); - } finally { - req.navigate(url); - } - return true; - } - - req.navigate(url); - - return true; - } - - return false; - } - - /** - * Handle middleware stack. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleStack(req, res) { - const url = req.url; - - let err = null; - - for (const hook of this.stack) { - if (!hook.isPrefix(req.pathname)) - continue; - - if (hook.path !== '/') { - const uri = url.substring(hook.path.length); - req.navigate(uri); - } - - if (err) { - if (hook.arity !== 3) - continue; - - try { - await hook.handler(err, req, res); - if (res.sent) - return true; - } finally { - if (hook.path !== '/') - req.navigate(url); - } - - continue; - } - - if (hook.arity !== 2) - continue; - - try { - await hook.handler(req, res); - if (res.sent) - return true; - } catch (e) { - err = e; - } finally { - if (hook.path !== '/') - req.navigate(url); - } - } - - if (err) - throw err; - - return false; - } - - /** - * Handle socket (abstract). - * @param {Object} socket - */ - - handleSocket(socket) {} - - /** - * Handle call (abstract). - * @param {Object} cmd - * @param {Object} query - */ - - handleCall(cmd, query) {} - - /** - * Open the server. - * @returns {Promise} - */ - - async open() { - assert$s(!this.opened, 'Already opened.'); - - this.opened = true; - - this._bind(); - - if (this.mounted) - return this.parent.address(); - - const {port, host} = this.config; - - return new Promise((resolve, reject) => { - this._reject = reject; - - const cb = () => { - this._reject = null; - resolve(this.address()); - }; - - try { - this.http.listen(port, host, cb); - } catch (e) { - this._reject = null; - reject(e); - } - }); - } - - /** - * Close the server. - * @returns {Promise} - */ - - async close() { - assert$s(this.opened, 'Not open.'); - - this.opened = false; - - if (this.mounted) - return undefined; - - return new Promise((resolve, reject) => { - this._reject = reject; - - const cb = (err) => { - this._reject = null; - - if (err) { - reject(err); - return; - } - - resolve(); - }; - - try { - this.io.close(); - this.http.close(cb); - } catch (e) { - this._reject = null; - reject(e); - } - }); - } - - /** - * Setup error handler. - * @param {Function} handler - */ - - error(handler) { - assert$s(typeof handler === 'function'); - this.onError = handler; - } - - /** - * Mount a server. - * @param {String} path - * @param {Server} server - */ - - mount(path, server) { - assert$s(typeof path === 'string'); - assert$s(server && typeof server === 'object'); - assert$s(!server.opened); - assert$s(!server.mounted); - - if (server.config.sockets) - this.io.mount(server.io); - - this.rpc.mount(server.rpc); - - server.parent = this; - server.mounted = true; - - this.mounts.push(new Hook(path, server)); - } - - /** - * Attach a server. - * @param {String} path - * @param {Server} server - */ - - attach(path, server) { - this._bind(); - server.mount(path, this); - } - - /** - * Add a middleware to the stack. - * @param {String?} path - * @param {Function} handler - */ - - use(path, handler) { - if (!handler) { - handler = path; - path = '/'; - } - this.stack.push(new Hook(path, handler)); - } - - /** - * Add a hook to the stack. - * @param {String?} path - * @param {Function} handler - */ - - hook(path, handler) { - this.routes.hook(path, handler); - } - - /** - * Add a GET route. - * @param {String} path - * @param {Function} handler - */ - - get(path, handler) { - this.routes.get(path, handler); - } - - /** - * Add a POST route. - * @param {String} path - * @param {Function} handler - */ - - post(path, handler) { - this.routes.post(path, handler); - } - - /** - * Add a PUT route. - * @param {String} path - * @param {Function} handler - */ - - put(path, handler) { - this.routes.put(path, handler); - } - - /** - * Add a DELETE route. - * @param {String} path - * @param {Function} handler - */ - - del(path, handler) { - this.routes.del(path, handler); - } - - /** - * Add a PATCH route. - * @param {String} path - * @param {Function} handler - */ - - patch(path, handler) { - this.routes.patch(path, handler); - } - - /** - * Get a channel. - * @param {String} name - * @returns {Set|null} - */ - - channel(name) { - return this.io.channel(name); - } - - /** - * Join a channel. - * @param {Object} socket - * @param {String} name - */ - - join(socket, name) { - return this.io.join(socket, name); - } - - /** - * Leave a channel. - * @param {Object} socket - * @param {String} name - */ - - leave(socket, name) { - return this.io.leave(socket, name); - } - - /** - * Emit event to channel. - */ - - to(...args) { - return this.io.to(...args); - } - - /** - * Emit event to all sockets. - */ - - all(...args) { - return this.io.all(...args); - } - - /** - * Execute an RPC call. - * @private - * @param {Object} json - * @param {Boolean} help - * @returns {Promise} - */ - - execute(json, help) { - return this.rpc.execute(json, help); - } - - /** - * Add an RPC call. - * @param {String} name - * @param {Function} func - * @param {Object?} ctx - */ - - add(name, func, ctx) { - return this.rpc.add(name, func, ctx); - } - - /** - * Get server address. - * @returns {Object} - */ - - address() { - return this.http.address(); - } - - /** - * Router middleware. - * @returns {Function} - */ - - router(routes) { - if (!routes) - routes = this.routes; - - return middleware$1.router(routes); - } - - /** - * CORS middleware. - * @returns {Function} - */ - - cors() { - return middleware$1.cors(); - } - - /** - * Basic auth middleware. - * @param {Object} options - * @returns {Function} - */ - - basicAuth(options) { - return middleware$1.basicAuth(options); - } - - /** - * Body parser middleware. - * @param {Object} options - * @returns {Function} - */ - - bodyParser(options) { - return middleware$1.bodyParser(options); - } - - /** - * JSON rpc middleware. - * @param {Object} rpc - * @returns {Function} - */ - - jsonRPC(rpc) { - if (rpc == null) - rpc = this.rpc; - - return middleware$1.jsonRPC(rpc); - } - - /** - * Static file middleware. - * @param {String} prefix - * @returns {Function} - */ - - fileServer(prefix) { - return middleware$1.fileServer(prefix); - } - - /** - * Cookie parsing middleware. - * @returns {Function} - */ - - cookieParser() { - return middleware$1.cookieParser(); - } - } - - /** - * HTTP Server Options - */ - - class ServerOptions { - /** - * Create http server options. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.host = '127.0.0.1'; - this.port = 8080; - - this.ssl = false; - this.keyFile = null; - this.certFile = null; - this.key = null; - this.cert = null; - this.ca = null; - - this.sockets = true; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {ServerOptions} - */ - - fromOptions(options) { - assert$s(options); - - if (options.host != null) { - assert$s(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$s((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.prefix != null) { - assert$s(typeof options.prefix === 'string'); - this.keyFile = Path$5.join(options.prefix, 'key.pem'); - this.certFile = Path$5.join(options.prefix, 'cert.pem'); - } - - if (options.ssl != null) { - assert$s(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$s(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$s(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - if (options.key != null) { - assert$s(typeof options.key === 'string' || Buffer.isBuffer(options.key)); - this.key = options.key; - } - - if (options.cert != null) { - assert$s(typeof options.cert === 'string' || Buffer.isBuffer(options.cert)); - this.cert = options.cert; - } - - if (options.ca != null) { - assert$s(Array.isArray(options.ca)); - this.ca = options.ca; - } - - if (options.sockets != null) { - assert$s(typeof options.sockets === 'boolean'); - this.sockets = options.sockets; - } - - if (this.ssl) { - assert$s(this.key || this.keyFile, 'SSL specified with no provided key.'); - assert$s(this.cert || this.certFile, - 'SSL specified with no provided cert.'); - } - - return this; - } - - /** - * Instantiate http server options from object. - * @param {Object} options - * @returns {ServerOptions} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Load key and cert file. - * @private - */ - - load() { - if (!this.ssl) - return; - - if (this.keyFile) - this.key = fs$3.readFileSync(this.keyFile); - - if (this.certFile) - this.cert = fs$3.readFileSync(this.certFile); - } - - /** - * Get HTTP server backend. - * @private - * @returns {Object} - */ - - getBackend() { - return this.ssl ? require$$6__default$1["default"] : require$$5__default["default"]; - } - - /** - * Get HTTP server options. - * @private - * @returns {Object} - */ - - toHTTP() { - if (!this.ssl) - return undefined; - - return { - key: this.key, - cert: this.cert, - ca: this.ca - }; - } - } - - /* - * Expose - */ - - var server = Server$3; - - /*! - * bweb.js - a web server - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - - const Server$2 = server; - const Router$5 = router$3; - const {RPC: RPC$5, RPCError: RPCError$2, errors} = rpc$2; - const middleware = middleware$2; - - bweb$2.Server = Server$2; - bweb$2.createServer = options => new Server$2(options); - bweb$2.server = options => new Server$2(options); - - bweb$2.Router = Router$5; - bweb$2.router = () => new Router$5(); - - bweb$2.RPC = RPC$5; - bweb$2.rpc = () => new RPC$5(); - - bweb$2.RPCError = RPCError$2; - bweb$2.errors = errors; - - bweb$2.middleware = middleware; - - /*! - * assert.js - assertions for javascript - * Copyright (c) 2018, Christopher Jeffrey (MIT License). - * https://github.com/chjj/bsert - */ - - /** - * AssertionError - */ - - class AssertionError extends Error { - constructor(options) { - if (typeof options === 'string') - options = { message: options }; - - if (options === null || typeof options !== 'object') - options = {}; - - let message = null; - let operator = 'fail'; - let generatedMessage = Boolean(options.generatedMessage); - - if (options.message != null) - message = toString$2(options.message); - - if (typeof options.operator === 'string') - operator = options.operator; - - if (message == null) { - if (operator === 'fail') { - message = 'Assertion failed.'; - } else { - const a = stringify(options.actual); - const b = stringify(options.expected); - - message = `${a} ${operator} ${b}`; - } - - generatedMessage = true; - } - - super(message); - - let start = this.constructor; - - if (typeof options.stackStartFunction === 'function') - start = options.stackStartFunction; - else if (typeof options.stackStartFn === 'function') - start = options.stackStartFn; - - this.type = 'AssertionError'; - this.name = 'AssertionError [ERR_ASSERTION]'; - this.code = 'ERR_ASSERTION'; - this.generatedMessage = generatedMessage; - this.actual = options.actual; - this.expected = options.expected; - this.operator = operator; - - if (Error.captureStackTrace) - Error.captureStackTrace(this, start); - } - } - - /* - * Assert - */ - - function assert$r(value, message) { - if (!value) { - let generatedMessage = false; - - if (arguments.length === 0) { - message = 'No value argument passed to `assert()`.'; - generatedMessage = true; - } else if (message == null) { - message = 'Assertion failed.'; - generatedMessage = true; - } else if (isError(message)) { - throw message; - } - - throw new AssertionError({ - message, - actual: value, - expected: true, - operator: '==', - generatedMessage, - stackStartFn: assert$r - }); - } - } - - function equal(actual, expected, message) { - if (!Object.is(actual, expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'strictEqual', - stackStartFn: equal - }); - } - } - - function notEqual(actual, expected, message) { - if (Object.is(actual, expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'notStrictEqual', - stackStartFn: notEqual - }); - } - } - - function fail(message) { - let generatedMessage = false; - - if (isError(message)) - throw message; - - if (message == null) { - message = 'Assertion failed.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: false, - expected: true, - operator: 'fail', - generatedMessage, - stackStartFn: fail - }); - } - - function throws(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - enforce$2(typeof func === 'function', 'func', 'function'); - - try { - func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) { - let generatedMessage = false; - - if (message == null) { - message = 'Missing expected exception.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'throws', - generatedMessage, - stackStartFn: throws - }); - } - - if (!testError(err, expected, message, throws)) - throw err; - } - - function doesNotThrow(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - enforce$2(typeof func === 'function', 'func', 'function'); - - try { - func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) - return; - - if (testError(err, expected, message, doesNotThrow)) { - let generatedMessage = false; - - if (message == null) { - message = 'Got unwanted exception.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: err, - expected, - operator: 'doesNotThrow', - generatedMessage, - stackStartFn: doesNotThrow - }); - } - - throw err; - } - - async function rejects(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - if (typeof func !== 'function') - enforce$2(isPromise(func), 'func', 'promise'); - - try { - if (isPromise(func)) - await func; - else - await func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) { - let generatedMessage = false; - - if (message == null) { - message = 'Missing expected rejection.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'rejects', - generatedMessage, - stackStartFn: rejects - }); - } - - if (!testError(err, expected, message, rejects)) - throw err; - } - - async function doesNotReject(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - if (typeof func !== 'function') - enforce$2(isPromise(func), 'func', 'promise'); - - try { - if (isPromise(func)) - await func; - else - await func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) - return; - - if (testError(err, expected, message, doesNotReject)) { - let generatedMessage = false; - - if (message == null) { - message = 'Got unwanted rejection.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'doesNotReject', - generatedMessage, - stackStartFn: doesNotReject - }); - } - - throw err; - } - - function ifError(err) { - if (err != null) { - let message = 'ifError got unwanted exception: '; - - if (typeof err === 'object' && typeof err.message === 'string') { - if (err.message.length === 0 && err.constructor) - message += err.constructor.name; - else - message += err.message; - } else { - message += stringify(err); - } - - throw new AssertionError({ - message, - actual: err, - expected: null, - operator: 'ifError', - generatedMessage: true, - stackStartFn: ifError - }); - } - } - - function deepEqual(actual, expected, message) { - if (!isDeepEqual(actual, expected, false)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'deepStrictEqual', - stackStartFn: deepEqual - }); - } - } - - function notDeepEqual(actual, expected, message) { - if (isDeepEqual(actual, expected, true)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'notDeepStrictEqual', - stackStartFn: notDeepEqual - }); - } - } - - function bufferEqual(actual, expected, enc, message) { - if (!isEncoding(enc)) { - message = enc; - enc = null; - } - - if (enc == null) - enc = 'hex'; - - expected = bufferize(actual, expected, enc); - - enforce$2(isBuffer(actual), 'actual', 'buffer'); - enforce$2(isBuffer(expected), 'expected', 'buffer'); - - if (actual !== expected && !actual.equals(expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual: actual.toString(enc), - expected: expected.toString(enc), - operator: 'bufferEqual', - stackStartFn: bufferEqual - }); - } - } - - function notBufferEqual(actual, expected, enc, message) { - if (!isEncoding(enc)) { - message = enc; - enc = null; - } - - if (enc == null) - enc = 'hex'; - - expected = bufferize(actual, expected, enc); - - enforce$2(isBuffer(actual), 'actual', 'buffer'); - enforce$2(isBuffer(expected), 'expected', 'buffer'); - - if (actual === expected || actual.equals(expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual: actual.toString(enc), - expected: expected.toString(enc), - operator: 'notBufferEqual', - stackStartFn: notBufferEqual - }); - } - } - - function enforce$2(value, name, type) { - if (!value) { - let msg; - - if (name == null) { - msg = 'Invalid type for parameter.'; - } else { - if (type == null) - msg = `Invalid type for "${name}".`; - else - msg = `"${name}" must be a(n) ${type}.`; - } - - const err = new TypeError(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, enforce$2); - - throw err; - } - } - - function range(value, name) { - if (!value) { - const msg = name != null - ? `"${name}" is out of range.` - : 'Parameter is out of range.'; - - const err = new RangeError(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, range); - - throw err; - } - } - - /* - * Stringification - */ - - function stringify(value) { - switch (typeof value) { - case 'undefined': - return 'undefined'; - case 'object': - if (value === null) - return 'null'; - return `[${objectName(value)}]`; - case 'boolean': - return `${value}`; - case 'number': - return `${value}`; - case 'string': - if (value.length > 80) - value = `${value.substring(0, 77)}...`; - return JSON.stringify(value); - case 'symbol': - return tryString(value); - case 'function': - return `[${funcName(value)}]`; - case 'bigint': - return `${value}n`; - default: - return `[${typeof value}]`; - } - } - - function toString$2(value) { - if (typeof value === 'string') - return value; - - if (isError(value)) - return tryString(value); - - return stringify(value); - } - - function tryString(value) { - try { - return String(value); - } catch (e) { - return 'Object'; - } - } - - /* - * Error Testing - */ - - function testError(err, expected, message, func) { - if (expected == null) - return true; - - if (isRegExp(expected)) - return expected.test(err); - - if (typeof expected !== 'function') { - if (func === doesNotThrow || func === doesNotReject) - throw new TypeError('"expected" must not be an object.'); - - if (typeof expected !== 'object') - throw new TypeError('"expected" must be an object.'); - - let generatedMessage = false; - - if (message == null) { - const name = func === rejects ? 'rejection' : 'exception'; - message = `Missing expected ${name}.`; - generatedMessage = true; - } - - if (err == null || typeof err !== 'object') { - throw new AssertionError({ - actual: err, - expected, - message, - operator: func.name, - generatedMessage, - stackStartFn: func - }); - } - - const keys = Object.keys(expected); - - if (isError(expected)) - keys.push('name', 'message'); - - if (keys.length === 0) - throw new TypeError('"expected" may not be an empty object.'); - - for (const key of keys) { - const expect = expected[key]; - const value = err[key]; - - if (typeof value === 'string' - && isRegExp(expect) - && expect.test(value)) { - continue; - } - - if ((key in err) && isDeepEqual(value, expect, false)) - continue; - - throw new AssertionError({ - actual: err, - expected: expected, - message, - operator: func.name, - generatedMessage, - stackStartFn: func - }); - } - - return true; - } - - if (expected.prototype !== undefined && (err instanceof expected)) - return true; - - if (Error.isPrototypeOf(expected)) - return false; - - return expected.call({}, err) === true; - } - - /* - * Comparisons - */ - - function isDeepEqual(x, y, fail) { - try { - return compare(x, y, null); - } catch (e) { - return fail; - } - } - - function compare(a, b, cache) { - // Primitives. - if (Object.is(a, b)) - return true; - - if (!isObject(a) || !isObject(b)) - return false; - - // Semi-primitives. - if (objectString(a) !== objectString(b)) - return false; - - if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) - return false; - - if (isBuffer(a) && isBuffer(b)) - return a.equals(b); - - if (isDate(a)) - return Object.is(a.getTime(), b.getTime()); - - if (isRegExp(a)) { - return a.source === b.source - && a.global === b.global - && a.multiline === b.multiline - && a.lastIndex === b.lastIndex - && a.ignoreCase === b.ignoreCase; - } - - if (isError(a)) { - if (a.message !== b.message) - return false; - } - - if (isArrayBuffer(a)) { - a = new Uint8Array(a); - b = new Uint8Array(b); - } - - if (isView(a) && !isBuffer(a)) { - if (isBuffer(b)) - return false; - - const x = new Uint8Array(a.buffer); - const y = new Uint8Array(b.buffer); - - if (x.length !== y.length) - return false; - - for (let i = 0; i < x.length; i++) { - if (x[i] !== y[i]) - return false; - } - - return true; - } - - if (isSet(a)) { - if (a.size !== b.size) - return false; - - const keys = new Set([...a, ...b]); - - return keys.size === a.size; - } - - // Recursive. - if (!cache) { - cache = { - a: new Map(), - b: new Map(), - p: 0 - }; - } else { - const aa = cache.a.get(a); - - if (aa != null) { - const bb = cache.b.get(b); - if (bb != null) - return aa === bb; - } - - cache.p += 1; - } - - cache.a.set(a, cache.p); - cache.b.set(b, cache.p); - - const ret = recurse(a, b, cache); - - cache.a.delete(a); - cache.b.delete(b); - - return ret; - } - - function recurse(a, b, cache) { - if (isMap(a)) { - if (a.size !== b.size) - return false; - - const keys = new Set([...a.keys(), ...b.keys()]); - - if (keys.size !== a.size) - return false; - - for (const key of keys) { - if (!compare(a.get(key), b.get(key), cache)) - return false; - } - - return true; - } - - if (isArray(a)) { - if (a.length !== b.length) - return false; - - for (let i = 0; i < a.length; i++) { - if (!compare(a[i], b[i], cache)) - return false; - } - - return true; - } - - const ak = ownKeys(a); - const bk = ownKeys(b); - - if (ak.length !== bk.length) - return false; - - const keys = new Set([...ak, ...bk]); - - if (keys.size !== ak.length) - return false; - - for (const key of keys) { - if (!compare(a[key], b[key], cache)) - return false; - } - - return true; - } - - function ownKeys(obj) { - const keys = Object.keys(obj); - - if (!Object.getOwnPropertySymbols) - return keys; - - if (!Object.getOwnPropertyDescriptor) - return keys; - - const symbols = Object.getOwnPropertySymbols(obj); - - for (const symbol of symbols) { - const desc = Object.getOwnPropertyDescriptor(obj, symbol); - - if (desc && desc.enumerable) - keys.push(symbol); - } - - return keys; - } - - /* - * Helpers - */ - - function objectString(obj) { - if (obj === undefined) - return '[object Undefined]'; - - if (obj === null) - return '[object Null]'; - - try { - return Object.prototype.toString.call(obj); - } catch (e) { - return '[object Object]'; - } - } - - function objectType(obj) { - return objectString(obj).slice(8, -1); - } - - function objectName(obj) { - const type = objectType(obj); - - if (obj == null) - return type; - - if (type !== 'Object' && type !== 'Error') - return type; - - let ctor, name; - - try { - ctor = obj.constructor; - } catch (e) { - } - - if (ctor == null) - return type; - - try { - name = ctor.name; - } catch (e) { - return type; - } - - if (typeof name !== 'string' || name.length === 0) - return type; - - return name; - } - - function funcName(func) { - let name; - - try { - name = func.name; - } catch (e) { - } - - if (typeof name !== 'string' || name.length === 0) - return 'Function'; - - return `Function: ${name}`; - } - - function isArray(obj) { - return Array.isArray(obj); - } - - function isArrayBuffer(obj) { - return obj instanceof ArrayBuffer; - } - - function isBuffer(obj) { - return isObject(obj) - && typeof obj.writeUInt32LE === 'function' - && typeof obj.equals === 'function'; - } - - function isDate(obj) { - return obj instanceof Date; - } - - function isError(obj) { - return obj instanceof Error; - } - - function isMap(obj) { - return obj instanceof Map; - } - - function isObject(obj) { - return obj && typeof obj === 'object'; - } - - function isPromise(obj) { - return obj instanceof Promise; - } - - function isRegExp(obj) { - return obj instanceof RegExp; - } - - function isSet(obj) { - return obj instanceof Set; - } - - function isView(obj) { - return ArrayBuffer.isView(obj); - } - - function isEncoding(enc) { - if (typeof enc !== 'string') - return false; - - switch (enc) { - case 'ascii': - case 'binary': - case 'base64': - case 'hex': - case 'latin1': - case 'ucs2': - case 'utf8': - case 'utf16le': - return true; - } - - return false; - } - - function bufferize(actual, expected, enc) { - if (typeof expected === 'string') { - if (!isBuffer(actual)) - return null; - - const {constructor} = actual; - - if (!constructor || typeof constructor.from !== 'function') - return null; - - if (!isEncoding(enc)) - return null; - - if (enc === 'hex' && (expected.length & 1)) - return null; - - const raw = constructor.from(expected, enc); - - if (enc === 'hex' && raw.length !== (expected.length >>> 1)) - return null; - - return raw; - } - - return expected; - } - - /* - * API - */ - - assert$r.AssertionError = AssertionError; - assert$r.assert = assert$r; - assert$r.strict = assert$r; - assert$r.ok = assert$r; - assert$r.equal = equal; - assert$r.notEqual = notEqual; - assert$r.strictEqual = equal; - assert$r.notStrictEqual = notEqual; - assert$r.fail = fail; - assert$r.throws = throws; - assert$r.doesNotThrow = doesNotThrow; - assert$r.rejects = rejects; - assert$r.doesNotReject = doesNotReject; - assert$r.ifError = ifError; - assert$r.deepEqual = deepEqual; - assert$r.notDeepEqual = notDeepEqual; - assert$r.deepStrictEqual = deepEqual; - assert$r.notDeepStrictEqual = notDeepEqual; - assert$r.bufferEqual = bufferEqual; - assert$r.notBufferEqual = notBufferEqual; - assert$r.enforce = enforce$2; - assert$r.range = range; - - /* - * Expose - */ - - var assert_1 = assert$r; - - /*! - * validator.js - validator for bcoin - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$q = assert_1; - - /** - * Validator - */ - - class Validator$4 { - /** - * Create a validator. - * @constructor - * @param {Object} map - * @param {Boolean} [loose=false] - */ - - constructor(map, loose) { - if (!map || typeof map !== 'object') - throw new ValidationError('map', 'object'); - - this.map = map; - this.loose = loose || false; - } - - /** - * Create a multi validator. - * @param {Object[]} maps - * @param {Boolean} [loose=false] - * @returns {MultiValidator} - */ - - static multi(maps, loose) { - return new MultiValidator(maps, loose); - } - - /** - * Create a multi validator from an http request. - * @param {Object} req - * @returns {MultiValidator} - */ - - static fromRequest(req) { - const query = new Validator$4(req.query, true); - const params = new Validator$4(req.params, true); - const body = new Validator$4(req.body, false); - return new MultiValidator([query, params, body]); - } - - /** - * Create a child validator. - * @param {String} key - * @returns {Validator} - */ - - child(key) { - return new this.constructor(this.get(key)); - } - - /** - * Test whether value is present. - * @param {String} key - * @returns {Boolean} - */ - - has(key) { - return this.get(key) != null; - } - - /** - * Get a value (no type validation). - * @param {String} key - * @param {Object?} fallback - * @returns {Object|null} - */ - - get(key, fallback) { - if (fallback === undefined) - fallback = null; - - if (Array.isArray(key)) { - const keys = key; - for (const key of keys) { - const value = this.get(key); - if (value !== null) - return value; - } - return fallback; - } - - assert$q(typeof key === 'string' || typeof key === 'number', - 'Key must be a string or number.'); - - const value = this.map[key]; - - if (value != null) - return value; - - return fallback; - } - - /** - * Get a value's type. - * @param {String} key - * @returns {String} - */ - - typeOf(key) { - const value = this.get(key); - - if (value == null) - return 'null'; - - return typeof value; - } - - /** - * Get a value (as a string). - * @param {String} key - * @param {Object?} fallback - * @returns {String|null} - */ - - str(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') - throw new ValidationError(key, 'string'); - - return value; - } - - /** - * Get a value (as an integer). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - int(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (typeof value !== 'number') - throw new ValidationError(key, 'int'); - - if (!Number.isSafeInteger(value)) - throw new ValidationError(key, 'int'); - - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'int'); - - if (!/^\-?\d+$/.test(value)) - throw new ValidationError(key, 'int'); - - const num = parseInt(value, 10); - - if (!Number.isSafeInteger(num)) - throw new ValidationError(key, 'int'); - - return num; - } - - /** - * Get a value (as a signed integer). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - uint(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'uint'); - - return value; - } - - /** - * Get a value (as a float). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - float(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (typeof value !== 'number') - throw new ValidationError(key, 'float'); - - if (!isFinite(value)) - throw new ValidationError(key, 'float'); - - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'float'); - - if (!/^\-?\d*(?:\.\d*)?$/.test(value)) - throw new ValidationError(key, 'float'); - - if (!/\d/.test(value)) - throw new ValidationError(key, 'float'); - - const num = parseFloat(value); - - if (!isFinite(num)) - throw new ValidationError(key, 'float'); - - return num; - } - - /** - * Get a value (as a positive float). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - ufloat(key, fallback) { - const value = this.float(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'positive float'); - - return value; - } - - /** - * Get a value (as a fixed number). - * @param {String} key - * @param {Number?} exp - * @param {Object?} fallback - * @returns {Number|null} - */ - - fixed(key, exp, fallback) { - const value = this.float(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - try { - return fromFloat(value, exp || 0); - } catch (e) { - throw new ValidationError(key, 'fixed number'); - } - } - - /** - * Get a value (as a positive fixed number). - * @param {String} key - * @param {Number?} exp - * @param {Object?} fallback - * @returns {Number|null} - */ - - ufixed(key, exp, fallback) { - const value = this.fixed(key, exp); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'positive fixed number'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i8(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < -0x80 || value > 0x7f) - throw new ValidationError(key, 'i8'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i16(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < -0x8000 || value > 0x7fff) - throw new ValidationError(key, 'i16'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i32(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value | 0) !== value) - throw new ValidationError(key, 'int32'); - - return value; - } - - /** - * Get a value (as an int64). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i64(key, fallback) { - return this.int(key, fallback); - } - - /** - * Get a value (as a uint32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u8(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value & 0xff) !== value) - throw new ValidationError(key, 'uint8'); - - return value; - } - - /** - * Get a value (as a uint16). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u16(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value & 0xffff) !== value) - throw new ValidationError(key, 'uint16'); - - return value; - } - - /** - * Get a value (as a uint32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u32(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value >>> 0) !== value) - throw new ValidationError(key, 'uint32'); - - return value; - } - - /** - * Get a value (as a uint64). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u64(key, fallback) { - return this.uint(key, fallback); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Hash|null} - */ - - hash(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'hash'); - - if (value.length !== 32) - throw new ValidationError(key, 'hash'); - - return value.toString('hex'); - } - - if (value.length !== 64) - throw new ValidationError(key, 'hex string'); - - if (!/^[0-9a-f]+$/i.test(value)) - throw new ValidationError(key, 'hex string'); - - return value.toLowerCase(); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Buffer|null} - */ - - bhash(key, fallback) { - const value = this.hash(key, fallback); - - if (!value) - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a number or hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Hash|null} - */ - - uinthash(key, fallback) { - const value = this.get(key); - - if (fallback == null) - fallback = null; - - if (value == null) - return fallback; - - if (Buffer.isBuffer(value)) - return this.hash(key, fallback); - - if (typeof value === 'string') { - if (!this.loose || value.length === 64) - return this.hash(key, fallback); - } - - return this.uint(key, fallback); - } - - /** - * Get a value (as a number or hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Buffer|null} - */ - - uintbhash(key, fallback) { - const value = this.uinthash(key, fallback); - - if (typeof value !== 'string') - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Hash|null} - */ - - rhash(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'hash'); - - if (value.length !== 32) - throw new ValidationError(key, 'hash'); - - return value.toString('hex'); - } - - if (value.length !== 64) - throw new ValidationError(key, 'hex string'); - - if (!/^[0-9a-f]+$/i.test(value)) - throw new ValidationError(key, 'hex string'); - - let out = ''; - - for (let i = 0; i < value.length; i += 2) - out = value.slice(i, i + 2) + out; - - return out.toLowerCase(); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Buffer|null} - */ - - brhash(key, fallback) { - const value = this.rhash(key, fallback); - - if (!value) - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a number or reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Hash|null} - */ - - uintrhash(key, fallback) { - const value = this.get(key); - - if (fallback == null) - fallback = null; - - if (value == null) - return fallback; - - if (Buffer.isBuffer(value)) - return this.rhash(key, fallback); - - if (typeof value === 'string') { - if (!this.loose || value.length === 64) - return this.rhash(key, fallback); - } - - return this.uint(key, fallback); - } - - /** - * Get a value (as a number or reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Buffer|null} - */ - - uintbrhash(key, fallback) { - const value = this.uintrhash(key, fallback); - - if (typeof value !== 'string') - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a boolean). - * @param {String} key - * @param {Object?} fallback - * @returns {Boolean|null} - */ - - bool(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - // Bitcoin Core compat. - if (typeof value === 'number') { - if (value === 1) - return true; - - if (value === 0) - return false; - } - - if (typeof value !== 'string') { - if (typeof value !== 'boolean') - throw new ValidationError(key, 'boolean'); - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'boolean'); - - if (value === 'true' || value === '1') - return true; - - if (value === 'false' || value === '0') - return false; - - throw new ValidationError(key, 'boolean'); - } - - /** - * Get a value (as a buffer). - * @param {String} key - * @param {Object?} fallback - * @param {String?} enc - * @returns {Buffer|null} - */ - - buf(key, fallback, enc) { - const value = this.get(key); - - if (!enc) - enc = 'hex'; - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'buffer'); - return value; - } - - const data = Buffer.from(value, enc); - - if (data.length !== Buffer.byteLength(value, enc)) - throw new ValidationError(key, `${enc} string`); - - return data; - } - - /** - * Get a value (as an array). - * @param {String} key - * @param {Object?} fallback - * @returns {Array|String[]|null} - */ - - array(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Array.isArray(value)) - throw new ValidationError(key, 'array'); - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'array'); - - const parts = value.trim().split(/\s*,\s*/); - const result = []; - - for (const part of parts) { - if (part.length === 0) - continue; - - result.push(part); - } - - return result; - } - - /** - * Get a value (as an object). - * @param {String} key - * @param {Object?} fallback - * @returns {Object|null} - */ - - obj(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'object' || Array.isArray(value)) - throw new ValidationError(key, 'object'); - - return value; - } - - /** - * Get a value (as a function). - * @param {String} key - * @param {Object?} fallback - * @returns {Function|null} - */ - - func(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'function') - throw new ValidationError(key, 'function'); - - return value; - } - } - - /* - * Constants - */ - - const SENTINEL = new Validator$4(Object.create(null)); - - /** - * Multi Validator - * @extends Validator - */ - - class MultiValidator { - /** - * Create a multi validator. - * @constructor - * @param {Object[]} maps - * @param {Boolean} [loose=false] - */ - - constructor(maps, loose) { - this.maps = []; - - this.init(maps, loose); - } - - /** - * Initialize the validator. - * @private - * @param {Object[]} maps - * @param {Boolean} [loose=false] - */ - - init(maps, loose) { - assert$q(Array.isArray(maps)); - assert$q(maps.length > 0); - - for (const map of maps) { - if (!(map instanceof Validator$4)) { - assert$q(map && typeof map === 'object'); - this.maps.push(new Validator$4(map, loose)); - continue; - } - this.maps.push(map); - } - } - - /** - * Get a validator. - * @private - * @param {String} key - * @returns {Validator} - */ - - find(key) { - for (const map of this.maps) { - if (map.has(key)) - return map; - } - return SENTINEL; - } - - child(key) { - return this.find(key).child(key); - } - - has(key) { - return this.find(key).has(key); - } - - get(key, fallback) { - return this.find(key).get(key, fallback); - } - - typeOf(key) { - return this.find(key).typeOf(key); - } - - str(key, fallback) { - return this.find(key).str(key, fallback); - } - - int(key, fallback) { - return this.find(key).int(key, fallback); - } - - uint(key, fallback) { - return this.find(key).uint(key, fallback); - } - - float(key, fallback) { - return this.find(key).float(key, fallback); - } - - ufloat(key, fallback) { - return this.find(key).ufloat(key, fallback); - } - - fixed(key, exp, fallback) { - return this.find(key).fixed(key, exp, fallback); - } - - ufixed(key, exp, fallback) { - return this.find(key).ufixed(key, exp, fallback); - } - - i8(key, fallback) { - return this.find(key).i8(key, fallback); - } - - i16(key, fallback) { - return this.find(key).i16(key, fallback); - } - - i32(key, fallback) { - return this.find(key).i32(key, fallback); - } - - i64(key, fallback) { - return this.find(key).i64(key, fallback); - } - - u8(key, fallback) { - return this.find(key).u8(key, fallback); - } - - u16(key, fallback) { - return this.find(key).u16(key, fallback); - } - - u32(key, fallback) { - return this.find(key).u32(key, fallback); - } - - u64(key, fallback) { - return this.find(key).u64(key, fallback); - } - - hash(key, fallback) { - return this.find(key).hash(key, fallback); - } - - bhash(key, fallback) { - return this.find(key).bhash(key, fallback); - } - - uinthash(key, fallback) { - return this.find(key).uinthash(key, fallback); - } - - uintbhash(key, fallback) { - return this.find(key).uintbhash(key, fallback); - } - - rhash(key, fallback) { - return this.find(key).rhash(key, fallback); - } - - brhash(key, fallback) { - return this.find(key).brhash(key, fallback); - } - - uintrhash(key, fallback) { - return this.find(key).uintrhash(key, fallback); - } - - uintbrhash(key, fallback) { - return this.find(key).uintbrhash(key, fallback); - } - - bool(key, fallback) { - return this.find(key).bool(key, fallback); - } - - buf(key, fallback, enc) { - return this.find(key).buf(key, fallback, enc); - } - - array(key, fallback) { - return this.find(key).array(key, fallback); - } - - obj(key, fallback) { - return this.find(key).obj(key, fallback); - } - - func(key, fallback) { - return this.find(key).func(key, fallback); - } - } - - /* - * Helpers - */ - - function fmt(key) { - if (Array.isArray(key)) - key = key[0]; - - if (typeof key === 'number') - return `Param #${key}`; - - return key; - } - - class ValidationError extends Error { - constructor(key, type) { - super(); - - this.type = 'ValidationError'; - this.message = `${fmt(key)} must be a ${type}.`; - - if (Error.captureStackTrace) - Error.captureStackTrace(this, ValidationError); - } - } - - function fromFloat(num, exp) { - assert$q(typeof num === 'number' && isFinite(num)); - assert$q(Number.isSafeInteger(exp)); - - let str = num.toFixed(exp); - let sign = 1; - - if (str.length > 0 && str[0] === '-') { - str = str.substring(1); - sign = -1; - } - - let hi = str; - let lo = '0'; - - const index = str.indexOf('.'); - - if (index !== -1) { - hi = str.substring(0, index); - lo = str.substring(index + 1); - } - - hi = hi.replace(/^0+/, ''); - lo = lo.replace(/0+$/, ''); - - assert$q(hi.length <= 16 - exp, - 'Fixed number string exceeds 2^53-1.'); - - assert$q(lo.length <= exp, - 'Too many decimal places in fixed number string.'); - - if (hi.length === 0) - hi = '0'; - - while (lo.length < exp) - lo += '0'; - - if (lo.length === 0) - lo = '0'; - - assert$q(/^\d+$/.test(hi) && /^\d+$/.test(lo), - 'Non-numeric characters in fixed number string.'); - - hi = parseInt(hi, 10); - lo = parseInt(lo, 10); - - const mult = Math.pow(10, exp); - const maxLo = Number.MAX_SAFE_INTEGER % mult; - const maxHi = (Number.MAX_SAFE_INTEGER - maxLo) / mult; - - assert$q(hi < maxHi || (hi === maxHi && lo <= maxLo), - 'Fixed number string exceeds 2^53-1.'); - - return sign * (hi * mult + lo); - } - - /* - * Expose - */ - - var validator = Validator$4; - - var bval = validator; - - var safe = {}; - - /*! - * safe.js - constant-time equals for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on golang/go: - * Copyright (c) 2009 The Go Authors. All rights reserved. - * https://github.com/golang/go - * - * Resources: - * https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go - */ - - const assert$p = assert_1$d; - - /* - * Safe - */ - - function safeCompare(x, y) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - - if (safeEqualInt(x.length, 0)) - return safeEqualInt(y.length, 0); - - // Assumes `y` is the "constant size" - // parameter. Note that constant size - // doesn't necessarily mean secret. - // Assuming we have a constant-size - // secret key or passphrase. This - // function should be called as: - // - // if (!safeCompare(input, key)) - // throw new Error('Bad passphrase.'); - let v = x.length ^ y.length; - - for (let i = 0; i < y.length; i++) - v |= x[i % x.length] ^ y[i]; - - return (v - 1) >>> 31; - } - - function safeEqual$5(x, y) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - - // Assumes the lengths of both - // `x` and `y` are not secret. - if (!safeEqualInt(x.length, y.length)) - return 0; - - let v = 0; - - for (let i = 0; i < x.length; i++) - v |= x[i] ^ y[i]; - - return (v - 1) >>> 31; - } - - function safeEqualByte(x, y) { - return safeEqualInt(x & 0xff, y & 0xff); - } - - function safeEqualInt(x, y) { - return ((x ^ y) - 1) >>> 31; - } - - function safeSelect(x, y, v) { - return (x & (v - 1)) | (y & ~(v - 1)); - } - - function safeLT(x, y) { - return (x - y) >>> 31; - } - - function safeLTE(x, y) { - return (x - y - 1) >>> 31; - } - - function safeGT(x, y) { - return (y - x) >>> 31; - } - - function safeGTE(x, y) { - return (y - x - 1) >>> 31; - } - - function safeMin(x, y) { - return safeSelect(x, y, safeLT(y, x)); - } - - function safeMax(x, y) { - return safeSelect(x, y, safeGT(y, x)); - } - - function safeAbs(x) { - return (x | 0) * ((x >> 31) | 1); - } - - function safeBool(x) { - return ((x >> 31) | (-x >> 31)) & 1; - } - - function safeCopy(x, y, v) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - assert$p(safeEqualInt(x.length, y.length)); - - const xmask = (v - 1) & 0xff; - const ymask = ~(v - 1) & 0xff; - - for (let i = 0; i < x.length; i++) - x[i] = (x[i] & xmask) | (y[i] & ymask); - } - - /* - * Expose - */ - - safe.safeCompare = safeCompare; - safe.safeEqual = safeEqual$5; - safe.safeEqualByte = safeEqualByte; - safe.safeEqualInt = safeEqualInt; - safe.safeSelect = safeSelect; - safe.safeLT = safeLT; - safe.safeLTE = safeLTE; - safe.safeGT = safeGT; - safe.safeGTE = safeGTE; - safe.safeMin = safeMin; - safe.safeMax = safeMax; - safe.safeAbs = safeAbs; - safe.safeBool = safeBool; - safe.safeCopy = safeCopy; - - /*! - * server.js - http server for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$o = assert_1$g; - const path$4 = require$$1__default["default"]; - const {Server: Server$1} = bweb$2; - const Validator$3 = bval; - const base58$2 = base58$9.exports; - const {BloomFilter: BloomFilter$1} = bfilter; - const sha256$2 = sha256$9.exports; - const random$2 = random$9; - const {safeEqual: safeEqual$4} = safe; - const util$6 = util$y; - const Address$7 = address$1; - const TX$3 = tx; - const Outpoint$6 = outpoint; - const Network$4 = network; - const pkg$3 = pkg$4; - - /** - * HTTP - * @alias module:http.Server - */ - - class HTTP$4 extends Server$1 { - /** - * Create an http server. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(new HTTPOptions$1(options)); - - this.network = this.options.network; - this.logger = this.options.logger.context('node-http'); - this.node = this.options.node; - - this.chain = this.node.chain; - this.mempool = this.node.mempool; - this.pool = this.node.pool; - this.fees = this.node.fees; - this.miner = this.node.miner; - this.rpc = this.node.rpc; - - this.init(); - } - - /** - * Initialize routes. - * @private - */ - - init() { - this.on('request', (req, res) => { - if (req.method === 'POST' && req.pathname === '/') - return; - - this.logger.debug('Request for method=%s path=%s (%s).', - req.method, req.pathname, req.socket.remoteAddress); - }); - - this.on('listening', (address) => { - this.logger.info('Node HTTP server listening on %s (port=%d).', - address.address, address.port); - }); - - this.initRouter(); - this.initSockets(); - } - - /** - * Initialize routes. - * @private - */ - - initRouter() { - if (this.options.cors) - this.use(this.cors()); - - if (!this.options.noAuth) { - this.use(this.basicAuth({ - hash: sha256$2.digest, - password: this.options.apiKey, - realm: 'node' - })); - } - - this.use(this.bodyParser({ - type: 'json' - })); - - this.use(this.jsonRPC()); - this.use(this.router()); - - this.error((err, req, res) => { - const code = err.statusCode || 500; - res.json(code, { - error: { - type: err.type, - code: err.code, - message: err.message - } - }); - }); - - this.get('/', async (req, res) => { - const totalTX = this.mempool ? this.mempool.map.size : 0; - const size = this.mempool ? this.mempool.getSize() : 0; - const orphans = this.mempool ? this.mempool.orphans.size : 0; - - let addr = this.pool.hosts.getLocal(); - - if (!addr) - addr = this.pool.hosts.address; - - res.json(200, { - version: pkg$3.version, - network: this.network.type, - chain: { - height: this.chain.height, - tip: this.chain.tip.rhash(), - progress: this.chain.getProgress() - }, - indexes: { - addr: { - enabled: Boolean(this.node.addrindex), - height: this.node.addrindex ? this.node.addrindex.height : 0 - }, - tx: { - enabled: Boolean(this.node.txindex), - height: this.node.txindex ? this.node.txindex.height : 0 - }, - filter: { - enabled: Boolean(this.node.filterindex), - height: this.node.filterindex ? this.node.filterindex.height : 0 - } - }, - pool: { - host: addr.host, - port: addr.port, - agent: this.pool.options.agent, - services: this.pool.options.services.toString(2), - outbound: this.pool.peers.outbound, - inbound: this.pool.peers.inbound - }, - mempool: { - tx: totalTX, - size: size, - orphans: orphans - }, - time: { - uptime: this.node.uptime(), - system: util$6.now(), - adjusted: this.network.now(), - offset: this.network.time.offset - }, - memory: this.logger.memoryUsage() - }); - }); - - // UTXO by id - this.get('/coin/:hash/:index', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce$1(hash, 'Hash is required.'); - enforce$1(index != null, 'Index is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get coins in SPV mode.'); - - const coin = await this.node.getCoin(hash, index); - - if (!coin) { - res.json(404); - return; - } - - res.json(200, coin.getJSON(this.network)); - }); - - // TX by hash - this.get('/tx/:hash', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce$1(hash, 'Hash is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get TX in SPV mode.'); - - const meta = await this.node.getMeta(hash); - - if (!meta) { - res.json(404); - return; - } - - const view = await this.node.getMetaView(meta); - - res.json(200, meta.getJSON(this.network, view, this.chain.height)); - }); - - // TX by address - this.get('/tx/address/:address', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const address = valid.str('address'); - const limit = valid.uint('limit', this.options.maxTxs); - const reverse = valid.bool('reverse', false); - const after = valid.brhash('after', null); - - enforce$1(address, 'Address is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get TX in SPV mode.'); - enforce$1(limit <= this.options.maxTxs, - `Limit above max of ${this.options.maxTxs}.`); - - const addr = Address$7.fromString(address, this.network); - - const metas = await this.node.getMetaByAddress( - addr, {limit, reverse, after}); - - const result = []; - - for (const meta of metas) { - const view = await this.node.getMetaView(meta); - result.push(meta.getJSON(this.network, view, this.chain.height)); - } - - res.json(200, result); - }); - - // Block by hash/height - this.get('/block/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - enforce$1(!this.chain.options.spv, 'Cannot get block in SPV mode.'); - - const block = await this.chain.getBlock(hash); - - if (!block) { - res.json(404); - return; - } - - const view = await this.chain.getBlockView(block); - - if (!view) { - res.json(404); - return; - } - - const height = await this.chain.getHeight(hash); - const depth = this.chain.height - height + 1; - - res.json(200, block.getJSON(this.network, view, height, depth)); - }); - - // Block Header by hash/height - this.get('/header/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) { - res.json(404); - return; - } - - res.json(200, entry.toJSON()); - }); - - // Filters by hash/height - this.get('/filter/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - - const filter = await this.node.getBlockFilter(hash); - - if (!filter) { - res.json(404); - return; - } - - res.json(200, filter.toJSON()); - }); - - // Mempool snapshot - this.get('/mempool', async (req, res) => { - enforce$1(this.mempool, 'No mempool available.'); - - const hashes = this.mempool.getSnapshot(); - const result = []; - - for (const hash of hashes) - result.push(util$6.revHex(hash)); - - res.json(200, result); - }); - - // Broadcast TX - this.post('/broadcast', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const raw = valid.buf('tx'); - - enforce$1(raw, 'TX is required.'); - - const tx = TX$3.fromRaw(raw); - - await this.node.sendTX(tx); - - res.json(200, { success: true }); - }); - - // Estimate fee - this.get('/fee', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const blocks = valid.u32('blocks', 1); - - if (!this.fees) { - res.json(200, { rate: this.network.feeRate }); - return; - } - - const fee = this.fees.estimateFee(blocks); - - res.json(200, { rate: fee }); - }); - - // Reset chain - this.post('/reset', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const height = valid.u32('height'); - - enforce$1(height != null, 'Height is required.'); - enforce$1(height <= this.chain.height, - 'Height cannot be greater than chain tip.'); - - await this.chain.reset(height); - - res.json(200, { success: true }); - }); - } - - /** - * Handle new websocket. - * @private - * @param {WebSocket} socket - */ - - handleSocket(socket) { - socket.hook('auth', (...args) => { - if (socket.channel('auth')) - throw new Error('Already authed.'); - - if (!this.options.noAuth) { - const valid = new Validator$3(args); - const key = valid.str(0, ''); - - if (key.length > 255) - throw new Error('Invalid API key.'); - - const data = Buffer.from(key, 'ascii'); - const hash = sha256$2.digest(data); - - if (!safeEqual$4(hash, this.options.apiHash)) - throw new Error('Invalid API key.'); - } - - socket.join('auth'); - - this.logger.info('Successful auth from %s.', socket.host); - this.handleAuth(socket); - - return null; - }); - - socket.fire('version', { - version: pkg$3.version, - network: this.network.type - }); - } - - /** - * Handle new auth'd websocket. - * @private - * @param {WebSocket} socket - */ - - handleAuth(socket) { - socket.hook('watch chain', () => { - socket.join('chain'); - return null; - }); - - socket.hook('unwatch chain', () => { - socket.leave('chain'); - return null; - }); - - socket.hook('watch mempool', () => { - socket.join('mempool'); - return null; - }); - - socket.hook('unwatch mempool', () => { - socket.leave('mempool'); - return null; - }); - - socket.hook('set filter', (...args) => { - const valid = new Validator$3(args); - const data = valid.buf(0); - - if (!data) - throw new Error('Invalid parameter.'); - - socket.filter = BloomFilter$1.fromRaw(data); - - return null; - }); - - socket.hook('get tip', () => { - return this.chain.tip.toRaw(); - }); - - socket.hook('get entry', async (...args) => { - const valid = new Validator$3(args); - const block = valid.uintbrhash(0); - - if (block == null) - throw new Error('Invalid parameter.'); - - const entry = await this.chain.getEntry(block); - - if (!entry) - return null; - - if (!await this.chain.isMainChain(entry)) - return null; - - return entry.toRaw(); - }); - - socket.hook('get hashes', async (...args) => { - const valid = new Validator$3(args); - const start = valid.i32(0, -1); - const end = valid.i32(1, -1); - - return this.chain.getHashes(start, end); - }); - - socket.hook('add filter', (...args) => { - const valid = new Validator$3(args); - const chunks = valid.array(0); - - if (!chunks) - throw new Error('Invalid parameter.'); - - if (!socket.filter) - throw new Error('No filter set.'); - - const items = new Validator$3(chunks); - - for (let i = 0; i < chunks.length; i++) { - const data = items.buf(i); - - if (!data) - throw new Error('Bad data chunk.'); - - socket.filter.add(data); - - if (this.node.spv) - this.pool.watch(data); - } - - return null; - }); - - socket.hook('reset filter', () => { - socket.filter = null; - return null; - }); - - socket.hook('estimate fee', (...args) => { - const valid = new Validator$3(args); - const blocks = valid.u32(0); - - if (!this.fees) - return this.network.feeRate; - - return this.fees.estimateFee(blocks); - }); - - socket.hook('send', (...args) => { - const valid = new Validator$3(args); - const data = valid.buf(0); - - if (!data) - throw new Error('Invalid parameter.'); - - const tx = TX$3.fromRaw(data); - - this.node.relay(tx); - - return null; - }); - - socket.hook('rescan', (...args) => { - const valid = new Validator$3(args); - const start = valid.uintbrhash(0); - - if (start == null) - throw new Error('Invalid parameter.'); - - return this.scan(socket, start); - }); - } - - /** - * Bind to chain events. - * @private - */ - - initSockets() { - const pool = this.mempool || this.pool; - - this.chain.on('connect', (entry, block, view) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - const raw = entry.toRaw(); - - this.to('chain', 'chain connect', raw); - - for (const socket of sockets) { - const txs = this.filterBlock(socket, block); - socket.fire('block connect', raw, txs); - } - }); - - this.chain.on('disconnect', (entry, block, view) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - const raw = entry.toRaw(); - - this.to('chain', 'chain disconnect', raw); - this.to('chain', 'block disconnect', raw); - }); - - this.chain.on('reset', (tip) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - this.to('chain', 'chain reset', tip.toRaw()); - }); - - pool.on('tx', (tx) => { - const sockets = this.channel('mempool'); - - if (!sockets) - return; - - const raw = tx.toRaw(); - - for (const socket of sockets) { - if (!this.filterTX(socket, tx)) - continue; - - socket.fire('tx', raw); - } - }); - } - - /** - * Filter block by socket. - * @private - * @param {WebSocket} socket - * @param {Block} block - * @returns {TX[]} - */ - - filterBlock(socket, block) { - if (!socket.filter) - return []; - - const txs = []; - - for (const tx of block.txs) { - if (this.filterTX(socket, tx)) - txs.push(tx.toRaw()); - } - - return txs; - } - - /** - * Filter transaction by socket. - * @private - * @param {WebSocket} socket - * @param {TX} tx - * @returns {Boolean} - */ - - filterTX(socket, tx) { - if (!socket.filter) - return false; - - let found = false; - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const hash = output.getHash(); - - if (!hash) - continue; - - if (socket.filter.test(hash)) { - const prevout = Outpoint$6.fromTX(tx, i); - socket.filter.add(prevout.toRaw()); - found = true; - } - } - - if (found) - return true; - - if (!tx.isCoinbase()) { - for (const {prevout} of tx.inputs) { - if (socket.filter.test(prevout.toRaw())) - return true; - } - } - - return false; - } - - /** - * Scan using a socket's filter. - * @private - * @param {WebSocket} socket - * @param {Hash} start - * @returns {Promise} - */ - - async scan(socket, start) { - if (!socket.filter) - return null; - - await this.node.scan(start, socket.filter, (entry, txs) => { - const block = entry.toRaw(); - const raw = []; - - for (const tx of txs) - raw.push(tx.toRaw()); - - return socket.call('block rescan', block, raw); - }); - return null; - } - } - - class HTTPOptions$1 { - /** - * HTTPOptions - * @alias module:http.HTTPOptions - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network$4.primary; - this.logger = null; - this.node = null; - this.apiKey = base58$2.encode(random$2.randomBytes(20)); - this.apiHash = sha256$2.digest(Buffer.from(this.apiKey, 'ascii')); - this.noAuth = false; - this.cors = false; - this.maxTxs = 100; - - this.prefix = null; - this.host = '127.0.0.1'; - this.port = 8080; - this.ssl = false; - this.keyFile = null; - this.certFile = null; - - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {HTTPOptions} - */ - - fromOptions(options) { - assert$o(options); - assert$o(options.node && typeof options.node === 'object', - 'HTTP Server requires a Node.'); - - this.node = options.node; - this.network = options.node.network; - this.logger = options.node.logger; - - this.port = this.network.rpcPort; - - if (options.logger != null) { - assert$o(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.apiKey != null) { - assert$o(typeof options.apiKey === 'string', - 'API key must be a string.'); - assert$o(options.apiKey.length <= 255, - 'API key must be under 256 bytes.'); - this.apiKey = options.apiKey; - this.apiHash = sha256$2.digest(Buffer.from(this.apiKey, 'ascii')); - } - - if (options.noAuth != null) { - assert$o(typeof options.noAuth === 'boolean'); - this.noAuth = options.noAuth; - } - - if (options.cors != null) { - assert$o(typeof options.cors === 'boolean'); - this.cors = options.cors; - } - - if (options.prefix != null) { - assert$o(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.keyFile = path$4.join(this.prefix, 'key.pem'); - this.certFile = path$4.join(this.prefix, 'cert.pem'); - } - - if (options.host != null) { - assert$o(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$o((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.ssl != null) { - assert$o(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$o(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$o(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - if (options.maxTxs != null) { - assert$o(Number.isSafeInteger(options.maxTxs)); - this.maxTxs = options.maxTxs; - } - - // Allow no-auth implicitly - // if we're listening locally. - if (!options.apiKey) { - if (this.host === '127.0.0.1' || this.host === '::1') - this.noAuth = true; - } - - return this; - } - - /** - * Instantiate http options from object. - * @param {Object} options - * @returns {HTTPOptions} - */ - - static fromOptions(options) { - return new HTTPOptions$1().fromOptions(options); - } - } - - /* - * Helpers - */ - - function enforce$1(value, msg) { - if (!value) { - const err = new Error(msg); - err.statusCode = 400; - throw err; - } - } - - /* - * Expose - */ - - var http$1 = HTTP$4; - - /*! - * rpc.js - bitcoind-compatible json rpc for bcoin. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$n = assert_1$g; - const bweb$1 = bweb$2; - const {Lock: Lock$4} = bmutex; - const IP = binet$2; - const Validator$2 = bval; - const {BufferMap: BufferMap$2, BufferSet: BufferSet$3} = bufferMap; - const hash160$1 = hash160$9.exports; - const {safeEqual: safeEqual$3} = safe; - const secp256k1$2 = secp256k1$b.exports; - const util$5 = util$y; - const messageUtil$1 = message; - const common$7 = common$m; - const Amount$2 = amount; - const NetAddress = netaddress; - const Script$8 = script$2; - const Address$6 = address$1; - const Block$4 = block$1; - const Headers = headers; - const Input = input; - const KeyRing$3 = keyring; - const MerkleBlock$1 = merkleblock; - const MTX$4 = mtx$1.exports; - const Network$3 = network; - const Outpoint$5 = outpoint; - const Output$2 = output; - const TX$2 = tx; - const consensus$5 = consensus$s; - const pkg$2 = pkg$4; - const RPCBase$1 = bweb$1.RPC; - const RPCError$1 = bweb$1.RPCError; - - /* - * Constants - */ - - const errs$1 = { - // Standard JSON-RPC 2.0 errors - INVALID_REQUEST: bweb$1.errors.INVALID_REQUEST, - METHOD_NOT_FOUND: bweb$1.errors.METHOD_NOT_FOUND, - INVALID_PARAMS: bweb$1.errors.INVALID_PARAMS, - INTERNAL_ERROR: bweb$1.errors.INTERNAL_ERROR, - PARSE_ERROR: bweb$1.errors.PARSE_ERROR, - - // General application defined errors - MISC_ERROR: -1, - FORBIDDEN_BY_SAFE_MODE: -2, - TYPE_ERROR: -3, - INVALID_ADDRESS_OR_KEY: -5, - OUT_OF_MEMORY: -7, - INVALID_PARAMETER: -8, - DATABASE_ERROR: -20, - DESERIALIZATION_ERROR: -22, - VERIFY_ERROR: -25, - VERIFY_REJECTED: -26, - VERIFY_ALREADY_IN_CHAIN: -27, - IN_WARMUP: -28, - - // P2P client errors - CLIENT_NOT_CONNECTED: -9, - CLIENT_IN_INITIAL_DOWNLOAD: -10, - CLIENT_NODE_ALREADY_ADDED: -23, - CLIENT_NODE_NOT_ADDED: -24, - CLIENT_NODE_NOT_CONNECTED: -29, - CLIENT_INVALID_IP_OR_SUBNET: -30, - CLIENT_P2P_DISABLED: -31 - }; - - /** - * Bitcoin RPC - * @alias module:http.RPC - * @extends bweb.RPC - */ - - class RPC$4 extends RPCBase$1 { - /** - * Create RPC. - * @param {Node} node - */ - - constructor(node) { - super(); - - assert$n(node, 'RPC requires a Node.'); - - this.node = node; - this.network = node.network; - this.workers = node.workers; - this.chain = node.chain; - this.mempool = node.mempool; - this.pool = node.pool; - this.fees = node.fees; - this.miner = node.miner; - this.logger = node.logger.context('node-rpc'); - this.locker = new Lock$4(); - - this.mining = false; - this.procLimit = 0; - this.attempt = null; - this.lastActivity = 0; - this.boundChain = false; - this.nonce1 = 0; - this.nonce2 = 0; - this.merkleMap = new BufferMap$2(); - this.pollers = []; - - this.init(); - } - - getCode(err) { - switch (err.type) { - case 'RPCError': - return err.code; - case 'ValidationError': - return errs$1.TYPE_ERROR; - case 'EncodingError': - return errs$1.DESERIALIZATION_ERROR; - default: - return errs$1.INTERNAL_ERROR; - } - } - - handleCall(cmd, query) { - if (cmd.method !== 'getwork' - && cmd.method !== 'getblocktemplate' - && cmd.method !== 'getbestblockhash') { - this.logger.debug('Handling RPC call: %s.', cmd.method); - if (cmd.method !== 'submitblock' - && cmd.method !== 'getmemorypool') { - this.logger.debug(cmd.params); - } - } - - if (cmd.method === 'getwork') { - if (query.longpoll) - cmd.method = 'getworklp'; - } - } - - init() { - this.add('stop', this.stop); - this.add('help', this.help); - - this.add('getblockchaininfo', this.getBlockchainInfo); - this.add('getbestblockhash', this.getBestBlockHash); - this.add('getblockcount', this.getBlockCount); - this.add('getblock', this.getBlock); - this.add('getblockbyheight', this.getBlockByHeight); - this.add('getblockhash', this.getBlockHash); - this.add('getblockheader', this.getBlockHeader); - this.add('getblockfilter', this.getBlockFilter); - this.add('getchaintips', this.getChainTips); - this.add('getdifficulty', this.getDifficulty); - this.add('getmempoolancestors', this.getMempoolAncestors); - this.add('getmempooldescendants', this.getMempoolDescendants); - this.add('getmempoolentry', this.getMempoolEntry); - this.add('getmempoolinfo', this.getMempoolInfo); - this.add('getrawmempool', this.getRawMempool); - this.add('gettxout', this.getTXOut); - this.add('gettxoutsetinfo', this.getTXOutSetInfo); - this.add('pruneblockchain', this.pruneBlockchain); - this.add('verifychain', this.verifyChain); - - this.add('invalidateblock', this.invalidateBlock); - this.add('reconsiderblock', this.reconsiderBlock); - - this.add('getnetworkhashps', this.getNetworkHashPS); - this.add('getmininginfo', this.getMiningInfo); - this.add('prioritisetransaction', this.prioritiseTransaction); - this.add('getwork', this.getWork); - this.add('getworklp', this.getWorkLongpoll); - this.add('getblocktemplate', this.getBlockTemplate); - this.add('submitblock', this.submitBlock); - this.add('verifyblock', this.verifyBlock); - - this.add('setgenerate', this.setGenerate); - this.add('getgenerate', this.getGenerate); - this.add('generate', this.generate); - this.add('generatetoaddress', this.generateToAddress); - - this.add('estimatefee', this.estimateFee); - this.add('estimatepriority', this.estimatePriority); - this.add('estimatesmartfee', this.estimateSmartFee); - this.add('estimatesmartpriority', this.estimateSmartPriority); - - this.add('getinfo', this.getInfo); - this.add('validateaddress', this.validateAddress); - this.add('createmultisig', this.createMultisig); - this.add('createwitnessaddress', this.createWitnessAddress); - this.add('verifymessage', this.verifyMessage); - this.add('signmessagewithprivkey', this.signMessageWithPrivkey); - - this.add('setmocktime', this.setMockTime); - - this.add('getconnectioncount', this.getConnectionCount); - this.add('ping', this.ping); - this.add('getpeerinfo', this.getPeerInfo); - this.add('addnode', this.addNode); - this.add('disconnectnode', this.disconnectNode); - this.add('getaddednodeinfo', this.getAddedNodeInfo); - this.add('getnettotals', this.getNetTotals); - this.add('getnetworkinfo', this.getNetworkInfo); - this.add('setban', this.setBan); - this.add('listbanned', this.listBanned); - this.add('clearbanned', this.clearBanned); - - this.add('getrawtransaction', this.getRawTransaction); - this.add('createrawtransaction', this.createRawTransaction); - this.add('decoderawtransaction', this.decodeRawTransaction); - this.add('decodescript', this.decodeScript); - this.add('sendrawtransaction', this.sendRawTransaction); - this.add('signrawtransaction', this.signRawTransaction); - - this.add('gettxoutproof', this.getTXOutProof); - this.add('verifytxoutproof', this.verifyTXOutProof); - - this.add('getmemoryinfo', this.getMemoryInfo); - this.add('setloglevel', this.setLogLevel); - } - - /* - * Overall control/query calls - */ - - async getInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getinfo'); - - return { - version: pkg$2.version, - protocolversion: this.pool.options.version, - walletversion: 0, - balance: 0, - blocks: this.chain.height, - timeoffset: this.network.time.offset, - connections: this.pool.peers.size(), - proxy: '', - difficulty: toDifficulty(this.chain.tip.bits), - testnet: this.network !== Network$3.main, - keypoololdest: 0, - keypoolsize: 0, - unlocked_until: 0, - paytxfee: Amount$2.btc(this.network.feeRate, true), - relayfee: Amount$2.btc(this.network.minRelay, true), - errors: '' - }; - } - - async help(args, _help) { - if (args.length === 0) - return `Select a command:\n${Object.keys(this.calls).join('\n')}`; - - const json = { - method: args[0], - params: [] - }; - - return await this.execute(json, true); - } - - async stop(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'stop'); - - this.node.close().catch((err) => { - setImmediate(() => { - throw err; - }); - }); - - return 'Stopping.'; - } - - /* - * P2P networking - */ - - async getNetworkInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnetworkinfo'); - - const hosts = this.pool.hosts; - const locals = []; - - for (const local of hosts.local.values()) { - locals.push({ - address: local.addr.host, - port: local.addr.port, - score: local.score - }); - } - - return { - version: pkg$2.version, - subversion: this.pool.options.agent, - protocolversion: this.pool.options.version, - localservices: hex32(this.pool.options.services), - localservicenames: this.pool.getServiceNames(), - localrelay: !this.pool.options.noRelay, - timeoffset: this.network.time.offset, - networkactive: this.pool.connected, - connections: this.pool.peers.size(), - networks: [], - relayfee: Amount$2.btc(this.network.minRelay, true), - incrementalfee: 0, - localaddresses: locals, - warnings: '' - }; - } - - async addNode(args, help) { - if (help || args.length !== 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'addnode "node" "add|remove|onetry"'); - - const valid = new Validator$2(args); - const node = valid.str(0, ''); - const cmd = valid.str(1, ''); - - switch (cmd) { - case 'add': { - this.pool.hosts.addNode(node); - } - case 'onetry': { - const addr = parseNetAddress(node, this.network); - - if (!this.pool.peers.get(addr.hostname)) { - const peer = this.pool.createOutbound(addr); - this.pool.peers.add(peer); - } - - break; - } - case 'remove': { - this.pool.hosts.removeNode(node); - break; - } - } - - return null; - } - - async disconnectNode(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'disconnectnode "node"'); - - const valid = new Validator$2(args); - const str = valid.str(0, ''); - - const addr = parseIP(str, this.network); - const peer = this.pool.peers.get(addr.hostname); - - if (peer) - peer.destroy(); - - return null; - } - - async getAddedNodeInfo(args, help) { - if (help || args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getaddednodeinfo ( "node" )'); - - const hosts = this.pool.hosts; - const valid = new Validator$2(args); - const addr = valid.str(0, ''); - - let target; - if (args.length === 1) - target = parseIP(addr, this.network); - - const result = []; - - for (const node of hosts.nodes) { - if (target) { - if (node.host !== target.host) - continue; - - if (node.port !== target.port) - continue; - } - - const peer = this.pool.peers.get(node.hostname); - - if (!peer || !peer.connected) { - result.push({ - addednode: node.hostname, - connected: false, - addresses: [] - }); - continue; - } - - result.push({ - addednode: node.hostname, - connected: peer.connected, - addresses: [ - { - address: peer.hostname(), - connected: peer.outbound - ? 'outbound' - : 'inbound' - } - ] - }); - } - - if (target && result.length === 0) { - throw new RPCError$1(errs$1.CLIENT_NODE_NOT_ADDED, - 'Node has not been added.'); - } - - return result; - } - - async getConnectionCount(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getconnectioncount'); - - return this.pool.peers.size(); - } - - async getNetTotals(args, help) { - let sent = 0; - let recv = 0; - - if (help || args.length > 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnettotals'); - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) { - sent += peer.socket.bytesWritten; - recv += peer.socket.bytesRead; - } - - return { - totalbytesrecv: recv, - totalbytessent: sent, - timemillis: Date.now() - }; - } - - async getPeerInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getpeerinfo'); - - const peers = []; - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) { - const offset = this.network.time.known.get(peer.hostname()) || 0; - const hashes = []; - - for (const hash in peer.blockMap.keys()) { - const str = util$5.revHex(hash); - hashes.push(str); - } - - peer.getName(); - - peers.push({ - id: peer.id, - addr: peer.hostname(), - addrlocal: !peer.local.isNull() - ? peer.local.hostname - : undefined, - name: peer.name || undefined, - services: hex32(peer.services), - servicenames: peer.getServiceNames(), - relaytxes: !peer.noRelay, - lastsend: peer.lastSend / 1000 | 0, - lastrecv: peer.lastRecv / 1000 | 0, - bytessent: peer.socket.bytesWritten, - bytesrecv: peer.socket.bytesRead, - conntime: peer.time !== 0 ? (Date.now() - peer.time) / 1000 | 0 : 0, - timeoffset: offset, - pingtime: peer.lastPong !== -1 - ? (peer.lastPong - peer.lastPing) / 1000 - : -1, - minping: peer.minPing !== -1 ? peer.minPing / 1000 : -1, - version: peer.version, - subver: peer.agent, - inbound: !peer.outbound, - startingheight: peer.height, - besthash: peer.bestHash ? util$5.revHex(peer.bestHash) : null, - bestheight: peer.bestHeight, - banscore: peer.banScore, - inflight: hashes, - whitelisted: false - }); - } - - return peers; - } - - async ping(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'ping'); - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) - peer.sendPing(); - - return null; - } - - async setBan(args, help) { - const valid = new Validator$2(args); - const str = valid.str(0, ''); - const action = valid.str(1, ''); - - if (help - || args.length < 2 - || (action !== 'add' && action !== 'remove')) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'setban "ip(/netmask)" "add|remove" (bantime) (absolute)'); - } - - const addr = parseNetAddress(str, this.network); - - switch (action) { - case 'add': - this.pool.ban(addr); - break; - case 'remove': - this.pool.unban(addr); - break; - } - - return null; - } - - async listBanned(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'listbanned'); - - const banned = []; - - for (const [host, time] of this.pool.hosts.banned) { - banned.push({ - address: host, - banned_until: time + this.pool.options.banTime, - ban_created: time, - ban_reason: '' - }); - } - - return banned; - } - - async clearBanned(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'clearbanned'); - - this.pool.hosts.clearBanned(); - - return null; - } - - /* Block chain and UTXO */ - async getBlockchainInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockchaininfo'); - - return { - chain: this.network.type !== 'testnet' - ? this.network.type - : 'test', - blocks: this.chain.height, - headers: this.chain.height, - bestblockhash: this.chain.tip.rhash(), - difficulty: toDifficulty(this.chain.tip.bits), - mediantime: await this.chain.getMedianTime(this.chain.tip), - verificationprogress: this.chain.getProgress(), - chainwork: this.chain.tip.chainwork.toString('hex', 64), - pruned: this.chain.options.prune, - softforks: this.getSoftforks(), - bip9_softforks: await this.getBIP9Softforks(), - pruneheight: this.chain.options.prune - ? Math.max(0, this.chain.height - this.network.block.keepBlocks) - : null - }; - } - - async getBestBlockHash(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getbestblockhash'); - - return this.chain.tip.rhash(); - } - - async getBlockCount(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockcount'); - - return this.chain.tip.height; - } - - async getBlock(args, help) { - if (help || args.length < 1 || args.length > 3) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblock "hash" ( verbose )'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, true); - const details = valid.bool(2, false); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - const block = await this.chain.getBlock(entry.hash); - - if (!block) { - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not available (spv mode)'); - - if (this.chain.options.prune) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Block not available (pruned data)'); - } - - throw new RPCError$1(errs$1.MISC_ERROR, 'Can\'t read block from disk'); - } - - if (!verbose) - return block.toRaw().toString('hex'); - - return await this.blockToJSON(entry, block, details); - } - - async getBlockByHeight(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getblockbyheight "height" ( verbose )'); - } - - const valid = new Validator$2(args); - const height = valid.u32(0, -1); - const verbose = valid.bool(1, true); - const details = valid.bool(2, false); - - if (height === -1) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block height.'); - - const entry = await this.chain.getEntry(height); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - const block = await this.chain.getBlock(entry.hash); - - if (!block) { - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not available (spv mode)'); - - if (this.chain.options.prune) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Block not available (pruned data)'); - } - - throw new RPCError$1(errs$1.DATABASE_ERROR, 'Can\'t read block from disk'); - } - - if (!verbose) - return block.toRaw().toString('hex'); - - return await this.blockToJSON(entry, block, details); - } - - async getBlockHash(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockhash index'); - - const valid = new Validator$2(args); - const height = valid.u32(0); - - if (height == null || height > this.chain.height) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Block height out of range.'); - - const hash = await this.chain.getHash(height); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Not found.'); - - return util$5.revHex(hash); - } - - async getBlockHeader(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockheader "hash" ( verbose )'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, true); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Invalid block hash.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - if (!verbose) - return entry.toRaw().toString('hex', 0, 80); - - return await this.headerToJSON(entry); - } - - async getBlockFilter(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockfilter "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Invalid block hash.'); - - const filter = await this.node.getBlockFilter(hash); - - if (!filter) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block filter not found.'); - - return filter.toJSON(); - } - - async getChainTips(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getchaintips'); - - const tips = await this.chain.getTips(); - const result = []; - - for (const hash of tips) { - const entry = await this.chain.getEntry(hash); - - assert$n(entry); - - const fork = await this.findFork(entry); - const main = await this.chain.isMainChain(entry); - - result.push({ - height: entry.height, - hash: entry.rhash(), - branchlen: entry.height - fork.height, - status: main ? 'active' : 'valid-headers' - }); - } - - return result; - } - - async getDifficulty(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getdifficulty'); - - return toDifficulty(this.chain.tip.bits); - } - - async getMempoolInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolinfo'); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - return { - size: this.mempool.map.size, - bytes: this.mempool.getSize(), - usage: this.mempool.getSize(), - maxmempool: this.mempool.options.maxSize, - mempoolminfee: Amount$2.btc(this.mempool.options.minRelay, true) - }; - } - - async getMempoolAncestors(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolancestors txid (verbose)'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - const entries = this.mempool.getAncestors(entry); - const out = []; - - if (verbose) { - for (const entry of entries) - out.push(this.entryToJSON(entry)); - } else { - for (const entry of entries) - out.push(entry.txid()); - } - - return out; - } - - async getMempoolDescendants(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getmempooldescendants txid (verbose)'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - const entries = this.mempool.getDescendants(entry); - const out = []; - - if (verbose) { - for (const entry of entries) - out.push(this.entryToJSON(entry)); - } else { - for (const entry of entries) - out.push(entry.txid()); - } - - return out; - } - - async getMempoolEntry(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolentry txid'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - return this.entryToJSON(entry); - } - - async getRawMempool(args, help) { - if (help || args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getrawmempool ( verbose )'); - - const valid = new Validator$2(args); - const verbose = valid.bool(0, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (verbose) { - const out = {}; - - for (const entry of this.mempool.map.values()) - out[entry.txid()] = this.entryToJSON(entry); - - return out; - } - - const hashes = this.mempool.getSnapshot(); - - return hashes.map(util$5.revHex); - } - - async getTXOut(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'gettxout "txid" n ( includemempool )'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const index = valid.u32(1); - const mempool = valid.bool(2, true); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins when pruned.'); - - if (!hash || index == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid outpoint.'); - - let coin; - if (mempool) { - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - coin = this.mempool.getCoin(hash, index); - } - - if (!coin) - coin = await this.chain.getCoin(hash, index); - - if (!coin) - return null; - - return { - bestblock: this.chain.tip.rhash(), - confirmations: coin.getDepth(this.chain.height), - value: Amount$2.btc(coin.value, true), - scriptPubKey: this.scriptToJSON(coin.script, true), - version: coin.version, - coinbase: coin.coinbase - }; - } - - async getTXOutProof(args, help) { - if (help || (args.length !== 1 && args.length !== 2)) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'gettxoutproof ["txid",...] ( blockhash )'); - } - - const valid = new Validator$2(args); - const txids = valid.array(0); - const hash = valid.brhash(1); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins when pruned.'); - - if (!txids || txids.length === 0) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid TXIDs.'); - - const items = new Validator$2(txids); - const set = new BufferSet$3(); - const hashes = []; - - let last = null; - - for (let i = 0; i < txids.length; i++) { - const hash = items.brhash(i); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - if (set.has(hash)) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Duplicate txid.'); - - set.add(hash); - hashes.push(hash); - - last = hash; - } - - let block = null; - - if (hash) { - block = await this.chain.getBlock(hash); - } else if (await this.node.hasTX(last)) { - const tx = await this.node.getMeta(last); - if (tx) - block = await this.chain.getBlock(tx.block); - } else { - const coin = await this.chain.getCoin(last, 0); - if (coin) - block = await this.chain.getBlock(coin.height); - } - - if (!block) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - for (const hash of hashes) { - if (!block.hasTX(hash)) { - throw new RPCError$1(errs$1.VERIFY_ERROR, - 'Block does not contain all txids.'); - } - } - - block = MerkleBlock$1.fromHashes(block, hashes); - - return block.toRaw().toString('hex'); - } - - async verifyTXOutProof(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'verifytxoutproof "proof"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const block = MerkleBlock$1.fromRaw(data); - - if (!block.verify()) - return []; - - const entry = await this.chain.getEntry(block.hash()); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found in chain.'); - - const tree = block.getTree(); - const out = []; - - for (const hash of tree.matches) - out.push(util$5.revHex(hash)); - - return out; - } - - async getTXOutSetInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'gettxoutsetinfo'); - - if (this.chain.options.spv) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Chainstate not available (SPV mode).'); - } - - return { - height: this.chain.height, - bestblock: this.chain.tip.rhash(), - transactions: this.chain.db.state.tx, - txouts: this.chain.db.state.coin, - bytes_serialized: 0, - hash_serialized: 0, - total_amount: Amount$2.btc(this.chain.db.state.value, true) - }; - } - - async pruneBlockchain(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'pruneblockchain'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot prune chain in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Chain is already pruned.'); - - if (this.chain.height < this.network.block.pruneAfterHeight) - throw new RPCError$1(errs$1.MISC_ERROR, 'Chain is too short for pruning.'); - - try { - await this.chain.prune(); - } catch (e) { - throw new RPCError$1(errs$1.DATABASE_ERROR, e.message); - } - } - - async verifyChain(args, help) { - if (help || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'verifychain ( checklevel numblocks )'); - } - - const valid = new Validator$2(args); - const level = valid.u32(0); - const blocks = valid.u32(1); - - if (level == null || blocks == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Missing parameters.'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify chain in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify chain when pruned.'); - - return null; - } - - /* - * Mining - */ - - async submitWork(data) { - const unlock = await this.locker.lock(); - try { - return await this._submitWork(data); - } finally { - unlock(); - } - } - - async _submitWork(data) { - const attempt = this.attempt; - - if (!attempt) - return false; - - if (data.length !== 128) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid work size.'); - - const raw = data.slice(0, 80); - swap32(raw); - - const header = Headers.fromHead(raw); - - if (header.prevBlock !== attempt.prevBlock - || header.bits !== attempt.bits) { - return false; - } - - if (!header.verify()) - return false; - - const nonces = this.merkleMap.get(header.merkleRoot); - - if (!nonces) - return false; - - const [n1, n2] = nonces; - const nonce = header.nonce; - const time = header.time; - - const proof = attempt.getProof(n1, n2, time, nonce); - - if (!proof.verify(attempt.target)) - return false; - - const block = attempt.commit(proof); - - let entry; - try { - entry = await this.chain.add(block); - } catch (err) { - if (err.type === 'VerifyError') { - this.logger.warning('RPC block rejected: %h (%s).', - block.hash(), err.reason); - return false; - } - throw err; - } - - if (!entry) { - this.logger.warning('RPC block rejected: %h (bad-prevblk).', - block.hash()); - return false; - } - - return true; - } - - async createWork(data) { - const unlock = await this.locker.lock(); - try { - return await this._createWork(data); - } finally { - unlock(); - } - } - - async _createWork() { - const attempt = await this.updateWork(); - const n1 = this.nonce1; - const n2 = this.nonce2; - const time = attempt.time; - - const data = Buffer.allocUnsafe(128); - data.fill(0); - - const root = attempt.getRoot(n1, n2); - const head = attempt.getHeader(root, time, 0); - - head.copy(data, 0); - - data[80] = 0x80; - data.writeUInt32BE(80 * 8, data.length - 4, true); - - swap32(data); - - return { - data: data.toString('hex'), - target: attempt.target.toString('hex'), - height: attempt.height - }; - } - - async getWorkLongpoll(args, help) { - await this.longpoll(); - return await this.createWork(); - } - - async getWork(args, help) { - if (args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getwork ( "data" )'); - - if (args.length === 1) { - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid work data.'); - - return await this.submitWork(data); - } - - return await this.createWork(); - } - - async submitBlock(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'submitblock "hexdata" ( "jsonparametersobject" )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - - const block = Block$4.fromRaw(data); - - return await this.addBlock(block); - } - - async getBlockTemplate(args, help) { - if (help || args.length > 1) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getblocktemplate ( "jsonrequestobject" )'); - } - - const validator = new Validator$2(args); - const options = validator.obj(0, {}); - const valid = new Validator$2(options); - const mode = valid.str('mode', 'template'); - - if (mode !== 'template' && mode !== 'proposal') - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid mode.'); - - if (mode === 'proposal') { - const data = valid.buf('data'); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Missing data parameter.'); - - const block = Block$4.fromRaw(data); - - if (!block.prevBlock.equals(this.chain.tip.hash)) - return 'inconclusive-not-best-prevblk'; - - try { - await this.chain.verifyBlock(block); - } catch (e) { - if (e.type === 'VerifyError') - return e.reason; - throw e; - } - - return null; - } - - let maxVersion = valid.u32('maxversion', -1); - let rules = valid.array('rules'); - - if (rules) - maxVersion = -1; - - const capabilities = valid.array('capabilities'); - let coinbase = false; - - if (capabilities) { - let txnCap = false; - let valueCap = false; - - for (const capability of capabilities) { - if (typeof capability !== 'string') - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid capability.'); - - switch (capability) { - case 'coinbasetxn': - txnCap = true; - break; - case 'coinbasevalue': - // Prefer value if they support it. - valueCap = true; - break; - } - } - - // BIP22 states that we can't have coinbasetxn - // _and_ coinbasevalue in the same template. - // The problem is, many clients _say_ they - // support coinbasetxn when they don't (ckpool). - // To make matters worse, some clients will - // parse an undefined `coinbasevalue` as zero. - // Because of all of this, coinbasetxn is - // disabled for now. - valueCap = true; - - if (txnCap && !valueCap) { - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - coinbase = true; - } - } - - if (!this.network.selfConnect) { - if (this.pool.peers.size() === 0) { - throw new RPCError$1(errs$1.CLIENT_NOT_CONNECTED, - 'Bitcoin is not connected!'); - } - - if (!this.chain.synced) { - throw new RPCError$1(errs$1.CLIENT_IN_INITIAL_DOWNLOAD, - 'Bitcoin is downloading blocks...'); - } - } - - const lpid = valid.str('longpollid'); - - if (lpid) - await this.handleLongpoll(lpid); - - if (!rules) - rules = []; - - return await this.createTemplate(maxVersion, coinbase, rules); - } - - async createTemplate(maxVersion, coinbase, rules) { - const unlock = await this.locker.lock(); - try { - return await this._createTemplate(maxVersion, coinbase, rules); - } finally { - unlock(); - } - } - - async _createTemplate(maxVersion, coinbase, rules) { - const attempt = await this.getTemplate(); - const scale = attempt.witness ? 1 : consensus$5.WITNESS_SCALE_FACTOR; - - // Default mutable fields. - const mutable = ['time', 'transactions', 'prevblock']; - - // The miner doesn't support - // versionbits. Force them to - // encode our version. - if (maxVersion >= 2) - mutable.push('version/force'); - - // Allow the miner to change - // our provided coinbase. - // Note that these are implied - // without `coinbasetxn`. - if (coinbase) { - mutable.push('coinbase'); - mutable.push('coinbase/append'); - mutable.push('generation'); - } - - // Build an index of every transaction. - const index = new BufferMap$2(); - for (let i = 0; i < attempt.items.length; i++) { - const entry = attempt.items[i]; - index.set(entry.hash, i + 1); - } - - // Calculate dependencies for each transaction. - const txs = []; - for (let i = 0; i < attempt.items.length; i++) { - const entry = attempt.items[i]; - const tx = entry.tx; - const deps = []; - - for (let j = 0; j < tx.inputs.length; j++) { - const input = tx.inputs[j]; - const dep = index.get(input.prevout.hash); - - if (dep == null) - continue; - - if (deps.indexOf(dep) === -1) { - assert$n(dep < i + 1); - deps.push(dep); - } - } - - txs.push({ - data: tx.toRaw().toString('hex'), - txid: tx.txid(), - hash: tx.wtxid(), - depends: deps, - fee: entry.fee, - sigops: entry.sigops / scale | 0, - weight: tx.getWeight() - }); - } - - if (this.chain.options.bip91) { - rules.push('segwit'); - rules.push('segsignal'); - } - - if (this.chain.options.bip148) - rules.push('segwit'); - - // Calculate version based on given rules. - let version = attempt.version; - const vbavailable = {}; - const vbrules = []; - - for (const deploy of this.network.deploys) { - const state = await this.chain.getState(this.chain.tip, deploy); - let name = deploy.name; - - switch (state) { - case common$7.thresholdStates.DEFINED: - case common$7.thresholdStates.FAILED: - break; - case common$7.thresholdStates.LOCKED_IN: - version |= 1 << deploy.bit; - case common$7.thresholdStates.STARTED: - if (!deploy.force) { - if (rules.indexOf(name) === -1) - version &= ~(1 << deploy.bit); - if (deploy.required) - name = '!' + name; - } - vbavailable[name] = deploy.bit; - break; - case common$7.thresholdStates.ACTIVE: - if (!deploy.force && deploy.required) { - if (rules.indexOf(name) === -1) { - throw new RPCError$1(errs$1.INVALID_PARAMETER, - `Client must support ${name}.`); - } - name = '!' + name; - } - vbrules.push(name); - break; - default: - assert$n(false, 'Bad state.'); - break; - } - } - - version >>>= 0; - - const json = { - capabilities: ['proposal'], - mutable: mutable, - version: version, - rules: vbrules, - vbavailable: vbavailable, - vbrequired: 0, - height: attempt.height, - previousblockhash: util$5.revHex(attempt.prevBlock), - target: util$5.revHex(attempt.target), - bits: hex32(attempt.bits), - noncerange: '00000000ffffffff', - curtime: attempt.time, - mintime: attempt.mtp + 1, - maxtime: attempt.time + 7200, - expires: attempt.time + 7200, - sigoplimit: consensus$5.MAX_BLOCK_SIGOPS_COST / scale | 0, - sizelimit: consensus$5.MAX_BLOCK_SIZE, - weightlimit: undefined, - longpollid: this.chain.tip.rhash() + hex32(this.totalTX()), - submitold: false, - coinbaseaux: { - flags: attempt.coinbaseFlags.toString('hex') - }, - coinbasevalue: undefined, - coinbasetxn: undefined, - default_witness_commitment: undefined, - transactions: txs - }; - - // See: - // bitcoin/bitcoin#9fc7f0bce94f1cea0239b1543227f22a3f3b9274 - if (attempt.witness) { - json.sizelimit = consensus$5.MAX_RAW_BLOCK_SIZE; - json.weightlimit = consensus$5.MAX_BLOCK_WEIGHT; - } - - // The client wants a coinbasetxn - // instead of a coinbasevalue. - if (coinbase) { - const tx = attempt.toCoinbase(); - const input = tx.inputs[0]; - - // Pop off the nonces. - input.script.pop(); - input.script.compile(); - - if (attempt.witness) { - // We don't include the commitment - // output (see bip145). - const output = tx.outputs.pop(); - assert$n(output.script.isCommitment()); - - // Also not including the witness nonce. - input.witness.clear(); - } - - tx.refresh(); - - json.coinbasetxn = { - data: tx.toRaw().toString('hex'), - txid: tx.txid(), - hash: tx.wtxid(), - depends: [], - fee: 0, - sigops: tx.getSigopsCost() / scale | 0, - weight: tx.getWeight() - }; - } else { - json.coinbasevalue = attempt.getReward(); - } - - if (rules.indexOf('segwit') !== -1) - json.default_witness_commitment = attempt.getWitnessScript().toJSON(); - - return json; - } - - async getMiningInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmininginfo'); - - const attempt = this.attempt; - - let size = 0; - let weight = 0; - let txs = 0; - let diff = 0; - - if (attempt) { - weight = attempt.weight; - txs = attempt.items.length + 1; - diff = attempt.getDifficulty(); - size = 1000; - for (const item of attempt.items) - size += item.tx.getBaseSize(); - } - - return { - blocks: this.chain.height, - currentblocksize: size, - currentblockweight: weight, - currentblocktx: txs, - difficulty: diff, - errors: '', - genproclimit: this.procLimit, - networkhashps: await this.getHashRate(120), - pooledtx: this.totalTX(), - testnet: this.network !== Network$3.main, - chain: this.network.type !== 'testnet' - ? this.network.type - : 'test', - generate: this.mining - }; - } - - async getNetworkHashPS(args, help) { - if (help || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnetworkhashps ( blocks height )'); - - const valid = new Validator$2(args); - const lookup = valid.u32(0, 120); - const height = valid.u32(1); - - return await this.getHashRate(lookup, height); - } - - async prioritiseTransaction(args, help) { - if (help || args.length !== 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'prioritisetransaction '); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const pri = valid.i64(1); - const fee = valid.i64(2); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID'); - - if (pri == null || fee == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid fee or priority.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - this.mempool.prioritise(entry, pri, fee); - - return true; - } - - async verifyBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'verifyblock "block-hex"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hex.'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify block in SPV mode.'); - - const block = Block$4.fromRaw(data); - - try { - await this.chain.verifyBlock(block); - } catch (e) { - if (e.type === 'VerifyError') - return e.reason; - throw e; - } - - return null; - } - - /* - * Coin generation - */ - - async getGenerate(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getgenerate'); - return this.mining; - } - - async setGenerate(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'setgenerate mine ( proclimit )'); - - const valid = new Validator$2(args); - const mine = valid.bool(0, false); - const limit = valid.u32(1, 0); - - if (mine && this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - this.mining = mine; - this.procLimit = limit; - - if (mine) { - this.miner.cpu.start(); - return true; - } - - await this.miner.cpu.stop(); - - return false; - } - - async generate(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'generate numblocks ( maxtries )'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - const tries = valid.u32(1); - - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - return await this.mineBlocks(blocks, null, tries); - } - - async generateToAddress(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'generatetoaddress numblocks address ( maxtries )'); - } - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - const str = valid.str(1, ''); - const tries = valid.u32(2); - - const addr = parseAddress$1(str, this.network); - - return await this.mineBlocks(blocks, addr, tries); - } - - /* - * Raw transactions - */ - - async createRawTransaction(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'createrawtransaction' - + ' [{"txid":"id","vout":n},...]' - + ' {"address":amount,"data":"hex",...}' - + ' ( locktime )'); - } - - const valid = new Validator$2(args); - const inputs = valid.array(0); - const sendTo = valid.obj(1); - const locktime = valid.u32(2); - - if (!inputs || !sendTo) { - throw new RPCError$1(errs$1.TYPE_ERROR, - 'Invalid parameters (inputs and sendTo).'); - } - - const tx = new MTX$4(); - - if (locktime != null) - tx.locktime = locktime; - - for (const obj of inputs) { - const valid = new Validator$2(obj); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - let sequence = valid.u32('sequence', 0xffffffff); - - if (tx.locktime) - sequence--; - - if (!hash || index == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid outpoint.'); - - const input = new Input(); - input.prevout.hash = hash; - input.prevout.index = index; - input.sequence = sequence; - - tx.inputs.push(input); - } - - const sends = new Validator$2(sendTo); - const uniq = new Set(); - - for (const key of Object.keys(sendTo)) { - if (key === 'data') { - const value = sends.buf(key); - - if (!value) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid nulldata..'); - - const output = new Output$2(); - output.value = 0; - output.script.fromNulldata(value); - tx.outputs.push(output); - - continue; - } - - const addr = parseAddress$1(key, this.network); - const b58 = addr.toString(this.network); - - if (uniq.has(b58)) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Duplicate address'); - - uniq.add(b58); - - const value = sends.ufixed(key, 8); - - if (value == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid output value.'); - - const output = new Output$2(); - output.value = value; - output.script.fromAddress(addr); - - tx.outputs.push(output); - } - - return tx.toRaw().toString('hex'); - } - - async decodeRawTransaction(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'decoderawtransaction "hexstring"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const tx = TX$2.fromRaw(data); - - return this.txToJSON(tx); - } - - async decodeScript(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'decodescript "hex"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - let script = new Script$8(); - - if (data) - script = Script$8.fromRaw(data); - - const addr = Address$6.fromScripthash(script.hash160()); - - const json = this.scriptToJSON(script); - json.p2sh = addr.toString(this.network); - - return json; - } - - async getRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getrawtransaction "txid" ( verbose )'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const meta = await this.node.getMeta(hash); - - if (!meta) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not found.'); - - const tx = meta.tx; - - if (!verbose) - return tx.toRaw().toString('hex'); - - let entry; - if (meta.block) - entry = await this.chain.getEntry(meta.block); - - const json = this.txToJSON(tx, entry); - json.time = meta.mtime; - json.hex = tx.toRaw().toString('hex'); - - return json; - } - - async sendRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'sendrawtransaction "hexstring" ( allowhighfees )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const tx = TX$2.fromRaw(data); - - this.node.relay(tx); - - return tx.txid(); - } - - async signRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 4) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'signrawtransaction' - + ' "hexstring" (' - + ' [{"txid":"id","vout":n,"scriptPubKey":"hex",' - + 'redeemScript":"hex"},...] ["privatekey1",...]' - + ' sighashtype )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - const prevout = valid.array(1); - const secrets = valid.array(2); - const sighash = valid.str(3); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - const tx = MTX$4.fromRaw(data); - tx.view = await this.mempool.getSpentView(tx); - - const map = new BufferMap$2(); - const keys = []; - - if (secrets) { - const valid = new Validator$2(secrets); - for (let i = 0; i < secrets.length; i++) { - const secret = valid.str(i, ''); - const key = parseSecret$1(secret, this.network); - map.set(key.getPublicKey(), key); - keys.push(key); - } - } - - if (prevout) { - for (const prev of prevout) { - const valid = new Validator$2(prev); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - const scriptRaw = valid.buf('scriptPubKey'); - const value = valid.ufixed('amount', 8); - const redeemRaw = valid.buf('redeemScript'); - - if (!hash || index == null || !scriptRaw || value == null) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid UTXO.'); - - const outpoint = new Outpoint$5(hash, index); - - const script = Script$8.fromRaw(scriptRaw); - const coin = Output$2.fromScript(script, value); - - tx.view.addOutput(outpoint, coin); - - if (keys.length === 0 || !redeemRaw) - continue; - - if (!script.isScripthash() && !script.isWitnessScripthash()) - continue; - - if (!redeemRaw) { - throw new RPCError$1(errs$1.INVALID_PARAMETER, - 'P2SH requires redeem script.'); - } - - const redeem = Script$8.fromRaw(redeemRaw); - - for (const op of redeem.code) { - if (!op.data) - continue; - - const key = map.get(op.data); - - if (key) { - key.script = redeem; - key.witness = script.isWitnessScripthash(); - key.refresh(); - break; - } - } - } - } - - let type = Script$8.hashType.ALL; - if (sighash) { - const parts = sighash.split('|'); - - if (parts.length < 1 || parts.length > 2) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - - type = Script$8.hashType[parts[0]]; - - if (type == null) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - - if (parts.length === 2) { - if (parts[1] !== 'ANYONECANPAY') - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - type |= Script$8.hashType.ANYONECANPAY; - } - } - - await tx.signAsync(keys, type, this.workers); - - return { - hex: tx.toRaw().toString('hex'), - complete: tx.isSigned() - }; - } - - /* - * Utility Functions - */ - - async createMultisig(args, help) { - if (help || args.length < 2 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'createmultisig nrequired ["key",...]'); - } - - const valid = new Validator$2(args); - const keys = valid.array(1, []); - const m = valid.u32(0, 0); - const n = keys.length; - - if (m < 1 || n < m || n > 16) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid m and n values.'); - - const items = new Validator$2(keys); - - for (let i = 0; i < keys.length; i++) { - const key = items.buf(i); - - if (!key) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid key.'); - - if (!secp256k1$2.publicKeyVerify(key)) - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - - keys[i] = key; - } - - const script = Script$8.fromMultisig(m, n, keys); - - if (script.getSize() > consensus$5.MAX_SCRIPT_PUSH) { - throw new RPCError$1(errs$1.VERIFY_ERROR, - 'Redeem script exceeds size limit.'); - } - - const addr = script.getAddress(); - - return { - address: addr.toString(this.network), - redeemScript: script.toJSON() - }; - } - - async createWitnessAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'createwitnessaddress "script"'); - - const valid = new Validator$2(args); - const raw = valid.buf(0); - - if (!raw) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid script hex.'); - - const script = Script$8.fromRaw(raw); - const program = script.forWitness(); - const addr = program.getAddress(); - - return { - address: addr.toString(this.network), - witnessScript: program.toJSON() - }; - } - - async validateAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'validateaddress "bitcoinaddress"'); - - const valid = new Validator$2(args); - const str = valid.str(0, ''); - - let addr; - try { - addr = Address$6.fromString(str, this.network); - } catch (e) { - return { - isvalid: false - }; - } - - const script = Script$8.fromAddress(addr); - const isWitness = addr.isProgram(); - const isScript = script.isScripthash() || script.isWitnessScripthash(); - - const result = { - isvalid: true, - address: addr.toString(this.network), - scriptPubKey: script.toJSON(), - isscript: isScript, - iswitness: isWitness - }; - - if (isWitness) { - result.witness_version = addr.version; - result.witness_program = addr.hash.toString('hex'); - } - - return result; - } - - async verifyMessage(args, help) { - if (help || args.length !== 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'verifymessage "bitcoinaddress" "signature" "message"'); - } - - const valid = new Validator$2(args); - const b58 = valid.str(0, ''); - const sig = valid.buf(1, null, 'base64'); - const str = valid.str(2); - - if (!sig || !str) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid parameters.'); - - const addr = parseAddress$1(b58, this.network); - const key = messageUtil$1.recover(str, sig); - - if (!key) - return false; - - return safeEqual$3(hash160$1.digest(key), addr.hash) === 1; - } - - async signMessageWithPrivkey(args, help) { - if (help || args.length !== 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'signmessagewithprivkey "privkey" "message"'); - } - - const valid = new Validator$2(args); - const wif = valid.str(0, ''); - const str = valid.str(1, ''); - - const key = parseSecret$1(wif, this.network); - const sig = messageUtil$1.sign(str, key); - - return sig.toString('base64'); - } - - async estimateFee(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatefee nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Fee estimation not available.'); - - const fee = this.fees.estimateFee(blocks, false); - - if (fee === 0) - return -1; - - return Amount$2.btc(fee, true); - } - - async estimatePriority(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatepriority nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Priority estimation not available.'); - - return this.fees.estimatePriority(blocks, false); - } - - async estimateSmartFee(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatesmartfee nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Fee estimation not available.'); - - let fee = this.fees.estimateFee(blocks, true); - - if (fee === 0) - fee = -1; - else - fee = Amount$2.btc(fee, true); - - return { - fee: fee, - blocks: blocks - }; - } - - async estimateSmartPriority(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatesmartpriority nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Priority estimation not available.'); - - const pri = this.fees.estimatePriority(blocks, true); - - return { - priority: pri, - blocks: blocks - }; - } - - async invalidateBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'invalidateblock "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - await this.chain.invalidate(hash); - - return null; - } - - async reconsiderBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'reconsiderblock "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - this.chain.removeInvalid(hash); - - return null; - } - - async setMockTime(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'setmocktime timestamp'); - - const valid = new Validator$2(args); - const time = valid.u32(0); - - if (time == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid timestamp.'); - - this.network.time.offset = 0; - - const delta = this.network.now() - time; - - this.network.time.offset = -delta; - - return null; - } - - async getMemoryInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmemoryinfo'); - - return this.logger.memoryUsage(); - } - - async setLogLevel(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'setloglevel "level"'); - - const valid = new Validator$2(args); - const level = valid.str(0, ''); - - this.logger.setLevel(level); - - return null; - } - - /* - * Helpers - */ - - async handleLongpoll(lpid) { - if (lpid.length !== 72) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid longpoll ID.'); - - const watched = lpid.slice(0, 64); - const lastTX = parseInt(lpid.slice(64, 72), 16); - - if ((lastTX >>> 0) !== lastTX) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid longpoll ID.'); - - const hash = util$5.revHex(watched); - - if (!this.chain.tip.hash.equals(hash)) - return; - - await this.longpoll(); - } - - longpoll() { - return new Promise((resolve, reject) => { - this.pollers.push({ resolve, reject }); - }); - } - - refreshBlock() { - const pollers = this.pollers; - - this.attempt = null; - this.lastActivity = 0; - this.merkleMap.clear(); - this.nonce1 = 0; - this.nonce2 = 0; - this.pollers = []; - - for (const job of pollers) - job.resolve(); - } - - bindChain() { - if (this.boundChain) - return; - - this.boundChain = true; - - this.node.on('connect', () => { - if (!this.attempt) - return; - - this.refreshBlock(); - }); - - if (!this.mempool) - return; - - this.node.on('tx', () => { - if (!this.attempt) - return; - - if (util$5.now() - this.lastActivity > 10) - this.refreshBlock(); - }); - } - - async getTemplate() { - this.bindChain(); - - let attempt = this.attempt; - - if (attempt) { - this.miner.updateTime(attempt); - } else { - attempt = await this.miner.createBlock(); - this.attempt = attempt; - this.lastActivity = util$5.now(); - } - - return attempt; - } - - async updateWork() { - this.bindChain(); - - let attempt = this.attempt; - - if (attempt) { - if (attempt.address.isNull()) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - this.miner.updateTime(attempt); - - if (++this.nonce2 === 0x100000000) { - this.nonce2 = 0; - this.nonce1++; - } - - const n1 = this.nonce1; - const n2 = this.nonce2; - - const root = attempt.getRoot(n1, n2); - - this.merkleMap.set(root, [n1, n2]); - - return attempt; - } - - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - attempt = await this.miner.createBlock(); - - const n1 = this.nonce1; - const n2 = this.nonce2; - - const root = attempt.getRoot(n1, n2); - - this.attempt = attempt; - this.lastActivity = util$5.now(); - this.merkleMap.set(root, [n1, n2]); - - return attempt; - } - - async addBlock(block) { - const unlock1 = await this.locker.lock(); - const unlock2 = await this.chain.locker.lock(); - try { - return await this._addBlock(block); - } finally { - unlock2(); - unlock1(); - } - } - - async _addBlock(block) { - this.logger.info('Handling submitted block: %h.', block.hash()); - - const prev = await this.chain.getEntry(block.prevBlock); - - if (prev) { - const state = await this.chain.getDeployments(block.time, prev); - - // Fix eloipool bug (witness nonce is not present). - if (state.hasWitness() && block.getCommitmentHash()) { - const tx = block.txs[0]; - const input = tx.inputs[0]; - if (!tx.hasWitness()) { - this.logger.warning('Submitted block had no witness nonce.'); - this.logger.debug(tx); - - // Recreate witness nonce (all zeroes). - input.witness.push(consensus$5.ZERO_HASH); - input.witness.compile(); - - tx.refresh(); - block.refresh(); - } - } - } - - let entry; - try { - entry = await this.chain._add(block); - } catch (err) { - if (err.type === 'VerifyError') { - this.logger.warning('RPC block rejected: %h (%s).', - block.hash(), err.reason); - return `rejected: ${err.reason}`; - } - throw err; - } - - if (!entry) { - this.logger.warning('RPC block rejected: %h (bad-prevblk).', - block.hash()); - return 'rejected: bad-prevblk'; - } - - return null; - } - - totalTX() { - return this.mempool ? this.mempool.map.size : 0; - } - - getSoftforks() { - return [ - toDeployment('bip34', 2, this.chain.state.hasBIP34()), - toDeployment('bip66', 3, this.chain.state.hasBIP66()), - toDeployment('bip65', 4, this.chain.state.hasCLTV()) - ]; - } - - async getBIP9Softforks() { - const tip = this.chain.tip; - const forks = {}; - - for (const deployment of this.network.deploys) { - const state = await this.chain.getState(tip, deployment); - let status; - - switch (state) { - case common$7.thresholdStates.DEFINED: - status = 'defined'; - break; - case common$7.thresholdStates.STARTED: - status = 'started'; - break; - case common$7.thresholdStates.LOCKED_IN: - status = 'locked_in'; - break; - case common$7.thresholdStates.ACTIVE: - status = 'active'; - break; - case common$7.thresholdStates.FAILED: - status = 'failed'; - break; - default: - assert$n(false, 'Bad state.'); - break; - } - - forks[deployment.name] = { - status: status, - bit: deployment.bit, - startTime: deployment.startTime, - timeout: deployment.timeout - }; - } - - return forks; - } - - async getHashRate(lookup, height) { - let tip = this.chain.tip; - - if (height != null) - tip = await this.chain.getEntry(height); - - if (!tip) - return 0; - - assert$n(typeof lookup === 'number'); - assert$n(lookup >= 0); - - if (lookup === 0) - lookup = tip.height % this.network.pow.retargetInterval + 1; - - if (lookup > tip.height) - lookup = tip.height; - - let min = tip.time; - let max = min; - let entry = tip; - - for (let i = 0; i < lookup; i++) { - entry = await this.chain.getPrevious(entry); - - if (!entry) - throw new RPCError$1(errs$1.DATABASE_ERROR, 'Not found.'); - - min = Math.min(entry.time, min); - max = Math.max(entry.time, max); - } - - const diff = max - min; - - if (diff === 0) - return 0; - - const work = tip.chainwork.sub(entry.chainwork); - - return Number(work.toString()) / diff; - } - - async mineBlocks(blocks, addr, tries) { - const unlock = await this.locker.lock(); - try { - return await this._mineBlocks(blocks, addr, tries); - } finally { - unlock(); - } - } - - async _mineBlocks(blocks, addr, tries) { - const hashes = []; - - for (let i = 0; i < blocks; i++) { - const block = await this.miner.mineBlock(null, addr); - const entry = await this.chain.add(block); - assert$n(entry); - hashes.push(entry.rhash()); - } - - return hashes; - } - - async findFork(entry) { - while (entry) { - if (await this.chain.isMainChain(entry)) - return entry; - entry = await this.chain.getPrevious(entry); - } - throw new Error('Fork not found.'); - } - - txToJSON(tx, entry) { - let height = -1; - let time = 0; - let hash = null; - let conf = 0; - - if (entry) { - height = entry.height; - time = entry.time; - hash = entry.rhash(); - conf = this.chain.height - height + 1; - } - - const vin = []; - - for (const input of tx.inputs) { - const json = { - coinbase: undefined, - txid: undefined, - scriptSig: undefined, - txinwitness: undefined, - sequence: input.sequence - }; - - if (tx.isCoinbase()) { - json.coinbase = input.script.toJSON(); - } else { - json.txid = input.prevout.txid(); - json.vout = input.prevout.index; - json.scriptSig = { - asm: input.script.toASM(), - hex: input.script.toJSON() - }; - } - - if (input.witness.items.length > 0) { - json.txinwitness = input.witness.items.map((item) => { - return item.toString('hex'); - }); - } - - vin.push(json); - } - - const vout = []; - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - vout.push({ - value: Amount$2.btc(output.value, true), - n: i, - scriptPubKey: this.scriptToJSON(output.script, true) - }); - } - - return { - txid: tx.txid(), - hash: tx.wtxid(), - size: tx.getSize(), - vsize: tx.getVirtualSize(), - version: tx.version, - locktime: tx.locktime, - vin: vin, - vout: vout, - blockhash: hash, - confirmations: conf, - time: time, - blocktime: time, - hex: undefined - }; - } - - scriptToJSON(script, hex) { - const type = script.getType(); - - const json = { - asm: script.toASM(), - hex: undefined, - type: Script$8.typesByVal[type], - reqSigs: 1, - addresses: [], - p2sh: undefined - }; - - if (hex) - json.hex = script.toJSON(); - - const [m] = script.getMultisig(); - - if (m !== -1) - json.reqSigs = m; - - const addr = script.getAddress(); - - if (addr) { - const str = addr.toString(this.network); - json.addresses.push(str); - } - - return json; - } - - async headerToJSON(entry) { - const mtp = await this.chain.getMedianTime(entry); - const next = await this.chain.getNextHash(entry.hash); - - let confirmations = -1; - if (await this.chain.isMainChain(entry)) - confirmations = this.chain.height - entry.height + 1; - - return { - hash: entry.rhash(), - confirmations: confirmations, - height: entry.height, - version: entry.version, - versionHex: hex32(entry.version), - merkleroot: util$5.revHex(entry.merkleRoot), - time: entry.time, - mediantime: mtp, - nonce: entry.nonce, - bits: hex32(entry.bits), - difficulty: toDifficulty(entry.bits), - chainwork: entry.chainwork.toString('hex', 64), - previousblockhash: !entry.prevBlock.equals(consensus$5.ZERO_HASH) - ? util$5.revHex(entry.prevBlock) - : null, - nextblockhash: next ? util$5.revHex(next) : null - }; - } - - async blockToJSON(entry, block, details) { - const mtp = await this.chain.getMedianTime(entry); - const next = await this.chain.getNextHash(entry.hash); - - let confirmations = -1; - if (await this.chain.isMainChain(entry)) - confirmations = this.chain.height - entry.height + 1; - - const txs = []; - - for (const tx of block.txs) { - if (details) { - const json = this.txToJSON(tx, entry); - txs.push(json); - continue; - } - txs.push(tx.txid()); - } - - return { - hash: entry.rhash(), - confirmations: confirmations, - strippedsize: block.getBaseSize(), - size: block.getSize(), - weight: block.getWeight(), - height: entry.height, - version: entry.version, - versionHex: hex32(entry.version), - merkleroot: util$5.revHex(entry.merkleRoot), - coinbase: block.txs[0].inputs[0].script.toJSON(), - tx: txs, - time: entry.time, - mediantime: mtp, - nonce: entry.nonce, - bits: hex32(entry.bits), - difficulty: toDifficulty(entry.bits), - chainwork: entry.chainwork.toString('hex', 64), - nTx: txs.length, - previousblockhash: !entry.prevBlock.equals(consensus$5.ZERO_HASH) - ? util$5.revHex(entry.prevBlock) - : null, - nextblockhash: next ? util$5.revHex(next) : null - }; - } - - entryToJSON(entry) { - return { - size: entry.size, - fee: Amount$2.btc(entry.deltaFee, true), - modifiedfee: 0, - time: entry.time, - height: entry.height, - startingpriority: entry.priority, - currentpriority: entry.getPriority(this.chain.height), - descendantcount: this.mempool.countDescendants(entry), - descendantsize: entry.descSize, - descendantfees: entry.descFee, - ancestorcount: this.mempool.countAncestors(entry), - ancestorsize: 0, - ancestorfees: 0, - depends: this.mempool.getDepends(entry.tx).map(util$5.revHex) - }; - } - } - - /* - * Helpers - */ - - function swap32(data) { - for (let i = 0; i < data.length; i += 4) { - const field = data.readUInt32LE(i, true); - data.writeUInt32BE(field, i, true); - } - return data; - } - - function toDeployment(id, version, status) { - return { - id: id, - version: version, - reject: { - status: status - } - }; - } - - function parseAddress$1(raw, network) { - try { - return Address$6.fromString(raw, network); - } catch (e) { - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid address.'); - } - } - - function parseSecret$1(raw, network) { - try { - return KeyRing$3.fromSecret(raw, network); - } catch (e) { - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - } - } - - function parseIP(addr, network) { - try { - return IP.fromHostname(addr, network.port); - } catch (e) { - throw new RPCError$1(errs$1.CLIENT_INVALID_IP_OR_SUBNET, - 'Invalid IP address or subnet.'); - } - } - - function parseNetAddress(addr, network) { - try { - return NetAddress.fromHostname(addr, network); - } catch (e) { - throw new RPCError$1(errs$1.CLIENT_INVALID_IP_OR_SUBNET, - 'Invalid IP address or subnet.'); - } - } - - function toDifficulty(bits) { - let shift = (bits >>> 24) & 0xff; - let diff = 0x0000ffff / (bits & 0x00ffffff); - - while (shift < 29) { - diff *= 256.0; - shift++; - } - - while (shift > 29) { - diff /= 256.0; - shift--; - } - - return diff; - } - - function hex32(num) { - assert$n(num >= 0); - - num = num.toString(16); - - assert$n(num.length <= 8); - - while (num.length < 8) - num = '0' + num; - - return num; - } - - /* - * Expose - */ - - var rpc$1 = RPC$4; - - var blockstore$1 = {}; - - /*! - * blockstore/abstract.js - abstract blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const Logger$1 = blgr; - - /** - * Abstract Block Store - * - * @alias module:blockstore.AbstractBlockStore - * @abstract - */ - - class AbstractBlockStore$3 { - /** - * Create an abstract blockstore. - * @constructor - */ - - constructor(options) { - this.options = options || {}; - - if (this.options.logger != null) - this.logger = this.options.logger.context('blockstore'); - else - this.logger = Logger$1.global.context('blockstore'); - } - - /** - * This method ensures that resources are available - * before opening. - * @returns {Promise} - */ - - async ensure() { - throw new Error('Abstract method.'); - } - - /** - * This method opens any necessary resources and - * initializes the store to be ready to be queried. - * @returns {Promise} - */ - - async open() { - throw new Error('Abstract method.'); - } - - /** - * This method closes resources and prepares - * the store to be closed. - * @returns {Promise} - */ - - async close() { - throw new Error('Abstract method.'); - } - - /** - * This method stores merkle blocks including - * all the relevant transactions. - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores block undo coin data. - * @returns {Promise} - */ - - async writeUndo(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores serialized block filter data in files. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores block data. - * @returns {Promise} - */ - - async write(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method reads merkle block data. - * @returns {Promise} - */ - - async readMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve serialized block filter data. - * @returns {Promise} - */ - - async readFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block filter header only. - * @returns {Promise} - */ - - async readFilterHeader(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block undo coin data. - * @returns {Promise} - */ - - async readUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block data. Smaller portions of - * the block can be read by using the offset and size arguments. - * @returns {Promise} - */ - - async read(hash, offset, size) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the merkle block data. - * @returns {Promise} - */ - - async pruneMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the block undo coin data. - * @returns {Promise} - */ - - async pruneUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the serialized block filter data. - * @returns {Promise} - */ - - async pruneFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the block data. - * @returns {Promise} - */ - - async prune(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if merkle block data has been stored - * and is available. - * @returns {Promise} - */ - - async hasMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block undo coin data has been stored - * and is available. - * @returns {Promise} - */ - - async hasUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @returns {Promise} - */ - - async hasFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block has been stored and is available. - * @returns {Promise} - */ - - async has(hash) { - throw new Error('Abstract method.'); - } - } - - /* - * Expose - */ - - var abstract = AbstractBlockStore$3; - - /*! - * blockstore/layout.js - file blockstore data layout for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const bdb$5 = bdb$d; - - /* - * Database Layout: - * V -> db version - * F[type] -> last file record by type - * f[type][fileno] -> file record by type and file number - * b[type][hash] -> block record by type and block hash - */ - - const layout$5 = { - V: bdb$5.key('V'), - F: bdb$5.key('F', ['uint32']), - f: bdb$5.key('f', ['uint32', 'uint32']), - b: bdb$5.key('b', ['uint32', 'hash256']) - }; - - /* - * Expose - */ - - var layout_1 = layout$5; - - var common$6 = {}; - - /*! - * common.js - blockstore constants for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module blockstore/common - */ - - /** - * Block data types. - * @enum {Number} - */ - - common$6.types = { - BLOCK: 1, - UNDO: 2, - FILTER: 3, - MERKLE: 4 - }; - - /** - * File prefixes for block data types. - * @enum {String} - */ - - common$6.prefixes = { - 1: 'blk', - 2: 'blu', - 3: 'blf', - 4: 'blm' - }; - - /*! - * blockstore/level.js - leveldb blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const bdb$4 = bdb$d; - const fs$2 = bfile; - const AbstractBlockStore$2 = abstract; - const layout$4 = layout_1; - const {types: types$1} = common$6; - - /** - * LevelDB Block Store - * - * @alias module:blockstore:LevelBlockStore - * @abstract - */ - - class LevelBlockStore$1 extends AbstractBlockStore$2 { - /** - * Create a blockstore that stores blocks in LevelDB. - * @constructor - */ - - constructor(options) { - super(options); - - this.location = options.location; - - this.db = bdb$4.create({ - location: this.location, - cacheSize: options.cacheSize, - compression: false, - memory: options.memory - }); - } - - /** - * This method ensures that the storage directory exists - * before opening. - * @returns {Promise} - */ - - async ensure() { - return fs$2.mkdirp(this.location); - } - - /** - * Opens the block storage. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening LevelBlockStore...'); - - await this.db.open(); - await this.db.verify(layout$4.V.encode(), 'levelblockstore', 0); - } - - /** - * Closes the block storage. - */ - - async close() { - this.logger.info('Closing LevelBlockStore...'); - - await this.db.close(); - } - - /** - * This method stores merkle block data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - return this.db.put(layout$4.b.encode(types$1.MERKLE, hash), data); - } - - /** - * This method stores block undo coin data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeUndo(hash, data) { - return this.db.put(layout$4.b.encode(types$1.UNDO, hash), data); - } - - /** - * This method stores block data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async write(hash, data) { - return this.db.put(layout$4.b.encode(types$1.BLOCK, hash), data); - } - - /** - * This method stores serialized block filter data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The serialized block filter data. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - return this.db.put(layout$4.b.encode(types$1.FILTER, hash), data); - } - - /** - * This method will retrieve merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readMerkle(hash) { - return this.db.get(layout$4.b.encode(types$1.MERKLE, hash)); - } - - /** - * This method will retrieve block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readUndo(hash) { - return this.db.get(layout$4.b.encode(types$1.UNDO, hash)); - } - - /** - * This method will retrieve serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilter(hash) { - return this.db.get(layout$4.b.encode(types$1.FILTER, hash)); - } - - /** - * This method will retrieve block filter header only. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilterHeader(hash) { - const data = await this.db.get(layout$4.b.encode(types$1.FILTER, hash)); - - if (!data) - return null; - - return data.slice(0, 32); - } - - /** - * This method will retrieve block data. Smaller portions of the - * block (e.g. transactions) can be returned using the offset and - * length arguments. However, the entire block will be read as the - * data is stored in a key/value database. - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async read(hash, offset, length) { - let raw = await this.db.get(layout$4.b.encode(types$1.BLOCK, hash)); - - if (offset) { - if (offset + length > raw.length) - throw new Error('Out-of-bounds read.'); - - raw = raw.slice(offset, offset + length); - } - - return raw; - } - - /** - * This will free resources for storing merkle block data. - * The block data may not be immediately removed from disk, and will - * be reclaimed during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneMerkle(hash) { - if (!await this.hasMerkle(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.MERKLE, hash)); - - return true; - } - - /** - * This will free resources for storing the block undo coin data. - * The block data may not be immediately removed from disk, and will - * be reclaimed during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneUndo(hash) { - if (!await this.hasUndo(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.UNDO, hash)); - - return true; - } - - /** - * This will free resources for storing the serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneFilter(hash) { - if (!await this.hasFilter(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.FILTER, hash)); - - return true; - } - - /** - * This will free resources for storing the block data. The block - * data may not be immediately removed from disk, and will be reclaimed - * during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async prune(hash) { - if (!await this.has(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.BLOCK, hash)); - - return true; - } - - /** - * This will check if a merkle block data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasMerkle(hash) { - return this.db.has(layout$4.b.encode(types$1.MERKLE, hash)); - } - - /** - * This will check if a block undo coin data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasUndo(hash) { - return this.db.has(layout$4.b.encode(types$1.UNDO, hash)); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasFilter(hash) { - return this.db.has(layout$4.b.encode(types$1.FILTER, hash)); - } - - /** - * This will check if a block has been stored and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async has(hash) { - return this.db.has(layout$4.b.encode(types$1.BLOCK, hash)); - } - } - - /* - * Expose - */ - - var level = LevelBlockStore$1; - - var records$3 = {exports: {}}; - - /*! - * blockstore/records.js - blockstore records - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - (function (module, exports) { - - const assert = assert_1$g; - const bio = bufio; - - /** - * @module blockstore/records - */ - - /** - * Block Record - */ - - class BlockRecord { - /** - * Create a block record. - * @constructor - */ - - constructor(options = {}) { - this.file = options.file || 0; - this.position = options.position || 0; - this.length = options.length || 0; - - assert((this.file >>> 0) === this.file); - assert((this.position >>> 0) === this.position); - assert((this.length >>> 0) === this.length); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.file = br.readU32(); - this.position = br.readU32(); - this.length = br.readU32(); - - return this; - } - - /** - * Instantiate block record from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {BlockRecord} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the block record. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(12); - - bw.writeU32(this.file); - bw.writeU32(this.position); - bw.writeU32(this.length); - - return bw.render(); - } - } - - /** - * File Record - */ - - class FileRecord { - /** - * Create a file record. - * @constructor - */ - - constructor(options = {}) { - this.blocks = options.blocks || 0; - this.used = options.used || 0; - this.length = options.length || 0; - - assert((this.blocks >>> 0) === this.blocks); - assert((this.used >>> 0) === this.used); - assert((this.length >>> 0) === this.length); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.blocks = br.readU32(); - this.used = br.readU32(); - this.length = br.readU32(); - - return this; - } - - /** - * Instantiate file record from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {ChainState} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the file record. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(12); - - bw.writeU32(this.blocks); - bw.writeU32(this.used); - bw.writeU32(this.length); - - return bw.render(); - } - } - - /* - * Expose - */ - - exports.BlockRecord = BlockRecord; - exports.FileRecord = FileRecord; - - module.exports = exports; - }(records$3, records$3.exports)); - - /*! - * blockstore/file.js - file blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const {isAbsolute, resolve, join: join$1} = require$$1__default["default"]; - const bdb$3 = bdb$d; - const assert$m = assert_1$g; - const fs$1 = bfile; - const bio$7 = bufio; - const hash256$3 = hash256$k.exports; - const Network$2 = network; - const AbstractBlockStore$1 = abstract; - const {BlockRecord: BlockRecord$1, FileRecord} = records$3.exports; - const layout$3 = layout_1; - const {types, prefixes} = common$6; - - /** - * File Block Store - * - * @alias module:blockstore:FileBlockStore - * @abstract - */ - - class FileBlockStore$1 extends AbstractBlockStore$1 { - /** - * Create a blockstore that stores blocks in files. - * @constructor - */ - - constructor(options) { - super(options); - - assert$m(isAbsolute(options.location), 'Location not absolute.'); - - this.location = options.location; - this.indexLocation = resolve(this.location, './index'); - - this.db = bdb$3.create({ - location: this.indexLocation, - cacheSize: options.cacheSize, - compression: false - }); - - this.maxFileLength = options.maxFileLength || 128 * 1024 * 1024; - - assert$m(Number.isSafeInteger(this.maxFileLength), - 'Invalid max file length.'); - - this.network = Network$2.primary; - - if (options.network != null) - this.network = Network$2.get(options.network); - - this.writing = Object.create(null); - } - - /** - * Compares the number of files in the directory - * with the recorded number of files. - * @param {Number} type - The type of block data - * @private - * @returns {Promise} - */ - - async check(type) { - const prefix = prefixes[type]; - const regexp = new RegExp(`^${prefix}(\\d{5})\\.dat$`); - const all = await fs$1.readdir(this.location); - const dats = all.filter(f => regexp.test(f)); - const filenos = dats.map(f => parseInt(f.match(regexp)[1])); - - let missing = false; - - for (const fileno of filenos) { - const rec = await this.db.get(layout$3.f.encode(type, fileno)); - if (!rec) { - missing = true; - break; - } - } - - return {missing, filenos}; - } - - /** - * Creates indexes from files for a block type. Reads the hash of - * the block data from the magic prefix, except for a block which - * the hash is read from the block header. - * @private - * @param {Number} type - The type of block data - * @returns {Promise} - */ - - async _index(type) { - const {missing, filenos} = await this.check(type); - - if (!missing) - return; - - this.logger.info('Indexing block type %d...', type); - - for (const fileno of filenos) { - const b = this.db.batch(); - const filepath = this.filepath(type, fileno); - const data = await fs$1.readFile(filepath); - const reader = bio$7.read(data); - let magic = null; - let blocks = 0; - - while (reader.left() >= 4) { - magic = reader.readU32(); - - // Move forward a byte from the last read - // if the magic doesn't match. - if (magic !== this.network.magic) { - reader.seek(-3); - continue; - } - - let hash = null; - let position = 0; - let length = 0; - - try { - length = reader.readU32(); - - if (type === types.BLOCK || type === types.MERKLE) { - position = reader.offset; - hash = hash256$3.digest(reader.readBytes(80, true)); - reader.seek(length - 80); - } else { - hash = reader.readHash(); - position = reader.offset; - reader.seek(length); - } - } catch (err) { - this.logger.warning( - 'Unknown block in file: %s, reason: %s', - filepath, err.message); - continue; - } - - const blockrecord = new BlockRecord$1({ - file: fileno, - position: position, - length: length - }); - - blocks += 1; - b.put(layout$3.b.encode(type, hash), blockrecord.toRaw()); - } - - const filerecord = new FileRecord({ - blocks: blocks, - used: reader.offset, - length: this.maxFileLength - }); - - b.put(layout$3.f.encode(type, fileno), filerecord.toRaw()); - - await b.write(); - - this.logger.info('Indexed %d blocks (file=%s).', blocks, filepath); - } - } - - /** - * Compares the number of files in the directory - * with the recorded number of files. If there are any - * inconsistencies it will reindex all blocks. - * @private - * @returns {Promise} - */ - - async index() { - await this._index(types.BLOCK); - await this._index(types.MERKLE); - await this._index(types.UNDO); - } - - /** - * This method ensures that both the block storage directory - * and index directory exist. - * before opening. - * @returns {Promise} - */ - - async ensure() { - return fs$1.mkdirp(this.indexLocation); - } - - /** - * Opens the file block store. It will regenerate necessary block - * indexing if the index is missing or inconsistent. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening FileBlockStore...'); - - await this.db.open(); - await this.db.verify(layout$3.V.encode(), 'fileblockstore', 0); - - await this.index(); - } - - /** - * This closes the file block store and underlying - * indexing databases. - */ - - async close() { - this.logger.info('Closing FileBlockStore...'); - - await this.db.close(); - } - - /** - * This method will determine the file path based on the file number - * and the current block data location. - * @private - * @param {Number} type - The type of block data - * @param {Number} fileno - The number of the file. - * @returns {Promise} - */ - - filepath(type, fileno) { - const pad = 5; - - let num = fileno.toString(10); - - if (num.length > pad) - throw new Error('File number too large.'); - - while (num.length < pad) - num = `0${num}`; - - let filepath = null; - - const prefix = prefixes[type]; - - if (!prefix) - throw new Error('Unknown file prefix.'); - - filepath = join$1(this.location, `${prefix}${num}.dat`); - - return filepath; - } - - /** - * This method will select and potentially allocate a file to - * write a block based on the size and type. - * @private - * @param {Number} type - The type of block data - * @param {Number} length - The number of bytes - * @returns {Promise} - */ - - async allocate(type, length) { - if (length > this.maxFileLength) - throw new Error('Block length above max file length.'); - - let fileno = 0; - let filerecord = null; - let filepath = null; - - const last = await this.db.get(layout$3.F.encode(type)); - if (last) - fileno = bio$7.readU32(last, 0); - - filepath = this.filepath(type, fileno); - - const rec = await this.db.get(layout$3.f.encode(type, fileno)); - - let touch = false; - - if (rec) { - filerecord = FileRecord.fromRaw(rec); - } else { - touch = true; - filerecord = new FileRecord({ - blocks: 0, - used: 0, - length: this.maxFileLength - }); - } - - if (filerecord.used + length > filerecord.length) { - fileno += 1; - filepath = this.filepath(type, fileno); - touch = true; - filerecord = new FileRecord({ - blocks: 0, - used: 0, - length: this.maxFileLength - }); - } - - if (touch) { - const fd = await fs$1.open(filepath, 'w'); - await fs$1.close(fd); - } - - return {fileno, filerecord, filepath}; - } - - /** - * This method stores merkle block data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - return this._write(types.MERKLE, hash, data); - } - - /** - * This method stores block undo coin data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeUndo(hash, data) { - return this._write(types.UNDO, hash, data); - } - - /** - * This method stores block data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async write(hash, data) { - return this._write(types.BLOCK, hash, data); - } - - /** - * This method stores serialized block filter data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The serialized block filter data. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - return this._write(types.FILTER, hash, data); - } - - /** - * This method stores block data in files with by appending - * data to the last written file and updating indexes to point - * to the file and position. - * @private - * @param {Number} type - The type of block data - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async _write(type, hash, data) { - if (this.writing[type]) - throw new Error('Already writing.'); - - this.writing[type] = true; - - if (await this.db.has(layout$3.b.encode(type, hash))) { - this.writing[type] = false; - return false; - } - - let mlength = 8; - - // Hash for a block is not stored with - // the magic prefix as it's read from the header - // of the block data. - if (type !== types.BLOCK && type !== types.MERKLE) - mlength += 32; - - const blength = data.length; - const length = data.length + mlength; - - const bwm = bio$7.write(mlength); - - bwm.writeU32(this.network.magic); - bwm.writeU32(blength); - - if (type !== types.BLOCK && type !== types.MERKLE) - bwm.writeHash(hash); - - const magic = bwm.render(); - - const { - fileno, - filerecord, - filepath - } = await this.allocate(type, length); - - const mposition = filerecord.used; - const bposition = filerecord.used + mlength; - - const fd = await fs$1.open(filepath, 'r+'); - - let mwritten = 0; - let bwritten = 0; - - try { - mwritten = await fs$1.write(fd, magic, 0, mlength, mposition); - bwritten = await fs$1.write(fd, data, 0, blength, bposition); - } finally { - await fs$1.close(fd); - } - - if (mwritten !== mlength) { - this.writing[type] = false; - throw new Error('Could not write block magic.'); - } - - if (bwritten !== blength) { - this.writing[type] = false; - throw new Error('Could not write block.'); - } - - filerecord.blocks += 1; - filerecord.used += length; - - const b = this.db.batch(); - - const blockrecord = new BlockRecord$1({ - file: fileno, - position: bposition, - length: blength - }); - - b.put(layout$3.b.encode(type, hash), blockrecord.toRaw()); - b.put(layout$3.f.encode(type, fileno), filerecord.toRaw()); - - const last = bio$7.write(4).writeU32(fileno).render(); - b.put(layout$3.F.encode(type), last); - - await b.write(); - - this.writing[type] = false; - - return true; - } - - /** - * This method will retrieve merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readMerkle(hash) { - return this._read(types.MERKLE, hash); - } - - /** - * This method will retrieve block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readUndo(hash) { - return this._read(types.UNDO, hash); - } - - /** - * This method will retrieve block data. Smaller portions of the - * block (e.g. transactions) can be read by using the offset and - * length arguments. - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async read(hash, offset, length) { - return this._read(types.BLOCK, hash, offset, length); - } - - /** - * This method will retrieve serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilter(hash) { - return this._read(types.FILTER, hash); - } - - /** - * This method will retrieve block filter header only. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilterHeader(hash) { - return this._read(types.FILTER, hash, 0, 32); - } - - /** - * This methods reads data from disk by retrieving the index of - * the data and reading from the corresponding file and location. - * @private - * @param {Number} type - The type of block data - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async _read(type, hash, offset, length) { - const raw = await this.db.get(layout$3.b.encode(type, hash)); - if (!raw) - return null; - - const blockrecord = BlockRecord$1.fromRaw(raw); - - const filepath = this.filepath(type, blockrecord.file); - - let position = blockrecord.position; - - if (offset) - position += offset; - - if (!length && offset > 0) - length = blockrecord.length - offset; - - if (!length) - length = blockrecord.length; - - if (offset + length > blockrecord.length) - throw new Error('Out-of-bounds read.'); - - const data = Buffer.alloc(length); - - const fd = await fs$1.open(filepath, 'r'); - let bytes = 0; - - try { - bytes = await fs$1.read(fd, data, 0, length, position); - } finally { - await fs$1.close(fd); - } - - if (bytes !== length) - throw new Error('Wrong number of bytes read.'); - - return data; - } - - /** - * This will free resources for storing merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneMerkle(hash) { - return this._prune(types.MERKLE, hash); - } - - /** - * This will free resources for storing the block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneUndo(hash) { - return this._prune(types.UNDO, hash); - } - - /** - * This will free resources for storing the block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async prune(hash) { - return this._prune(types.BLOCK, hash); - } - - /** - * This will free resources for storing the serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneFilter(hash) { - return this._prune(types.FILTER, hash); - } - - /** - * This will free resources for storing the block data. The block - * data may not be deleted from disk immediately, the index for the - * block is removed and will not be able to be read. The underlying - * file is unlinked when all blocks in a file have been pruned. - * @private - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async _prune(type, hash) { - const braw = await this.db.get(layout$3.b.encode(type, hash)); - if (!braw) - return false; - - const blockrecord = BlockRecord$1.fromRaw(braw); - - const fraw = await this.db.get(layout$3.f.encode(type, blockrecord.file)); - if (!fraw) - return false; - - const filerecord = FileRecord.fromRaw(fraw); - - filerecord.blocks -= 1; - - const b = this.db.batch(); - - if (filerecord.blocks === 0) - b.del(layout$3.f.encode(type, blockrecord.file)); - else - b.put(layout$3.f.encode(type, blockrecord.file), filerecord.toRaw()); - - b.del(layout$3.b.encode(type, hash)); - - await b.write(); - - if (filerecord.blocks === 0) - await fs$1.unlink(this.filepath(type, blockrecord.file)); - - return true; - } - - /** - * This will check if merkle block data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasMerkle(hash) { - return await this.db.has(layout$3.b.encode(types.MERKLE, hash)); - } - - /** - * This will check if a block undo coin has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasUndo(hash) { - return await this.db.has(layout$3.b.encode(types.UNDO, hash)); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasFilter(hash) { - return await this.db.has(layout$3.b.encode(types.FILTER, hash)); - } - - /** - * This will check if a block has been stored and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async has(hash) { - return await this.db.has(layout$3.b.encode(types.BLOCK, hash)); - } - } - - /* - * Expose - */ - - var file = FileBlockStore$1; - - /*! - * blockstore/index.js - bitcoin blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const {join} = require$$1__default["default"]; - - const AbstractBlockStore = abstract; - const LevelBlockStore = level; - const FileBlockStore = file; - - /** - * @module blockstore - */ - - blockstore$1.create = (options) => { - if (options.memory) { - return new LevelBlockStore({ - network: options.network, - logger: options.logger, - cacheSize: options.cacheSize, - memory: options.memory - }); - } - - const location = join(options.prefix, 'blocks'); - - return new FileBlockStore({ - network: options.network, - logger: options.logger, - location: location, - cacheSize: options.cacheSize - }); - }; - - blockstore$1.AbstractBlockStore = AbstractBlockStore; - blockstore$1.FileBlockStore = FileBlockStore; - blockstore$1.LevelBlockStore = LevelBlockStore; - - /*! - * filters.js - filter object for bcoin - * Copyright (c) 2019, the bcoin developers (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$l = assert_1$g; - const bio$6 = bufio; - const util$4 = util$y; - const consensus$4 = consensus$s; - const {inspectSymbol: inspectSymbol$5} = utils; - - /* - * Constants - */ - - const EMPTY_BUFFER = Buffer.alloc(0); - - /** - * Filter - * Represents a GCSFilter. - * @alias module:primitives.Filter - * @property {Hash} hash - * @property {Number} index - */ - - class Filter$1 { - /** - * Create an filter. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - this.header = consensus$4.ZERO_HASH; - this.filter = EMPTY_BUFFER; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$l(options, 'Filter data is required.'); - assert$l(Buffer.isBuffer(options.header)); - assert$l(Buffer.isBuffer(options.filter)); - this.header = options.header; - this.filter = options.filter; - return this; - } - - /** - * Instantate outpoint from options object. - * @param {Object} options - * @returns {Filter} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Write filter to a buffer writer. - * @param {BufferWriter} bw - */ - - toWriter(bw) { - bw.writeHash(this.header); - bw.writeBytes(this.filter); - return bw; - } - - /** - * Calculate size of filter. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 32; - size += this.filter.length; - return size; - } - - /** - * Serialize filter. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio$6.write(size)).render(); - } - - /** - * Inject properties from buffer reader. - * @private - * @param {BufferReader} br - */ - - fromReader(br) { - this.header = br.readHash(); - this.filter = br.readBytes(br.getSize() - br.offset); - return this; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - return this.fromReader(bio$6.read(data)); - } - - /** - * Instantiate filter from a buffer reader. - * @param {BufferReader} br - * @returns {Filter} - */ - - static fromReader(br) { - return new this().fromReader(br); - } - - /** - * Instantiate filter from serialized data. - * @param {Buffer} data - * @returns {Filter} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Inject properties from json object. - * @private - * @params {Object} json - */ - - fromJSON(json) { - assert$l(json, 'Filter data is required.'); - assert$l(typeof json.filter === 'string', 'Filter must be a string.'); - assert$l(typeof json.header === 'string', 'Header must be a string.'); - this.filter = Buffer.from(json.filter); - this.header = Buffer.from(json.header); - return this; - } - - /** - * Convert the filter to an object suitable - * for JSON serialization. - * @returns {Object} - */ - - toJSON() { - return { - filter: this.filter.toString('hex'), - header: util$4.revHex(this.header) - }; - } - - /** - * Instantiate filter from json object. - * @param {Object} json - * @returns {Filter} - */ - - static fromJSON(json) { - return new this().fromJSON(json); - } - - /** - * Convert the filter to a user-friendly string. - * @returns {String} - */ - - [inspectSymbol$5]() { - return ``; - } - - /** - * Test an object to see if it is an filter. - * @param {Object} obj - * @returns {Boolean} - */ - - static isFilter(obj) { - return obj instanceof Filter$1; - } - } - - /* - * Expose - */ - - var filter = Filter$1; - - /*! - * filterindexer.js - filter indexer - * Copyright (c) 2018, the bcoin developers (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const bdb$2 = bdb$d; - const assert$k = assert_1$g; - const Indexer = indexer; - const consensus$3 = consensus$s; - const Filter = filter; - - /** - * FilterIndexer - * @alias module:indexer.FilterIndexer - * @extends Indexer - */ - - class FilterIndexer$1 extends Indexer { - /** - * Create a indexer - * @constructor - * @param {Object} options - */ - - constructor(options) { - super('filter', options); - - this.db = bdb$2.create(this.options); - } - - /** - * Store genesis previous filter header. - * @private - * @returns {Promise} - */ - - async saveGenesis() { - const prevHash = this.network.genesis.prevBlock; - - // Genesis prev filter headers are defined to be zero hashes - const filter = new Filter(); - filter.header = consensus$3.ZERO_HASH; - await this.blocks.writeFilter(prevHash, filter.toRaw()); - - await super.saveGenesis(); - } - - /** - * Index compact filters. - * @private - * @param {BlockMeta} meta - * @param {Block} block - * @param {CoinView} view - */ - - async indexBlock(meta, block, view) { - const hash = block.hash(); - const prev = await this.getFilterHeader(block.prevBlock); - const basic = block.toFilter(view); - - const filter = new Filter(); - filter.header = basic.header(prev); - filter.filter = basic.toRaw(); - await this.blocks.writeFilter(hash, filter.toRaw()); - } - - /** - * Prune compact filters. - * @private - * @param {BlockMeta} meta - */ - - async pruneBlock(meta) { - await this.blocks.pruneFilter(meta.hash); - } - - /** - * Retrieve compact filter by hash. - * @param {Hash} hash - * @param {Number} type - * @returns {Promise} - Returns {@link Filter}. - */ - - async getFilter(hash) { - assert$k(hash); - - const filter = await this.blocks.readFilter(hash); - if (!filter) - return null; - - return Filter.fromRaw(filter); - } - - /** - * Retrieve compact filter header by hash. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Hash}. - */ - - async getFilterHeader(hash) { - assert$k(hash); - - return this.blocks.readFilterHeader(hash); - } - } - - var filterindexer = FilterIndexer$1; - - /*! - * fullnode.js - full node for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$j = assert_1$g; - const Chain$3 = chain$1; - const Fees = fees; - const Mempool = mempool; - const Pool$1 = pool; - const Miner = miner; - const Node$2 = node$1; - const HTTP$3 = http$1; - const RPC$3 = rpc$1; - const blockstore = blockstore$1; - const TXIndexer = txindexer; - const AddrIndexer = addrindexer$1; - const FilterIndexer = filterindexer; - - /** - * Full Node - * Respresents a fullnode complete with a - * chain, mempool, miner, etc. - * @alias module:node.FullNode - * @extends Node - */ - - class FullNode extends Node$2 { - /** - * Create a full node. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super('bcoin', 'bcoin.conf', 'debug.log', options); - - this.opened = false; - - // SPV flag. - this.spv = false; - - // Instantiate block storage. - this.blocks = blockstore.create({ - network: this.network, - logger: this.logger, - prefix: this.config.prefix, - cacheSize: this.config.mb('block-cache-size'), - memory: this.memory - }); - - // Chain needs access to blocks. - this.chain = new Chain$3({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - workers: this.workers, - memory: this.config.bool('memory'), - prefix: this.config.prefix, - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - forceFlags: this.config.bool('force-flags'), - bip91: this.config.bool('bip91'), - bip148: this.config.bool('bip148'), - prune: this.config.bool('prune'), - checkpoints: this.config.bool('checkpoints'), - entryCache: this.config.uint('entry-cache'), - indexTX: this.config.bool('index-tx'), - indexAddress: this.config.bool('index-address') - }); - - // Fee estimation. - this.fees = new Fees(this.logger); - this.fees.init(); - - // Mempool needs access to the chain. - this.mempool = new Mempool({ - network: this.network, - logger: this.logger, - workers: this.workers, - chain: this.chain, - fees: this.fees, - memory: this.memory, - prefix: this.config.prefix, - persistent: this.config.bool('persistent-mempool'), - maxSize: this.config.mb('mempool-size'), - limitFree: this.config.bool('limit-free'), - limitFreeRelay: this.config.uint('limit-free-relay'), - requireStandard: this.config.bool('require-standard'), - rejectAbsurdFees: this.config.bool('reject-absurd-fees'), - replaceByFee: this.config.bool('replace-by-fee'), - indexAddress: this.config.bool('index-address') - }); - - // Pool needs access to the chain and mempool. - this.pool = new Pool$1({ - network: this.network, - logger: this.logger, - chain: this.chain, - mempool: this.mempool, - prefix: this.config.prefix, - selfish: this.config.bool('selfish'), - compact: this.config.bool('compact'), - bip37: this.config.bool('bip37'), - maxOutbound: this.config.uint('max-outbound'), - maxInbound: this.config.uint('max-inbound'), - createSocket: this.config.func('create-socket'), - proxy: this.config.str('proxy'), - onion: this.config.bool('onion'), - upnp: this.config.bool('upnp'), - seeds: this.config.array('seeds'), - nodes: this.config.array('nodes'), - only: this.config.array('only'), - publicHost: this.config.str('public-host'), - publicPort: this.config.uint('public-port'), - host: this.config.str('host'), - port: this.config.uint('port'), - listen: this.config.bool('listen'), - memory: this.memory - }); - - // Miner needs access to the chain and mempool. - this.miner = new Miner({ - network: this.network, - logger: this.logger, - workers: this.workers, - chain: this.chain, - mempool: this.mempool, - address: this.config.array('coinbase-address'), - coinbaseFlags: this.config.str('coinbase-flags'), - preverify: this.config.bool('preverify'), - maxWeight: this.config.uint('max-weight'), - reservedWeight: this.config.uint('reserved-weight'), - reservedSigops: this.config.uint('reserved-sigops') - }); - - // RPC needs access to the node. - this.rpc = new RPC$3(this); - - // HTTP needs access to the node. - this.http = new HTTP$3({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - maxTxs: this.config.uint('max-txs') - }); - - // Indexers - if (this.config.bool('index-tx')) { - this.txindex = new TXIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - prune: this.config.bool('prune'), - memory: this.memory, - prefix: this.config.str('index-prefix', this.config.prefix) - }); - } - - if (this.config.bool('index-address')) { - this.addrindex= new AddrIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - prune: this.config.bool('prune'), - memory: this.memory, - prefix: this.config.str('index-prefix', this.config.prefix), - maxTxs: this.config.uint('max-txs') - }); - } - - if (this.config.bool('index-filter')) { - this.filterindex = new FilterIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - memory: this.config.bool('memory'), - prefix: this.config.str('index-prefix', this.config.prefix) - }); - } - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - // Bind to errors - this.chain.on('error', err => this.error(err)); - this.mempool.on('error', err => this.error(err)); - this.pool.on('error', err => this.error(err)); - this.miner.on('error', err => this.error(err)); - - if (this.txindex) - this.txindex.on('error', err => this.error(err)); - - if (this.addrindex) - this.addrindex.on('error', err => this.error(err)); - - if (this.filterindex) - this.filterindex.on('error', err => this.error(err)); - - if (this.http) - this.http.on('error', err => this.error(err)); - - this.mempool.on('tx', (tx) => { - this.miner.cpu.notifyEntry(); - this.emit('tx', tx); - }); - - this.chain.on('connect', async (entry, block) => { - try { - await this.mempool._addBlock(entry, block.txs); - } catch (e) { - this.error(e); - } - this.emit('block', block); - this.emit('connect', entry, block); - }); - - this.chain.on('disconnect', async (entry, block) => { - try { - await this.mempool._removeBlock(entry, block.txs); - } catch (e) { - this.error(e); - } - this.emit('disconnect', entry, block); - }); - - this.chain.on('reorganize', async (tip, competitor) => { - try { - await this.mempool._handleReorg(); - } catch (e) { - this.error(e); - } - this.emit('reorganize', tip, competitor); - }); - - this.chain.on('reset', async (tip) => { - try { - await this.mempool._reset(); - } catch (e) { - this.error(e); - } - this.emit('reset', tip); - }); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @alias FullNode#open - * @returns {Promise} - */ - - async open() { - assert$j(!this.opened, 'FullNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.blocks.open(); - await this.chain.open(); - await this.mempool.open(); - await this.miner.open(); - await this.pool.open(); - - if (this.txindex) - await this.txindex.open(); - - if (this.addrindex) - await this.addrindex.open(); - - if (this.filterindex) - await this.filterindex.open(); - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @alias FullNode#close - * @returns {Promise} - */ - - async close() { - assert$j(this.opened, 'FullNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - if (this.txindex) - await this.txindex.close(); - - if (this.addrindex) - await this.addrindex.close(); - - if (this.filterindex) - await this.filterindex.close(); - - await this.closePlugins(); - - await this.pool.close(); - await this.miner.close(); - await this.mempool.close(); - await this.chain.close(); - await this.blocks.close(); - - await this.handleClose(); - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - scan(start, filter, iter) { - return this.chain.scan(start, filter, iter); - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX|Block} item - * @returns {Promise} - */ - - async broadcast(item) { - try { - await this.pool.broadcast(item); - } catch (e) { - this.emit('error', e); - } - } - - /** - * Add transaction to mempool, broadcast. - * @param {TX} tx - * @returns {Promise} - */ - - async sendTX(tx) { - let missing; - - try { - missing = await this.mempool.addTX(tx); - } catch (err) { - if (err.type === 'VerifyError' && err.score === 0) { - this.error(err); - this.logger.warning('Verification failed for tx: %h.', tx.hash()); - this.logger.warning('Attempting to broadcast anyway...'); - this.broadcast(tx); - return; - } - throw err; - } - - if (missing) { - this.logger.warning('TX was orphaned in mempool: %h.', tx.hash()); - this.logger.warning('Attempting to broadcast anyway...'); - this.broadcast(tx); - return; - } - - // We need to announce by hand if - // we're running in selfish mode. - if (this.pool.options.selfish) - this.broadcast(tx); - } - - /** - * Add transaction to mempool, broadcast. Silence errors. - * @param {TX} tx - * @returns {Promise} - */ - - async relay(tx) { - try { - await this.sendTX(tx); - } catch (e) { - this.error(e); - } - } - - /** - * Connect to the network. - * @returns {Promise} - */ - - connect() { - return this.pool.connect(); - } - - /** - * Disconnect from the network. - * @returns {Promise} - */ - - disconnect() { - return this.pool.disconnect(); - } - - /** - * Start the blockchain sync. - */ - - startSync() { - if (this.txindex) - this.txindex.sync(); - - if (this.addrindex) - this.addrindex.sync(); - - if (this.filterindex) - this.filterindex.sync(); - - return this.pool.startSync(); - } - - /** - * Stop syncing the blockchain. - */ - - stopSync() { - return this.pool.stopSync(); - } - - /** - * Retrieve a block from the chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Block}. - */ - - getBlock(hash) { - return this.chain.getBlock(hash); - } - - /** - * Retrieve a coin from the mempool or chain database. - * Takes into account spent coins in the mempool. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCoin(hash, index) { - const coin = this.mempool.getCoin(hash, index); - - if (coin) - return coin; - - if (this.mempool.isSpent(hash, index)) - return null; - - return this.chain.getCoin(hash, index); - } - - /** - * Retrieve transactions pertaining to an - * address from the mempool or chain database. - * @param {Address} addr - * @param {Object} options - * @param {Number} options.limit - * @param {Number} options.reverse - * @param {Buffer} options.after - * @returns {Promise} - Returns {@link TXMeta}[]. - */ - - async getMetaByAddress(addr, options = {}) { - if (!this.txindex || !this.addrindex) - return []; - - const {reverse, after} = options; - let {limit} = options; - - let metas = []; - - const confirmed = async () => { - const hashes = await this.addrindex.getHashesByAddress( - addr, {limit, reverse, after}); - - for (const hash of hashes) { - const mtx = await this.txindex.getMeta(hash); - assert$j(mtx); - metas.push(mtx); - } - }; - - const unconfirmed = () => { - const mempool = this.mempool.getMetaByAddress( - addr, {limit, reverse, after}); - - metas = metas.concat(mempool); - }; - - if (reverse) - unconfirmed(); - else - await confirmed(); - - if (metas.length > 0) - limit -= metas.length; - - if (limit <= 0) - return metas; - - if (reverse) - await confirmed(); - else - unconfirmed(); - - return metas; - } - - /** - * Retrieve a transaction from the mempool or chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TXMeta}. - */ - - async getMeta(hash) { - const meta = this.mempool.getMeta(hash); - - if (meta) - return meta; - - if (this.txindex) - return this.txindex.getMeta(hash); - - return null; - } - - /** - * Retrieve a spent coin viewpoint from mempool or chain database. - * @param {TXMeta} meta - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getMetaView(meta) { - if (meta.height === -1) - return this.mempool.getSpentView(meta.tx); - - if (this.txindex) - return this.txindex.getSpentView(meta.tx); - - return null; - } - - /** - * Retrieve transactions pertaining to an - * address from the mempool or chain database. - * @param {Address} addr - * @param {Object} options - * @param {Number} options.limit - * @param {Number} options.reverse - * @param {Buffer} options.after - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getTXByAddress(addr, options = {}) { - const mtxs = await this.getMetaByAddress(addr, options); - const out = []; - - for (const mtx of mtxs) - out.push(mtx.tx); - - return out; - } - - /** - * Retrieve a transaction from the mempool or chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - async getTX(hash) { - const mtx = await this.getMeta(hash); - - if (!mtx) - return null; - - return mtx.tx; - } - - /** - * Test whether the mempool or chain contains a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasTX(hash) { - if (this.mempool.hasEntry(hash)) - return true; - - if (this.txindex) - return this.txindex.hasTX(hash); - - return false; - } - - /** - * Retrieve compact filter by hash. - * @param {Hash | Number} hash - * @returns {Promise} - Returns {@link Buffer}. - */ - - async getBlockFilter(hash) { - if (!this.filterindex) - return null; - - if (typeof hash === 'number') - hash = await this.chain.getHash(hash); - - if (!hash) - return null; - - return this.filterindex.getFilter(hash); - } - } - - /* - * Expose - */ - - var fullnode = FullNode; - - /*! - * spvnode.js - spv node for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$i = assert_1$g; - const Chain$2 = chain$1; - const Pool = pool; - const Node$1 = node$1; - const HTTP$2 = http$1; - const RPC$2 = rpc$1; - - /** - * SPV Node - * Create an spv node which only maintains - * a chain, a pool, and an http server. - * @alias module:node.SPVNode - * @extends Node - */ - - class SPVNode extends Node$1 { - /** - * Create SPV node. - * @constructor - * @param {Object?} options - * @param {Buffer?} options.sslKey - * @param {Buffer?} options.sslCert - * @param {Number?} options.httpPort - * @param {String?} options.httpHost - */ - - constructor(options) { - super('bcoin', 'bcoin.conf', 'debug.log', options); - - this.opened = false; - - // SPV flag. - this.spv = true; - - this.chain = new Chain$2({ - network: this.network, - logger: this.logger, - prefix: this.config.prefix, - memory: this.memory, - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - entryCache: this.config.uint('entry-cache'), - forceFlags: this.config.bool('force-flags'), - checkpoints: this.config.bool('checkpoints'), - bip91: this.config.bool('bip91'), - bip148: this.config.bool('bip148'), - spv: true - }); - - this.pool = new Pool({ - network: this.network, - logger: this.logger, - chain: this.chain, - prefix: this.config.prefix, - proxy: this.config.str('proxy'), - onion: this.config.bool('onion'), - upnp: this.config.bool('upnp'), - seeds: this.config.array('seeds'), - nodes: this.config.array('nodes'), - only: this.config.array('only'), - maxOutbound: this.config.uint('max-outbound'), - createSocket: this.config.func('create-socket'), - memory: this.memory, - selfish: true, - listen: false - }); - - this.rpc = new RPC$2(this); - - this.http = new HTTP$2({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors') - }); - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - // Bind to errors - this.chain.on('error', err => this.error(err)); - this.pool.on('error', err => this.error(err)); - - if (this.http) - this.http.on('error', err => this.error(err)); - - this.pool.on('tx', (tx) => { - this.emit('tx', tx); - }); - - this.chain.on('block', (block) => { - this.emit('block', block); - }); - - this.chain.on('connect', async (entry, block) => { - this.emit('connect', entry, block); - }); - - this.chain.on('disconnect', (entry, block) => { - this.emit('disconnect', entry, block); - }); - - this.chain.on('reorganize', (tip, competitor) => { - this.emit('reorganize', tip, competitor); - }); - - this.chain.on('reset', (tip) => { - this.emit('reset', tip); - }); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @returns {Promise} - */ - - async open() { - assert$i(!this.opened, 'SPVNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.chain.open(); - await this.pool.open(); - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @returns {Promise} - */ - - async close() { - assert$i(this.opened, 'SPVNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - await this.closePlugins(); - - await this.pool.close(); - await this.chain.close(); - await this.handleClose(); - } - - /** - * Scan for any missed transactions. - * Note that this will replay the blockchain sync. - * @param {Number|Hash} start - Start block. - * @returns {Promise} - */ - - async scan(start) { - throw new Error('Not implemented.'); - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX|Block} item - * @returns {Promise} - */ - - async broadcast(item) { - try { - await this.pool.broadcast(item); - } catch (e) { - this.emit('error', e); - } - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX} tx - * @returns {Promise} - */ - - sendTX(tx) { - return this.broadcast(tx); - } - - /** - * Broadcast a transaction. Silence errors. - * @param {TX} tx - * @returns {Promise} - */ - - relay(tx) { - return this.broadcast(tx); - } - - /** - * Connect to the network. - * @returns {Promise} - */ - - connect() { - return this.pool.connect(); - } - - /** - * Disconnect from the network. - * @returns {Promise} - */ - - disconnect() { - return this.pool.disconnect(); - } - - /** - * Start the blockchain sync. - */ - - startSync() { - return this.pool.startSync(); - } - - /** - * Stop syncing the blockchain. - */ - - stopSync() { - return this.pool.stopSync(); - } - } - - /* - * Expose - */ - - var spvnode = SPVNode; - - /*! - * node/index.js - node for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module node - */ - - node$2.FullNode = fullnode; - node$2.HTTP = http$1; - node$2.Node = node$1; - node$2.RPC = rpc$1; - node$2.SPVNode = spvnode; - - var primitives = {}; - - /*! - * primitives/index.js - bitcoin primitives for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module primitives - */ - - primitives.AbstractBlock = abstractblock; - primitives.Address = address$1; - primitives.Block = block$1; - primitives.Coin = coin; - primitives.Headers = headers; - primitives.Input = input; - primitives.InvItem = invitem; - primitives.KeyRing = keyring; - primitives.MemBlock = memblock; - primitives.MerkleBlock = merkleblock; - primitives.MTX = mtx$1.exports; - primitives.Outpoint = outpoint; - primitives.Output = output; - primitives.TX = tx; - primitives.TXMeta = txmeta; - - var protocol = {}; - - /*! - * protocol/index.js - protocol constants for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module protocol - */ - - protocol.consensus = consensus$s; - protocol.errors = errors$2; - protocol.Network = network; - protocol.networks = networks$1; - protocol.policy = policy$9; - protocol.timedata = timedata; - - var script$1 = {}; - - /*! - * sigcache.js - signature cache for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$h = assert_1$g; - const {BufferMap: BufferMap$1} = bufferMap; - const secp256k1$1 = secp256k1$b.exports; - - /** - * Signature cache. - * @alias module:script.SigCache - * @property {Number} size - * @property {Hash[]} keys - * @property {Object} valid - */ - - class SigCache { - /** - * Create a signature cache. - * @constructor - * @param {Number} [size=10000] - */ - - constructor(size) { - if (size == null) - size = 10000; - - assert$h((size >>> 0) === size); - - this.size = size; - this.keys = []; - this.valid = new BufferMap$1(); - } - - /** - * Resize the sigcache. - * @param {Number} size - */ - - resize(size) { - assert$h((size >>> 0) === size); - - this.size = size; - this.keys.length = 0; - this.valid.clear(); - } - - /** - * Add item to the sigcache. - * Potentially evict a random member. - * @param {Hash} msg - Sig hash. - * @param {Buffer} sig - * @param {Buffer} key - */ - - add(msg, sig, key) { - if (this.size === 0) - return; - - this.valid.set(msg, new SigCacheEntry(sig, key)); - - if (this.keys.length >= this.size) { - const i = Math.floor(Math.random() * this.keys.length); - const k = this.keys[i]; - this.valid.delete(k); - this.keys[i] = msg; - } else { - this.keys.push(msg); - } - } - - /** - * Test whether the sig exists. - * @param {Hash} msg - Sig hash. - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - has(msg, sig, key) { - const entry = this.valid.get(msg); - - if (!entry) - return false; - - return entry.equals(sig, key); - } - - /** - * Verify a signature, testing - * it against the cache first. - * @param {Buffer} msg - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - verify(msg, sig, key) { - if (this.size === 0) - return secp256k1$1.verifyDER(msg, sig, key); - - if (this.has(msg, sig, key)) - return true; - - const result = secp256k1$1.verifyDER(msg, sig, key); - - if (!result) - return false; - - this.add(msg, sig, key); - - return true; - } - } - - /** - * Signature Cache Entry - * @ignore - * @property {Buffer} sig - * @property {Buffer} key - */ - - class SigCacheEntry { - /** - * Create a cache entry. - * @constructor - * @param {Buffer} sig - * @param {Buffer} key - */ - - constructor(sig, key) { - this.sig = Buffer.from(sig); - this.key = Buffer.from(key); - } - - /** - * Compare an entry to a sig and key. - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - equals(sig, key) { - return this.sig.equals(sig) && this.key.equals(key); - } - } - - /* - * Expose - */ - - var sigcache = SigCache; - - /*! - * script/index.js - bitcoin scripting for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module script - */ - - script$1.common = common$s; - script$1.Opcode = opcode$1; - script$1.Program = program$1; - script$1.Script = script$2; - script$1.ScriptError = scripterror; - script$1.ScriptNum = scriptnum; - script$1.sigcache = sigcache; - script$1.Stack = stack; - script$1.Witness = witness; - - var wallet$2 = {}; - - /*! - * path.js - path object for wallets - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$g = assert_1$g; - const bio$5 = bufio; - const Address$5 = address$1; - const {encoding: encoding$2} = bio$5; - const {inspectSymbol: inspectSymbol$4} = utils; - - /** - * Path - * @alias module:wallet.Path - * @property {String} name - Account name. - * @property {Number} account - Account index. - * @property {Number} branch - Branch index. - * @property {Number} index - Address index. - */ - - class Path$4 { - /** - * Create a path. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - this.keyType = Path$4.types.HD; - - this.name = null; // Passed in by caller. - this.account = 0; - - this.type = Address$5.types.PUBKEYHASH; - this.version = -1; - - this.branch = -1; - this.index = -1; - - this.encrypted = false; - this.data = null; - - this.hash = null; // Passed in by caller. - - if (options) - this.fromOptions(options); - } - - /** - * Instantiate path from options object. - * @private - * @param {Object} options - * @returns {Path} - */ - - fromOptions(options) { - this.keyType = options.keyType; - - this.name = options.name; - this.account = options.account; - this.branch = options.branch; - this.index = options.index; - - this.encrypted = options.encrypted; - this.data = options.data; - - this.type = options.type; - this.version = options.version; - this.hash = options.hash; - - return this; - } - - /** - * Instantiate path from options object. - * @param {Object} options - * @returns {Path} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Clone the path object. - * @returns {Path} - */ - - clone() { - const path = new this.constructor(); - - path.keyType = this.keyType; - - path.name = this.name; - path.account = this.account; - path.branch = this.branch; - path.index = this.index; - - path.encrypted = this.encrypted; - path.data = this.data; - - path.type = this.type; - path.version = this.version; - path.hash = this.hash; - - return path; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$5.read(data); - - this.account = br.readU32(); - this.keyType = br.readU8(); - - const flags = br.readU8(); - - this.type = flags & 7; - this.version = flags >>> 3; - - if (this.version === 0x1f) - this.version = -1; - - switch (this.keyType) { - case Path$4.types.HD: - this.branch = br.readU32(); - this.index = br.readU32(); - break; - case Path$4.types.KEY: - this.encrypted = br.readU8() === 1; - this.data = br.readVarBytes(); - break; - case Path$4.types.ADDRESS: - // Hash will be passed in by caller. - break; - default: - assert$g(false); - break; - } - - return this; - } - - /** - * Instantiate path from serialized data. - * @param {Buffer} data - * @returns {Path} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - size += 6; - - switch (this.keyType) { - case Path$4.types.HD: - size += 8; - break; - case Path$4.types.KEY: - size += 1; - size += encoding$2.sizeVarBytes(this.data); - break; - } - - return size; - } - - /** - * Serialize path. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$5.write(size); - - bw.writeU32(this.account); - bw.writeU8(this.keyType); - - let version = this.version; - - if (version === -1) - version = 0x1f; - - const flags = (version << 3) | this.type; - - bw.writeU8(flags); - - switch (this.keyType) { - case Path$4.types.HD: - assert$g(!this.data); - assert$g(this.index !== -1); - bw.writeU32(this.branch); - bw.writeU32(this.index); - break; - case Path$4.types.KEY: - assert$g(this.data); - assert$g(this.index === -1); - bw.writeU8(this.encrypted ? 1 : 0); - bw.writeVarBytes(this.data); - break; - case Path$4.types.ADDRESS: - assert$g(!this.data); - assert$g(this.index === -1); - break; - default: - assert$g(false); - break; - } - - return bw.render(); - } - - /** - * Inject properties from address. - * @private - * @param {Account} account - * @param {Address} address - */ - - fromAddress(account, address) { - this.keyType = Path$4.types.ADDRESS; - this.name = account.name; - this.account = account.accountIndex; - this.version = address.version; - this.type = address.type; - this.hash = address.getHash(); - return this; - } - - /** - * Instantiate path from address. - * @param {Account} account - * @param {Address} address - * @returns {Path} - */ - - static fromAddress(account, address) { - return new this().fromAddress(account, address); - } - - /** - * Convert path object to string derivation path. - * @returns {String} - */ - - toPath() { - if (this.keyType !== Path$4.types.HD) - return null; - - return `m/${this.account}'/${this.branch}/${this.index}`; - } - - /** - * Convert path object to an address (currently unused). - * @returns {Address} - */ - - toAddress() { - return Address$5.fromHash(this.hash, this.type, this.version); - } - - /** - * Convert path to a json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - name: this.name, - account: this.account, - change: this.branch === 1, - derivation: this.toPath() - }; - } - - /** - * Inspect the path. - * @returns {String} - */ - - [inspectSymbol$4]() { - return ``; - } - } - - /** - * Path types. - * @enum {Number} - * @default - */ - - Path$4.types = { - HD: 0, - KEY: 1, - ADDRESS: 2 - }; - - /** - * Path types. - * @enum {Number} - * @default - */ - - Path$4.typesByVal = [ - 'HD', - 'KEY', - 'ADDRESS' - ]; - - /** - * Expose - */ - - var path$3 = Path$4; - - var common$5 = {}; - - /*! - * common.js - commonly required functions for wallet. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - (function (exports) { - - const {BufferMap} = bufferMap; - - /** - * @exports wallet/common - */ - - const common = exports; - - /** - * Test whether a string is eligible - * to be used as a name or ID. - * @param {String} key - * @returns {Boolean} - */ - - common.isName = function isName(key) { - if (typeof key !== 'string') - return false; - - if (key.length === 0) - return false; - - if (!/^[\-\._0-9A-Za-z]+$/.test(key)) - return false; - - // Prevents __proto__ - // from being used. - switch (key[0]) { - case '_': - case '-': - case '.': - return false; - } - - switch (key[key.length - 1]) { - case '_': - case '-': - case '.': - return false; - } - - return key.length >= 1 && key.length <= 40; - }; - - /** - * Sort an array of transactions by time. - * @param {TX[]} txs - * @returns {TX[]} - */ - - common.sortTX = function sortTX(txs) { - return txs.sort((a, b) => { - return a.mtime - b.mtime; - }); - }; - - /** - * Sort an array of coins by height. - * @param {Coin[]} txs - * @returns {Coin[]} - */ - - common.sortCoins = function sortCoins(coins) { - return coins.sort((a, b) => { - a = a.height === -1 ? 0x7fffffff : a.height; - b = b.height === -1 ? 0x7fffffff : b.height; - return a - b; - }); - }; - - /** - * Sort an array of transactions in dependency order. - * @param {TX[]} txs - * @returns {TX[]} - */ - - common.sortDeps = function sortDeps(txs) { - const map = new BufferMap(); - - for (const tx of txs) { - const hash = tx.hash(); - map.set(hash, tx); - } - - const depMap = new BufferMap(); - const depCount = new BufferMap(); - const top = []; - - for (const [hash, tx] of map) { - depCount.set(hash, 0); - - let hasDeps = false; - - for (const input of tx.inputs) { - const prev = input.prevout.hash; - - if (!map.has(prev)) - continue; - - const count = depCount.get(hash); - depCount.set(hash, count + 1); - hasDeps = true; - - if (!depMap.has(prev)) - depMap.set(prev, []); - - depMap.get(prev).push(tx); - } - - if (hasDeps) - continue; - - top.push(tx); - } - - const result = []; - - for (const tx of top) { - const deps = depMap.get(tx.hash()); - - result.push(tx); - - if (!deps) - continue; - - for (const tx of deps) { - let count = depCount.get(tx.hash()); - - if (--count === 0) - top.push(tx); - - depCount.set(tx.hash(), count); - } - } - - return result; - }; - }(common$5)); - - /*! - * walletkey.js - walletkey object for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const Address$4 = address$1; - const KeyRing$2 = keyring; - const Path$3 = path$3; - - /** - * Wallet Key - * Represents a key ring which amounts to an address. - * @alias module:wallet.WalletKey - * @extends KeyRing - */ - - class WalletKey$2 extends KeyRing$2 { - /** - * Create a wallet key. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super(options); - - this.keyType = Path$3.types.HD; - - this.name = null; - this.account = -1; - this.branch = -1; - this.index = -1; - } - - /** - * Convert an WalletKey to a more json-friendly object. - * @returns {Object} - */ - - toJSON(network) { - return { - name: this.name, - account: this.account, - branch: this.branch, - index: this.index, - witness: this.witness, - nested: this.nested, - publicKey: this.publicKey.toString('hex'), - script: this.script ? this.script.toRaw().toString('hex') : null, - program: this.witness ? this.getProgram().toRaw().toString('hex') : null, - type: Address$4.typesByVal[this.getType()].toLowerCase(), - address: this.getAddress('string', network) - }; - } - - /** - * Inject properties from hd key. - * @private - * @param {Account} account - * @param {HDPrivateKey|HDPublicKey} key - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - fromHD(account, key, branch, index) { - this.keyType = Path$3.types.HD; - this.name = account.name; - this.account = account.accountIndex; - this.branch = branch; - this.index = index; - this.witness = account.witness; - this.nested = branch === 2; - - if (key.privateKey) - return this.fromPrivate(key.privateKey); - - return this.fromPublic(key.publicKey); - } - - /** - * Instantiate a wallet key from hd key. - * @param {Account} account - * @param {HDPrivateKey|HDPublicKey} key - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - static fromHD(account, key, branch, index) { - return new this().fromHD(account, key, branch, index); - } - - /** - * Inject properties from imported data. - * @private - * @param {Account} account - * @param {Buffer} data - * @returns {WalletKey} - */ - - fromImport(account, data) { - this.keyType = Path$3.types.KEY; - this.name = account.name; - this.account = account.accountIndex; - this.witness = account.witness; - return this.fromRaw(data); - } - - /** - * Instantiate a wallet key from imported data. - * @param {Account} account - * @param {Buffer} data - * @returns {WalletKey} - */ - - static fromImport(account, data) { - return new this().fromImport(account, data); - } - - /** - * Inject properties from key. - * @private - * @param {Account} account - * @param {KeyRing} ring - * @returns {WalletKey} - */ - - fromRing(account, ring) { - this.keyType = Path$3.types.KEY; - this.name = account.name; - this.account = account.accountIndex; - this.witness = account.witness; - return this.fromOptions(ring); - } - - /** - * Instantiate a wallet key from regular key. - * @param {Account} account - * @param {KeyRing} ring - * @returns {WalletKey} - */ - - static fromRing(account, ring) { - return new this().fromRing(account, ring); - } - - /** - * Convert wallet key to a path. - * @returns {Path} - */ - - toPath() { - const path = new Path$3(); - - path.name = this.name; - path.account = this.account; - - switch (this.keyType) { - case Path$3.types.HD: - path.branch = this.branch; - path.index = this.index; - break; - case Path$3.types.KEY: - path.data = this.toRaw(); - break; - } - - path.keyType = this.keyType; - - path.version = this.getVersion(); - path.type = this.getType(); - path.hash = this.getHash(); - - return path; - } - - /** - * Test whether an object is a WalletKey. - * @param {Object} obj - * @returns {Boolean} - */ - - static isWalletKey(obj) { - return obj instanceof WalletKey$2; - } - } - - /* - * Expose - */ - - var walletkey = WalletKey$2; - - /*! - * account.js - account object for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$f = assert_1$g; - const bio$4 = bufio; - const binary = binary$4; - const Path$2 = path$3; - const common$4 = common$5; - const Script$7 = script$2; - const WalletKey$1 = walletkey; - const {HDPublicKey: HDPublicKey$1} = hd$1; - const {inspectSymbol: inspectSymbol$3} = utils; - - /** - * Account - * Represents a BIP44 Account belonging to a {@link Wallet}. - * Note that this object does not enforce locks. Any method - * that does a write is internal API only and will lead - * to race conditions if used elsewhere. - * @alias module:wallet.Account - */ - - class Account$2 { - /** - * Create an account. - * @constructor - * @param {Object} options - */ - - constructor(wdb, options) { - assert$f(wdb, 'Database is required.'); - - this.wdb = wdb; - this.network = wdb.network; - - this.wid = 0; - this.id = null; - this.accountIndex = 0; - this.name = null; - this.initialized = false; - this.witness = wdb.options.witness === true; - this.watchOnly = false; - this.type = Account$2.types.PUBKEYHASH; - this.m = 1; - this.n = 1; - this.receiveDepth = 0; - this.changeDepth = 0; - this.nestedDepth = 0; - this.lookahead = 10; - this.accountKey = null; - this.keys = []; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$f(options, 'Options are required.'); - assert$f((options.wid >>> 0) === options.wid); - assert$f(common$4.isName(options.id), 'Bad Wallet ID.'); - assert$f(HDPublicKey$1.isHDPublicKey(options.accountKey), - 'Account key is required.'); - assert$f((options.accountIndex >>> 0) === options.accountIndex, - 'Account index is required.'); - - this.wid = options.wid; - this.id = options.id; - - if (options.accountIndex != null) { - assert$f((options.accountIndex >>> 0) === options.accountIndex); - this.accountIndex = options.accountIndex; - } - - if (options.name != null) { - assert$f(common$4.isName(options.name), 'Bad account name.'); - this.name = options.name; - } - - if (options.initialized != null) { - assert$f(typeof options.initialized === 'boolean'); - this.initialized = options.initialized; - } - - if (options.witness != null) { - assert$f(typeof options.witness === 'boolean'); - this.witness = options.witness; - } - - if (options.watchOnly != null) { - assert$f(typeof options.watchOnly === 'boolean'); - this.watchOnly = options.watchOnly; - } - - if (options.type != null) { - if (typeof options.type === 'string') { - this.type = Account$2.types[options.type.toUpperCase()]; - assert$f(this.type != null); - } else { - assert$f(typeof options.type === 'number'); - this.type = options.type; - assert$f(Account$2.typesByVal[this.type]); - } - } - - if (options.m != null) { - assert$f((options.m & 0xff) === options.m); - this.m = options.m; - } - - if (options.n != null) { - assert$f((options.n & 0xff) === options.n); - this.n = options.n; - } - - if (options.receiveDepth != null) { - assert$f((options.receiveDepth >>> 0) === options.receiveDepth); - this.receiveDepth = options.receiveDepth; - } - - if (options.changeDepth != null) { - assert$f((options.changeDepth >>> 0) === options.changeDepth); - this.changeDepth = options.changeDepth; - } - - if (options.nestedDepth != null) { - assert$f((options.nestedDepth >>> 0) === options.nestedDepth); - this.nestedDepth = options.nestedDepth; - } - - if (options.lookahead != null) { - assert$f((options.lookahead >>> 0) === options.lookahead); - assert$f(options.lookahead >= 0); - assert$f(options.lookahead <= Account$2.MAX_LOOKAHEAD); - this.lookahead = options.lookahead; - } - - this.accountKey = options.accountKey; - - if (this.n > 1) - this.type = Account$2.types.MULTISIG; - - if (!this.name) - this.name = this.accountIndex.toString(10); - - if (this.m < 1 || this.m > this.n) - throw new Error('m ranges between 1 and n'); - - if (options.keys) { - assert$f(Array.isArray(options.keys)); - for (const key of options.keys) - this.pushKey(key); - } - - return this; - } - - /** - * Instantiate account from options. - * @param {WalletDB} wdb - * @param {Object} options - * @returns {Account} - */ - - static fromOptions(wdb, options) { - return new this(wdb).fromOptions(options); - } - - /** - * Attempt to intialize the account (generating - * the first addresses along with the lookahead - * addresses). Called automatically from the - * walletdb. - * @returns {Promise} - */ - - async init(b) { - // Waiting for more keys. - if (this.keys.length !== this.n - 1) { - assert$f(!this.initialized); - this.save(b); - return; - } - - assert$f(this.receiveDepth === 0); - assert$f(this.changeDepth === 0); - assert$f(this.nestedDepth === 0); - - this.initialized = true; - - await this.initDepth(b); - } - - /** - * Add a public account key to the account (multisig). - * Does not update the database. - * @param {HDPublicKey} key - Account (bip44) - * key (can be in base58 form). - * @throws Error on non-hdkey/non-accountkey. - */ - - pushKey(key) { - if (typeof key === 'string') - key = HDPublicKey$1.fromBase58(key, this.network); - - if (!HDPublicKey$1.isHDPublicKey(key)) - throw new Error('Must add HD keys to wallet.'); - - if (!key.isAccount()) - throw new Error('Must add HD account keys to BIP44 wallet.'); - - if (this.type !== Account$2.types.MULTISIG) - throw new Error('Cannot add keys to non-multisig wallet.'); - - if (key.equals(this.accountKey)) - throw new Error('Cannot add own key.'); - - const index = binary.insert(this.keys, key, cmp, true); - - if (index === -1) - return false; - - if (this.keys.length > this.n - 1) { - binary.remove(this.keys, key, cmp); - throw new Error('Cannot add more keys.'); - } - - return true; - } - - /** - * Remove a public account key to the account (multisig). - * Does not update the database. - * @param {HDPublicKey} key - Account (bip44) - * key (can be in base58 form). - * @throws Error on non-hdkey/non-accountkey. - */ - - spliceKey(key) { - if (typeof key === 'string') - key = HDPublicKey$1.fromBase58(key, this.network); - - if (!HDPublicKey$1.isHDPublicKey(key)) - throw new Error('Must add HD keys to wallet.'); - - if (!key.isAccount()) - throw new Error('Must add HD account keys to BIP44 wallet.'); - - if (this.type !== Account$2.types.MULTISIG) - throw new Error('Cannot remove keys from non-multisig wallet.'); - - if (this.keys.length === this.n - 1) - throw new Error('Cannot remove key.'); - - return binary.remove(this.keys, key, cmp); - } - - /** - * Add a public account key to the account (multisig). - * Saves the key in the wallet database. - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async addSharedKey(b, key) { - const result = this.pushKey(key); - - if (await this.hasDuplicate()) { - this.spliceKey(key); - throw new Error('Cannot add a key from another account.'); - } - - // Try to initialize again. - await this.init(b); - - return result; - } - - /** - * Ensure accounts are not sharing keys. - * @private - * @returns {Promise} - */ - - async hasDuplicate() { - if (this.keys.length !== this.n - 1) - return false; - - const ring = this.deriveReceive(0); - const hash = ring.getScriptHash(); - - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Remove a public account key from the account (multisig). - * Remove the key from the wallet database. - * @param {HDPublicKey} key - * @returns {Promise} - */ - - removeSharedKey(b, key) { - const result = this.spliceKey(key); - - if (!result) - return false; - - this.save(b); - - return true; - } - - /** - * Create a new receiving address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createReceive(b) { - return this.createKey(b, 0); - } - - /** - * Create a new change address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createChange(b) { - return this.createKey(b, 1); - } - - /** - * Create a new change address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createNested(b) { - return this.createKey(b, 2); - } - - /** - * Create a new address (increments depth). - * @param {Boolean} change - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async createKey(b, branch) { - let key, lookahead; - - switch (branch) { - case 0: - key = this.deriveReceive(this.receiveDepth); - lookahead = this.deriveReceive(this.receiveDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.receiveDepth += 1; - this.receive = key; - break; - case 1: - key = this.deriveChange(this.changeDepth); - lookahead = this.deriveChange(this.changeDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.changeDepth += 1; - this.change = key; - break; - case 2: - key = this.deriveNested(this.nestedDepth); - lookahead = this.deriveNested(this.nestedDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.nestedDepth += 1; - this.nested = key; - break; - default: - throw new Error(`Bad branch: ${branch}.`); - } - - this.save(b); - - return key; - } - - /** - * Derive a receiving address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveReceive(index, master) { - return this.deriveKey(0, index, master); - } - - /** - * Derive a change address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveChange(index, master) { - return this.deriveKey(1, index, master); - } - - /** - * Derive a nested address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveNested(index, master) { - if (!this.witness) - throw new Error('Cannot derive nested on non-witness account.'); - - return this.deriveKey(2, index, master); - } - - /** - * Derive an address from `path` object. - * @param {Path} path - * @param {MasterKey} master - * @returns {WalletKey} - */ - - derivePath(path, master) { - switch (path.keyType) { - case Path$2.types.HD: { - return this.deriveKey(path.branch, path.index, master); - } - case Path$2.types.KEY: { - assert$f(this.type === Account$2.types.PUBKEYHASH); - - let data = path.data; - - if (path.encrypted) { - data = master.decipher(data, path.hash); - if (!data) - return null; - } - - return WalletKey$1.fromImport(this, data); - } - case Path$2.types.ADDRESS: { - return null; - } - default: { - throw new Error('Bad key type.'); - } - } - } - - /** - * Derive an address at `index`. Do not increment depth. - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - deriveKey(branch, index, master) { - assert$f(typeof branch === 'number'); - - const keys = []; - - let key; - if (master && master.key && !this.watchOnly) { - const type = this.network.keyPrefix.coinType; - key = master.key.deriveAccount(44, type, this.accountIndex); - key = key.derive(branch).derive(index); - } else { - key = this.accountKey.derive(branch).derive(index); - } - - const ring = WalletKey$1.fromHD(this, key, branch, index); - - switch (this.type) { - case Account$2.types.PUBKEYHASH: - break; - case Account$2.types.MULTISIG: - keys.push(key.publicKey); - - for (const shared of this.keys) { - const key = shared.derive(branch).derive(index); - keys.push(key.publicKey); - } - - ring.script = Script$7.fromMultisig(this.m, this.n, keys); - - break; - } - - return ring; - } - - /** - * Save the account to the database. Necessary - * when address depth and keys change. - * @returns {Promise} - */ - - save(b) { - return this.wdb.saveAccount(b, this); - } - - /** - * Save addresses to path map. - * @param {WalletKey[]} rings - * @returns {Promise} - */ - - saveKey(b, ring) { - return this.wdb.saveKey(b, this.wid, ring); - } - - /** - * Save paths to path map. - * @param {Path[]} rings - * @returns {Promise} - */ - - savePath(b, path) { - return this.wdb.savePath(b, this.wid, path); - } - - /** - * Initialize address depths (including lookahead). - * @returns {Promise} - */ - - async initDepth(b) { - // Receive Address - this.receiveDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - } - - // Change Address - this.changeDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - - // Nested Address - if (this.witness) { - this.nestedDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - } - } - - this.save(b); - } - - /** - * Allocate new lookahead addresses if necessary. - * @param {Number} receiveDepth - * @param {Number} changeDepth - * @param {Number} nestedDepth - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async syncDepth(b, receive, change, nested) { - let derived = false; - let result = null; - - if (receive > this.receiveDepth) { - const depth = this.receiveDepth + this.lookahead; - - assert$f(receive <= depth + 1); - - for (let i = depth; i < receive + this.lookahead; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - result = key; - } - - this.receiveDepth = receive; - - derived = true; - } - - if (change > this.changeDepth) { - const depth = this.changeDepth + this.lookahead; - - assert$f(change <= depth + 1); - - for (let i = depth; i < change + this.lookahead; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - - this.changeDepth = change; - - derived = true; - } - - if (this.witness && nested > this.nestedDepth) { - const depth = this.nestedDepth + this.lookahead; - - assert$f(nested <= depth + 1); - - for (let i = depth; i < nested + this.lookahead; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - result = key; - } - - this.nestedDepth = nested; - - derived = true; - result = this.nested; - } - - if (derived) - this.save(b); - - return result; - } - - /** - * Allocate new lookahead addresses. - * @param {Number} lookahead - * @returns {Promise} - */ - - async setLookahead(b, lookahead) { - if (lookahead === this.lookahead) - return; - - if (lookahead < this.lookahead) { - const diff = this.lookahead - lookahead; - - this.receiveDepth += diff; - this.changeDepth += diff; - - if (this.witness) - this.nestedDepth += diff; - - this.lookahead = lookahead; - - this.save(b); - - return; - } - - { - const depth = this.receiveDepth + this.lookahead; - const target = this.receiveDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - } - } - - { - const depth = this.changeDepth + this.lookahead; - const target = this.changeDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - } - - if (this.witness) { - const depth = this.nestedDepth + this.lookahead; - const target = this.nestedDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - } - } - - this.lookahead = lookahead; - this.save(b); - } - - /** - * Get current receive key. - * @returns {WalletKey} - */ - - receiveKey() { - if (!this.initialized) - return null; - - return this.deriveReceive(this.receiveDepth - 1); - } - - /** - * Get current change key. - * @returns {WalletKey} - */ - - changeKey() { - if (!this.initialized) - return null; - - return this.deriveChange(this.changeDepth - 1); - } - - /** - * Get current nested key. - * @returns {WalletKey} - */ - - nestedKey() { - if (!this.initialized) - return null; - - if (!this.witness) - return null; - - return this.deriveNested(this.nestedDepth - 1); - } - - /** - * Get current receive address. - * @returns {Address} - */ - - receiveAddress() { - const key = this.receiveKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Get current change address. - * @returns {Address} - */ - - changeAddress() { - const key = this.changeKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Get current nested address. - * @returns {Address} - */ - - nestedAddress() { - const key = this.nestedKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Convert the account to a more inspection-friendly object. - * @returns {Object} - */ - - [inspectSymbol$3]() { - const receive = this.receiveAddress(); - const change = this.changeAddress(); - const nested = this.nestedAddress(); - - return { - id: this.id, - wid: this.wid, - name: this.name, - network: this.network.type, - initialized: this.initialized, - witness: this.witness, - watchOnly: this.watchOnly, - type: Account$2.typesByVal[this.type].toLowerCase(), - m: this.m, - n: this.n, - accountIndex: this.accountIndex, - receiveDepth: this.receiveDepth, - changeDepth: this.changeDepth, - nestedDepth: this.nestedDepth, - lookahead: this.lookahead, - receiveAddress: receive ? receive.toString(this.network) : null, - changeAddress: change ? change.toString(this.network) : null, - nestedAddress: nested ? nested.toString(this.network) : null, - accountKey: this.accountKey.toBase58(this.network), - keys: this.keys.map(key => key.toBase58(this.network)) - }; - } - - /** - * Convert the account to an object suitable for - * serialization. - * @returns {Object} - */ - - toJSON(balance) { - const receive = this.receiveAddress(); - const change = this.changeAddress(); - const nested = this.nestedAddress(); - - return { - name: this.name, - initialized: this.initialized, - witness: this.witness, - watchOnly: this.watchOnly, - type: Account$2.typesByVal[this.type].toLowerCase(), - m: this.m, - n: this.n, - accountIndex: this.accountIndex, - receiveDepth: this.receiveDepth, - changeDepth: this.changeDepth, - nestedDepth: this.nestedDepth, - lookahead: this.lookahead, - receiveAddress: receive ? receive.toString(this.network) : null, - changeAddress: change ? change.toString(this.network) : null, - nestedAddress: nested ? nested.toString(this.network) : null, - accountKey: this.accountKey.toBase58(this.network), - keys: this.keys.map(key => key.toBase58(this.network)), - balance: balance ? balance.toJSON(true) : null - }; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 92; - size += this.keys.length * 74; - return size; - } - - /** - * Serialize the account. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$4.write(size); - - let flags = 0; - - if (this.initialized) - flags |= 1; - - if (this.witness) - flags |= 2; - - bw.writeU8(flags); - bw.writeU8(this.type); - bw.writeU8(this.m); - bw.writeU8(this.n); - bw.writeU32(this.receiveDepth); - bw.writeU32(this.changeDepth); - bw.writeU32(this.nestedDepth); - bw.writeU8(this.lookahead); - writeKey(this.accountKey, bw); - bw.writeU8(this.keys.length); - - for (const key of this.keys) - writeKey(key, bw); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - * @returns {Object} - */ - - fromRaw(data) { - const br = bio$4.read(data); - const flags = br.readU8(); - - this.initialized = (flags & 1) !== 0; - this.witness = (flags & 2) !== 0; - this.type = br.readU8(); - this.m = br.readU8(); - this.n = br.readU8(); - this.receiveDepth = br.readU32(); - this.changeDepth = br.readU32(); - this.nestedDepth = br.readU32(); - this.lookahead = br.readU8(); - this.accountKey = readKey(br); - - assert$f(this.type < Account$2.typesByVal.length); - - const count = br.readU8(); - - for (let i = 0; i < count; i++) { - const key = readKey(br); - binary.insert(this.keys, key, cmp, true); - } - - return this; - } - - /** - * Instantiate a account from serialized data. - * @param {WalletDB} data - * @param {Buffer} data - * @returns {Account} - */ - - static fromRaw(wdb, data) { - return new this(wdb).fromRaw(data); - } - - /** - * Test an object to see if it is a Account. - * @param {Object} obj - * @returns {Boolean} - */ - - static isAccount(obj) { - return obj instanceof Account$2; - } - } - - /** - * Account types. - * @enum {Number} - * @default - */ - - Account$2.types = { - PUBKEYHASH: 0, - MULTISIG: 1 - }; - - /** - * Account types by value. - * @const {Object} - */ - - Account$2.typesByVal = [ - 'PUBKEYHASH', - 'MULTISIG' - ]; - - /** - * Default address lookahead. - * @const {Number} - */ - - Account$2.MAX_LOOKAHEAD = 40; - - /* - * Helpers - */ - - function cmp(a, b) { - return a.compare(b); - } - - function writeKey(key, bw) { - bw.writeU8(key.depth); - bw.writeU32BE(key.parentFingerPrint); - bw.writeU32BE(key.childIndex); - bw.writeBytes(key.chainCode); - bw.writeBytes(key.publicKey); - } - - function readKey(br) { - const key = new HDPublicKey$1(); - key.depth = br.readU8(); - key.parentFingerPrint = br.readU32BE(); - key.childIndex = br.readU32BE(); - key.chainCode = br.readBytes(32); - key.publicKey = br.readBytes(33); - return key; - } - - /* - * Expose - */ - - var account = Account$2; - - /*! - * client.js - http client for wallets - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$e = assert_1$g; - const NodeClient$1 = node$3; - const util$3 = util$y; - const TX$1 = tx; - const hash256$2 = hash256$k.exports; - - const parsers = { - 'block connect': (entry, txs) => parseBlock(entry, txs), - 'block disconnect': entry => [parseEntry(entry)], - 'block rescan': (entry, txs) => parseBlock(entry, txs), - 'chain reset': entry => [parseEntry(entry)], - 'tx': tx => [TX$1.fromRaw(tx)] - }; - - class WalletClient extends NodeClient$1 { - constructor(options) { - super(options); - } - - bind(event, handler) { - const parser = parsers[event]; - - if (!parser) { - super.bind(event, handler); - return; - } - - super.bind(event, (...args) => { - return handler(...parser(...args)); - }); - } - - hook(event, handler) { - const parser = parsers[event]; - - if (!parser) { - super.hook(event, handler); - return; - } - - super.hook(event, (...args) => { - return handler(...parser(...args)); - }); - } - - async getTip() { - return parseEntry(await super.getTip()); - } - - async getEntry(block) { - if (Buffer.isBuffer(block)) - block = util$3.revHex(block); - - return parseEntry(await super.getEntry(block)); - } - - async send(tx) { - return super.send(tx.toRaw()); - } - - async setFilter(filter) { - return super.setFilter(filter.toRaw()); - } - - async rescan(start) { - if (Buffer.isBuffer(start)) - start = util$3.revHex(start); - - return super.rescan(start); - } - } - - /* - * Helpers - */ - - function parseEntry(data) { - assert$e(Buffer.isBuffer(data)); - assert$e(data.length >= 84); - - const hash = hash256$2.digest(data.slice(0, 80)); - - return { - hash: hash, - height: data.readUInt32LE(80, true), - time: data.readUInt32LE(68, true) - }; - } - - function parseBlock(entry, txs) { - const block = parseEntry(entry); - const out = []; - - for (const tx of txs) - out.push(TX$1.fromRaw(tx)); - - return [block, out]; - } - - /* - * Expose - */ - - var client = WalletClient; - - /*! - * server.js - http server for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$d = assert_1$g; - const path$2 = require$$1__default["default"]; - const {Server} = bweb$2; - const Validator$1 = bval; - const base58$1 = base58$9.exports; - const MTX$3 = mtx$1.exports; - const Outpoint$4 = outpoint; - const Script$6 = script$2; - const sha256$1 = sha256$9.exports; - const random$1 = random$9; - const {safeEqual: safeEqual$2} = safe; - const Network$1 = network; - const Address$3 = address$1; - const KeyRing$1 = keyring; - const Mnemonic$3 = mnemonic; - const HDPrivateKey$1 = _private; - const HDPublicKey = _public; - const common$3 = common$5; - const pkg$1 = pkg$4; - - /** - * HTTP - * @alias module:wallet.HTTP - */ - - class HTTP$1 extends Server { - /** - * Create an http server. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(new HTTPOptions(options)); - - this.network = this.options.network; - this.logger = this.options.logger.context('wallet-http'); - this.wdb = this.options.node.wdb; - this.rpc = this.options.node.rpc; - - this.init(); - } - - /** - * Initialize http server. - * @private - */ - - init() { - this.on('request', (req, res) => { - if (req.method === 'POST' && req.pathname === '/') - return; - - this.logger.debug('Request for method=%s path=%s (%s).', - req.method, req.pathname, req.socket.remoteAddress); - }); - - this.on('listening', (address) => { - this.logger.info('Wallet HTTP server listening on %s (port=%d).', - address.address, address.port); - }); - - this.initRouter(); - this.initSockets(); - } - - /** - * Initialize routes. - * @private - */ - - initRouter() { - if (this.options.cors) - this.use(this.cors()); - - if (!this.options.noAuth) { - this.use(this.basicAuth({ - hash: sha256$1.digest, - password: this.options.apiKey, - realm: 'wallet' - })); - } - - this.use(this.bodyParser({ - type: 'json' - })); - - this.use(async (req, res) => { - if (!this.options.walletAuth) { - req.admin = true; - return; - } - - const valid = Validator$1.fromRequest(req); - const token = valid.buf('token'); - - if (token && safeEqual$2(token, this.options.adminToken)) { - req.admin = true; - return; - } - - if (req.method === 'POST' && req.path.length === 0) { - res.json(403); - return; - } - }); - - this.use(this.jsonRPC()); - this.use(this.router()); - - this.error((err, req, res) => { - const code = err.statusCode || 500; - res.json(code, { - error: { - type: err.type, - code: err.code, - message: err.message - } - }); - }); - - this.hook(async (req, res) => { - if (req.path.length < 2) - return; - - if (req.path[0] !== 'wallet') - return; - - if (req.method === 'PUT' && req.path.length === 2) - return; - - const valid = Validator$1.fromRequest(req); - const id = valid.str('id'); - const token = valid.buf('token'); - - if (!id) { - res.json(403); - return; - } - - if (req.admin || !this.options.walletAuth) { - const wallet = await this.wdb.get(id); - - if (!wallet) { - res.json(404); - return; - } - - req.wallet = wallet; - - return; - } - - if (!token) { - res.json(403); - return; - } - - let wallet; - try { - wallet = await this.wdb.auth(id, token); - } catch (err) { - this.logger.info('Auth failure for %s: %s.', id, err.message); - res.json(403); - return; - } - - if (!wallet) { - res.json(404); - return; - } - - req.wallet = wallet; - - this.logger.info('Successful auth for %s.', id); - }); - - // Info - this.get('/', async (req, res) => { - res.json(200, { - version: pkg$1.version, - network: this.network.type - }); - }); - - // Rescan - this.post('/rescan', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const valid = Validator$1.fromRequest(req); - const height = valid.u32('height'); - - res.json(200, { success: true }); - - await this.wdb.rescan(height); - }); - - // Resend - this.post('/resend', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - await this.wdb.resend(); - - res.json(200, { success: true }); - }); - - // Backup WalletDB - this.post('/backup', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const valid = Validator$1.fromRequest(req); - const path = valid.str('path'); - - enforce(path, 'Path is required.'); - - await this.wdb.backup(path); - - res.json(200, { success: true }); - }); - - // List wallets - this.get('/wallet', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const wallets = await this.wdb.getWallets(); - res.json(200, wallets); - }); - - // Get wallet - this.get('/wallet/:id', async (req, res) => { - const balance = await req.wallet.getBalance(); - res.json(200, req.wallet.toJSON(false, balance)); - }); - - // Get wallet master key - this.get('/wallet/:id/master', (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - res.json(200, req.wallet.master.toJSON(this.network, true)); - }); - - // Create wallet - this.put('/wallet/:id', async (req, res) => { - const valid = Validator$1.fromRequest(req); - - let master = valid.str('master'); - let mnemonic = valid.str('mnemonic'); - let accountKey = valid.str('accountKey'); - - if (master) - master = HDPrivateKey$1.fromBase58(master, this.network); - - if (mnemonic) - mnemonic = Mnemonic$3.fromPhrase(mnemonic); - - if (accountKey) - accountKey = HDPublicKey.fromBase58(accountKey, this.network); - - const wallet = await this.wdb.create({ - id: valid.str('id'), - type: valid.str('type'), - m: valid.u32('m'), - n: valid.u32('n'), - passphrase: valid.str('passphrase'), - master: master, - mnemonic: mnemonic, - witness: valid.bool('witness'), - accountKey: accountKey, - watchOnly: valid.bool('watchOnly') - }); - - const balance = await wallet.getBalance(); - - res.json(200, wallet.toJSON(false, balance)); - }); - - // List accounts - this.get('/wallet/:id/account', async (req, res) => { - const accounts = await req.wallet.getAccounts(); - res.json(200, accounts); - }); - - // Get account - this.get('/wallet/:id/account/:account', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const account = await req.wallet.getAccount(acct); - - if (!account) { - res.json(404); - return; - } - - const balance = await req.wallet.getBalance(account.accountIndex); - - res.json(200, account.toJSON(balance)); - }); - - // Create account - this.put('/wallet/:id/account/:account', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - - let accountKey = valid.get('accountKey'); - - if (accountKey) - accountKey = HDPublicKey.fromBase58(accountKey, this.network); - - const options = { - name: valid.str('account'), - witness: valid.bool('witness'), - type: valid.str('type'), - m: valid.u32('m'), - n: valid.u32('n'), - accountKey: accountKey, - lookahead: valid.u32('lookahead') - }; - - const account = await req.wallet.createAccount(options, passphrase); - const balance = await req.wallet.getBalance(account.accountIndex); - - res.json(200, account.toJSON(balance)); - }); - - // Change passphrase - this.post('/wallet/:id/passphrase', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const old = valid.str('old'); - - enforce(passphrase, 'Passphrase is required.'); - - await req.wallet.setPassphrase(passphrase, old); - - res.json(200, { success: true }); - }); - - // Unlock wallet - this.post('/wallet/:id/unlock', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const timeout = valid.u32('timeout'); - - enforce(passphrase, 'Passphrase is required.'); - - await req.wallet.unlock(passphrase, timeout); - - res.json(200, { success: true }); - }); - - // Lock wallet - this.post('/wallet/:id/lock', async (req, res) => { - await req.wallet.lock(); - res.json(200, { success: true }); - }); - - // Import key - this.post('/wallet/:id/import', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const passphrase = valid.str('passphrase'); - const pub = valid.buf('publicKey'); - const priv = valid.str('privateKey'); - const address = valid.str('address'); - - if (pub) { - const key = KeyRing$1.fromPublic(pub); - await req.wallet.importKey(acct, key); - res.json(200, { success: true }); - return; - } - - if (priv) { - const key = KeyRing$1.fromSecret(priv, this.network); - await req.wallet.importKey(acct, key, passphrase); - res.json(200, { success: true }); - return; - } - - if (address) { - const addr = Address$3.fromString(address, this.network); - await req.wallet.importAddress(acct, addr); - res.json(200, { success: true }); - return; - } - - enforce(false, 'Key or address is required.'); - }); - - // Generate new token - this.post('/wallet/:id/retoken', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const token = await req.wallet.retoken(passphrase); - - res.json(200, { - token: token.toString('hex') - }); - }); - - // Send TX - this.post('/wallet/:id/send', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs', []); - - const options = { - rate: valid.u64('rate'), - blocks: valid.u32('blocks'), - maxFee: valid.u64('maxFee'), - selection: valid.str('selection'), - smart: valid.bool('smart'), - account: valid.str('account'), - sort: valid.bool('sort'), - subtractFee: valid.bool('subtractFee'), - subtractIndex: valid.i32('subtractIndex'), - depth: valid.u32(['confirmations', 'depth']), - outputs: [] - }; - - for (const output of outputs) { - const valid = new Validator$1(output); - - let addr = valid.str('address'); - let script = valid.buf('script'); - - if (addr) - addr = Address$3.fromString(addr, this.network); - - if (script) - script = Script$6.fromRaw(script); - - options.outputs.push({ - address: addr, - script: script, - value: valid.u64('value') - }); - } - - const tx = await req.wallet.send(options, passphrase); - - const details = await req.wallet.getDetails(tx.hash()); - - res.json(200, details.toJSON(this.network, this.wdb.height)); - }); - - // Create TX - this.post('/wallet/:id/create', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs', []); - const sign = valid.bool('sign', true); - - const options = { - rate: valid.u64('rate'), - blocks: valid.u32('blocks'), - maxFee: valid.u64('maxFee'), - selection: valid.str('selection'), - smart: valid.bool('smart'), - account: valid.str('account'), - sort: valid.bool('sort'), - subtractFee: valid.bool('subtractFee'), - subtractIndex: valid.i32('subtractIndex'), - depth: valid.u32(['confirmations', 'depth']), - template: valid.bool('template', sign), - outputs: [] - }; - - for (const output of outputs) { - const valid = new Validator$1(output); - - let addr = valid.str('address'); - let script = valid.buf('script'); - - if (addr) - addr = Address$3.fromString(addr, this.network); - - if (script) - script = Script$6.fromRaw(script); - - options.outputs.push({ - address: addr, - script: script, - value: valid.u64('value') - }); - } - - const tx = await req.wallet.createTX(options); - - if (sign) - await req.wallet.sign(tx, passphrase); - - res.json(200, tx.getJSON(this.network)); - }); - - // Sign TX - this.post('/wallet/:id/sign', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const raw = valid.buf('tx'); - - enforce(raw, 'TX is required.'); - - const tx = MTX$3.fromRaw(raw); - tx.view = await req.wallet.getCoinView(tx); - - await req.wallet.sign(tx, passphrase); - - res.json(200, tx.getJSON(this.network)); - }); - - // Zap Wallet TXs - this.post('/wallet/:id/zap', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const age = valid.u32('age'); - - enforce(age, 'Age is required.'); - - await req.wallet.zap(acct, age); - - res.json(200, { success: true }); - }); - - // Abandon Wallet TX - this.del('/wallet/:id/tx/:hash', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce(hash, 'Hash is required.'); - - await req.wallet.abandon(hash); - - res.json(200, { success: true }); - }); - - // List blocks - this.get('/wallet/:id/block', async (req, res) => { - const heights = await req.wallet.getBlocks(); - res.json(200, heights); - }); - - // Get Block Record - this.get('/wallet/:id/block/:height', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const height = valid.u32('height'); - - enforce(height != null, 'Height is required.'); - - const block = await req.wallet.getBlock(height); - - if (!block) { - res.json(404); - return; - } - - res.json(200, block.toJSON()); - }); - - // Add key - this.put('/wallet/:id/shared-key', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const b58 = valid.str('accountKey'); - - enforce(b58, 'Key is required.'); - - const key = HDPublicKey.fromBase58(b58, this.network); - - const added = await req.wallet.addSharedKey(acct, key); - - res.json(200, { - success: true, - addedKey: added - }); - }); - - // Remove key - this.del('/wallet/:id/shared-key', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const b58 = valid.str('accountKey'); - - enforce(b58, 'Key is required.'); - - const key = HDPublicKey.fromBase58(b58, this.network); - - const removed = await req.wallet.removeSharedKey(acct, key); - - res.json(200, { - success: true, - removedKey: removed - }); - }); - - // Get key by address - this.get('/wallet/:id/key/:address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const b58 = valid.str('address'); - - enforce(b58, 'Address is required.'); - - const addr = Address$3.fromString(b58, this.network); - const key = await req.wallet.getKey(addr); - - if (!key) { - res.json(404); - return; - } - - res.json(200, key.toJSON(this.network)); - }); - - // Get private key - this.get('/wallet/:id/wif/:address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const address = valid.str('address'); - const passphrase = valid.str('passphrase'); - - enforce(address, 'Address is required.'); - - const addr = Address$3.fromString(address, this.network); - const key = await req.wallet.getPrivateKey(addr, passphrase); - - if (!key) { - res.json(404); - return; - } - - res.json(200, { privateKey: key.toSecret(this.network) }); - }); - - // Create address - this.post('/wallet/:id/address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createReceive(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Create change address - this.post('/wallet/:id/change', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createChange(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Create nested address - this.post('/wallet/:id/nested', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createNested(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Wallet Balance - this.get('/wallet/:id/balance', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const balance = await req.wallet.getBalance(acct); - - if (!balance) { - res.json(404); - return; - } - - res.json(200, balance.toJSON()); - }); - - // Wallet UTXOs - this.get('/wallet/:id/coin', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const coins = await req.wallet.getCoins(acct); - const result = []; - - common$3.sortCoins(coins); - - for (const coin of coins) - result.push(coin.getJSON(this.network)); - - res.json(200, result); - }); - - // Locked coins - this.get('/wallet/:id/locked', async (req, res) => { - const locked = req.wallet.getLocked(); - const result = []; - - for (const outpoint of locked) - result.push(outpoint.toJSON()); - - res.json(200, result); - }); - - // Lock coin - this.put('/wallet/:id/locked/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const outpoint = new Outpoint$4(hash, index); - - req.wallet.lockCoin(outpoint); - - res.json(200, { success: true }); - }); - - // Unlock coin - this.del('/wallet/:id/locked/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const outpoint = new Outpoint$4(hash, index); - - req.wallet.unlockCoin(outpoint); - - res.json(200, { success: true }); - }); - - // Wallet Coin - this.get('/wallet/:id/coin/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const coin = await req.wallet.getCoin(hash, index); - - if (!coin) { - res.json(404); - return; - } - - res.json(200, coin.getJSON(this.network)); - }); - - // Wallet TXs - this.get('/wallet/:id/tx/history', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const txs = await req.wallet.getHistory(acct); - - common$3.sortTX(txs); - - const details = await req.wallet.toDetails(txs); - - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet Pending TXs - this.get('/wallet/:id/tx/unconfirmed', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const txs = await req.wallet.getPending(acct); - - common$3.sortTX(txs); - - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet TXs within time range - this.get('/wallet/:id/tx/range', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - - const options = { - start: valid.u32('start'), - end: valid.u32('end'), - limit: valid.u32('limit'), - reverse: valid.bool('reverse') - }; - - const txs = await req.wallet.getRange(acct, options); - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Last Wallet TXs - this.get('/wallet/:id/tx/last', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const limit = valid.u32('limit'); - const txs = await req.wallet.getLast(acct, limit); - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet TX - this.get('/wallet/:id/tx/:hash', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce(hash, 'Hash is required.'); - - const tx = await req.wallet.getTX(hash); - - if (!tx) { - res.json(404); - return; - } - - const details = await req.wallet.toDetails(tx); - - res.json(200, details.toJSON(this.network, this.wdb.height)); - }); - - // Resend - this.post('/wallet/:id/resend', async (req, res) => { - await req.wallet.resend(); - res.json(200, { success: true }); - }); - } - - /** - * Initialize websockets. - * @private - */ - - initSockets() { - const handleTX = (event, wallet, tx, details) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = details.toJSON(this.network, this.wdb.liveHeight()); - - if (this.channel(name)) - this.to(name, event, wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', event, wallet.id, json); - }; - - this.wdb.on('tx', (wallet, tx, details) => { - handleTX('tx', wallet, tx, details); - }); - - this.wdb.on('confirmed', (wallet, tx, details) => { - handleTX('confirmed', wallet, tx, details); - }); - - this.wdb.on('unconfirmed', (wallet, tx, details) => { - handleTX('unconfirmed', wallet, tx, details); - }); - - this.wdb.on('conflict', (wallet, tx, details) => { - handleTX('conflict', wallet, tx, details); - }); - - this.wdb.on('balance', (wallet, balance) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = balance.toJSON(); - - if (this.channel(name)) - this.to(name, 'balance', wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', 'balance', wallet.id, json); - }); - - this.wdb.on('address', (wallet, receive) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = []; - - for (const addr of receive) - json.push(addr.toJSON(this.network)); - - if (this.channel(name)) - this.to(name, 'address', wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', 'address', wallet.id, json); - }); - } - - /** - * Handle new websocket. - * @private - * @param {WebSocket} socket - */ - - handleSocket(socket) { - socket.hook('auth', (...args) => { - if (socket.channel('auth')) - throw new Error('Already authed.'); - - if (!this.options.noAuth) { - const valid = new Validator$1(args); - const key = valid.str(0, ''); - - if (key.length > 255) - throw new Error('Invalid API key.'); - - const data = Buffer.from(key, 'utf8'); - const hash = sha256$1.digest(data); - - if (!safeEqual$2(hash, this.options.apiHash)) - throw new Error('Invalid API key.'); - } - - socket.join('auth'); - - this.logger.info('Successful auth from %s.', socket.host); - - this.handleAuth(socket); - - return null; - }); - } - - /** - * Handle new auth'd websocket. - * @private - * @param {WebSocket} socket - */ - - handleAuth(socket) { - socket.hook('join', async (...args) => { - const valid = new Validator$1(args); - const id = valid.str(0, ''); - const token = valid.buf(1); - - if (!id) - throw new Error('Invalid parameter.'); - - if (!this.options.walletAuth) { - socket.join('admin'); - } else if (token) { - if (safeEqual$2(token, this.options.adminToken)) - socket.join('admin'); - } - - if (socket.channel('admin') || !this.options.walletAuth) { - socket.join(`w:${id}`); - return null; - } - - if (id === '*') - throw new Error('Bad token.'); - - if (!token) - throw new Error('Invalid parameter.'); - - let wallet; - try { - wallet = await this.wdb.auth(id, token); - } catch (e) { - this.logger.info('Wallet auth failure for %s: %s.', id, e.message); - throw new Error('Bad token.'); - } - - if (!wallet) - throw new Error('Wallet does not exist.'); - - this.logger.info('Successful wallet auth for %s.', id); - - socket.join(`w:${id}`); - - return null; - }); - - socket.hook('leave', (...args) => { - const valid = new Validator$1(args); - const id = valid.str(0, ''); - - if (!id) - throw new Error('Invalid parameter.'); - - socket.leave(`w:${id}`); - - return null; - }); - } - } - - class HTTPOptions { - /** - * HTTPOptions - * @alias module:http.HTTPOptions - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network$1.primary; - this.logger = null; - this.node = null; - this.apiKey = base58$1.encode(random$1.randomBytes(20)); - this.apiHash = sha256$1.digest(Buffer.from(this.apiKey, 'ascii')); - this.adminToken = random$1.randomBytes(32); - this.serviceHash = this.apiHash; - this.noAuth = false; - this.cors = false; - this.walletAuth = false; - - this.prefix = null; - this.host = '127.0.0.1'; - this.port = 8080; - this.ssl = false; - this.keyFile = null; - this.certFile = null; - - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {HTTPOptions} - */ - - fromOptions(options) { - assert$d(options); - assert$d(options.node && typeof options.node === 'object', - 'HTTP Server requires a WalletDB.'); - - this.node = options.node; - this.network = options.node.network; - this.logger = options.node.logger; - this.port = this.network.walletPort; - - if (options.logger != null) { - assert$d(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.apiKey != null) { - assert$d(typeof options.apiKey === 'string', - 'API key must be a string.'); - assert$d(options.apiKey.length <= 255, - 'API key must be under 255 bytes.'); - this.apiKey = options.apiKey; - this.apiHash = sha256$1.digest(Buffer.from(this.apiKey, 'ascii')); - } - - if (options.adminToken != null) { - if (typeof options.adminToken === 'string') { - assert$d(options.adminToken.length === 64, - 'Admin token must be a 32 byte hex string.'); - const token = Buffer.from(options.adminToken, 'hex'); - assert$d(token.length === 32, - 'Admin token must be a 32 byte hex string.'); - this.adminToken = token; - } else { - assert$d(Buffer.isBuffer(options.adminToken), - 'Admin token must be a hex string or buffer.'); - assert$d(options.adminToken.length === 32, - 'Admin token must be 32 bytes.'); - this.adminToken = options.adminToken; - } - } - - if (options.noAuth != null) { - assert$d(typeof options.noAuth === 'boolean'); - this.noAuth = options.noAuth; - } - - if (options.cors != null) { - assert$d(typeof options.cors === 'boolean'); - this.cors = options.cors; - } - - if (options.walletAuth != null) { - assert$d(typeof options.walletAuth === 'boolean'); - this.walletAuth = options.walletAuth; - } - - if (options.prefix != null) { - assert$d(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.keyFile = path$2.join(this.prefix, 'key.pem'); - this.certFile = path$2.join(this.prefix, 'cert.pem'); - } - - if (options.host != null) { - assert$d(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$d((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.ssl != null) { - assert$d(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$d(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$d(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - // Allow no-auth implicitly - // if we're listening locally. - if (!options.apiKey) { - if (this.host === '127.0.0.1' || this.host === '::1') - this.noAuth = true; - } - - return this; - } - - /** - * Instantiate http options from object. - * @param {Object} options - * @returns {HTTPOptions} - */ - - static fromOptions(options) { - return new HTTPOptions().fromOptions(options); - } - } - - /* - * Helpers - */ - - function enforce(value, msg) { - if (!value) { - const err = new Error(msg); - err.statusCode = 400; - throw err; - } - } - - /* - * Expose - */ - - var http = HTTP$1; - - var layout$2 = {}; - - /*! - * layout.js - data layout for wallets - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const bdb$1 = bdb$d; - - /* - * Wallet Database Layout: - * V -> db version - * O -> flags - * R -> chain sync state - * D -> wallet id depth - * p[addr-hash] -> wallet ids - * P[wid][addr-hash] -> path data - * r[wid][index][hash] -> path account index - * w[wid] -> wallet - * W[wid] -> wallet id - * l[id] -> wid - * a[wid][index] -> account - * i[wid][name] -> account index - * n[wid][index] -> account name - * h[height] -> recent block hash - * b[height] -> block->wid map - * o[hash][index] -> outpoint->wid map - * T[hash] -> tx->wid map - * t[wid]* -> txdb - */ - - layout$2.wdb = { - V: bdb$1.key('V'), - O: bdb$1.key('O'), - R: bdb$1.key('R'), - D: bdb$1.key('D'), - p: bdb$1.key('p', ['hash']), - P: bdb$1.key('P', ['uint32', 'hash']), - r: bdb$1.key('r', ['uint32', 'uint32', 'hash']), - w: bdb$1.key('w', ['uint32']), - W: bdb$1.key('W', ['uint32']), - l: bdb$1.key('l', ['ascii']), - a: bdb$1.key('a', ['uint32', 'uint32']), - i: bdb$1.key('i', ['uint32', 'ascii']), - n: bdb$1.key('n', ['uint32', 'uint32']), - h: bdb$1.key('h', ['uint32']), - b: bdb$1.key('b', ['uint32']), - o: bdb$1.key('o', ['hash256', 'uint32']), - T: bdb$1.key('T', ['hash256']), - t: bdb$1.key('t', ['uint32']) - }; - - /* - * TXDB Database Layout: - * R -> wallet balance - * r[account] -> account balance - * t[hash] -> extended tx - * c[hash][index] -> coin - * d[hash][index] -> undo coin - * s[hash][index] -> spent by hash - * p[hash] -> dummy (pending flag) - * m[time][hash] -> dummy (tx by time) - * h[height][hash] -> dummy (tx by height) - * T[account][hash] -> dummy (tx by account) - * P[account][hash] -> dummy (pending tx by account) - * M[account][time][hash] -> dummy (tx by time + account) - * H[account][height][hash] -> dummy (tx by height + account) - * C[account][hash][index] -> dummy (coin by account) - * b[height] -> block record - */ - - layout$2.txdb = { - prefix: bdb$1.key('t', ['uint32']), - R: bdb$1.key('R'), - r: bdb$1.key('r', ['uint32']), - t: bdb$1.key('t', ['hash256']), - c: bdb$1.key('c', ['hash256', 'uint32']), - d: bdb$1.key('d', ['hash256', 'uint32']), - s: bdb$1.key('s', ['hash256', 'uint32']), - p: bdb$1.key('p', ['hash256']), - m: bdb$1.key('m', ['uint32', 'hash256']), - h: bdb$1.key('h', ['uint32', 'hash256']), - T: bdb$1.key('T', ['uint32', 'hash256']), - P: bdb$1.key('P', ['uint32', 'hash256']), - M: bdb$1.key('M', ['uint32', 'uint32', 'hash256']), - H: bdb$1.key('H', ['uint32', 'uint32', 'hash256']), - C: bdb$1.key('C', ['uint32', 'hash256', 'uint32']), - b: bdb$1.key('b', ['uint32']) - }; - - var aes$5 = {exports: {}}; - - var aes$4 = {}; - - /*! - * aes.js - aes128/192/256 for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on openssl/openssl: - * Based on code entered into the public domain by Vincent Rijmen. - * https://github.com/openssl/openssl/blob/master/crypto/aes/aes_core.c - * - * Resources: - * https://en.wikipedia.org/wiki/Advanced_Encryption_Standard - * http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf - * https://github.com/openssl/openssl/blob/master/crypto/aes/aes_core.c - */ - - const assert$c = assert_1$d; - - /* - * Constants - */ - - const TE0 = new Uint32Array([ - 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, - 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, - 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, - 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, - 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, - 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, - 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, - 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, - 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, - 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, - 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, - 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, - 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, - 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, - 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, - 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, - 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, - 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, - 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, - 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, - 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, - 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, - 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, - 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, - 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, - 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, - 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, - 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, - 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, - 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, - 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, - 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, - 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, - 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, - 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, - 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, - 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, - 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, - 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, - 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, - 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, - 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, - 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, - 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, - 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, - 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, - 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, - 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, - 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, - 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, - 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, - 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, - 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, - 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, - 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, - 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, - 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, - 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, - 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, - 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, - 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, - 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, - 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, - 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a - ]); - - const TE1 = new Uint32Array([ - 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, - 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, - 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, - 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, - 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, - 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, - 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, - 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, - 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, - 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, - 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, - 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, - 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, - 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, - 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, - 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, - 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, - 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, - 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, - 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, - 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, - 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, - 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, - 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, - 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, - 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, - 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, - 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, - 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, - 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, - 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, - 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, - 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, - 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, - 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, - 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, - 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, - 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, - 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, - 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, - 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, - 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, - 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, - 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, - 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, - 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, - 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, - 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, - 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, - 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, - 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, - 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, - 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, - 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, - 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, - 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, - 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, - 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, - 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, - 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, - 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, - 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, - 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, - 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616 - ]); - - const TE2 = new Uint32Array([ - 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, - 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, - 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, - 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, - 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, - 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, - 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, - 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, - 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, - 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, - 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, - 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, - 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, - 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, - 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, - 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, - 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, - 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, - 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, - 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, - 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, - 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, - 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, - 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, - 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, - 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, - 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, - 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, - 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, - 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, - 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, - 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, - 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, - 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, - 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, - 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, - 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, - 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, - 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, - 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, - 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, - 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, - 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, - 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, - 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, - 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, - 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, - 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, - 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, - 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, - 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, - 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, - 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, - 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, - 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, - 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, - 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, - 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, - 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, - 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, - 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, - 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, - 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, - 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16 - ]); - - const TE3 = new Uint32Array([ - 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, - 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, - 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, - 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, - 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, - 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, - 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, - 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, - 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, - 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, - 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, - 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, - 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, - 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, - 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, - 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, - 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, - 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, - 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, - 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, - 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, - 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, - 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, - 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, - 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, - 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, - 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, - 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, - 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, - 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, - 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, - 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, - 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, - 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, - 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, - 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, - 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, - 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, - 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, - 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, - 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, - 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, - 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, - 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, - 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, - 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, - 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, - 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, - 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, - 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, - 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, - 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, - 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, - 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, - 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, - 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, - 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, - 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, - 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, - 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, - 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, - 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, - 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, - 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c - ]); - - const TD0 = new Uint32Array([ - 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, - 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, - 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, - 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, - 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, - 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, - 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, - 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, - 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, - 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, - 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, - 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, - 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, - 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, - 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, - 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, - 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, - 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, - 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, - 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, - 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, - 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, - 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, - 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, - 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, - 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, - 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, - 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, - 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, - 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, - 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, - 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, - 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, - 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, - 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, - 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, - 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, - 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, - 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, - 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, - 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, - 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, - 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, - 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, - 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, - 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, - 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, - 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, - 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, - 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, - 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, - 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, - 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, - 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, - 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, - 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, - 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, - 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, - 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, - 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, - 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, - 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, - 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, - 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742 - ]); - - const TD1 = new Uint32Array([ - 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, - 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, - 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, - 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, - 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, - 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, - 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, - 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, - 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, - 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, - 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, - 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, - 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, - 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, - 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, - 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, - 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, - 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, - 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, - 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, - 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, - 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, - 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, - 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, - 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, - 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, - 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, - 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, - 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, - 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, - 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, - 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, - 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, - 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, - 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, - 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, - 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, - 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, - 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, - 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, - 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, - 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, - 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, - 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, - 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, - 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, - 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, - 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, - 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, - 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, - 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, - 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, - 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, - 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, - 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, - 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, - 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, - 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, - 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, - 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, - 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, - 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, - 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, - 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857 - ]); - - const TD2 = new Uint32Array([ - 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, - 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, - 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, - 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, - 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, - 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, - 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, - 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, - 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, - 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, - 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, - 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, - 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, - 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, - 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, - 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, - 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, - 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, - 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, - 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, - 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, - 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, - 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, - 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, - 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, - 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, - 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, - 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, - 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, - 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, - 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, - 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, - 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, - 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, - 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, - 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, - 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, - 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, - 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, - 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, - 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, - 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, - 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, - 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, - 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, - 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, - 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, - 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, - 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, - 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, - 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, - 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, - 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, - 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, - 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, - 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, - 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, - 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, - 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, - 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, - 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, - 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, - 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, - 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8 - ]); - - const TD3 = new Uint32Array([ - 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, - 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, - 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, - 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, - 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, - 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, - 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, - 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, - 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, - 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, - 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, - 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, - 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, - 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, - 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, - 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, - 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, - 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, - 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, - 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, - 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, - 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, - 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, - 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, - 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, - 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, - 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, - 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, - 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, - 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, - 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, - 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, - 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, - 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, - 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, - 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, - 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, - 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, - 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, - 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, - 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, - 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, - 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, - 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, - 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, - 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, - 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, - 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, - 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, - 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, - 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, - 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, - 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, - 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, - 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, - 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, - 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, - 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, - 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, - 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, - 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, - 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, - 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, - 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0 - ]); - - const TD4 = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, - 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, - 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, - 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, - 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, - 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, - 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, - 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, - 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, - 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, - 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, - 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, - 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, - 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, - 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, - 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, - 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, - 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, - 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, - 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, - 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, - 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d - ]); - - const RCON = new Uint32Array([ - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1b000000, 0x36000000 - ]); - - /** - * AES - */ - - class AES$1 { - constructor(bits = 256) { - assert$c((bits >>> 0) === bits); - - this.bits = bits; - this.rounds = getRounds(bits); - this.key = null; - this.encKey = null; - this.decKey = null; - } - - get blockSize() { - return 16; - } - - init(key) { - assert$c(Buffer.isBuffer(key)); - - if (key.length !== (this.bits >>> 3)) - throw new Error('Invalid key size.'); - - this.destroy(); - this.key = Buffer.from(key); - this.encKey = null; - this.decKey = null; - - return this; - } - - createEncryptKey() { - if (!this.key) - throw new Error('Cipher is not initialized.'); - - const ukey = this.key; - - if (ukey.length !== (this.bits >>> 3)) - throw new Error('Invalid key size.'); - - const key = new Uint32Array(60); - - key[0] = readU32$1(ukey, 0); - key[1] = readU32$1(ukey, 4); - key[2] = readU32$1(ukey, 8); - key[3] = readU32$1(ukey, 12); - - let p = 0; - let i = 0; - - if (this.bits === 128) { - for (;;) { - const tmp = key[p + 3]; - - key[p + 4] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 5] = key[p + 1] ^ key[p + 4]; - key[p + 6] = key[p + 2] ^ key[p + 5]; - key[p + 7] = key[p + 3] ^ key[p + 6]; - - i += 1; - - if (i === 10) - break; - - p += 4; - } - - return key; - } - - key[p + 4] = readU32$1(ukey, 16); - key[p + 5] = readU32$1(ukey, 20); - - if (this.bits === 192) { - for (;;) { - const tmp = key[p + 5]; - - key[p + 6] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 7] = key[p + 1] ^ key[p + 6]; - key[p + 8] = key[p + 2] ^ key[p + 7]; - key[p + 9] = key[p + 3] ^ key[p + 8]; - - i += 1; - - if (i === 8) - break; - - key[p + 10] = key[p + 4] ^ key[p + 9]; - key[p + 11] = key[p + 5] ^ key[p + 10]; - p += 6; - } - - return key; - } - - key[p + 6] = readU32$1(ukey, 24); - key[p + 7] = readU32$1(ukey, 28); - - if (this.bits === 256) { - for (;;) { - let tmp = key[p + 7]; - - key[p + 8] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 9] = key[p + 1] ^ key[p + 8]; - key[p + 10] = key[p + 2] ^ key[p + 9]; - key[p + 11] = key[p + 3] ^ key[p + 10]; - - i += 1; - - if (i === 7) - break; - - tmp = key[p + 11]; - - key[p + 12] = key[p + 4] - ^ (TE2[(tmp >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 0) & 0xff] & 0x000000ff); - - key[p + 13] = key[p + 5] ^ key[p + 12]; - key[p + 14] = key[p + 6] ^ key[p + 13]; - key[p + 15] = key[p + 7] ^ key[p + 14]; - - p += 8; - } - - return key; - } - - throw new Error('Bad key size.'); - } - - createDecryptKey() { - // First, start with an encryption schedule. - const key = this.createEncryptKey(); - - let p = 0; - - // Invert the order of the round keys. - for (let i = 0, j = 4 * this.rounds; i < j; i += 4, j -= 4) { - let tmp = key[p + i + 0]; - - key[p + i + 0] = key[p + j + 0]; - key[p + j + 0] = tmp; - - tmp = key[p + i + 1]; - key[p + i + 1] = key[p + j + 1]; - key[p + j + 1] = tmp; - - tmp = key[p + i + 2]; - key[p + i + 2] = key[p + j + 2]; - key[p + j + 2] = tmp; - - tmp = key[p + i + 3]; - key[p + i + 3] = key[p + j + 3]; - key[p + j + 3] = tmp; - } - - // Apply the inverse MixColumn transform to - // all round keys but the first and the last. - for (let i = 1; i < this.rounds; i++) { - p += 4; - - key[p + 0] = TD0[TE1[(key[p + 0] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 0] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 0] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 0] >>> 0) & 0xff] & 0xff]; - - key[p + 1] = TD0[TE1[(key[p + 1] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 1] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 1] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 1] >>> 0) & 0xff] & 0xff]; - - key[p + 2] = TD0[TE1[(key[p + 2] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 2] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 2] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 2] >>> 0) & 0xff] & 0xff]; - - key[p + 3] = TD0[TE1[(key[p + 3] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 3] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 3] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 3] >>> 0) & 0xff] & 0xff]; - } - - return key; - } - - getEncryptKey() { - if (!this.encKey) - this.encKey = this.createEncryptKey(); - return this.encKey; - } - - getDecryptKey() { - if (!this.decKey) - this.decKey = this.createDecryptKey(); - return this.decKey; - } - - encrypt(output, opos, input, ipos) { - const key = this.getEncryptKey(); - - // Map byte array block to cipher - // state and add initial round key. - let s0 = readU32$1(input, ipos + 0) ^ key[0]; - let s1 = readU32$1(input, ipos + 4) ^ key[1]; - let s2 = readU32$1(input, ipos + 8) ^ key[2]; - let s3 = readU32$1(input, ipos + 12) ^ key[3]; - - // Nr - 1 full rounds - let r = this.rounds >>> 1; - let p = 0; - let t0, t1, t2, t3; - - for (;;) { - t0 = TE0[(s0 >>> 24) & 0xff] - ^ TE1[(s1 >>> 16) & 0xff] - ^ TE2[(s2 >>> 8) & 0xff] - ^ TE3[(s3 >>> 0) & 0xff] - ^ key[p + 4]; - - t1 = TE0[(s1 >>> 24) & 0xff] - ^ TE1[(s2 >>> 16) & 0xff] - ^ TE2[(s3 >>> 8) & 0xff] - ^ TE3[(s0 >>> 0) & 0xff] - ^ key[p + 5]; - - t2 = TE0[(s2 >>> 24) & 0xff] - ^ TE1[(s3 >>> 16) & 0xff] - ^ TE2[(s0 >>> 8) & 0xff] - ^ TE3[(s1 >>> 0) & 0xff] - ^ key[p + 6]; - - t3 = TE0[(s3 >>> 24) & 0xff] - ^ TE1[(s0 >>> 16) & 0xff] - ^ TE2[(s1 >>> 8) & 0xff] - ^ TE3[(s2 >>> 0) & 0xff] - ^ key[p + 7]; - - p += 8; - r -= 1; - - if (r === 0) - break; - - s0 = TE0[(t0 >>> 24) & 0xff] - ^ TE1[(t1 >>> 16) & 0xff] - ^ TE2[(t2 >>> 8) & 0xff] - ^ TE3[(t3 >>> 0) & 0xff] - ^ key[p + 0]; - - s1 = TE0[(t1 >>> 24) & 0xff] - ^ TE1[(t2 >>> 16) & 0xff] - ^ TE2[(t3 >>> 8) & 0xff] - ^ TE3[(t0 >>> 0) & 0xff] - ^ key[p + 1]; - - s2 = TE0[(t2 >>> 24) & 0xff] - ^ TE1[(t3 >>> 16) & 0xff] - ^ TE2[(t0 >>> 8) & 0xff] - ^ TE3[(t1 >>> 0) & 0xff] - ^ key[p + 2]; - - s3 = TE0[(t3 >>> 24) & 0xff] - ^ TE1[(t0 >>> 16) & 0xff] - ^ TE2[(t1 >>> 8) & 0xff] - ^ TE3[(t2 >>> 0) & 0xff] - ^ key[p + 3]; - } - - // Apply last round and map cipher - // state to byte array block. - s0 = (TE2[(t0 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t1 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t2 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t3 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 0]; - - s1 = (TE2[(t1 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t2 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t3 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t0 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 1]; - - s2 = (TE2[(t2 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t3 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t0 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t1 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 2]; - - s3 = (TE2[(t3 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t0 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t1 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t2 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 3]; - - writeU32$1(output, s0, opos + 0); - writeU32$1(output, s1, opos + 4); - writeU32$1(output, s2, opos + 8); - writeU32$1(output, s3, opos + 12); - - return this; - } - - decrypt(output, opos, input, ipos) { - const key = this.getDecryptKey(); - - // Map byte array block to cipher - // state and add initial round key. - let s0 = readU32$1(input, ipos + 0) ^ key[0]; - let s1 = readU32$1(input, ipos + 4) ^ key[1]; - let s2 = readU32$1(input, ipos + 8) ^ key[2]; - let s3 = readU32$1(input, ipos + 12) ^ key[3]; - - // Nr - 1 full rounds - let r = this.rounds >>> 1; - let p = 0; - let t0, t1, t2, t3; - - for (;;) { - t0 = TD0[(s0 >>> 24) & 0xff] - ^ TD1[(s3 >>> 16) & 0xff] - ^ TD2[(s2 >>> 8) & 0xff] - ^ TD3[(s1 >>> 0) & 0xff] - ^ key[p + 4]; - - t1 = TD0[(s1 >>> 24) & 0xff] - ^ TD1[(s0 >>> 16) & 0xff] - ^ TD2[(s3 >>> 8) & 0xff] - ^ TD3[(s2 >>> 0) & 0xff] - ^ key[p + 5]; - - t2 = TD0[(s2 >>> 24) & 0xff] - ^ TD1[(s1 >>> 16) & 0xff] - ^ TD2[(s0 >>> 8) & 0xff] - ^ TD3[(s3 >>> 0) & 0xff] - ^ key[p + 6]; - - t3 = TD0[(s3 >>> 24) & 0xff] - ^ TD1[(s2 >>> 16) & 0xff] - ^ TD2[(s1 >>> 8) & 0xff] - ^ TD3[(s0 >>> 0) & 0xff] - ^ key[p + 7]; - - p += 8; - r -= 1; - - if (r === 0) - break; - - s0 = TD0[(t0 >>> 24) & 0xff] - ^ TD1[(t3 >>> 16) & 0xff] - ^ TD2[(t2 >>> 8) & 0xff] - ^ TD3[(t1 >>> 0) & 0xff] - ^ key[p + 0]; - - s1 = TD0[(t1 >>> 24) & 0xff] - ^ TD1[(t0 >>> 16) & 0xff] - ^ TD2[(t3 >>> 8) & 0xff] - ^ TD3[(t2 >>> 0) & 0xff] - ^ key[p + 1]; - - s2 = TD0[(t2 >>> 24) & 0xff] - ^ TD1[(t1 >>> 16) & 0xff] - ^ TD2[(t0 >>> 8) & 0xff] - ^ TD3[(t3 >>> 0) & 0xff] - ^ key[p + 2]; - - s3 = TD0[(t3 >>> 24) & 0xff] - ^ TD1[(t2 >>> 16) & 0xff] - ^ TD2[(t1 >>> 8) & 0xff] - ^ TD3[(t0 >>> 0) & 0xff] - ^ key[p + 3]; - } - - // Apply last round and map cipher - // state to byte array block. - s0 = (TD4[(t0 >>> 24) & 0xff] << 24) - ^ (TD4[(t3 >>> 16) & 0xff] << 16) - ^ (TD4[(t2 >>> 8) & 0xff] << 8) - ^ (TD4[(t1 >>> 0) & 0xff] << 0) - ^ key[p + 0]; - - s1 = (TD4[(t1 >>> 24) & 0xff] << 24) - ^ (TD4[(t0 >>> 16) & 0xff] << 16) - ^ (TD4[(t3 >>> 8) & 0xff] << 8) - ^ (TD4[(t2 >>> 0) & 0xff] << 0) - ^ key[p + 1]; - - s2 = (TD4[(t2 >>> 24) & 0xff] << 24) - ^ (TD4[(t1 >>> 16) & 0xff] << 16) - ^ (TD4[(t0 >>> 8) & 0xff] << 8) - ^ (TD4[(t3 >>> 0) & 0xff] << 0) - ^ key[p + 2]; - - s3 = (TD4[(t3 >>> 24) & 0xff] << 24) - ^ (TD4[(t2 >>> 16) & 0xff] << 16) - ^ (TD4[(t1 >>> 8) & 0xff] << 8) - ^ (TD4[(t0 >>> 0) & 0xff] << 0) - ^ key[p + 3]; - - writeU32$1(output, s0, opos + 0); - writeU32$1(output, s1, opos + 4); - writeU32$1(output, s2, opos + 8); - writeU32$1(output, s3, opos + 12); - - return this; - } - - destroy() { - if (this.key) { - for (let i = 0; i < this.key.length; i++) - this.key[i] = 0; - } - - if (this.encKey) { - for (let i = 0; i < 60; i++) - this.encKey[i] = 0; - } - - if (this.decKey) { - for (let i = 0; i < 60; i++) - this.decKey[i] = 0; - } - - this.key = null; - this.encKey = null; - this.decKey = null; - - return this; - } - } - - /* - * Helpers - */ - - function getRounds(bits) { - switch (bits) { - case 128: - return 10; - case 192: - return 12; - case 256: - return 14; - default: - throw new Error('Bad key size.'); - } - } - - function readU32$1(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off]); - } - - function writeU32$1(dst, num, off) { - dst[off++] = num >>> 24; - dst[off++] = num >>> 16; - dst[off++] = num >>> 8; - dst[off++] = num; - return off; - } - - /* - * Expose - */ - - var aes$3 = AES$1; - - var modes = {}; - - /*! - * ghash.js - ghash for javascript - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on golang/go: - * Copyright (c) 2009, The Go Authors. All rights reserved. - * https://github.com/golang/go - * - * Resources: - * https://en.wikipedia.org/wiki/Galois/Counter_Mode - * https://dx.doi.org/10.6028/NIST.SP.800-38D - * https://github.com/golang/go/blob/master/src/crypto/cipher/gcm.go - * https://github.com/golang/go/blob/master/src/crypto/cipher/gcm_test.go - * https://github.com/DaGenix/rust-crypto/blob/master/src/ghash.rs - */ - - const assert$b = assert_1$d; - - /* - * Constants - */ - - const PADDING = Buffer.alloc(16, 0x00); - const FINALIZED = -1; - - const REDUCTION = new Uint16Array([ - 0x0000, 0x1c20, 0x3840, 0x2460, - 0x7080, 0x6ca0, 0x48c0, 0x54e0, - 0xe100, 0xfd20, 0xd940, 0xc560, - 0x9180, 0x8da0, 0xa9c0, 0xb5e0 - ]); - - /** - * GHASH - */ - - class GHASH$1 { - constructor() { - this.state = new Uint32Array(4); - this.block = Buffer.alloc(16); - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - this.table = new Array(16); - - for (let i = 0; i < 16; i++) - this.table[i] = new Uint32Array(4); - } - - init(key) { - assert$b(Buffer.isBuffer(key)); - assert$b(key.length === 16); - - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - this.size = 0; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - - const x = new Uint32Array(4); - - x[1] = readU32(key, 0); - x[0] = readU32(key, 4); - x[3] = readU32(key, 8); - x[2] = readU32(key, 12); - - this.table[reverse(1)] = x; - - for (let i = 2; i < 16; i += 2) { - this.table[reverse(i)] = this.double(this.table[reverse(i >>> 1)]); - this.table[reverse(i + 1)] = this.add(this.table[reverse(i)], x); - } - - return this; - } - - absorb(data) { - this._absorb(data, data.length); - return this; - } - - _absorb(data, len) { - assert$b(this.size !== FINALIZED, 'Context is not initialized.'); - - let pos = this.size & 15; - let off = 0; - - this.size += len; - - if (pos > 0) { - let want = 16 - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < 16) - return; - - this.transform(this.block, 0); - } - - while (len >= 16) { - this.transform(data, off); - off += 16; - len -= 16; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - } - - transform(block, off) { - this.state[1] ^= readU32(block, off + 0); - this.state[0] ^= readU32(block, off + 4); - this.state[3] ^= readU32(block, off + 8); - this.state[2] ^= readU32(block, off + 12); - this.mul(this.state); - } - - pad() { - const pos = this.size & 15; - - if (pos !== 0) - this._absorb(PADDING, 16 - pos); - } - - aad(data) { - assert$b(Buffer.isBuffer(data)); - assert$b(this.ctLen === 0); - - this.adLen += data.length; - - return this.absorb(data); - } - - update(data) { - assert$b(Buffer.isBuffer(data)); - - if (data.length === 0) - return this; - - if (this.ctLen === 0) - this.pad(); - - this.ctLen += data.length; - - return this.absorb(data); - } - - final() { - const out = Buffer.alloc(16); - - this.pad(); - - const adLen = this.adLen * 8; - const ctLen = this.ctLen * 8; - - this.state[1] ^= hi32(adLen); - this.state[0] ^= lo32(adLen); - this.state[3] ^= hi32(ctLen); - this.state[2] ^= lo32(ctLen); - - this.mul(this.state); - - writeU32(out, this.state[1], 0); - writeU32(out, this.state[0], 4); - writeU32(out, this.state[3], 8); - writeU32(out, this.state[2], 12); - - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - for (let i = 0; i < 16; i++) - this.block[i] = 0; - - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - - return out; - } - - destroy() { - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - for (let i = 0; i < 16; i++) - this.block[i] = 0; - - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - } - - add(x, y) { - assert$b(x instanceof Uint32Array); - assert$b(x.length === 4); - assert$b(y instanceof Uint32Array); - assert$b(y.length === 4); - - const z = new Uint32Array(4); - - z[0] = x[0] ^ y[0]; - z[1] = x[1] ^ y[1]; - z[2] = x[2] ^ y[2]; - z[3] = x[3] ^ y[3]; - - return z; - } - - double(x) { - assert$b(x instanceof Uint32Array); - assert$b(x.length === 4); - - const d = new Uint32Array(4); - const msb = (x[2] & 1) === 1; - - let v; - - d[3] = x[3]; - d[2] = x[2]; - v = d[3] & 1; - d[3] >>>= 1; - d[2] >>>= 1; - d[2] |= v << 31; - - d[3] |= (x[0] & 1) << 31; - - d[1] = x[1]; - d[0] = x[0]; - v = d[1] & 1; - d[1] >>>= 1; - d[0] >>>= 1; - d[0] |= v << 31; - - if (msb) { - d[1] ^= 0xe1000000; - d[0] ^= 0x00000000; - } - - return d; - } - - mul(y) { - assert$b(y instanceof Uint32Array); - assert$b(y.length === 4); - - const z = new Uint32Array(4); - const w = new Uint32Array(2); - - let v, t; - - for (let i = 0; i < 2; i++) { - w[0] = y[2]; - w[1] = y[3]; - - if (i === 1) { - w[0] = y[0]; - w[1] = y[1]; - } - - for (let j = 0; j < 64; j += 4) { - const msw = z[2] & 0x0f; - - v = z[3] & 0x0f; - z[3] >>>= 4; - z[2] >>>= 4; - z[2] |= v << 28; - - z[3] |= z[0] << 28; - - v = z[1] & 0x0f; - z[1] >>>= 4; - z[0] >>>= 4; - z[0] |= v << 28; - - z[1] ^= REDUCTION[msw] << 16; - - t = this.table[w[0] & 0x0f]; - - z[0] ^= t[0]; - z[1] ^= t[1]; - - z[2] ^= t[2]; - z[3] ^= t[3]; - - v = w[1] & 0x0f; - w[1] >>>= 4; - w[0] >>>= 4; - w[0] |= v << 28; - } - } - - y[0] = z[0]; - y[1] = z[1]; - y[2] = z[2]; - y[3] = z[3]; - } - } - - /* - * Helpers - */ - - function hi32(num) { - return (num * (1 / 0x100000000)) >>> 0; - } - - function lo32(num) { - return num >>> 0; - } - - function reverse(i) { - i = ((i << 2) & 0x0c) | ((i >>> 2) & 0x03); - i = ((i << 1) & 0x0a) | ((i >>> 1) & 0x05); - return i; - } - - function readU32(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off++]); - } - - function writeU32(dst, num, off) { - dst[off++] = num >>> 24; - dst[off++] = num >>> 16; - dst[off++] = num >>> 8; - dst[off++] = num; - return off; - } - - /* - * Expose - */ - - var ghash = GHASH$1; - - /*! - * modes.js - cipher modes for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Resources: - * https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation - */ - - const assert$a = assert_1$d; - const GHASH = ghash; - - /* - * Constants - */ - - const EMPTY = Buffer.alloc(0); - - // Shifted by four. - const polyTable = new Uint32Array([ - 0x00001b, // 8 - 0x000087, // 16 - 0x000425, // 32 - 0x000000, - 0x000125, // 64 - 0x000000, - 0x000000, - 0x000000, - 0x080043 // 128 - ]); - - /* - * Mode - */ - - class Mode { - constructor(ctx) { - assert$a(ctx && typeof ctx.encrypt === 'function'); - assert$a(typeof ctx.blockSize === 'number'); - - this.ctx = ctx; - } - - get blockSize() { - return this.ctx.blockSize; - } - - init(key, iv) { - throw new Error('Not implemented.'); - } - - update(data) { - throw new Error('Not implemented.'); - } - - crypt(output, input) { - throw new Error('Not implemented.'); - } - - final() { - throw new Error('Not implemented.'); - } - - destroy() { - throw new Error('Not implemented.'); - } - - setAutoPadding(padding) { - assert$a(typeof padding === 'boolean'); - - this._setAutoPadding(padding); - - return this; - } - - setAAD(data) { - assert$a(Buffer.isBuffer(data)); - this._setAAD(data); - return this; - } - - setCCM(msgLen, tagLen, aad) { - assert$a((msgLen >>> 0) === msgLen); - assert$a((tagLen >>> 0) === tagLen); - assert$a(aad == null || Buffer.isBuffer(aad)); - - this._setCCM(msgLen, tagLen, aad); - - return this; - } - - getAuthTag() { - return this._getAuthTag(); - } - - setAuthTag(tag) { - assert$a(Buffer.isBuffer(tag)); - this._setAuthTag(tag); - return this; - } - - _setAutoPadding(padding) { - throw new Error('Not available.'); - } - - _setAAD(data) { - throw new Error('Cipher is not authenticated.'); - } - - _setCCM(msgLen, tagLen, aad) { - throw new Error('Not available.'); - } - - _getAuthTag() { - throw new Error('Cipher is not authenticated.'); - } - - _setAuthTag(tag) { - throw new Error('Cipher is not authenticated.'); - } - } - - /** - * Block Mode - */ - - class Block$3 extends Mode { - constructor(ctx, unpad) { - super(ctx); - - this.padding = true; - this.unpad = unpad; - this.block = Buffer.alloc(this.blockSize); - this.blockPos = -1; - this.last = null; - this.lastSize = 0; - - if (unpad) - this.last = Buffer.alloc(this.blockSize); - } - - init(key, iv) { - if (iv == null) - iv = EMPTY; - - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - - this.ctx.init(key); - - this.blockPos = 0; - this.lastSize = 0; - - this._init(key, iv); - - return this; - } - - _updateSize(ilen) { - if (this.blockPos + ilen < this.blockSize) - return 0; - - let olen = 0; - - if (this.unpad) - olen += this.lastSize; - - if (this.blockPos > 0) { - ilen -= this.blockSize - this.blockPos; - olen += this.blockSize; - } - - if (ilen >= this.blockSize) - olen += ilen - (ilen % this.blockSize); - - assert$a(olen >= this.blockSize); - - return olen; - } - - update(input) { - assert$a(Buffer.isBuffer(input)); - - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - const olen = this._updateSize(input.length); - const output = Buffer.alloc(olen); - - if (this.blockPos + input.length < this.blockSize) { - this.blockPos += input.copy(this.block, this.blockPos, 0, input.length); - return output; - } - - let ilen = input.length; - let ipos = 0; - let opos = 0; - - if (this.unpad) - opos += this.last.copy(output, opos, 0, this.lastSize); - - if (this.blockPos > 0) { - const want = this.blockSize - this.blockPos; - - ipos += input.copy(this.block, this.blockPos, ipos, ipos + want); - ilen -= want; - - this._update(output, opos, this.block, 0); - - opos += this.blockSize; - - this.blockPos = 0; - } - - while (ilen >= this.blockSize) { - this._update(output, opos, input, ipos); - - ipos += this.blockSize; - ilen -= this.blockSize; - opos += this.blockSize; - } - - if (ilen > 0) - this.blockPos = input.copy(this.block, 0, ipos, ipos + ilen); - - assert$a(opos === olen); - - if (this.unpad) { - this.lastSize = output.copy(this.last, 0, olen - this.blockSize, olen); - return output.slice(0, olen - this.blockSize); - } - - return output; - } - - crypt(output, input) { - assert$a(Buffer.isBuffer(output)); - assert$a(Buffer.isBuffer(input)); - assert$a(output.length === input.length); - - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - if (this.unpad || this.blockPos !== 0) - throw new Error('Cannot crypt while buffering.'); - - if ((input.length % this.blockSize) !== 0) - throw new Error('Input must be a multiple of the block size.'); - - const size = this.blockSize; - - let len = input.length; - let pos = 0; - - while (len > 0) { - this._update(output, pos, input, pos); - pos += size; - len -= size; - } - - return output; - } - - final() { - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - try { - return this._final(); - } finally { - this.destroy(); - } - } - - destroy() { - this.ctx.destroy(); - - this.blockPos = -1; - this.lastSize = 0; - - for (let i = 0; i < this.blockSize; i++) - this.block[i] = 0; - - if (this.unpad) { - for (let i = 0; i < this.blockSize; i++) - this.last[i] = 0; - } - - this._destroy(); - - return this; - } - - _init(key, iv) { - throw new Error('Not implemented.'); - } - - _update(output, opos, input, ipos) { - throw new Error('Not implemented.'); - } - - _final() { - throw new Error('Not implemented.'); - } - - _destroy() { - throw new Error('Not implemented.'); - } - } - - /* - * Stream Mode - */ - - class Stream extends Mode { - constructor(ctx) { - super(ctx); - this.pos = -1; - } - - init(key, iv) { - if (iv == null) - iv = EMPTY; - - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - - this.ctx.init(key); - - this.pos = 0; - - this._init(key, iv); - - return this; - } - - update(input) { - assert$a(Buffer.isBuffer(input)); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - const output = Buffer.alloc(input.length); - - this._crypt(output, input); - - return output; - } - - crypt(output, input) { - assert$a(Buffer.isBuffer(output)); - assert$a(Buffer.isBuffer(input)); - assert$a(output.length === input.length); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this._crypt(output, input); - - return output; - } - - final() { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - try { - return this._final(); - } finally { - this.destroy(); - } - } - - destroy() { - this.ctx.destroy(); - - this.pos = -1; - - this._destroy(); - - return this; - } - - _init(key, iv) { - throw new Error('Not implemented.'); - } - - _crypt(output, input) { - throw new Error('Not implemented.'); - } - - _final() { - throw new Error('Not implemented.'); - } - - _destroy() { - throw new Error('Not implemented.'); - } - } - - /** - * Raw Cipher - */ - - class RawCipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.encrypt(output, opos, input, ipos); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - _destroy() { - return; - } - } - - /** - * Raw Decipher - */ - - class RawDecipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.decrypt(output, opos, input, ipos); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - _destroy() { - return; - } - } - - /** - * PKCS#7 Cipher - */ - - class PKCS7Cipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - const left = this.blockSize - this.blockPos; - const block = Buffer.from(this.block); - - for (let i = this.blockPos; i < this.blockSize; i++) - block[i] = left; - - this._update(block, 0, block, 0); - - return block; - } - - _setAutoPadding(padding) { - this.padding = padding; - } - } - - /** - * PKCS#7 Decipher - */ - - class PKCS7Decipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - if (!this.padding) - return Buffer.alloc(0); - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - assert$a(this.lastSize === this.last.length); - assert$a(this.lastSize === this.blockSize); - - const block = Buffer.from(this.last); - - let left = block[block.length - 1]; - let res = 1; - - // left != 0 - res &= ((left - 1) >>> 31) ^ 1; - - // left <= block_size - res &= (left - this.blockSize - 1) >>> 31; - - // left = 0 if left == 0 or left > block_size - left &= -res; - - // Verify padding in constant time. - const end = this.blockSize - left; - - for (let i = 0; i < this.blockSize; i++) { - const ch = block[i]; - - // i < end or ch == left - res &= ((i - end) >>> 31) | (((ch ^ left) - 1) >>> 31); - } - - if (!res) - throw new Error('Bad decrypt (padding).'); - - return block.slice(0, end); - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } - } - - /** - * ECB Cipher - */ - - class ECBCipher extends PKCS7Cipher { - constructor(ctx) { - super(ctx); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.encrypt(output, opos, input, ipos); - } - - _destroy() { - return; - } - } - - /** - * ECB Decipher - */ - - class ECBDecipher extends PKCS7Decipher { - constructor(ctx) { - super(ctx); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.decrypt(output, opos, input, ipos); - } - - _destroy() { - return; - } - } - - /** - * CBC Cipher - */ - - class CBCCipher$1 extends PKCS7Cipher { - constructor(ctx) { - super(ctx); - - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] ^= input[ipos + i]; - - this.ctx.encrypt(output, opos, this.prev, 0); - - output.copy(this.prev, 0, opos, opos + this.blockSize); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] = 0; - } - } - - /** - * CBC Decipher - */ - - class CBCDecipher$1 extends PKCS7Decipher { - constructor(ctx) { - super(ctx); - - this.prev = Buffer.alloc(this.blockSize); - this.tmp = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - if (overlap(output, opos, input, ipos)) { - this.prev.copy(this.tmp, 0); - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tmp[i]; - } else { - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.prev[i]; - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - } - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.prev[i] = 0; - this.tmp[i] = 0; - } - } - } - - /** - * CTS Cipher - */ - - class CTSCipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] ^= input[ipos + i]; - - this.ctx.encrypt(output, opos, this.prev, 0); - - output.copy(this.prev, 0, opos, opos + this.blockSize); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad encrypt (no data).'); - - for (let i = 0; i < this.blockPos; i++) - this.prev[i] ^= this.block[i]; - - this.ctx.encrypt(this.prev, 0, this.prev, 0); - - const last = this.last.slice(0, this.blockPos); - - return Buffer.concat([this.prev, last]); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] = 0; - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } - } - - /** - * CTS Decipher - */ - - class CTSDecipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - - this.prev = Buffer.alloc(this.blockSize); - this.tmp = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - if (overlap(output, opos, input, ipos)) { - this.prev.copy(this.tmp, 0); - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tmp[i]; - } else { - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.prev[i]; - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - } - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - const tmp = Buffer.alloc(this.blockSize); - - this.ctx.decrypt(this.prev, 0, this.prev, 0); - - // Recreate the previous (x2) ciphertext (`this.tmp`), - // which is normally only available on overlap. - for (let i = 0; i < this.blockSize; i++) - tmp[i] = this.last[i] ^ this.prev[i]; - - for (let i = 0; i < this.blockPos; i++) { - this.last[i] = this.block[i]; - this.block[i] ^= this.prev[i]; - } - - for (let i = this.blockPos; i < this.blockSize; i++) - this.last[i] = this.prev[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= tmp[i]; - - const block = this.block.slice(0, this.blockPos); - - return Buffer.concat([this.last, block]); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.prev[i] = 0; - this.tmp[i] = 0; - } - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } - } - - /** - * XTS - */ - - class XTS extends Block$3 { - constructor(ctx, encrypt) { - super(ctx, true); - - this.encrypt = encrypt; - this.poly = polyTable[this.blockSize >>> 4]; - this.tweak = Buffer.alloc(this.blockSize); - this.prev = Buffer.alloc(this.blockSize); - } - - init(key, iv) { - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - assert$a(key.length > 0 && (key.length & 1) === 0); - assert$a(iv.length === this.blockSize); - - const size = key.length >>> 1; - const k1 = key.slice(0, size); - const k2 = key.slice(size); - - if (safeEqual$1(k1, k2, size)) - throw new Error('XTS keys are equal.'); - - this.ctx.init(k2); - this.ctx.encrypt(this.tweak, 0, iv, 0); - - this.ctx.init(k1); - - this.blockPos = 0; - this.lastSize = 0; - - return this; - } - - _shift() { - let cy = 0; - - if (!this.encrypt) - this.tweak.copy(this.prev, 0); - - for (let i = 0; i < this.blockSize; i++) { - const c = this.tweak[i] >> 7; - - this.tweak[i] <<= 1; - this.tweak[i] |= cy; - - cy = c; - } - - cy = -cy & 0xff; - - this.tweak[2] ^= (this.poly >> 16) & cy; - this.tweak[1] ^= (this.poly >> 8) & cy; - this.tweak[0] ^= (this.poly >> 0) & cy; - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - output[opos + i] = input[ipos + i] ^ this.tweak[i]; - - if (this.encrypt) - this.ctx.encrypt(output, opos, output, opos); - else - this.ctx.decrypt(output, opos, output, opos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tweak[i]; - - this._shift(); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.tweak[i] = 0; - this.prev[i] = 0; - } - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } - } - - /* - * XTS Cipher - */ - - class XTSCipher extends XTS { - constructor(ctx) { - super(ctx, true); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad encrypt (no data).'); - - if (this.blockPos === 0) - return Buffer.from(this.last); - - // Use ciphertext stealing for partial blocks. - const out = Buffer.alloc(this.blockPos); - - for (let i = 0; i < this.blockPos; i++) { - out[i] = this.last[i]; - - this.last[i] = this.block[i]; - } - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - this.ctx.encrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - return Buffer.concat([this.last, out]); - } - } - - /* - * XTS Decipher - */ - - class XTSDecipher extends XTS { - constructor(ctx) { - super(ctx, false); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - if (this.blockPos === 0) - return Buffer.from(this.last); - - // Undo Block mode object's behavior of - // running _update on the last full block. - // Could avoid this somehow in the future. - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - this.ctx.encrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - // Recreate the last partial plaintext - // block (out) and the last ciphertext - // block (last). - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - const out = Buffer.alloc(this.blockPos); - - for (let i = 0; i < this.blockPos; i++) { - out[i] = this.last[i]; - - this.last[i] = this.block[i]; - } - - // Now decrypt the last ciphertext block. - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - return Buffer.concat([this.last, out]); - } - } - - /** - * CTR - */ - - class CTR extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - this.ctr = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - - iv.copy(this.ctr, 0); - } - - _increment() { - for (let i = this.ctr.length - 1; i >= 0; i--) { - this.ctr[i] += 1; - - if (this.ctr[i] !== 0x00) - break; - } - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - } - } - } - - /** - * CTR Cipher - */ - - class CTRCipher extends CTR { - constructor(ctx) { - super(ctx); - } - } - - /** - * CTR Decipher - */ - - class CTRDecipher extends CTR { - constructor(ctx) { - super(ctx); - } - } - - /** - * CFB - */ - - class CFB extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - - iv.copy(this.prev, 0); - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.prev[i] = 0; - } - } - } - - /** - * CFB Cipher - */ - - class CFBCipher extends CFB { - constructor(ctx) { - super(ctx); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.prev, 0); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos]; - - this.prev[this.pos] = output[i]; - - this.pos += 1; - } - } - } - - /** - * CFB Decipher - */ - - class CFBDecipher extends CFB { - constructor(ctx) { - super(ctx); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.prev, 0); - this.pos = 0; - } - - this.prev[this.pos] = input[i]; - - output[i] = input[i] ^ this.state[this.pos]; - - this.pos += 1; - } - } - } - - /** - * OFB - */ - - class OFB extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(Buffer.isBuffer(iv)); - assert$a(iv.length === this.blockSize); - - iv.copy(this.state, 0); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.state, 0); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.state[i] = 0; - } - } - - /** - * OFB Cipher - */ - - class OFBCipher extends OFB { - constructor(ctx) { - super(ctx); - } - } - - /** - * OFB Decipher - */ - - class OFBDecipher extends OFB { - constructor(ctx) { - super(ctx); - } - } - - /** - * GCM - */ - - class GCM extends Stream { - constructor(ctx, encrypt) { - assert$a(ctx.blockSize === 16); - - super(ctx); - - this.encrypt = encrypt; - this.hash = new GHASH(); - this.ctr = Buffer.alloc(16); - this.state = Buffer.alloc(16); - this.key = Buffer.alloc(16); - this.mask = Buffer.alloc(16); - this.tag = null; - this.mac = null; - } - - _init(key, iv) { - for (let i = 0; i < 16; i++) { - this.ctr[i] = 0; - this.key[i] = 0; - this.mask[i] = 0; - } - - this._encipher(this.key, this.key); - - this.hash.init(this.key); - - // Full round of ghash with same key. - if (iv.length !== 12) { - this.hash.update(iv); - iv = this.hash.final(); - this.hash.init(this.key); - } - - iv.copy(this.ctr, 0); - - if (iv.length === 12) { - this.ctr[12] = 0x00; - this.ctr[13] = 0x00; - this.ctr[14] = 0x00; - this.ctr[15] = 0x01; - } - - this._encipher(this.mask, this.mask); - - this.tag = null; - this.mac = null; - - return this; - } - - _increment() { - let cy = 1; - let i = 4; - - while (i--) { - cy += this.ctr[12 + i]; - this.ctr[12 + i] = cy; - cy >>= 8; - } - } - - _encipher(output, input) { - for (let i = 0; i < input.length; i++) { - if ((this.pos & 15) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _crypt(output, input) { - if (this.encrypt) { - this._encipher(output, input); - this.hash.update(output); - } else { - this.hash.update(input); - this._encipher(output, input); - } - } - - _final() { - const mac = this.hash.final(); - - for (let i = 0; i < 16; i++) - mac[i] ^= this.mask[i]; - - if (this.encrypt) { - this.mac = mac; - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tag.length)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - this.hash.destroy(); - - for (let i = 0; i < 16; i++) { - this.ctr[i] = 0; - this.state[i] = 0; - this.key[i] = 0; - this.mask[i] = 0; - } - - if (this.tag) { - for (let i = 0; i < this.tag.length; i++) - this.tag[i] = 0; - - this.tag = null; - } - } - - _setAAD(data) { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this.hash.aad(data); - - return this; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (tag.length !== 4 && tag.length !== 8 - && (tag.length < 12 || tag.length > 16)) { - throw new RangeError('Invalid tag size.'); - } - - this.tag = Buffer.from(tag); - - return this; - } - } - - /** - * GCM Cipher - */ - - class GCMCipher extends GCM { - constructor(ctx) { - super(ctx, true); - } - } - - /** - * GCM Decipher - */ - - class GCMDecipher extends GCM { - constructor(ctx) { - super(ctx, false); - } - } - - /** - * CBC-MAC - */ - - class CBCMAC { - constructor(ctx) { - this.ctx = ctx; - this.size = ctx.blockSize; - this.mac = Buffer.alloc(this.size); - this.pos = -1; - } - - init() { - this.mac.fill(0); - this.pos = 0; - return this; - } - - update(data) { - assert$a(Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - this.mac[this.pos++] ^= data[i]; - - if (this.pos === this.size) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - } - } - - pad() { - if (this.pos > 0) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - } - - final() { - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - this.pad(); - this.pos = -1; - - return Buffer.from(this.mac); - } - } - - /** - * CCM - * https://tools.ietf.org/html/rfc3610 - */ - - class CCM extends Stream { - constructor(ctx, encrypt) { - assert$a(ctx.blockSize === 16); - - super(ctx); - - this.encrypt = encrypt; - this.hash = new CBCMAC(ctx); - this.state = Buffer.alloc(16); - this.ctr = Buffer.alloc(16); - this.tagLen = 0; - this.iv = null; - this.mac = null; - this.tag = null; - } - - _increment() { - for (let i = 15; i >= 1; i--) { - this.ctr[i] += 1; - - if (this.ctr[i] !== 0x00) - break; - } - } - - _encipher(output, input) { - for (let i = 0; i < input.length; i++) { - if ((this.pos & 15) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _init(key, iv) { - // sjcl compat: no upper limit on l(N). - if (iv.length < 7) - throw new RangeError('Invalid nonce length.'); - - if (iv.length > 13) - iv = iv.slice(0, 13); - - this.iv = Buffer.from(iv); - this.pos = -1; - this.tagLen = 0; - this.mac = null; - this.tag = null; - } - - _setCCM(msgLen, tagLen, aad) { - if (!this.iv) - throw new Error('Cipher is not initialized.'); - - // Compute L, M, and N. - let lm = msgLen; - let L = Math.ceil((32 - Math.clz32(lm)) / 8); - - if (L < 2) - L = 2; - - const M = tagLen; - const N = 15 - L; - const Adata = (aad && aad.length > 0) | 0; - const block = Buffer.alloc(16); - - if (M < 4 || M > 16 || (M & 1) !== 0) - throw new RangeError('Invalid tag length.'); - - // Compute flags. - block[0] = 64 * Adata + 8 * ((M - 2) / 2) + (L - 1); - - // sjcl compat: clamp nonces to 15-L. - this.iv.copy(block, 1, 0, Math.min(N, this.iv.length)); - - // Serialize message length. - for (let i = 15; i >= 1 + N; i--) { - block[i] = lm & 0xff; - lm >>>= 8; - } - - assert$a(lm === 0); - - this.hash.init(); - this.hash.update(block); - - if (Adata) { - if (aad.length < 0xff00) { - const buf = Buffer.alloc(2); - - buf[0] = aad.length >>> 8; - buf[1] = aad.length >>> 0; - - this.hash.update(buf); - } else if (aad.length < 0xffffffff) { - const buf = Buffer.alloc(6); - - buf[0] = 0xff; - buf[1] = 0xfe; - buf[2] = aad.length >>> 24; - buf[3] = aad.length >>> 16; - buf[4] = aad.length >>> 8; - buf[5] = aad.length >>> 0; - - this.hash.update(buf); - } else { - throw new RangeError('Invalid AAD length.'); - } - - this.hash.update(aad); - this.hash.pad(); - } - - block[0] &= 7; - block[15] = 1; - - for (let i = 14; i >= 1 + N; i--) - block[i] = 0; - - block.copy(this.ctr, 0); - - this.pos = 0; - this.tagLen = M; - this.iv = null; - } - - _crypt(output, input) { - if (this.encrypt) { - this.hash.update(input); - this._encipher(output, input); - } else { - this._encipher(output, input); - this.hash.update(output); - } - } - - _final() { - const mac = this.hash.final(); - - // Recreate S_0. - let i = 16 - ((this.ctr[0] & 7) + 1); - - while (i < 16) - this.ctr[i++] = 0; - - this.pos = 0; - this._encipher(mac, mac); - - if (this.encrypt) { - this.mac = mac.slice(0, this.tagLen); - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tagLen)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < 16; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - } - - this.tagLen = 0; - this.iv = null; - this.tag = null; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (this.tagLen === 0 || tag.length !== this.tagLen) - throw new RangeError('Invalid tag size.'); - - this.tag = Buffer.from(tag); - - return this; - } - } - - /** - * CCM Cipher - */ - - class CCMCipher extends CCM { - constructor(ctx) { - super(ctx, true); - } - } - - /** - * CCM Decipher - */ - - class CCMDecipher extends CCM { - constructor(ctx) { - super(ctx, false); - } - } - - /** - * CMAC - * https://tools.ietf.org/html/rfc4493 - */ - - class CMAC { - constructor(ctx) { - this.ctx = ctx; - this.poly = polyTable[ctx.blockSize >>> 4]; - this.size = ctx.blockSize; - this.mac = Buffer.alloc(this.size); - this.pos = -1; - } - - init(flag) { - this.mac.fill(0); - this.pos = 0; - - if (flag != null) { - this.mac[this.size - 1] ^= flag; - this.pos = this.size; - } - - return this; - } - - shift(dst, src) { - let cy = 0; - - for (let i = this.size - 1; i >= 0; i--) { - const c = src[i] >> 7; - - dst[i] = (src[i] << 1) | cy; - - cy = c; - } - - cy = -cy & 0xff; - - dst[this.size - 3] ^= (this.poly >> 16) & cy; - dst[this.size - 2] ^= (this.poly >> 8) & cy; - dst[this.size - 1] ^= (this.poly >> 0) & cy; - } - - update(data) { - assert$a(Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - if (this.pos === this.size) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - - this.mac[this.pos++] ^= data[i]; - } - } - - final() { - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - const k = Buffer.alloc(this.size); - - this.ctx.encrypt(k, 0, k, 0); - - this.shift(k, k); - - if (this.pos < this.size) { - this.mac[this.pos] ^= 0x80; - this.shift(k, k); - } - - for (let i = 0; i < this.size; i++) - this.mac[i] ^= k[i]; - - this.ctx.encrypt(this.mac, 0, this.mac, 0); - - this.pos = -1; - - return Buffer.from(this.mac); - } - } - - /** - * EAX - */ - - class EAX extends Stream { - constructor(ctx, encrypt) { - super(ctx); - - this.encrypt = encrypt; - this.hash1 = new CMAC(ctx); - this.hash2 = new CMAC(ctx); - this.state = Buffer.alloc(this.blockSize); - this.ctr = Buffer.alloc(this.blockSize); - this.mask = Buffer.alloc(this.blockSize); - this.mac = null; - this.tag = null; - } - - _increment() { - let i = this.blockSize; - let cy = 1; - - while (i--) { - cy += this.ctr[i]; - this.ctr[i] = cy; - cy >>= 8; - } - } - - _encipher(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _init(key, iv) { - assert$a(iv.length > 0); - - this.hash1.init(0); - this.hash1.update(iv); - - this.mask = this.hash1.final(); - this.mask.copy(this.ctr, 0); - - this.hash1.init(1); - this.hash2.init(2); - - this.mac = null; - this.tag = null; - } - - _crypt(output, input) { - if (this.encrypt) { - this._encipher(output, input); - this.hash2.update(output); - } else { - this.hash2.update(input); - this._encipher(output, input); - } - } - - _final() { - const mac = Buffer.alloc(this.blockSize); - const mac1 = this.hash1.final(); - const mac2 = this.hash2.final(); - - for (let i = 0; i < this.blockSize; i++) - mac[i] = mac1[i] ^ mac2[i] ^ this.mask[i]; - - if (this.encrypt) { - this.mac = mac; - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tag.length)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - this.mask[i] = 0; - } - - this.tag = null; - } - - _setAAD(data) { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this.hash1.update(data); - - return this; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (tag.length === 0 || tag.length > this.blockSize) - throw new RangeError('Invalid tag size.'); - - this.tag = Buffer.from(tag); - - return this; - } - } - - /** - * EAX Cipher - */ - - class EAXCipher extends EAX { - constructor(ctx) { - super(ctx, true); - } - } - - /** - * EAX Decipher - */ - - class EAXDecipher extends EAX { - constructor(ctx) { - super(ctx, false); - } - } - - /* - * Helpers - */ - - function get(name, encrypt = true) { - assert$a(typeof name === 'string'); - assert$a(typeof encrypt === 'boolean'); - - switch (name) { - case 'RAW': - return encrypt ? RawCipher : RawDecipher; - case 'ECB': - return encrypt ? ECBCipher : ECBDecipher; - case 'CBC': - return encrypt ? CBCCipher$1 : CBCDecipher$1; - case 'CTS': - return encrypt ? CTSCipher : CTSDecipher; - case 'XTS': - return encrypt ? XTSCipher : XTSDecipher; - case 'CTR': - return encrypt ? CTRCipher : CTRDecipher; - case 'CFB': - return encrypt ? CFBCipher : CFBDecipher; - case 'OFB': - return encrypt ? OFBCipher : OFBDecipher; - case 'GCM': - return encrypt ? GCMCipher : GCMDecipher; - case 'CCM': - return encrypt ? CCMCipher : CCMDecipher; - case 'EAX': - return encrypt ? EAXCipher : EAXDecipher; - default: - throw new Error(`Unknown mode: ${name}.`); - } - } - - function overlap(output, opos, input, ipos) { - return output.buffer === input.buffer - && output.byteOffset === input.byteOffset - && opos === ipos; - } - - function safeEqual$1(x, y, len) { - let z = 0; - - for (let i = 0; i < len; i++) - z |= x[i] ^ y[i]; - - return (z - 1) >>> 31; - } - - /* - * Expose - */ - - modes.Mode = Mode; - modes.Block = Block$3; - modes.Stream = Stream; - modes.RawCipher = RawCipher; - modes.RawDecipher = RawDecipher; - modes.PKCS7Cipher = PKCS7Cipher; - modes.PKCS7Decipher = PKCS7Decipher; - modes.ECBCipher = ECBCipher; - modes.ECBDecipher = ECBDecipher; - modes.CBCCipher = CBCCipher$1; - modes.CBCDecipher = CBCDecipher$1; - modes.CTSCipher = CTSCipher; - modes.CTSDecipher = CTSDecipher; - modes.XTS = XTS; - modes.XTSCipher = XTSCipher; - modes.XTSDecipher = XTSDecipher; - modes.CTR = CTR; - modes.CTRCipher = CTRCipher; - modes.CTRDecipher = CTRDecipher; - modes.CFB = CFB; - modes.CFBCipher = CFBCipher; - modes.CFBDecipher = CFBDecipher; - modes.OFB = OFB; - modes.OFBCipher = OFBCipher; - modes.OFBDecipher = OFBDecipher; - modes.GCM = GCM; - modes.GCMCipher = GCMCipher; - modes.GCMDecipher = GCMDecipher; - modes.CBCMAC = CBCMAC; - modes.CCM = CCM; - modes.CCMCipher = CCMCipher; - modes.CCMDecipher = CCMDecipher; - modes.CMAC = CMAC; - modes.EAX = EAX; - modes.EAXCipher = EAXCipher; - modes.EAXDecipher = EAXDecipher; - modes.get = get; - - /*! - * aes.js - aes128/192/256 for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - const AES = aes$3; - const {CBCCipher, CBCDecipher} = modes; - - /** - * Encrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - - function encipher$1(data, key, iv) { - const ctx = new CBCCipher(new AES(256)); - ctx.init(key, iv); - return Buffer.concat([ctx.update(data), ctx.final()]); - } - - /** - * Decrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - - function decipher$1(data, key, iv) { - const ctx = new CBCDecipher(new AES(256)); - ctx.init(key, iv); - return Buffer.concat([ctx.update(data), ctx.final()]); - } - - /* - * Expose - */ - - aes$4.native = 0; - aes$4.encipher = encipher$1; - aes$4.decipher = decipher$1; - - var aes$2 = {}; - - /*! - * aes.js - aes for bcrypto - * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - const assert$9 = assert_1$d; - const binding = binding_1; - - /* - * Constants - */ - - const type = binding.ciphers.AES256; - const mode = binding.modes.CBC; - - /** - * Encrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - - function encipher(data, key, iv) { - assert$9(Buffer.isBuffer(data)); - assert$9(Buffer.isBuffer(key)); - assert$9(Buffer.isBuffer(iv)); - - const {buffer, length} = binding.cipher_encrypt(type, mode, key, iv, data); - - return Buffer.from(buffer, 0, length); - } - - /** - * Decrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - - function decipher(data, key, iv) { - assert$9(Buffer.isBuffer(data)); - assert$9(Buffer.isBuffer(key)); - assert$9(Buffer.isBuffer(iv)); - - const {buffer, length} = binding.cipher_decrypt(type, mode, key, iv, data); - - return Buffer.from(buffer, 0, length); - } - - /* - * Expose - */ - - aes$2.native = 2; - aes$2.encipher = encipher; - aes$2.decipher = decipher; - - /*! - * aes.js - aes for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - if (process.env.NODE_BACKEND === 'js') - aes$5.exports = aes$4; - else - aes$5.exports = aes$2; - - /*! - * masterkey.js - master bip32 key object for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$8 = assert_1$g; - const bio$3 = bufio; - const {Lock: Lock$3} = bmutex; - const random = random$9; - const cleanse$1 = cleanse$7.exports; - const aes$1 = aes$5.exports; - const sha256 = sha256$9.exports; - const hash256$1 = hash256$k.exports; - const secp256k1 = secp256k1$b.exports; - const pbkdf2 = pbkdf2$5.exports; - const scrypt = scrypt$3.exports; - const util$2 = util$y; - const HDPrivateKey = _private; - const Mnemonic$2 = mnemonic; - const {encoding: encoding$1} = bio$3; - const {inspectSymbol: inspectSymbol$2} = utils; - - /** - * Master Key - * Master BIP32 key which can exist - * in a timed out encrypted state. - * @alias module:wallet.MasterKey - */ - - class MasterKey$1 { - /** - * Create a master key. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - this.key = null; - this.mnemonic = null; - - this.alg = MasterKey$1.alg.PBKDF2; - this.n = 50000; - this.r = 0; - this.p = 0; - - this.aesKey = null; - this.timer = null; - this.until = 0; - this.locker = new Lock$3(); - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$8(options); - - if (options.encrypted != null) { - assert$8(typeof options.encrypted === 'boolean'); - this.encrypted = options.encrypted; - } - - if (options.iv) { - assert$8(Buffer.isBuffer(options.iv)); - this.iv = options.iv; - } - - if (options.ciphertext) { - assert$8(Buffer.isBuffer(options.ciphertext)); - this.ciphertext = options.ciphertext; - } - - if (options.key) { - assert$8(HDPrivateKey.isHDPrivateKey(options.key)); - this.key = options.key; - } - - if (options.mnemonic) { - assert$8(options.mnemonic instanceof Mnemonic$2); - this.mnemonic = options.mnemonic; - } - - if (options.alg != null) { - if (typeof options.alg === 'string') { - this.alg = MasterKey$1.alg[options.alg.toUpperCase()]; - assert$8(this.alg != null, 'Unknown algorithm.'); - } else { - assert$8(typeof options.alg === 'number'); - assert$8(MasterKey$1.algByVal[options.alg]); - this.alg = options.alg; - } - } - - if (options.rounds != null) { - assert$8((options.rounds >>> 0) === options.rounds); - this.rounds = options.rounds; - } - - if (options.n != null) { - assert$8((options.n >>> 0) === options.n); - this.n = options.n; - } - - if (options.r != null) { - assert$8((options.r >>> 0) === options.r); - this.r = options.r; - } - - if (options.p != null) { - assert$8((options.p >>> 0) === options.p); - this.p = options.p; - } - - assert$8(this.encrypted ? !this.key : this.key); - - return this; - } - - /** - * Instantiate master key from options. - * @returns {MasterKey} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Decrypt the key and set a timeout to destroy decrypted data. - * @param {Buffer|String} passphrase - Zero this yourself. - * @param {Number} [timeout=60000] timeout in ms. - * @returns {Promise} - Returns {@link HDPrivateKey}. - */ - - async unlock(passphrase, timeout) { - const _unlock = await this.locker.lock(); - try { - return await this._unlock(passphrase, timeout); - } finally { - _unlock(); - } - } - - /** - * Decrypt the key without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @param {Number} [timeout=60000] timeout in ms. - * @returns {Promise} - Returns {@link HDPrivateKey}. - */ - - async _unlock(passphrase, timeout) { - if (this.key) { - if (this.encrypted) { - assert$8(this.timer != null); - this.start(timeout); - } - return this.key; - } - - if (!passphrase) - throw new Error('No passphrase.'); - - assert$8(this.encrypted); - - const key = await this.derive(passphrase); - const data = aes$1.decipher(this.ciphertext, key, this.iv); - - this.readKey(data); - - this.start(timeout); - - this.aesKey = key; - - return this.key; - } - - /** - * Start the destroy timer. - * @private - * @param {Number} [timeout=60] timeout in seconds. - */ - - start(timeout) { - if (!timeout) - timeout = 60; - - this.stop(); - - if (timeout === -1) - return; - - assert$8((timeout >>> 0) === timeout); - - this.until = util$2.now() + timeout; - this.timer = setTimeout(() => this.lock(), timeout * 1000); - } - - /** - * Stop the destroy timer. - * @private - */ - - stop() { - if (this.timer != null) { - clearTimeout(this.timer); - this.timer = null; - this.until = 0; - } - } - - /** - * Derive an aes key based on params. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async derive(passwd) { - const salt = MasterKey$1.SALT; - const n = this.n; - const r = this.r; - const p = this.p; - - if (typeof passwd === 'string') - passwd = Buffer.from(passwd, 'utf8'); - - switch (this.alg) { - case MasterKey$1.alg.PBKDF2: - return pbkdf2.deriveAsync(sha256, passwd, salt, n, 32); - case MasterKey$1.alg.SCRYPT: - return scrypt.deriveAsync(passwd, salt, n, r, p, 32); - default: - throw new Error(`Unknown algorithm: ${this.alg}.`); - } - } - - /** - * Encrypt data with in-memory aes key. - * @param {Buffer} data - * @param {Buffer} iv - * @returns {Buffer} - */ - - encipher(data, iv) { - if (!this.aesKey) - return null; - - return aes$1.encipher(data, this.aesKey, iv.slice(0, 16)); - } - - /** - * Decrypt data with in-memory aes key. - * @param {Buffer} data - * @param {Buffer} iv - * @returns {Buffer} - */ - - decipher(data, iv) { - if (!this.aesKey) - return null; - - return aes$1.decipher(data, this.aesKey, iv.slice(0, 16)); - } - - /** - * Destroy the key by zeroing the - * privateKey and chainCode. Stop - * the timer if there is one. - * @returns {Promise} - */ - - async lock() { - const unlock = await this.locker.lock(); - try { - return await this._lock(); - } finally { - unlock(); - } - } - - /** - * Destroy the key by zeroing the - * privateKey and chainCode. Stop - * the timer if there is one. - */ - - _lock() { - if (!this.encrypted) { - assert$8(this.timer == null); - assert$8(this.key); - return; - } - - this.stop(); - - if (this.key) { - this.key.destroy(true); - this.key = null; - } - - if (this.aesKey) { - cleanse$1(this.aesKey); - this.aesKey = null; - } - } - - /** - * Destroy the key permanently. - */ - - async destroy() { - await this.lock(); - this.locker.destroy(); - } - - /** - * Decrypt the key permanently. - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async decrypt(passphrase, clean) { - const unlock = await this.locker.lock(); - try { - return await this._decrypt(passphrase, clean); - } finally { - unlock(); - } - } - - /** - * Decrypt the key permanently without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async _decrypt(passphrase, clean) { - if (!this.encrypted) - throw new Error('Master key is not encrypted.'); - - if (!passphrase) - throw new Error('No passphrase provided.'); - - this._lock(); - - const key = await this.derive(passphrase); - const data = aes$1.decipher(this.ciphertext, key, this.iv); - - this.readKey(data); - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - - if (!clean) { - cleanse$1(key); - return null; - } - - return key; - } - - /** - * Encrypt the key permanently. - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async encrypt(passphrase, clean) { - const unlock = await this.locker.lock(); - try { - return await this._encrypt(passphrase, clean); - } finally { - unlock(); - } - } - - /** - * Encrypt the key permanently without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async _encrypt(passphrase, clean) { - if (this.encrypted) - throw new Error('Master key is already encrypted.'); - - if (!passphrase) - throw new Error('No passphrase provided.'); - - const raw = this.writeKey(); - const iv = random.randomBytes(16); - - this.stop(); - - const key = await this.derive(passphrase); - const data = aes$1.encipher(raw, key, iv); - - this.key = null; - this.mnemonic = null; - this.encrypted = true; - this.iv = iv; - this.ciphertext = data; - - if (!clean) { - cleanse$1(key); - return null; - } - - return key; - } - - /** - * Calculate key serialization size. - * @returns {Number} - */ - - keySize() { - let size = 0; - - size += 64; - size += 1; - - if (this.mnemonic) - size += this.mnemonic.getSize(); - - return size; - } - - /** - * Serialize key and menmonic to a single buffer. - * @returns {Buffer} - */ - - writeKey() { - const bw = bio$3.write(this.keySize()); - - bw.writeBytes(this.key.chainCode); - bw.writeBytes(this.key.privateKey); - - if (this.mnemonic) { - bw.writeU8(1); - this.mnemonic.toWriter(bw); - } else { - bw.writeU8(0); - } - - return bw.render(); - } - - /** - * Inject properties from serialized key. - * @param {Buffer} data - */ - - readKey(data) { - const br = bio$3.read(data); - - this.key = new HDPrivateKey(); - - if (isLegacy(data)) { - br.seek(13); - this.key.chainCode = br.readBytes(32); - assert$8(br.readU8() === 0); - this.key.privateKey = br.readBytes(32); - } else { - this.key.chainCode = br.readBytes(32); - this.key.privateKey = br.readBytes(32); - } - - this.key.publicKey = secp256k1.publicKeyCreate(this.key.privateKey, true); - - if (br.readU8() === 1) - this.mnemonic = Mnemonic$2.fromReader(br); - - return this; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - if (this.encrypted) { - size += 1; - size += encoding$1.sizeVarBytes(this.iv); - size += encoding$1.sizeVarBytes(this.ciphertext); - size += 13; - return size; - } - - size += 1; - size += this.keySize(); - - return size; - } - - /** - * Serialize the key in the form of: - * `[enc-flag][iv?][ciphertext?][extended-key?]` - * @returns {Buffer} - */ - - toWriter(bw) { - if (this.encrypted) { - bw.writeU8(1); - bw.writeVarBytes(this.iv); - bw.writeVarBytes(this.ciphertext); - - bw.writeU8(this.alg); - bw.writeU32(this.n); - bw.writeU32(this.r); - bw.writeU32(this.p); - - return bw; - } - - bw.writeU8(0); - - bw.writeBytes(this.key.chainCode); - bw.writeBytes(this.key.privateKey); - - if (this.mnemonic) { - bw.writeU8(1); - this.mnemonic.toWriter(bw); - } else { - bw.writeU8(0); - } - - return bw; - } - - /** - * Serialize the key in the form of: - * `[enc-flag][iv?][ciphertext?][extended-key?]` - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio$3.write(size)).render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} raw - */ - - fromReader(br) { - this.encrypted = br.readU8() === 1; - - if (this.encrypted) { - this.iv = br.readVarBytes(); - this.ciphertext = br.readVarBytes(); - - this.alg = br.readU8(); - - assert$8(this.alg < MasterKey$1.algByVal.length); - - this.n = br.readU32(); - this.r = br.readU32(); - this.p = br.readU32(); - - return this; - } - - this.key = new HDPrivateKey(); - this.key.chainCode = br.readBytes(32); - this.key.privateKey = br.readBytes(32); - this.key.publicKey = secp256k1.publicKeyCreate(this.key.privateKey, true); - - if (br.readU8() === 1) - this.mnemonic = Mnemonic$2.fromReader(br); - - return this; - } - - /** - * Instantiate master key from serialized data. - * @returns {MasterKey} - */ - - static fromReader(br) { - return new this().fromReader(br); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} raw - */ - - fromRaw(raw) { - return this.fromReader(bio$3.read(raw)); - } - - /** - * Instantiate master key from serialized data. - * @returns {MasterKey} - */ - - static fromRaw(raw) { - return new this().fromRaw(raw); - } - - /** - * Inject properties from an HDPrivateKey. - * @private - * @param {HDPrivateKey} key - * @param {Mnemonic?} mnemonic - */ - - fromKey(key, mnemonic) { - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - this.key = key; - this.mnemonic = mnemonic || null; - return this; - } - - /** - * Instantiate master key from an HDPrivateKey. - * @param {HDPrivateKey} key - * @param {Mnemonic?} mnemonic - * @returns {MasterKey} - */ - - static fromKey(key, mnemonic) { - return new this().fromKey(key, mnemonic); - } - - /** - * Convert master key to a jsonifiable object. - * @param {Network?} network - * @param {Boolean?} unsafe - Whether to include - * the key data in the JSON. - * @returns {Object} - */ - - toJSON(network, unsafe) { - if (!this.key) { - return { - encrypted: true, - until: this.until, - iv: this.iv.toString('hex'), - ciphertext: unsafe ? this.ciphertext.toString('hex') : undefined, - algorithm: MasterKey$1.algByVal[this.alg].toLowerCase(), - n: this.n, - r: this.r, - p: this.p - }; - } - - return { - encrypted: false, - key: unsafe ? this.key.toJSON(network) : undefined, - mnemonic: unsafe && this.mnemonic ? this.mnemonic.toJSON() : undefined - }; - } - - /** - * Inspect the key. - * @returns {Object} - */ - - [inspectSymbol$2]() { - const json = this.toJSON(null, true); - - if (this.key) - json.key = this.key.toJSON(); - - if (this.mnemonic) - json.mnemonic = this.mnemonic.toJSON(); - - return json; - } - - /** - * Test whether an object is a MasterKey. - * @param {Object} obj - * @returns {Boolean} - */ - - static isMasterKey(obj) { - return obj instanceof MasterKey$1; - } - } - - /** - * Key derivation salt. - * @const {Buffer} - * @default - */ - - MasterKey$1.SALT = Buffer.from('bcoin', 'ascii'); - - /** - * Key derivation algorithms. - * @enum {Number} - * @default - */ - - MasterKey$1.alg = { - PBKDF2: 0, - SCRYPT: 1 - }; - - /** - * Key derivation algorithms by value. - * @enum {String} - * @default - */ - - MasterKey$1.algByVal = [ - 'PBKDF2', - 'SCRYPT' - ]; - - /* - * Helpers - */ - - function isLegacy(data) { - if (data.length < 82) - return false; - - const key = data.slice(0, 78); - const chk = data.readUInt32LE(78, true); - - const hash = hash256$1.digest(key); - - return hash.readUInt32LE(0, true) === chk; - } - - /* - * Expose - */ - - var masterkey = MasterKey$1; - - /*! - * nodeclient.js - node client for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$7 = assert_1$g; - const AsyncEmitter = bevent; - - /** - * Node Client - * @alias module:node.NodeClient - */ - - class NodeClient extends AsyncEmitter { - /** - * Create a node client. - * @constructor - */ - - constructor(node) { - super(); - - this.node = node; - this.network = node.network; - this.filter = null; - this.opened = false; - - this.init(); - } - - /** - * Initialize the client. - */ - - init() { - this.node.chain.on('connect', async (entry, block) => { - if (!this.opened) - return; - - await this.emitAsync('block connect', entry, block.txs); - }); - - this.node.chain.on('disconnect', async (entry, block) => { - if (!this.opened) - return; - - await this.emitAsync('block disconnect', entry); - }); - - this.node.on('tx', (tx) => { - if (!this.opened) - return; - - this.emit('tx', tx); - }); - - this.node.on('reset', (tip) => { - if (!this.opened) - return; - - this.emit('chain reset', tip); - }); - } - - /** - * Open the client. - * @returns {Promise} - */ - - async open(options) { - assert$7(!this.opened, 'NodeClient is already open.'); - this.opened = true; - setImmediate(() => this.emit('connect')); - } - - /** - * Close the client. - * @returns {Promise} - */ - - async close() { - assert$7(this.opened, 'NodeClient is not open.'); - this.opened = false; - setImmediate(() => this.emit('disconnect')); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - bind(type, handler) { - return this.on(type, handler); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - hook(type, handler) { - return this.on(type, handler); - } - - /** - * Get chain tip. - * @returns {Promise} - */ - - async getTip() { - return this.node.chain.tip; - } - - /** - * Get chain entry. - * @param {Hash} hash - * @returns {Promise} - */ - - async getEntry(hash) { - const entry = await this.node.chain.getEntry(hash); - - if (!entry) - return null; - - if (!await this.node.chain.isMainChain(entry)) - return null; - - return entry; - } - - /** - * Send a transaction. Do not wait for promise. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - this.node.relay(tx); - } - - /** - * Set bloom filter. - * @param {Bloom} filter - * @returns {Promise} - */ - - async setFilter(filter) { - this.filter = filter; - this.node.pool.setFilter(filter); - } - - /** - * Add data to filter. - * @param {Buffer} data - * @returns {Promise} - */ - - async addFilter(data) { - this.node.pool.queueFilterLoad(); - } - - /** - * Reset filter. - * @returns {Promise} - */ - - async resetFilter() { - this.node.pool.queueFilterLoad(); - } - - /** - * Estimate smart fee. - * @param {Number?} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - if (!this.node.fees) - return {rate: this.network.feeRate}; - - const fee = this.node.fees.estimateFee(blocks); - return {rate: fee}; - } - - /** - * Get hash range. - * @param {Number} start - * @param {Number} end - * @returns {Promise} - */ - - async getHashes(start = -1, end = -1) { - return this.node.chain.getHashes(start, end); - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - async rescan(start) { - if (this.node.spv) - return this.node.chain.reset(start); - - return this.node.chain.scan(start, this.filter, (entry, txs) => { - return this.emitAsync('block rescan', entry, txs); - }); - } - } - - /* - * Expose - */ - - var nodeclient = NodeClient; - - var plugin = {}; - - var records$2 = {exports: {}}; - - /*! - * records.js - walletdb records - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - (function (module, exports) { - - /** - * @module wallet/records - */ - - const assert = assert_1$g; - const bio = bufio; - const util = util$y; - const TX = tx; - const consensus = consensus$s; - - /** - * Chain State - */ - - class ChainState { - /** - * Create a chain state. - * @constructor - */ - - constructor() { - this.startHeight = 0; - this.startHash = consensus.ZERO_HASH; - this.height = 0; - this.marked = false; - } - - /** - * Clone the state. - * @returns {ChainState} - */ - - clone() { - const state = new ChainState(); - state.startHeight = this.startHeight; - state.startHash = this.startHash; - state.height = this.height; - state.marked = this.marked; - return state; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.startHeight = br.readU32(); - this.startHash = br.readHash(); - this.height = br.readU32(); - this.marked = br.readU8() === 1; - - return this; - } - - /** - * Instantiate chain state from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {ChainState} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the chain state. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(41); - - bw.writeU32(this.startHeight); - bw.writeHash(this.startHash); - bw.writeU32(this.height); - bw.writeU8(this.marked ? 1 : 0); - - return bw.render(); - } - } - - /** - * Block Meta - */ - - class BlockMeta { - /** - * Create block meta. - * @constructor - * @param {Hash} hash - * @param {Number} height - * @param {Number} time - */ - - constructor(hash, height, time) { - this.hash = hash || consensus.ZERO_HASH; - this.height = height != null ? height : -1; - this.time = time || 0; - } - - /** - * Clone the block. - * @returns {BlockMeta} - */ - - clone() { - return new this.constructor(this.hash, this.height, this.time); - } - - /** - * Get block meta hash as a buffer. - * @returns {Buffer} - */ - - toHash() { - return this.hash; - } - - /** - * Instantiate block meta from chain entry. - * @private - * @param {ChainEntry} entry - */ - - fromEntry(entry) { - this.hash = entry.hash; - this.height = entry.height; - this.time = entry.time; - return this; - } - - /** - * Instantiate block meta from json object. - * @private - * @param {Object} json - */ - - fromJSON(json) { - this.hash = util.revHex(json.hash); - this.height = json.height; - this.time = json.time; - return this; - } - - /** - * Instantiate block meta from serialized tip data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - this.hash = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - return this; - } - - /** - * Instantiate block meta from chain entry. - * @param {ChainEntry} entry - * @returns {BlockMeta} - */ - - static fromEntry(entry) { - return new this().fromEntry(entry); - } - - /** - * Instantiate block meta from json object. - * @param {Object} json - * @returns {BlockMeta} - */ - - static fromJSON(json) { - return new this().fromJSON(json); - } - - /** - * Instantiate block meta from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {BlockMeta} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the block meta. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(42); - bw.writeHash(this.hash); - bw.writeU32(this.height); - bw.writeU32(this.time); - return bw.render(); - } - - /** - * Convert the block meta to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - hash: util.revHex(this.hash), - height: this.height, - time: this.time - }; - } - } - - /** - * TX Record - */ - - class TXRecord { - /** - * Create tx record. - * @constructor - * @param {TX} tx - * @param {BlockMeta?} block - */ - - constructor(tx, block) { - this.tx = null; - this.hash = null; - this.mtime = util.now(); - this.height = -1; - this.block = null; - this.index = -1; - this.time = 0; - - if (tx) - this.fromTX(tx, block); - } - - /** - * Inject properties from tx and block. - * @private - * @param {TX} tx - * @param {Block?} block - * @returns {TXRecord} - */ - - fromTX(tx, block) { - this.tx = tx; - this.hash = tx.hash(); - - if (block) - this.setBlock(block); - - return this; - } - - /** - * Instantiate tx record from tx and block. - * @param {TX} tx - * @param {Block?} block - * @returns {TXRecord} - */ - - static fromTX(tx, block) { - return new this().fromTX(tx, block); - } - - /** - * Set block data (confirm). - * @param {BlockMeta} block - */ - - setBlock(block) { - this.height = block.height; - this.block = block.hash; - this.time = block.time; - } - - /** - * Unset block (unconfirm). - */ - - unsetBlock() { - this.height = -1; - this.block = null; - this.time = 0; - } - - /** - * Convert tx record to a block meta. - * @returns {BlockMeta} - */ - - getBlock() { - if (this.height === -1) - return null; - - return new BlockMeta(this.block, this.height, this.time); - } - - /** - * Calculate current number of transaction confirmations. - * @param {Number} height - Current chain height. - * @returns {Number} confirmations - */ - - getDepth(height) { - assert(typeof height === 'number', 'Must pass in height.'); - - if (this.height === -1) - return 0; - - if (height < this.height) - return 0; - - return height - this.height + 1; - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - size += this.tx.getSize(); - size += 4; - - if (this.block) { - size += 1; - size += 32; - size += 4 * 3; - } else { - size += 1; - } - - return size; - } - - /** - * Serialize a transaction to "extended format". - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio.write(size); - - let index = this.index; - - this.tx.toWriter(bw); - - bw.writeU32(this.mtime); - - if (this.block) { - if (index === -1) - index = 0x7fffffff; - - bw.writeU8(1); - bw.writeHash(this.block); - bw.writeU32(this.height); - bw.writeU32(this.time); - bw.writeU32(index); - } else { - bw.writeU8(0); - } - - return bw.render(); - } - - /** - * Inject properties from "extended" format. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.tx = new TX(); - this.tx.fromReader(br); - - this.hash = this.tx.hash(); - this.mtime = br.readU32(); - - if (br.readU8() === 1) { - this.block = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - this.index = br.readU32(); - if (this.index === 0x7fffffff) - this.index = -1; - } - - return this; - } - - /** - * Instantiate a transaction from a buffer - * in "extended" serialization format. - * @param {Buffer} data - * @returns {TX} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - } - - /** - * Map Record - */ - - class MapRecord { - /** - * Create map record. - * @constructor - */ - - constructor() { - this.wids = new Set(); - } - - add(wid) { - if (this.wids.has(wid)) - return false; - - this.wids.add(wid); - - return true; - } - - remove(wid) { - return this.wids.delete(wid); - } - - toWriter(bw) { - bw.writeU32(this.wids.size); - - for (const wid of this.wids) - bw.writeU32(wid); - - return bw; - } - - getSize() { - return 4 + this.wids.size * 4; - } - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio.write(size)).render(); - } - - fromReader(br) { - const count = br.readU32(); - - for (let i = 0; i < count; i++) - this.wids.add(br.readU32()); - - return this; - } - - fromRaw(data) { - return this.fromReader(bio.read(data)); - } - - static fromReader(br) { - return new this().fromReader(br); - } - - static fromRaw(data) { - return new this().fromRaw(data); - } - } - - /* - * Expose - */ - - exports.ChainState = ChainState; - exports.BlockMeta = BlockMeta; - exports.TXRecord = TXRecord; - exports.MapRecord = MapRecord; - - module.exports = exports; - }(records$2, records$2.exports)); - - /*! - * txdb.js - persistent transaction pool - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$6 = assert_1$g; - const bio$2 = bufio; - const {BufferSet: BufferSet$2} = bufferMap; - const util$1 = util$y; - const Amount$1 = amount; - const CoinView = coinview; - const Coin$1 = coin; - const Outpoint$3 = outpoint; - const records$1 = records$2.exports; - const layout$1 = layout$2.txdb; - const consensus$2 = consensus$s; - const policy$1 = policy$9; - const {TXRecord: TXRecord$1} = records$1; - const {inspectSymbol: inspectSymbol$1} = utils; - - /** - * TXDB - * @alias module:wallet.TXDB - */ - - class TXDB$1 { - /** - * Create a TXDB. - * @constructor - * @param {WalletDB} wdb - */ - - constructor(wdb, wid) { - this.wdb = wdb; - this.db = wdb.db; - this.logger = wdb.logger; - - this.wid = wid || 0; - this.bucket = null; - this.wallet = null; - this.locked = new BufferSet$2(); - } - - /** - * Open TXDB. - * @returns {Promise} - */ - - async open(wallet) { - const prefix = layout$1.prefix.encode(wallet.wid); - - this.wid = wallet.wid; - this.bucket = this.db.bucket(prefix); - this.wallet = wallet; - } - - /** - * Emit transaction event. - * @private - * @param {String} event - * @param {Object} data - * @param {Details} details - */ - - emit(event, data, details) { - this.wdb.emit(event, this.wallet, data, details); - this.wallet.emit(event, data, details); - } - - /** - * Get wallet path for output. - * @param {Output} output - * @returns {Promise} - Returns {@link Path}. - */ - - getPath(output) { - const hash = output.getHash(); - - if (!hash) - return null; - - return this.wdb.getPath(this.wid, hash); - } - - /** - * Test whether path exists for output. - * @param {Output} output - * @returns {Promise} - Returns Boolean. - */ - - hasPath(output) { - const hash = output.getHash(); - - if (!hash) - return false; - - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Save credit. - * @param {Credit} credit - * @param {Path} path - */ - - async saveCredit(b, credit, path) { - const {coin} = credit; - - b.put(layout$1.c.encode(coin.hash, coin.index), credit.toRaw()); - b.put(layout$1.C.encode(path.account, coin.hash, coin.index), null); - - return this.addOutpointMap(b, coin.hash, coin.index); - } - - /** - * Remove credit. - * @param {Credit} credit - * @param {Path} path - */ - - async removeCredit(b, credit, path) { - const {coin} = credit; - - b.del(layout$1.c.encode(coin.hash, coin.index)); - b.del(layout$1.C.encode(path.account, coin.hash, coin.index)); - - return this.removeOutpointMap(b, coin.hash, coin.index); - } - - /** - * Spend credit. - * @param {Credit} credit - * @param {TX} tx - * @param {Number} index - */ - - spendCredit(b, credit, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.put(layout$1.s.encode(prevout.hash, prevout.index), spender.toRaw()); - b.put(layout$1.d.encode(spender.hash, spender.index), credit.coin.toRaw()); - } - - /** - * Unspend credit. - * @param {TX} tx - * @param {Number} index - */ - - unspendCredit(b, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.del(layout$1.s.encode(prevout.hash, prevout.index)); - b.del(layout$1.d.encode(spender.hash, spender.index)); - } - - /** - * Write input record. - * @param {TX} tx - * @param {Number} index - */ - - async writeInput(b, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.put(layout$1.s.encode(prevout.hash, prevout.index), spender.toRaw()); - return this.addOutpointMap(b, prevout.hash, prevout.index); - } - - /** - * Remove input record. - * @param {TX} tx - * @param {Number} index - */ - - async removeInput(b, tx, index) { - const prevout = tx.inputs[index].prevout; - b.del(layout$1.s.encode(prevout.hash, prevout.index)); - return this.removeOutpointMap(b, prevout.hash, prevout.index); - } - - /** - * Update wallet balance. - * @param {BalanceDelta} state - */ - - async updateBalance(b, state) { - const balance = await this.getWalletBalance(); - state.applyTo(balance); - b.put(layout$1.R.encode(), balance.toRaw()); - return balance; - } - - /** - * Update account balance. - * @param {Number} acct - * @param {Balance} delta - */ - - async updateAccountBalance(b, acct, delta) { - const balance = await this.getAccountBalance(acct); - delta.applyTo(balance); - b.put(layout$1.r.encode(acct), balance.toRaw()); - return balance; - } - - /** - * Test a whether a coin has been spent. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns Boolean. - */ - - async getSpent(hash, index) { - const data = await this.bucket.get(layout$1.s.encode(hash, index)); - - if (!data) - return null; - - return Outpoint$3.fromRaw(data); - } - - /** - * Test a whether a coin has been spent. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns Boolean. - */ - - isSpent(hash, index) { - return this.bucket.has(layout$1.s.encode(hash, index)); - } - - /** - * Append to global map. - * @param {Number} height - * @returns {Promise} - */ - - addBlockMap(b, height) { - return this.wdb.addBlockMap(b.root(), height, this.wid); - } - - /** - * Remove from global map. - * @param {Number} height - * @returns {Promise} - */ - - removeBlockMap(b, height) { - return this.wdb.removeBlockMap(b.root(), height, this.wid); - } - - /** - * Append to global map. - * @param {Hash} hash - * @returns {Promise} - */ - - addTXMap(b, hash) { - return this.wdb.addTXMap(b.root(), hash, this.wid); - } - - /** - * Remove from global map. - * @param {Hash} hash - * @returns {Promise} - */ - - removeTXMap(b, hash) { - return this.wdb.removeTXMap(b.root(), hash, this.wid); - } - - /** - * Append to global map. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - */ - - addOutpointMap(b, hash, index) { - return this.wdb.addOutpointMap(b.root(), hash, index, this.wid); - } - - /** - * Remove from global map. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - */ - - removeOutpointMap(b, hash, index) { - return this.wdb.removeOutpointMap(b.root(), hash, index, this.wid); - } - - /** - * List block records. - * @returns {Promise} - */ - - getBlocks() { - return this.bucket.keys({ - gte: layout$1.b.min(), - lte: layout$1.b.max(), - parse: key => layout$1.b.decode(key)[0] - }); - } - - /** - * Get block record. - * @param {Number} height - * @returns {Promise} - */ - - async getBlock(height) { - const data = await this.bucket.get(layout$1.b.encode(height)); - - if (!data) - return null; - - return BlockRecord.fromRaw(data); - } - - /** - * Append to the global block record. - * @param {Hash} hash - * @param {BlockMeta} block - * @returns {Promise} - */ - - async addBlock(b, hash, block) { - const key = layout$1.b.encode(block.height); - const data = await this.bucket.get(key); - - if (!data) { - const blk = BlockRecord.fromMeta(block); - blk.add(hash); - b.put(key, blk.toRaw()); - return; - } - - const raw = Buffer.allocUnsafe(data.length + 32); - data.copy(raw, 0); - - const size = raw.readUInt32LE(40, true); - raw.writeUInt32LE(size + 1, 40, true); - hash.copy(raw, data.length); - - b.put(key, raw); - } - - /** - * Remove from the global block record. - * @param {Hash} hash - * @param {Number} height - * @returns {Promise} - */ - - async removeBlock(b, hash, height) { - const key = layout$1.b.encode(height); - const data = await this.bucket.get(key); - - if (!data) - return; - - const size = data.readUInt32LE(40, true); - - assert$6(size > 0); - assert$6(data.slice(-32).equals(hash)); - - if (size === 1) { - b.del(key); - return; - } - - const raw = data.slice(0, -32); - raw.writeUInt32LE(size - 1, 40, true); - - b.put(key, raw); - } - - /** - * Remove from the global block record. - * @param {Hash} hash - * @param {Number} height - * @returns {Promise} - */ - - async spliceBlock(b, hash, height) { - const block = await this.getBlock(height); - - if (!block) - return; - - if (!block.remove(hash)) - return; - - if (block.hashes.size === 0) { - b.del(layout$1.b.encode(height)); - return; - } - - b.put(layout$1.b.encode(height), block.toRaw()); - } - - /** - * Add transaction without a batch. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async add(tx, block) { - const hash = tx.hash(); - const existing = await this.getTX(hash); - - assert$6(!tx.mutable, 'Cannot add mutable TX to wallet.'); - - if (existing) { - // Existing tx is already confirmed. Ignore. - if (existing.height !== -1) - return null; - - // The incoming tx won't confirm the - // existing one anyway. Ignore. - if (!block) - return null; - - // Confirm transaction. - return this.confirm(existing, block); - } - - const wtx = TXRecord$1.fromTX(tx, block); - - if (!block) { - // Potentially remove double-spenders. - // Only remove if they're not confirmed. - if (!await this.removeConflicts(tx, true)) - return null; - } else { - // Potentially remove double-spenders. - await this.removeConflicts(tx, false); - } - - // Finally we can do a regular insertion. - return this.insert(wtx, block); - } - - /** - * Insert transaction. - * @private - * @param {TXRecord} wtx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async insert(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block ? block.height : -1; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - let own = false; - - if (!tx.isCoinbase()) { - // We need to potentially spend some coins here. - for (let i = 0; i < tx.inputs.length; i++) { - const input = tx.inputs[i]; - const {hash, index} = input.prevout; - const credit = await this.getCredit(hash, index); - - if (!credit) { - // Watch all inputs for incoming txs. - // This allows us to check for double spends. - if (!block) - await this.writeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - const path = await this.getPath(coin); - assert$6(path); - - // Build the tx details object - // as we go, for speed. - details.setInput(i, path, coin); - - // Write an undo coin for the credit - // and add it to the stxo set. - this.spendCredit(b, credit, tx, i); - - // Unconfirmed balance should always - // be updated as it reflects the on-chain - // balance _and_ mempool balance assuming - // everything in the mempool were to confirm. - state.tx(path, 1); - state.coin(path, -1); - state.unconfirmed(path, -coin.value); - - if (!block) { - // If the tx is not mined, we do not - // disconnect the coin, we simply mark - // a `spent` flag on the credit. This - // effectively prevents the mempool - // from altering our utxo state - // permanently. It also makes it - // possible to compare the on-chain - // state vs. the mempool state. - credit.spent = true; - await this.saveCredit(b, credit, path); - } else { - // If the tx is mined, we can safely - // remove the coin being spent. This - // coin will be indexed as an undo - // coin so it can be reconnected - // later during a reorg. - state.confirmed(path, -coin.value); - await this.removeCredit(b, credit, path); - } - - own = true; - } - } - - // Potentially add coins to the utxo set. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - const credit = Credit.fromTX(tx, i, height); - credit.own = own; - - state.tx(path, 1); - state.coin(path, 1); - state.unconfirmed(path, output.value); - - if (block) - state.confirmed(path, output.value); - - await this.saveCredit(b, credit, path); - } - - // If this didn't update any coins, - // it's not our transaction. - if (!state.updated()) - return null; - - // Save and index the transaction record. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.put(layout$1.m.encode(wtx.mtime, hash), null); - - if (!block) - b.put(layout$1.p.encode(hash), null); - else - b.put(layout$1.h.encode(height, hash), null); - - // Do some secondary indexing for account-based - // queries. This saves us a lot of time for - // queries later. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - - b.put(layout$1.T.encode(acct, hash), null); - b.put(layout$1.M.encode(acct, wtx.mtime, hash), null); - - if (!block) - b.put(layout$1.P.encode(acct, hash), null); - else - b.put(layout$1.H.encode(acct, height, hash), null); - } - - // Update block records. - if (block) { - await this.addBlockMap(b, height); - await this.addBlock(b, tx.hash(), block); - } else { - await this.addTXMap(b, hash); - } - - // Commit the new state. - const balance = await this.updateBalance(b, state); - - await b.write(); - - // This transaction may unlock some - // coins now that we've seen it. - this.unlockTX(tx); - - // Emit events for potential local and - // websocket listeners. Note that these - // will only be emitted if the batch is - // successfully written to disk. - this.emit('tx', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Attempt to confirm a transaction. - * @private - * @param {TXRecord} wtx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async confirm(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block.height; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - let own = false; - - wtx.setBlock(block); - - if (!tx.isCoinbase()) { - const credits = await this.getSpentCredits(tx); - - // Potentially spend coins. Now that the tx - // is mined, we can actually _remove_ coins - // from the utxo state. - for (let i = 0; i < tx.inputs.length; i++) { - const input = tx.inputs[i]; - const {hash, index} = input.prevout; - - let resolved = false; - - // There may be new credits available - // that we haven't seen yet. - if (!credits[i]) { - await this.removeInput(b, tx, i); - - const credit = await this.getCredit(hash, index); - - if (!credit) - continue; - - // Add a spend record and undo coin - // for the coin we now know is ours. - // We don't need to remove the coin - // since it was never added in the - // first place. - this.spendCredit(b, credit, tx, i); - - credits[i] = credit; - resolved = true; - } - - const credit = credits[i]; - const coin = credit.coin; - - assert$6(coin.height !== -1); - - const path = await this.getPath(coin); - assert$6(path); - own = true; - - details.setInput(i, path, coin); - - if (resolved) { - state.coin(path, -1); - state.unconfirmed(path, -coin.value); - } - - // We can now safely remove the credit - // entirely, now that we know it's also - // been removed on-chain. - state.confirmed(path, -coin.value); - - await this.removeCredit(b, credit, path); - } - } - - // Update credit heights, including undo coins. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - let credit = await this.getCredit(hash, i); - - if (!credit) { - // This credit didn't belong to us the first time we - // saw the transaction (before confirmation or rescan). - // Create new credit for database. - credit = Credit.fromTX(tx, i, height); - - // If this tx spent any of our own coins, we "own" this output, - // meaning if it becomes unconfirmed, we can still confidently spend it. - credit.own = own; - - // Add coin to "unconfirmed" balance (which includes confirmed coins) - state.coin(path, 1); - state.unconfirmed(path, credit.coin.value); - } - - // Credits spent in the mempool add an - // undo coin for ease. If this credit is - // spent in the mempool, we need to - // update the undo coin's height. - if (credit.spent) - await this.updateSpentCoin(b, tx, i, height); - - // Update coin height and confirmed - // balance. Save once again. - state.confirmed(path, output.value); - credit.coin.height = height; - - await this.saveCredit(b, credit, path); - } - - // Save the new serialized transaction as - // the block-related properties have been - // updated. Also reindex for height. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.del(layout$1.p.encode(hash)); - b.put(layout$1.h.encode(height, hash), null); - - // Secondary indexing also needs to change. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - b.del(layout$1.P.encode(acct, hash)); - b.put(layout$1.H.encode(acct, height, hash), null); - } - - await this.removeTXMap(b, hash); - await this.addBlockMap(b, height); - await this.addBlock(b, tx.hash(), block); - - // Commit the new state. The balance has updated. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.unlockTX(tx); - - this.emit('confirmed', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Recursively remove a transaction - * from the database. - * @param {Hash} hash - * @returns {Promise} - */ - - async remove(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - return this.removeRecursive(wtx); - } - - /** - * Remove a transaction from the - * database. Disconnect inputs. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async erase(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block ? block.height : -1; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - if (!tx.isCoinbase()) { - // We need to undo every part of the - // state this transaction ever touched. - // Start by getting the undo coins. - const credits = await this.getSpentCredits(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const credit = credits[i]; - - if (!credit) { - if (!block) - await this.removeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - const path = await this.getPath(coin); - assert$6(path); - - details.setInput(i, path, coin); - - // Recalculate the balance, remove - // from stxo set, remove the undo - // coin, and resave the credit. - state.tx(path, -1); - state.coin(path, 1); - state.unconfirmed(path, coin.value); - - if (block) - state.confirmed(path, coin.value); - - this.unspendCredit(b, tx, i); - - credit.spent = false; - await this.saveCredit(b, credit, path); - } - } - - // We need to remove all credits - // this transaction created. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - const credit = Credit.fromTX(tx, i, height); - - state.tx(path, -1); - state.coin(path, -1); - state.unconfirmed(path, -output.value); - - if (block) - state.confirmed(path, -output.value); - - await this.removeCredit(b, credit, path); - } - - // Remove the transaction data - // itself as well as unindex. - b.del(layout$1.t.encode(hash)); - b.del(layout$1.m.encode(wtx.mtime, hash)); - - if (!block) - b.del(layout$1.p.encode(hash)); - else - b.del(layout$1.h.encode(height, hash)); - - // Remove all secondary indexing. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - - b.del(layout$1.T.encode(acct, hash)); - b.del(layout$1.M.encode(acct, wtx.mtime, hash)); - - if (!block) - b.del(layout$1.P.encode(acct, hash)); - else - b.del(layout$1.H.encode(acct, height, hash)); - } - - // Update block records. - if (block) { - await this.removeBlockMap(b, height); - await this.spliceBlock(b, hash, height); - } else { - await this.removeTXMap(b, hash); - } - - // Update the transaction counter - // and commit new state due to - // balance change. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.emit('remove tx', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Remove a transaction and recursively - * remove all of its spenders. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async removeRecursive(wtx) { - const {tx, hash} = wtx; - - if (!await this.hasTX(hash)) - return null; - - for (let i = 0; i < tx.outputs.length; i++) { - const spent = await this.getSpent(hash, i); - - if (!spent) - continue; - - // Remove all of the spender's spenders first. - const stx = await this.getTX(spent.hash); - - assert$6(stx); - - await this.removeRecursive(stx); - } - - // Remove the spender. - return this.erase(wtx, wtx.getBlock()); - } - - /** - * Revert a block. - * @param {Number} height - * @returns {Promise} - */ - - async revert(height) { - const block = await this.getBlock(height); - - if (!block) - return 0; - - this.logger.debug('Rescan: reverting block %d', height); - const hashes = block.toArray(); - - for (let i = hashes.length - 1; i >= 0; i--) { - const hash = hashes[i]; - await this.unconfirm(hash); - } - - return hashes.length; - } - - /** - * Unconfirm a transaction without a batch. - * @private - * @param {Hash} hash - * @returns {Promise} - */ - - async unconfirm(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - if (wtx.height === -1) - return null; - - return this.disconnect(wtx, wtx.getBlock()); - } - - /** - * Unconfirm a transaction. Necessary after a reorg. - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async disconnect(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash, height} = wtx; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - assert$6(block); - - wtx.unsetBlock(); - - if (!tx.isCoinbase()) { - // We need to reconnect the coins. Start - // by getting all of the undo coins we know - // about. - const credits = await this.getSpentCredits(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const credit = credits[i]; - - if (!credit) { - await this.writeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - - assert$6(coin.height !== -1); - - const path = await this.getPath(coin); - assert$6(path); - - details.setInput(i, path, coin); - - state.confirmed(path, coin.value); - - // Resave the credit and mark it - // as spent in the mempool instead. - credit.spent = true; - await this.saveCredit(b, credit, path); - } - } - - // We need to remove heights on - // the credits and undo coins. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - const credit = await this.getCredit(hash, i); - - // Potentially update undo coin height. - if (!credit) { - await this.updateSpentCoin(b, tx, i, height); - continue; - } - - if (credit.spent) - await this.updateSpentCoin(b, tx, i, height); - - details.setOutput(i, path); - - // Update coin height and confirmed - // balance. Save once again. - credit.coin.height = -1; - - state.confirmed(path, -output.value); - - await this.saveCredit(b, credit, path); - } - - await this.addTXMap(b, hash); - await this.removeBlockMap(b, height); - await this.removeBlock(b, tx.hash(), height); - - // We need to update the now-removed - // block properties and reindex due - // to the height change. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.put(layout$1.p.encode(hash), null); - b.del(layout$1.h.encode(height, hash)); - - // Secondary indexing also needs to change. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - b.put(layout$1.P.encode(acct, hash), null); - b.del(layout$1.H.encode(acct, height, hash)); - } - - // Commit state due to unconfirmed - // vs. confirmed balance change. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.emit('unconfirmed', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Remove spenders that have not been confirmed. We do this in the - * odd case of stuck transactions or when a coin is double-spent - * by a newer transaction. All previously-spending transactions - * of that coin that are _not_ confirmed will be removed from - * the database. - * @private - * @param {Hash} hash - * @param {TX} ref - Reference tx, the tx that double-spent. - * @returns {Promise} - Returns Boolean. - */ - - async removeConflict(wtx) { - const tx = wtx.tx; - - this.logger.warning('Handling conflicting tx: %h.', tx.hash()); - - const details = await this.removeRecursive(wtx); - - if (!details) - return null; - - this.logger.warning('Removed conflict: %h.', tx.hash()); - - // Emit the _removed_ transaction. - this.emit('conflict', tx, details); - - return details; - } - - /** - * Retrieve coins for own inputs, remove - * double spenders, and verify inputs. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async removeConflicts(tx, conf) { - if (tx.isCoinbase()) - return true; - - const txid = tx.hash(); - const spends = []; - - // Gather all spent records first. - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - - // Is it already spent? - const spent = await this.getSpent(hash, index); - - if (!spent) - continue; - - // Did _we_ spend it? - if (spent.hash.equals(txid)) - continue; - - const spender = await this.getTX(spent.hash); - assert$6(spender); - - if (conf && spender.height !== -1) - return false; - - spends.push(spender); - } - - // Once we know we're not going to - // screw things up, remove the double - // spenders. - for (const spender of spends) { - // Remove the double spender. - await this.removeConflict(spender); - } - - return true; - } - - /** - * Lock all coins in a transaction. - * @param {TX} tx - */ - - lockTX(tx) { - if (tx.isCoinbase()) - return; - - for (const input of tx.inputs) - this.lockCoin(input.prevout); - } - - /** - * Unlock all coins in a transaction. - * @param {TX} tx - */ - - unlockTX(tx) { - if (tx.isCoinbase()) - return; - - for (const input of tx.inputs) - this.unlockCoin(input.prevout); - } - - /** - * Lock a single coin. - * @param {Coin|Outpoint} coin - */ - - lockCoin(coin) { - const key = coin.toKey(); - this.locked.add(key); - } - - /** - * Unlock a single coin. - * @param {Coin|Outpoint} coin - */ - - unlockCoin(coin) { - const key = coin.toKey(); - return this.locked.delete(key); - } - - /** - * Unlock all coins. - */ - - unlockCoins() { - for (const coin of this.getLocked()) - this.unlockCoin(coin); - } - - /** - * Test locked status of a single coin. - * @param {Coin|Outpoint} coin - */ - - isLocked(coin) { - const key = coin.toKey(); - return this.locked.has(key); - } - - /** - * Filter array of coins or outpoints - * for only unlocked ones. - * @param {Coin[]|Outpoint[]} - * @returns {Array} - */ - - filterLocked(coins) { - const out = []; - - for (const coin of coins) { - if (!this.isLocked(coin)) - out.push(coin); - } - - return out; - } - - /** - * Return an array of all locked outpoints. - * @returns {Outpoint[]} - */ - - getLocked() { - const outpoints = []; - - for (const key of this.locked.keys()) - outpoints.push(Outpoint$3.fromKey(key)); - - return outpoints; - } - - /** - * Get hashes of all transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountHistoryHashes(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.T.min(acct), - lte: layout$1.T.max(acct), - parse: (key) => { - const [, hash] = layout$1.T.decode(key); - return hash; - } - }); - } - - /** - * Get hashes of all transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHistoryHashes(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountHistoryHashes(acct); - - return this.bucket.keys({ - gte: layout$1.t.min(), - lte: layout$1.t.max(), - parse: key => layout$1.t.decode(key)[0] - }); - } - - /** - * Get hashes of all unconfirmed transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountPendingHashes(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.P.min(acct), - lte: layout$1.P.max(acct), - parse: (key) => { - const [, hash] = layout$1.P.decode(key); - return hash; - } - }); - } - - /** - * Get hashes of all unconfirmed transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getPendingHashes(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountPendingHashes(acct); - - return this.bucket.keys({ - gte: layout$1.p.min(), - lte: layout$1.p.max(), - parse: key => layout$1.p.decode(key)[0] - }); - } - - /** - * Test whether the database has a pending transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasPending(hash) { - return this.bucket.has(layout$1.p.encode(hash)); - } - - /** - * Get all coin hashes in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountOutpoints(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.C.min(acct), - lte: layout$1.C.max(acct), - parse: (key) => { - const [, hash, index] = layout$1.C.decode(key); - return new Outpoint$3(hash, index); - } - }); - } - - /** - * Get all coin hashes in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getOutpoints(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountOutpoints(acct); - - return this.bucket.keys({ - gte: layout$1.c.min(), - lte: layout$1.c.max(), - parse: (key) => { - const [hash, index] = layout$1.c.decode(key); - return new Outpoint$3(hash, index); - } - }); - } - - /** - * Get TX hashes by height range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountHeightRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.H.min(acct, start), - lte: layout$1.H.max(acct, end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [,, hash] = layout$1.H.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by height range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHeightRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountHeightRangeHashes(acct, options); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.h.min(start), - lte: layout$1.h.max(end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [, hash] = layout$1.h.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by height. - * @param {Number} height - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHeightHashes(height) { - return this.getHeightRangeHashes({ start: height, end: height }); - } - - /** - * Get TX hashes by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.M.min(acct, start), - lte: layout$1.M.max(acct, end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [,, hash] = layout$1.M.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountRangeHashes(acct, options); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.m.min(start), - lte: layout$1.m.max(end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [, hash] = layout$1.m.decode(key); - return hash; - } - }); - } - - /** - * Get transactions by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start time. - * @param {Number} options.end - End time. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getRange(acct, options) { - const hashes = await this.getRangeHashes(acct, options); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get last N transactions. - * @param {Number} acct - * @param {Number} limit - Max number of transactions. - * @returns {Promise} - Returns {@link TX}[]. - */ - - getLast(acct, limit) { - return this.getRange(acct, { - start: 0, - end: 0xffffffff, - reverse: true, - limit: limit || 10 - }); - } - - /** - * Get all transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - getHistory(acct) { - assert$6(typeof acct === 'number'); - - // Slow case - if (acct !== -1) - return this.getAccountHistory(acct); - - // Fast case - return this.bucket.values({ - gte: layout$1.t.min(), - lte: layout$1.t.max(), - parse: data => TXRecord$1.fromRaw(data) - }); - } - - /** - * Get all acct transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getAccountHistory(acct) { - const hashes = await this.getHistoryHashes(acct); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get unconfirmed transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getPending(acct) { - const hashes = await this.getPendingHashes(acct); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get coins. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - getCredits(acct) { - assert$6(typeof acct === 'number'); - - // Slow case - if (acct !== -1) - return this.getAccountCredits(acct); - - // Fast case - return this.bucket.range({ - gte: layout$1.c.min(), - lte: layout$1.c.max(), - parse: (key, value) => { - const [hash, index] = layout$1.c.decode(key); - const credit = Credit.fromRaw(value); - credit.coin.hash = hash; - credit.coin.index = index; - return credit; - } - }); - } - - /** - * Get coins by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getAccountCredits(acct) { - const outpoints = await this.getOutpoints(acct); - const credits = []; - - for (const {hash, index} of outpoints) { - const credit = await this.getCredit(hash, index); - if (!credit) - continue; - credits.push(credit); - } - - return credits; - } - - /** - * Fill a transaction with coins (all historical coins). - * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. - */ - - async getSpentCredits(tx) { - if (tx.isCoinbase()) - return []; - - const hash = tx.hash(); - const credits = []; - - for (let i = 0; i < tx.inputs.length; i++) - credits.push(null); - - await this.bucket.range({ - gte: layout$1.d.min(hash), - lte: layout$1.d.max(hash), - parse: (key, value) => { - const [, index] = layout$1.d.decode(key); - const coin = Coin$1.fromRaw(value); - const input = tx.inputs[index]; - assert$6(input); - coin.hash = input.prevout.hash; - coin.index = input.prevout.index; - credits[index] = new Credit(coin); - } - }); - - return credits; - } - - /** - * Get coins. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getCoins(acct) { - const credits = await this.getCredits(acct); - const coins = []; - - for (const credit of credits) { - if (credit.spent) - continue; - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get coins by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getAccountCoins(acct) { - const credits = await this.getAccountCredits(acct); - const coins = []; - - for (const credit of credits) { - if (credit.spent) - continue; - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get historical coins for a transaction. - * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. - */ - - async getSpentCoins(tx) { - if (tx.isCoinbase()) - return []; - - const credits = await this.getSpentCredits(tx); - const coins = []; - - for (const credit of credits) { - if (!credit) { - coins.push(null); - continue; - } - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get a coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getCoinView(tx) { - const view = new CoinView(); - - if (tx.isCoinbase()) - return view; - - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - const coin = await this.getCoin(hash, index); - - if (!coin) - continue; - - view.addCoin(coin); - } - - return view; - } - - /** - * Get historical coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getSpentView(tx) { - const view = new CoinView(); - - if (tx.isCoinbase()) - return view; - - const coins = await this.getSpentCoins(tx); - - for (const coin of coins) { - if (!coin) - continue; - - view.addCoin(coin); - } - - return view; - } - - /** - * Get transaction. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - async getTX(hash) { - const raw = await this.bucket.get(layout$1.t.encode(hash)); - - if (!raw) - return null; - - return TXRecord$1.fromRaw(raw); - } - - /** - * Get transaction details. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TXDetails}. - */ - - async getDetails(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - return this.toDetails(wtx); - } - - /** - * Convert transaction to transaction details. - * @param {TXRecord[]} wtxs - * @returns {Promise} - */ - - async toDetails(wtxs) { - const out = []; - - if (!Array.isArray(wtxs)) - return this._toDetails(wtxs); - - for (const wtx of wtxs) { - const details = await this._toDetails(wtx); - - if (!details) - continue; - - out.push(details); - } - - return out; - } - - /** - * Convert transaction to transaction details. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async _toDetails(wtx) { - const tx = wtx.tx; - const block = wtx.getBlock(); - const details = new Details(wtx, block); - const coins = await this.getSpentCoins(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const coin = coins[i]; - - let path = null; - - if (coin) - path = await this.getPath(coin); - - details.setInput(i, path, coin); - } - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - details.setOutput(i, path); - } - - return details; - } - - /** - * Test whether the database has a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - hasTX(hash) { - return this.bucket.has(layout$1.t.encode(hash)); - } - - /** - * Get coin. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCoin(hash, index) { - const credit = await this.getCredit(hash, index); - - if (!credit) - return null; - - return credit.coin; - } - - /** - * Get coin. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCredit(hash, index) { - const data = await this.bucket.get(layout$1.c.encode(hash, index)); - - if (!data) - return null; - - const credit = Credit.fromRaw(data); - credit.coin.hash = hash; - credit.coin.index = index; - - return credit; - } - - /** - * Get spender coin. - * @param {Outpoint} spent - * @param {Outpoint} prevout - * @returns {Promise} - Returns {@link Coin}. - */ - - async getSpentCoin(spent, prevout) { - const data = await this.bucket.get(layout$1.d.encode( - spent.hash, - spent.index - )); - - if (!data) - return null; - - const coin = Coin$1.fromRaw(data); - coin.hash = prevout.hash; - coin.index = prevout.index; - - return coin; - } - - /** - * Test whether the database has a spent coin. - * @param {Outpoint} spent - * @returns {Promise} - Returns {@link Coin}. - */ - - hasSpentCoin(spent) { - return this.bucket.has(layout$1.d.encode(spent.hash, spent.index)); - } - - /** - * Update spent coin height in storage. - * @param {TX} tx - Sending transaction. - * @param {Number} index - * @param {Number} height - * @returns {Promise} - */ - - async updateSpentCoin(b, tx, index, height) { - const prevout = Outpoint$3.fromTX(tx, index); - const spent = await this.getSpent(prevout.hash, prevout.index); - - if (!spent) - return; - - const coin = await this.getSpentCoin(spent, prevout); - - if (!coin) - return; - - coin.height = height; - - b.put(layout$1.d.encode(spent.hash, spent.index), coin.toRaw()); - } - - /** - * Test whether the database has a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasCoin(hash, index) { - return this.bucket.has(layout$1.c.encode(hash, index)); - } - - /** - * Calculate balance. - * @param {Number?} account - * @returns {Promise} - Returns {@link Balance}. - */ - - async getBalance(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountBalance(acct); - - return this.getWalletBalance(); - } - - /** - * Calculate balance. - * @returns {Promise} - Returns {@link Balance}. - */ - - async getWalletBalance() { - const data = await this.bucket.get(layout$1.R.encode()); - - if (!data) - return new Balance(); - - return Balance.fromRaw(-1, data); - } - - /** - * Calculate balance by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Balance}. - */ - - async getAccountBalance(acct) { - const data = await this.bucket.get(layout$1.r.encode(acct)); - - if (!data) - return new Balance(acct); - - return Balance.fromRaw(acct, data); - } - - /** - * Zap pending transactions older than `age`. - * @param {Number} acct - * @param {Number} age - Age delta. - * @returns {Promise} - */ - - async zap(acct, age) { - assert$6((age >>> 0) === age); - - const now = util$1.now(); - - const txs = await this.getRange(acct, { - start: 0, - end: now - age - }); - - const hashes = []; - - for (const wtx of txs) { - if (wtx.height !== -1) - continue; - - assert$6(now - wtx.mtime >= age); - - this.logger.debug('Zapping TX: %h (%d)', - wtx.tx.hash(), this.wid); - - await this.remove(wtx.hash); - - hashes.push(wtx.hash); - } - - return hashes; - } - - /** - * Abandon transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async abandon(hash) { - const result = await this.bucket.has(layout$1.p.encode(hash)); - - if (!result) - throw new Error('TX not eligible.'); - - return this.remove(hash); - } - } - - /** - * Balance - * @alias module:wallet.Balance - */ - - class Balance { - /** - * Create a balance. - * @constructor - * @param {Number} account - */ - - constructor(acct = -1) { - assert$6(typeof acct === 'number'); - - this.account = acct; - this.tx = 0; - this.coin = 0; - this.unconfirmed = 0; - this.confirmed = 0; - } - - /** - * Apply delta. - * @param {Balance} balance - */ - - applyTo(balance) { - balance.tx += this.tx; - balance.coin += this.coin; - balance.unconfirmed += this.unconfirmed; - balance.confirmed += this.confirmed; - - assert$6(balance.tx >= 0); - assert$6(balance.coin >= 0); - assert$6(balance.unconfirmed >= 0); - assert$6(balance.confirmed >= 0); - } - - /** - * Serialize balance. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio$2.write(32); - - bw.writeU64(this.tx); - bw.writeU64(this.coin); - bw.writeU64(this.unconfirmed); - bw.writeU64(this.confirmed); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - * @returns {TXDBState} - */ - - fromRaw(data) { - const br = bio$2.read(data); - this.tx = br.readU64(); - this.coin = br.readU64(); - this.unconfirmed = br.readU64(); - this.confirmed = br.readU64(); - return this; - } - - /** - * Instantiate balance from serialized data. - * @param {Number} acct - * @param {Buffer} data - * @returns {TXDBState} - */ - - static fromRaw(acct, data) { - return new this(acct).fromRaw(data); - } - - /** - * Convert balance to a more json-friendly object. - * @param {Boolean?} minimal - * @returns {Object} - */ - - toJSON(minimal) { - return { - account: !minimal ? this.account : undefined, - tx: this.tx, - coin: this.coin, - unconfirmed: this.unconfirmed, - confirmed: this.confirmed - }; - } - - /** - * Inspect balance. - * @param {String} - */ - - [inspectSymbol$1]() { - return ''; - } - } - - /** - * Balance Delta - * @ignore - */ - - class BalanceDelta { - /** - * Create a balance delta. - * @constructor - */ - - constructor() { - this.wallet = new Balance(); - this.accounts = new Map(); - } - - updated() { - return this.wallet.tx !== 0; - } - - applyTo(balance) { - this.wallet.applyTo(balance); - } - - get(path) { - if (!this.accounts.has(path.account)) - this.accounts.set(path.account, new Balance()); - - return this.accounts.get(path.account); - } - - tx(path, value) { - const account = this.get(path); - account.tx = value; - this.wallet.tx = value; - } - - coin(path, value) { - const account = this.get(path); - account.coin += value; - this.wallet.coin += value; - } - - unconfirmed(path, value) { - const account = this.get(path); - account.unconfirmed += value; - this.wallet.unconfirmed += value; - } - - confirmed(path, value) { - const account = this.get(path); - account.confirmed += value; - this.wallet.confirmed += value; - } - } - - /** - * Credit (wrapped coin) - * @alias module:wallet.Credit - * @property {Coin} coin - * @property {Boolean} spent - */ - - class Credit { - /** - * Create a credit. - * @constructor - * @param {Coin} coin - * @param {Boolean?} spent - */ - - constructor(coin, spent) { - this.coin = coin || new Coin$1(); - this.spent = spent || false; - this.own = false; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$2.read(data); - this.coin.fromReader(br); - this.spent = br.readU8() === 1; - this.own = br.readU8() === 1; - return this; - } - - /** - * Instantiate credit from serialized data. - * @param {Buffer} data - * @returns {Credit} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - return this.coin.getSize() + 2; - } - - /** - * Serialize credit. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$2.write(size); - this.coin.toWriter(bw); - bw.writeU8(this.spent ? 1 : 0); - bw.writeU8(this.own ? 1 : 0); - return bw.render(); - } - - /** - * Inject properties from tx object. - * @private - * @param {TX} tx - * @param {Number} index - * @returns {Credit} - */ - - fromTX(tx, index, height) { - this.coin.fromTX(tx, index, height); - this.spent = false; - this.own = false; - return this; - } - - /** - * Instantiate credit from transaction. - * @param {TX} tx - * @param {Number} index - * @returns {Credit} - */ - - static fromTX(tx, index, height) { - return new this().fromTX(tx, index, height); - } - } - - /** - * Transaction Details - * @alias module:wallet.Details - */ - - class Details { - /** - * Create transaction details. - * @constructor - * @param {TXRecord} wtx - * @param {BlockMeta} block - */ - - constructor(wtx, block) { - this.hash = wtx.hash; - this.tx = wtx.tx; - this.mtime = wtx.mtime; - this.size = this.tx.getSize(); - this.vsize = this.tx.getVirtualSize(); - - this.block = null; - this.height = -1; - this.time = 0; - - if (block) { - this.block = block.hash; - this.height = block.height; - this.time = block.time; - } - - this.inputs = []; - this.outputs = []; - - this.init(); - } - - /** - * Initialize transaction details. - * @private - */ - - init() { - for (const input of this.tx.inputs) { - const member = new DetailsMember(); - member.address = input.getAddress(); - this.inputs.push(member); - } - - for (const output of this.tx.outputs) { - const member = new DetailsMember(); - member.value = output.value; - member.address = output.getAddress(); - this.outputs.push(member); - } - } - - /** - * Add necessary info to input member. - * @param {Number} i - * @param {Path} path - * @param {Coin} coin - */ - - setInput(i, path, coin) { - const member = this.inputs[i]; - - if (coin) { - member.value = coin.value; - member.address = coin.getAddress(); - } - - if (path) - member.path = path; - } - - /** - * Add necessary info to output member. - * @param {Number} i - * @param {Path} path - */ - - setOutput(i, path) { - const member = this.outputs[i]; - - if (path) - member.path = path; - } - - /** - * Calculate confirmations. - * @returns {Number} - */ - - getDepth(height) { - if (this.height === -1) - return 0; - - if (height == null) - return 0; - - const depth = height - this.height; - - if (depth < 0) - return 0; - - return depth + 1; - } - - /** - * Calculate fee. Only works if wallet - * owns all inputs. Returns 0 otherwise. - * @returns {Amount} - */ - - getFee() { - let inputValue = 0; - let outputValue = 0; - - for (const input of this.inputs) { - if (!input.path) - return 0; - - inputValue += input.value; - } - - for (const output of this.outputs) - outputValue += output.value; - - return inputValue - outputValue; - } - - /** - * Calculate fee rate. Only works if wallet - * owns all inputs. Returns 0 otherwise. - * @param {Amount} fee - * @returns {Rate} - */ - - getRate(fee) { - return policy$1.getRate(this.vsize, fee); - } - - /** - * Convert details to a more json-friendly object. - * @returns {Object} - */ - - toJSON(network, height) { - const fee = this.getFee(); - const rate = this.getRate(fee); - - return { - hash: util$1.revHex(this.hash), - height: this.height, - block: this.block ? util$1.revHex(this.block) : null, - time: this.time, - mtime: this.mtime, - date: util$1.date(this.time), - mdate: util$1.date(this.mtime), - size: this.size, - virtualSize: this.vsize, - fee: fee, - rate: rate, - confirmations: this.getDepth(height), - inputs: this.inputs.map((input) => { - return input.getJSON(network); - }), - outputs: this.outputs.map((output) => { - return output.getJSON(network); - }), - tx: this.tx.toRaw().toString('hex') - }; - } - } - - /** - * Transaction Details Member - * @property {Number} value - * @property {Address} address - * @property {Path} path - */ - - class DetailsMember { - /** - * Create details member. - * @constructor - */ - - constructor() { - this.value = 0; - this.address = null; - this.path = null; - } - - /** - * Convert the member to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return this.getJSON(); - } - - /** - * Convert the member to a more json-friendly object. - * @param {Network} network - * @returns {Object} - */ - - getJSON(network) { - return { - value: this.value, - address: this.address - ? this.address.toString(network) - : null, - path: this.path - ? this.path.toJSON() - : null - }; - } - } - - /** - * Block Record - * @alias module:wallet.BlockRecord - */ - - class BlockRecord { - /** - * Create a block record. - * @constructor - * @param {Hash} hash - * @param {Number} height - * @param {Number} time - */ - - constructor(hash, height, time) { - this.hash = hash || consensus$2.ZERO_HASH; - this.height = height != null ? height : -1; - this.time = time || 0; - this.hashes = new BufferSet$2(); - } - - /** - * Add transaction to block record. - * @param {Hash} hash - * @returns {Boolean} - */ - - add(hash) { - if (this.hashes.has(hash)) - return false; - - this.hashes.add(hash); - - return true; - } - - /** - * Remove transaction from block record. - * @param {Hash} hash - * @returns {Boolean} - */ - - remove(hash) { - return this.hashes.delete(hash); - } - - /** - * Instantiate wallet block from serialized tip data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$2.read(data); - - this.hash = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - - const count = br.readU32(); - - for (let i = 0; i < count; i++) { - const hash = br.readHash(); - this.hashes.add(hash); - } - - return this; - } - - /** - * Instantiate wallet block from serialized data. - * @param {Buffer} data - * @returns {BlockRecord} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - return 44 + this.hashes.size * 32; - } - - /** - * Serialize the wallet block as a tip (hash and height). - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$2.write(size); - - bw.writeHash(this.hash); - bw.writeU32(this.height); - bw.writeU32(this.time); - - bw.writeU32(this.hashes.size); - - for (const hash of this.hashes) - bw.writeHash(hash); - - return bw.render(); - } - - /** - * Convert hashes set to an array. - * @returns {Hash[]} - */ - - toArray() { - const hashes = []; - for (const hash of this.hashes) - hashes.push(hash); - return hashes; - } - - /** - * Convert the block to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - hash: util$1.revHex(this.hash), - height: this.height, - time: this.time, - hashes: this.toArray().map(util$1.revHex) - }; - } - - /** - * Instantiate wallet block from block meta. - * @private - * @param {BlockMeta} block - */ - - fromMeta(block) { - this.hash = block.hash; - this.height = block.height; - this.time = block.time; - return this; - } - - /** - * Instantiate wallet block from block meta. - * @param {BlockMeta} block - * @returns {BlockRecord} - */ - - static fromMeta(block) { - return new this().fromMeta(block); - } - } - - /* - * Expose - */ - - var txdb = TXDB$1; - - /*! - * wallet.js - wallet object for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$5 = assert_1$g; - const EventEmitter$2 = require$$1__default$1["default"]; - const {Lock: Lock$2} = bmutex; - const base58 = base58$9.exports; - const bio$1 = bufio; - const hash160 = hash160$9.exports; - const hash256 = hash256$k.exports; - const cleanse = cleanse$7.exports; - const TXDB = txdb; - const Path$1 = path$3; - const common$2 = common$5; - const Address$2 = address$1; - const MTX$2 = mtx$1.exports; - const Script$5 = script$2; - const WalletKey = walletkey; - const HD = hd$1; - const Output$1 = output; - const Account$1 = account; - const MasterKey = masterkey; - const policy = policy$9; - const consensus$1 = consensus$s; - const {encoding} = bio$1; - const {Mnemonic: Mnemonic$1} = HD; - const {inspectSymbol} = utils; - const {BufferSet: BufferSet$1} = bufferMap; - - /** - * Wallet - * @alias module:wallet.Wallet - * @extends EventEmitter - */ - - class Wallet$4 extends EventEmitter$2 { - /** - * Create a wallet. - * @constructor - * @param {Object} options - */ - - constructor(wdb, options) { - super(); - - assert$5(wdb, 'WDB required.'); - - this.wdb = wdb; - this.db = wdb.db; - this.network = wdb.network; - this.logger = wdb.logger; - this.writeLock = new Lock$2(); - this.fundLock = new Lock$2(); - - this.wid = 0; - this.id = null; - this.watchOnly = false; - this.accountDepth = 0; - this.token = consensus$1.ZERO_HASH; - this.tokenDepth = 0; - this.master = new MasterKey(); - - this.txdb = new TXDB(this.wdb); - - this.maxAncestors = policy.MEMPOOL_MAX_ANCESTORS; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - if (!options) - return this; - - let key = options.master; - let id, token, mnemonic; - - if (key) { - if (typeof key === 'string') - key = HD.PrivateKey.fromBase58(key, this.network); - - assert$5(HD.isPrivate(key), - 'Must create wallet with hd private key.'); - } else { - mnemonic = new Mnemonic$1(options.mnemonic); - key = HD.fromMnemonic(mnemonic, options.password); - } - - this.master.fromKey(key, mnemonic); - - if (options.wid != null) { - assert$5((options.wid >>> 0) === options.wid); - this.wid = options.wid; - } - - if (options.id) { - assert$5(common$2.isName(options.id), 'Bad wallet ID.'); - id = options.id; - } - - if (options.watchOnly != null) { - assert$5(typeof options.watchOnly === 'boolean'); - this.watchOnly = options.watchOnly; - } - - if (options.accountDepth != null) { - assert$5((options.accountDepth >>> 0) === options.accountDepth); - this.accountDepth = options.accountDepth; - } - - if (options.token) { - assert$5(Buffer.isBuffer(options.token)); - assert$5(options.token.length === 32); - token = options.token; - } - - if (options.tokenDepth != null) { - assert$5((options.tokenDepth >>> 0) === options.tokenDepth); - this.tokenDepth = options.tokenDepth; - } - - if (options.maxAncestors != null) { - assert$5((options.maxAncestors >>> 0) === options.maxAncestors); - this.maxAncestors = options.maxAncestors; - } - - if (!id) - id = this.getID(); - - if (!token) - token = this.getToken(this.tokenDepth); - - this.id = id; - this.token = token; - - return this; - } - - /** - * Instantiate wallet from options. - * @param {WalletDB} wdb - * @param {Object} options - * @returns {Wallet} - */ - - static fromOptions(wdb, options) { - return new this(wdb).fromOptions(options); - } - - /** - * Attempt to intialize the wallet (generating - * the first addresses along with the lookahead - * addresses). Called automatically from the - * walletdb. - * @returns {Promise} - */ - - async init(options, passphrase) { - if (passphrase) - await this.master.encrypt(passphrase); - - const account = await this._createAccount(options, passphrase); - assert$5(account); - - this.logger.info('Wallet initialized (%s).', this.id); - - return this.txdb.open(this); - } - - /** - * Open wallet (done after retrieval). - * @returns {Promise} - */ - - async open() { - const account = await this.getAccount(0); - - if (!account) - throw new Error('Default account not found.'); - - this.logger.info('Wallet opened (%s).', this.id); - - return this.txdb.open(this); - } - - /** - * Close the wallet, unregister with the database. - * @returns {Promise} - */ - - async destroy() { - const unlock1 = await this.writeLock.lock(); - const unlock2 = await this.fundLock.lock(); - try { - await this.master.destroy(); - this.writeLock.destroy(); - this.fundLock.destroy(); - } finally { - unlock2(); - unlock1(); - } - } - - /** - * Add a public account key to the wallet (multisig). - * Saves the key in the wallet database. - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async addSharedKey(acct, key) { - const unlock = await this.writeLock.lock(); - try { - return await this._addSharedKey(acct, key); - } finally { - unlock(); - } - } - - /** - * Add a public account key to the wallet without a lock. - * @private - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async _addSharedKey(acct, key) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const result = await account.addSharedKey(b, key); - await b.write(); - - return result; - } - - /** - * Remove a public account key from the wallet (multisig). - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async removeSharedKey(acct, key) { - const unlock = await this.writeLock.lock(); - try { - return await this._removeSharedKey(acct, key); - } finally { - unlock(); - } - } - - /** - * Remove a public account key from the wallet (multisig). - * @private - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async _removeSharedKey(acct, key) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const result = await account.removeSharedKey(b, key); - await b.write(); - - return result; - } - - /** - * Change or set master key's passphrase. - * @param {String|Buffer} passphrase - * @param {String|Buffer} old - * @returns {Promise} - */ - - async setPassphrase(passphrase, old) { - if (old != null) - await this.decrypt(old); - - await this.encrypt(passphrase); - } - - /** - * Encrypt the wallet permanently. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async encrypt(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._encrypt(passphrase); - } finally { - unlock(); - } - } - - /** - * Encrypt the wallet permanently, without a lock. - * @private - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async _encrypt(passphrase) { - const key = await this.master.encrypt(passphrase, true); - const b = this.db.batch(); - - try { - await this.wdb.encryptKeys(b, this.wid, key); - } finally { - cleanse(key); - } - - this.save(b); - - await b.write(); - } - - /** - * Decrypt the wallet permanently. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async decrypt(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._decrypt(passphrase); - } finally { - unlock(); - } - } - - /** - * Decrypt the wallet permanently, without a lock. - * @private - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async _decrypt(passphrase) { - const key = await this.master.decrypt(passphrase, true); - const b = this.db.batch(); - - try { - await this.wdb.decryptKeys(b, this.wid, key); - } finally { - cleanse(key); - } - - this.save(b); - - await b.write(); - } - - /** - * Generate a new token. - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async retoken(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._retoken(passphrase); - } finally { - unlock(); - } - } - - /** - * Generate a new token without a lock. - * @private - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _retoken(passphrase) { - if (passphrase) - await this.unlock(passphrase); - - this.tokenDepth += 1; - this.token = this.getToken(this.tokenDepth); - - const b = this.db.batch(); - this.save(b); - - await b.write(); - - return this.token; - } - - /** - * Rename the wallet. - * @param {String} id - * @returns {Promise} - */ - - async rename(id) { - const unlock = await this.writeLock.lock(); - try { - return await this.wdb.rename(this, id); - } finally { - unlock(); - } - } - - /** - * Rename account. - * @param {(String|Number)?} acct - * @param {String} name - * @returns {Promise} - */ - - async renameAccount(acct, name) { - const unlock = await this.writeLock.lock(); - try { - return await this._renameAccount(acct, name); - } finally { - unlock(); - } - } - - /** - * Rename account without a lock. - * @private - * @param {(String|Number)?} acct - * @param {String} name - * @returns {Promise} - */ - - async _renameAccount(acct, name) { - if (!common$2.isName(name)) - throw new Error('Bad account name.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.accountIndex === 0) - throw new Error('Cannot rename default account.'); - - if (await this.hasAccount(name)) - throw new Error('Account name not available.'); - - const b = this.db.batch(); - - this.wdb.renameAccount(b, account, name); - - await b.write(); - } - - /** - * Lock the wallet, destroy decrypted key. - */ - - async lock() { - const unlock1 = await this.writeLock.lock(); - const unlock2 = await this.fundLock.lock(); - try { - await this.master.lock(); - } finally { - unlock2(); - unlock1(); - } - } - - /** - * Unlock the key for `timeout` seconds. - * @param {Buffer|String} passphrase - * @param {Number?} [timeout=60] - */ - - unlock(passphrase, timeout) { - return this.master.unlock(passphrase, timeout); - } - - /** - * Generate the wallet ID if none was passed in. - * It is represented as HASH160(m/44->public|magic) - * converted to an "address" with a prefix - * of `0x03be04` (`WLT` in base58). - * @private - * @returns {Base58String} - */ - - getID() { - assert$5(this.master.key, 'Cannot derive id.'); - - const key = this.master.key.derive(44); - - const bw = bio$1.write(37); - bw.writeBytes(key.publicKey); - bw.writeU32(this.network.magic); - - const hash = hash160.digest(bw.render()); - - const b58 = bio$1.write(27); - b58.writeU8(0x03); - b58.writeU8(0xbe); - b58.writeU8(0x04); - b58.writeBytes(hash); - b58.writeChecksum(hash256.digest); - - return base58.encode(b58.render()); - } - - /** - * Generate the wallet api key if none was passed in. - * It is represented as HASH256(m/44'->private|nonce). - * @private - * @param {HDPrivateKey} master - * @param {Number} nonce - * @returns {Buffer} - */ - - getToken(nonce) { - if (!this.master.key) - throw new Error('Cannot derive token.'); - - const key = this.master.key.derive(44, true); - - const bw = bio$1.write(36); - bw.writeBytes(key.privateKey); - bw.writeU32(nonce); - - return hash256.digest(bw.render()); - } - - /** - * Create an account. Requires passphrase if master key is encrypted. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async createAccount(options, passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._createAccount(options, passphrase); - } finally { - unlock(); - } - } - - /** - * Create an account without a lock. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async _createAccount(options, passphrase) { - let name = options.name; - - if (!name) - name = this.accountDepth.toString(10); - - if (await this.hasAccount(name)) - throw new Error('Account already exists.'); - - await this.unlock(passphrase); - - let key; - if (this.watchOnly) { - key = options.accountKey; - - if (typeof key === 'string') - key = HD.PublicKey.fromBase58(key, this.network); - - if (!HD.isPublic(key)) - throw new Error('Must add HD public keys to watch only wallet.'); - } else { - assert$5(this.master.key); - const type = this.network.keyPrefix.coinType; - key = this.master.key.deriveAccount(44, type, this.accountDepth); - key = key.toPublic(); - } - - const opt = { - wid: this.wid, - id: this.id, - name: this.accountDepth === 0 ? 'default' : name, - witness: options.witness, - watchOnly: this.watchOnly, - accountKey: key, - accountIndex: this.accountDepth, - type: options.type, - m: options.m, - n: options.n, - keys: options.keys - }; - - const b = this.db.batch(); - - const account = Account$1.fromOptions(this.wdb, opt); - - await account.init(b); - - this.logger.info('Created account %s/%s/%d.', - account.id, - account.name, - account.accountIndex); - - this.accountDepth += 1; - this.save(b); - - if (this.accountDepth === 1) - this.increment(b); - - await b.write(); - - return account; - } - - /** - * Ensure an account. Requires passphrase if master key is encrypted. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async ensureAccount(options, passphrase) { - const name = options.name; - const account = await this.getAccount(name); - - if (account) - return account; - - return this.createAccount(options, passphrase); - } - - /** - * List account names and indexes from the db. - * @returns {Promise} - Returns Array. - */ - - getAccounts() { - return this.wdb.getAccounts(this.wid); - } - - /** - * Get all wallet address hashes. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns Array. - */ - - getAddressHashes(acct) { - if (acct != null) - return this.getAccountHashes(acct); - return this.wdb.getWalletHashes(this.wid); - } - - /** - * Get all account address hashes. - * @param {String|Number} acct - * @returns {Promise} - Returns Array. - */ - - async getAccountHashes(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - return this.wdb.getAccountHashes(this.wid, index); - } - - /** - * Retrieve an account from the database. - * @param {Number|String} acct - * @returns {Promise} - Returns {@link Account}. - */ - - async getAccount(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - return null; - - const account = await this.wdb.getAccount(this.wid, index); - - if (!account) - return null; - - account.wid = this.wid; - account.id = this.id; - account.watchOnly = this.watchOnly; - - return account; - } - - /** - * Lookup the corresponding account name's index. - * @param {String|Number} acct - Account name/index. - * @returns {Promise} - Returns Number. - */ - - getAccountIndex(acct) { - if (acct == null) - return -1; - - if (typeof acct === 'number') - return acct; - - return this.wdb.getAccountIndex(this.wid, acct); - } - - /** - * Lookup the corresponding account name's index. - * @param {String|Number} acct - Account name/index. - * @returns {Promise} - Returns Number. - * @throws on non-existent account - */ - - async ensureIndex(acct) { - if (acct == null || acct === -1) - return -1; - - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - return index; - } - - /** - * Lookup the corresponding account index's name. - * @param {Number} index - Account index. - * @returns {Promise} - Returns String. - */ - - async getAccountName(index) { - if (typeof index === 'string') - return index; - - return this.wdb.getAccountName(this.wid, index); - } - - /** - * Test whether an account exists. - * @param {Number|String} acct - * @returns {Promise} - Returns {@link Boolean}. - */ - - async hasAccount(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - return false; - - return this.wdb.hasAccount(this.wid, index); - } - - /** - * Create a new receiving address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createReceive(acct = 0) { - return this.createKey(acct, 0); - } - - /** - * Create a new change address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createChange(acct = 0) { - return this.createKey(acct, 1); - } - - /** - * Create a new nested address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createNested(acct = 0) { - return this.createKey(acct, 2); - } - - /** - * Create a new address (increments depth). - * @param {(Number|String)?} acct - * @param {Number} branch - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async createKey(acct, branch) { - const unlock = await this.writeLock.lock(); - try { - return await this._createKey(acct, branch); - } finally { - unlock(); - } - } - - /** - * Create a new address (increments depth) without a lock. - * @private - * @param {(Number|String)?} acct - * @param {Number} branch - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async _createKey(acct, branch) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const key = await account.createKey(b, branch); - await b.write(); - - return key; - } - - /** - * Save the wallet to the database. Necessary - * when address depth and keys change. - * @returns {Promise} - */ - - save(b) { - return this.wdb.save(b, this); - } - - /** - * Increment the wid depth. - * @returns {Promise} - */ - - increment(b) { - return this.wdb.increment(b, this.wid); - } - - /** - * Test whether the wallet possesses an address. - * @param {Address|Hash} address - * @returns {Promise} - Returns Boolean. - */ - - async hasAddress(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - return path != null; - } - - /** - * Get path by address hash. - * @param {Address|Hash} address - * @returns {Promise} - Returns {@link Path}. - */ - - async getPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.getPath(this.wid, hash); - } - - /** - * Get path by address hash (without account name). - * @private - * @param {Address|Hash} address - * @returns {Promise} - Returns {@link Path}. - */ - - async readPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.readPath(this.wid, hash); - } - - /** - * Test whether the wallet contains a path. - * @param {Address|Hash} address - * @returns {Promise} - Returns {Boolean}. - */ - - async hasPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Get all wallet paths. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link Path}. - */ - - async getPaths(acct) { - if (acct != null) - return this.getAccountPaths(acct); - - return this.wdb.getWalletPaths(this.wid); - } - - /** - * Get all account paths. - * @param {String|Number} acct - * @returns {Promise} - Returns {@link Path}. - */ - - async getAccountPaths(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - const hashes = await this.getAccountHashes(index); - const name = await this.getAccountName(acct); - - assert$5(name); - - const result = []; - - for (const hash of hashes) { - const path = await this.readPath(hash); - - assert$5(path); - assert$5(path.account === index); - - path.name = name; - - result.push(path); - } - - return result; - } - - /** - * Import a keyring (will not exist on derivation chain). - * Rescanning must be invoked manually. - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async importKey(acct, ring, passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._importKey(acct, ring, passphrase); - } finally { - unlock(); - } - } - - /** - * Import a keyring (will not exist on derivation chain) without a lock. - * @private - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _importKey(acct, ring, passphrase) { - if (!this.watchOnly) { - if (!ring.privateKey) - throw new Error('Cannot import pubkey into non watch-only wallet.'); - } else { - if (ring.privateKey) - throw new Error('Cannot import privkey into watch-only wallet.'); - } - - const hash = ring.getHash(); - - if (await this.getPath(hash)) - throw new Error('Key already exists.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.type !== Account$1.types.PUBKEYHASH) - throw new Error('Cannot import into non-pkh account.'); - - await this.unlock(passphrase); - - const key = WalletKey.fromRing(account, ring); - const path = key.toPath(); - - if (this.master.encrypted) { - path.data = this.master.encipher(path.data, path.hash); - assert$5(path.data); - path.encrypted = true; - } - - const b = this.db.batch(); - await account.savePath(b, path); - await b.write(); - } - - /** - * Import a keyring (will not exist on derivation chain). - * Rescanning must be invoked manually. - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async importAddress(acct, address) { - const unlock = await this.writeLock.lock(); - try { - return await this._importAddress(acct, address); - } finally { - unlock(); - } - } - - /** - * Import a keyring (will not exist on derivation chain) without a lock. - * @private - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _importAddress(acct, address) { - if (!this.watchOnly) - throw new Error('Cannot import address into non watch-only wallet.'); - - if (await this.getPath(address)) - throw new Error('Address already exists.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.type !== Account$1.types.PUBKEYHASH) - throw new Error('Cannot import into non-pkh account.'); - - const path = Path$1.fromAddress(account, address); - - const b = this.db.batch(); - await account.savePath(b, path); - await b.write(); - } - - /** - * Fill a transaction with inputs, estimate - * transaction size, calculate fee, and add a change output. - * @see MTX#selectCoins - * @see MTX#fill - * @param {MTX} mtx - _Must_ be a mutable transaction. - * @param {Object?} options - * @param {(String|Number)?} options.account - If no account is - * specified, coins from the entire wallet will be filled. - * @param {String?} options.selection - Coin selection priority. Can - * be `age`, `random`, or `all`. (default=age). - * @param {Boolean} options.round - Whether to round to the nearest - * kilobyte for fee calculation. - * See {@link TX#getMinFee} vs. {@link TX#getRoundFee}. - * @param {Rate} options.rate - Rate used for fee calculation. - * @param {Boolean} options.confirmed - Select only confirmed coins. - * @param {Boolean} options.free - Do not apply a fee if the - * transaction priority is high enough to be considered free. - * @param {Amount?} options.hardFee - Use a hard fee rather than - * calculating one. - * @param {Number|Boolean} options.subtractFee - Whether to subtract the - * fee from existing outputs rather than adding more inputs. - */ - - async fund(mtx, options, force) { - const unlock = await this.fundLock.lock(force); - try { - return await this._fund(mtx, options); - } finally { - unlock(); - } - } - - /** - * Fill a transaction with inputs without a lock. - * @private - * @see MTX#selectCoins - * @see MTX#fill - */ - - async _fund(mtx, options) { - if (!options) - options = {}; - - const acct = options.account || 0; - const change = await this.changeAddress(acct); - - if (!change) - throw new Error('Account not found.'); - - let rate = options.rate; - if (rate == null) - rate = await this.wdb.estimateFee(options.blocks); - - let coins; - if (options.smart) { - coins = await this.getSmartCoins(options.account); - } else { - coins = await this.getCoins(options.account); - coins = this.txdb.filterLocked(coins); - } - - await mtx.fund(coins, { - selection: options.selection, - round: options.round, - depth: options.depth, - hardFee: options.hardFee, - subtractFee: options.subtractFee, - subtractIndex: options.subtractIndex, - changeAddress: change, - height: this.wdb.state.height, - rate: rate, - maxFee: options.maxFee, - estimate: prev => this.estimateSize(prev) - }); - - assert$5(mtx.getFee() <= MTX$2.Selector.MAX_FEE, 'TX exceeds MAX_FEE.'); - } - - /** - * Get account by address. - * @param {Address} address - * @returns {Account} - */ - - async getAccountByAddress(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - return this.getAccount(path.account); - } - - /** - * Input size estimator for max possible tx size. - * @param {Script} prev - * @returns {Number} - */ - - async estimateSize(prev) { - const scale = consensus$1.WITNESS_SCALE_FACTOR; - const address = prev.getAddress(); - - if (!address) - return -1; - - const account = await this.getAccountByAddress(address); - - if (!account) - return -1; - - let size = 0; - - if (prev.isScripthash()) { - // Nested bullshit. - if (account.witness) { - switch (account.type) { - case Account$1.types.PUBKEYHASH: - size += 23; // redeem script - size *= 4; // vsize - break; - case Account$1.types.MULTISIG: - size += 35; // redeem script - size *= 4; // vsize - break; - } - } - } - - switch (account.type) { - case Account$1.types.PUBKEYHASH: - // P2PKH - // OP_PUSHDATA0 [signature] - size += 1 + 73; - // OP_PUSHDATA0 [key] - size += 1 + 33; - break; - case Account$1.types.MULTISIG: - // P2SH Multisig - // OP_0 - size += 1; - // OP_PUSHDATA0 [signature] ... - size += (1 + 73) * account.m; - // OP_PUSHDATA2 [redeem] - size += 3; - // m value - size += 1; - // OP_PUSHDATA0 [key] ... - size += (1 + 33) * account.n; - // n value - size += 1; - // OP_CHECKMULTISIG - size += 1; - break; - } - - if (account.witness) { - // Varint witness items length. - size += 1; - // Calculate vsize if - // we're a witness program. - size = (size + scale - 1) / scale | 0; - } else { - // Byte for varint - // size of input script. - size += encoding.sizeVarint(size); - } - - return size; - } - - /** - * Build a transaction, fill it with outputs and inputs, - * sort the members according to BIP69 (set options.sort=false - * to avoid sorting), set locktime, and template it. - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @param {Boolean} options.sort - Sort inputs and outputs (BIP69). - * @param {Boolean} options.template - Build scripts for inputs. - * @param {Number} options.locktime - TX locktime - * @returns {Promise} - Returns {@link MTX}. - */ - - async createTX(options, force) { - const outputs = options.outputs; - const mtx = new MTX$2(); - - assert$5(Array.isArray(outputs), 'Outputs must be an array.'); - assert$5(outputs.length > 0, 'At least one output required.'); - - // Add the outputs - for (const obj of outputs) { - const output = new Output$1(obj); - const addr = output.getAddress(); - - if (output.isDust()) - throw new Error('Output is dust.'); - - if (output.value > 0) { - if (!addr) - throw new Error('Cannot send to unknown address.'); - - if (addr.isNull()) - throw new Error('Cannot send to null address.'); - } - - mtx.outputs.push(output); - } - - // Fill the inputs with unspents - await this.fund(mtx, options, force); - - // Sort members a la BIP69 - if (options.sort !== false) - mtx.sortMembers(); - - // Set the locktime to target value. - if (options.locktime != null) - mtx.setLocktime(options.locktime); - - // Consensus sanity checks. - assert$5(mtx.isSane(), 'TX failed sanity check.'); - assert$5(mtx.verifyInputs(this.wdb.state.height + 1), - 'TX failed context check.'); - - if (options.template === false) - return mtx; - - const total = await this.template(mtx); - - if (total === 0) - throw new Error('Templating failed.'); - - return mtx; - } - - /** - * Build a transaction, fill it with outputs and inputs, - * sort the members according to BIP69, set locktime, - * sign and broadcast. Doing this all in one go prevents - * coins from being double spent. - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @returns {Promise} - Returns {@link TX}. - */ - - async send(options, passphrase) { - const unlock = await this.fundLock.lock(); - try { - return await this._send(options, passphrase); - } finally { - unlock(); - } - } - - /** - * Build and send a transaction without a lock. - * @private - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @returns {Promise} - Returns {@link TX}. - */ - - async _send(options, passphrase) { - const mtx = await this.createTX(options, true); - - await this.sign(mtx, passphrase); - - if (!mtx.isSigned()) - throw new Error('TX could not be fully signed.'); - - const tx = mtx.toTX(); - - // Policy sanity checks. - if (tx.getSigopsCost(mtx.view) > policy.MAX_TX_SIGOPS_COST) - throw new Error('TX exceeds policy sigops.'); - - if (tx.getWeight() > policy.MAX_TX_WEIGHT) - throw new Error('TX exceeds policy weight.'); - - const ancestors = await this.getPendingAncestors(tx); - if (ancestors.size + 1 > this.maxAncestors) - throw new Error('TX exceeds maximum unconfirmed ancestors.'); - - await this.wdb.addTX(tx); - - this.logger.debug('Sending wallet tx (%s): %h', this.id, tx.hash()); - - await this.wdb.send(tx); - - return tx; - } - - /** - * Intentionally double-spend outputs by - * increasing fee for an existing transaction. - * @param {Hash} hash - * @param {Rate} rate - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - Returns {@link TX}. - */ - - async increaseFee(hash, rate, passphrase) { - assert$5((rate >>> 0) === rate, 'Rate must be a number.'); - - const wtx = await this.getTX(hash); - - if (!wtx) - throw new Error('Transaction not found.'); - - if (wtx.height !== -1) - throw new Error('Transaction is confirmed.'); - - const tx = wtx.tx; - - if (tx.isCoinbase()) - throw new Error('Transaction is a coinbase.'); - - const view = await this.getSpentView(tx); - - if (!tx.hasCoins(view)) - throw new Error('Not all coins available.'); - - const oldFee = tx.getFee(view); - - let fee = tx.getMinFee(null, rate); - - if (fee > MTX$2.Selector.MAX_FEE) - fee = MTX$2.Selector.MAX_FEE; - - if (oldFee >= fee) - throw new Error('Fee is not increasing.'); - - const mtx = MTX$2.fromTX(tx); - mtx.view = view; - - for (const input of mtx.inputs) { - input.script.clear(); - input.witness.clear(); - } - - let change; - for (let i = 0; i < mtx.outputs.length; i++) { - const output = mtx.outputs[i]; - const addr = output.getAddress(); - - if (!addr) - continue; - - const path = await this.getPath(addr); - - if (!path) - continue; - - if (path.branch === 1) { - change = output; - mtx.changeIndex = i; - break; - } - } - - if (!change) - throw new Error('No change output.'); - - change.value += oldFee; - - if (mtx.getFee() !== 0) - throw new Error('Arithmetic error for change.'); - - change.value -= fee; - - if (change.value < 0) - throw new Error('Fee is too high.'); - - if (change.isDust()) { - mtx.outputs.splice(mtx.changeIndex, 1); - mtx.changeIndex = -1; - } - - await this.sign(mtx, passphrase); - - if (!mtx.isSigned()) - throw new Error('TX could not be fully signed.'); - - const ntx = mtx.toTX(); - - this.logger.debug( - 'Increasing fee for wallet tx (%s): %h', - this.id, ntx.hash()); - - await this.wdb.addTX(ntx); - await this.wdb.send(ntx); - - return ntx; - } - - /** - * Resend pending wallet transactions. - * @returns {Promise} - */ - - async resend() { - const wtxs = await this.getPending(); - - if (wtxs.length > 0) - this.logger.info('Rebroadcasting %d transactions.', wtxs.length); - - const txs = []; - - for (const wtx of wtxs) - txs.push(wtx.tx); - - const sorted = common$2.sortDeps(txs); - - for (const tx of sorted) - await this.wdb.send(tx); - - return txs; - } - - /** - * Derive necessary addresses for signing a transaction. - * @param {MTX} mtx - * @param {Number?} index - Input index. - * @returns {Promise} - Returns {@link WalletKey}[]. - */ - - async deriveInputs(mtx) { - assert$5(mtx.mutable); - - const paths = await this.getInputPaths(mtx); - const rings = []; - - for (const path of paths) { - const account = await this.getAccount(path.account); - - if (!account) - continue; - - const ring = account.derivePath(path, this.master); - - if (ring) - rings.push(ring); - } - - return rings; - } - - /** - * Retrieve a single keyring by address. - * @param {Address|Hash} hash - * @returns {Promise} - */ - - async getKey(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - const account = await this.getAccount(path.account); - - if (!account) - return null; - - return account.derivePath(path, this.master); - } - - /** - * Retrieve a single keyring by address - * (with the private key reference). - * @param {Address|Hash} hash - * @param {(Buffer|String)?} passphrase - * @returns {Promise} - */ - - async getPrivateKey(address, passphrase) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - const account = await this.getAccount(path.account); - - if (!account) - return null; - - await this.unlock(passphrase); - - const key = account.derivePath(path, this.master); - - if (!key.privateKey) - return null; - - return key; - } - - /** - * Map input addresses to paths. - * @param {MTX} mtx - * @returns {Promise} - Returns {@link Path}[]. - */ - - async getInputPaths(mtx) { - assert$5(mtx.mutable); - - if (!mtx.hasCoins()) - throw new Error('Not all coins available.'); - - const hashes = mtx.getInputHashes(); - const paths = []; - - for (const hash of hashes) { - const path = await this.getPath(hash); - if (path) - paths.push(path); - } - - return paths; - } - - /** - * Map output addresses to paths. - * @param {TX} tx - * @returns {Promise} - Returns {@link Path}[]. - */ - - async getOutputPaths(tx) { - const paths = []; - const hashes = tx.getOutputHashes(); - - for (const hash of hashes) { - const path = await this.getPath(hash); - if (path) - paths.push(path); - } - - return paths; - } - - /** - * Increase lookahead for account. - * @param {(Number|String)?} account - * @param {Number} lookahead - * @returns {Promise} - */ - - async setLookahead(acct, lookahead) { - const unlock = await this.writeLock.lock(); - try { - return this._setLookahead(acct, lookahead); - } finally { - unlock(); - } - } - - /** - * Increase lookahead for account (without a lock). - * @private - * @param {(Number|String)?} account - * @param {Number} lookahead - * @returns {Promise} - */ - - async _setLookahead(acct, lookahead) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - await account.setLookahead(b, lookahead); - await b.write(); - } - - /** - * Sync address depths based on a transaction's outputs. - * This is used for deriving new addresses when - * a confirmed transaction is seen. - * @param {TX} tx - * @returns {Promise} - */ - - async syncOutputDepth(tx) { - const map = new Map(); - - for (const hash of tx.getOutputHashes()) { - const path = await this.readPath(hash); - - if (!path) - continue; - - if (path.index === -1) - continue; - - if (!map.has(path.account)) - map.set(path.account, []); - - map.get(path.account).push(path); - } - - const derived = []; - const b = this.db.batch(); - - for (const [acct, paths] of map) { - let receive = -1; - let change = -1; - let nested = -1; - - for (const path of paths) { - switch (path.branch) { - case 0: - if (path.index > receive) - receive = path.index; - break; - case 1: - if (path.index > change) - change = path.index; - break; - case 2: - if (path.index > nested) - nested = path.index; - break; - } - } - - receive += 2; - change += 2; - nested += 2; - - const account = await this.getAccount(acct); - assert$5(account); - - const ring = await account.syncDepth(b, receive, change, nested); - - if (ring) - derived.push(ring); - } - - await b.write(); - - return derived; - } - - /** - * Build input scripts templates for a transaction (does not - * sign, only creates signature slots). Only builds scripts - * for inputs that are redeemable by this wallet. - * @param {MTX} mtx - * @returns {Promise} - Returns Number - * (total number of scripts built). - */ - - async template(mtx) { - const rings = await this.deriveInputs(mtx); - return mtx.template(rings); - } - - /** - * Build input scripts and sign inputs for a transaction. Only attempts - * to build/sign inputs that are redeemable by this wallet. - * @param {MTX} tx - * @param {Object|String|Buffer} options - Options or passphrase. - * @returns {Promise} - Returns Number (total number - * of inputs scripts built and signed). - */ - - async sign(mtx, passphrase) { - if (this.watchOnly) - throw new Error('Cannot sign from a watch-only wallet.'); - - await this.unlock(passphrase); - - const rings = await this.deriveInputs(mtx); - - return mtx.signAsync(rings, Script$5.hashType.ALL, this.wdb.workers); - } - - /** - * Get pending ancestors up to the policy limit - * @param {TX} tx - * @returns {Promise} - Returns {BufferSet} with Hash - */ - - async getPendingAncestors(tx) { - return this._getPendingAncestors(tx, new BufferSet$1()); - } - - /** - * Get pending ancestors up to the policy limit. - * @param {TX} tx - * @param {Object} set - * @returns {Promise} - Returns {BufferSet} with Hash - */ - - async _getPendingAncestors(tx, set) { - for (const {prevout} of tx.inputs) { - const hash = prevout.hash; - - if (set.has(hash)) - continue; - - if (!await this.hasPending(hash)) - continue; - - set.add(hash); - - if (set.size > this.maxAncestors) - break; - - const parent = await this.getTX(hash); - await this._getPendingAncestors(parent.tx, set); - - if (set.size > this.maxAncestors) - break; - } - - return set; - } - - /** - * Test whether the database has a pending transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - hasPending(hash) { - return this.txdb.hasPending(hash); - } - - /** - * Get a coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - getCoinView(tx) { - return this.txdb.getCoinView(tx); - } - - /** - * Get a historical coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - getSpentView(tx) { - return this.txdb.getSpentView(tx); - } - - /** - * Convert transaction to transaction details. - * @param {TXRecord} wtx - * @returns {Promise} - Returns {@link Details}. - */ - - toDetails(wtx) { - return this.txdb.toDetails(wtx); - } - - /** - * Get transaction details. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Details}. - */ - - getDetails(hash) { - return this.txdb.getDetails(hash); - } - - /** - * Get a coin from the wallet. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - getCoin(hash, index) { - return this.txdb.getCoin(hash, index); - } - - /** - * Get a transaction from the wallet. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - getTX(hash) { - return this.txdb.getTX(hash); - } - - /** - * List blocks for the wallet. - * @returns {Promise} - Returns {@link BlockRecord}. - */ - - getBlocks() { - return this.txdb.getBlocks(); - } - - /** - * Get a block from the wallet. - * @param {Number} height - * @returns {Promise} - Returns {@link BlockRecord}. - */ - - getBlock(height) { - return this.txdb.getBlock(height); - } - - /** - * Add a transaction to the wallets TX history. - * @param {TX} tx - * @returns {Promise} - */ - - async add(tx, block) { - const unlock = await this.writeLock.lock(); - try { - return await this._add(tx, block); - } finally { - unlock(); - } - } - - /** - * Add a transaction to the wallet without a lock. - * Potentially resolves orphans. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async _add(tx, block) { - const details = await this.txdb.add(tx, block); - - if (details) { - const derived = await this.syncOutputDepth(tx); - if (derived.length > 0) { - this.wdb.emit('address', this, derived); - this.emit('address', derived); - } - } - - return details; - } - - /** - * Revert a block. - * @param {Number} height - * @returns {Promise} - */ - - async revert(height) { - const unlock = await this.writeLock.lock(); - try { - return await this.txdb.revert(height); - } finally { - unlock(); - } - } - - /** - * Remove a wallet transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async remove(hash) { - const unlock = await this.writeLock.lock(); - try { - return await this.txdb.remove(hash); - } finally { - unlock(); - } - } - - /** - * Zap stale TXs from wallet. - * @param {(Number|String)?} acct - * @param {Number} age - Age threshold (unix time). - * @returns {Promise} - */ - - async zap(acct, age) { - const unlock = await this.writeLock.lock(); - try { - return await this._zap(acct, age); - } finally { - unlock(); - } - } - - /** - * Zap stale TXs from wallet without a lock. - * @private - * @param {(Number|String)?} acct - * @param {Number} age - * @returns {Promise} - */ - - async _zap(acct, age) { - const account = await this.ensureIndex(acct); - return this.txdb.zap(account, age); - } - - /** - * Abandon transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async abandon(hash) { - const unlock = await this.writeLock.lock(); - try { - return await this._abandon(hash); - } finally { - unlock(); - } - } - - /** - * Abandon transaction without a lock. - * @private - * @param {Hash} hash - * @returns {Promise} - */ - - _abandon(hash) { - return this.txdb.abandon(hash); - } - - /** - * Lock a single coin. - * @param {Coin|Outpoint} coin - */ - - lockCoin(coin) { - return this.txdb.lockCoin(coin); - } - - /** - * Unlock a single coin. - * @param {Coin|Outpoint} coin - */ - - unlockCoin(coin) { - return this.txdb.unlockCoin(coin); - } - - /** - * Unlock all locked coins. - */ - - unlockCoins() { - return this.txdb.unlockCoins(); - } - - /** - * Test locked status of a single coin. - * @param {Coin|Outpoint} coin - */ - - isLocked(coin) { - return this.txdb.isLocked(coin); - } - - /** - * Return an array of all locked outpoints. - * @returns {Outpoint[]} - */ - - getLocked() { - return this.txdb.getLocked(); - } - - /** - * Get all transactions in transaction history. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getHistory(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getHistory(account); - } - - /** - * Get all available coins. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getCoins(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getCoins(account); - } - - /** - * Get all available credits. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Credit}[]. - */ - - async getCredits(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getCredits(account); - } - - /** - * Get "smart" coins. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getSmartCoins(acct) { - const credits = await this.getCredits(acct); - const coins = []; - - for (const credit of credits) { - const coin = credit.coin; - - if (credit.spent) - continue; - - if (this.txdb.isLocked(coin)) - continue; - - // Always use confirmed coins. - if (coin.height !== -1) { - coins.push(coin); - continue; - } - - // Use unconfirmed only if they were - // created as a result of one of our - // _own_ transactions. i.e. they're - // not low-fee and not in danger of - // being double-spent by a bad actor. - if (!credit.own) - continue; - - coins.push(coin); - } - - return coins; - } - - /** - * Get all pending/unconfirmed transactions. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getPending(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getPending(account); - } - - /** - * Get wallet balance. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link Balance}. - */ - - async getBalance(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getBalance(account); - } - - /** - * Get a range of transactions between two timestamps. - * @param {(String|Number)?} acct - * @param {Object} options - * @param {Number} options.start - * @param {Number} options.end - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getRange(acct, options) { - const account = await this.ensureIndex(acct); - return this.txdb.getRange(account, options); - } - - /** - * Get the last N transactions. - * @param {(String|Number)?} acct - * @param {Number} limit - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getLast(acct, limit) { - const account = await this.ensureIndex(acct); - return this.txdb.getLast(account, limit); - } - - /** - * Get account key. - * @param {Number} [acct=0] - * @returns {HDPublicKey} - */ - - async accountKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.accountKey; - } - - /** - * Get current receive depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async receiveDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveDepth; - } - - /** - * Get current change depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async changeDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeDepth; - } - - /** - * Get current nested depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async nestedDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedDepth; - } - - /** - * Get current receive address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async receiveAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveAddress(); - } - - /** - * Get current change address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async changeAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeAddress(); - } - - /** - * Get current nested address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async nestedAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedAddress(); - } - - /** - * Get current receive key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async receiveKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveKey(); - } - - /** - * Get current change key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async changeKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeKey(); - } - - /** - * Get current nested key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async nestedKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedKey(); - } - - /** - * Convert the wallet to a more inspection-friendly object. - * @returns {Object} - */ - - [inspectSymbol]() { - return { - wid: this.wid, - id: this.id, - network: this.network.type, - accountDepth: this.accountDepth, - token: this.token.toString('hex'), - tokenDepth: this.tokenDepth, - master: this.master - }; - } - - /** - * Convert the wallet to an object suitable for - * serialization. - * @param {Boolean?} unsafe - Whether to include - * the master key in the JSON. - * @returns {Object} - */ - - toJSON(unsafe, balance) { - return { - network: this.network.type, - wid: this.wid, - id: this.id, - watchOnly: this.watchOnly, - accountDepth: this.accountDepth, - token: this.token.toString('hex'), - tokenDepth: this.tokenDepth, - master: this.master.toJSON(this.network, unsafe), - balance: balance ? balance.toJSON(true) : null - }; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 41; - size += this.master.getSize(); - return size; - } - - /** - * Serialize the wallet. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$1.write(size); - - let flags = 0; - - if (this.watchOnly) - flags |= 1; - - bw.writeU8(flags); - bw.writeU32(this.accountDepth); - bw.writeBytes(this.token); - bw.writeU32(this.tokenDepth); - this.master.toWriter(bw); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$1.read(data); - - const flags = br.readU8(); - - this.watchOnly = (flags & 1) !== 0; - this.accountDepth = br.readU32(); - this.token = br.readBytes(32); - this.tokenDepth = br.readU32(); - this.master.fromReader(br); - - return this; - } - - /** - * Instantiate a wallet from serialized data. - * @param {Buffer} data - * @returns {Wallet} - */ - - static fromRaw(wdb, data) { - return new this(wdb).fromRaw(data); - } - - /** - * Test an object to see if it is a Wallet. - * @param {Object} obj - * @returns {Boolean} - */ - - static isWallet(obj) { - return obj instanceof Wallet$4; - } - } - - /* - * Expose - */ - - var wallet$1 = Wallet$4; - - /*! - * nullclient.js - node client for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$4 = assert_1$g; - const EventEmitter$1 = require$$1__default$1["default"]; - - /** - * Null Client - * Sort of a fake local client for separation of concerns. - * @alias module:node.NullClient - */ - - class NullClient$1 extends EventEmitter$1 { - /** - * Create a client. - * @constructor - */ - - constructor(wdb) { - super(); - - this.wdb = wdb; - this.network = wdb.network; - this.opened = false; - } - - /** - * Open the client. - * @returns {Promise} - */ - - async open(options) { - assert$4(!this.opened, 'NullClient is already open.'); - this.opened = true; - setImmediate(() => this.emit('connect')); - } - - /** - * Close the client. - * @returns {Promise} - */ - - async close() { - assert$4(this.opened, 'NullClient is not open.'); - this.opened = false; - setImmediate(() => this.emit('disconnect')); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - bind(type, handler) { - return this.on(type, handler); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - hook(type, handler) { - return this.on(type, handler); - } - - /** - * Get chain tip. - * @returns {Promise} - */ - - async getTip() { - const {hash, height, time} = this.network.genesis; - return { hash, height, time }; - } - - /** - * Get chain entry. - * @param {Hash} hash - * @returns {Promise} - */ - - async getEntry(hash) { - return { hash, height: 0, time: 0 }; - } - - /** - * Send a transaction. Do not wait for promise. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - this.wdb.emit('send', tx); - } - - /** - * Set bloom filter. - * @param {Bloom} filter - * @returns {Promise} - */ - - async setFilter(filter) { - this.wdb.emit('set filter', filter); - } - - /** - * Add data to filter. - * @param {Buffer} data - * @returns {Promise} - */ - - async addFilter(data) { - this.wdb.emit('add filter', data); - } - - /** - * Reset filter. - * @returns {Promise} - */ - - async resetFilter() { - this.wdb.emit('reset filter'); - } - - /** - * Esimate smart fee. - * @param {Number?} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - return {rate: this.network.feeRate}; - } - - /** - * Get hash range. - * @param {Number} start - * @param {Number} end - * @returns {Promise} - */ - - async getHashes(start = -1, end = -1) { - return [this.network.genesis.hash]; - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - async rescan(start) { - } - } - - /* - * Expose - */ - - var nullclient = NullClient$1; - - /*! - * walletdb.js - storage for wallets - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$3 = assert_1$g; - const path$1 = require$$1__default["default"]; - const EventEmitter = require$$1__default$1["default"]; - const bio = bufio; - const {BloomFilter} = bfilter; - const {Lock: Lock$1, MapLock} = bmutex; - const bdb = bdb$d; - const Logger = blgr; - const {safeEqual} = safe; - const aes = aes$5.exports; - const Network = network; - const Path = path$3; - const common$1 = common$5; - const Wallet$3 = wallet$1; - const Account = account; - const Outpoint$2 = outpoint; - const layouts = layout$2; - const records = records$2.exports; - const NullClient = nullclient; - const layout = layouts.wdb; - const tlayout = layouts.txdb; - - const { - ChainState, - BlockMeta: BlockMeta$1, - TXRecord, - MapRecord - } = records; - - /** - * WalletDB - * @alias module:wallet.WalletDB - * @extends EventEmitter - */ - - class WalletDB$2 extends EventEmitter { - /** - * Create a wallet db. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(); - - this.options = new WalletOptions(options); - - this.network = this.options.network; - this.logger = this.options.logger.context('wallet'); - this.workers = this.options.workers; - this.client = this.options.client || new NullClient(this); - this.feeRate = this.options.feeRate; - this.db = bdb.create(this.options); - - this.primary = null; - this.state = new ChainState(); - this.confirming = false; - this.height = 0; - this.wallets = new Map(); - this.depth = 0; - this.rescanning = false; - this.filterSent = false; - - // Wallet read lock. - this.readLock = new MapLock(); - - // Wallet write lock (creation and rename). - this.writeLock = new Lock$1(); - - // Lock for handling anything tx related. - this.txLock = new Lock$1(); - - // Address and outpoint filter. - this.filter = new BloomFilter(); - - this.init(); - } - - /** - * Initialize walletdb. - * @private - */ - - init() { - let items = 3000000; - let flag = -1; - - // Highest number of items with an - // FPR of 0.001. We have to do this - // by hand because BloomFilter.fromRate's - // policy limit enforcing is fairly - // naive. - if (this.options.spv) { - items = 20000; - flag = BloomFilter.flags.ALL; - } - - this.filter = BloomFilter.fromRate(items, 0.001, flag); - this._bind(); - } - - /** - * Bind to node events. - * @private - */ - - _bind() { - this.client.on('error', (err) => { - this.emit('error', err); - }); - - this.client.on('connect', async () => { - try { - await this.syncNode(); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.on('disconnect', async () => { - this.filterSent = false; - }); - - this.client.bind('block connect', async (entry, txs) => { - try { - await this.addBlock(entry, txs); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('block disconnect', async (entry) => { - try { - await this.removeBlock(entry); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.hook('block rescan', async (entry, txs) => { - try { - await this.rescanBlock(entry, txs); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('tx', async (tx) => { - try { - await this.addTX(tx); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('chain reset', async (tip) => { - try { - await this.resetChain(tip); - } catch (e) { - this.emit('error', e); - } - }); - } - - /** - * Open the walletdb, wait for the database to load. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening WalletDB...'); - await this.db.open(); - await this.db.verify(layout.V.encode(), 'wallet', 7); - - await this.verifyNetwork(); - - this.depth = await this.getDepth(); - - if (this.options.wipeNoReally) - await this.wipe(); - - await this.watch(); - await this.connect(); - - this.logger.info( - 'WalletDB loaded (depth=%d, height=%d, start=%d).', - this.depth, - this.state.height, - this.state.startHeight); - - const wallet = await this.ensure({ - id: 'primary' - }); - - const addr = await wallet.receiveAddress(); - - this.logger.info( - 'Loaded primary wallet (id=%s, wid=%d, address=%s)', - wallet.id, wallet.wid, addr.toString(this.network)); - - this.primary = wallet; - } - - /** - * Verify network. - * @returns {Promise} - */ - - async verifyNetwork() { - const raw = await this.db.get(layout.O.encode()); - - if (!raw) { - const b = this.db.batch(); - b.put(layout.O.encode(), fromU32(this.network.magic)); - return b.write(); - } - - const magic = raw.readUInt32LE(0, true); - - if (magic !== this.network.magic) - throw new Error('Network mismatch for WalletDB.'); - - return undefined; - } - - /** - * Close the walletdb, wait for the database to close. - * @returns {Promise} - */ - - async close() { - await this.disconnect(); - - for (const wallet of this.wallets.values()) { - await wallet.destroy(); - this.unregister(wallet); - } - - return this.db.close(); - } - - /** - * Watch addresses and outpoints. - * @private - * @returns {Promise} - */ - - async watch() { - const piter = this.db.iterator({ - gte: layout.p.min(), - lte: layout.p.max() - }); - - let hashes = 0; - - await piter.each((key) => { - const [data] = layout.p.decode(key); - - this.filter.add(data); - - hashes += 1; - }); - - this.logger.info('Added %d hashes to WalletDB filter.', hashes); - - const oiter = this.db.iterator({ - gte: layout.o.min(), - lte: layout.o.max() - }); - - let outpoints = 0; - - await oiter.each((key) => { - const [hash, index] = layout.o.decode(key); - const outpoint = new Outpoint$2(hash, index); - const data = outpoint.toRaw(); - - this.filter.add(data); - - outpoints += 1; - }); - - this.logger.info('Added %d outpoints to WalletDB filter.', outpoints); - } - - /** - * Connect to the node server (client required). - * @returns {Promise} - */ - - async connect() { - return this.client.open(); - } - - /** - * Disconnect from node server (client required). - * @returns {Promise} - */ - - async disconnect() { - return this.client.close(); - } - - /** - * Sync state with server on every connect. - * @returns {Promise} - */ - - async syncNode() { - const unlock = await this.txLock.lock(); - try { - this.logger.info('Resyncing from server...'); - await this.syncState(); - await this.syncFilter(); - await this.syncChain(); - await this.resend(); - } finally { - unlock(); - } - } - - /** - * Initialize and write initial sync state. - * @returns {Promise} - */ - - async syncState() { - const cache = await this.getState(); - - if (cache) { - if (!await this.getBlock(0)) - return this.migrateState(cache); - - this.state = cache; - this.height = cache.height; - - return undefined; - } - - this.logger.info('Initializing database state from server.'); - - const b = this.db.batch(); - const hashes = await this.client.getHashes(); - - let tip = null; - - for (let height = 0; height < hashes.length; height++) { - const hash = hashes[height]; - const meta = new BlockMeta$1(hash, height); - b.put(layout.h.encode(height), meta.toHash()); - tip = meta; - } - - assert$3(tip); - - const state = this.state.clone(); - state.startHeight = tip.height; - state.startHash = tip.hash; - state.height = tip.height; - state.marked = false; - - b.put(layout.R.encode(), state.toRaw()); - - await b.write(); - - this.state = state; - this.height = state.height; - - return undefined; - } - - /** - * Migrate sync state. - * @private - * @param {ChainState} state - * @returns {Promise} - */ - - async migrateState(state) { - const b = this.db.batch(); - - this.logger.info('Migrating to new sync state.'); - - const hashes = await this.client.getHashes(0, state.height); - - for (let height = 0; height < hashes.length; height++) { - const hash = hashes[height]; - const meta = new BlockMeta$1(hash, height); - b.put(layout.h.encode(height), meta.toHash()); - } - - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Connect and sync with the chain server. - * @private - * @returns {Promise} - */ - - async syncChain() { - let height = this.state.height; - - this.logger.info('Syncing state from height %d.', height); - - for (;;) { - const tip = await this.getBlock(height); - assert$3(tip); - - if (await this.client.getEntry(tip.hash)) - break; - - assert$3(height !== 0); - height -= 1; - } - - return this.scan(height); - } - - /** - * Rescan blockchain from a given height. - * @private - * @param {Number?} height - * @returns {Promise} - */ - - async scan(height) { - if (height == null) - height = this.state.startHeight; - - assert$3((height >>> 0) === height, 'WDB: Must pass in a height.'); - - this.logger.info( - 'WalletDB is scanning %d blocks.', - this.state.height - height + 1); - - await this.rollback(height); - - const tip = await this.getTip(); - - try { - this.rescanning = true; - await this.client.rescan(tip.hash); - } finally { - this.rescanning = false; - } - } - - /** - * Force a rescan. - * @param {Number} height - * @returns {Promise} - */ - - async rescan(height) { - const unlock = await this.txLock.lock(); - try { - return await this._rescan(height); - } finally { - unlock(); - } - } - - /** - * Force a rescan (without a lock). - * @private - * @param {Number} height - * @returns {Promise} - */ - - async _rescan(height) { - return this.scan(height); - } - - /** - * Broadcast a transaction via chain server. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - return this.client.send(tx); - } - - /** - * Estimate smart fee from chain server. - * @param {Number} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - if (this.feeRate > 0) - return this.feeRate; - - const json = await this.client.estimateFee(blocks); - - if (!json) - throw new Error('Fee not found.'); - - if (!Number.isInteger(json.rate)) - throw new Error('Fee is not an integer.'); - - if (json.rate < this.network.feeRate) - return this.network.feeRate; - - if (json.rate > this.network.maxFeeRate) - return this.network.maxFeeRate; - - return json.rate; - } - - /** - * Send filter to the remote node. - * @private - * @returns {Promise} - */ - - syncFilter() { - this.logger.info('Sending filter to server (%dmb).', - this.filter.size / 8 / (1 << 20)); - - this.filterSent = true; - return this.client.setFilter(this.filter); - } - - /** - * Add data to remote filter. - * @private - * @param {Buffer} data - * @returns {Promise} - */ - - addFilter(data) { - if (!this.filterSent) - return undefined; - return this.client.addFilter(data); - } - - /** - * Reset remote filter. - * @private - * @returns {Promise} - */ - - resetFilter() { - if (!this.filterSent) - return undefined; - return this.client.resetFilter(); - } - - /** - * Backup the wallet db. - * @param {String} path - * @returns {Promise} - */ - - backup(path) { - return this.db.backup(path); - } - - /** - * Wipe the txdb - NEVER USE. - * @returns {Promise} - */ - - async wipe() { - this.logger.warning('Wiping WalletDB TXDB...'); - this.logger.warning('I hope you know what you\'re doing.'); - - const iter = this.db.iterator(); - const b = this.db.batch(); - - let total = 0; - - await iter.each((key) => { - switch (key[0]) { - case 0x62: // b - case 0x63: // c - case 0x65: // e - case 0x74: // t - case 0x6f: // o - case 0x68: // h - case 0x52: // R - b.del(key); - total += 1; - break; - } - }); - - this.logger.warning('Wiped %d txdb records.', total); - - return b.write(); - } - - /** - * Get current wallet wid depth. - * @private - * @returns {Promise} - */ - - async getDepth() { - const raw = await this.db.get(layout.D.encode()); - - if (!raw) - return 0; - - return raw.readUInt32LE(0, true); - } - - /** - * Test the bloom filter against a tx or address hash. - * @private - * @param {Hash} hash - * @returns {Boolean} - */ - - testFilter(data) { - return this.filter.test(data); - } - - /** - * Add hash to local and remote filters. - * @private - * @param {Hash} hash - */ - - addHash(hash) { - this.filter.add(hash); - return this.addFilter(hash); - } - - /** - * Add outpoint to local filter. - * @private - * @param {Hash} hash - * @param {Number} index - */ - - addOutpoint(hash, index) { - const outpoint = new Outpoint$2(hash, index); - this.filter.add(outpoint.toRaw()); - } - - /** - * Dump database (for debugging). - * @returns {Promise} - Returns Object. - */ - - dump() { - return this.db.dump(); - } - - /** - * Register an object with the walletdb. - * @param {Object} object - */ - - register(wallet) { - assert$3(!this.wallets.has(wallet.wid)); - this.wallets.set(wallet.wid, wallet); - } - - /** - * Unregister a object with the walletdb. - * @param {Object} object - * @returns {Boolean} - */ - - unregister(wallet) { - assert$3(this.wallets.has(wallet.wid)); - this.wallets.delete(wallet.wid); - } - - /** - * Map wallet id to wid. - * @param {String|Number} id - * @returns {Promise} - Returns {Number}. - */ - - async ensureWID(id) { - if (typeof id === 'number') { - if (!await this.db.has(layout.W.encode(id))) - return -1; - return id; - } - - return this.getWID(id); - } - - /** - * Map wallet id to wid. - * @param {String} id - * @returns {Promise} - Returns {Number}. - */ - - async getWID(id) { - const data = await this.db.get(layout.l.encode(id)); - - if (!data) - return -1; - - assert$3(data.length === 4); - - return data.readUInt32LE(0, true); - } - - /** - * Map wallet wid to id. - * @param {Number} wid - * @returns {Promise} - Returns {String}. - */ - - async getID(wid) { - const data = await this.db.get(layout.W.encode(wid)); - - if (!data) - return null; - - return toString$1(data); - } - - /** - * Get a wallet from the database, setup watcher. - * @param {Number|String} id - * @returns {Promise} - Returns {@link Wallet}. - */ - - async get(id) { - const wid = await this.ensureWID(id); - - if (wid === -1) - return null; - - const unlock = await this.readLock.lock(wid); - - try { - return await this._get(wid); - } finally { - unlock(); - } - } - - /** - * Get a wallet from the database without a lock. - * @private - * @param {Number} wid - * @returns {Promise} - Returns {@link Wallet}. - */ - - async _get(wid) { - const cache = this.wallets.get(wid); - - if (cache) - return cache; - - const id = await this.getID(wid); - - if (!id) - return null; - - const data = await this.db.get(layout.w.encode(wid)); - assert$3(data); - - const wallet = Wallet$3.fromRaw(this, data); - - wallet.wid = wid; - wallet.id = id; - - await wallet.open(); - - this.register(wallet); - - return wallet; - } - - /** - * Save a wallet to the database. - * @param {Wallet} wallet - */ - - save(b, wallet) { - const wid = wallet.wid; - const id = wallet.id; - - b.put(layout.w.encode(wid), wallet.toRaw()); - b.put(layout.W.encode(wid), fromString(id)); - b.put(layout.l.encode(id), fromU32(wid)); - } - - /** - * Increment the wid depth. - * @param {Batch} b - * @param {Number} wid - */ - - increment(b, wid) { - b.put(layout.D.encode(), fromU32(wid + 1)); - } - - /** - * Rename a wallet. - * @param {Wallet} wallet - * @param {String} id - * @returns {Promise} - */ - - async rename(wallet, id) { - const unlock = await this.writeLock.lock(); - try { - return await this._rename(wallet, id); - } finally { - unlock(); - } - } - - /** - * Rename a wallet without a lock. - * @private - * @param {Wallet} wallet - * @param {String} id - * @returns {Promise} - */ - - async _rename(wallet, id) { - if (!common$1.isName(id)) - throw new Error('WDB: Bad wallet ID.'); - - if (await this.has(id)) - throw new Error('WDB: ID not available.'); - - const b = this.db.batch(); - - // Update wid->id index. - b.put(layout.W.encode(wallet.wid), fromString(id)); - - // Delete old id->wid index. - b.del(layout.l.encode(wallet.id)); - - // Add new id->wid index. - b.put(layout.l.encode(id), fromU32(wallet.wid)); - - await b.write(); - - wallet.id = id; - } - - /** - * Rename an account. - * @param {Account} account - * @param {String} name - */ - - renameAccount(b, account, name) { - const wid = account.wid; - const index = account.accountIndex; - - // Remove old wid/name->account index. - b.del(layout.i.encode(wid, account.name)); - - // Name->Index lookups - b.put(layout.i.encode(wid, name), fromU32(index)); - - // Index->Name lookups - b.put(layout.n.encode(wid, index), fromString(name)); - - account.name = name; - } - - /** - * Remove a wallet. - * @param {Number|String} id - * @returns {Promise} - */ - - async remove(id) { - const wid = await this.ensureWID(id); - - if (wid === -1) - return false; - - // Grab all locks. - const unlock1 = await this.readLock.lock(wid); - const unlock2 = await this.writeLock.lock(); - const unlock3 = await this.txLock.lock(); - - try { - return await this._remove(wid); - } finally { - unlock3(); - unlock2(); - unlock1(); - } - } - - /** - * Remove a wallet (without a lock). - * @private - * @param {Number} wid - * @returns {Promise} - */ - - async _remove(wid) { - const id = await this.getID(wid); - - if (!id) - return false; - - if (id === 'primary') - throw new Error('Cannot remove primary wallet.'); - - const b = this.db.batch(); - - b.del(layout.w.encode(wid)); - b.del(layout.W.encode(wid)); - b.del(layout.l.encode(id)); - - const piter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid) - }); - - await piter.each((key, value) => { - const [, hash] = layout.P.decode(key); - b.del(key); - return this.removePathMap(b, hash, wid); - }); - - const removeRange = (opt) => { - return this.db.iterator(opt).each(key => b.del(key)); - }; - - await removeRange({ - gte: layout.r.min(wid), - lte: layout.r.max(wid) - }); - - await removeRange({ - gte: layout.a.min(wid), - lte: layout.a.max(wid) - }); - - await removeRange({ - gte: layout.i.min(wid), - lte: layout.i.max(wid) - }); - - await removeRange({ - gte: layout.n.min(wid), - lte: layout.n.max(wid) - }); - - await removeRange({ - gt: layout.t.encode(wid), - lt: layout.t.encode(wid + 1) - }); - - const bucket = this.db.bucket(layout.t.encode(wid)); - - const biter = bucket.iterator({ - gte: tlayout.b.min(), - lte: tlayout.b.max() - }); - - await biter.each((key, value) => { - const [height] = tlayout.b.decode(key); - return this.removeBlockMap(b, height, wid); - }); - - const siter = bucket.iterator({ - gte: tlayout.s.min(), - lte: tlayout.s.max(), - keys: true - }); - - await siter.each((key, value) => { - const [hash, index] = tlayout.s.decode(key); - return this.removeOutpointMap(b, hash, index, wid); - }); - - const uiter = bucket.iterator({ - gte: tlayout.p.min(), - lte: tlayout.p.max(), - keys: true - }); - - await uiter.each((key, value) => { - const [hash] = tlayout.p.decode(key); - return this.removeTXMap(b, hash, wid); - }); - - const wallet = this.wallets.get(wid); - - if (wallet) { - await wallet.destroy(); - this.unregister(wallet); - } - - await b.write(); - - return true; - } - - /** - * Get a wallet with token auth first. - * @param {Number|String} id - * @param {Buffer} token - * @returns {Promise} - Returns {@link Wallet}. - */ - - async auth(id, token) { - const wallet = await this.get(id); - - if (!wallet) - return null; - - // Compare in constant time: - if (!safeEqual(token, wallet.token)) - throw new Error('WDB: Authentication error.'); - - return wallet; - } - - /** - * Create a new wallet, save to database, setup watcher. - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async create(options) { - const unlock = await this.writeLock.lock(); - - if (!options) - options = {}; - - try { - return await this._create(options); - } finally { - unlock(); - } - } - - /** - * Create a new wallet, save to database without a lock. - * @private - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async _create(options) { - if (options.id) { - if (await this.has(options.id)) - throw new Error('WDB: Wallet already exists.'); - } - - const wallet = Wallet$3.fromOptions(this, options); - - wallet.wid = this.depth; - - await wallet.init(options, options.passphrase); - - this.depth += 1; - - this.register(wallet); - - this.logger.info('Created wallet %s in WalletDB.', wallet.id); - - return wallet; - } - - /** - * Test for the existence of a wallet. - * @param {Number|String} id - * @returns {Promise} - */ - - async has(id) { - const wid = await this.ensureWID(id); - return wid !== -1; - } - - /** - * Attempt to create wallet, return wallet if already exists. - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - */ - - async ensure(options) { - if (options.id) { - const wallet = await this.get(options.id); - - if (wallet) - return wallet; - } - - return this.create(options); - } - - /** - * Get an account from the database by wid. - * @private - * @param {Number} wid - * @param {Number} index - Account index. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async getAccount(wid, index) { - const name = await this.getAccountName(wid, index); - - if (!name) - return null; - - const data = await this.db.get(layout.a.encode(wid, index)); - assert$3(data); - - const account = Account.fromRaw(this, data); - - account.accountIndex = index; - account.name = name; - - return account; - } - - /** - * List account names and indexes from the db. - * @param {Number} wid - * @returns {Promise} - Returns Array. - */ - - async getAccounts(wid) { - return this.db.values({ - gte: layout.n.min(wid), - lte: layout.n.max(wid), - parse: toString$1 - }); - } - - /** - * Lookup the corresponding account name's index. - * @param {Number} wid - * @param {String} name - Account name/index. - * @returns {Promise} - Returns Number. - */ - - async getAccountIndex(wid, name) { - const index = await this.db.get(layout.i.encode(wid, name)); - - if (!index) - return -1; - - return index.readUInt32LE(0, true); - } - - /** - * Lookup the corresponding account index's name. - * @param {Number} wid - * @param {Number} index - * @returns {Promise} - Returns Number. - */ - - async getAccountName(wid, index) { - const name = await this.db.get(layout.n.encode(wid, index)); - - if (!name) - return null; - - return toString$1(name); - } - - /** - * Save an account to the database. - * @param {Account} account - * @returns {Promise} - */ - - saveAccount(b, account) { - const wid = account.wid; - const index = account.accountIndex; - const name = account.name; - - // Account data - b.put(layout.a.encode(wid, index), account.toRaw()); - - // Name->Index lookups - b.put(layout.i.encode(wid, name), fromU32(index)); - - // Index->Name lookups - b.put(layout.n.encode(wid, index), fromString(name)); - } - - /** - * Test for the existence of an account. - * @param {Number} wid - * @param {String|Number} acct - * @returns {Promise} - Returns Boolean. - */ - - async hasAccount(wid, index) { - return this.db.has(layout.a.encode(wid, index)); - } - - /** - * Save an address to the path map. - * @param {Wallet} wallet - * @param {WalletKey} ring - * @returns {Promise} - */ - - async saveKey(b, wid, ring) { - return this.savePath(b, wid, ring.toPath()); - } - - /** - * Save a path to the path map. - * - * The path map exists in the form of: - * - `p[address-hash] -> wid map` - * - `P[wid][address-hash] -> path data` - * - `r[wid][account-index][address-hash] -> dummy` - * - * @param {Wallet} wallet - * @param {Path} path - * @returns {Promise} - */ - - async savePath(b, wid, path) { - // Address Hash -> Wallet Map - await this.addPathMap(b, path.hash, wid); - - // Wallet ID + Address Hash -> Path Data - b.put(layout.P.encode(wid, path.hash), path.toRaw()); - - // Wallet ID + Account Index + Address Hash -> Dummy - b.put(layout.r.encode(wid, path.account, path.hash), null); - } - - /** - * Retrieve path by hash. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async getPath(wid, hash) { - const path = await this.readPath(wid, hash); - - if (!path) - return null; - - path.name = await this.getAccountName(wid, path.account); - assert$3(path.name); - - return path; - } - - /** - * Retrieve path by hash. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async readPath(wid, hash) { - const data = await this.db.get(layout.P.encode(wid, hash)); - - if (!data) - return null; - - const path = Path.fromRaw(data); - path.hash = hash; - - return path; - } - - /** - * Test whether a wallet contains a path. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async hasPath(wid, hash) { - return this.db.has(layout.P.encode(wid, hash)); - } - - /** - * Get all address hashes. - * @returns {Promise} - */ - - async getHashes() { - return this.db.keys({ - gte: layout.p.min(), - lte: layout.p.max(), - parse: key => layout.p.decode(key)[0] - }); - } - - /** - * Get all outpoints. - * @returns {Promise} - */ - - async getOutpoints() { - return this.db.keys({ - gte: layout.o.min(), - lte: layout.o.max(), - parse: (key) => { - const [hash, index] = layout.o.decode(key); - return new Outpoint$2(hash, index); - } - }); - } - - /** - * Get all address hashes. - * @param {Number} wid - * @returns {Promise} - */ - - async getWalletHashes(wid) { - return this.db.keys({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - parse: key => layout.P.decode(key)[1] - }); - } - - /** - * Get all account address hashes. - * @param {Number} wid - * @param {Number} account - * @returns {Promise} - */ - - async getAccountHashes(wid, account) { - return this.db.keys({ - gte: layout.r.min(wid, account), - lte: layout.r.max(wid, account), - parse: key => layout.r.decode(key)[2] - }); - } - - /** - * Get all paths for a wallet. - * @param {Number} wid - * @returns {Promise} - */ - - async getWalletPaths(wid) { - const items = await this.db.range({ - gte: layout.P.min(wid), - lte: layout.P.max(wid) - }); - - const paths = []; - - for (const {key, value} of items) { - const [, hash] = layout.P.decode(key); - const path = Path.fromRaw(value); - - path.hash = hash; - path.name = await this.getAccountName(wid, path.account); - assert$3(path.name); - - paths.push(path); - } - - return paths; - } - - /** - * Get all wallet ids. - * @returns {Promise} - */ - - async getWallets() { - return this.db.values({ - gte: layout.W.min(), - lte: layout.W.max(), - parse: toString$1 - }); - } - - /** - * Encrypt all imported keys for a wallet. - * @param {Number} wid - * @param {Buffer} key - * @returns {Promise} - */ - - async encryptKeys(b, wid, key) { - const iter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - values: true - }); - - await iter.each((k, value) => { - const [, hash] = layout.P.decode(k); - const path = Path.fromRaw(value); - - if (!path.data) - return; - - assert$3(!path.encrypted); - - const iv = hash.slice(0, 16); - - path.data = aes.encipher(path.data, key, iv); - path.encrypted = true; - - b.put(k, path.toRaw()); - }); - } - - /** - * Decrypt all imported keys for a wallet. - * @param {Number} wid - * @param {Buffer} key - * @returns {Promise} - */ - - async decryptKeys(b, wid, key) { - const iter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - values: true - }); - - await iter.each((k, value) => { - const [, hash] = layout.P.decode(k); - const path = Path.fromRaw(value); - - if (!path.data) - return; - - assert$3(path.encrypted); - - const iv = hash.slice(0, 16); - - path.data = aes.decipher(path.data, key, iv); - path.encrypted = false; - - b.put(k, path.toRaw()); - }); - } - - /** - * Resend all pending transactions. - * @returns {Promise} - */ - - async resend() { - const wids = await this.db.keys({ - gte: layout.w.min(), - lte: layout.w.max(), - parse: key => layout.w.decode(key)[0] - }); - - this.logger.info('Resending from %d wallets.', wids.length); - - for (const wid of wids) - await this.resendPending(wid); - } - - /** - * Resend all pending transactions for a specific wallet. - * @private - * @param {Number} wid - * @returns {Promise} - */ - - async resendPending(wid) { - const prefix = layout.t.encode(wid); - const b = this.db.bucket(prefix); - - const hashes = await b.keys({ - gte: tlayout.p.min(), - lte: tlayout.p.max(), - parse: key => tlayout.p.decode(key)[0] - }); - - if (hashes.length === 0) - return; - - this.logger.info( - 'Rebroadcasting %d transactions for %d.', - hashes.length, - wid); - - const txs = []; - - for (const hash of hashes) { - const data = await b.get(tlayout.t.encode(hash)); - - if (!data) - continue; - - const wtx = TXRecord.fromRaw(data); - - if (wtx.tx.isCoinbase()) - continue; - - txs.push(wtx.tx); - } - - for (const tx of common$1.sortDeps(txs)) - await this.send(tx); - } - - /** - * Get all wallet ids by output addresses and outpoints. - * @param {Hash[]} hashes - * @returns {Promise} - */ - - async getWalletsByTX(tx) { - const wids = new Set(); - - if (!tx.isCoinbase()) { - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - - if (!this.testFilter(prevout.toRaw())) - continue; - - const map = await this.getOutpointMap(hash, index); - - if (!map) - continue; - - for (const wid of map.wids) - wids.add(wid); - } - } - - const hashes = tx.getOutputHashes(); - - for (const hash of hashes) { - if (!this.testFilter(hash)) - continue; - - const map = await this.getPathMap(hash); - - if (!map) - continue; - - for (const wid of map.wids) - wids.add(wid); - } - - if (wids.size === 0) - return null; - - return wids; - } - - /** - * Get the best block hash. - * @returns {Promise} - */ - - async getState() { - const data = await this.db.get(layout.R.encode()); - - if (!data) - return null; - - return ChainState.fromRaw(data); - } - - /** - * Sync the current chain state to tip. - * @param {BlockMeta} tip - * @returns {Promise} - */ - - async setTip(tip) { - const b = this.db.batch(); - const state = this.state.clone(); - - if (tip.height < state.height) { - // Hashes ahead of our new tip - // that we need to delete. - while (state.height !== tip.height) { - b.del(layout.h.encode(state.height)); - state.height -= 1; - } - } else if (tip.height > state.height) { - assert$3(tip.height === state.height + 1, 'Bad chain sync.'); - state.height += 1; - } - - if (tip.height < state.startHeight) { - state.startHeight = tip.height; - state.startHash = tip.hash; - state.marked = false; - } - - // Save tip and state. - b.put(layout.h.encode(tip.height), tip.toHash()); - b.put(layout.R.encode(), state.toRaw()); - - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Will return the current height and will increment - * to the current height of a block currently being - * added to the wallet. - * @returns {Number} - */ - - liveHeight() { - let height = this.height; - - if (this.confirming) - height += 1; - - return height; - } - - /** - * Mark current state. - * @param {BlockMeta} block - * @returns {Promise} - */ - - async markState(block) { - const state = this.state.clone(); - state.startHeight = block.height; - state.startHash = block.hash; - state.marked = true; - - const b = this.db.batch(); - b.put(layout.R.encode(), state.toRaw()); - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getMap(key) { - const data = await this.db.get(key); - - if (!data) - return null; - - return MapRecord.fromRaw(data); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addMap(b, key, wid) { - const data = await this.db.get(key); - - if (!data) { - const map = new MapRecord(); - map.add(wid); - b.put(key, map.toRaw()); - return; - } - - assert$3(data.length >= 4); - - const len = data.readUInt32LE(0, true); - const bw = bio.write(data.length + 4); - - bw.writeU32(len + 1); - bw.copy(data, 4, data.length); - bw.writeU32(wid); - - b.put(key, bw.render()); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeMap(b, key, wid) { - const map = await this.getMap(key); - - if (!map) - return; - - if (!map.remove(wid)) - return; - - if (map.size === 0) { - b.del(key); - return; - } - - b.put(key, map.toRaw()); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getPathMap(hash) { - return this.getMap(layout.p.encode(hash)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addPathMap(b, hash, wid) { - await this.addHash(hash); - return this.addMap(b, layout.p.encode(hash), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removePathMap(b, hash, wid) { - return this.removeMap(b, layout.p.encode(hash), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getBlockMap(height) { - return this.getMap(layout.b.encode(height)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addBlockMap(b, height, wid) { - return this.addMap(b, layout.b.encode(height), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeBlockMap(b, height, wid) { - return this.removeMap(b, layout.b.encode(height), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getTXMap(hash) { - return this.getMap(layout.T.encode(hash)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addTXMap(b, hash, wid) { - return this.addMap(b, layout.T.encode(hash), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeTXMap(b, hash, wid) { - return this.removeMap(b, layout.T.encode(hash), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getOutpointMap(hash, index) { - return this.getMap(layout.o.encode(hash, index)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addOutpointMap(b, hash, index, wid) { - await this.addOutpoint(hash, index); - return this.addMap(b, layout.o.encode(hash, index), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeOutpointMap(b, hash, index, wid) { - return this.removeMap(b, layout.o.encode(hash, index), wid); - } - - /** - * Get a wallet block meta. - * @param {Hash} hash - * @returns {Promise} - */ - - async getBlock(height) { - const data = await this.db.get(layout.h.encode(height)); - - if (!data) - return null; - - const block = new BlockMeta$1(); - block.hash = data; - block.height = height; - - return block; - } - - /** - * Get wallet tip. - * @param {Hash} hash - * @returns {Promise} - */ - - async getTip() { - const tip = await this.getBlock(this.state.height); - - if (!tip) - throw new Error('WDB: Tip not found!'); - - return tip; - } - - /** - * Sync with chain height. - * @param {Number} height - * @returns {Promise} - */ - - async rollback(height) { - if (height > this.state.height) - throw new Error('WDB: Cannot rollback to the future.'); - - if (height === this.state.height) { - this.logger.info('Rolled back to same height (%d).', height); - return; - } - - this.logger.info( - 'Rolling back %d WalletDB blocks to height %d.', - this.state.height - height, height); - - const tip = await this.getBlock(height); - assert$3(tip); - - await this.revert(tip.height); - await this.setTip(tip); - } - - /** - * Revert TXDB to an older state. - * @param {Number} target - * @returns {Promise} - */ - - async revert(target) { - const iter = this.db.iterator({ - gte: layout.b.encode(target + 1), - lte: layout.b.max(), - reverse: true, - values: true - }); - - let total = 0; - - await iter.each(async (key, value) => { - const [height] = layout.b.decode(key); - const block = MapRecord.fromRaw(value); - - for (const wid of block.wids) { - const wallet = await this.get(wid); - assert$3(wallet); - total += await wallet.revert(height); - } - }); - - this.logger.info('Rolled back %d WalletDB transactions.', total); - } - - /** - * Add a block's transactions and write the new best hash. - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async addBlock(entry, txs) { - const unlock = await this.txLock.lock(); - try { - return await this._addBlock(entry, txs); - } finally { - unlock(); - } - } - - /** - * Add a block's transactions without a lock. - * @private - * @param {ChainEntry} entry - * @param {TX[]} txs - * @returns {Promise} - */ - - async _addBlock(entry, txs) { - const tip = BlockMeta$1.fromEntry(entry); - - if (tip.height < this.state.height) { - this.logger.warning( - 'WalletDB is connecting low blocks (%d).', - tip.height); - return 0; - } - - if (tip.height >= this.network.block.slowHeight) - this.logger.debug('Adding block: %d.', tip.height); - - if (tip.height === this.state.height) { - // We let blocks of the same height - // through specifically for rescans: - // we always want to rescan the last - // block since the state may have - // updated before the block was fully - // processed (in the case of a crash). - this.logger.warning('Already saw WalletDB block (%d).', tip.height); - } else if (tip.height !== this.state.height + 1) { - await this.scan(this.state.height); - return 0; - } - - let total = 0; - - try { - // We set the state as confirming so that - // anything that uses the current height can - // increment by one until the block is fully - // added and the height is updated. - this.confirming = true; - for (const tx of txs) { - if (await this._addTX(tx, tip)) - total += 1; - } - - // Sync the state to the new tip. - await this.setTip(tip); - } finally { - this.confirming = false; - } - - if (total > 0) { - this.logger.info('Connected WalletDB block %h (tx=%d).', - tip.hash, total); - } - - return total; - } - - /** - * Unconfirm a block's transactions - * and write the new best hash (SPV version). - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async removeBlock(entry) { - const unlock = await this.txLock.lock(); - try { - return await this._removeBlock(entry); - } finally { - unlock(); - } - } - - /** - * Unconfirm a block's transactions. - * @private - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async _removeBlock(entry) { - const tip = BlockMeta$1.fromEntry(entry); - - if (tip.height === 0) - throw new Error('WDB: Bad disconnection (genesis block).'); - - if (tip.height > this.state.height) { - this.logger.warning( - 'WalletDB is disconnecting high blocks (%d).', - tip.height); - return 0; - } - - if (tip.height !== this.state.height) - throw new Error('WDB: Bad disconnection (height mismatch).'); - - const prev = await this.getBlock(tip.height - 1); - assert$3(prev); - - // Get the map of block->wids. - const map = await this.getBlockMap(tip.height); - - if (!map) { - await this.setTip(prev); - return 0; - } - - let total = 0; - - for (const wid of map.wids) { - const wallet = await this.get(wid); - assert$3(wallet); - total += await wallet.revert(tip.height); - } - - // Sync the state to the previous tip. - await this.setTip(prev); - - this.logger.warning('Disconnected wallet block %h (tx=%d).', - tip.hash, total); - - return total; - } - - /** - * Rescan a block. - * @private - * @param {ChainEntry} entry - * @param {TX[]} txs - * @returns {Promise} - */ - - async rescanBlock(entry, txs) { - if (!this.rescanning) { - this.logger.warning('Unsolicited rescan block: %d.', entry.height); - return; - } - - if (entry.height > this.state.height + 1) { - this.logger.warning('Rescan block too high: %d.', entry.height); - return; - } - - try { - await this._addBlock(entry, txs); - } catch (e) { - this.emit('error', e); - throw e; - } - } - - /** - * Add a transaction to the database, map addresses - * to wallet IDs, potentially store orphans, resolve - * orphans, or confirm a transaction. - * @param {TX} tx - * @param {BlockMeta?} block - * @returns {Promise} - */ - - async addTX(tx, block) { - const unlock = await this.txLock.lock(); - try { - return await this._addTX(tx, block); - } finally { - unlock(); - } - } - - /** - * Add a transaction to the database without a lock. - * @private - * @param {TX} tx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async _addTX(tx, block) { - const wids = await this.getWalletsByTX(tx); - - assert$3(!tx.mutable, 'WDB: Cannot add mutable TX.'); - - if (!wids) - return null; - - if (block && !this.state.marked) - await this.markState(block); - - this.logger.info( - 'Incoming transaction for %d wallets in WalletDB (%h).', - wids.size, tx.hash()); - - let result = false; - - // Insert the transaction - // into every matching wallet. - for (const wid of wids) { - const wallet = await this.get(wid); - - assert$3(wallet); - - if (await wallet.add(tx, block)) { - this.logger.info( - 'Added transaction to wallet in WalletDB: %s (%d).', - wallet.id, wid); - result = true; - } - } - - if (!result) - return null; - - return wids; - } - - /** - * Handle a chain reset. - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async resetChain(entry) { - const unlock = await this.txLock.lock(); - try { - return await this._resetChain(entry); - } finally { - unlock(); - } - } - - /** - * Handle a chain reset without a lock. - * @private - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async _resetChain(entry) { - if (entry.height > this.state.height) - throw new Error('WDB: Bad reset height.'); - - return this.rollback(entry.height); - } - } - - /** - * Wallet Options - * @alias module:wallet.WalletOptions - */ - - class WalletOptions { - /** - * Create wallet options. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network.primary; - this.logger = Logger.global; - this.workers = null; - this.client = null; - this.feeRate = 0; - - this.prefix = null; - this.location = null; - this.memory = true; - this.maxFiles = 64; - this.cacheSize = 16 << 20; - this.compression = true; - - this.spv = false; - this.witness = true; - this.wipeNoReally = false; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {WalletOptions} - */ - - fromOptions(options) { - if (options.network != null) - this.network = Network.get(options.network); - - if (options.logger != null) { - assert$3(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.workers != null) { - assert$3(typeof options.workers === 'object'); - this.workers = options.workers; - } - - if (options.client != null) { - assert$3(typeof options.client === 'object'); - this.client = options.client; - } - - if (options.feeRate != null) { - assert$3((options.feeRate >>> 0) === options.feeRate); - this.feeRate = options.feeRate; - } - - if (options.prefix != null) { - assert$3(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.location = path$1.join(this.prefix, 'wallet'); - } - - if (options.location != null) { - assert$3(typeof options.location === 'string'); - this.location = options.location; - } - - if (options.memory != null) { - assert$3(typeof options.memory === 'boolean'); - this.memory = options.memory; - } - - if (options.maxFiles != null) { - assert$3((options.maxFiles >>> 0) === options.maxFiles); - this.maxFiles = options.maxFiles; - } - - if (options.cacheSize != null) { - assert$3(Number.isSafeInteger(options.cacheSize) && options.cacheSize >= 0); - this.cacheSize = options.cacheSize; - } - - if (options.compression != null) { - assert$3(typeof options.compression === 'boolean'); - this.compression = options.compression; - } - - if (options.spv != null) { - assert$3(typeof options.spv === 'boolean'); - this.spv = options.spv; - } - - if (options.witness != null) { - assert$3(typeof options.witness === 'boolean'); - this.witness = options.witness; - } - - if (options.wipeNoReally != null) { - assert$3(typeof options.wipeNoReally === 'boolean'); - this.wipeNoReally = options.wipeNoReally; - } - - return this; - } - - /** - * Instantiate chain options from object. - * @param {Object} options - * @returns {WalletOptions} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - } - - /* - * Helpers - */ - - function fromU32(num) { - const data = Buffer.allocUnsafe(4); - data.writeUInt32LE(num, 0, true); - return data; - } - - function fromString(str) { - const buf = Buffer.alloc(1 + str.length); - buf[0] = str.length; - buf.write(str, 1, str.length, 'ascii'); - return buf; - } - - function toString$1(buf) { - assert$3(buf.length > 0); - assert$3(buf[0] === buf.length - 1); - return buf.toString('ascii', 1, buf.length); - } - - /* - * Expose - */ - - var walletdb = WalletDB$2; - - /*! - * rpc.js - bitcoind-compatible json rpc for bcoin. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$2 = assert_1$g; - const {format} = require$$0__default$3["default"]; - const bweb = bweb$2; - const {Lock} = bmutex; - const fs = bfile; - const Validator = bval; - const {BufferMap, BufferSet} = bufferMap; - const util = util$y; - const messageUtil = message; - const Amount = amount; - const Script$4 = script$2; - const Address$1 = address$1; - const KeyRing = keyring; - const MerkleBlock = merkleblock; - const MTX$1 = mtx$1.exports; - const Outpoint$1 = outpoint; - const Output = output; - const TX = tx; - const consensus = consensus$s; - const pkg = pkg$4; - const common = common$5; - const {BlockMeta} = records$2.exports; - const RPCBase = bweb.RPC; - const RPCError = bweb.RPCError; - - /* - * Constants - */ - - const errs = { - // Standard JSON-RPC 2.0 errors - INVALID_REQUEST: bweb.errors.INVALID_REQUEST, - METHOD_NOT_FOUND: bweb.errors.METHOD_NOT_FOUND, - INVALID_PARAMS: bweb.errors.INVALID_PARAMS, - INTERNAL_ERROR: bweb.errors.INTERNAL_ERROR, - PARSE_ERROR: bweb.errors.PARSE_ERROR, - - // General application defined errors - MISC_ERROR: -1, - FORBIDDEN_BY_SAFE_MODE: -2, - TYPE_ERROR: -3, - INVALID_ADDRESS_OR_KEY: -5, - OUT_OF_MEMORY: -7, - INVALID_PARAMETER: -8, - DATABASE_ERROR: -20, - DESERIALIZATION_ERROR: -22, - VERIFY_ERROR: -25, - VERIFY_REJECTED: -26, - VERIFY_ALREADY_IN_CHAIN: -27, - IN_WARMUP: -28, - - // Wallet errors - WALLET_ERROR: -4, - WALLET_INSUFFICIENT_FUNDS: -6, - WALLET_INVALID_ACCOUNT_NAME: -11, - WALLET_KEYPOOL_RAN_OUT: -12, - WALLET_UNLOCK_NEEDED: -13, - WALLET_PASSPHRASE_INCORRECT: -14, - WALLET_WRONG_ENC_STATE: -15, - WALLET_ENCRYPTION_FAILED: -16, - WALLET_ALREADY_UNLOCKED: -17 - }; - - /** - * Wallet RPC - * @alias module:wallet.RPC - * @extends bweb.RPC - */ - - class RPC$1 extends RPCBase { - /** - * Create an RPC. - * @param {WalletDB} wdb - */ - - constructor(node) { - super(); - - assert$2(node, 'RPC requires a WalletDB.'); - - this.wdb = node.wdb; - this.network = node.network; - this.logger = node.logger.context('wallet-rpc'); - this.client = node.client; - this.locker = new Lock(); - - this.wallet = null; - - this.init(); - } - - getCode(err) { - switch (err.type) { - case 'RPCError': - return err.code; - case 'ValidationError': - return errs.TYPE_ERROR; - case 'EncodingError': - return errs.DESERIALIZATION_ERROR; - case 'FundingError': - return errs.WALLET_INSUFFICIENT_FUNDS; - default: - return errs.INTERNAL_ERROR; - } - } - - handleCall(cmd, query) { - this.logger.debug('Handling RPC call: %s.', cmd.method); - } - - init() { - this.add('help', this.help); - this.add('stop', this.stop); - this.add('fundrawtransaction', this.fundRawTransaction); - this.add('resendwallettransactions', this.resendWalletTransactions); - this.add('abandontransaction', this.abandonTransaction); - this.add('addmultisigaddress', this.addMultisigAddress); - this.add('addwitnessaddress', this.addWitnessAddress); - this.add('backupwallet', this.backupWallet); - this.add('dumpprivkey', this.dumpPrivKey); - this.add('dumpwallet', this.dumpWallet); - this.add('encryptwallet', this.encryptWallet); - this.add('getaddressinfo', this.getAddressInfo); - this.add('getaccountaddress', this.getAccountAddress); - this.add('getaccount', this.getAccount); - this.add('getaddressesbyaccount', this.getAddressesByAccount); - this.add('getbalance', this.getBalance); - this.add('getnewaddress', this.getNewAddress); - this.add('getrawchangeaddress', this.getRawChangeAddress); - this.add('getreceivedbyaccount', this.getReceivedByAccount); - this.add('getreceivedbyaddress', this.getReceivedByAddress); - this.add('gettransaction', this.getTransaction); - this.add('getunconfirmedbalance', this.getUnconfirmedBalance); - this.add('getwalletinfo', this.getWalletInfo); - this.add('importprivkey', this.importPrivKey); - this.add('importwallet', this.importWallet); - this.add('importaddress', this.importAddress); - this.add('importprunedfunds', this.importPrunedFunds); - this.add('importpubkey', this.importPubkey); - this.add('keypoolrefill', this.keyPoolRefill); - this.add('listaccounts', this.listAccounts); - this.add('listaddressgroupings', this.listAddressGroupings); - this.add('listlockunspent', this.listLockUnspent); - this.add('listreceivedbyaccount', this.listReceivedByAccount); - this.add('listreceivedbyaddress', this.listReceivedByAddress); - this.add('listsinceblock', this.listSinceBlock); - this.add('listtransactions', this.listTransactions); - this.add('listunspent', this.listUnspent); - this.add('lockunspent', this.lockUnspent); - this.add('move', this.move); - this.add('sendfrom', this.sendFrom); - this.add('sendmany', this.sendMany); - this.add('sendtoaddress', this.sendToAddress); - this.add('setaccount', this.setAccount); - this.add('settxfee', this.setTXFee); - this.add('signmessage', this.signMessage); - this.add('walletlock', this.walletLock); - this.add('walletpassphrasechange', this.walletPassphraseChange); - this.add('walletpassphrase', this.walletPassphrase); - this.add('removeprunedfunds', this.removePrunedFunds); - this.add('selectwallet', this.selectWallet); - this.add('getmemoryinfo', this.getMemoryInfo); - this.add('setloglevel', this.setLogLevel); - } - - async help(args, _help) { - if (args.length === 0) - return `Select a command:\n${Object.keys(this.calls).join('\n')}`; - - const json = { - method: args[0], - params: [] - }; - - return await this.execute(json, true); - } - - async stop(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'stop'); - - this.wdb.close(); - - return 'Stopping.'; - } - - async fundRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'fundrawtransaction "hexstring" ( options )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const data = valid.buf(0); - const options = valid.obj(1); - - if (!data) - throw new RPCError(errs.TYPE_ERROR, 'Invalid hex string.'); - - const tx = MTX$1.fromRaw(data); - - if (tx.outputs.length === 0) { - throw new RPCError(errs.INVALID_PARAMETER, - 'TX must have at least one output.'); - } - - let rate = null; - let change = null; - - if (options) { - const valid = new Validator(options); - - rate = valid.ufixed('feeRate', 8); - change = valid.str('changeAddress'); - - if (change) - change = parseAddress(change, this.network); - } - - await wallet.fund(tx, { - rate: rate, - changeAddress: change - }); - - return { - hex: tx.toRaw().toString('hex'), - changepos: tx.changeIndex, - fee: Amount.btc(tx.getFee(), true) - }; - } - - /* - * Wallet - */ - - async resendWalletTransactions(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'resendwallettransactions'); - - const wallet = this.wallet; - const txs = await wallet.resend(); - const hashes = []; - - for (const tx of txs) - hashes.push(tx.txid()); - - return hashes; - } - - async addMultisigAddress(args, help) { - // Impossible to implement in bcoin (no address book). - throw new Error('Not implemented.'); - } - - async addWitnessAddress(args, help) { - // Unlikely to be implemented. - throw new Error('Not implemented.'); - } - - async backupWallet(args, help) { - const valid = new Validator(args); - const dest = valid.str(0); - - if (help || args.length !== 1 || !dest) - throw new RPCError(errs.MISC_ERROR, 'backupwallet "destination"'); - - await this.wdb.backup(dest); - - return null; - } - - async dumpPrivKey(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'dumpprivkey "bitcoinaddress"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const hash = parseHash(addr, this.network); - const ring = await wallet.getPrivateKey(hash); - - if (!ring) - throw new RPCError(errs.MISC_ERROR, 'Key not found.'); - - return ring.toSecret(this.network); - } - - async dumpWallet(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'dumpwallet "filename"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const file = valid.str(0); - - if (!file) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const tip = await this.wdb.getTip(); - const time = util.date(); - - const out = [ - format('# Wallet Dump created by Bcoin %s', pkg.version), - format('# * Created on %s', time), - format('# * Best block at time of backup was %d (%s).', - tip.height, util.revHex(tip.hash)), - format('# * File: %s', file), - '' - ]; - - const hashes = await wallet.getAddressHashes(); - - for (const hash of hashes) { - const ring = await wallet.getPrivateKey(hash); - - if (!ring) - continue; - - const addr = ring.getAddress('string', this.network); - - let fmt = '%s %s label= addr=%s'; - - if (ring.branch === 1) - fmt = '%s %s change=1 addr=%s'; - - const str = format(fmt, ring.toSecret(this.network), time, addr); - - out.push(str); - } - - out.push(''); - out.push('# End of dump'); - out.push(''); - - const dump = out.join('\n'); - - if (fs.unsupported) - return dump; - - await fs.writeFile(file, dump, 'utf8'); - - return null; - } - - async encryptWallet(args, help) { - const wallet = this.wallet; - - if (!wallet.master.encrypted && (help || args.length !== 1)) - throw new RPCError(errs.MISC_ERROR, 'encryptwallet "passphrase"'); - - const valid = new Validator(args); - const passphrase = valid.str(0, ''); - - if (wallet.master.encrypted) { - throw new RPCError(errs.WALLET_WRONG_ENC_STATE, - 'Already running with an encrypted wallet.'); - } - - if (passphrase.length < 1) - throw new RPCError(errs.MISC_ERROR, 'encryptwallet "passphrase"'); - - try { - await wallet.encrypt(passphrase); - } catch (e) { - throw new RPCError(errs.WALLET_ENCRYPTION_FAILED, 'Encryption failed.'); - } - - return 'wallet encrypted; we do not need to stop!'; - } - - async getAccountAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaccountaddress "account"'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0, ''); - - if (!name) - name = 'default'; - - const addr = await wallet.receiveAddress(name); - - if (!addr) - return ''; - - return addr.toString(this.network); - } - - async getAccount(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaccount "bitcoinaddress"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const hash = parseHash(addr, this.network); - const path = await wallet.getPath(hash); - - if (!path) - return ''; - - return path.name; - } - - async getAddressesByAccount(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaddressesbyaccount "account"'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0, ''); - const addrs = []; - - if (name === '') - name = 'default'; - - let paths; - try { - paths = await wallet.getPaths(name); - } catch (e) { - if (e.message === 'Account not found.') - return []; - throw e; - } - - for (const path of paths) { - const addr = path.toAddress(); - addrs.push(addr.toString(this.network)); - } - - return addrs; - } - - async getAddressInfo(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaddressinfo "address"'); - - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const address = parseAddress(addr, this.network); - const script = Script$4.fromAddress(address); - const wallet = this.wallet.toJSON(); - - const path = await this.wallet.getPath(address); - - const isScript = script.isScripthash() || script.isWitnessScripthash(); - const isWitness = address.isProgram(); - - const result = { - address: address.toString(this.network), - scriptPubKey: script ? script.toJSON() : undefined, - ismine: path != null, - ischange: path ? path.branch === 1 : false, - iswatchonly: wallet.watchOnly, - isscript: isScript, - iswitness: isWitness - }; - - if (isWitness) { - result.witness_version = address.version; - result.witness_program = address.hash.toString('hex'); - } - - return result; - } - - async getBalance(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'getbalance ( "account" minconf includeWatchonly )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const minconf = valid.u32(1, 1); - const watchOnly = valid.bool(2, false); - - if (name === '') - name = 'default'; - - if (name === '*') - name = null; - - if (wallet.watchOnly !== watchOnly) - return 0; - - const balance = await wallet.getBalance(name); - - let value; - if (minconf > 0) - value = balance.confirmed; - else - value = balance.unconfirmed; - - return Amount.btc(value, true); - } - - async getNewAddress(args, help) { - if (help || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'getnewaddress ( "account" )'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - - if (name === '' || args.length === 0) - name = 'default'; - - const addr = await wallet.createReceive(name); - - return addr.getAddress('string', this.network); - } - - async getRawChangeAddress(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getrawchangeaddress'); - - const wallet = this.wallet; - const addr = await wallet.createChange(); - - return addr.getAddress('string', this.network); - } - - async getReceivedByAccount(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'getreceivedbyaccount "account" ( minconf )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const minconf = valid.u32(1, 0); - const height = this.wdb.state.height; - - if (name === '') - name = 'default'; - - const paths = await wallet.getPaths(name); - const filter = new BufferSet(); - - for (const path of paths) - filter.add(path.hash); - - const txs = await wallet.getHistory(name); - - let total = 0; - - for (const wtx of txs) { - const conf = wtx.getDepth(height); - - if (conf < minconf) - continue; - - for (const output of wtx.tx.outputs) { - const hash = output.getHash(); - if (hash && filter.has(hash)) - total += output.value; - } - } - - return Amount.btc(total, true); - } - - async getReceivedByAddress(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'getreceivedbyaddress "bitcoinaddress" ( minconf )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - const minconf = valid.u32(1, 0); - const height = this.wdb.state.height; - - const hash = parseHash(addr, this.network); - const txs = await wallet.getHistory(); - - let total = 0; - - for (const wtx of txs) { - if (wtx.getDepth(height) < minconf) - continue; - - for (const output of wtx.tx.outputs) { - // Some transaction outputs don't have scripts with address hashes. - // One example is OP_RETURN data, like a coinbase witness commitment. - const addr = output.getAddress(); - - if (!addr) - continue; - - if (addr.getHash().equals(hash)) - total += output.value; - } - } - - return Amount.btc(total, true); - } - - async _toWalletTX(wtx) { - const wallet = this.wallet; - const details = await wallet.toDetails(wtx); - - if (!details) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - let receive = true; - for (const member of details.inputs) { - if (member.path) { - receive = false; - break; - } - } - - const det = []; - let sent = 0; - let received = 0; - - for (let i = 0; i < details.outputs.length; i++) { - const member = details.outputs[i]; - - if (member.path) { - if (member.path.branch === 1) - continue; - - det.push({ - account: member.path.name, - address: member.address.toString(this.network), - category: 'receive', - amount: Amount.btc(member.value, true), - label: member.path.name, - vout: i - }); - - received += member.value; - - continue; - } - - if (receive) - continue; - - det.push({ - account: '', - address: member.address - ? member.address.toString(this.network) - : null, - category: 'send', - amount: -(Amount.btc(member.value, true)), - fee: -(Amount.btc(details.fee, true)), - vout: i - }); - - sent += member.value; - } - - return { - amount: Amount.btc(receive ? received : -sent, true), - confirmations: details.confirmations, - blockhash: details.block ? util.revHex(details.block) : null, - blockindex: details.index, - blocktime: details.time, - txid: util.revHex(details.hash), - walletconflicts: [], - time: details.mtime, - timereceived: details.mtime, - 'bip125-replaceable': 'no', - details: det, - hex: details.tx.toRaw().toString('hex') - }; - } - - async getTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'gettransaction "txid" ( includeWatchonly )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - const watchOnly = valid.bool(1, false); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter'); - - const wtx = await wallet.getTX(hash); - - if (!wtx) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - return await this._toWalletTX(wtx, watchOnly); - } - - async abandonTransaction(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'abandontransaction "txid"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const result = await wallet.abandon(hash); - - if (!result) - throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.'); - - return null; - } - - async getUnconfirmedBalance(args, help) { - if (help || args.length > 0) - throw new RPCError(errs.MISC_ERROR, 'getunconfirmedbalance'); - - const wallet = this.wallet; - const balance = await wallet.getBalance(); - - return Amount.btc(balance.unconfirmed, true); - } - - async getWalletInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getwalletinfo'); - - const wallet = this.wallet; - const balance = await wallet.getBalance(); - - return { - walletid: wallet.id, - walletversion: 6, - balance: Amount.btc(balance.unconfirmed, true), - unconfirmed_balance: Amount.btc(balance.unconfirmed, true), - txcount: balance.tx, - keypoololdest: 0, - keypoolsize: 0, - unlocked_until: wallet.master.until, - paytxfee: Amount.btc(this.wdb.feeRate, true) - }; - } - - async importPrivKey(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'importprivkey "bitcoinprivkey" ( "label" rescan )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const secret = valid.str(0); - const rescan = valid.bool(2, false); - - const key = parseSecret(secret, this.network); - - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importWallet(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError(errs.MISC_ERROR, 'importwallet "filename" ( rescan )'); - - const wallet = this.wallet; - const valid = new Validator(args); - const file = valid.str(0); - const rescan = valid.bool(1, false); - - if (fs.unsupported) - throw new RPCError(errs.INTERNAL_ERROR, 'FS not available.'); - - let data; - try { - data = await fs.readFile(file, 'utf8'); - } catch (e) { - throw new RPCError(errs.INTERNAL_ERROR, e.code || ''); - } - - const lines = data.split(/\n+/); - const keys = []; - - for (let line of lines) { - line = line.trim(); - - if (line.length === 0) - continue; - - if (/^\s*#/.test(line)) - continue; - - const parts = line.split(/\s+/); - - if (parts.length < 4) - throw new RPCError(errs.DESERIALIZATION_ERROR, 'Malformed wallet.'); - - const secret = parseSecret(parts[0], this.network); - - keys.push(secret); - } - - for (const key of keys) - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importAddress(args, help) { - if (help || args.length < 1 || args.length > 4) { - throw new RPCError(errs.MISC_ERROR, - 'importaddress "address" ( "label" rescan p2sh )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let addr = valid.str(0, ''); - const rescan = valid.bool(2, false); - const p2sh = valid.bool(3, false); - - if (p2sh) { - let script = valid.buf(0); - - if (!script) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameters.'); - - script = Script$4.fromRaw(script); - script = Script$4.fromScripthash(script.hash160()); - - addr = script.getAddress(); - } else { - addr = parseAddress(addr, this.network); - } - - try { - await wallet.importAddress(0, addr); - } catch (e) { - if (e.message !== 'Address already exists.') - throw e; - } - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importPubkey(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'importpubkey "pubkey" ( "label" rescan )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const data = valid.buf(0); - const rescan = valid.bool(2, false); - - if (!data) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const key = KeyRing.fromPublic(data, this.network); - - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async keyPoolRefill(args, help) { - if (help || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'keypoolrefill ( newsize )'); - return null; - } - - async listAccounts(args, help) { - if (help || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'listaccounts ( minconf includeWatchonly)'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const watchOnly = valid.bool(1, false); - - const accounts = await wallet.getAccounts(); - const map = {}; - - for (const account of accounts) { - const balance = await wallet.getBalance(account); - let value = balance.unconfirmed; - - if (minconf > 0) - value = balance.confirmed; - - if (wallet.watchOnly !== watchOnly) - value = 0; - - map[account] = Amount.btc(value, true); - } - - return map; - } - - async listAddressGroupings(args, help) { - throw new Error('Not implemented.'); - } - - async listLockUnspent(args, help) { - if (help || args.length > 0) - throw new RPCError(errs.MISC_ERROR, 'listlockunspent'); - - const wallet = this.wallet; - const outpoints = wallet.getLocked(); - const out = []; - - for (const outpoint of outpoints) { - out.push({ - txid: outpoint.txid(), - vout: outpoint.index - }); - } - - return out; - } - - async listReceivedByAccount(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listreceivedbyaccount ( minconf includeempty includeWatchonly )'); - } - - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const includeEmpty = valid.bool(1, false); - const watchOnly = valid.bool(2, false); - - return await this._listReceived(minconf, includeEmpty, watchOnly, true); - } - - async listReceivedByAddress(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listreceivedbyaddress ( minconf includeempty includeWatchonly )'); - } - - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const includeEmpty = valid.bool(1, false); - const watchOnly = valid.bool(2, false); - - return await this._listReceived(minconf, includeEmpty, watchOnly, false); - } - - async _listReceived(minconf, empty, watchOnly, account) { - const wallet = this.wallet; - const paths = await wallet.getPaths(); - const height = this.wdb.state.height; - - const map = new BufferMap(); - for (const path of paths) { - const addr = path.toAddress(); - map.set(path.hash, { - involvesWatchonly: wallet.watchOnly, - address: addr.toString(this.network), - account: path.name, - amount: 0, - confirmations: -1, - label: '' - }); - } - - const txs = await wallet.getHistory(); - - for (const wtx of txs) { - const conf = wtx.getDepth(height); - - if (conf < minconf) - continue; - - for (const output of wtx.tx.outputs) { - const addr = output.getAddress(); - - if (!addr) - continue; - - const hash = addr.getHash(); - const entry = map.get(hash); - - if (entry) { - if (entry.confirmations === -1 || conf < entry.confirmations) - entry.confirmations = conf; - entry.address = addr.toString(this.network); - entry.amount += output.value; - } - } - } - - let out = []; - for (const entry of map.values()) - out.push(entry); - - if (account) { - const map = new Map(); - - for (const entry of out) { - const item = map.get(entry.account); - if (!item) { - map.set(entry.account, entry); - entry.address = undefined; - continue; - } - item.amount += entry.amount; - } - - out = []; - - for (const entry of map.values()) - out.push(entry); - } - - const result = []; - for (const entry of out) { - if (!empty && entry.amount === 0) - continue; - - if (entry.confirmations === -1) - entry.confirmations = 0; - - entry.amount = Amount.btc(entry.amount, true); - result.push(entry); - } - - return result; - } - - async listSinceBlock(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listsinceblock ( "blockhash" target-confirmations includeWatchonly)'); - } - - const wallet = this.wallet; - const chainHeight = this.wdb.state.height; - const valid = new Validator(args); - const block = valid.brhash(0); - const minconf = valid.u32(1, 0); - const watchOnly = valid.bool(2, false); - - if (wallet.watchOnly !== watchOnly) - return []; - - let height = -1; - - if (block) { - const entry = await this.client.getEntry(block); - if (entry) - height = entry.height; - else - throw new RPCError(errs.MISC_ERROR, 'Block not found.'); - } - - if (height === -1) - height = chainHeight; - - const txs = await wallet.getHistory(); - const out = []; - - let highest = null; - - for (const wtx of txs) { - if (wtx.height < height) - continue; - - if (wtx.getDepth(chainHeight) < minconf) - continue; - - if (!highest || wtx.height > highest) - highest = wtx; - - const json = await this._toListTX(wtx); - - out.push(json); - } - - return { - transactions: out, - lastblock: highest && highest.block - ? util.revHex(highest.block) - : util.revHex(consensus.ZERO_HASH) - }; - } - - async _toListTX(wtx) { - const wallet = this.wallet; - const details = await wallet.toDetails(wtx); - - if (!details) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - let receive = true; - for (const member of details.inputs) { - if (member.path) { - receive = false; - break; - } - } - - let sent = 0; - let received = 0; - let sendMember = null; - let recMember = null; - let sendIndex = -1; - let recIndex = -1; - - for (let i = 0; i < details.outputs.length; i++) { - const member = details.outputs[i]; - - if (member.path) { - if (member.path.branch === 1) - continue; - received += member.value; - recMember = member; - recIndex = i; - continue; - } - - sent += member.value; - sendMember = member; - sendIndex = i; - } - - let member = null; - let index = -1; - - if (receive) { - assert$2(recMember); - member = recMember; - index = recIndex; - } else { - if (sendMember) { - member = sendMember; - index = sendIndex; - } else { - // In the odd case where we send to ourselves. - receive = true; - received = 0; - member = recMember; - index = recIndex; - } - } - - let rbf = false; - - if (wtx.height === -1 && wtx.tx.isRBF()) - rbf = true; - - return { - account: member.path ? member.path.name : '', - address: member.address - ? member.address.toString(this.network) - : null, - category: receive ? 'receive' : 'send', - amount: Amount.btc(receive ? received : -sent, true), - label: member.path ? member.path.name : undefined, - vout: index, - confirmations: details.getDepth(this.wdb.height), - blockhash: details.block ? util.revHex(details.block) : null, - blockindex: -1, - blocktime: details.time, - blockheight: details.height, - txid: util.revHex(details.hash), - walletconflicts: [], - time: details.mtime, - timereceived: details.mtime, - 'bip125-replaceable': rbf ? 'yes' : 'no' - }; - } - - async listTransactions(args, help) { - if (help || args.length > 4) { - throw new RPCError(errs.MISC_ERROR, - 'listtransactions ( "account" count from includeWatchonly)'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const count = valid.u32(1, 10); - const from = valid.u32(2, 0); - const watchOnly = valid.bool(3, false); - - if (wallet.watchOnly !== watchOnly) - return []; - - if (name === '') - name = 'default'; - - const txs = await wallet.getHistory(name); - - common.sortTX(txs); - - const end = from + count; - const to = Math.min(end, txs.length); - const out = []; - - for (let i = from; i < to; i++) { - const wtx = txs[i]; - const json = await this._toListTX(wtx); - out.push(json); - } - - return out; - } - - async listUnspent(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listunspent ( minconf maxconf ["address",...] )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const minDepth = valid.u32(0, 1); - const maxDepth = valid.u32(1, 9999999); - const addrs = valid.array(2); - const height = this.wdb.state.height; - - const map = new BufferSet(); - - if (addrs) { - const valid = new Validator(addrs); - for (let i = 0; i < addrs.length; i++) { - const addr = valid.str(i, ''); - const hash = parseHash(addr, this.network); - - if (map.has(hash)) - throw new RPCError(errs.INVALID_PARAMETER, 'Duplicate address.'); - - map.add(hash); - } - } - - const coins = await wallet.getCoins(); - - common.sortCoins(coins); - - const out = []; - - for (const coin of coins) { - const depth = coin.getDepth(height); - - if (depth < minDepth || depth > maxDepth) - continue; - - const addr = coin.getAddress(); - - if (!addr) - continue; - - const hash = coin.getHash(); - - if (addrs) { - if (!hash || !map.has(hash)) - continue; - } - - const ring = await wallet.getKey(hash); - - out.push({ - txid: coin.txid(), - vout: coin.index, - address: addr ? addr.toString(this.network) : null, - account: ring ? ring.name : undefined, - redeemScript: ring && ring.script - ? ring.script.toJSON() - : undefined, - scriptPubKey: coin.script.toJSON(), - amount: Amount.btc(coin.value, true), - confirmations: depth, - spendable: !wallet.isLocked(coin), - solvable: true - }); - } - - return out; - } - - async lockUnspent(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'lockunspent unlock ([{"txid":"txid","vout":n},...])'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const unlock = valid.bool(0, false); - const outputs = valid.array(1); - - if (args.length === 1) { - if (unlock) - wallet.unlockCoins(); - return true; - } - - if (!outputs) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - for (const output of outputs) { - const valid = new Validator(output); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - - if (hash == null || index == null) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter.'); - - const outpoint = new Outpoint$1(hash, index); - - if (unlock) { - wallet.unlockCoin(outpoint); - continue; - } - - wallet.lockCoin(outpoint); - } - - return true; - } - - async move(args, help) { - // Not implementing: stupid and deprecated. - throw new Error('Not implemented.'); - } - - async sendFrom(args, help) { - if (help || args.length < 3 || args.length > 6) { - throw new RPCError(errs.MISC_ERROR, - 'sendfrom "fromaccount" "tobitcoinaddress"' - + ' amount ( minconf "comment" "comment-to" )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const str = valid.str(1); - const value = valid.ufixed(2, 8); - const minconf = valid.u32(3, 0); - - const addr = parseAddress(str, this.network); - - if (!addr || value == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - if (name === '') - name = 'default'; - - const options = { - account: name, - depth: minconf, - outputs: [{ - address: addr, - value: value - }] - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async sendMany(args, help) { - if (help || args.length < 2 || args.length > 5) { - throw new RPCError(errs.MISC_ERROR, - 'sendmany "fromaccount" {"address":amount,...}' - + ' ( minconf "comment" subtractfee )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const sendTo = valid.obj(1); - const minconf = valid.u32(2, 1); - const subtract = valid.bool(4, false); - - if (name === '') - name = 'default'; - - if (!sendTo) - throw new RPCError(errs.TYPE_ERROR, 'Invalid send-to address.'); - - const to = new Validator(sendTo); - const uniq = new BufferSet(); - const outputs = []; - - for (const key of Object.keys(sendTo)) { - const value = to.ufixed(key, 8); - const addr = parseAddress(key, this.network); - const hash = addr.getHash(); - - if (value == null) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid amount.'); - - if (uniq.has(hash)) - throw new RPCError(errs.INVALID_PARAMETER, - 'Each send-to address must be unique.'); - - uniq.add(hash); - - const output = new Output(); - output.value = value; - output.script.fromAddress(addr); - outputs.push(output); - } - - const options = { - outputs: outputs, - subtractFee: subtract, - account: name, - depth: minconf - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async sendToAddress(args, help) { - if (help || args.length < 2 || args.length > 5) { - throw new RPCError(errs.MISC_ERROR, - 'sendtoaddress "bitcoinaddress" amount' - + ' ( "comment" "comment-to" subtractfeefromamount )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const str = valid.str(0); - const value = valid.ufixed(1, 8); - const subtract = valid.bool(4, false); - - const addr = parseAddress(str, this.network); - - if (!addr || value == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const options = { - subtractFee: subtract, - outputs: [{ - address: addr, - value: value - }] - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async setAccount(args, help) { - // Impossible to implement in bcoin: - throw new Error('Not implemented.'); - } - - async setTXFee(args, help) { - const valid = new Validator(args); - const rate = valid.ufixed(0, 8); - - if (help || args.length < 1 || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'settxfee amount'); - - if (rate == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - this.wdb.feeRate = rate; - - return true; - } - - async signMessage(args, help) { - if (help || args.length !== 2) { - throw new RPCError(errs.MISC_ERROR, - 'signmessage "bitcoinaddress" "message"'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const b58 = valid.str(0, ''); - const str = valid.str(1, ''); - - const addr = parseHash(b58, this.network); - - const ring = await wallet.getKey(addr); - - if (!ring) - throw new RPCError(errs.WALLET_ERROR, 'Address not found.'); - - if (!wallet.master.key) - throw new RPCError(errs.WALLET_UNLOCK_NEEDED, 'Wallet is locked.'); - - const sig = messageUtil.sign(str, ring); - - return sig.toString('base64'); - } - - async walletLock(args, help) { - const wallet = this.wallet; - - if (help || (wallet.master.encrypted && args.length !== 0)) - throw new RPCError(errs.MISC_ERROR, 'walletlock'); - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - await wallet.lock(); - - return null; - } - - async walletPassphraseChange(args, help) { - const wallet = this.wallet; - - if (help || (wallet.master.encrypted && args.length !== 2)) { - throw new RPCError(errs.MISC_ERROR, 'walletpassphrasechange' - + ' "oldpassphrase" "newpassphrase"'); - } - - const valid = new Validator(args); - const old = valid.str(0, ''); - const passphrase = valid.str(1, ''); - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - if (old.length < 1 || passphrase.length < 1) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter'); - - await wallet.setPassphrase(passphrase, old); - - return null; - } - - async walletPassphrase(args, help) { - const wallet = this.wallet; - const valid = new Validator(args); - const passphrase = valid.str(0, ''); - const timeout = valid.u32(1); - - if (help || (wallet.master.encrypted && args.length !== 2)) { - throw new RPCError(errs.MISC_ERROR, - 'walletpassphrase "passphrase" timeout'); - } - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - if (passphrase.length < 1) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter'); - - if (timeout == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter'); - - await wallet.unlock(passphrase, timeout); - - return null; - } - - async importPrunedFunds(args, help) { - if (help || args.length !== 2) { - throw new RPCError(errs.MISC_ERROR, - 'importprunedfunds "rawtransaction" "txoutproof"'); - } - - const valid = new Validator(args); - const txRaw = valid.buf(0); - const blockRaw = valid.buf(1); - - if (!txRaw || !blockRaw) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const tx = TX.fromRaw(txRaw); - const block = MerkleBlock.fromRaw(blockRaw); - const hash = block.hash(); - - if (!block.verify()) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - if (!block.hasTX(tx.hash())) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - const entry = await this.client.getEntry(hash); - - if (!entry) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - const meta = BlockMeta.fromEntry(entry); - - if (!await this.wdb.addTX(tx, meta)) - throw new RPCError(errs.WALLET_ERROR, - 'Address for TX not in wallet, or TX already in wallet'); - - return null; - } - - async removePrunedFunds(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'removeprunedfunds "txid"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - if (!await wallet.remove(hash)) - throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.'); - - return null; - } - - async selectWallet(args, help) { - const valid = new Validator(args); - const id = valid.str(0); - - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'selectwallet "id"'); - - const wallet = await this.wdb.get(id); - - if (!wallet) - throw new RPCError(errs.WALLET_ERROR, 'Wallet not found.'); - - this.wallet = wallet; - - return null; - } - - async getMemoryInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getmemoryinfo'); - - return this.logger.memoryUsage(); - } - - async setLogLevel(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'setloglevel "level"'); - - const valid = new Validator(args); - const level = valid.str(0, ''); - - this.logger.setLevel(level); - - return null; - } - } - - /* - * Helpers - */ - - function parseHash(raw, network) { - const addr = parseAddress(raw, network); - return addr.getHash(); - } - - function parseAddress(raw, network) { - try { - return Address$1.fromString(raw, network); - } catch (e) { - throw new RPCError(errs.INVALID_ADDRESS_OR_KEY, 'Invalid address.'); - } - } - - function parseSecret(raw, network) { - try { - return KeyRing.fromSecret(raw, network); - } catch (e) { - throw new RPCError(errs.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - } - } - - /* - * Expose - */ - - var rpc = RPC$1; - - /*! - * plugin.js - wallet plugin for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - (function (exports) { - - const EventEmitter = require$$1__default$1["default"]; - const WalletDB = walletdb; - const NodeClient = nodeclient; - const HTTP = http; - const RPC = rpc; - - /** - * @exports wallet/plugin - */ - - const plugin = exports; - - /** - * Plugin - * @extends EventEmitter - */ - - class Plugin extends EventEmitter { - /** - * Create a plugin. - * @constructor - * @param {Node} node - */ - - constructor(node) { - super(); - - this.config = node.config.filter('wallet'); - - if (node.config.options.file) - this.config.open('wallet.conf'); - - this.network = node.network; - this.logger = node.logger; - - this.client = new NodeClient(node); - - this.wdb = new WalletDB({ - network: this.network, - logger: this.logger, - workers: this.workers, - client: this.client, - prefix: this.config.prefix, - memory: this.config.bool('memory', node.memory), - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - witness: this.config.bool('witness'), - wipeNoReally: this.config.bool('wipe-no-really'), - spv: node.spv - }); - - this.rpc = new RPC(this); - - this.http = new HTTP({ - network: this.network, - logger: this.logger, - node: this, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key', node.config.str('api-key')), - walletAuth: this.config.bool('wallet-auth'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - adminToken: this.config.str('admin-token') - }); - - this.init(); - } - - init() { - this.wdb.on('error', err => this.emit('error', err)); - this.http.on('error', err => this.emit('error', err)); - } - - async open() { - await this.wdb.open(); - this.rpc.wallet = this.wdb.primary; - await this.http.open(); - } - - async close() { - await this.http.close(); - this.rpc.wallet = null; - await this.wdb.close(); - } - } - - /** - * Plugin name. - * @const {String} - */ - - plugin.id = 'walletdb'; - - /** - * Plugin initialization. - * @param {Node} node - * @returns {WalletDB} - */ - - plugin.init = function init(node) { - return new Plugin(node); - }; - }(plugin)); - - /*! - * server.js - wallet server for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - const assert$1 = assert_1$g; - const Node = node$1; - const WalletDB$1 = walletdb; - const HTTP = http; - const Client = client; - const RPC = rpc; - - /** - * Wallet Node - * @extends Node - */ - - class WalletNode extends Node { - /** - * Create a wallet node. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super('bcoin', 'wallet.conf', 'wallet.log', options); - - this.opened = false; - - this.client = new Client({ - network: this.network, - url: this.config.str('node-url'), - host: this.config.str('node-host'), - port: this.config.uint('node-port', this.network.rpcPort), - ssl: this.config.bool('node-ssl'), - apiKey: this.config.str('node-api-key') - }); - - this.wdb = new WalletDB$1({ - network: this.network, - logger: this.logger, - workers: this.workers, - client: this.client, - prefix: this.config.prefix, - memory: this.config.bool('memory'), - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - witness: this.config.bool('witness'), - wipeNoReally: this.config.bool('wipe-no-really'), - spv: this.config.bool('spv') - }); - - this.rpc = new RPC(this); - - this.http = new HTTP({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - walletAuth: this.config.bool('wallet-auth'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - adminToken: this.config.str('admin-token') - }); - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - this.wdb.on('error', err => this.error(err)); - this.http.on('error', err => this.error(err)); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @returns {Promise} - */ - - async open() { - assert$1(!this.opened, 'WalletNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.wdb.open(); - - this.rpc.wallet = this.wdb.primary; - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Wallet node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @returns {Promise} - */ - - async close() { - assert$1(this.opened, 'WalletNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - await this.closePlugins(); - - this.rpc.wallet = null; - - await this.wdb.close(); - await this.handleClose(); - } - } - - /* - * Expose - */ - - var node = WalletNode; - - /*! - * wallet/index.js - wallet for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module wallet - */ - - wallet$2.Account = account; - wallet$2.Client = client; - wallet$2.common = common$5; - wallet$2.HTTP = http; - wallet$2.layout = layout$2; - wallet$2.MasterKey = masterkey; - wallet$2.NodeClient = nodeclient; - wallet$2.Path = path$3; - wallet$2.plugin = plugin; - wallet$2.records = records$2.exports; - wallet$2.RPC = rpc; - wallet$2.Node = node; - wallet$2.TXDB = txdb; - wallet$2.WalletDB = walletdb; - wallet$2.Wallet = wallet$1; - wallet$2.WalletKey = walletkey; - - var workers = {}; - - /*! - * workers/index.js - workers for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - /** - * @module workers - */ - - workers.Framer = framer; - workers.jobs = jobs$1; - workers.packets = packets$2; - workers.Parser = parser$1; - workers.WorkerPool = workerpool; - - /*! - * bcoin.js - a javascript bitcoin library. - * Copyright (c) 2014-2015, Fedor Indutny (MIT License). - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - - (function (exports) { - - /** - * A bcoin "environment" which exposes all - * constructors for primitives, the blockchain, - * mempool, wallet, etc. It also exposes a - * global worker pool. - * - * @exports bcoin - * @type {Object} - */ - - const bcoin = exports; - - /** - * Set the default network. - * @param {String} network - */ - - bcoin.set = function set(network) { - bcoin.Network.set(network); - return bcoin; - }; - - /* - * Expose - */ - - // Blockchain - bcoin.blockchain = blockchain; - bcoin.Chain = chain$1; - bcoin.ChainEntry = chainentry; - - // BTC - bcoin.btc = btc; - bcoin.Amount = amount; - bcoin.URI = uri; - - // Client - bcoin.client = client$2; - bcoin.NodeClient = node$3; - bcoin.WalletClient = wallet$3; - - // Coins - bcoin.coins = coins; - bcoin.Coins = coins$1; - bcoin.CoinEntry = coinentry; - bcoin.CoinView = coinview; - - // HD - bcoin.hd = hd; - bcoin.HDPrivateKey = _private; - bcoin.HDPublicKey = _public; - bcoin.Mnemonic = mnemonic; - - // Index - bcoin.indexer = indexer$1; - bcoin.Indexer = indexer; - bcoin.TXIndexer = txindexer; - bcoin.AddrIndexer = addrindexer$1; - - // Mempool - bcoin.mempool = mempool$1; - bcoin.Fees = fees; - bcoin.Mempool = mempool; - bcoin.MempoolEntry = mempoolentry; - - // Miner - bcoin.mining = mining; - bcoin.Miner = miner; - - // Net - bcoin.net = net$3; - bcoin.packets = packets$6; - bcoin.Peer = peer$1; - bcoin.Pool = pool; - - // Node - bcoin.node = node$2; - bcoin.Node = node$1; - bcoin.FullNode = fullnode; - bcoin.SPVNode = spvnode; - - // Primitives - bcoin.primitives = primitives; - bcoin.Address = address$1; - bcoin.Block = block$1; - bcoin.Coin = coin; - bcoin.Headers = headers; - bcoin.Input = input; - bcoin.InvItem = invitem; - bcoin.KeyRing = keyring; - bcoin.MerkleBlock = merkleblock; - bcoin.MTX = mtx$1.exports; - bcoin.Outpoint = outpoint; - bcoin.Output = output; - bcoin.TX = tx; - - // Protocol - bcoin.protocol = protocol; - bcoin.consensus = consensus$s; - bcoin.Network = network; - bcoin.networks = networks$1; - bcoin.policy = policy$9; - - // Script - bcoin.script = script$1; - bcoin.Opcode = opcode$1; - bcoin.Program = program$1; - bcoin.Script = script$2; - bcoin.ScriptNum = scriptnum; - bcoin.SigCache = sigcache; - bcoin.Stack = stack; - bcoin.Witness = witness; - - // Utils - bcoin.utils = utils; - bcoin.util = util$y; - - // Wallet - bcoin.wallet = wallet$2; - bcoin.WalletDB = walletdb; - - // Workers - bcoin.workers = workers; - bcoin.WorkerPool = workerpool; - - // Package Info - bcoin.pkg = pkg$4; - }(bcoinBrowser)); - - const config = require$$0$1; - const merge$3 = lodash_merge.exports; - - // External Dependencies - const BN = bn$2.exports; - - // Types - const Actor$5 = actor; - const EncryptedPromise = promise; - const Collection$3 = collection$1; - const Consensus = consensus$t; - const Channel = channel; - const Hash256 = hash256$l; - const Service$7 = service_1; - const Secret = secret; - const State$3 = state$2; - - // Bcoin - // For the browser... - // const bcoin = require('bcoin/lib/bcoin-browser'); - // For the node... - const bcoin = bcoinBrowser; - - // TODO: most of these should be converted to use Consensus, - // provided above. Refactor these to use `this.provider` or - // `this.consensus` for maximum portability. - // ATTN: @martindale - // Convenience classes... - const Address = bcoin.Address; - const Coin = bcoin.Coin; - const WalletDB = bcoin.WalletDB; - bcoin.wallet.WalletKey; - const Outpoint = bcoin.Outpoint; - bcoin.Output; - bcoin.wallet.WalletKey; - const Mnemonic = bcoin.hd.Mnemonic; - bcoin.hd; - const MTX = bcoin.MTX; - const Script$3 = bcoin.Script; - - /** - * Manage keys and track their balances. - * @property {String} id Unique identifier for this {@link Wallet}. - * @type {Object} - */ - class Wallet$2 extends Service$7 { - /** - * Create an instance of a {@link Wallet}. - * @param {Object} [settings={}] Configure the wallet. - * @param {Number} [settings.verbosity=2] One of: 0 (none), 1 (error), 2 (warning), 3 (notice), 4 (debug), 5 (audit) - * @param {Object} [settings.key] Key to restore from. - * @param {String} [settings.key.seed] Mnemonic seed for a restored wallet. - * @return {Wallet} Instance of the wallet. - */ - constructor (settings = {}) { - super(settings); - - // Create a Marshalling object - this.marshall = { - agents: [], - collections: { - transactions: null, // not yet loaded, seek for Buffer, - orders: null - } - }; - - this.settings = merge$3({ - name: 'primary', - network: config.network, - language: config.language, - locktime: 144, - decimals: 8, - shardsize: 4, - verbosity: 2, - witness: true, - key: null - }, settings); - - bcoin.set(this.settings.network); - - this.database = new WalletDB({ - network: 'regtest' - }); - - this.account = null; - this.manager = null; - this.wallet = null; - this.master = null; - this.ring = null; - this.seed = null; - this.key = null; - - // TODO: enable wordlist translations - // this.words = Mnemonic.getWordlist(this.settings.language).words; - this.mnemonic = null; - this.index = 0; - - this.accounts = new Collection$3(); - this.addresses = new Collection$3(); - this.keys = new Collection$3(); - this.coins = new Collection$3(); - this.secrets = new Collection$3({ - methods: { - create: this._prepareSecret.bind(this) - } - }); - - this.transactions = new Collection$3(); - this.txids = new Collection$3(); - this.outputs = new Collection$3(); - - this.entity = new Actor$5(this.settings); - this.consensus = new Consensus(); - - // Internal State - this._state = merge$3(this._state, { - actors: {}, - asset: this.settings.asset || null, - balances: { - confirmed: 0, - unconfirmed: 0 - }, - space: {}, // tracks addresses in shard - keys: {}, - services: {}, - status: 'PAUSED', - transactions: {}, - orders: {}, - outputs: {} - }); - - Object.defineProperty(this, 'database', { enumerable: false }); - // TODO: remove these - Object.defineProperty(this, 'accounts', { enumerable: false }); - Object.defineProperty(this, 'addresses', { enumerable: false }); - Object.defineProperty(this, 'utxos', { enumerable: false }); - Object.defineProperty(this, 'keys', { enumerable: false }); - Object.defineProperty(this, 'outputs', { enumerable: false }); - Object.defineProperty(this, 'secrets', { enumerable: false }); - Object.defineProperty(this, 'swarm', { enumerable: false }); - Object.defineProperty(this, 'transactions', { enumerable: false }); - Object.defineProperty(this, 'wallet', { enumerable: false }); - - return this; - } - - get balance () { - return this.get('/balances/confirmed'); - } - - get orders () { - return this.get('/orders'); - } - - trust (emitter) { - const wallet = this; - const listener = emitter.on('message', this._handleGenericMessage.bind(this)); - - // Keep track of all event handlers - this.marshall.agents.push(listener); - - emitter.on('transaction', async function trustedHandler (msg) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Received transaction from trusted event emitter:', msg); - await wallet.addTransactionToWallet(msg); - }); - - return this; - } - - _handleGenericMessage (msg) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Received message from trusted event emitter:', msg); - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:WALLET]', 'Trusted emitter gave us:', msg); - - // TODO: bind @fabric/core/services/bitcoin to addresses on wallet... - // ATTN: Eric - - // TODO: update channels - // TODO: parse as {@link Message} - // TODO: store in this.messages - switch (msg['@type']) { - case 'ServiceMessage': - return this._processServiceMessage(msg['@data']); - default: - return console.warn('[FABRIC:WALLET]', `Unhandled message type: ${msg['@type']}`); - } - } - - async _processServiceMessage (msg) { - switch (msg['@type']) { - case 'BitcoinBlock': - this.processBitcoinBlock(msg['@data']); - break; - case 'BitcoinTransaction': - // TODO: validate destination is this wallet - this.addTransactionToWallet(msg['@data']); - break; - default: - return console.warn('[FABRIC:WALLET]', `Unhandled message type: ${msg['@type']}`); - } - } - - async processBitcoinBlock (block) { - if (this.settings.verbosity >= 4) console.log('[FABRIC:WALLET]', 'Processing block:', block); - if (!block.block) return 0; - for (let i = 0; i < block.block.hashes.length; i++) { - const txid = block.block.hashes[i].toString('hex'); - // ATTN: Eric - // TODO: process transaction - console.log('found txid in block:', txid); - } - } - - async _attachTXID (txid) { - // TODO: check that `txid` is a proper TXID - let txp = await this.txids.create(txid); - if (this.settings.verbosity >= 5) console.log('[AUDIT]', `Attached TXID ${txid} to Wallet ID ${this.id}, result:`, txp); - return txp; - } - - async _handleFabricTransaction (tx) { - console.log('[FABRIC:WALLET]', 'Handling Fabric Transaction:', tx); - } - - async addTransactionToWallet (transaction) { - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:WALLET]', 'Adding transaction to Wallet:', transaction); - let entity = new Actor$5(transaction); - if (!transaction.spent) transaction.spent = false; - if (!transaction.outputs) transaction.outputs = []; - this._state.transactions.push(transaction); - await this.commit(); - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Wallet transactions now:', this._state.transactions); - - for (let i = 0; i < transaction.outputs.length; i++) { - let output = transaction.outputs[i].toJSON(); - let address = await this._findAddressInCurrentShard(output.address); - - // TODO: test these outputs - // console.log('output to parse:', output); - // console.log('address found:', address); - - if (address) { - this._state.outputs.push(output); - this._state.utxos.push(new Coin(transaction.outputs[i])); - this.emit('payment', { - '@type': 'WalletPayment', - '@data': { - id: entity.id, - transaction: transaction - } - }); - } - - /* switch (output.type) { - default: - console.warn('[FABRIC:WALLET]', 'Unhandled output type:', output.type); - break; - case 'pubkeyhash': - let address = await this._findAddressInCurrentShard(output.address); - break; - } */ - } - - await this.commit(); - } - - async _findAddressInCurrentShard (address) { - for (let i = 0; i < this.shard.length; i++) { - let slice = this.shard[i]; - if (slice.string === address) return slice; - } - return null; - } - - async _createMultisigAddress (m, n, keys) { - let result = null; - - // Check for required fields - if (!m) throw new Error('Parameter 0 required: m'); - if (!m) throw new Error('Parameter 1 required: n'); - if (!keys || !keys.length) throw new Error('Parameter 2 required: keys'); - - try { - // Compose the address - const multisig = Script$3.fromMultisig(m, n, keys); - const address = multisig.getAddress().toBase58(this.settings.network); - - // TODO: remove this audit message - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Created multisig address:', address); - - // Assign to output - result = address; - } catch (exception) { - console.error('[FABRIC:WALLET]', 'Could not create multisig address:', exception); - } - - return result; - } - - async _spendToAddress (amount, address) { - const mtx = new MTX(); - const change = await this.wallet.receiveAddress(); - const coins = await this.wallet.getCoins(); - - this.emit('log', `Amount to send: ${amount}`); - - mtx.addOutput({ - address: recipient, - value: parseInt(amount) - }); - - await mtx.fund(coins, { - rate: 10, - changeAddress: change - }); - - mtx.sign(this.ring); - const tx = mtx.toTX(); - tx.check(mtx.view); - - return tx; - } - - async _getUnspentOutput (amount) { - if (!this._state.utxos.length) throw new Error('No available funds.'); - // TODO: use coin selection - const mtx = new MTX(); - - // Send 10,000 satoshis to ourself. - mtx.addOutput({ - address: this.ring.getAddress(), - value: amount - }); - - await mtx.fund(this._state.utxos, { - // Use a rate of 10,000 satoshis per kb. - // With the `fullnode` object, you can - // use the fee estimator for this instead - // of blindly guessing. - rate: 10000, - // Send the change back to ourselves. - changeAddress: this.ring.getAddress() - }); - // TODO: use the MTX to select outputs - - return this._state.utxos[0]; - } - - /** - * Returns a bech32 address for the provided {@link Script}. - * @param {Script} script - */ - getAddressForScript (script) { - // TODO: use Fabric.Script - let p2wsh = script.forWitness(); - let address = p2wsh.getAddress().toBech32(this.settings.network); - return address; - } - - /** - * Generate a {@link BitcoinAddress} for the supplied {@link BitcoinScript}. - * @param {BitcoinScript} redeemScript - */ - getAddressFromRedeemScript (redeemScript) { - if (!redeemScript) return null; - return Address.fromScripthash(redeemScript.hash160()); - } - - /** - * Create a priced order. - * @param {Object} order - * @param {Object} order.asset - * @param {Object} order.amount - */ - async createPricedOrder (order) { - if (!order.asset) throw new Error('Order parameter "asset" is required.'); - if (!order.amount) throw new Error('Order parameter "amount" is required.'); - - order.amount % (10 * this.settings.decimals); - let parts = order.amount / (10 * this.settings.decimals); - - let partials = []; - // TODO: remove short-circuit - await this._generateFakeCoinbase(order.amount); - new MTX(); - let script = new Script$3(); - - let secret = await this.generateSecret(); - let image = Buffer.from(secret.hash); - - console.log('secret generated:', secret); - console.log('image of secret:', image); - - let refund = await this.ring.getPublicKey(); - console.log('refund:', refund); - - script.pushSym('OP_IF'); - script.pushSym('OP_SHA256'); - script.pushData(image); - script.pushSym('OP_EQUALVERIFY'); - script.pushData(order.counterparty); - script.pushSym('OP_ELSE'); - script.pushInt(this.settings.locktime); - script.pushSym('OP_CHECKSEQUENCEVERIFY'); - script.pushSym('OP_DROP'); - script.pushData(refund); - script.pushSym('OP_ENDIF'); - script.pushSym('OP_CHECKSIG'); - script.compile(); - - // TODO: complete order construction - for (let i = 0; i < parts; i++) { - // TODO: should be split parts - partials.push(script); - } - - let entity = new Actor$5({ - comment: 'List of transactions to validate.', - orders: partials, - transactions: partials - }); - - return entity; - } - - async createHTLC (contract) { - // if (!contract.asset) throw new Error('Contract parameter "asset" is required.'); - if (!contract.amount) throw new Error('Contract parameter "amount" is required.'); - // TODO: remove short-circuit - if (!contract.counterparty) { - // TODO: replace this with a randomly-generated input - // sha256 - // -> pubkey - contract.counterparty = await this.ring.getPublicKey(); - console.log('contract counterparty artificially generated:', contract.counterparty); - } - - let leftover = contract.amount % this.settings.decimals; - let parts = contract.amount / this.settings.decimals; - - let partials = []; - // TODO: remove short-circuit - await this._generateFakeCoinbase(contract.amount); - new MTX(); - let script = new Script$3(); - - let secret = await this.generateSecret(); - let image = Buffer.from(secret.hash); - - console.log('secret generated:', secret); - console.log('image of secret:', image); - - let refund = await this.ring.getPublicKey(); - console.log('refund:', refund); - - script.pushSym('OP_IF'); - script.pushSym('OP_SHA256'); - script.pushData(image); - script.pushSym('OP_EQUALVERIFY'); - script.pushData(contract.counterparty); - script.pushSym('OP_ELSE'); - script.pushInt(this.settings.locktime); - script.pushSym('OP_CHECKSEQUENCEVERIFY'); - script.pushSym('OP_DROP'); - script.pushData(refund); - script.pushSym('OP_ENDIF'); - script.pushSym('OP_CHECKSIG'); - script.compile(); - - // TODO: complete order construction - for (let i = 0; i < parts; i++) { - // TODO: should be split parts - partials.push(script); - } - - console.log('parts:', partials); - console.log('leftover:', leftover); - - let entity = new Actor$5({ - comment: 'List of transactions to validate.', - orders: partials, - transactions: partials, - type: 'BitcoinTransaction' - }); - - return entity; - } - - async generateSecret () { - const secret = new Secret(); - const entity = await this.secrets.create({ - hash: secret.hash - }); - console.log('created secret:', entity); - return entity; - } - - async generateSignedTransactionTo (address, amount) { - if (!address) throw new Error(`Parameter "address" is required.`); - if (!amount) throw new Error(`Parameter "amount" is required.`); - - new BN(amount + '', 10); - // TODO: labeled keypairs - await this.generateCleanKeyPair(); - let change = await this.generateCleanKeyPair(); - - let mtx = new MTX(); - await this._generateFakeCoinbase(amount); - - mtx.addOutput({ - address: address, - amount: amount - }); - - await mtx.fund(this._state.utxos, { - rate: 10000, // TODO: fee calculation - changeAddress: change.address - }); - - mtx.sign(this.ring); - // mtx.signInput(0, this.ring); - - let tx = mtx.toTX(); - let output = Coin.fromTX(mtx, 0, -1); - let raw = mtx.toRaw(); - let hash = Hash256.digest(raw.toString('hex')); - - return { - type: 'BitcoinTransaction', - data: { - tx: tx, - output: output, - raw: raw.toString('hex'), - hash: hash - } - }; - } - - async generateOrderRootTo (pubkey, amount) { - if (!pubkey) throw new Error(`Parameter "pubkey" is required.`); - if (!amount) throw new Error(`Parameter "amount" is required.`); - - new BN(amount + '', 10); - // TODO: labeled keypairs - await this.generateCleanKeyPair(); - let change = await this.generateCleanKeyPair(); - - let mtx = new MTX(); - await this._generateFakeCoinbase(amount); - - mtx.addOutput({ - address: address, - amount: amount - }); - - await mtx.fund(this._state.utxos, { - rate: 10000, // TODO: fee calculation - changeAddress: change.address - }); - - mtx.sign(this.ring); - // mtx.signInput(0, this.ring); - - let tx = mtx.toTX(); - let output = null; - - try { - output = Coin.fromTX(mtx, 0, -1); - } catch (exception) { - console.error('[FABRIC:WALLET]', 'Could not generate output:', exception); - } - - let raw = mtx.toRaw(); - let hash = Hash256.digest(raw.toString('hex')); - - return { - type: 'BitcoinTransaction', - data: { - tx: tx, - output: output, - raw: raw.toString('hex'), - hash: hash - } - }; - } - - addInputForCrowdfund (coin, inputIndex, mtx, keyring, hashType) { - let sampleCoin = coin instanceof Coin ? coin : Coin.fromJSON(coin); - if (!hashType) hashType = Script$3.hashType.ANYONECANPAY | Script$3.hashType.ALL; - - mtx.addCoin(sampleCoin); - mtx.scriptInput(inputIndex, sampleCoin, keyring); - mtx.signInput(inputIndex, sampleCoin, keyring, hashType); - - console.log('MTX after Input added (and signed):', mtx); - - // TODO: return a full object for Fabric - return mtx; - } - - balanceFromState (state) { - if (!state.transactions) throw new Error('State does not provide a `transactions` property.'); - if (!state.transactions.length) return 0; - return state.transactions.reduce((acc, obj, i) => { - if (!acc.value) acc.value = 0; - acc.value += obj.value; - }); - } - - getFeeForInput (coin, address, keyring, rate) { - let testMTX = new MTX(); - - // TODO: restore swap code, abstract input types - // this.addInputForCrowdfund(coin, 0, testMTX, this.keyring); - - return testMTX.getMinFee(null, rate); - } - - async _createAccount (data) { - // console.log('wallet creating account with data:', data); - await this._load(); - let existing = await this.wallet.getAccount(data.name); - if (existing) return existing; - let account = await this.wallet.createAccount(data); - return account; - } - - async _updateBalance (amount) { - return this.set('/balances/confirmed', amount); - } - - _handleWalletTransaction (tx) { - console.log('[BRIDGE:WALLET]', 'incoming transaction:', tx); - } - - _getDepositAddress () { - return this.ring.getAddress().toString(); - } - - _getSeed () { - return this.seed; - } - - _getAccountByIndex (index = 0) { - return { - address: this.account.deriveReceive(index).getAddress('string') - }; - } - - async _splitCoinbase (funderKeyring, coin, targetAmount, txRate) { - // loop through each coinbase coin to split - let coins = []; - - const mtx = new MTX(); - - assert(coin.value > targetAmount, 'coin value is not enough!'); - - // creating a transaction that will have an output equal to what we want to fund - mtx.addOutput({ - address: funderKeyring.getAddress(), - value: targetAmount - }); - - // the fund method will automatically split - // the remaining funds to the change address - // Note that in a real application these splitting transactions will also - // have to be broadcast to the network - await mtx.fund([coin], { - rate: txRate, - // send change back to an address belonging to the funder - changeAddress: funderKeyring.getAddress() - }).then(() => { - // sign the mtx to finalize split - mtx.sign(funderKeyring); - assert(mtx.verify()); - - const tx = mtx.toTX(); - assert(tx.verify(mtx.view)); - - const outputs = tx.outputs; - - // get coins from tx - outputs.forEach((outputs, index) => { - coins.push(Coin.fromTX(tx, index, -1)); - }); - }).catch(e => console.log('There was an error: ', e)); - - return coins; - } - - async composeCrowdfund (coins) { - // Loop through each coinbase - for (let index in coins) { - const coinbase = coins[index][0]; - // estimate fee for each coin (assuming their split coins will use same tx type) - const estimatedFee = getFeeForInput(coinbase, fundeeAddress, funders[index], txRate); - const targetPlusFee = amountToFund + estimatedFee; - - // split the coinbase with targetAmount plus estimated fee - await Utils.splitCoinbase(funders[index], coinbase, targetPlusFee, txRate); - } - // ... we'll keep filling out the rest of the code here - } - - async _addOutputToSpendables (coin) { - this._state.utxos.push(coin); - return this; - } - - async getUnusedAddress () { - let clean = await this.wallet.receiveAddress(); - this.emit('log', `unused address: ${clean}`); - return clean; - } - - async getUnspentTransactionOutputs () { - return this._state.transactions.filter(x => { - return (x.spent === 0); - }); - } - - async _generateFakeCoinbase (amount = 1) { - // TODO: use Satoshis for all calculations - new BN(amount, 10); - - // TODO: remove all fake coinbases - // TODO: remove all short-circuits - // fake coinbase - let cb = new MTX(); - let clean = await this.generateCleanKeyPair(); - - // Coinbase Input - cb.addInput({ - prevout: new Outpoint(), - script: new Script$3(), - sequence: 0xffffffff - }); - - // Add Output to pay ourselves - cb.addOutput({ - address: clean.address, - value: 5000000000 - }); - - // TODO: remove short-circuit - let coin = Coin.fromTX(cb, 0, -1); - cb.toTX(); - - // TODO: remove entirely, test short-circuit removal - // await this._addOutputToSpendables(coin); - - return { - type: 'BitcoinTransactionOutput', - data: { - tx: cb, - coin: coin - } - }; - } - - async _getFreeCoinbase (amount = 1) { - let num = new BN(amount, 10); - let max = new BN('5000000000000', 10); // upper limit per coinbase - let hun = new BN('100000000', 10); // one hundred million - let value = num.mul(hun); // amount in Satoshis - - if (value.gt(max)) { - console.warn('Value (in satoshis) higher than max:', value.toString(10), `(max was ${max.toString(10)})`); - value = max; - } - - let v = value.toString(10); - let w = parseInt(v); - - await this._load(); - const coinbase = new MTX(); - - // INSERT 1 Input - coinbase.addInput({ - prevout: new Outpoint(), - script: new Script$3(), - sequence: 0xffffffff - }); - - try { - // INSERT 1 Output - coinbase.addOutput({ - address: this._getDepositAddress(), - value: w - }); - } catch (E) { - console.error('Could not add output:', E); - } - - // TODO: wallet._getSpendableOutput() - let coin = Coin.fromTX(coinbase, 0, -1); - this._state.utxos.push(coin); - - // console.log('coinbase:', coinbase); - - return coinbase; - } - - /** - * Signs a transaction with the keyring. - * @param {BcoinTX} tx - */ - async _sign (tx) { - let signature = await tx.sign(this.keyring); - console.log('signing tx:', tx); - console.log('signing sig:', signature); - return Object.assign({}, tx, { signature }); - } - - /** - * Create a crowdfunding transaction. - * @param {Object} fund - */ - async _createCrowdfund (fund = {}) { - if (!fund.amount) return null; - if (!fund.address) return null; - - let index = fund.index || 0; - let hashType = Script$3.hashType.ANYONECANPAY | Script$3.hashType.ALL; - - mtx.addCoin(this._state.utxos[0]); - mtx.scriptInput(index, this._state.utxos[0], this.keyring); - mtx.signInput(index, this._state.utxos[0], this.keyring, hashType); - - await this.commit(); - - return { - tx: mtx.toTX(), - mtx: mtx - }; - } - - async _createSeed (password = null) { - const mnemonic = new Mnemonic({ bits: 256 }); - const master = bcoin.hd.fromMnemonic(mnemonic); - - await this._load(); - - const wallet = await this.database.create({ - network: this.settings.network, - master: master - }); - - // TODO: allow override of wallet name - const account = await wallet.getAccount('default'); - const data = { - seed: mnemonic.toString(), - master: master.privateKey.toString('hex'), - xpub: { - meta: { - depth: account.accountKey.depth, - parentFingerPrint: account.accountKey.parentFingerPrint, - childIndex: account.accountKey.childIndex, - chainCode: account.accountKey.chainCode.toString('hex'), - publicKey: account.accountKey.publicKey.toString('hex'), - fingerPrint: account.accountKey.fingerPrint - }, - public: account.accountKey.publicKey.toString('hex') - }, - key: { - private: master.privateKey.toString('hex'), - public: master.publicKey.toString('hex') - } - }; - - return data; - } - - async _importSeed (seed) { - let mnemonic = new Mnemonic(seed); - return this._loadSeed(mnemonic.toString()); - } - - async _createIncentivizedTransaction (config) { - console.log('creating incentivized transaction with config:', config); - - let mtx = new MTX(); - let data = new Script$3(); - let clean = await this.generateCleanKeyPair(); - - data.pushSym('OP_IF'); - data.pushSym('OP_SHA256'); - data.pushData(Buffer.from(config.hash)); - data.pushSym('OP_EQUALVERIFY'); - data.pushData(Buffer.from(config.payee)); - data.pushSym('OP_CHECKSIG'); - data.pushSym('OP_ELSE'); - data.pushInt(config.locktime); - data.pushSym('OP_CHECKSEQUENCEVERIFY'); - data.pushSym('OP_DROP'); - data.pushData(Buffer.from(clean.public)); - data.pushSym('OP_CHECKSIG'); - data.pushSym('OP_ENDIF'); - data.compile(); - - console.log('address data:', data); - let segwitAddress = await this.getAddressForScript(data); - - mtx.addOutput({ - address: segwitAddress, - value: 0 - }); - - // TODO: load available outputs from wallet - let out = await mtx.fund([] /* coins */, { - // TODO: fee estimation - rate: 10000, - changeAddress: this.ring.getAddress() - }); - - console.log('transaction:', out); - return out; - } - - async _getBondAddress () { - await this._load(); - - new Script$3(); - let clean = await this.generateCleanKeyPair(); - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'getting bond address, clean:', clean); - - // write the contract - // script.pushData(clean.public.toString('hex')); - // script.pushSym('OP_CHECKSIG'); - - // compile the script - // script.compile(); - - return { - pubkey: clean.public.toString(), - address: clean.address - }; - } - - async _getSpendableOutput (target, amount = 0) { - let self = this; - let out = null; - let mtx = new MTX(); - - await this._load(); - - console.log('funding transaction with coins:', this._state.utxos); - - // INSERT 1 Output - mtx.addOutput({ - address: target, - value: amount - }); - - out = await mtx.fund(this._state.utxos, { - // TODO: fee estimation - rate: 10000, - changeAddress: self.ring.getAddress() - }); - - console.log('out:', out); - - console.trace('created mutable transaction:', mtx); - console.trace('created immutable transaction:', mtx.toTX()); - - return { - tx: mtx.toTX(), - mtx: mtx - }; - } - - async signInput (mtx, index, redeemScript, value, privateKey, sigHashType, version_or_flags) { - return mtx.signature( - index, - redeemScript, - value, - privateKey, - sigHashType, - version_or_flags - ); - } - - async getRedeemTX (address, fee, fundingTX, fundingTXoutput, redeemScript, inputScript, locktime, privateKey) { - // Create a mutable transaction object - let redeemTX = new MTX(); - - // Get the output we want to spend (coins sent to the P2SH address) - let coin = Coin.fromTX(fundingTX, fundingTXoutput, -1); - - // Add that coin as an input to our transaction - redeemTX.addCoin(coin); - - // Redeem the input coin with either the swap or refund script - redeemTX.inputs[0].script = inputScript; - - // Create the output back to our primary wallet - redeemTX.addOutput({ - address: address, - value: coin.value - fee - }); - - // If this was a refund redemption we need to set the sequence - // Sequence is the relative timelock value applied to individual inputs - if (locktime) { - redeemTX.setSequence(0, locktime, this.CSV_seconds); - } else { - redeemTX.inputs[0].sequence = 0xffffffff; - } - - // Set SIGHASH and replay protection bits - let version_or_flags = 0; - let type = null; - - if (this.libName === 'bcash') { - version_or_flags = this.flags; - type = Script$3.hashType.SIGHASH_FORKID | Script$3.hashType.ALL; - } - - // Create the signature authorizing the input script to spend the coin - let sig = await this.signInput( - redeemTX, - 0, - redeemScript, - coin.value, - privateKey, - type, - version_or_flags - ); - - // Insert the signature into the input script where we had a `0` placeholder - inputScript.setData(0, sig); - - // Finish up and return - inputScript.compile(); - - return redeemTX; - } - - /** - * Generate {@link Script} for claiming a {@link Swap}. - * @param {*} redeemScript - * @param {*} secret - */ - async _getSwapInputScript (redeemScript, secret) { - let inputSwap = new Script$3(); - - inputSwap.pushInt(0); // signature placeholder - inputSwap.pushData(secret); - inputSwap.pushInt(1); // - inputSwap.pushData(redeemScript.toRaw()); // P2SH - inputSwap.compile(); - - return inputSwap; - } - - /** - * Generate {@link Script} for reclaiming funds commited to a {@link Swap}. - * @param {*} redeemScript - */ - async _getRefundInputScript (redeemScript) { - let inputRefund = new Script$3(); - - inputRefund.pushInt(0); // signature placeholder - inputRefund.pushInt(0); // - inputRefund.pushData(redeemScript.toRaw()); // P2SH - inputRefund.compile(); - - return inputRefund; - } - - async _createOrderForPubkey (pubkey) { - this.emit('log', `creating ORDER transaction with pubkey: ${pubkey}`); - - let mtx = new MTX(); - let data = new Script$3(); - let clean = await this.generateCleanKeyPair(); - - let secret = 'fixed secret :)'; - let sechash = require$$0__default["default"].createHash('sha256').update(secret).digest('hex'); - - this.emit('log', `SECRET CREATED: ${secret}`); - this.emit('log', `SECHASH: ${sechash}`); - - data.pushSym('OP_IF'); - data.pushSym('OP_SHA256'); - data.pushData(Buffer.from(sechash)); - data.pushSym('OP_EQUALVERIFY'); - data.pushData(Buffer.from(pubkey)); - data.pushSym('OP_ELSE'); - data.pushInt(86400); - data.pushSym('OP_CHECKSEQUENCEVERIFY'); - data.pushSym('OP_DROP'); - data.pushData(Buffer.from(clean.public)); - data.pushSym('OP_ENDIF'); - data.pushSym('OP_CHECKSIG'); - data.compile(); - - this.emit('log', `[AUDIT] address data: ${data}`); - let segwitAddress = await this.getAddressForScript(data); - let address = await this.getAddressFromRedeemScript(data); - - this.emit('log', `[AUDIT] segwit address: ${segwitAddress}`); - this.emit('log', `[AUDIT] normal address: ${address}`); - - mtx.addOutput({ - address: address, - value: 25000000 - }); - - // ensure a coin exists... - // NOTE: this is tracked in this._state.coins - // and thus does not need to be cast to a variable... - await this._getFreeCoinbase(); - - // TODO: load available outputs from wallet - await mtx.fund(this._state.utxos, { - // TODO: fee estimation - rate: 10000, - changeAddress: this.ring.getAddress() - }); - - let tx = mtx.toTX(); - let sig = await mtx.sign(this.ring); - - this.emit('log', 'transaction:', tx); - this.emit('log', 'sig:', sig); - - return { - tx: tx, - mtx: mtx, - sig: sig - }; - } - - async _scanBlockForTransactions (block) { - console.log('[AUDIT]', 'Scanning block for transactions:', block); - } - - async _scanChainForTransactions (chain) { - console.log('[AUDIT]', 'Scanning chain for transactions:', chain); - - let transactions = []; - - for (let i = 0; i < chain.blocks.length; i++) { - transactions.concat(await this._scanBlockForTransactions(chain.blocks[i])); - } - - return transactions; - } - - async _createChannel (channel) { - let element = new Channel(channel); - return element; - } - - async _allocateSlot () { - for (let i = 0; i < Object.keys(this._state.space).length; i++) { - let slot = this._state.space[Object.keys(this._state.space)[i]]; - if (!slot.allocation) { - this._state.space[Object.keys(this._state.space)[i]].allocation = new Secret(); - return this._state.space[Object.keys(this._state.space)[i]]; - } - } - } - - async getFirstAddressSlice (size = 256) { - await this._load(); - - // aggregate results for return - let slice = []; - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'generating {@link Space} with settings:', this.settings); - - // iterate over length of shard, aggregate addresses - for (let i = 0; i < size; i++) { - let addr = this.account.deriveReceive(i).getAddress('string', this.settings.network); - let address = await this.addresses.create({ - string: addr, - label: `shared address ${i} for wallet ${this.id}`, - allocation: null - }); - - // TODO: restore address tracking in state - // this._state.space[addr] = address; - - slice.push(address); - } - - return slice; - } - - /** - * Create a public key from a string. - * @param {String} input Hex-encoded string to create key from. - */ - publicKeyFromString (input) { - const buf = Buffer.from(input, 'hex'); - return bcoin.KeyRing.fromPublic(buf).publicKey; - } - - async generateCleanKeyPair () { - if (this.status !== 'loaded') await this._load(); - - this.index++; - - let key = this.master.derivePath(`m/44'/0'/0'/0/${this.index}`); - let keyring = bcoin.KeyRing.fromPrivate(key.privateKey); - - return { - index: this.index, - public: keyring.publicKey.toString('hex'), - address: keyring.getAddress('string'), - keyring: keyring - }; - } - - async _handleWalletBalance (balance) { - await this._PUT('/balance', balance); - const depositor = new State$3({ name: this.settings.name || 'default' }); - await this._PUT(`/depositors/${depositor.id}/balance`, balance); - this.emit('balance', balance); - } - - async _registerAccount (obj) { - if (!obj.name) throw new Error('Account must have "name" property.'); - if (!this.database.db.loaded) { - await this.database.open(); - } - - const account = await this.accounts.create(obj); - if (this.settings.verbosity >= 4) console.log('registering account, created:', account); - - if (this.manager) { - this.manager.on('tx', this._handleWalletTransaction.bind(this)); - this.manager.on('balance', this._handleWalletBalance.bind(this)); - // TODO: check on above events, should be more like... - // this.manager.on('changes', this._handleWalletBalance.bind(this)); - } - - return account; - } - - async _prepareSecret (state) { - const entity = new Actor$5(state); - return entity; - } - - async _loadSeed (seed) { - this.settings.key = { seed }; - await this._load(); - return this.seed; - } - - async _unload () { - return this.database.close(); - } - - /** - * Initialize the wallet, including keys and addresses. - * @param {Object} settings Settings to load. - */ - async _load (settings = {}) { - if (this.wallet) return this; - - this.status = 'loading'; - this.master = null; - - if (!this.database.db.loaded) { - await this.database.open(); - } - - if (this.settings.key && this.settings.key.seed) { - this.emit('log', 'Restoring wallet from seed...'); - if (this.settings.verbosity >= 3) console.log('[AUDIT]', 'Restoring wallet from provided seed:', this.settings.key.seed); - const mnemonic = new Mnemonic(this.settings.key.seed); - this.master = bcoin.hd.fromMnemonic(mnemonic); - this.seed = new EncryptedPromise({ data: this.settings.key.seed }); - } else { - if (this.settings.verbosity >= 3) console.log('[AUDIT]', 'Generating new HD key for wallet...'); - this.master = bcoin.hd.generate(this.settings.network); - } - - try { - this.wallet = await this.database.create({ - network: this.settings.network, - master: this.master - }); - } catch (E) { - console.error('Could not create wallet:', E); - } - - // Setup Ring - this.ring = new bcoin.KeyRing(this.master, this.settings.network); - this.ring.witness = this.settings.witness; // designates witness - - if (this.settings.verbosity >= 4) console.log('keyring:', this.ring); - if (this.settings.verbosity >= 4) console.log('address from keyring:', this.ring.getAddress().toString()); - - // TODO: allow override of wallet name - this.account = await this.wallet.getAccount('default'); - - // Let's call it a shard! - this.shard = await this.getFirstAddressSlice(this.settings.shardsize); - // console.log('shard created:', await this.addresses.asMerkleTree()); - // console.log('shard created:', this.shard); - - if (this.settings.verbosity >= 3) this.emit('log', `[AUDIT] Wallet account ${JSON.stringify(this.account, null, ' ')}`); - // TODO: also retrieve key for address - // let key = this.master.derivePath('m/44/0/0/0/0'); - // TODO: label as identity address - // this.address = await this.account.receiveAddress(); - // TODO: notify downstream of short-circuit removal - - // finally, assign state... - this._state.transactions = this.settings.transaction; - this._state.orders = this.settings.orders; - this._state.outputs = this.state.actors; - - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'state after loading:', this._state); - - this.status = 'loaded'; - this.emit('ready'); - - return this; - } - - /** - * Start the wallet, including listening for transactions. - */ - async start () { - this.status = 'STARTING'; - await this._load(); - this.status = 'STARTED'; - } - } - - var wallet = Wallet$2; - - // Constants - const { - P2P_IDENT_REQUEST, - P2P_IDENT_RESPONSE, - P2P_ROOT, - P2P_PING, - P2P_PONG, - P2P_START_CHAIN, - P2P_INSTRUCTION, - P2P_BASE_MESSAGE, - P2P_STATE_COMMITTMENT, - P2P_STATE_CHANGE, - P2P_STATE_ROOT, - ZERO_LENGTH_PLAINTEXT - } = constants$1; - - // Internals - const net = require$$6__default["default"]; - const crypto$4 = require$$0__default["default"]; - const stream = require$$2__default["default"]; - - // Dependencies - const merge$2 = lodash_merge.exports; - // const upnp = require('nat-upnp'); - - // Fabric Types - const Actor$4 = actor; - const Key$2 = key$1; - const Machine$4 = machine; - const Message$2 = message$1; - const Session = session; - const Reader = reader$2; - const Wallet$1 = wallet; - - /** - * An in-memory representation of a node in our network. - */ - class Peer$1 extends Actor$4 { - /** - * Create an instance of {@link Peer}. - * @param {Object} [config] Initialization Vector for this peer. - * @param {Boolean} [config.listen] Whether or not to listen for connections. - * @param {Boolean} [config.upnp] Whether or not to use UPNP for automatic configuration. - * @param {Number} [config.port=7777] Port to use for P2P connections. - * @param {Array} [config.peers=[]] List of initial peers. - */ - constructor (config = {}) { - super(config); - - this.name = 'Peer'; - this.settings = merge$2({ - address: '0.0.0.0', - network: 'regtest', - networking: true, - listen: false, - peers: [], - port: 7777, - upnp: false - }, config); - - // Network Internals - this.upnp = null; - this.server = net.createServer(this._handleConnection.bind(this)); - this.stream = new stream.Transform({ - transform (chunk, encoding, callback) { - // TODO: parse as encrypted data - callback(null, chunk); - } - }); - - this.key = new Key$2({ - network: this.settings.network, - seed: (this.settings.wallet && this.settings.wallet.seed) ? this.settings.wallet.seed : this.settings.seed - }); - - // TODO: document wallet settings - this.wallet = new Wallet$1({ - key: { - seed: (this.settings.wallet && this.settings.wallet.seed) ? this.settings.wallet.seed : this.settings.seed - } - }); - - // this.hex = this.key.public.encodeCompressed('hex'); - // this.pkh = crypto.createHash('sha256').update(this.hex).digest('hex'); - - // Public Details - this.public = { - ip: null, - port: this.settings.port - }; - - // Internal properties - this.chains = {}; - this.connections = {}; - this.peers = {}; - this.memory = {}; - this.handlers = {}; - this.messages = new Set(); - - // Internal Stack Machine - this.machine = new Machine$4(); - - this.meta = { - messages: { - inbound: 0, - outbound: 0 - } - }; - - this._state = { - peers: {}, - chains: {}, - connections: {}, - status: 'sleeping' - }; - - return this; - } - - get id () { - return this.key.pubkey; - } - - get pubkeyhash () { - return this.wallet.ring.getKeyHash('hex'); - } - - get state () { - // TODO: use Proxy - return Object.assign({}, this._state); - } - - get address () { - return this.settings.interface || this.settings.address; - } - - get port () { - return this.settings.port || 7777; - } - - set state (value) { - this._state = value; - } - - /** - * Start the Peer. - */ - async start () { - let address = null; - - if (this.settings.verbosity >= 4) console.log('[FABRIC:PEER]', 'Peer starting...'); - if (this.settings.upnp) { - this.upnp = upnp.createClient(); - } - - try { - await this.wallet.start(); - } catch (E) { - console.error('[FABRIC:PEER]', 'Could not start wallet:', E); - } - - if (this.settings.listen) { - address = await this.listen(); - } - - if (this.settings.networking) { - for (const candidate of this.settings.peers) { - this._connect(candidate); - } - } - - this.emit('ready', { - id: this.id, - address: address, - pubkey: this.key.pubkey - }); - - return this; - } - - /** - * Stop the peer. - */ - async stop () { - const peer = this; - - // Alert listeners - peer.emit('log', 'Peer stopping...'); - - if (peer.settings.upnp && peer.upnp) { - peer.upnp.close(); - } - - for (const id in peer.connections) { - peer.emit('log', `Closing connection: ${id}`); - const connection = peer.connections[id]; - const closer = async function () { - return new Promise((resolve, reject) => { - // Give socket a timeout to close cleanly, destroy if failed - let deadline = setTimeout(function () { - console.warn('[FABRIC:PEER]', 'end() timed out for peer:', id, 'Calling destroy...'); - connection.destroy(); - resolve(); - }, 5000); - - // TODO: notify remote peer of closure - // Use end(SOME_CLOSE_MESSAGE, ...) - return connection.end(function socketClosed (error) { - if (error) return reject(error); - clearTimeout(deadline); - resolve(); - }); - }); - }; - await closer(); - } - - const terminator = async function () { - return new Promise((resolve, reject) => { - if (!peer.server.address()) return resolve(); - return peer.server.close(function serverClosed (error) { - if (error) return reject(error); - resolve(); - }); - }); - }; - - await terminator(); - - return this; - } - - async _setState (value) { - if (!value) return new Error('You must provide a State to set the value to.'); - this.state.state = value; - return this.state.state; - } - - // TODO: use in _connect - async _sessionStart (socket, target) { - const self = this; - const address = `${target.address}:${target.port}`; - self.emit('log', `Starting session with address: ${target.pubkey}@${address}`); - self.connections[address].session = new Session({ recipient: target.pubkey }); - await self.connections[address].session.start(); - self.emit('log', `Session created: ${JSON.stringify(self.connections[address].session)}`); - - if (!self.public.ip) { - self.public.ip = socket.localAddress; - self.emit('log', `Local socket was null, changed to: ${self.public.ip}`); - } - - // TODO: consolidate with similar _handleConnection segment - // TODO: check peer ID, eject if self or known - - // TODO re-enable (disabled to reduce spammy messaging) - // /* - // TODO: re-evaluate use of IdentityRequest - // const vector = ['IdentityRequest', self.id]; - const vector = ['StartSession', JSON.stringify({ - id: self.connections[address].session.id, - identity: self.id, - advertise: `${self.key.pubkey}@${self.public.ip}:${self.public.port}`, - signature: self.connections[address].session.key._sign(self.id) - })]; - const message = Message$2.fromVector(vector); - - if (!socket.writable) { - self.emit('error', `Socket is not writable.`); - return false; - } - - self.sendToSocket(address, message); - - // Emit notification of a newly opened connection - self.emit('connections:open', { - address: address, - status: 'unauthenticated', - initiator: true - }); - - if (self.settings.verbosity >= 4) console.log('[FABRIC:PEER]', `Connection to ${address} established!`); - } - - async _processCompleteDataPacket (socket, address, data) { - // Constants - const self = this; - // TODO: actually decrypt packet - const decrypted = socket.session.decrypt(data); - - // Variables - let message = null; - - try { - message = self._parseMessage(decrypted); - } catch (exception) { - console.error('[FABRIC:PEER]', 'Could not parse inbound messsage:', exception); - } - - // disconnect from any peer sending invalid messages - if (!message) return socket.destroy(); - - const response = await self._handleMessage({ - message: message, - origin: address, - peer: { - address: address, - id: socket.id - } - }); - - if (response) { - self.meta.messages.outbound++; - self.sendToSocket(address, response); - } - } - - async _handleSocketData (socket, address, data) { - const self = this; - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Received data from peer:', data); - - if (!socket.session) { - self.emit('error', `Received data on socket without a session! Violator: ${address}`); - return false; - } - - socket._reader._addData(data); - } - - _connect (address) { - let self = this; - let parts = address.split(':'); - let known = Object.keys(self.connections); - let keyparts = parts[0].split('@'); - let target = { - pubkey: null, - address: null, - port: null - }; - - if (keyparts.length === 2) { - target.pubkey = keyparts[0]; - target.address = keyparts[1]; - target.port = parts[1]; - } else { - target.address = parts[0]; - target.port = parts[1]; - } - - if (target.pubkey === self.id) return this.emit('error', 'Cannot connect to self.'); - - const authority = `${target.address}:${target.port}`; - - if (this.settings.verbosity >= 4) console.log('[FABRIC:PEER]', 'Connecting to address:', authority); - - if (parts.length !== 2) return console.debug('Invalid address:', address); - if (known.includes(authority)) return self.connections[authority]; - - // TODO: refactor to use local functions + specific unbindings - try { - self.connections[authority] = new net.Socket(); - self.connections[authority]._reader = new Reader(); - self.connections[authority]._reader.on('debug', function (msg) { - self.emit('debug', msg); - }); - - self.connections[authority]._reader.on('message', function (msg) { - self._processCompleteDataPacket.apply(self, [ self.connections[authority], authority, msg ]); - }); - - self.connections[authority].on('error', function (err) { - const text = `could not connect to peer ${authority} — Reason: ${err}`; - self.emit('connection:error', { - message: text - }); - // console.debug('[PEER]', `could not connect to peer ${authority} — Reason:`, err); - }); - - self.connections[authority].on('close', function _handleSocketClose (err) { - if (err) self.debug('socket closed on error:', err); - if (err) self.emit('log', `socket closed on error: ${err}`); - - self.emit('warning', `Connection closed: ${authority}`); - - self.connections[authority].removeAllListeners(); - - // TODO: consider using `process.nextTick` to only clean up after event? - delete self.connections[authority]; - self.emit('connections:close', { - address: authority - }); - }); - - // TODO: unify as _dataHandler - self.connections[authority].on('data', async function peerDataHandler (data) { - self._handleSocketData.apply(self, [ this, authority, data ]); - }); - - self.emit('log', `Starting connection to address: ${authority}`); - - // TODO: replace with handshake - // NOTE: the handler is only called once per connection! - self.connections[authority].connect(target.port, target.address, async function connectionAttemptComplete (error) { - if (error) return new Error(`Could not establish connection: ${error}`); - await self._sessionStart.apply(self, [ this, target ]); - self._maintainConnection(authority); - }); - } catch (E) { - self.log('[PEER]', 'failed to connect:', E); - } - - return self.connections[authority]; - } - - _disconnect (address) { - if (!this.connections[address]) return false; - - // Halt any heartbeat - if (this.connections[address].heartbeat) { - clearInterval(this.connections[address].heartbeat); - } - - // Destroy the connection - this.connections[address].destroy(); - - // Remove connection from map - delete this.connections[address]; - } - - _parseMessage (data) { - if (!data) return false; - if (this.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Parsing message:', data); - - // Variables - let message = null; - - try { - message = Message$2.fromRaw(data); - } catch (exception) { - this.emit('debug', `[FABRIC:PEER] error parsing message: ${exception}`); - } - - if (this.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Parsed message into:', message.type, message.data); - return message; - } - - async _handleConnection (socket) { - const self = this; - const address = [socket.remoteAddress, socket.remotePort].join(':'); - if (this.settings.verbosity >= 4) self.emit('log', `[FABRIC:PEER] [0x${self.id}] Incoming connection from address: ${address}`); - - self.emit('connections:open', { - address: address, - status: 'connected', - initiator: false - }); - - // TODO: use known key - socket.session = new Session(); - - socket.on('close', function terminate () { - self.emit('log', `connection closed: ${address}`); - self.emit('connections:close', { address: address }); - self._disconnect(address); - }); - - socket.on('data', function inboundPeerHandler (data) { - try { - self._handleSocketData.apply(self, [ socket, address, data ]); - } catch (exception) { - self.emit('error', `Could not handle socket data: ${exception}`); - } - }); - - // add this socket to the list of known connections - this.connections[address] = socket; - this.connections[address]._reader = new Reader(); - self.connections[address]._reader.on('debug', function (msg) { - self.emit('debug', msg); - }); - - this.connections[address]._reader.on('message', function (msg) { - self._processCompleteDataPacket.apply(self, [ self.connections[address], address, msg ]); - }); - - self._maintainConnection(address); - } - - _maintainConnection (address) { - const peer = this; - if (!peer.connections[address]) return new Error(`Connection for address "${address}" does not exist.`); - /* peer.connections[address]._player = setInterval(function () { - peer._pingConnection.apply(peer, [ address ]); - }, 60000); */ - } - - _pingConnection (address) { - const ping = Message$2.fromVector(['Ping', `${Date.now().toString()}`]); - - try { - this.sendToSocket(address, ping); - } catch (exception) { - this.emit('error', `Couldn't deliver message to socket: ${exception}`); - } - } - - _updateLiveness (address) { - // Return Error if no connection - if (!this.connections[address]) { - const error = `No connection for address: ${address}`; - this.emit('error', error); - return new Error(error); - } - - // Set the _lastMessage property - this.connections[address]._lastMessage = Date.now(); - - // Make chainable - return this; - } - - _registerHandler (type, method) { - if (this.handlers[type]) return new Error(`Handler for method "${type}" is already registered.`); - this.handlers[type] = method.bind(this); - return this.handlers[type]; - } - - _registerPeer (peer) { - if (this.settings.verbosity >= 6) console.warn('[AUDIT]', 'Registering peer:', peer); - let self = this; - - if (!peer) return false; - if (!peer.id) { - self.log(`Peer attribute 'id' is required.`); - return false; - } - - self.peers[peer.id] = peer; - - // console.log('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Peer registered:', peer); - // console.log('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Peer list:', self.peers); - - self.emit('peer', peer); - - // TODO: document peer announcement - // TODO: eliminate use of JSON in messaging - const announcement = Message$2.fromVector(['PeerCandidate', JSON.stringify(peer)]); - - try { - self.relayFrom(peer.id, announcement); - } catch (exception) { - self.emit('error', `Could not relay peer registration: ${exception}`); - } - - return true; - } - - async _requestStateFromAllPeers () { - const message = Message$2.fromVector(['StateRequest']); - this.broadcast(message); - } - - async _handleMessage (packet) { - if (!packet) return false; - - // Constants - const self = this; - const message = packet.message; - const origin = packet.origin; - - // Variables - let relay = false; - let response = null; - - this._updateLiveness(origin); - - if (!message) return console.error('Hard failure:', packet); - if (this.messages.has(message.id)) { - // this.emit('debug', `Received duplicate message ${message.id} from [${origin}] in packet: ${JSON.stringify(packet, null, ' ')}`); - return false; - } else { - this.memory[message.id] = message; - this.messages.add(message.id); - } - - this.emit('log', `Evaluting message with purported type "${message.type}":`); - - // Build a response to various message types - switch (message.type) { - case 'ChatMessage': - relay = true; - this.emit('debug', `Message: ${JSON.stringify({ - type: message.type, - data: message.data, - size: message.data.length - }, null, ' ')}`); - this.emit('debug', `Data (${typeof message.data}): \n\t${message.data}`); - - try { - const data = JSON.parse(message.data); - this.emit('debug', `Parsed (${typeof data}): ${JSON.stringify(data, null, ' ')}`); - this.emit('log', `[${data.object.created}] @${data.actor}: ${data.object.content}`); - this.emit('message', message.data); - } catch (exception) { - this.emit('error', `Could not process ChatMessage: ${exception}`); - } - break; - case 'Generic': - relay = true; - break; - case 'Ping': - response = Message$2.fromVector(['Pong', message.id]); - break; - case 'Pong': - // self.emit('message', `Received Pong: ${message}`); - break; - case 'StartChain': - break; - case 'GenericMessage': - console.warn('[FABRIC:PEER]', 'Received Generic Message:', message.data); - relay = true; - break; - case 'IdentityRequest': - console.log('[FABRIC:PEER]', 'Peer sent IdentityRequest. Responding with IdentityResponse (node id)...', self.id); - response = Message$2.fromVector(['IdentityResponse', self.id]); - break; - case 'IdentityResponse': - if (!self.peers[message.data]) { - ({ - id: message.data, - address: packet.origin - }); - - // TODO: remove in favor of StartSession - // Why? Duplicate "peer" event is sent within _registerPeer - // Try to register peer... - /* try { - self._registerPeer(peer); - } catch (exception) { - self.emit('error', `Could not register peer ${message.data} because: ${exception}`); - } */ - } - - response = Message$2.fromVector(['StateRoot', JSON.stringify(self.state)]); - break; - case 'DocumentPublish': - this.emit('log', `Document published from peer: ${message.data}`); - this.emit('DocumentPublish', message.data); - break; - case 'DocumentRequest': - this.emit('DocumentRequest', message.data); - break; - case 'BlockCandidate': - break; - case 'PeerCandidate': - let candidate = null; - - try { - candidate = JSON.parse(message.data); - } catch (exception) { - console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Could not parse PeerCandidate message:', message.data, exception); - } - - self.emit('peer:candidate', candidate); - break; - case 'PeerMessage': - // console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, `Received "PeerMessage" from ${packet.origin} on socket:`, message.raw); - // console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, `Packet origin:`, packet.origin); - // TODO: use packet's peer ID, not socket address - // Likely need to track connection? - self.relayFrom(packet.origin, message); - break; - case 'StartSession': - if (self.settings.verbosity >= 6) console.warn('[AUDIT]', '[FABRIC:PEER]', `[0x${self.id}]`, 'Received "StartSession" message on socket:', message.raw); - let session = null; - - try { - session = JSON.parse(message.data.toString('utf8')); - } catch (exception) { - console.error('[FABRIC:PEER]', 'Session body could not be parsed:', exception); - } - - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Proposed session:', session); - // TODO: restore session identity - if (session/* && session.identity */) { - if (self.settings.verbosity >= 6) console.log('[AUDIT]', 'Session is valid...'); - - let peer = { - id: session.identity, - address: packet.origin, - advertise: `${self.pubkeyhash}@${self.public.ip}:${self.public.port}`, - status: 'unfunded' - }; - - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Peer to register:', peer); - - // TODO: document peer registration process - self._registerPeer(peer); - - // TODO: use message type for next phase of session (i.e., NOISE) - response = Message$2.fromVector(['StartSession', { identity: self.id }]); - if (self.settings.verbosity >= 6) console.log('[AUDIT]', 'Will send response:', response); - } - - break; - case 'StateRoot': - if (self.settings.verbosity >= 5) console.log('[AUDIT]', 'Message was a state root:', message.data); - - // TODO: test protocol flow (i.e., understand StateRoot) - console.log('[AUDIT]', 'Message was a state root:', message.raw, message.data); - - try { - const state = JSON.parse(message.data); - self.emit('state', state); - response = { - 'type': 'Receipt', - 'data': state - }; - } catch (E) { - console.error('[FABRIC:PEER]', 'Could not parse StateRoot:', E); - } - break; - case 'StateChange': - console.log('message was a state change:', message.data); - break; - case P2P_BASE_MESSAGE: - self._handleBasePacket(packet); - break; - case P2P_ROOT: - response = Message$2.fromVector([P2P_STATE_COMMITTMENT, self.state]); - self.log('type was ROOT, sending state root:', response); - self.log('type was ROOT, state was:', self.state); - break; - case P2P_INSTRUCTION: - // TODO: use Fabric.Script / Fabric.Machine - let stack = message.data.split(' '); - switch (stack[1]) { - case 'SIGN': - let signature = self.key._sign(stack[0]); - let buffer = Buffer.from(signature); - let script = [buffer.toString('hex'), 'CHECKSIG'].join(' '); - - response = Message$2.fromVector([P2P_INSTRUCTION, script]); - break; - default: - console.log('[PEER]', `unhandled peer instruction "${stack[1]}"`); - break; - } - - break; - default: - console.error('[PEER]', `unhandled message type "${message.type}"`); - self.emit('error', `Unhandled message type "${message.type}"`); - break; - } - - // Emit for listeners - // self.emit('message', message); - - if (relay) { - self.relayFrom(origin, message); - } - - return response; - } - - _handleBasePacket (packet) { - let message = null; - - try { - message = JSON.parse(packet.message.data); - } catch (E) { - return this.log('Error parsing message:', E); - } - - switch (message.type) { - case 'collections:post': - this.emit('collections:post', message.data); - break; - default: - console.log('unhandled base packet type:', message.type); - break; - } - } - - async sendToSocket (address, raw) { - if (raw instanceof Message$2) { - raw = raw.asRaw(); - } - - if (!this.connections[address]) { - this.emit('error', `Could not deliver message to unconnected address: ${address}`); - return false; - } - - if (!this.connections[address].session) { - this.emit('error', `Connection does not have a Session: ${address}`); - return false; - } - - if (!this.connections[address].writable) { - this.emit('error', `Connection is not writable: ${address}`); - return false; - } - - this.emit('debug', `Writing ${raw.length} bytes to socket: \n\t${raw.toString('hex')}`); - // const signature = await this.connections[address].session._appendMessage(raw); - // self.emit('debug', `Signature: ${signature}`); - - try { - const result = this.connections[address].write(raw); - if (!result) { - this.emit('warning', 'Stream result false.'); - } - } catch (exception) { - this.emit('error', `Exception writing to $[${address}]: ${exception}`); - } - } - - relayFrom (origin, message) { - if (!origin) { - this.emit('error', 'Must provide an origin.'); - return false; - } - - if (!message) { - this.emit('error', 'Must provide a message.'); - return false; - } - - if (!(message instanceof Message$2)) { - this.emit('error', 'Must provide a valid Fabric message.'); - return false; - } - - this.emit('log', `Relaying ${message.type} from ${origin}: <${typeof message.data}> ${message.data}}`); - - let authorized = false; - - if (message.type) { - switch (message.type) { - case 'ChatMessage': - authorized = true; - break; - case 'PeerCandidate': - break; - default: - this.emit('debug', `Unhandled type: ${message.type}`); - break; - } - } else { - this.emit('warning', `Unknown message structure: <${message.constructor.name} ${JSON.stringify(message, null, ' ')} />`); - } - - // For each known peer, send to the corresponding socket - for (const id in this.peers) { - this.emit('debug', `Is ${id} === ${origin}?`); - if (id === origin) continue; - const peer = this.peers[id]; - - // TODO: select type byte for state updates - // TODO: require `Message` type before broadcast (or, preferrably, cast as necessary) - // let msg = Message.fromVector([P2P_BASE_MESSAGE, message]); - const msg = Message$2.fromVector([ - message.type, - message.data - ]); - - const raw = msg.asRaw(); - this.emit('debug', `Preparing write (${raw.length} bytes): <${raw.constructor.name}> \n\t${raw.toString('hex')}`); - - if (authorized) { - try { - this.emit('debug', `Sending ${raw.length} bytes to address $[${peer.address}]: \n\t${raw.toString('hex')}`); - this.sendToSocket(peer.address, raw); - } catch (exception) { - this.emit('error', `Could not write message to connection "${peer.address}":`, exception); - } - } else { - this.emit('debug', 'Would have sent to socket:'); - this.emit('debug', `sendToSocket (${raw.length} bytes): from ${origin} to ${peer.address}: ${raw.toString('hex')})`); - } - } - } - - broadcast (message) { - // Coerce to Object - if (message instanceof Message$2) { - message = message.toObject(); - } - - if (typeof message !== 'string') message = JSON.stringify(message); - let hash = crypto$4.createHash('sha256').update(message).digest('hex'); - - // Do not relay duplicate messages - if (this.messages.has(hash)) { - if (this.settings.verbosity >= 3) console.warn('[FABRIC:PEER]', `Attempted to broadcast duplicate message ${hash} with content:`, message); - return false; - } else { - this.memory[hash] = message; - this.messages.add(hash); - } - - for (let id in this.peers) { - let peer = this.peers[id]; - // TODO: select type byte for state updates - // TODO: require `Message` type before broadcast (or, preferrably, cast as necessary) - // let msg = Message.fromVector([P2P_BASE_MESSAGE, message]); - let msg = Message$2.fromVector(['PeerMessage', message]); - - try { - this.sendToSocket(peer.address, msg); - } catch (exception) { - console.error('[FABRIC:PEER]', `Could not write message to connection "${peer.address}":`, exception); - } - } - } - - _broadcastTypedMessage (type, message) { - if (!message) message = ''; - if (typeof message !== 'string') message = JSON.stringify(message); - - let id = crypto$4.createHash('sha256').update(message).digest('hex'); - - if (this.messages.has(id)) { - this.log('attempted to broadcast duplicate message'); - return false; - } else { - this.memory[id] = message; - this.messages.add(id); - } - - for (let id in this.peers) { - let peer = this.peers[id]; - // TODO: select type byte for state updates - let msg = Message$2.fromVector([type, message]); - this.sendToSocket(peer.address, msg); - } - } - - /** - * Start listening for connections. - * @fires Peer#ready - * @return {Peer} Chainable method. - */ - async listen () { - const self = this; - const promise = new Promise((resolve, reject) => { - self.server.listen(self.port, self.address, function listenComplete (error) { - if (error) return reject(error); - - const details = self.server.address(); - const address = `tcp://${details.address}:${details.port}`; - const complete = function () { - self.emit('log', `Now listening on ${address} [!!!]`); - return resolve(address); - }; - - if (!self.settings.upnp) { - return complete(); - } - - // UPNP - self.upnp.portMapping({ - public: 7777, - private: 7777, - ttl: 10 - }, function (err) { - if (err) { - self.emit('log', `error configuring upnp: ${err}`); - return complete(); - } - - self.upnp.externalIp(function (err, ip) { - if (err) { - self.emit('log', `Could not retrieve public IP: ${err}`); - } else { - self.public.ip = ip; - self.emit('log', `UPNP configured! External IP: ${ip}`); - } - - return complete(); - }); - }); - }); - }); - - return promise; - } - } - - var peer = Peer$1; - - // Dependencies - const merge$1 = lodash_merge.exports; - - // Types - const Actor$3 = actor; - const KeyStore = keystore; - const Machine$3 = machine; - const Message$1 = message$1; - const Peer = peer; - // const Remote = require('./remote'); - const Resource$4 = resource$1; - const Service$6 = service_1; - const Storage = store_1; - // const Swarm = require('./swarm'); - - /** - * Web-friendly application framework for building single-page applications with - * Fabric-based networking and storage. - * @extends Service - * @property {Collection} components Interface elements. - * @property {Store} stash Routable {@link Datastore}. - */ - // class App extends Scribe { - class App$4 extends Service$6 { - /** - * Generic bundle for building Fabric applications. - * @param {Object} definition Application definition. See `config` for examples. - * @return {App} Returns an instance of `App`. - */ - constructor (definition = {}) { - super(definition); - - if (!definition.resources) definition.resources = {}; - - this.settings = Object.assign({ - seed: null, - path: './stores/fabric-application', - prefix: '/', - services: [], - verbosity: 1 - }, definition); - - // Internal Components - this.node = new Peer(this.settings); - this.actor = new Actor$3(this.settings); - this.machine = new Machine$3(this.settings); - this.store = new KeyStore(this.settings); - - // TODO: replace these with KeyStore - this.tips = new Storage({ path: './stores/tips' }); - this.stash = new Storage({ path: './stores/stash' }); - - // TODO: debug these in browser - // this.swarm = new Swarm(); - // this.worker = new Worker(); - - this.name = 'application'; - this.network = {}; - - // TODO: debug this in browser - // this.element = document.createElement('fabric-app'); - - // Assign Properties - this.bindings = {}; - this.authorities = {}; - this.components = {}; - this.elements = {}; - this.services = {}; - this.commands = {}; - this.resources = {}; - this.templates = {}; - this.keys = []; - - // Listen for Patches - this.stash.on('patches', function (patches) { - console.log('[FABRIC:APP]', 'heard patches!', patches); - }); - - if (this.settings.resources) { - for (const name in this.resources) { - this.set(this.settings.prefix + this.resources[name].components.list, []); - } - } - - // State - this._state = { - anchor: 'BTC', - chains: {} - }; - - this.commit(); - - return this; - } - - _bindEvents (element) { - for (const name in this.bindings) element.addEventListener(name, this.bindings[name]); - return element; - } - - _unbindEvents (element) { - for (const name in this.bindings) element.removeEventListener(this.bindings[name]); - return element; - } - - async bootstrap () { - return true; - } - - async _signWithOwnID (input) { - return this.key.sign(input); - } - - /** - * Start the program. - * @return {Promise} - */ - async start () { - this._appendMessage(`[FABRIC:APP] @${this.id} -- Starting...`); - this.status = 'STARTING'; - - for (const [name, service] of Object.entries(this.services)) { - this._appendWarning(`@${this.id} -- Checking for Service: ${name}`); - if (this.settings.services.includes(name)) { - this._appendWarning(`Starting service: ${name}`); - await this.services[name]._bindStore(this.store); - await this.services[name].start(); - } - } - - // Start P2P node - this.node.start(); - this.status = 'STARTED'; - this.emit('ready'); - this._appendMessage(`[FABRIC:APP] @${this.id} -- Started!`); - - return this; - } - - /** - * Stop the program. - * @return {Promise} - */ - async stop () { - this.emit('log', '[FABRIC:APP] Stopping...'); - await this.node.stop(); - await this.tips.close(); - await this.stash.close(); - this.emit('log', '[FABRIC:APP] Stopped!'); - return this; - } - - /** - * Define a Resource, or "Type", used by the application. - * @param {String} name Human-friendly name for the Resource. - * @param {Object} structure Map of attribute names -> definitions. - * @return {Object} [description] - */ - async define (name, structure) { - const self = this; - - self.log('[APP]', 'defining:', name, structure); - - try { - const resource = new Resource$4(structure); - - resource._sign(); - resource.trust(self.stash); - - // self.use(name, structure); - // TODO: decide on resource['@data'] vs. resource (new) - self.resources[name] = resource; - - self._sign(); - } catch (E) { - console.error(E); - } - - return this; - } - - async register (component) { - this.components[component.name] = component; - } - - /** - * Defer control of this application to an outside authority. - * @param {String} authority Hostname to trust. - * @return {App} The configured application as deferred to `authority`. - */ - async defer (authority) { - let self = this; - let resources = {}; - - console.warn('[APP]', 'deferring authority:', authority); - - /* if (typeof authority === 'string') { - self.remote = new Remote({ - host: authority - }); - resources = await self.remote.enumerate(); - } else { - resources = authority.resources; - } */ - - if (!resources) { - resources = {}; - } - - self.consume(resources); - - if (window && window.page) { - // load the Index - window.page('/', function (context) { - self.log('Hello, navigator.'); - self.log('Context:', context); - self.element.navigate('fabric-splash', context); - }); - - window.page(); - } - - return this; - } - - async _appendMessage (msg) { - if (this.settings.verbosity > 2) console.log(`[${(new Date()).toISOString()}]: ${msg}`); - } - - async _appendWarning (msg) { - console.warn(`[${(new Date()).toISOString()}]: ${msg}`); - } - - async _appendError (msg) { - console.error(`[${(new Date()).toISOString()}]: ${msg}`); - } - - /** - * Configure the Application to use a specific element. - * @param {DOMElement} element DOM element to bind to. - * @return {App} Configured instance of the Application. - */ - attach (element) { - this.element = element; - return this; - } - - /** - * Define the Application's resources from an existing resource map. - * @param {Object} resources Map of resource definitions by name. - * @return {App} Configured instance of the Application. - */ - consume (resources) { - let self = this; - - self.element.resources = resources; - - for (let key in resources) { - let def = resources[key]; - self.define(def.name, def); - } - - return this; - } - - /** - * Use a CSS selector to find an element in the current document's tree and - * bind to it as the render target. - * @param {String} selector CSS selector. - * @return {App} Instance of app with bound element. - */ - envelop (selector) { - try { - let element = document.querySelector(selector); - - if (!element) { - this.log('[FABRIC:APP]', 'envelop()', 'could not find element:', selector); - return null; - } - - this._bindEvents(element); - this.attach(element); - } catch (E) { - console.error('Could not envelop element:', E); - } - - return this; - } - - /** - * Define a named {@link Resource}. - * @param {String} name Human-friendly name for this resource. - * @param {Object} definition Map of configuration values. - * @return {App} Configurated instance of the {@link App}. - */ - use (name, definition) { - this.log('[APP]', 'using:', name, definition); - super.use(name, definition); - return this; - } - - /** - * Get the output of our program. - * @return {String} Output of the program. - */ - render () { - const actor = new Actor$3(this._state); - const html = `` + - `\n ` + - `\n ${actor.serialize()}` + - '\n ' + - `\n\n`; - - const sample = new Actor$3(html); - - if (this.element) { - this.element.setAttribute('integrity', `sha256:${sample.preimage}`); - this.element.innerHTML = html; - } - - return html; - } - - _registerCommand (command, method) { - this.commands[command] = method.bind(this); - } - - /** - * Registers a named {@link Service} with the application. Services are - * standardized interfaces for Fabric contracts, emitting {@link Message} - * events with a predictable lifecycle. - * @internal - * @param {String} name Internal name of the service. - * @param {Class} Service The ES6 class definition implementing {@link Service}. - * @returns {Service} The registered service instance. - */ - _registerService (name, Service) { - const self = this; - const service = new Service(merge$1({}, this.settings, this.settings[name])); - - if (this.services[name]) { - return this._appendWarning(`Service already registered: ${name}`); - } - - this.services[name] = service; - - this.services[name].on('error', function (msg) { - self._appendError(`Service "${name}" emitted error: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('warning', function (msg) { - self._appendWarning(`Service warning from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('message', function (msg) { - self._appendMessage(`@services/${name} -- (${typeof msg}) ${JSON.stringify(msg, null, ' ')}`); - switch (msg['@type']) { - case 'ChatMessage': - self.node.relayFrom(self.node.id, Message$1.fromVector(['ChatMessage', JSON.stringify(msg)])); - break; - } - }); - - this.on('identity', function _registerActor (identity) { - if (this.settings.services.includes(name)) { - self._appendMessage(`Registering actor on service "${name}": ${JSON.stringify(identity)}`); - - try { - this.services[name]._registerActor(identity); - } catch (exception) { - self._appendError(`Error from service "${name}" during _registerActor: ${exception}`); - } - } - }); - - return this.services[name]; - } - } - - var app$1 = App$4; - - const Actor$2 = actor; - const merge = lodash_merge.exports; - - class Block$2 extends Actor$2 { - constructor (input = {}) { - super(input); - - this._state = merge({ - parent: null, - transactions: {}, - signatures: [] - }, input); - - Object.defineProperty(this, '_events', { enumerable: false }); - Object.defineProperty(this, '_eventCount', { enumerable: false }); - Object.defineProperty(this, 'observer', { enumerable: false }); - - return this; - } - - get transactions () { - return this._state.transactions; - } - - sign () { - const actor = new Actor$2(this._state); - const data = actor.toString(); - const array = this.key._sign(data); - this._state.signature = Buffer.from(array); - return this._state.signature; - } - - validate () { - // TODO: implement validators - } - } - - var block = Block$2; - - const { - MAX_TX_PER_BLOCK - } = constants$1; - - const monitor$1 = duplex; - - const Actor$1 = actor; - const Block$1 = block; - const Stack$4 = stack$2; - const State$2 = state$2; - - /** - * Chain. - * @property {String} name Current name. - * @property {Map} indices - * @property {Storage} storage - */ - class Chain$1 extends Actor$1 { - /** - * Holds an immutable chain of events. - * @param {Vector} genesis Initial state for the chain of events. - */ - constructor (origin = {}) { - super(origin); - - this.name = (origin) ? origin.name : '@fabric/playnet'; - this.settings = Object.assign({ - name: this.name, - type: 'sha256', - validator: this.validate.bind(this) - }, origin); - - // Internal State - this._state = { - blocks: {}, - genesis: null, - consensus: null, - transactions: {}, - mempool: [], - ledger: [] - }; - - return this; - } - - static fromObject (data) { - return new Chain$1(data); - } - - get consensus () { - return this.tip; - } - - get tip () { - return this._state.consensus; - } - - get root () { - return this.mast.getRoot(); - } - - get blocks () { - return this._state.ledger; - } - - get leaves () { - return this.blocks.map(x => Buffer.from(x, 'hex')); - } - - get subsidy () { - return 50; - } - - get mempool () { - return this._state.mempool; - } - - get _tree () { - const stack = new Stack$4(this.leaves); - return stack.asMerkleTree(); - } - - trust (source) { - const self = this; - - source.on('message', function TODO (message) { - self.emit('debug', `Message from trusted source: ${message}`); - }); - - return self; - } - - async start () { - const chain = this; - - // Monitor changes - this.observer = monitor$1.observe(this._state); - - // before returning, ensure a commit - await chain.commit(); - - return chain; - } - - async stop () { - await this.commit(); - return this; - } - - async attach (application) { - if (!application.store) { - this.emit('error', `Application has no "store" property.`); - } else { - this.store = application.store; - } - - return this; - } - - async open () { - return this.storage.open(); - } - - async close () { - return this.storage.close(); - } - - async _load () { - const chain = this; - - const query = await chain.storage.get('/blocks'); - const response = new State$2(query); - - this.log('query:', query); - this.log('response:', response); - this.log('response id:', response.id); - - return chain; - } - - async append (block) { - if (!block) throw new Error('Must provide a block.'); - if (!(block instanceof Block$1)) { - block = new Block$1(block); - } - - if (this.blocks.length <= 0) { - this._state.genesis = block.id; - } - - this._state.blocks[block.id] = block; - this._state.ledger.push(block.id); - this._state.consensus = block.id; - - await this.commit(); - - this.emit('block', block); - - return this; - } - - async _listBlocks () { - return this.blocks; - } - - async proposeTransaction (transaction) { - const actor = new Actor$1(transaction); - - this._state.transactions[actor.id] = actor; - this._state.mempool.push(actor.id); - - return actor; - } - - async generateBlock () { - const proposal = { - parent: this.consensus, - transactions: [] - }; - - // TODO: _sortFees - if (this.mempool.length) { - for (let i = 0; i < MAX_TX_PER_BLOCK; i++) { - const candidate = this.mempool.shift(); - if (candidate) { - proposal.transactions.push(candidate); - } - } - } - - const block = new Block$1(proposal); - await this.append(block); - - return block; - } - - async generateBlocks (count = 1) { - const blocks = []; - - for (let i = 0; i < count; i++) { - const block = await this.generateBlock(); - blocks.push(block); - } - - return blocks; - } - - async commit () { - let changes = null; - - if (this.observer) { - changes = monitor$1.generate(this.observer); - } - - if (changes) { - this.emit('changes', { - type: 'StateChanges', - data: changes - }); - } - - const state = new Actor$1(this._state); - return state.id; - } - - async verify (level = 4, depth = 6) { - this.log(`Verification Level ${level} running from -${depth}...`); - console.log('root:', this.root); - return (this['@id'] === this.root); - } - - validate (chain) { - let valid = false; - for (let i = 0; i < chain.height; i++) { - chain.blocks[i]; - } - return valid; - } - - render () { - console.log('[CHAIN]', '[RENDER]', this); - return ``; - } - } - - var chain = Chain$1; - - const Scribe$3 = scribe; - const Stack$3 = stack$2; - - /** - * An ordered stack of pages. - * @property {Buffer} memory The ledger's memory (4096 bytes). - * @property {Stack} stack The ledger's stack. - * @property {Mixed} tip The most recent page in the ledger. - * @extends Scribe - */ - class Ledger$1 extends Scribe$3 { - constructor (state) { - super(state); - - this.memory = Buffer.alloc(4096); - this.pages = new Stack$3(state || []); - - return this; - } - - get tip () { - return this.pages[this.pages.length - 1]; - } - - async start () { - await super.start(); - - if (!this.pages.length) { - await this.append({ - name: 'genesis' - }); - } - - this.status = 'started'; - - return this; - } - - /** - * Attempts to append a {@link Page} to the ledger. - * @param {Mixed} item Item to store. - * @return {Promise} Resolves after the change has been committed. - */ - async append (item) { - this.pages.push(item); - await this.pages.commit(); - await this.commit(); - return this; - } - - commit () { - if (!this.pages) return null; - this['@data'] = this.pages['@data']; - return this.id; - } - - consume (ink) { - if (!this.ink) this.ink = ink; - return this.ink; - } - - render () { - return ``; - } - } - - var ledger = Ledger$1; - - const monitor = duplex; - - class Observer$1 { - constructor (target) { - this.observer = monitor.observe(target); - return this; - } - } - - var observer = Observer$1; - - const Scribe$2 = scribe; - const Stack$2 = stack$2; - - class Vector$2 extends Scribe$2 { - /** - * An "Initialization" Vector. - * @param {Object} - Input state (will map to `@data`.) - * @constructor - */ - constructor (origin) { - super(origin); - - this.settings = Object.assign({}, origin); - - this.known = {}; - this.registry = {}; - - this.stack = new Stack$2(); - this.script = []; - - this.status = 'initialized'; - - return this; - } - - static fromObjectString (input = '') { - if (!input) throw new Error('Must provide input.'); - if (typeof input !== 'string') input = JSON.stringify(input); - let result = []; - let object = JSON.parse(input); - - for (let i in object) { - let element = object[i]; - - if (element instanceof Array) { - element = Buffer.from(element); - } else { - element = Buffer.from(element.data); - } - - result.push(element); - } - - return result; - } - - /** - * _serialize is a placeholder, should be discussed. - * @param {String} input - What to serialize. Defaults to `this.state`. - * @return {String} - resulting string [JSON-encoded version of the local `@data` value.] - */ - _serialize (input) { - return this.toString(input); - } - - _deserialize (input) { - return this.fromString(input); - } - - // TODO: standardize on a serialization format - fromString (input) { - return JSON.parse(input); - } - - toObject () { - let object = {}; - for (let property in this['@data']) { - if (property.charAt(0) !== '@') { - object[property] = this['@data'][property]; - } - } - return object; - } - - /** - * Render the output to a {@link String}. - * @param {Mixed} input Arbitrary input. - * @return {String} - */ - toString (input) { - if (!input) input = this.state; - // TODO: standardize on a serialization format - return JSON.stringify(input); - } - - validate (input) { - return true; - } - - async step () { - return super.compute((this.clock | 0)); - } - } - - var vector$1 = Vector$2; - - const Vector$1 = vector$1; - - class Opcode$1 { - constructor (definition) { - let opcode = this; - - opcode.config = Object.assign({}, definition); - opcode.vector = new Vector$1(definition)._sign(); - - return function Opcode (input) { - opcode.output = definition.call({ - id: opcode.vector['@id'] - }, input); - - return opcode.output; - }; - } - } - - var opcode = Opcode$1; - - const Machine$2 = machine; - const Resource$3 = resource$1; - const Store$1 = store_1; - - /** - * An Oracle manages one or more collections, using a mempool for - * transitive state. - * @extends Store - */ - class Oracle$1 extends Store$1 { - /** - * Trusted point-of-reference for external services. - * @param {Object} initial - Initialization vector. - */ - constructor (init) { - super(init); - - this.name = 'Oracle'; - this.config = Object.assign({ - path: './stores/oracle', - services: ['http'], - resources: { - Actors: {}, - Keys: {} - } - }, init); - - this.machine = new Machine$2(this.config); - this.mempool = []; - - this.resources = new Set(); - this.keys = new Set(); - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - _handleStateChange (changes) { - this.mempool.push(changes); - // this.emit('changes', changes); - } - - /** - * Core messaging function for interacting with this object in system-time. - * @param {Message} msg Instance of a {@link module:Message} object, validated then transmitted verbatim. - * @return {Boolean} Returns `true` on success, `false` on failure. - */ - broadcast (msg) { - return this.emit('message', msg); - } - - async define (name, definition) { - const resource = Object.assign({ - name: name - }, definition); - - this.resources[name] = new Resource$3(resource); - this.emit('resource', this.resources[name]); - - return this.resources[name]; - } - - async start () { - try { - await this.open(); - } catch (E) { - console.error('Could not open Oracle:', E); - } - - // TODO: define all resources - await Promise.all([ - this.define('Actor', { - attributes: { - name: { type: 'String', required: true, max: 220 } - } - }), - this.define('Asset', { - attributes: { - name: { type: 'String', required: true, max: 220 } - } - }), - this.define('Hash', { - attributes: { - 'sha256': { type: 'String', required: true, max: 32 }, - '@data': { type: 'String', required: true, max: 2048 } - } - }) - ]); - - // TODO: pre-populate - // this.state = await this._GET('/'); - // console.log('state retrieved:', this.state); - // this.machine.on('changes', this._handleStateChange.bind(this)); - - return this; - } - - async stop () { - try { - await this.close(); - } catch (E) { - console.error('Could not close Oracle:', E); - } - - return this; - } - - async _sync () { - for (let name in this.machine.state) { - let data = this.machine.state[name]; - let path = `/${name}`; - await this._PUT(path, data); - } - } - - async flush () { - this.log('[ORACLE]', 'flush requested:', this.keys); - - for (let item of this.keys) { - this.log('...flushing:', item); - try { - await this._DELETE(item); - } catch (E) { - console.error(E); - } - } - } - } - - var oracle = Oracle$1; - - const Stack$1 = stack$2; - - // addresses of known operators - const known = { - 'OP_0': '0x5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9', - 'OP_1': '0x6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b' - }; - - class Script$2 extends Stack$1 { - /** - * Compose a {@link Script} for inclusion within a {@link Contract}. - * @param {Mixed} config Configuration options for the script. - * @return {Script} Instance of the {@link Script}, ready for use. - */ - constructor (config) { - super(config); - this.stack = new Stack$1(); - this['@data'] = this.stack['@data']; - return this; - } - - compile () { - return this.stack.map(x => { - return known[x] || x; - }); - } - - render () { - return this.stack.join(' '); - } - } - - var script = Script$2; - - const Circuit$2 = circuit; - const Script$1 = script; - - class Program$1 extends Circuit$2 { - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - instructions: [] - }, settings); - - this.circuit = new Circuit$2(); - this.script = new Script$1(); - - this.state = {}; - - return this; - } - - step () { - console.log('[FABRIC:PROGRAM]', 'Executing step...'); - } - - async start () { - console.log('[FABRIC:PROGRAM]', 'Starting execution...'); - } - } - - var program = Program$1; - - const Scribe$1 = scribe; - - // TODO: re-define this class for Fabric messages - // Current code is specific to @fabric/doorman — should be a general- - // purpose Router, not for strings and triggers in chat messages. - - /** - * Process incoming messages. - * @extends Scribe - */ - class Router$4 extends Scribe$1 { - /** - * Maintains a list of triggers ("commands") and their behaviors. - * @param {Object} map Map of command names => behaviors. - */ - constructor (config) { - super(config); - - this.settings = Object.assign({ - routes: {}, - handlers: {}, - trigger: '!' - }, config); - - this.handlers = {}; - this.status = 'ready'; - - return this; - } - - /** - * Assembles a list of possible responses to the incoming request. - * @param {String} msg Input message to route. - * @return {Array} List of outputs generated from the input string. - */ - async route (msg) { - if (!msg.actor || !msg.object || !msg.target) return null; - if (typeof msg.object !== 'string') return null; - - let output = []; - let parts = msg.object - .split(/\s+/g) - .filter(x => x.charAt(0) === this.settings.trigger) - .map(x => x.substr(1)); - - for (let i in parts) { - let token = parts[i]; - let command = token.toLowerCase(); - let handler = this.handlers[command]; - let result = null; - - if (handler) { - switch (typeof handler.value) { - case 'string': - result = handler.value; - break; - default: - this.log('no such native trigger, calling...', command); - // TODO: remove this.fabric.plugins call - result = await handler.value.apply(this.fabric.plugins[handler.plugin], [msg]); - break; - } - - if (result) { - output.push(result); - } - } - } - - return output; - } - - /** - * Attaches a new handler to the router. - * @param {Plugin} plugin Instance of the plugin. - * @param {Plugin.name} name Name of the plugin. - * @return {Router} Configured instance of the router. - */ - use (plugin) { - if (!plugin.name) throw new Error('Cannot use plugin: no "name" attribute specified.'); - this.handlers[plugin.name] = plugin; - return this; - } - } - - var router$1 = Router$4; - - const Machine$1 = machine; - const Router$3 = router$1; - const Service$5 = service_1; - - /** - * Workers are arbitrary containers for processing data. They can be thought of - * almost like "threads", as they run asynchronously over the duration of a - * contract's lifetime as "fulfillment conditions" for its closure. - * @param {Function} method Pure function. - * @constructor - */ - class Worker$2 extends Service$5 { - constructor (method) { - super(method); - // self.worker = new Worker('validator.js'); - this.method = method; - this.machine = new Machine$1(); - this.router = new Router$3(); - this.behaviors = {}; - } - - use (definition) { - return this.router.use(definition); - } - - /** - * Handle a task. - * @param {Vector} input Input vector. - * @return {String} Outcome of the requested job. - */ - async compute (input) { - let output = await this.machine.compute(input); - - console.log('[FABRIC:WORKER]', this.machine.clock, 'Computed output:', output); - - switch (input) { - case 'PING': - this.emit('pong'); - break; - } - - return output; - } - - async route (path) { - switch (path) { - default: - await this.compute(path); - break; - } - } - } - - var worker = Worker$2; - - const Service$4 = service_1; - - class Local extends Service$4 { - constructor (config) { - super(config); - this.config = Object.assign({ - path: './stores/local' - }, config); - return this; - } - - handler (message) { - this.log('[LOCAL:HANDLER]', 'handling message:', message); - let data = Object.assign({ - actor: message.user, - target: message.channel, - object: message.text, - origin: { - type: 'Link', - name: 'Internal' - } - }, message); - this.emit('message', data); - } - - async start () { - this.log('[LOCAL:START]', 'starting...'); - return super.start(); - } - } - - var local = Local; - - // external dependencies - const crypto$3 = require$$0__default["default"]; - - // components - const Actor = actor; - const App$3 = app$1; - const Block = block; - const Chain = chain; - const Circuit$1 = circuit; - const Collection$2 = collection$1; - // const Contract = require('./contract'); - // const Disk = require('./disk'); - const Entity$1 = entity; - const Key$1 = key$1; - const Ledger = ledger; - const Machine = machine; - const Message = message$1; - const Observer = observer; - const Opcode = opcode; - const Oracle = oracle; - // const Peer = require('./peer'); - const Program = program; - // const Remote = require('../types/remote'); - const Resource$2 = resource$1; - const Service$3 = service_1; - const Scribe = scribe; - const Script = script; - const Stack = stack$2; - const State$1 = state$2; - const Store = store_1; - // const Swarm = require('../types/swarm'); - // const Transaction = require('./transaction'); - const Vector = vector$1; - const Wallet = wallet; - const Worker$1 = worker; - - /** - * Reliable decentralized infrastructure. - * @property {Class} Block - */ - class Fabric$5 extends Service$3 { - /** - * The {@link Fabric} type implements a peer-to-peer protocol for - * establishing and settling of mutually-agreed upon proofs of - * work. Contract execution takes place in the local node first, - * then is optionally shared with the network. - * - * Utilizing - * @exports Fabric - * @constructor - * @param {Vector} config - Initial configuration for the Fabric engine. This can be considered the "genesis" state for any contract using the system. If a chain of events is maintained over long periods of time, `state` can be considered "in contention", and it is demonstrated that the outstanding value of the contract remains to be settled. - * @emits Fabric#thread - * @emits Fabric#step Emitted on a `compute` step. - */ - constructor (vector = {}) { - super(vector); - - // local settings - this.settings = Object.assign({ - path: './stores/fabric', - persistent: false - }, vector); - - // start with reference to object - this.ident = new Actor(this.config); - this.state = new Actor(vector); // State - - // build maps - this.agent = {}; // Identity - this.modules = {}; // List - this.opcodes = {}; // Map - this.peers = {}; // Map - this.plugins = {}; // Map - this.services = {}; // Map - - // initialize components - this.chain = new Chain(this.config); - this.machine = new Machine(this.config); - this.store = new Store(this.config); - // this.script = new Script(this.config); - - this._state = { - status: 'PAUSED', - content: this.state.data - }; - - // provide instance - return this; - } - - static get registry () { - return { - local: local - }; - } - - static get App () { return App$3; } - static get Block () { return Block; } - static get Chain () { return Chain; } - static get Circuit () { return Circuit$1; } - static get Collection () { return Collection$2; } - // static get Contract () { return Contract; } - // static get Disk () { return Disk; } - static get Entity () { return Entity$1; } - static get Key () { return Key$1; } - static get Ledger () { return Ledger; } - static get Machine () { return Machine; } - static get Message () { return Message; } - static get Observer () { return Observer; } - static get Oracle () { return Oracle; } - // static get Peer () { return Peer; } - static get Program () { return Program; } - static get Remote () { return Remote; } - static get Resource () { return Resource$2; } - static get Service () { return Service$3; } - static get Scribe () { return Scribe; } - static get Script () { return Script; } - static get Stack () { return Stack; } - static get State () { return State$1; } - static get Store () { return Store; } - static get Swarm () { return Swarm; } - // static get Transaction () { return Transaction; } - static get Vector () { return Vector; } - static get Wallet () { return Wallet; } - static get Worker () { return Worker$1; } - - static sha256 (data) { - return crypto$3.createHash('sha256').update(data).digest('hex'); - } - - static random () { - // TODO: select random function - // do not trust keys until this is determined! - return Math.random(); - } - - async _GET (key) { - return this.store._GET(key); - } - - async _SET (key, value) { - return this.store._SET(key, value); - } - - async _PUT (key, value) { - return this.store._SET(key, value); - } - - async _POST (collection, value) { - return this.store._POST(collection, value); - } - - async _PATCH (key, overlay) { - return this.store._PATCH(key, overlay); - } - - async _DELETE (key) { - return this.store._DELETE(key); - } - - /** - * Register an available {@link Service} using an ES6 {@link Class}. - * @param {Class} service The ES6 {@link Class}. - */ - async register (service) { - if (!service) return new Error('Service must be provided.'); - - try { - let name = service.name || service.constructor.name; - this.modules[name.toLowerCase()] = service; - this.emit('message', { - '@type': 'ServiceRegistration', - '@data': { name: name } - }); - } catch (E) { - this.error('Could not register service:', E); - } - - return this; - } - - async enable (name) { - let self = this; - let Module = null; - let config = Object.assign({ - name: name, - path: `./stores/${name}` - }, this.config[name]); - - if (this.modules[name]) { - Module = this.modules[name]; - } else { - return this.error(`Could not enable module ${name}. Check local registry.`); - } - - // configure the service - this.services[name] = new Module(config); - this.services[name].on('ready', function () { - self.emit('service:ready', { name }); - }); - - // bind all events - self.trust(this.services[name]); - - try { - await this.services[name].start(); - this.emit('message', { - '@type': 'ServiceStartup', - '@data': { name: name } - }); - } catch (E) { - console.error(`exceptioning:`, E); - } - - return this; - } - - append (value) { - return this.chain.append(value); - } - - set (key, value) { - return State$1.pointer.set(this['@entity'], key, value); - } - - get (key) { - return State$1.pointer.get(this['@entity'], key); - } - - /** - * Push an instruction onto the stack. - * @param {Instruction} value - * @return {Stack} - */ - push (value) { - let name = value.constructor.name; - if (name !== 'Vector') value = new Vector(value)._sign(); - this.machine.script.push(value); - return this.machine.script; - } - - use (name, description) { - this.log('[FABRIC]', `defining ${name} as:`, description); - this.opcodes[name] = new Opcode(description); - return this.define(name, description); - } - - define (name, description) { - this.log(`Defining resource "${name}":`, description); - let vector = new Fabric$5.State(description); - let resource = new Fabric$5.Resource(name, description); - this.log(`Resource:`, resource); - this.log(`Resource as vector:`, vector); - return resource; - } - - identify (vector) { - if (!vector) vector = {}; - - let self = this; - let key = new Key$1(); - - self.identity = { key }; - - // a "vector" is a known truth, something that we've generated ourselves - // or otherwise derived truth from an origin (a genesis vector - // TODO: remove lodash - self['@data'] = Object.assign({}, self['@data'], vector, key); // should be equivalent to `f(x + y)` - - this.emit('auth', { - key: { - public: key.public - } - }); - - return this; - } - - send (target, message) { - // console.log('sending:', target, message); - return this.emit('message', { - 'target': target, - 'object': message - }); - } - - broadcast (msg, data) { - var self = this; - - self.emit(msg, data); - - Object.keys(self.peers).forEach(function tell (id) { - var peer = self.peers[id]; - peer.send(msg); - }); - - return true; - } - - /** - * Blindly consume messages from a {@link Source}, relying on `this.chain` to - * verify results. - * @param {EventEmitter} source Any object which implements the `EventEmitter` pattern. - * @return {Fabric} Returns itself. - */ - trust (source) { - let self = this; - - this.warn('[TRUST]', 'trusting:', typeof source); - - source.on('changes', async function (changes) { - self.log('source', typeof source, 'emitted:', changes); - }); - - source.on('transaction', async function (transaction) { - // console.log('[FABRIC:CORE]', '[EVENT:TRANSACTION]', `source (${source.constructor.name}):`, transaction); - // console.log('[PROPOSAL]', 'apply this transaction to local state:', transaction); - }); - - source.on('block', async function (block) { - await self.chain.append(block).catch(self.log.bind(self)); - }); - - source.on('patch', function (patch) { - console.log('source', typeof source, 'emitted patch:', patch); - self.emit('patch', Object.assign({}, patch, { - path: source.name + patch.path // TODO: check in Vector Machine that this is safe - })); - }); - - // normalized bindings - source.on('actor', function (actor) { - self.log(typeof source, 'source emitted actor:', actor); - self.emit('actor', { - id: [source.name, 'actors', actor.id].join('/'), - name: actor.name, - online: actor.online || false, - subscriptions: [] - }); - }); - - source.on('channel', function (channel) { - self.emit('channel', { - id: [source.name, 'channels', channel.id].join('/'), - name: channel.name, - members: [] - }); - }); - - source.on('join', async function (join) { - self.emit('join', { - user: [source.name, 'actors', join.user].join('/'), - channel: [source.name, 'channels', join.channel].join('/') - }); - }); - - source.on('message', async function (msg) { - let now = Date.now(); - let id = [now, msg.actor, msg.target, msg.object].join('/'); - let hash = crypto$3.createHash('sha256').update(id).digest('hex'); - let message = { - id: [source.name, 'messages', (msg.id || hash)].join('/'), - actor: [source.name, 'actors', msg.actor].join('/'), - target: [source.name, 'channels', msg.target].join('/'), - object: msg.object, - origin: { - type: 'Link', - name: source.name - }, - created: now - }; - - this.log('message:', message); - self.emit('message', message); - - let response = await self.parse(message); - if (response) { - await source.send(msg.target, response, { - parent: message - }); - - self.emit('response', { - parent: message, - response: response - }); - } - }); - - return self; - } - - /** - * Process the current stack. - * @return {Fabric} Resulting instance of the stack. - */ - compute () { - ++this.clock; - // console.log('[FABRIC:COMPUTE]', '[COMMIT:RESULT]', this.commit()); - return this; - } - - render () { - return ``; - } - } - - var fabric$2 = Fabric$5; - - /** - * # Fabric: an experimental p2p framework - * Providing an interface to Fabric network, this file defines the available - * components and abstractions used when relying on this library. - */ - - const Fabric$4 = fabric$2; - - /** - * Default interface to {@link Fabric}. Provides immutable types for all - * elements of the `components` option. - * @property {Configuration} config Initial {@link Vector}. - * @property {Map} config.components Transformation function of `Σ ⇒ Δ`. - */ - class App$2 extends Fabric$4 { - /** - * Create a new instance of the Fabric App. - * @param {Object} [config] Configuration object. - * @param {Object} [config.store] Path to local storage. - * @param {Object} [config.components] Map of components. - * @param {Object} [config.components.list] Name of "list" component. - * @param {Object} [config.components.view] Name of "view" component. - * @return {App} - */ - constructor (config) { - super(config); - - // Store the configuration - this.config = Object.assign({ - store: `./stores/${this.constructor.name.toLowerCase()}` - }, config); - - return this; - } - - /** - * Draw the application to canvas (display). - * @return {Mixed} - */ - render () { - return ``; - } - } - - var fabric$1 = App$2; - - /** - * Tokenize input string. - */ - function lexer(str) { - var tokens = []; - var i = 0; - while (i < str.length) { - var char = str[i]; - if (char === "*" || char === "+" || char === "?") { - tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); - continue; - } - if (char === "\\") { - tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); - continue; - } - if (char === "{") { - tokens.push({ type: "OPEN", index: i, value: str[i++] }); - continue; - } - if (char === "}") { - tokens.push({ type: "CLOSE", index: i, value: str[i++] }); - continue; - } - if (char === ":") { - var name = ""; - var j = i + 1; - while (j < str.length) { - var code = str.charCodeAt(j); - if ( - // `0-9` - (code >= 48 && code <= 57) || - // `A-Z` - (code >= 65 && code <= 90) || - // `a-z` - (code >= 97 && code <= 122) || - // `_` - code === 95) { - name += str[j++]; - continue; - } - break; - } - if (!name) - throw new TypeError("Missing parameter name at ".concat(i)); - tokens.push({ type: "NAME", index: i, value: name }); - i = j; - continue; - } - if (char === "(") { - var count = 1; - var pattern = ""; - var j = i + 1; - if (str[j] === "?") { - throw new TypeError("Pattern cannot start with \"?\" at ".concat(j)); - } - while (j < str.length) { - if (str[j] === "\\") { - pattern += str[j++] + str[j++]; - continue; - } - if (str[j] === ")") { - count--; - if (count === 0) { - j++; - break; - } - } - else if (str[j] === "(") { - count++; - if (str[j + 1] !== "?") { - throw new TypeError("Capturing groups are not allowed at ".concat(j)); - } - } - pattern += str[j++]; - } - if (count) - throw new TypeError("Unbalanced pattern at ".concat(i)); - if (!pattern) - throw new TypeError("Missing pattern at ".concat(i)); - tokens.push({ type: "PATTERN", index: i, value: pattern }); - i = j; - continue; - } - tokens.push({ type: "CHAR", index: i, value: str[i++] }); - } - tokens.push({ type: "END", index: i, value: "" }); - return tokens; - } - /** - * Parse a string for the raw tokens. - */ - function parse$1(str, options) { - if (options === void 0) { options = {}; } - var tokens = lexer(str); - var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; - var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?"); - var result = []; - var key = 0; - var i = 0; - var path = ""; - var tryConsume = function (type) { - if (i < tokens.length && tokens[i].type === type) - return tokens[i++].value; - }; - var mustConsume = function (type) { - var value = tryConsume(type); - if (value !== undefined) - return value; - var _a = tokens[i], nextType = _a.type, index = _a.index; - throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); - }; - var consumeText = function () { - var result = ""; - var value; - while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { - result += value; - } - return result; - }; - while (i < tokens.length) { - var char = tryConsume("CHAR"); - var name = tryConsume("NAME"); - var pattern = tryConsume("PATTERN"); - if (name || pattern) { - var prefix = char || ""; - if (prefixes.indexOf(prefix) === -1) { - path += prefix; - prefix = ""; - } - if (path) { - result.push(path); - path = ""; - } - result.push({ - name: name || key++, - prefix: prefix, - suffix: "", - pattern: pattern || defaultPattern, - modifier: tryConsume("MODIFIER") || "", - }); - continue; - } - var value = char || tryConsume("ESCAPED_CHAR"); - if (value) { - path += value; - continue; - } - if (path) { - result.push(path); - path = ""; - } - var open = tryConsume("OPEN"); - if (open) { - var prefix = consumeText(); - var name_1 = tryConsume("NAME") || ""; - var pattern_1 = tryConsume("PATTERN") || ""; - var suffix = consumeText(); - mustConsume("CLOSE"); - result.push({ - name: name_1 || (pattern_1 ? key++ : ""), - pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, - prefix: prefix, - suffix: suffix, - modifier: tryConsume("MODIFIER") || "", - }); - continue; - } - mustConsume("END"); - } - return result; - } - /** - * Compile a string to a template function for the path. - */ - function compile$1(str, options) { - return tokensToFunction(parse$1(str, options), options); - } - /** - * Expose a method for transforming tokens into the path function. - */ - function tokensToFunction(tokens, options) { - if (options === void 0) { options = {}; } - var reFlags = flags(options); - var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; - // Compile all the tokens into regexps. - var matches = tokens.map(function (token) { - if (typeof token === "object") { - return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); - } - }); - return function (data) { - var path = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (typeof token === "string") { - path += token; - continue; - } - var value = data ? data[token.name] : undefined; - var optional = token.modifier === "?" || token.modifier === "*"; - var repeat = token.modifier === "*" || token.modifier === "+"; - if (Array.isArray(value)) { - if (!repeat) { - throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array")); - } - if (value.length === 0) { - if (optional) - continue; - throw new TypeError("Expected \"".concat(token.name, "\" to not be empty")); - } - for (var j = 0; j < value.length; j++) { - var segment = encode(value[j], token); - if (validate && !matches[i].test(segment)) { - throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); - } - path += token.prefix + segment + token.suffix; - } - continue; - } - if (typeof value === "string" || typeof value === "number") { - var segment = encode(String(value), token); - if (validate && !matches[i].test(segment)) { - throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); - } - path += token.prefix + segment + token.suffix; - continue; - } - if (optional) - continue; - var typeOfMessage = repeat ? "an array" : "a string"; - throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage)); - } - return path; - }; - } - /** - * Create path match function from `path-to-regexp` spec. - */ - function match$1(str, options) { - var keys = []; - var re = pathToRegexp$1(str, keys, options); - return regexpToFunction(re, keys, options); - } - /** - * Create a path match function from `path-to-regexp` output. - */ - function regexpToFunction(re, keys, options) { - if (options === void 0) { options = {}; } - var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; - return function (pathname) { - var m = re.exec(pathname); - if (!m) - return false; - var path = m[0], index = m.index; - var params = Object.create(null); - var _loop_1 = function (i) { - if (m[i] === undefined) - return "continue"; - var key = keys[i - 1]; - if (key.modifier === "*" || key.modifier === "+") { - params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { - return decode(value, key); - }); - } - else { - params[key.name] = decode(m[i], key); - } - }; - for (var i = 1; i < m.length; i++) { - _loop_1(i); - } - return { path: path, index: index, params: params }; - }; - } - /** - * Escape a regular expression string. - */ - function escapeString(str) { - return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); - } - /** - * Get the flags for a regexp from the options. - */ - function flags(options) { - return options && options.sensitive ? "" : "i"; - } - /** - * Pull out keys from a regexp. - */ - function regexpToRegexp(path, keys) { - if (!keys) - return path; - var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; - var index = 0; - var execResult = groupsRegex.exec(path.source); - while (execResult) { - keys.push({ - // Use parenthesized substring match if available, index otherwise - name: execResult[1] || index++, - prefix: "", - suffix: "", - modifier: "", - pattern: "", - }); - execResult = groupsRegex.exec(path.source); - } - return path; - } - /** - * Transform an array into a regexp. - */ - function arrayToRegexp(paths, keys, options) { - var parts = paths.map(function (path) { return pathToRegexp$1(path, keys, options).source; }); - return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); - } - /** - * Create a path regexp from string input. - */ - function stringToRegexp(path, keys, options) { - return tokensToRegexp(parse$1(path, options), keys, options); - } - /** - * Expose a function for taking tokens and returning a RegExp. - */ - function tokensToRegexp(tokens, keys, options) { - if (options === void 0) { options = {}; } - var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; - var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); - var delimiterRe = "[".concat(escapeString(delimiter), "]"); - var route = start ? "^" : ""; - // Iterate over the tokens and create our regexp string. - for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { - var token = tokens_1[_i]; - if (typeof token === "string") { - route += escapeString(encode(token)); - } - else { - var prefix = escapeString(encode(token.prefix)); - var suffix = escapeString(encode(token.suffix)); - if (token.pattern) { - if (keys) - keys.push(token); - if (prefix || suffix) { - if (token.modifier === "+" || token.modifier === "*") { - var mod = token.modifier === "*" ? "?" : ""; - route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod); - } - else { - route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); - } - } - else { - if (token.modifier === "+" || token.modifier === "*") { - route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")"); - } - else { - route += "(".concat(token.pattern, ")").concat(token.modifier); - } - } - } - else { - route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); - } - } - } - if (end) { - if (!strict) - route += "".concat(delimiterRe, "?"); - route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); - } - else { - var endToken = tokens[tokens.length - 1]; - var isEndDelimited = typeof endToken === "string" - ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 - : endToken === undefined; - if (!strict) { - route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); - } - if (!isEndDelimited) { - route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); - } - } - return new RegExp(route, flags(options)); - } - /** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - */ - function pathToRegexp$1(path, keys, options) { - if (path instanceof RegExp) - return regexpToRegexp(path, keys); - if (Array.isArray(path)) - return arrayToRegexp(path, keys, options); - return stringToRegexp(path, keys, options); - } - - var dist_es2015 = /*#__PURE__*/Object.freeze({ - __proto__: null, - parse: parse$1, - compile: compile$1, - tokensToFunction: tokensToFunction, - match: match$1, - regexpToFunction: regexpToFunction, - tokensToRegexp: tokensToRegexp, - pathToRegexp: pathToRegexp$1 - }); - - var require$$1 = /*@__PURE__*/getAugmentedNamespace(dist_es2015); - - const { pathToRegexp, match, parse, compile } = require$$1; - - const Entity = entity; - const Service$2 = service_1; - - /** - * Simple router. - * @type {Object} - */ - class Router$2 extends Service$2 { - /** - * Builds a new {@link Router}. - * @param {Object} [settings={}] Configuration for the router. - * @return {Router} Instance of the {@link Router}. - */ - constructor (settings = {}) { - super(settings); - - let fee = { - '@type': 'BasisPointsOnValue', - '@data': 20 - }; - - this.current = null; - this.settings = Object.assign({ fee }, settings); - this.components = {}; - this.resources = {}; - this.routes = {}; - this.page = null; - - return this; - } - - define (name, definition) { - let result = super.define(name, definition); - - if (definition.components) { - if (definition.components.list) { - this.components[definition.components.list] = 'name/list'; - } - if (definition.components.view) { - this.components[definition.components.view] = 'name/view'; - } - } - - return result; - } - - route (msg) { - console.log('[MAKI:ROUTER]', 'ROUTING THE FOLLOWING MESSAGE', msg, this.routes); - let route = this._route(msg); - console.log('THE ROUTE:', route); - this.current = msg; - return Object.assign({ - fee: this.settings.fee, - route: route - }); - } - - _addRoute (route, component) { - this.routes[component] = { - path: route, - regex: pathToRegexp(route) - }; - // this.router.use(route.path, this._handleRoutableRequest.bind(this)); - return this.routes[route.name]; - } - - _route (path) { - for (let name in this.routes) { - let route = this.routes[name]; - let match = route.regex.exec(path); - if (match) { - return { - resource: route.resource, - component: name - }; - } - } - return null; - } - - /** - * Add a named definition. - * @param {String} path Flat path. - * @param {Object} definition Resource definition? - * @return {Promise} Resolves once added. - */ - async _addFlat (path, definition) { - this.routes[path] = definition; - } - - async _deliver (target, msg) { - console.log('delivering:', target, msg); - return this.members[target]; - } - - async _handleRoutableRequest (event) { - return this.router.route(event); - } - - async start () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'starting...'); - this.status = 'starting'; - - for (let name in this.routes) { - new Entity(this.routes[name].path); - /* this.state.channels[route.id] = Object.assign({ - path: this.routes[name].path, - members: [], - messages: [] - }); */ - } - - this.status = 'started'; - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'started!', this.state); - return this; - } - - async stop () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'Stopping...'); - this.status = 'stopping'; - this.status = 'stopped'; - return this; - } - } - - var router = Router$2; - - var hasOwn = Object.prototype.hasOwnProperty; - var toString = Object.prototype.toString; - - var foreach = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } - }; - - var each = foreach; - var jsonPointer = api; - - - /** - * Convenience wrapper around the api. - * Calls `.get` when called with an `object` and a `pointer`. - * Calls `.set` when also called with `value`. - * If only supplied `object`, returns a partially applied function, mapped to the object. - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - * @returns {*} - */ - - function api (obj, pointer, value) { - // .set() - if (arguments.length === 3) { - return api.set(obj, pointer, value); - } - // .get() - if (arguments.length === 2) { - return api.get(obj, pointer); - } - // Return a partially applied function on `obj`. - var wrapped = api.bind(api, obj); - - // Support for oo style - for (var name in api) { - if (api.hasOwnProperty(name)) { - wrapped[name] = api[name].bind(wrapped, obj); - } - } - return wrapped; - } - - - /** - * Lookup a json pointer in an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @returns {*} - */ - api.get = function get (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer); - - for (var i = 0; i < refTokens.length; ++i) { - var tok = refTokens[i]; - if (!(typeof obj == 'object' && tok in obj)) { - throw new Error('Invalid reference token: ' + tok); - } - obj = obj[tok]; - } - return obj; - }; - - /** - * Sets a value on an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - */ - api.set = function set (obj, pointer, value) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer), - nextTok = refTokens[0]; - - if (refTokens.length === 0) { - throw Error('Can not set the root object'); - } - - for (var i = 0; i < refTokens.length - 1; ++i) { - var tok = refTokens[i]; - if (typeof tok !== 'string' && typeof tok !== 'number') { - tok = String(tok); - } - if (tok === "__proto__" || tok === "constructor" || tok === "prototype") { - continue - } - if (tok === '-' && Array.isArray(obj)) { - tok = obj.length; - } - nextTok = refTokens[i + 1]; - - if (!(tok in obj)) { - if (nextTok.match(/^(\d+|-)$/)) { - obj[tok] = []; - } else { - obj[tok] = {}; - } - } - obj = obj[tok]; - } - if (nextTok === '-' && Array.isArray(obj)) { - nextTok = obj.length; - } - obj[nextTok] = value; - return this; - }; - - /** - * Removes an attribute - * - * @param {Object} obj - * @param {String|Array} pointer - */ - api.remove = function (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer); - var finalToken = refTokens[refTokens.length -1]; - if (finalToken === undefined) { - throw new Error('Invalid JSON pointer for remove: "' + pointer + '"'); - } - - var parent = api.get(obj, refTokens.slice(0, -1)); - if (Array.isArray(parent)) { - var index = +finalToken; - if (finalToken === '' && isNaN(index)) { - throw new Error('Invalid array index: "' + finalToken + '"'); - } - - Array.prototype.splice.call(parent, index, 1); - } else { - delete parent[finalToken]; - } - }; - - /** - * Returns a (pointer -> value) dictionary for an object - * - * @param obj - * @param {function} descend - * @returns {} - */ - api.dict = function dict (obj, descend) { - var results = {}; - api.walk(obj, function (value, pointer) { - results[pointer] = value; - }, descend); - return results; - }; - - /** - * Iterates over an object - * Iterator: function (value, pointer) {} - * - * @param obj - * @param {function} iterator - * @param {function} descend - */ - api.walk = function walk (obj, iterator, descend) { - var refTokens = []; - - descend = descend || function (value) { - var type = Object.prototype.toString.call(value); - return type === '[object Object]' || type === '[object Array]'; - }; - - (function next (cur) { - each(cur, function (value, key) { - refTokens.push(String(key)); - if (descend(value)) { - next(value); - } else { - iterator(value, api.compile(refTokens)); - } - refTokens.pop(); - }); - }(obj)); - }; - - /** - * Tests if an object has a value for a json pointer - * - * @param obj - * @param pointer - * @returns {boolean} - */ - api.has = function has (obj, pointer) { - try { - api.get(obj, pointer); - } catch (e) { - return false; - } - return true; - }; - - /** - * Escapes a reference token - * - * @param str - * @returns {string} - */ - api.escape = function escape (str) { - return str.toString().replace(/~/g, '~0').replace(/\//g, '~1'); - }; - - /** - * Unescapes a reference token - * - * @param str - * @returns {string} - */ - api.unescape = function unescape (str) { - return str.replace(/~1/g, '/').replace(/~0/g, '~'); - }; - - /** - * Converts a json pointer into a array of reference tokens - * - * @param pointer - * @returns {Array} - */ - api.parse = function parse (pointer) { - if (pointer === '') { return []; } - if (pointer.charAt(0) !== '/') { throw new Error('Invalid JSON pointer: ' + pointer); } - return pointer.substring(1).split(/\//).map(api.unescape); - }; - - /** - * Builds a json pointer from a array of reference tokens - * - * @param refTokens - * @returns {string} - */ - api.compile = function compile (refTokens) { - if (refTokens.length === 0) { return ''; } - return '/' + refTokens.map(api.escape).join('/'); - }; - - // const Component = require('../types/component'); - - class BrowserContent$1 { - constructor (settings = {}) { - // super(settings); - - this.settings = Object.assign({ - name: 'UnsafeBrowserContent', - title: 'UnsafeBrowserContent', - handle: 'fabric-browser-content' - }, settings); - - return this; - } - - init () { - console.log('[BROWSER:CONTENT]', 'init()'); - } - - _getInnerHTML () { - let html = ``; - html += `
`; - html += `

Preparing content...

`; - html += `

The application is compiling your document.

`; - html += `
`; - return html; - } - - render () { - return `${this._getInnerHTML()}`; - } - } - - var browserContent = BrowserContent$1; - - // Defaults - require('../settings/state'); - - const crypto$2 = require('crypto'); - const Service$1 = require('@fabric/core/types/service'); - // const Fabric = require('@fabric/core'); - - /** - * Generic component. - */ - class FabricComponent extends Service$1 { - /** - * Create a component. - * @param {Object} [settings={}] Settings for the component. - * @return {Component} Fully-configured component. - */ - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - handle: 'fabric-component', - path: '/' - }, settings); - - this.state = settings; - this.element = null; - - // Healthy Cleanup - this._boundFunctions = {}; - this._listeners = {}; - - return this; - } - - get path () { - return this.settings.path; - } - - get data () { - return JSON.stringify(this.state || {}); - } - - get hash () { - // TODO: cache and skip - return crypto$2.createHash('sha256').update(this.render()).digest('hex'); - } - - get integrity () { - // TODO: cache and skip - let hash = crypto$2.createHash('sha256').update(this.data).digest('base64'); - return `sha256-${hash}`; - } - - attributeChangedCallback (name, old, value) { - console.log('[MAKI:COMPONENT]', 'Component notified a change:', name, 'changed to:', value, `(was ${old})`); - } - - connectedCallback () { - console.log('[MAKI:COMPONENT]', 'Component added to page:', this); - let html = this._getInnerHTML(this.state); - - this.setAttribute('data-integrity', Fabric.sha256(html)); - this.setAttribute('data-fingerprint', this.fingerprint); - // this.innerHTML = html; - this.innerHTML = html + ''; - - /* let binding = this.getAttribute('data-bind'); - - if (binding) { - // TODO: use Fabric.Remote - fetch(`fabric:${binding}`) - .then((response) => response.text()) - .then((responseText) => { - this.render(JSON.parse(responseText)); - }) - .catch((error) => { - console.error(error); - }); - } */ - - // Reflect.construct(HTMLElement, [], this.constructor); - return this; - } - - disconnectedCallback () { - console.log('[MAKI:COMPONENT]', 'Component removed from page:', this); - - for (let name in this._boundFunctions) { - this.removeEventListener('message', this._boundFunctions[name]); - } - } - - _bind (element) { - if (this.element) ; - - this.element = element; - this.element.addEventListener('refresh', this.refresh.bind(this)); - this.element.addEventListener('message', this._handleComponentMessage.bind(this)); - - this.render(); - - return this; - } - - _handleComponentMessage (msg) { - console.log('[FABRIC:COMPONENT]', 'Element emitted message:', msg); - } - - _toElement () { - let element = document.createElement(this.settings.handle); - element.innerHTML = this._getInnerHTML(this.state); - return element; - } - - _loadHTML (content) { - let hash = crypto$2.createHash('sha256').update(content).digest('base64'); - return `<${this.settings.handle} integrity="sha256-${hash}">${content}`; - } - - _getInnerHTML (state) { - return `${JSON.stringify(state || this.state)}`; - } - - _renderState (state) { - // TODO: render Template here - // cc: @melnx @lel @lllllll:fabric.pub - let content = this._getInnerHTML(state); - return this._loadHTML(content); - } - - refresh () { - if (this.element) { - this.element.innerHTML = this._getInnerHTML(this.state); - } - } - - register () { - customElements.define(this.settings.handle, Component, { extends: 'div' }); - } - - render () { - if (this.element) { - this.element.innerHTML = this._getInnerHTML(); - } - return this._renderState(this.state); - } - } - - // TODO: debug why this can't be used on this parent class... - // ``` - // TypeError: Class extends value # is not a constructor or null - // Module. - // src/components/FabricIdentityManager.js:19 - // 16 | import IdentityPicker from './IdentityPicker'; - // 17 | import SeedEntryForm from './SeedEntryForm'; - // 18 | - // > 19 | class FabricIdentityManager extends FabricComponent { - // 20 | constructor (props) { - // 21 | super(props); - // 22 | - // ``` - // export default connect(FabricStateMapper)(FabricComponent); - // - // ... - // End of @fabric/core/types/component - - var component = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': FabricComponent - }); - - var require$$10 = /*@__PURE__*/getAugmentedNamespace(component); - - // const Component = require('./component'); - const Component$5 = require$$10; - - class Introduction$2 extends Component$5 { - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - title: 'Introduction to Maki, a cross-platform UI designer', - handle: 'fabric-introduction' - }, settings); - - return this; - } - - _getInnerHTML () { - return `
-

${this.settings.title}

-

Welcome to Fabric, friend.

-

Help Wanted

-

Curious adventurers inquire within.

-
`; - } - } - - var introduction = Introduction$2; - - var jquery = {exports: {}}; - - /*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2021-03-02T17:08Z - */ - - (function (module) { - ( function( global, factory ) { - - { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } - - // Pass this if window is not defined yet - } )( typeof window !== "undefined" ? window : commonjsGlobal, function( window, noGlobal ) { - - var arr = []; - - var getProto = Object.getPrototypeOf; - - var slice = arr.slice; - - var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); - } : function( array ) { - return arr.concat.apply( [], array ); - }; - - - var push = arr.push; - - var indexOf = arr.indexOf; - - var class2type = {}; - - var toString = class2type.toString; - - var hasOwn = class2type.hasOwnProperty; - - var fnToString = hasOwn.toString; - - var ObjectFunctionString = fnToString.call( Object ); - - var support = {}; - - var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - - var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - - var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - - function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - } - /* global Symbol */ - // Defining this global in .eslintrc.json would create a danger of using the global - // unguarded in another place, it seems safer to define global only for this module - - - - var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - - jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice - }; - - jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; - }; - - jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support - } ); - - if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; - } - - // Populate the class2type map - jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - - function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; - } - var Sizzle = - /*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ - ( function( window ) { - var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - - // Optimize for push.apply( _, NodeList ) - try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; - } catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; - } - - function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); - } - - /** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ - function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; - } - - /** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ - function markFunction( fn ) { - fn[ expando ] = true; - return fn; - } - - /** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ - function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } - } - - /** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ - function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } - } - - /** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ - function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; - } - - /** - * Returns a function to use in pseudos for input types - * @param {String} type - */ - function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; - } - - /** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ - function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; - } - - /** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ - function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; - } - - /** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ - function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); - } - - /** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ - function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; - } - - // Expose support vars for convenience - support = Sizzle.support = {}; - - /** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ - isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); - }; - - /** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ - setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; - }; - - Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); - }; - - Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; - }; - - Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); - }; - - Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - }; - - Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); - }; - - Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); - }; - - /** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ - Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; - }; - - /** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ - getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; - }; - - Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } - }; - - Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - - // Add button/input type pseudos - for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); - } - for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); - } - - // Easy API for creating new setFilters - function setFilters() {} - setFilters.prototype = Expr.filters = Expr.pseudos; - Expr.setFilters = new setFilters(); - - tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); - }; - - function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; - } - - function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; - } - - function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; - } - - function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; - } - - function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; - } - - function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); - } - - function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); - } - - function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; - } - - compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; - }; - - /** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ - select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; - }; - - // One-time assignments - - // Sort stability - support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - - // Support: Chrome 14-35+ - // Always assume duplicates if they aren't passed to the comparison function - support.detectDuplicates = !!hasDuplicate; - - // Initialize against the default document - setDocument(); - - // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) - // Detached nodes confoundingly follow *each other* - support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; - } ); - - // Support: IE<8 - // Prevent attribute/property "interpolation" - // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx - if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; - } ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); - } - - // Support: IE<9 - // Use defaultValue in place of getAttribute("value") - if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; - } ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); - } - - // Support: IE<9 - // Use getAttributeNode to fetch booleans when getAttribute lies - if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; - } ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); - } - - return Sizzle; - - } )( window ); - - - - jQuery.find = Sizzle; - jQuery.expr = Sizzle.selectors; - - // Deprecated - jQuery.expr[ ":" ] = jQuery.expr.pseudos; - jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; - jQuery.text = Sizzle.getText; - jQuery.isXMLDoc = Sizzle.isXML; - jQuery.contains = Sizzle.contains; - jQuery.escapeSelector = Sizzle.escape; - - - - - var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; - }; - - - var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; - }; - - - var rneedsContext = jQuery.expr.match.needsContext; - - - - function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - - } - var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - - // Implement the identical functionality for filter and not - function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); - } - - jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); - }; - - jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } - } ); - - - // Initialize a jQuery object - - - // A central reference to the root jQuery(document) - var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - - // Give the init function the jQuery prototype for later instantiation - init.prototype = jQuery.fn; - - // Initialize central reference - rootjQuery = jQuery( document ); - - - var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - - jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } - } ); - - function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; - } - - jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } - }, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; - } ); - var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - - // Convert String-formatted options into Object-formatted ones - function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; - } - - /* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ - jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; - }; - - - function Identity( v ) { - return v; - } - function Thrower( ex ) { - throw ex; - } - - function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } - } - - jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } - } ); - - - // These usually indicate a programmer mistake during development, - // warn about them ASAP rather than swallowing them by default. - var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - - jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } - }; - - - - - jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); - }; - - - - - // The deferred used on DOM ready - var readyList = jQuery.Deferred(); - - jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; - }; - - jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } - } ); - - jQuery.ready.then = readyList.then; - - // The ready event handler and self cleanup method - function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); - } - - // Catch cases where $(document).ready() is called - // after the browser event has already occurred. - // Support: IE <=9 - 10 only - // Older IE sometimes signals "interactive" too soon - if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - - } else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); - } - - - - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; - }; - - - // Matches dashed string for camelizing - var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - - // Used by camelCase as callback to replace() - function fcamelCase( _all, letter ) { - return letter.toUpperCase(); - } - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 15 - // Microsoft forgot to hump their vendor prefix (#9572) - function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - } - var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); - }; - - - - - function Data() { - this.expando = jQuery.expando + Data.uid++; - } - - Data.uid = 1; - - Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } - }; - var dataPriv = new Data(); - - var dataUser = new Data(); - - - - // Implementation Summary - // - // 1. Enforce API surface and semantic compatibility with 1.9.x branch - // 2. Improve the module's maintainability by reducing the storage - // paths to a single mechanism. - // 3. Use the same single mechanism to support "private" and "user" data. - // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) - // 5. Avoid exposing implementation details on user objects (eg. expando properties) - // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - - var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - - function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; - } - - function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; - } - - jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } - } ); - - jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } - } ); - - - jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } - } ); - - jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } - } ); - var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - - var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - - var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - - var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } - var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - - function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; - } - - - var defaultDisplayMap = {}; - - function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; - } - - function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; - } - - jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } - } ); - var rcheckableType = ( /^(?:checkbox|radio)$/i ); - - var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - - var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - - ( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; - } )(); - - - // We have to close these tags to support XHTML (#13200) - var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] - }; - - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; - wrapMap.th = wrapMap.td; - - // Support: IE <=9 only - if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; - } - - - function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; - } - - - // Mark scripts as having already been evaluated - function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } - } - - - var rhtml = /<|&#?\w+;/; - - function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; - } - - - var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - - function returnTrue() { - return true; - } - - function returnFalse() { - return false; - } - - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous, except when they are no-op. - // So expect focus to be synchronous when the element is already active, - // and blur to be synchronous when the element is not already active. - // (focus and blur are always synchronous in other supported browsers, - // this just defines when we can count on it). - function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); - } - - // Support: IE <=9 only - // Accessing document.activeElement can throw unexpectedly - // https://bugs.jquery.com/ticket/13393 - function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } - } - - function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); - } - - /* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ - jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } - }; - - // Ensure the presence of an event listener that handles manually-triggered - // synthetic events by interrupting progress until reinvoked in response to - // *native* events that it fires directly, ensuring that state changes have - // already occurred before other listeners are invoked. - function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); - } - - jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } - }; - - jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; - }; - - // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding - // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html - jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } - }; - - // Includes all common event props including KeyEvent and MouseEvent specific props - jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true - }, jQuery.event.addProp ); - - jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; - } ); - - // Create mouseenter/leave events using mouseover/out and event-time checks - // so that event delegation works in jQuery. - // Do the same for pointerenter/pointerleave and pointerover/pointerout - // - // Support: Safari 7 only - // Safari sends mouseenter too often; see: - // https://bugs.chromium.org/p/chromium/issues/detail?id=470258 - // for the description of the bug (it existed in older Chrome versions as well). - jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" - }, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; - } ); - - jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } - } ); - - - var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - - // Prefer a tbody over its parent table for containing new rows - function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; - } - - // Replace/restore the type attribute of script elements for safe DOM manipulation - function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; - } - function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; - } - - function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } - } - - // Fix IE bugs, see support tests - function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } - } - - function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; - } - - function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; - } - - jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } - } ); - - jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } - } ); - - jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" - }, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; - } ); - var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - - var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - }; - - - var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - - ( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); - } )(); - - - function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; - } - - - function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; - } - - - var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - - // Return a vendor-prefixed property or undefined - function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } - } - - // Return a potentially-mapped jQuery.cssProps or vendor prefixed property - function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; - } - - - var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - - function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; - } - - function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; - } - - function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; - } - - jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } - } ); - - jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; - } ); - - jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } - ); - - // These hooks are used by animate to expand properties - jQuery.each( { - margin: "", - padding: "", - border: "Width" - }, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } - } ); - - jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } - } ); - - - function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); - } - jQuery.Tween = Tween; - - Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } - }; - - Tween.prototype.init.prototype = Tween.prototype; - - Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } - }; - - // Support: IE <=9 only - // Panic based approach to setting things on disconnected nodes - Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } - }; - - jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" - }; - - jQuery.fx = Tween.prototype.init; - - // Back compat <1.8 extension point - jQuery.fx.step = {}; - - - - - var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - - function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } - } - - // Animations created synchronously will run synchronously - function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); - } - - // Generate parameters to create a standard animation - function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; - } - - function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } - } - - function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } - } - - function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } - } - - function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; - } - - jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } - } ); - - jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; - }; - - jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } - } ); - - jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; - } ); - - // Generate shortcuts for custom animations - jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } - }, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; - } ); - - jQuery.timers = []; - jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; - }; - - jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); - }; - - jQuery.fx.interval = 13; - jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); - }; - - jQuery.fx.stop = function() { - inProgress = null; - }; - - jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 - }; - - - // Based off of the plugin by Clint Helfers, with permission. - // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ - jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); - }; - - - ( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; - } )(); - - - var boolHook, - attrHandle = jQuery.expr.attrHandle; - - jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } - } ); - - jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } - } ); - - // Hooks for boolean attributes - boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } - }; - - jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; - } ); - - - - - var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - - jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } - } ); - - jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } - } ); - - // Support: IE <=11 only - // Accessing the selectedIndex property - // forces the browser to respect setting selected - // on the option - // The getter ensures a default option is selected - // when in an optgroup - // eslint rule "no-unused-expressions" is disabled for this code - // since it considers such accessions noop - if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; - } - - jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" - ], function() { - jQuery.propFix[ this.toLowerCase() ] = this; - } ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - - function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; - } - - function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; - } - - jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } - } ); - - - - - var rreturn = /\r/g; - - jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } - } ); - - jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } - } ); - - // Radios and checkboxes getter/setter - jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } - } ); - - - - - // Return jQuery for attributes-only inclusion - - - support.focusin = "onfocusin" in window; - - - var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - - jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - - } ); - - jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } - } ); - - - // Support: Firefox <=44 - // Firefox doesn't have focus(in | out) events - // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 - // - // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 - // focus(in | out) events fire after focus & blur events, - // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order - // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 - if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); - } - var location = window.location; - - var nonce = { guid: Date.now() }; - - var rquery = ( /\?/ ); - - - - // Cross-browser xml parsing - jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; - }; - - - var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - - function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } - } - - // Serialize an array of form elements or a set of - // key/values into a query string - jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); - }; - - jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } - } ); - - - var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - - originAnchor.href = location.href; - - // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport - function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; - } - - // Base inspection function for prefilters and transports - function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); - } - - // A special extend for ajax options - // that takes "flat" options (not to be deep extended) - // Fixes #9887 - function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; - } - - /* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ - function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } - } - - /* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ - function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; - } - - jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } - } ); - - jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; - } ); - - jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } - } ); - - - jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); - }; - - - jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } - } ); - - - jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); - }; - jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); - }; - - - - - jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} - }; - - var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - - support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); - support.ajax = xhrSupported = !!xhrSupported; - - jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } - } ); - - - - - // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) - jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } - } ); - - // Install script dataType - jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } - } ); - - // Handle cache's special case and crossDomain - jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } - } ); - - // Bind script tag hack transport - jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - `; - return content; - } - - async _toggleFullscreen () { - // TODO: implement fullscreen from RPG - } - - /** - * Generate the rendered HTML output of the application's user interface. - * @return {String} HTML string. - */ - render () { - let page = this.page.render(); - let html = this._loadHTML(page); - let pretty = beautify.html(html, { - indent_size: 2, - extra_liners: [] - }); - - return pretty; - } - - /** - * Launches any necessary processes and notifies the user on ready. - * @return {Promise} Resolves on completion. - */ - async start () { - if (typeof window !== 'undefined' && window.app) await window.app.stop(); - - if (this.store) { - try { - await this.store.start(); - } catch (E) { - console.error('Could not open store:', E); - } - } - - await this.define('FabricMenu', Menu); - await this.define('ResourceList', ResourceList); - - for (const name in this.resources) { - const definition = this.resources[name]; - if (definition.data) { - // TODO: move this to `types/resource.js` - if (!definition.names) { - definition.names = { - singular: name, - plural: pluralize(name) - }; - } - await this.set(`/${definition.names.plural.toLowerCase()}`, definition.data); - } - } - - this.on('call', this._handleCall.bind(this)); - - // await this.fabric.start(); - try { - await this.circuit.start(); - await this.browser.start(); - await this.router.start(); - } catch (E) { - console.error('Could not start, Exception:', E); - } - - return true; - } - - async stop () { - await this.router.stop(); - await this.browser.stop(); - await this.circuit.stop(); - if (this.store) await this.store.stop(); - - return true; - } - } - - var app = App$1; - - const D3GraphViz = d3Graphviz.exports; - - // TODO: switch core to types - const Service = service_1; - const Circuit = circuit; - const App = app; - - async function main () { - window.App = App; - window.Circuit = Circuit; - window.Service = Service; - window.D3GraphViz = D3GraphViz; - - window.app = new App({ - resources: { - // 'Depositor': Service - } - }); - window.app.service = new Service(); - window.app.circuit = new Circuit({ - gates: [], - wires: [ - { name: 'ready', from: 'init', to: 'ready' }, - { name: 'step1', from: 'ready', to: '1' }, - { name: 'step2', from: '1', to: '2' }, - { name: 'step3', from: '2', to: '3' }, - { name: 'done', from: '3', to: 'complete' } - ] - }); - - window.graph = D3GraphViz.graphviz('#svg', { - fit: true, - width: 800, - height: 600 - }).renderDot(window.app.circuit.dot); - - // TODO: fix verification - window.app._verifyElements(); - - // TODO: move these into App - window.app.actions = []; - window.app.bindings = []; - - window.app.circuit.on('/', async function (msg) { - console.log('[FABRIC:WEB]', 'Circuit emitted:', msg, msg['@data']); - switch (msg['@type']) { - default: - console.error('unhandled circuit message type:', msg['@type']); - break; - case 'KeyUp': - console.log('KeyUp:', msg['@data']); - break; - case 'Snapshot': - console.log('Received snapshot:', msg['@data']); - break; - } - }); - - window.app.service.on('/', async function (msg) { - console.log('[FABRIC:WEB]', 'Service emitted:', msg, msg['@data']); - switch (msg['@type']) { - default: - console.error('unhandled service message type:', msg['@type']); - break; - case 'KeyUp': - console.log('KeyUp:', msg['@data']); - break; - case 'Snapshot': - console.log('Received snapshot:', msg['@data']); - break; - } - }); - - let elements = document.querySelectorAll('*[data-bind]'); - for (let i = 0; i < elements.length; i++) { - let element = elements[i]; - let binding = element.getAttribute('data-bind'); - - console.log('binding the element:', binding, element); - - element.addEventListener('keyup', async function (event) { - if (!event.target) return false; - if (!event.target.value) return false; - await window.app.service._PUT('/source', event.target.value); - }); - - window.app.circuit.on(binding, function (data) { - console.log('received replacement data (from circuit!) targeted for binding:', binding); - element.innerHTML = data; - }); - - window.app.service.on(binding, function (data) { - console.log('received replacement data (from service!) targeted for binding:', binding); - element.innerHTML = data; - }); - - window.app.on(binding, function (data) { - console.log('received replacement data targeted for binding:', binding); - element.innerHTML = data; - }); - - window.app.bindings.push(element); - } - - let actionables = document.querySelectorAll('*[data-action]'); - for (let i = 0; i < actionables.length; i++) { - let element = actionables[i]; - let action = element.getAttribute('data-action'); - element.addEventListener('click', async function (event) { - console.log('click event on actionable element:', action, event); - let method = window.app.circuit.methods[action]; - if (!method) console.warn('NO METHOD ON CIRCUIT:', method); - let result = await window.app.circuit[action].call(window.app.circuit); - console.log('result:', result); - }); - window.app.actions.push(element); - } - - console.log('[FABRIC:WEB]', 'ready!!!'); - } - - main(); - - return scripts$2; - -})(require$$0$4, require$$0$5, require$$1$3, require$$2$2, require$$1$4, require$$0$7, require$$0$6, require$$10$1, require$$1$5, require$$4$1, require$$6, require$$0$8, require$$7$1, require$$4$2, require$$5$2, require$$6$1, require$$7$2, require$$3$1, require$$1$6, require$$1$7, require$$2$3); +(function () { + 'use strict'; + + require('../constants'); + + const D3GraphViz = require('d3-graphviz'); + + // TODO: switch core to types + const Service = require('@fabric/core/types/service'); + const Circuit = require('@fabric/core/types/circuit'); + const App = require('../types/app'); + + async function main () { + window.App = App; + window.Circuit = Circuit; + window.Service = Service; + window.D3GraphViz = D3GraphViz; + + window.app = new App({ + resources: { + // 'Depositor': Service + } + }); + window.app.service = new Service(); + window.app.circuit = new Circuit({ + gates: [], + wires: [ + { name: 'ready', from: 'init', to: 'ready' }, + { name: 'step1', from: 'ready', to: '1' }, + { name: 'step2', from: '1', to: '2' }, + { name: 'step3', from: '2', to: '3' }, + { name: 'done', from: '3', to: 'complete' } + ] + }); + + window.graph = D3GraphViz.graphviz('#svg', { + fit: true, + width: 800, + height: 600 + }).renderDot(window.app.circuit.dot); + + // TODO: fix verification + window.app._verifyElements(); + + // TODO: move these into App + window.app.actions = []; + window.app.bindings = []; + + window.app.circuit.on('/', async function (msg) { + console.log('[FABRIC:WEB]', 'Circuit emitted:', msg, msg['@data']); + switch (msg['@type']) { + default: + console.error('unhandled circuit message type:', msg['@type']); + break; + case 'KeyUp': + console.log('KeyUp:', msg['@data']); + break; + case 'Snapshot': + console.log('Received snapshot:', msg['@data']); + break; + } + }); + + window.app.service.on('/', async function (msg) { + console.log('[FABRIC:WEB]', 'Service emitted:', msg, msg['@data']); + switch (msg['@type']) { + default: + console.error('unhandled service message type:', msg['@type']); + break; + case 'KeyUp': + console.log('KeyUp:', msg['@data']); + break; + case 'Snapshot': + console.log('Received snapshot:', msg['@data']); + break; + } + }); + + let elements = document.querySelectorAll('*[data-bind]'); + for (let i = 0; i < elements.length; i++) { + let element = elements[i]; + let binding = element.getAttribute('data-bind'); + + console.log('binding the element:', binding, element); + + element.addEventListener('keyup', async function (event) { + if (!event.target) return false; + if (!event.target.value) return false; + await window.app.service._PUT('/source', event.target.value); + }); + + window.app.circuit.on(binding, function (data) { + console.log('received replacement data (from circuit!) targeted for binding:', binding); + element.innerHTML = data; + }); + + window.app.service.on(binding, function (data) { + console.log('received replacement data (from service!) targeted for binding:', binding); + element.innerHTML = data; + }); + + window.app.on(binding, function (data) { + console.log('received replacement data targeted for binding:', binding); + element.innerHTML = data; + }); + + window.app.bindings.push(element); + } + + let actionables = document.querySelectorAll('*[data-action]'); + for (let i = 0; i < actionables.length; i++) { + let element = actionables[i]; + let action = element.getAttribute('data-action'); + element.addEventListener('click', async function (event) { + console.log('click event on actionable element:', action, event); + let method = window.app.circuit.methods[action]; + if (!method) console.warn('NO METHOD ON CIRCUIT:', method); + let result = await window.app.circuit[action].call(window.app.circuit); + console.log('result:', result); + }); + window.app.actions.push(element); + } + + console.log('[FABRIC:WEB]', 'ready!!!'); + } + + main(); + +})(); diff --git a/builds/esm/fabric.http.js b/builds/esm/fabric.http.js index 033a2443..090d1431 100644 --- a/builds/esm/fabric.http.js +++ b/builds/esm/fabric.http.js @@ -1,254189 +1,11 @@ -import require$$0$4, { randomBytes as randomBytes$3 } from 'crypto'; -import require$$0$5, { readFileSync } from 'fs'; -import require$$1$3 from 'path'; -import require$$2$2 from 'stream'; -import require$$1$4 from 'events'; -import require$$0$7 from 'util'; -import require$$0$6 from 'buffer'; -import require$$10$1 from 'string_decoder/'; -import require$$1$5 from 'os'; -import require$$4$1, { fileURLToPath as fileURLToPath$1, URL as URL$6 } from 'url'; -import require$$6 from 'net'; -import require$$0$8 from 'assert'; -import require$$7$1 from 'tls'; -import require$$4$2 from 'querystring'; -import require$$5$2 from 'http'; -import require$$6$1 from 'https'; -import require$$7$2 from 'string_decoder'; -import require$$3$1 from 'punycode'; -import require$$1$6 from 'dns'; -import require$$1$7 from 'dgram'; -import require$$2$3 from 'child_process'; +require('../constants'); -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function getAugmentedNamespace(n) { - if (n.__esModule) return n; - var a = Object.defineProperty({}, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; -} - -function commonjsRequire (path) { - throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); -} - -var scripts$2 = {}; - -/* - Fabric Core Constants. - --- - Author: Fabric Labs - Copyright: All Rights Reserved. - */ - -// Dependencies -const crypto$p = require$$0$4; - -// Networking and Environment -const PEER_PORT = 9999; -const MAX_PEERS = 32; -const PRECISION = 100; - -// Fabric Core -const BITCOIN_GENESIS = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'; -const BITCOIN_GENESIS_ROOT = '4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b'; -const FABRIC_KEY_DERIVATION_PATH$1 = "m/44'/0'/0'/0/0"; - -// Message Constants -const MAGIC_BYTES$2 = 0xC0D3F33D; -const VERSION_NUMBER$1 = 0x01; // 0 for development, pre-alpha, 1 for production -const HEADER_SIZE$2 = 144; // [4], [4], [32], [4], [4], [32], [64] bytes -const LARGE_COLLECTION_SIZE = 10; // TODO: test with 1,000,000 -const MAX_MESSAGE_SIZE$3 = 4096 - HEADER_SIZE$2; - -// Stacks and Frames -const MAX_STACK_HEIGHT = 32; // max height of stack (number of elements) -const MAX_FRAME_SIZE$1 = 32; // max size of a stack frame in bytes -const MAX_MEMORY_ALLOC$1 = MAX_STACK_HEIGHT * MAX_FRAME_SIZE$1; -const MAX_TX_PER_BLOCK$1 = 100; -const MAX_CHANNEL_VALUE$1 = 100000000; - -// Machine Constraints -const MACHINE_MAX_MEMORY = MAX_MEMORY_ALLOC$1 * MAX_MESSAGE_SIZE$3; -const MAX_CHAT_MESSAGE_LENGTH = 2048; - -// FABRIC ONLY -const GENERIC_MESSAGE_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericMessage').digest('hex').slice(0, 4), 16); -const LOG_MESSAGE_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericLogMessage').digest('hex').slice(0, 4), 16); -const GENERIC_LIST_TYPE$1 = MAGIC_BYTES$2 + parseInt(crypto$p.createHash('sha256').update('@types/GenericList').digest('hex').slice(0, 4), 16); -const DOCUMENT_PUBLISH_TYPE$1 = 998; -const DOCUMENT_REQUEST_TYPE$1 = 999; - -// Opcodes -const OP_CYCLE$1 = '00'; -const OP_DONE = 'ff'; - -// Bitcoin -const OP_0 = '00'; -const OP_36 = '24'; -const OP_CHECKSIG = 'ac'; -const OP_DUP = '76'; -const OP_EQUAL = '87'; -const OP_SHA256 = 'a8'; -const OP_HASH160 = 'a9'; -const OP_PUSHDATA1 = '4c'; -const OP_RETURN = '6a'; -const OP_EQUALVERIFY = '88'; -const OP_SEPARATOR = 'ab'; - -const P2P_GENERIC$1 = 0x80; // 128 in decimal -const P2P_IDENT_REQUEST$2 = 0x01; // 1, or the identity -const P2P_IDENT_RESPONSE$2 = 0x11; -const P2P_ROOT$2 = 0x00000000; -const P2P_PING$2 = 0x00000012; // same ID as Lightning (18) -const P2P_PONG$2 = 0x00000013; // same ID as Lightning (19) -const P2P_INSTRUCTION$2 = 0x00000020; // TODO: select w/ no overlap -const P2P_START_CHAIN$2 = 0x00000021; -const P2P_STATE_REQUEST$1 = 0x00000029; // TODO: select w/ no overlap -const P2P_STATE_ROOT$2 = 0x00000030; // TODO: select w/ no overlap -const P2P_BASE_MESSAGE$2 = 0x00000031; // TODO: select w/ no overlap -const P2P_STATE_COMMITTMENT$2 = 0x00000032; // TODO: select w/ no overlap -const P2P_STATE_CHANGE$2 = 0x00000033; // TODO: select w/ no overlap -const P2P_TRANSACTION$1 = 0x00000039; // TODO: select w/ no overlap -const P2P_CALL$1 = 0x00000042; -const P2P_CHAIN_SYNC_REQUEST$1 = 0x55; -const P2P_SESSION_ACK$1 = 0x4200; -const P2P_MUSIG_START = 0x4220; -const P2P_MUSIG_ACCEPT = 0x4221; -const P2P_MUSIG_RECEIVE_COUNTER = 0x4222; -const P2P_MUSIG_SEND_PROPOSAL = 0x4223; -const P2P_MUSIG_REPLY_TO_PROPOSAL = 0x4224; -const P2P_MUSIG_ACCEPT_PROPOSAL = 0x4225; - -const PEER_CANDIDATE$1 = 0x09; -// TODO: should be 0x02 for Bitcoin P2P -const BLOCK_CANDIDATE$1 = 0x03; - -const SESSION_START$1 = 0x02; -const CHAT_MESSAGE$1 = 0x67; - -// Lightning -const LIGHTNING_TEST_HEADER = 'D0520C6E'; -const LIGHTNING_PROTOCOL_H_INIT$1 = 'Noise_XK_secp256k1_ChaChaPoly_SHA256'; -const LIGHTNING_PROTOCOL_PROLOGUE$1 = 'lightning'; - -// Lightning BMM -const LIGHTNING_BMM_HEADER = 'D0520C6E'; -const LIGHTNING_SIDECHAIN_NUM = 0xFF; // 1-byte - sidechain number - -const LIGHTNING_SIDEBLOCK_HASH = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000; // 32-bytes -const LIGHTNING_PARENT_SIDEBLOCK_HASH = 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // 32-bytes - -const ZERO_LENGTH_PLAINTEXT$1 = ''; - -var constants$1 = { - PEER_PORT, - MAX_PEERS, - PRECISION, - BITCOIN_GENESIS, - BITCOIN_GENESIS_ROOT, - FABRIC_KEY_DERIVATION_PATH: FABRIC_KEY_DERIVATION_PATH$1, - HEADER_SIZE: HEADER_SIZE$2, - GENERIC_MESSAGE_TYPE: GENERIC_MESSAGE_TYPE$1, - LOG_MESSAGE_TYPE: LOG_MESSAGE_TYPE$1, - GENERIC_LIST_TYPE: GENERIC_LIST_TYPE$1, - LARGE_COLLECTION_SIZE, - BLOCK_CANDIDATE: BLOCK_CANDIDATE$1, - CHAT_MESSAGE: CHAT_MESSAGE$1, - ZERO_LENGTH_PLAINTEXT: ZERO_LENGTH_PLAINTEXT$1, - LIGHTNING_TEST_HEADER, - LIGHTNING_PROTOCOL_H_INIT: LIGHTNING_PROTOCOL_H_INIT$1, - LIGHTNING_PROTOCOL_PROLOGUE: LIGHTNING_PROTOCOL_PROLOGUE$1, - LIGHTNING_BMM_HEADER, - LIGHTNING_SIDECHAIN_NUM, - LIGHTNING_SIDEBLOCK_HASH, - LIGHTNING_PARENT_SIDEBLOCK_HASH, - MAGIC_BYTES: MAGIC_BYTES$2, - MAX_FRAME_SIZE: MAX_FRAME_SIZE$1, - MAX_MEMORY_ALLOC: MAX_MEMORY_ALLOC$1, - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$3, - MAX_STACK_HEIGHT, - MAX_CHANNEL_VALUE: MAX_CHANNEL_VALUE$1, - MAX_CHAT_MESSAGE_LENGTH, - MAX_TX_PER_BLOCK: MAX_TX_PER_BLOCK$1, - MACHINE_MAX_MEMORY, - OP_CYCLE: OP_CYCLE$1, - OP_DONE, - OP_0, - OP_36, - OP_CHECKSIG, - OP_DUP, - OP_EQUAL, - OP_SHA256, - OP_HASH160, - OP_PUSHDATA1, - OP_RETURN, - OP_EQUALVERIFY, - OP_SEPARATOR, - P2P_GENERIC: P2P_GENERIC$1, - P2P_IDENT_REQUEST: P2P_IDENT_REQUEST$2, - P2P_IDENT_RESPONSE: P2P_IDENT_RESPONSE$2, - P2P_CHAIN_SYNC_REQUEST: P2P_CHAIN_SYNC_REQUEST$1, - P2P_ROOT: P2P_ROOT$2, - P2P_PING: P2P_PING$2, - P2P_PONG: P2P_PONG$2, - P2P_START_CHAIN: P2P_START_CHAIN$2, - P2P_INSTRUCTION: P2P_INSTRUCTION$2, - P2P_BASE_MESSAGE: P2P_BASE_MESSAGE$2, - P2P_STATE_ROOT: P2P_STATE_ROOT$2, - P2P_STATE_COMMITTMENT: P2P_STATE_COMMITTMENT$2, - P2P_STATE_CHANGE: P2P_STATE_CHANGE$2, - P2P_STATE_REQUEST: P2P_STATE_REQUEST$1, - P2P_TRANSACTION: P2P_TRANSACTION$1, - P2P_CALL: P2P_CALL$1, - P2P_SESSION_ACK: P2P_SESSION_ACK$1, - P2P_MUSIG_START, - P2P_MUSIG_ACCEPT, - P2P_MUSIG_RECEIVE_COUNTER, - P2P_MUSIG_SEND_PROPOSAL, - P2P_MUSIG_REPLY_TO_PROPOSAL, - P2P_MUSIG_ACCEPT_PROPOSAL, - PEER_CANDIDATE: PEER_CANDIDATE$1, - DOCUMENT_PUBLISH_TYPE: DOCUMENT_PUBLISH_TYPE$1, - DOCUMENT_REQUEST_TYPE: DOCUMENT_REQUEST_TYPE$1, - SESSION_START: SESSION_START$1, - VERSION_NUMBER: VERSION_NUMBER$1 -}; - -const { - P2P_SESSION_ACK -} = constants$1; - -// engine -const TICK_INTERVAL = 1000; -const SESSION_SEED = '79084a7963fc1761e8f6871d6aa704c4922316030af4aa5a076dde35fc0b6857'; - -// http -const HTTP_CLIENT_PORT = 80; -const HTTP_SERVER_PORT$1 = 9999; - -// https -const HTTPS_CLIENT_PORT = 443; -const HTTPS_SERVER_PORT = 19999; - -// websockets -const MAXIMUM_PING = 10000; -const WEBSOCKET_KEEPALIVE = 600000; // 10 minutes - -// browser / dom -const BROWSER_TARGET$2 = '#browser-content'; - -// exports -var constants = { - TICK_INTERVAL, - SESSION_SEED, - HTTP_CLIENT_PORT, - HTTP_SERVER_PORT: HTTP_SERVER_PORT$1, - HTTPS_CLIENT_PORT, - HTTPS_SERVER_PORT, - MAXIMUM_PING, - WEBSOCKET_KEEPALIVE, - BROWSER_TARGET: BROWSER_TARGET$2, - P2P_SESSION_ACK -}; - -var d3Graphviz = {exports: {}}; - -var xhtml = "http://www.w3.org/1999/xhtml"; - -var namespaces = { - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; - -function namespace(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; -} - -function creatorInherit(name) { - return function() { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml - ? document.createElement(name) - : document.createElementNS(uri, name); - }; -} - -function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; -} - -function creator(name) { - var fullname = namespace(name); - return (fullname.local - ? creatorFixed - : creatorInherit)(fullname); -} - -function none() {} - -function selector(selector) { - return selector == null ? none : function() { - return this.querySelector(selector); - }; -} - -function selection_select(select) { - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection$1(subgroups, this._parents); -} - -function empty$1() { - return []; -} - -function selectorAll(selector) { - return selector == null ? empty$1 : function() { - return this.querySelectorAll(selector); - }; -} - -function selection_selectAll(select) { - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection$1(subgroups, parents); -} - -function matcher(selector) { - return function() { - return this.matches(selector); - }; -} - -function selection_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection$1(subgroups, this._parents); -} - -function sparse(update) { - return new Array(update.length); -} - -function selection_enter() { - return new Selection$1(this._enter || this._groups.map(sparse), this._parents); -} - -function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; -} - -EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, - insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, - querySelector: function(selector) { return this._parent.querySelector(selector); }, - querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } -}; - -function constant$2(x) { - return function() { - return x; - }; -} - -var keyPrefix = "$"; // Protect against keys like “__proto__”. - -function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } -} - -function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = {}, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); - if (keyValue in nodeByKeyValue) { - exit[i] = node; - } else { - nodeByKeyValue[keyValue] = node; - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = keyPrefix + key.call(parent, data[i], i, data); - if (node = nodeByKeyValue[keyValue]) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue[keyValue] = null; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) { - exit[i] = node; - } - } -} - -function selection_data(value, key) { - if (!value) { - data = new Array(this.size()), j = -1; - this.each(function(d) { data[++j] = d; }); - return data; - } - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - - if (typeof value !== "function") value = constant$2(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = value.call(parent, parent && parent.__data__, j, parents), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection$1(update, parents); - update._enter = enter; - update._exit = exit; - return update; -} - -function selection_exit() { - return new Selection$1(this._exit || this._groups.map(sparse), this._parents); -} - -function selection_join(onenter, onupdate, onexit) { - var enter = this.enter(), update = this, exit = this.exit(); - enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); - if (onupdate != null) update = onupdate(update); - if (onexit == null) exit.remove(); else onexit(exit); - return enter && update ? enter.merge(update).order() : update; -} - -function selection_merge(selection) { - - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection$1(merges, this._parents); -} - -function selection_order() { - - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; -} - -function selection_sort(compare) { - if (!compare) compare = ascending; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection$1(sortgroups, this._parents).order(); -} - -function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} - -function selection_call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; -} - -function selection_nodes() { - var nodes = new Array(this.size()), i = -1; - this.each(function() { nodes[++i] = this; }); - return nodes; -} - -function selection_node() { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; -} - -function selection_size() { - var size = 0; - this.each(function() { ++size; }); - return size; -} - -function selection_empty() { - return !this.node(); -} - -function selection_each(callback) { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; -} - -function attrRemove$1(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS$1(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant$1(name, value) { - return function() { - this.setAttribute(name, value); - }; -} - -function attrConstantNS$1(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; -} - -function attrFunction$1(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; -} - -function attrFunctionNS$1(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; -} - -function selection_attr(name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each((value == null - ? (fullname.local ? attrRemoveNS$1 : attrRemove$1) : (typeof value === "function" - ? (fullname.local ? attrFunctionNS$1 : attrFunction$1) - : (fullname.local ? attrConstantNS$1 : attrConstant$1)))(fullname, value)); -} - -function defaultView(node) { - return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node - || (node.document && node) // node is a Window - || node.defaultView; // node is a Document -} - -function styleRemove$1(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant$1(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; -} - -function styleFunction$1(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; -} - -function selection_style(name, value, priority) { - return arguments.length > 1 - ? this.each((value == null - ? styleRemove$1 : typeof value === "function" - ? styleFunction$1 - : styleConstant$1)(name, value, priority == null ? "" : priority)) - : styleValue(this.node(), name); -} - -function styleValue(node, name) { - return node.style.getPropertyValue(name) - || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); -} - -function propertyRemove(name) { - return function() { - delete this[name]; - }; -} - -function propertyConstant(name, value) { - return function() { - this[name] = value; - }; -} - -function propertyFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; -} - -function selection_property(name, value) { - return arguments.length > 1 - ? this.each((value == null - ? propertyRemove : typeof value === "function" - ? propertyFunction - : propertyConstant)(name, value)) - : this.node()[name]; -} - -function classArray(string) { - return string.trim().split(/^|\s+/); -} - -function classList(node) { - return node.classList || new ClassList(node); -} - -function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); -} - -ClassList.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } -}; - -function classedAdd(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); -} - -function classedRemove(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); -} - -function classedTrue(names) { - return function() { - classedAdd(this, names); - }; -} - -function classedFalse(names) { - return function() { - classedRemove(this, names); - }; -} - -function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; -} - -function selection_classed(name, value) { - var names = classArray(name + ""); - - if (arguments.length < 2) { - var list = classList(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each((typeof value === "function" - ? classedFunction : value - ? classedTrue - : classedFalse)(names, value)); -} - -function textRemove() { - this.textContent = ""; -} - -function textConstant$1(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction$1(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; -} - -function selection_text(value) { - return arguments.length - ? this.each(value == null - ? textRemove : (typeof value === "function" - ? textFunction$1 - : textConstant$1)(value)) - : this.node().textContent; -} - -function htmlRemove() { - this.innerHTML = ""; -} - -function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; -} - -function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; -} - -function selection_html(value) { - return arguments.length - ? this.each(value == null - ? htmlRemove : (typeof value === "function" - ? htmlFunction - : htmlConstant)(value)) - : this.node().innerHTML; -} - -function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); -} - -function selection_raise() { - return this.each(raise); -} - -function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); -} - -function selection_lower() { - return this.each(lower); -} - -function selection_append(name) { - var create = typeof name === "function" ? name : creator(name); - return this.select(function() { - return this.appendChild(create.apply(this, arguments)); - }); -} - -function constantNull() { - return null; -} - -function selection_insert(name, before) { - var create = typeof name === "function" ? name : creator(name), - select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); -} - -function remove$1() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); -} - -function selection_remove() { - return this.each(remove$1); -} - -function selection_cloneShallow() { - var clone = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -function selection_cloneDeep() { - var clone = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -function selection_clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); -} - -function selection_datum(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; -} - -var filterEvents = {}; - -var event = null; - -if (typeof document !== "undefined") { - var element = document.documentElement; - if (!("onmouseenter" in element)) { - filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"}; - } -} - -function filterContextListener(listener, index, group) { - listener = contextListener(listener, index, group); - return function(event) { - var related = event.relatedTarget; - if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) { - listener.call(this, event); - } - }; -} - -function contextListener(listener, index, group) { - return function(event1) { - var event0 = event; // Events can be reentrant (e.g., focus). - event = event1; - try { - listener.call(this, this.__data__, index, group); - } finally { - event = event0; - } - }; -} - -function parseTypenames$1(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return {type: t, name: name}; - }); -} - -function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; -} - -function onAdd(typename, value, capture) { - var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; - return function(d, i, group) { - var on = this.__on, o, listener = wrap(value, i, group); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - this.addEventListener(o.type, o.listener = listener, o.capture = capture); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, capture); - o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture}; - if (!on) this.__on = [o]; - else on.push(o); - }; -} - -function selection_on(typename, value, capture) { - var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - if (capture == null) capture = false; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture)); - return this; -} - -function customEvent(event1, listener, that, args) { - var event0 = event; - event1.sourceEvent = event; - event = event1; - try { - return listener.apply(that, args); - } finally { - event = event0; - } -} - -function dispatchEvent(node, type, params) { - var window = defaultView(node), - event = window.CustomEvent; - - if (typeof event === "function") { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); -} - -function dispatchConstant(type, params) { - return function() { - return dispatchEvent(this, type, params); - }; -} - -function dispatchFunction(type, params) { - return function() { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; -} - -function selection_dispatch(type, params) { - return this.each((typeof params === "function" - ? dispatchFunction - : dispatchConstant)(type, params)); -} - -var root$1 = [null]; - -function Selection$1(groups, parents) { - this._groups = groups; - this._parents = parents; -} - -function selection() { - return new Selection$1([[document.documentElement]], root$1); -} - -Selection$1.prototype = selection.prototype = { - constructor: Selection$1, - select: selection_select, - selectAll: selection_selectAll, - filter: selection_filter, - data: selection_data, - enter: selection_enter, - exit: selection_exit, - join: selection_join, - merge: selection_merge, - order: selection_order, - sort: selection_sort, - call: selection_call, - nodes: selection_nodes, - node: selection_node, - size: selection_size, - empty: selection_empty, - each: selection_each, - attr: selection_attr, - style: selection_style, - property: selection_property, - classed: selection_classed, - text: selection_text, - html: selection_html, - raise: selection_raise, - lower: selection_lower, - append: selection_append, - insert: selection_insert, - remove: selection_remove, - clone: selection_clone, - datum: selection_datum, - on: selection_on, - dispatch: selection_dispatch -}; - -function select(selector) { - return typeof selector === "string" - ? new Selection$1([[document.querySelector(selector)]], [document.documentElement]) - : new Selection$1([[selector]], root$1); -} - -function create$1(name) { - return select(creator(name).call(document.documentElement)); -} - -var nextId = 0; - -function local$1() { - return new Local$1; -} - -function Local$1() { - this._ = "@" + (++nextId).toString(36); -} - -Local$1.prototype = local$1.prototype = { - constructor: Local$1, - get: function(node) { - var id = this._; - while (!(id in node)) if (!(node = node.parentNode)) return; - return node[id]; - }, - set: function(node, value) { - return node[this._] = value; - }, - remove: function(node) { - return this._ in node && delete node[this._]; - }, - toString: function() { - return this._; - } -}; - -function sourceEvent() { - var current = event, source; - while (source = current.sourceEvent) current = source; - return current; -} - -function point(node, event) { - var svg = node.ownerSVGElement || node; - - if (svg.createSVGPoint) { - var point = svg.createSVGPoint(); - point.x = event.clientX, point.y = event.clientY; - point = point.matrixTransform(node.getScreenCTM().inverse()); - return [point.x, point.y]; - } - - var rect = node.getBoundingClientRect(); - return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; -} - -function mouse(node) { - var event = sourceEvent(); - if (event.changedTouches) event = event.changedTouches[0]; - return point(node, event); -} - -function selectAll(selector) { - return typeof selector === "string" - ? new Selection$1([document.querySelectorAll(selector)], [document.documentElement]) - : new Selection$1([selector == null ? [] : selector], root$1); -} - -function touch(node, touches, identifier) { - if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches; - - for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) { - if ((touch = touches[i]).identifier === identifier) { - return point(node, touch); - } - } - - return null; -} - -function touches(node, touches) { - if (touches == null) touches = sourceEvent().touches; - - for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) { - points[i] = point(node, touches[i]); - } - - return points; -} - -var src$b = /*#__PURE__*/Object.freeze({ - __proto__: null, - create: create$1, - creator: creator, - local: local$1, - matcher: matcher, - mouse: mouse, - namespace: namespace, - namespaces: namespaces, - clientPoint: point, - select: select, - selectAll: selectAll, - selection: selection, - selector: selector, - selectorAll: selectorAll, - style: styleValue, - touch: touch, - touches: touches, - window: defaultView, - get event () { return event; }, - customEvent: customEvent -}); - -var require$$0$3 = /*@__PURE__*/getAugmentedNamespace(src$b); - -var noop$2 = {value: function() {}}; - -function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - return new Dispatch(_); -} - -function Dispatch(_) { - this._ = _; -} - -function parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return {type: t, name: name}; - }); -} - -Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, - T = parseTypenames(typename + "", _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get$2(_[t], typename.name))) return t; - return; - } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set$1(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set$1(_[t], typename.name, null); - } - - return this; - }, - copy: function() { - var copy = {}, _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - } -}; - -function get$2(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } -} - -function set$1(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop$2, type = type.slice(0, i).concat(type.slice(i + 1)); - break; - } - } - if (callback != null) type.push({name: name, value: callback}); - return type; -} - -var src$a = /*#__PURE__*/Object.freeze({ - __proto__: null, - dispatch: dispatch -}); - -var require$$1$2 = /*@__PURE__*/getAugmentedNamespace(src$a); - -var frame$2 = 0, // is an animation frame pending? - timeout$1 = 0, // is a timeout pending? - interval$1 = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = typeof performance === "object" && performance.now ? performance : Date, - setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; - -function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); -} - -function clearNow() { - clockNow = 0; -} - -function Timer() { - this._call = - this._time = - this._next = null; -} - -Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } -}; - -function timer(callback, delay, time) { - var t = new Timer; - t.restart(callback, delay, time); - return t; -} - -function timerFlush() { - now(); // Get the current time, if not already set. - ++frame$2; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(null, e); - t = t._next; - } - --frame$2; -} - -function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame$2 = timeout$1 = 0; - try { - timerFlush(); - } finally { - frame$2 = 0; - nap(); - clockNow = 0; - } -} - -function poke() { - var now = clock.now(), delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; -} - -function nap() { - var t0, t1 = taskHead, t2, time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; - } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; - } - } - taskTail = t0; - sleep(time); -} - -function sleep(time) { - if (frame$2) return; // Soonest alarm already set, or will be. - if (timeout$1) timeout$1 = clearTimeout(timeout$1); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) timeout$1 = setTimeout(wake, time - clock.now() - clockSkew); - if (interval$1) interval$1 = clearInterval(interval$1); - } else { - if (!interval$1) clockLast = clock.now(), interval$1 = setInterval(poke, pokeDelay); - frame$2 = 1, setFrame(wake); - } -} - -function timeout(callback, delay, time) { - var t = new Timer; - delay = delay == null ? 0 : +delay; - t.restart(function(elapsed) { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; -} - -function interval(callback, delay, time) { - var t = new Timer, total = delay; - if (delay == null) return t.restart(callback, delay, time), t; - delay = +delay, time = time == null ? now() : +time; - t.restart(function tick(elapsed) { - elapsed += total; - t.restart(tick, total += delay, time); - callback(elapsed); - }, delay, time); - return t; -} - -var src$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - now: now, - timer: timer, - timerFlush: timerFlush, - timeout: timeout, - interval: interval -}); - -var emptyOn = dispatch("start", "end", "cancel", "interrupt"); -var emptyTween = []; - -var CREATED = 0; -var SCHEDULED = 1; -var STARTING = 2; -var STARTED = 3; -var RUNNING = 4; -var ENDING = 5; -var ENDED = 6; - -function schedule(node, name, id, index, group, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id in schedules) return; - create(node, id, { - name: name, - index: index, // For context during callback. - group: group, // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); -} - -function init(node, id) { - var schedule = get$1(node, id); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; -} - -function set(node, id) { - var schedule = get$1(node, id); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; -} - -function get$1(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); - return schedule; -} - -function create(node, id, self) { - var schedules = node.__transition, - tween; - - // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); - - // If the elapsed delay is less than our first sleep, start immediately. - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; - - // If the state is not SCHEDULED, then we previously errored on start. - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - - // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - if (o.state === STARTED) return timeout(start); - - // Interrupt the active transition, if any. - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - - // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - - // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - timeout(function() { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - - // Dispatch the start event. - // Note this must be done before the tween are initialized. - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - self.state = STARTED; - - // Initialize the tween, deleting null tween. - tween = new Array(n = self.tween.length); - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } - - // Dispatch the end event. - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - for (var i in schedules) return; // eslint-disable-line no-unused-vars - delete node.__transition; - } -} - -function interrupt(node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - - if (!schedules) return; - - name = name == null ? null : name + ""; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { empty = false; continue; } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - - if (empty) delete node.__transition; -} - -function selection_interrupt(name) { - return this.each(function() { - interrupt(this, name); - }); -} - -function define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} - -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; -} - -function Color() {} - -var darker = 0.7; -var brighter = 1 / darker; - -var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); - -var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 -}; - -define(Color, color, { - copy: function(channels) { - return Object.assign(new this.constructor, this, channels); - }, - displayable: function() { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); - -function color_formatHex() { - return this.rgb().formatHex(); -} - -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} - -function color_formatRgb() { - return this.rgb().formatRgb(); -} - -function color(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 - : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 - : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) - : null; -} - -function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); -} - -function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); -} - -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb; - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} - -function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); -} - -function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; -} - -define(Rgb, rgb, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function() { - return this; - }, - displayable: function() { - return (-0.5 <= this.r && this.r < 255.5) - && (-0.5 <= this.g && this.g < 255.5) - && (-0.5 <= this.b && this.b < 255.5) - && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); - -function rgb_formatHex() { - return "#" + hex$3(this.r) + hex$3(this.g) + hex$3(this.b); -} - -function rgb_formatRgb() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") - + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.b) || 0)) - + (a === 1 ? ")" : ", " + a + ")"); -} - -function hex$3(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); -} - -function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); -} - -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl; - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); -} - -function hsl$2(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); -} - -function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; -} - -define(Hsl, hsl$2, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - displayable: function() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) - && (0 <= this.l && this.l <= 1) - && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl: function() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") - + (this.h || 0) + ", " - + (this.s || 0) * 100 + "%, " - + (this.l || 0) * 100 + "%" - + (a === 1 ? ")" : ", " + a + ")"); - } -})); - -/* From FvD 13.37, CSS Color Module Level 3 */ -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 - : h < 180 ? m2 - : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 - : m1) * 255; -} - -var deg2rad = Math.PI / 180; -var rad2deg = 180 / Math.PI; - -// https://observablehq.com/@mbostock/lab-and-rgb -var K$5 = 18, - Xn = 0.96422, - Yn = 1, - Zn = 0.82521, - t0 = 4 / 29, - t1 = 6 / 29, - t2 = 3 * t1 * t1, - t3 = t1 * t1 * t1; - -function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) return hcl2lab(o); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), - g = rgb2lrgb(o.g), - b = rgb2lrgb(o.b), - y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; - if (r === g && g === b) x = z = y; else { - x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); - } - return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); -} - -function lab$1(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); -} - -function Lab(l, a, b, opacity) { - this.l = +l; - this.a = +a; - this.b = +b; - this.opacity = +opacity; -} - -define(Lab, lab$1, extend(Color, { - brighter: function(k) { - return new Lab(this.l + K$5 * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - darker: function(k) { - return new Lab(this.l - K$5 * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - rgb: function() { - var y = (this.l + 16) / 116, - x = isNaN(this.a) ? y : y + this.a / 500, - z = isNaN(this.b) ? y : y - this.b / 200; - x = Xn * lab2xyz(x); - y = Yn * lab2xyz(y); - z = Zn * lab2xyz(z); - return new Rgb( - lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), - lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), - lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), - this.opacity - ); - } -})); - -function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; -} - -function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); -} - -function lrgb2rgb(x) { - return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); -} - -function rgb2lrgb(x) { - return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); -} - -function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * rad2deg; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); -} - -function hcl$2(h, c, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); -} - -function Hcl(h, c, l, opacity) { - this.h = +h; - this.c = +c; - this.l = +l; - this.opacity = +opacity; -} - -function hcl2lab(o) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * deg2rad; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); -} - -define(Hcl, hcl$2, extend(Color, { - brighter: function(k) { - return new Hcl(this.h, this.c, this.l + K$5 * (k == null ? 1 : k), this.opacity); - }, - darker: function(k) { - return new Hcl(this.h, this.c, this.l - K$5 * (k == null ? 1 : k), this.opacity); - }, - rgb: function() { - return hcl2lab(this).rgb(); - } -})); - -var A = -0.14861, - B = +1.78277, - C = -0.29227, - D = -0.90649, - E = +1.97294, - ED = E * D, - EB = E * B, - BC_DA = B * C - D * A; - -function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), - bl = b - l, - k = (E * (g - l) - C * bl) / D, - s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 - h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); -} - -function cubehelix$2(h, s, l, opacity) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); -} - -function Cubehelix(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; -} - -define(Cubehelix, cubehelix$2, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, - l = +this.l, - a = isNaN(this.s) ? 0 : this.s * l * (1 - l), - cosh = Math.cos(h), - sinh = Math.sin(h); - return new Rgb( - 255 * (l + a * (A * cosh + B * sinh)), - 255 * (l + a * (C * cosh + D * sinh)), - 255 * (l + a * (E * cosh)), - this.opacity - ); - } -})); - -function basis(t1, v0, v1, v2, v3) { - var t2 = t1 * t1, t3 = t2 * t1; - return ((1 - 3 * t1 + 3 * t2 - t3) * v0 - + (4 - 6 * t2 + 3 * t3) * v1 - + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 - + t3 * v3) / 6; -} - -function basis$1(values) { - var n = values.length - 1; - return function(t) { - var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), - v1 = values[i], - v2 = values[i + 1], - v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, - v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -function basisClosed(values) { - var n = values.length; - return function(t) { - var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), - v0 = values[(i + n - 1) % n], - v1 = values[i % n], - v2 = values[(i + 1) % n], - v3 = values[(i + 2) % n]; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -function constant$1(x) { - return function() { - return x; - }; -} - -function linear(a, d) { - return function(t) { - return a + t * d; - }; -} - -function exponential(a, b, y) { - return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { - return Math.pow(a + t * b, y); - }; -} - -function hue$1(a, b) { - var d = b - a; - return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$1(isNaN(a) ? b : a); -} - -function gamma(y) { - return (y = +y) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a); - }; -} - -function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : constant$1(isNaN(a) ? b : a); -} - -var interpolateRgb = (function rgbGamma(y) { - var color = gamma(y); - - function rgb$1(start, end) { - var r = color((start = rgb(start)).r, (end = rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - rgb$1.gamma = rgbGamma; - - return rgb$1; -})(1); - -function rgbSpline(spline) { - return function(colors) { - var n = colors.length, - r = new Array(n), - g = new Array(n), - b = new Array(n), - i, color; - for (i = 0; i < n; ++i) { - color = rgb(colors[i]); - r[i] = color.r || 0; - g[i] = color.g || 0; - b[i] = color.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color.opacity = 1; - return function(t) { - color.r = r(t); - color.g = g(t); - color.b = b(t); - return color + ""; - }; - }; -} - -var rgbBasis = rgbSpline(basis$1); -var rgbBasisClosed = rgbSpline(basisClosed); - -function numberArray(a, b) { - if (!b) b = []; - var n = a ? Math.min(b.length, a.length) : 0, - c = b.slice(), - i; - return function(t) { - for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; - return c; - }; -} - -function isNumberArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); -} - -function array(a, b) { - return (isNumberArray(b) ? numberArray : genericArray)(a, b); -} - -function genericArray(a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; - - for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; - - return function(t) { - for (i = 0; i < na; ++i) c[i] = x[i](t); - return c; - }; -} - -function date(a, b) { - var d = new Date; - return a = +a, b = +b, function(t) { - return d.setTime(a * (1 - t) + b * t), d; - }; -} - -function interpolateNumber(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; -} - -function object(a, b) { - var i = {}, - c = {}, - k; - - if (a === null || typeof a !== "object") a = {}; - if (b === null || typeof b !== "object") b = {}; - - for (k in b) { - if (k in a) { - i[k] = value(a[k], b[k]); - } else { - c[k] = b[k]; - } - } - - return function(t) { - for (k in i) c[k] = i[k](t); - return c; - }; -} - -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); - -function zero(b) { - return function() { - return b; - }; -} - -function one(b) { - return function(t) { - return b(t) + ""; - }; -} - -function interpolateString(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - a = a + "", b = b + ""; - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) - && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { // interpolate non-matching numbers - s[++i] = null; - q.push({i: i, x: interpolateNumber(am, bm)}); - } - bi = reB.lastIndex; - } - - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 ? (q[0] - ? one(q[0].x) - : zero(b)) - : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); -} - -function value(a, b) { - var t = typeof b, c; - return b == null || t === "boolean" ? constant$1(b) - : (t === "number" ? interpolateNumber - : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString) - : b instanceof color ? interpolateRgb - : b instanceof Date ? date - : isNumberArray(b) ? numberArray - : Array.isArray(b) ? genericArray - : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object - : interpolateNumber)(a, b); -} - -function discrete(range) { - var n = range.length; - return function(t) { - return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; - }; -} - -function hue(a, b) { - var i = hue$1(+a, +b); - return function(t) { - var x = i(t); - return x - 360 * Math.floor(x / 360); - }; -} - -function round(a, b) { - return a = +a, b = +b, function(t) { - return Math.round(a * (1 - t) + b * t); - }; -} - -var degrees = 180 / Math.PI; - -var identity$3 = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; - -function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; -} - -var cssNode, - cssRoot, - cssView, - svgNode; - -function parseCss(value) { - if (value === "none") return identity$3; - if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; - cssNode.style.transform = value; - value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); - cssRoot.removeChild(cssNode); - value = value.slice(7, -1).split(","); - return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); -} - -function parseSvg(value) { - if (value == null) return identity$3; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity$3; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); -} - -function interpolateTransform(parse, pxComma, pxParen, degParen) { - - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path - q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - - return function(a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - }; -} - -var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); -var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - -var rho = Math.SQRT2, - rho2 = 2, - rho4 = 4, - epsilon2 = 1e-12; - -function cosh(x) { - return ((x = Math.exp(x)) + 1 / x) / 2; -} - -function sinh(x) { - return ((x = Math.exp(x)) - 1 / x) / 2; -} - -function tanh(x) { - return ((x = Math.exp(2 * x)) - 1) / (x + 1); -} - -// p0 = [ux0, uy0, w0] -// p1 = [ux1, uy1, w1] -function interpolateZoom(p0, p1) { - var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], - ux1 = p1[0], uy1 = p1[1], w1 = p1[2], - dx = ux1 - ux0, - dy = uy1 - uy0, - d2 = dx * dx + dy * dy, - i, - S; - - // Special case for u0 ≅ u1. - if (d2 < epsilon2) { - S = Math.log(w1 / w0) / rho; - i = function(t) { - return [ - ux0 + t * dx, - uy0 + t * dy, - w0 * Math.exp(rho * t * S) - ]; - }; - } - - // General case. - else { - var d1 = Math.sqrt(d2), - b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), - b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), - r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), - r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); - S = (r1 - r0) / rho; - i = function(t) { - var s = t * S, - coshr0 = cosh(r0), - u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); - return [ - ux0 + u * dx, - uy0 + u * dy, - w0 * coshr0 / cosh(rho * s + r0) - ]; - }; - } - - i.duration = S * 1000; - - return i; -} - -function hsl(hue) { - return function(start, end) { - var h = hue((start = hsl$2(start)).h, (end = hsl$2(end)).h), - s = nogamma(start.s, end.s), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.s = s(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; - } -} - -var hsl$1 = hsl(hue$1); -var hslLong = hsl(nogamma); - -function lab(start, end) { - var l = nogamma((start = lab$1(start)).l, (end = lab$1(end)).l), - a = nogamma(start.a, end.a), - b = nogamma(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.l = l(t); - start.a = a(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; -} - -function hcl(hue) { - return function(start, end) { - var h = hue((start = hcl$2(start)).h, (end = hcl$2(end)).h), - c = nogamma(start.c, end.c), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.c = c(t); - start.l = l(t); - start.opacity = opacity(t); - return start + ""; - }; - } -} - -var hcl$1 = hcl(hue$1); -var hclLong = hcl(nogamma); - -function cubehelix(hue) { - return (function cubehelixGamma(y) { - y = +y; - - function cubehelix(start, end) { - var h = hue((start = cubehelix$2(start)).h, (end = cubehelix$2(end)).h), - s = nogamma(start.s, end.s), - l = nogamma(start.l, end.l), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.h = h(t); - start.s = s(t); - start.l = l(Math.pow(t, y)); - start.opacity = opacity(t); - return start + ""; - }; - } - - cubehelix.gamma = cubehelixGamma; - - return cubehelix; - })(1); -} - -var cubehelix$1 = cubehelix(hue$1); -var cubehelixLong = cubehelix(nogamma); - -function piecewise(interpolate, values) { - var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); - while (i < n) I[i] = interpolate(v, v = values[++i]); - return function(t) { - var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); - return I[i](t - i); - }; -} - -function quantize(interpolator, n) { - var samples = new Array(n); - for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); - return samples; -} - -var src$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - interpolate: value, - interpolateArray: array, - interpolateBasis: basis$1, - interpolateBasisClosed: basisClosed, - interpolateDate: date, - interpolateDiscrete: discrete, - interpolateHue: hue, - interpolateNumber: interpolateNumber, - interpolateNumberArray: numberArray, - interpolateObject: object, - interpolateRound: round, - interpolateString: interpolateString, - interpolateTransformCss: interpolateTransformCss, - interpolateTransformSvg: interpolateTransformSvg, - interpolateZoom: interpolateZoom, - interpolateRgb: interpolateRgb, - interpolateRgbBasis: rgbBasis, - interpolateRgbBasisClosed: rgbBasisClosed, - interpolateHsl: hsl$1, - interpolateHslLong: hslLong, - interpolateLab: lab, - interpolateHcl: hcl$1, - interpolateHclLong: hclLong, - interpolateCubehelix: cubehelix$1, - interpolateCubehelixLong: cubehelixLong, - piecewise: piecewise, - quantize: quantize -}); - -function tweenRemove(id, name) { - var tween0, tween1; - return function() { - var schedule = set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; -} - -function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error; - return function() { - var schedule = set(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; -} - -function transition_tween(name, value) { - var id = this._id; - - name += ""; - - if (arguments.length < 2) { - var tween = get$1(this.node(), id).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - - return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); -} - -function tweenValue(transition, name, value) { - var id = transition._id; - - transition.each(function() { - var schedule = set(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - - return function(node) { - return get$1(node, id).value[name]; - }; -} - -function interpolate(a, b) { - var c; - return (typeof b === "number" ? interpolateNumber - : b instanceof color ? interpolateRgb - : (c = color(b)) ? (b = c, interpolateRgb) - : interpolateString)(a, b); -} - -function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attrConstantNS(fullname, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attrFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function attrFunctionNS(fullname, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function transition_attr(name, value) { - var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate; - return this.attrTween(name, typeof value === "function" - ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) - : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) - : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value)); -} - -function attrInterpolate(name, i) { - return function(t) { - this.setAttribute(name, i.call(this, t)); - }; -} - -function attrInterpolateNS(fullname, i) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; -} - -function attrTweenNS(fullname, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - tween._value = value; - return tween; -} - -function attrTween(name, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - tween._value = value; - return tween; -} - -function transition_attrTween(name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); -} - -function delayFunction(id, value) { - return function() { - init(this, id).delay = +value.apply(this, arguments); - }; -} - -function delayConstant(id, value) { - return value = +value, function() { - init(this, id).delay = value; - }; -} - -function transition_delay(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? delayFunction - : delayConstant)(id, value)) - : get$1(this.node(), id).delay; -} - -function durationFunction(id, value) { - return function() { - set(this, id).duration = +value.apply(this, arguments); - }; -} - -function durationConstant(id, value) { - return value = +value, function() { - set(this, id).duration = value; - }; -} - -function transition_duration(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? durationFunction - : durationConstant)(id, value)) - : get$1(this.node(), id).duration; -} - -function easeConstant(id, value) { - if (typeof value !== "function") throw new Error; - return function() { - set(this, id).ease = value; - }; -} - -function transition_ease(value) { - var id = this._id; - - return arguments.length - ? this.each(easeConstant(id, value)) - : get$1(this.node(), id).ease; -} - -function transition_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); -} - -function transition_merge(transition) { - if (transition._id !== this._id) throw new Error; - - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); -} - -function start(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); -} - -function onFunction(id, name, listener) { - var on0, on1, sit = start(name) ? init : set; - return function() { - var schedule = sit(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - - schedule.on = on1; - }; -} - -function transition_on(name, listener) { - var id = this._id; - - return arguments.length < 2 - ? get$1(this.node(), id).on.on(name) - : this.each(onFunction(id, name, listener)); -} - -function removeFunction(id) { - return function() { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id) return; - if (parent) parent.removeChild(this); - }; -} - -function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); -} - -function transition_select(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule(subgroup[i], name, id, i, subgroup, get$1(node, id)); - } - } - } - - return new Transition(subgroups, this._parents, name, id); -} - -function transition_selectAll(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - for (var children = select.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) { - if (child = children[k]) { - schedule(child, name, id, k, children, inherit); - } - } - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); -} - -var Selection = selection.prototype.constructor; - -function transition_selection() { - return new Selection(this._groups, this._parents); -} - -function styleNull(name, interpolate) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; -} - -function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function styleFunction(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function styleMaybeRemove(id, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; - return function() { - var schedule = set(this, id), - on = schedule.on, - listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - - schedule.on = on1; - }; -} - -function transition_style(name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate; - return value == null ? this - .styleTween(name, styleNull(name, i)) - .on("end.style." + name, styleRemove(name)) - : typeof value === "function" ? this - .styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))) - .each(styleMaybeRemove(this._id, name)) - : this - .styleTween(name, styleConstant(name, i, value), priority) - .on("end.style." + name, null); -} - -function styleInterpolate(name, i, priority) { - return function(t) { - this.style.setProperty(name, i.call(this, t), priority); - }; -} - -function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; -} - -function transition_styleTween(name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); -} - -function textConstant(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; -} - -function transition_text(value) { - return this.tween("text", typeof value === "function" - ? textFunction(tweenValue(this, "text", value)) - : textConstant(value == null ? "" : value + "")); -} - -function textInterpolate(i) { - return function(t) { - this.textContent = i.call(this, t); - }; -} - -function textTween(value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - tween._value = value; - return tween; -} - -function transition_textTween(value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, textTween(value)); -} - -function transition_transition() { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - var inherit = get$1(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); -} - -function transition_end() { - var on0, on1, that = this, id = that._id, size = that.size(); - return new Promise(function(resolve, reject) { - var cancel = {value: reject}, - end = {value: function() { if (--size === 0) resolve(); }}; - - that.each(function() { - var schedule = set(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - - schedule.on = on1; - }); - }); -} - -var id = 0; - -function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; -} - -function transition(name) { - return selection().transition(name); -} - -function newId() { - return ++id; -} - -var selection_prototype = selection.prototype; - -Transition.prototype = transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition_transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: transition_tween, - delay: transition_delay, - duration: transition_duration, - ease: transition_ease, - end: transition_end -}; - -function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; -} - -var defaultTiming = { - time: null, // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut -}; - -function inherit(node, id) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - return defaultTiming.time = now(), defaultTiming; - } - } - return timing; -} - -function selection_transition(name) { - var id, - timing; - - if (name instanceof Transition) { - id = name._id, name = name._name; - } else { - id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); -} - -selection.prototype.interrupt = selection_interrupt; -selection.prototype.transition = selection_transition; - -var root = [null]; - -function active(node, name) { - var schedules = node.__transition, - schedule, - i; - - if (schedules) { - name = name == null ? null : name + ""; - for (i in schedules) { - if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) { - return new Transition([[node]], root, name, +i); - } - } - } - - return null; -} - -var src$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - transition: transition, - active: active, - interrupt: interrupt -}); - -var require$$2$1 = /*@__PURE__*/getAugmentedNamespace(src$7); - -var require$$3 = /*@__PURE__*/getAugmentedNamespace(src$9); - -var require$$4 = /*@__PURE__*/getAugmentedNamespace(src$8); - -function noevent$1() { - event.preventDefault(); - event.stopImmediatePropagation(); -} - -function dragDisable(view) { - var root = view.document.documentElement, - selection = select(view).on("dragstart.drag", noevent$1, true); - if ("onselectstart" in root) { - selection.on("selectstart.drag", noevent$1, true); - } else { - root.__noselect = root.style.MozUserSelect; - root.style.MozUserSelect = "none"; - } -} - -function yesdrag(view, noclick) { - var root = view.document.documentElement, - selection = select(view).on("dragstart.drag", null); - if (noclick) { - selection.on("click.drag", noevent$1, true); - setTimeout(function() { selection.on("click.drag", null); }, 0); - } - if ("onselectstart" in root) { - selection.on("selectstart.drag", null); - } else { - root.style.MozUserSelect = root.__noselect; - delete root.__noselect; - } -} - -function constant(x) { - return function() { - return x; - }; -} - -function ZoomEvent(target, type, transform) { - this.target = target; - this.type = type; - this.transform = transform; -} - -function Transform$2(k, x, y) { - this.k = k; - this.x = x; - this.y = y; -} - -Transform$2.prototype = { - constructor: Transform$2, - scale: function(k) { - return k === 1 ? this : new Transform$2(this.k * k, this.x, this.y); - }, - translate: function(x, y) { - return x === 0 & y === 0 ? this : new Transform$2(this.k, this.x + this.k * x, this.y + this.k * y); - }, - apply: function(point) { - return [point[0] * this.k + this.x, point[1] * this.k + this.y]; - }, - applyX: function(x) { - return x * this.k + this.x; - }, - applyY: function(y) { - return y * this.k + this.y; - }, - invert: function(location) { - return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; - }, - invertX: function(x) { - return (x - this.x) / this.k; - }, - invertY: function(y) { - return (y - this.y) / this.k; - }, - rescaleX: function(x) { - return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); - }, - rescaleY: function(y) { - return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); - }, - toString: function() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } -}; - -var identity$2 = new Transform$2(1, 0, 0); - -transform.prototype = Transform$2.prototype; - -function transform(node) { - while (!node.__zoom) if (!(node = node.parentNode)) return identity$2; - return node.__zoom; -} - -function nopropagation() { - event.stopImmediatePropagation(); -} - -function noevent() { - event.preventDefault(); - event.stopImmediatePropagation(); -} - -// Ignore right-click, since that should open the context menu. -function defaultFilter() { - return !event.ctrlKey && !event.button; -} - -function defaultExtent() { - var e = this; - if (e instanceof SVGElement) { - e = e.ownerSVGElement || e; - if (e.hasAttribute("viewBox")) { - e = e.viewBox.baseVal; - return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; - } - return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; - } - return [[0, 0], [e.clientWidth, e.clientHeight]]; -} - -function defaultTransform() { - return this.__zoom || identity$2; -} - -function defaultWheelDelta() { - return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002); -} - -function defaultTouchable() { - return navigator.maxTouchPoints || ("ontouchstart" in this); -} - -function defaultConstrain(transform, extent, translateExtent) { - var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], - dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], - dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], - dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; - return transform.translate( - dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), - dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) - ); -} - -function zoom() { - var filter = defaultFilter, - extent = defaultExtent, - constrain = defaultConstrain, - wheelDelta = defaultWheelDelta, - touchable = defaultTouchable, - scaleExtent = [0, Infinity], - translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], - duration = 250, - interpolate = interpolateZoom, - listeners = dispatch("start", "zoom", "end"), - touchstarting, - touchending, - touchDelay = 500, - wheelDelay = 150, - clickDistance2 = 0; - - function zoom(selection) { - selection - .property("__zoom", defaultTransform) - .on("wheel.zoom", wheeled) - .on("mousedown.zoom", mousedowned) - .on("dblclick.zoom", dblclicked) - .filter(touchable) - .on("touchstart.zoom", touchstarted) - .on("touchmove.zoom", touchmoved) - .on("touchend.zoom touchcancel.zoom", touchended) - .style("touch-action", "none") - .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - - zoom.transform = function(collection, transform, point) { - var selection = collection.selection ? collection.selection() : collection; - selection.property("__zoom", defaultTransform); - if (collection !== selection) { - schedule(collection, transform, point); - } else { - selection.interrupt().each(function() { - gesture(this, arguments) - .start() - .zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform) - .end(); - }); - } - }; - - zoom.scaleBy = function(selection, k, p) { - zoom.scaleTo(selection, function() { - var k0 = this.__zoom.k, - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return k0 * k1; - }, p); - }; - - zoom.scaleTo = function(selection, k, p) { - zoom.transform(selection, function() { - var e = extent.apply(this, arguments), - t0 = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, - p1 = t0.invert(p0), - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); - }, p); - }; - - zoom.translateBy = function(selection, x, y) { - zoom.transform(selection, function() { - return constrain(this.__zoom.translate( - typeof x === "function" ? x.apply(this, arguments) : x, - typeof y === "function" ? y.apply(this, arguments) : y - ), extent.apply(this, arguments), translateExtent); - }); - }; - - zoom.translateTo = function(selection, x, y, p) { - zoom.transform(selection, function() { - var e = extent.apply(this, arguments), - t = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; - return constrain(identity$2.translate(p0[0], p0[1]).scale(t.k).translate( - typeof x === "function" ? -x.apply(this, arguments) : -x, - typeof y === "function" ? -y.apply(this, arguments) : -y - ), e, translateExtent); - }, p); - }; - - function scale(transform, k) { - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); - return k === transform.k ? transform : new Transform$2(k, transform.x, transform.y); - } - - function translate(transform, p0, p1) { - var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k; - return x === transform.x && y === transform.y ? transform : new Transform$2(transform.k, x, y); - } - - function centroid(extent) { - return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; - } - - function schedule(transition, transform, point) { - transition - .on("start.zoom", function() { gesture(this, arguments).start(); }) - .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); }) - .tween("zoom", function() { - var that = this, - args = arguments, - g = gesture(that, args), - e = extent.apply(that, args), - p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, - w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), - a = that.__zoom, - b = typeof transform === "function" ? transform.apply(that, args) : transform, - i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); - return function(t) { - if (t === 1) t = b; // Avoid rounding error on end. - else { var l = i(t), k = w / l[2]; t = new Transform$2(k, p[0] - l[0] * k, p[1] - l[1] * k); } - g.zoom(null, t); - }; - }); - } - - function gesture(that, args, clean) { - return (!clean && that.__zooming) || new Gesture(that, args); - } - - function Gesture(that, args) { - this.that = that; - this.args = args; - this.active = 0; - this.extent = extent.apply(that, args); - this.taps = 0; - } - - Gesture.prototype = { - start: function() { - if (++this.active === 1) { - this.that.__zooming = this; - this.emit("start"); - } - return this; - }, - zoom: function(key, transform) { - if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); - if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); - if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); - this.that.__zoom = transform; - this.emit("zoom"); - return this; - }, - end: function() { - if (--this.active === 0) { - delete this.that.__zooming; - this.emit("end"); - } - return this; - }, - emit: function(type) { - customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]); - } - }; - - function wheeled() { - if (!filter.apply(this, arguments)) return; - var g = gesture(this, arguments), - t = this.__zoom, - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), - p = mouse(this); - - // If the mouse is in the same location as before, reuse it. - // If there were recent wheel events, reset the wheel idle timeout. - if (g.wheel) { - if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { - g.mouse[1] = t.invert(g.mouse[0] = p); - } - clearTimeout(g.wheel); - } - - // If this wheel event won’t trigger a transform change, ignore it. - else if (t.k === k) return; - - // Otherwise, capture the mouse point and location at the start. - else { - g.mouse = [p, t.invert(p)]; - interrupt(this); - g.start(); - } - - noevent(); - g.wheel = setTimeout(wheelidled, wheelDelay); - g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); - - function wheelidled() { - g.wheel = null; - g.end(); - } - } - - function mousedowned() { - if (touchending || !filter.apply(this, arguments)) return; - var g = gesture(this, arguments, true), - v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), - p = mouse(this), - x0 = event.clientX, - y0 = event.clientY; - - dragDisable(event.view); - nopropagation(); - g.mouse = [p, this.__zoom.invert(p)]; - interrupt(this); - g.start(); - - function mousemoved() { - noevent(); - if (!g.moved) { - var dx = event.clientX - x0, dy = event.clientY - y0; - g.moved = dx * dx + dy * dy > clickDistance2; - } - g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent, translateExtent)); - } - - function mouseupped() { - v.on("mousemove.zoom mouseup.zoom", null); - yesdrag(event.view, g.moved); - noevent(); - g.end(); - } - } - - function dblclicked() { - if (!filter.apply(this, arguments)) return; - var t0 = this.__zoom, - p0 = mouse(this), - p1 = t0.invert(p0), - k1 = t0.k * (event.shiftKey ? 0.5 : 2), - t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent); - - noevent(); - if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0); - else select(this).call(zoom.transform, t1); - } - - function touchstarted() { - if (!filter.apply(this, arguments)) return; - var touches = event.touches, - n = touches.length, - g = gesture(this, arguments, event.changedTouches.length === n), - started, i, t, p; - - nopropagation(); - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - p = [p, this.__zoom.invert(p), t.identifier]; - if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; - else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; - } - - if (touchstarting) touchstarting = clearTimeout(touchstarting); - - if (started) { - if (g.taps < 2) touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); - interrupt(this); - g.start(); - } - } - - function touchmoved() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event.changedTouches, - n = touches.length, i, t, p, l; - - noevent(); - if (touchstarting) touchstarting = clearTimeout(touchstarting); - g.taps = 0; - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; - else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; - } - t = g.that.__zoom; - if (g.touch1) { - var p0 = g.touch0[0], l0 = g.touch0[1], - p1 = g.touch1[0], l1 = g.touch1[1], - dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, - dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; - t = scale(t, Math.sqrt(dp / dl)); - p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; - l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; - } - else if (g.touch0) p = g.touch0[0], l = g.touch0[1]; - else return; - g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); - } - - function touchended() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event.changedTouches, - n = touches.length, i, t; - - nopropagation(); - if (touchending) clearTimeout(touchending); - touchending = setTimeout(function() { touchending = null; }, touchDelay); - for (i = 0; i < n; ++i) { - t = touches[i]; - if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0; - else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; - } - if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; - if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); - else { - g.end(); - // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. - if (g.taps === 2) { - var p = select(this).on("dblclick.zoom"); - if (p) p.apply(this, arguments); - } - } - } - - zoom.wheelDelta = function(_) { - return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant(+_), zoom) : wheelDelta; - }; - - zoom.filter = function(_) { - return arguments.length ? (filter = typeof _ === "function" ? _ : constant(!!_), zoom) : filter; - }; - - zoom.touchable = function(_) { - return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), zoom) : touchable; - }; - - zoom.extent = function(_) { - return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; - }; - - zoom.scaleExtent = function(_) { - return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; - }; - - zoom.translateExtent = function(_) { - return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; - }; - - zoom.constrain = function(_) { - return arguments.length ? (constrain = _, zoom) : constrain; - }; - - zoom.duration = function(_) { - return arguments.length ? (duration = +_, zoom) : duration; - }; - - zoom.interpolate = function(_) { - return arguments.length ? (interpolate = _, zoom) : interpolate; - }; - - zoom.on = function() { - var value = listeners.on.apply(listeners, arguments); - return value === listeners ? zoom : value; - }; - - zoom.clickDistance = function(_) { - return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); - }; - - return zoom; -} - -var src$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - zoom: zoom, - zoomTransform: transform, - zoomIdentity: identity$2 -}); - -var require$$5$1 = /*@__PURE__*/getAugmentedNamespace(src$6); - -var viz = {exports: {}}; - -/* -Viz.js 1.8.2 (Graphviz 2.40.1, Expat 2.2.5, Emscripten 1.37.33) -Copyright (c) 2014-2018 Michael Daines -Licensed under MIT license - -This distribution contains other software in object code form: - -Graphviz -Licensed under Eclipse Public License - v 1.0 -http://www.graphviz.org - -Expat -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. -Licensed under MIT license -http://www.libexpat.org - -zlib -Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler -http://www.zlib.net/zlib_license.html -*/ - -(function (module, exports) { -(function(global) { -var Module = function(Module) { - Module = Module || {}; -var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key];}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true;}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true;}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true;}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true;}else {throw new Error("Module['ENVIRONMENT'] value is not valid. must be one of: WEB|WORKER|NODE|SHELL.")}}else {ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof commonjsRequire==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;}if(ENVIRONMENT_IS_NODE){var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;ret=tryParseAsDataURI(filename);if(!ret){if(!nodeFS)nodeFS=require$$0$5;if(!nodePath)nodePath=require$$1$3;filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);}return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/");}Module["arguments"]=process["argv"].slice(2);{module["exports"]=Module;}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",(function(reason,p){process["exit"](1);}));Module["inspect"]=(function(){return "[Emscripten Module object]"});}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)};}Module["readBinary"]=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs;}else if(typeof arguments!="undefined"){Module["arguments"]=arguments;}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status);});}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}};}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror();};xhr.onerror=onerror;xhr.send(null);};if(typeof arguments!="undefined"){Module["arguments"]=arguments;}Module["setWindowTitle"]=(function(title){document.title=title;});}Module["print"]=typeof console!=="undefined"?console.log:typeof print!=="undefined"?print:null;Module["printErr"]=typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn||Module["print"];Module.print=Module["print"];Module.printErr=Module["printErr"];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key];}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size/factor)*factor;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else {return 0}}}}new Array(0);var GLOBAL_BASE=8;var ABORT=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text);}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}var JSfuncs={"stackSave":(function(){stackSave();}),"stackRestore":(function(){stackRestore();}),"arrayToC":(function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len);}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type);}}var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab;}else {zeroinit=false;size=slab.length;}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr;}else {ret=[typeof _malloc==="function"?_malloc:staticAlloc,stackAlloc,staticAlloc,dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length));}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0;}stop=ret+size;while(ptr>0]=0;}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret);}else {HEAPU8.set(new Uint8Array(slab),ret);}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK;}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else {var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else {u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3;}else {u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4;}else {u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5;}}}if(u0<65536){str+=String.fromCharCode(u0);}else {var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}else {if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63;}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len;}else if(u<=2047){len+=2;}else if(u<=65535){len+=3;}else if(u<=2097151){len+=4;}else if(u<=67108863){len+=5;}else {len+=6;}}return len}typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e;}if(!err.stack){return "(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var PAGE_SIZE=16384;var buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=new Uint16Array(buffer);Module["HEAPU32"]=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer);}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ");}function enlargeMemory(){abortOnCannotGrowMemory();}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func);}else {Module["dynCall_vi"](func,callback.arg);}}else {func(callback.arg===undefined?null:callback.arg);}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer);}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i);}if(!dontAddNull)HEAP8[buffer>>0]=0;}if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_min=Math.min;var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var ASM_CONSTS=[(function($0,$1){var path=Pointer_stringify($0);var data=Pointer_stringify($1);FS.createPath("/",PATH.dirname(path));FS.writeFile(PATH.join("/",path),data);})];function _emscripten_asm_const_iii(code,a0,a1){return ASM_CONSTS[code](a0,a1)}STATIC_BASE=GLOBAL_BASE;STATICTOP=STATIC_BASE+197232;__ATINIT__.push();memoryInitializer="data:application/octet-stream;base64,AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/ACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAIMEAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAIMEAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkACEAAAAAAAAAAAAAAAABBAoC8AAAgAAAABAAAAAAAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICWQAAAAAAAgJZABJDDAAAAAAAAAAAAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWEAAAAAAAABYQAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYQAAAAAAAAFhAAAAAAAAAAAAAAAAAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUkAAAAAAAABSQAAgAwIAAAAAAAAAAAAAEEAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAABCQAAAAAAAAEJAAAAAAAAgg0AAAAAAAMCIQAAAAAAAAFJAAAAAAAAAUkAAAAAAAAAAAAAAAAAAAEJAAAAAAAAAQkAAAAAAACCDQAAAAAAAwIhAAAAAAAAAUkAAAAAAAABSQACwwQAAAAAAAAAAAAAAEEBANgAAkwAAAAEAAAAAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAEAACAAAAAAAAAAAAABBAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYQAAAAAAAAFhAALDBAAAAAAAAAAAAAAAAABw6AAAQAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWEAAAAAAAABYQEAgPgMAAAAAAAAAAAAAEEAkOwAAegAAAAEAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFJAAAAAAAAAUkAAAAAAAAAAAAAAAAAAABBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSQAAAAAAAAFJA////////73/////////vf////////+//////////7/8AAAAAAAD4PzMzMzMzM9M/PAAAAAAAAACamZmZmZmpPwEAAAAAAAAAAQAAAAAAAAAAAAAAAADwPwEAAAAAAAAAAgAAAAAAAAAAAAAAAADwPwIAAAAAAAAAAwAAAAAAAAAAAAAAAADgPwMAAAAAAAAABAAAAAAAAAAAAAAAAADwPwQAAAAAAAAABQAAAAAAAAAzMzMzMzPzPwUAAAAAAAAABgAAAAAAAACamZmZmZnpPwYAAAAAAAAABwAAAAAAAAAAAAAAAADwPwcAAAAAAAAACAAAAAAAAAAAAAAAAADgPwgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAMzMzMzMz078AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgEZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAmpmZmZmZ2b8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzMzMzMzPjPwAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAexSuR+F65L8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAEAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABr4VQAAAQAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAAAgGZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgGZAmpmZmZmZ2b8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAgGZAexSuR+F65L8AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAgEZAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAQAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABUAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAAAAAAAAAEAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAEAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwVQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPC/AAAAAAAAAQAAAAAAAAAAAAAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQP1ioNc07TtU/JXUCmggb2j8AAAAAAADgPwAAAAAAAOA/LNSa5h2n6j9q3nGKjuToP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAAOA/XdxGA3gL4j8AAAAAAADQP1ioNc07TtU/AAAAAAAA0D/TvOMUHcnRPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/07zjFB3J0T/TvOMUHcnRP13cRgN4C+I/XdxGA3gL4j9d3EYDeAviPw1xrIvbaNw/ZF3cRgN47T/Sb18HzhnnPxB6Nqs+V+U/EHo2qz5X5T/Sb18HzhnnP3gLJCh+jOM/tRX7y+7J4T/Sb18HzhnnP9JvXwfOGec/WKg1zTtO1T+IhVrTvOPYP9JvXwfOGec/eAskKH6M4z/EQq1p3nHsP9JvXwfOGec/0m9fB84Z5z+1FfvL7snhP9JvXwfOGec/EHo2qz5X5T+1FfvL7snhP3gLJCh+jOM/0m9fB84Z5z/Sb18HzhnnP4Y41sVtNO4/0m9fB84Z5z/Sb18HzhnnP3gLJCh+jOM/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/pgpGJXUC3j8AAAAAAADgP1ioNc07TtU/DXGsi9to3D8AAAAAAADgPw1xrIvbaNw/AAAAAAAA4D8NcayL22jcP1ioNc07TtU/AAAAAAAA4D8AAAAAAADgP9O84xQdydE/07zjFB3J0T8AAAAAAADgP9O84xQdydE/at5xio7k6D8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgP1ioNc07TtU/iIVa07zj2D/TvOMUHcnRPwAAAAAAAOA/AAAAAAAA4D/Sb18HzhnnPwAAAAAAAOA/AAAAAAAA4D8NcayL22jcP/RsVn2utt4/ETY8vVKWyT/0bFZ9rrbePzsBTYQNT+E/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D9YqDXNO07VPwAAAAAAAOA/AAAAAAAA4D8+6Nms+lzFPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAAOA/gnNGlPYGxz8NcayL22jcPwAAAAAAAOA/WKg1zTtO1T9YqDXNO07VP7UV+8vuyeE/tRX7y+7J4T8AAAAAAADQPwAAAAAAAOA/AAAAAAAA4D8AAAAAAADgPwAAAAAAANA/AAAAAAAA0D8H8BZIUPzcP6K0N/jCZNY/WKg1zTtO1T8NcayL22jcPw1xrIvbaNw/AAAAAAAA4D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA0D8NcayL22jcPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VPwAAAAAAANA/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/AAAAAAAA8D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQP8RCrWnecew/AAAAAAAA0D9/2T15WKjRPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/eAskKH6M4z/Sb18HzhnnP8RCrWnecew/E/JBz2bV0z8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/EHo2qz5X5T8AAAAAAADQPwAAAAAAANA/AAAAAAAA0D/TvOMUHcnRPwAAAAAAANA/AAAAAAAA0D/TvOMUHcnRPwAAAAAAAOA/0m9fB84Z5z8AAAAAAADgPwAAAAAAANA/AAAAAAAA0D8AAAAAAADQPwAAAAAAANA/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z9R2ht8YTLjP1HaG3xhMuM/UdobfGEy4z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP/RsVn2uttY/tRX7y+7J4T+1FfvL7snhP8RCrWnecew/EHo2qz5X5T/129eBc0bMP1ioNc07TtU/WKg1zTtO1T+IhVrTvOPYPwFNhA1Pr+I/07zjFB3J0T9YqDXNO07VP9O84xQdydE/07zjFB3J0T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhP9O84xQdydE/07zjFB3J0T8BTYQNT6/iPwFNhA1Pr+I/AU2EDU+v4j+1FfvL7snhP8xdS8gHPfA/EHo2qz5X5T8QejarPlflP9JvXwfOGec/0m9fB84Z5z8QejarPlflP3gLJCh+jOM/at5xio7k6D/Sb18HzhnnP9O84xQdydE/AAAAAAAA4D8QejarPlflP7UV+8vuyeE/LNSa5h2n6j/Sb18HzhnnP2recYqO5Og/EHo2qz5X5T9q3nGKjuToP9JvXwfOGec/EHo2qz5X5T94CyQofozjP9JvXwfOGec/EHo2qz5X5T+GONbFbTTuPxB6Nqs+V+U/EHo2qz5X5T94CyQofozjP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP6YKRiV1At4/tRX7y+7J4T9Iv30dOGfMP7UV+8vuyeE/tRX7y+7J4T8AAAAAAADgP7UV+8vuyeE/tRX7y+7J4T/TvOMUHcnRP7UV+8vuyeE/tRX7y+7J4T9Iv30dOGfMP0i/fR04Z8w/AAAAAAAA4D9Iv30dOGfMPyzUmuYdp+o/tRX7y+7J4T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T9YqDXNO07VPwAAAAAAAOA/07zjFB3J0T+1FfvL7snhPwAAAAAAAOA/0m9fB84Z5z8AAAAAAADgPwAAAAAAAOA/AAAAAAAA4D8Cmggbnl7VP+C+DpwzotA/ApoIG55e1T8BTYQNT6/iP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/WKg1zTtO1T+1FfvL7snhP7UV+8vuyeE/PujZrPpcxT+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T+1FfvL7snhPx04Z0Rpb8g/WKg1zTtO1T+1FfvL7snhP1ioNc07TtU/WKg1zTtO1T8AAAAAAADgPwAAAAAAAOA/07zjFB3J0T+1FfvL7snhP7UV+8vuyeE/tRX7y+7J4T/TvOMUHcnRP9O84xQdydE/5x2n6Egu4T+itDf4wmTWP0i/fR04Z8w/WKg1zTtO1T9YqDXNO07VP7UV+8vuyeE/AAAAAAAA8D8AAAAAAADwP9O84xQdydE/eAskKH6M4z/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VP1ioNc07TtU/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T/TvOMUHcnRP1ioNc07TtU/WKg1zTtO1T9YqDXNO07VPwAAAAAAAPA/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T8AAAAAAADwP9O84xQdydE/6pWyDHGs1z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP7UV+8vuyeE/at5xio7k6D8AAAAAAADwP5jdk4eFWtc/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP8RCrWnecew/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP9O84xQdydE/SL99HThnzD94CyQofozjP4Y41sVtNO4/eAskKH6M4z/TvOMUHcnRP9O84xQdydE/07zjFB3J0T/TvOMUHcnRP1GgT+RJ0g5AtMh2vp86NcA6It+l1CXVv/OCPkeaLoo/n+V5cHfW+b9+/RAbLJzmP5bs2AjE68w/zc6idyrg0D+w479AECDtv62h1F5E29g/O6F85lGWdj/TbnD5eoR7P4HMzqJ3KuS/0a3X9KCgyD9q3zcZsD+EP77KkBle/4Q/HJYGflTDxL+lSSno9uIjQKnZA63AkME/CMSQQZNpiT/6RJ4kXTPQvwHwmTYtwl4/DZx9L8+Ulz+JtfgUAOOJP+WpWEY0y7G/jwDJz6Fnpr9ctcb7zLSIP02kj1Q6s5A/5scEoWHWoL/HaWccE/eCvyp/a+UtcFy/5FdiVAiadT/R8YdVcgS3P5XUCWgiPDPAZCMQr+t3EMCnIarwZ3jHP9r/AGvVrsE/TihEwCFU97+qSIWxhSD1P51oVyHlJ/Y/TS7GwDqOzT9Zayi1F9HcvwM/qmG/J8w/pkdTPZl/2j+2gTtQpzyuP1FM3gAz37m/9XaV/9oLpj/UpTW8D/aUPx+tILws3JA/KCzxgLLJI0AjWuFMAoq3P0ijZVGWKX8/u7SG98Gekz8XqHtTR32gvyErruBtlIs/M3PchNYetb+geISJ9fyPP2k1JO6x9JG/uM0zel6/aj+SPq2iPzTNv36w58ZPPpi/ByObUC3HpD8+GMJ7WLmRvy18fa1LjcY/AAAAQPsh+T8AAAAALUR0PgAAAICYRvg8AAAAYFHMeDsAAACAgxvwOQAAAEAgJXo4AAAAgCKC4zYAAAAAHfNpNQAAAAAAAPC/vAQBAOgqAAADAAAAEC0AAAMAAADoLwAAAwAAALAwAAADAAAAADIAAAMAAAB4NQAAAwAAALQ4AAADAAAAxC4AAAMAAAB8OQAAAwAAAIQ6AAADAAAAED8AAAMAAAA0PQAAAAAAANQsAAAAAAAAwC8AAAAAAAAQMAAAAAAAANgxAAAAAAAAKDIAAAAAAACMOAAAAAAAAGAuAAAAAAAAVDkAAAAAAABcOgAAAAAAAOg+AAAAAAAADD0AAAQAAAA4PwAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAACAAAAAQAAAAEAAAADAAAAAAAAAAAAAAAI2QIAGNkCACjZAgA42QIASNkCAFjZAgBo2QIAeNkCABjZAgAY2QIAWNkCAFjZAgAfAAAAPwAAAH8AAAAAAAAAooUBAAEAAACoKwAAaAAAAAQAAADVCAEAAQAAACAsAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAUBAAEAAAAAAAAA4AAAAAAAAAB4BQEAAQAAAAAAAADgAAAAAQAAAH8FAQABAAAAAAAAAKgAAAACAAAAiQUBAAEAAAAAAAAA4AAAAAMAAACTBQEAAQAAAAAAAADgAAAABAAAAKEFAQABAAAAAAAAAOAAAAAFAAAAqwUBAAEAAAAAAAAA4AAAAAYAAAC4BQEAAQAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAA/////wAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2ggBAAEAAADELQAAGAEAAAEAAADfCAEAAQAAAMQtAAAYAQAAAgAAAOUIAQABAAAAxC0AABgBAAADAAAA7ggBAAEAAADELQAAGAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPgIAQABAAAAAAAAAHABAAABAAAAAgkBAAEAAAAAAAAAcAEAAAIAAAANCQEAAQAAAAAAAAA4AQAAAwAAABsJAQABAAAAAAAAADgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAkAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAwAAAANAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAYAAAACAAAAAgAAAAcAAAACAAAAAAAAAGIYAgBnAQIA+AICADgJAgAvEAIAbhQCAO4XAgD/FwIAAAAAAGIJAQABAAAAKC8AAKgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmCQEAAQAAAAAAAADIAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAbgkBAAEAAAA4MAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAKYKAQABAAAAAAAAACACAAACAAAAsAoBAAEAAAAAAAAAWAIAAAAAAAC5CgEAAQAAAAAAAABYAgAAAwAAAMIKAQABAAAAAAAAAFgCAAAAAAAAzAoBAAEAAAAAAAAAIAIAAAMAAADYCgEAAQAAAAAAAAAgAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAASAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAVAAAAFgAAABcAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAMAAAAJAAAAAwAAAAMAAAAKAAAABAAAAAAAAABiGAIAZwECADgJAgD4AgIAbhQCAC8QAgD/FwIA7hcCAAAAAAAAAAAAlQwBAP////88MQAAkAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJgMAQD/////AAAAALACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACojQEAAQAAAFAyAADoAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAGQAAABoAAAAAAAAABAAAAAAAAAAbAAAAHAAAAB0AAAAeAAAAAAAAAAAAAAAAAAAAAAAAAB8AAAAgAAAAIQAAACIAAAACAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAMAAAABQAAAAQAAAANAAAABQAAAAMAAACVEAEAoxABALkQAQDz+QIAxxABANYQAQDbEAEA+RABAPP5AgALEQEAOxEBAPP5AgBZEQEAgREBAI8RAQC+EQEA8hEBAAMSAQAoEgEASxIBAFESAQBtEgEAihIBAKUSAQDGEgEA4BIBAAITAQAhEwEARxMBAF8TAQB/EwEAnBMBAMATAQDMEwEA8/kCANcTAQD9EwEAIRQBAEcUAQDz+QIAfRQBAJUUAQCiFAEA0RQBAMwTAQDz+QIA3hQBAOcUAQAIFQEAQxUBAI4VAQDiFQEABBYBABkWAQAwFgEARhYBAF4WAQDz+QIAdBYBAI8WAQCzFgEA1xYBAPwWAQDz+QIAHRcBADcXAQBJFwEAVhcBAGMXAQB3FwEAhhcBAI4XAQCjFwEAsRcBAO8XAQD6FwEAzBMBAPP5AgAAGAEADBgBABsYAQBLEgEA8/kCAC4YAQBXGAEAdRgBAIUYAQCWGAEAnRgBAKwYAQC8GAEAABkBAAcZAQBLEgEA8/kCABEZAQA9GQEASBkBAFEZAQBaGQEAaxkBAHwZAQCQGQEAzBMBAPP5AgCcGQEArBkBALoZAQDIGQEA1RkBAOIZAQD4GQEAARoBABAaAQAdGgEALhoBAMwTAQDz+QIAORoBAFgaAQDz+QIAahoBAHkaAQCpGgEAsxoBAMAaAQDNGgEA2hoBAOcaAQDqGgEA8/kCAO4aAQDz+QIAERsBAEIbAQBxGwEAiBsBAKMbAQC+GwEAzBMBAPP5AgDaGwEA8/kCAAIcAQAOHAEAIRwBADQcAQBJHAEAXhwBAGIcAQBLEgEA8/kCAG4cAQDz+QIAfhwBAIwcAQCYHAEApRwBAMUcAQDbHAEA8/kCAO8cAQA4HQEAfh0BAK4dAQDhHQEA6B0BAA8eAQA2HgEA8/kCADseAQAAAAAAAAAAAPBHAQABAAAAAAAAAAgDAAABAAAArx4BAAEAAAAAAAAACAMAAAIAAADpRwEAAQAAAAAAAABAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjAAAAAAAAACQAAAAlAAAABgAAACYAAAAnAAAAKAAAACkAAAAqAAAAAAAAAAAAAAAAAAAAAAAAACsAAAAsAAAALQAAAC4AAAAEAAAALwAAAAAAAAAAAAAADgAAAAAAAAAPAAAABwAAAAUAAAAQAAAABgAAAAAAAAB/AAIAiQACAHkxAQDOAAIACQECACsBAgAxAQIAYhgCAFgBAgBnAQIAhAECAI8BAgCxAQIA5wECAB0CAgBYAgIAjgICALACAgC/AgIA8AICAPgCAgA/JQEASCUBABUDAgBRJQEAXwMCAFolAQBpAwIAYyUBAHMDAgDCAwIA/QMCAG8lAQA4BAIAQwQCAIgEAgCWBAIA4AQCAO4EAgD8BAIABwUCADgFAgB4BQIAgAUCAIgFAgDDBQIA+QUCAAUGAgB+MQEAEQYCABsGAgAmBgIAQwYCAHkGAgA4CQIAWgkCAGYJAgAlDAIAVgwCAIIMAgC4DAIAxQwCAOcMAgAJDQIAEg0CAFwNAgBmDQIAqw0CAOENAgDsDQIAcQ4CAIYOAgB3JQEAkA4CAJoOAgDQDgIAEA8CAB4PAgByDwIAgQ8CAJAPAgDfDwIAhjEBAB8QAgApEAIALxACAFsQAgCCEAIAkxACAJ4QAgDjEAIAKBECADcRAgBHEQIAWRECAGkRAgB5EQIAhhECAJARAgDGEQIAzxECAA8SAgAiEgIAizEBACoSAgBgEgIAhxICAL0SAgDkEgIA8hICACgTAgByEwIAvBMCAMcTAgD9EwIAAhQCAB8UAgA8FAIARxQCAG4UAgCGFAIAvBQCAPIUAgD+FAIAJRUCADAVAgBhFQIAkhUCAHg8AQC5FQIA5RUCABsWAgBRFgIAWxYCAHgWAgC4FgIA7hYCAJExAQAGFwIAMhcCAFkXAgCPFwIAzBcCAO4XAgD0FwIA/xcCACYYAgAAAAAAq40BAAEAAADINQAAeAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMdIAQABAAAAAAAAAJgDAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAAAAAAAzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAABIAAAAIAAAABgAAABMAAAAHAAAAAAAAAAAAAACtJgEAAQAAANw4AADQAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsCYBAAEAAAAAAAAA8AMAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAA1AAAANgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAADcAAAAAAAAAAAAAABQAAAAAAAAAFQAAAAkAAAAHAAAAFgAAAAgAAAAAAAAAeTEBAGIYAgBnAQIAfjEBAHkGAgA4CQIAhjEBAFsQAgAPEgIAizEBAEcUAgBuFAIAeDwBAJExAQDuFwIA/xcCAAAAAACWMQEAAQAAAKQ5AAAoBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmjEBAAEAAAAAAAAASAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAA5AAAAOgAAAAoAAAA7AAAAPAAAAD0AAAA+AAAAPwAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQQAAAEIAAABDAAAAAAAAAAAAAAAAAAAAAAAAABcAAAAAAAAAGAAAAAsAAAAIAAAAGQAAAAkAAAAAAAAAzgACAA47AQBiGAIAZwECAIQBAgAZOwEAHzsBACo7AQAxOwEAjwECAOcBAgA5OwEAPzsBAEo7AQCOAgIAsAICAPgCAgBROwEAXwMCAHMDAgD9AwIAWzsBAIgEAgCWBAIA4AQCAGY7AQDuBAIAbjsBAHc7AQCFOwEAjzsBAMMFAgCYOwEABQYCACYGAgBDBgIAnjsBAIoGAgC1BgIA3gYCAAEHAgAqBwIATQcCAHYHAgCZBwIAwgcCAOUHAgAOCAIAMQgCAFoIAgB9CAIApggCAMkIAgDyCAIAFQkCADgJAgClOwEAWgkCALE7AQCCDAIA5wwCAKsNAgC+OwEAkA8CAMs7AQAfEAIALxACANU7AQBbEAIAghACAJMQAgDkOwEA9jsBAJ4QAgAoEQIANxECAEcRAgBZEQIAaRECAAY8AQARPAEAHDwBAHkRAgAPEgIAFBICACE8AQAqPAEAMzwBAEM8AQBKPAEAYBICAIcSAgC9EgIA8hICAAIUAgAfFAIAUjwBAG4UAgBZPAEA/hQCAGI8AQAwFQIAajwBAJIVAgB4PAEAuRUCAOUVAgB/PAEAeBYCALgWAgCJPAEA7hYCAAYXAgBZFwIAkzwBAKE8AQCPFwIAlhcCAMwXAgDuFwIA/xcCACYYAgAAAAAAszwBAAEAAACsOgAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALc8AQABAAAAAAAAAKAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAEUAAAAAAAAAAAAAAEYAAABHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAABsAAAAMAAAACQAAABwAAAAKAAAAAAAAAEFCAACwoQEAQUkAAIqhAQBBUgAAXaEBAEFYAADFoQEAQiAAAAGkAQBCSQAAEqQBAENCAABKogEAQ08AADiiAQBDWAAAV6IBAEggAAB7ogEASEIAAIWiAQBISQAAEaMBAEhYAACUogEASGIAAMWiAQBIaQAA+KIBAEhyAACqogEASHgAANuiAQBJIAAAI6QBAEtCAADcoQEAS0kAACSiAQBLUgAAEKIBAEtYAAD9oQEATkIAACOjAQBOSQAAaqMBAE5SAACCowEATlgAAE6jAQBQQQAA46MBAFBCAACfowEAUEkAANOjAQBQWAAAv6MBAFIgAADapQEAUyAAAPKjAQBaRAAAYKQBAAAAAAAAAAAAAQAAAAAAAABdRwEA/////1w9AADYBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYUcBAP////8AAAAA+AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAGlHAQABAAAAIEMAAAAAAAAQAAAAcUcBAAEAAAAgQwAAAAAAABEAAAB5RwEAAQAAACBDAAAAAAAAEQAAAIJHAQABAAAAIEMAAAAAAAARAAAAikcBAAEAAAAgQwAAAAAAABMAAACSRwEAAQAAACRDAAAAAAAAFAAAAJpHAQABAAAAJEMAAAAAAAAVAAAAokcBAAEAAAAkQwAAAAAAABUAAACrRwEAAQAAACRDAAAAAAAAFQAAALNHAQABAAAAJEMAAAAAAAAWAAAAu0cBAAEAAAAoQwAAAAAAABcAAADERwEAAQAAAChDAAAAAAAAGAAAAM1HAQABAAAAKEMAAAAAAAAYAAAA10cBAAEAAAAoQwAAAAAAABgAAADgRwEAAQAAAChDAAAAAAAAGQAAAOlHAQABAAAALEMAAAAAAAAZAAAA8EcBAAEAAAAsQwAAAAAAABoAAAD2RwEAAQAAADBDAAAAAAAACgAAAP9HAQABAAAANEMAAAAAAAALAAAAB0gBAAEAAAA0QwAAAAAAAAwAAAAPSAEAAQAAADRDAAAAAAAADAAAABhIAQABAAAANEMAAAAAAAAMAAAAIEgBAAEAAAA0QwAAAAAAAA4AAAAoSAEAAQAAADRDAAAAAAAADgAAAC9IAQABAAAANEMAAAAAAAANAAAAN0gBAAEAAAA0QwAAAAAAAAUAAAA/SAEAAQAAADRDAAAAAAAABgAAAEdIAQABAAAANEMAAAAAAAAHAAAAT0gBAAEAAAA0QwAAAAAAAAcAAABYSAEAAQAAADRDAAAAAAAABwAAAGBIAQABAAAANEMAAAAAAAAJAAAAaEgBAAEAAAA0QwAAAAAAAAkAAABvSAEAAQAAADRDAAAAAAAACAAAAHdIAQABAAAANEMAAAAAAAAAAAAAf0gBAAEAAAA4QwAAAAAAAAEAAACISAEAAQAAADhDAAAAAAAAAgAAAJFIAQABAAAAOEMAAAAAAAACAAAAm0gBAAEAAAA4QwAAAAAAAAIAAACkSAEAAQAAADhDAAAAAAAABAAAAK1IAQABAAAAOEMAAAAAAAAEAAAAtUgBAAEAAAA4QwAAAAAAAAMAAAC+SAEAAQAAADhDAAAAAAAAEgAAAMdIAQABAAAAIEMAAAAAAAAbAAAAz0gBAAEAAAA8QwAAAAAAABwAAADXSAEAAQAAADxDAAAAAAAAHQAAAN9IAQABAAAAPEMAAAAAAAAdAAAA6EgBAAEAAAA8QwAAAAAAAB0AAADwSAEAAQAAADxDAAAAAAAAHgAAAPhIAQABAAAAQEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAAUAAAAFQAAAGNMAQBMQwAAAQAAAGhDAAAAAAAAAAAAAEgAAABJAAAAAQAAAAAAAACihQEAAAAAAFxDAABkQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAgAAAAQAAAAYAQAAMAEAALAAAACIVAEAjVQBAJFUAQCYVAEAnFQBAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAdAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAfAAAAAAAAAAAAAACRWQEAKEQAAAEAAACARAAAAAAAAAAAAABKAAAASwAAAEwAAABNAAAATgAAAE8AAABQAAAAUQAAAFIAAABTAAAAVAAAAEsAAABVAAAASwAAAFYAAABXAAAAWAAAAFkAAAAAAAAAnlkBAAAAAAA4RAAAKNsCAAEAAACkWQEAAAAAAEBEAAAo2wIAAgAAAKhZAQAAAAAASEQAACjbAgADAAAArVkBAAAAAABQRAAAKNsCAAQAAACzWQEAAAAAAFhEAAAo2wIABQAAALlZAQAAAAAAcEQAACjbAgAGAAAAw1kBAAAAAAB4RAAAKNsCAAcAAADJWQEAAAAAAGBEAAAo2wIABwAAAM1ZAQAAAAAAYEQAACjbAgAHAAAA0lkBAAAAAABoRAAAKNsCAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADAAAAAAAAAAAQAAACAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAQAAAAAAAAAPGcBAFRnAQBzZwEAkGcBAK9nAQC2ZwEAv2cBADxnAQBBZwEASGcBAE1nAQDeZgEA8GYBAP5mAQAMZwEAGmcBACFnAQAwZwEAPGcBAAAAAADz+QIAAAAAAB0SAgABAAAA+GkBAAcAAAC8aQEAAwAAAMYlAgAFAAAAAGoBAA8AAACQjQEACAAAAJCNAQAQAAAACGoBAAQAAAAIagEAEQAAAA1qAQAFAAAADWoBAAIAAAATagEABgAAABpqAQAEAAAAJmoBAAcAAAAuagEABwAAAD5qAQAFAAAARGoBAAgAAABbagEACAAAAERqAQAJAAAAZGoBAAcAAABsagEACgAAAIZqAQAHAAAAjmoBAAsAAACoagEABgAAAK9qAQAMAAAAzWoBAAkAAACvagEADQAAANdqAQAIAAAA4GoBAA4AAAABawEACAAAAAprAQASAAAAK2sBAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAIAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAMAAAAhAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAiAAAABQAAAAAAAAAAAAAAAAAAAAUAAABAAAAAiEcAAJhHAAAGAAAABAAAAKRHAAAGAAAACAAAAAYAAAAEAAAArEcAAAAEAAAIAAAA/////wAAAAAAAAAAIwAAAAAAAAAAAAAAAAAAAAAAAAA1AAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAGAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAGAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAIAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAIAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAJAAAAAAAAAAcAAAAAAAAACQAAAAsAAAAIAAAACgAAADBJAAC0SAAAGEkAAAEAAAABAAAACgAAABYAAAALAAAAWgAAACQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA0AAAAAAAAABwAAAAAAAAAHAAAAAgAAAAUAAAAIAAAAAAAAAAAAAAAGAAAAAwAAAA4AAAALAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAADwAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlAAAAEAAAAAAAAAAHAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAmAAAAAAAAAAAAAAAAAAAAAAAAABAAAAD/////AAAAAAAAAAAnAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAwAAAAEAAAABAAAAAgAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAABAAAAAUAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAGAAAAAQAAAAEAAAAHAAAACAAAAAkAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAAQAAAAEAAAALAAAAAQAAAAwAAAABAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABMAAAATAAAAEwAAABMAAAAXAAAAGAAAABkAAAATAAAAGgAAABsAAAAcAAAAHQAAABMAAAATAAAAEwAAABMAAAATAAAAAQAAAB4AAAABAAAAAQAAABMAAAABAAAAHwAAACAAAAAhAAAAIgAAACMAAAATAAAAJAAAACUAAAAmAAAAEwAAABMAAAATAAAAEwAAACcAAAAoAAAAKQAAABMAAAAqAAAAKwAAACwAAAAtAAAAEwAAABMAAAATAAAAEwAAABMAAAABAAAAAQAAAAEAAAABAAAAAQAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAALgAAABMAAAATAAAAEwAAAC8AAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAADAAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAEwAAABMAAAATAAAAAAAAAAEAAAABAAAAAgAAAAMAAAABAAAABAAAAAEAAAAFAAAAAQAAAAYAAAAHAAAABwAAAAEAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAAAwAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAIAAAAB5swEAWrMBACB8AQCGswEAfrMBAIyzAQAAAAAAJoABAC+AAQA2gAEARIABAHqyAQCiswEAS4ABAFKAAQABAAAACAAAAP////8AAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAA8IEBAAgAAAADAAAA+YEBAP2BAQALAAAABgAAAKiNAQAJggEAAgAAAAEAAAAMggEAEIIBAAQAAAACAAAAFYIBABmCAQAEAAAABAAAAB6CAQAjggEABQAAAAUAAAApggEALYIBAAQAAAAHAAAAMoIBADaCAQAFAAAACQAAADyCAQBAggEABAAAAAoAAABFggEASoIBAAQAAAAMAAAAT4IBAOKGAQAAAAAAAQAAAOqGAQABAAAAAAAAAHWyAQABAAAAAQAAAB0SAgAAAAAAAAAAAAAAAAAAAAAAAAAAAMuFAQAxAAAAAAAAAAAAAACjrQEAEAAAAEUeAgCAAAAAxIUBAEAAAAAOoAEAEAAAAMaFAQBAAAAAAAAAAAAAAACShQEAAQAAAJmFAQACAAAAnoUBAAMAAADMpgEABAAAADCdAQAFAAAAooUBAAYAAAAdEgIACAAAAKaFAQAhAAAAqoUBACIAAACuhQEAIgAAALKFAQABAAAAt4UBAAcAAAC9hQEAJwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAApAAAAAAAAAAAAAAAAAAAAAAAAAP2KAQAEiwEAAAAAAKWNAQCojQEAq40BAAAAAAAAAAAAAQAAAAIAAAD/////aI0BAG6NAQAdEgIAAAAAAGQAAABlAAAAZgAAAGQAAAAIAAAACAAAAAAAAAAAAAAAKgAAABEAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAJAAAAKwAAABEAAAAAAAAAAAAAAAAAAAAIAAAA/////wAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAADMpgEAYFUAAIAGAAAAAAAA+ZwBAGBVAACwBgAAAAAAANKlAQBgVQAA4AYAAAAAAAABnQEAYFUAAOAGAAAAAAAABp0BAGBVAAAQBwAAAAAAAA2dAQB4VQAAEAcAAAAAAAATnQEAYFUAAEAHAAAAAAAAF50BAGBVAABwBwAAAAAAAB0SAgBgVQAAoAcAAAAAAAAgnQEAYFUAAKAHAAAAAAAAKp0BAGBVAABQBgAAAAAAADCdAQBgVQAA0AcAAAAAAAA4nQEAYFUAAAAIAAAAAAAAQp0BAGBVAAAwCAAAAAAAAFCdAQBgVQAAYAgAAAAAAABWnQEAYFUAAJAIAAAAAAAAX50BAGBVAADACAAAAAAAAGedAQBgVQAA8AgAAAAAAABwnQEAYFUAACAJAAAAAAAAeJ0BAGBVAABQCQAAAAAAAH2dAQBgVQAAgAkAAAAAAACBnQEAYFUAALAJAAAAAAAAiJ0BAGBVAADgCQAAAAAAAI6dAQBgVQAAEAoAAAAAAACYnQEAkFUAAEAKAAAAAAAAoZ0BAGBVAACABgAAAAAAAKadAQBgVQAAgAYAAAAAAACwnQEAYFUAAHAKAAAAAAAAt50BAGBVAACgCgAAAAAAAMSdAQBgVQAA0AoAAAAAAADSnQEAYFUAAAALAAAAAAAA4J0BAGBVAAAwCwAAAAAAAOydAQBgVQAAYAsAAAAAAAD5nQEAYFUAAJALAAAAAAAAAp4BAGBVAADACwAAAAAAAAyeAQBgVQAA8AsAAAAAAAAVngEAYFUAACAMAAAAAAAAHZ4BAGBVAABQDAAAAAAAACWeAQBgVQAAgAwAAAAAAAAungEAYFUAALAMAAAAAAAAMp4BAGBVAADgDAAAAAAAAD2eAQBgVQAAEA0AAAAAAABBngEAYFUAAEANAAAAAAAAS54BAGBVAABwDQAAAAAAAFSeAQBgVQAAoA0AAAAAAABcngEAYFUAANANAAAAAAAAaZ4BAGBVAAAADgAAAAAAAHWeAQBgVQAAMA4AAAAAAACAngEAYFUAAGAOAAAAAAAAkJ4BAGBVAACQDgAAAAAAAJ6eAQBgVQAAwA4AAAAAAACtngEAYFUAAPAOAAAAAAAAt54BAGBVAAAgDwAAAAAAAMCeAQBgVQAAUA8AAAAAAADKngEAYFUAAIAPAAAAAAAA1J4BAGBVAACwDwAAAAAAANueAQBgVQAA4A8AAAAAAADingEAYFUAABAQAAAAAAAA7J4BAKhVAAAAAAAAAAAAAPOeAQCoVQAAAAAAAAAAAADVnAEAwFUAAAAAAAAAAAAA+54BANhVAABAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbAAAAXAAAABcAAAAEAAAAAgAAAAwAAABdAAAAXAAAABcAAAAFAAAAAAAAAA0AAABbAAAAXAAAABcAAAAEAAAAAgAAAAwAAABeAAAAXwAAABgAAAAGAAAAAwAAAA4AAABgAAAAYQAAABcAAAAHAAAAAAAAAA8AAABbAAAAXAAAABcAAAAIAAAAAgAAAAwAAAAQAAAAEQAAABIAAAATAAAA/Z8BAASgAQAAAAAADKABAA6gAQB/HgIAEKABAAwAAAAEAAAABgAAAAIAAAADAAAAAQAAAAkAAAAIAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB8AAAAgAAAAIQAAACIAAAAjAAAAJAAAACUAAAAmAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAAD0AAAA+AAAAPwAAAEAAAABBAAAAQgAAAEMAAABEAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAF2hAQBtoQEAeqEBAAAAAAAAAAAABAAAAH+hAQAAAAAAAAAAAIqhAQBtoQEAeqEBAAAAAAChoQEABQAAAH+hAQAAAAAAqaEBALChAQBtoQEAwKEBAAAAAAAAAAAABgAAAH+hAQDrsQEAAAAAAMWhAQBtoQEAwKEBAAAAAAChoQEABwAAAH+hAQDrsQEAqaEBANyhAQDpoQEAwKEBAAAAAAAAAAAACgAAAPehAQDrsQEAAAAAAP2hAQDpoQEAwKEBAAAAAACpoQEACwAAAPehAQDrsQEAqaEBABCiAQDpoQEAHqIBAAAAAAAAAAAACAAAAPehAQAAAAAAAAAAACSiAQDpoQEAHqIBAAAAAACpoQEACQAAAPehAQAAAAAAqaEBADiiAQA4ogEAAAAAAAAAAAAAAAAADAAAAECiAQAAAAAAAAAAAEqiAQA4ogEA67EBAAAAAAAAAAAADgAAAECiAQDrsQEAAAAAAFeiAQA4ogEA67EBAAAAAAChoQEADwAAAECiAQDrsQEAqaEBAGuiAQA4ogEAAAAAAAAAAAChoQEADQAAAECiAQAAAAAAqaEBAHuiAQB7ogEAAAAAAAAAAAAAAAAAEAAAAH+hAQAAAAAAAAAAAIWiAQB7ogEA67EBAAAAAAAAAAAAEgAAAH+hAQDrsQEAAAAAAJSiAQB7ogEA67EBAAAAAAChoQEAEwAAAH+hAQDrsQEAqaEBAKqiAQB7ogEAAAAAALuiAQAAAAAAFAAAAH+hAQAAAAAAAAAAAMWiAQB7ogEA67EBALuiAQAAAAAAFgAAAH+hAQDrsQEAAAAAANuiAQB7ogEA67EBALuiAQChoQEAFwAAAH+hAQDrsQEAqaEBAPiiAQB7ogEAAAAAALuiAQChoQEAFQAAAH+hAQAAAAAAqaEBABGjAQB7ogEAAAAAAAAAAAChoQEAEQAAAH+hAQAAAAAAqaEBACOjAQA5owEA67EBAAAAAAAAAAAAGgAAAPehAQDrsQEAAAAAAE6jAQA5owEA67EBAAAAAACpoQEAGwAAAPehAQDrsQEAqaEBAGqjAQA5owEAAAAAAAAAAACpoQEAGQAAAPehAQAAAAAAqaEBAIKjAQA5owEAmaMBAAAAAAAAAAAAGAAAAPehAQAAAAAAAAAAAJ+jAQCtowEA67EBAAAAAAAAAAAAHgAAAPehAQDrsQEAAAAAAL+jAQCtowEA67EBAAAAAACpoQEAHwAAAPehAQDrsQEAqaEBANOjAQCtowEAAAAAAAAAAACpoQEAHQAAAPehAQAAAAAAqaEBAOOjAQCtowEAmaMBAAAAAAAAAAAAHAAAAPehAQAAAAAAAAAAAPKjAQDyowEAAAAAAAAAAAAAAAAAIAAAAPmjAQAAAAAAAAAAAAGkAQAMpAEA67EBAAAAAAAAAAAAAgAAAPehAQDrsQEAAAAAABKkAQAMpAEA67EBAAAAAACpoQEAAwAAAPehAQDrsQEAqaEBACOkAQAMpAEAAAAAAAAAAACpoQEAAQAAAPehAQAAAAAAqaEBANqlAQAMpAEAAAAAAAAAAAAAAAAAAAAAAPehAQAAAAAAAAAAADCkAQBKpAEAWaQBAAAAAACpoQEAIQAAAPehAQAAAAAAqaEBAGCkAQBtpAEAAAAAAAAAAAAAAAAAIgAAAPmjAQAAAAAAAAAAAAgAAAAEAAAAAAAAAAoAAAAtAAAAEgAAAAAAAAAAAAAAAAAAAAgAAAD/////AAAAAAAAAAAuAAAAAAAAAAAAAAAAAAAAAAAAAAmnAQDGAAAAD6cBAMEAAAAWpwEAwgAAABynAQDAAAAAI6cBAJEDAAAppwEAxQAAAC+nAQDDAAAANqcBAMQAAAA7pwEAkgMAAECnAQDHAAAAR6cBAKcDAABLpwEAISAAAFKnAQCUAwAAWKcBANAAAABcpwEAyQAAAGOnAQDKAAAAaacBAMgAAABwpwEAlQMAAHinAQCXAwAAfKcBAMsAAACBpwEAkwMAAIenAQDNAAAAjqcBAM4AAACUpwEAzAAAAJunAQCZAwAAoKcBAM8AAAClpwEAmgMAAKunAQCbAwAAsqcBAJwDAAC1pwEA0QAAALynAQCdAwAAv6cBAFIBAADFpwEA0wAAAMynAQDUAAAA0qcBANIAAADZpwEAqQMAAN+nAQCfAwAA56cBANgAAADupwEA1QAAAPWnAQDWAAAA+qcBAKYDAAD+pwEAoAMAAAGoAQAzIAAAB6gBAKgDAAALqAEAoQMAAA+oAQBgAQAAFqgBAKMDAAAcqAEA3gAAACKoAQCkAwAAJqgBAJgDAAAsqAEA2gAAADOoAQDbAAAAOagBANkAAABAqAEApQMAAEioAQDcAAAATagBAJ4DAABQqAEA3QAAAFeoAQB4AQAAXKgBAJYDAABhqAEA4QAAAGioAQDiAAAAbqgBALQAAAB0qAEA5gAAAHqoAQDgAAAAgagBADUhAACJqAEAsQMAAI+oAQAmAAAAk6gBACciAACXqAEAICIAAJuoAQDlAAAAoagBAEgiAACnqAEA4wAAAK6oAQDkAAAAs6gBAB4gAAC5qAEAsgMAAL6oAQCmAAAAxagBACIgAADKqAEAKSIAAM6oAQDnAAAA1agBALgAAADbqAEAogAAAOCoAQDHAwAA5KgBAMYCAADpqAEAYyYAAO+oAQBFIgAA9KgBAKkAAAD5qAEAtSEAAP+oAQAqIgAAA6kBAKQAAAAKqQEA0yEAAA+pAQAgIAAAFqkBAJMhAAAbqQEAsAAAAB+pAQC0AwAAJakBAGYmAAArqQEA9wAAADKpAQDpAAAAOakBAOoAAAA/qQEA6AAAAEapAQAFIgAATKkBAAMgAABRqQEAAiAAAFapAQC1AwAAXqkBAGEiAABkqQEAtwMAAGipAQDwAAAAbKkBAOsAAABxqQEArCAAAHapAQADIgAAfKkBAJIBAACBqQEAACIAAIipAQC9AAAAj6kBALwAAACWqQEAvgAAAJ2pAQBEIAAAo6kBALMDAACpqQEAZSIAAKypAQA+AAAAr6kBANQhAAC0qQEAlCEAALmpAQBlJgAAwKkBACYgAADHqQEA7QAAAM6pAQDuAAAA1KkBAKEAAADaqQEA7AAAAOGpAQARIQAA56kBAB4iAADtqQEAKyIAAPGpAQC5AwAA9qkBAL8AAAD9qQEACCIAAAKqAQDvAAAAB6oBALoDAAANqgEA0CEAABKqAQC7AwAAGaoBACkjAAAeqgEAqwAAACSqAQCQIQAAKaoBAAgjAAAvqgEAHCAAADWqAQBkIgAAOKoBAAojAAA/qgEAFyIAAEaqAQDKJQAASqoBAA4gAABOqgEAOSAAAFWqAQAYIAAAW6oBADwAAABeqgEArwAAAGOqAQAUIAAAaaoBALUAAABvqgEAtwAAAEazAQASIgAAdqoBALwDAAB5qgEAByIAAH+qAQCgAAAAhKoBABMgAACKqgEAYCIAAI2qAQALIgAAkKoBAKwAAACUqgEACSIAAJqqAQCEIgAAn6oBAPEAAACmqgEAvQMAAKmqAQDzAAAAsKoBAPQAAAC2qgEAUwEAALyqAQDyAAAAw6oBAD4gAADJqgEAyQMAAM+qAQC/AwAA16oBAJUiAADdqgEAKCIAAOCqAQCqAAAA5aoBALoAAADqqgEA+AAAAPGqAQD1AAAA+KoBAJciAAD/qgEA9gAAAASrAQC2AAAACasBAAIiAAAOqwEAMCAAABWrAQClIgAAGqsBAMYDAAAeqwEAwAMAACGrAQDWAwAAJasBALEAAAAsqwEAowAAADKrAQAyIAAAOKsBAA8iAAA9qwEAHSIAAEKrAQDIAwAARqsBACIAAABLqwEA0iEAAFCrAQAaIgAAVqsBACojAABbqwEAuwAAAGGrAQCSIQAAZqsBAAkjAABsqwEAHSAAAHKrAQAcIQAAd6sBAK4AAAB7qwEACyMAAIKrAQDBAwAAhqsBAA8gAACKqwEAOiAAAJGrAQAZIAAAl6sBABogAACdqwEAYQEAAKSrAQDFIgAAqasBAKcAAACuqwEArQAAALKrAQDDAwAAuKsBAMIDAAC/qwEAPCIAAMOrAQBgJgAAyqsBAIIiAADOqwEAhiIAANOrAQARIgAA16sBAIMiAADbqwEAuQAAAOCrAQCyAAAA5asBALMAAADqqwEAhyIAAO+rAQDfAAAA9asBAMQDAAD5qwEANCIAAACsAQC4AwAABqwBANEDAAAPrAEACSAAABasAQD+AAAAHKwBANwCAAAirAEA1wAAACisAQAiIQAALqwBANEhAAAzrAEA+gAAADqsAQCRIQAAP6wBAPsAAABFrAEA+QAAAEysAQCoAAAAUKwBANIDAABWrAEAxQMAAF6sAQD8AAAAY6wBABghAABqrAEAvgMAAG2sAQD9AAAAdKwBAKUAAAB4rAEA/wAAAH2sAQC2AwAAgqwBAA0gAACGrAEADCAAAAcAAAAIAAAAAQEAAAgAAAAIAAAAAAAAAAAAAAAvAAAAEwAAAAAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAwAAAAFAAAAAAAAAAAAAAAAAAAAAazAQAJAAAACLMBAAoAAAANswEACgAAABWzAQALAAAAG7MBAAsAAAAkswEADAAAACezAQAMAAAALbMBAA0AAAAyswEADQAAADqzAQAOAAAAP7MBAA4AAABGswEADwAAAEyzAQAPAAAAWLMBABAAAABiAAAAMQAAADIAAAAUAAAAMwAAAGMAAAA0AAAAFQAAADUAAAAIAAAABAAAAP////8AAAAAAAAAABUAAAAAAAAAAAAAAAAAAACjtAEAVV3Jf8l//wCutAEAuy3Uvq7U/wC5tAEAFHf9/cCG/wDEtAEAVV3Jf8l//wDPtAEAuy3Uvq7U/wDatAEAFHf9/cCG/wDltAEAKmb///+Z/wDwtAEAVV3Jf8l//wD7tAEAuy3Uvq7U/wAGtQEAFHf9/cCG/wARtQEAKmb///+Z/wActQEAl62wOGyw/wAntQEAVV3Jf8l//wAytQEAuy3Uvq7U/wA9tQEAFHf9/cCG/wBItQEAKmb///+Z/wBTtQEAl62wOGyw/wBetQEA6Pzw8AJ//wBptQEAVV3Jf8l//wB0tQEAuy3Uvq7U/wB/tQEAFHf9/cCG/wCKtQEAKmb///+Z/wCVtQEAl62wOGyw/wCgtQEA6Pzw8AJ//wCrtQEAEeC/v1sX/wC2tQEAVV3Jf8l//wDBtQEAuy3Uvq7U/wDMtQEAFHf9/cCG/wDXtQEAKmb///+Z/wDitQEAl62wOGyw/wDttQEA6Pzw8AJ//wD4tQEAEeC/v1sX/wADtgEAAABmZmZm/wAOtgEAkxn33uv3/wAYtgEAjkvhnsrh/wAitgEAkby9MYK9/wAstgEAnxD/7/P//wA2tgEAjy7nvdfn/wBAtgEAj3/Wa67W/wBKtgEAk9C1IXG1/wBUtgEAnxD/7/P//wBetgEAjy7nvdfn/wBotgEAj3/Wa67W/wBytgEAkby9MYK9/wB8tgEAlfGcCFGc/wCGtgEAnxD/7/P//wCQtgEAlCvvxtvv/wCatgEAjkvhnsrh/wCktgEAj3/Wa67W/wCutgEAkby9MYK9/wC4tgEAlfGcCFGc/wDCtgEAnxD/7/P//wDMtgEAlCvvxtvv/wDWtgEAjkvhnsrh/wDgtgEAj3/Wa67W/wDqtgEAkKnGQpLG/wD0tgEAk9C1IXG1/wD+tgEAl/GUCEWU/wAItwEAlAj/9/v//wAStwEAkxn33uv3/wActwEAlCvvxtvv/wAmtwEAjkvhnsrh/wAwtwEAj3/Wa67W/wA6twEAkKnGQpLG/wBEtwEAk9C1IXG1/wBOtwEAl/GUCEWU/wBYtwEAlAj/9/v//wBitwEAkxn33uv3/wBstwEAlCvvxtvv/wB2twEAjkvhnsrh/wCAtwEAj3/Wa67W/wCKtwEAkKnGQpLG/wCUtwEAk9C1IXG1/wCetwEAlfGcCFGc/wCotwEAmOtrCDBr/wCytwEAF+9UVDAF/wC8twEAd/88ADww/wDHtwEAF+yMjFEK/wDRtwEAGMK/v4Et/wDbtwEAHXDf38J9/wDltwEAHjT29ujD/wDvtwEAeSbqx+rl/wD5twEAeF/NgM3B/wADuAEAfKWXNZeP/wANuAEAfPxmAWZe/wAXuAEAF+9UVDAF/wAhuAEAfPxmAWZe/wAsuAEAd/88ADww/wA3uAEAF+yMjFEK/wBBuAEAGMK/v4Et/wBLuAEAHXDf38J9/wBVuAEAHjT29ujD/wBfuAEAAAD19fX1/wBpuAEAeSbqx+rl/wBzuAEAeF/NgM3B/wB9uAEAfKWXNZeP/wCHuAEAHIfY2LNl/wCQuAEAAAD19fX1/wCZuAEAe3+0WrSs/wCiuAEAFdempmEa/wCruAEAHXDf38J9/wC0uAEAeF/NgM3B/wC9uAEAef2FAYVx/wDGuAEAFdempmEa/wDPuAEAHXDf38J9/wDYuAEAAAD19fX1/wDhuAEAeF/NgM3B/wDquAEAef2FAYVx/wDzuAEAF+yMjFEK/wD8uAEAHIfY2LNl/wAFuQEAHjT29ujD/wAOuQEAeSbqx+rl/wAXuQEAe3+0WrSs/wAguQEAfPxmAWZe/wApuQEAF+yMjFEK/wAyuQEAHIfY2LNl/wA7uQEAHjT29ujD/wBEuQEAAAD19fX1/wBNuQEAeSbqx+rl/wBWuQEAe3+0WrSs/wBfuQEAfPxmAWZe/wBouQEAF+yMjFEK/wBxuQEAGMK/v4Et/wB6uQEAHXDf38J9/wCDuQEAHjT29ujD/wCMuQEAeSbqx+rl/wCVuQEAeF/NgM3B/wCeuQEAfKWXNZeP/wCnuQEAfPxmAWZe/wCwuQEAF+yMjFEK/wC5uQEAGMK/v4Et/wDCuQEAHXDf38J9/wDLuQEAHjT29ujD/wDUuQEAAAD19fX1/wDduQEAeSbqx+rl/wDmuQEAeF/NgM3B/wDvuQEAfKWXNZeP/wD4uQEAfPxmAWZe/wABugEAhxT55fX5/wAKugEAdUrYmdjJ/wATugEAZ7miLKJf/wAcugEAiA777fj7/wAlugEAfzbisuLi/wAuugEAcXjCZsKk/wA3ugEAYr6LI4tF/wBAugEAiA777fj7/wBJugEAfzbisuLi/wBSugEAcXjCZsKk/wBbugEAZ7miLKJf/wBkugEAZv9tAG0s/wBtugEAiA777fj7/wB2ugEAdyLszOzm/wB/ugEAdUrYmdjJ/wCIugEAcXjCZsKk/wCRugEAZ7miLKJf/wCaugEAZv9tAG0s/wCjugEAiA777fj7/wCsugEAdyLszOzm/wC1ugEAdUrYmdjJ/wC+ugEAcXjCZsKk/wDHugEAaZ+uQa52/wDQugEAYr6LI4tF/wDZugEAZv9YAFgk/wDiugEAhgb99/z9/wDrugEAhxT55fX5/wD0ugEAdyLszOzm/wD9ugEAdUrYmdjJ/wAGuwEAcXjCZsKk/wAPuwEAaZ+uQa52/wAYuwEAYr6LI4tF/wAhuwEAZv9YAFgk/wAquwEAhgb99/z9/wAzuwEAhxT55fX5/wA8uwEAdyLszOzm/wBFuwEAdUrYmdjJ/wBOuwEAcXjCZsKk/wBXuwEAaZ+uQa52/wBguwEAYr6LI4tF/wBpuwEAZv9tAG0s/wByuwEAZf9EAEQb/wB7uwEAkBT04Oz0/wCEuwEAlEbanrza/wCNuwEAxHuniFan/wCWuwEAiA777fj7/wCfuwEAkjXjs83j/wCouwEAokrGjJbG/wCxuwEAypWdiEGd/wC6uwEAiA777fj7/wDDuwEAkjXjs83j/wDMuwEAokrGjJbG/wDVuwEAxHuniFan/wDeuwEA1uGBgQ98/wDnuwEAiA777fj7/wDwuwEAlCvmv9Pm/wD5uwEAlEbanrza/wACvAEAokrGjJbG/wALvAEAxHuniFan/wAUvAEA1uGBgQ98/wAdvAEAiA777fj7/wAmvAEAlCvmv9Pm/wAvvAEAlEbanrza/wA4vAEAokrGjJbG/wBBvAEAvmSxjGux/wBKvAEAypWdiEGd/wBTvAEA1fxubgFr/wBcvAEAhgb99/z9/wBlvAEAkBT04Oz0/wBuvAEAlCvmv9Pm/wB3vAEAlEbanrza/wCAvAEAokrGjJbG/wCJvAEAvmSxjGux/wCSvAEAypWdiEGd/wCbvAEA1fxubgFr/wCkvAEAhgb99/z9/wCtvAEAkBT04Oz0/wC2vAEAlCvmv9Pm/wC/vAEAlEbanrza/wDIvAEAokrGjJbG/wDRvAEAvmSxjGux/wDavAEAypWdiEGd/wDjvAEA1uGBgQ98/wDsvAEA1f9NTQBL/wD1vAEActOeG553/wD/vAEAEvzZ2V8C/wAJvQEArV+zdXCz/wATvQEActOeG553/wAdvQEAEvzZ2V8C/wAnvQEArV+zdXCz/wAxvQEA6dHn5ymK/wA7vQEActOeG553/wBFvQEAEvzZ2V8C/wBPvQEArV+zdXCz/wBZvQEA6dHn5ymK/wBjvQEAPtCmZqYe/wBtvQEActOeG553/wB3vQEAEvzZ2V8C/wCBvQEArV+zdXCz/wCLvQEA6dHn5ymK/wCVvQEAPtCmZqYe/wCfvQEAH/zm5qsC/wCpvQEActOeG553/wCzvQEAEvzZ2V8C/wC9vQEArV+zdXCz/wDHvQEA6dHn5ymK/wDRvQEAPtCmZqYe/wDbvQEAH/zm5qsC/wDlvQEAG9KmpnYd/wDvvQEActOeG553/wD5vQEAEvzZ2V8C/wADvgEArV+zdXCz/wANvgEA6dHn5ymK/wAXvgEAPtCmZqYe/wAhvgEAH/zm5qsC/wArvgEAG9KmpnYd/wA1vgEAAABmZmZm/wA/vgEATBnz4PPb/wBIvgEAXz3dqN21/wBRvgEAjKrKQ6LK/wBavgEAQRH58Pno/wBjvgEAVy7kuuS8/wBsvgEAe2XMe8zE/wB1vgEAjcW+K4y+/wB+vgEAQRH58Pno/wCHvgEAVy7kuuS8/wCQvgEAe2XMe8zE/wCZvgEAjKrKQ6LK/wCivgEAkfOsCGis/wCrvgEAQRH58Pno/wC0vgEATSnrzOvF/wC9vgEAXz3dqN21/wDGvgEAe2XMe8zE/wDPvgEAjKrKQ6LK/wDYvgEAkfOsCGis/wDhvgEAQRH58Pno/wDqvgEATSnrzOvF/wDzvgEAXz3dqN21/wD8vgEAe2XMe8zE/wAFvwEAiaDTTrPT/wAOvwEAjcW+K4y+/wAXvwEAk/KeCFie/wAgvwEAPAz89/zw/wApvwEATBnz4PPb/wAyvwEATSnrzOvF/wA7vwEAXz3dqN21/wBEvwEAe2XMe8zE/wBNvwEAiaDTTrPT/wBWvwEAjcW+K4y+/wBfvwEAk/KeCFie/wBovwEAPAz89/zw/wBxvwEATBnz4PPb/wB6vwEATSnrzOvF/wCDvwEAXz3dqN21/wCMvwEAe2XMe8zE/wCVvwEAiaDTTrPT/wCevwEAjcW+K4y+/wCnvwEAkfOsCGis/wCwvwEAlu+BCECB/wC5vwEAShX15fXg/wDEvwEAUEjZodmb/wDPvwEAYrKjMaNU/wDavwEASQ/47fjp/wDlvwEATjbkuuSz/wDwvwEAVmjEdMR2/wD7vwEAYr6LI4tF/wAGwAEASQ/47fjp/wARwAEATjbkuuSz/wAcwAEAVmjEdMR2/wAnwAEAYrKjMaNU/wAywAEAZv9tAG0s/wA9wAEASQ/47fjp/wBIwAEATSzpx+nA/wBTwAEAUEjZodmb/wBewAEAVmjEdMR2/wBpwAEAYrKjMaNU/wB0wAEAZv9tAG0s/wB/wAEASQ/47fjp/wCKwAEATSzpx+nA/wCVwAEAUEjZodmb/wCgwAEAVmjEdMR2/wCrwAEAYJ6rQatd/wC2wAEAYr6LI4tF/wDBwAEAbP9aAFoy/wDMwAEASAf89/z1/wDXwAEAShX15fXg/wDiwAEATSzpx+nA/wDtwAEAUEjZodmb/wD4wAEAVmjEdMR2/wADwQEAYJ6rQatd/wAOwQEAYr6LI4tF/wAZwQEAbP9aAFoy/wAkwQEASAf89/z1/wAvwQEAShX15fXg/wA6wQEATSzpx+nA/wBFwQEAUEjZodmb/wBQwQEAVmjEdMR2/wBbwQEAYJ6rQatd/wBmwQEAYr6LI4tF/wBxwQEAZv9tAG0s/wB8wQEAZf9EAEQb/wCHwQEAAADw8PDw/wCRwQEAAAC9vb29/wCbwQEAAABjY2Nj/wClwQEAAAD39/f3/wCvwQEAAADMzMzM/wC5wQEAAACWlpaW/wDDwQEAAABSUlJS/wDNwQEAAAD39/f3/wDXwQEAAADMzMzM/wDhwQEAAACWlpaW/wDrwQEAAABjY2Nj/wD1wQEAAAAlJSUl/wD/wQEAAAD39/f3/wAJwgEAAADZ2dnZ/wATwgEAAAC9vb29/wAdwgEAAACWlpaW/wAnwgEAAABjY2Nj/wAxwgEAAAAlJSUl/wA7wgEAAAD39/f3/wBFwgEAAADZ2dnZ/wBPwgEAAAC9vb29/wBZwgEAAACWlpaW/wBjwgEAAABzc3Nz/wBtwgEAAABSUlJS/wB3wgEAAAAlJSUl/wCBwgEAAAD//////wCLwgEAAADw8PDw/wCVwgEAAADZ2dnZ/wCfwgEAAAC9vb29/wCpwgEAAACWlpaW/wCzwgEAAABzc3Nz/wC9wgEAAABSUlJS/wDHwgEAAAAlJSUl/wDRwgEAAAD//////wDbwgEAAADw8PDw/wDlwgEAAADZ2dnZ/wDvwgEAAAC9vb29/wD5wgEAAACWlpaW/wADwwEAAABzc3Nz/wANwwEAAABSUlJS/wAXwwEAAAAlJSUl/wAhwwEAAAAAAAAA/wArwwEAFTD+/ubO/wA3wwEAE5P9/a5r/wBDwwEADvDm5lUN/wBPwwEAEyD+/u3e/wBbwwEAFHj9/b6F/wBnwwEAEcL9/Y08/wBzwwEADf3Z2UcB/wB/wwEAEyD+/u3e/wCLwwEAFHj9/b6F/wCXwwEAEcL9/Y08/wCjwwEADvDm5lUN/wCvwwEADfqmpjYD/wC7wwEAEyD+/u3e/wDHwwEAFVv9/dCi/wDTwwEAE5P9/a5r/wDfwwEAEcL9/Y08/wDrwwEADvDm5lUN/wD3wwEADfqmpjYD/wADxAEAEyD+/u3e/wAPxAEAFVv9/dCi/wAbxAEAE5P9/a5r/wAnxAEAEcL9/Y08/wAzxAEAEOrx8WkT/wA/xAEADf3Z2UgB/wBLxAEADPeMjC0E/wBXxAEAFRT///Xr/wBjxAEAFTD+/ubO/wBvxAEAFVv9/dCi/wB7xAEAE5P9/a5r/wCHxAEAEcL9/Y08/wCTxAEAEOrx8WkT/wCfxAEADf3Z2UgB/wCrxAEADPeMjC0E/wC3xAEAFRT///Xr/wDDxAEAFTD+/ubO/wDPxAEAFVv9/dCi/wDbxAEAE5P9/a5r/wDnxAEAEcL9/Y08/wDzxAEAEOrx8WkT/wD/xAEADf3Z2UgB/wALxQEADfqmpjYD/wAXxQEADPZ/fycE/wAjxQEAGTb+/ujI/wAsxQEAE3n9/buE/wA1xQEABcXj40oz/wA+xQEAGiX+/vDZ/wBHxQEAGHP9/cyK/wBQxQEADaT8/I1Z/wBZxQEAA9rX1zAf/wBixQEAGiX+/vDZ/wBrxQEAGHP9/cyK/wB0xQEADaT8/I1Z/wB9xQEABcXj40oz/wCGxQEAAP+zswAA/wCPxQEAGiX+/vDZ/wCYxQEAGF/9/dSe/wChxQEAE3n9/buE/wCqxQEADaT8/I1Z/wCzxQEABcXj40oz/wC8xQEAAP+zswAA/wDFxQEAGiX+/vDZ/wDOxQEAGF/9/dSe/wDXxQEAE3n9/buE/wDgxQEADaT8/I1Z/wDpxQEAB7Lv72VI/wDyxQEAA9rX1zAf/wD7xQEAAP+ZmQAA/wAExgEAGBL///fs/wANxgEAGTb+/ujI/wAWxgEAGF/9/dSe/wAfxgEAE3n9/buE/wAoxgEADaT8/I1Z/wAxxgEAB7Lv72VI/wA6xgEAA9rX1zAf/wBDxgEAAP+ZmQAA/wBMxgEAGBL///fs/wBVxgEAGTb+/ujI/wBexgEAGF/9/dSe/wBnxgEAE3n9/buE/wBwxgEADaT8/I1Z/wB5xgEAB7Lv72VI/wCCxgEAA9rX1zAf/wCLxgEAAP+zswAA/wCUxgEAAP9/fwAA/wCdxgEAjkTjps7j/wCpxgEAvpmaaj2a/wC2xgEAkNO0H3i0/wDCxgEAQWHfst+K/wDOxgEAUrigM6As/wDaxgEAAGP7+5qZ/wDmxgEA/uHj4xoc/wDyxgEAF4/9/b9v/wD+xgEAFf///38A/wAKxwEAxirWyrLW/wAWxwEAjkTjps7j/wAixwEAvpmaaj2a/wAvxwEAKmb///+Z/wA8xwEAkNO0H3i0/wBIxwEAQWHfst+K/wBUxwEAUrigM6As/wBgxwEAAGP7+5qZ/wBsxwEA/uHj4xoc/wB4xwEAF4/9/b9v/wCExwEAFf///38A/wCQxwEAxirWyrLW/wCcxwEAjkTjps7j/wCoxwEAvpmaaj2a/wC1xwEAKmb///+Z/wDCxwEAD8WxsVko/wDPxwEAkNO0H3i0/wDbxwEAQWHfst+K/wDnxwEAUrigM6As/wDzxwEAAGP7+5qZ/wD/xwEA/uHj4xoc/wALyAEAF4/9/b9v/wAXyAEAFf///38A/wAjyAEAxirWyrLW/wAvyAEAjkTjps7j/wA6yAEAkNO0H3i0/wBFyAEAQWHfst+K/wBQyAEAjkTjps7j/wBbyAEAkNO0H3i0/wBmyAEAQWHfst+K/wBxyAEAUrigM6As/wB8yAEAjkTjps7j/wCHyAEAkNO0H3i0/wCSyAEAQWHfst+K/wCdyAEAUrigM6As/wCoyAEAAGP7+5qZ/wCzyAEAjkTjps7j/wC+yAEAkNO0H3i0/wDJyAEAQWHfst+K/wDUyAEAUrigM6As/wDfyAEAAGP7+5qZ/wDqyAEA/uHj4xoc/wD1yAEAjkTjps7j/wAAyQEAkNO0H3i0/wALyQEAQWHfst+K/wAWyQEAUrigM6As/wAhyQEAAGP7+5qZ/wAsyQEA/uHj4xoc/wA3yQEAF4/9/b9v/wBCyQEAjkTjps7j/wBNyQEAkNO0H3i0/wBYyQEAQWHfst+K/wBjyQEAUrigM6As/wBuyQEAAGP7+5qZ/wB5yQEA/uHj4xoc/wCEyQEAF4/9/b9v/wCPyQEAFf///38A/wCayQEAjkTjps7j/wClyQEAkNO0H3i0/wCwyQEAQWHfst+K/wC7yQEAUrigM6As/wDGyQEAAGP7+5qZ/wDRyQEA/uHj4xoc/wDcyQEAF4/9/b9v/wDnyQEAFf///38A/wDyyQEAxirWyrLW/wD9yQEAA077+7Su/wAJygEAkjXjs83j/wAVygEATSnrzOvF/wAhygEAA077+7Su/wAtygEAkjXjs83j/wA5ygEATSnrzOvF/wBFygEAyhvk3svk/wBRygEAA077+7Su/wBdygEAkjXjs83j/wBpygEATSnrzOvF/wB1ygEAyhvk3svk/wCBygEAGFj+/tmm/wCNygEAA077+7Su/wCZygEAkjXjs83j/wClygEATSnrzOvF/wCxygEAyhvk3svk/wC9ygEAGFj+/tmm/wDJygEAKjL////M/wDVygEAA077+7Su/wDhygEAkjXjs83j/wDtygEATSnrzOvF/wD5ygEAyhvk3svk/wAFywEAGFj+/tmm/wARywEAKjL////M/wAdywEAHCzl5di9/wApywEAA077+7Su/wA1ywEAkjXjs83j/wBBywEATSnrzOvF/wBNywEAyhvk3svk/wBZywEAGFj+/tmm/wBlywEAKjL////M/wBxywEAHCzl5di9/wB9ywEA6SP9/drs/wCJywEAA077+7Su/wCVywEAkjXjs83j/wChywEATSnrzOvF/wCtywEAyhvk3svk/wC5ywEAGFj+/tmm/wDFywEAKjL////M/wDRywEAHCzl5di9/wDdywEA6SP9/drs/wDpywEAAADy8vLy/wD1ywEAbDXis+LN/wABzAEAEVH9/c2s/wANzAEAmx/oy9Xo/wAZzAEAbDXis+LN/wAlzAEAEVH9/c2s/wAxzAEAmx/oy9Xo/wA9zAEA5Cv09Mrk/wBJzAEAbDXis+LN/wBVzAEAEVH9/c2s/wBhzAEAmx/oy9Xo/wBtzAEA5Cv09Mrk/wB5zAEAOC315vXJ/wCFzAEAbDXis+LN/wCRzAEAEVH9/c2s/wCdzAEAmx/oy9Xo/wCpzAEA5Cv09Mrk/wC1zAEAOC315vXJ/wDBzAEAI1H///Ku/wDNzAEAbDXis+LN/wDZzAEAEVH9/c2s/wDlzAEAmx/oy9Xo/wDxzAEA5Cv09Mrk/wD9zAEAOC315vXJ/wAJzQEAI1H///Ku/wAVzQEAGSfx8eLM/wAhzQEAbDXis+LN/wAtzQEAEVH9/c2s/wA5zQEAmx/oy9Xo/wBFzQEA5Cv09Mrk/wBRzQEAOC315vXJ/wBdzQEAI1H///Ku/wBpzQEAGSfx8eLM/wB1zQEAAADMzMzM/wCBzQEA5v2OjgFS/wCLzQEATb9kJ2QZ/wCWzQEA5tzFxRt9/wCgzQEA6Hbe3neu/wCqzQEA5T7x8bba/wC0zQEA6R39/eDv/wC+zQEAOyb15vXQ/wDIzQEAPWfhuOGG/wDSzQEAP6a8f7xB/wDczQEARMWSTZIh/wDmzQEA5v2OjgFS/wDwzQEARMWSTZIh/wD7zQEATb9kJ2QZ/wAGzgEA5tzFxRt9/wAQzgEA6Hbe3neu/wAazgEA5T7x8bba/wAkzgEA6R39/eDv/wAuzgEAAAD39/f3/wA4zgEAOyb15vXQ/wBCzgEAPWfhuOGG/wBMzgEAP6a8f7xB/wBWzgEA50zp6aPJ/wBfzgEAAAD39/f3/wBozgEAP4HXoddq/wBxzgEA5NzQ0ByL/wB6zgEA5T7x8bba/wCDzgEAPWfhuOGG/wCMzgEASMasTawm/wCVzgEA5NzQ0ByL/wCezgEA5T7x8bba/wCnzgEAAAD39/f3/wCwzgEAPWfhuOGG/wC5zgEASMasTawm/wDCzgEA5tzFxRt9/wDLzgEA50zp6aPJ/wDUzgEA6R39/eDv/wDdzgEAOyb15vXQ/wDmzgEAP4HXoddq/wDvzgEARMWSTZIh/wD4zgEA5tzFxRt9/wABzwEA50zp6aPJ/wAKzwEA6R39/eDv/wATzwEAAAD39/f3/wAczwEAOyb15vXQ/wAlzwEAP4HXoddq/wAuzwEARMWSTZIh/wA3zwEA5tzFxRt9/wBAzwEA6Hbe3neu/wBJzwEA5T7x8bba/wBSzwEA6R39/eDv/wBbzwEAOyb15vXQ/wBkzwEAPWfhuOGG/wBtzwEAP6a8f7xB/wB2zwEARMWSTZIh/wB/zwEA5tzFxRt9/wCIzwEA6Hbe3neu/wCRzwEA5T7x8bba/wCazwEA6R39/eDv/wCjzwEAAAD39/f3/wCszwEAOyb15vXQ/wC1zwEAPWfhuOGG/wC+zwEAP6a8f7xB/wDHzwEARMWSTZIh/wDQzwEAzv9LQABL/wDazwEAZf9EAEQb/wDlzwEAzq2DdiqD/wDvzwEAx1ermXCr/wD5zwEAxzPPwqXP/wAD0AEA0hXo59To/wAN0AEATB7w2fDT/wAX0AEAUETbptug/wAh0AEAWHuuWq5h/wAr0AEAYcV4G3g3/wA10AEAzv9LQABL/wA/0AEAYcV4G3g3/wBK0AEAZf9EAEQb/wBV0AEAzq2DdiqD/wBf0AEAx1ermXCr/wBp0AEAxzPPwqXP/wBz0AEA0hXo59To/wB90AEAAAD39/f3/wCH0AEATB7w2fDT/wCR0AEAUETbptug/wCb0AEAWHuuWq5h/wCl0AEAxEbDr43D/wCu0AEAAAD39/f3/wC30AEAUlq/f797/wDA0AEAyaiUezKU/wDJ0AEAxzPPwqXP/wDS0AEAUETbptug/wDb0AEAZv+IAIg3/wDk0AEAyaiUezKU/wDt0AEAxzPPwqXP/wD20AEAAAD39/f3/wD/0AEAUETbptug/wAI0QEAZv+IAIg3/wAR0QEAzq2DdiqD/wAa0QEAxEbDr43D/wAj0QEA0hXo59To/wAs0QEATB7w2fDT/wA10QEAUlq/f797/wA+0QEAYcV4G3g3/wBH0QEAzq2DdiqD/wBQ0QEAxEbDr43D/wBZ0QEA0hXo59To/wBi0QEAAAD39/f3/wBr0QEATB7w2fDT/wB00QEAUlq/f797/wB90QEAYcV4G3g3/wCG0QEAzq2DdiqD/wCP0QEAx1ermXCr/wCY0QEAxzPPwqXP/wCh0QEA0hXo59To/wCq0QEATB7w2fDT/wCz0QEAUETbptug/wC80QEAWHuuWq5h/wDF0QEAYcV4G3g3/wDO0QEAzq2DdiqD/wDX0QEAx1ermXCr/wDg0QEAxzPPwqXP/wDp0QEA0hXo59To/wDy0QEAAAD39/f3/wD70QEATB7w2fDT/wAE0gEAUETbptug/wAN0gEAWHuuWq5h/wAW0gEAYcV4G3g3/wAf0gEAvQvy7Ofy/wAo0gEAlz3bpr3b/wAx0gEAjcW+K4y+/wA60gEAuQj28e72/wBD0gEAmyjhvcnh/wBM0gEAkXDPdKnP/wBV0gEAj/ewBXCw/wBe0gEAuQj28e72/wBn0gEAmyjhvcnh/wBw0gEAkXDPdKnP/wB50gEAjcW+K4y+/wCC0gEAj/eNBFqN/wCL0gEAuQj28e72/wCU0gEAqBjm0NHm/wCd0gEAlz3bpr3b/wCm0gEAkXDPdKnP/wCv0gEAjcW+K4y+/wC40gEAj/eNBFqN/wDB0gEAuQj28e72/wDK0gEAqBjm0NHm/wDT0gEAlz3bpr3b/wDc0gEAkXDPdKnP/wDl0gEAjrfANpDA/wDu0gEAj/ewBXCw/wD30gEAj/h7A057/wAA0wEA6Qj///f7/wAJ0wEAvQvy7Ofy/wAS0wEAqBjm0NHm/wAb0wEAlz3bpr3b/wAk0wEAkXDPdKnP/wAt0wEAjrfANpDA/wA20wEAj/ewBXCw/wA/0wEAj/h7A057/wBI0wEA6Qj///f7/wBR0wEAvQvy7Ofy/wBa0wEAqBjm0NHm/wBj0wEAlz3bpr3b/wBs0wEAkXDPdKnP/wB10wEAjrfANpDA/wB+0wEAj/ewBXCw/wCH0wEAj/eNBFqN/wCQ0wEAj/lYAjhY/wCZ0wEAyA7w7OLw/wCk0wEAlz3bpr3b/wCv0wEAgtCZHJCZ/wC60wEAzwj39u/3/wDF0wEAmyjhvcnh/wDQ0wEAj4DPZ6nP/wDb0wEAgvuKAoGK/wDm0wEAzwj39u/3/wDx0wEAmyjhvcnh/wD80wEAj4DPZ6nP/wAH1AEAgtCZHJCZ/wAS1AEAd/xsAWxZ/wAd1AEAzwj39u/3/wAo1AEAqBjm0NHm/wAz1AEAlz3bpr3b/wA+1AEAj4DPZ6nP/wBJ1AEAgtCZHJCZ/wBU1AEAd/xsAWxZ/wBf1AEAzwj39u/3/wBq1AEAqBjm0NHm/wB11AEAlz3bpr3b/wCA1AEAj4DPZ6nP/wCL1AEAjrfANpDA/wCW1AEAgvuKAoGK/wCh1AEAdvxkAWRQ/wCs1AEA6Qj///f7/wC31AEAyA7w7OLw/wDC1AEAqBjm0NHm/wDN1AEAlz3bpr3b/wDY1AEAj4DPZ6nP/wDj1AEAjrfANpDA/wDu1AEAgvuKAoGK/wD51AEAdvxkAWRQ/wAE1QEA6Qj///f7/wAP1QEAyA7w7OLw/wAa1QEAqBjm0NHm/wAl1QEAlz3bpr3b/wAw1QEAj4DPZ6nP/wA71QEAjrfANpDA/wBG1QEAgvuKAoGK/wBR1QEAd/xsAWxZ/wBc1QEAdftGAUY2/wBn1QEAEu5/fzsI/wBx1QEAw/9LLQBL/wB81QEAFPazs1gG/wCG1QEAFujg4IIU/wCQ1QEAF5v9/bhj/wCa1QEAGEj+/uC2/wCk1QEApRTr2Nrr/wCu1QEAsS/SsqvS/wC41QEAs1SsgHOs/wDC1QEAvbWIVCeI/wDM1QEAEu5/fzsI/wDW1QEAvbWIVCeI/wDh1QEAw/9LLQBL/wDs1QEAFPazs1gG/wD21QEAFujg4IIU/wAA1gEAF5v9/bhj/wAK1gEAGEj+/uC2/wAU1gEAAAD39/f3/wAe1gEApRTr2Nrr/wAo1gEAsS/SsqvS/wAy1gEAs1SsgHOs/wA81gEAF7vx8aNA/wBF1gEAAAD39/f3/wBO1gEAskXDmY7D/wBX1gEAEf3m5mEB/wBg1gEAF5v9/bhj/wBp1gEAsS/SsqvS/wBy1gEAuZuZXjyZ/wB71gEAEf3m5mEB/wCE1gEAF5v9/bhj/wCN1gEAAAD39/f3/wCW1gEAsS/SsqvS/wCf1gEAuZuZXjyZ/wCo1gEAFPazs1gG/wCx1gEAF7vx8aNA/wC61gEAGEj+/uC2/wDD1gEApRTr2Nrr/wDM1gEAskXDmY7D/wDV1gEAvbWIVCeI/wDe1gEAFPazs1gG/wDn1gEAF7vx8aNA/wDw1gEAGEj+/uC2/wD51gEAAAD39/f3/wAC1wEApRTr2Nrr/wAL1wEAskXDmY7D/wAU1wEAvbWIVCeI/wAd1wEAFPazs1gG/wAm1wEAFujg4IIU/wAv1wEAF5v9/bhj/wA41wEAGEj+/uC2/wBB1wEApRTr2Nrr/wBK1wEAsS/SsqvS/wBT1wEAs1SsgHOs/wBc1wEAvbWIVCeI/wBl1wEAFPazs1gG/wBu1wEAFujg4IIU/wB31wEAF5v9/bhj/wCA1wEAGEj+/uC2/wCJ1wEAAAD39/f3/wCS1wEApRTr2Nrr/wCb1wEAsS/SsqvS/wCk1wEAs1SsgHOs/wCt1wEAvbWIVCeI/wC21wEAvA7v5+Hv/wC/1wEA1kPJyZTH/wDI1wEA6t7d3Rx3/wDR1wEAuQj28e72/wDa1wEA0ynY17XY/wDj1wEA5Ivf32Ww/wDs1wEA7+jOzhJW/wD11wEAuQj28e72/wD+1wEA0ynY17XY/wAH2AEA5Ivf32Ww/wAQ2AEA6t7d3Rx3/wAZ2AEA7P+YmABD/wAi2AEAuQj28e72/wAr2AEAzCba1Lna/wA02AEA1kPJyZTH/wA92AEA5Ivf32Ww/wBG2AEA6t7d3Rx3/wBP2AEA7P+YmABD/wBY2AEAuQj28e72/wBh2AEAzCba1Lna/wBq2AEA1kPJyZTH/wBz2AEA5Ivf32Ww/wB82AEA6dHn5ymK/wCF2AEA7+jOzhJW/wCO2AEA7P+RkQA//wCX2AEAwwX59/T5/wCg2AEAvA7v5+Hv/wCp2AEAzCba1Lna/wCy2AEA1kPJyZTH/wC72AEA5Ivf32Ww/wDE2AEA6dHn5ymK/wDN2AEA7+jOzhJW/wDW2AEA7P+RkQA//wDf2AEAwwX59/T5/wDo2AEAvA7v5+Hv/wDx2AEAzCba1Lna/wD62AEA1kPJyZTH/wAD2QEA5Ivf32Ww/wAM2QEA6dHn5ymK/wAV2QEA7+jOzhJW/wAe2QEA7P+YmABD/wAn2QEA8v9nZwAf/wAw2QEAtAj17+31/wA82QEAqCXcvL3c/wBI2QEAsGSxdWux/wBU2QEAtgf38vD3/wBg2QEArRziy8ni/wBs2QEArTrInprI/wB42QEAtoCjalGj/wCE2QEAtgf38vD3/wCQ2QEArRziy8ni/wCc2QEArTrInprI/wCo2QEAsGSxdWux/wC02QEAvLmPVCeP/wDA2QEAtgf38vD3/wDM2QEAqhLr2trr/wDY2QEAqCXcvL3c/wDk2QEArTrInprI/wDw2QEAsGSxdWux/wD82QEAvLmPVCeP/wAI2gEAtgf38vD3/wAU2gEAqhLr2trr/wAg2gEAqCXcvL3c/wAs2gEArTrInprI/wA42gEArFO6gH26/wBE2gEAtoCjalGj/wBQ2gEAvtiGShSG/wBc2gEAvwL9/Pv9/wBo2gEAtAj17+31/wB02gEAqhLr2trr/wCA2gEAqCXcvL3c/wCM2gEArTrInprI/wCY2gEArFO6gH26/wCk2gEAtoCjalGj/wCw2gEAvtiGShSG/wC82gEAvwL9/Pv9/wDI2gEAtAj17+31/wDU2gEAqhLr2trr/wDg2gEAqCXcvL3c/wDs2gEArTrInprI/wD42gEArFO6gH26/wAE2wEAtoCjalGj/wAQ2wEAvLmPVCeP/wAc2wEAv/99PwB9/wAo2wEA8v9nZwAf/wAy2wEAlvFhBTBh/wA92wEA+dyyshgr/wBH2wEABaPW1mBN/wBR2wEADXf09KWC/wBb2wEADzb9/dvH/wBl2wEAjiDw0eXw/wBv2wEAjVfeksXe/wB52wEAj6fDQ5PD/wCD2wEAlM6sIWas/wCN2wEA8v9nZwAf/wCX2wEAlM6sIWas/wCi2wEAlvFhBTBh/wCt2wEA+dyyshgr/wC32wEABaPW1mBN/wDB2wEADXf09KWC/wDL2wEADzb9/dvH/wDV2wEAAAD39/f3/wDf2wEAjiDw0eXw/wDp2wEAjVfeksXe/wDz2wEAj6fDQ5PD/wD92wEADJbv74pi/wAG3AEAAAD39/f3/wAP3AEAj4DPZ6nP/wAY3AEA+P/KygAg/wAh3AEADXf09KWC/wAq3AEAjVfeksXe/wAz3AEAj/ewBXGw/wA83AEA+P/KygAg/wBF3AEADXf09KWC/wBO3AEAAAD39/f3/wBX3AEAjVfeksXe/wBg3AEAj/ewBXGw/wBp3AEA+dyyshgr/wBy3AEADJbv74pi/wB73AEADzb9/dvH/wCE3AEAjiDw0eXw/wCN3AEAj4DPZ6nP/wCW3AEAlM6sIWas/wCf3AEA+dyyshgr/wCo3AEADJbv74pi/wCx3AEADzb9/dvH/wC63AEAAAD39/f3/wDD3AEAjiDw0eXw/wDM3AEAj4DPZ6nP/wDV3AEAlM6sIWas/wDe3AEA+dyyshgr/wDn3AEABaPW1mBN/wDw3AEADXf09KWC/wD53AEADzb9/dvH/wAC3QEAjiDw0eXw/wAL3QEAjVfeksXe/wAU3QEAj6fDQ5PD/wAd3QEAlM6sIWas/wAm3QEA+dyyshgr/wAv3QEABaPW1mBN/wA43QEADXf09KWC/wBB3QEADzb9/dvH/wBK3QEAAAD39/f3/wBT3QEAjiDw0eXw/wBc3QEAjVfeksXe/wBl3QEAj6fDQ5PD/wBu3QEAlM6sIWas/wB33QEA8v9nZwAf/wCB3QEAAAAaGhoa/wCM3QEA+dyyshgr/wCW3QEABaPW1mBN/wCg3QEADXf09KWC/wCq3QEADzb9/dvH/wC03QEAAADg4ODg/wC+3QEAAAC6urq6/wDI3QEAAACHh4eH/wDS3QEAAABNTU1N/wDc3QEA8v9nZwAf/wDm3QEAAABNTU1N/wDx3QEAAAAaGhoa/wD83QEA+dyyshgr/wAG3gEABaPW1mBN/wAQ3gEADXf09KWC/wAa3gEADzb9/dvH/wAk3gEAAAD//////wAu3gEAAADg4ODg/wA43gEAAAC6urq6/wBC3gEAAACHh4eH/wBM3gEADJbv74pi/wBV3gEAAAD//////wBe3gEAAACZmZmZ/wBn3gEA+P/KygAg/wBw3gEADXf09KWC/wB53gEAAAC6urq6/wCC3gEAAABAQEBA/wCL3gEA+P/KygAg/wCU3gEADXf09KWC/wCd3gEAAAD//////wCm3gEAAAC6urq6/wCv3gEAAABAQEBA/wC43gEA+dyyshgr/wDB3gEADJbv74pi/wDK3gEADzb9/dvH/wDT3gEAAADg4ODg/wDc3gEAAACZmZmZ/wDl3gEAAABNTU1N/wDu3gEA+dyyshgr/wD33gEADJbv74pi/wAA3wEADzb9/dvH/wAJ3wEAAAD//////wAS3wEAAADg4ODg/wAb3wEAAACZmZmZ/wAk3wEAAABNTU1N/wAt3wEA+dyyshgr/wA23wEABaPW1mBN/wA/3wEADXf09KWC/wBI3wEADzb9/dvH/wBR3wEAAADg4ODg/wBa3wEAAAC6urq6/wBj3wEAAACHh4eH/wBs3wEAAABNTU1N/wB13wEA+dyyshgr/wB+3wEABaPW1mBN/wCH3wEADXf09KWC/wCQ3wEADzb9/dvH/wCZ3wEAAAD//////wCi3wEAAADg4ODg/wCr3wEAAAC6urq6/wC03wEAAACHh4eH/wC93wEAAABNTU1N/wDG3wEAAyD9/eDd/wDP3wEA9Fz6+p+1/wDY3wEA49zFxRuK/wDh3wEADRz+/uvi/wDq3wEA/Ej7+7S5/wDz3wEA7pP392ih/wD83wEA4P2urgF+/wAF4AEADRz+/uvi/wAO4AEA/Ej7+7S5/wAX4AEA7pP392ih/wAg4AEA49zFxRuK/wAp4AEA1fx6egF3/wAy4AEADRz+/uvi/wA74AEAAzz8/MXA/wBE4AEA9Fz6+p+1/wBN4AEA7pP392ih/wBW4AEA49zFxRuK/wBf4AEA1fx6egF3/wBo4AEADRz+/uvi/wBx4AEAAzz8/MXA/wB64AEA9Fz6+p+1/wCD4AEA7pP392ih/wCM4AEA5sPd3TSX/wCV4AEA4P2urgF+/wCe4AEA1fx6egF3/wCn4AEADgz///fz/wCw4AEAAyD9/eDd/wC54AEAAzz8/MXA/wDC4AEA9Fz6+p+1/wDL4AEA7pP392ih/wDU4AEA5sPd3TSX/wDd4AEA4P2urgF+/wDm4AEA1fx6egF3/wDv4AEADgz///fz/wD44AEAAyD9/eDd/wAB4QEAAzz8/MXA/wAK4QEA9Fz6+p+1/wAT4QEA7pP392ih/wAc4QEA5sPd3TSX/wAl4QEA4P2urgF+/wAu4QEA1fx6egF3/wA34QEAx/9qSQBq/wBA4QEA9f+lpQAm/wBM4QEAp6uVMTaV/wBZ4QEAAtDX1zAn/wBl4QEACrj09G1D/wBx4QEAFJ39/a5h/wB94QEAHm7+/uCQ/wCJ4QEAiBj44PP4/wCV4QEAikPpq9np/wCh4QEAj3HRdK3R/wCt4QEAl520RXW0/wC54QEA9f+lpQAm/wDF4QEAl520RXW0/wDS4QEAp6uVMTaV/wDf4QEAAtDX1zAn/wDr4QEACrj09G1D/wD34QEAFJ39/a5h/wAD4gEAHm7+/uCQ/wAP4gEAKkD///+//wAb4gEAiBj44PP4/wAn4gEAikPpq9np/wAz4gEAj3HRdK3R/wA/4gEADaT8/I1Z/wBK4gEAKkD///+//wBV4gEAj1bbkb/b/wBg4gEA/uHX1xkc/wBr4gEAFJ39/a5h/wB24gEAikPpq9np/wCB4gEAkcG2LHu2/wCM4gEA/uHX1xkc/wCX4gEAFJ39/a5h/wCi4gEAKkD///+//wCt4gEAikPpq9np/wC44gEAkcG2LHu2/wDD4gEAAtDX1zAn/wDO4gEADaT8/I1Z/wDZ4gEAHm7+/uCQ/wDk4gEAiBj44PP4/wDv4gEAj1bbkb/b/wD64gEAl520RXW0/wAF4wEAAtDX1zAn/wAQ4wEADaT8/I1Z/wAb4wEAHm7+/uCQ/wAm4wEAKkD///+//wAx4wEAiBj44PP4/wA84wEAj1bbkb/b/wBH4wEAl520RXW0/wBS4wEAAtDX1zAn/wBd4wEACrj09G1D/wBo4wEAFJ39/a5h/wBz4wEAHm7+/uCQ/wB+4wEAiBj44PP4/wCJ4wEAikPpq9np/wCU4wEAj3HRdK3R/wCf4wEAl520RXW0/wCq4wEAAtDX1zAn/wC14wEACrj09G1D/wDA4wEAFJ39/a5h/wDL4wEAHm7+/uCQ/wDW4wEAKkD///+//wDh4wEAiBj44PP4/wDs4wEAikPpq9np/wD34wEAj3HRdK3R/wAC5AEAl520RXW0/wAN5AEA9f+lpQAm/wAZ5AEAa/9oAGg3/wAm5AEAAtDX1zAn/wAy5AEACrj09G1D/wA+5AEAFJ39/a5h/wBK5AEAH3P+/uCL/wBW5AEAM2rv2e+L/wBi5AEAPoLZptlq/wBu5AEAU3m9Zr1j/wB65AEAZ9OYGphQ/wCG5AEA9f+lpQAm/wCS5AEAZ9OYGphQ/wCf5AEAa/9oAGg3/wCs5AEAAtDX1zAn/wC45AEACrj09G1D/wDE5AEAFJ39/a5h/wDQ5AEAH3P+/uCL/wDc5AEAKkD///+//wDo5AEAM2rv2e+L/wD05AEAPoLZptlq/wAA5QEAU3m9Zr1j/wAM5QEADaT8/I1Z/wAX5QEAKkD///+//wAi5QEAQojPkc9g/wAt5QEA/uHX1xkc/wA45QEAFJ39/a5h/wBD5QEAPoLZptlq/wBO5QEAYtKWGpZB/wBZ5QEA/uHX1xkc/wBk5QEAFJ39/a5h/wBv5QEAKkD///+//wB65QEAPoLZptlq/wCF5QEAYtKWGpZB/wCQ5QEAAtDX1zAn/wCb5QEADaT8/I1Z/wCm5QEAH3P+/uCL/wCx5QEAM2rv2e+L/wC85QEAQojPkc9g/wDH5QEAZ9OYGphQ/wDS5QEAAtDX1zAn/wDd5QEADaT8/I1Z/wDo5QEAH3P+/uCL/wDz5QEAKkD///+//wD+5QEAM2rv2e+L/wAJ5gEAQojPkc9g/wAU5gEAZ9OYGphQ/wAf5gEAAtDX1zAn/wAq5gEACrj09G1D/wA15gEAFJ39/a5h/wBA5gEAH3P+/uCL/wBL5gEAM2rv2e+L/wBW5gEAPoLZptlq/wBh5gEAU3m9Zr1j/wBs5gEAZ9OYGphQ/wB35gEAAtDX1zAn/wCC5gEACrj09G1D/wCN5gEAFJ39/a5h/wCY5gEAH3P+/uCL/wCj5gEAKkD///+//wCu5gEAM2rv2e+L/wC55gEAPoLZptlq/wDE5gEAU3m9Zr1j/wDP5gEAZ9OYGphQ/wDa5gEADSz+/uDS/wDj5gEACYv8/JJy/wDs5gEAAdPe3i0m/wD15gEADSX+/uXZ/wD+5gEAC2z8/K6R/wAH5wEAB7P7+2pK/wAQ5wEA/eDLyxgd/wAZ5wEADSX+/uXZ/wAi5wEAC2z8/K6R/wAr5wEAB7P7+2pK/wA05wEAAdPe3i0m/wA95wEA/eelpQ8V/wBG5wEADSX+/uXZ/wBP5wEADFz8/Luh/wBY5wEACYv8/JJy/wBh5wEAB7P7+2pK/wBq5wEAAdPe3i0m/wBz5wEA/eelpQ8V/wB85wEADSX+/uXZ/wCF5wEADFz8/Luh/wCO5wEACYv8/JJy/wCX5wEAB7P7+2pK/wCg5wEAA9Dv7zss/wCp5wEA/eDLyxgd/wCy5wEA+/+ZmQAN/wC75wEADg////Xw/wDE5wEADSz+/uDS/wDN5wEADFz8/Luh/wDW5wEACYv8/JJy/wDf5wEAB7P7+2pK/wDo5wEAA9Dv7zss/wDx5wEA/eDLyxgd/wD65wEA+/+ZmQAN/wAD6AEADg////Xw/wAM6AEADSz+/uDS/wAV6AEADFz8/Luh/wAe6AEACYv8/JJy/wAn6AEAB7P7+2pK/wAw6AEAA9Dv7zss/wA56AEA/eDLyxgd/wBC6AEA/eelpQ8V/wBL6AEA+f9nZwAN/wBU6AEA/uHk5Boc/wBd6AEAkrK4N364/wBm6AEAU5OvTa9K/wBv6AEA/uHk5Boc/wB46AEAkrK4N364/wCB6AEAU5OvTa9K/wCK6AEAz4SjmE6j/wCT6AEA/uHk5Boc/wCc6AEAkrK4N364/wCl6AEAU5OvTa9K/wCu6AEAz4SjmE6j/wC36AEAFf///38A/wDA6AEA/uHk5Boc/wDJ6AEAkrK4N364/wDS6AEAU5OvTa9K/wDb6AEAz4SjmE6j/wDk6AEAFf///38A/wDt6AEAKsz///8z/wD26AEA/uHk5Boc/wD/6AEAkrK4N364/wAI6QEAU5OvTa9K/wAR6QEAz4SjmE6j/wAa6QEAFf///38A/wAj6QEAKsz///8z/wAs6QEAD8GmplYo/wA16QEA/uHk5Boc/wA+6QEAkrK4N364/wBH6QEAU5OvTa9K/wBQ6QEAz4SjmE6j/wBZ6QEAFf///38A/wBi6QEAKsz///8z/wBr6QEAD8GmplYo/wB06QEA6Hn394G//wB96QEA/uHk5Boc/wCG6QEAkrK4N364/wCP6QEAU5OvTa9K/wCY6QEAz4SjmE6j/wCh6QEAFf///38A/wCq6QEAKsz///8z/wCz6QEAD8GmplYo/wC86QEA6Hn394G//wDF6QEAAACZmZmZ/wDO6QEAcnjCZsKl/wDX6QEAC5v8/I1i/wDg6QEAnE3LjaDL/wDp6QEAcnjCZsKl/wDy6QEAC5v8/I1i/wD76QEAnE3LjaDL/wAE6gEA5Gbn54rD/wAN6gEAcnjCZsKl/wAW6gEAC5v8/I1i/wAf6gEAnE3LjaDL/wAo6gEA5Gbn54rD/wAx6gEAOpvYpthU/wA66gEAcnjCZsKl/wBD6gEAC5v8/I1i/wBM6gEAnE3LjaDL/wBV6gEA5Gbn54rD/wBe6gEAOpvYpthU/wBn6gEAItD//9kv/wBw6gEAcnjCZsKl/wB56gEAC5v8/I1i/wCC6gEAnE3LjaDL/wCL6gEA5Gbn54rD/wCU6gEAOpvYpthU/wCd6gEAItD//9kv/wCm6gEAGVrl5cSU/wCv6gEAcnjCZsKl/wC46gEAC5v8/I1i/wDB6gEAnE3LjaDL/wDK6gEA5Gbn54rD/wDT6gEAOpvYpthU/wDc6gEAItD//9kv/wDl6gEAGVrl5cSU/wDu6gEAAACzs7Oz/wD36gEAeFTTjdPH/wAB6wEA01K9vIC9/wAM6wEAKkz///+z/wAW6wEAryXavrra/wAg6wEABIv7+4By/wAq6wEAkGTTgLHT/wA06wEAFpz9/bRi/wA+6wEAOobes95p/wBI6wEA6S/8/M3l/wBS6wEAAADZ2dnZ/wBc6wEAeFTTjdPH/wBm6wEA01K9vIC9/wBx6wEATSnrzOvF/wB86wEAKkz///+z/wCG6wEAryXavrra/wCQ6wEABIv7+4By/wCa6wEAkGTTgLHT/wCk6wEAFpz9/bRi/wCu6wEAOobes95p/wC46wEA6S/8/M3l/wDC6wEAAADZ2dnZ/wDM6wEAeFTTjdPH/wDW6wEA01K9vIC9/wDh6wEATSnrzOvF/wDs6wEAJZD//+1v/wD36wEAKkz///+z/wAB7AEAryXavrra/wAL7AEABIv7+4By/wAV7AEAkGTTgLHT/wAf7AEAFpz9/bRi/wAp7AEAOobes95p/wAz7AEA6S/8/M3l/wA97AEAAADZ2dnZ/wBH7AEAeFTTjdPH/wBQ7AEAKkz///+z/wBZ7AEAryXavrra/wBi7AEAeFTTjdPH/wBr7AEAKkz///+z/wB07AEAryXavrra/wB97AEABIv7+4By/wCG7AEAeFTTjdPH/wCP7AEAKkz///+z/wCY7AEAryXavrra/wCh7AEABIv7+4By/wCq7AEAkGTTgLHT/wCz7AEAeFTTjdPH/wC87AEAKkz///+z/wDF7AEAryXavrra/wDO7AEABIv7+4By/wDX7AEAkGTTgLHT/wDg7AEAFpz9/bRi/wDp7AEAeFTTjdPH/wDy7AEAKkz///+z/wD77AEAryXavrra/wAE7QEABIv7+4By/wAN7QEAkGTTgLHT/wAW7QEAFpz9/bRi/wAf7QEAOobes95p/wAo7QEAeFTTjdPH/wAx7QEAKkz///+z/wA67QEAryXavrra/wBD7QEABIv7+4By/wBM7QEAkGTTgLHT/wBV7QEAFpz9/bRi/wBe7QEAOobes95p/wBn7QEA6S/8/M3l/wBw7QEAeFTTjdPH/wB57QEAKkz///+z/wCC7QEAryXavrra/wCL7QEABIv7+4By/wCU7QEAkGTTgLHT/wCd7QEAFpz9/bRi/wCm7QEAOobes95p/wCv7QEA6S/8/M3l/wC47QEAAADZ2dnZ/wDB7QEA7f2engFC/wDP7QEAsYKiXk+i/wDe7QEA+rTV1T5P/wDs7QEACrj09G1D/wD67QEAFJ39/a5h/wAI7gEAH3P+/uCL/wAW7gEAMWD15vWY/wAk7gEAT0Hdq92k/wAy7gEAcnjCZsKl/wBA7gEAj7u9Moi9/wBO7gEA7f2engFC/wBc7gEAj7u9Moi9/wBr7gEAsYKiXk+i/wB67gEA+rTV1T5P/wCI7gEACrj09G1D/wCW7gEAFJ39/a5h/wCk7gEAH3P+/uCL/wCy7gEAKkD///+//wDA7gEAMWD15vWY/wDO7gEAT0Hdq92k/wDc7gEAcnjCZsKl/wDq7gEADaT8/I1Z/wD37gEAKkD///+//wAE7wEAUU3VmdWU/wAR7wEA/uHX1xkc/wAe7wEAFJ39/a5h/wAr7wEAT0Hdq92k/wA47wEAj8S6K4O6/wBF7wEA/uHX1xkc/wBS7wEAFJ39/a5h/wBf7wEAKkD///+//wBs7wEAT0Hdq92k/wB57wEAj8S6K4O6/wCG7wEA+rTV1T5P/wCT7wEADaT8/I1Z/wCg7wEAH3P+/uCL/wCt7wEAMWD15vWY/wC67wEAUU3VmdWU/wDH7wEAj7u9Moi9/wDU7wEA+rTV1T5P/wDh7wEADaT8/I1Z/wDu7wEAH3P+/uCL/wD77wEAKkD///+//wAI8AEAMWD15vWY/wAV8AEAUU3VmdWU/wAi8AEAj7u9Moi9/wAv8AEA+rTV1T5P/wA88AEACrj09G1D/wBJ8AEAFJ39/a5h/wBW8AEAH3P+/uCL/wBj8AEAMWD15vWY/wBw8AEAT0Hdq92k/wB98AEAcnjCZsKl/wCK8AEAj7u9Moi9/wCX8AEA+rTV1T5P/wCk8AEACrj09G1D/wCx8AEAFJ39/a5h/wC+8AEAH3P+/uCL/wDL8AEAKkD///+//wDY8AEAMWD15vWY/wDl8AEAT0Hdq92k/wDy8AEAcnjCZsKl/wD/8AEAj7u9Moi9/wAM8QEAkw//8Pj//wAb8QEAGCP6+uvX/wAt8QEAf///AP///wA38QEAcYD/f//U/wBH8QEAfw//8P///wBS8QEAKhr19fXc/wBd8QEAFzr//+TE/wBp8QEAAAAAAAAA/wB08QEAGTH//+vN/wCI8QEAqv//AAD//wCS8QEAwM7iiivi/wCi8QEAAL6lpSoq/wCt8QEAF2Pe3riH/wC88QEAgGegX56g/wDL8QEAP///f/8A/wDb8QEAEdrS0mke/wDq8QEAC6///39Q/wD18QEAmpPtZJXt/wAJ8gEAISL///jc/wAX8gEA9ufc3BQ8/wAk8gEAf///AP///wAu8gEAqv+LAACL/wA88gEAf/+LAIuL/wBK8gEAHu+4uIYL/wBd8gEAAACpqamp/wBr8gEAVf9kAGQA/wB68gEAAACpqamp/wCI8gEAJ269vbdr/wCX8gEA1P+LiwCL/wCo8gEAOo5rVWsv/wC88gEAF////4wA/wDM8gEAxsDMmTLM/wDc8gEAAP+LiwAA/wDp8gEACnnp6ZZ6/wD58gEAVT28j7yP/wAL8wEAr4+LSD2L/wAe8wEAf2dPL09P/wAx8wEAf2dPL09P/wBE8wEAgP/RAM7R/wBX8wEAx//TlADT/wBn8wEA6Ov//xST/wB18wEAiv//AL///wCG8wEAAABpaWlp/wCT8wEAAABpaWlp/wCg8wEAlOH/HpD//wCw8wEAAM6ysiIi/wC/8wEAHA////rw/wDQ8wEAVcCLIosi/wDh8wEA1P///wD//wDu8wEAAADc3Nzc/wD98wEAqgf/+Pj//wAN9AEAI////9cA/wAX9AEAHtna2qUg/wAm9AEAAACAgICA/wAw9AEAVf+AAIAA/wA79AEAO9D/rf8v/wBM9AEAAACAgICA/wBW9AEAVQ//8P/w/wBk9AEA6Zb//2m0/wBx9AEAAIzNzVxc/wCA9AEAwv+CSwCC/wCM9AEAKg/////w/wCX9AEAJmrw8OaM/wCi9AEAqhT65ub6/wCw9AEA8A////D1/wDD9AEAQP/8fPwA/wDS9AEAJjH///rN/wDk9AEAiT/mrdjm/wDz9AEAAHfw8ICA/wAD9QEAfx//4P///wAS9QEAKij6+vrS/wAs9QEAAADT09PT/wA79QEAVWTukO6Q/wBL9QEAAADT09PT/wBa9QEA+En//7bB/wBp9QEADIT//6B6/wB69QEAfdGyILKq/wCN9QEAj3X6h876/wCf9QEAlDiZd4iZ/wCz9QEAlDiZd4iZ/wDH9QEAlzTesMTe/wDb9QEAKh/////g/wDs9QEAVf//AP8A/wD29QEAVcDNMs0y/wAF9gEAFRT6+vDm/wAQ9gEA1P///wD//wAd9gEAAP+AgAAA/wAp9gEAcYDNZs2q/wA/9gEAqv/NAADN/wBP9gEAzJjTulXT/wBh9gEAt3zbk3Db/wBz9gEAZ6mzPLNx/wCH9gEAsI/ue2ju/wCc9gEAb//6APqa/wCz9gEAfafRSNHM/wDI9gEA5OTHxxWF/wDd9gEAqsZwGRlw/wDv9gEAagn/9f/6/wD+9gEABB7//+Th/wAN9wEAGkn//+S1/wAb9wEAGVH//96t/wAs9wEAqv+AAACA/wA29wEAGxf9/fXm/wBD9wEAKv+AgIAA/wBO9wEAOMCOa44j/wBd9wEAG////6UA/wBp9wEAC////0UA/wB49wEA1nva2nDW/wCE9wEAJkju7uiq/wCX9wEAVWT7mPuY/wCm9wEAf0Pur+7u/wC59wEA8Xzb23CT/wDM9wEAGin//+/V/wDc9wEAFEb//9q5/wDr9wEAFLDNzYU//wD19wEA9z///8DL/wD/9wEA1Ebd3aDd/wAJ+AEAhDvmsODm/wAZ+AEA1P+AgACA/wAl+AEAAP///wAA/wAu+AEAAD28vI+P/wA9+AEAn7XhQWnh/wBM+AEAEdyLi0UT/wBd+AEABIr6+oBy/wBp+AEAE5r09KRg/wB5+AEAZ6qLLotX/wCH+AEAERD///Xu/wCV+AEADbegoFIt/wCh+AEAAADAwMDA/wCt+AEAi2zrh87r/wC6+AEAr4/NalrN/wDJ+AEAlDiQcICQ/wDY+AEAlDiQcICQ/wDn+AEAAAX///r6/wDx+AEAav//AP9//wAC+QEAkpu0RoK0/wAR+QEAGFTS0rSM/wAa+QEAf/+AAICA/wAk+QEA1B3Y2L/Y/wAx+QEABrj//2NH/wA9+QEAe7bgQODQ/wBM+QEA1HPu7oLu/wBY+QEAG0T19d6z/wBj+QEAAAD//////wBu+QEAAAD19fX1/wB++QEAKv////8A/wCK+QEAOMDNms0y/wCb+QEALUP89/y5/wCk+QEARFvdrd2O/wCt+QEAYrKjMaNU/wC2+QEAKjL////M/wC/+QEAPlXmwuaZ/wDI+QEAVWTGeMZ5/wDR+QEAY7uEI4RD/wDa+QEAKjL////M/wDj+QEAPlXmwuaZ/wDs+QEAVWTGeMZ5/wD1+QEAYrKjMaNU/wD++QEAa/9oAGg3/wAH+gEAKjL////M/wAQ+gEAN1Hw2fCj/wAZ+gEARFvdrd2O/wAi+gEAVWTGeMZ5/wAr+gEAYrKjMaNU/wA0+gEAa/9oAGg3/wA9+gEAKjL////M/wBG+gEAN1Hw2fCj/wBP+gEARFvdrd2O/wBY+gEAVWTGeMZ5/wBh+gEAYJ6rQatd/wBq+gEAY7uEI4RD/wBz+gEAbP9aAFoy/wB8+gEAKhn////l/wCF+gEALUP89/y5/wCO+gEAN1Hw2fCj/wCX+gEARFvdrd2O/wCg+gEAVWTGeMZ5/wCp+gEAYJ6rQatd/wCy+gEAY7uEI4RD/wC7+gEAbP9aAFoy/wDE+gEAKhn////l/wDN+gEALUP89/y5/wDW+gEAN1Hw2fCj/wDf+gEARFvdrd2O/wDo+gEAVWTGeMZ5/wDx+gEAYJ6rQatd/wD6+gEAY7uEI4RD/wAD+wEAa/9oAGg3/wAM+wEAbv9FAEUp/wAV+wEAMUn47fix/wAg+wEAdWHNf827/wAr+wEAkMK4LH+4/wA2+wEAKjL////M/wBB+wEAY0Laodq0/wBM+wEAhKrEQbbE/wBX+wEAlsuoIl6o/wBi+wEAKjL////M/wBt+wEAY0Laodq0/wB4+wEAhKrEQbbE/wCD+wEAkMK4LH+4/wCO+wEApL+UJTSU/wCZ+wEAKjL////M/wCk+wEARTrpx+m0/wCv+wEAdWHNf827/wC6+wEAhKrEQbbE/wDF+wEAkMK4LH+4/wDQ+wEApL+UJTSU/wDb+wEAKjL////M/wDm+wEARTrpx+m0/wDx+wEAdWHNf827/wD8+wEAhKrEQbbE/wAH/AEAi9jAHZHA/wAS/AEAlsuoIl6o/wAd/AEAnueEDCyE/wAo/AEAKib////Z/wAz/AEAMUn47fix/wA+/AEARTrpx+m0/wBJ/AEAdWHNf827/wBU/AEAhKrEQbbE/wBf/AEAi9jAHZHA/wBq/AEAlsuoIl6o/wB1/AEAnueEDCyE/wCA/AEAKib////Z/wCL/AEAMUn47fix/wCW/AEARTrpx+m0/wCh/AEAdWHNf827/wCs/AEAhKrEQbbE/wC3/AEAi9jAHZHA/wDC/AEAlsuoIl6o/wDN/AEApL+UJTSU/wDY/AEAnudYCB1Y/wDj/AEAJUL///e8/wDu/AEAHK/+/sRP/wD5/AEAEO7Z2V8O/wAE/QEAKir////U/wAP/QEAHHD+/tmO/wAa/QEAFtX+/pkp/wAl/QEAD/zMzEwC/wAw/QEAKir////U/wA7/QEAHHD+/tmO/wBG/QEAFtX+/pkp/wBR/QEAEO7Z2V8O/wBc/QEADfiZmTQE/wBn/QEAKir////U/wBy/QEAH23+/uOR/wB9/QEAHK/+/sRP/wCI/QEAFtX+/pkp/wCT/QEAEO7Z2V8O/wCe/QEADfiZmTQE/wCp/QEAKir////U/wC0/QEAH23+/uOR/wC//QEAHK/+/sRP/wDK/QEAFtX+/pkp/wDV/QEAEuns7HAU/wDg/QEAD/zMzEwC/wDr/QEADPeMjC0E/wD2/QEAKhn////l/wAB/gEAJUL///e8/wAM/gEAH23+/uOR/wAX/gEAHK/+/sRP/wAi/gEAFtX+/pkp/wAt/gEAEuns7HAU/wA4/gEAD/zMzEwC/wBD/gEADPeMjC0E/wBO/gEAKhn////l/wBZ/gEAJUL///e8/wBk/gEAH23+/uOR/wBv/gEAHK/+/sRP/wB6/gEAFtX+/pkp/wCF/gEAEuns7HAU/wCQ/gEAD/zMzEwC/wCb/gEADfiZmTQE/wCm/gEADfBmZiUG/wCx/gEAIl///+2g/wC8/gEAGLL+/rJM/wDH/gEABd3w8Dsg/wDS/gEAKk3///+y/wDd/gEAHaL+/sxc/wDo/gEAEcL9/Y08/wDz/gEA/uHj4xoc/wD+/gEAKk3///+y/wAJ/wEAHaL+/sxc/wAU/wEAEcL9/Y08/wAf/wEABd3w8Dsg/wAq/wEA9v+9vQAm/wA1/wEAKk3///+y/wBA/wEAHoj+/tl2/wBL/wEAGLL+/rJM/wBW/wEAEcL9/Y08/wBh/wEABd3w8Dsg/wBs/wEA9v+9vQAm/wB3/wEAKk3///+y/wCC/wEAHoj+/tl2/wCN/wEAGLL+/rJM/wCY/wEAEcL9/Y08/wCj/wEAB9T8/E4q/wCu/wEA/uHj4xoc/wC5/wEA9f+xsQAm/wDE/wEAKjL////M/wDP/wEAIl///+2g/wDa/wEAHoj+/tl2/wDl/wEAGLL+/rJM/wDw/wEAEcL9/Y08/wD7/wEAB9T8/E4q/wAGAAIA/uHj4xoc/wARAAIA9f+xsQAm/wAcAAIAKjL////M/wAnAAIAIl///+2g/wAyAAIAHoj+/tl2/wA9AAIAGLL+/rJM/wBIAAIAEcL9/Y08/wBTAAIAB9T8/E4q/wBeAAIA/uHj4xoc/wBpAAIA9v+9vQAm/wB0AAIA8v+AgAAm/wB/AAIAkw//8Pj//wCJAAIAGCP6+uvX/wCWAAIAFyT//+/b/wCkAAIAFyTu7t/M/wCyAAIAFyTNzcCw/wDAAAIAGCKLi4N4/wDOAAIAcYD/f//U/wDZAAIAcYD/f//U/wDlAAIAcYDudu7G/wDxAAIAcYDNZs2q/wD9AAIAcYCLRYt0/wAJAQIAfw//8P///wAPAQIAfw//8P///wAWAQIAfw/u4O7u/wAdAQIAfw7Nwc3N/wAkAQIAfw6Lg4uL/wArAQIAKhr19fXc/wAxAQIAFzr//+TE/wA4AQIAFzr//+TE/wBAAQIAFzru7tW3/wBIAQIAFjrNzbee/wBQAQIAFzqLi31r/wBiGAIAAAAAAAAA/wBYAQIAGTH//+vN/wBnAQIAqv//AAD//wBsAQIAqv//AAD//wByAQIAqv/uAADu/wB4AQIAqv/NAADN/wB+AQIAqv+LAACL/wCEAQIAwM7iiivi/wCPAQIAAL6lpSoq/wCVAQIAAL///0BA/wCcAQIAAL/u7js7/wCjAQIAAL/NzTMz/wCqAQIAAL6LiyMj/wCxAQIAF2Pe3riH/wC7AQIAF2T//9Ob/wDGAQIAF2Pu7sWR/wDRAQIAF2PNzap9/wDcAQIAF2OLi3NV/wDnAQIAgGegX56g/wDxAQIAg2f/mPX//wD8AQIAg2bujuXu/wAHAgIAg2fNesXN/wASAgIAg2aLU4aL/wAdAgIAP///f/8A/wAoAgIAP///f/8A/wA0AgIAP//udu4A/wBAAgIAP//NZs0A/wBMAgIAP/+LRYsA/wBYAgIAEdrS0mke/wBiAgIAEdv//38k/wBtAgIAEdvu7nYh/wB4AgIAEdrNzWYd/wCDAgIAEdyLi0UT/wCOAgIAC6///39Q/wCUAgIAB6n//3JW/wCbAgIABqnu7mpQ/wCiAgIABqnNzVtF/wCpAgIABqiLiz4v/wCwAgIAmpPtZJXt/wC/AgIAISL///jc/wDIAgIAISL///jc/wDSAgIAIiPu7ujN/wDcAgIAIiLNzcix/wDmAgIAIyKLi4h4/wDwAgIA9ufc3BQ8/wD4AgIAf///AP///wD9AgIAf///AP///wADAwIAf//uAO7u/wAJAwIAf//NAM3N/wAPAwIAf/+LAIuL/wAVAwIAHu+4uIYL/wAjAwIAHvD//7kP/wAyAwIAHvDu7q0O/wBBAwIAHvDNzZUM/wBQAwIAHvCLi2UI/wBfAwIAVf9kAGQA/wBpAwIAJ269vbdr/wBzAwIAOo5rVWsv/wCCAwIAOo//yv9w/wCSAwIAOo/uvO5o/wCiAwIAOo/Nos1a/wCyAwIAOo+Lbos9/wDCAwIAF////4wA/wDNAwIAFf///38A/wDZAwIAFf/u7nYA/wDlAwIAFf/NzWYA/wDxAwIAFf+Li0UA/wD9AwIAxsDMmTLM/wAIBAIAxsH/vz7//wAUBAIAxsDusjru/wAgBAIAxsDNmjLN/wAsBAIAxsCLaCKL/wA4BAIACnnp6ZZ6/wBDBAIAVT28j7yP/wBQBAIAVT7/wf/B/wBeBAIAVT7utO60/wBsBAIAVT7Nm82b/wB6BAIAVT6LaYtp/wCIBAIAr4+LSD2L/wCWBAIAf2dPL09P/wCkBAIAf2j/l////wCzBAIAf2fuje7u/wDCBAIAf2jNec3N/wDRBAIAf2iLUouL/wDgBAIAf2dPL09P/wDuBAIAgP/RAM7R/wD8BAIAx//TlADT/wAHBQIA6Ov//xST/wAQBQIA6Ov//xST/wAaBQIA6Ovu7hKJ/wAkBQIA6OvNzRB2/wAuBQIA5+yLiwpQ/wA4BQIAiv//AL///wBEBQIAiv//AL///wBRBQIAiv/uALLu/wBeBQIAiv/NAJrN/wBrBQIAiv+LAGiL/wB4BQIAAABpaWlp/wCABQIAAABpaWlp/wCIBQIAlOH/HpD//wCTBQIAlOH/HpD//wCfBQIAlOHuHIbu/wCrBQIAlOHNGHTN/wC3BQIAlOGLEE6L/wDDBQIAAM6ysiIi/wDNBQIAAM///zAw/wDYBQIAAM/u7iws/wDjBQIAAM/NzSYm/wDuBQIAAM+Lixoa/wD5BQIAHA////rw/wAFBgIAVcCLIosi/wARBgIAAADc3Nzc/wAbBgIAqgf/+Pj//wAmBgIAI////9cA/wArBgIAI////9cA/wAxBgIAI//u7skA/wA3BgIAI//Nza0A/wA9BgIAI/+Li3UA/wBDBgIAHtna2qUg/wBNBgIAHtr//8El/wBYBgIAHtru7rQi/wBjBgIAHtrNzZsd/wBuBgIAHtqLi2kU/wB5BgIAAADAwMDA/wB+BgIAAAAAAAAA/wCEBgIAAAADAwMD/wCKBgIAAAAaGhoa/wCRBgIAAAD//////wCZBgIAAAAcHBwc/wCgBgIAAAAfHx8f/wCnBgIAAAAhISEh/wCuBgIAAAAkJCQk/wC1BgIAAAAmJiYm/wC8BgIAAAApKSkp/wDDBgIAAAArKysr/wDKBgIAAAAuLi4u/wDRBgIAAAAwMDAw/wDYBgIAAAAFBQUF/wDeBgIAAAAzMzMz/wDlBgIAAAA2NjY2/wDsBgIAAAA4ODg4/wDzBgIAAAA7Ozs7/wD6BgIAAAA9PT09/wABBwIAAABAQEBA/wAIBwIAAABCQkJC/wAPBwIAAABFRUVF/wAWBwIAAABHR0dH/wAdBwIAAABKSkpK/wAkBwIAAAAICAgI/wAqBwIAAABNTU1N/wAxBwIAAABPT09P/wA4BwIAAABSUlJS/wA/BwIAAABUVFRU/wBGBwIAAABXV1dX/wBNBwIAAABZWVlZ/wBUBwIAAABcXFxc/wBbBwIAAABeXl5e/wBiBwIAAABhYWFh/wBpBwIAAABjY2Nj/wBwBwIAAAAKCgoK/wB2BwIAAABmZmZm/wB9BwIAAABpaWlp/wCEBwIAAABra2tr/wCLBwIAAABubm5u/wCSBwIAAABwcHBw/wCZBwIAAABzc3Nz/wCgBwIAAAB1dXV1/wCnBwIAAAB4eHh4/wCuBwIAAAB6enp6/wC1BwIAAAB9fX19/wC8BwIAAAANDQ0N/wDCBwIAAAB/f39//wDJBwIAAACCgoKC/wDQBwIAAACFhYWF/wDXBwIAAACHh4eH/wDeBwIAAACKioqK/wDlBwIAAACMjIyM/wDsBwIAAACPj4+P/wDzBwIAAACRkZGR/wD6BwIAAACUlJSU/wABCAIAAACWlpaW/wAICAIAAAAPDw8P/wAOCAIAAACZmZmZ/wAVCAIAAACcnJyc/wAcCAIAAACenp6e/wAjCAIAAAChoaGh/wAqCAIAAACjo6Oj/wAxCAIAAACmpqam/wA4CAIAAACoqKio/wA/CAIAAACrq6ur/wBGCAIAAACtra2t/wBNCAIAAACwsLCw/wBUCAIAAAASEhIS/wBaCAIAAACzs7Oz/wBhCAIAAAC1tbW1/wBoCAIAAAC4uLi4/wBvCAIAAAC6urq6/wB2CAIAAAC9vb29/wB9CAIAAAC/v7+//wCECAIAAADCwsLC/wCLCAIAAADExMTE/wCSCAIAAADHx8fH/wCZCAIAAADJycnJ/wCgCAIAAAAUFBQU/wCmCAIAAADMzMzM/wCtCAIAAADPz8/P/wC0CAIAAADR0dHR/wC7CAIAAADU1NTU/wDCCAIAAADW1tbW/wDJCAIAAADZ2dnZ/wDQCAIAAADb29vb/wDXCAIAAADe3t7e/wDeCAIAAADg4ODg/wDlCAIAAADj4+Pj/wDsCAIAAAAXFxcX/wDyCAIAAADl5eXl/wD5CAIAAADo6Ojo/wAACQIAAADr6+vr/wAHCQIAAADt7e3t/wAOCQIAAADw8PDw/wAVCQIAAADy8vLy/wAcCQIAAAD19fX1/wAjCQIAAAD39/f3/wAqCQIAAAD6+vr6/wAxCQIAAAD8/Pz8/wA4CQIAVf//AP8A/wA+CQIAVf//AP8A/wBFCQIAVf/uAO4A/wBMCQIAVf/NAM0A/wBTCQIAVf+LAIsA/wBaCQIAO9D/rf8v/wBmCQIAAADAwMDA/wBrCQIAAAAAAAAA/wBxCQIAAAADAwMD/wB3CQIAAAAaGhoa/wB+CQIAAAD//////wCGCQIAAAAcHBwc/wCNCQIAAAAfHx8f/wCUCQIAAAAhISEh/wCbCQIAAAAkJCQk/wCiCQIAAAAmJiYm/wCpCQIAAAApKSkp/wCwCQIAAAArKysr/wC3CQIAAAAuLi4u/wC+CQIAAAAwMDAw/wDFCQIAAAAFBQUF/wDLCQIAAAAzMzMz/wDSCQIAAAA2NjY2/wDZCQIAAAA4ODg4/wDgCQIAAAA7Ozs7/wDnCQIAAAA9PT09/wDuCQIAAABAQEBA/wD1CQIAAABCQkJC/wD8CQIAAABFRUVF/wADCgIAAABHR0dH/wAKCgIAAABKSkpK/wARCgIAAAAICAgI/wAXCgIAAABNTU1N/wAeCgIAAABPT09P/wAlCgIAAABSUlJS/wAsCgIAAABUVFRU/wAzCgIAAABXV1dX/wA6CgIAAABZWVlZ/wBBCgIAAABcXFxc/wBICgIAAABeXl5e/wBPCgIAAABhYWFh/wBWCgIAAABjY2Nj/wBdCgIAAAAKCgoK/wBjCgIAAABmZmZm/wBqCgIAAABpaWlp/wBxCgIAAABra2tr/wB4CgIAAABubm5u/wB/CgIAAABwcHBw/wCGCgIAAABzc3Nz/wCNCgIAAAB1dXV1/wCUCgIAAAB4eHh4/wCbCgIAAAB6enp6/wCiCgIAAAB9fX19/wCpCgIAAAANDQ0N/wCvCgIAAAB/f39//wC2CgIAAACCgoKC/wC9CgIAAACFhYWF/wDECgIAAACHh4eH/wDLCgIAAACKioqK/wDSCgIAAACMjIyM/wDZCgIAAACPj4+P/wDgCgIAAACRkZGR/wDnCgIAAACUlJSU/wDuCgIAAACWlpaW/wD1CgIAAAAPDw8P/wD7CgIAAACZmZmZ/wACCwIAAACcnJyc/wAJCwIAAACenp6e/wAQCwIAAAChoaGh/wAXCwIAAACjo6Oj/wAeCwIAAACmpqam/wAlCwIAAACoqKio/wAsCwIAAACrq6ur/wAzCwIAAACtra2t/wA6CwIAAACwsLCw/wBBCwIAAAASEhIS/wBHCwIAAACzs7Oz/wBOCwIAAAC1tbW1/wBVCwIAAAC4uLi4/wBcCwIAAAC6urq6/wBjCwIAAAC9vb29/wBqCwIAAAC/v7+//wBxCwIAAADCwsLC/wB4CwIAAADExMTE/wB/CwIAAADHx8fH/wCGCwIAAADJycnJ/wCNCwIAAAAUFBQU/wCTCwIAAADMzMzM/wCaCwIAAADPz8/P/wChCwIAAADR0dHR/wCoCwIAAADU1NTU/wCvCwIAAADW1tbW/wC2CwIAAADZ2dnZ/wC9CwIAAADb29vb/wDECwIAAADe3t7e/wDLCwIAAADg4ODg/wDSCwIAAADj4+Pj/wDZCwIAAAAXFxcX/wDfCwIAAADl5eXl/wDmCwIAAADo6Ojo/wDtCwIAAADr6+vr/wD0CwIAAADt7e3t/wD7CwIAAADw8PDw/wACDAIAAADy8vLy/wAJDAIAAAD19fX1/wAQDAIAAAD39/f3/wAXDAIAAAD6+vr6/wAeDAIAAAD8/Pz8/wAlDAIAVQ//8P/w/wAuDAIAVQ//8P/w/wA4DAIAVQ/u4O7g/wBCDAIAVQ7Nwc3B/wBMDAIAVQ6Lg4uD/wBWDAIA6Zb//2m0/wBeDAIA6pH//260/wBnDAIA643u7mqn/wBwDAIA7IfNzWCQ/wB5DAIA6pSLizpi/wCCDAIAAIzNzVxc/wCMDAIAAJT//2pq/wCXDAIAAJTu7mNj/wCiDAIAAJXNzVVV/wCtDAIAAJSLizo6/wC4DAIAwv+CSwCC/wC/DAIAKgD////+AADFDAIAKg/////w/wDLDAIAKg/////w/wDSDAIAKg/u7u7g/wDZDAIAKg7Nzc3B/wDgDAIAKg6Li4uD/wDnDAIAJmrw8OaM/wDtDAIAJ3D///aP/wD0DAIAJ3Du7uaF/wD7DAIAJ2/NzcZz/wACDQIAJ2+Li4ZO/wAJDQIAqhT65ub6/wASDQIA8A////D1/wAgDQIA8A////D1/wAvDQIA7w/u7uDl/wA+DQIA8A7NzcHF/wBNDQIA7w6Li4OG/wBcDQIAQP/8fPwA/wBmDQIAJjH///rN/wBzDQIAJjH///rN/wCBDQIAJTLu7um//wCPDQIAJjHNzcml/wCdDQIAJzGLi4lw/wCrDQIAiT/mrdjm/wC1DQIAikD/v+///wDADQIAikDust/u/wDLDQIAij/NmsDN/wDWDQIAiUCLaIOL/wDhDQIAAHfw8ICA/wDsDQIAfx//4P///wD2DQIAfx//4P///wABDgIAfx/u0e7u/wAMDgIAfx/NtM3N/wAXDgIAfx+LeouL/wAiDgIAI3Pu7t2C/wAxDgIAI3T//+yL/wBBDgIAI3Pu7tyC/wBRDgIAI3PNzb5w/wBhDgIAI3OLi4FM/wBxDgIAKij6+vrS/wCGDgIAAADT09PT/wCQDgIAAADT09PT/wCaDgIA+En//7bB/wCkDgIA+VH//665/wCvDgIA+FHu7qKt/wC6DgIA+VDNzYyV/wDFDgIA+VCLi19l/wDQDgIADIT//6B6/wDcDgIADIT//6B6/wDpDgIAC4Tu7pVy/wD2DgIADIXNzYFi/wADDwIADIWLi1dC/wAQDwIAfdGyILKq/wAeDwIAj3X6h876/wArDwIAj0//sOL//wA5DwIAj0/upNPu/wBHDwIAjk/NjbbN/wBVDwIAj06LYHuL/wBjDwIAr4//hHD//wByDwIAlDiZd4iZ/wCBDwIAlDiZd4iZ/wCQDwIAlzTesMTe/wCfDwIAlzX/yuH//wCvDwIAlzXuvNLu/wC/DwIAlzXNorXN/wDPDwIAljWLbnuL/wDfDwIAKh/////g/wDrDwIAKh/////g/wD4DwIAKh/u7u7R/wAFEAIAKh/Nzc20/wASEAIAKh+Li4t6/wAfEAIAVcDNMs0y/wApEAIAFRT6+vDm/wAvEAIA1P///wD//wA3EAIA1P///wD//wBAEAIA1P/u7gDu/wBJEAIA1P/NzQDN/wBSEAIA1P+LiwCL/wBbEAIA77mwsDBg/wBiEAIA5Mv//zSz/wBqEAIA5Mvu7jCn/wByEAIA5MzNzSmQ/wB6EAIA5MuLixxi/wCCEAIAcYDNZs2q/wCTEAIAqv/NAADN/wCeEAIAzJjTulXT/wCrEAIAy5n/4Gb//wC5EAIAy5nu0V/u/wDHEAIAy5nNtFLN/wDVEAIAy5qLejeL/wDjEAIAt3zbk3Db/wDwEAIAt33/q4L//wD+EAIAt33un3nu/wAMEQIAt33NiWjN/wAaEQIAt3yLXUeL/wAoEQIAZ6mzPLNx/wA3EQIAsI/ue2ju/wBHEQIAb//6APqa/wBZEQIAfafRSNHM/wBpEQIA5OTHxxWF/wB5EQIAqsZwGRlw/wCGEQIAagn/9f/6/wCQEQIABB7//+Th/wCaEQIABB7//+Th/wClEQIABB7u7tXS/wCwEQIAAx3Nzbe1/wC7EQIABR2Li317/wDGEQIAGkn//+S1/wDPEQIAGVH//96t/wDbEQIAGVH//96t/wDoEQIAGVLu7s+h/wD1EQIAGVLNzbOL/wACEgIAGVKLi3le/wAPEgIAqv+AAACA/wAUEgIAqv+AAACA/wAdEgIAKgD////+AAAiEgIAGxf9/fXm/wAqEgIAOMCOa44j/wA0EgIAOMH/wP8+/wA/EgIAOMDus+46/wBKEgIAOMDNms0y/wBVEgIAOMCLaYsi/wBgEgIAG////6UA/wBnEgIAG////6UA/wBvEgIAG//u7poA/wB3EgIAG//NzYUA/wB/EgIAG/+Li1oA/wCHEgIAC////0UA/wCREgIAC////0UA/wCcEgIAC//u7kAA/wCnEgIAC//NzTcA/wCyEgIAC/+LiyUA/wC9EgIA1nva2nDW/wDEEgIA1nz//4P6/wDMEgIA1nzu7nrp/wDUEgIA1nzNzWnJ/wDcEgIA1XyLi0eJ/wDkEgIAJkju7uiq/wDyEgIAVWT7mPuY/wD8EgIAVWX/mv+a/wAHEwIAVWTukO6Q/wASEwIAVWTNfM18/wAdEwIAVWSLVItU/wAoEwIAf0Pur+7u/wA2EwIAf0T/u////wBFEwIAf0Turu7u/wBUEwIAf0TNls3N/wBjEwIAf0OLZouL/wByEwIA8Xzb23CT/wCAEwIA8X3//4Kr/wCPEwIA8X3u7nmf/wCeEwIA8X3NzWiJ/wCtEwIA8XyLi0dd/wC8EwIAGin//+/V/wDHEwIAFEb//9q5/wDREwIAFEb//9q5/wDcEwIAE0Xu7sut/wDnEwIAE0XNza+V/wDyEwIAFEWLi3dl/wD9EwIAFLDNzYU//wACFAIA9z///8DL/wAHFAIA9Un//7XF/wANFAIA9Unu7qm4/wATFAIA9UrNzZGe/wAZFAIA9UmLi2Ns/wAfFAIA1Ebd3aDd/wAkFAIA1ET//7v//wAqFAIA1ETu7q7u/wAwFAIA1ETNzZbN/wA2FAIA1EOLi2aL/wA8FAIAhDvmsODm/wBHFAIAxN3woCDw/wBOFAIAv8//mzD//wBWFAIAwM/ukSzu/wBeFAIAwM/NfSbN/wBmFAIAwM+LVRqL/wBuFAIAAP///wAA/wByFAIAAP///wAA/wB3FAIAAP/u7gAA/wB8FAIAAP/NzQAA/wCBFAIAAP+LiwAA/wCGFAIAAD28vI+P/wCQFAIAAD7//8HB/wCbFAIAAD7u7rS0/wCmFAIAAD7NzZub/wCxFAIAAD6Li2lp/wC8FAIAn7XhQWnh/wDGFAIAn7f/SHb//wDRFAIAn7fuQ27u/wDcFAIAn7bNOl/N/wDnFAIAn7eLJ0CL/wDyFAIAEdyLi0UT/wD+FAIABIr6+oBy/wAFFQIACZb//4xp/wANFQIACZbu7oJi/wAVFQIACZbNzXBU/wAdFQIACZaLi0w5/wAlFQIAE5r09KRg/wAwFQIAZ6qLLotX/wA5FQIAZ6v/VP+f/wBDFQIAZ6vuTu6U/wBNFQIAZ6vNQ82A/wBXFQIAZ6qLLotX/wBhFQIAERD///Xu/wBqFQIAERD///Xu/wB0FQIAEhHu7uXe/wB+FQIAEhHNzcW//wCIFQIAEhCLi4aC/wCSFQIADbegoFIt/wCZFQIADbj//4JH/wChFQIADbju7nlC/wCpFQIADbjNzWg5/wCxFQIADbmLi0cm/wC5FQIAi2zrh87r/wDBFQIAkHj/h87//wDKFQIAkHjufsDu/wDTFQIAkHjNbKbN/wDcFQIAkXeLSnCL/wDlFQIAr4/NalrN/wDvFQIAr5D/g2///wD6FQIAr5Duemfu/wAFFgIAr5DNaVnN/wAQFgIAr5CLRzyL/wAbFgIAlDiQcICQ/wAlFgIAlTj/xuL//wAwFgIAlTjuudPu/wA7FgIAlDnNn7bN/wBGFgIAlTiLbHuL/wBRFgIAlDiQcICQ/wBbFgIAAAX///r6/wBgFgIAAAX///r6/wBmFgIAAAXu7unp/wBsFgIAAATNzcnJ/wByFgIAAAOLi4mJ/wB4FgIAav//AP9//wCEFgIAav//AP9//wCRFgIAav/uAO52/wCeFgIAav/NAM1m/wCrFgIAav+LAItF/wC4FgIAkpu0RoK0/wDCFgIAkpz/Y7j//wDNFgIAkpzuXKzu/wDYFgIAkpzNT5TN/wDjFgIAk5uLNmSL/wDuFgIAGFTS0rSM/wDyFgIAFLD//6VP/wD3FgIAFLDu7ppJ/wD8FgIAFLDNzYU//wABFwIAFLCLi1or/wAGFwIA1B3Y2L/Y/wAOFwIA1B7//+H//wAXFwIA1B7u7tLu/wAgFwIA1B3NzbXN/wApFwIA1B2Li3uL/wAyFwIABrj//2NH/wA5FwIABrj//2NH/wBBFwIABrju7lxC/wBJFwIABrjNzU85/wBRFwIABrmLizYm/wCjGAIAKgD////+AABZFwIAe7bgQODQ/wBjFwIAgf//APX//wBuFwIAgf/uAOXu/wB5FwIAgf/NAMXN/wCEFwIAgf+LAIaL/wCPFwIA1HPu7oLu/wCWFwIA49fQ0CCQ/wCgFwIA68H//z6W/wCrFwIA68Du7jqM/wC2FwIA68DNzTJ4/wDBFwIA68CLiyJS/wDMFwIAG0T19d6z/wDSFwIAG0X//+e6/wDZFwIAG0Tu7tiu/wDgFwIAG0TNzbqW/wDnFwIAG0OLi35m/wDuFwIAAAD//////wD0FwIAAAD19fX1/wD/FwIAKv////8A/wAGGAIAKv////8A/wAOGAIAKv/u7u4A/wAWGAIAKv/Nzc0A/wAeGAIAKv+Li4sA/wAmGAIAOMDNms0y/wCaHAIAfywCALYYAgC4GAIAuhgCALwYAgC+GAIAwBgCAMIYAgDEGAIAxhgCAMkYAgDMGAIAzxgCANIYAgDVGAIA2BgCANsYAgDeGAIA4RgCAOQYAgAAAAAABAAAAAQAAAALAAAANgAAABYAAAAAAAAAAAAAAAAAAAAIAAAAEAAAABgAAAAAAAAAAAAAABcAAAAAAAAAAAAAAAAAAAAIAAAAEAAAABgAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAANwAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAADGJQIACQAAAMwlAgAKAAAA1SUCAAsAAAAXJgIADAAAAB0mAgANAAAAIiYCAA4AAADVJQIADwAAAKomAgAQAAAAsSYCABEAAAC5JgIAEgAAAMAmAgATAAAAzCYCABQAAAAXJgIAFQAAANgmAgAWAAAA4CYCABcAAADqJgIAGAAAAPgmAgAZAAAA/yYCABoAAAAEJwIAGwAAAAcnAgAcAAAADCcCAB0AAAAUJwIAHgAAABonAgAfAAAAICcCACAAAAAnJwIAIQAAAC0nAgAhAAAANScCACIAAAA8JwIAIwAAANUlAgAkAAAAsSYCABEAAAC5JgIAEgAAADMpAgAlAAAAwCYCABMAAADMJgIAFAAAABcmAgAVAAAAPikCACYAAADgJgIAFwAAAOomAgAYAAAA+CYCABkAAAD/JgIAGgAAAAQnAgAbAAAABycCABwAAABGKQIAJwAAABQnAgAeAAAAGicCAB8AAAAgJwIAIAAAACcnAgAhAAAALScCACEAAAA1JwIAIgAAADwnAgAjAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwWHBwcHBwcHBwcHBYcGhwcFhwcHBwcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAABP7//4f+//8HAAAAAAAAAAD//3////9///////////N//v3//////3///////////w/g/////zH8////AAAAAAAAAP//////////////AQD4AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQNf///v/////f39U/f8PAP7f///////////+3/////8DAP///////58Z////zz8DAAAAAAAA/v///38C/v///38AAAAAAAAAAAD///8HBwAAAAAA/v//B/4HAAAAAP7//////////3z/fy8AYAAAAOD///////8jAAAA/wMAAADgn/n///3FAwAAALADAAMA4If5///9bQMAAABeAAAcAOCv+////e0jAAAAAAEAAADgn/n///3NIwAAALADAAAA4Mc91hjHvwMAAAAAAAAAAODf/f///e8DAAAAAAMAAADg3/3///3vAwAAAEADAAAA4N/9///9/wMAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAD+/////38NAD8AAAAAAAAAliXw/q5sDSAfAAAAAAAAAAAAAAAAAAAA//7///8DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////PwD/////fwDt2gcAAAAAUAFQMYKrYiwAAAAAQADJgPUHAAAAAAgBAv////////////////////////8P//////////////8D//8/P/////8/P/+q////P////////99f3B/PD/8f3B8AAAAAQEwAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAIAAAAD+AwAA/v///////////x8A/v////////////8H4P////8fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////z8AAAAAAAAAAAAAAP//////////////////////////DwAAAAAAAAAAAAAAAAAAAABg/wf+//+H/v//BwAAAAAAAIAA//9/////f/////8AAAAAAAAA//////////////8BAPgDAAMAAAAAAP//////////PwAAAAMAAADA1///+/////9/f1T9/w8A/t////////////7f/////3sA////////nxn////PPwMAAAAAAAD+////fwL+////fwD+//v//7sWAP///wcHAAAAAAD+//8H//8HAP8D////////////fP9/7///Pf8D7v////////P/Px7/z/8AAO6f+f///cXTnzmAsM//AwDkh/n///1t04c5AF7A/x8A7q/7///97fO/OwAAwf8AAO6f+f///c3zjznAsMP/AADsxz3WGMe/w8c9gACA/wAA7t/9///978PfPWAAw/8AAOzf/f///e/D3z1gQMP/AADs3/3///3/w889gADD/wAAAAAAAAAAAAAAAAAAAAAAAP7/////f/8H/3//AwAAAACWJfD+rmz/O18//wMAAAAAAAAAA/8DoML//v///wP+/98Pv/7/P/4CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8fAgAAAKAAAAD+/z4A/v///////////x9m/v////////////93GQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAGAAAABwAAAAEAAAABAAAAAAAAAAAAAAAAFQoAABUAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUGBgYGBgYGBgYGBgYGBgYGBwcHBwcAAAAAAAAAAAABASsAAAAsAAAALQAAAC4AAAAvAAAALQAAADAAAAAxAAAAMgAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAoAAAAKQAAACAAAAAqAAAADAAAABkAAAAhAAAABgAAAAcAAAABAAAAAQAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkWEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBgYGBgYGBgYGBgYGBgYGBgcHBwcHAAAAAAAAAAAAAQErAAAALAAAAC0AAAAuAAAALwAAAC0AAAAwAAAAMQAAADIAAAAA3QAAYOYAANjkAADM5wAAzOcAADjpAADY5AAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAIAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRYSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIAAAAjAAAAJAAAACUAAAAmAAAAJwAAACgAAAAzAAAANAAAACkAAAA1AAAADQAAABoAAAAqAAAACQAAAAoAAAACAAAAAAAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkWEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcFhwcHBwcHBwcHBwWHBocHBYcHBwcHBYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArAAAALAAAAC0AAAAuAAAALwAAADAAAAAxAAAANgAAADcAAAAyAAAAOAAAAA4AAAAbAAAAMwAAAAsAAAAMAAAAAgAAAAABAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFhICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAz40BALIzAgBTjgEAuzMCAMIzAgDLMwIAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAGAAAABwAAAAEAAAABAAAAAAAAAAAAAAAAFQoAABUAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUGBgYGBgYGBgYGBgYGBgYGBwcHBwcAAAAAAAAAAAABASsAAAAsAAAALQAAAC4AAAAvAAAALQAAADAAAAAxAAAAMgAAAETsAACw7QAAHO8AAIjwAACI8AAA9PEAABzvAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAKAAAACkAAAAgAAAAKgAAAAwAAAAZAAAAIQAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFxICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACgAAAApAAAAIAAAACoAAAAMAAAAGQAAACEAAAAIAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAoAAAAKQAAACAAAAAqAAAADAAAABkAAAAhAAAABgAAAAcAAAABAAAAAQAAAAAAAAAAAAAAABUKAAAJAAAAAAAAAAAAAAAAAAAAAAAAFRAMExweAw0fICEiIxsaERkZGRkZGRkZGRkXEgIOCw8cGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYUHAQcFhwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhwkHBwcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBgYGBgYGBgYGBgYGBgYGBgcHBwcHAAAAAAAAAAAAAQErAAAALAAAAC0AAAAuAAAALwAAAC0AAAAwAAAAMQAAADIAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAAoAAAAMwAAADQAAAApAAAANQAAAA0AAAAaAAAAKgAAAAkAAAAKAAAAAgAAAAAAAAAAAAAAAAAAAAAVCgAACQAAAAAAAAAAAAAAAAAAAAAAABUQDBMcHgMNHyAhIiMbGhEZGRkZGRkZGRkZFxICDgsPHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWFBwEHBYcGBgYGBgYFhYWFhYWFhYWFhYWFhYWFhYWFhYcJBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBYcHBwcHBwcHBwcFhwaHBwWHBwcHBwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWHBYWFhYWFhYWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADYAAAA3AAAAMgAAADgAAAAOAAAAGwAAADMAAAALAAAADAAAAAIAAAAAAQAAAAAAAAAAAAAAFQoAAAkAAAAAAAAAAAAAAAAAAAAAAAAVEAwTHB4DDR8gISIjGxoRGRkZGRkZGRkZGRcSAg4LDxwYGBgYGBgWFhYWFhYWFhYWFhYWFhYWFhYWFhQcBBwWHBgYGBgYGBYWFhYWFhYWFhYWFhYWFhYWFhYWHCQcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwWHBwcHBwcHBwcHBYcGhwcFhwcHBwcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYcFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhwWFhYWFhYWFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF00AgBjNAIAZjQCAGw0AgAGNAIAczQCAHw0AgCENAIAnPMAABQAAABDLlVURi04AAAAAAAAAAAAAAAAAN4SBJUAAAAA////////////////AgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADAFAAAwBUAAMAWAADAFwAAwBgAAMAZAADAGgAAwBsAAMAcAADAHQAAwB4AAMAfAADAAAAAswEAAMMCAADDAwAAwwQAAMMFAADDBgAAwwcAAMMIAADDCQAAwwoAAMMLAADDDAAAww0AANMOAADDDwAAwwAADLsBAAzDAgAMwwMADMMEAAzTgPQAAAkAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAQAAAA/PkCAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9QAABQAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAABAAAAAE/gIAAAQAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACv////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD1AACE9QAABQAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABAAAAAMAgMAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmOgCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAABAAAAAQAAAAGAAAAg/miAERObgD8KRUA0VcnAN009QBi28AAPJmVAEGQQwBjUf4Au96rALdhxQA6biQA0k1CAEkG4AAJ6i4AHJLRAOsd/gApsRwA6D6nAPU1ggBEuy4AnOmEALQmcABBfl8A1pE5AFODOQCc9DkAi1+EACj5vQD4HzsA3v+XAA+YBQARL+8AClqLAG0fbQDPfjYACcsnAEZPtwCeZj8ALepfALondQDl68cAPXvxAPc5BwCSUooA+2vqAB+xXwAIXY0AMANWAHv8RgDwq2sAILzPADb0mgDjqR0AXmGRAAgb5gCFmWUAoBRfAI1AaACA2P8AJ3NNAAYGMQDKVhUAyahzAHviYABrjMAAIAAAAAkAAAAKAAAADQAAAAsAAAAMAAAAhQAAAAAgAAABIAAAAiAAAAMgAAAEIAAABSAAAAYgAAAIIAAACSAAAAogAAAoIAAAKSAAAF8gAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAZAAAAOgDAAAQJwAAoIYBAEBCDwCAlpgAAOH1BV9wiQD/CS8PdAAAAP1XAgBuAAAA/1cCAHIAAAABWAIAZgAAAANYAgBhAAAABVgCAGUAAAAHWAIAdwAAAAlYAgBXAAAAFlgCAHMAAAAkWAIAUwAAADBYAgBkAAAAPVgCAEQAAABJWAIAAAAAAAAAAAAAAAAAAAAEAAQAGwAbACAAIAAjACEACgACABYACQAhACEAIQAVABwAAQAUABQAFAAUABQAFAAUAAgABAAFABsAAgAXABsAIAAfAB4AHQAJABMAAAAVABIAFQADAAcAFQAVABQAFAAUABQAFAAUABQAFAAIAAQABQAFAAYAGwAaABgAGQAgAAcAFQAUABQAFAAUABQAFAALABQADQAUAAwAFAAUABQADgAUABQAFAAQABQADwAUABEAAAAAAAAArgAuAC8AMwA1ADAANwCqANsA2wDbANsAAAA9AIcANwA3ANsA2wAAACgANQAuADIALwBiAAAAAABHAAAAAADbAFEAAADbANsA2wAAANsAhABVANsAggDbAAAAgQDbAAAAPgBCAEEASABEAFIAWwAAAAAAXgBfANsAAADbANsA2wAAAAAAewBJAFcAUgBaAFoAXQAAAF8AAABfAAAAZQBdAF8AAABdAG4AagAAAGkAAABuAAAA2wCTAJoAoQCoAKsAcACxALgAvwDGAM0A0wAAAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAMABAAHAAMABAAFAAUABgAGAAgABwAHABEAFgASABEAEgAIAAgADwAPABcADwAYAA8AGQAaABoAHgAWADQAHgAFADIABgAiACIAMwAXABgANQAZABoAGgAqADYAKgA0ADcAMgBFADsAPAAzADsAPABGADUARwBIAEwANgAiAEkASgA3AEUATgBQAGIAUQBSAFQARgBHAFUASABMAFYASQBKAFgAWgBOAEQAUABRAFIAVAA4AC8ALABVACkAVgAbABAAWABaAF0AXQBdAF0AXQBdAF0AXgBeAF4AXgBeAF4AXgBfAF8AXwBfAF8AXwBfAGAACQBgAGAAYABgAGAAYQBhAGMAAgBjAGMAYwBjAGMAZAAAAGQAAABkAGQAZABlAAAAZQBlAGUAZQBlAGYAZgAAAGYAZgBmAGYAZwAAAGcAZwBnAGcAaAAAAGgAaABoAGgAaABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAAXAABAF0AXQBeAF4AXwBfAFwAXABcAFwAXABgAFwAXABcAGEAXABcAGIAYgBiAGIAYgBiAGIAYwBkAGUAZgBmAFwAXABnAFwAXABcAGAAXABcAGEAXABhAFwAaABhAFwAYgBiAGIAYgBiAGIAYgBiAGMAZABlAGUAXABmAFwAXABcAGcAaABhAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgBiAGIAYgAAAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAACgALAAwADQAOAAoADwAQABEAEgATAAoAFAAVABUAFQAWABcAFQAYABUAFQAZABUAFQAVABoAFQAVAAoAFQAVABUAFgAXABgAFQAVABkAFQAVABUAGgAVABUAFQAVABsADAAMACQAHgAeACAAIQAgACEAJAAlACYALQAyAC8ALgAqACUAJgAoACkAMwAqADQAKwA1ADYANwA8ADIARwA9ACIARQAiAD8AQABGADMANABIADUANgA3AC8ASQAqAEcASgBFAEwAXAA8AEYAXAA9AE0ASABOAE8AUgBJAEEAUABRAEoATABTAFQAMQBVAFYAVwBNAE4AWABPAFIAWQBQAFEAWgBbAFMARABUAFUAVgBXAEsARAAsAFgALABZADgALABaAFsAHQAdAB0AHQAdAB0AHQAfAB8AHwAfAB8AHwAfACMAIwAjACMAIwAjACMAJwBcACcAJwAnACcAJwAwADAAOQAcADkAOQA5ADkAOQA6AFwAOgBcADoAOgA6ADsAXAA7ADsAOwA7ADsAPgA+AFwAPgA+AD4APgBCAFwAQgBCAEIAQgBDAFwAQwBDAEMAQwBDAAkAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwACACu/9EACgCu/67/CwCu/67/rv+u/67/rv+u/67/BQDRAK7/0QDRANEA0QDRANEA0QDRAK7/+/+u/w4A7P+u/67/rv+u/9EA0QDRANEA0QANACUADABCABAAUAATAG0AewAUAJgADwCmAMMArv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/rv+u/67/FwCu/3cArv8HAC4Arv8mAK7/FwARACMArv8NAK7/rv+u/67/OgCu/67/NQCu/67/rv8oAK7/BwCu/zsARQCu/0gArv+u/67/rv+u/67/rv/8/+gA9v///xoAAAAnAAEAMgCu/67/AgAkAAMALwCu/67/rv+u/67//v+UAK7/CQAbAK7/vP+u/67/r/+u/67/rv+u/67/rv+u/wAAAAAAAG3m7N4FAAsASQAxAVMAfwEwAWkAeAH/AIEBUwKCAYMBhAGFAYYBVAKHAYgBiQFWAooBVwKLAYwBjgHdAY8BWQKQAVsCkQGSAZMBYAKUAWMClgFpApcBaAKYAZkBnAFvAp0BcgKfAXUCpgGAAqcBqAGpAYMCrAGtAa4BiAKvAbABsQGKArIBiwK3AZICuAG5AbwBvQHEAcYBxAHFAcUBxgHHAckBxwHIAcgByQHKAcwBygHLAcsBzAHxAfMB8QHyAfIB8wH0AfUB9gGVAfcBvwEgAp4BhgOsA4gDrQOJA64DigOvA4wDzAOOA80DjwPOA5kDRQOZA74fowPCA/cD+AP6A/sDYB6bHp4e3wBZH1EfWx9TH10fVR9fH1cfvB+zH8wfwx/sH+Uf/B/zHzoCZSw7AjwCPQKaAT4CZixBAkICQwKAAUQCiQJFAowC9AO4A/kD8gP9A3sD/gN8A/8DfQPABM8EJiHJAyohawArIeUAMiFOIYMhhCFgLGEsYixrAmMsfR1kLH0CbSxRAm4scQJvLFACcCxSAnIscyx1LHYsfiw/An8sQALyLPMsfad5HYunjKeNp2UCqqdmAscQJy3NEC0tdgN3A5wDtQCSA9ADmAPRA6YD1QOgA9YDmgPwA6ED8QOVA/UDzwPXAwAAAABBACAawAAgHwABAS8yAQEFOQEBD0oBAS15AQEFcAMBA5EDIBGjAyAJAARQEBAEICBgBAEhigQBNcEEAQ3QBAE/FAUBEzEFMCagAQEFswEBA80BAQ/eAQER+AEBJyICARHYAwEXAB4BlaAeAV8IH/gIGB/4Bigf+Ag4H/gISB/4Bmgf+AiIH/gImB/4CKgf+Ai4H/gCuh+2AsgfqgTYH/gC2h+cAugf+ALqH5AC+B+AAvofggJGAgEJEAUBA2AhEBAALDAvZywBBYAsAWPrLAEDQKYBLYCmARcipwENMqcBPXmnAQN+pwEJkKcBA6CnAQkh/yAaAAAAAHsgdmFyIHBhdGggPSBQb2ludGVyX3N0cmluZ2lmeSgkMCk7IHZhciBkYXRhID0gUG9pbnRlcl9zdHJpbmdpZnkoJDEpOyBGUy5jcmVhdGVQYXRoKCIvIiwgUEFUSC5kaXJuYW1lKHBhdGgpKTsgRlMud3JpdGVGaWxlKFBBVEguam9pbigiLyIsIHBhdGgpLCBkYXRhKTsgfQBjb3JlAHhkb3R2ZXJzaW9uADEuNwAxLjQAMS4yAF9sZHJhd18AX2hkcmF3XwBfdGRyYXdfAF9obGRyYXdfAF90bGRyYXdfAHhkb3QgdmVyc2lvbiAiJXMiIHRvbyBsb25nACAlZCAAJS4wMmYAJXMlZCAtACMlMDJ4JTAyeCUwMnglMDJ4AHNldGxpbmV3aWR0aCgAJS4zZgBTIABDIAAyIABFIABlIABGIAB0ICV1IABUIABkb3Q6ZG90AGd2OmRvdABjYW5vbjpkb3QAcGxhaW46ZG90AHBsYWluLWV4dDpkb3QAeGRvdDp4ZG90AHhkb3QxLjI6eGRvdAB4ZG90MS40Onhkb3QASSAAIl9zdWJncmFwaF9jbnQiOiAlZAAiX2d2aWQiOiAlZAAiZWRnZXMiOiBbCgAiX2d2aWQiOiAlZCwKACJ0YWlsIjogJWQsCgAiaGVhZCI6ICVkACJvYmplY3RzIjogWwoAIm5vZGVzIjogWwoAIm5hbWUiOiAiJXMiAFwiAFwvAFxiAFxmAFxuAFxyAFx0ACJzdWJncmFwaHMiOiBbCgAiJXMiOiAAIiVzIgBDb3VsZCBub3QgcGFyc2UgeGRvdCAiJXMiCgBbCgAib3AiOiAiJWMiLAoAInJlY3QiOiBbJS4wM2YsJS4wM2YsJS4wM2YsJS4wM2ZdCgAib3AiOiAiTCIsCgAib3AiOiAiVCIsCgAicHQiOiBbJS4wM2YsJS4wM2ZdLAoAImFsaWduIjogIiVjIiwKACJ3aWR0aCI6ICUuMDNmLAoAInRleHQiOiAiJXMiCgAiZ3JhZCI6ICJub25lIiwKACJjb2xvciI6ICIlcyIKACJncmFkIjogImxpbmVhciIsCgAiZ3JhZCI6ICJyYWRpYWwiLAoAIm9wIjogIkYiLAoAInNpemUiOiAlLjAzZiwKACJmYWNlIjogIiVzIgoAIm9wIjogIlMiLAoAInN0eWxlIjogIiVzIgoAIm9wIjogInQiLAoAImZvbnRjaGFyIjogJWQKACJwMCI6IFslLjAzZiwlLjAzZiwlLjAzZl0sCgAicDEiOiBbJS4wM2YsJS4wM2YsJS4wM2ZdLAoAInN0b3BzIjogWwB7ImZyYWMiOiAlLjAzZiwgImNvbG9yIjogIiVzIn0AXQoAInAwIjogWyUuMDNmLCUuMDNmXSwKACJwMSI6IFslLjAzZiwlLjAzZl0sCgAicG9pbnRzIjogWwBbJS4wM2YsJS4wM2ZdAGRyYXdfAGxkcmF3XwBoZHJhd18AdGRyYXdfAGhsZHJhd18AdGxkcmF3XwAiZGlyZWN0ZWQiOiAlcywKACJzdHJpY3QiOiAlcwBEdXBsaWNhdGUgY2x1c3RlciBuYW1lICIlcyIKAHhkb3QAanNvbgBqc29uMABkb3RfanNvbgB4ZG90X2pzb24AanNvbjpqc29uAGpzb24wOmpzb24AZG90X2pzb246anNvbgB4ZG90X2pzb246anNvbgBuID49IDQAZ3ZyZW5kZXJfY29yZV9maWcuYwBmaWdfYmV6aWVyAGZpZ19yZXNvbHZlX2NvbG9yAGZpZwBmaWc6ZmlnAG1hcAByZWN0ICVzICVkLCVkICVkLCVkCgBjaXJjbGUgJXMgJWQsJWQsJWQKAHBvbHkgJXMAICVkLCVkAGd2cmVuZGVyX2NvcmVfbWFwLmMAbWFwX291dHB1dF9zaGFwZQByZWN0YW5nbGUgKCVkLCVkKSAoJWQsJWQpICVzICVzCgA8YXJlYSBzaGFwZT0iY2lyY2xlIgA8YXJlYSBzaGFwZT0icmVjdCIAPGFyZWEgc2hhcGU9InBvbHkiACBocmVmPSIAIHRpdGxlPSIAIGFsdD0iIgAgY29vcmRzPSIAJWQsJWQsJWQAJWQsJWQsJWQsJWQAJWQsJWQALCVkLCVkACI+CgA8L21hcD4KAGJhc2UgcmVmZXJlcgoAZGVmYXVsdCAAPG1hcCBpZD0iACIgbmFtZT0iAGlzbWFwOm1hcABjbWFwOm1hcABpbWFwOm1hcABjbWFweDptYXAAaW1hcF9ucDptYXAAY21hcHhfbnA6bWFwACMgJXMKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuMWYgJWQgJWQgJWQgJWQgJWQgJWQKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuMWYgJWQgJWQgJWQgJWQKACVkICVkICVkICVkICVkICVkICVkICVkICVkICUuM2YgJWQgJS40ZiAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZAoAJWQgJWQgIyUwMnglMDJ4JTAyeAoAZ3ZyZW5kZXJfY29yZV9tcC5jAG1wX3Jlc29sdmVfY29sb3IAJWQgJWQgJWQgJWQgJWQgJWQgJS4xZiAlLjRmICVkICUuMWYgJS4xZiAlZCAlZCAlc1wwMDEKACMgZW5kIG9mIEZJRyBmaWxlCgAjRklHIDMuMgoAIyBHZW5lcmF0ZWQgYnkgJXMgdmVyc2lvbiAlcyAoJXMpCgAjIFRpdGxlOiAlcwoAIyBQYWdlczogJWQKAFBvcnRyYWl0CgBDZW50ZXIKAEluY2hlcwoATGV0dGVyCgAxMDAuMDAKAFNpbmdsZQoALTIKADEyMDAAIDIKAG1wAG1wOm1wACBdICAlZCB0cnVlICVzCgAgXSAgJWQgZmFsc2UgJXMKACBzZXRsaW5ld2lkdGgKACVzIABzZXRoc2IAJS41ZyAlLjVnICUuNWcgJXNjb2xvcgoAJSAAbmV3cGF0aCAAIG1vdmV0bwoAIGxpbmV0bwoAc3Ryb2tlCgAgY3VydmV0bwoAY2xvc2VwYXRoIGZpbGwKAGNsb3NlcGF0aCBzdHJva2UKACBlbGxpcHNlX3BhdGggZmlsbAoAIGVsbGlwc2VfcGF0aCBzdHJva2UKACAvJXMgc2V0X2ZvbnQKACBtb3ZldG8gACAlcyBhbGlnbmVkdGV4dAoAWyAvUmVjdCBbIAAgXQoAICAvQm9yZGVyIFsgMCAwIDAgXQogIC9BY3Rpb24gPDwgL1N1YnR5cGUgL1VSSSAvVVJJICVzID4+CiAgL1N1YnR5cGUgL0xpbmsKL0FOTiBwZGZtYXJrCgBnc2F2ZQoAJSUgJXMKADAgMCAwIGVkZ2Vjb2xvcgoAZW5kcGFnZQpzaG93cGFnZQpncmVzdG9yZQoAJSVQYWdlVHJhaWxlcgoAJSUlJUVuZFBhZ2U6ICVkCgAlJSUlUGFnZTogJWQgJWQKACUlJSVQYWdlQm91bmRpbmdCb3g6ICVkICVkICVkICVkCgBMYW5kc2NhcGUAUG9ydHJhaXQAJSUlJVBhZ2VPcmllbnRhdGlvbjogJXMKADw8IC9QYWdlU2l6ZSBbJWQgJWRdID4+IHNldHBhZ2VkZXZpY2UKACVkICVkICVkIGJlZ2lucGFnZQoAZ3NhdmUKJWQgJWQgJWQgJWQgYm94cHJpbSBjbGlwIG5ld3BhdGgKACVnICVnIHNldF9zY2FsZSAlZCByb3RhdGUgJWcgJWcgdHJhbnNsYXRlCgBjYW52YXMgc2l6ZSAoJWQsJWQpIGV4Y2VlZHMgUERGIGxpbWl0ICglZCkKCShzdWdnZXN0IHNldHRpbmcgYSBib3VuZGluZyBib3ggc2l6ZSwgc2VlIGRvdCgxKSkKAFsgL0Nyb3BCb3ggWyVkICVkICVkICVkXSAvUEFHRVMgcGRmbWFyawoAJWQgJWQgc2V0bGF5ZXIKACUlJSVUaXRsZTogJXMKACUlUGFnZXM6IChhdGVuZCkKACUlUGFnZXM6IDEKACUlQm91bmRpbmdCb3g6IChhdGVuZCkKACUlJSVCb3VuZGluZ0JveDogJWQgJWQgJWQgJWQKACUlRW5kQ29tbWVudHMKc2F2ZQoAc2V0dXBMYXRpbjEKAFsge0NhdGFsb2d9IDw8IC9VUkkgPDwgL0Jhc2UgJXMgPj4gPj4KL1BVVCBwZGZtYXJrCgAlJUJlZ2luUHJvbG9nAC9Eb3REaWN0IDIwMCBkaWN0IGRlZgBEb3REaWN0IGJlZ2luAC9zZXR1cExhdGluMSB7AG1hcmsAL0VuY29kaW5nVmVjdG9yIDI1NiBhcnJheSBkZWYAIEVuY29kaW5nVmVjdG9yIDAASVNPTGF0aW4xRW5jb2RpbmcgMCAyNTUgZ2V0aW50ZXJ2YWwgcHV0aW50ZXJ2YWwARW5jb2RpbmdWZWN0b3IgNDUgL2h5cGhlbiBwdXQAJSBTZXQgdXAgSVNPIExhdGluIDEgY2hhcmFjdGVyIGVuY29kaW5nAC9zdGFybmV0SVNPIHsAICAgICAgICBkdXAgZHVwIGZpbmRmb250IGR1cCBsZW5ndGggZGljdCBiZWdpbgAgICAgICAgIHsgMSBpbmRleCAvRklEIG5lIHsgZGVmIH17IHBvcCBwb3AgfSBpZmVsc2UAICAgICAgICB9IGZvcmFsbAAgICAgICAgIC9FbmNvZGluZyBFbmNvZGluZ1ZlY3RvciBkZWYAICAgICAgICBjdXJyZW50ZGljdCBlbmQgZGVmaW5lZm9udAB9IGRlZgAvVGltZXMtUm9tYW4gc3Rhcm5ldElTTyBkZWYAL1RpbWVzLUl0YWxpYyBzdGFybmV0SVNPIGRlZgAvVGltZXMtQm9sZCBzdGFybmV0SVNPIGRlZgAvVGltZXMtQm9sZEl0YWxpYyBzdGFybmV0SVNPIGRlZgAvSGVsdmV0aWNhIHN0YXJuZXRJU08gZGVmAC9IZWx2ZXRpY2EtT2JsaXF1ZSBzdGFybmV0SVNPIGRlZgAvSGVsdmV0aWNhLUJvbGQgc3Rhcm5ldElTTyBkZWYAL0hlbHZldGljYS1Cb2xkT2JsaXF1ZSBzdGFybmV0SVNPIGRlZgAvQ291cmllciBzdGFybmV0SVNPIGRlZgAvQ291cmllci1PYmxpcXVlIHN0YXJuZXRJU08gZGVmAC9Db3VyaWVyLUJvbGQgc3Rhcm5ldElTTyBkZWYAL0NvdXJpZXItQm9sZE9ibGlxdWUgc3Rhcm5ldElTTyBkZWYAY2xlYXJ0b21hcmsAfSBiaW5kIGRlZgAlJUJlZ2luUmVzb3VyY2U6IHByb2NzZXQgZ3JhcGh2aXogMCAwAC9jb29yZC1mb250LWZhbWlseSAvVGltZXMtUm9tYW4gZGVmAC9kZWZhdWx0LWZvbnQtZmFtaWx5IC9UaW1lcy1Sb21hbiBkZWYAL2Nvb3JkZm9udCBjb29yZC1mb250LWZhbWlseSBmaW5kZm9udCA4IHNjYWxlZm9udCBkZWYAL0ludlNjYWxlRmFjdG9yIDEuMCBkZWYAL3NldF9zY2FsZSB7ACAgICAgICBkdXAgMSBleGNoIGRpdiAvSW52U2NhbGVGYWN0b3IgZXhjaCBkZWYAICAgICAgIHNjYWxlACUgc3R5bGVzAC9zb2xpZCB7IFtdIDAgc2V0ZGFzaCB9IGJpbmQgZGVmAC9kYXNoZWQgeyBbOSBJbnZTY2FsZUZhY3RvciBtdWwgZHVwIF0gMCBzZXRkYXNoIH0gYmluZCBkZWYAL2RvdHRlZCB7IFsxIEludlNjYWxlRmFjdG9yIG11bCA2IEludlNjYWxlRmFjdG9yIG11bF0gMCBzZXRkYXNoIH0gYmluZCBkZWYAL2ludmlzIHsvZmlsbCB7bmV3cGF0aH0gZGVmIC9zdHJva2Uge25ld3BhdGh9IGRlZiAvc2hvdyB7cG9wIG5ld3BhdGh9IGRlZn0gYmluZCBkZWYAL2JvbGQgeyAyIHNldGxpbmV3aWR0aCB9IGJpbmQgZGVmAC9maWxsZWQgeyB9IGJpbmQgZGVmAC91bmZpbGxlZCB7IH0gYmluZCBkZWYAL3JvdW5kZWQgeyB9IGJpbmQgZGVmAC9kaWFnb25hbHMgeyB9IGJpbmQgZGVmAC90YXBlcmVkIHsgfSBiaW5kIGRlZgAlIGhvb2tzIGZvciBzZXR0aW5nIGNvbG9yIAAvbm9kZWNvbG9yIHsgc2V0aHNiY29sb3IgfSBiaW5kIGRlZgAvZWRnZWNvbG9yIHsgc2V0aHNiY29sb3IgfSBiaW5kIGRlZgAvZ3JhcGhjb2xvciB7IHNldGhzYmNvbG9yIH0gYmluZCBkZWYAL25vcGNvbG9yIHtwb3AgcG9wIHBvcH0gYmluZCBkZWYAL2JlZ2lucGFnZSB7CSUgaSBqIG5wYWdlcwAJL25wYWdlcyBleGNoIGRlZgAJL2ogZXhjaCBkZWYACS9pIGV4Y2ggZGVmAAkvc3RyIDEwIHN0cmluZyBkZWYACW5wYWdlcyAxIGd0IHsACQlnc2F2ZQAJCQljb29yZGZvbnQgc2V0Zm9udAAJCQkwIDAgbW92ZXRvAAkJCShcKCkgc2hvdyBpIHN0ciBjdnMgc2hvdyAoLCkgc2hvdyBqIHN0ciBjdnMgc2hvdyAoXCkpIHNob3cACQlncmVzdG9yZQAJfSBpZgAvc2V0X2ZvbnQgewAJZmluZGZvbnQgZXhjaAAJc2NhbGVmb250IHNldGZvbnQAJSBkcmF3IHRleHQgZml0dGVkIHRvIGl0cyBleHBlY3RlZCB3aWR0aAAvYWxpZ25lZHRleHQgewkJCSUgd2lkdGggdGV4dAAJL3RleHQgZXhjaCBkZWYACS93aWR0aCBleGNoIGRlZgAJZ3NhdmUACQl3aWR0aCAwIGd0IHsACQkJW10gMCBzZXRkYXNoAAkJCXRleHQgc3RyaW5nd2lkdGggcG9wIHdpZHRoIGV4Y2ggc3ViIHRleHQgbGVuZ3RoIGRpdiAwIHRleHQgYXNob3cACQl9IGlmAAlncmVzdG9yZQAvYm94cHJpbSB7CQkJCSUgeGNvcm5lciB5Y29ybmVyIHhzaXplIHlzaXplAAkJNCAyIHJvbGwACQltb3ZldG8ACQkyIGNvcHkACQlleGNoIDAgcmxpbmV0bwAJCTAgZXhjaCBybGluZXRvAAkJcG9wIG5lZyAwIHJsaW5ldG8ACQljbG9zZXBhdGgAL2VsbGlwc2VfcGF0aCB7AAkvcnkgZXhjaCBkZWYACS9yeCBleGNoIGRlZgAJL3kgZXhjaCBkZWYACS94IGV4Y2ggZGVmAAltYXRyaXggY3VycmVudG1hdHJpeAAJbmV3cGF0aAAJeCB5IHRyYW5zbGF0ZQAJcnggcnkgc2NhbGUACTAgMCAxIDAgMzYwIGFyYwAJc2V0bWF0cml4AC9lbmRwYWdlIHsgc2hvd3BhZ2UgfSBiaW5kIGRlZgAvc2hvd3BhZ2UgeyB9IGRlZgAvbGF5ZXJjb2xvcnNlcQAJWwklIGxheWVyIGNvbG9yIHNlcXVlbmNlIC0gZGFya2VzdCB0byBsaWdodGVzdAAJCVswIDAgMF0ACQlbLjIgLjggLjhdAAkJWy40IC44IC44XQAJCVsuNiAuOCAuOF0ACQlbLjggLjggLjhdAAldAGRlZgAvbGF5ZXJsZW4gbGF5ZXJjb2xvcnNlcSBsZW5ndGggZGVmAC9zZXRsYXllciB7L21heGxheWVyIGV4Y2ggZGVmIC9jdXJsYXllciBleGNoIGRlZgAJbGF5ZXJjb2xvcnNlcSBjdXJsYXllciAxIHN1YiBsYXllcmxlbiBtb2QgZ2V0AAlhbG9hZCBwb3Agc2V0aHNiY29sb3IACS9ub2RlY29sb3Ige25vcGNvbG9yfSBkZWYACS9lZGdlY29sb3Ige25vcGNvbG9yfSBkZWYACS9ncmFwaGNvbG9yIHtub3Bjb2xvcn0gZGVmAC9vbmxheWVyIHsgY3VybGF5ZXIgbmUge2ludmlzfSBpZiB9IGRlZgAvb25sYXllcnMgewAJL215dXBwZXIgZXhjaCBkZWYACS9teWxvd2VyIGV4Y2ggZGVmAAljdXJsYXllciBteWxvd2VyIGx0AAljdXJsYXllciBteXVwcGVyIGd0AAlvcgAJe2ludmlzfSBpZgAvY3VybGF5ZXIgMCBkZWYAJSVFbmRSZXNvdXJjZQAlJUVuZFByb2xvZwAlJUJlZ2luU2V0dXAAMTQgZGVmYXVsdC1mb250LWZhbWlseSBzZXRfZm9udAAlIC9hcnJvd2xlbmd0aCAxMCBkZWYAJSAvYXJyb3d3aWR0aCA1IGRlZgAlIG1ha2Ugc3VyZSBwZGZtYXJrIGlzIGhhcm1sZXNzIGZvciBQUy1pbnRlcnByZXRlcnMgb3RoZXIgdGhhbiBEaXN0aWxsZXIAL3BkZm1hcmsgd2hlcmUge3BvcH0ge3VzZXJkaWN0IC9wZGZtYXJrIC9jbGVhcnRvbWFyayBsb2FkIHB1dH0gaWZlbHNlACUgbWFrZSAnPDwnIGFuZCAnPj4nIHNhZmUgb24gUFMgTGV2ZWwgMSBkZXZpY2VzAC9sYW5ndWFnZWxldmVsIHdoZXJlIHtwb3AgbGFuZ3VhZ2VsZXZlbH17MX0gaWZlbHNlADIgbHQgewAgICAgdXNlcmRpY3QgKDw8KSBjdm4gKFspIGN2biBsb2FkIHB1dAAgICAgdXNlcmRpY3QgKD4+KSBjdm4gKFspIGN2biBsb2FkIHB1dAB9IGlmACUlRW5kU2V0dXAAJSVUcmFpbGVyCgAlJSUlUGFnZXM6ICVkCgBlbmQKcmVzdG9yZQoAJSVFT0YKACUhUFMtQWRvYmUtMy4wACBFUFNGLTMuMAoAJSUlJUNyZWF0b3I6ICVzIHZlcnNpb24gJXMgKCVzKQoAcHMyOnBzADwhLS0gADxwb2x5bGluZQAgcG9pbnRzPSIAIi8+CgAgZmlsbD0iAHVybCgjbF8lZCkAdXJsKCNyXyVkKQAiIGZpbGwtb3BhY2l0eT0iJWYAIiBzdHJva2U9IgAiIHN0cm9rZS13aWR0aD0iACIgc3Ryb2tlLWRhc2hhcnJheT0iJXMANSwyADEsNQAiIHN0cm9rZS1vcGFjaXR5PSIlZgBndnJlbmRlcl9jb3JlX3N2Zy5jAHN2Z19wcmludF9jb2xvcgA8cGF0aAAgaWQ9IgBfcCIgACBkPSIAJWMAPGRlZnM+CjxyYWRpYWxHcmFkaWVudCBpZD0icl8lZCIgY3g9IjUwJSUiIGN5PSI1MCUlIiByPSI3NSUlIiBmeD0iJWQlJSIgZnk9IiVkJSUiPgoAPHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjoAO3N0b3Atb3BhY2l0eToAMS4AOyIvPgoAPHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjoAOyIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+CgA8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJsXyVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgAHgxPSIAIiB5MT0iACIgeDI9IgAiIHkyPSIAIiA+CgA8c3RvcCBvZmZzZXQ9IiUuMDNmIiBzdHlsZT0ic3RvcC1jb2xvcjoAOyIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+CgA8cG9seWdvbgA8ZWxsaXBzZQAgY3g9IgAiIGN5PSIAIiByeD0iACIgcnk9IgA8dGV4dAAgdGV4dC1hbmNob3I9InN0YXJ0IgAgdGV4dC1hbmNob3I9ImVuZCIAIHRleHQtYW5jaG9yPSJtaWRkbGUiACB4PSIAIiB5PSIAIGZvbnQtZmFtaWx5PSIlcwAsJXMAIGZvbnQtd2VpZ2h0PSIlcyIAIGZvbnQtc3RyZXRjaD0iJXMiACBmb250LXN0eWxlPSIlcyIAIGZvbnQtZmFtaWx5PSIlcyIAIGZvbnQtd2VpZ2h0PSJib2xkIgAgZm9udC1zdHlsZT0iaXRhbGljIgAgdGV4dC1kZWNvcmF0aW9uPSIAJXNvdmVybGluZQAlc2xpbmUtdGhyb3VnaAAgYmFzZWxpbmUtc2hpZnQ9InN1cGVyIgAgYmFzZWxpbmUtc2hpZnQ9InN1YiIAIGZvbnQtc2l6ZT0iJS4yZiIAIGZpbGw9IiVzIgAgZmlsbD0iIyUwMnglMDJ4JTAyeCIAc3ZnX3RleHRzcGFuAD4APHRleHRQYXRoIHhsaW5rOmhyZWY9IiMlc19wIiBzdGFydE9mZnNldD0iNTAlJSI+ADx0c3BhbiB4PSIwIiBkeT0iACI+ADwvdHNwYW4+PC90ZXh0UGF0aD4APC90ZXh0PgoAPC9nPgoAPGcAIGlkPSJhXwAgeGxpbms6aHJlZj0iACB4bGluazp0aXRsZT0iACB0YXJnZXQ9IgA8dGl0bGU+ADwvdGl0bGU+CgA8ZyBpZD0iAF8lcwAiIGNsYXNzPSIlcwBjbGFzcwAgdHJhbnNmb3JtPSJzY2FsZSgAKSByb3RhdGUoJWQpIHRyYW5zbGF0ZSgAKSI+CgA8L3N2Zz4KADwhLS0AIFBhZ2VzOiAlZCAtLT4KADxzdmcgd2lkdGg9IiVkcHQiIGhlaWdodD0iJWRwdCIKACB2aWV3Qm94PSIlLjJmICUuMmYgJS4yZiAlLjJmIgAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiADw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJubyI/PgoAc3R5bGVzaGVldAA8P3htbC1zdHlsZXNoZWV0IGhyZWY9IgAiIHR5cGU9InRleHQvY3NzIj8+CgA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iCgAgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CgA8IS0tIEdlbmVyYXRlZCBieSAAZGFya2JsdWUAZGFya2N5YW4AZGFya2dyYXkAZGFya2dyZXkAZGFya21hZ2VudGEAZGFya3JlZABsaWdodGdyZWVuACMgACBjcmVhdGUgbGluZSAAIC1maWxsIAAgLWRhc2ggNQAgLWRhc2ggMgBndnJlbmRlcl9jb3JlX3RrLmMAdGtnZW5fcHJpbnRfdGFncwBncmFwaCBsYWJlbAAgLXRhZ3MgeyVkJXMlcH0AdGtnZW5fcHJpbnRfY29sb3IAJGMAIC13aWR0aCAAIC1zbW9vdGggYmV6aWVyIAAgY3JlYXRlIHBvbHlnb24gACAtb3V0bGluZSAAIGNyZWF0ZSBvdmFsIAAgY3JlYXRlIHRleHQgACAtdGV4dCB7AH0AIC1mb250IHsAICVkfQAgLWFuY2hvciB3ACAtYW5jaG9yIGUAIwAgVGl0bGU6IAAgUGFnZXM6ICVkCgAjIEdlbmVyYXRlZCBieSAAKQoAdGsAdGs6dGsAICAgICAgPCEtLSAAIC0tPgoARXJyb3IgZHVyaW5nIGNvbnZlcnNpb24gdG8gIlVURi04Ii4gIFF1aXRpbmcuCgAgPHY6c2hhcGUgc3R5bGU9InBvc2l0aW9uOmFic29sdXRlOyAAIHdpZHRoOiAlZDsgaGVpZ2h0OiAlZCIgZmlsbGVkPSJmYWxzZSI+ADx2OnBhdGggdj0iACBtIAAlLjBmLCUuMGYgACBsIAAgZSAAIi8+ADwvdjpzaGFwZT4KADx2OnN0cm9rZSBjb2xvcj0iACIgd2VpZ2h0PSIlLjBmcHQAIiBkYXNoc3R5bGU9ImRhc2gAIiBkYXNoc3R5bGU9ImRvdAAiIC8+ACMlMDJ4JTAyeCUwMngAZ3ZyZW5kZXJfY29yZV92bWwuYwB2bWxfcHJpbnRfY29sb3IAIHdpZHRoOiAlZDsgaGVpZ2h0OiAlZCIAID4APHY6cGF0aCAgdj0iAC8+PC92OnNoYXBlPgoAbSAAJXMlLjBmLCUuMGYgAGMgACBmaWxsZWQ9InRydWUiIGZpbGxjb2xvcj0iACIgACBmaWxsZWQ9ImZhbHNlIiAAJS4wZiAlLjBmIABsIAB4IGUgIi8+ACAgPHY6b3ZhbCBzdHlsZT0icG9zaXRpb246YWJzb2x1dGU7ACBsZWZ0OiAlLjJmOyB0b3A6ICUuMmY7ACB3aWR0aDogJS4yZjsgaGVpZ2h0OiAlLjJmIgA8L3Y6b3ZhbD4KADx2OnJlY3Qgc3R5bGU9InBvc2l0aW9uOmFic29sdXRlOyAAIHN0cm9rZWQ9ImZhbHNlIiBmaWxsZWQ9ImZhbHNlIj4KADx2OnRleHRib3ggaW5zZXQ9IjAsMCwwLDAiIHN0eWxlPSJwb3NpdGlvbjphYnNvbHV0ZTsgdi10ZXh0LXdyYXBwaW5nOidmYWxzZSc7cGFkZGluZzonMCc7AGZvbnQtZmFtaWx5OiAnJXMnOwBmb250LXdlaWdodDogJXM7AGZvbnQtc3RyZXRjaDogJXM7AGZvbnQtc3R5bGU6ICVzOwAgZm9udC1zaXplOiAlLjJmcHQ7AGNvbG9yOiVzOwBjb2xvcjojJTAyeCUwMnglMDJ4OwB2bWxfdGV4dHNwYW4AIj48Y2VudGVyPgA8L2NlbnRlcj48L3Y6dGV4dGJveD4KADwvdjpyZWN0PgoAPC9hPgoAPGEAIGhyZWY9IiVzIgAgdGl0bGU9IiVzIgAgdGFyZ2V0PSIlcyIAPgoAPC92Omdyb3VwPgoAPC9ESVY+CgA8RElWIGlkPSdfVk1MMl8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTt2aXNpYmlsaXR5OmhpZGRlbiI+CgA8IS0tIGluc2VydCBhbnkgb3RoZXIgaHRtbCBjb250ZW50IGhlcmUgLS0+CgA8RElWIGlkPSdfbm90Vk1MMV8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTsiPgoAPCEtLSB0aGlzIHNob3VsZCBvbmx5IGRpc3BsYXkgb24gTk9OLUlFIGJyb3dzZXJzIC0tPgoAPEgyPlNvcnJ5LCB0aGlzIGRpYWdyYW0gd2lsbCBvbmx5IGRpc3BsYXkgY29ycmVjdGx5IG9uIEludGVybmV0IEV4cGxvcmVyIDUgKGFuZCB1cCkgYnJvd3NlcnMuPC9IMj4KADxESVYgaWQ9J19ub3RWTUwyXycgc3R5bGU9InBvc2l0aW9uOnJlbGF0aXZlOyI+CgA8IS0tIGluc2VydCBhbnkgb3RoZXIgTk9OLUlFIGh0bWwgY29udGVudCBoZXJlIC0tPgoAPC9CT0RZPgo8L0hUTUw+CgA8SEVBRD4APE1FVEEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgiPgoAPFRJVExFPgA8L1RJVExFPgA8IS0tIFBhZ2VzOiAlZCAtLT4KACAgIDxTQ1JJUFQgTEFOR1VBR0U9J0phdmFzY3JpcHQnPgoAICAgZnVuY3Rpb24gYnJvd3NlcmNoZWNrKCkKACAgIHsKACAgICAgIHZhciB1YSA9IHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50CgAgICAgICB2YXIgbXNpZSA9IHVhLmluZGV4T2YgKCAnTVNJRSAnICkKACAgICAgIHZhciBpZXZlcnM7CgAgICAgICB2YXIgaXRlbTsKACAgICAgIHZhciBWTUx5ZXM9bmV3IEFycmF5KCdfVk1MMV8nLCdfVk1MMl8nKTsKACAgICAgIHZhciBWTUxubz1uZXcgQXJyYXkoJ19ub3RWTUwxXycsJ19ub3RWTUwyXycpOwoAICAgICAgaWYgKCBtc2llID4gMCApeyAgICAgIC8vIElmIEludGVybmV0IEV4cGxvcmVyLCByZXR1cm4gdmVyc2lvbiBudW1iZXIKACAgICAgICAgIGlldmVycz0gcGFyc2VJbnQgKHVhLnN1YnN0cmluZyAobXNpZSs1LCB1YS5pbmRleE9mICgnLicsIG1zaWUgKSkpCgAgICAgICB9CgAgICAgICBpZiAoaWV2ZXJzPj01KXsKACAgICAgICBmb3IgKHggaW4gVk1MeWVzKXsKACAgICAgICAgIGl0ZW0gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChWTUx5ZXNbeF0pOwoAICAgICAgICAgaWYgKGl0ZW0pIHsKACAgICAgICAgICAgaXRlbS5zdHlsZS52aXNpYmlsaXR5PSd2aXNpYmxlJzsKACAgICAgICAgIH0KACAgICAgICB9CgAgICAgICAgZm9yICh4IGluIFZNTG5vKXsKACAgICAgICAgIGl0ZW0gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChWTUxub1t4XSk7CgAgICAgICAgICAgIGl0ZW0uc3R5bGUudmlzaWJpbGl0eT0naGlkZGVuJzsKACAgICAgfWVsc2V7CgAgICAgIH0KACAgIH0KACAgIDwvU0NSSVBUPgoAPC9IRUFEPgA8Qk9EWSBvbmxvYWQ9J2Jyb3dzZXJjaGVjaygpOyc+CgA8RElWIGlkPSdfVk1MMV8nIHN0eWxlPSJwb3NpdGlvbjpyZWxhdGl2ZTsgZGlzcGxheTppbmxpbmU7IHZpc2liaWxpdHk6aGlkZGVuACB3aWR0aDogJWRwdDsgaGVpZ2h0OiAlZHB0Ij4KADxTVFlMRT4KAHZcOiogeyBiZWhhdmlvcjogdXJsKCNkZWZhdWx0I1ZNTCk7ZGlzcGxheTppbmxpbmUtYmxvY2t9CgA8L1NUWUxFPgoAPHhtbDpuYW1lc3BhY2UgbnM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206dm1sIiBwcmVmaXg9InYiIC8+CgAgPHY6Z3JvdXAgc3R5bGU9InBvc2l0aW9uOnJlbGF0aXZlOyAAIHdpZHRoOiAlZHB0OyBoZWlnaHQ6ICVkcHQiACBjb29yZG9yaWdpbj0iMCwwIiBjb29yZHNpemU9IiVkLCVkIiA+ADxIVE1MPgoACjwhLS0gR2VuZXJhdGVkIGJ5IAAgdmVyc2lvbiAAICgAKQotLT4KAGFxdWEAZnVjaHNpYQBsaW1lAG9saXZlAHRlYWwAdm1sAHZtbDp2bWwALy8qKiogY29tbWVudDogJXMKAC8vKioqIHBvbHlsaW5lCgBzY2FsZSAgICA8JTkuM2YsICU5LjNmLCAlOS4zZj4KAHJvdGF0ZSAgIDwlOS4zZiwgJTkuM2YsICU5LjNmPgoAdHJhbnNsYXRlPCU5LjNmLCAlOS4zZiwgJTkuM2Y+CgBzcGhlcmVfc3dlZXAgewogICAgJXMKICAgICVkLAoAbGluZWFyX3NwbGluZQA8JTkuM2YsICU5LjNmLCAlOS4zZj4sICUuM2YKACVzICAgICVzACAgICB0b2xlcmFuY2UgMC4wMQogICAgJXMgICAgJXMgICAgJXMgICAgJXN9CgAlcyVzACVzIHRyYW5zbWl0ICUuM2YAUmVkAEdyZWVuAEJsdWUAcmdiPCU5LjNmLCAlOS4zZiwgJTkuM2Y+IHRyYW5zbWl0ICUuM2YAb29wcywgaW50ZXJuYWwgZXJyb3I6IHVuaGFuZGxlZCBjb2xvciB0eXBlPSVkICVzCgBndnJlbmRlcl9jb3JlX3Bvdi5jAHBvdl9jb2xvcl9hc19zdHIAcGlnbWVudCB7IGNvbG9yICVzIH0KAHBvdiByZW5kZXJlcjplbCAtICVzCgAvLyoqKiBiZXppZXIKAGJfc3BsaW5lACAgICAgICAgdG9sZXJhbmNlIDAuMDEKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogcG9seWdvbgoAICAgIHRvbGVyYW5jZSAwLjEKICAgICVzICAgICVzICAgICVzICAgICVzfQoAcG9seWdvbiB7ICVkLAoAPCU5LjNmLCAlOS4zZiwgJTkuM2Y+ACVzCiAgICAlcwAKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogZWxsaXBzZQoAdG9ydXMgeyAlLjNmLCAlLjNmCiAgICAlcyAgICAlcyAgICAlcyAgICAlc30KAHNwaGVyZSB7PCU5LjNmLCAlOS4zZiwgJTkuM2Y+LCAxLjAKICAgICVzICAgICVzICAgICVzICAgICVzfQoALy8qKiogdGV4dHNwYW46ICVzLCBmb250c2l6ZSA9ICUuM2YsIGZvbnRuYW1lID0gJXMKAHNjYWxlICUuM2YKAHRleHQgewogICAgdHRmICIlcyIsCiAgICAiJXMiLCAlLjNmLCAlLjNmCiAgICAlcyAgICAlcyAgICAlcyAgICAlcyAgICAlc30KACAgICBub19zaGFkb3cKAC8vKioqIGVuZF9lZGdlCgAvLyoqKiBiZWdpbl9lZGdlCgAvLyoqKiBlbmRfbm9kZQoALy8qKiogYmVnaW5fbm9kZTogJXMKAC8vKioqIGVuZF9jbHVzdGVyCgAvLyoqKiBiZWdpbl9jbHVzdGVyCgAvLyoqKiBlbmRfcGFnZQoALy8qKiogYmVnaW5fcGFnZQoALy8qKiogZW5kX2xheWVyCgAvLyoqKiBiZWdpbl9sYXllcjogJXMsICVkLyVkCgAvLyoqKiBlbmRfZ3JhcGgKAC8vKioqIGJlZ2luX2dyYXBoICVzCgBjYW1lcmEgeyBsb2NhdGlvbiA8JS4zZiAsICUuM2YgLCAlLjNmPgogICAgICAgICBsb29rX2F0ICA8JS4zZiAsICUuM2YgLCAlLjNmPgogICAgICAgICByaWdodCB4ICogaW1hZ2Vfd2lkdGggLyBpbWFnZV9oZWlnaHQKICAgICAgICAgYW5nbGUgJS4zZgp9CgAvL3NreQpwbGFuZSB7IDwwLCAxLCAwPiwgMSBob2xsb3cKICAgIHRleHR1cmUgewogICAgICAgIHBpZ21lbnQgeyBib3pvIHR1cmJ1bGVuY2UgMC45NQogICAgICAgICAgICBjb2xvcl9tYXAgewogICAgICAgICAgICAgICAgWzAuMDAgcmdiIDwwLjA1LCAwLjIwLCAwLjUwPl0KICAgICAgICAgICAgICAgIFswLjUwIHJnYiA8MC4wNSwgMC4yMCwgMC41MD5dCiAgICAgICAgICAgICAgICBbMC43NSByZ2IgPDEuMDAsIDEuMDAsIDEuMDA+XQogICAgICAgICAgICAgICAgWzAuNzUgcmdiIDwwLjI1LCAwLjI1LCAwLjI1Pl0KICAgICAgICAgICAgICAgIFsxLjAwIHJnYiA8MC41MCwgMC41MCwgMC41MD5dCiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2NhbGUgPDEuMDAsIDEuMDAsIDEuNTA+ICogMi41MAogICAgICAgICAgICB0cmFuc2xhdGUgPDAuMDAsIDAuMDAsIDAuMDA+CiAgICAgICAgfQogICAgICAgIGZpbmlzaCB7IGFtYmllbnQgMSBkaWZmdXNlIDAgfQogICAgfQogICAgc2NhbGUgMTAwMDAKfQovL21pc3QKZm9nIHsgZm9nX3R5cGUgMgogICAgZGlzdGFuY2UgNTAKICAgIGNvbG9yIHJnYiA8MS4wMCwgMS4wMCwgMS4wMD4gKiAwLjc1CiAgICBmb2dfb2Zmc2V0IDAuMTAKICAgIGZvZ19hbHQgMS41MAogICAgdHVyYnVsZW5jZSAxLjc1Cn0KLy9nbmQKcGxhbmUgeyA8MC4wMCwgMS4wMCwgMC4wMD4sIDAKICAgIHRleHR1cmUgewogICAgICAgIHBpZ21lbnR7IGNvbG9yIHJnYiA8MC4yNSwgMC40NSwgMC4wMD4gfQogICAgICAgIG5vcm1hbCB7IGJ1bXBzIDAuNzUgc2NhbGUgMC4wMSB9CiAgICAgICAgZmluaXNoIHsgcGhvbmcgMC4xMCB9CiAgICB9Cn0KAGxpZ2h0X3NvdXJjZSB7IDwxNTAwLDMwMDAsLTI1MDA+IGNvbG9yIFdoaXRlIH0KACN2ZXJzaW9uIDMuNjsKAGdsb2JhbF9zZXR0aW5ncyB7IGFzc3VtZWRfZ2FtbWEgMS4wIH0KACNkZWZhdWx0IHsgZmluaXNoIHsgYW1iaWVudCAwLjEgZGlmZnVzZSAwLjkgfSB9CgAjaW5jbHVkZSAiY29sb3JzLmluYyIKI2luY2x1ZGUgInRleHR1cmVzLmluYyIKI2luY2x1ZGUgInNoYXBlcy5pbmMiCgAjZGVjbGFyZSAlcyA9ICVzOwoAQmxhY2sAV2hpdGUAYmFrZXJzY2hvYwBicmFzcwBicmlnaHRnb2xkAGJyb256ZQBicm9uemUyAGNsZWFyAGNvb2xjb3BwZXIAY29wcGVyAGRhcmticm93bgBkYXJrcHVycGxlAGRhcmt0YW4AZGFya3dvb2QAZGtncmVlbmNvcHBlcgBkdXN0eXJvc2UAZmVsZHNwYXIAZmxlc2gAZ3JheTA1AGdyZWVuY29wcGVyAGh1bnRlcnNncmVlbgBsaWdodF9wdXJwbGUAbGlnaHR3b29kAG1hbmRhcmlub3JhbmdlAG1lZGl1bWZvcmVzdGdyZWVuAG1lZGl1bWdvbGRlbnJvZABtZWRpdW13b29kAG1lZF9wdXJwbGUAbWljYQBuZW9uYmx1ZQBuZW9ucGluawBuZXdtaWRuaWdodGJsdWUAbmV3dGFuAG9sZGdvbGQAcXVhcnR6AHJpY2hibHVlAHNjYXJsZXQAc2VtaVN3ZWV0Q2hvYwBzaWx2ZXIAc3BpY3lwaW5rAHN1bW1lcnNreQB2ZXJ5ZGFya2Jyb3duAHZlcnlfbGlnaHRfcHVycGxlAHBvdgBwb3Y6cG92ACVzICVzCgAuXCIgACAlZCAlZAAgJXMKACAlZABmaWxsIABlbGxpcHNlIGF0dHJzJWQgJXN3aWQgJS41ZiBodCAlLjVmIGF0ICglLjVmLCUuNWYpOwoALmZ0ICVzCgAucHMgJWQqXG4oU0Z1LyUuMGZ1CgAiJXMiIGF0ICglLjVmLCUuNWYpOwoAJTAzbwAlcyVzIGlzIG5vdCBhIHRyb2ZmIGZvbnQKAGRvdCBwaWMgcGx1Z2luOiAAUgBdCi5QRQoALlBTICUuNWYgJS41ZgoAJXMgdG8gY2hhbmdlIGRyYXdpbmcgc2l6ZSwgbXVsdGlwbHkgdGhlIHdpZHRoIGFuZCBoZWlnaHQgb24gdGhlIC5QUyBsaW5lIGFib3ZlIGFuZCB0aGUgbnVtYmVyIG9uIHRoZSB0d28gbGluZXMgYmVsb3cgKHJvdW5kZWQgdG8gdGhlIG5lYXJlc3QgaW50ZWdlcikgYnkgYSBzY2FsZSBmYWN0b3IKAC5uciBTRiAlLjBmCnNjYWxldGhpY2tuZXNzID0gJS4wZgoAJXMgZG9uJ3QgY2hhbmdlIGFueXRoaW5nIGJlbG93IHRoaXMgbGluZSBpbiB0aGlzIGRyYXdpbmcKACVzIG5vbi1mYXRhbCBydW4tdGltZSBwaWMgdmVyc2lvbiBkZXRlcm1pbmF0aW9uLCB2ZXJzaW9uIDIKAGJveHJhZD0yLjAgJXMgd2lsbCBiZSByZXNldCB0byAwLjAgYnkgZ3BpYyBvbmx5CgBzY2FsZT0xLjAgJXMgcmVxdWlyZWQgZm9yIGNvbXBhcmlzb25zCgAlcyBib3hyYWQgaXMgbm93IDAuMCBpbiBncGljLCBlbHNlIGl0IHJlbWFpbnMgMi4wCgAlcyBkYXNod2lkIGlzIDAuMSBpbiAxMHRoIEVkaXRpb24sIDAuMDUgaW4gRFdCIDIgYW5kIGluIGdwaWMKACVzIGZpbGx2YWwgaXMgMC4zIGluIDEwdGggRWRpdGlvbiAoZmlsbCAwIG1lYW5zIGJsYWNrKSwgMC41IGluIGdwaWMgKGZpbGwgMCBtZWFucyB3aGl0ZSksIHVuZGVmaW5lZCBpbiBEV0IgMgoAJXMgZmlsbCBoYXMgbm8gbWVhbmluZyBpbiBEV0IgMiwgZ3BpYyBjYW4gdXNlIGZpbGwgb3IgZmlsbGVkLCAxMHRoIEVkaXRpb24gdXNlcyBmaWxsIG9ubHkKACVzIERXQiAyIGRvZXNuJ3QgdXNlIGZpbGwgYW5kIGRvZXNuJ3QgZGVmaW5lIGZpbGx2YWwKACVzIHJlc2V0IHdvcmtzIGluIGdwaWMgYW5kIDEwdGggZWRpdGlvbiwgYnV0IGlzbid0IGRlZmluZWQgaW4gRFdCIDIKACVzIERXQiAyIGNvbXBhdGliaWxpdHkgZGVmaW5pdGlvbnMKAGlmIGJveHJhZCA+IDEuMCAmJiBkYXNod2lkIDwgMC4wNzUgdGhlbiBYCglmaWxsdmFsID0gMTsKCWRlZmluZSBmaWxsIFkgWTsKCWRlZmluZSBzb2xpZCBZIFk7CglkZWZpbmUgcmVzZXQgWSBzY2FsZT0xLjAgWTsKWAoAcmVzZXQgJXMgc2V0IHRvIGtub3duIHN0YXRlCgAlcyBHTlUgcGljIHZzLiAxMHRoIEVkaXRpb24gZFwoZSd0ZW50ZQoAaWYgZmlsbHZhbCA+IDAuNCB0aGVuIFgKCWRlZmluZSBzZXRmaWxsdmFsIFkgZmlsbHZhbCA9IDEgLSBZOwoJZGVmaW5lIGJvbGQgWSB0aGlja25lc3MgMiBZOwoACSVzIGlmIHlvdSB1c2UgZ3BpYyBhbmQgaXQgYmFyZnMgb24gZW5jb3VudGVyaW5nICJzb2xpZCIsCgAJJXMJaW5zdGFsbCBhIG1vcmUgcmVjZW50IHZlcnNpb24gb2YgZ3BpYyBvciBzd2l0Y2ggdG8gRFdCIG9yIDEwdGggRWRpdGlvbiBwaWM7CgAJJXMJc29ycnksIHRoZSBncm9mZiBmb2xrcyBjaGFuZ2VkIGdwaWM7IHNlbmQgYW55IGNvbXBsYWludCB0byB0aGVtOwoAWCBlbHNlIFoKCWRlZmluZSBzZXRmaWxsdmFsIFkgZmlsbHZhbCA9IFk7CglkZWZpbmUgYm9sZCBZIFk7CglkZWZpbmUgZmlsbGVkIFkgZmlsbCBZOwpaCgAlcyBhcnJvd2hlYWQgaGFzIG5vIG1lYW5pbmcgaW4gRFdCIDIsIGFycm93aGVhZCA9IDcgbWFrZXMgZmlsbGVkIGFycm93aGVhZHMgaW4gZ3BpYyBhbmQgaW4gMTB0aCBFZGl0aW9uCgAlcyBhcnJvd2hlYWQgaXMgdW5kZWZpbmVkIGluIERXQiAyLCBpbml0aWFsbHkgMSBpbiBncGljLCAyIGluIDEwdGggRWRpdGlvbgoAYXJyb3doZWFkID0gNyAlcyBub3QgdXNlZCBieSBncmFwaHZpegoAJXMgR05VIHBpYyBzdXBwb3J0cyBhIGJveHJhZCB2YXJpYWJsZSB0byBkcmF3IGJveGVzIHdpdGggcm91bmRlZCBjb3JuZXJzOyBEV0IgYW5kIDEwdGggRWQuIGRvIG5vdAoAYm94cmFkID0gMCAlcyBubyByb3VuZGVkIGNvcm5lcnMgaW4gZ3JhcGh2aXoKACVzIEdOVSBwaWMgc3VwcG9ydHMgYSBsaW5ldGhpY2sgdmFyaWFibGUgdG8gc2V0IGxpbmUgdGhpY2tuZXNzOyBEV0IgYW5kIDEwdGggRWQuIGRvIG5vdAoAbGluZXRoaWNrID0gMDsgb2xkbGluZXRoaWNrID0gbGluZXRoaWNrCgAlcyAuUFMgdy9vIGFyZ3MgY2F1c2VzIEdOVSBwaWMgdG8gc2NhbGUgZHJhd2luZyB0byBmaXQgOC41eDExIHBhcGVyOyBEV0IgZG9lcyBub3QKACVzIG1heHBzaHQgYW5kIG1heHBzd2lkIGhhdmUgbm8gbWVhbmluZyBpbiBEV0IgMi4wLCBzZXQgcGFnZSBib3VuZGFyaWVzIGluIGdwaWMgYW5kIGluIDEwdGggRWRpdGlvbgoAJXMgbWF4cHNodCBhbmQgbWF4cHN3aWQgYXJlIHByZWRlZmluZWQgdG8gMTEuMCBhbmQgOC41IGluIGdwaWMKAG1heHBzaHQgPSAlZgptYXhwc3dpZCA9ICVmCgBEb3Q6IFsKAGRlZmluZSBhdHRyczAgJSUgJSU7IGRlZmluZSB1bmZpbGxlZCAlJSAlJTsgZGVmaW5lIHJvdW5kZWQgJSUgJSU7IGRlZmluZSBkaWFnb25hbHMgJSUgJSUKACVzJXMgdW5zdXBwb3J0ZWQKACVzIHJlc3RvcmUgcG9pbnQgc2l6ZSBhbmQgZm9udAoucHMgXG4oLlMKLmZ0IFxuKERGCgAlcyBDcmVhdG9yOiAlcyB2ZXJzaW9uICVzICglcykKACVzIFRpdGxlOiAlcwoAJXMgc2F2ZSBwb2ludCBzaXplIGFuZCBmb250Ci5uciAuUyBcbigucwoubnIgREYgXG4oLmYKAHBpYwBwaWM6cGljAHBuZzpzdmcAZ2lmOnN2ZwBqcGVnOnN2ZwBqcGU6c3ZnAGpwZzpzdmcAcG5nOmZpZwBnaWY6ZmlnAGpwZWc6ZmlnAGpwZTpmaWcAanBnOmZpZwBwbmc6dnJtbABnaWY6dnJtbABqcGVnOnZybWwAanBlOnZybWwAanBnOnZybWwAZXBzOnBzAHBzOnBzAChsaWIpOnBzAHBuZzptYXAAZ2lmOm1hcABqcGVnOm1hcABqcGU6bWFwAGpwZzptYXAAcHM6bWFwAGVwczptYXAAc3ZnOm1hcABwbmc6ZG90AGdpZjpkb3QAanBlZzpkb3QAanBlOmRvdABqcGc6ZG90AHBzOmRvdABlcHM6ZG90AHN2Zzpkb3QAcG5nOnhkb3QAZ2lmOnhkb3QAanBlZzp4ZG90AGpwZTp4ZG90AGpwZzp4ZG90AHBzOnhkb3QAZXBzOnhkb3QAc3ZnOnhkb3QAc3ZnOnN2ZwBwbmc6dm1sAGdpZjp2bWwAanBlZzp2bWwAanBlOnZtbABqcGc6dm1sAGdpZjp0awBpbWFnZSBjcmVhdGUgcGhvdG8gInBob3RvXyVzIiAtZmlsZSAiJXMiCgAkYyBjcmVhdGUgaW1hZ2UgJS4yZiAlLjJmIC1pbWFnZSAicGhvdG9fJXMiCgA8djppbWFnZSBzcmM9IiVzIiBzdHlsZT0iIHBvc2l0aW9uOmFic29sdXRlOyB3aWR0aDolLjJmOyBoZWlnaHQ6JS4yZjsgbGVmdDolLjJmIDsgdG9wOiUuMmYiACAvPgoAZ3Zsb2FkaW1hZ2VfY29yZS5jAGNvcmVfbG9hZGltYWdlX3BzbGliAFsgACVnICVnIABdICAlZCB0cnVlICVzCgBdICAlZCBmYWxzZSAlcwoAY29yZV9sb2FkaW1hZ2VfcHMAZ3NhdmUgJWcgJWcgdHJhbnNsYXRlIG5ld3BhdGgKAHVzZXJfc2hhcGVfJWQKAGdyZXN0b3JlCgBjb3JlX2xvYWRpbWFnZV92cm1sAFNoYXBlIHsKACAgYXBwZWFyYW5jZSBBcHBlYXJhbmNlIHsKACAgICBtYXRlcmlhbCBNYXRlcmlhbCB7CgAgICAgICBhbWJpZW50SW50ZW5zaXR5IDAuMzMKACAgICAgICAgZGlmZnVzZUNvbG9yIDEgMSAxCgAgICAgfQoAICAgIHRleHR1cmUgSW1hZ2VUZXh0dXJlIHsgdXJsICIlcyIgfQoAICB9CgBjb3JlX2xvYWRpbWFnZV9maWcAJWQgJWQgJWQgJWQgJWQgJWQgJWQgJWQgJWQgJS4xZiAlZCAlZCAlZCAlZCAlZCAlZAogJWQgJXMKACAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZAoAY29yZV9sb2FkaW1hZ2Vfc3ZnADxpbWFnZSB4bGluazpocmVmPSIAIiB3aWR0aD0iJWdweCIgaGVpZ2h0PSIlZ3B4IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiB4PSIlZyIgeT0iJWciACB0cmFuc2Zvcm09InJvdGF0ZSglZCAlZyAlZykiACIgd2lkdGg9IiVncHgiIGhlaWdodD0iJWdweCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pbllNaW4gbWVldCIgeD0iJWciIHk9IiVnIgAvPgoAZG90X2xheW91dABwaGFzZQBkb3QgZG9lcyBub3Qgc3VwcG9ydCB0aGUgYXNwZWN0IGF0dHJpYnV0ZSBmb3IgZGlzY29ubmVjdGVkIGdyYXBocyBvciBncmFwaHMgd2l0aCBjbHVzdGVycwoAY29tcG91bmQAdiA9PSBuAGRvdGluaXQuYwByZW1vdmVfZnJvbV9yYW5rAG9yZGVyAGVkZ2UgbGFiZWxzIHdpdGggc3BsaW5lcz1jdXJ2ZWQgbm90IHN1cHBvcnRlZCBpbiBkb3QgLSB1c2UgeGxhYmVscwoARURfbGFiZWwoZmUpAGRvdHNwbGluZXMuYwBfZG90X3NwbGluZXMAZmxhdCBlZGdlIGJldHdlZW4gYWRqYWNlbnQgbm9kZXMgb25lIG9mIHdoaWNoIGhhcyBhIHJlY29yZCBzaGFwZSAtIHJlcGxhY2UgcmVjb3JkcyB3aXRoIEhUTUwtbGlrZSBsYWJlbHMKACAgRWRnZSAlcyAlcyAlcwoAeHh4ADEwMDAwAHslc30AYXV4ZwBsYWJlbF9mbG9hdABmaXhlZAAobCA9IEVEX2xhYmVsKGZlKSkAc2V0RWRnZUxhYmVsUG9zAGUgIT0gTlVMTABmYXN0Z3IuYwBkZWxldGVfZmFzdF9lZGdlAG4gIT0gTkRfbmV4dChuKQBmYXN0X25vZGUAdSAhPSB2AGZhc3Rfbm9kZWFwcABORF9uZXh0KHYpID09IE5VTEwAZmluZF9mYXN0X25vZGUoZywgbikAZGVsZXRlX2Zhc3Rfbm9kZQBkZWxldGVfZmxhdF9lZGdlAG1lcmdlX29uZXdheSBnbGl0Y2gKAG1lcmdlX29uZXdheQBzYWZlX2RlbGV0ZV9mYXN0X2VkZ2UAbGcAY29tcABjbnQgPT0gc3oAbWluY3Jvc3MuYwBmaXhMYWJlbE9yZGVyAHJlbWluY3Jvc3MAbWluY3Jvc3MgJXM6ICVkIGNyb3NzaW5ncywgJS4yZiBzZWNzLgoAdgBuZWlnaGJvcgAocnYgPT0gMCkgfHwgKE5EX29yZGVyKHJ2KS1ORF9vcmRlcih2KSkqZGlyID4gMABjb25zdHJhaW5pbmdfZmxhdF9lZGdlKGcsdixlKSA9PSBGQUxTRQBmbGF0X3Jlb3JkZXIATkRfcmFuayh2KSA9PSByAHBvc3RvcmRlcgBmbGF0aW5kZXgoYWdoZWFkKGUpKSA8IE0tPm5yb3dzAGZsYXRfc2VhcmNoAGZsYXRpbmRleChhZ3RhaWwoZSkpIDwgTS0+bmNvbHMAb3V0AG9yZGVyaW5nICclcycgbm90IHJlY29nbml6ZWQuCgBvcmRlcmluZyAnJXMnIG5vdCByZWNvZ25pemVkIGZvciBub2RlICclcycuCgBtZXJnZTI6IGdyYXBoICVzLCByYW5rICVkIGhhcyBvbmx5ICVkIDwgJWQgbm9kZXMKAG1pbmNyb3NzOiBwYXNzICVkIGl0ZXIgJWQgdHJ5aW5nICVkIGN1cl9jcm9zcyAlZCBiZXN0X2Nyb3NzICVkCgBORF9vcmRlcih2KSA8IE5EX29yZGVyKHcpAGJhbGFuY2UAdHJhbnNwb3NlX3N0ZXAAc3VycHJpc2UKAGluc3RhbGxfaW5fcmFuaywgbGluZSAlZDogJXMgJXMgcmFuayAlZCBpID0gJWQgYW4gPSAwCgBHRF9yYW5rKGcpW3JdLm4gPD0gR0RfcmFuayhnKVtyXS5hbgBpbnN0YWxsX2luX3JhbmsAaW5zdGFsbF9pbl9yYW5rLCBsaW5lICVkOiBORF9vcmRlciglcykgWyVkXSA+IEdEX3JhbmsoUm9vdClbJWRdLmFuIFslZF0KAGluc3RhbGxfaW5fcmFuaywgbGluZSAlZDogcmFuayAlZCBub3QgaW4gcmFuayByYW5nZSBbJWQsJWRdCgBpbnN0YWxsX2luX3JhbmssIGxpbmUgJWQ6IEdEX3JhbmsoZylbJWRdLnYgKyBORF9vcmRlciglcykgWyVkXSA+IEdEX3JhbmsoZylbJWRdLmF2ICsgR0RfcmFuayhSb290KVslZF0uYW4gWyVkXQoAX25ld19yYW5rAG1jbGltaXQAcmFuayhnLCAyLCBuc2l0ZXIyKGcpKSA9PSAwAHBvc2l0aW9uLmMAZG90X3Bvc2l0aW9uAEFSPSUwLjRsZgkgQXJlYT0gJTAuNGxmCQBEdW1teT0lZAoAR29pbmcgdG8gYXBwbHkgYW5vdGhlciBleHBhbnNpb24uCgBuZXh0I2l0ZXI9JWQKAGhwAGNvbm5lY3RHcmFwaABFZGdlIGxlbmd0aCAlZiBsYXJnZXIgdGhhbiBtYXhpbXVtICV1IGFsbG93ZWQuCkNoZWNrIGZvciBvdmVyd2lkZSBub2RlKHMpLgoAbnNsaW1pdABjb250YWluX25vZGVzIGNsdXN0ICVzIHJhbmsgJWQgbWlzc2luZyBub2RlCgBuc2xpbWl0MQBuZXdyYW5rAE1heHJhbmsgPSAlZCwgbWlucmFuayA9ICVkCgBsZWFkZXIgIT0gTlVMTAByYW5rLmMAY2x1c3Rlcl9sZWFkZXIAKE5EX1VGX3NpemUobikgPD0gMSkgfHwgKG4gPT0gbGVhZGVyKQBhZ2hlYWQoZSkgPT0gVUZfZmluZChhZ2hlYWQoZSkpAG1pbm1heF9lZGdlcwBhZ3RhaWwoZSkgPT0gVUZfZmluZChhZ3RhaWwoZSkpAHJhbmsAc2FtZQBtaW4Ac291cmNlAG1heABzaW5rAGxldmVsIGFzc2lnbm1lbnQgY29uc3RyYWludHMAbGV2ZWwgZ3JhcGggcmVjAH9yb290AH90b3AAf2JvdABjb21wYWN0AF93ZWFrXyVkAHJhbmtpbmc6IGZhaWx1cmUgdG8gY3JlYXRlIHN0cm9uZyBjb25zdHJhaW50IGVkZ2UgYmV0d2VlbiBub2RlcyAlcyBhbmQgJXMKACVzIGhhcyB1bnJlY29nbml6ZWQgcmFuaz0lcwBsZXZlbCBlZGdlIHJlYwBsZXZlbCBub2RlIHJlYwBzYW1laGVhZABzYW1ldGFpbAB0b28gbWFueSAoPiAlZCkgc2FtZXtoZWFkLHRhaWx9IGdyb3VwcyBmb3Igbm9kZSAlcwoAY29tYmlBUiA9ICVsZgoAJWxmLCVkAHRoZSBhc3BlY3QgYXR0cmlidXRlIGhhcyBiZWVuIGRpc2FibGVkIGR1ZSB0byBpbXBsZW1lbnRhdGlvbiBmbGF3cyAtIGF0dHJpYnV0ZSBpZ25vcmVkLgoARURfdG9fdmlydChlKSA9PSBOVUxMAGNsYXNzMi5jAG1lcmdlX2NoYWluAEVEX3RvX3ZpcnQob3JpZykgPT0gTlVMTABtYWtlX2NoYWluAEVEX3RvX3ZpcnQob3JpZykgIT0gTlVMTABORF9yYW5rKGZyb20pIDwgTkRfcmFuayh0bykAY2x1c3Rlci5jAG1hcF9wYXRoACVzIHdhcyBhbHJlYWR5IGluIGEgcmFua3NldCwgZGVsZXRlZCBmcm9tIGNsdXN0ZXIgJXMKAGxoZWFkAGx0YWlsACVzIC0+ICVzOiBzcGxpbmUgc2l6ZSA+IDEgbm90IHN1cHBvcnRlZAoAJXMgLT4gJXM6IGhlYWQgbm90IGluc2lkZSBoZWFkIGNsdXN0ZXIgJXMKACVzIC0+ICVzOiB0YWlsIGlzIGluc2lkZSBoZWFkIGNsdXN0ZXIgJXMKAGJlei0+c2ZsYWcAY29tcG91bmQuYwBtYWtlQ29tcG91bmRFZGdlAGJlei0+ZWZsYWcAJXMgLT4gJXM6IHRhaWwgbm90IGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKACVzIC0+ICVzOiBoZWFkIGlzIGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKAHNlZ21lbnQgWyVzLCVzXSBkb2VzIG5vdCBpbnRlcnNlY3QgYm94IGxsPSVzLHVyPSVzCgBib3hJbnRlcnNlY3RmACglLjVnLCUuNWcpAGNsdXN0ZXIgbmFtZWQgJXMgbm90IGZvdW5kCgBjb25jZW50cmF0ZT10cnVlIG1heSBub3Qgd29yayBjb3JyZWN0bHkuCgByZWJ1aWx0ZF92bGlzdHM6IHJhbmsgbGVhZCAlcyBub3QgaW4gb3JkZXIgJWQgb2YgcmFuayAlZAoAZGVnZW5lcmF0ZSBjb25jZW50cmF0ZWQgcmFuayAlcywlZAoATkRfaW4ocmlnaHQpLnNpemUgKyBORF9vdXQocmlnaHQpLnNpemUgPT0gMABjb25jLmMAbWVyZ2V2aXJ0dWFsAGRvdDogT3V0IG9mIG1lbW9yeQoATkRfb3V0KHYpLnNpemUgPT0gMgBmbGF0LmMAc2V0Ym91bmRzAEdEX21pbnJhbmsoZykgPT0gMABhYm9taW5hdGlvbgBuZWF0b19sYXlvdXQAbmVhdG8AZmRwAHNmZHAAdHdvcGkAY2lyY28AcGF0Y2h3b3JrAG9zYWdlAG5vcABub3AxAG5vcDIAJWxmLCVsZiwlbGYlYwBub2RlICVzLCBwb3NpdGlvbiAlcywgZXhwZWN0ZWQgdHdvIGRvdWJsZXMKAG5vdHJhbnNsYXRlAG5vZGUgJXMgaW4gZ3JhcGggJXMgaGFzIG5vIHBvc2l0aW9uCgBzLCVsZiwlbGYlbgAgZSwlbGYsJWxmJW4AcG9zIGF0dHJpYnV0ZSBmb3IgZWRnZSAoJXMsJXMpIGRvZXNuJ3QgaGF2ZSAzbisxIHBvaW50cwoAJWxmLCVsZiVuAHN5bnRheCBlcnJvciBpbiBwb3MgYXR0cmlidXRlIGZvciBlZGdlICglcywlcykKACVsZiwlbGYsJWxmLCVsZgBzdGFydABzZWxmAHJhbmRvbQBub2RlIHBvc2l0aW9ucyBhcmUgaWdub3JlZCB1bmxlc3Mgc3RhcnQ9cmFuZG9tCgBhcyByZXF1aXJlZCBieSB0aGUgLW4gZmxhZwoAX25lYXRvX2NjAGdyYXBoICVzIGlzIGRpc2Nvbm5lY3RlZC4gSGVuY2UsIHRoZSBjaXJjdWl0IG1vZGVsCgBBbHRlcm5hdGl2ZWx5LCBjb25zaWRlciBydW5uaW5nIG5lYXRvIHVzaW5nIC1HcGFjaz10cnVlIG9yIGRlY29tcG9zaW5nCgB0aGUgZ3JhcGggaW50byBjb25uZWN0ZWQgY29tcG9uZW50cy4KAFNvbHZpbmcgbW9kZWwgJWQgaXRlcmF0aW9ucyAlZCB0b2wgJWYKAE5EX2lkKG5wKSA9PSBpAG5lYXRvaW5pdC5jAG1ha2VHcmFwaERhdGEAZiA8IGdyYXBoW2pdLm5lZGdlcwBkZnNDeWNsZQBtb2RlbCAlZCBzbWFydF9pbml0ICVkIHN0cmVzc3d0ICVkIGl0ZXJhdGlvbnMgJWQgdG9sICVmCgBjb252ZXJ0IGdyYXBoOiAAbWFqb3JpemF0aW9uCgAlZCBub2RlcyAlLjJmIHNlYwoAbGV2ZWxzZ2FwAGxheW91dCBhYm9ydGVkCgBzdHJlc3N3dAAlcyBhdHRyaWJ1dGUgdmFsdWUgbXVzdCBiZSAxIG9yIDIgLSBpZ25vcmluZwoAbW9kZWwAY2lyY3VpdABzdWJzZXQAc2hvcnRwYXRoAG1kcwBlZGdlcyBpbiBncmFwaCAlcyBoYXZlIG5vIGxlbiBhdHRyaWJ1dGUuIEhlbmNlLCB0aGUgbWRzIG1vZGVsCgBpcyBpbmFwcHJvcHJpYXRlLiBSZXZlcnRpbmcgdG8gdGhlIHNob3J0ZXN0IHBhdGggbW9kZWwuCgBVbmtub3duIHZhbHVlICVzIGZvciBhdHRyaWJ1dGUgIm1vZGVsIiBpbiBncmFwaCAlcyAtIGlnbm9yZWQKAG1vZGUAS0sAbWFqb3IAaGllcgBJbGxlZ2FsIHZhbHVlICVzIGZvciBhdHRyaWJ1dGUgIm1vZGUiIGluIGdyYXBoICVzIC0gaWdub3JlZAoAbWFrZVNwbGluZTogZmFpbGVkIHRvIG1ha2Ugc3BsaW5lIGVkZ2UgKCVzLCVzKQoAc3BsaW5lICVzICVzCgBiID09IG4AbmVhdG9zcGxpbmVzLmMAbWFrZV9iYXJyaWVycwB0aGUgYm91bmRpbmcgYm94ZXMgb2Ygc29tZSBub2RlcyB0b3VjaCAtIGZhbGxpbmcgYmFjayB0byBzdHJhaWdodCBsaW5lIGVkZ2VzCgBzb21lIG5vZGVzIHdpdGggbWFyZ2luICglLjAyZiwlLjAyZikgdG91Y2ggLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAcG9seWxpbmVzAGxpbmUgc2VnbWVudHMAb3J0aG9nb25hbCBsaW5lcwBDcmVhdGluZyBlZGdlcyB1c2luZyAlcwoAcG9seWxpbmUgJXMgJXMKAG1kc01vZGVsOiBkZWx0YSA9ICVmCgBTZXR0aW5nIHVwIHN0cmVzcyBmdW5jdGlvbgBTb2x2aW5nIG1vZGVsOiAACmZpbmFsIGUgPSAlZiAlZCBpdGVyYXRpb25zICUuMmYgc2VjCgBEYW1waW5nAGRlZmF1bHRkaXN0ACBpbiAlcyAtIHNldHRpbmcgdG8gJS4wMmYKAGJhZCBlZGdlIGxlbiAiJXMiAFNldHRpbmcgaW5pdGlhbCBwb3NpdGlvbnMKAHN0YXJ0PSVzIG5vdCBzdXBwb3J0ZWQgd2l0aCBtb2RlPXNlbGYgLSBpZ25vcmVkCgBTZXR0aW5nIHVwIHNwcmluZyBtb2RlbDogACUuMmYgc2VjCgAKZmluYWwgZSA9ICVmACEAICVkJXMgaXRlcmF0aW9ucyAlLjJmIHNlYwoATWF4LiBpdGVyYXRpb25zICglZCkgcmVhY2hlZCBvbiBncmFwaCAlcwoAJXMgJS4zZgoAJS4zZiAATkRfaGVhcGluZGV4KHYpIDwgMABzdHVmZi5jAG5lYXRvX2VucXVldWUAQ2FsY3VsYXRpbmcgc2hvcnRlc3QgcGF0aHM6IABzcGVjaWZpZWQgcm9vdCBub2RlICIlcyIgd2FzIG5vdCBmb3VuZC4AVXNpbmcgZGVmYXVsdCBjYWxjdWxhdGlvbiBmb3Igcm9vdCBub2RlCgByZXBvc2l0aW9uICVzCgAlcyA6ICVmICVmCgAlcyA6ICVmICVmICVmICVmCgAgIABHcmFwaCAlcyBoYXMgYXJyYXkgcGFja2luZyB3aXRoIHVzZXIgdmFsdWVzIGJ1dCBubyAic29ydHYiIGF0dHJpYnV0ZXMgYXJlIGRlZmluZWQuAHBpbgBXYXJuaW5nOiBub2RlICVzLCBwb3NpdGlvbiAlcywgZXhwZWN0ZWQgdHdvIGZsb2F0cwoAY29vcmRzAGxheW91dCAlcwoAZW5kICVzCgBpZHggPT0gc3oAbGF5b3V0LmMAZXhwYW5kQ2x1c3RlcgBpID09IGRlZwBnZXRFZGdlTGlzdABfZGdfJWQAZGVyaXZlIGdyYXBoICVzIG9mICVzCgBub2RlICIlcyIgaXMgY29udGFpbmVkIGluIHR3byBub24tY29tcGFyYWJsZSBjbHVzdGVycyAiJXMiIGFuZCAiJXMiCgBfcG9ydF8lc18lc18lc18lbGQAX3BvcnRfJXNfKCVkKV8oJWQpXyVsZAAlbGYsJWxmLCVsZiwlbGYlYwBncmFwaCAlcywgY29vcmQgJXMsIGV4cGVjdGVkIGZvdXIgZG91YmxlcwoAc3BsaW5lcyBhbmQgY2x1c3RlciBlZGdlcyBub3Qgc3VwcG9ydGVkIC0gdXNpbmcgbGluZSBzZWdtZW50cwoAbWF4aXRlcgBUMABmZHAgZG9lcyBub3Qgc3VwcG9ydCBzdGFydD1zZWxmIC0gaWdub3JpbmcKAHhMYXlvdXQgADk6cHJpc20AdHJpZXMgPSAlZCwgbW9kZSA9ICVzCgBkZXJpdmVkAGluZm8Ac2ZkcCBvbmx5IHN1cHBvcnRzIHN0YXJ0PXJhbmRvbQoASwByZXB1bHNpdmVmb3JjZQBsZXZlbHMAc21vb3RoaW5nAHF1YWR0cmVlAGJlYXV0aWZ5AG92ZXJsYXBfc2hyaW5rAHJvdGF0aW9uAGxhYmVsX3NjaGVtZQBsYWJlbF9zY2hlbWUgPSAlZCA+IDQgOiBpZ25vcmluZwoAZmFzdABhdmdfZGlzdABncmFwaF9kaXN0AHBvd2VyX2Rpc3QAc3ByaW5nAGRpbWVuAGRpbQBzcHJpbmdfZWxlY3RyaWNhbF9jb250cm9sOgoAICByZXB1bHNpdmUgYW5kIGF0dHJhY3RpdmUgZXhwb25lbnRzOiAlLjAzZiAlLjAzZgoAICByYW5kb20gc3RhcnQgJWQgc2VlZCAlZAoAICBLIDogJS4wM2YgQyA6ICUuMDNmCgAgIG1heCBsZXZlbHMgJWQgY29hcnNlbl9zY2hlbWUgJWQgY29hcnNlbl9ub2RlICVkCgAgIHF1YWR0cmVlIHNpemUgJWQgbWF4X2xldmVsICVkCgAgIEJhcm5lcy1IdXR0IGNvbnN0YW50ICUuMDNmIHRvbGVyYW5jZSAgJS4wM2YgbWF4aXRlciAlZAoAICBjb29saW5nICUuMDNmIHN0ZXAgc2l6ZSAgJS4wM2YgYWRhcHRpdmUgJWQKACAgYmVhdXRpZnlfbGVhdmVzICVkIG5vZGUgd2VpZ2h0cyAlZCByb3RhdGlvbiAlLjAzZgoAICBzbW9vdGhpbmcgJXMgb3ZlcmxhcCAlZCBpbml0aWFsX3NjYWxpbmcgJS4wM2YgZG9fc2hyaW5raW5nICVkCgAgIG9jdHJlZSBzY2hlbWUgJXMgbWV0aG9kICVzCgAgIGVkZ2VfbGFiZWxpbmdfc2NoZW1lICVkCgBTUFJJTkdfRUxFQ1RSSUNBTABTUFJJTkdfTUFYRU5UAFNUUkVTU19NQVhFTlQAU1RSRVNTX0FQUFJPWABTVFJFU1MAVU5JRk9STV9TVFJFU1MARlVMTF9TVFJFU1MATk9ORQBOT1JNQUwARkFTVABIWUJSSUQAU1RSRVNTX01BSk9SSVpBVElPTl9HUkFQSF9ESVNUAFNUUkVTU19NQUpPUklaQVRJT05fQVZHX0RJU1QAU1RSRVNTX01BSk9SSVpBVElPTl9QT1dFUl9ESVNUAFNQUklORwBUUklBTkdMRQBSTkcADSAgICAgICAgICAgICAgICBpdGVyID0gJWQsIHN0ZXAgPSAlZiBGbm9ybSA9ICVmIG56ID0gJWQgIEsgPSAlZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAc3ByaW5nX2VsZWN0cmljYWxfZW1iZWRkaW5nX3Nsb3cAZG1lYW4gPSAlZiwgcmhvID0gJWYKAHNlbmQgcmFuZG9tIGNvb3JkaW5hdGVzCgBzY2FsaW5nIGZhY3RvciA9ICVmCgBRVUFEX1RSRUVfSFlCUklELCBzaXplIGxhcmdlciB0aGFuICVkLCBzd2l0Y2ggdG8gZmFzdCBxdWFkdHJlZQBjdHJsLT5vdmVybGFwPSVkCgAlZCAlZAoAdW5pZm9ybV9zdHJlc3MuYwBVbmlmb3JtU3RyZXNzU21vb3RoZXJfbmV3AFNwYXJzZU1hdHJpeF9pc19zeW1tZXRyaWMoQiwgRkFMU0UpAHVuaWZvcm1fc3RyZXNzAHxlZGdlbGFiZWx8AGxlbgBub3JtYWxpemUAb3ZlcmxhcABPdmVybGFwIHZhbHVlICIlcyIgdW5zdXBwb3J0ZWQgLSBpZ25vcmVkCgBVbnJlY29nbml6ZWQgb3ZlcmxhcCB2YWx1ZSAiJXMiIC0gdXNpbmcgZmFsc2UKAFZvcm9ub2kAb3ZlcmxhcDogJXMgdmFsdWUgJWQgc2NhbGluZyAlLjA0ZgoAb3ZlcmxhcF9zY2FsaW5nAHZvcm9ub2kAc2NhbGluZwB2cHNjAGlwc2VwAG9zY2FsZQBvbGQgc2NhbGluZwBzY2FsZXh5AHggYW5kIHkgc2NhbGluZwBvcnRobwBvcnRob2dvbmFsIGNvbnN0cmFpbnRzAG9ydGhvX3l4AG9ydGhveHkAeHkgb3J0aG9nb25hbCBjb25zdHJhaW50cwBvcnRob3l4AHl4IG9ydGhvZ29uYWwgY29uc3RyYWludHMAcG9ydGhvAHBzZXVkby1vcnRob2dvbmFsIGNvbnN0cmFpbnRzAHBvcnRob195eABwb3J0aG94eQB4eSBwc2V1ZG8tb3J0aG9nb25hbCBjb25zdHJhaW50cwBwb3J0aG95eAB5eCBwc2V1ZG8tb3J0aG9nb25hbCBjb25zdHJhaW50cwBwcmlzbQBBZGp1c3RpbmcgJXMgdXNpbmcgJXMKAFVuaGFuZGxlZCBhZGp1c3Qgb3B0aW9uICVzCgBOdW1iZXIgb2YgaXRlcmF0aW9ucyA9ICVkCgBOdW1iZXIgb2YgaW5jcmVhc2VzID0gJWQKAG92ZXJsYXAgWyVkXSA6ICVkCgB2b3JvX21hcmdpbgBzZXAAZXNlcABOb2RlIHNlcGFyYXRpb246IGFkZD0lZCAoJWYsJWYpCgAlZiwlZgBzY2FsZSA9ICglLjAzZiwlLjAzZikKAEVkZ2Ugc2VwYXJhdGlvbjogYWRkPSVkICglZiwlZikKAENhbGN1bGF0aW5nIGNpcmN1aXQgbW9kZWwAY29uanVnYXRlX2dyYWRpZW50OiB1bmV4cGVjdGVkIGxlbmd0aCAwIHZlY3RvcgoAQ2FsY3VsYXRpbmcgc3Vic2V0IG1vZGVsAGdyYXBoIGlzIGRpc2Nvbm5lY3RlZC4gSGVuY2UsIHRoZSBjaXJjdWl0IG1vZGVsCgBpcyB1bmRlZmluZWQuIFJldmVydGluZyB0byB0aGUgc2hvcnRlc3QgcGF0aCBtb2RlbC4KAENhbGN1bGF0aW5nIE1EUyBtb2RlbABDYWxjdWxhdGluZyBzaG9ydGVzdCBwYXRocwA6ICUuMmYgc2VjCgBTZXR0aW5nIGluaXRpYWwgcG9zaXRpb25zADogJS4yZiBzZWMAY2cAZGVsdGEgPD0gMHhGRkZGAGNvbnN0cmFpbnQuYwBta05Db25zdHJhaW50RwB2ZwBjb21wcmVzcyAlZyAKAHNjYWxlIGJ5ICVnLCVnIAoAYmVzdGNvc3QgPCBIVUdFX1ZBTABjb21wdXRlU2NhbGVYWQBHcmFwaHZpeiBidWlsdCB3aXRob3V0IGFueSB0cmlhbmd1bGF0aW9uIGxpYnJhcnkKAGRlbGF1bmF5X3RyaWFuZ3VsYXRpb246ICVzCgBkZWxhdW5heV90cmk6ICVzCgB0cnlpbmcgdG8gZGVsZXRlIGEgbm9uLWxpbmUKAAppbnRlcnNlY3Rpb24gYXQgJS4zZiAlLjNmCgBzZWcjJWQgOiAoJS4zZiwgJS4zZikgKCUuM2YsICUuM2YpCgByZW1vdmVfb3ZlcmxhcDogR3JhcGh2aXogbm90IGJ1aWx0IHdpdGggdHJpYW5ndWxhdGlvbiBsaWJyYXJ5CgBtYWtlQWRkUG9seTogdW5rbm93biBzaGFwZSB0eXBlICVzCgBtYWtlUG9seTogdW5rbm93biBzaGFwZSB0eXBlICVzCgB4IT1OVUxMAHNtYXJ0X2luaV94LmMASU1EU19naXZlbl9kaW0AaWxsLWNvbmRpdGlvbmVkAHJvb3QgPSAlcyBtYXggc3RlcHMgdG8gcm9vdCA9ICVkCgB0d29waTogdXNlIG9mIHdlaWdodD0wIGNyZWF0ZXMgZGlzY29ubmVjdGVkIGNvbXBvbmVudC4KAFJhbmsgc2VwYXJhdGlvbiA9IAAlLjAzbGYgAGFyZWEAaW5zZXQAJXMgY29vcmQgJS41ZyAlLjVnIGh0ICVmIHdpZHRoICVmCgAlLjAzZgByZWMgJWYgJWYgJWYgJWYKACVmIC0gJWYgJWYgJWYgJWYgPSAlZiAoJWYgJWYgJWYgJWYpCgB0cnlpbmcgdG8gYWRkIHRvIHJlY3QgeyVmICsvLSAlZiwgJWYgKy8tICVmfQoAdG90YWwgYWRkZWQgc28gZmFyID0gJWQKAGFkZGluZyAlZCBpdGVtcywgdG90YWwgYXJlYSA9ICVmLCB3ID0gJWYsIGFyZWEvdz0lZgoAY29tcG91bmRFZGdlczogY291bGQgbm90IGNvbnN0cnVjdCBvYnN0YWNsZXMgLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAY29tcG91bmRFZGdlczogbm9kZXMgdG91Y2ggLSBmYWxsaW5nIGJhY2sgdG8gc3RyYWlnaHQgbGluZSBlZGdlcwoAcGFjayB2YWx1ZSAlZCBpcyBzbWFsbGVyIHRoYW4gZXNlcCAoJS4wM2YsJS4wM2YpCgBzZXAgdmFsdWUgKCUuMDNmLCUuMDNmKSBpcyBzbWFsbGVyIHRoYW4gZXNlcCAoJS4wM2YsJS4wM2YpCgBjYyVzXyVkAGNjJXMrJWQAY19jbnQgPT0gMABjb21wLmMAZmluZENDb21wAGdyaWQoJWQsJWQpOiAlcwoAd2d0ID4gMABRdWFkVHJlZS5jAFF1YWRUcmVlX3JlcHVsc2l2ZV9mb3JjZV9hY2N1bXVsYXRlAHF0Mi0+biA+IDAAcXQxLT5uID4gMCAmJiBxdDItPm4gPiAwAFF1YWRUcmVlX3JlcHVsc2l2ZV9mb3JjZV9pbnRlcmFjdABkaXN0ID4gMAAhKHEtPmwpAFF1YWRUcmVlX2FkZF9pbnRlcm5hbABpaSA8IDE8PGRpbSAmJiBpaSA+PSAwAHEtPnF0c1tpaV0AcS0+biA9PSAxACEocS0+cXRzKQBxLT5sAHdpZHRoID4gMABRdWFkVHJlZV9uZXcAQS0+Zm9ybWF0ID09IEZPUk1BVF9DU1IAU3BhcnNlTWF0cml4LmMAU3BhcnNlTWF0cml4X3RyYW5zcG9zZQBBICYmIEIAU3BhcnNlTWF0cml4X2FkZABBLT5mb3JtYXQgPT0gQi0+Zm9ybWF0ICYmIEEtPmZvcm1hdCA9PSBGT1JNQVRfQ1NSAEEtPnR5cGUgPT0gQi0+dHlwZQBTcGFyc2VNYXRyaXhfaXNfc3ltbWV0cmljAEEtPmZvcm1hdCA9PSBGT1JNQVRfQ09PUkQAU3BhcnNlTWF0cml4X2Zyb21fY29vcmRpbmF0ZV9mb3JtYXQAbSA+IDAgJiYgbiA+IDAgJiYgbnogPj0gMABTcGFyc2VNYXRyaXhfZnJvbV9jb29yZGluYXRlX2FycmF5c19pbnRlcm5hbABBAGphW21hc2tbamFbal1dXSA9PSBqYVtqXQBTcGFyc2VNYXRyaXhfc3VtX3JlcGVhdF9lbnRyaWVzAGlkIDwgbiooeW1heC15bWluKzEpAGphW21hc2tbaWRdXSA9PSBqYVtqXQBTcGFyc2VNYXRyaXhfbXVsdGlwbHlfZGVuc2UyAEEtPnR5cGUgPT0gTUFUUklYX1RZUEVfUkVBTABTcGFyc2VNYXRyaXhfbXVsdGlwbHlfdmVjdG9yAEEtPnR5cGUgPT0gTUFUUklYX1RZUEVfUkVBTCB8fCBBLT50eXBlID09IE1BVFJJWF9UWVBFX0lOVEVHRVIAU3BhcnNlTWF0cml4X211bHRpcGx5X2RlbnNlMQBTcGFyc2VNYXRyaXhfbXVsdGlwbHkAamNbbWFza1tqYltrXV1dID09IGpiW2tdAFNwYXJzZU1hdHJpeF9tdWx0aXBseTMAamRbbWFza1tqY1trXV1dID09IGpjW2tdAFNwYXJzZU1hdHJpeF9jb29yZGluYXRlX2Zvcm1fYWRkX2VudHJpZXMAU3BhcnNlTWF0cml4X2RpdmlkZV9yb3dfYnlfZGVncmVlAG4gPiAxAGdlbmVyYWwuYwBpcmFuZABvbmVibG9jawBtaW5kaXN0AGFydGljdWxhdGlvbl9wb3MAcm9vdABQcmlvcml0eVF1ZXVlLmMAUHJpb3JpdHlRdWV1ZV9wdXNoAGdhaW4gPD0gcS0+bmdhaW4AU3BhcnNlTWF0cml4X2lzX3N5bW1ldHJpYyhBLCBGQUxTRSkAcG9zdF9wcm9jZXNzLmMAaWRlYWxfZGlzdGFuY2VfbWF0cml4AGxlbiA+IDAAU3RyZXNzTWFqb3JpemF0aW9uU21vb3RoZXIyX25ldwBueiA+IDAAaWRlYWxfZGlzdF9zY2hlbWUgdmFsdWUgd3JvbmcAU3BhcnNlTWF0cml4X2lzX3N5bW1ldHJpYyhBLCBGQUxTRSkgJiYgQS0+dHlwZSA9PSBNQVRSSVhfVFlQRV9SRUFMAFNwYXJzZVN0cmVzc01ham9yaXphdGlvblNtb290aGVyX25ldwBpZGlhZyA+PSAwAFN0cmVzc01ham9yaXphdGlvblNtb290aGVyX3Ntb290aAAoIWpjbikgJiYgKCF2YWwpAGdldF9lZGdlX2xhYmVsX21hdHJpeABUcmlhbmdsZVNtb290aGVyX25ldwBqZGlhZyA+PSAwAFNwcmluZ1Ntb290aGVyX25ldwAhZmxhZwBTcHJpbmdTbW9vdGhlcl9zbW9vdGgAbmVpZ2hiPSVkCgByb290ID0gJXMKAF9ibG9ja18lZABzLT5zeiA+IDAAYmxvY2t0cmVlLmMAcG9wAGFjdHVhbABub2RlbGlzdC5jAGluc2VydE5vZGVsaXN0AF9zcGFuXyVkAF9jbG9uZV8lZABpcABkZWdsaXN0LmMAcmVtb3ZlRGVnbGlzdABFcnJvcgBXYXJuaW5nACVzOiAAdXNlcm91dDogY291bGQgbm90IGFsbG9jYXRlIG1lbW9yeQoAX0FHX3N0cmRhdGEAX0FHX2RhdGFkaWN0AGFnZGljdG9mOiB1bmtub3duIGtpbmQgJWQKACVjJWxkAG1lbW9yeSBhbGxvY2F0aW9uIGZhaWx1cmUAYWdkZWxldGUgb24gd3JvbmcgZ3JhcGgAX0FHX3BlbmRpbmcAYWdyZWNvcmRfY2FsbGJhY2sgb2YgYSBiYWQgb2JqZWN0AHBlbmQgZGljdG9mIGEgYmFkIG9iamVjdABtb3ZlIHRvIGZyb250IGxvY2sgaW5jb25zaXN0ZW5jeQBcXABmYXRhbCBmbGV4IHNjYW5uZXIgaW50ZXJuYWwgZXJyb3ItLW5vIGFjdGlvbiBmb3VuZAAlcwoAZmF0YWwgZmxleCBzY2FubmVyIGludGVybmFsIGVycm9yLS1lbmQgb2YgYnVmZmVyIG1pc3NlZABmYXRhbCBlcnJvciAtIHNjYW5uZXIgaW5wdXQgYnVmZmVyIG92ZXJmbG93AG91dCBvZiBkeW5hbWljIG1lbW9yeSBpbiBhYWdfZ2V0X25leHRfYnVmZmVyKCkAaW5wdXQAc3ludGF4IGFtYmlndWl0eSAtIGJhZGx5IGRlbGltaXRlZCBudW1iZXIgJwAnIGluIGxpbmUgJWQgb2YgACBzcGxpdHMgaW50byB0d28gdG9rZW5zCgAlcwBsaW5lACVkICUxWyJdJW4Ab3V0IG9mIGR5bmFtaWMgbWVtb3J5IGluIGFhZ19jcmVhdGVfYnVmZmVyKCkAb3V0IG9mIGR5bmFtaWMgbWVtb3J5IGluIGFhZ2Vuc3VyZV9idWZmZXJfc3RhY2soKQA6IAAgaW4gbGluZSAlZAAgbmVhciAnACBzY2FubmluZyBhIHF1b3RlZCBzdHJpbmcgKG1pc3NpbmcgZW5kcXVvdGU/IGxvbmdlciB0aGFuICVkPykAClN0cmluZyBzdGFydGluZzoiACBzY2FubmluZyBhIEhUTUwgc3RyaW5nIChtaXNzaW5nICc+Jz8gYmFkIG5lc3Rpbmc/IGxvbmdlciB0aGFuICVkPykAClN0cmluZyBzdGFydGluZzo8ACBzY2FubmluZyBhIC8qLi4uKi8gY29tbWVudCAobWlzc2luZyAnKi8/IGxvbmdlciB0aGFuICVkPykAZmxleCBzY2FubmVyIHB1c2gtYmFjayBvdmVyZmxvdwAiIgBzdHJpY3QAbGluZWxlbmd0aAA7CgAgW2tleT0AXQAgWwAsCgA9AF8lbGRfU1VTUEVDVABkaQBzdHJpY3QgAHsKAF07CgAS7u4UCQPu/u7u7gHu7u4B7u4K/u4TGRXuEwHu7u7uCxHu7u7u7u7u7u4B7u4WCQEBHQ8X7u4aFxvu7hzu7u7uARn77u7uAe4Q7u4e7u7u7gACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXEQICAgICAgICAgICAgISEAITAgIWAgICAgICAgICAgICAgICAgICAgICAgICAgIUAhUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg4CDwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBAgMEBQYHCAkKCwwNCwMEBQ8HAwwNBgwNDgwNGhUWAAEAAwcOBg8IDA0SEyoQEQkQLzARMhcTDRQSLhIUQRMyEyxAKkIZLEJGIgwNDiMPCRARChARyRARLUVG/AEG9g8H9iQCEBEvMDZNTigmOzwqNjE5PT8vOkDYRDA+JTdDNUsrOElMAAMJAAAAAQ4CCwwIIyQlNjs9AA0QEhsWHBInMiIXMx48Bgc1BQ8RFBgpABMpAAAAAAA3FSgdHgAhJjQfMD4ZLAAbACAaKgArOi4vADE4OS0AAgIBAAMDAQABAAEBAQACAQEAAgIDAQEAAAUAAQMBAwUDAQEBAQIAAQAEAgACAQEDAgEAAwIBAAEBAAEBAQMAGBkZGRobHBwdHR4eHx8gICEhIiIjJCQmJyUlKCgpKSkqKisrKywsLS0uLy8wMTEyMzQ2NTc3Nzg4ODk5Ojru7v/u7u7u7u4fIO4A7+7u7gzu7u4IDe7u7vju7u7u7u717v8DCAQhBQsSEycUFRYpMkEXGBkaLDM0QkdIG0ocHS4eTx8ga2V5AGF0dHJpYnV0ZSBtYWNyb3Mgbm90IGltcGxlbWVudGVkACVzOiVzAENvdWxkIG5vdCBvcGVuICIlcyIgZm9yIHdyaXRpbmcgOiAlcwoATm8gbGlieiBzdXBwb3J0LgoALiVkAG5vbmFtZS5ndgBndndyaXRlX25vX3ogcHJvYmxlbSAlZAoAbWVtb3J5IGFsbG9jYXRpb24gZmFpbHVyZQoATm8gbGlieiBzdXBwb3J0CgBndnByaW50ZjogJXMKAC05OTk5OTk5OTk5OTk5OTkuOTkAZ3JhcGh2aXoAMi40MC4xADIwMTYxMjI1LjAzMDQAcmVuZGVyAGRldmljZQBsb2FkaW1hZ2UAZHluYW1pYyBsb2FkaW5nIG5vdCBhdmFpbGFibGUKAFVzaW5nICVzOiAlczolcwoAZ3Z1c2Vyc2hhcGUuYwBndnVzZXJzaGFwZV9maW5kAGd2dXNlcnNoYXBlX2ZpbGVfYWNjZXNzAEZpbGVuYW1lICIlcyIgaXMgdW5zYWZlCgAlcyB3aGlsZSBvcGVuaW5nICVzCgB1cy0+ZgBndnVzZXJzaGFwZV9vcGVuACIlcyIgd2FzIG5vdCBmb3VuZCBhcyBhIGZpbGUgb3IgYXMgYSBzaGFwZSBsaWJyYXJ5IG1lbWJlcgoAL01lZGlhQm94AChbYS16XVthLXpBLVpdKik9IihbXiJdKikiAGNhbm5vdCBjb21waWxlIHJlZ3VsYXIgZXhwcmVzc2lvbiAlcwAlbGYlMnMAcHQAdmlld0JveAAlbGYgJWxmICVsZiAlbGYAaW4AcHgAcGMAIgBjbQBtbQAlJUJvdW5kaW5nQm94OgAB0NHS09TV1tfY2QA8c3ZnAFdFQlAAd2VicAAobGliKQCJUE5HDQoaCgBwbmcAJSFQUy1BZG9iZS0AQk0AYm1wAEdJRjgAZ2lmAP/Y/+AAanBlZwAlUERGLQBwZGYAxdDTxgBlcHMAPD94bWwAeG1sAFJJRkYAcmlmZgAAAAEAAGljbwAlZCAlZCAlZCAlZABMYXlvdXQgd2FzIG5vdCBkb25lCgBmYWlsdXJlIG1hbGxvYydpbmcgZm9yIHJlc3VsdCBzdHJpbmcAZ2M6IE91dCBvZiBtZW1vcnkKAF9jY18Ab3JpZwBvcABjY29tcHMuYwBtYXBDbHVzdABjY2dyYXBoaW5mbwBjY2dub2RlaW5mbwAoJTRsZCkgJTdsZCBub2RlcyAlN2xkIGVkZ2VzCgAgICAgICAgJTdkIG5vZGVzICU3ZCBlZGdlcyAlN2xkIGNvbXBvbmVudHMgJXMKAGRnAEVycm9yOiBub2RlICIlcyIgYmVsb25ncyB0byB0d28gbm9uLW5lc3RlZCBjbHVzdGVycyAiJXMiIGFuZCAiJXMiCgBzb3J0dgByb3cgbWFqb3IAY29sdW1uIG1ham9yAGFycmF5IHBhY2tpbmc6ICVzICVkIHJvd3MgJWQgY29sdW1ucwoAYmJbJXNdICUuNWcgJS41ZyAlLjVnICUuNWcKAHN0ZXAgc2l6ZSA9ICVkCgBwb3NbJWRdICVkICVkCgBjYyAoJWQgY2VsbHMpIGF0ICglZCwlZCkgKCVkLCVkKQoAY2MgKCVkIGNlbGxzKSBhdCAoJWQsJWQpCgAlcyBuby4gY2VsbHMgJWQgVyAlZCBIICVkCgAgICVkICVkIGNlbGwKAGxpYnBhY2s6IGRpc2MgPSAlZiAoIDwgMCkKAFBhY2tpbmc6IGNvbXB1dGUgZ3JpZCBzaXplCgBhICVmIGIgJWYgYyAlZiBkICVmIHIgJWYKAHJvb3QgJWQgKCVmKSAlZCAoJWYpCgAgcjEgJWYgcjIgJWYKAHBpbmZvAHBhY2suYwBnZXRQYWNrSW5mbwAgIG1hcmdpbiAlZAoAcGFja21vZGUAcGFyc2VQYWNrTW9kZUluZm8AYXJyYXkAYXNwZWN0ACVmAHBhY2sgaW5mbzoKACAgbW9kZSAgICVzCgAgIGFzcGVjdCAlZgoAICBzaXplICAgJWQKACAgZmxhZ3MgICVkCgB1bmRlZmluZWQAcGFjawBBcnJvdyB0eXBlICIlcyIgdW5rbm93biAtIGlnbm9yaW5nCgBub3JtYWwAY3JvdwB0ZWUAZG90AGludgB2ZWUAcGVuAG1wdHkAY3VydmUAaWN1cnZlAGwAaGFsZgBpbnZlbXB0eQBfYmFja2dyb3VuZABfZHJhd18AQ291bGQgbm90IHBhcnNlICJfYmFja2dyb3VuZCIgYXR0cmlidXRlIGluIGdyYXBoICVzCgAgICIlcyIKAG5vIG1lbW9yeSBmcm9tIHptYWxsb2MoKQoAb2JqAGVtaXQuYwBwb3Bfb2JqX3N0YXRlAGNsdXN0ACVsZABwYWdlJWQsJWRfAFRvdGFsIHNpemUgPiAxIGluICIlcyIgY29sb3Igc3BlYyAASWxsZWdhbCBsZW5ndGggdmFsdWUgaW4gIiVzIiBjb2xvciBhdHRyaWJ1dGUgAGxucmNvbG9yc2NoZW1lAGVtaXRfZWRnZV9sYWJlbAAlcy0lcwBmb3J3YXJkAGJhY2sAIC0+IAAgLS0gAGluIGVkZ2UgJXMlcyVzCgBsYWJlbGFsaWduZWQAZWRnZWhyZWYAZWRnZVVSTABsYWJlbGhyZWYAbGFiZWxVUkwAdGFpbGhyZWYAdGFpbFVSTABoZWFkaHJlZgBoZWFkVVJMAGVkZ2V0YXJnZXQAbGFiZWx0YXJnZXQAdGFpbHRhcmdldABoZWFkdGFyZ2V0AGVkZ2V0b29sdGlwAGxhYmVsdG9vbHRpcAB0YWlsdG9vbHRpcABoZWFkdG9vbHRpcAABbmVzdGluZyBub3QgYWxsb3dlZCBpbiBzdHlsZTogJXMKAHVubWF0Y2hlZCAnKScgaW4gc3R5bGU6ICVzCgB0cnVuY2F0aW5nIHN0eWxlICclcycKAHVubWF0Y2hlZCAnKCcgaW4gc3R5bGU6ICVzCgBhbGwAaW4gY2x1c3RlciAlcwoATW9yZSB0aGFuIDIgY29sb3JzIHNwZWNpZmllZCBmb3IgYSBncmFkaWVudCAtIGlnbm9yaW5nIHJlbWFpbmluZwoAZ3JhZGllbnQgcGVuIGNvbG9ycyBub3QgeWV0IHN1cHBvcnRlZC4KAEltYWdlcyB1bnN1cHBvcnRlZCBpbiAiYmFja2dyb3VuZCIgYXR0cmlidXRlCgBsYXllcnMgbm90IHN1cHBvcnRlZCBpbiAlcyBvdXRwdXQKAExheW91dCB3YXMgbm90IGRvbmUuICBNaXNzaW5nIGxheW91dCBwbHVnaW5zPyAKAGd2UmVuZGVySm9icyAlczogJS4yZiBzZWNzLgoAbGF5b3V0IHdhcyBub3QgZG9uZQoAcmVuZGVyZXIgZm9yICVzIGlzIHVuYXZhaWxhYmxlCgBwYWdlZGlyPSVzIGlnbm9yZWQKAHZpZXdwb3J0ACVsZiwlbGYsJWxmLCclW14nXScAJWxmLCVsZiwlbGYsJVteLF0lcwAlbGYsJWxmLCVsZiwlbGYsJWxmAG91dHB1dG9yZGVyAG9kZXNmaXJzdABkZ2VzZmlyc3QAbGF5ZXJzAGxheWVyc2VsZWN0AFRoZSBsYXllcnNlbGVjdCBhdHRyaWJ1dGUgIiVzIiBkb2VzIG5vdCBtYXRjaCBhbnkgbGF5ZXIgc3BlY2lmZWQgYnkgdGhlIGxheWVycyBhdHRyaWJ1dGUgLSBpZ25vcmVkLgoAbGF5ZXJzZXAAOgkgAGxheWVybGlzdHNlcAAsAFRoZSBjaGFyYWN0ZXIgJyVjJyBhcHBlYXJzIGluIGJvdGggdGhlIGxheWVyc2VwIGFuZCBsYXllcmxpc3RzZXAgYXR0cmlidXRlcyAtIGxheWVybGlzdHNlcCBpZ25vcmVkLgoAcGFkAEJMAHBhZ2VkaXIAc29saWQAAHNldGxpbmV3aWR0aAAxAABzcGwtPnNpemUgPiAwAGluaXRfc3BsaW5lc19iYgBiei5zaXplID4gMABiZXppZXJfYmIAYnouc2l6ZSAlIDMgPT0gMQAlbGYAZm9udHBhdGgARE9URk9OVFBBVEgAR0RGT05UUEFUSABpbWFnZXBhdGgAcXVhbnR1bQByYW5rZGlyAExSAEJUAFJMAG5vZGVzZXAAcmFua3NlcABlcXVhbGx5AHNob3dib3hlcwBmb250bmFtZXMAc2l6ZQBwYWdlAGNlbnRlcgByb3RhdGUAb3JpZW50YXRpb24AbGFuZHNjYXBlAGNsdXN0ZXJyYW5rAGNvbmNlbnRyYXRlAGRwaQByZXNvbHV0aW9uAG9yZGVyaW5nAGZpbGxjb2xvcgBmb250c2l6ZQBmb250bmFtZQBmb250Y29sb3IAeGxhYmVsAHBlbndpZHRoAHBlcmlwaGVyaWVzAHNrZXcAZGlzdG9ydGlvbgBub2p1c3RpZnkAbGF5ZXIAZ3JvdXAAY29tbWVudAB2ZXJ0aWNlcwB6AHdlaWdodABsYWJlbGZsb2F0AGRpcgBhcnJvd2hlYWQAYXJyb3d0YWlsAGhlYWRsYWJlbAB0YWlsbGFiZWwAbGFiZWxmb250c2l6ZQBsYWJlbGZvbnRuYW1lAGxhYmVsZm9udGNvbG9yAGxhYmVsZGlzdGFuY2UAbGFiZWxhbmdsZQBtaW5sZW4AZGVjb3JhdGUAYXJyb3dzaXplAGNvbnN0cmFpbnQAdGFpbGNsaXAAaGVhZGNsaXAAbGFiZWxqdXN0AGxvY2FsAGdsb2JhbAAlbGYsJWxmJWMAJWxmJWMAcmF0aW8AYXV0bwBjb21wcmVzcwBleHBhbmQAZmlsbABnZABwcwBzdmcAY2hhcnNldAB1dGYtOABsYXRpbi0xAGxhdGluMQBsMQBJU08tODg1OS0xAElTT184ODU5LTEASVNPODg1OS0xAElTTy1JUi0xMDAAYmlnLTUAYmlnNQB1dGY4AFVuc3VwcG9ydGVkIGNoYXJzZXQgIiVzIiAtIGFzc3VtaW5nIHV0Zi04CgBVbnN1cHBvcnRlZCBjaGFyc2V0IHZhbHVlICVkCgBVVEYtOABCSUctNQBpbiBsYWJlbCBvZiBncmFwaCAlcwoAaW4gbGFiZWwgb2Ygbm9kZSAlcwoAaW4gbGFiZWwgb2YgZWRnZSAlcyAlcyAlcwoAa2luZCA9PSBMVF9OT05FAGxhYmVscy5jAG1ha2VfbGFiZWwAXEwAXEcAXEUAXEgAXFQAJiMxMzsAJiMxMDsAJnF1b3Q7ACYjMTYwOwAmYW1wOwAmZ3Q7ACYjMzk7ACYjNDU7ACZsdDsAJXMgJWQgbm9kZXMgJWQgZWRnZXMgbWF4aXRlcj0lZCBiYWxhbmNlPSVkCgBuZXR3b3JrIHNpbXBsZXg6IAAlZCAAJXMlZCBub2RlcyAlZCBlZGdlcyAlZCBpdGVyICUuMmYgc2VjCgB1cGRhdGU6IG1pc21hdGNoZWQgbGNhIGluIHRyZWV1cGRhdGVzCgBUcmVlX2VkZ2Uuc2l6ZSA9PSBOX25vZGVzIC0gMQBucy5jAGZlYXNpYmxlX3RyZWUAIVRSRUVfRURHRShlKQBtZXJnZV90cmVlcwAocjAtPmhlYXBfaW5kZXggPiAtMSkgfHwgKHIxLT5oZWFwX2luZGV4ID4gLTEpAFNUc2V0VW5pb24Aci0+aGVhcF9pbmRleCA+PSAwAGFkZF90cmVlX2VkZ2U6IG1pc3NpbmcgdHJlZSBlZGdlCgBhZGRfdHJlZV9lZGdlOiBlbXB0eSBvdXRlZGdlIGxpc3QKAGFkZF90cmVlX2VkZ2U6IGVtcHR5IGluZWRnZSBsaXN0CgB0cm91YmxlIGluIGluaXRfcmFuawoACSVzICVkCgBzZWFyY2hzaXplAGdyYXBoIAAgAG5vZGUgAHN0b3AKACUuNWcAcG9zAHJlY3RzAHhscABscABoZWFkX2xwAHRhaWxfbHAAbHdpZHRoAGxoZWlnaHQAYmIAJS41ZywlLjVnLCUuNWcALCUuNWcAJS41ZywlLjVnAHNhbXBsZXBvaW50cwAlLjVnICUuNWcAcywlLjVnLCUuNWcgAGUsJS41ZywlLjVnIAAlLjVnLCUuNWcsJS41ZywlLjVnACUuMmYAJS41ZywlLjVnLCUuNWcsJS41ZyAAL3BhdGhib3ggewogICAgL1ggZXhjaCBuZWcgJS41ZyBzdWIgZGVmCiAgICAvWSBleGNoICUuNWcgc3ViIGRlZgogICAgL3ggZXhjaCBuZWcgJS41ZyBzdWIgZGVmCiAgICAveSBleGNoICUuNWcgc3ViIGRlZgogICAgbmV3cGF0aCB4IHkgbW92ZXRvCiAgICBYIHkgbGluZXRvCiAgICBYIFkgbGluZXRvCiAgICB4IFkgbGluZXRvCiAgICBjbG9zZXBhdGggc3Ryb2tlCn0gZGVmCgAvcGF0aGJveCB7CiAgICAvWSBleGNoICUuNWcgc3ViIGRlZgogICAgL1ggZXhjaCAlLjVnIHN1YiBkZWYKICAgIC95IGV4Y2ggJS41ZyBzdWIgZGVmCiAgICAveCBleGNoICUuNWcgc3ViIGRlZgogICAgbmV3cGF0aCB4IHkgbW92ZXRvCiAgICBYIHkgbGluZXRvCiAgICBYIFkgbGluZXRvCiAgICB4IFkgbGluZXRvCiAgICBjbG9zZXBhdGggc3Ryb2tlCiB9IGRlZgovZGJnc3RhcnQgeyBnc2F2ZSAlLjVnICUuNWcgdHJhbnNsYXRlIH0gZGVmCi9hcnJvd2xlbmd0aCAxMCBkZWYKL2Fycm93d2lkdGggYXJyb3dsZW5ndGggMiBkaXYgZGVmCi9hcnJvd2hlYWQgewogICAgZ3NhdmUKICAgIHJvdGF0ZQogICAgY3VycmVudHBvaW50CiAgICBuZXdwYXRoCiAgICBtb3ZldG8KICAgIGFycm93bGVuZ3RoIGFycm93d2lkdGggMiBkaXYgcmxpbmV0bwogICAgMCBhcnJvd3dpZHRoIG5lZyBybGluZXRvCiAgICBjbG9zZXBhdGggZmlsbAogICAgZ3Jlc3RvcmUKfSBiaW5kIGRlZgovbWFrZWFycm93IHsKICAgIGN1cnJlbnRwb2ludCBleGNoIHBvcCBzdWIgZXhjaCBjdXJyZW50cG9pbnQgcG9wIHN1YiBhdGFuCiAgICBhcnJvd2hlYWQKfSBiaW5kIGRlZgovcG9pbnQgeyAgICBuZXdwYXRoICAgIDIgMCAzNjAgYXJjIGZpbGx9IGRlZi9tYWtldmVjIHsKICAgIC9ZIGV4Y2ggZGVmCiAgICAvWCBleGNoIGRlZgogICAgL3kgZXhjaCBkZWYKICAgIC94IGV4Y2ggZGVmCiAgICBuZXdwYXRoIHggeSBtb3ZldG8KICAgIFggWSBsaW5ldG8gc3Ryb2tlCiAgICBYIFkgbW92ZXRvCiAgICB4IHkgbWFrZWFycm93Cn0gZGVmCgBsb3N0ICVzICVzIGVkZ2UKAG5vIHBvc2l0aW9uIGZvciBlZGdlIHdpdGggbGFiZWwgJXMAbm8gcG9zaXRpb24gZm9yIGVkZ2Ugd2l0aCB0YWlsIGxhYmVsICVzAG5vIHBvc2l0aW9uIGZvciBlZGdlIHdpdGggaGVhZCBsYWJlbCAlcwBubyBwb3NpdGlvbiBmb3IgZWRnZSB3aXRoIHhsYWJlbCAlcwBmb3JjZWxhYmVscwAlZCBvdXQgb2YgJWQgbGFiZWxzIHBvc2l0aW9uZWQuCgAlZCBvdXQgb2YgJWQgZXh0ZXJpb3IgbGFiZWxzIHBvc2l0aW9uZWQuCgAlZCBvYmpzICVkIHhsYWJlbHMgZm9yY2U9JWQgYmI9KCUuMDJmLCUuMDJmKSAoJS4wMmYsJS4wMmYpCgBvYmplY3RzCgAgWyVkXSAoJS4wMmYsJS4wMmYpICglLjAyZiwlLjAyZikgJXAgIiVzIgoAeGxhYmVscwoAIFslZF0gJXAgc2V0ICVkICglLjAyZiwlLjAyZikgKCUuMDJmLCUuMDJmKSAlcwoAc2hhcGVmaWxlIG5vdCBzZXQgb3Igbm90IGZvdW5kIGZvciBlcHNmIG5vZGUgJXMKAGNvdWxkbid0IG9wZW4gZXBzZiBmaWxlICVzCgAlJSUlQm91bmRpbmdCb3g6ICVkICVkICVkICVkAHJlYWQAQm91bmRpbmdCb3ggbm90IGZvdW5kIGluIGVwc2YgZmlsZSAlcwoAY2FuJ3QgZmluZCBsaWJyYXJ5IGZpbGUgJXMKAGNhbid0IG9wZW4gbGlicmFyeSBmaWxlICVzCgBFT0YAQkVHSU4ARU5EAFRSQUlMRVIAL3VzZXJfc2hhcGVfJWQgewoAJSVCZWdpbkRvY3VtZW50OgoAJSVFbmREb2N1bWVudAoAfSBiaW5kIGRlZgoAVVRGLTggaW5wdXQgdXNlcyBub24tTGF0aW4xIGNoYXJhY3RlcnMgd2hpY2ggY2Fubm90IGJlIGhhbmRsZWQgYnkgdGhpcyBQb3N0U2NyaXB0IGRyaXZlcgoAY2Fubm90IHJlLWFsbG9jYXRlIHBzCgByb3V0ZXNwbGluZXNpbml0OiBjYW5ub3QgYWxsb2NhdGUgcHMKAHJvdXRlc3BsaW5lczogJWQgZWRnZXMsICVkIGJveGVzICUuMmYgc2VjCgBpbiByb3V0ZXNwbGluZXMsIGNhbm5vdCBmaW5kIE5PUk1BTCBlZGdlCgBpbiByb3V0ZXNwbGluZXMsIGlsbGVnYWwgdmFsdWVzIG9mIHByZXYgJWQgYW5kIG5leHQgJWQsIGxpbmUgJWQKAGluIHJvdXRlc3BsaW5lcywgZWRnZSBpcyBhIGxvb3AgYXQgJXMKAGluIHJvdXRlc3BsaW5lcywgUHNob3J0ZXN0cGF0aCBmYWlsZWQKAGluIHJvdXRlc3BsaW5lcywgUHJvdXRlc3BsaW5lIGZhaWxlZAoAVW5hYmxlIHRvIHJlY2xhaW0gYm94IHNwYWNlIGluIHNwbGluZSByb3V0aW5nIGZvciBlZGdlICIlcyIgLT4gIiVzIi4gU29tZXRoaW5nIGlzIHByb2JhYmx5IHNlcmlvdXNseSB3cm9uZy4KAGluIGNoZWNrcGF0aCwgYm94IDAgaGFzIExMIGNvb3JkID4gVVIgY29vcmQKAGluIGNoZWNrcGF0aCwgYm94ICVkIGhhcyBMTCBjb29yZCA+IFVSIGNvb3JkCgBpbiBjaGVja3BhdGgsIGJveGVzICVkIGFuZCAlZCBkb24ndCB0b3VjaAoAaW4gY2hlY2twYXRoLCBzdGFydCBwb3J0IG5vdCBpbiBmaXJzdCBib3gKAGluIGNoZWNrcGF0aCwgZW5kIHBvcnQgbm90IGluIGxhc3QgYm94CgAlZCBib3hlczoKACVkICglLjVnLCAlLjVnKSwgKCUuNWcsICUuNWcpCgBjb25zdHJhaW5lZABub3QgY29uc3RyYWluZWQAc3RhcnQgcG9ydDogKCUuNWcsICUuNWcpLCB0YW5nZW50IGFuZ2xlOiAlLjVnLCAlcwoAZW5kIHBvcnQ6ICglLjVnLCAlLjVnKSwgdGFuZ2VudCBhbmdsZTogJS41ZywgJXMKAHNpZGVzID09IDQAc2hhcGVzLmMAcm91bmRfY29ybmVycwBiYWQgbGFiZWwgZm9ybWF0ICVzCgBcTgBtYXJnaW4AJWxmLCVsZgByZWd1bGFyAGN1c3RvbQBzaGFwZWZpbGUAPG5pbD4ATm8gb3IgaW1wcm9wZXIgc2hhcGVmaWxlPSIlcyIgZm9yIG5vZGUgIiVzIgoATm8gb3IgaW1wcm9wZXIgaW1hZ2U9IiVzIiBmb3Igbm9kZSAiJXMiCgBsYWJlbGxvYwBub2RlICclcycsIGdyYXBoICclcycgc2l6ZSB0b28gc21hbGwgZm9yIGxhYmVsCgBlcHNmAHVzaW5nICVzIGZvciB1bmtub3duIHNoYXBlICVzCgBwb2x5Z29uAG92YWwAY2lyY2xlAHBvaW50AGVnZwB0cmlhbmdsZQBwbGFpbnRleHQAcGxhaW4AZGlhbW9uZAB0cmFwZXppdW0AcGFyYWxsZWxvZ3JhbQBob3VzZQBwZW50YWdvbgBoZXhhZ29uAHNlcHRhZ29uAG9jdGFnb24Abm90ZQB0YWIAZm9sZGVyAGJveDNkAGNvbXBvbmVudABjeWxpbmRlcgByZWN0AHJlY3RhbmdsZQBzcXVhcmUAZG91YmxlY2lyY2xlAGRvdWJsZW9jdGFnb24AdHJpcGxlb2N0YWdvbgBpbnZ0cmlhbmdsZQBpbnZ0cmFwZXppdW0AaW52aG91c2UAdW5kZXJsaW5lAE1kaWFtb25kAE1zcXVhcmUATWNpcmNsZQBwcm9tb3RlcgBjZHMAdGVybWluYXRvcgB1dHIAaW5zdWxhdG9yAHJpYm9zaXRlAHJuYXN0YWIAcHJvdGVhc2VzaXRlAHByb3RlaW5zdGFiAHByaW1lcnNpdGUAcmVzdHJpY3Rpb25zaXRlAGZpdmVwb3ZlcmhhbmcAdGhyZWVwb3ZlcmhhbmcAbm92ZXJoYW5nAGFzc2VtYmx5AHNpZ25hdHVyZQBycHJvbW90ZXIAbGFycm93AHJhcnJvdwBscHJvbW90ZXIAcmVjb3JkAE1yZWNvcmQAc3RhcgAjODA4MDgwACNmY2ZjZmMAIzMwMzAzMAAjZThlOGU4ACNlMGUwZTAAI2YwZjBmMAAjMTAxMDEwACNmOGY4ZjgAaW4gbm9kZSAlcwoAcm91bmRlZABkaWFnb25hbHMAcmFkaWFsAHN0cmlwZWQAd2VkZ2VkAF8Abm9kZSAlcywgcG9ydCAlcywgdW5yZWNvZ25pemVkIGNvbXBhc3MgcG9pbnQgJyVzJyAtIGlnbm9yZWQKAG5vZGUgJXMsIHBvcnQgJXMgdW5yZWNvZ25pemVkCgAlLjVnICUuNWcgdHJhbnNsYXRlIG5ld3BhdGggdXNlcl9zaGFwZV8lZAoAaW52aXMAAGZpbGxlZAAAcwBlAHcAc3BsaW5lcy5jAGJlZ2lucGF0aABQLT5lbmQudGhldGEgPCAyICogTV9QSQBlbmRwYXRoAG1ha2VTZWxmRWRnZQBnZXRzcGxpbmVwb2ludHM6IG5vIHNwbGluZSBwb2ludHMgYXZhaWxhYmxlIGZvciBlZGdlICglcywlcykKAHBvbHlsaW5lTWlkcG9pbnQAc3Bhbi0+Zm9udAB0ZXh0c3Bhbi5jAHRleHRzcGFuX3NpemUAZm9udC0+bmFtZQBmb250bmFtZTogIiVzIiByZXNvbHZlZCB0bzogJXMKAGZvbnRuYW1lOiB1bmFibGUgdG8gcmVzb2x2ZSAiJXMiCgBjb3VyAGFyaWFsAGhlbHZldGljYQBbaW50ZXJuYWwgdGltZXNdAFtpbnRlcm5hbCBjb3VyaWVyXQBbaW50ZXJuYWwgYXJpYWxdAEF2YW50R2FyZGUtQm9vawBVUlcgR290aGljIEwAYm9vawBzYW5zLVNlcmlmAEF2YW50R2FyZGUtQm9va09ibGlxdWUAb2JsaXF1ZQBpdGFsaWMAQXZhbnRHYXJkZS1EZW1pAGRlbWkAQXZhbnRHYXJkZS1EZW1pT2JsaXF1ZQBCb29rbWFuLURlbWkAVVJXIEJvb2ttYW4gTABzZXJpZgBCb29rbWFuLURlbWlJdGFsaWMAQm9va21hbi1MaWdodABsaWdodABCb29rbWFuLUxpZ2h0SXRhbGljAENvdXJpZXIAbW9ub3NwYWNlAENvdXJpZXItQm9sZABDb3VyaWVyLUJvbGRPYmxpcXVlAENvdXJpZXItT2JsaXF1ZQBIZWx2ZXRpY2EASGVsdmV0aWNhLUJvbGQASGVsdmV0aWNhLUJvbGRPYmxpcXVlAEhlbHZldGljYS1OYXJyb3cAY29uZGVuc2VkAEhlbHZldGljYS1OYXJyb3ctQm9sZABIZWx2ZXRpY2EtTmFycm93LUJvbGRPYmxpcXVlAEhlbHZldGljYS1OYXJyb3ctT2JsaXF1ZQBIZWx2ZXRpY2EtT2JsaXF1ZQBOZXdDZW50dXJ5U2NobGJrLUJvbGQAQ2VudHVyeSBTY2hvb2xib29rIEwATmV3Q2VudHVyeVNjaGxiay1Cb2xkSXRhbGljAE5ld0NlbnR1cnlTY2hsYmstSXRhbGljAE5ld0NlbnR1cnlTY2hsYmstUm9tYW4Acm9tYW4AUGFsYXRpbm8tQm9sZABQYWxhdGlubyBMaW5vdHlwZQBQYWxhdGluby1Cb2xkSXRhbGljAFBhbGF0aW5vLUl0YWxpYwBQYWxhdGluby1Sb21hbgBTeW1ib2wAZmFudGFzeQBUaW1lcy1Cb2xkAFRpbWVzAFRpbWVzLUJvbGRJdGFsaWMAVGltZXMtSXRhbGljAFphcGZDaGFuY2VyeS1NZWRpdW1JdGFsaWMAVVJXIENoYW5jZXJ5IEwAbWVkaXVtAFphcGZEaW5nYmF0cwBEaW5nYmF0cwBpbnB1dHNjYWxlAG5vAHRydWUAeWVzAHV0aWxzLmMAdSA9PSBVRl9maW5kKHUpAFVGX3NldG5hbWUAAWZpbGUgbG9hZGluZyBpcyBkaXNhYmxlZCBiZWNhdXNlIHRoZSBlbnZpcm9ubWVudCBjb250YWlucyBTRVJWRVJfTkFNRT0iJXMiCmFuZCB0aGUgR1ZfRklMRV9QQVRIIHZhcmlhYmxlIGlzIHVuc2V0IG9yIGVtcHR5LgoAUGF0aCBwcm92aWRlZCB0byBmaWxlOiAiJXMiIGhhcyBiZWVuIGlnbm9yZWQgYmVjYXVzZSBmaWxlcyBhcmUgb25seSBwZXJtaXR0ZWQgdG8gYmUgbG9hZGVkIGZyb20gdGhlIGRpcmVjdG9yaWVzIGluICIlcyIgd2hlbiBydW5uaW5nIGluIGFuIGh0dHAgc2VydmVyLgoAJXMlcyVzAC8AOgBlbGxpcHNlAFRpbWVzLVJvbWFuAGNsdXN0ZXIAX19jbHVzdGVybm9kZXMAY2x1c3RlciBjeWNsZSAlcyAtLSAlcyBub3Qgc3VwcG9ydGVkCgB0YWlsIGNsdXN0ZXIgJXMgaW5zaWRlIGhlYWQgY2x1c3RlciAlcwoAaGVhZCBjbHVzdGVyICVzIGluc2lkZSB0YWlsIGNsdXN0ZXIgJXMKAHRhaWwgbm9kZSAlcyBpbnNpZGUgaGVhZCBjbHVzdGVyICVzCgBoZWFkIG5vZGUgJXMgaW5zaWRlIHRhaWwgY2x1c3RlciAlcwoAX18AbGFiZWwAc2hhcGUAYm94AFR3byBjbHVzdGVycyBuYW1lZCAlcyAtIHRoZSBzZWNvbmQgd2lsbCBiZSBpZ25vcmVkCgBtYXBOAEFFbGlnAEFhY3V0ZQBBY2lyYwBBZ3JhdmUAQWxwaGEAQXJpbmcAQXRpbGRlAEF1bWwAQmV0YQBDY2VkaWwAQ2hpAERhZ2dlcgBEZWx0YQBFVEgARWFjdXRlAEVjaXJjAEVncmF2ZQBFcHNpbG9uAEV0YQBFdW1sAEdhbW1hAElhY3V0ZQBJY2lyYwBJZ3JhdmUASW90YQBJdW1sAEthcHBhAExhbWJkYQBNdQBOdGlsZGUATnUAT0VsaWcAT2FjdXRlAE9jaXJjAE9ncmF2ZQBPbWVnYQBPbWljcm9uAE9zbGFzaABPdGlsZGUAT3VtbABQaGkAUGkAUHJpbWUAUHNpAFJobwBTY2Fyb24AU2lnbWEAVEhPUk4AVGF1AFRoZXRhAFVhY3V0ZQBVY2lyYwBVZ3JhdmUAVXBzaWxvbgBVdW1sAFhpAFlhY3V0ZQBZdW1sAFpldGEAYWFjdXRlAGFjaXJjAGFjdXRlAGFlbGlnAGFncmF2ZQBhbGVmc3ltAGFscGhhAGFtcABhbmQAYW5nAGFyaW5nAGFzeW1wAGF0aWxkZQBhdW1sAGJkcXVvAGJldGEAYnJ2YmFyAGJ1bGwAY2FwAGNjZWRpbABjZWRpbABjZW50AGNoaQBjaXJjAGNsdWJzAGNvbmcAY29weQBjcmFycgBjdXAAY3VycmVuAGRBcnIAZGFnZ2VyAGRhcnIAZGVnAGRlbHRhAGRpYW1zAGRpdmlkZQBlYWN1dGUAZWNpcmMAZWdyYXZlAGVtcHR5AGVtc3AAZW5zcABlcHNpbG9uAGVxdWl2AGV0YQBldGgAZXVtbABldXJvAGV4aXN0AGZub2YAZm9yYWxsAGZyYWMxMgBmcmFjMTQAZnJhYzM0AGZyYXNsAGdhbW1hAGdlAGd0AGhBcnIAaGFycgBoZWFydHMAaGVsbGlwAGlhY3V0ZQBpY2lyYwBpZXhjbABpZ3JhdmUAaW1hZ2UAaW5maW4AaW50AGlvdGEAaXF1ZXN0AGlzaW4AaXVtbABrYXBwYQBsQXJyAGxhbWJkYQBsYW5nAGxhcXVvAGxhcnIAbGNlaWwAbGRxdW8AbGUAbGZsb29yAGxvd2FzdABsb3oAbHJtAGxzYXF1bwBsc3F1bwBsdABtYWNyAG1kYXNoAG1pY3JvAG1pZGRvdABtdQBuYWJsYQBuYnNwAG5kYXNoAG5lAG5pAG5vdABub3RpbgBuc3ViAG50aWxkZQBudQBvYWN1dGUAb2NpcmMAb2VsaWcAb2dyYXZlAG9saW5lAG9tZWdhAG9taWNyb24Ab3BsdXMAb3IAb3JkZgBvcmRtAG9zbGFzaABvdGlsZGUAb3RpbWVzAG91bWwAcGFyYQBwYXJ0AHBlcm1pbABwZXJwAHBoaQBwaQBwaXYAcGx1c21uAHBvdW5kAHByaW1lAHByb2QAcHJvcABwc2kAcXVvdAByQXJyAHJhZGljAHJhbmcAcmFxdW8AcmFycgByY2VpbAByZHF1bwByZWFsAHJlZwByZmxvb3IAcmhvAHJsbQByc2FxdW8AcnNxdW8Ac2JxdW8Ac2Nhcm9uAHNkb3QAc2VjdABzaHkAc2lnbWEAc2lnbWFmAHNpbQBzcGFkZXMAc3ViAHN1YmUAc3VtAHN1cABzdXAxAHN1cDIAc3VwMwBzdXBlAHN6bGlnAHRhdQB0aGVyZTQAdGhldGEAdGhldGFzeW0AdGhpbnNwAHRob3JuAHRpbGRlAHRpbWVzAHRyYWRlAHVBcnIAdWFjdXRlAHVhcnIAdWNpcmMAdWdyYXZlAHVtbAB1cHNpaAB1cHNpbG9uAHV1bWwAd2VpZXJwAHhpAHlhY3V0ZQB5ZW4AeXVtbAB6ZXRhAHp3agB6d25qAFVURjggY29kZXMgPiA0IGJ5dGVzIGFyZSBub3QgY3VycmVudGx5IHN1cHBvcnRlZCAoZ3JhcGggJXMpIC0gdHJlYXRlZCBhcyBMYXRpbi0xLiBQZXJoYXBzICItR2NoYXJzZXQ9bGF0aW4xIiBpcyBuZWVkZWQ/CgBJbnZhbGlkICVkLWJ5dGUgVVRGOCBmb3VuZCBpbiBpbnB1dCBvZiBncmFwaCAlcyAtIHRyZWF0ZWQgYXMgTGF0aW4tMS4gUGVyaGFwcyAiLUdjaGFyc2V0PWxhdGluMSIgaXMgbmVlZGVkPwoAYnouc2l6ZQBvdmVybGFwX2JlemllcgB1cnZlZABvbXBvdW5kAGFsc2UAaW5lAG9uZQBvAHJ0aG8Ab2x5bGluZQBwbGluZQBydWUAZXMAVW5rbm93biAic3BsaW5lcyIgdmFsdWU6ICIlcyIgLSBpZ25vcmVkCgBzcGxpbmVzAG9kYgBPcnRob2dvbmFsIGVkZ2VzIGRvIG5vdCBjdXJyZW50bHkgaGFuZGxlIGVkZ2UgbGFiZWxzLiBUcnkgdXNpbmcgeGxhYmVscy4KAG9ydGhvICVzICVzCgBjaGFuaQBvcnRoby5jAGNoYW5TZWFyY2gAY3AAJSUhUFMtQWRvYmUtMi4wCiUlJSVCb3VuZGluZ0JveDogKGF0ZW5kKQovcG9pbnQgewogIC9ZIGV4Y2ggZGVmCiAgL1ggZXhjaCBkZWYKICBuZXdwYXRoCiAgWCBZIDMgMCAzNjAgYXJjIGZpbGwKfSBkZWYKL2NlbGwgewogIC9ZIGV4Y2ggZGVmCiAgL1ggZXhjaCBkZWYKICAveSBleGNoIGRlZgogIC94IGV4Y2ggZGVmCiAgbmV3cGF0aAogIHggeSBtb3ZldG8KICB4IFkgbGluZXRvCiAgWCBZIGxpbmV0bwogIFggeSBsaW5ldG8KICBjbG9zZXBhdGggc3Ryb2tlCn0gZGVmCi9ub2RlIHsKIC91IGV4Y2ggZGVmCiAvciBleGNoIGRlZgogL2QgZXhjaCBkZWYKIC9sIGV4Y2ggZGVmCiBuZXdwYXRoIGwgZCBtb3ZldG8KIHIgZCBsaW5ldG8gciB1IGxpbmV0byBsIHUgbGluZXRvCiBjbG9zZXBhdGggZmlsbAp9IGRlZgoKACVkICVkIHRyYW5zbGF0ZQoAMC44IDAuOCAwLjggc2V0cmdiY29sb3IKAHNob3dwYWdlCiUlJSVUcmFpbGVyCiUlJSVCb3VuZGluZ0JveDogJWQgJWQgJWQgJWQKAG5ld3BhdGggJWQgJWQgbW92ZXRvCgAlZCAlZCBsaW5ldG8KACVkICVkIGxpbmV0byBzdHJva2UKAGNoYW5uZWwgJWQgKCVmLCVmKQoAIC0+CgAgICAgIAAoKCVmLCVmKSwoJWYsJWYpKSAlcyAlcwBCX1JJR0hUAEJfRE9XTgBCX0xFRlQAQl9VUABCX05PREUAc2VnAG5leHRfc2VnAGRlY2lkZV9wb2ludABpbmNvbXBhcmFibGUgc2VnbWVudHMgISEgLS0gQWJvcnRpbmcKAHMxLT5jb21tX2Nvb3JkPT1zMi0+Y29tbV9jb29yZABpc19wYXJhbGxlbABncmFwaCBHIHsKACBub2RlW3NoYXBlPXBvaW50XQoAICAlZCBbcG9zPSIlZCwlZCJdCgAgICVkIC0tICVkW2xlbj0iJWYiXQoAfQoAY29sb3IgJXMAJXMgaXMgbm90IGEga25vd24gY29sb3IuCgBlcnJvciBpbiBjb2x4bGF0ZSgpCgBzb2xpZABpbnZpc2libGUAYm9sZABzZXRsaW5ld2lkdGgAZmlsbGVkAHVuZmlsbGVkAHRhcGVyZWQAZ3ZyZW5kZXJfc2V0X3N0eWxlOiB1bnN1cHBvcnRlZCBzdHlsZSAlcyAtIGlnbm9yaW5nCgBndnJlbmRlci5jAGd2cmVuZGVyX3VzZXJzaGFwZQBuYW1lAG5hbWVbMF0AYm90aABsYXlvdXQATGF5b3V0IHR5cGU6ICIlcyIgbm90IHJlY29nbml6ZWQuIFVzZSBvbmUgb2Y6JXMKAGpvYgBndmxvYWRpbWFnZS5jAGd2bG9hZGltYWdlAHVzAHVzLT5uYW1lAHVzLT5uYW1lWzBdAE5vIGxvYWRpbWFnZSBwbHVnaW4gZm9yICIlcyIKAFEATGVmdABLUF9MZWZ0AFJpZ2h0AEtQX1JpZ2h0AFVwAEtQX1VwAERvd24AS1BfRG93bgBwbHVzAEtQX0FkZABtaW51cwBLUF9TdWJ0cmFjdABGAGVkZ2UAdGFpbHBvcnQAaGVhZHBvcnQAa2V5AFVSTABub2RlAGRpZ3JhcGgAZ3JhcGgAc3ViZ3JhcGgAX0xUWF9saWJyYXJ5AHRleHRsYXlvdXQAb2JqcC0+bGJsAHhsYWJlbHMuYwB4bGFkanVzdAB4bGludGVyc2VjdGlvbnMAbHAgIT0gY2xwAGdldGludHJzeGkAb2JqcDEtPnN6LnggPT0gMCAmJiBvYmpwMS0+c3oueSA9PSAwAGxibGVuY2xvc2luZwB2cAB4bGhkeHVubG9hZABzaXplPT1mcmVlZAByZWN0LmJvdW5kYXJ5WzJdIDwgSU5UX01BWABvYmpwbHBta3MAcmVjdC5ib3VuZGFyeVszXSA8IElOVF9NQVgAb3V0IG9mIG1lbW9yeQoAIyUyeCUyeCUyeCUyeAAlbGYlbGYlbGYAL2FjY2VudDMvMQAvYWNjZW50My8yAC9hY2NlbnQzLzMAL2FjY2VudDQvMQAvYWNjZW50NC8yAC9hY2NlbnQ0LzMAL2FjY2VudDQvNAAvYWNjZW50NS8xAC9hY2NlbnQ1LzIAL2FjY2VudDUvMwAvYWNjZW50NS80AC9hY2NlbnQ1LzUAL2FjY2VudDYvMQAvYWNjZW50Ni8yAC9hY2NlbnQ2LzMAL2FjY2VudDYvNAAvYWNjZW50Ni81AC9hY2NlbnQ2LzYAL2FjY2VudDcvMQAvYWNjZW50Ny8yAC9hY2NlbnQ3LzMAL2FjY2VudDcvNAAvYWNjZW50Ny81AC9hY2NlbnQ3LzYAL2FjY2VudDcvNwAvYWNjZW50OC8xAC9hY2NlbnQ4LzIAL2FjY2VudDgvMwAvYWNjZW50OC80AC9hY2NlbnQ4LzUAL2FjY2VudDgvNgAvYWNjZW50OC83AC9hY2NlbnQ4LzgAL2JsdWVzMy8xAC9ibHVlczMvMgAvYmx1ZXMzLzMAL2JsdWVzNC8xAC9ibHVlczQvMgAvYmx1ZXM0LzMAL2JsdWVzNC80AC9ibHVlczUvMQAvYmx1ZXM1LzIAL2JsdWVzNS8zAC9ibHVlczUvNAAvYmx1ZXM1LzUAL2JsdWVzNi8xAC9ibHVlczYvMgAvYmx1ZXM2LzMAL2JsdWVzNi80AC9ibHVlczYvNQAvYmx1ZXM2LzYAL2JsdWVzNy8xAC9ibHVlczcvMgAvYmx1ZXM3LzMAL2JsdWVzNy80AC9ibHVlczcvNQAvYmx1ZXM3LzYAL2JsdWVzNy83AC9ibHVlczgvMQAvYmx1ZXM4LzIAL2JsdWVzOC8zAC9ibHVlczgvNAAvYmx1ZXM4LzUAL2JsdWVzOC82AC9ibHVlczgvNwAvYmx1ZXM4LzgAL2JsdWVzOS8xAC9ibHVlczkvMgAvYmx1ZXM5LzMAL2JsdWVzOS80AC9ibHVlczkvNQAvYmx1ZXM5LzYAL2JsdWVzOS83AC9ibHVlczkvOAAvYmx1ZXM5LzkAL2JyYmcxMC8xAC9icmJnMTAvMTAAL2JyYmcxMC8yAC9icmJnMTAvMwAvYnJiZzEwLzQAL2JyYmcxMC81AC9icmJnMTAvNgAvYnJiZzEwLzcAL2JyYmcxMC84AC9icmJnMTAvOQAvYnJiZzExLzEAL2JyYmcxMS8xMAAvYnJiZzExLzExAC9icmJnMTEvMgAvYnJiZzExLzMAL2JyYmcxMS80AC9icmJnMTEvNQAvYnJiZzExLzYAL2JyYmcxMS83AC9icmJnMTEvOAAvYnJiZzExLzkAL2JyYmczLzEAL2JyYmczLzIAL2JyYmczLzMAL2JyYmc0LzEAL2JyYmc0LzIAL2JyYmc0LzMAL2JyYmc0LzQAL2JyYmc1LzEAL2JyYmc1LzIAL2JyYmc1LzMAL2JyYmc1LzQAL2JyYmc1LzUAL2JyYmc2LzEAL2JyYmc2LzIAL2JyYmc2LzMAL2JyYmc2LzQAL2JyYmc2LzUAL2JyYmc2LzYAL2JyYmc3LzEAL2JyYmc3LzIAL2JyYmc3LzMAL2JyYmc3LzQAL2JyYmc3LzUAL2JyYmc3LzYAL2JyYmc3LzcAL2JyYmc4LzEAL2JyYmc4LzIAL2JyYmc4LzMAL2JyYmc4LzQAL2JyYmc4LzUAL2JyYmc4LzYAL2JyYmc4LzcAL2JyYmc4LzgAL2JyYmc5LzEAL2JyYmc5LzIAL2JyYmc5LzMAL2JyYmc5LzQAL2JyYmc5LzUAL2JyYmc5LzYAL2JyYmc5LzcAL2JyYmc5LzgAL2JyYmc5LzkAL2J1Z24zLzEAL2J1Z24zLzIAL2J1Z24zLzMAL2J1Z240LzEAL2J1Z240LzIAL2J1Z240LzMAL2J1Z240LzQAL2J1Z241LzEAL2J1Z241LzIAL2J1Z241LzMAL2J1Z241LzQAL2J1Z241LzUAL2J1Z242LzEAL2J1Z242LzIAL2J1Z242LzMAL2J1Z242LzQAL2J1Z242LzUAL2J1Z242LzYAL2J1Z243LzEAL2J1Z243LzIAL2J1Z243LzMAL2J1Z243LzQAL2J1Z243LzUAL2J1Z243LzYAL2J1Z243LzcAL2J1Z244LzEAL2J1Z244LzIAL2J1Z244LzMAL2J1Z244LzQAL2J1Z244LzUAL2J1Z244LzYAL2J1Z244LzcAL2J1Z244LzgAL2J1Z245LzEAL2J1Z245LzIAL2J1Z245LzMAL2J1Z245LzQAL2J1Z245LzUAL2J1Z245LzYAL2J1Z245LzcAL2J1Z245LzgAL2J1Z245LzkAL2J1cHUzLzEAL2J1cHUzLzIAL2J1cHUzLzMAL2J1cHU0LzEAL2J1cHU0LzIAL2J1cHU0LzMAL2J1cHU0LzQAL2J1cHU1LzEAL2J1cHU1LzIAL2J1cHU1LzMAL2J1cHU1LzQAL2J1cHU1LzUAL2J1cHU2LzEAL2J1cHU2LzIAL2J1cHU2LzMAL2J1cHU2LzQAL2J1cHU2LzUAL2J1cHU2LzYAL2J1cHU3LzEAL2J1cHU3LzIAL2J1cHU3LzMAL2J1cHU3LzQAL2J1cHU3LzUAL2J1cHU3LzYAL2J1cHU3LzcAL2J1cHU4LzEAL2J1cHU4LzIAL2J1cHU4LzMAL2J1cHU4LzQAL2J1cHU4LzUAL2J1cHU4LzYAL2J1cHU4LzcAL2J1cHU4LzgAL2J1cHU5LzEAL2J1cHU5LzIAL2J1cHU5LzMAL2J1cHU5LzQAL2J1cHU5LzUAL2J1cHU5LzYAL2J1cHU5LzcAL2J1cHU5LzgAL2J1cHU5LzkAL2RhcmsyMy8xAC9kYXJrMjMvMgAvZGFyazIzLzMAL2RhcmsyNC8xAC9kYXJrMjQvMgAvZGFyazI0LzMAL2RhcmsyNC80AC9kYXJrMjUvMQAvZGFyazI1LzIAL2RhcmsyNS8zAC9kYXJrMjUvNAAvZGFyazI1LzUAL2RhcmsyNi8xAC9kYXJrMjYvMgAvZGFyazI2LzMAL2RhcmsyNi80AC9kYXJrMjYvNQAvZGFyazI2LzYAL2RhcmsyNy8xAC9kYXJrMjcvMgAvZGFyazI3LzMAL2RhcmsyNy80AC9kYXJrMjcvNQAvZGFyazI3LzYAL2RhcmsyNy83AC9kYXJrMjgvMQAvZGFyazI4LzIAL2RhcmsyOC8zAC9kYXJrMjgvNAAvZGFyazI4LzUAL2RhcmsyOC82AC9kYXJrMjgvNwAvZGFyazI4LzgAL2duYnUzLzEAL2duYnUzLzIAL2duYnUzLzMAL2duYnU0LzEAL2duYnU0LzIAL2duYnU0LzMAL2duYnU0LzQAL2duYnU1LzEAL2duYnU1LzIAL2duYnU1LzMAL2duYnU1LzQAL2duYnU1LzUAL2duYnU2LzEAL2duYnU2LzIAL2duYnU2LzMAL2duYnU2LzQAL2duYnU2LzUAL2duYnU2LzYAL2duYnU3LzEAL2duYnU3LzIAL2duYnU3LzMAL2duYnU3LzQAL2duYnU3LzUAL2duYnU3LzYAL2duYnU3LzcAL2duYnU4LzEAL2duYnU4LzIAL2duYnU4LzMAL2duYnU4LzQAL2duYnU4LzUAL2duYnU4LzYAL2duYnU4LzcAL2duYnU4LzgAL2duYnU5LzEAL2duYnU5LzIAL2duYnU5LzMAL2duYnU5LzQAL2duYnU5LzUAL2duYnU5LzYAL2duYnU5LzcAL2duYnU5LzgAL2duYnU5LzkAL2dyZWVuczMvMQAvZ3JlZW5zMy8yAC9ncmVlbnMzLzMAL2dyZWVuczQvMQAvZ3JlZW5zNC8yAC9ncmVlbnM0LzMAL2dyZWVuczQvNAAvZ3JlZW5zNS8xAC9ncmVlbnM1LzIAL2dyZWVuczUvMwAvZ3JlZW5zNS80AC9ncmVlbnM1LzUAL2dyZWVuczYvMQAvZ3JlZW5zNi8yAC9ncmVlbnM2LzMAL2dyZWVuczYvNAAvZ3JlZW5zNi81AC9ncmVlbnM2LzYAL2dyZWVuczcvMQAvZ3JlZW5zNy8yAC9ncmVlbnM3LzMAL2dyZWVuczcvNAAvZ3JlZW5zNy81AC9ncmVlbnM3LzYAL2dyZWVuczcvNwAvZ3JlZW5zOC8xAC9ncmVlbnM4LzIAL2dyZWVuczgvMwAvZ3JlZW5zOC80AC9ncmVlbnM4LzUAL2dyZWVuczgvNgAvZ3JlZW5zOC83AC9ncmVlbnM4LzgAL2dyZWVuczkvMQAvZ3JlZW5zOS8yAC9ncmVlbnM5LzMAL2dyZWVuczkvNAAvZ3JlZW5zOS81AC9ncmVlbnM5LzYAL2dyZWVuczkvNwAvZ3JlZW5zOS84AC9ncmVlbnM5LzkAL2dyZXlzMy8xAC9ncmV5czMvMgAvZ3JleXMzLzMAL2dyZXlzNC8xAC9ncmV5czQvMgAvZ3JleXM0LzMAL2dyZXlzNC80AC9ncmV5czUvMQAvZ3JleXM1LzIAL2dyZXlzNS8zAC9ncmV5czUvNAAvZ3JleXM1LzUAL2dyZXlzNi8xAC9ncmV5czYvMgAvZ3JleXM2LzMAL2dyZXlzNi80AC9ncmV5czYvNQAvZ3JleXM2LzYAL2dyZXlzNy8xAC9ncmV5czcvMgAvZ3JleXM3LzMAL2dyZXlzNy80AC9ncmV5czcvNQAvZ3JleXM3LzYAL2dyZXlzNy83AC9ncmV5czgvMQAvZ3JleXM4LzIAL2dyZXlzOC8zAC9ncmV5czgvNAAvZ3JleXM4LzUAL2dyZXlzOC82AC9ncmV5czgvNwAvZ3JleXM4LzgAL2dyZXlzOS8xAC9ncmV5czkvMgAvZ3JleXM5LzMAL2dyZXlzOS80AC9ncmV5czkvNQAvZ3JleXM5LzYAL2dyZXlzOS83AC9ncmV5czkvOAAvZ3JleXM5LzkAL29yYW5nZXMzLzEAL29yYW5nZXMzLzIAL29yYW5nZXMzLzMAL29yYW5nZXM0LzEAL29yYW5nZXM0LzIAL29yYW5nZXM0LzMAL29yYW5nZXM0LzQAL29yYW5nZXM1LzEAL29yYW5nZXM1LzIAL29yYW5nZXM1LzMAL29yYW5nZXM1LzQAL29yYW5nZXM1LzUAL29yYW5nZXM2LzEAL29yYW5nZXM2LzIAL29yYW5nZXM2LzMAL29yYW5nZXM2LzQAL29yYW5nZXM2LzUAL29yYW5nZXM2LzYAL29yYW5nZXM3LzEAL29yYW5nZXM3LzIAL29yYW5nZXM3LzMAL29yYW5nZXM3LzQAL29yYW5nZXM3LzUAL29yYW5nZXM3LzYAL29yYW5nZXM3LzcAL29yYW5nZXM4LzEAL29yYW5nZXM4LzIAL29yYW5nZXM4LzMAL29yYW5nZXM4LzQAL29yYW5nZXM4LzUAL29yYW5nZXM4LzYAL29yYW5nZXM4LzcAL29yYW5nZXM4LzgAL29yYW5nZXM5LzEAL29yYW5nZXM5LzIAL29yYW5nZXM5LzMAL29yYW5nZXM5LzQAL29yYW5nZXM5LzUAL29yYW5nZXM5LzYAL29yYW5nZXM5LzcAL29yYW5nZXM5LzgAL29yYW5nZXM5LzkAL29ycmQzLzEAL29ycmQzLzIAL29ycmQzLzMAL29ycmQ0LzEAL29ycmQ0LzIAL29ycmQ0LzMAL29ycmQ0LzQAL29ycmQ1LzEAL29ycmQ1LzIAL29ycmQ1LzMAL29ycmQ1LzQAL29ycmQ1LzUAL29ycmQ2LzEAL29ycmQ2LzIAL29ycmQ2LzMAL29ycmQ2LzQAL29ycmQ2LzUAL29ycmQ2LzYAL29ycmQ3LzEAL29ycmQ3LzIAL29ycmQ3LzMAL29ycmQ3LzQAL29ycmQ3LzUAL29ycmQ3LzYAL29ycmQ3LzcAL29ycmQ4LzEAL29ycmQ4LzIAL29ycmQ4LzMAL29ycmQ4LzQAL29ycmQ4LzUAL29ycmQ4LzYAL29ycmQ4LzcAL29ycmQ4LzgAL29ycmQ5LzEAL29ycmQ5LzIAL29ycmQ5LzMAL29ycmQ5LzQAL29ycmQ5LzUAL29ycmQ5LzYAL29ycmQ5LzcAL29ycmQ5LzgAL29ycmQ5LzkAL3BhaXJlZDEwLzEAL3BhaXJlZDEwLzEwAC9wYWlyZWQxMC8yAC9wYWlyZWQxMC8zAC9wYWlyZWQxMC80AC9wYWlyZWQxMC81AC9wYWlyZWQxMC82AC9wYWlyZWQxMC83AC9wYWlyZWQxMC84AC9wYWlyZWQxMC85AC9wYWlyZWQxMS8xAC9wYWlyZWQxMS8xMAAvcGFpcmVkMTEvMTEAL3BhaXJlZDExLzIAL3BhaXJlZDExLzMAL3BhaXJlZDExLzQAL3BhaXJlZDExLzUAL3BhaXJlZDExLzYAL3BhaXJlZDExLzcAL3BhaXJlZDExLzgAL3BhaXJlZDExLzkAL3BhaXJlZDEyLzEAL3BhaXJlZDEyLzEwAC9wYWlyZWQxMi8xMQAvcGFpcmVkMTIvMTIAL3BhaXJlZDEyLzIAL3BhaXJlZDEyLzMAL3BhaXJlZDEyLzQAL3BhaXJlZDEyLzUAL3BhaXJlZDEyLzYAL3BhaXJlZDEyLzcAL3BhaXJlZDEyLzgAL3BhaXJlZDEyLzkAL3BhaXJlZDMvMQAvcGFpcmVkMy8yAC9wYWlyZWQzLzMAL3BhaXJlZDQvMQAvcGFpcmVkNC8yAC9wYWlyZWQ0LzMAL3BhaXJlZDQvNAAvcGFpcmVkNS8xAC9wYWlyZWQ1LzIAL3BhaXJlZDUvMwAvcGFpcmVkNS80AC9wYWlyZWQ1LzUAL3BhaXJlZDYvMQAvcGFpcmVkNi8yAC9wYWlyZWQ2LzMAL3BhaXJlZDYvNAAvcGFpcmVkNi81AC9wYWlyZWQ2LzYAL3BhaXJlZDcvMQAvcGFpcmVkNy8yAC9wYWlyZWQ3LzMAL3BhaXJlZDcvNAAvcGFpcmVkNy81AC9wYWlyZWQ3LzYAL3BhaXJlZDcvNwAvcGFpcmVkOC8xAC9wYWlyZWQ4LzIAL3BhaXJlZDgvMwAvcGFpcmVkOC80AC9wYWlyZWQ4LzUAL3BhaXJlZDgvNgAvcGFpcmVkOC83AC9wYWlyZWQ4LzgAL3BhaXJlZDkvMQAvcGFpcmVkOS8yAC9wYWlyZWQ5LzMAL3BhaXJlZDkvNAAvcGFpcmVkOS81AC9wYWlyZWQ5LzYAL3BhaXJlZDkvNwAvcGFpcmVkOS84AC9wYWlyZWQ5LzkAL3Bhc3RlbDEzLzEAL3Bhc3RlbDEzLzIAL3Bhc3RlbDEzLzMAL3Bhc3RlbDE0LzEAL3Bhc3RlbDE0LzIAL3Bhc3RlbDE0LzMAL3Bhc3RlbDE0LzQAL3Bhc3RlbDE1LzEAL3Bhc3RlbDE1LzIAL3Bhc3RlbDE1LzMAL3Bhc3RlbDE1LzQAL3Bhc3RlbDE1LzUAL3Bhc3RlbDE2LzEAL3Bhc3RlbDE2LzIAL3Bhc3RlbDE2LzMAL3Bhc3RlbDE2LzQAL3Bhc3RlbDE2LzUAL3Bhc3RlbDE2LzYAL3Bhc3RlbDE3LzEAL3Bhc3RlbDE3LzIAL3Bhc3RlbDE3LzMAL3Bhc3RlbDE3LzQAL3Bhc3RlbDE3LzUAL3Bhc3RlbDE3LzYAL3Bhc3RlbDE3LzcAL3Bhc3RlbDE4LzEAL3Bhc3RlbDE4LzIAL3Bhc3RlbDE4LzMAL3Bhc3RlbDE4LzQAL3Bhc3RlbDE4LzUAL3Bhc3RlbDE4LzYAL3Bhc3RlbDE4LzcAL3Bhc3RlbDE4LzgAL3Bhc3RlbDE5LzEAL3Bhc3RlbDE5LzIAL3Bhc3RlbDE5LzMAL3Bhc3RlbDE5LzQAL3Bhc3RlbDE5LzUAL3Bhc3RlbDE5LzYAL3Bhc3RlbDE5LzcAL3Bhc3RlbDE5LzgAL3Bhc3RlbDE5LzkAL3Bhc3RlbDIzLzEAL3Bhc3RlbDIzLzIAL3Bhc3RlbDIzLzMAL3Bhc3RlbDI0LzEAL3Bhc3RlbDI0LzIAL3Bhc3RlbDI0LzMAL3Bhc3RlbDI0LzQAL3Bhc3RlbDI1LzEAL3Bhc3RlbDI1LzIAL3Bhc3RlbDI1LzMAL3Bhc3RlbDI1LzQAL3Bhc3RlbDI1LzUAL3Bhc3RlbDI2LzEAL3Bhc3RlbDI2LzIAL3Bhc3RlbDI2LzMAL3Bhc3RlbDI2LzQAL3Bhc3RlbDI2LzUAL3Bhc3RlbDI2LzYAL3Bhc3RlbDI3LzEAL3Bhc3RlbDI3LzIAL3Bhc3RlbDI3LzMAL3Bhc3RlbDI3LzQAL3Bhc3RlbDI3LzUAL3Bhc3RlbDI3LzYAL3Bhc3RlbDI3LzcAL3Bhc3RlbDI4LzEAL3Bhc3RlbDI4LzIAL3Bhc3RlbDI4LzMAL3Bhc3RlbDI4LzQAL3Bhc3RlbDI4LzUAL3Bhc3RlbDI4LzYAL3Bhc3RlbDI4LzcAL3Bhc3RlbDI4LzgAL3BpeWcxMC8xAC9waXlnMTAvMTAAL3BpeWcxMC8yAC9waXlnMTAvMwAvcGl5ZzEwLzQAL3BpeWcxMC81AC9waXlnMTAvNgAvcGl5ZzEwLzcAL3BpeWcxMC84AC9waXlnMTAvOQAvcGl5ZzExLzEAL3BpeWcxMS8xMAAvcGl5ZzExLzExAC9waXlnMTEvMgAvcGl5ZzExLzMAL3BpeWcxMS80AC9waXlnMTEvNQAvcGl5ZzExLzYAL3BpeWcxMS83AC9waXlnMTEvOAAvcGl5ZzExLzkAL3BpeWczLzEAL3BpeWczLzIAL3BpeWczLzMAL3BpeWc0LzEAL3BpeWc0LzIAL3BpeWc0LzMAL3BpeWc0LzQAL3BpeWc1LzEAL3BpeWc1LzIAL3BpeWc1LzMAL3BpeWc1LzQAL3BpeWc1LzUAL3BpeWc2LzEAL3BpeWc2LzIAL3BpeWc2LzMAL3BpeWc2LzQAL3BpeWc2LzUAL3BpeWc2LzYAL3BpeWc3LzEAL3BpeWc3LzIAL3BpeWc3LzMAL3BpeWc3LzQAL3BpeWc3LzUAL3BpeWc3LzYAL3BpeWc3LzcAL3BpeWc4LzEAL3BpeWc4LzIAL3BpeWc4LzMAL3BpeWc4LzQAL3BpeWc4LzUAL3BpeWc4LzYAL3BpeWc4LzcAL3BpeWc4LzgAL3BpeWc5LzEAL3BpeWc5LzIAL3BpeWc5LzMAL3BpeWc5LzQAL3BpeWc5LzUAL3BpeWc5LzYAL3BpeWc5LzcAL3BpeWc5LzgAL3BpeWc5LzkAL3ByZ24xMC8xAC9wcmduMTAvMTAAL3ByZ24xMC8yAC9wcmduMTAvMwAvcHJnbjEwLzQAL3ByZ24xMC81AC9wcmduMTAvNgAvcHJnbjEwLzcAL3ByZ24xMC84AC9wcmduMTAvOQAvcHJnbjExLzEAL3ByZ24xMS8xMAAvcHJnbjExLzExAC9wcmduMTEvMgAvcHJnbjExLzMAL3ByZ24xMS80AC9wcmduMTEvNQAvcHJnbjExLzYAL3ByZ24xMS83AC9wcmduMTEvOAAvcHJnbjExLzkAL3ByZ24zLzEAL3ByZ24zLzIAL3ByZ24zLzMAL3ByZ240LzEAL3ByZ240LzIAL3ByZ240LzMAL3ByZ240LzQAL3ByZ241LzEAL3ByZ241LzIAL3ByZ241LzMAL3ByZ241LzQAL3ByZ241LzUAL3ByZ242LzEAL3ByZ242LzIAL3ByZ242LzMAL3ByZ242LzQAL3ByZ242LzUAL3ByZ242LzYAL3ByZ243LzEAL3ByZ243LzIAL3ByZ243LzMAL3ByZ243LzQAL3ByZ243LzUAL3ByZ243LzYAL3ByZ243LzcAL3ByZ244LzEAL3ByZ244LzIAL3ByZ244LzMAL3ByZ244LzQAL3ByZ244LzUAL3ByZ244LzYAL3ByZ244LzcAL3ByZ244LzgAL3ByZ245LzEAL3ByZ245LzIAL3ByZ245LzMAL3ByZ245LzQAL3ByZ245LzUAL3ByZ245LzYAL3ByZ245LzcAL3ByZ245LzgAL3ByZ245LzkAL3B1YnUzLzEAL3B1YnUzLzIAL3B1YnUzLzMAL3B1YnU0LzEAL3B1YnU0LzIAL3B1YnU0LzMAL3B1YnU0LzQAL3B1YnU1LzEAL3B1YnU1LzIAL3B1YnU1LzMAL3B1YnU1LzQAL3B1YnU1LzUAL3B1YnU2LzEAL3B1YnU2LzIAL3B1YnU2LzMAL3B1YnU2LzQAL3B1YnU2LzUAL3B1YnU2LzYAL3B1YnU3LzEAL3B1YnU3LzIAL3B1YnU3LzMAL3B1YnU3LzQAL3B1YnU3LzUAL3B1YnU3LzYAL3B1YnU3LzcAL3B1YnU4LzEAL3B1YnU4LzIAL3B1YnU4LzMAL3B1YnU4LzQAL3B1YnU4LzUAL3B1YnU4LzYAL3B1YnU4LzcAL3B1YnU4LzgAL3B1YnU5LzEAL3B1YnU5LzIAL3B1YnU5LzMAL3B1YnU5LzQAL3B1YnU5LzUAL3B1YnU5LzYAL3B1YnU5LzcAL3B1YnU5LzgAL3B1YnU5LzkAL3B1YnVnbjMvMQAvcHVidWduMy8yAC9wdWJ1Z24zLzMAL3B1YnVnbjQvMQAvcHVidWduNC8yAC9wdWJ1Z240LzMAL3B1YnVnbjQvNAAvcHVidWduNS8xAC9wdWJ1Z241LzIAL3B1YnVnbjUvMwAvcHVidWduNS80AC9wdWJ1Z241LzUAL3B1YnVnbjYvMQAvcHVidWduNi8yAC9wdWJ1Z242LzMAL3B1YnVnbjYvNAAvcHVidWduNi81AC9wdWJ1Z242LzYAL3B1YnVnbjcvMQAvcHVidWduNy8yAC9wdWJ1Z243LzMAL3B1YnVnbjcvNAAvcHVidWduNy81AC9wdWJ1Z243LzYAL3B1YnVnbjcvNwAvcHVidWduOC8xAC9wdWJ1Z244LzIAL3B1YnVnbjgvMwAvcHVidWduOC80AC9wdWJ1Z244LzUAL3B1YnVnbjgvNgAvcHVidWduOC83AC9wdWJ1Z244LzgAL3B1YnVnbjkvMQAvcHVidWduOS8yAC9wdWJ1Z245LzMAL3B1YnVnbjkvNAAvcHVidWduOS81AC9wdWJ1Z245LzYAL3B1YnVnbjkvNwAvcHVidWduOS84AC9wdWJ1Z245LzkAL3B1b3IxMC8xAC9wdW9yMTAvMTAAL3B1b3IxMC8yAC9wdW9yMTAvMwAvcHVvcjEwLzQAL3B1b3IxMC81AC9wdW9yMTAvNgAvcHVvcjEwLzcAL3B1b3IxMC84AC9wdW9yMTAvOQAvcHVvcjExLzEAL3B1b3IxMS8xMAAvcHVvcjExLzExAC9wdW9yMTEvMgAvcHVvcjExLzMAL3B1b3IxMS80AC9wdW9yMTEvNQAvcHVvcjExLzYAL3B1b3IxMS83AC9wdW9yMTEvOAAvcHVvcjExLzkAL3B1b3IzLzEAL3B1b3IzLzIAL3B1b3IzLzMAL3B1b3I0LzEAL3B1b3I0LzIAL3B1b3I0LzMAL3B1b3I0LzQAL3B1b3I1LzEAL3B1b3I1LzIAL3B1b3I1LzMAL3B1b3I1LzQAL3B1b3I1LzUAL3B1b3I2LzEAL3B1b3I2LzIAL3B1b3I2LzMAL3B1b3I2LzQAL3B1b3I2LzUAL3B1b3I2LzYAL3B1b3I3LzEAL3B1b3I3LzIAL3B1b3I3LzMAL3B1b3I3LzQAL3B1b3I3LzUAL3B1b3I3LzYAL3B1b3I3LzcAL3B1b3I4LzEAL3B1b3I4LzIAL3B1b3I4LzMAL3B1b3I4LzQAL3B1b3I4LzUAL3B1b3I4LzYAL3B1b3I4LzcAL3B1b3I4LzgAL3B1b3I5LzEAL3B1b3I5LzIAL3B1b3I5LzMAL3B1b3I5LzQAL3B1b3I5LzUAL3B1b3I5LzYAL3B1b3I5LzcAL3B1b3I5LzgAL3B1b3I5LzkAL3B1cmQzLzEAL3B1cmQzLzIAL3B1cmQzLzMAL3B1cmQ0LzEAL3B1cmQ0LzIAL3B1cmQ0LzMAL3B1cmQ0LzQAL3B1cmQ1LzEAL3B1cmQ1LzIAL3B1cmQ1LzMAL3B1cmQ1LzQAL3B1cmQ1LzUAL3B1cmQ2LzEAL3B1cmQ2LzIAL3B1cmQ2LzMAL3B1cmQ2LzQAL3B1cmQ2LzUAL3B1cmQ2LzYAL3B1cmQ3LzEAL3B1cmQ3LzIAL3B1cmQ3LzMAL3B1cmQ3LzQAL3B1cmQ3LzUAL3B1cmQ3LzYAL3B1cmQ3LzcAL3B1cmQ4LzEAL3B1cmQ4LzIAL3B1cmQ4LzMAL3B1cmQ4LzQAL3B1cmQ4LzUAL3B1cmQ4LzYAL3B1cmQ4LzcAL3B1cmQ4LzgAL3B1cmQ5LzEAL3B1cmQ5LzIAL3B1cmQ5LzMAL3B1cmQ5LzQAL3B1cmQ5LzUAL3B1cmQ5LzYAL3B1cmQ5LzcAL3B1cmQ5LzgAL3B1cmQ5LzkAL3B1cnBsZXMzLzEAL3B1cnBsZXMzLzIAL3B1cnBsZXMzLzMAL3B1cnBsZXM0LzEAL3B1cnBsZXM0LzIAL3B1cnBsZXM0LzMAL3B1cnBsZXM0LzQAL3B1cnBsZXM1LzEAL3B1cnBsZXM1LzIAL3B1cnBsZXM1LzMAL3B1cnBsZXM1LzQAL3B1cnBsZXM1LzUAL3B1cnBsZXM2LzEAL3B1cnBsZXM2LzIAL3B1cnBsZXM2LzMAL3B1cnBsZXM2LzQAL3B1cnBsZXM2LzUAL3B1cnBsZXM2LzYAL3B1cnBsZXM3LzEAL3B1cnBsZXM3LzIAL3B1cnBsZXM3LzMAL3B1cnBsZXM3LzQAL3B1cnBsZXM3LzUAL3B1cnBsZXM3LzYAL3B1cnBsZXM3LzcAL3B1cnBsZXM4LzEAL3B1cnBsZXM4LzIAL3B1cnBsZXM4LzMAL3B1cnBsZXM4LzQAL3B1cnBsZXM4LzUAL3B1cnBsZXM4LzYAL3B1cnBsZXM4LzcAL3B1cnBsZXM4LzgAL3B1cnBsZXM5LzEAL3B1cnBsZXM5LzIAL3B1cnBsZXM5LzMAL3B1cnBsZXM5LzQAL3B1cnBsZXM5LzUAL3B1cnBsZXM5LzYAL3B1cnBsZXM5LzcAL3B1cnBsZXM5LzgAL3B1cnBsZXM5LzkAL3JkYnUxMC8xAC9yZGJ1MTAvMTAAL3JkYnUxMC8yAC9yZGJ1MTAvMwAvcmRidTEwLzQAL3JkYnUxMC81AC9yZGJ1MTAvNgAvcmRidTEwLzcAL3JkYnUxMC84AC9yZGJ1MTAvOQAvcmRidTExLzEAL3JkYnUxMS8xMAAvcmRidTExLzExAC9yZGJ1MTEvMgAvcmRidTExLzMAL3JkYnUxMS80AC9yZGJ1MTEvNQAvcmRidTExLzYAL3JkYnUxMS83AC9yZGJ1MTEvOAAvcmRidTExLzkAL3JkYnUzLzEAL3JkYnUzLzIAL3JkYnUzLzMAL3JkYnU0LzEAL3JkYnU0LzIAL3JkYnU0LzMAL3JkYnU0LzQAL3JkYnU1LzEAL3JkYnU1LzIAL3JkYnU1LzMAL3JkYnU1LzQAL3JkYnU1LzUAL3JkYnU2LzEAL3JkYnU2LzIAL3JkYnU2LzMAL3JkYnU2LzQAL3JkYnU2LzUAL3JkYnU2LzYAL3JkYnU3LzEAL3JkYnU3LzIAL3JkYnU3LzMAL3JkYnU3LzQAL3JkYnU3LzUAL3JkYnU3LzYAL3JkYnU3LzcAL3JkYnU4LzEAL3JkYnU4LzIAL3JkYnU4LzMAL3JkYnU4LzQAL3JkYnU4LzUAL3JkYnU4LzYAL3JkYnU4LzcAL3JkYnU4LzgAL3JkYnU5LzEAL3JkYnU5LzIAL3JkYnU5LzMAL3JkYnU5LzQAL3JkYnU5LzUAL3JkYnU5LzYAL3JkYnU5LzcAL3JkYnU5LzgAL3JkYnU5LzkAL3JkZ3kxMC8xAC9yZGd5MTAvMTAAL3JkZ3kxMC8yAC9yZGd5MTAvMwAvcmRneTEwLzQAL3JkZ3kxMC81AC9yZGd5MTAvNgAvcmRneTEwLzcAL3JkZ3kxMC84AC9yZGd5MTAvOQAvcmRneTExLzEAL3JkZ3kxMS8xMAAvcmRneTExLzExAC9yZGd5MTEvMgAvcmRneTExLzMAL3JkZ3kxMS80AC9yZGd5MTEvNQAvcmRneTExLzYAL3JkZ3kxMS83AC9yZGd5MTEvOAAvcmRneTExLzkAL3JkZ3kzLzEAL3JkZ3kzLzIAL3JkZ3kzLzMAL3JkZ3k0LzEAL3JkZ3k0LzIAL3JkZ3k0LzMAL3JkZ3k0LzQAL3JkZ3k1LzEAL3JkZ3k1LzIAL3JkZ3k1LzMAL3JkZ3k1LzQAL3JkZ3k1LzUAL3JkZ3k2LzEAL3JkZ3k2LzIAL3JkZ3k2LzMAL3JkZ3k2LzQAL3JkZ3k2LzUAL3JkZ3k2LzYAL3JkZ3k3LzEAL3JkZ3k3LzIAL3JkZ3k3LzMAL3JkZ3k3LzQAL3JkZ3k3LzUAL3JkZ3k3LzYAL3JkZ3k3LzcAL3JkZ3k4LzEAL3JkZ3k4LzIAL3JkZ3k4LzMAL3JkZ3k4LzQAL3JkZ3k4LzUAL3JkZ3k4LzYAL3JkZ3k4LzcAL3JkZ3k4LzgAL3JkZ3k5LzEAL3JkZ3k5LzIAL3JkZ3k5LzMAL3JkZ3k5LzQAL3JkZ3k5LzUAL3JkZ3k5LzYAL3JkZ3k5LzcAL3JkZ3k5LzgAL3JkZ3k5LzkAL3JkcHUzLzEAL3JkcHUzLzIAL3JkcHUzLzMAL3JkcHU0LzEAL3JkcHU0LzIAL3JkcHU0LzMAL3JkcHU0LzQAL3JkcHU1LzEAL3JkcHU1LzIAL3JkcHU1LzMAL3JkcHU1LzQAL3JkcHU1LzUAL3JkcHU2LzEAL3JkcHU2LzIAL3JkcHU2LzMAL3JkcHU2LzQAL3JkcHU2LzUAL3JkcHU2LzYAL3JkcHU3LzEAL3JkcHU3LzIAL3JkcHU3LzMAL3JkcHU3LzQAL3JkcHU3LzUAL3JkcHU3LzYAL3JkcHU3LzcAL3JkcHU4LzEAL3JkcHU4LzIAL3JkcHU4LzMAL3JkcHU4LzQAL3JkcHU4LzUAL3JkcHU4LzYAL3JkcHU4LzcAL3JkcHU4LzgAL3JkcHU5LzEAL3JkcHU5LzIAL3JkcHU5LzMAL3JkcHU5LzQAL3JkcHU5LzUAL3JkcHU5LzYAL3JkcHU5LzcAL3JkcHU5LzgAL3JkcHU5LzkAL3JkeWxidTEwLzEAL3JkeWxidTEwLzEwAC9yZHlsYnUxMC8yAC9yZHlsYnUxMC8zAC9yZHlsYnUxMC80AC9yZHlsYnUxMC81AC9yZHlsYnUxMC82AC9yZHlsYnUxMC83AC9yZHlsYnUxMC84AC9yZHlsYnUxMC85AC9yZHlsYnUxMS8xAC9yZHlsYnUxMS8xMAAvcmR5bGJ1MTEvMTEAL3JkeWxidTExLzIAL3JkeWxidTExLzMAL3JkeWxidTExLzQAL3JkeWxidTExLzUAL3JkeWxidTExLzYAL3JkeWxidTExLzcAL3JkeWxidTExLzgAL3JkeWxidTExLzkAL3JkeWxidTMvMQAvcmR5bGJ1My8yAC9yZHlsYnUzLzMAL3JkeWxidTQvMQAvcmR5bGJ1NC8yAC9yZHlsYnU0LzMAL3JkeWxidTQvNAAvcmR5bGJ1NS8xAC9yZHlsYnU1LzIAL3JkeWxidTUvMwAvcmR5bGJ1NS80AC9yZHlsYnU1LzUAL3JkeWxidTYvMQAvcmR5bGJ1Ni8yAC9yZHlsYnU2LzMAL3JkeWxidTYvNAAvcmR5bGJ1Ni81AC9yZHlsYnU2LzYAL3JkeWxidTcvMQAvcmR5bGJ1Ny8yAC9yZHlsYnU3LzMAL3JkeWxidTcvNAAvcmR5bGJ1Ny81AC9yZHlsYnU3LzYAL3JkeWxidTcvNwAvcmR5bGJ1OC8xAC9yZHlsYnU4LzIAL3JkeWxidTgvMwAvcmR5bGJ1OC80AC9yZHlsYnU4LzUAL3JkeWxidTgvNgAvcmR5bGJ1OC83AC9yZHlsYnU4LzgAL3JkeWxidTkvMQAvcmR5bGJ1OS8yAC9yZHlsYnU5LzMAL3JkeWxidTkvNAAvcmR5bGJ1OS81AC9yZHlsYnU5LzYAL3JkeWxidTkvNwAvcmR5bGJ1OS84AC9yZHlsYnU5LzkAL3JkeWxnbjEwLzEAL3JkeWxnbjEwLzEwAC9yZHlsZ24xMC8yAC9yZHlsZ24xMC8zAC9yZHlsZ24xMC80AC9yZHlsZ24xMC81AC9yZHlsZ24xMC82AC9yZHlsZ24xMC83AC9yZHlsZ24xMC84AC9yZHlsZ24xMC85AC9yZHlsZ24xMS8xAC9yZHlsZ24xMS8xMAAvcmR5bGduMTEvMTEAL3JkeWxnbjExLzIAL3JkeWxnbjExLzMAL3JkeWxnbjExLzQAL3JkeWxnbjExLzUAL3JkeWxnbjExLzYAL3JkeWxnbjExLzcAL3JkeWxnbjExLzgAL3JkeWxnbjExLzkAL3JkeWxnbjMvMQAvcmR5bGduMy8yAC9yZHlsZ24zLzMAL3JkeWxnbjQvMQAvcmR5bGduNC8yAC9yZHlsZ240LzMAL3JkeWxnbjQvNAAvcmR5bGduNS8xAC9yZHlsZ241LzIAL3JkeWxnbjUvMwAvcmR5bGduNS80AC9yZHlsZ241LzUAL3JkeWxnbjYvMQAvcmR5bGduNi8yAC9yZHlsZ242LzMAL3JkeWxnbjYvNAAvcmR5bGduNi81AC9yZHlsZ242LzYAL3JkeWxnbjcvMQAvcmR5bGduNy8yAC9yZHlsZ243LzMAL3JkeWxnbjcvNAAvcmR5bGduNy81AC9yZHlsZ243LzYAL3JkeWxnbjcvNwAvcmR5bGduOC8xAC9yZHlsZ244LzIAL3JkeWxnbjgvMwAvcmR5bGduOC80AC9yZHlsZ244LzUAL3JkeWxnbjgvNgAvcmR5bGduOC83AC9yZHlsZ244LzgAL3JkeWxnbjkvMQAvcmR5bGduOS8yAC9yZHlsZ245LzMAL3JkeWxnbjkvNAAvcmR5bGduOS81AC9yZHlsZ245LzYAL3JkeWxnbjkvNwAvcmR5bGduOS84AC9yZHlsZ245LzkAL3JlZHMzLzEAL3JlZHMzLzIAL3JlZHMzLzMAL3JlZHM0LzEAL3JlZHM0LzIAL3JlZHM0LzMAL3JlZHM0LzQAL3JlZHM1LzEAL3JlZHM1LzIAL3JlZHM1LzMAL3JlZHM1LzQAL3JlZHM1LzUAL3JlZHM2LzEAL3JlZHM2LzIAL3JlZHM2LzMAL3JlZHM2LzQAL3JlZHM2LzUAL3JlZHM2LzYAL3JlZHM3LzEAL3JlZHM3LzIAL3JlZHM3LzMAL3JlZHM3LzQAL3JlZHM3LzUAL3JlZHM3LzYAL3JlZHM3LzcAL3JlZHM4LzEAL3JlZHM4LzIAL3JlZHM4LzMAL3JlZHM4LzQAL3JlZHM4LzUAL3JlZHM4LzYAL3JlZHM4LzcAL3JlZHM4LzgAL3JlZHM5LzEAL3JlZHM5LzIAL3JlZHM5LzMAL3JlZHM5LzQAL3JlZHM5LzUAL3JlZHM5LzYAL3JlZHM5LzcAL3JlZHM5LzgAL3JlZHM5LzkAL3NldDEzLzEAL3NldDEzLzIAL3NldDEzLzMAL3NldDE0LzEAL3NldDE0LzIAL3NldDE0LzMAL3NldDE0LzQAL3NldDE1LzEAL3NldDE1LzIAL3NldDE1LzMAL3NldDE1LzQAL3NldDE1LzUAL3NldDE2LzEAL3NldDE2LzIAL3NldDE2LzMAL3NldDE2LzQAL3NldDE2LzUAL3NldDE2LzYAL3NldDE3LzEAL3NldDE3LzIAL3NldDE3LzMAL3NldDE3LzQAL3NldDE3LzUAL3NldDE3LzYAL3NldDE3LzcAL3NldDE4LzEAL3NldDE4LzIAL3NldDE4LzMAL3NldDE4LzQAL3NldDE4LzUAL3NldDE4LzYAL3NldDE4LzcAL3NldDE4LzgAL3NldDE5LzEAL3NldDE5LzIAL3NldDE5LzMAL3NldDE5LzQAL3NldDE5LzUAL3NldDE5LzYAL3NldDE5LzcAL3NldDE5LzgAL3NldDE5LzkAL3NldDIzLzEAL3NldDIzLzIAL3NldDIzLzMAL3NldDI0LzEAL3NldDI0LzIAL3NldDI0LzMAL3NldDI0LzQAL3NldDI1LzEAL3NldDI1LzIAL3NldDI1LzMAL3NldDI1LzQAL3NldDI1LzUAL3NldDI2LzEAL3NldDI2LzIAL3NldDI2LzMAL3NldDI2LzQAL3NldDI2LzUAL3NldDI2LzYAL3NldDI3LzEAL3NldDI3LzIAL3NldDI3LzMAL3NldDI3LzQAL3NldDI3LzUAL3NldDI3LzYAL3NldDI3LzcAL3NldDI4LzEAL3NldDI4LzIAL3NldDI4LzMAL3NldDI4LzQAL3NldDI4LzUAL3NldDI4LzYAL3NldDI4LzcAL3NldDI4LzgAL3NldDMxMC8xAC9zZXQzMTAvMTAAL3NldDMxMC8yAC9zZXQzMTAvMwAvc2V0MzEwLzQAL3NldDMxMC81AC9zZXQzMTAvNgAvc2V0MzEwLzcAL3NldDMxMC84AC9zZXQzMTAvOQAvc2V0MzExLzEAL3NldDMxMS8xMAAvc2V0MzExLzExAC9zZXQzMTEvMgAvc2V0MzExLzMAL3NldDMxMS80AC9zZXQzMTEvNQAvc2V0MzExLzYAL3NldDMxMS83AC9zZXQzMTEvOAAvc2V0MzExLzkAL3NldDMxMi8xAC9zZXQzMTIvMTAAL3NldDMxMi8xMQAvc2V0MzEyLzEyAC9zZXQzMTIvMgAvc2V0MzEyLzMAL3NldDMxMi80AC9zZXQzMTIvNQAvc2V0MzEyLzYAL3NldDMxMi83AC9zZXQzMTIvOAAvc2V0MzEyLzkAL3NldDMzLzEAL3NldDMzLzIAL3NldDMzLzMAL3NldDM0LzEAL3NldDM0LzIAL3NldDM0LzMAL3NldDM0LzQAL3NldDM1LzEAL3NldDM1LzIAL3NldDM1LzMAL3NldDM1LzQAL3NldDM1LzUAL3NldDM2LzEAL3NldDM2LzIAL3NldDM2LzMAL3NldDM2LzQAL3NldDM2LzUAL3NldDM2LzYAL3NldDM3LzEAL3NldDM3LzIAL3NldDM3LzMAL3NldDM3LzQAL3NldDM3LzUAL3NldDM3LzYAL3NldDM3LzcAL3NldDM4LzEAL3NldDM4LzIAL3NldDM4LzMAL3NldDM4LzQAL3NldDM4LzUAL3NldDM4LzYAL3NldDM4LzcAL3NldDM4LzgAL3NldDM5LzEAL3NldDM5LzIAL3NldDM5LzMAL3NldDM5LzQAL3NldDM5LzUAL3NldDM5LzYAL3NldDM5LzcAL3NldDM5LzgAL3NldDM5LzkAL3NwZWN0cmFsMTAvMQAvc3BlY3RyYWwxMC8xMAAvc3BlY3RyYWwxMC8yAC9zcGVjdHJhbDEwLzMAL3NwZWN0cmFsMTAvNAAvc3BlY3RyYWwxMC81AC9zcGVjdHJhbDEwLzYAL3NwZWN0cmFsMTAvNwAvc3BlY3RyYWwxMC84AC9zcGVjdHJhbDEwLzkAL3NwZWN0cmFsMTEvMQAvc3BlY3RyYWwxMS8xMAAvc3BlY3RyYWwxMS8xMQAvc3BlY3RyYWwxMS8yAC9zcGVjdHJhbDExLzMAL3NwZWN0cmFsMTEvNAAvc3BlY3RyYWwxMS81AC9zcGVjdHJhbDExLzYAL3NwZWN0cmFsMTEvNwAvc3BlY3RyYWwxMS84AC9zcGVjdHJhbDExLzkAL3NwZWN0cmFsMy8xAC9zcGVjdHJhbDMvMgAvc3BlY3RyYWwzLzMAL3NwZWN0cmFsNC8xAC9zcGVjdHJhbDQvMgAvc3BlY3RyYWw0LzMAL3NwZWN0cmFsNC80AC9zcGVjdHJhbDUvMQAvc3BlY3RyYWw1LzIAL3NwZWN0cmFsNS8zAC9zcGVjdHJhbDUvNAAvc3BlY3RyYWw1LzUAL3NwZWN0cmFsNi8xAC9zcGVjdHJhbDYvMgAvc3BlY3RyYWw2LzMAL3NwZWN0cmFsNi80AC9zcGVjdHJhbDYvNQAvc3BlY3RyYWw2LzYAL3NwZWN0cmFsNy8xAC9zcGVjdHJhbDcvMgAvc3BlY3RyYWw3LzMAL3NwZWN0cmFsNy80AC9zcGVjdHJhbDcvNQAvc3BlY3RyYWw3LzYAL3NwZWN0cmFsNy83AC9zcGVjdHJhbDgvMQAvc3BlY3RyYWw4LzIAL3NwZWN0cmFsOC8zAC9zcGVjdHJhbDgvNAAvc3BlY3RyYWw4LzUAL3NwZWN0cmFsOC82AC9zcGVjdHJhbDgvNwAvc3BlY3RyYWw4LzgAL3NwZWN0cmFsOS8xAC9zcGVjdHJhbDkvMgAvc3BlY3RyYWw5LzMAL3NwZWN0cmFsOS80AC9zcGVjdHJhbDkvNQAvc3BlY3RyYWw5LzYAL3NwZWN0cmFsOS83AC9zcGVjdHJhbDkvOAAvc3BlY3RyYWw5LzkAL3N2Zy9hbGljZWJsdWUAL3N2Zy9hbnRpcXVld2hpdGUAL3N2Zy9hcXVhAC9zdmcvYXF1YW1hcmluZQAvc3ZnL2F6dXJlAC9zdmcvYmVpZ2UAL3N2Zy9iaXNxdWUAL3N2Zy9ibGFjawAvc3ZnL2JsYW5jaGVkYWxtb25kAC9zdmcvYmx1ZQAvc3ZnL2JsdWV2aW9sZXQAL3N2Zy9icm93bgAvc3ZnL2J1cmx5d29vZAAvc3ZnL2NhZGV0Ymx1ZQAvc3ZnL2NoYXJ0cmV1c2UAL3N2Zy9jaG9jb2xhdGUAL3N2Zy9jb3JhbAAvc3ZnL2Nvcm5mbG93ZXJibHVlAC9zdmcvY29ybnNpbGsAL3N2Zy9jcmltc29uAC9zdmcvY3lhbgAvc3ZnL2RhcmtibHVlAC9zdmcvZGFya2N5YW4AL3N2Zy9kYXJrZ29sZGVucm9kAC9zdmcvZGFya2dyYXkAL3N2Zy9kYXJrZ3JlZW4AL3N2Zy9kYXJrZ3JleQAvc3ZnL2RhcmtraGFraQAvc3ZnL2RhcmttYWdlbnRhAC9zdmcvZGFya29saXZlZ3JlZW4AL3N2Zy9kYXJrb3JhbmdlAC9zdmcvZGFya29yY2hpZAAvc3ZnL2RhcmtyZWQAL3N2Zy9kYXJrc2FsbW9uAC9zdmcvZGFya3NlYWdyZWVuAC9zdmcvZGFya3NsYXRlYmx1ZQAvc3ZnL2RhcmtzbGF0ZWdyYXkAL3N2Zy9kYXJrc2xhdGVncmV5AC9zdmcvZGFya3R1cnF1b2lzZQAvc3ZnL2Rhcmt2aW9sZXQAL3N2Zy9kZWVwcGluawAvc3ZnL2RlZXBza3libHVlAC9zdmcvZGltZ3JheQAvc3ZnL2RpbWdyZXkAL3N2Zy9kb2RnZXJibHVlAC9zdmcvZmlyZWJyaWNrAC9zdmcvZmxvcmFsd2hpdGUAL3N2Zy9mb3Jlc3RncmVlbgAvc3ZnL2Z1Y2hzaWEAL3N2Zy9nYWluc2Jvcm8AL3N2Zy9naG9zdHdoaXRlAC9zdmcvZ29sZAAvc3ZnL2dvbGRlbnJvZAAvc3ZnL2dyYXkAL3N2Zy9ncmVlbgAvc3ZnL2dyZWVueWVsbG93AC9zdmcvZ3JleQAvc3ZnL2hvbmV5ZGV3AC9zdmcvaG90cGluawAvc3ZnL2luZGlhbnJlZAAvc3ZnL2luZGlnbwAvc3ZnL2l2b3J5AC9zdmcva2hha2kAL3N2Zy9sYXZlbmRlcgAvc3ZnL2xhdmVuZGVyYmx1c2gAL3N2Zy9sYXduZ3JlZW4AL3N2Zy9sZW1vbmNoaWZmb24AL3N2Zy9saWdodGJsdWUAL3N2Zy9saWdodGNvcmFsAC9zdmcvbGlnaHRjeWFuAC9zdmcvbGlnaHRnb2xkZW5yb2R5ZWxsb3cAL3N2Zy9saWdodGdyYXkAL3N2Zy9saWdodGdyZWVuAC9zdmcvbGlnaHRncmV5AC9zdmcvbGlnaHRwaW5rAC9zdmcvbGlnaHRzYWxtb24AL3N2Zy9saWdodHNlYWdyZWVuAC9zdmcvbGlnaHRza3libHVlAC9zdmcvbGlnaHRzbGF0ZWdyYXkAL3N2Zy9saWdodHNsYXRlZ3JleQAvc3ZnL2xpZ2h0c3RlZWxibHVlAC9zdmcvbGlnaHR5ZWxsb3cAL3N2Zy9saW1lAC9zdmcvbGltZWdyZWVuAC9zdmcvbGluZW4AL3N2Zy9tYWdlbnRhAC9zdmcvbWFyb29uAC9zdmcvbWVkaXVtYXF1YW1hcmluZQAvc3ZnL21lZGl1bWJsdWUAL3N2Zy9tZWRpdW1vcmNoaWQAL3N2Zy9tZWRpdW1wdXJwbGUAL3N2Zy9tZWRpdW1zZWFncmVlbgAvc3ZnL21lZGl1bXNsYXRlYmx1ZQAvc3ZnL21lZGl1bXNwcmluZ2dyZWVuAC9zdmcvbWVkaXVtdHVycXVvaXNlAC9zdmcvbWVkaXVtdmlvbGV0cmVkAC9zdmcvbWlkbmlnaHRibHVlAC9zdmcvbWludGNyZWFtAC9zdmcvbWlzdHlyb3NlAC9zdmcvbW9jY2FzaW4AL3N2Zy9uYXZham93aGl0ZQAvc3ZnL25hdnkAL3N2Zy9vbGRsYWNlAC9zdmcvb2xpdmUAL3N2Zy9vbGl2ZWRyYWIAL3N2Zy9vcmFuZ2UAL3N2Zy9vcmFuZ2VyZWQAL3N2Zy9vcmNoaWQAL3N2Zy9wYWxlZ29sZGVucm9kAC9zdmcvcGFsZWdyZWVuAC9zdmcvcGFsZXR1cnF1b2lzZQAvc3ZnL3BhbGV2aW9sZXRyZWQAL3N2Zy9wYXBheWF3aGlwAC9zdmcvcGVhY2hwdWZmAC9zdmcvcGVydQAvc3ZnL3BpbmsAL3N2Zy9wbHVtAC9zdmcvcG93ZGVyYmx1ZQAvc3ZnL3B1cnBsZQAvc3ZnL3JlZAAvc3ZnL3Jvc3licm93bgAvc3ZnL3JveWFsYmx1ZQAvc3ZnL3NhZGRsZWJyb3duAC9zdmcvc2FsbW9uAC9zdmcvc2FuZHlicm93bgAvc3ZnL3NlYWdyZWVuAC9zdmcvc2Vhc2hlbGwAL3N2Zy9zaWVubmEAL3N2Zy9zaWx2ZXIAL3N2Zy9za3libHVlAC9zdmcvc2xhdGVibHVlAC9zdmcvc2xhdGVncmF5AC9zdmcvc2xhdGVncmV5AC9zdmcvc25vdwAvc3ZnL3NwcmluZ2dyZWVuAC9zdmcvc3RlZWxibHVlAC9zdmcvdGFuAC9zdmcvdGVhbAAvc3ZnL3RoaXN0bGUAL3N2Zy90b21hdG8AL3N2Zy90dXJxdW9pc2UAL3N2Zy92aW9sZXQAL3N2Zy93aGVhdAAvc3ZnL3doaXRlAC9zdmcvd2hpdGVzbW9rZQAvc3ZnL3llbGxvdwAvc3ZnL3llbGxvd2dyZWVuAC95bGduMy8xAC95bGduMy8yAC95bGduMy8zAC95bGduNC8xAC95bGduNC8yAC95bGduNC8zAC95bGduNC80AC95bGduNS8xAC95bGduNS8yAC95bGduNS8zAC95bGduNS80AC95bGduNS81AC95bGduNi8xAC95bGduNi8yAC95bGduNi8zAC95bGduNi80AC95bGduNi81AC95bGduNi82AC95bGduNy8xAC95bGduNy8yAC95bGduNy8zAC95bGduNy80AC95bGduNy81AC95bGduNy82AC95bGduNy83AC95bGduOC8xAC95bGduOC8yAC95bGduOC8zAC95bGduOC80AC95bGduOC81AC95bGduOC82AC95bGduOC83AC95bGduOC84AC95bGduOS8xAC95bGduOS8yAC95bGduOS8zAC95bGduOS80AC95bGduOS81AC95bGduOS82AC95bGduOS83AC95bGduOS84AC95bGduOS85AC95bGduYnUzLzEAL3lsZ25idTMvMgAveWxnbmJ1My8zAC95bGduYnU0LzEAL3lsZ25idTQvMgAveWxnbmJ1NC8zAC95bGduYnU0LzQAL3lsZ25idTUvMQAveWxnbmJ1NS8yAC95bGduYnU1LzMAL3lsZ25idTUvNAAveWxnbmJ1NS81AC95bGduYnU2LzEAL3lsZ25idTYvMgAveWxnbmJ1Ni8zAC95bGduYnU2LzQAL3lsZ25idTYvNQAveWxnbmJ1Ni82AC95bGduYnU3LzEAL3lsZ25idTcvMgAveWxnbmJ1Ny8zAC95bGduYnU3LzQAL3lsZ25idTcvNQAveWxnbmJ1Ny82AC95bGduYnU3LzcAL3lsZ25idTgvMQAveWxnbmJ1OC8yAC95bGduYnU4LzMAL3lsZ25idTgvNAAveWxnbmJ1OC81AC95bGduYnU4LzYAL3lsZ25idTgvNwAveWxnbmJ1OC84AC95bGduYnU5LzEAL3lsZ25idTkvMgAveWxnbmJ1OS8zAC95bGduYnU5LzQAL3lsZ25idTkvNQAveWxnbmJ1OS82AC95bGduYnU5LzcAL3lsZ25idTkvOAAveWxnbmJ1OS85AC95bG9yYnIzLzEAL3lsb3JicjMvMgAveWxvcmJyMy8zAC95bG9yYnI0LzEAL3lsb3JicjQvMgAveWxvcmJyNC8zAC95bG9yYnI0LzQAL3lsb3JicjUvMQAveWxvcmJyNS8yAC95bG9yYnI1LzMAL3lsb3JicjUvNAAveWxvcmJyNS81AC95bG9yYnI2LzEAL3lsb3JicjYvMgAveWxvcmJyNi8zAC95bG9yYnI2LzQAL3lsb3JicjYvNQAveWxvcmJyNi82AC95bG9yYnI3LzEAL3lsb3JicjcvMgAveWxvcmJyNy8zAC95bG9yYnI3LzQAL3lsb3JicjcvNQAveWxvcmJyNy82AC95bG9yYnI3LzcAL3lsb3JicjgvMQAveWxvcmJyOC8yAC95bG9yYnI4LzMAL3lsb3JicjgvNAAveWxvcmJyOC81AC95bG9yYnI4LzYAL3lsb3JicjgvNwAveWxvcmJyOC84AC95bG9yYnI5LzEAL3lsb3JicjkvMgAveWxvcmJyOS8zAC95bG9yYnI5LzQAL3lsb3JicjkvNQAveWxvcmJyOS82AC95bG9yYnI5LzcAL3lsb3JicjkvOAAveWxvcmJyOS85AC95bG9ycmQzLzEAL3lsb3JyZDMvMgAveWxvcnJkMy8zAC95bG9ycmQ0LzEAL3lsb3JyZDQvMgAveWxvcnJkNC8zAC95bG9ycmQ0LzQAL3lsb3JyZDUvMQAveWxvcnJkNS8yAC95bG9ycmQ1LzMAL3lsb3JyZDUvNAAveWxvcnJkNS81AC95bG9ycmQ2LzEAL3lsb3JyZDYvMgAveWxvcnJkNi8zAC95bG9ycmQ2LzQAL3lsb3JyZDYvNQAveWxvcnJkNi82AC95bG9ycmQ3LzEAL3lsb3JyZDcvMgAveWxvcnJkNy8zAC95bG9ycmQ3LzQAL3lsb3JyZDcvNQAveWxvcnJkNy82AC95bG9ycmQ3LzcAL3lsb3JyZDgvMQAveWxvcnJkOC8yAC95bG9ycmQ4LzMAL3lsb3JyZDgvNAAveWxvcnJkOC81AC95bG9ycmQ4LzYAL3lsb3JyZDgvNwAveWxvcnJkOC84AC95bG9ycmQ5LzEAL3lsb3JyZDkvMgAveWxvcnJkOS8zAC95bG9ycmQ5LzQAL3lsb3JyZDkvNQAveWxvcnJkOS82AC95bG9ycmQ5LzcAL3lsb3JyZDkvOAAveWxvcnJkOS85AGFsaWNlYmx1ZQBhbnRpcXVld2hpdGUAYW50aXF1ZXdoaXRlMQBhbnRpcXVld2hpdGUyAGFudGlxdWV3aGl0ZTMAYW50aXF1ZXdoaXRlNABhcXVhbWFyaW5lAGFxdWFtYXJpbmUxAGFxdWFtYXJpbmUyAGFxdWFtYXJpbmUzAGFxdWFtYXJpbmU0AGF6dXJlAGF6dXJlMQBhenVyZTIAYXp1cmUzAGF6dXJlNABiZWlnZQBiaXNxdWUAYmlzcXVlMQBiaXNxdWUyAGJpc3F1ZTMAYmlzcXVlNABibGFuY2hlZGFsbW9uZABibHVlAGJsdWUxAGJsdWUyAGJsdWUzAGJsdWU0AGJsdWV2aW9sZXQAYnJvd24AYnJvd24xAGJyb3duMgBicm93bjMAYnJvd240AGJ1cmx5d29vZABidXJseXdvb2QxAGJ1cmx5d29vZDIAYnVybHl3b29kMwBidXJseXdvb2Q0AGNhZGV0Ymx1ZQBjYWRldGJsdWUxAGNhZGV0Ymx1ZTIAY2FkZXRibHVlMwBjYWRldGJsdWU0AGNoYXJ0cmV1c2UAY2hhcnRyZXVzZTEAY2hhcnRyZXVzZTIAY2hhcnRyZXVzZTMAY2hhcnRyZXVzZTQAY2hvY29sYXRlAGNob2NvbGF0ZTEAY2hvY29sYXRlMgBjaG9jb2xhdGUzAGNob2NvbGF0ZTQAY29yYWwAY29yYWwxAGNvcmFsMgBjb3JhbDMAY29yYWw0AGNvcm5mbG93ZXJibHVlAGNvcm5zaWxrAGNvcm5zaWxrMQBjb3Juc2lsazIAY29ybnNpbGszAGNvcm5zaWxrNABjcmltc29uAGN5YW4AY3lhbjEAY3lhbjIAY3lhbjMAY3lhbjQAZGFya2dvbGRlbnJvZABkYXJrZ29sZGVucm9kMQBkYXJrZ29sZGVucm9kMgBkYXJrZ29sZGVucm9kMwBkYXJrZ29sZGVucm9kNABkYXJrZ3JlZW4AZGFya2toYWtpAGRhcmtvbGl2ZWdyZWVuAGRhcmtvbGl2ZWdyZWVuMQBkYXJrb2xpdmVncmVlbjIAZGFya29saXZlZ3JlZW4zAGRhcmtvbGl2ZWdyZWVuNABkYXJrb3JhbmdlAGRhcmtvcmFuZ2UxAGRhcmtvcmFuZ2UyAGRhcmtvcmFuZ2UzAGRhcmtvcmFuZ2U0AGRhcmtvcmNoaWQAZGFya29yY2hpZDEAZGFya29yY2hpZDIAZGFya29yY2hpZDMAZGFya29yY2hpZDQAZGFya3NhbG1vbgBkYXJrc2VhZ3JlZW4AZGFya3NlYWdyZWVuMQBkYXJrc2VhZ3JlZW4yAGRhcmtzZWFncmVlbjMAZGFya3NlYWdyZWVuNABkYXJrc2xhdGVibHVlAGRhcmtzbGF0ZWdyYXkAZGFya3NsYXRlZ3JheTEAZGFya3NsYXRlZ3JheTIAZGFya3NsYXRlZ3JheTMAZGFya3NsYXRlZ3JheTQAZGFya3NsYXRlZ3JleQBkYXJrdHVycXVvaXNlAGRhcmt2aW9sZXQAZGVlcHBpbmsAZGVlcHBpbmsxAGRlZXBwaW5rMgBkZWVwcGluazMAZGVlcHBpbms0AGRlZXBza3libHVlAGRlZXBza3libHVlMQBkZWVwc2t5Ymx1ZTIAZGVlcHNreWJsdWUzAGRlZXBza3libHVlNABkaW1ncmF5AGRpbWdyZXkAZG9kZ2VyYmx1ZQBkb2RnZXJibHVlMQBkb2RnZXJibHVlMgBkb2RnZXJibHVlMwBkb2RnZXJibHVlNABmaXJlYnJpY2sAZmlyZWJyaWNrMQBmaXJlYnJpY2syAGZpcmVicmljazMAZmlyZWJyaWNrNABmbG9yYWx3aGl0ZQBmb3Jlc3RncmVlbgBnYWluc2Jvcm8AZ2hvc3R3aGl0ZQBnb2xkAGdvbGQxAGdvbGQyAGdvbGQzAGdvbGQ0AGdvbGRlbnJvZABnb2xkZW5yb2QxAGdvbGRlbnJvZDIAZ29sZGVucm9kMwBnb2xkZW5yb2Q0AGdyYXkAZ3JheTAAZ3JheTEAZ3JheTEwAGdyYXkxMDAAZ3JheTExAGdyYXkxMgBncmF5MTMAZ3JheTE0AGdyYXkxNQBncmF5MTYAZ3JheTE3AGdyYXkxOABncmF5MTkAZ3JheTIAZ3JheTIwAGdyYXkyMQBncmF5MjIAZ3JheTIzAGdyYXkyNABncmF5MjUAZ3JheTI2AGdyYXkyNwBncmF5MjgAZ3JheTI5AGdyYXkzAGdyYXkzMABncmF5MzEAZ3JheTMyAGdyYXkzMwBncmF5MzQAZ3JheTM1AGdyYXkzNgBncmF5MzcAZ3JheTM4AGdyYXkzOQBncmF5NABncmF5NDAAZ3JheTQxAGdyYXk0MgBncmF5NDMAZ3JheTQ0AGdyYXk0NQBncmF5NDYAZ3JheTQ3AGdyYXk0OABncmF5NDkAZ3JheTUAZ3JheTUwAGdyYXk1MQBncmF5NTIAZ3JheTUzAGdyYXk1NABncmF5NTUAZ3JheTU2AGdyYXk1NwBncmF5NTgAZ3JheTU5AGdyYXk2AGdyYXk2MABncmF5NjEAZ3JheTYyAGdyYXk2MwBncmF5NjQAZ3JheTY1AGdyYXk2NgBncmF5NjcAZ3JheTY4AGdyYXk2OQBncmF5NwBncmF5NzAAZ3JheTcxAGdyYXk3MgBncmF5NzMAZ3JheTc0AGdyYXk3NQBncmF5NzYAZ3JheTc3AGdyYXk3OABncmF5NzkAZ3JheTgAZ3JheTgwAGdyYXk4MQBncmF5ODIAZ3JheTgzAGdyYXk4NABncmF5ODUAZ3JheTg2AGdyYXk4NwBncmF5ODgAZ3JheTg5AGdyYXk5AGdyYXk5MABncmF5OTEAZ3JheTkyAGdyYXk5MwBncmF5OTQAZ3JheTk1AGdyYXk5NgBncmF5OTcAZ3JheTk4AGdyYXk5OQBncmVlbgBncmVlbjEAZ3JlZW4yAGdyZWVuMwBncmVlbjQAZ3JlZW55ZWxsb3cAZ3JleQBncmV5MABncmV5MQBncmV5MTAAZ3JleTEwMABncmV5MTEAZ3JleTEyAGdyZXkxMwBncmV5MTQAZ3JleTE1AGdyZXkxNgBncmV5MTcAZ3JleTE4AGdyZXkxOQBncmV5MgBncmV5MjAAZ3JleTIxAGdyZXkyMgBncmV5MjMAZ3JleTI0AGdyZXkyNQBncmV5MjYAZ3JleTI3AGdyZXkyOABncmV5MjkAZ3JleTMAZ3JleTMwAGdyZXkzMQBncmV5MzIAZ3JleTMzAGdyZXkzNABncmV5MzUAZ3JleTM2AGdyZXkzNwBncmV5MzgAZ3JleTM5AGdyZXk0AGdyZXk0MABncmV5NDEAZ3JleTQyAGdyZXk0MwBncmV5NDQAZ3JleTQ1AGdyZXk0NgBncmV5NDcAZ3JleTQ4AGdyZXk0OQBncmV5NQBncmV5NTAAZ3JleTUxAGdyZXk1MgBncmV5NTMAZ3JleTU0AGdyZXk1NQBncmV5NTYAZ3JleTU3AGdyZXk1OABncmV5NTkAZ3JleTYAZ3JleTYwAGdyZXk2MQBncmV5NjIAZ3JleTYzAGdyZXk2NABncmV5NjUAZ3JleTY2AGdyZXk2NwBncmV5NjgAZ3JleTY5AGdyZXk3AGdyZXk3MABncmV5NzEAZ3JleTcyAGdyZXk3MwBncmV5NzQAZ3JleTc1AGdyZXk3NgBncmV5NzcAZ3JleTc4AGdyZXk3OQBncmV5OABncmV5ODAAZ3JleTgxAGdyZXk4MgBncmV5ODMAZ3JleTg0AGdyZXk4NQBncmV5ODYAZ3JleTg3AGdyZXk4OABncmV5ODkAZ3JleTkAZ3JleTkwAGdyZXk5MQBncmV5OTIAZ3JleTkzAGdyZXk5NABncmV5OTUAZ3JleTk2AGdyZXk5NwBncmV5OTgAZ3JleTk5AGhvbmV5ZGV3AGhvbmV5ZGV3MQBob25leWRldzIAaG9uZXlkZXczAGhvbmV5ZGV3NABob3RwaW5rAGhvdHBpbmsxAGhvdHBpbmsyAGhvdHBpbmszAGhvdHBpbms0AGluZGlhbnJlZABpbmRpYW5yZWQxAGluZGlhbnJlZDIAaW5kaWFucmVkMwBpbmRpYW5yZWQ0AGluZGlnbwBpbnZpcwBpdm9yeQBpdm9yeTEAaXZvcnkyAGl2b3J5MwBpdm9yeTQAa2hha2kAa2hha2kxAGtoYWtpMgBraGFraTMAa2hha2k0AGxhdmVuZGVyAGxhdmVuZGVyYmx1c2gAbGF2ZW5kZXJibHVzaDEAbGF2ZW5kZXJibHVzaDIAbGF2ZW5kZXJibHVzaDMAbGF2ZW5kZXJibHVzaDQAbGF3bmdyZWVuAGxlbW9uY2hpZmZvbgBsZW1vbmNoaWZmb24xAGxlbW9uY2hpZmZvbjIAbGVtb25jaGlmZm9uMwBsZW1vbmNoaWZmb240AGxpZ2h0Ymx1ZQBsaWdodGJsdWUxAGxpZ2h0Ymx1ZTIAbGlnaHRibHVlMwBsaWdodGJsdWU0AGxpZ2h0Y29yYWwAbGlnaHRjeWFuAGxpZ2h0Y3lhbjEAbGlnaHRjeWFuMgBsaWdodGN5YW4zAGxpZ2h0Y3lhbjQAbGlnaHRnb2xkZW5yb2QAbGlnaHRnb2xkZW5yb2QxAGxpZ2h0Z29sZGVucm9kMgBsaWdodGdvbGRlbnJvZDMAbGlnaHRnb2xkZW5yb2Q0AGxpZ2h0Z29sZGVucm9keWVsbG93AGxpZ2h0Z3JheQBsaWdodGdyZXkAbGlnaHRwaW5rAGxpZ2h0cGluazEAbGlnaHRwaW5rMgBsaWdodHBpbmszAGxpZ2h0cGluazQAbGlnaHRzYWxtb24AbGlnaHRzYWxtb24xAGxpZ2h0c2FsbW9uMgBsaWdodHNhbG1vbjMAbGlnaHRzYWxtb240AGxpZ2h0c2VhZ3JlZW4AbGlnaHRza3libHVlAGxpZ2h0c2t5Ymx1ZTEAbGlnaHRza3libHVlMgBsaWdodHNreWJsdWUzAGxpZ2h0c2t5Ymx1ZTQAbGlnaHRzbGF0ZWJsdWUAbGlnaHRzbGF0ZWdyYXkAbGlnaHRzbGF0ZWdyZXkAbGlnaHRzdGVlbGJsdWUAbGlnaHRzdGVlbGJsdWUxAGxpZ2h0c3RlZWxibHVlMgBsaWdodHN0ZWVsYmx1ZTMAbGlnaHRzdGVlbGJsdWU0AGxpZ2h0eWVsbG93AGxpZ2h0eWVsbG93MQBsaWdodHllbGxvdzIAbGlnaHR5ZWxsb3czAGxpZ2h0eWVsbG93NABsaW1lZ3JlZW4AbGluZW4AbWFnZW50YQBtYWdlbnRhMQBtYWdlbnRhMgBtYWdlbnRhMwBtYWdlbnRhNABtYXJvb24AbWFyb29uMQBtYXJvb24yAG1hcm9vbjMAbWFyb29uNABtZWRpdW1hcXVhbWFyaW5lAG1lZGl1bWJsdWUAbWVkaXVtb3JjaGlkAG1lZGl1bW9yY2hpZDEAbWVkaXVtb3JjaGlkMgBtZWRpdW1vcmNoaWQzAG1lZGl1bW9yY2hpZDQAbWVkaXVtcHVycGxlAG1lZGl1bXB1cnBsZTEAbWVkaXVtcHVycGxlMgBtZWRpdW1wdXJwbGUzAG1lZGl1bXB1cnBsZTQAbWVkaXVtc2VhZ3JlZW4AbWVkaXVtc2xhdGVibHVlAG1lZGl1bXNwcmluZ2dyZWVuAG1lZGl1bXR1cnF1b2lzZQBtZWRpdW12aW9sZXRyZWQAbWlkbmlnaHRibHVlAG1pbnRjcmVhbQBtaXN0eXJvc2UAbWlzdHlyb3NlMQBtaXN0eXJvc2UyAG1pc3R5cm9zZTMAbWlzdHlyb3NlNABtb2NjYXNpbgBuYXZham93aGl0ZQBuYXZham93aGl0ZTEAbmF2YWpvd2hpdGUyAG5hdmFqb3doaXRlMwBuYXZham93aGl0ZTQAbmF2eQBuYXZ5Ymx1ZQBub25lAG9sZGxhY2UAb2xpdmVkcmFiAG9saXZlZHJhYjEAb2xpdmVkcmFiMgBvbGl2ZWRyYWIzAG9saXZlZHJhYjQAb3JhbmdlAG9yYW5nZTEAb3JhbmdlMgBvcmFuZ2UzAG9yYW5nZTQAb3JhbmdlcmVkAG9yYW5nZXJlZDEAb3JhbmdlcmVkMgBvcmFuZ2VyZWQzAG9yYW5nZXJlZDQAb3JjaGlkAG9yY2hpZDEAb3JjaGlkMgBvcmNoaWQzAG9yY2hpZDQAcGFsZWdvbGRlbnJvZABwYWxlZ3JlZW4AcGFsZWdyZWVuMQBwYWxlZ3JlZW4yAHBhbGVncmVlbjMAcGFsZWdyZWVuNABwYWxldHVycXVvaXNlAHBhbGV0dXJxdW9pc2UxAHBhbGV0dXJxdW9pc2UyAHBhbGV0dXJxdW9pc2UzAHBhbGV0dXJxdW9pc2U0AHBhbGV2aW9sZXRyZWQAcGFsZXZpb2xldHJlZDEAcGFsZXZpb2xldHJlZDIAcGFsZXZpb2xldHJlZDMAcGFsZXZpb2xldHJlZDQAcGFwYXlhd2hpcABwZWFjaHB1ZmYAcGVhY2hwdWZmMQBwZWFjaHB1ZmYyAHBlYWNocHVmZjMAcGVhY2hwdWZmNABwZXJ1AHBpbmsAcGluazEAcGluazIAcGluazMAcGluazQAcGx1bQBwbHVtMQBwbHVtMgBwbHVtMwBwbHVtNABwb3dkZXJibHVlAHB1cnBsZQBwdXJwbGUxAHB1cnBsZTIAcHVycGxlMwBwdXJwbGU0AHJlZAByZWQxAHJlZDIAcmVkMwByZWQ0AHJvc3licm93bgByb3N5YnJvd24xAHJvc3licm93bjIAcm9zeWJyb3duMwByb3N5YnJvd240AHJveWFsYmx1ZQByb3lhbGJsdWUxAHJveWFsYmx1ZTIAcm95YWxibHVlMwByb3lhbGJsdWU0AHNhZGRsZWJyb3duAHNhbG1vbgBzYWxtb24xAHNhbG1vbjIAc2FsbW9uMwBzYWxtb240AHNhbmR5YnJvd24Ac2VhZ3JlZW4Ac2VhZ3JlZW4xAHNlYWdyZWVuMgBzZWFncmVlbjMAc2VhZ3JlZW40AHNlYXNoZWxsAHNlYXNoZWxsMQBzZWFzaGVsbDIAc2Vhc2hlbGwzAHNlYXNoZWxsNABzaWVubmEAc2llbm5hMQBzaWVubmEyAHNpZW5uYTMAc2llbm5hNABza3libHVlAHNreWJsdWUxAHNreWJsdWUyAHNreWJsdWUzAHNreWJsdWU0AHNsYXRlYmx1ZQBzbGF0ZWJsdWUxAHNsYXRlYmx1ZTIAc2xhdGVibHVlMwBzbGF0ZWJsdWU0AHNsYXRlZ3JheQBzbGF0ZWdyYXkxAHNsYXRlZ3JheTIAc2xhdGVncmF5MwBzbGF0ZWdyYXk0AHNsYXRlZ3JleQBzbm93AHNub3cxAHNub3cyAHNub3czAHNub3c0AHNwcmluZ2dyZWVuAHNwcmluZ2dyZWVuMQBzcHJpbmdncmVlbjIAc3ByaW5nZ3JlZW4zAHNwcmluZ2dyZWVuNABzdGVlbGJsdWUAc3RlZWxibHVlMQBzdGVlbGJsdWUyAHN0ZWVsYmx1ZTMAc3RlZWxibHVlNAB0YW4AdGFuMQB0YW4yAHRhbjMAdGFuNAB0aGlzdGxlAHRoaXN0bGUxAHRoaXN0bGUyAHRoaXN0bGUzAHRoaXN0bGU0AHRvbWF0bwB0b21hdG8xAHRvbWF0bzIAdG9tYXRvMwB0b21hdG80AHR1cnF1b2lzZQB0dXJxdW9pc2UxAHR1cnF1b2lzZTIAdHVycXVvaXNlMwB0dXJxdW9pc2U0AHZpb2xldAB2aW9sZXRyZWQAdmlvbGV0cmVkMQB2aW9sZXRyZWQyAHZpb2xldHJlZDMAdmlvbGV0cmVkNAB3aGVhdAB3aGVhdDEAd2hlYXQyAHdoZWF0MwB3aGVhdDQAd2hpdGUAd2hpdGVzbW9rZQB5ZWxsb3cAeWVsbG93MQB5ZWxsb3cyAHllbGxvdzMAeWVsbG93NAB5ZWxsb3dncmVlbgBsYWNrAGhpdGUAaWdodGdyZXkAWDExLwAvJXMvJXMAaW1hZ2VzY2FsZQBmYWxzZQBibGFjawBkb3R0ZWQAZGFzaGVkAGNwLT5zcmMAaHRtbHRhYmxlLmMAZW1pdF9odG1sX2ltZwBjcC0+c3JjWzBdAHRyYW5zcGFyZW50AF8lZAAlZAAyADMANAA1ADYANwA4ADkAMTAAMTEAMTIAMTMAMTQAMTUAMTYAMTcAMTgAMTkAMjAAQWdub2RlaW5mb190AEFnZWRnZWluZm9fdAByb3dnAGNvbGcAQWdyYXBoaW5mb190AGRlbHggPj0gMABwb3NfaHRtbF90YmwAZGVseSA+PSAwAHRhYmxlIHNpemUgdG9vIHNtYWxsIGZvciBjb250ZW50CgBmaXhlZCB0YWJsZSBzaXplIHdpdGggdW5zcGVjaWZpZWQgd2lkdGggb3IgaGVpZ2h0CgBjZWxsIHNpemUgdG9vIHNtYWxsIGZvciBjb250ZW50CgBmaXhlZCBjZWxsIHNpemUgd2l0aCB1bnNwZWNpZmllZCB3aWR0aCBvciBoZWlnaHQKAE5vIG9yIGltcHJvcGVyIGltYWdlIGZpbGU9IiVzIgoAcGVuY29sb3IALT4AZlBRLmMAUFFjaGVjawBIZWFwIG92ZXJmbG93CgAlIVBTLUFkb2JlLTIuMAovbm9kZSB7CiAgL1kgZXhjaCBkZWYKICAvWCBleGNoIGRlZgogIC95IGV4Y2ggZGVmCiAgL3ggZXhjaCBkZWYKICBuZXdwYXRoCiAgeCB5IG1vdmV0bwogIHggWSBsaW5ldG8KICBYIFkgbGluZXRvCiAgWCB5IGxpbmV0bwogIGNsb3NlcGF0aCBmaWxsCn0gZGVmCi9jZWxsIHsKICAvWSBleGNoIGRlZgogIC9YIGV4Y2ggZGVmCiAgL3kgZXhjaCBkZWYKICAveCBleGNoIGRlZgogIG5ld3BhdGgKICB4IHkgbW92ZXRvCiAgeCBZIGxpbmV0bwogIFggWSBsaW5ldG8KICBYIHkgbGluZXRvCiAgY2xvc2VwYXRoIHN0cm9rZQp9IGRlZgoAc2hvd3BhZ2UKAGZhaWxlZCBhdCBub2RlICVkWzBdCgBucC0+Y2VsbHNbMF0AbWF6ZS5jAGNoa1NncmFwaABmYWlsZWQgYXQgbm9kZSAlZFsxXQoAbnAtPmNlbGxzWzFdAGRpdGVtcwBmaW5kU1ZlcnQAJSUlJVBhZ2U6IDEgMQolJSUlUGFnZUJvdW5kaW5nQm94OiAlZCAlZCAlZCAlZAoAJWYgJWYgdHJhbnNsYXRlCgAwIDAgMSBzZXRyZ2Jjb2xvcgoAJWYgJWYgJWYgJWYgbm9kZQoAMCAwIDAgc2V0cmdiY29sb3IKACVmICVmICVmICVmIGNlbGwKADEgMCAwIHNldHJnYmNvbG9yCgB1bmV4cGVjdGVkIGNhc2UgaW4gbG9jYXRlX2VuZHBvaW50CgAwAHRyYXBlem9pZC5jAGxvY2F0ZV9lbmRwb2ludABhZGRfc2VnbWVudDogZXJyb3IKAG5ld25vZGU6IFF1ZXJ5LXRhYmxlIG92ZXJmbG93CgBuZXdub2RlAG5ld3RyYXA6IFRyYXBlem9pZC10YWJsZSBvdmVyZmxvdyAlZAoAbmV3dHJhcABpbmRleC5jAFJUcmVlU2VhcmNoAG4tPmxldmVsID49IDAAUlRyZWVJbnNlcnQAbGV2ZWwgPj0gMCAmJiBsZXZlbCA8PSAoKm4pLT5sZXZlbAByLT5ib3VuZGFyeVtpXSA8PSByLT5ib3VuZGFyeVtOVU1ESU1TICsgaV0AciAmJiBuICYmIG5ldwBSVHJlZUluc2VydDIAbGV2ZWwgPj0gMCAmJiBsZXZlbCA8PSBuLT5sZXZlbABGQUxTRQBub2RlLmMATm9kZUNvdmVyAHIgJiYgbgBQaWNrQnJhbmNoAEFkZEJyYW5jaABpIDwgTk9ERUNBUkQAbmV3AG4gJiYgaSA+PSAwICYmIGkgPCBOT0RFQ0FSRABEaXNjb25CcmFuY2gAcgByZWN0YW5nbGUuYwBSZWN0QXJlYQByICYmIHJyAENvbWJpbmVSZWN0AHIgJiYgcwBPdmVybGFwAG4Ac3BsaXQucS5jAFNwbGl0Tm9kZQBiAG4tPmNvdW50ICsgKCpubiktPmNvdW50ID09IE5PREVDQVJEICsgMQBMb2FkTm9kZXMAcQBwAHJ0cC0+c3BsaXQuUGFydGl0aW9uc1swXS5wYXJ0aXRpb25baV0gPT0gMCB8fCBydHAtPnNwbGl0LlBhcnRpdGlvbnNbMF0ucGFydGl0aW9uW2ldID09IDEAcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzBdICsgcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzFdID09IE5PREVDQVJEICsgMQBNZXRob2RaZXJvAHJ0cC0+c3BsaXQuUGFydGl0aW9uc1swXS5jb3VudFswXSA+PSBydHAtPk1pbkZpbGwgJiYgcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLmNvdW50WzFdID49IHJ0cC0+TWluRmlsbAAhcnRwLT5zcGxpdC5QYXJ0aXRpb25zWzBdLnRha2VuW2ldAENsYXNzaWZ5AEdldEJyYW5jaGVzAG4tPmJyYW5jaFtpXS5jaGlsZAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKAICAgICAhAMWQEAH1AIAwcSExRXFhcIC2kMHwoFDA4pESsPLRAvMCAyBjQ1GxwdHgsMISIjJCUmJygMGBkXBAobHBogKgohIiMkJSYnKAwKDlMKLFgxWFhYWFhYDBscDy5YMyEiIyQlJicoGxz/U///ISIjJCUmJygM//8F////CRT//////wwbHP8QFRYhIiMkJSYnKBsc/////yEiIyQlJicoDP8SExQRFhf///////8MGxz///8SISIjJCUmJygbHP////8hIiMkJSYnKAz///////8T////////DBsc/////yEiIyQlJicoGxz/////ISIjJCUmJygSExQVFhcYGf///////////yMkJSYnGxITFBYXIjZoAR84ViEgAhsbG14bGzc5cDbSwk8EPCJHIj8iRCIiWCJlIiIFBl9gOQQHCAkKCwwNDgRmZ11qbQUGb1g7cQcICQoLDA0OBHI8W3M+YUYbEhMUFhcEBQY/QWJJBwgJCgsMDQ4FBgBcAAAHCAkKCwwNDgQAAE8AAABTQgAAAAAABAUGAERUVQcICQoLDA0OBQYAAAAABwgJCgsMDQ4EACosLkcxMwAAAAAAAAQFBgAAAEoHCAkKCwwNDgUGAAAAAAcICQoLDA0OBAAAAAAAAEwAAAAAAAAEBQYAAAAABwgJCgsMDQ4FBgAAAAAHCAkKCwwNDikrLS8wMjQ1AAAAAAAAAAAAKSstMDIABC8AJCMAEhQWGhweIBgABQcvLy8ALy8AAAkIKAAAASICBgAAAAAACAAAAAAAAAAAAAAAAAAlAyYTCikVCyoXDi0ZERsMKx0NLB8PIRAAMwAwAC9DADEALwA1LidCMkEAOjgAPDRFADYAQAAAPwBENzs5PQACAwMBAQIBAQEDAwMDAwMDAwEBAQEBAQEBAQEBAQEBAQECAQECAAYBAwMDAwMBAAECAwAEAQIDAAQABAAEAAMCAQIBAgFTeW50YXggZXJyb3I6IG5vbi1zcGFjZSBzdHJpbmcgdXNlZCBiZWZvcmUgPFRBQkxFPgBTeW50YXggZXJyb3I6IG5vbi1zcGFjZSBzdHJpbmcgdXNlZCBhZnRlciA8L1RBQkxFPgAAKSoqKissLC0tLS0tLS0tLS0uLzAxMjM0NTY3ODk6Ozw9Pj4/P0FAQkJCQkJCQ0NERERGRUdHR0lISkhLSExITU1OTk9P/wMPEBEjOiQ9JUAVQyZFJ0gYSxlNGigcTh0eUFFSWVpsa25jZFdpbWVtb3J5IGV4aGF1c3RlZAAlcyBpbiBsaW5lICVkIAoALi4uICVzIC4uLgoAVEFCTEUAVFIAVEgAVEQASFRNTABGT05UAEIAVQBPAEkAU1VQAFNVQgBTAEJSAEhSAFZSAElNRwBVbmtub3duIEhUTUwgZWxlbWVudCA8JXM+IG9uIGxpbmUgJWQgCgA8SU1HPgBJbGxlZ2FsIGF0dHJpYnV0ZSAlcyBpbiAlcyAtIGlnbm9yZWQKAHNjYWxlAHNyYwA8QlI+AGFsaWduAElHSFQARUZUAEVOVEVSAElsbGVnYWwgdmFsdWUgJXMgZm9yIEFMSUdOIC0gaWdub3JlZAoAPEZPTlQ+AGNvbG9yAGZhY2UAcG9pbnQtc2l6ZQBQT0lOVC1TSVpFAEltcHJvcGVyICVzIHZhbHVlICVzIC0gaWdub3JlZAAlcyB2YWx1ZSAlcyA+ICVkIC0gdG9vIGxhcmdlIC0gaWdub3JlZAAlcyB2YWx1ZSAlcyA8ICVkIC0gdG9vIHNtYWxsIC0gaWdub3JlZAA8VEQ+AGJhbGlnbgBiZ2NvbG9yAGJvcmRlcgBjZWxscGFkZGluZwBjZWxsc3BhY2luZwBjb2xzcGFuAGZpeGVkc2l6ZQBncmFkaWVudGFuZ2xlAGhlaWdodABocmVmAGlkAHBvcnQAcm93c3BhbgBzaWRlcwBzdHlsZQB0YXJnZXQAdGl0bGUAdG9vbHRpcAB2YWxpZ24Ad2lkdGgAV0lEVEgAT1RUT00AT1AASURETEUASWxsZWdhbCB2YWx1ZSAlcyBmb3IgVkFMSUdOIC0gaWdub3JlZAoAICwAT1VOREVEAEFESUFMAElsbGVnYWwgdmFsdWUgJXMgZm9yIFNUWUxFIC0gaWdub3JlZAoAU09MSUQASU5WSVNJQkxFAElOVklTAERPVFRFRABEQVNIRUQAVW5yZWNvZ25pemVkIGNoYXJhY3RlciAnJWMnICglZCkgaW4gc2lkZXMgYXR0cmlidXRlCgBST1dTUEFOAFJPV1NQQU4gdmFsdWUgY2Fubm90IGJlIDAgLSBpZ25vcmVkCgBIRUlHSFQAR1JBRElFTlRBTkdMRQBSVUUAQUxTRQBJbGxlZ2FsIHZhbHVlICVzIGZvciBGSVhFRFNJWkUgLSBpZ25vcmVkCgBDT0xTUEFOAENPTFNQQU4gdmFsdWUgY2Fubm90IGJlIDAgLSBpZ25vcmVkCgBDRUxMU1BBQ0lORwBDRUxMUEFERElORwBCT1JERVIASWxsZWdhbCB2YWx1ZSAlcyBmb3IgQkFMSUdOIGluIFREIC0gaWdub3JlZAoARVhUAElsbGVnYWwgdmFsdWUgJXMgZm9yIEFMSUdOIGluIFREIC0gaWdub3JlZAoAPFRBQkxFPgBjZWxsYm9yZGVyAGNvbHVtbnMAcm93cwBVbmtub3duIHZhbHVlICVzIGZvciBST1dTIC0gaWdub3JlZAoAVW5rbm93biB2YWx1ZSAlcyBmb3IgQ09MVU1OUyAtIGlnbm9yZWQKAENFTExTQk9SREVSADxIVE1MPgA8L0hUTUw+AC0tAExhYmVsIGNsb3NlZCBiZWZvcmUgZW5kIG9mIEhUTUwgZWxlbWVudAoAVW5jbG9zZWQgY29tbWVudAoAaiA9PSAwAGN2dC5jAFBvYnNwYXRoAHJvdXRlLmMAbGlicGF0aC8lczolZDogJXMKAHNob3J0ZXN0LmMAc291cmNlIHBvaW50IG5vdCBpbiBhbnkgdHJpYW5nbGUAZGVzdGluYXRpb24gcG9pbnQgbm90IGluIGFueSB0cmlhbmdsZQBjYW5ub3QgZmluZCB0cmlhbmdsZSBwYXRoAGNhbm5vdCBtYWxsb2Mgb3BzAGNhbm5vdCByZWFsbG9jIG9wcwB0cmlhbmd1bGF0aW9uIGZhaWxlZABjYW5ub3QgbWFsbG9jIHRyaXMAY2Fubm90IHJlYWxsb2MgdHJpcwBjYW5ub3QgbWFsbG9jIGRxLnBubHMAY2Fubm90IHJlYWxsb2MgZHEucG5scwBjYW5ub3QgbWFsbG9jIHBubHMAY2Fubm90IG1hbGxvYyBwbmxwcwBjYW5ub3QgcmVhbGxvYyBwbmxzAGNhbm5vdCByZWFsbG9jIHBubHBzAENEQVRBAElEAElEUkVGAElEUkVGUwBFTlRJVFkARU5USVRJRVMATk1UT0tFTgBOTVRPS0VOUwBOT1RBVElPTigAKAB8AGh0dHA6Ly93d3cudzMub3JnL1hNTC8xOTk4L25hbWVzcGFjZQBodHRwOi8vd3d3LnczLm9yZy8yMDAwL3htbG5zLwB4bWw9aHR0cDovL3d3dy53My5vcmcvWE1MLzE5OTgvbmFtZXNwYWNlAC9kZXYvdXJhbmRvbQBmYWxsYmFjayg0KQBnZXR0aW1lb2ZkYXlfcmVzID09IDAAeG1scGFyc2UuYwBnYXRoZXJfdGltZV9lbnRyb3B5AEVYUEFUX0VOVFJPUFlfREVCVUcAMQBFbnRyb3B5OiAlcyAtLT4gMHglMCpseCAoJWx1IGJ5dGVzKQoAaW52YWxpZCBhcmd1bWVudABwcmVmaXggbXVzdCBub3QgYmUgYm91bmQgdG8gb25lIG9mIHRoZSByZXNlcnZlZCBuYW1lc3BhY2UgbmFtZXMAcmVzZXJ2ZWQgcHJlZml4ICh4bWxucykgbXVzdCBub3QgYmUgZGVjbGFyZWQgb3IgdW5kZWNsYXJlZAByZXNlcnZlZCBwcmVmaXggKHhtbCkgbXVzdCBub3QgYmUgdW5kZWNsYXJlZCBvciBib3VuZCB0byBhbm90aGVyIG5hbWVzcGFjZSBuYW1lAGNhbm5vdCBzdXNwZW5kIGluIGV4dGVybmFsIHBhcmFtZXRlciBlbnRpdHkAcGFyc2luZyBmaW5pc2hlZABwYXJzaW5nIGFib3J0ZWQAcGFyc2VyIG5vdCBzdXNwZW5kZWQAcGFyc2VyIHN1c3BlbmRlZABpbGxlZ2FsIGNoYXJhY3RlcihzKSBpbiBwdWJsaWMgaWQAdGV4dCBkZWNsYXJhdGlvbiBub3Qgd2VsbC1mb3JtZWQAWE1MIGRlY2xhcmF0aW9uIG5vdCB3ZWxsLWZvcm1lZABpbmNvbXBsZXRlIG1hcmt1cCBpbiBwYXJhbWV0ZXIgZW50aXR5AG11c3Qgbm90IHVuZGVjbGFyZSBwcmVmaXgAdW5ib3VuZCBwcmVmaXgAY2Fubm90IGNoYW5nZSBzZXR0aW5nIG9uY2UgcGFyc2luZyBoYXMgYmVndW4AcmVxdWVzdGVkIGZlYXR1cmUgcmVxdWlyZXMgWE1MX0RURCBzdXBwb3J0IGluIEV4cGF0AGVudGl0eSBkZWNsYXJlZCBpbiBwYXJhbWV0ZXIgZW50aXR5AHVuZXhwZWN0ZWQgcGFyc2VyIHN0YXRlIC0gcGxlYXNlIHNlbmQgYSBidWcgcmVwb3J0AGRvY3VtZW50IGlzIG5vdCBzdGFuZGFsb25lAGVycm9yIGluIHByb2Nlc3NpbmcgZXh0ZXJuYWwgZW50aXR5IHJlZmVyZW5jZQB1bmNsb3NlZCBDREFUQSBzZWN0aW9uAGVuY29kaW5nIHNwZWNpZmllZCBpbiBYTUwgZGVjbGFyYXRpb24gaXMgaW5jb3JyZWN0AHVua25vd24gZW5jb2RpbmcAWE1MIG9yIHRleHQgZGVjbGFyYXRpb24gbm90IGF0IHN0YXJ0IG9mIGVudGl0eQByZWZlcmVuY2UgdG8gZXh0ZXJuYWwgZW50aXR5IGluIGF0dHJpYnV0ZQByZWZlcmVuY2UgdG8gYmluYXJ5IGVudGl0eQByZWZlcmVuY2UgdG8gaW52YWxpZCBjaGFyYWN0ZXIgbnVtYmVyAGFzeW5jaHJvbm91cyBlbnRpdHkAcmVjdXJzaXZlIGVudGl0eSByZWZlcmVuY2UAdW5kZWZpbmVkIGVudGl0eQBpbGxlZ2FsIHBhcmFtZXRlciBlbnRpdHkgcmVmZXJlbmNlAGp1bmsgYWZ0ZXIgZG9jdW1lbnQgZWxlbWVudABkdXBsaWNhdGUgYXR0cmlidXRlAG1pc21hdGNoZWQgdGFnAHBhcnRpYWwgY2hhcmFjdGVyAHVuY2xvc2VkIHRva2VuAG5vdCB3ZWxsLWZvcm1lZCAoaW52YWxpZCB0b2tlbikAbm8gZWxlbWVudCBmb3VuZABzeW50YXggZXJyb3IAb3V0IG9mIG1lbW9yeQACAwQFBgcIAAAJCgsMDQ4PEBEAAAAAAAAAAAAAAAASEwAUAAAAAAAAAAAAAAAAAAAVFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEXAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBARgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQMaGxwdHgAAHyAhIiMkJRARAAAAAAAAAAAAAAAAEhMmFAAAAAAAAAAAAAAAAAAAJxYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBFwAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENEQVRBW1VTLUFTQ0lJAFVURi0xNgBVVEYtMTZCRQBVVEYtMTZMRQB2ZXJzaW9uAGVuY29kaW5nAHN0YW5kYWxvbmUARE9DVFlQRQBTWVNURU0AUFVCTElDAEVOVElUWQBBVFRMSVNUAEVMRU1FTlQATk9UQVRJT04ASU5DTFVERQBJR05PUkUARU1QVFkAQU5ZAFBDREFUQQBJTVBMSUVEAFJFUVVJUkVEAEZJWEVEAENEQVRBAElEAElEUkVGAElEUkVGUwBFTlRJVElFUwBOTVRPS0VOAE5NVE9LRU5TAE5EQVRBAFQhIhkNAQIDEUscDBAECx0SHidobm9wcWIgBQYPExQVGggWBygkFxgJCg4bHyUjg4J9JiorPD0+P0NHSk1YWVpbXF1eX2BhY2RlZmdpamtscnN0eXp7fABJbGxlZ2FsIGJ5dGUgc2VxdWVuY2UARG9tYWluIGVycm9yAFJlc3VsdCBub3QgcmVwcmVzZW50YWJsZQBOb3QgYSB0dHkAUGVybWlzc2lvbiBkZW5pZWQAT3BlcmF0aW9uIG5vdCBwZXJtaXR0ZWQATm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeQBObyBzdWNoIHByb2Nlc3MARmlsZSBleGlzdHMAVmFsdWUgdG9vIGxhcmdlIGZvciBkYXRhIHR5cGUATm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UAT3V0IG9mIG1lbW9yeQBSZXNvdXJjZSBidXN5AEludGVycnVwdGVkIHN5c3RlbSBjYWxsAFJlc291cmNlIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlAEludmFsaWQgc2VlawBDcm9zcy1kZXZpY2UgbGluawBSZWFkLW9ubHkgZmlsZSBzeXN0ZW0ARGlyZWN0b3J5IG5vdCBlbXB0eQBDb25uZWN0aW9uIHJlc2V0IGJ5IHBlZXIAT3BlcmF0aW9uIHRpbWVkIG91dABDb25uZWN0aW9uIHJlZnVzZWQASG9zdCBpcyBkb3duAEhvc3QgaXMgdW5yZWFjaGFibGUAQWRkcmVzcyBpbiB1c2UAQnJva2VuIHBpcGUASS9PIGVycm9yAE5vIHN1Y2ggZGV2aWNlIG9yIGFkZHJlc3MAQmxvY2sgZGV2aWNlIHJlcXVpcmVkAE5vIHN1Y2ggZGV2aWNlAE5vdCBhIGRpcmVjdG9yeQBJcyBhIGRpcmVjdG9yeQBUZXh0IGZpbGUgYnVzeQBFeGVjIGZvcm1hdCBlcnJvcgBJbnZhbGlkIGFyZ3VtZW50AEFyZ3VtZW50IGxpc3QgdG9vIGxvbmcAU3ltYm9saWMgbGluayBsb29wAEZpbGVuYW1lIHRvbyBsb25nAFRvbyBtYW55IG9wZW4gZmlsZXMgaW4gc3lzdGVtAE5vIGZpbGUgZGVzY3JpcHRvcnMgYXZhaWxhYmxlAEJhZCBmaWxlIGRlc2NyaXB0b3IATm8gY2hpbGQgcHJvY2VzcwBCYWQgYWRkcmVzcwBGaWxlIHRvbyBsYXJnZQBUb28gbWFueSBsaW5rcwBObyBsb2NrcyBhdmFpbGFibGUAUmVzb3VyY2UgZGVhZGxvY2sgd291bGQgb2NjdXIAU3RhdGUgbm90IHJlY292ZXJhYmxlAFByZXZpb3VzIG93bmVyIGRpZWQAT3BlcmF0aW9uIGNhbmNlbGVkAEZ1bmN0aW9uIG5vdCBpbXBsZW1lbnRlZABObyBtZXNzYWdlIG9mIGRlc2lyZWQgdHlwZQBJZGVudGlmaWVyIHJlbW92ZWQARGV2aWNlIG5vdCBhIHN0cmVhbQBObyBkYXRhIGF2YWlsYWJsZQBEZXZpY2UgdGltZW91dABPdXQgb2Ygc3RyZWFtcyByZXNvdXJjZXMATGluayBoYXMgYmVlbiBzZXZlcmVkAFByb3RvY29sIGVycm9yAEJhZCBtZXNzYWdlAEZpbGUgZGVzY3JpcHRvciBpbiBiYWQgc3RhdGUATm90IGEgc29ja2V0AERlc3RpbmF0aW9uIGFkZHJlc3MgcmVxdWlyZWQATWVzc2FnZSB0b28gbGFyZ2UAUHJvdG9jb2wgd3JvbmcgdHlwZSBmb3Igc29ja2V0AFByb3RvY29sIG5vdCBhdmFpbGFibGUAUHJvdG9jb2wgbm90IHN1cHBvcnRlZABTb2NrZXQgdHlwZSBub3Qgc3VwcG9ydGVkAE5vdCBzdXBwb3J0ZWQAUHJvdG9jb2wgZmFtaWx5IG5vdCBzdXBwb3J0ZWQAQWRkcmVzcyBmYW1pbHkgbm90IHN1cHBvcnRlZCBieSBwcm90b2NvbABBZGRyZXNzIG5vdCBhdmFpbGFibGUATmV0d29yayBpcyBkb3duAE5ldHdvcmsgdW5yZWFjaGFibGUAQ29ubmVjdGlvbiByZXNldCBieSBuZXR3b3JrAENvbm5lY3Rpb24gYWJvcnRlZABObyBidWZmZXIgc3BhY2UgYXZhaWxhYmxlAFNvY2tldCBpcyBjb25uZWN0ZWQAU29ja2V0IG5vdCBjb25uZWN0ZWQAQ2Fubm90IHNlbmQgYWZ0ZXIgc29ja2V0IHNodXRkb3duAE9wZXJhdGlvbiBhbHJlYWR5IGluIHByb2dyZXNzAE9wZXJhdGlvbiBpbiBwcm9ncmVzcwBTdGFsZSBmaWxlIGhhbmRsZQBSZW1vdGUgSS9PIGVycm9yAFF1b3RhIGV4Y2VlZGVkAE5vIG1lZGl1bSBmb3VuZABXcm9uZyBtZWRpdW0gdHlwZQBObyBlcnJvciBpbmZvcm1hdGlvbgAAEhATFBUWFxgZGhscHR4fICEQECIjECQlJicoKSorECwtLhEvMBERMRERETIzNDU2Nzg5ERAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA6EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA7EDw9Pj9AQRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBCEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBDEBBEEEVGRxBIEEkQEBAQSktMTRAQThBPUBAQEBBREBAQEBAQEBAQEBAQEFIQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFMQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBUVVZXEBBYWRAQEBAQEBAQEBAQEBAQEBAQEBAQEBBaEFtcXV5fYGFiEBAQEBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////AAAAAP7/APwBAAD4AQAAeAAAAAD/+9/7AACAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8APz/4K//////////////3///////IECwAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAPwDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAAAAIb+////AEBJAAAAAAAYAN//AMgAAAAAAAAAAQA8AAAAAAAAAAAAAAAAEOABHgBg/78AAAAAAAD/BwAAAAAAAAAAAAAAAAAAAAAAAAD4zwMAAAADACD/fwAAAE4AAAAAAAAAAAAAAAAAAAAAAPwAAAAAAAAAAAAQACAeADAAAQAAAAAAAAAAEAAgAAAAAPwPAAAAAAAAABAAIAAAAAAAAAAAAAAAAAAQACAAAAAAAwAAAAAAAAAAEAAgAAAAAP0AAAAAAAAAAAAAIAAAAAD/BwAAAAAAAAAAACAAAAAAAP8AAAAAAAAAEAAgAAAAAAAAAAAAAAAAAAAAIAAAAAA/AgAAAAAAAAAAAAQAAAAAEAAAAAAAAIAAgMDfAAwAAAAAAAAAAAAAAAAAHwAAAAAAAP7///8A/P//AAAAAAAAAAD8AAAAAAAAwP/f/wcAAAAAAAAAAAAAgAYA/AAAGD4AAIC/AMwAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAGD///8fAAD/AwAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAEAABgAAAAAAAAAAAA4AAAAABAAAABwAAAAAAAAAAAAAAAAAAAAMAAA/n8vAAD/A/9/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4xAAAAAAAAAAAAAAAAAAAAAAAAxP////8AAADAAAAAAAAAAAABAOCfAAAAAH8/AAAAAAAAAAAAAAAAAAAAABAAEAAA/P///x8AAAAAAAwAAAAAAABAAAzwAAAAAAAAwPgAAAAAAAAAwAAAAAAAAAAA/wD///8hEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////fwAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAPgAOAA4ABggPj////8//////9/H/zxf/9/AAD///8DAAD/////AQB7A9DBr0IADB+8//8AAAAAAAL//////////////////////////////////////////////////////////w8A/////38AAAD/BwAA/////////////z8AAAAAAAD8///+/////////////////////////////////////////////////////x//AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCHA/4AAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAP//////f/8PAAAAAAAAAAD////7/////////////w8A//////////////////////////////////8/AAAA/w8e////AfzB4AAAAAAAAAAAAAAAHgEAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAP////8PAAAA////f////////////////////////////////////38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAP///////38AAAAAAADAAOAAAAAAAAAAAAAAAIAPcAAAAAAAAAAAAAAAAAAA/wD//38AAwAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAEQIAAAAD/8DAAAAAAAA8AAAAAAAAAAAABDAAAD//wMHAAAAAAD4AAAAAAiAAAAAAAAAAAAAAAgA/z8AwAAAAAAAAAAAAAAAAAAAAPAAAIALAAAAAAAAAIACAADAAABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAgAAAAAAAAAAAAAAAAAAAAD8/wMAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADD///8DfwD/////9/9/DwAAAAAAAAAAAAAAAAAAAAAAgP7/APwBAAD4AQAA+D8AAAAAAAAAAAAAAAAAAAB/fwAwh///////j/8AAAAAAADg//8H/w8AAAAAAAD//////z8AAAAADwAAAAAAAAAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAAAAAAAAAACA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAADAjwAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAh/8A/wEAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+AAAA/wAAAP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////fwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMA//P8/AAAAAwAAAAAAAP4DAAAAAAAAAAAAAAAAABgADwAAAAAAAAAAAAAAAAAAAOEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAcAAAAAAAAAAAAAAAAA////////////////////////////////////////PwD/////f/7///////////////////////////8/AAAAAP//////////PwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////38A//8DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAIAAAACAAAIAAAACAAAIAAAACAAAAAAgAAAAIAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwD//////w////////////////8PAP9//n/+//7/AAAAAP8H////f/////////8P//////8HAAAAAAAAAADA////BwD//////wf/AQMAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AQC///////////8f//8PAP/////fBwAA//8BAP////////9//f////////////////////////////8e/////////z8PAP///wAAAAAAAAAAAAAAAAAAAAAAAPj//////////+H/AAAAAAAA//////////8/AAAAAAAAAP//////////////////DwAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAQIEBwMGBQASERMUFRYXGBkaGxwdHh8gIREiIyQRJSYnKCkqKywRLS4vEBAwEBAQEBAQEDEyMxA0NRAQERERERERERERERERERERERERERERERERETYRERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERE3ERERETgROTo7PD0+ERERERERERERERERERERERERERERERERERERERERERERERERERERERERET8QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBARQEERQkNERUZHSEkQEBBKS0xNThAQEE9QEBAQEFEQEBAQEBAQEBARERFSUxAQEBAQEBAQEBAQEREREVQQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAREVUQEBAQVhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBXEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBYWVpbEBAQEBAQEBAQEBAQEBAQEBAQEBAQEFwQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAAAP7//wf+//8HAAAAAAAEIAT//3////9//////////////////////////////////8P/AwAfUAAAAAAAAAAAAAAgAAAAAADfPEDX///7////////////v///////////////////////A/z/////////////////////////AP7///9/Av7/////AAAAAAD/v7YA////BwcAAAD/B//////////+/8P////////////////vH/7h/58AAP///////wDg////////////////AwD//////wcwBP////z/HwAA////AQAAAAAAAAAA/R8AAAAAAADwA/9//////////+//3+H/z//+/u6f+f///cXjn1mAsM//AwDuh/n///1tw4cZAl7A/z8A7r/7///97eO/GwEAz/8AAO6f+f///e3jnxnAsM//AgDsxz3WGMf/w8cdgQDA/wAA7t/9///97+PfHWADz/8AAOzf/f///e/j3x1gQM//BgDs3/3/////599dgADP/wD87P9//P//+y9/gF//AAAMAP7/////f/8HPyD/AwAAAACWJfD+ruz/O18g//MAAAAAAQAAAP8DAAD//v///x/+/wP///7///8fAAAAAAAAAAD///////9/+f8D///nwf//f0D/M/////+/IP//////9////////////z1/Pf//////Pf////89fz3/f/////////89//////////+HAAAAAP//AAD/////////////HwD+//////////////////////////////////////////////////////////+f///+//8H////////////xwEA/98PAP//DwD//w8A/98NAP///////8///wGAEP8DAAAAAP8D//////////////8A//////8H//////////8/AP///x//D/8BwP////8/HwD//////w////8D/wMAAAAA////D/////////9//v8fAP8D/wOAAAAAAAAAAAAAAAD////////v/+8P/wMAAAAA///////z////////v/8DAP///////z8A/+P//////z8AAAAAAAAAAAAAAAAA3m8A////////////////////////////////AAAAAAAAAAD//z8//////z8//6r///8/////////31/cH88P/x/cHwAAAAAAAAAAAAAAAAAAAoAAAP8fAAAAAAAAAAAAAAAAhPwvPlC9//PgQwAA//////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwP///////wMAAP//////f///////f/////////////////////8feAwA/////78g/////////4AAAP//fwB/f39/f39/f/////8AAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAD+Az4f/v///////////3/g/v/////////////34P////8//v////////////9/AAD///8HAAAAAAAA////////////////////////////////PwAAAAAAAAAAAP////////////////////////////////8fAAAAAAAA//////////////////////8fAAAAAAAAAAD//////z//H////w8AAP//////f/CP////gP////////////8AAAAAgP/8////////////////eQ8A/wcAAAAAAAAAAAD/u/f///8AAAD///////8PAP//////////DwD/AwAA/Aj//////wf/////BwD///8f////////9/8AgP8DAAAAAP///////38A/z//A///fwT/////////fwUAADj//zwAfn5+AH9/AAAAAAAAAAAAAAAAAAAAAAAA//////8H/wP//////////////////////////w8A//9/+P//////D/////////////////8//////////////////wMAAAAAfwD44P/9f1/b/////////////////wMAAAD4////////////////PwAA///////////8////////AAAAAAD/DwAAAAAAAAAAAAAAAAAA3/////////////////////8fAAD/A/7//wf+//8HwP////////////9//Pz8HAAAAAD/7///f///t/8//z8AAAAA////////////////////BwAAAAAAAAAA////////HwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///x////////8BAAAAAAD///9/AAD///8HAAAAAAAA////P/////8P/z4AAAAAAP////////////////////////8//wMAAAAAAAAAAAAAP/3/////v5H//z8AAAAAAAAAAAAAAAAAAAAAAAAAAAD//z8A////AwAAAAAAAAAA/////////8AAAAAAAAAAAG/w7/7//w8AAAAAAP///x8AAAAAAAAAAAAAAAAAAAAA////////PwD//z8A//8HAAAAAAAAAAAAAAAAAAAAAAD///////////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////PwAAAMD/AAD8////////AQAA////Af8D////////x/8AAAAAAAAAAP//////////HgD/AwAAAAAAAAAAAAAAAAAAAAAAAAAA////////PwD/AwAAAAAAAP////////////////9/AAAAAAAAAAAAAAAAAAAAAAAA////////////////BwAAAAAAAAAAAAAAAAAAAAAAAAD//////38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////8fAP//////fwAA+P8AAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////f///////////fZN7/6+//////////v+ff3////3tf/P3//////////////////////////////////////////////////////z/////9///3////9///3////9///3////9//////f////3///fP////////7////5b+9wqE6paqlvf3Xv/7/w/u+/8PAAAAAAAAAABMQ19BTEwATENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVMATEFORwBDLlVURi04AFBPU0lYAE1VU0xfTE9DUEFUSAARAAoAERERAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABEADwoREREDCgcAARMJCwsAAAkGCwAACwAGEQAAABEREQAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA0AAAAEDQAAAAAJDgAAAAAADgAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABISEgAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAoAAAAACgAAAAAJCwAAAAAACwAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAwAAAAACQwAAAAAAAwAAAwAAC0rICAgMFgweAAobnVsbCkALTBYKzBYIDBYLTB4KzB4IDB4AGluZgBJTkYATkFOADAxMjM0NTY3ODlBQkNERUYuAGFsbnVtAGFscGhhAGJsYW5rAGNudHJsAGRpZ2l0AGdyYXBoAGxvd2VyAHByaW50AHB1bmN0AHNwYWNlAHVwcGVyAHhkaWdpdABDLlVURi04AAAAAAAAAAAAQwAvcHJvYy9zZWxmL2ZkLwByd2EAaW5maW5pdHkAbmFuAAkACgANAAwABwAbAFtbOmFsbnVtOl1fXQBbXls6YWxudW06XV9dAFtbOnNwYWNlOl1dAFteWzpzcGFjZTpdXQBbWzpkaWdpdDpdXQBbXls6ZGlnaXQ6XV0AL3RtcC90bXBmaWxlX1hYWFhYWAB3Kw==";var tempDoublePtr=STATICTOP;STATICTOP+=16;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]);}function _emscripten_get_now(){abort();}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now();}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now();}else {___setErrNo(ERRNO_CODES.EINVAL);return -1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function ___clock_gettime(){return _clock_gettime.apply(null,arguments)}function ___lock(){}function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);return -1}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return !!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path=".";}if(path&&trailingSlash){path+="/";}return (isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return "."}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir}),basename:(function(path){if(path==="/")return "/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return ""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/";}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return !!p})),!resolvedAbsolute).join("/");return (resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return [];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8");}else {result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null}tty.input=intArrayFromString(result,true);}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[];}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[];}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={};}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null;}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream;}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream;}node.timestamp=Date.now();if(parent){parent.contents[name]=node;}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length;}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else {for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++;}}));var remove=[];Object.keys(dst.entries).forEach((function(key){dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++;}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault();});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done);}));}else {IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done);}));}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done);}else {IDBFS.removeRemoteEntry(store,path,done);}}));})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"];}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]};}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2;}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent;}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k;}}if(!flags){return newFlags}else {throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096;}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0;}return {dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode;}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date);}if(attr.size!==undefined){fs.truncateSync(path,attr.size);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode);}else {fs.writeFileSync(path,"",{mode:node.mode});}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath);}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags));}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd);}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position;}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size;}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position;}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size;}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return {path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key];}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return !!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return {path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent;}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else {var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next;}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return (this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode;})},write:{get:(function(){return (this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode;})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}});}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node);}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return !!node.mounted}),isFile:(function(mode){return (mode&61440)===32768}),isDir:(function(mode){return (mode&61440)===16384}),isLink:(function(mode){return (mode&61440)===40960}),isChrdev:(function(mode){return (mode&61440)===8192}),isBlkdev:(function(mode){return (mode&61440)===24576}),isFIFO:(function(mode){return (mode&61440)===4096}),isSocket:(function(mode){return (mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else {if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val;})},isRead:{get:(function(){return (this.flags&2097155)!==1})},isWrite:{get:(function(){return (this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}});}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p];}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null;}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream);}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops};}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts);}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done);}));}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current);}current=next;}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter;};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined");}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else {return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength();}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray};}else {var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)};}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags);}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return -ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return -ERRNO_CODES.EINVAL;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}),doAccess:(function(path,amode){if(amode&~7){return -ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return -ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0);})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();off<<=12;var ptr;var allocated=false;if(fd===-1){ptr=_memalign(PAGE_SIZE,len);if(!ptr)return -ERRNO_CODES.ENOMEM;_memset(ptr,0,len);allocated=true;}else {var info=FS.getStream(fd);if(!info)return -ERRNO_CODES.EBADF;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated;}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags};return ptr}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return -ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return -ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return -1;default:{return -ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return -ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return -ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op);}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc);}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);function ___unlock(){}function __exit(status){Module["exit"](status);}function _exit(status){__exit(status);}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=staticAlloc(TOTAL_ENV_SIZE);envPtr=staticAlloc(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr;}else {envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2];}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length;}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1;}HEAP32[envPtr+strings.length*ptrSize>>2]=0;}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}var _llvm_ceil_f64=Math_ceil;var _llvm_fabs_f32=Math_abs;var _llvm_fabs_f64=Math_abs;var _llvm_floor_f64=Math_floor;var _llvm_pow_f64=Math_pow;var _llvm_sqrt_f32=Math_sqrt;var _llvm_sqrt_f64=Math_sqrt;function _llvm_trap(){abort("trap!");}function _longjmp(env,value){Module["setThrew"](env,value||1);throw "longjmp"}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _setenv(envname,envval,overwrite){if(envname===0){___setErrNo(ERRNO_CODES.EINVAL);return -1}var name=Pointer_stringify(envname);var val=Pointer_stringify(envval);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return -1}if(ENV.hasOwnProperty(name)&&!overwrite)return 0;ENV[name]=val;___buildEnvironment(ENV);return 0}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret;}return ret}function _times(buffer){if(buffer!==0){_memset(buffer,0,16);}return 0}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6};}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow;}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()});}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()});}else {_emscripten_get_now=Date.now;}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();}));__ATMAIN__.push((function(){FS.ignorePermissions=false;}));__ATEXIT__.push((function(){FS.quit();}));__ATINIT__.unshift((function(){}));__ATEXIT__.push((function(){}));if(ENVIRONMENT_IS_NODE){var fs=require$$0$5;var NODEJS_PATH=require$$1$3;NODEFS.staticInit();}___buildEnvironment(ENV);DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");}chr&=255;}ret.push(String.fromCharCode(chr));}return ret.join("")}var decodeBase64=typeof atob==="function"?atob:(function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2);}if(enc4!==64){output=output+String.fromCharCode(chr3);}}while(i>2]=0;s=y;o=0;e=$(29,b|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;a:do if((g|0)!=1){o=0;v=$(23,e<<3|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){e=V6(c[f>>2]|0,w|0,x|0)|0;if(!e)bb(f|0,p|0);z=p;}else e=-1;if((e|0)!=1){if(!(a[194954]|0))t=0;else {o=0;e=_(3)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=0;k=0;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;break}t=e;}o=0;e=aa(97,b|0,110064)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[47323]=0;b:do if(e|0?(i=a[e>>0]|0,i<<24>>24):0){h=e;f=i;g=0;while(1){i=h+1|0;if(!(f<<24>>24))break b;switch(f<<24>>24|0){case 99:{e=8;u=16;break}case 105:{e=18;u=16;break}case 109:{e=1;u=16;break}case 114:{e=4;u=16;break}case 115:{e=2;u=16;break}default:e=g;}if((u|0)==16){u=0;e=g|e;c[47323]=e;}h=i;f=a[i>>0]|0;g=e;}}while(0);if(d|0){o=0;ca(20,0,110068,j|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){n=0;k=t;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;break}}o=0;r=aa(98,b|0,0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){m=c[r+16>>2]|0;if(c[47323]&2|0){o=0;ja(26,c[15712]|0,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break}}o=0;g=$(25,b|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){n=0;while(1){if(!g)break;o=0;e=aa(99,b|0,g|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}i=n;while(1){if(!e)break;if(!((c[47134]|0)==2?(c[(c[e+16>>2]|0)+8>>2]|0)!=0:0))u=32;c:do if((u|0)==32){u=0;do if(a[194954]|0){k=c[e>>2]&3;j=(c[c[((k|0)==3?e:e+48|0)+40>>2]>>2]|0)>>>4;k=(c[c[((k|0)==2?e:e+-48|0)+40>>2]>>2]|0)>>>4;if(j>>>0>k>>>0){o=0;f=ca(34,t|0,k|0,j|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){d=V6(c[h>>2]|0,w|0,x|0)|0;if(!d)bb(h|0,p|0);z=p;}else d=-1;if((d|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}if(f|0)break c;o=0;ka(64,t|0,k|0,j|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}break}else {o=0;f=ca(34,t|0,j|0,k|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){d=V6(c[h>>2]|0,w|0,x|0)|0;if(!d)bb(h|0,p|0);z=p;}else d=-1;if((d|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}if(f|0)break c;o=0;ka(64,t|0,j|0,k|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}break}}while(0);c[v+(i<<3)+4>>2]=e;o=0;d=$(30,e|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}c[v+(i<<3)>>2]=d;i=i+1|0;}while(0);o=0;e=aa(100,b|0,e|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){h=V6(c[f>>2]|0,w|0,x|0)|0;if(!h)bb(f|0,p|0);z=p;}else h=-1;if((h|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}}o=0;g=aa(86,b|0,g|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;break a}n=i;}o=0;j=$(31,n<<3|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){o=0;ma(28,v|0,n|0,8,101);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){g=c[m>>2]|0;o=0;ia(110,g+2|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){i=c[m+16>>2]|0;d=i+(g*40|0)|0;i=i+((g+1|0)*40|0)|0;q=c[15712]|0;h=0;while(1){if((h|0)>=(n|0))break;if((h|0)>0?c[47323]&16|0:0){o=0;ja(26,q|0,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}e=c[v+(h<<3)+4>>2]|0;k=c[e>>2]&3;g=c[(c[(c[((k|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;e=c[(c[(c[((k|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;if((g|0)==(e|0)){o=0;ma(29,m|0,g|0,i|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}else {o=0;ka(65,m|0,e|0,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}o=0;ka(65,m|0,g|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}}o=0;e=ca(35,m|0,i|0,d|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}if(e|0){k=t;m=j;i=r;d=v;h=v;break a}e=j+(h<<3)|0;o=0;ma(30,s|0,m|0,d|0,i|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}g=s;k=c[g+4>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=k;o=0;ia(111,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;break a}h=h+1|0;}o=0;ha(8);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){o=0;e=$(32,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[r+20>>2]=e;o=0;e=$(33,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)!=1){c[r+24>>2]=e;o=0;ka(66,n|0,j|0,r|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){w=U6(189296,1,w|0,x|0)|0;x=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)!=1){k=t;m=j;i=r;d=v;h=v;e=0;g=q;u=74;}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=q;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=0;u=74;}}else {k=t;m=j;i=r;d=v;h=v;e=z;g=0;u=74;}}else {k=t;m=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=r;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=t;m=0;j=0;i=0;d=v;h=v;e=z;g=0;u=74;}}else {n=0;k=0;m=0;j=0;i=0;d=0;h=v;e=z;g=0;u=74;}}else {n=0;k=0;m=0;j=0;i=0;d=0;h=0;e=z;g=0;u=74;}while(0);d:while(1){if((u|0)==74){u=0;if(e|0){q=g;continue}o=0;ia(112,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){A=g;f=h;q=d;r=i;s=j;t=m;v=k;u=n;e=z;g=A;h=f;d=q;i=r;j=s;m=t;k=v;n=u;u=74;continue}if(c[47323]&4|0){o=0;na(8,g|0,i|0,n|0,m|0,d|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=g;q=h;r=d;s=i;t=j;v=m;A=k;u=n;e=z;g=f;h=q;d=r;i=s;j=t;m=v;k=A;n=u;u=74;continue}}o=0;oa(10,b|0,i|0,n|0,m|0,d|0,0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=g;q=h;r=d;s=i;t=j;v=m;A=k;u=n;e=z;g=f;h=q;d=r;i=s;j=t;m=v;k=A;n=u;u=74;continue}q=g;}if(!(a[194954]|0))e=0;else {o=0;ia(113,k|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}e=0;}while(1){if((e|0)>=(n|0))break;o=0;ia(105,c[m+(e<<3)+4>>2]|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,w|0,x|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;g=q;u=74;continue d}e=e+1|0;}o=0;ia(105,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}o=0;ia(114,i|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;continue}o=0;ia(105,h|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,x|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;g=q;u=74;}else break}U1(w|0);l=y;return}function sQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+64|0;p=q+32|0;o=q+16|0;j=q;k=q+48|0;T4(110935,a)|0;T4(110946,a)|0;m=b+16|0;n=j+8|0;i=k+4|0;g=0;while(1){if((g|0)>=(c[b>>2]|0))break;d=c[m>>2]|0;e=c[d+(g*40|0)+20>>2]|0;f=c[d+(g*40|0)+24>>2]|0;if((e|0)==(f|0)){lR(j,e);d=~~+h[j>>3];e=~~+h[n>>3];}else {nR(k,(c[e>>2]&1|0)==0?e:f,d+(g*40|0)|0);d=c[k>>2]|0;e=c[i>>2]|0;}c[o>>2]=g;c[o+4>>2]=d;c[o+8>>2]=e;w4(a,110966,o)|0;g=g+1|0;}f=b+4|0;e=b+20|0;d=0;while(1){if((d|0)>=(c[f>>2]|0))break;o=c[e>>2]|0;b=c[o+(d*24|0)+16>>2]|0;r=+h[o+(d*24|0)>>3];c[p>>2]=c[o+(d*24|0)+12>>2];c[p+4>>2]=b;h[p+8>>3]=r;w4(a,110986,p)|0;d=d+1|0;}T4(111008,a)|0;l=q;return}function tQ(a){a=a|0;var b=0.0,d=0.0,e=0,f=0;f=c[a>>2]&3;e=c[(c[((f|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0;a=c[(c[((f|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0;b=+h[e+16>>3]-+h[a+16>>3];d=+h[e+24>>3]-+h[a+24>>3];return ~~(d*d+b*b)|0}function uQ(a,b){a=a|0;b=b|0;return (c[a>>2]|0)-(c[b>>2]|0)|0}function vQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;j=n;lR(n+16|0,d);k=d+32|0;m=d+36|0;g=0;while(1){if((g|0)>=(c[k>>2]|0))break;h=c[(c[m>>2]|0)+(g<<2)>>2]|0;do if(!(a[h+36>>0]|0)){i=c[h+20>>2]|0;if((i|0)==(d|0)){jR(j,h,c[h+24>>2]|0);ER(b,f,h,0.0)|0;break}else {jR(j,h,i);ER(b,e,h,0.0)|0;break}}while(0);g=g+1|0;}c[b>>2]=(c[b>>2]|0)+2;l=n;return}function wQ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;h=k;lR(k+16|0,b);i=b+32|0;j=b+36|0;f=0;while(1){if((f|0)>=(c[i>>2]|0))break;g=c[(c[j>>2]|0)+(f<<2)>>2]|0;e=c[g+20>>2]|0;if((e|0)==(b|0))e=c[g+24>>2]|0;jR(h,g,e);ER(a,d,g,0.0)|0;f=f+1|0;}c[a>>2]=(c[a>>2]|0)+1;c[d+24>>2]=b;c[d+20>>2]=b;l=k;return}function xQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+128|0;C=H+64|0;n=H+48|0;D=H+32|0;E=H+16|0;F=H;g=0;i=e;while(1){if(!i)break;g=g+1|0;i=c[i+8>>2]|0;}B=JK((g*56|0)+-112|0)|0;c[C+52>>2]=0;c[C+48>>2]=0;A=e+8|0;e=c[A>>2]|0;i=c[e+8>>2]|0;g=c[e+20>>2]|0;if(c[g>>2]&1)g=c[e+24>>2]|0;jR(n,e,g);j=e;q=e;p=0.0;o=+h[n>>3];z=0;m=0.0;x=+h[n+8>>3];while(1){y=i+8|0;if(!(c[y>>2]|0))break;v=kR(j,i)|0;cV(d,v,c[q+12>>2]|0);t=q+36|0;u=i+36|0;if((a[t>>0]|0)==(a[u>>0]|0))if((c[y>>2]|0)==(f|0)){jR(E,i,v);e=E;G=12;}else {j=q;e=z;k=x;}else {lR(D,v);e=D;G=12;}if((G|0)==12){G=0;w=+h[e>>3];k=+h[e+8>>3];e=a[t>>0]|0;s=e<<24>>24==0;r=(q|0)==(c[A>>2]|0);if(s){if(!(a[u>>0]|0))e=0;else e=(c[i+20>>2]|0)==(v|0)?4:2;n=v+48|0;q=g+48|0;j=g+40|0;g=r?0:p>o?4:2;}else {if(e<<24>>24==(a[u>>0]|0))e=0;else e=(c[i+20>>2]|0)==(v|0)?1:3;n=v+40|0;q=g+40|0;j=g+48|0;g=r?0:m>x?1:3;}mR(C,s&1,+h[j>>3],+h[q>>3],+h[n>>3],g,e);q=z+1|0;g=B+(z*56|0)|0;e=C;j=g+56|0;do{c[g>>2]=c[e>>2];g=g+4|0;e=e+4|0;}while((g|0)<(j|0));if((a[t>>0]|0)!=(a[u>>0]|0)?(c[y>>2]|0)==(f|0):0){jR(F,i,v);n=(a[u>>0]|0)==0;e=v+40|0;g=v+48|0;p=+h[(n?g:e)>>3];mR(C,n&1,+h[(n?e:g)>>3],p,p,n?(o>w?4:2):x>k?1:3,0);n=z+2|0;g=B+(q*56|0)|0;e=C;j=g+56|0;do{c[g>>2]=c[e>>2];g=g+4|0;e=e+4|0;}while((g|0)<(j|0));g=v;j=i;p=o;o=w;e=n;m=x;}else {g=v;j=i;p=o;o=w;e=q;m=x;}}v=i;i=c[y>>2]|0;q=j;z=e;x=k;j=v;}i=W1(B,z*56|0)|0;e=z+-1|0;g=0;while(1){if((g|0)>=(z|0))break;if((g|0)>0)c[i+(g*56|0)+48>>2]=i+((g+-1|0)*56|0);if((g|0)<(e|0)){G=g+1|0;c[i+(g*56|0)+52>>2]=i+(G*56|0);g=G;continue}else {g=g+1|0;continue}}c[b>>2]=z;c[b+4>>2]=i;l=H;return}function yQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;j=Vz(25692,c[4581]|0)|0;k=a+8|0;i=0;while(1){if((i|0)>=(c[a>>2]|0))break;b=(c[k>>2]|0)+(i*72|0)|0;if(!(c[b>>2]&4)){while(1){d=c[(c[b+36>>2]|0)+8>>2]|0;if(!d)break;d=c[d+20>>2]|0;if(!d)break;if(!(c[d>>2]&1))b=d;else break}g=JK(40)|0;c[g+36>>2]=b;h[g+8>>3]=+h[b+40>>3];f=b;d=c[b>>2]|0;while(1){c[f>>2]=d|4;d=c[c[f+36>>2]>>2]|0;if(!d)break;e=c[d+24>>2]|0;if(!e)break;d=c[e>>2]|0;if(d&1|0)break;else f=e;}h[g+16>>3]=+h[f+56>>3];eR(j,g,+h[b+48>>3]);}i=i+1|0;}return j|0}function zQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;j=Vz(25692,c[4581]|0)|0;k=a+8|0;i=0;while(1){if((i|0)>=(c[a>>2]|0))break;b=(c[k>>2]|0)+(i*72|0)|0;if(!(c[b>>2]&2)){while(1){d=c[(c[b+36>>2]|0)+12>>2]|0;if(!d)break;d=c[d+20>>2]|0;if(!d)break;if(!(c[d>>2]&1))b=d;else break}g=JK(40)|0;c[g+36>>2]=b;h[g+8>>3]=+h[b+48>>3];f=b;d=c[b>>2]|0;while(1){c[f>>2]=d|2;d=c[(c[f+36>>2]|0)+4>>2]|0;if(!d)break;e=c[d+24>>2]|0;if(!e)break;d=c[e>>2]|0;if(d&1|0)break;else f=e;}h[g+16>>3]=+h[f+64>>3];eR(j,g,+h[b+40>>3]);}i=i+1|0;}return j|0}function AQ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=e+20|0;i=e+24|0;e=0;while(1){if((e|0)>=(b|0))break;g=c[d+(e<<3)>>2]|0;h=c[d+(e<<3)+4>>2]|0;f=0;while(1){if((f|0)>=(g|0))break;k=h+(f*56|0)|0;dR(JQ(c[((a[k>>0]|0)==0?j:i)>>2]|0,k)|0,k);f=f+1|0;}e=e+1|0;}return}function BQ(a){a=a|0;var b=0,d=0;d=a+20|0;LQ(c[d>>2]|0);b=a+24|0;LQ(c[b>>2]|0);MQ(c[d>>2]|0);MQ(c[b>>2]|0);NQ(c[d>>2]|0,a);NQ(c[b>>2]|0,a);OQ(c[d>>2]|0);OQ(c[b>>2]|0);return}function CQ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0,E=0.0;z=l;l=l+224|0;n=z+176|0;m=z+208|0;x=z+160|0;y=z+128|0;k=z+96|0;t=z+64|0;u=z;o=z+32|0;v=u+8|0;h[v>>3]=1797693134862315708145274.0e284;h[u>>3]=1797693134862315708145274.0e284;w=u+24|0;h[w>>3]=-1797693134862315708145274.0e284;p=u+16|0;h[p>>3]=-1797693134862315708145274.0e284;T4(110183,a)|0;c[n>>2]=10;c[n+4>>2]=10;w4(a,110589,n)|0;T4(138265,a)|0;i=b+4|0;j=b+12|0;q=t+8|0;r=t+16|0;s=t+24|0;g=0;while(1){if((g|0)>=(c[i>>2]|0))break;D=(c[j>>2]|0)+(g*72|0)+40|0;c[t>>2]=c[D>>2];c[t+4>>2]=c[D+4>>2];c[t+8>>2]=c[D+8>>2];c[t+12>>2]=c[D+12>>2];c[t+16>>2]=c[D+16>>2];c[t+20>>2]=c[D+20>>2];c[t+24>>2]=c[D+24>>2];c[t+28>>2]=c[D+28>>2];C=+h[q>>3];B=+h[r>>3];A=+h[s>>3];h[k>>3]=+h[t>>3];h[k+8>>3]=C;h[k+16>>3]=B;h[k+24>>3]=A;w4(a,138284,k)|0;g=g+1|0;}g=0;while(1){if((g|0)>=(d|0))break;D=c[f+(g<<3)+4>>2]|0;k=e+(g<<3)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[n>>2]=c[u>>2];c[n+4>>2]=c[u+4>>2];c[n+8>>2]=c[u+8>>2];c[n+12>>2]=c[u+12>>2];c[n+16>>2]=c[u+16>>2];c[n+20>>2]=c[u+20>>2];c[n+24>>2]=c[u+24>>2];c[n+28>>2]=c[u+28>>2];KQ(o,a,D,m,b,n);c[u>>2]=c[o>>2];c[u+4>>2]=c[o+4>>2];c[u+8>>2]=c[o+8>>2];c[u+12>>2]=c[o+12>>2];c[u+16>>2]=c[o+16>>2];c[u+20>>2]=c[o+20>>2];c[u+24>>2]=c[o+24>>2];c[u+28>>2]=c[o+28>>2];g=g+1|0;}T4(110606,a)|0;i=b+8|0;g=0;while(1){if((g|0)>=(c[b>>2]|0))break;D=(c[i>>2]|0)+(g*72|0)+40|0;c[t>>2]=c[D>>2];c[t+4>>2]=c[D+4>>2];c[t+8>>2]=c[D+8>>2];c[t+12>>2]=c[D+12>>2];c[t+16>>2]=c[D+16>>2];c[t+20>>2]=c[D+20>>2];c[t+24>>2]=c[D+24>>2];c[t+28>>2]=c[D+28>>2];E=+h[t>>3];A=+h[q>>3];B=+h[r>>3];C=+h[s>>3];h[y>>3]=E;h[y+8>>3]=A;h[y+16>>3]=B;h[y+24>>3]=C;w4(a,138321,y)|0;h[u>>3]=+h[(+h[u>>3]>3];h[v>>3]=+h[(+h[v>>3]>3];h[p>>3]=+h[(+h[p>>3]>B?u:t)+16>>3];h[w>>3]=+h[(+h[w>>3]>C?u:t)+24>>3];g=g+1|0;}v=~~(+h[v>>3]+10.0);y=~~(+h[p>>3]+10.0);D=~~(+h[w>>3]+10.0);c[x>>2]=~~(+h[u>>3]+10.0);c[x+4>>2]=v;c[x+8>>2]=y;c[x+12>>2]=D;w4(a,110631,x)|0;l=z;return}function DQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;N=l;l=l+112|0;F=N+88|0;E=N+72|0;M=N+32|0;I=N+16|0;J=N;K=N+56|0;L=N+40|0;G=c[15712]|0;w=(i|0)==0;x=J+8|0;y=I+8|0;v=0;m=0;n=0;o=0;p=0;i=0;while(1){if((v|0)>=(e|0))break;z=c[g+(v<<3)+4>>2]|0;A=z+48|0;u=(c[(c[((c[z>>2]&3|0)==3?z:A)+40>>2]|0)+16>>2]|0)+16|0;B=z+16|0;C=(c[B>>2]|0)+16|0;c[E>>2]=c[u>>2];c[E+4>>2]=c[u+4>>2];c[E+8>>2]=c[u+8>>2];c[E+12>>2]=c[u+12>>2];c[F>>2]=c[C>>2];c[F+4>>2]=c[C+4>>2];c[F+8>>2]=c[C+8>>2];c[F+12>>2]=c[C+12>>2];EQ(K,E,F);c[I>>2]=c[K>>2];c[I+4>>2]=c[K+4>>2];c[I+8>>2]=c[K+8>>2];c[I+12>>2]=c[K+12>>2];C=z+-48|0;u=(c[(c[((c[z>>2]&3|0)==2?z:C)+40>>2]|0)+16>>2]|0)+16|0;t=(c[B>>2]|0)+56|0;c[E>>2]=c[u>>2];c[E+4>>2]=c[u+4>>2];c[E+8>>2]=c[u+8>>2];c[E+12>>2]=c[u+12>>2];c[F>>2]=c[t>>2];c[F+4>>2]=c[t+4>>2];c[F+8>>2]=c[t+8>>2];c[F+12>>2]=c[t+12>>2];EQ(L,E,F);c[J>>2]=c[L>>2];c[J+4>>2]=c[L+4>>2];c[J+8>>2]=c[L+8>>2];c[J+12>>2]=c[L+12>>2];t=c[f+(v<<3)>>2]|0;u=c[f+(v<<3)+4>>2]|0;s=t*3|0;D=s+1|0;if((s|0)>=(n|0)){if(m|0)U1(i);p=KK(D<<4)|0;m=p;n=D;o=p;i=p;}if(!(a[u>>0]|0)){k=+(GQ(u,d)|0);j=+h[I>>3];}else {j=+FQ(u,d);k=+h[y>>3];}r=m+16|0;h[m+16>>3]=j;h[m+24>>3]=k;c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];r=1;q=u;s=2;while(1){if((r|0)>=(t|0))break;q=u+(r*56|0)|0;if(!(a[q>>0]|0))k=+(GQ(q,d)|0);else j=+FQ(q,d);O=m+(s+2<<4)|0;Q=m+(s+1<<4)|0;P=m+(s<<4)|0;h[P>>3]=j;h[m+(s<<4)+8>>3]=k;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];r=r+1|0;s=s+3|0;}if(!(a[q>>0]|0)){k=+(GQ(q,d)|0);j=+h[J>>3];}else {j=+FQ(q,d);k=+h[x>>3];}Q=m+(s<<4)|0;O=s+1|0;P=m+(O<<4)|0;h[P>>3]=j;h[m+(O<<4)+8>>3]=k;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];if(0>1);dO(z,c[((c[z>>2]&3|0)==2?z:C)+40>>2]|0,m,D,25680);if((!w?(H=c[(c[B>>2]|0)+96>>2]|0,H|0):0)?(a[H+81>>0]|0)==0:0){c[E>>2]=c[I>>2];c[E+4>>2]=c[I+4>>2];c[E+8>>2]=c[I+8>>2];c[E+12>>2]=c[I+12>>2];c[F>>2]=c[J>>2];c[F+4>>2]=c[J+4>>2];c[F+8>>2]=c[J+8>>2];c[F+12>>2]=c[J+12>>2];yO(b,z,E,F);}v=v+1|0;}U1(o);l=N;return}function EQ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]+ +h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]+ +h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function FQ(a,b){a=a|0;b=b|0;var d=0.0,e=0;b=JQ(c[b+24>>2]|0,a)|0;e=c[b+36>>2]|0;d=+h[e+40>>3];return +((+h[e+56>>3]-d)*(+(c[a+44>>2]|0)/+((c[b+24>>2]|0)+1|0))+d)}function GQ(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=JQ(c[b+20>>2]|0,a)|0;b=c[e+36>>2]|0;d=+h[b+48>>3];return ~~((1.0-+(c[a+44>>2]|0)/+((c[e+24>>2]|0)+1|0))*(+h[b+64>>3]-d)+d)|0}function HQ(a){a=a|0;return 0}function IQ(a){a=a|0;return 0}function JQ(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b+8|0,512)|0;if(!a)qa(110155,110161,423,110169);a=c[a+16>>2]|0;a=nb[c[a>>2]&63](a,b+16|0,512)|0;if(!a)qa(110180,110161,425,110169);else return a|0;return 0}function KQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0.0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0;z=l;l=l+32|0;y=z+16|0;u=z+8|0;m=z;j=c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;t=c[f+4>>2]|0;if(!(a[t>>0]|0)){k=+h[j+56>>3];s=+h[j+40>>3];j=GQ(t,g)|0;k=(s+k)*.5;}else {k=+h[j+64>>3];s=+h[j+48>>3];j=~~((s+k)*.5);k=+FQ(t,g);}A=~~k;p=+h[i>>3];r=+(A|0);p=p>3]=p;v=i+8|0;q=+h[v>>3];s=+(j|0);q=q>3]=q;w=i+16|0;k=+h[w>>3];r=k>r?k:r;h[w>>3]=r;x=i+24|0;k=+h[x>>3];s=k>s?k:s;h[x>>3]=s;c[m>>2]=A;c[m+4>>2]=j;w4(d,110682,m)|0;o=c[f>>2]|0;m=t;n=1;f=A;while(1){if((n|0)>=(o|0))break;m=t+(n*56|0)|0;if(!(a[m>>0]|0))j=GQ(m,g)|0;else f=~~+FQ(m,g);B=+(f|0);D=p>3]=D;k=+(j|0);C=q>3]=C;B=r>B?r:B;h[w>>3]=B;k=s>k?s:k;h[x>>3]=k;c[u>>2]=f;c[u+4>>2]=j;w4(d,110704,u)|0;n=n+1|0;p=D;q=C;r=B;s=k;}j=c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;if(!(a[m>>0]|0)){k=+h[j+56>>3];D=+h[j+40>>3];j=GQ(m,g)|0;k=(D+k)*.5;}else {k=+h[j+64>>3];D=+h[j+48>>3];j=~~((D+k)*.5);k=+FQ(m,g);}A=~~k;C=+(A|0);h[i>>3]=p>3]=q>3]=r>C?r:C;h[x>>3]=s>D?s:D;c[y>>2]=A;c[y+4>>2]=j;w4(d,110718,y)|0;c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];c[b+16>>2]=c[i+16>>2];c[b+20>>2]=c[i+20>>2];c[b+24>>2]=c[i+24>>2];c[b+28>>2]=c[i+28>>2];l=z;return}function LQ(a){a=a|0;var b=0;a=Tz(a)|0;while(1){if(!a)break;b=Tz(c[a+16>>2]|0)|0;while(1){if(!b)break;c[b+32>>2]=oR(c[b+24>>2]|0)|0;b=c[b>>2]|0;}a=c[a>>2]|0;}return}function MQ(a){a=a|0;var b=0;a=Tz(a)|0;while(1){if(!a)break;b=Tz(c[a+16>>2]|0)|0;while(1){if(!b)break;if(c[b+24>>2]|0)cR(b);b=c[b>>2]|0;}a=c[a>>2]|0;}return}function NQ(a,b){a=a|0;b=b|0;var d=0;d=Tz(a)|0;while(1){if(!d)break;a=Tz(c[d+16>>2]|0)|0;while(1){if(!a)break;SQ(a,b);a=c[a>>2]|0;}d=c[d>>2]|0;}return}function OQ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0;e=Tz(a)|0;while(1){if(!e)break;i=e+8|0;f=Tz(c[e+16>>2]|0)|0;while(1){if(!f)break;a=f+24|0;a:do if(c[a>>2]|0){if(c[47323]&8|0)PQ(f,~~+h[i>>3]);g=f+32|0;tR(c[g>>2]|0);b=c[a>>2]|0;d=f+28|0;a=0;while(1){if((a|0)>=(b|0))break a;c[(c[(c[d>>2]|0)+(a<<2)>>2]|0)+44>>2]=(c[(c[(c[g>>2]|0)+4>>2]|0)+(a*12|0)+4>>2]|0)+1;a=a+1|0;}}while(0);f=c[f>>2]|0;}e=c[e>>2]|0;}return}function PQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+32|0;d=j;g=a+24|0;a:do if((c[g>>2]|0)>=2){i=c[15712]|0;m=+h[a+8>>3];k=+h[a+16>>3];c[d>>2]=b;h[d+8>>3]=m;h[d+16>>3]=k;w4(i,110739,d)|0;f=a+32|0;a=a+28|0;b=0;while(1){if((b|0)>=(c[g>>2]|0))break a;e=c[(c[(c[f>>2]|0)+4>>2]|0)+(b*12|0)+8>>2]|0;b:do if(Xz(e)|0){QQ(i,c[(c[a>>2]|0)+(b<<2)>>2]|0);T4(110759,i)|0;d=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!d)break b;T4(110764,i)|0;QQ(i,c[(c[a>>2]|0)+(c[d>>2]<<2)>>2]|0);T4(153599,i)|0;d=nb[c[e>>2]&63](e,d,8)|0;}}while(0);b=b+1|0;}}while(0);l=j;return}function QQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0;g=l;l=l+80|0;f=g+40|0;e=g;if(!(a[d>>0]|0)){m=+h[d+16>>3];j=+h[d+8>>3];k=+h[d+24>>3];i=RQ(c[d+32>>2]|0)|0;e=RQ(c[d+36>>2]|0)|0;h[f>>3]=m;h[f+8>>3]=j;h[f+16>>3]=k;h[f+24>>3]=j;c[f+32>>2]=i;c[f+36>>2]=e;w4(b,110770,f)|0;}else {k=+h[d+8>>3];j=+h[d+16>>3];m=+h[d+24>>3];f=RQ(c[d+32>>2]|0)|0;i=RQ(c[d+36>>2]|0)|0;h[e>>3]=k;h[e+8>>3]=j;h[e+16>>3]=k;h[e+24>>3]=m;c[e+32>>2]=f;c[e+36>>2]=i;w4(b,110770,e)|0;}l=g;return}function RQ(a){a=a|0;switch(a|0){case 0:{a=110821;break}case 1:{a=110816;break}case 2:{a=110809;break}case 3:{a=110802;break}case 4:{a=110794;break}default:a=0;}return a|0}function SQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+16|0;r=w+8|0;t=w;u=c[a+32>>2]|0;v=c[a+28>>2]|0;p=a+24|0;m=r+4|0;n=t+4|0;j=0;a=c[p>>2]|0;a:while(1){q=j+1|0;if((q|0)>=(a|0))break;o=v+(j<<2)|0;k=q;while(1){if((k|0)>=(a|0)){j=q;continue a}b:do if(((sR(u,j,k)|0)==0?(sR(u,k,j)|0)==0:0)?(s=v+(k<<2)|0,TQ(c[o>>2]|0,c[s>>2]|0)|0):0){f=c[o>>2]|0;a=c[f+48>>2]|0;i=c[s>>2]|0;d=c[i+48>>2]|0;e=(d|0)==0;if(a)if(e)a=1;else a=+h[a+8>>3]!=+h[d+8>>3];else a=e^1;g=a&1;UQ(r,f,i,0,g);a=c[r>>2]|0;i=c[m>>2]|0;f=g^1;UQ(t,c[o>>2]|0,c[s>>2]|0,1,f);d=c[t>>2]|0;e=c[n>>2]|0;switch(i|0){case -1:{VQ(c[s>>2]|0,c[o>>2]|0,g,0,a,b);VQ(c[s>>2]|0,c[o>>2]|0,f,1,d,b);if((e|0)!=1)break b;WQ(c[o>>2]|0,c[s>>2]|0,f,b);break b}case 0:switch(e|0){case -1:{VQ(c[s>>2]|0,c[o>>2]|0,g,0,a,b);VQ(c[s>>2]|0,c[o>>2]|0,f,1,d,b);break b}case 0:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);break b}case 1:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);break b}default:break b}case 1:{VQ(c[o>>2]|0,c[s>>2]|0,0,g,a,b);VQ(c[o>>2]|0,c[s>>2]|0,1,f,d,b);if((e|0)!=-1)break b;WQ(c[o>>2]|0,c[s>>2]|0,f,b);break b}default:break b}}while(0);k=k+1|0;a=c[p>>2]|0;}}l=w;return}function TQ(a,b){a=a|0;b=b|0;if(!(+h[a+8>>3]==+h[b+8>>3]))qa(110892,110161,843,110923);if((+h[a+16>>3]==+h[b+16>>3]?+h[a+24>>3]==+h[b+24>>3]:0)?(c[a+32>>2]|0)==(c[b+32>>2]|0):0)a=(c[a+36>>2]|0)==(c[b+36>>2]|0)&1;else a=0;return a|0}function UQ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=0;while(1){b=XQ(b,e)|0;if(!b){h=0;break}d=XQ(d,f)|0;if(!d){i=6;break}if(!(TQ(b,d)|0)){i=7;break}g=g+1|0;}if((i|0)==6)qa(138394,110161,871,110841);else if((i|0)==7)h=ZQ(b,YQ(b,d)|0,g+1|0,1-e|0)|0;c[a>>2]=g;c[a+4>>2]=h;return}function VQ(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=i+20|0;n=i+24|0;i=JQ(c[((a[b>>0]|0)==0?o:n)>>2]|0,b)|0;qR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0);k=1;while(1){if((k|0)>(g|0))break;l=XQ(b,e)|0;m=XQ(d,f)|0;do if(!(a[b>>0]|0)){j=JQ(c[n>>2]|0,l)|0;if(+h[l+8>>3]==+h[b+16>>3]){p=(c[b+32>>2]|0)==1;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}}else {p=(c[b+36>>2]|0)==1;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}}}else {j=JQ(c[o>>2]|0,l)|0;if(+h[l+8>>3]==+h[b+16>>3]){p=(c[b+32>>2]|0)==2;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}}else {p=(c[b+36>>2]|0)==2;i=(sR(c[i+32>>2]|0,c[b+40>>2]|0,c[d+40>>2]|0)|0)!=0;b=c[j+32>>2]|0;if(p)if(i){qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}else {qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else if(i){qR(b,c[l+40>>2]|0,c[m+40>>2]|0);i=j;break}else {qR(b,c[m+40>>2]|0,c[l+40>>2]|0);i=j;break}}}while(0);b=l;d=m;k=k+1|0;}return}function WQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;while(1){if(!(TQ(b,d)|0))break;g=XQ(b,1)|0;d=XQ(d,e)|0;b=g;}g=c[(JQ(c[((a[b>>0]|0)==0?f+20|0:f+24|0)>>2]|0,b)|0)+32>>2]|0;rR(g,c[b+40>>2]|0,c[d+40>>2]|0);return}function XQ(a,b){a=a|0;b=b|0;if(!a)qa(110828,110161,798,110832);else return c[((b|0)==0?a+48|0:a+52|0)>>2]|0;return 0}function YQ(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=a[b>>0]|0;if(d<<24>>24==(a[c>>0]|0)?!(+h[b+8>>3]!=+h[c+8>>3]):0){if(!(d<<24>>24))b=_Q(b,c,3,1)|0;else b=_Q(b,c,4,2)|0;l=f;return b|0}gA(1,110854,e)|0;bb(189296,1);return 0}function ZQ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0;j=1;while(1){if((j|0)>(e|0))break;i=XQ(b,f)|0;g=+h[i+8>>3]==+h[b+16>>3];do if(!(a[b>>0]|0))if(g){g=(c[b+32>>2]|0)==1;break}else {g=(c[b+36>>2]|0)==3;break}else if(g){g=(c[b+32>>2]|0)==4;break}else {g=(c[b+36>>2]|0)==2;break}while(0);b=i;j=j+1|0;d=g?0-d|0:d;}return d|0}function _Q(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0;j=+h[a+24>>3];k=+h[b+16>>3];do if(!(j>3],i=+h[b+24>>3],!(g>i)):0){if(k>2]|0;return ((d|0)==(c[b+32>>2]|0)?0:(d|0)==(e|0)?1:-1)|0}else {d=c[a+32>>2]|0;b=(d|0)==(c[b+36>>2]|0)?0:(d|0)==(e|0)?1:-1;break}if(!(j==i))if(j>2]|0)==(d|0);d=bR(c[b+32>>2]|0,c[a+32>>2]|0,d,e)|0;return (o?d:0-d|0)|0}else {o=(c[b+36>>2]|0)==(e|0);b=bR(c[a+32>>2]|0,c[b+32>>2]|0,d,e)|0;b=o?b:0-b|0;break}o=c[a+32>>2]|0;n=c[b+32>>2]|0;if((o|0)==(n|0)){b=c[b+36>>2]|0;if((c[a+36>>2]|0)==(b|0)){b=0;break}}else b=c[b+36>>2]|0;m=(n|0)==(d|0);if((n|0)==(b|0)){if(m){b=1;break}if((n|0)==(e|0)){b=-1;break}if((o|0)!=(d|0)?(c[a+36>>2]|0)!=(d|0):0){b=1;break}if((o|0)!=(e|0)?(c[a+36>>2]|0)!=(e|0):0){b=-1;break}b=0;break}f=(b|0)==(e|0);if(m&f){b=(c[a+36>>2]|0)==(e|0);if((o|0)==(d|0)){if(!b){b=-1;break}}else if(b){b=1;break}b=0;break}l=(b|0)==(d|0);if((n|0)==(e|0)&l){b=(o|0)==(e|0);if((c[a+36>>2]|0)==(d|0)){if(!b){b=-1;break}}else if(b){b=1;break}b=0;break}if(!n){if(l){b=aR(o,c[a+36>>2]|0,d)|0;break}if(f){b=0-(aR(o,c[a+36>>2]|0,e)|0)|0;break}}f=c[a+36>>2]|0;if(m&(b|0)==0){b=aR(f,o,d)|0;break}else {b=0-(aR(f,o,e)|0)|0;break}}else b=0;while(0);return b|0}function $Q(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0;i=+h[a+24>>3];j=+h[b+24>>3];do if(i>2]|0;if((a|0)==(d|0)?(c[b+32>>2]|0)==(e|0):0){a=-1;break}if((a|0)==(e|0)?(c[b+32>>2]|0)==(d|0):0){a=1;break}a=0;}else {f=c[b+32>>2]|0;g=(f|0)==(e|0);if(i==j)if(g){a=bR(c[a+36>>2]|0,c[b+36>>2]|0,d,e)|0;break}else {a=0-(bR(c[b+36>>2]|0,c[a+36>>2]|0,d,e)|0)|0;break}if(g?(c[b+36>>2]|0)==(e|0):0){a=-1;break}if((f|0)==(d|0)?(c[b+36>>2]|0)==(d|0):0){a=1;break}a=0;}while(0);return a|0}function aR(a,b,c){a=a|0;b=b|0;c=c|0;return ((a|0)==(c|0)?((b|0)==(c|0))<<31>>31:1)|0}function bR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((a|0)==(d|0)){b=(a|0)==0;if(b)return 0;else b=b&1;}return ((a|0)!=0|(b|0)!=(c|0))<<31>>31|0}function cR(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;g=c[a+28>>2]|0;h=c[a+24>>2]|0;d=c[a+32>>2]|0;a=0;a:while(1){e=a+1|0;if((e|0)>=(h|0))break;f=g+(a<<2)|0;b=e;while(1){if((b|0)==(h|0)){a=e;continue a}switch(YQ(c[f>>2]|0,c[g+(b<<2)>>2]|0)|0){case 1:{qR(d,a,b);break}case -1:{qR(d,b,a);break}default:{}}b=b+1|0;}}return}function dR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+24|0;e=c[f>>2]|0;d=e+1|0;c[f>>2]=d;c[b+40>>2]=e;e=a+28|0;a=c[e>>2]|0;if(!a)a=KK(d<<2)|0;else a=MK(a,d<<2)|0;c[e>>2]=a;c[a+((c[f>>2]|0)+-1<<2)>>2]=b;return}function eR(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;h[f>>3]=d;e=nb[c[a>>2]&63](a,f,512)|0;if(!e){e=JK(24)|0;h[e+8>>3]=+h[f>>3];c[e+16>>2]=Vz(25728,c[4581]|0)|0;nb[c[a>>2]&63](a,e,1)|0;}f=c[e+16>>2]|0;nb[c[f>>2]&63](f,b,1)|0;l=g;return}function fR(a,b,d){a=a|0;b=b|0;d=d|0;pR(c[b+32>>2]|0);U1(c[b+28>>2]|0);U1(b);return}function gR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b>>3];f=+h[c>>3];if(!(e>f))if(e>3]>=+h[c+8>>3])<<31>>31;else a=0;else a=!(+h[b+8>>3]<=+h[c+8>>3])&1;return a|0}function hR(a,b,d){a=a|0;b=b|0;d=d|0;Rz(c[b+16>>2]|0)|0;U1(b);return}function iR(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;f=+h[b>>3];e=+h[c>>3];return (f>e?1:(f>31)|0}function jR(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0;i=(a[d+36>>0]|0)!=0;j=e+40|0;do if((c[d+24>>2]|0)==(e|0)){f=+h[j>>3];if(i){g=(+h[e+64>>3]+ +h[e+48>>3])*.5;break}else {g=+h[e+48>>3];f=(+h[e+56>>3]+f)*.5;break}}else if(i){g=(+h[e+64>>3]+ +h[e+48>>3])*.5;f=+h[e+56>>3];break}else {g=+h[e+64>>3];f=(+h[e+56>>3]+ +h[j>>3])*.5;break}while(0);h[b>>3]=f;h[b+8>>3]=g;return}function kR(a,b){a=a|0;b=b|0;var d=0;d=c[a+20>>2]|0;if((d|0)!=(c[b+20>>2]|0)?(d|0)!=(c[b+24>>2]|0):0)d=c[a+24>>2]|0;return d|0}function lR(a,b){a=a|0;b=b|0;var c=0.0;c=(+h[b+64>>3]+ +h[b+48>>3])*.5;h[a>>3]=(+h[b+56>>3]+ +h[b+40>>3])*.5;h[a+8>>3]=c;return}function mR(b,d,e,f,g,i,j){b=b|0;d=d|0;e=+e;f=+f;g=+g;i=i|0;j=j|0;var k=0,l=0;a[b>>0]=d;h[b+8>>3]=e;if(f>3]=f;h[b+16>>3]=e;c[b+36>>2]=d;c[b+32>>2]=l;a[b+1>>0]=k;return}function nR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[b+36>>2]|0;do if((c[e+4>>2]|0)!=(d|0)){if((c[e+12>>2]|0)==(d|0)){e=~~((+h[b+56>>3]+ +h[b+40>>3])*.5);d=~~+h[b+48>>3];break}if((c[e+8>>2]|0)==(d|0)){e=~~+h[b+40>>3];d=~~((+h[b+64>>3]+ +h[b+48>>3])*.5);break}if((c[e>>2]|0)==(d|0)){e=~~+h[b+56>>3];d=~~((+h[b+64>>3]+ +h[b+48>>3])*.5);}else {e=0;d=0;}}else {e=~~((+h[b+56>>3]+ +h[b+40>>3])*.5);d=~~+h[b+64>>3];}while(0);c[a>>2]=e;c[a+4>>2]=d;return}function oR(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=JK(8)|0;c[d>>2]=a;e=d+4|0;c[e>>2]=JK(a*12|0)|0;b=0;while(1){if((b|0)>=(a|0))break;g=PU()|0;f=c[e>>2]|0;c[f+(b*12|0)+8>>2]=g;c[f+(b*12|0)>>2]=0;b=b+1|0;}return d|0}function pR(a){a=a|0;var b=0,d=0,e=0;d=a+4|0;b=0;while(1){e=c[d>>2]|0;if((b|0)>=(c[a>>2]|0))break;Rz(c[e+(b*12|0)+8>>2]|0)|0;b=b+1|0;}U1(e);U1(a);return}function qR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c[(c[a+4>>2]|0)+(b*12|0)+8>>2]|0;nb[c[d>>2]&63](d,f,1)|0;l=e;return}function rR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e;c[f>>2]=d;a=a+4|0;g=c[(c[a>>2]|0)+(b*12|0)+8>>2]|0;nb[c[g>>2]&63](g,f,2)|0;c[f>>2]=b;d=c[(c[a>>2]|0)+(d*12|0)+8>>2]|0;nb[c[d>>2]&63](d,f,2)|0;l=e;return}function sR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c[(c[a+4>>2]|0)+(b*12|0)+8>>2]|0;d=(nb[c[d>>2]&63](d,f,512)|0)!=0&1;l=e;return d|0}function tR(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;switch(b|0){case 0:break;case 1:{c[(c[a+4>>2]|0)+4>>2]=0;break}default:{e=uR(b)|0;f=a+4|0;d=0;b=0;while(1){if((d|0)>=(c[a>>2]|0)){b=0;break}if(!(c[(c[f>>2]|0)+(d*12|0)>>2]|0))b=vR(a,d,b,e)|0;d=d+1|0;}while(1){d=wR(e)|0;if((d|0)<=-1)break;c[(c[f>>2]|0)+(d*12|0)+4>>2]=b;b=b+1|0;}xR(e);}}return}function uR(a){a=a|0;var b=0;b=JK(8)|0;c[b+4>>2]=JK(a<<2)|0;c[b>>2]=-1;return b|0}function vR(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;i=a+4|0;g=c[i>>2]|0;j=g+(b*12|0)|0;c[j>>2]=1;g=c[g+(b*12|0)+8>>2]|0;h=g+4|0;d=d+1|0;g=Tz(g)|0;while(1){if(!g)break;f=c[(c[h>>2]|0)+8>>2]|0;if((f|0)<0)f=c[g+8>>2]|0;else f=g+(0-f)|0;f=c[f>>2]|0;if(!(c[(c[i>>2]|0)+(f*12|0)>>2]|0))d=vR(a,f,d,e)|0;g=c[g>>2]|0;}c[j>>2]=2;yR(e,b);return d+1|0}function wR(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if((b|0)==-1)a=-1;else {d=c[(c[a+4>>2]|0)+(b<<2)>>2]|0;c[a>>2]=b+-1;a=d;}return a|0}function xR(a){a=a|0;U1(c[a+4>>2]|0);U1(a);return}function yR(a,b){a=a|0;b=b|0;var d=0;d=(c[a>>2]|0)+1|0;c[a>>2]=d;c[(c[a+4>>2]|0)+(d<<2)>>2]=b;return}function zR(a){a=a|0;var d=0,e=0,f=0;e=c[a>>2]|0;c[a+8>>2]=e;c[a+12>>2]=c[a+4>>2];d=a+16|0;a=0;while(1){if((a|0)>=(e|0))break;f=c[d>>2]|0;b[f+(a*40|0)+18>>1]=b[f+(a*40|0)+16>>1]|0;a=a+1|0;}return}function AR(a){a=a|0;var d=0,e=0,f=0;d=c[a+8>>2]|0;c[a>>2]=d;c[a+4>>2]=c[a+12>>2];e=a+16|0;a=0;while(1){if((a|0)>=(d|0))break;f=c[e>>2]|0;b[f+(a*40|0)+16>>1]=b[f+(a*40|0)+18>>1]|0;a=a+1|0;}d=d+2|0;while(1){if((a|0)>=(d|0))break;b[(c[e>>2]|0)+(a*40|0)+16>>1]=0;a=a+1|0;}return}function BR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=JK(((c[a>>2]|0)*6|0)+(b<<1)<<2)|0;c[a+20>>2]=JK((((c[a>>2]|0)*3|0)+b|0)*24|0)|0;e=c[a>>2]|0;f=a+16|0;a=0;while(1){if((a|0)>=(e|0))break;c[(c[f>>2]|0)+(a*40|0)+28>>2]=d;d=d+24|0;a=a+1|0;}e=e+2|0;while(1){if((a|0)>=(e|0))break;c[(c[f>>2]|0)+(a*40|0)+28>>2]=d;d=d+(b<<2)|0;a=a+1|0;}return}function CR(a){a=a|0;var b=0;b=JK(24)|0;c[b>>2]=0;c[b+16>>2]=JK(a*40|0)|0;return b|0}function DR(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=c[a>>2]|0;c[d+(b*40|0)+32>>2]=b;c[a>>2]=b+1;return d+(b*40|0)|0}function ER(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,g=0;g=a+4|0;f=c[g>>2]|0;c[g>>2]=f+1;g=c[a+20>>2]|0;a=g+(f*24|0)|0;c[g+(f*24|0)+12>>2]=c[b+32>>2];c[g+(f*24|0)+16>>2]=c[d+32>>2];h[a>>3]=e;c[g+(f*24|0)+8>>2]=0;FR(b,f);FR(d,f);return a|0}function FR(a,d){a=a|0;d=d|0;var e=0,f=0;e=a+16|0;f=b[e>>1]|0;c[(c[a+28>>2]|0)+(f<<16>>16<<2)>>2]=d;b[e>>1]=f+1<<16>>16;return}function GR(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+28>>2]|0);U1(c[b>>2]|0);U1(c[a+20>>2]|0);U1(a);return}function HR(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;g=c[a>>2]|0;i=a+16|0;f=0;while(1){if((f|0)>=(g|0))break;c[(c[i>>2]|0)+(f*40|0)>>2]=-2147483648;f=f+1|0;}XU();a:do if(!(_U(d)|0)){c[d+8>>2]=0;c[d>>2]=0;d=a+20|0;b:while(1){g=aV()|0;if(!g){f=0;break a}c[g>>2]=0-(c[g>>2]|0);if((g|0)==(e|0)){f=0;break a}i=g+16|0;j=g+28|0;f=0;while(1){if((f|0)>=(b[i>>1]|0))continue b;k=(c[d>>2]|0)+((c[(c[j>>2]|0)+(f<<2)>>2]|0)*24|0)|0;l=IR(a,k,g)|0;m=c[l>>2]|0;do if((m|0)<0){n=~~-(+h[k>>3]+ +(c[g>>2]|0));if((m|0)==-2147483648){c[l>>2]=n;if(_U(l)|0){f=1;break a}c[l+8>>2]=g;c[l+12>>2]=k;break}else {if((m|0)>=(n|0))break;bV(l,n);c[l+8>>2]=g;c[l+12>>2]=k;break}}while(0);f=f+1|0;}}}else f=1;while(0);return f|0}function IR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[b+12>>2]|0;if((e|0)==(c[d+32>>2]|0))e=c[b+16>>2]|0;return (c[a+16>>2]|0)+(e*40|0)|0}function JR(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=c[a>>2]|0;LF(g,3,b)|0;b=c[g+92>>2]|0;do if(b){d=c[b+16>>2]|0;h=c[d+12>>2]|0;c[a+76>>2]=h;e=c[d+16>>2]|0;c[a+84>>2]=e;f=a+80|0;c[f>>2]=c[d>>2];c[a+88>>2]=c[b+4>>2];d=a+152|0;e=c[d>>2]|c[e>>2];c[d>>2]=e;b=c[g+80>>2]|0;if(!b){c[a+60>>2]=0;b=999;break}else {g=c[b+16>>2]|0;c[a+60>>2]=c[g+12>>2];i=c[g+16>>2]|0;c[a+68>>2]=i;c[a+72>>2]=c[b+4>>2];c[d>>2]=e|c[i>>2];c[a+64>>2]=c[((h|0)==0?f:g)>>2];b=300;break}}else b=999;while(0);return b|0}function KR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(!(kF(a)|0))if((b|0)!=0?(d=c[b>>2]|0,(d|0)!=0):0){tb[d&127](a);a=0;}else a=0;else a=1;return a|0}function LR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+4>>2]|0,d|0):0)tb[d&127](a);c[(c[a>>2]|0)+24>>2]=0;sF(a);return}function MR(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;e=+h[b+504>>3];f=+h[b+512>>3];i=+h[b+352>>3];if(!(c[b+360>>2]|0)){g=+h[d>>3]+e;d=d+8|0;e=f;}else g=-(f+ +h[d+8>>3]);f=+h[b+528>>3]*i*(+h[d>>3]+e);h[a>>3]=+h[b+520>>3]*i*g;h[a+8>>3]=f;return}function NR(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0;f=+h[a+504>>3];g=+h[a+512>>3];i=+h[a+352>>3];j=+h[a+520>>3]*i;i=+h[a+528>>3]*i;a:do if(!(c[a+360>>2]|0)){a=0;while(1){if((a|0)>=(e|0))break a;h[d+(a<<4)>>3]=(+h[b+(a<<4)>>3]+f)*j;h[d+(a<<4)+8>>3]=(+h[b+(a<<4)+8>>3]+g)*i;a=a+1|0;}}else {a=0;while(1){if((a|0)>=(e|0))break a;k=-(j*(+h[b+(a<<4)+8>>3]+g));h[d+(a<<4)+8>>3]=(+h[b+(a<<4)>>3]+f)*i;h[d+(a<<4)>>3]=k;a=a+1|0;}}while(0);return d|0}function OR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+8>>2]|0,d|0):0)tb[d&127](a);return}function PR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+12>>2]|0,d|0):0)tb[d&127](a);rF(a);return}function QR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+24>>2]|0,d|0):0)tb[d&127](a);return}function RR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+28>>2]|0,d|0):0)tb[d&127](a);return}function SR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+16>>2]|0,d|0):0){b=c[a+160>>2]|0;xb[d&31](a,c[(c[(c[a>>2]|0)+308>>2]|0)+(b<<2)>>2]|0,b,c[a+156>>2]|0);}return}function TR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+20>>2]|0,d|0):0)tb[d&127](a);return}function UR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+32>>2]|0,d|0):0)tb[d&127](a);return}function VR(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+36>>2]|0,d|0):0)tb[d&127](a);return}function WR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+40>>2]|0,d|0):0)tb[d&127](a);return}function XR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+44>>2]|0,d|0):0)tb[d&127](a);return}function YR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+48>>2]|0,d|0):0)tb[d&127](a);return}function ZR(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+52>>2]|0,d|0):0)tb[d&127](a);return}function _R(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+56>>2]|0,d|0):0)tb[d&127](a);return}function $R(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+60>>2]|0,d|0):0)tb[d&127](a);return}function aS(a,b){a=a|0;b=b|0;var d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+64>>2]|0,d|0):0)tb[d&127](a);return}function bS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+68>>2]|0,d|0):0)tb[d&127](a);return}function cS(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=c[a+60>>2]|0;if(g|0?(h=c[g+72>>2]|0,h|0):0)yb[h&15](a,b,d,e,f);return}function dS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+76>>2]|0,d|0):0)tb[d&127](a);return}function eS(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+60>>2]|0;if(d|0?(e=c[d+80>>2]|0,e|0):0)ub[e&63](a,b);return}function fS(a){a=a|0;var b=0,d=0;b=c[a+60>>2]|0;if(b|0?(d=c[b+84>>2]|0,d|0):0)tb[d&127](a);return}function gS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+48|0;f=k+32|0;h=k;i=k+16|0;j=c[b+60>>2]|0;m=c[e>>2]|0;do if(m|0?a[m>>0]|0:0){m=c[b+16>>2]|0;if(m|0?(c[m+144>>2]|0)==0:0)break;if(!(c[b+152>>2]&8192)){c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];MR(i,b,f);c[h>>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];}else {c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];}if(j|0?(g=c[j+88>>2]|0,g|0):0){c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];vb[g&127](b,f,e);}}while(0);l=k;return}function hS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=c[b+60>>2]|0;g=(c[b+16>>2]|0)+16|0;i=R2(d,58)|0;h=(i|0)!=0;if(h)a[i>>0]=0;if(f|0?(iS(c[b+68>>2]|0,d,g),e=c[f+92>>2]|0,e|0):0)ub[e&63](b,g);if(h)a[i>>0]=58;return}function iS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;g=k+16|0;j=k+8|0;i=k;c[d>>2]=b;c[d+32>>2]=5;e=zT(b)|0;f=c[a+16>>2]|0;if(!((f|0)!=0?(u5(e,f,c[a+20>>2]|0,4,102)|0)!=0:0))h=3;a:do if((h|0)==3){switch(AT(b,d,c[a+24>>2]|0)|0){case 0:break a;case 1:break;default:{gA(1,111046,g)|0;break a}}a=KK((l2(b)|0)+16|0)|0;c[i>>2]=b;m4(a,111011,i)|0;if(PJ(a)|0){c[j>>2]=b;gA(0,111020,j)|0;}U1(a);}while(0);l=k;return}function jS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=c[b+60>>2]|0;g=(c[b+16>>2]|0)+56|0;i=R2(d,58)|0;h=(i|0)!=0;if(h)a[i>>0]=0;if(f|0?(iS(c[b+68>>2]|0,d,g),e=c[f+92>>2]|0,e|0):0)ub[e&63](b,g);if(h)a[i>>0]=58;return}function kS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,h=0,i=0,j=0;h=c[a+60>>2]|0;i=a+16|0;j=(c[i>>2]|0)+96|0;if(h|0?(iS(c[a+68>>2]|0,b,j),f=c[h+92>>2]|0,f|0):0)ub[f&63](a,j);j=c[i>>2]|0;c[j+136>>2]=d;g[j+140>>2]=e;return}function lS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;k=m;j=c[b+60>>2]|0;b=c[b+16>>2]|0;c[b+160>>2]=d;a:do if((d|0)!=0&(j|0)!=0){j=b+144|0;i=b+152|0;g=b+148|0;b=d;b:while(1){f=b+4|0;b=c[b>>2]|0;if(!b)break a;c:do switch(a[b>>0]|0){case 115:{if(!(s2(b,111067)|0)){c[j>>2]=3;b=f;continue b}if(!(s2(b,111088)|0)){e=115;while(1){d=b+1|0;if(!(e<<24>>24))break;b=d;e=a[d>>0]|0;}h[i>>3]=+r5(d);b=f;continue b}break}case 100:{if(!(s2(b,137327)|0)){c[j>>2]=1;b=f;continue b}if(!(s2(b,137320)|0)){c[j>>2]=2;b=f;continue b}break}case 105:{if(s2(b,134335)|0?s2(b,111073)|0:0)break c;c[j>>2]=0;b=f;continue b}case 98:{if(!(s2(b,111083)|0)){h[i>>3]=2.0;b=f;continue b}break}case 102:{if(!(s2(b,111101)|0)){c[g>>2]=1;b=f;continue b}break}case 117:{if(!(s2(b,111108)|0)){c[g>>2]=0;b=f;continue b}break}case 116:{if(!(s2(b,111117)|0)){b=f;continue b}break}default:{}}while(0);c[k>>2]=b;gA(0,111125,k)|0;b=f;}}while(0);l=m;return}function mS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+32|0;g=j;d=c[a+60>>2]|0;if((d|0?(i=d+96|0,f=c[i>>2]|0,f|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){d=b+16|0;h[g>>3]=(+h[d>>3]+ +h[b>>3])*.5;h[g+8>>3]=(+h[b+24>>3]+ +h[b+8>>3])*.5;b=g+16|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];if(!(c[a+152>>2]&8192)){NR(a,g,g,2)|0;f=c[i>>2]|0;}vb[f&127](a,g,e);}l=j;return}function nS(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+48|0;m=o;f=c[a+60>>2]|0;if((f|0?(n=f+100|0,c[n>>2]|0):0)?(k=a+16|0,j=c[k>>2]|0,c[j+144>>2]|0):0){if(!(e&4)){f=e;g=0;}else {f=e&-5;e=j+16|0;g=m;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));g=e;h=j+56|0;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));g=1;}if(!(c[a+152>>2]&8192)){e=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=e;e=MK(c[47364]|0,e<<4)|0;c[47364]=e;}else e=c[47364]|0;NR(a,b,e,d)|0;xb[c[n>>2]&31](a,e,d,f);}else xb[c[n>>2]&31](a,b,d,f);if(g|0){g=(c[k>>2]|0)+16|0;h=m;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0))}}l=o;return}function oS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+64|0;f=e;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];g=f+32|0;b=b+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];h[f+16>>3]=+h[f>>3];h[f+24>>3]=+h[f+40>>3];h[f+48>>3]=+h[g>>3];h[f+56>>3]=+h[f+8>>3];nS(a,f,4,d);l=e;return}function pS(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=c[a+60>>2]|0;do if((i|0?(j=i+104|0,h=c[j>>2]|0,h|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){if(c[a+152>>2]&8192|0){zb[h&15](a,b,d,e,f,g&255);break}h=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=h;h=MK(c[47364]|0,h<<4)|0;c[47364]=h;}else h=c[47364]|0;NR(a,b,h,d)|0;zb[c[j>>2]&15](a,h,d,e,f,g&255);}while(0);return}function qS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=c[a+60>>2]|0;do if((e|0?(g=e+108|0,f=c[g>>2]|0,f|0):0)?c[(c[a+16>>2]|0)+144>>2]|0:0){if(c[a+152>>2]&8192|0){vb[f&127](a,b,d);break}e=d+10|0;if((c[47363]|0)<(d|0)){c[47363]=e;e=MK(c[47364]|0,e<<4)|0;c[47364]=e;}else e=c[47364]|0;NR(a,b,e,d)|0;vb[c[g>>2]&127](a,e,d);}while(0);return}function rS(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b+60>>2]|0;if((d|0?!((e|0)==0|(a[d>>0]|0)==0):0)?(f=c[e+112>>2]|0,f|0):0)ub[f&63](b,d);return}function sS(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;F=l;l=l+112|0;B=F+64|0;E=F;n=F+96|0;x=F+48|0;y=F+32|0;C=c[b+60>>2]|0;if(!b)qa(111282,111178,691,111189);if(!d)qa(111208,111178,692,111189);if(!(a[d>>0]|0))qa(111213,111178,693,111189);D=NF(d)|0;if(!D){if((C|0)!=0&(iN(d)|0)!=0?(m=c[C+116>>2]|0,m|0):0)yb[m&15](b,d,e,f,g&255);}else {s=b+432|0;c[B>>2]=c[s>>2];c[B+4>>2]=c[s+4>>2];c[B+8>>2]=c[s+8>>2];c[B+12>>2]=c[s+12>>2];QF(n,D,B);s=c[n>>2]|0;m=c[n+4>>2]|0;if(!((s|0)<1&(m|0)<1)){n=E+16|0;c[n>>2]=c[e>>2];c[n+4>>2]=c[e+4>>2];c[n+8>>2]=c[e+8>>2];c[n+12>>2]=c[e+12>>2];c[E>>2]=c[e>>2];c[E+4>>2]=c[e+4>>2];c[E+8>>2]=c[e+8>>2];c[E+12>>2]=c[e+12>>2];z=E+8|0;A=E+24|0;d=1;while(1){if((d|0)>=(f|0))break;G=e+(d<<4)|0;v=+h[G>>3];h[E>>3]=+h[(+h[E>>3]>3];w=+h[e+(d<<4)+8>>3];h[z>>3]=+h[(+h[z>>3]>3];h[n>>3]=+h[(+h[n>>3]>v?n:G)>>3];h[A>>3]=+h[(+h[A>>3]>w?n:G)+8>>3];d=d+1|0;}k=+h[n>>3];j=+h[E>>3];t=k-j;u=+h[A>>3];v=+h[z>>3];w=u-v;o=+(m|0);p=+(s|0);q=t/p;r=w/o;a:do switch(tS(i)|0){case 1:if(q>3]=j;k=k-t;h[n>>3]=k;}if(o>3]=v+w;h[A>>3]=u-w;}if(!(c[b+152>>2]&8192)){c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];MR(x,b,B);c[E>>2]=c[x>>2];c[E+4>>2]=c[x+4>>2];c[E+8>>2]=c[x+8>>2];c[E+12>>2]=c[x+12>>2];c[B>>2]=c[n>>2];c[B+4>>2]=c[n+4>>2];c[B+8>>2]=c[n+8>>2];c[B+12>>2]=c[n+12>>2];MR(y,b,B);c[n>>2]=c[y>>2];c[n+4>>2]=c[y+4>>2];c[n+8>>2]=c[y+8>>2];c[n+12>>2]=c[y+12>>2];k=+h[n>>3];j=+h[E>>3];}if(j>k){h[E>>3]=k;h[n>>3]=j;}j=+h[z>>3];k=+h[A>>3];if(j>k){h[z>>3]=k;h[A>>3]=j;}if(C|0){G=c[b+72>>2]|0;c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];c[B+16>>2]=c[E+16>>2];c[B+20>>2]=c[E+20>>2];c[B+24>>2]=c[E+24>>2];c[B+28>>2]=c[E+28>>2];xS(b,D,B,g,G);}}}l=F;return}function tS(b){b=b|0;if(a[b>>0]|0)if(c3(b,141116)|0)if(c3(b,141048)|0)if(!(c3(b,111221)|0))b=4;else b=(dP(b)|0)<<24>>24!=0&1;else b=3;else b=2;else b=0;return b|0}function uS(a,b){a=a|0;b=+b;if(c[a+60>>2]|0)h[(c[a+16>>2]|0)+152>>3]=b;return}function vS(a,b){a=a|0;b=b|0;b=LF(a,1,b)|0;if(!b)b=999;else {b=c[b+16>>2]|0;c[a+184>>2]=c[b+4>>2];c[a+172>>2]=c[b+12>>2];c[a+176>>2]=c[b>>2];c[a+180>>2]=c[b+16>>2];b=300;}return b|0}function wS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i;TC(b,137483,280,1)|0;g=b+16|0;c[(c[g>>2]|0)+144>>2]=a;if((yC(b)|0)!=(b|0))c[(c[(yC(b)|0)+16>>2]|0)+144>>2]=a;e=QA(b,111226)|0;d=a+172|0;if((e|0)!=0?(c[d>>2]=0,(vS(a,e)|0)==999):0){d=MF(a,1,e)|0;c[f>>2]=e;c[f+4>>2]=d;gA(1,111233,f)|0;d=-1;}else {e=c[d>>2]|0;if(!e)d=-1;else {RJ(1);qK(b,c[c[a+180>>2]>>2]&1);d=c[(c[g>>2]|0)+8>>2]|0;c[(c[(yC(b)|0)+16>>2]|0)+8>>2]=d;_N();d=c[e>>2]|0;if(d|0?(tb[d&127](b),h=c[e+4>>2]|0,h|0):0)c[(c[g>>2]|0)+148>>2]=h;RJ(0);d=0;}}l=i;return d|0}function xS(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+176|0;k=n+8|0;j=n;h=n+40|0;if(!b)qa(111282,111286,52,111300);if(!d)qa(111312,111286,53,111300);i=c[d+8>>2]|0;if(!i)qa(111315,111286,54,111300);if(!(a[i>>0]|0))qa(111324,111286,55,111300);r3(h,c[d+28>>2]|0)|0;i=h+(l2(h)|0)|0;a[i>>0]=58;a[i+1>>0]=0;F4(h,g)|0;if((yS(b,h)|0)==999){c[j>>2]=h;gA(0,111336,j)|0;}g=c[b+92>>2]|0;if(g|0?(m=c[g>>2]|0,m|0):0){c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[k+16>>2]=c[e+16>>2];c[k+20>>2]=c[e+20>>2];c[k+24>>2]=c[e+24>>2];c[k+28>>2]=c[e+28>>2];xb[m&31](b,d,k,f);}l=n;return}function yS(a,b){a=a|0;b=b|0;b=LF(c[a>>2]|0,4,b)|0;if(!b)b=999;else {b=c[b+16>>2]|0;c[a+92>>2]=c[b+12>>2];c[a+96>>2]=c[b>>2];b=300;}return b|0}function zS(a){a=a|0;return 1}function AS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+336|0;h[c>>3]=+h[c>>3]+10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function BS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+336|0;h[c>>3]=+h[c>>3]-10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function CS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+344|0;h[c>>3]=+h[c>>3]-10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function DS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+344|0;h[c>>3]=+h[c>>3]+10.0/+h[b+352>>3];a[b+537>>0]=1;return 0}function ES(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+352|0;h[c>>3]=+h[c>>3]*1.1;a[b+537>>0]=1;return 0}function FS(b){b=b|0;var c=0;a[b+536>>0]=0;c=b+352|0;h[c>>3]=+h[c>>3]*.9090909090909091;a[b+537>>0]=1;return 0}function GS(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;e=b+536|0;d=(a[e>>0]|0)==0;a[e>>0]=d&1;if(d){d=c[b+448>>2]|0;e=c[b+452>>2]|0;i=+(d>>>0);g=+(e>>>0);f=i/+(d|0)>3]=(f?i:g)/+((f?d:e)|0);e=b+336|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;a[b+537>>0]=1;}return 0}function HS(b){b=b|0;var d=0,e=0;d=c[(c[b>>2]|0)+168>>2]|0;e=b+580|0;if(!(c[e>>2]|0)){c[e>>2]=d;e=(c[d+16>>2]|0)+112|0;a[e>>0]=a[e>>0]|2;XS(b,d);}sI(b,d);a[b+540>>0]=1;return}function IS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0;k=l;l=l+16|0;f=k;switch(d|0){case 1:{c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];QS(b,f);WS(b);a[b+538>>0]=1;a[b+541>>0]=1;j=13;break}case 2:{a[b+538>>0]=1;a[b+541>>0]=2;j=13;break}case 3:{c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];QS(b,f);a[b+538>>0]=1;a[b+541>>0]=3;j=13;break}case 4:{a[b+536>>0]=0;if(!(c[b+360>>2]|0)){f=b+352|0;i=+h[f>>3];d=b+336|0;h[d>>3]=(+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+520>>3]*i)+ +h[d>>3];g=+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5;d=b+528|0;}else {f=b+352|0;i=+h[f>>3];d=b+336|0;h[d>>3]=+h[d>>3]-(+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+528>>3]*i);g=+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5;d=b+520|0;}j=b+344|0;h[j>>3]=g*.10000000000000009/(+h[d>>3]*i)+ +h[j>>3];h[f>>3]=i*1.1;j=13;break}case 5:{a[b+536>>0]=0;j=b+352|0;i=+h[j>>3]*.9090909090909091;h[j>>3]=i;if(!(c[b+360>>2]|0)){f=b+336|0;h[f>>3]=+h[f>>3]-(+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+520>>3]*i);g=+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5;f=b+528|0;}else {f=b+336|0;h[f>>3]=(+h[e+8>>3]-+((c[b+452>>2]|0)>>>0)*.5)*.10000000000000009/(+h[b+528>>3]*i)+ +h[f>>3];g=+h[e>>3]-+((c[b+448>>2]|0)>>>0)*.5;f=b+520|0;}j=b+344|0;h[j>>3]=+h[j>>3]-g*.10000000000000009/(+h[f>>3]*i);j=13;break}default:{}}if((j|0)==13)a[b+537>>0]=1;b=b+560|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];l=k;return}function JS(b,c,d){b=b|0;c=c|0;d=d|0;a[b+538>>0]=0;a[b+541>>0]=0;return}function KS(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0;k=l;l=l+16|0;e=k;i=b+560|0;j=(+h[d>>3]-+h[i>>3])/+h[b+520>>3];g=(+h[d+8>>3]-+h[b+568>>3])/+h[b+528>>3];if(!(+B(+j)<.0001&+B(+g)<.0001)){switch(a[b+541>>0]|0){case 0:{c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];QS(b,e);break}case 2:{f=+h[b+352>>3];if(!(c[b+360>>2]|0)){e=b+336|0;h[e>>3]=+h[e>>3]-j/f;e=b+344|0;h[e>>3]=+h[e>>3]-g/f;}else {e=b+336|0;h[e>>3]=+h[e>>3]-g/f;e=b+344|0;h[e>>3]=+h[e>>3]+j/f;}a[b+537>>0]=1;break}default:{}}c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];}l=k;return}function LS(a,b,c){a=a|0;b=b|0;c=c|0;return}function MS(a){a=a|0;return}function NS(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=c[b>>2]|0;if(d){d=$4(d,138821)|0;if(d|0){i=jF(d,0)|0;I4(d)|0;f=5;}}else {i=jF(c[15647]|0,0)|0;f=5;}if((f|0)==5?i|0:0){g=j+168|0;d=c[g>>2]|0;if(d|0){f=c[j+172>>2]|0;if((f|0)!=0?(h=c[f+4>>2]|0,(h|0)!=0):0){tb[h&127](d);d=c[g>>2]|0;}vK(d);sB(c[g>>2]|0)|0;}YC(i,0,137483,280,1);YC(i,1,137447,304,1);YC(i,2,137460,176,1);c[g>>2]=i;c[(c[i+16>>2]|0)+144>>2]=j;if((nG(j,i,e)|0)!=-1){c[b+580>>2]=0;c[b+576>>2]=0;a[b+537>>0]=1;}}return}function OS(a,b){a=a|0;b=b|0;a=c[a>>2]|0;nG(a,c[a+168>>2]|0,b)|0;return}function PS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=c[a>>2]|0;f=g+160|0;e=c[f>>2]|0;if((e|0)!=0?(c[g+164>>2]|0)==0:0){i=g+192|0;h=c[i>>2]|0;c[f>>2]=0;c[i>>2]=0;f=h;}else {f=0;e=0;}pG(g,c[g+168>>2]|0,b,d)|0;if(e|0){i=c[a>>2]|0;c[i+160>>2]=e;c[i+192>>2]=f;}return}function QS(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0;f=l;l=l+80|0;e=f+48|0;g=f;m=f+32|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];RS(m,b,e);k=+h[m>>3];j=+h[m+8>>3];i=1.0/+h[b+352>>3];h[g+16>>3]=i+k;h[g+24>>3]=i+j;h[g>>3]=k-i;h[g+8>>3]=j-i;d=c[(c[b>>2]|0)+168>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];c[e+16>>2]=c[g+16>>2];c[e+20>>2]=c[g+20>>2];c[e+24>>2]=c[g+24>>2];c[e+28>>2]=c[g+28>>2];d=SS(d,e)|0;e=b+576|0;if((d|0)!=(c[e>>2]|0)){TS(b);c[e>>2]=d;US(b);a[b+537>>0]=1;}l=f;return}function RS(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0;if(!(c[b+360>>2]|0)){e=+h[b+352>>3];f=+h[d+8>>3];g=e;i=b+528|0;e=+h[d>>3]/(+h[b+520>>3]*e)-+h[b+504>>3];}else {e=+h[b+352>>3];f=-+h[d>>3];g=e;i=b+520|0;e=+h[d+8>>3]/(+h[b+528>>3]*e)-+h[b+504>>3];}g=f/(+h[i>>3]*g)-+h[b+512>>3];h[a>>3]=e;h[a+8>>3]=g;return}function SS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g;e=jC(a)|0;a:while(1){if(!e){e=9;break}d=XA(a,e)|0;while(1){if(!d)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];if((jQ(d,f)|0)<<24>>24){e=6;break a}d=ZA(a,d)|0;}e=kC(a,e)|0;}do if((e|0)!=6)if((e|0)==9){d=lC(a)|0;while(1){if(!d)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];if((gQ(d,f)|0)<<24>>24){e=12;break}d=mC(a,d)|0;}if((e|0)==12)break;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];c[f+20>>2]=c[b+20>>2];c[f+24>>2]=c[b+24>>2];c[f+28>>2]=c[b+28>>2];d=VS(a,f)|0;if(!d){d=a;break}else break}while(0);l=g;return d|0}function TS(b){b=b|0;var d=0;d=c[b+576>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{d=(c[d+16>>2]|0)+112|0;a[d>>0]=a[d>>0]&-2;break a}case 1:{d=(c[d+16>>2]|0)+117|0;a[d>>0]=a[d>>0]&-2;break a}case 2:{d=(c[d+16>>2]|0)+115|0;a[d>>0]=a[d>>0]&-2;break a}default:break a}while(0);c[b+584>>2]=0;return}function US(b){b=b|0;var d=0,e=0;e=b+584|0;d=c[e>>2]|0;if(d|0){U1(d);c[e>>2]=0;}d=c[b+576>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{b=(c[d+16>>2]|0)+112|0;a[b>>0]=a[b>>0]|1;b=GA(d,0,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}case 1:{b=(c[d+16>>2]|0)+117|0;a[b>>0]=a[b>>0]|1;b=GA(xC(d)|0,1,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}case 2:{b=(c[d+16>>2]|0)+115|0;a[b>>0]=a[b>>0]|1;b=GA(xC(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0,2,141101,0)|0;if(!b)break a;c[e>>2]=EK(RA(d,b)|0,d)|0;break a}default:break a}while(0);return}function VS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+32|0;e=m;g=c[a+16>>2]|0;i=c[g+180>>2]|0;j=g+184|0;d=1;while(1){if((d|0)>(i|0)){k=4;break}f=c[(c[j>>2]|0)+(d<<2)>>2]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];c[e+16>>2]=c[b+16>>2];c[e+20>>2]=c[b+20>>2];c[e+24>>2]=c[b+24>>2];c[e+28>>2]=c[b+28>>2];f=VS(f,e)|0;if(!f)d=d+1|0;else {a=f;break}}do if((k|0)==4){o=+h[g+24>>3];n=+h[g+40>>3];if(((+h[b+16>>3]>=+h[g+16>>3]?+h[g+32>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=o:0)?n>=+h[b+8>>3]:0)break;a=0;}while(0);l=m;return a|0}function WS(b){b=b|0;var d=0,e=0,f=0;f=b+580|0;d=c[f>>2]|0;a:do if(d|0)switch(IC(d)|0){case 0:{e=(c[d+16>>2]|0)+112|0;a[e>>0]=a[e>>0]&-7|4;break a}case 1:{e=(c[d+16>>2]|0)+117|0;a[e>>0]=a[e>>0]&-7|4;break a}case 2:{e=(c[d+16>>2]|0)+115|0;a[e>>0]=a[e>>0]&-7|4;break a}default:break a}while(0);d=b+588|0;e=c[d>>2]|0;if(e|0){U1(e);c[d>>2]=0;}d=c[b+576>>2]|0;c[f>>2]=d;b:do if(d|0)switch(IC(d)|0){case 0:{f=(c[d+16>>2]|0)+112|0;a[f>>0]=a[f>>0]|2;XS(b,d);break b}case 1:{f=(c[d+16>>2]|0)+117|0;a[f>>0]=a[f>>0]|2;YS(b,d);break b}case 2:{f=(c[d+16>>2]|0)+115|0;a[f>>0]=a[f>>0]|2;ZS(b,d);break b}default:break b}while(0);return}function XS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+592|0;do if((yC(b)|0)==(b|0))if(!(xB(b)|0)){GF(d,0,111494);break}else {GF(d,0,111486);break}else GF(d,0,111500);while(0);GF(d,1,KB(b)|0);c[a+596>>2]=2;f=a+604|0;d=0;e=2;while(1){d=LA(b,0,d)|0;if(!d)break;GF(f,e,c[d+8>>2]|0);GF(f,e+1|0,RA(b,d)|0);GF(f,e+2|0,0);e=e+3|0;}c[a+608>>2]=e;d=GA(b,0,141055,0)|0;if(!d){d=GA(b,0,111477,0)|0;if(d|0)g=11;}else g=11;if((g|0)==11)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function YS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=a+592|0;GF(f,0,111481);GF(f,1,KB(b)|0);c[a+596>>2]=2;f=a+604|0;g=yC(xC(b)|0)|0;e=2;d=0;while(1){d=LA(g,1,d)|0;if(!d)break;GF(f,e,c[d+8>>2]|0);GF(f,e|1,RA(b,d)|0);e=e+2|0;}c[a+608>>2]=e;d=GA(xC(b)|0,1,141055,0)|0;if(!d){d=GA(xC(b)|0,1,111477,0)|0;if(d|0)h=6;}else h=6;if((h|0)==6)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function ZS(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;h=a+592|0;GF(h,0,111450);k=b+48|0;GF(h,1,KB(c[((c[b>>2]&3|0)==3?b:k)+40>>2]|0)|0);k=(xB(xC(c[((c[b>>2]&3|0)==3?b:k)+40>>2]|0)|0)|0)!=0;GF(h,3,k?137738:141747);k=b+-48|0;GF(h,4,KB(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0);c[a+596>>2]=7;i=a+604|0;j=yC(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0)|0;g=7;d=0;a:while(1){while(1){d=LA(j,2,d)|0;if(!d)break a;e=d+8|0;f=c[e>>2]|0;if(!(s2(f,111455)|0)){l=5;break}if(!(s2(f,111464)|0)){l=7;break}if(s2(f,111473)|0)break;GF(h,6,RA(b,d)|0);}if((l|0)==5){l=0;GF(h,2,RA(b,d)|0);}else if((l|0)==7){l=0;GF(h,5,RA(b,d)|0);}GF(i,g,c[e>>2]|0);GF(i,g+1|0,RA(b,d)|0);g=g+2|0;}c[a+608>>2]=g;d=GA(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0,2,141055,0)|0;if(!d){d=GA(xC(c[((c[b>>2]&3|0)==2?b:k)+40>>2]|0)|0,2,111477,0)|0;if(d|0)l=13;}else l=13;if((l|0)==13)c[a+588>>2]=EK(RA(b,d)|0,b)|0;return}function _S(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=$S(a,b,c[d>>2]|0)|0;d=c[d+4>>2]|0;while(1){f=c[d+4>>2]|0;if(!f)break;b=0;while(1){e=c[f+(b*20|0)+4>>2]|0;if(!e)break;JF(a,c[d>>2]|0,e,c[f+(b*20|0)+8>>2]|0,g,f+(b*20|0)|0)|0;b=b+1|0;}d=d+8|0;}return}function $S(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=KK(12)|0;if(!b)b=0;else b=D4(b)|0;c[e+4>>2]=b;c[e+8>>2]=D4(d)|0;d=a+100|0;c[e>>2]=c[d>>2];c[d>>2]=e;return e|0}function aT(b,c){b=b|0;c=c|0;bT(b);a[b+44>>0]=0;cT(b)|0;PO(b)|0;return}function bT(b){b=b|0;var d=0,e=0;d=c[b+32>>2]|0;a:do if(d|0)while(1){e=c[d>>2]|0;if(!e)break a;if((a[e>>0]|0)==103?d4(e,111509)|0:0)_S(b,0,c[d+4>>2]|0);d=d+8|0;}while(0);return}function cT(a){a=a|0;var b=0;b=LF(a,2,111522)|0;if(!b)a=999;else {c[a+148>>2]=c[(c[b+16>>2]|0)+12>>2];a=300;}return a|0}function dT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a=c[a+148>>2]|0;if((a|0)!=0?(e=c[a>>2]|0,(e|0)!=0):0)a=lb[e&127](b,d)|0;else a=0;return a|0}function eT(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return (c[b>>2]|0)-(c[d>>2]|0)|0}function fT(a){a=a|0;var b=0.0,d=0.0;a=c[a+16>>2]|0;d=+h[a+16>>3];b=+h[a+24>>3];return (gT(~~(d>b?d:b)>>>0)|0)+1|0}function gT(a){a=a|0;var b=0,c=0;if(!a)a=-1;else {c=a>>>0>65535;a=c?a>>>16:a;c=c?16:0;b=a>>>0>255;a=b?a>>>8:a;c=b?c|8:c;b=a>>>0>15;a=b?a>>>4:a;c=b?c|4:c;b=a>>>0>3;a=(b?c|2:c)+((b?a>>>2:a)>>>0>1&1)|0;}return a|0}function hT(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+32|0;q=r;p=iT(b,d,e,f,g)|0;e=jT(p)|0;if((e|0)>=0){n=q+16|0;o=q+24|0;m=q+8|0;k=g+32|0;e=0;g=0;while(1){if((g|0)>=(d|0))break;f=b+(g*40|0)+32|0;do if(c[f>>2]|0){kT(q,p,b+(g*40|0)|0);i=+h[n>>3];j=+h[o>>3];if(!(c[q>>2]|0)){a[(c[f>>2]|0)+36>>0]=1;break}if(+h[m>>3]==0.0){f=c[f>>2]|0;h[f+16>>3]=i;h[f+24>>3]=j;a[f+36>>0]=1;break}if((a[k>>0]|0)==1){f=c[f>>2]|0;h[f+16>>3]=i;h[f+24>>3]=j;a[f+36>>0]=1;}else e=1;}while(0);g=g+1|0;}lT(p);}l=r;return e|0}function iT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=JK(28)|0;j=Vz(25912,c[4584]|0)|0;h=g+20|0;c[h>>2]=j;do if(j){j=TV()|0;c[g+24>>2]=j;if(!j){U4(111740,14,1,c[15712]|0)|0;i=6;break}else {c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=d;c[g+12>>2]=e;c[g+16>>2]=f;break}}else {U4(111740,14,1,c[15712]|0)|0;i=6;}while(0);if((i|0)==6){a=c[h>>2]|0;if(a|0)Rz(a)|0;a=c[g+24>>2]|0;if(a|0)VV(a)|0;U1(g);g=0;}return g|0}function jT(a){a=a|0;var b=0;b=uT(a)|0;if((b|0)>=0){vT(a);wT(a);b=Rz(c[a+20>>2]|0)|0;}return b|0}function kT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0,L=0,M=0;M=l;l=l+464|0;J=M+416|0;L=M+400|0;G=M+384|0;m=M+352|0;n=M+320|0;o=M+288|0;p=M+256|0;r=M+224|0;s=M+192|0;t=M+160|0;u=M+128|0;v=M+96|0;x=M+64|0;y=M+32|0;H=M;z=c[d+32>>2]|0;e=+h[z>>3];C=d+16|0;A=(e*2.0+ +h[C>>3])*.125;D=z+8|0;I=d+24|0;i=+h[I>>3];K=(+h[D>>3]*2.0+i)*.5;if(!z)qa(111533,111543,445,111553);f=J;g=f+36|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));B=z+16|0;h[B>>3]=+h[d>>3]-e;E=d+8|0;F=z+24|0;h[F>>3]=i+ +h[E>>3];mT(m,b,d,J);j=c[m>>2]|0;f=c[m+4>>2]|0;e=+h[m+8>>3];m=m+16|0;c[L>>2]=c[m>>2];c[L+4>>2]=c[m+4>>2];c[L+8>>2]=c[m+8>>2];c[L+12>>2]=c[m+12>>2];a:do if(!j){c[a>>2]=0;c[a+4>>2]=f;h[a+8>>3]=e;a=a+16|0;c[a>>2]=c[L>>2];c[a+4>>2]=c[L+4>>2];c[a+8>>2]=c[L+8>>2];c[a+12>>2]=c[L+12>>2];}else {h[F>>3]=+h[E>>3];mT(n,b,d,J);g=c[n>>2]|0;m=c[n+4>>2]|0;i=+h[n+8>>3];n=n+16|0;c[G>>2]=c[n>>2];c[G+4>>2]=c[n+4>>2];c[G+8>>2]=c[n+8>>2];c[G+12>>2]=c[n+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=m;e=i;}else g=j;h[F>>3]=+h[E>>3]-+h[D>>3];mT(o,b,d,J);m=c[o>>2]|0;j=c[o+4>>2]|0;i=+h[o+8>>3];o=o+16|0;c[G>>2]=c[o>>2];c[G+4>>2]=c[o+4>>2];c[G+8>>2]=c[o+8>>2];c[G+12>>2]=c[o+12>>2];if(!m){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=j;e=i;}else m=g;h[B>>3]=+h[d>>3];h[F>>3]=+h[I>>3]+ +h[E>>3];mT(p,b,d,J);g=c[p>>2]|0;j=c[p+4>>2]|0;i=+h[p+8>>3];p=p+16|0;c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3]-+h[D>>3];mT(r,b,d,J);g=c[r>>2]|0;j=c[r+4>>2]|0;i=+h[r+8>>3];r=r+16|0;c[G>>2]=c[r>>2];c[G+4>>2]=c[r+4>>2];c[G+8>>2]=c[r+8>>2];c[G+12>>2]=c[r+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[B>>3]=+h[C>>3]+ +h[d>>3];h[F>>3]=+h[I>>3]+ +h[E>>3];mT(s,b,d,J);g=c[s>>2]|0;j=c[s+4>>2]|0;i=+h[s+8>>3];s=s+16|0;c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3];mT(t,b,d,J);g=c[t>>2]|0;j=c[t+4>>2]|0;i=+h[t+8>>3];t=t+16|0;c[G>>2]=c[t>>2];c[G+4>>2]=c[t+4>>2];c[G+8>>2]=c[t+8>>2];c[G+12>>2]=c[t+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=g;f=j;e=i;}h[F>>3]=+h[E>>3]-+h[D>>3];mT(u,b,d,J);g=c[u>>2]|0;j=c[u+4>>2]|0;i=+h[u+8>>3];u=u+16|0;c[G>>2]=c[u>>2];c[G+4>>2]=c[u+4>>2];c[G+8>>2]=c[u+8>>2];c[G+12>>2]=c[u+12>>2];if(!g){c[a>>2]=0;c[a+4>>2]=j;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break}if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];f=j;e=i;}else g=m;j=(c[J+28>>2]|0)==0;do if(!(c[J+24>>2]|0))if(j){if(c[J+32>>2]|0){w=38;break}if(!((c[J+12>>2]|0)==0&(c[J>>2]|0)==0))w=38;}else w=46;else if(j)w=38;else w=46;while(0);b:do if((w|0)==38)if(!(c[J+32>>2]|0)){h[B>>3]=+h[d>>3]-+h[z>>3];p=v+4|0;r=v+8|0;s=v+16|0;m=F;j=E;i=+h[I>>3];c:while(1){while(1){h[m>>3]=+h[j>>3]+i;if(!(+h[B>>3]<=+h[C>>3]+ +h[d>>3])){w=46;break b}mT(v,b,d,J);n=c[v>>2]|0;o=c[p>>2]|0;k=+h[r>>3];c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!n)break c;if(k>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=B;j=B;i=A;g=n;f=o;e=k;}c[a>>2]=0;c[a+4>>2]=o;h[a+8>>3]=k;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}else w=46;while(0);d:do if((w|0)==46)if((c[J+12>>2]|0)==0&(c[J>>2]|0)==0){h[B>>3]=+h[d>>3]-+h[z>>3];k=+h[E>>3];n=x+4|0;o=x+8|0;p=x+16|0;i=k;k=+h[I>>3]+k;while(1){h[F>>3]=k;if(!(k>=i-+h[D>>3]))break d;mT(x,b,d,J);j=c[x>>2]|0;m=c[n>>2]|0;i=+h[o>>3];c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!j)break;if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];g=j;f=m;e=i;}i=+h[E>>3];k=+h[F>>3]-K;}c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);i=+h[d>>3];k=+h[C>>3]+i;h[B>>3]=k;q=+h[D>>3];h[F>>3]=+h[E>>3]-q;j=c[J+4>>2]|0;do if(!(c[J+8>>2]|0)){m=c[J>>2]|0;if(!((j|0)==0&(m|0)==0)){w=59;break}if(c[J+20>>2]|0){j=0;m=0;w=59;break}if(c[J+32>>2]|0){j=0;m=0;w=59;}}else {m=c[J>>2]|0;w=59;}while(0);e:do if((w|0)==59){f:do if((j|0)==0&(m|0)==0){h[B>>3]=k;p=y+4|0;r=y+8|0;s=y+16|0;m=F;j=E;i=q;g:while(1){while(1){h[m>>3]=+h[j>>3]-i;i=+h[d>>3];if(!(+h[B>>3]>=i-+h[z>>3]))break f;mT(y,b,d,J);n=c[y>>2]|0;o=c[p>>2]|0;k=+h[r>>3];c[G>>2]=c[s>>2];c[G+4>>2]=c[s+4>>2];c[G+8>>2]=c[s+8>>2];c[G+12>>2]=c[s+12>>2];if(!n)break g;if(k>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];m=B;j=B;i=A;g=n;f=o;e=k;}c[a>>2]=0;c[a+4>>2]=o;h[a+8>>3]=k;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);if(c[J+20>>2]|0)break;if(c[J+32>>2]|0)break;h[B>>3]=+h[C>>3]+i;i=+h[E>>3];n=H+4|0;o=H+8|0;p=H+16|0;k=i;i=i-+h[D>>3];while(1){h[F>>3]=i;if(!(i<=+h[I>>3]+k))break e;mT(H,b,d,J);j=c[H>>2]|0;m=c[n>>2]|0;i=+h[o>>3];c[G>>2]=c[p>>2];c[G+4>>2]=c[p+4>>2];c[G+8>>2]=c[p+8>>2];c[G+12>>2]=c[p+12>>2];if(!j)break;if(i>2]=c[G>>2];c[L+4>>2]=c[G+4>>2];c[L+8>>2]=c[G+8>>2];c[L+12>>2]=c[G+12>>2];g=j;f=m;e=i;}k=+h[E>>3];i=+h[F>>3]+K;}c[a>>2]=0;c[a+4>>2]=m;h[a+8>>3]=i;a=a+16|0;c[a>>2]=c[G>>2];c[a+4>>2]=c[G+4>>2];c[a+8>>2]=c[G+8>>2];c[a+12>>2]=c[G+12>>2];break a}while(0);c[a>>2]=g;c[a+4>>2]=f;h[a+8>>3]=e;a=a+16|0;c[a>>2]=c[L>>2];c[a+4>>2]=c[L+4>>2];c[a+8>>2]=c[L+8>>2];c[a+12>>2]=c[L+12>>2];}while(0);l=M;return}function lT(a){a=a|0;VV(c[a+24>>2]|0)|0;U1(a);return}function mT(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,m=0,n=0.0,o=0,p=0,q=0,r=0.0,s=0,t=0;t=l;l=l+48|0;q=t+32|0;s=t+16|0;p=t;g=c[e+32>>2]|0;if(!g)qa(111533,111543,382,111562);o=g+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];o=d+4|0;m=0;g=0;while(1){if((m|0)>=(c[o>>2]|0))break;j=c[d>>2]|0;k=j+(m*40|0)|0;do if((k|0)!=(e|0)){if(+h[j+(m*40|0)+16>>3]>0.0?+h[j+(m*40|0)+24>>3]>0.0:0)break;g=g+((nT(e,k)|0)!=0&1)|0;}while(0);m=m+1|0;}oT(e,q);m=c[d+24>>2]|0;m=XV(m,c[m>>2]|0,q)|0;if(!m){c[b>>2]=g;h[b+8>>3]=0.0;s=b+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];}else {k=m;i=0.0;while(1){if(!k)break;j=c[(c[k+4>>2]|0)+16>>2]|0;if((j|0)!=(e|0)){pT(j,s);n=+qT(q,s);if(n>0.0){g=g+1|0;i=+rT(e,j,q,n,f)+i;}d=c[j+32>>2]|0;if(((d|0)!=0?(a[d+36>>0]|0)!=0:0)?(oT(j,s),r=+qT(q,s),r>0.0):0){g=g+1|0;i=+sT(e,j,q,r,f)+i;}}k=c[k>>2]|0;}SV(m);c[b>>2]=g;h[b+8>>3]=i;s=b+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];}l=t;return}function nT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0.0;a=c[a+32>>2]|0;if(+h[b+16>>3]==0.0?+h[b+24>>3]==0.0:0){if((((a|0)!=0?(d=+h[b>>3],e=+h[a+16>>3],d>e):0)?d<+h[a>>3]+e:0)?(f=+h[b+8>>3],g=+h[a+24>>3],f>g):0)a=f<+h[a+8>>3]+g&1;else a=0;return a|0}qa(111599,111543,219,111636);return 0}function oT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a+32>>2]|0;e=+h[a+16>>3];c[b>>2]=~~e;d=+h[a+24>>3];c[b+4>>2]=~~d;c[b+8>>2]=~~(+h[a>>3]+e);c[b+12>>2]=~~(+h[a+8>>3]+d);return}function pT(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;e=+h[a>>3];c[b>>2]=~~e;d=+h[a+8>>3];c[b+4>>2]=~~d;c[b+8>>2]=~~(+h[a+16>>3]+e);c[b+12>>2]=~~(+h[a+24>>3]+d);return}function qT(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=c[a+8>>2]|0;j=c[b>>2]|0;if((((i|0)>=(j|0)?(k=c[a>>2]|0,l=c[b+8>>2]|0,(k|0)<=(l|0)):0)?(e=c[a+12>>2]|0,f=c[b+4>>2]|0,(e|0)>=(f|0)):0)?(g=c[a+4>>2]|0,h=c[b+12>>2]|0,(g|0)<=(h|0)):0)d=(+(c[((e|0)<(h|0)?a:b)+12>>2]|0)-+(c[((g|0)>(f|0)?a:b)+4>>2]|0))*(+(c[((i|0)<(l|0)?a:b)+8>>2]|0)-+(c[((k|0)>(j|0)?a:b)>>2]|0));else d=0.0;return +d}function rT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;a=tT(a,b)|0;f=f+(((a|0)<0?5:a)<<2)|0;a=c[f>>2]|0;if(!a){c[f>>2]=b;g=e;}else {pT(a,i);g=+qT(d,i);g=g>e?g:0.0;a=c[f>>2]|0;if((c[a+32>>2]|0)!=0?(oT(a,i),h=+qT(d,i),h>e):0)g=h>g?h:g;if(!(g>0.0)){c[f>>2]=b;g=e;}}l=j;return +g}function sT(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;a=tT(a,b)|0;f=f+(((a|0)<0?5:a)<<2)|0;a=c[f>>2]|0;if(!a){c[f>>2]=b;g=e;}else {pT(a,i);g=+qT(d,i);g=g>e?g:0.0;a=c[f>>2]|0;if((c[a+32>>2]|0)!=0?(oT(a,i),h=+qT(d,i),h>e):0)g=h>g?h:g;if(!(g>0.0)){c[f>>2]=b;g=e;}}l=j;return +g}function tT(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=c[b+32>>2]|0;f=c[d+32>>2]|0;if((e|0)==(f|0))qa(111578,111543,276,111588);do if((a[e+36>>0]|0)!=0?(a[f+36>>0]|0)!=0:0){j=+h[b>>3];if(j==0.0?+h[b+8>>3]==0.0:0){e=-1;break}k=+h[d>>3];i=+h[d+8>>3];if(!(k==0.0&i==0.0)){g=+h[b+8>>3];if(ij?2:1;break}e=kg){if(e){e=6;break}e=k>j?8:7;break}if(!e)if(k>j)e=5;else e=-1;else e=3;}else e=-1;}else e=-1;while(0);return e|0}function uT(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;k=l;l=l+32|0;d=k+24|0;e=k+16|0;f=k;g=fT(a)|0;h=a+4|0;i=e+4|0;j=a+20|0;b=0;while(1){if((b|0)>=(c[h>>2]|0)){b=0;break}m=JK(32)|0;o=(c[a>>2]|0)+(b*40|0)|0;n=m+12|0;c[m+28>>2]=o;xT(f,o);c[n>>2]=c[f>>2];c[n+4>>2]=c[f+4>>2];c[n+8>>2]=c[f+8>>2];c[n+12>>2]=c[f+12>>2];n=c[n>>2]|0;c[e>>2]=(((c[m+20>>2]|0)-n|0)/2|0)+n;n=c[m+16>>2]|0;c[i>>2]=(((c[m+24>>2]|0)-n|0)/2|0)+n;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[m+8>>2]=yT(d,g)|0;n=c[j>>2]|0;if(!(nb[c[n>>2]&63](n,m,1)|0)){b=-1;break}else b=b+1|0;}l=k;return b|0}function vT(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;e=c[d>>2]|0;b=a+24|0;a=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!a)break;e=c[b>>2]|0;YV(e,a+12|0,c[a+28>>2]|0,e,0)|0;e=c[d>>2]|0;a=nb[c[e>>2]&63](e,a,8)|0;}return}function wT(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=a+20|0;f=Xz(c[e>>2]|0)|0;d=0;while(1){if(!(Xz(c[e>>2]|0)|0))break;g=c[e>>2]|0;a=c[(c[g+8>>2]|0)+4>>2]|0;if(!a){h=8;break}b=c[(c[g+4>>2]|0)+8>>2]|0;if((b|0)<0)a=c[a+8>>2]|0;else a=a+(0-b)|0;if(!a){h=8;break}nb[c[g>>2]&63](g,a,4096)|0;U1(a);d=d+1|0;}if((h|0)==8)qa(111649,111543,616,111652);if((f|0)==(d|0))return;else qa(111664,111543,623,111652);}function xT(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,l=0.0;d=c[b+32>>2]|0;if(!d){e=0.0;f=0.0;}else {e=+h[d>>3];f=+h[d+8>>3];}l=+h[b>>3];k=~~+A(+(l-e));g=+h[b+8>>3];j=~~+A(+(g-f));i=~~+N(+(l+e+ +h[b+16>>3]));if((i|0)==2147483647)qa(111676,111543,264,111703);d=~~+N(+(g+f+ +h[b+24>>3]));if((d|0)==2147483647)qa(111713,111543,266,111703);else {c[a>>2]=k;c[a+4>>2]=j;c[a+8>>2]=i;c[a+12>>2]=d;return}}function yT(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;f=0;e=c[a>>2]|0;d=c[a+4>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;i=e>>>a&1;b=d>>>a&1;g=b+-1|0;h=g&(e^d);g=g&0-i;f=i<<1|f<<2|i^b;b=a;e=h^e^g;d=h^d^g;}return f|0}function zT(b){b=b|0;var d=0,e=0,f=0,g=0;d=l2(b)|0;if(d>>>0>=(c[47365]|0)>>>0){d=d+11|0;c[47365]=d;d=MK(c[47366]|0,d)|0;c[47366]=d;if(!d)d=0;else e=4;}else {d=c[47366]|0;e=4;}if((e|0)==4){g=d;while(1){e=a[b>>0]|0;if(!(e<<24>>24))break;f=e&255;if(e3(f)|0)e=(d3(f)|0)&255;a[g>>0]=e;g=g+1|0;b=b+1|0;}a[g>>0]=0;}return d|0}function AT(b,e,f){b=b|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0;F=l;l=l+144|0;s=F+96|0;p=F+80|0;v=F+124|0;t=F+72|0;w=F+64|0;x=F+56|0;C=F+48|0;D=F+40|0;E=F+32|0;y=F+24|0;z=F+16|0;A=F+8|0;B=F;i=F+120|0;m=F+116|0;n=F+112|0;o=F+108|0;c[e+32>>2]=f;r=b;while(1)if((a[r>>0]|0)==32)r=r+1|0;else break;c[o>>2]=255;b=a[r>>0]|0;a:do if(b<<24>>24==35){c[p>>2]=i;c[p+4>>2]=m;c[p+8>>2]=n;c[p+12>>2]=o;if((b5(r,111755,p)|0)<=2){b=a[r>>0]|0;q=12;break}switch(f|0){case 0:{G=+((c[i>>2]|0)>>>0)*.00392156862745098;h[C>>3]=G;g=+((c[m>>2]|0)>>>0)*.00392156862745098;h[D>>3]=g;j=+((c[n>>2]|0)>>>0)*.00392156862745098;h[E>>3]=j;k=+((c[o>>2]|0)>>>0)*.00392156862745098;BT(G,g,j,t,w,x);h[e>>3]=+h[t>>3];h[e+8>>3]=+h[w>>3];h[e+16>>3]=+h[x>>3];h[e+24>>3]=k;b=0;break a}case 1:{a[e>>0]=c[i>>2];a[e+1>>0]=c[m>>2];a[e+2>>0]=c[n>>2];a[e+3>>0]=c[o>>2];b=0;break a}case 3:{j=+((c[i>>2]|0)>>>0)*.00392156862745098;h[C>>3]=j;k=+((c[m>>2]|0)>>>0)*.00392156862745098;h[D>>3]=k;G=+((c[n>>2]|0)>>>0)*.00392156862745098;h[E>>3]=G;CT(j,k,G,y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break a}case 2:{c[e>>2]=(((c[i>>2]|0)*65535|0)>>>0)/255|0;c[e+4>>2]=(((c[m>>2]|0)*65535|0)>>>0)/255|0;c[e+8>>2]=(((c[n>>2]|0)*65535|0)>>>0)/255|0;c[e+12>>2]=(((c[o>>2]|0)*65535|0)>>>0)/255|0;b=0;break a}case 4:{h[e>>3]=+((c[i>>2]|0)>>>0)*.00392156862745098;h[e+8>>3]=+((c[m>>2]|0)>>>0)*.00392156862745098;h[e+16>>3]=+((c[n>>2]|0)>>>0)*.00392156862745098;h[e+24>>3]=+((c[o>>2]|0)>>>0)*.00392156862745098;b=0;break a}default:{b=0;break a}}}else q=12;while(0);b:do if((q|0)==12){if(!(b<<24>>24!=46?((b&255)+-48|0)>>>0>=10:0)){b=l2(r)|0;if(b>>>0>=(c[47367]|0)>>>0){b=b+11|0;c[47367]=b;b=MK(c[47368]|0,b)|0;c[47368]=b;if(!b){b=-1;break}}else b=c[47368]|0;m=b;i=r;c:while(1){n=i+1|0;i=a[i>>0]|0;switch(i<<24>>24){case 0:break c;case 44:{i=32;break}default:{}}a[m>>0]=i;m=m+1|0;i=n;}a[m>>0]=0;c[s>>2]=t;c[s+4>>2]=w;c[s+8>>2]=x;if((b5(b,111769,s)|0)==3){k=+h[t>>3];k=k<1.0?k:1.0;k=k>0.0?k:0.0;h[t>>3]=k;j=+h[w>>3];j=j<1.0?j:1.0;j=j>0.0?j:0.0;h[w>>3]=j;g=+h[x>>3];g=g<1.0?g:1.0;g=g>0.0?g:0.0;h[x>>3]=g;switch(f|0){case 0:{h[e>>3]=k;h[e+8>>3]=j;h[e+16>>3]=g;h[e+24>>3]=1.0;b=0;break b}case 1:{DT(k,j,g,C,D,E);a[e>>0]=~~(+h[C>>3]*255.0);a[e+1>>0]=~~(+h[D>>3]*255.0);a[e+2>>0]=~~(+h[E>>3]*255.0);a[e+3>>0]=-1;b=0;break b}case 3:{DT(k,j,g,C,D,E);CT(+h[C>>3],+h[D>>3],+h[E>>3],y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break b}case 2:{DT(k,j,g,C,D,E);c[e>>2]=~~(+h[C>>3]*65535.0);c[e+4>>2]=~~(+h[D>>3]*65535.0);c[e+8>>2]=~~(+h[E>>3]*65535.0);c[e+12>>2]=65535;b=0;break b}case 4:{DT(k,j,g,C,D,E);h[e>>3]=+h[C>>3];h[e+8>>3]=+h[D>>3];h[e+16>>3]=+h[E>>3];h[e+24>>3]=1.0;b=0;break b}default:{b=0;break b}}}}i=ET(r)|0;c[v>>2]=i;if(!i)b=-1;else {b=c[47369]|0;if(!(((b|0)!=0?(u=c[b>>2]|0,(a[u>>0]|0)==(a[i>>0]|0)):0)?(s2(u,i)|0)==0:0)){b=u5(v,25948,2491,12,103)|0;c[47369]=b;if(!b)switch(f|0){case 0:{c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;h[e+24>>3]=1.0;b=1;break b}case 1:{a[e+2>>0]=0;a[e+1>>0]=0;a[e>>0]=0;a[e+3>>0]=-1;b=1;break b}case 3:{c[e>>2]=0;b=1;break b}case 2:{c[e+8>>2]=0;c[e+4>>2]=0;c[e>>2]=0;c[e+12>>2]=65535;b=1;break b}case 4:{c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;h[e+24>>3]=1.0;b=1;break b}default:{b=1;break b}}}switch(f|0){case 0:{h[e>>3]=+(d[b+4>>0]|0)*.00392156862745098;h[e+8>>3]=+(d[b+5>>0]|0)*.00392156862745098;h[e+16>>3]=+(d[b+6>>0]|0)*.00392156862745098;h[e+24>>3]=+(d[b+10>>0]|0)*.00392156862745098;b=0;break b}case 1:{a[e>>0]=a[b+7>>0]|0;a[e+1>>0]=a[b+8>>0]|0;a[e+2>>0]=a[b+9>>0]|0;a[e+3>>0]=a[b+10>>0]|0;b=0;break b}case 3:{j=+(d[b+7>>0]|0)*.00392156862745098;h[C>>3]=j;k=+(d[b+8>>0]|0)*.00392156862745098;h[D>>3]=k;G=+(d[b+9>>0]|0)*.00392156862745098;h[E>>3]=G;CT(j,k,G,y,z,A,B);a[e>>0]=~~+h[y>>3]*255;a[e+1>>0]=~~+h[z>>3]*255;a[e+2>>0]=~~+h[A>>3]*255;a[e+3>>0]=~~+h[B>>3]*255;b=0;break b}case 2:{c[e>>2]=(d[b+7>>0]|0)*257;c[e+4>>2]=(d[b+8>>0]|0)*257;c[e+8>>2]=(d[b+9>>0]|0)*257;c[e+12>>2]=(d[b+10>>0]|0)*257;b=0;break b}case 4:{h[e>>3]=+(d[b+7>>0]|0)*.00392156862745098;h[e+8>>3]=+(d[b+8>>0]|0)*.00392156862745098;h[e+16>>3]=+(d[b+9>>0]|0)*.00392156862745098;h[e+24>>3]=+(d[b+10>>0]|0)*.00392156862745098;b=0;break b}default:{b=0;break b}}}}while(0);l=F;return b|0}function BT(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;i=bc?b:c;m=ma?a:i);g=i/m;if(m>0.0)if(g>0.0){j=(m-a)/i;k=(m-b)/i;l=(m-c)/i;do if(!(m==a)){if(m==b){a=j+2.0-l;break}if(m==c)a=k+4.0-j;else a=0.0;}else a=(b-c)/i;while(0);a=a*60.0;if(a<0.0)a=a+360.0;}else a=0.0;else {g=0.0;a=0.0;}h[d>>3]=a*.002777777777777778;h[f>>3]=m;h[e>>3]=g;return}function CT(a,b,c,d,e,f,g){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;g=g|0;h[d>>3]=1.0-a;h[e>>3]=1.0-b;h[f>>3]=1.0-c;b=+h[d>>3];c=+h[e>>3];c=b>3]=c;b=+h[f>>3];c=b>3]=c;h[d>>3]=+h[d>>3]-c;h[e>>3]=+h[e>>3]-+h[g>>3];h[f>>3]=+h[f>>3]-+h[g>>3];return}function DT(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0.0,k=0,l=0;a:do if(!(b<=0.0)){i=!(a>=1.0)?a*6.0:0.0;l=~~i;i=i-+(l|0);a=(1.0-b)*c;j=(1.0-i*b)*c;b=(1.0-(1.0-i)*b)*c;switch(l|0){case 0:{g=a;i=b;a=c;k=8;break a}case 1:{g=a;i=c;a=j;k=8;break a}case 2:{g=b;i=c;k=8;break a}case 3:{g=c;i=j;k=8;break a}case 4:{g=c;i=a;a=b;k=8;break a}case 5:{g=j;i=a;a=c;k=8;break a}default:break a}}else {g=c;i=c;a=c;k=8;}while(0);if((k|0)==8){h[d>>3]=a;h[e>>3]=i;h[f>>3]=g;}return}function ET(b){b=b|0;var d=0,e=0;d=a[b>>0]|0;if(((d<<24>>24!=98?(e=b+1|0,!(d<<24>>24==119|(Q2(e,137266,4)|0)==0)):0)?!(d<<24>>24==108|(Q2(e,137271,4)|0)==0):0)?(Q2(e,137276,8)|0)!=0:0){do if(d<<24>>24==47){d=R2(e,47)|0;if(!d)b=e;else {if((a[e>>0]|0)!=47){e=(j3(137285,e,4)|0)==0;b=e?d+1|0:b;break}d=c[47370]|0;if((d|0?a[d>>0]|0:0)?j3(137285,d,3)|0:0){b=GT(d,b+2|0)|0;break}b=b+2|0;}}else {d=c[47370]|0;if(((d|0)!=0?(a[d>>0]|0)!=0:0)?(j3(137285,d,3)|0)!=0:0)b=GT(d,b)|0;}while(0);b=zT(b)|0;}return b|0}function FT(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function GT(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;g=l2(a)|0;g=(l2(b)|0)+g|0;d=g+13|0;if((g+3|0)>>>0<(c[47371]|0)>>>0)d=c[47372]|0;else {c[47371]=d;d=MK(c[47372]|0,d)|0;c[47372]=d;}c[e>>2]=a;c[e+4>>2]=b;m4(d,137290,e)|0;l=f;return c[47372]|0}function HT(a){a=a|0;c[47370]=a;return}function IT(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;var f=0,g=0;f=l;l=l+208|0;g=f;JT(g,+h[a>>3],+h[a+8>>3],b,c,d,e);a=KT(g)|0;l=f;return a|0}function JT(a,b,c,d,e,f,g){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;g=+g;var i=0,j=0;h[a>>3]=b;h[a+8>>3]=c;j=a+16|0;h[j>>3]=d;i=a+24|0;h[i>>3]=e;h[a+32>>3]=0.0;c=+K(+(+F(+f)/e),+(+E(+f)/d));h[a+56>>3]=c;e=+K(+(+F(+g)/e),+(+E(+g)/d));h[a+40>>3]=1.0;h[a+48>>3]=0.0;e=e-+A(+((e-c)*.15915494309189535))*6.283185307179586;h[a+64>>3]=g-f>3.141592653589793&e-c<3.141592653589793?e+6.283185307179586:e;QT(a);RT(a);ST(a);g=+h[j>>3];g=(g-+h[i>>3])/g;h[a+168>>3]=g;h[a+176>>3]=(2.0-g)*g;g=1.0-g;h[a+184>>3]=g;h[a+192>>3]=g*g;return}function KT(a){a=a|0;var b=0,c=0.0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;q=JK(8)|0;f=+h[a+56>>3];e=+h[a+64>>3]-f;p=1;b=0;while(1){o=e/+(p|0);if(!(b<<24>>24==0&(p|0)<1024))break;a:do if(!(o<=1.5707963267948966))b=0;else {c=f;d=0;b=1;while(1){if(!(b<<24>>24!=0&(d|0)<(p|0)))break a;n=c+o;b=+LT(a,c,n)<=1.0e-05&1;c=n;d=d+1|0;}}while(0);p=p<<1;}i=+E(+f);u=+F(+f);d=a+16|0;s=+h[d>>3];v=s*i;j=a+24|0;c=+h[j>>3];g=c*u;i=c*i;c=+h[a>>3];k=a+40|0;t=+h[k>>3];l=a+48|0;r=+h[l>>3];e=t*v+c-r*g;m=a+8|0;n=+h[m>>3];g=r*v+t*g+n;s=-(u*s);MT(q,c,n);NT(q,e,g);n=+G(+(o*.5));n=+F(+o)*.3333333333333333*(+C(+(n*n*3.0+4.0))+-1.0);c=f;f=g;g=r*s+t*i;i=t*s-r*i;b=0;while(1){if((b|0)>=(p|0))break;r=c+o;u=+E(+r);v=+F(+r);x=+h[d>>3];z=x*u;w=+h[j>>3];t=w*v;u=w*u;w=+h[k>>3];y=+h[l>>3];s=w*z+ +h[a>>3]-y*t;t=y*z+w*t+ +h[m>>3];x=-(v*x);v=w*x-y*u;u=y*x+w*u;OT(q,e+i*n,f+g*n,s-v*n,t-u*n,s,t);c=r;e=s;f=t;g=u;i=v;b=b+1|0;}PT(q);return q|0}function LT(a,b,c){a=a|0;b=+b;c=+c;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;d=c+b;i=+h[a+16>>3];e=+h[a+24>>3]/i;g=+E(+d);f=+E(+(d*2.0));d=+E(+(d*3.0));a=e<.25?10392:10648;return +(((e*.001+4.98)*e+.207)/(e+.0067)*i*+L(+(((+h[a+32>>3]*e+ +h[a+40>>3])*e+ +h[a+48>>3])/(+h[a+56>>3]+e)*g+((+h[a>>3]*e+ +h[a+8>>3])*e+ +h[a+16>>3])/(+h[a+24>>3]+e)+((+h[a+64>>3]*e+ +h[a+72>>3])*e+ +h[a+80>>3])/(+h[a+88>>3]+e)*f+((+h[a+96>>3]*e+ +h[a+104>>3])*e+ +h[a+112>>3])/(+h[a+120>>3]+e)*d+(((+h[a+160>>3]*e+ +h[a+168>>3])*e+ +h[a+176>>3])/(+h[a+184>>3]+e)*g+((+h[a+128>>3]*e+ +h[a+136>>3])*e+ +h[a+144>>3])/(+h[a+152>>3]+e)+((+h[a+192>>3]*e+ +h[a+200>>3])*e+ +h[a+208>>3])/(+h[a+216>>3]+e)*f+((+h[a+224>>3]*e+ +h[a+232>>3])*e+ +h[a+240>>3])/(+h[a+248>>3]+e)*d)*(c-b))))}function MT(a,b,d){a=a|0;b=+b;d=+d;var e=0;c[47373]=100;e=JK(1600)|0;c[a>>2]=e;h[e>>3]=b;h[e+8>>3]=d;c[a+4>>2]=1;return}function NT(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;f=c[a>>2]|0;e=(c[a+4>>2]|0)+-1|0;OT(a,+h[f+(e<<4)>>3],+h[f+(e<<4)+8>>3],b,d,b,d);return}function OT(a,b,d,e,f,g,i){a=a|0;b=+b;d=+d;e=+e;f=+f;g=+g;i=+i;var j=0,k=0,l=0,m=0;l=a+4|0;j=c[l>>2]|0;k=c[47373]|0;if((j+3|0)<(k|0))a=c[a>>2]|0;else {c[47373]=k<<1;j=W1(c[a>>2]|0,k<<5)|0;c[a>>2]=j;a=j;j=c[l>>2]|0;}h[a+(j<<4)>>3]=b;m=j+1|0;h[a+(j<<4)+8>>3]=d;h[a+(m<<4)>>3]=e;k=j+2|0;h[a+(m<<4)+8>>3]=f;h[a+(k<<4)>>3]=g;c[l>>2]=j+3;h[a+(k<<4)+8>>3]=i;return}function PT(a){a=a|0;var b=0;b=c[a>>2]|0;NT(a,+h[b>>3],+h[b+8>>3]);c[a>>2]=W1(c[a>>2]|0,c[a+4>>2]<<4)|0;c[47373]=0;return}function QT(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0;d=+h[a+16>>3];b=+h[a+24>>3];b=+C(+(d*d-b*b));d=b*+h[a+40>>3];b=b*+h[a+48>>3];e=+h[a>>3];h[a+104>>3]=e-d;c=+h[a+8>>3];h[a+112>>3]=c-b;h[a+120>>3]=e+d;h[a+128>>3]=c+b;return}function RT(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0;d=+h[a+16>>3];i=+h[a+56>>3];j=+E(+i)*d;b=+h[a+24>>3];i=+F(+i)*b;g=+h[a+64>>3];d=+E(+g)*d;b=+F(+g)*b;g=+h[a>>3];c=+h[a+40>>3];e=+h[a+48>>3];h[a+72>>3]=c*j+g-e*i;f=+h[a+8>>3];h[a+80>>3]=e*j+f+c*i;h[a+88>>3]=g+c*d-e*b;h[a+96>>3]=f+e*d+c*b;return}function ST(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0;k=+h[a+24>>3];l=+h[a+16>>3];e=k/l;m=+h[a+48>>3];n=+B(+m)<.1;j=+h[a+40>>3];do if(n){b=m/j;c=+J(+(b*e));d=-c;if(j<0.0){b=+J(+(b/e));e=d;d=3.141592653589793-c;c=4.71238898038469-b;b=1.5707963267948966-b;break}else {b=+J(+(b/e));e=-3.141592653589793-c;c=1.5707963267948966-b;b=-1.5707963267948966-b;break}}else {b=j/m;c=+J(+(b/e));d=c+1.5707963267948966;if(m<0.0){b=+J(+(b*e));e=c+-1.5707963267948966;c=b+3.141592653589793;break}else {b=+J(+(b*e));e=d;d=c+4.71238898038469;c=b;b=b+-3.141592653589793;break}}while(0);g=+h[a+56>>3];e=e-+A(+((e-g)*.15915494309189535))*6.283185307179586;b=b-+A(+((b-g)*.15915494309189535))*6.283185307179586;f=d-+A(+((d-g)*.15915494309189535))*6.283185307179586;g=c-+A(+((c-g)*.15915494309189535))*6.283185307179586;i=+h[a+64>>3];if(!(e<=i)){e=+h[a+72>>3];c=+h[a+88>>3];c=e>3]-k*+F(+e)*m;h[a+136>>3]=c;if(!(b<=i)){e=+h[a+80>>3];d=+h[a+96>>3];d=e>3]+ +F(+b)*k*j;h[a+144>>3]=d;if(!(f<=i)){f=+h[a+72>>3];b=+h[a+88>>3];b=f>b?f:b;}else b=+E(+f)*l*j+ +h[a>>3]-k*+F(+f)*m;h[a+152>>3]=b-c;if(!(g<=i)){m=+h[a+80>>3];b=+h[a+96>>3];b=m>b?m:b;}else b=+E(+g)*l*m+ +h[a+8>>3]+ +F(+g)*k*j;h[a+160>>3]=b-d;return}function TT(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+80|0;m=n;UT(b);k=+h[e+56>>3];g=+h[e+64>>3];switch(a[e+80>>0]|0){case 116:{g=(+h[e+48>>3]-+VT(d))*.5+g;f=4;break}case 98:{g=g-(+h[e+48>>3]-+VT(d))*.5;f=4;break}default:{}}if((f|0)==4)g=g+-1.0;h[m>>3]=k;h[m+8>>3]=g;c[m+20>>2]=c[e+8>>2];c[m+16>>2]=c[e+4>>2];h[m+32>>3]=+h[e+16>>3];j=b+16|0;f=QA(c[(c[j>>2]|0)+8>>2]|0,137297)|0;e=m+56|0;c[e>>2]=f;i=m+60|0;c[i>>2]=c[(c[j>>2]|0)+212>>2];j=m+64|0;a[j>>0]=0;if(!((f|0)!=0?(a[f>>0]|0)!=0:0))c[e>>2]=137308;if((a[d+4>>0]|0)==1){e=c[d>>2]|0;lS(b,c[(c[b>>2]|0)+336>>2]|0);f=c[e+24>>2]|0;if(!f)hS(b,137314);else hS(b,f);XT(b,e,m);if(a[j>>0]|0)U1(c[i>>2]|0);}else WT(b,c[d>>2]|0,m);YT(b);l=n;return}function UT(a){a=a|0;var d=0,e=0,f=0;d=aI(a)|0;e=c[d>>2]|0;a=c[e+4>>2]|0;c[d+4>>2]=a;c[d+12>>2]=c[e+12>>2];switch(a|0){case 2:{a=e+8|0;f=6;break}case 0:{a=e+8|0;f=6;break}case 1:{a=e+8|0;f=6;break}case 3:{a=e+8|0;f=6;break}default:{}}if((f|0)==6)c[d+8>>2]=c[a>>2];c[d+208>>2]=c[e+208>>2];c[d+228>>2]=c[e+228>>2];c[d+244>>2]=c[e+244>>2];f=d+260|0;b[f>>1]=b[f>>1]&-2|b[e+260>>1]&1;return}function VT(b){b=b|0;var d=0.0,e=0,f=0;switch(a[b+4>>0]|0){case 1:{e=c[b>>2]|0;b=e+72|0;e=e+56|0;f=5;break}case 3:{e=c[b>>2]|0;b=e+24|0;e=e+8|0;f=5;break}case 2:{e=c[b>>2]|0;b=e+32|0;e=e+16|0;f=5;break}default:d=0.0;}if((f|0)==5)d=+h[b>>3]-+h[e>>3];return +d}function WT(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;n=l;l=l+96|0;j=n+64|0;i=n+32|0;g=n+16|0;k=n;m=b[e+4>>1]|0;if(m<<16>>16>=1){r=e+8|0;p=+h[e+24>>3];o=+h[r>>3];h[k>>3]=(o+p)*.5+ +h[f>>3];h[k+8>>3]=(+h[e+16>>3]+ +h[e+32>>3])*.5+ +h[f+8>>3];q=c[e>>2]|0;s=f+16|0;f=a[e+6>>0]|0;c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[i+16>>2]=c[s+16>>2];c[i+20>>2]=c[s+20>>2];c[i+24>>2]=c[s+24>>2];c[i+28>>2]=c[s+28>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];c[j+16>>2]=c[r+16>>2];c[j+20>>2]=c[r+20>>2];c[j+24>>2]=c[r+24>>2];c[j+28>>2]=c[r+28>>2];iU(d,m<<16>>16,q,g,(p-o)*.5,i,j,f);}l=n;return}function XT(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+176|0;t=y+96|0;v=y+64|0;w=y+136|0;p=y;q=y+128|0;r=f+48|0;c[v>>2]=c[r>>2];c[v+4>>2]=c[r+4>>2];c[v+8>>2]=c[r+8>>2];c[v+12>>2]=c[r+12>>2];c[v+16>>2]=c[r+16>>2];c[v+20>>2]=c[r+20>>2];c[v+24>>2]=c[r+24>>2];c[v+28>>2]=c[r+28>>2];m=+h[g>>3];n=+h[g+8>>3];r=f+84|0;i=c[r>>2]|0;if(!(c[f>>2]|0))x=(c[f+8>>2]|0)!=0;else x=1;u=f+108|0;j=c[u>>2]|0;if(j|0)ZT(g,j,186544);h[v>>3]=+h[v>>3]+m;s=v+16|0;h[s>>3]=+h[s>>3]+m;s=v+8|0;h[s>>3]=+h[s>>3]+n;s=v+24|0;h[s>>3]=+h[s>>3]+n;if(x?(c[e+152>>2]&4|0)==0:0){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];s=_T(e,g,f,t,w)|0;}else s=0;o=f+42|0;j=b[o>>1]|0;if(!(j&32)){k=c[f+20>>2]|0;if(k){j=$T(e,k,c[f+28>>2]|0,j&65535,q)|0;if(!(b[o>>1]&4)){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];oS(e,t,j);}else {o=d[f+33>>0]|0;c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];TM(e,aU(p,t,o)|0,4,4,j);}U1(c[q>>2]|0);}while(1){j=c[i>>2]|0;if(!j)break;bU(e,j,g);i=i+4|0;}i=c[r>>2]|0;uS(e,1.0);j=f+24|0;while(1){k=i+4|0;i=c[i>>2]|0;if(!i)break;if(!(a[i+100>>0]|0)){i=k;continue}cU(e,i,g,c[j>>2]|0,c[k>>2]|0);i=k;}if(a[f+33>>0]|0){c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];c[t+16>>2]=c[v+16>>2];c[t+20>>2]=c[v+20>>2];c[t+24>>2]=c[v+24>>2];c[t+28>>2]=c[v+28>>2];dU(e,f,t);}}if(s|0)eU(e,w);if((x?c[e+152>>2]&4|0:0)?(c[t>>2]=c[v>>2],c[t+4>>2]=c[v+4>>2],c[t+8>>2]=c[v+8>>2],c[t+12>>2]=c[v+12>>2],c[t+16>>2]=c[v+16>>2],c[t+20>>2]=c[v+20>>2],c[t+24>>2]=c[v+24>>2],c[t+28>>2]=c[v+28>>2],_T(e,g,f,t,w)|0):0)eU(e,w);if(c[u>>2]|0)fU(g,186544);l=y;return}function YT(a){a=a|0;var b=0;b=c[a+16>>2]|0;c[b+208>>2]=0;c[b+228>>2]=0;c[b+244>>2]=0;c[b+212>>2]=0;bI(a);return}function ZT(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0;i=a+16|0;f=c[i>>2]|0;if(f|0){if(!(c[b>>2]|0)){f=0;g=d;}else {c[d>>2]=f;f=c[b>>2]|0;g=i;}c[g>>2]=f;}f=c[a+20>>2]|0;if(f|0){g=b+4|0;if(!(c[g>>2]|0)){f=0;g=d;}else {c[d+4>>2]=f;f=c[g>>2]|0;g=i;}c[g+4>>2]=f;}e=+h[a+32>>3];if(e>=0.0){f=b+16|0;if(!(+h[f>>3]>=0.0))e=-1.0;else {h[d+16>>3]=e;e=+h[f>>3];d=i;}h[d+16>>3]=e;}return}function _T(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+224|0;n=u+8|0;k=u;t=u+40|0;j=u+184|0;i=u+56|0;m=c[d+16>>2]|0;o=m+208|0;c[h>>2]=c[o>>2];p=m+228|0;c[h+4>>2]=c[p>>2];q=m+244|0;c[h+8>>2]=c[q>>2];r=m+212|0;c[h+12>>2]=c[r>>2];s=m+260|0;a[h+16>>0]=(b[s>>1]<<15&65535)<<16>>16>>15;h=c[f+16>>2]|0;if((h|0)!=0?(a[h>>0]|0)!=0:0)i=0;else {kA(t,128,i);i=e+60|0;h=c[i>>2]|0;if(!h){h=D4(dI(d,c[m+8>>2]|0,t)|0)|0;c[i>>2]=h;a[e+64>>0]=1;}nA(t,h)|0;i=c[47374]|0;c[47374]=i+1;c[k>>2]=i;m4(j,137391,k)|0;nA(t,j)|0;i=t+4|0;h=c[i>>2]|0;if(h>>>0>=(c[t+8>>2]|0)>>>0){lA(t,1)|0;h=c[i>>2]|0;}a[h>>0]=0;h=c[t>>2]|0;c[i>>2]=h;i=1;}h=cI(d,0,c[f>>2]|0,c[f+12>>2]|0,c[f+8>>2]|0,h,c[m+8>>2]|0)|0;if(i)oA(t);do if(h|0){if((c[o>>2]|0)==0?(b[s>>1]&1)==0:0)break;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];c[n+16>>2]=c[g+16>>2];c[n+20>>2]=c[g+20>>2];c[n+24>>2]=c[g+24>>2];c[n+28>>2]=c[g+28>>2];kI(d,n);cS(d,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0);}while(0);l=u;return h|0}function $T(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0,j=0;j=l;l=l+16|0;i=j;if(!((JJ(b,f,i)|0)<<24>>24)){jS(a,b);b=1;}else {jS(a,c[f>>2]|0);b=c[f+4>>2]|0;h=+g[i>>2];if(!b)kS(a,137314,d,h);else kS(a,b,d,h);b=e>>>1&1|2;}hS(a,137379);l=j;return b|0}function aU(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];e=a+32|0;b=b+16|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];if((d|0)>1){j=+(d|0)*.5;i=+h[a>>3]+j;h[a>>3]=i;d=a+8|0;g=+h[d>>3]+j;h[d>>3]=g;f=+h[e>>3]-j;h[e>>3]=f;e=a+40|0;j=+h[e>>3]-j;h[e>>3]=j;}else {f=+h[e>>3];g=+h[a+8>>3];i=+h[a>>3];j=+h[a+40>>3];}h[a+16>>3]=f;h[a+24>>3]=g;h[a+48>>3]=i;h[a+56>>3]=j;return a|0}function bU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+176|0;r=v+96|0;s=v+136|0;t=v+64|0;p=v;q=v+128|0;u=f+48|0;c[t>>2]=c[u>>2];c[t+4>>2]=c[u+4>>2];c[t+8>>2]=c[u+8>>2];c[t+12>>2]=c[u+12>>2];c[t+16>>2]=c[u+16>>2];c[t+20>>2]=c[u+20>>2];c[t+24>>2]=c[u+24>>2];c[t+28>>2]=c[u+28>>2];j=+h[g>>3];k=+h[g+8>>3];if(!(c[f>>2]|0))u=(c[f+8>>2]|0)!=0;else u=1;h[t>>3]=+h[t>>3]+j;o=t+16|0;h[o>>3]=+h[o>>3]+j;o=t+8|0;h[o>>3]=+h[o>>3]+k;o=t+24|0;h[o>>3]=+h[o>>3]+k;if(u?(c[e+152>>2]&4|0)==0:0){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];o=_T(e,g,f,r,s)|0;}else o=0;n=f+42|0;i=b[n>>1]|0;a:do if(!(i&32)){m=c[f+20>>2]|0;if(m|0){i=$T(e,m,c[f+28>>2]|0,i&65535,q)|0;if(!(b[n>>1]&4)){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];oS(e,r,i);}else {n=d[f+33>>0]|0;c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];TM(e,aU(p,r,n)|0,4,4,i);}U1(c[q>>2]|0);}if(a[f+33>>0]|0){c[r>>2]=c[t>>2];c[r+4>>2]=c[t+4>>2];c[r+8>>2]=c[t+8>>2];c[r+12>>2]=c[t+12>>2];c[r+16>>2]=c[t+16>>2];c[r+20>>2]=c[t+20>>2];c[r+24>>2]=c[t+24>>2];c[r+28>>2]=c[t+28>>2];dU(e,f,r);}i=f+88|0;switch(a[f+92>>0]|0){case 1:{XT(e,c[i>>2]|0,g);break a}case 3:{hU(e,c[i>>2]|0,g);break a}default:{WT(e,c[i>>2]|0,g);break a}}}while(0);if(o|0)eU(e,s);if((u?c[e+152>>2]&4|0:0)?(c[r>>2]=c[t>>2],c[r+4>>2]=c[t+4>>2],c[r+8>>2]=c[t+8>>2],c[r+12>>2]=c[t+12>>2],c[r+16>>2]=c[t+16>>2],c[r+20>>2]=c[t+20>>2],c[r+24>>2]=c[t+24>>2],c[r+28>>2]=c[t+28>>2],_T(e,g,f,r,s)|0):0)eU(e,s);l=v;return}function cU(f,g,i,j,k){f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0.0,n=0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0;A=l;l=l+32|0;y=A+16|0;z=A;r=+h[i>>3];x=+h[i+8>>3];q=(j|0)==0?137314:j;jS(f,q);hS(f,q);t=+h[g+48>>3];o=+h[g+56>>3];u=+h[g+64>>3];p=+h[g+72>>3];s=t+r;r=u+r;x=o+x;q=g+100|0;i=a[q>>0]|0;if((i&1)!=0?(n=c[g+96>>2]|0,((e[g+80>>1]|0)+(e[g+84>>1]|0)|0)<(c[n+104>>2]|0)):0){i=b[g+86>>1]|0;do if(i<<16>>16)if(((e[g+82>>1]|0)+(i&65535)|0)==(c[n+100>>2]|0)){B=a[n+32>>0]|0;C=(B<<24>>24)/2|0;j=(C<<24>>24)+(d[n+33>>0]|0)|0;i=j;j=j&255;m=x-+(C<<24>>24);n=B;break}else {n=a[n+32>>0]|0;i=0;j=((n<<24>>24)/2|0)<<24>>24;m=x;break}else {C=a[n+32>>0]|0;j=((C<<24>>24)/2|0)<<24>>24;i=j+(d[n+33>>0]|0)|0;m=x;n=C;}while(0);h[z+8>>3]=m-+(j|0);h[z>>3]=r+ +(((n<<24>>24)/2|0)<<24>>24);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];gU(f,y,0.0,p-o+ +(i&255|0)+ +(n<<24>>24));i=a[q>>0]|0;}if(i&2?(v=b[g+86>>1]|0,w=c[g+96>>2]|0,((e[g+82>>1]|0)+(v&65535)|0)<(c[w+100>>2]|0)):0){i=b[g+84>>1]|0;do if(!(i<<16>>16)){i=a[w+32>>0]|0;C=(i<<24>>24)/2|0;n=(C<<24>>24)+(d[w+33>>0]|0)|0;j=n&255;n=n&255;m=+(C<<24>>24);h[z>>3]=s-m-+(n|0);if((c[w+104>>2]|0)==(e[g+80>>1]|0)){j=n<<1&255;break}if((k|0)!=0?(b[k+86>>1]|0)!=v<<16>>16:0)j=~~(+(j&255)-u+ +h[w+64>>3]-m)&255;}else {if(((e[g+80>>1]|0)+(i&65535)|0)==(c[w+104>>2]|0)){i=a[w+32>>0]|0;C=(i<<24>>24)/2|0;j=(C&255)+(d[w+33>>0]|0)&255;h[z>>3]=s-+(C<<24>>24);break}i=a[w+32>>0]|0;m=+(((i<<24>>24)/2|0)<<24>>24);h[z>>3]=s-m;if((k|0)!=0?(b[k+86>>1]|0)!=v<<16>>16:0)j=~~(+h[w+64>>3]-u-m)&255;else j=0;}while(0);h[z+8>>3]=x-+(((i<<24>>24)/2|0)<<24>>24);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];gU(f,y,u-t+ +(j&255)+ +(i<<24>>24),0.0);}l=A;return}function dU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0;p=l;l=l+160|0;o=p+112|0;n=p;j=p+144|0;m=c[f+24>>2]|0;hS(e,(m|0)==0?137314:m);m=f+42|0;i=b[m>>1]|0;if(!(i&384))lS(e,c[(c[e>>2]|0)+336>>2]|0);else {c[j+4>>2]=0;c[j>>2]=0;i=i&65535;if(!(i&256)){if(i&128|0){i=137320;k=4;}}else {i=137327;k=4;}if((k|0)==4)c[j>>2]=i;lS(e,j);}k=f+33|0;uS(e,+(d[k>>0]|0));a:do if(!(b[m>>1]&4)){i=b[f+36>>1]&15360;if(!(i<<16>>16)){i=a[k>>0]|0;if((i&255)>1){q=+(i&255)*.5;h[g>>3]=+h[g>>3]+q;n=g+8|0;h[n>>3]=+h[n>>3]+q;n=g+16|0;h[n>>3]=+h[n>>3]-q;n=g+24|0;h[n>>3]=+h[n>>3]-q;};c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];oS(e,o,0);break}j=n+16|0;m=d[k>>0]|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];aU(j,o,m)|0;do switch(((i&65535)+-1024|0)>>>10&4194303|0){case 7:{qS(e,j,2);break a}case 3:{qS(e,n+32|0,2);break a}case 1:{qS(e,n+48|0,2);break a}case 0:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,2);break a}case 11:{qS(e,j,3);break a}case 5:{qS(e,n+32|0,3);break a}case 2:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];qS(e,n+48|0,3);break a}case 8:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,3);break a}case 13:{qS(e,j,4);break a}case 6:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];qS(e,n+32|0,4);break a}case 10:{g=n+80|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];g=n+96|0;o=n+32|0;c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];qS(e,n+48|0,4);break a}case 12:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,4);break a}case 9:{qS(e,j,2);qS(e,n+48|0,2);break a}case 4:{g=n+64|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];qS(e,n,2);qS(e,n+32|0,2);break a}default:break a}while(0)}else {m=d[k>>0]|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[o+16>>2]=c[g+16>>2];c[o+20>>2]=c[g+20>>2];c[o+24>>2]=c[g+24>>2];c[o+28>>2]=c[g+28>>2];TM(e,aU(n,o,m)|0,4,4,0);}while(0);l=p;return}function eU(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=c[d+16>>2]|0;f=h+208|0;if((c[f>>2]|0)==0?(b[h+260>>1]&1)==0:0)d=0;else {dS(d);d=c[f>>2]|0;}if((d|0)!=(c[e>>2]|0)){U1(d);c[f>>2]=c[e>>2];}d=h+228|0;f=c[d>>2]|0;g=e+4|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}d=h+244|0;f=c[d>>2]|0;g=e+8|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}d=h+212|0;f=c[d>>2]|0;g=e+12|0;if((f|0)!=(c[g>>2]|0)){U1(f);c[d>>2]=c[g>>2];}h=h+260|0;b[h>>1]=b[h>>1]&-2|a[e+16>>0]&1;return}function fU(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=c[b>>2]|0;if(e|0)c[a+16>>2]=e;e=c[b+4>>2]|0;if(e|0)c[a+20>>2]=e;d=+h[b+16>>3];if(d>=0.0)h[a+32>>3]=d;return}function gU(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0,i=0;f=l;l=l+64|0;g=f+32|0;i=f;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];h[i+16>>3]=+h[b>>3]+d;h[i+24>>3]=+h[b+8>>3]+e;c[g>>2]=c[i>>2];c[g+4>>2]=c[i+4>>2];c[g+8>>2]=c[i+8>>2];c[g+12>>2]=c[i+12>>2];c[g+16>>2]=c[i+16>>2];c[g+20>>2]=c[i+20>>2];c[g+24>>2]=c[i+24>>2];c[g+28>>2]=c[i+28>>2];oS(a,g,1);l=f;return}function hU(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0.0;i=l;l=l+64|0;g=i;k=+h[e>>3];n=k+ +h[d>>3];m=+h[e+8>>3];j=m+ +h[d+8>>3];k=k+ +h[d+16>>3];m=m+ +h[d+24>>3];h[g>>3]=k;h[g+8>>3]=m;h[g+32>>3]=n;h[g+40>>3]=j;h[g+16>>3]=n;h[g+24>>3]=m;h[g+48>>3]=k;h[g+56>>3]=j;f=c[d+36>>2]|0;if(!f)f=c[e+56>>2]|0;e=c[d+32>>2]|0;if(!e)qa(137334,137342,623,137354);if(!(a[e>>0]|0))qa(137368,137342,624,137354);else {sS(b,e,g,4,1,f);l=i;return}}function iU(d,e,f,g,i,j,k,m){d=d|0;e=e|0;f=f|0;g=g|0;i=+i;j=j|0;k=k|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0,K=0,L=0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0;R=l;l=l+128|0;K=R+104|0;O=R+48|0;P=R+16|0;L=R;J=L;c[J>>2]=0;c[J+4>>2]=0;M=+h[g>>3];N=M-i;I=M+i;J=L+8|0;h[J>>3]=(+h[k+24>>3]-+h[k+8>>3])*.5+ +h[g+8>>3];eS(d,1);D=P+16|0;E=P+4|0;F=P+24|0;G=O+4|0;H=O+16|0;s=(m|0)==0;t=O+24|0;u=O+8|0;v=O+32|0;w=O+40|0;x=O+48|0;y=j+16|0;z=j+4|0;A=P+8|0;q=0;while(1){if((q|0)>=(e|0))break;switch(a[f+(q*24|0)+6>>0]|0){case 108:{i=N;break}case 114:{i=I-+h[f+(q*24|0)+8>>3];break}default:i=M-+h[f+(q*24|0)+8>>3]*.5;}h[g>>3]=i;B=f+(q*24|0)+16|0;h[J>>3]=+h[J>>3]-+h[B>>3];C=f+(q*24|0)+4|0;p=c[f+(q*24|0)>>2]|0;r=0;while(1){if((r|0)>=(b[C>>1]|0))break;o=p+4|0;m=c[o>>2]|0;if(m){h[D>>3]=+h[(+h[m+16>>3]>0.0?m:j)+16>>3];c[P>>2]=c[((c[m>>2]|0)==0?j:m)>>2];k=c[((c[m+4>>2]|0)==0?j:m)+4>>2]|0;c[E>>2]=k;m=c[m+24>>2]&127;if(!m)Q=12;else m=c[F>>2]&-128|m;}else {h[D>>3]=+h[y>>3];c[P>>2]=c[j>>2];k=c[z>>2]|0;c[E>>2]=k;Q=12;}if((Q|0)==12){Q=0;m=c[F>>2]&-128;}c[F>>2]=m;hS(d,k);c[O>>2]=c[p>>2];c[G>>2]=P;h[H>>3]=+h[p+16>>3];if(s)n=1.0;else n=+h[p+24>>3];h[t>>3]=n;c[A>>2]=c[(c[o>>2]|0)+8>>2];c[u>>2]=c[p+8>>2];o=p+32|0;h[v>>3]=+h[o>>3];h[w>>3]=+h[B>>3];a[x>>0]=108;h[L>>3]=i;c[K>>2]=c[L>>2];c[K+4>>2]=c[L+4>>2];c[K+8>>2]=c[L+8>>2];c[K+12>>2]=c[L+12>>2];gS(d,K,O);n=+h[o>>3]+i;h[g>>3]=n;p=p+56|0;r=r+1|0;i=n;}q=q+1|0;}fS(d);l=R;return}function jU(a){a=a|0;U1(c[a>>2]|0);U1(c[a+4>>2]|0);U1(c[a+8>>2]|0);U1(c[a+16>>2]|0);U1(c[a+12>>2]|0);U1(c[a+20>>2]|0);U1(c[a+24>>2]|0);return}function kU(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(a|0){j=a+4|0;e=0;g=c[a>>2]|0;while(1){if((e|0)>=(b[j>>1]|0))break;k=g+4|0;d=0;f=c[g>>2]|0;while(1){if((d|0)>=(b[k>>1]|0))break;U1(c[f>>2]|0);h=c[f+8>>2]|0;if(h|0?(i=c[f+12>>2]|0,i|0):0)tb[i&127](h);d=d+1|0;f=f+56|0;}e=e+1|0;g=g+24|0;}d=c[a>>2]|0;if(d|0)U1(d);U1(a);}return}function lU(a){a=a|0;U1(c[a+32>>2]|0);U1(a);return}function mU(b,d){b=b|0;d=d|0;switch(a[b+4>>0]|0){case 1:{nU(c[b>>2]|0);break}case 3:{lU(c[b>>2]|0);break}default:kU(c[b>>2]|0);}if(d|0)U1(b);return}function nU(a){a=a|0;var b=0,d=0,e=0;e=a+84|0;if((c[a+100>>2]|0)==-1)Rz(c[e>>2]|0)|0;else {b=c[e>>2]|0;U1(c[a+92>>2]|0);U1(c[a+96>>2]|0);while(1){d=c[b>>2]|0;if(!d)break;oU(d);b=b+4|0;}U1(c[e>>2]|0);}jU(a);U1(a);return}function oU(a){a=a|0;mU(a+88|0,0);jU(a);U1(a);return}function pU(b,e,f){b=b|0;e=e|0;f=f|0;var g=0;b=c[(c[(c[b+16>>2]|0)+104>>2]|0)+72>>2]|0;if((a[b+4>>0]|0)!=2?(g=qU(c[b>>2]|0,e)|0,(g|0)!=0):0){c[f>>2]=d[g+35>>0];b=g+48|0;}else b=0;return b|0}function qU(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+4>>2]|0;if(!((d|0)!=0?(c3(d,b)|0)==0:0))e=3;a:do if((e|0)==3){d=c[a+84>>2]|0;while(1){a=c[d>>2]|0;if(!a){a=0;break a}a=rU(a,b)|0;if(!a)d=d+4|0;else break}}while(0);return a|0}function rU(b,d){b=b|0;d=d|0;var e=0;e=c[b+4>>2]|0;if(!((e|0)!=0?(c3(e,d)|0)==0:0))if((a[b+92>>0]|0)==1)b=qU(c[b+88>>2]|0,d)|0;else b=0;return b|0}function sU(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0}function tU(d){d=d|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=d+92|0;c[p>>2]=JK((c[d+100>>2]<<2)+4|0)|0;n=JK((c[d+104>>2]<<2)+4|0)|0;c[d+96>>2]=n;o=d+32|0;m=c[d+84>>2]|0;while(1){l=c[m>>2]|0;if(!l)break;d=b[l+82>>1]|0;f=+h[l+72>>3];if(d<<16>>16==1)i=~~f;else {i=~~((f-+(O((a[o>>0]|0)+-1|0,(d&65535)+-1|0)|0))/+(d&65535));i=(i|0)>1?i:1;}j=b[l+80>>1]|0;f=+h[l+64>>3];if(j<<16>>16==1)k=~~f;else {k=~~((f-+(O((a[o>>0]|0)+-1|0,(j&65535)+-1|0)|0))/+(j&65535));k=(k|0)>1?k:1;}q=e[l+86>>1]|0;g=(d&65535)+q|0;d=q;while(1){if((d|0)>=(g|0))break;q=(c[p>>2]|0)+(d<<2)|0;r=c[q>>2]|0;c[q>>2]=(r|0)>(i|0)?r:i;d=d+1|0;}d=e[l+84>>1]|0;g=(j&65535)+d|0;while(1){if((d|0)>=(g|0))break;r=n+(d<<2)|0;q=c[r>>2]|0;c[r>>2]=(q|0)>(k|0)?q:k;d=d+1|0;}m=m+4|0;}return}function uU(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;if(a>>>0<21)a=c[55840+(a<<2)>>2]|0;else {c[b>>2]=a;m4(194959,137395,b)|0;a=194959;}l=d;return a|0}function vU(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=a+104|0;l=a+100|0;j=d+16|0;f=0;g=0;while(1){if((f|0)>(c[k>>2]|0))break;i=tC(d,uU(f)|0,1)|0;TC(i,137447,304,1)|0;m=i+16|0;c[(c[m>>2]|0)+176>>2]=0;o=JK((c[l>>2]<<2)+4|0)|0;n=c[m>>2]|0;c[n+172>>2]=o;c[n+184>>2]=0;n=JK((c[l>>2]<<2)+4|0)|0;c[(c[m>>2]|0)+180>>2]=n;if(!g)c[(c[j>>2]|0)+192>>2]=i;else c[(c[g+16>>2]|0)+164>>2]=i;f=f+1|0;g=i;}j=b+16|0;f=0;g=0;while(1){if((f|0)>(c[l>>2]|0))break;i=tC(b,uU(f)|0,1)|0;TC(i,137447,304,1)|0;o=i+16|0;c[(c[o>>2]|0)+176>>2]=0;m=JK((c[k>>2]<<2)+4|0)|0;n=c[o>>2]|0;c[n+172>>2]=m;c[n+184>>2]=0;n=JK((c[k>>2]<<2)+4|0)|0;c[(c[o>>2]|0)+180>>2]=n;if(!g)c[(c[j>>2]|0)+192>>2]=i;else c[(c[g+16>>2]|0)+164>>2]=i;f=f+1|0;g=i;}f=c[a+84>>2]|0;while(1){g=c[f>>2]|0;if(!g)break;o=g+84|0;n=tC(d,uU(e[o>>1]|0)|0,0)|0;o=tC(d,uU((e[g+80>>1]|0)+(e[o>>1]|0)|0)|0,0)|0;wU(d,n,o,~~+h[g+64>>3]);o=g+86|0;n=tC(b,uU(e[o>>1]|0)|0,0)|0;o=tC(b,uU((e[g+82>>1]|0)+(e[o>>1]|0)|0)|0,0)|0;wU(b,n,o,~~+h[g+72>>3]);f=f+4|0;}xU(d);xU(b);return}function wU(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0;h=iB(a,d,f,0,0)|0;if(!h){i=iB(a,d,f,0,1)|0;TC(i,137460,176,1)|0;b[(c[i+16>>2]|0)+170>>1]=g;d=d+16|0;a=c[d>>2]|0;h=c[a+180>>2]|0;if(!h)a=KK((c[a+184>>2]<<2)+8|0)|0;else a=MK(h,(c[a+184>>2]<<2)+8|0)|0;g=c[d>>2]|0;c[g+180>>2]=a;g=g+184|0;h=c[g>>2]|0;c[g>>2]=h+1;c[a+(h<<2)>>2]=i;d=c[d>>2]|0;c[(c[d+180>>2]|0)+(c[d+184>>2]<<2)>>2]=0;d=f+16|0;a=c[d>>2]|0;h=c[a+172>>2]|0;if(!h)a=KK((c[a+176>>2]<<2)+8|0)|0;else a=MK(h,(c[a+176>>2]<<2)+8|0)|0;g=c[d>>2]|0;c[g+172>>2]=a;g=g+176|0;f=c[g>>2]|0;c[g>>2]=f+1;c[a+(f<<2)>>2]=i;i=c[d>>2]|0;c[(c[i+172>>2]|0)+(c[i+176>>2]<<2)>>2]=0;}else {i=(c[h+16>>2]|0)+170|0;f=e[i>>1]|0;b[i>>1]=(f|0)>(g|0)?f:g;}return}function xU(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[(c[a+16>>2]|0)+192>>2]|0;while(1){f=d+16|0;h=c[(c[f>>2]|0)+164>>2]|0;if(!h)break;if(iB(a,d,h,0,0)|0){d=h;continue}g=iB(a,d,h,0,1)|0;TC(g,137460,176,1)|0;b[(c[g+16>>2]|0)+170>>1]=0;d=c[f>>2]|0;e=c[d+180>>2]|0;if(!e)d=KK((c[d+184>>2]<<2)+8|0)|0;else d=MK(e,(c[d+184>>2]<<2)+8|0)|0;i=c[f>>2]|0;c[i+180>>2]=d;i=i+184|0;e=c[i>>2]|0;c[i>>2]=e+1;c[d+(e<<2)>>2]=g;f=c[f>>2]|0;c[(c[f+180>>2]|0)+(c[f+184>>2]<<2)>>2]=0;f=h+16|0;d=c[f>>2]|0;e=c[d+172>>2]|0;if(!e)d=KK((c[d+176>>2]<<2)+8|0)|0;else d=MK(e,(c[d+176>>2]<<2)+8|0)|0;e=c[f>>2]|0;c[e+172>>2]=d;e=e+176|0;i=c[e>>2]|0;c[e>>2]=i+1;c[d+(i<<2)>>2]=g;d=c[f>>2]|0;c[(c[d+172>>2]|0)+(c[d+176>>2]<<2)>>2]=0;d=h;}return}function yU(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=a+92|0;e=0;f=0;b=c[(c[(c[b+16>>2]|0)+192>>2]|0)+16>>2]|0;while(1){b=c[b+164>>2]|0;if(!b)break;b=c[b+16>>2]|0;h=b+232|0;c[(c[g>>2]|0)+(f<<2)>>2]=(c[h>>2]|0)-e;e=c[h>>2]|0;f=f+1|0;}a=a+96|0;e=0;f=0;b=c[(c[(c[d+16>>2]|0)+192>>2]|0)+16>>2]|0;while(1){b=c[b+164>>2]|0;if(!b)break;b=c[b+16>>2]|0;h=b+232|0;c[(c[a>>2]|0)+(f<<2)>>2]=(c[h>>2]|0)-e;e=c[h>>2]|0;f=f+1|0;}return}function zU(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h+4|0;d=h;c[d>>2]=c[4647];e=c[b+100>>2]|0;if((e|0)!=1?(f=b+104|0,(c[f>>2]|0)!=1):0){c[b+92>>2]=JK((e<<2)+4|0)|0;c[b+96>>2]=JK((c[f>>2]<<2)+4|0)|0;a[g>>0]=a[d>>0]|0;a[g+1>>0]=a[d+1>>0]|0;a[g+2>>0]=a[d+2>>0]|0;a[g+3>>0]=a[d+3>>0]|0;f=oB(137473,g,0)|0;a[g>>0]=a[d>>0]|0;a[g+1>>0]=a[d+1>>0]|0;a[g+2>>0]=a[d+2>>0]|0;a[g+3>>0]=a[d+3>>0]|0;g=oB(137478,g,0)|0;TC(f,137483,280,1)|0;TC(g,137483,280,1)|0;vU(b,f,g);uL(f,2,2147483647)|0;uL(g,2,2147483647)|0;yU(b,f,g);AU(f,g);}else tU(b);l=h;return}function AU(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=(c[b+16>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;f=d+16|0;d=c[f>>2]|0;e=c[d+172>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+180>>2]|0;if(e){U1(e);d=c[f>>2]|0;}d=d+164|0;}sB(a)|0;sB(b)|0;return}function BU(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0;p=l;l=l+272|0;n=p+104|0;o=p+136|0;j=p+72|0;k=p;g=p+144|0;c[k+48>>2]=b;switch(IC(b)|0){case 0:{e=c[b+60>>2]|0;break}case 1:{e=xC(b)|0;break}case 2:{e=xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;break}default:{}}i=k+52|0;c[i>>2]=e;m=c[e+60>>2]|0;h[k+32>>3]=+h[d+16>>3];c[k+16>>2]=c[d+4>>2];c[k+20>>2]=c[d+8>>2];c[k+40>>2]=0;f=LW(c[d>>2]|0,o,k)|0;if(!f){kA(n,128,g);a[d+82>>0]=0;e=D4(CU(b,n)|0)|0;c[d>>2]=e;if((c[d+12>>2]|0)==1)e=eQ(e)|0;else e=bQ(e,c[i>>2]|0)|0;U1(c[d>>2]|0);c[d>>2]=e;xK(c[(c[m+16>>2]|0)+144>>2]|0,d);oA(n);e=c[o>>2]|0;}else {e=f+4|0;if((a[e>>0]|0)==1){if((c[(c[f>>2]|0)+24>>2]|0)==0?DU(b)|0:0){i=D4(DU(b)|0)|0;c[(c[f>>2]|0)+24>>2]=i;}m=EU(m,c[f>>2]|0,0,k)|0;c[o>>2]=c[o>>2]|m;m=c[f>>2]|0;r=+h[m+64>>3]*.5;q=+h[m+72>>3]*.5;FU(j,-r,-q,r,q);m=c[f>>2]|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[n+16>>2]=c[j+16>>2];c[n+20>>2]=c[j+20>>2];c[n+24>>2]=c[j+24>>2];c[n+28>>2]=c[j+28>>2];GU(m,n,15);}else {HU(c[(c[m+16>>2]|0)+144>>2]|0,c[f>>2]|0,k);n=c[f>>2]|0;q=+h[n+24>>3]*.5;r=+h[n+32>>3]*.5;FU(j,-q,-r,q,r);n=(c[f>>2]|0)+8|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[n+16>>2]=c[j+16>>2];c[n+20>>2]=c[j+20>>2];c[n+24>>2]=c[j+24>>2];c[n+28>>2]=c[j+28>>2];}h[d+24>>3]=+h[j+16>>3]-+h[j>>3];h[d+32>>3]=+h[j+24>>3]-+h[j+8>>3];c[d+72>>2]=f;if((a[e>>0]|0)==1){U1(c[d>>2]|0);c[d>>2]=D4(141611)|0;}e=c[o>>2]|0;}l=p;return e|0}function CU(b,d){b=b|0;d=d|0;var e=0;a:do switch(IC(b)|0){case 0:{nA(d,KB(b)|0)|0;break}case 1:{nA(d,KB(b)|0)|0;break}case 2:{nA(d,KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)|0;e=b+-48|0;nA(d,KB(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)|0)|0;if(!(xB(xC(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)|0)|0)){nA(d,141747)|0;break a}else {nA(d,137738)|0;break a}}default:{}}while(0);e=d+4|0;b=c[e>>2]|0;if(b>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;b=c[e>>2]|0;}a[b>>0]=0;d=c[d>>2]|0;c[e>>2]=d;return d|0}function DU(b){b=b|0;var c=0,d=0;c=QA(b,137729)|0;if(!((c|0)!=0?(a[c>>0]|0)!=0:0))d=3;do if((d|0)==3){c=QA(b,140823)|0;if(c|0?a[c>>0]|0:0)break;c=0;}while(0);return c|0}function EU(f,g,i,j){f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+16|0;u=w+8|0;t=w;v=g+108|0;k=c[v>>2]|0;if(k|0)ZT(j,k,186576);c[g+80>>2]=i;k=LU(f,g,j)|0;r=g+36|0;f=b[r>>1]|0;if(!(f&128))a[g+32>>0]=2;i=g+33|0;if(!(f&32))a[i>>0]=1;zU(g);n=c[g+104>>2]|0;p=a[g+32>>0]|0;f=O(n+1|0,p)|0;o=d[i>>0]<<1;q=c[g+100>>2]|0;p=O(q+1|0,p)|0;m=g+96|0;f=o+f|0;i=0;while(1){if((i|0)>=(n|0))break;f=(c[(c[m>>2]|0)+(i<<2)>>2]|0)+f|0;i=i+1|0;}n=g+92|0;i=p+o|0;m=0;while(1){if((m|0)>=(q|0))break;i=(c[(c[n>>2]|0)+(m<<2)>>2]|0)+i|0;m=m+1|0;}n=g+38|0;do if(b[r>>1]&1){r=b[n>>1]|0;m=r&65535;if(r<<16>>16?(s=b[g+40>>1]|0,s<<16>>16):0){if(!((f|0)>(m|0)|(i|0)>(s&65535|0))){i=0;f=0;break}gA(0,137529,t)|0;k=1;i=0;f=0;break}gA(0,137563,u)|0;k=1;}while(0);u=e[n>>1]|0;h[g+64>>3]=+(((f|0)>(u|0)?f:u)|0);u=e[g+40>>1]|0;h[g+72>>3]=+(((i|0)>(u|0)?i:u)|0);if(c[v>>2]|0)fU(j,186576);l=w;return k|0}function FU(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function GU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0;I=l;l=l+64|0;G=I+32|0;H=I;E=c[e+84>>2]|0;k=c[e+80>>2]|0;if((k|0?(i=c[k+24>>2]|0,i|0):0)?(j=e+24|0,(c[j>>2]|0)==0):0)c[j>>2]=D4(i)|0;F=e+48|0;i=f+16|0;n=+h[i>>3];m=+h[f>>3];k=~~(n-m-+(~~+h[e+64>>3]|0));if((k|0)<=-1)qa(137496,137342,1761,137506);o=f+24|0;y=+h[o>>3];p=f+8|0;q=+h[p>>3];r=+(~~+h[e+72>>3]|0);s=~~(y-q-r);if((s|0)<=-1)qa(137519,137342,1764,137506);t=b[e+36>>1]|0;j=t&65535;a:do if(j&1){b:do if((k|0)>0)switch(j&6){case 4:{h[i>>3]=m+r;break b}case 2:{J=+(k|0);h[i>>3]=n+J;m=m+J;h[f>>3]=m;break b}default:{J=+(k>>>1|0);m=m+J;h[f>>3]=m;h[i>>3]=n-J;break b}}while(0);if((s|0)>0)switch(t&24){case 16:{y=q+r;h[o>>3]=y;s=0;i=0;break a}case 8:{J=+(s|0);y=y+J;h[o>>3]=y;h[p>>3]=q+J;s=0;i=0;break a}default:{J=+(s>>>1|0);h[p>>3]=q+J;y=y-J;h[o>>3]=y;s=0;i=0;break a}}else {s=0;i=0;}}else i=k;while(0);n=+(d[e+33>>0]|0);C=e+32|0;u=a[C>>0]|0;q=+(u<<24>>24);D=e+104|0;k=c[D>>2]|0;t=(i|0)/(k|0)|0;o=i-(O(t,k)|0)|0;o=~~(((o|0)>-1?.5:-.5)+ +(o|0));B=e+96|0;p=u<<24>>24;i=~~(m+n+q);j=0;while(1){if((j|0)>(k|0))break;A=(c[B>>2]|0)+(j<<2)|0;k=c[A>>2]|0;c[A>>2]=i;i=i+t+((j|0)<(o|0)&1)+k+p|0;j=j+1|0;k=c[D>>2]|0;}A=e+100|0;k=c[A>>2]|0;t=(s|0)/(k|0)|0;p=s-(O(t,k)|0)|0;p=~~(((p|0)>-1?.5:-.5)+ +(p|0));z=e+92|0;o=u<<24>>24;i=~~(y-n-q);j=0;while(1){if((j|0)>(k|0))break;x=(c[z>>2]|0)+(j<<2)|0;k=c[x>>2]|0;c[x>>2]=i;i=i-t+(((j|0)<(p|0))<<31>>31)-k-o|0;j=j+1|0;k=c[A>>2]|0;}u=(g|0)==0;v=H+16|0;w=H+24|0;x=H+8|0;i=E;while(1){o=c[i>>2]|0;if(!o)break;k=b[o+84>>1]|0;if(u){j=0;p=b[o+80>>1]|0;s=b[o+86>>1]|0;t=b[o+82>>1]|0;}else {j=k<<16>>16==0?8:0;s=b[o+86>>1]|0;j=s<<16>>16==0?j|4:j;p=b[o+80>>1]|0;t=b[o+82>>1]|0;j=(((p&65535)+(k&65535)|0)==(c[D>>2]|0)?j|2:j)|((t&65535)+(s&65535)|0)==(c[A>>2]|0);}K=c[B>>2]|0;k=k&65535;h[H>>3]=+(c[K+(k<<2)>>2]|0);E=a[C>>0]|0;h[v>>3]=+((c[K+((p&65535)+k<<2)>>2]|0)-E|0);p=c[z>>2]|0;h[w>>3]=+(c[p+((s&65535)<<2)>>2]|0);h[x>>3]=+((c[p+((t&65535)+(s&65535)<<2)>>2]|0)+E|0);c[G>>2]=c[H>>2];c[G+4>>2]=c[H+4>>2];c[G+8>>2]=c[H+8>>2];c[G+12>>2]=c[H+12>>2];c[G+16>>2]=c[H+16>>2];c[G+20>>2]=c[H+20>>2];c[G+24>>2]=c[H+24>>2];c[G+28>>2]=c[H+28>>2];IU(o,G,j&g);i=i+4|0;}a[e+35>>0]=g;c[F>>2]=c[f>>2];c[F+4>>2]=c[f+4>>2];c[F+8>>2]=c[f+8>>2];c[F+12>>2]=c[f+12>>2];c[F+16>>2]=c[f+16>>2];c[F+20>>2]=c[f+20>>2];c[F+24>>2]=c[f+24>>2];c[F+28>>2]=c[f+28>>2];l=I;return}function HU(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0.0,Q=0.0,R=0.0;O=l;l=l+112|0;H=O+48|0;I=O+16|0;J=O;c[I>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;c[I+12>>2]=0;c[I+16>>2]=0;c[I+20>>2]=0;c[I+24>>2]=0;c[I+28>>2]=0;K=e+4|0;L=f+16|0;M=f+32|0;N=I+16|0;r=b[K>>1]|0;n=r<<16>>16;g=0;j=-1.0;m=0;while(1){if((m|0)>=(n|0)){g=1;break}i=c[e>>2]|0;if((b[i+(m*24|0)+4>>1]|0)>1){g=0;break}i=c[(c[i+(m*24|0)>>2]|0)+4>>2]|0;if(!i){k=+h[M>>3];h[N>>3]=k;i=L;}else {if(c[i+24>>2]&127|0){g=0;break}k=+h[(+h[i+16>>3]>0.0?i:L)+16>>3];h[N>>3]=k;i=(c[i>>2]|0)==0?L:i;}i=c[i>>2]|0;c[I>>2]=i;if(!(j==-1.0)){if(k!=j){g=0;break}}else j=k;if(g){if(s2(i,g)|0){g=0;break}}else g=i;m=m+1|0;}a[e+6>>0]=g;E=f+48|0;F=f+20|0;G=I+4|0;w=f+40|0;x=I+24|0;y=d+144|0;z=H+4|0;v=J+8|0;A=H+16|0;B=H+24|0;C=H+8|0;D=H+12|0;f=(g|0)==0;j=0.0;s=0.0;t=0.0;u=0.0;n=0;g=r;while(1){if((n|0)>=(g<<16>>16|0))break;k=0.0;q=0.0;m=0;p=0.0;j=0.0;i=c[e>>2]|0;while(1){if((m|0)>=(b[i+(n*24|0)+4>>1]|0))break;c[H>>2]=EK(c[(c[i+(n*24|0)>>2]|0)+(m*56|0)>>2]|0,c[E>>2]|0)|0;i=(c[e>>2]|0)+(n*24|0)|0;g=c[(c[i>>2]|0)+(m*56|0)+4>>2]|0;if(!g){h[N>>3]=+h[M>>3];c[I>>2]=c[L>>2];c[G>>2]=c[F>>2];c[x>>2]=c[x>>2]&-128|c[w>>2]&127;}else {g=c[g+24>>2]&127;if(!g)g=c[w>>2]&127;c[x>>2]=c[x>>2]&-128|g;r=c[(c[i>>2]|0)+(m*56|0)+4>>2]|0;h[N>>3]=+h[(+h[r+16>>3]>0.0?r:L)+16>>3];c[I>>2]=c[((c[r>>2]|0)==0?L:r)>>2];c[G>>2]=c[((c[r+4>>2]|0)==0?L:r)+4>>2];}i=c[y>>2]|0;c[z>>2]=nb[c[i>>2]&63](i,I,1)|0;LO(J,d,H);Q=+h[J>>3];o=+h[v>>3];U1(c[(c[(c[e>>2]|0)+(n*24|0)>>2]|0)+(m*56|0)>>2]|0);i=c[e>>2]|0;r=c[i+(n*24|0)>>2]|0;c[r+(m*56|0)>>2]=c[H>>2];h[r+(m*56|0)+32>>3]=Q;h[r+(m*56|0)+16>>3]=+h[A>>3];h[r+(m*56|0)+24>>3]=+h[B>>3];c[r+(m*56|0)+4>>2]=c[z>>2];c[r+(m*56|0)+8>>2]=c[C>>2];c[r+(m*56|0)+12>>2]=c[D>>2];P=+h[N>>3];R=+h[B>>3];k=R>k?R:k;q=Q+q;m=m+1|0;p=P>p?P:p;j=o>j?o:j;}h[i+(n*24|0)+8>>3]=q;g=(n|0)==0;do if(f)if(g){o=p;k=p-k;g=i;break}else {o=p;k=t-u+p-k;g=i+(n*24|0)|0;break}else {o=j;k=g?p:j;g=i+(n*24|0)|0;}while(0);h[g+16>>3]=k;s=q>s?q:s;t=o+t;u=+h[i+(n*24|0)+16>>3]+u;n=n+1|0;g=b[K>>1]|0;}h[e+24>>3]=s;h[e+32>>3]=g<<16>>16==1?j:t;l=O;return}function IU(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0;y=l;l=l+64|0;v=y+32|0;x=y;j=e+24|0;if((c[j>>2]|0)==0?(i=c[(c[e+96>>2]|0)+24>>2]|0,i|0):0)c[j>>2]=D4(i)|0;t=e+36|0;w=b[t>>1]|0;i=w&65535;a:do if(i&1){k=+h[e+64>>3];q=+h[e+72>>3];j=f+16|0;m=+h[j>>3];o=+h[f>>3];n=m-o-k;b:do if(n>0.0)switch(i&6){case 4:{m=o+k;h[j>>3]=m;k=o;break b}case 2:{m=n+m;h[j>>3]=m;k=o+n;h[f>>3]=k;break b}default:{p=n*.5;k=p+o;h[f>>3]=k;m=m-p;h[j>>3]=m;break b}}else k=o;while(0);i=f+24|0;p=+h[i>>3];j=f+8|0;n=+h[j>>3];o=p-n-q;if(o>0.0)switch(w&24){case 16:{o=n+q;h[i>>3]=o;break a}case 8:{q=o+p;h[i>>3]=q;n=n+o;h[j>>3]=n;o=q;break a}default:{o=o*.5;n=o+n;h[j>>3]=n;o=p-o;h[i>>3]=o;break a}}else o=p;}else {k=+h[f>>3];n=+h[f+8>>3];m=+h[f+16>>3];o=+h[f+24>>3];}while(0);s=e+48|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];c[s+16>>2]=c[f+16>>2];c[s+20>>2]=c[f+20>>2];c[s+24>>2]=c[f+24>>2];c[s+28>>2]=c[f+28>>2];a[e+35>>0]=g;A=+(d[e+33>>0]|0);z=+(d[e+34>>0]|0);p=k+A+z;h[x>>3]=p;q=n+A+z;s=x+8|0;h[s>>3]=q;n=m-A-z;f=x+16|0;h[f>>3]=n;o=o-A-z;r=x+24|0;h[r>>3]=o;j=e+88|0;switch(a[e+92>>0]|0){case 1:{w=c[j>>2]|0;c[v>>2]=c[x>>2];c[v+4>>2]=c[x+4>>2];c[v+8>>2]=c[x+8>>2];c[v+12>>2]=c[x+12>>2];c[v+16>>2]=c[x+16>>2];c[v+20>>2]=c[x+20>>2];c[v+24>>2]=c[x+24>>2];c[v+28>>2]=c[x+28>>2];GU(w,v,g);break}case 3:{i=c[j>>2]|0;k=+h[i+24>>3];m=n-p-+h[i+16>>3];c:do if(m>0.0)switch(w&6){case 4:{h[f>>3]=n-m;break c}case 2:{h[x>>3]=m+p;break c}default:break c}while(0);k=o-q-k;d:do if(k>0.0)switch(w&24){case 16:{h[r>>3]=o-k;break d}case 8:{h[s>>3]=k+q;break d}default:break d}while(0);c[v>>2]=c[x>>2];c[v+4>>2]=c[x+4>>2];c[v+8>>2]=c[x+8>>2];c[v+12>>2]=c[x+12>>2];c[v+16>>2]=c[x+16>>2];c[v+20>>2]=c[x+20>>2];c[v+24>>2]=c[x+24>>2];c[v+28>>2]=c[x+28>>2];JU(i,v);break}default:{i=c[j>>2]|0;k=+h[i+32>>3];m=n-p-+h[i+24>>3];e:do if(m>0.0?(u=w&6,u<<16>>16!=6):0)switch(u&7){case 4:{h[f>>3]=n-m;break e}case 2:{h[x>>3]=m+p;break e}default:{A=m*.5;h[x>>3]=A+p;h[f>>3]=n-A;break e}}while(0);k=o-q-k;f:do if(k>0.0)switch(w&24){case 16:{h[r>>3]=o-k;break f}case 8:{h[s>>3]=k+q;break f}default:{A=k*.5;h[s>>3]=A+q;h[r>>3]=o-A;break f}}while(0);w=i+8|0;c[w>>2]=c[x>>2];c[w+4>>2]=c[x+4>>2];c[w+8>>2]=c[x+8>>2];c[w+12>>2]=c[x+12>>2];c[w+16>>2]=c[x+16>>2];c[w+20>>2]=c[x+20>>2];c[w+24>>2]=c[x+24>>2];c[w+28>>2]=c[x+28>>2];x=b[t>>1]&768;KU(c[j>>2]|0,(x&1023)==512?108:(x&1023)==256?114:110);}}l=y;return}function JU(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];return}function KU(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;g=b[d+4>>1]|0;f=0;while(1){if((f|0)>=(g|0))break;h=(c[d>>2]|0)+(f*24|0)+6|0;if(!(a[h>>0]|0))a[h>>0]=e;f=f+1|0;}return}function LU(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;l=f+84|0;t=c[l>>2]|0;u=KL()|0;v=PU()|0;i=0;h=0;k=Tz(t)|0;while(1){if(!k)break;j=Tz(c[k+8>>2]|0)|0;while(1){if(!j)break;j=c[j>>2]|0;i=i+1|0;}h=h+1|0;if(a[k+12>>0]|0)TU(v,h);k=c[k>>2]|0;}h=JK((i<<2)+4|0)|0;c[l>>2]=h;i=0;j=0;k=0;q=0;r=Tz(t)|0;while(1){if(!r)break;s=q&65535;p=0;o=Tz(c[r+8>>2]|0)|0;while(1){if(!o)break;n=c[o+8>>2]|0;c[h>>2]=n;k=MU(d,n,f,g)|0|k;l=NU(u,q,p,n)|0;b[n+86>>1]=s;b[n+84>>1]=l;l=l+(e[n+80>>1]|0)|0;m=q+(e[n+82>>1]|0)|0;if(UU(v,m)|0){p=n+100|0;a[p>>0]=a[p>>0]|2;}p=l;h=h+4|0;o=c[o>>2]|0;i=(l|0)>(i|0)?l:i;j=(m|0)>(j|0)?m:j;}q=q+1|0;r=c[r>>2]|0;}c[f+100>>2]=j;c[f+104>>2]=i;Rz(t)|0;Rz(v)|0;NL(u);return k|0}function MU(f,g,i,j){f=f|0;g=g|0;i=i|0;j=j|0;var k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+16|0;t=u+8|0;s=u;c[g+96>>2]=i;q=g+36|0;o=b[q>>1]|0;if(!(o&64)){if(!(b[i+36>>1]&64))n=2;else n=a[i+34>>0]|0;a[g+34>>0]=n;}if(!(o&32)){n=a[i+88>>0]|0;if(n<<24>>24<=-1)if(!(b[i+36>>1]&32))n=1;else n=a[i+33>>0]|0;a[g+33>>0]=n;}n=g+88|0;p=g+92|0;switch(a[p>>0]|0){case 1:{o=EU(f,c[n>>2]|0,g,j)|0;i=c[n>>2]|0;n=o;o=i+64|0;i=i+72|0;break}case 3:{o=OU(c[n>>2]|0,j)|0;i=c[n>>2]|0;n=o;o=i+16|0;i=i+24|0;break}default:{HU(c[(c[f+16>>2]|0)+144>>2]|0,c[n>>2]|0,j);i=c[n>>2]|0;n=0;o=i+24|0;i=i+32|0;}}k=+((d[g+33>>0]|0)+(d[g+34>>0]|0)<<1|0);m=+h[o>>3]+k;k=+h[i>>3]+k;i=g+38|0;do if(b[q>>1]&1){o=b[i>>1]|0;if(o<<16>>16?(r=b[g+40>>1]|0,r<<16>>16):0){if(!(m>+(o&65535)|k>+(r&65535))){m=0.0;k=0.0;break}if((a[p>>0]|0)==3){m=0.0;k=0.0;break}gA(0,137614,s)|0;n=1;m=0.0;k=0.0;break}gA(0,137647,t)|0;n=1;}while(0);v=+(e[i>>1]|0);h[g+64>>3]=m>v?m:v;m=+(e[g+40>>1]|0);h[g+72>>3]=k>m?k:m;l=u;return n|0}function NU(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var f=0,g=0,h=0,i=0,j=0;j=d+80|0;i=(e[j>>1]|0)+-1|0;h=0;a:while(1){f=c;while(1){if(h)break a;g=i+f|0;while(1){if((g|0)<(f|0)){c=f;h=1;continue a}if(SL(a,g,b)|0)break;g=g+-1|0;}f=g+1|0;}}h=d+82|0;f=c;while(1){if((f|0)<(c+(e[j>>1]|0)|0))g=b;else break;while(1){if((g|0)>=((e[h>>1]|0)+b|0))break;QL(a,f,g);g=g+1|0;}f=f+1|0;}return c|0}function OU(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;j=m;i=m+8|0;d=d+52|0;g=b+32|0;RF(i,c[d>>2]|0,c[g>>2]|0);k=c[i>>2]|0;i=c[i+4>>2]|0;if((i&k|0)==-1){c[j>>2]=c[g>>2];gA(1,137697,j)|0;d=1;f=0.0;e=0.0;}else {a[(c[(c[d>>2]|0)+16>>2]|0)+114>>0]=1;d=0;f=+(i|0);e=+(k|0);}c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;h[b+16>>3]=e;h[b+24>>3]=f;l=m;return d|0}function PU(){return Vz(55924,c[4581]|0)|0}function QU(a,b,d){a=a|0;b=b|0;d=d|0;d=JK(12)|0;c[d>>2]=c[b>>2];return d|0}function RU(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function SU(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return ((b|0)>(e|0)?1:((b|0)<(e|0))<<31>>31)|0}function TU(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;nb[c[a>>2]&63](a,e,1)|0;l=d;return}function UU(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;b=(nb[c[a>>2]&63](a,e,512)|0)!=0&1;l=d;return b|0}function VU(a){a=a|0;var b=0;if(!(c[47375]|0)){b=JK((a<<2)+4|0)|0;c[47375]=b;c[b>>2]=189504;c[47386]=a;}c[47387]=0;return}function WU(){U1(c[47375]|0);c[47375]=0;c[47387]=0;return}function XU(){c[47387]=0;return}function YU(){var a=0,b=0,d=0;b=c[47387]|0;d=c[47375]|0;a=1;while(1){if((a|0)>(b|0)){a=5;break}if((c[(c[d+(a<<2)>>2]|0)+4>>2]|0)==(a|0))a=a+1|0;else {a=4;break}}if((a|0)==4)qa(138394,137741,59,137747);else if((a|0)==5)return}function ZU(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;f=c[47375]|0;g=c[f+(a<<2)>>2]|0;h=c[g>>2]|0;while(1){b=(a|0)/2|0;d=c[f+(b<<2)>>2]|0;e=f+(a<<2)|0;if((c[d>>2]|0)>=(h|0))break;c[e>>2]=d;c[d+4>>2]=a;a=b;}c[e>>2]=g;c[g+4>>2]=a;return}function _U(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=c[47387]|0;if((b|0)==(c[47386]|0)){gA(1,137755,d)|0;a=1;}else {b=b+1|0;c[47387]=b;c[(c[47375]|0)+(b<<2)>>2]=a;ZU(b);YU();a=0;}l=d;return a|0}function $U(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=c[47375]|0;f=c[e+(a<<2)>>2]|0;g=c[f>>2]|0;h=c[47387]|0;i=(h|0)/2|0;while(1){if((a|0)>(i|0))break;d=a<<1;b=c[e+(d<<2)>>2]|0;if((d|0)<(h|0)){l=d|1;j=c[e+(l<<2)>>2]|0;k=(c[b>>2]|0)<(c[j>>2]|0);d=k?l:d;b=k?j:b;}if((g|0)>=(c[b>>2]|0))break;c[e+(a<<2)>>2]=b;c[b+4>>2]=a;a=d;}c[e+(a<<2)>>2]=f;c[f+4>>2]=a;return}function aV(){var a=0,b=0,d=0,e=0;b=c[47387]|0;if(!b)a=0;else {e=c[47375]|0;d=e+4|0;a=c[d>>2]|0;c[d>>2]=c[e+(b<<2)>>2];b=b+-1|0;c[47387]=b;if(b|0)$U(1);YU();}return a|0}function bV(a,b){a=a|0;b=b|0;c[a>>2]=b;ZU(c[a+4>>2]|0);YU();return}function cV(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=b+16|0;j=c[m>>2]|0;j=(a[j+((c[e+12>>2]|0)*40|0)+36>>0]|0)!=(a[j+((c[e+16>>2]|0)*40|0)+36>>0]|0);k=~~((+h[d+64>>3]+-3.0-+h[d+48>>3])*.5);l=~~((+h[d+56>>3]+-3.0-+h[d+40>>3])*.5);g=(k|0)<(l|0)?k:l;n=d+4|0;f=0;while(1){b=c[n>>2]|0;if((f|0)>=(b|0)){g=f;break}i=c[d+8+(f<<2)>>2]|0;o=c[m>>2]|0;if((a[o+((c[i+12>>2]|0)*40|0)+36>>0]|0)==(a[o+((c[i+16>>2]|0)*40|0)+36>>0]|0)){g=f;break}dV(i,g);f=f+1|0;}while(1){if((g|0)>=(b|0))break;f=c[d+8+(g<<2)>>2]|0;if(j|(f|0)==(e|0)){dV(f,a[(c[m>>2]|0)+((c[f+12>>2]|0)*40|0)+36>>0]|0?k:l);b=c[n>>2]|0;}g=g+1|0;}return}function dV(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+8|0;e=c[d>>2]|0;c[d>>2]=e+1;if((e|0)>=(b|0)){c[d>>2]=0;h[a>>3]=+h[a>>3]+16384.0;}return}function eV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0.0;x=l;l=l+112|0;u=x+64|0;t=x+96|0;m=x+32|0;v=x;w=JK(28)|0;b=tB(a)|0;s=w+4|0;c[s>>2]=b;b=JK(b*72|0)|0;r=w+12|0;c[r>>2]=b;e=v+8|0;h[e>>3]=1797693134862315708145274.0e284;h[v>>3]=1797693134862315708145274.0e284;f=v+24|0;h[f>>3]=-1797693134862315708145274.0e284;g=v+16|0;h[g>>3]=-1797693134862315708145274.0e284;i=m+16|0;j=m+8|0;k=m+24|0;d=jC(a)|0;n=1797693134862315708145274.0e284;o=1797693134862315708145274.0e284;p=-1797693134862315708145274.0e284;q=-1797693134862315708145274.0e284;while(1){if(!d)break;C=d+16|0;D=c[C>>2]|0;z=(+h[D+96>>3]+ +h[D+88>>3])*.5;z=z<1.0?1.0:z;y=+h[D+80>>3]*.5;y=y<1.0?1.0:y;E=+h[D+16>>3];B=E-z;h[m>>3]=B;z=E+z;h[i>>3]=z;E=+h[D+24>>3];A=E-y;h[j>>3]=A;y=E+y;h[k>>3]=y;B=+h[(n>3];h[v>>3]=B;A=+h[(o>3];h[e>>3]=A;z=+h[(p>z?v:m)+16>>3];h[g>>3]=z;y=+h[(q>y?v:m)+24>>3];h[f>>3]=y;D=b+40|0;c[D>>2]=c[m>>2];c[D+4>>2]=c[m+4>>2];c[D+8>>2]=c[m+8>>2];c[D+12>>2]=c[m+12>>2];c[D+16>>2]=c[m+16>>2];c[D+20>>2]=c[m+20>>2];c[D+24>>2]=c[m+24>>2];c[D+28>>2]=c[m+28>>2];c[b>>2]=c[b>>2]|1;c[(c[C>>2]|0)+112>>2]=b;b=b+72|0;d=kC(a,d)|0;n=B;o=A;p=z;q=y;}h[v>>3]=n+-36.0;h[e>>3]=o+-36.0;h[g>>3]=p+36.0;h[f>>3]=q+36.0;D=c[r>>2]|0;f=c[s>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];f=oV(D,f,t,u)|0;if(c[47323]&1|0){r=c[r>>2]|0;C=c[s>>2]|0;D=c[t>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];fV(r,C,u,f,D);}e=w+8|0;c[e>>2]=JK((c[t>>2]|0)*72|0)|0;c[w>>2]=c[t>>2];d=c[t>>2]|0;b=0;while(1){if((b|0)>=(d|0))break;D=(c[e>>2]|0)+(b*72|0)+40|0;C=f+(b<<5)|0;c[D>>2]=c[C>>2];c[D+4>>2]=c[C+4>>2];c[D+8>>2]=c[C+8>>2];c[D+12>>2]=c[C+12>>2];c[D+16>>2]=c[C+16>>2];c[D+20>>2]=c[C+20>>2];c[D+24>>2]=c[C+24>>2];c[D+28>>2]=c[C+28>>2];b=b+1|0;}U1(f);c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];c[u+16>>2]=c[v+16>>2];c[u+20>>2]=c[v+20>>2];c[u+24>>2]=c[v+24>>2];c[u+28>>2]=c[v+28>>2];c[w+16>>2]=gV(w,u)|0;l=x;return w|0}function fV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0.0;q=l;l=l+128|0;p=q+96|0;o=q+64|0;j=q+32|0;r=q+16|0;s=q;m=+h[d+16>>3];n=+h[d>>3];k=+h[d+24>>3];g=+h[d+8>>3];i=c[15712]|0;T4(137770,i)|0;c[s>>2]=10;c[s+4>>2]=10;c[s+8>>2]=~~(m+10.0-n);c[s+12>>2]=~~(k+10.0-g);w4(i,138200,s)|0;h[r>>3]=10.0-n;h[r+8>>3]=10.0-g;w4(i,138248,r)|0;T4(138265,i)|0;d=0;while(1){if((d|0)>=(b|0))break;v=+h[a+(d*72|0)+48>>3];u=+h[a+(d*72|0)+56>>3];t=+h[a+(d*72|0)+64>>3];h[j>>3]=+h[a+(d*72|0)+40>>3];h[j+8>>3]=v;h[j+16>>3]=u;h[j+24>>3]=t;w4(i,138284,j)|0;d=d+1|0;}T4(138302,i)|0;d=0;while(1){if((d|0)>=(f|0))break;t=+h[e+(d<<5)+8>>3];u=+h[e+(d<<5)+16>>3];v=+h[e+(d<<5)+24>>3];h[o>>3]=+h[e+(d<<5)>>3];h[o+8>>3]=t;h[o+16>>3]=u;h[o+24>>3]=v;w4(i,138321,o)|0;d=d+1|0;}T4(138339,i)|0;h[p>>3]=n;h[p+8>>3]=g;h[p+16>>3]=m;h[p+24>>3]=k;w4(i,138321,p)|0;T4(138086,i)|0;l=q;return}function gV(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;A=l;l=l+32|0;t=A+16|0;k=A;w=c[a>>2]|0;y=CR(w<<2|2)|0;z=Vz(55960,c[4581]|0)|0;v=Vz(55996,c[4581]|0)|0;w=JK(w<<7)|0;f=JK(c[a>>2]<<4)|0;x=a+8|0;g=b+16|0;i=k+8|0;j=b+24|0;m=b+8|0;d=0;while(1){if((d|0)>=(c[a>>2]|0))break;n=c[x>>2]|0;o=n+(d*72|0)|0;c[n+(d*72|0)+32>>2]=4;p=n+(d*72|0)+36|0;c[p>>2]=f+(d<<2<<2);q=n+(d*72|0)+40|0;e=+h[n+(d*72|0)+56>>3];if(e<+h[g>>3]){h[k>>3]=e;h[i>>3]=+h[n+(d*72|0)+48>>3];c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];s=hV(y,z,t,w,1)|0;c[s+20>>2]=o;c[c[p>>2]>>2]=s;}e=+h[n+(d*72|0)+64>>3];if(e<+h[j>>3]){h[k>>3]=+h[q>>3];h[i>>3]=e;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];s=hV(y,v,t,w,0)|0;c[s+20>>2]=o;c[(c[p>>2]|0)+4>>2]=s;}if(+h[q>>3]>+h[b>>3]){c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];s=hV(y,z,t,w,1)|0;c[s+24>>2]=o;c[(c[p>>2]|0)+8>>2]=s;}if(+h[n+(d*72|0)+48>>3]>+h[m>>3]){c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];s=hV(y,v,t,w,0)|0;c[s+24>>2]=o;c[(c[p>>2]|0)+12>>2]=s;}d=d+1|0;}o=JK(c[y>>2]<<2)|0;r=a+4|0;s=a+12|0;p=t+8|0;m=0;q=0;n=0;while(1){d=c[r>>2]|0;if((n|0)>=(d|0)){b=0;break}g=c[s>>2]|0;i=g+(n*72|0)|0;j=g+(n*72|0)+36|0;c[j>>2]=o+(m<<2);b=g+(n*72|0)+40|0;c[t>>2]=c[b>>2];c[t+4>>2]=c[b+4>>2];c[t+8>>2]=c[b+8>>2];c[t+12>>2]=c[b+12>>2];b=g+(n*72|0)+56|0;k=g+(n*72|0)+32|0;d=nb[c[v>>2]&63](v,t,512)|0;while(1){if(!d)break;if(!(+h[d+8>>3]<+h[b>>3]))break;C=c[d>>2]|0;B=c[j>>2]|0;f=c[k>>2]|0;c[k>>2]=f+1;c[B+(f<<2)>>2]=C;c[(c[d>>2]|0)+24>>2]=i;d=nb[c[v>>2]&63](v,d,8)|0;}f=g+(n*72|0)+64|0;d=nb[c[z>>2]&63](z,t,512)|0;while(1){if(!d){u=20;break}e=+h[f>>3];if(!(+h[d+16>>3]>2]|0;B=c[j>>2]|0;C=c[k>>2]|0;c[k>>2]=C+1;c[B+(C<<2)>>2]=b;c[(c[d>>2]|0)+24>>2]=i;d=nb[c[z>>2]&63](z,d,8)|0;}if((u|0)==20){u=0;e=+h[f>>3];}h[p>>3]=e;b=g+(n*72|0)+56|0;d=nb[c[v>>2]&63](v,t,512)|0;while(1){if(!d){u=25;break}e=+h[b>>3];if(!(+h[d+8>>3]>2]|0;B=c[j>>2]|0;C=c[k>>2]|0;c[k>>2]=C+1;c[B+(C<<2)>>2]=D;c[(c[d>>2]|0)+20>>2]=i;d=nb[c[v>>2]&63](v,d,8)|0;}if((u|0)==25){u=0;e=+h[b>>3];}h[t>>3]=e;h[p>>3]=+h[g+(n*72|0)+48>>3];d=nb[c[z>>2]&63](z,t,512)|0;while(1){if(!d)break;if(!(+h[d+16>>3]<+h[f>>3]))break;B=c[d>>2]|0;C=c[j>>2]|0;D=c[k>>2]|0;c[k>>2]=D+1;c[C+(D<<2)>>2]=B;c[(c[d>>2]|0)+20>>2]=i;d=nb[c[z>>2]&63](z,d,8)|0;}D=c[k>>2]|0;m=D+m|0;q=(D|0)>(q|0)?D:q;n=n+1|0;}while(1){if((b|0)>=(d|0))break;iV((c[s>>2]|0)+(b*72|0)|0);b=b+1|0;d=c[r>>2]|0;}d=c[y>>2]|0;D=c[y+16>>2]|0;c[D+(d*40|0)+32>>2]=d;d=d+1|0;c[D+(d*40|0)+32>>2]=d;BR(y,q);d=0;while(1){if((d|0)>=(c[a>>2]|0))break;jV((c[x>>2]|0)+(d*72|0)|0,y);d=d+1|0;}Rz(z)|0;Rz(v)|0;U1(w);kV(y);zR(y);l=A;return y|0}function hV(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=nb[c[d>>2]&63](d,e,512)|0;do if(!h){b=DR(b)|0;if(!f)qa(138183,138131,291,138190);else {h=c[b+32>>2]|0;i=f+(h<<5)|0;f=f+(h<<5)+8|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[i>>2]=b;a[b+36>>0]=g;nb[c[d>>2]&63](d,i,1)|0;break}}else i=h;while(0);return c[i>>2]|0}function iV(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;a:do if((+h[b+64>>3]+-3.0-+h[b+48>>3])*.5<2.0){i=c[b+32>>2]|0;j=b+36|0;g=0;while(1){if((g|0)>=(i|0))break a;d=c[(c[j>>2]|0)+(g<<2)>>2]|0;b:do if(a[d+36>>0]|0){f=c[d+20>>2]|0;if((f|0)==(b|0)){e=c[d+24>>2]|0;d=e;e=c[e>>2]|0;do{c[d>>2]=e|8;d=c[c[d+36>>2]>>2]|0;if(!d)break b;d=c[d+24>>2]|0;e=c[d>>2]|0;}while(!(e&1|0))}else {e=f;d=c[f>>2]|0;do{c[e>>2]=d|8;d=c[(c[e+36>>2]|0)+8>>2]|0;if(!d)break b;e=c[d+20>>2]|0;d=c[e>>2]|0;}while(!(d&1|0))}}while(0);g=g+1|0;}}while(0);c:do if((+h[b+56>>3]+-3.0-+h[b+40>>3])*.5<2.0){i=c[b+32>>2]|0;j=b+36|0;g=0;while(1){if((g|0)>=(i|0))break c;d=c[(c[j>>2]|0)+(g<<2)>>2]|0;d:do if(!(a[d+36>>0]|0)){f=c[d+20>>2]|0;if((f|0)==(b|0)){e=c[d+24>>2]|0;d=e;e=c[e>>2]|0;do{c[d>>2]=e|16;d=c[(c[d+36>>2]|0)+4>>2]|0;if(!d)break d;d=c[d+24>>2]|0;e=c[d>>2]|0;}while(!(e&1|0))}else {e=f;d=c[f>>2]|0;do{c[e>>2]=d|16;d=c[(c[e+36>>2]|0)+12>>2]|0;if(!d)break d;e=c[d+20>>2]|0;d=c[e>>2]|0;}while(!(d&1|0))}}while(0);g=g+1|0;}}while(0);return}function jV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;g=+h[a+56>>3]-+h[a+40>>3];i=+h[a+64>>3]-+h[a+48>>3];f=(i+g)*.5+500.0;if((i+-3.0)*.5<2.0){l=(c[a>>2]&8|0)==0;f=l?16384.0:f;p=l?16384.0:g;}else p=g;if((g+-3.0)*.5<2.0){l=(c[a>>2]&16|0)==0;i=l?16384.0:i;f=l?16384.0:f;}l=a+36|0;d=c[l>>2]|0;e=c[d+8>>2]|0;if((e|0)!=0?(j=c[d+4>>2]|0,(j|0)!=0):0){j=ER(b,e,j,f)|0;e=a+4|0;d=c[e>>2]|0;c[e>>2]=d+1;c[a+8+(d<<2)>>2]=j;d=c[l>>2]|0;}e=c[d+4>>2]|0;if((e|0)!=0?(k=c[d>>2]|0,(k|0)!=0):0){k=ER(b,e,k,f)|0;j=a+4|0;d=c[j>>2]|0;c[j>>2]=d+1;c[a+8+(d<<2)>>2]=k;d=c[l>>2]|0;}e=c[d+8>>2]|0;if((e|0)!=0?(m=c[d+12>>2]|0,(m|0)!=0):0){m=ER(b,e,m,f)|0;k=a+4|0;d=c[k>>2]|0;c[k>>2]=d+1;c[a+8+(d<<2)>>2]=m;d=c[l>>2]|0;}e=c[d+12>>2]|0;if((e|0)!=0?(n=c[d>>2]|0,(n|0)!=0):0){n=ER(b,e,n,f)|0;m=a+4|0;d=c[m>>2]|0;c[m>>2]=d+1;c[a+8+(d<<2)>>2]=n;d=c[l>>2]|0;}e=c[d+4>>2]|0;if((e|0)!=0?(o=c[d+12>>2]|0,(o|0)!=0):0){o=ER(b,e,o,i)|0;n=a+4|0;d=c[n>>2]|0;c[n>>2]=d+1;c[a+8+(d<<2)>>2]=o;d=c[l>>2]|0;}e=c[d+8>>2]|0;if(e|0?(q=c[d>>2]|0,q|0):0){b=ER(b,e,q,p)|0;o=a+4|0;q=c[o>>2]|0;c[o>>2]=q+1;c[a+8+(q<<2)>>2]=b;}return}function kV(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j+8|0;h=j;f=a+16|0;g=c[15712]|0;e=0;while(1){if((e|0)>=(c[a>>2]|0)){b=10;break}b=c[f>>2]|0;d=b+(e*40|0)+20|0;if((c[d>>2]|0)==0?(c[h>>2]=e,w4(g,138096,h)|0,(c[d>>2]|0)==0):0){b=5;break}b=b+(e*40|0)+24|0;if((c[b>>2]|0)==0?(c[i>>2]=e,w4(g,138148,i)|0,(c[b>>2]|0)==0):0){b=8;break}e=e+1|0;}if((b|0)==5)qa(138118,138131,311,138138);else if((b|0)==8)qa(138170,138131,313,138138);else if((b|0)==10){l=j;return}}function lV(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[c+8>>3];if(!(e>f))if(!(e>3];e=+h[c>>3];if(f>e)a=1;else a=(f>31;}else a=-1;else a=1;return a|0}function mV(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0;e=+h[b>>3];f=+h[c>>3];if(!(e>f))if(!(e>3];e=+h[c+8>>3];if(f>e)a=1;else a=(f>31;}else a=-1;else a=1;return a|0}function nV(a){a=a|0;var b=0,d=0;d=a+8|0;U1(c[(c[d>>2]|0)+36>>2]|0);b=a+12|0;U1(c[(c[b>>2]|0)+36>>2]|0);U1(c[d>>2]|0);U1(c[b>>2]|0);GR(c[a+16>>2]|0);Rz(c[a+20>>2]|0)|0;Rz(c[a+24>>2]|0)|0;U1(a);return}function oV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+32|0;h=p;i=b<<2;f=i+4|0;i=i+5|0;o=KK(i*56|0)|0;i=JK(i<<2)|0;g=f*5|1;j=KK(g*72|0)|0;m=g<<5;k=JK(m)|0;m=JK(m)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[h+16>>2]=c[e+16>>2];c[h+20>>2]=c[e+20>>2];c[h+24>>2]=c[e+24>>2];c[h+28>>2]=c[e+28>>2];pV(a,b,h,o,0);z5(173);qV(f,i);AV(f,o,i,g,j)|0;n=rV(f,o,j,0,k)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[h+16>>2]=c[e+16>>2];c[h+20>>2]=c[e+20>>2];c[h+24>>2]=c[e+24>>2];c[h+28>>2]=c[e+28>>2];pV(a,b,h,o,1);qV(f,i);AV(f,o,i,g,j)|0;f=rV(f,o,j,1,m)|0;g=JK(O(n<<5,f)|0)|0;b=0;a=0;while(1){if((b|0)>=(f|0))break;h=m+(b<<5)|0;e=0;while(1){if((e|0)>=(n|0))break;q=a+((sV(g+(a<<5)|0,h,k+(e<<5)|0)|0)!=0&1)|0;e=e+1|0;a=q;}b=b+1|0;}q=MK(g,a<<5)|0;U1(o);U1(i);U1(j);U1(k);U1(m);c[d>>2]=a;l=p;return q|0}function pV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;j=l;l=l+96|0;h=j+64|0;i=j;c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];c[h+16>>2]=c[d+16>>2];c[h+20>>2]=c[d+20>>2];c[h+24>>2]=c[d+24>>2];c[h+28>>2]=c[d+28>>2];yV(h,f,1,i);d=zV(e,1,i)|0;g=0;while(1){if((g|0)>=(b|0))break;k=a+(g*72|0)+40|0;c[h>>2]=c[k>>2];c[h+4>>2]=c[k+4>>2];c[h+8>>2]=c[k+8>>2];c[h+12>>2]=c[k+12>>2];c[h+16>>2]=c[k+16>>2];c[h+20>>2]=c[k+20>>2];c[h+24>>2]=c[k+24>>2];c[h+28>>2]=c[k+28>>2];yV(h,f,0,i);d=zV(e,d,i)|0;g=g+1|0;}l=j;return}function qV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=0;while(1){if((d|0)>(a|0))break;c[b+(d<<2)>>2]=d;d=d+1|0;}g=a+1|0;d=1;while(1){if((d|0)>(a|0))break;h=~~(+B5()*+(g-d|0)+ +(d|0));e=b+(d<<2)|0;f=b+(h<<2)|0;if((d|0)!=(h|0)){h=c[e>>2]|0;c[e>>2]=c[f>>2];c[f>>2]=h;}d=d+1|0;}return}function rV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;g=a*5|0;j=g+1|0;l=JK(j<<2)|0;c[47388]=JK(j<<4)|0;c[47389]=JK((a*56|0)+56|0)|0;j=JK(a<<2)|0;c[47390]=j;k=0;while(1){if((k|0)>(g|0))break;if(tV(d+(k*72|0)|0,b)|0)break;k=k+1|0;}h=c[47388]|0;i=c[47389]|0;g=1;while(1){if((g|0)>(a|0))break;c[h+(g<<4)+8>>2]=c[b+(g*56|0)+48>>2];m=b+(g*56|0)+44|0;c[h+(g<<4)+4>>2]=c[m>>2];c[h+(g<<4)>>2]=g;n=i+(g*56|0)|0;o=b+(g*56|0)|0;c[n>>2]=c[o>>2];c[n+4>>2]=c[o+4>>2];c[n+8>>2]=c[o+8>>2];c[n+12>>2]=c[o+12>>2];c[i+(g*56|0)+16>>2]=c[m>>2];c[i+(g*56|0)+32>>2]=g;c[i+(g*56|0)+48>>2]=1;g=g+1|0;}c[47391]=a;c[47392]=0;c[j>>2]=1;g=c[d+(k*72|0)+40>>2]|0;if((g|0)<=0){g=c[d+(k*72|0)+48>>2]|0;if((g|0)>0)g=uV(l,f,0,b,d,0,k,g,e,2)|0;else g=0;}else g=uV(l,f,0,b,d,0,k,g,e,1)|0;U1(l);U1(c[47388]|0);U1(c[47389]|0);U1(c[47390]|0);return g|0}function sV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;g=+h[(+h[b>>3]>+h[c>>3]?b:c)>>3];f=+h[(+h[b+16>>3]<+h[c+16>>3]?b:c)+16>>3];h[a+16>>3]=f;h[a>>3]=g;e=+h[(+h[b+8>>3]>+h[c+8>>3]?b:c)+8>>3];d=+h[(+h[b+24>>3]<+h[c+24>>3]?b:c)+24>>3];h[a+24>>3]=d;h[a+8>>3]=e;return !(g>=f)&!(e>=d)&1|0}function tV(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[a+4>>2]|0;do if((c[a+68>>2]|0)!=2?!((f|0)<1|(c[a>>2]|0)<1):0){if(!((c[a+40>>2]|0)<1?(c[a+44>>2]|0)<1:0)){if((c[a+48>>2]|0)>=1){a=0;break}if((c[a+52>>2]|0)>=1){a=0;break}}d=+h[b+(f*56|0)+24>>3];e=+h[b+(f*56|0)+8>>3];if(!(d>e+1.0e-07))if(d>3]>+h[b+(f*56|0)>>3]&1;else a=1;}else a=0;while(0);return a|0}function uV(a,b,d,e,f,g,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0,K=0.0,L=0,M=0,N=0,O=0,P=0;D=(k|0)==0;C=i;a:while(1){y=f+(C*72|0)|0;if((C|0)<1)break;i=a+(C<<2)|0;if(c[i>>2]|0)break;c[i>>2]=1;v=f+(C*72|0)+8|0;t=f+(C*72|0)+16|0;p=+h[t>>3];w=f+(C*72|0)+24|0;x=f+(C*72|0)+32|0;o=+h[x>>3];if((p>o?(A=c[y>>2]|0,I=+h[e+(A*56|0)>>3],I==+h[e+(A*56|0)+16>>3]):0)?(A=c[f+(C*72|0)+4>>2]|0,K=+h[e+(A*56|0)>>3],K==+h[e+(A*56|0)+16>>3]):0){i=b+(d<<5)|0;if(D){h[i>>3]=I;q=p;p=K;}else {h[i>>3]=o;q=-I;o=-K;}h[b+(d<<5)+8>>3]=o;h[b+(d<<5)+16>>3]=p;h[b+(d<<5)+24>>3]=q;d=d+1|0;}i=f+(C*72|0)+40|0;z=c[i>>2]|0;do if((z|0)<1?(L=f+(C*72|0)+44|0,(c[L>>2]|0)<1):0){i=f+(C*72|0)+48|0;n=f+(C*72|0)+52|0;if((c[i>>2]|0)>0?(M=c[n>>2]|0,(M|0)>0):0){m=c[f+(M*72|0)>>2]|0;l=c[y>>2]|0;if((M|0)==(j|0)){l=vV(g,l,m)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,1)|0;g=l;l=1;break}else {l=vV(g,m,l)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,1)|0;g=l;i=n;l=1;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[L>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,1)|0;i=n;l=1;}else P=19;while(0);do if((P|0)==19){P=0;A=f+(C*72|0)+48|0;r=c[A>>2]|0;if((r|0)<1?(N=f+(C*72|0)+52|0,(c[N>>2]|0)<1):0){n=f+(C*72|0)+44|0;if((z|0)>0?(O=c[n>>2]|0,(O|0)>0):0){m=c[f+(C*72|0)+4>>2]|0;l=c[f+(z*72|0)+4>>2]|0;if((O|0)==(j|0)){l=vV(g,l,m)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,2)|0;g=l;l=2;break}else {l=vV(g,m,l)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;g=l;i=n;l=2;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[n>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;i=N;l=1;break}u=f+(C*72|0)+44|0;s=c[u>>2]|0;m=(s|0)>0;if((z|0)>0){if(m){if((r|0)>0?(E=f+(C*72|0)+52|0,F=c[E>>2]|0,(F|0)>0):0){n=c[f+(F*72|0)>>2]|0;m=c[f+(z*72|0)+4>>2]|0;if(!((l|0)==2&(F|0)==(j|0))?!((l|0)==1&(s|0)==(j|0)):0){l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[u>>2]|0,C,k,2)|0;g=l;i=E;l=1;break}l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[E>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}m=c[y>>2]|0;if(+B(+(+h[x>>3]-+h[e+(m*56|0)+24>>3]))<=1.0e-07?+B(+(+h[w>>3]-+h[e+(m*56|0)+16>>3]))<=1.0e-07:0){n=c[f+(z*72|0)+4>>2]|0;m=c[e+(m*56|0)+44>>2]|0;if((l|0)==1&(z|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[u>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+52|0;l=1;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;l=2;break}}n=c[f+(C*72|0)+4>>2]|0;m=c[f+(z*72|0)+4>>2]|0;if((l|0)==1&(s|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[u>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[A>>2]|0,C,k,1)|0;g=l;l=2;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=u;l=2;break}}}else if(!m)break a;if((r|0)>0?(G=f+(C*72|0)+52|0,H=c[G>>2]|0,(H|0)>0):0){n=c[y>>2]|0;if(+B(+(+h[t>>3]-+h[e+(n*56|0)+8>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(n*56|0)>>3]))<=1.0e-07:0){m=c[f+(H*72|0)>>2]|0;if((l|0)==2&(r|0)==(j|0)){l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;g=l;i=G;l=1;break}else {l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[G>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}}m=c[f+(H*72|0)>>2]|0;n=c[e+((c[f+(C*72|0)+4>>2]|0)*56|0)+44>>2]|0;if((l|0)==2&(H|0)==(j|0)){l=vV(g,n,m)|0;d=uV(a,b,d,e,f,g,c[G>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=A;l=1;break}else {l=vV(g,m,n)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;g=l;i=G;l=1;break}}o=+h[t>>3];n=c[y>>2]|0;if(((+B(+(o-+h[e+(n*56|0)+8>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(n*56|0)>>3]))<=1.0e-07:0)?(J=c[f+(C*72|0)+4>>2]|0,+B(+(+h[x>>3]-+h[e+(J*56|0)+8>>3]))<=1.0e-07):0)?+B(+(+h[w>>3]-+h[e+(J*56|0)>>3]))<=1.0e-07:0)if((l|0)==1){l=vV(g,n,J)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=A;l=1;break}else {l=vV(g,J,n)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+44|0;l=2;break}j=c[f+(C*72|0)+4>>2]|0;if(((+B(+(o-+h[e+(j*56|0)+24>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[e+(j*56|0)+16>>3]))<=1.0e-07:0)?+B(+(+h[x>>3]-+h[e+(n*56|0)+24>>3]))<=1.0e-07:0)?+B(+(+h[w>>3]-+h[e+(n*56|0)+16>>3]))<=1.0e-07:0){m=c[e+(j*56|0)+44>>2]|0;j=c[e+(n*56|0)+44>>2]|0;if((l|0)==1){l=vV(g,j,m)|0;d=uV(a,b,d,e,f,g,c[i>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;d=uV(a,b,d,e,f,l,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;g=l;i=A;l=1;break}else {l=vV(g,m,j)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+52>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,l,c[i>>2]|0,C,k,2)|0;g=l;i=f+(C*72|0)+44|0;l=2;break}}d=uV(a,b,d,e,f,g,z,C,k,2)|0;d=uV(a,b,d,e,f,g,c[A>>2]|0,C,k,1)|0;d=uV(a,b,d,e,f,g,c[f+(C*72|0)+44>>2]|0,C,k,2)|0;i=f+(C*72|0)+52|0;l=1;}while(0);j=C;C=c[i>>2]|0;}return d|0}function vV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;f=l;l=l+16|0;r=f+4|0;i=f;e=(c[47392]|0)+1|0;c[47392]=e;m=c[47389]|0;wV(b,d,r,i);r=c[r>>2]|0;h=c[m+(b*56|0)+32+(r<<2)>>2]|0;i=c[m+(d*56|0)+32+(c[i>>2]<<2)>>2]|0;n=c[47391]|0;g=n+1|0;n=n+2|0;c[47391]=n;q=c[47388]|0;c[q+(g<<4)>>2]=b;c[q+(n<<4)>>2]=d;o=q+(h<<4)+4|0;p=q+(g<<4)+4|0;c[p>>2]=c[o>>2];c[q+(c[o>>2]<<4)+8>>2]=g;c[q+(g<<4)+8>>2]=n;c[q+(n<<4)+4>>2]=g;j=q+(i<<4)+8|0;c[q+(n<<4)+8>>2]=c[j>>2];c[q+(c[j>>2]<<4)+4>>2]=n;c[o>>2]=i;c[j>>2]=h;j=m+(b*56|0)+48|0;o=c[j>>2]|0;i=m+(d*56|0)+48|0;k=c[i>>2]|0;c[m+(b*56|0)+16+(r<<2)>>2]=d;c[m+(b*56|0)+32+(o<<2)>>2]=g;c[m+(b*56|0)+16+(o<<2)>>2]=c[q+(c[p>>2]<<4)>>2];c[m+(d*56|0)+32+(k<<2)>>2]=n;c[m+(d*56|0)+16+(k<<2)>>2]=b;c[j>>2]=(c[j>>2]|0)+1;c[i>>2]=(c[i>>2]|0)+1;d=c[47390]|0;c[d+(a<<2)>>2]=h;c[d+(e<<2)>>2]=g;l=f;return e|0}function wV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,h=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0;l=c[47389]|0;m=l+(a*56|0)|0;n=l+(b*56|0)|0;f=0;g=-4.0;i=0;while(1){if((i|0)==4)break;h=c[l+(a*56|0)+16+(i<<2)>>2]|0;if((h|0)>=1?(j=+xV(m,l+(h*56|0)|0,n),j>g):0){f=i;g=j;}i=i+1|0;}c[d>>2]=f;f=0;i=0;g=-4.0;while(1){if((i|0)==4)break;h=c[l+(b*56|0)+16+(i<<2)>>2]|0;if((h|0)>=1?(k=+xV(n,l+(h*56|0)|0,m),k>g):0){f=i;g=k;}i=i+1|0;}c[e>>2]=f;return}function xV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;g=+h[a>>3];i=+h[b>>3]-g;d=+h[a+8>>3];f=+h[b+8>>3]-d;g=+h[c>>3]-g;d=+h[c+8>>3]-d;e=d*f+g*i;if(!(d*i-g*f>=0.0))d=-e/(+C(+(d*d+g*g))*+C(+(f*f+i*i)))+-2.0;else d=e/(+C(+(d*d+g*g))*+C(+(f*f+i*i)));return +d}function yV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,l=0.0;c[e>>2]=c[a>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];i=e+32|0;j=a+16|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];if(!d){f=a+8|0;g=j;i=a+24|0;d=a;}else {f=a+24|0;g=a;i=a+8|0;d=j;}k=+h[g>>3];l=+h[i>>3];h[e+16>>3]=+h[d>>3];h[e+24>>3]=l;h[e+48>>3]=k;h[e+56>>3]=+h[f>>3];a:do if(b|0){d=0;while(1){if((d|0)==4)break a;j=e+(d<<4)+8|0;l=+h[j>>3];b=e+(d<<4)|0;h[j>>3]=+h[b>>3];h[b>>3]=-l;d=d+1|0;}}while(0);return}function zV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=b+3|0;i=b+1|0;j=b+2|0;k=a+(b*56|0)+44|0;l=a+(h*56|0)+44|0;e=0;f=b;while(1){if((f|0)>(h|0))break;do if((f|0)!=(b|0))if((f|0)==(h|0)){c[l>>2]=b;g=j;break}else {c[a+(f*56|0)+44>>2]=f+1;g=f+-1|0;break}else {c[k>>2]=i;g=h;}while(0);c[a+(f*56|0)+48>>2]=g;c[a+(f*56|0)+32>>2]=0;n=a+(f*56|0)|0;m=d+(e<<4)|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];c[n+8>>2]=c[m+8>>2];c[n+12>>2]=c[m+12>>2];X6(a+(g*56|0)+16|0,m|0,16)|0;e=e+1|0;f=f+1|0;}return b+4|0}function AV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;c[47393]=e<<1;c[47394]=e;k=JK(e*80|0)|0;c[47395]=1;c[47396]=1;Y6(f|0,0,e*72|0)|0;g=BV(c[d+4>>2]|0,b,f,k)|0;e=1;while(1){if((e|0)>(a|0))break;c[b+(e*56|0)+40>>2]=g;c[b+(e*56|0)+36>>2]=g;e=e+1|0;}j=CV(a)|0;g=2;i=1;while(1){if((i|0)>(j|0))break;e=DV(a,i+-1|0)|0;h=DV(a,i)|0;while(1){if((e|0)>=(h|0)){e=1;break}EV(c[d+(g<<2)>>2]|0,b,f,k);e=e+1|0;g=g+1|0;}while(1){if((e|0)>(a|0))break;FV(e,b,f,k);e=e+1|0;}i=i+1|0;}e=DV(a,j)|0;while(1){if((e|0)>=(a|0))break;EV(c[d+(g<<2)>>2]|0,b,f,k);g=g+1|0;e=e+1|0;}U1(k);return c[47395]|0}function BV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=KV()|0;c[e+(f*40|0)>>2]=2;s=e+(f*40|0)+8|0;k=b+(a*56|0)|0;l=b+(a*56|0)+16|0;OV(s,k,l);n=KV()|0;c[e+(f*40|0)+36>>2]=n;c[e+(n*40|0)>>2]=3;c[e+(n*40|0)+28>>2]=f;j=KV()|0;c[e+(f*40|0)+32>>2]=j;c[e+(j*40|0)>>2]=2;r=e+(j*40|0)+8|0;PV(r,k,l);c[e+(j*40|0)+28>>2]=f;l=KV()|0;c[e+(j*40|0)+32>>2]=l;c[e+(l*40|0)>>2]=3;c[e+(l*40|0)+28>>2]=j;k=KV()|0;c[e+(j*40|0)+36>>2]=k;c[e+(k*40|0)>>2]=1;c[e+(k*40|0)+4>>2]=a;c[e+(k*40|0)+28>>2]=j;j=KV()|0;c[e+(k*40|0)+32>>2]=j;c[e+(j*40|0)>>2]=3;c[e+(j*40|0)+28>>2]=k;g=KV()|0;c[e+(k*40|0)+36>>2]=g;c[e+(g*40|0)>>2]=3;c[e+(g*40|0)+28>>2]=k;k=JV(d)|0;i=JV(d)|0;m=JV(d)|0;o=JV(d)|0;p=d+(k*72|0)+8|0;q=d+(i*72|0)+8|0;t=d+(o*72|0)+24|0;c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];X6(q|0,s|0,16)|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];p=d+(k*72|0)+24|0;q=d+(i*72|0)+24|0;s=d+(m*72|0)+8|0;c[s>>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];X6(q|0,r|0,16)|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];h[d+(o*72|0)+16>>3]=1073741824.0;h[d+(o*72|0)+8>>3]=1073741824.0;h[d+(m*72|0)+32>>3]=-1073741824.0;h[d+(m*72|0)+24>>3]=-1073741824.0;c[d+(i*72|0)>>2]=a;c[d+(k*72|0)+4>>2]=a;c[d+(i*72|0)+40>>2]=o;c[d+(k*72|0)+40>>2]=o;c[d+(i*72|0)+48>>2]=m;c[d+(k*72|0)+48>>2]=m;c[d+(m*72|0)+40>>2]=k;c[d+(o*72|0)+48>>2]=k;c[d+(m*72|0)+44>>2]=i;c[d+(o*72|0)+52>>2]=i;c[d+(k*72|0)+56>>2]=j;c[d+(i*72|0)+56>>2]=g;c[d+(m*72|0)+56>>2]=l;c[d+(o*72|0)+56>>2]=n;c[d+(i*72|0)+68>>2]=1;c[d+(k*72|0)+68>>2]=1;c[d+(o*72|0)+68>>2]=1;c[d+(m*72|0)+68>>2]=1;c[e+(n*40|0)+24>>2]=o;c[e+(l*40|0)+24>>2]=m;c[e+(j*40|0)+24>>2]=k;c[e+(g*40|0)+24>>2]=i;c[b+(a*56|0)+32>>2]=1;return f|0}function CV(a){a=a|0;var b=0.0;b=+(a|0);a=0;while(1){if(!(b>=1.0))break;b=+x2(b);a=a+1|0;}return a+-1|0}function DV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+(a|0);c=d;a=0;while(1){if((a|0)>=(b|0))break;c=+x2(c);a=a+1|0;}return ~~+N(+(d/c))|0}function EV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0;W=l;l=l+96|0;S=W+32|0;f=W+16|0;T=W;s=S;k=b+(a*56|0)|0;r=s+56|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));U=S+16|0;V=S+24|0;i=+h[V>>3];H=S+8|0;j=+h[H>>3];do if(!(i>j+1.0e-07)){if(!(i>3]>+h[S>>3]:0){G=4;break}G=(IV(a,b,1)|0)==0;f=c[S+36>>2]|0;if(G){n=0;G=7;}else {f=GV(S,U,f,b,e)|0;G=20;}}else G=4;while(0);if((G|0)==4){c[f>>2]=c[S>>2];c[f+4>>2]=c[S+4>>2];c[f+8>>2]=c[S+8>>2];c[f+12>>2]=c[S+12>>2];c[S>>2]=c[U>>2];c[S+4>>2]=c[U+4>>2];c[S+8>>2]=c[U+8>>2];c[S+12>>2]=c[U+12>>2];c[U>>2]=c[f>>2];c[U+4>>2]=c[f+4>>2];c[U+8>>2]=c[f+8>>2];c[U+12>>2]=c[f+12>>2];E=S+36|0;F=c[E>>2]|0;G=S+40|0;f=c[G>>2]|0;c[E>>2]=f;c[G>>2]=F;if(!(IV(a,b,2)|0)){n=1;G=7;}else {f=GV(S,U,f,b,e)|0;G=19;}}if((G|0)==7){m=GV(S,U,f,b,e)|0;f=JV(d)|0;c[d+(f*72|0)+68>>2]=1;s=d+(f*72|0)|0;k=d+(m*72|0)|0;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));q=+h[H>>3];h[d+(f*72|0)+16>>3]=q;h[d+(m*72|0)+32>>3]=q;q=+h[S>>3];h[d+(f*72|0)+8>>3]=q;h[d+(m*72|0)+24>>3]=q;c[d+(m*72|0)+48>>2]=f;c[d+(m*72|0)+52>>2]=0;c[d+(f*72|0)+40>>2]=m;c[d+(f*72|0)+44>>2]=0;g=c[d+(f*72|0)+48>>2]|0;if((g|0)>0){k=d+(g*72|0)+40|0;if((c[k>>2]|0)==(m|0))c[k>>2]=f;g=d+(g*72|0)+44|0;if((c[g>>2]|0)==(m|0))c[g>>2]=f;}g=c[d+(f*72|0)+52>>2]|0;if((g|0)>0){k=d+(g*72|0)+40|0;if((c[k>>2]|0)==(m|0))c[k>>2]=f;g=d+(g*72|0)+44|0;if((c[g>>2]|0)==(m|0))c[g>>2]=f;}E=KV()|0;G=KV()|0;F=d+(m*72|0)+56|0;D=c[F>>2]|0;c[e+(D*40|0)>>2]=2;C=e+(D*40|0)+8|0;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[e+(D*40|0)+4>>2]=a;c[e+(D*40|0)+32>>2]=G;c[e+(D*40|0)+36>>2]=E;c[e+(E*40|0)>>2]=3;c[e+(E*40|0)+24>>2]=m;c[e+(E*40|0)+28>>2]=D;c[e+(G*40|0)>>2]=3;c[e+(G*40|0)+24>>2]=f;c[e+(G*40|0)+28>>2]=D;c[F>>2]=E;c[d+(f*72|0)+56>>2]=G;if(n)G=19;else G=20;}if((G|0)==19)if(!(IV(a,b,1)|0)){g=1;G=21;}else {g=1;G=32;}else if((G|0)==20)if(!(IV(a,b,2)|0)){g=0;G=21;}else {g=0;G=32;}if((G|0)==21){o=GV(U,S,c[S+40>>2]|0,b,e)|0;n=JV(d)|0;c[d+(n*72|0)+68>>2]=1;s=d+(n*72|0)|0;k=d+(o*72|0)|0;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));q=+h[V>>3];h[d+(n*72|0)+16>>3]=q;h[d+(o*72|0)+32>>3]=q;q=+h[U>>3];h[d+(n*72|0)+8>>3]=q;h[d+(o*72|0)+24>>3]=q;c[d+(o*72|0)+48>>2]=n;c[d+(o*72|0)+52>>2]=0;c[d+(n*72|0)+40>>2]=o;c[d+(n*72|0)+44>>2]=0;k=c[d+(n*72|0)+48>>2]|0;if((k|0)>0){m=d+(k*72|0)+40|0;if((c[m>>2]|0)==(o|0))c[m>>2]=n;k=d+(k*72|0)+44|0;if((c[k>>2]|0)==(o|0))c[k>>2]=n;}k=c[d+(n*72|0)+52>>2]|0;if((k|0)>0){m=d+(k*72|0)+40|0;if((c[m>>2]|0)==(o|0))c[m>>2]=n;k=d+(k*72|0)+44|0;if((c[k>>2]|0)==(o|0))c[k>>2]=n;}D=KV()|0;F=KV()|0;E=d+(o*72|0)+56|0;C=c[E>>2]|0;c[e+(C*40|0)>>2]=2;A=e+(C*40|0)+8|0;c[A>>2]=c[U>>2];c[A+4>>2]=c[U+4>>2];c[A+8>>2]=c[U+8>>2];c[A+12>>2]=c[U+12>>2];c[e+(C*40|0)+4>>2]=a;c[e+(C*40|0)+32>>2]=F;c[e+(C*40|0)+36>>2]=D;c[e+(D*40|0)>>2]=3;c[e+(D*40|0)+24>>2]=o;c[e+(D*40|0)+28>>2]=C;c[e+(F*40|0)>>2]=3;c[e+(F*40|0)+24>>2]=n;c[e+(F*40|0)+28>>2]=C;c[E>>2]=D;c[d+(n*72|0)+56>>2]=F;F=f;f=0;}else if((G|0)==32){F=f;o=GV(U,S,c[S+40>>2]|0,b,e)|0;f=1;}a:do if((F|0)>0){D=d+(o*72|0)+24|0;E=d+(o*72|0)+32|0;C=(f|0)!=0;y=g?b+(a*56|0)+48|0:b+(a*56|0)+44|0;z=T+8|0;g=0;f=0;x=F;b:while(1){k=d+(x*72|0)|0;v=d+(x*72|0)+24|0;if(!(LV(v,D)|0))break a;m=d+(x*72|0)+56|0;u=c[m>>2]|0;n=KV()|0;p=KV()|0;c[e+(u*40|0)>>2]=1;c[e+(u*40|0)+4>>2]=a;c[e+(u*40|0)+32>>2]=n;c[e+(u*40|0)+36>>2]=p;c[e+(n*40|0)>>2]=3;c[e+(n*40|0)+24>>2]=x;c[e+(n*40|0)+28>>2]=u;c[e+(p*40|0)>>2]=3;w=JV(d)|0;c[e+(p*40|0)+24>>2]=w;A=d+(w*72|0)|0;c[d+(w*72|0)+68>>2]=1;c[e+(p*40|0)+28>>2]=u;g=(x|0)==(F|0)?w:g;u=d+(x*72|0)+32|0;if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0)f=w;s=A;r=s+72|0;do{c[s>>2]=c[k>>2];s=s+4|0;k=k+4|0;}while((s|0)<(r|0));c[m>>2]=n;c[d+(w*72|0)+56>>2]=p;t=d+(x*72|0)+48|0;m=d+(x*72|0)+52|0;k=(c[m>>2]|0)<1;do if((c[t>>2]|0)<1){if(k)break b;s=d+(x*72|0)+40|0;k=c[s>>2]|0;do if((k|0)>0?(M=d+(x*72|0)+44|0,N=c[M>>2]|0,(N|0)>0):0){r=d+(x*72|0)+60|0;k=c[r>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=N;c[d+(w*72|0)+44>>2]=-1;c[M>>2]=-1;c[d+(N*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=N;c[M>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;p=w;n=N;}else {c[d+(w*72|0)+44>>2]=-1;t=d+(w*72|0)+40|0;c[t>>2]=c[M>>2];n=c[s>>2]|0;c[M>>2]=n;c[s>>2]=k;c[d+(k*72|0)+48>>2]=x;p=x;k=c[t>>2]|0;}c[d+(n*72|0)+48>>2]=p;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[r>>2]=0;}else G=77;while(0);do if((G|0)==77){G=0;n=d+(k*72|0)+48|0;p=c[n>>2]|0;k=d+(k*72|0)+52|0;if((p|0)>0?(c[k>>2]|0)>0:0){k=c[d+(p*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[s>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;break}c[n>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[y>>2]|0;if((k|0)>0?(HV(k,b,S)|0)!=0:0){c[d+((c[m>>2]|0)*72|0)+40>>2]=x;n=d+(w*72|0)+52|0;k=w;}else {c[d+((c[d+(w*72|0)+52>>2]|0)*72|0)+44>>2]=w;n=m;k=x;}c[n>>2]=-1;c[d+(k*72|0)+48>>2]=-1;k=c[m>>2]|0;break}k=c[m>>2]|0;m=d+(k*72|0)+40|0;n=c[m>>2]|0;p=d+(k*72|0)+44|0;if((n|0)>0?(O=c[p>>2]|0,P=(n|0)==(x|0),(O|0)>0):0){c[d+(k*72|0)+60>>2]=P?O:n;c[d+(k*72|0)+64>>2]=P?1:2;}c[m>>2]=x;c[p>>2]=w;}else {if(!k){i=+h[u>>3];j=+h[H>>3];q=i-j;if(!(+B(+q)<=1.0e-07)){h[z>>3]=i;i=+h[S>>3];h[T>>3]=(+h[U>>3]-i)*(q/(+h[V>>3]-j))+i;s=(MV(T,v)|0)!=0;}else s=+h[v>>3]>+h[S>>3];r=d+(x*72|0)+40|0;k=c[r>>2]|0;do if((k|0)>0?(Q=d+(x*72|0)+44|0,R=c[Q>>2]|0,(R|0)>0):0){p=d+(x*72|0)+60|0;k=c[p>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=R;c[d+(w*72|0)+44>>2]=-1;c[Q>>2]=-1;c[d+(R*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=R;c[Q>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[r>>2]|0)*72|0)+48>>2]=x;n=w;m=R;}else {c[d+(w*72|0)+44>>2]=-1;X=d+(w*72|0)+40|0;c[X>>2]=c[Q>>2];m=c[r>>2]|0;c[Q>>2]=m;c[r>>2]=k;c[d+(k*72|0)+48>>2]=x;n=x;k=c[X>>2]|0;}c[d+(m*72|0)+48>>2]=n;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[p>>2]=0;}else G=106;while(0);do if((G|0)==106){G=0;m=d+(k*72|0)+48|0;n=c[m>>2]|0;k=d+(k*72|0)+52|0;if((n|0)>0?(c[k>>2]|0)>0:0){k=c[d+(n*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[r>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[r>>2]|0)*72|0)+48>>2]=x;break}c[m>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[t>>2]|0;c[d+(k*72|0)+40>>2]=x;c[d+(k*72|0)+44>>2]=-1;k=d+(x*72|0)+52|0;X=c[k>>2]|0;c[d+(X*72|0)+40>>2]=w;c[d+(X*72|0)+44>>2]=-1;c[d+(w*72|0)+48>>2]=X;c[d+(w*72|0)+52>>2]=-1;c[k>>2]=-1;k=-1;}else G=116;do if((G|0)==116){G=0;k=c[t>>2]|0;c[d+(k*72|0)+40>>2]=x;m=d+(k*72|0)+44|0;if(s){c[m>>2]=w;X=d+(x*72|0)+52|0;v=c[X>>2]|0;c[d+(v*72|0)+40>>2]=w;c[d+(v*72|0)+44>>2]=-1;c[X>>2]=-1;break}else {c[m>>2]=-1;k=d+(x*72|0)+52|0;X=c[k>>2]|0;c[d+(X*72|0)+40>>2]=x;c[d+(X*72|0)+44>>2]=w;c[d+(w*72|0)+48>>2]=X;c[d+(w*72|0)+52>>2]=-1;k=c[k>>2]|0;break}}while(0);break}s=d+(x*72|0)+40|0;k=c[s>>2]|0;do if((k|0)>0?(I=d+(x*72|0)+44|0,J=c[I>>2]|0,(J|0)>0):0){r=d+(x*72|0)+60|0;k=c[r>>2]|0;if((k|0)<=0){c[d+(w*72|0)+40>>2]=J;c[d+(w*72|0)+44>>2]=-1;c[I>>2]=-1;c[d+(J*72|0)+48>>2]=w;break}if((c[d+(x*72|0)+64>>2]|0)==1){c[d+(w*72|0)+40>>2]=J;c[I>>2]=-1;c[d+(w*72|0)+44>>2]=k;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;p=w;n=J;}else {c[d+(w*72|0)+44>>2]=-1;X=d+(w*72|0)+40|0;c[X>>2]=c[I>>2];n=c[s>>2]|0;c[I>>2]=n;c[s>>2]=k;c[d+(k*72|0)+48>>2]=x;p=x;k=c[X>>2]|0;}c[d+(n*72|0)+48>>2]=p;c[d+(k*72|0)+48>>2]=w;c[d+(w*72|0)+60>>2]=0;c[r>>2]=0;}else G=51;while(0);do if((G|0)==51){G=0;n=d+(k*72|0)+48|0;p=c[n>>2]|0;k=d+(k*72|0)+52|0;if((p|0)>0?(c[k>>2]|0)>0:0){k=c[d+(p*72|0)+4>>2]|0;if((k|0)>0?(HV(k,b,U)|0)==0:0){c[d+(w*72|0)+44>>2]=-1;c[d+(x*72|0)+44>>2]=-1;c[s>>2]=-1;c[d+((c[d+(w*72|0)+40>>2]|0)*72|0)+52>>2]=w;break}c[d+(x*72|0)+44>>2]=-1;c[d+(w*72|0)+44>>2]=-1;c[d+(w*72|0)+40>>2]=-1;c[d+((c[s>>2]|0)*72|0)+48>>2]=x;break}c[n>>2]=x;c[k>>2]=w;}while(0);if(+B(+(+h[u>>3]-+h[E>>3]))<=1.0e-07?C&+B(+(+h[v>>3]-+h[D>>3]))<=1.0e-07:0){k=c[y>>2]|0;if((k|0)>0?(HV(k,b,S)|0)!=0:0){c[d+((c[t>>2]|0)*72|0)+40>>2]=x;m=d+(w*72|0)+52|0;k=w;}else {c[d+((c[d+(w*72|0)+48>>2]|0)*72|0)+44>>2]=w;k=x;}c[m>>2]=-1;c[d+(k*72|0)+48>>2]=-1;k=c[t>>2]|0;break}k=c[t>>2]|0;m=d+(k*72|0)+40|0;n=c[m>>2]|0;p=d+(k*72|0)+44|0;if((n|0)>0?(K=c[p>>2]|0,L=(n|0)==(x|0),(K|0)>0):0){c[d+(k*72|0)+60>>2]=L?K:n;c[d+(k*72|0)+64>>2]=L?1:2;}c[m>>2]=x;c[p>>2]=w;}while(0);c[A>>2]=a;c[d+(x*72|0)+4>>2]=a;if((k|0)>0)x=k;else break a}U4(138424,19,1,c[15712]|0)|0;}else {g=0;f=0;}while(0);NV(a,F,o,1,d,e);NV(a,g,f,2,d,e);c[b+(a*56|0)+32>>2]=1;l=W;return}function FV(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(!(c[b+(a*56|0)+32>>2]|0)){f=b+(a*56|0)|0;g=b+(a*56|0)+16|0;h=b+(a*56|0)+36|0;c[h>>2]=c[d+((GV(f,g,c[h>>2]|0,b,e)|0)*72|0)+56>>2];a=b+(a*56|0)+40|0;c[a>>2]=c[d+((GV(g,f,c[a>>2]|0,b,e)|0)*72|0)+56>>2];}return}function GV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0,r=0;o=a+8|0;q=b+8|0;a:while(1){b:do switch(c[f+(d*40|0)>>2]|0){case 3:{r=3;break a}case 2:{g=+h[o>>3];i=f+(d*40|0)+8|0;j=+h[f+(d*40|0)+16>>3];k=j+1.0e-07;do if(!(g>k)){l=j+-1.0e-07;if(!(g>3]>+h[i>>3]:0)break;if(+B(+(g-j))<=1.0e-07?(m=+h[i>>3],+B(+(+h[a>>3]-m))<=1.0e-07):0){g=+h[q>>3];do if(!(g>k)){if(!(g>3]>m:0)break;d=f+(d*40|0)+32|0;break b}while(0);d=f+(d*40|0)+36|0;break b}d=f+(d*40|0)+32|0;break b}while(0);d=f+(d*40|0)+36|0;break}case 1:{g=+h[o>>3];i=c[f+(d*40|0)+4>>2]|0;if(+B(+(g-+h[e+(i*56|0)+8>>3]))<=1.0e-07?(n=+h[a>>3],+B(+(n-+h[e+(i*56|0)>>3]))<=1.0e-07):0)j=n;else r=19;do if((r|0)==19){r=0;if(+B(+(g-+h[e+(i*56|0)+24>>3]))<=1.0e-07?(p=+h[a>>3],+B(+(p-+h[e+(i*56|0)+16>>3]))<=1.0e-07):0){j=p;break}if(!(HV(i,e,a)|0)){d=f+(d*40|0)+36|0;break b}else {d=f+(d*40|0)+32|0;break b}}while(0);if(!(+B(+(g-+h[q>>3]))<=1.0e-07))if(!(HV(i,e,b)|0)){d=f+(d*40|0)+36|0;break b}else {d=f+(d*40|0)+32|0;break b}else if(+h[b>>3]>2]|0;}if((r|0)==3)return c[f+(d*40|0)+24>>2]|0;else if((r|0)==31){U4(138358,35,1,c[15712]|0)|0;qa(138394,138396,349,138408);}return 0}function HV(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0.0;f=b+(a*56|0)+16|0;g=+h[b+(a*56|0)+24>>3];i=b+(a*56|0)|0;e=+h[b+(a*56|0)+8>>3];do if(!(g>e+1.0e-07)){if(!(g>3]>+h[i>>3]:0){j=4;break}d=+h[c+8>>3];if(+B(+(g-d))<=1.0e-07){d=+h[c>>3]<+h[f>>3]?1.0:-1.0;break}if(!(+B(+(e-d))<=1.0e-07)){k=+h[f>>3];d=(+h[i>>3]-k)*(d-g)-(+h[c>>3]-k)*(e-g);break}else {d=+h[c>>3]<+h[i>>3]?1.0:-1.0;break}}else j=4;while(0);do if((j|0)==4){d=+h[c+8>>3];if(+B(+(g-d))<=1.0e-07){d=+h[c>>3]<+h[f>>3]?1.0:-1.0;break}if(!(+B(+(e-d))<=1.0e-07)){k=+h[i>>3];d=(+h[f>>3]-k)*(d-e)-(+h[c>>3]-k)*(g-e);break}else {d=+h[c>>3]<+h[i>>3]?1.0:-1.0;break}}while(0);return d>0.0|0}function IV(a,b,d){a=a|0;b=b|0;d=d|0;return c[b+((c[((d|0)==1?b+(a*56|0)+48|0:b+(a*56|0)+44|0)>>2]|0)*56|0)+32>>2]|0}function JV(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=c[47395]|0;if((b|0)<(c[47394]|0)){c[a+(b*72|0)>>2]=-1;c[a+(b*72|0)+4>>2]=-1;c[a+(b*72|0)+68>>2]=1;c[47395]=b+1;l=e;return b|0}else {e=c[15712]|0;c[d>>2]=b;w4(e,138483,d)|0;qa(138394,138396,88,138521);}return 0}function KV(){var a=0;a=c[47396]|0;if((a|0)<(c[47393]|0)){c[47396]=a+1;return a|0}else {U4(138444,30,1,c[15712]|0)|0;qa(138394,138396,72,138475);}return 0}function LV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(c>d+1.0e-07))if(c>3]>=+h[b>>3]&1;else a=1;return a|0}function MV(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(cd+1.0e-07)a=0;else a=+h[a>>3]<+h[b>>3]&1;else a=1;return a|0}function NV(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=f+(d*72|0)+24|0;p=(e|0)==1;a:while(1){o=f+(b*72|0)+24|0;j=f+(b*72|0)+48|0;k=f+(b*72|0)+52|0;l=f+(b*72|0)|0;m=f+(b*72|0)+4|0;n=f+(b*72|0)+56|0;if((b|0)<=0)break;while(1){if(!(LV(o,q)|0))break a;d=c[j>>2]|0;e=(d|0)>0;do if(p){if(e?(c[f+(d*72|0)+4>>2]|0)==(a|0):0)break;d=c[k>>2]|0;if((d|0)<=0){b=d;continue a}if((c[f+(d*72|0)+4>>2]|0)!=(a|0)){b=d;continue a}}else {if(e?(c[f+(d*72|0)>>2]|0)==(a|0):0)break;d=c[k>>2]|0;if((d|0)<=0){b=d;continue a}if((c[f+(d*72|0)>>2]|0)!=(a|0)){b=d;continue a}}while(0);if((c[l>>2]|0)!=(c[f+(d*72|0)>>2]|0)){b=d;continue a}if((c[m>>2]|0)!=(c[f+(d*72|0)+4>>2]|0)){b=d;continue a}r=c[f+(d*72|0)+56>>2]|0;e=c[g+(r*40|0)+28>>2]|0;h=g+(e*40|0)+32|0;i=c[n>>2]|0;if((c[h>>2]|0)==(r|0))c[h>>2]=i;else c[g+(e*40|0)+36>>2]=i;e=c[f+(d*72|0)+48>>2]|0;c[j>>2]=e;do if((e|0)>0){h=f+(e*72|0)+40|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=b;break}e=f+(e*72|0)+44|0;if((c[e>>2]|0)==(d|0))c[e>>2]=b;}while(0);e=c[f+(d*72|0)+52>>2]|0;c[k>>2]=e;do if((e|0)>0){h=f+(e*72|0)+40|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=b;break}e=f+(e*72|0)+44|0;if((c[e>>2]|0)==(d|0))c[e>>2]=b;}while(0);r=f+(d*72|0)+24|0;c[o>>2]=c[r>>2];c[o+4>>2]=c[r+4>>2];c[o+8>>2]=c[r+8>>2];c[o+12>>2]=c[r+12>>2];c[f+(d*72|0)+68>>2]=2;}}return}function OV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[d+8>>3];do if(!(e>f+1.0e-07)){if(!(+B(+(e-f))<=1.0e-07)){c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}if(+h[b>>3]>+h[d>>3]+1.0e-07){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}while(0);return}function PV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+h[b+8>>3];f=+h[d+8>>3];do if(!(e>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}if(+h[b>>3]<+h[d>>3]){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}while(0);return}function QV(a){a=a|0;var b=0;b=JK(8)|0;if(b|0){c[b+4>>2]=a;c[b>>2]=0;}return b|0}function RV(a,b){a=a|0;b=b|0;if(b){b=QV(b)|0;c[b>>2]=a;a=b;}return a|0}function SV(a){a=a|0;var b=0;do{b=a;a=c[a>>2]|0;U1(b);}while((a|0)!=0);return}function TV(){var a=0;a=JK(1992)|0;if(a|0)c[a>>2]=UV(a)|0;return a|0}function UV(a){a=a|0;var b=0;b=_V(a)|0;c[b+4>>2]=0;a=a+1972|0;c[a>>2]=(c[a>>2]|0)+1;return b|0}function VV(a){a=a|0;WV(a,c[a>>2]|0);U1(c[a>>2]|0);U1(a);return 0}function WV(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=a+1980|0;h=a+1912|0;i=a+1936|0;a:do if((c[b+4>>2]|0)>0){d=0;while(1){if((d|0)==64)break a;e=b+8+(d*20|0)+16|0;f=c[e>>2]|0;if(f|0?(WV(a,f),U1(c[e>>2]|0),eW(b,d),c[g>>2]=(c[g>>2]|0)+-1,c[h>>2]|0):0)c[i>>2]=(c[i>>2]|0)+1;d=d+1|0;}}else {d=0;while(1){if((d|0)==64)break a;if(c[b+8+(d*20|0)+16>>2]|0?(eW(b,d),c[g>>2]=(c[g>>2]|0)+-1,c[h>>2]|0):0)c[i>>2]=(c[i>>2]|0)+1;d=d+1|0;}}while(0);return}function XV(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;if(!b)qa(138879,138529,194,138537);e=c[b+4>>2]|0;if((e|0)<=-1)qa(138549,138529,195,138537);if(!d)qa(138821,138529,196,138537);i=a+1952|0;c[i>>2]=(c[i>>2]|0)+1;a:do if((e|0)>0){i=0;e=0;while(1){if((i|0)==64)break a;f=b+8+(i*20|0)+16|0;if((c[f>>2]|0)!=0?(jW(d,b+8+(i*20|0)|0)|0)!=0:0){g=XV(a,c[f>>2]|0,d)|0;if(!e)e=g;else {f=e;while(1){h=c[f>>2]|0;if(!h)break;else f=h;}c[f>>2]=g;}}i=i+1|0;}}else {g=0;e=0;while(1){if((g|0)==64)break a;f=b+8+(g*20|0)|0;if((c[b+8+(g*20|0)+16>>2]|0)!=0?(jW(d,f)|0)!=0:0)e=RV(e,f)|0;g=g+1|0;}}while(0);return e|0}function YV(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+64|0;k=p+52|0;m=p+32|0;n=p+16|0;o=p;c[k>>2]=0;if(!((b|0)!=0&(e|0)!=0))qa(138735,138529,247,138563);if((f|0)>-1?(j=c[e>>2]|0,(c[j+4>>2]|0)>=(f|0)):0){g=0;while(1){if((g|0)>=2)break;if((c[b+(g<<2)>>2]|0)>(c[b+(g+2<<2)>>2]|0)){h=8;break}else g=g+1|0;}if((h|0)==8)qa(138610,138529,250,138563);i=a+1912|0;g=a+1908|0;h=c[g>>2]|0;if(c[i>>2]|0){q=h|0?a+1924|0:a+1916|0;c[q>>2]=(c[q>>2]|0)+1;}if(!h){q=a+1964|0;c[q>>2]=(c[q>>2]|0)+1;}if(!(ZV(a,b,d,j,k,f)|0))g=0;else {if(c[i>>2]|0){q=c[g>>2]|0?a+1948|0:a+1944|0;c[q>>2]=(c[q>>2]|0)+1;}g=_V(a)|0;q=a+1976|0;c[q>>2]=(c[q>>2]|0)+1;q=c[e>>2]|0;c[g+4>>2]=(c[q+4>>2]|0)+1;bW(n,q);c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];q=m+16|0;c[q>>2]=c[e>>2];dW(a,m,g,0)|0;bW(o,c[k>>2]|0);c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[q>>2]=c[k>>2];dW(a,m,g,0)|0;c[e>>2]=g;g=a+1980|0;c[g>>2]=(c[g>>2]|0)+2;g=1;}l=p;return g|0}qa(138575,138529,248,138563);return 0}function ZV(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+80|0;m=q+52|0;n=q+48|0;o=q+32|0;p=q+16|0;k=q;c[n>>2]=0;if(!((b|0)!=0&(e|0)!=0&(f|0)!=0))qa(138653,138529,311,138667);if((g|0)>-1?(i=e+4|0,h=c[i>>2]|0,(h|0)>=(g|0)):0){if(c[a+1912>>2]|0){h=c[a+1908>>2]|0?a+1948|0:a+1944|0;c[h>>2]=(c[h>>2]|0)+1;h=c[i>>2]|0;}do if((h|0)>(g|0)){i=cW(b,e)|0;h=e+8+(i*20|0)+16|0;i=e+8+(i*20|0)|0;if(!(ZV(a,b,d,c[h>>2]|0,n,g)|0)){iW(o,b,i);c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];j=0;break}else {bW(p,c[h>>2]|0);c[i>>2]=c[p>>2];c[i+4>>2]=c[p+4>>2];c[i+8>>2]=c[p+8>>2];c[i+12>>2]=c[p+12>>2];j=c[n>>2]|0;c[m+16>>2]=j;bW(k,j);c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];j=a+1980|0;c[j>>2]=(c[j>>2]|0)+1;j=dW(a,m,e,f)|0;break}}else if((h|0)==(g|0)){c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];c[m+16>>2]=d;j=a+1980|0;c[j>>2]=(c[j>>2]|0)+1;j=dW(a,m,e,f)|0;break}else qa(138712,138529,341,138667);while(0);l=q;return j|0}qa(138680,138529,312,138667);return 0}function _V(a){a=a|0;a=a+1968|0;c[a>>2]=(c[a>>2]|0)+1;a=T1(1288)|0;$V(a);return a|0}function $V(a){a=a|0;var b=0;c[a>>2]=0;c[a+4>>2]=-1;b=0;while(1){if((b|0)==64)break;aW(a+8+(b*20|0)|0);b=b+1|0;}return}function aW(a){a=a|0;fW(a);c[a+16>>2]=0;return}function bW(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;g=i+16|0;h=i;if(!b)qa(138879,138718,99,138725);fW(g);d=1;f=0;while(1){if((f|0)==64)break;do if(c[b+8+(f*20|0)+16>>2]|0){e=b+8+(f*20|0)|0;if(!d){iW(h,g,e);c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];c[g+8>>2]=c[h+8>>2];c[g+12>>2]=c[h+12>>2];d=0;break}else {c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];d=0;break}}while(0);f=f+1|0;}c[a>>2]=c[g>>2];c[a+4>>2]=c[g+4>>2];c[a+8>>2]=c[g+8>>2];c[a+12>>2]=c[g+12>>2];l=i;return}function cW(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;k=l;l=l+32|0;i=k+16|0;j=k;if(!((a|0)!=0&(b|0)!=0))qa(138735,138718,125,138742);d=0;e=0;f=0;g=1;h=0;while(1){if((h|0)==64)break;if(c[b+8+(h*20|0)+16>>2]|0){n=b+8+(h*20|0)|0;p=hW(n)|0;iW(j,a,n);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];n=(hW(i)|0)-p|0;m=(g|0)!=0|(n|0)<(f|0);o=m|(p|0)<(e|0)&(n|0)==(f|0);d=o?h:d;e=o?p:e;f=o?n:f;g=m?0:g;}h=h+1|0;}l=k;return d|0}function dW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(!b)qa(138901,138718,167,138753);if(!d)qa(138879,138718,168,138753);do if((c[d>>2]|0)<64){a=0;while(1){if((a|0)>=64){e=10;break}if(!(c[d+8+(a*20|0)+16>>2]|0)){e=8;break}a=a+1|0;}if((e|0)==8){f=d+8+(a*20|0)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[b+16>>2];f=0;g=d;break}else if((e|0)==10)qa(138763,138718,178,138753);}else {if(c[a+1912>>2]|0){h=c[a+1908>>2]|0?a+1948|0:a+1944|0;c[h>>2]=(c[h>>2]|0)+1;}if(!e)qa(138776,138718,187,138753);else {kW(a,d,b,e);f=1;g=(c[d+4>>2]|0)==0?a+1972|0:a+1976|0;break}}while(0);c[g>>2]=(c[g>>2]|0)+1;return f|0}function eW(a,b){a=a|0;b=b|0;if(!((a|0)!=0&b>>>0<64))qa(138780,138718,201,138808);if(!(c[a+8+(b*20|0)+16>>2]|0))qa(139302,138718,202,138808);else {aW(a+8+(b*20|0)|0);c[a>>2]=(c[a>>2]|0)+-1;return}}function fW(a){a=a|0;var b=0;b=0;while(1){if((b|0)==4)break;c[a+(b<<2)>>2]=0;b=b+1|0;}return}function gW(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;c[d>>2]=1;c[d+8>>2]=-1;b=1;while(1){if((b|0)==2)break;c[d+(b+2<<2)>>2]=0;c[d+(b<<2)>>2]=0;b=b+1|0;}c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];l=e;return}function hW(a){a=a|0;var b=0,d=0,e=0;if(!a)qa(138821,138823,128,138835);a:do if((c[a>>2]|0)>(c[a+8>>2]|0))b=0;else {b=1;d=0;while(1){if((d|0)==2)break a;e=O(c[a+(d+2<<2)>>2]|0,b)|0;b=e-(c[a+(d<<2)>>2]|0)|0;d=d+1|0;}}while(0);return b|0}function iW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;g=l;l=l+16|0;f=g;if(!((b|0)!=0&(d|0)!=0))qa(138844,138823,195,138852);do if((c[b>>2]|0)>(c[b+8>>2]|0)){c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];}else {if((c[d>>2]|0)>(c[d+8>>2]|0)){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else e=0;while(1){if((e|0)==2)break;j=c[b+(e<<2)>>2]|0;h=c[d+(e<<2)>>2]|0;c[f+(e<<2)>>2]=(j|0)<(h|0)?j:h;h=e+2|0;j=c[b+(h<<2)>>2]|0;i=c[d+(h<<2)>>2]|0;c[f+(h<<2)>>2]=(j|0)>(i|0)?j:i;e=e+1|0;}c[a>>2]=c[f>>2];c[a+4>>2]=c[f+4>>2];c[a+8>>2]=c[f+8>>2];c[a+12>>2]=c[f+12>>2];}while(0);l=g;return}function jW(a,b){a=a|0;b=b|0;var d=0,e=0;if((a|0)!=0&(b|0)!=0)d=0;else qa(138864,138823,216,138871);while(1){if((d|0)>=2){d=1;break}e=d+2|0;if((c[a+(d<<2)>>2]|0)>(c[b+(e<<2)>>2]|0)){d=0;break}if((c[b+(d<<2)>>2]|0)>(c[a+(e<<2)>>2]|0)){d=0;break}else d=d+1|0;}return d|0}function kW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0;if(!b)qa(138879,138881,40,138891);if(!d)qa(138901,138881,41,138891);j=a+1912|0;if(c[j>>2]|0){i=c[a+1908>>2]|0?a+1932|0:a+1928|0;c[i>>2]=(c[i>>2]|0)+1;}h=b+4|0;i=c[h>>2]|0;lW(a,b,d);d=a+1324|0;mW(a);f=hW(a+1852|0)|0;f=(hW(a+1868|0)|0)+f|0;if(c[j>>2]|0?(f|0)!=0&(c[a+1908>>2]|0)==0:0){j=a+1960|0;g[j>>2]=+((c[a+1320>>2]|0)>>>0)/+(f|0)+ +g[j>>2];}j=_V(a)|0;c[e>>2]=j;c[h>>2]=i;c[j+4>>2]=i;nW(a,b,j,d);if(((c[c[e>>2]>>2]|0)+(c[b>>2]|0)|0)==65)return;else qa(138903,138881,86,138891);}function lW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+16|0;g=h;if(!b)qa(138879,138881,106,139290);if(!d)qa(138901,138881,107,139290);else e=0;while(1){if((e|0)>=64)break;if(!(c[b+8+(e*20|0)+16>>2]|0)){f=7;break}j=b+8+(e*20|0)|0;i=a+4+(e*20|0)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];c[i+16>>2]=c[j+16>>2];e=e+1|0;}if((f|0)==7)qa(139302,138881,111,139290);e=a+4|0;j=a+1284|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];c[j+16>>2]=c[d+16>>2];d=a+1304|0;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];e=1;while(1){if((e|0)==65)break;iW(g,d,a+4+(e*20|0)|0);c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];e=e+1|0;}c[a+1320>>2]=hW(d)|0;$V(b);l=h;return}function mW(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;u=l;l=l+48|0;i=u+32|0;k=u+16|0;m=u;oW(a);pW(a);q=a+1844|0;s=a+1848|0;t=a+1892|0;n=a+1852|0;o=a+1884|0;p=a+1868|0;j=a+1888|0;f=0;e=0;while(1){d=c[q>>2]|0;b=c[s>>2]|0;if((b+d|0)>=65)break;h=65-(c[t>>2]|0)|0;if((d|0)<(h|0)&(b|0)<(h|0)){g=-1;h=0;}else {r=12;break}while(1){if((h|0)==65)break;if(!(c[a+1584+(h<<2)>>2]|0)){v=a+4+(h*20|0)|0;iW(k,v,n);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];b=hW(i)|0;d=c[o>>2]|0;iW(m,v,p);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];v=hW(i)|0;b=v-(c[j>>2]|0)+(d-b)|0;d=(b|0)>-1;b=d?b:0-b|0;d=(d^1)&1;if((b|0)<=(g|0))if((b|0)==(g|0)){v=(c[a+1844+(d<<2)>>2]|0)<(c[a+1844+(f<<2)>>2]|0);b=g;d=v?d:f;e=v?h:e;}else {b=g;d=f;}else e=h;}else {b=g;d=f;}g=b;h=h+1|0;f=d;}qW(a,e,f);}if((r|0)==12){b=(d|0)>=(65-(c[t>>2]|0)|0)&1;d=0;while(1){if((d|0)==65)break;if(!(c[a+1584+(d<<2)>>2]|0))qW(a,d,b);d=d+1|0;}d=c[q>>2]|0;b=c[s>>2]|0;}if((b+d|0)!=65)qa(139046,138881,210,139132);v=c[t>>2]|0;if((d|0)<(v|0)|(b|0)<(v|0))qa(139143,138881,212,139132);else {l=u;return}}function nW(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if(!b)qa(138879,138881,297,138943);if(!d)qa(138953,138881,298,138943);if(!e)qa(138955,138881,299,138943);else f=0;while(1){if((f|0)>=65){e=14;break}e=c[a+1324+(f<<2)>>2]|0;if(e>>>0>=2){e=9;break}switch(e|0){case 0:{dW(a,a+4+(f*20|0)|0,b,0)|0;break}case 1:{dW(a,a+4+(f*20|0)|0,d,0)|0;break}default:{}}f=f+1|0;}if((e|0)==9)qa(138957,138881,303,138943);else if((e|0)==14)return}function oW(a){a=a|0;var b=0,d=0,e=0,f=0;d=l;l=l+16|0;e=d;c[a+1848>>2]=0;c[a+1844>>2]=0;b=a+1852|0;f=a+1868|0;gW(e);c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[a+1888>>2]=0;c[a+1884>>2]=0;b=0;while(1){if((b|0)==65)break;c[a+1584+(b<<2)>>2]=0;c[a+1324+(b<<2)>>2]=-1;b=b+1|0;}l=d;return}function pW(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;o=l;l=l+304|0;k=o+32|0;m=o+16|0;n=o;b=0;while(1){if((b|0)==65)break;c[k+(b<<2)>>2]=hW(a+4+(b*20|0)|0)|0;b=b+1|0;}b=0;d=0;e=0;g=0;a:while(1){if((g|0)==64)break;i=g+1|0;j=a+4+(g*20|0)|0;h=k+(g<<2)|0;f=i;while(1){if((f|0)==65){g=i;continue a}iW(n,j,a+4+(f*20|0)|0);c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];p=hW(m)|0;p=p-(c[h>>2]|0)-(c[k+(f<<2)>>2]|0)|0;q=p>>>0>e>>>0;r=q?f:b;f=f+1|0;b=r;d=q?g:d;e=q?p:e;}}qW(a,d,0);qW(a,b,1);l=o;return}function qW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;e=a+1584+(b<<2)|0;if(c[e>>2]|0)qa(139246,138881,257,139281);c[a+1324+(b<<2)>>2]=d;c[e>>2]=1;g=a+1844+(d<<2)|0;f=a+1852+(d<<4)|0;e=a+4+(b*20|0)|0;if(!(c[g>>2]|0)){c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];}else {iW(h,e,f);c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];}c[a+1884+(d<<2)>>2]=hW(f)|0;c[g>>2]=(c[g>>2]|0)+1;l=i;return}function rW(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1200|0;r=t+800|0;g=t;c[47397]=0;c[47398]=-2;f=r;i=200;n=g;p=0;q=0;o=r;a:while(1){b[o>>1]=p;if((f+(i<<1)+-2|0)>>>0>o>>>0)k=i;else {m=o-f>>1;e=m+1|0;if(i>>>0>9999){s=95;break}k=i<<1;k=k>>>0<1e4?k:1e4;h=T1(k*6|3)|0;if(h){W6(h|0,f|0,e<<1|0)|0;i=h+(k>>>1<<2)|0;W6(i|0,n|0,e<<2|0)|0;if((f|0)==(r|0)){e=0;f=h;}else {U1(f);e=0;f=h;}}else {e=4;i=n;}j=(e|0)==0;h=f+(m<<1)|0;switch((j?((f+(k<<1)+-2|0)>>>0>h>>>0?0:9):e)&15){case 9:{e=1;s=96;break a}case 4:{s=95;break a}case 0:{g=j?i+(m<<2)|0:g;n=i;o=j?h:o;break}default:{e=0;break a}}}if((p|0)==31){e=0;s=96;break}e=b[65534+(p<<1)>>1]|0;j=e<<16>>16;do if(e<<16>>16!=-82){h=c[47398]|0;if((h|0)==-2){h=GX()|0;c[47398]=h;}if((h|0)>=1)if(h>>>0<296)i=d[139321+h>>0]|0;else i=2;else {c[47398]=0;i=0;}h=i+j|0;if(h>>>0<=271?(i|0)==(a[139617+h>>0]|0):0){p=a[139889+h>>0]|0;e=p<<24>>24;if(p<<24>>24<1){h=0-e|0;s=23;break}else {c[47398]=-2;g=g+4|0;c[g>>2]=c[47399];j=(q|0)==0?0:q+-1|0;h=o;break}}else s=22;}else s=22;while(0);if((s|0)==22){s=0;p=a[140161+p>>0]|0;h=p&255;if(!(p<<24>>24)){h=c[47398]|0;b:do switch(q|0){case 0:{c[47397]=(c[47397]|0)+1;MW(143761);h=o;break}case 3:if((h|0)<1)if(!h){e=1;s=96;break a}else {h=o;break b}else {c[47398]=-2;h=o;break b}default:h=o;}while(0);while(1){if(e<<16>>16==8)break;if((h|0)==(f|0)){e=1;s=96;break a}e=h+-2|0;g=g+-4|0;h=e;e=b[65534+(b[e>>1]<<1)>>1]|0;}g=g+4|0;c[g>>2]=c[47399];e=1;j=3;}else s=23;}do if((s|0)==23){s=0;j=d[140277+h>>0]|0;e=c[g+(1-j<<2)>>2]|0;do switch(h|0){case 4:{s=26;break a}case 2:{c[47400]=sW(c[g+-4>>2]|0,2)|0;break}case 3:{c[47400]=sW(c[g+-4>>2]|0,1)|0;break}case 5:{e=uW()|0;break}case 8:{vW(c[47401]|0);break}case 9:{wW(c[g>>2]|0);break}case 18:{xW(c[g>>2]|0);break}case 19:{yW();break}case 20:{xW(c[g>>2]|0);break}case 21:{yW();break}case 22:{xW(c[g>>2]|0);break}case 23:{yW();break}case 24:{xW(c[g>>2]|0);break}case 25:{yW();break}case 26:{xW(c[g>>2]|0);break}case 27:{yW();break}case 28:{xW(c[g>>2]|0);break}case 29:{yW();break}case 30:{xW(c[g>>2]|0);break}case 31:{yW();break}case 32:{xW(c[g>>2]|0);break}case 33:{yW();break}case 34:{e=c[g+-4>>2]|0;break}case 35:{e=c[g>>2]|0;break}case 38:{e=c[47401]|0;i=c[e+4>>2]|0;if(i>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;i=c[47401]|0;e=i;i=c[i+4>>2]|0;}a[i>>0]=0;p=c[e>>2]|0;c[e+4>>2]=p;if(zW(p)|0){s=51;break a}c[(c[g>>2]|0)+80>>2]=c[47402];e=Vz(56032,c[4580]|0)|0;c[(c[g>>2]|0)+84>>2]=e;c[47402]=c[g>>2];c[(c[g>>2]|0)+108>>2]=c[c[47403]>>2];e=c[g>>2]|0;break}case 39:{e=c[47401]|0;i=c[e+4>>2]|0;if(i>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;i=c[47401]|0;e=i;i=c[i+4>>2]|0;}a[i>>0]=0;p=c[e>>2]|0;c[e+4>>2]=p;if(zW(p)|0){s=56;break a}e=c[47402]|0;c[47402]=c[e+80>>2];break}case 40:{e=c[g>>2]|0;break}case 41:{e=c[g+-4>>2]|0;break}case 42:{e=c[g+-4>>2]|0;break}case 43:{e=c[g+-4>>2]|0;break}case 44:{e=c[g+-4>>2]|0;break}case 45:{e=c[g+-4>>2]|0;break}case 48:{e=c[g>>2]|0;break}case 49:{e=c[g>>2]|0;break}case 50:{a[(c[g+-8>>2]|0)+12>>0]=1;e=c[g>>2]|0;break}case 51:{AW();break}case 52:{e=BW()|0;break}case 53:{e=c[g>>2]|0;break}case 54:{e=c[g>>2]|0;break}case 55:{e=(c[g+-8>>2]|0)+100|0;a[e>>0]=a[e>>0]|1;e=c[g>>2]|0;break}case 56:{CW(c[g+-4>>2]|0,c[g>>2]|0,1);break}case 57:{e=c[g+-12>>2]|0;break}case 58:{CW(c[g+-4>>2]|0,c[g>>2]|0,2);break}case 59:{e=c[g+-12>>2]|0;break}case 60:{CW(c[g+-4>>2]|0,c[g>>2]|0,3);break}case 61:{e=c[g+-12>>2]|0;break}case 62:{CW(c[g>>2]|0,uW()|0,2);break}case 63:{e=c[g+-8>>2]|0;break}case 64:{e=c[g+-4>>2]|0;break}case 65:{e=c[g>>2]|0;break}default:{}}while(0);i=0-j|0;p=g+(i<<2)|0;i=o+(i<<1)|0;g=p+4|0;c[p+4>>2]=e;e=(d[140449+h>>0]|0)+-41|0;p=b[i>>1]|0;h=p+(b[65766+(e<<1)>>1]|0)|0;if(h>>>0<272?(a[139617+h>>0]|0)==(p|0):0){e=a[139889+h>>0]|0;j=q;h=i;break}e=a[140519+e>>0]|0;j=q;h=i;}while(0);i=k;p=e;q=j;o=h+2|0;}if((s|0)==26){tW();e=1;s=96;}else if((s|0)==51){MW(140347);tW();e=1;s=96;}else if((s|0)==56){MW(140398);tW();e=1;s=96;}else if((s|0)==95){MW(140558);e=2;s=96;}if((s|0)==96)if((f|0)!=(r|0))U1(f);l=t;return e|0}function sW(b,d){b=b|0;d=d|0;var e=0;e=JK(8)|0;a[e+4>>0]=d;c[e>>2]=b;return e|0}function tW(){var a=0,b=0;a=c[47402]|0;b=c[47400]|0;if(b|0){mU(b,1);c[47400]=0;}c[14021]=67;while(1){if(!a)break;b=c[a+80>>2]|0;GW(a);a=b;}c[14021]=56;c[14030]=68;b=c[47405]|0;nb[c[b>>2]&63](b,0,64)|0;c[14030]=56;c[14039]=69;b=c[47406]|0;nb[c[b>>2]&63](b,0,64)|0;c[14039]=56;JW();return}function uW(){var a=0,d=0,e=0,f=0,g=0,h=0;e=c[47406]|0;f=JK(40)|0;if(Xz(c[47405]|0)|0)wW(0);a=Xz(e)|0;b[f+4>>1]=a;a:do if(!a)a=e;else {c[f>>2]=JK(a*24|0)|0;a=0;d=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!d){a=e;break a}g=(c[f>>2]|0)+(a*24|0)|0;h=d+8|0;c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];c[g+8>>2]=c[h+8>>2];c[g+12>>2]=c[h+12>>2];c[g+16>>2]=c[h+16>>2];c[g+20>>2]=c[h+20>>2];a=a+1|0;d=nb[c[e>>2]&63](e,d,8)|0;}}while(0);nb[c[a>>2]&63](e,0,64)|0;return f|0}function vW(b){b=b|0;var d=0,e=0,f=0;e=JK(64)|0;f=b+4|0;d=c[f>>2]|0;if(d>>>0>=(c[b+8>>2]|0)>>>0){lA(b,1)|0;d=c[f>>2]|0;}a[d>>0]=0;b=c[b>>2]|0;c[f>>2]=b;c[e+8>>2]=D4(b)|0;c[e+12>>2]=c[c[47403]>>2];f=c[47405]|0;nb[c[f>>2]&63](f,e,1)|0;return}function wW(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=JK(32)|0;j=c[47405]|0;e=Xz(j)|0;k=i+8|0;a[i+14>>0]=d;a:do if(!e){c[k>>2]=JK(56)|0;b[i+12>>1]=1;h=D4(195059)|0;k=c[k>>2]|0;c[k>>2]=h;c[k+4>>2]=c[c[47403]>>2];}else {b[i+12>>1]=e;c[k>>2]=JK(e*56|0)|0;d=0;e=Tz(j)|0;while(1){if(!e)break a;f=(c[k>>2]|0)+(d*56|0)|0;g=e+8|0;h=f+56|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));d=d+1|0;e=c[e>>2]|0;}}while(0);nb[c[j>>2]&63](j,0,64)|0;k=c[47406]|0;nb[c[k>>2]&63](k,i,1)|0;return}function xW(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;g=j;i=JK(8)|0;f=c[c[47403]>>2]|0;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[g+16>>2]=c[a+16>>2];c[g+20>>2]=c[a+20>>2];c[g+24>>2]=c[a+24>>2];c[g+28>>2]=c[a+28>>2];if(f|0){a=g+4|0;if((c[a>>2]|0)==0?(b=c[f+4>>2]|0,b|0):0)c[a>>2]=b;a=g+16|0;if(+h[a>>3]<0.0?(d=+h[f+16>>3],d>=0.0):0)h[a>>3]=d;if((c[g>>2]|0)==0?(e=c[f>>2]|0,e|0):0)c[g>>2]=e;a=c[f+24>>2]&127;if(a|0){f=g+24|0;e=c[f>>2]|0;c[f>>2]=e&127|a|e&-128;}}f=c[(c[47404]|0)+144>>2]|0;c[i>>2]=nb[c[f>>2]&63](f,g,1)|0;c[i+4>>2]=c[47403];c[47403]=i;l=j;return}function yW(){var a=0,b=0;b=c[47403]|0;a=c[b+4>>2]|0;U1(b);c[47403]=a;return}function zW(b){b=b|0;var c=0;while(1){c=a[b>>0]|0;if(!(c<<24>>24)){b=0;break}if(c<<24>>24==32)b=b+1|0;else {b=1;break}}return b|0}function AW(){var b=0,d=0,e=0;e=Vz(56068,c[4580]|0)|0;b=c[47402]|0;d=JK(16)|0;c[d+8>>2]=e;if(a[b+112>>0]&2)a[d+12>>0]=1;e=c[b+84>>2]|0;nb[c[e>>2]&63](e,d,1)|0;return}function BW(){var a=0;a=c[(c[47402]|0)+84>>2]|0;return nb[c[a>>2]&63](a,0,256)|0}function CW(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=JK(16)|0;f=c[47402]|0;h=c[f+84>>2]|0;h=c[(nb[c[h>>2]&63](h,0,256)|0)+8>>2]|0;c[g+8>>2]=b;nb[c[h>>2]&63](h,g,1)|0;a[b+92>>0]=e;if(a[f+112>>0]&1)a[b+100>>0]=1;c[b+88>>2]=d;return}function DW(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function EW(a,b,d){a=a|0;b=b|0;d=d|0;Rz(c[b+8>>2]|0)|0;U1(b);return}function FW(a,b,d){a=a|0;b=b|0;d=d|0;KW(c[b+8>>2]|0);U1(b);return}function GW(a){a=a|0;Rz(c[a+84>>2]|0)|0;jU(a);U1(a);return}function HW(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+8>>2]|0);U1(b);return}function IW(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d+12|0;a=b[g>>1]|0;if(a<<16>>16){h=d+8|0;e=0;f=c[h>>2]|0;while(1){if((e|0)>=(a<<16>>16|0))break;U1(c[f>>2]|0);e=e+1|0;f=f+56|0;a=b[g>>1]|0;}U1(c[h>>2]|0);}U1(d);return}function JW(){var a=0,b=0;a=c[47403]|0;while(1){b=c[a+4>>2]|0;if(!b)break;U1(a);a=b;}return}function KW(b){b=b|0;var d=0;d=b+88|0;switch(a[b+92>>0]|0){case 1:{GW(c[d>>2]|0);break}case 2:{kU(c[d>>2]|0);break}default:{}}jU(b);U1(b);return}function LW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+160|0;e=f+8|0;g=f;c[g>>2]=0;c[g+4>>2]=0;c[47403]=g;c[47402]=0;c[47400]=0;c[47404]=c[(c[(c[d+52>>2]|0)+16>>2]|0)+144>>2];c[47405]=Vz(56104,c[4580]|0)|0;c[47406]=Vz(56140,c[4580]|0)|0;kA(e,128,f+24|0);c[47401]=e;if(!(PW(a,e,d)|0)){rW()|0;c[b>>2]=FX()|0;a=c[47400]|0;}Rz(c[47405]|0)|0;Rz(c[47406]|0)|0;c[47405]=0;c[47406]=0;c[47403]=0;oA(e);l=f;return a|0}function MW(b){b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;if(!(a[189661]|0)){a[189661]=1;f=NW()|0;c[d>>2]=b;c[d+4>>2]=f;gA(1,140575,d)|0;OW();}l=e;return}function NW(){return u_(c[47407]|0)|0}function OW(){var b=0,d=0,e=0,f=0;f=l;l=l+16|0;e=f;b=c[47410]|0;c[b+4>>2]=c[b>>2];d=c[47419]|0;if((d|0)>0){mA(b,c[47417]|0,d)|0;b=c[47410]|0;}mA(b,c[47416]|0,c[47418]|0)|0;d=c[47410]|0;b=c[d+4>>2]|0;if(b>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;b=c[47410]|0;d=b;b=c[b+4>>2]|0;}c[d+4>>2]=b+1;a[b>>0]=0;b=c[47410]|0;d=c[b>>2]|0;c[b+4>>2]=d;c[e>>2]=d;gA(3,140591,e)|0;l=f;return}function PW(b,e,f){b=b|0;e=e|0;f=f|0;c[47410]=e;kA(189644,128,0);c[47408]=b;a[189663]=0;a[189660]=0;a[189661]=0;c[47418]=0;c[47419]=0;a[189662]=1;f=f+52|0;e=UY(wK(d[(c[(c[f>>2]|0)+16>>2]|0)+115>>0]|0)|0)|0;c[47407]=e;h_(e,c[(c[(c[f>>2]|0)+16>>2]|0)+144>>2]|0);i_(c[47407]|0,70,27);j_(c[47407]|0,71);return 0}function QW(b,d,e){b=b|0;d=d|0;e=e|0;do if(!(c3(d,140603)|0)){c[47399]=UW(e)|0;a[189662]=0;c[47409]=286;}else {if(c3(d,140609)|0?c3(d,140612)|0:0){if(!(c3(d,140615)|0)){a[189662]=1;c[47399]=VW(e)|0;c[47409]=287;break}if(!(c3(d,140623)|0)){c[47399]=WW(b,e,0)|0;c[47409]=288;break}if(!(c3(d,140628)|0)){c[47399]=WW(b,0,1)|0;c[47409]=290;break}if(!(c3(d,140644)|0)){c[47399]=WW(b,0,32)|0;c[47409]=295;break}if(!(c3(d,140630)|0)){c[47399]=WW(b,0,4)|0;c[47409]=291;break}if(!(c3(d,140632)|0)){c[47399]=WW(b,0,64)|0;c[47409]=292;break}if(!(c3(d,140634)|0)){c[47399]=WW(b,0,2)|0;c[47409]=289;break}if(!(c3(d,140636)|0)){c[47399]=WW(b,0,8)|0;c[47409]=293;break}if(!(c3(d,140640)|0)){c[47399]=WW(b,0,16)|0;c[47409]=294;break}if(!(c3(d,140646)|0)){XW(e);c[47409]=283;break}if(!(c3(d,140649)|0)){c[47409]=277;break}if(!(c3(d,140652)|0)){c[47409]=280;break}if(!(c3(d,140655)|0)){c[47399]=YW(e)|0;c[47409]=285;break}if(!(c3(d,140618)|0)){c[47409]=262;break}else {TW(d);break}}a[189662]=0;c[47409]=260;}while(0);return}function RW(b,d){b=b|0;d=d|0;do if(!(c3(d,140603)|0)){c[47409]=264;a[189662]=1;}else {if(c3(d,140609)|0?c3(d,140612)|0:0){if(!(c3(d,140615)|0)){c[47409]=265;a[189662]=0;break}if(!(c3(d,140618)|0)){c[47409]=263;break}if(!(c3(d,140623)|0)){c[47409]=266;break}if(!(c3(d,140628)|0)){c[47409]=270;break}if(!(c3(d,140630)|0)){c[47409]=271;break}if(!(c3(d,140632)|0)){c[47409]=272;break}if(!(c3(d,140634)|0)){c[47409]=269;break}if(!(c3(d,140636)|0)){c[47409]=273;break}if(!(c3(d,140640)|0)){c[47409]=274;break}if(!(c3(d,140644)|0)){c[47409]=275;break}if(!(c3(d,140646)|0)){c[47409]=(c[47409]|0)==283?282:258;break}if(!(c3(d,140649)|0)){c[47409]=(c[47409]|0)==277?276:278;break}if(!(c3(d,140652)|0)){c[47409]=(c[47409]|0)==280?279:281;break}if(!(c3(d,140655)|0)){c[47409]=(c[47409]|0)==285?284:259;break}else {TW(d);break}}c[47409]=261;}while(0);return}function SW(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(a[189662]|0){b=0;while(1){if(!e)break;h=d+1|0;g=a[d>>0]|0;if((g&255)>31){d=c[47410]|0;f=c[d+4>>2]|0;if(f>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;f=c[47410]|0;d=f;f=c[f+4>>2]|0;}c[d+4>>2]=f+1;a[f>>0]=g;b=b+1|0;}d=h;e=e+-1|0;}if(b|0)c[47409]=267;}return}function TW(b){b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;c[47409]=268;a[189661]=1;f=NW()|0;c[e>>2]=b;c[e+4>>2]=f;gA(1,140659,e)|0;l=d;return}function UW(b){b=b|0;var d=0;d=JK(120)|0;c[d+100>>2]=-1;a[d+88>>0]=-1;ZW(d,56400,22,b,141611);return d|0}function VW(a){a=a|0;var c=0;c=JK(104)|0;b[c+80>>1]=1;b[c+82>>1]=1;ZW(c,56224,22,a,140965);return c|0}function WW(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+32|0;e=f;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=0;c[e+28>>2]=0;h[e+16>>3]=-1.0;c[e+24>>2]=d&127;if(b|0)ZW(e,56200,3,b,140816);d=c[a+144>>2]|0;e=nb[c[d>>2]&63](d,e,1)|0;l=f;return e|0}function XW(a){a=a|0;c[47399]=0;ZW(189596,56192,1,a,140752);return}function YW(a){a=a|0;var b=0;b=JK(40)|0;ZW(b,56176,2,a,140698);return b|0}function ZW(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;m=o+8|0;while(1){k=c[g>>2]|0;if(!k)break;i=c[g+4>>2]|0;c[m>>2]=k;j=u5(m,e,f,8,104)|0;if(!j){c[n>>2]=k;c[n+4>>2]=h;gA(0,140704,n)|0;i=1;}else {i=lb[c[j+4>>2]&127](b,i)|0;i=(i|(d[189660]|0))&255;}a[189660]=i;g=g+8|0;}l=o;return}function _W(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function $W(a,b){a=a|0;b=b|0;c[a+36>>2]=D4(b)|0;return 0}function aX(a,b){a=a|0;b=b|0;c[a+32>>2]=D4(b)|0;return 0}function bX(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=(Y3(a[d>>0]|0)|0)<<24>>24;switch(f|0){case 82:{e=d+1|0;if(!(c3(e,140763)|0)){c[b>>2]=114;e=0;}else h=5;break}case 76:{h=6;break}default:{e=d+1|0;h=5;}}do if((h|0)==5)if(!(c3(e,140768)|0))h=6;else {if((f|0)!=67?(c3(e,140772)|0)==0:0){c[g>>2]=d;gA(0,140778,g)|0;e=1;break}c[b>>2]=110;e=0;}while(0);if((h|0)==6){c[b>>2]=108;e=0;}l=i;return e|0}function cX(a,b){a=a|0;b=b|0;c[a+4>>2]=b;return 0}function dX(a,b){a=a|0;b=b|0;c[a>>2]=b;return 0}function eX(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;if(!(fX(b,140845,0,255,d)|0)){h[a+16>>3]=+(c[d>>2]|0);a=0;}else a=1;l=e;return a|0}function fX(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+48|0;j=k+24|0;i=k+8|0;h=k;m=k+36|0;g=y4(a,m,10)|0;do if((c[m>>2]|0)!=(a|0)){if((g|0)>(e|0)){c[i>>2]=b;c[i+4>>2]=a;c[i+8>>2]=e;gA(0,140887,i)|0;a=1;break}if((g|0)<(d|0)){c[j>>2]=b;c[j+4>>2]=a;c[j+8>>2]=d;gA(0,140926,j)|0;a=1;break}else {c[f>>2]=g;a=0;break}}else {c[h>>2]=b;c[h+4>>2]=a;gA(0,140856,h)|0;a=1;}while(0);l=k;return a|0}function gX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|4;d=0;}else g=9;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|2;d=0;}else g=9;break}case 84:{if(!(c3(e+1|0,141563)|0)){d=d+36|0;b[d>>1]=b[d>>1]|6;d=0;}else g=9;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=9;break}default:g=9;}if((g|0)==9){c[f>>2]=e;gA(0,141567,f)|0;d=1;}l=h;return d|0}function hX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|512;d=0;}else g=7;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|256;d=0;}else g=7;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,141518,f)|0;d=1;}l=h;return d|0}function iX(a,b){a=a|0;b=b|0;c[a+20>>2]=D4(b)|0;return 0}function jX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141511,0,255,f)|0)){a[d+33>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|32;d=0;}else d=1;l=g;return d|0}function kX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141499,0,255,f)|0)){a[d+34>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|64;d=0;}else d=1;l=g;return d|0}function lX(d,e){d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g;if(!(fX(e,141487,-128,127,f)|0)){a[d+32>>0]=c[f>>2];d=d+36|0;b[d>>1]=b[d>>1]|128;d=0;}else d=1;l=g;return d|0}function mX(a,b){a=a|0;b=b|0;c[a+24>>2]=D4(b)|0;return 0}function nX(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=g+4|0;do if(!(fX(d,141442,0,65535,e)|0)){d=c[e>>2]|0;if(!d){gA(0,141450,f)|0;d=1;break}else {b[a+80>>1]=d;d=0;break}}else d=1;while(0);l=g;return d|0}function oX(a,e){a=a|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(d[e>>0]|0)|0)<<24>>24|0){case 84:{if(!(c3(e+1|0,141391)|0)){a=a+36|0;b[a>>1]=b[a>>1]|1;a=0;}else g=5;break}case 70:{if(!(c3(e+1|0,141395)|0))a=0;else g=5;break}default:g=5;}if((g|0)==5){c[f>>2]=e;gA(0,141400,f)|0;a=1;}l=h;return a|0}function pX(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;if(!(fX(b,141377,0,360,d)|0)){c[a+28>>2]=c[d>>2]&65535;a=0;}else a=1;l=e;return a|0}function qX(a,d){a=a|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141370,0,65535,e)|0)){b[a+40>>1]=c[e>>2];a=0;}else a=1;l=f;return a|0}function rX(a,b){a=a|0;b=b|0;c[a>>2]=D4(b)|0;return 0}function sX(a,b){a=a|0;b=b|0;c[a+16>>2]=D4(b)|0;return 0}function tX(a,b){a=a|0;b=b|0;c[a+4>>2]=D4(b)|0;return 0}function uX(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=g+4|0;do if(!(fX(d,141325,0,65535,e)|0)){d=c[e>>2]|0;if(!d){gA(0,141333,f)|0;d=1;break}else {b[a+82>>1]=d;d=0;break}}else d=1;while(0);l=g;return d|0}function vX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;i=k;h=0;a:while(1){b:while(1){g=e+1|0;e=a[e>>0]|0;if(!(e<<24>>24))break a;e=e<<24>>24;f=(d3(e)|0)+-98|0;switch(f>>>1|f<<31|0){case 5:{j=5;break b}case 9:{f=2048;break b}case 8:{j=6;break b}case 0:{j=7;break b}default:{}}c[i>>2]=e;c[i+4>>2]=e;gA(0,141272,i)|0;e=g;}if((j|0)==5){j=0;f=1024;}else if((j|0)==6){j=0;f=4096;}else if((j|0)==7){j=0;f=8192;}e=g;h=h|f;}if(h<<16>>16!=15360){j=d+36|0;b[j>>1]=b[j>>1]|h;}l=k;return 0}function wX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;h=D4(e)|0;g=d+42|0;f=0;e=h;while(1){d=A4(e,141182)|0;if(!d)break;if(((Y3(a[d>>0]|0)|0)&255|0)==82){e=d+1|0;if(!(c3(e,141185)|0)){b[g>>1]=b[g>>1]|4;d=f;e=0;f=d;continue}if(!(c3(e,141192)|0)){b[g>>1]=b[g>>1]|2;d=f;e=0;f=d;continue}else {c[i>>2]=d;gA(0,141198,i)|0;f=1;e=0;continue}}if(!(c3(d,141236)|0)){b[g>>1]=b[g>>1]&-385;d=f;e=0;f=d;continue}if(c3(d,141242)|0?c3(d,141252)|0:0){if(!(c3(d,141258)|0)){b[g>>1]=b[g>>1]|128;d=f;e=0;f=d;continue}if(!(c3(d,141265)|0)){b[g>>1]=b[g>>1]|256;d=f;e=0;f=d;continue}else {c[j>>2]=d;gA(0,141198,j)|0;f=1;e=0;continue}}b[g>>1]=b[g>>1]|32;d=f;e=0;f=d;}U1(h);l=k;return f|0}function xX(a,b){a=a|0;b=b|0;c[a+8>>2]=D4(b)|0;return 0}function yX(a,b){a=a|0;b=b|0;c[a+12>>2]=D4(b)|0;return 0}function zX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 66:{if(!(c3(e+1|0,141128)|0)){d=d+36|0;b[d>>1]=b[d>>1]|16;d=0;}else g=7;break}case 84:{if(!(c3(e+1|0,141134)|0)){d=d+36|0;b[d>>1]=b[d>>1]|8;d=0;}else g=7;break}case 77:{if(!(c3(e+1|0,141137)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,141143,f)|0;d=1;}l=h;return d|0}function AX(a,d){a=a|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141122,0,65535,e)|0)){b[a+38>>1]=c[e>>2];a=0;}else a=1;l=f;return a|0}function BX(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;switch((Y3(a[e>>0]|0)|0)<<24>>24|0){case 76:{if(!(c3(e+1|0,140768)|0)){d=d+36|0;b[d>>1]=b[d>>1]|4;d=0;}else g=7;break}case 82:{if(!(c3(e+1|0,140763)|0)){d=d+36|0;b[d>>1]=b[d>>1]|2;d=0;}else g=7;break}case 67:{if(!(c3(e+1|0,140772)|0))d=0;else g=7;break}default:g=7;}if((g|0)==7){c[f>>2]=e;gA(0,140778,f)|0;d=1;}l=h;return d|0}function CX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(!(fX(d,141720,0,127,e)|0)){a[b+88>>0]=c[e>>2];b=0;}else b=1;l=f;return b|0}function DX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((a[d>>0]|0)==42){b=b+112|0;a[b>>0]=a[b>>0]|1;b=0;}else {c[e>>2]=d;gA(0,141680,e)|0;b=1;}l=f;return b|0}function EX(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((a[d>>0]|0)==42){b=b+112|0;a[b>>0]=a[b>>0]|2;b=0;}else {c[e>>2]=d;gA(0,141643,e)|0;b=1;}l=f;return b|0}function FX(){var b=0;b=(a[189661]|a[189660])<<24>>24;_Y(c[47407]|0);oA(189644);return b|0}function GX(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;c[47409]=0;d=0;a:do{b:do switch(a[189663]|0){case 2:{b=-1;break a}case 0:{a[189663]=1;h=6;b=141732;d=0;break}default:{b=c[47408]|0;if(!(a[b>>0]|0)){a[189663]=2;h=7;b=141739;break b}else {d=HX(b)|0;h=d-b|0;break b}}}while(0);c[47417]=c[47416];c[47419]=c[47418];c[47416]=b;c[47418]=h;e=c[47412]|0;f=e-(c[47411]|0)|0;g=c[47407]|0;if(!f)b=k_(g,b,h,(h|0)==0&1)|0;else {if(e>>>0<(c[47413]|0)>>>0)b=e;else {lA(189644,1)|0;b=c[47412]|0;}a[b>>0]=0;b=c[47411]|0;c[47412]=b;b=k_(g,b,f,0)|0;}if(!((b|0)!=0|(a[189661]|0)!=0)){g=v_(t_(c[47407]|0)|0)|0;h=NW()|0;c[i>>2]=g;c[i+4>>2]=h;gA(1,140575,i)|0;OW();a[189661]=1;c[47409]=268;}if(d|0)c[47408]=d;b=c[47409]|0;}while((b|0)==0);l=j;return b|0}function HX(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;d=b+1|0;e=a[b>>0]|0;a:do if(e<<24>>24==60){e=a[d>>0]|0;if(e<<24>>24==33)if(!(Q2(b+2|0,141747,2)|0)){e=IX(b+4|0)|0;d=e;e=a[e>>0]|0;g=8;}else {e=d;g=5;}else g=6;b:while(1)if((g|0)==5){d=e;e=a[e>>0]|0;g=6;continue}else if((g|0)==6){switch(e<<24>>24){case 62:case 0:{g=8;continue b}default:{}}e=d+1|0;g=5;continue}else if((g|0)==8)if(e<<24>>24==62){g=10;break}else {g=9;break}if((g|0)==9){gA(0,141750,f)|0;a[189660]=1;break}else if((g|0)==10){d=d+1|0;break}}else {d=b;b=e;while(1){switch(b<<24>>24){case 60:case 0:break a;case 38:{e=d+1|0;if((a[e>>0]|0)==35)g=15;else e=$P(e,189644)|0;break}default:g=15;}if((g|0)==15){g=0;e=c[47412]|0;if(e>>>0>=(c[47413]|0)>>>0){lA(189644,1)|0;e=c[47412]|0;}c[47412]=e+1;a[e>>0]=b;e=d+1|0;}d=e;b=a[e>>0]|0;}}while(0);l=h;return d|0}function IX(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;f=1;c=b;a:while(1){e=(f|0)==0;d=c;b:while(1){if(e)break a;g=d+1|0;switch(a[d>>0]|0){case 0:{c=g;break a}case 60:{h=5;break b}case 62:{c=-1;break b}default:d=g;}}if((h|0)==5){h=0;c=1;}f=f+c|0;c=g;}d=c+-1|0;do if(a[d>>0]|0){c=c+-3|0;if(c>>>0>=b>>>0?(Q2(c,141747,2)|0)==0:0)break;gA(0,141791,i)|0;a[189660]=1;}while(0);l=j;return d|0}function JX(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=T1(28)|0;if(!d)d=0;else {e=0;f=0;while(1){if((e|0)>=(b|0))break;r=(c[(c[a+(e<<2)>>2]|0)+4>>2]|0)+f|0;e=e+1|0;f=r;}o=d+8|0;c[o>>2]=KX(f<<4)|0;p=d+12|0;c[p>>2]=KX((b<<2)+4|0)|0;e=f<<2;q=d+16|0;c[q>>2]=KX(e)|0;e=KX(e)|0;r=d+20|0;c[r>>2]=e;c[d+4>>2]=f;c[d>>2]=b;f=0;h=0;while(1){c[(c[p>>2]|0)+(h<<2)>>2]=f;if((h|0)>=(b|0))break;j=a+(h<<2)|0;n=c[j>>2]|0;k=c[n+4>>2]|0;l=f+-1|0;g=0;i=f;m=k;while(1){if((g|0)>=(m|0))break;m=(c[o>>2]|0)+(i<<4)|0;e=(c[n>>2]|0)+(g<<4)|0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];m=i+1|0;c[(c[q>>2]|0)+(i<<2)>>2]=m;e=c[r>>2]|0;c[e+(i<<2)>>2]=i+-1;s=c[j>>2]|0;g=g+1|0;i=m;m=c[s+4>>2]|0;n=s;}s=l+k|0;c[(c[q>>2]|0)+(s<<2)>>2]=f;c[e+(f<<2)>>2]=s;f=i;h=h+1|0;}KY(d);}return d|0}function KX(a){a=a|0;if(!a)a=0;else a=T1(a)|0;return a|0}function LX(a){a=a|0;var b=0,d=0;U1(c[a+8>>2]|0);U1(c[a+12>>2]|0);U1(c[a+16>>2]|0);U1(c[a+20>>2]|0);d=a+24|0;b=c[d>>2]|0;if(b|0){U1(c[b>>2]|0);U1(c[d>>2]|0);}U1(a);return}function MX(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+32|0;m=p+16|0;j=p;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];n=RY(a,d,m)|0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];o=RY(a,f,m)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];m=AY(j,d,n,m,f,o,a)|0;d=c[a+4>>2]|0;j=d+1|0;f=1;h=d;while(1){h=c[m+(h<<2)>>2]|0;k=f+1|0;if((h|0)==(j|0))break;else f=k;}i=T1(k<<4)|0;h=i+(f<<4)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];a=a+8|0;while(1){d=c[m+(d<<2)>>2]|0;f=f+-1|0;h=i+(f<<4)|0;if((d|0)==(j|0))break;e=(c[a>>2]|0)+(d<<4)|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];}c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];if(f|0)qa(141809,141816,148,141822);if(n|0)U1(n);if(o|0)U1(o);c[g+4>>2]=k;c[g>>2]=i;U1(m);l=p;return 1}function NX(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;j=l;l=l+48|0;h=j+32|0;g=j+16|0;f=j;i=c[a>>2]|0;d=c[a+4>>2]|0;e=d+-1|0;a=0;while(1){if((a|0)>=(d|0)){a=1;break}m=i+(((e+a|0)%(d|0)|0)<<4)|0;k=i+(a<<4)|0;c[f>>2]=c[m>>2];c[f+4>>2]=c[m+4>>2];c[f+8>>2]=c[m+8>>2];c[f+12>>2]=c[m+12>>2];c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];if((GY(f,g,h)|0)==1){a=0;break}else a=a+1|0;}l=j;return a|0}function OX(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;m=u+48|0;k=u+32|0;s=4;j=T1(40)|0;c[j>>2]=0;n=u+16|0;q=u;r=c[d>>2]|0;i=c[d+4>>2]|0;s=U6(189680,1,j|0,s|0)|0;j=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1)d=z;else d=0;while(1){if(d|0){d=-1;break}o=0;c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];ja(28,n|0,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue};c[e>>2]=c[n>>2];c[e+4>>2]=c[n+4>>2];c[e+8>>2]=c[n+8>>2];c[e+12>>2]=c[n+12>>2];h=e+16|0;o=0;c[m>>2]=c[h>>2];c[m+4>>2]=c[h+4>>2];c[m+8>>2]=c[h+8>>2];c[m+12>>2]=c[h+12>>2];ja(28,q|0,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue};c[h>>2]=c[q>>2];c[h+4>>2]=c[q+4>>2];c[h+8>>2]=c[q+8>>2];c[h+12>>2]=c[q+12>>2];c[47459]=0;o=0;ia(115,4);d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,s|0,j|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;continue}g=c[47460]|0;d=c[47459]|0;c[47459]=d+1;d=g+(d<<4)|0;c[d>>2]=c[r>>2];c[d+4>>2]=c[r+4>>2];c[d+8>>2]=c[r+8>>2];c[d+12>>2]=c[r+12>>2];o=0;c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[m>>2]=c[h>>2];c[m+4>>2]=c[h+4>>2];c[m+8>>2]=c[h+8>>2];c[m+12>>2]=c[h+12>>2];d=fa(1,a|0,b|0,r|0,i|0,k|0,m|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,s|0,j|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1)d=z;else {t=8;break}}if((t|0)==8)if((d|0)==-1)d=-1;else {c[f+4>>2]=c[47459];c[f>>2]=c[47460];d=0;}U1(s|0);l=u;return d|0}function PX(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0.0,i=0.0;d=+h[b>>3];e=b+8|0;f=+h[e>>3];i=f*f+d*d;g=+C(+i);if(i>1.0e-06){h[b>>3]=d/g;h[e>>3]=f/g;};c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function QX(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47463]|0)<(a|0)){b=c[47460]|0;if(!b){e=T1(a<<4)|0;c[47460]=e;if(!e){e=c[15712]|0;c[d>>2]=141831;c[d+4>>2]=531;c[d+8>>2]=141966;w4(e,141839,d)|0;bb(189680,1);}}else {d=W1(b,a<<4)|0;c[47460]=d;if(!d){d=c[15712]|0;c[e>>2]=141831;c[e+4>>2]=537;c[e+8>>2]=141984;w4(d,141839,e)|0;bb(189680,1);}}c[47463]=a;}l=f;return}function RX(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0.0,U=0.0,V=0.0,W=0.0;R=l;l=l+336|0;J=R+320|0;I=R+304|0;w=R+144|0;q=R+128|0;G=R+112|0;H=R+96|0;Q=R+80|0;A=R+64|0;C=R+48|0;K=R+32|0;L=R+16|0;M=R;x=R+288|0;y=R+272|0;z=R+256|0;B=R+240|0;D=R+224|0;E=R+208|0;N=R+192|0;O=R+176|0;P=R+160|0;i=c[47462]|0;do if((c[47461]|0)<(e|0)){if(!i){i=T1(e*40|0)|0;c[47462]=i;if(!i){i=-1;break}}else {i=W1(i,e*40|0)|0;c[47462]=i;if(!i){i=-1;break}}c[47461]=e;k=6;}else k=6;while(0);if((k|0)==6){h[i>>3]=0.0;k=1;j=0.0;while(1){if((k|0)>=(e|0))break;n=d+(k<<4)|0;F=d+(k+-1<<4)|0;c[I>>2]=c[n>>2];c[I+4>>2]=c[n+4>>2];c[I+8>>2]=c[n+8>>2];c[I+12>>2]=c[n+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];v=+SX(I,J)+j;h[i+(k*40|0)>>3]=v;k=k+1|0;j=v;}F=e+-1|0;n=i+(F*40|0)|0;k=1;while(1){if((k|0)>=(e|0))break;S=i+(k*40|0)|0;h[S>>3]=+h[S>>3]/+h[n>>3];k=k+1|0;}k=0;while(1){if((k|0)>=(e|0))break;S=i+(k*40|0)+8|0;n=i+(k*40|0)|0;v=+TX(+h[n>>3]);c[J>>2]=c[f>>2];c[J+4>>2]=c[f+4>>2];c[J+8>>2]=c[f+8>>2];c[J+12>>2]=c[f+12>>2];UX(x,J,v);c[S>>2]=c[x>>2];c[S+4>>2]=c[x+4>>2];c[S+8>>2]=c[x+8>>2];c[S+12>>2]=c[x+12>>2];S=i+(k*40|0)+24|0;v=+VX(+h[n>>3]);c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];UX(y,J,v);c[S>>2]=c[y>>2];c[S+4>>2]=c[y+4>>2];c[S+8>>2]=c[y+8>>2];c[S+12>>2]=c[y+12>>2];k=k+1|0;}c[I>>2]=c[f>>2];c[I+4>>2]=c[f+4>>2];c[I+8>>2]=c[f+8>>2];c[I+12>>2]=c[f+12>>2];c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];WX(d,e,i,I,J,G,A,H,C);c[q>>2]=c[G>>2];c[q+4>>2]=c[G+4>>2];c[q+8>>2]=c[G+8>>2];c[q+12>>2]=c[G+12>>2];c[w>>2]=c[A>>2];c[w+4>>2]=c[A+4>>2];c[w+8>>2]=c[A+8>>2];c[w+12>>2]=c[A+12>>2];c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];if(!(XX(a,b,q,w,I,J,d,e)|0)){c[J>>2]=c[A>>2];c[J+4>>2]=c[A+4>>2];c[J+8>>2]=c[A+8>>2];c[J+12>>2]=c[A+12>>2];UX(z,J,.3333333333333333);c[I>>2]=c[G>>2];c[I+4>>2]=c[G+4>>2];c[I+8>>2]=c[G+8>>2];c[I+12>>2]=c[G+12>>2];c[J>>2]=c[z>>2];c[J+4>>2]=c[z+4>>2];c[J+8>>2]=c[z+8>>2];c[J+12>>2]=c[z+12>>2];YX(B,I,J);v=+h[B>>3];u=+h[B+8>>3];c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];UX(D,J,.3333333333333333);c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];c[J>>2]=c[D>>2];c[J+4>>2]=c[D+4>>2];c[J+8>>2]=c[D+8>>2];c[J+12>>2]=c[D+12>>2];ZX(E,I,J);t=+h[E>>3];p=+h[E+8>>3];q=c[47462]|0;r=+h[G>>3];s=+h[H>>3];o=+h[G+8>>3];m=+h[H+8>>3];n=Q+8|0;i=-1;j=-1.0;k=1;while(1){if((k|0)>=(F|0))break;T=+h[q+(k*40|0)>>3];U=+_X(T);V=+TX(T);W=+VX(T);T=+$X(T);h[Q>>3]=V*v+r*U+W*t+s*T;h[n>>3]=W*p+V*u+o*U+m*T;S=d+(k<<4)|0;c[I>>2]=c[Q>>2];c[I+4>>2]=c[Q+4>>2];c[I+8>>2]=c[Q+8>>2];c[I+12>>2]=c[Q+12>>2];c[J>>2]=c[S>>2];c[J+4>>2]=c[S+4>>2];c[J+8>>2]=c[S+8>>2];c[J+12>>2]=c[S+12>>2];T=+SX(I,J);S=T>j;i=S?k:i;j=S?T:j;k=k+1|0;}S=d+(i<<4)|0;Q=d+(i+-1<<4)|0;c[I>>2]=c[S>>2];c[I+4>>2]=c[S+4>>2];c[I+8>>2]=c[S+8>>2];c[I+12>>2]=c[S+12>>2];c[J>>2]=c[Q>>2];c[J+4>>2]=c[Q+4>>2];c[J+8>>2]=c[Q+8>>2];c[J+12>>2]=c[Q+12>>2];ZX(N,I,J);c[J>>2]=c[N>>2];c[J+4>>2]=c[N+4>>2];c[J+8>>2]=c[N+8>>2];c[J+12>>2]=c[N+12>>2];PX(L,J);Q=i+1|0;N=d+(Q<<4)|0;c[I>>2]=c[N>>2];c[I+4>>2]=c[N+4>>2];c[I+8>>2]=c[N+8>>2];c[I+12>>2]=c[N+12>>2];c[J>>2]=c[S>>2];c[J+4>>2]=c[S+4>>2];c[J+8>>2]=c[S+8>>2];c[J+12>>2]=c[S+12>>2];ZX(O,I,J);c[J>>2]=c[O>>2];c[J+4>>2]=c[O+4>>2];c[J+8>>2]=c[O+8>>2];c[J+12>>2]=c[O+12>>2];PX(M,J);c[I>>2]=c[L>>2];c[I+4>>2]=c[L+4>>2];c[I+8>>2]=c[L+8>>2];c[I+12>>2]=c[L+12>>2];c[J>>2]=c[M>>2];c[J+4>>2]=c[M+4>>2];c[J+8>>2]=c[M+8>>2];c[J+12>>2]=c[M+12>>2];YX(P,I,J);c[J>>2]=c[P>>2];c[J+4>>2]=c[P+4>>2];c[J+8>>2]=c[P+8>>2];c[J+12>>2]=c[P+12>>2];PX(K,J);c[I>>2]=c[f>>2];c[I+4>>2]=c[f+4>>2];c[I+8>>2]=c[f+8>>2];c[I+12>>2]=c[f+12>>2];c[J>>2]=c[K>>2];c[J+4>>2]=c[K+4>>2];c[J+8>>2]=c[K+8>>2];c[J+12>>2]=c[K+12>>2];RX(a,b,d,Q,I,J)|0;c[I>>2]=c[K>>2];c[I+4>>2]=c[K+4>>2];c[I+8>>2]=c[K+8>>2];c[I+12>>2]=c[K+12>>2];c[J>>2]=c[g>>2];c[J+4>>2]=c[g+4>>2];c[J+8>>2]=c[g+8>>2];c[J+12>>2]=c[g+12>>2];RX(a,b,S,e-i|0,I,J)|0;i=0;}else i=0;}l=R;return i|0}function SX(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[b>>3]-+h[a>>3];d=+h[b+8>>3]-+h[a+8>>3];return +(+C(+(d*d+c*c)))}function TX(a){a=+a;var b=0.0;b=1.0-a;return +(b*b*(a*3.0))}function UX(a,b,d){a=a|0;b=b|0;d=+d;var e=0;h[b>>3]=+h[b>>3]*d;e=b+8|0;h[e>>3]=+h[e>>3]*d;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function VX(a){a=+a;return +(a*a*3.0*(1.0-a))}function WX(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0.0,J=0,K=0,L=0,M=0;G=l;l=l+128|0;B=G+112|0;v=G+80|0;u=G;r=G+96|0;s=G+64|0;t=G+48|0;C=G+32|0;D=G+16|0;E=a+(b+-1<<4)|0;q=0;w=0.0;x=0.0;y=0.0;z=0.0;A=0.0;while(1){if((q|0)>=(b|0))break;K=d+(q*40|0)+8|0;c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];H=+fY(v,B)+x;J=d+(q*40|0)+24|0;c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[J>>2];c[B+4>>2]=c[J+4>>2];c[B+8>>2]=c[J+8>>2];c[B+12>>2]=c[J+12>>2];p=+fY(v,B)+A;c[v>>2]=c[J>>2];c[v+4>>2]=c[J+4>>2];c[v+8>>2]=c[J+8>>2];c[v+12>>2]=c[J+12>>2];c[B>>2]=c[J>>2];c[B+4>>2]=c[J+4>>2];c[B+8>>2]=c[J+8>>2];c[B+12>>2]=c[J+12>>2];o=+fY(v,B)+y;L=a+(q<<4)|0;M=d+(q*40|0)|0;I=+gY(+h[M>>3]);c[B>>2]=c[a>>2];c[B+4>>2]=c[a+4>>2];c[B+8>>2]=c[a+8>>2];c[B+12>>2]=c[a+12>>2];UX(s,B,I);I=+hY(+h[M>>3]);c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];UX(t,B,I);c[v>>2]=c[s>>2];c[v+4>>2]=c[s+4>>2];c[v+8>>2]=c[s+8>>2];c[v+12>>2]=c[s+12>>2];c[B>>2]=c[t>>2];c[B+4>>2]=c[t+4>>2];c[B+8>>2]=c[t+8>>2];c[B+12>>2]=c[t+12>>2];YX(r,v,B);c[v>>2]=c[L>>2];c[v+4>>2]=c[L+4>>2];c[v+8>>2]=c[L+8>>2];c[v+12>>2]=c[L+12>>2];c[B>>2]=c[r>>2];c[B+4>>2]=c[r+4>>2];c[B+8>>2]=c[r+8>>2];c[B+12>>2]=c[r+12>>2];ZX(u,v,B);c[v>>2]=c[K>>2];c[v+4>>2]=c[K+4>>2];c[v+8>>2]=c[K+8>>2];c[v+12>>2]=c[K+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];I=+fY(v,B)+w;c[v>>2]=c[J>>2];c[v+4>>2]=c[J+4>>2];c[v+8>>2]=c[J+8>>2];c[v+12>>2]=c[J+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];q=q+1|0;w=I;x=H;y=o;z=+fY(v,B)+z;A=p;}o=y*x-A*A;p=o>=0.0?o:-o;if(!(p>=1.0e-06?(m=(y*w-A*z)/o,n=(x*z-A*w)/o,!(p<1.0e-06|m<=0.0|n<=0.0)):0))F=6;if((F|0)==6){c[v>>2]=c[a>>2];c[v+4>>2]=c[a+4>>2];c[v+8>>2]=c[a+8>>2];c[v+12>>2]=c[a+12>>2];c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];m=+SX(v,B)*.3333333333333333;n=m;};c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[B>>2]=c[e>>2];c[B+4>>2]=c[e+4>>2];c[B+8>>2]=c[e+8>>2];c[B+12>>2]=c[e+12>>2];UX(C,B,m);c[i>>2]=c[C>>2];c[i+4>>2]=c[C+4>>2];c[i+8>>2]=c[C+8>>2];c[i+12>>2]=c[C+12>>2];c[j>>2]=c[E>>2];c[j+4>>2]=c[E+4>>2];c[j+8>>2]=c[E+8>>2];c[j+12>>2]=c[E+12>>2];c[B>>2]=c[f>>2];c[B+4>>2]=c[f+4>>2];c[B+8>>2]=c[f+8>>2];c[B+12>>2]=c[f+12>>2];UX(D,B,n);c[k>>2]=c[D>>2];c[k+4>>2]=c[D+4>>2];c[k+8>>2]=c[D+8>>2];c[k+12>>2]=c[D+12>>2];l=G;return}function XX(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0,u=0.0,v=0,w=0.0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0.0,E=0;C=l;l=l+64|0;B=C;z=(j|0)==2;y=+h[d>>3];u=+h[d+8>>3];v=B+8|0;w=+h[e>>3];x=B+16|0;p=+h[e+8>>3];q=B+24|0;r=+h[f>>3];s=+h[g>>3];t=B+32|0;o=+h[f+8>>3];n=+h[g+8>>3];e=B+40|0;f=B+48|0;g=B+56|0;d=1;k=4.0;m=4.0;while(1){h[B>>3]=y;h[v>>3]=u;D=m*.3333333333333333;h[x>>3]=D*w+y;h[q>>3]=D*p+u;D=k*.3333333333333333;h[t>>3]=r-D*s;h[e>>3]=o-D*n;h[f>>3]=r;h[g>>3]=o;if(d?(D=+aY(B,4),D<+aY(i,j)+-.001):0){d=0;break}if(bY(a,b,B)|0){A=5;break}if(m==0.0&k==0.0){A=9;break}E=m>.01;d=0;k=E?k*.5:0.0;m=E?m*.5:0.0;}a:do if((A|0)==5){QX((c[47459]|0)+4|0);e=c[47460]|0;d=1;while(1){if((d|0)==4){d=1;break a}E=c[47459]|0;h[e+(E<<4)>>3]=+h[B+(d<<4)>>3];D=+h[B+(d<<4)+8>>3];c[47459]=E+1;h[e+(E<<4)+8>>3]=D;d=d+1|0;}}else if((A|0)==9)if(z){QX((c[47459]|0)+4|0);e=c[47460]|0;d=1;while(1){if((d|0)==4){d=1;break a}E=c[47459]|0;h[e+(E<<4)>>3]=+h[B+(d<<4)>>3];D=+h[B+(d<<4)+8>>3];c[47459]=E+1;h[e+(E<<4)+8>>3]=D;d=d+1|0;}}else d=0;while(0);l=C;return d|0}function YX(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]+ +h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]+ +h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function ZX(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;h[b>>3]=+h[b>>3]-+h[d>>3];e=b+8|0;h[e>>3]=+h[e>>3]-+h[d+8>>3];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function _X(a){a=+a;a=1.0-a;return +(a*a*a)}function $X(a){a=+a;return +(a*a*a)}function aY(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0,f=0.0,g=0;c=0.0;d=1;while(1){if((d|0)>=(b|0))break;g=d+-1|0;e=+h[a+(d<<4)>>3]-+h[a+(g<<4)>>3];f=+h[a+(d<<4)+8>>3]-+h[a+(g<<4)+8>>3];c=+C(+(f*f+e*e))+c;d=d+1|0;}return +c}function bY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0.0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0;C=l;l=l+64|0;t=C+32|0;u=C;w=u+16|0;y=d+16|0;z=d+32|0;A=d+48|0;B=d+8|0;g=d+24|0;i=d+40|0;j=d+56|0;k=u+8|0;m=u+24|0;f=0;a:while(1){if((f|0)>=(b|0)){e=1;break}n=a+(f<<5)|0;c[u>>2]=c[n>>2];c[u+4>>2]=c[n+4>>2];c[u+8>>2]=c[n+8>>2];c[u+12>>2]=c[n+12>>2];n=a+(f<<5)+16|0;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];n=cY(d,u,t)|0;b:do if((n|0)!=4){o=+h[u>>3];p=+h[k>>3];q=+h[w>>3];r=+h[m>>3];e=0;while(1){if((e|0)>=(n|0))break b;s=+h[t+(e<<3)>>3];if((!(s<1.0e-06|s>.999999)?(x=s*s*s,E=s*3.0,D=1.0-s,s=E*s*D,v=D*D,E=v*E,D=v*D,v=+h[y>>3]*E+ +h[d>>3]*D+ +h[z>>3]*s+ +h[A>>3]*x,x=+h[g>>3]*E+ +h[B>>3]*D+ +h[i>>3]*s+ +h[j>>3]*x,s=v-o,D=x-p,!(D*D+s*s<.001)):0)?(E=v-q,D=x-r,!(D*D+E*E<.001)):0){e=0;break a}e=e+1|0;}}while(0);f=f+1|0;}l=C;return e|0}function cY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+96|0;s=v+48|0;t=v+24|0;k=v;u=v+80|0;p=+h[b>>3];g=+h[b+16>>3]-p;q=+h[b+8>>3];j=+h[b+24>>3]-q;c[u>>2]=0;a:do if(!(g==0.0)){j=j/g;m=a+16|0;n=a+32|0;o=a+48|0;dY(+h[a+8>>3]-+h[a>>3]*j,+h[a+24>>3]-+h[m>>3]*j,+h[a+40>>3]-+h[n>>3]*j,+h[a+56>>3]-+h[o>>3]*j,s);h[s>>3]=j*p-q+ +h[s>>3];e=BY(s,t)|0;if((e|0)==4)b=4;else {f=s+8|0;i=s+16|0;k=s+24|0;g=1.0/g;b=0;while(1){if((b|0)>=(e|0))break;j=+h[t+(b<<3)>>3];if(j>=0.0&j<=1.0?(dY(+h[a>>3],+h[m>>3],+h[n>>3],+h[o>>3],s),q=(+h[s>>3]-p+((+h[k>>3]*j+ +h[i>>3])*j+ +h[f>>3])*j)*g,q>=0.0&q<=1.0):0)eY(j,d,u);b=b+1|0;}b=c[u>>2]|0;}}else {dY(+h[a>>3],+h[a+16>>3],+h[a+32>>3],+h[a+48>>3],s);h[s>>3]=+h[s>>3]-p;r=BY(s,t)|0;if(!(j==0.0)){if((r|0)==4){b=4;break}m=a+8|0;n=a+24|0;o=a+40|0;e=a+56|0;f=s+8|0;i=s+16|0;k=s+24|0;g=1.0/j;b=0;while(1){if((b|0)>=(r|0))break;j=+h[t+(b<<3)>>3];if(j>=0.0&j<=1.0?(dY(+h[m>>3],+h[n>>3],+h[o>>3],+h[e>>3],s),p=(+h[s>>3]-q+((+h[k>>3]*j+ +h[i>>3])*j+ +h[f>>3])*j)*g,p>=0.0&p<=1.0):0)eY(j,d,u);b=b+1|0;}b=c[u>>2]|0;break}dY(+h[a+8>>3],+h[a+24>>3],+h[a+40>>3],+h[a+56>>3],s);h[s>>3]=+h[s>>3]-q;i=BY(s,k)|0;b=(i|0)==4;b:do if((r|0)==4){if(b){b=4;break a}else b=0;while(1){if((b|0)>=(i|0))break b;eY(+h[k+(b<<3)>>3],d,u);b=b+1|0;}}else {if(b){b=0;while(1){if((b|0)>=(r|0))break b;eY(+h[t+(b<<3)>>3],d,u);b=b+1|0;}}else e=0;while(1){if((e|0)>=(r|0))break b;f=t+(e<<3)|0;b=0;while(1){if((b|0)>=(i|0))break;g=+h[f>>3];if(g==+h[k+(b<<3)>>3])eY(g,d,u);b=b+1|0;}e=e+1|0;}}while(0);b=c[u>>2]|0;}while(0);l=v;return b|0}function dY(a,b,c,d,e){a=+a;b=+b;c=+c;d=+d;e=e|0;h[e+24>>3]=d-a+(b-c)*3.0;h[e+16>>3]=(c+a)*3.0-b*6.0;h[e+8>>3]=(b-a)*3.0;h[e>>3]=a;return}function eY(a,b,d){a=+a;b=b|0;d=d|0;var e=0;if(a>=0.0&a<=1.0){e=c[d>>2]|0;h[b+(e<<3)>>3]=a;c[d>>2]=e+1;}return}function fY(a,b){a=a|0;b=b|0;return +(+h[b+8>>3]*+h[a+8>>3]+ +h[b>>3]*+h[a>>3])}function gY(a){a=+a;var b=0.0;b=1.0-a;return +(b*b*(b+a*3.0))}function hY(a){a=+a;return +(a*a*((1.0-a)*3.0+a))}function iY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0;H=l;l=l+112|0;E=H+80|0;D=H+64|0;C=H+48|0;G=4;F=T1(40)|0;c[F>>2]=0;w=H+32|0;x=H+16|0;y=H;A=H+96|0;G=U6(189856,1,F|0,G|0)|0;F=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1)e=z;else e=0;a:while(1){if(e|0){e=-2;break}g=a+4|0;o=0;ia(116,c[g>>2]|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}c[47503]=0;c[47504]=0;o=0;ia(117,c[g>>2]<<1|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}m=(c[47506]|0)/2|0;c[47507]=m;c[47508]=m+-1;m=c[g>>2]|0;g=c[a>>2]|0;e=0;f=-1;i=t;while(1){if((e|0)>=(m|0))break;I=+h[g+(e<<4)>>3];v=i>I;u=v?e:f;e=e+1|0;f=u;i=v?I:i;}v=g+(f<<4)|0;c[x>>2]=c[v>>2];c[x+4>>2]=c[v+4>>2];c[x+8>>2]=c[v+8>>2];c[x+12>>2]=c[v+12>>2];v=g+(((f|0)==0?m:f)+-1<<4)|0;c[w>>2]=c[v>>2];c[w+4>>2]=c[v+4>>2];c[w+8>>2]=c[v+8>>2];c[w+12>>2]=c[v+12>>2];v=g+(((f|0)==(m+-1|0)?0:f+1|0)<<4)|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];I=+h[x>>3];if((+h[w>>3]==I?I==+h[y>>3]:0)?+h[y+8>>3]>+h[x+8>>3]:0)v=15;else v=12;b:do if((v|0)==12){v=0;o=0;e=ca(36,w|0,x|0,y|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,G|0,F|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((e|0)==1){g=c[47510]|0;e=c[47511]|0;f=0;while(1){if((f|0)>=(m|0))break b;j=c[a>>2]|0;if(!(((f|0)>0?(B=f+-1|0,+h[j+(f<<4)>>3]==+h[j+(B<<4)>>3]):0)?+h[j+(f<<4)+8>>3]==+h[j+(B<<4)+8>>3]:0)){u=c[47503]|0;c[g+(u<<3)>>2]=j+(f<<4);c[g+(u<<3)+4>>2]=g+(((u|0)%(m|0)|0)<<3);c[e+(u<<2)>>2]=g+(u<<3);c[47503]=u+1;}f=f+1|0;}}else v=15;}while(0);c:do if((v|0)==15){v=0;j=c[47510]|0;e=c[47511]|0;g=m;while(1){f=g+-1|0;if((g|0)<=0)break c;k=c[a>>2]|0;if(((g|0)<(m|0)?+h[k+(f<<4)>>3]==+h[k+(g<<4)>>3]:0)?+h[k+(f<<4)+8>>3]==+h[k+(g<<4)+8>>3]:0){g=f;continue}g=c[47503]|0;c[j+(g<<3)>>2]=k+(f<<4);c[j+(g<<3)+4>>2]=j+(((g|0)%(m|0)|0)<<3);c[e+(g<<2)>>2]=j+(g<<3);c[47503]=g+1;g=f;}}while(0);o=0;ja(29,e|0,c[47503]|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}j=0;e=c[47504]|0;d:while(1){if((j|0)>=(e|0)){s=0;break}k=j+1|0;g=k;while(1){if((g|0)>=(e|0)){j=k;continue d}o=0;ja(30,j|0,g|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue a}g=g+1|0;e=c[47504]|0;}}while(1){if((s|0)>=(e|0))break;o=0;f=aa(105,s|0,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}if(f|0)break;s=s+1|0;}if((s|0)==(e|0)){e=c[15712]|0;o=0;c[C>>2]=141858;c[C+4>>2]=192;c[C+8>>2]=141869;ca(32,e|0,141839,C|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=41;break}}u=b+16|0;k=0;while(1){if((k|0)>=(e|0))break;o=0;f=aa(105,k|0,u|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}if(f|0)break;k=k+1|0;}if((k|0)==(e|0)){e=c[15712]|0;o=0;c[D>>2]=141858;c[D+4>>2]=200;c[D+8>>2]=141902;ca(32,e|0,141839,D|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=48;break}}o=0;e=aa(106,s|0,k|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,G|0,F|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue}if(!e){e=c[15712]|0;o=0;c[E>>2]=141858;c[E+4>>2]=207;c[E+8>>2]=141940;ca(32,e|0,141839,E|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}o=0;ia(118,2);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=53;break}}if((s|0)==(k|0)){o=0;ia(118,2);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,G|0,F|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){e=z;continue}else {v=56;break}}c[A>>2]=b;c[A+4>>2]=0;f=A+8|0;c[f>>2]=u;c[A+12>>2]=0;o=0;ja(31,1,A|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue}c[47509]=c[47507];q=s;e:while(1){if((q|0)==-1){g=f;e=0;break}r=c[47513]|0;c[r+(q*52|0)>>2]=2;e=0;while(1){if((e|0)>=3){v=65;break}v=c[r+(q*52|0)+4+(e<<4)+12>>2]|0;if(v|0?(c[v>>2]|0)==1:0){v=68;break}e=e+1|0;}if((v|0)==65){v=0;if((e|0)==3){e=c[47505]|0;k=c[e+(c[47508]<<2)>>2]|0;o=0;e=ca(36,u|0,c[c[e+(c[47507]<<2)>>2]>>2]|0,c[k>>2]|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}j=(e|0)==1;n=j?f:k;j=j?k:f;}else v=68;}if((v|0)==68){v=0;k=c[r+(q*52|0)+4+(e<<4)>>2]|0;m=c[r+(q*52|0)+4+(e<<4)+4>>2]|0;o=0;e=ca(36,c[k>>2]|0,c[c[r+(q*52|0)+4+(((e+1|0)%3|0)<<4)+4>>2]>>2]|0,c[m>>2]|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1){e=z;continue a}j=(e|0)==1;n=j?k:m;j=j?m:k;}do if((q|0)==(s|0)){o=0;ja(31,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,1,n|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}e=0;}else {m=c[47505]|0;if((c[m+(c[47507]<<2)>>2]|0)!=(n|0)?(c[m+(c[47508]<<2)>>2]|0)!=(n|0):0){o=0;j=$(34,n|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(32,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,1,n|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((j|0)<=(c[47509]|0)){e=0;break}c[47509]=j;e=0;break}o=0;k=$(34,j|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(32,1,k|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}o=0;ja(31,2,j|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){g=V6(c[e>>2]|0,G|0,F|0)|0;if(!g)bb(e|0,p|0);z=p;}else g=-1;if((g|0)==1){e=z;continue a}if((k|0)>=(c[47509]|0)){e=0;break}c[47509]=k;e=0;}while(0);while(1){if((e|0)>=3){q=-1;continue e}g=c[r+(q*52|0)+4+(e<<4)+12>>2]|0;if(g|0?(c[g>>2]|0)==1:0)break;e=e+1|0;}q=(g-(c[47513]|0)|0)/52|0;}while(1){if(!g)break;g=c[g+4>>2]|0;e=e+1|0;}o=0;ia(118,e|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){j=V6(c[g>>2]|0,G|0,F|0)|0;if(!j)bb(g|0,p|0);z=p;}else j=-1;if((j|0)==1)e=z;else {v=94;break}}if((v|0)==41)e=-1;else if((v|0)==48)e=-1;else if((v|0)==53){c[d+4>>2]=2;e=c[47512]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];F=e+16|0;c[F>>2]=c[u>>2];c[F+4>>2]=c[u+4>>2];c[F+8>>2]=c[u+8>>2];c[F+12>>2]=c[u+12>>2];c[d>>2]=e;e=0;}else if((v|0)==56){c[d+4>>2]=2;e=c[47512]|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];F=e+16|0;c[F>>2]=c[u>>2];c[F+4>>2]=c[u+4>>2];c[F+8>>2]=c[u+8>>2];c[F+12>>2]=c[u+12>>2];c[d>>2]=e;e=0;}else if((v|0)==94){c[d+4>>2]=e;g=c[47512]|0;while(1){e=e+-1|0;if(!f)break;F=g+(e<<4)|0;E=c[f>>2]|0;c[F>>2]=c[E>>2];c[F+4>>2]=c[E+4>>2];c[F+8>>2]=c[E+8>>2];c[F+12>>2]=c[E+12>>2];f=c[f+4>>2]|0;}c[d>>2]=g;e=0;}U1(G|0);l=H;return e|0}function jY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+64|0;e=h+48|0;g=h+32|0;f=h+16|0;d=h;if((c[47516]|0)<(a|0)){b=c[47510]|0;if(!b){g=T1(a<<3)|0;c[47510]=g;if(!g){g=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=523;c[d+8>>2]=142108;w4(g,141839,d)|0;bb(189856,1);}g=T1(a<<2)|0;c[47511]=g;if(!g){g=c[15712]|0;c[f>>2]=141858;c[f+4>>2]=527;c[f+8>>2]=142127;w4(g,141839,f)|0;bb(189856,1);}}else {f=W1(b,a<<3)|0;c[47510]=f;if(!f){f=c[15712]|0;c[g>>2]=141858;c[g+4>>2]=533;c[g+8>>2]=142147;w4(f,141839,g)|0;bb(189856,1);}g=W1(c[47511]|0,a<<2)|0;c[47511]=g;if(!g){g=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=539;c[e+8>>2]=142167;w4(g,141839,e)|0;bb(189856,1);}}c[47516]=a;}l=h;return}function kY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47506]|0)<(a|0)){b=c[47505]|0;if(!b){e=T1(a<<2)|0;c[47505]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=573;c[d+8>>2]=142063;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a<<2)|0;c[47505]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=580;c[e+8>>2]=142085;w4(d,141839,e)|0;bb(189856,1);}}c[47506]=a;}l=f;return}function lY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];d=(+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d);return (d>0.0?1:d<0.0?2:3)|0}function mY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;a:while(1){if((b|0)>3)e=0;else {b=9;break}while(1){if((e|0)>=(b|0)){b=8;break a}f=e+1|0;d=(f|0)%(b|0)|0;g=(e+2|0)%(b|0)|0;if(!(uY(e,g,a,b)|0))e=f;else break}vY(c[a+(e<<2)>>2]|0,c[a+(d<<2)>>2]|0,c[a+(g<<2)>>2]|0);b=b+-1|0;while(1){if((d|0)>=(b|0))continue a;g=d+1|0;c[a+(d<<2)>>2]=c[a+(g<<2)>>2];d=g;}}if((b|0)==8){a=c[15712]|0;c[h>>2]=141858;c[h+4>>2]=324;c[h+8>>2]=142003;w4(a,141839,h)|0;}else if((b|0)==9)vY(c[a>>2]|0,c[a+4>>2]|0,c[a+8>>2]|0);l=i;return}function nY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=c[47513]|0;j=i+(a*52|0)|0;k=i+(b*52|0)|0;g=0;while(1){if((g|0)==3)break;l=i+(a*52|0)+4+(g<<4)|0;m=i+(a*52|0)+4+(g<<4)+4|0;n=i+(a*52|0)+4+(g<<4)+12|0;f=0;while(1){if((f|0)==3)break;o=c[c[l>>2]>>2]|0;h=c[c[i+(b*52|0)+4+(f<<4)>>2]>>2]|0;if((o|0)==(h|0)){d=c[c[i+(b*52|0)+4+(f<<4)+4>>2]>>2]|0;if((c[c[m>>2]>>2]|0)==(d|0))e=10;else e=8;}else {d=c[c[i+(b*52|0)+4+(f<<4)+4>>2]>>2]|0;e=8;}if(((e|0)==8?(e=0,(o|0)==(d|0)):0)?(c[c[m>>2]>>2]|0)==(h|0):0)e=10;if((e|0)==10){c[n>>2]=k;c[i+(b*52|0)+4+(f<<4)+12>>2]=j;}f=f+1|0;}g=g+1|0;}return}function oY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[47513]|0;d=0;e=0;while(1){if((e|0)==3)break;d=d+((lY(c[c[f+(a*52|0)+4+(e<<4)>>2]>>2]|0,c[c[f+(a*52|0)+4+(e<<4)+4>>2]>>2]|0,b)|0)!=2&1)|0;e=e+1|0;}return ((d|0)==3|(d|0)==0)&1|0}function pY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[47513]|0;e=d+(a*52|0)|0;a:do if(!(c[e>>2]|0)){c[e>>2]=1;if((a|0)==(b|0))d=1;else {f=0;while(1){if((f|0)>=3)break;e=c[d+(a*52|0)+4+(f<<4)+12>>2]|0;if(e){if(pY((e-d|0)/52|0,b)|0){d=1;break a}d=c[47513]|0;}f=f+1|0;}c[d+(a*52|0)>>2]=0;d=0;}}else d=0;while(0);return d|0}function qY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47514]|0)<(a|0)){b=c[47512]|0;if(!b){e=T1(a<<4)|0;c[47512]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=593;c[d+8>>2]=141966;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a<<4)|0;c[47512]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=599;c[e+8>>2]=141984;w4(d,141839,e)|0;bb(189856,1);}}c[47514]=a;}l=f;return}function rY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[47508]|0;e=c[47507]|0;f=(d|0)>=(e|0);if((a|0)==1)if(f){c[b+4>>2]=c[(c[47505]|0)+(e<<2)>>2];a=190028;d=-1;}else {a=190028;d=-1;}else if(f){c[b+4>>2]=c[(c[47505]|0)+(d<<2)>>2];a=190032;d=1;}else {a=190032;d=1;}f=(c[a>>2]|0)+d|0;c[a>>2]=f;c[(c[47505]|0)+(f<<2)>>2]=b;return}function sY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[47509]|0;g=c[47505]|0;b=c[47507]|0;while(1){if((b|0)>=(f|0)){e=4;break}d=b+1|0;if((lY(c[c[g+(d<<2)>>2]>>2]|0,c[c[g+(b<<2)>>2]>>2]|0,c[a>>2]|0)|0)==1)break;else b=d;}a:do if((e|0)==4){b=c[47508]|0;while(1){if((b|0)<=(f|0)){b=f;break a}d=b+-1|0;if((lY(c[c[g+(d<<2)>>2]>>2]|0,c[c[g+(b<<2)>>2]>>2]|0,c[a>>2]|0)|0)==2)break;else b=d;}}while(0);return b|0}function tY(a,b){a=a|0;b=b|0;c[((a|0)==1?190032:190028)>>2]=b;return}function uY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=c[c[d+(((a+-1+e|0)%(e|0)|0)<<2)>>2]>>2]|0;i=c[c[d+(a<<2)>>2]>>2]|0;g=c[c[d+(((a+1|0)%(e|0)|0)<<2)>>2]>>2]|0;k=(lY(f,i,g)|0)==1;j=c[c[d+(b<<2)>>2]>>2]|0;if(k)if((lY(i,j,f)|0)==1){f=lY(j,i,g)|0;g=1;h=5;}else f=0;else {f=lY(i,j,g)|0;g=2;h=5;}a:do if((h|0)==5)if((f|0)==(g|0)){f=0;while(1){if((f|0)>=(e|0)){f=1;break a}g=f;f=f+1|0;h=(f|0)%(e|0)|0;if((h|0)==(b|0)|((g|0)==(b|0)|((g|0)==(a|0)|(h|0)==(a|0))))continue;if(xY(i,j,c[c[d+(g<<2)>>2]>>2]|0,c[c[d+(h<<2)>>2]>>2]|0)|0){f=0;break}}}else f=0;while(0);return f|0}function vY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[47504]|0;f=c[47515]|0;if((e|0)<(f|0))h=e;else {wY(f+20|0);h=c[47504]|0;}g=c[47513]|0;c[47504]=h+1;f=g+(h*52|0)|0;c[f>>2]=0;c[g+(h*52|0)+4>>2]=a;c[g+(h*52|0)+8>>2]=b;c[g+(h*52|0)+16>>2]=0;c[g+(h*52|0)+20>>2]=b;c[g+(h*52|0)+24>>2]=d;c[g+(h*52|0)+32>>2]=0;c[g+(h*52|0)+36>>2]=d;c[g+(h*52|0)+40>>2]=a;c[g+(h*52|0)+48>>2]=0;e=0;while(1){if((e|0)==3)break;c[g+(h*52|0)+4+(e<<4)+8>>2]=f;e=e+1|0;}return}function wY(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+32|0;e=f+16|0;d=f;if((c[47515]|0)<(a|0)){b=c[47513]|0;if(!b){e=T1(a*52|0)|0;c[47513]=e;if(!e){e=c[15712]|0;c[d>>2]=141858;c[d+4>>2]=552;c[d+8>>2]=142024;w4(e,141839,d)|0;bb(189856,1);}}else {d=W1(b,a*52|0)|0;c[47513]=d;if(!d){d=c[15712]|0;c[e>>2]=141858;c[e+4>>2]=558;c[e+8>>2]=142043;w4(d,141839,e)|0;bb(189856,1);}}c[47515]=a;}l=f;return}function xY(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=lY(a,b,c)|0;if((((f|0)!=3?(g=lY(a,b,d)|0,(g|0)!=3):0)?(h=lY(c,d,a)|0,(h|0)!=3):0)?(e=lY(c,d,b)|0,(e|0)!=3):0)return ((f|0)==1^(g|0)==1)&((h|0)==1^(e|0)==1)&1|0;if(((yY(a,b,c)|0)==0?(yY(a,b,d)|0)==0:0)?(yY(c,d,a)|0)==0:0)return (yY(c,d,b)|0)!=0|0;return 1}function yY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;e=+h[a>>3];g=+h[b>>3]-e;f=+h[a+8>>3];d=+h[b+8>>3]-f;e=+h[c>>3]-e;f=+h[c+8>>3]-f;if((lY(a,b,c)|0)==3?f*d+e*g>=0.0:0)a=f*f+e*e<=d*d+g*g&1;else a=0;return a|0}function zY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;m=T1(d<<2)|0;n=T1((d<<3)+8|0)|0;o=n+8|0;f=0;while(1){if((f|0)>=(d|0))break;c[m+(f<<2)>>2]=-1;h[o+(f<<3)>>3]=-2147483647.0;f=f+1|0;}h[n>>3]=-2147483648.0;a:while(1){if((a|0)==(b|0))break;l=o+(a<<3)|0;j=+h[l>>3];h[l>>3]=j==-2147483647.0?0.0:-j;k=0;f=-1;while(1){if((k|0)>=(d|0)){a=f;continue a}i=o+(k<<3)|0;g=+h[i>>3];if(g<0.0){q=(a|0)<(k|0);p=+h[(c[e+((q?k:a)<<2)>>2]|0)+((q?a:k)<<3)>>3];j=-(p+ +h[l>>3]);if(p!=0.0&g>3]=j;c[m+(k<<2)>>2]=a;g=j;}f=g>+h[o+(f<<3)>>3]?k:f;}k=k+1|0;}}U1(n);return m|0}function AY(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0;j=l;l=l+32|0;k=j+16|0;m=j;i=c[h+4>>2]|0;c[m>>2]=c[a>>2];c[m+4>>2]=c[a+4>>2];c[m+8>>2]=c[a+8>>2];c[m+12>>2]=c[a+12>>2];c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];if(!(TY(m,b,k,f,h)|0)){a=c[h+24>>2]|0;c[a+(i<<2)>>2]=g;m=i+1|0;c[a+(m<<2)>>2]=d;a=zY(m,i,i+2|0,a)|0;}else {a=T1((i<<2)+8|0)|0;m=i+1|0;c[a+(i<<2)>>2]=m;c[a+(m<<2)>>2]=-1;}l=j;return a|0}function BY(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0;d=+h[a+24>>3];a:do if(d<1.0e-07&d>-1.0e-07)a=CY(a,b)|0;else {g=+h[a+16>>3]/(d*3.0);f=+h[a+8>>3]/d;e=g*g;d=g*2.0*e-g*f+ +h[a>>3]/d;e=f*.3333333333333333-e;e=e*e*4.0*e;f=d*d+e;if(!(f<0.0)){i=(+C(+f)-d)*.5;e=+E2(i);d=+E2(-d-i)+e;h[b>>3]=d;if(f>0.0)a=1;else {d=d*-.5;h[b+16>>3]=d;a=1;c=7;}}else {i=+K(+(+C(+-f)),+-d);d=+E2(+C(+-e)*.5)*2.0;h[b>>3]=d*+E(+(i*.3333333333333333));h[b+8>>3]=+E(+((i+6.283185307179586)*.3333333333333333))*d;d=+E(+((i+-6.283185307179586)*.3333333333333333))*d;a=2;c=7;}if((c|0)==7){h[b+(a<<3)>>3]=d;a=3;}c=0;while(1){if((c|0)>=(a|0))break a;j=b+(c<<3)|0;h[j>>3]=+h[j>>3]-g;c=c+1|0;}}while(0);return a|0}function CY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+16>>3];do if(!(c<1.0e-07&c>-1.0e-07)){d=+h[a+8>>3]/(c*2.0);c=d*d-+h[a>>3]/c;if(!(c<0.0))if(c==0.0){h[b>>3]=-d;a=1;break}else {c=+C(+c)-d;h[b>>3]=c;h[b+8>>3]=d*-2.0-c;a=2;break}else a=0;}else a=DY(a,b)|0;while(0);return a|0}function DY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a+8>>3];c=+h[a>>3];if(d<1.0e-07&d>-1.0e-07)a=c<1.0e-07&c>-1.0e-07?4:0;else {h[b>>3]=-c/d;a=1;}return a|0}function EY(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function FY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=c[a+4>>2]|0;i=(e*3|0)+-2|0;d=c[47518]|0;if((i|0)>(c[47517]|0)){if(!d)d=T1(i<<4)|0;else d=W1(d,i<<4)|0;c[47518]=d;c[47517]=i;h=d;g=d;}else {h=d;g=d;}f=c[a>>2]|0;c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];X6(h+16|0,f|0,16)|0;e=e+-1|0;d=1;a=2;while(1){if((d|0)>=(e|0))break;j=h+(a+2<<4)|0;k=h+(a+1<<4)|0;m=h+(a<<4)|0;l=f+(d<<4)|0;c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];X6(k|0,l|0,16)|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];d=d+1|0;a=a+3|0;}l=h+(a<<4)|0;m=f+(d<<4)|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];X6(h+(a+1<<4)|0,m|0,16)|0;c[b+4>>2]=i;c[b>>2]=g;return}function GY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];d=(+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d);return (d>.0001?1:(d<-.0001)<<31>>31)|0}function HY(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;e=+h[a>>3];f=+h[b>>3];if(e!=f){d=+h[c>>3];if(!(e>3];e=+h[c+8>>3];d=+h[b+8>>3];if(!(f>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];j=GY(g,h,i)|0;if((j|0)==0?(c[g>>2]=c[a>>2],c[g+4>>2]=c[a+4>>2],c[g+8>>2]=c[a+8>>2],c[g+12>>2]=c[a+12>>2],c[h>>2]=c[b>>2],c[h+4>>2]=c[b+4>>2],c[h+8>>2]=c[b+8>>2],c[h+12>>2]=c[b+12>>2],c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],(HY(g,h,i)|0)!=0):0)f=1;else k=3;do if((k|0)==3){c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];c[i>>2]=c[e>>2];c[i+4>>2]=c[e+4>>2];c[i+8>>2]=c[e+8>>2];c[i+12>>2]=c[e+12>>2];f=GY(g,h,i)|0;if((f|0)==0?(c[g>>2]=c[a>>2],c[g+4>>2]=c[a+4>>2],c[g+8>>2]=c[a+8>>2],c[g+12>>2]=c[a+12>>2],c[h>>2]=c[b>>2],c[h+4>>2]=c[b+4>>2],c[h+8>>2]=c[b+8>>2],c[h+12>>2]=c[b+12>>2],c[i>>2]=c[e>>2],c[i+4>>2]=c[e+4>>2],c[i+8>>2]=c[e+8>>2],c[i+12>>2]=c[e+12>>2],HY(g,h,i)|0):0){f=1;break};c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[i>>2]=c[a>>2];c[i+4>>2]=c[a+4>>2];c[i+8>>2]=c[a+8>>2];c[i+12>>2]=c[a+12>>2];a=GY(g,h,i)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];k=(O(f,j)|0)<0;f=(O(GY(g,h,i)|0,a)|0)>>>31;f=k?f:0;}while(0);l=m;return f|0}function JY(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(d*d+c*c)}function KY(a){a=a|0;c[a+24>>2]=LY(c[a+4>>2]|0)|0;MY(a);return}function LY(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+2|0;f=T1(e<<2)|0;b=V1(O(a,a)|0,8)|0;d=0;while(1){if((d|0)>=(a|0))break;c[f+(d<<2)>>2]=b;b=b+(a<<3)|0;d=d+1|0;}while(1){if((a|0)>=(e|0))break;c[f+(a<<2)>>2]=0;a=a+1|0;}return f|0}function MY(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;p=l;l=l+32|0;i=p+16|0;g=p;j=c[a+4>>2]|0;m=c[a+8>>2]|0;n=c[a+16>>2]|0;o=c[a+20>>2]|0;d=c[a+24>>2]|0;b=0;while(1){if((b|0)>=(j|0))break;q=c[o+(b<<2)>>2]|0;e=m+(b<<4)|0;f=m+(q<<4)|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];r=+NY(g,i);f=c[d+(b<<2)>>2]|0;h[f+(q<<3)>>3]=r;h[(c[d+(q<<2)>>2]|0)+(b<<3)>>3]=r;a=b+-1|0;a=(q|0)==(a|0)?b+-2|0:a;while(1){if((a|0)<=-1)break;if((OY(b,a,m,n,o)|0?OY(a,b,m,n,o)|0:0)?(k=m+(a<<4)|0,c[g>>2]=c[e>>2],c[g+4>>2]=c[e+4>>2],c[g+8>>2]=c[e+8>>2],c[g+12>>2]=c[e+12>>2],c[i>>2]=c[k>>2],c[i+4>>2]=c[k+4>>2],c[i+8>>2]=c[k+8>>2],c[i+12>>2]=c[k+12>>2],PY(g,i,j,j,j,m,n)|0):0){c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];r=+NY(g,i);h[f+(a<<3)>>3]=r;h[(c[d+(a<<2)>>2]|0)+(b<<3)>>3]=r;}a=a+-1|0;}b=b+1|0;}l=p;return}function NY(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0;e=l;l=l+32|0;f=e+16|0;g=e;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];d=+C(+(+JY(g,f)));l=e;return +d}function OY(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;g=l;l=l+64|0;h=g+48|0;i=g+32|0;j=g+16|0;k=g;n=d+(c[f+(a<<2)>>2]<<4)|0;m=d+(a<<4)|0;e=d+(c[e+(a<<2)>>2]<<4)|0;f=d+(b<<4)|0;c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];c[i>>2]=c[e>>2];c[i+4>>2]=c[e+4>>2];c[i+8>>2]=c[e+8>>2];c[i+12>>2]=c[e+12>>2];c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];f=QY(k,j,i,h)|0;l=g;return f|0}function PY(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+64|0;n=p+48|0;m=p+32|0;k=p+16|0;j=p;i=0;while(1){if((i|0)>=(d|0)){o=4;break}r=g+(i<<4)|0;q=g+(c[h+(i<<2)>>2]<<4)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[m>>2]=c[r>>2];c[m+4>>2]=c[r+4>>2];c[m+8>>2]=c[r+8>>2];c[m+12>>2]=c[r+12>>2];c[n>>2]=c[q>>2];c[n+4>>2]=c[q+4>>2];c[n+8>>2]=c[q+8>>2];c[n+12>>2]=c[q+12>>2];if(!(IY(j,k,m,n)|0))i=i+1|0;else {e=0;break}}a:do if((o|0)==4)while(1){if((e|0)>=(f|0)){e=1;break a}q=g+(e<<4)|0;r=g+(c[h+(e<<2)>>2]<<4)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[m>>2]=c[q>>2];c[m+4>>2]=c[q+4>>2];c[m+8>>2]=c[q+8>>2];c[m+12>>2]=c[q+12>>2];c[n>>2]=c[r>>2];c[n+4>>2]=c[r+4>>2];c[n+8>>2]=c[r+8>>2];c[n+12>>2]=c[r+12>>2];if(!(IY(j,k,m,n)|0)){e=e+1|0;o=4;}else {e=0;break}}while(0);l=p;return e|0}function QY(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=l;l=l+48|0;h=g+32|0;i=g+16|0;j=g;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[i>>2]=c[a>>2];c[i+4>>2]=c[a+4>>2];c[i+8>>2]=c[a+8>>2];c[i+12>>2]=c[a+12>>2];c[h>>2]=c[b>>2];c[h+4>>2]=c[b+4>>2];c[h+8>>2]=c[b+8>>2];c[h+12>>2]=c[b+12>>2];f=GY(j,i,h)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];e=GY(j,i,h)|0;c[j>>2]=c[a>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];d=(GY(j,i,h)|0)>0;l=g;return (d?e|f:e&f)>>>31^1|0}function RY(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;s=l;l=l+80|0;j=s+64|0;i=s+48|0;g=s+32|0;k=s+16|0;o=s;p=c[a+4>>2]|0;q=c[a+8>>2]|0;r=c[a+16>>2]|0;m=c[a+20>>2]|0;n=T1((p<<3)+16|0)|0;if((b|0)==-2222){c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];b=SY(a,j)|0;}if((b|0)>-1){a=c[a+12>>2]|0;f=c[a+(b+1<<2)>>2]|0;a=c[a+(b<<2)>>2]|0;}else {f=p;a=p;}b=0;while(1){if((b|0)>=(a|0)){b=a;break}u=q+(b<<4)|0;c[o>>2]=c[u>>2];c[o+4>>2]=c[u+4>>2];c[o+8>>2]=c[u+8>>2];c[o+12>>2]=c[u+12>>2];u=q+(c[m+(b<<2)>>2]<<4)|0;t=q+(c[r+(b<<2)>>2]<<4)|0;c[k>>2]=c[u>>2];c[k+4>>2]=c[u+4>>2];c[k+8>>2]=c[u+8>>2];c[k+12>>2]=c[u+12>>2];c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];if((QY(k,g,i,j)|0)!=0?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[j>>2]=c[o>>2],c[j+4>>2]=c[o+4>>2],c[j+8>>2]=c[o+8>>2],c[j+12>>2]=c[o+12>>2],(PY(i,j,a,f,p,q,r)|0)!=0):0){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];c[j+12>>2]=c[o+12>>2];e=+NY(i,j);}else e=0.0;h[n+(b<<3)>>3]=e;b=b+1|0;}while(1){if((b|0)>=(f|0)){b=f;break}h[n+(b<<3)>>3]=0.0;b=b+1|0;}while(1){if((b|0)>=(p|0))break;t=q+(b<<4)|0;c[o>>2]=c[t>>2];c[o+4>>2]=c[t+4>>2];c[o+8>>2]=c[t+8>>2];c[o+12>>2]=c[t+12>>2];t=q+(c[m+(b<<2)>>2]<<4)|0;u=q+(c[r+(b<<2)>>2]<<4)|0;c[k>>2]=c[t>>2];c[k+4>>2]=c[t+4>>2];c[k+8>>2]=c[t+8>>2];c[k+12>>2]=c[t+12>>2];c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];if((QY(k,g,i,j)|0)!=0?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[j>>2]=c[o>>2],c[j+4>>2]=c[o+4>>2],c[j+8>>2]=c[o+8>>2],c[j+12>>2]=c[o+12>>2],(PY(i,j,a,f,p,q,r)|0)!=0):0){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];c[j+12>>2]=c[o+12>>2];e=+NY(i,j);}else e=0.0;h[n+(b<<3)>>3]=e;b=b+1|0;}h[n+(p<<3)>>3]=0.0;h[n+(p+1<<3)>>3]=0.0;l=s;return n|0}function SY(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;m=l;l=l+32|0;f=m+8|0;e=m;h=m+24|0;i=a+8|0;j=a+12|0;k=h+4|0;d=0;while(1){if((d|0)>=(c[a>>2]|0)){d=-1111;break}o=c[j>>2]|0;n=c[o+(d<<2)>>2]|0;c[h>>2]=(c[i>>2]|0)+(n<<4);g=d+1|0;c[k>>2]=(c[o+(g<<2)>>2]|0)-n;c[e>>2]=c[h>>2];c[e+4>>2]=c[h+4>>2];c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];if(!(NX(e,f)|0))d=g;else break}l=m;return d|0}function TY(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+64|0;n=t+48|0;m=t+32|0;p=t+16|0;o=t;r=c[f+4>>2]|0;s=c[f+8>>2]|0;q=c[f+16>>2]|0;g=(e|0)<0;do if((b|0)<0)if(g){g=0;i=0;f=0;h=0;}else {b=c[f+12>>2]|0;f=0;h=0;i=e;j=b;b=b+(e<<2)|0;k=9;}else {if(g){k=c[f+12>>2]|0;f=0;h=0;i=b;j=k;b=k+(b<<2)|0;k=9;break}g=c[f+12>>2]|0;if((b|0)>(e|0)){f=c[g+(e+1<<2)>>2]|0;h=c[g+(e<<2)>>2]|0;i=b;j=g;b=g+(b<<2)|0;k=9;break}else {f=c[g+(b+1<<2)>>2]|0;h=c[g+(b<<2)>>2]|0;i=e;j=g;b=g+(e<<2)|0;k=9;break}}while(0);if((k|0)==9){g=c[j+(i+1<<2)>>2]|0;i=c[b>>2]|0;}b=0;while(1){if((b|0)>=(h|0)){k=13;break}j=s+(b<<4)|0;e=s+(c[q+(b<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[j>>2];c[m+4>>2]=c[j+4>>2];c[m+8>>2]=c[j+8>>2];c[m+12>>2]=c[j+12>>2];c[n>>2]=c[e>>2];c[n+4>>2]=c[e+4>>2];c[n+8>>2]=c[e+8>>2];c[n+12>>2]=c[e+12>>2];if(!(IY(o,p,m,n)|0))b=b+1|0;else {g=0;break}}a:do if((k|0)==13){while(1){if((f|0)>=(i|0))break;e=s+(f<<4)|0;k=s+(c[q+(f<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];if(!(IY(o,p,m,n)|0)){f=f+1|0;k=13;}else {g=0;break a}}while(1){if((g|0)>=(r|0)){g=1;break a}e=s+(g<<4)|0;k=s+(c[q+(g<<2)>>2]<<4)|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];if(!(IY(o,p,m,n)|0))g=g+1|0;else {g=0;break}}}while(0);l=t;return g|0}function UY(a){a=a|0;return VY(a,0,0)|0}function VY(a,b,c){a=a|0;b=b|0;c=c|0;return WY(a,b,c,0)|0}function WY(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;if(!d){g=T1(496)|0;if(!g)g=0;else {c[g+12>>2]=35;c[g+16>>2]=107;c[g+20>>2]=105;d=35;h=6;}}else {g=kb[c[d>>2]&63](496)|0;if(!g)g=0;else {h=c[d>>2]|0;c[g+12>>2]=h;c[g+16>>2]=c[d+4>>2];c[g+20>>2]=c[d+8>>2];d=h;h=6;}}do if((h|0)==6){c[g+8>>2]=0;c[g+32>>2]=0;c[g+376>>2]=16;j=g+12|0;i=kb[d&63](256)|0;d=g+388|0;c[d>>2]=i;if(!i){tb[c[g+20>>2]&127](g);g=0;break}h=kb[c[j>>2]&63](1024)|0;i=g+44|0;c[i>>2]=h;if(!h){e=g+20|0;tb[c[e>>2]&127](c[d>>2]|0);tb[c[e>>2]&127](g);g=0;break}c[g+48>>2]=h+1024;if(!f){f=XY(j)|0;c[g+352>>2]=f;if(!f){e=g+20|0;tb[c[e>>2]&127](c[i>>2]|0);tb[c[e>>2]&127](c[d>>2]|0);tb[c[e>>2]&127](g);g=0;break}}else c[g+352>>2]=f;c[g+372>>2]=0;c[g+364>>2]=0;c[g+300>>2]=0;c[g+464>>2]=0;c[g+460>>2]=0;c[g+124>>2]=0;c[g+244>>2]=0;d=g+468|0;a[d>>0]=33;h=g+232|0;a[h>>0]=0;a[g+233>>0]=0;c[g+392>>2]=0;c[g+396>>2]=0;a[g+400>>0]=0;f=g+228|0;c[f>>2]=0;YY(g+412|0,j);YY(g+436|0,j);ZY(g,b);if(b|0?(c[f>>2]|0)==0:0){_Y(g);g=0;break}if(!e){c[g+224>>2]=i$()|0;break}else {a[h>>0]=1;c[g+224>>2]=O0()|0;a[d>>0]=a[e>>0]|0;break}}while(0);return g|0}function XY(b){b=b|0;var d=0;d=kb[c[b>>2]&63](188)|0;if(d|0){YY(d+80|0,b);YY(d+104|0,b);f_(d,b);f_(d+20|0,b);f_(d+40|0,b);f_(d+60|0,b);a[d+131>>0]=0;f_(d+132|0,b);c[d+152>>2]=0;c[d+156>>2]=0;a[d+160>>0]=0;b=d+164|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;a[d+128>>0]=1;a[d+129>>0]=0;a[d+130>>0]=0;}return d|0}function YY(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=b;return}function ZY(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;c[d+276>>2]=56;V0(d+252|0);if(e|0)c[d+228>>2]=gZ(e,d+12|0)|0;c[d+356>>2]=0;Y$(d+148|0,d+144|0,0)|0;c[d>>2]=0;c[d+4>>2]=0;e=d+116|0;g=d+52|0;h=g+64|0;do{c[g>>2]=0;g=g+4|0;}while((g|0)<(h|0));c[e>>2]=d;c[d+120>>2]=0;e=d+128|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;e=c[d+8>>2]|0;c[d+24>>2]=e;c[d+28>>2]=e;c[d+36>>2]=0;c[d+40>>2]=0;e=d+312|0;g=d+404|0;c[g>>2]=0;c[g+4>>2]=0;g=d+280|0;f=d+304|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;g=e;h=g+36|0;do{c[g>>2]=0;g=g+4|0;}while((g|0)<(h|0));b[e+36>>1]=0;a[f>>0]=1;c[d+308>>2]=0;c[d+360>>2]=0;c[d+368>>2]=0;c[d+380>>2]=0;c[d+236>>2]=0;c[d+248>>2]=0;c[d+240>>2]=0;c[d+472>>2]=0;c[d+476>>2]=0;a[d+484>>0]=0;a[d+485>>0]=0;c[d+488>>2]=0;c[d+492>>2]=0;return}function _Y(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;if(b|0){e=b+364|0;g=b+20|0;d=c[b+360>>2]|0;while(1){if(!d){d=c[e>>2]|0;if(!d)break;c[e>>2]=0;}h=c[d>>2]|0;tb[c[g>>2]&127](c[d+36>>2]|0);$Y(c[d+44>>2]|0,b);tb[c[g>>2]&127](d);d=h;}e=b+300|0;d=c[b+296>>2]|0;while(1){if(!d){d=c[e>>2]|0;if(!d)break;c[e>>2]=0;}h=c[d+8>>2]|0;tb[c[g>>2]&127](d);d=h;}$Y(c[b+372>>2]|0,b);$Y(c[b+368>>2]|0,b);aZ(b+412|0);aZ(b+436|0);d=b+12|0;tb[c[g>>2]&127](c[b+228>>2]|0);if((a[b+484>>0]|0)==0?(f=c[b+352>>2]|0,f|0):0)bZ(f,(c[b+472>>2]|0)==0&1,d);tb[c[g>>2]&127](c[b+388>>2]|0);tb[c[g>>2]&127](c[b+460>>2]|0);tb[c[g>>2]&127](c[b+8>>2]|0);tb[c[g>>2]&127](c[b+44>>2]|0);tb[c[g>>2]&127](c[b+392>>2]|0);tb[c[g>>2]&127](c[b+236>>2]|0);d=c[b+248>>2]|0;if(d|0)tb[d&127](c[b+240>>2]|0);tb[c[g>>2]&127](b);}return}function $Y(a,b){a=a|0;b=b|0;var d=0;b=b+20|0;while(1){if(!a)break;d=c[a+4>>2]|0;tb[c[b>>2]&127](c[a+16>>2]|0);tb[c[b>>2]&127](a);a=d;}return}function aZ(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;b=c[a>>2]|0;while(1){if(!b)break;e=c[b>>2]|0;tb[c[(c[d>>2]|0)+8>>2]&127](b);b=e;}b=c[a+4>>2]|0;while(1){if(!b)break;e=c[b>>2]|0;tb[c[(c[d>>2]|0)+8>>2]&127](b);b=e;}return}function bZ(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=a+20|0;cZ(f,g);d=d+8|0;while(1){e=dZ(f)|0;if(!e)break;if(!(c[e+16>>2]|0))continue;tb[c[d>>2]&127](c[e+20>>2]|0);}eZ(a);eZ(a+132|0);eZ(g);eZ(a+40|0);eZ(a+60|0);aZ(a+80|0);aZ(a+104|0);if(b<<24>>24){tb[c[d>>2]&127](c[a+184>>2]|0);tb[c[d>>2]&127](c[a+164>>2]|0);}tb[c[d>>2]&127](a);l=h;return}function cZ(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;c[a>>2]=d;c[a+4>>2]=d+(c[b+8>>2]<<2);return}function dZ(a){a=a|0;var b=0,d=0,e=0;d=c[a+4>>2]|0;e=c[a>>2]|0;do{if((e|0)==(d|0)){b=0;break}b=e;e=e+4|0;c[a>>2]=e;b=c[b>>2]|0;}while(!(b|0));return b|0}function eZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=a+8|0;e=a+16|0;b=0;while(1){f=c[(c[e>>2]|0)+8>>2]|0;g=c[a>>2]|0;if(b>>>0>=(c[d>>2]|0)>>>0)break;tb[f&127](c[g+(b<<2)>>2]|0);b=b+1|0;}tb[f&127](g);return}function fZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=hZ(a)|0;if(!f){c[a+276>>2]=57;f=iZ(a,b,d,e)|0;}return f|0}function gZ(b,d){b=b|0;d=d|0;var e=0,f=0;e=0;do{f=e;e=e+1|0;}while((a[b+f>>0]|0)!=0);d=kb[c[d>>2]&63](e)|0;if(!d)d=0;else W6(d|0,b|0,e|0)|0;return d|0}function hZ(b){b=b|0;var d=0;d=b+228|0;if(!(nb[(a[b+232>>0]<<24>>24?38:37)&63](b+148|0,b+144|0,c[d>>2]|0)|0))b=e_(b,c[d>>2]|0)|0;else b=0;return b|0}function iZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=l;l=l+16|0;h=g;c[h>>2]=d;j=b+144|0;i=c[j>>2]|0;i=ob[c[i>>2]&127](i,d,e,h)|0;f=jZ(b,c[j>>2]|0,d,e,i,c[h>>2]|0,f,(a[b+480>>0]|0)==0&1)|0;l=g;return f|0}function jZ(b,e,f,g,h,i,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0;Ga=l;l=l+16|0;Da=Ga;c[Da>>2]=i;r=c[b+352>>2]|0;s=b+144|0;if((c[s>>2]|0)==(e|0)){p=b+284|0;q=b+288|0;na=b+296|0;}else {na=b+296|0;q=c[na>>2]|0;p=q;q=q+4|0;}t=k<<24>>24!=0;pa=b+252|0;u=b+80|0;v=b+476|0;w=b+84|0;x=b+320|0;y=b+412|0;z=b+316|0;A=b+424|0;B=b+428|0;C=b+324|0;ra=b+4|0;D=b+485|0;E=r+132|0;F=b+312|0;ta=r+129|0;G=r+128|0;H=r+80|0;I=r+92|0;J=r+96|0;K=b+136|0;L=b+88|0;M=b+488|0;va=b+112|0;wa=r+131|0;xa=b+116|0;ya=r+130|0;za=b+108|0;Aa=b+356|0;N=b+340|0;O=b+132|0;P=b+344|0;Q=b+348|0;R=b+328|0;S=b+349|0;T=b+420|0;U=r+120|0;V=r+116|0;W=b+92|0;X=b+472|0;Y=b+336|0;Z=b+332|0;_=b+96|0;$=b+256|0;aa=b+464|0;ba=b+460|0;ca=r+160|0;da=r+184|0;ea=r+180|0;fa=r+164|0;ga=b+128|0;ha=b+12|0;ia=b+16|0;ja=b+268|0;ka=b+120|0;la=r+176|0;ma=r+168|0;o=e;n=f;e=h;a:while(1){c[p>>2]=n;f=c[Da>>2]|0;c[q>>2]=f;i=f;b:do if((e|0)<1){if(t&(e|0)!=0){m=7;break a}switch(e|0){case -1:{i=5;m=280;break a}case 0:{m=9;break a}case -2:{i=6;break a}case -4:{m=10;break a}case -15:{e=15;break b}default:{}}c[Da>>2]=g;e=0-e|0;i=g;}while(0);h=pb[c[pa>>2]&127](pa,e,n,i,o)|0;c:do switch(h|0){case 2:{m=58;break a}case -1:{m=184;break a}case 1:{i=kZ(b,0,n,c[Da>>2]|0)|0;if(i|0){m=280;break a}i=c[s>>2]|0;break}case 4:{if(!(c[w>>2]|0))i=1;else {m=lZ(y,o,n,c[Da>>2]|0)|0;c[z>>2]=m;if(!m){i=1;m=280;break a}c[B>>2]=c[A>>2];c[C>>2]=0;i=0;}c[x>>2]=0;m=274;break}case 7:{i=c[w>>2]|0;if(!i)m=275;else {yb[i&15](c[ra>>2]|0,c[z>>2]|0,c[x>>2]|0,c[C>>2]|0,1);c[z>>2]=0;mZ(y);i=o;}break}case 57:{i=kZ(b,1,n,c[Da>>2]|0)|0;if(i|0){m=280;break a}i=c[s>>2]|0;break}case 6:{a[D>>0]=0;m=nZ(b,E,75395,36)|0;c[F>>2]=m;if(!m){i=1;m=280;break a}a[ta>>0]=1;if(!(c[w>>2]|0))m=33;else {if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break a}i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}oZ(i);c[B>>2]=c[A>>2];c[C>>2]=i;i=0;m=34;}break}case 14:{m=33;break}case 8:{i=c[z>>2]|0;if(!i)i=1;else {yb[c[w>>2]&15](c[ra>>2]|0,i,c[x>>2]|0,c[C>>2]|0,0);mZ(y);i=0;}if(!((c[x>>2]|0)==0?!(a[D>>0]|0):0)){f=a[ta>>0]|0;a[ta>>0]=1;do if(c[M>>2]|0?c[va>>2]|0:0){h=nZ(b,E,75395,36)|0;if(!h){i=1;m=280;break a}if(!(a[D>>0]|0))e=h+20|0;else {e=h+20|0;c[e>>2]=c[Aa>>2];}a[wa>>0]=0;if(!(pb[c[va>>2]&127](c[xa>>2]|0,0,c[e>>2]|0,c[h+16>>2]|0,c[h+24>>2]|0)|0)){i=21;m=280;break a}if(!(a[wa>>0]|0)){if(c[x>>2]|0)break;a[ta>>0]=f;break}if(((a[ya>>0]|0)==0?(oa=c[za>>2]|0,oa|0):0)?(kb[oa&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}}while(0);a[D>>0]=0;}e=c[L>>2]|0;if(!e)m=274;else {tb[e&127](c[ra>>2]|0);i=o;}break}case 34:{m=qZ(b,o,n,c[Da>>2]|0)|0;c[N>>2]=m;if(!m){i=1;m=280;break a}else m=80;break}case 22:{m=rZ(b,o,n,c[Da>>2]|0)|0;c[P>>2]=m;if(!m){i=1;m=280;break a}a[Q>>0]=0;c[R>>2]=0;a[S>>0]=0;m=80;break}case 23:{a[Q>>0]=1;c[R>>2]=142188;m=80;break}case 24:{a[S>>0]=1;c[R>>2]=142194;m=80;break}case 25:{c[R>>2]=142197;m=80;break}case 26:{c[R>>2]=142203;m=80;break}case 27:{c[R>>2]=142210;m=80;break}case 28:{c[R>>2]=142217;m=80;break}case 29:{c[R>>2]=142226;m=80;break}case 30:{c[R>>2]=142234;m=80;break}case 32:case 31:{if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0){if(!(sZ(y,(c[R>>2]|0)==0?((h|0)==32?142243:142253):142255)|0)){i=1;m=280;break a}if(!(tZ(y,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}c[R>>2]=c[B>>2];i=o;}else m=275;break}case 36:case 35:{if(a[G>>0]|0){if(!(uZ(c[N>>2]|0,c[P>>2]|0,a[Q>>0]|0,a[S>>0]|0,0,b)|0)){i=1;m=280;break a}if((c[O>>2]|0)!=0?(qa=c[R>>2]|0,(qa|0)!=0):0){switch(a[qa>>0]|0){case 40:{m=93;break}case 78:{if((a[qa+1>>0]|0)==79)m=93;break}default:{}}if((m|0)==93){m=0;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=41;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=0;c[R>>2]=c[B>>2];c[B>>2]=c[A>>2];}c[q>>2]=n;zb[c[O>>2]&15](c[ra>>2]|0,c[c[N>>2]>>2]|0,c[c[P>>2]>>2]|0,c[R>>2]|0,0,(h|0)==36&1);mZ(y);i=o;}else m=275;}else m=275;break}case 38:case 37:{if(a[G>>0]|0){i=c[o+64>>2]|0;i=wZ(b,o,a[Q>>0]|0,n+i|0,(c[Da>>2]|0)+(0-i)|0,H)|0;if(i|0){m=280;break a}e=c[J>>2]|0;c[J>>2]=c[I>>2];if(!(uZ(c[N>>2]|0,c[P>>2]|0,a[Q>>0]|0,0,e,b)|0)){i=1;m=280;break a}if((c[O>>2]|0)!=0?(sa=c[R>>2]|0,(sa|0)!=0):0){switch(a[sa>>0]|0){case 40:{m=108;break}case 78:{if((a[sa+1>>0]|0)==79)m=108;break}default:{}}if((m|0)==108){m=0;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=41;i=c[A>>2]|0;if((i|0)==(c[T>>2]|0)){if(!((vZ(y)|0)<<24>>24)){i=1;m=280;break a}i=c[A>>2]|0;}c[A>>2]=i+1;a[i>>0]=0;c[R>>2]=c[B>>2];c[B>>2]=c[A>>2];}c[q>>2]=n;zb[c[O>>2]&15](c[ra>>2]|0,c[c[N>>2]>>2]|0,c[c[P>>2]>>2]|0,c[R>>2]|0,e,(h|0)==38&1);mZ(y);i=o;}else m=275;}else m=275;break}case 12:{if(a[G>>0]|0){i=c[o+64>>2]|0;i=xZ(b,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;e=c[F>>2]|0;f=c[U>>2]|0;if(e){c[e+4>>2]=f;c[(c[F>>2]|0)+8>>2]=(c[V>>2]|0)-(c[U>>2]|0);c[U>>2]=c[V>>2];if(!(c[K>>2]|0))e=1;else {c[q>>2]=n;e=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[e>>2]|0,d[e+33>>0]|0,c[e+4>>2]|0,c[e+8>>2]|0,c[Aa>>2]|0,0,0,0);e=0;}}else {c[V>>2]=f;e=1;}if(!i){i=e;m=274;}else {m=280;break a}}else m=275;break}case 5:{a[D>>0]=0;a[ta>>0]=1;if(!(c[w>>2]|0)){c[x>>2]=75395;i=1;}else {m=c[o+64>>2]|0;m=lZ(y,o,n+m|0,(c[Da>>2]|0)+(0-m)|0)|0;c[x>>2]=m;if(!m){i=1;m=280;break a}c[B>>2]=c[A>>2];i=0;}if((((a[ya>>0]|0)==0?(c[M>>2]|0)==0:0)?(ua=c[za>>2]|0,ua|0):0)?(kb[ua&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}if(!(c[F>>2]|0)){e=nZ(b,E,75395,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}c[e+24>>2]=0;m=133;}else m=133;break}case 13:{i=1;m=133;break}case 15:{if(((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0)?(c[K>>2]|0)!=0:0){c[q>>2]=n;i=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[i>>2]|0,d[i+33>>0]|0,0,0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,0);i=o;}else m=275;break}case 16:{if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){h=lZ(H,o,n,c[Da>>2]|0)|0;c[(c[F>>2]|0)+28>>2]=h;if(!(c[(c[F>>2]|0)+28>>2]|0)){i=1;m=280;break a}c[J>>2]=c[I>>2];if(c[W>>2]|0){c[q>>2]=n;i=c[F>>2]|0;zb[c[W>>2]&15](c[ra>>2]|0,c[i>>2]|0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,c[i+28>>2]|0);i=o;break c}if(c[K>>2]|0){c[q>>2]=n;i=c[F>>2]|0;Ab[c[K>>2]&0](c[ra>>2]|0,c[i>>2]|0,0,0,0,c[i+20>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0,c[i+28>>2]|0);i=o;}else m=275;}else m=275;break}case 9:{if(nb[c[o+44>>2]&63](o,n,c[Da>>2]|0)|0){c[F>>2]=0;m=275;break c}if(!(a[G>>0]|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}i=lZ(H,o,n,c[Da>>2]|0)|0;if(!i){i=1;m=280;break a}e=nZ(b,r,i,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}if((c[e>>2]|0)!=(i|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}c[J>>2]=c[I>>2];c[(c[F>>2]|0)+24>>2]=0;a[(c[F>>2]|0)+33>>0]=0;if(!(c[X>>2]|0))i=(c[na>>2]|0)!=0;else i=1;a[(c[F>>2]|0)+34>>0]=(i^1)&1;if(!(c[K>>2]|0))m=275;else i=o;break}case 10:{if(!(a[G>>0]|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}i=lZ(H,o,n,c[Da>>2]|0)|0;if(!i){i=1;m=280;break a}e=nZ(b,E,i,36)|0;c[F>>2]=e;if(!e){i=1;m=280;break a}if((c[e>>2]|0)!=(i|0)){c[I>>2]=c[J>>2];c[F>>2]=0;m=275;break c}c[J>>2]=c[I>>2];c[(c[F>>2]|0)+24>>2]=0;a[(c[F>>2]|0)+33>>0]=1;if(!(c[X>>2]|0))i=(c[na>>2]|0)!=0;else i=1;a[(c[F>>2]|0)+34>>0]=(i^1)&1;if(!(c[K>>2]|0))m=275;else i=o;break}case 18:{c[Y>>2]=0;c[Z>>2]=0;if(!(c[_>>2]|0))m=275;else {n=lZ(y,o,n,c[Da>>2]|0)|0;c[Z>>2]=n;if(!n){i=1;m=280;break a}c[B>>2]=c[A>>2];i=o;}break}case 21:{if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break a}if(!(c[Z>>2]|0))m=275;else {i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}oZ(i);c[Y>>2]=i;c[B>>2]=c[A>>2];i=o;}break}case 19:{if((c[Z>>2]|0)!=0?(c[_>>2]|0)!=0:0){i=c[o+64>>2]|0;i=lZ(y,o,n+i|0,(c[Da>>2]|0)+(0-i)|0)|0;if(!i){i=1;m=280;break a}c[q>>2]=n;yb[c[_>>2]&15](c[ra>>2]|0,c[Z>>2]|0,c[Aa>>2]|0,i,c[Y>>2]|0);i=0;}else i=1;mZ(y);m=274;break}case 20:{if((c[Y>>2]|0)!=0?(c[_>>2]|0)!=0:0){c[q>>2]=n;yb[c[_>>2]&15](c[ra>>2]|0,c[Z>>2]|0,c[Aa>>2]|0,0,c[Y>>2]|0);i=0;}else i=1;mZ(y);m=274;break}case 58:{if(c[u>>2]|0)yZ(b,o,n,c[Da>>2]|0);i=zZ(b,o,Da,g,j,k)|0;if(i|0){m=280;break a}if(!(c[Da>>2]|0)){m=189;break a}else i=o;break}case 44:{i=c[aa>>2]|0;do if((c[$>>2]|0)>>>0>=i>>>0){if(!i){h=c[ha>>2]|0;c[aa>>2]=32;h=kb[h&63](32)|0;c[ba>>2]=h;if(!h){m=198;break a}else break}f=c[ia>>2]|0;h=c[ba>>2]|0;i=i<<1;c[aa>>2]=i;i=lb[f&127](h,i)|0;if(!i){m=193;break a}c[ba>>2]=i;i=c[da>>2]|0;if(i|0){i=lb[c[ia>>2]&127](i,c[aa>>2]<<2)|0;if(!i){i=1;m=280;break a}c[da>>2]=i;}}while(0);a[(c[ba>>2]|0)+(c[$>>2]|0)>>0]=0;if(a[ca>>0]|0){i=BZ(b)|0;if((i|0)<0){i=1;m=280;break a}c[(c[da>>2]|0)+(c[ea>>2]<<2)>>2]=i;c[ea>>2]=(c[ea>>2]|0)+1;c[(c[fa>>2]|0)+(i*28|0)>>2]=6;if(c[ga>>2]|0)i=o;else m=275;}else m=275;break}case 50:{i=(c[ba>>2]|0)+(c[$>>2]|0)|0;if((a[i>>0]|0)==124){i=2;m=280;break a}a[i>>0]=44;if((a[ca>>0]|0)!=0?(c[ga>>2]|0)!=0:0)i=o;else m=275;break}case 49:{f=c[ba>>2]|0;e=c[$>>2]|0;i=a[f+e>>0]|0;if(i<<24>>24==44){i=2;m=280;break a}if(i<<24>>24==0&(a[ca>>0]|0)!=0?(Ba=(c[fa>>2]|0)+((c[(c[da>>2]|0)+((c[ea>>2]|0)+-1<<2)>>2]|0)*28|0)|0,(c[Ba>>2]|0)!=3):0){c[Ba>>2]=5;i=(c[ga>>2]|0)==0&1;f=c[ba>>2]|0;e=c[$>>2]|0;}else i=1;a[f+e>>0]=124;m=274;break}case 59:case 60:{a[ta>>0]=1;if(c[M>>2]|0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;if(!e){i=1;m=280;break a}f=nZ(b,E,e,0)|0;c[I>>2]=c[J>>2];do if(c[ja>>2]|0){if(!(a[ya>>0]|0)){if(a[ta>>0]|0){m=219;break}}else if(c[na>>2]|0){m=219;break}if(!f){i=11;m=280;break a}if(!(a[f+34>>0]|0)){i=24;m=280;break a}}else m=219;while(0);if((m|0)==219?(m=0,(f|0)==0):0){a[G>>0]=a[ya>>0]|0;if((h|0)!=60){m=275;break c}i=c[ka>>2]|0;if(!i){m=275;break c}vb[i&127](c[ra>>2]|0,e,1);i=o;break c}i=f+32|0;if(a[i>>0]|0){i=12;m=280;break a}if(c[f+4>>2]|0){i=CZ(b,f,(h|0)==60&1)|0;e=(i|0)==0;if(e){i=(e^1)&1;m=274;break c}else {m=280;break a}}if(!(c[va>>2]|0)){a[G>>0]=a[ya>>0]|0;m=275;break c}a[wa>>0]=0;a[i>>0]=1;h=(pb[c[va>>2]&127](c[xa>>2]|0,0,c[f+20>>2]|0,c[f+16>>2]|0,c[f+24>>2]|0)|0)==0;a[i>>0]=0;if(h){i=21;m=280;break a}e=a[ya>>0]|0;if(!(a[wa>>0]|0)){a[G>>0]=e;i=o;break c}else i=0;}else {e=a[ya>>0]|0;a[G>>0]=e;i=1;}if((e<<24>>24==0?(Ca=c[za>>2]|0,(Ca|0)!=0):0)?(kb[Ca&63](c[ra>>2]|0)|0)==0:0){i=22;m=280;break a}else m=274;break}case 40:{if(!(c[ga>>2]|0))m=275;else {n=qZ(b,o,n,c[Da>>2]|0)|0;c[N>>2]=n;if(!n){i=1;m=280;break a}c[ea>>2]=0;c[la>>2]=0;a[ca>>0]=1;i=o;}break}case 42:case 41:{if(!(a[ca>>0]|0))m=275;else {if(!(c[ga>>2]|0))i=1;else {i=kb[c[ha>>2]&63](20)|0;if(!i){i=1;m=280;break a}m=i+4|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[i>>2]=(h|0)==41?2:1;c[q>>2]=n;vb[c[ga>>2]&127](c[ra>>2]|0,c[c[N>>2]>>2]|0,i);i=0;}a[ca>>0]=0;m=274;}break}case 43:{if((a[ca>>0]|0)!=0?(c[(c[fa>>2]|0)+((c[(c[da>>2]|0)+((c[ea>>2]|0)+-1<<2)>>2]|0)*28|0)>>2]=3,(c[ga>>2]|0)!=0):0)i=o;else m=275;break}case 51:{e=0;m=247;break}case 53:{e=1;m=247;break}case 52:{e=2;m=247;break}case 54:{e=3;m=247;break}case 45:{f=0;m=258;break}case 47:{f=1;m=258;break}case 46:{f=2;m=258;break}case 48:{f=3;m=258;break}case 55:{if(!(EZ(b,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}else i=o;break}case 56:{if(!(FZ(b,o,n,c[Da>>2]|0)|0)){i=1;m=280;break a}else i=o;break}case 0:{if((e|0)==14)i=o;else m=275;break}case 3:{if(!(c[w>>2]|0))m=275;else i=o;break}case 11:{if((a[G>>0]|0)!=0?(c[K>>2]|0)!=0:0)i=o;else m=275;break}case 17:{if(!(c[_>>2]|0))m=275;else i=o;break}case 33:{if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0)i=o;else m=275;break}case 39:{if(!(c[ga>>2]|0))m=275;else i=o;break}default:m=275;}while(0);if((m|0)==33)if(!(ob[c[o+52>>2]&127](o,n,c[Da>>2]|0,p)|0)){i=32;m=280;break}else {i=1;m=34;}else if((m|0)==80){m=0;if((a[G>>0]|0)!=0?(c[O>>2]|0)!=0:0)i=o;else m=275;}else if((m|0)==133){m=0;if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;c[(c[F>>2]|0)+16>>2]=e;e=c[F>>2]|0;if(!(c[e+16>>2]|0)){i=1;m=280;break}c[e+20>>2]=c[Aa>>2];c[J>>2]=c[I>>2];if((h|0)==13&(c[K>>2]|0)!=0)i=o;else m=274;}else m=274;}else if((m|0)==247){m=0;if(a[ca>>0]|0){i=c[Da>>2]|0;if(e)i=i+(0-(c[o+64>>2]|0))|0;f=BZ(b)|0;if((f|0)<0){i=1;m=280;break}c[(c[fa>>2]|0)+(f*28|0)>>2]=4;c[(c[fa>>2]|0)+(f*28|0)+4>>2]=e;i=qZ(b,o,n,i)|0;if(!i){i=1;m=280;break}e=c[i>>2]|0;c[(c[fa>>2]|0)+(f*28|0)+8>>2]=e;i=0;do{h=i;i=i+1|0;}while((a[e+h>>0]|0)!=0);c[ma>>2]=(c[ma>>2]|0)+i;if(c[ga>>2]|0)i=o;else m=275;}else m=275;}else if((m|0)==258)if(a[ca>>0]|0){e=(c[ga>>2]|0)==0;i=e&1;m=(c[ea>>2]|0)+-1|0;c[ea>>2]=m;c[(c[fa>>2]|0)+((c[(c[da>>2]|0)+(m<<2)>>2]|0)*28|0)+4>>2]=f;if(!(c[ea>>2]|0)){if(!e){e=DZ(b)|0;if(!e){i=1;m=280;break}c[q>>2]=n;vb[c[ga>>2]&127](c[ra>>2]|0,c[c[N>>2]>>2]|0,e);}a[ca>>0]=0;c[ma>>2]=0;m=274;}else m=274;}else m=275;if((m|0)==34){m=0;if((a[G>>0]|0)!=0?(c[F>>2]|0)!=0:0){e=c[o+64>>2]|0;e=lZ(H,o,n+e|0,(c[Da>>2]|0)+(0-e)|0)|0;if(!e){i=1;m=280;break}oZ(e);c[(c[F>>2]|0)+24>>2]=e;c[J>>2]=c[I>>2];if((h|0)==14&(c[K>>2]|0)!=0)i=o;else m=274;}else m=274;}if((m|0)==274){m=0;if(!(i<<24>>24))i=o;else m=275;}if((m|0)==275){m=0;if(!(c[u>>2]|0))i=o;else {yZ(b,o,n,c[Da>>2]|0);i=o;}}switch(c[v>>2]|0){case 3:{m=278;break a}case 2:{i=35;m=280;break a}default:{}}e=c[Da>>2]|0;o=i;n=e;e=ob[c[i>>2]&127](i,e,g,Da)|0;}d:switch(m|0){case 7:{c[j>>2]=n;i=0;break}case 9:{c[p>>2]=f;i=4;break}case 10:{i=(o|0)==(c[s>>2]|0);if(!i?(a[(c[na>>2]|0)+20>>0]|0)==0:0){c[j>>2]=n;i=0;break}if((a[b+484>>0]|0)!=0|i^1)if((pb[c[pa>>2]&127](pa,-4,g,g,o)|0)==-1)i=29;else {c[j>>2]=n;i=0;}else i=3;break}case 58:{do if((a[D>>0]|0?(Ea=a[ta>>0]|0,a[ta>>0]=1,c[M>>2]|0):0)?c[va>>2]|0:0){i=nZ(b,E,75395,36)|0;if(!i){i=1;break d}Da=i+20|0;c[Da>>2]=c[Aa>>2];a[wa>>0]=0;if(!(pb[c[va>>2]&127](c[xa>>2]|0,0,c[Da>>2]|0,c[i+16>>2]|0,c[i+24>>2]|0)|0)){i=21;break d}if(!(a[wa>>0]|0)){a[ta>>0]=Ea;break}if(((a[ya>>0]|0)==0?(Fa=c[za>>2]|0,Fa|0):0)?(kb[Fa&63](c[ra>>2]|0)|0)==0:0){i=22;break d}}while(0);c[b+276>>2]=58;i=pZ(b,n,g,j)|0;break}case 184:{i=(e|0)==28?10:(e|0)==12?17:2;break}case 189:{c[b+276>>2]=59;i=0;break}case 193:{c[aa>>2]=(c[aa>>2]|0)>>>1;i=1;break}case 198:{c[aa>>2]=0;i=1;break}case 278:{c[j>>2]=c[Da>>2];i=0;break}case 280:break}l=Ga;return i|0}function kZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+32|0;p=q+16|0;m=q+12|0;i=q+8|0;j=q+4|0;k=q;c[p>>2]=0;c[m>>2]=0;c[i>>2]=0;c[k>>2]=-1;n=b+144|0;o=b+284|0;g=(d|0)!=0;a:do if(rb[(a[b+232>>0]<<24>>24?2:1)&3](d,c[n>>2]|0,e,f,o,i,j,p,m,k)|0){if((c[k>>2]|0)==1&(g^1)?(a[(c[b+352>>2]|0)+130>>0]=1,h=b+488|0,(c[h>>2]|0)==1):0)c[h>>2]=0;h=b+140|0;if(!(c[h>>2]|0))if(!(c[b+80>>2]|0)){e=0;d=0;}else {yZ(b,c[n>>2]|0,e,f);e=0;d=0;}else {d=c[p>>2]|0;if(!d)d=0;else {f=c[n>>2]|0;d=lZ(b+436|0,f,d,d+(lb[c[f+28>>2]&127](f,d)|0)|0)|0;if(!d){d=1;break}c[b+452>>2]=c[b+448>>2];}g=c[i>>2]|0;if(g){i=c[n>>2]|0;g=lZ(b+436|0,i,g,(c[j>>2]|0)+(0-(c[i+64>>2]|0))|0)|0;if(!g){d=1;break}}else g=0;xb[c[h>>2]&31](c[b+4>>2]|0,g,d,c[k>>2]|0);e=g;}do if(!(c[b+228>>2]|0)){g=c[m>>2]|0;h=g;if(g|0){k=c[g+64>>2]|0;m=c[n>>2]|0;if((k|0)==(c[m+64>>2]|0)?(k|0)!=2|(g|0)==(m|0):0){c[n>>2]=h;break}c[o>>2]=c[p>>2];d=19;break a}g=c[p>>2]|0;if(g|0){h=b+436|0;if(!d){d=c[n>>2]|0;d=lZ(h,d,g,g+(lb[c[d+28>>2]&127](d,g)|0)|0)|0;if(!d){d=1;break a}}d=e_(b,d)|0;mZ(h);if((d|0)!=18)break a;c[o>>2]=c[p>>2];d=18;break a}}while(0);if((d|0)!=0|(e|0)!=0){mZ(b+436|0);d=0;}else d=0;}else d=g?31:30;while(0);l=q;return d|0}function lZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;do if(!(tZ(b,d,e,f)|0))d=0;else {e=b+12|0;d=c[e>>2]|0;if((d|0)==(c[b+8>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}d=c[e>>2]|0;}c[e>>2]=d+1;a[d>>0]=0;d=c[b+16>>2]|0;}while(0);return d|0}function mZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=a+4|0;b=c[e>>2]|0;a:do if(!b){c[e>>2]=c[a>>2];b=a;}else {d=c[a>>2]|0;while(1){if(!d){b=a;break a}g=c[d>>2]|0;c[d>>2]=b;c[e>>2]=d;f=d;d=g;b=f;}}while(0);c[b>>2]=0;c[a+16>>2]=0;c[a+12>>2]=0;c[a+8>>2]=0;return}function nZ(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;w=e+8|0;a:do if(!(c[w>>2]|0))if(g){a[e+4>>0]=6;c[w>>2]=64;h=e+16|0;i=kb[c[c[h>>2]>>2]&63](256)|0;c[e>>2]=i;if(!i){c[w>>2]=0;h=0;break}else {Y6(i|0,0,256)|0;j=c_(b,f)|0;j=(c[w>>2]|0)+-1&j;i=e;o=27;break}}else h=0;else {v=c_(b,f)|0;k=c[w>>2]|0;j=k+-1|0;l=c[e>>2]|0;m=v&0-k;u=e+4|0;n=j>>>2;i=0;j=j&v;while(1){h=c[l+(j<<2)>>2]|0;if(!h)break;if((d_(f,c[h>>2]|0)|0)<<24>>24)break a;if(!(i<<24>>24))h=(m>>>((d[u>>0]|0)+-1|0)&n|1)&255;else h=i;t=h&255;i=h;j=j-t+(j>>>0>>0?k:0)|0;}if(g){i=a[u>>0]|0;h=i&255;if(!((c[e+12>>2]|0)>>>(h+-1|0))){h=e+16|0;i=e;o=27;break}q=h+1&255;j=i+1&255;s=1<>2]>>2]&63](i)|0;if(t){Y6(t|0,0,i|0)|0;p=0-s|0;n=j+-1|0;o=r>>>2;m=0;while(1){if(m>>>0>=(c[w>>2]|0)>>>0)break;i=c[(c[e>>2]|0)+(m<<2)>>2]|0;if(i|0){i=c_(b,c[i>>2]|0)|0;k=((i&p)>>>n&o|1)&255;i=i&r;j=0;while(1){l=t+(i<<2)|0;if(!(c[l>>2]|0))break;l=j<<24>>24==0?k:j;x=l&255;i=i+(i>>>0>>0?s:0)-x|0;j=l;}c[l>>2]=c[(c[e>>2]|0)+(m<<2)>>2];}m=m+1|0;}tb[c[(c[h>>2]|0)+8>>2]&127](c[e>>2]|0);c[e>>2]=t;a[u>>0]=q;c[w>>2]=s;k=((v&p)>>>n&o|1)&255;i=r&v;j=0;while(1){if(!(c[t+(i<<2)>>2]|0)){j=i;i=e;o=27;break a}x=j<<24>>24==0?k:j;w=x&255;i=i+(i>>>0>>0?s:0)-w|0;j=x;}}else h=0;}else h=0;}while(0);if((o|0)==27){h=kb[c[c[h>>2]>>2]&63](g)|0;c[(c[i>>2]|0)+(j<<2)>>2]=h;h=c[(c[i>>2]|0)+(j<<2)>>2]|0;if(!h)h=0;else {Y6(h|0,0,g|0)|0;c[c[(c[i>>2]|0)+(j<<2)>>2]>>2]=f;h=e+12|0;c[h>>2]=(c[h>>2]|0)+1;h=c[(c[i>>2]|0)+(j<<2)>>2]|0;}}return h|0}function oZ(b){b=b|0;var c=0,d=0,e=0;e=b;c=b;while(1){d=a[e>>0]|0;if(!(d<<24>>24))break;switch(d<<24>>24|0){case 10:case 13:case 32:{if((c|0)!=(b|0)){if((a[c+-1>>0]|0)!=32){a[c>>0]=32;c=c+1|0;}}else c=b;break}default:{a[c>>0]=d;c=c+1|0;}}e=e+1|0;}if((c|0)!=(b|0)){b=c+-1|0;b=(a[b>>0]|0)==32?b:c;}a[b>>0]=0;return}function pZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;d=IZ(b,0,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;if((d|0)==0?(RZ(b)|0)<<24>>24==0:0)d=1;return d|0}function qZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[a+352>>2]|0;b=lZ(g+80|0,b,d,e)|0;do if((b|0)!=0?(f=nZ(a,g+20|0,b,24)|0,(f|0)!=0):0)if((c[f>>2]|0)==(b|0)){c[g+96>>2]=c[g+92>>2];if(!(TZ(a,f)|0)){f=0;break}}else c[g+92>>2]=c[g+96>>2];else f=0;while(0);return f|0}function rZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[b+352>>2]|0;k=m+80|0;n=m+92|0;h=c[n>>2]|0;l=m+88|0;if((h|0)==(c[l>>2]|0))if(!((vZ(k)|0)<<24>>24))g=0;else {h=c[n>>2]|0;i=4;}else i=4;a:do if((i|0)==4){c[n>>2]=h+1;a[h>>0]=0;d=lZ(k,d,e,f)|0;if((d|0)!=0?(j=d+1|0,g=nZ(b,m+40|0,j,12)|0,(g|0)!=0):0){if((c[g>>2]|0)!=(j|0)){c[n>>2]=c[m+96>>2];break}h=c[n>>2]|0;i=m+96|0;c[i>>2]=h;if(a[b+232>>0]|0){e=a[j>>0]|0;b:do if(e<<24>>24==120)if((((a[d+2>>0]|0)==109?(a[d+3>>0]|0)==108:0)?(a[d+4>>0]|0)==110:0)?(a[d+5>>0]|0)==115:0){switch(a[d+6>>0]|0){case 0:{h=m+152|0;break}case 58:{h=nZ(b,m+60|0,d+7|0,8)|0;break}default:{f=0;d=120;break b}}c[g+4>>2]=h;a[g+9>>0]=1;break a}else {f=0;d=120;}else {f=0;d=e;}while(0);c:while(1){switch(d<<24>>24){case 0:break a;case 58:{e=0;break c}default:{}}d=f+1|0;f=d;d=a[j+d>>0]|0;}while(1){d=(h|0)==(c[l>>2]|0);if((e|0)>=(f|0))break;if(d){if(!((vZ(k)|0)<<24>>24)){g=0;break a}h=c[n>>2]|0;}d=a[j+e>>0]|0;c[n>>2]=h+1;a[h>>0]=d;e=e+1|0;h=c[n>>2]|0;}if(d){if(!((vZ(k)|0)<<24>>24)){g=0;break}h=c[n>>2]|0;}c[n>>2]=h+1;a[h>>0]=0;h=nZ(b,m+60|0,c[i>>2]|0,8)|0;c[g+4>>2]=h;if(h){d=c[i>>2]|0;if((c[h>>2]|0)==(d|0)){c[i>>2]=c[n>>2];break}else {c[n>>2]=d;break}}else g=0;}}else g=0;}while(0);return g|0}function sZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=b+12|0;h=b+8|0;while(1){e=a[d>>0]|0;if(!(e<<24>>24)){i=7;break}f=c[g>>2]|0;if((f|0)==(c[h>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}f=c[g>>2]|0;e=a[d>>0]|0;}c[g>>2]=f+1;a[f>>0]=e;d=d+1|0;}if((i|0)==7)d=c[b+16>>2]|0;return d|0}function tZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;c[h>>2]=d;g=a+12|0;if((c[g>>2]|0)==0?(vZ(a)|0)<<24>>24==0:0)d=0;else f=3;a:do if((f|0)==3){d=b+56|0;f=a+8|0;while(1){if((pb[c[d>>2]&127](b,h,e,g,c[f>>2]|0)|0)>>>0<2)break;if(!((vZ(a)|0)<<24>>24)){d=0;break a}}d=c[a+16>>2]|0;}while(0);l=i;return d|0}function uZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;i=f<<24>>24==0;n=b+12|0;m=c[n>>2]|0;a:do if(!(i&(g|0)==0)){j=b+20|0;f=0;while(1){if((f|0)>=(m|0))break;if((c[(c[j>>2]|0)+(f*12|0)>>2]|0)==(d|0)){f=1;break a}else f=f+1|0;}if((!i?(k=b+8|0,(c[k>>2]|0)==0):0)?(a[d+9>>0]|0)==0:0){c[k>>2]=d;l=9;}else l=9;}else l=9;while(0);b:do if((l|0)==9){j=b+16|0;do if((m|0)==(c[j>>2]|0))if(!m){c[j>>2]=8;f=kb[c[h+12>>2]&63](96)|0;c[b+20>>2]=f;if(f|0)break;c[j>>2]=0;f=0;break b}else {i=b+20|0;f=lb[c[h+16>>2]&127](c[i>>2]|0,m*24|0)|0;if(!f){f=0;break b}c[j>>2]=m<<1;c[i>>2]=f;break}else f=c[b+20>>2]|0;while(0);h=c[n>>2]|0;c[f+(h*12|0)>>2]=d;c[f+(h*12|0)+8>>2]=g;a[f+(h*12|0)+4>>0]=e;if(!(e<<24>>24))a[d+8>>0]=1;c[n>>2]=(c[n>>2]|0)+1;f=1;}while(0);return f|0}function vZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;b=a+4|0;e=c[b>>2]|0;do if(e){f=a+16|0;g=c[f>>2]|0;if(!g){c[a>>2]=e;c[b>>2]=c[e>>2];c[e>>2]=0;l=c[a>>2]|0;b=l+8|0;c[f>>2]=b;c[a+8>>2]=(c[l+4>>2]|0)+(l+8);c[a+12>>2]=b;b=1;break}d=a+8|0;if(((c[d>>2]|0)-g|0)<(c[e+4>>2]|0)){k=c[e>>2]|0;c[e>>2]=c[a>>2];l=c[b>>2]|0;c[a>>2]=l;c[b>>2]=k;b=c[f>>2]|0;W6(l+8|0,b|0,(c[d>>2]|0)-b|0)|0;b=c[a>>2]|0;l=a+12|0;c[l>>2]=(c[l>>2]|0)-(c[f>>2]|0)+(b+8);c[f>>2]=b+8;c[d>>2]=(c[b+4>>2]|0)+(b+8);b=1;}else h=6;}else h=6;while(0);a:do if((h|0)==6){e=c[a>>2]|0;k=a+16|0;do if(!e){i=k;b=c[k>>2]|0;}else {j=c[k>>2]|0;b=j;if((j|0)!=(e+8|0)){i=k;break}f=a+8|0;g=(c[f>>2]|0)-b<<1;h=a+12|0;d=(c[h>>2]|0)-b|0;if((g|0)<0){b=0;break a}b=b_(g)|0;if(!b){b=0;break a}b=lb[c[(c[a+20>>2]|0)+4>>2]&127](e,b)|0;if(!b){b=0;break a}c[a>>2]=b;c[b+4>>2]=g;b=c[a>>2]|0;c[h>>2]=b+8+d;c[k>>2]=b+8;c[f>>2]=b+8+g;b=1;break a}while(0);j=a+8|0;b=(c[j>>2]|0)-b|0;if((b|0)>=0){if((b|0)>=1024){b=b<<1;if((b|0)<0){b=0;break}}else b=1024;d=b_(b)|0;if((d|0)!=0?(l=kb[c[c[a+20>>2]>>2]&63](d)|0,(l|0)!=0):0){c[l+4>>2]=b;c[l>>2]=c[a>>2];c[a>>2]=l;h=a+12|0;a=c[h>>2]|0;e=c[k>>2]|0;d=a;f=e;if((a|0)==(e|0)){g=l+8|0;e=f;}else {g=l+8|0;W6(g|0,e|0,d-f|0)|0;e=c[i>>2]|0;d=c[h>>2]|0;}c[h>>2]=l+8+(d-e);c[k>>2]=g;c[j>>2]=l+8+b;b=1;}else b=0;}else b=0;}while(0);return b|0}function wZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;b=a_(b,d,e,f,g,h)|0;do if(!b){d=h+12|0;b=c[d>>2]|0;if((e<<24>>24==0?(c[h+16>>2]|0)!=(b|0):0)?(i=b+-1|0,(a[i>>0]|0)==32):0){c[d>>2]=i;b=i;}if((b|0)==(c[h+8>>2]|0)){if(!((vZ(h)|0)<<24>>24)){b=1;break}b=c[d>>2]|0;}c[d>>2]=b+1;a[b>>0]=0;b=0;}while(0);return b|0}function xZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+16|0;B=H;C=H+4|0;g=c[b+352>>2]|0;D=g+104|0;F=b+272|0;E=c[F>>2]|0;c[F>>2]=1;if((c[D>>2]|0)==0?(vZ(D)|0)<<24>>24==0:0)g=1;else {n=d+20|0;o=b+484|0;p=b+144|0;q=b+412|0;r=d+64|0;s=g+132|0;t=b+428|0;u=b+424|0;v=b+224|0;w=b+112|0;m=g+130|0;x=g+128|0;y=g+131|0;z=b+116|0;A=g+112|0;j=g+116|0;k=d+40|0;a:while(1){b:do switch(ob[c[n>>2]&127](d,e,f,B)|0){case -4:{g=0;break a}case -1:{G=37;break a}case 0:{G=39;break a}case 28:{if((a[o>>0]|0)==0?(c[p>>2]|0)==(d|0):0){G=19;break a}g=c[r>>2]|0;g=lZ(q,d,e+g|0,(c[B>>2]|0)+(0-g)|0)|0;if(!g){g=1;break a}h=nZ(b,s,g,0)|0;c[u>>2]=c[t>>2];if(!h){G=9;break a}i=h+32|0;if(a[i>>0]|0){G=11;break a}g=h+16|0;if(!(c[g>>2]|0)){a[i>>0]=1;g=c[h+4>>2]|0;g=xZ(b,c[v>>2]|0,g,g+(c[h+8>>2]|0)|0)|0;a[i>>0]=0;if(!g)break b;else break a}if(c[w>>2]|0){a[y>>0]=0;a[i>>0]=1;h=(pb[c[w>>2]&127](c[z>>2]|0,0,c[h+20>>2]|0,c[g>>2]|0,c[h+24>>2]|0)|0)==0;a[i>>0]=0;if(h){g=21;break a}if(a[y>>0]|0)break b}a[x>>0]=a[m>>0]|0;break}case 6:case 9:{if(!(tZ(D,d,e,c[B>>2]|0)|0)){g=1;break a}break}case -3:{c[B>>2]=e+(c[r>>2]|0);G=22;break}case 7:{G=22;break}case 10:{g=lb[c[k>>2]&127](d,e)|0;if((g|0)<0){G=27;break a}h=x_(g,C)|0;e=0;while(1){if((e|0)>=(h|0))break;g=c[j>>2]|0;if((c[A>>2]|0)==(g|0)){if(!((vZ(D)|0)<<24>>24)){g=1;G=35;break a}g=c[j>>2]|0;}i=a[C+e>>0]|0;c[j>>2]=g+1;a[g>>0]=i;e=e+1|0;}break}default:{G=41;break a}}while(0);if((G|0)==22){G=0;g=c[j>>2]|0;if((c[A>>2]|0)==(g|0)){if(!((vZ(D)|0)<<24>>24)){g=1;break}g=c[j>>2]|0;}c[j>>2]=g+1;a[g>>0]=10;}e=c[B>>2]|0;}if((G|0)==9){a[x>>0]=a[m>>0]|0;g=0;}else if((G|0)==11)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=12;}else g=12;else if((G|0)==19){c[b+284>>2]=e;g=10;}else if((G|0)==27)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=14;G=35;}else {g=14;G=35;}else if((G|0)==37)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=4;}else g=4;else if((G|0)==39)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=c[B>>2];g=4;}else g=4;else if((G|0)==41)if((c[p>>2]|0)==(d|0)){c[b+284>>2]=e;g=23;}else g=23;c[F>>2]=E;}l=H;return g|0}function yZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+16|0;n=p;o=p+4|0;c[n>>2]=e;if(!(a[d+68>>0]|0)){if((c[b+144>>2]|0)==(d|0)){g=b+288|0;h=b+284|0;}else {h=c[b+296>>2]|0;g=h+4|0;}i=b+44|0;j=d+56|0;k=b+48|0;m=b+80|0;e=b+4|0;do{c[o>>2]=c[i>>2];b=pb[c[j>>2]&127](d,n,f,o,c[k>>2]|0)|0;c[g>>2]=c[n>>2];q=c[i>>2]|0;vb[c[m>>2]&127](c[e>>2]|0,q,(c[o>>2]|0)-q|0);c[h>>2]=c[n>>2];}while(b>>>0>1)}else vb[c[b+80>>2]&127](c[b+4>>2]|0,e,f-e|0);l=p;return}function zZ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;j=m;k=c[d>>2]|0;if((c[a+144>>2]|0)==(b|0)){i=a+284|0;c[i>>2]=k;h=a+288|0;}else {i=c[a+296>>2]|0;h=i+4|0;}c[i>>2]=k;c[d>>2]=0;n=ob[c[b+12>>2]&127](b,k,e,j)|0;e=c[j>>2]|0;c[h>>2]=e;switch(n|0){case 42:{if(c[a+80>>2]|0){yZ(a,b,k,e);e=c[j>>2]|0;}c[d>>2]=e;c[f>>2]=e;e=(c[a+476>>2]|0)==2?35:0;break}case 0:{c[i>>2]=e;e=4;break}case -2:{if(!(g<<24>>24))e=6;else {c[f>>2]=k;e=0;}break}case -4:case -1:{if(!(g<<24>>24))e=2;else {c[f>>2]=k;e=0;}break}default:{c[i>>2]=e;e=23;}}l=m;return e|0}function AZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;c[g>>2]=d;d=zZ(b,c[b+144>>2]|0,g,e,f,(a[b+480>>0]|0)==0&1)|0;g=c[g>>2]|0;if(!((d|0)!=0|(g|0)==0)){c[b+276>>2]=57;d=iZ(b,g,e,f)|0;}l=h;return d|0}function BZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=c[a+352>>2]|0;j=i+184|0;if(!(c[j>>2]|0)){b=kb[c[a+12>>2]&63](c[a+464>>2]<<2)|0;c[j>>2]=b;if(!b)b=-1;else {c[b>>2]=0;d=4;}}else d=4;do if((d|0)==4){h=i+176|0;b=c[h>>2]|0;g=i+172|0;d=c[g>>2]|0;f=i+164|0;e=c[f>>2]|0;if(b>>>0>>0)g=e;else {if(!e){b=kb[c[a+12>>2]&63](896)|0;if(!b){b=-1;break}else {d=b;b=32;}}else {b=lb[c[a+16>>2]&127](e,d*56|0)|0;if(!b){b=-1;break}d=b;b=c[g>>2]<<1;}c[g>>2]=b;c[f>>2]=d;b=c[h>>2]|0;g=d;}c[h>>2]=b+1;d=c[i+180>>2]|0;if(d|0){a=c[(c[j>>2]|0)+(d+-1<<2)>>2]|0;f=g+(a*28|0)+16|0;d=c[f>>2]|0;if(d|0)c[g+(d*28|0)+24>>2]=b;d=g+(a*28|0)+20|0;e=c[d>>2]|0;if(!e)c[g+(a*28|0)+12>>2]=b;c[f>>2]=b;c[d>>2]=e+1;}j=g+(b*28|0)+12|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;}while(0);return b|0}function CZ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;o=b+300|0;f=c[o>>2]|0;if(!f){f=kb[c[b+12>>2]&63](24)|0;if(!f)f=1;else {m=f;g=4;}}else {c[o>>2]=c[f+8>>2];m=f;g=4;}do if((g|0)==4){h=d+32|0;a[h>>0]=1;i=d+12|0;c[i>>2]=0;j=b+296|0;k=m+8|0;c[k>>2]=c[j>>2];c[j>>2]=m;c[m+12>>2]=d;f=b+308|0;c[m+16>>2]=c[f>>2];a[m+20>>0]=e;c[m>>2]=0;c[m+4>>2]=0;g=c[d+4>>2]|0;e=g+(c[d+8>>2]|0)|0;c[n>>2]=g;if(!(a[d+33>>0]|0))f=IZ(b,c[f>>2]|0,c[b+224>>2]|0,g,e,n,0)|0;else {d=b+224|0;f=c[d>>2]|0;f=ob[c[f>>2]&127](f,g,e,n)|0;f=jZ(b,c[d>>2]|0,g,e,f,c[n>>2]|0,n,0)|0;}if(!f){f=c[n>>2]|0;if((e|0)!=(f|0)?(c[b+476>>2]|0)==3:0){c[i>>2]=f-g;c[b+276>>2]=60;f=0;break}a[h>>0]=0;c[j>>2]=c[k>>2];c[k>>2]=c[o>>2];c[o>>2]=m;f=0;}}while(0);l=p;return f|0}function DZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+16|0;d=g+4|0;e=g;b=c[a+352>>2]|0;f=b+176|0;b=kb[c[a+12>>2]&63](((c[f>>2]|0)*20|0)+(c[b+168>>2]|0)|0)|0;if(!b)b=0;else {c[e>>2]=b+((c[f>>2]|0)*20|0);c[d>>2]=b+20;HZ(a,0,b,d,e);}l=g;return b|0}function EZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=a+64|0;if(!(c[j>>2]|0))if(!(c[a+80>>2]|0))d=1;else {yZ(a,b,d,e);d=1;}else {h=b+64|0;g=d+(c[h>>2]<<1)|0;d=g+(lb[c[b+28>>2]&127](b,g)|0)|0;f=a+412|0;g=lZ(f,b,g,d)|0;if((g|0)!=0?(c[a+428>>2]=c[a+424>>2],i=lb[c[b+32>>2]&127](b,d)|0,i=lZ(f,b,i,e+(0-(c[h>>2]<<1))|0)|0,(i|0)!=0):0){GZ(i);vb[c[j>>2]&127](c[a+4>>2]|0,g,i);mZ(f);d=1;}else d=0;}return d|0}function FZ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=a+68|0;if(!(c[g>>2]|0))if(!(c[a+80>>2]|0))b=1;else {yZ(a,b,d,e);b=1;}else {f=a+412|0;h=c[b+64>>2]|0;b=lZ(f,b,d+(h<<2)|0,e+(O(h,-3)|0)|0)|0;if(!b)b=0;else {GZ(b);ub[c[g>>2]&63](c[a+4>>2]|0,b);mZ(f);b=1;}}return b|0}function GZ(b){b=b|0;var c=0,d=0,e=0;a:while(1){switch(a[b>>0]|0){case 0:break a;case 13:{d=b;c=13;e=4;break a}default:{}}b=b+1|0;}if((e|0)==4){while(1){if(c<<24>>24==13){a[d>>0]=10;e=b+1|0;b=(a[e>>0]|0)==10?b+2|0:e;}else {a[d>>0]=c;b=b+1|0;}d=d+1|0;c=a[b>>0]|0;if(!(c<<24>>24))break;else e=4;}a[d>>0]=0;}return}function HZ(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=(c[b+352>>2]|0)+164|0;j=c[(c[k>>2]|0)+(d*28|0)>>2]|0;c[e>>2]=j;c[e+4>>2]=c[(c[k>>2]|0)+(d*28|0)+4>>2];if((j|0)==4){c[e+8>>2]=c[g>>2];d=c[(c[k>>2]|0)+(d*28|0)+8>>2]|0;while(1){j=a[d>>0]|0;k=c[g>>2]|0;c[g>>2]=k+1;a[k>>0]=j;if(!(a[d>>0]|0))break;else d=d+1|0;}c[e+12>>2]=0;c[e+16>>2]=0;}else {h=c[(c[k>>2]|0)+(d*28|0)+20>>2]|0;i=e+12|0;c[i>>2]=h;j=e+16|0;c[j>>2]=c[f>>2];c[f>>2]=(c[f>>2]|0)+(h*20|0);d=(c[k>>2]|0)+(d*28|0)+12|0;h=0;while(1){d=c[d>>2]|0;if(h>>>0>=(c[i>>2]|0)>>>0)break;HZ(b,d,(c[j>>2]|0)+(h*20|0)|0,f,g);d=(c[k>>2]|0)+(d*28|0)+24|0;h=h+1|0;}c[e+8>>2]=0;}return}function IZ(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0;ma=l;l=l+48|0;ja=ma+28|0;ea=ma+32|0;ka=ma+24|0;Z=ma;c[ja>>2]=f;_=c[b+352>>2]|0;if((c[b+144>>2]|0)==(e|0)){fa=b+284|0;Y=b+288|0;}else {Y=c[b+296>>2]|0;fa=Y;Y=Y+4|0;}c[fa>>2]=f;t=e+4|0;ga=b+80|0;u=b+476|0;v=e+44|0;w=e+64|0;x=_+80|0;y=_+96|0;z=_+92|0;A=_+129|0;B=b+112|0;C=b+116|0;D=b+428|0;E=b+424|0;F=b+304|0;G=b+120|0;ha=b+4|0;H=_+130|0;$=b+60|0;I=b+364|0;J=b+12|0;K=b+360|0;L=e+28|0;ia=b+308|0;aa=e+56|0;M=b+16|0;N=b+52|0;O=b+412|0;P=b+388|0;Q=b+56|0;R=b+232|0;S=b+233|0;T=b+468|0;U=b+104|0;V=b+372|0;W=e+40|0;X=b+72|0;ba=e+68|0;ca=b+44|0;da=b+48|0;a:while(1){s=c[ja>>2]|0;c[ea>>2]=s;s=ob[c[t>>2]&127](e,s,g,ea)|0;f=c[ea>>2]|0;c[Y>>2]=f;k=f;b:do switch(s|0){case -3:{la=6;break a}case -4:{la=15;break a}case 0:{la=20;break a}case -1:{la=21;break a}case -2:{la=23;break a}case 12:{f=17;break a}case -5:{la=134;break a}case 9:{s=c[w>>2]|0;s=(nb[c[v>>2]&63](e,(c[ja>>2]|0)+s|0,k+(0-s)|0)|0)&255;a[ka>>0]=s;do if(s<<24>>24){f=c[$>>2]|0;if(f|0){vb[f&127](c[ha>>2]|0,ka,1);break}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {j=c[w>>2]|0;j=lZ(x,e,(c[ja>>2]|0)+j|0,(c[ea>>2]|0)+(0-j)|0)|0;if(!j){f=1;la=56;break a}k=nZ(b,_,j,0)|0;c[z>>2]=c[y>>2];if((a[A>>0]|0)!=0?(a[H>>0]|0)==0:0){if(!k){f=c[G>>2]|0;if(f|0){vb[f&127](c[ha>>2]|0,j,0);break}if(!(c[ga>>2]|0))break;yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}}else {if(!k){f=11;la=56;break a}if(!(a[k+34>>0]|0)){f=24;la=56;break a}}f=k+32|0;if(a[f>>0]|0){f=12;la=56;break a}if(c[k+28>>2]|0){f=15;la=56;break a}if(!(c[k+4>>2]|0)){if(!(c[B>>2]|0)){if(!(c[ga>>2]|0))break;yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}a[f>>0]=1;j=KZ(b)|0;a[f>>0]=0;if(!j){f=1;la=56;break a}if(!(pb[c[B>>2]&127](c[C>>2]|0,j,c[k+20>>2]|0,c[k+16>>2]|0,c[k+24>>2]|0)|0)){f=21;la=56;break a}c[E>>2]=c[D>>2];break}if(a[F>>0]|0){f=CZ(b,k,0)|0;if(!f)break;else {la=58;break a}}f=c[G>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else vb[f&127](c[ha>>2]|0,c[k>>2]|0,0);break b}while(0);break}case 1:case 2:{f=c[I>>2]|0;if(!f){f=kb[c[J>>2]&63](48)|0;if(!f){f=1;la=75;break a}j=kb[c[J>>2]&63](32)|0;c[f+36>>2]=j;if(!j){la=63;break a}c[f+40>>2]=j+32;}else c[I>>2]=c[f>>2];o=f+44|0;c[o>>2]=0;c[f>>2]=c[K>>2];c[K>>2]=f;s=f+12|0;c[f+16>>2]=0;c[f+20>>2]=0;r=(c[ja>>2]|0)+(c[w>>2]|0)|0;q=f+4|0;c[q>>2]=r;p=f+8|0;c[p>>2]=lb[c[L>>2]&127](e,r)|0;c[ia>>2]=(c[ia>>2]|0)+1;q=c[q>>2]|0;p=q+(c[p>>2]|0)|0;c[Z>>2]=q;q=f+36|0;c[ka>>2]=c[q>>2];r=f+40|0;j=c[r>>2]|0;while(1){na=pb[c[aa>>2]&127](e,Z,p,ka,j+-1|0)|0;j=c[ka>>2]|0;m=c[q>>2]|0;k=m;n=j-k|0;if((na|0)==1?1:(c[Z>>2]|0)>>>0>=p>>>0)break;k=(c[r>>2]|0)-k<<1;j=lb[c[M>>2]&127](m,k)|0;if(!j){la=69;break a}c[q>>2]=j;na=j+k|0;c[r>>2]=na;c[ka>>2]=j+n;j=na;}c[f+24>>2]=n;c[s>>2]=k;a[j>>0]=0;f=LZ(b,e,c[ja>>2]|0,s,o)|0;if(f|0){la=75;break a}f=c[N>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else vb[f&127](c[ha>>2]|0,c[s>>2]|0,c[P>>2]|0);mZ(O);break}case 3:case 4:{na=(c[ja>>2]|0)+(c[w>>2]|0)|0;c[ka>>2]=0;na=lZ(O,e,na,na+(lb[c[L>>2]&127](e,na)|0)|0)|0;c[Z>>2]=na;if(!na){f=1;la=89;break a}c[D>>2]=c[E>>2];f=LZ(b,e,c[ja>>2]|0,Z,ka)|0;if(f|0){la=79;break a}c[D>>2]=c[E>>2];f=c[N>>2]|0;if(!f)j=1;else {vb[f&127](c[ha>>2]|0,c[Z>>2]|0,c[P>>2]|0);j=0;}f=c[Q>>2]|0;if(!f){if(j|0?c[ga>>2]|0:0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {if(c[N>>2]|0){c[fa>>2]=c[Y>>2];f=c[Q>>2]|0;}ub[f&63](c[ha>>2]|0,c[Z>>2]|0);}mZ(O);MZ(b,c[ka>>2]|0);if((c[ia>>2]|0)==0?(c[u>>2]&-2|0)!=2:0){la=92;break a}break}case 5:{if((c[ia>>2]|0)==(d|0)){f=13;break a}n=c[K>>2]|0;c[K>>2]=c[n>>2];c[n>>2]=c[I>>2];c[I>>2]=n;f=(c[ja>>2]|0)+(c[w>>2]<<1)|0;j=lb[c[L>>2]&127](e,f)|0;if((j|0)!=(c[n+8>>2]|0)){la=96;break a}if($3(c[n+4>>2]|0,f,j)|0){la=96;break a}c[ia>>2]=(c[ia>>2]|0)+-1;f=c[Q>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);}else {j=c[n+16>>2]|0;m=n+12|0;if((j|0)!=0&(a[R>>0]|0)!=0){f=(c[m>>2]|0)+(c[n+28>>2]|0)|0;while(1){k=a[j>>0]|0;if(!(k<<24>>24))break;a[f>>0]=k;f=f+1|0;j=j+1|0;}j=c[n+20>>2]|0;c:do if((j|0)!=0&(a[S>>0]|0)!=0){a[f>>0]=a[T>>0]|0;while(1){f=f+1|0;k=a[j>>0]|0;if(!(k<<24>>24))break c;a[f>>0]=k;j=j+1|0;}}while(0);a[f>>0]=0;f=c[Q>>2]|0;}ub[f&63](c[ha>>2]|0,c[m>>2]|0);}k=n+44|0;while(1){m=c[k>>2]|0;if(!m)break;f=c[U>>2]|0;if(!f){f=m;j=m;}else {ub[f&63](c[ha>>2]|0,c[c[m>>2]>>2]|0);f=m;j=c[k>>2]|0;}c[k>>2]=c[j+4>>2];c[m+4>>2]=c[V>>2];c[V>>2]=m;c[(c[f>>2]|0)+4>>2]=c[m+8>>2];}if(!(c[ia>>2]|0)){la=117;break a}break}case 10:{f=lb[c[W>>2]&127](e,c[ja>>2]|0)|0;if((f|0)<0){f=14;break a}j=c[$>>2]|0;if(j|0){s=c[ha>>2]|0;na=x_(f,ka)|0;vb[j&127](s,ka,na);break b}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,c[ea>>2]|0);break}case 7:{f=c[$>>2]|0;if(f|0){a[ka>>0]=10;vb[f&127](c[ha>>2]|0,ka,1);break b}if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);break}case 8:{f=c[X>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);}else tb[f&127](c[ha>>2]|0);f=OZ(b,e,ea,g,h,i)|0;if(f|0)break a;if(!(c[ea>>2]|0)){la=133;break a}break}case 6:{j=c[$>>2]|0;if(!j){if(!(c[ga>>2]|0))break b;yZ(b,e,c[ja>>2]|0,k);break b}if(!(a[ba>>0]|0))f=k;else {na=c[ja>>2]|0;vb[j&127](c[ha>>2]|0,na,f-na|0);break b}while(1){c[ka>>2]=c[ca>>2];na=pb[c[aa>>2]&127](e,ja,f,ka,c[da>>2]|0)|0;c[Y>>2]=c[ja>>2];s=c[ca>>2]|0;vb[j&127](c[ha>>2]|0,s,(c[ka>>2]|0)-s|0);if(na>>>0<2)break;c[fa>>2]=c[ja>>2];f=c[ea>>2]|0;}break}case 11:{if(!(EZ(b,e,c[ja>>2]|0,k)|0)){f=1;break a}break}case 13:{if(!(FZ(b,e,c[ja>>2]|0,k)|0)){f=1;break a}break}default:if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,k);}while(0);na=c[ea>>2]|0;c[ja>>2]=na;c[fa>>2]=na;switch(c[u>>2]|0){case 2:{f=35;break a}case 3:{la=160;break a}default:{}}}switch(la|0){case 6:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}c[Y>>2]=g;f=c[$>>2]|0;if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,g);}else {a[ka>>0]=10;vb[f&127](c[ha>>2]|0,ka,1);}if(d)if((c[ia>>2]|0)==(d|0)){c[h>>2]=g;f=0;}else f=13;else f=3;break}case 15:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}if((d|0)>0)if((c[ia>>2]|0)==(d|0)){c[h>>2]=c[ja>>2];f=0;}else f=13;else f=3;break}case 20:{c[fa>>2]=f;f=4;break}case 21:{if(!(i<<24>>24))f=5;else {c[h>>2]=c[ja>>2];f=0;}break}case 23:{if(!(i<<24>>24))f=6;else {c[h>>2]=c[ja>>2];f=0;}break}case 56:break;case 58:break;case 63:{tb[c[b+20>>2]&127](f);f=1;la=75;break}case 69:{f=1;la=75;break}case 79:{MZ(b,c[ka>>2]|0);la=89;break}case 92:{f=NZ(b,c[ea>>2]|0,g,h)|0;break}case 96:{c[fa>>2]=f;f=7;break}case 117:{f=NZ(b,c[ea>>2]|0,g,h)|0;break}case 133:{c[b+276>>2]=61;f=0;break}case 134:{if(i<<24>>24){c[h>>2]=c[ja>>2];f=0;break}f=c[$>>2]|0;do if(!f){if(c[ga>>2]|0)yZ(b,e,c[ja>>2]|0,g);}else if(!(a[ba>>0]|0)){c[ka>>2]=c[ca>>2];pb[c[aa>>2]&127](e,ja,g,ka,c[da>>2]|0)|0;na=c[ca>>2]|0;vb[c[$>>2]&127](c[ha>>2]|0,na,(c[ka>>2]|0)-na|0);break}else {na=c[ja>>2]|0;vb[f&127](c[ha>>2]|0,na,g-na|0);break}while(0);if(!d){c[fa>>2]=g;f=3;break}if((c[ia>>2]|0)==(d|0)){c[h>>2]=g;f=0;break}else {c[fa>>2]=g;f=13;break}}case 160:{c[h>>2]=c[ea>>2];f=0;break}}l=ma;return f|0}function JZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+16|0;p=q;k=b+296|0;m=c[k>>2]|0;do if(m){n=c[m+12>>2]|0;h=n+4|0;j=c[h>>2]|0;i=n+12|0;g=j+(c[i>>2]|0)|0;j=j+(c[n+8>>2]|0)|0;c[p>>2]=g;o=n+33|0;if(!(a[o>>0]|0))g=IZ(b,c[m+16>>2]|0,c[b+224>>2]|0,g,j,p,0)|0;else {s=b+224|0;r=c[s>>2]|0;r=ob[c[r>>2]&127](r,g,j,p)|0;g=jZ(b,c[s>>2]|0,g,j,r,c[p>>2]|0,p,0)|0;}if(!g){g=c[p>>2]|0;if((j|0)!=(g|0)?(c[b+476>>2]|0)==3:0){c[i>>2]=g-(c[h>>2]|0);g=0;break}a[n+32>>0]=0;s=m+8|0;c[k>>2]=c[s>>2];g=b+300|0;c[s>>2]=c[g>>2];c[g>>2]=m;g=b+276|0;if(!(a[o>>0]|0)){c[g>>2]=58;g=IZ(b,(c[b+472>>2]|0)!=0&1,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;break}else {c[g>>2]=57;s=b+144|0;g=c[s>>2]|0;g=ob[c[g>>2]&127](g,d,e,p)|0;g=jZ(b,c[s>>2]|0,d,e,g,c[p>>2]|0,f,(a[b+480>>0]|0)==0&1)|0;break}}}else g=23;while(0);l=q;return g|0}function KZ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;n=q;m=c[b+352>>2]|0;h=m+156|0;o=b+412|0;p=b+424|0;a:do if(!(c[h>>2]|0)){d=0;i=b+420|0;k=b+468|0;j=12;}else {d=c[p>>2]|0;i=b+420|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=61;g=b+468|0;e=(c[(c[h>>2]|0)+20>>2]|0)+(((a[g>>0]|0)!=0)<<31>>31)|0;f=0;while(1){if((f|0)>=(e|0)){d=1;k=g;j=12;break a}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break a}d=c[p>>2]|0;}k=a[(c[(c[h>>2]|0)+16>>2]|0)+f>>0]|0;c[p>>2]=d+1;a[d>>0]=k;f=f+1|0;}}while(0);b:do if((j|0)==12){cZ(n,m+60|0);c:while(1){do{e=dZ(n)|0;if(!e)break c;h=e+4|0;}while(!(c[h>>2]|0));if(d<<24>>24){d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=12;}g=c[e>>2]|0;while(1){e=a[g>>0]|0;d=c[p>>2]|0;f=(d|0)==(c[i>>2]|0);if(!(e<<24>>24))break;if(f){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;e=a[g>>0]|0;}c[p>>2]=d+1;a[d>>0]=e;g=g+1|0;}if(f){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=61;f=(c[(c[h>>2]|0)+20>>2]|0)+(((a[k>>0]|0)!=0)<<31>>31)|0;e=0;while(1){if((e|0)>=(f|0)){d=1;continue c}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}j=a[(c[(c[h>>2]|0)+16>>2]|0)+e>>0]|0;c[p>>2]=d+1;a[d>>0]=j;e=e+1|0;}}cZ(n,m);d:while(1){do{e=dZ(n)|0;if(!e)break d}while(!(a[e+32>>0]|0));if(d<<24>>24){d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=12;}f=c[e>>2]|0;while(1){e=a[f>>0]|0;if(!(e<<24>>24)){d=1;continue d}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break b}d=c[p>>2]|0;e=a[f>>0]|0;}c[p>>2]=d+1;a[d>>0]=e;f=f+1|0;}}d=c[p>>2]|0;if((d|0)==(c[i>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[p>>2]|0;}c[p>>2]=d+1;a[d>>0]=0;d=c[b+428>>2]|0;}while(0);l=q;return d|0}function LZ(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;O=l;l=l+80|0;K=O+16|0;L=O;M=c[b+352>>2]|0;k=M+20|0;i=nZ(b,k,c[g>>2]|0,0)|0;if(!i){i=SZ(M+80|0,c[g>>2]|0)|0;if((i|0)!=0?(j=nZ(b,k,i,24)|0,(j|0)!=0):0)if((a[b+232>>0]|0)!=0?(TZ(b,j)|0)==0:0)i=1;else A=6;else i=1;}else {j=i;A=6;}a:do if((A|0)==6){x=c[j+12>>2]|0;k=e+36|0;m=b+376|0;t=b+388|0;u=ob[c[k>>2]&127](e,f,c[m>>2]|0,c[t>>2]|0)|0;i=u+x|0;n=c[m>>2]|0;if((i|0)>(n|0)){i=i+16|0;c[m>>2]=i;i=lb[c[b+16>>2]&127](c[t>>2]|0,i<<4)|0;if(!i){c[m>>2]=n;i=1;break}c[t>>2]=i;if((u|0)>(n|0))ob[c[k>>2]&127](e,f,u,i)|0;}J=c[t>>2]|0;r=e+28|0;H=b+412|0;I=b+428|0;w=j+20|0;q=b+424|0;s=0;p=0;k=0;while(1){if((p|0)>=(u|0))break;o=c[(c[t>>2]|0)+(p<<4)>>2]|0;o=rZ(b,e,o,o+(lb[c[r>>2]&127](e,o)|0)|0)|0;if(!o){i=1;break a}i=(c[o>>2]|0)+-1|0;if(a[i>>0]|0){A=15;break}a[i>>0]=1;f=s+1|0;c[J+(s<<2)>>2]=c[o>>2];n=c[t>>2]|0;if(a[n+(p<<4)+12>>0]|0){G=lZ(H,e,c[n+(p<<4)+4>>2]|0,c[n+(p<<4)+8>>2]|0)|0;c[J+(f<<2)>>2]=G;if(!G){i=1;break a}}else {b:do if(!(a[o+8>>0]|0))i=1;else {i=0;while(1){if((i|0)>=(x|0)){i=1;break b}m=c[w>>2]|0;if((o|0)==(c[m+(i*12|0)>>2]|0))break;i=i+1|0;}i=a[m+(i*12|0)+4>>0]|0;}while(0);i=wZ(b,e,i,c[n+(p<<4)+4>>2]|0,c[n+(p<<4)+8>>2]|0,H)|0;if(i|0)break a;c[J+(f<<2)>>2]=c[I>>2];}c[I>>2]=c[q>>2];i=c[o+4>>2]|0;do if(i)if(a[o+9>>0]|0){i=UZ(b,i,o,c[J+(f<<2)>>2]|0,h)|0;if(!i){i=s;break}else break a}else {a[(c[o>>2]|0)+-1>>0]=2;k=k+1|0;i=s+2|0;break}else i=s+2|0;while(0);s=i;p=p+1|0;}if((A|0)==15){if((c[b+144>>2]|0)!=(e|0)){i=8;break}c[b+284>>2]=c[(c[t>>2]|0)+(p<<4)>>2];i=8;break}c[b+380>>2]=s;i=c[j+8>>2]|0;c:do if((i|0)!=0?(v=c[i>>2]|0,(a[v+-1>>0]|0)!=0):0){i=0;while(1){if((i|0)>=(s|0)){f=0;p=k;G=s;break c}if((c[J+(i<<2)>>2]|0)==(v|0)){A=37;break c}i=i+2|0;}}else {i=-1;A=37;}while(0);if((A|0)==37){c[b+384>>2]=i;f=0;p=k;G=s;}while(1){if((f|0)>=(x|0))break;i=c[w>>2]|0;n=i+(f*12|0)|0;k=c[n>>2]|0;m=(c[k>>2]|0)+-1|0;d:do if((a[m>>0]|0)==0?(y=i+(f*12|0)+8|0,z=c[y>>2]|0,(z|0)!=0):0){i=c[k+4>>2]|0;do if(i)if(a[k+9>>0]|0){i=UZ(b,i,k,z,h)|0;if(!i){i=p;k=G;break d}else break a}else {a[m>>0]=2;i=p+1|0;break}else {a[m>>0]=1;i=p;}while(0);c[J+(G<<2)>>2]=c[c[n>>2]>>2];c[J+(G+1<<2)>>2]=c[y>>2];k=G+2|0;}else {i=p;k=G;}while(0);f=f+1|0;p=i;G=k;}c[J+(G<<2)>>2]=0;e:do if(!p)i=0;else {o=b+396|0;n=c[o>>2]|0;F=b+400|0;f=a[F>>0]|0;i=f&255;do if(!(p<<1>>i)){i=1<>24;}while((p>>(E&255)|0)!=0);i=(i&255)>3?i:3;a[F>>0]=i;i=i&255;m=b+392|0;k=lb[c[b+16>>2]&127](c[m>>2]|0,12<>0]=f;i=1;break a}else {c[m>>2]=k;k=1<>2]|0)+(E*12|0)>>2]=-1;i=E;}}while(0);E=i+-1|0;c[o>>2]=E;w=M+40|0;x=b+424|0;y=b+420|0;z=k+-1|0;A=0-k|0;B=z>>>2;C=b+233|0;D=b+468|0;i=0;v=p;g:while(1){while(1){if((i|0)>=(G|0))break e;e=J+(i<<2)|0;n=c[e>>2]|0;f=n+-1|0;if((a[f>>0]|0)==2)break;a[f>>0]=0;i=i+2|0;}VZ(b,L);WZ(K,L);a[f>>0]=0;f=nZ(b,w,n,0)|0;if(!f){i=1;break}f=c[f+4>>2]|0;if(!f){i=1;break}u=c[f+4>>2]|0;if(!u){i=27;break}q=u+20|0;r=u+16|0;p=0;while(1){f=c[q>>2]|0;o=c[r>>2]|0;if((p|0)>=(f|0))break;o=a[o+p>>0]|0;f=c[x>>2]|0;if((f|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}f=c[x>>2]|0;}c[x>>2]=f+1;a[f>>0]=o;p=p+1|0;}XZ(K,o,f);do{t=n;n=n+1|0;}while((a[t>>0]|0)!=58);XZ(K,n,YZ(n)|0);while(1){f=c[x>>2]|0;if((f|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}f=c[x>>2]|0;}t=a[n>>0]|0;c[x>>2]=f+1;a[f>>0]=t;if(!(a[n>>0]|0))break;else n=n+1|0;}t=ZZ(K)|0;q=c[m>>2]|0;r=t&A;n=0;s=z&t;while(1){if((c[q+(s*12|0)>>2]|0)!=(E|0))break;if((c[q+(s*12|0)+4>>2]|0)==(t|0)){f=c[q+(s*12|0)+8>>2]|0;o=c[I>>2]|0;while(1){P=a[o>>0]|0;p=P<<24>>24==0;if(p|P<<24>>24!=(a[f>>0]|0))break;f=f+1|0;o=o+1|0;}if(p){i=8;break g}}if(!(n<<24>>24))n=(r>>>((d[F>>0]|0)+-1|0)&B|1)&255;P=n&255;s=s+((s|0)<(P|0)?k:0)-P|0;}if(a[C>>0]|0){a[(c[x>>2]|0)+-1>>0]=a[D>>0]|0;f=c[c[u>>2]>>2]|0;while(1){n=c[x>>2]|0;if((n|0)==(c[y>>2]|0)){if(!((vZ(H)|0)<<24>>24)){i=1;break g}n=c[x>>2]|0;}P=a[f>>0]|0;c[x>>2]=n+1;a[n>>0]=P;if(!(a[f>>0]|0))break;else f=f+1|0;}}P=c[I>>2]|0;c[I>>2]=c[x>>2];c[e>>2]=P;c[(c[m>>2]|0)+(s*12|0)>>2]=E;c[(c[m>>2]|0)+(s*12|0)+4>>2]=t;c[(c[m>>2]|0)+(s*12|0)+8>>2]=P;v=v+-1|0;i=i+2|0;if(!v)break e}break a}while(0);while(1){if((i|0)>=(G|0)){i=h;break}a[(c[J+(i<<2)>>2]|0)+-1>>0]=0;i=i+2|0;}while(1){i=c[i>>2]|0;if(!i)break;a[(c[c[i+12>>2]>>2]|0)+-1>>0]=0;i=i+4|0;}if(!(a[b+232>>0]|0))i=0;else {i=c[j+4>>2]|0;if(!i){i=c[M+156>>2]|0;if(!i){i=0;break}k=c[g>>2]|0;}else {i=c[i+4>>2]|0;if(!i){i=27;break}j=c[g>>2]|0;while(1){k=j+1|0;if((a[j>>0]|0)==58)break;else j=k;}}if((a[b+233>>0]|0)!=0?(N=c[c[i>>2]>>2]|0,(N|0)!=0):0){j=0;while(1){m=j+1|0;if(!(a[N+j>>0]|0))break;else j=m;}}else m=0;c[g+4>>2]=k;p=i+20|0;c[g+16>>2]=c[p>>2];c[g+8>>2]=c[c[i>>2]>>2];c[g+20>>2]=m;q=0;while(1){r=q+1|0;if(!(a[k+q>>0]|0))break;else q=r;}j=c[p>>2]|0;n=r+m+j|0;f=i+24|0;if((n|0)>(c[f>>2]|0)){j=n+24|0;o=kb[c[b+12>>2]&63](j)|0;if(!o){i=1;break}c[f>>2]=j;f=i+16|0;W6(o|0,c[f>>2]|0,c[p>>2]|0)|0;j=b+360|0;while(1){j=c[j>>2]|0;if(!j)break;n=j+12|0;if((c[n>>2]|0)==(c[f>>2]|0))c[n>>2]=o;}tb[c[b+20>>2]&127](c[f>>2]|0);c[f>>2]=o;n=o;j=c[p>>2]|0;}else {n=i+16|0;f=n;n=c[n>>2]|0;}j=n+j|0;W6(j|0,k|0,r|0)|0;if(m|0){P=j+q|0;a[P>>0]=a[b+468>>0]|0;W6(P+1|0,c[c[i>>2]>>2]|0,m|0)|0;}c[g>>2]=c[f>>2];i=0;}}while(0);l=O;return i|0}function MZ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=a+104|0;f=a+372|0;d=a+4|0;while(1){if(!b)break;a=c[e>>2]|0;if(!a)a=b;else {ub[a&63](c[d>>2]|0,c[c[b>>2]>>2]|0);a=b;}h=b+4|0;g=c[h>>2]|0;c[h>>2]=c[f>>2];c[f>>2]=b;c[(c[a>>2]|0)+4>>2]=c[b+8>>2];b=g;}return}function NZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+16|0;j=q;c[b+276>>2]=62;k=b+284|0;c[k>>2]=d;m=b+144|0;n=b+288|0;o=b+80|0;i=b+476|0;g=d;a:while(1){c[j>>2]=0;r=c[m>>2]|0;r=ob[c[r>>2]&127](r,g,e,j)|0;d=c[j>>2]|0;c[n>>2]=d;h=d;switch(r|0){case -15:{p=3;break a}case -4:{p=7;break a}case 0:{p=12;break a}case -1:{p=13;break a}case -2:{p=15;break a}case 15:{if(c[o>>2]|0)yZ(b,c[m>>2]|0,g,h);break}case 11:{if(!(EZ(b,c[m>>2]|0,g,h)|0)){d=1;break a}break}case 13:{if(!(FZ(b,c[m>>2]|0,g,h)|0)){d=1;break a}break}default:{d=9;break a}}d=c[j>>2]|0;c[k>>2]=d;switch(c[i>>2]|0){case 2:{d=35;break a}case 3:{p=18;break a}default:{}}g=d;}do if((p|0)==3){if(c[o>>2]|0){yZ(b,c[m>>2]|0,g,h);if((c[i>>2]|0)==2){d=35;break}d=c[j>>2]|0;}c[f>>2]=d;d=0;}else if((p|0)==7){c[f>>2]=g;d=0;}else if((p|0)==12){c[k>>2]=d;d=4;}else if((p|0)==13)if(!(a[b+480>>0]|0)){c[f>>2]=g;d=0;}else d=5;else if((p|0)==15)if(!(a[b+480>>0]|0)){c[f>>2]=g;d=0;}else d=6;else if((p|0)==18){c[f>>2]=d;d=0;}while(0);l=q;return d|0}function OZ(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;B=l;l=l+16|0;y=B+8|0;z=B+4|0;x=B;i=c[e>>2]|0;c[y>>2]=i;if((c[b+144>>2]|0)==(d|0)){s=b+284|0;c[s>>2]=i;t=b+288|0;}else {t=c[b+296>>2]|0;s=t;t=t+4|0;}c[s>>2]=i;c[e>>2]=0;k=d+8|0;m=b+60|0;u=b+80|0;v=b+4|0;w=b+476|0;n=d+68|0;o=b+44|0;p=d+56|0;q=b+48|0;a:while(1){j=ob[c[k>>2]&127](d,c[y>>2]|0,f,z)|0;i=c[z>>2]|0;c[t>>2]=i;r=i;b:do switch(j|0){case 40:{A=6;break a}case 0:{A=23;break a}case -2:{A=24;break a}case -4:case -1:{A=26;break a}case 7:{i=c[m>>2]|0;if(i|0){a[x>>0]=10;vb[i&127](c[v>>2]|0,x,1);break b}if(c[u>>2]|0)yZ(b,d,c[y>>2]|0,r);break}case 6:{j=c[m>>2]|0;if(!j){if(!(c[u>>2]|0))break b;yZ(b,d,c[y>>2]|0,r);break b}if(!(a[n>>0]|0))i=r;else {r=c[y>>2]|0;vb[j&127](c[v>>2]|0,r,i-r|0);break b}while(1){c[x>>2]=c[o>>2];r=pb[c[p>>2]&127](d,y,i,x,c[q>>2]|0)|0;c[t>>2]=c[z>>2];i=c[o>>2]|0;vb[j&127](c[v>>2]|0,i,(c[x>>2]|0)-i|0);if(r>>>0<2)break;c[s>>2]=c[y>>2];i=c[z>>2]|0;}break}default:{A=28;break a}}while(0);r=c[z>>2]|0;c[y>>2]=r;c[s>>2]=r;switch(c[w>>2]|0){case 3:{A=30;break a}case 2:{i=35;break a}default:{}}}if((A|0)==6){i=c[b+76>>2]|0;if(!i){if(c[u>>2]|0)yZ(b,d,c[y>>2]|0,r);}else tb[i&127](c[v>>2]|0);i=c[z>>2]|0;c[e>>2]=i;c[g>>2]=i;i=(c[w>>2]|0)==2?35:0;}else if((A|0)==23){c[s>>2]=i;i=4;}else if((A|0)==24)if(!(h<<24>>24))i=6;else {c[g>>2]=c[y>>2];i=0;}else if((A|0)==26)if(!(h<<24>>24))i=20;else {c[g>>2]=c[y>>2];i=0;}else if((A|0)==28){c[s>>2]=i;i=23;}else if((A|0)==30){c[g>>2]=c[z>>2];i=0;}l=B;return i|0}function PZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;c[g>>2]=d;d=OZ(b,c[b+144>>2]|0,g,e,f,(a[b+480>>0]|0)==0&1)|0;g=c[g>>2]|0;do if(!((d|0)!=0|(g|0)==0)){d=b+276|0;if(!(c[b+472>>2]|0)){c[d>>2]=58;d=pZ(b,g,e,f)|0;break}else {c[d>>2]=63;d=QZ(b,g,e,f)|0;break}}while(0);l=h;return d|0}function QZ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;d=IZ(b,1,c[b+144>>2]|0,d,e,f,(a[b+480>>0]|0)==0&1)|0;if((d|0)==0?(RZ(b)|0)<<24>>24==0:0)d=1;return d|0}function RZ(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=a+16|0;a=a+360|0;while(1){a=c[a>>2]|0;if(!a){a=1;break}i=(c[a+24>>2]|0)+1|0;j=a+36|0;f=c[j>>2]|0;e=f+i|0;l=a+4|0;d=c[l>>2]|0;if((d|0)==(e|0)){a=1;break}k=a+8|0;b=c[k>>2]|0;g=b+i|0;h=a+40|0;if((g|0)>((c[h>>2]|0)-f|0)){e=lb[c[m>>2]&127](f,g)|0;if(!e){a=0;break}b=a+12|0;f=c[j>>2]|0;if((c[b>>2]|0)==(f|0))c[b>>2]=e;b=a+16|0;d=c[b>>2]|0;if(d|0)c[b>>2]=e+(d-f);c[j>>2]=e;c[h>>2]=e+g;e=e+i|0;d=c[l>>2]|0;b=c[k>>2]|0;}W6(e|0,d|0,b|0)|0;c[l>>2]=e;}return a|0}function SZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=b+12|0;g=b+8|0;while(1){e=c[f>>2]|0;if((e|0)==(c[g>>2]|0)){if(!((vZ(b)|0)<<24>>24)){d=0;break}e=c[f>>2]|0;}i=a[d>>0]|0;c[f>>2]=e+1;a[e>>0]=i;if(!(a[d>>0]|0)){h=6;break}else d=d+1|0;}if((h|0)==6){i=b+16|0;d=c[i>>2]|0;c[i>>2]=c[f>>2];}return d|0}function TZ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=c[b+352>>2]|0;j=n+80|0;k=n+92|0;l=n+88|0;m=n+60|0;n=n+96|0;i=d+4|0;h=c[d>>2]|0;a:while(1){switch(a[h>>0]|0){case 0:{e=1;break a}case 58:{g=c[d>>2]|0;while(1){e=c[k>>2]|0;f=(e|0)==(c[l>>2]|0);if((g|0)==(h|0))break;if(f){if(!((vZ(j)|0)<<24>>24)){e=0;break a}e=c[k>>2]|0;}f=a[g>>0]|0;c[k>>2]=e+1;a[e>>0]=f;g=g+1|0;}if(f){if(!((vZ(j)|0)<<24>>24)){e=0;break a}e=c[k>>2]|0;}c[k>>2]=e+1;a[e>>0]=0;e=nZ(b,m,c[n>>2]|0,8)|0;if(!e){e=0;break a}f=c[n>>2]|0;if((c[e>>2]|0)==(f|0))c[n>>2]=c[k>>2];else c[k>>2]=f;c[i>>2]=e;break}default:{}}h=h+1|0;}return e|0}function UZ(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=a[f>>0]|0;i=c[d>>2]|0;h=(i|0)==0;do if(!(k<<24>>24))if(h){m=0;j=11;}else h=28;else if(((!h?(a[i>>0]|0)==120:0)?(a[i+1>>0]|0)==109:0)?(a[i+2>>0]|0)==108:0){h=a[i+3>>0]|0;if((h<<24>>24==110?(a[i+4>>0]|0)==115:0)?(a[i+5>>0]|0)==0:0){h=39;break}m=h<<24>>24==0&1;j=11;}else {m=0;j=11;}while(0);a:do if((j|0)==11){l=m<<24>>24!=0;h=1;i=1;n=0;while(1){j=i<<24>>24!=0;if(!(k<<24>>24))break;do if(j){if((n|0)<=36?k<<24>>24==(a[142257+n>>0]|0):0)break;i=0;}else i=0;while(0);do if(!(l|h<<24>>24==0)){if((n|0)<=29?k<<24>>24==(a[142294+n>>0]|0):0)break;h=0;}while(0);k=n+1|0;n=k;k=a[f+k>>0]|0;}if((m&255|0)!=(j&(n|0)==36&1|0)){h=l?38:40;break}if(!(h<<24>>24!=0&(n|0)==29)){o=b+468|0;n=n+((a[o>>0]|0)!=0&1)|0;h=b+372|0;j=c[h>>2]|0;do if(!j){h=b+12|0;i=kb[c[h>>2]&63](28)|0;if(!i){h=1;break a}j=n+24|0;m=kb[c[h>>2]&63](j)|0;c[i+16>>2]=m;if(!m){tb[c[b+20>>2]&127](i);h=1;break a}else {c[i+24>>2]=j;j=i;break}}else {i=j+24|0;if((n|0)>(c[i>>2]|0)){k=j+16|0;l=n+24|0;m=lb[c[b+16>>2]&127](c[k>>2]|0,l)|0;if(!m){h=1;break a}c[k>>2]=m;c[i>>2]=l;}c[h>>2]=c[j+4>>2];}while(0);c[j+20>>2]=n;i=j+16|0;W6(c[i>>2]|0,f|0,n|0)|0;h=a[o>>0]|0;if(h<<24>>24)a[(c[i>>2]|0)+(n+-1)>>0]=h;c[j>>2]=d;c[j+12>>2]=e;i=d+4|0;c[j+8>>2]=c[i>>2];if((a[f>>0]|0)==0?((c[b+352>>2]|0)+152|0)==(d|0):0)h=0;else h=j;c[i>>2]=h;c[j+4>>2]=c[g>>2];c[g>>2]=j;if((e|0)!=0?(p=c[b+100>>2]|0,(p|0)!=0):0){vb[p&127](c[b+4>>2]|0,c[d>>2]|0,c[i>>2]|0?f:0);h=0;}else h=0;}else h=40;}while(0);return h|0}function VZ(a,b){a=a|0;b=b|0;var d=0;d=b;c[d>>2]=0;c[d+4>>2]=0;b=b+8|0;c[b>>2]=$Z(a)|0;c[b+4>>2]=0;return}function WZ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=b;g=c[d+4>>2]^1936682341;e=a;c[e>>2]=c[d>>2]^1886610805;c[e+4>>2]=g;e=b+8|0;g=e;d=c[g+4>>2]^1685025377;f=a+8|0;c[f>>2]=c[g>>2]^1852075885;c[f+4>>2]=d;f=b;b=c[f+4>>2]^1819895653;d=a+16|0;c[d>>2]=c[f>>2]^1852142177;c[d+4>>2]=b;d=c[e+4>>2]^1952801890;b=a+24|0;c[b>>2]=c[e>>2]^2037671283;c[b+4>>2]=d;c[a+40>>2]=a+32;b=a+48|0;c[b>>2]=0;c[b+4>>2]=0;return}function XZ(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0;n=e+f|0;o=b+40|0;p=b+40|0;q=b+32|0;r=b+33|0;s=b+34|0;t=b+35|0;h=b+36|0;i=b+37|0;j=b+38|0;k=b+39|0;l=b+24|0;m=b+48|0;f=e;do{while(1){g=c[o>>2]|0;if(f>>>0>=n>>>0){e=0;break}if(g>>>0>=p>>>0){e=1;break}e=a[f>>0]|0;c[o>>2]=g+1;a[g>>0]=e;f=f+1|0;}if(g>>>0

>>0)break;A=d[q>>0]|0;B=R6(d[r>>0]|0|0,0,8)|0;g=z;y=R6(d[s>>0]|0|0,0,16)|0;g=g|z;w=R6(d[t>>0]|0|0,0,24)|0;g=g|z|(d[h>>0]|0);u=R6(d[i>>0]|0|0,0,40)|0;g=g|z;x=R6(d[j>>0]|0|0,0,48)|0;g=g|z;v=R6(d[k>>0]|0|0,0,56)|0;v=B|A|y|w|u|x|v;g=g|z;x=l;u=g^c[x+4>>2];w=l;c[w>>2]=v^c[x>>2];c[w+4>>2]=u;_Z(b,2);w=b;g=c[w+4>>2]^g;u=b;c[u>>2]=c[w>>2]^v;c[u+4>>2]=g;c[o>>2]=q;u=m;u=J6(c[u>>2]|0,c[u+4>>2]|0,8,0)|0;g=m;c[g>>2]=u;c[g+4>>2]=z;}while(e);return}function YZ(b){b=b|0;var c=0;c=0;while(1){if(!(a[b>>0]|0))break;c=c+1|0;b=b+1|0;}return c|0}function ZZ(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0;f=a+32|0;h=(c[a+40>>2]|0)-f|0;e=a+48|0;e=J6(c[e>>2]|0,c[e+4>>2]|0,h|0,0)|0;e=R6(e|0,z|0,56)|0;b=z;switch(h<<24>>24|0){case 7:{e=R6(d[a+38>>0]|0|0,0,48)|0|e;b=z|b;g=3;break}case 6:{g=3;break}case 5:{g=4;break}case 4:{g=5;break}case 3:{g=6;break}case 2:{g=7;break}case 1:{g=8;break}default:{}}if((g|0)==3){h=R6(d[a+37>>0]|0|0,0,40)|0;e=h|e;b=z|b;g=4;}if((g|0)==4){b=d[a+36>>0]|0|b;g=5;}if((g|0)==5){h=R6(d[a+35>>0]|0|0,0,24)|0;e=h|e;b=z|b;g=6;}if((g|0)==6){h=R6(d[a+34>>0]|0|0,0,16)|0;e=h|e;b=z|b;g=7;}if((g|0)==7){h=R6(d[a+33>>0]|0|0,0,8)|0;b=z|b;e=h|e;g=8;}if((g|0)==8)e=e|(d[f>>0]|0);h=a+24|0;i=h;g=c[i+4>>2]^b;f=h;c[f>>2]=c[i>>2]^e;c[f+4>>2]=g;_Z(a,2);f=a;b=c[f+4>>2]^b;g=a;c[g>>2]=c[f>>2]^e;c[g+4>>2]=b;g=a+16|0;b=g;e=c[b+4>>2]|0;f=g;c[f>>2]=c[b>>2]^255;c[f+4>>2]=e;_Z(a,4);f=a;a=a+8|0;z=c[a+4>>2]^c[f+4>>2]^c[g+4>>2]^c[h+4>>2];return c[a>>2]^c[f>>2]^c[g>>2]^c[h>>2]|0}function _Z(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=a+8|0;f=a+24|0;g=a+16|0;d=0;while(1){if((d|0)>=(b|0))break;h=e;n=c[h>>2]|0;h=c[h+4>>2]|0;o=a;o=J6(c[o>>2]|0,c[o+4>>2]|0,n|0,h|0)|0;k=z;m=R6(n|0,h|0,13)|0;l=z;h=Q6(n|0,h|0,51)|0;h=(m|h)^o;l=(l|z)^k;m=f;n=c[m>>2]|0;m=c[m+4>>2]|0;j=g;j=J6(c[j>>2]|0,c[j+4>>2]|0,n|0,m|0)|0;i=z;q=R6(n|0,m|0,16)|0;p=z;m=Q6(n|0,m|0,48)|0;m=(q|m)^j;p=(p|z)^i;o=J6(k|0,o|0,m|0,p|0)|0;k=z;q=a;c[q>>2]=o;c[q+4>>2]=k;q=R6(m|0,p|0,21)|0;n=z;p=Q6(m|0,p|0,43)|0;m=f;c[m>>2]=(q|p)^o;c[m+4>>2]=(n|z)^k;i=J6(j|0,i|0,h|0,l|0)|0;j=z;m=R6(h|0,l|0,17)|0;k=z;l=Q6(h|0,l|0,47)|0;h=e;c[h>>2]=(m|l)^i;c[h+4>>2]=(k|z)^j;h=g;c[h>>2]=j;c[h+4>>2]=i;d=d+1|0;}return}function $Z(a){a=a|0;var b=0;while(1){b=c[a+472>>2]|0;if(!b)break;else a=b;}return c[a+492>>2]|0}function a_(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;L=l;l=l+16|0;I=L;J=L+4|0;K=c[b+352>>2]|0;o=d+16|0;p=d+40|0;q=b+144|0;r=b+284|0;s=e<<24>>24==0;t=h+12|0;v=h+16|0;w=h+8|0;x=d+44|0;y=d+64|0;z=b+436|0;A=b+452|0;B=b+448|0;C=(K+80|0)==(h|0);D=b+268|0;E=K+130|0;F=K+129|0;G=b+296|0;H=b+224|0;i=0;a:while(1){b:while(1){switch(ob[c[o>>2]&127](d,f,g,I)|0){case -4:{i=0;n=61;break a}case 0:{n=4;break a}case -1:{n=6;break a}case 6:{n=21;break b}case -3:{n=22;break b}case 7:case 39:{n=23;break b}case 10:{j=lb[c[p>>2]&127](d,f)|0;c:do if((j|0)<0)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;j=1;i=14;}else {j=1;i=14;}else {if(s&(j|0)==32){k=c[t>>2]|0;if((c[v>>2]|0)==(k|0)){j=4;break}if((a[k+-1>>0]|0)==32){j=4;break}}m=x_(j,J)|0;k=0;while(1){if((k|0)>=(m|0)){j=0;break c}j=c[t>>2]|0;if((j|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){j=1;i=1;break c}j=c[t>>2]|0;}M=a[J+k>>0]|0;c[t>>2]=j+1;a[j>>0]=M;k=k+1|0;}}while(0);switch(j&7){case 4:case 0:break b;default:{}}break}case 9:{j=c[y>>2]|0;j=(nb[c[x>>2]&63](d,f+j|0,(c[I>>2]|0)+(0-j)|0)|0)&255;if(j<<24>>24){n=31;break b}j=c[y>>2]|0;j=lZ(z,d,f+j|0,(c[I>>2]|0)+(0-j)|0)|0;if(!j){i=1;n=61;break a}m=nZ(b,K,j,0)|0;c[B>>2]=c[A>>2];do if(C){if(!(c[D>>2]|0))if(!m)break b;else break;if(!(a[E>>0]|0)){j=(m|0)!=0;if(!(a[F>>0]|0)){n=45;break}else {u=j;n=47;break}}else {j=(m|0)!=0;if(!(c[G>>2]|0)){n=45;break}else {u=j;n=47;break}}}else if(!(a[F>>0]|0))if(!m){i=11;n=61;break a}else {n=46;break}else {j=(m|0)!=0;if(!(a[E>>0]|0)){u=j;n=47;break}else {n=45;break}}while(0);if((n|0)==45)if(j)n=46;else {i=11;n=61;break a}else if((n|0)==47?(n=0,!u):0)break b;if((n|0)==46?(n=0,(a[m+34>>0]|0)==0):0){i=24;n=61;break a}k=m+32|0;if(a[k>>0]|0){n=49;break a}if(c[m+28>>2]|0){n=52;break a}j=c[m+4>>2]|0;if(!j){n=55;break a}m=j+(c[m+8>>2]|0)|0;a[k>>0]=1;m=a_(b,c[H>>2]|0,e,j,m,h)|0;a[k>>0]=0;j=(m|0)==0;if(j)break b;else {j=(j^1)&1;i=m;}break}default:{n=58;break a}}if(j)break a}if((n|0)==21){n=0;if(!(tZ(h,d,f,c[I>>2]|0)|0)){i=1;n=61;break}}else if((n|0)==22){c[I>>2]=f+(c[y>>2]|0);n=23;}else if((n|0)==31){n=0;f=c[t>>2]|0;if((f|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){i=1;n=61;break}f=c[t>>2]|0;}c[t>>2]=f+1;a[f>>0]=j;}do if((n|0)==23){n=0;f=c[t>>2]|0;if(s){if((c[v>>2]|0)==(f|0))break;if((a[f+-1>>0]|0)==32)break}if((f|0)==(c[w>>2]|0)){if(!((vZ(h)|0)<<24>>24)){i=1;n=61;break a}f=c[t>>2]|0;}c[t>>2]=f+1;a[f>>0]=32;}while(0);f=c[I>>2]|0;}if((n|0)==4)if((c[q>>2]|0)==(d|0)){c[r>>2]=c[I>>2];i=4;n=61;}else {i=4;n=61;}else if((n|0)==6)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=4;n=61;}else {i=4;n=61;}else if((n|0)==49)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=12;n=61;}else {i=12;n=61;}else if((n|0)==52)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=15;n=61;}else {i=15;n=61;}else if((n|0)==55)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=16;n=61;}else {i=16;n=61;}else if((n|0)==58)if((c[q>>2]|0)==(d|0)){c[r>>2]=f;i=23;n=61;}else {i=23;n=61;}l=L;return i|0}function b_(a){a=a|0;var b=0;b=a+8|0;return ((a|0)<1?0:(b|0)>0?b:0)|0}function c_(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=l;l=l+80|0;d=c+16|0;e=c;VZ(a,e);WZ(d,e);XZ(d,b,YZ(b)|0);b=ZZ(d)|0;l=c;return b|0}function d_(b,c){b=b|0;c=c|0;var d=0;while(1){d=a[b>>0]|0;if(d<<24>>24!=(a[c>>0]|0)){c=0;break}if(!(d<<24>>24)){c=1;break}c=c+1|0;b=b+1|0;}return c|0}function e_(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+1040|0;i=k;f=c[b+124>>2]|0;a:do if(!f)e=18;else {e=0;while(1){if((e|0)==256)break;c[i+(e<<2)>>2]=-1;e=e+1|0;}g=i+1028|0;c[g>>2]=0;j=i+1024|0;c[j>>2]=0;h=i+1032|0;c[h>>2]=0;do if(nb[f&63](c[b+244>>2]|0,d,i)|0){f=c[b+12>>2]|0;e=y_()|0;e=kb[f&63](e)|0;c[b+236>>2]=e;if(!e){e=c[h>>2]|0;if(!e)e=1;else {tb[e&127](c[j>>2]|0);e=1;}}else {e=ob[(a[b+232>>0]<<24>>24?65:64)&127](e,i,c[g>>2]|0,c[j>>2]|0)|0;if(!e)break;c[b+240>>2]=c[j>>2];c[b+248>>2]=c[h>>2];c[b+144>>2]=e;e=0;}break a}while(0);e=c[h>>2]|0;if(e|0)tb[e&127](c[j>>2]|0);e=18;}while(0);l=k;return e|0}function f_(b,d){b=b|0;d=d|0;a[b+4>>0]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b>>2]=0;c[b+16>>2]=d;return}function g_(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;l=c[b+352>>2]|0;m=b+424|0;n=b+420|0;o=b+412|0;p=b+428|0;q=l+152|0;r=b+368|0;j=l+60|0;k=l+80|0;a:while(1){h=d;b:while(1){if(!(a[d>>0]|0)){d=1;break a}f=a[h>>0]|0;switch(f<<24>>24){case 0:case 12:{s=5;break b}case 61:break b;default:{}}e=c[m>>2]|0;if((e|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break a}e=c[m>>2]|0;f=a[h>>0]|0;}c[m>>2]=e+1;a[e>>0]=f;h=h+1|0;}if((s|0)==5){s=0;d=c[m>>2]|0;if((d|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;d=nZ(b,l,c[p>>2]|0,0)|0;if(d|0)a[d+32>>0]=1;d=(a[h>>0]|0)==0?h:h+1|0;c[m>>2]=c[p>>2];continue}d=c[m>>2]|0;if((c[p>>2]|0)==(d|0))f=q;else {if((d|0)==(c[n>>2]|0)){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;f=nZ(b,j,c[p>>2]|0,8)|0;if(!f){d=0;break}e=c[f>>2]|0;i=c[p>>2]|0;d=i;if((e|0)==(i|0)){i=SZ(k,e)|0;c[f>>2]=i;if(!i){d=0;break}d=c[p>>2]|0;}c[m>>2]=d;}c:while(1){i=h+1|0;e=a[i>>0]|0;g=(d|0)==(c[n>>2]|0);switch(e<<24>>24){case 0:case 12:break c;default:{}}if(g){if(!((vZ(o)|0)<<24>>24)){d=0;break a}d=c[m>>2]|0;e=a[i>>0]|0;}c[m>>2]=d+1;a[d>>0]=e;h=i;d=c[m>>2]|0;}if(g){if(!((vZ(o)|0)<<24>>24)){d=0;break}d=c[m>>2]|0;}c[m>>2]=d+1;a[d>>0]=0;if(UZ(b,f,0,c[p>>2]|0,r)|0){d=0;break}c[m>>2]=c[p>>2];d=(a[i>>0]|0)==0?i:h+2|0;}return d|0}function h_(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0?(d=a+4|0,e=(c[d>>2]|0)==(c[a>>2]|0),c[a>>2]=b,e):0)c[d>>2]=b;return}function i_(a,b,d){a=a|0;b=b|0;d=d|0;if(a|0){c[a+52>>2]=b;c[a+56>>2]=d;}return}function j_(a,b){a=a|0;b=b|0;if(a|0)c[a+60>>2]=b;return}function k_(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=(b|0)==0;a:do if(!(g|(e|0)<0)?!((d|0)==0&(e|0)!=0):0){h=b+476|0;switch(c[h>>2]|0){case 3:{c[b+280>>2]=33;g=0;break a}case 2:{c[b+280>>2]=36;g=0;break a}case 0:{if((c[b+472>>2]|0)==0?(l_(b)|0)<<24>>24==0:0){c[b+280>>2]=1;g=0;break a}break}default:{}}c[h>>2]=1;if(e|0){g=n_(b,e)|0;if(!g){g=0;break}W6(g|0,d|0,e|0)|0;g=o_(b,e,f)|0;break}a[b+480>>0]=f;if(!f)g=1;else {g=b+24|0;j=c[g>>2]|0;d=b+292|0;c[d>>2]=j;f=c[b+28>>2]|0;c[b+40>>2]=f;e=b+276|0;f=ob[c[e>>2]&127](b,j,f,g)|0;c[b+280>>2]=f;if(f|0){c[b+288>>2]=c[b+284>>2];c[e>>2]=66;g=0;break}switch(c[h>>2]|0){case 3:{j=c[b+144>>2]|0;xb[c[j+48>>2]&31](j,c[d>>2]|0,c[g>>2]|0,b+404|0);c[d>>2]=c[g>>2];g=2;break a}case 1:case 0:{c[h>>2]=2;g=1;break a}default:{g=1;break a}}}}else i=3;while(0);if((i|0)==3)if(g)g=0;else {c[b+280>>2]=41;g=0;}return g|0}function l_(b){b=b|0;var d=0;d=b+492|0;if(!(c[d>>2]|0))c[d>>2]=p_()|0;if(!(a[b+232>>0]|0))b=1;else b=g_(b,142324)|0;return b|0}function m_(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return c[a+280>>2]|0}function n_(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;a:do if(!a)d=0;else {if((b|0)<0){c[a+280>>2]=1;d=0;break}switch(c[a+476>>2]|0){case 3:{c[a+280>>2]=33;d=0;break a}case 2:{c[a+280>>2]=36;d=0;break a}default:{m=a+32|0;j=c[m>>2]|0;n=a+28|0;e=c[n>>2]|0;d=e;if((j-e|0)>=(b|0))break a;p=a+24|0;k=c[p>>2]|0;i=e-k|0;e=i+b|0;if((e|0)<0){c[a+280>>2]=1;d=0;break a}l=a+8|0;f=c[l>>2]|0;q=f;g=k-q|0;h=(g|0)>1024;b=h?1024:g;e=b+e|0;do if((e|0)>(j-q|0)){d=j-k|0;d=(d|0)==0?1024:d;do d=d<<1;while((d|0)<(e|0)&(d|0)>0);if((d|0)<1){c[a+280>>2]=1;d=0;break a}e=kb[c[a+12>>2]&63](d)|0;if(!e){c[a+280>>2]=1;d=0;break a}c[m>>2]=e+d;d=c[p>>2]|0;if(!d){d=e+(c[n>>2]|0)|0;c[n>>2]=d;c[l>>2]=e;o=22;break}else {q=d;o=q-(c[l>>2]|0)|0;o=(o|0)<1024?o:1024;W6(e|0,d+(0-o)|0,(c[n>>2]|0)-q+o|0)|0;tb[c[a+20>>2]&127](c[l>>2]|0);c[l>>2]=e;d=e+((c[n>>2]|0)-(c[p>>2]|0))+o|0;c[n>>2]=d;e=e+o|0;o=22;break}}else if(h){e=g-b|0;X6(f|0,f+e|0,b+i|0)|0;e=0-e|0;d=(c[n>>2]|0)+e|0;c[n>>2]=d;e=(c[p>>2]|0)+e|0;o=22;}while(0);if((o|0)==22)c[p>>2]=e;c[a+288>>2]=0;c[a+284>>2]=0;c[a+292>>2]=0;break a}}}while(0);return d|0}function o_(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;a:do if(!b)d=0;else {f=b+476|0;switch(c[f>>2]|0){case 3:{c[b+280>>2]=33;d=0;break a}case 2:{c[b+280>>2]=36;d=0;break a}case 0:{if((c[b+472>>2]|0)==0?(l_(b)|0)<<24>>24==0:0){c[b+280>>2]=1;d=0;break a}break}default:{}}c[f>>2]=1;g=b+24|0;j=c[g>>2]|0;h=b+292|0;c[h>>2]=j;k=b+28|0;i=(c[k>>2]|0)+d|0;c[k>>2]=i;c[b+40>>2]=i;k=b+36|0;c[k>>2]=(c[k>>2]|0)+d;a[b+480>>0]=e;d=b+276|0;i=ob[c[d>>2]&127](b,j,i,g)|0;c[b+280>>2]=i;if(i|0){c[b+288>>2]=c[b+284>>2];c[d>>2]=66;d=0;break}switch(c[f>>2]|0){case 3:{d=2;break}case 1:case 0:{if(!e)d=1;else {c[f>>2]=2;d=1;break a}break}default:d=1;}k=c[b+144>>2]|0;xb[c[k+48>>2]&31](k,c[h>>2]|0,c[g>>2]|0,b+404|0);c[h>>2]=c[g>>2];}while(0);return d|0}function p_(){var a=0,b=0,d=0;b=l;l=l+16|0;a=b;if(!(q_(a)|0)){d=s_()|0;d=(X4()|0)^d;c[a>>2]=d;a=r_(142378,O(d,2147483647)|0)|0;}else a=r_(142365,c[a>>2]|0)|0;l=b;return a|0}function q_(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=m2(142365,0,f)|0;if((e|0)<0)b=0;else {b=0;while(1){g=W4(e,a+b|0,4-b|0)|0;d=g+b|0;if((g|0)>0)if(d>>>0<4)b=d;else {b=1;break}if((c[(d2()|0)>>2]|0)!=4){b=0;break}}l4(e)|0;}l=f;return b|0}function r_(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=Ta(142443)|0;if(d|0?(s2(d,142463)|0)==0:0){d=c[15712]|0;c[e>>2]=a;c[e+4>>2]=8;c[e+8>>2]=b;c[e+12>>2]=4;w4(d,142465,e)|0;}l=f;return b|0}function s_(){var a=0,b=0;b=l;l=l+16|0;a=b;if(!(Ua(a|0,0)|0)){l=b;return c[a+4>>2]|0}else qa(142390,142412,819,142423);return 0}function t_(a){a=a|0;if(!a)a=41;else a=c[a+280>>2]|0;return a|0}function u_(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(!a)a=0;else {b=a+284|0;d=c[b>>2]|0;if(d|0?(e=a+292|0,f=c[e>>2]|0,d>>>0>=f>>>0):0){g=c[a+144>>2]|0;xb[c[g+48>>2]&31](g,f,d,a+404|0);c[e>>2]=c[b>>2];}a=(c[a+404>>2]|0)+1|0;}return a|0}function v_(a){a=a|0;do switch(a|0){case 41:{a=142502;break}case 1:{a=143774;break}case 2:{a=143761;break}case 3:{a=143744;break}case 4:{a=143712;break}case 5:{a=143697;break}case 6:{a=143679;break}case 7:{a=143664;break}case 8:{a=143644;break}case 9:{a=143616;break}case 10:{a=143581;break}case 11:{a=143564;break}case 12:{a=143537;break}case 13:{a=143517;break}case 14:{a=143479;break}case 15:{a=143452;break}case 16:{a=143410;break}case 17:{a=143363;break}case 18:{a=143346;break}case 19:{a=143295;break}case 20:{a=143272;break}case 21:{a=143226;break}case 22:{a=143199;break}case 23:{a=143148;break}case 24:{a=143112;break}case 25:{a=143060;break}case 26:{a=143015;break}case 27:{a=143e3;break}case 28:{a=142974;break}case 29:{a=142936;break}case 30:{a=142904;break}case 31:{a=142871;break}case 32:{a=142837;break}case 33:{a=142820;break}case 34:{a=142799;break}case 35:{a=142783;break}case 36:{a=142766;break}case 37:{a=142722;break}case 38:{a=142642;break}case 39:{a=142583;break}case 40:{a=142519;break}default:a=0;}while(0);return a|0}function w_(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0;e=c[b>>2]|0;f=0;a:while(1){if(e>>>0<=a>>>0)break;h=e+-1|0;g=d[h>>0]|0;do if((g&248|0)==240)if((f+1|0)>>>0>3){i=5;break a}else f=0;else {if((g&240|0)==224)if((f+1|0)>>>0>2){i=8;break a}else {f=0;break}if((g&224|0)==192)if((f+1|0)>>>0>1){i=11;break a}else {f=0;break}else if(!(g&128))break a;else break}while(0);e=h;f=f+1|0;}if((i|0)==5)e=e+3|0;else if((i|0)==8)e=e+2|0;else if((i|0)==11)e=e+1|0;c[b>>2]=e;return}function x_(b,c){b=b|0;c=c|0;do if((b|0)>=0){if((b|0)<128){a[c>>0]=b;b=1;break}if((b|0)<2048){a[c>>0]=b>>>6|192;a[c+1>>0]=b&63|128;b=2;break}if((b|0)<65536){a[c>>0]=b>>>12|224;a[c+1>>0]=b>>>6&63|128;a[c+2>>0]=b&63|128;b=3;break}if((b|0)<1114112){a[c>>0]=b>>>18|240;a[c+1>>0]=b>>>12&63|128;a[c+2>>0]=b>>>6&63|128;a[c+3>>0]=b&63|128;b=4;}else b=0;}else b=0;while(0);return b|0}function y_(){return 1908}function z_(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=0;while(1){if((i|0)==364){i=0;break}a[e+i>>0]=a[56576+i>>0]|0;i=i+1|0;}a:while(1){if((i|0)>=128){j=5;break}switch(a[56648+i>>0]|0){case 0:case 28:break;default:if((c[f+(i<<2)>>2]|0)!=(i|0)){e=0;break a}}i=i+1|0;}b:do if((j|0)==5){q=e+72|0;m=e+372|0;n=e+884|0;o=(g|0)==0;l=0;while(1){if((l|0)>=256)break;p=c[f+(l<<2)>>2]|0;do if((p|0)==-1){a[q+l>>0]=1;b[m+(l<<1)>>1]=-1;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=0;}else {if((p|0)<0){if(o|(p|0)<-4){e=0;break b}a[q+l>>0]=3-p;a[n+(l<<2)>>0]=0;b[m+(l<<1)>>1]=0;break}if((p|0)<128){i=a[56648+p>>0]|0;switch(i<<24>>24){case 0:case 28:break;default:if((p|0)!=(l|0)){e=0;break b}}a[q+l>>0]=i;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=p;b[m+(l<<1)>>1]=(p|0)==0?-1:p&65535;break}if((A_(p)|0)<0){a[q+l>>0]=0;b[m+(l<<1)>>1]=-1;a[n+(l<<2)>>0]=1;a[n+(l<<2)+1>>0]=0;break}if((p|0)>65535){e=0;break b}i=p>>>8;j=p>>>5&7;k=1<<(p&31);if(!(c[56940+((d[143788+i>>0]<<3|j)<<2)>>2]&k))a[q+l>>0]=c[56940+((d[144044+i>>0]<<3|j)<<2)>>2]&k|0?26:28;else a[q+l>>0]=22;a[n+(l<<2)>>0]=x_(p,n+(l<<2)+1|0)|0;b[m+(l<<1)>>1]=p;}while(0);l=l+1|0;}c[e+368>>2]=h;c[e+364>>2]=g;if(!o){c[e+328>>2]=108;c[e+332>>2]=108;c[e+336>>2]=108;c[e+340>>2]=109;c[e+344>>2]=109;c[e+348>>2]=109;c[e+352>>2]=110;c[e+356>>2]=110;c[e+360>>2]=110;}c[e+56>>2]=13;c[e+60>>2]=14;}while(0);return e|0}function A_(b){b=b|0;var c=0;switch(b>>8|0){case 223:case 222:case 221:case 220:case 219:case 218:case 217:case 216:{b=-1;break}case 0:{if(!(a[56648+b>>0]|0))b=-1;else c=4;break}case 255:{if((b|1|0)==65535)b=-1;else c=4;break}default:c=4;}return b|0}function B_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=0;else a=c[56940+(((d[144044+(a>>>8)>>0]|0)<<3|a>>>5&7)<<2)>>2]&1<<(a&31);return a|0}function C_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=0;else a=c[56940+(((d[143788+(a>>>8)>>0]|0)<<3|a>>>5&7)<<2)>>2]&1<<(a&31);return a|0}function D_(a,b){a=a|0;b=b|0;a=lb[c[a+364>>2]&127](c[a+368>>2]|0,b)|0;if(a>>>0>65535)a=1;else a=(A_(a)|0)>>>31;return a|0}function E_(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;q=l;l=l+16|0;m=q;n=b+364|0;o=b+884|0;p=b+368|0;k=b+72|0;while(1){i=c[e>>2]|0;if((i|0)==(f|0)){h=0;break}r=d[i>>0]|0;j=o+(r<<2)+1|0;r=a[o+(r<<2)>>0]|0;b=r<<24>>24;if(!(r<<24>>24)){b=x_(lb[c[n>>2]&127](c[p>>2]|0,i)|0,m)|0;if((b|0)>(h-(c[g>>2]|0)|0)){h=2;break}i=c[e>>2]|0;j=m;i=i+((d[k+(d[i>>0]|0)>>0]|0)+-3)|0;}else {if((h-(c[g>>2]|0)|0)<(b|0)){h=2;break}i=i+1|0;}c[e>>2]=i;W6(c[g>>2]|0,j|0,b|0)|0;c[g>>2]=(c[g>>2]|0)+b;}l=q;return h|0}function F_(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=a+372|0;n=a+364|0;o=a+368|0;l=a+72|0;while(1){k=c[e>>2]|0;a=k>>>0>>0;i=c[g>>2]|0;if(!(a&i>>>0>>0))break;a=b[m+((d[k>>0]|0)<<1)>>1]|0;if(!(a<<16>>16)){a=(lb[c[n>>2]&127](c[o>>2]|0,k)|0)&65535;i=c[e>>2]|0;j=(d[l+(d[i>>0]|0)>>0]|0)+-3|0;}else {j=1;i=k;}c[e>>2]=i+j;k=c[g>>2]|0;c[g>>2]=k+2;b[k>>1]=a;}return ((i|0)!=(h|0)|a^1?0:2)|0}function G_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:do if(e>>>0>>0){n=b+72|0;do switch(a[n+(d[e>>0]|0)>>0]|0){case 12:{h=f$(12,b,e+1|0,f,g)|0;break a}case 13:{h=f$(13,b,e+1|0,f,g)|0;break a}case 2:{h=e+1|0;if((f-h|0)<=0){h=-1;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 16:{h=g$(b,e+2|0,f,g)|0;break a}case 15:{h=b$(b,e+2|0,f,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;h=29;break a}default:{c[g>>2]=h;h=0;break a}}}case 9:{if((e+1|0)==(f|0)){c[g>>2]=f;h=-15;break a}else k=3;break}case 10:case 21:{k=3;break}case 30:{h=X_(b,e+1|0,f,g)|0;break a}case 35:{c[g>>2]=e+1;h=38;break a}case 20:{c[g>>2]=e+1;h=25;break a}case 4:{i=e+1|0;h=f-i|0;if((h|0)<=0){h=-26;break a}if((a[i>>0]|0)==93){if((h|0)<=1){h=-1;break a}if((a[e+2>>0]|0)==62){c[g>>2]=e+3;h=34;break a}}c[g>>2]=i;h=26;break a}case 31:{c[g>>2]=e+1;h=23;break a}case 32:{h=e+1|0;if((f-h|0)<=0){h=-24;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 33:{c[g>>2]=e+2;h=36;break a}case 15:{c[g>>2]=e+2;h=35;break a}case 34:{c[g>>2]=e+2;h=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;h=24;break a}default:{c[g>>2]=h;h=0;break a}}}case 36:{c[g>>2]=e+1;h=21;break a}case 11:{c[g>>2]=e+1;h=17;break a}case 19:{h=h$(b,e+1|0,f,g)|0;break a}case 5:{if((f-e|0)<2){h=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0))if(!(lb[c[b+328>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=2;}else {h=18;i=2;}break}case 6:{if((f-e|0)<3){h=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0))if(!(lb[c[b+332>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=3;}else {h=18;i=3;}break}case 7:{if((f-e|0)<4){h=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0))if(!(lb[c[b+336>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else {h=19;i=4;}else {h=18;i=4;}break}case 24:case 22:{h=18;i=1;break}case 23:case 27:case 26:case 25:{h=19;i=1;break}default:{c[g>>2]=e;h=0;break a}}while(0);if((k|0)==3){j=f;i=e;b:while(1){h=i;i=i+1|0;if((j-i|0)<=0){k=18;break}switch(a[n+(d[i>>0]|0)>>0]|0){case 10:case 21:continue b;case 9:break;default:{k=17;break b}}if((h+2|0)==(f|0)){k=17;break}}if((k|0)==17){c[g>>2]=i;h=15;break}else if((k|0)==18){c[g>>2]=i;h=15;break}}k=b+328|0;l=b+332|0;m=b+336|0;j=e+i|0;c:while(1){i=f-j|0;if((i|0)<=0){k=99;break}switch(a[n+(d[j>>0]|0)>>0]|0){case 29:{k=56;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{k=70;break c}case 34:{k=89;break c}case 33:{k=92;break c}case 15:{k=95;break c}case 27:case 26:case 25:case 24:case 22:{e=h;j=j+1|0;h=e;continue c}case 5:{if((i|0)<2){h=-2;break a}if(!(lb[c[k>>2]&127](b,j)|0)){k=60;break c}e=h;j=j+2|0;h=e;continue c}case 6:{if((i|0)<3){h=-2;break a}if(!(lb[c[l>>2]&127](b,j)|0)){k=64;break c}e=h;j=j+3|0;h=e;continue c}case 7:{if((i|0)<4){h=-2;break a}if(!(lb[c[m>>2]&127](b,j)|0)){k=68;break c}e=h;j=j+4|0;h=e;continue c}case 23:{i=j+1|0;switch(h&63){case 18:break;case 41:{h=19;j=i;continue c}default:{e=h;j=i;h=e;continue c}}h=f-i|0;if((h|0)<=0){h=-1;break a}switch(a[n+(d[i>>0]|0)>>0]|0){case 29:{k=74;break c}case 27:case 26:case 25:case 24:case 22:{h=41;j=j+2|0;continue c}case 5:{if((h|0)<2){h=-2;break a}if(!(lb[c[k>>2]&127](b,i)|0)){k=78;break c}h=41;j=j+3|0;continue c}case 6:{if((h|0)<3){h=-2;break a}if(!(lb[c[l>>2]&127](b,i)|0)){k=82;break c}h=41;j=j+4|0;continue c}case 7:{if((h|0)<4){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){k=86;break c}h=41;j=j+5|0;continue c}default:{h=19;j=i;continue c}}}default:{k=98;break c}}}switch(k|0){case 56:{c[g>>2]=j;h=0;break a}case 60:{c[g>>2]=j;h=0;break a}case 64:{c[g>>2]=j;h=0;break a}case 68:{c[g>>2]=j;h=0;break a}case 70:{c[g>>2]=j;break a}case 74:{c[g>>2]=i;h=0;break a}case 78:{c[g>>2]=i;h=0;break a}case 82:{c[g>>2]=i;h=0;break a}case 86:{c[g>>2]=i;h=0;break a}case 89:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=32;break a}case 92:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=31;break a}case 95:if((h|0)==19){c[g>>2]=j;h=0;break a}else {c[g>>2]=j+1;h=30;break a}case 98:{c[g>>2]=j;h=0;break a}case 99:{h=0-h|0;break a}}}else h=-4;while(0);return h|0}function H_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){m=b+72|0;b:do switch(a[m+(d[e>>0]|0)>>0]|0){case 2:{h=__(b,e+1|0,f,g)|0;break a}case 3:{h=W_(b,e+1|0,f,g)|0;break a}case 9:{h=e+1|0;if((f-h|0)<=0){h=-3;break a}c[g>>2]=(a[m+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break a}case 10:{c[g>>2]=e+1;h=7;break a}case 4:{i=e+1|0;if((f-i|0)<=0){h=-5;break a}if((a[i>>0]|0)==93){h=e+2|0;if((f-h|0)<=0){h=-5;break a}if((a[h>>0]|0)==62){c[g>>2]=h;h=0;break a}else h=f;}else h=f;break}case 5:{h=f;if((h-e|0)<2){h=-2;break a}if(!(lb[c[b+352>>2]&127](b,e)|0)){i=e+2|0;break b}else {c[g>>2]=e;h=0;break a}}case 6:{h=f;if((h-e|0)<3){h=-2;break a}if(!(lb[c[b+356>>2]&127](b,e)|0)){i=e+3|0;break b}else {c[g>>2]=e;h=0;break a}}case 7:{h=f;if((h-e|0)<4){h=-2;break a}if(!(lb[c[b+360>>2]&127](b,e)|0)){i=e+4|0;break b}else {c[g>>2]=e;h=0;break a}}case 8:case 1:case 0:{c[g>>2]=e;h=0;break a}default:{i=e+1|0;h=f;}}while(0);j=b+352|0;k=b+356|0;l=b+360|0;c:while(1){f=h-i|0;if((f|0)<=0){f=49;break}switch(a[m+(d[i>>0]|0)>>0]|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{f=47;break c}case 5:{if((f|0)<2){f=32;break c}if(lb[c[j>>2]&127](b,i)|0){f=32;break c}i=i+2|0;continue c}case 6:{if((f|0)<3){f=36;break c}if(lb[c[k>>2]&127](b,i)|0){f=36;break c}i=i+3|0;continue c}case 7:{if((f|0)<4){f=40;break c}if(lb[c[l>>2]&127](b,i)|0){f=40;break c}i=i+4|0;continue c}case 4:{if((f|0)<=1){f=47;break c}e=i+1|0;if((a[e>>0]|0)!=93){i=e;continue c}if((f|0)<=2){f=47;break c}i=i+2|0;if((a[i>>0]|0)==62){f=46;break c}else {i=e;continue c}}default:{i=i+1|0;continue c}}}if((f|0)==32){c[g>>2]=i;h=6;break}else if((f|0)==36){c[g>>2]=i;h=6;break}else if((f|0)==40){c[g>>2]=i;h=6;break}else if((f|0)==46){c[g>>2]=i;h=0;break}else if((f|0)==47){c[g>>2]=i;h=6;break}else if((f|0)==49){c[g>>2]=i;h=6;break}}else h=-4;while(0);return h|0}function I_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;a:do if(e>>>0>>0){l=b+72|0;b:do switch(a[l+(d[e>>0]|0)>>0]|0){case 4:{i=e+1|0;h=f;if((h-i|0)<=0){h=-1;break a}if((a[i>>0]|0)==93){f=e+2|0;if((h-f|0)<=0){h=-1;break a}if((a[f>>0]|0)==62){c[g>>2]=e+3;h=40;break a}}break}case 9:{h=e+1|0;if((f-h|0)<=0){h=-1;break a}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break a}case 10:{c[g>>2]=e+1;h=7;break a}case 5:{h=f;if((h-e|0)<2){h=-2;break a}if(!(lb[c[b+352>>2]&127](b,e)|0)){i=e+2|0;break b}else {c[g>>2]=e;h=0;break a}}case 6:{h=f;if((h-e|0)<3){h=-2;break a}if(!(lb[c[b+356>>2]&127](b,e)|0)){i=e+3|0;break b}else {c[g>>2]=e;h=0;break a}}case 7:{h=f;if((h-e|0)<4){h=-2;break a}if(!(lb[c[b+360>>2]&127](b,e)|0)){i=e+4|0;break b}else {c[g>>2]=e;h=0;break a}}case 8:case 1:case 0:{c[g>>2]=e;h=0;break a}default:{i=e+1|0;h=f;}}while(0);e=b+352|0;j=b+356|0;k=b+360|0;c:while(1){f=h-i|0;if((f|0)<=0){f=39;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 4:case 10:case 9:case 8:case 1:case 0:{f=37;break c}case 5:{if((f|0)<2){f=30;break c}if(!(lb[c[e>>2]&127](b,i)|0))f=2;else {f=30;break c}break}case 6:{if((f|0)<3){f=33;break c}if(!(lb[c[j>>2]&127](b,i)|0))f=3;else {f=33;break c}break}case 7:{if((f|0)<4){f=36;break c}if(!(lb[c[k>>2]&127](b,i)|0))f=4;else {f=36;break c}break}default:f=1;}i=i+f|0;}if((f|0)==30){c[g>>2]=i;h=6;break}else if((f|0)==33){c[g>>2]=i;h=6;break}else if((f|0)==36){c[g>>2]=i;h=6;break}else if((f|0)==37){c[g>>2]=i;h=6;break}else if((f|0)==39){c[g>>2]=i;h=6;break}}else h=-4;while(0);return h|0} -function Ew(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;if(!((a|0)>-1&((b|0)>0&(d|0)>0)))qa(95162,94943,843,95188);j=zw(b,d,a,i,j,1)|0;if(!j)qa(95233,94943,847,95188);u=c[j+20>>2]|0;t=c[j+24>>2]|0;m=b+1|0;l=0;while(1){if((l|0)==(m|0))break;c[u+(l<<2)>>2]=0;l=l+1|0;}a:do switch(i|0){case 1:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){q=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=13;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=13;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==13)qa(138394,94943,862,95188);while(1){if((q|0)==(b|0)){l=0;break}s=q+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(q<<2)>>2]|0);q=s;}while(1){if((l|0)==(a|0))break;r=u+(c[e+(l<<2)>>2]<<2)|0;s=c[r>>2]|0;h[i+(s<<3)>>3]=+h[g+(l<<3)>>3];d=c[f+(l<<2)>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 2:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){r=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=25;break}q=c[f+(l<<2)>>2]|0;if(!((q|0)>-1&(q|0)<(d|0))){s=25;break}q=u+(m+1<<2)|0;c[q>>2]=(c[q>>2]|0)+1;l=l+1|0;}if((s|0)==25)qa(138394,94943,880,95188);while(1){if((r|0)==(b|0)){l=0;break}s=r+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(r<<2)>>2]|0);r=s;}while(1){if((l|0)==(a|0))break;r=u+(c[e+(l<<2)>>2]<<2)|0;s=c[r>>2]|0;d=s<<1;h[i+(d<<3)>>3]=+h[g>>3];h[i+((d|1)<<3)>>3]=+h[g+8>>3];d=c[f+(l<<2)>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+16|0;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 4:{i=c[j+28>>2]|0;l=0;while(1){if((l|0)>=(a|0)){p=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=37;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=37;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==37)qa(138394,94943,899,95188);while(1){if((p|0)==(b|0)){l=0;break}s=p+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(p<<2)>>2]|0);p=s;}while(1){if((l|0)==(a|0))break;r=e+(l<<2)|0;c[i+(c[u+(c[r>>2]<<2)>>2]<<2)>>2]=c[g+(l<<2)>>2];d=c[f+(l<<2)>>2]|0;r=u+(c[r>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;l=l+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 8:{g=0;while(1){if((g|0)>=(a|0)){n=0;break}l=c[e+(g<<2)>>2]|0;if(!((l|0)>-1&(l|0)<(b|0))){s=48;break}r=c[f+(g<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=48;break}r=u+(l+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;g=g+1|0;}if((s|0)==48)qa(138394,94943,915,95188);while(1){if((n|0)==(b|0)){g=0;break}s=n+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(n<<2)>>2]|0);n=s;}while(1){if((g|0)==(a|0))break;d=c[f+(g<<2)>>2]|0;r=u+(c[e+(g<<2)>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}case 16:{l=0;while(1){if((l|0)>=(a|0)){o=0;break}m=c[e+(l<<2)>>2]|0;if(!((m|0)>-1&(m|0)<(b|0))){s=59;break}r=c[f+(l<<2)>>2]|0;if(!((r|0)>-1&(r|0)<(d|0))){s=59;break}r=u+(m+1<<2)|0;c[r>>2]=(c[r>>2]|0)+1;l=l+1|0;}if((s|0)==59)qa(138394,94943,930,95188);while(1){if((o|0)==(b|0))break;s=o+1|0;d=u+(s<<2)|0;c[d>>2]=(c[d>>2]|0)+(c[u+(o<<2)>>2]|0);o=s;}W6(c[j+28>>2]|0,g|0,O(c[j+40>>2]|0,a)|0)|0;g=0;while(1){if((g|0)==(a|0))break;d=c[f+(g<<2)>>2]|0;r=u+(c[e+(g<<2)>>2]<<2)|0;s=c[r>>2]|0;c[r>>2]=s+1;c[t+(s<<2)>>2]=d;g=g+1|0;}while(1){if((b|0)<=0)break a;f=b+-1|0;c[u+(b<<2)>>2]=c[u+(f<<2)>>2];b=f;}}default:qa(138394,94943,944,95188);}while(0);c[u>>2]=0;c[j+8>>2]=a;if(k)j=Fw(j,k)|0;return j|0}function Fw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;t=c[a+20>>2]|0;u=c[a+24>>2]|0;e=c[a+16>>2]|0;r=c[a+4>>2]|0;a:do if(b){m=r<<2;n=KK(m)|0;d=0;while(1){if((d|0)>=(r|0))break;c[n+(d<<2)>>2]=-1;d=d+1|0;}b:do switch(e|0){case 1:{k=c[a+28>>2]|0;f=0;e=c[t>>2]|0;d=0;c:while(1){if((d|0)>=(c[a>>2]|0)){v=f;w=n;break b}l=d+1|0;m=t+(l<<2)|0;i=t+(d<<2)|0;d=f;while(1){b=c[m>>2]|0;if((e|0)>=(b|0))break;b=u+(e<<2)|0;f=c[b>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;h[k+(d<<3)>>3]=+h[k+(e<<3)>>3];c[n+(c[b>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break c;s=k+(g<<3)|0;h[s>>3]=+h[s>>3]+ +h[k+(e<<3)>>3];}e=e+1|0;}c[m>>2]=d;f=d;e=b;d=l;}qa(95235,94943,1792,95260);break}case 2:{s=c[a+28>>2]|0;switch(b|0){case 1:{b=c[t>>2]|0;e=0;d=0;d:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}k=e+1|0;l=t+(k<<2)|0;i=t+(e<<2)|0;while(1){e=c[l>>2]|0;if((b|0)>=(e|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;q=b<<1;r=d<<1;h[s+(r<<3)>>3]=+h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break d;q=b<<1;r=g<<1;p=s+(r<<3)|0;h[p>>3]=+h[p>>3]+ +h[s+(q<<3)>>3];r=s+((r|1)<<3)|0;h[r>>3]=+h[r>>3]+ +h[s+((q|1)<<3)>>3];}b=b+1|0;}c[l>>2]=d;b=e;e=k;}qa(95235,94943,1815,95260);break}case 4:{b=c[t>>2]|0;e=0;d=0;e:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}l=e+1|0;k=t+(l<<2)|0;i=t+(e<<2)|0;while(1){e=c[k>>2]|0;if((b|0)>=(e|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;q=b<<1;r=d<<1;h[s+(r<<3)>>3]=+h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break e;q=b<<1;r=g<<1;p=s+(r<<3)|0;h[p>>3]=+h[p>>3]+ +h[s+(q<<3)>>3];h[s+((r|1)<<3)>>3]=+h[s+((q|1)<<3)>>3];}b=b+1|0;}c[k>>2]=d;b=e;e=l;}qa(95235,94943,1835,95260);break}case 2:{q=~~+h[s+8>>3];i=c[a>>2]|0;e=q;g=0;d=0;f:while(1){if((g|0)>=(i|0))break;k=g+1|0;l=c[t+(k<<2)>>2]|0;f=d;b=q;d=c[t+(g<<2)>>2]|0;while(1){if((d|0)>=(l|0)){q=b;g=k;d=f;continue f}q=~~+h[s+((f<<1|1)<<3)>>3];f=f+1|0;e=(e|0)>(q|0)?e:q;b=(b|0)<(q|0)?b:q;d=d+1|0;}}U1(n);p=e-q+1|0;o=KK(O(p,m)|0)|0;p=O(p,r)|0;d=0;while(1){if((d|0)>=(p|0))break;c[o+(d<<2)>>2]=-1;d=d+1|0;}d=0;b=c[t>>2]|0;e=0;g:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=o;break b}m=e+1|0;n=t+(m<<2)|0;l=t+(e<<2)|0;while(1){e=c[n>>2]|0;if((b|0)>=(e|0))break;e=c[u+(b<<2)>>2]|0;f=b<<1;j=+h[s+((f|1)<<3)>>3];g=(O(~~j-q|0,r)|0)+e|0;i=o+(g<<2)|0;k=c[i>>2]|0;if((k|0)<(c[l>>2]|0)){c[u+(d<<2)>>2]=e;k=d<<1;h[s+(k<<3)>>3]=+h[s+(f<<3)>>3];h[s+((k|1)<<3)>>3]=j;c[i>>2]=d;d=d+1|0;}else {if((g|0)>=(p|0)){d=55;break g}if((c[u+(k<<2)>>2]|0)!=(e|0)){d=57;break g}k=k<<1;i=s+(k<<3)|0;h[i>>3]=+h[i>>3]+ +h[s+(f<<3)>>3];h[s+((k|1)<<3)>>3]=j;}b=b+1|0;}c[n>>2]=d;b=e;e=m;}if((d|0)==55)qa(95292,94943,1869,95260);else if((d|0)==57)qa(95313,94943,1870,95260);break}case 3:{f=~~+h[s+8>>3];i=c[a>>2]|0;d=f;e=0;g=0;h:while(1){if((g|0)>=(i|0))break;k=g+1|0;l=c[t+(k<<2)>>2]|0;b=d;d=c[t+(g<<2)>>2]|0;while(1){if((d|0)>=(l|0)){d=b;g=k;continue h}q=~~+h[s+(e<<1<<3)>>3];b=(b|0)>(q|0)?b:q;f=(f|0)>(q|0)?f:q;e=e+1|0;d=d+1|0;}}U1(n);e=d-f+1|0;o=KK(O(e,m)|0)|0;e=O(e,r)|0;d=0;while(1){if((d|0)>=(e|0))break;c[o+(d<<2)>>2]=-1;d=d+1|0;}d=0;b=c[t>>2]|0;e=0;i:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=o;break b}m=e+1|0;n=t+(m<<2)|0;l=t+(e<<2)|0;while(1){e=c[n>>2]|0;if((b|0)>=(e|0))break;e=c[u+(b<<2)>>2]|0;g=b<<1;j=+h[s+(g<<3)>>3];i=o+((O(~~j-f|0,r)|0)+e<<2)|0;k=c[i>>2]|0;if((k|0)<(c[l>>2]|0)){c[u+(d<<2)>>2]=e;q=d<<1;h[s+(q<<3)>>3]=j;h[s+((q|1)<<3)>>3]=+h[s+((g|1)<<3)>>3];c[i>>2]=d;d=d+1|0;}else {if((c[u+(k<<2)>>2]|0)!=(e|0))break i;q=k<<1;h[s+(q<<3)>>3]=j;q=s+((q|1)<<3)|0;h[q>>3]=+h[q>>3]+ +h[s+((g|1)<<3)>>3];}b=b+1|0;}c[n>>2]=d;b=e;e=m;}qa(95313,94943,1905,95260);break}default:{v=0;w=n;break b}}break}case 4:{k=c[a+28>>2]|0;e=0;d=0;b=c[t>>2]|0;j:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}l=e+1|0;m=t+(l<<2)|0;i=t+(e<<2)|0;while(1){f=c[m>>2]|0;if((b|0)>=(f|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)<(c[i>>2]|0)){c[u+(d<<2)>>2]=f;c[k+(d<<2)>>2]=c[k+(b<<2)>>2];c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}else {if((c[u+(g<<2)>>2]|0)!=(f|0))break j;s=k+(g<<2)|0;c[s>>2]=(c[s>>2]|0)+(c[k+(b<<2)>>2]|0);}b=b+1|0;}c[m>>2]=d;e=l;b=f;}qa(95235,94943,1929,95260);break}case 8:{e=0;d=0;b=c[t>>2]|0;k:while(1){if((e|0)>=(c[a>>2]|0)){v=d;w=n;break b}k=e+1|0;l=t+(k<<2)|0;i=t+(e<<2)|0;while(1){f=c[l>>2]|0;if((b|0)>=(f|0))break;e=u+(b<<2)|0;f=c[e>>2]|0;g=c[n+(f<<2)>>2]|0;if((g|0)>=(c[i>>2]|0)){if((c[u+(g<<2)>>2]|0)!=(f|0))break k}else {c[u+(d<<2)>>2]=f;c[n+(c[e>>2]<<2)>>2]=d;d=d+1|0;}b=b+1|0;}c[l>>2]=d;e=k;b=f;}qa(95235,94943,1948,95260);break}default:{a=0;break a}}while(0);c[a+8>>2]=v;U1(w);}while(0);return a|0}function Gw(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;if(!d)Hw(a,c,e,g,b,f);else Iw(a,c,e,g,b,f);return}function Hw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0;if((c[a+32>>2]|0)!=1)qa(94919,94943,1121,95483);if((c[a+16>>2]|0)!=1)qa(95364,94943,1122,95483);p=c[a+28>>2]|0;q=c[a+20>>2]|0;r=c[a+24>>2]|0;s=c[a>>2]|0;o=c[a+4>>2]|0;a=c[d>>2]|0;i=(a|0)!=0;if(!f){if(!i)a=KK(O(e<<3,s)|0)|0;f=0;a:while(1){if((f|0)>=(s|0))break;n=O(f,e)|0;i=0;while(1){if((i|0)>=(e|0))break;h[a+(i+n<<3)>>3]=0.0;i=i+1|0;}l=f+1|0;m=c[q+(l<<2)>>2]|0;i=c[q+(f<<2)>>2]|0;while(1){if((i|0)>=(m|0)){f=l;continue a}j=p+(i<<3)|0;k=r+(i<<2)|0;f=0;while(1){if((f|0)>=(e|0))break;t=+h[b+((O(c[k>>2]|0,e)|0)+f<<3)>>3]*+h[j>>3];o=a+(f+n<<3)|0;h[o>>3]=+h[o>>3]+t;f=f+1|0;}i=i+1|0;}}if(g)Kw(a,s,e);}else {if(!i)a=KK(O(e<<3,o)|0)|0;f=O(o,e)|0;i=0;while(1){if((i|0)>=(f|0)){i=0;break}h[a+(i<<3)>>3]=0.0;i=i+1|0;}b:while(1){if((i|0)>=(s|0))break;l=i+1|0;m=c[q+(l<<2)>>2]|0;n=O(i,e)|0;i=c[q+(i<<2)>>2]|0;while(1){if((i|0)>=(m|0)){i=l;continue b}j=p+(i<<3)|0;k=r+(i<<2)|0;f=0;while(1){if((f|0)>=(e|0))break;u=a+((O(c[k>>2]|0,e)|0)+f<<3)|0;h[u>>3]=+h[u>>3]+ +h[b+(f+n<<3)>>3]*+h[j>>3];f=f+1|0;}i=i+1|0;}}if(g)Kw(a,o,e);}c[d>>2]=a;return}function Iw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;if((c[a+32>>2]|0)!=1)qa(94919,94943,1163,95335);if((c[a+16>>2]|0)!=1)qa(95364,94943,1164,95335);h=c[d>>2]|0;j=c[a>>2]|0;k=c[a+4>>2]|0;i=(h|0)!=0;if(!f){if(!i)h=KK(O(e<<3,j)|0)|0;i=0;while(1){if((i|0)>=(e|0))break;c[m>>2]=h+((O(i,j)|0)<<3);Jw(a,b+((O(i,k)|0)<<3)|0,m,0);i=i+1|0;}if(!g)Kw(h,e,j);}else {if(!i)h=KK(O(e<<3,k)|0)|0;i=0;while(1){if((i|0)>=(e|0))break;c[m>>2]=h+((O(i,k)|0)<<3);Jw(a,b+((O(i,j)|0)<<3)|0,m,f);i=i+1|0;}if(!g)Kw(h,e,k);}c[d>>2]=h;l=n;return}function Jw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0;if((c[a+32>>2]|0)!=1)qa(94919,94943,1222,95392);i=c[a+16>>2]|0;switch(i|0){case 4:case 1:break;default:qa(95421,94943,1223,95392);}n=c[a+20>>2]|0;m=c[a+24>>2]|0;o=c[a>>2]|0;k=c[a+4>>2]|0;j=c[d>>2]|0;a:do switch(i|0){case 1:{l=c[a+28>>2]|0;a=(e|0)!=0;f=(j|0)!=0;if(!b){if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;b:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue b}p=g+ +h[l+(a<<3)>>3];h[i>>3]=p;a=a+1|0;g=p;}}}if(!f)j=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[j+(a<<3)>>3]=0.0;a=a+1|0;}c:while(1){if((a|0)>=(o|0)){f=j;break a}f=a+1|0;i=c[n+(f<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(i|0)){a=f;continue c}b=j+(c[m+(a<<2)>>2]<<3)|0;h[b>>3]=+h[b>>3]+ +h[l+(a<<3)>>3];a=a+1|0;}}}else {if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;d:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue d}p=g+ +h[b+(c[m+(a<<2)>>2]<<3)>>3]*+h[l+(a<<3)>>3];h[i>>3]=p;a=a+1|0;g=p;}}}if(f)f=j;else f=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[f+(a<<3)>>3]=0.0;a=a+1|0;}e:while(1){if((a|0)>=(o|0))break a;i=a+1|0;j=c[n+(i<<2)>>2]|0;e=b+(a<<3)|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(j|0)){a=i;continue e}k=f+(c[m+(a<<2)>>2]<<3)|0;h[k>>3]=+h[k>>3]+ +h[e>>3]*+h[l+(a<<3)>>3];a=a+1|0;}}}}case 4:{l=c[a+28>>2]|0;a=(e|0)!=0;f=(j|0)!=0;if(!b){if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;f:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue f}p=g+ +(c[l+(a<<2)>>2]|0);h[i>>3]=p;a=a+1|0;g=p;}}}if(!f)j=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[j+(a<<3)>>3]=0.0;a=a+1|0;}g:while(1){if((a|0)>=(o|0)){f=j;break a}f=a+1|0;i=c[n+(f<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(i|0)){a=f;continue g}b=j+(c[m+(a<<2)>>2]<<3)|0;h[b>>3]=+h[b>>3]+ +(c[l+(a<<2)>>2]|0);a=a+1|0;}}}else {if(!a){if(f)f=j;else f=KK(o<<3)|0;a=0;h:while(1){if((a|0)>=(o|0))break a;i=f+(a<<3)|0;h[i>>3]=0.0;j=a+1|0;e=c[n+(j<<2)>>2]|0;a=c[n+(a<<2)>>2]|0;g=0.0;while(1){if((a|0)>=(e|0)){a=j;continue h}p=g+ +h[b+(c[m+(a<<2)>>2]<<3)>>3]*+(c[l+(a<<2)>>2]|0);h[i>>3]=p;a=a+1|0;g=p;}}}if(f)f=j;else f=KK(k<<3)|0;a=0;while(1){if((a|0)>=(k|0)){a=0;break}h[f+(a<<3)>>3]=0.0;a=a+1|0;}i:while(1){if((a|0)>=(o|0))break a;i=a+1|0;j=c[n+(i<<2)>>2]|0;e=b+(a<<3)|0;a=c[n+(a<<2)>>2]|0;while(1){if((a|0)>=(j|0)){a=i;continue i}k=f+(c[m+(a<<2)>>2]<<3)|0;h[k>>3]=+h[k>>3]+ +h[e>>3]*+(c[l+(a<<2)>>2]|0);a=a+1|0;}}}}default:qa(138394,94943,1315,95392);}while(0);c[d>>2]=f;return}function Kw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=O(b<<3,c)|0;f=KK(d)|0;W6(f|0,a|0,d|0)|0;d=0;while(1){if((d|0)>=(b|0))break;g=O(d,c)|0;e=0;while(1){if((e|0)>=(c|0))break;h[a+((O(e,b)|0)+d<<3)>>3]=+h[f+(e+g<<3)>>3];e=e+1|0;}d=d+1|0;}U1(f);return}function Lw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;x=c[a+20>>2]|0;y=c[a+24>>2]|0;z=c[b+20>>2]|0;A=c[b+24>>2]|0;w=c[a+32>>2]|0;if(!((w|0)==1?(w|0)==(c[b+32>>2]|0):0))qa(95005,94943,1408,95512);w=c[a>>2]|0;if(((c[a+4>>2]|0)==(c[b>>2]|0)?(n=c[a+16>>2]|0,(n|0)==(c[b+16>>2]|0)):0)?(m=b+4|0,B=KK(c[m>>2]<<2)|0,(B|0)!=0):0){d=0;while(1){if((d|0)>=(c[m>>2]|0)){e=0;d=0;break}c[B+(d<<2)>>2]=-1;d=d+1|0;}a:while(1){if((d|0)>=(w|0))break;j=d+1|0;k=x+(j<<2)|0;l=-2-d|0;i=c[x+(d<<2)>>2]|0;while(1){if((i|0)>=(c[k>>2]|0)){d=j;continue a}f=c[y+(i<<2)>>2]|0;g=z+(f+1<<2)|0;f=c[z+(f<<2)>>2]|0;while(1){if((f|0)>=(c[g>>2]|0))break;d=B+(c[A+(f<<2)>>2]<<2)|0;if((c[d>>2]|0)!=(l|0)){c[d>>2]=l;e=e+1|0;}f=f+1|0;}i=i+1|0;}}d=rw(w,c[m>>2]|0,e,n,1)|0;b:do if(!d)d=0;else {t=c[d+20>>2]|0;u=c[d+24>>2]|0;c:do switch(n|0){case 1:{r=c[a+28>>2]|0;n=c[b+28>>2]|0;b=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;d:while(1){if((e|0)>=(w|0)){v=f;break c}o=e+1|0;p=x+(o<<2)|0;q=t+(e<<2)|0;a=c[x+(e<<2)>>2]|0;while(1){if((a|0)>=(c[p>>2]|0))break;k=c[y+(a<<2)>>2]|0;l=z+(k+1<<2)|0;m=r+(a<<3)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[l>>2]|0))break;e=A+(k<<2)|0;g=c[e>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[q>>2]|0)){c[i>>2]=f;c[u+(f<<2)>>2]=c[e>>2];h[b+(f<<3)>>3]=+h[n+(k<<3)>>3]*+h[m>>3];f=f+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break d;s=b+(j<<3)|0;h[s>>3]=+h[s>>3]+ +h[n+(k<<3)>>3]*+h[m>>3];}k=k+1|0;}a=a+1|0;}c[t+(o<<2)>>2]=f;e=o;}qa(95534,94943,1468,95512);break}case 2:{s=c[a+28>>2]|0;b=c[b+28>>2]|0;o=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;e:while(1){if((e|0)>=(w|0)){v=f;break c}p=e+1|0;q=x+(p<<2)|0;r=t+(e<<2)|0;n=c[x+(e<<2)>>2]|0;while(1){if((n|0)>=(c[q>>2]|0))break;k=c[y+(n<<2)>>2]|0;l=z+(k+1<<2)|0;a=n<<1;m=s+(a<<3)|0;a=s+((a|1)<<3)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[l>>2]|0))break;e=A+(k<<2)|0;g=c[e>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[r>>2]|0)){c[i>>2]=f;c[u+(f<<2)>>2]=c[e>>2];i=k<<1;g=b+(i<<3)|0;i=b+((i|1)<<3)|0;j=f<<1;h[o+(j<<3)>>3]=+h[g>>3]*+h[m>>3]-+h[i>>3]*+h[a>>3];h[o+((j|1)<<3)>>3]=+h[g>>3]*+h[a>>3]+ +h[i>>3]*+h[m>>3];f=f+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break e;i=k<<1;g=b+(i<<3)|0;i=b+((i|1)<<3)|0;j=j<<1;e=o+(j<<3)|0;h[e>>3]=+h[e>>3]+ +h[g>>3]*+h[m>>3]-+h[i>>3]*+h[a>>3];j=o+((j|1)<<3)|0;h[j>>3]=+h[g>>3]*+h[a>>3]+ +h[i>>3]*+h[m>>3]+ +h[j>>3];}k=k+1|0;}n=n+1|0;}c[t+(p<<2)>>2]=f;e=p;}qa(95534,94943,1497,95512);break}case 4:{r=c[a+28>>2]|0;n=c[b+28>>2]|0;b=c[d+28>>2]|0;c[t>>2]=0;e=0;f=0;f:while(1){if((f|0)>=(w|0)){v=e;break c}o=f+1|0;p=x+(o<<2)|0;q=t+(f<<2)|0;l=c[x+(f<<2)>>2]|0;while(1){if((l|0)>=(c[p>>2]|0))break;k=c[y+(l<<2)>>2]|0;m=z+(k+1<<2)|0;a=r+(l<<2)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;f=A+(k<<2)|0;g=c[f>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)<(c[q>>2]|0)){c[i>>2]=e;c[u+(e<<2)>>2]=c[f>>2];c[b+(e<<2)>>2]=O(c[n+(k<<2)>>2]|0,c[a>>2]|0)|0;e=e+1|0;}else {if((c[u+(j<<2)>>2]|0)!=(g|0))break f;i=O(c[n+(k<<2)>>2]|0,c[a>>2]|0)|0;s=b+(j<<2)|0;c[s>>2]=(c[s>>2]|0)+i;}k=k+1|0;}l=l+1|0;}c[t+(o<<2)>>2]=e;f=o;}qa(95534,94943,1523,95512);break}case 8:{c[t>>2]=0;e=0;f=0;g:while(1){if((f|0)>=(w|0)){v=e;break c}a=f+1|0;n=x+(a<<2)|0;b=t+(f<<2)|0;l=c[x+(f<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;k=c[y+(l<<2)>>2]|0;m=z+(k+1<<2)|0;k=c[z+(k<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;f=A+(k<<2)|0;g=c[f>>2]|0;i=B+(g<<2)|0;j=c[i>>2]|0;if((j|0)>=(c[b>>2]|0)){if((c[u+(j<<2)>>2]|0)!=(g|0))break g}else {c[i>>2]=e;c[u+(e<<2)>>2]=c[f>>2];e=e+1|0;}k=k+1|0;}l=l+1|0;}c[t+(a<<2)>>2]=e;f=a;}qa(95534,94943,1543,95512);break}default:{qw(d);d=0;break b}}while(0);c[d+8>>2]=v;}while(0);U1(B);}else d=0;return d|0}function Mw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0.0,K=0.0,L=0.0,M=0.0;F=c[a+20>>2]|0;G=c[a+24>>2]|0;H=c[b+20>>2]|0;B=c[b+24>>2]|0;C=c[d+20>>2]|0;D=c[d+24>>2]|0;E=c[a+32>>2]|0;if(!((E|0)==1?(E|0)==(c[b+32>>2]|0):0))qa(95005,94943,1574,95559);E=c[a>>2]|0;if(((((c[a+4>>2]|0)==(c[b>>2]|0)?(c[b+4>>2]|0)==(c[d>>2]|0):0)?(q=c[a+16>>2]|0,(q|0)==(c[b+16>>2]|0)):0)?(q|0)==(c[d+16>>2]|0):0)?(p=d+4|0,I=KK(c[p>>2]<<2)|0,(I|0)!=0):0){e=0;while(1){if((e|0)>=(c[p>>2]|0)){f=0;e=0;break}c[I+(e<<2)>>2]=-1;e=e+1|0;}a:while(1){if((e|0)>=(E|0))break;m=e+1|0;n=F+(m<<2)|0;o=-2-e|0;l=c[F+(e<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0)){e=m;continue a}j=c[G+(l<<2)>>2]|0;k=H+(j+1<<2)|0;j=c[H+(j<<2)>>2]|0;while(1){if((j|0)>=(c[k>>2]|0))break;g=c[B+(j<<2)>>2]|0;i=C+(g+1<<2)|0;g=c[C+(g<<2)>>2]|0;while(1){if((g|0)>=(c[i>>2]|0))break;e=I+(c[D+(g<<2)>>2]<<2)|0;if((c[e>>2]|0)!=(o|0)){c[e>>2]=o;f=f+1|0;}g=g+1|0;}j=j+1|0;}l=l+1|0;}}e=rw(E,c[p>>2]|0,f,q,1)|0;b:do if(!e)e=0;else {y=c[e+20>>2]|0;z=c[e+24>>2]|0;c:do switch(q|0){case 1:{v=c[a+28>>2]|0;u=c[b+28>>2]|0;d=c[d+28>>2]|0;r=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;d:while(1){if((f|0)>=(E|0)){A=g;break c}s=f+1|0;t=F+(s<<2)|0;b=y+(f<<2)|0;q=c[F+(f<<2)>>2]|0;while(1){if((q|0)>=(c[t>>2]|0))break;o=c[G+(q<<2)>>2]|0;p=H+(o+1<<2)|0;a=v+(q<<3)|0;o=c[H+(o<<2)>>2]|0;while(1){if((o|0)>=(c[p>>2]|0))break;l=c[B+(o<<2)>>2]|0;m=C+(l+1<<2)|0;n=u+(o<<3)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[m>>2]|0))break;f=D+(l<<2)|0;i=c[f>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[b>>2]|0)){c[j>>2]=g;c[z+(g<<2)>>2]=c[f>>2];h[r+(g<<3)>>3]=+h[n>>3]*+h[a>>3]*+h[d+(l<<3)>>3];g=g+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break d;x=r+(k<<3)|0;h[x>>3]=+h[x>>3]+ +h[n>>3]*+h[a>>3]*+h[d+(l<<3)>>3];}l=l+1|0;}o=o+1|0;}q=q+1|0;}c[y+(s<<2)>>2]=g;f=s;}qa(95582,94943,1642,95559);break}case 2:{x=c[a+28>>2]|0;w=c[b+28>>2]|0;r=c[d+28>>2]|0;s=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;e:while(1){if((g|0)>=(E|0)){A=f;break c}t=g+1|0;u=F+(t<<2)|0;v=y+(g<<2)|0;a=c[F+(g<<2)>>2]|0;while(1){if((a|0)>=(c[u>>2]|0))break;m=c[G+(a<<2)>>2]|0;q=H+(m+1<<2)|0;d=a<<1;b=x+(d<<3)|0;d=x+((d|1)<<3)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[q>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;p=m<<1;o=w+(p<<3)|0;p=w+((p|1)<<3)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[v>>2]|0)){c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];K=+h[b>>3];L=+h[o>>3];J=+h[d>>3];M=+h[p>>3];j=l<<1;i=r+(j<<3)|0;j=r+((j|1)<<3)|0;k=f<<1;h[s+(k<<3)>>3]=(L*K-M*J)*+h[i>>3]-(M*K+J*L)*+h[j>>3];L=+h[b>>3];J=+h[p>>3];K=+h[d>>3];M=+h[o>>3];h[s+((k|1)<<3)>>3]=(M*K+J*L)*+h[i>>3]+(M*L-K*J)*+h[j>>3];f=f+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break e;L=+h[b>>3];K=+h[o>>3];M=+h[d>>3];J=+h[p>>3];j=l<<1;i=r+(j<<3)|0;j=r+((j|1)<<3)|0;k=k<<1;g=s+(k<<3)|0;h[g>>3]=+h[g>>3]+(K*L-J*M)*+h[i>>3]-(J*L+M*K)*+h[j>>3];K=+h[b>>3];M=+h[p>>3];L=+h[d>>3];J=+h[o>>3];k=s+((k|1)<<3)|0;h[k>>3]=(J*L+M*K)*+h[i>>3]+(J*K-L*M)*+h[j>>3]+ +h[k>>3];}l=l+1|0;}m=m+1|0;}a=a+1|0;}c[y+(t<<2)>>2]=f;g=t;}qa(95582,94943,1674,95559);break}case 4:{v=c[a+28>>2]|0;u=c[b+28>>2]|0;b=c[d+28>>2]|0;d=c[e+28>>2]|0;c[y>>2]=0;f=0;g=0;f:while(1){if((g|0)>=(E|0)){A=f;break c}r=g+1|0;s=F+(r<<2)|0;t=y+(g<<2)|0;p=c[F+(g<<2)>>2]|0;while(1){if((p|0)>=(c[s>>2]|0))break;m=c[G+(p<<2)>>2]|0;a=H+(m+1<<2)|0;q=v+(p<<2)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[a>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;o=u+(m<<2)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)<(c[t>>2]|0)){c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];w=O(c[o>>2]|0,c[q>>2]|0)|0;w=O(w,c[b+(l<<2)>>2]|0)|0;x=d+(f<<2)|0;c[x>>2]=(c[x>>2]|0)+w;f=f+1|0;}else {if((c[z+(k<<2)>>2]|0)!=(i|0))break f;w=O(c[o>>2]|0,c[q>>2]|0)|0;w=O(w,c[b+(l<<2)>>2]|0)|0;x=d+(k<<2)|0;c[x>>2]=(c[x>>2]|0)+w;}l=l+1|0;}m=m+1|0;}p=p+1|0;}c[y+(r<<2)>>2]=f;g=r;}qa(95582,94943,1706,95559);break}case 8:{c[y>>2]=0;f=0;g=0;g:while(1){if((g|0)>=(E|0)){A=f;break c}a=g+1|0;q=F+(a<<2)|0;b=y+(g<<2)|0;o=c[F+(g<<2)>>2]|0;while(1){if((o|0)>=(c[q>>2]|0))break;m=c[G+(o<<2)>>2]|0;p=H+(m+1<<2)|0;m=c[H+(m<<2)>>2]|0;while(1){if((m|0)>=(c[p>>2]|0))break;l=c[B+(m<<2)>>2]|0;n=C+(l+1<<2)|0;l=c[C+(l<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;g=D+(l<<2)|0;i=c[g>>2]|0;j=I+(i<<2)|0;k=c[j>>2]|0;if((k|0)>=(c[b>>2]|0)){if((c[z+(k<<2)>>2]|0)!=(i|0))break g}else {c[j>>2]=f;c[z+(f<<2)>>2]=c[g>>2];f=f+1|0;}l=l+1|0;}m=m+1|0;}o=o+1|0;}c[y+(a<<2)>>2]=f;g=a;}qa(95582,94943,1729,95559);break}default:{qw(e);e=0;break b}}while(0);c[e+8>>2]=A;}while(0);U1(I);}else e=0;return e|0}function Nw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;if((c[a+32>>2]|0)!=2)qa(95100,94943,1971,95607);if((b|0)>=1){h=c[a+8>>2]|0;g=h+b|0;if((g|0)>=(c[a+12>>2]|0))Ow(a,g+10|0)|0;i=h<<2;g=b<<2;W6((c[a+20>>2]|0)+i|0,d|0,g|0)|0;W6((c[a+24>>2]|0)+i|0,e|0,g|0)|0;g=c[a+40>>2]|0;if(g|0){i=O(g,b)|0;h=O(g,h)|0;W6((c[a+28>>2]|0)+h|0,f|0,i|0)|0;}f=a+4|0;h=0;while(1){if((h|0)>=(b|0))break;g=c[d+(h<<2)>>2]|0;if((g|0)>=(c[a>>2]|0))c[a>>2]=g+1;g=c[e+(h<<2)>>2]|0;if((g|0)>=(c[f>>2]|0))c[f>>2]=g+1;h=h+1|0;}i=a+8|0;c[i>>2]=(c[i>>2]|0)+b;}return a|0}function Ow(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if((c[a+32>>2]|0)==2){d=a+20|0;f=b<<2;c[d>>2]=MK(c[d>>2]|0,f)|0;d=a+24|0;c[d>>2]=MK(c[d>>2]|0,f)|0;d=c[a+40>>2]|0;if((d|0)>0){f=a+28|0;e=c[f>>2]|0;d=O(d,b)|0;if(!e)d=KK(d)|0;else d=MK(e,d)|0;c[f>>2]=d;}}else {d=a+24|0;c[d>>2]=MK(c[d>>2]|0,b<<2)|0;d=c[a+40>>2]|0;if((d|0)>0){f=a+28|0;e=c[f>>2]|0;d=O(d,b)|0;if(!e)d=KK(d)|0;else d=MK(e,d)|0;c[f>>2]=d;}}c[a+12>>2]=b;return a|0}function Pw(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;a:do if(!a)a=0;else {l=c[a+20>>2]|0;k=c[a+24>>2]|0;b:do switch(c[a+16>>2]|0){case 1:{i=c[a+28>>2]|0;e=c[a>>2]|0;b=0;c:while(1){if((b|0)>=(e|0))break b;f=b+1|0;g=c[l+(f<<2)>>2]|0;b=c[l+(b<<2)>>2]|0;d=1.0/+(g-b|0);while(1){if((b|0)>=(g|0)){b=f;continue c}k=i+(b<<3)|0;h[k>>3]=+h[k>>3]*d;b=b+1|0;}}}case 2:{f=c[a+28>>2]|0;g=c[a>>2]|0;b=0;d:while(1){if((b|0)>=(g|0))break b;i=b+1|0;j=c[l+(i<<2)>>2]|0;e=c[l+(b<<2)>>2]|0;d=1.0/+(j-e|0);while(1){if((e|0)>=(j|0)){b=i;continue d}if((c[k+(e<<2)>>2]|0)!=(b|0)){m=e<<1;n=f+(m<<3)|0;h[n>>3]=+h[n>>3]*d;m=f+((m|1)<<3)|0;h[m>>3]=+h[m>>3]*d;}e=e+1|0;}}}case 4:{qa(138394,94943,2192,95648);break}case 8:break;default:{a=0;break a}}while(0)}while(0);return a|0}function Qw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((a|0)!=0?(b=a+8|0,d=c[b>>2]|0,e=c[a+4>>2]|0,(e|0)==(c[a>>2]|0)):0){g=c[a+24>>2]|0;a=c[a+20>>2]|0;f=rw(e,e,d,8,1)|0;W6(c[f+20>>2]|0,a|0,(e<<2)+4|0)|0;W6(c[f+24>>2]|0,g|0,d<<2|0)|0;c[f+8>>2]=c[b>>2];a=vw(f,1)|0;qw(f);a=Bw(a)|0;e=a+8|0;d=KK(c[e>>2]<<3)|0;c[a+28>>2]=d;e=c[e>>2]|0;b=0;while(1){if((b|0)>=(e|0))break;h[d+(b<<3)>>3]=1.0;b=b+1|0;}c[a+16>>2]=1;c[a+40>>2]=8;}else a=0;return a|0}function Rw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;v=c[a+4>>2]|0;n=c[a>>2]|0;r=v<<2;s=KK(r)|0;t=KK(r+4|0)|0;u=KK(r)|0;r=KK(r)|0;o=t+4|0;a=0;while(1){if((a|0)>=(v|0))break;c[s+(a<<2)>>2]=0;a=a+1|0;}c[o>>2]=v;a=0;while(1){if((a|0)>=(v|0)){h=1;k=0;break}c[u+(a<<2)>>2]=-1;a=a+1|0;}a:while(1){if((k|0)>=(n|0))break;g=p+(k<<2)|0;l=k+1|0;m=p+(l<<2)|0;a=c[g>>2]|0;while(1){f=c[m>>2]|0;if((a|0)>=(f|0))break;j=o+(c[s+(c[q+(a<<2)>>2]<<2)>>2]<<2)|0;c[j>>2]=(c[j>>2]|0)+-1;a=a+1|0;}a=h;j=c[g>>2]|0;while(1){if((j|0)>=(f|0)){h=a;k=l;continue a}h=q+(j<<2)|0;f=s+(c[h>>2]<<2)|0;i=c[f>>2]|0;g=u+(i<<2)|0;if((c[g>>2]|0)<(k|0)){c[g>>2]=k;f=o+(i<<2)|0;if(!(c[f>>2]|0)){c[f>>2]=1;g=a;a=i;f=r+(i<<2)|0;}else {c[r+(i<<2)>>2]=a;c[o+(a<<2)>>2]=1;g=a+1|0;f=s+(c[h>>2]<<2)|0;}c[f>>2]=a;a=g;}else {i=r+(i<<2)|0;c[f>>2]=c[i>>2];i=o+(c[i>>2]<<2)|0;c[i>>2]=(c[i>>2]|0)+1;}j=j+1|0;f=c[m>>2]|0;}}c[t>>2]=0;a=0;f=0;while(1){if((a|0)>=(h|0))break;p=a+1|0;o=t+(p<<2)|0;q=(c[o>>2]|0)+f|0;c[o>>2]=q;a=p;f=q;}c[d>>2]=r;a=0;while(1){if((a|0)>=(v|0)){a=h;break}q=t+(c[s+(a<<2)>>2]<<2)|0;d=c[q>>2]|0;c[q>>2]=d+1;c[r+(d<<2)>>2]=a;a=a+1|0;}while(1){if((a|0)<=0)break;v=a+-1|0;c[t+(a<<2)>>2]=c[t+(v<<2)>>2];a=v;}c[t>>2]=0;c[e>>2]=t;c[b>>2]=h;U1(u);U1(s);return}function Sw(){return +(+(x5()|0)*4.656612875245797e-10)}function Tw(a){a=a|0;if((a|0)>1)return (x5()|0)%(a|0)|0|0;else qa(95682,95688,58,95698);return 0}function Uw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;a:do if((a|0)<1)b=0;else {b=KK(a<<2)|0;d=0;while(1){if((d|0)==(a|0))break;c[b+(d<<2)>>2]=d;d=d+1|0;}while(1){if((a|0)<=1)break a;e=Tw(a)|0;d=a+-1|0;g=b+(d<<2)|0;f=c[g>>2]|0;e=b+(e<<2)|0;c[g>>2]=c[e>>2];c[e>>2]=f;a=d;}}while(0);return b|0}function Vw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=0;while(1){if((d|0)>=(a|0))break;e=c+(d<<3)|0;h[e>>3]=+h[b+(d<<3)>>3]-+h[e>>3];d=d+1|0;}return c|0}function Ww(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0,f=0.0;d=0;e=0.0;while(1){if((d|0)>=(a|0))break;f=+h[c+(d<<3)>>3]*+h[b+(d<<3)>>3]+e;d=d+1|0;e=f;}return +e}function Xw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=c+(e<<3)|0;h[f>>3]=+h[f>>3]*d+ +h[b+(e<<3)>>3];e=e+1|0;}return c|0}function Yw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=b+(e<<3)|0;h[f>>3]=+h[c+(e<<3)>>3]*d+ +h[f>>3];e=e+1|0;}return b|0}function Zw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,g=0.0;f=O(c,b)|0;d=O(d,b)|0;e=0.0;c=0;while(1){if((c|0)>=(b|0))break;g=+h[a+(c+f<<3)>>3]-+h[a+(c+d<<3)>>3];e=g*g+e;c=c+1|0;}g=+C(+e);return +(g>1.0e-15?g:1.0e-15)}function _w(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0,g=0.0;f=O(c,b)|0;d=O(d,b)|0;e=0.0;c=0;while(1){if((c|0)>=(b|0))break;g=+h[a+(c+f<<3)>>3]-+h[a+(c+d<<3)>>3];e=g*g+e;c=c+1|0;}return +(+C(+e))}function $w(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0.0;d=0.0;e=0;while(1){if((e|0)>=(c|0))break;f=+h[a+(e<<3)>>3]-+h[b+(e<<3)>>3];d=f*f+d;e=e+1|0;}return +(+C(+d))}function ax(a,b,c,d,e,f,g){a=+a;b=+b;c=+c;d=+d;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0.0;p=l;l=l+80|0;n=p+48|0;m=p+24|0;o=p;i=0;while(1){if((i|0)>=(f|0)){j=0;break}q=+h[g+(i<<3)>>3];h[n+(i<<3)>>3]=q;h[m+(i<<3)>>3]=q;i=i+1|0;}while(1){if((j|0)>=(e|0))break;k=O(j,f)|0;i=0;while(1){if((i|0)>=(f|0))break;s=+h[g+(i+k<<3)>>3];r=n+(i<<3)|0;q=+h[r>>3];h[r>>3]=s>3];h[r>>3]=s>q?s:q;i=i+1|0;}j=j+1|0;}q=+h[m>>3]-+h[n>>3];c=q!=0.0?(c-a)/q:1.0;q=+h[m+8>>3]-+h[n+8>>3];s=(d-b)/q;c=q!=0.0?(c>3]=a;h[o+8>>3]=b;h[o+16>>3]=0.0;j=0;while(1){if((j|0)>=(e|0))break;k=O(j,f)|0;i=0;while(1){if((i|0)>=(f|0))break;r=g+(i+k<<3)|0;h[r>>3]=(+h[r>>3]-+h[n+(i<<3)>>3])*c+ +h[o+(i<<3)>>3];i=i+1|0;}j=j+1|0;}l=p;return}function bx(a,b){a=a|0;b=b|0;if((tB(a)|0)==1){a=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}else {cx(a);if(!((dP(QA(b,95704)|0)|0)<<24>>24))b=My(a,186208)|0;else b=dx(a)|0;Vy(a,b,186208);ex(b);}return}function cx(a){a=a|0;var b=0;b=xC(c[c[(c[(jC(a)|0)+16>>2]|0)+112>>2]>>2]|0)|0;a=c[46925]|0;if((b|0)!=(a|0)){c[46555]=0;c[46925]=b;c[46926]=GA(b,0,95713,0)|0;c[46927]=GA(c[46925]|0,1,95721,0)|0;c[46928]=GA(c[46925]|0,1,95738,0)|0;a=c[46925]|0;}c[46929]=QA(a,95738)|0;Gy(186208);c[46554]=1;h[23280]=+_O(c[46925]|0,c[46926]|0,1.0,0.0);c[46556]=c[46927];c[46557]=c[46928];c[46558]=c[46929];return}function dx(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+144|0;e=f;d=f+8|0;b=c[46555]|0;c[46555]=b+1;c[e>>2]=b;m4(d,96234,e)|0;d=Hy(ND(a,d,1)|0)|0;e=d+8|0;b=jC(a)|0;while(1){if(!b)break;oC(c[e>>2]|0,b,1)|0;c[(c[(c[b+16>>2]|0)+112>>2]|0)+12>>2]=d;b=kC(a,b)|0;}l=f;return d|0}function ex(a){a=a|0;Uy(a);return}function fx(a,b){a=a|0;b=b|0;var d=0;d=KK(32)|0;c[d>>2]=4;h[d+8>>3]=.75;c[d+16>>2]=1073741824;c[d+20>>2]=1;c[d+24>>2]=a;c[d+28>>2]=b;return d|0}function gx(a){a=a|0;U1(a);return}function hx(a){a=a|0;var b=0,d=0;if(!a)return;d=c[a+8>>2]|0;do if(d|0){if(c[a>>2]|0){qw(d);b=c[a+12>>2]|0;if(!b)break;qw(b);break}if(c[a+36>>2]|0?(qw(d),b=c[a+12>>2]|0,b|0):0)qw(b);}while(0);qw(c[a+16>>2]|0);qw(c[a+20>>2]|0);b=c[a+24>>2]|0;if(b|0?(c[a>>2]|0)>0:0)U1(b);hx(c[a+28>>2]|0);U1(a);return}function ix(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0;v=l;l=l+32|0;n=v+16|0;o=v+12|0;p=v+8|0;q=v+4|0;r=v;c[n>>2]=a;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[i>>2]=0;c[j>>2]=0;c[b>>2]=0;c[g>>2]=0;c[e>>2]=0;s=k+28|0;t=k+8|0;u=+(c[a+4>>2]|0);f=d;do{jx(a,n,f,o,0,r,p,q,k,m);f=c[n>>2]|0;if(!f)break;d=c[f+4>>2]|0;f=c[i>>2]|0;if(!f){c[i>>2]=c[p>>2];c[j>>2]=c[q>>2];}else {a=Lw(f,c[p>>2]|0)|0;qw(c[i>>2]|0);qw(c[p>>2]|0);c[i>>2]=a;a=Lw(c[q>>2]|0,c[j>>2]|0)|0;qw(c[j>>2]|0);qw(c[q>>2]|0);c[j>>2]=a;}f=c[b>>2]|0;if(f|0)qw(f);c[b>>2]=c[n>>2];f=c[e>>2]|0;if(f|0)qw(f);f=c[o>>2]|0;c[e>>2]=f;a=c[g>>2]|0;if(a){U1(a);f=c[o>>2]|0;}c[g>>2]=c[r>>2];a=c[n>>2]|0;c[r>>2]=0;if(!(+h[t>>3]*u<+(d|0)))break}while((c[s>>2]|0)==1);l=v;return}function jx(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+32|0;D=H+28|0;q=H+24|0;B=H+20|0;E=H+16|0;o=H+12|0;F=H+8|0;G=H+4|0;v=H;c[D>>2]=0;c[q>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[b>>2]=0;c[e>>2]=0;c[i>>2]=0;c[j>>2]=0;C=c[a>>2]|0;p=k+24|0;c[m>>2]=c[p>>2];n=c[p>>2]|0;a:do switch(n|0){case 12:{c[p>>2]=3;c[m>>2]=3;jx(a,b,d,e,f,g,i,j,k,m);if((((c[b>>2]|0)==0?(c[p>>2]=4,c[m>>2]=4,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0)?(c[p>>2]=6,c[m>>2]=6,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0)?(c[p>>2]=9,c[m>>2]=9,jx(a,b,d,e,f,g,i,j,k,m),(c[b>>2]|0)==0):0){c[p>>2]=2;c[m>>2]=2;jx(a,b,d,e,f,g,i,j,k,m);}c[p>>2]=12;p=0;q=0;k=0;o=0;n=0;m=0;break}case 9:case 10:{d=c[k+20>>2]|0;if((n|0)==9)qx(a,d,E,o,B);else rx(a,d,E,o,B);u=c[a+20>>2]|0;v=c[a+24>>2]|0;t=c[o>>2]|0;if(!(c[k+28>>2]|0)){if((t|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(t|0)){p=0;q=0;k=0;o=0;n=0;m=0;break a}}else if((t|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break a}if((t|0)>=(c[k>>2]|0)){z=c[B>>2]|0;y=z<<2;x=KK(y)|0;y=KK(y)|0;z=KK(z<<3)|0;c[B>>2]=0;s=c[E>>2]|0;r=0;o=0;b:while(1){if((r|0)>=(C|0))break;d=s+(r<<2)|0;if((c[d>>2]|0)!=-1){c[x+(o<<2)>>2]=r;c[y+(c[B>>2]<<2)>>2]=c[d>>2];q=c[B>>2]|0;k=q+1|0;c[B>>2]=k;h[z+(q<<3)>>3]=1.0;r=r+1|0;o=k;continue}n=c[u+(r<<2)>>2]|0;q=r+1|0;k=u+(q<<2)|0;p=c[k>>2]|0;d=0;m=n;while(1){if((m|0)>=(p|0))break;d=((c[s+(c[v+(m<<2)>>2]<<2)>>2]|0)>>>31^1)+d|0;m=m+1|0;}w=1.0/+(d|0);d=p;while(1){if((n|0)>=(d|0)){r=q;continue b}m=v+(n<<2)|0;if((c[s+(c[m>>2]<<2)>>2]|0)>-1){c[x+(o<<2)>>2]=r;c[y+(c[B>>2]<<2)>>2]=c[s+(c[m>>2]<<2)>>2];d=c[B>>2]|0;m=d+1|0;c[B>>2]=m;h[z+(d<<3)>>3]=w;d=c[k>>2]|0;}else m=o;n=n+1|0;o=m;}}C=Dw(o,C,t,x,y,z,1,8)|0;c[i>>2]=C;C=pw(C)|0;c[j>>2]=C;i=Mw(C,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=z;q=y;k=x;o=x;n=y;m=z;}else {Jw(c[j>>2]|0,f,g,0);p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;c[e>>2]=0;p=z;q=y;k=x;o=x;n=y;m=z;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}break}case 5:{A=26;break}case 1:{m=k+20|0;nx(a,c[m>>2]|0,D,q);d=c[p>>2]|0;if((d|0)==2){d=m;A=24;}else A=25;break}case 2:{d=k+20|0;A=24;break}case 3:{kx(a,c[k+20>>2]|0,F,G,v);A=12;break}case 4:{lx(a,c[k+20>>2]|0,F,G,v);A=12;break}case 6:{mx(a,F,G,v);A=12;break}default:{p=0;q=0;k=0;o=0;n=0;m=0;}}while(0);do if((A|0)==12){r=c[v>>2]|0;if(!(c[k+28>>2]|0)){if((r|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(r|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}}else if((r|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}if((r|0)>=(c[k>>2]|0)){t=C<<2;s=KK(t)|0;t=KK(t)|0;u=KK(C<<3)|0;c[B>>2]=0;o=c[G>>2]|0;p=c[F>>2]|0;n=0;d=0;c:while(1){if((n|0)>=(c[v>>2]|0))break;q=n+1|0;k=o+(q<<2)|0;m=c[o+(n<<2)>>2]|0;while(1){if((m|0)>=(c[k>>2]|0)){n=q;continue c}c[s+(d<<2)>>2]=c[p+(m<<2)>>2];c[t+(c[B>>2]<<2)>>2]=n;y=c[B>>2]|0;z=y+1|0;c[B>>2]=z;h[u+(y<<3)>>3]=1.0;m=m+1|0;d=z;}}C=Dw(d,C,r,s,t,u,1,8)|0;c[i>>2]=C;c[j>>2]=pw(C)|0;c[e>>2]=0;i=Mw(c[j>>2]|0,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=u;q=t;k=s;o=s;n=t;m=u;}else {Jw(c[j>>2]|0,f,g,0);c[j>>2]=Pw(c[j>>2]|0)|0;p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;p=u;q=t;k=s;o=s;n=t;m=u;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}}else if((A|0)==24){ox(a,c[d>>2]|0,D,q);d=c[p>>2]|0;A=25;}while(0);if((A|0)==25)if((d|0)==5)A=26;else A=27;if((A|0)==26){px(a,c[k+20>>2]|0,D,q);A=27;}do if((A|0)==27){d=c[q>>2]|0;if(!(c[k+28>>2]|0)){if((d|0)==(C|0)?1:+h[k+8>>3]*+(C|0)<+(d|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}}else if((d|0)==(C|0)){p=0;q=0;k=0;o=0;n=0;m=0;break}if((d|0)>=(c[k>>2]|0)){s=C<<2;r=KK(s)|0;s=KK(s)|0;t=KK(C<<3)|0;c[B>>2]=0;q=c[D>>2]|0;d=0;p=0;while(1){if((p|0)>=(C|0))break;m=q+(p<<2)|0;n=c[m>>2]|0;if((n|0)>-1){c[r+(c[B>>2]<<2)>>2]=p;c[s+(c[B>>2]<<2)>>2]=d;A=c[B>>2]|0;o=A+1|0;c[B>>2]=o;h[t+(A<<3)>>3]=1.0;if((n|0)!=(p|0)){c[r+(o<<2)>>2]=c[m>>2];c[s+(c[B>>2]<<2)>>2]=d;A=c[B>>2]|0;c[B>>2]=A+1;h[t+(A<<3)>>3]=1.0;c[q+(c[m>>2]<<2)>>2]=-1;}c[m>>2]=-1;d=d+1|0;}p=p+1|0;}C=Dw(c[B>>2]|0,C,d,r,s,t,1,8)|0;c[i>>2]=C;C=pw(C)|0;c[j>>2]=C;i=Mw(C,a,c[i>>2]|0)|0;c[b>>2]=i;if(!i){p=t;q=s;k=r;o=r;n=s;m=t;}else {Jw(c[j>>2]|0,f,g,0);c[j>>2]=Pw(c[j>>2]|0)|0;p=c[b>>2]|0;q=p+36|0;c[q>>2]=c[q>>2]|3;c[b>>2]=Bw(p)|0;c[e>>2]=0;p=t;q=s;k=r;o=r;n=s;m=t;}}else {p=0;q=0;k=0;o=0;n=0;m=0;}}while(0);d=c[D>>2]|0;if(d|0)U1(d);d=c[E>>2]|0;if(d|0)U1(d);if(k|0)U1(o);if(q|0)U1(n);if(p|0)U1(m);d=c[F>>2]|0;if(d|0)U1(d);d=c[G>>2]|0;if(d|0)U1(d);l=H;return}function kx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;t=c[a+20>>2]|0;u=c[a+24>>2]|0;w=c[a>>2]|0;v=w<<2;c[d>>2]=KK(v)|0;c[e>>2]=KK(v+4|0)|0;v=KK(v)|0;g=0;while(1){if((g|0)>=(w|0))break;c[v+(g<<2)>>2]=g;g=g+1|0;}c[f>>2]=0;r=c[e>>2]|0;c[r>>2]=0;s=c[a+28>>2]|0;a:do if(!b){g=0;a=0;b:while(1){while(1){if((a|0)>=(w|0)){a=0;j=0.0;b=0;break b}b=a;a=a+1|0;if((c[v+(b<<2)>>2]|0)==-1)continue;b=c[t+(b<<2)>>2]|0;if(((c[t+(a<<2)>>2]|0)-b|0)==1)break}l=c[u+(b<<2)>>2]|0;c[v+(l<<2)>>2]=-1;m=c[d>>2]|0;c[m+(g<<2)>>2]=l;n=t+(l+1<<2)|0;k=c[t+(l<<2)>>2]|0;g=g+1|0;while(1){if((k|0)>=(c[n>>2]|0))break;b=u+(k<<2)|0;i=c[b>>2]|0;if((l|0)!=(i|0)?((c[t+(i+1<<2)>>2]|0)-(c[t+(i<<2)>>2]|0)|0)==1:0){c[v+(i<<2)>>2]=-1;c[m+(g<<2)>>2]=c[b>>2];g=g+1|0;}k=k+1|0;}b=c[f>>2]|0;i=c[r+(b<<2)>>2]|0;if((g-i|0)<5){e=b+1|0;c[f>>2]=e;c[r+(e<<2)>>2]=g;continue}i=i+1|0;b=b+1|0;c[f>>2]=b;c[r+(b<<2)>>2]=i;b=i;while(1){if(!((i|0)<(g|0)&(b|0)<(g|0)))continue b;e=i+3|0;e=(g|0)<(e|0)?g:e;q=(c[f>>2]|0)+1|0;c[f>>2]=q;c[r+(q<<2)>>2]=e;b=b+1|0;i=e;}}c:while(1){do{n=b;while(1){if((n|0)>=(w|0)){a=0;break c}p=v+(n<<2)|0;i=c[p>>2]|0;if((i|0)!=-1)break;n=n+1|0;}b=n+1|0;q=c[t+(b<<2)>>2]|0;l=1;m=c[t+(n<<2)>>2]|0;while(1){if((m|0)>=(q|0))break;k=c[u+(m<<2)>>2]|0;if((n|0)!=(k|0)?(c[v+(k<<2)>>2]|0)!=-1:0)if((i|0)!=-1){o=+h[s+(m<<3)>>3];if((l|0)==0?!(o>j):0)l=0;else {l=0;a=k;j=o;}}else i=-1;m=m+1|0;}}while((l|0)!=0);c[v+(a<<2)>>2]=-1;c[p>>2]=-1;q=c[d>>2]|0;c[q+(g<<2)>>2]=n;e=g+2|0;c[q+(g+1<<2)>>2]=a;q=(c[f>>2]|0)+1|0;c[f>>2]=q;c[r+(q<<2)>>2]=e;g=e;}while(1){if((a|0)>=(w|0))break a;if((c[v+(a<<2)>>2]|0)==(a|0)){u=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[r+(g<<2)>>2]=u;g=u;}a=a+1|0;}}else {r=Uw(w)|0;n=0;g=0;while(1){if((n|0)>=(w|0)){q=0;a=0;j=0.0;break}a=c[r+(n<<2)>>2]|0;d:do if((c[v+(a<<2)>>2]|0)!=-1?(p=c[t+(a<<2)>>2]|0,((c[t+(a+1<<2)>>2]|0)-p|0)==1):0){k=c[u+(p<<2)>>2]|0;c[v+(k<<2)>>2]=-1;l=c[d>>2]|0;c[l+(g<<2)>>2]=k;m=t+(k+1<<2)|0;i=c[t+(k<<2)>>2]|0;g=g+1|0;while(1){if((i|0)>=(c[m>>2]|0))break;a=u+(i<<2)|0;b=c[a>>2]|0;if((k|0)!=(b|0)?((c[t+(b+1<<2)>>2]|0)-(c[t+(b<<2)>>2]|0)|0)==1:0){c[v+(b<<2)>>2]=-1;c[l+(g<<2)>>2]=c[a>>2];g=g+1|0;}i=i+1|0;}i=c[e>>2]|0;a=c[f>>2]|0;b=c[i+(a<<2)>>2]|0;if((g-b|0)<5){q=a+1|0;c[f>>2]=q;c[i+(q<<2)>>2]=g;break}b=b+1|0;a=a+1|0;c[f>>2]=a;c[i+(a<<2)>>2]=b;a=b;while(1){if(!((b|0)<(g|0)&(a|0)<(g|0)))break d;q=b+3|0;q=(g|0)<(q|0)?g:q;m=(c[f>>2]|0)+1|0;c[f>>2]=m;c[i+(m<<2)>>2]=q;a=a+1|0;b=q;}}while(0);n=n+1|0;}while(1){if((q|0)>=(w|0)){a=0;break}m=c[r+(q<<2)>>2]|0;n=v+(m<<2)|0;b=c[n>>2]|0;if((b|0)!=-1){p=c[t+(m+1<<2)>>2]|0;k=1;l=c[t+(m<<2)>>2]|0;while(1){if((l|0)>=(p|0))break;i=c[u+(l<<2)>>2]|0;if((m|0)!=(i|0)?(c[v+(i<<2)>>2]|0)!=-1:0)if((b|0)!=-1){o=+h[s+(l<<3)>>3];if((k|0)==0?!(o>j):0)k=0;else {k=0;a=i;j=o;}}else b=-1;l=l+1|0;}if(!k){c[v+(a<<2)>>2]=-1;c[n>>2]=-1;n=c[d>>2]|0;c[n+(g<<2)>>2]=m;p=g+2|0;c[n+(g+1<<2)>>2]=a;n=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[n+(g<<2)>>2]=p;g=p;}}q=q+1|0;}while(1){if((a|0)>=(w|0))break;if((c[v+(a<<2)>>2]|0)==(a|0)){u=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;t=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[t+(g<<2)>>2]=u;g=u;}a=a+1|0;}U1(r);}while(0);U1(v);return}function lx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+16|0;q=A+8|0;y=A+4|0;z=A;c[y>>2]=0;c[z>>2]=0;v=c[a+20>>2]|0;u=c[a+24>>2]|0;w=c[a>>2]|0;x=w<<2;c[d>>2]=KK(x)|0;c[e>>2]=KK(x+4|0)|0;x=KK(x)|0;g=0;while(1){if((g|0)>=(w|0))break;c[x+(g<<2)>>2]=g;g=g+1|0;}Rw(a,q,y,z);c[f>>2]=0;s=c[e>>2]|0;c[s>>2]=0;t=c[a+28>>2]|0;g=0;a=0;a:while(1){k=c[q>>2]|0;m=c[z>>2]|0;do{if((a|0)>=(k|0))break a;n=a;a=a+1|0;p=m+(a<<2)|0;j=c[p>>2]|0;n=c[m+(n<<2)>>2]|0;}while((j-n|0)<2);m=c[y>>2]|0;k=c[s+(c[f>>2]<<2)>>2]|0;while(1){if((n|0)>=(j|0))break;r=m+(n<<2)|0;c[x+(c[r>>2]<<2)>>2]=-1;j=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=c[r>>2];if((j-k|0)>3){g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[s+(g<<2)>>2]=j;g=j;}else g=k;k=g;n=n+1|0;g=j;j=c[p>>2]|0;}if((g|0)<=(k|0))continue;r=(c[f>>2]|0)+1|0;c[f>>2]=r;c[s+(r<<2)>>2]=g;}b:do if(!b){a=0;i=0.0;j=0;c:while(1){do{b=j;while(1){if((b|0)>=(w|0)){a=0;break c}q=x+(b<<2)|0;k=c[q>>2]|0;if((k|0)!=-1)break;b=b+1|0;}j=b+1|0;r=c[v+(j<<2)>>2]|0;n=1;p=c[v+(b<<2)>>2]|0;while(1){if((p|0)>=(r|0))break;m=c[u+(p<<2)>>2]|0;if((b|0)!=(m|0)?(c[x+(m<<2)>>2]|0)!=-1:0)if((k|0)!=-1){o=+h[t+(p<<3)>>3];if((n|0)==0?!(o>i):0)n=0;else {n=0;a=m;i=o;}}else k=-1;p=p+1|0;}}while((n|0)!=0);c[x+(a<<2)>>2]=-1;c[q>>2]=-1;r=c[d>>2]|0;c[r+(g<<2)>>2]=b;e=g+2|0;c[r+(g+1<<2)>>2]=a;r=(c[f>>2]|0)+1|0;c[f>>2]=r;c[s+(r<<2)>>2]=e;g=e;}while(1){if((a|0)>=(w|0))break b;if((c[x+(a<<2)>>2]|0)==(a|0)){v=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[s+(g<<2)>>2]=v;g=v;}a=a+1|0;}}else {s=Uw(w)|0;r=0;a=0;i=0.0;while(1){if((r|0)>=(w|0)){a=0;break}p=c[s+(r<<2)>>2]|0;b=x+(p<<2)|0;j=c[b>>2]|0;if((j|0)!=-1){q=c[v+(p+1<<2)>>2]|0;m=1;n=c[v+(p<<2)>>2]|0;while(1){if((n|0)>=(q|0))break;k=c[u+(n<<2)>>2]|0;if((p|0)!=(k|0)?(c[x+(k<<2)>>2]|0)!=-1:0)if((j|0)!=-1){o=+h[t+(n<<3)>>3];if((m|0)==0?!(o>i):0)m=0;else {m=0;a=k;i=o;}}else j=-1;n=n+1|0;}if(!m){c[x+(a<<2)>>2]=-1;c[b>>2]=-1;b=c[d>>2]|0;c[b+(g<<2)>>2]=p;q=g+2|0;c[b+(g+1<<2)>>2]=a;b=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[b+(g<<2)>>2]=q;g=q;}}r=r+1|0;}while(1){if((a|0)>=(w|0))break;if((c[x+(a<<2)>>2]|0)==(a|0)){v=g+1|0;c[(c[d>>2]|0)+(g<<2)>>2]=a;u=c[e>>2]|0;g=(c[f>>2]|0)+1|0;c[f>>2]=g;c[u+(g<<2)>>2]=v;g=v;}a=a+1|0;}U1(s);}while(0);U1(c[y>>2]|0);U1(c[z>>2]|0);U1(x);l=A;return}function mx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;r=c[a+20>>2]|0;s=c[a+24>>2]|0;v=c[a>>2]|0;u=v<<2;c[b>>2]=KK(u)|0;c[d>>2]=KK(u+4|0)|0;u=KK(u)|0;q=KK(v<<4)|0;f=0;while(1){if((f|0)>=(v|0))break;c[u+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=0;c[c[d>>2]>>2]=0;p=c[a+28>>2]|0;t=Uw(v)|0;f=0;m=0;while(1){if((m|0)>=(v|0)){o=0;break}a=c[t+(m<<2)>>2]|0;a:do if((c[u+(a<<2)>>2]|0)!=-1?(n=c[r+(a<<2)>>2]|0,((c[r+(a+1<<2)>>2]|0)-n|0)==1):0){j=c[s+(n<<2)>>2]|0;c[u+(j<<2)>>2]=-1;k=c[b>>2]|0;c[k+(f<<2)>>2]=j;l=r+(j+1<<2)|0;i=c[r+(j<<2)>>2]|0;f=f+1|0;while(1){if((i|0)>=(c[l>>2]|0))break;a=s+(i<<2)|0;g=c[a>>2]|0;if((j|0)!=(g|0)?((c[r+(g+1<<2)>>2]|0)-(c[r+(g<<2)>>2]|0)|0)==1:0){c[u+(g<<2)>>2]=-1;c[k+(f<<2)>>2]=c[a>>2];f=f+1|0;}i=i+1|0;}i=c[d>>2]|0;a=c[e>>2]|0;g=c[i+(a<<2)>>2]|0;if((f-g|0)<5){o=a+1|0;c[e>>2]=o;c[i+(o<<2)>>2]=f;break}g=g+1|0;a=a+1|0;c[e>>2]=a;c[i+(a<<2)>>2]=g;a=g;while(1){if(!((g|0)<(f|0)&(a|0)<(f|0)))break a;o=g+3|0;o=(f|0)<(o|0)?f:o;l=(c[e>>2]|0)+1|0;c[e>>2]=l;c[i+(l<<2)>>2]=o;a=a+1|0;g=o;}}while(0);m=m+1|0;}while(1){if((o|0)>=(v|0)){a=0;break}m=c[t+(o<<2)>>2]|0;n=u+(m<<2)|0;a=c[n>>2]|0;if((a|0)!=-1){l=c[r+(m+1<<2)>>2]|0;g=0;k=c[r+(m<<2)>>2]|0;while(1){if((k|0)>=(l|0))break;j=c[s+(k<<2)>>2]|0;if((m|0)!=(j|0)?(c[u+(j<<2)>>2]|0)!=-1:0){i=g<<1;if((a|0)==-1)a=-1;else {h[q+(i<<3)>>3]=+(j|0);h[q+((i|1)<<3)>>3]=+h[p+(k<<3)>>3];g=g+1|0;}}k=k+1|0;}if((g|0)>0){o4(q,g,16,81);g=(g|0)<3?g:3;a=0;while(1){if((a|0)>=(g|0))break;l=~~+h[q+(a<<1<<3)>>3];c[u+(l<<2)>>2]=-1;c[(c[b>>2]|0)+(f<<2)>>2]=l;a=a+1|0;f=f+1|0;}c[n>>2]=-1;n=f+1|0;c[(c[b>>2]|0)+(f<<2)>>2]=m;m=c[d>>2]|0;f=(c[e>>2]|0)+1|0;c[e>>2]=f;c[m+(f<<2)>>2]=n;f=n;}}o=o+1|0;}while(1){if((a|0)>=(v|0))break;if((c[u+(a<<2)>>2]|0)==(a|0)){s=f+1|0;c[(c[b>>2]|0)+(f<<2)>>2]=a;r=c[d>>2]|0;f=(c[e>>2]|0)+1|0;c[e>>2]=f;c[r+(f<<2)>>2]=s;f=s;}a=a+1|0;}U1(t);U1(u);return}function nx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;r=c[a>>2]|0;f=c[a+4>>2]|0;k=KK(r<<2)|0;c[d>>2]=k;a=0;while(1){if((a|0)>=(r|0))break;c[k+(a<<2)>>2]=a;a=a+1|0;}c[e>>2]=f;a:do if(!b){f=0;b:while(1){if((f|0)>=(r|0))break a;b=f+1|0;g=p+(b<<2)|0;h=k+(f<<2)|0;i=k+(f<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[g>>2]|0)){f=b;continue b}j=q+(a<<2)|0;d=c[j>>2]|0;if(((f|0)!=(d|0)?(o=k+(d<<2)|0,(c[o>>2]|0)==(d|0)):0)?(c[h>>2]|0)==(f|0):0){c[o>>2]=f;c[i>>2]=c[j>>2];c[e>>2]=(c[e>>2]|0)+-1;}a=a+1|0;}}}else {b=Uw(r)|0;a=0;while(1){if((a|0)>=(r|0))break;g=c[b+(a<<2)>>2]|0;h=p+(g+1<<2)|0;f=c[p+(g<<2)>>2]|0;while(1){if((f|0)>=(c[h>>2]|0))break;i=q+(f<<2)|0;j=c[i>>2]|0;if(((g|0)!=(j|0)?(l=c[d>>2]|0,m=l+(j<<2)|0,(c[m>>2]|0)==(j|0)):0)?(n=l+(g<<2)|0,(c[n>>2]|0)==(g|0)):0){c[m>>2]=g;c[n>>2]=c[i>>2];c[e>>2]=(c[e>>2]|0)+-1;}f=f+1|0;}a=a+1|0;}U1(b);}while(0);return}function ox(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;r=c[a+20>>2]|0;s=c[a+24>>2]|0;t=c[a>>2]|0;g=c[a+4>>2]|0;o=KK(t<<2)|0;c[d>>2]=o;f=0;while(1){if((f|0)>=(t|0))break;c[o+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=g;q=c[a+28>>2]|0;a:do if(!b){f=0;i=0.0;k=0;while(1){if((k|0)>=(t|0))break a;l=k+1|0;m=c[r+(l<<2)>>2]|0;n=o+(k<<2)|0;g=1;b=c[r+(k<<2)>>2]|0;while(1){if((b|0)>=(m|0))break;a=c[s+(b<<2)>>2]|0;if(((k|0)!=(a|0)?(c[o+(a<<2)>>2]|0)==(a|0):0)?(c[n>>2]|0)==(k|0):0){j=+h[q+(b<<3)>>3];if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(g|0){k=l;continue}c[o+(f<<2)>>2]=k;c[o+(k<<2)>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;k=l;}}else {p=Uw(t)|0;o=0;f=0;i=0.0;while(1){if((o|0)>=(t|0))break;k=c[p+(o<<2)>>2]|0;l=c[d>>2]|0;m=l+(k<<2)|0;if((c[m>>2]|0)==(k|0)){n=c[r+(k+1<<2)>>2]|0;b=c[r+(k<<2)>>2]|0;g=1;while(1){if((b|0)>=(n|0))break;a=c[s+(b<<2)>>2]|0;if((k|0)!=(a|0)?(c[l+(a<<2)>>2]|0)==(a|0):0){j=+h[q+(b<<3)>>3];if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(!g){c[l+(f<<2)>>2]=k;c[m>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;}}o=o+1|0;}U1(p);}while(0);return}function px(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;s=c[a+20>>2]|0;t=c[a+24>>2]|0;u=c[a>>2]|0;g=c[a+4>>2]|0;p=KK(u<<2)|0;c[d>>2]=p;f=0;while(1){if((f|0)>=(u|0))break;c[p+(f<<2)>>2]=f;f=f+1|0;}c[e>>2]=g;r=c[a+28>>2]|0;a:do if(!b){f=0;i=0.0;k=0;while(1){if((k|0)>=(u|0))break a;b=c[s+(k<<2)>>2]|0;l=k+1|0;m=c[s+(l<<2)>>2]|0;n=p+(k<<2)|0;o=+(m-b|0);g=1;while(1){if((b|0)>=(m|0))break;a=c[t+(b<<2)>>2]|0;if(((k|0)!=(a|0)?(c[p+(a<<2)>>2]|0)==(a|0):0)?(c[n>>2]|0)==(k|0):0){j=+h[r+(b<<3)>>3]/(+((c[s+(a+1<<2)>>2]|0)-(c[s+(a<<2)>>2]|0)|0)*o);if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(g|0){k=l;continue}c[p+(f<<2)>>2]=k;c[p+(k<<2)>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;k=l;}}else {q=Uw(u)|0;p=0;f=0;i=0.0;while(1){if((p|0)>=(u|0))break;k=c[q+(p<<2)>>2]|0;l=c[d>>2]|0;m=l+(k<<2)|0;if((c[m>>2]|0)==(k|0)){b=c[s+(k<<2)>>2]|0;n=c[s+(k+1<<2)>>2]|0;o=+(n-b|0);g=1;while(1){if((b|0)>=(n|0))break;a=c[t+(b<<2)>>2]|0;if((k|0)!=(a|0)?(c[l+(a<<2)>>2]|0)==(a|0):0){j=+h[r+(b<<3)>>3]/(+((c[s+(a+1<<2)>>2]|0)-(c[s+(a<<2)>>2]|0)|0)*o);if((g|0)==0?!(j>i):0)g=0;else {g=0;f=a;i=j;}}b=b+1|0;}if(!g){c[l+(f<<2)>>2]=k;c[m>>2]=f;c[e>>2]=(c[e>>2]|0)+-1;}}p=p+1|0;}U1(q);}while(0);return}function qx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;m=c[a+20>>2]|0;n=c[a+24>>2]|0;l=c[a>>2]|0;j=KK(l<<2)|0;c[d>>2]=j;a=0;while(1){if((a|0)>=(l|0))break;c[j+(a<<2)>>2]=-100;a=a+1|0;}c[e>>2]=0;c[f>>2]=0;a:do if(!b){b=0;b:while(1){if((b|0)>=(l|0))break a;if((c[j+(b<<2)>>2]|0)!=-100){b=b+1|0;continue}g=c[e>>2]|0;c[e>>2]=g+1;c[j+(b<<2)>>2]=g;g=b+1|0;h=m+(g<<2)|0;a=c[m+(b<<2)>>2]|0;while(1){if((a|0)>=(c[h>>2]|0)){b=g;continue b}i=c[n+(a<<2)>>2]|0;if((b|0)!=(i|0)){c[j+(i<<2)>>2]=-1;c[f>>2]=(c[f>>2]|0)+1;}a=a+1|0;}}}else {i=Uw(l)|0;h=0;while(1){if((h|0)>=(l|0))break;j=c[i+(h<<2)>>2]|0;k=c[d>>2]|0;a=k+(j<<2)|0;c:do if((c[a>>2]|0)==-100){b=c[e>>2]|0;c[e>>2]=b+1;c[a>>2]=b;b=m+(j+1<<2)|0;a=c[m+(j<<2)>>2]|0;while(1){if((a|0)>=(c[b>>2]|0))break c;g=c[n+(a<<2)>>2]|0;if((j|0)!=(g|0)){c[k+(g<<2)>>2]=-1;c[f>>2]=(c[f>>2]|0)+1;}a=a+1|0;}}while(0);h=h+1|0;}U1(i);}while(0);c[f>>2]=(c[f>>2]|0)+(c[e>>2]|0);return}function rx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;n=q+4|0;o=q;p=c[a+20>>2]|0;m=c[a+24>>2]|0;h=c[a>>2]|0;a=KK(h<<2)|0;c[d>>2]=a;g=0;while(1){c[n>>2]=g;if((g|0)>=(h|0))break;c[a+(g<<2)>>2]=-100;g=(c[n>>2]|0)+1|0;}c[e>>2]=0;c[f>>2]=0;k=xx(h,(h<<1)+-2|0)|0;a:do if(!b){a=0;while(1){c[n>>2]=a;if((a|0)>=(h|0))break a;j=a+1|0;zx(k,a,(c[p+(j<<2)>>2]|0)-(c[p+(a<<2)>>2]|0)|0)|0;a=j;}}else {g=Uw(h)|0;a=0;while(1){if((a|0)>=(h|0))break;j=c[g+(a<<2)>>2]|0;c[n>>2]=j;zx(k,j,(c[p+(j+1<<2)>>2]|0)-(c[p+(j<<2)>>2]|0)|0)|0;a=a+1|0;}U1(g);}while(0);b:while(1){j=(Ax(k,n,o)|0)==0;a=c[e>>2]|0;if(j)break;c[e>>2]=a+1;c[(c[d>>2]|0)+(c[n>>2]<<2)>>2]=a;a=c[n>>2]|0;j=c[p+(a<<2)>>2]|0;while(1){if((j|0)>=(c[p+(a+1<<2)>>2]|0))continue b;i=c[m+(j<<2)>>2]|0;if((a|0)!=(i|0)){c:do if((c[(c[d>>2]|0)+(i<<2)>>2]|0)==-100){Cx(k,i)|0;c[(c[d>>2]|0)+(i<<2)>>2]=-1;g=p+(i+1<<2)|0;a=c[p+(i<<2)>>2]|0;while(1){if((a|0)>=(c[g>>2]|0))break c;b=m+(a<<2)|0;h=c[b>>2]|0;if((i|0)!=(h|0)?(c[(c[d>>2]|0)+(h<<2)>>2]|0)==-100:0){h=Bx(k,h)|0;c[o>>2]=h;zx(k,c[b>>2]|0,h+1|0)|0;}a=a+1|0;}}while(0);c[f>>2]=(c[f>>2]|0)+1;a=c[n>>2]|0;}j=j+1|0;}}c[f>>2]=(c[f>>2]|0)+a;yx(k);l=q;return}function sx(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a+8>>3];c=+h[b+8>>3];return (d>c?-1:d>2]|0)==1:0)f=a;else f=Qw(a)|0;do if(!b)b=0;else {if(ww(b,0)|0?(c[b+16>>2]|0)==1:0)break;b=Aw(b,0)|0;}while(0);d=ux(f,b,d)|0;b=vx(d,e)|0;if((f|0)!=(a|0))c[d+36>>2]=1;return b|0}function ux(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(!a)a=0;else {e=KK(44)|0;c[e>>2]=0;c[e+4>>2]=c[a+4>>2];c[e+8>>2]=a;c[e+12>>2]=b;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=d;c[e+28>>2]=0;c[e+32>>2]=0;c[e+36>>2]=0;a=e;}return a|0}function vx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+32|0;e=k+20|0;f=k+16|0;g=k+12|0;h=k+8|0;i=k+4|0;j=k;c[f>>2]=0;if((c[a>>2]|0)<((c[b+16>>2]|0)+-1|0)?(ix(c[a+8>>2]|0,i,c[a+12>>2]|0,j,0,f,g,h,b,e),d=c[i>>2]|0,d|0):0){i=c[j>>2]|0;j=ux(d,i,c[f>>2]|0)|0;c[a+28>>2]=j;c[j+40>>2]=c[e>>2];c[j>>2]=(c[a>>2]|0)+1;c[j+4>>2]=c[d>>2];c[j+8>>2]=d;c[j+12>>2]=i;c[j+16>>2]=c[g>>2];c[a+20>>2]=c[h>>2];c[j+32>>2]=a;vx(j,b)|0;}l=k;return a|0}function wx(a){a=a|0;var b=0;while(1){b=c[a+28>>2]|0;if(!b)break;else a=b;}return a|0}function xx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=KK(28)|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=b;c[f+12>>2]=-1;e=f+16|0;c[e>>2]=KK((b<<2)+4|0)|0;d=0;while(1){if((d|0)>(b|0))break;c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0;}b=(a<<2)+4|0;e=f+20|0;c[e>>2]=KK(b)|0;d=0;while(1){if((d|0)>(a|0))break;c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0;}b=KK(b)|0;c[f+24>>2]=b;d=0;while(1){if((d|0)>(a|0))break;c[b+(d<<2)>>2]=-999;d=d+1|0;}return f|0}function yx(a){a=a|0;var b=0,d=0,e=0,f=0;if(a|0){e=a+16|0;b=c[e>>2]|0;if(b|0){f=a+8|0;d=0;while(1){if((d|0)>(c[f>>2]|0))break;Cy(c[b+(d<<2)>>2]|0,105);d=d+1|0;b=c[e>>2]|0;}U1(b);}b=c[a+20>>2]|0;if(b|0)U1(b);U1(c[a+24>>2]|0);U1(a);}return}function zx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;g=a+8|0;j=a+20|0;i=a+24|0;k=a+16|0;if(!a)qa(138953,95743,69,95759);while(1){if((c[g>>2]|0)<(d|0)){h=4;break}e=(c[j>>2]|0)+(b<<2)|0;f=c[e>>2]|0;if(!f)break;l=c[(c[i>>2]|0)+(b<<2)>>2]|0;c[e>>2]=0;c[a>>2]=(c[a>>2]|0)+-1;Fy(f,105,(c[k>>2]|0)+(l<<2)|0);}if((h|0)==4)qa(95778,95743,70,95759);c[a>>2]=(c[a>>2]|0)+1;e=a+12|0;if((c[e>>2]|0)<(d|0))c[e>>2]=d;c[(c[i>>2]|0)+(b<<2)>>2]=d;e=KK(4)|0;c[e>>2]=b;f=c[(c[k>>2]|0)+(d<<2)>>2]|0;if(!f)e=By(e)|0;else e=Dy(f,e)|0;c[(c[j>>2]|0)+(b<<2)>>2]=e;c[(c[k>>2]|0)+(d<<2)>>2]=e;return a|0}function Ax(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((a|0)!=0?(c[a>>2]|0)>=1:0){f=a+12|0;e=c[f>>2]|0;c[d>>2]=e;c[a>>2]=(c[a>>2]|0)+-1;d=a+16|0;g=c[(c[d>>2]|0)+(e<<2)>>2]|0;c[b>>2]=c[(Ey(g)|0)>>2];Fy(g,105,(c[d>>2]|0)+(e<<2)|0);d=c[d>>2]|0;if(!(c[d+(e<<2)>>2]|0)){while(1){if((e|0)<=-1)break;if(c[d+(e<<2)>>2]|0)break;e=e+-1|0;}c[f>>2]=e;}e=c[b>>2]|0;c[(c[a+20>>2]|0)+(e<<2)>>2]=0;c[(c[a+24>>2]|0)+(e<<2)>>2]=-999;e=1;}else e=0;return e|0}function Bx(a,b){a=a|0;b=b|0;return c[(c[a+24>>2]|0)+(b<<2)>>2]|0}function Cx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;if((a|0)!=0?(e=c[a>>2]|0,(e|0)>=1):0){h=a+24|0;d=c[(c[h>>2]|0)+(b<<2)>>2]|0;c[a>>2]=e+-1;f=a+20|0;e=a+16|0;Fy(c[(c[f>>2]|0)+(b<<2)>>2]|0,105,(c[e>>2]|0)+(d<<2)|0);a=a+12|0;if((d|0)==(c[a>>2]|0)?(g=c[e>>2]|0,(c[g+(d<<2)>>2]|0)==0):0){while(1){if((d|0)<=-1)break;if(c[g+(d<<2)>>2]|0)break;d=d+-1|0;}c[a>>2]=d;}c[(c[f>>2]|0)+(b<<2)>>2]=0;c[(c[h>>2]|0)+(b<<2)>>2]=-999;d=1;}else d=0;return d|0}function Dx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;if(!(ww(a,0)|0))qa(95795,95831,260,95846);w=xw(a)|0;x=c[w+20>>2]|0;y=c[w+24>>2]|0;e=w+16|0;a=w+28|0;if((c[e>>2]|0)==1)v=c[a>>2]|0;else {U1(c[a>>2]|0);c[e>>2]=1;v=KK(c[w+8>>2]<<3)|0;c[a>>2]=v;}r=KK(c[w>>2]<<2)|0;a=0;while(1){e=c[w>>2]|0;if((a|0)>=(e|0)){q=0;a=e;break}c[r+(a<<2)>>2]=-1;a=a+1|0;}a:while(1){if((q|0)>=(a|0)){g=0.0;k=0.0;f=0;u=0;t=a;break}p=q+1|0;i=x+(p<<2)|0;m=x+(q<<2)|0;j=(c[i>>2]|0)-(c[m>>2]|0)|0;c[r+(q<<2)>>2]=q;e=c[m>>2]|0;while(1){o=c[i>>2]|0;if((e|0)>=(o|0))break;a=c[y+(e<<2)>>2]|0;if((q|0)!=(a|0))c[r+(a<<2)>>2]=q;e=e+1|0;}n=+(j|0);e=c[m>>2]|0;while(1){if((e|0)>=(o|0))break;a=c[y+(e<<2)>>2]|0;if((q|0)!=(a|0)){i=c[x+(a+1<<2)>>2]|0;a=c[x+(a<<2)>>2]|0;l=+(i-a|0)+n;while(1){if((a|0)>=(i|0))break;l=(c[r+(c[y+(a<<2)>>2]<<2)>>2]|0)==(q|0)?l+-1.0:l;a=a+1|0;}h[v+(e<<3)>>3]=l;if(!(l>0.0)){s=23;break a}}e=e+1|0;}q=p;a=c[w>>2]|0;}if((s|0)==23)qa(95868,95831,290,95846);while(1){if((u|0)>=(t|0))break;i=u+1|0;j=x+(i<<2)|0;e=c[x+(u<<2)>>2]|0;while(1){if((e|0)>=(c[j>>2]|0))break;a=c[y+(e<<2)>>2]|0;if((u|0)==(a|0))a=f;else {k=+_w(d,b,u,a)+k;g=+h[v+(e<<3)>>3]+g;a=f+1|0;}f=a;e=e+1|0;}u=i;t=c[w>>2]|0;}n=+(f|0);g=k/(g/n*n);a=0;b:while(1){if((a|0)>=(t|0))break;i=a+1|0;j=c[x+(i<<2)>>2]|0;e=c[x+(a<<2)>>2]|0;while(1){if((e|0)>=(j|0)){a=i;continue b}f=v+(e<<3)|0;if((a|0)!=(c[y+(e<<2)>>2]|0))h[f>>3]=+h[f>>3]*g;e=e+1|0;}}return w|0}function Ex(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0.0,S=0.0;L=c[a>>2]|0;M=c[a+20>>2]|0;N=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,333,95876);O=Dx(a,b,e)|0;P=KK(56)|0;Q=P+32|0;h[Q>>3]=1.0;c[P+20>>2]=0;c[P+24>>2]=0;h[P+40>>3]=.01;c[P+48>>2]=~~+C(+(+(c[a>>2]|0)));g=L<<3;I=KK(g)|0;c[P+12>>2]=I;a=0;while(1){if((a|0)>=(L|0))break;h[I+(a<<3)>>3]=d;a=a+1|0;}J=KK(L<<2)|0;H=KK(g)|0;j=0;while(1){if((j|0)>=(L|0)){n=0;break}k=H+(j<<3)|0;h[k>>3]=0.0;l=j+1|0;m=M+(l<<2)|0;i=c[M+(j<<2)>>2]|0;a=0;d=0.0;while(1){if((i|0)>=(c[m>>2]|0))break;g=c[N+(i<<2)>>2]|0;if((j|0)!=(g|0)){d=+_w(e,b,j,g);d=+h[k>>3]+d;h[k>>3]=d;a=a+1|0;}i=i+1|0;}if((a|0)<=0){p=14;break}h[k>>3]=d/+(a|0);j=l;}if((p|0)==14)qa(95908,95831,358,95876);while(1){if((n|0)>=(L|0)){a=0;l=0;break}c[J+(n<<2)>>2]=-1;n=n+1|0;}a:while(1){if((l|0)>=(L|0))break;c[J+(l<<2)>>2]=l;j=M+(l<<2)|0;m=l+1|0;n=M+(m<<2)|0;i=c[j>>2]|0;while(1){g=c[n>>2]|0;if((i|0)>=(g|0))break;g=J+(c[N+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(l|0)){c[g>>2]=l;a=a+1|0;}i=i+1|0;}k=c[j>>2]|0;while(1){if((k|0)>=(g|0)){l=m;continue a}i=c[N+(k<<2)>>2]|0;j=M+(i+1<<2)|0;i=c[M+(i<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break;g=J+(c[N+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(l|0)){c[g>>2]=l;a=a+1|0;}i=i+1|0;}k=k+1|0;g=c[n>>2]|0;}}g=a+L|0;F=P+4|0;c[F>>2]=rw(L,L,g,1,1)|0;g=rw(L,L,g,1,1)|0;G=P+8|0;c[G>>2]=g;a=c[F>>2]|0;do if(!((g|0)==0|(a|0)==0)){B=c[a+20>>2]|0;A=c[a+24>>2]|0;y=c[a+28>>2]|0;E=c[g+28>>2]|0;z=c[g+20>>2]|0;t=c[g+24>>2]|0;c[z>>2]=0;c[B>>2]=0;d=0.0;o=0.0;p=0;i=0;b:while(1){if((p|0)>=(L|0)){p=58;break}u=p+L|0;c[J+(p<<2)>>2]=u;k=M+(p<<2)|0;v=p+1|0;w=M+(v<<2)|0;x=H+(p<<3)|0;q=0.0;r=0.0;j=c[k>>2]|0;while(1){a=c[w>>2]|0;if((j|0)>=(a|0))break;g=c[N+(j<<2)>>2]|0;a=J+(g<<2)|0;if((c[a>>2]|0)!=(u|0)){c[a>>2]=u;c[A+(i<<2)>>2]=g;switch(f|0){case 0:{s=1.0;break}case 1:{s=(+h[H+(g<<3)>>3]+ +h[x>>3])*.5;break}case 2:{s=+D(+(+Zw(e,b,p,g)),.4);break}default:{p=42;break b}}S=-1.0/(s*s);h[y+(i<<3)>>3]=S;c[t+(i<<2)>>2]=g;R=S*s;n=E+(i<<3)|0;h[n>>3]=R;o=+_w(e,b,p,g)*R+o;R=+h[n>>3];i=i+1|0;q=S+q;r=R+r;d=R*s+d;}j=j+1|0;}n=c[k>>2]|0;while(1){if((n|0)>=(a|0))break;k=c[N+(n<<2)>>2]|0;l=M+(k+1<<2)|0;m=H+(k<<3)|0;j=c[M+(k<<2)>>2]|0;while(1){if((j|0)>=(c[l>>2]|0))break;g=N+(j<<2)|0;a=J+(c[g>>2]<<2)|0;if((c[a>>2]|0)!=(u|0)){c[a>>2]=u;switch(f|0){case 0:{s=2.0;break}case 1:{s=(+h[m>>3]*2.0+ +h[x>>3]+ +h[H+(c[g>>2]<<3)>>3])*.5;break}case 2:{s=+D(+(+Zw(e,b,p,c[g>>2]|0)),.4);break}default:{p=53;break b}}c[A+(i<<2)>>2]=c[g>>2];R=-1.0/(s*s);h[y+(i<<3)>>3]=R;c[t+(i<<2)>>2]=c[g>>2];S=R*s;a=E+(i<<3)|0;h[a>>3]=S;o=+_w(e,b,c[g>>2]|0,k)*S+o;S=+h[a>>3];i=i+1|0;q=R+q;r=S+r;d=S*s+d;}j=j+1|0;}n=n+1|0;a=c[w>>2]|0;}c[A+(i<<2)>>2]=p;x=I+(p<<3)|0;S=-(q*+h[x>>3]);h[x>>3]=S;h[y+(i<<3)>>3]=S-q;c[t+(i<<2)>>2]=p;h[E+(i<<3)>>3]=-r;i=i+1|0;c[B+(v<<2)>>2]=i;c[z+(v<<2)>>2]=i;p=v;}if((p|0)==42){U4(95915,29,1,c[15712]|0)|0;qa(138394,95831,418,95876);}else if((p|0)==53){U4(95915,29,1,c[15712]|0)|0;qa(138394,95831,460,95876);}else if((p|0)==58){d=o/d;a=0;while(1){if((a|0)>=(i|0))break;N=E+(a<<3)|0;h[N>>3]=+h[N>>3]*d;a=a+1|0;}h[Q>>3]=d;c[(c[F>>2]|0)+8>>2]=i;c[(c[G>>2]|0)+8>>2]=i;U1(J);U1(H);qw(O);K=P;break}}else {Fx(P);K=0;}while(0);return K|0}function Fx(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)qw(b);b=c[a+8>>2]|0;if(b|0)qw(b);b=c[a+12>>2]|0;if(b|0)U1(b);b=c[a+20>>2]|0;if(b|0)tb[c[a+16>>2]&127](b);U1(a);}return}function Gx(a,b,d,e,f,g){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0;K=c[a>>2]|0;if(ww(a,0)|0?(c[a+16>>2]|0)==1:0){k=O(K,b)|0;j=0.0;i=0;while(1){if((i|0)>=(k|0))break;q=+h[e+(i<<3)>>3];j=q*q+j;i=i+1|0;}a:do if(j==0.0){i=0;while(1){if((i|0)>=(k|0))break a;h[e+(i<<3)>>3]=+Sw()*72.0;i=i+1|0;}}while(0);F=c[a+20>>2]|0;G=c[a+24>>2]|0;H=c[a+28>>2]|0;i=KK(56)|0;J=i+32|0;h[J>>3]=1.0;c[i+20>>2]=0;c[i+24>>2]=0;c[i>>2]=a;h[i+40>>3]=.01;c[i+48>>2]=~~+C(+(+(c[a>>2]|0)));I=KK(K<<3)|0;c[i+12>>2]=I;k=0;while(1){if((k|0)>=(K|0))break;h[I+(k<<3)>>3]=d;k=k+1|0;}a=(c[a+8>>2]|0)+K|0;D=i+4|0;c[D>>2]=rw(K,K,a,1,1)|0;a=rw(K,K,a,1,1)|0;E=i+8|0;c[E>>2]=a;k=c[D>>2]|0;if(!((a|0)==0|(k|0)==0)){x=c[k+20>>2]|0;y=c[k+24>>2]|0;z=c[a+20>>2]|0;A=c[a+24>>2]|0;v=c[k+28>>2]|0;B=c[a+28>>2]|0;c[z>>2]=0;c[x>>2]=0;p=0.0;q=0.0;w=0;s=0;b:while(1){if((s|0)>=(K|0))break;t=s+1|0;u=F+(t<<2)|0;l=0.0;m=0.0;r=c[F+(s<<2)>>2]|0;o=p;d=q;a=w;while(1){if((r|0)>=(c[u>>2]|0))break;k=c[G+(r<<2)>>2]|0;if((k|0)==(s|0)){j=o;k=a;}else {c[y+(a<<2)>>2]=k;n=+h[H+(r<<3)>>3];switch(f|0){case 2:{j=n*n;j=j==0.0?-1.0e5:-1.0/j;break}case 1:{j=n*n==0.0?-1.0e5:-1.0/n;break}case 0:{j=-1.0;break}default:{L=23;break b}}h[v+(a<<3)>>3]=j;c[A+(a<<2)>>2]=k;M=j*n;N=B+(a<<3)|0;h[N>>3]=M;d=+_w(e,b,s,k)*M+d;M=+h[N>>3];l=j+l;m=M+m;j=M*n+o;k=a+1|0;}r=r+1|0;o=j;a=k;}c[y+(a<<2)>>2]=s;w=I+(s<<3)|0;p=-(l*+h[w>>3]);h[w>>3]=p;h[v+(a<<3)>>3]=p-l;c[A+(a<<2)>>2]=s;h[B+(a<<3)>>3]=-m;w=a+1|0;c[x+(t<<2)>>2]=w;c[z+(t<<2)>>2]=w;p=o;q=d;s=t;}if((L|0)==23)qa(138394,95831,591,96012);j=(g|0)==0?1.0:q/p;if(j==0.0)i=0;else {k=0;while(1){if((k|0)>=(w|0))break;N=B+(k<<3)|0;h[N>>3]=+h[N>>3]*j;k=k+1|0;}h[J>>3]=j;c[(c[D>>2]|0)+8>>2]=w;c[(c[E>>2]|0)+8>>2]=w;}}else {Fx(i);i=0;}return i|0}qa(95945,95831,525,96012);return 0}function Hx(a){a=a|0;Fx(a);return}function Ix(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;return +(+Jx(a,b,c,d,e))}function Jx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0;T=l;l=l+16|0;Q=T+12|0;S=T+8|0;n=T+4|0;k=T;m=c[a+4>>2]|0;i=c[a+8>>2]|0;c[Q>>2]=0;c[S>>2]=0;c[n>>2]=0;K=c[a+12>>2]|0;c[k>>2]=0;L=xw(i)|0;M=c[m>>2]|0;N=O(M,b)|0;g=N<<3;R=KK(g)|0;if((R|0)!=0?(P=O(b<<3,M)|0,W6(R|0,d|0,P|0)|0,J=KK(g)|0,c[S>>2]=J,(J|0)!=0):0){I=c[i+20>>2]|0;J=c[i+24>>2]|0;E=c[i+28>>2]|0;F=c[L+28>>2]|0;G=c[m+28>>2]|0;H=a+24|0;switch(c[H>>2]|0){case 1:{Kx(c[a+20>>2]|0,M,b,d,k,n);g=c[k>>2]|0;if(!g){A=0.0;B=0.0;g=0;}else {m=yw(m,g)|0;A=0.0;B=0.0;}break}case 2:{g=c[a+20>>2]|0;A=+h[g+8>>3];B=+h[g>>3];g=0;break}default:{A=0.0;B=0.0;g=0;}}y=(K|0)==0;z=a+40|0;x=a+48|0;i=c[n>>2]|0;j=1.0;k=0;a:while(1){w=k+1|0;if(!((k|0)<(e|0)&j>f))break;b:do if((c[H>>2]|0)==4){n=c[S>>2]|0;k=0;while(1){if((k|0)>=(M|0))break b;o=O(k,b)|0;a=0;while(1){if((a|0)>=(b|0))break;h[n+(a+o<<3)>>3]=0.0;a=a+1|0;}k=k+1|0;}}else {q=0;while(1){if((q|0)>=(M|0))break;u=q+1|0;v=I+(u<<2)|0;p=0.0;t=c[I+(q<<2)>>2]|0;k=-1;while(1){if((t|0)>=(c[v>>2]|0))break;n=J+(t<<2)|0;a=c[n>>2]|0;if((q|0)==(a|0))k=t;else {s=+_w(d,b,q,a);o=E+(t<<3)|0;r=+h[o>>3];if(r==0.0)r=0.0;else {if(s==0.0){r=r/+h[G+(t<<3)>>3]*.0001;a=0;while(1){if((a|0)>=(b|0))break;s=r*(+Sw()+.0001);U=d+((O(c[n>>2]|0,b)|0)+a<<3)|0;h[U>>3]=s+ +h[U>>3];a=a+1|0;}s=+_w(d,b,q,c[n>>2]|0);r=+h[o>>3];}r=r/s;}h[F+(t<<3)>>3]=r;p=r+p;}t=t+1|0;}if((k|0)<=-1){D=25;break a}h[F+(k<<3)>>3]=-p;q=u;}Gw(L,0,d,0,S,0,b);}while(0);c:do if(!y){n=c[S>>2]|0;k=0;while(1){if((k|0)>=(M|0))break c;o=K+(k<<3)|0;q=O(k,b)|0;a=0;while(1){if((a|0)>=(b|0))break;v=a+q|0;U=n+(v<<3)|0;h[U>>3]=+h[U>>3]+ +h[R+(v<<3)>>3]*+h[o>>3];a=a+1|0;}k=k+1|0;}}while(0);d:do switch(c[H>>2]|0){case 1:{k=c[S>>2]|0;a=0;while(1){if((a|0)>=(M|0)){D=50;break d}o=O(a,b)|0;n=0;while(1){if((n|0)>=(b|0))break;D=n+o|0;U=k+(D<<3)|0;h[U>>3]=+h[U>>3]+ +h[i+(D<<3)>>3];n=n+1|0;}a=a+1|0;}}case 2:{Lx(M,b,d,c[S>>2]|0,B,A);k=c[S>>2]|0;p=+h[z>>3];a=c[x>>2]|0;if((c[H>>2]|0)==2)Mx(m,B,b,d,k,p,a,Q);else D=51;break}default:{k=c[S>>2]|0;D=50;}}while(0);if((D|0)==50){p=+h[z>>3];a=c[x>>2]|0;D=51;}if((D|0)==51){D=0;+fy(m,b,d,k,p,a,0,Q);}if(c[Q>>2]|0)break;j=+Nx(M,b,d,c[S>>2]|0);j=j/+C(+(+Ww(N,d,d)));W6(d|0,c[S>>2]|0,P|0)|0;k=w;}if((D|0)==25)qa(96049,95831,895,96060);qw(L);if(g){qw(g);qw(m);}}else {qw(L);j=1.0;i=0;}U1(R);g=c[S>>2]|0;if(g|0)U1(g);if(i|0)U1(i);l=T;return +j}function Kx(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0,B=0.0;p=c[a+8>>2]|0;A=c[a+12>>2]|0;x=c[a+16>>2]|0;z=c[a+32>>2]|0;y=c[z+20>>2]|0;z=c[z+24>>2]|0;l=a+20|0;r=c[l>>2]|0;m=a+24|0;q=c[m>>2]|0;n=a+28|0;o=c[n>>2]|0;w=+h[a>>3];a:do if((p|2|0)==3){if(!r){if((q|0)!=0|(o|0)!=0)qa(96094,95831,692,96111);else {i=0;j=0;}while(1){if((i|0)>=(A|0))break;v=c[x+(i<<2)>>2]|0;s=+((c[y+(v+1<<2)>>2]|0)-(c[y+(v<<2)>>2]|0)|0)+1.0;i=i+1|0;j=j+~~(s*s)|0;}q=j<<2;r=KK(q)|0;c[l>>2]=r;q=KK(q)|0;c[m>>2]=q;o=KK(j<<3)|0;c[n>>2]=o;}u=0;a=0;while(1){if((u|0)>=(A|0))break;p=c[x+(u<<2)>>2]|0;t=y+(p<<2)|0;j=c[t>>2]|0;i=c[z+(j<<2)>>2]|0;j=c[z+(j+1<<2)>>2]|0;b:do if((i|0)!=(j|0)){B=+Zw(e,d,i,j);B=B*B;n=y+(p+1<<2)|0;s=+((c[n>>2]|0)-(c[t>>2]|0)|0);c[r+(a<<2)>>2]=p;c[q+(a<<2)>>2]=p;h[o+(a<<3)>>3]=w/B;k=s*s*B;s=-(w/(B*s));j=c[t>>2]|0;while(1){a=a+1|0;i=c[n>>2]|0;if((j|0)>=(i|0))break;c[r+(a<<2)>>2]=p;c[q+(a<<2)>>2]=c[z+(j<<2)>>2];h[o+(a<<3)>>3]=s;j=j+1|0;}k=w/k;m=c[t>>2]|0;while(1){if((m|0)>=(i|0))break b;l=c[z+(m<<2)>>2]|0;c[r+(a<<2)>>2]=l;c[q+(a<<2)>>2]=p;h[o+(a<<3)>>3]=s;j=c[t>>2]|0;while(1){a=a+1|0;i=c[n>>2]|0;if((j|0)>=(i|0))break;v=c[z+(j<<2)>>2]|0;c[r+(a<<2)>>2]=l;c[q+(a<<2)>>2]=v;h[o+(a<<3)>>3]=k;j=j+1|0;}m=m+1|0;}}while(0);u=u+1|0;}i=Dw(a,b,b,r,q,o,1,8)|0;a=0;}else {switch(p|0){case 2:case 4:break;default:{i=0;a=0;break a}}do if(!r)if((q|0)!=0|(o|0)!=0)qa(96094,95831,734,96111);else {u=A<<2;v=KK(u)|0;c[l>>2]=v;u=KK(u)|0;c[m>>2]=u;t=KK(A<<3)|0;c[n>>2]=t;break}else {t=o;u=q;v=r;}while(0);a=KK(O(b<<3,d)|0)|0;j=O(d,b)|0;i=0;while(1){if((i|0)>=(j|0)){o=0;break}h[a+(i<<3)>>3]=0.0;i=i+1|0;}while(1){if((o|0)>=(A|0))break;p=c[x+(o<<2)>>2]|0;l=y+(p<<2)|0;m=c[l>>2]|0;k=+Zw(e,d,c[z+(m<<2)>>2]|0,c[z+(m+1<<2)>>2]|0);c[v+(o<<2)>>2]=p;c[u+(o<<2)>>2]=p;k=w/k;h[t+(o<<3)>>3]=k;l=c[l>>2]|0;m=c[y+(p+1<<2)>>2]|0;p=O(p,d)|0;j=l;while(1){if((j|0)>=(m|0))break;n=O(c[z+(j<<2)>>2]|0,d)|0;i=0;while(1){if((i|0)>=(d|0))break;r=a+(i+p<<3)|0;h[r>>3]=+h[r>>3]+ +h[e+(i+n<<3)>>3];i=i+1|0;}j=j+1|0;}k=k*(1.0/+(m-l|0));i=0;while(1){if((i|0)>=(d|0))break;r=a+(i+p<<3)|0;h[r>>3]=k*+h[r>>3];i=i+1|0;}o=o+1|0;}i=Dw(o,b,b,v,u,t,1,8)|0;}while(0);c[f>>2]=i;c[g>>2]=a;return}function Lx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0;f=f*e;g=0;a:while(1){if((g|0)>=(a|0))break;l=g+1|0;m=O(g,b)|0;i=l;while(1){if((i|0)==(a|0)){g=l;continue a}k=O(i,b)|0;e=1.0/+Zw(c,b,g,i);j=0;while(1){if((j|0)>=(b|0))break;p=j+m|0;n=j+k|0;o=f*((+h[c+(p<<3)>>3]-+h[c+(n<<3)>>3])*e);p=d+(p<<3)|0;h[p>>3]=o+ +h[p>>3];n=d+(n<<3)|0;h[n>>3]=+h[n>>3]-o;j=j+1|0;}i=i+1|0;}}return}function Mx(a,b,d,e,f,g,h,i){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;i=i|0;var j=0,k=0;k=Wx(a,b)|0;j=$x(a,b)|0;+cy(k,j,c[a>>2]|0,d,e,f,g,h,i);return}function Nx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,l=0;f=0;i=0.0;while(1){if((f|0)>=(a|0))break;j=O(f,b)|0;e=0;g=0.0;while(1){if((e|0)>=(b|0))break;l=e+j|0;k=+h[d+(l<<3)>>3]-+h[c+(l<<3)>>3];e=e+1|0;g=k*k+g;}f=f+1|0;i=+C(+g)+i;}return +i}function Ox(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,E=0.0,F=0.0;A=c[a>>2]|0;p=c[a+20>>2]|0;q=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,1034,96133);r=A<<3;B=KK(r)|0;j=0;while(1){if((j|0)>=(A|0))break;m=B+(j<<3)|0;h[m>>3]=0.0;n=j+1|0;o=p+(n<<2)|0;l=c[p+(j<<2)>>2]|0;g=0;k=0.0;while(1){if((l|0)>=(c[o>>2]|0))break;i=c[q+(l<<2)>>2]|0;if((j|0)!=(i|0)){k=+_w(e,b,j,i);k=+h[m>>3]+k;h[m>>3]=k;g=g+1|0;}l=l+1|0;}if((g|0)<=0){z=11;break}h[m>>3]=k/+(g|0);j=n;}if((z|0)==11)qa(95908,95831,1046,96133);g=KK(56)|0;y=g+32|0;h[y>>3]=1.0;c[g+20>>2]=0;c[g+24>>2]=0;h[g+40>>3]=.01;c[g+48>>2]=~~+C(+(+(c[a>>2]|0)));x=KK(r)|0;c[g+12>>2]=x;i=0;while(1){if((i|0)>=(A|0))break;h[x+(i<<3)>>3]=d;i=i+1|0;}do if((A|0)>2)if(!f){i=hy(A,b,e)|0;break}else {i=gy(A,b,e)|0;break}else i=xw(a)|0;while(0);f=g+4|0;c[f>>2]=yw(a,i)|0;qw(i);j=xw(c[f>>2]|0)|0;c[g+8>>2]=j;i=c[f>>2]|0;if((j|0)==0|(i|0)==0){Px(g);g=0;}else {r=c[i+20>>2]|0;q=c[i+24>>2]|0;p=c[i+28>>2]|0;f=c[j+28>>2]|0;v=0.0;w=0.0;m=0;while(1){if((m|0)>=(A|0))break;o=m+1|0;n=r+(o<<2)|0;u=0.0;d=0.0;j=-1;s=v;t=w;l=c[r+(m<<2)>>2]|0;while(1){if((l|0)>=(c[n>>2]|0))break;i=c[q+(l<<2)>>2]|0;if((i|0)==(m|0)){k=u;i=l;}else {E=+D(+(+Zw(e,b,m,i)),.6);k=1.0/(E*E);h[p+(l<<3)>>3]=k;F=k*E;a=f+(l<<3)|0;h[a>>3]=F;t=F*+_w(e,b,m,i)+t;F=+h[a>>3];k=k+u;d=F+d;i=j;s=F*E+s;}u=k;j=i;l=l+1|0;}a=x+(m<<3)|0;k=-(u*+h[a>>3]);h[a>>3]=k;if((j|0)<=-1){z=31;break}h[p+(j<<3)>>3]=k-u;h[f+(j<<3)>>3]=-d;v=s;w=t;m=o;}if((z|0)==31)qa(96154,95831,1112,96133);k=w/v;j=c[r+(A<<2)>>2]|0;i=0;while(1){if((i|0)>=(j|0))break;A=f+(i<<3)|0;h[A>>3]=+h[A>>3]*k;i=i+1|0;}h[y>>3]=k;U1(B);}return g|0}function Px(a){a=a|0;Fx(a);return}function Qx(a,b,c){a=a|0;b=b|0;c=c|0;+Jx(a,b,c,50,.001);return}function Rx(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;z=c[a>>2]|0;A=c[a+20>>2]|0;B=c[a+24>>2]|0;if(!(ww(a,0)|0))qa(95795,95831,1149,96165);v=Dx(a,b,e)|0;w=c[v+28>>2]|0;a=KK(8)|0;x=KK(z<<2)|0;y=KK(z<<3)|0;i=0;while(1){if((i|0)>=(z|0)){o=0;break}l=y+(i<<3)|0;h[l>>3]=0.0;m=i+1|0;n=A+(m<<2)|0;j=c[A+(i<<2)>>2]|0;f=0;k=0.0;while(1){if((j|0)>=(c[n>>2]|0))break;g=c[B+(j<<2)>>2]|0;if((i|0)!=(g|0)){k=+_w(e,b,i,g);k=+h[l>>3]+k;h[l>>3]=k;f=f+1|0;}j=j+1|0;}if((f|0)<=0){p=11;break}h[l>>3]=k/+(f|0);i=m;}if((p|0)==11)qa(95908,95831,1167,96165);while(1){if((o|0)>=(z|0)){m=0;f=0;break}c[x+(o<<2)>>2]=-1;o=o+1|0;}a:while(1){if((m|0)>=(z|0))break;c[x+(m<<2)>>2]=m;j=A+(m<<2)|0;n=m+1|0;o=A+(n<<2)|0;i=c[j>>2]|0;while(1){g=c[o>>2]|0;if((i|0)>=(g|0))break;g=x+(c[B+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(m|0)){c[g>>2]=m;f=f+1|0;}i=i+1|0;}l=c[j>>2]|0;while(1){if((l|0)>=(g|0)){m=n;continue a}i=c[B+(l<<2)>>2]|0;j=A+(i+1<<2)|0;i=c[A+(i<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break;g=x+(c[B+(i<<2)>>2]<<2)|0;if((c[g>>2]|0)!=(m|0)){c[g>>2]=m;f=f+1|0;}i=i+1|0;}l=l+1|0;g=c[o>>2]|0;}}e=rw(z,z,f,1,1)|0;c[a>>2]=e;if(!e){Sx(a);a=0;}else {p=c[e+20>>2]|0;q=c[e+24>>2]|0;r=c[e+28>>2]|0;c[p>>2]=0;g=0;f=0;while(1){if((g|0)>=(z|0))break;s=g+z|0;c[x+(g<<2)>>2]=s;l=A+(g<<2)|0;t=g+1|0;u=A+(t<<2)|0;b=y+(g<<3)|0;j=c[l>>2]|0;while(1){g=c[u>>2]|0;if((j|0)>=(g|0))break;g=c[B+(j<<2)>>2]|0;i=x+(g<<2)|0;if((c[i>>2]|0)!=(s|0)){c[i>>2]=s;c[q+(f<<2)>>2]=g;o=r+(f<<3)|0;h[o>>3]=(+h[y+(g<<3)>>3]+ +h[b>>3])*.5;h[o>>3]=+h[w+(j<<3)>>3];f=f+1|0;}j=j+1|0;}o=c[l>>2]|0;while(1){if((o|0)>=(g|0))break;j=c[B+(o<<2)>>2]|0;l=A+(j+1<<2)|0;m=y+(j<<3)|0;n=w+(o<<3)|0;j=c[A+(j<<2)>>2]|0;while(1){if((j|0)>=(c[l>>2]|0))break;g=B+(j<<2)|0;i=x+(c[g>>2]<<2)|0;if((c[i>>2]|0)!=(s|0)){c[i>>2]=s;c[q+(f<<2)>>2]=c[g>>2];i=r+(f<<3)|0;h[i>>3]=(+h[m>>3]*2.0+ +h[b>>3]+ +h[y+(c[g>>2]<<3)>>3])*.5;h[i>>3]=+h[w+(j<<3)>>3]+ +h[n>>3];f=f+1|0;}j=j+1|0;}o=o+1|0;g=c[u>>2]|0;}c[p+(t<<2)>>2]=f;g=t;}c[e+8>>2]=f;A=Yp()|0;B=a+4|0;c[B>>2]=A;W6(A|0,d|0,168)|0;B=c[B>>2]|0;c[B+16>>2]=0;c[B+40>>2]=1;A=B+96|0;h[A>>3]=+h[A>>3]*.5;c[B+80>>2]=20;U1(x);U1(y);qw(v);}return a|0}function Sx(a){a=a|0;var b=0;if(a|0){b=c[a>>2]|0;if(b|0)qw(b);a=c[a+4>>2]|0;if(a|0)Zp(a);}return}function Tx(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+16|0;h=g;c[h>>2]=0;sq(e,b,c[a>>2]|0,c[a+4>>2]|0,d,f,h);if(!(c[h>>2]|0)){l=g;return}else qa(96184,95831,1262,96190);}function Ux(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;c[g>>2]=0;g=c[d+120>>2]|0;a:do switch(g|0){case 5:case 6:{if((c[b>>2]|0)>2){b=Ox(b,a,0.0,f,(g|0)!=6&1)|0;Qx(b,a,f);Px(b);}break}case 4:{g=0;while(1){if((g|0)==1)break a;i=Rx(b,a,d,f)|0;Tx(i,b,e,a,f);Sx(i);g=g+1|0;}}case 1:{d=0;h=6;break}case 2:{d=1;h=6;break}case 3:{d=2;h=6;break}default:{}}while(0);b:do if((h|0)==6){g=0;while(1){if((g|0)==1)break b;i=Ex(b,a,.05,f,d)|0;+Jx(i,a,f,50,.001);Fx(i);g=g+1|0;}}while(0);return}function Vx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0,k=0;k=l;l=l+16|0;g=k;c[g>>2]=d;j=c[a>>2]|0;a=c[j+8>>2]|0;i=+h[j>>3];j=c[a>>2]|0;Jw(a,b,g,0);a=0;f=0.0;while(1){if((a|0)>=(j|0))break;e=+h[b+(a<<3)>>3]+f;a=a+1|0;f=e;}e=+(j|0);d=c[g>>2]|0;a=0;while(1){if((a|0)>=(j|0))break;g=d+(a<<3)|0;h[g>>3]=(+h[b+(a<<3)>>3]*e-f)*i+ +h[g>>3];a=a+1|0;}l=k;return d|0}function Wx(a,b){a=a|0;b=+b;var d=0,e=0;d=KK(8)|0;e=KK(16)|0;c[d>>2]=e;h[e>>3]=b;c[e+8>>2]=a;c[d+4>>2]=25;return d|0}function Xx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;c[e>>2]=d;Jw(c[a>>2]|0,b,e,0);l=f;return c[e>>2]|0}function Yx(a){a=a|0;var b=0;b=KK(8)|0;c[b>>2]=a;c[b+4>>2]=26;return b|0}function Zx(a){a=a|0;if(a|0)U1(a);return}function _x(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=c[a>>2]|0;e=~~+h[f>>3];f=f+8|0;a=0;while(1){if((a|0)>=(e|0))break;h[d+(a<<3)>>3]=+h[f+(a<<3)>>3]*+h[b+(a<<3)>>3];a=a+1|0;}return d|0}function $x(a,b){a=a|0;b=+b;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0.0,o=0,p=0,q=0.0;m=c[a>>2]|0;o=c[a+20>>2]|0;p=c[a+24>>2]|0;k=c[a+28>>2]|0;l=KK(8)|0;i=KK((m<<3)+8|0)|0;c[l>>2]=i;h[i>>3]=+(m|0);i=i+8|0;q=+(m+-1|0);j=1.0/q;b=q*b;a=0;a:while(1){if((a|0)>=(m|0))break;e=i+(a<<3)|0;h[e>>3]=j;f=a+1|0;g=c[o+(f<<2)>>2]|0;d=c[o+(a<<2)>>2]|0;while(1){if((d|0)>=(g|0)){a=f;continue a}if((a|0)==(c[p+(d<<2)>>2]|0)?(n=+h[k+(d<<3)>>3],(n>=0.0?n:-n)>0.0):0)h[e>>3]=1.0/(n+b);d=d+1|0;}}c[l+4>>2]=27;return l|0}function ay(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0;i=c[a>>2]|0;k=c[a+20>>2]|0;l=c[a+24>>2]|0;m=c[a+28>>2]|0;n=KK(8)|0;d=KK((c[a>>2]<<3)+8|0)|0;c[n>>2]=d;h[d>>3]=+(i|0);d=d+8|0;a=0;a:while(1){if((a|0)>=(i|0))break;e=d+(a<<3)|0;h[e>>3]=1.0;f=a+1|0;g=c[k+(f<<2)>>2]|0;b=c[k+(a<<2)>>2]|0;while(1){if((b|0)>=(g|0)){a=f;continue a}if((a|0)==(c[l+(b<<2)>>2]|0)?(j=+h[m+(b<<3)>>3],(j>=0.0?j:-j)>0.0):0)h[e>>3]=1.0/j;b=b+1|0;}}c[n+4>>2]=27;return n|0}function by(a){a=a|0;U1(c[a>>2]|0);if(a|0)U1(a);return}function cy(a,b,c,d,e,f,g,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;i=i|0;j=j|0;var k=0.0,l=0,m=0.0,n=0,o=0,p=0;o=c<<3;n=KK(o)|0;o=KK(o)|0;l=0;m=0.0;while(1){if((l|0)<(d|0))j=0;else break;while(1){if((j|0)>=(c|0))break;p=(O(j,d)|0)+l|0;h[n+(j<<3)>>3]=+h[e+(p<<3)>>3];h[o+(j<<3)>>3]=+h[f+(p<<3)>>3];j=j+1|0;}k=+dy(a,b,c,n,o,g,i);j=0;while(1){if((j|0)>=(c|0))break;h[f+((O(j,d)|0)+l<<3)>>3]=+h[n+(j<<3)>>3];j=j+1|0;}l=l+1|0;m=k+m;}U1(n);U1(o);return +m}function dy(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;var i=0,j=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0.0,t=0,u=0;r=c[a+4>>2]|0;p=c[b+4>>2]|0;q=d<<3;i=KK(q)|0;k=KK(q)|0;t=KK(q)|0;l=KK(q)|0;k=nb[r&63](a,e,k)|0;m=Vw(d,f,k)|0;o=+(d|0);s=+C(+(+Ww(d,m,m)))/o;n=s*g;o=1.0/o;m=0;f=t;j=1.0;g=s;while(1){if(!(g>n&(m|0)<(h|0)))break;i=nb[p&63](b,k,i)|0;g=+Ww(d,k,i);if((m|0)>0)Xw(d,i,f,g/j)|0;else W6(f|0,i|0,q|0)|0;u=nb[r&63](a,f,l)|0;j=g/+Ww(d,f,u);Yw(d,e,f,j)|0;t=Yw(d,k,u,-j)|0;m=m+1|0;j=g;l=u;g=+C(+(+Ww(d,t,t)))*o;}U1(i);U1(k);U1(f);U1(l);return +g}function ey(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+16|0;B=C;y=c[a+4>>2]|0;z=y<<3;A=KK(z)|0;u=KK(z)|0;v=KK(z)|0;w=c[a+20>>2]|0;x=c[a+24>>2]|0;s=c[a+28>>2]|0;t=c[15712]|0;r=0;while(1){if((r|0)<(b|0))g=0;else break;while(1){if((g|0)>=(y|0)){a=0;break}q=(O(g,b)|0)+r|0;h[A+(g<<3)>>3]=+h[d+(q<<3)>>3];h[v+(g<<3)>>3]=+h[e+(q<<3)>>3];g=g+1|0;}while(1){if((a|0)<(f|0))n=0;else {g=0;break}while(1){if((n|0)>=(y|0))break;o=c[w+(n<<2)>>2]|0;p=n+1|0;q=c[w+(p<<2)>>2]|0;m=o;j=0.0;i=0.0;while(1){if((m|0)>=(q|0))break;g=c[x+(m<<2)>>2]|0;k=+h[s+(m<<3)>>3];if((g|0)==(n|0))i=k;else j=+h[A+(g<<3)>>3]*k+j;m=m+1|0;}if(j==0.0){c[B>>2]=q-o;w4(t,96212,B)|0;}h[u+(n<<3)>>3]=(+h[v+(n<<3)>>3]-j)/i;n=p;}W6(A|0,u|0,z|0)|0;a=a+1|0;}while(1){if((g|0)>=(y|0))break;h[e+((O(g,b)|0)+r<<3)>>3]=+h[A+(g<<3)>>3];g=g+1|0;}r=r+1|0;}U1(A);U1(u);U1(v);l=C;return e|0}function fy(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=g|0;h=h|0;i=i|0;var j=0;j=c[a>>2]|0;c[i>>2]=0;switch(h|0){case 0:{h=Yx(a)|0;i=ay(a)|0;f=+cy(h,i,j,b,d,e,f,g,0);Zx(h);by(i);break}case 1:{ey(a,b,d,e,g,0)|0;f=0.0;break}default:f=0.0;}return +f}function gy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+32|0;k=o;m=o+20|0;f=o+16|0;g=o+12|0;i=o+8|0;h[k>>3]=1.0;j=a<<3;n=KK(j)|0;j=KK(j)|0;b=0;while(1){if((b|0)>=(a|0))break;e=b<<1;h[n+(b<<3)>>3]=+h[d+(e<<3)>>3];h[j+(b<<3)>>3]=+h[d+((e|1)<<3)>>3];b=b+1|0;}c[m>>2]=b;if((a|0)>2)d=Zr(n,j,a,i)|0;else {c[i>>2]=0;d=0;}e=rw(a,a,1,1,2)|0;b=0;while(1){c[m>>2]=b;if((b|0)>=(c[i>>2]|0))break;p=b<<1;c[f>>2]=c[d+(p<<2)>>2];c[g>>2]=c[d+((p|1)<<2)>>2];Nw(e,1,f,g,k)|0;b=(c[m>>2]|0)+1|0;}if((a|0)==2){c[f>>2]=0;c[g>>2]=1;Nw(e,1,f,g,k)|0;b=0;}else b=0;while(1){c[m>>2]=b;if((b|0)>=(a|0))break;Nw(e,1,m,m,k)|0;b=(c[m>>2]|0)+1|0;}a=Cw(e)|0;qw(e);p=vw(a,0)|0;qw(a);U1(d);U1(n);U1(j);l=o;return p|0}function hy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;g=m+8|0;i=m;h[i>>3]=1.0;k=a<<3;j=KK(k)|0;k=KK(k)|0;e=0;while(1){if((e|0)>=(a|0))break;f=O(e,b)|0;h[j+(e<<3)>>3]=+h[d+(f<<3)>>3];h[k+(e<<3)>>3]=+h[d+(f+1<<3)>>3];e=e+1|0;}c[g>>2]=e;e=_r(j,k,a,0)|0;f=rw(a,a,1,1,2)|0;b=0;while(1){c[g>>2]=b;if((b|0)<(a|0))d=1;else {b=0;break}while(1){if((d|0)>=(c[e+(b*12|0)>>2]|0))break;Nw(f,1,g,(c[e+(b*12|0)+4>>2]|0)+(d<<2)|0,i)|0;d=d+1|0;b=c[g>>2]|0;}b=b+1|0;}while(1){c[g>>2]=b;if((b|0)>=(a|0))break;Nw(f,1,g,g,i)|0;b=(c[g>>2]|0)+1|0;}i=vw(Cw(f)|0,0)|0;qw(f);U1(j);U1(k);$r(e);l=m;return i|0}function iy(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;jy(f,c);ky(a,b,c,f);ly(b,f,d);my(f);l=e;return}function jy(a,b){a=a|0;b=b|0;c[a>>2]=KK(b<<4)|0;c[a+4>>2]=b;c[a+8>>2]=0;return}function ky(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;D=l;l=l+64|0;r=D+32|0;u=D+48|0;v=D+16|0;w=D;t=b<<2;A=KK(t)|0;C=KK(t)|0;c[v>>2]=0;c[v+4>>2]=0;c[v+8>>2]=0;c[v+12>>2]=0;s=KK(t)|0;t=KK(t)|0;f=0;while(1){if((f|0)>=(b|0))break;c[s+(f<<2)>>2]=f;f=f+1|0;}q=b+-1|0;it(a,s,0,q);f=0;while(1){if((f|0)>=(b|0))break;c[t+(c[s+(f<<2)>>2]<<2)>>2]=f;f=f+1|0;}oy(u,a,s,b);f=1;while(1){if((f|0)>=(b|0)){f=0;break}c[A+(c[s+(f<<2)>>2]<<2)>>2]=c[s+(f+-1<<2)>>2];f=f+1|0;}while(1){if((f|0)>=(q|0))break;p=f+1|0;c[C+(c[s+(f<<2)>>2]<<2)>>2]=c[s+(p<<2)>>2];f=p;}k=e+8|0;m=e+4|0;n=v+4|0;o=w+4|0;p=w+8|0;j=0;while(1){if((j|0)>=(d|0))break;if(!((py(u,v)|0)<<24>>24))break;f=c[k>>2]|0;b=c[m>>2]|0;if((f|0)<(b|0))b=c[e>>2]|0;else {c[m>>2]=b<<1;b=W1(c[e>>2]|0,b<<5)|0;c[e>>2]=b;f=c[k>>2]|0;}c[k>>2]=f+1;f=b+(f<<4)|0;c[f>>2]=c[v>>2];c[f+4>>2]=c[v+4>>2];c[f+8>>2]=c[v+8>>2];c[f+12>>2]=c[v+12>>2];f=c[v>>2]|0;b=c[t+(f<<2)>>2]|0;g=c[n>>2]|0;i=c[t+(g<<2)>>2]|0;if((b|0)>0?(x=c[s+(b+-1<<2)>>2]|0,y=C+(x<<2)|0,(c[t+(c[y>>2]<<2)>>2]|0)<(i|0)):0){c[w>>2]=x;c[o>>2]=g;h[p>>3]=+h[a+(g<<3)>>3]-+h[a+(x<<3)>>3];c[r>>2]=c[w>>2];c[r+4>>2]=c[w+4>>2];c[r+8>>2]=c[w+8>>2];c[r+12>>2]=c[w+12>>2];qy(u,r);c[y>>2]=g;c[A+(g<<2)>>2]=x;}if((i|0)<(q|0)?(z=c[s+(i+1<<2)>>2]|0,B=A+(z<<2)|0,(c[t+(c[B>>2]<<2)>>2]|0)>(b|0)):0){c[w>>2]=f;c[o>>2]=z;h[p>>3]=+h[a+(z<<3)>>3]-+h[a+(f<<3)>>3];c[r>>2]=c[w>>2];c[r+4>>2]=c[w+4>>2];c[r+8>>2]=c[w+8>>2];c[r+12>>2]=c[w+12>>2];qy(u,r);c[B>>2]=f;c[C+(f<<2)>>2]=z;}j=j+1|0;}U1(A);U1(C);U1(s);U1(t);ry(u);l=D;return}function ly(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;k=KK(a<<2)|0;l=b+8|0;i=c[l>>2]|0;j=(i<<1)+a|0;h=j<<2;e=KK(h)|0;h=KK(h)|0;f=0;while(1){if((f|0)>=(a|0))break;c[k+(f<<2)>>2]=1;f=f+1|0;}f=0;while(1){if((f|0)>=(i|0)){f=0;break}n=c[b>>2]|0;m=c[n+(f<<4)+4>>2]|0;n=k+(c[n+(f<<4)>>2]<<2)|0;c[n>>2]=(c[n>>2]|0)+1;m=k+(m<<2)|0;c[m>>2]=(c[m>>2]|0)+1;f=f+1|0;}while(1){if((f|0)>=(j|0))break;g[h+(f<<2)>>2]=1.0;f=f+1|0;}i=KK(a*20|0)|0;c[d>>2]=i;f=0;while(1){if((f|0)>=(a|0))break;c[i+(f*20|0)>>2]=1;c[i+(f*20|0)+8>>2]=h;c[i+(f*20|0)+4>>2]=e;c[e>>2]=f;g[h>>2]=0.0;n=c[k+(f<<2)>>2]|0;h=h+(n<<2)|0;e=e+(n<<2)|0;f=f+1|0;}U1(k);while(1){e=c[l>>2]|0;if(!e)break;n=e+-1|0;c[l>>2]=n;m=c[b>>2]|0;ny(i,c[m+(n<<4)>>2]|0,c[m+(n<<4)+4>>2]|0);}return}function my(a){a=a|0;U1(c[a>>2]|0);return}function ny(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0;f=a+(b*20|0)|0;h=c[f>>2]|0;i=c[a+(b*20|0)+4>>2]|0;e=0;while(1){if((e|0)>=(h|0)){j=4;break}if((c[i+(e<<2)>>2]|0)==(d|0))break;else e=e+1|0;}if((j|0)==4?(c[f>>2]=h+1,c[i+(h<<2)>>2]=d,i=c[a+(d*20|0)+4>>2]|0,h=a+(d*20|0)|0,j=c[h>>2]|0,c[h>>2]=j+1,c[i+(j<<2)>>2]=b,c[a+8>>2]|0):0){j=c[a+(b*20|0)+8>>2]|0;g[j>>2]=+g[j>>2]+-1.0;j=c[a+(d*20|0)+8>>2]|0;g[j>>2]=+g[j>>2]+-1.0;}return}function oy(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0,k=0,l=0;f=e+-1|0;c[a+4>>2]=f;c[a+8>>2]=f;c[a>>2]=KK(f<<4)|0;e=0;while(1){if((e|0)>=(f|0))break;l=c[d+(e<<2)>>2]|0;g=e+1|0;k=c[d+(g<<2)>>2]|0;j=+h[b+(k<<3)>>3]-+h[b+(l<<3)>>3];i=c[a>>2]|0;c[i+(e<<4)>>2]=l;c[i+(e<<4)+4>>2]=k;h[i+(e<<4)+8>>3]=j;e=g;}e=(f|0)/2|0;while(1){if((e|0)<=-1)break;sy(a,e);e=e+-1|0;}return}function py(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+4|0;if(!(c[d>>2]|0))a=0;else {e=c[a>>2]|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];b=c[a>>2]|0;e=b+((c[d>>2]|0)+-1<<4)|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];c[d>>2]=(c[d>>2]|0)+-1;sy(a,0);a=1;}return a|0}function qy(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;j=a+4|0;g=c[j>>2]|0;d=a+8|0;if((g|0)==(c[d>>2]|0)){c[d>>2]=g<<1;d=W1(c[a>>2]|0,g<<5)|0;c[a>>2]=d;k=a;i=c[j>>2]|0;}else {k=a;i=g;d=c[a>>2]|0;}c[j>>2]=i+1;j=d+(g<<4)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];while(1){if((g|0)<=0)break;d=c[k>>2]|0;e=+h[d+(g<<4)+8>>3];a=g>>>1;f=+h[d+(a<<4)+8>>3];if(!(e>2]|0;}j=d+(g<<4)|0;c[m>>2]=c[j>>2];c[m+4>>2]=c[j+4>>2];c[m+8>>2]=c[j+8>>2];c[m+12>>2]=c[j+12>>2];b=d+(a<<4)|0;c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];j=(c[k>>2]|0)+(a<<4)|0;c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];g=a;}l=n;return}function ry(a){a=a|0;U1(c[a>>2]|0);return}function sy(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;i=m;j=a+4|0;while(1){d=b<<1;g=d|1;if((d|0)<(c[j>>2]|0)){n=c[a>>2]|0;e=+h[n+(d<<4)+8>>3];f=+h[n+(b<<4)+8>>3];if(!(e>2]|0)){n=c[a>>2]|0;e=+h[n+(g<<4)+8>>3];f=+h[n+(d<<4)+8>>3];if(!(e>2]|0;n=g+(d<<4)|0;c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];c[i+12>>2]=c[n+12>>2];g=g+(b<<4)|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];n=(c[a>>2]|0)+(b<<4)|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];b=d;}l=m;return}function ty(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=+d;e=+e;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0.0;l=(f|0)!=0;if(!l){f=KK(b<<3)|0;if(!(ju(a,b,f,b)|0))m=3;else {a=1;m=17;}}else m=3;if((m|0)==3){k=JK(b<<2)|0;c[g>>2]=k;a=0;while(1){if((a|0)>=(b|0))break;c[k+(a<<2)>>2]=a;a=a+1|0;}a=b+-1|0;it(f,k,0,a);n=+h[f+(c[k>>2]<<3)>>3];e=(+h[f+(c[k+(a<<2)>>2]<<3)>>3]-n)*e/+(a|0);e=e=(b|0))break;n=+h[f+(c[k+(g<<2)>>2]<<3)>>3];a=a+(n-d>e&1)|0;g=g+1|0;d=n;}c[j>>2]=a;a:do if(!a){k=KK(4)|0;c[i>>2]=k;c[k>>2]=b;}else {j=KK(a<<2)|0;c[i>>2]=j;a=0;g=1;while(1){if((g|0)>=(b|0))break a;if(+h[f+(c[k+(g<<2)>>2]<<3)>>3]-+h[f+(c[k+(g+-1<<2)>>2]<<3)>>3]>e){c[j+(a<<2)>>2]=g;a=a+1|0;}g=g+1|0;}}while(0);if(l)a=0;else {a=0;m=17;}}if((m|0)==17)U1(f);return a|0}function uy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=c[46930]|0;if(d|0)vn(d);c[46930]=un(b,b,0.0)|0;d=c[46931]|0;if(d|0)U1(d);c[46931]=JK(b<<2)|0;d=c[46932]|0;if(d|0)U1(d);n=JK(b<<3)|0;c[46932]=n;o=c[46930]|0;p=c[46931]|0;i=0;while(1){if((i|0)>=(b|0)){e=10;break}e=a+(i<<2)|0;g=o+(i<<2)|0;f=0.0;d=0;while(1){if((d|0)==(b|0))break;j=+h[(c[e>>2]|0)+(d<<3)>>3];h[(c[g>>2]|0)+(d<<3)>>3]=j;j=+B(+j);f=f>3]=1.0/f;c[p+(i<<2)>>2]=i;i=i+1|0;}a:do if((e|0)==10){m=b+-1|0;d=0;l=0;b:while(1){if((l|0)<(m|0)){e=l;k=d;f=0.0;}else break;while(1){if((e|0)>=(b|0))break;a=c[p+(e<<2)>>2]|0;j=+B(+(+h[(c[o+(a<<2)>>2]|0)+(l<<3)>>3]));j=+h[n+(a<<3)>>3]*j;a=f>2]|0;a=p+(k<<2)|0;c[d>>2]=c[a>>2];c[a>>2]=i;}g=c[o+(c[d>>2]<<2)>>2]|0;a=l+1|0;f=1.0/+h[g+(l<<3)>>3];e=a;while(1){if((e|0)>=(b|0)){d=k;l=a;continue b}i=c[o+(c[p+(e<<2)>>2]<<2)>>2]|0;d=i+(l<<3)|0;j=+h[d>>3]*f;h[d>>3]=j;c:do if(j!=0.0){d=a;while(1){if((d|0)>=(b|0))break c;q=i+(d<<3)|0;h[q>>3]=+h[q>>3]-+h[g+(d<<3)>>3]*j;d=d+1|0;}}while(0);e=e+1|0;}}d=+h[(c[o+(c[p+(m<<2)>>2]<<2)>>2]|0)+(m<<3)>>3]!=0.0&1;}else if((e|0)==15){h[n+(i<<3)>>3]=0.0;d=0;}while(0);return d|0}function vy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0;k=c[46930]|0;l=c[46931]|0;j=0;while(1){if((j|0)>=(d|0)){e=d;break}g=c[l+(j<<2)>>2]|0;i=k+(g<<2)|0;f=0.0;e=0;while(1){if((e|0)==(j|0))break;f=+h[a+(e<<3)>>3]*+h[(c[i>>2]|0)+(e<<3)>>3]+f;e=e+1|0;}h[a+(j<<3)>>3]=+h[b+(g<<3)>>3]-f;j=j+1|0;}while(1){b=e+-1|0;if((e|0)<=0)break;g=l+(b<<2)|0;f=0.0;while(1){if((e|0)>=(d|0))break;f=+h[a+(e<<3)>>3]*+h[(c[k+(c[g>>2]<<2)>>2]|0)+(e<<3)>>3]+f;e=e+1|0;}e=a+(b<<3)|0;h[e>>3]=(+h[e>>3]-f)/+h[(c[k+(c[g>>2]<<2)>>2]|0)+(b<<3)>>3];e=b;}return}function wy(a){a=a|0;var b=0;b=KK(8)|0;c[b>>2]=a;c[b+4>>2]=0;return b|0}function xy(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0)do{d=a;a=c[a+4>>2]|0;e=c[d>>2]|0;if(e|0)tb[b&127](e);U1(d);}while((a|0)!=0);return}function yy(a,b){a=a|0;b=b|0;b=wy(b)|0;c[b+4>>2]=a;return b|0}function zy(a){a=a|0;return c[a>>2]|0}function Ay(a){a=a|0;return c[a+4>>2]|0}function By(a){a=a|0;var b=0;b=KK(12)|0;c[b>>2]=a;c[b+4>>2]=0;c[b+8>>2]=0;return b|0}function Cy(a,b){a=a|0;b=b|0;var d=0,e=0;if(a|0)do{d=a;a=c[a+4>>2]|0;e=c[d>>2]|0;if(e|0)tb[b&127](e);U1(d);}while((a|0)!=0);return}function Dy(a,b){a=a|0;b=b|0;b=By(b)|0;if(a|0){c[b+4>>2]=a;c[a+8>>2]=b;}return b|0}function Ey(a){a=a|0;return c[a>>2]|0}function Fy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if(a|0){e=c[a+4>>2]|0;f=c[a+8>>2]|0;g=c[a>>2]|0;if(g|0)tb[b&127](g);U1(a);if(e|0)c[e+8>>2]=f;c[(f|0?f+4|0:d)>>2]=e;}return}function Gy(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;return}function Hy(a){a=a|0;var b=0;b=JK(64)|0;Gy(b+36|0);c[b+8>>2]=a;return b|0}function Iy(a){a=a|0;if(a|0){cz(c[a+32>>2]|0);U1(a);}return}function Jy(a){a=a|0;return tB(c[a+8>>2]|0)|0}function Ky(a,b){a=a|0;b=b|0;var d=0,e=0;c[b+4>>2]=0;d=a+4|0;e=c[d>>2]|0;c[((e|0)==0?a:e+4|0)>>2]=b;c[d>>2]=b;return}function Ly(a,b){a=a|0;b=b|0;var d=0;d=c[a>>2]|0;if(!d){c[a>>2]=b;a=a+4|0;}else c[b+4>>2]=d;c[a>>2]=b;return}function My(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;Ny(a,b);j=c[b>>2]|0;h=c[j+4>>2]|0;while(1){if(!h)break;k=c[h+8>>2]|0;i=jC(k)|0;d=c[(c[i+16>>2]|0)+112>>2]|0;a=c[d+16+4>>2]|0;d=c[d+8>>2]|0;f=i;i=kC(k,i)|0;while(1){if(!i)break;e=c[(c[i+16>>2]|0)+112>>2]|0;g=c[e+16+4>>2]|0;if((g|0)<(a|0)){f=i;d=c[e+8>>2]|0;a=g;}i=kC(k,i)|0;}i=c[(c[d+16>>2]|0)+112>>2]|0;k=i+4|0;c[k>>2]=c[k>>2]|8;c[h>>2]=f;k=c[h+4>>2]|0;Ky((c[i+12>>2]|0)+36|0,h);h=k;}Gy(b);return j|0}function Ny(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;g=i+8|0;e=c[b+24>>2]|0;if(!((e|0)!=0?(d=tC(a,e,0)|0,(d|0)!=0):0))f=3;a:do if((f|0)==3){e=b+20|0;b:do if(c[e>>2]|0){d=jC(a)|0;while(1){if(!d)break b;if((cP(c[c[(c[d+16>>2]|0)+112>>2]>>2]|0,c[e>>2]|0,0)|0)<<24>>24)break a;d=kC(a,d)|0;}}while(0);d=jC(a)|0;}while(0);if(0);c[g+4>>2]=0;c[g>>2]=0;Oy(a,d,b,1,g);l=i;return}function Oy(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;l=d+8|0;k=c[l>>2]|0;c[l>>2]=k+1;l=b+16|0;c[(c[(c[l>>2]|0)+112>>2]|0)+16+4>>2]=k;c[(c[(c[l>>2]|0)+112>>2]|0)+24>>2]=k;k=(e|0)==0;j=aB(a,b)|0;while(1){if(!j)break;e=c[j>>2]&3;g=c[((e|0)==2?j:j+-48|0)+40>>2]|0;if((g|0)==(b|0)){e=c[((e|0)==3?j:j+48|0)+40>>2]|0;g=c[(c[j+16>>2]|0)+120>>2]|0;if(!(c[g>>2]|0))c[g>>2]=-1;}else {e=c[(c[j+16>>2]|0)+120>>2]|0;if(!(c[e>>2]|0)){c[e>>2]=1;e=g;}else e=g;}g=e+16|0;h=c[(c[g>>2]|0)+112>>2]|0;i=c[h+16+4>>2]|0;do if(!i){c[h+8>>2]=b;Py(f,j);Oy(a,e,d,0,f);i=(c[(c[l>>2]|0)+112>>2]|0)+24|0;c[i>>2]=c[(c[(c[((c[i>>2]|0)<(c[(c[(c[g>>2]|0)+112>>2]|0)+24>>2]|0)?b:e)+16>>2]|0)+112>>2]|0)+24>>2];if((c[(c[(c[g>>2]|0)+112>>2]|0)+24>>2]|0)>=(c[(c[(c[l>>2]|0)+112>>2]|0)+16+4>>2]|0)){e=0;do{h=Qy(f)|0;g=(c[c[(c[h+16>>2]|0)+120>>2]>>2]|0)==1;g=c[((c[h>>2]&3|0)==((g?2:3)|0)?h:h+((g?-1:1)*48|0)|0)+40>>2]|0;if(!(c[(c[(c[g+16>>2]|0)+112>>2]|0)+12>>2]|0)){if(!e)e=Ry(a,d)|0;Sy(e,g);}}while((h|0)!=(j|0));if(e|0){if((c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==0?(Jy(e)|0)>1:0)Sy(e,b);if(!k?(c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==(e|0):0){Ly(d,e);break}Ky(d,e);}}}else {g=c[(c[l>>2]|0)+112>>2]|0;if((c[g+8>>2]|0)!=(e|0)){h=g+24|0;g=c[h>>2]|0;c[h>>2]=(g|0)<(i|0)?g:i;}}while(0);j=bB(a,j,b)|0;}if(!k?(c[(c[(c[l>>2]|0)+112>>2]|0)+12>>2]|0)==0:0){l=Ry(a,d)|0;Sy(l,b);Ly(d,l);}return}function Py(a,b){a=a|0;b=b|0;c[(c[(c[b+16>>2]|0)+120>>2]|0)+4>>2]=c[a>>2];c[a>>2]=b;b=a+4|0;c[b>>2]=(c[b>>2]|0)+1;return}function Qy(a){a=a|0;var b=0,d=0,e=0;b=c[a>>2]|0;if(!b)qa(138394,96254,65,96266);d=a+4|0;e=c[d>>2]|0;if((e|0)>0){c[a>>2]=c[(c[(c[b+16>>2]|0)+120>>2]|0)+4>>2];c[d>>2]=e+-1;return b|0}else qa(96244,96254,61,96266);return 0}function Ry(a,b){a=a|0;b=b|0;return Hy(Ty(a,b)|0)|0}function Sy(a,b){a=a|0;b=b|0;oC(c[a+8>>2]|0,b,1)|0;c[(c[(c[b+16>>2]|0)+112>>2]|0)+12>>2]=a;return}function Ty(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+144|0;f=d;e=d+8|0;g=b+12|0;b=c[g>>2]|0;c[g>>2]=b+1;c[f>>2]=b;m4(e,96234,f)|0;b=ND(a,e,1)|0;TC(b,137483,280,1)|0;l=d;return b|0}function Uy(a){a=a|0;var b=0,d=0;b=c[a+36>>2]|0;while(1){if(!b)break;d=c[b+4>>2]|0;Uy(b);b=d;}Iy(a);return}function Vy(a,b,c){a=a|0;b=b|0;c=c|0;Wy(a,b,+h[c+32>>3]);return}function Wy(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;e=b+36|0;f=0;while(1){e=c[e>>2]|0;if(!e)break;Wy(a,e,d);e=e+4|0;f=f+1|0;}e=mz(a,b,d)|0;c[b+32>>2]=e;a=jz(e)|0;if((f|0)>0)d=+Xy(f,a,e,b,d);else d=3.141592653589793;if((((a|0)==1?(g=c[b>>2]|0,g|0):0)?c[(c[(c[g+16>>2]|0)+112>>2]|0)+8>>2]|0:0)?(i=b+48|0,h[i>>3]=d,d<0.0):0)h[i>>3]=d+6.283185307179586;return}function Xy(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+48|0;t=v;u=JK(a*56|0)|0;c[t+40>>2]=c[e+36>>2];p=e+16|0;j=+h[p>>3];q=t+8|0;h[q>>3]=j;h[t>>3]=j;c[t+44>>2]=c[e>>2];j=6.283185307179586/+(b|0);h[t+16>>3]=j;r=t+24|0;h[r>>3]=-1.0;s=t+32|0;h[s>>3]=-1.0;k=0;o=0;g=0.0;while(1){i=c[d>>2]|0;if(!i)break;d=c[i>>2]|0;if(!(c[(c[(c[d+16>>2]|0)+112>>2]|0)+4>>2]&8))d=o;else {n=u+(o*56|0)|0;c[n>>2]=d;h[u+(o*56|0)+8>>3]=j*+(k|0);d=o+1|0;g=+Yy(n,t,f);}k=k+1|0;o=d;d=i+4|0;}a:do switch(o|0){case 1:{h[u+40>>3]=1.0;d=0;break}case 2:{j=+h[u+64>>3]-+h[u+8>>3];Zy(u,u+56|0,j>3.141592653589793?6.283185307179586-j:j);d=0;break}default:{n=u+8|0;m=u;d=0;while(1){if((d|0)>=(o|0)){d=0;break a}d=d+1|0;if((d|0)==(o|0)){i=u;j=+h[n>>3]+6.283185307179586-+h[m+8>>3];k=m+56|0;}else {k=m+56|0;i=k;j=+h[m+64>>3]-+h[m+8>>3];}Zy(m,i,j);m=k;}}}while(0);while(1){if((d|0)>=(o|0))break;_y(u+(d*56|0)|0,t,b,f);d=d+1|0;}U1(u);if((a|0)==1){f=g+f*.5;$y(e,-f,0.0,0.0);h[p>>3]=+h[p>>3]+f;u=e+56|0;c[u>>2]=c[u>>2]|1;}else h[p>>3]=+h[q>>3];l=v;return +((+h[s>>3]+ +h[r>>3])*.5+-3.141592653589793)}function Yy(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0.0,g=0.0,i=0,j=0,k=0.0;i=0;f=0.0;g=0.0;e=b+40|0;while(1){j=c[e>>2]|0;if(!j)break;e=c[j>>2]|0;if(!e)e=0;else e=c[(c[(c[e+16>>2]|0)+112>>2]|0)+8>>2]|0;if((e|0)==(c[a>>2]|0)){k=+h[j+16>>3];e=i+1|0;f=f+d+k*2.0;g=g>3]=f;c[a+48>>2]=i;h[a+16>>3]=g+d+ +h[b>>3];h[a+24>>3]=g;return +g}function Zy(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0.0;e=+h[b+16>>3];d=+h[a+16>>3];c=(d*+h[b+32>>3]+e*+h[a+32>>3])/(c*2.0*e*d);c=c<1.0?1.0:c;a=a+40|0;if(c>+h[a>>3])h[a>>3]=c;a=b+40|0;if(c>+h[a>>3])h[a>>3]=c;return}function _y(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0.0,g=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0.0,v=0.0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0.0,G=0.0;z=b+8|0;y=+h[z>>3];A=b+24|0;k=+h[A>>3];B=b+32|0;j=+h[B>>3];f=+h[a+16>>3]*+h[a+40>>3];x=(d|0)==1;if(x){v=+h[a+32>>3];g=v*.15915494309189535;g=f>g?f:g;f=g*6.283185307179586-v;if(f>0.0){e=f/+(c[a+48>>2]|0)+e;l=0.0;f=g;}else {l=0.0;f=g;}}else l=+h[a+8>>3]-+h[a+32>>3]/(f*2.0);q=+h[a+24>>3]+f;r=q>y;s=a+48|0;t=((c[s>>2]|0)+1|0)/2|0;u=1.0/f;v=e/f*.5;w=a+8|0;n=b+40|0;o=0;p=0.0;g=l;while(1){n=c[n>>2]|0;if(!n)break;i=c[n>>2]|0;if(!i)i=0;else i=c[(c[(c[i+16>>2]|0)+112>>2]|0)+8>>2]|0;if((i|0)==(c[a>>2]|0)?(jz(c[n+32>>2]|0)|0)>=1:0){l=+h[n+16>>3];m=l*u;do if(!x)if((c[s>>2]|0)==1){g=+h[w>>3];break}else {g=g+v+m;break}else {if(g!=0.0)g=(c[s>>2]|0)==2?3.141592653589793:m+g;j=g;k=k<0.0?g:k;}while(0);G=+E(+g)*f;D=+F(+g)*f;$y(n,G,D,+az(n,G,D,g));g=(x?(l+e)*u:m+v)+g;o=o+1|0;i=o;l=(o|0)==(t|0)?g:p;}else {i=o;l=p;}n=n+4|0;o=i;p=l;}f=r?q:y;if((d|0)>1?(C=c[a>>2]|0,(C|0)==(c[b+44>>2]|0)):0)h[(c[(c[C+16>>2]|0)+112>>2]|0)+24>>3]=p;h[z>>3]=f;h[A>>3]=k;h[B>>3]=j;return}function $y(a,b,d,e){a=a|0;b=+b;d=+d;e=+e;var f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0.0;m=c[a+8>>2]|0;n=e!=0.0;f=jC(m)|0;while(1){if(!f)break;k=c[(c[f+16>>2]|0)+132>>2]|0;i=+h[k>>3];l=k+8|0;g=+h[l>>3];if(n){o=+E(+e);p=+F(+e);j=o*i-p*g;g=p*i+o*g;}else j=i;h[k>>3]=j+b;h[l>>3]=g+d;f=kC(m,f)|0;}f=a+36|0;while(1){f=c[f>>2]|0;if(!f)break;$y(f,b,d,e);f=f+4|0;}return}function az(a,b,d,e){a=a|0;b=+b;d=+d;e=+e;var f=0.0,g=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0;m=c[a+8>>2]|0;f=+h[a+48>>3];do if(!(f>=0.0)){if((jz(c[a+32>>2]|0)|0)==2){f=e+-1.5707963267948966;break}l=c[a>>2]|0;n=l+16|0;i=c[(c[n>>2]|0)+132>>2]|0;f=+h[i>>3]+b;k=+h[i+8>>3]+d;f=k*k+f*f;i=jC(m)|0;g=l;while(1){if(!i)break;if((i|0)!=(l|0)?(o=c[(c[i+16>>2]|0)+132>>2]|0,j=+h[o>>3]+b,k=+h[o+8>>3]+d,j=k*k+j*j,j>3];k=+h[a+16>>3]-j;g=c[n>>2]|0;i=c[g+132>>2]|0;f=+h[i>>3];if(f>-k?(c[a+56>>2]&1|0)!=0:0){d=+C(+(d*d+b*b));b=+K(+(+h[i+8>>3]),+(f+k));f=+E(+b);f=e+1.5707963267948966-b-+I(+((k-j/f)/d*f));break}else {f=+K(+(+h[i+8>>3]),+f);f=e+3.141592653589793-f-+h[(c[g+112>>2]|0)+24>>3];f=f>6.283185307179586?f+-6.283185307179586:f;break}}else f=0.0;}else {f=3.141592653589793-f+e;f=f<0.0?f+6.283185307179586:f;}while(0);return +f}function bz(){return JK(12)|0}function cz(a){a=a|0;var b=0,d=0;if(a|0){b=c[a>>2]|0;while(1){if(!b)break;d=c[b+4>>2]|0;U1(b);b=d;}U1(a);}return}function dz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=ez(d)|0;d=a+8|0;c[d>>2]=(c[d>>2]|0)+1;d=a+4|0;e=c[d>>2]|0;if((b|0)==0|(e|0)==(b|0)){c[(e|0?e+4|0:a)>>2]=f;c[f+8>>2]=e;e=0;}else {e=b+4|0;d=c[e>>2]|0;c[e>>2]=f;c[f+8>>2]=b;e=d;d=d+8|0;}c[d>>2]=f;c[f+4>>2]=e;return}function ez(a){a=a|0;var b=0;b=JK(12)|0;c[b>>2]=a;return b|0}function fz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=c[a>>2]|0;d=b;while(1){if(!b)break;g=b+4|0;e=c[g>>2]|0;f=b+8|0;c[g>>2]=c[f>>2];c[f>>2]=e;b=e;}f=a+4|0;g=c[f>>2]|0;c[f>>2]=d;c[a>>2]=g;return a|0}function gz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[a>>2]|0;if((d|0)!=(b|0)){f=b+8|0;e=c[f>>2]|0;c[a>>2]=b;c[f>>2]=0;b=a+4|0;a=c[b>>2]|0;c[a+4>>2]=d;c[d+8>>2]=a;c[b>>2]=e;c[e+4>>2]=0;}return}function hz(a){a=a|0;var b=0,d=0,e=0;d=bz()|0;e=d+4|0;b=0;while(1){a=c[a>>2]|0;if(!a)break;dz(d,b,c[a>>2]|0);b=c[e>>2]|0;a=a+4|0;}return d|0}function iz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=a;while(1){j=c[f>>2]|0;if(!j){k=6;break}if((c[j>>2]|0)==(b|0))break;f=j+4|0;}if((k|0)==6)qa(96270,96277,217,96288);i=j+8|0;f=c[i>>2]|0;g=j+4|0;b=c[g>>2]|0;c[(f|0?f+4|0:a)>>2]=b;h=a+4|0;c[(b|0?b+8|0:h)>>2]=f;b=0;f=a;while(1){f=c[f>>2]|0;if(!f)break;if((c[f>>2]|0)==(d|0)){k=9;break}b=f;f=f+4|0;}if((k|0)==9){do if(!e)if((f|0)==(c[a>>2]|0)){c[a>>2]=j;c[g>>2]=f;c[i>>2]=0;f=f+8|0;break}else {c[b+4>>2]=j;c[i>>2]=b;c[g>>2]=f;f=f+8|0;break}else if((f|0)==(c[h>>2]|0)){c[h>>2]=j;c[g>>2]=0;c[i>>2]=f;f=f+4|0;break}else {c[i>>2]=f;f=f+4|0;c[g>>2]=c[f>>2];c[(c[f>>2]|0)+8>>2]=j;break}while(0);c[f>>2]=j;}return}function jz(a){a=a|0;return c[a+8>>2]|0}function kz(a,b){a=a|0;b=b|0;lz(a,fz(b)|0);U1(b);return}function lz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[b>>2]|0;if(d|0){e=a+4|0;f=c[e>>2]|0;c[f+4>>2]=d;c[d+8>>2]=f;c[e>>2]=c[b+4>>2];d=a+8|0;c[d>>2]=(c[d>>2]|0)+(c[b+8>>2]|0);}return}function mz(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0;m=c[b+8>>2]|0;nz(a,b);l=oz(m)|0;a=qz(pz(l)|0)|0;rz(m,a);m=sz(a,m)|0;a=jz(m)|0;j=+tz(m);k=(a|0)==1;f=+(a|0);i=f*.15915494309189535*(j+d);g=k?0.0:i;a=m;while(1){a=c[a>>2]|0;if(!a)break;if(c[(c[(c[(c[a>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&8|0){e=4;break}a=a+4|0;}if((e|0)==4)gz(m,a);d=1.0/f;e=0;a=m;while(1){a=c[a>>2]|0;if(!a)break;n=(c[a>>2]|0)+16|0;c[(c[(c[n>>2]|0)+112>>2]|0)+16>>2]=e;h[(c[(c[n>>2]|0)+112>>2]|0)+24>>3]=0.0;f=6.283185307179586*d*+(e|0);o=+E(+f)*g;n=c[(c[n>>2]|0)+132>>2]|0;h[n>>3]=o;h[n+8>>3]=+F(+f)*g;e=e+1|0;a=a+4|0;}o=k?j*.5:i;h[b+16>>3]=o;h[b+24>>3]=o;h[b+48>>3]=-1.0;sB(l)|0;return m|0}function nz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[b+8>>2]|0;d=jC(f)|0;while(1){if(!d)break;e=XA(a,d)|0;while(1){if(!e)break;if((c[(c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0)+12>>2]|0)==(b|0))mB(f,e,1)|0;e=ZA(a,e)|0;}d=kC(f,d)|0;}return}function oz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;g=k;f=zz(a,g)|0;g=c[g>>2]|0;i=tB(g)|0;h=Az(g)|0;i=i+-3|0;e=0;while(1){if((e|0)>=(i|0))break;j=Jz(h)|0;d=aB(g,j)|0;while(1){if(!d)break;b=c[d>>2]&3;a=c[((b|0)==2?d:d+-48|0)+40>>2]|0;if((j|0)==(a|0))a=c[((b|0)==3?d:d+48|0)+40>>2]|0;Iz(h,a);d=bB(g,d,j)|0;}Bz(g,j,f);d=aB(g,j)|0;while(1){if(!d)break;b=c[d>>2]&3;a=c[((b|0)==2?d:d+-48|0)+40>>2]|0;if((j|0)==(a|0))a=c[((b|0)==3?d:d+48|0)+40>>2]|0;b=(c[a+16>>2]|0)+236|0;c[b>>2]=(c[b>>2]|0)+-1;Hz(h,a);d=bB(g,d,j)|0;}wC(g,j)|0;e=e+1|0;}sB(g)|0;Gz(h);l=k;return f|0}function pz(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+144|0;b=f;e=f+8|0;d=c[46933]|0;c[46933]=d+1;c[b>>2]=d;m4(e,96303,b)|0;e=ND(a,e,1)|0;TC(e,137483,280,1)|0;b=jC(a)|0;while(1){if(!b)break;oC(e,b,1)|0;d=b+16|0;c[(c[(c[d>>2]|0)+112>>2]|0)+16+12>>2]=0;c[(c[(c[d>>2]|0)+112>>2]|0)+32>>2]=0;d=(c[(c[d>>2]|0)+112>>2]|0)+4|0;c[d>>2]=c[d>>2]&-2;b=kC(a,b)|0;}b=jC(a)|0;while(1){if(!b)break;d=c[(c[b+16>>2]|0)+112>>2]|0;if(!(c[d+4>>2]&1)){c[d+16>>2]=0;yz(a,b,e);}b=kC(a,b)|0;}l=f;return e|0}function qz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((tB(a)|0)!=1){d=jC(a)|0;while(1){if(!d)break;b=0;e=aB(a,d)|0;while(1){if(!e)break;b=b+1|0;e=bB(a,e,d)|0;}if((b|0)==1)xz(d,d,0,0);d=kC(a,d)|0;}b=0;f=0;d=jC(a)|0;while(1){if(!d)break;g=c[(c[d+16>>2]|0)+112>>2]|0;g=(c[g+32>>2]|0)+(c[g+16+12>>2]|0)|0;e=(g|0)>(b|0);b=e?g:b;f=e?d:f;d=kC(a,d)|0;}b=bz()|0;e=f+16|0;d=(c[(c[e>>2]|0)+112>>2]|0)+16+4|0;while(1){d=c[d>>2]|0;if((d|0)==(f|0))break;dz(b,0,d);d=c[(c[d+16>>2]|0)+112>>2]|0;g=d+4|0;c[g>>2]=c[g>>2]|16;d=d+16|0;}dz(b,0,f);g=c[(c[e>>2]|0)+112>>2]|0;a=g+4|0;c[a>>2]=c[a>>2]|16;if(c[g+32>>2]|0){a=bz()|0;d=(c[(c[e>>2]|0)+112>>2]|0)+24|0;while(1){d=c[d>>2]|0;if((d|0)==(f|0))break;dz(a,0,d);d=c[(c[d+16>>2]|0)+112>>2]|0;g=d+4|0;c[g>>2]=c[g>>2]|16;d=d+16|0;}kz(b,a);}}else {b=bz()|0;g=jC(a)|0;dz(b,0,g);g=(c[(c[g+16>>2]|0)+112>>2]|0)+4|0;c[g>>2]=c[g>>2]|16;}return b|0}function rz(a,b){a=a|0;b=b|0;var d=0;d=jC(a)|0;while(1){if(!d)break;if(!(c[(c[(c[d+16>>2]|0)+112>>2]|0)+4>>2]&16))wz(a,d,b);d=kC(a,d)|0;}return}function sz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;d=uz(a,b)|0;c[f>>2]=d;a:do if(d){e=0;while(1){if((e|0)>=10)break a;a=vz(a,b,f)|0;h=d;d=c[f>>2]|0;if((h|0)==(d|0)|(d|0)==0)break;else e=e+1|0;}}while(0);l=g;return a|0}function tz(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0;b=0.0;while(1){a=c[a>>2]|0;if(!a)break;f=c[(c[c[(c[(c[a>>2]|0)+16>>2]|0)+112>>2]>>2]|0)+16>>2]|0;d=+h[f+32>>3];d=d>b?d:b;e=+h[f+40>>3];b=e>d?e:d;a=a+4|0;}return +b}function uz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;k=Kz()|0;e=jC(b)|0;while(1){if(!e)break;d=XA(b,e)|0;while(1){if(!d)break;c[c[(c[d+16>>2]|0)+120>>2]>>2]=0;d=ZA(b,d)|0;}e=kC(b,e)|0;}j=1;d=0;while(1){h=c[a>>2]|0;if(!h)break;i=c[h>>2]|0;g=aB(b,i)|0;while(1){if(!g)break;f=g+16|0;if((c[c[(c[f>>2]|0)+120>>2]>>2]|0)>0){a=nb[c[k>>2]&63](k,0,128)|0;while(1){if(!a)break;e=c[a+8>>2]|0;if((c[c[(c[e+16>>2]|0)+120>>2]>>2]|0)>(c[c[(c[f>>2]|0)+120>>2]>>2]|0)?(l=c[e>>2]&3,(c[((l|0)==2?e:e+-48|0)+40>>2]|0)!=(i|0)):0)d=d+((c[((l|0)==3?e:e+48|0)+40>>2]|0)!=(i|0)&1)|0;a=nb[c[k>>2]&63](k,a,8)|0;}Qz(k,g);}g=bB(b,g,i)|0;}e=aB(b,i)|0;while(1){if(!e)break;a=c[(c[e+16>>2]|0)+120>>2]|0;if(!(c[a>>2]|0)){c[a>>2]=j;Pz(k,e);}e=bB(b,e,i)|0;}a=h+4|0;j=j+1|0;}Oz(k);return d|0}function vz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[d>>2]|0;k=jC(b)|0;a:while(1){if(!k)break;j=aB(b,k)|0;while(1){if(!j)break;g=c[j>>2]&3;f=c[((g|0)==3?j:j+48|0)+40>>2]|0;if((f|0)==(k|0))f=c[((g|0)==2?j:j+-48|0)+40>>2]|0;i=0;while(1){if((i|0)>=2)break;h=hz(a)|0;iz(a,k,f,i);g=uz(a,b)|0;if((g|0)<(e|0)){cz(h);if(!g){e=0;break a}else e=g;}else {cz(a);a=h;}i=i+1|0;}j=bB(b,j,k)|0;}k=kC(b,k)|0;}c[d>>2]=e;return a|0}function wz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=bz()|0;e=XA(a,b)|0;while(1){if(!e)break;f=e+-48|0;dz(h,0,c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0);f=(c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[f>>2]=c[f>>2]|32;e=ZA(a,e)|0;}e=_A(a,b)|0;while(1){if(!e)break;f=e+48|0;dz(h,0,c[((c[e>>2]&3|0)==3?e:f)+40>>2]|0);f=(c[(c[(c[((c[e>>2]&3|0)==3?e:f)+40>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[f>>2]=c[f>>2]|32;e=$A(a,e)|0;}a:do if((jz(h)|0)>1){f=d+4|0;a=d;while(1){e=c[a>>2]|0;if(!e){g=13;break a}a=e+4|0;if(!(c[(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32))continue;if(c[(c[(c[(c[c[((e|0)==(c[f>>2]|0)?d:a)>>2]>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32|0)break}dz(d,e,b);}else g=13;while(0);b:do if((g|0)==13){c:do if((jz(h)|0)>0){e=d;while(1){e=c[e>>2]|0;if(!e)break c;if(c[(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4>>2]&32|0)break;e=e+4|0;}dz(d,e,b);break b}while(0);dz(d,0,b);}while(0);e=h;while(1){e=c[e>>2]|0;if(!e)break;d=(c[(c[(c[e>>2]|0)+16>>2]|0)+112>>2]|0)+4|0;c[d>>2]=c[d>>2]&-33;e=e+4|0;}cz(h);return}function xz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;while(1){g=c[(c[(c[b+16>>2]|0)+112>>2]|0)+16>>2]|0;if(!g)break;h=d+1|0;i=g+16|0;j=c[(c[i>>2]|0)+112>>2]|0;b=j+16|0;f=c[b+12>>2]|0;if(f){if((f|0)>(d|0)){k=11;break}b=c[b+4>>2]|0;f=b;if((b|0)==(e|0))b=j;else {d=j+24|0;if(!((c[j+32>>2]|0)!=0?(c[d>>2]|0)==(e|0):0))e=b;c[d>>2]=f;b=c[(c[i>>2]|0)+112>>2]|0;c[b+32>>2]=c[b+16+12>>2];b=c[(c[i>>2]|0)+112>>2]|0;}b=b+16|0;}c[b+4>>2]=a;c[(c[(c[i>>2]|0)+112>>2]|0)+16+12>>2]=h;b=g;d=h;}if((k|0)==11?(c[j+32>>2]|0)<=(d|0):0){c[j+24>>2]=a;c[(c[(c[i>>2]|0)+112>>2]|0)+32>>2]=h;}return}function yz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=(c[(c[b+16>>2]|0)+112>>2]|0)+4|0;c[g>>2]=c[g>>2]|1;g=aB(a,b)|0;while(1){if(!g)break;f=c[g>>2]&3;e=c[((f|0)==2?g:g+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((f|0)==3?g:g+48|0)+40>>2]|0;f=e+16|0;if(!(c[(c[(c[f>>2]|0)+112>>2]|0)+4>>2]&1)){mB(d,g,1)|0;c[(c[(c[f>>2]|0)+112>>2]|0)+16>>2]=b;yz(a,e,d);}g=bB(a,g,b)|0;}return}function zz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;k=l;l=l+144|0;j=k+8|0;i=k;e=k+16|0;h=c[46934]|0;c[46934]=h+1;c[i>>2]=h;m4(e,96312,i)|0;i=ND(b,e,1)|0;TC(i,137483,280,1)|0;h=c[46934]|0;c[46934]=h+1;c[j>>2]=h;m4(e,96312,j)|0;h=b+24|0;a[j>>0]=a[h>>0]|0;a[j+1>>0]=a[h+1>>0]|0;a[j+2>>0]=a[h+2>>0]|0;a[j+3>>0]=a[h+3>>0]|0;j=oB(e,j,0)|0;e=jC(b)|0;while(1){if(!e)break;oC(i,e,1)|0;h=tC(j,KB(e)|0,1)|0;TC(h,137447,304,1)|0;c[(c[(c[e+16>>2]|0)+112>>2]|0)+16>>2]=h;e=kC(b,e)|0;}f=jC(b)|0;while(1){if(!f)break;g=c[(c[(c[f+16>>2]|0)+112>>2]|0)+16>>2]|0;h=g+16|0;e=XA(b,f)|0;while(1){if(!e)break;mB(i,e,1)|0;m=c[(c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0)+16>>2]|0;n=iB(j,g,m,0,1)|0;TC(n,137460,176,1)|0;c[(c[n+16>>2]|0)+116>>2]=e;n=(c[h>>2]|0)+236|0;c[n>>2]=(c[n>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;e=ZA(b,e)|0;}f=kC(b,f)|0;}c[d>>2]=j;l=k;return i|0}function Az(a){a=a|0;var b=0,c=0;c=Cz()|0;b=jC(a)|0;while(1){if(!b)break;Hz(c,b);b=kC(a,b)|0;}return c|0}function Bz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=c[(c[b+16>>2]|0)+236>>2]|0;p=m<<2;o=KK(p)|0;p=KK(p)|0;i=0;l=aB(a,b)|0;n=0;f=0;while(1){if(!l)break;e=c[l>>2]&3;g=c[((e|0)==2?l:l+-48|0)+40>>2]|0;if((g|0)==(b|0))g=c[((e|0)==3?l:l+48|0)+40>>2]|0;h=0;k=aB(a,b)|0;j=i;while(1){if(!k)break;if((k|0)!=(l|0)){i=c[k>>2]&3;e=c[((i|0)==2?k:k+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((i|0)==3?k:k+48|0)+40>>2]|0;i=iB(a,g,e,0,0)|0;if(i)if(g>>>0>>0){e=j+1|0;h=i+16|0;i=c[(c[h>>2]|0)+116>>2]|0;if(!i)h=1;else {wC(d,i)|0;c[(c[h>>2]|0)+116>>2]=0;h=1;}}else {h=1;e=j;}else e=j;}else e=j;k=bB(a,k,b)|0;j=e;}if(!h){c[p+(n<<2)>>2]=g;e=n+1|0;}else {c[o+(f<<2)>>2]=g;e=n;f=f+1|0;}i=j;l=bB(a,l,b)|0;n=e;}e=m+-1-i|0;a:do if((e|0)>0){if((e|0)<(n|0))g=0;else {if((e|0)!=(n|0))break;f=c[o>>2]|0;g=f+16|0;e=0;while(1){if((e|0)>=(n|0))break a;m=c[p+(e<<2)>>2]|0;TC(iB(a,f,m,0,1)|0,137460,176,1)|0;d=(c[g>>2]|0)+236|0;c[d>>2]=(c[d>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;e=e+1|0;}}while(1){if((g|0)>=(n|0)){f=2;break}f=g|1;if((f|0)>=(n|0)){f=2;break}d=c[p+(g<<2)>>2]|0;m=c[p+(f<<2)>>2]|0;TC(iB(a,d,m,0,1)|0,137460,176,1)|0;d=(c[d+16>>2]|0)+236|0;c[d>>2]=(c[d>>2]|0)+1;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;g=g+2|0;e=e+-1|0;}while(1){if((e|0)<=0)break a;m=c[p>>2]|0;n=c[p+(f<<2)>>2]|0;TC(iB(a,m,n,0,1)|0,137460,176,1)|0;m=(c[m+16>>2]|0)+236|0;c[m>>2]=(c[m>>2]|0)+1;n=(c[n+16>>2]|0)+236|0;c[n>>2]=(c[n>>2]|0)+1;f=f+1|0;e=e+-1|0;}}while(0);U1(p);U1(o);return}function Cz(){return Vz(18240,c[4581]|0)|0}function Dz(a,b,d){a=a|0;b=b|0;d=d|0;d=KK(16)|0;c[d+12>>2]=0;c[d+8>>2]=c[b+8>>2];return d|0}function Ez(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Fz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return ((b|0)<(e|0)?-1:(b|0)>(e|0)&1)|0}function Gz(a){a=a|0;Rz(a)|0;return}function Hz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;f=d;e=b+16|0;c[f+8>>2]=c[(c[e>>2]|0)+236>>2];a=(nb[c[a>>2]&63](a,f,1)|0)+12|0;c[(c[e>>2]|0)+164>>2]=c[a>>2];c[a>>2]=b;l=d;return}function Iz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=b+16|0;c[g+8>>2]=c[(c[f>>2]|0)+236>>2];g=nb[c[a>>2]&63](a,g,4)|0;if(!g)qa(96322,96325,107,96335);e=g+12|0;d=c[e>>2]|0;if((d|0)==(b|0)){b=c[(c[f>>2]|0)+164>>2]|0;c[e>>2]=b;if(!b)nb[c[a>>2]&63](a,g,2)|0;}else {do{a=(c[d+16>>2]|0)+164|0;d=c[a>>2]|0;e=(d|0)!=0;}while(e&(d|0)!=(b|0));if(e)c[a>>2]=c[(c[d+16>>2]|0)+164>>2];}l=h;return}function Jz(a){a=a|0;var b=0,d=0,e=0,f=0;d=nb[c[a>>2]&63](a,0,128)|0;if(d){f=d+12|0;b=c[f>>2]|0;e=c[(c[b+16>>2]|0)+164>>2]|0;c[f>>2]=e;if(!e)nb[c[a>>2]&63](a,d,2)|0;}else b=0;return b|0}function Kz(){return Vz(18276,c[4581]|0)|0}function Lz(a,b,d){a=a|0;b=b|0;d=d|0;d=KK(12)|0;c[d+8>>2]=c[b+8>>2];return d|0}function Mz(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Nz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b>>2]|0;e=c[d>>2]|0;return (b>>>0>e>>>0?1:(b>>>0>>0)<<31>>31)|0}function Oz(a){a=a|0;Rz(a)|0;return}function Pz(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e+8>>2]=b;nb[c[a>>2]&63](a,e,1)|0;l=d;return}function Qz(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e+8>>2]=b;nb[c[a>>2]&63](a,e,2)|0;l=d;return}function Rz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;do if((a|0)!=0?(c[a+24>>2]|0)<=0:0){h=c[a+4>>2]|0;g=h+32|0;b=c[g>>2]|0;if(b){b=ob[b&127](a,2,0,h)|0;if((b|0)<0){b=-1;break}}else b=0;if(c[a+28>>2]|0)_z(a,0)|0;f=(b|0)==0;if(f){nb[c[c[a+16>>2]>>2]&63](a,0,64)|0;if((Xz(a)|0)>0){b=-1;break}d=a+8|0;b=c[d>>2]|0;if((c[b+12>>2]|0)>0){e=a+12|0;ob[c[e>>2]&127](a,c[b+8>>2]|0,0,h)|0;b=c[d>>2]|0;}else e=a+12|0;ob[c[e>>2]&127](a,b,0,h)|0;}b=c[a+20>>2]|0;if(b){if(f&(b|0)==1)ob[c[a+12>>2]&127](a,a,0,h)|0;}else U1(a);b=c[g>>2]|0;if(!b)b=0;else {ob[b&127](a,6,0,h)|0;b=0;}}else b=-1;while(0);return b|0}function Sz(a){a=a|0;var b=0,d=0,e=0;e=a+8|0;b=c[e>>2]|0;d=c[b>>2]|0;a:do if(!(d&12)){if(!(d&3)){d=b+8|0;a=c[d>>2]|0;c[d>>2]=0;break}a=Tz(a)|0;d=c[e>>2]|0;b=c[d+8>>2]|0;d=b+(c[d+12>>2]<<2)|0;while(1){if(b>>>0>=d>>>0)break a;c[b>>2]=0;b=b+4|0;}}else a=c[b+4>>2]|0;while(0);e=c[e>>2]|0;c[e>>2]=c[e>>2]&-4097;c[e+16>>2]=0;c[e+4>>2]=0;return a|0}function Tz(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=a+8|0;a=c[g>>2]|0;b=c[a>>2]|0;if(!(b&4096)){a:do if(!(b&3)){if(b&112|0){a=c[a+8>>2]|0;break}a=c[a+4>>2]|0;if(!a)a=0;else {while(1){b=a+4|0;d=c[b>>2]|0;if(!d){e=a;break}c[b>>2]=c[d>>2];c[d>>2]=a;a=d;}while(1){b=c[e>>2]|0;if(!b)break a;d=c[b+4>>2]|0;if(!d){e=b;continue}while(1){c[b+4>>2]=c[d>>2];c[d>>2]=b;b=c[d+4>>2]|0;if(!b)break;else {f=d;d=b;b=f;}}c[e>>2]=d;e=d;}}}else {e=c[a+8>>2]|0;f=e+(c[a+12>>2]<<2)|0;b=0;a=0;while(1){if(e>>>0>=f>>>0)break a;d=c[e>>2]|0;if(d){if(!b){b=d;a=d;}else c[b>>2]=d;while(1){d=c[b>>2]|0;if(!d)break;else b=d;}c[e>>2]=b;}e=e+4|0;}}while(0);g=c[g>>2]|0;c[g+4>>2]=a;c[g>>2]=c[g>>2]|4096;}else a=c[a+4>>2]|0;return a|0}function Uz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;s=a+8|0;if(c[c[s>>2]>>2]&4096|0)Wz(a,0)|0;r=c[a+4>>2]|0;m=c[r>>2]|0;n=c[r+4>>2]|0;q=r+8|0;u=c[q>>2]|0;o=c[r+20>>2]|0;p=a+20|0;f=c[p>>2]&-32769;c[p>>2]=f;a:do if(!b){if(d&384|0){f=c[s>>2]|0;e=c[f+8>>2]|0;if(!e){e=0;break}if(d&256){e=c[e+4>>2]|0;c[f+4>>2]=e;if(!e){e=0;break}}else c[f+4>>2]=e;if((u|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-u)|0;break}}if(d&4098|0){e=c[s>>2]|0;if(c[e>>2]&144|0){e=0;break}e=c[e+8>>2]|0;if(!e){e=0;break}else {h=e;t=84;break}}if(!(d&64))e=0;else {i=r+16|0;b:do if((c[i>>2]|0)!=0|(u|0)<0){j=a+12|0;k=(u|0)<0;f=0-u|0;e=c[(c[s>>2]|0)+8>>2]|0;while(1){if(!e)break b;g=c[e>>2]|0;h=c[i>>2]|0;if(h|0){if(k)b=c[e+8>>2]|0;else b=e+f|0;vb[h&127](a,b,r);}if((c[q>>2]|0)>=0){e=g;continue}ob[c[j>>2]&127](a,e,0,r)|0;e=g;}}while(0);e=c[s>>2]|0;c[e+4>>2]=0;c[e+8>>2]=0;c[(c[s>>2]|0)+16>>2]=0;e=0;}}else {if(d&2049|0){g=r+12|0;e=c[g>>2]|0;h=(d&1|0)==0;if(!(h|(e|0)==0)){e=nb[e&63](a,b,r)|0;if(!e){e=0;break}else f=e;}else f=b;do if((u|0)>-1)h=f+u|0;else {e=ob[c[a+12>>2]&127](a,0,12,r)|0;if(e|0){c[e+8>>2]=f;h=e;break}if(!(c[g>>2]|0)){e=0;break a}e=c[r+16>>2]|0;if(h|(e|0)==0){e=0;break a}vb[e&127](a,f,r);e=0;break a}while(0);g=c[s>>2]|0;e=c[g>>2]|0;do if(!(e&128)){if(!(e&16))if(!(e&32)){t=51;break}else {t=48;break}f=c[g+4>>2]|0;e=(f|0)!=0;if(!(d&8192)){if(!e){t=48;break}if((f|0)==(c[g+8>>2]|0)){t=48;break}r=f+4|0;a=c[r>>2]|0;c[h+4>>2]=a;c[a>>2]=h;c[h>>2]=f;c[r>>2]=h;break}else {if(!e){t=51;break}e=c[f>>2]|0;if(!e){t=51;break}c[h>>2]=e;c[e+4>>2]=h;c[h+4>>2]=f;c[f>>2]=h;break}}else if(!(d&8192))t=48;else t=51;while(0);if((t|0)==48){e=c[g+8>>2]|0;c[h>>2]=e;if(!e)e=h;else c[h+4>>2]=c[e+4>>2];c[e+4>>2]=h;c[(c[s>>2]|0)+8>>2]=h;}else if((t|0)==51){f=g+8|0;e=c[f>>2]|0;if(!e){c[f>>2]=h;e=h;}else {r=e+4|0;c[c[r>>2]>>2]=h;c[h+4>>2]=c[r>>2];}c[e+4>>2]=h;c[h>>2]=0;}e=c[s>>2]|0;f=e+16|0;g=c[f>>2]|0;if((g|0)>-1)c[f>>2]=g+1;c[e+4>>2]=h;if((u|0)<0){e=c[h+8>>2]|0;break}else {e=h+(0-u)|0;break}}h=c[s>>2]|0;do if(!(d&512)){e=c[h+4>>2]|0;if(e|0){if((u|0)<0)g=c[e+8>>2]|0;else g=e+(0-u)|0;if((g|0)==(b|0))break}e=b+m|0;if((n|0)<0){b=c[e>>2]|0;t=68;}else {b=e;t=68;}}else t=68;while(0);if((t|0)==68){g=(u|0)<0;i=(n|0)<0;j=(o|0)==0;k=(n|0)<1;l=0-u|0;e=h+8|0;do{e=c[e>>2]|0;if(!e){e=0;break a}if(g)f=c[e+8>>2]|0;else f=e+l|0;f=f+m|0;if(i)f=c[f>>2]|0;do if(j)if(k){f=s2(b,f)|0;break}else {f=$3(b,f,n)|0;break}else f=ob[o&127](a,b,f,r)|0;while(0)}while((f|0)!=0);f=c[p>>2]|0;}c[p>>2]=f|32768;if(!(d&4098)){do if(!(d&8)){f=c[s>>2]|0;if(!(d&16)){c[f+4>>2]=e;break}if((e|0)==(c[f+8>>2]|0)){c[f+4>>2]=0;e=0;break a}else {e=e+4|0;t=108;break}}else {f=c[s>>2]|0;t=108;}while(0);if((t|0)==108){e=c[e>>2]|0;c[f+4>>2]=e;if(!e){e=0;break}}if((u|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-u)|0;break}}else {h=e;t=84;}}while(0);if((t|0)==84){e=c[h>>2]|0;if(e){c[e+4>>2]=c[h+4>>2];e=c[h>>2]|0;}f=(c[s>>2]|0)+8|0;g=c[f>>2]|0;if((h|0)==(g|0)){c[f>>2]=e;e=c[(c[s>>2]|0)+8>>2]|0;if(e|0)c[e+4>>2]=c[h+4>>2];}else {f=h+4|0;c[c[f>>2]>>2]=e;e=g+4|0;if((h|0)==(c[e>>2]|0))c[e>>2]=c[f>>2];}e=c[s>>2]|0;f=e+4|0;if((h|0)==(c[f>>2]|0))g=c[h>>2]|0;else g=0;c[f>>2]=g;t=e+16|0;c[t>>2]=(c[t>>2]|0)+-1;if((u|0)<0)e=c[h+8>>2]|0;else e=h+(0-u)|0;f=c[r+16>>2]|0;if(!((d&2|0)==0|(f|0)==0))vb[f&127](a,e,r);if((c[q>>2]|0)<0)ob[c[a+12>>2]&127](a,h,0,r)|0;}return e|0}function Vz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;a:do if((a|0)!=0&(b|0)!=0?(f=T1(40)|0,(f|0)!=0):0){c[f>>2]=0;c[f+16>>2]=0;c[f+4>>2]=0;bA(f,a,0)|0;d=f+20|0;i=a+32|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;d=c[i>>2]|0;do if(d){c[g>>2]=0;d=ob[d&127](f,1,g,a)|0;if((d|0)>=0)if(d){e=c[g>>2]|0;if(e|0)if(!(c[b+4>>2]&c[e>>2])){d=f;h=12;break}else {d=f;break}d=a+28|0;if(!(c[d>>2]|0)){d=f;h=12;}else {U1(f);e=ob[c[d>>2]&127](0,0,40,a)|0;if(!e){d=0;break a}c[e>>2]=0;c[e+16>>2]=0;c[e+4>>2]=0;bA(e,a,0)|0;c[e+20>>2]=1;c[e+24>>2]=0;c[e+32>>2]=0;c[e+28>>2]=0;d=e;f=e;h=11;}}else {d=f;h=11;}else {d=f;h=12;}}else {d=f;h=11;}while(0);if((h|0)==11){e=ob[c[d+12>>2]&127](d,0,28,a)|0;c[g>>2]=e;if(!e){d=f;h=12;}else {c[e>>2]=c[b+4>>2];g=e+4|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;}}if((h|0)==12){U1(d);d=0;break}c[d+8>>2]=e;c[d>>2]=c[b>>2];c[d+16>>2]=b;e=c[i>>2]|0;if(e)ob[e&127](d,5,f,a)|0;}else d=0;while(0);l=j;return d|0}function Wz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=c[c[a+16>>2]>>2]|0;j=a+8|0;g=c[j>>2]|0;h=c[g>>2]|0;d=h&4096;if(!b)if(!d)b=-1;else {e=d;b=c[g+4>>2]|0;i=5;}else if(!(c[g+16>>2]|0)){e=0;i=5;}else b=-1;a:do if((i|0)==5){c[g>>2]=h&-4097;if(!(h&3)){d=g+4|0;if(!(h&12)){c[d>>2]=0;d=g+8|0;}c[d>>2]=b;if(e|0){b=0;break}c[(c[j>>2]|0)+16>>2]=-1;b=0;break}c[g+4>>2]=0;if(!e){c[g+16>>2]=0;while(1){if(!b){b=0;break a}j=c[b>>2]|0;nb[f&63](a,b,32)|0;b=j;}}e=c[g+8>>2]|0;a=e+(c[g+12>>2]<<2)|0;while(1){if(e>>>0>=a>>>0){b=0;break a}d=c[e>>2]|0;if(d){c[e>>2]=b;b=c[d>>2]|0;c[d>>2]=0;}e=e+4|0;}}while(0);return b|0}function Xz(a){a=a|0;var b=0,d=0,e=0;b=a+8|0;d=c[b>>2]|0;if(c[d>>2]&4096){Wz(a,0)|0;d=c[b>>2]|0;}e=d+16|0;a=c[e>>2]|0;do if((a|0)<0){b=c[d>>2]|0;if(b&12|0){a=Yz(c[d+4>>2]|0)|0;c[e>>2]=a;break}if(b&112){a=0;b=d+8|0;while(1){b=c[b>>2]|0;if(!b)break;a=a+1|0;}c[e>>2]=a;}}while(0);return a|0}function Yz(a){a=a|0;var b=0;if(!a)return 0;else {b=Yz(c[a+4>>2]|0)|0;return b+1+(Yz(c[a>>2]|0)|0)|0}return 0}function Zz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;G=l;l=l+128|0;z=G+120|0;r=G;F=a+8|0;e=c[F>>2]|0;if(c[e>>2]&4096){Wz(a,0)|0;e=c[F>>2]|0;}E=c[a+4>>2]|0;A=c[E>>2]|0;B=c[E+4>>2]|0;x=E+8|0;D=c[x>>2]|0;C=c[E+20>>2]|0;t=a+20|0;c[t>>2]=c[t>>2]&-32769;h=c[e+4>>2]|0;a:do if(!b)if((d&448|0)==0|(h|0)==0)e=0;else {if(!(d&64)){b:do if(!(d&256)){e=h;while(1){f=e+4|0;g=c[f>>2]|0;if(!g)break b;c[f>>2]=c[g>>2];c[g>>2]=e;e=g;}}else {e=h;while(1){f=c[e>>2]|0;if(!f)break b;a=f+4|0;c[e>>2]=c[a>>2];c[a>>2]=e;e=f;}}while(0);c[(c[F>>2]|0)+4>>2]=e;if((D|0)<0){e=c[e+8>>2]|0;break}else {e=e+(0-D)|0;break}}b=E+16|0;if((c[b>>2]|0)!=0|(D|0)<0){j=a+12|0;k=(D|0)<0;i=0-D|0;e=h;do{h=e;while(1){e=h+4|0;f=c[e>>2]|0;if(!f)break;c[e>>2]=c[f>>2];c[f>>2]=h;h=f;}e=c[h>>2]|0;f=c[b>>2]|0;if(f|0){if(k)g=c[h+8>>2]|0;else g=h+i|0;vb[f&127](a,g,E);}if((c[x>>2]|0)<0)ob[c[j>>2]&127](a,h,0,E)|0;}while((e|0)!=0);e=c[F>>2]|0;}c[e+16>>2]=0;c[e+4>>2]=0;e=0;}else {y=a+16|0;u=(d&4098|0)==0;c:do if(u|(c[(c[y>>2]|0)+4>>2]|0)!=8)v=45;else {k=(B|0)<0;e=b+A|0;if(k)e=c[e>>2]|0;i=(C|0)==0;j=(B|0)<1;g=nb[c[a>>2]&63](a,b,4)|0;while(1){if(!g){v=45;break c}f=g+A|0;if(k)f=c[f>>2]|0;do if(i)if(j){f=s2(e,f)|0;break}else {f=$3(e,f,B)|0;break}else f=ob[C&127](a,e,f,E)|0;while(0);if(f|0){v=45;break c}if((g|0)==(b|0))break;g=nb[c[a>>2]&63](a,g,8)|0;}h=c[(c[F>>2]|0)+4>>2]|0;c[z>>2]=c[h+4>>2];c[z+4>>2]=c[h>>2];e=z;v=180;}while(0);d:do if((v|0)==45){do if(!(d&2565)){if(d&32|0){if((D|0)<0)g=c[b+8>>2]|0;else g=b+(0-D)|0;e=g+A|0;if((B|0)<0)f=c[e>>2]|0;else f=e;if(!h){e=b;f=z;h=z;v=198;break}else {e=b;s=f;j=b;v=64;break}}if(h){if((D|0)<0)e=c[h+8>>2]|0;else e=h+(0-D)|0;if((e|0)!=(b|0)){f=b+A|0;if((B|0)<0){g=b;e=0;s=c[f>>2]|0;j=0;v=64;}else {g=b;e=0;s=f;j=0;v=64;}}else {e=0;g=b;f=z;k=z;j=0;v=141;}}else {e=0;g=b;f=z;h=z;v=198;}}else {if(!(d&512)){e=b+A|0;if((B|0)<0)f=c[e>>2]|0;else f=e;}else f=b;if(!h){e=0;g=b;f=z;h=z;v=198;}else {g=b;e=0;s=f;j=0;v=64;}}while(0);e:do if((v|0)==64){f:do if((c[(c[y>>2]|0)+4>>2]|0)==4?(q=c[(c[F>>2]|0)+24>>2]|0,!((d&516|0)==0|(q|0)==0)):0){b=(D|0)<0;m=(B|0)<0;n=(C|0)==0;o=(B|0)<1;p=0-D|0;k=0;f=h;while(1){if((k|0)>=(q|0)){f=z;k=z;m=0;break}if(b)i=c[f+8>>2]|0;else i=f+p|0;i=i+A|0;if(m)i=c[i>>2]|0;do if(n)if(o){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if(!i){v=80;break}c[r+(k<<2)>>2]=i;f=c[((i|0)<0?f+4|0:f)>>2]|0;if(!f){e=0;break a}else k=k+1|0;}if((v|0)==80)if(b){e=c[f+8>>2]|0;break a}else {e=f+p|0;break a}while(1){if((m|0)>=(q|0))break f;do if((c[r+(m<<2)>>2]|0)<0){i=h+4|0;b=c[i>>2]|0;if((c[r+((m|1)<<2)>>2]|0)<0){c[i>>2]=c[b>>2];c[b>>2]=h;c[f+4>>2]=b;f=b;h=k;i=b+4|0;break}else {c[k>>2]=b;c[f+4>>2]=h;f=h;h=b;i=b;break}}else {i=c[h>>2]|0;if((c[r+((m|1)<<2)>>2]|0)>0){p=i+4|0;c[h>>2]=c[p>>2];c[p>>2]=h;c[k>>2]=i;h=i;break}else {c[f+4>>2]=i;c[k>>2]=h;f=i;i=i+4|0;break}}while(0);k=h;m=m+2|0;h=c[i>>2]|0;}}else {f=z;k=z;}while(0);n=(D|0)<0;o=(B|0)<0;p=(C|0)!=0;q=(B|0)<1;r=0-D|0;i=h;g:while(1){h=i;while(1){if(n)i=c[h+8>>2]|0;else i=h+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if(!i){v=140;break g}if((i|0)>=0)break;b=h+4|0;m=c[b>>2]|0;if(!m){v=121;break g}if(n)i=c[m+8>>2]|0;else i=m+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if((i|0)>=0){v=118;break}c[b>>2]=c[m>>2];c[m>>2]=h;c[f+4>>2]=m;h=c[m+4>>2]|0;if(!h){f=m;h=k;v=198;break e}else f=m;}if((v|0)==118){v=0;if(!i){v=119;break}c[k>>2]=m;c[f+4>>2]=h;i=c[m>>2]|0;if(!i){f=h;h=m;v=198;break e}else {f=h;k=m;continue}}b=c[h>>2]|0;if(!b){v=139;break}if(n)i=c[b+8>>2]|0;else i=b+r|0;i=i+A|0;if(o)i=c[i>>2]|0;do if(!p)if(q){i=s2(s,i)|0;break}else {i=$3(s,i,B)|0;break}else i=ob[C&127](a,s,i,E)|0;while(0);if((i|0)>0){i=b+4|0;c[h>>2]=c[i>>2];c[i>>2]=h;c[k>>2]=b;i=c[b>>2]|0;if(!i){h=b;v=198;break e}else {k=b;continue}}if(!i){v=137;break}c[f+4>>2]=b;c[k>>2]=h;i=c[b+4>>2]|0;if(!i){f=b;v=198;break e}else {f=b;k=h;}}if((v|0)==119){c[f+4>>2]=h;f=h;h=m;v=141;break}else if((v|0)==121){c[f+4>>2]=h;f=h;h=k;v=198;break}else if((v|0)==137){c[k>>2]=h;k=h;h=b;v=141;break}else if((v|0)==139){c[k>>2]=h;v=198;break}else if((v|0)==140)if(!h){h=k;v=198;break}else {v=141;break}}while(0);do if((v|0)==141){c[t>>2]=c[t>>2]|32768;i=h+4|0;c[k>>2]=c[i>>2];c[f+4>>2]=c[h>>2];if(!(d&516)){if(d&8|0){c[i>>2]=c[z>>2];c[h>>2]=0;c[z>>2]=h;v=169;break}if(d&16|0){v=z+4|0;c[h>>2]=c[v>>2];c[i>>2]=0;c[v>>2]=h;v=175;break}if(!u){e=f;v=180;break d}if(d&2049|0){if(c[(c[y>>2]|0)+4>>2]&4|0){e=h;break}c[i>>2]=0;e=z+4|0;c[h>>2]=c[e>>2];c[e>>2]=h;e=h;v=205;break}if(!(d&32)){e=0;break a}if(!(c[(c[y>>2]|0)+4>>2]&4)){c[e+4>>2]=0;x=z+4|0;c[e>>2]=c[x>>2];c[x>>2]=j;e=(c[F>>2]|0)+16|0;c[e>>2]=(c[e>>2]|0)+1;e=h;break}e=c[E+16>>2]|0;if(e|0)vb[e&127](a,g,E);if((c[x>>2]|0)<0){ob[c[a+12>>2]&127](a,j,0,E)|0;e=h;}else e=h;}else e=h;}else if((v|0)==198){c[f+4>>2]=0;c[h>>2]=0;if(!(d&8))if(!(d&16)){if(d&516|0){e=f;break d}if(!(d&2049)){if(!(d&32)){g=0;e=f;break d}x=(c[F>>2]|0)+16|0;c[x>>2]=(c[x>>2]|0)+1;}else {e=0;v=205;}}else v=175;else v=169;}while(0);if((v|0)==169){h=z+4|0;e=c[h>>2]|0;if(!e){e=f;break}while(1){f=e+4|0;g=c[f>>2]|0;if(!g)break;c[f>>2]=c[g>>2];c[g>>2]=e;e=g;}c[h>>2]=c[e>>2];}else if((v|0)==175){e=c[z>>2]|0;if(!e){e=f;break}while(1){f=c[e>>2]|0;if(!f)break;x=f+4|0;c[e>>2]=c[x>>2];c[x>>2]=e;e=f;}c[z>>2]=c[e+4>>2];}else if((v|0)==205){i=E+12|0;h=c[i>>2]|0;j=(d&1|0)==0;if(!(j|(h|0)==0))g=nb[h&63](a,g,E)|0;do if(g){if((D|0)>-1){e=g+D|0;v=215;break}e=ob[c[a+12>>2]&127](a,0,12,E)|0;if(e|0){c[e+8>>2]=g;break}if((c[i>>2]|0)!=0?(w=c[E+16>>2]|0,!(j|(w|0)==0)):0){vb[w&127](a,g,E);v=215;}else v=215;}else v=215;while(0);if((v|0)==215)if(!e){e=f;break}f=(c[F>>2]|0)+16|0;g=c[f>>2]|0;if((g|0)>-1)c[f>>2]=g+1;}c[e+4>>2]=c[z>>2];c[e>>2]=c[z+4>>2];h:do if(!((d&516|0)==0?1:(c[(c[y>>2]|0)+4>>2]&8|0)==0)){m=(D|0)<0;if(m)f=c[e+8>>2]|0;else f=e+(0-D)|0;n=(B|0)<0;f=f+A|0;if(n)f=c[f>>2]|0;j=(C|0)==0;k=(B|0)<1;b=0-D|0;while(1){i=e+4|0;g=c[i>>2]|0;if(!g)break h;while(1){h=c[g>>2]|0;if(!h)break;z=h+4|0;c[g>>2]=c[z>>2];c[z>>2]=g;g=h;}c[i>>2]=g;if(m)h=c[g+8>>2]|0;else h=g+b|0;h=h+A|0;if(n)h=c[h>>2]|0;do if(j)if(k){h=s2(f,h)|0;break}else {h=$3(f,h,B)|0;break}else h=ob[C&127](a,f,h,E)|0;while(0);if(h|0)break h;c[i>>2]=c[g>>2];c[g>>2]=e;e=g;}}while(0);c[(c[F>>2]|0)+4>>2]=e;if((D|0)<0){e=c[e+8>>2]|0;break a}else {e=e+(0-D)|0;break a}}while(0);if((v|0)==180){if((D|0)<0)g=c[h+8>>2]|0;else g=h+(0-D)|0;f=c[E+16>>2]|0;if(!((d&2|0)==0|(f|0)==0))vb[f&127](a,g,E);if((c[x>>2]|0)<0)ob[c[a+12>>2]&127](a,h,0,E)|0;a=(c[F>>2]|0)+16|0;E=c[a>>2]|0;c[a>>2]=(E|0)<1?-1:E+-1|0;}do{f=e+4|0;e=c[f>>2]|0;}while((e|0)!=0);c[f>>2]=c[z>>2];c[(c[F>>2]|0)+4>>2]=c[z+4>>2];e=d&2|0?g:0;}while(0);l=G;return e|0}function _z(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(c[c[a+8>>2]>>2]&4096|0)Wz(a,0)|0;f=(b|0)!=0;if(f){if(c[c[b+8>>2]>>2]&4096|0)Wz(b,0)|0;if((c[b+16>>2]|0)==(c[a+16>>2]|0)){d=b;e=7;}else b=0;}else {d=0;e=7;}a:do if((e|0)==7){while(1){if(!d)break;if((d|0)==(a|0)){b=0;break a}d=c[d+28>>2]|0;e=7;}d=a+28|0;e=c[d>>2]|0;if(e|0){g=e+24|0;c[g>>2]=(c[g>>2]|0)+-1;}c[a+32>>2]=0;c[d>>2]=0;if(f){c[d>>2]=b;c[a>>2]=28;g=b+24|0;c[g>>2]=(c[g>>2]|0)+1;break}else {c[a>>2]=c[c[a+16>>2]>>2];b=e;break}}while(0);return b|0}function $z(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a:do if(!(d&99)){if((d&516|0)==0?(e=c[(c[a+16>>2]|0)+4>>2]|0,!((d&384|0)!=0&(e&12|0)==0)):0){if(e&12|0){if(!(d&408)){e=0;break}o=(d&136|0)!=0;p=(d&272|0)!=0;l=0;f=0;e=0;n=a;while(1){if(!n)break;m=nb[c[c[n+16>>2]>>2]&63](n,b,d)|0;do if(!m)g=l;else {h=c[n+4>>2]|0;i=c[h+4>>2]|0;j=c[h+20>>2]|0;g=m+(c[h>>2]|0)|0;if((i|0)<0)k=c[g>>2]|0;else k=g;if(e|0){do if(!j)if((i|0)<1){g=s2(k,f)|0;break}else {g=$3(k,f,i)|0;break}else g=ob[j&127](n,k,f,h)|0;while(0);if(!(o&(g|0)<0|p&(g|0)>0)){g=l;break}}g=n;f=k;e=m;}while(0);l=g;n=c[n+28>>2]|0;}c[a+32>>2]=l;break}if(!(d&24)){e=0;break}j=a+32|0;f=c[j>>2]|0;if(f){e=c[(c[f+4>>2]|0)+8>>2]|0;g=c[(c[f+8>>2]|0)+4>>2]|0;if((e|0)<0)e=c[g+8>>2]|0;else e=g+(0-e)|0;if((e|0)==(b|0))e=b;else {f=a;h=32;}}else {f=a;h=32;}do if((h|0)==32){while(1){if(!f){h=33;break}e=nb[c[c[f+16>>2]>>2]&63](f,b,4)|0;if(e|0){h=36;break}f=c[f+28>>2]|0;h=32;}if((h|0)==33){c[j>>2]=0;e=0;break a}else if((h|0)==36){c[j>>2]=f;break}}while(0);i=(d<<4&128^128)+128|0;e=nb[c[c[f+16>>2]>>2]&63](f,e,d)|0;while(1){h=f+16|0;while(1){if(!e)break;else g=a;while(1){if((g|0)==(f|0))break a;if(nb[c[c[g+16>>2]>>2]&63](g,e,4)|0)break;g=c[g+28>>2]|0;}e=nb[c[c[h>>2]>>2]&63](f,e,d)|0;}f=c[f+28>>2]|0;c[j>>2]=f;if(!f){e=0;break a}e=nb[c[c[f+16>>2]>>2]&63](f,0,i)|0;}}else f=a;while(1){if(!f){f=0;e=0;break}e=nb[c[c[f+16>>2]>>2]&63](f,b,d)|0;if(e|0)break;f=c[f+28>>2]|0;}c[a+32>>2]=f;}else e=nb[c[c[a+16>>2]>>2]&63](a,b,d)|0;while(0);return e|0}function aA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=a+32|0;f=nb[c[a>>2]&63](a,0,128)|0;do{if(!f){e=0;break}h=c[g>>2]|0;e=f;f=nb[c[a>>2]&63](a,f,8)|0;e=nb[b&63]((h|0)==0?a:h,e,d)|0;}while((e|0)>=0);return e|0}function bA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=a+4|0;n=c[f>>2]|0;a:do if(n)if(b){m=c[c[a+16>>2]>>2]|0;g=a+8|0;if(c[c[g>>2]>>2]&4096|0)Wz(a,0)|0;e=c[n+32>>2]|0;if(e|0?(ob[e&127](a,3,b,n)|0)<0:0){b=0;break}c[f>>2]=b;e=c[b+28>>2]|0;c[a+12>>2]=(e|0)==0?52:e;e=c[c[g>>2]>>2]|0;if(!(e&112)){do if(!(e&2))if(!(e&3))if(!(d&1))break;else {b=n;break a}else if((d&3|0)==3){b=n;break a}else break;else if(d&2|0){b=n;break a}while(0);h=Tz(a)|0;e=c[g>>2]|0;l=c[e>>2]|0;c[e>>2]=l&-4097;c[e+4>>2]=0;c[e+16>>2]=0;b:do if(l&3|0){l=c[e+8>>2]|0;f=l+(c[e+12>>2]<<2)|0;e=l;while(1){if(e>>>0>=f>>>0)break b;c[e>>2]=0;e=e+4|0;}}while(0);i=(d&2|0)==0;j=b+8|0;k=b+4|0;l=b+24|0;while(1){if(!h){b=n;break a}d=c[h>>2]|0;if(i){e=c[j>>2]|0;if((e|0)<0)e=c[h+8>>2]|0;else e=h+(0-e)|0;g=c[k>>2]|0;e=e+(c[b>>2]|0)|0;if((g|0)<0)e=c[e>>2]|0;f=c[l>>2]|0;if(!f)e=dA(0,e,g)|0;else e=nb[f&63](a,e,b)|0;c[h+4>>2]=e;}nb[m&63](a,h,32)|0;h=d;}}else b=n;}else b=n;else {c[f>>2]=b;n=c[b+28>>2]|0;c[a+12>>2]=(n|0)==0?52:n;}while(0);return b|0}function cA(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=(c|0)==0;do if(!b)if(a)a=0;else a=T1(c)|0;else if(a){U1(b);a=0;break}else {a=W1(b,c)|0;break}while(0);return a|0}function dA(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;g=c;if((e|0)>=1){h=c+e+-1|0;g=(h>>>0>>0?c:h)+(1-g)&-2;f=c;while(1){if(f>>>0>=h>>>0)break;b=O(((d[f>>0]|0)<<8)+b+(d[f+1>>0]|0)|0,17109811)|0;f=f+2|0;}f=c+g|0;if(f>>>0>h>>>0)c=e;else {c=e;b=O(((d[f>>0]|0)<<8)+b|0,17109811)|0;}}else {while(1){f=a[c>>0]|0;if(!(f<<24>>24))break;h=a[c+1>>0]|0;e=O(((f&255)<<8)+b+(h&255)|0,17109811)|0;b=e;c=c+(h<<24>>24?2:1)|0;}c=c-g|0;}return O(b+c|0,17109811)|0}function eA(a){a=a|0;var b=0;b=c[46935]|0;c[46935]=a;return b|0}function fA(a){a=a|0;var b=0;b=c[46936]|0;c[46936]=a;return b|0}function gA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=hA(a,b,f)|0;l=e;return d|0}function hA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=l;l=l+16|0;e=g;f=(a|0)==3;h=f?c[46938]|0:(a|0)==2?1:a;c[46938]=h;i=c[46939]|0;c[46939]=i>>>0>h>>>0?i:h;do if(h>>>0<(c[46936]|0)>>>0){a=c[46937]|0;if(!a){a=C6()|0;c[46937]=a;if(!a){a=1;break}}if(!f){F6(a)|0;a=c[46937]|0;}H3(a,b,d)|0;a=0;}else {if(c[46935]|0){iA(a,b,d);a=0;break}if(f)a=c[15712]|0;else {i=c[15712]|0;c[e>>2]=(a|0)==1?96349:96355;w4(i,96363,e)|0;a=i;}H3(a,b,d)|0;a=0;}while(0);l=g;return a|0}function iA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if((c[46940]|0)==0?(f=T1(c[4590]|0)|0,c[46940]=f,(f|0)==0):0)T4(96368,c[15712]|0)|0;else e=4;do if((e|0)==4){if((a|0)!=3){kb[c[46935]&63]((a|0)==1?96349:96355)|0;kb[c[46935]&63](97027)|0;}while(1){a=G3(c[46940]|0,c[4590]|0,b,d)|0;e=c[4590]|0;if((a|0)>-1&(a|0)<(e|0)){e=7;break}e=e<<1;f=a+1|0;f=(e|0)>(f|0)?e:f;c[4590]=f;if(!(W1(c[46940]|0,f)|0)){e=9;break}}if((e|0)==7){kb[c[46935]&63](c[46940]|0)|0;break}else if((e|0)==9){T4(96368,c[15712]|0)|0;break}}while(0);return}function jA(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;hA(1,a,e)|0;l=d;return}function kA(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!e){e=(d|0)==0?1024:d;d=e;e=T1(e)|0;f=1;}else f=0;c[b+12>>2]=f;c[b>>2]=e;c[b+8>>2]=e+d;c[b+4>>2]=e;a[e>>0]=0;return}function lA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=a+8|0;f=c[a>>2]|0;g=(c[h>>2]|0)-f|0;e=g<<1;g=g+b|0;e=g>>>0>e>>>0?g:e;g=a+4|0;b=f;f=(c[g>>2]|0)-f|0;d=a+12|0;if(!(c[d>>2]|0)){i=T1(e)|0;W6(i|0,b|0,f|0)|0;c[d>>2]=1;b=i;}else b=W1(b,e)|0;c[a>>2]=b;c[g>>2]=b+f;c[h>>2]=b+e;return 0}function mA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=a+4|0;e=c[f>>2]|0;if((e+d|0)>>>0>(c[a+8>>2]|0)>>>0){lA(a,d)|0;e=c[f>>2]|0;}W6(e|0,b|0,d|0)|0;c[f>>2]=(c[f>>2]|0)+d;return d|0}function nA(a,b){a=a|0;b=b|0;return mA(a,b,l2(b)|0)|0}function oA(a){a=a|0;if(c[a+12>>2]|0)U1(c[a>>2]|0);return}function pA(a){a=a|0;var b=0,e=0;b=a+4|0;e=c[b>>2]|0;if(e>>>0>(c[a>>2]|0)>>>0){c[b>>2]=e+-1;a=d[e>>0]|0;}else a=-1;return a|0}function qA(a,b,d){a=a|0;b=b|0;d=d|0;hD(c[46942]|0,c[b+8>>2]|0)|0;hD(c[46942]|0,c[b+12>>2]|0)|0;eC(c[46942]|0,b);return}function rA(a,b){a=a|0;b=b|0;var c=0;c=RC(a,96416,0)|0;if((b|0)!=0&(c|0)==0){sA(a);c=RC(a,96416,0)|0;}return c|0}function sA(a){a=a|0;var b=0,c=0,d=0;d=yC(a)|0;BE(d,d,107,0,1)|0;c=jC(d)|0;while(1){if(!c)break;uA(a,c);b=XA(d,c)|0;while(1){if(!b)break;vA(a,b);b=ZA(d,b)|0;}c=kC(d,c)|0;}return}function tA(b){b=b|0;var c=0;c=b+24|0;a[c>>0]=a[c>>0]|64;AA(b);c=QD(b)|0;xA((c|0)==0?b:c,b);return}function uA(a,b){a=a|0;b=b|0;var d=0;d=wA(b)|0;if(!((d|0)!=0?(c[d+8>>2]|0)!=0:0))xA(a,b);return}function vA(a,b){a=a|0;b=b|0;var d=0;d=wA(b)|0;if(!((d|0)!=0?(c[d+8>>2]|0)!=0:0))xA(a,b);return}function wA(a){a=a|0;return RC(a,96404,0)|0}function xA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=TC(b,96404,16,0)|0;f=yA(a,c[b>>2]&3)|0;e=d+8|0;a:do if(!(c[e>>2]|0)){a=yC(a)|0;c[e>>2]=yA(a,c[b>>2]&3)|0;a=zA(b)|0;d=d+12|0;c[d>>2]=dC(xC(b)|0,((a|0)>4?a:4)<<2)|0;a=nb[c[f>>2]&63](f,0,128)|0;while(1){if(!a)break a;e=xC(b)|0;e=fD(e,c[a+12>>2]|0)|0;c[(c[d>>2]|0)+(c[a+16>>2]<<2)>>2]=e;a=nb[c[f>>2]&63](f,a,8)|0;}}while(0);return}function yA(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;a=rA(a,0)|0;a:do if(!a)a=0;else switch(b|0){case 0:{a=c[a+16>>2]|0;break a}case 1:{a=c[a+8>>2]|0;break a}case 2:case 3:{a=c[a+12>>2]|0;break a}default:{c[d>>2]=b;gA(1,96429,d)|0;a=0;break a}}while(0);l=e;return a|0}function zA(a){a=a|0;var b=0;b=yC(xC(a)|0)|0;a=yA(b,c[a>>2]&3)|0;if(!a)a=0;else a=Xz(a)|0;return a|0}function AA(a){a=a|0;var b=0,d=0,e=0,f=0;d=TC(a,96416,20,0)|0;e=d+8|0;c[e>>2]=UD(a,18364,c[4589]|0)|0;f=d+12|0;c[f>>2]=UD(a,18364,c[4589]|0)|0;d=d+16|0;c[d>>2]=UD(a,18364,c[4589]|0)|0;b=QD(a)|0;if(!b){b=c[46941]|0;if(!((b|0)==0|(b|0)==(a|0))){b=rA(b,0)|0;BA(c[b+8>>2]|0,c[e>>2]|0,a,1);BA(c[b+12>>2]|0,c[f>>2]|0,a,2);BA(c[b+16>>2]|0,c[d>>2]|0,a,0);}}else {a=rA(b,0)|0;_z(c[e>>2]|0,c[a+8>>2]|0)|0;_z(c[f>>2]|0,c[a+12>>2]|0)|0;_z(c[d>>2]|0,c[a+16>>2]|0)|0;}return}function BA(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=nb[c[b>>2]&63](b,0,128)|0;while(1){if(!g)break;h=CA(e,c[g+8>>2]|0,c[g+12>>2]|0,c[g+16>>2]|0,f)|0;a[h+22>>0]=a[g+22>>0]|0;a[h+21>>0]=a[g+21>>0]|0;nb[c[d>>2]&63](d,h,1)|0;g=nb[c[b>>2]&63](b,g,8)|0;}return}function CA(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=dC(b,24)|0;a[h+20>>0]=g;c[h+8>>2]=fD(b,d)|0;c[h+12>>2]=fD(b,e)|0;c[h+16>>2]=f;return h|0}function DA(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+32|0;e=d;c[e+8>>2]=b;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function EA(a,b){a=a|0;b=b|0;var c=0;c=_z(a,0)|0;b=DA(a,b)|0;_z(a,c)|0;return b|0}function FA(a,b){a=a|0;b=b|0;a=wA(a)|0;if(!a)a=0;else a=DA(c[a+8>>2]|0,b)|0;return a|0}function GA(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=l;l=l+16|0;g=h;if(!b){b=c[46941]|0;if(!b){a[g>>0]=a[18400]|0;a[g+1>>0]=a[18401]|0;a[g+2>>0]=a[18402]|0;a[g+3>>0]=a[18403]|0;b=oB(0,g,0)|0;c[46941]=b;}}if(!f)b=IA(b,d,e)|0;else b=HA(b,d,e,f)|0;l=h;return b|0}function HA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=yC(a)|0;rA(a,1)|0;g=yA(a,b)|0;f=EA(g,d)|0;a:do if(!f){f=DA(g,d)|0;if(f|0){f=CA(a,d,e,c[f+16>>2]|0,b)|0;nb[c[g>>2]&63](g,f,1)|0;h=16;break}g=yA(i,b)|0;f=CA(a,d,e,Xz(g)|0,b)|0;nb[c[g>>2]&63](g,f,1)|0;switch(b|0){case 0:{BE(i,i,57,f,1)|0;h=16;break a}case 1:{d=jC(i)|0;while(1){if(!d){h=16;break a}JA(a,d,f);d=kC(i,d)|0;}}case 2:case 3:{g=jC(i)|0;while(1){if(!g){h=16;break a}d=XA(i,g)|0;while(1){if(!d)break;JA(a,d,f);d=ZA(i,d)|0;}g=kC(i,g)|0;}}default:break a}}else {h=f+12|0;hD(a,c[h>>2]|0)|0;c[h>>2]=fD(a,e)|0;h=16;}while(0);if((h|0)==16)if((b|0)==0&(f|0)!=0)KA(a,f,e)|0;BC(a,a,f);return f|0}function IA(a,b,c){a=a|0;b=b|0;c=c|0;a=yA(a,b)|0;if(!a)a=0;else a=DA(a,c)|0;return a|0}function JA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;b=wA(b)|0;f=d+16|0;e=c[f>>2]|0;if((e|0)>3){g=c[a+64>>2]|0;b=b+12|0;e=e<<2;c[b>>2]=ob[c[(c[g>>2]|0)+8>>2]&127](c[g+12>>2]|0,c[b>>2]|0,e,e+4|0)|0;}else b=b+12|0;g=fD(a,c[d+12>>2]|0)|0;c[(c[b>>2]|0)+(c[f>>2]<<2)>>2]=g;return}function KA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=xC(a)|0;g=(wA(a)|0)+12|0;i=b+16|0;hD(h,c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]|0)|0;f=fD(h,d)|0;c[(c[g>>2]|0)+(c[i>>2]<<2)>>2]=f;do if(!(c[a>>2]&3)){e=c[(rA(h,0)|0)+16>>2]|0;f=b+8|0;g=EA(e,c[f>>2]|0)|0;if(!g){i=CA(h,c[f>>2]|0,d,c[i>>2]|0,c[a>>2]&3)|0;nb[c[e>>2]&63](e,i,1)|0;break}else {i=g+12|0;hD(h,c[i>>2]|0)|0;c[i>>2]=fD(h,d)|0;break}}while(0);BC(h,a,b);return 0}function LA(a,b,d){a=a|0;b=b|0;d=d|0;a=yA(a,b)|0;do if(a){b=c[a>>2]|0;if(!d){a=nb[b&63](a,0,128)|0;break}else {a=nb[b&63](a,d,8)|0;break}}else a=0;while(0);return a|0}function MA(a){a=a|0;var b=0;c[46942]=a;b=wA(a)|0;if(b|0){NA(a,b);VC(a,c[b>>2]|0)|0;}b=rA(a,0)|0;if(b)if(((WD(a,c[b+8>>2]|0)|0)==0?(WD(a,c[b+12>>2]|0)|0)==0:0)?(WD(a,c[b+16>>2]|0)|0)==0:0){VC(a,c[b>>2]|0)|0;b=0;}else b=1;else b=0;return b|0}function NA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=xC(a)|0;e=zA(a)|0;b=b+12|0;a=0;while(1){d=c[b>>2]|0;if((a|0)>=(e|0))break;hD(f,c[d+(a<<2)>>2]|0)|0;a=a+1|0;}eC(f,d);return}function OA(a){a=a|0;var b=0;b=wA(a)|0;if(b|0){NA(a,b);VC(a,96404)|0;}return}function PA(a){a=a|0;var b=0;b=wA(a)|0;if(b|0){NA(a,b);VC(a,96404)|0;}return}function QA(a,b){a=a|0;b=b|0;b=FA(a,b)|0;if(!b)b=0;else {a=c[(wA(a)|0)+12>>2]|0;b=c[a+(c[b+16>>2]<<2)>>2]|0;}return b|0}function RA(a,b){a=a|0;b=b|0;a=c[(wA(a)|0)+12>>2]|0;return c[a+(c[b+16>>2]<<2)>>2]|0}function SA(a,b,c){a=a|0;b=b|0;c=c|0;b=FA(a,b)|0;if(!b)b=-1;else {KA(a,b,c)|0;b=0;}return b|0}function TA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=xC(a)|0;f=GA(f,c[a>>2]&3,b,0)|0;if(!f){f=xC(a)|0;f=GA(f,c[a>>2]&3,b,e)|0;}KA(a,f,d)|0;return 0}function UA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=xC(a)|0;f=c[a>>2]|0;a:do if(!((c[b>>2]^f)&3)){d=1;e=0;while(1){e=LA(g,f&3,e)|0;if(!e)break a;d=FA(b,c[e+8>>2]|0)|0;if(!d){d=1;break a}f=RA(a,e)|0;KA(b,d,f)|0;if(iD(f)|0)jD(RA(b,d)|0);d=0;f=c[a>>2]|0;}}else d=1;while(0);return d|0}function VA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;a=c[b+40>>2]|0;f=c[d+40>>2]|0;if((a|0)==(f|0)){e=(c[b>>2]|0)>>>4;a=(c[d>>2]|0)>>>4;if(e>>>0>=a>>>0)if(e>>>0>a>>>0)a=1;else g=6;else a=-1;}else {e=(c[a>>2]|0)>>>4;a=(c[f>>2]|0)>>>4;if(e>>>0>=a>>>0)if(e>>>0>a>>>0)a=1;else g=6;else a=-1;}if((g|0)==6)a=0;return a|0}function WA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a=(c[b+40>>2]|0)+8|0;g=c[a>>2]|0;a=c[a+4>>2]|0;f=(c[d+40>>2]|0)+8|0;e=c[f>>2]|0;f=c[f+4>>2]|0;do if(!(a>>>0>>0|(a|0)==(f|0)&g>>>0>>0))if(a>>>0>f>>>0|(a|0)==(f|0)&g>>>0>e>>>0)a=1;else {e=b+8|0;a=c[e>>2]|0;e=c[e+4>>2]|0;if(!((a|0)==0&(e|0)==0)?(i=d+8|0,h=c[i>>2]|0,i=c[i+4>>2]|0,!((h|0)==0&(i|0)==0)):0){if(e>>>0>>0|(e|0)==(i|0)&a>>>0>>0){a=-1;break}if(e>>>0>i>>>0|(e|0)==(i|0)&a>>>0>h>>>0){a=1;break}}a=0;}else a=-1;while(0);return a|0}function XA(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if(!b)b=0;else {d=a+44|0;a=b+32|0;Wz(c[d>>2]|0,c[a>>2]|0)|0;b=c[d>>2]|0;b=nb[c[b>>2]&63](b,0,128)|0;c[a>>2]=Sz(c[d>>2]|0)|0;}return b|0}function YA(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+48|0;d=e;if((c[b+24>>2]|0)==(a|0))a=b+28|0;else {c[d+16>>2]=b;a=c[a+40>>2]|0;a=nb[c[a>>2]&63](a,d,4)|0;}l=e;return a|0}function ZA(a,b){a=a|0;b=b|0;var d=0,e=0;d=YA(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;if(!d)a=0;else {e=a+44|0;d=d+32|0;Wz(c[e>>2]|0,c[d>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,b,8)|0;c[d>>2]=Sz(c[e>>2]|0)|0;}return a|0}function _A(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if(!b)b=0;else {d=a+44|0;a=b+28|0;Wz(c[d>>2]|0,c[a>>2]|0)|0;b=c[d>>2]|0;b=nb[c[b>>2]&63](b,0,128)|0;c[a>>2]=Sz(c[d>>2]|0)|0;}return b|0}function $A(a,b){a=a|0;b=b|0;var d=0,e=0;d=YA(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;if(!d)a=0;else {e=a+44|0;d=d+28|0;Wz(c[e>>2]|0,c[d>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,b,8)|0;c[d>>2]=Sz(c[e>>2]|0)|0;}return a|0}function aB(a,b){a=a|0;b=b|0;var c=0;c=XA(a,b)|0;if(!c)c=_A(a,b)|0;return c|0}function bB(a,b,d){a=a|0;b=b|0;d=d|0;a:do if((c[b>>2]&3|0)==2){b=ZA(a,b)|0;if(!b){b=0;do{if(!b)b=_A(a,d)|0;else b=$A(a,b)|0;if(!b){b=0;break a}}while((c[b+40>>2]|0)==(d|0))}}else do{b=$A(a,b)|0;if(!b){b=0;break a}}while((c[b+40>>2]|0)==(d|0));while(0);return b|0}function cB(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+32|0;f=h+16|0;g=h;if((zB(a)|0)!=0?(c[g>>2]=0,c[g+4>>2]=0,c[g+8>>2]=0,c[g+12>>2]=0,c[f>>2]=c[g>>2],c[f+4>>2]=c[g+4>>2],c[f+8>>2]=c[g+8>>2],c[f+12>>2]=c[g+12>>2],(gB(a,b,e,f)|0)!=0):0)f=0;else f=((d[a+24>>0]|0)>>>2&1^1)&255|(b|0)!=(e|0);l=h;return f|0}function dB(a,b){a=a|0;b=b|0;fB(a,b);return}function eB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;oC(b,d,1)|0;oC(b,e,1)|0;h=dC(b,96)|0;i=h+48|0;l=rB(b,2)|0;j=c[i>>2]|0;k=c[h>>2]|0;m=h+8|0;c[m>>2]=f;c[m+4>>2]=g;m=h+56|0;c[m>>2]=f;c[m+4>>2]=g;g=l<<4;c[h>>2]=k&12|g|2;c[i>>2]=j&12|g|3;c[h+88>>2]=d;c[h+40>>2]=e;fB(b,h);if(a[b+24>>0]&64){TC(h,96404,16,0)|0;vA(b,h);}zC(b,h);return h|0}function fB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;i=l;l=l+16|0;d=i;h=c[b>>2]&3;g=(h|0)==2?b:b+-48|0;h=(h|0)==3?b:b+48|0;e=c[h+40>>2]|0;f=c[g+40>>2]|0;while(1){if(!a)break;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];if(gB(a,e,f,d)|0)break;j=YA(a,e)|0;m=a+44|0;hB(c[m>>2]|0,j+32|0,g);k=a+48|0;hB(c[k>>2]|0,j+24|0,g);j=YA(a,f)|0;hB(c[m>>2]|0,j+28|0,h);hB(c[k>>2]|0,j+20|0,h);a=QD(a)|0;}l=i;return}function gB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+48|0;f=h;if(!((b|0)==0|(d|0)==0)?(c[f>>2]=c[e>>2],c[f+4>>2]=c[e+4>>2],c[f+8>>2]=c[e+8>>2],c[f+12>>2]=c[e+12>>2],c[f+40>>2]=b,g=YA(a,d)|0,(g|0)!=0):0){e=a+48|0;g=g+20|0;Wz(c[e>>2]|0,c[g>>2]|0)|0;a=c[e>>2]|0;a=nb[c[a>>2]&63](a,f,4)|0;c[g>>2]=Sz(c[e>>2]|0)|0;}else a=0;l=h;return a|0}function hB(a,b,d){a=a|0;b=b|0;d=d|0;Wz(a,c[b>>2]|0)|0;nb[c[a>>2]&63](a,d,1)|0;c[b>>2]=Sz(a)|0;return}function iB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+48|0;i=n+24|0;k=n+16|0;j=n;do if(!(HB(a,2,e,k,0)|0))if(!e){if(f|0?(zB(a)|0)==0:0){m=18;break};c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;m=7;}else m=17;else {o=j;c[o>>2]=0;c[o+4>>2]=0;o=k;g=c[o+4>>2]|0;m=j+8|0;c[m>>2]=c[o>>2];c[m+4>>2]=g;c[j>>2]=2;m=7;}while(0);a:do if((m|0)==7){c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(a,b,d,i)|0;b:do if(!g){if(yB(a)|0?(c[i>>2]=c[j>>2],c[i+4>>2]=c[j+4>>2],c[i+8>>2]=c[j+8>>2],c[i+12>>2]=c[j+12>>2],h=gB(a,d,b,i)|0,h|0):0){g=h;break}do if(f|0){g=yC(a)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(g,b,d,i)|0;if(!g){if(!(yB(a)|0))break;g=yC(a)|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];g=gB(g,d,b,i)|0;if(!g)break}dB(a,g);break b}while(0);m=17;break a}while(0)}while(0);if((m|0)==17)if(!f)g=0;else m=18;if((m|0)==18)if((cB(a,b,d)|0)!=0?(HB(a,2,e,k,1)|0)!=0:0){g=k;g=eB(a,b,d,c[g>>2]|0,c[g+4>>2]|0)|0;LB(a,2,g);}else g=0;l=n;return g|0}function jB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=(c[b>>2]&3|0)==3;g=d?b+-48|0:b;d=d?b:b+48|0;b=c[g+40>>2]|0;h=YA(a,c[d+40>>2]|0)|0;f=a+44|0;kB(c[f>>2]|0,h+32|0,g);e=a+48|0;kB(c[e>>2]|0,h+24|0,g);b=YA(a,b)|0;kB(c[f>>2]|0,b+28|0,d);kB(c[e>>2]|0,b+20|0,d);return}function kB(a,b,d){a=a|0;b=b|0;d=d|0;Wz(a,c[b>>2]|0)|0;nb[c[a>>2]&63](a,d,2)|0;c[b>>2]=Sz(a)|0;return}function lB(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+16|0;f=e;d=(c[d>>2]&3|0)==2?d:d+-48|0;g=c[d>>2]&3;h=c[((g|0)==3?d:d+48|0)+40>>2]|0;g=c[((g|0)==2?d:d+-48|0)+40>>2]|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];if(gB(b,h,g,f)|0){if((yC(b)|0)==(b|0)){if(a[b+24>>0]&64)PA(d);DC(b,d);$C(d);h=d+8|0;JB(b,2,c[h>>2]|0,c[h+4>>2]|0);}if(!(BE(b,d,58,0,0)|0))if((yC(b)|0)==(b|0)){eC(b,d);d=0;}else d=0;else d=-1;}else d=-1;l=e;return d|0}function mB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;e=h;f=oC(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0,d)|0;g=oC(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0,d)|0;do if((f|0)!=0&(g|0)!=0){c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];e=gB(a,f,g,e)|0;f=(e|0)==0;if(!((d|0)!=0&f)){if(f)break}else {fB(a,b);e=b;}d=c[e>>2]&3;l=h;return ((d|0)==(c[b>>2]&3|0)?e:e+(((d|0)==3?-1:1)*48|0)|0)|0}while(0);l=h;return 0}function nB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=b+8|0;e=d+8|0;e=K6(c[b>>2]|0,c[b+4>>2]|0,c[e>>2]|0,c[e+4>>2]|0)|0;return ((e|0)==0?0:e>>31|1)|0}function oB(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+16|0;g=h;j=pB(e)|0;f=lb[c[(c[j>>2]|0)+4>>2]&127](c[j+12>>2]|0,72)|0;c[f>>2]=c[f>>2]&-4;i=f+64|0;c[i>>2]=j;k=f+24|0;d=c[d>>2]|0;c[k>>2]=d;a[k>>0]=d&255|8;c[f+60>>2]=f;e=lb[c[c[j+4>>2]>>2]&127](f,e)|0;c[(c[i>>2]|0)+16>>2]=e;if(HB(f,0,b,g,1)|0){i=g;j=c[i+4>>2]|0;k=f+8|0;c[k>>2]=c[i>>2];c[k+4>>2]=j;}k=qB(f)|0;LB(k,0,f);l=h;return k|0}function pB(b){b=b|0;var d=0,e=0,f=0,g=0;d=(b|0)!=0;if(d){e=c[b>>2]|0;e=(e|0)==0?18736:e;}else e=18736;g=kb[c[e>>2]&63](b)|0;f=lb[c[e+4>>2]&127](g,80)|0;c[f>>2]=e;c[f+12>>2]=g;if(d){g=c[b+4>>2]|0;c[f+4>>2]=(g|0)==0?18612:g;b=c[b+8>>2]|0;b=(b|0)==0?18712:b;}else {c[f+4>>2]=18612;b=18712;}c[f+8>>2]=b;a[f+52>>0]=1;return f|0}function qB(b){b=b|0;var d=0,e=0;c[b+36>>2]=UD(b,18792,c[4589]|0)|0;c[b+40>>2]=UD(b,18756,c[4589]|0)|0;d=(yC(b)|0)==(b|0);c[b+44>>2]=UD(b,d?18404:18440,c[4589]|0)|0;d=(yC(b)|0)==(b|0);c[b+48>>2]=UD(b,d?18476:18512,c[4589]|0)|0;c[b+52>>2]=UD(b,18548,c[4589]|0)|0;d=QD(b)|0;if(!((d|0)!=0?(e=rB(d,0)|0,c[b>>2]=c[b>>2]&15|e<<4,e=c[d+52>>2]|0,nb[c[e>>2]&63](e,b,1)|0,!(a[d+24>>0]&64)):0))tA(b);zC(b,b);return b|0}function rB(a,b){a=a|0;b=b|0;var d=0;d=(c[a+64>>2]|0)+24+(b<<3)|0;b=d;b=J6(c[b>>2]|0,c[b+4>>2]|0,1,0)|0;a=z;c[d>>2]=b;c[d+4>>2]=a;z=a;return b|0}function sB(b){b=b|0;var d=0,e=0,f=0,g=0;f=QD(b)|0;g=(f|0)==0;if(g?(d=b+64|0,(c[(c[c[d>>2]>>2]|0)+16>>2]|0)!=0):0){DC(b,b);g=b+8|0;JB(b,0,c[g>>2]|0,c[g+4>>2]|0);d=c[d>>2]|0;tb[c[(c[d>>2]|0)+16>>2]&127](c[d+12>>2]|0);d=0;}else e=4;do if((e|0)==4){d=OD(b)|0;while(1){if(!d)break;e=PD(d)|0;sB(d)|0;d=e;}d=jC(b)|0;while(1){if(!d)break;e=kC(b,d)|0;vC(b,d)|0;d=e;}UB(b);DC(b,b);if(((((WD(b,c[b+40>>2]|0)|0)==0?(WD(b,c[b+36>>2]|0)|0)==0:0)?(WD(b,c[b+48>>2]|0)|0)==0:0)?(WD(b,c[b+44>>2]|0)|0)==0:0)?(WD(b,c[b+52>>2]|0)|0)==0:0){if(a[b+24>>0]&64?MA(b)|0:0){d=-1;break}$C(b);e=b+8|0;JB(b,0,c[e>>2]|0,c[e+4>>2]|0);if(!g){RD(f,b)|0;eC(f,b);d=0;break}d=b+64|0;while(1){e=c[d>>2]|0;f=c[e+48>>2]|0;if(!f)break;GC(b,c[f>>2]|0)|0;}tb[c[(c[e+4>>2]|0)+20>>2]&127](c[e+16>>2]|0);if(!(aD(b)|0)){d=c[d>>2]|0;g=c[d+12>>2]|0;f=(c[d>>2]|0)+12|0;ub[c[f>>2]&63](g,b);ub[c[f>>2]&63](g,d);d=0;}else d=-1;}else d=-1;}while(0);return d|0}function tB(a){a=a|0;return Xz(c[a+40>>2]|0)|0}function uB(a){a=a|0;var b=0,c=0,d=0;b=0;c=jC(a)|0;while(1){if(!c)break;d=(vB(a,c,0,1)|0)+b|0;b=d;c=kC(a,c)|0;}return b|0}function vB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=YA(a,b)|0;if(f){if(!e)b=0;else b=wB(c[a+44>>2]|0,f+32|0)|0;if(d)b=(wB(c[a+44>>2]|0,f+28|0)|0)+b|0;}else b=0;return b|0}function wB(a,b){a=a|0;b=b|0;var d=0;Wz(a,c[b>>2]|0)|0;d=Xz(a)|0;c[b>>2]=Sz(a)|0;return d|0}function xB(b){b=b|0;return a[b+24>>0]&1|0}function yB(a){a=a|0;return (xB(a)|0)==0|0}function zB(a){a=a|0;return (d[a+24>>0]|0)>>>1&1|0}function AB(a,b){a=a|0;b=b|0;return a|0}function BB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;if(!d){f=1392;d=c[f>>2]|0;f=c[f+4>>2]|0;c[e>>2]=d;c[e+4>>2]=f;f=J6(d|0,f|0,2,0)|0;e=1392;c[e>>2]=f;c[e+4>>2]=z;}else {if(!f)a=cD(a,d)|0;else a=fD(a,d)|0;c[e>>2]=a;c[e+4>>2]=0;}return 1}function CB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return 0}function DB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((c&1|0)==0&0==0)hD(a,c)|0;return}function EB(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ((c&1|0)==0&0==0?c:0)|0}function FB(a){a=a|0;return}function GB(a,b,c){a=a|0;b=b|0;c=c|0;return}function HB(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=(e|0)!=0;do if(i){if((a[e>>0]|0)!=37?(h=c[b+64>>2]|0,h=pb[c[(c[h+4>>2]|0)+4>>2]&127](c[h+16>>2]|0,d,e,f,g)|0,h|0):0)break;h=MB(b,d,e,f)|0;if(!h)j=5;}else j=5;while(0);if((j|0)==5)if(g){h=c[b+64>>2]|0;h=pb[c[(c[h+4>>2]|0)+4>>2]&127](c[h+16>>2]|0,d,0,f,g)|0;if(i&(h|0)!=0){j=f;NB(b,d,e,c[j>>2]|0,c[j+4>>2]|0);}}else h=0;return h|0}function IB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[a+64>>2]|0;return ob[c[(c[a+4>>2]|0)+8>>2]&127](c[a+16>>2]|0,b,d,e)|0}function JB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;SB(a,b,d,e)|0;a=c[a+64>>2]|0;xb[c[(c[a+4>>2]|0)+12>>2]&31](c[a+16>>2]|0,b,d,e);return}function KB(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;d=xC(a)|0;f=a+8|0;b=f;b=QB(d,c[a>>2]&3,c[b>>2]|0,c[b+4>>2]|0)|0;do if(!b){b=c[d+64>>2]|0;d=c[(c[b+4>>2]|0)+16>>2]|0;if(d|0?(e=f,e=ob[d&127](c[b+16>>2]|0,c[a>>2]&3,c[e>>2]|0,c[e+4>>2]|0)|0,e|0):0){b=e;break}if((c[a>>2]&3|0)==2)b=0;else {e=c[f>>2]|0;f=c[f+4>>2]|0;c[g>>2]=37;b=g+8|0;c[b>>2]=e;c[b+4>>2]=f;m4(194773,96456,g)|0;b=194773;}}while(0);l=h;return b|0}function LB(a,b,d){a=a|0;b=b|0;d=d|0;a=c[a+64>>2]|0;vb[c[(c[a+4>>2]|0)+24>>2]&127](c[a+16>>2]|0,b,d);return}function MB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i;b=c[(c[a+64>>2]|0)+56+(((b|0)==3?2:b)<<2)>>2]|0;if(((b|0)!=0?(f=cD(a,d)|0,(f|0)!=0):0)?(c[h+24>>2]=f,g=nb[c[b>>2]&63](b,h,4)|0,(g|0)!=0):0){d=g+16|0;h=c[d+4>>2]|0;b=e;c[b>>2]=c[d>>2];c[b+4>>2]=h;b=1;}else b=0;l=i;return b|0}function NB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=dC(a,32)|0;g=h+16|0;c[g>>2]=e;c[g+4>>2]=f;c[h+24>>2]=fD(a,d)|0;e=(b|0)==3?2:b;g=a+64|0;d=c[g>>2]|0;b=c[d+56+(e<<2)>>2]|0;if(!b){f=UD(a,18640,c[4589]|0)|0;c[(c[g>>2]|0)+56+(e<<2)>>2]=f;b=c[g>>2]|0;}else {f=b;b=d;}b=c[b+68+(e<<2)>>2]|0;if(!b){b=UD(a,18676,c[4589]|0)|0;c[(c[g>>2]|0)+68+(e<<2)>>2]=b;}nb[c[f>>2]&63](f,h,1)|0;nb[c[b>>2]&63](b,h,1)|0;return}function OB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=b+16|0;b=c[a>>2]|0;a=c[a+4>>2]|0;d=d+16|0;e=c[d>>2]|0;d=c[d+4>>2]|0;return (a>>>0>d>>>0|(a|0)==(d|0)&b>>>0>e>>>0?1:(a>>>0>>0|(a|0)==(d|0)&b>>>0>>0)<<31>>31)|0}function PB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=c[b+24>>2]|0;e=c[d+24>>2]|0;return (b>>>0>e>>>0?1:(b>>>0>>0)<<31>>31)|0}function QB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=RB(a,b,d,e)|0;if(!a)a=0;else a=c[a+24>>2]|0;return a|0}function RB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;f=g;a=c[(c[a+64>>2]|0)+68+(((b|0)==3?2:b)<<2)>>2]|0;if(!a)a=0;else {b=f+16|0;c[b>>2]=d;c[b+4>>2]=e;a=nb[c[a>>2]&63](a,f,4)|0;}l=g;return a|0}function SB(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=(b|0)==3?2:b;b=RB(a,f,d,e)|0;if(!b)b=0;else {e=a+64|0;d=c[(c[e>>2]|0)+56+(f<<2)>>2]|0;nb[c[d>>2]&63](d,b,2)|0;e=c[(c[e>>2]|0)+68+(f<<2)>>2]|0;nb[c[e>>2]&63](e,b,2)|0;hD(a,c[b+24>>2]|0)|0;eC(a,b);b=1;}return b|0}function TB(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;c[46942]=b;g=c[b+64>>2]|0;f=0;while(1){if((f|0)==3)break;h=g+56+(f<<2)|0;d=c[h>>2]|0;a:do if(d|0){d=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!d)break a;e=c[h>>2]|0;e=nb[c[e>>2]&63](e,d,8)|0;if((a[c[d+24>>2]>>0]|0)!=37){d=e;continue}i=d+16|0;SB(b,f,c[i>>2]|0,c[i+4>>2]|0)|0;d=e;}}while(0);f=f+1|0;}return}function UB(a){a=a|0;c[46942]=a;a=a+64|0;VB((c[a>>2]|0)+56|0);VB((c[a>>2]|0)+68|0);return}function VB(a){a=a|0;var b=0,d=0,e=0;b=0;while(1){if((b|0)==3)break;d=a+(b<<2)|0;e=c[d>>2]|0;if(e|0){Rz(e)|0;c[d>>2]=0;}b=b+1|0;}return}function WB(a,b,c){a=a|0;b=b|0;c=c|0;if(!(c4(b,c,a)|0))a=0;else a=l2(b)|0;return a|0}function XB(a,b){a=a|0;b=b|0;return T4(b,a)|0}function YB(a){a=a|0;return M4(a)|0}function ZB(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+32|0;e=b+12|0;d=b;c[4682]=c[4679];c[4683]=c[4680];c[e>>2]=a;c[e+4>>2]=l2(a)|0;c[e+8>>2]=0;c[d>>2]=18736;c[d+4>>2]=18612;c[d+8>>2]=18724;a=jF(e,d)|0;kD(0);l=b;return a|0}function _B(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;if((e|0)!=0?(h=b+8|0,f=c[h>>2]|0,(f|0)<(c[b+4>>2]|0)):0){i=(c[b>>2]|0)+f|0;b=0;g=a[i>>0]|0;f=d;d=i;while(1){d=d+1|0;a[f>>0]=g;b=b+1|0;if(!(g<<24>>24!=10&(b|0)<(e|0)))break;g=a[d>>0]|0;if(!(g<<24>>24))break;else f=f+1|0;}c[h>>2]=(c[h>>2]|0)+b;}else b=0;return b|0}function $B(a){a=a|0;return 0}function aC(a,b){a=a|0;b=b|0;a=T1(b)|0;Y6(a|0,0,b|0)|0;return a|0}function bC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=W1(b,d)|0;if(d>>>0>c>>>0)Y6(a+c|0,0,d-c|0)|0;return a|0}function cC(a,b){a=a|0;b=b|0;U1(b);return}function dC(a,b){a=a|0;b=b|0;var d=0;d=l;l=l+16|0;a=c[a+64>>2]|0;a=lb[c[(c[a>>2]|0)+4>>2]&127](c[a+12>>2]|0,b)|0;if(!a)gA(1,96462,d)|0;l=d;return a|0}function eC(a,b){a=a|0;b=b|0;if(b|0){a=c[a+64>>2]|0;ub[c[(c[a>>2]|0)+12>>2]&63](c[a+12>>2]|0,b);}return}function fC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=(c[b+16>>2]|0)+8|0;b=c[a>>2]|0;a=c[a+4>>2]|0;d=(c[d+16>>2]|0)+8|0;e=c[d>>2]|0;d=c[d+4>>2]|0;return (a>>>0>>0|(a|0)==(d|0)&b>>>0>>0?-1:(a>>>0>d>>>0|(a|0)==(d|0)&b>>>0>e>>>0)&1)|0}function gC(a,b,d){a=a|0;b=b|0;d=d|0;a=c[b+16>>2]|0;if((a+28|0)!=(b|0))eC(c[a+24>>2]|0,b);return}function hC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;b=(c[c[b+16>>2]>>2]|0)>>>4;e=(c[c[d+16>>2]>>2]|0)>>>4;return (b>>>0>>0?-1:b>>>0>e>>>0&1)|0}function iC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=186256;c[e>>2]=b;c[e+4>>2]=d;c[46947]=186248;a=c[a+40>>2]|0;a=nb[c[a>>2]&63](a,187772,4)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function jC(a){a=a|0;a=c[a+36>>2]|0;a=nb[c[a>>2]&63](a,0,128)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function kC(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if((b|0)!=0?(d=c[a+36>>2]|0,d=nb[c[d>>2]&63](d,b,8)|0,(d|0)!=0):0)b=c[d+16>>2]|0;else b=0;return b|0}function lC(a){a=a|0;a=c[a+36>>2]|0;a=nb[c[a>>2]&63](a,0,256)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function mC(a,b){a=a|0;b=b|0;var d=0;b=YA(a,b)|0;if((b|0)!=0?(d=c[a+36>>2]|0,d=nb[c[d>>2]&63](d,b,16)|0,(d|0)!=0):0)b=c[d+16>>2]|0;else b=0;return b|0}function nC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=iC(a,b,c)|0;do if((d|0)!=0&(e|0)==0){e=yC(a)|0;if((e|0)!=(a|0)?(f=iC(e,b,c)|0,f|0):0){oC(a,f,1)|0;e=f;break}if(!(IB(a,1,b,c)|0))e=0;else {e=rB(a,1)|0;e=pC(a,b,c,e,z)|0;qC(a,e);rC(a,e);}}while(0);return e|0}function oC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=yC(a)|0;if((e|0)==(c[b+24>>2]|0)){e=b+8|0;e=iC(a,c[e>>2]|0,c[e+4>>2]|0)|0;if((d|0)!=0&(e|0)==0){e=QD(a)|0;if(!e)e=0;else {d=oC(e,b,d)|0;sC(a,d);return d|0}}}else e=0;return e|0}function pC(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;g=dC(b,64)|0;h=c[g>>2]|0;i=g+8|0;c[i>>2]=d;c[i+4>>2]=e;c[g>>2]=h&12|f<<4|1;c[g+24>>2]=yC(b)|0;if(a[(yC(b)|0)+24>>0]&64)TC(g,96404,16,0)|0;return g|0}function qC(a,b){a=a|0;b=b|0;do{sC(a,b);a=QD(a)|0;}while((a|0)!=0);return}function rC(b,c){b=b|0;c=c|0;if(a[(yC(b)|0)+24>>0]&64)uA(b,c);zC(b,c);return}function sC(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+40|0;Xz(c[e>>2]|0)|0;if((yC(a)|0)==(a|0))d=b+28|0;else d=dC(a,36)|0;c[d+16>>2]=b;e=c[e>>2]|0;nb[c[e>>2]&63](e,d,1)|0;e=c[a+36>>2]|0;nb[c[e>>2]&63](e,d,1)|0;return}function tC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;h=yC(a)|0;if(HB(a,1,b,g,0)|0){e=g;e=iC(a,c[e>>2]|0,c[e+4>>2]|0)|0;if(!e)if(!((d|0)==0|(h|0)==(a|0))?(f=g,f=iC(h,c[f>>2]|0,c[f+4>>2]|0)|0,(f|0)!=0):0)e=oC(a,f,1)|0;else i=6;}else i=6;if((i|0)==6)if((d|0)!=0?(HB(a,1,b,g,1)|0)!=0:0){i=g;h=c[i>>2]|0;i=c[i+4>>2]|0;e=rB(a,1)|0;e=pC(a,h,i,e,z)|0;qC(a,e);rC(a,e);LB(a,1,e);}else e=0;l=j;return e|0}function uC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;c[46956]=b;d=aB(a,b)|0;while(1){if(!d)break;e=bB(a,d,b)|0;jB(a,d,0);d=e;}e=c[a+40>>2]|0;nb[c[e>>2]&63](e,187808,2)|0;e=c[a+36>>2]|0;nb[c[e>>2]&63](e,187808,2)|0;return}function vC(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d+8|0;e=f;if(iC(b,c[e>>2]|0,c[e+4>>2]|0)|0){if((yC(b)|0)==(b|0)){e=aB(b,d)|0;while(1){if(!e)break;g=bB(b,e,d)|0;lB(b,e)|0;e=g;}if(a[b+24>>0]&64)OA(d);DC(b,d);$C(d);g=f;JB(b,1,c[g>>2]|0,c[g+4>>2]|0);}if(!(BE(b,d,59,0,0)|0))if((yC(b)|0)==(b|0)){eC(b,d);e=0;}else e=0;else e=-1;}else e=-1;return e|0}function wC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;e=h;d=c[b>>2]|0;do if(!(d&3))if((QD(b)|0)==(a|0)){d=c[b>>2]|0;g=5;break}else {gA(1,96488,e)|0;f=-1;break}else g=5;while(0);a:do if((g|0)==5)switch(d&3){case 1:{f=vC(a,b)|0;break a}case 2:case 3:{f=lB(a,b)|0;break a}case 0:{f=sB(b)|0;break a}default:{}}while(0);l=h;return f|0}function xC(a){a=a|0;var b=0;switch(c[a>>2]&3){case 2:case 3:{b=c[(c[a+40>>2]|0)+24>>2]|0;break}case 1:{b=c[a+24>>2]|0;break}case 0:{b=a;break}default:{}}return b|0}function yC(a){a=a|0;var b=0;switch(c[a>>2]&3){case 2:case 3:{b=(c[a+40>>2]|0)+24|0;break}case 1:{b=a+24|0;break}case 0:{b=a+60|0;break}default:{}}return c[b>>2]|0}function zC(b,d){b=b|0;d=d|0;var e=0;e=c[b+64>>2]|0;if(!(a[e+52>>0]|0))JC(b,d,100,0);else AC(b,d,c[e+48>>2]|0);return}function AC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a:do if(d|0){AC(a,b,c[d+8>>2]|0);switch(c[b>>2]&3){case 0:{e=c[d>>2]|0;break}case 1:{e=(c[d>>2]|0)+12|0;break}case 2:{e=(c[d>>2]|0)+24|0;break}default:break a}e=c[e>>2]|0;if(e|0)vb[e&127](a,b,c[d+4>>2]|0);}while(0);return}function BC(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=c[b+64>>2]|0;if(!(a[f+52>>0]|0))JC(b,d,101,e);else CC(b,d,e,c[f+48>>2]|0);return}function CC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a:do if(e|0){CC(a,b,d,c[e+8>>2]|0);switch(c[b>>2]&3){case 0:{f=(c[e>>2]|0)+4|0;break}case 1:{f=(c[e>>2]|0)+16|0;break}case 2:{f=(c[e>>2]|0)+28|0;break}default:break a}f=c[f>>2]|0;if(f|0)xb[f&31](a,b,c[e+4>>2]|0,d);}while(0);return}function DC(b,d){b=b|0;d=d|0;var e=0;e=c[b+64>>2]|0;if(!(a[e+52>>0]|0))JC(b,d,102,0);else EC(b,d,c[e+48>>2]|0);return}function EC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a:do if(d|0){EC(a,b,c[d+8>>2]|0);switch(c[b>>2]&3){case 0:{e=(c[d>>2]|0)+8|0;break}case 1:{e=(c[d>>2]|0)+20|0;break}case 2:{e=(c[d>>2]|0)+32|0;break}default:break a}e=c[e>>2]|0;if(e|0)vb[e&127](a,b,c[d+4>>2]|0);}while(0);return}function FC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=dC(a,12)|0;c[e>>2]=b;c[e+4>>2]=d;d=(c[a+64>>2]|0)+48|0;c[e+8>>2]=c[d>>2];c[d>>2]=e;return}function GC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=(c[a+64>>2]|0)+48|0;d=c[e>>2]|0;a:do if(!d)d=-1;else {if((c[d>>2]|0)!=(b|0)){while(1){if(!d){d=-1;break a}e=d+8|0;f=c[e>>2]|0;if((c[f>>2]|0)==(b|0))break;else d=f;}if(f)c[e>>2]=c[f+8>>2];}else c[e>>2]=c[d+8>>2];eC(a,d);d=0;}while(0);return d|0}function HC(a,b){a=a|0;b=b|0;var d=0;d=yC(a)|0;a:do if((d|0)==(yC(b)|0))switch(c[b>>2]&3){case 0:{while(1){if((b|0)==(a|0)){b=1;break a}b=QD(b)|0;if(!b){b=0;break}}break}case 1:{b=b+8|0;b=(nC(a,c[b>>2]|0,c[b+4>>2]|0,0)|0)!=0;break a}default:{b=(mB(a,b,0)|0)!=0;break a}}else b=0;while(0);return b&1|0}function IC(a){a=a|0;return c[a>>2]&3|0}function JC(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=TC(a,96512,44,0)|0;switch(c|0){case 100:{e=KC(f,b,100)|0;if(!(LC(e,b)|0))MC(e,a,b,d)|0;break}case 101:{if(((LC(KC(f,b,100)|0,b)|0)==0?(LC(KC(f,b,102)|0,b)|0)==0:0)?(e=KC(f,b,101)|0,(LC(e,b)|0)==0):0)MC(e,a,b,d)|0;break}case 102:{NC(KC(f,b,100)|0,b);NC(KC(f,b,101)|0,b);e=KC(f,b,102)|0;if(!(LC(e,b)|0))MC(e,a,b,d)|0;break}default:gA(1,96524,g)|0;}l=h;return}function KC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;e=g;a:do switch(c[b>>2]&3){case 0:switch(d|0){case 100:{d=a+8|0;break a}case 101:{d=a+20|0;break a}case 102:{d=a+32|0;break a}default:{f=14;break a}}case 1:switch(d|0){case 100:{d=a+12|0;break a}case 101:{d=a+24|0;break a}case 102:{d=a+36|0;break a}default:{f=14;break a}}case 2:switch(d|0){case 100:{d=a+16|0;break a}case 101:{d=a+28|0;break a}case 102:{d=a+40|0;break a}default:{f=14;break a}}default:f=14;}while(0);if((f|0)==14){gA(1,96558,e)|0;d=0;}a=c[d>>2]|0;if(!a){a=xC(b)|0;a=UD(a,18828,c[4589]|0)|0;c[d>>2]=a;}l=g;return a|0}function LC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+32|0;e=d;f=OC(b)|0;b=e+8|0;c[b>>2]=f;c[b+4>>2]=z;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function MC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=dC(xC(d)|0,32)|0;c[f+20>>2]=d;g=OC(d)|0;d=f+8|0;c[d>>2]=g;c[d+4>>2]=z;c[f+16>>2]=b;if(e|0){g=dC(b,8)|0;c[f+24>>2]=g;c[g>>2]=e;}nb[c[a>>2]&63](a,f,1)|0;return f|0}function NC(a,b){a=a|0;b=b|0;b=LC(a,b)|0;if(b|0)nb[c[a>>2]&63](a,b,2)|0;return}function OC(a){a=a|0;a=a+8|0;z=c[a+4>>2]|0;return c[a>>2]|0}function PC(a,b,d){a=a|0;b=b|0;d=d|0;QC(b);eC(c[b+16>>2]|0,b);return}function QC(a){a=a|0;var b=0,d=0;b=a+16|0;a=c[a+24>>2]|0;while(1){if(!a)break;d=c[a+4>>2]|0;eC(c[b>>2]|0,a);a=d;}return}function RC(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;i=k;h=c[b+16>>2]|0;f=h;while(1){if(!f){f=0;break}g=c[f>>2]|0;if((g|0)==(d|0)){j=7;break}if((a[d>>0]|0)==(a[g>>0]|0)?(s2(d,g)|0)==0:0){j=7;break}f=c[f+4>>2]|0;if((f|0)==(h|0)){f=0;break}}do if((j|0)==7){if(!(c[b>>2]&4)){if((f|0)==(h|0)&(e|0)==0){f=h;break}SC(b,f,e);break}if(e)if((h|0)==(f|0))f=h;else gA(1,96583,i)|0;}while(0);l=k;return f|0}function SC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;c[a+16>>2]=b;e=c[a>>2]|0;d=d<<2&4;c[a>>2]=e&-5|d;if(e&2|0){e=(e&3|0)==3?-1:1;c[a+(e*48|0)+16>>2]=b;e=a+(e*48|0)|0;c[e>>2]=c[e>>2]&-5|d;}return}function TC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=xC(a)|0;f=RC(a,b,0)|0;a:do if((d|0)!=0&(f|0)==0){d=dC(h,d)|0;c[d>>2]=fD(h,b)|0;switch(c[a>>2]&3){case 0:{UC(a,d);g=d;break a}case 1:{UC(a,d);g=d;break a}case 2:case 3:{UC(a,d);g=d;break a}default:{}}}else g=f;while(0);if(e|0)RC(a,b,1)|0;return g|0}function UC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[a+16>>2]|0;do if(d){e=d+4|0;f=c[e>>2]|0;if((f|0)==(d|0)){c[e>>2]=b;e=d;d=b;break}else {c[b+4>>2]=f;e=b;break}}else {e=b;d=b;}while(0);c[d+4>>2]=e;if(!(c[a>>2]&4))SC(a,b,0);return}function VC(a,b){a=a|0;b=b|0;var d=0,e=0;e=xC(a)|0;d=RC(a,b,0)|0;if(!d)b=-1;else {WC(a,d);if(!(c[a>>2]&3)){XC(e,a,d);b=d;}else {BE(yC(e)|0,a,60,d,0)|0;b=d;}hD(e,c[d>>2]|0)|0;eC(e,b);b=0;}return b|0}function WC(a,b){a=a|0;b=b|0;var d=0;a=c[a+16>>2]|0;do{d=a+4|0;a=c[d>>2]|0;}while((a|0)!=(b|0));c[d>>2]=c[b+4>>2];return}function XC(a,b,d){a=a|0;b=b|0;d=d|0;if((c[b+16>>2]|0)==(d|0)){a=c[d+4>>2]|0;SC(b,(a|0)==(d|0)?0:a,0);}return}function YC(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=(d|0)>-1;g=f?d:0-d|0;a:do switch(b|0){case 0:{TC(a,c,g,e)|0;if(!f){b=OD(a)|0;while(1){if(!b)break a;YC(b,0,c,d,e);b=PD(b)|0;}}break}case 3:case 2:case 1:{d=(b|0)==1;b=jC(a)|0;while(1){if(!b)break a;b:do if(d)TC(b,c,g,e)|0;else {f=XA(a,b)|0;while(1){if(!f)break b;TC(f,c,g,e)|0;f=ZA(a,f)|0;}}while(0);b=kC(a,b)|0;}}default:{}}while(0);return}function ZC(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;a:do switch(b|0){case 0:{BE(a,a,61,c,1)|0;break}case 3:case 2:case 1:{e=(b|0)==1;d=jC(a)|0;while(1){if(!d)break a;b:do if(e)VC(d,c)|0;else {b=XA(a,d)|0;while(1){if(!b)break b;VC(b,c)|0;b=ZA(a,b)|0;}}while(0);d=kC(a,d)|0;}}default:{}}while(0);return}function _C(a,b,c){a=a|0;b=b|0;c=c|0;VC(b,c)|0;return}function $C(a){a=a|0;var b=0,d=0,e=0;d=xC(a)|0;b=a+16|0;a=c[b>>2]|0;if(a|0)do{e=a;a=c[a+4>>2]|0;hD(d,c[e>>2]|0)|0;eC(d,e);}while((a|0)!=(c[b>>2]|0));c[b>>2]=0;return}function aD(a){a=a|0;return WD(a,bD(a)|0)|0}function bD(a){a=a|0;var b=0,d=0;if(!a)d=187844;else d=(c[a+64>>2]|0)+20|0;b=c[d>>2]|0;if(!b){b=UD(a,18864,c[4589]|0)|0;c[d>>2]=b;a=186312;c[a>>2]=-2147483648;c[a+4>>2]=0;a=186320;c[a>>2]=2147483647;c[a+4>>2]=-1;}return b|0}function cD(a,b){a=a|0;b=b|0;return dD(bD(a)|0,b)|0}function dD(a,b){a=a|0;b=b|0;a=eD(a,b)|0;if(!a)a=0;else a=c[a+16>>2]|0;return a|0}function eD(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+32|0;e=d;c[e+16>>2]=b;b=nb[c[a>>2]&63](a,e,4)|0;l=d;return b|0}function fD(a,b){a=a|0;b=b|0;var d=0,e=0;if(!b)d=0;else {e=bD(a)|0;d=eD(e,b)|0;if(!d){d=(l2(b)|0)+24|0;if(!a)d=T1(d)|0;else d=dC(a,d)|0;a=d+8|0;c[a>>2]=1;c[a+4>>2]=0;a=d+20|0;r3(a,b)|0;c[d+16>>2]=a;nb[c[e>>2]&63](e,d,1)|0;}else {e=d+8|0;b=e;b=J6(c[b>>2]|0,c[b+4>>2]|0,1,0)|0;c[e>>2]=b;c[e+4>>2]=z;}d=c[d+16>>2]|0;}return d|0}function gD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!b)d=0;else {e=bD(a)|0;d=eD(e,b)|0;if(!d){d=(l2(b)|0)+24|0;if(!a)d=T1(d)|0;else d=dC(a,d)|0;g=186312;f=c[g+4>>2]|0;a=d+8|0;c[a>>2]=c[g>>2]|1;c[a+4>>2]=f;a=d+20|0;r3(a,b)|0;c[d+16>>2]=a;nb[c[e>>2]&63](e,d,1)|0;}else {g=d+8|0;f=g;f=J6(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;c[g>>2]=f;c[g+4>>2]=z;}d=c[d+16>>2]|0;}return d|0}function hD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if((b|0)!=0?(d=bD(a)|0,e=eD(d,b)|0,(e|0)!=0):0)if((c[e+16>>2]|0)==(b|0)?(b=e+8|0,g=b,g=J6(c[g>>2]|0,c[g+4>>2]|0,-1,-1)|0,f=z,b,c[b>>2]=g,c[b+4>>2]=f,b=186320,(g|0)==0&(f|0)==0|(c[b>>2]|0)==0&(c[b+4>>2]|0)==0):0){VD(a,d,e)|0;a=0;}else a=0;else a=-1;return a|0}function iD(a){a=a|0;var b=0;if(!a)a=0;else {a=a+-12|0;b=186312;a=c[b>>2]&c[a>>2];}return a|0}function jD(a){a=a|0;var b=0,d=0,e=0;if(a|0){d=186312;a=a+-12|0;e=a;b=c[e+4>>2]|c[d+4>>2];c[a>>2]=c[e>>2]|c[d>>2];c[a+4>>2]=b;}return}function kD(a){a=a|0;c[46966]=a;c[4725]=1;return}function lD(a,b){a=a|0;b=b|0;c[46967]=a;c[46968]=b;c[46969]=0;return}function mD(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(!(c[46970]|0)){c[46970]=1;if(!(c[46971]|0))c[46971]=1;if(!(c[46962]|0))c[46962]=c[15647];if(!(c[46963]|0))c[46963]=c[15679];k=c[46972]|0;if(!((k|0)!=0?(c[k>>2]|0)!=0:0)){nD();k=oD(c[46962]|0,16384)|0;c[c[46972]>>2]=k;}pD();}a:while(1){j=c[46973]|0;a[j>>0]=a[194805]|0;e=(c[(c[c[46972]>>2]|0)+28>>2]|0)+(c[46971]|0)|0;f=j;b:while(1){h=f;while(1){f=c[18904+(d[h>>0]<<2)>>2]|0;if(b[63856+(e<<1)>>1]|0){c[46974]=e;c[46975]=h;}c:while(1){g=f&255;do{f=g+(b[64042+(e<<1)>>1]|0)|0;if((e|0)==(b[64252+(f<<1)>>1]|0))break c;k=b[64788+(e<<1)>>1]|0;e=k<<16>>16;}while(k<<16>>16<=92);f=c[19928+(g<<2)>>2]|0;}e=b[64998+(f<<1)>>1]|0;f=h+1|0;if((b[64042+(e<<1)>>1]|0)==219)break;else h=f;}d:while(1){k=j;e:while(1){e=b[63856+(e<<1)>>1]|0;if(!(e<<16>>16)){e=b[63856+(c[46974]<<1)>>1]|0;f=c[46975]|0;}else e=e<<16>>16;c[46964]=j;i=f;c[46965]=i-k;a[194805]=a[f>>0]|0;a[f>>0]=0;c[46973]=f;f:while(1){switch(e|0){case 1:{m=27;break a}case 12:{m=53;break a}case 13:{m=55;break a}case 14:{m=57;break a}case 15:{m=61;break a}case 16:{m=65;break a}case 17:{m=67;break a}case 18:{m=69;break a}case 19:{m=72;break a}case 20:{m=75;break a}case 21:{m=78;break a}case 23:{m=86;break a}case 33:{m=118;break a}case 39:case 38:case 37:case 36:{l=0;break a}case 2:{m=29;break b}case 3:{m=32;break b}case 4:{m=35;break b}case 5:{m=37;break b}case 6:{m=39;break b}case 7:{m=42;break b}case 8:{m=44;break b}case 9:{m=47;break b}case 10:{m=49;break b}case 11:{m=51;break b}case 22:{m=83;break b}case 24:{m=89;break b}case 25:{m=92;break b}case 26:{m=95;break b}case 27:{m=98;break b}case 28:{m=101;break b}case 29:{m=104;break b}case 30:{m=109;break b}case 31:{m=112;break b}case 32:{m=115;break b}case 34:{m=121;break b}case 0:break f;case 35:break;default:{m=134;break a}}h=c[46964]|0;a[f>>0]=a[194805]|0;e=c[46972]|0;g=c[e>>2]|0;if(!(c[g+44>>2]|0)){n=c[g+16>>2]|0;c[46977]=n;c[g>>2]=c[46962];g=c[e>>2]|0;c[g+44>>2]=1;e=n;}else e=c[46977]|0;if((c[46973]|0)>>>0<=((c[g+4>>2]|0)+e|0)>>>0){m=128;break e}switch(yD()|0){case 0:{m=132;break d}case 2:{m=133;break e}case 1:break;default:continue a}c[46973]=c[46964];e=(((c[46971]|0)+-1|0)/2|0)+36|0;}a[f>>0]=a[194805]|0;f=c[46975]|0;e=c[46974]|0;}if((m|0)==128){m=0;g=i-h|0;h=c[46964]|0;f=h+(g+-1)|0;c[46973]=f;e=wD()|0;i=xD(e)|0;j=c[46964]|0;if(!i)continue;else {m=129;break}}else if((m|0)==133){m=0;f=(c[(c[c[46972]>>2]|0)+4>>2]|0)+(c[46977]|0)|0;c[46973]=f;e=wD()|0;j=c[46964]|0;continue}}if((m|0)==129){m=0;f=h+g|0;c[46973]=f;e=i;continue}else if((m|0)==132){m=0;f=(c[46964]|0)+(i-h+-1)|0;c[46973]=f;e=wD()|0;j=c[46964]|0;continue}}switch(m|0){case 29:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[4725]=(c[4725]|0)+1;continue a}case 32:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=3;continue a}case 35:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 37:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 39:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=1;continue a}case 42:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 44:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;qD();continue a}case 47:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 49:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 51:{m=0;e=c[46965]|0;if(!e)continue a;c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;continue a}case 83:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=5;sD();continue a}case 89:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;uD(98744);continue a}case 92:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;uD(96616);continue a}case 95:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[4725]=(c[4725]|0)+1;continue a}case 98:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);continue a}case 101:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=7;c[46976]=1;sD();continue a}case 104:{m=0;e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;n=(c[46976]|0)+-1|0;c[46976]=n;if(!n){m=108;break a}uD(c[46964]|0);continue a}case 109:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;c[46976]=(c[46976]|0)+1;uD(e);continue a}case 112:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);c[4725]=(c[4725]|0)+1;continue a}case 115:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;uD(e);continue a}case 121:{m=0;f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;U4(e,f,1,c[46963]|0)|0;continue a}}}switch(m|0){case 27:{e=c[46965]|0;if(!e)l=-1;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=-1;}break}case 53:{e=c[46965]|0;if(!e)l=259;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=259;}break}case 55:{e=c[46965]|0;if(!e)l=260;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=260;}break}case 57:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(!(c[46969]|0)){c[46969]=258;l=258;}else l=258;break}case 61:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(!(c[46969]|0)){c[46969]=261;l=261;}else l=261;break}case 65:{e=c[46965]|0;if(!e)l=263;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=263;}break}case 67:{e=c[46965]|0;if(!e)l=262;else {c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=262;}break}case 69:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=(c[46969]|0)==261?264:45;break}case 72:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;l=(c[46969]|0)==258?264:45;break}case 75:{f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;c[46992]=fD(c[46942]|0,e)|0;l=267;break}case 78:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;if(rD()|0){m=(c[46965]|0)+-1|0;a[f>>0]=a[194805]|0;n=j+m|0;c[46973]=n;c[46964]=j;c[46965]=m;a[194805]=a[n>>0]|0;a[n>>0]=0;c[46973]=n;}c[46992]=fD(c[46942]|0,c[46964]|0)|0;l=267;break}case 86:{e=c[46965]|0;if(e|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[(c[46964]|0)+(e+-1)>>0]|0)==10&1;c[46971]=1;tD();l=268;break}case 108:{c[46971]=1;vD();l=268;break}case 118:{f=c[46965]|0;e=c[46964]|0;if(f|0)c[(c[c[46972]>>2]|0)+28>>2]=(a[e+(f+-1)>>0]|0)==10&1;l=a[e>>0]|0;break}case 134:{zD(96619);break}}return l|0}function nD(){var a=0,b=0,d=0;b=c[46972]|0;do if(!b){a=GD(4)|0;c[46972]=a;if(!a)zD(96977);else {c[a>>2]=0;a=1;d=9;break}}else {a=c[46983]|0;if(0>=(a+-1|0)>>>0){a=a+8|0;b=AD(b,a<<2)|0;c[46972]=b;if(!b)zD(96977);else {d=b+(c[46983]<<2)|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+24>>2]=0;c[d+28>>2]=0;d=9;break}}}while(0);if((d|0)==9)c[46983]=a;return}function oD(a,b){a=a|0;b=b|0;var d=0;d=GD(48)|0;if(!d)zD(96932);c[d+12>>2]=b;b=GD(b+2|0)|0;c[d+4>>2]=b;if(!b)zD(96932);else {c[d+20>>2]=1;CD(d,a);return d|0}return 0}function pD(){var b=0,d=0;d=c[46972]|0;b=c[d>>2]|0;c[46977]=c[b+16>>2];b=c[b+8>>2]|0;c[46973]=b;c[46964]=b;c[46962]=c[c[d>>2]>>2];a[194805]=a[b>>0]|0;return}function qD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g;d=g+16|0;e=g+12|0;h=c[46964]|0;b=h+1|0;i=(Q2(b,96916,4)|0)==0;b=i?h+5|0:b;c[f>>2]=e;c[f+4>>2]=g+20;c[f+8>>2]=d;f=b5(b,96921,f)|0;if((f|0)>0?(c[4725]=(c[e>>2]|0)+-1,(f|0)!=1):0){d=b+(c[d>>2]|0)|0;b=d;a:while(1){e=a[b>>0]|0;switch(e<<24>>24){case 0:case 34:break a;default:{}}b=b+1|0;}if((b|0)!=(d|0)&e<<24>>24==34){a[b>>0]=0;FD(d,b-d|0);}}l=g;return}function rD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+2080|0;i=j+8|0;f=j;b=j+1056|0;d=j+32|0;h=j+16|0;k=a[(c[46964]|0)+((c[46965]|0)+-1)>>0]|0;e=k<<24>>24==46;if(e|((k&255)+-48|0)>>>0<10)if(e?(ED()|0)!=0:0)g=4;else b=0;else g=4;if((g|0)==4){k=c[46966]|0;kA(h,1024,b);nA(h,96827)|0;nA(h,c[46964]|0)|0;c[f>>2]=c[4725];m4(d,96871,f)|0;nA(h,d)|0;nA(h,(k|0)==0?96821:k)|0;nA(h,96888)|0;d=h+4|0;b=c[d>>2]|0;if(b>>>0>=(c[h+8>>2]|0)>>>0){lA(h,1)|0;b=c[d>>2]|0;}a[b>>0]=0;b=c[h>>2]|0;c[d>>2]=b;c[i>>2]=b;gA(0,96913,i)|0;oA(h);b=1;}l=j;return b|0}function sD(){var b=0;b=c[46978]|0;if(!b){b=T1(1024)|0;c[46978]=b;c[46980]=b+1024;}c[46979]=b;a[b>>0]=0;return}function tD(){c[46992]=fD(c[46942]|0,c[46978]|0)|0;a[c[46978]>>0]=0;return}function uD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=c[46979]|0;d=c[46978]|0;if(e>>>0>d>>>0){e=e+-1|0;f=3;}a:while(1){if((f|0)==3)c[46979]=e;f=c[46980]|0;g=f;do{h=b;b=b+1|0;h=a[h>>0]|0;i=e;e=e+1|0;a[i>>0]=h;if(!(h<<24>>24))break a}while(e>>>0>>0);c[46979]=e;f=d;i=g-f<<1;d=W1(d,i)|0;c[46978]=d;c[46980]=d+i;e=d+(e-f)|0;f=3;}c[46979]=e;return}function vD(){c[46992]=gD(c[46942]|0,c[46978]|0)|0;a[c[46978]>>0]=0;return}function wD(){var d=0,e=0,f=0,g=0,h=0;h=c[46973]|0;g=c[46964]|0;e=(c[(c[c[46972]>>2]|0)+28>>2]|0)+(c[46971]|0)|0;while(1){if(g>>>0>=h>>>0)break;d=a[g>>0]|0;if(!(d<<24>>24))d=1;else d=c[18904+((d&255)<<2)>>2]|0;if(b[63856+(e<<1)>>1]|0){c[46974]=e;c[46975]=g;}a:while(1){f=d&255;do{d=f+(b[64042+(e<<1)>>1]|0)|0;if((e|0)==(b[64252+(d<<1)>>1]|0))break a;d=b[64788+(e<<1)>>1]|0;e=d<<16>>16;}while(d<<16>>16<=92);d=c[19928+(f<<2)>>2]|0;}g=g+1|0;e=b[64998+(d<<1)>>1]|0;}return e|0}function xD(a){a=a|0;var d=0;if(b[63856+(a<<1)>>1]|0){d=c[46973]|0;c[46974]=a;c[46975]=d;}while(1){d=(b[64042+(a<<1)>>1]|0)+1|0;if((a|0)==(b[64252+(d<<1)>>1]|0))break;a=b[64788+(a<<1)>>1]|0;}d=b[64998+(d<<1)>>1]|0;return (d<<16>>16==92?0:d<<16>>16)|0}function yD(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[46972]|0;g=c[j>>2]|0;i=c[g+4>>2]|0;f=c[46964]|0;l=c[46973]|0;k=l;if(l>>>0>(i+((c[46977]|0)+1)|0)>>>0)zD(96674);h=k-f|0;if(!(c[g+40>>2]|0))b=(h|0)==1?1:2;else {l=h+-1|0;h=i;g=0;while(1){if((g|0)>=(l|0))break;a[h>>0]=a[f>>0]|0;h=h+1|0;f=f+1|0;g=g+1|0;}f=c[j>>2]|0;do if((c[f+44>>2]|0)==2){c[46977]=0;c[f+16>>2]=0;e=f;m=17;}else {while(1){i=f+12|0;h=c[i>>2]|0;g=h-l+-1|0;if(g|0){m=16;break}g=f+4|0;j=c[g>>2]|0;if(!(c[f+20>>2]|0)){m=12;break}f=h<<1;f=(f|0)==0?(h>>>3)+h|0:f;c[i>>2]=f;f=AD(j,f+2|0)|0;c[g>>2]=f;if(!f)break;j=f+(k-j)|0;c[46973]=j;f=c[c[46972]>>2]|0;k=j;}if((m|0)==12)c[g>>2]=0;else if((m|0)==16){d=nb[c[c[(c[46967]|0)+8>>2]>>2]&63](c[46968]|0,(c[f+4>>2]|0)+l|0,g>>>0<8192?g:8192)|0;e=c[c[46972]>>2]|0;c[46977]=d;c[e+16>>2]=d;if(!d){m=17;break}else {b=0;break}}zD(96730);}while(0);do if((m|0)==17)if(!l){BD(c[46962]|0);b=1;d=c[46977]|0;e=c[c[46972]>>2]|0;break}else {c[e+44>>2]=2;b=2;d=0;break}while(0);f=d+l|0;do if(f>>>0>(c[e+12>>2]|0)>>>0){m=AD(c[e+4>>2]|0,f+(d>>>1)|0)|0;d=c[46972]|0;c[(c[d>>2]|0)+4>>2]=m;d=c[(c[d>>2]|0)+4>>2]|0;if(!d)zD(96774);else {n=c[46977]|0;o=d;break}}else {n=d;o=c[e+4>>2]|0;}while(0);n=n+l|0;c[46977]=n;a[o+n>>0]=0;o=c[46972]|0;a[(c[(c[o>>2]|0)+4>>2]|0)+((c[46977]|0)+1)>>0]=0;c[46964]=c[(c[o>>2]|0)+4>>2];}return b|0}function zD(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=c[15712]|0;c[b>>2]=a;w4(d,96670,b)|0;Sa(2);}function AD(a,b){a=a|0;b=b|0;return W1(a,b)|0}function BD(a){a=a|0;var b=0,d=0,e=0;d=c[46972]|0;if((d|0)!=0?(b=c[d>>2]|0,(b|0)!=0):0)e=4;else {nD();b=oD(c[46962]|0,16384)|0;d=c[46972]|0;c[d>>2]=b;if(!d)b=0;else e=4;}CD(b,a);pD();return}function CD(a,b){a=a|0;b=b|0;var d=0;d=c[(d2()|0)>>2]|0;DD(a);c[a>>2]=b;c[a+40>>2]=1;b=c[46972]|0;if(!b)b=0;else b=c[b>>2]|0;if((b|0)!=(a|0)){c[a+32>>2]=1;c[a+36>>2]=0;}c[a+24>>2]=0;c[(d2()|0)>>2]=d;return}function DD(b){b=b|0;var d=0;if(b|0){c[b+16>>2]=0;d=b+4|0;a[c[d>>2]>>0]=0;a[(c[d>>2]|0)+1>>0]=0;c[b+8>>2]=c[d>>2];c[b+28>>2]=1;c[b+44>>2]=0;d=c[46972]|0;if(!d)d=0;else d=c[d>>2]|0;if((d|0)==(b|0))pD();}return}function ED(){var b=0,d=0;d=c[46964]|0;b=(c[46965]|0)+-2|0;while(1){if((b|0)<=-1){b=0;break}if((a[d+b>>0]|0)==46){b=1;break}else b=b+-1|0;}return b|0}function FD(a,b){a=a|0;b=b|0;var d=0;d=c[46981]|0;if((d|0)<(b|0)){if(!d)d=T1(b+1|0)|0;else d=W1(c[46982]|0,b+1|0)|0;c[46982]=d;c[46981]=b;}else d=c[46982]|0;r3(d,a)|0;c[46966]=c[46982];return}function GD(a){a=a|0;return T1(a)|0}function HD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+2112|0;k=m+32|0;i=m+24|0;h=m+16|0;g=m+8|0;f=m;d=m+56|0;j=m+40|0;kA(j,1024,m+1080|0);e=c[46966]|0;if(e|0){nA(j,e)|0;nA(j,97027)|0;}nA(j,b)|0;c[f>>2]=c[4725];m4(d,97030,f)|0;nA(j,d)|0;a:do if(!(a[c[46964]>>0]|0))switch(((c[46971]|0)+-1|0)/2|0|0){case 2:{c[g>>2]=16384;m4(d,97050,g)|0;nA(j,d)|0;b=c[46978]|0;if(!(a[b>>0]|0))break a;i=l2(b)|0;nA(j,97112)|0;b=c[46978]|0;if((i|0)>80)a[b+80>>0]=0;nA(j,b)|0;break a}case 3:{c[h>>2]=16384;m4(d,97131,h)|0;nA(j,d)|0;b=c[46978]|0;if(!(a[b>>0]|0))break a;i=l2(b)|0;nA(j,97199)|0;b=c[46978]|0;if((i|0)>80)a[b+80>>0]=0;nA(j,b)|0;break a}case 1:{c[i>>2]=16384;m4(d,97218,i)|0;nA(j,d)|0;break a}default:break a}else {nA(j,97042)|0;nA(j,c[46964]|0)|0;d=j+4|0;b=c[d>>2]|0;if(b>>>0>=(c[j+8>>2]|0)>>>0){lA(j,1)|0;b=c[d>>2]|0;}c[d>>2]=b+1;a[b>>0]=39;}while(0);e=j+4|0;b=c[e>>2]|0;d=j+8|0;if(b>>>0>=(c[d>>2]|0)>>>0){lA(j,1)|0;b=c[e>>2]|0;}c[e>>2]=b+1;a[b>>0]=10;b=c[e>>2]|0;if(b>>>0>=(c[d>>2]|0)>>>0){lA(j,1)|0;b=c[e>>2]|0;}a[b>>0]=0;i=c[j>>2]|0;c[e>>2]=i;c[k>>2]=i;gA(1,96913,k)|0;oA(j);l=m;return}function ID(){JD(c[46964]|0);return}function JD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=c[46973]|0;a[j>>0]=a[194805]|0;i=c[46972]|0;e=c[i>>2]|0;d=c[e+4>>2]|0;if(j>>>0<(d+2|0)>>>0){f=d+((c[46977]|0)+2)|0;g=d+((c[e+12>>2]|0)+2)|0;k=d;h=e;while(1){if(f>>>0<=k>>>0)break;e=f+-1|0;k=g+-1|0;a[k>>0]=a[e>>0]|0;h=c[i>>2]|0;f=e;g=k;k=c[h+4>>2]|0;}e=g-f|0;d=j+e|0;j=c[h+12>>2]|0;c[46977]=j;c[h+16>>2]=j;if(d>>>0<(k+2|0)>>>0)zD(97277);else {l=b+e|0;m=d;}}else {l=b;m=j;}b=m+-1|0;a[b>>0]=64;c[46964]=l;a[194805]=a[b>>0]|0;c[46973]=b;return}function KD(){var a=0;a=c[46972]|0;if(!a)a=0;else a=c[a>>2]|0;DD(a);return}function LD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+80|0;f=e;g=a+52|0;XD(a,c[g>>2]|0,18548);a=f+8|0;c[a>>2]=b;c[a+4>>2]=d;d=c[g>>2]|0;d=nb[c[d>>2]&63](d,f,4)|0;l=e;return d|0}function MD(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=LD(b,d,e)|0;if(!f){f=dC(b,72)|0;c[f+64>>2]=c[b+64>>2];g=f+24|0;h=c[b+24>>2]|0;c[g>>2]=h;a[g>>0]=h&255&-9;c[f+56>>2]=b;c[f+60>>2]=c[b+60>>2];b=f+8|0;c[b>>2]=d;c[b+4>>2]=e;qB(f)|0;}return f|0}function ND(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;if(!(((b|0)!=0?(HB(a,0,b,f,0)|0)!=0:0)?(e=f,e=LD(a,c[e>>2]|0,c[e+4>>2]|0)|0,(e|0)!=0):0))if((d|0)!=0?(HB(a,0,b,f,1)|0)!=0:0){e=f;e=MD(a,c[e>>2]|0,c[e+4>>2]|0)|0;LB(a,0,e);}else e=0;l=g;return e|0}function OD(a){a=a|0;a=c[a+52>>2]|0;return nb[c[a>>2]&63](a,0,128)|0}function PD(a){a=a|0;var b=0;b=QD(a)|0;if(!b)a=0;else {b=c[b+52>>2]|0;a=nb[c[b>>2]&63](b,a,8)|0;}return a|0}function QD(a){a=a|0;return c[a+56>>2]|0}function RD(a,b){a=a|0;b=b|0;a=c[a+52>>2]|0;return nb[c[a>>2]&63](a,b,2)|0}function SD(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[46984]|0;e=(b|0)!=0;do if(!a)if(e){U1(b);a=0;break}else {a=T1(d)|0;break}else if(e){eC(a,b);a=0;break}else {a=dC(a,d)|0;break}while(0);return a|0}function TD(a,b,d){a=a|0;b=b|0;d=d|0;a=c[46984]|0;if(!a)U1(b);else eC(a,b);return}function UD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=b+28|0;f=c[e>>2]|0;c[e>>2]=7;c[46984]=a;d=Vz(b,d)|0;c[e>>2]=f;c[46984]=0;return d|0}function VD(a,b,d){a=a|0;b=b|0;d=d|0;c[46984]=a;return nb[c[b>>2]&63](b,d,2)|0}function WD(a,b){a=a|0;b=b|0;var d=0,e=0;d=(bA(b,0,0)|0)+28|0;e=c[d>>2]|0;c[d>>2]=7;c[46984]=a;if(!(Rz(b)|0)){c[d>>2]=e;c[46984]=0;a=0;}else a=1;return a|0}function XD(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0?(bA(b,0,0)|0)!=(c|0):0)bA(b,c,0)|0;return}function YD(a,b){a=a|0;b=b|0;if(!(iD(a)|0))b=_D(a,b)|0;else ZD(a,b)|0;return b|0}function ZD(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;a[c>>0]=60;e=c;while(1){d=e+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;a[d>>0]=f;b=b+1|0;e=d;}a[d>>0]=62;a[e+2>>0]=0;return c|0}function _D(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;a:do if((b|0)!=0?(a[b>>0]|0)!=0:0){a[d>>0]=34;l=a[b>>0]|0;q=0;g=((l+-45&255)<2|((l&255)+-48|0)>>>0<10)&1;h=0;i=0;j=0;e=d+1|0;f=b+1|0;b:while(1){k=e;while(1){if(!(l<<24>>24))break b;e=l&255;c:do if(l<<24>>24==34){a[k>>0]=92;m=g;n=1;k=k+1|0;}else {if(!g){n=l<<24>>24>-1&(l<<24>>24!=95&(a3(e)|0)==0);m=0;n=n?1:h;break}switch(l<<24>>24){case 45:{n=(j|0)==0;m=n?g:0;n=n?h:1;break c}case 46:{n=(i|0)==0;m=n?g:0;n=n?h:1;i=i+1|0;break c}default:{n=(e+-48|0)>>>0<10;m=n?g:0;n=n?h:1;break c}}}while(0);e=k+1|0;a[k>>0]=l;p=f+1|0;o=a[f>>0]|0;j=j+1|0;f=c[5031]|0;if(!f){g=m;h=n;k=e;f=p;l=o;continue}g=o&255;h=o<<24>>24!=0;if((q&h?!(l<<24>>24==92|l<<24>>24>-1&((l+-45&255)>1&(a3(l<<24>>24)|0)==0)^1):0)?!(o<<24>>24>-1&((o+-45&255)>1&(a3(g)|0)==0)):0)break;if((j|0)<(f|0)|h^1){g=m;h=n;k=e;f=p;l=o;continue}if(l<<24>>24==92|l<<24>>24>-1&((a3(l<<24>>24)|0)==0&(l+-45&255)>1)^1){q=1;g=m;h=n;l=o;f=p;continue b}if(o<<24>>24>-1&((o+-45&255)>1&(a3(g)|0)==0)){q=1;g=m;h=n;l=o;f=p;continue b}a[e>>0]=92;a[k+2>>0]=10;g=m;h=1;j=0;k=k+3|0;f=p;l=o;}a[e>>0]=92;a[k+2>>0]=10;q=0;g=m;h=1;j=0;l=o;e=k+3|0;f=p;}a[k>>0]=34;a[k+1>>0]=0;if(!h){if((j|0)==1?((a[b>>0]|0)+-45&255)<2:0){b=d;break}else e=20128;while(1){f=c[e>>2]|0;if(!f)break a;if(!(c3(f,b)|0)){b=d;break}else e=e+4|0;}}else b=d;}else b=97309;while(0);return b|0}function $D(a){a=a|0;return YD(a,aE(a)|0)|0}function aE(a){a=a|0;var b=0;b=((l2(a)|0)<<1)+2|0;b=b>>>0>1024?b:1024;a=c[46986]|0;if(b>>>0>(c[46985]|0)>>>0){if(!a)a=T1(b)|0;else a=W1(a,b)|0;c[46986]=a;c[46985]=b;}return a|0}function bE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=0;break}if((cE(a)|0)==0?oC(a,b,0)|0:0){a=1;break}a=PD(a)|0;}return a|0}function cE(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=KB(b)|0;if((h|0)!=0?(a[h>>0]|0)!=37:0)d=0;else e=3;a:do if((e|0)==3){d=wA(b)|0;b:do if(d|0?(f=wA(QD(b)|0)|0,f|0):0){h=Xz(c[(wA(yC(b)|0)|0)+8>>2]|0)|0;g=d+12|0;e=f+12|0;d=0;while(1){if((d|0)>=(h|0))break b;f=c[(c[g>>2]|0)+(d<<2)>>2]|0;if((f|0?(i=c[(c[e>>2]|0)+(d<<2)>>2]|0,i|0):0)?s2(f,i)|0:0){d=0;break a}d=d+1|0;}}while(0);d=rA(b,0)|0;if(d)if((Xz(c[d+8>>2]|0)|0)>0)d=0;else return (Xz(c[d+12>>2]|0)|0)<1|0;else d=1;}while(0);return d|0}function dE(b,d){b=b|0;d=d|0;var e=0,f=0;c[46987]=0;e=QA(b,97319)|0;if((e|0?((a[e>>0]|0)+-48|0)>>>0<10:0)?(f=y4(e,0,10)|0,(f|0)==0|(f|0)>59):0)c[5031]=f;eE(b,1);if(((fE(b,d,1)|0)!=-1?(gE(b,d)|0)!=-1:0)?(hE(b,d)|0)!=-1:0){c[5031]=128;b=kb[c[(c[(c[b+64>>2]|0)+8>>2]|0)+8>>2]&63](d)|0;}else b=-1;return b|0}function eE(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=c[a>>2]&-9;d=OD(a)|0;while(1){if(!d)break;eE(d,0);d=PD(d)|0;}a:do if(b|0){b=jC(a)|0;while(1){if(!b)break a;c[b>>2]=c[b>>2]&-9;d=XA(a,b)|0;while(1){if(!d)break;c[d>>2]=c[d>>2]&-9;d=ZA(a,d)|0;}b=kC(a,b)|0;}}while(0);return}function fE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;if((e|0)==0?(QD(b)|0)!=0:0){i=0;g=195059;k=109514;}else {k=(a[b+24>>0]&1)==0?195059:97363;g=(zB(b)|0)==0;c[46988]=GA(b,2,111455,0)|0;c[46989]=GA(b,2,111464,0)|0;i=1;g=g?195059:97366;}f=KB(b)|0;if((f|0)!=0?(a[f>>0]|0)!=37:0){h=1;j=102604;}else {h=0;j=195059;f=195059;}do if((iE(b,d)|0)!=-1?(jE(b,d,g)|0)!=-1:0){g=(h|0)==0;if(h|i|0){if((jE(b,d,k)|0)==-1){f=-1;break}if((jE(b,d,102597)|0)==-1){f=-1;break}}if(!g?(uE(b,d,f)|0)==-1:0){f=-1;break}if(((jE(b,d,j)|0)!=-1?(jE(b,d,97374)|0)!=-1:0)?(c[46987]=(c[46987]|0)+1,(zE(b,d,e)|0)!=-1):0){c[b>>2]=c[b>>2]|8;f=0;}else f=-1;}else f=-1;while(0);return f|0}function gE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:do if((kE(a,b)|0)==-1)d=-1;else {k=rA(yC(a)|0,0)|0;i=(k|0)==0;j=k+12|0;k=k+8|0;h=jC(a)|0;while(1){if(!h){d=0;break a}if(lE(a,h,(c[h>>2]|0)>>>4,0)|0){if(i)d=0;else d=c[k>>2]|0;if((mE(h,b,d)|0)==-1){d=-1;break a}}g=XA(a,h)|0;d=h;while(1){if(!g)break;f=g+-48|0;e=c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0;if((d|0)!=(e|0)?(lE(a,e,(c[h>>2]|0)>>>4,0)|0)!=0:0){if(i)d=0;else d=c[k>>2]|0;if((mE(c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0,b,d)|0)==-1){d=-1;break a}d=c[((c[g>>2]&3|0)==2?g:f)+40>>2]|0;}if(nE(a,g)|0){if(i)e=0;else e=c[j>>2]|0;if((oE(g,b,e)|0)==-1){d=-1;break a}}g=ZA(a,g)|0;}h=kC(a,h)|0;}}while(0);return d|0}function hE(a,b){a=a|0;b=b|0;c[46987]=(c[46987]|0)+-1;if((iE(a,b)|0)==-1)a=-1;else a=((jE(a,b,111008)|0)==-1)<<31>>31;return a|0}function iE(a,b){a=a|0;b=b|0;var d=0;d=c[46987]|0;while(1){if((d|0)<=0){d=0;break}if((jE(a,b,153597)|0)==-1){d=-1;break}else d=d+-1|0;}return d|0}function jE(a,b,d){a=a|0;b=b|0;d=d|0;return lb[c[(c[(c[a+64>>2]|0)+8>>2]|0)+4>>2]&127](b,d)|0}function kE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=0;break}if(!(cE(a)|0)){if((fE(a,b,0)|0)==-1){a=-1;break}if((gE(a,b)|0)==-1){a=-1;break}if((hE(a,b)|0)==-1){a=-1;break}}else kE(a,b)|0;a=PD(a)|0;}return a|0}function lE(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;if((bE(a,b)|0)==0?(wE(a,b,c,d)|0)!=0:0)if((xE(a,b)|0)==0?(yE(b)|0)==0:0)e=5;else a=1;else e=5;if((e|0)==5)a=0;return a|0}function mE(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=xC(a)|0;do if((iE(d,b)|0)!=-1?(pE(a,b)|0)!=-1:0){if((rE(a)|0)==0?(sE(a,b,c)|0)==-1:0){a=-1;break}a=jE(d,b,97330)|0;}else a=-1;while(0);return a|0}function nE(a,b){a=a|0;b=b|0;a=OD(a)|0;while(1){if(!a){a=1;break}if((cE(a)|0)==0?mB(a,b,0)|0:0){a=0;break}a=PD(a)|0;}return a|0}function oE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=c[a>>2]&3;g=c[((e|0)==3?a:a+48|0)+40>>2]|0;e=c[((e|0)==2?a:a+-48|0)+40>>2]|0;f=xC(g)|0;do if((((((iE(f,b)|0)!=-1?(pE(g,b)|0)!=-1:0)?(qE(a,b,c[46988]|0)|0)!=-1:0)?(g=(xB(xC(g)|0)|0)!=0,(jE(f,b,g?100079:100084)|0)!=-1):0)?(pE(e,b)|0)!=-1:0)?(qE(a,b,c[46989]|0)|0)!=-1:0){if(!(rE(a)|0)){if((sE(a,b,d)|0)==-1){a=-1;break}}else if((tE(a,b,1)|0)==-1){a=-1;break}a=jE(f,b,97330)|0;}else a=-1;while(0);return a|0}function pE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+32|0;g=i;d=i+8|0;e=KB(a)|0;f=xC(a)|0;if(!e){j=a+8|0;a=c[j+4>>2]|0;e=g;c[e>>2]=c[j>>2];c[e+4>>2]=a;m4(d,97350,g)|0;if((jE(f,b,d)|0)==-1)a=-1;else h=4;}else if((uE(f,b,e)|0)==-1)a=-1;else h=4;if((h|0)==4)a=0;l=i;return a|0}function qE(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if((d|0)!=0?(e=xC(b)|0,f=RA(b,d)|0,(a[f>>0]|0)!=0):0)if((jE(e,c,107984)|0)==-1)b=-1;else {do if(iD(f)|0){if((uE(e,c,f)|0)==-1){b=-1;break a}}else {b=R2(f,58)|0;if(!b)if((vE(e,c,f,0)|0)==-1){b=-1;break a}else break;a[b>>0]=0;if((vE(e,c,f,0)|0)==-1){b=-1;break a}if((jE(e,c,107984)|0)==-1){b=-1;break a}if((vE(e,c,b+1|0,0)|0)==-1){b=-1;break a}a[b>>0]=58;}while(0);b=0;}else b=0;while(0);return b|0}function rE(a){a=a|0;return (c[a>>2]|0)>>>3&1|0}function sE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:do if(!(c[a>>2]&2)){e=0;k=4;}else {switch(tE(a,b,0)|0){case -1:{e=-1;break a}case 0:{e=0;k=4;break a}default:{}}e=1;k=4;}while(0);b:do if((k|0)==4){f=wA(a)|0;j=xC(a)|0;c:do if(f){i=f+12|0;h=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!h)break c;do if(c[a>>2]&2){g=c[46988]|0;if(g|0?(c[h+16>>2]|0)==(c[g+16>>2]|0):0)break;g=c[46989]|0;if(!((g|0)!=0?(c[h+16>>2]|0)==(c[g+16>>2]|0):0))k=12;}else k=12;while(0);if((k|0)==12){k=0;f=h+16|0;if((c[(c[i>>2]|0)+(c[f>>2]<<2)>>2]|0)!=(c[h+12>>2]|0)){g=e+1|0;if(e){if((jE(j,b,97345)|0)==-1){e=-1;break b}if((iE(j,b)|0)==-1){e=-1;break b}}else {if((iE(j,b)|0)==-1){e=-1;break b}if((jE(j,b,97342)|0)==-1){e=-1;break b}c[46987]=(c[46987]|0)+1;}if((uE(j,b,c[h+8>>2]|0)|0)==-1){e=-1;break b}if((jE(j,b,97348)|0)==-1){e=-1;break b}if((uE(j,b,c[(c[i>>2]|0)+(c[f>>2]<<2)>>2]|0)|0)==-1){e=-1;break b}else e=g;}}h=nb[c[d>>2]&63](d,h,8)|0;}}while(0);if((e|0)>0){if((jE(j,b,97340)|0)==-1){e=-1;break}c[46987]=(c[46987]|0)+-1;}c[a>>2]=c[a>>2]|8;e=0;}while(0);return e|0}function tE(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;e=KB(b)|0;b=xC(b)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0)if((jE(b,c,97333)|0)!=-1?(uE(b,c,e)|0)!=-1:0)if((d|0)!=0?(jE(b,c,97340)|0)==-1:0)b=-1;else {b=1;f=7;}else b=-1;else {b=0;f=7;}return b|0}function uE(a,b,c){a=a|0;b=b|0;c=c|0;return vE(a,b,c,1)|0}function vE(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(!d)c=_D(c,aE(c)|0)|0;else c=$D(c)|0;return jE(a,b,c)|0}function wE(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a:do if(0>>0|(0==(e|0)?(c[b>>2]|0)>>>4>>>0>>0:0))b=0;else {b=_A(a,b)|0;while(1){if(!b){b=1;break a}if(0>>0|(0==(e|0)?(c[c[b+40>>2]>>2]|0)>>>4>>>0>>0:0)){b=0;break a}b=$A(a,b)|0;}}while(0);return b|0}function xE(a,b){a=a|0;b=b|0;if(!(_A(a,b)|0))a=(XA(a,b)|0)==0&1;else a=0;return a|0}function yE(a){a=a|0;var b=0,d=0,e=0;a=wA(a)|0;a:do if(!a)a=0;else {d=a+8|0;e=c[d>>2]|0;b=a+12|0;a=nb[c[e>>2]&63](e,0,128)|0;while(1){if(!a){a=0;break a}if((c[(c[b>>2]|0)+(c[a+16>>2]<<2)>>2]|0)!=(c[a+12>>2]|0)){a=1;break a}e=c[d>>2]|0;a=nb[c[e>>2]&63](e,a,8)|0;}}while(0);return a|0}function zE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=rA(a,0)|0;if(e)if(((AE(a,b,111494,c[e+16>>2]|0,d)|0)!=-1?(AE(a,b,111481,c[e+8>>2]|0,d)|0)!=-1:0)?(AE(a,b,111450,c[e+12>>2]|0,d)|0)!=-1:0)f=5;else a=-1;else f=5;if((f|0)==5)a=0;return a|0}function AE(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;m=(g|0)!=0;if(m)l=0;else l=_z(f,0)|0;k=(l|0)==0;j=nb[c[f>>2]&63](f,0,128)|0;g=0;while(1){if(!j){n=23;break}i=j+12|0;n=c[i>>2]|0;if((n|0)!=0?(a[n>>0]|0)!=0:0)n=12;else n=7;do if((n|0)==7){n=0;if(!(a[j+22>>0]|0)){if(!k){h=nb[c[l>>2]&63](l,j,4)|0;o=c[h+12>>2]|0;if(o|0?a[o>>0]|0:0){n=12;break}if(!(a[h+22>>0]|0))n=12;}}else n=12;}while(0);if((n|0)==12){n=0;h=g+1|0;if(g){if((jE(b,d,97345)|0)==-1){g=-1;break}if((iE(b,d)|0)==-1){g=-1;break}}else {if((iE(b,d)|0)==-1){g=-1;break}if((jE(b,d,e)|0)==-1){g=-1;break}if((jE(b,d,97342)|0)==-1){g=-1;break}c[46987]=(c[46987]|0)+1;}if((uE(b,d,c[j+8>>2]|0)|0)==-1){g=-1;break}if((jE(b,d,97348)|0)==-1){g=-1;break}if((uE(b,d,c[i>>2]|0)|0)==-1){g=-1;break}else g=h;}j=nb[c[f>>2]&63](f,j,8)|0;}do if((n|0)==23){if((g|0)>0){c[46987]=(c[46987]|0)+-1;if((g|0)!=1){if((jE(b,d,153599)|0)==-1){g=-1;break}if((iE(b,d)|0)==-1){g=-1;break}}g=(jE(b,d,97377)|0)==-1;if(m|g){g=g<<31>>31;break}}else if(m){g=0;break}_z(f,l)|0;g=0;}while(0);return g|0}function BE(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(c[b>>2]&3){case 0:{g=82;break}case 1:{g=83;break}case 3:case 2:{g=84;break}default:{}}b=lb[g&127](a,b)|0;if(!b)b=-1;else {FE(a,b,d,e,g,f);b=0;}return b|0}function CE(a,b){a=a|0;b=b|0;if((xC(b)|0)!=(a|0))b=mB(a,b,0)|0;return b|0}function DE(a,b){a=a|0;b=b|0;if((xC(b)|0)!=(a|0))b=oC(a,b,0)|0;return b|0}function EE(a,b){a=a|0;b=b|0;return a|0}function FE(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;h=(f|0)!=0;if(h)vb[c&127](a,b,d);g=OD(a)|0;while(1){if(!g)break;i=lb[e&127](g,b)|0;if(i|0)FE(g,i,c,d,e,f);g=PD(g)|0;}if(!h)vb[c&127](a,b,d);return}function GE(){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1200|0;r=t+800|0;g=t;c[46990]=0;c[46991]=-2;f=r;i=200;n=g;p=0;q=0;o=r;a:while(1){b[o>>1]=p;if((f+(i<<1)+-2|0)>>>0>o>>>0)k=i;else {m=o-f>>1;e=m+1|0;if(i>>>0>9999){s=75;break}k=i<<1;k=k>>>0<1e4?k:1e4;h=T1(k*6|3)|0;if(h){W6(h|0,f|0,e<<1|0)|0;i=h+(k>>>1<<2)|0;W6(i|0,n|0,e<<2|0)|0;if((f|0)==(r|0)){e=0;f=h;}else {U1(f);e=0;f=h;}}else {e=4;i=n;}j=(e|0)==0;h=f+(m<<1)|0;switch((j?((f+(k<<1)+-2|0)>>>0>h>>>0?0:9):e)&15){case 9:{e=1;s=76;break a}case 4:{s=75;break a}case 0:{g=j?i+(m<<2)|0:g;n=i;o=j?h:o;break}default:{e=0;break a}}}if((p|0)==6){e=0;s=76;break}e=a[97381+p>>0]|0;j=e<<24>>24;do if(e<<24>>24!=-18){h=c[46991]|0;if((h|0)==-2){h=mD()|0;c[46991]=h;}if((h|0)>=1)if(h>>>0<269)i=d[97461+h>>0]|0;else i=2;else {c[46991]=0;i=0;}h=i+j|0;if(h>>>0<=59?(i|0)==(d[97730+h>>0]|0):0){p=a[97790+h>>0]|0;e=p<<24>>24;if(p<<24>>24<1){h=0-e|0;s=23;break}else {c[46991]=-2;g=g+4|0;c[g>>2]=c[46992];j=(q|0)==0?0:q+-1|0;h=o;break}}else s=22;}else s=22;while(0);if((s|0)==22){s=0;p=a[97850+p>>0]|0;h=p&255;if(!(p<<24>>24)){h=c[46991]|0;b:do switch(q|0){case 0:{c[46990]=(c[46990]|0)+1;HD(143761);h=o;break}case 3:if((h|0)<1)if(!h){e=1;s=76;break a}else {h=o;break b}else {c[46991]=-2;h=o;break b}default:h=o;}while(0);while(1){if(e<<24>>24==18)break;if((h|0)==(f|0)){e=1;s=76;break a}e=h+-2|0;g=g+-4|0;h=e;e=a[97381+(b[e>>1]|0)>>0]|0;}g=g+4|0;c[g>>2]=c[46992];e=1;j=3;}else s=23;}do if((s|0)==23){s=0;i=d[97930+h>>0]|0;e=c[g+(1-i<<2)>>2]|0;c:do switch(h|0){case 2:{HE();IE();break}case 3:{if(c[46993]|0){HE();IE();sB(c[46993]|0)|0;c[46942]=0;c[46993]=0;}break}case 6:{JE(c[g>>2]|0,c[g+-4>>2]|0,c[g+-8>>2]|0);break}case 7:{e=c[g>>2]|0;break}case 8:{e=0;break}case 9:{e=1;break}case 10:{e=0;break}case 11:{e=0;break}case 12:{e=1;break}case 21:if(!(c[g+-4>>2]|0)){LE();break c}else {KE();break c}case 24:{ME();break}case 25:{ME();break}case 26:{e=1;break}case 27:{e=0;break}case 30:{NE(c[g>>2]|0,0,0);break}case 31:{NE(c[g+-8>>2]|0,c[g>>2]|0,0);break}case 32:{NE(c[g+-16>>2]|0,c[g+-8>>2]|0,c[g>>2]|0);break}case 33:{OE(c[g+-8>>2]|0,c[g+-4>>2]|0);break}case 34:{OE(258,0);break}case 35:{e=258;break}case 36:{e=259;break}case 37:{e=260;break}case 38:{e=c[g+-4>>2]|0;break}case 39:{e=0;break}case 48:{PE(c[g+-8>>2]|0,c[g>>2]|0);break}case 49:{PE(c[g>>2]|0,0);break}case 51:{QE(c[g>>2]|0);break}case 52:{RE();break}case 53:{e=c[g>>2]|0;break}case 54:{e=0;break}case 55:{e=0;break}case 59:{e=c[g>>2]|0;break}case 60:{e=c[g>>2]|0;break}case 61:{e=c[g>>2]|0;break}case 62:{e=SE(c[g+-8>>2]|0,c[g>>2]|0)|0;break}default:{}}while(0);i=0-i|0;p=g+(i<<2)|0;i=o+(i<<1)|0;g=p+4|0;c[p+4>>2]=e;e=(d[97993+h>>0]|0)+-24|0;p=b[i>>1]|0;h=p+(a[98056+e>>0]|0)|0;if(h>>>0<60?(d[97730+h>>0]|0)==(p|0):0){e=a[97790+h>>0]|0;j=q;h=i;break}e=a[98091+e>>0]|0;j=q;h=i;}while(0);i=k;p=e;q=j;o=h+2|0;}if((s|0)==75){HD(140558);e=2;s=76;}if((s|0)==76)if((f|0)!=(r|0))U1(f);l=t;return e|0}function HE(){var a=0,b=0;a=c[46994]|0;while(1){if(!a)break;_E(a+8|0);_E((c[46994]|0)+24|0);_E((c[46994]|0)+16|0);b=TE(c[46994]|0)|0;c[46994]=b;a=b;}return}function IE(){ID();TB(c[46993]|0);return}function JE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=c[46993]|0;if(!f){a[187980]=d&1|(e&255)<<1&2|a[187980]&-12|8;f=c[46996]|0;a[g>>0]=a[187980]|0;a[g+1>>0]=a[187981]|0;a[g+2>>0]=a[187982]|0;a[g+3>>0]=a[187983]|0;f=oB(b,g,f)|0;c[46993]=f;}c[46942]=f;c[46994]=UE(c[46994]|0,f)|0;hD(0,b)|0;l=h;return}function KE(){var b=0,d=0,e=0,f=0,g=0,h=0;ZE(2);e=c[46994]|0;f=a[98126]|0;h=0;b=e+24|0;while(1){d=c[b>>2]|0;if(!d)break;if(((c[d>>2]|0)==267?(g=c[d+4>>2]|0,(a[g>>0]|0)==f<<24>>24):0)?(s2(g,98126)|0)==0:0)b=c[d+8>>2]|0;else b=h;h=b;b=d+12|0;}b=e+16|0;a:while(1){e=c[b>>2]|0;b=e+12|0;if(!(c[b>>2]|0))break;d=e+4|0;if((c[e>>2]|0)==262){e=c[d>>2]|0;d=jC(e)|0;while(1){if(!d)continue a;g=oC(c[c[46994]>>2]|0,d,0)|0;fF(g,0,c[b>>2]|0,h);d=kC(e,d)|0;}}else while(1){d=c[d>>2]|0;if(!d)continue a;fF(c[d+4>>2]|0,c[d+8>>2]|0,c[b>>2]|0,h);d=d+12|0;}}_E((c[46994]|0)+8|0);_E((c[46994]|0)+16|0);_E((c[46994]|0)+24|0);c[(c[46994]|0)+4>>2]=0;return}function LE(){var a=0;ZE(1);a=(c[46994]|0)+8|0;while(1){a=c[a>>2]|0;if(!a)break;eF(c[a+4>>2]|0);a=a+12|0;}_E((c[46994]|0)+8|0);_E((c[46994]|0)+24|0);_E((c[46994]|0)+16|0);c[(c[46994]|0)+4>>2]=0;return}function ME(){var a=0,b=0;a=c[46994]|0;b=c[a+8>>2]|0;if(!b){b=c[a+4>>2]|0;if(!b)b=0;else {b=dF(b)|0;a=c[46994]|0;}c[a+4>>2]=0;}else {b=cF(b)|0;a=c[46994]|0;c[a+12>>2]=0;c[a+8>>2]=0;}if(b|0)WE(a+16|0,b);return}function NE(a,b,d){a=a|0;b=b|0;d=d|0;if(d)b=aF(b,d)|0;d=bF(tC(c[c[46994]>>2]|0,a,1)|0,b)|0;WE((c[46994]|0)+8|0,d);hD(c[46993]|0,a)|0;return}function OE(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;if(d|0)YE();d=(c[46994]|0)+24|0;while(1){d=c[d>>2]|0;if(!d)break;if(!(c[d+8>>2]|0))YE();d=d+12|0;}g=(b|0)==260?2:(b|0)==259&1;ZE(g);b=c[46994]|0;d=b+24|0;while(1){f=c[d>>2]|0;if(!f)break;do if((c[f>>2]|0)!=267){d=c[f+4>>2]|0;e=c[b>>2]|0;if(!((a[d+21>>0]|0)!=0&(e|0)==(c[46993]|0))){d=GA(e,g,c[d+8>>2]|0,c[f+8>>2]|0)|0;b=c[46994]|0;if((c[b>>2]|0)!=(c[46993]|0))break}a[d+22>>0]=1;}while(0);d=f+12|0;}_E(b+24|0);return}function PE(a,b){a=a|0;b=b|0;b=VE(a,b)|0;WE((c[46994]|0)+24|0,b);return}function QE(a){a=a|0;var b=0;b=c[46994]|0;c[46994]=UE(b,ND(c[b>>2]|0,a,1)|0)|0;hD(c[46993]|0,a)|0;return}function RE(){var a=0,b=0;a=c[46994]|0;b=c[a>>2]|0;a=TE(a)|0;c[46994]=a;c[a+4>>2]=b;return}function SE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+1024|0;f=g;d=l2(a)|0;d=d+1+(l2(b)|0)|0;if(d>>>0<1025)d=f;else d=T1(d)|0;r3(d,a)|0;F4(d,b)|0;e=fD(c[46993]|0,d)|0;hD(c[46993]|0,a)|0;hD(c[46993]|0,b)|0;if((d|0)!=(f|0))U1(d);l=g;return e|0}function TE(a){a=a|0;var b=0;b=c[(c[46994]|0)+32>>2]|0;eC(c[46993]|0,a);return b|0}function UE(a,b){a=a|0;b=b|0;var d=0;d=dC(c[46993]|0,36)|0;c[d+32>>2]=a;c[d>>2]=b;return d|0}function VE(a,b){a=a|0;b=b|0;return XE(267,a,b)|0}function WE(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+4|0;e=c[d>>2]|0;if(e|0)c[e+12>>2]=b;c[d>>2]=b;if(!(c[a>>2]|0))c[a>>2]=b;return}function XE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=dC(c[46993]|0,16)|0;c[e>>2]=a;c[e+4>>2]=b;c[e+8>>2]=d;return e|0}function YE(){var a=0;a=l;l=l+16|0;gA(0,98130,a)|0;l=a;return}function ZE(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=(b|0)==2;d=(c[46994]|0)+24|0;while(1){d=c[d>>2]|0;if(!d)break;e=d+4|0;f=c[e>>2]|0;if(!((g?(a[f>>0]|0)==(a[98126]|0):0)?!(s2(f,98126)|0):0)){h=GA(c[c[46994]>>2]|0,b,f,0)|0;c[e>>2]=h;if(!h)c[e>>2]=GA(c[c[46994]>>2]|0,b,f,195059)|0;c[d>>2]=266;hD(c[46993]|0,f)|0;}d=d+12|0;}return}function _E(a){a=a|0;$E(c[a>>2]|0);c[a+4>>2]=0;c[a>>2]=0;return}function $E(a){a=a|0;var b=0;while(1){if(!a)break;b=c[a+12>>2]|0;switch(c[a>>2]|0){case 265:{$E(c[a+4>>2]|0);break}case 266:case 267:{hD(c[46993]|0,c[a+8>>2]|0)|0;break}default:{}}eC(c[46993]|0,a);a=b;}return}function aF(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+1040|0;f=h;g=h+8|0;d=l2(a)|0;d=d+2+(l2(b)|0)|0;if(d>>>0<1025)e=g;else e=T1(d)|0;c[f>>2]=a;c[f+4>>2]=b;m4(e,98163,f)|0;d=fD(c[46993]|0,e)|0;hD(c[46993]|0,a)|0;hD(c[46993]|0,b)|0;if((e|0)!=(g|0))U1(e);l=h;return d|0}function bF(a,b){a=a|0;b=b|0;return XE(259,a,b)|0}function cF(a){a=a|0;return XE(265,a,0)|0}function dF(a){a=a|0;return XE(262,a,0)|0}function eF(a){a=a|0;var b=0,d=0;b=(c[46994]|0)+24|0;while(1){b=c[b>>2]|0;if(!b)break;if((c[b>>2]|0)==266?(d=c[b+4>>2]|0,d|0):0)KA(a,d,c[b+8>>2]|0)|0;b=b+12|0;}return}function fF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=d+4|0;a:do if((c[d>>2]|0)==262){d=c[f>>2]|0;f=jC(d)|0;while(1){if(!f)break a;gF(a,b,oC(c[c[46994]>>2]|0,f,0)|0,0,e);f=kC(d,f)|0;}}else while(1){f=c[f>>2]|0;if(!f)break a;d=oC(c[c[46994]>>2]|0,c[f+4>>2]|0,0)|0;gF(a,b,d,c[f+8>>2]|0,e);f=f+12|0;}while(0);return}function gF(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;d=iB(c[c[46994]>>2]|0,a,d,f,1)|0;if(d|0){g=c[d>>2]&3;f=c[((g|0)==2?d:d+-48|0)+40>>2]|0;a=(f|0)==(a|0)?(c[((g|0)==3?d:d+48|0)+40>>2]|0)!=(f|0):0;hF(d,111455,a?e:b);hF(d,111464,a?b:e);eF(d);}return}function hF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(d|0){e=GA(c[c[46994]>>2]|0,2,b,0)|0;if(!e)e=GA(c[c[46994]>>2]|0,2,b,195059)|0;KA(a,e,d)|0;}return}function iF(a,b,d){a=a|0;b=b|0;d=d|0;c[46962]=b;c[46993]=a;c[46942]=0;a=d|0?d:18600;c[46996]=a;lD(a,b);GE()|0;a=c[46942]|0;if(!a){KD();a=c[46942]|0;}return a|0}function jF(a,b){a=a|0;b=b|0;return iF(0,a,b)|0}function kF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;d=c[b+76>>2]|0;f=c[b>>2]|0;if((d|0)!=0?(e=c[d>>2]|0,(e|0)!=0):0){tb[e&127](b);g=12;}else g=4;do if((g|0)==4)if((c[b+40>>2]|0)==0?(h=b+36|0,(c[h>>2]|0)==0):0){if(a[f+13>>0]|0)lF(b);d=b+32|0;e=c[d>>2]|0;if(!e){c[h>>2]=c[15679];g=12;break}f=$4(e,106512)|0;c[h>>2]=f;if(!f){j=c[(c[b+12>>2]|0)+16>>2]|0;h=c[d>>2]|0;d=t2(c[(d2()|0)>>2]|0)|0;c[i>>2]=h;c[i+4>>2]=d;ub[j&63](98169,i);d=1;}else g=12;}else g=12;while(0);if((g|0)==12)if(!(c[b+152>>2]&1024))d=0;else {ub[c[(c[b+12>>2]|0)+16>>2]&63](98207,j);d=1;}l=k;return d|0}function lF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+112|0;e=h;g=h+4|0;d=c[b+24>>2]|0;if(!d)a[g>>0]=0;else {c[e>>2]=d+1;m4(g,98225,e)|0;}e=c[b+20>>2]|0;e=e|0?e:98229;d=l2(e)|0;i=l2(g)|0;f=b+52|0;i=d+1+i+(l2(c[f>>2]|0)|0)|0;d=i+11|0;if((c[46997]|0)>>>0<(i+1|0)>>>0){c[46997]=d;d=W1(c[46998]|0,d)|0;c[46998]=d;}else d=c[46998]|0;r3(d,e)|0;F4(c[46998]|0,g)|0;d=c[46998]|0;d=d+(l2(d)|0)|0;a[d>>0]=46;a[d+1>>0]=0;d=D4(c[f>>2]|0)|0;f=c[46998]|0;while(1){e=E4(d,58)|0;if(!e)break;F4(f,e+1|0)|0;i=c[46998]|0;g=i+(l2(i)|0)|0;a[g>>0]=46;a[g+1>>0]=0;a[e>>0]=0;f=i;}F4(f,d)|0;U1(d);c[b+32>>2]=c[46998];l=h;return}function mF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h+8|0;f=h;if((b|0)!=0&(d|0)!=0){if(c[a+152>>2]&1024|0){ub[c[(c[a+12>>2]|0)+16>>2]&63](98207,f);Sa(1);}if((nF(a,b,d)|0)==(d|0))e=d;else {f=c[(c[a+12>>2]|0)+16>>2]|0;c[g>>2]=d;ub[f&63](98239,g);Sa(1);}}else e=0;l=h;return e|0}function nF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;f=c[(c[b>>2]|0)+104>>2]|0;do if(!f){j=b+40|0;h=c[j>>2]|0;if(!h){e=U4(d,1,e,c[b+36>>2]|0)|0;break}f=b+44|0;i=b+48|0;g=c[i>>2]|0;do if(((c[f>>2]|0)+-1-g|0)>>>0>>0){g=e+4096+g&-4096;c[f>>2]=g;f=W1(h,g)|0;c[j>>2]=f;if(!f){ub[c[(c[b+12>>2]|0)+16>>2]&63](98264,n);Sa(1);}else {k=f;m=c[i>>2]|0;break}}else {k=h;m=g;}while(0);W6(k+m|0,d|0,e|0)|0;n=(c[i>>2]|0)+e|0;c[i>>2]=n;a[(c[j>>2]|0)+n>>0]=0;}else e=nb[f&63](b,d,e)|0;while(0);l=o;return e|0}function oF(a,b){a=a|0;b=b|0;var c=0;c=l2(b)|0;b=(mF(a,b,c)|0)==(c|0);return (b?1:-1)|0}function pF(b,c){b=b|0;c=c|0;var d=0,e=0;d=l;l=l+16|0;e=d;a[e>>0]=c;b=(mF(b,e,1)|0)==1;l=d;return (b?c:-1)|0}function qF(b){b=b|0;var d=0;d=c[b+36>>2]|0;if(((d|0)!=0?(a[b+144>>0]|0)==0:0)?(c[(c[b>>2]|0)+104>>2]|0)==0:0)b=M4(d)|0;else b=0;return b|0}function rF(a){a=a|0;var b=0,d=0;b=c[a+76>>2]|0;if(b|0?(d=c[b+4>>2]|0,d|0):0)tb[d&127](a);qF(a)|0;return}function sF(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=c[a+76>>2]|0;if(c[a+152>>2]&1024|0){ub[c[(c[a+12>>2]|0)+16>>2]&63](98291,e);Sa(1);}if((d|0)!=0?(b=c[d+8>>2]|0,(b|0)!=0):0)tb[b&127](a);else {qF(a)|0;tF(a);}l=e;return}function tF(b){b=b|0;var d=0,e=0,f=0;d=b+32|0;if((c[d>>2]|0?(e=b+36|0,f=c[e>>2]|0,(f|0)!=(c[15679]|0)):0)?(a[b+144>>0]|0)==0:0){if(f|0){I4(f)|0;c[e>>2]=0;}c[d>>2]=0;}return}function uF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+1056|0;f=i;h=i+24|0;g=i+8|0;c[g>>2]=d;e=G3(h,1024,b,g)|0;if((e|0)>=0){if((e|0)>1023){e=KK(e+1|0)|0;c[g>>2]=d;f=e;e=n4(e,b,g)|0;}else f=h;mF(a,f,e)|0;if((f|0)!=(h|0))U1(f);}else {c[f>>2]=t2(c[(d2()|0)>>2]|0)|0;gA(1,98308,f)|0;}l=i;return}function vF(a,b){a=a|0;b=+b;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=wF(e,b)|0;mF(a,f,c[e>>2]|0)|0;l=d;return}function wF(b,d){b=b|0;d=+d;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!(d<-1.0e15))if(!(d>1.0e15)){d=d*1.0e4;f=~~((d<0.0?-.5:.5)+d);if(!f){f=138394;e=1;}else {l=(f|0)<0;k=4;i=0;e=194826;f=l?0-f|0:f;while(1){if(!((f|0)!=0|(k|0)>0))break;g=(f|0)%10|0;j=(f|0)/10|0;h=e+-1|0;if((g|0)==0&i<<24>>24==0)f=0;else {a[h>>0]=g|48;f=1;e=h;}if((k|0)==1)if(!(f<<24>>24))f=1;else {e=e+-1|0;a[e>>0]=46;f=1;}k=k+-1|0;i=f;f=j;}if(l){e=e+-1|0;a[e>>0]=45;}f=e;e=194826-e|0;}}else {f=98323;e=18;}else {f=98322;e=19;}c[b>>2]=e;return f|0}function xF(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=wF(e,+h[b>>3])|0;mF(a,f,c[e>>2]|0)|0;mF(a,102604,1)|0;b=wF(e,+h[b+8>>3])|0;mF(a,b,c[e>>2]|0)|0;l=d;return}function yF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;e=0;while(1){h=b+(e<<4)|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];xF(a,f);e=e+1|0;if((e|0)>=(d|0))break;mF(a,102604,1)|0;}l=g;return}function zF(a,b){a=a|0;b=b|0;var d=0;d=JK(392)|0;if(d|0){c[d>>2]=20156;c[d+16>>2]=23;c[d+32>>2]=a;c[d+36>>2]=b;}return d|0}function AF(a){a=a|0;var b=0,d=0,e=0,f=0;b=JK(392)|0;d=b;e=a;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));f=b+60|0;e=a+60|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[f+16>>2]=c[e+16>>2];f=b+80|0;e=a+80|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];c[f+16>>2]=c[e+16>>2];return b|0}function BF(a){a=a|0;IF(a);U1(a);return}function CF(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+160|0;d=c[e>>2]|0;if(d){e=c[46999]|0;if(e){d=c[e+4>>2]|0;if(!d){d=JK(632)|0;c[(c[46999]|0)+4>>2]=d;}}}else {d=JK(632)|0;c[e>>2]=d;c[a+164>>2]=d;}c[46999]=d;c[d+32>>2]=b;c[d>>2]=a;return}function DF(a,b){a=a|0;b=b|0;var d=0,e=0;e=a+160|0;d=c[e>>2]|0;if(d){e=c[47e3]|0;if(e){d=c[e+4>>2]|0;if(!d){d=JK(632)|0;c[(c[47e3]|0)+4>>2]=d;}}}else {d=JK(632)|0;c[e>>2]=d;c[a+164>>2]=d;}c[47e3]=d;c[d+52>>2]=b;c[d>>2]=a;return (LF(a,3,b)|0)!=0|0}function EF(a){a=a|0;var b=0;b=c[a+160>>2]|0;c[a+164>>2]=b;return b|0}function FF(a){a=a|0;var b=0,d=0,e=0;a=a+164|0;b=c[a>>2]|0;d=c[b+4>>2]|0;if(d|0?(e=d+52|0,(c[e>>2]|0)==0):0)c[e>>2]=c[b+52>>2];c[a>>2]=d;return d|0}function GF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+8|0;f=b+10|0;if((c[e>>2]|0)>(b|0))a=c[a>>2]|0;else {c[e>>2]=f;f=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=f;a=f;}c[a+(b<<2)>>2]=d;return}function HF(a){a=a|0;var b=0;b=c[a>>2]|0;if(b|0)U1(b);c[a>>2]=0;c[a+8>>2]=0;c[a+4>>2]=0;return}function IF(a){a=a|0;var b=0,d=0,e=0;d=a+160|0;b=c[d>>2]|0;while(1){if(!b)break;e=c[b+4>>2]|0;HF(b+604|0);HF(b+592|0);U1(c[b+584>>2]|0);U1(c[b+588>>2]|0);U1(b);b=e;}c[47e3]=0;c[46999]=0;c[a+192>>2]=0;c[a+164>>2]=0;c[d>>2]=0;c[a+28>>2]=0;return}function JF(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0;n=l;l=l+128|0;k=n+64|0;m=n;i4(k,e,63)|0;i=R2(k,58)|0;if(i|0)a[i>>0]=0;b=b+60+(d<<2)|0;while(1){d=c[b>>2]|0;if(!d){d=b;b=0;break}i4(m,c[d+4>>2]|0,63)|0;d=R2(m,58)|0;if(d|0)a[d>>0]=0;if((s2(k,m)|0)<1){j=9;break}b=c[b>>2]|0;}while(1){if((j|0)==9){d=b;b=c[b>>2]|0;}if(!b)break;i4(m,c[b+4>>2]|0,63)|0;b=R2(m,58)|0;if(b|0)a[b>>0]=0;if(s2(k,m)|0)break;b=c[d>>2]|0;if((c[b+8>>2]|0)<=(f|0))break;j=9;}m=KK(20)|0;c[m>>2]=c[d>>2];c[d>>2]=m;c[m+4>>2]=e;c[m+8>>2]=f;c[m+12>>2]=g;c[m+16>>2]=h;l=n;return 1}function KF(a,b){a=a|0;b=b|0;b=l;l=l+16|0;gA(1,98396,b)|0;l=b;return 0}function LF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+144|0;r=s;o=s+80|0;p=s+16|0;n=(d+-3|0)>>>0<2?0:d;i4(o,e,63)|0;e=R2(o,58)|0;if(e){f=e+1|0;a[e>>0]=0;e=R2(f,58)|0;if(!e)m=0;else {a[e>>0]=0;m=e+1|0;}}else {m=0;f=0;}i=(f|0)!=0;j=(m|0)==0;k=(n|0)==(d|0);h=b+60+(d<<2)|0;a:while(1){e=c[h>>2]|0;if(!e){e=0;break}i4(p,c[e+4>>2]|0,63)|0;e=R2(p,58)|0;if(!e)e=0;else {a[e>>0]=0;e=e+1|0;}do if(!(s2(p,o)|0)){g=(e|0)!=0;if(i&g?s2(e,f)|0:0)break;if(!j?s2(m,c[(c[(c[h>>2]|0)+12>>2]|0)+8>>2]|0)|0:0)break;if(k|g^1){q=16;break a}if(LF(b,n,e)|0){q=16;break a}}while(0);h=c[h>>2]|0;}do if((q|0)==16){e=c[h>>2]|0;if(e){f=e+16|0;if((c[f>>2]|0)==0?(KF(0,0)|0,(c[f>>2]|0)==0):0){e=0;break}if((c[b+8>>2]|0)>0){q=c[15712]|0;o=c[e+4>>2]|0;p=c[(c[e+12>>2]|0)+8>>2]|0;c[r>>2]=c[20168+(d<<2)>>2];c[r+4>>2]=o;c[r+8>>2]=p;w4(q,98427,r)|0;}}else e=0;}while(0);c[b+80+(d<<2)>>2]=e;l=s;return e|0}function MF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;do if(!e)e=0;else {if(c[5047]|0){kA(188004,0,0);c[5047]=0;}h=D4(e)|0;e=R2(h,58)|0;if(e){a[e>>0]=0;f=b+60+(d<<2)|0;e=1;g=f;while(1){b=c[g>>2]|0;if(!b)break;d=D4(c[b+4>>2]|0)|0;b=R2(d,58)|0;if(b|0)a[b>>0]=0;if(!((a[h>>0]|0)!=0?(c3(h,d)|0)!=0:0)){e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=32;nA(188004,c[(c[g>>2]|0)+4>>2]|0)|0;e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=58;nA(188004,c[(c[(c[g>>2]|0)+12>>2]|0)+8>>2]|0)|0;e=0;}U1(d);g=c[g>>2]|0;}U1(h);if(e<<24>>24){g=0;i=19;}}else {U1(h);g=0;f=b+60+(d<<2)|0;e=1;i=19;}if((i|0)==19){while(1){b=c[f>>2]|0;if(!b)break;d=D4(c[b+4>>2]|0)|0;b=R2(d,58)|0;if(b|0)a[b>>0]=0;if(!((g|0)!=0?(c3(g,d)|0)==0:0)){e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}c[47002]=e+1;a[e>>0]=32;nA(188004,d)|0;e=0;}g=d;f=c[f>>2]|0;i=19;}if(e<<24>>24){e=195059;break}}e=c[47002]|0;if(e>>>0>=(c[47003]|0)>>>0){lA(188004,1)|0;e=c[47002]|0;}a[e>>0]=0;e=c[47001]|0;c[47002]=e;}while(0);return e|0}function NF(b){b=b|0;var d=0;if(!b)qa(111208,98444,573,98458);if(!(a[b>>0]|0))qa(111213,98444,574,98458);d=c[47005]|0;if(!d)b=0;else b=nb[c[d>>2]&63](d,b,512)|0;return b|0}function OF(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;if(!b)qa(111312,98444,589,98475);g=b+8|0;e=c[g>>2]|0;if(!e)qa(111315,98444,590,98475);if(!(a[e>>0]|0))qa(111324,98444,591,98475);h=b+20|0;f=c[h>>2]|0;do if(!f){d=mP(e)|0;if(!d){c[i>>2]=c[g>>2];gA(0,98499,i)|0;d=0;break}i=$4(d,138821)|0;c[h>>2]=i;if(!i){c[j>>2]=t2(c[(d2()|0)>>2]|0)|0;c[j+4>>2]=d;gA(0,98524,j)|0;d=0;break}d=c[47006]|0;if((d|0)>49){a[b+17>>0]=1;d=1;break}else {c[47006]=d+1;d=1;break}}else {n5(f,0,0)|0;if(!(c[h>>2]|0))qa(98545,98444,614,98475);else d=1;}while(0);l=k;return d|0}function PF(b){b=b|0;var d=0,e=0;if(a[b+17>>0]|0?(d=b+20|0,e=c[d>>2]|0,e|0):0){I4(e)|0;c[d>>2]=0;}return}function QF(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0;if(!b){e=-1;d=-1;}else {e=c[b+48>>2]|0;f=+(e|0);if(!e){g=+h[d>>3];f=+h[d+8>>3];}else {h[d+8>>3]=f;h[d>>3]=f;g=f;}e=~~(+((c[b+40>>2]|0)*72|0)/g);d=~~(+((c[b+44>>2]|0)*72|0)/f);}c[a>>2]=e;c[a+4>>2]=d;return}function RF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0.0;m=l;l=l+48|0;f=m+16|0;j=m;k=m+32|0;if((e|0)!=0?(a[e>>0]|0)!=0:0){if((0==0?(g=c[47133]|0,(c[47007]|0)!=(g|0)):0)?(c[47007]=g,i=c[47005]|0,i|0):0){Rz(i)|0;c[47005]=0;}n=+h[(c[(c[d+16>>2]|0)+8>>2]|0)+24>>3];n=!(n>=1.0)?96.0:n;h[j+8>>3]=n;h[j>>3]=n;d=SF(e)|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];QF(k,d,f);d=c[k>>2]|0;f=c[k+4>>2]|0;}else {d=-1;f=-1;}c[b>>2]=d;c[b+4>>2]=f;l=m;return}function SF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;e=f;if(!a)qa(111208,98444,638,98551);if(!(c[47005]|0))c[47005]=Vz(20192,c[4589]|0)|0;b=NF(a)|0;a:do if(!b){b=JK(64)|0;if(!b)b=0;else {d=b+8|0;c[d>>2]=fD(0,a)|0;if(!((OF(b)|0)<<24>>24)){TF(b);b=0;break}if(!(c[b+20>>2]|0))qa(98545,98444,653,98551);do switch(UF(b)|0){case 0:{a=iN(c[d>>2]|0)|0;c[b+52>>2]=a;if(!a){c[e>>2]=c[d>>2];gA(0,98568,e)|0;TF(b);b=0;break a}break}case 2:{VF(b);break}case 3:{WF(b);break}case 1:{XF(b);break}case 4:{YF(b);break}case 6:{ZF(b);break}case 11:{_F(b);break}case 8:{$F(b);break}case 5:{aG(b);break}case 12:{bG(b);break}default:{}}while(0);PF(b);e=c[47005]|0;nb[c[e>>2]&63](e,b,1)|0;}}else PF(b);while(0);l=f;return b|0}function TF(a){a=a|0;var b=0;b=c[a+8>>2]|0;if(b|0)hD(0,b)|0;U1(a);return}function UF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+224|0;f=j+200|0;g=j;h=a+20|0;b=c[h>>2]|0;a:do if((b|0)!=0?(x6(f,1,20,b)|0)==20:0){d=0;while(1){if(d>>>0>=10){i=13;break a}if(!($3(f,c[20228+(d<<4)>>2]|0,c[20228+(d<<4)+4>>2]|0)|0))break;d=d+1|0;}e=a+28|0;c[e>>2]=c[20228+(d<<4)+12>>2];b=c[20228+(d<<4)+8>>2]|0;a=a+24|0;c[a>>2]=b;switch(d|0){case 7:break;case 8:{if($3(f+8|0,98784,4)|0)break a;c[e>>2]=98789;c[a>>2]=11;b=11;break a}default:break a}while(1){if(!(c4(g,200,c[h>>2]|0)|0)){i=11;break}if(!($3(g,98779,4)|0)){i=8;break}}if((i|0)==8){c[e>>2]=101803;c[a>>2]=8;b=8;break}else if((i|0)==11){b=c[a>>2]|0;break}}else i=13;while(0);if((i|0)==13){c[a+28>>2]=98794;c[a+24>>2]=0;b=0;}l=j;return b|0}function VF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,6,0)|0;if((kG(c[e>>2]|0,2,b)|0)<<24>>24?(kG(c[e>>2]|0,2,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function WF(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,16,0)|0;if((cG(c[e>>2]|0,4,b)|0)<<24>>24?(cG(c[e>>2]|0,4,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function XF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;b=h+12|0;d=h+8|0;e=h+4|0;f=h;c[a+48>>2]=0;g=a+20|0;n5(c[g>>2]|0,16,0)|0;if((((kG(c[g>>2]|0,2,b)|0)<<24>>24?(kG(c[g>>2]|0,2,d)|0)<<24>>24:0)?(kG(c[g>>2]|0,2,e)|0)<<24>>24:0)?(kG(c[g>>2]|0,2,f)|0)<<24>>24:0){c[a+40>>2]=c[b>>2]<<16|c[d>>2];c[a+44>>2]=c[e>>2]<<16|c[f>>2];}l=h;return}function YF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+32|0;b=m+16|0;e=m+12|0;f=m+8|0;h=m+4|0;i=m;c[a+48>>2]=0;j=a+20|0;while(1){if(!((cG(c[j>>2]|0,1,b)|0)<<24>>24))break;d=c[b>>2]|0;if((d|0)==255)continue;if(R2(98767,d)|0)continue;if((d|0)==192){k=6;break}g=c[j>>2]|0;if((d|0)==194){k=11;break}if(!((cG(g,2,e)|0)<<24>>24))break;n5(c[j>>2]|0,(c[e>>2]|0)+-2|0,1)|0;}if((k|0)==6){if(((cG(c[j>>2]|0,3,i)|0)<<24>>24?(cG(c[j>>2]|0,2,f)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,h)|0)<<24>>24:0){c[a+44>>2]=c[f>>2];c[a+40>>2]=c[h>>2];}}else if((((k|0)==11?(cG(g,3,i)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,f)|0)<<24>>24:0)?(cG(c[j>>2]|0,2,h)|0)<<24>>24:0){c[a+44>>2]=c[f>>2];c[a+40>>2]=c[h>>2];}l=m;return}function ZF(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+1056|0;j=m;b=m+32|0;e=m+28|0;f=m+24|0;g=m+20|0;h=m+16|0;c[a+48>>2]=72;i=a+20|0;n5(c[i>>2]|0,0,0)|0;while(1){if(!(c4(b,1024,c[i>>2]|0)|0))break;d=d4(b,98752)|0;if(!d)continue;c[j>>2]=e;c[j+4>>2]=f;c[j+8>>2]=g;c[j+12>>2]=h;if((b5(d,104311,j)|0)==4){k=5;break}}if((k|0)==5){j=c[e>>2]|0;c[a+32>>2]=j;k=c[f>>2]|0;c[a+36>>2]=k;c[a+40>>2]=(c[g>>2]|0)-j;c[a+44>>2]=(c[h>>2]|0)-k;}l=m;return}function _F(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;b=g+4|0;d=g;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,15,0)|0;h=(D6(c[e>>2]|0)|0)==88;f=c[e>>2]|0;if(h){n5(f,24,0)|0;if((kG(c[e>>2]|0,4,b)|0)<<24>>24?(kG(c[e>>2]|0,4,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}}else {n5(f,26,0)|0;if((kG(c[e>>2]|0,2,b)|0)<<24>>24?(kG(c[e>>2]|0,2,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}}l=g;return}function $F(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;F=l;l=l+352|0;C=F+80|0;B=F+72|0;E=F+64|0;D=F+56|0;A=F+48|0;d=F+40|0;s=F+32|0;t=F+24|0;u=F+16|0;v=F+8|0;w=F;x=F+328|0;y=F+128|0;z=F+96|0;if(!(c[47008]|0)){if(F5(188036,98637,1)|0){c[d>>2]=98637;gA(1,98664,d)|0;}c[47008]=188036;}m=b+20|0;n5(c[m>>2]|0,0,0)|0;n=z+12|0;o=z+20|0;p=z+8|0;q=z+16|0;r=z+4|0;d=0;g=0;f=0;e=0;a:while(1){if(!(c4(y,200,c[m>>2]|0)|0))break;if(g<<24>>24==0|d<<24>>24==0){i=y;k=e;}else break;b:while(1){j=f;c:while(1){while(1){if(r6(188036,i,4,z,0)|0){f=j;e=k;continue a}a[i+(c[n>>2]|0)>>0]=0;a[i+(c[o>>2]|0)>>0]=0;e=i+(c[p>>2]|0)|0;f=i+(c[q>>2]|0)|0;i=i+((c[r>>2]|0)+1)|0;if(!(s2(e,141116)|0))break;if(!(s2(e,141048)|0))break c;if(s2(e,98711)|0)continue;c[C>>2]=t;c[C+4>>2]=u;c[C+8>>2]=v;c[C+12>>2]=w;if((b5(f,98719,C)|0)==4)break b}c[A>>2]=s;c[A+4>>2]=x;if((b5(f,98701,A)|0)!=2){c[D>>2]=s;if((b5(f,101209,D)|0)==1){e=1;f=jG(+h[s>>3],98708)|0;}else {e=g;f=j;}}else {e=1;f=jG(+h[s>>3],x)|0;}if(!(d<<24>>24)){d=0;g=e;j=f;}else {g=e;e=k;continue a}}c[E>>2]=s;c[E+4>>2]=x;if((b5(f,98701,E)|0)!=2){c[B>>2]=s;if((b5(f,101209,B)|0)==1){d=1;e=jG(+h[s>>3],98708)|0;}else e=k;}else {d=1;e=jG(+h[s>>3],x)|0;}if(!(g<<24>>24)){g=0;f=j;k=e;}else {f=j;continue a}}d=1;g=1;f=~~(+h[v>>3]+1.0-+h[t>>3])>>>0;e=~~(+h[w>>3]+1.0-+h[u>>3])>>>0;}c[b+48>>2]=0;c[b+40>>2]=f;c[b+44>>2]=e;l=F;return}function aG(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0;d=l;l=l+32|0;b=d;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,0,0)|0;if(!(dG(c[e>>2]|0,b)|0)){g=+h[b>>3];c[a+32>>2]=~~g;f=+h[b+8>>3];c[a+36>>2]=~~f;c[a+40>>2]=~~(+h[b+16>>3]-g);c[a+44>>2]=~~(+h[b+24>>3]-f);}l=d;return}function bG(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+16|0;b=f+4|0;d=f;c[a+48>>2]=0;e=a+20|0;n5(c[e>>2]|0,6,0)|0;if((cG(c[e>>2]|0,1,b)|0)<<24>>24?(cG(c[e>>2]|0,1,d)|0)<<24>>24:0){c[a+40>>2]=c[b>>2];c[a+44>>2]=c[d>>2];}l=f;return}function cG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[d>>2]=0;e=0;while(1){if(e>>>0>=b>>>0){e=1;break}f=D6(a)|0;if(H4(a)|0){e=0;break}c[d>>2]=c[d>>2]<<8|f;e=e+1|0;}return e|0}function dG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+1040|0;d=h;e=h+16|0;while(1){if(!(c4(e,1024,a)|0)){a=1;break}f=d4(e,98627)|0;if(f|0){g=4;break}}if((g|0)==4){c[d+4>>2]=e;c[d>>2]=f+9;c[d+8>>2]=a;a=eG(d,b)|0;}l=h;return a|0}function eG(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+1024|0;f=g;fG(b);e=a[c[b>>2]>>0]|0;if(!(e<<24>>24))e=(gG(b)|0)&255;else e=e<<24>>24;if((((e|0)==91?(c[b>>2]=(c[b>>2]|0)+1,hG(b,f),(iG(f,d)|0)==0):0)?(hG(b,f),(iG(f,d+8|0)|0)==0):0)?(hG(b,f),(iG(f,d+16|0)|0)==0):0){hG(b,f);e=(iG(f,d+24|0)|0)!=0&1;}else e=1;l=g;return e|0}function fG(b){b=b|0;var d=0;d=c[b>>2]|0;while(1){d=a[d>>0]|0;if(!(d<<24>>24))d=(gG(b)|0)&255;else d=d<<24>>24;if(!((d&255)<<24>>24))break;if(!(S2(d&255)|0))break;d=(c[b>>2]|0)+1|0;c[b>>2]=d;}return}function gG(b){b=b|0;var d=0;d=b+4|0;if(!(c4(c[d>>2]|0,1024,c[b+8>>2]|0)|0))b=0;else {d=c[d>>2]|0;c[b>>2]=d;b=a[d>>0]|0;}return b|0}function hG(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;fG(b);e=0;f=c[b>>2]|0;while(1){f=a[f>>0]|0;if(!(f<<24>>24))g=(gG(b)|0)&255;else g=f<<24>>24;f=g<<24>>24;if(!f)break;if(!((f|0)==46|(f+-48|0)>>>0<10))break;a[d+e>>0]=g;e=e+1|0;f=(c[b>>2]|0)+1|0;c[b>>2]=f;if((e|0)==1023){e=1023;break}}a[d+e>>0]=0;return}function iG(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0;e=l;l=l+16|0;f=e;d=+s5(a,f);if((c[f>>2]|0)==(a|0))a=1;else {h[b>>3]=d;a=0;}l=e;return a|0}function jG(a,b){a=+a;b=b|0;var c=0.0;do if(!(s2(b,98735)|0)){a=a*72.0;c=a;a=a>=0.0?.5:-.5;}else {if(!(s2(b,98738)|0)){a=a*.75;c=a;a=a>=0.0?.5:-.5;break}if(!(s2(b,98741)|0)){a=a*12.0;c=a;a=a>=0.0?.5:-.5;break}if(s2(b,98708)|0?s2(b,98744)|0:0)if(!(s2(b,98746)|0)){a=a*28.346456664;c=a;a=a>=0.0?.5:-.5;break}else {b=(s2(b,98749)|0)==0;c=a*2.8346456663999997;return (b?~~(c+(c>=0.0?.5:-.5)):0)|0}c=a>=0.0?.5:-.5;}while(0);return ~~(a+c)|0}function kG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[d>>2]=0;e=0;while(1){if(e>>>0>=b>>>0){e=1;break}f=D6(a)|0;if(H4(a)|0){e=0;break}c[d>>2]=c[d>>2]|f<<(e<<3);e=e+1|0;}return e|0}function lG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;a=c[b+20>>2]|0;if(a|0)I4(a)|0;if(c[b+52>>2]|0?(e=c[b+60>>2]|0,e|0):0)tb[e&127](b);U1(b);return}function mG(){var a=0;GA(0,1,108224,105493)|0;a=zF(0,1)|0;aT(a,0);return a|0}function nG(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0;k=l;l=l+304|0;j=k+24|0;i=k+8|0;f=k;g=k+40|0;if((vS(b,e)|0)!=999)if((wS(b,d)|0)==-1)b=-1;else {b=c[d+16>>2]|0;e=b+16|0;if(!(a[(c[b+8>>2]|0)+81>>0]|0)){p=+h[e>>3];o=+h[b+24>>3];n=+h[b+32>>3];m=+h[b+40>>3];c[j>>2]=~~(p+(p>=0.0?.5:-.5));c[j+4>>2]=~~(o+(o>=0.0?.5:-.5));c[j+8>>2]=~~(n+(n>=0.0?.5:-.5));c[j+12>>2]=~~(m+(m>=0.0?.5:-.5));m4(g,98899,j)|0;}else {m=+h[b+24>>3];n=+h[e>>3];o=+h[b+40>>3];p=+h[b+32>>3];c[i>>2]=~~(m+(m>=0.0?.5:-.5));c[i+4>>2]=~~(n+(n>=0.0?.5:-.5));c[i+8>>2]=~~(o+(o>=0.0?.5:-.5));c[i+12>>2]=~~(p+(p>=0.0?.5:-.5));m4(g,98899,i)|0;}TA(d,102671,g,195059)|0;b=0;}else {b=MF(b,1,e)|0;c[f>>2]=e;c[f+4>>2]=b;gA(1,111233,f)|0;b=-1;}l=k;return b|0}function oG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=c[b+60>>2]|0;DF(a,d)|0;b=c[a+164>>2]|0;c[b+56>>2]=JR(b,c[b+52>>2]|0)|0;if((TC(f,137483,0,1)|0)!=0?(c[(c[f+16>>2]|0)+8>>2]|0)!=0:0)h=5;else if(!(c[b+152>>2]&67108864)){jA(98911,g);b=-1;}else h=5;if((h|0)==5){c[b+36>>2]=e;if(!e){h=b+152|0;c[h>>2]=c[h>>2]|134217728;}h=SJ(a,f)|0;LR(b);IF(a);b=h;}l=i;return b|0}function pG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;f=c[b+60>>2]|0;DF(a,d)|0;b=c[a+164>>2]|0;c[b+56>>2]=JR(b,c[b+52>>2]|0)|0;if((TC(f,137483,0,1)|0)!=0?(c[(c[f+16>>2]|0)+8>>2]|0)!=0:0)h=5;else if(!(c[b+152>>2]&67108864)){jA(98911,g);b=-1;}else h=5;if((h|0)==5){CF(a,e);h=SJ(a,f)|0;LR(b);sF(b);IF(a);b=h;}l=i;return b|0}function qG(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;h=m+8|0;g=m;b=c[b+60>>2]|0;DF(a,d)|0;j=c[a+164>>2]|0;c[j+56>>2]=JR(j,c[j+52>>2]|0)|0;if((TC(b,137483,0,1)|0)!=0?(c[(c[b+16>>2]|0)+8>>2]|0)!=0:0)k=5;else if(!(c[j+152>>2]&67108864)){jA(98911,g);b=-1;}else k=5;do if((k|0)==5){if(e|0?(i=T1(4096)|0,c[e>>2]=i,i|0):0){g=j+40|0;c[g>>2]=i;c[j+44>>2]=4096;d=j+48|0;c[d>>2]=0;b=SJ(a,b)|0;LR(j);if(!b){c[e>>2]=c[g>>2];c[f>>2]=c[d>>2];}IF(a);break}gA(1,98932,h)|0;b=-1;}while(0);l=m;return b|0}function rG(a,b){a=a|0;b=b|0;_S(a,0,b);return}function sG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+4288|0;E=H+8|0;D=H;F=4;G=T1(40)|0;c[G>>2]=0;A=H+4152|0;B=H+4148|0;C=H+4128|0;j=H+4112|0;k=H+16|0;o=0;i=$(24,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;a:do if((h|0)!=1){if(!i){c[d>>2]=0;g=0;break}o=0;n=ca(29,e|0,B|0,A|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;m=$(23,40)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;na(7,C|0,j|0,k|0,24,85);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)!=1){j=C+16|0;i=c[j>>2]|0;g=e;while(1){if(!g)break;o=0;aa(i|0,g|0,0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){y=0;x=j;w=m;v=n;g=z;m=15;break a}o=0;g=aa(86,b|0,g|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){y=0;x=j;w=m;v=n;g=z;m=15;break a}}G=U6(188068,1,G|0,F|0)|0;F=z;o=0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){y=m;x=j;w=m;v=n;g=z;m=15;}else {y=m;x=j;w=m;v=n;g=0;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=m;v=n;g=z;m=15;}}else {y=0;x=0;w=0;v=n;g=z;m=15;}}else {y=0;x=0;w=0;v=0;g=z;m=15;}while(0);do if((m|0)==15){b:while(1){c:do if(!g){o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}u=v+(c[B>>2]|0)|0;k=0;m=0;j=0;while(1){if(!e)break;o=0;g=aa(c[x>>2]|0,e|0,-1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){i=V6(c[h>>2]|0,G|0,F|0)|0;if(!i)bb(h|0,p|0);z=p;}else i=-1;if((i|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if((g|0)==0?(a[(c[e+16>>2]|0)+119>>0]|0)==3:0){if(!m){o=0;c[D>>2]=j;ca(30,u|0,137395,D|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;i=ca(31,b|0,v|0,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(53,i|0,137483,280,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}c[y+(j<<2)>>2]=i;k=1;j=j+1|0;}else i=m;o=0;da(54,b|0,e|0,i|0,C|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}}else i=m;o=0;e=aa(86,b|0,e|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}m=i;}o=0;e=$(25,b|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}i=10;n=y;q=w;r=w;t=w;while(1){if(!e){m=0;i=r;e=t;break c}o=0;g=aa(c[x>>2]|0,e|0,-1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){m=V6(c[h>>2]|0,G|0,F|0)|0;if(!m)bb(h|0,p|0);z=p;}else m=-1;if((m|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if(!g){o=0;c[E>>2]=j;ca(30,u|0,137395,E|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;s=ca(31,b|0,v|0,1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(53,s|0,137483,280,1)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){g=V6(c[h>>2]|0,G|0,F|0)|0;if(!g)bb(h|0,p|0);z=p;}else g=-1;if((g|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}o=0;da(54,b|0,e|0,s|0,C|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}if((j|0)==(i|0)){i=j<<1;o=0;m=aa(87,q|0,j<<3|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}g=m;q=m;r=m;h=m;}else {g=n;h=t;}c[g+(j<<2)>>2]=s;n=g;j=j+1|0;m=h;}else m=t;o=0;e=aa(86,b|0,e|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}t=m;}}else {m=1;k=0;n=y;j=0;i=w;e=w;}while(0);o=0;ia(108,C|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}if((v|0)!=(A|0)){o=0;ia(105,v|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}}if(!m){o=0;g=aa(87,e|0,j<<2|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue}else {m=58;break}}c[d>>2]=0;g=0;while(1){if((g|0)>=(j|0))break;o=0;$(26,c[n+(g<<2)>>2]|0)|0;h=o;o=0;if((h|0)!=0&(p|0)!=0){e=V6(c[h>>2]|0,G|0,F|0)|0;if(!e)bb(h|0,p|0);z=p;}else e=-1;if((e|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;continue b}g=g+1|0;}o=0;ia(105,i|0);g=o;o=0;if((g|0)!=0&(p|0)!=0){h=V6(c[g>>2]|0,G|0,F|0)|0;if(!h)bb(g|0,p|0);z=p;}else h=-1;if((h|0)==1){s=v;t=w;u=x;m=y;g=z;v=s;w=t;x=u;y=m;m=15;}else {m=56;break}}if((m|0)==56){g=0;break}else if((m|0)==58){c[d>>2]=j;a[f>>0]=k;break}}while(0);U1(G|0);l=H;return g|0}function tG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if(!((a|0)!=0?(CG(a)|0)!=0:0))a=98988;e=l2(a)|0;if((e|0)>=104){d=KK(e+25|0)|0;if(!d)d=0;else f=6;}else f=6;if((f|0)==6){r3(d,a)|0;c[b>>2]=e;}return d|0}function uG(a,b){a=a|0;b=b|0;oC(b,a,1)|0;return}function vG(b,d){b=b|0;d=d|0;var e=0;b=(c[b+16>>2]|0)+157|0;e=a[b>>0]|0;if((d|0)>=0)a[b>>0]=d;return e|0}function wG(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[b>>2]=d;c[b+4>>2]=d+4096;c[b+12>>2]=0;c[b+8>>2]=0;c[a>>2]=b;c[a+4>>2]=b;c[a+8>>2]=d;c[a+12>>2]=e;c[a+16>>2]=f;return}function xG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;AG(e,b);i=e+12|0;j=e+16|0;b=0;a:while(1){k=BG(e)|0;if(!k)break;b=b+1|0;f=c[i>>2]|0;if(f|0)ub[f&63](k,d);h=aB(a,k)|0;while(1){if(!h)continue a;g=c[h>>2]&3;f=c[((g|0)==3?h:h+48|0)+40>>2]|0;if((f|0)==(k|0))f=c[((g|0)==2?h:h+-48|0)+40>>2]|0;if(!(lb[c[j>>2]&127](f,-1)|0))AG(e,f);h=bB(a,h,k)|0;}}return b|0}function yG(a){a=a|0;var b=0;a=c[(c[a>>2]|0)+12>>2]|0;while(1){if(!a)break;b=c[a+12>>2]|0;zG(a);a=b;}return}function zG(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function AG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;f=k;g=a+8|0;i=a+4|0;d=c[i>>2]|0;if((c[g>>2]|0)==(c[d+4>>2]|0)){d=c[d+12>>2]|0;do if(!d){e=KK(16)|0;if(!e){gA(1,98969,f)|0;bb(188068,1);}c[e+8>>2]=c[i>>2];c[e+12>>2]=0;d=KK(4e6)|0;c[e>>2]=d;if(!d){gA(1,98969,j)|0;bb(188068,1);}else {c[e+4>>2]=d+4e6;c[(c[i>>2]|0)+12>>2]=e;h=e;break}}else h=d;while(0);c[i>>2]=h;c[g>>2]=c[h>>2];}lb[c[a+16>>2]&127](b,1)|0;j=c[g>>2]|0;c[g>>2]=j+4;c[j>>2]=b;l=k;return}function BG(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+8|0;b=c[f>>2]|0;d=a+4|0;e=c[d>>2]|0;if((b|0)==(c[e>>2]|0))if((e|0)==(c[a>>2]|0))b=0;else {b=c[e+8>>2]|0;c[d>>2]=b;b=c[b+4>>2]|0;c[f>>2]=b;g=4;}else g=4;if((g|0)==4){b=b+-4|0;c[f>>2]=b;b=c[b>>2]|0;}return b|0}function CG(b){b=b|0;var c=0;a:while(1){c=b;b=b+1|0;c=a[c>>0]|0;switch(c<<24>>24){case 95:continue a;case 0:{b=1;break a}default:{}}if(!(a3(c&255)|0)){b=0;break}}return b|0}function DG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0;B=l;l=l+4272|0;x=B;y=4;A=T1(40)|0;c[A>>2]=0;u=B+4144|0;v=B+4140|0;w=B+4120|0;h=B+4104|0;i=B+8|0;o=0;f=$(24,a|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){e=V6(c[g>>2]|0,A|0,y|0)|0;if(!e)bb(g|0,p|0);z=p;}else e=-1;a:do if((e|0)!=1)if(f){o=0;k=ca(29,d|0,v|0,u|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;j=$(23,40)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;na(7,w|0,h|0,i|0,24,85);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){o=0;f=$(25,a|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1){h=w+16|0;g=c[h>>2]|0;e=f;while(1){if(!e)break;o=0;aa(g|0,e|0,0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){t=h;s=j;r=k;e=z;j=14;break a}o=0;e=aa(86,a|0,e|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){t=h;s=j;r=k;e=z;j=14;break a}}A=U6(188068,1,A|0,y|0)|0;y=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){t=h;s=j;r=k;e=z;j=14;}else {t=h;s=j;r=k;e=0;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=j;r=k;e=z;j=14;}}else {t=0;s=0;r=k;e=z;j=14;}}else {d=0;e=0;}else {t=0;s=0;r=0;e=z;j=14;}while(0);b:do if((j|0)==14){c:while(1){if(e|0){o=0;ia(108,w|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}o=0;ia(105,s|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}if((r|0)==(u|0)){d=0;e=0;break b}o=0;ia(105,r|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}else {j=19;break}}o=0;f=$(25,a|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,A|0,y|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}q=r+(c[v>>2]|0)|0;h=10;k=s;e=0;j=s;n=s;while(1){if(!f)break;o=0;d=aa(c[t>>2]|0,f|0,-1)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,A|0,y|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}if(!d){o=0;c[x>>2]=e;ca(30,q|0,137395,x|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;m=ca(31,a|0,r|0,1)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;da(53,m|0,137483,280,1)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}o=0;da(54,a|0,f|0,m|0,w|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}if((e|0)==(h|0)){h=e<<1;o=0;i=aa(87,j|0,e<<3|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}g=i;j=i;d=i;}else {g=k;d=n;}c[g+(e<<2)>>2]=m;e=e+1|0;k=g;i=d;}else i=n;o=0;f=aa(86,a|0,f|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){g=V6(c[d>>2]|0,A|0,y|0)|0;if(!g)bb(d|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue c}n=i;}o=0;ia(108,w|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){f=V6(c[d>>2]|0,A|0,y|0)|0;if(!f)bb(d|0,p|0);z=p;}else f=-1;if((f|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}o=0;d=aa(87,n|0,e<<2|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,A|0,y|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;continue}if((r|0)==(u|0))break b;o=0;ia(105,r|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,A|0,y|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){n=r;q=s;j=t;e=z;r=n;s=q;t=j;j=14;}else {j=39;break}}if((j|0)==19){d=0;e=0;break}else if((j|0)==39)break}while(0);c[b>>2]=e;U1(A|0);l=B;return d|0}function EG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=0;f=jC(a)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;if(oC(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,0)|0){mB(a,e,1)|0;d=d+1|0;}e=ZA(b,e)|0;}f=kC(a,f)|0;}return d|0}function FG(a){a=a|0;a=RC(a,98993,0)|0;if(!a)qa(98998,99001,529,99010);else return c[a+8>>2]|0;return 0}function GG(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;u=l;l=l+4320|0;s=u+24|0;r=u+8|0;q=u;t=u+4184|0;p=u+4160|0;f=u+40|0;if(tB(b)|0){YC(b,0,99019,-12,0);YC(b,1,99031,16,0);o=tG(e,f,t)|0;k=HG(b)|0;m=KK((tB(k)|0)<<2)|0;wG(p,u+4144|0,u+48|0,24,88);h=jC(k)|0;n=p+16|0;i=o+(c[f>>2]|0)|0;j=c[15712]|0;e=0;while(1){if(!h)break;if(!(lb[c[n>>2]&127](h,-1)|0)){c[q>>2]=e;m4(i,99933,q)|0;v=ND(k,o,1)|0;w=ND(b,o,1)|0;TC(w,99019,12,0)|0;a[(RC(w,99019,0)|0)+8>>0]=1;f=xG(k,h,v,p)|0;JG(v,w);g=KG(w)|0;LG(b,w);c[m+(e<<2)>>2]=w;wC(k,v)|0;if(0);e=e+1|0;}h=kC(k,h)|0;}if(0);sB(k)|0;ZC(b,0,99019);ZC(b,1,99031);yG(p);f=MK(m,e<<2)|0;if((o|0)!=(t|0))U1(o);}else {f=0;e=0;}c[d>>2]=e;l=u;return f|0}function HG(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;a[h>>0]=a[18596]|0;a[h+1>>0]=a[18597]|0;a[h+2>>0]=a[18598]|0;a[h+3>>0]=a[18599]|0;h=oB(99120,h,0)|0;OG(h,b);d=jC(b)|0;while(1){if(!d)break;if(!(c[(RC(d,99031,0)|0)+12>>2]|0)){g=tC(h,KB(d)|0,1)|0;TC(g,99031,16,1)|0;c[(c[g+16>>2]|0)+12>>2]=d;c[(RC(d,99031,0)|0)+12>>2]=g;}d=kC(b,d)|0;}e=jC(b)|0;while(1){if(!e)break;f=c[(RC(e,99031,0)|0)+12>>2]|0;d=XA(b,e)|0;while(1){if(!d)break;g=c[(RC(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,99031,0)|0)+12>>2]|0;do if((g|0)!=(f|0))if(g>>>0>f>>>0){iB(h,f,g,0,1)|0;break}else {iB(h,g,f,0,1)|0;break}while(0);d=ZA(b,d)|0;}e=kC(b,e)|0;}l=i;return h|0}function IG(b,d){b=b|0;d=d|0;var e=0;b=(c[b+16>>2]|0)+8|0;e=a[b>>0]|0;if((d|0)>=0)a[b>>0]=d;return e|0}function JG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=jC(a)|0;while(1){if(!e)break;f=c[(c[e+16>>2]|0)+12>>2]|0;a:do if((c[f>>2]&3|0)==1)oC(b,f,1)|0;else {d=jC(f)|0;while(1){if(!d)break a;oC(b,d,1)|0;d=kC(f,d)|0;}}while(0);e=kC(a,e)|0;}return}function KG(a){a=a|0;return EG(a,c[a+60>>2]|0)|0}function LG(a,b){a=a|0;b=b|0;MG(a,b,0);return}function MG(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;g=(d|0)==0;b=OD(b)|0;while(1){if(!b)break;if((a[(RC(b,99019,0)|0)+8>>0]|0)==0?(f=NG(b,c,d)|0,f|0):0){if(g)e=(Q2(KB(b)|0,108006,7)|0)==0;else e=1;MG(b,f,e&1);}b=PD(b)|0;}return}function NG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=0;g=jC(a)|0;while(1){if(!g)break;f=tC(b,KB(g)|0,0)|0;if(f){if(!e)e=ND(b,KB(a)|0,1)|0;oC(e,f,1)|0;}g=kC(a,g)|0;}if((d|0)!=0&(e|0)==0)e=ND(b,KB(a)|0,1)|0;if(e|0?(EG(e,a)|0,UA(a,e)|0,(Q2(KB(e)|0,108006,7)|0)==0):0)c[(TC(e,98993,12,0)|0)+8>>2]=a;return e|0}function OG(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+16|0;g=h;d=OD(b)|0;e=c[15712]|0;while(1){if(!d)break;a:do if(!(Q2(KB(d)|0,108006,7)|0)){f=tC(a,KB(d)|0,1)|0;TC(f,99031,16,1)|0;c[(c[f+16>>2]|0)+12>>2]=d;b=jC(d)|0;while(1){if(!b)break a;if(c[(RC(b,99031,0)|0)+12>>2]|0){k=KB(b)|0;j=KB(d)|0;i=KB(c[(RC(b,99031,0)|0)+12>>2]|0)|0;c[g>>2]=k;c[g+4>>2]=j;c[g+8>>2]=i;w4(e,99123,g)|0;}c[(RC(b,99031,0)|0)+12>>2]=f;b=kC(d,b)|0;}}else OG(a,d);while(0);d=PD(d)|0;}l=h;return}function PG(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0.0;n=+h[a>>3];j=~~(n+(n>=0.0?.5:-.5));n=+h[a+8>>3];a=~~(n+(n>=0.0?.5:-.5));n=+h[b>>3];g=~~(n+(n>=0.0?.5:-.5));n=+h[b+8>>3];f=~~(n+(n>=0.0?.5:-.5));l=g-j|0;i=((l|0)>-1?l:0-l|0)<<1;l=l>>31|1;m=f-a|0;k=((m|0)>-1?m:0-m|0)<<1;m=m>>31|1;a:do if((i|0)>(k|0)){e=0-i|0;d=k-(i>>1)|0;b=j;while(1){QL(c,b,a);if((b|0)==(g|0))break a;j=(d|0)>-1;d=d+k+(j?e:0)|0;b=b+l|0;a=(j?m:0)+a|0;}}else {e=0-k|0;d=j;b=i-(k>>1)|0;while(1){QL(c,d,a);if((a|0)==(f|0))break a;k=(b|0)>-1;d=(k?l:0)+d|0;b=b+i+(k?e:0)|0;a=a+m|0;}}while(0);return}function QG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;j=n+4|0;do if((a|0)<1)d=0;else {f=e+16|0;if((c[f>>2]|0)>>>0<4){d=RG(a,b,d,e)|0;break}m=KK(a<<5)|0;d=0;while(1){if((d|0)==(a|0))break;g=c[b+(d<<2)>>2]|0;BP(g);h=m+(d<<5)|0;g=(c[g+16>>2]|0)+16|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];c[h+16>>2]=c[g+16>>2];c[h+20>>2]=c[g+20>>2];c[h+24>>2]=c[g+24>>2];c[h+28>>2]=c[g+28>>2];d=d+1|0;}if((c[f>>2]|0)==4){h=e+28|0;a:do if(c[h>>2]&2|0){f=e+24|0;c[f>>2]=JK(a<<2)|0;d=0;while(1){if((d|0)==(a|0))break a;g=QA(c[b+(d<<2)>>2]|0,99190)|0;if(g|0?(c[k>>2]=j,g=(b5(g,137395,k)|0)>0,i=c[j>>2]|0,g&(i|0)>-1):0)c[(c[f>>2]|0)+(d<<2)>>2]=i;d=d+1|0;}}while(0);d=SG(a,m,e)|0;if(c[h>>2]&2)U1(c[e+24>>2]|0);}else d=0;U1(m);}while(0);l=n;return d|0}function RG(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0.0,J=0.0,K=0.0;G=l;l=l+144|0;B=G+136|0;A=G+64|0;F=G+48|0;v=G+40|0;u=G;t=G+120|0;x=G+104|0;C=G+96|0;D=c[f+20>>2]|0;c[x>>2]=0;c[x+4>>2]=0;c[x+8>>2]=0;c[x+12>>2]=0;a:do if((b|0)>=1){o=(D|0)==0;E=c[15712]|0;p=t+4|0;q=t+8|0;r=t+12|0;y=x+4|0;w=x+8|0;z=x+12|0;n=0;g=0;while(1){if((n|0)==(b|0))break;s=c[d+(n<<2)>>2]|0;BP(s);if(!o?(a[D+n>>0]|0)!=0:0){m=c[s+16>>2]|0;H=+h[m+16>>3];i=~~(H+(H>=0.0?.5:-.5));c[t>>2]=i;H=+h[m+24>>3];j=~~(H+(H>=0.0?.5:-.5));c[p>>2]=j;H=+h[m+32>>3];k=~~(H+(H>=0.0?.5:-.5));c[q>>2]=k;H=+h[m+40>>3];m=~~(H+(H>=0.0?.5:-.5));c[r>>2]=m;if(!g){c[x>>2]=c[t>>2];c[x+4>>2]=c[t+4>>2];c[x+8>>2]=c[t+8>>2];c[x+12>>2]=c[t+12>>2];}else {c[x>>2]=c[((c[x>>2]|0)>(i|0)?t:x)>>2];c[y>>2]=c[((c[y>>2]|0)>(j|0)?t:x)+4>>2];c[w>>2]=c[((c[w>>2]|0)<(k|0)?t:x)+8>>2];c[z>>2]=c[((c[z>>2]|0)<(m|0)?t:x)+12>>2];}g=g+1|0;}if(0>2);n=n+1|0;}q=KK(b<<5)|0;g=0;while(1){if((g|0)==(b|0))break;u=q+(g<<5)|0;t=(c[(c[d+(g<<2)>>2]|0)+16>>2]|0)+16|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[u+16>>2]=c[t+16>>2];c[u+20>>2]=c[t+20>>2];c[u+24>>2]=c[t+24>>2];c[u+28>>2]=c[t+28>>2];g=g+1|0;}o=f+8|0;p=VG(b,q,c[o>>2]|0)|0;if(0);if((p|0)>=1){n=(D|0)!=0;if(n){i=((c[w>>2]|0)+(c[x>>2]|0)|0)/2|0;g=((c[z>>2]|0)+(c[y>>2]|0)|0)/2|0;}else {i=0;g=0;}c[C+4>>2]=g;c[C>>2]=i;m=JK(b<<4)|0;k=f+16|0;g=0;while(1){if((g|0)>=(b|0))break;i=c[d+(g<<2)>>2]|0;j=m+(g<<4)|0;c[m+(g<<4)+12>>2]=g;if((c[k>>2]|0)==3){x=(c[i+16>>2]|0)+16|0;y=c[o>>2]|0;z=KB(i)|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];c[A+16>>2]=c[x+16>>2];c[A+20>>2]=c[x+20>>2];c[A+24>>2]=c[x+24>>2];c[A+28>>2]=c[x+28>>2];c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];WG(A,j,p,y,B,z);}else {c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];XG(e,i,j,p,f,B);}g=g+1|0;}j=JK(b<<2)|0;g=0;while(1){if((g|0)>=(b|0))break;c[j+(g<<2)>>2]=m+(g<<4);g=g+1|0;}o4(j,b,4,89);k=KL()|0;g=JK(b<<3)|0;b:do if(n){i=0;while(1){if((i|0)>=(b|0)){i=0;break}if(a[D+i>>0]|0){e=c[j+(i<<2)>>2]|0;f=g+(c[e+12>>2]<<3)|0;c[B>>2]=c[C>>2];c[B+4>>2]=c[C+4>>2];ZG(e,k,f,B);}i=i+1|0;}while(1){if((i|0)>=(b|0))break b;if(!(a[D+i>>0]|0)){C=c[j+(i<<2)>>2]|0;_G(i,C,k,g+(c[C+12>>2]<<3)|0,p,c[o>>2]|0,q);}i=i+1|0;}}else {i=0;while(1){if((i|0)>=(b|0))break b;D=c[j+(i<<2)>>2]|0;_G(i,D,k,g+(c[D+12>>2]<<3)|0,p,c[o>>2]|0,q);i=i+1|0;}}while(0);U1(j);i=0;while(1){if((i|0)>=(b|0))break;U1(c[m+(i<<4)+4>>2]|0);i=i+1|0;}U1(m);NL(k);U1(q);if(0>1);}else g=0;}else g=0;while(0);l=G;return g|0}function SG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=l;l=l+16|0;g=z;x=JK(a<<3)|0;f=c[d+4>>2]|0;y=d+28|0;e=(f|0)>0;do if(!(c[y>>2]&1))if(e){k=1;w=(a+-1+f|0)/(f|0)|0;break}else {f=~~+N(+(+C(+(+(a|0)))));k=1;w=(a+-1+f|0)/(f|0)|0;break}else if(e){k=0;w=f;f=(a+-1+f|0)/(f|0)|0;break}else {f=~~+N(+(+C(+(+(a|0)))));k=0;w=f;f=(a+-1+f|0)/(f|0)|0;break}while(0);if(0);t=JK((f<<3)+8|0)|0;u=JK((w<<3)+8|0)|0;v=JK(a*24|0)|0;j=d+8|0;e=0;g=v;while(1){if((e|0)>=(a|0))break;p=+h[b+(e<<5)+8>>3];o=+h[b+(e<<5)+24>>3];q=+((c[j>>2]|0)>>>0);h[g>>3]=+h[b+(e<<5)+16>>3]-+h[b+(e<<5)>>3]+q;h[g+8>>3]=o-p+q;c[g+16>>2]=e;e=e+1|0;g=g+24|0;}s=JK(a<<2)|0;e=0;while(1){if((e|0)>=(a|0))break;c[s+(e<<2)>>2]=v+(e*24|0);e=e+1|0;}e=c[d+24>>2]|0;if(!e){if(!(c[y>>2]&64))o4(s,a,4,91);}else {c[47056]=e;o4(s,a,4,90);}r=(k|0)==0;e=0;g=0;j=0;while(1){if((j|0)>=(a|0)){i=0.0;e=0;break}k=c[s+(j<<2)>>2]|0;d=t+(g<<3)|0;q=+h[d>>3];p=+h[k>>3];h[d>>3]=q>p?q:p;d=u+(e<<3)|0;p=+h[d>>3];q=+h[k+8>>3];h[d>>3]=p>q?p:q;if(r){e=e+1|0;d=(e|0)==(w|0);e=d?0:e;g=g+(d&1)|0;}else {g=g+1|0;d=(g|0)==(f|0);e=e+(d&1)|0;g=d?0:g;}j=j+1|0;}while(1){if((e|0)>(f|0)){i=0.0;e=w;break}d=t+(e<<3)|0;q=+h[d>>3];h[d>>3]=i;i=q+i;e=e+1|0;}while(1){if((e|0)<=0)break;d=e+-1|0;q=+h[u+(d<<3)>>3];h[u+(e<<3)>>3]=i;i=q+i;e=d;}h[u>>3]=i;e=0;g=0;d=0;while(1){if((d|0)>=(a|0))break;k=c[(c[s+(d<<2)>>2]|0)+16>>2]|0;i=+h[b+(k<<5)>>3];m=-i;p=+h[b+(k<<5)+8>>3];q=-p;n=+h[b+(k<<5)+16>>3];o=+h[b+(k<<5)+24>>3];j=c[y>>2]|0;do if(!(j&4))if(!(j&8)){i=(m-n+ +h[t+(g<<3)>>3]+ +h[t+(g+1<<3)>>3])*.5;break}else {i=i-n+ +h[t+(g+1<<3)>>3];break}else i=+h[t+(g<<3)>>3];while(0);c[x+(k<<3)>>2]=~~i;do if(!(j&16))if(!(j&32)){i=(q-o+ +h[u+(e<<3)>>3]+ +h[u+(e+1<<3)>>3])*.5;break}else {i=+h[u+(e+1<<3)>>3];break}else i=p-o+ +h[u+(e<<3)>>3];while(0);c[x+(k<<3)+4>>2]=~~i;if(r){e=e+1|0;k=(e|0)==(w|0);e=k?0:e;g=g+(k&1)|0;}else {g=g+1|0;k=(g|0)==(f|0);e=e+(k&1)|0;g=k?0:g;}d=d+1|0;}U1(v);U1(s);U1(t);U1(u);l=z;return x|0}function TG(a,b){a=a|0;b=b|0;var d=0;d=c[47056]|0;a=c[d+(c[(c[a>>2]|0)+16>>2]<<2)>>2]|0;b=c[d+(c[(c[b>>2]|0)+16>>2]<<2)>>2]|0;return ((a|0)>(b|0)?1:((a|0)<(b|0))<<31>>31)|0}function UG(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a>>2]|0;b=c[b>>2]|0;e=+h[a>>3]+ +h[a+8>>3];d=+h[b>>3]+ +h[b+8>>3];return (ed)<<31>>31)|0}function VG(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0;s=l;l=l+96|0;q=s+80|0;r=s+48|0;p=s+8|0;m=s;k=(a*100|0)+-1|0;e=+(d<<1|0);n=0.0;o=0.0;d=0;while(1){if((d|0)>=(a|0))break;j=+h[b+(d<<5)+16>>3]-+h[b+(d<<5)>>3]+e;i=+h[b+(d<<5)+24>>3]-+h[b+(d<<5)+8>>3]+e;n=n-j-i;o=o-i*j;d=d+1|0;}i=+(k|0);j=n*n-i*4.0*o;if(!(j<0.0)){e=+C(+j);g=i*2.0;f=(e-n)/g;g=(-n-e)/g;d=~~f;d=(d|0)==0?1:d;if(0>2);}else {h[m>>3]=j;gA(1,99417,m)|0;d=-1;}l=s;return d|0}function WG(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0.0;u=l;l=l+32|0;t=u+16|0;s=u;p=+h[a>>3];q=+h[a+8>>3];n=+h[a+16>>3];o=+h[a+24>>3];r=KL()|0;j=c[f>>2]|0;a=j-e|0;k=c[f+4>>2]|0;i=k-e|0;j=e-~~(p+(p>=0.0?.5:-.5))+j+~~(n+(n>=0.0?.5:-.5))|0;k=e-~~(q+(q>=0.0?.5:-.5))+k+~~(o+(o>=0.0?.5:-.5))|0;if((a|0)>-1)f=(a|0)/(d|0)|0;else f=((a+1|0)/(d|0)|0)+-1|0;if((i|0)>-1)m=(i|0)/(d|0)|0;else m=((i+1|0)/(d|0)|0)+-1|0;if((j|0)>-1)j=(j|0)/(d|0)|0;else j=((j+1|0)/(d|0)|0)+-1|0;if((k|0)>-1)i=(k|0)/(d|0)|0;else i=((k+1|0)/(d|0)|0)+-1|0;while(1){if((f|0)>(j|0))break;else a=m;while(1){if((a|0)>(i|0))break;QL(r,f,a);a=a+1|0;}f=f+1|0;}k=b+4|0;c[k>>2]=UL(r)|0;j=TL(r)|0;m=b+8|0;c[m>>2]=j;w=+(e<<1|0);v=+(d|0);i=~~+N(+((n+w-p)/v));a=~~+N(+((o+w-q)/v));c[b>>2]=a+i;a:do if(0>2);while(0);NL(r);l=u;return}function XG(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,O=0,P=0,Q=0.0,R=0.0;P=l;l=l+128|0;F=P+112|0;E=P+104|0;O=P+16|0;M=P;H=P+64|0;I=P+56|0;z=P+40|0;A=P+96|0;y=P+88|0;v=P+24|0;w=P+80|0;x=P+72|0;K=c[f+8>>2]|0;G=c[f+12>>2]|0;C=(a|0)==0?b:a;L=KL()|0;J=b+16|0;B=c[J>>2]|0;t=+h[B+16>>3];D=(c[g>>2]|0)-~~(t+(t>=0.0?.5:-.5))|0;t=+h[B+24>>3];B=(c[g+4>>2]|0)-~~(t+(t>=0.0?.5:-.5))|0;a:do if((c[f+16>>2]|0)==1){v=KK((tB(b)|0)<<2)|0;a=0;g=jC(b)|0;while(1){if(!g)break;x=g+16|0;c[v+(a<<2)>>2]=c[(c[x>>2]|0)+112>>2];c[(c[x>>2]|0)+112>>2]=0;a=a+1|0;g=kC(b,g)|0;}o=D-K|0;p=B-K|0;q=D+K|0;r=B+K|0;n=1;while(1){a=c[J>>2]|0;if((n|0)>(c[a+180>>2]|0))break;m=c[(c[a+184>>2]|0)+(n<<2)>>2]|0;i=c[m+16>>2]|0;t=+h[i+16>>3];a=~~(t+(t>=0.0?.5:-.5));t=+h[i+24>>3];g=~~(t+(t>=0.0?.5:-.5));t=+h[i+32>>3];f=~~(t+(t>=0.0?.5:-.5));t=+h[i+40>>3];i=~~(t+(t>=0.0?.5:-.5));b:do if((f|0)>(a|0)&(i|0)>(g|0)){a=o+a|0;j=p+g|0;f=q+f|0;k=r+i|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)j=(j|0)/(e|0)|0;else j=((j+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)i=(f|0)/(e|0)|0;else i=((f+1|0)/(e|0)|0)+-1|0;if((k|0)>-1)f=(k|0)/(e|0)|0;else f=((k+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=j;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}a=jC(m)|0;while(1){if(!a)break b;c[(c[a+16>>2]|0)+212>>2]=m;a=kC(m,a)|0;}}while(0);n=n+1|0;}r=z+8|0;s=H+4|0;t=+(K|0);u=I+4|0;q=A+4|0;p=y+4|0;o=jC(b)|0;while(1){if(!o)break;jP(z,o);R=+h[z>>3];Q=+h[r>>3];m=D+~~(R+(R>=0.0?.5:-.5))|0;c[H>>2]=m;n=B+~~(Q+(Q>=0.0?.5:-.5))|0;c[s>>2]=n;g=o+16|0;a=c[g>>2]|0;c:do if(!(c[a+212>>2]|0)){c[I>>2]=~~((+h[a+96>>3]+ +h[a+88>>3])*.5+t);c[u>>2]=~~(+h[a+80>>3]*.5+t);c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];aH(A,E,F);a=c[A>>2]|0;f=c[q>>2]|0;c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];bH(y,E,F);i=c[y>>2]|0;j=c[p>>2]|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)k=(f|0)/(e|0)|0;else k=((f+1|0)/(e|0)|0)+-1|0;if((i|0)>-1)i=(i|0)/(e|0)|0;else i=((i+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)f=(j|0)/(e|0)|0;else f=((j+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=k;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break c;c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);a=ZA(C,a)|0;}}else {if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break c;if((c[(c[g>>2]|0)+212>>2]|0)!=(c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)){c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);}a=ZA(C,a)|0;}}while(0);o=kC(b,o)|0;}a=0;g=jC(b)|0;while(1){if(!g)break;c[(c[g+16>>2]|0)+112>>2]=c[v+(a<<2)>>2];a=a+1|0;g=kC(b,g)|0;}U1(v);}else {r=v+8|0;s=H+4|0;t=+(K|0);u=I+4|0;q=w+4|0;p=x+4|0;o=jC(b)|0;while(1){if(!o)break a;jP(v,o);Q=+h[v>>3];R=+h[r>>3];m=D+~~(Q+(Q>=0.0?.5:-.5))|0;c[H>>2]=m;n=B+~~(R+(R>=0.0?.5:-.5))|0;c[s>>2]=n;a=c[o+16>>2]|0;c[I>>2]=~~((+h[a+96>>3]+ +h[a+88>>3])*.5+t);c[u>>2]=~~(+h[a+80>>3]*.5+t);c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];aH(w,E,F);a=c[w>>2]|0;f=c[q>>2]|0;c[E>>2]=c[H>>2];c[E+4>>2]=c[H+4>>2];c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];bH(x,E,F);i=c[x>>2]|0;j=c[p>>2]|0;if((a|0)>-1)g=(a|0)/(e|0)|0;else g=((a+1|0)/(e|0)|0)+-1|0;if((f|0)>-1)k=(f|0)/(e|0)|0;else k=((f+1|0)/(e|0)|0)+-1|0;if((i|0)>-1)i=(i|0)/(e|0)|0;else i=((i+1|0)/(e|0)|0)+-1|0;if((j|0)>-1)f=(j|0)/(e|0)|0;else f=((j+1|0)/(e|0)|0)+-1|0;while(1){if((g|0)>(i|0))break;else a=k;while(1){if((a|0)>(f|0))break;QL(L,g,a);a=a+1|0;}g=g+1|0;}if((m|0)>-1)a=(m|0)/(e|0)|0;else a=((m+1|0)/(e|0)|0)+-1|0;c[H>>2]=a;if((n|0)>-1)a=(n|0)/(e|0)|0;else a=((n+1|0)/(e|0)|0)+-1|0;c[s>>2]=a;a=XA(C,o)|0;while(1){if(!a)break;c[F>>2]=c[H>>2];c[F+4>>2]=c[H+4>>2];cH(a,F,L,D,B,e,G);a=ZA(C,a)|0;}o=kC(b,o)|0;}}while(0);i=d+4|0;c[i>>2]=UL(L)|0;j=d+8|0;c[j>>2]=TL(L)|0;g=c[J>>2]|0;Q=+(K<<1|0);R=+(e|0);a=~~+N(+((+h[g+32>>3]+Q-+h[g+16>>3])/R));g=~~+N(+((+h[g+40>>3]+Q-+h[g+24>>3])/R));c[d>>2]=g+a;d:do if(0>2);while(0);NL(L);l=P;return}function YG(a,b){a=a|0;b=b|0;return (c[c[b>>2]>>2]|0)-(c[c[a>>2]>>2]|0)|0}function ZG(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+32|0;h=j+16|0;i=j;k=c[a+4>>2]|0;g=c[a+8>>2]|0;c[d>>2]=0-(c[e>>2]|0);f=d+4|0;c[f>>2]=0-(c[e+4>>2]|0);a=0;e=k;while(1){if((a|0)>=(g|0))break;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];OL(b,h);a=a+1|0;e=e+8|0;}if(0>1);l=j;return}function _G(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;k=c[b+12>>2]|0;l=+h[i+(k<<5)>>3];m=+h[i+(k<<5)+8>>3];n=+h[i+(k<<5)+16>>3];o=+h[i+(k<<5)+24>>3];if(!((a|0)==0?(q=+(g<<1|0),p=+(f|0),($G((~~+N(+((q-l+n)/p))|0)/-2|0,(~~+N(+((q-m+o)/p))|0)/-2|0,b,d,e,f,i)|0)!=0):0))j=3;a:do if((j|0)==3?($G(0,0,b,d,e,f,i)|0)==0:0)if((~~+N(+(n-l))|0)<(~~+N(+(o-m))|0)){k=1;while(1){j=0-k|0;a=0;while(1){if((a|0)<=(j|0)){g=j;break}if($G(j,a,b,d,e,f,i)|0)break a;a=a+-1|0;}while(1){if((g|0)>=(k|0))break;if($G(g,a,b,d,e,f,i)|0)break a;g=g+1|0;}while(1){if((a|0)>=(k|0))break;if($G(g,a,b,d,e,f,i)|0)break a;a=a+1|0;}while(1){if((g|0)<=(j|0))break;if($G(g,a,b,d,e,f,i)|0)break a;g=g+-1|0;}while(1){if((a|0)<=0)break;if(!($G(g,a,b,d,e,f,i)|0))a=a+-1|0;else break a}k=k+1|0;}}else {k=1;while(1){j=0-k|0;a=0;while(1){if((a|0)>=(k|0)){g=j;break}if($G(a,j,b,d,e,f,i)|0)break a;a=a+1|0;}while(1){if((g|0)>=(k|0))break;if($G(a,g,b,d,e,f,i)|0)break a;g=g+1|0;}while(1){if((a|0)<=(j|0))break;if($G(a,g,b,d,e,f,i)|0)break a;a=a+-1|0;}while(1){if((g|0)<=(j|0))break;if($G(a,g,b,d,e,f,i)|0)break a;g=g+-1|0;}while(1){if((a|0)>=0)break;if(!($G(a,g,b,d,e,f,i)|0))a=a+1|0;else break a}k=k+1|0;}}while(0);return}function $G(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0;t=l;l=l+48|0;r=t+32|0;s=t+8|0;q=t;m=d+4|0;o=c[d+8>>2]|0;p=q+4|0;j=c[m>>2]|0;k=0;while(1){if((k|0)>=(o|0)){n=5;break}v=j;u=c[v+4>>2]|0;c[q>>2]=(c[v>>2]|0)+a;c[p>>2]=u+b;c[r>>2]=c[q>>2];c[r+4>>2]=c[q+4>>2];if(RL(e,r)|0){j=0;break}j=j+8|0;k=k+1|0;}if((n|0)==5){d=c[d+12>>2]|0;x=+h[i+(d<<5)>>3];w=+h[i+(d<<5)+8>>3];c[f>>2]=(O(g,a)|0)-~~(x+(x>=0.0?.5:-.5));d=f+4|0;c[d>>2]=(O(g,b)|0)-~~(w+(w>=0.0?.5:-.5));j=c[m>>2]|0;k=0;while(1){if((k|0)>=(o|0))break;u=j;v=c[u+4>>2]|0;c[q>>2]=(c[u>>2]|0)+a;c[p>>2]=v+b;c[r>>2]=c[q>>2];c[r+4>>2]=c[q+4>>2];OL(e,r);j=j+8|0;k=k+1|0;}if(0>1);else j=1;}l=t;return j|0}function aH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[b+4>>2]|0)-(c[d+4>>2]|0)|0;c[a>>2]=(c[b>>2]|0)-(c[d>>2]|0);c[a+4>>2]=e;return}function bH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[d+4>>2]|0)+(c[b+4>>2]|0)|0;c[a>>2]=(c[d>>2]|0)+(c[b>>2]|0);c[a+4>>2]=e;return}function cH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+112|0;x=A+96|0;w=A+80|0;r=A+48|0;s=A+32|0;y=A+16|0;z=A;n=A+64|0;h[y>>3]=+(c[b>>2]|0);t=y+8|0;h[t>>3]=+(c[b+4>>2]|0);a:do if((i|0)!=0?(u=a+16|0,m=c[(c[u>>2]|0)+8>>2]|0,(m|0)!=0):0){q=+(e|0);p=+(f|0);o=1.0/+(g|0);n=z+8|0;i=0;while(1){if((i|0)>=(c[m+4>>2]|0))break a;f=c[m>>2]|0;a=c[f+(i*48|0)>>2]|0;b=c[f+(i*48|0)+4>>2]|0;g=c[f+(i*48|0)+8>>2]|0;e=c[f+(i*48|0)+12>>2]|0;m=f+(i*48|0)+16|0;c[r>>2]=c[m>>2];c[r+4>>2]=c[m+4>>2];c[r+8>>2]=c[m+8>>2];c[r+12>>2]=c[m+12>>2];f=f+(i*48|0)+32|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];if(!g){c[y>>2]=c[a>>2];c[y+4>>2]=c[a+4>>2];c[y+8>>2]=c[a+8>>2];c[y+12>>2]=c[a+12>>2];m=a+16|0;c[z>>2]=c[m>>2];c[z+4>>2]=c[m+4>>2];c[z+8>>2]=c[m+8>>2];c[z+12>>2]=c[m+12>>2];m=2;}else {c[y>>2]=c[r>>2];c[y+4>>2]=c[r+4>>2];c[y+8>>2]=c[r+8>>2];c[y+12>>2]=c[r+12>>2];c[z>>2]=c[a>>2];c[z+4>>2]=c[a+4>>2];c[z+8>>2]=c[a+8>>2];c[z+12>>2]=c[a+12>>2];m=1;}j=+h[y>>3]+q;h[y>>3]=j;k=+h[t>>3]+p;h[t>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[y>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[t>>3]=j;j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);while(1){if((m|0)>=(b|0))break;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];g=a+(m<<4)|0;c[z>>2]=c[g>>2];c[z+4>>2]=c[g+4>>2];c[z+8>>2]=c[g+8>>2];c[z+12>>2]=c[g+12>>2];j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);m=m+1|0;}if(e|0){c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[z>>2]=c[s>>2];c[z+4>>2]=c[s+4>>2];c[z+8>>2]=c[s+8>>2];c[z+12>>2]=c[s+12>>2];j=+h[z>>3]+q;h[z>>3]=j;k=+h[n>>3]+p;h[n>>3]=k;if(!(j>=0.0))j=(j+1.0)*o+-1.0;else j=j*o;h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)*o+-1.0;else j=k*o;h[n>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);}i=i+1|0;m=c[(c[u>>2]|0)+8>>2]|0;}}else v=4;while(0);if((v|0)==4){jP(n,c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0);c[z>>2]=c[n>>2];c[z+4>>2]=c[n+4>>2];c[z+8>>2]=c[n+8>>2];c[z+12>>2]=c[n+12>>2];j=+h[z>>3]+ +(e|0);h[z>>3]=j;m=z+8|0;k=+h[m>>3]+ +(f|0);h[m>>3]=k;if(!(j>=0.0))j=(j+1.0)/+(g|0)+-1.0;else j=j/+(g|0);h[z>>3]=j;if(!(k>=0.0))j=(k+1.0)/+(g|0)+-1.0;else j=k/+(g|0);h[m>>3]=j;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[x>>2]=c[z>>2];c[x+4>>2]=c[z+4>>2];c[x+8>>2]=c[z+8>>2];c[x+12>>2]=c[z+12>>2];PG(w,x,d);}l=A;return}function dH(a,b,d){a=a|0;b=b|0;d=d|0;a:do if((a|0)<1)a=0;else switch(c[d+16>>2]|0){case 4:{a=SG(a,b,d)|0;break a}case 3:{a=eH(a,b,d)|0;break a}default:{a=0;break a}}while(0);return a|0}function eH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+80|0;g=n+64|0;f=n+24|0;m=n+8|0;e=n;h=n+56|0;j=d+8|0;k=VG(a,b,c[j>>2]|0)|0;if(0);a:do if((k|0)>=1){c[h+4>>2]=0;c[h>>2]=0;i=JK(a<<4)|0;d=0;while(1){if((d|0)>=(a|0))break;c[i+(d<<4)+12>>2]=d;o=b+(d<<5)|0;e=c[j>>2]|0;c[f>>2]=c[o>>2];c[f+4>>2]=c[o+4>>2];c[f+8>>2]=c[o+8>>2];c[f+12>>2]=c[o+12>>2];c[f+16>>2]=c[o+16>>2];c[f+20>>2]=c[o+20>>2];c[f+24>>2]=c[o+24>>2];c[f+28>>2]=c[o+28>>2];c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];WG(f,i+(d<<4)|0,k,e,g,195059);d=d+1|0;}f=JK(a<<2)|0;d=0;while(1){if((d|0)>=(a|0))break;c[f+(d<<2)>>2]=i+(d<<4);d=d+1|0;}o4(f,a,4,89);g=KL()|0;d=JK(a<<3)|0;e=0;while(1){if((e|0)>=(a|0))break;o=c[f+(e<<2)>>2]|0;_G(e,o,g,d+(c[o+12>>2]<<3)|0,k,c[j>>2]|0,b);e=e+1|0;}U1(f);e=0;while(1){if((e|0)>=(a|0))break;U1(c[i+(e<<4)+4>>2]|0);e=e+1|0;}U1(i);NL(g);if(0>1);}else d=0;while(0);l=n;return d|0}function fH(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0;a:do if((a|0)<1)f=0-a|0;else {s=(e|0)==0;q=(f|0)==0;j=0;while(1){if((j|0)==(a|0)){f=0;break a}r=c[b+(j<<2)>>2]|0;g=s?r:e;k=c[d+(j<<3)>>2]|0;l=c[d+(j<<3)+4>>2]|0;m=+(k|0);n=m*.013888888888888888;o=+(l|0);p=o*.013888888888888888;i=jC(r)|0;while(1){if(!i)break;f=c[i+16>>2]|0;t=c[f+132>>2]|0;h[t>>3]=+h[t>>3]+n;t=t+8|0;h[t>>3]=+h[t>>3]+p;t=f+16|0;h[t>>3]=+h[t>>3]+m;t=f+24|0;h[t>>3]=+h[t>>3]+o;f=c[f+108>>2]|0;if(f|0){t=f+56|0;h[t>>3]=+h[t>>3]+m;t=f+64|0;h[t>>3]=+h[t>>3]+o;}b:do if(!q){f=XA(g,i)|0;while(1){if(!f)break b;gH(f,k,l);f=ZA(g,f)|0;}}while(0);i=kC(r,i)|0;}hH(r,k,l);j=j+1|0;}}while(0);return f|0}function gH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0,l=0.0,m=0,n=0;e=c[a+16>>2]|0;a=c[e+96>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+108>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+100>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}a=c[e+104>>2]|0;if(a|0){m=a+56|0;h[m>>3]=+h[m>>3]+ +(b|0);m=a+64|0;h[m>>3]=+h[m>>3]+ +(d|0);}m=c[e+8>>2]|0;a:do if(m|0){l=+(b|0);j=+(d|0);b=c[m+4>>2]|0;a=0;while(1){if((a|0)>=(b|0))break a;k=c[m>>2]|0;d=c[k+(a*48|0)>>2]|0;f=c[k+(a*48|0)+4>>2]|0;g=c[k+(a*48|0)+8>>2]|0;i=c[k+(a*48|0)+12>>2]|0;e=0;while(1){if((e|0)>=(f|0))break;n=d+(e<<4)|0;h[n>>3]=+h[n>>3]+l;n=d+(e<<4)+8|0;h[n>>3]=+h[n>>3]+j;e=e+1|0;}if(g|0){n=k+(a*48|0)+16|0;h[n>>3]=+h[n>>3]+l;n=k+(a*48|0)+24|0;h[n>>3]=+h[n>>3]+j;}if(i|0){n=k+(a*48|0)+32|0;h[n>>3]=+h[n>>3]+l;n=k+(a*48|0)+40|0;h[n>>3]=+h[n>>3]+j;}a=a+1|0;}}while(0);return}function hH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0;j=b+16|0;b=c[j>>2]|0;o=b+16|0;m=b+24|0;f=b+32|0;b=b+40|0;g=+(d|0);l=+h[f>>3]+g;i=+(e|0);n=+h[m>>3]+i;k=+h[b>>3]+i;h[o>>3]=+h[o>>3]+g;h[m>>3]=n;h[f>>3]=l;h[b>>3]=k;b=c[j>>2]|0;f=c[b+12>>2]|0;if((f|0)!=0?(a[f+81>>0]|0)!=0:0){o=f+56|0;h[o>>3]=+h[o>>3]+g;f=f+64|0;h[f>>3]=+h[f>>3]+i;f=1;}else f=1;while(1){if((f|0)>(c[b+180>>2]|0))break;hH(c[(c[b+184>>2]|0)+(f<<2)>>2]|0,d,e);f=f+1|0;b=c[j>>2]|0;}return}function iH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=QG(a,b,d,e)|0;if(!f)a=1;else {a=fH(a,b,f,d,c[e+12>>2]|0)|0;U1(f);}return a|0}function jH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+32|0;o=p;n=iH(a,b,d,e)|0;if(!n){BP(d);m=(c[d+16>>2]|0)+16|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];c[o+16>>2]=c[m+16>>2];c[o+20>>2]=c[m+20>>2];c[o+24>>2]=c[m+24>>2];c[o+28>>2]=c[m+28>>2];f=o+8|0;g=o+16|0;i=o+24|0;e=0;while(1){if((e|0)>=(a|0))break;k=c[(c[b+(e<<2)>>2]|0)+16>>2]|0;j=c[k+180>>2]|0;k=k+184|0;d=1;while(1){if((d|0)>(j|0))break;r=(c[(c[(c[k>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+16|0;h[o>>3]=+h[(+h[o>>3]<+h[r>>3]?o:r)>>3];r=c[(c[(c[k>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;q=r+16|0;h[f>>3]=+h[(+h[f>>3]<+h[r+24>>3]?o:q)+8>>3];h[g>>3]=+h[(+h[g>>3]>+h[r+32>>3]?o:q)+16>>3];h[i>>3]=+h[(+h[i>>3]>+h[r+40>>3]?o:q)+24>>3];d=d+1|0;}e=e+1|0;}c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[m+16>>2]=c[o+16>>2];c[m+20>>2]=c[o+20>>2];c[m+24>>2]=c[o+24>>2];c[m+28>>2]=c[o+28>>2];}l=p;return n|0}function kH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=l;l=l+16|0;f=g;if(!e)qa(99534,99540,1400,99547);d=lH(a,d,d)|0;c[e+8>>2]=d;if(0);c[e+12>>2]=0;c[e+20>>2]=0;mH(a,b,e)|0;l=g;return c[e+16>>2]|0}function lH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;f=i+4|0;g=QA(b,99689)|0;a:do if(g){c[h>>2]=f;h=(b5(g,137395,h)|0)==1;b=c[f>>2]|0;if(h&(b|0)>-1)d=b;else {switch(a[g>>0]|0){case 84:case 116:break;default:break a}d=e;}}while(0);l=i;return d|0}function mH(a,b,c){a=a|0;b=b|0;c=c|0;return nH(QA(a,99572)|0,b,c)|0}function nH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+64|0;r=u+40|0;q=u+32|0;t=u+24|0;s=u+16|0;m=u+8|0;k=u;i=u+48|0;j=u+44|0;if(!e)qa(99534,99540,1292,99581);o=e+28|0;c[o>>2]=0;p=e+16|0;c[p>>2]=d;n=e+4|0;c[n>>2]=0;c[e+24>>2]=0;a:do if(b|0?(f=a[b>>0]|0,f<<24>>24):0)switch(f<<24>>24|0){case 97:if(!(Q2(b,99599,5)|0)){c[p>>2]=4;m=oH(b+5|0,e)|0;c[k>>2]=j;m=(b5(m,137395,k)|0)>0;d=c[j>>2]|0;if(!(m&(d|0)>0))break a;c[n>>2]=d;break a}else {if(Q2(b,99605,6)|0)break a;c[p>>2]=5;c[m>>2]=i;m=(b5(b+5|0,99612,m)|0)>0;v=+g[i>>2];g[e>>2]=m&v>0.0?v:1.0;break a}case 99:{if(f<<24>>24!=99)break a;if(s2(b,108006)|0)break a;c[p>>2]=1;break a}case 103:{if(f<<24>>24!=103)break a;if(s2(b,111494)|0)break a;c[p>>2]=3;break a}case 110:{if(f<<24>>24!=110)break a;if(s2(b,111481)|0)break a;c[p>>2]=2;break a}default:break a}while(0);if(0);l=u;return c[p>>2]|0}function oH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;a:do if((a[b>>0]|0)==95){f=d+28|0;e=1;while(1){b=b+1|0;b:while(1){if(!e)break a;d=a[b>>0]|0;if(!(d<<24>>24))break a;switch(d<<24>>24|0){case 99:{g=10;break b}case 105:{g=9;break b}case 117:{g=11;break b}case 116:{g=12;break b}case 98:{d=32;break b}case 108:{g=7;break b}case 114:{g=8;break b}default:e=0;}}if((g|0)==7){g=0;d=4;}else if((g|0)==8){g=0;d=8;}else if((g|0)==9){g=0;d=64;}else if((g|0)==10){g=0;d=1;}else if((g|0)==11){g=0;d=2;}else if((g|0)==12){g=0;d=16;}c[f>>2]=c[f>>2]|d;}}while(0);return b|0}function pH(a){a=a|0;switch(a|0){case 1:{a=108006;break}case 2:{a=111481;break}case 3:{a=111494;break}case 4:{a=99599;break}case 5:{a=99605;break}default:a=99679;}return a|0}function qH(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+96|0;k=n;m=n+80|0;do if(a){if(!e){e=V1(1,20)|0;c[e+4>>2]=d>>>0>80?d:80;}d=c[e>>2]|0;j=c[e+4>>2]|0;if(!d){h=100;d=a;i=V1(100,j)|0;}else {h=d+100|0;i=W1(c[e+8>>2]|0,O(h,j)|0)|0;Y6(i+(O(j,d)|0)|0,0,j*100|0)|0;d=a;}while(1){d=rH(k,d,b,m)|0;if(!d)break;a=c[e>>2]|0;f=h<<1;g=O(h,j)|0;if((a|0)==(h|0)){i=W1(i,O(f,j)|0)|0;Y6(i+g|0,0,g|0)|0;a=c[e>>2]|0;}else f=h;a=i+(O(a,j)|0)|0;g=k;h=a+80|0;do{c[a>>2]=c[g>>2];a=a+4|0;g=g+4|0;}while((a|0)<(h|0));c[e>>2]=(c[e>>2]|0)+1;h=f;}if(c[m>>2]|0){m=e+16|0;c[m>>2]=c[m>>2]|1;}d=c[e>>2]|0;if(!d){U1(i);U1(e);e=0;break}else {c[e+8>>2]=W1(i,O(d,j)|0)|0;break}}while(0);l=n;return e|0}function rH(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+80|0;h=j+64|0;i=j;c[f>>2]=0;do{g=a[d>>0]|0;d=d+1|0;}while((S2(g)|0)!=0);a:do switch(g|0){case 69:{c[b>>2]=0;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e>>2];break}case 101:{c[b>>2]=1;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e>>2];break}case 80:{c[b>>2]=2;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+4>>2];break}case 112:{c[b>>2]=3;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+4>>2];break}case 98:{c[b>>2]=4;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+8>>2];break}case 66:{c[b>>2]=5;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+8>>2];break}case 99:{d=uH(d,h)|0;if(!d){c[f>>2]=1;d=0;break a}g=vH(c[h>>2]|0,i)|0;c[h>>2]=g;if(!g){c[f>>2]=1;d=0;break a}if(!(c[i>>2]|0)){c[b>>2]=9;c[b+8>>2]=c[i+8>>2];if(!e)break a;c[b+72>>2]=c[e+24>>2];break a}else {c[b>>2]=14;f=b+8|0;g=i;h=f+64|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));if(!e)break a;c[b+72>>2]=c[e+40>>2];break a}}case 67:{d=uH(d,h)|0;if(!d){c[f>>2]=1;d=0;break a}g=vH(c[h>>2]|0,i)|0;c[h>>2]=g;if(!g){c[f>>2]=1;d=0;break a}if(!(c[i>>2]|0)){c[b>>2]=8;c[b+8>>2]=c[i+8>>2];if(!e)break a;c[b+72>>2]=c[e+20>>2];break a}else {c[b>>2]=13;f=b+8|0;g=i;h=f+64|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(h|0));if(!e)break a;c[b+72>>2]=c[e+40>>2];break a}}case 76:{c[b>>2]=6;d=tH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+12>>2];break}case 84:{c[b>>2]=7;d=wH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=wH(d,b+16|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=xH(d,b+24|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=wH(d,b+32|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+40|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+16>>2];break}case 70:{c[b>>2]=10;d=wH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+16|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+28>>2];break}case 83:{c[b>>2]=11;d=uH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+32>>2];break}case 73:{c[b>>2]=12;d=sH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}d=uH(d,b+40|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+36>>2];break}case 116:{c[b>>2]=15;d=yH(d,b+8|0)|0;if(!d){c[f>>2]=1;d=0;break a}if(e)c[b+72>>2]=c[e+44>>2];break}case 0:{d=0;break}default:{c[f>>2]=1;d=0;}}while(0);l=j;return d|0}function sH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0;i=l;l=l+16|0;e=i;h[b>>3]=+s5(a,e);f=c[e>>2]|0;if(((f|0)!=(a|0)?(h[b+8>>3]=+s5(f,e),g=c[e>>2]|0,(f|0)!=(g|0)):0)?(h[b+16>>3]=+s5(g,e),d=c[e>>2]|0,(g|0)!=(d|0)):0){h[b+24>>3]=+s5(d,e);a=c[e>>2]|0;a=(d|0)==(a|0)?0:a;}else a=0;l=i;return a|0}function tH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+4|0;g=k;a=zH(a,j)|0;do if(a){d=c[j>>2]|0;i=V1(d,24)|0;c[b>>2]=d;e=i;f=0;while(1){if((f|0)>=(d|0)){d=9;break}h[e>>3]=+s5(a,g);d=c[g>>2]|0;if((a|0)==(d|0)){d=5;break}h[e+8>>3]=+s5(d,g);a=c[g>>2]|0;if((d|0)==(a|0)){d=7;break}h[e+16>>3]=0.0;e=e+24|0;d=c[b>>2]|0;f=f+1|0;}if((d|0)==5){c[j>>2]=f;U1(i);a=0;break}else if((d|0)==7){c[j>>2]=f;U1(i);a=0;break}else if((d|0)==9){c[j>>2]=f;c[b+4>>2]=i;break}}else a=0;while(0);l=k;return a|0}function uH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j;b=zH(b,i)|0;f=c[i>>2]|0;do if(!((b|0)==0|(f|0)<1)){while(1){h=a[b>>0]|0;e=h<<24>>24==0;if(e^h<<24>>24!=45)b=b+1|0;else break}if(!e){h=V1(f+1|0,1)|0;g=h;e=f;while(1){b=b+1|0;if((e|0)<=0){e=9;break}e=a[b>>0]|0;if(!(e<<24>>24)){e=8;break}a[g>>0]=e;e=(c[i>>2]|0)+-1|0;c[i>>2]=e;g=g+1|0;}if((e|0)==8){U1(h);b=0;break}else if((e|0)==9){a[g>>0]=0;c[d>>2]=h;break}}else b=0;}else b=0;while(0);l=j;return b|0}function vH(b,d){b=b|0;d=d|0;var e=0;e=a[b>>0]|0;switch(e|0){case 91:{b=AH(b+1|0,d)|0;break}case 40:{b=BH(b+1|0,d)|0;break}case 47:case 35:{c[d>>2]=0;c[d+8>>2]=b;break}default:if(!(a3(e)|0))b=0;else {c[d>>2]=0;c[d+8>>2]=b;}}return b|0}function wH(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0;f=l;l=l+16|0;d=f;e=+s5(a,d);d=c[d>>2]|0;if((d|0)==(a|0))d=0;else h[b>>3]=e;l=f;return d|0}function xH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;a=zH(a,e)|0;e=c[e>>2]|0;c[b>>2]=(e|0)<0?0:e|0?2:1;l=d;return a|0}function yH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[b>>2]=T2(a,e,10)|0;b=c[e>>2]|0;l=d;return ((b|0)==(a|0)?0:b)|0}function zH(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[b>>2]=y4(a,e,10)|0;b=c[e>>2]|0;l=d;return ((b|0)==(a|0)?0:b)|0}function AH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;m=o;c[b>>2]=1;n=b+8|0;i=wH(a,n)|0;do if(((((i|0)!=0?(j=wH(i,b+16|0)|0,(j|0)!=0):0)?(e=wH(j,b+24|0)|0,(e|0)!=0):0)?(f=wH(e,b+32|0)|0,(f|0)!=0):0)?(k=b+40|0,d=zH(f,k)|0,(d|0)!=0):0){b=c[k>>2]|0;f=V1(b,8)|0;e=0;while(1){if((e|0)>=(b|0)){d=13;break}d=wH(d,m)|0;if(!d){d=9;break}g[f+(e<<3)>>2]=+h[m>>3];d=uH(d,f+(e<<3)+4|0)|0;if(!d){d=12;break}e=e+1|0;b=c[k>>2]|0;}if((d|0)==9){U1(f);a=0;break}else if((d|0)==12){U1(f);a=0;break}else if((d|0)==13){c[n+36>>2]=f;break}}else a=0;while(0);l=o;return a|0}function BH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;c[b>>2]=2;k=wH(a,b+8|0)|0;do if(((((((k|0)!=0?(m=wH(k,b+16|0)|0,(m|0)!=0):0)?(e=wH(m,b+24|0)|0,(e|0)!=0):0)?(f=wH(e,b+32|0)|0,(f|0)!=0):0)?(i=wH(f,b+40|0)|0,(i|0)!=0):0)?(j=wH(i,b+48|0)|0,(j|0)!=0):0)?(o=b+56|0,d=zH(j,o)|0,(d|0)!=0):0){e=c[o>>2]|0;i=V1(e,8)|0;f=0;while(1){if((f|0)>=(e|0)){d=15;break}d=wH(d,n)|0;if(!d){d=11;break}g[i+(f<<3)>>2]=+h[n>>3];d=uH(d,i+(f<<3)+4|0)|0;if(!d){d=14;break}f=f+1|0;e=c[o>>2]|0;}if((d|0)==11){U1(i);a=0;break}else if((d|0)==14){U1(i);a=0;break}else if((d|0)==15){c[b+60>>2]=i;break}}else a=0;while(0);l=p;return a|0}function CH(a,b,c){a=a|0;b=b|0;c=c|0;return qH(a,b,c,0)|0}function DH(a){a=a|0;return CH(a,0,0)|0}function EH(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=c[a+12>>2]|0;if(a|0){f=c[a+8>>2]|0;g=a+4|0;h=(e|0)==0;b=0;while(1){if((b|0)>=(c[a>>2]|0))break;d=f+(O(c[g>>2]|0,b)|0)|0;if(!h)tb[e&127](d);FH(d);b=b+1|0;}U1(f);U1(a);}return}function FH(a){a=a|0;switch(c[a>>2]|0){case 3:case 2:{U1(c[a+8+4>>2]|0);break}case 5:case 4:{U1(c[a+8+4>>2]|0);break}case 6:{U1(c[a+8+4>>2]|0);break}case 7:{U1(c[a+40>>2]|0);break}case 9:case 8:{U1(c[a+8>>2]|0);break}case 14:case 13:{GH(a+8|0);break}case 10:{U1(c[a+16>>2]|0);break}case 11:{U1(c[a+8>>2]|0);break}case 12:{U1(c[a+40>>2]|0);break}default:{}}return}function GH(a){a=a|0;var b=0,d=0,e=0;switch(c[a>>2]|0){case 1:{e=a+40|0;b=a+8+36|0;a=0;while(1){d=c[b>>2]|0;if((a|0)>=(c[e>>2]|0))break;U1(c[d+(a<<3)+4>>2]|0);a=a+1|0;}U1(d);break}case 2:{e=a+56|0;d=a+60|0;a=0;while(1){b=c[d>>2]|0;if((a|0)>=(c[e>>2]|0))break;U1(c[b+(a<<3)+4>>2]|0);a=a+1|0;}U1(b);break}default:{}}return}function HH(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;k=o+4|0;n=o;c[d>>2]=0;c[e>>2]=(xB(xC(b)|0)|0)!=0&1;f=c[47184]|0;a:do if(f|0?(h=RA(b,f)|0,i=a[h>>0]|0,i<<24>>24):0){f=20388;while(1){g=c[f>>2]|0;if(!g)break a;if(i<<24>>24==(a[g>>0]|0)?(s2(h,g)|0)==0:0)break;f=f+12|0;}c[d>>2]=c[f+4>>2];c[e>>2]=c[f+8>>2];}while(0);f=c[47195]|0;if((f|0?(c[e>>2]|0)==1:0)?(j=RA(b,f)|0,a[j>>0]|0):0)IH(j,e);f=c[47196]|0;if((f|0?(c[d>>2]|0)==1:0)?(m=RA(b,f)|0,a[m>>0]|0):0)IH(m,d);if(a[(c[b+16>>2]|0)+153>>0]|0){j=b+-48|0;i=xC(c[((c[b>>2]&3|0)==2?b:j)+40>>2]|0)|0;m=c[b>>2]&3;HH(iB(i,c[((m|0)==2?b:j)+40>>2]|0,c[((m|0)==3?b:b+48|0)+40>>2]|0,0,0)|0,k,n);c[e>>2]=c[k>>2]|c[e>>2];c[d>>2]=c[n>>2]|c[d>>2];}l=o;return}function IH(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;m=o;k=o+4|0;j=0;e=0;a:while(1){c[d>>2]=e;g=(j|0)<4;h=(j|0)==3;i=(j|0)==0;while(1){if(!(g&(a[b>>0]|0)!=0))break a;c[k>>2]=0;f=JH(b,k)|0;e=c[k>>2]|0;if(!e){n=5;break a}b=(e|0)==8;if(!(h&b)){if(!(i&b))break;if(a[f>>0]|0)break}c[k>>2]=0;b=f;}e=c[d>>2]|e<<(j<<3);j=j+1|0;b=f;}if((n|0)==5){c[m>>2]=b;gA(0,99694,m)|0;}l=o;return}function JH(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;c[e>>2]=0;d=KH(a,20448,e)|0;if((d|0)==(a|0)){while(1){d=KH(a,20464,e)|0;if((a|0)==(d|0))break;else a=d;}d=KH(a,20512,e)|0;}a=c[e>>2]|0;if((a|0)!=0&(a&15|0)==0){a=a|1;c[e>>2]=a;}c[b>>2]=c[b>>2]|a;l=f;return d|0}function KH(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;while(1){e=c[b>>2]|0;if(!e)break;f=l2(e)|0;if(!(Q2(a,e,f)|0)){g=4;break}b=b+8|0;}if((g|0)==4){c[d>>2]=c[d>>2]|c[b+4>>2];a=a+f|0;}return a|0}function LH(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0;g=0;d=0.0;while(1){if((g|0)==4)break;f=b>>(g<<3)&15;e=1400;while(1){if(!(c[e+16>>2]|0))break;if((f|0)==(c[e>>2]|0)){i=6;break}e=e+24|0;}if((i|0)==6){i=0;d=+h[e+8>>3]+d;}g=g+1|0;}return +(d*10.0*+_O(a,c[47188]|0,1.0,0.0))}function MH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0,n=0.0,o=0,p=0;p=l;l=l+96|0;m=p+80|0;o=p;k=f>4.0?f*.0875:.35;i=+h[d+8>>3];n=i*k;j=+h[d>>3];k=j*k;e=+h[b>>3];j=e+j;h[m>>3]=j;f=+h[b+8>>3];i=i+f;h[m+8>>3]=i;d=o+64|0;if(!(g&32)){c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];m=o+32|0;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];f=i;e=j;}else {c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];b=o+32|0;c[b>>2]=c[m>>2];c[b+4>>2]=c[m+4>>2];c[b+8>>2]=c[m+8>>2];c[b+12>>2]=c[m+12>>2];}h[o+16>>3]=e+n;h[o+24>>3]=f-k;h[o+48>>3]=e-n;h[o+56>>3]=f+k;do if(!(g&64))if(!(g&128)){nS(a,o+16|0,3,g>>>4&1^1);break}else {nS(a,o+32|0,3,g>>>4&1^1);break}else nS(a,o,3,g>>>4&1^1);while(0);l=p;return}function NH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0;x=l;l=l+160|0;n=x+144|0;w=x;q=e*4.0;y=(g&32|0)==0;q=!(q1.0)|y?0.0:(f+-1.0)*.05/e;u=+h[d+8>>3];r=-u;v=q*r;t=+h[d>>3];q=t*q;r=s*r;s=t*s;p=+h[b>>3];e=p+t;h[n>>3]=e;o=+h[b+8>>3];f=u+o;h[n+8>>3]=f;t=t*.5+p;u=u*.5+o;d=w+128|0;if(y){c[d>>2]=c[n>>2];c[d+4>>2]=c[n+4>>2];c[d+8>>2]=c[n+8>>2];c[d+12>>2]=c[n+12>>2];c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];y=w+64|0;c[y>>2]=c[b>>2];c[y+4>>2]=c[b+4>>2];c[y+8>>2]=c[b+8>>2];c[y+12>>2]=c[b+12>>2];i=o;j=p;k=o;m=p;f=o;e=p;}else {c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[w>>2]=c[b>>2];c[w+4>>2]=c[b+4>>2];c[w+8>>2]=c[b+8>>2];c[w+12>>2]=c[b+12>>2];y=w+64|0;c[y>>2]=c[n>>2];c[y+4>>2]=c[n+4>>2];c[y+8>>2]=c[n+8>>2];c[y+12>>2]=c[n+12>>2];i=f+s;j=e+r;k=f-s;m=e-r;}h[w+16>>3]=e-v;h[w+24>>3]=f-q;h[w+32>>3]=t-r;h[w+40>>3]=u-s;h[w+48>>3]=m;h[w+56>>3]=k;h[w+80>>3]=j;h[w+88>>3]=i;h[w+96>>3]=t+r;h[w+104>>3]=u+s;h[w+112>>3]=e+v;h[w+120>>3]=f+q;do if(!(g&64))if(!(g&128)){nS(a,w,9,1);break}else {nS(a,w+48|0,6,1);break}else nS(a,w,6,1);while(0);l=x;return}function OH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0;q=l;l=l+64|0;p=q;t=+h[d+8>>3];s=+h[d>>3];k=+h[b>>3];e=k+s;m=+h[b+8>>3];f=m+t;i=k+s*.2;j=m+t*.2;k=k+s*.6;m=m+t*.6;h[p>>3]=i-t;h[p+8>>3]=j+s;n=p+16|0;h[n>>3]=i+t;o=p+24|0;h[o>>3]=j-s;h[p+32>>3]=k+t;h[p+40>>3]=m-s;h[p+48>>3]=k-t;h[p+56>>3]=m+s;if(!(g&64)){if(g&128|0){d=2;g=1;r=3;}}else {d=3;g=0;r=3;}if((r|0)==3){h[p+(g<<4)>>3]=i;h[p+(g<<4)+8>>3]=j;h[p+(d<<4)>>3]=k;h[p+(d<<4)+8>>3]=m;}nS(a,p,4,1);c[p>>2]=c[b>>2];c[p+4>>2]=c[b+4>>2];c[p+8>>2]=c[b+8>>2];c[p+12>>2]=c[b+12>>2];h[n>>3]=e;h[o>>3]=f;qS(a,p,2);l=q;return}function PH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0;o=l;l=l+64|0;n=o;j=+h[d+8>>3];r=j*-.4;i=+h[d>>3];q=i*.4;t=+h[b>>3];e=t+i*.8;s=+h[b+8>>3];f=s+j*.8;i=t+i;j=s+j;h[n>>3]=t+r;k=n+8|0;h[k>>3]=s+q;d=n+16|0;h[d>>3]=t-r;m=n+24|0;h[m>>3]=s-q;h[n+32>>3]=e-r;h[n+40>>3]=f-q;h[n+48>>3]=e+r;h[n+56>>3]=f+q;if(!(g&64)){if(g&128|0){c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];d=2;p=5;}}else {c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];d=3;p=5;}if((p|0)==5){h[n+(d<<4)>>3]=e;h[n+(d<<4)+8>>3]=f;}nS(a,n,4,g>>>4&1^1);h[n>>3]=e;h[k>>3]=f;h[n+16>>3]=i;h[m>>3]=j;qS(a,n,2);l=o;return}function QH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;j=l;l=l+80|0;i=j;n=+h[d+8>>3];k=n*-.3333333333333333;p=+h[d>>3];f=p*.3333333333333333;q=+h[b>>3];m=q+p*.5;o=+h[b+8>>3];e=o+n*.5;d=i+64|0;h[i+64>>3]=q+p;h[i+72>>3]=o+n;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];h[i+16>>3]=m+k;h[i+24>>3]=e+f;d=i+32|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];h[i+48>>3]=m-k;h[i+56>>3]=e-f;do if(!(g&64)){d=g>>>4&1^1;if(!(g&128)){nS(a,i,4,d);break}else {nS(a,i,3,d);break}}else nS(a,d,3,g>>>4&1^1);while(0);l=j;return}function RH(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=+e;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0.0;g=l;l=l+32|0;i=g;k=+h[c>>3];e=+h[c+8>>3];d=+C(+(e*e+k*k))*.5;m=+h[b>>3];k=k*.5;h[i>>3]=m+k-d;j=+h[b+8>>3];e=e*.5;h[i+8>>3]=j-d+e;h[i+16>>3]=m+d+k;h[i+24>>3]=j+d+e;mS(a,i,2,f>>>4&1^1);l=g;return}function SH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0;t=l;l=l+112|0;q=t+48|0;r=t+16|0;s=t;n=f>4.0?f*.125:.5;p=+h[b>>3];o=+h[d>>3];i=+h[b+8>>3];m=+h[d+8>>3];e=m*n;f=o*n;c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];h[r+16>>3]=o+p;h[r+24>>3]=m+i;h[q>>3]=n*(o-m)+p;j=n*(m+o);k=j+i;h[q+8>>3]=k;h[q+48>>3]=j+p;i=n*(m-o)+i;h[q+56>>3]=i;o=e*-.95;m=o+f+p;n=f*1.3333333333333333;if(!(g&32)){e=e*1.3333333333333333;j=f*-.33333333333333326;i=i-e;f=k-e;e=m-n;}else {e=e*1.3333333333333333;j=f*2.333333333333333;i=i+e;f=k+e;e=m+n;}h[q+16>>3]=e;h[q+24>>3]=f;h[q+32>>3]=j-o+p;h[q+40>>3]=i;qS(a,r,2);if(!(g&64)){if(g&128|0)kP(s,q,3,.5,q,0);}else kP(s,q,3,.5,0,q);pS(a,q,4,0,0,0);l=t;return}function TH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0;g=l;l=l+32|0;i=g;e=+h[d>>3]+ +h[b>>3];f=+h[d+8>>3]+ +h[b+8>>3];c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];h[i+16>>3]=e;h[i+24>>3]=f;qS(a,i,2);l=g;return}function UH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;n=l;l=l+80|0;j=n+72|0;k=n+8|0;m=n;i=+LH(a,g);i=i*i;h[m>>3]=i;c[f+12>>2]=g;g=f+32|0;a=e+3|0;f=b+(a<<4)|0;c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];if((e|0)>(d|0)?(o=+h[b+(e<<4)>>3]-+h[f>>3],p=+h[b+(e<<4)+8>>3]-+h[b+(a<<4)+8>>3],p*p+o*o>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];q=k+32|0;a=b+(e+1<<4)|0;c[q>>2]=c[a>>2];c[q+4>>2]=c[a+4>>2];c[q+8>>2]=c[a+8>>2];c[q+12>>2]=c[a+12>>2];f=k+16|0;d=b+(e+2<<4)|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];c[k>>2]=c[g>>2];c[k+4>>2]=c[g+4>>2];c[k+8>>2]=c[g+8>>2];c[k+12>>2]=c[g+12>>2];c[j>>2]=k;c[j+4>>2]=m;$N(j,92,k,1);c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];c[a>>2]=c[q>>2];c[a+4>>2]=c[q+4>>2];c[a+8>>2]=c[q+8>>2];c[a+12>>2]=c[q+12>>2];c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];m=b+(e+3<<4)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];l=n;return e|0}function VH(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[a>>2]|0;d=+h[b>>3]-+h[f>>3];e=+h[b+8>>3]-+h[f+8>>3];return e*e+d*d<=+h[c[a+4>>2]>>3]|0}function WH(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0;o=l;l=l+80|0;k=o+72|0;m=o+8|0;n=o;j=+LH(a,g);j=j*j;h[n>>3]=j;c[f+8>>2]=g;f=f+16|0;a=b+(d<<4)|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];if(!((e|0)>(d|0)?(i=d+3|0,p=+h[a>>3]-+h[b+(i<<4)>>3],q=+h[b+(d<<4)+8>>3]-+h[b+(i<<4)+8>>3],q*q+p*p>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];g=m+16|0;d=b+(i+2<<4)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];r=m+32|0;a=b+(i+1<<4)|0;c[r>>2]=c[a>>2];c[r+4>>2]=c[a+4>>2];c[r+8>>2]=c[a+8>>2];c[r+12>>2]=c[a+12>>2];s=m+48|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];c[k>>2]=s;c[k+4>>2]=n;$N(k,92,m,0);n=b+(i<<4)|0;c[n>>2]=c[s>>2];c[n+4>>2]=c[s+4>>2];c[n+8>>2]=c[s+8>>2];c[n+12>>2]=c[s+12>>2];c[a>>2]=c[r>>2];c[a+4>>2]=c[r+4>>2];c[a+8>>2]=c[r+8>>2];c[a+12>>2]=c[r+12>>2];c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[e>>2]=c[m>>2];c[e+4>>2]=c[m+4>>2];c[e+8>>2]=c[m+8>>2];c[e+12>>2]=c[m+12>>2];l=o;return i|0}function XH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0,v=0,w=0;u=(g|0)!=0;l=(i|0)!=0;if(!((e|0)==(d|0)&(u&l))){if(l){j=+LH(a,i);k=+h[b+(e<<4)>>3];p=+h[b+(e<<4)+8>>3];l=e+3|0;r=b+(l<<4)|0;n=+h[r>>3];l=b+(l<<4)+8|0;o=+h[l>>3];t=k-n;s=p-o;t=+C(+(s*s+t*t))*.9;j=j>=t?t:j;if(p==o){m=(k>3]=k;h[b+(w<<4)+8>>3]=p;e=b+(e+2<<4)|0;h[r>>3]=m;h[l>>3]=j;c[e>>2]=c[r>>2];c[e+4>>2]=c[r+4>>2];c[e+8>>2]=c[r+8>>2];c[e+12>>2]=c[r+12>>2];c[f+12>>2]=i;h[f+32>>3]=n;h[f+40>>3]=o;}if(u){m=+LH(a,g);l=b+(d<<4)|0;k=+h[l>>3];j=+h[b+(d<<4)+8>>3];w=d+3|0;o=+h[b+(w<<4)>>3];p=+h[b+(w<<4)+8>>3];t=k-o;s=j-p;t=+C(+(s*s+t*t))*.9;m=m>=t?t:m;if(j==p){n=(k>3]=n;h[b+(w<<4)+8>>3]=m;c[l>>2]=c[v>>2];c[l+4>>2]=c[v+4>>2];c[l+8>>2]=c[v+8>>2];c[l+12>>2]=c[v+12>>2];v=d+2|0;h[b+(v<<4)>>3]=o;h[b+(v<<4)+8>>3]=p;v=16;}}else {r=b+(e<<4)|0;s=+h[r>>3];t=+h[b+(e<<4)+8>>3];l=e+3|0;u=b+(l<<4)|0;k=+h[u>>3];l=b+(l<<4)+8|0;j=+h[l>>3];m=+LH(a,g);q=+LH(a,i);n=s-k;p=t-j;n=+C(+(p*p+n*n));w=!(q+m>=n);n=n*.3333333333333333;m=w?m:n;n=w?q:n;if(t==j){w=s>3]=q;h[b+(w<<4)+8>>3]=o;c[r>>2]=c[v>>2];c[r+4>>2]=c[v+4>>2];c[r+8>>2]=c[v+8>>2];c[r+12>>2]=c[v+12>>2];v=b+(e+2<<4)|0;h[u>>3]=p;h[l>>3]=m;c[v>>2]=c[u>>2];c[v+4>>2]=c[u+4>>2];c[v+8>>2]=c[u+8>>2];c[v+12>>2]=c[u+12>>2];c[f+12>>2]=i;h[f+32>>3]=s;h[f+40>>3]=t;v=16;}if((v|0)==16){c[f+8>>2]=g;h[f+16>>3]=k;h[f+24>>3]=j;}return}function YH(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0;n=+h[b>>3];k=+h[c>>3]-n;o=+h[b+8>>3];l=+h[c+8>>3]-o;j=d*10.0/(+C(+(k*k+l*l))+.0001);k=j*((k>=0.0?.0001:-.0001)+k);j=((l>=0.0?.0001:-.0001)+l)*j;l=k*.5;m=j*.5;i=n-m;f=o-l;n=m+n;l=o+l;o=i+k;m=f+j;k=n+k;j=l+j;g=o>k?o:k;g=n>g?n:g;d=m>j?m:j;d=l>d?l:d;k=o>3]=i>3]=f>3]=i>g?i:g;h[a+24>>3]=f>d?f:d;return}function ZH(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0;q=l;l=l+48|0;m=q+32|0;k=q+16|0;p=q;n=(c[a+16>>2]|0)+12|0;o=c[n>>2]|0;c[n>>2]=b;lS(a,c[(c[a>>2]|0)+336>>2]|0);uS(a,g);t=+h[e>>3]-+h[d>>3];b=e+8|0;s=+h[b>>3]-+h[d+8>>3];r=10.0/(+C(+(t*t+s*s))+.0001);h[e>>3]=r*((t>=0.0?.0001:-.0001)+t);h[b>>3]=((s>=0.0?.0001:-.0001)+s)*r;b=0;while(1){if((b|0)>=4)break;j=i>>(b<<3)&255;if(!j)break;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];_H(p,a,k,m,f,g,j);c[d>>2]=c[p>>2];c[d+4>>2]=c[p+4>>2];c[d+8>>2]=c[p+8>>2];c[d+12>>2]=c[p+12>>2];b=b+1|0;}c[n>>2]=o;l=q;return}function _H(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+32|0;m=q+16|0;k=q;n=i&15;j=1400;while(1){o=c[j>>2]|0;if(!o)break;if((n|0)==(o|0)){p=4;break}j=j+24|0;}if((p|0)==4){r=+h[j+8>>3]*f;h[e>>3]=r*+h[e>>3];o=e+8|0;h[o>>3]=r*+h[o>>3];p=c[j+16>>2]|0;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[m>>2]=c[e>>2];c[m+4>>2]=c[e+4>>2];c[m+8>>2]=c[e+8>>2];c[m+12>>2]=c[e+12>>2];wb[p&15](b,k,m,f,g,i);h[d>>3]=+h[e>>3]+ +h[d>>3];p=d+8|0;h[p>>3]=+h[o>>3]+ +h[p>>3];};c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];l=q;return}function $H(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i+8|0;f=i;d=QA(b,99796)|0;if((d|0)!=0?(a[d>>0]|0)!=0:0){e=d;h=5;}else {d=QA(b,99808)|0;if((d|0)!=0?(a[d>>0]|0)!=0:0){e=d;h=5;}else d=0;}if((h|0)==5){d=CH(e,0,120)|0;if(!d){c[f>>2]=KB(b)|0;gA(0,99815,f)|0;c[g>>2]=e;gA(3,99868,g)|0;}}l=i;return d|0}function aI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+16|0;f=JK(304)|0;if(!f)gA(1,99876,g)|0;e=a+16|0;a=c[e>>2]|0;c[f>>2]=a;c[e>>2]=f;if(!a){c[f+144>>2]=3;c[f+148>>2]=0;h[f+152>>3]=1.0;}else {b=f+16|0;d=a+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));b=f+56|0;d=a+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));c[f+144>>2]=c[a+144>>2];c[f+148>>2]=c[a+148>>2];h[f+152>>3]=+h[a+152>>3];c[f+136>>2]=c[a+136>>2];b=f+96|0;d=a+96|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0))}l=g;return f|0}function bI(a){a=a|0;var b=0;a=a+16|0;b=c[a>>2]|0;if(!b)qa(99902,99906,117,99913);else {U1(c[b+212>>2]|0);U1(c[b+208>>2]|0);U1(c[b+216>>2]|0);U1(c[b+220>>2]|0);U1(c[b+224>>2]|0);U1(c[b+228>>2]|0);U1(c[b+232>>2]|0);U1(c[b+236>>2]|0);U1(c[b+240>>2]|0);U1(c[b+244>>2]|0);U1(c[b+248>>2]|0);U1(c[b+252>>2]|0);U1(c[b+256>>2]|0);U1(c[b+272>>2]|0);U1(c[b+284>>2]|0);U1(c[b+280>>2]|0);c[a>>2]=c[b>>2];U1(b);return}}function cI(d,e,f,g,h,i,j){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;l=c[d+16>>2]|0;k=c[d+152>>2]|0;if((e|0)!=0&(k&32768|0)!=0)c[l+192>>2]=e;if(((k&65536|0)!=0?(c[l+212>>2]=EK(i,j)|0,(f|0)!=0):0)?(a[f>>0]|0)!=0:0){c[l+208>>2]=EK(f,j)|0;d=1;}else d=0;do if(k&4194304){if(g|0?a[g>>0]|0:0){c[l+228>>2]=EK(g,j)|0;d=l+260|0;b[d>>1]=b[d>>1]|1;d=1;break}e=c[l+192>>2]|0;if(e){c[l+228>>2]=D4(e)|0;d=1;}}while(0);if((h|0)!=0&(k&8388608|0)!=0?(a[h>>0]|0)!=0:0){c[l+244>>2]=EK(h,j)|0;d=1;}return d|0}function dI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+80|0;i=j;h=j+8|0;g=c[(c[b>>2]|0)+168>>2]|0;f=c[(c[(c[g+16>>2]|0)+8>>2]|0)+92>>2]|0;eI(b,e);b=QA(d,141060)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0){nA(e,b)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}a[b>>0]=0;b=c[e>>2]|0;c[f>>2]=b;}else {if((g|0)!=(d|0)&(f|0)!=0){nA(e,f)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}c[f>>2]=b+1;a[b>>0]=95;}switch(IC(d)|0){case 0:{f=(g|0)==(d|0)?111494:99927;b=(c[d>>2]|0)>>>4;break}case 1:{f=111481;b=(c[d>>2]|0)>>>4;break}case 2:{f=111450;b=(c[d>>2]|0)>>>4;break}default:{f=0;b=0;}}nA(e,f)|0;c[i>>2]=b;m4(h,99933,i)|0;nA(e,h)|0;f=e+4|0;b=c[f>>2]|0;if(b>>>0>=(c[e+8>>2]|0)>>>0){lA(e,1)|0;b=c[f>>2]|0;}a[b>>0]=0;b=c[e>>2]|0;c[f>>2]=b;}l=j;return b|0}function eI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+144|0;h=i;g=i+8|0;e=c[b+160>>2]|0;if((e|0)>1?c[b+152>>2]&64|0:0){nA(d,c[(c[(c[b>>2]|0)+308>>2]|0)+(e<<2)>>2]|0)|0;f=d+4|0;e=c[f>>2]|0;if(e>>>0>=(c[d+8>>2]|0)>>>0){lA(d,1)|0;e=c[f>>2]|0;}c[f>>2]=e+1;a[e>>0]=95;}f=c[b+196>>2]|0;e=c[b+200>>2]|0;if((f|0)>0|(e|0)>0){c[h>>2]=f;c[h+4>>2]=e;m4(g,99937,h)|0;nA(d,g)|0;}l=i;return}function fI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,i=0.0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0;s=l;l=l+48|0;p=s+16|0;f=s+32|0;q=s;r=+h[(c[a+16>>2]|0)+152>>3];o=gI(d,0,f)|0;if((o+-1|0)>>>0>=2){e=+h[b+16>>3];k=(e+ +h[b>>3])*.5;h[q>>3]=k;i=+h[b+24>>3];m=(i+ +h[b+8>>3])*.5;h[q+8>>3]=m;k=e-k;m=i-m;n=r>.5;if(n)uS(a,.5);j=c[f>>2]|0;i=0.0;f=c[j+8>>2]|0;while(1){d=c[f>>2]|0;if(!d)break;b=f+4|0;if(+g[b>>2]==0.0)e=i;else {jS(a,d);if(!(c[f+12>>2]|0))e=6.283185307179586;else e=+g[b>>2]*6.283185307179586+i;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];b=IT(p,k,m,i,e)|0;pS(a,c[b>>2]|0,c[b+4>>2]|0,0,0,1);EY(b);}i=e;f=f+12|0;}if(n)uS(a,r);hI(j);}l=s;return o|0}function gI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;o=r+8|0;n=r;q=JK(12)|0;i=D4(b)|0;a:do if(!d){d=1;f=i;while(1){switch(a[f>>0]|0){case 0:break a;case 58:{d=d+1|0;break}default:{}}f=f+1|0;}}while(0);c[q+4>>2]=i;p=JK((d*12|0)+12|0)|0;c[q+8>>2]=p;m=1.0;h=0;d=0;f=i;while(1){f=A4(f,107984)|0;if(!f){f=20;break}j=+iI(f);if(!(j>=0.0)){f=17;break}k=j-m;if(k>0.0)if((c[5156]|0)!=0?!(k<1.0e-05&k>-1.0e-05):0){c[n>>2]=b;gA(0,99948,n)|0;c[5156]=0;j=m;d=3;}else j=m;k=m-j;if(j>0.0)a[p+(h*12|0)+8>>0]=1;if(a[f>>0]|0)c[p+(h*12|0)>>2]=f;f=h+1|0;g[p+(h*12|0)+4>>2]=j;if(k<1.0e-05&k>-1.0e-05){h=f;f=30;break}else {m=k;h=f;f=0;}}b:do if((f|0)==17){if(!(c[5156]|0))d=1;else {c[o>>2]=b;gA(1,99983,o)|0;c[5156]=0;d=2;}hI(q);}else if((f|0)==20)if(m>0.0){f=0;i=0;while(1){if((f|0)>=(h|0))break;o=i+(+g[p+(f*12|0)+4>>2]==0.0&1)|0;f=f+1|0;i=o;}if((i|0)<=0){f=p+((h+-1|0)*12|0)+4|0;g[f>>2]=m+ +g[f>>2];f=30;break}j=m/+(i|0);f=0;while(1){if((f|0)>=(h|0)){f=30;break b}i=p+(f*12|0)+4|0;if(+g[i>>2]==0.0)g[i>>2]=j;f=f+1|0;}}else f=30;while(0);if((f|0)==30){while(1){f=h+-1|0;if((h|0)<=0)break;if(+g[p+(f*12|0)+4>>2]>0.0)break;else h=f;}c[p+(h*12|0)>>2]=0;c[q>>2]=h;c[e>>2]=q;}l=r;return d|0}function hI(a){a=a|0;U1(c[a+4>>2]|0);U1(c[a+8>>2]|0);U1(a);return}function iI(b){b=b|0;var d=0.0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;b=R2(b,59)|0;if(!b)d=0.0;else {g=b+1|0;a[b>>0]=0;d=+s5(g,e);d=(d>=0.0?(c[e>>2]|0)!=(g|0):0)?d:-1.0;}l=f;return +d}function jI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0;t=l;l=l+80|0;i=t+64|0;r=t;s=+h[(c[a+16>>2]|0)+152>>3];q=gI(d,0,i)|0;if((q+-1|0)>>>0>=2){if(!e){c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];p=r+16|0;o=b+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+32|0;o=b+32|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+48|0;o=b+48|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];}else {p=b+32|0;c[r>>2]=c[p>>2];c[r+4>>2]=c[p+4>>2];c[r+8>>2]=c[p+8>>2];c[r+12>>2]=c[p+12>>2];p=r+16|0;o=b+48|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];p=r+32|0;c[p>>2]=c[b>>2];c[p+4>>2]=c[b+4>>2];c[p+8>>2]=c[b+8>>2];c[p+12>>2]=c[b+12>>2];p=r+48|0;o=b+16|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];}k=r+16|0;m=+h[k>>3];f=+h[r>>3];n=m-f;o=r+32|0;h[o>>3]=f;h[k>>3]=f;p=s>.5;if(p)uS(a,.5);i=c[i>>2]|0;j=r+48|0;e=c[i+8>>2]|0;while(1){d=c[e>>2]|0;if(!d)break;b=e+4|0;if(!(+g[b>>2]==0.0)){jS(a,d);if(!(c[e+12>>2]|0))f=m;else f=n*+g[b>>2]+ +h[r>>3];h[o>>3]=f;h[k>>3]=f;nS(a,r,4,1);f=+h[k>>3];h[j>>3]=f;h[r>>3]=f;}e=e+12|0;}if(p)uS(a,s);hI(i);}l=t;return q|0}function kI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;g=f>>>16^2;c[d+264>>2]=g;h=d+268|0;c[h>>2]=g+2;g=d+272|0;U1(c[g>>2]|0);d=JK(c[h>>2]<<4)|0;c[g>>2]=d;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];g=d+16|0;b=b+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function lI(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0;q=l;l=l+144|0;c=q+80|0;e=q+16|0;f=q;k=+h[b>>3];o=a+16|0;m=+h[o>>3];if(!(((((((((!(k>m)?(n=+h[a>>3],!(k>3],i=+h[a+24>>3],!(d>i)):0)?(j=+h[a+8>>3],!(d>3],!(k>m|k>3],!(k>i|k>3],!(k>m|k>3],!(k>i|k>3],!(k>m|k>3],!(n>i|n>3];if(!(d>+h[o>>3])){if(d<+h[a>>3]){c=a;p=16;}}else {c=o;p=16;}if((p|0)==16){p=0;h[c>>3]=d;}d=+h[b+(e<<4)+8>>3];if(!(d>+h[f>>3])){if(d<+h[g>>3]){c=a;p=19;}}else {c=o;p=19;}if((p|0)==19){p=0;h[c+8>>3]=d;}e=e+1|0;}}while(0);l=q;return}function mI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,h=0,i=0;b=l;l=l+48|0;d=b+32|0;e=b+16|0;f=b;i=a+48|0;h=a+16|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];c[d>>2]=c[h>>2];c[d+4>>2]=c[h+4>>2];c[d+8>>2]=c[h+8>>2];c[d+12>>2]=c[h+12>>2];g=+oK(f,e,d);h=a+32|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];c[d>>2]=c[h>>2];c[d+4>>2]=c[h+4>>2];c[d+8>>2]=c[h+8>>2];c[d+12>>2]=c[h+12>>2];a=g<4.0&+oK(f,e,d)<4.0&1;l=b;return a|0}function nI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0;D=l;l=l+272|0;u=D+256|0;v=D+224|0;w=D+192|0;x=D+128|0;y=D+64|0;z=D;A=D+160|0;B=D+96|0;C=D+32|0;t=c[d+16>>2]|0;s=c[t+144>>2]|0;r=t+16|0;c[x>>2]=c[r>>2];c[x+4>>2]=c[r+4>>2];c[x+8>>2]=c[r+8>>2];c[x+12>>2]=c[r+12>>2];c[x+16>>2]=c[r+16>>2];c[x+20>>2]=c[r+20>>2];c[x+24>>2]=c[r+24>>2];c[x+28>>2]=c[r+28>>2];t=c[(c[t+8>>2]|0)+88>>2]|0;c[z>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;c[z+12>>2]=0;c[z+16>>2]=0;c[z+20>>2]=0;c[z+24>>2]=0;c[z+28>>2]=0;if(!t){c[b>>2]=c[x>>2];c[b+4>>2]=c[x+4>>2];c[b+8>>2]=c[x+8>>2];c[b+12>>2]=c[x+12>>2];c[b+16>>2]=c[x+16>>2];c[b+20>>2]=c[x+20>>2];c[b+24>>2]=c[x+24>>2];c[b+28>>2]=c[x+28>>2];}else {d=x+16|0;if(+h[x>>3]==+h[d>>3]?(e=x+8|0,f=x+24|0,+h[e>>3]==+h[f>>3]):0){h[e>>3]=1797693134862315708145274.0e284;h[x>>3]=1797693134862315708145274.0e284;h[f>>3]=-1797693134862315708145274.0e284;h[d>>3]=-1797693134862315708145274.0e284;}j=v+8|0;k=v+16|0;m=v+24|0;n=y+16|0;o=y+24|0;p=s+144|0;q=w+16|0;r=t+12|0;d=0;f=c[t+8>>2]|0;e=0;g=0.0;i=0;while(1){if((i|0)>=(c[t>>2]|0))break;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[y+16>>2]=c[z+16>>2];c[y+20>>2]=c[z+20>>2];c[y+24>>2]=c[z+24>>2];c[y+28>>2]=c[z+28>>2];switch(c[f>>2]|0){case 1:case 0:{H=+h[f+8>>3];I=+h[f+24>>3];h[v>>3]=H-I;F=+h[f+16>>3];G=+h[f+32>>3];h[j>>3]=F-G;h[k>>3]=I+H;h[m>>3]=G+F;E=f+80|0;c[E>>2]=c[v>>2];c[E+4>>2]=c[v+4>>2];c[E+8>>2]=c[v+8>>2];c[E+12>>2]=c[v+12>>2];E=f+96|0;c[E>>2]=c[k>>2];c[E+4>>2]=c[k+4>>2];c[E+8>>2]=c[k+8>>2];c[E+12>>2]=c[k+12>>2];c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];oI(x,u);c[u>>2]=c[k>>2];c[u+4>>2]=c[k+4>>2];c[u+8>>2]=c[k+8>>2];c[u+12>>2]=c[k+12>>2];oI(x,u);break}case 3:case 2:{E=f+80|0;J=f+8|0;pI(A,c[J+4>>2]|0,c[J>>2]|0,x);c[E>>2]=c[A>>2];c[E+4>>2]=c[A+4>>2];c[E+8>>2]=c[A+8>>2];c[E+12>>2]=c[A+12>>2];c[E+16>>2]=c[A+16>>2];c[E+20>>2]=c[A+20>>2];c[E+24>>2]=c[A+24>>2];c[E+28>>2]=c[A+28>>2];break}case 5:case 4:{J=f+80|0;E=f+8|0;pI(B,c[E+4>>2]|0,c[E>>2]|0,x);c[J>>2]=c[B>>2];c[J+4>>2]=c[B+4>>2];c[J+8>>2]=c[B+8>>2];c[J+12>>2]=c[B+12>>2];c[J+16>>2]=c[B+16>>2];c[J+20>>2]=c[B+20>>2];c[J+24>>2]=c[B+24>>2];c[J+28>>2]=c[B+28>>2];break}case 6:{J=f+80|0;E=f+8|0;pI(C,c[E+4>>2]|0,c[E>>2]|0,x);c[J>>2]=c[C>>2];c[J+4>>2]=c[C+4>>2];c[J+8>>2]=c[C+8>>2];c[J+12>>2]=c[C+12>>2];c[J+16>>2]=c[C+16>>2];c[J+20>>2]=c[C+20>>2];c[J+24>>2]=c[C+24>>2];c[J+28>>2]=c[C+28>>2];break}case 7:{J=f+112|0;c[J>>2]=JK(56)|0;E=D4(c[f+40>>2]|0)|0;K=c[J>>2]|0;c[K>>2]=E;a[K+48>>0]=a[100029+(c[f+24>>2]|0)>>0]|0;c[y>>2]=e;h[n>>3]=g;c[o>>2]=c[o>>2]&-128|d&127;K=c[p>>2]|0;K=nb[c[K>>2]&63](K,y,1)|0;E=c[J>>2]|0;c[E+4>>2]=K;LO(u,s,E);qI(w,+h[f+8>>3],+h[f+16>>3],c[J>>2]|0);J=f+80|0;c[J>>2]=c[w>>2];c[J+4>>2]=c[w+4>>2];c[J+8>>2]=c[w+8>>2];c[J+12>>2]=c[w+12>>2];c[J+16>>2]=c[w+16>>2];c[J+20>>2]=c[w+20>>2];c[J+24>>2]=c[w+24>>2];c[J+28>>2]=c[w+28>>2];c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];oI(x,u);c[u>>2]=c[q>>2];c[u+4>>2]=c[q+4>>2];c[u+8>>2]=c[q+8>>2];c[u+12>>2]=c[q+12>>2];oI(x,u);if(!(c[r>>2]|0))c[r>>2]=109;break}case 10:{e=c[f+16>>2]|0;g=+h[f+8>>3];break}case 15:{d=c[f+8>>2]|0;break}default:{}}f=f+120|0;i=i+1|0;}c[b>>2]=c[x>>2];c[b+4>>2]=c[x+4>>2];c[b+8>>2]=c[x+8>>2];c[b+12>>2]=c[x+12>>2];c[b+16>>2]=c[x+16>>2];c[b+20>>2]=c[x+20>>2];c[b+24>>2]=c[x+24>>2];c[b+28>>2]=c[x+28>>2];}l=D;return}function oI(a,b){a=a|0;b=b|0;var c=0.0,d=0;c=+h[b>>3];d=a+16|0;if(c>+h[d>>3])h[d>>3]=c;if(c<+h[a>>3])h[a>>3]=c;c=+h[b+8>>3];b=a+24|0;if(c>+h[b>>3])h[b>>3]=c;b=a+8|0;if(c<+h[b>>3])h[b>>3]=c;return}function pI(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+48|0;k=r+32|0;n=r;f=+h[b>>3];o=n+16|0;h[o>>3]=f;h[n>>3]=f;f=+h[b+8>>3];p=n+24|0;h[p>>3]=f;m=n+8|0;h[m>>3]=f;j=1;while(1){if((j|0)>=(d|0))break;i=b+24|0;f=+h[i>>3];if(!(f<+h[n>>3])){if(f>+h[o>>3]){g=o;q=5;}}else {g=n;q=5;}if((q|0)==5){q=0;h[g>>3]=f;}f=+h[b+32>>3];if(!(f<+h[m>>3])){if(f>+h[p>>3]){b=o;q=8;}}else {b=n;q=8;}if((q|0)==8){q=0;h[b+8>>3]=f;}j=j+1|0;b=i;}c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];oI(e,k);c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];oI(e,k);c[a>>2]=c[n>>2];c[a+4>>2]=c[n+4>>2];c[a+8>>2]=c[n+8>>2];c[a+12>>2]=c[n+12>>2];c[a+16>>2]=c[n+16>>2];c[a+20>>2]=c[n+20>>2];c[a+24>>2]=c[n+24>>2];c[a+28>>2]=c[n+28>>2];l=r;return}function qI(b,c,d,e){b=b|0;c=+c;d=+d;e=e|0;var f=0.0,g=0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+16|0;i=n+8|0;j=n;f=+h[e+32>>3];k=+h[e+40>>3];switch(a[e+48>>0]|0){case 108:{h[i>>3]=c;f=f+c;g=j;m=5;break}case 110:{f=f*.5;h[i>>3]=c-f;f=f+c;g=j;m=5;break}case 114:{h[j>>3]=c;f=c-f;g=i;m=5;break}default:{c=0.0;f=0.0;}}if((m|0)==5){h[g>>3]=f;c=+h[i>>3];f=+h[j>>3];}d=+h[e+16>>3]+d;h[b>>3]=c;h[b+8>>3]=d-k;h[b+16>>3]=f;h[b+24>>3]=d;l=n;return}function rI(a){a=a|0;if((c[a>>2]|0)==7)BK(c[a+112>>2]|0,1);return}function sI(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0.0;m=l;l=l+16|0;k=m;j=c[b+152>>2]|0;n=+h[b+432>>3];i=+h[b+352>>3]*.013888888888888888;f=i*n;h[b+488>>3]=f;g=+h[b+440>>3];i=i*g;h[b+496>>3]=i;h[b+520>>3]=n*.013888888888888888;e=b+528|0;h[e>>3]=g*.013888888888888888;if(j&4096|0)h[e>>3]=g*-.013888888888888888;e=(c[b+360>>2]|0)==0;n=+((c[b+448>>2]|0)>>>0);g=+((c[b+452>>2]|0)>>>0);h[b+368>>3]=(e?n:g)/f;h[b+376>>3]=(e?g:n)/i;rS(b,aP(d,GA(d,0,101522,0)|0,195059)|0);c[b+160>>2]=0;tI(b,d);if(j&2|0)uI(b,d);e=jC(d)|0;while(1){if(!e)break;a[(c[e+16>>2]|0)+116>>0]=0;e=kC(d,e)|0;}vI(b,k);while(1){if(!((wI(b)|0)<<24>>24))break;if((xI(b)|0)>1)SR(b);yI(b);while(1){if(!((zI(b)|0)<<24>>24))break;AI(b,d);BI(b);}if((xI(b)|0)>1)TR(b);CI(b,k);}DI(b);l=m;return}function tI(a,b){a=a|0;b=b|0;var d=0;d=aI(a)|0;c[d+4>>2]=0;c[d+8>>2]=b;c[d+12>>2]=0;CJ(a,c[(c[b+16>>2]|0)+12>>2]|0,b);OR(a,b);return}function uI(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;jS(b,134800);d=QA(c,140977)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(c,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);OJ(b,c);g=jC(c)|0;while(1){if(!g)break;d=QA(g,140823)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(g,137729)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(g,101418)|0;do if(d|0?a[d>>0]|0:0){if(!(R2(d,58)|0)){hS(b,d);break}e=D4(d)|0;d=e;while(1){d=A4(d,107984)|0;if(!d)break;if(!(a[d>>0]|0)){d=0;continue}hS(b,d);d=0;}U1(e);}while(0);d=QA(g,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=XA(c,g)|0;while(1){if(!f)break;d=QA(f,140823)|0;do if(d|0?a[d>>0]|0:0){if(!(R2(d,58)|0)){hS(b,d);break}e=D4(d)|0;d=e;while(1){d=A4(d,107984)|0;if(!d)break;if(!(a[d>>0]|0)){d=0;continue}hS(b,d);d=0;}U1(e);}while(0);d=QA(f,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=ZA(c,f)|0;}g=kC(c,g)|0;}return}function vI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;e=i+8|0;g=i;h=c[a>>2]|0;d=c[h+312>>2]|0;f=a+156|0;c[f>>2]=d;h=c[h+316>>2]|0;if(!h)if((d|0)>1?(c[a+152>>2]&64|0)==0:0){c[e>>2]=c[a+52>>2];gA(0,100567,e)|0;c[f>>2]=1;e=1;d=0;}else {e=1;d=0;}else {d=h+4|0;if((c[h>>2]|0)>1?(c[a+152>>2]&64|0)==0:0){c[g>>2]=c[a+52>>2];gA(0,100567,g)|0;c[h+8>>2]=(c[f>>2]|0)+1;}e=c[d>>2]|0;d=h+8|0;}c[a+160>>2]=e;c[b>>2]=d;l=i;return}function wI(a){a=a|0;return (c[a+160>>2]|0)<=(c[a+156>>2]|0)|0}function xI(a){a=a|0;var b=0;b=c[(c[a>>2]|0)+316>>2]|0;return c[((b|0)==0?a+156|0:b)>>2]|0}function yI(a){a=a|0;var b=0,d=0;d=a+172|0;b=c[d+4>>2]|0;a=a+196|0;c[a>>2]=c[d>>2];c[a+4>>2]=b;return}function zI(a){a=a|0;var b=0,d=0;d=c[a+196>>2]|0;if(((d|0)>-1?(d|0)<(c[a+164>>2]|0):0)?(b=c[a+200>>2]|0,(b|0)>-1):0)a=(b|0)<(c[a+168>>2]|0)&1;else a=0;return a|0}function AI(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+176|0;k=p;f=p+48|0;m=p+32|0;n=c[d+16>>2]|0;o=c[d+152>>2]|0;if((c[d+160>>2]|0)<=1?(c[d+196>>2]|0)<=0:0)h=0;else {kA(m,128,f);g=n+212|0;h=c[g>>2]|0;eI(d,m);nA(m,h)|0;i=m+4|0;f=c[i>>2]|0;if(f>>>0>=(c[m+8>>2]|0)>>>0){lA(m,1)|0;f=c[i>>2]|0;}a[f>>0]=0;f=c[m>>2]|0;c[i>>2]=f;c[g>>2]=f;}HT(QA(e,100032)|0);FI(d);QR(d);hS(d,137314);jS(d,134800);do if(o&4259840|0){if((c[n+208>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;if(o&655360){i=o&131072;c[n+264>>2]=i>>>16^2;f=JK((i>>>12^32)+32|0)|0;g=d+288|0;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];c[f+8>>2]=c[g+8>>2];c[f+12>>2]=c[g+12>>2];g=f+16|0;q=d+304|0;c[g>>2]=c[q>>2];c[g+4>>2]=c[q+4>>2];c[g+8>>2]=c[q+8>>2];c[g+12>>2]=c[q+12>>2];if(!i){jK(f);g=4;}else g=2;}else {f=0;g=0;}if(!(o&8192))NR(d,f,f,g)|0;c[n+272>>2]=f;c[n+268>>2]=g;}while(0);if(o&32768|0?(j=c[(c[e+16>>2]|0)+12>>2]|0,j|0):0)c[n+192>>2]=c[j>>2];g=(o&4|0)!=0;do if(!g){f=n+208|0;if((c[f>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;q=d+256|0;c[k>>2]=c[q>>2];c[k+4>>2]=c[q+4>>2];c[k+8>>2]=c[q+8>>2];c[k+12>>2]=c[q+12>>2];c[k+16>>2]=c[q+16>>2];c[k+20>>2]=c[q+20>>2];c[k+24>>2]=c[q+24>>2];c[k+28>>2]=c[q+28>>2];kI(d,k);cS(d,c[f>>2]|0,c[n+228>>2]|0,c[n+244>>2]|0,c[n+212>>2]|0);}while(0);GI(d,e);f=c[(c[e+16>>2]|0)+12>>2]|0;if(f|0)DK(d,4,f);do if(!g){if((c[n+208>>2]|0)==0?(b[n+260>>1]&1)==0:0)break;dS(d);}while(0);HI(d,e,o);RR(d);if(h|0){oA(m);c[n+212>>2]=h;}l=p;return}function BI(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+32|0;d=h+24|0;b=h+16|0;j=h+8|0;f=h;g=a+196|0;i=a+188|0;c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[d>>2]=c[i>>2];c[d+4>>2]=c[i+4>>2];EI(j,b,d);i=c[j+4>>2]|0;e=g;c[e>>2]=c[j>>2];c[e+4>>2]=i;if(!((zI(a)|0)<<24>>24)){e=a+180|0;if(!(c[a+184>>2]|0))c[a+200>>2]=c[a+176>>2];else c[g>>2]=c[a+172>>2];c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];EI(f,b,d);i=c[f+4>>2]|0;j=g;c[j>>2]=c[f>>2];c[j+4>>2]=i;}l=h;return}function CI(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;if(!d){d=a+160|0;c[d>>2]=(c[d>>2]|0)+1;}else {c[a+160>>2]=c[d>>2];c[b>>2]=d+4;}return}function DI(a){a=a|0;PR(a);bI(a);return}function EI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[d+4>>2]|0)+(c[b+4>>2]|0)|0;c[a>>2]=(c[d>>2]|0)+(c[b>>2]|0);c[a+4>>2]=e;return}function FI(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0.0;t=l;l=l+48|0;n=t+32|0;f=t+24|0;j=t+8|0;k=t+16|0;m=t;r=a+196|0;q=c[r>>2]|0;r=c[r+4>>2]|0;p=f;c[p>>2]=q;c[p+4>>2]=r;p=a+164|0;i=c[p>>2]|0;p=c[p+4>>2]|0;s=j;c[s>>2]=i;c[s+4>>2]=p;s=a+360|0;if(!(c[s>>2]|0)){k=q;j=r;}else {c[n>>2]=c[f>>2];c[n+4>>2]=c[f+4>>2];NJ(k,n);r=k;k=c[r>>2]|0;r=c[r+4>>2]|0;p=f;c[p>>2]=k;c[p+4>>2]=r;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];NJ(m,n);p=m;i=c[p>>2]|0;p=c[p+4>>2]|0;c[j>>2]=i;c[j+4>>2]=p;j=r;}d=+h[a+320>>3];g=d*+(k|0)-+h[a+240>>3];h[a+288>>3]=g;e=+h[a+328>>3];o=e*+(j|0)-+h[a+248>>3];h[a+296>>3]=o;h[a+304>>3]=d+g;h[a+312>>3]=e+o;f=a+472|0;if(!(c[(c[a+12>>2]|0)+28>>2]|0)){r=a+456|0;c[f>>2]=c[r>>2];c[f+4>>2]=c[r+4>>2];c[f+8>>2]=c[r+8>>2];c[f+12>>2]=c[r+12>>2];}else {q=a+456|0;c[f>>2]=c[((c[f>>2]|0)<(c[q>>2]|0)?f:q)>>2];r=a+476|0;c[r>>2]=c[((c[r>>2]|0)<(c[a+460>>2]|0)?f:q)+4>>2];r=a+480|0;c[r>>2]=c[((c[r>>2]|0)>(c[a+464>>2]|0)?f:q)+8>>2];r=a+484|0;c[r>>2]=c[((c[r>>2]|0)>(c[a+468>>2]|0)?f:q)+12>>2];}m=c[a+152>>2]|0;b=+h[a+336>>3];if(!(m&128)){b=(+(k|0)-+(i|0)*.5)*d+b;h[a+256>>3]=b;g=(+(j|0)-+(p|0)*.5)*e+ +h[a+344>>3];o=g;d=d+b;g=g+e;}else {d=+h[a+368>>3]*.5;e=b-d;h[a+256>>3]=e;g=+h[a+344>>3];u=+h[a+376>>3]*.5;o=g-u;d=d+b;g=u+g;b=e;}h[a+264>>3]=o;h[a+272>>3]=d;h[a+280>>3]=g;if(!(c[s>>2]|0)){e=+h[a+352>>3];h[a+504>>3]=+h[a+384>>3]/e-b;if(!(m&4096)){d=+h[a+392>>3]/e;b=o;}else {d=-g;b=+h[a+392>>3]/e;}h[a+512>>3]=d-b;}else {f=a+384|0;e=+h[a+352>>3];h[a+512>>3]=-g-+h[a+392>>3]/e;if(!(m&4096))d=+h[f>>3]/e;else {d=-d;b=+h[f>>3]/e;}h[a+504>>3]=d-b;}l=t;return}function GI(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+48|0;q=s;o=s+40|0;p=s+36|0;r=s+32|0;e=QA(d,140977)|0;if(!e){j=1;e=137198;}else {i=(a[e>>0]|0)==0;j=i&1;e=i?137198:e;}h=c[b+152>>2]|0;i=(a[e>>0]|0)==116;if(!(h&256))if(i){m=(s2(e,137379)|0)==0;k=m?137198:e;m=m?1:j;n=8;}else {k=e;m=j;n=8;}else if(!(i?!(s2(e,137379)|0):0)){k=e;m=j;n=8;}if((n|0)==8?!((m|0)!=0&(h&33554432|0)!=0):0)if(!((JJ(k,o,p)|0)<<24>>24)){jS(b,k);hS(b,137379);r=b+256|0;c[q>>2]=c[r>>2];c[q+4>>2]=c[r+4>>2];c[q+8>>2]=c[r+8>>2];c[q+12>>2]=c[r+12>>2];c[q+16>>2]=c[r+16>>2];c[q+20>>2]=c[r+20>>2];c[q+24>>2]=c[r+24>>2];c[q+28>>2]=c[r+28>>2];oS(b,q,1);}else {c[r>>2]=0;i=c[o>>2]|0;jS(b,i);hS(b,137379);IJ(d,r)|0;e=c[o+4>>2]|0;h=ZO(d,c[47143]|0,0,0)|0;f=+g[p>>2];if(!e)kS(b,137314,h,f);else kS(b,e,h,f);r=(c[r>>2]|0)>>>1&1|2;p=b+256|0;c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];c[q+16>>2]=c[p+16>>2];c[q+20>>2]=c[p+20>>2];c[q+24>>2]=c[p+24>>2];c[q+28>>2]=c[p+28>>2];oS(b,q,r);U1(i);}e=c[(c[(c[d+16>>2]|0)+8>>2]|0)+88>>2]|0;if(e|0)LJ(b,e);l=s;return}function HI(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=(c[a>>2]|0)+28|0;c[g>>2]=(c[g>>2]|0)+1;g=(d&4|0)!=0;if(!g)II(a,b,d);a:do if(!(d&1)){if(d&16|0){YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);WR(a);e=jC(b)|0;while(1){if(!e)break;JI(a,e);e=kC(b,e)|0;}XR(a);break}if(!(d&8)){f=jC(b)|0;while(1){if(!f)break a;JI(a,f);e=XA(b,f)|0;while(1){if(!e)break;JI(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0);KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}}WR(a);e=jC(b)|0;while(1){if(!e)break;if((LI(b,e)|0)<<24>>24)JI(a,e);e=kC(b,e)|0;}XR(a);YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;if((MI(b,e)|0)<<24>>24)KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);}else {WR(a);e=jC(b)|0;while(1){if(!e)break;JI(a,e);e=kC(b,e)|0;}XR(a);YR(a);f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;KI(a,e);e=ZA(b,e)|0;}f=kC(b,f)|0;}ZR(a);}while(0);if(g)II(a,b,d);return}function II(e,f,i){e=e|0;f=f|0;i=i|0;var j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;P=l;l=l+128|0;w=P+72|0;N=P+64|0;H=P+112|0;I=P;J=P+104|0;K=f+16|0;L=(i&4|0)!=0;M=e+16|0;x=I+32|0;y=I+16|0;A=I+8|0;B=I+24|0;C=I+48|0;D=I+40|0;E=I+56|0;F=(i&8|0)==0;G=J+4|0;v=1;while(1){j=c[K>>2]|0;if((v|0)>(c[j+180>>2]|0))break;u=c[(c[j+184>>2]|0)+(v<<2)>>2]|0;if((GJ(e,u)|0)<<24>>24){if(L)II(e,u,i);HJ(e,u);r=c[M>>2]|0;s=r+208|0;if(!(c[s>>2]|0))t=(b[r+260>>1]&1)!=0;else t=1;HT(QA(u,100032)|0);if(!(L|t^1)){q=(c[u+16>>2]|0)+16|0;c[w>>2]=c[q>>2];c[w+4>>2]=c[q+4>>2];c[w+8>>2]=c[q+8>>2];c[w+12>>2]=c[q+12>>2];c[w+16>>2]=c[q+16>>2];c[w+20>>2]=c[q+20>>2];c[w+24>>2]=c[q+24>>2];c[w+28>>2]=c[q+28>>2];kI(e,w);cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);}c[H>>2]=0;j=IJ(u,H)|0;if(!j)p=0;else {lS(e,j);p=c[H>>2]&1;}q=u+16|0;j=d[(c[q>>2]|0)+112>>0]|0;do if(!(j&1)){if(j&2|0){j=bP(u,0,106256)|0;k=bP(u,0,106264)|0;O=29;break}if(j&8|0){j=bP(u,0,106272)|0;k=bP(u,0,106280)|0;O=29;break}if(j&4|0){j=bP(u,0,106288)|0;k=bP(u,0,106296)|0;O=29;break}j=QA(u,140823)|0;if(!j)k=0;else k=(a[j>>0]|0)==0?0:j;j=QA(u,137729)|0;if(!j)j=k;else j=(a[j>>0]|0)==0?k:j;m=QA(u,101418)|0;if(m)k=(a[m>>0]|0)==0?k:m;if(!((p|0)!=0&(k|0)!=0)){m=QA(u,140977)|0;if(m|0?a[m>>0]|0:0){k=m;O=29;break}j=(j|0)==0?137314:j;n=(k|0)==0?134800:k;c[J>>2]=0;if(!p)k=0;else O=31;}else O=29;}else {j=bP(u,0,106240)|0;k=bP(u,0,106248)|0;O=29;}while(0);if((O|0)==29){c[J>>2]=0;j=(j|0)==0?137314:j;n=(k|0)==0?134800:k;O=31;}if((O|0)==31){O=0;if(!((JJ(n,J,w)|0)<<24>>24)){jS(e,n);k=1;}else {jS(e,c[J>>2]|0);k=c[G>>2]|0;m=ZO(u,c[47143]|0,0,0)|0;o=+g[w>>2];if(!k)kS(e,137314,m,o);else kS(e,k,m,o);k=(c[H>>2]|0)>>>1&1|2;}}m=c[47142]|0;if((m|0?(z=RA(u,m)|0,z|0):0)?a[z>>0]|0:0)uS(e,+_O(u,c[47142]|0,1.0,0.0));p=c[H>>2]|0;do if(p&4){m=ZO(u,c[47141]|0,1,0)|0;if(m|k|0){n=c[q>>2]|0;Q=n+16|0;c[I>>2]=c[Q>>2];c[I+4>>2]=c[Q+4>>2];c[I+8>>2]=c[Q+8>>2];c[I+12>>2]=c[Q+12>>2];n=n+32|0;c[x>>2]=c[n>>2];c[x+4>>2]=c[n+4>>2];c[x+8>>2]=c[n+8>>2];c[x+12>>2]=c[n+12>>2];h[y>>3]=+h[x>>3];h[B>>3]=+h[A>>3];h[C>>3]=+h[I>>3];h[E>>3]=+h[D>>3];if(!m)hS(e,137379);else hS(e,j);TM(e,I,4,p,k);}}else {if(!(p&64)){if(ZO(u,c[47141]|0,1,0)|0){hS(e,j);Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,k);break}if(!k)break;hS(e,137379);Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,k);break}Q=c[q>>2]|0;p=Q+16|0;c[I>>2]=c[p>>2];c[I+4>>2]=c[p+4>>2];c[I+8>>2]=c[p+8>>2];c[I+12>>2]=c[p+12>>2];Q=Q+32|0;c[x>>2]=c[Q>>2];c[x+4>>2]=c[Q+4>>2];c[x+8>>2]=c[Q+8>>2];c[x+12>>2]=c[Q+12>>2];h[y>>3]=+h[x>>3];h[B>>3]=+h[A>>3];h[C>>3]=+h[I>>3];h[E>>3]=+h[D>>3];if(!(ZO(u,c[47141]|0,1,0)|0))hS(e,137379);else hS(e,j);if((jI(e,I,n,0)|0)>1){c[N>>2]=KB(u)|0;gA(3,100400,N)|0;}Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];oS(e,w,0);}while(0);U1(c[J>>2]|0);j=c[(c[q>>2]|0)+12>>2]|0;if(j|0)DK(e,5,j);if(t){if(L){Q=(c[q>>2]|0)+16|0;c[w>>2]=c[Q>>2];c[w+4>>2]=c[Q+4>>2];c[w+8>>2]=c[Q+8>>2];c[w+12>>2]=c[Q+12>>2];c[w+16>>2]=c[Q+16>>2];c[w+20>>2]=c[Q+20>>2];c[w+24>>2]=c[Q+24>>2];c[w+28>>2]=c[Q+28>>2];kI(e,w);cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);}dS(e);}a:do if(!F){k=jC(u)|0;while(1){if(!k)break a;JI(e,k);j=XA(u,k)|0;while(1){if(!j)break;KI(e,j);j=ZA(u,j)|0;}k=kC(u,k)|0;}}while(0);KJ(e,f);if(!L)II(e,u,i);}v=v+1|0;}l=P;return}function JI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+32|0;e=j;h=c[b>>2]|0;i=d+16|0;a:do if(((c[(c[i>>2]|0)+8>>2]|0?(yJ(b,xC(d)|0,d)|0)<<24>>24:0)?(k=b+256|0,c[e>>2]=c[k>>2],c[e+4>>2]=c[k+4>>2],c[e+8>>2]=c[k+8>>2],c[e+12>>2]=c[k+12>>2],c[e+16>>2]=c[k+16>>2],c[e+20>>2]=c[k+20>>2],c[e+24>>2]=c[k+24>>2],c[e+28>>2]=c[k+28>>2],(zJ(d,e)|0)<<24>>24):0)?(f=(c[i>>2]|0)+116|0,g=c[h+28>>2]|0,(g|0)!=(a[f>>0]|0)):0){a[f>>0]=g;rS(b,KB(d)|0);e=aP(d,c[47169]|0,195059)|0;if(a[e>>0]|0)rS(b,e);e=aP(d,c[47157]|0,195059)|0;b:do if(a[e>>0]|0){PI(e)|0;e=188228;while(1){f=e;e=e+4|0;f=c[f>>2]|0;if(!f)break b;if((a[f>>0]|0)!=105)continue;if(!(s2(f,134335)|0))break a}}while(0);AJ(b,d);ub[c[(c[(c[(c[i>>2]|0)+8>>2]|0)+4>>2]|0)+20>>2]&63](b,d);e=c[(c[i>>2]|0)+108>>2]|0;if(e|0?a[e+81>>0]|0:0)DK(b,10,e);BJ(b);}while(0);l=j;return}function KI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;g=h;e=b+256|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];c[g+16>>2]=c[e+16>>2];c[g+20>>2]=c[e+20>>2];c[g+24>>2]=c[e+24>>2];c[g+28>>2]=c[e+28>>2];a:do if((NI(d,g)|0)<<24>>24?(f=d+-48|0,(OI(b,d)|0)<<24>>24):0){i=d+48|0;e=l2(KB(c[((c[d>>2]&3|0)==3?d:i)+40>>2]|0)|0)|0;e=T1(e+3+(l2(KB(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0)|0)|0;r3(e,KB(c[((c[d>>2]&3|0)==3?d:i)+40>>2]|0)|0)|0;i=(xB(xC(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0)==0;g=e+(l2(e)|0)|0;if(i){a[g>>0]=a[141747]|0;a[g+1>>0]=a[141748]|0;a[g+2>>0]=a[141749]|0;}else {a[g>>0]=a[137738]|0;a[g+1>>0]=a[137739]|0;a[g+2>>0]=a[137740]|0;}F4(e,KB(c[((c[d>>2]&3|0)==2?d:f)+40>>2]|0)|0)|0;rS(b,e);U1(e);e=aP(d,c[47191]|0,195059)|0;if(a[e>>0]|0)rS(b,e);e=aP(d,c[47185]|0,195059)|0;b:do if(!(a[e>>0]|0))e=0;else {PI(e)|0;e=188228;while(1){f=e;e=e+4|0;f=c[f>>2]|0;if(!f){e=188228;break b}if((a[f>>0]|0)!=105)continue;if(!(s2(f,134335)|0))break a}}while(0);QI(b,d,e);RI(b,d,e);SI(b);}while(0);l=h;return}function LI(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0)){a=1;break}if(!(HC(c[(c[e+184>>2]|0)+(a<<2)>>2]|0,b)|0))a=a+1|0;else {a=0;break}}return a|0}function MI(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0)){a=1;break}if(!(HC(c[(c[e+184>>2]|0)+(a<<2)>>2]|0,b)|0))a=a+1|0;else {a=0;break}}return a|0}function NI(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+64|0;i=j+32|0;f=j;g=b+16|0;b=c[g>>2]|0;e=c[b+8>>2]|0;if((e|0)!=0?(e=e+8|0,c[f>>2]=c[e>>2],c[f+4>>2]=c[e+4>>2],c[f+8>>2]=c[e+8>>2],c[f+12>>2]=c[e+12>>2],c[f+16>>2]=c[e+16>>2],c[f+20>>2]=c[e+20>>2],c[f+24>>2]=c[e+24>>2],c[f+28>>2]=c[e+28>>2],c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[i+16>>2]=c[d+16>>2],c[i+20>>2]=c[d+20>>2],c[i+24>>2]=c[d+24>>2],c[i+28>>2]=c[d+28>>2],(xJ(f,i)|0)!=0):0)b=1;else h=3;do if((h|0)==3){e=c[b+96>>2]|0;if(e){c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[i+16>>2]=c[d+16>>2];c[i+20>>2]=c[d+20>>2];c[i+24>>2]=c[d+24>>2];c[i+28>>2]=c[d+28>>2];if((iQ(e,i)|0)<<24>>24){b=1;break}b=c[g>>2]|0;}b=c[b+108>>2]|0;if((b|0?a[b+81>>0]|0:0)?(c[i>>2]=c[d>>2],c[i+4>>2]=c[d+4>>2],c[i+8>>2]=c[d+8>>2],c[i+12>>2]=c[d+12>>2],c[i+16>>2]=c[d+16>>2],c[i+20>>2]=c[d+20>>2],c[i+24>>2]=c[d+24>>2],c[i+28>>2]=c[d+28>>2],(iQ(b,i)|0)<<24>>24):0){b=1;break}b=0;}while(0);l=j;return b|0}function OI(b,d){b=b|0;d=d|0;var e=0,f=0;a:do if((c[b+156>>2]|0)>=2?(e=aP(d,c[47190]|0,195059)|0,(tJ(b,e)|0)<<24>>24==0):0)if(!(a[e>>0]|0)){e=0;while(1){if((e|0)>=2){e=0;break a}f=(e|0)==1;f=aP(c[((c[d>>2]&3|0)==((f?2:3)|0)?d:d+((f?-1:1)*48|0)|0)+40>>2]|0,c[47167]|0,195059)|0;if(!(a[f>>0]|0)){e=1;break a}if(!((tJ(b,f)|0)<<24>>24))e=e+1|0;else {e=1;break}}}else e=0;else e=1;while(0);return e|0}function PI(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+192|0;o=p+24|0;n=p+16|0;m=p+8|0;k=p;g=p+48|0;j=p+32|0;if(a[100282]|0){kA(188492,128,194826);a[100282]=0;}kA(j,128,p+56|0);c[g>>2]=b;h=j+4|0;i=j+8|0;d=0;e=0;a:while(1){f=d;b:while(1)switch(rJ(g,j)|0){case 0:{d=21;break a}case 40:if(!(f<<24>>24)){f=1;continue b}else {d=7;break a}case 41:if(!(f<<24>>24)){d=9;break a}else {f=0;continue b}default:break b}if(!(f<<24>>24)){if((e|0)==63){d=12;break}d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}c[47124]=d+1;a[d>>0]=0;c[188228+(e<<2)>>2]=c[47124];e=e+1|0;}d=c[h>>2]|0;if(d>>>0>=(c[i>>2]|0)>>>0){lA(j,1)|0;d=c[h>>2]|0;}a[d>>0]=0;d=c[j>>2]|0;c[h>>2]=d;nA(188492,d)|0;d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}c[47124]=d+1;a[d>>0]=0;d=f;}do if((d|0)==7){c[k>>2]=b;gA(1,100283,k)|0;c[47057]=0;oA(j);}else if((d|0)==9){c[m>>2]=b;gA(1,100317,m)|0;c[47057]=0;oA(j);}else if((d|0)==12){c[n>>2]=b;gA(0,100345,n)|0;c[47120]=0;oA(j);}else if((d|0)==21){if(f<<24>>24){c[o>>2]=b;gA(1,100368,o)|0;c[47057]=0;oA(j);break}c[188228+(e<<2)>>2]=0;oA(j);d=c[47124]|0;if(d>>>0>=(c[47125]|0)>>>0){lA(188492,1)|0;d=c[47124]|0;}a[d>>0]=0;c[47124]=c[47123];}while(0);l=p;return 188228} -function Bb(a){a=a|0;var b=0;b=l;l=l+a|0;l=l+15&-16;return b|0}function Cb(){return l|0}function Db(a){a=a|0;l=a;}function Eb(a,b){a=a|0;b=b|0;l=a;m=b;}function Fb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b;}}function Gb(a){a=a|0;z=a;}function Hb(){return z|0}function Ib(a){a=a|0;c[46654]=a;return 0}function Jb(){return c[46654]|0}function Kb(a,b){a=a|0;b=b|0;Oa(0,a|0,b|0)|0;return}function Lb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i+4|0;g=i;c[f>>2]=0;h=mG()|0;rG(h,10976);rG(h,17220);rG(h,17440);fA(1)|0;eA(18)|0;while(1){a=ZB(a)|0;e=c[f>>2]|0;if(!a)break;if(e|0){a=195059;continue}nG(h,a,d)|0;qG(h,a,b,f,g)|0;a=195059;}l=i;return e|0}function Mb(a){a=a|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;d=g+4|0;e=g;f=c[(c[a+16>>2]|0)+8>>2]|0;a=a+64|0;switch(c[a>>2]|0){case 0:{JL(f);break}case 1:{if(b[(c[f+16>>2]|0)+136>>1]&1)UP(f);break}case 4:case 5:case 6:{GL(f,e,d);Pb(f,c[e>>2]|0,c[d>>2]|0,c[a>>2]|0);break}default:{}}l=g;return}function Nb(a){a=a|0;var b=0,d=0,e=0,f=0;d=c[(c[a+16>>2]|0)+8>>2]|0;if(!(c[46655]|0)){c[46655]=c[4678];c[46656]=57;c[46657]=19;}e=d+64|0;f=(c[e>>2]|0)+8|0;b=c[f>>2]|0;c[f>>2]=186620;switch(c[a+64>>2]|0){case 2:{wL(a,d,a,0);break}case 3:{wL(a,d,a,1);break}case 1:case 0:{if(!(c[a+152>>2]&134217728))dE(d,a)|0;break}case 6:case 5:case 4:{Ob(d);if(!(c[a+152>>2]&134217728))dE(d,a)|0;break}default:{}}c[(c[e>>2]|0)+8>>2]=b;return}function Ob(b){b=b|0;var d=0,e=0;d=c[46659]|0;if((d|0)!=(c[46658]|0)){e=c[c[46690]>>2]|0;if(!e){e=_P(b,0,99808,195059)|0;c[c[46690]>>2]=e;d=c[46659]|0;}if(d>>>0>=(c[46660]|0)>>>0){lA(186632,1)|0;d=c[46659]|0;}a[d>>0]=0;d=c[46658]|0;c[46659]=d;KA(b,e,d)|0;}if(c[(c[b+16>>2]|0)+12>>2]|0){e=c[(c[46690]|0)+4>>2]|0;d=c[46675]|0;if(d>>>0>=(c[46676]|0)>>>0){lA(186696,1)|0;d=c[46675]|0;}a[d>>0]=0;d=c[46674]|0;c[46675]=d;KA(b,e,d)|0;}TA(b,66753,c[(c[46690]|0)+8236>>2]|0,195059)|0;d=0;while(1){if((d|0)==8)break;oA(186632+(d<<4)|0);d=d+1|0;}U1(c[46690]|0);h[1]=1.0;h[5]=1.0;c[46691]=0;c[46695]=0;return}function Pb(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;i=T1(8240)|0;c[46690]=i;a:do switch(g|0){case 6:{b[i+8232>>1]=14;g=66769;break}case 5:{b[i+8232>>1]=12;g=66773;break}default:{g=QA(d,66753)|0;if((g|0?a[g>>0]|0:0)?(h=Qb(g)|0,(h&65535)>10):0){i=c[46690]|0;b[i+8232>>1]=h;break a}g=Qb(66765)|0;i=c[46690]|0;b[i+8232>>1]=g;g=66765;}}while(0);c[i+8236>>2]=g;j=d+16|0;g=c[j>>2]|0;if(!(c[g+180>>2]|0))h=0;else {h=_P(d,0,99808,195059)|0;i=c[46690]|0;g=c[j>>2]|0;}c[i>>2]=h;if(!(a[g+113>>0]&8))g=0;else g=_P(d,0,66777,195059)|0;c[(c[46690]|0)+4>>2]=g;i=_P(d,1,99808,195059)|0;c[(c[46690]|0)+8>>2]=i;i=_P(d,1,66777,195059)|0;c[(c[46690]|0)+12>>2]=i;i=_P(d,2,99808,195059)|0;g=c[46690]|0;c[g+16>>2]=i;if(!f)h=0;else {h=_P(d,2,66785,195059)|0;g=c[46690]|0;}c[g+20>>2]=h;if(!e)h=0;else {h=_P(d,2,66793,195059)|0;g=c[46690]|0;}c[g+24>>2]=h;h=a[(c[j>>2]|0)+113>>0]|0;if(!(h&33))i=0;else {i=_P(d,2,66777,195059)|0;g=c[46690]|0;h=a[(c[j>>2]|0)+113>>0]|0;}c[g+28>>2]=i;if(!(h&2))i=0;else {i=_P(d,2,66801,195059)|0;g=c[46690]|0;h=a[(c[j>>2]|0)+113>>0]|0;}c[g+32>>2]=i;if(!(h&4))h=0;else {h=_P(d,2,66810,195059)|0;g=c[46690]|0;}c[g+36>>2]=h;g=0;while(1){if((g|0)==8)break;kA(186632+(g<<4)|0,1024,(c[46690]|0)+40+(g<<10)|0);g=g+1|0;}return}function Qb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+1040|0;h=j;g=j+8|0;f=0;d=b;a:while(1){do{e=d;d=d+1|0;e=a[e>>0]|0;if(!(e<<24>>24))break a}while(((e<<24>>24)+-48|0)>>>0>=10);if((f|0)>=1023){i=7;break}a[g+f>>0]=e;f=f+1|0;}if((i|0)==7){c[h>>2]=b;gA(0,66819,h)|0;}a[g+f>>0]=0;i=(q5(g)|0)&65535;l=j;return i|0}function Rb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;d=c[c[46690]>>2]|0;b=c[46663]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;if(c[(c[e+16>>2]|0)+12>>2]|0){d=c[(c[46690]|0)+4>>2]|0;b=c[46679]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}h[2]=1.0;h[6]=1.0;c[46692]=0;c[46696]=0;return}function Sb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;b=c[46663]|0;if((c[46662]|0)!=(b|0)){d=c[(c[46690]|0)+8>>2]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;}b=c[46679]|0;if((c[46678]|0)!=(b|0)){d=c[(c[46690]|0)+12>>2]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}h[9]=1.0;h[11]=1.0;c[46699]=0;c[46701]=0;return}function Tb(b){b=b|0;var d=0,e=0;e=c[(c[b+16>>2]|0)+8>>2]|0;b=c[46663]|0;if((c[46662]|0)!=(b|0)){d=c[(c[46690]|0)+16>>2]|0;if(b>>>0>=(c[46664]|0)>>>0){lA(186648,1)|0;b=c[46663]|0;}a[b>>0]=0;b=c[46662]|0;c[46663]=b;KA(e,d,b)|0;}b=c[46667]|0;if((c[46666]|0)!=(b|0)){d=c[(c[46690]|0)+24>>2]|0;if(b>>>0>=(c[46668]|0)>>>0){lA(186664,1)|0;b=c[46667]|0;}a[b>>0]=0;b=c[46666]|0;c[46667]=b;KA(e,d,b)|0;}b=c[46671]|0;if((c[46670]|0)!=(b|0)){d=c[(c[46690]|0)+20>>2]|0;if(b>>>0>=(c[46672]|0)>>>0){lA(186680,1)|0;b=c[46671]|0;}a[b>>0]=0;b=c[46670]|0;c[46671]=b;KA(e,d,b)|0;}b=c[46679]|0;if((c[46678]|0)!=(b|0)){d=c[(c[46690]|0)+28>>2]|0;if(b>>>0>=(c[46680]|0)>>>0){lA(186712,1)|0;b=c[46679]|0;}a[b>>0]=0;b=c[46678]|0;c[46679]=b;KA(e,d,b)|0;}b=c[46683]|0;if((c[46682]|0)!=(b|0)){d=c[(c[46690]|0)+36>>2]|0;if(b>>>0>=(c[46684]|0)>>>0){lA(186728,1)|0;b=c[46683]|0;}a[b>>0]=0;b=c[46682]|0;c[46683]=b;KA(e,d,b)|0;}b=c[46687]|0;if((c[46686]|0)!=(b|0)){d=c[(c[46690]|0)+32>>2]|0;if(b>>>0>=(c[46688]|0)>>>0){lA(186744,1)|0;b=c[46687]|0;}a[b>>0]=0;b=c[46686]|0;c[46687]=b;KA(e,d,b)|0;}h[10]=1.0;h[12]=1.0;h[3]=1.0;h[4]=1.0;h[7]=1.0;h[8]=1.0;c[46700]=0;c[46702]=0;c[46693]=0;c[46694]=0;c[46697]=0;c[46698]=0;return}function Ub(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+1056|0;j=t+16|0;s=t+8|0;r=t;k=t+32|0;o=c[(c[d+16>>2]|0)+12>>2]|0;p=c[11416+(o<<2)>>2]|0;nA(p,66916)|0;g=f+4|0;bc(k,+h[(c[g>>2]|0)+16>>3]);nA(p,k)|0;ec(d,195059,c[c[g>>2]>>2]|0);_b(d);q=a[f+48>>0]|0;q=q<<24>>24==108?-1:q<<24>>24==114&1;g=c[g>>2]|0;if(!g)g=0;else g=c[g+24>>2]&127;i=b[(c[46690]|0)+8232>>1]|0;if((i&65535)>14?(m=c[11464+((i&65535)+-15<<2)>>2]&g,n=186764+(o<<2)|0,(c[n>>2]|0)!=(m|0)):0){c[r>>2]=m;m4(k,66919,r)|0;nA(p,k)|0;c[n>>2]=m;}r=e+8|0;h[r>>3]=+h[r>>3]+ +h[f+24>>3];nA(p,66925)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];ac(p,j);c[s>>2]=q;m4(k,102220,s)|0;nA(p,k)|0;bc(k,+h[f+32>>3]);nA(p,k)|0;ec(d,195059,c[f>>2]|0);l=t;return}function Vb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;i=l;l=l+1040|0;f=i;g=i+16|0;e=c[(c[a+16>>2]|0)+12>>2]|0;Zb(a);_b(a);if(!d){a=c[11416+(e<<2)>>2]|0;nA(a,66913)|0;}else {if((d|1|0)==3)gc(a,d,b,2);else hc(a);a=c[11416+(e<<2)>>2]|0;nA(a,66910)|0;};c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];ac(a,f);bc(g,+h[b+16>>3]-+h[b>>3]);nA(a,g)|0;bc(g,+h[b+24>>3]-+h[b+8>>3]);nA(a,g)|0;l=i;return}function Wb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Zb(a);_b(a);if(!d)$b(a,112,b,c);else {if((d|1|0)==3)gc(a,d,b,c);else hc(a);$b(a,80,b,c);}return}function Xb(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Zb(a);_b(a);if(!f)$b(a,66,b,c);else {if((f|1|0)==3)gc(a,f,b,c);else hc(a);$b(a,98,b,c);}return}function Yb(a,b,c){a=a|0;b=b|0;c=c|0;Zb(a);_b(a);$b(a,76,b,c);return}function Zb(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+1184|0;i=n;f=n+24|0;m=n+8|0;kA(m,1024,n+152|0);j=b+16|0;d=c[j>>2]|0;g=+h[d+152>>3];e=8+(c[d+12>>2]<<3)|0;if(g!=+h[e>>3]){h[e>>3]=g;nA(m,66882)|0;h[i>>3]=+h[(c[j>>2]|0)+152>>3];m4(f,66896,i)|0;cc(f,0);nA(m,f)|0;f=m+4|0;d=c[f>>2]|0;e=m+8|0;if(d>>>0>=(c[e>>2]|0)>>>0){lA(m,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=41;d=c[f>>2]|0;if(d>>>0>=(c[e>>2]|0)>>>0){lA(m,1)|0;d=c[f>>2]|0;}a[d>>0]=0;d=c[m>>2]|0;c[f>>2]=d;ec(b,66901,d);d=c[j>>2]|0;}d=c[d+160>>2]|0;if(d|0){j=m+4|0;k=m+8|0;a:while(1){i=d+4|0;d=c[d>>2]|0;if(!d)break;switch(a[d>>0]|0){case 102:{if(!(s2(d,111101)|0)){d=i;continue a}break}case 98:{if(!(s2(d,111083)|0)){d=i;continue a}break}case 115:{if(!(s2(d,111088)|0)){d=i;continue a}break}default:{}}nA(m,d)|0;do{f=d;d=d+1|0;}while((a[f>>0]|0)!=0);if(a[d>>0]|0){e=c[j>>2]|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;e=c[j>>2]|0;}c[j>>2]=e+1;a[e>>0]=40;f=0;while(1){if(!(a[d>>0]|0))break;if(f|0){e=c[j>>2]|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;e=c[j>>2]|0;}c[j>>2]=e+1;a[e>>0]=44;}nA(m,d)|0;do{e=d;d=d+1|0;}while((a[e>>0]|0)!=0);f=f+1|0;}d=c[j>>2]|0;if(d>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=41;}d=c[j>>2]|0;if(d>>>0>=(c[k>>2]|0)>>>0){lA(m,1)|0;d=c[j>>2]|0;}a[d>>0]=0;d=c[m>>2]|0;c[j>>2]=d;ec(b,66901,d);d=i;}oA(m);}l=n;return}function _b(a){a=a|0;dc((c[a+16>>2]|0)+16|0);ec(a,75834,193758);return}function $b(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+1040|0;j=k;i=k+16|0;h=c[11416+(c[(c[b+16>>2]|0)+12>>2]<<2)>>2]|0;g=h+4|0;b=c[g>>2]|0;if(b>>>0>=(c[h+8>>2]|0)>>>0){lA(h,1)|0;b=c[g>>2]|0;}c[g>>2]=b+1;a[b>>0]=d;c[j>>2]=f;m4(i,66846,j)|0;nA(h,i)|0;b=0;while(1){if((b|0)>=(f|0))break;i=e+(b<<4)|0;c[j>>2]=c[i>>2];c[j+4>>2]=c[i+4>>2];c[j+8>>2]=c[i+8>>2];c[j+12>>2]=c[i+12>>2];ac(h,j);b=b+1|0;}l=k;return}function ac(a,b){a=a|0;b=b|0;var c=0,d=0;c=l;l=l+1024|0;d=c;bc(d,+h[b>>3]);nA(a,d)|0;bc(d,+vL(+h[b+8>>3]));nA(a,d)|0;l=c;return}function bc(a,b){a=a|0;b=+b;var c=0,d=0;c=l;l=l+16|0;d=c;h[d>>3]=b>-1.0e-08&b<1.0e-08?0.0:b;m4(a,66851,d)|0;cc(a,1);l=c;return}function cc(b,c){b=b|0;c=c|0;var d=0,e=0;d=R2(b,46)|0;if(!d){if(c|0){d=b+(l2(b)|0)|0;e=10;}}else {while(1){b=d+1|0;if(!(a[b>>0]|0))break;else d=b;}a:while(1){switch(a[d>>0]|0){case 46:{e=5;break a}case 48:break;default:{e=6;break a}}a[d>>0]=0;d=d+-1|0;}if((e|0)==5)a[d>>0]=0;else if((e|0)==6)d=d+1|0;if(c|0)e=10;}if((e|0)==10){a[d>>0]=32;a[d+1>>0]=0;}return}function dc(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;i=j+16|0;h=j;e=a[b+3>>0]|0;f=d[b>>0]|0;g=d[b+1>>0]|0;b=d[b+2>>0]|0;if(e<<24>>24==-1){c[h>>2]=f;c[h+4>>2]=g;c[h+8>>2]=b;m4(193758,75714,h)|0;}else {c[i>>2]=f;c[i+4>>2]=g;c[i+8>>2]=b;c[i+12>>2]=e&255;m4(193758,66864,i)|0;}l=j;return}function ec(a,b,d){a=a|0;b=b|0;d=d|0;fc(c[11416+(c[(c[a+16>>2]|0)+12>>2]<<2)>>2]|0,b,d);return}function fc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=l;l=l+1040|0;h=f;g=f+8|0;i=l2(e)|0;c[h>>2]=d;c[h+4>>2]=i;m4(g,66857,h)|0;nA(b,g)|0;nA(b,e)|0;e=b+4|0;d=c[e>>2]|0;if(d>>>0>=(c[b+8>>2]|0)>>>0){lA(b,1)|0;d=c[e>>2]|0;}c[e>>2]=d+1;a[d>>0]=32;l=f;return}function gc(b,d,f,i){b=b|0;d=d|0;f=f|0;i=i|0;var j=0.0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0;x=l;l=l+1120|0;t=x+64|0;w=x+80|0;k=x+32|0;r=x+16|0;s=x;u=c[b+16>>2]|0;j=+(c[u+136>>2]|0)*.017453292519943295;if((e[(c[46690]|0)+8232>>1]|0)<14)hc(b);else {kA(w,1024,x+96|0);v=(d|0)==2;if(v){pQ(f,k,i,j,2);f=w+4|0;d=c[f>>2]|0;if(d>>>0>=(c[w+8>>2]|0)>>>0){lA(w,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=91;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];ac(w,t);s=k+16|0;c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];ac(w,t);}else {pQ(f,k,i,0.0,3);q=+h[k+24>>3];o=+h[k>>3];if(j==0.0){n=+h[k+8>>3];p=q*.25;j=n;m=o;}else {p=q*.25;y=p;m=+E(+j)*y+o;n=+h[k+8>>3];j=+F(+j)*y+n;}h[r>>3]=m;h[r+8>>3]=j;h[s>>3]=o;h[s+8>>3]=n;f=w+4|0;d=c[f>>2]|0;if(d>>>0>=(c[w+8>>2]|0)>>>0){lA(w,1)|0;d=c[f>>2]|0;}c[f>>2]=d+1;a[d>>0]=40;c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];ac(w,t);ic(w,p);c[t>>2]=c[s>>2];c[t+4>>2]=c[s+4>>2];c[t+8>>2]=c[s+8>>2];c[t+12>>2]=c[s+12>>2];ac(w,t);ic(w,q);}nA(w,66907)|0;d=u+140|0;j=+g[d>>2];f=u+56|0;if(j>0.0){jc(w,j,f);jc(w,+g[d>>2],u+96|0);}else {jc(w,0.0,f);jc(w,1.0,u+96|0);}pA(w)|0;k=w+4|0;d=c[k>>2]|0;i=w+8|0;f=d>>>0>=(c[i>>2]|0)>>>0;if(v){if(f){lA(w,1)|0;d=c[k>>2]|0;}c[k>>2]=d+1;a[d>>0]=93;}else {if(f){lA(w,1)|0;d=c[k>>2]|0;}c[k>>2]=d+1;a[d>>0]=41;}d=c[k>>2]|0;if(d>>>0>=(c[i>>2]|0)>>>0){lA(w,1)|0;d=c[k>>2]|0;}a[d>>0]=0;v=c[w>>2]|0;c[k>>2]=v;ec(b,66904,v);oA(w);}l=x;return}function hc(a){a=a|0;dc((c[a+16>>2]|0)+56|0);ec(a,66904,193758);return}function ic(a,b){a=a|0;b=+b;var c=0,d=0;c=l;l=l+1024|0;d=c;bc(d,b);nA(a,d)|0;l=c;return}function jc(a,b,c){a=a|0;b=+b;c=c|0;var d=0,e=0,f=0;d=l;l=l+1040|0;f=d;e=d+8|0;h[f>>3]=b;m4(e,94168,f)|0;cc(e,1);dc(c);fc(a,e,193758);l=d;return}function kc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0;e=l;l=l+1040|0;i=e;f=e+16|0;g=c[11416+(c[(c[a+16>>2]|0)+12>>2]<<2)>>2]|0;nA(g,67013)|0;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];ac(g,i);bc(f,+h[d+16>>3]-+h[d>>3]);nA(g,f)|0;bc(f,+h[d+24>>3]-+h[d+8>>3]);nA(g,f)|0;ec(a,195059,c[b+8>>2]|0);l=e;return}function lc(a){a=a|0;var b=0;switch(c[a+64>>2]|0){case 0:{b=AF(c[a>>2]|0)|0;oG(b,c[(c[a+16>>2]|0)+8>>2]|0,67797,0)|0;BF(b);break}case 1:{JL(c[(c[a>>2]|0)+168>>2]|0);break}default:{}}return}function mc(b){b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;d=f;e=c[(c[b+16>>2]|0)+8>>2]|0;if(!(c[46703]|0)){c[46703]=c[4678];c[46704]=57;c[46705]=19;}c[(c[e+64>>2]|0)+8>>2]=186812;nc(e,1);c[d>>2]=0;a[d+4>>0]=(a[(c[e+16>>2]|0)+115>>0]|0)==1&1;g=c[b+64>>2]|0;a[d+5>>0]=((g|0)==0|(g|0)==3)&1;a[d+6>>0]=0;oc(e,b,1,d);l=f;return}function nc(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=c[a>>2]&-9;d=OD(a)|0;while(1){if(!d)break;nc(d,0);d=PD(d)|0;}a:do if(b|0){b=jC(a)|0;while(1){if(!b)break a;c[b>>2]=c[b>>2]&-9;d=XA(a,b)|0;while(1){if(!d)break;c[d>>2]=c[d>>2]&-9;d=ZA(a,d)|0;}b=kC(a,b)|0;}}while(0);return}function oc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q+8|0;o=q;n=(d|0)!=0;if(n){m=Vz(11836,c[4581]|0)|0;YC(a,1,141060,12,0);YC(a,2,141060,12,0);YC(a,0,141060,-12,0);f=pc(a,0,m)|0;j=jC(a)|0;i=0;g=0;while(1){if(!j)break;if(!(Q2(KB(j)|0,108006,7)|0)){k=g;g=qc(m,KB(j)|0)|0;}else {k=g+1|0;g=g+f|0;}c[(RC(j,141060,0)|0)+8>>2]=g;h=XA(a,j)|0;g=i;while(1){if(!h)break;c[(RC(h,141060,0)|0)+8>>2]=g;h=ZA(a,h)|0;g=g+1|0;}j=kC(a,j)|0;i=g;g=k;}Rz(m)|0;}else f=0;m=c[e>>2]|0;c[e>>2]=m+1;rc(b,m);oF(b,97374)|0;sc(a,b,d,e);tc(a,b,e);oF(b,97345)|0;rc(b,c[e>>2]|0);if(n){c[o>>2]=f;uF(b,67016,o);}else {c[p>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67036,p);}vc(a,b,d,uc(a,b,d,e)|0,e);wc(a,b,d,e);oF(b,153599)|0;p=(c[e>>2]|0)+-1|0;c[e>>2]=p;rc(b,p);if(n)oF(b,111008)|0;else oF(b,75357)|0;l=q;return}function pc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if((yC(a)|0)!=(a|0)){e=b+1|0;c[(RC(a,141060,0)|0)+8>>2]=b;if(!(Q2(KB(a)|0,108006,7)|0)){b=KB(a)|0;Ic(d,b,c[(RC(a,141060,0)|0)+8>>2]|0);b=e;}else b=e;}e=OD(a)|0;while(1){if(!e)break;a=pc(e,b,d)|0;e=PD(e)|0;b=a;}return b|0}function qc(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b,512)|0;if(!a)a=-1;else a=c[a+12>>2]|0;return a|0}function rc(a,b){a=a|0;b=b|0;while(1){if((b|0)<=0)break;oF(a,90574)|0;b=b+-1|0;}return}function sc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=l;l=l+32|0;g=h+16|0;f=h+8|0;i=h;j=KB(a)|0;rc(b,c[e>>2]|0);c[i>>2]=zc(j,e)|0;uF(b,67124,i);if(d|0){oF(b,97345)|0;rc(b,c[e>>2]|0);j=(xB(a)|0)!=0;c[f>>2]=j?107652:137308;uF(b,67738,f);rc(b,c[e>>2]|0);j=(zB(a)|0)!=0;c[g>>2]=j?107652:137308;uF(b,67755,g);}l=h;return}function tc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;m=o;i=yC(b)|0;j=c[b>>2]&3;f=LA(i,j,0)|0;a:do if(f|0){k=e+5|0;while(1){if(!f)break a;g=RA(b,f)|0;do if(g|0){h=f+8|0;if(!(a[g>>0]|0)){g=c[h>>2]|0;if((a[g>>0]|0)!=108)break;if(s2(g,108224)|0)break}oF(d,97345)|0;rc(d,c[e>>2]|0);c[m>>2]=zc(c[h>>2]|0,e)|0;uF(d,67174,m);if(a[k>>0]|0?Bc(c[h>>2]|0)|0:0){Cc(RA(b,f)|0,d,e);break}c[n>>2]=zc(RA(b,f)|0,e)|0;uF(d,67181,n);}while(0);f=LA(i,j,f)|0;}}while(0);l=o;return}function uc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;f=OD(a)|0;if(f){oF(b,97345)|0;g=c[e>>2]|0;c[e>>2]=g+1;rc(b,g);g=(d|0)!=0;if(g){oF(b,67098)|0;a=0;d=f;}else {oF(b,67158)|0;rc(b,c[e>>2]|0);a=0;d=f;}while(1){if(!d)break;if(!a)a=1;else oF(b,97345)|0;if(g)Ac(d,b,e);else {c[h>>2]=c[(RC(d,141060,0)|0)+8>>2];uF(b,137395,h);}d=PD(d)|0;}if(g)a=1;else {c[e>>2]=(c[e>>2]|0)+-1;oF(b,153599)|0;rc(b,c[e>>2]|0);oF(b,97340)|0;a=1;}}else a=0;l=i;return a|0}function vc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=jC(a)|0;if(!g){if((d|0)!=0&(e|0)!=0){c[f>>2]=(c[f>>2]|0)+-1;oF(b,153599)|0;rc(b,c[f>>2]|0);oF(b,97340)|0;}}else {oF(b,97345)|0;h=(d|0)!=0;if(h)if(!e){e=c[f>>2]|0;c[f>>2]=e+1;rc(b,e);oF(b,67098)|0;e=0;}else e=0;else {e=c[f>>2]|0;c[f>>2]=e+1;rc(b,e);oF(b,67112)|0;rc(b,c[f>>2]|0);e=0;}while(1){if(!g)break;if(Q2(KB(g)|0,108006,7)|0){do if(e)if(h){oF(b,97345)|0;break}else {oF(b,100999)|0;break}else e=1;while(0);yc(g,b,d,f);}g=kC(a,g)|0;}c[f>>2]=(c[f>>2]|0)+-1;oF(b,153599)|0;rc(b,c[f>>2]|0);oF(b,97340)|0;}return}function wc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=jC(a)|0;a:do if(f|0){while(1){if(!f)break a;if(XA(a,f)|0)break;f=kC(a,f)|0;}oF(b,97345)|0;i=c[e>>2]|0;c[e>>2]=i+1;rc(b,i);oF(b,67048)|0;i=(d|0)!=0;if(i)g=0;else {rc(b,c[e>>2]|0);g=0;}while(1){if(!f)break;h=XA(a,f)|0;while(1){if(!h)break;do if(g)if(i){oF(b,97345)|0;break}else {oF(b,100999)|0;break}else g=1;while(0);xc(h,b,d,e);h=ZA(a,h)|0;}f=kC(a,f)|0;}c[e>>2]=(c[e>>2]|0)+-1;oF(b,153599)|0;rc(b,c[e>>2]|0);oF(b,97340)|0;}while(0);return}function xc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+32|0;i=j+24|0;h=j+16|0;g=j+8|0;f=j;if(!d){c[i>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,137395,i);}else {i=c[e>>2]|0;c[e>>2]=i+1;rc(b,i);oF(b,97374)|0;rc(b,c[e>>2]|0);c[f>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67060,f);rc(b,c[e>>2]|0);c[g>>2]=c[(RC(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0,141060,0)|0)+8>>2];uF(b,67074,g);rc(b,c[e>>2]|0);c[h>>2]=c[(RC(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0,141060,0)|0)+8>>2];uF(b,67087,h);tc(a,b,e);oF(b,153599)|0;i=(c[e>>2]|0)+-1|0;c[e>>2]=i;rc(b,i);oF(b,75357)|0;}l=j;return}function yc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i+16|0;g=i+8|0;f=i;if(!d){c[h>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,137395,h);}else {h=c[e>>2]|0;c[e>>2]=h+1;rc(b,h);oF(b,97374)|0;rc(b,c[e>>2]|0);c[f>>2]=c[(RC(a,141060,0)|0)+8>>2];uF(b,67060,f);rc(b,c[e>>2]|0);c[g>>2]=zc(KB(a)|0,e)|0;uF(b,67124,g);tc(a,b,e);oF(b,153599)|0;h=(c[e>>2]|0)+-1|0;c[e>>2]=h;rc(b,h);oF(b,75357)|0;}l=i;return}function zc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=d+4|0;if(a[g>>0]|0)b=eQ(b)|0;if(!(c[46706]|0)){kA(186824,1024,0);e=b;}else e=b;a:while(1){f=a[e>>0]|0;switch(f<<24>>24){case 0:break a;case 34:{nA(186824,67137)|0;break}case 92:{nA(186824,96616)|0;break}case 47:{nA(186824,67140)|0;break}case 8:{nA(186824,67143)|0;break}case 12:{nA(186824,67146)|0;break}case 10:{nA(186824,67149)|0;break}case 13:{nA(186824,67152)|0;break}case 9:{nA(186824,67155)|0;break}default:{d=c[46707]|0;if(d>>>0>=(c[46708]|0)>>>0){lA(186824,1)|0;d=c[46707]|0;}c[46707]=d+1;a[d>>0]=f;}}e=e+1|0;}d=c[46707]|0;if(d>>>0>=(c[46708]|0)>>>0){lA(186824,1)|0;d=c[46707]|0;}a[d>>0]=0;d=c[46706]|0;c[46707]=d;if(a[g>>0]|0)U1(b);return d|0}function Ac(a,b,c){a=a|0;b=b|0;c=c|0;oc(a,b,0,c);a=OD(a)|0;while(1){if(!a)break;oF(b,97345)|0;Ac(a,b,c);a=PD(a)|0;}return}function Bc(b){b=b|0;var c=0;c=b+1|0;a:do if((a[b>>0]|0)==95){b=(a[c>>0]|0)+-100<<24>>24;switch(((b&255)>>>2|b<<6&255)<<24>>24){case 0:{if(!(s2(c,67695)|0)){b=1;break a}break}case 2:{if(!(s2(c,67701)|0)){b=1;break a}break}case 1:{if(!(s2(c,67708)|0)){b=1;break a}return (s2(c,67722)|0)==0|0}case 4:{if(!(s2(c,67715)|0)){b=1;break a}b=(s2(c,67730)|0)==0&1;break a}default:{b=0;break a}}b=0;}else b=0;while(0);return b|0}function Cc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=l;l=l+16|0;f=i;do if(b|0?a[b>>0]|0:0){h=DH(b)|0;if(!h){c[f>>2]=b;gA(0,67186,f)|0;break}oF(d,153599)|0;g=c[e>>2]|0;c[e>>2]=g+1;rc(d,g);oF(d,67213)|0;g=h+8|0;b=0;f=0;while(1){if((f|0)>=(c[h>>2]|0))break;if(!b)b=1;else oF(d,97345)|0;Dc((c[g>>2]|0)+(f*80|0)|0,d,e);f=f+1|0;}c[e>>2]=(c[e>>2]|0)+-1;oF(d,153599)|0;rc(d,c[e>>2]|0);oF(d,97340)|0;EH(h);}while(0);l=i;return}function Dc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0;A=l;l=l+240|0;y=A+224|0;x=A+216|0;w=A+208|0;v=A+200|0;u=A+192|0;t=A+184|0;s=A+176|0;r=A+152|0;q=A+136|0;p=A+128|0;o=A+112|0;n=A+104|0;m=A+96|0;k=A+88|0;j=A+72|0;i=A+48|0;z=A+40|0;g=A+8|0;f=A;e=c[d>>2]|0;c[d>>2]=e+1;rc(b,e);oF(b,97374)|0;rc(b,c[d>>2]|0);e=c[a>>2]|0;a:do switch(e|0){case 1:case 0:{c[f>>2]=(e|0)==0?69:101;uF(b,67216,f);rc(b,c[d>>2]|0);D=+h[a+16>>3];C=+h[a+24>>3];B=+h[a+32>>3];h[g>>3]=+h[a+8>>3];h[g+8>>3]=D;h[g+16>>3]=C;h[g+24>>3]=B;uF(b,67229,g);break}case 3:case 2:{c[z>>2]=(e|0)==2?80:112;uF(b,67216,z);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 5:case 4:{c[i>>2]=(e|0)==4?66:98;uF(b,67216,i);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 6:{uF(b,67264,A+56|0);rc(b,c[d>>2]|0);Ec(b,a+8|0);break}case 7:{uF(b,67276,A+64|0);rc(b,c[d>>2]|0);D=+h[a+16>>3];h[j>>3]=+h[a+8>>3];h[j+8>>3]=D;uF(b,67288,j);rc(b,c[d>>2]|0);z=c[a+24>>2]|0;c[k>>2]=(z|0)==0?108:(z|0)==1?99:114;uF(b,67310,k);rc(b,c[d>>2]|0);h[m>>3]=+h[a+32>>3];uF(b,67326,m);rc(b,c[d>>2]|0);c[n>>2]=zc(c[a+40>>2]|0,d)|0;uF(b,67343,n);break}case 9:case 8:{c[o>>2]=(e|0)==8?67:99;uF(b,67216,o);rc(b,c[d>>2]|0);uF(b,67357,A+120|0);rc(b,c[d>>2]|0);c[p>>2]=zc(c[a+8>>2]|0,d)|0;uF(b,67374,p);break}case 13:case 14:{c[q>>2]=(e|0)==13?67:99;uF(b,67216,q);rc(b,c[d>>2]|0);switch(c[a+8>>2]|0){case 0:{uF(b,67357,A+144|0);rc(b,c[d>>2]|0);c[r>>2]=zc(c[a+16>>2]|0,d)|0;uF(b,67374,r);break a}case 1:{uF(b,67389,A+160|0);rc(b,c[d>>2]|0);Fc(b,a+16|0,d);break a}default:{uF(b,67408,A+168|0);rc(b,c[d>>2]|0);Gc(b,a+16|0,d);break a}}}case 10:{uF(b,67427,s);rc(b,c[d>>2]|0);h[t>>3]=+h[a+8>>3];uF(b,67439,t);rc(b,c[d>>2]|0);c[u>>2]=zc(c[a+16>>2]|0,d)|0;uF(b,67455,u);break}case 11:{uF(b,67469,v);rc(b,c[d>>2]|0);c[w>>2]=zc(c[a+8>>2]|0,d)|0;uF(b,67481,w);break}case 15:{uF(b,67496,x);rc(b,c[d>>2]|0);c[y>>2]=c[a+8>>2];uF(b,67508,y);break}default:{}}while(0);z=(c[d>>2]|0)+-1|0;c[d>>2]=z;rc(b,z);oF(b,75357)|0;l=A;return}function Ec(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0.0;j=l;l=l+48|0;i=j+32|0;g=j+16|0;f=j+8|0;e=c[b>>2]|0;d=c[b+4>>2]|0;uF(a,67669,j);b=0;while(1){if((b|0)>=(e|0))break;if((b|0)>0)uF(a,100999,f);k=+h[d+(b*24|0)+8>>3];h[g>>3]=+h[d+(b*24|0)>>3];h[g+8>>3]=k;uF(a,67681,g);b=b+1|0;}uF(a,67622,i);l=j;return}function Fc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0;e=l;l=l+32|0;f=e+16|0;i=e;rc(a,c[d>>2]|0);g=+h[b+8>>3];h[i>>3]=+h[b>>3];h[i+8>>3]=g;uF(a,67625,i);rc(a,c[d>>2]|0);g=+h[b+24>>3];h[f>>3]=+h[b+16>>3];h[f+8>>3]=g;uF(a,67647,f);rc(a,c[d>>2]|0);Hc(a,c[b+32>>2]|0,c[b+36>>2]|0,d);l=e;return}function Gc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0;e=l;l=l+48|0;f=e+24|0;j=e;rc(a,c[d>>2]|0);g=+h[b+8>>3];i=+h[b+16>>3];h[j>>3]=+h[b>>3];h[j+8>>3]=g;h[j+16>>3]=i;uF(a,67524,j);rc(a,c[d>>2]|0);i=+h[b+32>>3];g=+h[b+40>>3];h[f>>3]=+h[b+24>>3];h[f+8>>3]=i;h[f+16>>3]=g;uF(a,67552,f);rc(a,c[d>>2]|0);Hc(a,c[b+48>>2]|0,c[b+52>>2]|0,d);l=e;return}function Hc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0.0;m=l;l=l+48|0;k=m+32|0;j=m+16|0;i=m+8|0;uF(a,67580,m);f=0;while(1){if((f|0)>=(b|0))break;if((f|0)>0)uF(a,100999,i);o=+g[d+(f<<3)>>2];n=zc(c[d+(f<<3)+4>>2]|0,e)|0;h[j>>3]=o;c[j+8>>2]=n;uF(a,67591,j);f=f+1|0;}uF(a,67622,k);l=m;return}function Ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;e=nb[c[a>>2]&63](a,b,512)|0;if(e){if((c[e+12>>2]|0)!=(d|0)){c[f>>2]=b;gA(0,67768,f)|0;}}else {f=V1(1,16)|0;c[f+8>>2]=D4(b)|0;c[f+12>>2]=d;nb[c[a>>2]&63](a,f,1)|0;}l=g;return}function Jc(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+8>>2]|0);U1(b);return}function Kc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;oF(a,68623)|0;j=c[c[a+12>>2]>>2]|0;i=c[j+4>>2]|0;h=c[j+8>>2]|0;c[g>>2]=c[j>>2];c[g+4>>2]=i;c[g+8>>2]=h;uF(a,68633,g);c[e>>2]=KB(c[f+8>>2]|0)|0;uF(a,68668,e);c[d>>2]=O(c[a+168>>2]|0,c[a+164>>2]|0)|0;uF(a,68681,d);oF(a,68694)|0;oF(a,68704)|0;oF(a,68712)|0;oF(a,68720)|0;oF(a,68728)|0;oF(a,68736)|0;oF(a,68744)|0;oF(a,68748)|0;oF(a,68753)|0;l=b;return}function Lc(a){a=a|0;oF(a,68604)|0;return}function Mc(a){a=a|0;c[46710]=2;return}function Nc(a){a=a|0;c[46710]=1;return}function Oc(a){a=a|0;c[46710]=2;return}function Pc(a){a=a|0;c[46710]=0;return}function Qc(a){a=a|0;c[46710]=2;return}function Rc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0;p=l;l=l+80|0;o=p;m=c[(c[b+16>>2]|0)+16>>2]|0;n=c[46710]|0;f=c[e+4>>2]|0;g=+h[b+352>>3]*+h[f+16>>3];i=c[b+360>>2]|0?1.5707963267948966:0.0;j=c[e>>2]|0;k=g*.3333333333333333*+((l2(j)|0)>>>0);f=c[f+8>>2]|0;if(!f)f=-1;else f=c[f+20>>2]|0;s=a[e+48>>0]|0;r=+h[d>>3];q=+h[d+8>>3];e=$c(j)|0;c[o>>2]=4;c[o+4>>2]=s<<24>>24==108?0:s<<24>>24==114?2:1;c[o+8>>2]=m;c[o+12>>2]=n;c[o+16>>2]=0;c[o+20>>2]=f;h[o+24>>3]=g;h[o+32>>3]=i;c[o+40>>2]=6;h[o+48>>3]=g;h[o+56>>3]=k;c[o+64>>2]=~~(r+(r>=0.0?.5:-.5));c[o+68>>2]=~~(q+(q+-72.0>=0.0?-71.5:-72.5));c[o+72>>2]=e;uF(b,68549,o);l=p;return}function Sc(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;j=n;i=n+20|0;m=e+32|0;a:do switch(c[m>>2]|0){case 5:{f=0;while(1){g=c[12724+(f<<2)>>2]|0;if((f|0)==8)break a;h=c[e>>2]|0;if((a[g>>0]|0)==(a[h>>0]|0)?(s2(g,h)|0)==0:0){k=10;break a}f=f+1|0;}}case 1:{g=e+1|0;h=e+2|0;f=(_c(i,d[e>>0]|0,d[g>>0]|0,d[h>>0]|0)|0)+32|0;if(!(c[i>>2]|0))k=10;else {o=d[e>>0]|0;i=d[g>>0]|0;k=d[h>>0]|0;c[j>>2]=0;c[j+4>>2]=f;c[j+8>>2]=o;c[j+12>>2]=i;c[j+16>>2]=k;uF(b,68492,j);k=10;}break}default:qa(138394,67889,163,67920);}while(0);if((k|0)==10)c[e>>2]=f;c[m>>2]=6;l=n;return}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+112|0;f=e+8|0;u=e+104|0;t=e;k=c[a+16>>2]|0;s=~~+h[k+152>>3];r=c[k+16>>2]|0;q=c[k+56>>2]|0;p=c[46710]|0;Yc(k,u,t);n=+h[b>>3];k=~~(n+(n>=0.0?.5:-.5));m=+h[b+8>>3];j=~~(m+(m>=0.0?.5:-.5));i=+h[b+16>>3];n=i-n;g=+h[b+24>>3];m=g-m;b=c[u>>2]|0;o=+h[t>>3];c[f>>2]=1;c[f+4>>2]=1;c[f+8>>2]=b;c[f+12>>2]=s;c[f+16>>2]=r;c[f+20>>2]=q;c[f+24>>2]=p;c[f+28>>2]=0;c[f+32>>2]=d|0?20:-1;h[f+40>>3]=o;c[f+48>>2]=0;h[f+56>>3]=0.0;c[f+64>>2]=k;c[f+68>>2]=j;c[f+72>>2]=~~(n+(n>=0.0?.5:-.5));c[f+76>>2]=~~(m+(m>=0.0?.5:-.5));c[f+80>>2]=k;c[f+84>>2]=j;c[f+88>>2]=~~(i+(i>=0.0?.5:-.5));c[f+92>>2]=~~(g+(g>=0.0?.5:-.5));uF(a,68427,f);l=e;return}function Uc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;f=l;l=l+96|0;g=f+8|0;o=f+80|0;p=f;q=c[a+16>>2]|0;n=~~+h[q+152>>3];m=c[q+16>>2]|0;k=c[q+56>>2]|0;j=c[46710]|0;Yc(q,o,p);o=c[o>>2]|0;i=+h[p>>3];c[g>>2]=2;c[g+4>>2]=3;c[g+8>>2]=o;c[g+12>>2]=n;c[g+16>>2]=m;c[g+20>>2]=k;c[g+24>>2]=j;c[g+28>>2]=0;c[g+32>>2]=e|0?20:-1;h[g+40>>3]=i;c[g+48>>2]=0;c[g+52>>2]=0;c[g+56>>2]=0;c[g+60>>2]=0;c[g+64>>2]=0;c[g+68>>2]=d+1;uF(a,68331,g);Zc(a,b,d,1);l=f;return}function Vc(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0;C=l;l=l+192|0;B=C+176|0;z=C+168|0;A=C+104|0;y=C+96|0;i=C+88|0;u=C+180|0;v=C+80|0;w=C+16|0;x=C;f=a+16|0;e=c[f>>2]|0;q=~~+h[e+152>>3];r=c[e+16>>2]|0;s=c[46710]|0;if((d|0)<=3)qa(67882,67889,360,67909);t=T1((d*140|0)+140|0)|0;Yc(e,u,v);if(!g){o=4;j=0;k=-1;}else {o=5;j=c[(c[f>>2]|0)+56>>2]|0;k=20;}E=+h[b>>3];n=w+48|0;h[n>>3]=E;D=+h[b+8>>3];h[w+56>>3]=D;c[i>>2]=~~(E+(E>=0.0?.5:-.5));c[i+4>>2]=~~(D+(D>=0.0?.5:-.5));m=x+8|0;e=t+(m4(t,81099,i)|0)|0;p=1;g=0;while(1){i=g+3|0;if((i|0)>=(d|0))break;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];f=1;while(1){if((f|0)==4){f=1;break}F=f+g|0;h[w+(f<<4)>>3]=+h[b+(F<<4)>>3];h[w+(f<<4)+8>>3]=+h[b+(F<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(x,w,3,+(f|0)*.16666666666666666,0,0);D=+h[x>>3];E=+h[m>>3];c[y>>2]=~~(D+(D>=0.0?.5:-.5));c[y+4>>2]=~~(E+(E>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,y)|0)|0;}p=p+6|0;g=i;}f=c[u>>2]|0;E=+h[v>>3];c[A>>2]=3;c[A+4>>2]=o;c[A+8>>2]=f;c[A+12>>2]=q;c[A+16>>2]=r;c[A+20>>2]=j;c[A+24>>2]=s;c[A+28>>2]=0;c[A+32>>2]=k;h[A+40>>3]=E;c[A+48>>2]=0;c[A+52>>2]=0;c[A+56>>2]=0;c[A+60>>2]=p;uF(a,68382,A);c[z>>2]=t;uF(a,81106,z);U1(t);f=p+-1|0;e=0;while(1){if((e|0)>=(p|0))break;c[B>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,B);e=e+1|0;}oF(a,153599)|0;l=C;return}function Wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;e=l;l=l+96|0;f=e+8|0;m=e+80|0;n=e;o=c[a+16>>2]|0;k=~~+h[o+152>>3];j=c[o+16>>2]|0;i=c[46710]|0;Yc(o,m,n);m=c[m>>2]|0;g=+h[n>>3];c[f>>2]=2;c[f+4>>2]=1;c[f+8>>2]=m;c[f+12>>2]=k;c[f+16>>2]=j;c[f+20>>2]=0;c[f+24>>2]=i;c[f+28>>2]=0;c[f+32>>2]=0;h[f+40>>3]=g;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=d;uF(a,68331,f);Zc(a,b,d,0);l=e;return}function Xc(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,68325,e);l=d;return}function Yc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function Zc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function _c(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[a>>2]=0;k=c[46711]|0;h=195075;g=0;i=-1;while(1){if((g|0)>=(k|0)){l=6;break}m=(b[190680+(g<<1)>>1]|0)-d|0;n=(b[191192+(g<<1)>>1]|0)-e|0;j=(b[191704+(g<<1)>>1]|0)-f|0;j=(O(n,n)|0)+(O(m,m)|0)+(O(j,j)|0)|0;if((j|0)<(h|0))if(!j)break;else {h=j;i=g;}g=g+1|0;}if((l|0)==6){c[46711]=k+1;if((k|0)==256)g=i;else {b[190680+(g<<1)>>1]=d;b[191192+(g<<1)>>1]=e;b[191704+(g<<1)>>1]=f;c[a>>2]=1;}}return g|0}function $c(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46712]|0;if(!d){c[46713]=64;d=T1(64)|0;c[46712]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46713]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46713]=d;d=W1(c[46712]|0,d)|0;c[46712]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46712]|0}function ad(b){b=b|0;var d=0,e=0,f=0;e=c[b+16>>2]|0;switch(c[b+64>>2]|0){case 0:{oF(b,68220)|0;d=e+208|0;e=c[d>>2]|0;if(e|0?a[e>>0]|0:0){oF(b,68234)|0;oF(b,FK(c[d>>2]|0)|0)|0;oF(b,153599)|0;}break}case 1:{d=e+208|0;f=c[d>>2]|0;if(f|0?a[f>>0]|0:0){oF(b,68234)|0;oF(b,FK(c[d>>2]|0)|0)|0;oF(b,102604)|0;oF(b,FK(KB(c[e+8>>2]|0)|0)|0)|0;oF(b,153599)|0;}break}case 3:{f=FK(KB(c[e+8>>2]|0)|0)|0;oF(b,68243)|0;oF(b,f)|0;oF(b,68253)|0;oF(b,f)|0;oF(b,68208)|0;break}default:{}}return}function bd(a){a=a|0;var b=0;b=c[a+16>>2]|0;switch(c[a+64>>2]|0){case 2:{dd(a,c[b+264>>2]|0,c[b+272>>2]|0,c[b+268>>2]|0,c[b+208>>2]|0,c[b+228>>2]|0,c[b+244>>2]|0,c[b+212>>2]|0);break}case 3:{dd(a,c[b+264>>2]|0,c[b+272>>2]|0,c[b+268>>2]|0,c[b+208>>2]|0,c[b+228>>2]|0,c[b+244>>2]|0,c[b+212>>2]|0);oF(a,68212)|0;break}default:{}}return}function cd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=c[a+16>>2]|0;dd(a,c[g+264>>2]|0,c[g+272>>2]|0,c[g+268>>2]|0,b,d,e,f);return}function dd(b,d,e,f,g,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0;y=l;l=l+128|0;x=y+120|0;u=y+112|0;t=y+96|0;s=y+80|0;r=y+56|0;w=y+48|0;q=y+40|0;v=y+24|0;p=y;a:do if((e|0)!=0&(f|0)!=0){m=f+10|0;if((c[46714]|0)<(f|0)){c[46714]=m;o=W1(c[46715]|0,m<<3)|0;c[46715]=o;}else o=c[46715]|0;m=0;while(1){if((m|0)>=(f|0))break;z=+h[e+(m<<4)>>3];c[o+(m<<3)>>2]=~~(z+(z>=0.0?.5:-.5));z=+h[e+(m<<4)+8>>3];c[o+(m<<3)+4>>2]=~~(z+(z>=0.0?.5:-.5));m=m+1|0;}n=b+64|0;m=c[n>>2]|0;e=(g|0)!=0;if(e&(m|0)==0){if(!(a[g>>0]|0))break;switch(d|0){case 0:{v=c[o>>2]|0;w=c[o+12>>2]|0;x=c[o+8>>2]|0;f=c[o+4>>2]|0;c[p>>2]=g;c[p+4>>2]=v;c[p+8>>2]=w;c[p+12>>2]=x;c[p+16>>2]=f;uF(b,67954,p);break a}case 1:{w=c[o>>2]|0;x=c[o+4>>2]|0;f=(c[o+8>>2]|0)-w|0;c[v>>2]=g;c[v+4>>2]=w;c[v+8>>2]=x;c[v+12>>2]=f;uF(b,67975,v);break a}case 2:{c[q>>2]=g;uF(b,67995,q);m=0;while(1){if((m|0)>=(f|0))break;v=c[46715]|0;x=c[v+(m<<3)+4>>2]|0;c[w>>2]=c[v+(m<<3)>>2];c[w+4>>2]=x;uF(b,68003,w);m=m+1|0;}oF(b,153599)|0;break a}default:qa(138394,68010,63,68030);}}if(e&(m|0)==1){if(!(a[g>>0]|0))break;if(!d){w=c[o+12>>2]|0;x=c[o+8>>2]|0;f=c[o+4>>2]|0;c[r>>2]=c[o>>2];c[r+4>>2]=w;c[r+8>>2]=x;c[r+12>>2]=f;c[r+16>>2]=g;c[r+20>>2]=i;uF(b,68047,r);break}else qa(138394,68010,75,68030);}if((m&-2|0)==2){switch(d|0){case 1:{oF(b,68080)|0;break}case 0:{oF(b,68101)|0;break}case 2:{oF(b,68120)|0;break}default:qa(138394,68010,91,68030);}if(k|0?a[k>>0]|0:0){oF(b,73600)|0;oF(b,IK(k)|0)|0;oF(b,98744)|0;}if(e?a[g>>0]|0:0){oF(b,68139)|0;oF(b,IK(g)|0)|0;oF(b,98744)|0;}if(j|0?a[j>>0]|0:0){oF(b,74559)|0;oF(b,FK(j)|0)|0;oF(b,98744)|0;}if(i|0?a[i>>0]|0:0){oF(b,68147)|0;oF(b,FK(i)|0)|0;oF(b,98744)|0;}oF(b,68156)|0;oF(b,68164)|0;b:do switch(d|0){case 1:{f=c[46715]|0;w=c[f>>2]|0;x=c[f+4>>2]|0;f=(c[f+8>>2]|0)-w|0;c[s>>2]=w;c[s+4>>2]=x;c[s+8>>2]=f;uF(b,68174,s);break}case 0:{v=c[46715]|0;w=c[v+12>>2]|0;x=c[v+8>>2]|0;f=c[v+4>>2]|0;c[t>>2]=c[v>>2];c[t+4>>2]=w;c[t+8>>2]=x;c[t+12>>2]=f;uF(b,68183,t);break}case 2:{w=c[46715]|0;m=c[w+4>>2]|0;c[u>>2]=c[w>>2];c[u+4>>2]=m;uF(b,68195,u);m=1;while(1){if((m|0)>=(f|0))break b;v=c[46715]|0;w=c[v+(m<<3)+4>>2]|0;c[x>>2]=c[v+(m<<3)>>2];c[x+4>>2]=w;uF(b,68201,x);m=m+1|0;}}default:{}}while(0);if((c[n>>2]|0)==3){oF(b,73424)|0;break}else {oF(b,68208)|0;break}}}while(0);l=y;return}function ed(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;oF(a,68623)|0;j=c[c[a+12>>2]>>2]|0;i=c[j+4>>2]|0;h=c[j+8>>2]|0;c[g>>2]=c[j>>2];c[g+4>>2]=i;c[g+8>>2]=h;uF(a,68633,g);c[e>>2]=KB(c[f+8>>2]|0)|0;uF(a,68668,e);c[d>>2]=O(c[a+168>>2]|0,c[a+164>>2]|0)|0;uF(a,68681,d);oF(a,68694)|0;oF(a,68704)|0;oF(a,68712)|0;oF(a,68720)|0;oF(a,68728)|0;oF(a,68736)|0;oF(a,68744)|0;oF(a,68748)|0;oF(a,68753)|0;l=b;return}function fd(a){a=a|0;oF(a,68604)|0;return}function gd(a){a=a|0;c[46716]=2;return}function hd(a){a=a|0;c[46716]=1;return}function id(a){a=a|0;c[46716]=2;return}function jd(a){a=a|0;c[46716]=0;return}function kd(a){a=a|0;c[46716]=2;return}function ld(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0;n=l;l=l+80|0;m=n;j=c[(c[b+16>>2]|0)+16>>2]|0;k=c[46716]|0;f=c[e+4>>2]|0;g=+h[b+352>>3]*+h[f+16>>3];i=c[b+360>>2]|0?1.5707963267948966:0.0;f=c[f+8>>2]|0;if(!f)f=-1;else f=c[f+20>>2]|0;q=a[e+48>>0]|0;p=+h[d>>3];o=+h[d+8>>3];e=vd(c[e>>2]|0)|0;c[m>>2]=4;c[m+4>>2]=q<<24>>24==108?0:q<<24>>24==114?2:1;c[m+8>>2]=j;c[m+12>>2]=k;c[m+16>>2]=0;c[m+20>>2]=f;h[m+24>>3]=g;h[m+32>>3]=i;c[m+40>>2]=4;h[m+48>>3]=0.0;h[m+56>>3]=0.0;c[m+64>>2]=~~(p+(p>=0.0?.5:-.5));c[m+68>>2]=~~(o+(o>=0.0?.5:-.5));c[m+72>>2]=e;uF(b,68549,m);l=n;return}function md(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;j=n;i=n+20|0;m=e+32|0;a:do switch(c[m>>2]|0){case 5:{f=0;while(1){g=c[12724+(f<<2)>>2]|0;if((f|0)==8)break a;h=c[e>>2]|0;if((a[g>>0]|0)==(a[h>>0]|0)?(s2(g,h)|0)==0:0){k=10;break a}f=f+1|0;}}case 1:{g=e+1|0;h=e+2|0;f=(ud(i,d[e>>0]|0,d[g>>0]|0,d[h>>0]|0)|0)+32|0;if(!(c[i>>2]|0))k=10;else {o=d[e>>0]|0;i=d[g>>0]|0;k=d[h>>0]|0;c[j>>2]=0;c[j+4>>2]=f;c[j+8>>2]=o;c[j+12>>2]=i;c[j+16>>2]=k;uF(b,68492,j);k=10;}break}case 0:{f=0;k=10;break}default:qa(138394,68513,168,68532);}while(0);if((k|0)==10)c[e>>2]=f;c[m>>2]=6;l=n;return}function nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0;e=l;l=l+112|0;f=e+8|0;u=e+104|0;t=e;k=c[a+16>>2]|0;s=~~+h[k+152>>3];r=c[k+16>>2]|0;q=c[k+56>>2]|0;p=c[46716]|0;sd(k,u,t);n=+h[b>>3];k=~~(n+(n>=0.0?.5:-.5));m=+h[b+8>>3];j=~~(m+(m>=0.0?.5:-.5));i=+h[b+16>>3];n=i-n;g=+h[b+24>>3];m=g-m;b=c[u>>2]|0;o=+h[t>>3];c[f>>2]=1;c[f+4>>2]=1;c[f+8>>2]=b;c[f+12>>2]=s;c[f+16>>2]=r;c[f+20>>2]=q;c[f+24>>2]=p;c[f+28>>2]=0;c[f+32>>2]=d|0?20:-1;h[f+40>>3]=o;c[f+48>>2]=0;h[f+56>>3]=0.0;c[f+64>>2]=k;c[f+68>>2]=j;c[f+72>>2]=~~(n+(n>=0.0?.5:-.5));c[f+76>>2]=~~(m+(m>=0.0?.5:-.5));c[f+80>>2]=k;c[f+84>>2]=j;c[f+88>>2]=~~(i+(i>=0.0?.5:-.5));c[f+92>>2]=~~(g+(g>=0.0?.5:-.5));uF(a,68427,f);l=e;return}function od(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;f=l;l=l+96|0;g=f+8|0;o=f+80|0;p=f;q=c[a+16>>2]|0;n=~~+h[q+152>>3];m=c[q+16>>2]|0;k=c[q+56>>2]|0;j=c[46716]|0;sd(q,o,p);o=c[o>>2]|0;i=+h[p>>3];c[g>>2]=2;c[g+4>>2]=3;c[g+8>>2]=o;c[g+12>>2]=n;c[g+16>>2]=m;c[g+20>>2]=k;c[g+24>>2]=j;c[g+28>>2]=0;c[g+32>>2]=e|0?20:-1;h[g+40>>3]=i;c[g+48>>2]=0;c[g+52>>2]=0;c[g+56>>2]=0;c[g+60>>2]=0;c[g+64>>2]=0;c[g+68>>2]=d+1;uF(a,68331,g);td(a,b,d,1);l=f;return}function pd(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0;C=l;l=l+192|0;B=C+176|0;z=C+168|0;A=C+104|0;y=C+96|0;f=C+88|0;u=C+180|0;v=C+80|0;w=C+16|0;x=C;e=a+16|0;p=c[e>>2]|0;q=~~+h[p+152>>3];r=c[p+16>>2]|0;s=c[46716]|0;t=T1((d*140|0)+140|0)|0;sd(p,u,v);if(!g){o=4;j=0;k=-1;}else {o=5;j=c[(c[e>>2]|0)+56>>2]|0;k=20;}E=+h[b>>3];n=w+48|0;h[n>>3]=E;D=+h[b+8>>3];h[w+56>>3]=D;c[f>>2]=~~(E+(E>=0.0?.5:-.5));c[f+4>>2]=~~(D+(D>=0.0?.5:-.5));m=x+8|0;e=t+(m4(t,81099,f)|0)|0;p=1;g=0;while(1){i=g+3|0;if((i|0)>=(d|0))break;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];f=1;while(1){if((f|0)==4){f=1;break}F=f+g|0;h[w+(f<<4)>>3]=+h[b+(F<<4)>>3];h[w+(f<<4)+8>>3]=+h[b+(F<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(x,w,3,+(f|0)*.16666666666666666,0,0);D=+h[x>>3];E=+h[m>>3];c[y>>2]=~~(D+(D>=0.0?.5:-.5));c[y+4>>2]=~~(E+(E>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,y)|0)|0;}p=p+6|0;g=i;}f=c[u>>2]|0;E=+h[v>>3];c[A>>2]=3;c[A+4>>2]=o;c[A+8>>2]=f;c[A+12>>2]=q;c[A+16>>2]=r;c[A+20>>2]=j;c[A+24>>2]=s;c[A+28>>2]=0;c[A+32>>2]=k;h[A+40>>3]=E;c[A+48>>2]=0;c[A+52>>2]=0;c[A+56>>2]=0;c[A+60>>2]=p;uF(a,68382,A);c[z>>2]=t;uF(a,81106,z);U1(t);f=p+-1|0;e=0;while(1){if((e|0)>=(p|0))break;c[B>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,B);e=e+1|0;}oF(a,153599)|0;l=C;return}function qd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;e=l;l=l+96|0;f=e+8|0;m=e+80|0;n=e;o=c[a+16>>2]|0;k=~~+h[o+152>>3];j=c[o+16>>2]|0;i=c[46716]|0;sd(o,m,n);m=c[m>>2]|0;g=+h[n>>3];c[f>>2]=2;c[f+4>>2]=1;c[f+8>>2]=m;c[f+12>>2]=k;c[f+16>>2]=j;c[f+20>>2]=0;c[f+24>>2]=i;c[f+28>>2]=0;c[f+32>>2]=0;h[f+40>>3]=g;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=d;uF(a,68331,f);td(a,b,d,0);l=e;return}function rd(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,68325,e);l=d;return}function sd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function td(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function ud(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[a>>2]=0;k=c[46717]|0;h=195075;g=0;i=-1;while(1){if((g|0)>=(k|0)){l=6;break}m=(b[192216+(g<<1)>>1]|0)-d|0;n=(b[192728+(g<<1)>>1]|0)-e|0;j=(b[193240+(g<<1)>>1]|0)-f|0;j=(O(n,n)|0)+(O(m,m)|0)+(O(j,j)|0)|0;if((j|0)<(h|0))if(!j)break;else {h=j;i=g;}g=g+1|0;}if((l|0)==6){c[46717]=k+1;if((k|0)==256)g=i;else {b[192216+(g<<1)>>1]=d;b[192728+(g<<1)>>1]=e;b[193240+(g<<1)>>1]=f;c[a>>2]=1;}}return g|0}function vd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46718]|0;if(!d){c[46719]=64;d=T1(64)|0;c[46718]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46719]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46719]=d;d=W1(c[46718]|0,d)|0;c[46718]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46718]|0}function wd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=l;l=l+16|0;b=d;oF(a,73332)|0;if((c[a+64>>2]|0)==2)oF(a,73347)|0;else oF(a,153599)|0;g=c[c[a+12>>2]>>2]|0;f=c[g+4>>2]|0;e=c[g+8>>2]|0;c[b>>2]=c[g>>2];c[b+4>>2]=f;c[b+8>>2]=e;uF(a,73358,b);l=d;return}function xd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g+8|0;e=g;oF(a,73286)|0;d=a+64|0;b=a+12|0;if((c[d>>2]|0)!=2){c[e>>2]=c[(c[b>>2]|0)+28>>2];uF(a,73297,e);}if((c[(c[b>>2]|0)+20>>2]|0)==0?(c[d>>2]|0)!=2:0){b=c[a+476>>2]|0;d=c[a+480>>2]|0;e=c[a+484>>2]|0;c[f>>2]=c[a+472>>2];c[f+4>>2]=b;c[f+8>>2]=d;c[f+12>>2]=e;uF(a,69666,f);}oF(a,73312)|0;oF(a,73325)|0;l=g;return}function yd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;k=l;l=l+32|0;j=k+24|0;f=k+8|0;i=k;g=c[b+16>>2]|0;a[193768]=0;e=b+12|0;h=g+8|0;if(!(c[(c[e>>2]|0)+28>>2]|0)){c[i>>2]=KB(c[h>>2]|0)|0;uF(b,69597,i);d=b+64|0;if((c[d>>2]|0)==2)oF(b,69630)|0;else oF(b,69612)|0;do if(!(c[(c[e>>2]|0)+20>>2]|0))if((c[d>>2]|0)==2){n=c[b+460>>2]|0;m=c[b+464>>2]|0;d=c[b+468>>2]|0;c[f>>2]=c[b+456>>2];c[f+4>>2]=n;c[f+8>>2]=m;c[f+12>>2]=d;uF(b,69666,f);break}else {oF(b,69642)|0;break}while(0);oF(b,69696)|0;yM(b,c[(c[e>>2]|0)+24>>2]|0,13e3);AM(b);d=c[(c[e>>2]|0)+20>>2]|0;if(d|0){c[i>>2]=c[d>>2];c[i+4>>2]=0;yM(b,0,i);}}c[46720]=(a[(c[(c[h>>2]|0)+16>>2]|0)+115>>0]|0)==1?1:-1;if(!(a[193768]|0)){oF(b,69716)|0;a[193768]=1;}d=c[g+208>>2]|0;if(d|0){c[j>>2]=BM(d,c[46720]|0)|0;uF(b,69729,j);}l=k;return}function zd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;b=l;l=l+16|0;f=b;c[f>>2]=d;c[f+4>>2]=e;uF(a,69581,f);l=b;return}function Ad(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0.0,w=0.0;s=l;l=l+144|0;r=s+128|0;q=s+112|0;p=s+72|0;o=s+56|0;n=s+40|0;m=s+32|0;e=s+24|0;b=s+8|0;d=s;f=c[a+456>>2]|0;j=c[a+460>>2]|0;g=c[a+464>>2]|0;i=c[a+468>>2]|0;k=a+12|0;t=(c[(c[k>>2]|0)+28>>2]|0)+1|0;c[d>>2]=t;c[d+4>>2]=t;uF(a,69208,d);if(!(c[(c[k>>2]|0)+20>>2]|0)){c[b>>2]=f;c[b+4>>2]=j;c[b+8>>2]=g;c[b+12>>2]=i;uF(a,69225,b);}d=a+360|0;c[e>>2]=c[d>>2]|0?69259:69269;uF(a,69278,e);b=a+64|0;if((c[b>>2]|0)==1){c[m>>2]=g;c[m+4>>2]=i;uF(a,69303,m);}m=c[a+200>>2]|0;t=c[a+204>>2]|0;c[n>>2]=c[a+196>>2];c[n+4>>2]=m;c[n+8>>2]=t;uF(a,69342,n);if(!(c[(c[k>>2]|0)+20>>2]|0)){c[o>>2]=f;c[o+4>>2]=j;c[o+8>>2]=g-f;c[o+12>>2]=i-j;uF(a,69362,o);}w=+h[a+496>>3];t=c[d>>2]|0;v=+h[a+504>>3];u=+h[a+512>>3];h[p>>3]=+h[a+488>>3];h[p+8>>3]=w;c[p+16>>2]=t;h[p+24>>3]=v;h[p+32>>3]=u;uF(a,69402,p);if((c[b>>2]|0)==1){if((g|0)>14399|(i|0)>14399){t=c[(c[k>>2]|0)+16>>2]|0;c[q>>2]=g;c[q+4>>2]=i;c[q+8>>2]=14400;ub[t&63](69445,q);}c[r>>2]=f;c[r+4>>2]=j;c[r+8>>2]=g;c[r+12>>2]=i;uF(a,69540,r);}l=s;return}function Bd(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=a+12|0;if(c[(c[b>>2]|0)+20>>2]|0){oF(a,69132)|0;yM(a,0,(c[(c[b>>2]|0)+20>>2]|0)+4|0);}oF(a,69149)|0;oF(a,69176)|0;c[d>>2]=c[(c[b>>2]|0)+28>>2];uF(a,69191,d);l=e;return}function Cd(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,69125,d);oF(a,69118)|0;l=b;return}function Dd(a){a=a|0;oF(a,84552)|0;return}function Ed(a){a=a|0;oF(a,69118)|0;return}function Fd(a){a=a|0;oF(a,84552)|0;return}function Gd(a){a=a|0;oF(a,69118)|0;return}function Hd(a){a=a|0;oF(a,84552)|0;return}function Id(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;e=l;l=l+16|0;d=e;if(b|0?(g=(c[a+16>>2]|0)+272|0,c[g>>2]|0):0){oF(a,69014)|0;yF(a,c[g>>2]|0,2);oF(a,69025)|0;c[d>>2]=BM(b,c[46720]|0)|0;uF(a,69029,d);}l=e;return}function Jd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+32|0;j=m+8|0;k=m;f=c[b+16>>2]|0;if(!(+h[f+40>>3]<.5)){Qd(b,f+16|0);i=e+4|0;vF(b,+h[(c[i>>2]|0)+16>>3]);c[j>>2]=c[c[i>>2]>>2];uF(b,68973,j);i=BM(c[e>>2]|0,c[46720]|0)|0;switch(a[e+48>>0]|0){case 114:{n=e+32|0;f=n;g=+h[n>>3];break}case 108:{f=e+32|0;g=0.0;break}default:{n=e+32|0;f=n;g=+h[n>>3]*.5;}}h[d>>3]=+h[d>>3]-g;n=d+8|0;h[n>>3]=+h[n>>3]+ +h[e+24>>3];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];xF(b,j);oF(b,68988)|0;vF(b,+h[f>>3]);c[k>>2]=i;uF(b,68997,k);}l=m;return}function Kd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+32|0;f=g;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];h[f+16>>3]=+h[b+16>>3]-+h[b>>3];h[f+24>>3]=+h[b+24>>3]-+h[b+8>>3];b=a+16|0;if(d|0?(e=c[b>>2]|0,+h[e+80>>3]>.5):0){Qd(a,e+56|0);yF(a,f,2);oF(a,68931)|0;}if(+h[(c[b>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[b>>2]|0)+16|0);yF(a,f,2);oF(a,68951)|0;}l=g;return}function Ld(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+16|0;i=j;g=a+16|0;if(e|0?(f=c[g>>2]|0,+h[f+80>>3]>.5):0){Qd(a,f+56|0);oF(a,68852)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];xF(a,i);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;f=b+(e<<4)|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];xF(a,i);oF(a,68870)|0;e=e+1|0;}oF(a,68897)|0;}if(+h[(c[g>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[g>>2]|0)+16|0);oF(a,68852)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];xF(a,i);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;g=b+(e<<4)|0;c[i>>2]=c[g>>2];c[i+4>>2]=c[g+4>>2];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];xF(a,i);oF(a,68870)|0;e=e+1|0;}oF(a,68913)|0;}l=j;return}function Md(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0;k=l;l=l+16|0;f=k;i=a+16|0;if(g|0?(j=c[i>>2]|0,+h[j+80>>3]>.5):0){Qd(a,j+56|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;yF(a,b+(e<<4)|0,3);oF(a,68887)|0;e=e+3|0;}oF(a,68897)|0;}if(+h[(c[i>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[i>>2]|0)+16|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;yF(a,b+(e<<4)|0,3);oF(a,68887)|0;e=e+3|0;}oF(a,68879)|0;}l=k;return}function Nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;g=l;l=l+16|0;f=g;e=a+16|0;if(+h[(c[e>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[e>>2]|0)+16|0);oF(a,68852)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];xF(a,f);oF(a,68861)|0;e=1;while(1){if((e|0)>=(d|0))break;i=b+(e<<4)|0;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];xF(a,f);oF(a,68870)|0;e=e+1|0;}oF(a,68879)|0;}l=g;return}function Od(a,b){a=a|0;b=b|0;oF(a,68849)|0;oF(a,b)|0;oF(a,153599)|0;return}function Pd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;g=n+16|0;m=n+8|0;k=n;i=a+16|0;if(f|0?(j=c[i>>2]|0,+h[j+80>>3]>.5):0){Qd(a,j+56|0);oF(a,84447)|0;yF(a,d,e);oF(a,102604)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];xF(a,g);c[k>>2]=e;c[k+4>>2]=b;uF(a,68766,k);}if(+h[(c[i>>2]|0)+40>>3]>.5){Rd(a);Qd(a,(c[i>>2]|0)+16|0);oF(a,84447)|0;yF(a,d,e);oF(a,102604)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];xF(a,g);c[m>>2]=e;c[m+4>>2]=b;uF(a,68782,m);}l=n;return}function Qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;f=l;l=l+32|0;e=f;if(b|0){switch(c[(c[a+16>>2]|0)+4>>2]|0){case 1:case 0:{d=111494;break}case 2:{d=111481;break}case 3:{d=111450;break}default:d=68818;}i=+h[b+8>>3];g=+h[b+16>>3];h[e>>3]=+h[b>>3];h[e+8>>3]=i;h[e+16>>3]=g;c[e+24>>2]=d;uF(a,68825,e);}l=f;return}function Rd(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;k=m+8|0;j=m;g=b+16|0;i=c[g>>2]|0;d=c[i+160>>2]|0;vF(b,+h[i+152>>3]);oF(b,68799)|0;while(1){if(!d)break;i=d+4|0;f=c[d>>2]|0;if(!f)break;if(!(s2(f,111088)|0)){d=i;continue}else e=f;while(1){d=e+1|0;if(!(a[e>>0]|0))break;else e=d;}a:while(1){if(!(a[d>>0]|0))break;c[j>>2]=d;uF(b,68814,j);while(1){e=d+1|0;if(!(a[d>>0]|0)){d=e;continue a}else d=e;}}if(!(s2(f,134335)|0))h[(c[g>>2]|0)+152>>3]=0.0;c[k>>2]=f;uF(b,96670,k);d=i;}l=m;return}function Sd(b){b=b|0;var d=0;oF(b,74838)|0;d=QA(c[(c[b>>2]|0)+168>>2]|0,74894)|0;if(d|0?a[d>>0]|0:0){oF(b,74905)|0;oF(b,d)|0;oF(b,74929)|0;}oF(b,74950)|0;oF(b,74998)|0;oF(b,75052)|0;d=b+12|0;oF(b,FK(c[c[c[d>>2]>>2]>>2]|0)|0)|0;oF(b,78181)|0;oF(b,FK(c[(c[c[d>>2]>>2]|0)+4>>2]|0)|0)|0;oF(b,78191)|0;oF(b,FK(c[(c[c[d>>2]>>2]|0)+8>>2]|0)|0)|0;oF(b,75434)|0;oF(b,75458)|0;return}function Td(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0;i=l;l=l+48|0;g=i+16|0;f=i+8|0;e=i;d=c[b+16>>2]|0;oF(b,74673)|0;d=d+8|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,75397)|0;oF(b,FK(KB(c[d>>2]|0)|0)|0)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,74678,e);e=c[b+452>>2]|0;c[f>>2]=c[b+448>>2];c[f+4>>2]=e;uF(b,74694,f);m=+h[b+392>>3];k=+h[b+400>>3];j=+h[b+408>>3];h[g>>3]=+h[b+384>>3];h[g+8>>3]=m;h[g+16>>3]=k;h[g+24>>3]=j;uF(b,74727,g);oF(b,74758)|0;oF(b,74794)|0;oF(b,76388)|0;l=i;return}function Ud(a){a=a|0;oF(a,74665)|0;return}function Vd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;qe(a,b,0,101510,c[(c[a+16>>2]|0)+8>>2]|0);oF(a,76388)|0;return}function Wd(a){a=a|0;oF(a,74513)|0;return}function Xd(b){b=b|0;var d=0,e=0,f=0,g=0;e=l;l=l+16|0;f=e;g=c[b+16>>2]|0;d=g+8|0;qe(b,c[g+212>>2]|0,0,111494,c[d>>2]|0);oF(b,74617)|0;vF(b,+h[b+488>>3]);oF(b,102604)|0;vF(b,+h[b+496>>3]);c[f>>2]=0-(c[b+360>>2]|0);uF(b,74636,f);vF(b,+h[b+504>>3]);oF(b,102604)|0;vF(b,-+h[b+512>>3]);oF(b,74660)|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,74569)|0;oF(b,FK(KB(c[d>>2]|0)|0)|0)|0;oF(b,74577)|0;}l=e;return}function Yd(a){a=a|0;oF(a,74513)|0;return}function Zd(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=d+8|0;qe(a,c[d+212>>2]|0,0,108006,c[b>>2]|0);oF(a,76388)|0;oF(a,74569)|0;oF(a,FK(KB(c[b>>2]|0)|0)|0)|0;oF(a,74577)|0;return}function _d(a){a=a|0;oF(a,74513)|0;return}function $d(a){a=a|0;var b=0,d=0,e=0;d=c[a+16>>2]|0;b=c[a+160>>2]|0;if((b|0)>1)b=c[(c[(c[a>>2]|0)+308>>2]|0)+(b<<2)>>2]|0;else b=0;e=d+8|0;qe(a,c[d+212>>2]|0,b,111481,c[e>>2]|0);oF(a,76388)|0;oF(a,74569)|0;oF(a,FK(KB(c[e>>2]|0)|0)|0)|0;oF(a,74577)|0;return}function ae(a){a=a|0;oF(a,74513)|0;return}function be(a){a=a|0;var b=0,d=0;d=c[a+16>>2]|0;b=d+8|0;qe(a,c[d+212>>2]|0,0,111450,c[b>>2]|0);oF(a,76388)|0;oF(a,74569)|0;b=EK(102095,c[b>>2]|0)|0;oF(a,FK(b)|0)|0;U1(b);oF(a,74577)|0;return}function ce(a){a=a|0;oF(a,74513)|0;return}function de(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;oF(b,74519)|0;if(f|0){oF(b,74522)|0;oF(b,FK(f)|0)|0;oF(b,98744)|0;}oF(b,74412)|0;oF(b,76349)|0;if(c|0?a[c>>0]|0:0){oF(b,74530)|0;oF(b,c)|0;oF(b,98744)|0;}if(d|0?a[d>>0]|0:0){oF(b,74544)|0;oF(b,GK(d,1)|0)|0;oF(b,98744)|0;}if(e|0?a[e>>0]|0:0){oF(b,74559)|0;oF(b,FK(e)|0)|0;oF(b,98744)|0;}oF(b,76388)|0;return}function ee(a){a=a|0;oF(a,76343)|0;oF(a,74513)|0;return}function fe(e,f,g){e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+176|0;L=M+160|0;K=M+152|0;F=M+136|0;J=M+128|0;E=M+120|0;D=M+112|0;C=M+104|0;B=M+96|0;A=M+88|0;y=M+80|0;w=M+72|0;v=M+64|0;u=M+56|0;t=M+48|0;i=M+40|0;q=M+32|0;s=M+24|0;r=M+16|0;p=M+8|0;o=M;I=c[e+16>>2]|0;oF(e,74044)|0;switch(a[g+48>>0]|0){case 108:{oF(e,74050)|0;break}case 114:{oF(e,74071)|0;break}default:oF(e,74090)|0;}H=f+8|0;G=+h[H>>3]+ +h[g+24>>3];h[H>>3]=G;H=I+260|0;if(!(b[H>>1]&512)){oF(e,74112)|0;vF(e,+h[f>>3]);oF(e,74117)|0;vF(e,-G);oF(e,98744)|0;}x=g+4|0;f=c[x>>2]|0;n=c[f+8>>2]|0;if(n){switch(c[(c[(c[(c[e>>2]|0)+168>>2]|0)+16>>2]|0)+244>>2]|0){case 1:{m=n;f=n+16|0;i=n+8|0;break}case 2:{m=n+24|0;f=n+32|0;i=n+28|0;break}default:{m=n+4|0;f=n+16|0;i=n+8|0;}}j=c[f>>2]|0;f=c[i>>2]|0;k=c[n+12>>2]|0;c[o>>2]=c[m>>2];uF(e,74123,o);i=c[n+24>>2]|0;if(i|0){c[p>>2]=i;uF(e,74140,p);}oF(e,98744)|0;if(f|0){c[r>>2]=f;uF(e,74144,r);}if(k|0){c[s>>2]=k;uF(e,74162,s);}if(!j)j=0;else {c[q>>2]=j;uF(e,74181,q);}}else {c[i>>2]=c[f>>2];uF(e,74198,i);j=0;f=0;}i=c[x>>2]|0;if(i|0?(z=c[i+24>>2]|0,z&127|0):0){if(!((f|0)!=0|(z&1|0)==0))uF(e,74216,t);if(!((j|0)!=0|(z&2|0)==0))uF(e,74236,u);if(z&100|0){uF(e,74257,v);if(!(z&4))f=0;else {uF(e,105986,w);f=1;}if(z&64){c[y>>2]=f|0?100999:195059;uF(e,74276,y);f=1;}if(z&32|0){c[A>>2]=f|0?100999:195059;uF(e,74287,A);}uF(e,98744,B);}if(z&8|0)uF(e,74302,C);if(z&16|0)uF(e,74326,D);}h[E>>3]=+h[(c[x>>2]|0)+16>>3];uF(e,74348,E);f=I+16|0;switch(c[I+48>>2]|0){case 5:{f=c[f>>2]|0;if(c3(f,137314)|0){c[J>>2]=f;uF(e,74366,J);}break}case 1:{E=d[f+1>>0]|0;J=d[f+2>>0]|0;c[F>>2]=d[f>>0];c[F+4>>2]=E;c[F+8>>2]=J;uF(e,74377,F);break}default:qa(138394,73558,486,74399);}oF(e,74412)|0;if(b[H>>1]&512){c[K>>2]=FK(c[I+212>>2]|0)|0;uF(e,74414,K);oF(e,74463)|0;vF(e,-G);oF(e,74481)|0;}oF(e,GK(c[g>>2]|0,1)|0)|0;if(b[H>>1]&512)uF(e,74484,L);oF(e,74504)|0;l=M;return}function ge(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;switch(c|0){case 2:{d=ne(a,b,2)|0;break}case 3:{d=oe(a)|0;break}default:d=0;}oF(a,74008)|0;le(a,c,d);oF(a,74017)|0;vF(a,+h[b>>3]);oF(a,74023)|0;c=b+8|0;vF(a,-+h[c>>3]);oF(a,74030)|0;vF(a,+h[b+16>>3]-+h[b>>3]);oF(a,74037)|0;vF(a,+h[b+24>>3]-+h[c>>3]);oF(a,73424)|0;return}function he(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;switch(d|0){case 2:{e=ne(a,b,c)|0;break}case 3:{e=oe(a)|0;break}default:e=0;}oF(a,73999)|0;le(a,d,e);oF(a,73414)|0;e=0;while(1){if((e|0)>=(c|0))break;vF(a,+h[b+(e<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(e<<4)+8>>3]);oF(a,102604)|0;e=e+1|0;}vF(a,+h[b>>3]);oF(a,100999)|0;vF(a,-+h[b+8>>3]);oF(a,73424)|0;return}function ie(a,d,e,f,g,h){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;g=c[a+16>>2]|0;switch(h|0){case 2:{f=ne(a,d,e)|0;break}case 3:{f=oe(a)|0;break}default:f=0;}oF(a,73594)|0;if(b[g+260>>1]&512){oF(a,73600)|0;oF(a,FK(c[g+212>>2]|0)|0)|0;oF(a,73606)|0;}le(a,h,f);oF(a,73611)|0;pe(a,d,e);oF(a,73424)|0;return}function je(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;oF(a,73404)|0;le(a,0,0);oF(a,73414)|0;d=0;while(1){if((d|0)>=(c|0))break;vF(a,+h[b+(d<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(d<<4)+8>>3]);oF(a,102604)|0;d=d+1|0;}oF(a,73424)|0;return}function ke(a,b){a=a|0;b=b|0;oF(a,73398)|0;oF(a,FK(b)|0)|0;oF(a,75458)|0;return}function le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+96|0;k=q+48|0;p=q+40|0;n=q+32|0;o=q+24|0;j=q+16|0;g=q+8|0;f=q;m=c[b+16>>2]|0;oF(b,73429)|0;a:do switch(d|0){case 2:{c[f>>2]=e;uF(b,73437,f);break}case 3:{c[g>>2]=e;uF(b,73448,g);break}case 0:{oF(b,135709)|0;break}default:{d=m+56|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);if((c[m+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:break a;default:{}}h[j>>3]=+(d&255)*.00392156862745098;uF(b,73459,j);}}}while(0);oF(b,73478)|0;e=m+16|0;f=k;g=e;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);d=m+152|0;if(+h[d>>3]!=1.0){oF(b,73489)|0;vF(b,+h[d>>3]);}switch(c[m+144>>2]|0){case 1:{c[o>>2]=73529;uF(b,73506,o);break}case 2:{c[n>>2]=73533;uF(b,73506,n);break}default:{}}b:do if((c[m+48>>2]|0)==1){d=a[e+3>>0]|0;switch(d<<24>>24){case -1:case 0:break b;default:{}}h[p>>3]=+(d&255)*.00392156862745098;uF(b,73537,p);}while(0);oF(b,98744)|0;l=q;return}function me(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,137379)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,73558,117,73578);}while(0);l=g;return}function ne(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+112|0;o=t+64|0;r=t+56|0;n=t+48|0;m=t+40|0;i=t+32|0;k=t;q=c[46722]|0;c[46722]=q+1;p=c[b+16>>2]|0;f=+(c[p+136>>2]|0)*.017453292519943295;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;pQ(d,k,e,f,0);c[o>>2]=q;uF(b,73831,o);oF(b,73896)|0;vF(b,+h[k>>3]);oF(b,73901)|0;vF(b,+h[k+8>>3]);oF(b,73908)|0;vF(b,+h[k+16>>3]);oF(b,73915)|0;vF(b,+h[k+24>>3]);oF(b,73922)|0;k=p+140|0;f=+g[k>>2];if(f>0.0){h[i>>3]=f+-.001;uF(b,73927,i);}else oF(b,73703)|0;d=p+56|0;e=o;i=d;j=e+40|0;do{c[e>>2]=c[i>>2];e=e+4|0;i=i+4|0;}while((e|0)<(j|0));me(b,o);oF(b,73739)|0;a:do if((c[p+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{s=7;break a}default:{}}h[m>>3]=+(d&255)*.00392156862745098;uF(b,99612,m);}else s=7;while(0);if((s|0)==7)oF(b,73754)|0;oF(b,73757)|0;f=+g[k>>2];if(f>0.0){h[n>>3]=f;uF(b,73927,n);}else oF(b,73763)|0;d=p+96|0;e=o;i=d;j=e+40|0;do{c[e>>2]=c[i>>2];e=e+4|0;i=i+4|0;}while((e|0)<(j|0));me(b,o);oF(b,73739)|0;b:do if((c[p+128>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{s=14;break b}default:{}}h[r>>3]=+(d&255)*.00392156862745098;uF(b,99612,r);}else s=14;while(0);if((s|0)==14)oF(b,73754)|0;oF(b,73967)|0;l=t;return q|0}function oe(b){b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+64|0;k=q+16|0;o=q+8|0;j=q;n=c[46721]|0;c[46721]=n+1;m=c[b+16>>2]|0;r=+(c[m+136>>2]|0)*.017453292519943295;e=r;if(r==0.0){f=50;d=50;}else {f=~~((+E(+e)+1.0)*50.0);d=~~((1.0-+F(+e))*50.0);}c[k>>2]=n;c[k+4>>2]=f;c[k+8>>2]=d;uF(b,73619,k);oF(b,73703)|0;d=m+56|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);oF(b,73739)|0;a:do if((c[m+88>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{p=6;break a}default:{}}h[j>>3]=+(d&255)*.00392156862745098;uF(b,99612,j);}else p=6;while(0);if((p|0)==6)oF(b,73754)|0;oF(b,73757)|0;oF(b,73763)|0;d=m+96|0;f=k;g=d;i=f+40|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0;}while((f|0)<(i|0));me(b,k);oF(b,73739)|0;b:do if((c[m+128>>2]|0)==1){d=a[d+3>>0]|0;switch(d<<24>>24){case -1:case 0:{p=10;break b}default:{}}h[o>>3]=+(d&255)*.00392156862745098;uF(b,99612,o);}else p=10;while(0);if((p|0)==10)oF(b,73754)|0;oF(b,73799)|0;l=q;return n|0}function pe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0;i=l;l=l+16|0;g=i;e=77;f=0;while(1){if((f|0)>=(d|0))break;c[g>>2]=e;uF(a,73616,g);vF(a,+h[b+(f<<4)>>3]);oF(a,100999)|0;vF(a,-+h[b+(f<<4)+8>>3]);e=(f|0)==0?67:32;f=f+1|0;}l=i;return}function qe(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+16|0;i=j+8|0;h=j;oF(b,74587)|0;oF(b,FK(d)|0)|0;if(e|0){c[h>>2]=FK(e)|0;uF(b,74595,h);}c[i>>2]=f;uF(b,74599,i);d=QA(g,74611)|0;if(d|0?a[d>>0]|0:0){oF(b,102604)|0;oF(b,FK(d)|0)|0;}oF(b,98744)|0;l=j;return}function re(a){a=a|0;var b=0;oF(a,75418)|0;b=a+12|0;oF(a,Be(c[c[c[b>>2]>>2]>>2]|0)|0)|0;oF(a,78181)|0;oF(a,Be(c[(c[c[b>>2]>>2]|0)+4>>2]|0)|0)|0;oF(a,78191)|0;oF(a,Be(c[(c[c[b>>2]>>2]|0)+8>>2]|0)|0)|0;oF(a,75434)|0;return}function se(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=c[b+16>>2]|0;oF(b,75395)|0;d=d+8|0;if(a[(KB(c[d>>2]|0)|0)>>0]|0){oF(b,75397)|0;oF(b,Be(KB(c[d>>2]|0)|0)|0)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,75406,e);c[46723]=0;l=f;return}function te(a){a=a|0;c[46723]=1;return}function ue(a){a=a|0;c[46723]=-1;return}function ve(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+48|0;i=n+8|0;m=n;f=c[b+16>>2]|0;if(c[f+144>>2]|0?(k=e+4|0,j=~~(+h[b+352>>3]*+h[(c[k>>2]|0)+16>>3]),j|0):0){Ce(b);oF(b,75334)|0;g=d+8|0;h[g>>3]=+h[g>>3]-+(j|0)*.55;c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];xF(b,i);oF(b,75348)|0;oF(b,c[e>>2]|0)|0;oF(b,75357)|0;oF(b,75155)|0;g=i;d=f+16|0;f=g+40|0;do{c[g>>2]=c[d>>2];g=g+4|0;d=d+4|0;}while((g|0)<(f|0));De(b,i);oF(b,75359)|0;i=c[k>>2]|0;k=c[i+8>>2]|0;k=c[((k|0)==0?i:k+4|0)>>2]|0;oF(b,98744)|0;oF(b,k)|0;oF(b,98744)|0;c[m>>2]=j;uF(b,75368,m);switch(a[e+48>>0]|0){case 108:{oF(b,75373)|0;break}case 114:{oF(b,75384)|0;break}default:{}}Ee(b);oF(b,153599)|0;}l=n;return}function we(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0.0,m=0.0,n=0.0;j=l;l=l+48|0;f=j;g=c[a+16>>2]|0;i=g+144|0;if(c[i>>2]|0){n=+h[b>>3];m=+h[b+24>>3];e=b+8|0;k=+h[e>>3];h[b>>3]=n-+h[b+16>>3]+n;h[e>>3]=k-m+k;Ce(a);oF(a,75320)|0;yF(a,b,2);oF(a,75155)|0;do if(!d)if(!(c[46723]|0)){oF(a,97309)|0;break}else {oF(a,137198)|0;break}else {b=f;d=g+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);}while(0);if((c[46723]|0)==1)c[46723]=0;oF(a,75266)|0;vF(a,+h[g+152>>3]);oF(a,75309)|0;b=f;d=g+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);b=c[i>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[i>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=j;return}function xe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0;j=l;l=l+48|0;f=j;g=c[a+16>>2]|0;i=g+144|0;if(c[i>>2]|0){Ce(a);oF(a,75292)|0;yF(a,b,d);oF(a,75155)|0;do if(!e)if(!(c[46723]|0)){oF(a,97309)|0;break}else {oF(a,137198)|0;break}else {b=f;d=g+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);}while(0);if((c[46723]|0)==1)c[46723]=0;oF(a,75266)|0;vF(a,+h[g+152>>3]);oF(a,75309)|0;b=f;d=g+16|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));De(a,f);b=c[i>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[i>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=j;return}function ye(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0;m=l;l=l+48|0;i=m;j=c[a+16>>2]|0;k=j+144|0;if(c[k>>2]|0){Ce(a);oF(a,75141)|0;yF(a,b,d);oF(a,75155)|0;e=i;f=j+16|0;g=e+40|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));De(a,i);oF(a,75266)|0;vF(a,+h[j+152>>3]);e=c[k>>2]|0;if((e|0)==1){oF(a,75163)|0;e=c[k>>2]|0;}if((e|0)==2)oF(a,75172)|0;oF(a,75275)|0;Ee(a);oF(a,153599)|0;}l=m;return}function ze(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;g=i;e=c[a+16>>2]|0;h=e+144|0;if(c[h>>2]|0){Ce(a);oF(a,75141)|0;yF(a,b,d);oF(a,75155)|0;f=g;b=e+16|0;d=f+40|0;do{c[f>>2]=c[b>>2];f=f+4|0;b=b+4|0;}while((f|0)<(d|0));De(a,g);b=c[h>>2]|0;if((b|0)==1){oF(a,75163)|0;b=c[h>>2]|0;}if((b|0)==2)oF(a,75172)|0;Ee(a);oF(a,153599)|0;}l=i;return}function Ae(a,b){a=a|0;b=b|0;oF(a,75138)|0;oF(a,Be(b)|0)|0;oF(a,153599)|0;return}function Be(a){a=a|0;return a|0}function Ce(b){b=b|0;if(!(a[b+144>>0]|0))oF(b,75263)|0;else oF(b,c[b+148>>2]|0)|0;return}function De(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,97309)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,75181,49,75245);}while(0);l=g;return}function Ee(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;f=c[a+16>>2]|0;switch(c[f+12>>2]|0){case 8:{b=1;d=111481;e=f+8|0;break}case 10:{b=0;d=111481;e=f+8|0;break}case 3:case 2:case 9:{b=1;d=111450;e=f+8|0;break}case 7:case 6:case 11:{b=0;d=111450;e=f+8|0;break}case 0:{b=1;d=111494;e=f+8|0;break}case 4:{b=0;d=75217;e=f+8|0;break}case 1:{b=1;d=111494;e=f+8|0;break}case 5:{b=0;d=111494;e=f+8|0;break}default:qa(138394,75181,106,75200);}f=c[(c[e>>2]|0)+8>>2]|0;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=f;uF(a,75229,g);l=h;return}function Fe(a){a=a|0;var b=0;oF(a,78153)|0;oF(a,78161)|0;b=a+12|0;oF(a,Qe(c[c[c[b>>2]>>2]>>2]|0)|0)|0;oF(a,78181)|0;oF(a,Qe(c[(c[c[b>>2]>>2]|0)+4>>2]|0)|0)|0;oF(a,78191)|0;oF(a,Qe(c[(c[c[b>>2]>>2]|0)+8>>2]|0)|0)|0;oF(a,78194)|0;return}function Ge(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;i=j+24|0;g=j+16|0;f=j+8|0;e=j;d=c[b+16>>2]|0;c[46727]=~~(+h[b+232>>3]-+h[b+216>>3]);c[46726]=~~(+h[b+224>>3]-+h[b+208>>3]);oF(b,76840)|0;oF(b,76847)|0;d=KB(c[d+8>>2]|0)|0;if(a[d>>0]|0){oF(b,76916)|0;oF(b,Qe(d)|0)|0;oF(b,76924)|0;}c[e>>2]=O(c[b+168>>2]|0,c[b+164>>2]|0)|0;uF(b,76933,e);oF(b,76953)|0;oF(b,76988)|0;oF(b,77016)|0;oF(b,77022)|0;oF(b,77065)|0;oF(b,77106)|0;oF(b,77125)|0;oF(b,77142)|0;oF(b,77190)|0;oF(b,77243)|0;oF(b,77319)|0;oF(b,77395)|0;oF(b,77404)|0;oF(b,77427)|0;oF(b,77454)|0;oF(b,77507)|0;oF(b,77529)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77596)|0;oF(b,77622)|0;oF(b,77507)|0;oF(b,77674)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77718)|0;oF(b,77427)|0;oF(b,77454)|0;oF(b,77507)|0;oF(b,77674)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77596)|0;oF(b,77622)|0;oF(b,77507)|0;oF(b,77529)|0;oF(b,77574)|0;oF(b,77586)|0;oF(b,77731)|0;oF(b,77739)|0;oF(b,77745)|0;oF(b,77759)|0;oF(b,77767)|0;oF(b,77800)|0;e=(c[46727]|0)+10|0;c[f>>2]=c[46726];c[f+4>>2]=e;uF(b,77877,f);oF(b,77907)|0;oF(b,77916)|0;oF(b,77974)|0;oF(b,77984)|0;oF(b,78049)|0;f=c[46727]|0;c[g>>2]=c[46726];c[g+4>>2]=f;uF(b,78086,g);g=c[46727]|0;c[i>>2]=c[46726];c[i+4>>2]=g;uF(b,78114,i);l=j;return}function He(a){a=a|0;oF(a,76391)|0;oF(a,76403)|0;oF(a,76411)|0;oF(a,76474)|0;oF(a,76403)|0;oF(a,76519)|0;oF(a,76568)|0;oF(a,76622)|0;oF(a,76403)|0;oF(a,76722)|0;oF(a,76771)|0;oF(a,76403)|0;oF(a,76823)|0;return}function Ie(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+32|0;i=j+16|0;h=j+8|0;g=j;oF(b,76349)|0;if(d|0?a[d>>0]|0:0){c[g>>2]=Qe(d)|0;uF(b,76352,g);}if(e|0?a[e>>0]|0:0){c[h>>2]=Qe(e)|0;uF(b,76363,h);}if(f|0?a[f>>0]|0:0){c[i>>2]=Qe(f)|0;uF(b,76375,i);}oF(b,76388)|0;l=j;return}function Je(a){a=a|0;oF(a,76343)|0;return}function Ke(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0;A=l;l=l+112|0;y=A+96|0;z=A+88|0;w=A+80|0;q=A+72|0;v=A+64|0;t=A+56|0;s=A+48|0;r=A+40|0;p=A+24|0;o=A+8|0;n=A;x=c[b+16>>2]|0;switch(a[f+48>>0]|0){case 108:{j=+h[e>>3];m=+h[f+32>>3];break}case 114:{m=+h[f+32>>3];j=+h[e>>3]-m;break}default:{m=+h[f+32>>3];j=+h[e>>3]-m*.5;}}g=f+40|0;i=+h[g>>3];u=f+4|0;k=+h[(c[u>>2]|0)+16>>3];if(i>3]=i;}B=j+-8.0;k=+((c[46727]|0)>>>0)-+h[e+8>>3]-i+k*.2+(k<12.0?1.4:2.0);uF(b,76005,n);h[o>>3]=B;h[o+8>>3]=k;uF(b,75942,o);h[p>>3]=j+8.0+m-B;h[p+8>>3]=i;uF(b,75966,p);oF(b,76040)|0;oF(b,76074)|0;g=c[u>>2]|0;e=c[g+8>>2]|0;if(e){c[r>>2]=c[e+4>>2];uF(b,76164,r);g=c[e+8>>2]|0;if(g|0){c[s>>2]=g;uF(b,76183,s);}g=c[e+12>>2]|0;if(g|0){c[t>>2]=g;uF(b,76200,t);}g=c[e+16>>2]|0;if(g|0){c[v>>2]=g;uF(b,76218,v);}}else {c[q>>2]=c[g>>2];uF(b,76164,q);}h[w>>3]=+h[(c[u>>2]|0)+16>>3];uF(b,76234,w);g=x+16|0;switch(c[x+48>>2]|0){case 5:{g=c[g>>2]|0;if(c3(g,137314)|0){c[z>>2]=g;uF(b,76254,z);}break}case 1:{x=d[g+1>>0]|0;z=d[g+2>>0]|0;c[y>>2]=d[g>>0];c[y+4>>2]=x;c[y+8>>2]=z;uF(b,76264,y);break}default:qa(138394,75728,438,76285);}oF(b,76298)|0;oF(b,Qe(c[f>>2]|0)|0)|0;oF(b,76309)|0;oF(b,76332)|0;l=A;return}function Le(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0;e=l;l=l+32|0;f=e+16|0;j=e;oF(a,75906)|0;m=+h[b>>3];i=+h[b+16>>3]-m;k=+h[b+24>>3];g=k-+h[b+8>>3];k=+((c[46727]|0)>>>0)-k;h[j>>3]=m-i;h[j+8>>3]=k;uF(a,75942,j);h[f>>3]=i*2.0;h[f+8>>3]=g*2.0;uF(a,75966,f);Ue(a,d);oF(a,75788)|0;Se(a);oF(a,75994)|0;l=e;return}function Me(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+24|0;j=m+8|0;g=m;oF(a,75511)|0;n=c[46727]|0;c[g>>2]=c[46726];c[g+4>>2]=n;uF(a,75764,g);Ue(a,e);oF(a,75788)|0;Se(a);oF(a,75791)|0;g=d+-1|0;e=0;while(1){if((e|0)>=(d|0))break;i=+h[b+(e<<4)>>3];f=+((c[46727]|0)>>>0)-+h[b+(e<<4)+8>>3];if(!e){oF(a,75818)|0;h[j>>3]=i;h[j+8>>3]=f;uF(a,75884,j);oF(a,75895)|0;}else {h[k>>3]=i;h[k+8>>3]=f;uF(a,75884,k);}if((e|0)==(g|0))oF(a,75898)|0;e=e+1|0;}oF(a,75627)|0;l=m;return}function Ne(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;f=l;l=l+16|0;e=f;oF(a,75511)|0;h=c[46727]|0;c[e>>2]=c[46726];c[e+4>>2]=h;uF(a,75764,e);Ue(a,g);oF(a,75788)|0;Se(a);oF(a,75791)|0;Ve(a,b,d);oF(a,75804)|0;l=f;return}function Oe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0.0;k=l;l=l+48|0;j=k+24|0;i=k+8|0;f=k;oF(a,75511)|0;g=c[46727]|0;c[f>>2]=c[46726];c[f+4>>2]=g;uF(a,75548,f);oF(a,75588)|0;f=d+-1|0;g=b+8|0;e=0;while(1){if((e|0)>=(d|0))break;if(!e){oF(a,75600)|0;m=+((c[46727]|0)>>>0)-+h[g>>3];h[i>>3]=+h[b>>3];h[i+8>>3]=m;uF(a,75604,i);oF(a,75615)|0;}else {m=+((c[46727]|0)>>>0)-+h[b+(e<<4)+8>>3];h[j>>3]=+h[b+(e<<4)>>3];h[j+8>>3]=m;uF(a,75604,j);}if((e|0)==(f|0))oF(a,75619)|0;e=e+1|0;}oF(a,75623)|0;Se(a);oF(a,75627)|0;l=k;return}function Pe(a,b){a=a|0;b=b|0;oF(a,75446)|0;oF(a,Qe(b)|0)|0;oF(a,75458)|0;return}function Qe(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+16|0;e=u;d=c[46724]|0;if(!d){c[46725]=64;d=KK(64)|0;c[46724]=d;}s=e+15|0;r=e+14|0;g=0;q=0;o=0;e=0;f=0;a:while(1){n=(o|0)!=0;k=g;p=b;j=e;b:while(1){if(!p){t=32;break a}e=a[p>>0]|0;if(!(e<<24>>24)){t=32;break a}b=c[46725]|0;if((q|0)>(b+-8|0)){d=b<<1;c[46725]=d;d=MK(c[46724]|0,d)|0;c[46724]=d;d=d+q|0;e=a[p>>0]|0;}switch(e<<24>>24){case 60:{e=4;b=102153;t=26;break b}case 62:{e=4;b=102136;t=27;break b}case 38:{t=10;break b}case 45:{e=5;b=102147;i=j;break b}default:{}}if(n&e<<24>>24==32){t=12;break}switch(e<<24>>24){case 34:{e=6;b=102116;t=26;break b}case 39:{e=5;b=102141;t=27;break b}default:{}}if(e<<24>>24<0){i=127;b=0;}else {e=1;b=p;t=26;break}while(1){g=i&255;h=e&255;if(g>>>0>=h>>>0)break;e=i&h&255;i=g>>>1;b=b+1|0;}if((b|0)<=1){g=R6(j|0,f|0,6)|0;g=J6(g|0,z|0,e&255|0,0)|0;f=z;m=k+-1|0;if((k|0)>1){b=m;e=g;}else {t=21;break}}else {b=b+-1|0;e=e&255;f=0;}k=b;p=p+1|0;j=e;}if((t|0)==10){t=0;b=(Re(p)|0)==0;e=b?5:1;b=b?102130:p;i=j;}else if((t|0)==12){t=0;b=(a[o>>0]|0)==32;e=b?6:1;b=b?102123:p;i=j;}else if((t|0)==21){t=0;a[s>>0]=59;e=3;h=r;i=g;j=f;while(1){b=O6(i|0,j|0,10,0)|0;g=h+-1|0;a[h>>0]=b|48;b=i;i=N6(i|0,j|0,10,0)|0;f=j;j=z;o=e;e=e+1|0;if((o|0)>11){t=23;break a}if(!(f>>>0>0|(f|0)==0&b>>>0>9))break;else h=g;}b=h+-2|0;a[g>>0]=35;a[b>>0]=38;k=m;f=j;}else if((t|0)==26){t=0;i=j;}else if((t|0)==27){t=0;i=j;}h=d+e|0;g=e;while(1){if(!g)break;a[d>>0]=a[b>>0]|0;g=g+-1|0;b=b+1|0;d=d+1|0;}g=k;b=p+1|0;q=e+q|0;o=p;d=h;e=i;}if((t|0)==23){U4(75464,46,1,c[15712]|0)|0;Sa(1);}else if((t|0)==32){a[d>>0]=0;l=u;return c[46724]|0}return 0}function Re(b){b=b|0;var c=0,d=0;d=b+1|0;c=a[d>>0]|0;a:do if(c<<24>>24==35){d=b+2|0;c=a[d>>0]|0;switch(c<<24>>24){case 88:case 120:break;default:{b=d;while(1){d=b+1|0;if((c+-48&255)>=10)break a;b=d;c=a[d>>0]|0;}}}d=b+3|0;while(1){c=a[d>>0]|0;if((c+-48&255)>=10)switch(c<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:break a}d=d+1|0;}}else while(1){b=d+1|0;if(((c&-33)+-65&255)>=26)break a;d=b;c=a[b>>0]|0;}while(0);return c<<24>>24==59|0}function Se(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;k=l;l=l+48|0;d=k+8|0;j=k;i=c[a+16>>2]|0;oF(a,75639)|0;e=d;f=i+16|0;g=e+40|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));Te(a,d);b=+h[i+152>>3];if(b!=1.0){h[j>>3]=b;uF(a,75657,j);}switch(c[i+144>>2]|0){case 1:{oF(a,75674)|0;break}case 2:{oF(a,75692)|0;break}default:{}}oF(a,75709)|0;l=k;return}function Te(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+16|0;f=g;a:do switch(c[e+32>>2]|0){case 5:{oF(b,c[e>>2]|0)|0;break}case 1:if(!(a[e+3>>0]|0)){oF(b,135709)|0;break a}else {i=d[e+1>>0]|0;h=d[e+2>>0]|0;c[f>>2]=d[e>>0];c[f+4>>2]=i;c[f+8>>2]=h;uF(b,75714,f);break a}default:qa(138394,75728,94,75748);}while(0);l=g;return}function Ue(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g;if(!b)oF(a,75867)|0;else {d=c[a+16>>2]|0;oF(a,75837)|0;b=f;d=d+56|0;e=b+40|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));Te(a,f);oF(a,75864)|0;}l=g;return}function Ve(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0;i=l;l=l+32|0;g=i;e=75818;f=0;while(1){if((f|0)>=(d|0))break;k=+h[b+(f<<4)>>3];j=+((c[46727]|0)>>>0)-+h[b+(f<<4)+8>>3];c[g>>2]=e;h[g+8>>3]=k;h[g+16>>3]=j;uF(a,75821,g);e=(f|0)==0?75834:195059;f=f+1|0;}oF(a,98744)|0;l=i;return}function We(a){a=a|0;var b=0,d=0,e=0;b=l;l=l+16|0;d=b+8|0;e=b;oF(a,80451)|0;oF(a,80466)|0;oF(a,80505)|0;oF(a,80554)|0;c[e>>2]=137314;c[e+4>>2]=80642;uF(a,80623,e);c[d>>2]=137198;c[d+4>>2]=80648;uF(a,80623,d);l=b;return}function Xe(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0;b=l;l=l+64|0;d=b+8|0;j=b;c[j>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,79404,j);i=+h[a+368>>3]*.5*+h[a+488>>3];g=+h[a+376>>3]*.5*+h[a+496>>3];f=+J(+(i*2.0000000949949026e-03))*180.0*.6366197723675814;e=+J(+(g*2.0000000949949026e-03))*180.0*.6366197723675814;h[d>>3]=i;h[d+8>>3]=g;h[d+16>>3]=-500.0;h[d+24>>3]=i;h[d+32>>3]=g;h[d+40>>3]=0.0;h[d+48>>3]=(f>e?f:e)*1.2;uF(a,79426,d);oF(a,79573)|0;oF(a,80403)|0;l=b;return}function Ye(a){a=a|0;oF(a,79387)|0;return}function Ze(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0;f=l;l=l+16|0;h=f;c[h>>2]=b;c[h+4>>2]=d;c[h+8>>2]=e;uF(a,79357,h);g[46728]=+(O(d,-10)|0);l=f;return}function _e(a){a=a|0;oF(a,79340)|0;return}function $e(a){a=a|0;oF(a,79322)|0;return}function af(a){a=a|0;oF(a,79306)|0;return}function bf(a){a=a|0;oF(a,79285)|0;g[46728]=+g[46728]+-2.0;return}function cf(a){a=a|0;oF(a,79266)|0;return}function df(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=KB(c[(c[a+16>>2]|0)+8>>2]|0)|0;uF(a,79244,d);l=b;return}function ef(a){a=a|0;oF(a,79228)|0;return}function ff(a){a=a|0;oF(a,79210)|0;g[46728]=+g[46728]+-5.0;return}function gf(a){a=a|0;oF(a,79194)|0;g[46728]=+g[46728]+5.0;return}function hf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0;r=l;l=l+144|0;o=r+104|0;q=r+56|0;m=r+32|0;j=r+24|0;n=r;p=e+4|0;i=c[p>>2]|0;f=+h[i+16>>3];i=c[i>>2]|0;c[n>>2]=c[e>>2];h[n+8>>3]=f;c[n+16>>2]=i;uF(b,79040,n);g[46729]=+g[46728]+-9.0;switch(a[e+48>>0]|0){case 108:{f=+h[d>>3];break}case 114:{i=d;f=+h[d>>3]-+h[e+32>>3];k=5;break}default:{i=d;f=+h[d>>3]-+h[e+32>>3]*.5;k=5;}}if((k|0)==5)h[i>>3]=f;u=+h[b+488>>3];t=(+h[b+504>>3]+f)*u;s=(+h[b+512>>3]+ +h[d+8>>3])*+h[b+496>>3];h[j>>3]=+h[(c[p>>2]|0)+16>>3]*u;n=of(b,79092,j)|0;f=+(c[b+360>>2]|0);h[m>>3]=0.0;h[m+8>>3]=0.0;h[m+16>>3]=f;i=of(b,78309,m)|0;f=+g[46729];h[o>>3]=t;h[o+8>>3]=s;h[o+16>>3]=f;d=of(b,78341,o)|0;j=o;k=(c[b+16>>2]|0)+16|0;m=j+40|0;do{c[j>>2]=c[k>>2];j=j+4|0;k=k+4|0;}while((j|0)<(m|0));o=pf(b,o,0.0)|0;e=c[e>>2]|0;c[q>>2]=c[c[p>>2]>>2];h[q+8>>3]=.25;h[q+16>>3]=0.0;c[q+24>>2]=e;c[q+28>>2]=79179;c[q+32>>2]=n;c[q+36>>2]=i;c[q+40>>2]=d;c[q+44>>2]=o;q=of(b,79104,q)|0;oF(b,q)|0;U1(q);U1(i);U1(o);U1(d);U1(n);l=r;return}function jf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0;z=l;l=l+240|0;x=z+192|0;y=z+152|0;t=z+128|0;r=z+104|0;o=z+80|0;n=z+48|0;e=z+24|0;m=z;oF(a,78917)|0;g[46729]=+g[46728]+-6.0;i=+h[b>>3];j=+h[a+488>>3];p=(+h[a+504>>3]+i)*j;A=+h[b+8>>3];k=+h[a+496>>3];q=(+h[a+512>>3]+A)*k;j=(+h[b+16>>3]-i)*j;k=(+h[b+24>>3]-A)*k;s=a+16|0;A=k+j;i=+h[(c[s>>2]|0)+152>>3]/A*2.5;h[m>>3]=j;h[m+8>>3]=A*.25;h[m+16>>3]=k;b=of(a,78277,m)|0;m=a+360|0;A=+(c[m>>2]|0);h[e>>3]=90.0;h[e+8>>3]=0.0;h[e+16>>3]=A;e=of(a,78309,e)|0;A=+g[46729];h[x>>3]=p;h[x+8>>3]=q;h[x+16>>3]=A;f=of(a,78341,x)|0;u=x;v=(c[s>>2]|0)+16|0;w=u+40|0;do{c[u>>2]=c[v>>2];u=u+4|0;v=v+4|0;}while((u|0)<(w|0));v=pf(a,x,0.0)|0;h[n>>3]=1.0;h[n+8>>3]=i;c[n+16>>2]=b;c[n+20>>2]=e;c[n+24>>2]=f;c[n+28>>2]=v;w=of(a,78932,n)|0;oF(a,w)|0;U1(b);U1(e);U1(f);U1(v);U1(w);if(d|0){h[o>>3]=j;h[o+8>>3]=k;h[o+16>>3]=1.0;f=of(a,78277,o)|0;A=+(c[m>>2]|0);h[r>>3]=0.0;h[r+8>>3]=0.0;h[r+16>>3]=A;e=of(a,78309,r)|0;A=+g[46729];h[t>>3]=p;h[t+8>>3]=q;h[t+16>>3]=A;b=of(a,78341,t)|0;u=x;v=(c[s>>2]|0)+56|0;w=u+40|0;do{c[u>>2]=c[v>>2];u=u+4|0;v=v+4|0;}while((u|0)<(w|0));x=pf(a,x,0.0)|0;h[y>>3]=0.0;h[y+8>>3]=0.0;h[y+16>>3]=0.0;c[y+24>>2]=f;c[y+28>>2]=e;c[y+32>>2]=b;c[y+36>>2]=x;y=of(a,78978,y)|0;oF(a,y)|0;U1(f);U1(e);U1(b);U1(x);U1(y);}l=z;return}function kf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0,M=0,N=0.0;K=l;l=l+336|0;B=K+296|0;J=K+288|0;I=K+272|0;H=K+264|0;G=K+240|0;D=K+232|0;A=K+208|0;z=K+184|0;w=K+160|0;v=K+152|0;u=K+136|0;t=K+128|0;s=K+96|0;r=K+88|0;q=K+56|0;f=K+48|0;m=K+24|0;k=K;oF(a,78782)|0;g[46729]=+g[46728]+-2.0;o=a+488|0;p=a+496|0;L=+h[p>>3];h[k>>3]=+h[o>>3];h[k+8>>3]=L;h[k+16>>3]=1.0;k=of(a,78277,k)|0;y=a+360|0;L=+(c[y>>2]|0);h[m>>3]=0.0;h[m+8>>3]=0.0;h[m+16>>3]=L;m=of(a,78309,m)|0;L=+g[46729]+-2.0;h[B>>3]=0.0;h[B+8>>3]=0.0;h[B+16>>3]=L;n=of(a,78341,B)|0;C=a+16|0;i=B;j=(c[C>>2]|0)+16|0;x=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(x|0));j=pf(a,B,0.0)|0;c[f>>2]=78404;c[f+4>>2]=d+1;E=a+504|0;F=a+512|0;i=0;f=of(a,78373,f)|0;while(1){if((i|0)>=(d|0))break;N=+h[F>>3]+ +h[b+(i<<4)+8>>3];L=+h[(c[C>>2]|0)+152>>3];h[q>>3]=+h[E>>3]+ +h[b+(i<<4)>>3];h[q+8>>3]=N;h[q+16>>3]=0.0;h[q+24>>3]=L;M=of(a,78418,q)|0;c[r>>2]=f;c[r+4>>2]=M;x=of(a,78447,r)|0;U1(M);U1(f);i=i+1|0;f=x;}L=+h[F>>3]+ +h[b+8>>3];N=+h[(c[C>>2]|0)+152>>3];h[s>>3]=+h[E>>3]+ +h[b>>3];h[s+8>>3]=L;h[s+16>>3]=0.0;h[s+24>>3]=N;x=of(a,78418,s)|0;c[t>>2]=f;c[t+4>>2]=x;M=of(a,78447,t)|0;U1(x);U1(f);c[u>>2]=k;c[u+4>>2]=m;c[u+8>>2]=n;c[u+12>>2]=j;x=of(a,78797,u)|0;c[v>>2]=M;c[v+4>>2]=x;M=of(a,78502,v)|0;U1(x);oF(a,M)|0;U1(k);U1(m);U1(n);U1(j);U1(M);if(e|0){N=+h[p>>3];h[w>>3]=+h[o>>3];h[w+8>>3]=N;h[w+16>>3]=1.0;n=of(a,78277,w)|0;N=+(c[y>>2]|0);h[z>>3]=0.0;h[z+8>>3]=0.0;h[z+16>>3]=N;m=of(a,78309,z)|0;N=+g[46729]+-2.0;h[A>>3]=0.0;h[A+8>>3]=0.0;h[A+16>>3]=N;k=of(a,78341,A)|0;i=B;j=(c[C>>2]|0)+56|0;x=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(x|0));j=pf(a,B,.25)|0;c[D>>2]=d;i=0;f=of(a,78842,D)|0;while(1){if((i|0)>=(d|0))break;N=+h[F>>3]+ +h[b+(i<<4)+8>>3];h[G>>3]=+h[E>>3]+ +h[b+(i<<4)>>3];h[G+8>>3]=N;h[G+16>>3]=0.0;D=of(a,78857,G)|0;c[H>>2]=f;c[H+4>>2]=D;M=of(a,78879,H)|0;U1(D);U1(f);i=i+1|0;f=M;}c[I>>2]=n;c[I+4>>2]=m;c[I+8>>2]=k;c[I+12>>2]=j;I=of(a,78889,I)|0;c[J>>2]=f;c[J+4>>2]=I;M=of(a,78502,J)|0;U1(I);oF(a,M)|0;U1(n);U1(m);U1(k);U1(j);U1(M);}l=K;return}function lf(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0.0,D=0.0;B=l;l=l+208|0;e=B+160|0;A=B+152|0;z=B+136|0;y=B+128|0;x=B+96|0;w=B+88|0;v=B+56|0;k=B+48|0;s=B+24|0;r=B;oF(a,78709)|0;g[46729]=+g[46728]+-4.0;C=+h[a+496>>3];h[r>>3]=+h[a+488>>3];h[r+8>>3]=C;h[r+16>>3]=1.0;r=of(a,78277,r)|0;C=+(c[a+360>>2]|0);h[s>>3]=0.0;h[s+8>>3]=0.0;h[s+16>>3]=C;s=of(a,78309,s)|0;C=+g[46729]+-2.0;h[e>>3]=0.0;h[e+8>>3]=0.0;h[e+16>>3]=C;t=of(a,78341,e)|0;u=a+16|0;f=e;i=(c[u>>2]|0)+56|0;j=f+40|0;do{c[f>>2]=c[i>>2];f=f+4|0;i=i+4|0;}while((f|0)<(j|0));n=pf(a,e,0.0)|0;c[k>>2]=78723;c[k+4>>2]=d+2;o=a+504|0;p=a+512|0;q=d+-1|0;m=0;e=of(a,78373,k)|0;while(1){if((m|0)>=(d|0))break;f=b+(m<<4)|0;i=b+(m<<4)+8|0;D=+h[p>>3]+ +h[i>>3];C=+h[(c[u>>2]|0)+152>>3];h[v>>3]=+h[o>>3]+ +h[f>>3];h[v+8>>3]=D;h[v+16>>3]=0.0;h[v+24>>3]=C;k=of(a,78418,v)|0;c[w>>2]=e;c[w+4>>2]=k;j=of(a,78447,w)|0;U1(k);U1(e);if((m|0)==0|(m|0)==(q|0)){C=+h[p>>3]+ +h[i>>3];D=+h[(c[u>>2]|0)+152>>3];h[x>>3]=+h[o>>3]+ +h[f>>3];h[x+8>>3]=C;h[x+16>>3]=0.0;h[x+24>>3]=D;k=of(a,78418,x)|0;c[y>>2]=j;c[y+4>>2]=k;e=of(a,78447,y)|0;U1(k);U1(j);}else e=j;m=m+1|0;}c[z>>2]=r;c[z+4>>2]=s;c[z+8>>2]=t;c[z+12>>2]=n;b=of(a,78732,z)|0;c[A>>2]=e;c[A+4>>2]=b;d=of(a,78502,A)|0;U1(b);oF(a,d)|0;U1(r);U1(s);U1(t);U1(n);U1(d);l=B;return}function mf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0,y=0.0;v=l;l=l+160|0;e=v+120|0;u=v+112|0;t=v+96|0;s=v+88|0;r=v+56|0;m=v+48|0;n=v+24|0;q=v;oF(a,78261)|0;g[46729]=+g[46728]+-6.0;w=+h[a+496>>3];h[q>>3]=+h[a+488>>3];h[q+8>>3]=w;h[q+16>>3]=1.0;q=of(a,78277,q)|0;w=+(c[a+360>>2]|0);h[n>>3]=0.0;h[n+8>>3]=0.0;h[n+16>>3]=w;n=of(a,78309,n)|0;w=+g[46729];h[e>>3]=0.0;h[e+8>>3]=0.0;h[e+16>>3]=w;o=of(a,78341,e)|0;p=a+16|0;f=e;i=(c[p>>2]|0)+16|0;j=f+40|0;do{c[f>>2]=c[i>>2];f=f+4|0;i=i+4|0;}while((f|0)<(j|0));i=pf(a,e,0.0)|0;c[m>>2]=78404;c[m+4>>2]=d;j=a+504|0;k=a+512|0;f=0;e=of(a,78373,m)|0;while(1){if((f|0)>=(d|0))break;y=+h[k>>3]+ +h[b+(f<<4)+8>>3];w=+h[(c[p>>2]|0)+152>>3];h[r>>3]=+h[j>>3]+ +h[b+(f<<4)>>3];h[r+8>>3]=y;h[r+16>>3]=0.0;h[r+24>>3]=w;x=of(a,78418,r)|0;c[s>>2]=e;c[s+4>>2]=x;m=of(a,78447,s)|0;U1(x);U1(e);f=f+1|0;e=m;}c[t>>2]=q;c[t+4>>2]=n;c[t+8>>2]=o;c[t+12>>2]=i;t=of(a,78456,t)|0;c[u>>2]=e;c[u+4>>2]=t;x=of(a,78502,u)|0;U1(t);oF(a,x)|0;U1(q);U1(n);U1(o);U1(i);U1(x);l=v;return}function nf(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=b;uF(a,78242,e);l=d;return}function of(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+1056|0;h=i;e=i+24|0;f=i+8|0;c[f>>2]=d;g=G3(e,1024,b,f)|0;do if((g|0)>=0)if((g|0)>1023){a=T1(g+1|0)|0;c[f>>2]=d;n4(a,b,f)|0;break}else {a=D4(e)|0;break}else {a=c[(c[a+12>>2]|0)+16>>2]|0;c[h>>2]=t2(c[(d2()|0)>>2]|0)|0;ub[a&63](78687,h);a=D4(195059)|0;}while(0);l=i;return a|0}function pf(a,b,e){a=a|0;b=b|0;e=+e;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0;q=l;l=l+112|0;o=q+104|0;j=q+96|0;i=q+64|0;n=q+48|0;p=q+32|0;m=q+16|0;k=q;g=c[b+32>>2]|0;a:do switch(g|0){case 5:{f=c[b>>2]|0;if(!(s2(f,136302)|0)){c[k>>2]=78524;h[k+8>>3]=e;f=of(a,78507,k)|0;break a}if(!(s2(f,133432)|0)){c[m>>2]=78528;h[m+8>>3]=e;f=of(a,78507,m)|0;break a}if(!(s2(f,131431)|0)){c[p>>2]=78534;h[p+8>>3]=e;f=of(a,78507,p)|0;break a}else {c[n>>2]=f;h[n+8>>3]=e;f=of(a,78507,n)|0;break a}}case 1:{s=+(d[b+1>>0]|0)*.00390625;r=+(d[b+2>>0]|0)*.00390625;h[i>>3]=+(d[b>>0]|0)*.00390625;h[i+8>>3]=s;h[i+16>>3]=r;h[i+24>>3]=e;f=of(a,78539,i)|0;break}default:{p=c[15712]|0;n=c[b>>2]|0;c[j>>2]=g;c[j+4>>2]=n;w4(p,78578,j)|0;qa(138394,78628,436,78648);}}while(0);c[o>>2]=f;p=of(a,78665,o)|0;U1(f);l=q;return p|0}function qf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=l;l=l+32|0;d=b+24|0;e=b+16|0;g=b;f=c[a+16>>2]|0;h=c[c[a+12>>2]>>2]|0;j=c[h>>2]|0;i=c[h+4>>2]|0;h=c[h+8>>2]|0;c[g>>2]=81094;c[g+4>>2]=j;c[g+8>>2]=i;c[g+12>>2]=h;uF(a,83704,g);f=KB(c[f+8>>2]|0)|0;c[e>>2]=81094;c[e+4>>2]=f;uF(a,83736,e);c[d>>2]=81094;uF(a,83750,d);l=b;return}function rf(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=81094;uF(a,83652,d);l=b;return}function sf(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;W=l;l=l+304|0;V=W+296|0;U=W+288|0;T=W+272|0;R=W+264|0;Q=W+256|0;P=W+248|0;O=W+240|0;N=W+232|0;M=W+224|0;L=W+216|0;K=W+208|0;J=W+200|0;I=W+192|0;H=W+184|0;G=W+176|0;F=W+168|0;E=W+160|0;C=W+152|0;A=W+144|0;z=W+136|0;y=W+128|0;x=W+120|0;w=W+112|0;v=W+104|0;u=W+96|0;t=W+88|0;s=W+80|0;r=W+72|0;q=W+64|0;p=W+56|0;o=W+48|0;S=W+40|0;B=W+24|0;n=W+16|0;m=W;g=c[a+456>>2]|0;i=c[a+460>>2]|0;j=c[a+464>>2]|0;k=c[a+468>>2]|0;f=a+360|0;a:do if(c[4025]|0){switch(c[f>>2]|0){case 90:case 0:break a;default:{}}Ef();c[4025]=0;}while(0);e=(+(k|0)-+(i|0))*.013888888888888888;b=(+(j|0)-+(g|0))*.013888888888888888;k=(c[f>>2]|0)==90;d=k?e:b;e=k?b:e;h[m>>3]=d;h[m+8>>3]=e;uF(a,81281,m);c[n>>2]=81094;uF(a,81296,n);if(d>0.0){b=+A2(d);h[19214]=b;b=b+3.0-+(~~b|0);}else b=3.0;b=+D(10.0,+b);h[19214]=b;h[B>>3]=b;h[B+8>>3]=b;uF(a,81465,B);c[S>>2]=81094;uF(a,81500,S);c[o>>2]=81094;uF(a,81558,o);c[p>>2]=81094;uF(a,81618,p);c[q>>2]=81094;uF(a,81667,q);c[r>>2]=81094;uF(a,81706,r);c[s>>2]=81094;uF(a,81757,s);c[t>>2]=81094;uF(a,81819,t);c[u>>2]=81094;uF(a,81929,u);c[v>>2]=81094;uF(a,82020,v);c[w>>2]=81094;uF(a,82074,w);c[x>>2]=81094;uF(a,82143,x);uF(a,82179,y);c[z>>2]=81094;uF(a,82304,z);c[A>>2]=81094;uF(a,82333,A);uF(a,82373,C);c[E>>2]=81094;uF(a,82466,E);c[F>>2]=81094;uF(a,82525,F);c[G>>2]=81094;uF(a,82606,G);uF(a,82676,H);c[I>>2]=81094;uF(a,82765,I);c[J>>2]=81094;uF(a,82870,J);c[K>>2]=81094;uF(a,82946,K);c[L>>2]=81094;uF(a,82985,L);c[M>>2]=81094;uF(a,83084,M);c[N>>2]=81094;uF(a,83130,N);uF(a,83219,O);c[P>>2]=81094;uF(a,83260,P);c[Q>>2]=81094;uF(a,83343,Q);c[R>>2]=81094;uF(a,83444,R);h[T>>3]=e;h[T+8>>3]=d;uF(a,83508,T);uF(a,83536,U);uF(a,83544,V);l=W;return}function tf(a){a=a|0;var b=0;b=l;l=l+16|0;uF(a,81274,b);l=b;return}function uf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0.0,o=0,p=0,q=0,r=0;r=l;l=l+48|0;q=r+24|0;p=r+8|0;o=r;switch(a[e+48>>0]|0){case 108:{k=d;i=+h[e+32>>3];j=+h[d>>3];break}case 114:{i=+h[e+32>>3];g=i;f=5;break}default:{i=+h[e+32>>3];g=i*.5;f=5;}}if((f|0)==5){j=+h[d>>3]-g;h[d>>3]=j;k=d;}m=e+4|0;f=c[m>>2]|0;g=+h[f+16>>3];d=d+8|0;n=+h[d>>3]+g*.004629629629629629;h[d>>3]=n;i=j+i*.006944444444444444;h[k>>3]=i;f=c[f>>2]|0;do if(f){d=c[46730]|0;if(d|0?(s2(d,f)|0)==0:0)break;c[o>>2]=Cf(f)|0;uF(b,81173,o);o=c[m>>2]|0;c[46730]=c[o>>2];g=+h[o+16>>3];}while(0);f=~~g;f=(f|0)>1?f:1;if((f|0)!=(c[46731]|0)){j=+h[19214];c[p>>2]=f;h[p+8>>3]=j;uF(b,81181,p);c[46731]=f;}c[q>>2]=Df(c[e>>2]|0)|0;h[q+8>>3]=i;h[q+16>>3]=n;uF(b,81202,q);l=r;return}function vf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=l;l=l+48|0;f=e;i=+h[b>>3];k=(+h[b+16>>3]-i)*.027777777777777776;g=+h[b+8>>3];j=(+h[b+24>>3]-g)*.027777777777777776;c[f>>2]=1;c[f+4>>2]=d|0?81115:195059;h[f+8>>3]=k;h[f+16>>3]=j;h[f+24>>3]=i*.013888888888888888;h[f+32>>3]=g*.013888888888888888;uF(a,81121,f);l=e;return}function wf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=l;l=l+16|0;Af(c[a+16>>2]|0,e+8|0,e);Bf(a,b,d,1);l=e;return}function xf(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0.0,w=0;t=l;l=l+128|0;s=t+112|0;q=t+104|0;p=t+96|0;e=t+88|0;n=t+16|0;o=t;k=c[a+16>>2]|0;j=T1((d*140|0)+140|0)|0;Af(k,t+116|0,t+80|0);v=+h[b>>3];k=n+48|0;h[k>>3]=v;u=+h[b+8>>3];h[n+56>>3]=u;c[e>>2]=~~(v+(v>=0.0?.5:-.5));c[e+4>>2]=~~(u+(u>=0.0?.5:-.5));i=o+8|0;e=j+(m4(j,81099,e)|0)|0;r=1;g=0;while(1){m=g+3|0;if((m|0)>=(d|0))break;c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];f=1;while(1){if((f|0)==4){f=1;break}w=f+g|0;h[n+(f<<4)>>3]=+h[b+(w<<4)>>3];h[n+(f<<4)+8>>3]=+h[b+(w<<4)+8>>3];f=f+1|0;}while(1){if((f|0)==7)break;kP(o,n,3,+(f|0)*.16666666666666666,0,0);u=+h[o>>3];v=+h[i>>3];c[p>>2]=~~(u+(u>=0.0?.5:-.5));c[p+4>>2]=~~(v+(v>=0.0?.5:-.5));f=f+1|0;e=e+(m4(e,81099,p)|0)|0;}r=r+6|0;g=m;}c[q>>2]=j;uF(a,81106,q);U1(j);f=r+-1|0;e=0;while(1){if((e|0)>=(r|0))break;c[s>>2]=((e|0)%(f|0)|0|0)!=0&1;uF(a,81111,s);e=e+1|0;}oF(a,153599)|0;l=t;return}function yf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=l;l=l+16|0;Af(c[a+16>>2]|0,e+8|0,e);Bf(a,b,d,0);l=e;return}function zf(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=81094;c[e+4>>2]=b;uF(a,81087,e);l=d;return}function Af(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0;switch(c[a+144>>2]|0){case 1:{e=10.0;a=1;break}case 2:{e=10.0;a=2;break}default:{e=0.0;a=0;}}c[b>>2]=a;h[d>>3]=e;return}function Bf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0;j=l;l=l+16|0;i=j+8|0;g=j;f=0;while(1){if((f|0)>=(d|0))break;m=+h[b+(f<<4)>>3];k=+h[b+(f<<4)+8>>3];c[g>>2]=~~(m+(m>=0.0?.5:-.5));c[g+4>>2]=~~(k+(k>=0.0?.5:-.5));uF(a,81099,g);f=f+1|0;}if(e|0){k=+h[b>>3];m=+h[b+8>>3];c[i>>2]=~~(k+(k>=0.0?.5:-.5));c[i+4>>2]=~~(m+(m>=0.0?.5:-.5));uF(a,81099,i);}oF(a,153599)|0;l=j;return}function Cf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;a:while(1){d=15828;while(1){e=c[d+4>>2]|0;if(!e)break;if(!(s2(e,b)|0)){g=6;break a}d=d+8|0;}c[f>>2]=81255;c[f+4>>2]=b;gA(1,81229,f)|0;d=E4(b,45)|0;if(!d){d=81272;break}a[d>>0]=0;}l=h;return d|0}function Df(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i;d=c[46732]|0;if(!d){c[46733]=64;d=T1(64)|0;c[46732]=d;e=0;}else e=0;while(1){g=b+1|0;f=a[b>>0]|0;if(!(f<<24>>24))break;b=c[46733]|0;if((e|0)>(b+-8|0)){d=b<<1;c[46733]=d;d=W1(c[46732]|0,d)|0;c[46732]=d;d=d+e|0;}if(f<<24>>24<=-1){a[d>>0]=92;c[h>>2]=f&255;m4(d+1|0,81224,h)|0;b=g;d=d+4|0;e=e+4|0;continue}if(f<<24>>24==92){a[d>>0]=92;e=e+1|0;d=d+1|0;}a[d>>0]=f;b=g;d=d+1|0;e=e+1|0;}a[d>>0]=0;l=i;return c[46732]|0}function Ef(){var a=0,b=0;a=l;l=l+16|0;b=a;c[b>>2]=81255;c[b+4>>2]=91269;gA(0,83634,b)|0;l=a;return}function Ff(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0;e=l;l=l+32|0;f=e+8|0;j=e;b=b+8|0;k=c[b>>2]|0;c[j>>2]=k;c[j+4>>2]=k;uF(a,84223,j);i=(+h[d>>3]+ +h[d+16>>3])*.5;g=(+h[d+8>>3]+ +h[d+24>>3])*.5;c[f>>2]=c[b>>2];h[f+8>>3]=i;h[f+16>>3]=g;uF(a,84265,f);l=e;return}function Gf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0.0;e=l;l=l+48|0;f=e;i=+h[d>>3];k=+h[d+16>>3]-i;g=+h[d+24>>3];j=g-+h[d+8>>3];g=+(~~(+h[a+232>>3]-+h[a+216>>3])>>>0)-g;c[f>>2]=c[b+8>>2];h[f+8>>3]=k;h[f+16>>3]=j;h[f+24>>3]=i;h[f+32>>3]=g;uF(a,84310,f);oF(a,84402)|0;l=e;return}function Hf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return}function If(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0;t=l;l=l+160|0;s=t+152|0;r=t+136|0;q=t+120|0;k=t+112|0;n=t+104|0;m=t+88|0;j=t+72|0;i=t+64|0;o=t;if(!a)qa(111282,84407,212,84426);if(!b)qa(111312,84407,213,84426);p=b+8|0;if(!(c[p>>2]|0))qa(111315,84407,214,84426);if(c[b+52>>2]|0){c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];b=o+32|0;d=d+16|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];f=+h[o>>3];h[o+16>>3]=f;h[o+24>>3]=+h[o+40>>3];h[o+48>>3]=+h[b>>3];g=+h[o+8>>3];h[o+56>>3]=g;if(e<<24>>24){uF(a,84447,i);b=0;while(1){if((b|0)==4)break;u=+h[o+(b<<4)+8>>3];h[j>>3]=+h[o+(b<<4)>>3];h[j+8>>3]=u;uF(a,84450,j);b=b+1|0;}h[m>>3]=f;h[m+8>>3]=g;uF(a,84450,m);m=c[p>>2]|0;c[n>>2]=4;c[n+4>>2]=m;uF(a,84457,n);}uF(a,84447,k);b=0;while(1){if((b|0)==4)break;u=+h[o+(b<<4)+8>>3];h[q>>3]=+h[o+(b<<4)>>3];h[q+8>>3]=u;uF(a,84450,q);b=b+1|0;}h[r>>3]=f;h[r+8>>3]=g;uF(a,84450,r);r=c[p>>2]|0;c[s>>2]=4;c[s+4>>2]=r;uF(a,84472,s);}l=t;return}function Jf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+112|0;n=o+24|0;m=o+16|0;k=o;i=o+28|0;if(!b)qa(111282,84407,153,84488);if(!d)qa(111312,84407,154,84488);if(!(c[d+8>>2]|0))qa(111315,84407,155,84488);j=d+52|0;if(c[j>>2]|0){f=d+60|0;g=c[f>>2]|0;if((g|0)==100)g=18;else {tb[g&127](d);c[j>>2]=0;c[f>>2]=0;c[d+56>>2]=0;g=10;}}else g=10;do if((g|0)==10){if(!((OF(d)|0)<<24>>24))break;f=A6(c[d+20>>2]|0)|0;if((c[d+24>>2]&-2|0)==6){Z4(f,i)|0;i=c[i+36>>2]|0;c[d+56>>2]=i;f=j2(0,i,1,1,f,0)|0;c[j>>2]=f;a[d+16>>0]=1;}else f=c[j>>2]|0;if(f|0)c[d+60>>2]=100;PF(d);if(c[j>>2]|0)g=18;}while(0);if((g|0)==18){p=+h[e+8>>3]-+(c[d+36>>2]|0);h[k>>3]=+h[e>>3]-+(c[d+32>>2]|0);h[k+8>>3]=p;uF(b,84506,k);if(!(a[d+16>>0]|0)){c[m>>2]=c[d+12>>2];uF(b,84537,m);}else zM(b,d);uF(b,84552,n);}l=o;return}function Kf(a){a=a|0;h2(c[a+52>>2]|0,c[a+56>>2]|0)|0;return}function Lf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+80|0;f=g+48|0;if(!a)qa(111282,84407,121,84562);e=c[a+16>>2]|0;if(!e)qa(99902,84407,123,84562);if(!b)qa(111312,84407,124,84562);d=b+8|0;if(!(c[d>>2]|0))qa(111315,84407,125,84562);if(!(c[e+8>>2]|0))qa(138879,84407,128,84562);else {uF(a,84582,g);uF(a,84591,g+8|0);uF(a,84618,g+16|0);uF(a,84643,g+24|0);uF(a,84672,g+32|0);uF(a,84700,g+40|0);c[f>>2]=c[d>>2];uF(a,84707,f);uF(a,84746,g+56|0);uF(a,111008,g+64|0);l=g;return}}function Mf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0.0;i=l;l=l+128|0;g=i+80|0;f=i;if(!a)qa(111282,84407,97,84751);if(!b)qa(111312,84407,98,84751);e=c[b+8>>2]|0;if(!e)qa(111315,84407,99,84751);else {m=+h[d>>3];j=~~(m+(m>=0.0?.5:-.5));m=+h[d+8>>3];b=~~(m+(m>=0.0?.5:-.5));m=+h[d+16>>3];k=~~(m+(m>=0.0?.5:-.5));m=+h[d+24>>3];d=~~(m+(m>=0.0?.5:-.5));c[f>>2]=2;c[f+4>>2]=5;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=-1;c[f+24>>2]=1;c[f+28>>2]=-1;c[f+32>>2]=0;h[f+40>>3]=0.0;c[f+48>>2]=0;c[f+52>>2]=0;c[f+56>>2]=0;c[f+60>>2]=0;c[f+64>>2]=0;c[f+68>>2]=5;c[f+72>>2]=0;c[f+76>>2]=e;uF(a,84770,f);c[g>>2]=j;c[g+4>>2]=b;c[g+8>>2]=j;c[g+12>>2]=d;c[g+16>>2]=k;c[g+20>>2]=d;c[g+24>>2]=k;c[g+28>>2]=b;c[g+32>>2]=j;c[g+36>>2]=b;uF(a,84828,g);l=i;return}}function Nf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;o=l;l=l+96|0;n=o+56|0;m=o+32|0;k=o;i=+h[d>>3];j=+h[d+16>>3]-i;f=+h[d+24>>3];g=f-+h[d+8>>3];if(!a)qa(111282,84407,53,84860);if(!b)qa(111312,84407,54,84860);e=b+8|0;if(!(c[e>>2]|0))qa(111315,84407,55,84860);oF(a,84879)|0;oF(a,c[e>>2]|0)|0;e=a+360|0;f=-f;if(!(c[e>>2]|0)){h[n>>3]=j;h[n+8>>3]=g;h[n+16>>3]=i;h[n+24>>3]=f;uF(a,85008,n);}else {h[k>>3]=g;h[k+8>>3]=j;h[k+16>>3]=i;h[k+24>>3]=f;uF(a,84899,k);c[m>>2]=c[e>>2];h[m+8>>3]=i;h[m+16>>3]=f;uF(a,84978,m);}oF(a,85087)|0;l=o;return}function Of(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;Pf(b);b=kC(a,b)|0;}c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;Qf(b);b=ZA(a,b)|0;}c=kC(a,c)|0;}return}function Pf(a){a=a|0;var b=0,d=0;TC(a,137447,304,1)|0;sP(a);qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);a=a+16|0;c[(c[a>>2]|0)+176>>2]=0;b=JK(20)|0;d=c[a>>2]|0;c[d+172>>2]=b;c[d+184>>2]=0;d=JK(20)|0;b=c[a>>2]|0;c[b+180>>2]=d;c[b+200>>2]=0;b=JK(12)|0;d=c[a>>2]|0;c[d+196>>2]=b;c[d+192>>2]=0;d=JK(12)|0;b=c[a>>2]|0;c[b+188>>2]=d;c[b+208>>2]=0;b=JK(12)|0;a=c[a>>2]|0;c[a+204>>2]=b;c[a+216>>2]=1;return}function Qf(d){d=d|0;var e=0,f=0,g=0,h=0,i=0;TC(d,137460,176,1)|0;tP(d)|0;h=ZO(d,c[47174]|0,1,0)|0;g=d+16|0;c[(c[g>>2]|0)+156>>2]=h;h=aP(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,c[47168]|0,195059)|0;i=aP(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,c[47168]|0,195059)|0;e=c[g>>2]|0;f=e+154|0;b[f>>1]=1;b[e+168>>1]=1;if((h|0)==(i|0)&(a[h>>0]|0)!=0){b[f>>1]=1e3;i=e+156|0;c[i>>2]=(c[i>>2]|0)*100;}if(Mk(d)|0){i=c[g>>2]|0;b[i+154>>1]=0;c[i+156>>2]=0;}i=(ZO(d,c[47187]|0,0,0)|0)&255;a[(c[g>>2]|0)+152>>0]=i;i=(ZO(d,c[47175]|0,1,0)|0)&65535;b[(c[g>>2]|0)+170>>1]=i;return}function Rf(a){a=a|0;var b=0,d=0;Sf(c[(c[a+16>>2]|0)+192>>2]|0);d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}Tf(d);d=kC(a,d)|0;}Uf(a);return}function Sf(b){b=b|0;var d=0,e=0,f=0,g=0;while(1){if(!b)break;f=b+16|0;g=c[(c[f>>2]|0)+164>>2]|0;Vf(b);d=c[f>>2]|0;if((a[d+156>>0]|0)!=1){b=g;continue}e=c[d+180>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+172>>2]|0;if(e){U1(e);d=c[f>>2]|0;}U1(d);U1(b);b=g;}return}function Tf(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;b=c[e>>2]|0;d=c[b+172>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+180>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+188>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+196>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+204>>2]|0;if(d){U1(d);b=c[e>>2]|0;}CK(c[b+104>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);b=c[(c[e>>2]|0)+8>>2]|0;if(b|0)tb[c[(c[b+4>>2]|0)+4>>2]&127](a);VC(a,137447)|0;return}function Uf(a){a=a|0;var d=0,e=0,f=0;d=OD(a)|0;while(1){if(!d)break;Uf(d);d=PD(d)|0;}if(TC(a,137483,0,1)|0){f=a+16|0;d=c[f>>2]|0;e=c[d+184>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+268>>2]|0;if(e){U1(e);d=c[f>>2]|0;}e=c[d+216>>2]|0;if(e){U1(e);d=c[f>>2]|0;}do if(c[d+196>>2]|0){e=b[d+236>>1]|0;while(1){if((e|0)>(b[d+238>>1]|0))break;U1(c[(c[d+196>>2]|0)+(e<<6)+12>>2]|0);e=e+1|0;d=c[f>>2]|0;}e=c[d+196>>2]|0;if((b[d+236>>1]|0)==-1){U1(e+-64|0);break}else {U1(e);break}}while(0);if((yC(a)|0)!=(a|0)){CK(c[(c[f>>2]|0)+12>>2]|0);VC(a,137483)|0;}}return}function Vf(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;d=c[e>>2]|0;b=c[d+176>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;b=c[(c[d+172>>2]|0)+(a<<2)>>2]|0;ih(b);U1(c[b+16>>2]|0);U1(b);b=a;d=c[e>>2]|0;}b=c[d+184>>2]|0;while(1){a=b+-1|0;if((b|0)<=0)break;b=c[(c[(c[e>>2]|0)+180>>2]|0)+(a<<2)>>2]|0;ih(b);U1(c[b+16>>2]|0);U1(b);b=a;}return}function Wf(a){a=a|0;if(tB(a)|0)Xf(a);tM(a);return}function Xf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=l;l=l+48|0;g=h+32|0;f=h;b=lH(a,-1,8)|0;d=mH(a,0,f)|0;kH(a,2,8,f)|0;d=(d|0)==0;e=(b|0)<0;if(e&d)Yf(a);else {if(d)c[f+16>>2]=3;else b=e?8:b;c[f+8>>2]=b;c[f+20>>2]=0;e=GG(a,g,0)|0;b=c[g>>2]|0;do if((b|0)==1){Yf(a);b=0;}else {if(c[(c[(c[a+16>>2]|0)+8>>2]|0)+84>>2]|0){Yf(a);b=0;break}c[f+12>>2]=1;d=0;while(1){if((d|0)>=(b|0))break;b=c[e+(d<<2)>>2]|0;Zf(b,a);Yf(b);d=d+1|0;b=c[g>>2]|0;}_f(a);jH(c[g>>2]|0,e,a,f)|0;$f(a);ag(c[g>>2]|0,e,a);b=0;}while(0);while(1){if((b|0)>=(c[g>>2]|0))break;f=e+(b<<2)|0;U1(c[(c[(c[f>>2]|0)+16>>2]|0)+8>>2]|0);Uf(c[f>>2]|0);wC(a,c[f>>2]|0)|0;b=b+1|0;}U1(e);}l=h;return}function Yf(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+40|0;e=m;i=ZO(a,GA(a,0,85102,0)|0,-1,1)|0;oQ(a,10);d=Lk(a,e)|0;cg(a,a);Of(a);f=(i|0)==1;g=e+32|0;h=(i|0)==2;i=(i|0)==3;j=e+28|0;e=e+24|0;while(1){xj(a,d);if(f){d=3;break}if(c[g>>2]|0){gA(0,85108,k)|0;c[e>>2]=0;d=0;}Hh(a,(d|0)!=0&1);if(h){d=7;break}Ki(a,d);if(i){d=9;break}n=(c[j>>2]|0)+-1|0;c[j>>2]=n;if(!((n|0)!=0&(c[e>>2]|0)!=0)){d=11;break}}if((d|0)==3)dg(a,1);else if((d|0)==7)dg(a,2);else if((d|0)==9)dg(a,2);else if((d|0)==11){if(b[(c[a+16>>2]|0)+136>>1]&16)eg(a);rk(a);ig(a);if((dP(QA(a,85199)|0)|0)<<24>>24)ll(a);}l=m;return}function Zf(b,d){b=b|0;d=d|0;var e=0,f=0;TC(b,137483,280,1)|0;e=JK(96)|0;b=c[b+16>>2]|0;c[b+8>>2]=e;d=c[d+16>>2]|0;f=c[d+8>>2]|0;h[e>>3]=+h[f>>3];h[e+24>>3]=+h[f+24>>3];c[b+144>>2]=c[d+144>>2];a[b+115>>0]=a[d+115>>0]|0;c[b+116>>2]=c[d+116>>2];c[b+248>>2]=c[d+248>>2];c[b+252>>2]=c[d+252>>2];c[b+244>>2]=c[d+244>>2];return}function _f(a){a=a|0;var b=0,d=0,e=0;b=JK((tB(a)|0)<<4)|0;d=jC(a)|0;while(1){if(!d)break;e=c[d+16>>2]|0;c[e+132>>2]=b;h[b>>3]=+h[e+16>>3]*.013888888888888888;h[b+8>>3]=+h[e+24>>3]*.013888888888888888;b=b+16|0;d=kC(a,d)|0;}return}function $f(a){a=a|0;var b=0,d=0,e=0,f=0;e=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;b=e;d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;c[f+132>>2]=0;h[f+16>>3]=+h[b>>3]*72.0;h[f+24>>3]=+h[b+8>>3]*72.0;b=b+16|0;d=kC(a,d)|0;}U1(e);return}function ag(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=0;f=0;while(1){if((e|0)>=(a|0))break;i=(c[(c[(c[b+(e<<2)>>2]|0)+16>>2]|0)+180>>2]|0)+f|0;e=e+1|0;f=i;}i=d+16|0;c[(c[i>>2]|0)+180>>2]=f;g=JK((f<<2)+4|0)|0;c[(c[i>>2]|0)+184>>2]=g;g=0;e=1;while(1){if((g|0)>=(a|0))break;h=(c[b+(g<<2)>>2]|0)+16|0;f=1;while(1){d=c[h>>2]|0;if((f|0)>(c[d+180>>2]|0))break;d=FG(c[(c[d+184>>2]|0)+(f<<2)>>2]|0)|0;c[(c[(c[i>>2]|0)+184>>2]|0)+(e<<2)>>2]=d;bg(c[(c[(c[h>>2]|0)+184>>2]|0)+(f<<2)>>2]|0,d);f=f+1|0;e=e+1|0;}g=g+1|0;}return}function bg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;TC(d,137483,280,1)|0;g=d+16|0;d=(c[g>>2]|0)+16|0;f=b+16|0;b=(c[f>>2]|0)+16|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[d+16>>2]=c[b+16>>2];c[d+20>>2]=c[b+20>>2];c[d+24>>2]=c[b+24>>2];c[d+28>>2]=c[b+28>>2];b=c[f>>2]|0;d=c[g>>2]|0;a[d+275>>0]=a[b+275>>0]|0;d=d+48|0;b=b+48|0;e=d+64|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0;}while((d|0)<(e|0));b=c[(c[f>>2]|0)+180>>2]|0;c[(c[g>>2]|0)+180>>2]=b;d=JK((b<<2)+4|0)|0;c[(c[g>>2]|0)+184>>2]=d;d=1;while(1){e=c[f>>2]|0;if((d|0)>(b|0))break;e=FG(c[(c[e+184>>2]|0)+(d<<2)>>2]|0)|0;c[(c[(c[g>>2]|0)+184>>2]|0)+(d<<2)>>2]=e;bg(c[(c[(c[f>>2]|0)+184>>2]|0)+(d<<2)>>2]|0,e);d=d+1|0;}f=e+12|0;c[(c[g>>2]|0)+12>>2]=c[f>>2];c[f>>2]=0;return}function cg(a,b){a=a|0;b=b|0;if((yC(a)|0)!=(a|0))TC(a,137483,280,1)|0;if((a|0)==(b|0))c[(c[(yC(a)|0)+16>>2]|0)+188>>2]=a;a=OD(a)|0;while(1){if(!a)break;cg(a,b);a=PD(a)|0;}return}function dg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+1040|0;k=m+8|0;j=m;e=m+16|0;f=GA(a,1,87171,195059)|0;g=GA(a,1,85242,195059)|0;h=(b|0)>0;d=(b|0)==1;b=jC(a)|0;while(1){if(!b)break;if(h?(i=b+16|0,c[j>>2]=c[(c[i>>2]|0)+232>>2],m4(e,137395,j)|0,KA(b,f,e)|0,!d):0){c[k>>2]=c[(c[i>>2]|0)+236>>2];m4(e,137395,k)|0;KA(b,g,e)|0;}b=kC(a,b)|0;}l=m;return}function eg(a){a=a|0;var b=0,c=0,d=0;c=ND(a,86675,0)|0;if(c|0){b=jC(c)|0;while(1){if(!b)break;d=kC(c,b)|0;qh(a,b);fg(a,b);Tf(b);vC(a,b)|0;b=d;}RD(a,c)|0;}return}function fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=c[(c[b+16>>2]|0)+232>>2]|0;i=a+16|0;a=c[(c[i>>2]|0)+196>>2]|0;d=c[a+(j<<6)>>2]|0;h=a+(j<<6)+4|0;g=0;e=0;while(1){if((e|0)>=(d|0)){f=7;break}f=c[(c[h>>2]|0)+(e<<2)>>2]|0;e=e+1|0;if((f|0)==(b|0)){f=4;break}else g=f;}if((f|0)==4){while(1){if((e|0)>=(d|0))break;f=c[a+(j<<6)+4>>2]|0;c[f+(e+-1<<2)>>2]=c[f+(e<<2)>>2];f=c[(c[i>>2]|0)+196>>2]|0;e=e+1|0;d=c[f+(j<<6)>>2]|0;a=f;f=4;}c[a+(j<<6)>>2]=d+-1;}else if((f|0)==7?(g|0)!=(b|0):0)qa(85208,85215,248,85225);return}function gg(a){a=a|0;return c[(c[(yC(a)|0)+16>>2]|0)+188>>2]|0}function hg(b,c){b=b|0;c=c|0;var d=0;d=a[b+28>>0]|0;if(a[c+28>>0]|0)if(d<<24>>24){d=~~(+h[b>>3]-+h[c>>3]);if(!d)d=~~(+h[b+8>>3]-+h[c+8>>3]);}else d=-1;else d=d<<24>>24!=0&1;return d|0}function ig(a){a=a|0;jg(a,1);return}function jg(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0.0;Z=l;l=l+656|0;O=Z+592|0;N=Z+552|0;f=Z+544|0;T=Z+96|0;U=Z;Y=Z+632|0;V=d+16|0;X=b[(c[V>>2]|0)+136>>1]&14;P=X&65535;Q=T+16|0;c[Q>>2]=Z+368;R=U+16|0;c[R>>2]=Z+192;do if(X<<16>>16){S=X<<16>>16==4;do if(S){kg(d);if(!(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1))A=9;else {gA(0,85248,f)|0;A=9;}}else if(X<<16>>16==8){kg(d);if(!(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1)){rQ(d,0);n=0;m=0;k=0;break}else {lg(d);rQ(d,1);n=0;m=0;k=0;break}}else A=9;while(0);if((A|0)==9){jl(d);if(FM()|0)break;W=JK(96)|0;K=c[(c[V>>2]|0)+248>>2]|0;c[Y+8>>2]=(K|0)/4|0;c[Y+12>>2]=K;k=JK(512)|0;F=Y+4|0;c[F>>2]=0;c[Y>>2]=0;j=c[V>>2]|0;C=b[j+236>>1]|0;D=0;L=0;M=k;E=k;m=k;n=k;o=k;H=0;I=0;a:while(1){if((C|0)>(b[j+238>>1]|0))break;p=c[j+196>>2]|0;i=c[p+(C<<6)>>2]|0;G=i+D|0;g=c[p+(C<<6)+4>>2]|0;f=c[g>>2]|0;if(!f)f=H;else {_=+(H|0);f=c[f+16>>2]|0;y=+h[f+16>>3]-+h[f+88>>3];f=~~(y>_?_:y);}if((i|0)!=0?(J=c[g+(i+-1<<2)>>2]|0,(J|0)!=0):0){y=+(I|0);g=c[J+16>>2]|0;_=+h[g+96>>3]+ +h[g+16>>3];g=~~(_=(i|0))break;k=c[(c[f+(C<<6)+4>>2]|0)+(x<<2)>>2]|0;w=k+16|0;f=c[w>>2]|0;i=c[f+112>>2]|0;if(i){i=i+16|0;j=c[(c[i>>2]|0)+96>>2]|0;if(!j){A=21;break a}s=j+56|0;f=f+16|0;c[s>>2]=c[f>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];c[s+12>>2]=c[f+12>>2];a[(c[(c[i>>2]|0)+96>>2]|0)+81>>0]=1;f=c[w>>2]|0;}if((a[f+156>>0]|0)!=0?(kb[c[17300>>2]&63](k)|0)<<24>>24==0:0){q=t;f=r;j=u;k=v;i=o;}else {s=0;q=t;j=u;k=v;A=25;}b:do if((A|0)==25){while(1){A=0;p=c[w>>2]|0;i=c[(c[p+180>>2]|0)+(s<<2)>>2]|0;if(!i)break;switch(a[(c[i+16>>2]|0)+112>>0]|0){case 6:case 4:{f=q;i=r;break}default:{mg(i,1,16,64);f=q+1|0;c[r+(q<<2)>>2]=i;if(!(f&127)){g=MK(g,(q<<2)+516|0)|0;i=g;j=g;k=g;n=g;o=g;}else i=r;}}s=s+1|0;q=f;r=i;A=25;}f=c[p+188>>2]|0;c:do if(!f)i=o;else {s=0;i=o;while(1){f=c[f+(s<<2)>>2]|0;if(!f)break c;mg(f,2,0,128);o=q+1|0;c[r+(q<<2)>>2]=f;if(!(o&127)){g=MK(i,(q<<2)+516|0)|0;f=g;j=g;k=g;n=g;i=g;}else f=r;p=c[w>>2]|0;s=s+1|0;q=o;r=f;f=c[p+188>>2]|0;}}while(0);f=c[p+204>>2]|0;if(!f)f=r;else {if(!(a[p+156>>0]|0)){v=p+96|0;_=+h[v>>3];s=p+240|0;h[v>>3]=+h[s>>3];h[s>>3]=_;s=0;p=r;}else {s=0;p=r;}while(1){f=c[f+(s<<2)>>2]|0;if(!f){f=p;break b}mg(f,0,0,128);o=q+1|0;c[p+(q<<2)>>2]=f;if(!(o&127)){g=MK(n,(q<<2)+516|0)|0;f=g;j=g;k=g;n=g;i=g;}else f=p;s=s+1|0;q=o;p=f;f=c[(c[w>>2]|0)+204>>2]|0;}}}while(0);u=c[V>>2]|0;w=c[u+196>>2]|0;x=x+1|0;t=q;r=f;q=u;u=j;v=k;o=i;i=c[w+(C<<6)>>2]|0;f=w;}C=C+1|0;D=G;L=t;M=r;E=u;j=q;m=v;k=g;H=B;I=z;}if((A|0)==21)qa(85316,85329,313,85342);c[Y>>2]=H;c[F>>2]=I;o4(E,L,4,58);c[W+84>>2]=JK((D<<5)+11520|0)|0;c[Y+16>>2]=JK(C<<5)|0;d:do if(X<<16>>16==2){f=(c[V>>2]|0)+192|0;while(1){g=c[f>>2]|0;if(!g)break d;i=g+16|0;f=c[i>>2]|0;if((a[f+156>>0]|0)==1?(c[f+104>>2]|0)!=0:0){og(g);f=c[i>>2]|0;}f=f+164|0;}}while(0);z=U+48|0;A=U+-48|0;B=T+48|0;C=T+-48|0;y=+(K|0);x=0;e:while(1){if((x|0)>=(L|0))break;v=M+(x<<2)|0;r=c[v>>2]|0;s=pg(r)|0;t=r+16|0;g=c[t>>2]|0;if(!(a[g+44>>0]|0)){g=(a[g+84>>0]|0)==0?s:r;f=g;g=c[g+16>>2]|0;}else f=r;i=f+16|0;if(c[g+164>>2]&32){g=c[Q>>2]|0;W6(g|0,c[i>>2]|0,176)|0;n=T;o=f;p=n+48|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));c[Q>>2]=g;o=c[f>>2]&3;n=c[T>>2]&3;c[((n|0)==3?T:B)+40>>2]=c[((o|0)==2?f:f+-48|0)+40>>2];c[((n|0)==2?T:C)+40>>2]=c[((o|0)==3?f:f+48|0)+40>>2];n=g+16|0;o=(c[i>>2]|0)+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=g+56|0;o=(c[i>>2]|0)+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));a[g+112>>0]=1;c[g+116>>2]=f;f=T;}q=f+16|0;w=1;f=x;while(1){u=f+1|0;if((u|0)>=(L|0))break;j=M+(u<<2)|0;f=c[j>>2]|0;if((s|0)!=(pg(f)|0))break;if(!(a[(c[t>>2]|0)+113>>0]|0)){k=f+16|0;g=c[k>>2]|0;if(!(a[g+44>>0]|0)){g=(a[g+84>>0]|0)==0?s:f;f=g;g=c[g+16>>2]|0;}i=f+16|0;if(c[g+164>>2]&32){g=c[R>>2]|0;W6(g|0,c[i>>2]|0,176)|0;n=U;o=f;p=n+48|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));c[R>>2]=g;o=c[f>>2]&3;n=c[U>>2]&3;c[((n|0)==3?U:z)+40>>2]=c[((o|0)==2?f:f+-48|0)+40>>2];c[((n|0)==2?U:A)+40>>2]=c[((o|0)==3?f:f+48|0)+40>>2];n=g+16|0;o=(c[i>>2]|0)+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=g+56|0;o=(c[i>>2]|0)+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));a[g+112>>0]=1;c[g+116>>2]=f;}i=c[q>>2]|0;f=g+16|0;n=N;o=i+16|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=O;o=f;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));if(hg(N,O)|0)break;f=g+56|0;n=N;o=i+56|0;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));n=O;o=f;p=n+40|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0;}while((n|0)<(p|0));if(hg(N,O)|0)break;K=c[t>>2]|0;if((c[K+164>>2]&15|0)==2?(c[K+96>>2]|0)!=(c[(c[k>>2]|0)+96>>2]|0):0)break;if(c[(c[(c[j>>2]|0)+16>>2]|0)+164>>2]&64|0)break}w=w+1|0;f=u;}if(S){if((w|0)==1)f=O;else f=JK(w<<2)|0;c[f>>2]=pg(c[v>>2]|0)|0;g=1;while(1){if((g|0)>=(w|0))break;c[f+(g<<2)>>2]=c[v+(g<<2)>>2];g=g+1|0;}PM(d,f,w,P,17296);if((w|0)>1)U1(f);x=u;continue}f=c[r>>2]&3;K=c[((f|0)==3?r:r+48|0)+40>>2]|0;f=c[((f|0)==2?r:r+-48|0)+40>>2]|0;g=c[K+16>>2]|0;i=c[g+232>>2]|0;if((K|0)!=(f|0))if((i|0)==(c[(c[f+16>>2]|0)+232>>2]|0)){qg(d,Y,W,M,x,w,P);x=u;continue}else {rg(d,Y,W,M,x,w,P);x=u;continue}f=c[V>>2]|0;do if((i|0)==(b[f+238>>1]|0))if((i|0)>0){f=~~(+h[(c[(c[c[(c[f+196>>2]|0)+(i+-1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[g+24>>3]);break}else {f=~~+h[g+80>>3];break}else if((i|0)==(b[f+236>>1]|0)){f=~~(+h[g+24>>3]-+h[(c[(c[c[(c[f+196>>2]|0)+(i+1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]);break}else {f=c[f+196>>2]|0;_=+h[g+24>>3];K=~~(+h[(c[(c[c[f+(i+-1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-_);f=~~(_-+h[(c[(c[c[f+(i+1<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]);f=(K|0)<(f|0)?K:f;break}while(0);lO(W,M,x,w,y,+((f|0)/2|0|0),17296);f=0;while(1){if((f|0)>=(w|0)){x=u;continue e}g=c[(c[(c[M+(f+x<<2)>>2]|0)+16>>2]|0)+96>>2]|0;if(g|0)zP(d,g);f=f+1|0;}}f=(c[V>>2]|0)+192|0;while(1){g=c[f>>2]|0;if(!g)break;i=g+16|0;f=c[i>>2]|0;if((a[f+156>>0]|0)==1?(c[f+104>>2]|0)!=0:0){og(g);zP(d,c[(c[i>>2]|0)+104>>2]|0);f=c[i>>2]|0;}f=f+164|0;}if(!e){n=W;k=W;}else {sg(d);n=W;k=W;}}f:do if((c[47197]|0)!=0|(c[47198]|0)!=0?(c[47203]|0)!=0|(c[47202]|0)!=0:0){j=jC(d)|0;while(1){if(!j)break f;g:do if(c[47197]|0){f=_A(d,j)|0;while(1){if(!f)break g;g=f+-48|0;i=(c[f>>2]&3|0)==2?f:g;if(c[(c[i+16>>2]|0)+100>>2]|0){tO(i,1)|0;zP(d,c[(c[((c[f>>2]&3|0)==2?f:g)+16>>2]|0)+100>>2]|0);}f=$A(d,f)|0;}}while(0);h:do if(c[47198]|0){f=XA(d,j)|0;while(1){if(!f)break h;g=f+16|0;if(c[(c[g>>2]|0)+104>>2]|0?tO(f,0)|0:0)zP(d,c[(c[g>>2]|0)+104>>2]|0);f=ZA(d,f)|0;}}while(0);j=kC(d,j)|0;}}while(0);switch(X&15){case 4:case 8:break;default:{U1(m);U1(c[n+84>>2]|0);U1(k);U1(c[Y+16>>2]|0);GM();}}c[47138]=1;c[47139]=1;}while(0);l=Z;return}function kg(a){a=a|0;var b=0,d=0,e=0.0,f=0;b=jC(a)|0;while(1){if(!b)break;d=c[b+16>>2]|0;if(c[d+204>>2]|0){f=d+96|0;e=+h[f>>3];d=d+240|0;h[f>>3]=+h[d>>3];h[d>>3]=e;}b=kC(a,b)|0;}return}function lg(b){b=b|0;var d=0,e=0,f=0,g=0;d=(c[b+16>>2]|0)+192|0;a:while(1){f=c[d>>2]|0;if(!f){d=12;break}g=f+16|0;d=c[g>>2]|0;do if((a[d+156>>0]|0)==1){e=c[d+112>>2]|0;if(!e){e=c[d+104>>2]|0;if(!e)break;og(f);d=e;}else {e=c[(c[e+16>>2]|0)+96>>2]|0;if(!e){d=6;break a}f=e+56|0;d=d+16|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];a[e+81>>0]=1;d=e;}zP(b,d);d=c[g>>2]|0;}while(0);d=d+164|0;}if((d|0)==6)qa(85516,85329,234,85535);else if((d|0)==12)return}function mg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0;do if(!d){g=c[b>>2]&3;d=c[((g|0)==3?b:b+48|0)+40>>2]|0;g=c[((g|0)==2?b:b+-48|0)+40>>2]|0;if((d|0)!=(g|0)){d=(c[(c[d+16>>2]|0)+232>>2]|0)==(c[(c[g+16>>2]|0)+232>>2]|0)?2:1;break}d=c[b+16>>2]|0;if(!(a[d+44>>0]|0))d=(a[d+84>>0]|0)==0?8:4;else d=4;}while(0);a:do if(!e)switch(d|0){case 1:{e=c[b>>2]&3;e=(c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)<(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)?16:32;break a}case 2:{e=c[b>>2]&3;e=(c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)<(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)?16:32;break a}default:{e=16;break a}}while(0);c[(c[b+16>>2]|0)+164>>2]=d|f|e;return}function ng(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;D=l;l=l+624|0;z=D+584|0;y=D+544|0;s=D+368|0;e=D+192|0;t=D+96|0;v=D;u=t+16|0;c[u>>2]=s;w=v+16|0;c[w>>2]=e;C=c[b>>2]|0;B=c[d>>2]|0;x=C+16|0;q=c[x>>2]|0;d=c[q+164>>2]|0;f=d&15;A=B+16|0;b=c[A>>2]|0;g=c[b+164>>2]&15;do if((g|0)==(f|0)){p=pg(C)|0;r=pg(B)|0;n=c[p>>2]|0;g=n&3;f=c[(c[((g|0)==3?p:p+48|0)+40>>2]|0)+16>>2]|0;g=c[(c[((g|0)==2?p:p+-48|0)+40>>2]|0)+16>>2]|0;i=(c[f+232>>2]|0)-(c[g+232>>2]|0)|0;o=c[r>>2]|0;m=o&3;k=c[(c[((m|0)==3?r:r+48|0)+40>>2]|0)+16>>2]|0;m=c[(c[((m|0)==2?r:r+-48|0)+40>>2]|0)+16>>2]|0;j=(c[k+232>>2]|0)-(c[m+232>>2]|0)|0;i=(i|0)>-1?i:0-i|0;j=(j|0)>-1?j:0-j|0;if((i|0)!=(j|0)){b=i-j|0;break}g=~~(+h[f+16>>3]-+h[g+16>>3]);g=(g|0)>-1?g:0-g|0;f=~~(+h[k+16>>3]-+h[m+16>>3]);f=(f|0)>-1?f:0-f|0;if((g|0)!=(f|0)){b=g-f|0;break}g=n>>>4;f=o>>>4;if((g|0)!=(f|0)){b=g-f|0;break}if(!(a[q+44>>0]|0)){d=(a[q+84>>0]|0)==0?p:C;g=d;d=c[(c[d+16>>2]|0)+164>>2]|0;}else g=C;f=g+16|0;if(d&32){W6(s|0,c[f>>2]|0,176)|0;i=t;j=g;k=i+48|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));c[u>>2]=s;j=c[g>>2]&3;i=c[t>>2]&3;c[((i|0)==3?t:t+48|0)+40>>2]=c[((j|0)==2?g:g+-48|0)+40>>2];c[((i|0)==2?t:t+-48|0)+40>>2]=c[((j|0)==3?g:g+48|0)+40>>2];i=s+16|0;j=(c[f>>2]|0)+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=s+56|0;j=(c[f>>2]|0)+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));a[s+112>>0]=1;c[s+116>>2]=g;g=t;b=c[A>>2]|0;}if(!(a[b+44>>0]|0)){b=(a[b+84>>0]|0)==0?r:B;f=b;b=c[b+16>>2]|0;}else f=B;d=f+16|0;if(!(c[b+164>>2]&32))e=b;else {W6(e|0,c[d>>2]|0,176)|0;i=v;j=f;k=i+48|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));c[w>>2]=e;j=c[f>>2]&3;i=c[v>>2]&3;c[((i|0)==3?v:v+48|0)+40>>2]=c[((j|0)==2?f:f+-48|0)+40>>2];c[((i|0)==2?v:v+-48|0)+40>>2]=c[((j|0)==3?f:f+48|0)+40>>2];i=e+16|0;j=(c[d>>2]|0)+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=e+56|0;j=(c[d>>2]|0)+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));a[e+112>>0]=1;c[e+116>>2]=f;}d=c[g+16>>2]|0;b=e+16|0;i=y;j=d+16|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=z;j=b;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));b=hg(y,z)|0;if(!b){b=e+56|0;i=y;j=d+56|0;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));i=z;j=b;k=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(k|0));b=hg(y,z)|0;if(!b){d=c[(c[x>>2]|0)+164>>2]&192;b=c[(c[A>>2]|0)+164>>2]&192;if((d|0)==(b|0)){b=((c[C>>2]|0)>>>4)-((c[B>>2]|0)>>>4)|0;break}else {b=d-b|0;break}}}}else b=g-f|0;while(0);l=D;return b|0}function og(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0;f=b+16|0;d=c[f>>2]|0;if(c[d+176>>2]|0){d=c[d+180>>2]|0;while(1){d=(c[d>>2]|0)+16|0;e=c[d>>2]|0;if(!(a[e+112>>0]|0))break;else d=e+116|0;}e=c[e+96>>2]|0;g=+h[e+24>>3];i=+h[e+32>>3];e=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)!=0;b=c[f>>2]|0;f=c[(c[d>>2]|0)+96>>2]|0;h[f+56>>3]=(e?i:g)*.5+ +h[b+16>>3];h[f+64>>3]=+h[b+24>>3];a[f+81>>0]=1;}return}function pg(a){a=a|0;var b=0,d=0;while(1){b=c[a+16>>2]|0;d=c[b+172>>2]|0;if(!d)break;else a=d;}while(1){b=c[b+116>>2]|0;if(!b)break;a=b;b=c[b+16>>2]|0;}return a|0}function qg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0;B=l;l=l+1712|0;x=B+1664|0;s=B+1488|0;t=B+1392|0;A=B+1696|0;y=B+696|0;z=B;p=t+16|0;c[p>>2]=s;q=c[f+(g<<2)>>2]|0;r=q+16|0;k=c[r>>2]|0;u=a[k+113>>0]|0;if(c[k+164>>2]&32){W6(s|0,k|0,176)|0;k=t;n=q;o=k+48|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));c[p>>2]=s;k=c[t>>2]&3;c[((k|0)==3?t:t+48|0)+40>>2]=c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2];c[((k|0)==2?t:t+-48|0)+40>>2]=c[((c[q>>2]&3|0)==3?q:q+48|0)+40>>2];k=s+16|0;n=(c[r>>2]|0)+56|0;o=k+40|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));k=s+56|0;n=(c[r>>2]|0)+16|0;o=k+40|0;do{c[k>>2]=c[n>>2];k=k+4|0;n=n+4|0;}while((k|0)<(o|0));a[s+112>>0]=1;c[s+116>>2]=q;q=t;}k=1;while(1){if((k|0)>=(i|0)){w=6;break}if(!(a[(c[(c[f+(k+g<<2)>>2]|0)+16>>2]|0)+113>>0]|0))k=k+1|0;else {w=7;break}}a:do if((w|0)==6)if(!(u<<24>>24)){k=c[q+16>>2]|0;if(c[k+96>>2]|0){Qg(b,d,e,q,j);break}if((j|0)==2){A=c[q>>2]&3;Rg(c[((A|0)==3?q:q+48|0)+40>>2]|0,c[((A|0)==2?q:q+-48|0)+40>>2]|0,f,g,i,2);break}t=a[k+49>>0]|0;u=a[k+89>>0]|0;if(!(t<<24>>24==1&u<<24>>24!=4)?!(t<<24>>24!=4&u<<24>>24==1):0){p=c[q>>2]&3;o=c[((p|0)==3?q:q+48|0)+40>>2]|0;p=c[((p|0)==2?q:q+-48|0)+40>>2]|0;k=c[o+16>>2]|0;n=c[k+232>>2]|0;if((n|0)>0){u=c[(c[b+16>>2]|0)+196>>2]|0;t=n+~(a[(c[(c[b+60>>2]|0)+16>>2]|0)+113>>0]&1)|0;m=+h[(c[(c[c[u+(t<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[u+(t<<6)+16>>3]-+h[k+24>>3]-+h[u+(n<<6)+24>>3];}else m=+(c[(c[b+16>>2]|0)+252>>2]|0);C=+(i+1|0);v=+(c[d+12>>2]|0)/C;m=m/C;Tg(b,d,e,o,q,y,1);Tg(b,d,e,p,q,z,0);s=y+52|0;t=z+52|0;p=(j|0)==10;q=e+80|0;k=0;while(1){if((k|0)>=(i|0))break a;r=c[f+(k+g<<2)>>2]|0;o=c[s>>2]|0;n=o+-1|0;G=+h[y+56+(n<<5)>>3];F=+h[y+56+(n<<5)+16>>3];E=+h[y+56+(n<<5)+24>>3];h[19215]=G;h[19216]=E;k=k+1|0;C=+(k|0);D=v*C;h[19217]=F+D;C=E+m*C;h[19218]=C;h[19219]=G;h[19220]=C;n=(c[t>>2]|0)+-1|0;G=+h[z+56+(n<<5)+16>>3];h[19221]=G;h[19222]=C+m;E=+h[z+56+(n<<5)>>3];F=+h[z+56+(n<<5)+24>>3];h[19225]=G;h[19224]=F;h[19223]=E-D;h[19226]=C;n=0;while(1){if((n|0)>=(o|0)){n=0;break}o=y+56+(n<<5)|0;c[x>>2]=c[o>>2];c[x+4>>2]=c[o+4>>2];c[x+8>>2]=c[o+8>>2];c[x+12>>2]=c[o+12>>2];c[x+16>>2]=c[o+16>>2];c[x+20>>2]=c[o+20>>2];c[x+24>>2]=c[o+24>>2];c[x+28>>2]=c[o+28>>2];fO(e,x);n=n+1|0;o=c[s>>2]|0;}while(1){if((n|0)==3)break;j=153720+(n<<5)|0;c[x>>2]=c[j>>2];c[x+4>>2]=c[j+4>>2];c[x+8>>2]=c[j+8>>2];c[x+12>>2]=c[j+12>>2];c[x+16>>2]=c[j+16>>2];c[x+20>>2]=c[j+20>>2];c[x+24>>2]=c[j+24>>2];c[x+28>>2]=c[j+28>>2];fO(e,x);n=n+1|0;}o=c[t>>2]|0;while(1){n=o+-1|0;if((o|0)<=0)break;o=z+56+(n<<5)|0;c[x>>2]=c[o>>2];c[x+4>>2]=c[o+4>>2];c[x+8>>2]=c[o+8>>2];c[x+12>>2]=c[o+12>>2];c[x+16>>2]=c[o+16>>2];c[x+20>>2]=c[o+20>>2];c[x+24>>2]=c[o+24>>2];c[x+28>>2]=c[o+28>>2];fO(e,x);o=n;}if(p)n=HM(e,A)|0;else n=NM(e,A)|0;o=c[A>>2]|0;if(!o)break a;dO(r,c[((c[r>>2]&3|0)==2?r:r+-48|0)+40>>2]|0,n,o,17296);c[q>>2]=0;}}Sg(b,d,e,f,g,i,q,(j|0)==10&1);}else w=7;while(0);if((w|0)==7)Pg(b,f,g,i,q,j);l=B;return}function rg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;ba=l;l=l+2576|0;S=ba+2528|0;_=ba+2568|0;k=ba+2352|0;n=ba+2176|0;t=ba+1904|0;Y=ba+1808|0;$=ba+1712|0;T=ba+1016|0;U=ba+320|0;V=ba+256|0;X=ba+2564|0;Z=ba+2560|0;z=ba+288|0;A=ba+224|0;L=ba+192|0;M=ba+160|0;N=ba+128|0;P=ba+96|0;Q=ba+64|0;R=ba+32|0;W=ba;s=t+16|0;c[s>>2]=k;o=Y+16|0;c[o>>2]=n;aa=$+16|0;c[aa>>2]=ba+2e3;if(!(c[46734]|0)){c[46734]=KK(32e3)|0;c[46735]=KK(32e3)|0;c[46736]=2e3;c[46737]=2e3;}u=c[f+(g<<2)>>2]|0;K=c[u>>2]&3;p=u+48|0;q=u+-48|0;K=(c[(c[(c[((K|0)==3?u:p)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((K|0)==2?u:q)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0;r=u+16|0;if((((K|0)>-1?K:0-K|0)|0)<=1){k=c[r>>2]|0;if(!(c[k+164>>2]&32)){K=u;n=0;}else {n=c[s>>2]|0;W6(n|0,k|0,176)|0;w=t;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[s>>2]=n;w=c[t>>2]&3;c[((w|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];c[((w|0)==2?t:t+-48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=n+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[s>>2]|0;w=k+56|0;x=(c[r>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;n=0;J=12;}}else {W6(k|0,c[r>>2]|0,176)|0;w=t;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));w=t+48|0;x=p;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[s>>2]=k;k=c[r>>2]|0;if(!(c[k+164>>2]&32)){W6(n|0,k|0,176)|0;w=Y;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[o>>2]=n;o=c[t>>2]|0;c[((o&3|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=Y+48|0;x=p;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0))}else {n=c[o>>2]|0;W6(n|0,k|0,176)|0;w=Y;x=u;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[o>>2]=n;w=c[Y>>2]&3;c[((w|0)==3?Y:Y+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];c[((w|0)==2?Y:Y+-48|0)+40>>2]=c[((c[u>>2]&3|0)==3?u:p)+40>>2];w=n+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[o>>2]|0;w=k+56|0;x=(c[r>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;c[k+116>>2]=u;o=c[t>>2]|0;c[((o&3|0)==3?t:t+48|0)+40>>2]=c[((c[u>>2]&3|0)==2?u:q)+40>>2];w=(c[s>>2]|0)+16|0;x=(c[r>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0))}k=pg(u)|0;while(1){n=c[(c[k+16>>2]|0)+172>>2]|0;if(!n)break;else k=n;}c[((o&3|0)==2?t:t+-48|0)+40>>2]=c[((c[k>>2]&3|0)==2?k:k+-48|0)+40>>2];k=c[s>>2]|0;a[k+84>>0]=0;a[k+112>>0]=1;n=k+56|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;n=1;J=12;}if((J|0)==12){c[k+116>>2]=u;K=t;}H=(j|0)==2;if(H?(v=vg(b,K,c[46734]|0,_)|0,c[Z>>2]=v,(v|0)!=0):0)J=63;else J=15;a:do if((J|0)==15){G=(j|0)==10;c[Z>>2]=0;o=c[K>>2]&3;k=c[((o|0)==3?K:K+48|0)+40>>2]|0;o=c[((o|0)==2?K:K+-48|0)+40>>2]|0;c[_>>2]=o;wg(z,b,d,k,0,K);c[T>>2]=c[z>>2];c[T+4>>2]=c[z+4>>2];c[T+8>>2]=c[z+8>>2];c[T+12>>2]=c[z+12>>2];c[T+16>>2]=c[z+16>>2];c[T+20>>2]=c[z+20>>2];c[T+24>>2]=c[z+24>>2];c[T+28>>2]=c[z+28>>2];c[V>>2]=c[z>>2];c[V+4>>2]=c[z+4>>2];c[V+8>>2]=c[z+8>>2];c[V+12>>2]=c[z+12>>2];c[V+16>>2]=c[z+16>>2];c[V+20>>2]=c[z+20>>2];gO(e,K,1,T,xg(k)|0);B=T+52|0;I=(c[B>>2]|0)+-1|0;D=V+24|0;h[D>>3]=+h[T+56+(I<<5)+24>>3];E=V+8|0;h[E>>3]=+h[T+56+(I<<5)+8>>3];I=c[k+16>>2]|0;F=b+16|0;m=+h[I+24>>3]-+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[I+232>>2]<<6)+16>>3];c[S>>2]=c[V>>2];c[S+4>>2]=c[V+4>>2];c[S+8>>2]=c[V+8>>2];c[S+12>>2]=c[V+12>>2];c[S+16>>2]=c[V+16>>2];c[S+20>>2]=c[V+20>>2];c[S+24>>2]=c[V+24>>2];c[S+28>>2]=c[V+28>>2];yg(A,S,1,m);c[V>>2]=c[A>>2];c[V+4>>2]=c[A+4>>2];c[V+8>>2]=c[A+8>>2];c[V+12>>2]=c[A+12>>2];c[V+16>>2]=c[A+16>>2];c[V+20>>2]=c[A+20>>2];c[V+24>>2]=c[A+24>>2];c[V+28>>2]=c[A+28>>2];A=V+16|0;if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){I=c[B>>2]|0;c[B>>2]=I+1;I=T+56+(I<<5)|0;c[I>>2]=c[V>>2];c[I+4>>2]=c[V+4>>2];c[I+8>>2]=c[V+8>>2];c[I+12>>2]=c[V+12>>2];c[I+16>>2]=c[V+16>>2];c[I+20>>2]=c[V+20>>2];c[I+24>>2]=c[V+24>>2];c[I+28>>2]=c[V+28>>2];}w=b+60|0;C=U+52|0;x=e+56|0;y=e+69|0;j=e+16|0;z=e+29|0;I=K;q=0;r=-1;b:while(1){s=k;t=0;k=0;u=I;while(1){p=o;v=o;if((a[(c[p+16>>2]|0)+156>>0]|0)!=1)break b;if((kb[c[17300>>2]&63](p)|0)<<24>>24)break b;o=t|1;ca=153720+(t<<5)|0;zg(L,d,b,c[(c[s+16>>2]|0)+232>>2]|0);c[ca>>2]=c[L>>2];c[ca+4>>2]=c[L+4>>2];c[ca+8>>2]=c[L+8>>2];c[ca+12>>2]=c[L+12>>2];c[ca+16>>2]=c[L+16>>2];c[ca+20>>2]=c[L+20>>2];c[ca+24>>2]=c[L+24>>2];c[ca+28>>2]=c[L+28>>2];if(!k){q=Ag(p)|0;k=(q|0)<((a[(c[(c[w>>2]|0)+16>>2]|0)+113>>0]<<1&2)+3&255|0);q=k?q:q+-2|0;r=k?r:1;k=(k^1)&1;}if(!((k|0)==0|(r|0)>0))break;ca=153720+(o<<5)|0;wg(M,b,d,p,u,c[c[(c[p+16>>2]|0)+180>>2]>>2]|0);c[ca>>2]=c[M>>2];c[ca+4>>2]=c[M+4>>2];c[ca+8>>2]=c[M+8>>2];c[ca+12>>2]=c[M+12>>2];c[ca+16>>2]=c[M+16>>2];c[ca+20>>2]=c[M+20>>2];c[ca+24>>2]=c[M+24>>2];c[ca+28>>2]=c[M+28>>2];ca=c[c[(c[v+16>>2]|0)+180>>2]>>2]|0;o=c[ca>>2]&3;s=c[((o|0)==3?ca:ca+48|0)+40>>2]|0;o=c[((o|0)==2?ca:ca+-48|0)+40>>2]|0;c[_>>2]=o;t=t+2|0;r=r+-1|0;u=ca;}wg(N,b,d,p,u,c[c[(c[p+16>>2]|0)+180>>2]>>2]|0);c[U>>2]=c[N>>2];c[U+4>>2]=c[N+4>>2];c[U+8>>2]=c[N+8>>2];c[U+12>>2]=c[N+12>>2];c[U+16>>2]=c[N+16>>2];c[U+20>>2]=c[N+20>>2];c[U+24>>2]=c[N+24>>2];c[U+28>>2]=c[N+28>>2];jO(e,u,1,U,xg(c[((c[u>>2]&3|0)==2?u:u+-48|0)+40>>2]|0)|0);ca=U+56+((c[C>>2]|0)+-1<<5)|0;t=c[v+16>>2]|0;m=+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[t+232>>2]<<6)+24>>3]+ +h[t+24>>3];c[S>>2]=c[ca>>2];c[S+4>>2]=c[ca+4>>2];c[S+8>>2]=c[ca+8>>2];c[S+12>>2]=c[ca+12>>2];c[S+16>>2]=c[ca+16>>2];c[S+20>>2]=c[ca+20>>2];c[S+24>>2]=c[ca+24>>2];c[S+28>>2]=c[ca+28>>2];yg(V,S,4,m);if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[C>>2]|0;c[C>>2]=ca+1;ca=U+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}h[x>>3]=1.5707963267948966;a[y>>0]=1;Bg(e,I,u,T,U,o);if(!G){k=NM(e,X)|0;o=c[X>>2]|0;if(H&(o|0)>4){ca=k+16|0;c[ca>>2]=c[k>>2];c[ca+4>>2]=c[k+4>>2];c[ca+8>>2]=c[k+8>>2];c[ca+12>>2]=c[k+12>>2];ca=k+32|0;o=k+(o+-1<<4)|0;c[ca>>2]=c[o>>2];c[ca+4>>2]=c[o+4>>2];c[ca+8>>2]=c[o+8>>2];c[ca+12>>2]=c[o+12>>2];X6(k+48|0,o|0,16)|0;c[X>>2]=4;o=4;}else J=33;}else {k=HM(e,X)|0;o=c[X>>2]|0;J=33;}if((J|0)==33){J=0;if(!o)break a}u=c[Z>>2]|0;p=u+o|0;if((p|0)>(c[46736]|0)){c[46736]=p<<1;t=MK(c[46734]|0,p<<5)|0;c[46734]=t;o=c[X>>2]|0;}else t=c[46734]|0;s=0;p=u;while(1){if((s|0)>=(o|0))break;ca=t+(p<<4)|0;u=k+(s<<4)|0;c[ca>>2]=c[u>>2];c[ca+4>>2]=c[u+4>>2];c[ca+8>>2]=c[u+8>>2];c[ca+12>>2]=c[u+12>>2];s=s+1|0;p=p+1|0;}c[Z>>2]=p;o=Cg(c[c[(c[v+16>>2]|0)+180>>2]>>2]|0,q,t,Z)|0;Dg(I,e);p=c[o>>2]&3;k=c[((p|0)==3?o:o+48|0)+40>>2]|0;p=c[((p|0)==2?o:o+-48|0)+40>>2]|0;c[_>>2]=p;I=k+16|0;wg(P,b,d,k,c[c[(c[I>>2]|0)+172>>2]>>2]|0,o);c[T>>2]=c[P>>2];c[T+4>>2]=c[P+4>>2];c[T+8>>2]=c[P+8>>2];c[T+12>>2]=c[P+12>>2];c[T+16>>2]=c[P+16>>2];c[T+20>>2]=c[P+20>>2];c[T+24>>2]=c[P+24>>2];c[T+28>>2]=c[P+28>>2];gO(e,o,1,T,xg(k)|0);ca=T+56+((c[B>>2]|0)+-1<<5)|0;I=c[I>>2]|0;m=+h[I+24>>3]-+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[I+232>>2]<<6)+16>>3];c[S>>2]=c[ca>>2];c[S+4>>2]=c[ca+4>>2];c[S+8>>2]=c[ca+8>>2];c[S+12>>2]=c[ca+12>>2];c[S+16>>2]=c[ca+16>>2];c[S+20>>2]=c[ca+20>>2];c[S+24>>2]=c[ca+24>>2];c[S+28>>2]=c[ca+28>>2];yg(V,S,1,m);if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[B>>2]|0;c[B>>2]=ca+1;ca=T+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}h[j>>3]=-1.5707963267948966;a[z>>0]=1;I=o;o=p;}k=t|1;r=153720+(t<<5)|0;zg(Q,d,b,c[(c[s+16>>2]|0)+232>>2]|0);c[r>>2]=c[Q>>2];c[r+4>>2]=c[Q+4>>2];c[r+8>>2]=c[Q+8>>2];c[r+12>>2]=c[Q+12>>2];c[r+16>>2]=c[Q+16>>2];c[r+20>>2]=c[Q+20>>2];c[r+24>>2]=c[Q+24>>2];c[r+28>>2]=c[Q+28>>2];wg(R,b,d,p,u,0);c[U>>2]=c[R>>2];c[U+4>>2]=c[R+4>>2];c[U+8>>2]=c[R+8>>2];c[U+12>>2]=c[R+12>>2];c[U+16>>2]=c[R+16>>2];c[U+20>>2]=c[R+20>>2];c[U+24>>2]=c[R+24>>2];c[U+28>>2]=c[R+28>>2];c[V>>2]=c[R>>2];c[V+4>>2]=c[R+4>>2];c[V+8>>2]=c[R+8>>2];c[V+12>>2]=c[R+12>>2];c[V+16>>2]=c[R+16>>2];c[V+20>>2]=c[R+20>>2];c[V+24>>2]=c[R+24>>2];c[V+28>>2]=c[R+28>>2];r=(n|0)!=0;s=u+-48|0;jO(e,r?Y:u,1,U,xg(c[((c[u>>2]&3|0)==2?u:s)+40>>2]|0)|0);ca=(c[C>>2]|0)+-1|0;h[D>>3]=+h[U+56+(ca<<5)+24>>3];h[E>>3]=+h[U+56+(ca<<5)+8>>3];ca=c[v+16>>2]|0;m=+h[(c[(c[F>>2]|0)+196>>2]|0)+(c[ca+232>>2]<<6)+24>>3]+ +h[ca+24>>3];c[S>>2]=c[V>>2];c[S+4>>2]=c[V+4>>2];c[S+8>>2]=c[V+8>>2];c[S+12>>2]=c[V+12>>2];c[S+16>>2]=c[V+16>>2];c[S+20>>2]=c[V+20>>2];c[S+24>>2]=c[V+24>>2];c[S+28>>2]=c[V+28>>2];yg(W,S,4,m);c[V>>2]=c[W>>2];c[V+4>>2]=c[W+4>>2];c[V+8>>2]=c[W+8>>2];c[V+12>>2]=c[W+12>>2];c[V+16>>2]=c[W+16>>2];c[V+20>>2]=c[W+20>>2];c[V+24>>2]=c[W+24>>2];c[V+28>>2]=c[W+28>>2];if(+h[V>>3]<+h[A>>3]?+h[E>>3]<+h[D>>3]:0){ca=c[C>>2]|0;c[C>>2]=ca+1;ca=U+56+(ca<<5)|0;c[ca>>2]=c[V>>2];c[ca+4>>2]=c[V+4>>2];c[ca+8>>2]=c[V+8>>2];c[ca+12>>2]=c[V+12>>2];c[ca+16>>2]=c[V+16>>2];c[ca+20>>2]=c[V+20>>2];c[ca+24>>2]=c[V+24>>2];c[ca+28>>2]=c[V+28>>2];}Bg(e,I,u,T,U,k);if(G)q=HM(e,X)|0;else q=NM(e,X)|0;k=c[X>>2]|0;if(!(H&(k|0)>4)){if(!k)break}else {ca=q+16|0;c[ca>>2]=c[q>>2];c[ca+4>>2]=c[q+4>>2];c[ca+8>>2]=c[q+8>>2];c[ca+12>>2]=c[q+12>>2];ca=q+32|0;k=q+(k+-1<<4)|0;c[ca>>2]=c[k>>2];c[ca+4>>2]=c[k+4>>2];c[ca+8>>2]=c[k+8>>2];c[ca+12>>2]=c[k+12>>2];X6(q+48|0,k|0,16)|0;c[X>>2]=4;k=4;}o=c[Z>>2]|0;n=o+k|0;if((n|0)>(c[46736]|0)){c[46736]=n<<1;p=MK(c[46734]|0,n<<5)|0;c[46734]=p;k=c[X>>2]|0;}else p=c[46734]|0;n=0;while(1){if((n|0)>=(k|0))break;ca=p+(o<<4)|0;X=q+(n<<4)|0;c[ca>>2]=c[X>>2];c[ca+4>>2]=c[X+4>>2];c[ca+8>>2]=c[X+8>>2];c[ca+12>>2]=c[X+12>>2];n=n+1|0;o=o+1|0;}c[Z>>2]=o;Dg(I,e);if(r)k=(c[Y>>2]&3|0)==2?Y:Y+-48|0;else k=(c[u>>2]&3|0)==2?u:s;c[_>>2]=c[k+40>>2];v=o;J=63;}while(0);c:do if((J|0)==63){if((i|0)==1){dO(K,c[_>>2]|0,c[46734]|0,v,17296);break}t=d+12|0;u=v+-1|0;m=+((O(c[t>>2]|0,i+-1|0)|0)/2|0|0);n=c[46734]|0;k=1;while(1){if((k|0)>=(u|0))break;ca=n+(k<<4)|0;h[ca>>3]=+h[ca>>3]-m;k=k+1|0;}k=c[46736]|0;if((k|0)>(c[46737]|0)){c[46737]=k;o=MK(c[46735]|0,k<<4)|0;c[46735]=o;n=c[46734]|0;}else o=c[46735]|0;k=0;while(1){if((k|0)>=(v|0))break;ca=o+(k<<4)|0;d=n+(k<<4)|0;c[ca>>2]=c[d>>2];c[ca+4>>2]=c[d+4>>2];c[ca+8>>2]=c[d+8>>2];c[ca+12>>2]=c[d+12>>2];k=k+1|0;}dO(K,c[_>>2]|0,o,v,17296);r=$+48|0;s=$+-48|0;q=1;while(1){if((q|0)>=(i|0))break c;o=c[f+(q+g<<2)>>2]|0;p=o+16|0;k=c[p>>2]|0;if(c[k+164>>2]&32){n=c[aa>>2]|0;W6(n|0,k|0,176)|0;w=$;x=o;y=w+48|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));c[aa>>2]=n;w=c[$>>2]&3;c[((w|0)==3?$:r)+40>>2]=c[((c[o>>2]&3|0)==2?o:o+-48|0)+40>>2];c[((w|0)==2?$:s)+40>>2]=c[((c[o>>2]&3|0)==3?o:o+48|0)+40>>2];w=n+16|0;x=(c[p>>2]|0)+56|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));k=c[aa>>2]|0;w=k+56|0;x=(c[p>>2]|0)+16|0;y=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0;}while((w|0)<(y|0));a[k+112>>0]=1;c[k+116>>2]=o;o=$;}p=c[46734]|0;k=1;while(1){if((k|0)>=(u|0))break;ca=p+(k<<4)|0;h[ca>>3]=+h[ca>>3]+ +(c[t>>2]|0);k=k+1|0;}n=c[46735]|0;k=0;while(1){if((k|0)>=(v|0))break;ca=n+(k<<4)|0;_=p+(k<<4)|0;c[ca>>2]=c[_>>2];c[ca+4>>2]=c[_+4>>2];c[ca+8>>2]=c[_+8>>2];c[ca+12>>2]=c[_+12>>2];k=k+1|0;}dO(o,c[((c[o>>2]&3|0)==2?o:o+-48|0)+40>>2]|0,n,v,17296);q=q+1|0;}}while(0);l=ba;return}function sg(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;if((kb[c[4324]&63](d)|0)<<24>>24?(e=c[(c[d+16>>2]|0)+8>>2]|0,e|0):0)tg(e);d=ZA(a,d)|0;}b=kC(a,b)|0;}return}function tg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[a+4>>2]|0;g=KK(f*48|0)|0;b=g;d=0;e=(c[a>>2]|0)+((f+-1|0)*48|0)|0;while(1){if((d|0)>=(f|0)){b=0;break}ug(e,b);b=b+48|0;d=d+1|0;e=e+-48|0;}while(1){d=c[a>>2]|0;if((b|0)>=(f|0))break;U1(c[d+(b*48|0)>>2]|0);b=b+1|0;}U1(d);c[a>>2]=g;return}function ug(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[a+4>>2]|0;h=KK(g<<4)|0;d=h;e=0;f=(c[a>>2]|0)+(g+-1<<4)|0;while(1){if((e|0)>=(g|0))break;c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];d=d+16|0;e=e+1|0;f=f+-16|0;}c[b>>2]=h;c[b+4>>2]=g;c[b+8>>2]=c[a+12>>2];c[b+12>>2]=c[a+8>>2];h=b+16|0;g=a+32|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];h=b+32|0;g=a+16|0;c[h>>2]=c[g>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];return}function vg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+96|0;q=x+80|0;s=x+64|0;r=x+48|0;u=x+32|0;v=x+16|0;w=x;m=d;while(1){t=m+16|0;g=c[t>>2]|0;if(!(a[g+112>>0]|0))break;m=c[g+116>>2]|0;}g=c[m>>2]&3;o=c[((g|0)==2?m:m+-48|0)+40>>2]|0;g=c[((g|0)==3?m:m+48|0)+40>>2]|0;m=o+16|0;n=g+16|0;y=(c[(c[m>>2]|0)+232>>2]|0)-(c[(c[n>>2]|0)+232>>2]|0)|0;switch(((y|0)>-1?y:0-y|0)|0){case 1:{g=0;break}case 2:{if(!(a[(c[(c[b+60>>2]|0)+16>>2]|0)+113>>0]&1))p=6;else g=0;break}default:p=6;}do if((p|0)==6){if((c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)==(g|0)){c[f>>2]=o;y=(c[n>>2]|0)+16|0;p=(c[t>>2]|0)+16|0;c[s>>2]=c[y>>2];c[s+4>>2]=c[y+4>>2];c[s+8>>2]=c[y+8>>2];c[s+12>>2]=c[y+12>>2];c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];Ng(u,s,q);p=(c[m>>2]|0)+16|0;y=(c[t>>2]|0)+56|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];Ng(v,s,q);}else {c[f>>2]=g;y=(c[m>>2]|0)+16|0;p=(c[t>>2]|0)+56|0;c[s>>2]=c[y>>2];c[s+4>>2]=c[y+4>>2];c[s+8>>2]=c[y+8>>2];c[s+12>>2]=c[y+12>>2];c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];Ng(u,s,q);p=(c[n>>2]|0)+16|0;y=(c[t>>2]|0)+16|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];Ng(v,s,q);}g=c[(c[t>>2]|0)+96>>2]|0;if(!g){g=e+16|0;c[e>>2]=c[u>>2];c[e+4>>2]=c[u+4>>2];c[e+8>>2]=c[u+8>>2];c[e+12>>2]=c[u+12>>2];c[g>>2]=c[u>>2];c[g+4>>2]=c[u+4>>2];c[g+8>>2]=c[u+8>>2];c[g+12>>2]=c[u+12>>2];g=e+48|0;y=e+32|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];c[g>>2]=c[v>>2];c[g+4>>2]=c[v+4>>2];c[g+8>>2]=c[v+8>>2];c[g+12>>2]=c[v+12>>2];g=4;break}j=+h[g+24>>3];i=+h[g+32>>3];p=(c[(c[(xC(o)|0)+16>>2]|0)+116>>2]&1|0)==0;k=p?i:j;y=(c[(c[t>>2]|0)+96>>2]|0)+56|0;c[w>>2]=c[y>>2];c[w+4>>2]=c[y+4>>2];c[w+8>>2]=c[y+8>>2];c[w+12>>2]=c[y+12>>2];c[r>>2]=c[v>>2];c[r+4>>2]=c[v+4>>2];c[r+8>>2]=c[v+8>>2];c[r+12>>2]=c[v+12>>2];c[s>>2]=c[u>>2];c[s+4>>2]=c[u+4>>2];c[s+8>>2]=c[u+8>>2];c[s+12>>2]=c[u+12>>2];c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];y=(Og(r,s,q)|0)==0;i=(p?j:i)*.5;j=+h[w>>3];if(y){h[w>>3]=j-i;y=w+8|0;h[y>>3]=+h[y>>3]+k*.5;}else {h[w>>3]=j+i;y=w+8|0;h[y>>3]=+h[y>>3]-k*.5;}g=e+16|0;c[e>>2]=c[u>>2];c[e+4>>2]=c[u+4>>2];c[e+8>>2]=c[u+8>>2];c[e+12>>2]=c[u+12>>2];c[g>>2]=c[u>>2];c[g+4>>2]=c[u+4>>2];c[g+8>>2]=c[u+8>>2];c[g+12>>2]=c[u+12>>2];g=e+32|0;y=e+48|0;u=e+64|0;c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];c[g>>2]=c[w>>2];c[g+4>>2]=c[w+4>>2];c[g+8>>2]=c[w+8>>2];c[g+12>>2]=c[w+12>>2];g=e+80|0;y=e+96|0;c[y>>2]=c[v>>2];c[y+4>>2]=c[v+4>>2];c[y+8>>2]=c[v+8>>2];c[y+12>>2]=c[v+12>>2];c[g>>2]=c[v>>2];c[g+4>>2]=c[v+4>>2];c[g+8>>2]=c[v+8>>2];c[g+12>>2]=c[v+12>>2];g=7;}while(0);l=x;return g|0}function wg(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0,l=0,m=0.0,n=0,o=0.0,p=0.0,q=0;q=c[f+16>>2]|0;p=+h[q+16>>3];j=p-+h[q+88>>3];m=j+-4.0;l=Jg(d,f,g,i,-1)|0;if(!l){n=~~(j+(m>=0.0?-3.5:-4.5));k=c[e>>2]|0;k=(k|0)>(n|0)?n:k;}else {k=Kg(d,f,l)|0;do if(!k){n=c[l+16>>2]|0;j=+h[n+240>>3]+ +h[n+16>>3];if(!(a[n+156>>0]|0)){j=+(c[(c[d+16>>2]|0)+248>>2]|0)*.5+j;break}else {j=j+ +(c[e+8>>2]|0);break}}else j=+h[(c[k+16>>2]|0)+32>>3]+ +(c[e+8>>2]|0);while(0);o=j=0.0?.5:-.5));}o=+(k|0);n=(a[q+156>>0]|0)==1;if(n?(c[q+104>>2]|0)!=0:0)m=p+10.0;else m=p+4.0+ +h[q+96>>3];l=Jg(d,f,g,i,1)|0;if(!l){f=~~(m+(m>=0.0?.5:-.5));k=c[e+4>>2]|0;k=(k|0)<(f|0)?f:k;}else {k=Kg(d,f,l)|0;do if(!k){f=c[l+16>>2]|0;j=+h[f+16>>3]-+h[f+88>>3];if(!(a[f+156>>0]|0)){j=j-+(c[(c[d+16>>2]|0)+248>>2]|0)*.5;break}else {j=j-+(c[e+8>>2]|0);break}}else j=+h[(c[k+16>>2]|0)+16>>3]-+(c[e+8>>2]|0);while(0);m=j>m?j:m;k=~~(m+(m>=0.0?.5:-.5));}j=+(k|0);if(n?(c[q+104>>2]|0)!=0:0){j=j-+h[q+96>>3];if(j>3];d=c[(c[d+16>>2]|0)+196>>2]|0;q=c[q+232>>2]|0;m=p-+h[d+(q<<6)+16>>3];p=+h[d+(q<<6)+24>>3]+p;h[b>>3]=o;h[b+8>>3]=m;h[b+16>>3]=j;h[b+24>>3]=p;return}function xg(b){b=b|0;b=c[b+16>>2]|0;if((a[b+156>>0]|0)==1)if((c[b+176>>2]|0)>1)b=1;else b=(c[b+184>>2]|0)>1&1;else b=0;return b|0}function yg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;var f=0,g=0;g=l;l=l+32|0;f=g;switch(d|0){case 1:{Ig(f,+h[b>>3],e,+h[b+16>>3],+h[b+8>>3]);break}case 4:{Ig(f,+h[b>>3],+h[b+24>>3],+h[b+16>>3],e);break}default:{}}c[a>>2]=c[f>>2];c[a+4>>2]=c[f+4>>2];c[a+8>>2]=c[f+8>>2];c[a+12>>2]=c[f+12>>2];c[a+16>>2]=c[f+16>>2];c[a+20>>2]=c[f+20>>2];c[a+24>>2]=c[f+24>>2];c[a+28>>2]=c[f+28>>2];l=g;return}function zg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0;l=c[b+16>>2]|0;k=l+(e<<5)|0;j=+h[k>>3];m=l+(e<<5)+8|0;g=+h[m>>3];n=l+(e<<5)+16|0;f=+h[n>>3];l=l+(e<<5)+24|0;i=+h[l>>3];if(j==f){d=c[(c[d+16>>2]|0)+196>>2]|0;o=e+1|0;j=+(c[b>>2]|0);g=+h[d+(o<<6)+24>>3]+ +h[(c[(c[c[d+(o<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];f=+(c[b+4>>2]|0);i=+h[(c[(c[c[d+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[d+(e<<6)+16>>3];h[k>>3]=j;h[m>>3]=g;h[n>>3]=f;h[l>>3]=i;}h[a>>3]=j;h[a+8>>3]=g;h[a+16>>3]=f;h[a+24>>3]=i;return}function Ag(b){b=b|0;var d=0,e=0;b=c[b+16>>2]|0;e=b+16|0;d=0;while(1){b=c[c[b+180>>2]>>2]|0;b=c[(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0;if((a[b+156>>0]|0)!=1)break;if((c[b+184>>2]|0)!=1)break;if((c[b+176>>2]|0)!=1)break;if(+h[b+16>>3]!=+h[e>>3])break;d=d+1|0;}return d|0}function Bg(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=l;l=l+32|0;j=k;h=Fg(b,-1)|0;b=Fg(b,1)|0;if(!((h|0)!=0?!(uO(h)|0):0))i=3;do if((i|0)==3){if(b|0?(uO(b)|0)==0:0)break;h=Gg(d,-1)|0;b=Gg(d,1)|0;if(h|0?(uO(h)|0)==0:0)break;if(b|0?(uO(b)|0)==0:0)break;h=e+52|0;b=0;while(1){if((b|0)>=(c[h>>2]|0))break;d=e+56+(b<<5)|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];c[j+16>>2]=c[d+16>>2];c[j+20>>2]=c[d+20>>2];c[j+24>>2]=c[d+24>>2];c[j+28>>2]=c[d+28>>2];fO(a,j);b=b+1|0;}h=c[a+80>>2]|0;i=g+-3|0;b=0;while(1){if((b|0)>=(g|0))break;e=153720+(b<<5)|0;c[j>>2]=c[e>>2];c[j+4>>2]=c[e+4>>2];c[j+8>>2]=c[e+8>>2];c[j+12>>2]=c[e+12>>2];c[j+16>>2]=c[e+16>>2];c[j+20>>2]=c[e+20>>2];c[j+24>>2]=c[e+24>>2];c[j+28>>2]=c[e+28>>2];fO(a,j);b=b+1|0;}d=h+1|0;i=i+d|0;h=c[f+52>>2]|0;while(1){b=h+-1|0;if((h|0)<=0)break;h=f+56+(b<<5)|0;c[j>>2]=c[h>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];fO(a,j);h=b;}Hg(a,d,i);}while(0);l=k;return}function Cg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=c[e>>2]|0;while(1){if(!b)break;a=c[c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;b=b+-1|0;}c[e>>2]=f+1;g=d+(f<<4)|0;b=d+(f+-1<<4)|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];f=c[e>>2]|0;c[e>>2]=f+1;f=d+(f<<4)|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];f=d+(c[e>>2]<<4)|0;e=(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+16|0;c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];c[f+8>>2]=c[e+8>>2];c[f+12>>2]=c[e+12>>2];return a|0}function Dg(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,l=0,m=0;m=d+84|0;l=d+80|0;e=0;d=b;a:while(1){j=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;k=j+16|0;if((a[(c[k>>2]|0)+156>>0]|0)!=1)break;if((kb[c[17300>>2]&63](j)|0)<<24>>24)break;d=c[l>>2]|0;while(1){if((e|0)>=(d|0))break a;if(!(+h[(c[m>>2]|0)+(e<<5)+8>>3]>+h[(c[k>>2]|0)+24>>3]))break;e=e+1|0;}d=c[m>>2]|0;b=c[k>>2]|0;do if(!(+h[d+(e<<5)+24>>3]<+h[b+24>>3])){g=+h[d+(e<<5)>>3];i=~~g;f=+h[d+(e<<5)+16>>3];if(!(c[b+104>>2]|0)){Eg(j,i,~~((f+g)*.5),~~f);break}else {Eg(j,i,~~f,~~(+h[b+96>>3]+f));break}}while(0);d=c[c[(c[k>>2]|0)+180>>2]>>2]|0;}return}function Eg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[a+16>>2]|0;h[a+16>>3]=+(d|0);h[a+88>>3]=+(d-b|0);h[a+96>>3]=+(e-d|0);return}function Fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=c[(c[(c[((h|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+180>>2]|0;h=((h|0)==2?a:a+-48|0)+40|0;g=0;a=0;while(1){e=c[i+(g<<2)>>2]|0;if(!e)break;f=c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;do if((O(f-(c[(c[(c[h>>2]|0)+16>>2]|0)+236>>2]|0)|0,b)|0)>=1){d=c[e+16>>2]|0;if(!(c[d+8>>2]|0)){d=c[d+116>>2]|0;if(!d)break;if(!(c[(c[d+16>>2]|0)+8>>2]|0))break}if(a|0?(O((c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-f|0,b)|0)<=0:0)break;a=e;}while(0);g=g+1|0;}return a|0}function Gg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=c[(c[(c[((h|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+172>>2]|0;h=((h|0)==3?a:a+48|0)+40|0;g=0;a=0;while(1){e=c[i+(g<<2)>>2]|0;if(!e)break;f=c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;do if((O(f-(c[(c[(c[h>>2]|0)+16>>2]|0)+236>>2]|0)|0,b)|0)>=1){d=c[e+16>>2]|0;if(!(c[d+8>>2]|0)){d=c[d+116>>2]|0;if(!d)break;if(!(c[(c[d+16>>2]|0)+8>>2]|0))break}if(a|0?(O((c[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-f|0,b)|0)<=0:0)break;a=e;}while(0);g=g+1|0;}return a|0}function Hg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0;l=a+84|0;i=b+-1|0;while(1){if((i|0)>(d|0))break;f=c[l>>2]|0;j=f+(i<<5)|0;e=+h[j>>3];if(!(i-b&1)){f=f+(i<<5)+16|0;m=+h[f>>3];g=~~((m+e)*.5);if(e>=m){h[j>>3]=+(g+-8|0);h[f>>3]=+(g+8|0);}}else {f=f+(i<<5)+16|0;m=+h[f>>3];g=~~((m+e)*.5);if(e+16.0>m){h[j>>3]=+(g+-8|0);h[f>>3]=+(g+8|0);}}i=i+1|0;}k=(c[a+80>>2]|0)+-1|0;g=0;while(1){if((g|0)>=(k|0))break;i=c[l>>2]|0;f=i+(g<<5)|0;j=g+1|0;a=i+(j<<5)|0;if(!((g|0)<(b|0)|(g|0)>(d|0))?(g-b&1|0)==0:0){e=+h[f>>3]+16.0;f=i+(j<<5)+16|0;if(e>+h[f>>3])h[f>>3]=e;e=+h[i+(g<<5)+16>>3]+-16.0;if(!(e<+h[a>>3])){g=j;continue}h[a>>3]=e;g=j;continue}if(!((g|0)<(d|0)&(j|0)>=(b|0))){g=j;continue}if(j-b&1|0){g=j;continue}e=+h[i+(j<<5)+16>>3];if(+h[f>>3]+16.0>e)h[f>>3]=e+-16.0;f=i+(g<<5)+16|0;e=+h[a>>3];if(!(+h[f>>3]+-16.0>3]=e+16.0;g=j;}return}function Ig(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function Jg(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=c[(c[b+16>>2]|0)+196>>2]|0;h=c[d+16>>2]|0;j=c[h+232>>2]|0;i=k+(j<<6)|0;j=k+(j<<6)+4|0;h=c[h+236>>2]|0;a:do{h=h+g|0;if((h|0)<=-1){b=0;break}if((h|0)>=(c[i>>2]|0)){b=0;break}b=c[(c[j>>2]|0)+(h<<2)>>2]|0;k=c[b+16>>2]|0;switch(a[k+156>>0]|0){case 0:break a;case 1:{if(c[k+104>>2]|0)break a;break}default:{}}}while((Mg(b,d,e,f)|0)<<24>>24!=0);return b|0}function Kg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;d=c[d+16>>2]|0;if(!(a[d+156>>0]|0)){i=c[d+212>>2]|0;h=i;}else {i=c[(c[(c[c[d+180>>2]>>2]|0)+16>>2]|0)+116>>2]|0;g=c[i>>2]&3;h=c[(c[(c[((g|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;i=c[(c[(c[((g|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;}d=c[e+16>>2]|0;if(!(a[d+156>>0]|0)){e=c[d+212>>2]|0;e=(e|0)==(b|0)?0:e;return ((e|0)==(h|0)|((e|0)==0|(e|0)==(i|0))?0:e)|0}f=c[(c[(c[c[d+180>>2]>>2]|0)+16>>2]|0)+116>>2]|0;g=c[f>>2]&3;d=c[(c[(c[((g|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;d=(d|0)==(b|0)?0:d;if(!(!((d|0)==(h|0)|((d|0)==0|(d|0)==(i|0)))?(Lg(d,e)|0)!=0:0)){d=c[(c[(c[((g|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;d=(d|0)==(b|0)?0:d;if((d|0)==(h|0)|((d|0)==0|(d|0)==(i|0)))d=0;else {e=(Lg(d,e)|0)==0;return (e?0:d)|0}}return d|0}function Lg(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0;d=c[a+16>>2]|0;a=c[b+16>>2]|0;f=+h[a+16>>3];if((+h[d+16>>3]<=f?f<=+h[d+32>>3]:0)?(e=+h[a+24>>3],+h[d+24>>3]<=e):0)a=e<=+h[d+40>>3]&1;else a=0;return a|0}function Mg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=c[b+16>>2]|0;j=(c[i+236>>2]|0)>(c[(c[d+16>>2]|0)+236>>2]|0);a:do if((c[i+184>>2]|0)==1){b:do if(f|0){h=0;b=c[c[i+180>>2]>>2]|0;while(1){if((h|0)>=2)break b;b=c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0;d=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((b|0)==(d|0))break b;g=c[b+16>>2]|0;b=c[d+16>>2]|0;if(j^(c[g+236>>2]|0)>(c[b+236>>2]|0)){b=1;break a}if((c[g+184>>2]|0)!=1)break b;if(!(a[g+156>>0]|0))break b;if((c[b+184>>2]|0)!=1)break b;if(!(a[b+156>>0]|0))break b;h=h+1|0;f=c[c[b+180>>2]>>2]|0;b=c[c[g+180>>2]>>2]|0;}}while(0);if(e|0?(c[i+176>>2]|0)==1:0){g=0;d=e;b=c[c[i+172>>2]>>2]|0;while(1){if((g|0)>=2){b=0;break a}b=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;d=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((b|0)==(d|0)){b=0;break a}f=c[b+16>>2]|0;b=c[d+16>>2]|0;if(j^(c[f+236>>2]|0)>(c[b+236>>2]|0)){b=1;break a}if((c[f+176>>2]|0)!=1){b=0;break a}if(!(a[f+156>>0]|0)){b=0;break a}if((c[b+176>>2]|0)!=1){b=0;break a}if(!(a[b+156>>0]|0)){b=0;break a}g=g+1|0;d=c[c[b+172>>2]>>2]|0;b=c[c[f+172>>2]>>2]|0;}}else b=0;}else b=0;while(0);return b|0}function Ng(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function Og(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];return (~~((+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d))|0)>0|0}function Pg(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;R=l;l=l+256|0;D=R+232|0;C=R+216|0;P=R+88|0;O=R+80|0;K=R+64|0;L=R+200|0;M=R+184|0;N=R;E=R+168|0;F=R+152|0;G=R+136|0;H=R+120|0;I=R+104|0;B=c[g>>2]&3;J=c[((B|0)==3?g:g+48|0)+40>>2]|0;B=c[((B|0)==2?g:g+-48|0)+40>>2]|0;do if((WM(J)|0)!=2?(WM(B)|0)!=2:0){g=0;j=0;k=0;while(1){if((k|0)>=(f|0))break;A=c[(c[d+(k+e<<2)>>2]|0)+16>>2]|0;g=g+((c[A+96>>2]|0)!=0&1)|0;if(!((a[A+44>>0]|0)==0?(a[A+84>>0]|0)==0:0))j=1;k=k+1|0;}if(!j)if(!g){Rg(J,B,d,e,f,i);break}else {Wg(J,B,d,e,f,i,g);break}y=JK(156)|0;z=Xg(b,y)|0;t=ND(z,85478,1)|0;TC(t,137483,280,1)|0;SA(t,87171,87185)|0;m=+h[(c[B+16>>2]|0)+16>>3];s=+h[(c[J+16>>2]|0)+16>>3];A=b+16|0;q=(c[(c[A>>2]|0)+116>>2]&1|0)==0;r=q?B:J;q=q?J:B;t=Yg(t,q)|0;u=Yg(z,r)|0;g=0;p=0;while(1){if((p|0)>=(f|0))break;j=d+(p+e<<2)|0;while(1){o=c[j>>2]|0;n=o+16|0;j=c[n>>2]|0;if(!(a[j+112>>0]|0))break;else j=j+116|0;}if((c[((c[o>>2]&3|0)==3?o:o+48|0)+40>>2]|0)==(q|0))k=Zg(z,t,u,o)|0;else k=Zg(z,u,t,o)|0;j=c[n>>2]|0;c[j+120>>2]=k;if(!g)if((a[j+44>>0]|0)==0?(a[j+84>>0]|0)==0:0){c[(c[k+16>>2]|0)+120>>2]=o;g=k;}else g=0;p=p+1|0;}if(!g)x=iB(z,t,u,0,1)|0;else x=g;KA(x,c[47174]|0,85482)|0;g=z+16|0;n=c[g>>2]|0;c[n+144>>2]=c[(c[A>>2]|0)+144>>2];c[n+188>>2]=z;oQ(z,i);Of(z);xj(z,0);Hh(z,0);Ki(z,0);q=q+16|0;i=c[q>>2]|0;n=c[r+16>>2]|0;r=t+16|0;o=c[r>>2]|0;p=o+16|0;v=+(~~m|0);w=+(~~((+h[(c[u+16>>2]|0)+16>>3]+ +h[p>>3])*.5)|0);m=+(~~s|0);s=+(~~((+h[i+16>>3]-+h[i+96>>3]+ +h[n+16>>3]+ +h[n+88>>3])*.5)|0);n=o+24|0;g=(c[g>>2]|0)+192|0;while(1){j=c[g>>2]|0;if(!j)break;do if((j|0)!=(t|0)){g=c[j+16>>2]|0;k=g+24|0;if((j|0)==(u|0)){h[k>>3]=m;h[g+16>>3]=w;break}else {h[k>>3]=s;break}}else {h[n>>3]=v;h[p>>3]=w;g=o;}while(0);g=g+164|0;}rk(z);jg(z,0);tM(z);k=c[q>>2]|0;g=c[r>>2]|0;if(!(c[(c[A>>2]|0)+116>>2]&1)){j=g+16|0;m=+h[k+24>>3]-+h[g+24>>3];}else {j=g+24|0;m=+h[g+16>>3]+ +h[k+24>>3];}h[K>>3]=+h[k+16>>3]-+h[j>>3];h[K+8>>3]=m;i=N+16|0;t=N+32|0;u=N+48|0;r=0;while(1){if((r|0)>=(f|0))break;g=d+(r+e<<2)|0;while(1){j=c[g>>2]|0;q=j+16|0;g=c[q>>2]|0;if(!(a[g+112>>0]|0))break;else g=g+116|0;}o=c[g+120>>2]|0;p=o+16|0;g=c[p>>2]|0;if(!((o|0)==(x|0)&(c[g+120>>2]|0)==0)){n=c[c[g+8>>2]>>2]|0;o=n+4|0;j=cO(j,c[o>>2]|0)|0;c[j+8>>2]=c[n+8>>2];g=j+16|0;k=n+16|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(L,C,D,S);c[g>>2]=c[L>>2];c[g+4>>2]=c[L+4>>2];c[g+8>>2]=c[L+8>>2];c[g+12>>2]=c[L+12>>2];c[j+12>>2]=c[n+12>>2];g=j+32|0;S=n+32|0;k=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(M,C,D,k);c[g>>2]=c[M>>2];c[g+4>>2]=c[M+4>>2];c[g+8>>2]=c[M+8>>2];c[g+12>>2]=c[M+12>>2];g=0;while(1){if((g|0)>=(c[o>>2]|0))break;k=(c[j>>2]|0)+(g<<4)|0;T=(c[n>>2]|0)+(g<<4)|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[T>>2];c[C+4>>2]=c[T+4>>2];c[C+8>>2]=c[T+8>>2];c[C+12>>2]=c[T+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(E,C,D,S);c[k>>2]=c[E>>2];c[k+4>>2]=c[E+4>>2];c[k+8>>2]=c[E+8>>2];c[k+12>>2]=c[E+12>>2];c[N>>2]=c[E>>2];c[N+4>>2]=c[E+4>>2];c[N+8>>2]=c[E+8>>2];c[N+12>>2]=c[E+12>>2];k=g+1|0;if((k|0)>=(c[o>>2]|0)){Q=48;break}S=(c[j>>2]|0)+(k<<4)|0;k=(c[n>>2]|0)+(k<<4)|0;T=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(F,C,D,T);c[S>>2]=c[F>>2];c[S+4>>2]=c[F+4>>2];c[S+8>>2]=c[F+8>>2];c[S+12>>2]=c[F+12>>2];c[i>>2]=c[F>>2];c[i+4>>2]=c[F+4>>2];c[i+8>>2]=c[F+8>>2];c[i+12>>2]=c[F+12>>2];S=g+2|0;T=(c[j>>2]|0)+(S<<4)|0;S=(c[n>>2]|0)+(S<<4)|0;k=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[S>>2];c[C+4>>2]=c[S+4>>2];c[C+8>>2]=c[S+8>>2];c[C+12>>2]=c[S+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(G,C,D,k);c[T>>2]=c[G>>2];c[T+4>>2]=c[G+4>>2];c[T+8>>2]=c[G+8>>2];c[T+12>>2]=c[G+12>>2];c[t>>2]=c[G>>2];c[t+4>>2]=c[G+4>>2];c[t+8>>2]=c[G+8>>2];c[t+12>>2]=c[G+12>>2];T=g+3|0;k=(c[n>>2]|0)+(T<<4)|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[k>>2];c[C+4>>2]=c[k+4>>2];c[C+8>>2]=c[k+8>>2];c[C+12>>2]=c[k+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(H,C,D,S);c[u>>2]=c[H>>2];c[u+4>>2]=c[H+4>>2];c[u+8>>2]=c[H+8>>2];c[u+12>>2]=c[H+12>>2];lI((c[A>>2]|0)+16|0,N);g=T;}if((Q|0)==48)Q=0;g=c[(c[q>>2]|0)+96>>2]|0;if(g|0){T=g+56|0;p=(c[(c[p>>2]|0)+96>>2]|0)+56|0;S=c[(c[A>>2]|0)+116>>2]&1;c[C>>2]=c[p>>2];c[C+4>>2]=c[p+4>>2];c[C+8>>2]=c[p+8>>2];c[C+12>>2]=c[p+12>>2];c[D>>2]=c[K>>2];c[D+4>>2]=c[K+4>>2];c[D+8>>2]=c[K+8>>2];c[D+12>>2]=c[K+12>>2];_g(I,C,D,S);c[T>>2]=c[I>>2];c[T+4>>2]=c[I+4>>2];c[T+8>>2]=c[I+8>>2];c[T+12>>2]=c[I+12>>2];T=c[(c[q>>2]|0)+96>>2]|0;a[T+81>>0]=1;zP(b,T);}}r=r+1|0;}$g(z,y);}else Q=3;while(0);if((Q|0)==3?(c[46738]|0)==0:0){c[46738]=1;gA(0,85355,O)|0;Q=KB(J)|0;S=(xB(b)|0)!=0;T=KB(B)|0;c[P>>2]=Q;c[P+4>>2]=S?137738:141747;c[P+8>>2]=T;gA(3,85461,P)|0;}l=R;return}function Qg(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0;z=l;l=l+1600|0;u=z+1552|0;n=z+1536|0;t=z+840|0;v=z+144|0;w=z+1584|0;j=z+32|0;s=z+16|0;o=z;q=c[f>>2]&3;p=c[((q|0)==3?f:f+48|0)+40>>2]|0;x=f+-48|0;q=c[((q|0)==2?f:x)+40>>2]|0;r=f+16|0;k=c[r>>2]|0;i=c[k+172>>2]|0;while(1){m=c[(c[i+16>>2]|0)+172>>2]|0;if(!m)break;else i=m;}k=(c[k+96>>2]|0)+56|0;i=(c[((c[i>>2]&3|0)==3?i:i+48|0)+40>>2]|0)+16|0;m=(c[i>>2]|0)+16|0;c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];k=c[r>>2]|0;a[(c[k+96>>2]|0)+81>>0]=1;if((g|0)!=2){k=c[i>>2]|0;C=+h[k+16>>3];E=C-+h[k+88>>3];C=+h[k+96>>3]+C;B=+h[k+24>>3];D=+h[k+80>>3]*.5+B;k=c[(c[b+16>>2]|0)+196>>2]|0;m=c[p+16>>2]|0;j=c[m+232>>2]|0;B=+(~~(+(~~(B-+h[k+(j<<6)+16>>3]-+h[m+24>>3]+ +h[k+(j<<6)+24>>3])|0)*.16666666666666666)|0);B=D-(B<5.0?5.0:B);Tg(b,d,e,p,f,t,1);Tg(b,d,e,q,f,v,0);j=t+52|0;k=c[j>>2]|0;m=k+-1|0;A=+h[t+56+(m<<5)>>3];h[19215]=A;h[19216]=+h[t+56+(m<<5)+24>>3];h[19217]=E;h[19218]=B;h[19219]=A;h[19220]=B;m=v+52|0;i=(c[m>>2]|0)+-1|0;A=+h[v+56+(i<<5)+16>>3];h[19221]=A;h[19222]=D;h[19223]=C;h[19226]=B;h[19224]=+h[v+56+(i<<5)+24>>3];h[19225]=A;i=0;while(1){if((i|0)>=(k|0)){i=0;break}k=t+56+(i<<5)|0;c[u>>2]=c[k>>2];c[u+4>>2]=c[k+4>>2];c[u+8>>2]=c[k+8>>2];c[u+12>>2]=c[k+12>>2];c[u+16>>2]=c[k+16>>2];c[u+20>>2]=c[k+20>>2];c[u+24>>2]=c[k+24>>2];c[u+28>>2]=c[k+28>>2];fO(e,u);i=i+1|0;k=c[j>>2]|0;}while(1){if((i|0)==3)break;t=153720+(i<<5)|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[u+16>>2]=c[t+16>>2];c[u+20>>2]=c[t+20>>2];c[u+24>>2]=c[t+24>>2];c[u+28>>2]=c[t+28>>2];fO(e,u);i=i+1|0;}j=c[m>>2]|0;while(1){i=j+-1|0;if((j|0)<=0)break;j=v+56+(i<<5)|0;c[u>>2]=c[j>>2];c[u+4>>2]=c[j+4>>2];c[u+8>>2]=c[j+8>>2];c[u+12>>2]=c[j+12>>2];c[u+16>>2]=c[j+16>>2];c[u+20>>2]=c[j+20>>2];c[u+24>>2]=c[j+24>>2];c[u+28>>2]=c[j+28>>2];fO(e,u);j=i;}if((g|0)==10)j=HM(e,w)|0;else j=NM(e,w)|0;i=c[w>>2]|0;if(i|0)y=17;}else {i=(c[p+16>>2]|0)+16|0;v=k+16|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];c[u>>2]=c[v>>2];c[u+4>>2]=c[v+4>>2];c[u+8>>2]=c[v+8>>2];c[u+12>>2]=c[v+12>>2];Ng(s,n,u);v=(c[q+16>>2]|0)+16|0;i=(c[r>>2]|0)+56|0;c[n>>2]=c[v>>2];c[n+4>>2]=c[v+4>>2];c[n+8>>2]=c[v+8>>2];c[n+12>>2]=c[v+12>>2];c[u>>2]=c[i>>2];c[u+4>>2]=c[i+4>>2];c[u+8>>2]=c[i+8>>2];c[u+12>>2]=c[i+12>>2];Ng(o,n,u);i=c[(c[r>>2]|0)+96>>2]|0;D=+h[i+56>>3];E=+h[i+64>>3]-+h[i+32>>3]*.5;i=j+16|0;c[j>>2]=c[s>>2];c[j+4>>2]=c[s+4>>2];c[j+8>>2]=c[s+8>>2];c[j+12>>2]=c[s+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];i=j+32|0;v=j+48|0;y=j+64|0;h[j+64>>3]=D;h[j+72>>3]=E;c[v>>2]=c[y>>2];c[v+4>>2]=c[y+4>>2];c[v+8>>2]=c[y+8>>2];c[v+12>>2]=c[y+12>>2];c[i>>2]=c[y>>2];c[i+4>>2]=c[y+4>>2];c[i+8>>2]=c[y+8>>2];c[i+12>>2]=c[y+12>>2];i=j+80|0;y=j+96|0;c[y>>2]=c[o>>2];c[y+4>>2]=c[o+4>>2];c[y+8>>2]=c[o+8>>2];c[y+12>>2]=c[o+12>>2];c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];c[w>>2]=7;i=7;y=17;}if((y|0)==17)dO(f,c[((c[f>>2]&3|0)==2?f:x)+40>>2]|0,j,i,17296);l=z;return}function Rg(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;N=l;l=l+352|0;x=N+336|0;w=N+320|0;L=N+128|0;u=N+304|0;y=N+288|0;M=N+112|0;E=N+96|0;F=N+80|0;G=N+64|0;H=N+48|0;I=N+32|0;J=N+16|0;K=N;a=a+16|0;q=(c[a>>2]|0)+16|0;v=(c[d+(e<<2)>>2]|0)+16|0;s=(c[v>>2]|0)+16|0;c[w>>2]=c[q>>2];c[w+4>>2]=c[q+4>>2];c[w+8>>2]=c[q+8>>2];c[w+12>>2]=c[q+12>>2];c[x>>2]=c[s>>2];c[x+4>>2]=c[s+4>>2];c[x+8>>2]=c[s+8>>2];c[x+12>>2]=c[s+12>>2];Ng(u,w,x);C=+h[u>>3];D=+h[u+8>>3];u=(c[b+16>>2]|0)+16|0;v=(c[v>>2]|0)+56|0;c[w>>2]=c[u>>2];c[w+4>>2]=c[u+4>>2];c[w+8>>2]=c[u+8>>2];c[w+12>>2]=c[u+12>>2];c[x>>2]=c[v>>2];c[x+4>>2]=c[v+4>>2];c[x+8>>2]=c[v+8>>2];c[x+12>>2]=c[v+12>>2];Ng(y,w,x);A=+h[y>>3];B=+h[y+8>>3];if((f|0)>1){z=+h[(c[a>>2]|0)+80>>3];i=z*.5;z=z/+(f+-1|0);}else {i=0.0;z=0.0;}p=(g|8|0)==10;m=L+8|0;q=L+16|0;r=(A+C*2.0)*.3333333333333333;s=L+32|0;t=(A*2.0+C)*.3333333333333333;n=L+24|0;u=L+48|0;v=L+64|0;w=L+80|0;x=L+96|0;y=L+112|0;k=L+128|0;o=L+136|0;i=D-i;b=0;while(1){if((b|0)>=(f|0))break;j=c[d+(b+e<<2)>>2]|0;h[L>>3]=C;h[m>>3]=D;if(p){Vg(M,r,i);c[q>>2]=c[M>>2];c[q+4>>2]=c[M+4>>2];c[q+8>>2]=c[M+8>>2];c[q+12>>2]=c[M+12>>2];Vg(E,t,i);c[s>>2]=c[E>>2];c[s+4>>2]=c[E+4>>2];c[s+8>>2]=c[E+8>>2];c[s+12>>2]=c[E+12>>2];a=4;g=3;}else {h[q>>3]=C;h[n>>3]=D;Vg(F,r,i);c[s>>2]=c[F>>2];c[s+4>>2]=c[F+4>>2];c[s+8>>2]=c[F+8>>2];c[s+12>>2]=c[F+12>>2];Vg(G,r,i);c[u>>2]=c[G>>2];c[u+4>>2]=c[G+4>>2];c[u+8>>2]=c[G+8>>2];c[u+12>>2]=c[G+12>>2];Vg(H,r,i);c[v>>2]=c[H>>2];c[v+4>>2]=c[H+4>>2];c[v+8>>2]=c[H+8>>2];c[v+12>>2]=c[H+12>>2];Vg(I,t,i);c[w>>2]=c[I>>2];c[w+4>>2]=c[I+4>>2];c[w+8>>2]=c[I+8>>2];c[w+12>>2]=c[I+12>>2];Vg(J,t,i);c[x>>2]=c[J>>2];c[x+4>>2]=c[J+4>>2];c[x+8>>2]=c[J+8>>2];c[x+12>>2]=c[J+12>>2];Vg(K,t,i);c[y>>2]=c[K>>2];c[y+4>>2]=c[K+4>>2];c[y+8>>2]=c[K+8>>2];c[y+12>>2]=c[K+12>>2];h[k>>3]=A;h[o>>3]=B;a=10;g=9;}h[L+(g<<4)>>3]=A;h[L+(g<<4)+8>>3]=B;dO(j,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0,L,a,17296);i=i+z;b=b+1|0;}l=N;return}function Sg(a,d,e,f,g,i,j,k){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;var m=0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0;x=l;l=l+1440|0;t=x+1392|0;v=x+1424|0;w=x+696|0;u=x;r=c[j>>2]&3;q=c[((r|0)==3?j:j+48|0)+40>>2]|0;r=c[((r|0)==2?j:j+-48|0)+40>>2]|0;m=c[q+16>>2]|0;o=c[m+232>>2]|0;p=c[a+16>>2]|0;if((o|0)<(b[p+238>>1]|0)){y=c[p+196>>2]|0;p=o+1|0;n=+h[m+24>>3]-+h[y+(o<<6)+32>>3]-+h[(c[(c[c[y+(p<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[y+(p<<6)+40>>3];}else n=+(c[p+252>>2]|0);z=+(i+1|0);s=+(c[d+12>>2]|0)/z;n=n/z;Ug(a,d,e,q,j,w,1);Ug(a,d,e,r,j,u,0);r=w+52|0;j=u+52|0;a=(k|0)==0;d=e+80|0;m=0;while(1){if((m|0)>=(i|0))break;q=c[f+(m+g<<2)>>2]|0;p=c[r>>2]|0;o=p+-1|0;D=+h[w+56+(o<<5)>>3];B=+h[w+56+(o<<5)+8>>3];C=+h[w+56+(o<<5)+16>>3];h[19215]=D;h[19218]=B;m=m+1|0;z=+(m|0);A=s*z;h[19217]=C+A;z=B-n*z;h[19216]=z;h[19219]=D;h[19222]=z;o=(c[j>>2]|0)+-1|0;D=+h[u+56+(o<<5)+16>>3];h[19221]=D;h[19220]=z-n;B=+h[u+56+(o<<5)>>3];C=+h[u+56+(o<<5)+8>>3];h[19225]=D;h[19226]=C;h[19223]=B-A;h[19224]=z;o=0;while(1){if((o|0)>=(p|0)){o=0;break}p=w+56+(o<<5)|0;c[t>>2]=c[p>>2];c[t+4>>2]=c[p+4>>2];c[t+8>>2]=c[p+8>>2];c[t+12>>2]=c[p+12>>2];c[t+16>>2]=c[p+16>>2];c[t+20>>2]=c[p+20>>2];c[t+24>>2]=c[p+24>>2];c[t+28>>2]=c[p+28>>2];fO(e,t);o=o+1|0;p=c[r>>2]|0;}while(1){if((o|0)==3)break;y=153720+(o<<5)|0;c[t>>2]=c[y>>2];c[t+4>>2]=c[y+4>>2];c[t+8>>2]=c[y+8>>2];c[t+12>>2]=c[y+12>>2];c[t+16>>2]=c[y+16>>2];c[t+20>>2]=c[y+20>>2];c[t+24>>2]=c[y+24>>2];c[t+28>>2]=c[y+28>>2];fO(e,t);o=o+1|0;}p=c[j>>2]|0;while(1){o=p+-1|0;if((p|0)<=0)break;p=u+56+(o<<5)|0;c[t>>2]=c[p>>2];c[t+4>>2]=c[p+4>>2];c[t+8>>2]=c[p+8>>2];c[t+12>>2]=c[p+12>>2];c[t+16>>2]=c[p+16>>2];c[t+20>>2]=c[p+20>>2];c[t+24>>2]=c[p+24>>2];c[t+28>>2]=c[p+28>>2];fO(e,t);p=o;}if(a)o=NM(e,v)|0;else o=HM(e,v)|0;p=c[v>>2]|0;if(!p)break;dO(q,c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2]|0,o,p,17296);c[d>>2]=0;}l=x;return}function Tg(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+128|0;j=n+96|0;k=n+64|0;o=n+32|0;m=n;wg(o,a,b,e,0,f);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[g+16>>2]=c[o+16>>2];c[g+20>>2]=c[o+20>>2];c[g+24>>2]=c[o+24>>2];c[g+28>>2]=c[o+28>>2];c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];c[k+16>>2]=c[o+16>>2];c[k+20>>2]=c[o+20>>2];c[k+24>>2]=c[o+24>>2];c[k+28>>2]=c[o+28>>2];c[g+48>>2]=4;if(!(i<<24>>24))jO(d,f,2,g,0);else gO(d,f,2,g,0);b=g+52|0;f=(c[b>>2]|0)+-1|0;o=k+24|0;h[o>>3]=+h[g+56+(f<<5)+24>>3];i=k+8|0;h[i>>3]=+h[g+56+(f<<5)+8>>3];e=c[e+16>>2]|0;p=+h[(c[(c[a+16>>2]|0)+196>>2]|0)+(c[e+232>>2]<<6)+24>>3]+ +h[e+24>>3];c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];c[j+16>>2]=c[k+16>>2];c[j+20>>2]=c[k+20>>2];c[j+24>>2]=c[k+24>>2];c[j+28>>2]=c[k+28>>2];yg(m,j,4,p);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[k+16>>2]=c[m+16>>2];c[k+20>>2]=c[m+20>>2];c[k+24>>2]=c[m+24>>2];c[k+28>>2]=c[m+28>>2];if(+h[k>>3]<+h[k+16>>3]?+h[i>>3]<+h[o>>3]:0){o=c[b>>2]|0;c[b>>2]=o+1;o=g+56+(o<<5)|0;c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];c[o+16>>2]=c[k+16>>2];c[o+20>>2]=c[k+20>>2];c[o+24>>2]=c[k+24>>2];c[o+28>>2]=c[k+28>>2];}l=n;return}function Ug(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+128|0;j=n+96|0;k=n+64|0;o=n+32|0;m=n;wg(o,a,b,e,0,f);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[g+16>>2]=c[o+16>>2];c[g+20>>2]=c[o+20>>2];c[g+24>>2]=c[o+24>>2];c[g+28>>2]=c[o+28>>2];c[k>>2]=c[o>>2];c[k+4>>2]=c[o+4>>2];c[k+8>>2]=c[o+8>>2];c[k+12>>2]=c[o+12>>2];c[k+16>>2]=c[o+16>>2];c[k+20>>2]=c[o+20>>2];c[k+24>>2]=c[o+24>>2];c[k+28>>2]=c[o+28>>2];c[g+48>>2]=1;if(!(i<<24>>24))jO(d,f,2,g,0);else gO(d,f,2,g,0);b=g+52|0;f=(c[b>>2]|0)+-1|0;o=k+24|0;h[o>>3]=+h[g+56+(f<<5)+24>>3];i=k+8|0;h[i>>3]=+h[g+56+(f<<5)+8>>3];e=c[e+16>>2]|0;p=+h[e+24>>3]-+h[(c[(c[a+16>>2]|0)+196>>2]|0)+(c[e+232>>2]<<6)+24>>3];c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];c[j+16>>2]=c[k+16>>2];c[j+20>>2]=c[k+20>>2];c[j+24>>2]=c[k+24>>2];c[j+28>>2]=c[k+28>>2];yg(m,j,1,p);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[k+16>>2]=c[m+16>>2];c[k+20>>2]=c[m+20>>2];c[k+24>>2]=c[m+24>>2];c[k+28>>2]=c[m+28>>2];if(+h[k>>3]<+h[k+16>>3]?+h[i>>3]<+h[o>>3]:0){o=c[b>>2]|0;c[b>>2]=o+1;o=g+56+(o<<5)|0;c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];c[o+16>>2]=c[k+16>>2];c[o+20>>2]=c[k+20>>2];c[o+24>>2]=c[k+24>>2];c[o+28>>2]=c[k+28>>2];}l=n;return}function Vg(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function Wg(b,d,e,f,g,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0,A=0.0,B=0.0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0.0;Y=l;l=l+288|0;R=Y+256|0;Q=Y+240|0;P=Y+224|0;V=Y+280|0;W=Y+272|0;X=Y+32|0;S=Y+16|0;T=Y;m=Y+208|0;n=Y+192|0;o=c[e+(f<<2)>>2]|0;U=JK(g<<2)|0;k=0;while(1){if((k|0)>=(g|0))break;c[U+(k<<2)>>2]=c[e+(k+f<<2)>>2];k=k+1|0;}o4(U,g,4,59);e=b+16|0;f=(c[e>>2]|0)+16|0;o=o+16|0;C=(c[o>>2]|0)+16|0;c[Q>>2]=c[f>>2];c[Q+4>>2]=c[f+4>>2];c[Q+8>>2]=c[f+8>>2];c[Q+12>>2]=c[f+12>>2];c[R>>2]=c[C>>2];c[R+4>>2]=c[C+4>>2];c[R+8>>2]=c[C+8>>2];c[R+12>>2]=c[C+12>>2];Ng(m,Q,R);c[S>>2]=c[m>>2];c[S+4>>2]=c[m+4>>2];c[S+8>>2]=c[m+8>>2];c[S+12>>2]=c[m+12>>2];C=d+16|0;f=(c[C>>2]|0)+16|0;o=(c[o>>2]|0)+56|0;c[Q>>2]=c[f>>2];c[Q+4>>2]=c[f+4>>2];c[Q+8>>2]=c[f+8>>2];c[Q+12>>2]=c[f+12>>2];c[R>>2]=c[o>>2];c[R+4>>2]=c[o+4>>2];c[R+8>>2]=c[o+8>>2];c[R+12>>2]=c[o+12>>2];Ng(n,Q,R);c[T>>2]=c[n>>2];c[T+4>>2]=c[n+4>>2];c[T+8>>2]=c[n+8>>2];c[T+12>>2]=c[n+12>>2];w=+h[(c[e>>2]|0)+96>>3]+ +h[S>>3];x=+h[T>>3]-+h[(c[C>>2]|0)+88>>3];u=x+w;v=u*.5;C=c[U>>2]|0;c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];o=X+16|0;c[o>>2]=c[S>>2];c[o+4>>2]=c[S+4>>2];c[o+8>>2]=c[S+8>>2];c[o+12>>2]=c[S+12>>2];e=X+32|0;c[e>>2]=c[T>>2];c[e+4>>2]=c[T+4>>2];c[e+8>>2]=c[T+8>>2];c[e+12>>2]=c[T+12>>2];f=X+48|0;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];dO(C,c[((c[C>>2]&3|0)==2?C:C+-48|0)+40>>2]|0,X,4,17296);C=c[(c[C+16>>2]|0)+96>>2]|0;h[C+56>>3]=v;z=S+8|0;r=+h[z>>3];s=+h[C+32>>3];h[C+64>>3]=(s+6.0)*.5+r;a[C+81>>0]=1;r=r+3.0;B=+h[C+24>>3];A=(u-B)*.5;B=(B+u)*.5;C=X+24|0;D=X+40|0;E=X+56|0;F=X+64|0;G=T+8|0;H=X+72|0;I=X+80|0;J=X+88|0;K=X+96|0;L=X+104|0;M=X+112|0;N=X+120|0;O=V+4|0;n=(i|0)==6&1;q=0.0;p=0.0;s=s+r;m=1;while(1){if((m|0)>=(j|0)){y=6;break}d=c[U+(m<<2)>>2]|0;if(!(m&1)){c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=A;h[C>>3]=+h[z>>3];h[e>>3]=A;h[D>>3]=s;h[f>>3]=B;h[E>>3]=s;h[F>>3]=B;t=+h[G>>3];h[H>>3]=t;Z=+h[T>>3];h[I>>3]=Z;h[J>>3]=t;h[K>>3]=Z;Z=s+6.0;h[L>>3]=Z;h[M>>3]=+h[S>>3];h[N>>3]=Z;s=+h[(c[(c[d+16>>2]|0)+96>>2]|0)+32>>3];t=Z+s*.5;s=Z+s;}else {k=d+16|0;b=c[(c[k>>2]|0)+96>>2]|0;if((m|0)==1){p=+h[b+24>>3];q=(p+u)*.5;p=(u-p)*.5;}r=r+-6.0-+h[b+32>>3];c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=+h[S>>3];t=r+-6.0;h[C>>3]=t;h[e>>3]=+h[T>>3];h[D>>3]=t;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];h[F>>3]=q;h[H>>3]=+h[G>>3];h[I>>3]=q;h[J>>3]=r;h[K>>3]=p;h[L>>3]=r;h[M>>3]=p;h[N>>3]=+h[z>>3];t=+h[(c[(c[k>>2]|0)+96>>2]|0)+32>>3]*.5+r;}c[O>>2]=8;c[V>>2]=X;c[P>>2]=c[S>>2];c[P+4>>2]=c[S+4>>2];c[P+8>>2]=c[S+8>>2];c[P+12>>2]=c[S+12>>2];c[Q>>2]=c[T>>2];c[Q+4>>2]=c[T+4>>2];c[Q+8>>2]=c[T+8>>2];c[Q+12>>2]=c[T+12>>2];c[R>>2]=c[V>>2];c[R+4>>2]=c[V+4>>2];k=DM(P,Q,R,W,n)|0;b=c[W>>2]|0;if(!b)break;i=c[(c[d+16>>2]|0)+96>>2]|0;h[i+56>>3]=v;h[i+64>>3]=t;a[i+81>>0]=1;dO(d,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,k,b,17296);m=m+1|0;}a:do if((y|0)==6){v=(x+w*2.0)*.3333333333333333;u=(x*2.0+w)*.3333333333333333;while(1){if((m|0)>=(g|0))break;d=c[U+(m<<2)>>2]|0;if(!(m&1)){c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=A;h[C>>3]=+h[z>>3];h[e>>3]=A;h[D>>3]=s;h[f>>3]=B;h[E>>3]=s;h[F>>3]=B;t=+h[G>>3];h[H>>3]=t;Z=+h[T>>3];h[I>>3]=Z;h[J>>3]=t;h[K>>3]=Z;Z=s+6.0;h[L>>3]=Z;h[M>>3]=+h[S>>3];s=Z;t=p;p=Z;}else {y=(m|0)==1;t=y?v:p;q=y?u:q;p=r+-6.0;c[X>>2]=c[S>>2];c[X+4>>2]=c[S+4>>2];c[X+8>>2]=c[S+8>>2];c[X+12>>2]=c[S+12>>2];h[o>>3]=+h[S>>3];r=r+-12.0;h[C>>3]=r;h[e>>3]=+h[T>>3];h[D>>3]=r;c[f>>2]=c[T>>2];c[f+4>>2]=c[T+4>>2];c[f+8>>2]=c[T+8>>2];c[f+12>>2]=c[T+12>>2];h[F>>3]=q;h[H>>3]=+h[G>>3];h[I>>3]=q;h[J>>3]=p;h[K>>3]=t;h[L>>3]=p;h[M>>3]=t;r=p;p=+h[z>>3];}h[N>>3]=p;c[O>>2]=8;c[V>>2]=X;c[P>>2]=c[S>>2];c[P+4>>2]=c[S+4>>2];c[P+8>>2]=c[S+8>>2];c[P+12>>2]=c[S+12>>2];c[Q>>2]=c[T>>2];c[Q+4>>2]=c[T+4>>2];c[Q+8>>2]=c[T+8>>2];c[Q+12>>2]=c[T+12>>2];c[R>>2]=c[V>>2];c[R+4>>2]=c[V+4>>2];k=DM(P,Q,R,W,n)|0;b=c[W>>2]|0;if(!b)break a;dO(d,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,k,b,17296);m=m+1|0;p=t;}U1(U);}while(0);l=Y;return}function Xg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0;g=l;l=l+16|0;f=g;j=(xB(b)|0)==0;j=j?18592:18584;a[f>>0]=a[j>>0]|0;a[f+1>>0]=a[j+1>>0]|0;a[f+2>>0]=a[j+2>>0]|0;a[f+3>>0]=a[j+3>>0]|0;f=oB(85493,f,0)|0;TC(f,137483,280,1)|0;GA(f,0,87171,195059)|0;j=JK(96)|0;e=c[f+16>>2]|0;c[e+8>>2]=j;i=c[b+16>>2]|0;k=c[i+8>>2]|0;h[j>>3]=+h[k>>3];h[j+24>>3]=+h[k+24>>3];a[e+115>>0]=a[i+115>>0]|0;c[e+116>>2]=c[i+116>>2]&1^1;c[e+248>>2]=c[i+248>>2];c[e+252>>2]=c[i+252>>2];e=LA(yC(b)|0,1,0)|0;while(1){if(!e)break;GA(f,1,c[e+8>>2]|0,c[e+12>>2]|0)|0;e=LA(yC(b)|0,1,e)|0;}e=LA(yC(b)|0,2,0)|0;while(1){if(!e)break;GA(f,2,c[e+8>>2]|0,c[e+12>>2]|0)|0;e=LA(yC(b)|0,2,e)|0;}if(!(GA(f,2,111464,0)|0))GA(f,2,111464,195059)|0;if(!(GA(f,2,111455,0)|0))GA(f,2,111455,195059)|0;ah(f,d);l=g;return f|0}function Yg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;a=tC(a,KB(b)|0,1)|0;TC(a,137447,304,1)|0;UA(b,a)|0;if((WM(b)|0)==2){f=b+16|0;b=KK((l2(c[c[(c[f>>2]|0)+104>>2]>>2]|0)|0)+3|0)|0;c[d>>2]=c[c[(c[f>>2]|0)+104>>2]>>2];m4(b,85488,d)|0;SA(a,108224,b)|0;}l=e;return a|0}function Zg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=iB(a,b,c,0,1)|0;TC(c,137460,176,1)|0;UA(d,c)|0;return c|0}function _g(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0;i=l;l=l+32|0;g=i+16|0;f=i;if(e|0){j=+h[b>>3];e=b+8|0;h[b>>3]=+h[e>>3];h[e>>3]=-j;};c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];Ng(a,f,g);l=i;return}function $g(a,b){a=a|0;b=b|0;c[47189]=c[b>>2];c[47193]=c[b+4>>2];c[47194]=c[b+8>>2];c[47174]=c[b+12>>2];c[47175]=c[b+16>>2];c[47181]=c[b+20>>2];c[47180]=c[b+24>>2];c[47179]=c[b+28>>2];c[47205]=c[b+32>>2];c[47197]=c[b+36>>2];c[47182]=c[b+40>>2];c[47192]=c[b+44>>2];c[47201]=c[b+48>>2];c[47200]=c[b+52>>2];c[47199]=c[b+56>>2];c[47204]=c[b+60>>2];c[47198]=c[b+64>>2];c[47183]=c[b+68>>2];c[47145]=c[b+72>>2];c[47146]=c[b+76>>2];c[47147]=c[b+80>>2];c[47157]=c[b+84>>2];c[47150]=c[b+88>>2];c[47151]=c[b+92>>2];c[47152]=c[b+96>>2];c[47154]=c[b+100>>2];c[47155]=c[b+104>>2];c[47158]=c[b+108>>2];c[47161]=c[b+112>>2];c[47159]=c[b+116>>2];c[47160]=c[b+120>>2];c[47163]=c[b+124>>2];c[47162]=c[b+128>>2];c[47164]=c[b+132>>2];c[47165]=c[b+136>>2];c[47156]=c[b+140>>2];c[47168]=c[b+144>>2];c[47140]=c[b+148>>2];c[47138]=c[b+152>>2];U1(b);Rf(a);sB(a)|0;return}function ah(a,b){a=a|0;b=b|0;c[b>>2]=c[47189];c[b+4>>2]=c[47193];c[b+8>>2]=c[47194];c[b+12>>2]=c[47174];c[b+16>>2]=c[47175];c[b+20>>2]=c[47181];c[b+24>>2]=c[47180];c[b+28>>2]=c[47179];c[b+32>>2]=c[47205];c[b+36>>2]=c[47197];c[b+40>>2]=c[47182];c[b+44>>2]=c[47192];c[b+48>>2]=c[47201];c[b+52>>2]=c[47200];c[b+56>>2]=c[47199];c[b+60>>2]=c[47204];c[b+64>>2]=c[47198];c[b+68>>2]=c[47183];c[b+72>>2]=c[47145];c[b+76>>2]=c[47146];c[b+80>>2]=c[47147];c[b+84>>2]=c[47157];c[b+88>>2]=c[47150];c[b+92>>2]=c[47151];c[b+96>>2]=c[47152];c[b+100>>2]=c[47154];c[b+104>>2]=c[47155];c[b+108>>2]=c[47158];c[b+112>>2]=c[47161];c[b+116>>2]=c[47159];c[b+120>>2]=c[47160];c[b+124>>2]=c[47163];c[b+128>>2]=c[47162];c[b+132>>2]=c[47164];c[b+136>>2]=c[47165];c[b+140>>2]=c[47156];c[b+144>>2]=c[47168];c[b+152>>2]=c[47138];c[b+148>>2]=c[47140];c[47189]=0;c[47193]=GA(a,2,87412,0)|0;c[47194]=GA(a,2,87421,0)|0;b=GA(a,2,101541,0)|0;c[47174]=b;if(!b)c[47174]=GA(a,2,101541,195059)|0;c[47175]=0;c[47181]=0;c[47180]=GA(a,2,101437,0)|0;c[47179]=GA(a,2,101428,0)|0;c[47205]=GA(a,2,101717,0)|0;c[47197]=0;c[47182]=GA(a,2,108224,0)|0;c[47192]=GA(a,2,85498,0)|0;c[47201]=0;c[47200]=GA(a,2,101617,0)|0;c[47199]=GA(a,2,101603,0)|0;c[47204]=GA(a,2,101708,0)|0;c[47198]=0;c[47183]=0;c[47145]=GA(a,1,141048,0)|0;c[47146]=GA(a,1,141116,0)|0;c[47147]=GA(a,1,108230,0)|0;c[47157]=0;c[47150]=GA(a,1,101428,0)|0;c[47151]=GA(a,1,101437,0)|0;c[47152]=0;c[47154]=GA(a,1,108224,0)|0;c[47155]=0;c[47158]=0;c[47161]=GA(a,1,101409,0)|0;c[47159]=GA(a,1,141076,0)|0;c[47160]=GA(a,1,101472,0)|0;c[47163]=GA(a,1,101484,0)|0;c[47162]=GA(a,1,101348,0)|0;c[47164]=GA(a,1,101489,0)|0;c[47165]=GA(a,1,85510,0)|0;c[47156]=0;c[47168]=0;c[47140]=GA(a,0,101409,0)|0;return}function bh(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0;d=c[(c[(c[a>>2]|0)+16>>2]|0)+96>>2]|0;a=c[(c[(c[b>>2]|0)+16>>2]|0)+96>>2]|0;b=(a|0)!=0;if(d)if(b?(f=+h[d+24>>3],i=+h[d+32>>3],e=+h[a+24>>3],g=+h[a+32>>3],!(f>e)):0)if(!(fg)a=-1;else a=i>2]|0)+116>>2]|0;if(!b)break;else a=b;}b=c[a>>2]&3;d=c[(c[((b|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0;e=c[d+232>>2]|0;a=c[(c[((b|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0;b=c[a+232>>2]|0;if((e|0)<=(b|0))if((e|0)<(b|0))a=1;else a=(c[d+236>>2]|0)<(c[a+236>>2]|0)&1;else a=0;return a|0}function dh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;e=d+8|0;f=d;h=(c[a+16>>2]|0)+180|0;g=(c[b+16>>2]|0)+172|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];b=eh(a,f,b,e)|0;l=d;return b|0}function eh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=c[b+4>>2]|0;a:do if((f|0)>0?(g=c[e+4>>2]|0,(g|0)>0):0)if((f|0)<(g|0)){f=c[b>>2]|0;e=0;while(1){b=c[f+(e<<2)>>2]|0;if(!b){b=0;break a}if((c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)==(d|0))break;else e=e+1|0;}}else {f=c[e>>2]|0;e=0;while(1){b=c[f+(e<<2)>>2]|0;if(!b){b=0;break a}if((c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)==(a|0))break;else e=e+1|0;}}else b=0;while(0);return b|0}function fh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=l;l=l+16|0;e=d+8|0;f=d;h=(c[a+16>>2]|0)+188|0;g=(c[b+16>>2]|0)+196|0;c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];b=eh(a,f,b,e)|0;l=d;return b|0}function gh(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+48|0;d=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[d+180>>2]|0;if(!b)b=KK((c[d+184>>2]<<2)+8|0)|0;else b=MK(b,(c[d+184>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0)+180>>2]=b;f=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;d=c[f+180>>2]|0;f=f+184|0;b=c[f>>2]|0;c[f>>2]=b+1;c[d+(b<<2)>>2]=a;e=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;c[(c[e+180>>2]|0)+(c[e+184>>2]<<2)>>2]=0;e=a+-48|0;b=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;if(!d)b=KK((c[b+176>>2]<<2)+8|0)|0;else b=MK(d,(c[b+176>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0)+172>>2]=b;b=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;b=b+176|0;f=c[b>>2]|0;c[b>>2]=f+1;c[d+(f<<2)>>2]=a;f=c[(c[((c[a>>2]&3|0)==2?a:e)+40>>2]|0)+16>>2]|0;c[(c[f+172>>2]|0)+(c[f+176>>2]<<2)>>2]=0;return a|0}function hh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=a+4|0;f=c[e>>2]|0;d=0;while(1){if((d|0)>=(f|0))break;g=c[a>>2]|0;h=g+(d<<2)|0;if((c[h>>2]|0)==(b|0)){i=4;break}else d=d+1|0;}if((i|0)==4){i=f+-1|0;c[e>>2]=i;c[h>>2]=c[g+(i<<2)>>2];c[(c[a>>2]|0)+(i<<2)>>2]=0;}return}function ih(a){a=a|0;if(!a)qa(85551,85561,117,85570);else {hh((c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+180|0,a);hh((c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+172|0,a);return}}function jh(a){a=a|0;var b=0,d=0,e=0,f=0;e=a+48|0;d=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[d+204>>2]|0;if(!b)b=KK((c[d+208>>2]<<2)+8|0)|0;else b=MK(b,(c[d+208>>2]<<2)+8|0)|0;c[(c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0)+204>>2]=b;f=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;b=c[f+204>>2]|0;f=f+208|0;d=c[f>>2]|0;c[f>>2]=d+1;c[b+(d<<2)>>2]=a;e=c[(c[((c[a>>2]&3|0)==3?a:e)+40>>2]|0)+16>>2]|0;c[(c[e+204>>2]|0)+(c[e+208>>2]<<2)>>2]=0;return}function kh(a){a=a|0;lh(a,(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+204|0);return}function lh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=b+4|0;e=c[h>>2]|0;f=c[b>>2]|0;d=0;while(1){if((d|0)>=(e|0)){g=4;break}if((c[f+(d<<2)>>2]|0)==(a|0))break;else d=d+1|0;}if((g|0)==4){if(!f)d=KK((e<<2)+8|0)|0;else d=MK(f,(e<<2)+8|0)|0;c[b>>2]=d;f=c[h>>2]|0;g=f+1|0;c[h>>2]=g;c[d+(f<<2)>>2]=a;c[(c[b>>2]|0)+(g<<2)>>2]=0;}return}function mh(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=JK(96)|0;g=n+48|0;c[g>>2]=c[g>>2]|3;c[n>>2]=c[n>>2]&-4|2;h=JK(176)|0;m=n+16|0;c[m>>2]=h;c[((c[n>>2]&3|0)==3?n:g)+40>>2]=d;j=n+-48|0;c[((c[n>>2]&3|0)==2?n:j)+40>>2]=e;a[h+112>>0]=1;if(!f){c[h+156>>2]=1;b[h+154>>1]=1;b[h+168>>1]=1;b[h+170>>1]=1;}else {c[n>>2]=c[n>>2]&15|c[f>>2]&-16;c[g>>2]=c[g>>2]&15|c[f>>2]&-16;l=f+16|0;i=c[l>>2]|0;b[h+168>>1]=b[i+168>>1]|0;b[h+154>>1]=b[i+154>>1]|0;c[h+156>>2]=c[i+156>>2];b[h+170>>1]=b[i+170>>1]|0;d=c[((c[n>>2]&3|0)==3?n:g)+40>>2]|0;e=c[f>>2]&3;k=f+48|0;if((d|0)!=(c[((e|0)==3?f:k)+40>>2]|0)){g=f+-48|0;if((d|0)==(c[((e|0)==2?f:g)+40>>2]|0)){h=h+16|0;d=i+56|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}}else {h=h+16|0;d=i+16|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0));g=f+-48|0;}d=c[((c[n>>2]&3|0)==2?n:j)+40>>2]|0;e=c[f>>2]&3;if((d|0)!=(c[((e|0)==2?f:g)+40>>2]|0)){if((d|0)==(c[((e|0)==3?f:k)+40>>2]|0)){h=(c[m>>2]|0)+56|0;d=(c[l>>2]|0)+16|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}}else {h=(c[m>>2]|0)+56|0;d=(c[l>>2]|0)+56|0;e=h+40|0;do{c[h>>2]=c[d>>2];h=h+4|0;d=d+4|0;}while((h|0)<(e|0))}d=(c[l>>2]|0)+172|0;if(!(c[d>>2]|0))c[d>>2]=n;c[(c[m>>2]|0)+116>>2]=f;}return n|0}function nh(a,b,c){a=a|0;b=b|0;c=c|0;return gh(mh(a,b,c)|0)|0}function oh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;a=(c[a+16>>2]|0)+192|0;f=c[a>>2]|0;d=c[b+16>>2]|0;c[d+164>>2]=f;e=f;if(f|0)c[(c[e+16>>2]|0)+168>>2]=b;c[a>>2]=b;c[d+168>>2]=0;if((e|0)==(b|0))qa(85587,85561,215,85603);else return}function ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if((a|0)==(b|0))qa(85613,85561,220,85620);f=c[b+16>>2]|0;d=f+164|0;if(c[d>>2]|0)qa(85633,85561,221,85620);e=(c[a+16>>2]|0)+164|0;c[d>>2]=c[e>>2];d=c[e>>2]|0;if(d|0)c[(c[d+16>>2]|0)+168>>2]=b;c[f+168>>2]=a;c[e>>2]=b;return}function qh(a,b){a=a|0;b=b|0;var d=0,e=0;if(!(rh(a,b)|0))qa(85652,85561,231,85673);b=c[b+16>>2]|0;d=c[b+164>>2]|0;e=d;b=b+168|0;if(d|0)c[(c[d+16>>2]|0)+168>>2]=c[b>>2];b=c[b>>2]|0;if(!b)c[(c[a+16>>2]|0)+192>>2]=e;else c[(c[b+16>>2]|0)+164>>2]=e;return}function rh(a,b){a=a|0;b=b|0;a=(c[a+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if((a|0)==0|(a|0)==(b|0))break;a=(c[a+16>>2]|0)+164|0;}return a|0}function sh(b){b=b|0;var d=0,e=0,f=0,g=0;d=JK(64)|0;c[d>>2]=c[d>>2]&-4|1;e=d+16|0;c[e>>2]=JK(304)|0;c[d+24>>2]=yC(b)|0;g=c[e>>2]|0;a[g+156>>0]=1;h[g+96>>3]=1.0;h[g+88>>3]=1.0;h[g+80>>3]=1.0;c[g+216>>2]=1;c[g+176>>2]=0;g=JK(20)|0;f=c[e>>2]|0;c[f+172>>2]=g;c[f+184>>2]=0;f=JK(20)|0;c[(c[e>>2]|0)+180>>2]=f;oh(b,d);b=(c[b+16>>2]|0)+232|0;c[b>>2]=(c[b>>2]|0)+1;return d|0}function th(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=d+48|0;e=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;f=c[e+188>>2]|0;if(!f)e=KK((c[e+192>>2]<<2)+8|0)|0;else e=MK(f,(c[e+192>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0)+188>>2]=e;h=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;f=c[h+188>>2]|0;h=h+192|0;e=c[h>>2]|0;c[h>>2]=e+1;c[f+(e<<2)>>2]=d;g=c[(c[((c[d>>2]&3|0)==3?d:g)+40>>2]|0)+16>>2]|0;c[(c[g+188>>2]|0)+(c[g+192>>2]<<2)>>2]=0;g=d+-48|0;e=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;f=c[e+196>>2]|0;if(!f)e=KK((c[e+200>>2]<<2)+8|0)|0;else e=MK(f,(c[e+200>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0)+196>>2]=e;e=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;f=c[e+196>>2]|0;e=e+200|0;h=c[e>>2]|0;c[e>>2]=h+1;c[f+(h<<2)>>2]=d;h=c[(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;c[(c[h+196>>2]|0)+(c[h+200>>2]<<2)>>2]=0;a[(c[b+16>>2]|0)+240>>0]=1;a[(c[(gg(b)|0)+16>>2]|0)+240>>0]=1;return}function uh(a){a=a|0;var b=0,d=0;if(!a)qa(85551,85561,269,85690);b=c[(c[a+16>>2]|0)+116>>2]|0;if(b|0?(d=(c[b+16>>2]|0)+172|0,(c[d>>2]|0)==(a|0)):0)c[d>>2]=0;hh((c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+188|0,a);hh((c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+196|0,a);return}function vh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;d=(c[a+16>>2]|0)+172|0;e=c[d>>2]|0;do if((e|0)!=(b|0))if(!e){c[d>>2]=b;wh(a,b);break}else qa(87593,85561,340,85728);else gA(0,85707,f)|0;while(0);l=f;return}function wh(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,i=0;f=(c[d+16>>2]|0)+170|0;i=c[a+16>>2]|0;a=b[i+170>>1]|0;if((e[f>>1]|0)<(a&65535))b[f>>1]=a;g=i+168|0;h=i+154|0;f=i+156|0;a=d;while(1){if(!a)break;d=c[a+16>>2]|0;i=d+168|0;b[i>>1]=(e[i>>1]|0)+(e[g>>1]|0);i=d+154|0;b[i>>1]=(e[i>>1]|0)+(e[h>>1]|0);i=d+156|0;c[i>>2]=(c[i>>2]|0)+(c[f>>2]|0);a=c[d+172>>2]|0;}return}function xh(d){d=d|0;var e=0,f=0,g=0,h=0;f=d+16|0;e=c[(c[f>>2]|0)+172>>2]|0;a:while(1){if(!e)break;yh(e,d);h=c[e+16>>2]|0;g=c[h+172>>2]|0;if(!(b[h+168>>1]|0))zh(e);while(1){if((a[(c[e+16>>2]|0)+112>>0]|0)!=1){e=g;continue a}e=c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){e=g;continue a}if((c[e+184>>2]|0)!=1){e=g;continue a}e=c[c[e+180>>2]>>2]|0;yh(e,d);}}c[(c[f>>2]|0)+172>>2]=0;return}function yh(a,d){a=a|0;d=d|0;var f=0;f=c[d+16>>2]|0;d=c[a+16>>2]|0;a=d+168|0;b[a>>1]=(e[a>>1]|0)-(e[f+168>>1]|0);a=d+154|0;b[a>>1]=(e[a>>1]|0)-(e[f+154>>1]|0);d=d+156|0;c[d>>2]=(c[d>>2]|0)-(c[f+156>>2]|0);return}function zh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(!a)qa(85551,85561,128,85741);g=a+48|0;d=0;while(1){b=c[a>>2]|0;e=(c[(c[((b&3|0)==3?a:g)+40>>2]|0)+16>>2]|0)+180|0;f=c[(c[e>>2]|0)+(d<<2)>>2]|0;if(!f)break;if((f|0)==(a|0))hh(e,a);d=d+1|0;}g=a+-48|0;f=0;while(1){d=(c[(c[((b&3|0)==2?a:g)+40>>2]|0)+16>>2]|0)+172|0;e=c[(c[d>>2]|0)+(f<<2)>>2]|0;if(!e)break;if((e|0)==(a|0)){hh(d,a);b=c[a>>2]|0;}f=f+1|0;}return}function Ah(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;p=l;l=l+1040|0;n=p+1032|0;o=p;m=p+8|0;k=d+16|0;d=c[k>>2]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;i=c[d+196>>2]|0;h=i+(j<<6)|0;i=i+(j<<6)+4|0;g=0;d=0;while(1){if((g|0)>=(c[h>>2]|0))break;e=c[(c[i>>2]|0)+(g<<2)>>2]|0;f=e+16|0;if(c[(c[f>>2]|0)+112>>2]|0){if(!d){a[n>>0]=a[18588]|0;a[n+1>>0]=a[18589]|0;a[n+2>>0]=a[18590]|0;a[n+3>>0]=a[18591]|0;d=oB(85763,n,0)|0;}c[o>>2]=g;m4(m,137395,o)|0;t=tC(d,m,1)|0;TC(t,91164,24,1)|0;q=c[(c[f>>2]|0)+180>>2]|0;r=c[q>>2]|0;r=c[(c[(c[((c[r>>2]&3|0)==2?r:r+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;q=c[q+4>>2]|0;q=c[(c[(c[((c[q>>2]&3|0)==2?q:q+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;s=(r|0)>(q|0);f=c[t+16>>2]|0;c[f+12>>2]=s?q:r;c[f+16>>2]=s?r:q;c[f+20>>2]=e;}g=g+1|0;}if(d|0){if((tB(d)|0)>1)Bh(d,h);sB(d)|0;}j=j+1|0;d=c[k>>2]|0;}l=p;return}function Bh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=0;h=jC(a)|0;a:while(1){if(!h)break;i=kC(a,h)|0;j=h+16|0;g=i;while(1){if(!g){h=i;continue a}f=c[g+16>>2]|0;e=c[j>>2]|0;if((c[f+16>>2]|0)>(c[e+12>>2]|0)){if((c[e+16>>2]|0)<=(c[f+12>>2]|0))iB(a,h,g,0,1)|0;}else {iB(a,g,h,0,1)|0;d=1;}g=kC(a,g)|0;}}do if(d|0){h=ND(a,85766,1)|0;j=JK((tB(a)|0)<<2)|0;i=JK((tB(a)|0)<<2)|0;f=b+4|0;e=jC(a)|0;b:while(1){if(!e){d=23;break}if((c[(c[e+16>>2]|0)+8>>2]|0)==0?vB(a,e,1,1)|0:0){c:do if(Ch(a,e,h,i)|0){g=tB(h)|0;if((Dh(a,h,j)|0)!=(g|0)){d=17;break b}o4(i,g,4,60);d=0;while(1){if((d|0)>=(g|0))break c;b=i+(d<<2)|0;k=c[j+(d<<2)>>2]|0;c[(c[k+16>>2]|0)+236>>2]=c[b>>2];c[(c[f>>2]|0)+(c[b>>2]<<2)>>2]=k;d=d+1|0;}}while(0);Fh(h);}e=kC(a,e)|0;}if((d|0)==17)qa(85771,85781,265,85792);else if((d|0)==23){U1(j);break}}while(0);return}function Ch(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=c[b+16>>2]|0;c[h+8>>2]=1;h=c[(c[(c[h+20>>2]|0)+16>>2]|0)+236>>2]|0;c[e+((tB(d)|0)<<2)>>2]=h;oC(d,b,1)|0;h=XA(a,b)|0;f=0;while(1){if(!h)break;j=c[h>>2]&3;g=c[((j|0)==2?h:h+-48|0)+40>>2]|0;i=c[g+16>>2]|0;f=f+((c[(c[(c[i+20>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[(c[(c[((j|0)==3?h:h+48|0)+40>>2]|0)+16>>2]|0)+20>>2]|0)+16>>2]|0)+236>>2]|0)&1)|0;if(!(c[i+8>>2]|0))f=(Ch(a,g,d,e)|0)+f|0;h=ZA(a,h)|0;}h=_A(a,b)|0;while(1){if(!h)break;i=c[h>>2]&3;g=c[((i|0)==3?h:h+48|0)+40>>2]|0;j=c[g+16>>2]|0;f=f+((c[(c[(c[(c[(c[((i|0)==2?h:h+-48|0)+40>>2]|0)+16>>2]|0)+20>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[j+20>>2]|0)+16>>2]|0)+236>>2]|0)&1)|0;if(!(c[j+8>>2]|0))f=(Ch(a,g,d,e)|0)+f|0;h=$A(a,h)|0;}return f|0}function Dh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=0;while(1){e=Gh(a,b)|0;if(!e)break;c[d+(f<<2)>>2]=c[(c[e+16>>2]|0)+20>>2];vC(b,e)|0;e=XA(a,e)|0;while(1){if(!e)break;g=ZA(a,e)|0;lB(a,e)|0;e=g;}f=f+1|0;}return f|0}function Eh(a,b){a=a|0;b=b|0;return (c[a>>2]|0)-(c[b>>2]|0)|0}function Fh(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;c=kC(a,b)|0;vC(a,b)|0;b=c;}return}function Gh(a,b){a=a|0;b=b|0;var c=0;c=jC(b)|0;while(1){if(!c){c=0;break}if(!(vB(a,c,1,0)|0))break;c=kC(b,c)|0;}return c|0}function Hh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;Ih(b);i=b+16|0;f=0;e=0;while(1){if((f|0)>=(c[(c[i>>2]|0)+220>>2]|0))break;Jh(b,f);f=f+1|0;e=(Kh(b,0,d)|0)+e|0;}Lh(b);h=1;while(1){f=c[i>>2]|0;g=c[f+180>>2]|0;if((h|0)>(g|0))break;g=(Mh(c[(c[f+184>>2]|0)+(h<<2)>>2]|0,d)|0)+e|0;h=h+1|0;e=g;}do if((g|0)>0){f=QA(b,85806)|0;if(f|0?(dP(f)|0)<<24>>24==0:0)break;jl(b);a[193769]=1;e=Kh(b,2,d)|0;}while(0);Nh(b,e);return}function Ih(d){d=d|0;var e=0;if(0);a[193769]=0;c[46741]=d;e=((uB(gg(d)|0)|0)<<2)+4|0;c[46740]=JK(e)|0;c[46739]=JK(e)|0;Di(d);e=d+16|0;if(b[(c[e>>2]|0)+136>>1]&16)Ei(d);Sk(d);Gl(d,1);Fi(d);Uh(d);e=c[e>>2]|0;c[46742]=b[e+236>>1];c[46743]=b[e+238>>1];return}function Jh(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;a=c[a+16>>2]|0;c[a+192>>2]=c[(c[a+216>>2]|0)+(d<<2)>>2];a:do if((d|0)>0){d=b[a+238>>1]|0;e=a+196|0;a=b[a+236>>1]|0;while(1){if((a|0)>(d|0))break a;f=c[e>>2]|0;g=f+(a<<6)+4|0;f=f+(a<<6)|0;c[g>>2]=(c[g>>2]|0)+(c[f>>2]<<2);c[f>>2]=0;a=a+1|0;}}while(0);return}function Kh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+32|0;n=o;if((b|0)>1){e=ii(0)|0;ji(a);}else e=2147483647;m=c[15712]|0;k=b;f=0;b=e;while(1){if((k|0)>=3)break;f=c[47136]|0;if((k|0)==2)if((e|0)>(b|0)){li(a);e=b;}else e=b;else {e=(f|0)<4?f:4;if((gg(a)|0)==(a|0))ki(a,k);if(!k)Vh(a);Wh(a);g=ii(0)|0;if((g|0)>(b|0)){f=e;e=g;}else {ji(a);f=e;e=g;b=g;}}g=0;j=0;while(1){if((j|0)>=(f|0))break;if(0);i=g+1|0;if((e|0)==0|(g|0)>=(c[46744]|0))break;mi(a,j);e=ii(0)|0;if((e|0)>(b|0))g=i;else {ji(a);g=+h[23215]*+(b|0)>+(e|0)?0:i;b=e;}j=j+1|0;}if(!e){e=0;break}else k=k+1|0;}if((e|0)>(b|0))li(a);if((b|0)>0){ni(a,0);e=ii(0)|0;}else e=b;a:do if(d|0){b=0;while(1){if((b|0)>=(f|0))break a;oi(a);b=b+1|0;}}while(0);l=o;return e|0}function Lh(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;n=p;hi(a);k=a+16|0;d=c[k>>2]|0;m=c[15712]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;e=c[d+196>>2]|0;f=c[e+(j<<6)+8>>2]|0;c[e+(j<<6)>>2]=f;g=c[e+(j<<6)+12>>2]|0;c[e+(j<<6)+4>>2]=g;i=0;while(1){if((i|0)>=(f|0))break;h=c[g+(i<<2)>>2]|0;if(!h){o=6;break}c[(c[h+16>>2]|0)+236>>2]=i;i=i+1|0;}if((o|0)==6){o=0;if(0);c[e+(j<<6)>>2]=i;}j=j+1|0;}l=p;return}function Mh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;dl(a);Uh(a);Vh(a);Wh(a);f=a+16|0;d=Kh(a,2,b)|0;e=1;while(1){g=c[f>>2]|0;if((e|0)>(c[g+180>>2]|0))break;d=(Mh(c[(c[g+184>>2]|0)+(e<<2)>>2]|0,b)|0)+d|0;e=e+1|0;}Xh(a);return d|0}function Nh(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+16|0;p=q;f=c[46739]|0;if(f|0){U1(f);c[46739]=0;}f=c[46740]|0;if(f|0){U1(f);c[46740]=0;}o=d+16|0;f=1;while(1){g=c[o>>2]|0;if((f|0)>(c[g+180>>2]|0))break;Oh(c[(c[g+184>>2]|0)+(f<<2)>>2]|0);f=f+1|0;}n=b[g+236>>1]|0;f=g;while(1){if((n|0)>(b[f+238>>1]|0))break;else m=0;while(1){f=c[f+196>>2]|0;if((m|0)>=(c[f+(n<<6)>>2]|0))break;k=(c[(c[f+(n<<6)+4>>2]|0)+(m<<2)>>2]|0)+16|0;f=c[k>>2]|0;c[f+236>>2]=m;f=c[f+188>>2]|0;a:do if(f|0){g=0;while(1){i=c[f+(g<<2)>>2]|0;if(!i)break a;j=i+16|0;if((a[(c[j>>2]|0)+112>>0]|0)==4){uh(i);U1(c[j>>2]|0);U1(i);g=g+-1|0;f=c[(c[k>>2]|0)+188>>2]|0;}g=g+1|0;}}while(0);m=m+1|0;f=c[o>>2]|0;}Ph(c[f+(n<<6)+56>>2]|0);n=n+1|0;f=c[o>>2]|0;}if(0);l=q;return}function Oh(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;g=a+16|0;d=1;while(1){f=c[g>>2]|0;if((d|0)>(c[f+180>>2]|0))break;Oh(c[(c[f+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}a:do if(c[f+268>>2]|0){e=b[f+236>>1]|0;d=f;while(1){if((e|0)>(b[d+238>>1]|0))break a;j=c[(c[d+268>>2]|0)+(e<<2)>>2]|0;i=Qh(a,j,-1)|0;j=Qh(a,j,1)|0;c[(c[(c[g>>2]|0)+268>>2]|0)+(e<<2)>>2]=i;k=c[(c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0;i=c[(c[i+16>>2]|0)+236>>2]|0;f=c[g>>2]|0;h=c[f+196>>2]|0;c[h+(e<<6)+4>>2]=k+(i<<2);c[h+(e<<6)>>2]=(c[(c[j+16>>2]|0)+236>>2]|0)+1-i;e=e+1|0;d=f;}}while(0);return}function Ph(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function Qh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=b;while(1){b=Rh(b,c)|0;if(!b)break;if(Sh(a,b)|0){d=b;continue}e=(Th(a,b)|0)==0;d=e?d:b;}return d|0}function Rh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!a)qa(85856,85781,1023,85858);if((b|0)<0){a=c[a+16>>2]|0;e=c[a+236>>2]|0;if((e|0)>0){a=(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(c[a+232>>2]<<6)+4|0;d=e+-1|0;f=7;}else g=0;}else {a=c[a+16>>2]|0;e=c[a+236>>2]|0;a=(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(c[a+232>>2]<<6)+4|0;d=e+1|0;f=7;}if((f|0)==7){a=c[(c[a>>2]|0)+(d<<2)>>2]|0;if(a)if((O((c[(c[a+16>>2]|0)+236>>2]|0)-e|0,b)|0)>0)g=a;else qa(85867,85781,1029,85858);else g=0;}return g|0}function Sh(b,d){b=b|0;d=d|0;if(!(a[(c[d+16>>2]|0)+156>>0]|0))b=(HC(b,d)|0)!=0&1;else b=0;return b|0}function Th(b,d){b=b|0;d=d|0;var e=0,f=0;d=c[d+16>>2]|0;if(((a[d+156>>0]|0)==1?(c[d+176>>2]|0)==1:0)?(c[d+184>>2]|0)==1:0){d=c[d+180>>2]|0;while(1){d=c[d>>2]|0;e=c[d+16>>2]|0;if(!(a[e+112>>0]|0))break;else d=e+116|0;}if(HC(b,d)|0)d=1;else f=7;}else f=7;if((f|0)==7)d=0;return d|0}function Uh(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=c[47140]|0;a:do if((d|0)!=0|(c[47161]|0)!=0){d=aP(b,d,0)|0;if(d|0){switch(a[d>>0]|0){case 0:break a;case 111:{if(!(s2(d,86069)|0)){ci(b,1);break a}break}case 105:{if(!(s2(d,98735)|0)){ci(b,0);break a}break}default:{}}c[e>>2]=d;gA(1,86073,e)|0;break}d=OD(b)|0;while(1){if(!d)break;if(!(Pj(d)|0))Uh(d);d=PD(d)|0;}if(c[47161]|0)di(b);}while(0);l=f;return}function Vh(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;e=c[k>>2]|0;j=b[e+236>>1]|0;while(1){if((j|0)>(b[e+238>>1]|0))break;else {f=0;i=0;}while(1){g=c[e+196>>2]|0;h=c[g+(j<<6)>>2]|0;if((i|0)>=(h|0))break;g=c[(c[(c[g+(j<<6)+4>>2]|0)+(i<<2)>>2]|0)+16>>2]|0;a[g+158>>0]=0;a[g+157>>0]=0;c[g+284>>2]=i;if((f|0)==0&(c[g+192>>2]|0)>0){f=ai(h,h)|0;e=c[k>>2]|0;c[(c[e+196>>2]|0)+(j<<6)+56>>2]=f;f=1;}i=i+1|0;}a:do if(f){i=0;f=h;while(1){if((i|0)>=(f|0))break a;h=c[(c[g+(j<<6)+4>>2]|0)+(i<<2)>>2]|0;if(!(a[(c[h+16>>2]|0)+157>>0]|0)){bi(d,h);e=c[k>>2]|0;f=c[e+196>>2]|0;g=f;f=c[f+(j<<6)>>2]|0;}i=i+1|0;}}while(0);j=j+1|0;}return}function Wh(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=d+16|0;e=c[s>>2]|0;if(a[e+240>>0]|0){h=0;r=b[e+236>>1]|0;q=0;i=0;a:while(1){if((r|0)>(b[e+238>>1]|0))break;f=c[e+196>>2]|0;g=c[f+(r<<6)>>2]|0;if(!g){g=q;f=i;}else {f=c[f+(r<<6)+4>>2]|0;o=c[(c[(c[f>>2]|0)+16>>2]|0)+236>>2]|0;e=0;while(1){if((e|0)>=(g|0))break;a[(c[(c[f+(e<<2)>>2]|0)+16>>2]|0)+157>>0]=0;e=e+1|0;}e=(e<<2)+4|0;if(!h)p=KK(e)|0;else p=MK(i,e)|0;m=0;n=0;while(1){e=c[s>>2]|0;f=c[e+196>>2]|0;g=c[f+(r<<6)>>2]|0;if((g|0)<=(n|0))break;j=c[(c[f+(r<<6)+4>>2]|0)+(((c[e+116>>2]&1|0)==0?g+~n|0:n)<<2)>>2]|0;l=j+16|0;e=0;k=0;while(1){i=c[l>>2]|0;if((e|0)>=(c[i+200>>2]|0)){f=0;g=0;e=i;break}i=k+((Yh(d,c[(c[i+196>>2]|0)+(e<<2)>>2]|0)|0)!=0&1)|0;e=e+1|0;k=i;}while(1){if((g|0)>=(c[e+192>>2]|0))break;i=f+((Yh(d,c[(c[e+188>>2]|0)+(g<<2)>>2]|0)|0)!=0&1)|0;f=i;g=g+1|0;e=c[l>>2]|0;}if(f|k)if((k|0)==0&(a[e+157>>0]|0)==0)e=(Zh(d,j,p+(m<<2)|0,r)|0)+m|0;else e=m;else {c[p+(m<<2)>>2]=j;e=m+1|0;}m=e;n=n+1|0;}b:do if(m){c:do if(!(c[e+116>>2]&1)){f=p;e=p+(m<<2)|0;while(1){e=e+-4|0;if(f>>>0>=e>>>0){g=0;break c}n=c[f>>2]|0;c[f>>2]=c[e>>2];c[e>>2]=n;f=f+4|0;}}else g=0;while(0);while(1){e=c[s>>2]|0;i=c[e+196>>2]|0;f=c[i+(r<<6)>>2]|0;if((g|0)>=(f|0)){m=0;g=i;break}n=c[p+(g<<2)>>2]|0;c[(c[i+(r<<6)+4>>2]|0)+(g<<2)>>2]=n;c[(c[n+16>>2]|0)+236>>2]=g+o;g=g+1|0;}while(1){if((m|0)>=(f|0))break b;l=(c[(c[g+(r<<6)+4>>2]|0)+(m<<2)>>2]|0)+16|0;i=c[(c[l>>2]|0)+188>>2]|0;if(i){k=0;f=i;while(1){g=c[f+(k<<2)>>2]|0;e=c[s>>2]|0;if(!g)break;j=c[g>>2]&3;i=c[(c[(c[((j|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;j=c[(c[(c[((j|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;if(!(c[e+116>>2]&1))if((i|0)<(j|0))t=36;else e=k;else if((i|0)>(j|0))t=36;else e=k;if((t|0)==36){t=0;if(Yh(d,g)|0){t=37;break a}uh(g);_h(d,g);e=k+-1|0;f=c[(c[l>>2]|0)+188>>2]|0;}k=e+1|0;}f=c[e+196>>2]|0;g=f;f=c[f+(r<<6)>>2]|0;}m=m+1|0;}}while(0);a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(r<<6)+49>>0]=0;h=p;g=p;f=p;}r=r+1|0;q=g;i=f;}if((t|0)==37)qa(85915,85781,1561,85954);if(h|0)U1(q);}return}function Xh(a){a=a|0;var d=0,e=0;e=a+16|0;a=c[e>>2]|0;a:do if(c[a+268>>2]|0){d=b[a+236>>1]|0;while(1){if((d|0)>(b[a+238>>1]|0))break a;c[(c[a+268>>2]|0)+(d<<2)>>2]=c[c[(c[a+196>>2]|0)+(d<<6)+4>>2]>>2];d=d+1|0;a=c[e>>2]|0;}}while(0);return}function Yh(a,b){a=a|0;b=b|0;if((c[(c[b+16>>2]|0)+156>>2]|0)!=0?($h(a,c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)!=0:0)a=($h(a,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)!=0&1;else a=0;return a|0}function Zh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;l=d+16|0;g=c[l>>2]|0;a[g+157>>0]=1;a:do if((c[g+192>>2]|0)>0){h=0;j=0;while(1){i=c[(c[g+188>>2]|0)+(j<<2)>>2]|0;if(!i)break a;if((Yh(b,i)|0)!=0?(k=c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0,(a[(c[k+16>>2]|0)+157>>0]|0)==0):0)h=(Zh(b,k,e+(h<<2)|0,f)|0)+h|0;j=j+1|0;g=c[l>>2]|0;}}else h=0;while(0);if((c[g+232>>2]|0)==(f|0)){c[e+(h<<2)>>2]=d;return h+1|0}else qa(85967,85781,1490,85983);return 0}function _h(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;i=c[d>>2]&3;j=c[((i|0)==2?d:d+-48|0)+40>>2]|0;f=c[(c[j+16>>2]|0)+188>>2]|0;a:do if(!f){e=d+48|0;m=15;}else {l=d+48|0;g=((i|0)==3?d:l)+40|0;e=0;while(1){h=c[f+(e<<2)>>2]|0;if(!h){e=l;m=15;break a}if((c[((c[h>>2]&3|0)==2?h:h+-48|0)+40>>2]|0)==(c[g>>2]|0))break;else e=e+1|0;}vh(d,h);e=(c[d+16>>2]|0)+172|0;if(!(c[e>>2]|0))c[e>>2]=h;e=c[h+16>>2]|0;if((a[e+112>>0]|0)==4?(k=e+116|0,(c[k>>2]|0)==0):0)c[k>>2]=d;e=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;f=c[e+204>>2]|0;if(!f)e=KK((c[e+208>>2]<<2)+8|0)|0;else e=MK(f,(c[e+208>>2]<<2)+8|0)|0;c[(c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0)+204>>2]=e;i=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;j=c[i+204>>2]|0;i=i+208|0;k=c[i>>2]|0;c[i>>2]=k+1;c[j+(k<<2)>>2]=d;d=c[(c[((c[d>>2]&3|0)==3?d:l)+40>>2]|0)+16>>2]|0;c[(c[d+204>>2]|0)+(c[d+208>>2]<<2)>>2]=0;}while(0);if((m|0)==15){m=mh(j,c[((i|0)==3?d:e)+40>>2]|0,d)|0;l=c[d+16>>2]|0;d=c[m+16>>2]|0;a[d+112>>0]=(a[l+112>>0]|0)==4?4:3;c[d+96>>2]=c[l+96>>2];th(b,m);}return}function $h(a,b){a=a|0;b=b|0;var c=0;c=Sh(a,b)|0;return Th(a,b)|0|c|0}function ai(a,b){a=a|0;b=b|0;var d=0;d=JK(12)|0;c[d>>2]=a;c[d+4>>2]=b;c[d+8>>2]=JK(O(b,a)|0)|0;return d|0}function bi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;o=d+16|0;l=c[o>>2]|0;k=c[(c[(c[b+16>>2]|0)+196>>2]|0)+(c[l+232>>2]<<6)+56>>2]|0;a[l+157>>0]=1;a[l+158>>0]=1;l=(c[(c[(gg(b)|0)+16>>2]|0)+180>>2]|0)>0;e=c[o>>2]|0;f=c[e+188>>2]|0;a:do if(f){m=k+4|0;n=k+8|0;d=0;b:while(1){j=c[f+(d<<2)>>2]|0;if(!j){p=e;break a}if(l){if((HC(b,c[((c[j>>2]&3|0)==3?j:j+48|0)+40>>2]|0)|0)!=0?(HC(b,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)|0)!=0:0)q=7;}else q=7;do if((q|0)==7){q=0;h=j+16|0;if(c[(c[h>>2]|0)+156>>2]|0){e=c[j>>2]&3;g=j+-48|0;r=c[(c[((e|0)==2?j:g)+40>>2]|0)+16>>2]|0;i=c[r+284>>2]|0;f=(i|0)<(c[k>>2]|0);if((a[r+158>>0]|0)==1){if(!f){q=10;break b}e=c[(c[(c[((e|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+284>>2]|0;f=c[m>>2]|0;if((e|0)>=(f|0)){q=12;break b}a[(c[n>>2]|0)+((O(f,i)|0)+e)>>0]=1;uh(j);d=d+-1|0;if((a[(c[h>>2]|0)+112>>0]|0)==4)break;_h(b,j);break}else {if(!f){q=16;break b}e=c[(c[(c[((e|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+284>>2]|0;f=c[m>>2]|0;if((e|0)>=(f|0)){q=18;break b}a[(c[n>>2]|0)+((O(f,e)|0)+i)>>0]=1;e=c[((c[j>>2]&3|0)==2?j:g)+40>>2]|0;if(a[(c[e+16>>2]|0)+157>>0]|0)break;bi(b,e);break}}}while(0);f=c[o>>2]|0;d=d+1|0;e=f;f=c[f+188>>2]|0;}if((q|0)==10)qa(85993,85781,1251,86025);else if((q|0)==12)qa(86037,85781,1252,86025);else if((q|0)==16)qa(85993,85781,1260,86025);else if((q|0)==18)qa(86037,85781,1261,86025);}else p=e;while(0);a[p+158>>0]=0;return}function ci(a,b){a=a|0;b=b|0;var c=0;c=jC(a)|0;while(1){if(!c)break;ei(a,c,b);c=kC(a,c)|0;}return}function di(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g;d=jC(b)|0;while(1){if(!d)break;e=aP(d,c[47161]|0,0)|0;a:do if(e|0){switch(a[e>>0]|0){case 0:break a;case 111:{if(!(s2(e,86069)|0)){ei(b,d,1);break a}break}case 105:{if(!(s2(e,98735)|0)){ei(b,d,0);break a}break}default:{}}h=KB(d)|0;c[f>>2]=e;c[f+4>>2]=h;gA(1,86104,f)|0;}while(0);d=kC(b,d)|0;}l=g;return}function ei(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=c[46740]|0;h=d+16|0;f=c[h>>2]|0;a:do if(!(c[f+212>>2]|0)){i=(e|0)!=0;b:do if(i){g=0;d=0;e=f;while(1){f=c[(c[e+180>>2]|0)+(g<<2)>>2]|0;if(!f)break b;if(!(fi(f)|0)){c[j+(d<<2)>>2]=f;d=d+1|0;e=c[h>>2]|0;}g=g+1|0;}}else {g=0;d=0;e=f;while(1){f=c[(c[e+172>>2]|0)+(g<<2)>>2]|0;if(!f)break b;if(!(fi(f)|0)){c[j+(d<<2)>>2]=f;d=d+1|0;e=c[h>>2]|0;}g=g+1|0;}}while(0);if((d|0)>=2){c[j+(d<<2)>>2]=0;o4(j,d,4,61);h=i?2:3;g=i?-1:1;f=1;while(1){d=c[j+(f<<2)>>2]|0;if(!d)break a;e=c[j+(f+-1<<2)>>2]|0;e=c[((c[e>>2]&3|0)==(h|0)?e:e+(g*48|0)|0)+40>>2]|0;d=c[((c[d>>2]&3|0)==(h|0)?d:d+(g*48|0)|0)+40>>2]|0;if(fh(e,d)|0)break a;i=mh(e,d,0)|0;a[(c[i+16>>2]|0)+112>>0]=4;th(b,i);f=f+1|0;}}}while(0);return}function fi(a){a=a|0;var b=0;while(1){b=c[(c[a+16>>2]|0)+116>>2]|0;if(!b)break;else a=b;}b=c[a>>2]&3;return (c[(c[(c[((b|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)!=(c[(c[(c[((b|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0)|0}function gi(a,b){a=a|0;b=b|0;return ((c[c[a>>2]>>2]|0)>>>4)-((c[c[b>>2]>>2]|0)>>>4)|0}function hi(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;f=c[a+16>>2]|0;g=f+220|0;h=c[g>>2]|0;if((h|0)>=2){i=f+216|0;a=0;e=0;while(1){if((e|0)>=(h|0))break;d=c[(c[i>>2]|0)+(e<<2)>>2]|0;if(a|0)c[(c[a+16>>2]|0)+164>>2]=d;j=c[d+16>>2]|0;c[j+168>>2]=a;a=d;d=j;while(1){d=c[d+164>>2]|0;if(!d)break;a=d;d=c[d+16>>2]|0;}e=e+1|0;}c[g>>2]=1;c[f+192>>2]=c[c[f+216>>2]>>2];b[f+236>>1]=c[46742];b[f+238>>1]=c[46743];}return}function ii(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;i=c[46741]|0;j=i+16|0;f=c[j>>2]|0;g=0;h=b[f+236>>1]|0;while(1){if((h|0)>=(b[f+238>>1]|0))break;d=c[f+196>>2]|0;if(!(a[d+(h<<6)+49>>0]|0)){e=Bi(i,h)|0;d=c[j>>2]|0;f=c[d+196>>2]|0;c[f+(h<<6)+52>>2]=e;a[f+(h<<6)+49>>0]=1;}else {e=c[d+(h<<6)+52>>2]|0;d=f;}g=e+g|0;h=h+1|0;f=d;}return g|0}function ji(a){a=a|0;var d=0,e=0,f=0,g=0,i=0,j=0;a=c[a+16>>2]|0;g=b[a+238>>1]|0;i=a+196|0;a=b[a+236>>1]|0;while(1){if((a|0)>(g|0))break;f=c[i>>2]|0;e=c[f+(a<<6)>>2]|0;f=f+(a<<6)+4|0;d=0;while(1){if((d|0)>=(e|0))break;j=c[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;h[j+16>>3]=+(c[j+236>>2]|0);d=d+1|0;}a=a+1|0;}return}function ki(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;m=r;n=d+16|0;o=VO(c[(c[n>>2]|0)+232>>2]|0)|0;j=c[n>>2]|0;f=j+192|0;g=f;while(1){g=c[g>>2]|0;if(!g)break;g=c[g+16>>2]|0;a[g+157>>0]=0;g=g+164|0;}h=b[j+238>>1]|0;i=j+196|0;g=b[j+236>>1]|0;while(1){if((g|0)>(h|0))break;c[(c[i>>2]|0)+(g<<6)>>2]=0;g=g+1|0;}i=(e|0)==0;while(1){g=c[f>>2]|0;if(!g)break;h=g+16|0;f=c[h>>2]|0;if((c[c[(i?f+172|0:f+180|0)>>2]>>2]|0)==0?(k=f+157|0,(a[k>>0]|0)==0):0){a[k>>0]=1;XO(o,g);while(1){f=YO(o)|0;if(!f)break;if((a[(c[f+16>>2]|0)+159>>0]|0)==7){il(d,f,e,o);continue}else {zi(d,f);Ai(o,f,e);continue}}f=c[h>>2]|0;}f=f+164|0;}if(YO(o)|0)gA(1,86312,m)|0;f=c[n>>2]|0;j=b[f+236>>1]|0;while(1){if((j|0)>(b[f+238>>1]|0))break;a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(j<<6)+49>>0]=0;if((c[f+116>>2]&1|0)!=0?(p=c[f+196>>2]|0,q=c[p+(j<<6)>>2]|0,(q|0)>0):0){g=c[p+(j<<6)+4>>2]|0;h=q+-1|0;i=(h|0)/2|0;f=0;while(1){if((f|0)>(i|0))break;ti(c[g+(f<<2)>>2]|0,c[g+(h-f<<2)>>2]|0);f=f+1|0;}f=c[n>>2]|0;}j=j+1|0;}if((gg(d)|0)==(d|0)?(ii(0)|0)>0:0)ni(d,0);WO(o);l=r;return}function li(d){d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=d+16|0;d=c[n>>2]|0;f=b[d+236>>1]|0;e=b[d+238>>1]|0;l=e<<16>>16;m=d+196|0;g=f;while(1){if((g|0)>(l|0))break;k=c[m>>2]|0;j=c[k+(g<<6)>>2]|0;k=k+(g<<6)+4|0;i=0;while(1){if((i|0)>=(j|0))break;o=c[(c[(c[k>>2]|0)+(i<<2)>>2]|0)+16>>2]|0;c[o+236>>2]=~~+h[o+16>>3];i=i+1|0;}g=g+1|0;}while(1){if((f|0)>(e<<16>>16|0))break;a[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(f<<6)+49>>0]=0;o=c[d+196>>2]|0;o4(c[o+(f<<6)+4>>2]|0,c[o+(f<<6)>>2]|0,4,62);o=c[n>>2]|0;f=f+1|0;e=b[o+238>>1]|0;d=o;}return}function mi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=((d|0)%4|0|0)<2&1;e=c[a+16>>2]|0;if(!(d&1)){d=b[e+236>>1]|0;f=1;e=b[e+238>>1]|0;d=(d<<16>>16<=(b[(c[(c[46741]|0)+16>>2]|0)+236>>1]|0)&1)+(d<<16>>16)|0;}else {d=b[e+238>>1]|0;f=-1;e=b[e+236>>1]|0;d=((d<<16>>16>=(b[(c[(c[46741]|0)+16>>2]|0)+238>>1]|0))<<31>>31)+(d<<16>>16)|0;}e=f+e|0;while(1){if((d|0)==(e|0))break;wi(a,d,g,(vi(a,d,d-f|0)|0)&255);d=d+f|0;}ni(a,g^1);return}function ni(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;g=c[k>>2]|0;i=b[g+236>>1]|0;j=b[g+238>>1]|0;h=g+196|0;f=i<<16>>16;while(1){if((f|0)>(j|0)){h=i;break}a[(c[h>>2]|0)+(f<<6)+48>>0]=1;f=f+1|0;}while(1){f=0;h=h<<16>>16;while(1){if((h|0)>(b[g+238>>1]|0))break;if(a[(c[g+196>>2]|0)+(h<<6)+48>>0]|0){f=(ui(d,h,e)|0)+f|0;g=c[k>>2]|0;}h=h+1|0;}if((f|0)<=0)break;h=b[g+236>>1]|0;}return}function oi(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=d+16|0;e=c[o>>2]|0;n=b[e+238>>1]|0;a:while(1){if((n|0)<(b[e+236>>1]|0)){e=16;break}f=c[e+196>>2]|0;a[f+(n<<6)+48>>0]=0;p=(n|0)>0;q=n+1|0;g=0;b:while(1){l=(c[f+(n<<6)>>2]|0)+-1|0;m=f+(n<<6)+4|0;k=f+(q<<6)|0;while(1){if((g|0)>=(l|0))break b;j=c[m>>2]|0;i=c[j+(g<<2)>>2]|0;g=g+1|0;j=c[j+(g<<2)>>2]|0;if((c[(c[i+16>>2]|0)+236>>2]|0)>=(c[(c[j+16>>2]|0)+236>>2]|0)){e=7;break a}if(pi(d,i,j)|0)continue;if(p){f=qi(i,j)|0;h=qi(j,i)|0;}else {f=0;h=0;}if((c[k>>2]|0)>0){f=(ri(i,j)|0)+f|0;h=(ri(j,i)|0)+h|0;}if((h|0)<=(f|0))break}si(d,n,i,j);e=c[o>>2]|0;f=c[e+196>>2]|0;}n=n+-1|0;}if((e|0)==7)qa(86263,85781,721,86289);else if((e|0)==16)return}function pi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=c[d+16>>2]|0;i=c[j+212>>2]|0;f=c[e+16>>2]|0;g=c[f+212>>2]|0;h=(i|0)!=(g|0);do if(!(a[193769]|0))if((g|0)==0|((i|0)==0|h^1))k=9;else {if((a[j+159>>0]|0)==7?(a[j+156>>0]|0)==1:0){b=0;break}if((a[f+159>>0]|0)==7?(a[f+156>>0]|0)==1:0){b=0;break}b=1;}else if(h)b=1;else k=9;while(0);if((k|0)==9){f=c[b+16>>2]|0;b=c[(c[f+196>>2]|0)+(c[j+232>>2]<<6)+56>>2]|0;if(!b)b=0;else {j=(c[f+116>>2]&1|0)==0;k=O(c[b+4>>2]|0,c[(c[(j?d:e)+16>>2]|0)+284>>2]|0)|0;b=a[(c[b+8>>2]|0)+((c[(c[(j?e:d)+16>>2]|0)+284>>2]|0)+k)>>0]|0;}}return b|0}function qi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;l=a+16|0;j=c[(c[d+16>>2]|0)+172>>2]|0;d=0;while(1){a=c[j>>2]|0;if(!a)break;i=c[a+16>>2]|0;k=b[i+154>>1]|0;g=c[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;i=i+16|0;f=c[(c[l>>2]|0)+172>>2]|0;a=d;while(1){d=c[f>>2]|0;if(!d)break;e=(c[(c[(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-g|0;if((e|0)<=0){if((e|0)==0?(m=c[d+16>>2]|0,+h[m+16>>3]>+h[i>>3]):0){d=m;n=9;}}else {d=c[d+16>>2]|0;n=9;}if((n|0)==9){n=0;a=(O(b[d+154>>1]|0,k)|0)+a|0;}f=f+4|0;}j=j+4|0;d=a;}return d|0}function ri(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;l=a+16|0;j=c[(c[d+16>>2]|0)+180>>2]|0;d=0;while(1){a=c[j>>2]|0;if(!a)break;i=c[a+16>>2]|0;k=b[i+154>>1]|0;g=c[(c[(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;i=i+56|0;f=c[(c[l>>2]|0)+180>>2]|0;a=d;while(1){d=c[f>>2]|0;if(!d)break;e=(c[(c[(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-g|0;if((e|0)<=0){if((e|0)==0?(m=c[d+16>>2]|0,+h[m+56>>3]>+h[i>>3]):0){d=m;n=9;}}else {d=c[d+16>>2]|0;n=9;}if((n|0)==9){n=0;a=(O(b[d+154>>1]|0,k)|0)+a|0;}f=f+4|0;}j=j+4|0;d=a;}return d|0}function si(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=a[(c[e+16>>2]|0)+156>>0]|0;if(i<<24>>24!=(a[(c[f+16>>2]|0)+156>>0]|0)){j=b+16|0;l=c[(c[j>>2]|0)+196>>2]|0;k=c[l+(d<<6)>>2]|0;l=l+(d<<6)+4|0;b=0;g=0;h=0;while(1){if((b|0)>=(k|0))break;o=(a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)==0;b=b+1|0;g=g+(o&1)|0;h=h+((o^1)&1)|0;}i=i<<24>>24==0;h=(g|0)<(h|0)?(i?e:f):i?f:e;i=0;b=0;while(1){if((b|0)>=(k|0))break;i=(c[(c[l>>2]|0)+(b<<2)>>2]|0)==(h|0)?b:i;b=b+1|0;}o=(a[(c[h+16>>2]|0)+156>>0]|0)==0&1;n=0;g=i;while(1){b=g+-1|0;if((g|0)<=0){m=0;b=i;break}if((a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0)){m=0;b=i;break}n=n+1|0;g=b;}while(1){b=b+1|0;if((b|0)>=(k|0))break;if((a[(c[(c[(c[l>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0))break;m=m+1|0;}ti(e,f);j=c[(c[j>>2]|0)+196>>2]|0;k=c[j+(d<<6)>>2]|0;j=j+(d<<6)+4|0;b=0;while(1){if((b|0)>=(k|0)){h=0;g=i;break}i=(c[(c[j>>2]|0)+(b<<2)>>2]|0)==(h|0)?b:i;b=b+1|0;}while(1){b=g+-1|0;if((g|0)<=0){g=0;b=i;break}if((a[(c[(c[(c[j>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0)){g=0;b=i;break}h=h+1|0;g=b;}while(1){b=b+1|0;if((b|0)>=(k|0))break;if((a[(c[(c[(c[j>>2]|0)+(b<<2)>>2]|0)+16>>2]|0)+156>>0]|0)!=(o|0))break;g=g+1|0;}d=h-g|0;o=n-m|0;if((((d|0)>-1?d:0-d|0)|0)>(((o|0)>-1?o:0-o|0)|0))ti(e,f);}return}function ti(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+16>>2]|0;e=c[f+232>>2]|0;f=f+236|0;d=c[f>>2]|0;g=b+16|0;h=c[(c[g>>2]|0)+236>>2]|0;c[f>>2]=h;f=(c[46741]|0)+16|0;c[(c[(c[(c[f>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(h<<2)>>2]=a;c[(c[g>>2]|0)+236>>2]=d;c[(c[(c[(c[f>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(d<<2)>>2]=b;return}function ui(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=d+16|0;n=c[(c[q>>2]|0)+196>>2]|0;a[n+(e<<6)+48>>0]=0;r=(e|0)>0;s=e+1|0;o=(f|0)!=0;p=e+-1|0;g=0;i=0;f=n;a:while(1){l=(c[f+(e<<6)>>2]|0)+-1|0;m=f+(e<<6)+4|0;h=f+(s<<6)|0;n=g;while(1){if((n|0)>=(l|0)){f=17;break a}k=c[m>>2]|0;j=c[k+(n<<2)>>2]|0;n=n+1|0;k=c[k+(n<<2)>>2]|0;if((c[(c[j+16>>2]|0)+236>>2]|0)>=(c[(c[k+16>>2]|0)+236>>2]|0)){f=5;break a}if(pi(d,j,k)|0)continue;if(r){f=qi(j,k)|0;g=qi(k,j)|0;}else {f=0;g=0;}if((c[h>>2]|0)>0){f=(ri(j,k)|0)+f|0;g=(ri(k,j)|0)+g|0;}if((f|0)>(g|0))break;if((f|0)==(g|0)&(o&(f|0)>0)){f=g;break}}ti(j,k);i=f-g+i|0;g=c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0;a[g+(e<<6)+49>>0]=0;h=c[q>>2]|0;f=c[h+196>>2]|0;a[f+(e<<6)+48>>0]=1;if((b[h+236>>1]|0)<(e|0)){a[g+(p<<6)+49>>0]=0;a[f+(p<<6)+48>>0]=1;}if((b[h+238>>1]|0)<=(e|0)){g=n;continue}a[g+(s<<6)+49>>0]=0;a[f+(s<<6)+48>>0]=1;g=n;}if((f|0)==5)qa(86263,85781,770,86297);else if((f|0)==17)return i|0;return 0}function vi(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=c[46739]|0;q=a+16|0;a=c[(c[q>>2]|0)+196>>2]|0;r=c[a+(e<<6)+4>>2]|0;n=(f|0)>(e|0);o=p+4|0;m=0;while(1){f=c[a+(e<<6)>>2]|0;if((m|0)>=(f|0)){a=0;j=0;break}l=(c[r+(m<<2)>>2]|0)+16|0;a=c[l>>2]|0;a:do if(n){k=c[a+180>>2]|0;a=0;j=0;while(1){f=c[k+(j<<2)>>2]|0;if(!f)break a;g=c[f+16>>2]|0;if((b[g+154>>1]|0)>0){c[p+(a<<2)>>2]=c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]<<8|d[g+88>>0];a=a+1|0;}j=j+1|0;}}else {k=c[a+172>>2]|0;j=0;a=0;while(1){f=c[k+(j<<2)>>2]|0;if(!f)break a;g=c[f+16>>2]|0;if((b[g+154>>1]|0)>0){c[p+(a<<2)>>2]=c[(c[(c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+236>>2]<<8|d[g+48>>0];a=a+1|0;}j=j+1|0;}}while(0);b:do switch(a|0){case 0:{i=-1.0;break}case 1:{i=+(c[p>>2]|0);break}case 2:{i=+(((c[o>>2]|0)+(c[p>>2]|0)|0)/2|0|0);break}default:{o4(p,a,4,60);f=(a|0)/2|0;if(a&1|0){i=+(c[p+(f<<2)>>2]|0);break b}j=c[p+(f<<2)>>2]|0;g=(c[p+(a+-1<<2)>>2]|0)-j|0;a=c[p+(f+-1<<2)>>2]|0;f=a-(c[p>>2]|0)|0;if((f|0)==(g|0)){i=+((a+j|0)/2|0|0);break b}else {i=+(((O(f,j)|0)+(O(a,g)|0)|0)/(f+g|0)|0|0);break b}}}while(0);h[(c[l>>2]|0)+240>>3]=i;m=m+1|0;a=c[(c[q>>2]|0)+196>>2]|0;}while(1){if((j|0)>=(f|0))break;g=c[r+(j<<2)>>2]|0;p=c[g+16>>2]|0;if((c[p+184>>2]|0)==0?(c[p+176>>2]|0)==0:0){a=(xi(g)|0|a&255)&255;f=c[(c[(c[q>>2]|0)+196>>2]|0)+(e<<6)>>2]|0;}j=j+1|0;}return a|0}function wi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0;o=c[(c[b+16>>2]|0)+196>>2]|0;s=c[o+(d<<6)+4>>2]|0;o=c[o+(d<<6)>>2]|0;q=(e|0)!=0;p=(f|e|0)==0;f=0;e=o;o=s+(o<<2)|0;while(1){n=e+-1|0;if((e|0)>0)e=s;else break;a:while(1){b:while(1){if(e>>>0>=o>>>0)break a;while(1){if(e>>>0>=o>>>0)break a;l=c[e>>2]|0;m=+h[(c[l+16>>2]|0)+240>>3];if(!(m<0.0))break;e=e+4|0;}k=0;while(1){g=k<<24>>24==0;while(1){e=e+4|0;if(e>>>0>=o>>>0)break a;if(g){g=11;break}i=c[e>>2]|0;if(!(c[(c[i+16>>2]|0)+212>>2]|0)){g=13;break}}if((g|0)==11){i=c[e>>2]|0;j=i;}else if((g|0)==13)j=i;if(pi(b,l,j)|0)continue b;g=c[i+16>>2]|0;if(+h[g+240>>3]>=0.0)break;k=(c[g+212>>2]|0)==0?k:1;}g=~~m;k=~~+h[(c[i+16>>2]|0)+240>>3];if((g|0)>(k|0)|q&(g|0)==(k|0))break}ti(l,j);f=f+1|0;}e=n;o=p?o+-4|0:o;}if(f|0?(r=c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0,a[r+(d<<6)+49>>0]=0,(d|0)>0):0)a[r+(d+-1<<6)+49>>0]=0;return}function xi(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0;g=c[a+16>>2]|0;if((c[g+200>>2]|0)>0){f=c[g+196>>2]|0;a=c[f>>2]|0;a=c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0;d=1;while(1){e=c[f+(d<<2)>>2]|0;if(!e)break;e=c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0;a=(c[(c[e+16>>2]|0)+236>>2]|0)>(c[(c[a+16>>2]|0)+236>>2]|0)?e:a;d=d+1|0;}b=+h[(c[a+16>>2]|0)+240>>3];if(!(b>=0.0))a=1;else {h[g+240>>3]=b+1.0;a=0;}}else if((c[g+192>>2]|0)>0){e=c[g+188>>2]|0;d=c[e>>2]|0;a=1;d=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;while(1){f=c[e+(a<<2)>>2]|0;if(!f)break;f=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;a=a+1|0;d=(c[(c[f+16>>2]|0)+236>>2]|0)<(c[(c[d+16>>2]|0)+236>>2]|0)?f:d;}b=+h[(c[d+16>>2]|0)+240>>3];if(b>0.0){h[g+240>>3]=b+-1.0;a=0;}else a=1;}else a=1;return a|0}function yi(a,b){a=a|0;b=b|0;return (c[(c[(c[a>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[b>>2]|0)+16>>2]|0)+236>>2]|0)|0}function zi(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+96|0;o=p+64|0;n=p+48|0;h=p+24|0;f=p;j=d+16|0;k=c[(c[j>>2]|0)+232>>2]|0;m=a+16|0;e=c[(c[m>>2]|0)+196>>2]|0;i=c[e+(k<<6)>>2]|0;do if((c[e+(k<<6)+8>>2]|0)>=1){c[(c[e+(k<<6)+4>>2]|0)+(i<<2)>>2]=d;c[(c[j>>2]|0)+236>>2]=i;a=c[m>>2]|0;f=c[a+196>>2]|0;e=f+(k<<6)|0;g=c[e>>2]|0;c[e>>2]=g+1;if((g|0)>=(c[f+(k<<6)+8>>2]|0))qa(86377,85781,1346,86413);g=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]|0;if((i|0)>(g|0)){m=KB(d)|0;n=c[(c[j>>2]|0)+236>>2]|0;o=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]|0;c[h>>2]=1359;c[h+4>>2]=m;c[h+8>>2]=n;c[h+12>>2]=k;c[h+16>>2]=o;gA(1,86429,h)|0;break}e=b[a+236>>1]|0;a=b[a+238>>1]|0;if((k|0)<(e|0)|(k|0)>(a<<16>>16|0)){c[n>>2]=1364;c[n+4>>2]=k;c[n+8>>2]=e;c[n+12>>2]=a<<16>>16;gA(1,86502,n)|0;break}if(((c[f+(k<<6)+4>>2]|0)+(i<<2)|0)>>>0>((c[f+(k<<6)+12>>2]|0)+(g<<2)|0)>>>0){i=KB(d)|0;n=c[(c[m>>2]|0)+196>>2]|0;m=(c[n+(k<<6)+4>>2]|0)+(c[(c[j>>2]|0)+236>>2]<<2)|0;n=(c[n+(k<<6)+12>>2]|0)+(c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(k<<6)+8>>2]<<2)|0;c[o>>2]=1370;c[o+4>>2]=k;c[o+8>>2]=i;c[o+12>>2]=m;c[o+16>>2]=k;c[o+20>>2]=k;c[o+24>>2]=n;gA(1,86563,o)|0;}}else {n=KB(a)|0;o=KB(d)|0;c[f>>2]=1339;c[f+4>>2]=n;c[f+8>>2]=o;c[f+12>>2]=k;c[f+16>>2]=i;gA(1,86322,f)|0;}while(0);l=p;return}function Ai(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=d+16|0;a:do if(!e){g=0;while(1){d=c[h>>2]|0;if((g|0)>=(c[d+184>>2]|0))break a;d=c[(c[d+180>>2]|0)+(g<<2)>>2]|0;e=d+-48|0;f=(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;XO(b,c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0);}g=g+1|0;}}else {g=0;while(1){d=c[h>>2]|0;if((g|0)>=(c[d+176>>2]|0))break a;d=c[(c[d+172>>2]|0)+(g<<2)>>2]|0;e=d+48|0;f=(c[(c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0)+16>>2]|0)+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;XO(b,c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0);}g=g+1|0;}}while(0);return}function Bi(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;u=v;g=d+16|0;f=c[(c[g>>2]|0)+196>>2]|0;s=c[f+(e<<6)+4>>2]|0;t=e+1|0;d=c[(c[(c[(c[46741]|0)+16>>2]|0)+196>>2]|0)+(t<<6)>>2]|0;if((c[46745]|0)>(d|0))q=c[46746]|0;else {d=d+1|0;c[46745]=d;f=c[46746]|0;if(!f)d=KK(d<<2)|0;else d=MK(f,d<<2)|0;c[46746]=d;f=c[(c[g>>2]|0)+196>>2]|0;q=d;}r=f+(t<<6)|0;d=0;while(1){if((d|0)>=(c[r>>2]|0))break;c[q+(d<<2)>>2]=0;d=d+1|0;}p=f+(e<<6)|0;o=0;h=0;d=0;j=q;while(1){k=c[p>>2]|0;if((o|0)>=(k|0))break;n=c[(c[(c[s+(o<<2)>>2]|0)+16>>2]|0)+180>>2]|0;a:do if((h|0)>0){m=0;while(1){g=c[n+(m<<2)>>2]|0;if(!g)break a;k=g+16|0;i=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;while(1){g=i+1|0;if((i|0)>=(h|0))break;i=g;d=(O(c[j+(g<<2)>>2]|0,b[(c[k>>2]|0)+154>>1]|0)|0)+d|0;}m=m+1|0;}}while(0);i=0;while(1){g=c[n+(i<<2)>>2]|0;if(!g)break;j=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;m=q+(j<<2)|0;c[m>>2]=(c[m>>2]|0)+(b[(c[g+16>>2]|0)+154>>1]|0);h=(j|0)>(h|0)?j:h;i=i+1|0;j=q;}o=o+1|0;}i=f+(e<<6)+4|0;h=0;while(1){if((h|0)>=(k|0))break;g=c[(c[(c[i>>2]|0)+(h<<2)>>2]|0)+16>>2]|0;if(a[g+145>>0]|0){e=g+180|0;c[u>>2]=c[e>>2];c[u+4>>2]=c[e+4>>2];d=(Ci(u,1)|0)+d|0;}h=h+1|0;}i=c[r>>2]|0;h=f+(t<<6)+4|0;g=0;while(1){if((g|0)>=(i|0))break;f=c[(c[(c[h>>2]|0)+(g<<2)>>2]|0)+16>>2]|0;if(a[f+145>>0]|0){t=f+172|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];d=(Ci(u,-1)|0)+d|0;}g=g+1|0;}l=v;return d|0}function Ci(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;n=(d|0)<1;l=c[a>>2]|0;d=0;a=0;a:while(1){m=c[l+(d<<2)>>2]|0;if(!m)break;d=d+1|0;if(n){j=m+48|0;k=m+16|0;i=d;while(1){e=c[l+(i<<2)>>2]|0;if(!e)continue a;f=c[e+16>>2]|0;g=c[k>>2]|0;if((+h[f+56>>3]-+h[g+56>>3])*+((c[(c[(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[((c[m>>2]&3|0)==3?m:j)+40>>2]|0)+16>>2]|0)+236>>2]|0)|0)<0.0)a=(O(b[f+154>>1]|0,b[g+154>>1]|0)|0)+a|0;i=i+1|0;}}else {j=m+-48|0;k=m+16|0;i=d;while(1){e=c[l+(i<<2)>>2]|0;if(!e)continue a;f=c[e+16>>2]|0;g=c[k>>2]|0;if((+h[f+16>>3]-+h[g+16>>3])*+((c[(c[(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)-(c[(c[(c[((c[m>>2]&3|0)==2?m:j)+40>>2]|0)+16>>2]|0)+236>>2]|0)|0)<0.0)a=(O(b[f+154>>1]|0,b[g+154>>1]|0)|0)+a|0;i=i+1|0;}}}return a|0}function Di(a){a=a|0;var b=0.0,d=0.0;c[46744]=8;c[47136]=24;h[23215]=.995;a=QA(a,86685)|0;if(a|0?(b=+r5(a),b>0.0):0){d=b*+(c[46744]|0);c[46744]=~~(d>1.0?d:1.0);b=b*+(c[47136]|0);c[47136]=~~(b>1.0?b:1.0);}return}function Ei(a){a=a|0;var d=0,e=0;e=(b[(c[a+16>>2]|0)+238>>1]|0)+2|0;d=JK(e<<2)|0;Gi(a,d,e,0)|0;U1(d);return}function Fi(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=a+16|0;i=JK((b[(c[h>>2]|0)+238>>1]<<2)+8|0)|0;g=jC(a)|0;while(1){if(!g)break;f=i+(c[(c[g+16>>2]|0)+232>>2]<<2)|0;c[f>>2]=(c[f>>2]|0)+1;f=XA(a,g)|0;while(1){if(!f)break;j=c[f>>2]&3;d=c[(c[(c[((j|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;j=c[(c[(c[((j|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;k=(d|0)>(j|0);e=k?d:j;d=k?j:d;while(1){d=d+1|0;if((d|0)>=(e|0))break;k=i+(d<<2)|0;c[k>>2]=(c[k>>2]|0)+1;}f=ZA(a,f)|0;}g=kC(a,g)|0;}f=JK((b[(c[h>>2]|0)+238>>1]<<6)+128|0)|0;e=c[h>>2]|0;c[e+196>>2]=f;d=b[e+236>>1]|0;while(1){if((d|0)>(b[e+238>>1]|0))break;j=i+(d<<2)|0;e=c[j>>2]|0;c[f+(d<<6)>>2]=e;c[f+(d<<6)+8>>2]=e;j=JK((c[j>>2]<<2)+4|0)|0;e=c[h>>2]|0;k=c[e+196>>2]|0;c[k+(d<<6)+4>>2]=j;c[k+(d<<6)+12>>2]=j;d=d+1|0;f=k;}U1(i);return}function Gi(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0;m=a+16|0;i=1;while(1){g=c[m>>2]|0;if((i|0)>(c[g+180>>2]|0))break;l=Gi(c[(c[g+184>>2]|0)+(i<<2)>>2]|0,d,e,f)|0;i=i+1|0;f=l;}a:do if((gg(a)|0)!=(a|0)){Y6(d|0,0,e<<2|0)|0;g=jC(a)|0;while(1){if(!g)break;k=g+16|0;c[d+(c[(c[k>>2]|0)+232>>2]<<2)>>2]=1;i=XA(a,g)|0;while(1){if(!i)break;l=i+-48|0;j=c[(c[k>>2]|0)+232>>2]|0;while(1){e=j+1|0;if((j|0)>=(c[(c[(c[((c[i>>2]&3|0)==2?i:l)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;c[d+(e<<2)>>2]=1;j=e;}i=ZA(a,i)|0;}g=kC(a,g)|0;}g=c[m>>2]|0;i=b[g+236>>1]|0;while(1){if((i|0)>(b[g+238>>1]|0))break a;if(!(c[d+(i<<2)>>2]|0)){if(!f)f=ND(gg(a)|0,86675,1)|0;g=tC(f,0,1)|0;TC(g,137447,304,1)|0;l=g+16|0;j=c[l>>2]|0;c[j+232>>2]=i;h[j+96>>3]=.5;h[j+88>>3]=.5;h[j+80>>3]=1.0;c[j+216>>2]=1;c[j+176>>2]=0;j=JK(20)|0;k=c[l>>2]|0;c[k+172>>2]=j;c[k+184>>2]=0;k=JK(20)|0;c[(c[l>>2]|0)+180>>2]=k;oC(a,g,1)|0;g=c[m>>2]|0;}i=i+1|0;}}while(0);return f|0}function Hi(a){a=a|0;var b=0,d=0;Xh(a);b=a+16|0;a=1;while(1){d=c[b>>2]|0;if((a|0)>(c[d+180>>2]|0))break;Hi(c[(c[d+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}return}function Ii(a){a=a|0;var b=0,d=0;b=c[a>>2]&3;d=Ji(c[((b|0)==3?a:a+48|0)+40>>2]|0)|0;b=c[17308+(d*12|0)+((Ji(c[((b|0)==2?a:a+-48|0)+40>>2]|0)|0)<<2)>>2]|0;a=(c[a+16>>2]|0)+156|0;c[a>>2]=O(c[a>>2]|0,b)|0;return}function Ji(b){b=b|0;b=c[b+16>>2]|0;if((a[b+156>>0]|0)==1)b=2;else b=(a[b+160>>0]|0)<2&1;return b|0}function Ki(b,d){b=b|0;d=d|0;if(c[(c[b+16>>2]|0)+192>>2]|0){jl(b);Li(b);if(a[194954]|0)xl(b);Mi(b);if(Pl(b)|0)Li(b);Ni(b);if(uL(b,2,Oi(b)|0)|0?(Pi(b),uL(b,2,Oi(b)|0)|0):0)qa(86693,86721,134,86732);Qi(b);Ri(b,d);Si(b);}return}function Li(d){d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0;v=d+16|0;e=c[v>>2]|0;w=c[e+196>>2]|0;t=b[e+236>>1]|0;while(1){if((t|0)>(b[e+238>>1]|0))break;n=w+(t<<6)|0;o=w+(t<<6)+4|0;p=w+(t<<6)+40|0;q=w+(t<<6)+24|0;r=w+(t<<6)+32|0;s=w+(t<<6)+16|0;m=0;while(1){if((m|0)>=(c[n>>2]|0))break;l=(c[(c[o>>2]|0)+(m<<2)>>2]|0)+16|0;e=c[l>>2]|0;j=+h[e+80>>3]*.5;i=c[e+204>>2]|0;a:do if(i){g=0;while(1){f=c[i+(g<<2)>>2]|0;if(!f)break a;x=c[f>>2]&3;if((c[((x|0)==3?f:f+48|0)+40>>2]|0)==(c[((x|0)==2?f:f+-48|0)+40>>2]|0)?(u=c[(c[f+16>>2]|0)+96>>2]|0,(u|0)!=0):0){k=+h[u+32>>3]*.5;j=j>k?j:k;}g=g+1|0;}}while(0);if(+h[p>>3]>3]=j;h[p>>3]=j;}if(+h[r>>3]>3]=j;h[r>>3]=j;}f=c[e+212>>2]|0;if(f|0){if((f|0)==(d|0))g=0;else {g=ZO(f,c[47144]|0,8,0)|0;e=c[l>>2]|0;}i=c[e+232>>2]|0;f=c[f+16>>2]|0;e=f+128|0;j=j+ +(g|0);if((i|0)==(b[f+236>>1]|0)){k=+h[e>>3];h[e>>3]=k>j?k:j;}e=f+120|0;if((i|0)==(b[f+238>>1]|0)){k=+h[e>>3];h[e>>3]=k>j?k:j;}}m=m+1|0;}t=t+1|0;e=c[v>>2]|0;}m=rj(d)|0;g=c[v>>2]|0;e=b[g+238>>1]|0;h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[w+(e<<6)+16>>3];f=b[g+236>>1]|0;i=g+252|0;k=0.0;while(1){l=e+-1|0;if((e|0)<=(f|0))break;y=+h[w+(l<<6)+32>>3]+ +h[w+(e<<6)+40>>3]+ +(c[i>>2]|0);j=+h[w+(e<<6)+24>>3]+8.0+ +h[w+(l<<6)+16>>3];j=y>j?y:j;if((c[w+(l<<6)>>2]|0)>0)h[(c[(c[c[w+(l<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+j;k=k>j?k:j;e=l;}b:do if((m|0)!=0?(c[g+116>>2]&1|0)!=0:0){sj(d,0);g=c[v>>2]|0;if(a[g+276>>0]|0){e=b[g+238>>1]|0;f=b[g+236>>1]|0;j=+h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];k=0.0;while(1){i=e+-1|0;if((e|0)<=(f|0))break b;z=+h[(c[(c[c[w+(i<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];y=z-j;j=z;k=k>y?k:y;e=i;}}}while(0);c:do if(a[g+276>>0]|0){i=b[g+236>>1]|0;f=b[g+238>>1]|0;while(1){e=f+-1|0;if((f|0)<=(i|0))break c;if((c[w+(e<<6)>>2]|0)<=0){f=e;continue}h[(c[(c[c[w+(e<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]=+h[(c[(c[c[w+(f<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+k;f=e;}}while(0);e=g+192|0;while(1){e=c[e>>2]|0;if(!e)break;e=c[e+16>>2]|0;h[e+24>>3]=+h[(c[(c[c[w+(c[e+232>>2]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];e=e+164|0;}return}function Mi(a){a=a|0;var b=0,d=0,e=0;nj(a);b=(c[a+16>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;e=b+16|0;b=c[e>>2]|0;d=c[b+224>>2]|0;if(d){oj(a,d);b=c[e>>2]|0;}d=c[b+228>>2]|0;if(!d)d=b;else {oj(a,d);d=c[e>>2]|0;}e=c[d+204>>2]|0;if(e|0){b=0;while(1)if(!(c[e+(b<<2)>>2]|0))break;else b=b+1|0;}b=d+164|0;}return}function Ni(a){a=a|0;$i(a);aj(a);bj(a);cj(a);dj(a);return}function Oi(a){a=a|0;var b=0,c=0.0;b=QA(a,86921)|0;if(!b)a=2147483647;else {c=+r5(b);a=~~(c*+(tB(a)|0));}return a|0}function Pi(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;r=d+16|0;e=c[r>>2]|0;q=b[e+236>>1]|0;while(1){p=b[e+238>>1]|0;if((q|0)>(p|0)){s=19;break}n=c[e+196>>2]|0;o=n+(q<<6)|0;m=c[o>>2]|0;n=n+(q<<6)+4|0;l=0;f=0;a:while(1){if((l|0)>=(m|0)){s=14;break}f=c[(c[n>>2]|0)+(l<<2)>>2]|0;h=c[f+16>>2]|0;i=c[h+256>>2]|0;b:do if(i|0){g=0;while(1){j=c[i+(g<<2)>>2]|0;if(!j)break b;k=c[j>>2]&3;if((c[(c[(c[((k|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;if((c[(c[(c[((k|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;else g=g+1|0;}}while(0);h=c[h+248>>2]|0;c:do if(h|0){g=0;while(1){i=c[h+(g<<2)>>2]|0;if(!i)break c;j=c[i>>2]&3;if((c[(c[(c[((j|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;if((c[(c[(c[((j|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(q|0))break a;else g=g+1|0;}}while(0);l=l+1|0;}if((s|0)==14){s=0;if(f){f=c[c[n>>2]>>2]|0;e=c[c[o+(((q|0)<(p|0)?1:-1)<<6)+4>>2]>>2]|0;if(!e){s=16;break}o=sh(d)|0;p=o+16|0;a[(c[p>>2]|0)+156>>0]=2;Zi(o,f,0.0,0)|0;Zi(o,e,0.0,0)|0;c[(c[p>>2]|0)+232>>2]=c[(c[((c[(c[f+16>>2]|0)+232>>2]|0)<(c[(c[e+16>>2]|0)+232>>2]|0)?f:e)+16>>2]|0)+232>>2];e=c[r>>2]|0;}}q=q+1|0;}if((s|0)==16)qa(86829,86721,111,86832);else if((s|0)==19)return}function Qi(a){a=a|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0;a=c[a+16>>2]|0;i=c[a+196>>2]|0;e=b[a+238>>1]|0;a=b[a+236>>1]|0;while(1){if((a|0)>(e|0))break;f=c[i+(a<<6)>>2]|0;g=i+(a<<6)+4|0;d=0;while(1){if((d|0)>=(f|0))break;k=c[(c[(c[g>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;j=k+232|0;h[k+16>>3]=+(c[j>>2]|0);c[j>>2]=a;d=d+1|0;}a=a+1|0;}return}function Ri(a,d){a=a|0;d=d|0;var e=0,f=0.0,g=0,i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0;Ti(a,a);g=a+16|0;k=c[g>>2]|0;a:do if((b[k+238>>1]|0)>0?(j=c[k+8>>2]|0,e=c[j+84>>2]|0,e|0):0){o=~~(+h[k+32>>3]-+h[k+16>>3]);m=~~(+h[k+40>>3]-+h[k+24>>3]);p=(c[k+116>>2]&1|0)==0;n=p?m:o;m=p?o:m;if((e|0)==4){e=Ui(a)|0;k=c[g>>2]|0;j=c[k+8>>2]|0;}else e=(e|0)==2&1;b:do if(!(e<<24>>24)){switch(c[j+84>>2]|0){case 5:{f=+h[j+64>>3];if(f<=0.0)break a;i=f/+h[k+32>>3];l=+h[j+72>>3]/+h[k+40>>3];f=i1.0&l>1.0){l=f;break b}else break a}case 1:break;default:break a}i=+h[j+16>>3];f=+(n|0)/+(m|0);if(f>3];if(f<=0.0)break a;i=f/+(m|0);f=+h[j+72>>3]/+(n|0);if(i<1.0|f<1.0)if(i>2]&1|0)==0;i=e?f:l;f=e?l:f;e=k+192|0;while(1){e=c[e>>2]|0;if(!e)break;e=c[e+16>>2]|0;p=e+16|0;l=+h[p>>3]*f;h[p>>3]=+(~~(l+(l>=0.0?.5:-.5))|0);p=e+24|0;l=+h[p>>3]*i;h[p>>3]=+(~~(l+(l>=0.0?.5:-.5))|0);e=e+164|0;}Vi(a,f,i);}while(0);if(d|0)Wi(a,d);return}function Si(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=b+16|0;b=(c[h>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;g=b+16|0;d=0;while(1){b=c[g>>2]|0;f=c[b+180>>2]|0;e=c[f+(d<<2)>>2]|0;if(!e)break;U1(c[e+16>>2]|0);U1(e);d=d+1|0;}if(f){U1(f);b=c[g>>2]|0;}d=c[b+172>>2]|0;if(d){U1(d);b=c[g>>2]|0;}f=b+256|0;e=c[f+4>>2]|0;b=b+180|0;c[b>>2]=c[f>>2];c[b+4>>2]=e;b=c[g>>2]|0;e=b+248|0;f=c[e+4>>2]|0;b=b+172|0;c[b>>2]=c[e>>2];c[b+4>>2]=f;b=(c[g>>2]|0)+164|0;}b=0;d=c[(c[h>>2]|0)+192>>2]|0;a:while(1){g=(b|0)==0;f=b+16|0;b=d;while(1){if(!b)break a;e=c[b+16>>2]|0;d=c[e+164>>2]|0;if((a[e+156>>0]|0)!=2)continue a;if(g)c[(c[h>>2]|0)+192>>2]=d;else c[(c[f>>2]|0)+164>>2]=d;U1(e);U1(b);b=d;}}c[(c[(c[(c[h>>2]|0)+192>>2]|0)+16>>2]|0)+168>>2]=0;return}function Ti(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=a+16|0;d=1;while(1){f=c[e>>2]|0;if((d|0)>(c[f+180>>2]|0))break;Ti(c[(c[f+184>>2]|0)+(d<<2)>>2]|0,b);d=d+1|0;}Yi(a,b);return}function Ui(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0;s=l;l=l+80|0;e=s+64|0;d=s+48|0;f=s+16|0;m=s;r=s+32|0;a=a+16|0;b=c[(c[a>>2]|0)+8>>2]|0;t=b+48|0;c[f>>2]=c[t>>2];c[f+4>>2]=c[t+4>>2];c[f+8>>2]=c[t+8>>2];c[f+12>>2]=c[t+12>>2];if((!(+h[f>>3]<.001)?(g=f+8|0,!(+h[g>>3]<.001)):0)?(i=b+32|0,c[m>>2]=c[i>>2],c[m+4>>2]=c[i+4>>2],c[m+8>>2]=c[i+8>>2],c[m+12>>2]=c[i+12>>2],c[d>>2]=c[f>>2],c[d+4>>2]=c[f+4>>2],c[d+8>>2]=c[f+8>>2],c[d+12>>2]=c[f+12>>2],c[e>>2]=c[i>>2],c[e+4>>2]=c[i+4>>2],c[e+8>>2]=c[i+8>>2],c[e+12>>2]=c[i+12>>2],Xi(r,d,e),c[f>>2]=c[r>>2],c[f+4>>2]=c[r+4>>2],c[f+8>>2]=c[r+8>>2],c[f+12>>2]=c[r+12>>2],c[d>>2]=c[r>>2],c[d+4>>2]=c[r+4>>2],c[d+8>>2]=c[r+8>>2],c[d+12>>2]=c[r+12>>2],c[e>>2]=c[m>>2],c[e+4>>2]=c[m+4>>2],c[e+8>>2]=c[m+8>>2],c[e+12>>2]=c[m+12>>2],Xi(f,d,e),i=c[a>>2]|0,j=+h[i+32>>3],k=+h[i+40>>3],n=+h[f>>3],o=n/j,p=+h[g>>3],q=p/k,!(o>=1.0&q>=1.0)):0){o=o.5?o:.5;q=+N(+(o*k/p))*p/k;p=+N(+(o*j/n))*n/j*j;a=c[i+8>>2]|0;h[a+64>>3]=p;h[a+72>>3]=q*k;a=1;}else a=0;l=s;return a|0}function Vi(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;e=a+16|0;a=1;while(1){f=c[e>>2]|0;if((a|0)>(c[f+180>>2]|0))break;Vi(c[(c[f+184>>2]|0)+(a<<2)>>2]|0,b,d);a=a+1|0;}e=f+16|0;h[e>>3]=+h[e>>3]*b;e=f+24|0;h[e>>3]=+h[e>>3]*d;e=f+32|0;h[e>>3]=+h[e>>3]*b;f=f+40|0;h[f>>3]=+h[f>>3]*d;return}function Wi(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0;m=l;l=l+32|0;j=m+24|0;g=m+16|0;f=m;n=c[a+16>>2]|0;e=+h[n+32>>3]-+h[n+16>>3];d=+h[n+40>>3]-+h[n+24>>3];i=e/d;if(0);d=+h[b>>3];do if(!(i>d*1.1)){a=b+24|0;if(!(i<=d*.8)){c[a>>2]=0;k=9;break}c[a>>2]=-1;if(0);}else {c[b+24>>2]=~~(d*+((c[b+20>>2]|0)-(c[b+16>>2]|0)|0)/i);k=9;}while(0);if((k|0)==9?0:0){n=c[15712]|0;c[j>>2]=c[b+24>>2];w4(n,86815,j)|0;}l=m;return}function Xi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function Yi(d,e){d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;s=(gg(d)|0)==(d|0);v=d+16|0;w=c[v>>2]|0;a:do if(s){f=b[w+236>>1]|0;d=b[w+238>>1]|0;q=d<<16>>16;r=w+196|0;s=w+196|0;p=f<<16>>16;i=-2147483647.0;g=2147483647.0;while(1){if((p|0)>(q|0))break;j=c[r>>2]|0;o=c[j+(p<<6)>>2]|0;if((o|0)!=0?(t=c[j+(p<<6)+4>>2]|0,u=c[t>>2]|0,(u|0)!=0):0){l=1;j=u;while(1){j=c[j+16>>2]|0;k=a[j+156>>0]|0;if(!((l|0)<(o|0)&k<<24>>24!=0))break;j=c[t+(l<<2)>>2]|0;l=l+1|0;}if(!(k<<24>>24)){m=+h[j+16>>3]-+h[j+88>>3];n=g>2]|0)+(p<<6)+4>>2]|0;k=o+-2|0;j=o+-1|0;while(1){j=c[(c[l+(j<<2)>>2]|0)+16>>2]|0;if(!(a[j+156>>0]|0))break;else {j=k;k=k+-1|0;}}x=+h[j+96>>3]+ +h[j+16>>3];i=i>x?i:x;g=n?g:m;}}p=p+1|0;}k=c[w+180>>2]|0;l=w+184|0;j=1;while(1){if((j|0)>(k|0))break a;u=c[(c[(c[l>>2]|0)+(j<<2)>>2]|0)+16>>2]|0;x=+h[u+16>>3]+-8.0;m=+h[u+32>>3]+8.0;j=j+1|0;i=i>m?i:m;g=g>2]|0)+16>>2]|0)+232>>2]|0);g=+(c[(c[(c[w+256>>2]|0)+16>>2]|0)+232>>2]|0);f=b[w+236>>1]|0;d=b[w+238>>1]|0;}while(0);e=c[(c[e+16>>2]|0)+196>>2]|0;m=+h[(c[(c[c[e+(d<<16>>16<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]-+h[w+120>>3];x=+h[w+128>>3]+ +h[(c[(c[c[e+(f<<16>>16<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3];h[w+16>>3]=g;h[w+24>>3]=m;e=c[v>>2]|0;h[e+32>>3]=i;h[e+40>>3]=x;return}function Zi(a,d,e,f){a=a|0;d=d|0;e=+e;f=f|0;var g=0,h=0,i=0,j=0;i=JK(96)|0;j=i+48|0;c[j>>2]=c[j>>2]|3;c[i>>2]=c[i>>2]&-4|2;g=JK(176)|0;h=i+16|0;c[h>>2]=g;c[((c[i>>2]&3|0)==3?i:j)+40>>2]=a;c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]=d;if(e>65535.0){_i(e);e=65535.0;g=c[h>>2]|0;}b[g+170>>1]=~~(e+(e>=0.0?.5:-.5));c[g+156>>2]=f;gh(i)|0;return i|0}function _i(a){a=+a;var b=0,d=0;b=l;l=l+16|0;d=b;h[d>>3]=a;c[d+8>>2]=65535;gA(1,86845,d)|0;l=b;return}function $i(a){a=a|0;var b=0,d=0,e=0,f=0;a=(c[a+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if(!a)break;f=a+16|0;e=c[f>>2]|0;a=e+172|0;d=c[a+4>>2]|0;e=e+248|0;c[e>>2]=c[a>>2];c[e+4>>2]=d;e=c[f>>2]|0;d=e+180|0;a=c[d+4>>2]|0;e=e+256|0;c[e>>2]=c[d>>2];c[e+4>>2]=a;e=c[f>>2]|0;a=c[e+180>>2]|0;d=0;while(1)if(!(c[a+(d<<2)>>2]|0))break;else d=d+1|0;b=c[e+172>>2]|0;a=0;while(1)if(!(c[b+(a<<2)>>2]|0))break;else a=a+1|0;c[e+176>>2]=0;a=JK((a+d<<2)+16|0)|0;e=c[f>>2]|0;c[e+172>>2]=a;c[e+184>>2]=0;e=JK(16)|0;a=c[f>>2]|0;c[a+180>>2]=e;a=a+164|0;}return}function aj(d){d=d|0;var f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0;z=l;l=l+16|0;w=z;x=d+16|0;u=c[x>>2]|0;y=c[u+196>>2]|0;d=(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1)!=0;v=c[u+248>>2]|0;c[w>>2]=v;c[w+4>>2]=d?5:v;v=b[u+236>>1]|0;d=u;while(1){if((v|0)>(b[d+238>>1]|0))break;r=y+(v<<6)+4|0;c[(c[(c[c[r>>2]>>2]|0)+16>>2]|0)+232>>2]=0;s=y+(v<<6)|0;t=+(c[w+((v&1)<<2)>>2]|0);p=0.0;k=0;a:while(1){if((k|0)>=(c[s>>2]|0))break;f=c[r>>2]|0;m=c[f+(k<<2)>>2]|0;u=m+16|0;d=c[u>>2]|0;i=+h[d+96>>3];h[d+240>>3]=i;if((c[d+208>>2]|0)>0){j=0;f=0;while(1){g=c[(c[d+204>>2]|0)+(j<<2)>>2]|0;if(!g)break;q=c[g>>2]&3;if((c[((q|0)==3?g:g+48|0)+40>>2]|0)==(c[((q|0)==2?g:g+-48|0)+40>>2]|0)){f=(kO(g)|0)+f|0;d=c[u>>2]|0;}j=j+1|0;}q=d+96|0;i=+h[q>>3]+ +(f|0);h[q>>3]=i;f=c[r>>2]|0;}q=k+1|0;f=c[f+(q<<2)>>2]|0;if(f){o=f+16|0;i=i+t+ +h[(c[o>>2]|0)+88>>3];Zi(m,f,i,0)|0;d=~~(i+p);c[(c[o>>2]|0)+232>>2]=d;p=+(d|0);d=c[u>>2]|0;}f=c[d+112>>2]|0;if(f){j=c[d+256>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;d=(c[(c[(c[((c[k>>2]&3|0)==2?k:k+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0)>(c[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0);g=d?j:k;j=d?k:j;k=f+16|0;d=c[k>>2]|0;i=+((O(c[(c[x>>2]|0)+248>>2]|0,e[d+170>>1]|0)|0)/2|0|0);o=c[g>>2]&3;f=c[((o|0)==2?g:g+-48|0)+40>>2]|0;g=c[((o|0)==3?g:g+48|0)+40>>2]|0;if(!(lj(g,f)|0))Zi(f,g,+(~~(+h[(c[f+16>>2]|0)+96>>3]+i+ +h[(c[g+16>>2]|0)+88>>3])|0),c[d+156>>2]|0)|0;d=c[j>>2]&3;f=c[((d|0)==3?j:j+48|0)+40>>2]|0;d=c[((d|0)==2?j:j+-48|0)+40>>2]|0;if(!(lj(d,f)|0)){Zi(f,d,+(~~(+h[(c[f+16>>2]|0)+96>>3]+i+ +h[(c[d+16>>2]|0)+88>>3])|0),c[(c[k>>2]|0)+156>>2]|0)|0;o=0;}else o=0;}else o=0;while(1){d=c[u>>2]|0;if((o|0)>=(c[d+192>>2]|0)){k=q;continue a}m=c[(c[d+188>>2]|0)+(o<<2)>>2]|0;k=c[m>>2]&3;g=c[((k|0)==3?m:m+48|0)+40>>2]|0;k=c[((k|0)==2?m:m+-48|0)+40>>2]|0;j=(c[(c[g+16>>2]|0)+236>>2]|0)<(c[(c[k+16>>2]|0)+236>>2]|0);f=j?g:k;g=j?k:g;i=+h[(c[g+16>>2]|0)+88>>3]+ +h[(c[f+16>>2]|0)+96>>3];k=m+16|0;j=~~(i+ +(O(c[(c[x>>2]|0)+248>>2]|0,e[(c[k>>2]|0)+170>>1]|0)|0));n=dh(f,g)|0;if(!n){d=c[k>>2]|0;if(!(c[d+96>>2]|0))Zi(f,g,+(j|0),c[d+156>>2]|0)|0;}else {A=+(j|0);d=c[k>>2]|0;B=+h[d+136>>3];i=i+ +(c[(c[x>>2]|0)+248>>2]|0)+ +(~~(B+(B>=0.0?.5:-.5))|0);f=~~(i65535){_i(+(f|0));f=65535;d=c[k>>2]|0;}k=c[n+16>>2]|0;j=k+170|0;g=e[j>>1]|0;b[j>>1]=(f|0)<(g|0)?g:f;k=k+156|0;c[k>>2]=c[(c[((c[k>>2]|0)>(c[d+156>>2]|0)?n:m)+16>>2]|0)+156>>2];}o=o+1|0;}}v=v+1|0;d=c[x>>2]|0;}l=z;return}function bj(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;d=(c[b+16>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;g=d+16|0;d=c[g>>2]|0;e=c[d+256>>2]|0;a:do if(e){f=0;while(1){e=c[e+(f<<2)>>2]|0;if(!e)break a;n=sh(b)|0;d=n+16|0;a[(c[d>>2]|0)+156>>0]=2;l=e+16|0;k=c[l>>2]|0;i=~~(+h[k+56>>3]-+h[k+16>>3]);m=(i|0)>0;j=m?0:0-i|0;i=m?i:0;m=e+48|0;Zi(n,c[((c[e>>2]&3|0)==3?e:m)+40>>2]|0,+(i+1|0),c[k+156>>2]|0)|0;k=e+-48|0;Zi(n,c[((c[e>>2]&3|0)==2?e:k)+40>>2]|0,+(j+1|0),c[(c[l>>2]|0)+156>>2]|0)|0;l=c[e>>2]&3;i=(c[(c[(c[((l|0)==3?e:m)+40>>2]|0)+16>>2]|0)+232>>2]|0)-i|0;e=(c[(c[(c[((l|0)==2?e:k)+40>>2]|0)+16>>2]|0)+232>>2]|0)-j|0;c[(c[d>>2]|0)+232>>2]=((i|0)<(e|0)?i:e)+-1;d=c[g>>2]|0;f=f+1|0;e=c[d+256>>2]|0;}}while(0);d=d+164|0;}return}function cj(a){a=a|0;if((c[(c[a+16>>2]|0)+180>>2]|0)>0){gj(a);hj(a);ij(a);jj(a);}return}function dj(a){a=a|0;var b=0.0,d=0.0,e=0,f=0;e=a+16|0;f=c[(c[e>>2]|0)+8>>2]|0;if((c[f+84>>2]|0)==3?(b=+h[f+64>>3],d=+h[f+72>>3],!(d*b<=1.0)):0){ej(a);f=c[e>>2]|0;d=(c[f+116>>2]&1|0)==0?b:d;Zi(c[f+256>>2]|0,c[f+260>>2]|0,d<65535.0?d:65535.0,1e3)|0;}return}function ej(a){a=a|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n;e=ZO(a,c[47144]|0,8,0)|0;fj(a);i=a+16|0;g=c[i>>2]|0;j=c[g+256>>2]|0;k=c[g+260>>2]|0;f=+(e|0);e=b[g+236>>1]|0;while(1){if((e|0)>(b[g+238>>1]|0))break;d=c[g+196>>2]|0;do if(c[d+(e<<6)>>2]|0){d=c[c[d+(e<<6)+4>>2]>>2]|0;if(!d){c[m>>2]=KB(a)|0;c[m+4>>2]=e;gA(1,86929,m)|0;break}else {Zi(j,d,+h[(c[d+16>>2]|0)+88>>3]+f+ +h[g+96>>3],0)|0;g=c[i>>2]|0;d=c[g+196>>2]|0;d=c[(c[d+(e<<6)+4>>2]|0)+((c[d+(e<<6)>>2]|0)+-1<<2)>>2]|0;Zi(d,k,+h[(c[d+16>>2]|0)+96>>3]+f+ +h[g+64>>3],0)|0;break}}while(0);e=e+1|0;g=c[i>>2]|0;}l=n;return}function fj(b){b=b|0;var d=0,e=0,f=0;d=b+16|0;if(!(c[(c[d>>2]|0)+256>>2]|0)){f=sh(gg(b)|0)|0;a[(c[f+16>>2]|0)+156>>0]=2;e=sh(gg(b)|0)|0;a[(c[e+16>>2]|0)+156>>0]=2;if((c[(c[d>>2]|0)+12>>2]|0?(gg(b)|0)!=(b|0):0)?(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0:0){b=c[d>>2]|0;Zi(f,e,+(~~+h[b+48+((+h[b+48>>3]>+h[b+80>>3]?0:2)<<4)>>3]|0),0)|0;}d=c[d>>2]|0;c[d+256>>2]=f;c[d+260>>2]=e;}return}function gj(a){a=a|0;var b=0,d=0;do if((gg(a)|0)!=(a|0)){ej(a);a=a+16|0;b=c[a>>2]|0;b=dh(c[b+256>>2]|0,c[b+260>>2]|0)|0;if(!b){d=c[a>>2]|0;Zi(c[d+256>>2]|0,c[d+260>>2]|0,1.0,128)|0;break}else {d=(c[b+16>>2]|0)+156|0;c[d>>2]=(c[d>>2]|0)+128;break}}else a=a+16|0;while(0);b=1;while(1){d=c[a>>2]|0;if((b|0)>(c[d+180>>2]|0))break;gj(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function hj(d){d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0;k=ZO(d,c[47144]|0,8,0)|0;o=d+16|0;e=c[o>>2]|0;m=+(k|0);k=b[e+236>>1]|0;while(1){if((k|0)>(b[e+238>>1]|0)){f=1;break}e=c[e+196>>2]|0;a:do if(c[e+(k<<6)>>2]|0?(l=c[c[e+(k<<6)+4>>2]>>2]|0,l|0):0){i=l+16|0;f=c[(c[i>>2]|0)+236>>2]|0;while(1){if((f|0)<=0)break;f=f+-1|0;j=c[(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)+4>>2]|0)+(f<<2)>>2]|0;g=j+16|0;e=c[g>>2]|0;if(!(a[e+156>>0]|0)){n=10;break}if(kj(d,j)|0){n=9;break}}if((n|0)==9){e=c[g>>2]|0;n=10;}if((n|0)==10){n=0;Zi(j,c[(c[o>>2]|0)+256>>2]|0,+h[e+96>>3]+m,0)|0;}f=(c[(c[(c[o>>2]|0)+196>>2]|0)+(k<<6)>>2]|0)+(c[(c[i>>2]|0)+236>>2]|0)|0;while(1){if((f|0)>=(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)>>2]|0))break a;i=c[(c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(k<<6)+4>>2]|0)+(f<<2)>>2]|0;g=i+16|0;e=c[g>>2]|0;if(!(a[e+156>>0]|0))break;if(!(kj(d,i)|0))f=f+1|0;else {n=15;break}}if((n|0)==15){n=0;e=c[g>>2]|0;}Zi(c[(c[o>>2]|0)+260>>2]|0,i,+h[e+88>>3]+m,0)|0;}while(0);k=k+1|0;e=c[o>>2]|0;}while(1){if((f|0)>(c[e+180>>2]|0))break;hj(c[(c[e+184>>2]|0)+(f<<2)>>2]|0);f=f+1|0;e=c[o>>2]|0;}return}function ij(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0;e=ZO(a,c[47144]|0,8,0)|0;fj(a);b=a+16|0;d=+(e|0);a=1;while(1){e=c[b>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[(c[e+184>>2]|0)+(a<<2)>>2]|0;fj(e);f=c[b>>2]|0;g=e+16|0;Zi(c[f+256>>2]|0,c[(c[g>>2]|0)+256>>2]|0,+h[f+96>>3]+d,0)|0;f=c[b>>2]|0;Zi(c[(c[g>>2]|0)+260>>2]|0,c[f+260>>2]|0,+h[f+64>>3]+d,0)|0;ij(e);a=a+1|0;}return}function jj(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0;d=ZO(a,c[47144]|0,8,0)|0;n=a+16|0;a=1;while(1){f=c[n>>2]|0;e=c[f+180>>2]|0;if((a|0)>(e|0))break;fj(c[(c[f+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}m=+(d|0);l=1;a=e;d=f;while(1){if((l|0)>(a|0))break;k=l+1|0;j=k;while(1){e=c[d+184>>2]|0;f=c[e+(l<<2)>>2]|0;if((j|0)>(a|0))break;e=c[e+(j<<2)>>2]|0;g=(b[(c[f+16>>2]|0)+236>>1]|0)>(b[(c[e+16>>2]|0)+236>>1]|0);i=g?e:f;e=g?f:e;f=c[i+16>>2]|0;g=c[e+16>>2]|0;o=b[g+236>>1]|0;h=o<<16>>16;if((b[f+238>>1]|0)>=o<<16>>16){a=(c[(c[(c[c[(c[f+196>>2]|0)+(h<<6)+4>>2]>>2]|0)+16>>2]|0)+236>>2]|0)<(c[(c[(c[c[(c[g+196>>2]|0)+(h<<6)+4>>2]>>2]|0)+16>>2]|0)+236>>2]|0);Zi(c[(c[(a?i:e)+16>>2]|0)+260>>2]|0,c[(c[(a?e:i)+16>>2]|0)+256>>2]|0,m,0)|0;a=c[n>>2]|0;d=a;a=c[a+180>>2]|0;}j=j+1|0;}jj(f);d=c[n>>2]|0;l=k;a=c[d+180>>2]|0;}return}function kj(b,d){b=b|0;d=d|0;var e=0;d=c[d+16>>2]|0;if((a[d+156>>0]|0)==1){d=c[c[d+256>>2]>>2]|0;while(1){e=c[(c[d+16>>2]|0)+116>>2]|0;if(!e)break;else d=e;}if(!(HC(b,c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0))d=(HC(b,c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0)==0&1;else d=0;}else d=0;return d|0}function lj(a,b){a=a|0;b=b|0;return mj(a,b)|0}function mj(a,b){a=a|0;b=b|0;var d=0,e=0;a:do if((a|0)==(b|0))a=1;else {d=c[(c[a+16>>2]|0)+180>>2]|0;a=0;while(1){e=c[d+(a<<2)>>2]|0;if(!e){a=0;break a}if(!(mj(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,b)|0))a=a+1|0;else {a=1;break}}}while(0);return a|0}function nj(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=d+16|0;d=c[k>>2]|0;j=b[d+236>>1]|0;while(1){if((j|0)>(b[d+238>>1]|0))break;h=c[d+196>>2]|0;g=c[h+(j<<6)>>2]|0;h=h+(j<<6)+4|0;i=0;f=0;while(1){if((f|0)>=(g|0))break;e=c[(c[(c[h>>2]|0)+(f<<2)>>2]|0)+16>>2]|0;c[e+236>>2]=i;if((a[e+159>>0]|0)==6)e=c[e+216>>2]|0;else e=1;i=e+i|0;f=f+1|0;}if((i|0)>(g|0)){d=c[h>>2]|0;if(!d)d=KK((i<<2)+4|0)|0;else d=MK(d,(i<<2)+4|0)|0;f=c[(c[k>>2]|0)+196>>2]|0;c[f+(j<<6)+4>>2]=d;e=c[f+(j<<6)>>2]|0;while(1){d=e+-1|0;if((e|0)<=0)break;h=c[f+(j<<6)+4>>2]|0;e=c[h+(d<<2)>>2]|0;c[h+(c[(c[e+16>>2]|0)+236>>2]<<2)>>2]=e;e=d;f=c[(c[k>>2]|0)+196>>2]|0;}c[f+(j<<6)>>2]=i;c[(c[f+(j<<6)+4>>2]|0)+(i<<2)>>2]=0;d=c[k>>2]|0;}j=j+1|0;}return}function oj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+48|0;n=o+32|0;m=o+8|0;d=o+24|0;k=o+16|0;j=o;e=b+16|0;f=c[e>>2]|0;a:do if((c[f+216>>2]|0)>=2){c[m>>2]=~~(+h[f+16>>3]-+h[f+88>>3]);c[m+4>>2]=~~+h[f+24>>3];c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];pj(d,b,n);g=d;i=c[g+4>>2]|0;d=m;c[d>>2]=c[g>>2];c[d+4>>2]=i;d=c[e>>2]|0;if((c[d+184>>2]|0)>0){j=c[c[d+180>>2]>>2]|0;d=(c[d+236>>2]|0)+1|0;j=_A(a,c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)|0;while(1){if(!j)break a;i=(c[j>>2]&3|0)==2?j:j+-48|0;e=i+48|0;f=c[((c[i>>2]&3|0)==3?i:e)+40>>2]|0;if((f|0)!=(b|0)?(fP(f)|0)==(b|0):0){f=c[((c[i>>2]&3|0)==3?i:e)+40>>2]|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];qj(k,a,f,n,d);f=k;e=c[f+4>>2]|0;g=m;c[g>>2]=c[f>>2];c[g+4>>2]=e;xh(i);g=i+-48|0;e=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;f=c[e+172>>2]|0;if(!f)e=KK((c[e+176>>2]<<2)+8|0)|0;else e=MK(f,(c[e+176>>2]<<2)+8|0)|0;c[(c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0)+172>>2]=e;p=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;e=c[p+172>>2]|0;p=p+176|0;f=c[p>>2]|0;c[p>>2]=f+1;c[e+(f<<2)>>2]=i;i=c[(c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0)+16>>2]|0;c[(c[i+172>>2]|0)+(c[i+176>>2]<<2)>>2]=0;d=d+1|0;}j=$A(a,j)|0;}}else {i=c[c[d+172>>2]>>2]|0;d=(c[d+236>>2]|0)+1|0;i=XA(a,c[((c[i>>2]&3|0)==3?i:i+48|0)+40>>2]|0)|0;while(1){if(!i)break a;e=i+-48|0;f=c[((c[i>>2]&3|0)==2?i:e)+40>>2]|0;if((f|0)!=(b|0)?(fP(f)|0)==(b|0):0){f=c[((c[i>>2]&3|0)==2?i:e)+40>>2]|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];qj(j,a,f,n,d);f=j;e=c[f+4>>2]|0;g=m;c[g>>2]=c[f>>2];c[g+4>>2]=e;xh(i);g=i+48|0;e=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;f=c[e+180>>2]|0;if(!f)e=KK((c[e+184>>2]<<2)+8|0)|0;else e=MK(f,(c[e+184>>2]<<2)+8|0)|0;c[(c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0)+180>>2]=e;f=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;k=c[f+180>>2]|0;f=f+184|0;p=c[f>>2]|0;c[f>>2]=p+1;c[k+(p<<2)>>2]=i;p=c[(c[((c[i>>2]&3|0)==3?i:g)+40>>2]|0)+16>>2]|0;c[(c[p+180>>2]|0)+(c[p+184>>2]<<2)>>2]=0;d=d+1|0;}i=ZA(a,i)|0;}}}while(0);l=o;return}function pj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0;qQ(b,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1);e=c[b+16>>2]|0;h[e+24>>3]=+(c[d+4>>2]|0);f=+h[e+88>>3]+ +(c[d>>2]|0);h[e+16>>3]=f;f=f+ +h[e+96>>3];c[d>>2]=~~(f+ +(c[(c[(xC(b)|0)+16>>2]|0)+248>>2]|0));e=d;b=c[e+4>>2]|0;d=a;c[d>>2]=c[e>>2];c[d+4>>2]=b;return}function qj(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=l;l=l+16|0;h=i;b=gg(b)|0;g=fP(d)|0;if((g|0)!=(d|0))ph(g,d);j=c[d+16>>2]|0;c[j+236>>2]=f;g=c[(c[g+16>>2]|0)+232>>2]|0;c[j+232>>2]=g;c[(c[(c[(c[b+16>>2]|0)+196>>2]|0)+(g<<6)+4>>2]|0)+(f<<2)>>2]=d;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];pj(a,d,h);l=i;return}function rj(a){a=a|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,l=0,m=0,n=0.0;m=c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0;if((gg(a)|0)==(a|0))j=8.0;else j=+(ZO(a,c[47144]|0,8,0)|0);l=a+16|0;g=c[l>>2]|0;f=0;k=1;e=+h[g+120>>3];d=+h[g+128>>3];while(1){if((k|0)>(c[g+180>>2]|0))break;i=c[(c[g+184>>2]|0)+(k<<2)>>2]|0;f=rj(i)|0|f;i=c[i+16>>2]|0;g=c[l>>2]|0;if((b[i+238>>1]|0)==(b[g+238>>1]|0)){n=+h[i+120>>3]+j;e=e>n?e:n;}if((b[i+236>>1]|0)==(b[g+236>>1]|0)){n=+h[i+128>>3]+j;d=d>n?d:n;}k=k+1|0;}if((gg(a)|0)!=(a|0)?(c[(c[l>>2]|0)+12>>2]|0)!=0:0)if(!(c[(c[(yC(a)|0)+16>>2]|0)+116>>2]&1)){k=c[l>>2]|0;f=1;e=+h[k+56>>3]+e;d=+h[k+88>>3]+d;}else f=1;k=c[l>>2]|0;h[k+120>>3]=e;h[k+128>>3]=d;if((gg(a)|0)!=(a|0)){l=c[l>>2]|0;a=m+(b[l+236>>1]<<6)+24|0;n=+h[a>>3];h[a>>3]=n>d?n:d;m=m+(b[l+238>>1]<<6)+16|0;n=+h[m>>3];h[m>>3]=n>e?n:e;}return f|0}function sj(a,d){a=a|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0.0,q=0.0;o=c[(c[(gg(a)|0)+16>>2]|0)+196>>2]|0;if((gg(a)|0)==(a|0))e=0;else e=ZO(a,c[47144]|0,8,0)|0;l=a+16|0;i=c[l>>2]|0;m=e+d|0;k=+(e|0);j=1;f=+h[i+128>>3];g=+h[i+120>>3];e=i;while(1){if((j|0)>(c[e+180>>2]|0))break;i=c[(c[e+184>>2]|0)+(j<<2)>>2]|0;sj(i,m);i=c[i+16>>2]|0;e=c[l>>2]|0;if((b[i+238>>1]|0)==(b[e+238>>1]|0)){q=+h[i+120>>3]+k;g=g>q?g:q;}if((b[i+236>>1]|0)==(b[e+236>>1]|0)){q=+h[i+128>>3]+k;f=f>q?f:q;}j=j+1|0;}h[e+120>>3]=g;h[e+128>>3]=f;if(((gg(a)|0)!=(a|0)?(n=c[l>>2]|0,c[n+12>>2]|0):0)?(p=-g-f+ +h[n+48+((+h[n+104>>3]>+h[n+72>>3]?3:1)<<4)+8>>3]-+h[(c[(c[c[o+(b[n+236>>1]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+ +h[(c[(c[c[o+(b[n+238>>1]<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3],p>0.0):0)tj(a,~~p,d);if((gg(a)|0)!=(a|0)){n=c[l>>2]|0;m=o+(b[n+236>>1]<<6)+24|0;q=+h[m>>3];p=+h[n+128>>3];h[m>>3]=q>p?q:p;o=o+(b[n+238>>1]<<6)+16|0;p=+h[o>>3];q=+h[n+120>>3];h[o>>3]=p>q?p:q;}return}function tj(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0;k=c[(gg(a)|0)+16>>2]|0;q=c[k+196>>2]|0;p=c[a+16>>2]|0;a=b[p+238>>1]|0;f=b[p+236>>1]|0;l=(d+1|0)/2|0;m=p+120|0;n=+h[m>>3];o=+(l|0);i=+(e|0);e=~~(o+i+n-+h[q+(a<<6)+16>>3]);if((e|0)>0){g=+(e|0);while(1){if((a|0)<(f|0))break;if((c[q+(a<<6)>>2]|0)>0){r=(c[(c[c[q+(a<<6)+4>>2]>>2]|0)+16>>2]|0)+24|0;h[r>>3]=+h[r>>3]+g;}a=a+-1|0;}j=+h[p+128>>3];a=e;g=j+ +(d-l|0);}else {j=+h[p+128>>3];a=d-l|0;g=j;}a=~~(+(a|0)+i+g-+h[q+(f<<6)+24>>3]);a:do if((a|0)>0){e=b[k+236>>1]|0;g=+(a|0);while(1){a=f+-1|0;if((f|0)<=(e|0))break a;if((c[q+(a<<6)>>2]|0)<=0){f=a;continue}f=(c[(c[c[q+(a<<6)+4>>2]>>2]|0)+16>>2]|0)+24|0;h[f>>3]=+h[f>>3]+g;f=a;}}while(0);h[p+128>>3]=j+ +(d-l|0);h[m>>3]=n+o;return}function uj(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b+16>>2]|0;f=a[e+84>>0]|0;b=c[d+16>>2]|0;do if(f<<24>>24==(a[b+84>>0]|0)){if(+h[e+56>>3]==+h[b+56>>3]){if(!(f<<24>>24==0?1:+h[e+64>>3]==+h[b+64>>3])){b=0;break}}else if(f<<24>>24){b=0;break}if(+h[e+16>>3]==+h[b+16>>3]?+h[e+24>>3]==+h[b+24>>3]:0){b=1;break}b=(a[e+44>>0]|0)==0&1;}else b=0;while(0);return b|0}function vj(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+16|0;d=c[i>>2]|0;b[d+236>>1]=32767;b[d+238>>1]=-1;d=0;h=jC(a)|0;while(1){e=c[i>>2]|0;if(!h)break;f=e+238|0;g=c[(c[h+16>>2]|0)+232>>2]|0;if((g|0)>(b[f>>1]|0))b[f>>1]=g;e=e+236|0;if((g|0)<(b[e>>1]|0))b[e>>1]=g;if(!d)d=h;else d=(g|0)<(c[(c[d+16>>2]|0)+232>>2]|0)?h:d;h=kC(a,h)|0;}c[e+264>>2]=d;return}function wj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0;b=QA(a,86974)|0;if(!b)b=2147483647;else {g=+r5(b);b=~~(g*+(tB(a)|0));}e=a+16|0;d=0;while(1){f=c[e>>2]|0;if((d|0)>=(c[f+220>>2]|0))break;c[f+192>>2]=c[(c[f+216>>2]|0)+(d<<2)>>2];uL(a,(c[f+180>>2]|0)==0&1,b)|0;d=d+1|0;}return}function xj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+16|0;e=f;if(!(QA(a,86983)|0))zj(a,d);else {g=(c[a+16>>2]|0)+136|0;b[g>>1]=b[g>>1]|16;yj(a,d);}if(0);l=f;return}function yj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0.0;i=l;l=l+16|0;h=i;c[46747]=0;a[h>>0]=a[18588]|0;a[h+1>>0]=a[18589]|0;a[h+2>>0]=a[18590]|0;a[h+3>>0]=a[18591]|0;h=oB(87201,h,0)|0;TC(h,87230,280,1)|0;FC(h,17404,17344);Aj(b);e=QA(b,86974)|0;if(!e)f=2147483647;else {j=+r5(e);f=~~(j*+(tB(b)|0));}Qj(b,0);Rj(b,h);Sj(b,h);Tj(b,h,0,0);Uj(h);g=Vj(h)|0;Wj(h);if(d|0){Kk(h);yk(h);}e=QA(b,102586)|0;if(!e)e=-1;else e=q5(e)|0;NK(h,1,f,e)|0;Xj(b,h,g);sB(h)|0;l=i;return}function zj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g+16|0;e=g+8|0;d=g;Aj(a);do if(!b){Bj(a,a);Nk(a);Cj(d,a);h=d;d=c[h+4>>2]|0;b=e;c[b>>2]=c[h>>2];c[b+4>>2]=d;Gl(a,0);b=0;}else {Kk(a);yk(a);Bj(a,a);Nk(a);Cj(d,a);i=d;d=c[i+4>>2]|0;h=e;c[h>>2]=c[i>>2];c[h+4>>2]=d;Gl(a,0);h=c[a+16>>2]|0;if((c[h+220>>2]|0)<=1?(c[h+180>>2]|0)<=0:0)break;c[b+32>>2]=1;b=0;}while(0);vk(a);c[f>>2]=c[e>>2];c[f+4>>2]=c[e+4>>2];if(Dj(a,f)|0)Gl(a,0);if(!b)wj(a);else zk(a,b);Ej(a,b);Fj(a);l=g;return}function Aj(d){d=d|0;var f=0,g=0,h=0;if(a[(c[(c[d+60>>2]|0)+16>>2]|0)+113>>0]&1){g=jC(d)|0;while(1){if(!g)break;f=XA(d,g)|0;while(1){if(!f)break;h=(c[f+16>>2]|0)+170|0;b[h>>1]=(e[h>>1]|0)<<1;f=ZA(d,f)|0;}g=kC(d,g)|0;}h=(c[d+16>>2]|0)+252|0;c[h>>2]=((c[h>>2]|0)+1|0)/2|0;}return}function Bj(a,b){a=a|0;b=b|0;var d=0;b=OD(b)|0;while(1){if(!b)break;d=Nj(b)|0;do if(d)if((d|0)==7&(c[47135]|0)==100){Jj(a,b);break}else {Oj(a,b,d);break}else Bj(a,b);while(0);b=PD(b)|0;}return}function Cj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=d+16|0;e=c[i>>2]|0;d=c[e+228>>2]|0;e=c[e+224>>2]|0;f=(e|0)==0;if(!d)if(f){j=0;k=0;}else g=4;else if(f)g=5;else g=4;if((g|0)==4){d=fP(e)|0;e=c[i>>2]|0;c[e+224>>2]=d;d=c[e+228>>2]|0;if(!d){h=0;d=e;g=12;}else g=5;}do if((g|0)==5){d=fP(d)|0;e=c[i>>2]|0;c[e+228>>2]=d;if(d){e=d+16|0;d=c[e>>2]|0;f=(a[d+159>>0]|0)==5&1;while(1){d=c[c[d+180>>2]>>2]|0;if(!d){g=11;break}h=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;if((h|0)!=(fP(h)|0)){g=9;break}uk(d);d=c[e>>2]|0;}if((g|0)==9)qa(87094,87034,346,87126);else if((g|0)==11){h=f;d=c[i>>2]|0;g=12;break}}else {h=0;d=e;g=12;}}while(0);a:do if((g|0)==12){d=c[d+224>>2]|0;if(!d){j=0;k=h;}else {e=d+16|0;d=c[e>>2]|0;f=(a[d+159>>0]|0)==3&1;while(1){d=c[c[d+172>>2]>>2]|0;if(!d){j=f;k=h;break a}i=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((i|0)!=(fP(i)|0))break;uk(d);d=c[e>>2]|0;}qa(87139,87034,353,87126);}}while(0);c[b>>2]=j;c[b+4>>2]=k;return}function Dj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;j=a+16|0;i=c[j>>2]|0;if((c[i+228>>2]|0)==0?(c[i+224>>2]|0)==0:0)d=0;else e=3;a:do if((e|0)==3){g=jC(a)|0;i=d+4|0;h=c[d>>2]&65535;d=0;while(1){if(!g)break a;if((g|0)==(fP(g)|0)){f=g+16|0;e=c[f>>2]|0;if((c[e+184>>2]|0)==0?(k=c[(c[j>>2]|0)+228>>2]|0,!((k|0)==0|(g|0)==(k|0))):0){d=nh(g,k,0)|0;e=c[d+16>>2]|0;b[e+170>>1]=c[i>>2];c[e+156>>2]=0;e=c[f>>2]|0;}if((c[e+176>>2]|0)==0?(l=c[(c[j>>2]|0)+224>>2]|0,!((l|0)==0|(g|0)==(l|0))):0){d=nh(l,g,0)|0;f=c[d+16>>2]|0;b[f+170>>1]=h;c[f+156>>2]=0;}}g=kC(a,g)|0;}}while(0);return (d|0)!=0|0}function Ej(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;g=jC(d)|0;k=d+16|0;f=c[k>>2]|0;a:do if(g){b[f+236>>1]=32767;b[f+238>>1]=-1;j=(e|0)==0;while(1){if(!g)break;f=fP(g)|0;i=c[g+16>>2]|0;e=c[i+232>>2]|0;do if((f|0)!=(g|0)){if(!j)if(!e)e=0;else break;e=e+(c[(c[f+16>>2]|0)+232>>2]|0)|0;c[i+232>>2]=e;}while(0);f=c[k>>2]|0;h=f+238|0;if((e|0)>(b[h>>1]|0))b[h>>1]=e;f=f+236|0;if((e|0)<(b[f>>1]|0))b[f>>1]=e;switch(a[i+159>>0]|0){case 6:case 0:break;default:hP(g);}g=kC(d,g)|0;}if((gg(d)|0)==(d|0)){if((c[47135]|0)==100)e=1;else {Ij(d);break}while(1){f=c[k>>2]|0;if((e|0)>(c[f+180>>2]|0))break a;Hj(c[(c[f+184>>2]|0)+(e<<2)>>2]|0);e=e+1|0;}}}else {b[f+238>>1]=0;b[f+236>>1]=0;}while(0);return}function Fj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=b+16|0;e=0;while(1){d=c[j>>2]|0;if((e|0)>=(c[d+220>>2]|0))break;i=c[(c[d+216>>2]|0)+(e<<2)>>2]|0;c[d+192>>2]=i;d=i;while(1){if(!d)break;i=d+16|0;Gj((c[i>>2]|0)+172|0);Gj((c[i>>2]|0)+180|0);i=c[i>>2]|0;a[i+157>>0]=0;d=c[i+164>>2]|0;}e=e+1|0;}i=jC(b)|0;while(1){if(!i)break;h=XA(b,i)|0;while(1){if(!h)break;f=h+16|0;d=c[f>>2]|0;g=c[d+172>>2]|0;if((g|0)!=0?(k=g+16|0,(h|0)==(c[(c[k>>2]|0)+116>>2]|0)):0){d=jC(b)|0;while(1){if(!d)break;e=XA(b,d)|0;while(1){if(!e)break;if((h|0)!=(e|0)?(l=(c[e+16>>2]|0)+172|0,m=c[l>>2]|0,(m|0)!=0&(g|0)==(m|0)):0)c[l>>2]=0;e=ZA(b,e)|0;}d=kC(b,d)|0;}U1(c[k>>2]|0);U1(g);d=c[f>>2]|0;}c[d+172>>2]=0;h=ZA(b,h)|0;}i=kC(b,i)|0;}U1(c[(c[j>>2]|0)+216>>2]|0);m=c[j>>2]|0;c[m+216>>2]=0;c[m+220>>2]=0;return}function Gj(a){a=a|0;var b=0,d=0;d=a+4|0;b=c[d>>2]|0;while(1){if((b|0)<=-1)break;c[(c[a>>2]|0)+(b<<2)>>2]=0;b=b+-1|0;}c[d>>2]=0;return}function Hj(a){a=a|0;var d=0,f=0,g=0;d=a+16|0;f=c[d>>2]|0;g=c[(c[(c[f+264>>2]|0)+16>>2]|0)+232>>2]|0;a=f+236|0;b[a>>1]=g+(e[a>>1]|0);a=f+238|0;b[a>>1]=g+(e[a>>1]|0);a=1;while(1){if((a|0)>(c[f+180>>2]|0))break;Hj(c[(c[f+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;f=c[d>>2]|0;}return}function Ij(b){b=b|0;var d=0;d=OD(gg(b)|0)|0;while(1){if(!d)break;if((a[(c[d+16>>2]|0)+274>>0]|0)==7)Jj(b,d);d=PD(d)|0;}return}function Jj(a,b){a=a|0;b=b|0;var d=0;d=(c[b+16>>2]|0)+200|0;do if((c[d>>2]|0)==0?(c[d>>2]=a,Kj(a,b),jC(b)|0):0){Lj(a,b);if((c[47135]|0)==100){zj(b,0);Mj(b);break}else {vj(b);break}}while(0);return}function Kj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=b+16|0;g=jC(d)|0;while(1){if(!g)break;i=kC(d,g)|0;j=g+16|0;if(!(a[(c[j>>2]|0)+159>>0]|0))f=1;else {wC(d,g)|0;g=i;continue}while(1){e=c[h>>2]|0;b=c[e+180>>2]|0;if((f|0)>=(b|0))break;if(HC(c[(c[e+184>>2]|0)+(f<<2)>>2]|0,g)|0){k=7;break}f=f+1|0;}if((k|0)==7){k=0;b=c[(c[h>>2]|0)+180>>2]|0;}if((f|0)<(b|0))wC(d,g)|0;c[(c[j>>2]|0)+212>>2]=0;g=i;}e=jC(d)|0;while(1){if(!e)break;b=XA(gg(d)|0,e)|0;while(1){if(!b)break;if(HC(d,c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)mB(d,b,1)|0;b=ZA(gg(d)|0,b)|0;}e=kC(d,e)|0;}return}function Lj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+16|0;d=c[e>>2]|0;g=d+180|0;a=c[g>>2]|0;f=a+1|0;c[g>>2]=f;d=c[d+184>>2]|0;if(!d)a=JK((a<<2)+8|0)|0;else a=LK(d,a+2|0,4,f)|0;c[(c[e>>2]|0)+184>>2]=a;c[a+(f<<2)>>2]=b;uK(b);return}function Mj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;g=c[b+16>>2]|0;d=g+192|0;h=0;while(1){d=c[d>>2]|0;if(!d)break;f=c[d+16>>2]|0;if(!(c[f+232>>2]|0))e=(a[f+156>>0]|0)==0?d:h;else e=h;d=f+164|0;h=e;}if(!h)qa(87019,87034,238,87041);c[g+264>>2]=h;d=jC(b)|0;while(1){if(!d){d=13;break}e=d+16|0;if(!((d|0)==(h|0)?1:(c[(c[e>>2]|0)+216>>2]|0)<2)){d=11;break}gP(d,h)|0;a[(c[e>>2]|0)+159>>0]=7;d=kC(b,d)|0;}if((d|0)==11)qa(87056,87034,242,87041);else if((d|0)==13)return}function Nj(b){b=b|0;var d=0;if(!(Pj(b)|0)){d=pP(QA(b,87171)|0,17356,17380)|0;a[(c[b+16>>2]|0)+274>>0]=d;b=d;}else b=7;return b|0}function Oj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=jC(d)|0;a:do if(g|0){j=e&255;i=g+16|0;f=g;h=j;while(1){a[(c[f+16>>2]|0)+159>>0]=h;f=kC(d,f)|0;if(!f)break;gP(g,f)|0;h=a[(c[i>>2]|0)+159>>0]|0;}switch(e|0){case 3:case 2:{b=b+16|0;f=c[b>>2]|0;h=c[f+224>>2]|0;if(h){g=gP(h,g)|0;f=c[b>>2]|0;}c[f+224>>2]=g;break}case 5:case 4:{b=b+16|0;f=c[b>>2]|0;h=c[f+228>>2]|0;if(h){g=gP(h,g)|0;f=c[b>>2]|0;}c[f+228>>2]=g;break}default:break a}switch(e|0){case 3:{f=f+224|0;break}case 5:{f=f+228|0;break}default:break a}a[(c[(c[f>>2]|0)+16>>2]|0)+159>>0]=j;}while(0);return}function Pj(a){a=a|0;return (Q2(KB(a)|0,108006,7)|0)==0|0}function Qj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;g=m;if(!(jk(b)|0)){do if(FP(b)|0)if(!d){c[(c[b+16>>2]|0)+204>>2]=0;d=b;break}else {c[(c[b+16>>2]|0)+204>>2]=(c[(c[d+16>>2]|0)+204>>2]|0)+1;kk(b,d);d=b;break}while(0);e=OD(b)|0;while(1){if(!e)break;Qj(e,d);e=PD(e)|0;}a:do if(FP(b)|0){e=jC(b)|0;while(1){if(!e)break a;f=(c[e+16>>2]|0)+212|0;if(!(c[f>>2]|0))c[f>>2]=b;e=kC(b,e)|0;}}while(0);switch(lk(b)|0){case 3:{d=d+16|0;a[(c[d>>2]|0)+241>>0]=1;k=19;break}case 2:{d=d+16|0;k=19;break}case 5:{d=d+16|0;a[(c[d>>2]|0)+242>>0]=1;k=21;break}case 4:{d=d+16|0;k=21;break}case 1:{mk(b)|0;break}case 6:break;default:{e=KB(b)|0;f=QA(b,87171)|0;c[g>>2]=e;c[g+4>>2]=f;gA(0,87354,g)|0;}}if((k|0)==19){k=mk(b)|0;k=nk(k,c[(c[d>>2]|0)+208>>2]|0)|0;c[(c[d>>2]|0)+208>>2]=k;}else if((k|0)==21){k=mk(b)|0;k=nk(k,c[(c[d>>2]|0)+212>>2]|0)|0;c[(c[d>>2]|0)+212>>2]=k;}if((FP(b)|0?(h=b+16|0,i=c[h>>2]|0,j=c[i+208>>2]|0,j|0):0)?(j|0)==(c[i+212>>2]|0):0){j=mk(b)|0;k=c[h>>2]|0;c[k+208>>2]=j;c[k+212>>2]=j;}}l=m;return}function Rj(a,b){a=a|0;b=b|0;var d=0,e=0;c[46747]=0;d=jC(a)|0;while(1){if(!d)break;if((Yj(d)|0)==(d|0)){e=$j(b,KB(d)|0)|0;c[(c[d+16>>2]|0)+148>>2]=e;}d=kC(a,d)|0;}d=jC(a)|0;while(1){if(!d)break;b=d+16|0;if(!(c[(c[b>>2]|0)+148>>2]|0)){e=c[(c[(Yj(d)|0)+16>>2]|0)+148>>2]|0;c[(c[b>>2]|0)+148>>2]=e;}d=kC(a,d)|0;}return}function Sj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=jC(a)|0;while(1){if(!h)break;d=c[(c[h+16>>2]|0)+148>>2]|0;i=XA(a,h)|0;while(1){if(!i)break;do if((ek(i)|0)==0?(j=i+-48|0,k=c[(c[(Yj(c[((c[i>>2]&3|0)==2?i:j)+40>>2]|0)|0)+16>>2]|0)+148>>2]|0,(d|0)!=(k|0)):0){f=c[i>>2]&3;g=i+48|0;e=((f|0)==3?i:g)+40|0;f=c[(c[(c[((f|0)==2?i:j)+40>>2]|0)+16>>2]|0)+212>>2]|0;if(!(fk(i)|0)){if((dk(c[(c[(c[e>>2]|0)+16>>2]|0)+212>>2]|0)|0)==0?(dk(f)|0)==0:0){gk(b,d,k,i);break}hk(b,d,k,i);break}else {f=Yj(c[e>>2]|0)|0;e=c[i>>2]&3;if((f|0)!=(c[(c[(c[(c[(c[((e|0)==3?i:g)+40>>2]|0)+16>>2]|0)+212>>2]|0)+16>>2]|0)+212>>2]|0)?(g=Yj(c[((e|0)==2?i:j)+40>>2]|0)|0,(g|0)!=(c[(c[(c[(c[(c[((c[i>>2]&3|0)==2?i:j)+40>>2]|0)+16>>2]|0)+212>>2]|0)+16>>2]|0)+208>>2]|0)):0)e=k;else {e=d;d=k;}gk(b,d,e,i);break}}while(0);i=ZA(a,i)|0;}h=kC(a,h)|0;}return}function Tj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;if((FP(a)|0)!=0?(dk(a)|0)!=0:0){g=jC(a)|0;while(1){if(!g)break;if(!(_A(a,g)|0)){f=c[(c[(Yj(g)|0)+16>>2]|0)+148>>2]|0;if(!d)d=$j(b,87252)|0;iB(b,d,f,0,1)|0;}if(!(XA(a,g)|0)){f=c[(c[(Yj(g)|0)+16>>2]|0)+148>>2]|0;if(!e)e=$j(b,87257)|0;iB(b,f,e,0,1)|0;}g=kC(a,g)|0;}if((e|0)!=0&(d|0)!=0){ck(iB(b,d,e,0,1)|0,0,1e3);f=d;}else f=d;}else f=d;d=OD(a)|0;while(1){if(!d)break;Tj(d,b,f,e);d=PD(d)|0;}return}function Uj(b){b=b|0;var d=0,e=0;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;a[e+158>>0]=0;a[e+157>>0]=0;d=kC(b,d)|0;}d=jC(b)|0;while(1){if(!d)break;ak(b,d);d=kC(b,d)|0;}return}function Vj(a){a=a|0;var b=0,d=0,e=0,f=0;b=jC(a)|0;while(1){if(!b)break;c[(c[b+16>>2]|0)+128>>2]=0;b=kC(a,b)|0;}b=0;e=jC(a)|0;while(1){if(!e)break;d=b+1|0;if(!(c[(c[e+16>>2]|0)+128>>2]|0)){_j(a,e,d);b=d;}e=kC(a,e)|0;}a:do if((b|0)>1){f=$j(a,87246)|0;d=1;e=jC(a)|0;while(1){if(!e)break a;if((c[(c[e+16>>2]|0)+128>>2]|0)==(d|0)){iB(a,f,e,0,1)|0;d=d+1|0;}e=kC(a,e)|0;}}while(0);return b|0}function Wj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;g=jC(a)|0;while(1){if(!g)break;h=g+16|0;f=XA(a,g)|0;while(1){if(!f)break;b=c[h>>2]|0;d=c[b+180>>2]|0;if(!d)b=KK((c[b+184>>2]<<2)+8|0)|0;else b=MK(d,(c[b+184>>2]<<2)+8|0)|0;d=c[h>>2]|0;c[d+180>>2]=b;d=d+184|0;e=c[d>>2]|0;c[d>>2]=e+1;c[b+(e<<2)>>2]=f;e=c[h>>2]|0;c[(c[e+180>>2]|0)+(c[e+184>>2]<<2)>>2]=0;e=f+-48|0;b=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;d=c[b+172>>2]|0;if(!d)b=KK((c[b+176>>2]<<2)+8|0)|0;else b=MK(d,(c[b+176>>2]<<2)+8|0)|0;c[(c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0)+172>>2]=b;i=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;b=c[i+172>>2]|0;i=i+176|0;d=c[i>>2]|0;c[i>>2]=d+1;c[b+(d<<2)>>2]=f;e=c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0;c[(c[e+172>>2]|0)+(c[e+176>>2]<<2)>>2]=0;f=ZA(a,f)|0;}g=kC(a,g)|0;}return}function Xj(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=a+16|0;o=c[n>>2]|0;b[o+236>>1]=32767;b[o+238>>1]=-1;a:do if((f|0)>1){h=JK((f<<2)+4|0)|0;g=f+1|0;f=1;while(1){if((f|0)==(g|0)){m=h;o=h;break a}c[h+(f<<2)>>2]=32767;f=f+1|0;}}else {m=0;o=0;}while(0);i=(m|0)==0;h=jC(a)|0;while(1){if(!h)break;j=c[(c[(c[(Yj(h)|0)+16>>2]|0)+148>>2]|0)+16>>2]|0;k=c[j+232>>2]|0;l=c[h+16>>2]|0;c[l+232>>2]=k;f=c[n>>2]|0;g=f+238|0;if((k|0)>(b[g>>1]|0))b[g>>1]=k;f=f+236|0;if((k|0)<(b[f>>1]|0))b[f>>1]=k;if(!i){j=c[j+128>>2]|0;c[l+128>>2]=j;l=m+(j<<2)|0;j=c[l>>2]|0;c[l>>2]=(j|0)<(k|0)?j:k;}h=kC(a,h)|0;}j=(m|0)!=0;b:do if(!j){m=b[(c[n>>2]|0)+236>>1]|0;g=m<<16>>16;if(m<<16>>16>0){f=jC(a)|0;while(1){if(!f)break;m=(c[f+16>>2]|0)+232|0;c[m>>2]=(c[m>>2]|0)-g;f=kC(a,f)|0;}f=c[n>>2]|0;n=f+236|0;b[n>>1]=(e[n>>1]|0)-g;f=f+238|0;b[f>>1]=(e[f>>1]|0)-g;f=0;}else f=0;}else {f=jC(a)|0;while(1){if(!f){f=1;break b}l=c[f+16>>2]|0;n=l+232|0;c[n>>2]=(c[n>>2]|0)-(c[m+(c[l+128>>2]<<2)>>2]|0);f=kC(a,f)|0;}}while(0);Zj(a,f);i=jC(d)|0;while(1){if(!i)break;g=i+16|0;f=c[g>>2]|0;h=c[f+172>>2]|0;if(h){U1(h);f=c[g>>2]|0;}f=c[f+180>>2]|0;if(f|0)U1(f);i=kC(d,i)|0;}U1(c[(c[(jC(a)|0)+16>>2]|0)+112>>2]|0);f=jC(a)|0;while(1){if(!f)break;c[(c[f+16>>2]|0)+112>>2]=0;f=kC(a,f)|0;}if(j)U1(o);return}function Yj(a){a=a|0;var b=0,d=0,e=0;b=a+16|0;d=(c[b>>2]|0)+152|0;e=c[d>>2]|0;if(e){if((e|0)!=(a|0)){e=Yj(e)|0;c[(c[b>>2]|0)+152>>2]=e;return e|0}}else c[d>>2]=a;return a|0}function Zj(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=a+16|0;e=1;while(1){f=c[i>>2]|0;if((e|0)>(c[f+180>>2]|0))break;Zj(c[(c[f+184>>2]|0)+(e<<2)>>2]|0,0);e=e+1|0;}if((d|0)!=0|(c[f+200>>2]|0)!=0){b[f+236>>1]=32767;b[f+238>>1]=-1;e=0;h=jC(a)|0;while(1){if(!h)break;g=c[(c[h+16>>2]|0)+232>>2]|0;d=c[i>>2]|0;f=d+238|0;if((g|0)>(b[f>>1]|0))b[f>>1]=g;d=d+236|0;if((g|0)<(b[d>>1]|0)){b[d>>1]=g;e=h;}h=kC(a,h)|0;}c[(c[i>>2]|0)+264>>2]=e;}return}function _j(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=(c[b+16>>2]|0)+128|0;a:do if(!(c[e>>2]|0)){c[e>>2]=d;e=XA(a,b)|0;while(1){if(!e)break;_j(a,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,d);e=ZA(a,e)|0;}e=_A(a,b)|0;while(1){if(!e)break a;_j(a,c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0,d);e=$A(a,e)|0;}}while(0);return}function $j(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=tC(a,b,1)|0;b=f+16|0;c[(c[b>>2]|0)+176>>2]=0;e=JK(20)|0;d=c[b>>2]|0;c[d+172>>2]=e;c[d+184>>2]=0;d=JK(20)|0;b=c[b>>2]|0;c[b+180>>2]=d;d=c[46747]|0;e=b+168|0;if(!d){c[e>>2]=0;c[(c[a+16>>2]|0)+192>>2]=f;}else {c[e>>2]=d;c[(c[d+16>>2]|0)+164>>2]=f;}c[46747]=f;c[b+164>>2]=0;return f|0}function ak(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=d+16|0;e=c[h>>2]|0;f=e+157|0;if(!(a[f>>0]|0)){a[f>>0]=1;a[e+158>>0]=1;d=XA(b,d)|0;while(1){if(!d)break;e=ZA(b,d)|0;f=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;g=c[f+16>>2]|0;if(a[g+158>>0]|0){bk(b,d);d=e;continue}if(a[g+157>>0]|0){d=e;continue}ak(b,f);d=e;}a[(c[h>>2]|0)+158>>0]=0;}return}function bk(a,b){a=a|0;b=b|0;var d=0,f=0,g=0;d=c[b>>2]&3;g=b+-48|0;f=b+48|0;d=iB(a,c[((d|0)==2?b:g)+40>>2]|0,c[((d|0)==3?b:f)+40>>2]|0,0,0)|0;if(!d){d=c[b>>2]&3;d=iB(a,c[((d|0)==2?b:g)+40>>2]|0,c[((d|0)==3?b:f)+40>>2]|0,0,1)|0;}g=c[b+16>>2]|0;ck(d,e[g+170>>1]|0,c[g+156>>2]|0);wC(a,b)|0;return}function ck(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0;a=c[a+16>>2]|0;g=a+170|0;h=e[g>>1]|0;b[g>>1]=(h|0)>(d|0)?h:d;d=a+156|0;c[d>>2]=(c[d>>2]|0)+f;return}function dk(a){a=a|0;return (eP(QA(a,87262)|0,0)|0)&255|0}function ek(b){b=b|0;var d=0,e=0;d=c[47189]|0;if((((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0)?(dP(e)|0)<<24>>24==0:0)b=1;else b=0;return b|0}function fk(a){a=a|0;var b=0,d=0;d=c[a>>2]&3;b=c[(c[(c[((d|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;a=c[(c[(c[((d|0)==2?a:a+-48|0)+40>>2]|0)+16>>2]|0)+212>>2]|0;if((b|0)==(a|0))return 1;else {d=ik(b,a)|0;return ((d|0)==(b|0)|(d|0)==(a|0))&1|0}return 0}function gk(a,b,d,f){a=a|0;b=b|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;h=j;g=iB(a,b,d,0,0)|0;if(!g){g=iB(a,d,b,0,0)|0;if(!g){g=iB(a,b,d,0,1)|0;if(!g){b=KB(b)|0;f=KB(d)|0;c[h>>2]=b;c[h+4>>2]=f;gA(1,87279,h)|0;}else i=4;}else i=4;}else i=4;if((i|0)==4){i=c[f+16>>2]|0;ck(g,e[i+170>>1]|0,c[i+156>>2]|0);}l=j;return}function hk(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+112|0;j=m;i=m+4|0;h=_A(a,d)|0;while(1){if(!h){k=6;break}n=XA(a,c[((c[h>>2]&3|0)==3?h:h+48|0)+40>>2]|0)|0;if(n|0?(c[((c[n>>2]&3|0)==2?n:n+-48|0)+40>>2]|0)==(f|0):0)break;h=$A(a,h)|0;}if((k|0)==6){n=c[46748]|0;c[46748]=n+1;c[j>>2]=n;m4(i,87270,j)|0;i=$j(a,i)|0;n=iB(a,i,d,0,1)|0;i=iB(a,i,f,0,1)|0;f=c[g+16>>2]|0;k=f+156|0;n=(c[n+16>>2]|0)+156|0;c[n>>2]=(c[n>>2]|0)+((c[k>>2]|0)*1e3|0);n=c[i+16>>2]|0;j=n+170|0;b[j>>1]=b[(c[((e[j>>1]|0)>(e[f+170>>1]|0)?i:g)+16>>2]|0)+170>>1]|0;n=n+156|0;c[n>>2]=(c[n>>2]|0)+(c[k>>2]|0);}l=m;return}function ik(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;a:while(1){e=a+16|0;while(1){if((a|0)==(b|0))break a;f=c[e>>2]|0;d=c[b+16>>2]|0;if((c[f+204>>2]|0)>=(c[d+204>>2]|0))break;b=c[d+200>>2]|0;}a=c[f+200>>2]|0;}return a|0}function jk(a){a=a|0;return (jC(a)|0)==0|0}function kk(a,b){a=a|0;b=b|0;c[(c[a+16>>2]|0)+200>>2]=b;Lj(b,a);Kj(b,a);return}function lk(b){b=b|0;var c=0;b=QA(b,87171)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0)if(s2(b,87181)|0)if(s2(b,87185)|0)if(s2(b,87192)|0)if(s2(b,87196)|0)if(!(s2(b,87176)|0))b=1;else c=8;else b=5;else b=4;else b=3;else b=2;else c=8;if((c|0)==8)b=6;return b|0}function mk(a){a=a|0;var b=0,c=0;c=jC(a)|0;a:do if(!c)b=0;else {b=Yj(c)|0;while(1){c=kC(a,c)|0;if(!c)break a;nk(b,c)|0;}}while(0);return b|0}function nk(a,b){a=a|0;b=b|0;if(b){a=Yj(a)|0;c[(c[(Yj(b)|0)+16>>2]|0)+152>>2]=a;}return a|0}function ok(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87230,c[d>>2]|0,1)|0;return}function pk(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87397,c[d+4>>2]|0,1)|0;return}function qk(a,b,d){a=a|0;b=b|0;d=d|0;TC(b,87382,c[d+8>>2]|0,1)|0;return}function rk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+240|0;m=p+120|0;n=p;c[47193]=GA(b,2,87412,0)|0;k=GA(b,2,87421,0)|0;c[47194]=k;a:do if((k|0)!=0|(c[47193]|0)!=0){k=jC(b)|0;while(1){if(!k)break a;j=0;d=0;i=aB(b,k)|0;while(1){if(!i){f=0;break}e=c[i>>2]|0;g=e&3;f=c[((g|0)==2?i:i+-48|0)+40>>2]|0;h=i+48|0;b:do if((f|0)!=(c[((g|0)==3?i:h)+40>>2]|0)){g=c[47193]|0;do if((f|0)==(k|0)&(g|0)!=0){f=RA(i,g)|0;if(!(a[f>>0]|0)){e=c[i>>2]|0;break}else {e=j;d=sk(m,d,k,i,f)|0;break b}}while(0);f=c[47194]|0;if((f|0?(c[((e&3|0)==3?i:h)+40>>2]|0)==(k|0):0)?(o=RA(i,f)|0,(a[o>>0]|0)!=0):0)e=sk(n,j,k,i,o)|0;else e=j;}else e=j;while(0);j=e;i=bB(b,i,k)|0;}while(1){if((f|0)>=(d|0)){e=0;break}e=m+(f*24|0)+4|0;if((c[m+(f*24|0)+8>>2]|0)>1)tk(k,e);e=c[e>>2]|0;if(e|0)U1(e);f=f+1|0;}while(1){if((e|0)>=(j|0))break;d=n+(e*24|0)+4|0;if((c[n+(e*24|0)+8>>2]|0)>1)tk(k,d);d=c[d>>2]|0;if(d|0)U1(d);e=e+1|0;}k=kC(b,k)|0;}}while(0);l=p;return}function sk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;p=l;l=l+16|0;k=p;m=p+12|0;n=p+8|0;o=0;while(1){if((o|0)>=(d|0)){j=10;break}j=c[b+(o*24|0)>>2]|0;if((a[j>>0]|0)==(a[g>>0]|0)?(s2(j,g)|0)==0:0){j=5;break}o=o+1|0;}do if((j|0)==5){k=b+(o*24|0)+4|0;j=c[k>>2]|0;if(!j){j=b+(o*24|0)+8|0;g=j;j=KK((c[j>>2]<<2)+8|0)|0;}else {q=b+(o*24|0)+8|0;g=q;j=MK(j,(c[q>>2]<<2)+8|0)|0;}c[k>>2]=j;r=c[g>>2]|0;q=r+1|0;c[g>>2]=q;c[j+(r<<2)>>2]=f;c[(c[k>>2]|0)+(q<<2)>>2]=0;j=13;}else if((j|0)==10)if((d|0)>4){r=KB(e)|0;c[k>>2]=5;c[k+4>>2]=r;gA(1,87430,k)|0;break}else {s=b+(o*24|0)+8|0;c[s>>2]=0;k=JK(8)|0;r=b+(o*24|0)+4|0;c[r>>2]=k;q=c[s>>2]|0;j=q+1|0;c[s>>2]=j;c[k+(q<<2)>>2]=f;c[(c[r>>2]|0)+(j<<2)>>2]=0;c[b+(o*24|0)>>2]=g;c[b+(o*24|0)+12>>2]=0;h[b+(o*24|0)+16>>3]=0.0;d=d+1|0;j=13;break}while(0);if((j|0)==13){HH(f,m,n);j=(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)==(e|0)?c[n>>2]|0:c[m>>2]|0;if(j){r=b+(o*24|0)+12|0;s=c[r>>2]|0;c[r>>2]=s+1;if(!s)i=+LH(f,j);else i=0.0;h[b+(o*24|0)+16>>3]=i;}}l=p;return d|0}function tk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0;x=l;l=l+80|0;t=x+68|0;u=x+64|0;r=x;v=d+4|0;n=c[v>>2]|0;w=b+16|0;i=0;p=0.0;q=0.0;while(1){if((i|0)>=(n|0))break;f=c[(c[d>>2]|0)+(i<<2)>>2]|0;g=c[f>>2]&3;e=c[((g|0)==2?f:f+-48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((g|0)==3?f:f+48|0)+40>>2]|0;g=c[e+16>>2]|0;s=c[w>>2]|0;k=+h[g+16>>3]-+h[s+16>>3];m=+h[g+24>>3]-+h[s+24>>3];o=+L2(k,m);i=i+1|0;p=k/o+p;q=m/o+q;}j=+L2(p,q);s=c[w>>2]|0;k=+h[s+16>>3];m=+h[s+24>>3];y=+h[s+96>>3]+ +h[s+88>>3];o=+h[s+80>>3];s=y>o+ +(c[(c[(xC(b)|0)+16>>2]|0)+252>>2]|0);e=c[w>>2]|0;if(s)o=+h[e+96>>3]+ +h[e+88>>3];else {o=+h[e+80>>3];o=o+ +(c[(c[(xC(b)|0)+16>>2]|0)+252>>2]|0);e=c[w>>2]|0;}y=+h[e+16>>3]+o*(p/j);j=+h[e+24>>3]+o*(q/j);h[r>>3]=k;n=r+8|0;h[n>>3]=m;h[r+16>>3]=(y+k*2.0)*.3333333333333333;h[r+24>>3]=(j+m*2.0)*.3333333333333333;h[r+32>>3]=(y*2.0+k)*.3333333333333333;h[r+40>>3]=(j*2.0+m)*.3333333333333333;h[r+48>>3]=y;h[r+56>>3]=j;aO(b,r);s=c[w>>2]|0;j=+h[r>>3]-+h[s+16>>3];k=+h[n>>3]-+h[s+24>>3];j=+(~~(j+(j>=0.0?.5:-.5))|0);k=+(~~(k+(k>=0.0?.5:-.5))|0);y=+h[s+88>>3];s=~~((y+j)*256.0/(+h[s+96>>3]+y))&255;r=0;while(1){if((r|0)>=(c[v>>2]|0))break;n=c[(c[d>>2]|0)+(r<<2)>>2]|0;HH(n,t,u);while(1){if(!n)break;else g=n;while(1){if(!g){i=n;break}e=c[g>>2]|0;i=g+-48|0;if((c[((e&3|0)==2?g:i)+40>>2]|0)==(b|0)){e=c[g+16>>2]|0;h[e+56>>3]=j;h[e+64>>3]=k;h[e+72>>3]=0.0;c[e+80>>2]=0;a[e+84>>0]=1;a[e+85>>0]=0;a[e+86>>0]=0;a[e+87>>0]=0;a[e+88>>0]=s;a[e+89>>0]=0;c[e+92>>2]=0;e=c[g>>2]|0;}f=g+16|0;if((c[((e&3|0)==3?g:g+48|0)+40>>2]|0)==(b|0)){e=c[f>>2]|0;h[e+16>>3]=j;h[e+24>>3]=k;h[e+32>>3]=0.0;c[e+40>>2]=0;a[e+44>>0]=1;a[e+45>>0]=0;a[e+46>>0]=0;a[e+47>>0]=0;a[e+48>>0]=s;a[e+49>>0]=0;c[e+52>>2]=0;}if((a[(c[f>>2]|0)+112>>0]|0)!=1){g=0;continue}e=c[(c[((c[g>>2]&3|0)==2?g:i)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){g=0;continue}if((c[e+184>>2]|0)!=1){g=0;continue}g=c[c[e+180>>2]>>2]|0;}while(1){if(!i)break;e=c[i>>2]|0;if((c[((e&3|0)==2?i:i+-48|0)+40>>2]|0)==(b|0)){e=c[i+16>>2]|0;h[e+56>>3]=j;h[e+64>>3]=k;h[e+72>>3]=0.0;c[e+80>>2]=0;a[e+84>>0]=1;a[e+85>>0]=0;a[e+86>>0]=0;a[e+87>>0]=0;a[e+88>>0]=s;a[e+89>>0]=0;c[e+92>>2]=0;e=c[i>>2]|0;}f=i+48|0;g=i+16|0;if((c[((e&3|0)==3?i:f)+40>>2]|0)==(b|0)){e=c[g>>2]|0;h[e+16>>3]=j;h[e+24>>3]=k;h[e+32>>3]=0.0;c[e+40>>2]=0;a[e+44>>0]=1;a[e+45>>0]=0;a[e+46>>0]=0;a[e+47>>0]=0;a[e+48>>0]=s;a[e+49>>0]=0;c[e+52>>2]=0;}if((a[(c[g>>2]|0)+112>>0]|0)!=1){i=0;continue}e=c[(c[((c[i>>2]&3|0)==3?i:f)+40>>2]|0)+16>>2]|0;if((a[e+156>>0]|0)!=1){i=0;continue}if((c[e+176>>2]|0)!=1){i=0;continue}i=c[c[e+172>>2]>>2]|0;}n=c[(c[n+16>>2]|0)+172>>2]|0;}r=r+1|0;}a[(c[w>>2]|0)+145>>0]=1;l=x;return}function uk(a){a=a|0;var b=0,d=0,e=0;ih(a);b=c[a>>2]&3;d=a+-48|0;e=a+48|0;b=dh(c[((b|0)==2?a:d)+40>>2]|0,c[((b|0)==3?a:e)+40>>2]|0)|0;if(!b){b=c[a>>2]&3;nh(c[((b|0)==2?a:d)+40>>2]|0,c[((b|0)==3?a:e)+40>>2]|0,a)|0;}else vh(a,b);return}function vk(b){b=b|0;var d=0,e=0,f=0,g=0;f=b+16|0;e=0;while(1){b=c[f>>2]|0;if((e|0)>=(c[b+220>>2]|0))break;d=c[(c[b+216>>2]|0)+(e<<2)>>2]|0;c[b+192>>2]=d;b=d;d=b;while(1){if(!d)break;g=c[d+16>>2]|0;a[g+157>>0]=0;d=c[g+164>>2]|0;}while(1){if(!b)break;wk(b);b=c[(c[b+16>>2]|0)+164>>2]|0;}e=e+1|0;}return}function wk(b){b=b|0;var d=0,e=0,f=0,g=0;g=b+16|0;d=c[g>>2]|0;b=d+157|0;if(!(a[b>>0]|0)){a[b>>0]=1;a[d+158>>0]=1;b=0;while(1){f=c[(c[d+180>>2]|0)+(b<<2)>>2]|0;if(!f)break;d=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;e=c[d+16>>2]|0;if(!(a[e+158>>0]|0)){if(!(a[e+157>>0]|0))wk(d);}else {uk(f);b=b+-1|0;}b=b+1|0;d=c[g>>2]|0;}a[d+158>>0]=0;}return}function xk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=jC(a)|0;b=0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;g=c[d>>2]&3;h=c[(c[(c[((g|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;g=c[(c[(c[((g|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;f=h-g|0;d=ZA(a,d)|0;b=((h|0)==(g|0)?0:((f|0)>-1?f:0-f|0)+-1|0)+b|0;}e=kC(a,e)|0;}return b|0}function yk(b){b=b|0;var d=0,e=0,f=0,g=0;e=jC(b)|0;while(1){if(!e)break;g=c[e+16>>2]|0;f=c[g+176>>2]|0;g=g+172|0;d=0;while(1){if((d|0)>=(f|0))break;a[(c[(c[(c[g>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+112>>0]=0;d=d+1|0;}e=kC(b,e)|0;}return}function zk(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;o=q;j=c[b+24>>2]|0;Ak(a);k=(j|0)==-1;m=b+8|0;i=k^1;n=c[15712]|0;f=1797693134862315708145274.0e284;g=0;while(1){if(!(k|(g|0)<(j|0)))break;d=jC(a)|0;while(1){if(!d)break;c[(c[d+16>>2]|0)+232>>2]=0;d=kC(a,d)|0;}wj(a);e=+Bk(a);h[m>>3]=e;if(0);if(!(!(e<=+h[b>>3])&(!(f<=e)|i))){p=9;break}Ck(a);f=e;g=g+1|0;}if((p|0)==9){p=b+20|0;c[b+16>>2]=c[p>>2];c[p>>2]=g;}wj(a);Dk(a);Ek();h[m>>3]=+Bk(a);l=q;return}function Ak(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0;c[46752]=KK((tB(a)|0)*24|0)|0;c[46751]=0;b=jC(a)|0;while(1){if(!b)break;c[(c[b+16>>2]|0)+120>>2]=-1;b=kC(a,b)|0;}i=jC(a)|0;while(1){if(!i)break;j=i+16|0;do if(!(c[(c[j>>2]|0)+216>>2]|0)){f=JK(4)|0;g=c[46752]|0;k=c[46751]|0;c[g+(k*24|0)>>2]=f;c[f>>2]=i;c[g+(k*24|0)+4>>2]=1;j=c[j>>2]|0;h[g+(k*24|0)+8>>3]=+h[j+32>>3];h[g+(k*24|0)+16>>3]=+h[j+40>>3];c[j+120>>2]=k;c[46751]=k+1;}else {g=fP(i)|0;k=g+16|0;b=c[k>>2]|0;d=c[b+120>>2]|0;if((d|0)>-1){g=c[46752]|0;f=c[g+(d*24|0)>>2]|0;e=g+(d*24|0)+4|0;k=c[e>>2]|0;c[e>>2]=k+1;c[f+(k<<2)>>2]=i;k=c[j>>2]|0;j=g+(d*24|0)+8|0;h[j>>3]=+h[j>>3]+ +h[k+32>>3];j=g+(d*24|0)+16|0;l=+h[j>>3];m=+h[k+40>>3];h[j>>3]=l>2]=d;break}d=JK(c[b+216>>2]<<2)|0;e=c[46752]|0;f=c[46751]|0;b=e+(f*24|0)|0;c[b>>2]=d;c[d>>2]=g;if((g|0)==(i|0)){h[e+(f*24|0)+8>>3]=+h[(c[k>>2]|0)+32>>3];d=1;b=i;}else {c[(c[b>>2]|0)+4>>2]=i;n=c[k>>2]|0;b=c[j>>2]|0;h[e+(f*24|0)+8>>3]=+h[b+32>>3]+ +h[n+32>>3];d=2;b=+h[n+40>>3]<+h[b+40>>3]?i:g;}c[e+(f*24|0)+4>>2]=d;h[e+(f*24|0)+16>>3]=+h[(c[b+16>>2]|0)+40>>3];c[(c[k>>2]|0)+120>>2]=f;c[(c[j>>2]|0)+120>>2]=f;c[46751]=f+1;}while(0);i=kC(a,i)|0;}return}function Bk(a){a=a|0;var b=0.0,d=0.0,e=0,f=0,g=0,i=0.0,j=0.0;Dk(a);g=c[46749]|0;e=c[a+16>>2]|0;b=+(O(c[e+252>>2]|0,g+-1|0)|0);f=c[46750]|0;e=e+248|0;a=0;d=0.0;while(1){if((a|0)>=(g|0))break;i=+h[f+(a*40|0)+24>>3]+ +(O(c[e>>2]|0,c[f+(a*40|0)+16>>2]|0)|0);j=+h[f+(a*40|0)+32>>3]+b;a=a+1|0;b=j;d=d=(tB(a)|0))break;c[(c[46753]|0)+(b<<2)>>2]=b;b=b+1|0;}Dk(a);Fk(a);Gk(a);return}function Dk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0,k=0,l=0;c[46749]=0;b=c[46750]|0;if(b|0){e=0;while(1){if((e|0)>=(c[46751]|0))break;d=c[b+(e*40|0)+4>>2]|0;if(d){U1(d);b=c[46750]|0;}d=c[b+(e*40|0)+8>>2]|0;if(d){U1(d);b=c[46750]|0;}e=e+1|0;}U1(b);}c[46750]=JK((c[46751]|0)*40|0)|0;b=0;while(1){d=c[46751]|0;if((b|0)>=(d|0))break;k=JK(d<<2)|0;c[(c[46750]|0)+(b*40|0)+4>>2]=k;k=JK(c[46751]<<2)|0;l=c[46750]|0;c[l+(b*40|0)+8>>2]=k;c[l+(b*40|0)>>2]=b;c[l+(b*40|0)+12>>2]=0;c[l+(b*40|0)+16>>2]=0;l=l+(b*40|0)+24|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;b=b+1|0;}e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;i=c[d>>2]|0;f=d+-48|0;g=c[46750]|0;b=c[(c[(c[((i&3|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;while(1){b=b+1|0;if((b|0)>=(c[(c[(c[((i&3|0)==2?d:f)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;i=g+(b*40|0)+16|0;c[i>>2]=(c[i>>2]|0)+1;i=c[d>>2]|0;}d=ZA(a,d)|0;}e=kC(a,e)|0;}i=c[46751]|0;k=c[46752]|0;l=c[46750]|0;d=a+16|0;b=0;while(1){if((b|0)>=(i|0))break;e=(c[c[k+(b*24|0)>>2]>>2]|0)+16|0;f=c[(c[e>>2]|0)+232>>2]|0;if((f|0)>=(c[46749]|0))c[46749]=f+1;g=l+(f*40|0)+24|0;j=+h[g>>3];h[g>>3]=j+ +h[k+(b*24|0)+8>>3]*72.0+(j>0.0?+(c[(c[d>>2]|0)+248>>2]|0):0.0);g=l+(f*40|0)+32|0;j=+h[k+(b*24|0)+16>>3]*72.0;if(+h[g>>3]>3]=j;c[(c[l+(f*40|0)+4>>2]|0)+(c[l+(f*40|0)+12>>2]<<2)>>2]=k+(b*24|0);a=l+((c[(c[e>>2]|0)+232>>2]|0)*40|0)+12|0;c[a>>2]=(c[a>>2]|0)+1;b=b+1|0;}return}function Ek(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=c[46749]|0;l=c[46750]|0;j=0;b=0;a=0;while(1){if((j|0)>=(k|0))break;d=l+(j*40|0)|0;i=c[l+(j*40|0)+12>>2]|0;e=(b|0)==0;a:do if(i)if(!e){if((c[d>>2]|0)>(a|0)){f=l+(j*40|0)+4|0;d=0;while(1){if((d|0)>=(i|0))break a;g=c[(c[f>>2]|0)+(d<<2)>>2]|0;h=c[g+4>>2]|0;e=0;while(1){if((e|0)>=(h|0))break;m=(c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0)+232|0;c[m>>2]=(c[m>>2]|0)-b;e=e+1|0;}d=d+1|0;}}}else b=0;else {if(e)a=c[d>>2]|0;b=b+1|0;}while(0);j=j+1|0;}return}function Fk(a){a=a|0;var b=0;b=c[46753]|0;o4(b,tB(a)|0,4,63);return}function Gk(b){b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0;j=c[46749]|0;k=c[46750]|0;g=c[46753]|0;i=0;while(1){if((i|0)>=(j|0)){e=0;d=0.0;break}e=c[g+(i<<2)>>2]|0;f=i+1|0;if((c[k+(e*40|0)+12>>2]|0)<2)i=f;else {l=4;break}}if((l|0)==4)if((j|0)>(f|0))d=+h[k+((c[g+(f<<2)>>2]|0)*40|0)+24>>3];else d=0.0;a:do if((i|0)!=(j|0)){o4(c[k+(e*40|0)+4>>2]|0,c[k+(e*40|0)+12>>2]|0,4,64);g=c[46750]|0;r=+h[g+(e*40|0)+24>>3];r=!(d<=r*.25)&!(d>=r*.75)?d:r*.5;s=c[g+(e*40|0)+12>>2]|0;q=b+16|0;n=0;o=0;d=0.0;f=0;p=0;while(1){if((p|0)>=(f+s|0))break a;do if(!(c[(c[g+(e*40|0)+8>>2]|0)+(p<<2)>>2]|0)){l=c[(c[g+(e*40|0)+4>>2]|0)+(p<<2)>>2]|0;b=l+8|0;m=+h[b>>3]*72.0+d+(d>0.0?+(c[(c[q>>2]|0)+248>>2]|0):0.0);i=(o|0)!=0;if(!(i&!(m<=r))){j=i?n:l;i=i?o:1;d=m;break}j=n+4|0;k=l+4|0;i=0;while(1){if((i|0)<(c[j>>2]|0))g=0;else break;while(1){if((g|0)>=(c[k>>2]|0))break;a[(c[(nh(c[(c[n>>2]|0)+(i<<2)>>2]|0,c[(c[l>>2]|0)+(g<<2)>>2]|0,0)|0)+16>>2]|0)+112>>0]=1;g=g+1|0;}i=i+1|0;}g=c[46750]|0;c[(c[g+(e*40|0)+8>>2]|0)+(p<<2)>>2]=1;j=g+(e*40|0)+12|0;c[j>>2]=(c[j>>2]|0)+-1;j=g+(e*40|0)+16|0;c[j>>2]=(c[j>>2]|0)+1;j=g+(e*40|0)+24|0;h[j>>3]=+h[b>>3]*-72.0-+(c[(c[q>>2]|0)+248>>2]|0)+ +h[j>>3];j=n;i=o;}else {j=n;i=o;f=f+1|0;}while(0);n=j;o=i;p=p+1|0;}}while(0);return}function Hk(a,b){a=a|0;b=b|0;a=Ik(c[a>>2]|0)|0;b=Ik(c[b>>2]|0)|0;return ((b|0)<(a|0)&1)-((b|0)>(a|0)&1)|0}function Ik(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+4|0;d=0;b=0;while(1){if((d|0)>=(c[f>>2]|0))break;e=c[(c[a>>2]|0)+(d<<2)>>2]|0;g=xC(e)|0;e=XA(g,e)|0;while(1){if(!e)break;e=ZA(g,e)|0;b=b+1|0;}d=d+1|0;}return b|0}function Jk(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[46750]|0;e=+h[f+((c[b>>2]|0)*40|0)+24>>3];d=+h[f+((c[a>>2]|0)*40|0)+24>>3];return (e>d&1)-(e>2]|0)+216>>2]=0;b=kC(a,b)|0;}return}function Lk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+32|0;f=g+16|0;e=g+8|0;d=g+20|0;c[d>>2]=5;a=QA(a,99605)|0;if(a|0?(c[e>>2]=g,c[e+4>>2]=d,(b5(a,87497,e)|0)>=1):0)gA(0,87504,f)|0;c[b+24>>2]=0;c[b+32>>2]=0;l=g;return 0}function Mk(b){b=b|0;var d=0,e=0;d=c[47189]|0;if((((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0)?(dP(e)|0)<<24>>24==0:0)b=1;else b=0;return b|0}function Nk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;gl(a);b=jC(a)|0;while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;do if(((c[(c[d+16>>2]|0)+172>>2]|0)==0?(Mk(d)|0)==0:0)?(e=d+48|0,f=fP(c[((c[d>>2]&3|0)==3?d:e)+40>>2]|0)|0,g=d+-48|0,h=fP(c[((c[d>>2]&3|0)==2?d:g)+40>>2]|0)|0,(f|0)!=(h|0)):0){if((c[(c[f+16>>2]|0)+212>>2]|0)==0?(c[(c[h+16>>2]|0)+212>>2]|0)==0:0){i=dh(f,h)|0;if(!i){nh(f,h,d)|0;break}else {vh(d,i);break}}i=c[d>>2]&3;Ok(a,c[((i|0)==3?d:e)+40>>2]|0,c[((i|0)==2?d:g)+40>>2]|0,d);}while(0);d=ZA(a,d)|0;}b=kC(a,b)|0;}return}function Ok(b,d,f,g){b=b|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=c[g>>2]&3;h=c[(c[((j|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0;i=c[h+212>>2]|0;if(!i)k=0;else k=(c[h+232>>2]|0)-(c[(c[(c[(c[i+16>>2]|0)+264>>2]|0)+16>>2]|0)+232>>2]|0)|0;h=c[(c[((j|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0;i=c[h+212>>2]|0;if(!i)h=0;else h=(c[(c[(c[(c[i+16>>2]|0)+264>>2]|0)+16>>2]|0)+232>>2]|0)-(c[h+232>>2]|0)|0;j=g+16|0;k=h+k+(e[(c[j>>2]|0)+170>>1]|0)|0;b=sh(b)|0;a[(c[b+16>>2]|0)+156>>0]=2;i=fP(d)|0;d=fP(f)|0;f=Zi(b,i,(k|0)>0?0.0:+(0-k|0),(c[(c[j>>2]|0)+156>>2]|0)*10|0)|0;c[(c[(Zi(b,d,+(((k|0)>0?k:0)|0),c[(c[j>>2]|0)+156>>2]|0)|0)+16>>2]|0)+116>>2]=g;c[(c[f+16>>2]|0)+116>>2]=g;return}function Pk(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=c[d>>2]&3;i=(j|0)==3?d:d+48|0;j=(j|0)==2?d:d+-48|0;j=c[(c[(c[((c[(c[(c[i+40>>2]|0)+16>>2]|0)+232>>2]|0)>(c[(c[(c[j+40>>2]|0)+16>>2]|0)+232>>2]|0)?i:j)+40>>2]|0)+16>>2]|0)+232>>2]|0;i=d+16|0;d=(c[i>>2]|0)+172|0;if(c[d>>2]|0)qa(87593,87615,148,87624);c[d>>2]=f;h=(g|0)==0;do{d=c[i>>2]|0;if(h)g=c[f+16>>2]|0;else {g=c[f+16>>2]|0;k=g+168|0;b[k>>1]=(e[k>>1]|0)+(e[d+168>>1]|0);}k=g+154|0;b[k>>1]=(e[k>>1]|0)+(e[d+154>>1]|0);g=g+156|0;c[g>>2]=(c[g>>2]|0)+(c[d+156>>2]|0);d=f+-48|0;g=c[((c[f>>2]&3|0)==2?f:d)+40>>2]|0;if((c[(c[g+16>>2]|0)+232>>2]|0)==(j|0))break;Qk(a,g);f=c[c[(c[(c[((c[f>>2]&3|0)==2?f:d)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((f|0)!=0);return}function Qk(a,b){a=a|0;b=b|0;var d=0.0;d=+((c[(c[a+16>>2]|0)+248>>2]|0)/2|0|0);b=c[b+16>>2]|0;a=b+88|0;h[a>>3]=+h[a>>3]+d;b=b+96|0;h[b>>3]=+h[b>>3]+d;return}function Rk(a,b){a=a|0;b=b|0;var d=0,e=0;if(((((a|0)!=0&(b|0)!=0?(e=c[a>>2]&3,d=c[b>>2]&3,(c[((e|0)==3?a:a+48|0)+40>>2]|0)==(c[((d|0)==3?b:b+48|0)+40>>2]|0)):0)?(c[((e|0)==2?a:a+-48|0)+40>>2]|0)==(c[((d|0)==2?b:b+-48|0)+40>>2]|0):0)?(c[(c[a+16>>2]|0)+96>>2]|0)==(c[(c[b+16>>2]|0)+96>>2]|0):0)?(uj(a,b)|0)!=0:0)a=1;else a=0;return a|0}function Sk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=b+16|0;d=c[r>>2]|0;c[d+192>>2]=0;c[d+232>>2]=0;gl(b);d=1;while(1){e=c[r>>2]|0;if((d|0)>(c[e+180>>2]|0))break;hl(b,c[(c[e+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}h=jC(b)|0;while(1){if(!h)break;g=XA(b,h)|0;while(1){if(!g)break;d=c[g>>2]|0;e=(c[(c[((d&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+160|0;f=a[e>>0]|0;if(f<<24>>24<3){a[e>>0]=f+1<<24>>24;d=c[g>>2]|0;}d=(c[(c[((d&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+160|0;e=a[d>>0]|0;if(e<<24>>24<3)a[d>>0]=e+1<<24>>24;g=ZA(b,g)|0;}h=kC(b,h)|0;}m=jC(b)|0;while(1){if(!m)break;if((c[(c[m+16>>2]|0)+212>>2]|0)==0?(m|0)==(fP(m)|0):0){oh(b,m);l=(c[r>>2]|0)+232|0;c[l>>2]=(c[l>>2]|0)+1;}d=0;l=XA(b,m)|0;while(1){if(!l)break;k=l+16|0;h=c[k>>2]|0;a:do if(!(c[h+172>>2]|0)){if(Tk(l)|0){if(!(Rk(d,l)|0)){Uk(b,l);d=l;break}e=c[(c[d+16>>2]|0)+172>>2]|0;if(e|0){Pk(b,l,e,0);jh(l);break}k=c[l>>2]&3;if((c[(c[(c[((k|0)==3?l:l+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)!=(c[(c[(c[((k|0)==2?l:l+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;vh(l,d);jh(l);break}if(d){i=c[l>>2]&3;e=l+48|0;f=c[((i|0)==3?l:e)+40>>2]|0;g=c[d>>2]&3;if((f|0)==(c[((g|0)==3?d:d+48|0)+40>>2]|0)?(n=c[((i|0)==2?l:l+-48|0)+40>>2]|0,(n|0)==(c[((g|0)==2?d:d+-48|0)+40>>2]|0)):0){if((c[(c[f+16>>2]|0)+232>>2]|0)==(c[(c[n+16>>2]|0)+232>>2]|0)){vh(l,d);jh(l);break}if(((c[h+96>>2]|0)==0?(o=d+16|0,(c[(c[o>>2]|0)+96>>2]|0)==0):0)?(uj(l,d)|0)!=0:0)if(!(a[194954]|0)){Pk(b,l,c[(c[o>>2]|0)+172>>2]|0,1);jh(l);break}else {a[(c[k>>2]|0)+112>>0]=6;break}else i=e;}else i=e;}else i=l+48|0;h=c[l>>2]&3;e=c[((h|0)==3?l:i)+40>>2]|0;j=l+-48|0;if((e|0)==(c[((h|0)==2?l:j)+40>>2]|0)){jh(l);d=l;break}e=fP(e)|0;f=fP(c[((c[l>>2]&3|0)==2?l:j)+40>>2]|0)|0;h=c[l>>2]&3;if((c[((h|0)==3?l:i)+40>>2]|0)==(e|0)?(c[((h|0)==2?l:j)+40>>2]|0)==(f|0):0){g=c[(c[e+16>>2]|0)+232>>2]|0;h=c[(c[f+16>>2]|0)+232>>2]|0;if((g|0)==(h|0)){th(b,l);d=l;break}if((h|0)>(g|0)){Vk(b,e,f,l);d=l;break}e=iB(b,f,e,0,0)|0;do if(e|0?(p=c[e>>2]&3,q=c[((p|0)==2?e:e+-48|0)+40>>2]|0,(q|0)!=(c[((c[l>>2]&3|0)==2?l:j)+40>>2]|0)):0){f=e+16|0;if(!(c[(c[f>>2]|0)+172>>2]|0))Vk(b,c[((p|0)==3?e:e+48|0)+40>>2]|0,q,e);if((c[(c[k>>2]|0)+96>>2]|0)==0?(c[(c[f>>2]|0)+96>>2]|0)==0:0){if(!(uj(l,e)|0))break;if(!(a[194954]|0)){jh(l);Pk(b,l,c[(c[f>>2]|0)+172>>2]|0,1);break a}else {a[(c[k>>2]|0)+112>>0]=6;a[(c[f>>2]|0)+153>>0]=1;break a}}}while(0);d=c[l>>2]&3;Vk(b,c[((d|0)==2?l:j)+40>>2]|0,c[((d|0)==3?l:i)+40>>2]|0,l);d=l;}}else d=l;while(0);l=ZA(b,l)|0;}m=kC(b,m)|0;}if((gg(b)|0)!=(b|0)){d=c[(c[r>>2]|0)+216>>2]|0;if(!d)d=KK(4)|0;else d=MK(d,4)|0;r=c[r>>2]|0;c[r+216>>2]=d;c[d>>2]=c[r+192>>2];}return}function Tk(b){b=b|0;var d=0;d=c[b>>2]&3;if((a[(c[(c[((d|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+159>>0]|0)==7)b=1;else b=(a[(c[(c[((d|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+159>>0]|0)==7&1;return b|0}function Uk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;f=Yk(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;g=Yk(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;i=(c[(c[f+16>>2]|0)+232>>2]|0)>(c[(c[g+16>>2]|0)+232>>2]|0);e=i?f:g;f=i?g:f;g=f+16|0;i=e+16|0;a:do if((c[(c[g>>2]|0)+212>>2]|0)!=(c[(c[i>>2]|0)+212>>2]|0)){h=dh(f,e)|0;if(h|0){Pk(b,d,h,1);break}if((c[(c[g>>2]|0)+232>>2]|0)!=(c[(c[i>>2]|0)+232>>2]|0)){Vk(b,f,e,d);e=(c[d+16>>2]|0)+172|0;while(1){e=c[e>>2]|0;if(!e)break a;f=e+-48|0;if((c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+232>>2]|0)>(c[(c[i>>2]|0)+232>>2]|0))break a;a[(c[e+16>>2]|0)+112>>0]=5;e=c[(c[(c[((c[e>>2]&3|0)==2?e:f)+40>>2]|0)+16>>2]|0)+180>>2]|0;}}}while(0);return}function Vk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=e+16|0;f=c[k>>2]|0;if(!(c[f+96>>2]|0))j=-1;else j=((c[(c[d+16>>2]|0)+232>>2]|0)+(c[(c[b+16>>2]|0)+232>>2]|0)|0)/2|0;if(c[f+172>>2]|0)qa(87636,87615,89,87661);i=d+16|0;h=c[(c[b+16>>2]|0)+232>>2]|0;while(1){g=h+1|0;f=c[(c[i>>2]|0)+232>>2]|0;if((h|0)>=(f|0))break;if((g|0)<(f|0)){if((g|0)==(j|0))f=Wk(a,e)|0;else f=Xk(a)|0;c[(c[f+16>>2]|0)+232>>2]=g;}else f=d;Ii(nh(b,f,e)|0);h=g;b=f;}if(!(c[(c[k>>2]|0)+172>>2]|0))qa(87672,87615,103,87661);else return}function Wk(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0.0;i=d+16|0;g=c[(c[i>>2]|0)+96>>2]|0;e=+h[g+24>>3];f=+h[g+32>>3];g=sh(b)|0;d=g+16|0;c[(c[d>>2]|0)+104>>2]=c[(c[i>>2]|0)+96>>2];j=+(c[(c[(yC(g)|0)+16>>2]|0)+248>>2]|0);h[(c[d>>2]|0)+88>>3]=j;if(!(a[(c[i>>2]|0)+114>>0]|0)){b=(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;i=c[d>>2]|0;h[i+80>>3]=b?f:e;h[i+96>>3]=b?e:f;}return g|0}function Xk(a){a=a|0;var b=0;b=sh(a)|0;Qk(a,b);return b|0}function Yk(b){b=b|0;var d=0;d=c[b+16>>2]|0;if((a[d+159>>0]|0)==7)b=c[(c[(c[(c[d+212>>2]|0)+16>>2]|0)+268>>2]|0)+(c[d+232>>2]<<2)>>2]|0;else b=fP(b)|0;return b|0}function Zk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;j=gg(a)|0;h=jC(a)|0;while(1){if(!h)break;b=aB(j,h)|0;i=0;while(1){if(!b)break;l=bB(j,b,h)|0;if(HC(a,b)|0){k=i;b=l;i=k;continue}k=(c[b>>2]&3|0)==2?b:b+-48|0;m=(Rk(i,k)|0)==0;e=c[k>>2]&3;b=c[((e|0)==3?k:k+48|0)+40>>2]|0;d=c[(c[b+16>>2]|0)+232>>2]|0;e=c[((e|0)==2?k:k+-48|0)+40>>2]|0;f=c[(c[e+16>>2]|0)+232>>2]|0;g=(d|0)==(f|0);if(!m){c[(c[k+16>>2]|0)+172>>2]=g?i:0;b=c[(c[i+16>>2]|0)+172>>2]|0;if(!b){m=i;b=l;i=m;continue}Pk(a,k,b,0);kh(k);m=i;b=l;i=m;continue}if(!g)if((f|0)>(d|0)){_k(b,e,k);b=l;i=k;continue}else {_k(e,b,k);b=l;i=k;continue}b=fh(b,e)|0;if(!b){th(j,k);b=l;i=k;continue}if((k|0)==(b|0)){m=i;b=l;i=m;continue}kh(k);if(c[(c[k+16>>2]|0)+172>>2]|0){m=i;b=l;i=m;continue}vh(k,b);m=i;b=l;i=m;}h=kC(a,h)|0;}return}function _k(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=$k(a)|0;e=$k(b)|0;al(f,e,d,c[(c[d+16>>2]|0)+172>>2]|0,(f|0)==(a|0)&(e|0)==(b|0)?1:5);return}function $k(b){b=b|0;var d=0,e=0,f=0;d=c[b+16>>2]|0;e=c[d+212>>2]|0;if((e|0)!=0?(f=c[e+16>>2]|0,(a[f+272>>0]|0)==0):0)b=c[(c[f+268>>2]|0)+(c[d+232>>2]<<2)>>2]|0;return b|0}function al(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;n=d+16|0;k=c[(c[n>>2]|0)+232>>2]|0;o=e+16|0;i=c[(c[o>>2]|0)+232>>2]|0;if((i|0)<=(k|0))qa(87697,87725,81,87735);m=c[g>>2]&3;if(!((c[((m|0)==3?g:g+48|0)+40>>2]|0)==(d|0)?(c[((m|0)==2?g:g+-48|0)+40>>2]|0)==(e|0):0))l=5;a:do if((l|0)==5){if((b[(c[g+16>>2]|0)+168>>1]|0)>1){c[(c[f+16>>2]|0)+172>>2]=0;if(((i-k|0)==1?(j=dh(d,e)|0,j|0):0)?uj(f,j)|0:0){vh(f,j);if(a[(c[n>>2]|0)+156>>0]|0)break;if(a[(c[o>>2]|0)+156>>0]|0)break;jh(f);break}m=h&255;h=d;l=c[(c[n>>2]|0)+232>>2]|0;while(1){i=c[(c[o>>2]|0)+232>>2]|0;if((l|0)>=(i|0))break a;if((l|0)<(i+-1|0)){i=gg(d)|0;j=g+-48|0;i=bl(i,c[((c[g>>2]&3|0)==2?g:j)+40>>2]|0)|0;k=g;}else {i=e;j=g+-48|0;k=g;}a[(c[(nh(h,i,f)|0)+16>>2]|0)+112>>0]=m;n=(c[g+16>>2]|0)+168|0;b[n>>1]=(b[n>>1]|0)+-1<<16>>16;h=i;l=l+1|0;g=c[c[(c[(c[((c[k>>2]&3|0)==2?g:j)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}}do if((i-k|0)==1){g=dh(d,e)|0;if(g|0?uj(f,g)|0:0){c[(c[f+16>>2]|0)+172>>2]=g;m=c[g+16>>2]|0;a[m+112>>0]=h;m=m+168|0;b[m>>1]=(b[m>>1]|0)+1<<16>>16;if(a[(c[n>>2]|0)+156>>0]|0)break;if(a[(c[o>>2]|0)+156>>0]|0)break;jh(f);break}c[(c[f+16>>2]|0)+172>>2]=0;g=nh(d,e,f)|0;a[(c[g+16>>2]|0)+112>>0]=h;}while(0);i=c[(c[o>>2]|0)+232>>2]|0;if((i-(c[(c[n>>2]|0)+232>>2]|0)|0)>1){if((c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)==(d|0))l=i;else {n=f+16|0;c[(c[n>>2]|0)+172>>2]=0;l=nh(d,c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0,f)|0;c[(c[n>>2]|0)+172>>2]=l;ih(g);g=l;l=c[(c[o>>2]|0)+232>>2]|0;}while(1){i=c[g>>2]&3;j=c[((i|0)==2?g:g+-48|0)+40>>2]|0;k=c[j+16>>2]|0;if((c[k+232>>2]|0)==(l|0))break;g=c[c[k+180>>2]>>2]|0;}if((j|0)!=(e|0)){a[(c[(nh(c[((i|0)==3?g:g+48|0)+40>>2]|0,e,f)|0)+16>>2]|0)+112>>0]=h;ih(g);}}}while(0);return}function bl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=b+16|0;b=c[d>>2]|0;e=c[b+232>>2]|0;cl(a,e,c[b+236>>2]|0,2);b=sh(a)|0;d=c[d>>2]|0;f=c[b+16>>2]|0;h[f+88>>3]=+h[d+88>>3];h[f+96>>3]=+h[d+96>>3];c[f+232>>2]=c[d+232>>2];d=(c[d+236>>2]|0)+1|0;c[f+236>>2]=d;c[(c[(c[(c[a+16>>2]|0)+196>>2]|0)+(e<<6)+4>>2]|0)+(d<<2)>>2]=b;return b|0}function cl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;h=a+16|0;f=c[(c[h>>2]|0)+196>>2]|0;i=c[f+(b<<6)+4>>2]|0;a:do if((e|0)<1){d=d-e|0;while(1){g=d+1|0;a=c[f+(b<<6)>>2]|0;if((g|0)>=(a|0))break;a=c[i+(g<<2)>>2]|0;f=d+e|0;c[(c[a+16>>2]|0)+236>>2]=f;c[i+(f<<2)>>2]=a;d=g;f=c[(c[h>>2]|0)+196>>2]|0;}g=e+-1|0;d=g+a|0;while(1){if((d|0)>=(a|0))break a;c[i+(d<<2)>>2]=0;f=c[(c[h>>2]|0)+196>>2]|0;d=d+1|0;a=c[f+(b<<6)>>2]|0;}}else {g=e+-1|0;a=c[f+(b<<6)>>2]|0;while(1){a=a+-1|0;if((a|0)<=(d|0))break;j=c[i+(a<<2)>>2]|0;f=g+a|0;c[(c[j+16>>2]|0)+236>>2]=f;c[i+(f<<2)>>2]=j;}f=e+d|0;a=d;while(1){a=a+1|0;if((a|0)>=(f|0))break;c[i+(a<<2)>>2]=0;}a=c[(c[h>>2]|0)+196>>2]|0;f=a;a=c[a+(b<<6)>>2]|0;}while(0);c[f+(b<<6)>>2]=g+a;return}function dl(a){a=a|0;var b=0;Sk(a);b=c[a+16>>2]|0;c[b+220>>2]=1;c[c[b+216>>2]>>2]=c[b+192>>2];Fi(a);ki(a,0);el(a);Zk(a);fl(a);return}function el(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=gg(d)|0;l=d+16|0;f=c[l>>2]|0;j=b[f+236>>1]|0;e=j<<16>>16;m=k+16|0;if(j<<16>>16>0)a[(c[(c[m>>2]|0)+196>>2]|0)+(e+-1<<6)+49>>0]=0;j=e;while(1){if((j|0)>(b[f+238>>1]|0))break;i=c[(c[(c[(c[f+268>>2]|0)+(j<<2)>>2]|0)+16>>2]|0)+236>>2]|0;cl(k,j,i,c[(c[f+196>>2]|0)+(j<<6)>>2]|0);g=0;h=i;while(1){f=c[l>>2]|0;e=c[f+196>>2]|0;if((g|0)>=(c[e+(j<<6)>>2]|0))break;e=c[(c[e+(j<<6)+4>>2]|0)+(g<<2)>>2]|0;c[(c[(c[(c[m>>2]|0)+196>>2]|0)+(j<<6)+4>>2]|0)+(h<<2)>>2]=e;f=c[e+16>>2]|0;c[f+236>>2]=h;if((a[f+156>>0]|0)==1)c[e+24>>2]=yC(k)|0;qh(d,e);oh(k,e);f=(c[m>>2]|0)+232|0;c[f>>2]=(c[f>>2]|0)+1;g=g+1|0;h=h+1|0;}h=c[(c[m>>2]|0)+196>>2]|0;c[e+(j<<6)+4>>2]=(c[h+(j<<6)+4>>2]|0)+(i<<2);a[h+(j<<6)+49>>0]=0;j=j+1|0;}e=c[m>>2]|0;if((j|0)<(b[e+238>>1]|0))a[(c[e+196>>2]|0)+(j<<6)+49>>0]=0;a[f+272>>0]=1;return}function fl(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+16|0;d=c[i>>2]|0;h=b[d+236>>1]|0;while(1){if((h|0)>(b[d+238>>1]|0))break;f=c[(c[d+268>>2]|0)+(h<<2)>>2]|0;g=f+16|0;while(1){d=c[g>>2]|0;e=c[c[d+180>>2]>>2]|0;if(!e)break;ih(e);}while(1){d=c[c[d+172>>2]>>2]|0;if(!d)break;ih(d);d=c[g>>2]|0;}qh(gg(a)|0,f);c[(c[(c[i>>2]|0)+268>>2]|0)+(h<<2)>>2]=0;h=h+1|0;d=c[i>>2]|0;}return}function gl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;f=jC(b)|0;while(1){if(!f)break;e=f+16|0;d=c[e>>2]|0;if((a[d+159>>0]|0)==7){hP(f);d=c[e>>2]|0;}c[d+212>>2]=0;f=kC(b,f)|0;}m=b+16|0;k=1;while(1){d=c[m>>2]|0;if((k|0)>(c[d+180>>2]|0))break;h=c[(c[d+184>>2]|0)+(k<<2)>>2]|0;i=h+16|0;d=jC(h)|0;a:while(1){if(!d)break;j=kC(h,d)|0;e=d+16|0;if(a[(c[e>>2]|0)+159>>0]|0){f=KB(d)|0;g=KB(b)|0;c[n>>2]=f;c[n+4>>2]=g;gA(0,87744,n)|0;wC(h,d)|0;d=j;continue}iP(d,c[(c[i>>2]|0)+264>>2]|0);g=c[e>>2]|0;c[g+212>>2]=h;a[g+159>>0]=7;g=XA(h,d)|0;while(1){if(!g){d=j;continue a}d=c[(c[g+16>>2]|0)+172>>2]|0;b:do if(d|0)do{e=d+-48|0;f=c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break b;c[f+212>>2]=h;d=c[c[(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);g=ZA(h,g)|0;}}k=k+1|0;}l=o;return}function hl(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=e+16|0;g=JK((b[(c[k>>2]|0)+238>>1]<<2)+8|0)|0;f=c[k>>2]|0;c[f+268>>2]=g;g=0;h=b[f+236>>1]|0;while(1){if((h|0)>(b[f+238>>1]|0))break;f=sh(d)|0;c[(c[(c[k>>2]|0)+268>>2]|0)+(h<<2)>>2]=f;j=c[f+16>>2]|0;c[j+232>>2]=h;a[j+159>>0]=7;c[j+212>>2]=e;if(g|0){j=(c[(nh(g,f,0)|0)+16>>2]|0)+154|0;b[j>>1]=(b[j>>1]|0)*1e3;}g=f;h=h+1|0;f=c[k>>2]|0;}j=jC(e)|0;while(1){f=c[k>>2]|0;if(!j)break;h=(c[(c[f+268>>2]|0)+(c[(c[j+16>>2]|0)+232>>2]<<2)>>2]|0)+16|0;f=(c[h>>2]|0)+216|0;c[f>>2]=(c[f>>2]|0)+1;f=XA(e,j)|0;while(1){if(!f)break;i=c[f>>2]|0;d=f+-48|0;g=c[(c[(c[((i&3|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0;while(1){if((g|0)>=(c[(c[(c[((i&3|0)==2?f:d)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;i=(c[(c[c[(c[h>>2]|0)+180>>2]>>2]|0)+16>>2]|0)+168|0;b[i>>1]=(b[i>>1]|0)+1<<16>>16;g=g+1|0;i=c[f>>2]|0;}f=ZA(e,f)|0;}j=kC(e,j)|0;}d=b[f+238>>1]|0;i=f+268|0;f=b[f+236>>1]|0;while(1){if((f|0)>(d|0))break;g=(c[(c[(c[i>>2]|0)+(f<<2)>>2]|0)+16>>2]|0)+216|0;h=c[g>>2]|0;if((h|0)>1)c[g>>2]=h+-1;f=f+1|0;}return}function il(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=(c[(c[e+16>>2]|0)+212>>2]|0)+16|0;e=c[k>>2]|0;j=f+1|0;if((j|0)!=(a[e+273>>0]|0)){i=b[e+236>>1]|0;while(1){h=b[e+238>>1]|0;if((i|0)>(h<<16>>16|0))break;zi(d,c[(c[e+268>>2]|0)+(i<<2)>>2]|0);i=i+1|0;e=c[k>>2]|0;}i=b[e+236>>1]|0;while(1){if((i|0)>(h<<16>>16|0))break;Ai(g,c[(c[e+268>>2]|0)+(i<<2)>>2]|0,f);d=c[k>>2]|0;i=i+1|0;h=b[d+238>>1]|0;e=d;}a[e+273>>0]=j;}return}function jl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=jC(b)|0;while(1){if(!h)break;c[(c[h+16>>2]|0)+212>>2]=0;g=XA(b,h)|0;while(1){if(!g)break;d=c[(c[g+16>>2]|0)+172>>2]|0;a:do if(d|0)do{e=d+-48|0;f=c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break a;c[f+212>>2]=0;d=c[c[(c[(c[((c[d>>2]&3|0)==2?d:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);g=ZA(b,g)|0;}h=kC(b,h)|0;}kl(b);return}function kl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=b+16|0;d=1;while(1){f=c[e>>2]|0;if((d|0)>(c[f+180>>2]|0))break;kl(c[(c[f+184>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}i=jC(b)|0;while(1){if(!i)break;d=(c[i+16>>2]|0)+212|0;if(!(c[d>>2]|0))c[d>>2]=b;h=XA(b,i)|0;while(1){if(!h)break;d=c[(c[h+16>>2]|0)+172>>2]|0;a:do if(d|0)do{e=c[d>>2]|0;g=d+-48|0;f=c[(c[((e&3|0)==2?d:g)+40>>2]|0)+16>>2]|0;if((a[f+156>>0]|0)!=1)break a;f=f+212|0;if(!(c[f>>2]|0)){c[f>>2]=b;e=c[d>>2]|0;}d=c[c[(c[(c[((e&3|0)==2?d:g)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}while((d|0)!=0);while(0);h=ZA(b,h)|0;}i=kC(b,i)|0;}return}function ll(a){a=a|0;var b=0,c=0,d=0;d=IP(a)|0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;ml(b,d);b=ZA(a,b)|0;}c=kC(a,c)|0;}Rz(d)|0;return}function ml(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+320|0;H=M+296|0;G=M+280|0;x=M+136|0;w=M+120|0;n=M+104|0;i=M+88|0;f=M+80|0;E=M+16|0;z=M;j=M+264|0;k=M+248|0;m=M+232|0;o=M+216|0;A=M+200|0;B=M+184|0;y=M+168|0;D=M+152|0;g=nl(QA(a,87798)|0,b)|0;q=nl(QA(a,87804)|0,b)|0;r=(q|0)!=0;b=(g|0)!=0;do if(b|r?(L=a+16|0,e=c[(c[L>>2]|0)+8>>2]|0,e|0):0){if((c[e+4>>2]|0)>1){K=KB(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)|0;L=KB(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)|0;c[f>>2]=K;c[f+4>>2]=L;gA(0,87810,f)|0;break}I=c[e>>2]|0;e=c[I+4>>2]|0;p=c[a>>2]&3;s=a+-48|0;t=c[((p|0)==2?a:s)+40>>2]|0;u=a+48|0;p=c[((p|0)==3?a:u)+40>>2]|0;J=KK(48)|0;v=I+12|0;c[J+12>>2]=c[v>>2];C=I+8|0;c[J+8>>2]=c[C>>2];do if(b){h=(c[g+16>>2]|0)+16|0;g=(c[t+16>>2]|0)+16|0;c[H>>2]=c[g>>2];c[H+4>>2]=c[g+4>>2];c[H+8>>2]=c[g+8>>2];c[H+12>>2]=c[g+12>>2];if(!(ol(H,h)|0)){o=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;F=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87798)|0;c[i>>2]=o;c[i+4>>2]=F;c[i+8>>2]=K;gA(0,87851,i)|0;K=26;break}b=c[I>>2]|0;c[H>>2]=c[b>>2];c[H+4>>2]=c[b+4>>2];c[H+8>>2]=c[b+8>>2];c[H+12>>2]=c[b+12>>2];if(ol(H,h)|0){F=(c[p+16>>2]|0)+16|0;c[H>>2]=c[F>>2];c[H+4>>2]=c[F+4>>2];c[H+8>>2]=c[F+8>>2];c[H+12>>2]=c[F+12>>2];if(ol(H,h)|0){o=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;F=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87798)|0;c[n>>2]=o;c[n+4>>2]=F;c[n+8>>2]=K;gA(0,87894,n)|0;K=26;break}if(!(c[C>>2]|0))qa(87936,87947,369,87958);o=I+16|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];pl(z,G,H,h);F=(c[I>>2]|0)+48|0;c[F>>2]=c[z>>2];c[F+4>>2]=c[z+4>>2];c[F+8>>2]=c[z+8>>2];c[F+12>>2]=c[z+12>>2];F=(c[I>>2]|0)+16|0;c[G>>2]=c[z>>2];c[G+4>>2]=c[z+4>>2];c[G+8>>2]=c[z+8>>2];c[G+12>>2]=c[z+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];ql(j,G,H);c[F>>2]=c[j>>2];c[F+4>>2]=c[j+4>>2];c[F+8>>2]=c[j+8>>2];c[F+12>>2]=c[j+12>>2];F=c[I>>2]|0;b=F+16|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[o>>2];c[H+4>>2]=c[o+4>>2];c[H+8>>2]=c[o+8>>2];c[H+12>>2]=c[o+12>>2];ql(k,G,H);c[F>>2]=c[k>>2];c[F+4>>2]=c[k+4>>2];c[F+8>>2]=c[k+8>>2];c[F+12>>2]=c[k+12>>2];F=c[I>>2]|0;b=F+32|0;F=F+16|0;c[G>>2]=c[F>>2];c[G+4>>2]=c[F+4>>2];c[G+8>>2]=c[F+8>>2];c[G+12>>2]=c[F+12>>2];c[H>>2]=c[z>>2];c[H+4>>2]=c[z+4>>2];c[H+8>>2]=c[z+8>>2];c[H+12>>2]=c[z+12>>2];ql(m,G,H);c[b>>2]=c[m>>2];c[b+4>>2]=c[m+4>>2];c[b+8>>2]=c[m+8>>2];c[b+12>>2]=c[m+12>>2];b=c[v>>2]|0;if(!b){F=3;break}F=(UH(a,c[I>>2]|0,0,0,J,b)|0)+3|0;break}g=e+-1|0;b=0;while(1){if((b|0)>=(g|0))break;if(rl((c[I>>2]|0)+(b<<4)|0,h)|0)break;b=b+3|0;}e=c[v>>2]|0;f=(e|0)!=0;if((b|0)==(g|0))if(f){F=J+32|0;m=I+32|0;n=(c[I>>2]|0)+(g<<4)|0;c[G>>2]=c[m>>2];c[G+4>>2]=c[m+4>>2];c[G+8>>2]=c[m+8>>2];c[G+12>>2]=c[m+12>>2];c[H>>2]=c[n>>2];c[H+4>>2]=c[n+4>>2];c[H+8>>2]=c[n+8>>2];c[H+12>>2]=c[n+12>>2];pl(o,G,H,h);c[F>>2]=c[o>>2];c[F+4>>2]=c[o+4>>2];c[F+8>>2]=c[o+8>>2];c[F+12>>2]=c[o+12>>2];F=g;break}else qa(87975,87947,387,87958);else {if(f)b=UH(a,c[I>>2]|0,0,b,J,e)|0;F=b+3|0;break}}else K=26;while(0);if((K|0)==26){b=e+-1|0;if(!(c[v>>2]|0))F=b;else {F=J+32|0;o=I+32|0;c[F>>2]=c[o>>2];c[F+4>>2]=c[o+4>>2];c[F+8>>2]=c[o+8>>2];c[F+12>>2]=c[o+12>>2];F=b;}}do if(r){f=(c[q+16>>2]|0)+16|0;r=(c[p+16>>2]|0)+16|0;c[H>>2]=c[r>>2];c[H+4>>2]=c[r+4>>2];c[H+8>>2]=c[r+8>>2];c[H+12>>2]=c[r+12>>2];if(!(ol(H,f)|0)){G=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;H=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87804)|0;c[w>>2]=G;c[w+4>>2]=H;c[w+8>>2]=K;gA(0,87986,w)|0;K=52;break}b=(c[I>>2]|0)+(F<<4)|0;c[H>>2]=c[b>>2];c[H+4>>2]=c[b+4>>2];c[H+8>>2]=c[b+8>>2];c[H+12>>2]=c[b+12>>2];if(ol(H,f)|0){E=(c[t+16>>2]|0)+16|0;c[H>>2]=c[E>>2];c[H+4>>2]=c[E+4>>2];c[H+8>>2]=c[E+8>>2];c[H+12>>2]=c[E+12>>2];if(ol(H,f)|0){G=KB(c[((c[a>>2]&3|0)==3?a:u)+40>>2]|0)|0;H=KB(c[((c[a>>2]&3|0)==2?a:s)+40>>2]|0)|0;K=QA(a,87804)|0;c[x>>2]=G;c[x+4>>2]=H;c[x+8>>2]=K;gA(0,88029,x)|0;K=52;break}if(!(c[v>>2]|0))qa(87975,87947,429,87958);x=J+32|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];pl(z,G,H,f);d=F+-3|0;E=(c[I>>2]|0)+(d<<4)|0;c[E>>2]=c[z>>2];c[E+4>>2]=c[z+4>>2];c[E+8>>2]=c[z+8>>2];c[E+12>>2]=c[z+12>>2];E=F+-1|0;b=(c[I>>2]|0)+(E<<4)|0;c[G>>2]=c[z>>2];c[G+4>>2]=c[z+4>>2];c[G+8>>2]=c[z+8>>2];c[G+12>>2]=c[z+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];ql(A,G,H);c[b>>2]=c[A>>2];c[b+4>>2]=c[A+4>>2];c[b+8>>2]=c[A+8>>2];c[b+12>>2]=c[A+12>>2];b=c[I>>2]|0;D=b+(F<<4)|0;b=b+(E<<4)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];c[H>>2]=c[x>>2];c[H+4>>2]=c[x+4>>2];c[H+8>>2]=c[x+8>>2];c[H+12>>2]=c[x+12>>2];ql(B,G,H);c[D>>2]=c[B>>2];c[D+4>>2]=c[B+4>>2];c[D+8>>2]=c[B+8>>2];c[D+12>>2]=c[B+12>>2];D=c[I>>2]|0;b=D+(F+-2<<4)|0;E=D+(E<<4)|0;c[G>>2]=c[E>>2];c[G+4>>2]=c[E+4>>2];c[G+8>>2]=c[E+8>>2];c[G+12>>2]=c[E+12>>2];c[H>>2]=c[z>>2];c[H+4>>2]=c[z+4>>2];c[H+8>>2]=c[z+8>>2];c[H+12>>2]=c[z+12>>2];ql(y,G,H);c[b>>2]=c[y>>2];c[b+4>>2]=c[y+4>>2];c[b+8>>2]=c[y+8>>2];c[b+12>>2]=c[y+12>>2];b=c[C>>2]|0;if(!b)break;d=WH(a,c[I>>2]|0,d,d,J,b)|0;break}e=F;while(1){if((e|0)>0)b=0;else break;while(1){if((b|0)==4)break;B=E+(b<<4)|0;A=(c[I>>2]|0)+(e-b<<4)|0;c[B>>2]=c[A>>2];c[B+4>>2]=c[A+4>>2];c[B+8>>2]=c[A+8>>2];c[B+12>>2]=c[A+12>>2];b=b+1|0;}if(rl(E,f)|0){b=0;K=43;break}e=e+-3|0;}a:do if((K|0)==43)while(1){K=0;if((b|0)==4)break a;K=(c[I>>2]|0)+(e-b<<4)|0;B=E+(b<<4)|0;c[K>>2]=c[B>>2];c[K+4>>2]=c[B+4>>2];c[K+8>>2]=c[B+8>>2];c[K+12>>2]=c[B+12>>2];b=b+1|0;K=43;}while(0);if(e|0){d=e+-3|0;b=c[C>>2]|0;if(!b)break;d=WH(a,c[I>>2]|0,d,F+-3|0,J,b)|0;break}if(!(c[C>>2]|0))qa(87936,87947,452,87958);else {d=J+16|0;E=I+16|0;a=c[I>>2]|0;c[G>>2]=c[E>>2];c[G+4>>2]=c[E+4>>2];c[G+8>>2]=c[E+8>>2];c[G+12>>2]=c[E+12>>2];c[H>>2]=c[a>>2];c[H+4>>2]=c[a+4>>2];c[H+8>>2]=c[a+8>>2];c[H+12>>2]=c[a+12>>2];pl(D,G,H,f);c[d>>2]=c[D>>2];c[d+4>>2]=c[D+4>>2];c[d+8>>2]=c[D+8>>2];c[d+12>>2]=c[D+12>>2];d=0;break}}else K=52;while(0);if((K|0)==52)if(!(c[C>>2]|0))d=0;else {d=J+16|0;K=I+16|0;c[d>>2]=c[K>>2];c[d+4>>2]=c[K+4>>2];c[d+8>>2]=c[K+8>>2];c[d+12>>2]=c[K+12>>2];d=0;}b=F-d+1|0;e=J+4|0;c[e>>2]=b;c[J>>2]=KK(b<<4)|0;b=0;while(1){if((b|0)>=(c[e>>2]|0))break;K=(c[J>>2]|0)+(b<<4)|0;a=(c[I>>2]|0)+(d<<4)|0;c[K>>2]=c[a>>2];c[K+4>>2]=c[a+4>>2];c[K+8>>2]=c[a+8>>2];c[K+12>>2]=c[a+12>>2];d=d+1|0;b=b+1|0;}U1(c[I>>2]|0);U1(I);c[c[(c[L>>2]|0)+8>>2]>>2]=J;}while(0);l=M;return}function nl(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if((b|0)!=0?(a[b>>0]|0)!=0:0){d=KP(d,b)|0;if(!d){c[e>>2]=b;gA(0,88149,e)|0;d=0;}}else d=0;l=f;return d|0}function ol(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a>>3];if((+h[b>>3]<=d?d<=+h[b+16>>3]:0)?(c=+h[a+8>>3],+h[b+8>>3]<=c):0)a=c<=+h[b+24>>3]&1;else a=0;return a|0}function pl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0.0,k=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0;C=l;l=l+464|0;n=C+48|0;B=C+32|0;u=C+16|0;v=C;w=C+364|0;x=C+264|0;z=C+164|0;A=C+64|0;q=+h[b>>3];r=+h[b+8>>3];s=+h[d>>3];t=+h[d+8>>3];c[u>>2]=c[e>>2];c[u+4>>2]=c[e+4>>2];c[u+8>>2]=c[e+8>>2];c[u+12>>2]=c[e+12>>2];e=e+16|0;c[v>>2]=c[e>>2];c[v+4>>2]=c[e+4>>2];c[v+8>>2]=c[e+8>>2];c[v+12>>2]=c[e+12>>2];k=+h[u>>3];if((s=+h[u+8>>3]):0)?f<=+h[v+8>>3]:0){o=f;p=k;}else i=4;do if((i|0)==4){j=+h[v>>3];if(s>j){g=r+ +(~~((j-q)*(r-t)/(q-s))|0);f=+h[u+8>>3];if(g>=f?g<=+h[v+8>>3]:0){o=g;p=j;break}}else f=+h[u+8>>3];if(t=k)|!(m<=j))):0){o=f;p=m;break}f=+h[v+8>>3];if(t>f?(y=q+ +(~~((f-r)*(q-s)/(r-t))|0),!(!(y>=k)|!(y<=j))):0){o=f;p=y;break};c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];w=wl(n,w)|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];x=wl(n,x)|0;c[n>>2]=c[u>>2];c[n+4>>2]=c[u+4>>2];c[n+8>>2]=c[u+8>>2];c[n+12>>2]=c[u+12>>2];z=wl(n,z)|0;c[n>>2]=c[v>>2];c[n+4>>2]=c[v+4>>2];c[n+8>>2]=c[v+8>>2];c[n+12>>2]=c[v+12>>2];A=wl(n,A)|0;c[B>>2]=w;c[B+4>>2]=x;c[B+8>>2]=z;c[B+12>>2]=A;gA(1,88071,B)|0;qa(138394,87947,78,88123);}while(0);h[a>>3]=p;h[a+8>>3]=o;l=C;return}function ql(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function rl(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+80|0;j=m+16|0;k=m;e=0;while(1){if((e|0)==4)break;i=j+(e<<4)|0;g=a+(e<<4)|0;c[i>>2]=c[g>>2];c[i+4>>2]=c[g+4>>2];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];e=e+1|0;}e=b+8|0;i=b+24|0;d=+sl(a,0.0,1.0,+h[b>>3],+h[e>>3],+h[i>>3]);if(d>=0.0&d<2.0)kP(k,j,3,d,a,0);else d=2.0;g=b+16|0;f=+sl(a,0.0,d>1.0?1.0:d,+h[g>>3],+h[e>>3],+h[i>>3]);if(f>=0.0&f1.0?1.0:d,+h[e>>3],+h[b>>3],+h[g>>3]);if(f>=0.0&f1.0?1.0:d,+h[i>>3],+h[b>>3],+h[g>>3]);if(f>=0.0&f>3]-d))<=.005){b=+h[a+56>>3];b=!(b>=e)|!(b<=f)?-1.0:c;break a}break}default:{}}kP(i,a,3,.5,j,k);g=(c+b)*.5;b=+sl(j,b,g,d,e,f);if(!(b>=0.0))b=+sl(k,g,c,d,e,f);}while(0);l=m;return +b}function tl(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;var g=0.0,i=0,j=0,k=0,m=0;m=l;l=l+144|0;j=m+80|0;k=m+16|0;i=m;a:do if(!(b==c)){switch(ul(a,d)|0){case 0:{b=-1.0;break a}case 1:{if(+B(+(+h[a+56>>3]-d))<=.005){b=+h[a+48>>3];b=!(b>=e)|!(b<=f)?-1.0:c;break a}break}default:{}}kP(i,a,3,.5,j,k);g=(c+b)*.5;b=+tl(j,b,g,d,e,f);if(!(b>=0.0))b=+tl(k,g,c,d,e,f);}while(0);l=m;return +b}function ul(a,b){a=a|0;b=+b;var c=0,d=0,e=0,f=0.0,g=0,i=0;f=+h[a+8>>3];e=fb&1;c=1;d=e;e=(e|0)==0&1;while(1){if((c|0)==4)break;f=+h[a+(c<<4)+8>>3];i=fb&1;g=e+((d|0)!=0&(i|0)!=(d|0)&1)|0;c=c+1|0;d=i;e=g;}return e|0}function vl(a,b){a=a|0;b=+b;var c=0,d=0,e=0,f=0.0,g=0,i=0;f=+h[a>>3];e=fb&1;c=1;d=e;e=(e|0)==0&1;while(1){if((c|0)==4)break;f=+h[a+(c<<4)>>3];i=fb&1;g=e+((d|0)!=0&(i|0)!=(d|0)&1)|0;c=c+1|0;d=i;e=g;}return e|0}function wl(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=l;l=l+16|0;d=c;e=+h[a+8>>3];h[d>>3]=+h[a>>3];h[d+8>>3]=e;m4(b,88137,d)|0;l=c;return b|0}function xl(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;s=v;u=4;t=T1(40)|0;c[t>>2]=0;r=a+16|0;e=c[r>>2]|0;a:do if(((b[e+238>>1]|0)-(b[e+236>>1]|0)|0)>=2){m=1;d=e;e=c[e+196>>2]|0;b:while(1){n=m+1|0;if(!(c[e+(n<<6)>>2]|0)){q=15;break}else k=0;while(1){h=c[e+(m<<6)>>2]|0;if((k|0)>=(h|0)){m=n;continue b}j=c[(c[e+(m<<6)+4>>2]|0)+(k<<2)>>2]|0;o=0;d=$(20,j|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,u|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;break b}if(d<<24>>24){i=k;d=h;while(1){g=i+1|0;if((g|0)>=(d|0))break;o=0;d=aa(65,j|0,c[(c[e+(m<<6)+4>>2]|0)+(g<<2)>>2]|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,t|0,u|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){d=z;break b}if(!(d<<24>>24))break;d=c[(c[r>>2]|0)+196>>2]|0;i=g;e=d;d=c[d+(m<<6)>>2]|0;}if((g-k|0)>1){o=0;na(6,a|0,m|0,k|0,i|0,1);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;break b}}}e=c[r>>2]|0;k=k+1|0;d=e;e=c[e+196>>2]|0;}}c:do if((q|0)==15){while(1){if((m|0)>0)k=0;else break;while(1){e=c[d+196>>2]|0;h=c[e+(m<<6)>>2]|0;if((k|0)>=(h|0))break;j=c[(c[e+(m<<6)+4>>2]|0)+(k<<2)>>2]|0;o=0;d=$(21,j|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,u|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){d=z;break c}if(d<<24>>24){i=k;d=h;while(1){g=i+1|0;if((g|0)>=(d|0))break;o=0;d=aa(66,j|0,c[(c[e+(m<<6)+4>>2]|0)+(g<<2)>>2]|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,t|0,u|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){d=z;break c}if(!(d<<24>>24))break;d=c[(c[r>>2]|0)+196>>2]|0;i=g;e=d;d=c[d+(m<<6)>>2]|0;}if((g-k|0)>1){o=0;na(6,a|0,m|0,k|0,i|0,0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;break c}}}k=k+1|0;d=c[r>>2]|0;}m=m+-1|0;q=15;}t=U6(187016,1,t|0,u|0)|0;u=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1)d=z;else d=0;}while(0);d:while(1){if(d){o=0;ca(20,3,88177,s|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}else break}else f=1;while(1){d=c[r>>2]|0;if((f|0)>(c[d+180>>2]|0))break a;o=0;ia(101,c[(c[d+184>>2]|0)+(f<<2)>>2]|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,t|0,u|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue d}f=f+1|0;}}}while(0);U1(t|0);l=v;return}function yl(b){b=b|0;b=c[b+16>>2]|0;if(((a[b+156>>0]|0)==1?(c[b+176>>2]|0)==1:0)?(c[b+184>>2]|0)==1:0)b=(c[b+104>>2]|0)==0&1;else b=0;return b|0}function zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;h=i+40|0;g=i;e=c[c[(c[a+16>>2]|0)+172>>2]>>2]|0;a=c[c[(c[b+16>>2]|0)+172>>2]>>2]|0;if(((yl(b)|0)<<24>>24!=0?(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)==(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0):0)?(Fl(e,a)|0)<<24>>24!=0:0){d=(c[a+16>>2]|0)+16|0;f=g;a=(c[e+16>>2]|0)+16|0;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));f=h;a=d;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));a=(hg(g,h)|0)==0&1;}else a=0;l=i;return a|0}function Al(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=a+16|0;q=c[(c[(c[(c[t>>2]|0)+196>>2]|0)+(b<<6)+4>>2]|0)+(d<<2)>>2]|0;p=d+1|0;m=(f|0)==1;n=q+16|0;l=p;while(1){if((l|0)>(e|0)){g=e;s=p;break}o=c[(c[(c[(c[t>>2]|0)+196>>2]|0)+(b<<6)+4>>2]|0)+(l<<2)>>2]|0;k=o+16|0;a:do if(m)while(1){d=c[k>>2]|0;j=c[c[d+180>>2]>>2]|0;if(!j)break a;h=c[(c[n>>2]|0)+180>>2]|0;i=j+-48|0;f=0;while(1){d=c[h+(f<<2)>>2]|0;if(!d){r=8;break}if((c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)==(c[((c[j>>2]&3|0)==2?j:i)+40>>2]|0))break;else f=f+1|0;}if((r|0)==8){r=0;d=nh(q,c[((c[j>>2]&3|0)==2?j:i)+40>>2]|0,j)|0;}while(1){f=c[c[(c[k>>2]|0)+172>>2]>>2]|0;if(!f)break;vh(f,d);ih(f);}ih(j);}else while(1){d=c[k>>2]|0;j=c[c[d+172>>2]>>2]|0;if(!j)break a;h=c[(c[n>>2]|0)+172>>2]|0;i=j+48|0;f=0;while(1){d=c[h+(f<<2)>>2]|0;if(!d){r=17;break}if((c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)==(c[((c[j>>2]&3|0)==3?j:i)+40>>2]|0))break;else f=f+1|0;}if((r|0)==17){r=0;d=nh(c[((c[j>>2]&3|0)==3?j:i)+40>>2]|0,q,j)|0;}while(1){f=c[c[(c[k>>2]|0)+180>>2]>>2]|0;if(!f)break;vh(f,d);ih(f);}ih(j);}while(0);if((c[d+176>>2]|0)!=(0-(c[d+184>>2]|0)|0)){r=23;break}qh(a,o);l=l+1|0;}if((r|0)==23)qa(88313,88357,115,88364);while(1){g=g+1|0;d=c[(c[t>>2]|0)+196>>2]|0;f=d+(b<<6)|0;if((g|0)>=(c[f>>2]|0))break;e=c[d+(b<<6)+4>>2]|0;r=c[e+(g<<2)>>2]|0;c[e+(s<<2)>>2]=r;c[(c[r+16>>2]|0)+236>>2]=s;s=s+1|0;}c[f>>2]=s;c[(c[d+(b<<6)+4>>2]|0)+(s<<2)>>2]=0;return}function Bl(b){b=b|0;b=c[b+16>>2]|0;if(((a[b+156>>0]|0)==1?(c[b+184>>2]|0)==1:0)?(c[b+176>>2]|0)==1:0)b=(c[b+104>>2]|0)==0&1;else b=0;return b|0}function Cl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;h=i+40|0;g=i;e=c[c[(c[a+16>>2]|0)+180>>2]>>2]|0;a=c[c[(c[b+16>>2]|0)+180>>2]>>2]|0;if(((Bl(b)|0)<<24>>24!=0?(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0)==(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0):0)?(Fl(e,a)|0)<<24>>24!=0:0){d=(c[a+16>>2]|0)+56|0;f=g;a=(c[e+16>>2]|0)+56|0;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));f=h;a=d;b=f+40|0;do{c[f>>2]=c[a>>2];f=f+4|0;a=a+4|0;}while((f|0)<(b|0));a=(hg(g,h)|0)==0&1;}else a=0;l=i;return a|0}function Dl(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+32|0;p=r+16|0;o=r;m=d+16|0;f=c[m>>2]|0;e=b[f+236>>1]|0;while(1){if((e|0)>(b[f+238>>1]|0))break;c[(c[f+268>>2]|0)+(e<<2)>>2]=0;e=e+1|0;f=c[m>>2]|0;}vj(d);j=jC(d)|0;while(1){if(!j)break;El(d,j);i=XA(d,j)|0;while(1){if(!i)break;else f=i;while(1){e=c[(c[f+16>>2]|0)+172>>2]|0;if(!e)break;else f=e;}h=i+-48|0;while(1){e=f+-48|0;g=c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0;if((c[(c[g+16>>2]|0)+232>>2]|0)>=(c[(c[(c[((c[i>>2]&3|0)==2?i:h)+40>>2]|0)+16>>2]|0)+232>>2]|0))break;El(d,g);f=c[c[(c[(c[((c[f>>2]&3|0)==2?f:e)+40>>2]|0)+16>>2]|0)+180>>2]>>2]|0;}i=ZA(d,i)|0;}j=kC(d,j)|0;}e=c[m>>2]|0;i=b[e+236>>1]|0;while(1){if((i|0)>(b[e+238>>1]|0)){k=1;n=e;break}e=c[(c[e+268>>2]|0)+(i<<2)>>2]|0;j=c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(i<<6)+4>>2]|0;f=e+16|0;if((c[j+(c[(c[f>>2]|0)+236>>2]<<2)>>2]|0)!=(e|0)){q=17;break}h=c[(c[(c[(gg(d)|0)+16>>2]|0)+196>>2]|0)+(i<<6)+4>>2]|0;e=c[m>>2]|0;f=c[e+196>>2]|0;c[f+(i<<6)+4>>2]=h+(c[(c[(c[(c[e+268>>2]|0)+(i<<2)>>2]|0)+16>>2]|0)+236>>2]<<2);e=-1;h=0;a:while(1){if((h|0)>=(c[f+(i<<6)>>2]|0))break;f=c[(c[f+(i<<6)+4>>2]|0)+(h<<2)>>2]|0;if(!f)break;g=c[f+16>>2]|0;b:do if(!(a[g+156>>0]|0))if(!(HC(d,f)|0))break a;else e=h;else {f=c[c[g+172>>2]>>2]|0;while(1){if(!f)break b;g=c[(c[f+16>>2]|0)+116>>2]|0;if(!g)break;else f=g;}if(HC(d,c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0)|0){j=(HC(d,c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)|0)==0;e=j?e:h;}}while(0);h=h+1|0;f=c[(c[m>>2]|0)+196>>2]|0;}if((e|0)==-1){c[p>>2]=KB(d)|0;c[p+4>>2]=i;gA(0,88277,p)|0;}j=c[m>>2]|0;c[(c[j+196>>2]|0)+(i<<6)>>2]=e+1;i=i+1|0;e=j;}if((q|0)==17){p=KB(e)|0;q=c[(c[f>>2]|0)+236>>2]|0;c[o>>2]=p;c[o+4>>2]=q;c[o+8>>2]=i;gA(1,88219,o)|0;bb(187016,1);}while(1){if((k|0)>(c[n+180>>2]|0))break;Dl(c[(c[n+184>>2]|0)+(k<<2)>>2]|0);k=k+1|0;n=c[m>>2]|0;}l=r;return}function El(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[b+16>>2]|0;a=(c[(c[a+16>>2]|0)+268>>2]|0)+(c[d+232>>2]<<2)|0;e=c[a>>2]|0;if(!((e|0)!=0?(c[(c[e+16>>2]|0)+236>>2]|0)<=(c[d+236>>2]|0):0))c[a>>2]=b;return}function Fl(b,d){b=b|0;d=d|0;var e=0,f=0;while(1){f=c[b+16>>2]|0;if(!(a[f+112>>0]|0))break;b=c[f+116>>2]|0;}while(1){e=c[d+16>>2]|0;if(!(a[e+112>>0]|0))break;d=c[e+116>>2]|0;}if((a[f+153>>0]|0)==0?(a[e+153>>0]|0)==0:0){f=c[d>>2]&3;e=c[b>>2]&3;b=(O((c[(c[(c[((e|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((e|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0,(c[(c[(c[((f|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((f|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)|0)>0&1;}else b=0;return b|0}function Gl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+544|0;j=k+528|0;Hl(j,k+512|0,k);e=(a[193770]|0)+1<<24>>24;a[193770]=e<<24>>24==0?1:e;e=c[b+16>>2]|0;c[e+220>>2]=0;c[e+232>>2]=0;e=(d|0)>0;d=jC(b)|0;while(1){if(!d)break;if(e?(h=c[d+16>>2]|0,i=c[h+212>>2]|0,(i|0)!=0):0){g=c[(c[(c[i+16>>2]|0)+268>>2]|0)+(c[h+232>>2]<<2)>>2]|0;f=7;}else f=6;if((f|0)==6?(f=0,(d|0)==(fP(d)|0)):0){g=d;f=7;}if((f|0)==7?(0,(a[(c[g+16>>2]|0)+157>>0]|0)!=(a[193770]|0)):0){Il(b);Jl(j,b,g);Kl(b);}d=kC(b,d)|0;}Ll(j);l=k;return}function Hl(a,b,d){a=a|0;b=b|0;d=d|0;c[b>>2]=d;c[b+4>>2]=d+512;c[b+12>>2]=0;c[b+8>>2]=0;c[a>>2]=b;c[a+4>>2]=b;c[a+8>>2]=d;return}function Il(a){a=a|0;c[(c[a+16>>2]|0)+192>>2]=0;c[46793]=0;return}function Jl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+32|0;p=q;Ml(b,e);k=p+8|0;m=p+16|0;n=p+24|0;a:while(1){o=Nl(b)|0;if(!o)break;e=o+16|0;if((a[(c[e>>2]|0)+157>>0]|0)==(a[193770]|0))continue;Ol(d,o);h=c[e>>2]|0;g=h+180|0;j=c[g+4>>2]|0;i=p;c[i>>2]=c[g>>2];c[i+4>>2]=j;i=h+172|0;j=c[i+4>>2]|0;g=k;c[g>>2]=c[i>>2];c[g+4>>2]=j;g=h+188|0;j=c[g+4>>2]|0;i=m;c[i>>2]=c[g>>2];c[i+4>>2]=j;h=h+196|0;i=c[h+4>>2]|0;j=n;c[j>>2]=c[h>>2];c[j+4>>2]=i;j=3;while(1){if((j|0)<=-1)continue a;e=c[p+(j<<3)>>2]|0;b:do if(e|0){i=(c[p+(j<<3)+4>>2]|0)+-1|0;h=e+(i<<2)|0;while(1){if((i|0)<=-1)break b;f=c[h>>2]|0;g=c[f>>2]&3;e=c[((g|0)==2?f:f+-48|0)+40>>2]|0;if((e|0)==(o|0))e=c[((g|0)==3?f:f+48|0)+40>>2]|0;if((a[(c[e+16>>2]|0)+157>>0]|0)!=(a[193770]|0)?(e|0)==(fP(e)|0):0)Ml(b,e);h=h+-4|0;i=i+-1|0;}}while(0);j=j+-1|0;}}l=q;return}function Kl(a){a=a|0;var b=0,d=0,e=0,f=0;d=a+16|0;b=c[d>>2]|0;f=b+220|0;e=c[f>>2]|0;a=e+1|0;c[f>>2]=a;b=c[b+216>>2]|0;if(!b)a=KK(a<<2)|0;else a=MK(b,a<<2)|0;f=c[d>>2]|0;c[f+216>>2]=a;c[a+(e<<2)>>2]=c[f+192>>2];return}function Ll(a){a=a|0;var b=0;a=c[(c[a>>2]|0)+12>>2]|0;while(1){if(!a)break;b=c[a+12>>2]|0;U1(c[a>>2]|0);U1(a);a=b;}return}function Ml(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;h=k+8|0;g=k;j=b+8|0;f=c[j>>2]|0;i=b+4|0;b=c[i>>2]|0;if((f|0)==(c[b+4>>2]|0)){f=c[b+12>>2]|0;if(!f){f=JK(16)|0;if(!f)gA(1,98969,g)|0;c[f+8>>2]=c[i>>2];c[f+12>>2]=0;b=JK(4e6)|0;c[f>>2]=b;if(!b){gA(1,88377,h)|0;b=c[f>>2]|0;}c[f+4>>2]=b+4e6;c[(c[i>>2]|0)+12>>2]=f;}c[i>>2]=f;f=c[f>>2]|0;c[j>>2]=f;}a[(c[e+16>>2]|0)+157>>0]=(d[193770]|0)+1;c[j>>2]=f+4;c[f>>2]=e;l=k;return}function Nl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=a+8|0;b=c[f>>2]|0;d=a+4|0;e=c[d>>2]|0;if((b|0)==(c[e>>2]|0))if((e|0)==(c[a>>2]|0))b=0;else {b=c[e+8>>2]|0;c[d>>2]=b;b=c[b+4>>2]|0;c[f>>2]=b;g=4;}else g=4;if((g|0)==4){b=b+-4|0;c[f>>2]=b;b=c[b>>2]|0;}return b|0}function Ol(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=c[b+16>>2]|0;g=f+232|0;c[g>>2]=(c[g>>2]|0)+1;g=c[d+16>>2]|0;a[g+157>>0]=a[193770]|0;b=c[46793]|0;e=g+168|0;if(!b){c[e>>2]=0;c[f+192>>2]=d;}else {c[e>>2]=b;c[(c[b+16>>2]|0)+164>>2]=d;}c[46793]=d;c[g+164>>2]=0;return}function Pl(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0;m=b+16|0;d=(c[m>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;g=d+16|0;d=c[g>>2]|0;e=c[d+188>>2]|0;a:do if(!e)f=0;else {f=0;while(1){e=c[e+(f<<2)>>2]|0;if(!e){f=0;break a}Ql(e);d=c[g>>2]|0;f=f+1|0;e=c[d+188>>2]|0;}}while(0);while(1){if((f|0)>=(c[d+208>>2]|0))break;e=c[(c[d+204>>2]|0)+(f<<2)>>2]|0;l=c[e>>2]&3;if((c[(c[(c[((l|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)==(c[(c[(c[((l|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)){Ql(e);d=c[g>>2]|0;}f=f+1|0;}d=d+164|0;}l=c[m>>2]|0;d=c[l+196>>2]|0;if(!((c[d+56>>2]|0)==0?(c[l+180>>2]|0)<=0:0))i=13;b:do if((i|0)==13){i=c[d+4>>2]|0;g=0;c:while(1){d=c[i+(g<<2)>>2]|0;if(!d)break b;e=c[(c[d+16>>2]|0)+196>>2]|0;d=0;while(1){f=c[e+(d<<2)>>2]|0;if(!f)break;l=c[f+16>>2]|0;if(c[l+96>>2]|0?(a[l+113>>0]|0)==0:0)break c;d=d+1|0;}g=g+1|0;}Rl(b);}while(0);Hi(b);e=0;d=(c[m>>2]|0)+192|0;while(1){d=c[d>>2]|0;if(!d)break;l=d+16|0;d=c[l>>2]|0;f=c[d+188>>2]|0;d:do if(f){k=0;while(1){g=c[f+(k<<2)>>2]|0;if(!g){k=0;break}i=c[g+16>>2]|0;j=c[i+96>>2]|0;do if(j)if(!(a[i+113>>0]|0)){Sl(g);f=c[l>>2]|0;e=1;d=f;f=c[f+188>>2]|0;break}else {h[i+136>>3]=+h[((c[(c[m>>2]|0)+116>>2]&1|0)==0?j+24|0:j+32|0)>>3];break}while(0);k=k+1|0;}while(1){if((k|0)>=(c[d+208>>2]|0))break d;i=c[(c[d+204>>2]|0)+(k<<2)>>2]|0;j=c[i>>2]&3;g=c[((j|0)==3?i:i+48|0)+40>>2]|0;j=c[((j|0)==2?i:i+-48|0)+40>>2]|0;do if(!((g|0)==(j|0)?1:(c[(c[g+16>>2]|0)+232>>2]|0)!=(c[(c[j+16>>2]|0)+232>>2]|0))){f=i;do{j=c[f+16>>2]|0;f=c[j+172>>2]|0;}while((f|0)!=0);f=a[j+113>>0]|0;g=c[i+16>>2]|0;a[g+113>>0]=f;g=c[g+96>>2]|0;if(g)if(!(f<<24>>24)){Sl(i);e=1;d=c[l>>2]|0;break}else {o=+h[((c[(c[m>>2]|0)+116>>2]&1|0)==0?g+24|0:g+32|0)>>3];j=j+136|0;n=+h[j>>3];h[j>>3]=o>n?o:n;break}}while(0);k=k+1|0;}}while(0);d=d+164|0;}if(e|0){Ah(b);Oh(b);}return e|0}function Ql(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[b>>2]&3;i=c[((d|0)==3?b:b+48|0)+40>>2]|0;f=i+16|0;g=c[(c[f>>2]|0)+236>>2]|0;d=c[(c[(c[((d|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;h=(g|0)<(d|0);e=h?d:g;i=c[(c[(gg(i)|0)+16>>2]|0)+196>>2]|0;f=i+(c[(c[f>>2]|0)+232>>2]<<6)+4|0;d=h?g:d;a:while(1){d=d+1|0;if((d|0)>=(e|0))break;g=c[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+16>>2]|0;switch(a[g+156>>0]|0){case 0:break a;case 1:break;default:continue a}if(c[g+104>>2]|0)break}if((d|0)==(e|0))do{i=c[b+16>>2]|0;a[i+113>>0]=1;b=c[i+172>>2]|0;}while((b|0)!=0);return}function Rl(a){a=a|0;var d=0,e=0,f=0,g=0;g=a+16|0;a=c[g>>2]|0;if(b[a+236>>1]|0)qa(88434,88417,190,88453);d=(b[a+238>>1]|0)+3|0;a=c[a+196>>2]|0;if(!a)a=KK(d<<6)|0;else a=MK(a,d<<6)|0;d=a+64|0;a=c[g>>2]|0;c[a+196>>2]=d;a=b[a+238>>1]|0;while(1){if((a|0)<=-1)break;f=a+-1|0;e=d+(a<<6)|0;a=d+(f<<6)|0;d=e+64|0;do{c[e>>2]=c[a>>2];e=e+4|0;a=a+4|0;}while((e|0)<(d|0));a=f;d=c[(c[g>>2]|0)+196>>2]|0;}c[d+(a<<6)+8>>2]=0;c[d+(a<<6)>>2]=0;e=JK(8)|0;g=c[g>>2]|0;f=c[g+196>>2]|0;c[f+(a<<6)+12>>2]=e;c[f+(a<<6)+4>>2]=e;c[f+(a<<6)+56>>2]=0;h[f+(a<<6)+24>>3]=1.0;h[f+(a<<6)+16>>3]=1.0;h[f+(a<<6)+40>>3]=1.0;h[f+(a<<6)+32>>3]=1.0;g=g+236|0;b[g>>1]=(b[g>>1]|0)+-1<<16>>16;return}function Sl(b){b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0;j=b+16|0;if(c[(c[j>>2]|0)+96>>2]|0){m=b+48|0;k=gg(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)|0;d=c[(c[(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)+16>>2]|0)+232>>2]|0;l=Tl(k,b)|0;n=k+16|0;e=c[n>>2]|0;g=c[e+196>>2]|0;o=d+-1|0;i=c[c[g+(o<<6)+4>>2]>>2]|0;if(!i)f=+h[g+(d<<6)+24>>3]+ +h[(c[(c[c[g+(d<<6)+4>>2]>>2]|0)+16>>2]|0)+24>>3]+ +(c[e+252>>2]|0);else f=+h[(c[i+16>>2]|0)+24>>3]-+h[g+(o<<6)+16>>3];d=Ul(k,o,l)|0;k=c[(c[j>>2]|0)+96>>2]|0;q=+h[k+24>>3];p=+h[k+32>>3];j=(c[(c[n>>2]|0)+116>>2]&1|0)==0;r=j?p:q;g=d+16|0;e=c[g>>2]|0;h[e+80>>3]=r;l=~~(r*.5);p=(j?q:p)*.5;h[e+96>>3]=p;h[e+88>>3]=p;c[e+104>>2]=k;h[e+24>>3]=+(l+~~f|0);e=nh(d,c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0,b)|0;e=c[e+16>>2]|0;h[e+16>>3]=-+h[(c[g>>2]|0)+88>>3];h[e+56>>3]=+h[(c[(c[((c[b>>2]&3|0)==3?b:m)+40>>2]|0)+16>>2]|0)+96>>3];a[e+112>>0]=4;e=b+-48|0;d=nh(d,c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0,b)|0;g=c[g>>2]|0;d=c[d+16>>2]|0;h[d+16>>3]=+h[g+96>>3];h[d+56>>3]=+h[(c[(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)+16>>2]|0)+88>>3];a[d+112>>0]=4;d=c[(c[n>>2]|0)+196>>2]|0;e=d+(o<<6)+16|0;f=+(l|0);if(+h[e>>3]>3]=f;d=d+(o<<6)+24|0;if(+h[d>>3]>3]=f;c[g+112>>2]=b;}return} -function QI(d,f,g){d=d|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+160|0;y=A+24|0;w=A+20|0;v=A+16|0;o=A;p=A+32|0;x=c[d+152>>2]|0;c[y>>2]=0;c[w>>2]=0;c[v>>2]=0;z=aI(d)|0;c[z+4>>2]=3;c[z+8>>2]=f;c[z+12>>2]=9;t=f+16|0;n=c[(c[t>>2]|0)+96>>2]|0;if((n|0?(a[n+82>>0]|0)==0:0)?(eP(QA(f,100105)|0,0)|0)<<24>>24:0){n=z+260|0;b[n>>1]=b[n>>1]|512;}if(g|0?c[(c[t>>2]|0)+8>>2]|0:0)lS(d,g);g=c[47206]|0;if((g|0?(i=RA(f,g)|0,i|0):0)?a[i>>0]|0:0)uS(d,+_O(f,c[47206]|0,1.0,0.0));do if(x&16777216|0){g=f+48|0;if((e[(c[(xC(c[((c[f>>2]&3|0)==3?f:g)+40>>2]|0)|0)+16>>2]|0)+178>>1]|0)>2){m=+h[(c[(c[(c[((c[f>>2]&3|0)==3?f:g)+40>>2]|0)+16>>2]|0)+132>>2]|0)+16>>3]*72.0;h[z+176>>3]=+(~~(m+(m>=0.0?.5:-.5))|0);m=+h[(c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0)+16>>3]*72.0;h[z+184>>3]=+(~~(m+(m>=0.0?.5:-.5))|0);break}else {n=z+176|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;break}}while(0);if(x&32768|0){n=c[t>>2]|0;g=c[n+96>>2]|0;if(!g)g=c[z+192>>2]|0;else {g=c[g>>2]|0;c[z+192>>2]=g;}i=z+196|0;c[i>>2]=g;k=z+204|0;c[k>>2]=g;j=z+200|0;c[j>>2]=g;g=c[n+108>>2]|0;if(g|0)c[i>>2]=c[g>>2];g=c[n+104>>2]|0;if(g|0)c[j>>2]=c[g>>2];g=c[n+100>>2]|0;if(g|0)c[k>>2]=c[g>>2];}if(!(x&65536))j=0;else {kA(o,128,p);c[z+212>>2]=EK(dI(d,f,o)|0,f)|0;oA(o);g=QA(f,141055)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=31;else {g=QA(f,111477)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=31;else i=0;}if((q|0)==31)i=EK(g,f)|0;g=QA(f,100118)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=36;else q=34;do if((q|0)==34){g=QA(f,100127)|0;if(g|0?a[g>>0]|0:0){q=36;break}if(i|0){g=D4(i)|0;q=39;}}while(0);if((q|0)==36){g=EK(g,f)|0;q=39;}if((q|0)==39)c[z+208>>2]=g;g=QA(f,100135)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=44;else q=42;do if((q|0)==42){g=QA(f,100145)|0;if(g|0?a[g>>0]|0:0){q=44;break}if(i|0){g=D4(i)|0;q=47;}}while(0);if((q|0)==44){g=EK(g,f)|0;q=47;}if((q|0)==47)c[z+216>>2]=g;g=QA(f,100154)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=52;else q=50;do if((q|0)==50){g=QA(f,100163)|0;if(g|0?a[g>>0]|0:0){q=52;break}if(i|0)c[z+220>>2]=D4(i)|0;}while(0);if((q|0)==52){c[z+220>>2]=EK(g,f)|0;q=z+260|0;b[q>>1]=b[q>>1]|128;}g=QA(f,100171)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=59;else q=57;do if((q|0)==57){g=QA(f,100180)|0;if(g|0?a[g>>0]|0:0){q=59;break}if(i|0)c[z+224>>2]=D4(i)|0;}while(0);if((q|0)==59){c[z+224>>2]=EK(g,f)|0;q=z+260|0;b[q>>1]=b[q>>1]|256;}j=i;}do if(x&8388608){g=QA(f,141088)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)i=EK(g,f)|0;else i=0;g=QA(f,100188)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){q=z+260|0;b[q>>1]=b[q>>1]|64;g=EK(g,f)|0;q=72;}else q=70;if((q|0)==70?i|0:0){g=D4(i)|0;q=72;}if((q|0)==72)c[z+244>>2]=g;g=QA(f,100199)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){g=EK(g,f)|0;q=78;}else q=76;if((q|0)==76?i|0:0){g=D4(i)|0;q=78;}if((q|0)==78)c[z+248>>2]=g;g=QA(f,100211)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){c[z+252>>2]=EK(g,f)|0;p=z+260|0;b[p>>1]=b[p>>1]|16;}else q=82;if((q|0)==82?i|0:0)c[z+252>>2]=D4(i)|0;g=QA(f,100222)|0;if(g|0?a[g>>0]|0:0){q=z+260|0;b[q>>1]=b[q>>1]|32;c[z+256>>2]=EK(g,f)|0;break}if(i)c[z+256>>2]=D4(i)|0;else i=0;}else i=0;while(0);do if(x&4194304|0){g=QA(f,141101)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0)q=94;else q=92;do if((q|0)==92){g=QA(f,100233)|0;if(g|0?a[g>>0]|0:0){q=94;break}g=c[z+192>>2]|0;if(g|0)c[z+228>>2]=D4(g)|0;}while(0);if((q|0)==94){p=jJ(g,f)|0;c[z+228>>2]=EK(p,f)|0;U1(p);p=z+260|0;b[p>>1]=b[p>>1]|1;}g=QA(f,100245)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){p=jJ(g,f)|0;c[z+232>>2]=EK(p,f)|0;U1(p);p=z+260|0;b[p>>1]=b[p>>1]|8;}else q=100;if((q|0)==100?(r=c[z+192>>2]|0,r|0):0)c[z+232>>2]=D4(r)|0;g=QA(f,100258)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){r=jJ(g,f)|0;c[z+236>>2]=EK(r,f)|0;U1(r);r=z+260|0;b[r>>1]=b[r>>1]|2;}else q=105;if((q|0)==105?(s=c[z+200>>2]|0,s|0):0)c[z+236>>2]=D4(s)|0;g=QA(f,100270)|0;if(g|0?a[g>>0]|0:0){s=jJ(g,f)|0;c[z+240>>2]=EK(s,f)|0;U1(s);s=z+260|0;b[s>>1]=b[s>>1]|4;break}g=c[z+204>>2]|0;if(g|0)c[z+240>>2]=D4(g)|0;}while(0);U1(j);U1(i);do if(x&4259840|0?(u=c[(c[t>>2]|0)+8>>2]|0,u|0):0){if(!(c[z+208>>2]|0)){if((x&524288|0)==0|(c[z+228>>2]|0)==0)break}else if(!(x&524288))break;m=+h[(c[d+16>>2]|0)+152>>3]*.5;m=m>2.0?m:2.0;i=c[u+4>>2]|0;g=0;while(1){if((g|0)>=(i|0))break;kJ(y,w,v,(c[u>>2]|0)+(g*48|0)|0,m);g=g+1|0;}j=c[v>>2]|0;c[z+276>>2]=j;k=c[w>>2]|0;c[z+280>>2]=k;if(!(x&8192)){g=0;i=0;while(1){if((i|0)>=(j|0))break;g=(c[k+(i<<2)>>2]|0)+g|0;i=i+1|0;}y=c[y>>2]|0;NR(d,y,y,g)|0;g=y;}else g=c[y>>2]|0;c[z+284>>2]=g;c[z+264>>2]=2;c[z+272>>2]=g;c[z+268>>2]=c[k>>2];}while(0);aS(d,f);g=c[z+208>>2]|0;if(!((g|0)==0?!(b[z+260>>1]&1):0))cS(d,g,c[z+228>>2]|0,c[z+244>>2]|0,c[z+212>>2]|0);l=A;return}function RI(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0,S=0;P=l;l=l+240|0;L=P+224|0;K=P+208|0;x=P+128|0;w=P+112|0;O=P+64|0;C=P+48|0;D=P+32|0;E=P+16|0;F=P;G=P+192|0;H=P+176|0;y=P+160|0;B=P+144|0;c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;M=+h[(c[b+16>>2]|0)+152>>3];HT(QA(e,100032)|0);J=e+16|0;a:do if(c[(c[J>>2]|0)+8>>2]|0){N=+_O(e,c[47188]|0,1.0,0.0);k=aP(e,c[47176]|0,195059)|0;v=(f|0)!=0;b:do if(v){g=f;while(1){i=g;g=g+4|0;i=c[i>>2]|0;if(!i){o=0;break b}if((a[i>>0]|0)!=116)continue;if(!(s2(i,111117)|0)){o=1;break}}}else o=0;while(0);j=k;q=0;i=0;c:while(1){switch(a[j>>0]|0){case 0:break c;case 58:{g=q+1|0;break}case 59:{g=q;i=i+1|0;break}default:g=q;}j=j+1|0;q=g;}n=(q|0)!=0;if((i|0)!=0&n)if(!(ZI(b,e,f,k,q+1|0,N,M)|0))break;else m=137314;else m=k;g=d[(c[J>>2]|0)+115>>0]|0;if(!(g&1))if(!(g&2))if(!(g&8))if(!(g&4)){i=m;j=bP(e,c[47177]|0,m)|0;}else {j=106296;g=106288;k=188712;i=188712;p=18;}else {j=106280;g=106272;k=188712;i=188712;p=18;}else {j=106264;g=106256;k=188712;i=188712;p=18;}else {j=106248;g=106240;k=188712;i=188712;p=18;}if((p|0)==18){i=c[i>>2]|0;i=bP(e,i,_I(m,g)|0)|0;g=bP(e,c[k>>2]|0,j)|0;if((i|0)==(m|0)){i=m;j=g;}else {hS(b,i);j=g;}}if((j|0)!=(m|0))jS(b,j);if(o<<24>>24){i=(a[i>>0]|0)==0?137314:i;g=(a[j>>0]|0)==0?137314:j;hS(b,137379);jS(b,i);u=O;r=c[c[(c[J>>2]|0)+8>>2]>>2]|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));J=zO(O,$I(e)|0,M,0,0)|0;nS(b,c[J+8>>2]|0,c[J>>2]|0,1);aJ(J);hS(b,i);if((g|0)!=(i|0))jS(b,g);g=c[O+8>>2]|0;if(g|0){I=O+16|0;J=c[O>>2]|0;c[K>>2]=c[I>>2];c[K+4>>2]=c[I+4>>2];c[K+8>>2]=c[I+8>>2];c[K+12>>2]=c[I+12>>2];c[L>>2]=c[J>>2];c[L+4>>2]=c[J+4>>2];c[L+8>>2]=c[J+8>>2];c[L+12>>2]=c[J+12>>2];ZH(b,2,K,L,N,M,g);}g=c[O+12>>2]|0;if(!g)break;J=O+32|0;O=(c[O>>2]|0)+((c[O+4>>2]|0)+-1<<4)|0;c[K>>2]=c[J>>2];c[K+4>>2]=c[J+4>>2];c[K+8>>2]=c[J+8>>2];c[K+12>>2]=c[J+12>>2];c[L>>2]=c[O>>2];c[L+4>>2]=c[O+4>>2];c[L+8>>2]=c[O+8>>2];c[L+12>>2]=c[O+12>>2];ZH(b,3,K,L,N,M,g);break}g=c[J>>2]|0;if(!n){do if(!(a[g+115>>0]&3)){if(a[i>>0]|0){hS(b,i);jS(b,j);break}hS(b,137314);if(!(a[j>>0]|0)){jS(b,137314);break}else {jS(b,j);break}}while(0);k=b+152|0;m=O+4|0;n=O+8|0;o=O+12|0;p=O+32|0;q=O+16|0;j=0;while(1){g=c[(c[J>>2]|0)+8>>2]|0;if((j|0)>=(c[g+4>>2]|0))break a;u=O;r=(c[g>>2]|0)+(j*48|0)|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));g=c[O>>2]|0;i=c[m>>2]|0;do if(!(c[k>>2]&16384)){pS(b,g,i,0,0,0);g=c[n>>2]|0;if(g|0){I=c[O>>2]|0;c[K>>2]=c[q>>2];c[K+4>>2]=c[q+4>>2];c[K+8>>2]=c[q+8>>2];c[K+12>>2]=c[q+12>>2];c[L>>2]=c[I>>2];c[L+4>>2]=c[I+4>>2];c[L+8>>2]=c[I+8>>2];c[L+12>>2]=c[I+12>>2];ZH(b,2,K,L,N,M,g);}g=c[o>>2]|0;if(g|0){I=(c[O>>2]|0)+((c[m>>2]|0)+-1<<4)|0;c[K>>2]=c[p>>2];c[K+4>>2]=c[p+4>>2];c[K+8>>2]=c[p+8>>2];c[K+12>>2]=c[p+12>>2];c[L>>2]=c[I>>2];c[L+4>>2]=c[I+4>>2];c[L+8>>2]=c[I+8>>2];c[L+12>>2]=c[I+12>>2];ZH(b,3,K,L,N,M,g);}if((c[(c[(c[J>>2]|0)+8>>2]|0)+4>>2]|0)>1){if(!(c[n>>2]|0)){if(!(v&(c[o>>2]|0)!=0))break}else if(!v)break;lS(b,f);}}else pS(b,g,i,c[n>>2]|0,c[o>>2]|0,0);while(0);j=j+1|0;}}I=c[(c[g+8>>2]|0)+4>>2]|0;A=I*48|0;z=T1(A)|0;A=T1(A)|0;t=+(q+2|0)*.5;v=O+4|0;p=C+8|0;q=D+8|0;e=E+8|0;f=F+8|0;o=0;while(1){if((o|0)>=(I|0))break;u=O;r=(c[c[(c[J>>2]|0)+8>>2]>>2]|0)+(o*48|0)|0;s=u+48|0;do{c[u>>2]=c[r>>2];u=u+4|0;r=r+4|0;}while((u|0)<(s|0));g=c[v>>2]|0;c[z+(o*48|0)+4>>2]=g;c[A+(o*48|0)+4>>2]=g;n=g<<4;m=T1(n)|0;c[z+(o*48|0)>>2]=m;n=T1(n)|0;c[A+(o*48|0)>>2]=n;k=c[O>>2]|0;c[F>>2]=c[k>>2];c[F+4>>2]=c[k+4>>2];c[F+8>>2]=c[k+8>>2];c[F+12>>2]=c[k+12>>2];k=0;while(1){if((k|0)>=(g+-1|0))break;c[C>>2]=c[F>>2];c[C+4>>2]=c[F+4>>2];c[C+8>>2]=c[F+8>>2];c[C+12>>2]=c[F+12>>2];g=k+1|0;j=(c[O>>2]|0)+(g<<4)|0;c[D>>2]=c[j>>2];c[D+4>>2]=c[j+4>>2];c[D+8>>2]=c[j+8>>2];c[D+12>>2]=c[j+12>>2];j=m+(k<<4)|0;if(!k){c[K>>2]=c[C>>2];c[K+4>>2]=c[C+4>>2];c[K+8>>2]=c[C+8>>2];c[K+12>>2]=c[C+12>>2];c[L>>2]=c[D>>2];c[L+4>>2]=c[D+4>>2];c[L+8>>2]=c[D+8>>2];c[L+12>>2]=c[D+12>>2];bJ(G,K,L);c[j>>2]=c[G>>2];c[j+4>>2]=c[G+4>>2];c[j+8>>2]=c[G+8>>2];c[j+12>>2]=c[G+12>>2];}else {c[K>>2]=c[E>>2];c[K+4>>2]=c[E+4>>2];c[K+8>>2]=c[E+8>>2];c[K+12>>2]=c[E+12>>2];c[L>>2]=c[D>>2];c[L+4>>2]=c[D+4>>2];c[L+8>>2]=c[D+8>>2];c[L+12>>2]=c[D+12>>2];bJ(H,K,L);c[j>>2]=c[H>>2];c[j+4>>2]=c[H+4>>2];c[j+8>>2]=c[H+8>>2];c[j+12>>2]=c[H+12>>2];}R=c[O>>2]|0;s=k+2|0;S=R+(s<<4)|0;c[E>>2]=c[S>>2];c[E+4>>2]=c[S+4>>2];c[E+8>>2]=c[S+8>>2];c[E+12>>2]=c[S+12>>2];u=k+3|0;R=R+(u<<4)|0;c[F>>2]=c[R>>2];c[F+4>>2]=c[R+4>>2];c[F+8>>2]=c[R+8>>2];c[F+12>>2]=c[R+12>>2];Q=m+(g<<4)|0;r=m+(s<<4)|0;c[w>>2]=c[C>>2];c[w+4>>2]=c[C+4>>2];c[w+8>>2]=c[C+8>>2];c[w+12>>2]=c[C+12>>2];c[x>>2]=c[D>>2];c[x+4>>2]=c[D+4>>2];c[x+8>>2]=c[D+8>>2];c[x+12>>2]=c[D+12>>2];c[K>>2]=c[S>>2];c[K+4>>2]=c[S+4>>2];c[K+8>>2]=c[S+8>>2];c[K+12>>2]=c[S+12>>2];c[L>>2]=c[R>>2];c[L+4>>2]=c[R+4>>2];c[L+8>>2]=c[R+8>>2];c[L+12>>2]=c[R+12>>2];cJ(y,w,x,K,L);c[r>>2]=c[y>>2];c[r+4>>2]=c[y+4>>2];c[r+8>>2]=c[y+8>>2];c[r+12>>2]=c[y+12>>2];c[Q>>2]=c[y>>2];c[Q+4>>2]=c[y+4>>2];c[Q+8>>2]=c[y+8>>2];c[Q+12>>2]=c[y+12>>2];h[n+(k<<4)>>3]=+h[C>>3]-+h[j>>3]*t;h[n+(k<<4)+8>>3]=+h[p>>3]-+h[m+(k<<4)+8>>3]*t;h[n+(g<<4)>>3]=+h[D>>3]-+h[Q>>3]*t;h[n+(g<<4)+8>>3]=+h[q>>3]-+h[m+(g<<4)+8>>3]*t;h[n+(s<<4)>>3]=+h[E>>3]-+h[r>>3]*t;h[n+(s<<4)+8>>3]=+h[e>>3]-+h[m+(s<<4)+8>>3]*t;k=u;g=c[v>>2]|0;}S=m+(k<<4)|0;c[K>>2]=c[E>>2];c[K+4>>2]=c[E+4>>2];c[K+8>>2]=c[E+8>>2];c[K+12>>2]=c[E+12>>2];c[L>>2]=c[F>>2];c[L+4>>2]=c[F+4>>2];c[L+8>>2]=c[F+8>>2];c[L+12>>2]=c[F+12>>2];bJ(B,K,L);c[S>>2]=c[B>>2];c[S+4>>2]=c[B+4>>2];c[S+8>>2]=c[B+8>>2];c[S+12>>2]=c[B+12>>2];h[n+(k<<4)>>3]=+h[F>>3]-+h[S>>3]*t;h[n+(k<<4)+8>>3]=+h[f>>3]-+h[m+(k<<4)+8>>3]*t;o=o+1|0;}s=D4(i)|0;f=0;r=i;g=i;j=i;i=s;while(1){i=A4(i,107984)|0;if(!i)break;e=(a[i>>0]|0)==0?137314:i;if((e|0)!=(j|0))if(!(a[(c[J>>2]|0)+115>>0]&3)){hS(b,e);jS(b,e);j=e;}else j=e;m=(f|0)==0;n=f>>>0<2;i=0;while(1){if((i|0)>=(I|0))break;o=c[A+(i*48|0)>>2]|0;p=c[z+(i*48|0)>>2]|0;q=c[A+(i*48|0)+4>>2]|0;k=0;while(1){if((k|0)>=(q|0))break;S=o+(k<<4)|0;h[S>>3]=+h[S>>3]+ +h[p+(k<<4)>>3];S=o+(k<<4)+8|0;h[S>>3]=+h[S>>3]+ +h[p+(k<<4)+8>>3];k=k+1|0;}pS(b,o,q,0,0,0);i=i+1|0;}f=f+1|0;r=m?e:r;g=n?e:g;i=0;}i=c[O+8>>2]|0;if(!i)i=0;else {if(g){if(!(a[(c[J>>2]|0)+115>>0]&3)){hS(b,g);jS(b,g);}}else g=0;R=O+16|0;S=c[O>>2]|0;c[K>>2]=c[R>>2];c[K+4>>2]=c[R+4>>2];c[K+8>>2]=c[R+8>>2];c[K+12>>2]=c[R+12>>2];c[L>>2]=c[S>>2];c[L+4>>2]=c[S+4>>2];c[L+8>>2]=c[S+8>>2];c[L+12>>2]=c[S+12>>2];ZH(b,2,K,L,N,M,i);i=g;}j=O+12|0;g=c[j>>2]|0;if(g|0){if((i|0)!=(r|0)?(a[(c[J>>2]|0)+115>>0]&3)==0:0){hS(b,r);jS(b,r);g=c[j>>2]|0;}R=O+32|0;S=(c[O>>2]|0)+((c[v>>2]|0)+-1<<4)|0;c[K>>2]=c[R>>2];c[K+4>>2]=c[R+4>>2];c[K+8>>2]=c[R+8>>2];c[K+12>>2]=c[R+12>>2];c[L>>2]=c[S>>2];c[L+4>>2]=c[S+4>>2];c[L+8>>2]=c[S+8>>2];c[L+12>>2]=c[S+12>>2];ZH(b,3,K,L,N,M,g);}U1(s);g=0;while(1){if((g|0)>=(I|0))break;U1(c[z+(g*48|0)>>2]|0);U1(c[A+(g*48|0)>>2]|0);g=g+1|0;}U1(z);U1(A);}while(0);l=P;return}function SI(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+64|0;r=x+48|0;u=x+32|0;t=x+16|0;s=x;w=c[a+16>>2]|0;v=c[w+8>>2]|0;q=w+208|0;if(!((c[q>>2]|0)==0?!(b[w+260>>1]&1):0))d=3;a:do if((d|0)==3?(dS(a),p=w+276|0,e=c[p>>2]|0,e|0):0){h=w+280|0;d=c[h>>2]|0;i=w+268|0;j=w+284|0;k=w+272|0;m=w+228|0;n=w+244|0;o=w+212|0;f=c[d>>2]|0;g=1;while(1){if((g|0)>=(e|0))break a;c[i>>2]=c[d+(g<<2)>>2];c[k>>2]=(c[j>>2]|0)+(f<<4);cS(a,c[q>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0);dS(a);y=c[h>>2]|0;f=(c[y+(g<<2)>>2]|0)+f|0;g=g+1|0;e=c[p>>2]|0;d=y;}}while(0);c[w+268>>2]=0;c[w+272>>2]=0;q=v+16|0;d=c[q>>2]|0;e=c[d+8>>2]|0;if(!e)f=w+260|0;else {p=c[e>>2]|0;d=c[p>>2]|0;y=c[p+8>>2]|0;o=p+16|0;c[t>>2]=c[o>>2];c[t+4>>2]=c[o+4>>2];c[t+8>>2]=c[o+8>>2];c[t+12>>2]=c[o+12>>2];p=p+32|0;c[s>>2]=c[p>>2];c[s+4>>2]=c[p+4>>2];c[s+8>>2]=c[p+8>>2];c[s+12>>2]=c[p+12>>2];if(!y){c[u>>2]=c[d>>2];c[u+4>>2]=c[d+4>>2];c[u+8>>2]=c[d+8>>2];c[u+12>>2]=c[d+12>>2];}else {c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];}f=w+260|0;p=b[f>>1]|0;o=c[w+220>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];TI(a,r,(p<<8&65535)<<16>>16>>15&255,o,(p<<14&65535)<<16>>16>>15&255);p=c[(c[q>>2]|0)+8>>2]|0;o=c[p>>2]|0;p=(c[p+4>>2]|0)+-1|0;d=c[o+(p*48|0)>>2]|0;e=c[o+(p*48|0)+4>>2]|0;y=c[o+(p*48|0)+12>>2]|0;n=o+(p*48|0)+16|0;c[t>>2]=c[n>>2];c[t+4>>2]=c[n+4>>2];c[t+8>>2]=c[n+8>>2];c[t+12>>2]=c[n+12>>2];t=o+(p*48|0)+32|0;c[s>>2]=c[t>>2];c[s+4>>2]=c[t+4>>2];c[s+8>>2]=c[t+8>>2];c[s+12>>2]=c[t+12>>2];if(!y){y=d+(e+-1<<4)|0;c[u>>2]=c[y>>2];c[u+4>>2]=c[y+4>>2];c[u+8>>2]=c[y+8>>2];c[u+12>>2]=c[y+12>>2];}else {c[u>>2]=c[s>>2];c[u+4>>2]=c[s+4>>2];c[u+8>>2]=c[s+8>>2];c[u+12>>2]=c[s+12>>2];}d=b[f>>1]|0;y=c[w+224>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];TI(a,r,(d<<7&65535)<<16>>16>>15&255,y,(d<<13&65535)<<16>>16>>15&255);d=c[q>>2]|0;}e=c[d+96>>2]|0;g=(b[f>>1]<<12&65535)<<16>>16>>15<<16>>16;m=w+216|0;h=c[m>>2]|0;n=w+232|0;i=c[n>>2]|0;o=w+248|0;j=c[o>>2]|0;p=w+212|0;k=c[p>>2]|0;if(!((dP(aP(v,c[47186]|0,137308)|0)|0)<<24>>24))d=0;else d=c[(c[q>>2]|0)+8>>2]|0;UI(a,e,11,g,h,i,j,k,d);j=c[(c[q>>2]|0)+108>>2]|0;k=(b[f>>1]<<12&65535)<<16>>16>>15<<16>>16;i=c[m>>2]|0;h=c[n>>2]|0;e=c[o>>2]|0;g=c[p>>2]|0;if(!((dP(aP(v,c[47186]|0,137308)|0)|0)<<24>>24))d=0;else d=c[(c[q>>2]|0)+8>>2]|0;UI(a,j,11,k,i,h,e,g,d);UI(a,c[(c[q>>2]|0)+100>>2]|0,7,(b[f>>1]<<13&65535)<<16>>16>>15<<16>>16,c[w+224>>2]|0,c[w+240>>2]|0,c[w+256>>2]|0,c[p>>2]|0,0);UI(a,c[(c[q>>2]|0)+104>>2]|0,6,(b[f>>1]<<14&65535)<<16>>16>>15<<16>>16,c[w+220>>2]|0,c[w+236>>2]|0,c[w+252>>2]|0,c[p>>2]|0,0);bS(a);bI(a);l=x;return}function TI(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;j=l;l=l+16|0;h=j;i=c[a+16>>2]|0;if(!(e<<24>>24))f=c[i+208>>2]|0;if(!(g<<24>>24==0?((f|0)==0?(b[i+260>>1]&1)==0:0):0)){c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];YI(a,h);}l=j;return}function UI(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0,q=0,r=0;r=l;l=l+16|0;o=r;q=c[b+152>>2]|0;if(d|0?a[d+81>>0]|0:0){if(!j)n=0;else {n=JK((l2(j)|0)+11|0)|0;switch(e|0){case 11:{m=108224;break}case 7:{m=101583;break}case 6:{m=101593;break}default:qa(138394,99906,2730,100044);}c[o>>2]=j;c[o+4>>2]=m;m4(n,100060,o)|0;}o=b+16|0;j=(c[o>>2]|0)+12|0;p=c[j>>2]|0;c[j>>2]=e;j=(f|0)!=0|(g|0)!=0;m=(q&4|0)==0;if(j&m){VI(b,d);cS(b,g,h,i,n);}DK(b,e,d);if(k|0)WI(b,d,k);if(j){if(!m){VI(b,d);cS(b,g,h,i,n);}dS(b);}U1(n);c[(c[o>>2]|0)+12>>2]=p;}l=r;return}function VI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;i=f>>>16^2;c[d+264>>2]=i;j=d+268|0;c[j>>2]=i+2;i=d+272|0;U1(c[i>>2]|0);d=JK(c[j>>2]<<4)|0;c[i>>2]=d;i=b+56|0;j=b+24|0;h[d>>3]=+h[i>>3]-+h[j>>3]*.5;g=b+64|0;b=b+32|0;h[d+8>>3]=+h[g>>3]-+h[b>>3]*.5;h[d+16>>3]=+h[j>>3]*.5+ +h[i>>3];h[d+24>>3]=+h[b>>3]*.5+ +h[g>>3];if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function WI(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+96|0;g=o+80|0;i=o+32|0;j=o+16|0;k=o;f=c[d>>2]|0;while(1){m=a[f>>0]|0;if(!(m<<24>>24))break;if(!(S2(m&255)|0)){n=4;break}else f=f+1|0;}if((n|0)==4){p=+h[d+24>>3];m=d+56|0;XI(i,+h[m>>3]+p*.5,+h[d+64>>3]-+h[d+32>>3]*.5);n=i+16|0;XI(j,+h[i>>3]-p,+h[i+8>>3]);c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];n=i+32|0;c[g>>2]=c[m>>2];c[g+4>>2]=c[m+4>>2];c[g+8>>2]=c[m+8>>2];c[g+12>>2]=c[m+12>>2];qP(k,e,g);c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];lS(b,c[(c[b>>2]|0)+336>>2]|0);hS(b,c[d+8>>2]|0);qS(b,i,3);}l=o;return}function XI(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function YI(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0;d=c[a+16>>2]|0;e=c[a+152>>2]|0;if(e&4259840|0){f=e&131072;j=f>>>16^2;c[d+264>>2]=j;k=d+268|0;c[k>>2]=j+2;j=d+272|0;U1(c[j>>2]|0);d=JK(c[k>>2]<<4)|0;c[j>>2]=d;i=+h[b>>3];h[d>>3]=i+-3.0;g=+h[b+8>>3];h[d+8>>3]=g+-3.0;h[d+16>>3]=i+3.0;h[d+24>>3]=g+3.0;if(!(e&8192))NR(a,d,d,2)|0;if(!f)jK(d);}return}function ZI(a,b,d,e,f,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;i=+i;var j=0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;J=l;l=l+256|0;D=J+224|0;C=J+208|0;j=J+192|0;F=J+144|0;G=J+96|0;H=J+48|0;E=J;k=J+240|0;e=gI(e,f,k)|0;if((e|0)>1){z=b+48|0;A=xC(c[((c[b>>2]&3|0)==3?b:z)+40>>2]|0)|0;z=KB(c[((c[b>>2]&3|0)==3?b:z)+40>>2]|0)|0;A=(xB(A)|0)!=0;B=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[j>>2]=z;c[j+4>>2]=A?100079:100084;c[j+8>>2]=B;gA(3,100089,j)|0;if((e|0)==2)e=1;else I=4;}else if((e|0)==1)e=1;else I=4;if((I|0)==4){B=b+16|0;r=c[k>>2]|0;s=r+8|0;t=H+4|0;u=F+8|0;v=F+12|0;w=(d|0)!=0;q=(d|0)==0;x=F+32|0;y=F+4|0;z=F+16|0;A=E+4|0;e=0;p=0;while(1){f=c[(c[B>>2]|0)+8>>2]|0;if((p|0)>=(c[f+4>>2]|0))break;j=F;f=(c[f>>2]|0)+(p*48|0)|0;b=j+48|0;do{c[j>>2]=c[f>>2];j=j+4|0;f=f+4|0;}while((j|0)<(b|0));b=1;m=1.0;o=c[s>>2]|0;a:while(1){f=c[o>>2]|0;if(!f)break;k=o+4|0;n=+g[k>>2];do if(n<1.0e-05&n>-1.0e-05)f=b;else {hS(a,f);n=+g[k>>2];m=m-n;e=c[o>>2]|0;if(b|0){hJ(F,n,H,E);k=c[H>>2]|0;pS(a,k,c[t>>2]|0,0,0,0);U1(k);if(m<1.0e-05&m>-1.0e-05){I=11;break a}else {f=0;break}}if(m<1.0e-05&m>-1.0e-05){I=13;break a}j=G;f=E;b=j+48|0;do{c[j>>2]=c[f>>2];j=j+4|0;f=f+4|0;}while((j|0)<(b|0));n=+g[k>>2];hJ(G,n/(m+n),H,E);U1(c[G>>2]|0);f=c[H>>2]|0;pS(a,f,c[t>>2]|0,0,0,0);U1(f);f=0;}while(0);b=f;o=o+12|0;}if((I|0)==11){I=0;U1(c[E>>2]|0);}else if((I|0)==13){I=0;o=c[E>>2]|0;pS(a,o,c[A>>2]|0,0,0,0);U1(o);}if(c[u>>2]|0){hS(a,c[c[s>>2]>>2]|0);jS(a,c[c[s>>2]>>2]|0);k=c[F>>2]|0;o=c[u>>2]|0;c[C>>2]=c[z>>2];c[C+4>>2]=c[z+4>>2];c[C+8>>2]=c[z+8>>2];c[C+12>>2]=c[z+12>>2];c[D>>2]=c[k>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[D+12>>2]=c[k+12>>2];ZH(a,2,C,D,h,i,o);}if(c[v>>2]|0){hS(a,e);jS(a,e);k=(c[F>>2]|0)+((c[y>>2]|0)+-1<<4)|0;o=c[v>>2]|0;c[C>>2]=c[x>>2];c[C+4>>2]=c[x+4>>2];c[C+8>>2]=c[x+8>>2];c[C+12>>2]=c[x+12>>2];c[D>>2]=c[k>>2];c[D+4>>2]=c[k+4>>2];c[D+8>>2]=c[k+8>>2];c[D+12>>2]=c[k+12>>2];ZH(a,3,C,D,h,i,o);}do if((c[(c[(c[B>>2]|0)+8>>2]|0)+4>>2]|0)>1){if(!(c[u>>2]|0)){if(!(w&(c[v>>2]|0)!=0))break}else if(q)break;lS(a,d);}while(0);p=p+1|0;}hI(r);e=0;}l=J;return e|0}function _I(b,d){b=b|0;d=d|0;var e=0,f=0;e=1;a:while(1){switch(a[b>>0]|0){case 0:break a;case 58:{e=e+1|0;break}default:{}}b=b+1|0;}f=O((l2(d)|0)+1|0,e)|0;b=f+10|0;if((c[47121]|0)<(f|0)){c[47121]=b;b=W1(c[47122]|0,b)|0;c[47122]=b;}else b=c[47122]|0;r3(b,d)|0;while(1){e=e+-1|0;b=c[47122]|0;if(!e)break;f=b+(l2(b)|0)|0;a[f>>0]=58;a[f+1>>0]=0;F4(b,d)|0;}return b|0}function $I(b){b=b|0;var d=0,e=0;d=c[47184]|0;a:do if(!d)e=7;else {d=RA(b,d)|0;switch(a[d>>0]|0){case 110:if(!(s2(d,135709)|0)){d=1;break a}else {e=7;break a}case 102:if(!(s2(d,100066)|0)){d=2;break a}else {e=7;break a}case 98:{if(!(s2(d,100074)|0)){d=3;break a}if(!(s2(d,111221)|0)){d=4;break a}else {e=7;break a}}default:{e=7;break a}}}while(0);if((e|0)==7){d=(xB(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)|0)!=0;d=d?2:1;}return d|0}function aJ(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function bJ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;e=+h[b>>3]-+h[c>>3];f=+h[b+8>>3]-+h[c+8>>3];d=2.0/+C(+(e*e+.0001+f*f));h[a>>3]=d*f;h[a+8>>3]=-(e*d);return}function cJ(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0;g=+h[c>>3]-+h[d>>3];i=+h[c+8>>3]-+h[d+8>>3];f=+C(+(i*i+g*g));if(f<.0001){j=+h[b>>3]-+h[e>>3];f=+h[b+8>>3]-+h[e+8>>3];i=f;g=j;f=+C(+(j*j+.0001+f*f));}j=2.0/f;h[a>>3]=i*j;h[a+8>>3]=-(j*g);return}function dJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5*(1.0-a/b))}function eJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5)}function fJ(a,b,c){a=+a;b=+b;c=+c;return +(c*.5*(a/b))}function gJ(a,b,c){a=+a;b=+b;c=+c;b=a/b;return +((!(b<=.5)?1.0-b:b)*c)}function hJ(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0;p=l;l=l+16|0;o=p;n=c[a+4>>2]|0;j=(n+-1|0)/3|0;if((n+-4|0)>>>0<3){c[d+4>>2]=4;c[d>>2]=JK(64)|0;c[e+4>>2]=4;n=JK(64)|0;c[e>>2]=n;kP(o,c[a>>2]|0,3,b,c[d>>2]|0,n);}else {n=JK(j<<3)|0;g=0;i=c[a>>2]|0;f=0.0;while(1){if((g|0)>=(j|0))break;q=+iJ(i);h[n+(g<<3)>>3]=q;g=g+1|0;i=i+48|0;f=q+f;}b=f*b;m=0;f=0.0;while(1){if((j|0)<=(m|0))break;f=+h[n+(m<<3)>>3]+f;if(f>=b)break;m=m+1|0;}k=m*3|0;g=k+4|0;i=d+4|0;c[i>>2]=g;c[d>>2]=JK(g<<4)|0;g=((j-m|0)*3|0)+1|0;j=e+4|0;c[j>>2]=g;c[e>>2]=JK(g<<4)|0;g=0;while(1){if((g|0)>=(c[i>>2]|0))break;r=(c[d>>2]|0)+(g<<4)|0;s=(c[a>>2]|0)+(g<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];g=g+1|0;}g=g+-4|0;i=0;while(1){if((i|0)>=(c[j>>2]|0))break;s=(c[e>>2]|0)+(i<<4)|0;r=(c[a>>2]|0)+(g<<4)|0;c[s>>2]=c[r>>2];c[s+4>>2]=c[r+4>>2];c[s+8>>2]=c[r+8>>2];c[s+12>>2]=c[r+12>>2];g=g+1|0;i=i+1|0;}q=+h[n+(m<<3)>>3];kP(o,(c[a>>2]|0)+(k<<4)|0,3,(b-f+q)/q,(c[d>>2]|0)+(k<<4)|0,c[e>>2]|0);U1(n);}l=p;return}function iJ(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0;e=+h[a+16>>3];d=+h[a>>3]-e;f=+h[a+24>>3];b=+h[a+8>>3]-f;d=+C(+(b*b+d*d));b=+h[a+32>>3];e=e-b;c=+h[a+40>>3];f=f-c;d=+C(+(f*f+e*e))+d;b=b-+h[a+48>>3];c=c-+h[a+56>>3];return +(d+ +C(+(c*c+b*b)))}function jJ(b,d){b=b|0;d=d|0;d=yC(d)|0;if((a[(c[d+16>>2]|0)+115>>0]|0)==1)d=eQ(b)|0;else d=bQ(b,d)|0;return qJ(d)|0}function kJ(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=l;l=l+1664|0;m=q+1600|0;n=q+800|0;o=q;p=KK(24)|0;c[p+16>>2]=1;j=((c[e+4>>2]|0)+-1|0)/3|0;h=0;i=p;while(1){if((h|0)>=(j|0))break;k=h*3|0;g=0;while(1){if((g|0)==4)break;r=m+(g<<4)|0;s=(c[e>>2]|0)+(g+k<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];g=g+1|0;}h=h+1|0;i=lJ(m,i)|0;}g=0;h=0;i=p;while(1){if(!i){h=p;g=p;break}j=c[i+16>>2]|0;k=n+(g<<4)|0;e=o+(g<<4)|0;mJ(h,i,j,k,e,f);g=g+1|0;if(!((g|0)==50|(j|0)==0)){h=i;i=j;continue}nJ(a,b,d,g,n,o);c[n>>2]=c[k>>2];c[n+4>>2]=c[k+4>>2];c[n+8>>2]=c[k+8>>2];c[n+12>>2]=c[k+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];h=i;g=1;i=j;}while(1){if(!h)break;s=c[h+16>>2]|0;U1(g);h=s;g=s;}l=q;return}function lJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+144|0;f=g+128|0;d=g+64|0;e=g;if(!(mI(a)|0)){kP(f,a,3,.5,d,e);d=lJ(e,lJ(d,b)|0)|0;}else {d=b+16|0;if((c[d>>2]|0)==1){c[d>>2]=0;c[b>>2]=c[a>>2];c[b+4>>2]=c[a+4>>2];c[b+8>>2]=c[a+8>>2];c[b+12>>2]=c[a+12>>2];}d=a+48|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];d=pJ(f,b)|0;}l=g;return d|0}function mJ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0;r=l;l=l+96|0;n=r+80|0;m=r+64|0;k=r+48|0;o=r+32|0;p=r+16|0;q=r;c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];do if(a){c[p>>2]=c[a>>2];c[p+4>>2]=c[a+4>>2];c[p+8>>2]=c[a+8>>2];c[p+12>>2]=c[a+12>>2];if(!d){i=+h[o>>3];h[q>>3]=i*2.0-+h[p>>3];j=+h[o+8>>3];h[q+8>>3]=j*2.0-+h[p+8>>3];break}else {c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];i=+h[o>>3];j=+h[o+8>>3];break}}else {c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];i=+h[o>>3];h[p>>3]=i*2.0-+h[q>>3];j=+h[o+8>>3];h[p+8>>3]=j*2.0-+h[q+8>>3];}while(0);c[k>>2]=c[p>>2];c[k+4>>2]=c[p+4>>2];c[k+8>>2]=c[p+8>>2];c[k+12>>2]=c[p+12>>2];c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[n>>2]=c[q>>2];c[n+4>>2]=c[q+4>>2];c[n+8>>2]=c[q+8>>2];c[n+12>>2]=c[q+12>>2];t=+oJ(k,m,n);s=+E(+t)*g;g=+F(+t)*g;h[e>>3]=i+s;h[e+8>>3]=j+g;h[f>>3]=i-s;h[f+8>>3]=j-g;l=r;return}function nJ(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;i=e<<1;j=c[d>>2]|0;h=0;k=0;while(1){if((h|0)>=(j|0))break;l=(c[(c[b>>2]|0)+(h<<2)>>2]|0)+k|0;h=h+1|0;k=l;}l=j+1|0;c[d>>2]=l;l=MK(c[b>>2]|0,l<<2)|0;c[b>>2]=l;c[l+(h<<2)>>2]=i;c[a>>2]=MK(c[a>>2]|0,k+i<<4)|0;b=i+-1+k|0;h=0;while(1){if((h|0)>=(e|0))break;l=(c[a>>2]|0)+(h+k<<4)|0;j=f+(h<<4)|0;c[l>>2]=c[j>>2];c[l+4>>2]=c[j+4>>2];c[l+8>>2]=c[j+8>>2];c[l+12>>2]=c[j+12>>2];l=(c[a>>2]|0)+(b-h<<4)|0;j=g+(h<<4)|0;c[l>>2]=c[j>>2];c[l+4>>2]=c[j+4>>2];c[l+8>>2]=c[j+8>>2];c[l+12>>2]=c[j+12>>2];h=h+1|0;}return}function oJ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;f=+h[b+8>>3];d=+h[b>>3];e=+K(+(+h[c+8>>3]-f),+(+h[c>>3]-d));d=+K(+(+h[a+8>>3]-f),+(+h[a>>3]-d));e=e-d;return +((e>0.0?e+-6.283185307179586:e)*.5+d)}function pJ(a,b){a=a|0;b=b|0;var d=0;d=KK(24)|0;c[d+16>>2]=0;c[d>>2]=c[a>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];c[d+12>>2]=c[a+12>>2];c[b+16>>2]=d;return d|0}function qJ(b){b=b|0;var c=0,d=0,e=0,f=0,g=0;c=b;f=b;a:while(1){e=0;while(1){d=c;c=c+1|0;d=a[d>>0]|0;if(!(d<<24>>24))break a;if(e<<24>>24){g=5;break}if(d<<24>>24!=92)break;else e=1;}b:do if((g|0)==5){g=0;switch(d<<24>>24|0){case 114:{d=13;break b}case 108:case 110:{d=10;break b}default:break b}}while(0);a[f>>0]=d;f=f+1|0;}a[f>>0]=0;return b|0}function rJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=c[b>>2]|0;while(1){g=a[e>>0]|0;if(!(g<<24>>24)){f=0;break}f=g<<24>>24;if(!(g<<24>>24==44|(S2(f)|0)!=0)){h=5;break}e=e+1|0;}a:do if((h|0)==5){switch(f|0){case 0:{f=0;break a}case 41:case 40:{e=e+1|0;break a}default:{}}h=d+4|0;i=d+8|0;while(1){if((sJ(g<<24>>24)|0)<<24>>24){f=1;break a}f=c[h>>2]|0;if(f>>>0>=(c[i>>2]|0)>>>0){lA(d,1)|0;f=c[h>>2]|0;}c[h>>2]=f+1;a[f>>0]=g;f=e+1|0;e=f;g=a[f>>0]|0;}}while(0);c[b>>2]=e;return f|0}function sJ(a){a=a|0;switch(a|0){case 0:case 44:case 41:case 40:{a=1;break}default:a=0;}return a|0}function tJ(a,b){a=a|0;b=b|0;return uJ(c[a>>2]|0,c[a+160>>2]|0,c[a+156>>2]|0,b)|0}function uJ(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+160|0;k=o+20|0;m=o+16|0;n=o;c[k>>2]=0;c[m>>2]=0;kA(n,128,o+24|0);nA(n,f)|0;g=n+4|0;f=c[g>>2]|0;if(f>>>0>=(c[n+8>>2]|0)>>>0){lA(n,1)|0;f=c[g>>2]|0;}a[f>>0]=0;h=c[n>>2]|0;c[g>>2]=h;i=b+300|0;j=b+296|0;f=0;g=h;a:while(1){if(f){f=1;break}f=C4(g,c[i>>2]|0,k)|0;if(!f){f=0;break}g=C4(f,c[j>>2]|0,m)|0;h=(g|0)!=0;if(h)f=C4(0,c[j>>2]|0,m)|0;else f=0;switch(((f|0)!=0&1)+(h&1)&3){case 2:{g=vJ(b,g,0)|0;f=vJ(b,f,e)|0;h=(g|0)>(f|0);f=(f&g|0)>-1&(((h?g:f)|0)>=(d|0)&((h?f:g)|0)<=(d|0));g=0;continue a}case 1:{f=(vJ(b,g,d)|0)==(d|0);g=0;continue a}default:{f=0;g=0;continue a}}}oA(n);l=o;return f|0}function vJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=a[d>>0]|0;if(!(h<<24>>24==97?(s2(d,100396)|0)==0:0))f=3;a:do if((f|0)==3){if((wJ(d)|0)<<24>>24){e=q5(d)|0;break}g=c[b+308>>2]|0;if(!g)e=-1;else {b=c[b+312>>2]|0;e=1;while(1){if((e|0)>(b|0)){e=-1;break a}f=c[g+(e<<2)>>2]|0;if(h<<24>>24==(a[f>>0]|0)?(s2(d,f)|0)==0:0)break a;e=e+1|0;}}}while(0);return e|0}function wJ(b){b=b|0;var c=0;while(1){c=a[b>>0]|0;if(!(c<<24>>24)){b=1;break}if(((c&255)+-48|0)>>>0<10)b=b+1|0;else {b=0;break}}return b|0}function xJ(a,b){a=a|0;b=b|0;if((+h[a+16>>3]>=+h[b>>3]?+h[b+16>>3]>=+h[a>>3]:0)?+h[a+24>>3]>=+h[b+8>>3]:0)a=+h[b+24>>3]>=+h[a+8>>3]&1;else a=0;return a|0}function yJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;a:do if((c[b+156>>2]|0)>=2?(f=aP(e,c[47167]|0,195059)|0,(tJ(b,f)|0)<<24>>24==0):0)if(!(a[f>>0]|0))if(!(aB(d,e)|0))f=1;else {f=aB(d,e)|0;while(1){if(!f){f=0;break a}g=aP(f,c[47190]|0,195059)|0;if(!(a[g>>0]|0)){f=1;break a}if((tJ(b,g)|0)<<24>>24){f=1;break a}f=bB(d,f,e)|0;}}else f=0;else f=1;while(0);return f|0}function zJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+64|0;e=d+32|0;f=d;a=(c[a+16>>2]|0)+48|0;c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[f+16>>2]=c[a+16>>2];c[f+20>>2]=c[a+20>>2];c[f+24>>2]=c[a+24>>2];c[f+28>>2]=c[a+28>>2];c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];c[e+16>>2]=c[b+16>>2];c[e+20>>2]=c[b+20>>2];c[e+24>>2]=c[b+24>>2];c[e+28>>2]=c[b+28>>2];b=(xJ(f,e)|0)&255;l=d;return b|0}function AJ(a,d){a=a|0;d=d|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0,u=0.0,v=0.0;r=c[a+152>>2]|0;s=aI(a)|0;c[s+4>>2]=2;c[s+8>>2]=d;c[s+12>>2]=8;if(r&16777216|0){if((e[(c[(xC(d)|0)+16>>2]|0)+178>>1]|0)>2){f=+h[(c[(c[d+16>>2]|0)+132>>2]|0)+16>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);}else f=0.0;h[s+168>>3]=f;}k=d+16|0;CJ(a,c[(c[k>>2]|0)+104>>2]|0,d);do if(r&4259840|0){if((c[s+208>>2]|0)==0?(b[s+260>>1]&1)==0:0)break;p=WM(d)|0;l=c[k>>2]|0;f=+h[l+16>>3];q=+h[l+24>>3];l=DJ(d)|0;a:do if((p|2|0)==3){n=c[(c[k>>2]|0)+12>>2]|0;if(!((EJ(n)|0)<<24>>24))g=0;else g=(c[n+4>>2]|l|0)!=0;if(!((r&524288|0)==0|((n|0)==0|g))){i=n+8|0;o=c[i>>2]|0;o=(o|0)<3?1:o;j=n+4|0;m=c[j>>2]|0;m=(m|0)>1?m:1;p=c[n+44>>2]|0;g=QA(d,102705)|0;if(!g)g=0;else g=q5(g)|0;g=(g+-4|0)>>>0>56?20:g;if(!(c[j>>2]|l)){c[s+264>>2]=0;i=JK(32)|0;g=c[k>>2]|0;v=+h[g+88>>3];h[i>>3]=f-v;u=+h[g+80>>3]*.5;h[i+8>>3]=q-u;h[i+16>>3]=v+f;h[i+24>>3]=u+q;g=2;break}i=c[i>>2]|0;if(((i|0)<3?+h[n+32>>3]==0.0:0)?+h[n+24>>3]==0.0:0){i=s+264|0;if(c[n>>2]|0){c[i>>2]=1;i=JK(32)|0;h[i>>3]=f;h[i+8>>3]=q;g=(m<<1)+-1|0;h[i+16>>3]=+h[p+(g<<4)>>3]+f;h[i+24>>3]=+h[p+(g<<4)+8>>3]+q;g=2;break}c[i>>2]=2;i=(m<<1)+-1|0;i=FJ(+h[p+(i<<4)>>3],+h[p+(i<<4)+8>>3],g)|0;j=0;while(1){if((j|0)>=(g|0))break a;p=i+(j<<4)|0;h[p>>3]=+h[p>>3]+f;p=i+(j<<4)+8|0;h[p>>3]=+h[p>>3]+q;j=j+1|0;}}m=O(i,m+-1|0)|0;c[s+264>>2]=2;if((i|0)<(g|0)){i=JK(o<<4)|0;g=0;while(1){if((g|0)>=(o|0)){g=o;break a}n=g+m|0;h[i+(g<<4)>>3]=+h[p+(n<<4)>>3]+f;h[i+(g<<4)+8>>3]=+h[p+(n<<4)+8>>3]+q;g=g+1|0;}}else {l=(i|0)/(g|0)|0;i=JK(g<<4)|0;j=0;k=0;while(1){if((j|0)>=(g|0))break a;o=k+m|0;h[i+(j<<4)>>3]=+h[p+(o<<4)>>3]+f;h[i+(j<<4)+8>>3]=+h[p+(o<<4)+8>>3]+q;j=j+1|0;k=k+l|0;}}}else t=31;}else t=31;while(0);if((t|0)==31){c[s+264>>2]=0;i=JK(32)|0;g=c[k>>2]|0;h[i>>3]=f-+h[g+88>>3];v=+h[g+80>>3]*.5;h[i+8>>3]=q-v;h[i+16>>3]=+h[g+96>>3]+f;h[i+24>>3]=v+q;g=2;}if(!(r&8192))NR(a,i,i,g)|0;c[s+272>>2]=i;c[s+268>>2]=g;}while(0);HT(QA(d,100032)|0);_R(a,d);return}function BJ(a){a=a|0;$R(a);bI(a);return}function CJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+144|0;j=m;f=QA(e,141055)|0;i=QA(e,141101)|0;k=QA(e,141088)|0;kA(j,128,m+16|0);if(!d)h=0;else h=c[d>>2]|0;if(!((f|0)!=0?(a[f>>0]|0)!=0:0))f=QA(e,111477)|0;g=dI(b,e,j)|0;if(!i)d=0;else d=jJ(i,e)|0;cI(b,h,f,d,k,g,e)|0;U1(d);oA(j);l=m;return}function DJ(b){b=b|0;var d=0,e=0;b=bP(b,c[47157]|0,195059)|0;a:do if(!(a[b>>0]|0))b=0;else {PI(b)|0;b=0;d=188228;while(1){e=c[d>>2]|0;if(!e)break a;e=(s2(e,111101)|0)==0;b=e?1:b;d=d+4|0;}}while(0);return b|0}function EJ(a){a=a|0;var b=0.0;if(((c[a+8>>2]|0)==4?(b=+h[a+16>>3],((~~(b+(b>=0.0?.5:-.5))|0)%90|0|0)==0):0)?+h[a+24>>3]==0.0:0)a=+h[a+32>>3]==0.0&1;else a=0;return a|0}function FJ(a,b,c){a=+a;b=+b;c=c|0;var d=0.0,e=0,f=0.0,g=0;f=6.283185307179586/+(c|0);g=JK(c<<4)|0;d=0.0;e=0;while(1){if((e|0)>=(c|0))break;h[g+(e<<4)>>3]=+E(+d)*a;h[g+(e<<4)+8>>3]=+F(+d)*b;d=d+f;e=e+1|0;}return g|0}function GJ(b,d){b=b|0;d=d|0;var e=0;a:do if((c[b+156>>2]|0)>=2?(e=aP(d,GA(d,0,101510,0)|0,195059)|0,(tJ(b,e)|0)<<24>>24==0):0)if(!(a[e>>0]|0)){e=jC(d)|0;while(1){if(!e){e=0;break a}if((yJ(b,d,e)|0)<<24>>24){e=1;break a}e=kC(d,e)|0;}}else e=0;else e=1;while(0);return e|0}function HJ(a,b){a=a|0;b=b|0;var d=0;d=aI(a)|0;c[d+4>>2]=1;c[d+8>>2]=b;c[d+12>>2]=1;CJ(a,c[(c[b+16>>2]|0)+12>>2]|0,b);UR(a,b);return}function IJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;b=QA(b,141082)|0;a:do if((b|0)!=0?(a[b>>0]|0)!=0:0){PI(b)|0;e=188228;b=0;while(1){while(1){f=c[e>>2]|0;if(!f){e=188228;break a}if(!(s2(f,111101)|0)){g=10;break}if(!(s2(f,106334)|0)){f=e;g=12;break}if(!(s2(f,106341)|0)){f=e;g=14;break}if(!(s2(f,106316)|0)){f=e;g=16;break}e=e+4|0;}if((g|0)==10){e=e+4|0;b=b|1;continue}else if((g|0)==12){while(1){h=f;f=f+4|0;g=c[f>>2]|0;c[h>>2]=g;if(!g)break;else g=12;}b=b|3;continue}else if((g|0)==14){while(1){g=f;f=f+4|0;h=c[f>>2]|0;c[g>>2]=h;if(!h)break;else g=14;}b=b|64;continue}else if((g|0)==16){while(1){g=f;f=f+4|0;h=c[f>>2]|0;c[g>>2]=h;if(!h)break;else g=16;}b=b|4;continue}}}else {e=0;b=0;}while(0);c[d>>2]=b;return e|0}function JJ(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;i=k;j=k+4|0;c[j>>2]=0;m=(gI(b,0,j)|0)==0;j=c[j>>2]|0;if((m?(f=c[j>>2]|0,(f|0)>=2):0)?(h=j+8|0,(c[c[h>>2]>>2]|0)!=0):0){if((f|0)>2)gA(0,100415,i)|0;m=KK((l2(b)|0)+1|0)|0;c[d>>2]=m;r3(m,c[c[h>>2]>>2]|0)|0;if(!(c[(c[h>>2]|0)+12>>2]|0))c[d+4>>2]=0;else {m=c[d>>2]|0;m=m+((l2(m)|0)+1)|0;c[d+4>>2]=m;r3(m,c[(c[h>>2]|0)+12>>2]|0)|0;}b=c[h>>2]|0;do if(!(a[b+8>>0]|0))if(!(a[b+20>>0]|0)){g[e>>2]=0.0;break}else {g[e>>2]=1.0-+g[b+16>>2];break}else c[e>>2]=c[b+4>>2];while(0);hI(j);b=1;}else {c[d>>2]=0;hI(j);b=0;}l=k;return b|0}function KJ(a,b){a=a|0;b=b|0;VR(a,b);bI(a);return}function LJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;x=l;l=l+96|0;p=x+48|0;s=x+16|0;w=x+8|0;v=x;t=x+80|0;c[t>>2]=1e3;f=KK(16e3)|0;u=a+256|0;e=1;j=1;i=0;q=0;r=c[b+8>>2]|0;while(1){if((q|0)>=(c[b>>2]|0))break;d=c[r>>2]|0;a:do switch(d|0){case 1:case 0:{n=r+80|0;c[s>>2]=c[n>>2];c[s+4>>2]=c[n+4>>2];c[s+8>>2]=c[n+8>>2];c[s+12>>2]=c[n+12>>2];c[s+16>>2]=c[n+16>>2];c[s+20>>2]=c[n+20>>2];c[s+24>>2]=c[n+24>>2];c[s+28>>2]=c[n+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {z=r+8|0;A=r+24|0;h[f>>3]=+h[z>>3]-+h[A>>3];n=r+16|0;y=r+32|0;h[f+8>>3]=+h[n>>3]-+h[y>>3];h[f+16>>3]=+h[A>>3]+ +h[z>>3];h[f+24>>3]=+h[y>>3]+ +h[n>>3];mS(a,f,2,(d|0)==0?j:0);d=j;}break}case 3:case 2:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;nS(a,f,c[d>>2]|0,(c[r>>2]|0)==2?j:0);d=j;}break}case 5:case 4:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;pS(a,f,c[d>>2]|0,0,0,(c[r>>2]|0)==4?j&255:0);d=j;}break}case 6:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {d=r+8|0;f=MJ(f,t,c[d+4>>2]|0,c[d>>2]|0)|0;qS(a,f,c[d>>2]|0);d=j;}break}case 7:{A=r+80|0;c[s>>2]=c[A>>2];c[s+4>>2]=c[A+4>>2];c[s+8>>2]=c[A+8>>2];c[s+12>>2]=c[A+12>>2];c[s+16>>2]=c[A+16>>2];c[s+20>>2]=c[A+20>>2];c[s+24>>2]=c[A+24>>2];c[s+28>>2]=c[A+28>>2];c[p>>2]=c[u>>2];c[p+4>>2]=c[u+4>>2];c[p+8>>2]=c[u+8>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[u+16>>2];c[p+20>>2]=c[u+20>>2];c[p+24>>2]=c[u+24>>2];c[p+28>>2]=c[u+28>>2];if(!(xJ(s,p)|0))d=j;else {h[f>>3]=+h[r+8>>3];h[f+8>>3]=+h[r+16>>3];d=c[r+112>>2]|0;c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];gS(a,p,d);d=j;}break}case 8:{jS(a,c[r+8>>2]|0);d=1;break}case 9:{hS(a,c[r+8>>2]|0);d=1;break}case 13:{if((c[r+8>>2]|0)!=2){d=r+16|0;z=c[d+36>>2]|0;A=c[z+12>>2]|0;o=+g[z+8>>2];d=~~(+K(+(+h[r+40>>3]-+h[r+24>>3]),+(+h[r+32>>3]-+h[d>>3]))*57.29577951308232);jS(a,c[z+4>>2]|0);kS(a,A,d,o);d=2;break a}A=c[r+68>>2]|0;j=c[A+4>>2]|0;n=c[A+12>>2]|0;o=+g[A+8>>2];k=+h[r+40>>3];m=+h[r+16>>3];if(k==m?+h[r+48>>3]==+h[r+24>>3]:0)d=0;else d=~~(+H(+((m-k)/+h[r+32>>3]))*57.29577951308232);jS(a,j);kS(a,n,d,o);d=3;break}case 14:{gA(0,100481,v)|0;d=j;break}case 12:{if(!e){e=0;d=j;}else {gA(0,100521,w)|0;e=0;d=j;}break}case 11:{PI(c[r+8>>2]|0)|0;lS(a,188228);i=188228;d=j;break}default:d=j;}while(0);j=d;q=q+1|0;r=r+120|0;}if(i|0)lS(a,c[(c[a>>2]|0)+336>>2]|0);U1(f);l=x;return}function MJ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[b>>2]|0;f=g<<1;f=(f|0)>(e|0)?f:e;if((g|0)<(e|0)){a=MK(a,f<<4)|0;c[b>>2]=f;}b=0;while(1){if((b|0)>=(e|0))break;h[a+(b<<4)>>3]=+h[d+(b*24|0)>>3];h[a+(b<<4)+8>>3]=+h[d+(b*24|0)+8>>3];b=b+1|0;}return a|0}function NJ(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;c[a>>2]=c[b+4>>2];c[a+4>>2]=d;return}function OJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=d+16|0;f=1;while(1){d=c[g>>2]|0;if((f|0)>(c[d+180>>2]|0))break;e=c[(c[d+184>>2]|0)+(f<<2)>>2]|0;OJ(b,e);d=QA(e,140823)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,137729)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,140977)|0;if(d|0?a[d>>0]|0:0)hS(b,d);d=QA(e,101418)|0;if(d|0?a[d>>0]|0:0)jS(b,d);d=QA(e,101446)|0;if(d|0?a[d>>0]|0:0)hS(b,d);f=f+1|0;}return}function PJ(a){a=a|0;var b=0,d=0,e=0;b=c[47127]|0;if(!b){b=Vz(20628,c[4581]|0)|0;c[47127]=b;}if(!(nb[c[b>>2]&63](b,a,4)|0)){d=c[47127]|0;e=c[d>>2]|0;b=D4(a)|0;nb[e&63](d,b,1)|0;b=1;}else b=0;return b|0}function QJ(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function RJ(a){a=a|0;var b=0;b=c[47128]|0;if(!a){if((b|0)>0?(b=b+-1|0,c[47128]=b,(b|0)==0):0){Z3(1,c[47129]|0)|0;U1(c[47129]|0);}}else {c[47128]=b+1;if(!b){c[47129]=D4(Z3(1,0)|0)|0;Z3(1,153563)|0;}}return}function SJ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;u=l;l=l+96|0;r=u+72|0;q=u+56|0;p=u+48|0;t=u+32|0;s=u+24|0;e=u+8|0;d=u;if(0);do if((TC(b,137483,0,1)|0)!=0?(o=b+16|0,(c[(c[o>>2]|0)+8>>2]|0)!=0):0){TJ(b);UJ(a,b);VJ(a,b);RJ(1);j=a+56|0;k=a+184|0;m=a+192|0;n=a+28|0;i=EF(a)|0;a:while(1){if(!i){g=33;break}d=c[j>>2]|0;if(!d){c[i+20>>2]=0;d=0;}else {c[i+20>>2]=c[d+8>>2];d=c[d+12>>2]|0;}c[i+24>>2]=d;c[i+12>>2]=a;c[i+28>>2]=c[k>>2];c[i+620>>2]=25764;c[i+624>>2]=14;if(!(c[(c[o>>2]|0)+8>>2]|0)){g=13;break}e=i+52|0;g=JR(i,c[e>>2]|0)|0;c[i+56>>2]=g;switch(g|0){case 999:{g=16;break a}case 21:{d=1;break}case 24:{d=520;break}default:d=WJ(b)|0;}f=i+152|0;c[f>>2]=c[f>>2]|d;d=c[m>>2]|0;do if(!d)g=24;else {if(c[d+152>>2]&32|0?(s2(c[e>>2]|0,c[d+52>>2]|0)|0)==0:0){d=c[47130]|0;if(!d){g=27;break}c[d+8>>2]=i;c[i+36>>2]=c[d+36>>2];g=29;break}LR(d);c[m>>2]=0;c[n>>2]=0;g=24;}while(0);if((g|0)==24){c[47130]=0;g=27;}if((g|0)==27?(g=0,(KR(i)|0)==0):0){c[m>>2]=i;g=29;}if((g|0)==29){c[i+8>>2]=0;c[i+104>>2]=25876;XJ(i);YJ(i);ZJ(i,b);_J(i,b);$J(i,b);if(!(c[f>>2]&128))sI(i,b);c[47130]=i;}i=FF(a)|0;}if((g|0)==13){gA(1,100679,s)|0;RJ(0);if(!0){d=-1;break}d=c[15712]|0;s=KB(b)|0;v=+UO();c[t>>2]=s;h[t+8>>3]=v;w4(d,100650,t)|0;d=-1;break}else if((g|0)==16){c[p>>2]=c[e>>2];gA(1,100700,p)|0;RJ(0);if(!0){d=-1;break}d=c[15712]|0;t=KB(b)|0;v=+UO();c[q>>2]=t;h[q+8>>3]=v;w4(d,100650,q)|0;d=-1;break}else if((g|0)==33){RJ(0);if(!0){d=0;break}d=c[15712]|0;t=KB(b)|0;v=+UO();c[r>>2]=t;h[r+8>>3]=v;w4(d,100650,r)|0;d=0;break}}else g=5;while(0);if((g|0)==5){gA(1,100602,d)|0;if(!0)d=-1;}l=u;return d|0}function TJ(a){a=a|0;var b=0;b=jC(a)|0;while(1){if(!b)break;eK(a,b);b=kC(a,b)|0;}return}function UJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+32|0;k=o+24|0;f=o+16|0;j=o+8|0;n=o;c[b+168>>2]=d;g=b+293|0;a[g>>0]=0;e=QA(d,105496)|0;if(e|0?(c[f>>2]=j,c[f+4>>2]=n,i=b5(e,105503,f)|0,(i|0)>0):0){p=+h[j>>3]*72.0;e=b+208|0;h[e>>3]=p;h[b+200>>3]=p;if((i|0)!=1)h[e>>3]=+h[n>>3]*72.0;a[g>>0]=1;}f=b+292|0;a[f>>0]=0;e=QA(d,101102)|0;if(e|0?(c[k>>2]=j,c[k+4>>2]=n,m=b5(e,105503,k)|0,(m|0)>0):0){p=+h[j>>3]*72.0;e=b+224|0;h[e>>3]=p;h[b+216>>3]=p;if((m|0)!=1)h[e>>3]=+h[n>>3]*72.0;a[f>>0]=1;}e=b+294|0;a[e>>0]=0;f=b+232|0;g=d+16|0;n=(c[(c[g>>2]|0)+8>>2]|0)+48|0;c[f>>2]=c[n>>2];c[f+4>>2]=c[n+4>>2];c[f+8>>2]=c[n+8>>2];c[f+12>>2]=c[n+12>>2];f=c[(c[g>>2]|0)+8>>2]|0;if(+h[f+48>>3]>.001?+h[f+56>>3]>.001:0)a[e>>0]=1;c[b+288>>2]=a[f+81>>0]|0?90:0;e=b+196|0;c[e>>2]=101106;f=QA(d,101109)|0;if(f|0?a[f>>0]|0:0)c[e>>2]=f;n=b+256|0;m=(c[g>>2]|0)+16|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];c[n+8>>2]=c[m+8>>2];c[n+12>>2]=c[m+12>>2];c[n+16>>2]=c[m+16>>2];c[n+20>>2]=c[m+20>>2];c[n+24>>2]=c[m+24>>2];c[n+28>>2]=c[m+28>>2];c[47141]=GA(d,0,101472,0)|0;c[47142]=GA(d,0,101463,0)|0;c[b+320>>2]=bP(0,c[47151]|0,107994)|0;h[b+328>>3]=+_O(0,c[47150]|0,14.0,1.0);c[b+336>>2]=20664;c[b+188>>2]=KB(d)|0;l=o;return}function VJ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=b+304|0;f=c[e>>2]|0;if(f|0){U1(f);c[e>>2]=0;}f=b+308|0;e=c[f>>2]|0;if(e|0){U1(e);c[f>>2]=0;}g=b+316|0;e=c[g>>2]|0;if(e|0){U1(e);c[g>>2]=0;}e=QA(d,100853)|0;if(e){c[b+312>>2]=cK(b,d,e)|0;e=QA(d,100860)|0;if(e|0?a[e>>0]|0:0)c[g>>2]=dK(b,e)|0;}else {c[f>>2]=0;c[b+312>>2]=1;}return}function WJ(b){b=b|0;b=QA(b,100821)|0;a:do if(!b)b=0;else switch(a[b>>0]|0){case 110:{if(!(s2(b+1|0,100833)|0))b=1;else {b=0;break a}break}case 101:{if(!(s2(b+1|0,100843)|0))b=16;else {b=0;break a}break}default:{b=0;break a}}while(0);return b|0}function XJ(b){b=b|0;var d=0.0,e=0;e=c[b>>2]|0;if(!(a[e+292>>0]|0)){if((c[b+56>>2]|0)==300)d=+h[(c[b+68>>2]|0)+8>>3];else d=4.0;h[b+248>>3]=d;h[b+240>>3]=d;}else {b=b+240|0;e=e+216|0;c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];}return}function YJ(b){b=b|0;var d=0;d=c[b>>2]|0;a:do if(!(a[d+293>>0]|0))switch(c[b+56>>2]|0){case 300:{d=b+416|0;b=(c[b+84>>2]|0)+8|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];break a}case 30:case 21:case 22:case 4:case 3:case 2:{h[b+424>>3]=36.0;h[b+416>>3]=36.0;break a}default:{d=b+416|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;break a}}else {b=b+416|0;d=d+200|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];}while(0);return}function ZJ(b,d){b=b|0;d=d|0;var e=0.0,f=0;f=c[(c[b>>2]|0)+192>>2]|0;e=+h[(c[(c[d+16>>2]|0)+8>>2]|0)+24>>3];do if(!(e!=0.0)){if(f|0?a[f+128>>0]|0:0){b=b+432|0;f=f+112|0;c[b>>2]=c[f>>2];c[b+4>>2]=c[f+4>>2];c[b+8>>2]=c[f+8>>2];c[b+12>>2]=c[f+12>>2];break}d=b+432|0;if((c[b+56>>2]|0)==300){b=(c[b+84>>2]|0)+40|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];break}else {h[b+440>>3]=96.0;h[d>>3]=96.0;break}}else {h[b+440>>3]=e;h[b+432>>3]=e;}while(0);return}function _J(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;A=l;l=l+112|0;t=A+80|0;u=A+56|0;s=A+40|0;v=A+32|0;w=A+24|0;x=A+16|0;y=A+8|0;z=A;m=c[b>>2]|0;o=+h[m+272>>3];q=+h[m+280>>3];p=+h[m+256>>3];r=+h[m+264>>3];f=+h[b+240>>3];e=p-f;h[b+208>>3]=e;i=+h[b+248>>3];j=r-i;h[b+216>>3]=j;f=f+o;h[b+224>>3]=f;i=i+q;h[b+232>>3]=i;e=f-e;j=i-j;h[x>>3]=1.0;g=c[(c[d+16>>2]|0)+8>>2]|0;i=+h[g+64>>3];do if(i>.001?(k=+h[g+72>>3],k>.001):0){e=e==0.0?i:e;f=j==0.0?k:j;if(!(if&(i>e&(a[g+80>>0]|0)!=0)):0){k=e;j=f;i=1.0;break}n=i/e>3]=i;k=e;j=f;}else {k=e;i=1.0;}while(0);f=(p+o)*.5;h[y>>3]=f;e=(r+q)*.5;h[z>>3]=e;c[b+360>>2]=c[m+288>>2];k=i*k;h[v>>3]=k;j=i*j;h[w>>3]=j;g=QA(d,100752)|0;if(g){m=T1((l2(g)|0)+1|0)|0;n=T1((l2(g)|0)+1|0)|0;c[s>>2]=v;c[s+4>>2]=w;c[s+8>>2]=x;c[s+12>>2]=m;do if((b5(g,100761,s)|0)==4){g=tC(c[d+60>>2]|0,m,0)|0;if(g|0){u=c[g+16>>2]|0;h[y>>3]=+h[u+16>>3];h[z>>3]=+h[u+24>>3];}}else {c[u>>2]=v;c[u+4>>2]=w;c[u+8>>2]=x;c[u+12>>2]=m;c[u+16>>2]=n;if((b5(g,100781,u)|0)!=4){c[t>>2]=v;c[t+4>>2]=w;c[t+8>>2]=x;c[t+12>>2]=y;c[t+16>>2]=z;b5(g,100801,t)|0;break}g=tC(c[d+60>>2]|0,m,0)|0;if(g|0){u=c[g+16>>2]|0;h[y>>3]=+h[u+16>>3];h[z>>3]=+h[u+24>>3];}}while(0);U1(m);U1(n);k=+h[v>>3];j=+h[w>>3];i=+h[x>>3];f=+h[y>>3];e=+h[z>>3];}h[b+368>>3]=k;h[b+376>>3]=j;h[b+352>>3]=i;h[b+336>>3]=f;h[b+344>>3]=e;l=A;return}function $J(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0,P=0.0,Q=0.0;M=l;l=l+224|0;J=M+200|0;z=M+168|0;E=M+144|0;I=M+120|0;F=M+96|0;G=M+64|0;e=M+184|0;v=M+176|0;w=M+160|0;y=M+136|0;x=M+112|0;A=M+80|0;B=M+48|0;C=M+32|0;D=M+16|0;K=M+8|0;L=M;u=c[b>>2]|0;c[G>>2]=0;c[G+4>>2]=0;c[G+8>>2]=0;c[G+12>>2]=0;H=b+368|0;c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2];H=b+360|0;if(c[H>>2]|0){c[J>>2]=c[I>>2];c[J+4>>2]=c[I+4>>2];c[J+8>>2]=c[I+8>>2];c[J+12>>2]=c[I+12>>2];aK(e,J);c[I>>2]=c[e>>2];c[I+4>>2]=c[e+4>>2];c[I+8>>2]=c[e+8>>2];c[I+12>>2]=c[e+12>>2];}t=b+416|0;c[F>>2]=c[t>>2];c[F+4>>2]=c[t+4>>2];c[F+8>>2]=c[t+8>>2];c[F+12>>2]=c[t+12>>2];if((a[u+294>>0]|0)!=0?(c[b+152>>2]&32|0)!=0:0){i=+h[u+232>>3]-+h[F>>3]*2.0;h[E>>3]=i;k=+h[u+240>>3]-+h[F+8>>3]*2.0;p=E+8|0;h[p>>3]=k;if(!(i<.0001)){o=+h[I>>3];e=~~(o/i);f=b+164|0;c[f>>2]=e;if(o-i*+(e|0)>.0001){e=e+1|0;c[f>>2]=e;}}else {c[b+164>>2]=1;e=1;}if(!(k<.0001)){g=+h[I+8>>3];f=~~(g/k);j=b+168|0;c[j>>2]=f;if(g-k*+(f|0)>.0001){f=f+1|0;c[j>>2]=f;}}else {c[b+168>>2]=1;f=1;g=+h[I+8>>3];}c[b+204>>2]=O(f,e)|0;o=+h[(+h[I>>3]>3];h[I>>3]=o;e=p;f=I;m=+h[(g>3];g=o;j=21;}else {if(c[b+68>>2]|0){e=c[b+84>>2]|0;i=+h[e+24>>3]-+h[F>>3]*2.0;i=i<0.0?0.0:i;h[E>>3]=i;o=+h[e+32>>3]-+h[F+8>>3]*2.0;e=E+8|0;h[e>>3]=o;if(o<0.0){f=E;j=17;}else e=E;}else {h[E+8>>3]=0.0;f=E;e=E;j=17;}if((j|0)==17){h[e>>3]=0.0;e=f;i=+h[f>>3];}c[b+204>>2]=1;c[b+168>>2]=1;c[b+164>>2]=1;g=+h[I>>3];if(i>3]=g;i=g;}e=E+8|0;k=+h[e>>3];m=+h[I+8>>3];if(k>3]=m;r=e;m=+h[e>>3];}n=+h[F>>3];s=b+432|0;k=+h[s>>3]*.013888888888888888*(n*2.0+i);c[b+448>>2]=~~(k+(k>=0.0?.5:-.5));q=F+8|0;k=+h[q>>3];t=b+440|0;o=+h[t>>3]*.013888888888888888*(k*2.0+m);c[b+452>>2]=~~(o+(o>=0.0?.5:-.5));j=b+188|0;p=b+180|0;e=b+172|0;f=u+196|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;bK(v,b,a[c[f>>2]>>0]|0);u=v;v=c[u+4>>2]|0;e=p;c[e>>2]=c[u>>2];c[e+4>>2]=v;bK(w,b,a[(c[f>>2]|0)+1>>0]|0);e=w;w=c[e>>2]|0;e=c[e+4>>2]|0;v=j;c[v>>2]=w;c[v+4>>2]=e;w=(c[p>>2]|0)+w|0;if(!((((w|0)>-1?w:0-w|0)|0)==1?(w=(c[b+184>>2]|0)+e|0,(((w|0)>-1?w:0-w|0)|0)==1):0)){bK(y,b,66);v=y;y=c[v+4>>2]|0;w=p;c[w>>2]=c[v>>2];c[w+4>>2]=y;bK(x,b,76);w=x;x=c[w+4>>2]|0;y=j;c[y>>2]=c[w>>2];c[y+4>>2]=x;c[z>>2]=c[f>>2];gA(0,100732,z)|0;}if(a[(c[(c[d+16>>2]|0)+8>>2]|0)+82>>0]|0){if(i>g){m=(i-g)*.5;h[G>>3]=m;}else m=0.0;i=+h[r>>3];o=+h[I+8>>3];if(i>o){i=(i-o)*.5;h[G+8>>3]=i;}else i=0.0;}else {i=0.0;m=0.0;}if(!(c[H>>2]|0))j=1;else {c[J>>2]=c[I>>2];c[J+4>>2]=c[I+4>>2];c[J+8>>2]=c[I+8>>2];c[J+12>>2]=c[I+12>>2];aK(A,J);c[I>>2]=c[A>>2];c[I+4>>2]=c[A+4>>2];c[I+8>>2]=c[A+8>>2];c[I+12>>2]=c[A+12>>2];c[J>>2]=c[E>>2];c[J+4>>2]=c[E+4>>2];c[J+8>>2]=c[E+8>>2];c[J+12>>2]=c[E+12>>2];aK(B,J);c[E>>2]=c[B>>2];c[E+4>>2]=c[B+4>>2];c[E+8>>2]=c[B+8>>2];c[E+12>>2]=c[B+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];aK(C,J);c[F>>2]=c[C>>2];c[F+4>>2]=c[C+4>>2];c[F+8>>2]=c[C+8>>2];c[F+12>>2]=c[C+12>>2];c[J>>2]=c[G>>2];c[J+4>>2]=c[G+4>>2];c[J+8>>2]=c[G+8>>2];c[J+12>>2]=c[G+12>>2];aK(D,J);c[G>>2]=c[D>>2];c[G+4>>2]=c[D+4>>2];c[G+8>>2]=c[D+8>>2];c[G+12>>2]=c[D+12>>2];n=+h[F>>3];m=+h[G>>3];k=+h[q>>3];i=+h[G+8>>3];g=+h[I>>3];j=(c[H>>2]|0)==0;}o=m+n;h[b+384>>3]=o;P=i+k;h[b+392>>3]=P;N=m+n+g;h[b+400>>3]=N;Q=+h[I+8>>3];n=i+k+Q;h[b+408>>3]=n;m=+h[b+352>>3];h[b+320>>3]=g/m;h[b+328>>3]=Q/m;m=+h[s>>3];o=o*.013888888888888888*m;f=b+456|0;c[f>>2]=~~(o+(o>=0.0?.5:-.5));o=+h[t>>3];k=P*.013888888888888888*o;c[b+460>>2]=~~(k+(k>=0.0?.5:-.5));m=N*.013888888888888888*m;e=b+464|0;c[e>>2]=~~(m+(m>=0.0?.5:-.5));o=n*.013888888888888888*o;c[b+468>>2]=~~(o+(o>=0.0?.5:-.5));if(!j){c[J>>2]=c[f>>2];c[J+4>>2]=c[f+4>>2];NJ(K,J);I=K;K=c[I+4>>2]|0;b=f;c[b>>2]=c[I>>2];c[b+4>>2]=K;c[J>>2]=c[e>>2];c[J+4>>2]=c[e+4>>2];NJ(L,J);b=L;K=c[b+4>>2]|0;L=e;c[L>>2]=c[b>>2];c[L+4>>2]=K;}l=M;return}function aK(a,b){a=a|0;b=b|0;var c=0.0;c=+h[b>>3];h[a>>3]=+h[b+8>>3];h[a+8>>3]=c;return}function bK(a,b,d){a=a|0;b=b|0;d=d|0;d=(d<<24>>24)+-66|0;switch(d>>>1|d<<31|0){case 9:{c[b+176>>2]=(c[b+168>>2]|0)+-1;b=0;d=-1;break}case 0:{b=0;d=1;break}case 5:{b=1;d=0;break}case 8:{c[b+172>>2]=(c[b+164>>2]|0)+-1;b=-1;d=0;break}default:{b=0;d=0;}}c[a>>2]=b;c[a+4>>2]=d;return}function cK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;f=QA(d,100973)|0;i=b+296|0;c[i>>2]=(f|0)==0?100982:f;d=QA(d,100986)|0;f=b+300|0;d=(d|0)==0?100999:d;c[f>>2]=d;d=G4(c[i>>2]|0,d)|0;if(d|0){c[g>>2]=a[d>>0];gA(0,101001,g)|0;c[f>>2]=195059;}d=D4(e)|0;c[b+304>>2]=d;h=b+308|0;f=0;b=0;while(1){e=A4(d,c[i>>2]|0)|0;if(!e)break;g=b+1|0;if((b|0)<(f|0))d=c[h>>2]|0;else {f=f+128|0;d=c[h>>2]|0;if(!d)d=KK(f<<2)|0;else d=MK(d,f<<2)|0;c[h>>2]=d;}c[d+(g<<2)>>2]=e;b=g;d=0;}if(b|0){i=MK(c[h>>2]|0,(b<<2)+8|0)|0;c[h>>2]=i;c[i>>2]=0;c[(c[h>>2]|0)+(b+1<<2)>>2]=0;}l=j;return b|0}function dK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k;i=a+312|0;d=KK((c[i>>2]<<2)+8|0)|0;e=0;h=1;while(1){g=c[i>>2]|0;if((h|0)>(g|0))break;f=e+1|0;if((uJ(a,h,g,b)|0)<<24>>24){c[d+(f<<2)>>2]=h;e=f;}h=h+1|0;}if(!e){c[j>>2]=b;gA(0,100872,j)|0;U1(d);d=0;}else {c[d>>2]=e;c[d+(e+1<<2)>>2]=(c[i>>2]|0)+1;}l=k;return d|0}function eK(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0;d=c[b+16>>2]|0;g=+h[d+16>>3];h[d+48>>3]=g-+h[d+88>>3];e=+h[d+24>>3];f=+h[d+80>>3]*.5;h[d+56>>3]=e-f;h[d+64>>3]=+h[d+96>>3]+g;h[d+72>>3]=f+e;b=XA(a,b)|0;while(1){if(!b)break;fK(b);b=ZA(a,b)|0;}return}function fK(a){a=a|0;a=c[(c[a+16>>2]|0)+8>>2]|0;if(a|0)gK(a);return}function gK(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;C=l;l=l+240|0;v=C+192|0;u=C+176|0;w=C+64|0;x=C+32|0;y=C;z=C+144|0;A=C+112|0;B=a+4|0;if((c[B>>2]|0)<=0)qa(101140,99906,3994,101154);b=c[a>>2]|0;d=w;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));d=v;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));hK(x,v);i=x+8|0;j=y+8|0;k=x+16|0;m=y+16|0;n=x+24|0;o=y+24|0;p=w+8|0;q=w+12|0;r=w+32|0;s=w+4|0;t=w+16|0;g=0;while(1){if((g|0)>=(c[B>>2]|0))break;if((g|0)>0){b=(c[a>>2]|0)+(g*48|0)|0;d=w;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));d=v;e=b;f=d+48|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));hK(y,v);h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}b=c[p>>2]|0;if(b|0){f=c[w>>2]|0;c[u>>2]=c[t>>2];c[u+4>>2]=c[t+4>>2];c[u+8>>2]=c[t+8>>2];c[u+12>>2]=c[t+12>>2];c[v>>2]=c[f>>2];c[v+4>>2]=c[f+4>>2];c[v+8>>2]=c[f+8>>2];c[v+12>>2]=c[f+12>>2];YH(z,u,v,1.0,b);c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[y+16>>2]=c[z+16>>2];c[y+20>>2]=c[z+20>>2];c[y+24>>2]=c[z+24>>2];c[y+28>>2]=c[z+28>>2];h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}b=c[q>>2]|0;if(b|0){f=(c[w>>2]|0)+((c[s>>2]|0)+-1<<4)|0;c[u>>2]=c[r>>2];c[u+4>>2]=c[r+4>>2];c[u+8>>2]=c[r+8>>2];c[u+12>>2]=c[r+12>>2];c[v>>2]=c[f>>2];c[v+4>>2]=c[f+4>>2];c[v+8>>2]=c[f+8>>2];c[v+12>>2]=c[f+12>>2];YH(A,u,v,1.0,b);c[y>>2]=c[A>>2];c[y+4>>2]=c[A+4>>2];c[y+8>>2]=c[A+8>>2];c[y+12>>2]=c[A+12>>2];c[y+16>>2]=c[A+16>>2];c[y+20>>2]=c[A+20>>2];c[y+24>>2]=c[A+24>>2];c[y+28>>2]=c[A+28>>2];h[x>>3]=+h[(+h[x>>3]<+h[y>>3]?x:y)>>3];h[i>>3]=+h[(+h[i>>3]<+h[j>>3]?x:y)+8>>3];h[k>>3]=+h[(+h[k>>3]>+h[m>>3]?x:y)+16>>3];h[n>>3]=+h[(+h[n>>3]>+h[o>>3]?x:y)+24>>3];}g=g+1|0;}B=a+8|0;c[B>>2]=c[x>>2];c[B+4>>2]=c[x+4>>2];c[B+8>>2]=c[x+8>>2];c[B+12>>2]=c[x+12>>2];c[B+16>>2]=c[x+16>>2];c[B+20>>2]=c[x+20>>2];c[B+24>>2]=c[x+24>>2];c[B+28>>2]=c[x+28>>2];l=C;return}function hK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0;n=l;l=l+48|0;i=n+32|0;j=n;k=c[b+4>>2]|0;if((k|0)<=0)qa(101170,99906,3968,101182);if(((k>>>0)%3|0|0)!=1)qa(101192,99906,3969,101182);m=j+16|0;d=c[b>>2]|0;c[m>>2]=c[d>>2];c[m+4>>2]=c[d+4>>2];c[m+8>>2]=c[d+8>>2];c[m+12>>2]=c[d+12>>2];c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];e=i+8|0;f=j+8|0;g=j+24|0;b=1;while(1){if((b|0)>=(k|0))break;p=+h[d+(b<<4)+8>>3];t=b+1|0;o=+h[d+(t<<4)+8>>3];r=(+h[d+(t<<4)>>3]+ +h[d+(b<<4)>>3])*.5;h[i>>3]=r;p=(o+p)*.5;h[e>>3]=p;o=+h[(+h[j>>3]>3];h[j>>3]=o;s=+h[(+h[f>>3]>3];h[f>>3]=s;r=+h[(+h[m>>3]>r?m:i)>>3];h[m>>3]=r;p=+h[(+h[g>>3]>p?m:i)+8>>3];h[g>>3]=p;t=d+(b+2<<4)|0;c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];q=+h[i>>3];h[j>>3]=+h[(o>3];o=+h[e>>3];h[f>>3]=+h[(s>3];h[m>>3]=+h[(r>q?m:i)>>3];h[g>>3]=+h[(p>o?m:i)+8>>3];b=b+3|0;}c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];c[a+16>>2]=c[j+16>>2];c[a+20>>2]=c[j+20>>2];c[a+24>>2]=c[j+24>>2];c[a+28>>2]=c[j+28>>2];l=n;return}function iK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0;q=+h[a>>3];r=+h[c>>3];k=!(q>=r);if((!k?q<=+h[c+16>>3]:0)?(e=+h[a+8>>3],e>=+h[c+8>>3]):0)i=e<=+h[c+24>>3];else i=0;e=+h[b>>3];if((e>=r?e<=+h[c+16>>3]:0)?(f=+h[b+8>>3],f>=+h[c+8>>3]):0){d=f<=+h[c+24>>3];if(!(i^d))if(i&d)d=1;else l=11;else d=0;}else if(i)d=0;else l=11;a:do if((l|0)==11){p=+h[a+8>>3];do if(q==e){r=+h[c+8>>3];if(!(k|p>=r^+h[b+8>>3]>=r^1)?q<=+h[c+16>>3]:0){d=0;break a}}else {j=+h[b+8>>3];if(p==j){if(!(q>=r^e>=r))break;if(!(p>=+h[c+8>>3]))break;if(!(p<=+h[c+24>>3]))break;else {d=0;break a}}o=(j-p)/(e-q);l=q>3];if(!(!(r>=g)|!(r<=e)|!(f>=m))?f<=+h[c+24>>3]:0){d=0;break a}n=+h[c+16>>3];f=(n-r)*o+f;if(f>=m?!(!(n<=e)|(n>=g?!(f<=+h[c+24>>3]):1)):0){d=0;break a}l=p=r?!(!(m<=f)|(!(m>=g)|!(e<=n))):0){d=0;break a}p=+h[c+24>>3];q=(p-m)/o+e;if(q>=r?!(!(p<=f)|(!(p>=g)|!(q<=n))):0){d=0;break a}}while(0);d=-1;}while(0);return d|0}function jK(a){a=a|0;var b=0,c=0.0;b=a+16|0;c=+h[b>>3];h[a+32>>3]=c;h[a+48>>3]=c;h[a+40>>3]=+h[a+24>>3];h[a+56>>3]=+h[a+8>>3];h[b>>3]=+h[a>>3];return}function kK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;if((c[47131]|0)!=(d|0)){N2(+(d|0)*.15915494309189535,186328,186336);c[47131]=d;}g=+h[b>>3];e=+h[23292];f=+h[b+8>>3];i=+h[23291];h[a>>3]=e*g-i*f;h[a+8>>3]=i*g+f*e;return}function lK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;f=k;e=+h[b>>3];i=b+8|0;g=+h[i>>3];a:do switch(d|0){case 0:{j=11;break}case 90:{h[b>>3]=g;e=-e;j=10;break}case 180:{e=-g;j=10;break}case 270:{h[b>>3]=g;j=10;break}default:{if((d|0)<0){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(a,f,0-d|0);break a}if((d|0)>360){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];lK(a,f,(d>>>0)%360|0);break a}else {c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];kK(a,f,d);break a}}}while(0);if((j|0)==10){h[i>>3]=e;j=11;}if((j|0)==11){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}l=k;return}function mK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;f=k;e=+h[b>>3];i=b+8|0;g=+h[i>>3];a:do switch(d|0){case 0:{j=11;break}case 90:{h[b>>3]=-g;j=10;break}case 180:{e=-g;j=10;break}case 270:{h[b>>3]=g;j=10;break}default:{if((d|0)<0){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];lK(a,f,0-d|0);break a}if((d|0)>360){c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(a,f,(d>>>0)%360|0);break a}else {c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];kK(a,f,360-d|0);break a}}}while(0);if((j|0)==10){h[i>>3]=e;j=11;}if((j|0)==11){c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];}l=k;return}function nK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;g=+h[c>>3];d=+h[c+8>>3];f=d+ +h[b>>3];e=g+ +h[b+24>>3];d=d+ +h[b+16>>3];h[a>>3]=g+ +h[b+8>>3];h[a+8>>3]=f;h[a+16>>3]=e;h[a+24>>3]=d;return}function oK(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0;f=+h[a>>3];d=+h[b>>3]-f;g=+h[a+8>>3];e=+h[b+8>>3]-g;f=(+h[c+8>>3]-g)*d-(+h[c>>3]-f)*e;f=f*f;return +(f<1.0e-10?0.0:f/(e*e+d*d))}function pK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g+8|0;e=g;a=QA(a,b)|0;if(a|0?(c[f>>2]=e,(b5(a,101209,f)|0)>0):0)h[d>>3]=+h[e>>3];l=g;return}function qK(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;g=n+8|0;i=n;e=JK(96)|0;m=b+16|0;c[(c[m>>2]|0)+8>>2]=e;e=QA(b,101213)|0;if(!e){e=Ta(101222)|0;if(e|0)k=3;}else k=3;if((k|0)==3)cb(101234,e|0,1)|0;e=(rK(b)|0)&255;a[(c[m>>2]|0)+115>>0]=e;if(0==0?(e=QA(b,101245)|0,c[47133]=e,(e|0)==0):0)c[47133]=c[47132];f=+_O(b,GA(b,0,101255,0)|0,0.0,0.0);h[c[(c[m>>2]|0)+8>>2]>>3]=f;e=QA(b,101263)|0;a:do if(!e)e=0;else {switch(a[e>>0]|0){case 76:{if(!(s2(e,101271)|0)){e=1;break a}break}case 66:{if(!(s2(e,101274)|0)){e=2;break a}break}case 82:{e=(s2(e,101277)|0)==0;e=e?3:0;break a}default:{e=0;break a}}e=0;}while(0);c[(c[m>>2]|0)+116>>2]=e<<2|(d<<24>>24==0?0:e);f=+_O(b,GA(b,0,101280,0)|0,.25,.02);h[i>>3]=f;f=f*72.0;c[(c[m>>2]|0)+248>>2]=~~(f+(f>=0.0?.5:-.5));e=aP(b,GA(b,0,101288,0)|0,0)|0;if(e){c[g>>2]=i;if(b5(e,101209,g)|0){f=+h[i>>3];if(f<.02){h[i>>3]=.02;f=.02;}}else {h[i>>3]=.5;f=.5;}if(d4(e,101296)|0)a[(c[m>>2]|0)+276>>0]=1;}else {h[i>>3]=.5;f=.5;}f=f*72.0;c[(c[m>>2]|0)+252>>2]=~~(f+(f>=0.0?.5:-.5));i=(ZO(b,GA(b,0,101304,0)|0,0,0)|0)&255;a[(c[m>>2]|0)+243>>0]=i;i=pP(aP(b,GA(b,0,101314,0)|0,0)|0,20676,20692)|0;c[(c[m>>2]|0)+244>>2]=i;sK(b);i=tK(b,101324,(c[(c[m>>2]|0)+8>>2]|0)+64|0)|0;e=c[(c[m>>2]|0)+8>>2]|0;a[e+80>>0]=i;tK(b,101329,e+48|0)|0;e=dP(QA(b,101334)|0)|0;a[(c[(c[m>>2]|0)+8>>2]|0)+82>>0]=e;e=QA(b,101341)|0;do if(!e){e=QA(b,101348)|0;if(e|0){e=(a[e>>0]|32)<<24>>24==108&1;k=27;break}e=QA(b,101360)|0;if(e|0){e=dP(e)|0;k=27;}}else {e=(q5(e)|0)==90&1;k=27;}while(0);if((k|0)==27)a[(c[(c[m>>2]|0)+8>>2]|0)+81>>0]=e;c[47135]=pP(QA(b,101370)|0,20708,20724)|0;a[194954]=dP(QA(b,101382)|0)|0;c[47138]=0;c[47139]=0;h[(c[(c[m>>2]|0)+8>>2]|0)+24>>3]=0.0;e=QA(b,101394)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0)k=32;else k=30;if(((k|0)==30?(j=QA(b,101398)|0,j|0):0)?a[j>>0]|0:0){e=j;k=32;}if((k|0)==32){f=+r5(e);h[(c[(c[m>>2]|0)+8>>2]|0)+24>>3]=f;}uK(b);h[23295]=1.e+37;c[47140]=GA(b,0,101409,0)|0;c[47143]=GA(b,0,141034,0)|0;c[47144]=GA(b,0,105496,0)|0;c[47145]=GA(b,1,141048,0)|0;c[47146]=GA(b,1,141116,0)|0;c[47147]=GA(b,1,108230,0)|0;c[47148]=GA(b,1,140823,0)|0;c[47149]=GA(b,1,101418,0)|0;c[47157]=GA(b,1,141082,0)|0;c[47150]=GA(b,1,101428,0)|0;c[47151]=GA(b,1,101437,0)|0;c[47152]=GA(b,1,101446,0)|0;k=GA(b,1,108224,0)|0;c[47154]=k;if(!k)c[47154]=GA(b,1,108224,105493)|0;c[47155]=GA(b,1,101456,0)|0;c[47158]=GA(b,1,101304,0)|0;c[47172]=GA(b,1,101463,0)|0;c[47161]=GA(b,1,101409,0)|0;c[47153]=GA(b,1,105496,0)|0;c[47159]=GA(b,1,141076,0)|0;c[47160]=GA(b,1,101472,0)|0;c[47163]=GA(b,1,101484,0)|0;c[47162]=GA(b,1,101348,0)|0;c[47164]=GA(b,1,101489,0)|0;c[47165]=GA(b,1,141024,0)|0;c[47166]=GA(b,1,137297,0)|0;c[47156]=GA(b,1,101500,0)|0;c[47167]=GA(b,1,101510,0)|0;c[47168]=GA(b,1,101516,0)|0;c[47169]=GA(b,1,101522,0)|0;c[47170]=GA(b,1,101530,0)|0;c[47171]=GA(b,1,101539,0)|0;c[47173]=GA(b,1,141034,0)|0;c[47174]=GA(b,2,101541,0)|0;c[47176]=GA(b,2,140823,0)|0;c[47177]=GA(b,2,101418,0)|0;c[47179]=GA(b,2,101428,0)|0;c[47180]=GA(b,2,101437,0)|0;c[47181]=GA(b,2,101446,0)|0;c[47182]=GA(b,2,108224,0)|0;c[47183]=GA(b,2,101456,0)|0;c[47192]=GA(b,2,101548,0)|0;c[47184]=GA(b,2,101559,0)|0;c[47195]=GA(b,2,101563,0)|0;c[47196]=GA(b,2,101573,0)|0;c[47197]=GA(b,2,101583,0)|0;c[47198]=GA(b,2,101593,0)|0;c[47199]=GA(b,2,101603,0)|0;c[47200]=GA(b,2,101617,0)|0;c[47201]=GA(b,2,101631,0)|0;c[47202]=GA(b,2,101646,0)|0;c[47203]=GA(b,2,101660,0)|0;c[47175]=GA(b,2,101671,0)|0;c[47187]=GA(b,2,101304,0)|0;c[47185]=GA(b,2,141082,0)|0;c[47186]=GA(b,2,101678,0)|0;c[47188]=GA(b,2,101687,0)|0;c[47189]=GA(b,2,101697,0)|0;c[47190]=GA(b,2,101510,0)|0;c[47191]=GA(b,2,101522,0)|0;c[47204]=GA(b,2,101708,0)|0;c[47205]=GA(b,2,101717,0)|0;c[47206]=GA(b,2,101463,0)|0;e=$H(b)|0;c[(c[(c[m>>2]|0)+8>>2]|0)+88>>2]=e;e=QA(b,141060)|0;if(e|0?a[e>>0]|0:0){b=EK(e,b)|0;c[(c[(c[m>>2]|0)+8>>2]|0)+92>>2]=b;}l=n;return}function rK(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;a=bP(a,GA(a,0,101807,0)|0,101815)|0;if(((((((c3(a,101821)|0)!=0?(c3(a,101829)|0)!=0:0)?(c3(a,101836)|0)!=0:0)?(c3(a,101839)|0)!=0:0)?(c3(a,101850)|0)!=0:0)?(c3(a,101861)|0)!=0:0)?(c3(a,101871)|0)!=0:0)if((c3(a,101882)|0)!=0?(c3(a,101888)|0)!=0:0)if((c3(a,101815)|0)!=0?(c3(a,101893)|0)!=0:0){c[b>>2]=a;gA(0,101898,b)|0;a=0;}else a=0;else a=2;else a=1;l=d;return a|0}function sK(b){b=b|0;var d=0.0,e=0,f=0;e=QA(b,101765)|0;a:do if(e|0?(f=a[e>>0]|0,f<<24>>24):0)switch(f<<24>>24|0){case 97:{if(f<<24>>24!=97)break a;if(s2(e,101771)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=4;break a}case 99:{if(f<<24>>24!=99)break a;if(s2(e,101776)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=3;break a}case 101:{if(f<<24>>24!=101)break a;if(s2(e,101785)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=5;break a}case 102:{if(f<<24>>24!=102)break a;if(s2(e,101792)|0)break a;c[(c[(c[b+16>>2]|0)+8>>2]|0)+84>>2]=2;break a}default:{d=+r5(e);if(!(d>0.0))break a;b=c[(c[b+16>>2]|0)+8>>2]|0;c[b+84>>2]=1;h[b+16>>3]=d;break a}}while(0);return}function tK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+48|0;m=o+32|0;i=o+16|0;k=o+8|0;j=o;n=o+40|0;a[n>>0]=0;b=QA(b,d)|0;do if(b){c[i>>2]=k;c[i+4>>2]=j;c[i+8>>2]=n;i=(b5(b,101749,i)|0)>1;g=+h[k>>3];f=+h[j>>3];if(i&g>0.0&f>0.0){g=g*72.0;h[e>>3]=+(~~(g+(g>=0.0?.5:-.5))|0);g=f*72.0;h[e+8>>3]=+(~~(g+(g>=0.0?.5:-.5))|0);b=(a[n>>0]|0)==33;break}a[n>>0]=0;c[m>>2]=k;c[m+4>>2]=n;m=(b5(b,101759,m)|0)>0;f=+h[k>>3];if(m&f>0.0){g=f*72.0;g=+(~~(g+(g>=0.0?.5:-.5))|0);h[e>>3]=g;h[e+8>>3]=g;b=(a[n>>0]|0)==33;}else b=0;}else b=0;while(0);l=o;return b&1|0}function uK(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0;d=QA(b,108224)|0;do if(d|0?a[d>>0]|0:0){e=(c[(c[b+60>>2]|0)+16>>2]|0)+113|0;a[e>>0]=a[e>>0]|8;e=(iD(d)|0)!=0;g=+_O(b,GA(b,0,101428,0)|0,14.0,1.0);i=bP(b,GA(b,0,101437,0)|0,107994)|0;d=zK(b,d,e?2:0,g,i,bP(b,GA(b,0,101446,0)|0,137314)|0)|0;i=b+16|0;c[(c[i>>2]|0)+12>>2]=d;d=QA(b,105628)|0;e=(d|0)!=0;do if((yC(b)|0)==(b|0)){if(e?(a[d>>0]|0)==116:0){d=1;break}d=0;}else {if(e?(a[d>>0]|0)==98:0){d=0;break}d=1;}while(0);e=QA(b,101726)|0;a:do if(e)switch(a[e>>0]|0){case 108:{d=d|2;break a}case 114:{d=d|4;break a}default:break a}while(0);a[(c[i>>2]|0)+275>>0]=d;if((yC(b)|0)!=(b|0)){d=c[(c[i>>2]|0)+12>>2]|0;f=+h[d+24>>3]+16.0;g=+h[d+32>>3]+8.0;b=(c[(c[(yC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;d=c[i>>2]|0;e=a[d+275>>0]<<1&2;if(b){b=e&255;h[d+48+(b<<4)>>3]=f;h[d+48+(b<<4)+8>>3]=g;break}else {b=(e^3)&255;h[d+48+(b<<4)>>3]=g;h[d+48+(b<<4)+8>>3]=f;break}}}while(0);return}function vK(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;d=c[e>>2]|0;b=c[d+8>>2]|0;do if(!b)b=d;else {d=c[b+88>>2]|0;if(d){EH(d);d=c[e>>2]|0;b=c[d+8>>2]|0;if(!b){b=d;break}}U1(c[b+92>>2]|0);b=c[e>>2]|0;}while(0);U1(c[b+8>>2]|0);e=c[e>>2]|0;c[e+8>>2]=0;CK(c[e+12>>2]|0);ZC(a,0,137483);return}function wK(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;switch(a|0){case 0:{a=101971;break}case 1:{a=101839;break}case 2:{a=101977;break}default:{c[b>>2]=a;gA(1,101941,b)|0;a=101971;}}l=d;return a|0}function xK(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;f=c[d>>2]|0;l=d+24|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;if(a[f>>0]|0){i=KK((l2(f)|0)+1|0)|0;a[i>>0]=0;j=d+12|0;e=i;a:while(1){b:while(1){h=f+1|0;g=a[f>>0]|0;if(!(g<<24>>24))break a;if(!(g<<24>>24==-1|((g&255)<161|(c[j>>2]|0)!=2))){a[e>>0]=g;h=a[h>>0]|0;g=e+2|0;a[e+1>>0]=h;if(!(h<<24>>24)){e=g;break a}else {e=g;f=f+2|0;continue}}switch(g<<24>>24){case 92:break b;case 10:{k=12;break b}default:{}}a[e>>0]=g;e=e+1|0;f=h;}if((k|0)==12){k=0;f=e+1|0;a[e>>0]=0;yK(b,d,i,110);e=f;i=f;f=h;continue}g=a[h>>0]|0;switch(g<<24>>24|0){case 114:case 108:case 110:{g=e+1|0;a[e>>0]=0;yK(b,d,i,a[h>>0]|0);e=g;break}default:{a[e>>0]=g;e=e+1|0;g=i;}}i=g;f=(a[h>>0]|0)==0?h:f+2|0;}if((i|0)!=(e|0)){a[e>>0]=0;yK(b,d,i,110);}d=d+40|0;c[d>>2]=c[l>>2];c[d+4>>2]=c[l+4>>2];c[d+8>>2]=c[l+8>>2];c[d+12>>2]=c[l+12>>2];}return}function yK(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+32|0;q=s+16|0;p=s;r=e+76|0;k=b[r>>1]|0;o=e+72|0;m=c[o>>2]|0;if(!m)n=JK((k*56|0)+112|0)|0;else n=LK(m,k+2|0,56,k+1|0)|0;c[o>>2]=n;k=b[r>>1]|0;m=n+(k*56|0)|0;c[m>>2]=f;a[n+(k*56|0)+48>>0]=g;if((f|0)!=0?(a[f>>0]|0)!=0:0){c[46594]=c[e+4>>2];h[23299]=+h[e+16>>3];g=c[d+144>>2]|0;c[n+(k*56|0)+4>>2]=nb[c[g>>2]&63](g,186376,1)|0;LO(p,d,m);j=+h[p>>3];h[q>>3]=j;i=+h[p+8>>3];}else {h[q>>3]=0.0;i=+(~~(+h[e+16>>3]*1.2)|0);h[n+(k*56|0)+40>>3]=i;j=0.0;}b[r>>1]=(b[r>>1]|0)+1<<16>>16;r=e+24|0;h[r>>3]=+h[(+h[r>>3]>j?r:q)>>3];r=e+32|0;h[r>>3]=+h[r>>3]+i;l=s;return}function zK(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=i|0;j=j|0;var k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+32|0;r=u+16|0;q=u+8|0;p=u;t=JK(88)|0;switch(IC(b)|0){case 0:{m=0;s=c[b+60>>2]|0;n=b;o=0;break}case 1:{m=0;s=yC(xC(b)|0)|0;n=0;o=b;break}case 2:{m=b;s=yC(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)|0;n=0;o=0;break}default:{m=0;s=0;n=0;o=0;}}c[t+4>>2]=i;c[t+8>>2]=j;h[t+16>>3]=g;k=s+16|0;j=t+12|0;c[j>>2]=d[(c[k>>2]|0)+115>>0];a:do if(f&4){c[t>>2]=D4(e)|0;if(f&2|0)a[t+82>>0]=1;}else switch(f|0){case 2:{c[t>>2]=D4(e)|0;a[t+82>>0]=1;if(!(BU(b,t)|0))break a;switch(IC(b)|0){case 0:{c[p>>2]=KB(n)|0;gA(3,101983,p)|0;break a}case 1:{c[q>>2]=KB(o)|0;gA(3,102005,q)|0;break a}case 2:{p=KB(c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0)|0;q=(xB(s)|0)!=0;s=KB(c[((c[m>>2]&3|0)==2?m:m+-48|0)+40>>2]|0)|0;c[r>>2]=p;c[r+4>>2]=q?137738:141747;c[r+8>>2]=s;gA(3,102026,r)|0;break a}default:break a}}case 0:{i=AK(e,b,0)|0;c[t>>2]=i;if((c[j>>2]|0)==1)i=eQ(i)|0;else i=bQ(i,s)|0;U1(c[t>>2]|0);c[t>>2]=i;xK(c[(c[k>>2]|0)+144>>2]|0,t);break a}default:qa(102053,102069,166,102078);}while(0);l=u;return t|0}function AK(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;switch(IC(d)|0){case 0:{i=KB(d)|0;g=l2(i)|0;f=c[(c[d+16>>2]|0)+12>>2]|0;if(f){f=c[f>>2]|0;if(!b){v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=2;w=f;x=102095;}else {v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=l2(f)|0;w=f;x=102095;}}else {v=0;t=2;u=2;s=2;h=2;y=102101;m=102098;j=105493;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}break}case 1:{i=KB(xC(d)|0)|0;g=l2(i)|0;j=KB(d)|0;h=l2(j)|0;f=c[(c[d+16>>2]|0)+104>>2]|0;if(f){f=c[f>>2]|0;if(!b){v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=2;w=f;x=102095;}else {v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=l2(f)|0;w=f;x=102095;}}else {v=0;t=2;u=2;s=2;y=102101;m=102098;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}break}case 2:{h=d+48|0;i=KB(yC(xC(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0)|0)|0;g=l2(i)|0;l=KB(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0;k=l2(l)|0;f=d+16|0;q=c[(c[f>>2]|0)+52>>2]|0;if(!q)r=0;else r=l2(q)|0;m=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;f=c[f>>2]|0;o=c[f+92>>2]|0;if(!o)p=0;else p=l2(o)|0;j=l2(m)|0;f=c[f+96>>2]|0;if(f){f=c[f>>2]|0;if(!b)n=2;else n=l2(f)|0;}else {n=2;f=102089;}x=(xB(yC(xC(c[((c[d>>2]&3|0)==3?d:h)+40>>2]|0)|0)|0)|0)==0;v=1;t=k;u=j;s=k+2+(r|0?r+1|0:0)+j+(p|0?p+1|0:0)|0;h=2;y=l;j=105493;w=f;x=x?141747:137738;break}default:{v=0;t=2;u=2;s=2;h=2;g=2;y=102101;m=102098;j=105493;i=102092;o=195059;q=195059;p=0;r=0;n=2;w=102089;x=102095;}}e=(e|0)==0;l=0;f=b;a:while(1){d=f+1|0;b:do switch(a[f>>0]|0){case 0:break a;case 92:{f=f+2|0;switch(a[d>>0]|0){case 78:{k=h;break b}case 71:{k=g;break b}case 69:{k=s;break b}case 72:{k=u;break b}case 84:{k=t;break b}case 76:{k=n;break b}case 92:{if(!e){k=1;break b}break}default:{}}k=2;break}default:{k=1;f=d;}}while(0);l=l+k|0;}s=KK(l+1|0)|0;n=(v|0)==0;l=(r|0)==0;d=(p|0)==0;f=s;g=b;c:while(1){k=g+1|0;h=a[g>>0]|0;switch(h<<24>>24){case 0:break c;case 92:break;default:{a[f>>0]=h;f=f+1|0;g=k;continue c}}h=g+2|0;g=a[k>>0]|0;switch(g<<24>>24|0){case 71:{g=i;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 78:{g=j;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 69:{if(n){g=h;continue c}else g=y;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24))break;g=g+1|0;f=f+1|0;}if(l)g=x;else {a[f>>0]=58;g=q;while(1){f=f+1|0;b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=x;break}else g=g+1|0;}}while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=m;break}g=g+1|0;f=f+1|0;}while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24))break;g=g+1|0;f=f+1|0;}if(d){g=h;continue c}a[f>>0]=58;g=o;while(1){f=f+1|0;b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}else g=g+1|0;}}case 84:{g=y;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}g=g+1|0;f=f+1|0;}}case 72:{g=m;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}f=f+1|0;g=g+1|0;}}case 76:{g=w;while(1){b=a[g>>0]|0;a[f>>0]=b;if(!(b<<24>>24)){g=h;continue c}f=f+1|0;g=g+1|0;}}case 92:{if(!e){a[f>>0]=92;f=f+1|0;g=h;continue c}break}default:{}}a[f>>0]=92;a[f+1>>0]=g;f=f+2|0;g=h;}a[f>>0]=0;return s|0}function BK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(a|0){d=a;e=0;while(1){if((e|0)>=(b|0))break;if(!e)U1(c[d>>2]|0);g=c[d+8>>2]|0;if(g|0?(f=c[d+12>>2]|0,f|0):0)tb[f&127](g);d=d+56|0;e=e+1|0;}U1(a);}return}function CK(d){d=d|0;var e=0;if(d|0){U1(c[d>>2]|0);e=d+72|0;if(a[d+82>>0]|0){e=c[e>>2]|0;if(e|0)mU(e,1);}else BK(c[e>>2]|0,b[d+76>>1]|0);U1(d);}return}function DK(d,e,f){d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+32|0;q=u+16|0;r=u;k=c[d+16>>2]|0;s=k+12|0;t=c[s>>2]|0;c[s>>2]=e;if(!(a[f+82>>0]|0)){p=f+76|0;if((b[p>>1]|0)>=1){eS(d,0);hS(d,c[f+8>>2]|0);switch(a[f+80>>0]|0){case 116:{j=+h[f+64>>3];g=+h[f+48>>3]*.5+j;break}case 98:{j=+h[f+64>>3];g=+h[f+48>>3]*-.5+j+ +h[f+32>>3];break}default:{j=+h[f+64>>3];g=+h[f+32>>3]*.5+j;}}g=g-+h[f+16>>3];o=r+8|0;h[o>>3]=g;if(b[k+260>>1]&512)h[o>>3]=g-j;m=f+72|0;n=f+56|0;i=f+40|0;e=0;while(1){if((e|0)>=(b[p>>1]|0))break;k=c[m>>2]|0;switch(a[k+(e*56|0)+48>>0]|0){case 108:{g=+h[n>>3]-+h[i>>3]*.5;break}case 114:{g=+h[i>>3]*.5+ +h[n>>3];break}default:g=+h[n>>3];}h[r>>3]=g;c[q>>2]=c[r>>2];c[q+4>>2]=c[r+4>>2];c[q+8>>2]=c[r+8>>2];c[q+12>>2]=c[r+12>>2];gS(d,q,k+(e*56|0)|0);h[o>>3]=+h[o>>3]-+h[(c[m>>2]|0)+(e*56|0)+40>>3];e=e+1|0;}fS(d);i=18;}}else {TT(d,c[f+72>>2]|0,f);i=18;}if((i|0)==18)c[s>>2]=t;l=u;return}function EK(a,b){a=a|0;b=b|0;return AK(a,b,1)|0}function FK(a){a=a|0;return GK(a,0)|0}function GK(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[47207]|0;if(!e){c[47208]=64;e=KK(64)|0;c[47207]=e;}j=d<<24>>24==0;i=0;f=0;h=b;while(1){if(!h)break;d=a[h>>0]|0;if(!(d<<24>>24))break;b=c[47208]|0;if((i|0)>(b+-8|0)){e=b<<1;c[47208]=e;e=MK(c[47207]|0,e)|0;c[47207]=e;e=e+i|0;d=a[h>>0]|0;}a:do switch(d<<24>>24){case 38:{if(j?(HK(h)|0)!=0:0)k=18;else {f=5;d=102130;}break}case 60:{f=4;d=102153;break}case 62:{f=4;d=102136;break}case 45:{f=5;d=102147;break}default:{if((f|0)!=0&d<<24>>24==32)if((a[f>>0]|0)==32){f=6;d=102123;break a}else {k=18;break a}switch(d<<24>>24){case 34:{f=6;d=102116;break a}case 39:{f=5;d=102141;break a}case 10:if(j){k=18;break a}else {f=5;d=102110;break a}default:{k=18;break a}}}}while(0);if((k|0)==18){k=0;d=j|d<<24>>24!=13;f=d?1:5;d=d?h:102104;}g=e+f|0;b=f;while(1){if(!b)break;a[e>>0]=a[d>>0]|0;b=b+-1|0;d=d+1|0;e=e+1|0;}b=h;i=f+i|0;e=g;h=h+1|0;f=b;}a[e>>0]=0;return c[47207]|0}function HK(b){b=b|0;var c=0,d=0;d=b+1|0;c=a[d>>0]|0;a:do if(c<<24>>24==35){d=b+2|0;c=a[d>>0]|0;switch(c<<24>>24){case 88:case 120:break;default:{b=d;while(1){d=b+1|0;if((c+-48&255)>=10)break a;b=d;c=a[d>>0]|0;}}}d=b+3|0;while(1){c=a[d>>0]|0;if((c+-48&255)>=10)switch(c<<24>>24){case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:break;default:break a}d=d+1|0;}}else while(1){b=d+1|0;if(((c&-33)+-65&255)>=26)break a;d=b;c=a[b>>0]|0;}while(0);return c<<24>>24==59|0}function IK(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=c[47209]|0;if(!d){c[47210]=64;d=KK(64)|0;c[47209]=d;i=0;}else i=0;while(1){if(!b)break;e=a[b>>0]|0;if(!(e<<24>>24))break;f=c[47210]|0;if((i|0)>(f+-8|0)){d=f<<1;c[47210]=d;d=MK(c[47209]|0,d)|0;c[47209]=d;d=d+i|0;e=a[b>>0]|0;}switch(e<<24>>24){case 38:{if(!(HK(b)|0)){g=5;e=102130;}else j=12;break}case 60:{g=4;e=102153;break}case 62:{g=4;e=102136;break}case 34:{g=6;e=102116;break}case 39:{g=5;e=102141;break}default:j=12;}if((j|0)==12){j=0;g=1;e=b;}h=d+g|0;f=g;while(1){if(!f)break;a[d>>0]=a[e>>0]|0;f=f+-1|0;e=e+1|0;d=d+1|0;}i=g+i|0;d=h;b=b+1|0;}a[d>>0]=0;return c[47209]|0}function JK(a){a=a|0;var b=0;if(!a)a=0;else {b=KK(a)|0;Y6(b|0,0,a|0)|0;a=b;}return a|0}function KK(a){a=a|0;if(a){a=T1(a)|0;if(!a){U4(111740,14,1,c[15712]|0)|0;a=0;}}else a=0;return a|0}function LK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=W1(a,O(d,b)|0)|0;if(!((b|0)!=0&(a|0)==0)){if(b>>>0>e>>>0)Y6(a+(O(e,d)|0)|0,0,O(b-e|0,d)|0)|0;}else U4(111740,14,1,c[15712]|0)|0;return a|0}function MK(a,b){a=a|0;b=b|0;a=W1(a,b)|0;if((b|0)!=0&(a|0)==0)U4(111740,14,1,c[15712]|0)|0;return a|0}function NK(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0,n=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+80|0;r=u+40|0;q=u+32|0;n=u+24|0;m=u;s=4;t=T1(40)|0;c[t>>2]=0;f=u+68|0;g=u+64|0;if(0);else j=6;do if((j|0)==6){o=0;f=$(27,a|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)!=1){if(!f){o=0;ha(2);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}}if((d|0)<1){o=0;ha(3);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}f=0;break}else {c[47211]=(e|0)>-1?e:30;t=U6(188848,1,t|0,s|0)|0;s=z;o=0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;break}f=0;j=15;break}}else {f=z;j=15;}}while(0);a:do if((j|0)==15){b:while(1){if(f|0){f=2;break a}o=0;ha(4);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue}a=c[15712]|0;m=0;while(1){o=0;j=_(2)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}if(!j)break;o=0;f=$(28,j|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){f=z;j=15;continue b}o=0;ja(25,j|0,f|0);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}m=m+1|0;do if(((m|0)%100|0|0)==0&0!=0){f=(m|0)%1e3|0;if((f|0)==100){o=0;aa(93,102202,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}o=0;c[n>>2]=m;ca(32,a|0,102220,n|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}o=0;c[q>>2]=m;ca(32,a|0,102220,q|0)|0;g=o;o=0;if((g|0)!=0&(p|0)!=0){i=V6(c[g>>2]|0,t|0,s|0)|0;if(!i)bb(g|0,p|0);z=p;}else i=-1;if((i|0)==1){f=z;j=15;continue b}if(!f){o=0;aa(94,10,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}}}while(0);if((m|0)>=(d|0))break}switch(b|0){case 1:{o=0;ha(5);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}case 2:{o=0;ha(6);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}break}default:{o=0;ha(7);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}o=0;ha(3);f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue b}}}if(!0){f=0;break a}if((m|0)>99){o=0;aa(94,10,a|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;continue}}f=c[47251]|0;g=c[47252]|0;o=0;k=+X(1);i=o;o=0;if((i|0)!=0&(p|0)!=0){j=V6(c[i>>2]|0,t|0,s|0)|0;if(!j)bb(i|0,p|0);z=p;}else j=-1;if((j|0)==1){f=z;j=15;continue}o=0;c[r>>2]=102202;c[r+4>>2]=f;c[r+8>>2]=g;c[r+12>>2]=m;h[r+16>>3]=k;ca(32,a|0,102224,r|0)|0;f=o;o=0;if((f|0)!=0&(p|0)!=0){g=V6(c[f>>2]|0,t|0,s|0)|0;if(!g)bb(f|0,p|0);z=p;}else g=-1;if((g|0)==1){f=z;j=15;}else break}f=0;}while(0);U1(t|0);l=u;return f|0}function OK(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;a=(c[a+16>>2]|0)+192|0;e=0;h=0;while(1){a=c[a>>2]|0;if(!a)break;g=c[a+16>>2]|0;f=c[g+180>>2]|0;a=0;while(1){if(!(c[f+(a<<2)>>2]|0))break;a=a+1|0;e=e+1|0;}a=g+164|0;h=h+1|0;}c[b>>2]=h;c[d>>2]=e;return}function PK(b){b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;c[47254]=b;c[47261]=0;c[47252]=0;c[47251]=0;i=b+16|0;b=(c[i>>2]|0)+192|0;h=0;f=0;while(1){b=c[b>>2]|0;if(!b)break;g=c[b+16>>2]|0;a[g+157>>0]=0;h=h+1|0;c[47251]=h;d=c[g+180>>2]|0;b=0;while(1){if(!(c[d+(b<<2)>>2]|0))break;k=f+1|0;c[47252]=k;b=b+1|0;f=k;}b=g+164|0;}b=c[47262]|0;if(!b)b=KK(h<<2)|0;else b=MK(b,h<<2)|0;c[47262]=b;c[47263]=0;b=c[47256]|0;if(!b)b=KK(c[47251]<<2)|0;else b=MK(b,c[47251]<<2)|0;c[47256]=b;c[47255]=0;d=1;b=(c[i>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;k=b+16|0;i=c[k>>2]|0;j=i+292|0;c[j>>2]=0;i=c[i+172>>2]|0;h=d;g=0;b=0;while(1){d=c[i+(g<<2)>>2]|0;if(!d)break;f=b+1|0;c[j>>2]=f;b=c[d+16>>2]|0;c[b+160>>2]=0;c[b+164>>2]=-1;if(!h)b=0;else {l=c[d>>2]&3;b=((c[(c[(c[((l|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((l|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)<(e[b+170>>1]|0|0)?0:h;}h=b;g=g+1|0;b=f;}b=JK((g<<2)+4|0)|0;d=c[k>>2]|0;c[d+264>>2]=b;c[d+268>>2]=0;d=c[d+180>>2]|0;b=0;do{l=b;b=b+1|0;}while((c[d+(l<<2)>>2]|0)!=0);d=JK(b<<2)|0;b=c[k>>2]|0;c[b+272>>2]=d;c[b+276>>2]=0;d=h;b=b+164|0;}return d|0}function QK(){var a=0,b=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;k=o;m=VO(c[47251]|0)|0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b){j=0;break}d=b+16|0;a=c[d>>2]|0;if(!(c[a+292>>2]|0)){XO(m,b);a=c[d>>2]|0;}a=a+164|0;}while(1){a=YO(m)|0;if(!a)break;i=a+16|0;a=c[i>>2]|0;f=a+232|0;c[f>>2]=0;d=c[a+172>>2]|0;b=0;h=0;while(1){g=c[d+(b<<2)>>2]|0;if(!g){f=0;break}g=(c[(c[(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)+(e[(c[g+16>>2]|0)+170>>1]|0)|0;g=(h|0)>(g|0)?h:g;c[f>>2]=g;b=b+1|0;h=g;}while(1){b=c[(c[a+180>>2]|0)+(f<<2)>>2]|0;if(!b)break;d=b+-48|0;g=(c[(c[((c[b>>2]&3|0)==2?b:d)+40>>2]|0)+16>>2]|0)+292|0;h=c[g>>2]|0;c[g>>2]=h+-1;if((h|0)<2){XO(m,c[((c[b>>2]&3|0)==2?b:d)+40>>2]|0);a=c[i>>2]|0;}f=f+1|0;}j=j+1|0;}a:do if((j|0)!=(c[47251]|0)){gA(1,102556,k)|0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b)break a;d=b+16|0;a=c[d>>2]|0;if(c[a+292>>2]|0){k=KB(b)|0;a=c[(c[d>>2]|0)+292>>2]|0;c[n>>2]=k;c[n+4>>2]=a;gA(3,102578,n)|0;a=c[d>>2]|0;}a=a+164|0;}}while(0);WO(m);l=o;return}function RK(){var b=0,d=0,e=0;b=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[b>>2]|0;if(!b)break;e=b+16|0;b=c[e>>2]|0;d=c[b+264>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+272>>2]|0;if(d){U1(d);b=c[e>>2]|0;}a[b+157>>0]=0;b=b+164|0;}return}function SK(){var a=0,b=0,d=0,e=0,f=0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){a=c[a>>2]|0;if(!a)break;a=c[a+16>>2]|0;c[a+280>>2]=0;a=a+164|0;}f=JK(c[47251]<<2)|0;e=0;a=(c[(c[47254]|0)+16>>2]|0)+192|0;while(1){b=c[a>>2]|0;if(!b)break;d=b+16|0;a=c[d>>2]|0;if(!(c[a+280>>2]|0)){c[f+(e<<2)>>2]=dL(b)|0;b=e+1|0;a=c[d>>2]|0;}else b=e;e=b;a=a+164|0;}a=eL(f,e)|0;while(1){if((fL(a)|0)<=1)break;jL(a,c[(iL(hL(gL(a)|0)|0)|0)+8>>2]|0);}U1(a);a=0;while(1){if((a|0)>=(e|0))break;U1(c[f+(a<<2)>>2]|0);a=a+1|0;}U1(f);if((c[47255]|0)==((c[47251]|0)+-1|0)){kL();return}else qa(102301,102331,523,102336);}function TK(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=c[47261]|0;f=c[47255]|0;j=c[47256]|0;k=c[47211]|0;b=0;a=0;g=i;while(1){if((g|0)>=(f|0)){h=8;break}e=c[j+(g<<2)>>2]|0;d=c[(c[e+16>>2]|0)+160>>2]|0;if((d|0)<0){if(!a)a=e;else a=(c[(c[a+16>>2]|0)+160>>2]|0)>(d|0)?e:a;b=b+1|0;if((b|0)>=(k|0))break}e=g+1|0;c[47261]=e;g=e;}if((h|0)==8)if((i|0)>0){f=0;while(1){if((f|0)>=(i|0))break;d=c[j+(f<<2)>>2]|0;e=c[(c[d+16>>2]|0)+160>>2]|0;if((e|0)<0){if(!a)a=d;else a=(c[(c[a+16>>2]|0)+160>>2]|0)>(e|0)?d:a;b=b+1|0;if((b|0)>=(k|0))break}f=f+1|0;}c[47261]=f;}return a|0}function UK(a){a=a|0;var b=0,d=0;b=c[a>>2]&3;d=c[((b|0)==3?a:a+48|0)+40>>2]|0;a=c[((b|0)==2?a:a+-48|0)+40>>2]|0;b=(c[(c[d+16>>2]|0)+288>>2]|0)<(c[(c[a+16>>2]|0)+288>>2]|0);a=b?d:a;c[47257]=0;c[47258]=2147483647;d=c[a+16>>2]|0;c[47259]=c[d+284>>2];c[47260]=c[d+288>>2];if(b)cL(a);else bL(a);return c[47257]|0}function VK(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;g=c[b>>2]&3;m=b+-48|0;j=b+48|0;k=b+16|0;g=(c[(c[(c[((g|0)==2?b:m)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((g|0)==3?b:j)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[k>>2]|0)+170>>1]|0)|0;do if((g|0)>0){d=c[a>>2]&3;h=c[((d|0)==3?a:a+48|0)+40>>2]|0;i=c[h+16>>2]|0;if(((c[i+276>>2]|0)+(c[i+268>>2]|0)|0)==1){ZK(h,g);break}d=c[((d|0)==2?a:a+-48|0)+40>>2]|0;f=c[d+16>>2]|0;if(((c[f+276>>2]|0)+(c[f+268>>2]|0)|0)==1){ZK(d,0-g|0);break}if((c[i+288>>2]|0)<(c[f+288>>2]|0)){ZK(h,g);break}else {ZK(d,0-g|0);break}}while(0);d=a+16|0;f=c[(c[d>>2]|0)+160>>2]|0;g=c[b>>2]&3;g=_K(c[((g|0)==3?b:j)+40>>2]|0,c[((g|0)==2?b:m)+40>>2]|0,f,1)|0;i=c[b>>2]&3;if((_K(c[((i|0)==2?b:m)+40>>2]|0,c[((i|0)==3?b:j)+40>>2]|0,f,0)|0)==(g|0)){c[(c[k>>2]|0)+160>>2]=0-f;c[(c[d>>2]|0)+160>>2]=0;$K(a,b);n=c[g+16>>2]|0;aL(g,c[n+280>>2]|0,c[n+284>>2]|0)|0;l=o;return}else {gA(1,102262,n)|0;bb(188848,1);}}function WK(){var b=0,d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;YK();m=JK((c[47253]<<2)+4|0)|0;d=c[47253]|0;b=0;while(1){if((b|0)>(d|0))break;c[m+(b<<2)>>2]=0;b=b+1|0;}b=(c[(c[47254]|0)+16>>2]|0)+192|0;d=b;while(1){d=c[d>>2]|0;if(!d)break;d=c[d+16>>2]|0;if(!(a[d+156>>0]|0)){l=m+(c[d+232>>2]<<2)|0;c[l>>2]=(c[l>>2]|0)+1;}d=d+164|0;}while(1){b=c[b>>2]|0;if(!b)break;l=b+16|0;b=c[l>>2]|0;if(!(a[b+156>>0]|0)){h=c[47253]|0;f=c[b+172>>2]|0;k=0;j=0;d=0;while(1){g=c[f+(d<<2)>>2]|0;if(!g)break;n=c[g+16>>2]|0;i=(c[(c[(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)+(e[n+170>>1]|0)|0;k=(c[n+156>>2]|0)+k|0;j=(j|0)>(i|0)?j:i;d=d+1|0;}g=c[b+180>>2]|0;i=0;d=0;while(1){f=c[g+(d<<2)>>2]|0;if(!f)break;o=c[f+16>>2]|0;n=(c[(c[(c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[o+170>>1]|0)|0;i=(c[o+156>>2]|0)+i|0;h=(h|0)<(n|0)?h:n;d=d+1|0;}d=(j|0)>0?j:0;if((k|0)==(i|0)){g=d;f=d;while(1){d=f+1|0;if((f|0)>=(h|0))break;g=(c[m+(d<<2)>>2]|0)<(c[m+(g<<2)>>2]|0)?d:g;f=d;}o=b+232|0;n=m+(c[o>>2]<<2)|0;c[n>>2]=(c[n>>2]|0)+-1;n=m+(g<<2)|0;c[n>>2]=(c[n>>2]|0)+1;c[o>>2]=g;}d=c[b+264>>2]|0;if(d){U1(d);b=c[l>>2]|0;}d=c[b+272>>2]|0;if(d){U1(d);b=c[l>>2]|0;}a[b+157>>0]=0;}b=b+164|0;}U1(m);return}function XK(){var a=0,b=0,d=0,f=0,g=0,h=0;b=0;while(1){if((b|0)>=(c[47255]|0))break;a=c[(c[47256]|0)+(b<<2)>>2]|0;do if(((c[(c[a+16>>2]|0)+160>>2]|0)==0?(d=UK(a)|0,d|0):0)?(f=c[d>>2]&3,f=(c[(c[(c[((f|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((f|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0,(f|0)>=2):0){h=c[a>>2]&3;g=c[((h|0)==3?a:a+48|0)+40>>2]|0;a=c[((h|0)==2?a:a+-48|0)+40>>2]|0;if((c[(c[g+16>>2]|0)+288>>2]|0)<(c[(c[a+16>>2]|0)+288>>2]|0)){ZK(g,f>>>1);break}else {ZK(a,(f|0)/-2|0);break}}while(0);b=b+1|0;}RK();return}function YK(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+16|0;h=i;c[h>>2]=0;c[h>>2]=2147483647;c[47253]=-2147483647;b=(c[(c[47254]|0)+16>>2]|0)+192|0;e=b;g=2147483647;f=-2147483647;while(1){d=c[e>>2]|0;if(!d)break;e=c[d+16>>2]|0;if(!(a[e+156>>0]|0)){j=c[e+232>>2]|0;d=(g|0)<(j|0)?g:j;c[h>>2]=d;f=(f|0)>(j|0)?f:j;c[47253]=f;}else d=g;e=e+164|0;g=d;}if(g|0){while(1){b=c[b>>2]|0;if(!b)break;b=c[b+16>>2]|0;j=b+232|0;c[j>>2]=(c[j>>2]|0)-g;b=b+164|0;}c[47253]=f-g;c[h>>2]=0;}l=i;return}function ZK(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+16|0;a=c[f>>2]|0;e=a+232|0;c[e>>2]=(c[e>>2]|0)-b;e=0;while(1){d=c[(c[a+272>>2]|0)+(e<<2)>>2]|0;if(!d){e=0;break}if((d|0)!=(c[a+280>>2]|0)){ZK(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0,b);a=c[f>>2]|0;}e=e+1|0;}while(1){d=c[(c[a+264>>2]|0)+(e<<2)>>2]|0;if(!d)break;if((d|0)!=(c[a+280>>2]|0)){ZK(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,b);a=c[f>>2]|0;}e=e+1|0;}return}function _K(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;g=(e|0)==0&1;h=0-d|0;f=c[(c[b+16>>2]|0)+288>>2]|0;b=a;while(1){a=c[b+16>>2]|0;if((c[a+284>>2]|0)<=(f|0)?(f|0)<=(c[a+288>>2]|0):0)break;a=c[a+280>>2]|0;i=a+48|0;j=(c[a+16>>2]|0)+160|0;c[j>>2]=(((b|0)==(c[((c[a>>2]&3|0)==3?a:i)+40>>2]|0)?e:g)|0?d:h)+(c[j>>2]|0);j=c[a>>2]&3;i=c[((j|0)==3?a:i)+40>>2]|0;a=c[((j|0)==2?a:a+-48|0)+40>>2]|0;b=(c[(c[i+16>>2]|0)+288>>2]|0)>(c[(c[a+16>>2]|0)+288>>2]|0)?i:a;}return b|0}function $K(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=a+16|0;e=(c[i>>2]|0)+164|0;c[(c[b+16>>2]|0)+164>>2]=c[e>>2];c[(c[47256]|0)+(c[e>>2]<<2)>>2]=b;c[(c[i>>2]|0)+164>>2]=-1;i=(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16|0;e=c[i>>2]|0;g=e+276|0;f=c[g>>2]|0;j=f+-1|0;c[g>>2]=j;g=e+272|0;h=0;while(1){if((h|0)>=(f|0)){k=3;break}d=c[g>>2]|0;if((c[d+(h<<2)>>2]|0)==(a|0))break;h=h+1|0;}if((k|0)==3)d=c[e+272>>2]|0;c[d+(h<<2)>>2]=c[d+(j<<2)>>2];c[(c[(c[i>>2]|0)+272>>2]|0)+(j<<2)>>2]=0;i=(c[((c[a>>2]&3|0)==2?a:a+-48|0)+40>>2]|0)+16|0;e=c[i>>2]|0;g=e+268|0;f=c[g>>2]|0;j=f+-1|0;c[g>>2]=j;g=e+264|0;h=0;while(1){if((h|0)>=(f|0)){k=8;break}d=c[g>>2]|0;if((c[d+(h<<2)>>2]|0)==(a|0))break;h=h+1|0;}if((k|0)==8)d=c[e+264>>2]|0;c[d+(h<<2)>>2]=c[d+(j<<2)>>2];c[(c[(c[i>>2]|0)+264>>2]|0)+(j<<2)>>2]=0;k=(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)+16|0;a=c[k>>2]|0;j=c[a+272>>2]|0;a=a+276|0;i=c[a>>2]|0;c[a>>2]=i+1;c[j+(i<<2)>>2]=b;k=c[k>>2]|0;c[(c[k+272>>2]|0)+(c[k+276>>2]<<2)>>2]=0;k=(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)+16|0;i=c[k>>2]|0;j=c[i+264>>2]|0;i=i+268|0;a=c[i>>2]|0;c[i>>2]=a+1;c[j+(a<<2)>>2]=b;k=c[k>>2]|0;c[(c[k+264>>2]|0)+(c[k+268>>2]<<2)>>2]=0;return}function aL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=a+16|0;a=c[g>>2]|0;c[a+280>>2]=b;c[a+284>>2]=d;f=0;while(1){e=c[(c[a+272>>2]|0)+(f<<2)>>2]|0;if(!e){f=0;break}if((e|0)!=(b|0)){d=aL(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,e,d)|0;a=c[g>>2]|0;}f=f+1|0;}while(1){e=c[(c[a+264>>2]|0)+(f<<2)>>2]|0;if(!e)break;if((e|0)!=(b|0)){d=aL(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0,e,d)|0;a=c[g>>2]|0;}f=f+1|0;}c[a+288>>2]=d;return d+1|0}function bL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0,j=0;i=a+16|0;g=0;while(1){a=c[i>>2]|0;d=c[(c[a+180>>2]|0)+(g<<2)>>2]|0;if(!d){d=0;break}f=c[d+16>>2]|0;if((c[f+164>>2]|0)<0){a=c[d>>2]&3;b=c[(c[((a|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0;j=c[b+288>>2]|0;if((c[47259]|0)>(j|0)|(j|0)>(c[47260]|0)?(h=(c[b+232>>2]|0)-(c[(c[(c[((a|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[f+170>>1]|0)|0,(h|0)<(c[47258]|0)|(c[47257]|0)==0):0){c[47257]=d;c[47258]=h;}}else {b=c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0))bL(b);}g=g+1|0;}while(1){b=c[(c[a+264>>2]|0)+(d<<2)>>2]|0;if(!((b|0)!=0&(c[47258]|0)>0))break;b=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0)){bL(b);a=c[i>>2]|0;}d=d+1|0;}return}function cL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0,j=0;i=a+16|0;g=0;while(1){a=c[i>>2]|0;d=c[(c[a+172>>2]|0)+(g<<2)>>2]|0;if(!d){d=0;break}f=c[d+16>>2]|0;if((c[f+164>>2]|0)<0){a=c[d>>2]&3;b=c[(c[((a|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0;j=c[b+288>>2]|0;if((c[47259]|0)>(j|0)|(j|0)>(c[47260]|0)?(h=(c[(c[(c[((a|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[b+232>>2]|0)-(e[f+170>>1]|0)|0,(h|0)<(c[47258]|0)|(c[47257]|0)==0):0){c[47257]=d;c[47258]=h;}}else {b=c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0))cL(b);}g=g+1|0;}while(1){b=c[(c[a+272>>2]|0)+(d<<2)>>2]|0;if(!((b|0)!=0&(c[47258]|0)>0))break;b=c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0;if((c[(c[b+16>>2]|0)+288>>2]|0)<(c[a+288>>2]|0)){cL(b);a=c[i>>2]|0;}d=d+1|0;}return}function dL(a){a=a|0;var b=0;b=JK(16)|0;c[b>>2]=a;c[b+4>>2]=tL(a,b)|0;c[b+12>>2]=b;return b|0}function eL(a,b){a=a|0;b=b|0;var d=0,e=0;e=JK(8)|0;c[e>>2]=a;c[e+4>>2]=b;d=0;while(1){if((d|0)>=(b|0))break;c[(c[a+(d<<2)>>2]|0)+8>>2]=d;d=d+1|0;}d=(b|0)/2|0;while(1){if((d|0)<=-1)break;jL(e,d);d=d+-1|0;}return e|0}function fL(a){a=a|0;return c[a+4>>2]|0}function gL(a){a=a|0;var b=0,d=0,e=0,f=0;f=c[a>>2]|0;b=c[f>>2]|0;c[b+8>>2]=-1;d=a+4|0;e=(c[d>>2]|0)+-1|0;c[f>>2]=c[f+(e<<2)>>2];f=c[a>>2]|0;c[(c[f>>2]|0)+8>>2]=0;c[f+(e<<2)>>2]=b;c[d>>2]=e;jL(a,0);return b|0}function hL(a){a=a|0;return sL(c[a>>2]|0,0,0)|0}function iL(a){a=a|0;var b=0,d=0,f=0,g=0,h=0,i=0;b=a+16|0;if((c[(c[b>>2]|0)+164>>2]|0)>-1)qa(102350,102331,463,102364);g=a+48|0;d=oL(c[((c[a>>2]&3|0)==3?a:g)+40>>2]|0)|0;i=a+-48|0;f=oL(c[((c[a>>2]&3|0)==2?a:i)+40>>2]|0)|0;h=c[a>>2]&3;b=(c[(c[(c[((h|0)==2?a:i)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((h|0)==3?a:g)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[b>>2]|0)+170>>1]|0)|0;if((c[d+8>>2]|0)==-1)pL(c[d>>2]|0,0,b);else pL(c[f>>2]|0,0,0-b|0);qL(a);return rL(d,f)|0}function jL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=c[a>>2]|0;g=c[a+4>>2]|0;while(1){a=b<<1;f=a+2|0;a=a|1;if(!((a|0)<(g|0)?(c[(c[h+(a<<2)>>2]|0)+4>>2]|0)<(c[(c[h+(b<<2)>>2]|0)+4>>2]|0):0))a=b;if((f|0)>=(g|0))break;d=h+(f<<2)|0;e=c[d>>2]|0;if((f|0)==(b|0)?1:(c[e+4>>2]|0)>=(c[(c[h+(a<<2)>>2]|0)+4>>2]|0))break;i=h+(b<<2)|0;a=c[i>>2]|0;c[i>>2]=e;c[d>>2]=a;c[(c[i>>2]|0)+8>>2]=b;c[a+8>>2]=f;b=f;}return}function kL(){aL(c[(c[(c[47254]|0)+16>>2]|0)+192>>2]|0,0,1)|0;lL(c[(c[(c[47254]|0)+16>>2]|0)+192>>2]|0,0);return}function lL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+16|0;d=0;while(1){a=c[f>>2]|0;e=c[(c[a+272>>2]|0)+(d<<2)>>2]|0;if(!e){e=0;break}if((e|0)!=(b|0))lL(c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,e);d=d+1|0;}while(1){d=c[(c[a+264>>2]|0)+(e<<2)>>2]|0;if(!d)break;if((d|0)!=(b|0)){lL(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0,d);a=c[f>>2]|0;}e=e+1|0;}if(b|0)mL(b);return}function mL(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=c[a>>2]&3;d=c[((b|0)==3?a:a+48|0)+40>>2]|0;e=c[d+16>>2]|0;if((c[e+280>>2]|0)==(a|0))i=1;else {e=c[((b|0)==2?a:a+-48|0)+40>>2]|0;i=-1;d=e;e=c[e+16>>2]|0;}g=c[e+180>>2]|0;b=0;f=0;while(1){h=c[g+(f<<2)>>2]|0;if(!h)break;b=(nL(h,d,i)|0)+b|0;f=f+1|0;}g=c[e+172>>2]|0;e=0;while(1){f=c[g+(e<<2)>>2]|0;if(!f)break;b=(nL(f,d,i)|0)+b|0;e=e+1|0;}c[(c[a+16>>2]|0)+160>>2]=b;return}function nL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=c[a>>2]&3;i=(h|0)==3?a:a+48|0;e=c[i+40>>2]|0;if((e|0)==(b|0))e=c[((h|0)==2?a:a+-48|0)+40>>2]|0;g=c[b+16>>2]|0;f=c[(c[e+16>>2]|0)+288>>2]|0;if((c[g+284>>2]|0)<=(f|0)?(f|0)<=(c[g+288>>2]|0):0){f=c[a+16>>2]|0;if((c[f+164>>2]|0)>-1)e=c[f+160>>2]|0;else e=0;g=1;e=e-(c[f+156>>2]|0)|0;}else {g=0;e=c[(c[a+16>>2]|0)+156>>2]|0;}i=(c[((d|0)>0?((h|0)==2?a:a+-48|0):i)+40>>2]|0)==(b|0)?1:-1;return (((g?i:0-i|0)|0)<0?0-e|0:e)|0}function oL(a){a=a|0;var b=0,d=0;a=c[(c[a+16>>2]|0)+280>>2]|0;while(1){b=a+12|0;d=c[b>>2]|0;if(!((d|0)!=(a|0)&(d|0)!=0))break;a=c[d+12>>2]|0;if(!a){a=d;continue}c[b>>2]=a;}return a|0}function pL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=a+16|0;e=c[h>>2]|0;g=e+232|0;c[g>>2]=(c[g>>2]|0)+d;g=0;while(1){f=c[(c[e+264>>2]|0)+(g<<2)>>2]|0;if(!f){g=0;break}f=c[((c[f>>2]&3|0)==3?f:f+48|0)+40>>2]|0;if((f|0)!=(b|0)){pL(f,a,d);e=c[h>>2]|0;}g=g+1|0;}while(1){f=c[(c[e+272>>2]|0)+(g<<2)>>2]|0;if(!f)break;f=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((f|0)!=(b|0)){pL(f,a,d);e=c[h>>2]|0;}g=g+1|0;}return}function qL(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;d=(c[b+16>>2]|0)+164|0;if((c[d>>2]|0)>-1){gA(1,102453,h)|0;bb(188848,1);}g=c[47255]|0;c[d>>2]=g;d=c[47256]|0;c[47255]=g+1;c[d+(g<<2)>>2]=b;d=c[b>>2]|0;g=b+48|0;e=c[((d&3|0)==3?b:g)+40>>2]|0;if(!(a[(c[e+16>>2]|0)+157>>0]|0)){f=c[47262]|0;d=c[47263]|0;c[47263]=d+1;c[f+(d<<2)>>2]=e;d=c[b>>2]|0;}f=b+-48|0;e=c[((d&3|0)==2?b:f)+40>>2]|0;if(!(a[(c[e+16>>2]|0)+157>>0]|0)){i=c[47262]|0;d=c[47263]|0;c[47263]=d+1;c[i+(d<<2)>>2]=e;d=c[b>>2]|0;}i=(c[((d&3|0)==3?b:g)+40>>2]|0)+16|0;d=c[i>>2]|0;a[d+157>>0]=1;e=c[d+272>>2]|0;d=d+276|0;g=c[d>>2]|0;c[d>>2]=g+1;c[e+(g<<2)>>2]=b;g=c[i>>2]|0;c[(c[g+272>>2]|0)+(c[g+276>>2]<<2)>>2]=0;i=c[i>>2]|0;if(!(c[(c[i+180>>2]|0)+((c[i+276>>2]|0)+-1<<2)>>2]|0)){gA(1,102487,h+8|0)|0;bb(188848,1);}i=(c[((c[b>>2]&3|0)==2?b:f)+40>>2]|0)+16|0;e=c[i>>2]|0;a[e+157>>0]=1;f=c[e+264>>2]|0;e=e+268|0;g=c[e>>2]|0;c[e>>2]=g+1;c[f+(g<<2)>>2]=b;b=c[i>>2]|0;c[(c[b+264>>2]|0)+(c[b+268>>2]<<2)>>2]=0;i=c[i>>2]|0;if(!(c[(c[i+172>>2]|0)+((c[i+268>>2]|0)+-1<<2)>>2]|0)){gA(1,102522,h+16|0)|0;bb(188848,1);}else {l=h;return}}function rL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;while(1){g=a+12|0;d=c[g>>2]|0;if((d|0)==0|(d|0)==(a|0))break;else a=d;}while(1){f=b+12|0;d=c[f>>2]|0;if((d|0)==0|(d|0)==(b|0))break;else b=d;}if((a|0)!=(b|0)){e=c[a+8>>2]|0;d=c[b+8>>2]|0;do if((e|0)>-1)if((d|0)==-1)h=a;else j=10;else if((d|0)>-1)if((e|0)==-1){h=b;break}else {j=10;break}else qa(102376,102331,327,102423);while(0);if((j|0)==10)h=(c[b+4>>2]|0)<(c[a+4>>2]|0)?a:b;c[f>>2]=h;c[g>>2]=h;c[h+4>>2]=(c[b+4>>2]|0)+(c[a+4>>2]|0);if((c[h+8>>2]|0)>-1)i=h;else qa(102434,102331,335,102423);}else i=a;return i|0}function sL(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=oL(a)|0;if(d){k=c[d>>2]&3;if(((c[(c[(c[((k|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((k|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)!=(e[(c[d+16>>2]|0)+170>>1]|0|0))f=3;}else {d=0;f=3;}a:do if((f|0)==3){k=a+16|0;j=0;while(1){f=c[k>>2]|0;i=c[(c[f+180>>2]|0)+(j<<2)>>2]|0;if(!i){j=0;break}f=i+16|0;g=i+-48|0;h=c[((c[i>>2]&3|0)==2?i:g)+40>>2]|0;do if((c[(c[f>>2]|0)+164>>2]|0)>-1){if((h|0)!=(b|0))d=sL(h,a,d)|0;}else if((oL(h)|0)!=(l|0)){if(d|0?(m=c[i>>2]&3,h=c[d>>2]&3,((c[(c[(c[((m|0)==2?i:g)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((m|0)==3?i:i+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[f>>2]|0)+170>>1]|0)|0)>=((c[(c[(c[((h|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((h|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0)):0)break;d=i;}while(0);j=j+1|0;}while(1){f=c[(c[f+172>>2]|0)+(j<<2)>>2]|0;if(!f)break a;g=f+16|0;h=f+48|0;i=c[((c[f>>2]&3|0)==3?f:h)+40>>2]|0;do if((c[(c[g>>2]|0)+164>>2]|0)>-1){if((i|0)!=(b|0))d=sL(i,a,d)|0;}else if((oL(i)|0)!=(l|0)){if(d|0?(i=c[f>>2]&3,m=c[d>>2]&3,((c[(c[(c[((i|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((i|0)==3?f:h)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[g>>2]|0)+170>>1]|0)|0)>=((c[(c[(c[((m|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[(c[(c[((m|0)==3?d:d+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(e[(c[d+16>>2]|0)+170>>1]|0)|0)):0)break;d=f;}while(0);j=j+1|0;f=c[k>>2]|0;}}while(0);return d|0}function tL(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;l=a+16|0;d=c[l>>2]|0;c[d+280>>2]=b;a=1;h=0;while(1){g=c[(c[d+172>>2]|0)+(h<<2)>>2]|0;if(!g){h=0;break}f=c[g+16>>2]|0;if(((c[f+164>>2]|0)<=-1?(i=c[g>>2]&3,j=g+48|0,k=c[(c[((i|0)==3?g:j)+40>>2]|0)+16>>2]|0,(c[k+280>>2]|0)==0):0)?((c[(c[(c[((i|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)-(c[k+232>>2]|0)|0)==(e[f+170>>1]|0|0):0){qL(g);a=(tL(c[((c[g>>2]&3|0)==3?g:j)+40>>2]|0,b)|0)+a|0;d=c[l>>2]|0;}h=h+1|0;}while(1){f=c[(c[d+180>>2]|0)+(h<<2)>>2]|0;if(!f)break;g=c[f+16>>2]|0;if(((c[g+164>>2]|0)<=-1?(m=c[f>>2]&3,n=f+-48|0,o=c[(c[((m|0)==2?f:n)+40>>2]|0)+16>>2]|0,(c[o+280>>2]|0)==0):0)?((c[o+232>>2]|0)-(c[(c[(c[((m|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+232>>2]|0)|0)==(e[g+170>>1]|0|0):0){qL(f);a=(tL(c[((c[f>>2]&3|0)==2?f:n)+40>>2]|0,b)|0)+a|0;d=c[l>>2]|0;}h=h+1|0;}return a|0}function uL(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=QA(a,102586)|0;if(!d)d=30;else d=q5(d)|0;return NK(a,b,c,d)|0}function vL(a){a=+a;return +(0==0?a:+h[23301]-a)}function wL(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0;r=l;l=l+16|0;q=r;c[47264]=c[(c[(c[d+64>>2]|0)+8>>2]|0)+4>>2];xL(d);i=c[d+16>>2]|0;t=+h[i+32>>3];s=+h[i+40>>3];yL(e,102597,+h[b+352>>3]);yL(e,102604,t*.013888888888888888);yL(e,102604,s*.013888888888888888);zL(e);i=jC(d)|0;while(1){if(!i)break;g=i+16|0;if(!(a[(c[g>>2]|0)+118>>0]|0)){AL(e,102606,$D(KB(i)|0)|0);p=(c[g>>2]|0)+16|0;c[q>>2]=c[p>>2];c[q+4>>2]=c[p+4>>2];c[q+8>>2]=c[p+8>>2];c[q+12>>2]=c[p+12>>2];BL(e,q);if(!(a[(c[(c[g>>2]|0)+104>>2]|0)+82>>0]|0)){b=xC(i)|0;b=CL(b,c[c[(c[g>>2]|0)+104>>2]>>2]|0)|0;}else b=$D(RA(i,c[47154]|0)|0)|0;yL(e,102604,+h[(c[g>>2]|0)+32>>3]);yL(e,102604,+h[(c[g>>2]|0)+40>>3]);AL(e,102604,b);AL(e,102604,bP(i,c[47157]|0,111067)|0);AL(e,102604,c[c[(c[g>>2]|0)+8>>2]>>2]|0);AL(e,102604,bP(i,c[47148]|0,137314)|0);b=bP(i,c[47149]|0,195059)|0;if(!(a[b>>0]|0))b=bP(i,c[47148]|0,134800)|0;AL(e,102604,b);zL(e);}i=kC(d,i)|0;}o=f<<24>>24==0;n=jC(d)|0;while(1){if(!n)break;m=XA(d,n)|0;while(1){if(!m)break;if(o){f=195059;j=195059;}else {j=QA(m,111455)|0;f=QA(m,111464)|0;f=f|0?f:195059;j=j|0?j:195059;}p=m+16|0;b=c[p>>2]|0;k=c[b+8>>2]|0;a:do if(k){i=c[k+4>>2]|0;b=0;g=0;while(1){if((b|0)>=(i|0))break;u=(c[(c[k>>2]|0)+(b*48|0)+4>>2]|0)+g|0;b=b+1|0;g=u;}AL(e,0,111450);DL(e,c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0,j);DL(e,c[((c[m>>2]&3|0)==2?m:m+-48|0)+40>>2]|0,f);EL(e,g);f=0;while(1){b=c[p>>2]|0;g=c[b+8>>2]|0;if((f|0)>=(c[g+4>>2]|0))break a;i=c[g>>2]|0;g=c[i+(f*48|0)>>2]|0;i=c[i+(f*48|0)+4>>2]|0;b=0;while(1){if((b|0)>=(i|0))break;u=g+(b<<4)|0;c[q>>2]=c[u>>2];c[q+4>>2]=c[u+4>>2];c[q+8>>2]=c[u+8>>2];c[q+12>>2]=c[u+12>>2];BL(e,q);b=b+1|0;}f=f+1|0;}}while(0);if(c[b+96>>2]|0){u=xC(c[((c[m>>2]&3|0)==3?m:m+48|0)+40>>2]|0)|0;AL(e,102604,CL(u,c[c[(c[p>>2]|0)+96>>2]>>2]|0)|0);u=(c[(c[p>>2]|0)+96>>2]|0)+56|0;c[q>>2]=c[u>>2];c[q+4>>2]=c[u+4>>2];c[q+8>>2]=c[u+8>>2];c[q+12>>2]=c[u+12>>2];BL(e,q);}AL(e,102604,bP(m,c[47185]|0,111067)|0);AL(e,102604,bP(m,c[47176]|0,137314)|0);zL(e);m=ZA(d,m)|0;}n=kC(d,n)|0;}FL(102612,e);l=r;return}function xL(a){a=a|0;var b=0.0;if(0);return}function yL(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0,f=0;f=l;l=l+1040|0;e=f;d=f+8|0;if(b|0)FL(b,a);h[e>>3]=c;m4(d,102618,e)|0;FL(d,a);l=f;return}function zL(b){b=b|0;a[194955]=10;lb[c[47264]&127](b,194955)|0;return}function AL(a,b,c){a=a|0;b=b|0;c=c|0;if(b|0)FL(b,a);FL(c,a);return}function BL(a,b){a=a|0;b=b|0;var c=0.0;yL(a,102604,+h[b>>3]*.013888888888888888);if(!0)c=+h[b+8>>3];yL(a,102604,c*.013888888888888888);return}function CL(a,b){a=a|0;b=b|0;var c=0;c=fD(a,b)|0;b=$D(c)|0;hD(a,c)|0;return b|0}function DL(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!(a[(c[d+16>>2]|0)+118>>0]|0))d=$D(KB(d)|0)|0;else {f=xC(d)|0;d=CL(f,(R2(KB(d)|0,58)|0)+1|0)|0;}AL(b,102604,d);if(e|0?a[e>>0]|0:0)AL(b,107984,$D(e)|0);return}function EL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+1040|0;f=d;e=d+8|0;FL(102604,a);c[f>>2]=b;m4(e,137395,f)|0;FL(e,a);l=d;return}function FL(a,b){a=a|0;b=b|0;lb[c[47264]&127](b,a)|0;return}function GL(d,f,g){d=d|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0.0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;Y=l;l=l+2288|0;W=Y+208|0;V=Y+192|0;U=Y+176|0;T=Y+160|0;S=Y+144|0;R=Y+128|0;P=Y+112|0;O=Y+96|0;N=Y+80|0;M=Y+64|0;L=Y+56|0;K=Y+48|0;X=Y+32|0;Q=Y+24|0;J=Y;G=Y+1264|0;H=Y+224|0;I=d+16|0;C=(e[(c[I>>2]|0)+178>>1]|0)>2;RJ(1);xL(d);kA(H,1024,Y+240|0);_P(d,1,102623,195059)|0;_P(d,1,102627,195059)|0;c[47146]=_P(d,1,141116,195059)|0;c[47145]=_P(d,1,141048,195059)|0;_P(d,2,102623,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;if(i&16){_P(d,1,102633,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&1){_P(d,2,102637,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&32){_P(d,2,102633,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&2){_P(d,2,102640,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(i&4){_P(d,2,102648,195059)|0;i=a[(c[I>>2]|0)+113>>0]|0;}if(!(i&8)){v=0;w=0;x=0;}else {x=_P(d,0,102637,195059)|0;w=_P(d,0,102656,195059)|0;v=_P(d,0,102663,195059)|0;}z=_P(d,0,102671,195059)|0;A=H+4|0;B=H+8|0;u=0;i=0;y=jC(d)|0;while(1){if(!y)break;t=y+16|0;k=c[t>>2]|0;o=+h[k+16>>3];j=0==0;if(C){if(j)m=+h[k+24>>3];else m=+h[23301]-+h[k+24>>3];q=+h[(c[k+132>>2]|0)+16>>3]*72.0;h[J>>3]=o;h[J+8>>3]=m;h[J+16>>3]=q;m4(G,102674,J)|0;nA(H,G)|0;j=3;while(1){if((j|0)>=(e[(c[I>>2]|0)+178>>1]|0))break;h[Q>>3]=+h[(c[(c[t>>2]|0)+132>>2]|0)+(j<<3)>>3]*72.0;m4(G,102689,Q)|0;nA(H,G)|0;j=j+1|0;}j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;s=c[H>>2]|0;c[A>>2]=s;SA(y,102623,s)|0;s=y;}else {if(j)m=+h[k+24>>3];else m=+h[23301]-+h[k+24>>3];h[X>>3]=o;h[X+8>>3]=m;m4(G,102695,X)|0;SA(y,102623,G)|0;s=y;}h[K>>3]=+h[(c[t>>2]|0)+80>>3]*.013888888888888888;m4(G,102618,K)|0;KA(s,c[47145]|0,G)|0;j=c[t>>2]|0;h[L>>3]=(+h[j+96>>3]+ +h[j+88>>3])*.013888888888888888;m4(G,102618,L)|0;KA(s,c[47146]|0,G)|0;j=c[t>>2]|0;k=c[j+108>>2]|0;if((k|0)!=0?(a[k+81>>0]|0)!=0:0){q=+h[k+64>>3];q=0==0?q:+h[23301]-q;h[M>>3]=+h[k+56>>3];h[M+8>>3]=q;m4(G,102695,M)|0;SA(s,102633,G)|0;j=c[t>>2]|0;}if(s2(c[c[j+8>>2]>>2]|0,106220)|0){if(c[47170]|0?(hN(y)|0)<<24>>24:0){k=c[(c[t>>2]|0)+12>>2]|0;r=k+8|0;j=c[r>>2]|0;if((j|0)<3){j=QA(s,102705)|0;if(!j)j=8;else j=q5(j)|0;j=(j|0)<3?8:j;}p=k+44|0;q=1.0/+(j|0);n=0;while(1){if((n|0)>=(j|0))break;if((n|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=32;}if((c[r>>2]|0)>2){k=c[p>>2]|0;if(!0)m=+h[k+(n<<4)+8>>3]*.013888888888888888;h[N>>3]=+h[k+(n<<4)>>3]*.013888888888888888;h[N+8>>3]=m;m4(G,102718,N)|0;}else {k=c[t>>2]|0;m=q*+(n|0)*6.283185307179586;o=+h[k+32>>3]*.5*+E(+m);if(!0)m=+h[k+40>>3]*.5*+F(+m);h[O>>3]=o;h[O+8>>3]=m;m4(G,102718,O)|0;}nA(H,G)|0;n=n+1|0;}k=c[47170]|0;j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;t=c[H>>2]|0;c[A>>2]=t;KA(s,k,t)|0;}}else {HL(y,c[j+12>>2]|0,H);pA(H)|0;j=c[A>>2]|0;if(j>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;j=c[A>>2]|0;}a[j>>0]=0;t=c[H>>2]|0;c[A>>2]=t;SA(s,102627,t)|0;}a:do if((c[47138]|0)>0){t=XA(d,y)|0;j=u;while(1){if(!t)break a;s=t+16|0;k=c[s>>2]|0;do if((a[k+112>>0]|0)!=6?(D=c[k+8>>2]|0,(D|0)!=0):0){r=0;k=D;while(1){if((r|0)>=(c[k+4>>2]|0))break;if((r|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=59;k=c[(c[s>>2]|0)+8>>2]|0;}k=c[k>>2]|0;if(c[k+(r*48|0)+8>>2]|0){if(!0)m=+h[k+(r*48|0)+24>>3];h[P>>3]=+h[k+(r*48|0)+16>>3];h[P+8>>3]=m;m4(G,102728,P)|0;nA(H,G)|0;i=1;k=c[c[(c[s>>2]|0)+8>>2]>>2]|0;}if(c[k+(r*48|0)+12>>2]|0){if(!0)m=+h[k+(r*48|0)+40>>3];h[R>>3]=+h[k+(r*48|0)+32>>3];h[R+8>>3]=m;m4(G,102741,R)|0;nA(H,G)|0;j=1;}p=0;while(1){k=c[(c[s>>2]|0)+8>>2]|0;n=c[k>>2]|0;if((p|0)>=(c[n+(r*48|0)+4>>2]|0))break;if((p|0)>0){k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}c[A>>2]=k+1;a[k>>0]=32;k=c[c[(c[s>>2]|0)+8>>2]>>2]|0;}else k=n;u=c[k+(r*48|0)>>2]|0;q=+h[u+(p<<4)+8>>3];q=0==0?q:+h[23301]-q;h[S>>3]=+h[u+(p<<4)>>3];h[S+8>>3]=q;m4(G,102695,S)|0;nA(H,G)|0;p=p+1|0;}r=r+1|0;}k=c[A>>2]|0;if(k>>>0>=(c[B>>2]|0)>>>0){lA(H,1)|0;k=c[A>>2]|0;}a[k>>0]=0;k=c[H>>2]|0;c[A>>2]=k;SA(t,102623,k)|0;k=c[s>>2]|0;n=c[k+96>>2]|0;if(n){q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[T>>3]=+h[n+56>>3];h[T+8>>3]=q;m4(G,102695,T)|0;SA(t,102637,G)|0;k=c[s>>2]|0;}n=c[k+108>>2]|0;do if(n){if(!(a[n+81>>0]|0))break;q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[U>>3]=+h[n+56>>3];h[U+8>>3]=q;m4(G,102695,U)|0;SA(t,102633,G)|0;k=c[s>>2]|0;}while(0);n=c[k+100>>2]|0;if(n){q=+h[n+64>>3];q=0==0?q:+h[23301]-q;h[V>>3]=+h[n+56>>3];h[V+8>>3]=q;m4(G,102695,V)|0;SA(t,102640,G)|0;k=c[s>>2]|0;}k=c[k+104>>2]|0;if(!k)break;q=+h[k+64>>3];q=0==0?q:+h[23301]-q;h[W>>3]=+h[k+56>>3];h[W+8>>3]=q;m4(G,102695,W)|0;SA(t,102648,G)|0;}while(0);t=ZA(d,t)|0;}}else j=u;while(0);u=j;y=kC(d,y)|0;}IL(d,z,x,w,v);oA(H);if(b[(c[I>>2]|0)+136>>1]&1)UP(d);c[f>>2]=i;c[g>>2]=u;RJ(0);l=Y;return}function HL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0.0;n=l;l=l+1056|0;k=n;j=n+32|0;m=b+48|0;if(!(c[m>>2]|0)){e=c[a+16>>2]|0;i=+h[e+16>>3];if(!0){g=+h[e+24>>3];f=g+ +h[b+24>>3];g=g+ +h[b+40>>3];}o=i+ +h[b+32>>3];h[k>>3]=i+ +h[b+16>>3];h[k+8>>3]=f;h[k+16>>3]=o;h[k+24>>3]=g;m4(j,102779,k)|0;nA(d,j)|0;}b=b+56|0;e=0;while(1){if((e|0)>=(c[m>>2]|0))break;HL(a,c[(c[b>>2]|0)+(e<<2)>>2]|0,d);e=e+1|0;}l=n;return}function IL(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0;s=l;l=l+1088|0;o=s+56|0;q=s+48|0;p=s+32|0;j=s;n=s+64|0;r=b+16|0;i=c[r>>2]|0;if(!0){k=+h[i+24>>3];m=+h[i+40>>3];}t=+h[i+32>>3];h[j>>3]=+h[i+16>>3];h[j+8>>3]=k;h[j+16>>3]=t;h[j+24>>3]=m;m4(n,102754,j)|0;KA(b,d,n)|0;i=c[(c[r>>2]|0)+12>>2]|0;if((i|0)!=0?(a[c[i>>2]>>0]|0)!=0:0){t=+h[i+64>>3];t=0==0?t:+h[23301]-t;h[p>>3]=+h[i+56>>3];h[p+8>>3]=t;m4(n,102695,p)|0;KA(b,e,n)|0;i=c[(c[r>>2]|0)+12>>2]|0;t=+h[i+32>>3];h[q>>3]=+h[i+24>>3]*.013888888888888888;m4(n,102774,q)|0;KA(b,f,n)|0;h[o>>3]=t*.013888888888888888;m4(n,102774,o)|0;KA(b,g,n)|0;i=1;}else i=1;while(1){j=c[r>>2]|0;if((i|0)>(c[j+180>>2]|0))break;IL(c[(c[j+184>>2]|0)+(i<<2)>>2]|0,d,e,f,g);i=i+1|0;}l=s;return}function JL(a){a=a|0;var b=0;b=l;l=l+16|0;GL(a,b,b+4|0);l=b;return}function KL(){return Vz(20740,c[4581]|0)|0}function LL(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function ML(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if((a|0)<=(e|0))if((a|0)<(e|0))a=-1;else {b=c[b+4>>2]|0;d=c[d+4>>2]|0;return ((b|0)>(d|0)?1:((b|0)<(d|0))<<31>>31)|0}else a=1;return a|0}function NL(a){a=a|0;Rz(a)|0;return}function OL(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];b=PL(e)|0;if((nb[c[a>>2]&63](a,b,1)|0)!=(b|0))U1(b);l=d;return}function PL(a){a=a|0;var b=0,d=0,e=0;b=JK(16)|0;e=a;d=c[e+4>>2]|0;a=b+8|0;c[a>>2]=c[e>>2];c[a+4>>2]=d;return b|0}function QL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e+8|0;g=e;c[g>>2]=b;c[g+4>>2]=d;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];b=PL(f)|0;if((nb[c[a>>2]&63](a,b,1)|0)!=(b|0))U1(b);l=e;return}function RL(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+16|0;e=d;g=b;f=c[g+4>>2]|0;b=e+8|0;c[b>>2]=c[g>>2];c[b+4>>2]=f;b=(nb[c[a>>2]&63](a,e,4)|0)!=0&1;l=d;return b|0}function SL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f+8>>2]=b;c[f+12>>2]=d;d=(nb[c[a>>2]&63](a,f,4)|0)!=0&1;l=e;return d|0}function TL(a){a=a|0;return Xz(a)|0}function UL(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=JK((Xz(a)|0)<<3)|0;b=d;a=Tz(a)|0;while(1){if(!a)break;g=a+8|0;f=c[g+4>>2]|0;e=b;c[e>>2]=c[g>>2];c[e+4>>2]=f;b=b+8|0;a=c[a>>2]|0;}return d|0}function VL(){var a=0,b=0,d=0,e=0;a=KK(40)|0;b=a;d=20776;e=b+36|0;do{c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}while((b|0)<(e|0));c[a+36>>2]=0;return Vz(a,c[4581]|0)|0}function WL(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;d=d+36|0;a=c[d>>2]|0;if(!a)a=KK(20)|0;else c[d>>2]=c[a>>2];f=b+8|0;e=c[f+4>>2]|0;d=a+8|0;c[d>>2]=c[f>>2];c[d+4>>2]=e;c[a+16>>2]=c[b+16>>2];return a|0}function XL(a,b,d){a=a|0;b=b|0;d=d|0;d=d+36|0;c[b>>2]=c[d>>2];c[d>>2]=b;return}function YL(a){a=a|0;nb[c[a>>2]&63](a,0,64)|0;return}function ZL(a){a=a|0;var b=0,d=0;b=c[a+4>>2]|0;Rz(a)|0;a=c[b+36>>2]|0;while(1){if(!a)break;d=c[a>>2]|0;U1(a);a=d;}U1(b);return}function _L(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=l;l=l+32|0;g=f;c[g+8>>2]=b;c[g+12>>2]=d;c[g+16>>2]=e;e=c[(nb[c[a>>2]&63](a,g,1)|0)+16>>2]|0;l=f;return e|0}function $L(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+160|0;q=t+144|0;d=t+48|0;j=t+128|0;k=t+112|0;m=t+96|0;n=t+80|0;o=t+32|0;p=t+16|0;r=t;s=a+16|0;a=c[s>>2]|0;e=+h[a+16>>3];f=+h[a+24>>3];g=+h[a+32>>3];i=+h[a+40>>3];if((b+-1|0)>>>0<2){aM(j,e,i);c[q>>2]=c[j>>2];c[q+4>>2]=c[j+4>>2];c[q+8>>2]=c[j+8>>2];c[q+12>>2]=c[j+12>>2];bM(d,q);p=d+16|0;aM(k,g,f);c[q>>2]=c[k>>2];c[q+4>>2]=c[k+4>>2];c[q+8>>2]=c[k+8>>2];c[q+12>>2]=c[k+12>>2];bM(m,q);c[p>>2]=c[m>>2];c[p+4>>2]=c[m+4>>2];c[p+8>>2]=c[m+8>>2];c[p+12>>2]=c[m+12>>2];}else {aM(n,e,f);c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];bM(d,q);n=d+16|0;aM(o,g,i);c[q>>2]=c[o>>2];c[q+4>>2]=c[o+4>>2];c[q+8>>2]=c[o+8>>2];c[q+12>>2]=c[o+12>>2];bM(p,q);c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];}a=(c[s>>2]|0)+16|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];c[a+20>>2]=c[d+20>>2];c[a+24>>2]=c[d+24>>2];c[a+28>>2]=c[d+28>>2];a=c[(c[s>>2]|0)+12>>2]|0;if(!a)a=1;else {a=a+56|0;c[q>>2]=c[a>>2];c[q+4>>2]=c[a+4>>2];c[q+8>>2]=c[a+8>>2];c[q+12>>2]=c[a+12>>2];bM(r,q);c[a>>2]=c[r>>2];c[a+4>>2]=c[r+4>>2];c[a+8>>2]=c[r+8>>2];c[a+12>>2]=c[r+12>>2];a=1;}while(1){d=c[s>>2]|0;if((a|0)>(c[d+180>>2]|0))break;$L(c[(c[d+184>>2]|0)+(a<<2)>>2]|0,b);a=a+1|0;}l=t;return}function aM(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function bM(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+32|0;g=d+16|0;e=d;f=(c[47265]|0)*90|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];mK(e,g,f);c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];h[b>>3]=+h[b>>3]-+h[23303];e=b+8|0;h[e>>3]=+h[e>>3]-+h[23304];c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];l=d;return}function cM(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=l;l=l+1168|0;s=w+144|0;v=w+96|0;u=w+64|0;t=w+48|0;o=w+32|0;p=w+16|0;q=w;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;r=b+16|0;m=c[(c[r>>2]|0)+116>>2]|0;c[47265]=m&3;m=m&1;a[194957]=m;if(!(m<<24>>24))eM(b);else dM(b);fM(b);m=c[r>>2]|0;e=c[m+12>>2]|0;do if(e|0?(a[e+81>>0]|0)==0:0){g=e+24|0;c[t>>2]=c[g>>2];c[t+4>>2]=c[g+4>>2];c[t+8>>2]=c[g+8>>2];c[t+12>>2]=c[g+12>>2];n=+h[t>>3]+16.0;h[t>>3]=n;g=t+8|0;f=+h[g>>3]+8.0;h[g>>3]=f;g=(a[m+275>>0]&1)!=0;if(a[194957]|0){if(g){i=m+32|0;h[i>>3]=+h[i>>3]+f;}else {i=m+16|0;h[i>>3]=+h[i>>3]-f;}g=m+40|0;f=+h[g>>3];i=m+24|0;j=+h[i>>3];k=f-j;if(!(n>k))break;n=(n-k)*.5;h[i>>3]=j-n;h[g>>3]=f+n;break}i=(c[47265]|0)==0;do if(g)if(i){i=m+40|0;h[i>>3]=+h[i>>3]+f;break}else {i=m+24|0;h[i>>3]=+h[i>>3]-f;break}else if(i){i=m+24|0;h[i>>3]=+h[i>>3]-f;break}else {i=m+40|0;h[i>>3]=+h[i>>3]+f;break}while(0);g=m+32|0;f=+h[g>>3];i=m+16|0;j=+h[i>>3];k=f-j;if(n>k){n=(n-k)*.5;h[i>>3]=j-n;h[g>>3]=f+n;}}while(0);if(d){switch(c[47265]|0){case 0:{q=m+16|0;c[46606]=c[q>>2];c[46607]=c[q+4>>2];c[46608]=c[q+8>>2];c[46609]=c[q+12>>2];break}case 1:{aM(o,-+h[m+40>>3],+h[m+16>>3]);c[46606]=c[o>>2];c[46607]=c[o+4>>2];c[46608]=c[o+8>>2];c[46609]=c[o+12>>2];break}case 2:{aM(p,+h[m+16>>3],-+h[m+40>>3]);c[46606]=c[p>>2];c[46607]=c[p+4>>2];c[46608]=c[p+8>>2];c[46609]=c[p+12>>2];break}case 3:{aM(q,+h[m+24>>3],+h[m+16>>3]);c[46606]=c[q>>2];c[46607]=c[q+4>>2];c[46608]=c[q+8>>2];c[46609]=c[q+12>>2];break}default:{}}gM(b);e=c[(c[r>>2]|0)+12>>2]|0;}if(e|0?(a[e+81>>0]|0)==0:0){c[s>>2]=c[t>>2];c[s+4>>2]=c[t+4>>2];c[s+8>>2]=c[t+8>>2];c[s+12>>2]=c[t+12>>2];hM(b,s);}if(!0){l=w;return}if(!(a[194957]|0)){n=+h[23304];k=+h[23303];h[v>>3]=n;h[v+8>>3]=k;h[v+16>>3]=n;h[v+24>>3]=k;h[v+32>>3]=-k;h[v+40>>3]=-n;m4(s,103015,v)|0;}else {k=+h[23303];n=+h[23304];h[u>>3]=k;h[u+8>>3]=n;h[u+16>>3]=k;h[u+24>>3]=n;m4(s,102800,u)|0;}D4(s)|0;ab();}function dM(b){b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0;j=b+16|0;if(((yC(b)|0)!=(b|0)?(g=c[j>>2]|0,i=c[g+12>>2]|0,(i|0)!=0):0)?(a[i+81>>0]|0)==0:0){d=a[g+275>>0]|0;if(!(d&1)){f=+h[g+16>>3]+ +h[g+96>>3]*.5;b=g+104|0;}else {f=+h[g+32>>3]-+h[g+64>>3]*.5;b=g+72|0;}e=+h[b>>3];b=d<<24>>24;do if(!(b&4))if(!(b&2)){e=(+h[g+40>>3]+ +h[g+24>>3])*.5;break}else {e=+h[g+40>>3]-e*.5;break}else e=+h[g+24>>3]+e*.5;while(0);h[i+56>>3]=f;h[i+64>>3]=e;a[(c[(c[j>>2]|0)+12>>2]|0)+81>>0]=1;b=1;}else b=1;while(1){d=c[j>>2]|0;if((b|0)>(c[d+180>>2]|0))break;dM(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function eM(b){b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0;k=b+16|0;if(((yC(b)|0)!=(b|0)?(i=c[k>>2]|0,j=c[i+12>>2]|0,(j|0)!=0):0)?(a[j+81>>0]|0)==0:0){d=a[i+275>>0]|0;if(!(d&1)){g=+h[i+24>>3]+ +h[i+56>>3]*.5;b=i+48|0;}else {g=+h[i+40>>3]-+h[i+88>>3]*.5;b=i+80|0;}f=+h[b>>3];b=d<<24>>24;do if(!(b&4)){e=+h[i+16>>3];if(!(b&2)){e=(+h[i+32>>3]+e)*.5;break}else {e=e+f*.5;break}}else e=+h[i+32>>3]-f*.5;while(0);h[j+56>>3]=e;h[j+64>>3]=g;a[(c[(c[k>>2]|0)+12>>2]|0)+81>>0]=1;b=1;}else b=1;while(1){d=c[k>>2]|0;if((b|0)>(c[d+180>>2]|0))break;eM(c[(c[d+184>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}return}function fM(e){e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;S=l;l=l+544|0;L=S+504|0;R=S+416|0;Q=S+376|0;K=S+352|0;J=S+312|0;I=S+288|0;H=S+248|0;M=S+200|0;B=S+152|0;O=S+96|0;p=S+488|0;C=S+456|0;D=S+424|0;E=S+384|0;F=S+360|0;G=S+320|0;w=S+296|0;x=S+256|0;y=S+232|0;z=S+168|0;A=S+136|0;f=S+56|0;N=S+16|0;P=S;o=e+16|0;u=c[o>>2]|0;g=b[u+136>>1]&14;u=d[u+113>>0]|0;if(!((u&54|0)==0?(u&1|0)==0|(c[47139]|0)!=0:0)){u=g<<16>>16==0;n=jC(e)|0;h=0;j=0;i=0;while(1){if(!n)break;g=c[(c[n+16>>2]|0)+108>>2]|0;do if(g)if(!(a[g+81>>0]|0)){i=i+1|0;break}else {h=h+1|0;break}while(0);m=XA(e,n)|0;g=j;while(1){if(!m)break;k=c[m+16>>2]|0;j=c[k+108>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+100>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+104>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);j=c[k+96>>2]|0;do if(j){if(a[j+81>>0]|0){h=h+1|0;break}if(!u)g=g+((c[k+8>>2]|0)!=0&1)|0;}while(0);m=ZA(e,m)|0;}n=kC(e,n)|0;j=g;}if(!(a[(c[o>>2]|0)+113>>0]&8))o=0;else o=jM(e)|0;t=j+i|0;if(t|0){q=h+j+o+(tB(e)|0)|0;r=JK(q*40|0)|0;s=JK(t*40|0)|0;aM(M,2147483647.0,2147483647.0);g=M+16|0;aM(p,-2147483647.0,-2147483647.0);c[g>>2]=c[p>>2];c[g+4>>2]=c[p+4>>2];c[g+8>>2]=c[p+8>>2];c[g+12>>2]=c[p+12>>2];g=s;i=r;n=jC(e)|0;while(1){if(!n)break;c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];kM(C,n,i,L);c[M>>2]=c[C>>2];c[M+4>>2]=c[C+4>>2];c[M+8>>2]=c[C+8>>2];c[M+12>>2]=c[C+12>>2];c[M+16>>2]=c[C+16>>2];c[M+20>>2]=c[C+20>>2];c[M+24>>2]=c[C+24>>2];c[M+28>>2]=c[C+28>>2];h=c[(c[n+16>>2]|0)+108>>2]|0;do if(h)if(!(a[h+81>>0]|0)){c[L>>2]=c[B>>2];c[L+4>>2]=c[B+4>>2];c[L+8>>2]=c[B+8>>2];c[L+12>>2]=c[B+12>>2];mM(h,i,g,0,L);g=g+40|0;break}else {i=i+40|0;c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(D,h,i,L);c[M>>2]=c[D>>2];c[M+4>>2]=c[D+4>>2];c[M+8>>2]=c[D+8>>2];c[M+12>>2]=c[D+12>>2];c[M+16>>2]=c[D+16>>2];c[M+20>>2]=c[D+20>>2];c[M+24>>2]=c[D+24>>2];c[M+28>>2]=c[D+28>>2];break}while(0);m=XA(e,n)|0;i=i+40|0;while(1){if(!m)break;k=m+16|0;h=c[k>>2]|0;j=c[h+96>>2]|0;a:do if(!j)v=52;else {do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){vO(F,e,m);c[L>>2]=c[F>>2];c[L+4>>2]=c[F+4>>2];c[L+8>>2]=c[F+8>>2];c[L+12>>2]=c[F+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[H>>2]=c[j>>2];gA(0,103827,H)|0;break a}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(E,j,i,L);c[M>>2]=c[E>>2];c[M+4>>2]=c[E+4>>2];c[M+8>>2]=c[E+8>>2];c[M+12>>2]=c[E+12>>2];c[M+16>>2]=c[E+16>>2];c[M+20>>2]=c[E+20>>2];c[M+24>>2]=c[E+24>>2];c[M+28>>2]=c[E+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;v=52;}while(0);b:do if((v|0)==52){v=0;j=c[h+104>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){nM(w,m);c[L>>2]=c[w>>2];c[L+4>>2]=c[w+4>>2];c[L+8>>2]=c[w+8>>2];c[L+12>>2]=c[w+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[I>>2]=c[j>>2];gA(0,103862,I)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(G,j,i,L);c[M>>2]=c[G>>2];c[M+4>>2]=c[G+4>>2];c[M+8>>2]=c[G+8>>2];c[M+12>>2]=c[G+12>>2];c[M+16>>2]=c[G+16>>2];c[M+20>>2]=c[G+20>>2];c[M+24>>2]=c[G+24>>2];c[M+28>>2]=c[G+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;}j=c[h+100>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){oM(y,m);c[L>>2]=c[y>>2];c[L+4>>2]=c[y+4>>2];c[L+8>>2]=c[y+8>>2];c[L+12>>2]=c[y+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[J>>2]=c[j>>2];gA(0,103902,J)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(x,j,i,L);c[M>>2]=c[x>>2];c[M+4>>2]=c[x+4>>2];c[M+8>>2]=c[x+8>>2];c[M+12>>2]=c[x+12>>2];c[M+16>>2]=c[x+16>>2];c[M+20>>2]=c[x+20>>2];c[M+24>>2]=c[x+24>>2];c[M+28>>2]=c[x+28>>2];}while(0);i=i+40|0;h=c[k>>2]|0;}j=c[h+108>>2]|0;if(j){do if(!(a[j+81>>0]|0)){if(!u?c[h+8>>2]|0:0){vO(A,e,m);c[L>>2]=c[A>>2];c[L+4>>2]=c[A+4>>2];c[L+8>>2]=c[A+8>>2];c[L+12>>2]=c[A+12>>2];mM(j,i,g,1,L);g=g+40|0;break}c[K>>2]=c[j>>2];gA(0,103942,K)|0;break b}else {c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];c[L+16>>2]=c[M+16>>2];c[L+20>>2]=c[M+20>>2];c[L+24>>2]=c[M+24>>2];c[L+28>>2]=c[M+28>>2];lM(z,j,i,L);c[M>>2]=c[z>>2];c[M+4>>2]=c[z+4>>2];c[M+8>>2]=c[z+8>>2];c[M+12>>2]=c[z+12>>2];c[M+16>>2]=c[z+16>>2];c[M+20>>2]=c[z+20>>2];c[M+24>>2]=c[z+24>>2];c[M+28>>2]=c[z+28>>2];}while(0);i=i+40|0;}}while(0);m=ZA(e,m)|0;}n=kC(e,n)|0;}if(o|0){c[f>>2]=c[M>>2];c[f+4>>2]=c[M+4>>2];c[f+8>>2]=c[M+8>>2];c[f+12>>2]=c[M+12>>2];c[f+16>>2]=c[M+16>>2];c[f+20>>2]=c[M+20>>2];c[f+24>>2]=c[M+24>>2];c[f+28>>2]=c[M+28>>2];c[f+32>>2]=i;h=L;g=h+40|0;do{c[h>>2]=c[f>>2];h=h+4|0;f=f+4|0;}while((h|0)<(g|0));pM(N,e,L);c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];c[M+16>>2]=c[N+16>>2];c[M+20>>2]=c[N+20>>2];c[M+24>>2]=c[N+24>>2];c[M+28>>2]=c[N+28>>2];}a[O+32>>0]=cP(e,GA(e,0,103978,0)|0,1)|0;c[O>>2]=c[M>>2];c[O+4>>2]=c[M+4>>2];c[O+8>>2]=c[M+8>>2];c[O+12>>2]=c[M+12>>2];c[O+16>>2]=c[M+16>>2];c[O+20>>2]=c[M+20>>2];c[O+24>>2]=c[M+24>>2];c[O+28>>2]=c[M+28>>2];hT(r,q,s,t,O)|0;if(0);f=0;g=0;h=s;while(1){if((g|0)>=(t|0))break;if(a[h+36>>0]|0){O=c[h+32>>2]|0;a[O+81>>0]=1;N=O+56|0;rM(P,h);c[N>>2]=c[P>>2];c[N+4>>2]=c[P+4>>2];c[N+8>>2]=c[P+8>>2];c[N+12>>2]=c[P+12>>2];zP(e,O);f=f+1|0;}g=g+1|0;h=h+40|0;}if(!0){if((f|0)!=(t|0)){c[R>>2]=f;c[R+4>>2]=t;gA(0,104023,R)|0;}}U1(r);U1(s);}}l=S;return}function gM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0;i=l;l=l+48|0;e=i+32|0;f=i+16|0;g=i;if(+h[23303]!=0.0|+h[23304]!=0.0|(c[47265]|0)!=0){d=jC(a)|0;while(1){if(!d)break;if(c[47265]|0)qQ(d,0);b=d+16|0;j=(c[b>>2]|0)+16|0;c[e>>2]=c[j>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[e+12>>2]=c[j+12>>2];bM(f,e);c[j>>2]=c[f>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];b=c[(c[b>>2]|0)+108>>2]|0;if(b|0){j=b+56|0;c[e>>2]=c[j>>2];c[e+4>>2]=c[j+4>>2];c[e+8>>2]=c[j+8>>2];c[e+12>>2]=c[j+12>>2];bM(g,e);c[j>>2]=c[g>>2];c[j+4>>2]=c[g+4>>2];c[j+8>>2]=c[g+8>>2];c[j+12>>2]=c[g+12>>2];}a:do if((c[47138]|0)==1){b=XA(a,d)|0;while(1){if(!b)break a;iM(b);b=ZA(a,b)|0;}}while(0);d=kC(a,d)|0;}$L(a,c[(c[a+16>>2]|0)+116>>2]&3);}l=i;return}function hM(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0;i=b+16|0;j=c[i>>2]|0;g=a[j+275>>0]|0;b=g<<24>>24;do if(!(b&4)){e=+h[j+16>>3];if(!(b&2)){f=(+h[j+32>>3]+e)*.5;break}else {f=+h[d>>3]*.5+e;break}}else f=+h[j+32>>3]-+h[d>>3]*.5;while(0);if(!(g&1))e=+h[d+8>>3]*.5+ +h[j+24>>3];else e=+h[j+40>>3]-+h[d+8>>3]*.5;j=c[j+12>>2]|0;h[j+56>>3]=f;h[j+64>>3]=e;a[(c[(c[i>>2]|0)+12>>2]|0)+81>>0]=1;return}function iM(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=l;l=l+144|0;q=s+120|0;e=s+16|0;i=s+104|0;j=s+88|0;k=s+72|0;m=s+56|0;n=s+40|0;o=s+24|0;r=s;p=b+16|0;d=c[p>>2]|0;f=c[d+8>>2]|0;if(!f){if((a[194954]|0)==0?(a[d+112>>0]|0)!=6:0){q=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;r=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[e>>2]=q;c[e+4>>2]=r;gA(1,103810,e)|0;}}else {h=0;b=f;while(1){if((h|0)>=(c[b+4>>2]|0))break;g=c[b>>2]|0;b=c[g+(h*48|0)>>2]|0;e=c[g+(h*48|0)+4>>2]|0;f=c[g+(h*48|0)+8>>2]|0;g=c[g+(h*48|0)+12>>2]|0;d=0;while(1){if((d|0)>=(e|0))break;t=b+(d<<4)|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(i,q);c[t>>2]=c[i>>2];c[t+4>>2]=c[i+4>>2];c[t+8>>2]=c[i+8>>2];c[t+12>>2]=c[i+12>>2];d=d+1|0;}if(f|0){t=(c[c[(c[p>>2]|0)+8>>2]>>2]|0)+(h*48|0)+16|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(j,q);c[t>>2]=c[j>>2];c[t+4>>2]=c[j+4>>2];c[t+8>>2]=c[j+8>>2];c[t+12>>2]=c[j+12>>2];}if(g|0){t=(c[c[(c[p>>2]|0)+8>>2]>>2]|0)+(h*48|0)+32|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(k,q);c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];}d=c[p>>2]|0;h=h+1|0;b=c[d+8>>2]|0;}b=c[d+96>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(m,q);c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];d=c[p>>2]|0;}b=c[d+108>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(n,q);c[d>>2]=c[n>>2];c[d+4>>2]=c[n+4>>2];c[d+8>>2]=c[n+8>>2];c[d+12>>2]=c[n+12>>2];d=c[p>>2]|0;}b=c[d+100>>2]|0;if(b){d=b+56|0;c[q>>2]=c[d>>2];c[q+4>>2]=c[d+4>>2];c[q+8>>2]=c[d+8>>2];c[q+12>>2]=c[d+12>>2];bM(o,q);c[d>>2]=c[o>>2];c[d+4>>2]=c[o+4>>2];c[d+8>>2]=c[o+8>>2];c[d+12>>2]=c[o+12>>2];d=c[p>>2]|0;}d=c[d+104>>2]|0;if(d|0){t=d+56|0;c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];bM(r,q);c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];}}l=s;return}function jM(b){b=b|0;var d=0,e=0,f=0;f=b+16|0;if((yC(b)|0)!=(b|0)?(d=c[(c[f>>2]|0)+12>>2]|0,(d|0)!=0):0){e=1;b=(a[d+81>>0]|0)!=0&1;}else {e=1;b=0;}while(1){d=c[f>>2]|0;if((e|0)>(c[d+180>>2]|0))break;d=(jM(c[(c[d+184>>2]|0)+(e<<2)>>2]|0)|0)+b|0;e=e+1|0;b=d;}return b|0}function kM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0;g=l;l=l+32|0;i=g;n=(a[194957]|0)==0;d=d+16|0;m=c[d>>2]|0;k=+h[(n?m+32|0:m+40|0)>>3];h[e+16>>3]=k*72.0;j=+h[(n?m+40|0:m+32|0)>>3];h[e+24>>3]=j*72.0;d=(c[d>>2]|0)+16|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];h[e>>3]=+h[e>>3]-k*36.0;d=e+8|0;h[d>>3]=+h[d>>3]-j*36.0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];sM(b,e,i);l=g;return}function lM(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0.0,m=0,n=0;g=l;l=l+32|0;i=g;n=(a[194957]|0)==0;m=d+24|0;k=+h[(n?m:d+32|0)>>3];h[e+16>>3]=k;j=+h[(n?d+32|0:m)>>3];h[e+24>>3]=j;d=d+56|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];h[e>>3]=+h[e>>3]-k*.5;d=e+8|0;h[d>>3]=+h[d>>3]-j*.5;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];sM(b,e,i);l=g;return}function mM(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(f|0){f=d+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];}if(!(a[194957]|0)){g=b+24|0;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];}else {h[e>>3]=+h[b+32>>3];h[e+8>>3]=+h[b+24>>3];}c[e+32>>2]=b;a[e+36>>0]=0;c[d+32>>2]=e;return}function nM(a,b){a=a|0;b=b|0;b=uO(b)|0;do if(b){b=c[b>>2]|0;if(!(c[b+8>>2]|0)){b=c[b>>2]|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}else {b=b+16|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];break}}else {c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}while(0);return}function oM(a,b){a=a|0;b=b|0;var d=0;b=uO(b)|0;do if(b){d=c[b>>2]|0;b=(c[b+4>>2]|0)+-1|0;if(!(c[d+(b*48|0)+12>>2]|0)){d=(c[d+(b*48|0)>>2]|0)+((c[d+(b*48|0)+4>>2]|0)+-1<<4)|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}else {d=d+(b*48|0)+32|0;c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];break}}else {c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;}while(0);return}function pM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+112|0;k=q+72|0;n=q+32|0;o=q;p=d+16|0;j=1;while(1){f=c[p>>2]|0;if((j|0)>(c[f+180>>2]|0))break;f=c[(c[f+184>>2]|0)+(j<<2)>>2]|0;g=k;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));pM(n,f,k);g=e;h=n;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));j=j+1|0;}if(((yC(d)|0)!=(d|0)?(m=c[(c[p>>2]|0)+12>>2]|0,m|0):0)?a[m+81>>0]|0:0){p=e+32|0;n=c[p>>2]|0;c[k>>2]=c[e>>2];c[k+4>>2]=c[e+4>>2];c[k+8>>2]=c[e+8>>2];c[k+12>>2]=c[e+12>>2];c[k+16>>2]=c[e+16>>2];c[k+20>>2]=c[e+20>>2];c[k+24>>2]=c[e+24>>2];c[k+28>>2]=c[e+28>>2];lM(o,m,n,k);c[e>>2]=c[o>>2];c[e+4>>2]=c[o+4>>2];c[e+8>>2]=c[o+8>>2];c[e+12>>2]=c[o+12>>2];c[e+16>>2]=c[o+16>>2];c[e+20>>2]=c[o+20>>2];c[e+24>>2]=c[o+24>>2];c[e+28>>2]=c[o+28>>2];c[p>>2]=(c[p>>2]|0)+40;}g=b;h=e;i=g+40|0;do{c[g>>2]=c[h>>2];g=g+4|0;h=h+4|0;}while((g|0)<(i|0));l=q;return}function qM(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+160|0;r=s+96|0;p=s+48|0;o=s;q=c[15712]|0;n=d[g+32>>0]|0;i=+h[g>>3];j=+h[g+8>>3];k=+h[g+16>>3];m=+h[g+24>>3];c[o>>2]=b;c[o+4>>2]=f;c[o+8>>2]=n;h[o+16>>3]=i;h[o+24>>3]=j;h[o+32>>3]=k;h[o+40>>3]=m;w4(q,104065,o)|0;a:do if(0>=2);while(0);l=s;return}function rM(a,b){a=a|0;b=b|0;var c=0.0;c=+h[b+8>>3]*.5+ +h[b+24>>3];h[a>>3]=+h[b>>3]*.5+ +h[b+16>>3];h[a+8>>3]=c;return}function sM(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0.0;e=l;l=l+16|0;f=e;j=+h[b>>3];h[d>>3]=+h[(+h[d>>3]>3];g=d+8|0;i=+h[b+8>>3];h[g>>3]=+h[(+h[g>>3]>3];j=+h[b+16>>3]+j;h[f>>3]=j;i=+h[b+24>>3]+i;h[f+8>>3]=i;g=d+16|0;h[g>>3]=+h[(+h[g>>3]>j?g:f)>>3];b=d+24|0;h[b>>3]=+h[(+h[b>>3]>i?g:f)+8>>3];c[a>>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];c[a+20>>2]=c[d+20>>2];c[a+24>>2]=c[d+24>>2];c[a+28>>2]=c[d+28>>2];l=e;return}function tM(a){a=a|0;cM(a,1);return}function uM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=l;l=l+16|0;d=e;b=mP(QA(a,105526)|0)|0;if(b){b=vM(b)|0;if(b|0){f=c[b+40>>2]|0;d=c[b+44>>2]|0;g=a+16|0;a=c[g>>2]|0;h[a+32>>3]=+(f|0)*.013888888888888888;h[a+40>>3]=+(d|0)*.013888888888888888;a=JK(12)|0;c[(c[g>>2]|0)+12>>2]=a;c[a>>2]=c[b+12>>2];c[a+4>>2]=((f|0)/-2|0)-(c[b+32>>2]|0);c[a+8>>2]=((d|0)/-2|0)-(c[b+36>>2]|0);}}else {c[d>>2]=KB(a)|0;gA(0,104234,d)|0;}l=e;return}function vM(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+1152|0;i=p+24|0;h=p+8|0;e=p;f=p+120|0;j=p+44|0;k=p+40|0;m=p+36|0;n=p+32|0;o=p+28|0;d=c[47266]|0;if(!d){d=Vz(20812,c[4581]|0)|0;c[47266]=d;}d=nb[c[d>>2]&63](d,b,512)|0;do if(!d){g=$4(b,138821)|0;if(!g){c[e>>2]=b;gA(0,104283,e)|0;d=0;break}else {d=0;e=0;}while(1){if(!(c4(f,1024,g)|0)){f=11;break}c[h>>2]=k;c[h+4>>2]=m;c[h+8>>2]=n;c[h+12>>2]=o;q=(b5(f,104311,h)|0)==4;e=q?1:e;if((a[f>>0]|0)!=37){q=(d4(f,104340)|0)==0;d=q?d:1;}if((e|0)!=0&(d|0)!=0){f=12;break}}if((f|0)==11)if(!e){c[i>>2]=b;gA(0,104345,i)|0;d=0;}else f=12;if((f|0)==12){q=KK(64)|0;k=c[k>>2]|0;c[q+32>>2]=k;m=c[m>>2]|0;c[q+40>>2]=(c[n>>2]|0)-k;c[q+36>>2]=(c[o>>2]|0)-m;c[q+8>>2]=b;o=c[47267]|0;c[47267]=o+1;c[q+12>>2]=o;Z4(A6(g)|0,j)|0;o=c[j+36>>2]|0;n=KK(o+1|0)|0;c[q+52>>2]=n;n5(g,0,0)|0;x6(n,o,1,g)|0;a[n+o>>0]=0;o=c[47266]|0;nb[c[o>>2]&63](o,q,1)|0;a[q+16>>0]=d;d=q;}I4(g)|0;}while(0);l=p;return d|0}function wM(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b+52>>2]|0);return}function xM(a){a=a|0;U1(c[(c[a+16>>2]|0)+12>>2]|0);return}function yM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n+8|0;k=n;j=(d|0)!=0;a:do if(j){h=0;f=0;b:while(1)while(1){if(h)break a;g=c[d+(f<<2)>>2]|0;if(!g){i=6;break a}f=f+1|0;if(!(a[g>>0]|0)){h=1;continue b}}}else i=6;while(0);c:do if((i|0)==6)while(1){f=c[e>>2]|0;if(!f)break c;oF(b,f)|0;oF(b,153599)|0;e=e+4|0;i=6;}while(0);d:do if(j){h=0;while(1){f=c[d+(h<<2)>>2]|0;if(!f)break d;do if(a[f>>0]|0){e=mP(f)|0;if(!e){c[k>>2]=f;gA(0,104384,k)|0;break}g=$4(e,138821)|0;if(!g){c[m>>2]=e;gA(0,104412,m)|0;break}while(1){f=lP(g)|0;if(!f)break;oF(b,f)|0;}oF(b,153599)|0;I4(g)|0;}while(0);h=h+1|0;}}while(0);l=n;return}function zM(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;d=c[d+52>>2]|0;a:while(1){e=a[d>>0]|0;b:do switch(e<<24>>24){case 0:break a;case 37:{if((a[d+1>>0]|0)==37){e=d+2|0;if((((j3(e,104440,3)|0)!=0?(j3(e,104444,5)|0)!=0:0)?(j3(e,104450,3)|0)!=0:0)?(j3(e,104454,7)|0)!=0:0){e=37;break b}else g=37;c:while(1){switch(g<<24>>24){case 13:{f=10;break c}case 10:case 0:{f=12;break c}default:{}}g=d+1|0;d=g;g=a[g>>0]|0;}if((f|0)==10){e=d+1|0;if((a[e>>0]|0)==10){d=d+2|0;continue a}}else if((f|0)==12)e=d+1|0;d=g<<24>>24==0?d:e;continue a}else e=37;break}default:{}}while(0);d:while(1){switch(e<<24>>24){case 10:case 13:case 0:break d;default:{}}pF(b,e<<24>>24)|0;g=d+1|0;d=g;e=a[g>>0]|0;}f=d+1|0;if(e<<24>>24==13?(a[f>>0]|0)==10:0)d=d+2|0;else d=e<<24>>24==0?d:f;pF(b,10)|0;}return}function AM(b){b=b|0;var d=0,e=0,f=0,g=0;f=l;l=l+16|0;e=f;d=c[47266]|0;a:do if(d|0){d=nb[c[d>>2]&63](d,0,128)|0;while(1){if(!d)break a;if(!(a[d+16>>0]|0)){c[e>>2]=c[d+12>>2];uF(b,104462,e);oF(b,104480)|0;zM(b,d);oF(b,104498)|0;oF(b,104513)|0;}g=c[47266]|0;d=nb[c[g>>2]&63](g,d,8)|0;}}while(0);l=f;return}function BM(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;e=g;a:do switch(d|0){case 0:{f=b;break}case 1:{f=fQ(b)|0;break}default:{switch(CM(b)|0){case 2:break;case 1:{f=fQ(b)|0;break a}default:{f=b;break a}}if(!(c[47268]|0)){gA(0,104525,e)|0;c[47268]=1;f=b;}else f=b;}}while(0);if(!(c[47269]|0))kA(189076,0,0);d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=40;e=f;b:while(1){switch(a[e>>0]|0){case 0:break b;case 92:case 41:case 40:{d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=92;break}default:{}}d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}h=a[e>>0]|0;c[47270]=d+1;a[d>>0]=h;e=e+1|0;}d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}c[47270]=d+1;a[d>>0]=41;if((f|0)!=(b|0))U1(f);d=c[47270]|0;if(d>>>0>=(c[47271]|0)>>>0){lA(189076,1)|0;d=c[47270]|0;}a[d>>0]=0;h=c[47269]|0;c[47270]=h;l=g;return h|0}function CM(b){b=b|0;var c=0,d=0;c=0;a:while(1){while(1){d=a[b>>0]|0;if(!(d<<24>>24))break a;if((d&255)<127)b=b+1|0;else break}if((d&-4)<<24>>24==-64){c=1;b=b+2|0;}else {c=2;break}}return c|0}function DM(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+96|0;i=n+80|0;j=n+72|0;m=n+64|0;g=n+32|0;k=n;h[g>>3]=+h[a>>3];h[g+8>>3]=+h[a+8>>3];h[g+16>>3]=+h[b>>3];h[g+24>>3]=+h[b+8>>3];do if((iY(d,g,j)|0)>=0){if(!f){b=d+4|0;a=c[b>>2]|0;f=c[47274]|0;if((a|0)>(c[47273]|0)){if(!f)a=KK(a<<5)|0;else a=MK(f,a<<5)|0;c[47274]=a;g=c[b>>2]|0;c[47273]=g;f=a;}else g=a;b=c[d>>2]|0;a=0;while(1){if((a|0)>=(g|0))break;o=f+(a<<5)|0;d=b+(a<<4)|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];o=f+(a<<5)+16|0;d=a+1|0;p=b+(((d|0)%(g|0)|0)<<4)|0;c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];a=d;}c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];if((OX(f,g,i,k,m)|0)<0){a=0;break}}else {c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];FY(i,m);}a=m+4|0;if(!(EM(c[a>>2]|0)|0)){g=c[a>>2]|0;a=c[47275]|0;f=c[m>>2]|0;b=0;while(1){if((b|0)>=(g|0))break;p=a+(b<<4)|0;o=f+(b<<4)|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];b=b+1|0;}c[e>>2]=g;}else a=0;}else a=0;while(0);l=n;return a|0}function EM(a){a=a|0;var b=0,d=0,e=0;e=l;l=l+16|0;d=e;b=c[47276]|0;do if((b|0)<(a|0)){a=a+300-((a|0)%300|0)+b|0;b=MK(c[47275]|0,a<<4)|0;c[47275]=b;if(!b){gA(1,104615,d)|0;a=1;break}else {c[47276]=a;a=0;break}}else a=0;while(0);l=e;return a|0}function FM(){var a=0,b=0,d=0;b=l;l=l+16|0;a=b;d=c[47277]|0;c[47277]=d+1;do if((d|0)<=0){d=KK(4800)|0;c[47275]=d;if(!d){gA(1,104638,a)|0;a=1;break}c[47276]=300;c[47278]=0;c[47279]=0;if(0);else a=0;}else a=0;while(0);l=b;return a|0}function GM(){var a=0,b=0,d=0,e=0.0,f=0,g=0;b=l;l=l+16|0;a=b;d=c[47277]|0;c[47277]=d+-1;if((d|0)<=1?(U1(c[47275]|0),0):0){d=c[15712]|0;g=c[47278]|0;f=c[47279]|0;e=+UO();c[a>>2]=g;c[a+4>>2]=f;h[a+8>>3]=e;w4(d,104676,a)|0;}l=b;return}function HM(a,b){a=a|0;b=b|0;return IM(a,b,0)|0}function IM(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;L=l;l=l+176|0;G=L+168|0;K=L+128|0;x=L+120|0;v=L+112|0;i=L+104|0;s=L+88|0;n=L+72|0;g=L+64|0;t=L+160|0;I=L+152|0;y=L+144|0;u=L+32|0;w=L;J=L+136|0;c[47278]=(c[47278]|0)+1;H=c[b+80>>2]|0;c[47279]=(c[47279]|0)+H;f=b+88|0;while(1){C=c[f>>2]|0;if(!C){D=4;break}f=c[C+16>>2]|0;if(!(a[f+112>>0]|0)){D=5;break}else f=f+116|0;}do if((D|0)==4){gA(1,104719,g)|0;f=0;}else if((D|0)==5){B=c[b+84>>2]|0;if(!(JM(H,B,b)|0)){g=H<<3;if((g|0)>(c[47280]|0)){f=c[47281]|0;if(!f)f=KK(H<<7)|0;else f=MK(f,H<<7)|0;c[47281]=f;c[47280]=g;}a:do if((H|0)>1?+h[B+8>>3]>+h[B+40>>3]:0){f=0;while(1){if((f|0)==(H|0)){p=1;break a}z=B+(f<<5)+24|0;m=+h[z>>3];A=B+(f<<5)+8|0;h[z>>3]=-+h[A>>3];h[A>>3]=-m;f=f+1|0;}}else p=0;while(0);r=c[C>>2]&3;z=C+48|0;f=c[((r|0)==3?C:z)+40>>2]|0;A=C+-48|0;if((f|0)==(c[((r|0)==2?C:A)+40>>2]|0)){c[i>>2]=KB(f)|0;gA(1,104826,i)|0;f=0;break}o=H+-1|0;q=c[47281]|0;r=q;f=0;j=0;b:while(1){if((j|0)>=(H|0)){j=o;n=f;break}if((j|0)>0)g=+h[B+(j<<5)+8>>3]>+h[B+(j+-1<<5)+8>>3]?-1:1;else g=0;if((j|0)<(o|0))i=+h[B+(j+1<<5)+8>>3]>+h[B+(j<<5)+8>>3]?1:-1;else i=0;c:do if((g|0)!=(i|0))if((g|0)==1|(i|0)==-1){g=B+(j<<5)|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+8|0;D=29;break}else {g=B+(j<<5)+16|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+24|0;D=29;break}else {switch(g|0){case -1:break c;case 0:break;default:{D=28;break b}}g=B+(j<<5)|0;h[q+(f<<4)>>3]=+h[g>>3];i=f+1|0;h[q+(f<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(i<<4)>>3]=+h[g>>3];g=B+(j<<5)+8|0;D=29;}while(0);if((D|0)==29){D=0;h[q+(i<<4)+8>>3]=+h[g>>3];f=f+2|0;}j=j+1|0;}if((D|0)==28){c[n>>2]=g;c[n+4>>2]=g;c[n+8>>2]=480;gA(1,104761,n)|0;f=0;break}d:while(1){if((j|0)<=-1)break;if((j|0)<(o|0))f=+h[B+(j<<5)+8>>3]>+h[B+(j+1<<5)+8>>3]?-1:1;else f=0;if((j|0)>0)g=+h[B+(j+-1<<5)+8>>3]>+h[B+(j<<5)+8>>3]?1:-1;else g=0;e:do if((f|0)!=(g|0))if((f|0)==1|(g|0)==-1){f=B+(j<<5)|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+24>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+8|0;i=2;break}else {f=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+24|0;i=2;break}else switch(f|0){case 0:{f=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[f>>3];g=n+1|0;h[q+(n<<4)+8>>3]=+h[B+(j<<5)+8>>3];h[q+(g<<4)>>3]=+h[f>>3];f=B+(j<<5)+24|0;i=2;break e}case -1:{N=B+(j<<5)+16|0;h[q+(n<<4)>>3]=+h[N>>3];f=B+(j<<5)+8|0;i=n+1|0;h[q+(n<<4)+8>>3]=+h[f>>3];h[q+(i<<4)>>3]=+h[N>>3];N=B+(j<<5)+24|0;M=n+2|0;h[q+(i<<4)+8>>3]=+h[N>>3];i=B+(j<<5)|0;h[q+(M<<4)>>3]=+h[i>>3];g=n+3|0;h[q+(M<<4)+8>>3]=+h[N>>3];h[q+(g<<4)>>3]=+h[i>>3];i=4;break e}default:{D=42;break d}}while(0);h[q+(g<<4)+8>>3]=+h[f>>3];j=j+-1|0;n=n+i|0;}if((D|0)==42){c[s>>2]=f;c[s+4>>2]=f;c[s+8>>2]=513;gA(1,104761,s)|0;f=0;break}f:do if(!p)f=0;else {f=0;while(1){if((f|0)>=(H|0)){f=0;break}M=B+(f<<5)+24|0;m=+h[M>>3];N=B+(f<<5)+8|0;h[M>>3]=-+h[N>>3];h[N>>3]=-m;f=f+1|0;}while(1){if((f|0)>=(n|0)){f=0;break f}N=q+(f<<4)+8|0;h[N>>3]=-+h[N>>3];f=f+1|0;}}while(0);while(1){if((f|0)>=(H|0))break;h[B+(f<<5)>>3]=2147483647.0;h[B+(f<<5)+16>>3]=-2147483648.0;f=f+1|0;}c[t>>2]=r;i=t+4|0;c[i>>2]=n;h[u>>3]=+h[b>>3];h[u+8>>3]=+h[b+8>>3];h[u+16>>3]=+h[b+40>>3];h[u+24>>3]=+h[b+48>>3];if((iY(t,u,I)|0)<0){gA(1,104865,v)|0;f=0;break}if(!e){g=c[i>>2]|0;f=c[47274]|0;if((g|0)>(c[47273]|0)){if(!f)f=KK(g<<5)|0;else f=MK(f,g<<5)|0;c[47274]=f;g=c[i>>2]|0;c[47273]=g;}j=c[47281]|0;i=0;while(1){if((i|0)>=(g|0))break;M=f+(i<<5)|0;N=j+(i<<4)|0;c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];M=f+(i<<5)+16|0;N=i+1|0;v=j+(((N|0)%(g|0)|0)<<4)|0;c[M>>2]=c[v>>2];c[M+4>>2]=c[v+4>>2];c[M+8>>2]=c[v+8>>2];c[M+12>>2]=c[v+12>>2];i=N;}if(!(a[b+29>>0]|0)){k=0.0;m=0.0;}else {m=+h[b+16>>3];k=+E(+m);m=+F(+m);}h[w+8>>3]=m;h[w>>3]=k;if(!(a[b+69>>0]|0)){k=0.0;m=0.0;}else {m=+h[b+56>>3];k=-+E(+m);m=-+F(+m);}h[w+24>>3]=m;h[w+16>>3]=k;c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];if((OX(f,g,G,w,y)|0)<0){gA(1,104904,x)|0;f=0;break}}else {c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];FY(G,y);}n=y+4|0;if(!(EM(c[n>>2]|0)|0)){f=0;while(1){if((f|0)>=(H|0))break;h[B+(f<<5)>>3]=2147483647.0;h[B+(f<<5)+16>>3]=-2147483648.0;f=f+1|0;}i=c[n>>2]|0;j=c[47275]|0;g=c[y>>2]|0;f=0;while(1){if((f|0)>=(i|0)){i=1;f=10;g=0;break}N=j+(f<<4)|0;M=g+(f<<4)|0;c[N>>2]=c[M>>2];c[N+4>>2]=c[M+4>>2];c[N+8>>2]=c[M+8>>2];c[N+12>>2]=c[M+12>>2];f=f+1|0;}while(1){if(!((g|0)<15&i<<24>>24!=0))break;KM(B,H,c[47275]|0,c[n>>2]|0,f);j=0;while(1){if((j|0)>=(H|0))break;if(+h[B+(j<<5)>>3]==2147483647.0){D=82;break}if(+h[B+(j<<5)+16>>3]==-2147483648.0){D=82;break}j=j+1|0;}if((D|0)==82){D=0;N=f<<1;f=N;g=(N|0)>(2147483647/(H|0)|0|0)?15:g;}i=(j|0)==(H|0)?0:i;g=g+1|0;}if(i<<24>>24){M=KB(c[((c[C>>2]&3|0)==3?C:z)+40>>2]|0)|0;N=KB(c[((c[C>>2]&3|0)==2?C:A)+40>>2]|0)|0;c[K>>2]=M;c[K+4>>2]=N;gA(0,104942,K)|0;c[G>>2]=c[I>>2];c[G+4>>2]=c[I+4>>2];FY(G,J);KM(B,H,c[J>>2]|0,c[J+4>>2]|0,10);U1(c[J>>2]|0);}c[d>>2]=c[n>>2];f=c[47275]|0;}else f=0;}else f=0;}while(0);l=L;return f|0}function JM(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0,L=0,M=0,N=0,O=0.0,P=0,Q=0,R=0;R=l;l=l+32|0;I=R+16|0;H=R+8|0;k=R;e=0;j=0;while(1){if((j|0)>=(a|0))break;i=b+(j<<5)|0;s=+h[b+(j<<5)+8>>3]-+h[b+(j<<5)+24>>3];if(!((s>=0.0?s:-s)<.01)?(s=+h[i>>3]-+h[b+(j<<5)+16>>3],!((s>=0.0?s:-s)<.01)):0){if((e|0)!=(j|0)){P=b+(e<<5)|0;c[P>>2]=c[i>>2];c[P+4>>2]=c[i+4>>2];c[P+8>>2]=c[i+8>>2];c[P+12>>2]=c[i+12>>2];c[P+16>>2]=c[i+16>>2];c[P+20>>2]=c[i+20>>2];c[P+24>>2]=c[i+24>>2];c[P+28>>2]=c[i+28>>2];}e=e+1|0;}j=j+1|0;}J=b+16|0;do if(!(+h[b>>3]>+h[J>>3])?(L=b+8|0,N=b+24|0,!(+h[L>>3]>+h[N>>3])):0){P=e+-1|0;M=c[15712]|0;w=0;while(1){if((w|0)>=(P|0))break;D=w+1|0;E=b+(D<<5)|0;f=+h[E>>3];F=b+(D<<5)+16|0;g=+h[F>>3];if(f>g){Q=16;break}A=b+(D<<5)+8|0;m=+h[A>>3];B=b+(D<<5)+24|0;n=+h[B>>3];if(m>n){Q=16;break}G=b+(w<<5)+16|0;v=+h[G>>3]>3]>g;a=u&1;z=b+(w<<5)+24|0;t=+h[z>>3]>3]>n;i=k&1;x=a+e+j+i|0;o=(x|0)!=0;if(!(0==0|o^1)){c[I>>2]=w;c[I+4>>2]=D;w4(M,105142,I)|0;LM(d);}a:do if(o){if(!v)if(!u)if(!t){if(k){k=0;o=e;e=B;i=y;Q=24;}}else {k=i;j=0;o=e;e=A;i=z;Q=24;}else {k=i;a=0;o=e;e=F;i=C;Q=24;}else {k=i;o=0;e=E;i=G;Q=24;}if((Q|0)==24){Q=0;w=~~+h[i>>3];h[i>>3]=+h[e>>3];h[e>>3]=+(w|0);i=k;e=o;}o=x+-1|0;k=0;while(1){if((k|0)>=(o|0))break a;do if((e|0)!=1){if((a|0)==1){s=+(~~((+h[F>>3]+ +h[C>>3])*.5+.5)|0);h[F>>3]=s;h[C>>3]=s;a=0;break}if((j|0)==1){s=+(~~((+h[A>>3]+ +h[z>>3])*.5+.5)|0);h[A>>3]=s;h[z>>3]=s;j=0;break}if((i|0)==1){s=+(~~((+h[B>>3]+ +h[y>>3])*.5+.5)|0);h[B>>3]=s;h[y>>3]=s;i=0;}}else {s=+(~~((+h[E>>3]+ +h[G>>3])*.5+.5)|0);h[E>>3]=s;h[G>>3]=s;e=0;}while(0);k=k+1|0;}}while(0);p=+h[C>>3];q=+h[G>>3];r=+h[E>>3];s=+h[F>>3];i=MM(~~p,~~q,~~r,~~s)|0;n=+h[y>>3];m=+h[z>>3];g=+h[A>>3];f=+h[B>>3];e=MM(~~n,~~m,~~g,~~f)|0;if(!((i|0)!=0&(e|0)!=0)){w=D;continue}if((i|0)<(e|0)){B=q-p>s-r;w=q>3]=B?(w?r:s):w?q:p;w=D;continue}else {B=m-n>f-g;w=m>3]=B?(w?g:f):w?m:n;w=D;continue}}if((Q|0)==16){c[H>>2]=D;gA(1,105096,H)|0;LM(d);e=1;break}f=+h[d>>3];g=+h[b>>3];if(!(((!(f+h[J>>3]):0)?(K=+h[d+8>>3],!(K<+h[L>>3])):0)?!(K>+h[N>>3]):0)){if(0);if(f>3]=g;else g=f;f=+h[J>>3];if(g>f)h[d>>3]=f;e=d+8|0;g=+h[e>>3];f=+h[L>>3];if(g>3]=f;g=f;}f=+h[N>>3];if(g>f)h[e>>3]=f;}i=d+40|0;f=+h[i>>3];e=b+(P<<5)|0;g=+h[e>>3];if(((!(f+h[b+(P<<5)+16>>3]):0)?(O=+h[d+48>>3],!(O<+h[b+(P<<5)+8>>3])):0)?!(O>+h[b+(P<<5)+24>>3]):0){e=0;break}if(0);if(f>3]=g;f=g;}g=+h[b+(P<<5)+16>>3];if(f>g)h[i>>3]=g;e=d+48|0;f=+h[e>>3];g=+h[b+(P<<5)+8>>3];if(f>3]=g;else g=f;f=+h[b+(P<<5)+24>>3];if(g>f){h[e>>3]=f;e=0;}else e=0;}else Q=12;while(0);if((Q|0)==12){gA(1,105051,k)|0;LM(d);e=1;}l=R;return e|0}function KM(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;s=O(e,b)|0;t=1.0/+(s|0);e=0;a:while(1){u=e+3|0;if((u|0)>=(d|0))break;o=c+(e<<4)|0;p=c+(e<<4)+8|0;r=e+1|0;q=c+(r<<4)|0;r=c+(r<<4)+8|0;j=e+2|0;i=c+(j<<4)|0;j=c+(j<<4)+8|0;k=c+(u<<4)|0;l=c+(u<<4)+8|0;g=0;while(1){if((g|0)>(s|0)){e=u;continue a}v=t*+(g|0);m=+h[o>>3];n=+h[p>>3];y=+h[q>>3];w=+h[r>>3];z=+h[i>>3];x=+h[j>>3];m=(y-m)*v+m;n=(w-n)*v+n;y=(z-y)*v+y;w=(x-w)*v+w;m=(y-m)*v+m;n=(w-n)*v+n;m=((z-y+(+h[k>>3]-z)*v)*v+y-m)*v+m;n=((x-w+(+h[l>>3]-x)*v)*v+w-n)*v+n;f=0;while(1){if((f|0)>=(b|0))break;if(n<=+h[a+(f<<5)+24>>3]+.0001?n>=+h[a+(f<<5)+8>>3]+-.0001:0){e=a+(f<<5)|0;if(+h[e>>3]>m)h[e>>3]=m;e=a+(f<<5)+16|0;if(+h[e>>3]>3]=m;}f=f+1|0;}g=g+1|0;}}return}function LM(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0;m=l;l=l+112|0;j=m+80|0;k=m+48|0;i=m+8|0;g=m;e=c[15712]|0;f=b+80|0;c[g>>2]=c[f>>2];w4(e,105268,g)|0;g=b+84|0;d=0;while(1){if((d|0)>=(c[f>>2]|0))break;r=c[g>>2]|0;q=+h[r+(d<<5)>>3];p=+h[r+(d<<5)+8>>3];o=+h[r+(d<<5)+16>>3];n=+h[r+(d<<5)+24>>3];c[i>>2]=d;h[i+8>>3]=q;h[i+16>>3]=p;h[i+24>>3]=o;h[i+32>>3]=n;w4(e,105279,i)|0;d=d+1|0;}q=+h[b+8>>3];p=+h[b+16>>3];r=a[b+29>>0]|0?105310:105322;h[k>>3]=+h[b>>3];h[k+8>>3]=q;h[k+16>>3]=p;c[k+24>>2]=r;w4(e,105338,k)|0;p=+h[b+48>>3];q=+h[b+56>>3];r=a[b+69>>0]|0?105310:105322;h[j>>3]=+h[b+40>>3];h[j+8>>3]=p;h[j+16>>3]=q;c[j+24>>2]=r;w4(e,105389,j)|0;l=m;return}function MM(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;do if((b|0)>(c|0)&(d|0)>(a|0)){if(!((c|0)>(a|0)|(d|0)<(a|0))){a=d-a|0;break}if((b|0)<(c|0)|(b|0)>(d|0)){b=b-a|0;a=d-c|0;a=(b|0)<(a|0)?b:a;break}else {a=b-c|0;break}}else a=0;while(0);return a|0}function NM(a,b){a=a|0;b=b|0;return IM(a,b,1)|0}function OM(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;j=l;l=l+80|0;g=j;i=1;f=b;while(1){h=f;f=c[(c[f+16>>2]|0)+172>>2]|0;if(!((f|0)!=0&(h|0)!=(f|0)))break;else i=i+1|0;}if((i|0)>=21)g=JK(i<<2)|0;h=0;f=b;while(1){if((h|0)>=(i|0))break;c[g+(h<<2)>>2]=f;h=h+1|0;f=c[(c[f+16>>2]|0)+172>>2]|0;}PM(a,g,i,d,e);if((i|0)>20)U1(g);l=j;return}function PM(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0.0,M=0.0,N=0.0,P=0,Q=0;K=l;l=l+304|0;A=K+272|0;z=K+208|0;G=K+96|0;H=K+32|0;I=K+16|0;J=K;r=K+192|0;y=K+176|0;i=K+160|0;B=K+296|0;D=K+288|0;j=c[d>>2]|0;w=c[j>>2]&3;k=j+-48|0;E=c[((w|0)==2?j:k)+40>>2]|0;t=G+16|0;w=(c[(c[((w|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+16|0;x=j+16|0;F=(c[x>>2]|0)+16|0;c[z>>2]=c[w>>2];c[z+4>>2]=c[w+4>>2];c[z+8>>2]=c[w+8>>2];c[z+12>>2]=c[w+12>>2];c[A>>2]=c[F>>2];c[A+4>>2]=c[F+4>>2];c[A+8>>2]=c[F+8>>2];c[A+12>>2]=c[F+12>>2];QM(r,z,A);c[G>>2]=c[r>>2];c[G+4>>2]=c[r+4>>2];c[G+8>>2]=c[r+8>>2];c[G+12>>2]=c[r+12>>2];c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];c[I>>2]=c[r>>2];c[I+4>>2]=c[r+4>>2];c[I+8>>2]=c[r+8>>2];c[I+12>>2]=c[r+12>>2];r=G+32|0;F=G+48|0;w=(c[E+16>>2]|0)+16|0;x=(c[x>>2]|0)+56|0;c[z>>2]=c[w>>2];c[z+4>>2]=c[w+4>>2];c[z+8>>2]=c[w+8>>2];c[z+12>>2]=c[w+12>>2];c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];QM(y,z,A);c[F>>2]=c[y>>2];c[F+4>>2]=c[y+4>>2];c[F+8>>2]=c[y+8>>2];c[F+12>>2]=c[y+12>>2];c[r>>2]=c[y>>2];c[r+4>>2]=c[y+4>>2];c[r+8>>2]=c[y+8>>2];c[r+12>>2]=c[y+12>>2];c[J>>2]=c[y>>2];c[J+4>>2]=c[y+4>>2];c[J+8>>2]=c[y+8>>2];c[J+12>>2]=c[y+12>>2];a:do if((e|0)!=1&(a[194954]|0)==0){m=+h[G>>3];n=+h[F>>3];L=m-n;o=+h[G+8>>3];p=+h[G+56>>3];s=o-p;q=s*s;if(q+L*L<1.0e-06){c[t>>2]=c[G>>2];c[t+4>>2]=c[G+4>>2];c[t+8>>2]=c[G+8>>2];c[t+12>>2]=c[G+12>>2];c[r>>2]=c[F>>2];c[r+4>>2]=c[F+4>>2];c[r+8>>2]=c[F+8>>2];c[r+12>>2]=c[F+12>>2];y=G+24|0;x=G+40|0;n=0.0;m=0.0;}else {M=n-m;L=+C(+(q+M*M));w=c[(c[(c[b+60>>2]|0)+16>>2]|0)+248>>2]|0;N=+((O(w,e+-1|0)|0)/2|0|0);q=s*N/L;h[t>>3]=q+m;m=M*N/L;y=G+24|0;h[y>>3]=m+o;h[r>>3]=q+n;x=G+40|0;h[x>>3]=p+m;m=+(0-w|0);n=M*m/L;m=s*m/L;}f=(f|0)==6;u=D+4|0;v=B+4|0;j=0;while(1){if((j|0)>=(e|0))break a;w=c[d+(j<<2)>>2]|0;k=w+-48|0;b:do if((c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0)==(E|0)){c[I>>2]=c[G>>2];c[I+4>>2]=c[G+4>>2];c[I+8>>2]=c[G+8>>2];c[I+12>>2]=c[G+12>>2];c[J>>2]=c[F>>2];c[J+4>>2]=c[F+4>>2];c[J+8>>2]=c[F+8>>2];c[J+12>>2]=c[F+12>>2];i=0;while(1){if((i|0)==4)break b;P=H+(i<<4)|0;Q=G+(i<<4)|0;c[P>>2]=c[Q>>2];c[P+4>>2]=c[Q+4>>2];c[P+8>>2]=c[Q+8>>2];c[P+12>>2]=c[Q+12>>2];i=i+1|0;}}else {c[I>>2]=c[F>>2];c[I+4>>2]=c[F+4>>2];c[I+8>>2]=c[F+8>>2];c[I+12>>2]=c[F+12>>2];c[J>>2]=c[G>>2];c[J+4>>2]=c[G+4>>2];c[J+8>>2]=c[G+8>>2];c[J+12>>2]=c[G+12>>2];i=0;while(1){if((i|0)==4)break b;Q=H+(3-i<<4)|0;P=G+(i<<4)|0;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];i=i+1|0;}}while(0);if(f){c[u>>2]=4;c[D>>2]=z;i=0;while(1){if((i|0)==4)break;Q=z+(i<<4)|0;P=H+(i<<4)|0;c[Q>>2]=c[P>>2];c[Q+4>>2]=c[P+4>>2];c[Q+8>>2]=c[P+8>>2];c[Q+12>>2]=c[P+12>>2];i=i+1|0;}c[A>>2]=c[D>>2];c[A+4>>2]=c[D+4>>2];FY(A,B);dO(w,c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0,c[B>>2]|0,c[v>>2]|0,g);}else dO(w,c[((c[w>>2]&3|0)==2?w:k)+40>>2]|0,H,4,g);c[z>>2]=c[I>>2];c[z+4>>2]=c[I+4>>2];c[z+8>>2]=c[I+8>>2];c[z+12>>2]=c[I+12>>2];c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];yO(b,w,z,A);h[t>>3]=+h[t>>3]+m;h[y>>3]=+h[y>>3]+n;h[r>>3]=+h[r>>3]+m;h[x>>3]=+h[x>>3]+n;j=j+1|0;}}else {if((f|0)==4){RM(i,b);c[A>>2]=c[i>>2];c[A+4>>2]=c[i+4>>2];c[A+8>>2]=c[i+8>>2];c[A+12>>2]=c[i+12>>2];SM(G,A);}dO(j,c[((c[j>>2]&3|0)==2?j:k)+40>>2]|0,G,4,g);c[z>>2]=c[I>>2];c[z+4>>2]=c[I+4>>2];c[z+8>>2]=c[I+8>>2];c[z+12>>2]=c[I+12>>2];c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];yO(b,j,z,A);}while(0);l=K;return}function QM(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function RM(a,b){a=a|0;b=b|0;b=c[b+16>>2]|0;h[23305]=(+h[b+32>>3]+ +h[b+16>>3])*.5;h[23306]=(+h[b+40>>3]+ +h[b+24>>3])*.5;c[a>>2]=c[46610];c[a+4>>2]=c[46611];c[a+8>>2]=c[46612];c[a+12>>2]=c[46613];return}function SM(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0;f=+h[a>>3];d=+h[a+48>>3];i=(d+f)*.5;g=+h[a+8>>3];c=+h[a+56>>3];e=(c+g)*.5;f=d-f;g=c-g;f=+C(+(g*g+f*f))*.2;g=+h[b>>3]-i;c=+h[b+8>>3]-e;d=+C(+(c*c+g*g));if(!(d==0.0)){g=i-g/d*f;i=e-c/d*f;h[a+32>>3]=g;h[a+16>>3]=g;h[a+40>>3]=i;h[a+24>>3]=i;}return}function TM(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0.0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0.0,G=0,H=0.0,I=0.0,J=0.0;E=l;l=l+208|0;t=E+192|0;s=E+176|0;B=E+32|0;w=E+16|0;x=E;y=E+160|0;z=E+144|0;u=E+128|0;v=E+112|0;g=e&2130706432;A=(e&8|0)==0?((g|0)==0?4:g):8;if((A|0)==436207616)UM(a,b,d,f);else {D=JK((d<<6)+64|0)|0;p=d+-1|0;q=x+8|0;r=w+8|0;o=12.0;e=0;while(1){if((e|0)>=(d|0))break;n=b+(e<<4)|0;c[w>>2]=c[n>>2];c[w+4>>2]=c[n+4>>2];c[w+8>>2]=c[n+8>>2];c[w+12>>2]=c[n+12>>2];if((e|0)<(p|0)){e=e+1|0;n=b+(e<<4)|0;c[x>>2]=c[n>>2];c[x+4>>2]=c[n+4>>2];c[x+8>>2]=c[n+8>>2];c[x+12>>2]=c[n+12>>2];}else {c[x>>2]=c[b>>2];c[x+4>>2]=c[b+4>>2];c[x+8>>2]=c[b+8>>2];c[x+12>>2]=c[b+12>>2];e=e+1|0;}m=+h[x>>3]-+h[w>>3];F=+h[q>>3]-+h[r>>3];m=+C(+(F*F+m*m))*.3333333333333333;o=o=(d|0))break;g=b+(i<<4)|0;c[w>>2]=c[g>>2];c[w+4>>2]=c[g+4>>2];c[w+8>>2]=c[g+8>>2];c[w+12>>2]=c[g+12>>2];if((i|0)<(p|0)){g=b+(i+1<<4)|0;c[x>>2]=c[g>>2];c[x+4>>2]=c[g+4>>2];c[x+8>>2]=c[g+8>>2];c[x+12>>2]=c[g+12>>2];}else {c[x>>2]=c[b>>2];c[x+4>>2]=c[b+4>>2];c[x+8>>2]=c[b+8>>2];c[x+12>>2]=c[b+12>>2];}m=+h[x>>3]-+h[w>>3];F=+h[q>>3]-+h[r>>3];m=o/+C(+(F*F+m*m));m=k?m*.3333333333333333:j?m*.5:m;g=D+(e<<4)|0;if(n){c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(y,m*.5,s,t);c[g>>2]=c[y>>2];c[g+4>>2]=c[y+4>>2];c[g+8>>2]=c[y+8>>2];c[g+12>>2]=c[y+12>>2];}else {c[g>>2]=c[w>>2];c[g+4>>2]=c[w+4>>2];c[g+8>>2]=c[w+8>>2];c[g+12>>2]=c[w+12>>2];}g=D+(e+1<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(z,m,s,t);c[g>>2]=c[z>>2];c[g+4>>2]=c[z+4>>2];c[g+8>>2]=c[z+8>>2];c[g+12>>2]=c[z+12>>2];g=e+3|0;G=D+(e+2<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(u,1.0-m,s,t);c[G>>2]=c[u>>2];c[G+4>>2]=c[u+4>>2];c[G+8>>2]=c[u+8>>2];c[G+12>>2]=c[u+12>>2];if(n){G=D+(g<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];VM(v,1.0-m*.5,s,t);c[G>>2]=c[v>>2];c[G+4>>2]=c[v+4>>2];c[G+8>>2]=c[v+8>>2];c[G+12>>2]=c[v+12>>2];e=e+4|0;}else e=g;i=i+1|0;}k=D+(e<<4)|0;c[k>>2]=c[D>>2];c[k+4>>2]=c[D+4>>2];c[k+8>>2]=c[D+8>>2];c[k+12>>2]=c[D+12>>2];k=D+(e+1<<4)|0;j=D+16|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];e=D+(e+2<<4)|0;k=D+32|0;c[e>>2]=c[k>>2];c[e+4>>2]=c[k+4>>2];c[e+8>>2]=c[k+8>>2];c[e+12>>2]=c[k+12>>2];e=A&2147483647;a:do if((e|0)<201326592){if((e|0)>=83886080){if((e|0)<134217728){if((e|0)<100663296){switch(e|0){case 83886080:break;default:break a}if((d|0)==4){G=JK(192)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];p=G+16|0;t=b+16|0;c[p>>2]=c[t>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[p+12>>2]=c[t+12>>2];p=D+48|0;t=D+64|0;o=+h[t>>3];n=G+32|0;h[n>>3]=o;q=D+56|0;r=D+72|0;H=+h[r>>3];z=G+40|0;h[z>>3]=H;F=+h[p>>3]+o-+h[k>>3];u=G+48|0;h[u>>3]=F;J=+h[q>>3]+H-+h[D+40>>3];x=G+56|0;h[x>>3]=J;I=+h[t>>3]+F-+h[p>>3];p=G+64|0;h[p>>3]=I;m=+h[r>>3]+J-+h[q>>3];q=G+72|0;h[q>>3]=m;r=G+80|0;h[r>>3]=o+I-F;h[G+88>>3]=H+m-J;t=D+96|0;v=D+80|0;J=+h[v>>3];d=G+144|0;h[d>>3]=J;w=D+104|0;s=D+88|0;m=+h[s>>3];h[G+152>>3]=m;H=+h[t>>3]+J-+h[D+112>>3];y=G+128|0;h[y>>3]=H;F=+h[w>>3]+m-+h[D+120>>3];A=G+136|0;h[A>>3]=F;I=+h[v>>3]+H-+h[t>>3];t=G+112|0;h[t>>3]=I;o=+h[s>>3]+F-+h[w>>3];w=G+120|0;h[w>>3]=o;s=G+96|0;h[s>>3]=J+I-H;v=G+104|0;h[v>>3]=m+o-F;k=G+160|0;j=b+32|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];k=G+176|0;b=b+48|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];nS(a,G,12,f);c[B>>2]=c[n>>2];c[B+4>>2]=c[n+4>>2];c[B+8>>2]=c[n+8>>2];c[B+12>>2]=c[n+12>>2];F=+h[n>>3];o=+h[u>>3];F=F+F-o;u=B+16|0;h[u>>3]=F;m=+h[z>>3];H=+h[x>>3];m=m+m-H;x=B+24|0;h[x>>3]=m;z=B+32|0;h[z>>3]=+h[p>>3]+F-o;b=B+40|0;h[b>>3]=+h[q>>3]+m-H;f=B+48|0;c[f>>2]=c[r>>2];c[f+4>>2]=c[r+4>>2];c[f+8>>2]=c[r+8>>2];c[f+12>>2]=c[r+12>>2];qS(a,B,4);c[B>>2]=c[s>>2];c[B+4>>2]=c[s+4>>2];c[B+8>>2]=c[s+8>>2];c[B+12>>2]=c[s+12>>2];H=+h[s>>3];m=+h[t>>3];H=H-(m-H);h[u>>3]=H;o=+h[v>>3];F=+h[w>>3];o=o-(F-o);h[x>>3]=o;h[z>>3]=+h[y>>3]+H-m;h[b>>3]=+h[A>>3]+o-F;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];qS(a,B,4);U1(G);break}else qa(105438,105449,737,105458);}if((e|0)<117440512){switch(e|0){case 100663296:break;default:break a}y=d+5|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];H=(+h[b>>3]-H)*.625+H;h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;v=D+48|0;w=D+56|0;x=D+72|0;J=(+h[d>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*1.5;h[G+8>>3]=J;I=+h[z>>3];I=(+h[b>>3]-I)*.25+I;h[G+16>>3]=I;h[G+24>>3]=J;h[G+32>>3]=I;F=+h[A>>3];h[G+40>>3]=(+h[d>>3]-F)*.5+F;I=(+h[k>>3]-+h[v>>3])*.5+I;h[G+48>>3]=I;F=+h[A>>3];h[G+56>>3]=(+h[d>>3]-F)*.5+F;h[G+64>>3]=I;I=+h[A>>3];I=(+h[d>>3]-I)*.5+I+(+h[w>>3]-+h[x>>3]);h[G+72>>3]=I;h[G+80>>3]=H;h[G+88>>3]=I;h[G+96>>3]=H;I=I-(+h[w>>3]-+h[x>>3])*.25;h[G+104>>3]=I;h[G+112>>3]=+h[k>>3]+H-+h[v>>3];h[G+120>>3]=(+h[w>>3]-+h[x>>3])*.5+I;h[G+128>>3]=+h[G>>3];h[G+136>>3]=(+h[w>>3]-+h[x>>3])*.25+J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 117440512:break;default:break a}d=d+1|0;G=JK(d<<4)|0;h[G>>3]=+h[j>>3];z=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[z>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[D+48>>3];J=+h[z>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];B=b+40|0;h[G+40>>3]=(+h[z>>3]-+h[A>>3])*.5+ +h[B>>3];h[G+48>>3]=+h[j>>3];h[G+56>>3]=(+h[z>>3]-+h[A>>3])*.5+ +h[B>>3];J=+h[b+8>>3];h[G+72>>3]=J-(J-+h[b+56>>3])*.5;h[G+64>>3]=+h[b>>3];nS(a,G,d,f);U1(G);break}}if((e|0)<167772160)if((e|0)<150994944){switch(e|0){case 134217728:break;default:break a}y=d+4|0;G=JK(y<<4)|0;z=b+16|0;F=+h[z>>3];x=D+48|0;F=(+h[b>>3]-F)*.5+F+(+h[k>>3]-+h[x>>3])*.25;h[G>>3]=F;A=b+40|0;J=+h[A>>3];d=b+24|0;J=(+h[d>>3]-J)*.5+J;h[G+8>>3]=J;h[G+16>>3]=F;v=D+56|0;w=D+72|0;H=(+h[v>>3]-+h[w>>3])*.5+J;h[G+24>>3]=H;F=(+h[k>>3]-+h[x>>3])*.5+F;h[G+32>>3]=F;h[G+40>>3]=H;h[G+48>>3]=F;F=(+h[v>>3]-+h[w>>3])*.5+H;h[G+56>>3]=F;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.75;h[G+64>>3]=I;h[G+72>>3]=F;h[G+80>>3]=I;h[G+88>>3]=H;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.25;h[G+96>>3]=I;h[G+104>>3]=H;h[G+112>>3]=I;h[G+120>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 150994944:break;default:break a}y=d+2|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];x=D+48|0;H=(+h[b>>3]-H)*.5+H+(+h[k>>3]-+h[x>>3])*.75;h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;J=(+h[d>>3]-J)*.5+J;h[G+8>>3]=J;h[G+16>>3]=H;v=D+56|0;w=D+72|0;H=(+h[v>>3]-+h[w>>3])*.25+J;h[G+24>>3]=H;I=+h[z>>3];h[G+32>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*.25;I=(+h[v>>3]-+h[w>>3])*.5+H;h[G+40>>3]=I;F=+h[z>>3];h[G+48>>3]=(+h[b>>3]-F)*.5+F+(+h[k>>3]-+h[x>>3])*-.25;h[G+56>>3]=I;I=+h[z>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[x>>3])*-.75;h[G+64>>3]=I;h[G+72>>3]=H;h[G+80>>3]=I;h[G+88>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else if((e|0)<184549376){switch(e|0){case 167772160:break;default:break a}y=d+1|0;G=JK(y<<4)|0;z=b+16|0;H=+h[z>>3];v=D+48|0;H=+h[k>>3]+H+(+h[b>>3]-H)*.5-+h[v>>3];h[G>>3]=H;A=b+40|0;J=+h[A>>3];d=b+24|0;w=D+56|0;x=D+72|0;J=(+h[d>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*.25;h[G+8>>3]=J;H=H-+h[k>>3]+ +h[v>>3];h[G+16>>3]=H;h[G+24>>3]=+h[w>>3]+J-+h[x>>3];h[G+32>>3]=H;H=(+h[w>>3]-+h[x>>3])*.5+J;h[G+40>>3]=H;I=+h[z>>3];I=(+h[b>>3]-I)*.25+I;h[G+48>>3]=I;h[G+56>>3]=H;h[G+64>>3]=I;h[G+72>>3]=J;nS(a,G,y,f);h[B>>3]=+h[z>>3];J=+h[A>>3];h[B+8>>3]=(+h[d>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 184549376:break;default:break a}z=d+4|0;G=JK(z<<4)|0;y=b+16|0;H=+h[y>>3];I=+h[b>>3]-H;u=D+48|0;I=I*.125+H+(+h[k>>3]-+h[u>>3]+I)*.5;h[G>>3]=I;w=b+40|0;H=+h[w>>3];x=b+24|0;d=D+56|0;v=D+72|0;H=(+h[x>>3]-H)*.5+H+(+h[d>>3]-+h[v>>3])*.25;h[G+8>>3]=H;J=+h[y>>3];J=(+h[b>>3]-J)*.375+J;h[G+16>>3]=J;h[G+24>>3]=H;h[G+32>>3]=J;H=(+h[d>>3]-+h[v>>3])*.5+H;h[G+40>>3]=H;J=J-(+h[k>>3]-+h[u>>3])*.5;h[G+48>>3]=J;h[G+56>>3]=H;A=G+64|0;h[A>>3]=J;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[d>>3]-+h[v>>3])*-.25;h[G+72>>3]=J;H=I-(+h[k>>3]-+h[u>>3])*.5;h[G+80>>3]=H;h[G+88>>3]=J;h[G+96>>3]=H;J=J-(+h[d>>3]-+h[v>>3])*.5;h[G+104>>3]=J;v=G+112|0;h[v>>3]=I;h[G+120>>3]=J;nS(a,G,z,f);h[B>>3]=+h[y>>3];J=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-J)*.5+J;z=B+16|0;h[z>>3]=+h[A>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);h[B>>3]=+h[v>>3];J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=+h[b>>3];h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<33554432){if((e|0)<8){switch(e|0){case 4:break;default:break a}i=KK((d*96|0)+32|0)|0;e=0;g=0;while(1){j=g|1;k=i+(g<<4)|0;if((e|0)>=(d|0))break;b=e<<2;G=D+(b<<4)|0;c[k>>2]=c[G>>2];c[k+4>>2]=c[G+4>>2];c[k+8>>2]=c[G+8>>2];c[k+12>>2]=c[G+12>>2];G=i+(j<<4)|0;B=D+((b|1)<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+2<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+3<<4)|0;B=D+((b|2)<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+4<<4)|0;c[G>>2]=c[B>>2];c[G+4>>2]=c[B+4>>2];c[G+8>>2]=c[B+8>>2];c[G+12>>2]=c[B+12>>2];G=i+(g+5<<4)|0;b=D+((b|3)<<4)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];e=e+1|0;g=g+6|0;}c[k>>2]=c[i>>2];c[k+4>>2]=c[i+4>>2];c[k+8>>2]=c[i+8>>2];c[k+12>>2]=c[i+12>>2];d=i+(j<<4)|0;G=i+16|0;c[d>>2]=c[G>>2];c[d+4>>2]=c[G+4>>2];c[d+8>>2]=c[G+8>>2];c[d+12>>2]=c[G+12>>2];pS(a,G,j,0,0,f&255);U1(i);break}if((e|0)<16777216){switch(e|0){case 8:break;default:break a}nS(a,b,d,f);g=B+16|0;e=0;while(1){if((e|0)>=(d|0))break a;G=e*3|0;f=D+(G+2<<4)|0;c[B>>2]=c[f>>2];c[B+4>>2]=c[f+4>>2];c[B+8>>2]=c[f+8>>2];c[B+12>>2]=c[f+12>>2];G=D+(G+4<<4)|0;c[g>>2]=c[G>>2];c[g+4>>2]=c[G+4>>2];c[g+8>>2]=c[G+8>>2];c[g+12>>2]=c[G+12>>2];qS(a,B,2);e=e+1|0;}}switch(e|0){case 16777216:break;default:break a}g=d+1|0;i=JK(g<<4)|0;e=1;while(1){if((e|0)>=(d|0))break;G=i+(e<<4)|0;A=b+(e<<4)|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];e=e+1|0;}b=d*3|0;A=D+(b+1<<4)|0;c[i>>2]=c[A>>2];c[i+4>>2]=c[A+4>>2];c[i+8>>2]=c[A+8>>2];c[i+12>>2]=c[A+12>>2];d=i+(d<<4)|0;G=D+(b+-1<<4)|0;c[d>>2]=c[G>>2];c[d+4>>2]=c[G+4>>2];c[d+8>>2]=c[G+8>>2];c[d+12>>2]=c[G+12>>2];nS(a,i,g,f);U1(i);c[B>>2]=c[G>>2];c[B+4>>2]=c[G+4>>2];c[B+8>>2]=c[G+8>>2];c[B+12>>2]=c[G+12>>2];G=B+16|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];f=B+32|0;h[f>>3]=+h[B>>3]+ +h[G>>3]-+h[D+(b<<4)>>3];h[B+40>>3]=+h[B+8>>3]+ +h[B+24>>3]-+h[D+(b<<4)+8>>3];qS(a,G,2);c[G>>2]=c[f>>2];c[G+4>>2]=c[f+4>>2];c[G+8>>2]=c[f+8>>2];c[G+12>>2]=c[f+12>>2];qS(a,B,2);break}else {if((e|0)<50331648){switch(e|0){case 33554432:break;default:break a}g=d+2|0;i=JK(g<<4)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];j=i+16|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];j=D+48|0;d=D+64|0;h[i+32>>3]=(+h[j>>3]-+h[d>>3])*.3333333333333333+ +h[k>>3];G=D+56|0;e=D+72|0;h[i+40>>3]=(+h[G>>3]-+h[e>>3])*.3333333333333333+ +h[D+40>>3];J=+h[j>>3];h[i+48>>3]=(J-+h[d>>3])*.3333333333333333+J;J=+h[G>>3];h[i+56>>3]=(J-+h[e>>3])*.3333333333333333+J;e=4;while(1){if((e|0)>=(g|0))break;G=i+(e<<4)|0;d=b+(e+-2<<4)|0;c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];e=e+1|0;}nS(a,i,g,f);U1(i);c[B>>2]=c[j>>2];c[B+4>>2]=c[j+4>>2];c[B+8>>2]=c[j+8>>2];c[B+12>>2]=c[j+12>>2];G=B+16|0;c[G>>2]=c[k>>2];c[G+4>>2]=c[k+4>>2];c[G+8>>2]=c[k+8>>2];c[G+12>>2]=c[k+12>>2];qS(a,B,2);break}if((e|0)>=67108864){switch(e|0){case 67108864:break;default:break a}if((d|0)==4){G=JK(96)|0;c[G>>2]=c[b>>2];c[G+4>>2]=c[b+4>>2];c[G+8>>2]=c[b+8>>2];c[G+12>>2]=c[b+12>>2];d=G+16|0;c[d>>2]=c[k>>2];c[d+4>>2]=c[k+4>>2];c[d+8>>2]=c[k+8>>2];c[d+12>>2]=c[k+12>>2];d=G+32|0;A=D+64|0;c[d>>2]=c[A>>2];c[d+4>>2]=c[A+4>>2];c[d+8>>2]=c[A+8>>2];c[d+12>>2]=c[A+12>>2];d=G+48|0;b=b+32|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];b=G+64|0;d=D+128|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=G+80|0;z=D+160|0;c[b>>2]=c[z>>2];c[b+4>>2]=c[z+4>>2];c[b+8>>2]=c[z+8>>2];c[b+12>>2]=c[z+12>>2];nS(a,G,6,f);U1(G);h[B>>3]=+h[D+176>>3]+ +h[j>>3]-+h[D>>3];h[B+8>>3]=+h[D+184>>3]+ +h[D+24>>3]-+h[D+8>>3];G=B+16|0;c[G>>2]=c[A>>2];c[G+4>>2]=c[A+4>>2];c[G+8>>2]=c[A+8>>2];c[G+12>>2]=c[A+12>>2];qS(a,B,2);c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];qS(a,B,2);c[G>>2]=c[D>>2];c[G+4>>2]=c[D+4>>2];c[G+8>>2]=c[D+8>>2];c[G+12>>2]=c[D+12>>2];qS(a,B,2);break}else qa(105438,105449,714,105458);}switch(e|0){case 50331648:break;default:break a}g=d+3|0;i=JK(g<<4)|0;c[i>>2]=c[b>>2];c[i+4>>2]=c[b+4>>2];c[i+8>>2]=c[b+8>>2];c[i+12>>2]=c[b+12>>2];J=+h[b>>3];h[i+16>>3]=J-(J-+h[j>>3])*.25;e=D+56|0;J=(+h[e>>3]-+h[D+72>>3])*.3333333333333333+ +h[b+8>>3];h[i+24>>3]=J;I=+h[b>>3];h[i+32>>3]=I-(I-+h[j>>3])*2.0;h[i+40>>3]=J;J=+h[b>>3];h[i+48>>3]=J-(J-+h[j>>3])*2.25;h[i+56>>3]=+h[e>>3];h[i+64>>3]=+h[D+48>>3];h[i+72>>3]=+h[e>>3];e=4;while(1){if((e|0)>=(g|0))break;G=i+(e<<4)|0;d=b+(e+-3<<4)|0;c[G>>2]=c[d>>2];c[G+4>>2]=c[d+4>>2];c[G+8>>2]=c[d+8>>2];c[G+12>>2]=c[d+12>>2];e=e+1|0;}nS(a,i,g,f);U1(i);break}}else if((e|0)<318767104){if((e|0)<251658240){if((e|0)<218103808){switch(e|0){case 201326592:break;default:break a}G=d<<4;u=JK(G)|0;v=b+16|0;J=+h[v>>3];h[u>>3]=J;z=b+40|0;I=+h[z>>3];A=b+24|0;y=D+48|0;w=D+56|0;x=D+72|0;I=(+h[A>>3]-I)*.5+I+(+h[w>>3]-+h[x>>3])*.125;h[u+8>>3]=I;H=(+h[k>>3]-+h[y>>3])*2.0+J;h[u+16>>3]=H;h[u+24>>3]=I;h[u+32>>3]=H;I=(+h[w>>3]-+h[x>>3])*.5+I;h[u+40>>3]=I;h[u+48>>3]=J;h[u+56>>3]=I;nS(a,u,d,f);U1(u);G=JK(G)|0;I=+h[k>>3]+ +h[v>>3]-+h[y>>3];h[G>>3]=I;J=+h[z>>3];J=(+h[A>>3]-J)*.5+J+(+h[w>>3]-+h[x>>3])*-.625;h[G+8>>3]=J;H=+h[k>>3]-+h[y>>3]+I;y=G+16|0;h[y>>3]=H;h[G+24>>3]=J;h[G+32>>3]=H;J=(+h[w>>3]-+h[x>>3])*.5+J;h[G+40>>3]=J;h[G+48>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[y>>3];J=+h[z>>3];h[B+8>>3]=(+h[A>>3]-J)*.5+J;h[B+16>>3]=+h[b>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}if((e|0)<234881024){switch(e|0){case 218103808:break;default:break a}G=d<<4;w=JK(G)|0;J=+h[b>>3];h[w>>3]=J;y=b+40|0;I=+h[y>>3];z=b+24|0;x=D+56|0;A=D+72|0;I=(+h[z>>3]-I)*.5+I+(+h[x>>3]-+h[A>>3])*.125;h[w+8>>3]=I;h[w+16>>3]=J;H=(+h[x>>3]-+h[A>>3])*.5+I;h[w+24>>3]=H;J=J-(+h[x>>3]-+h[A>>3])*2.0;h[w+32>>3]=J;h[w+40>>3]=H;h[w+48>>3]=J;h[w+56>>3]=I;nS(a,w,d,f);U1(w);G=JK(G)|0;I=+h[b>>3]-+h[k>>3]+ +h[D+48>>3];h[G>>3]=I;J=+h[y>>3];J=(+h[z>>3]-J)*.5+J+(+h[x>>3]-+h[A>>3])*-.625;h[G+8>>3]=J;h[G+16>>3]=I;H=(+h[x>>3]-+h[A>>3])*.5+J;h[G+24>>3]=H;I=I-(+h[x>>3]-+h[A>>3]);h[G+32>>3]=I;h[G+40>>3]=H;A=G+48|0;h[A>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[b+16>>3];J=+h[y>>3];h[B+8>>3]=(+h[z>>3]-J)*.5+J;h[B+16>>3]=+h[A>>3];h[B+24>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 234881024:break;default:break a}G=d<<4;y=JK(G)|0;u=b+16|0;I=+h[u>>3];v=D+48|0;I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*-1.125;h[y>>3]=I;w=b+40|0;J=+h[w>>3];x=b+24|0;A=D+56|0;z=D+72|0;J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*.125;h[y+8>>3]=J;H=+h[k>>3]-+h[v>>3]+I;h[y+16>>3]=H;h[y+24>>3]=J;h[y+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[y+40>>3]=J;h[y+48>>3]=I;h[y+56>>3]=J;nS(a,y,d,f);U1(y);y=JK(G)|0;J=+h[u>>3];J=(+h[b>>3]-J)*.5+J+(+h[k>>3]-+h[v>>3])*-1.125;h[y>>3]=J;I=+h[w>>3];I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*-.625;h[y+8>>3]=I;H=+h[k>>3]-+h[v>>3]+J;h[y+16>>3]=H;h[y+24>>3]=I;h[y+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[y+40>>3]=I;h[y+48>>3]=J;h[y+56>>3]=I;nS(a,y,d,f);U1(y);y=JK(G)|0;I=+h[u>>3];I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*.125;h[y>>3]=I;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*-.625;h[y+8>>3]=J;H=+h[k>>3]-+h[v>>3]+I;h[y+16>>3]=H;h[y+24>>3]=J;h[y+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[y+40>>3]=J;h[y+48>>3]=I;h[y+56>>3]=J;nS(a,y,d,f);U1(y);G=JK(G)|0;J=+h[u>>3];J=(+h[b>>3]-J)*.5+J+(+h[k>>3]-+h[v>>3])*.125;h[G>>3]=J;I=+h[w>>3];I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*.125;h[G+8>>3]=I;H=+h[k>>3]-+h[v>>3]+J;y=G+16|0;h[y>>3]=H;h[G+24>>3]=I;h[G+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[G+40>>3]=I;h[G+48>>3]=J;h[G+56>>3]=I;nS(a,G,d,f);h[B>>3]=+h[y>>3];I=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-I)*.5+I;z=B+16|0;h[z>>3]=+h[b>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+I;qS(a,B,2);I=+h[u>>3];h[B>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[v>>3])*-1.125;J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=I;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<285212672)if((e|0)<268435456){switch(e|0){case 251658240:break;default:break a}G=d<<4;u=JK(G)|0;v=b+16|0;J=+h[v>>3];y=D+48|0;J=J-+h[k>>3]+(+h[b>>3]-J)*.5+ +h[y>>3];h[u>>3]=J;w=b+40|0;I=+h[w>>3];x=b+24|0;A=D+56|0;z=D+72|0;I=(+h[x>>3]-I)*.5+I+(+h[A>>3]-+h[z>>3])*.125;h[u+8>>3]=I;H=(+h[k>>3]-+h[y>>3])*2.0+J;h[u+16>>3]=H;h[u+24>>3]=I;h[u+32>>3]=H;I=(+h[A>>3]-+h[z>>3])*.5+I;h[u+40>>3]=I;h[u+48>>3]=J;h[u+56>>3]=I;nS(a,u,d,f);U1(u);G=JK(G)|0;I=+h[v>>3];I=I-+h[k>>3]+(+h[b>>3]-I)*.5+ +h[y>>3];h[G>>3]=I;J=+h[w>>3];J=(+h[x>>3]-J)*.5+J+(+h[A>>3]-+h[z>>3])*-.625;h[G+8>>3]=J;H=(+h[k>>3]-+h[y>>3])*2.0+I;y=G+16|0;h[y>>3]=H;h[G+24>>3]=J;h[G+32>>3]=H;J=(+h[A>>3]-+h[z>>3])*.5+J;h[G+40>>3]=J;h[G+48>>3]=I;h[G+56>>3]=J;nS(a,G,d,f);h[B>>3]=+h[y>>3];J=+h[w>>3];y=B+8|0;h[y>>3]=(+h[x>>3]-J)*.5+J;z=B+16|0;h[z>>3]=+h[b>>3];A=b+8|0;d=b+56|0;f=B+24|0;h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);h[B>>3]=+h[v>>3];J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[z>>3]=+h[G>>3];h[f>>3]=(+h[A>>3]-+h[d>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 268435456:break;default:break a}G=JK(d<<4)|0;h[G>>3]=+h[b>>3];v=D+48|0;x=D+56|0;y=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[x>>3]-+h[y>>3])*.5;h[G+16>>3]=+h[v>>3];J=+h[x>>3];h[G+24>>3]=J-(J-+h[y>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=(+h[x>>3]-+h[y>>3])*.5+ +h[z>>3];h[G+48>>3]=+h[b>>3];h[G+56>>3]=(+h[x>>3]-+h[y>>3])*.5+ +h[z>>3];nS(a,G,d,f);w=b+16|0;J=(+h[k>>3]-+h[v>>3])*.25;I=J+ +h[w>>3];h[B>>3]=I;H=+h[z>>3];u=b+24|0;F=+h[x>>3]-+h[y>>3];H=(+h[u>>3]-H)*.5+H+F*.125;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J+I;f=B+24|0;h[f>>3]=H-F*.25;qS(a,B,2);F=(+h[k>>3]-+h[v>>3])*.25;H=F+ +h[w>>3];h[B>>3]=H;I=+h[z>>3];J=+h[x>>3]-+h[y>>3];I=(+h[u>>3]-I)*.5+I+J*-.125;h[A>>3]=I;h[d>>3]=F+H;h[f>>3]=J*.25+I;qS(a,B,2);I=(+h[k>>3]-+h[v>>3])*.25;h[B>>3]=I+ +h[w>>3];J=(+h[x>>3]-+h[y>>3])*.75+ +h[z>>3];h[A>>3]=J;h[d>>3]=+h[b>>3]-I;h[f>>3]=J;qS(a,B,2);U1(G);break}else if((e|0)<301989888){switch(e|0){case 285212672:break;default:break a}y=JK(d<<4)|0;v=b+16|0;I=+h[v>>3];z=D+48|0;I=(+h[k>>3]-+h[z>>3]+(+h[b>>3]-I))*.5+I;h[y>>3]=I;w=b+40|0;F=+h[w>>3];x=b+24|0;F=(+h[k>>3]-+h[z>>3]+(+h[x>>3]-F))*.5+F;h[y+8>>3]=F;h[y+16>>3]=I;I=+h[w>>3];o=+h[k>>3]-+h[z>>3];I=(+h[x>>3]-I-o)*.5+I;h[y+24>>3]=I;J=+h[v>>3];J=(+h[b>>3]-J-o)*.5+J;h[y+32>>3]=J;h[y+40>>3]=I;h[y+48>>3]=J;h[y+56>>3]=F;nS(a,y,d,f);U1(y);F=+h[v>>3];F=(+h[b>>3]-F)*.5+F;J=+h[k>>3]-+h[z>>3];I=J*.75;o=F+I;h[B>>3]=o;H=+h[w>>3];H=(+h[x>>3]-H)*.5+H;I=H+I;y=B+8|0;h[y>>3]=I;A=B+16|0;h[A>>3]=o;J=J*-.75;H=H+J;G=B+24|0;h[G>>3]=H;J=F+J;h[B+32>>3]=J;h[B+40>>3]=H;h[B+48>>3]=J;h[B+56>>3]=I;d=B+64|0;c[d>>2]=c[B>>2];c[d+4>>2]=c[B+4>>2];c[d+8>>2]=c[B+8>>2];c[d+12>>2]=c[B+12>>2];qS(a,B,5);I=+h[v>>3];J=+h[b>>3];h[B>>3]=(J-I)*.5+I+(+h[k>>3]-+h[z>>3])*.75;I=+h[w>>3];h[y>>3]=(+h[x>>3]-I)*.5+I;h[A>>3]=J;d=b+8|0;f=b+56|0;h[G>>3]=(+h[d>>3]-+h[f>>3])*.5+I;qS(a,B,2);I=+h[v>>3];h[B>>3]=I;J=+h[w>>3];h[y>>3]=(+h[x>>3]-J)*.5+J;h[A>>3]=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[z>>3])*-.75;h[G>>3]=(+h[d>>3]-+h[f>>3])*.5+J;qS(a,B,2);break}else {switch(e|0){case 301989888:break;default:break a}A=d+12|0;G=JK(A<<4)|0;x=b+16|0;m=+h[x>>3];s=D+48|0;m=(+h[b>>3]-m)*.5+m+(+h[k>>3]-+h[s>>3])*.25;h[G>>3]=m;y=b+40|0;F=+h[y>>3];z=b+24|0;v=D+56|0;w=D+72|0;F=(+h[v>>3]-+h[w>>3]+(+h[z>>3]-F))*.5+F;u=G+8|0;h[u>>3]=F;h[G+16>>3]=m;F=(+h[v>>3]-+h[w>>3])*.125+F;t=G+24|0;h[t>>3]=F;H=m-(+h[k>>3]-+h[s>>3])*.125;d=G+32|0;h[d>>3]=H;o=(+h[v>>3]-+h[w>>3])*.125+F;h[G+40>>3]=o;h[G+48>>3]=m;I=(+h[v>>3]-+h[w>>3])*.125+o;h[G+56>>3]=I;h[G+64>>3]=m;m=(+h[v>>3]-+h[w>>3])*.125+I;h[G+72>>3]=m;h[G+80>>3]=H;h[G+88>>3]=m;H=+h[x>>3];H=(+h[b>>3]-H)*.5+H;h[G+96>>3]=H;h[G+104>>3]=I;J=H-(+h[k>>3]-+h[s>>3])*.125;h[G+112>>3]=J;h[G+120>>3]=m;J=J-(+h[k>>3]-+h[s>>3])*.125;h[G+128>>3]=J;h[G+136>>3]=m;h[G+144>>3]=J;h[G+152>>3]=I;I=(+h[k>>3]-+h[s>>3])*.125+J;h[G+160>>3]=I;h[G+168>>3]=o;h[G+176>>3]=J;h[G+184>>3]=F;h[G+192>>3]=J;J=+h[u>>3];h[G+200>>3]=J;h[G+208>>3]=I;h[G+216>>3]=J;u=G+224|0;h[u>>3]=H;h[G+232>>3]=+h[t>>3];h[G+240>>3]=+h[d>>3];h[G+248>>3]=J;nS(a,G,A,f);J=+h[u>>3];h[B>>3]=J;H=+h[y>>3];H=(+h[z>>3]-H)*.5+H;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J;f=B+24|0;h[f>>3]=(+h[v>>3]-+h[w>>3])*.125+H;qS(a,B,2);H=+h[u>>3];h[B>>3]=H;J=+h[y>>3];I=+h[v>>3]-+h[w>>3];J=(+h[z>>3]-J)*.5+J+I*.25;h[A>>3]=J;h[d>>3]=H;h[f>>3]=I*.125+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}}else {if((e|0)<369098752){if((e|0)<335544320){switch(e|0){case 318767104:break;default:break a}A=d+4|0;G=JK(A<<4)|0;x=b+16|0;H=+h[x>>3];d=D+48|0;H=(+h[b>>3]-H)*.5+H+(+h[k>>3]-+h[d>>3])*.125;h[G>>3]=H;y=b+40|0;J=+h[y>>3];z=b+24|0;v=D+56|0;w=D+72|0;J=(+h[v>>3]-+h[w>>3]+(+h[z>>3]-J))*.5+J;h[G+8>>3]=J;o=(+h[k>>3]-+h[d>>3])*.125+H;h[G+16>>3]=o;I=(+h[v>>3]-+h[w>>3])*.125+J;h[G+24>>3]=I;h[G+32>>3]=o;o=(+h[v>>3]-+h[w>>3])*.25+I;h[G+40>>3]=o;h[G+48>>3]=H;F=(+h[v>>3]-+h[w>>3])*.125+o;h[G+56>>3]=F;H=H-(+h[k>>3]-+h[d>>3])*.25;h[G+64>>3]=H;h[G+72>>3]=F;F=H-(+h[k>>3]-+h[d>>3])*.125;h[G+80>>3]=F;h[G+88>>3]=o;h[G+96>>3]=F;h[G+104>>3]=I;h[G+112>>3]=H;h[G+120>>3]=J;nS(a,G,A,f);J=+h[x>>3];J=(+h[b>>3]-J)*.5+J;h[B>>3]=J;H=+h[y>>3];H=(+h[z>>3]-H)*.5+H;A=B+8|0;h[A>>3]=H;d=B+16|0;h[d>>3]=J;f=B+24|0;h[f>>3]=(+h[v>>3]-+h[w>>3])*.125+H;qS(a,B,2);H=+h[x>>3];H=(+h[b>>3]-H)*.5+H;h[B>>3]=H;J=+h[y>>3];I=+h[v>>3]-+h[w>>3];J=(+h[z>>3]-J)*.5+J+I*.25;h[A>>3]=J;h[d>>3]=H;h[f>>3]=I*.125+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}if((e|0)<352321536){switch(e|0){case 335544320:break;default:break a}x=d+12|0;G=JK(x<<4)|0;y=b+16|0;m=+h[y>>3];u=D+48|0;m=(+h[b>>3]-m)*.5+m+(+h[k>>3]-+h[u>>3])*.25;h[G>>3]=m;z=b+40|0;F=+h[z>>3];A=b+24|0;s=D+56|0;t=D+72|0;F=(+h[s>>3]-+h[t>>3]+(+h[A>>3]-F))*.5+F;d=G+8|0;h[d>>3]=F;h[G+16>>3]=m;F=(+h[s>>3]-+h[t>>3])*.125+F;v=G+24|0;h[v>>3]=F;I=m-(+h[k>>3]-+h[u>>3])*.125;w=G+32|0;h[w>>3]=I;o=(+h[s>>3]-+h[t>>3])*.125+F;h[G+40>>3]=o;h[G+48>>3]=m;H=(+h[s>>3]-+h[t>>3])*.125+o;h[G+56>>3]=H;h[G+64>>3]=m;m=(+h[s>>3]-+h[t>>3])*.125+H;h[G+72>>3]=m;h[G+80>>3]=I;h[G+88>>3]=m;I=+h[y>>3];I=(+h[b>>3]-I)*.5+I;h[G+96>>3]=I;h[G+104>>3]=H;J=I-(+h[k>>3]-+h[u>>3])*.125;h[G+112>>3]=J;h[G+120>>3]=m;J=J-(+h[k>>3]-+h[u>>3])*.125;h[G+128>>3]=J;h[G+136>>3]=m;h[G+144>>3]=J;h[G+152>>3]=H;H=(+h[k>>3]-+h[u>>3])*.125+J;h[G+160>>3]=H;h[G+168>>3]=o;h[G+176>>3]=J;h[G+184>>3]=F;h[G+192>>3]=J;J=+h[d>>3];h[G+200>>3]=J;h[G+208>>3]=H;h[G+216>>3]=J;d=G+224|0;h[d>>3]=I;h[G+232>>3]=+h[v>>3];h[G+240>>3]=+h[w>>3];h[G+248>>3]=J;nS(a,G,x,f);c[B>>2]=c[d>>2];c[B+4>>2]=c[d+4>>2];c[B+8>>2]=c[d+8>>2];c[B+12>>2]=c[d+12>>2];d=B+16|0;h[d>>3]=+h[B>>3];J=+h[z>>3];f=B+24|0;h[f>>3]=(+h[A>>3]-J)*.5+J;qS(a,B,2);h[B>>3]=+h[y>>3];J=+h[z>>3];h[B+8>>3]=(+h[A>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}else {switch(e|0){case 352321536:break;default:break a}A=d+4|0;G=JK(A<<4)|0;x=b+16|0;I=+h[x>>3];w=D+48|0;I=(+h[b>>3]-I)*.5+I+(+h[k>>3]-+h[w>>3])*.125;h[G>>3]=I;y=b+40|0;J=+h[y>>3];z=b+24|0;u=D+56|0;v=D+72|0;J=(+h[u>>3]-+h[v>>3]+(+h[z>>3]-J))*.5+J;d=G+8|0;h[d>>3]=J;o=(+h[k>>3]-+h[w>>3])*.125+I;h[G+16>>3]=o;H=(+h[u>>3]-+h[v>>3])*.125+J;h[G+24>>3]=H;h[G+32>>3]=o;o=(+h[u>>3]-+h[v>>3])*.25+H;h[G+40>>3]=o;h[G+48>>3]=I;F=(+h[u>>3]-+h[v>>3])*.125+o;h[G+56>>3]=F;I=I-(+h[k>>3]-+h[w>>3])*.25;h[G+64>>3]=I;h[G+72>>3]=F;F=I-(+h[k>>3]-+h[w>>3])*.125;h[G+80>>3]=F;h[G+88>>3]=o;h[G+96>>3]=F;h[G+104>>3]=H;h[G+112>>3]=I;h[G+120>>3]=J;nS(a,G,A,f);J=+h[x>>3];J=(+h[b>>3]-J)*.5+J;h[B>>3]=J;A=B+8|0;h[A>>3]=+h[d>>3];d=B+16|0;h[d>>3]=J;J=+h[y>>3];f=B+24|0;h[f>>3]=(+h[z>>3]-J)*.5+J;qS(a,B,2);h[B>>3]=+h[x>>3];J=+h[y>>3];h[A>>3]=(+h[z>>3]-J)*.5+J;h[d>>3]=+h[b>>3];h[f>>3]=(+h[b+8>>3]-+h[b+56>>3])*.5+J;qS(a,B,2);U1(G);break}}if((e|0)<402653184)if((e|0)<385875968){switch(e|0){case 369098752:break;default:break a}d=d+5|0;G=JK(d<<4)|0;B=D+48|0;h[G>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;y=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[y>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[B>>3];J=+h[y>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=+h[z>>3];J=+h[k>>3];h[G+48>>3]=(J-+h[B>>3])*.5+J;h[G+56>>3]=+h[z>>3];J=+h[k>>3];h[G+64>>3]=(J-+h[B>>3])*.5+J;h[G+72>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+80>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;h[G+88>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;z=b+56|0;h[G+104>>3]=+h[z>>3];A=b+8|0;J=+h[A>>3];h[G+120>>3]=J-(J-+h[z>>3])*.5;h[G+112>>3]=+h[b>>3];h[G+136>>3]=+h[A>>3];h[G+128>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;nS(a,G,d,f);U1(G);break}else {switch(e|0){case 385875968:break;default:break a}d=d+3|0;G=JK(d<<4)|0;B=D+48|0;h[G>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;y=D+56|0;A=D+72|0;h[G+8>>3]=+h[D+24>>3]-(+h[y>>3]-+h[A>>3])*.5;h[G+16>>3]=+h[B>>3];J=+h[y>>3];h[G+24>>3]=J-(J-+h[A>>3])*.5;h[G+32>>3]=+h[b+32>>3];z=b+40|0;h[G+40>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+48>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;h[G+56>>3]=(+h[y>>3]-+h[A>>3])*.5+ +h[z>>3];h[G+64>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;z=b+56|0;h[G+72>>3]=+h[z>>3];A=b+8|0;J=+h[A>>3];h[G+88>>3]=J-(J-+h[z>>3])*.5;h[G+80>>3]=+h[b>>3];h[G+104>>3]=+h[A>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[B>>3])*.5;nS(a,G,d,f);U1(G);break}else if((e|0)<419430400){switch(e|0){case 402653184:break;default:break a}d=d+3|0;G=JK(d<<4)|0;h[G>>3]=+h[b>>3];y=b+8|0;z=D+48|0;A=D+56|0;B=D+72|0;h[G+8>>3]=+h[y>>3]-(+h[A>>3]-+h[B>>3])*.5;J=+h[k>>3];h[G+16>>3]=(J-+h[z>>3])*.5+J;h[G+24>>3]=+h[y>>3]-(+h[A>>3]-+h[B>>3])*.5;J=+h[k>>3];h[G+32>>3]=(J-+h[z>>3])*.5+J;h[G+40>>3]=+h[D+40>>3];h[G+48>>3]=+h[b+16>>3];J=+h[b+24>>3];y=b+40|0;h[G+56>>3]=J-(J-+h[y>>3])*.5;J=+h[k>>3];h[G+64>>3]=(J-+h[z>>3])*.5+J;h[G+72>>3]=+h[y>>3];h[G+88>>3]=(+h[A>>3]-+h[B>>3])*.5+ +h[y>>3];J=+h[k>>3];h[G+80>>3]=(J-+h[z>>3])*.5+J;h[G+104>>3]=(+h[A>>3]-+h[B>>3])*.5+ +h[b+56>>3];h[G+96>>3]=+h[b>>3];nS(a,G,d,f);U1(G);break}else {switch(e|0){case 419430400:break;default:break a}d=d+5|0;G=JK(d<<4)|0;h[G>>3]=+h[b>>3];B=b+8|0;A=D+48|0;y=D+56|0;z=D+72|0;h[G+8>>3]=+h[B>>3]-(+h[y>>3]-+h[z>>3])*.5;J=+h[k>>3];h[G+16>>3]=(J-+h[A>>3])*.5+J;h[G+24>>3]=+h[B>>3]-(+h[y>>3]-+h[z>>3])*.5;J=+h[k>>3];h[G+32>>3]=(J-+h[A>>3])*.5+J;h[G+40>>3]=+h[D+40>>3];h[G+48>>3]=+h[b+16>>3];J=+h[b+24>>3];B=b+40|0;h[G+56>>3]=J-(J-+h[B>>3])*.5;J=+h[k>>3];h[G+64>>3]=(J-+h[A>>3])*.5+J;h[G+72>>3]=+h[B>>3];h[G+88>>3]=(+h[y>>3]-+h[z>>3])*.5+ +h[B>>3];J=+h[k>>3];h[G+80>>3]=(J-+h[A>>3])*.5+J;B=b+56|0;h[G+104>>3]=(+h[y>>3]-+h[z>>3])*.5+ +h[B>>3];h[G+96>>3]=+h[j>>3]-(+h[k>>3]-+h[A>>3])*.5;h[G+112>>3]=+h[j>>3]-(+h[k>>3]-+h[A>>3])*.5;h[G+120>>3]=+h[B>>3];h[G+128>>3]=+h[b+48>>3];h[G+136>>3]=+h[B>>3];nS(a,G,d,f);U1(G);break}}while(0);U1(D);}l=E;return}function UM(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0;f=l;l=l+112|0;g=f;k=+h[b+8>>3]*2.0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];h[g+16>>3]=+h[b+16>>3];h[g+24>>3]=k-+h[b+24>>3];h[g+32>>3]=+h[b+32>>3];h[g+40>>3]=k-+h[b+40>>3];h[g+48>>3]=+h[b+48>>3];h[g+56>>3]=k-+h[b+56>>3];h[g+64>>3]=+h[b+64>>3];h[g+72>>3]=k-+h[b+72>>3];h[g+80>>3]=+h[b+80>>3];h[g+88>>3]=k-+h[b+88>>3];i=g+96|0;j=b+96|0;c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];pS(a,b,d,0,0,e&255);pS(a,g,7,0,0,0);l=f;return}function VM(a,b,c,d){a=a|0;b=+b;c=c|0;d=d|0;var e=0.0,f=0.0;f=+h[c>>3];e=+h[c+8>>3];e=(+h[d+8>>3]-e)*b+e;h[a>>3]=(+h[d>>3]-f)*b+f;h[a+8>>3]=e;return}function WM(a){a=a|0;a=c[(c[a+16>>2]|0)+8>>2]|0;if(a){a=c[c[a+4>>2]>>2]|0;if((a|0)!=91)if((a|0)==94)a=2;else return ((a|0)==93?3:(a|0)==96?4:0)|0;else a=1;}else a=0;return a|0}function XM(b){b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0,D=0,G=0,H=0,I=0,J=0,L=0,M=0,N=0,P=0.0,Q=0.0,R=0,S=0,T=0.0,U=0.0,V=0.0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0.0;aa=l;l=l+144|0;J=aa+112|0;N=aa+104|0;G=aa+96|0;H=aa+88|0;i=aa+80|0;Y=aa+64|0;_=aa+48|0;R=aa+40|0;S=aa+32|0;j=aa+24|0;p=aa+16|0;D=aa+136|0;A=aa+128|0;L=aa;$=JK(48)|0;Z=b+16|0;W=c[(c[(c[Z>>2]|0)+8>>2]|0)+8>>2]|0;g=(W|0)==1616;X=c[W>>2]|0;d=c[W+4>>2]|0;e=c[W+8>>2]|0;m=+h[W+16>>3];n=+h[W+32>>3];o=+h[W+24>>3];X=X|(dP(QA(b,105511)|0)|0)&255;do if(!g){if(!X){W=c[Z>>2]|0;k=+h[W+32>>3]*72.0;f=+h[W+40>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);k=+(~~(k+(k>=0.0?.5:-.5))|0);break}k=+fN(b);if(k>0.0)f=k;else {W=c[Z>>2]|0;f=+h[W+32>>3];k=+h[W+40>>3];k=(f=0.0?.5:-.5))|0);f=k;}}else {f=0.0;k=0.0;}while(0);W=ZO(b,c[47160]|0,d,0)|0;V=+_O(b,c[47162]|0,0.0,-360.0)+m;if(!e){U=+_O(b,c[47163]|0,0.0,-100.0);I=ZO(b,c[47159]|0,4,0)|0;T=+_O(b,c[47164]|0,0.0,-100.0);}else {I=e;U=n;T=o;}d=c[(c[Z>>2]|0)+104>>2]|0;e=d+24|0;c[Y>>2]=c[e>>2];c[Y+4>>2]=c[e+4>>2];c[Y+8>>2]=c[e+8>>2];c[Y+12>>2]=c[e+12>>2];q=+h[Y>>3];if(q>0.0){if(!g)M=11;}else if(!(g|!(+h[Y+8>>3]>0.0)))M=11;if((M|0)==11){d=QA(b,105496)|0;do if(d){h[p>>3]=0.0;h[j>>3]=0.0;c[i>>2]=j;c[i+4>>2]=p;d=b5(d,105503,i)|0;m=+h[j>>3];if(m<0.0){h[j>>3]=0.0;m=0.0;}n=+h[p>>3];if(n<0.0){h[p>>3]=0.0;o=0.0;}else o=n;if((d|0)<=0){n=q+16.0;h[Y>>3]=n;m=8.0;break}m=m*72.0;m=+(~~(m+(m>=0.0?.5:-.5))<<1|0);n=q+m;h[Y>>3]=n;if((d|0)!=1){m=o*72.0;m=+(~~(m+(m>=0.0?.5:-.5))<<1|0);}}else {n=q+16.0;h[Y>>3]=n;m=8.0;}while(0);d=Y+8|0;h[d>>3]=+h[d>>3]+m;d=c[(c[Z>>2]|0)+104>>2]|0;q=n;}s=+h[d+24>>3];m=+h[c[(c[(xC(b)|0)+16>>2]|0)+8>>2]>>3];if(m>0.0){P=m*72.0;P=+(~~(P+(P>=0.0?.5:-.5))|0);Q=+gN(q,P);h[Y>>3]=Q;p=Y+8|0;h[p>>3]=+gN(+h[p>>3],P);}else Q=q;d=c[(c[Z>>2]|0)+8>>2]|0;do if(!(a[d+12>>0]|0)){e=QA(b,109025)|0;if((e|0)!=0?(a[e>>0]|0)!=0:0){RF(A,xC(b)|0,e);d=c[A>>2]|0;g=c[A+4>>2]|0;if((g&d|0)==-1){d=KB(b)|0;c[G>>2]=e;c[G+4>>2]=d;gA(0,105587,G)|0;e=0;d=0;break}else {a[(c[(xC(b)|0)+16>>2]|0)+114>>0]=1;e=d+2|0;d=g+2|0;break}}else {e=0;d=0;}}else {d=c[d>>2]|0;if((a[d>>0]|0)==99?(s2(d,105519)|0)==0:0){e=QA(b,105526)|0;RF(D,xC(b)|0,e);d=c[D>>2]|0;g=c[D+4>>2]|0;if((g&d|0)==-1){d=KB(b)|0;c[H>>2]=e|0?e:105536;c[H+4>>2]=d;gA(0,105542,H)|0;e=0;d=0;break}else {a[(c[(xC(b)|0)+16>>2]|0)+114>>0]=1;e=d+2|0;d=g+2|0;break}}else {e=0;d=0;}}while(0);P=+(e|0);h[_>>3]=Q>P?Q:P;P=+h[Y+8>>3];r=+(d|0);d=_+8|0;h[d>>3]=P>r?P:r;e=(I|0)<3&(T!=0.0|U!=0.0)?120:I;g=QA(b,105628)|0;if(!g)i=99;else {i=a[g>>0]|0;i=i<<24>>24==116?116:i<<24>>24==98?98:99;}g=c[Z>>2]|0;a[(c[g+104>>2]|0)+80>>0]=i;if((e|0)==4?(T==0.0?((~~(V+(V>=0.0?.5:-.5))|0)%90|0|0)==0:0)&U==0.0:0)p=1;else M=39;do if((M|0)==39){g=c[(c[(c[g+8>>2]|0)+8>>2]|0)+44>>2]|0;if(g|0){p=c[g>>2]|0;c[J>>2]=c[_>>2];c[J+4>>2]=c[_+4>>2];c[J+8>>2]=c[_+8>>2];c[J+12>>2]=c[_+12>>2];ub[p&63](L,J);c[_>>2]=c[L>>2];c[_+4>>2]=c[L+4>>2];c[_+8>>2]=c[L+8>>2];c[_+12>>2]=c[L+12>>2];p=0;break}m=+h[d>>3];n=m*1.4142135623730951;if(f>n&i<<24>>24==99){o=m/f;o=+C(+(1.0/(1.0-o*o)));o=+h[_>>3]*o;h[_>>3]=o;}else {o=+h[_>>3]*1.4142135623730951;h[_>>3]=o;h[d>>3]=n;m=n;}if((e|0)>2){z=+E(+(3.141592653589793/+(e|0)));h[_>>3]=o/z;h[d>>3]=m/z;p=0;}else p=0;}while(0);m=+h[d>>3];g=aP(b,c[47165]|0,137308)|0;if((a[g>>0]|0)==115?(s2(g,108230)|0)==0:0){h[_>>3]=k;h[d>>3]=f;N=$+40|0;c[N>>2]=c[N>>2]|2048;}else {if(!((dP(g)|0)<<24>>24)){z=+h[_>>3];k=k>z?k:z;h[_>>3]=k;z=+h[d>>3];f=f>z?f:z;}else {M=c[(c[Z>>2]|0)+104>>2]|0;if(!(!(k<+h[M+24>>3])?!(f<+h[M+32>>3]):0)){L=KB(b)|0;M=KB(xC(b)|0)|0;c[N>>2]=L;c[N+4>>2]=M;gA(0,105637,N)|0;}h[_>>3]=k;}h[d>>3]=f;}if(!X){z=f;y=k;}else {y=k>f?k:f;h[d>>3]=y;h[_>>3]=y;z=y;}do if(!((dP(aP(b,c[47156]|0,137308)|0)|0)<<24>>24)){if(p){f=+h[(Q>+h[_>>3]?Y:_)>>3];break}f=+h[d>>3];if(P>3]*+C(+(1.0-P*P/(f*f)));f=Q>f?Q:f;}else f=Q;}else f=Q;while(0);g=c[(c[Z>>2]|0)+104>>2]|0;h[g+40>>3]=s-q+f;A=$+40|0;if(!(c[A>>2]&2048)){x=+h[d>>3]-m;h[g+48>>3]=(P1;g=j?W:1;a:do if((e|0)<3){g=JK(g<<5)|0;k=+h[_>>3]*.5;f=+h[d>>3]*.5;h[g>>3]=-k;h[g+8>>3]=-f;h[g+16>>3]=k;h[g+24>>3]=f;if(j){e=1;i=2;while(1){if((e|0)==(W|0))break;y=k+4.0;z=f+4.0;h[g+(i<<4)>>3]=-y;h[g+(i<<4)+8>>3]=-z;S=i|1;h[g+(S<<4)>>3]=y;h[g+(S<<4)+8>>3]=z;e=e+1|0;i=i+2|0;k=y;f=z;}h[_>>3]=k*2.0;h[d>>3]=f*2.0;e=2;}else e=2;}else {g=JK(O(g<<4,e)|0)|0;i=c[(c[(c[(c[Z>>2]|0)+8>>2]|0)+8>>2]|0)+44>>2]|0;b:do if(!i){q=6.283185307179586/+(e|0);t=q*.5;r=+F(+t);s=+L2(+B(+U)+ +B(+T),1.0);t=T*1.4142135623730951/+E(+t);u=U*.5;N2((q+-3.141592653589793)*.5,R,S);v=V*.017453292519943295;k=0.0;f=0.0;m=0.0;i=0;n=+h[S>>3]*.5;o=+h[R>>3]*.5;while(1){if((i|0)>=(e|0))break b;m=m+q;N2(m,R,S);n=+h[S>>3]*r+n;o=+h[R>>3]*r+o;x=(o*t+s)*n+u*o;N2(+K(+o,+x)+v,R,S);x=+L2(x,o);w=+h[S>>3]*x*+h[_>>3];x=+h[R>>3]*x*+h[d>>3];ba=+B(+w);f=ba>f?ba:f;ba=+B(+x);k=ba>k?ba:k;h[g+(i<<4)>>3]=w;h[g+(i<<4)+8>>3]=x;if(p)break;else i=i+1|0;}ba=-w;h[g+16>>3]=ba;h[g+24>>3]=x;h[g+32>>3]=ba;ba=-x;h[g+40>>3]=ba;h[g+48>>3]=w;h[g+56>>3]=ba;}else {ub[c[i+4>>2]&63](g,_);k=+h[d>>3]*.5;f=+h[_>>3]*.5;}while(0);f=f*2.0;k=k*2.0;y=y>f?y:f;h[_>>3]=y;ba=z>k?z:k;h[d>>3]=ba;f=y/f;k=ba/k;i=0;while(1){if((i|0)>=(e|0))break;N=g+(i<<4)|0;b=g+(i<<4)+8|0;ba=+h[b>>3]*k;h[N>>3]=+h[N>>3]*f;h[b>>3]=ba;i=i+1|0;}if(j){j=e+-1|0;k=+h[g>>3];m=+h[g+8>>3];f=+K(+(m-+h[g+(j<<4)+8>>3]),+(k-+h[g+(j<<4)>>3]));j=0;c:while(1){if((j|0)>=(e|0))break;p=j+1|0;i=(p|0)%(e|0)|0;n=+h[g+(i<<4)>>3];o=+h[g+(i<<4)+8>>3];q=+K(+(o-m),+(n-k));z=(f+3.141592653589793-q)*.5;ba=4.0/+F(+z);N2(f-z,R,S);h[R>>3]=+h[R>>3]*ba;h[S>>3]=+h[S>>3]*ba;i=1;f=m;while(1){if((i|0)==(W|0)){f=q;j=p;k=n;m=o;continue c}z=+h[S>>3]+k;ba=+h[R>>3]+f;b=(O(i,e)|0)+j|0;h[g+(b<<4)>>3]=z;h[g+(b<<4)+8>>3]=ba;i=i+1|0;k=z;f=ba;}}j=O(e,W+-1|0)|0;i=0;while(1){if((i|0)>=(e|0))break a;S=i+j|0;z=+h[g+(S<<4)+8>>3];y=+B(+(+h[g+(S<<4)>>3]))*2.0;ba=+h[_>>3];h[_>>3]=y>ba?y:ba;z=+B(+z)*2.0;ba=+h[d>>3];h[d>>3]=z>ba?z:ba;i=i+1|0;}}}while(0);c[$>>2]=X;c[$+4>>2]=W;c[$+8>>2]=e;h[$+16>>3]=V;h[$+32>>3]=U;h[$+24>>3]=T;c[$+44>>2]=g;f=+h[_>>3];if(!(c[A>>2]&2048)){e=c[Z>>2]|0;h[e+32>>3]=f*.013888888888888888;}else {e=c[Z>>2]|0;h[e+32>>3]=+h[(Q>f?Y:_)>>3]*.013888888888888888;d=(P>+h[d>>3]?Y:_)+8|0;}h[e+40>>3]=+h[d>>3]*.013888888888888888;c[e+12>>2]=$;l=aa;return}function YM(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+64|0;j=o+40|0;e=o+32|0;k=o+16|0;n=o;d=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]|0)>>>2&1^1;m=a+16|0;f=c[c[(c[m>>2]|0)+104>>2]>>2]|0;c[47282]=f;f=l2(f)|0;f=JK(((f|0)>1?f:1)+1|0)|0;b=_M(a,d,1,f)|0;if(!b){c[e>>2]=c[c[(c[m>>2]|0)+104>>2]>>2];gA(1,105472,e)|0;c[47282]=105493;b=_M(a,d,1,f)|0;}U1(f);$M(j,a,b);d=c[m>>2]|0;i=+h[d+32>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))|0);h[n>>3]=i;g=+h[d+40>>3]*72.0;g=+(~~(g+(g>=0.0?.5:-.5))|0);d=n+8|0;h[d>>3]=g;if(!((dP(aP(a,c[47165]|0,137308)|0)|0)<<24>>24)){i=+h[(+h[b>>3]>i?b:n)>>3];h[n>>3]=i;e=b+8|0;g=+h[(+h[e>>3]>g?b:n)+8>>3];h[d>>3]=g;d=e;e=b;}else {d=b+8|0;e=b;}a=(dP(aP(a,c[47156]|0,137308)|0)|0)&255;c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];aN(b,j,a);bN(k,i*-.5,g*.5);c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];cN(b,j,15);n=c[m>>2]|0;h[n+32>>3]=+h[e>>3]*.013888888888888888;h[n+40>>3]=(+h[d>>3]+1.0)*.013888888888888888;c[n+12>>2]=b;l=o;return}function ZM(a){a=a|0;var b=0.0,d=0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0.0,m=0;j=JK(48)|0;k=a+16|0;g=c[(c[(c[(c[k>>2]|0)+8>>2]|0)+8>>2]|0)+4>>2]|0;f=+_O(a,c[47146]|0,1797693134862315708145274.0e284,0.0);b=+_O(a,c[47145]|0,1797693134862315708145274.0e284,0.0);f=f0.0?(f>.0003?f:.0003):f;i=c[k>>2]|0;h[i+40>>3]=f;h[i+32>>3]=f;b=f*72.0;g=ZO(a,c[47160]|0,g,0)|0;i=JK((g|0)<1?32:g<<5)|0;f=f*36.0;e=-f;h[i>>3]=e;h[i+8>>3]=e;h[i+16>>3]=f;h[i+24>>3]=f;if((g|0)>1){a=1;d=2;e=f;b=f;while(1){if((a|0)==(g|0))break;l=e+4.0;f=b+4.0;h[i+(d<<4)>>3]=-l;h[i+(d<<4)+8>>3]=-f;m=d|1;h[i+(m<<4)>>3]=l;h[i+(m<<4)+8>>3]=f;a=a+1|0;d=d+2|0;e=l;b=f;}b=e*2.0;}c[j>>2]=1;c[j+4>>2]=g;c[j+8>>2]=2;m=j+16|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[m+16>>2]=0;c[m+20>>2]=0;c[j+44>>2]=i;l=b*.013888888888888888;m=c[k>>2]|0;h[m+32>>3]=l;h[m+40>>3]=l;c[m+12>>2]=j;return}function _M(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;g=JK(72)|0;n=c[(c[b+16>>2]|0)+104>>2]|0;m=0;i=1;j=c[47282]|0;a:while(1){k=a[j>>0]|0;switch(k<<24>>24){case 0:break a;case 92:{j=j+1|0;k=a[j>>0]|0;switch(k<<24>>24){case 124:case 125:case 123:case 92:{l=m;break}default:E=4;}break}default:E=4;}if((E|0)==4){E=0;switch(k<<24>>24){case 123:{l=m+1|0;break}case 125:{l=m+-1|0;break}default:{l=m;i=i+((m|0)==0&k<<24>>24==124&1)|0;}}if((l|0)<0)break}m=l;j=j+1|0;}B=g+56|0;c[B>>2]=JK(i<<2)|0;a[g+64>>0]=d;y=(d|0)==0&1;z=n+82|0;A=f+1|0;v=(e|0)!=0;w=n+16|0;x=n+4|0;u=n+8|0;k=0;m=0;d=0;t=0;l=0;e=0;n=f;i=0;j=0;b:while(1){p=k;k=0;c:while(1){d:while(1){s=e;e:while(1){r=k;o=i;f:while(1){q=m;g:while(1){while(1){if(t){E=78;break b}m=c[47282]|0;i=a[m>>0]|0;if((i+-1&255)>=31)break;c[47282]=m+1;}switch(i<<24>>24|0){case 92:{E=53;break d}case 0:case 124:case 125:break e;case 60:break f;case 62:break g;case 123:break;default:{k=d;i=m;break d}}i=m+1|0;c[47282]=i;if(l|0){E=34;break b}if(!(a[i>>0]|0)){E=34;break b}e=_M(b,y,0,f)|0;c[(c[B>>2]|0)+(q<<2)>>2]=e;if(!e){E=36;break b}else {q=q+1|0;l=4;}}if(a[z>>0]|0){k=d;i=m;break d}if(!(l&16)){E=27;break b}if(o>>>0>A>>>0?(C=o+-1|0,(C|0)!=(s|0)):0)i=(a[C>>0]|0)==32?C:o;else i=o;a[i>>0]=0;r=D4(f)|0;c[47282]=(c[47282]|0)+1;m=q;l=l&-17;o=i;}if(l&6|0){E=22;break b}if(a[z>>0]|0){k=d;i=m;break d}c[47282]=m+1;m=q;l=l|18;k=r;s=f;i=f;}if(!((l&16|0)==0&(v|i<<24>>24!=0))){E=38;break b}if(!(l&4)){k=JK(72)|0;c[(c[B>>2]|0)+(q<<2)>>2]=k;m=q+1|0;}else {k=p;m=q;}if(r|0)c[k+60>>2]=r;if(!(l&5)){a[f+j>>0]=32;l=l|1;j=j+1|0;}i=f+j|0;if(l&1){if((j|0)>1?(D=i+-1|0,(D|0)!=(n|0)):0)i=(a[D>>0]|0)==32?D:i;a[i>>0]=0;n=D4(f)|0;c[k+52>>2]=zK(b,n,a[z>>0]|0?2:0,+h[w>>3],c[x>>2]|0,c[u>>2]|0)|0;a[k+64>>0]=1;n=f;j=0;}i=c[47282]|0;switch(a[i>>0]|0){case 0:{t=1;e=s;i=o;continue b}case 125:{E=51;break b}default:{}}c[47282]=i+1;p=k;l=0;k=0;e=s;i=o;}h:do if((E|0)==53){E=0;k=f+j|0;i=m+1|0;switch(a[i>>0]|0){case 0:{k=d;i=m;break h}case 62:case 60:case 124:case 125:case 123:{k=d;break}case 32:{if(!(a[z>>0]|0))k=1;else E=55;break}default:E=55;}if((E|0)==55){E=0;a[k>>0]=92;k=d;l=l|9;j=j+1|0;}c[47282]=i;}while(0);d=f+j|0;if(l&4|0?(a[i>>0]|0)!=32:0){E=59;break b}if(!(l&24))l=(a[i>>0]|0)==32?l:l|9;if(!(l&8))if(!(l&16))e=s;else {m=a[i>>0]|0;d=(k|0)!=0;if(!(d|m<<24>>24!=32))if((o|0)!=(f|0))if((a[o+-1>>0]|0)==32)m=o;else E=73;else m=f;else E=73;if((E|0)==73){E=0;a[o>>0]=m;m=o+1|0;i=c[47282]|0;}e=d?m+-1|0:s;o=m;}else {m=a[i>>0]|0;e=(k|0)!=0;if(!((!(e|m<<24>>24!=32)?(a[d+-1>>0]|0)==32:0)?(a[z>>0]|0)==0:0)){a[d>>0]=m;j=j+1|0;}if(e){e=s;n=f+j+-1|0;}else e=s;}i=i+1|0;c[47282]=i;while(1){if((a[i>>0]|0)>=0){m=q;d=k;k=r;i=o;continue c}s=i+1|0;c[47282]=s;a[f+j>>0]=a[i>>0]|0;j=j+1|0;i=s;}}}if((E|0)==22){dN(g,r);g=0;}else if((E|0)==27){dN(g,r);g=0;}else if((E|0)==34){dN(g,r);g=0;}else if((E|0)==36){dN(g,r);g=0;}else if((E|0)==38){dN(g,r);g=0;}else if((E|0)==51){c[47282]=i+1;c[g+48>>2]=m;}else if((E|0)==59){dN(g,r);g=0;}else if((E|0)==78)c[g+48>>2]=q;return g|0}function $M(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;k=u+48|0;m=u+40|0;n=u+32|0;t=u+16|0;s=u;j=c[e+52>>2]|0;a:do if(!j){n=t+8|0;o=e+48|0;p=e+56|0;q=e+64|0;r=s+8|0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;j=0;while(1){if((j|0)>=(c[o>>2]|0))break a;$M(s,d,c[(c[p>>2]|0)+(j<<2)>>2]|0);if(!(a[q>>0]|0)){h[n>>3]=+h[n>>3]+ +h[r>>3];k=t;m=+h[t>>3]>+h[s>>3]?t:s;}else {h[t>>3]=+h[t>>3]+ +h[s>>3];k=n;m=(+h[n>>3]>+h[r>>3]?t:s)+8|0;}h[k>>3]=+h[m>>3];j=j+1|0;}}else {g=+h[j+24>>3];f=+h[j+32>>3];if(g>0.0|f>0.0){j=QA(d,105496)|0;do if(j){c[k>>2]=m;c[k+4>>2]=n;j=b5(j,105503,k)|0;if((j|0)<=0){i=8.0;g=g+16.0;break}i=+h[m>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))<<1|0);g=g+i;if((j|0)!=1){i=+h[n>>3]*72.0;i=+(~~(i+(i>=0.0?.5:-.5))<<1|0);}}else {i=8.0;g=g+16.0;}while(0);f=i+f;}h[t>>3]=g;h[t+8>>3]=f;}while(0);c[e>>2]=c[t>>2];c[e+4>>2]=c[t+4>>2];c[e+8>>2]=c[t+8>>2];c[e+12>>2]=c[t+12>>2];c[b>>2]=c[t>>2];c[b+4>>2]=c[t+4>>2];c[b+8>>2]=c[t+8>>2];c[b+12>>2]=c[t+12>>2];l=u;return}function aN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0;s=l;l=l+32|0;o=s+16|0;p=s;q=+h[d>>3];i=q-+h[b>>3];r=+h[d+8>>3];f=r-+h[b+8>>3];c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];d=c[b+52>>2]|0;if(!((e|0)!=0|(d|0)==0)){n=d+40|0;h[n>>3]=+h[n>>3]+i;n=d+48|0;h[n>>3]=+h[n>>3]+f;}m=b+48|0;d=c[m>>2]|0;a:do if(d|0){n=b+64|0;f=((a[n>>0]|0)==0?f:i)/+(d|0);k=b+56|0;j=0;while(1){if((j|0)>=(d|0))break a;b=c[(c[k>>2]|0)+(j<<2)>>2]|0;g=j+1|0;d=~~(f*+(g|0))-~~(f*+(j|0))|0;if(!(a[n>>0]|0))bN(p,q,+h[b+8>>3]+ +(d|0));else bN(p,+h[b>>3]+ +(d|0),r);c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];aN(b,o,e);j=g;d=c[m>>2]|0;}}while(0);l=s;return}function bN(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function cN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0;q=l;l=l+48|0;j=q+32|0;n=q+16|0;m=q;a[b+65>>0]=e;k=b+16|0;s=+h[d>>3];p=d+8|0;r=+h[p>>3];bN(n,s,r-+h[b+8>>3]);c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];k=b+32|0;bN(m,+h[b>>3]+s,r);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];k=c[b+48>>2]|0;m=k+-1|0;n=(e|0)==0;o=b+56|0;i=b+64|0;g=0;while(1){if((g|0)>=(k|0))break;do if(!n){b=(g|0)==0;f=(g|0)==(m|0);if(!(a[i>>0]|0))if(b){b=f?15:14;break}else {b=f?11:10;break}else if(b){b=f?15:13;break}else {b=f?7:5;break}}else b=0;while(0);f=c[(c[o>>2]|0)+(g<<2)>>2]|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];cN(f,j,b&e);if(!(a[i>>0]|0))h[p>>3]=+h[p>>3]-+h[(c[(c[o>>2]|0)+(g<<2)>>2]|0)+8>>3];else h[d>>3]=+h[c[(c[o>>2]|0)+(g<<2)>>2]>>3]+ +h[d>>3];g=g+1|0;}l=q;return}function dN(a,b){a=a|0;b=b|0;eN(a);U1(b);return}function eN(a){a=a|0;var b=0,d=0,e=0;d=a+48|0;e=a+56|0;b=0;while(1){if((b|0)>=(c[d>>2]|0))break;eN(c[(c[e>>2]|0)+(b<<2)>>2]|0);b=b+1|0;}U1(c[a+60>>2]|0);CK(c[a+52>>2]|0);U1(c[e>>2]|0);U1(a);return}function fN(a){a=a|0;var b=0.0,d=0.0;d=+_O(a,c[47146]|0,0.0,.01);b=+_O(a,c[47145]|0,0.0,.02);b=(d>b?d:b)*72.0;return +(+(~~(b+(b>=0.0?.5:-.5))|0))}function gN(a,b){a=+a;b=+b;var c=0;c=~~(a/b);return +(+((+(c|0)*b+1.0e-05>2]|0)+8>>2]|0;if(!a)a=0;else a=(c[c[a+4>>2]>>2]|0)==91&1;return a|0}function iN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[47283]|0;a:do if(!f)d=0;else {g=c[47284]|0;e=0;while(1){if((e|0)>=(g|0)){d=0;break a}d=c[f+(e<<2)>>2]|0;h=c[d>>2]|0;if((a[h>>0]|0)==(a[b>>0]|0)?(s2(h,b)|0)==0:0)break a;e=e+1|0;}}while(0);return d|0}function jN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;if(mP(QA(d,105526)|0)|0)if((a[b>>0]|0)==101?(s2(b,105685)|0)==0:0){d=101;g=6;}else {b=105519;g=4;}else g=4;if((g|0)==4){d=a[b>>0]|0;if(d<<24>>24==99)if(!(s2(b,105519)|0))g=11;else {d=99;g=6;}else g=6;}a:do if((g|0)==6){e=20848;while(1){f=c[e>>2]|0;if(!f){g=11;break a}if((a[f>>0]|0)==d<<24>>24?(s2(f,b)|0)==0:0){b=e;break a}e=e+16|0;}}while(0);if((g|0)==11)b=kN(b)|0;return b|0}function kN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;d=iN(b)|0;if(!d){f=c[47284]|0;d=f+1|0;c[47284]=d;e=c[47283]|0;if(!e)d=KK(d<<2)|0;else d=MK(e,d<<2)|0;c[47283]=d;d=JK(16)|0;c[(c[47283]|0)+(f<<2)>>2]=d;c[d>>2]=c[5212];c[d+4>>2]=c[5213];c[d+8>>2]=c[5214];c[d+12>>2]=c[5215];e=D4(b)|0;c[d>>2]=e;do if(!0){if((a[b>>0]|0)==99?(s2(b,105519)|0)==0:0){e=1;break}c[g>>2]=c[5212];c[g+4>>2]=e;gA(0,105690,g)|0;e=0;}while(0);a[d+12>>0]=e;}l=h;return d|0}function lN(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[b>>3]*.5257311121191336;c=+h[b+8>>3]*.8944271909999159;c=d>c?d:c;h[a>>3]=c*4.97979656976556;h[a+8>>3]=c*4.73606797749979;return}function mN(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0.0;d=+h[b>>3];k=b+8|0;e=+h[k>>3];c=e/d;if(!(c>.9510565162951536))if(c<.9510565162951536){j=d;e=d*.9510565162951536;}else j=d;else j=e*1.0514622242382672;d=j*.5257311121191336;g=j*.20081141588622725;i=j*.05020285397155681;c=.3141592653589793;f=0;while(1){if((f|0)>=10)break;h[a+(f<<4)>>3]=+E(+c)*d;h[a+(f<<4)+8>>3]=+F(+c)*d-i;m=c+.6283185307179586;l=f|1;h[a+(l<<4)>>3]=+E(+m)*g;h[a+(l<<4)+8>>3]=+F(+m)*g-i;c=c+1.2566370614359172;f=f+2|0;}h[b>>3]=j;h[k>>3]=e;return}function nN(a){a=a|0;a=c[(c[a+16>>2]|0)+12>>2]|0;if(a|0){U1(c[a+44>>2]|0);U1(a);}return}function oN(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+80|0;k=o+40|0;g=o;n=o+64|0;h=o+56|0;if(!(a[e>>0]|0)){g=4208;h=b+40|0;do{c[b>>2]=c[g>>2];b=b+4|0;g=g+4|0;}while((b|0)<(h|0))}else {i=(f|0)==0?106356:f;c[n>>2]=15;j=d+16|0;f=c[j>>2]|0;do if(a[(c[f+104>>2]|0)+82>>0]|0){f=pU(d,e,n)|0;if(!f){f=c[j>>2]|0;m=8;break}if(CN(d,f,g,i,c[n>>2]|0,0)|0){c[k>>2]=KB(d)|0;c[k+4>>2]=e;c[k+8>>2]=i;gA(0,106358,k)|0;}}else m=8;while(0);if((m|0)==8){if((c[(c[f+8>>2]|0)+8>>2]|0)==1664)h=0;else {c[h>>2]=d;c[h+4>>2]=0;}if(CN(d,0,g,e,c[n>>2]|0,h)|0)DN(d,e);}c[g+36>>2]=0;h=b+40|0;do{c[b>>2]=c[g>>2];b=b+4|0;g=g+4|0;}while((b|0)<(h|0))}l=o;return}function pN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0;r=l;l=l+112|0;n=r+96|0;m=r+80|0;p=r+64|0;k=r+48|0;q=r+32|0;o=r;f=r+16|0;if(!a){c[47287]=0;a=0;}else {g=c[a+4>>2]|0;a=c[a>>2]|0;i=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];mK(f,n,i);c[q>>2]=c[f>>2];c[q+4>>2]=c[f+4>>2];c[q+8>>2]=c[f+8>>2];c[q+12>>2]=c[f+12>>2];a:do if(g){d=+h[g+8>>3];e=+h[g+24>>3];s=+h[q>>3];if((+h[g>>3]<=s?s<=+h[g+16>>3]:0)?(j=+h[q+8>>3],d<=j):0)a=j<=e&1;else a=0;}else {if((a|0)==(c[47287]|0)){f=c[47288]|0;g=c[47290]|0;i=c[47289]|0;}else {g=c[(c[a+16>>2]|0)+12>>2]|0;c[47291]=g;i=c[g+44>>2]|0;c[47289]=i;f=c[g+8>>2]|0;c[47288]=f;g=O((c[g+4>>2]|0)+-1|0,f)|0;g=(g|0)>0?g:0;c[47290]=g;c[47287]=a;}a=0;b=0;while(1){if((a|0)>=(f|0)){a=1;break a}t=i+(g+a<<4)|0;c[o>>2]=c[t>>2];c[o+4>>2]=c[t+4>>2];c[o+8>>2]=c[t+8>>2];c[o+12>>2]=c[t+12>>2];t=i+(g+((a+4|0)%(f|0)|0)<<4)|0;c[k>>2]=c[q>>2];c[k+4>>2]=c[q+4>>2];c[k+8>>2]=c[q+8>>2];c[k+12>>2]=c[q+12>>2];c[p>>2]=c[46614];c[p+4>>2]=c[46615];c[p+8>>2]=c[46616];c[p+12>>2]=c[46617];c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];b=b+((BN(k,p,m,n)|0)==0&1)|0;if((b|0)==2){a=0;break}else a=a+2|0;}}while(0)}l=r;return a|0}function qN(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;e=c[b+16>>2]|0;if((a[(c[e+104>>2]|0)+82>>0]|0)!=0?(a[e+145>>0]|0)!=0:0)b=sU(b,d,0,f,g)|0;else b=0;return b|0}function rN(e,f){e=e|0;f=f|0;var i=0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0;P=l;l=l+48|0;H=P+24|0;G=P+16|0;A=P+8|0;z=P;L=P+32|0;n=P+28|0;M=c[e+16>>2]|0;N=M+208|0;i=c[N>>2]|0;if((i|0)==0?(b[M+260>>1]&1)==0:0)J=0;else E=4;if((E|0)==4)if(!(c[e+152>>2]&4)){cS(e,i,c[M+228>>2]|0,c[M+244>>2]|0,c[M+212>>2]|0);J=1;}else J=1;I=f+16|0;i=c[I>>2]|0;r=c[i+12>>2]|0;F=c[r+44>>2]|0;K=c[r+8>>2]|0;r=c[r+4>>2]|0;if((c[47285]|0)<(K|0)){i=K+5|0;c[47285]=i;j=c[47286]|0;if(!j)i=KK(i<<4)|0;else i=MK(j,i<<4)|0;c[47286]=i;i=c[I>>2]|0;}D=(c[i+104>>2]|0)+56|0;i=i+16|0;c[D>>2]=c[i>>2];c[D+4>>2]=c[i+4>>2];c[D+8>>2]=c[i+8>>2];c[D+12>>2]=c[i+12>>2];D=c[I>>2]|0;B=+h[D+32>>3]*72.0;B=(+h[D+96>>3]+ +h[D+88>>3])/+(~~(B+(B>=0.0?.5:-.5))|0);C=+h[D+40>>3]*72.0;C=+h[D+80>>3]/+(~~(C+(C>=0.0?.5:-.5))|0);D=sN(e,f)|0;c[L>>2]=0;i=d[(c[I>>2]|0)+117>>0]|0;do if(!(i&1)){if(i&2|0){s=bP(f,0,106256)|0;hS(e,s);jS(e,bP(f,0,106264)|0);j=0;i=1;break}if(i&8|0){s=bP(f,0,106272)|0;hS(e,s);jS(e,bP(f,0,106280)|0);j=0;i=1;break}if(i&4|0){s=bP(f,0,106288)|0;hS(e,s);jS(e,bP(f,0,106296)|0);j=0;i=1;break}if(!(D&1))if(!(D&576)){j=0;i=0;}else {j=tN(f)|0;i=1;}else {j=tN(f)|0;if(!((JJ(j,L,n)|0)<<24>>24)){jS(e,j);i=1;}else {jS(e,c[L>>2]|0);i=c[L+4>>2]|0;m=ZO(f,c[47173]|0,0,0)|0;k=+g[n>>2];if(!i)kS(e,137314,m,k);else kS(e,i,m,k);i=(D&2)>>>1|2;}}s=uN(e,f)|0;}else {s=bP(f,0,106240)|0;hS(e,s);jS(e,bP(f,0,106248)|0);j=0;i=1;}while(0);m=c[(c[I>>2]|0)+8>>2]|0;if(a[m+12>>0]|0){m=c[m>>2]|0;if((a[m>>0]|0)==99){m=(s2(m,105519)|0)==0;E=33;}else u=1;}else {m=1;E=33;}if((E|0)==33){m=m^1;if((r|0)!=0|i<<24>>24==0|m)u=m;else {hS(e,137379);r=1;u=0;}}v=(K|0)<3;w=(D&512|0)!=0;y=(D&8|0)==0;x=(D&64|0)==0;p=(D&1024|0)==0;q=(D&2130706444|0)==0;t=0;while(1){if((t|0)>=(r|0))break;n=O(t,K)|0;o=c[47286]|0;m=0;while(1){if((m|0)>=(K|0))break;R=m+n|0;k=+h[F+(R<<4)+8>>3];Q=c[I>>2]|0;h[o+(m<<4)>>3]=+h[Q+16>>3]+ +h[F+(R<<4)>>3]*B;h[o+(m<<4)+8>>3]=+h[Q+24>>3]+k*C;m=m+1|0;}do if(v){if(w&(t|0)==0?(R2(j,58)|0)!=0:0)if((fI(e,o,j)|0)>1){c[z>>2]=KB(f)|0;gA(3,106304,z)|0;i=0;}else i=0;mS(e,c[47286]|0,K,i&255);if(!y)vN(e,f);}else {if(!x){if((t|0)==0?(jI(e,o,j,1)|0)>1:0){c[A>>2]=KB(f)|0;gA(3,106304,A)|0;}nS(e,c[47286]|0,K,0);break}if(!p){hS(e,137379);nS(e,c[47286]|0,K,i&255);hS(e,s);qS(e,(c[47286]|0)+32|0,2);break}i=i&255;if(q){nS(e,o,K,i);break}else {TM(e,o,K,D,i);break}}while(0);t=t+1|0;i=0;}m=c[(c[I>>2]|0)+8>>2]|0;if(!(a[m+12>>0]|0)){m=QA(f,109025)|0;if(m|0?a[m>>0]|0:0){o=m;E=65;}}else {m=c[m>>2]|0;if((a[m>>0]|0)==99?(s2(m,105519)|0)==0:0){m=QA(f,105526)|0;if(m|0?a[m>>0]|0:0){o=m;E=65;}}else {o=m;E=65;}}if((E|0)==65){n=c[47286]|0;m=0;while(1){if((m|0)>=(K|0))break;k=+h[F+(m<<4)+8>>3];R=c[I>>2]|0;h[n+(m<<4)>>3]=+h[R+16>>3]+ +h[F+(m<<4)>>3]*B;h[n+(m<<4)+8>>3]=+h[R+24>>3]+k*C;m=m+1|0;}m=i&255;do if(!(u|i<<24>>24==0)){if(v){if(w&(t|0)==0?(R2(j,58)|0)!=0:0)if((fI(e,n,j)|0)>1){c[G>>2]=KB(f)|0;gA(3,106304,G)|0;i=0;}else i=0;mS(e,c[47286]|0,K,i&255);if(y)break;vN(e,f);break}if(x)if(!(D&12)){nS(e,n,K,m);break}else {TM(e,n,K,D,m);break}else {if((jI(e,n,j,1)|0)>1){c[H>>2]=KB(f)|0;gA(3,106304,H)|0;}nS(e,c[47286]|0,K,0);break}}while(0);R=c[47286]|0;sS(e,o,R,K,i,aP(f,c[47166]|0,137308)|0);}U1(c[L>>2]|0);DK(e,10,c[(c[I>>2]|0)+104>>2]|0);if(J){if(c[e+152>>2]&4|0)cS(e,c[N>>2]|0,c[M+228>>2]|0,c[M+244>>2]|0,c[M+212>>2]|0);dS(e);}l=P;return}function sN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;e=yN(d,f)|0;if(e|0)lS(b,e);e=c[47172]|0;if((e|0?(g=RA(d,e)|0,g|0):0)?a[g>>0]|0:0)uS(b,+_O(d,c[47172]|0,1.0,0.0));l=h;return c[f>>2]|0}function tN(a){a=a|0;return xN(a,134800)|0}function uN(b,d){b=b|0;d=d|0;d=bP(d,c[47148]|0,195059)|0;d=a[d>>0]|0?d:137314;hS(b,d);return d|0}function vN(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0.0,j=0,k=0,m=0;d=l;l=l+96|0;j=d+80|0;k=d+64|0;e=d+32|0;m=d+16|0;g=d;b=c[b+16>>2]|0;f=+h[b+80>>3];h[m+8>>3]=f*.375;i=+h[b+96>>3];h[m>>3]=i*.6614;b=b+16|0;c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];c[j>>2]=c[b>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];wN(g,k,j);c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];g=e+8|0;b=e+24|0;h[b>>3]=+h[g>>3];h[e+16>>3]=+h[e>>3]-i*1.3228;qS(a,e,2);f=+h[g>>3]-f*.75;h[g>>3]=f;h[b>>3]=f;qS(a,e,2);l=d;return}function wN(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function xN(b,d){b=b|0;d=d|0;var e=0;e=bP(b,c[47149]|0,195059)|0;if(!(a[e>>0]|0)){e=bP(b,c[47148]|0,195059)|0;return ((a[e>>0]|0)==0?d:e)|0}else return e|0;return 0}function yN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=bP(b,c[47157]|0,195059)|0;a:do if(!(a[e>>0]|0)){g=0;e=0;}else {g=PI(e)|0;h=g;e=0;b:while(1){f=c[h>>2]|0;if(!f)break a;switch(a[f>>0]|0){case 102:{if(!(s2(f,111101)|0)){h=h+4|0;e=e|1;continue b}break}case 114:{if(!(s2(f,106316)|0)){f=h;do{j=f;f=f+4|0;i=c[f>>2]|0;c[j>>2]=i;}while((i|0)!=0);j=h;e=e|4;h=j;continue b}if(!(s2(f,106334)|0)){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|3;h=j;continue b}break}case 100:{if(!(s2(f,106324)|0)){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|8;h=j;continue b}break}case 105:{if(!(s2(f,134335)|0)){h=h+4|0;e=e|32;continue b}break}case 115:{if((s2(f,106341)|0)==0?zN(b)|0:0){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|64;h=j;continue b}break}case 119:{if((s2(f,106349)|0)==0?AN(b)|0:0){f=h;do{i=f;f=f+4|0;j=c[f>>2]|0;c[i>>2]=j;}while((j|0)!=0);j=h;e=e|512;h=j;continue b}break}default:{}}h=h+4|0;}}while(0);f=c[(c[(c[b+16>>2]|0)+8>>2]|0)+8>>2]|0;if(f)e=c[f+40>>2]|e;c[d>>2]=e;return g|0}function zN(a){a=a|0;var b=0.0;a=c[(c[(c[a+16>>2]|0)+8>>2]|0)+8>>2]|0;if((((a|0)!=0?(c[a+8>>2]|0)==4:0)?(b=+h[a+16>>3],((~~(b+(b>=0.0?.5:-.5))|0)%90|0|0)==0):0)?+h[a+24>>3]==0.0:0)a=+h[a+32>>3]==0.0&1;else a=0;return a|0}function AN(a){a=a|0;a=c[(c[(c[a+16>>2]|0)+8>>2]|0)+8>>2]|0;if(!a)a=0;else a=(c[a+8>>2]|0)<3&1;return a|0}function BN(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0;i=+h[c+8>>3];g=-(+h[d+8>>3]-i);f=+h[c>>3];e=+h[d>>3]-f;f=e*i+f*g;return (+h[a+8>>3]*e+ +h[a>>3]*g-f>=0.0^+h[b>>3]*g-f+ +h[b+8>>3]*e>=0.0^1)&1|0}function CN(b,d,e,f,g,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;G=l;l=l+192|0;B=G+176|0;E=G+160|0;m=G+144|0;z=G+128|0;A=G+112|0;n=G+96|0;o=G+80|0;p=G+64|0;v=G+48|0;w=G+32|0;x=G+16|0;D=G;if(!d){c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;m=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;C=c[b+16>>2]|0;q=+h[C+80>>3]*.5;j=+h[C+88>>3];t=m?q:j;q=m?j:q;m=0;C=E;j=0.0;k=-q;r=t;F=E+8|0;s=0.0;t=-t;}else {k=+h[d>>3];t=+h[d+8>>3];q=+h[d+16>>3];r=+h[d+24>>3];bN(m,(q+k)*.5,(r+t)*.5);c[E>>2]=c[m>>2];c[E+4>>2]=c[m+4>>2];c[E+8>>2]=c[m+8>>2];c[E+12>>2]=c[m+12>>2];H=E+8|0;m=1;C=E;j=+h[E>>3];F=H;s=+h[H>>3];}u=(q>r?q:r)*4.0;a:do if((f|0)!=0?(y=a[f>>0]|0,y<<24>>24!=0):0){f=f+1|0;switch(y<<24>>24|0){case 99:{p=1;g=0;f=0;n=0;j=0.0;o=0;break a}case 101:{if(a[f>>0]|0){p=1;g=0;f=0;n=0;j=0.0;o=1;break a}if(!i)h[C>>3]=q;else {EN(z,i,s,u);c[E>>2]=c[z>>2];c[E+4>>2]=c[z+4>>2];c[E+8>>2]=c[z+8>>2];c[E+12>>2]=c[z+12>>2];}p=0;g=g&2;f=0;n=1;j=0.0;o=0;m=1;break a}case 115:{h[F>>3]=t;switch(a[f>>0]|0){case 0:{if(!i)h[C>>3]=j;else {EN(A,i,-u,j);c[E>>2]=c[A>>2];c[E+4>>2]=c[A+4>>2];c[E+8>>2]=c[A+8>>2];c[E+12>>2]=c[A+12>>2];}p=0;g=g&1;f=0;n=1;j=-1.5707963267948966;o=0;m=1;break a}case 101:{if(!i)h[C>>3]=q;else {EN(n,i,-u,u);c[E>>2]=c[n>>2];c[E+4>>2]=c[n+4>>2];c[E+8>>2]=c[n+8>>2];c[E+12>>2]=c[n+12>>2];}p=0;g=g&3;f=0;n=1;j=-.7853981633974483;o=0;m=1;break a}case 119:{if(!i)h[C>>3]=k;else {u=-u;EN(o,i,u,u);c[E>>2]=c[o>>2];c[E+4>>2]=c[o+4>>2];c[E+8>>2]=c[o+8>>2];c[E+12>>2]=c[o+12>>2];}p=0;g=g&9;f=0;n=1;j=-2.356194490192345;o=0;m=1;break a}default:{h[F>>3]=s;p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}case 119:{if(a[f>>0]|0){p=1;g=0;f=0;n=0;j=0.0;o=1;break a}if(!i)h[C>>3]=k;else {EN(p,i,s,-u);c[E>>2]=c[p>>2];c[E+4>>2]=c[p+4>>2];c[E+8>>2]=c[p+8>>2];c[E+12>>2]=c[p+12>>2];}p=0;g=g&8;f=0;n=1;j=3.141592653589793;o=0;m=1;break a}case 110:{h[F>>3]=r;switch(a[f>>0]|0){case 0:{if(!i)h[C>>3]=j;else {EN(v,i,u,j);c[E>>2]=c[v>>2];c[E+4>>2]=c[v+4>>2];c[E+8>>2]=c[v+8>>2];c[E+12>>2]=c[v+12>>2];}p=0;g=g&4;f=0;n=1;j=1.5707963267948966;o=0;m=1;break a}case 101:{if(!i)h[C>>3]=q;else {EN(w,i,u,u);c[E>>2]=c[w>>2];c[E+4>>2]=c[w+4>>2];c[E+8>>2]=c[w+8>>2];c[E+12>>2]=c[w+12>>2];}p=0;g=g&6;f=0;n=1;j=.7853981633974483;o=0;m=1;break a}case 119:{if(!i)h[C>>3]=k;else {EN(x,i,u,-u);c[E>>2]=c[x>>2];c[E+4>>2]=c[x+4>>2];c[E+8>>2]=c[x+8>>2];c[E+12>>2]=c[x+12>>2];}p=0;g=g&12;f=0;n=1;j=2.356194490192345;o=0;m=1;break a}default:{h[F>>3]=s;p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}case 95:{p=1;f=1;n=0;j=0.0;o=0;break a}default:{p=1;g=0;f=0;n=0;j=0.0;o=1;break a}}}else {p=1;g=0;f=0;n=0;j=0.0;o=0;}while(0);H=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3)*90|0;c[B>>2]=c[E>>2];c[B+4>>2]=c[E+4>>2];c[B+8>>2]=c[E+8>>2];c[B+12>>2]=c[E+12>>2];lK(D,B,H);c[E>>2]=c[D>>2];c[E+4>>2]=c[D+4>>2];c[E+8>>2]=c[D+8>>2];c[E+12>>2]=c[D+12>>2];if(!(f<<24>>24))g=FN(g,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3)|0;a[e+33>>0]=g;c[e+24>>2]=d;k=+h[C>>3];h[e>>3]=+(~~(k+(k>=0.0?.5:-.5))|0);k=+h[F>>3];h[e+8>>3]=+(~~(k+(k>=0.0?.5:-.5))|0);h[e+16>>3]=+GN(j,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&3);k=+h[C>>3];j=+h[F>>3];if(k==0.0&j==0.0)g=-128;else {u=+K(+j,+k);t=u+4.71238898038469;g=~~((!(t>=6.283185307179586)?t:u+-1.5707963267948966)*40.74366543152521)&255;}a[e+32>>0]=g;a[e+29>>0]=n;a[e+28>>0]=m;a[e+30>>0]=p;a[e+31>>0]=f;l=G;return o|0}function DN(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=KB(a)|0;c[e+4>>2]=b;gA(0,106419,e)|0;l=d;return}function EN(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+128|0;g=p+112|0;j=p+48|0;k=p+16|0;m=p+32|0;n=p;o=c[b>>2]|0;i=c[(c[(xC(o)|0)+16>>2]|0)+116>>2]&3;h[k>>3]=e;h[k+8>>3]=d;f=(i|0)!=0;if(f){c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];lK(m,g,i*90|0);c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];}m=j+48|0;q=j+32|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;c[j+20>>2]=0;c[j+24>>2]=0;c[j+28>>2]=0;c[q>>2]=c[k>>2];c[q+4>>2]=c[k+4>>2];c[q+8>>2]=c[k+8>>2];c[q+12>>2]=c[k+12>>2];c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];$N(b,c[(c[(c[(c[o+16>>2]|0)+8>>2]|0)+4>>2]|0)+12>>2]|0,j,1);if(f){c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];mK(n,g,i*90|0);c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];};c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];l=p;return}function FN(a,b){a=a|0;b=b|0;a:do switch(b|0){case 3:switch(a|0){case 4:{a=2;break a}case 1:{a=8;break a}case 8:{a=1;break a}case 2:{a=4;break a}default:break a}case 2:switch(a|0){case 4:{a=1;break a}case 1:{a=4;break a}default:break a}case 1:switch(a|0){case 4:{a=2;break a}case 1:{a=8;break a}case 8:{a=4;break a}case 2:{a=1;break a}default:break a}default:{}}while(0);return a|0}function GN(a,b){a=+a;b=b|0;switch(b|0){case 3:{if(!(a==3.141592653589793))if(!(a==2.356194490192345))if(!(a==1.5707963267948966))if(!(a==0.0))if(!(a==-.7853981633974483)){if(a==-1.5707963267948966)a=3.141592653589793;}else a=2.356194490192345;else a=1.5707963267948966;else a=0.0;else a=-.7853981633974483;else a=-1.5707963267948966;break}case 2:{a=-a;break}case 1:{a=a+-1.5707963267948966;break}default:{}}return +a}function HN(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0.0,i=0,j=0,k=0;e=l;l=l+32|0;k=e+16|0;i=e;a=c[a>>2]|0;j=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];mK(i,k,j);d=+h[i>>3];g=+h[i+8>>3];a=c[a+16>>2]|0;f=+h[a+80>>3]*.5;if(!(!(g>=-f)|!(g<=f))?d>=-+h[a+88>>3]:0)a=d<=+h[a+96>>3]&1;else a=0;l=e;return a|0}function IN(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;n=l;l=l+32|0;m=n;i=c[a+16>>2]|0;j=i+208|0;g=c[j>>2]|0;if(!g)k=(b[i+260>>1]&1)!=0;else k=1;e=d+16|0;d=c[e>>2]|0;f=c[d+12>>2]|0;if(f|0){if(k?(c[a+152>>2]&4|0)==0:0){cS(a,g,c[i+228>>2]|0,c[i+244>>2]|0,c[i+212>>2]|0);d=c[e>>2]|0;}g=c[a+36>>2]|0;p=+h[d+24>>3]+ +(c[f+8>>2]|0);o=c[f>>2]|0;h[m>>3]=+h[d+16>>3]+ +(c[f+4>>2]|0);h[m+8>>3]=p;c[m+16>>2]=o;w4(g,106450,m)|0;g=c[e>>2]|0;m=(c[g+104>>2]|0)+56|0;g=g+16|0;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];c[m+12>>2]=c[g+12>>2];DK(a,10,c[(c[e>>2]|0)+104>>2]|0);if(k){if(c[a+152>>2]&4|0)cS(a,c[j>>2]|0,c[i+228>>2]|0,c[i+244>>2]|0,c[i+212>>2]|0);dS(a);}}l=n;return}function JN(a){a=a|0;eN(c[(c[a+16>>2]|0)+12>>2]|0);return}function KN(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0;m=l;l=l+64|0;k=m+40|0;h=m;if(!(a[f>>0]|0)){h=4208;g=b+40|0;do{c[b>>2]=c[h>>2];b=b+4|0;h=h+4|0;}while((b|0)<(g|0))}else {g=(g|0)==0?106356:g;i=c[(c[e+16>>2]|0)+12>>2]|0;j=QN(i,f)|0;if(!j){if(CN(e,i+16|0,h,f,15,0)|0)DN(e,f);}else if(CN(e,j+16|0,h,g,d[j+65>>0]|0,0)|0){c[k>>2]=KB(e)|0;c[k+4>>2]=f;c[k+8>>2]=g;gA(0,106358,k)|0;}g=b+40|0;do{c[b>>2]=c[h>>2];b=b+4|0;h=h+4|0;}while((b|0)<(g|0))}l=m;return}function LN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0.0,k=0,m=0,n=0.0;k=l;l=l+32|0;m=k+16|0;i=k;f=c[a+4>>2]|0;a=c[a>>2]|0;g=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[m>>2]=c[b>>2];c[m+4>>2]=c[b+4>>2];c[m+8>>2]=c[b+8>>2];c[m+12>>2]=c[b+12>>2];mK(i,m,g);c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];if(!f){f=c[(c[a+16>>2]|0)+12>>2]|0;g=f+16|0;a=f+24|0;i=f+32|0;f=f+40|0;}else {g=f;a=f+8|0;i=f+16|0;f=f+24|0;}e=+h[a>>3];d=+h[f>>3];n=+h[b>>3];if((+h[g>>3]<=n?n<=+h[i>>3]:0)?(j=+h[b+8>>3],e<=j):0)a=j<=d&1;else a=0;l=k;return a|0}function MN(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0,v=0.0;u=l;l=l+80|0;r=u+64|0;q=u+32|0;t=u;a:do if(!(a[d+28>>0]|0))e=0;else {i=+h[d>>3];p=b+16|0;m=c[(c[p>>2]|0)+12>>2]|0;k=m+48|0;m=m+56|0;d=0;while(1){if((d|0)>=(c[k>>2]|0))break a;n=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;o=c[(c[m>>2]|0)+(d<<2)>>2]|0;j=+(~~+h[(n?o+16|0:o+24|0)>>3]|0);if(i>=j?(s=+(~~+h[(n?o+32|0:o+40|0)>>3]|0),i<=s):0)break;d=d+1|0;}if(!(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1)){t=c[p>>2]|0;v=+h[t+16>>3];h[f>>3]=v+j;j=+h[t+24>>3];i=+h[t+80>>3];h[f+8>>3]=j-i*.5;h[f+16>>3]=v+s;}else {o=(c[(c[m>>2]|0)+(d<<2)>>2]|0)+16|0;b=(c[p>>2]|0)+16|0;c[q>>2]=c[o>>2];c[q+4>>2]=c[o+4>>2];c[q+8>>2]=c[o+8>>2];c[q+12>>2]=c[o+12>>2];c[q+16>>2]=c[o+16>>2];c[q+20>>2]=c[o+20>>2];c[q+24>>2]=c[o+24>>2];c[q+28>>2]=c[o+28>>2];c[r>>2]=c[b>>2];c[r+4>>2]=c[b+4>>2];c[r+8>>2]=c[b+8>>2];c[r+12>>2]=c[b+12>>2];nK(t,q,r);c[f>>2]=c[t>>2];c[f+4>>2]=c[t+4>>2];c[f+8>>2]=c[t+8>>2];c[f+12>>2]=c[t+12>>2];c[f+16>>2]=c[t+16>>2];c[f+20>>2]=c[t+20>>2];c[f+24>>2]=c[t+24>>2];c[f+28>>2]=c[t+28>>2];t=c[p>>2]|0;i=+h[t+80>>3];j=+h[t+24>>3];}h[f+24>>3]=i*.5+j;c[g>>2]=1;}while(0);l=u;return e|0}function NN(d,e){d=d|0;e=e|0;var f=0,i=0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;w=l;l=l+144|0;n=w+96|0;p=w+64|0;r=w;s=w+128|0;t=c[d+16>>2]|0;u=t+208|0;f=c[u>>2]|0;if(!f)v=(b[t+260>>1]&1)!=0;else v=1;m=e+16|0;q=c[m>>2]|0;o=c[q+12>>2]|0;j=o+16|0;c[p>>2]=c[j>>2];c[p+4>>2]=c[j+4>>2];c[p+8>>2]=c[j+8>>2];c[p+12>>2]=c[j+12>>2];c[p+16>>2]=c[j+16>>2];c[p+20>>2]=c[j+20>>2];c[p+24>>2]=c[j+24>>2];c[p+28>>2]=c[j+28>>2];x=+h[q+16>>3];h[p>>3]=+h[p>>3]+x;k=+h[q+24>>3];q=p+8|0;h[q>>3]=+h[q>>3]+k;q=p+16|0;h[q>>3]=+h[q>>3]+x;j=p+24|0;h[j>>3]=+h[j>>3]+k;if(v?(c[d+152>>2]&4|0)==0:0)cS(d,f,c[t+228>>2]|0,c[t+244>>2]|0,c[t+212>>2]|0);f=sN(d,e)|0;uN(d,e)|0;c[s>>2]=0;if(!(f&1))i=0;else {i=tN(e)|0;if(!((JJ(i,s,n)|0)<<24>>24)){jS(d,i);i=1;}else {jS(d,c[s>>2]|0);i=c[s+4>>2]|0;j=ZO(e,c[47173]|0,0,0)|0;k=+g[n>>2];if(!i)kS(d,137314,j,k);else kS(d,i,j,k);i=f>>>1&1|2;}}j=c[c[(c[m>>2]|0)+8>>2]>>2]|0;if((a[j>>0]|0)==77){m=(s2(j,106227)|0)==0;f=m?f|4:f;}if(!(f&2130706444)){c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];c[n+16>>2]=c[p+16>>2];c[n+20>>2]=c[p+20>>2];c[n+24>>2]=c[p+24>>2];c[n+28>>2]=c[p+28>>2];oS(d,n,i);}else {c[r>>2]=c[p>>2];c[r+4>>2]=c[p+4>>2];c[r+8>>2]=c[p+8>>2];c[r+12>>2]=c[p+12>>2];p=r+32|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];h[r+16>>3]=+h[p>>3];h[r+24>>3]=+h[r+8>>3];h[r+48>>3]=+h[r>>3];h[r+56>>3]=+h[r+40>>3];TM(d,r,4,f,i);}ON(d,e,o);U1(c[s>>2]|0);if(v){if(c[d+152>>2]&4|0)cS(d,c[u>>2]|0,c[t+228>>2]|0,c[t+244>>2]|0,c[t+212>>2]|0);dS(d);}l=w;return}function ON(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+144|0;p=u+128|0;o=u+112|0;q=u+16|0;r=u;g=u+96|0;i=u+80|0;s=u+64|0;t=u+48|0;j=e+52|0;f=c[j>>2]|0;if(!f)f=d+16|0;else {n=f+56|0;m=e+16|0;f=e+32|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];PN(g,o,p);f=d+16|0;m=(c[f>>2]|0)+16|0;c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];c[p>>2]=c[m>>2];c[p+4>>2]=c[m+4>>2];c[p+8>>2]=c[m+8>>2];c[p+12>>2]=c[m+12>>2];wN(i,o,p);c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];DK(b,10,c[j>>2]|0);uN(b,d)|0;}k=(c[f>>2]|0)+16|0;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];c[r+8>>2]=c[k+8>>2];c[r+12>>2]=c[k+12>>2];k=e+48|0;m=e+64|0;n=q+16|0;j=e+56|0;e=q+16|0;i=0;while(1){if((i|0)>=(c[k>>2]|0))break;if((i|0)>0){f=(c[j>>2]|0)+(i<<2)|0;g=c[f>>2]|0;if(!(a[m>>0]|0)){g=g+32|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];h[q>>3]=+h[(c[f>>2]|0)+16>>3];f=n;g=0;}else {g=g+16|0;c[q>>2]=c[g>>2];c[q+4>>2]=c[g+4>>2];c[q+8>>2]=c[g+8>>2];c[q+12>>2]=c[g+12>>2];h[e>>3]=+h[q>>3];f=(c[f>>2]|0)+32|0;g=1;}h[q+(g<<4)+8>>3]=+h[f+8>>3];c[o>>2]=c[q>>2];c[o+4>>2]=c[q+4>>2];c[o+8>>2]=c[q+8>>2];c[o+12>>2]=c[q+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];wN(s,o,p);c[q>>2]=c[s>>2];c[q+4>>2]=c[s+4>>2];c[q+8>>2]=c[s+8>>2];c[q+12>>2]=c[s+12>>2];c[o>>2]=c[n>>2];c[o+4>>2]=c[n+4>>2];c[o+8>>2]=c[n+8>>2];c[o+12>>2]=c[n+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];wN(t,o,p);c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];qS(b,q,2);}ON(b,d,c[(c[j>>2]|0)+(i<<2)>>2]|0);i=i+1|0;}l=u;return}function PN(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function QN(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=c[b+60>>2]|0;if(!(((e|0)!=0?(a[e>>0]|0)==(a[d>>0]|0):0)?(s2(e,d)|0)==0:0))f=4;a:do if((f|0)==4){g=b+56|0;f=c[b+48>>2]|0;e=0;while(1){if((e|0)>=(f|0)){b=0;break a}b=QN(c[(c[g>>2]|0)+(e<<2)>>2]|0,d)|0;if(!b)e=e+1|0;else break}}while(0);return b|0}function RN(a,b){a=a|0;b=b|0;var d=0;d=b+8|0;h[d>>3]=+h[d>>3]*1.375;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function SN(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;k=+h[b>>3];f=k*.5;m=+h[b+8>>3];i=m*.5;h[a>>3]=f;e=m*.40909090909090906;h[a+8>>3]=e;h[a+16>>3]=f;g=m*.4592530909090909;h[a+24>>3]=g;j=k*.275892;h[a+32>>3]=j;h[a+40>>3]=i;h[a+48>>3]=0.0;h[a+56>>3]=i;k=k*-.275892;h[a+64>>3]=k;h[a+72>>3]=i;l=-f;h[a+80>>3]=l;h[a+88>>3]=g;d=a+96|0;h[d>>3]=l;h[a+104>>3]=e;b=a+112|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=a+128|0;h[b>>3]=l;h[a+136>>3]=m*-.40909090909090906;d=a+144|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];h[a+160>>3]=l;g=-g;h[a+168>>3]=g;h[a+176>>3]=k;i=-i;h[a+184>>3]=i;h[a+192>>3]=0.0;h[a+200>>3]=i;h[a+208>>3]=j;h[a+216>>3]=i;h[a+224>>3]=f;h[a+232>>3]=g;d=a+240|0;h[d>>3]=f;h[a+248>>3]=-e;b=a+256|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];b=a+288|0;d=a+272|0;c[d>>2]=c[a>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];c[d+12>>2]=c[a+12>>2];c[b>>2]=c[a>>2];c[b+4>>2]=c[a+4>>2];c[b+8>>2]=c[a+8>>2];c[b+12>>2]=c[a+12>>2];return}function TN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+144|0;u=x+112|0;t=x+96|0;v=x+80|0;s=x+64|0;w=x+32|0;q=x+16|0;r=x;g=x+48|0;do if(a){j=c[a+4>>2]|0;k=c[a>>2]|0;o=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&3)*90|0;c[u>>2]=c[b>>2];c[u+4>>2]=c[b+4>>2];c[u+8>>2]=c[b+8>>2];c[u+12>>2]=c[b+12>>2];mK(g,u,o);c[w>>2]=c[g>>2];c[w+4>>2]=c[g+4>>2];c[w+8>>2]=c[g+8>>2];c[w+12>>2]=c[g+12>>2];if(j|0){d=+h[w>>3];if(!(+h[j>>3]<=d)){a=0;break}if(!(d<=+h[j+16>>3])){a=0;break}d=+h[w+8>>3];if(!(+h[j+8>>3]<=d)){a=0;break}a=d<=+h[j+24>>3];break}if((k|0)==(c[47292]|0)){d=+h[23309];e=+h[23310];i=+h[23311];}else {a=k+16|0;b=c[(c[a>>2]|0)+12>>2]|0;c[47293]=b;c[47294]=c[b+44>>2];c[47295]=c[b+8>>2];if(!(c[b+40>>2]&2048)){n=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&1|0)==0;o=c[a>>2]|0;h[(n?186496:186504)>>3]=+h[o+96>>3]+ +h[o+88>>3];h[(n?186504:186496)>>3]=+h[o+80>>3];i=+h[o+32>>3]*72.0;f=+h[o+40>>3]*72.0;f=+(~~(f+(f>=0.0?.5:-.5))|0);i=+(~~(i+(i>=0.0?.5:-.5))|0);}else {yP(u,b);i=+h[u+16>>3]-+h[u>>3];f=+h[u+24>>3]-+h[u+8>>3];o=(c[(c[(xC(k)|0)+16>>2]|0)+116>>2]&1|0)==0;h[(o?186496:186504)>>3]=i;h[(o?186504:186496)>>3]=f;}d=+h[23312];if(d==0.0){h[23312]=1.0;d=1.0;}e=+h[23313];if(e==0.0){h[23313]=1.0;e=1.0;}d=i/d;h[23309]=d;e=f/e;h[23310]=e;i=i*.5;h[23311]=i;h[23314]=f*.5;o=O((c[(c[47293]|0)+4>>2]|0)+-1|0,c[47295]|0)|0;c[47296]=(o|0)>0?o:0;c[47292]=k;}f=+h[w>>3]*d;h[w>>3]=f;o=w+8|0;d=+h[o>>3]*e;h[o>>3]=d;if(!(+B(+f)>i)?(e=+B(+d),p=+h[23314],!(e>p)):0){o=c[47295]|0;if((o|0)<3){a=+L2(f/i,d/p)<1.0;break}b=(c[47297]|0)%(o|0)|0;a=(b+1|0)%(o|0)|0;k=c[47294]|0;m=c[47296]|0;n=k+(m+b<<4)|0;c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];n=k+(m+a<<4)|0;c[r>>2]=c[n>>2];c[r+4>>2]=c[n+4>>2];c[r+8>>2]=c[n+8>>2];c[r+12>>2]=c[n+12>>2];c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[46630];c[v+4>>2]=c[46631];c[v+8>>2]=c[46632];c[v+12>>2]=c[46633];c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[u>>2]=c[n>>2];c[u+4>>2]=c[n+4>>2];c[u+8>>2]=c[n+8>>2];c[u+12>>2]=c[n+12>>2];if(BN(s,v,t,u)|0){c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[q>>2];c[v+4>>2]=c[q+4>>2];c[v+8>>2]=c[q+8>>2];c[v+12>>2]=c[q+12>>2];c[t>>2]=c[r>>2];c[t+4>>2]=c[r+4>>2];c[t+8>>2]=c[r+8>>2];c[t+12>>2]=c[r+12>>2];c[u>>2]=c[46630];c[u+4>>2]=c[46631];c[u+8>>2]=c[46632];c[u+12>>2]=c[46633];n=(BN(s,v,t,u)|0)!=0;if(n?(c[s>>2]=c[w>>2],c[s+4>>2]=c[w+4>>2],c[s+8>>2]=c[w+8>>2],c[s+12>>2]=c[w+12>>2],c[v>>2]=c[r>>2],c[v+4>>2]=c[r+4>>2],c[v+8>>2]=c[r+8>>2],c[v+12>>2]=c[r+12>>2],c[t>>2]=c[46630],c[t+4>>2]=c[46631],c[t+8>>2]=c[46632],c[t+12>>2]=c[46633],c[u>>2]=c[q>>2],c[u+4>>2]=c[q+4>>2],c[u+8>>2]=c[q+8>>2],c[u+12>>2]=c[q+12>>2],(BN(s,v,t,u)|0)!=0):0){a=1;break}else {j=b;b=1;}while(1){if((b|0)>=(o|0)){b=31;break}if(n){g=a;a=(a+1|0)%(o|0)|0;}else {g=(j+-1+o|0)%(o|0)|0;a=j;}q=k+(m+g<<4)|0;r=k+(m+a<<4)|0;c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];c[v>>2]=c[46630];c[v+4>>2]=c[46631];c[v+8>>2]=c[46632];c[v+12>>2]=c[46633];c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[u>>2]=c[r>>2];c[u+4>>2]=c[r+4>>2];c[u+8>>2]=c[r+8>>2];c[u+12>>2]=c[r+12>>2];if(!(BN(s,v,t,u)|0)){b=30;break}else {j=g;b=b+1|0;}}if((b|0)==30){c[47297]=g;a=0;break}else if((b|0)==31){c[47297]=j;a=1;break}}else a=0;}else a=0;}else {c[47292]=0;a=0;}while(0);l=x;return a&1|0}function UN(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0;j=l;l=l+32|0;f=j+16|0;i=j;if(a){a=c[a>>2]|0;k=(c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&3)*90|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];mK(i,f,k);g=+h[i>>3];e=+h[i+8>>3];if((a|0)==(c[47300]|0))d=+h[23317];else {i=c[(c[a+16>>2]|0)+12>>2]|0;k=(c[i+4>>2]<<1)+-2|0;d=+h[(c[i+44>>2]|0)+((((k|0)>0?k:0)|1)<<4)>>3];h[23317]=d;c[47300]=a;}if(+B(+g)>d|+B(+e)>d)a=0;else a=+L2(g,e)<=d&1;}else {c[47300]=0;a=0;}l=j;return a|0}function VN(e,f){e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0,w=0;t=l;l=l+16|0;j=t;r=c[e+16>>2]|0;s=r+208|0;g=c[s>>2]|0;if((g|0)==0?(b[r+260>>1]&1)==0:0)q=0;else if(!(c[e+152>>2]&4)){cS(e,g,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);q=1;}else q=1;n=f+16|0;k=c[(c[n>>2]|0)+12>>2]|0;o=c[k+44>>2]|0;p=c[k+8>>2]|0;k=c[k+4>>2]|0;if((c[47298]|0)<(p|0)){g=p+2|0;c[47298]=g;i=c[47299]|0;if(!i)g=KK(g<<4)|0;else g=MK(i,g<<4)|0;c[47299]=g;}yN(f,j)|0;if(!(c[j>>2]&32))lS(e,22020);else lS(e,22016);g=c[47172]|0;if(g|0)uS(e,+_O(f,g,1.0,0.0));g=d[(c[n>>2]|0)+117>>0]|0;do if(!(g&1)){if(g&2|0){hS(e,bP(f,0,106256)|0);g=bP(f,0,106264)|0;jS(e,g);break}if(g&8|0){hS(e,bP(f,0,106272)|0);g=bP(f,0,106280)|0;jS(e,g);break}if(!(g&4)){g=xN(f,137314)|0;jS(e,g);uN(e,f)|0;break}else {hS(e,bP(f,0,106288)|0);g=bP(f,0,106296)|0;jS(e,g);break}}else {hS(e,bP(f,0,106240)|0);g=bP(f,0,106248)|0;jS(e,g);}while(0);if(!k)if(!(a[g>>0]|0))i=1;else {hS(e,g);i=1;}else i=k;j=1;f=0;while(1){if((f|0)>=(i|0))break;k=O(f,p)|0;m=c[47299]|0;g=0;while(1){if((g|0)>=(p|0))break;w=g+k|0;u=+h[o+(w<<4)+8>>3];v=c[n>>2]|0;h[m+(g<<4)>>3]=+h[v+16>>3]+ +h[o+(w<<4)>>3];h[m+(g<<4)+8>>3]=+h[v+24>>3]+u;g=g+1|0;}mS(e,m,p,j);j=0;f=f+1|0;}if(q){if(c[e+152>>2]&4|0)cS(e,c[s>>2]|0,c[r+228>>2]|0,c[r+244>>2]|0,c[r+212>>2]|0);dS(e);}l=t;return}function WN(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0;g=l;l=l+48|0;h=g;e=XN(b,e,f)|0;c[h+36>>2]=c[f+36>>2];CN(b,c[f+24>>2]|0,h,e,d[f+33>>0]|0,0)|0;b=h;e=a+40|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0;}while((a|0)<(e|0));l=g;return}function XN(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0,C=0;z=l;l=l+32|0;y=z;g=z+24|0;k=z+16|0;x=c[(c[(c[(xC(b)|0)+60>>2]|0)+16>>2]|0)+116>>2]&3;f=b+16|0;w=(c[f>>2]|0)+16|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];YN(g,y,x);w=(c[d+16>>2]|0)+16|0;c[y>>2]=c[w>>2];c[y+4>>2]=c[w+4>>2];c[y+8>>2]=c[w+8>>2];c[y+12>>2]=c[w+12>>2];YN(k,y,x);x=a[e+33>>0]|0;y=x&255;a:do switch(x<<24>>24){case 0:case 15:{d=0;break}default:{d=c[e+24>>2]|0;if(!d){x=(c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1|0)==0;w=c[f>>2]|0;B=+h[w+80>>3]*.5;A=-B;m=+h[w+88>>3];j=-m;n=x?j:A;i=x?m:B;m=x?B:m;j=x?A:j;}else {n=+h[d>>3];i=+h[d+16>>3];m=+h[d+24>>3];j=+h[d+8>>3];}x=c[g>>2]|0;v=c[g+4>>2]|0;w=c[k>>2]|0;s=c[k+4>>2]|0;t=~~j;u=~~((i+n)*.5);r=~~i;q=~~((m+j)*.5);p=~~m;o=~~n;g=0;k=0;d=0;e=0;b=0;while(1){if((k|0)==4)break a;if(1<>2]|0;else f=g;}else f=g;g=f;k=k+1|0;}}}while(0);l=z;return d|0}function YN(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;switch(d|0){case 0:{f=+h[b>>3];e=+h[b+8>>3];break}case 2:{f=+h[b>>3];e=-+h[b+8>>3];break}case 1:{f=-+h[b+8>>3];e=+h[b>>3];break}case 3:{f=+h[b+8>>3];e=+h[b>>3];break}default:{f=0.0;e=0.0;}}c[a>>2]=~~(f+(f>=0.0?.5:-.5));c[a+4>>2]=~~(e+(e>=0.0?.5:-.5));return}function ZN(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+80|0;f=i+40|0;h=i;g=b+16|0;e=c[g>>2]|0;d=e+16|0;if(a[e+47>>0]|0){e=c[b>>2]&3;WN(f,c[((e|0)==3?b:b+48|0)+40>>2]|0,c[((e|0)==2?b:b+-48|0)+40>>2]|0,d);e=f;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0));e=c[g>>2]|0;}d=e+56|0;if(a[e+87>>0]|0){e=c[b>>2]&3;WN(h,c[((e|0)==2?b:b+-48|0)+40>>2]|0,c[((e|0)==3?b:b+48|0)+40>>2]|0,d);e=h;f=d+40|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0;}while((d|0)<(f|0))}l=i;return}function _N(){var a=0,b=0,d=0;a=l;l=l+32|0;b=a+16|0;d=a;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];TN(0,b)|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];UN(0,b)|0;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];pN(0,b)|0;l=a;return}function $N(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;z=l;l=l+192|0;s=z+176|0;x=z+112|0;y=z+48|0;t=z+32|0;u=z+24|0;v=z+16|0;w=z;if(!(e<<24>>24)){k=d+48|0;c[t>>2]=c[k>>2];c[t+4>>2]=c[k+4>>2];c[t+8>>2]=c[k+8>>2];c[t+12>>2]=c[k+12>>2];k=u;m=v;n=x;o=0;}else {c[t>>2]=c[d>>2];c[t+4>>2]=c[d+4>>2];c[t+8>>2]=c[d+8>>2];c[t+12>>2]=c[d+12>>2];k=v;m=u;n=0;o=x;}h[u>>3]=0.0;h[v>>3]=1.0;q=t+8|0;f=0.0;g=1.0;j=0;p=+h[t>>3];while(1){r=+h[q>>3];f=(f+g)*.5;kP(w,d,3,f,n,o);c[t>>2]=c[w>>2];c[t+4>>2]=c[w+4>>2];c[t+8>>2]=c[w+8>>2];c[t+12>>2]=c[w+12>>2];c[s>>2]=c[w>>2];c[s+4>>2]=c[w+4>>2];c[s+8>>2]=c[w+8>>2];c[s+12>>2]=c[w+12>>2];a:do if(!((lb[b&127](a,s)|0)<<24>>24)){e=0;while(1){if((e|0)==4){e=k;j=1;break a}j=y+(e<<4)|0;A=x+(e<<4)|0;c[j>>2]=c[A>>2];c[j+4>>2]=c[A+4>>2];c[j+8>>2]=c[A+8>>2];c[j+12>>2]=c[A+12>>2];e=e+1|0;}}else e=m;while(0);h[e>>3]=f;i=+h[t>>3];p=p-i;if(!((p>=0.0?p:-p)>.5)?(r=r-+h[q>>3],!((r>=0.0?r:-r)>.5)):0)break;f=+h[u>>3];g=+h[v>>3];p=i;}b:do if(!(j<<24>>24)){e=0;while(1){if((e|0)==4)break b;A=d+(e<<4)|0;y=x+(e<<4)|0;c[A>>2]=c[y>>2];c[A+4>>2]=c[y+4>>2];c[A+8>>2]=c[y+8>>2];c[A+12>>2]=c[y+12>>2];e=e+1|0;}}else {e=0;while(1){if((e|0)==4)break b;A=d+(e<<4)|0;x=y+(e<<4)|0;c[A>>2]=c[x>>2];c[A+4>>2]=c[x+4>>2];c[A+8>>2]=c[x+8>>2];c[A+12>>2]=c[x+12>>2];e=e+1|0;}}while(0);l=z;return}function aO(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0;m=l;l=l+48|0;d=m+16|0;e=m;f=m+32|0;g=a+16|0;i=c[g>>2]|0;j=c[i+8>>2]|0;if(j|0?(k=j+4|0,c[(c[k>>2]|0)+12>>2]|0):0){c[f>>2]=a;c[f+4>>2]=0;n=+h[i+96>>3];h[e>>3]=+h[b>>3]-+h[i+16>>3];h[e+8>>3]=+h[b+8>>3]-+h[i+24>>3];k=c[(c[k>>2]|0)+12>>2]|0;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];k=lb[k&127](f,d)|0;h[(c[g>>2]|0)+96>>3]=n;bO(f,a,b,k);}l=m;return}function bO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0.0,m=0,n=0;n=l;l=l+64|0;m=n;j=b+16|0;g=c[j>>2]|0;k=+h[g+96>>3];i=g+16|0;f=g+24|0;b=0;while(1){if((b|0)==4)break;h[m+(b<<4)>>3]=+h[d+(b<<4)>>3]-+h[i>>3];h[m+(b<<4)+8>>3]=+h[d+(b<<4)+8>>3]-+h[f>>3];b=b+1|0;}$N(a,c[(c[(c[g+8>>2]|0)+4>>2]|0)+12>>2]|0,m,e);b=0;while(1){if((b|0)==4)break;e=c[j>>2]|0;h[d+(b<<4)>>3]=+h[e+16>>3]+ +h[m+(b<<4)>>3];h[d+(b<<4)+8>>3]=+h[e+24>>3]+ +h[m+(b<<4)+8>>3];b=b+1|0;}h[(c[j>>2]|0)+96>>3]=k;l=n;return}function cO(b,d){b=b|0;d=d|0;var e=0,f=0;while(1){f=b+16|0;b=c[f>>2]|0;if(!(a[b+112>>0]|0))break;b=c[b+116>>2]|0;}b=c[b+8>>2]|0;if(!b){b=JK(40)|0;c[(c[f>>2]|0)+8>>2]=b;}e=c[b>>2]|0;if(!e)b=KK(((c[b+4>>2]|0)*48|0)+48|0)|0;else b=MK(e,((c[b+4>>2]|0)*48|0)+48|0)|0;f=c[(c[f>>2]|0)+8>>2]|0;c[f>>2]=b;f=f+4|0;e=c[f>>2]|0;c[f>>2]=e+1;f=b+(e*48|0)|0;c[f>>2]=JK(d<<4)|0;c[b+(e*48|0)+4>>2]=d;b=b+(e*48|0)+8|0;e=b+40|0;do{c[b>>2]=0;b=b+4|0;}while((b|0)<(e|0));return f|0}function dO(b,e,f,g,i){b=b|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0.0,F=0.0;D=l;l=l+96|0;A=D+16|0;u=D;x=D+92|0;y=D+88|0;v=D+80|0;m=c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0;z=xC(m)|0;B=cO(b,g)|0;n=b;while(1){o=c[n+16>>2]|0;if(!(a[o+112>>0]|0))break;n=c[o+116>>2]|0;}if((a[i+8>>0]|0)==0?(j=c[m+16>>2]|0,k=c[e+16>>2]|0,(c[j+232>>2]|0)==(c[k+232>>2]|0)):0){p=(c[j+236>>2]|0)>(c[k+236>>2]|0);w=p?m:e;m=p?e:m;}else w=e;if((m|0)==(c[((c[n>>2]&3|0)==3?n:n+48|0)+40>>2]|0)){j=o+80|0;k=o+40|0;p=d[o+86>>0]|0;e=d[o+46>>0]|0;}else {j=o+40|0;k=o+80|0;p=d[o+46>>0]|0;e=d[o+86>>0]|0;}o=c[j>>2]|0;j=c[k>>2]|0;if(((e|0)!=0?(r=m+16|0,q=c[(c[r>>2]|0)+8>>2]|0,(q|0)!=0):0)?(c[(c[q+4>>2]|0)+12>>2]|0)!=0:0){c[v>>2]=m;c[v+4>>2]=j;j=g+-4|0;e=u+8|0;k=0;while(1){if((k|0)>=(j|0))break;n=k+3|0;q=c[r>>2]|0;h[u>>3]=+h[f+(n<<4)>>3]-+h[q+16>>3];h[e>>3]=+h[f+(n<<4)+8>>3]-+h[q+24>>3];q=c[(c[(c[q+8>>2]|0)+4>>2]|0)+12>>2]|0;c[A>>2]=c[u>>2];c[A+4>>2]=c[u+4>>2];c[A+8>>2]=c[u+8>>2];c[A+12>>2]=c[u+12>>2];if(!((lb[q&127](v,A)|0)<<24>>24))break;else k=n;}c[x>>2]=k;bO(v,m,f+(k<<4)|0,1);}else {c[x>>2]=0;k=0;}if(((p|0)!=0?(t=w+16|0,s=c[(c[t>>2]|0)+8>>2]|0,(s|0)!=0):0)?(c[(c[s+4>>2]|0)+12>>2]|0)!=0:0){c[v>>2]=w;c[v+4>>2]=o;m=g+-4|0;e=u+8|0;j=m;while(1){if((j|0)<=0)break;g=c[t>>2]|0;h[u>>3]=+h[f+(j<<4)>>3]-+h[g+16>>3];h[e>>3]=+h[f+(j<<4)+8>>3]-+h[g+24>>3];g=c[(c[(c[g+8>>2]|0)+4>>2]|0)+12>>2]|0;c[A>>2]=c[u>>2];c[A+4>>2]=c[u+4>>2];c[A+8>>2]=c[u+8>>2];c[A+12>>2]=c[u+12>>2];if(!((lb[g&127](v,A)|0)<<24>>24))break;j=j+-3|0;}c[y>>2]=j;bO(v,w,f+(j<<4)|0,0);}else {m=g+-4|0;c[y>>2]=m;j=m;}while(1){if((k|0)>=(m|0))break;e=k+3|0;E=+h[f+(k<<4)>>3]-+h[f+(e<<4)>>3];F=+h[f+(k<<4)+8>>3]-+h[f+(e<<4)+8>>3];if(F*F+E*E<1.0e-06)k=e;else break}c[x>>2]=k;while(1){if((j|0)<=0)break;v=j+3|0;F=+h[f+(j<<4)>>3]-+h[f+(v<<4)>>3];E=+h[f+(j<<4)+8>>3]-+h[f+(v<<4)+8>>3];if(!(E*E+F*F<1.0e-06))break;j=j+-3|0;}c[y>>2]=j;eO(b,w,f,x,y,B,i);r=c[x>>2]|0;n=c[y>>2]|0;m=n+4|0;n=n+3|0;o=A+16|0;p=A+32|0;q=A+48|0;k=z+16|0;j=r;while(1){if((j|0)>=(m|0))break;z=(c[B>>2]|0)+(j-r<<4)|0;e=f+(j<<4)|0;c[z>>2]=c[e>>2];c[z+4>>2]=c[e+4>>2];c[z+8>>2]=c[e+8>>2];c[z+12>>2]=c[e+12>>2];c[A>>2]=c[e>>2];c[A+4>>2]=c[e+4>>2];c[A+8>>2]=c[e+8>>2];c[A+12>>2]=c[e+12>>2];e=j+1|0;if((j|0)>=(n|0)){C=38;break}y=(c[B>>2]|0)+(e-r<<4)|0;z=f+(e<<4)|0;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[o>>2]=c[z>>2];c[o+4>>2]=c[z+4>>2];c[o+8>>2]=c[z+8>>2];c[o+12>>2]=c[z+12>>2];z=j+2|0;y=(c[B>>2]|0)+(z-r<<4)|0;z=f+(z<<4)|0;c[y>>2]=c[z>>2];c[y+4>>2]=c[z+4>>2];c[y+8>>2]=c[z+8>>2];c[y+12>>2]=c[z+12>>2];c[p>>2]=c[z>>2];c[p+4>>2]=c[z+4>>2];c[p+8>>2]=c[z+8>>2];c[p+12>>2]=c[z+12>>2];z=j+3|0;y=f+(z<<4)|0;c[q>>2]=c[y>>2];c[q+4>>2]=c[y+4>>2];c[q+8>>2]=c[y+8>>2];c[q+12>>2]=c[y+12>>2];lI((c[k>>2]|0)+16|0,A);j=z;}c[B+4>>2]=m-r;l=D;return}function eO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;m=p+4|0;n=p;o=b;while(1){j=c[(c[o+16>>2]|0)+116>>2]|0;if(!j)break;else o=j;}if(!(a[i+8>>0]|0))j=(kb[c[i>>2]&63](o)|0)&255;else j=0;HH(o,m,n);k=i+4|0;if((kb[c[k>>2]&63](d)|0)<<24>>24)c[n>>2]=0;if((kb[c[k>>2]&63](c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0)<<24>>24)c[m>>2]=0;if(j|0){d=c[m>>2]|0;c[m>>2]=c[n>>2];c[n>>2]=d;}if(!(a[i+9>>0]|0)){j=c[m>>2]|0;if(j|0)c[f>>2]=WH(o,e,c[f>>2]|0,c[g>>2]|0,h,j)|0;j=c[n>>2]|0;if(j|0)c[g>>2]=UH(o,e,c[f>>2]|0,c[g>>2]|0,h,j)|0;}else {k=c[n>>2]|0;j=c[m>>2]|0;if(j|k|0)XH(o,e,c[f>>2]|0,c[g>>2]|0,h,j,k);}l=p;return}function fO(a,b){a=a|0;b=b|0;var d=0,e=0;if(+h[b>>3]<+h[b+16>>3]?+h[b+8>>3]<+h[b+24>>3]:0){d=c[a+84>>2]|0;e=a+80|0;a=c[e>>2]|0;c[e>>2]=a+1;a=d+(a<<5)|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];}return}function gO(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0;x=l;l=l+112|0;u=x+72|0;o=x+56|0;n=x+16|0;q=x;j=c[d>>2]&3;p=d+48|0;w=c[((j|0)==3?d:p)+40>>2]|0;t=d+16|0;r=c[t>>2]|0;i=r+16|0;if(a[r+47>>0]|0){WN(n,w,c[((j|0)==2?d:d+-48|0)+40>>2]|0,i);j=n;n=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(n|0))}r=w+16|0;j=c[r>>2]|0;i=c[j+8>>2]|0;if(!i)n=0;else n=c[(c[i+4>>2]|0)+16>>2]|0;i=j+16|0;j=(c[t>>2]|0)+16|0;c[o>>2]=c[i>>2];c[o+4>>2]=c[i+4>>2];c[o+8>>2]=c[i+8>>2];c[o+12>>2]=c[i+12>>2];c[u>>2]=c[j>>2];c[u+4>>2]=c[j+4>>2];c[u+8>>2]=c[j+8>>2];c[u+12>>2]=c[j+12>>2];hO(q,o,u);c[b>>2]=c[q>>2];c[b+4>>2]=c[q+4>>2];c[b+8>>2]=c[q+8>>2];c[b+12>>2]=c[q+12>>2];if(!(g<<24>>24)){i=c[t>>2]|0;if(!(a[i+45>>0]|0))i=0;else {k=+h[i+32>>3];v=9;}}else {k=+iO(c[((c[d>>2]&3|0)==3?d:p)+40>>2]|0);v=9;}if((v|0)==9){h[b+16>>3]=k;i=1;}a[b+29>>0]=i;c[b+80>>2]=0;c[b+88>>2]=d;q=f+32|0;c[q>>2]=c[b>>2];c[q+4>>2]=c[b+4>>2];c[q+8>>2]=c[b+8>>2];c[q+12>>2]=c[b+12>>2];switch(e|0){case 1:{j=c[r>>2]|0;if((a[j+156>>0]|0)==0?(q=a[(c[t>>2]|0)+49>>0]|0,s=q&255,q<<24>>24!=0):0){c[u>>2]=c[f>>2];c[u+4>>2]=c[f+4>>2];c[u+8>>2]=c[f+8>>2];c[u+12>>2]=c[f+12>>2];c[u+16>>2]=c[f+16>>2];c[u+20>>2]=c[f+20>>2];c[u+24>>2]=c[f+24>>2];c[u+28>>2]=c[f+28>>2];do if(!(s&4)){if(s&1|0){c[f+48>>2]=1;i=u+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?u+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}i=f+48|0;if(!(s&8)){c[i>>2]=2;h[u>>3]=+h[b>>3];h[u+8>>3]=+h[j+24>>3]-+h[j+80>>3]*.5;h[u+24>>3]=+h[b+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}else {c[i>>2]=8;h[u+16>>3]=+h[b>>3];h[u+8>>3]=+h[j+24>>3]-+h[j+80>>3]*.5;h[u+24>>3]=+h[b+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}}else {c[f+48>>2]=4;k=+h[u>>3];if(+h[b>>3]<+h[j+16>>3]){z=k+-1.0;y=+h[b+8>>3];b=u+16|0;k=+h[b>>3];m=+h[j+80>>3]*.5+ +h[j+24>>3];m=m+ +((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[r>>2]|0;h[b>>3]=+h[i+16>>3]-+h[i+88>>3];h[u+24>>3]=y;h[u+8>>3]=+h[i+24>>3]-+h[i+80>>3]*.5;h[u>>3]=z;h[f+56>>3]=z;h[f+64>>3]=y;h[f+72>>3]=k;h[f+80>>3]=m;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}else {m=+h[b+8>>3];i=u+16|0;y=+h[i>>3]+1.0;z=+h[j+80>>3]*.5+ +h[j+24>>3];z=z+ +((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[r>>2]|0;h[u>>3]=+h[b+96>>3]+ +h[b+16>>3];h[u+24>>3]=m;h[u+8>>3]=+h[b+24>>3]-+h[b+80>>3]*.5;h[i>>3]=y;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=y;h[f+80>>3]=z;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((w|0)==(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)?i+16|0:i+56|0)+30>>0]=0;}else {j=1;v=47;}break}case 2:{s=a[(c[t>>2]|0)+49>>0]|0;j=s&255;if(!(s<<24>>24))v=46;else {c[u>>2]=c[f>>2];c[u+4>>2]=c[f+4>>2];c[u+8>>2]=c[f+8>>2];c[u+12>>2]=c[f+12>>2];c[u+16>>2]=c[f+16>>2];c[u+20>>2]=c[f+20>>2];c[u+24>>2]=c[f+24>>2];c[u+28>>2]=c[f+28>>2];do if(!(j&4)){if(j&1|0)if((c[f+48>>2]|0)==4){i=c[r>>2]|0;z=+h[i+24>>3]-+h[i+80>>3]*.5;i=u+16|0;y=+h[i>>3]+1.0;k=+h[b>>3];m=z-+((c[(c[(xC(w)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[r>>2]|0;h[u>>3]=+h[b+96>>3]+ +h[b+16>>3];h[u+8>>3]=z;h[u+24>>3]=+h[b+80>>3]*.5+ +h[b+24>>3];h[i>>3]=y;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=y;h[f+80>>3]=z;i=f+88|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=2;break}else {i=u+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?u+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}k=+h[b>>3];if(!(j&8)){h[u>>3]=k;e=c[r>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[u+24>>3]=m+k;k=+h[b+8>>3];i=u;}else {h[u+8>>3]=k-m;k=+h[b+8>>3]+1.0;i=u+16|0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}else {i=u+16|0;h[i>>3]=k+1.0;e=c[r>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[u+24>>3]=m+k;k=+h[b+8>>3]+-1.0;i=u;}else {h[u+8>>3]=k-m;k=+h[b+8>>3]+1.0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;break}}else {i=u+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+8>>3]?u:b)+8>>3];i=f+56|0;c[i>>2]=c[u>>2];c[i+4>>2]=c[u+4>>2];c[i+8>>2]=c[u+8>>2];c[i+12>>2]=c[u+12>>2];c[i+16>>2]=c[u+16>>2];c[i+20>>2]=c[u+20>>2];c[i+24>>2]=c[u+24>>2];c[i+28>>2]=c[u+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((w|0)==(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)?i+16|0:i+56|0)+30>>0]=0;c[f+48>>2]=j;}break}default:v=46;}if((v|0)==46){j=c[f+48>>2]|0;v=47;}a:do if((v|0)==47){if(n){d=f+56|0;i=f+52|0;j=pb[n&127](w,(c[t>>2]|0)+16|0,j,d,i)|0;if(j){c[f+48>>2]=j;break}}else {i=f+52|0;d=f+56|0;};c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];c[d+16>>2]=c[f+16>>2];c[d+20>>2]=c[f+20>>2];c[d+24>>2]=c[f+24>>2];c[d+28>>2]=c[f+28>>2];c[i>>2]=1;switch(e|0){case 8:{qa(138394,106514,569,106524);break}case 2:{h[((c[f+48>>2]|0)==4?f+56|0:f+72|0)+8>>3]=+h[b+8>>3];break a}case 1:{h[f+80>>3]=+h[b+8>>3];c[f+48>>2]=1;break a}default:break a}}while(0);l=x;return}function hO(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function iO(a){a=a|0;var b=0.0,d=0,e=0,f=0.0,g=0,i=0,j=0,k=0.0,l=0.0;i=c[a+16>>2]|0;j=c[i+172>>2]|0;f=0.0;g=0;while(1){a=c[j+(g<<2)>>2]|0;if(!a)break;f=+h[(c[(c[((c[a>>2]&3|0)==3?a:a+48|0)+40>>2]|0)+16>>2]|0)+16>>3]+f;g=g+1|0;}e=c[i+180>>2]|0;b=0.0;a=0;while(1){d=c[e+(a<<2)>>2]|0;if(!d)break;b=+h[(c[(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)+16>>2]|0)+16>>3]+b;a=a+1|0;}k=+h[i+16>>3];l=+h[i+24>>3];j=c[j>>2]|0;f=+K(+(l-+h[(c[(c[((c[j>>2]&3|0)==3?j:j+48|0)+40>>2]|0)+16>>2]|0)+24>>3]),+(k-f/+(g|0)));j=c[e>>2]|0;return +((+K(+(+h[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+24>>3]-l),+(b/+(a|0)-k))+f)*.5)}function jO(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0.0;z=l;l=l+112|0;w=z+72|0;p=z+56|0;n=z+16|0;t=z;j=c[d>>2]&3;r=d+-48|0;y=c[((j|0)==2?d:r)+40>>2]|0;u=d+16|0;s=c[u>>2]|0;i=s+56|0;if(a[s+87>>0]|0){WN(n,y,c[((j|0)==3?d:d+48|0)+40>>2]|0,i);j=n;n=i+40|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0;}while((i|0)<(n|0))}s=y+16|0;j=c[s>>2]|0;i=c[j+8>>2]|0;if(!i)o=0;else o=c[(c[i+4>>2]|0)+16>>2]|0;n=b+40|0;i=j+16|0;j=(c[u>>2]|0)+56|0;c[p>>2]=c[i>>2];c[p+4>>2]=c[i+4>>2];c[p+8>>2]=c[i+8>>2];c[p+12>>2]=c[i+12>>2];c[w>>2]=c[j>>2];c[w+4>>2]=c[j+4>>2];c[w+8>>2]=c[j+8>>2];c[w+12>>2]=c[j+12>>2];hO(t,p,w);c[n>>2]=c[t>>2];c[n+4>>2]=c[t+4>>2];c[n+8>>2]=c[t+8>>2];c[n+12>>2]=c[t+12>>2];if(!(g<<24>>24)){i=c[u>>2]|0;if(!(a[i+85>>0]|0))q=0;else {h[b+56>>3]=+h[i+72>>3];q=1;}}else {m=+iO(c[((c[d>>2]&3|0)==2?d:r)+40>>2]|0)+3.141592653589793;h[b+56>>3]=m;if(m<6.283185307179586)q=1;else qa(106534,106514,606,106558);}a[b+69>>0]=q;t=f+32|0;c[t>>2]=c[n>>2];c[t+4>>2]=c[n+4>>2];c[t+8>>2]=c[n+8>>2];c[t+12>>2]=c[n+12>>2];switch(e|0){case 1:{j=c[s>>2]|0;if((a[j+156>>0]|0)==0?(t=a[(c[u>>2]|0)+89>>0]|0,v=t&255,t<<24>>24!=0):0){c[w>>2]=c[f>>2];c[w+4>>2]=c[f+4>>2];c[w+8>>2]=c[f+8>>2];c[w+12>>2]=c[f+12>>2];c[w+16>>2]=c[f+16>>2];c[w+20>>2]=c[f+20>>2];c[w+24>>2]=c[f+24>>2];c[w+28>>2]=c[f+28>>2];do if(!(v&4))if(!(v&1)){i=f+48|0;if(!(v&8)){c[i>>2]=2;h[w>>3]=+h[n>>3];h[w+24>>3]=+h[j+80>>3]*.5+ +h[j+24>>3];h[w+8>>3]=+h[b+48>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}else {c[i>>2]=8;h[w+16>>3]=+h[n>>3];h[w+24>>3]=+h[j+80>>3]*.5+ +h[j+24>>3];h[w+8>>3]=+h[b+48>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}}else {c[f+48>>2]=1;k=+h[w>>3];if(+h[n>>3]<+h[j+16>>3]){B=k+-1.0;m=+h[b+48>>3];b=w+16|0;k=+h[b>>3];A=+h[j+80>>3]*-.5+ +h[j+24>>3];A=A-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[s>>2]|0;h[b>>3]=+h[i+16>>3]-+h[i+88>>3];h[w+8>>3]=m;h[w+24>>3]=+h[i+80>>3]*.5+ +h[i+24>>3];h[w>>3]=B;h[f+56>>3]=B;h[f+64>>3]=A;h[f+72>>3]=k;h[f+80>>3]=m;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}else {B=+h[b+48>>3];i=w+16|0;A=+h[i>>3]+1.0;m=+h[j+80>>3]*-.5+ +h[j+24>>3];m=m-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);b=c[s>>2]|0;h[w>>3]=+h[b+96>>3]+ +h[b+16>>3];h[w+8>>3]=B;h[w+24>>3]=+h[b+80>>3]*.5+ +h[b+24>>3];h[i>>3]=A;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=A;h[f+80>>3]=B;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}}else {c[f+48>>2]=4;i=w+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+48>>3]?w:n)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((y|0)==(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)?i+56|0:i+16|0)+30>>0]=0;c[f+48>>2]=v;}else {j=4;x=47;}break}case 2:{v=a[(c[u>>2]|0)+89>>0]|0;j=v&255;if(!(v<<24>>24))x=46;else {c[w>>2]=c[f>>2];c[w+4>>2]=c[f+4>>2];c[w+8>>2]=c[f+8>>2];c[w+12>>2]=c[f+12>>2];c[w+16>>2]=c[f+16>>2];c[w+20>>2]=c[f+20>>2];c[w+24>>2]=c[f+24>>2];c[w+28>>2]=c[f+28>>2];do if(!(j&4)){if(j&1|0)if((c[f+48>>2]|0)==4){k=+h[w>>3]+-1.0;i=c[s>>2]|0;B=+h[i+24>>3]-+h[i+80>>3]*.5;A=+h[n>>3];m=B-+((c[(c[(xC(y)|0)+16>>2]|0)+252>>2]|0)/2|0|0);i=c[s>>2]|0;h[w+16>>3]=+h[i+16>>3]+-2.0-+h[i+88>>3];h[w+8>>3]=B;h[w+24>>3]=+h[i+80>>3]*.5+ +h[i+24>>3];h[w>>3]=k;h[f+56>>3]=k;h[f+64>>3]=m;h[f+72>>3]=A;h[f+80>>3]=B;i=f+88|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=2;break}else {i=w+24|0;h[i>>3]=+h[(+h[i>>3]>+h[b+8>>3]?w+16|0:b)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}k=+h[n>>3];if(!(j&8)){h[w>>3]=k+-1.0;e=c[s>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[w+24>>3]=m+k;k=+h[b+48>>3]+-1.0;i=w;}else {h[w+8>>3]=k-m;k=+h[b+48>>3];i=w+16|0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}else {i=w+16|0;h[i>>3]=k+1.0;e=c[s>>2]|0;k=+h[e+24>>3];m=+h[e+80>>3]*.5;if((c[f+48>>2]|0)==4){h[w+24>>3]=m+k;k=+h[b+48>>3]+-1.0;i=w;}else {h[w+8>>3]=k-m;k=+h[b+48>>3]+1.0;}h[i+8>>3]=k;i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;break}}else {i=w+8|0;h[i>>3]=+h[(+h[i>>3]<+h[b+48>>3]?w:n)+8>>3];i=f+56|0;c[i>>2]=c[w>>2];c[i+4>>2]=c[w+4>>2];c[i+8>>2]=c[w+8>>2];c[i+12>>2]=c[w+12>>2];c[i+16>>2]=c[w+16>>2];c[i+20>>2]=c[w+20>>2];c[i+24>>2]=c[w+24>>2];c[i+28>>2]=c[w+28>>2];i=1;}while(0);c[f+52>>2]=i;while(1){i=c[d+16>>2]|0;if(!(a[i+112>>0]|0))break;d=c[i+116>>2]|0;}a[((y|0)==(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)?i+56|0:i+16|0)+30>>0]=0;c[f+48>>2]=j;}break}default:x=46;}if((x|0)==46){j=c[f+48>>2]|0;x=47;}a:do if((x|0)==47){if(o){d=f+56|0;i=f+52|0;j=pb[o&127](y,(c[u>>2]|0)+56|0,j,d,i)|0;if(j){c[f+48>>2]=j;break}}else {i=f+52|0;d=f+56|0;};c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];c[d+16>>2]=c[f+16>>2];c[d+20>>2]=c[f+20>>2];c[d+24>>2]=c[f+24>>2];c[d+28>>2]=c[f+28>>2];c[i>>2]=1;switch(e|0){case 8:{qa(138394,106514,765,106558);break}case 2:{h[((c[f+48>>2]|0)==4?f+56|0:f+72|0)+8>>3]=+h[b+48>>3];break a}case 1:{h[f+64>>3]=+h[b+48>>3];c[f+48>>2]=4;break a}default:break a}}while(0);l=z;return}function kO(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;g=c[b+16>>2]|0;i=c[g+96>>2]|0;if((a[g+44>>0]|0)==0?(a[g+84>>0]|0)==0:0)j=6;else {d=a[g+49>>0]|0;e=d&255;if(((e&8|0)==0?(f=a[g+89>>0]|0,(f&8)==0):0)?((e&5|0)==0?1:d<<24>>24!=f<<24>>24):0)j=6;else b=0;}if((j|0)==6)if(!i)b=18;else {b=(c[(c[(xC(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)!=0;b=~~(+h[(b?i+32|0:i+24|0)>>3]+18.0);}return b|0}function lO(b,d,e,f,g,h,i){b=b|0;d=d|0;e=e|0;f=f|0;g=+g;h=+h;i=i|0;var j=0,k=0,l=0,m=0;b=c[(c[d+(e<<2)>>2]|0)+16>>2]|0;if((a[b+44>>0]|0)==0?(a[b+84>>0]|0)==0:0)l=6;else l=3;do if((l|0)==3){j=a[b+49>>0]|0;k=j&255;if(!(k&8)){m=a[b+89>>0]|0;if((m&8)==0?((k&5|0)==0?1:j<<24>>24!=m<<24>>24):0){l=6;break}if(!(a[b+89>>0]&8)){if(k&4|0){nO(d,e,f,g,h,i);break}if(!(k&1))qa(138394,106514,1231,106566);else {pO(d,e,f,g,h,i);break}}}if((j&2)==0?(a[b+89>>0]&2)==0:0){oO(d,e,f,g,h,i);break}nO(d,e,f,g,h,i);}while(0);if((l|0)==6)mO(d,e,f,g,h,i);return}function mO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,C=0.0,D=0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;B=c[b+(e<<2)>>2]|0;n=i*.5/+(f|0);n=n>2.0?n:2.0;D=(c[((c[B>>2]&3|0)==3?B:B+48|0)+40>>2]|0)+16|0;A=c[D>>2]|0;C=+h[A+16>>3];H=+h[A+24>>3];B=c[B+16>>2]|0;m=+h[B+16>>3];E=m+C;F=+h[B+24>>3]+H;i=+h[B+56>>3];G=i+C;H=+h[B+64>>3]+H;k=!(F>=H)?-1:1;p=+h[A+96>>3];switch(qO(d[B+49>>0]|0,d[B+89>>0]|0)|0){case 65:case 32:{if(F==H)k=0-k|0;break}default:{}}Q=(p-m)*3.0;m=(p-i)*3.0;v=n*+(k|0);u=L+8|0;w=L+16|0;x=L+32|0;y=L+48|0;z=(H+F)*.5;A=L+64|0;B=L+80|0;s=L+96|0;t=L+104|0;r=0;o=0.0;i=p;n=p=(f|0))break;q=e+1|0;e=c[b+(e<<2)>>2]|0;p=i+g;n=n+g;m=m+g;o=o+v;h[L>>3]=E;h[u>>3]=F;Q=o+F;rO(M,n*.3333333333333333+E,Q);c[w>>2]=c[M>>2];c[w+4>>2]=c[M+4>>2];c[w+8>>2]=c[M+8>>2];c[w+12>>2]=c[M+12>>2];R=p+C;rO(N,R,Q);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];rO(O,R,z);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];Q=H-o;rO(J,R,Q);c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];rO(K,m*.3333333333333333+G,Q);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];h[s>>3]=G;h[t>>3]=H;k=e+16|0;if((c[(c[k>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,k=c[(c[k>>2]|0)+96>>2]|0,I=+h[(S?k+24|0:k+32|0)>>3],S=c[D>>2]|0,h[k+56>>3]=I*.5+p+ +h[S+16>>3],h[k+64>>3]=+h[S+24>>3],a[k+81>>0]=1,I>g):0)i=I+i;else i=p;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,L,7,j);e=q;r=r+1|0;}l=P;return}function nO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0.0,E=0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0.0,S=0;Q=l;l=l+16080|0;M=Q+80|0;N=Q+64|0;O=Q+48|0;P=Q+32|0;K=Q+16|0;L=Q;C=c[b+(e<<2)>>2]|0;q=g*.5/+(f|0);q=q>2.0?q:2.0;E=(c[((c[C>>2]&3|0)==3?C:C+48|0)+40>>2]|0)+16|0;m=c[E>>2]|0;H=+h[m+16>>3];D=+h[m+24>>3];C=c[C+16>>2]|0;k=+h[C+16>>3];p=+h[C+24>>3];F=k+H;G=p+D;g=+h[C+56>>3];o=+h[C+64>>3];H=g+H;I=o+D;n=!(F>=H)?-1.0:1.0;s=+h[m+80>>3]*.5;switch(qO(d[C+49>>0]|0,d[C+89>>0]|0)|0){case 15:{k=(q-g+ +h[m+96>>3])*n;break}case 38:{k=(g+q+ +h[m+88>>3])*n;break}case 41:{k=(q-k+ +h[m+96>>3])*n;break}case 48:{k=(q-k+ +h[m+96>>3])*n;break}case 58:case 57:case 51:case 47:case 37:case 14:{k=n*.3333333333333333*(k-g+ +h[m+88>>3]+ +h[m+96>>3]);break}case 73:{k=(k+q+ +h[m+88>>3])*n;break}case 83:{k=(+h[m+88>>3]+k)*n;break}case 84:{k=((k-g+ +h[m+88>>3]+ +h[m+96>>3])*.5+q)*n;break}case 85:case 75:case 74:{k=((k-g+ +h[m+88>>3]+ +h[m+96>>3])*.5+q*2.0)*n;break}default:k=0.0;}p=(s-p)*3.0;o=(s-o)*3.0;q=n*q;w=M+8|0;x=M+16|0;y=M+32|0;z=M+48|0;A=(H+F)*.5;B=M+64|0;C=M+80|0;u=M+96|0;v=M+104|0;t=0;g=s;p=s=(f|0))break;r=e+1|0;e=c[b+(e<<2)>>2]|0;o=g+i;p=p+i;n=n+i;k=k+q;h[M>>3]=F;h[w>>3]=G;s=k+F;rO(N,s,p*.3333333333333333+G);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];R=o+D;rO(O,s,R);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];rO(P,A,R);c[z>>2]=c[P>>2];c[z+4>>2]=c[P+4>>2];c[z+8>>2]=c[P+8>>2];c[z+12>>2]=c[P+12>>2];s=H-k;rO(K,s,R);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];rO(L,s,n*.3333333333333333+I);c[C>>2]=c[L>>2];c[C+4>>2]=c[L+4>>2];c[C+8>>2]=c[L+8>>2];c[C+12>>2]=c[L+12>>2];h[u>>3]=H;h[v>>3]=I;m=e+16|0;if((c[(c[m>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,m=c[(c[m>>2]|0)+96>>2]|0,J=+h[(S?m+32|0:m+24|0)>>3],S=c[E>>2]|0,h[m+64>>3]=J*.5+o+ +h[S+24>>3],h[m+56>>3]=+h[S+16>>3],a[m+81>>0]=1,J>i):0)g=J+g;else g=o;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,M,7,j);e=r;t=t+1|0;}l=Q;return}function oO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,C=0.0,D=0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;B=c[b+(e<<2)>>2]|0;n=i*.5/+(f|0);n=n>2.0?n:2.0;D=(c[((c[B>>2]&3|0)==3?B:B+48|0)+40>>2]|0)+16|0;A=c[D>>2]|0;C=+h[A+16>>3];H=+h[A+24>>3];B=c[B+16>>2]|0;m=+h[B+16>>3];E=m+C;F=+h[B+24>>3]+H;i=+h[B+56>>3];G=i+C;H=+h[B+64>>3]+H;k=!(F>=H)?-1:1;p=+h[A+88>>3];switch(qO(d[B+49>>0]|0,d[B+89>>0]|0)|0){case 67:case 12:{if(F==H)k=0-k|0;break}default:{}}Q=(m+p)*3.0;m=(i+p)*3.0;v=n*+(k|0);u=L+8|0;w=L+16|0;x=L+32|0;y=L+48|0;z=(H+F)*.5;A=L+64|0;B=L+80|0;s=L+96|0;t=L+104|0;r=0;o=0.0;i=p;n=p=(f|0))break;q=e+1|0;e=c[b+(e<<2)>>2]|0;p=i+g;n=n+g;m=m+g;o=o+v;h[L>>3]=E;h[u>>3]=F;Q=o+F;rO(M,E-n*.3333333333333333,Q);c[w>>2]=c[M>>2];c[w+4>>2]=c[M+4>>2];c[w+8>>2]=c[M+8>>2];c[w+12>>2]=c[M+12>>2];R=C-p;rO(N,R,Q);c[x>>2]=c[N>>2];c[x+4>>2]=c[N+4>>2];c[x+8>>2]=c[N+8>>2];c[x+12>>2]=c[N+12>>2];rO(O,R,z);c[y>>2]=c[O>>2];c[y+4>>2]=c[O+4>>2];c[y+8>>2]=c[O+8>>2];c[y+12>>2]=c[O+12>>2];Q=H-o;rO(J,R,Q);c[A>>2]=c[J>>2];c[A+4>>2]=c[J+4>>2];c[A+8>>2]=c[J+8>>2];c[A+12>>2]=c[J+12>>2];rO(K,G-m*.3333333333333333,Q);c[B>>2]=c[K>>2];c[B+4>>2]=c[K+4>>2];c[B+8>>2]=c[K+8>>2];c[B+12>>2]=c[K+12>>2];h[s>>3]=G;h[t>>3]=H;k=e+16|0;if((c[(c[k>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,k=c[(c[k>>2]|0)+96>>2]|0,I=+h[(S?k+24|0:k+32|0)>>3],S=c[D>>2]|0,h[k+56>>3]=I*-.5-p+ +h[S+16>>3],h[k+64>>3]=+h[S+24>>3],a[k+81>>0]=1,I>g):0)i=I+i;else i=p;dO(e,c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0,L,7,j);e=q;r=r+1|0;}l=P;return}function pO(b,e,f,g,i,j){b=b|0;e=e|0;f=f|0;g=+g;i=+i;j=j|0;var k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0.0,G=0,H=0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0;P=l;l=l+16080|0;L=P+80|0;M=P+64|0;N=P+48|0;O=P+32|0;J=P+16|0;K=P;C=c[b+(e<<2)>>2]|0;B=g*.5/+(f|0);w=(c[((c[C>>2]&3|0)==3?C:C+48|0)+40>>2]|0)+16|0;D=c[w>>2]|0;z=+h[D+16>>3];v=+h[D+24>>3];C=c[C+16>>2]|0;m=+h[C+24>>3];x=+h[C+16>>3]+z;y=m+v;n=+h[C+64>>3];z=+h[C+56>>3]+z;A=n+v;u=!(x>=z)?-1:1;o=+h[D+80>>3]*.5;C=(qO(d[C+49>>0]|0,d[C+89>>0]|0)|0)==67;m=(m+o)*3.0;n=(n+o)*3.0;B=(B>2.0?B:2.0)*+((C?0-u|0:u)|0);u=L+8|0;C=L+16|0;D=L+32|0;E=L+48|0;F=(z+x)*.5;G=L+64|0;H=L+80|0;s=L+96|0;t=L+104|0;g=o;k=0.0;m=o=(f|0))break;r=e+1|0;p=c[b+(e<<2)>>2]|0;o=g+i;m=m+i;n=n+i;k=k+B;h[L>>3]=x;h[u>>3]=y;Q=k+x;rO(M,Q,y-m*.3333333333333333);c[C>>2]=c[M>>2];c[C+4>>2]=c[M+4>>2];c[C+8>>2]=c[M+8>>2];c[C+12>>2]=c[M+12>>2];R=v-o;rO(N,Q,R);c[D>>2]=c[N>>2];c[D+4>>2]=c[N+4>>2];c[D+8>>2]=c[N+8>>2];c[D+12>>2]=c[N+12>>2];rO(O,F,R);c[E>>2]=c[O>>2];c[E+4>>2]=c[O+4>>2];c[E+8>>2]=c[O+8>>2];c[E+12>>2]=c[O+12>>2];Q=z-k;rO(J,Q,R);c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];rO(K,Q,A-n*.3333333333333333);c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];h[s>>3]=z;h[t>>3]=A;e=p+16|0;if((c[(c[e>>2]|0)+96>>2]|0)!=0?(S=(c[(c[(xC(c[((c[p>>2]&3|0)==3?p:p+48|0)+40>>2]|0)|0)+16>>2]|0)+116>>2]&1|0)==0,e=c[(c[e>>2]|0)+96>>2]|0,I=+h[(S?e+32|0:e+24|0)>>3],S=c[w>>2]|0,h[e+64>>3]=I*-.5-o+ +h[S+24>>3],h[e+56>>3]=+h[S+16>>3],a[e+81>>0]=1,I>i):0)g=I+g;else g=o;dO(p,c[((c[p>>2]&3|0)==2?p:p+-48|0)+40>>2]|0,L,7,j);e=r;q=q+1|0;}l=P;return}function qO(a,b){a=a|0;b=b|0;var d=0;d=0;while(1){if((d|0)>=8){b=-1;break}if((c[22044+(d<<2)>>2]|0)==(b|0)){b=d;break}d=d+1|0;}d=0;while(1){if((d|0)>=8){d=-1;break}if((c[22044+(d<<2)>>2]|0)==(a|0))break;d=d+1|0;}if((d|b|0)<0)d=0;else d=c[22076+(d<<5)+(b<<2)>>2]|0;return d|0}function rO(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function sO(b){b=b|0;var d=0,e=0;if((c[47203]|0)!=0|(c[47202]|0)!=0){d=b+16|0;e=c[(c[d>>2]|0)+100>>2]|0;if((e|0?(a[e+81>>0]|0)==0:0)?tO(b,1)|0:0){e=xC(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;zP(e,c[(c[d>>2]|0)+100>>2]|0);}e=c[(c[d>>2]|0)+104>>2]|0;if((e|0?(a[e+81>>0]|0)==0:0)?tO(b,0)|0:0){e=xC(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;zP(e,c[(c[d>>2]|0)+104>>2]|0);}}return}function tO(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+96|0;o=q+32|0;m=q+16|0;n=q;i=b+16|0;do if((a[(c[i>>2]|0)+112>>0]|0)!=6){e=c[47203]|0;if(!((e|0)!=0?(a[(RA(b,e)|0)>>0]|0)!=0:0)){e=c[47202]|0;if(!e){e=0;break}if(!(a[(RA(b,e)|0)>>0]|0)){e=0;break}}d=d<<24>>24==0;p=c[i>>2]|0;p=c[(d?p+104|0:p+100|0)>>2]|0;e=uO(b)|0;if(e){k=c[e>>2]|0;do if(d){if(c[k+8>>2]|0){e=c[k>>2]|0;j=+h[e>>3];g=+h[k+16>>3];e=e+8|0;f=+h[k+24>>3];break}e=c[k>>2]|0;g=+h[e>>3];f=+h[e+8>>3];e=0;while(1){if((e|0)==4)break;n=o+(e<<4)|0;i=(c[k>>2]|0)+(e<<4)|0;c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];e=e+1|0;}kP(m,o,3,.1,0,0);j=+h[m>>3];e=m+8|0;}else {d=(c[e+4>>2]|0)+-1|0;i=k+(d*48|0)|0;if(c[k+(d*48|0)+12>>2]|0){o=c[i>>2]|0;e=(c[k+(d*48|0)+4>>2]|0)+-1|0;j=+h[o+(e<<4)>>3];g=+h[k+(d*48|0)+32>>3];e=o+(e<<4)+8|0;f=+h[k+(d*48|0)+40>>3];break}m=c[i>>2]|0;d=k+(d*48|0)+4|0;e=(c[d>>2]|0)+-1|0;g=+h[m+(e<<4)>>3];f=+h[m+(e<<4)+8>>3];e=0;while(1){if((e|0)==4)break;m=o+(e<<4)|0;k=(c[i>>2]|0)+(e+-4+(c[d>>2]|0)<<4)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];e=e+1|0;}kP(n,o,3,.9,0,0);j=+h[n>>3];e=n+8|0;}while(0);r=+K(+(+h[e>>3]-f),+(j-g));r=+_O(b,c[47203]|0,-25.0,-180.0)*.017453292519943295+r;j=+_O(b,c[47202]|0,1.0,0.0)*10.0;h[p+56>>3]=j*+E(+r)+g;h[p+64>>3]=+F(+r)*j+f;a[p+81>>0]=1;e=1;}else e=0;}else e=0;while(0);l=q;return e|0}function uO(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;d=b;while(1){e=c[d+16>>2]|0;d=c[e+8>>2]|0;if(d|0)break;if(!(a[e+112>>0]|0)){g=5;break}d=c[e+116>>2]|0;}if((g|0)==5){g=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;d=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[f>>2]=g;c[f+4>>2]=d;gA(1,106579,f)|0;d=0;}l=h;return d|0}function vO(a,d,e){a=a|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0;s=l;l=l+96|0;m=s+80|0;n=s+64|0;o=s+48|0;p=s+32|0;q=s+16|0;r=s;k=b[(c[d+16>>2]|0)+136>>1]|0;d=e+16|0;wO(c[(c[d>>2]|0)+8>>2]|0,p,q);f=+h[p>>3];g=+h[q>>3];t=f-g;i=+h[p+8>>3];j=+h[q+8>>3];u=i-j;a:do if(u*u+t*t<1.0e-06){c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];}else switch(k&14){case 4:case 10:{h[n>>3]=(g+f)*.5;h[n+8>>3]=(j+i)*.5;q=c[(c[d>>2]|0)+8>>2]|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];qP(r,q,m);c[o>>2]=c[r>>2];c[o+4>>2]=c[r+4>>2];c[o+8>>2]=c[r+8>>2];c[o+12>>2]=c[r+12>>2];break a}default:{xO(o,c[(c[d>>2]|0)+8>>2]|0,p,q);break a}}while(0);c[a>>2]=c[o>>2];c[a+4>>2]=c[o+4>>2];c[a+8>>2]=c[o+8>>2];c[a+12>>2]=c[o+12>>2];l=s;return}function wO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=l;l=l+32|0;g=h+16|0;f=h;j=c[a>>2]|0;e=c[j>>2]|0;i=c[j+8>>2]|0;k=j+16|0;c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];j=j+32|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];if(!i){c[b>>2]=c[e>>2];c[b+4>>2]=c[e+4>>2];c[b+8>>2]=c[e+8>>2];c[b+12>>2]=c[e+12>>2];}else {c[b>>2]=c[g>>2];c[b+4>>2]=c[g+4>>2];c[b+8>>2]=c[g+8>>2];c[b+12>>2]=c[g+12>>2];}i=c[a>>2]|0;j=(c[a+4>>2]|0)+-1|0;e=c[i+(j*48|0)>>2]|0;a=c[i+(j*48|0)+4>>2]|0;k=c[i+(j*48|0)+12>>2]|0;b=i+(j*48|0)+16|0;c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];j=i+(j*48|0)+32|0;c[f>>2]=c[j>>2];c[f+4>>2]=c[j+4>>2];c[f+8>>2]=c[j+8>>2];c[f+12>>2]=c[j+12>>2];if(!k){k=e+(a+-1<<4)|0;c[d>>2]=c[k>>2];c[d+4>>2]=c[k+4>>2];c[d+8>>2]=c[k+8>>2];c[d+12>>2]=c[k+12>>2];}else {c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];c[d+8>>2]=c[f+8>>2];c[d+12>>2]=c[f+12>>2];}l=h;return}function xO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0;r=c[b+4>>2]|0;g=0.0;f=0;while(1){if((f|0)>=(r|0))break;l=c[b>>2]|0;k=c[l+(f*48|0)>>2]|0;l=c[l+(f*48|0)+4>>2]|0;i=3;j=0;while(1){if((i|0)>=(l|0))break;q=+h[k+(j<<4)>>3]-+h[k+(i<<4)>>3];p=+h[k+(j<<4)+8>>3]-+h[k+(i<<4)+8>>3];i=i+3|0;j=j+3|0;g=+C(+(p*p+q*q))+g;}f=f+1|0;}l=0;g=g*.5;a:while(1){if((l|0)>=(r|0)){f=15;break}k=c[b>>2]|0;j=c[k+(l*48|0)>>2]|0;k=c[k+(l*48|0)+4>>2]|0;f=3;i=0;while(1){if((f|0)>=(k|0))break;m=+h[j+(i<<4)>>3];p=+h[j+(i<<4)+8>>3];n=+h[j+(f<<4)>>3];o=+h[j+(f<<4)+8>>3];q=m-n;s=p-o;q=+C(+(s*s+q*q));if(q>=g){f=12;break a}f=f+3|0;i=i+3|0;g=g-q;}l=l+1|0;}if((f|0)==12){h[d>>3]=m;h[d+8>>3]=p;h[e>>3]=n;h[e+8>>3]=o;s=q-g;h[a>>3]=(s*m+n*g)/q;h[a+8>>3]=(s*p+o*g)/q;return}else if((f|0)==15)qa(138712,106514,1316,106641);}function yO(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;sO(b);return}function zO(b,d,e,f,g){b=b|0;d=d|0;e=+e;f=f|0;g=g|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0.0,C=0.0,D=0,G=0,H=0,I=0,J=0,K=0,L=0;J=AO(b)|0;I=c[J+4>>2]|0;K=c[J>>2]|0;H=I+-1|0;B=+h[K+(H<<6)+16>>3];C=+(I|0);D=(g|0)==2;G=(f|0)!=0;n=0;j=0.0;i=0.0;l=0.0;m=0.0;while(1){if((n|0)>=(I|0))break;b=~~+BO(+(n+-1|0),C);A=n+1|0;L=~~+BO(+(A|0),C);o=K+(n<<6)|0;m=+h[o>>3];z=K+(n<<6)+8|0;l=+h[z>>3];s=K+(n<<6)+16|0;t=+h[s>>3];u=K+(n<<6)+24|0;v=K+(n<<6)+32|0;w=K+(n<<6)+40|0;x=K+(n<<6)+48|0;y=K+(n<<6)+56|0;k=+CO(+h[K+(L<<6)+8>>3]-l,+h[K+(L<<6)>>3]-m);q=+CO(+h[K+(b<<6)+8>>3]-l,+h[K+(b<<6)>>3]-m);r=+hb[d&7](t,B,e);b=(n|0)==0;do if(b|(n|0)==(H|0))if(b){i=k+1.5707963267948966;if(!D){b=0;p=i;j=r;break}b=0;p=i;j=r;l=l-+F(+k)*r;m=m-+E(+k)*r;break}else {i=q+-1.5707963267948966;if(!D){b=0;p=i;j=r;break}b=0;p=i;j=r;l=l-+F(+q)*r;m=m-+E(+q)*r;break}else {p=k-q;p=1.5707963267948966-(p<0.0?p+6.283185307179586:p)*.5;j=+E(+p);j=j==0.0?0.0:r/j;i=k+1.5707963267948966;k=p+i;if(G|j>r*10.0){q=+BO(q+-1.5707963267948966,6.283185307179586);b=1;p=+BO(i,6.283185307179586);j=r;i=q;}else {b=0;p=k;i=k;}}while(0);h[o>>3]=m;h[z>>3]=l;h[s>>3]=t;a[u>>0]=108;h[v>>3]=i;h[w>>3]=j;c[x>>2]=b;h[y>>3]=p;n=A;}o=JK(12)|0;b=0;while(1){if((b|0)>=(I|0))break;m=+h[K+(b<<6)>>3];l=+h[K+(b<<6)+8>>3];i=+h[K+(b<<6)+32>>3];j=+h[K+(b<<6)+40>>3];L=c[K+(b<<6)+48>>2]|0;k=+h[K+(b<<6)+56>>3];DO(o,+E(+i)*j+m,+F(+i)*j+l);if(L|0)EO(m,l,j,1,i,k,f,o);b=b+1|0;}n=(g|0)==1;k=i+3.141592653589793;if(n)FO(o,m,l,j,i,k);else {DO(o,+E(+k)*j+m,+F(+k)*j+l);i=k;}b=I+-2|0;k=m;while(1){if((b|0)<=-1)break;m=+h[K+(b<<6)>>3];l=+h[K+(b<<6)+8>>3];j=+h[K+(b<<6)+40>>3];L=c[K+(b<<6)+48>>2]|0;i=+h[K+(b<<6)+32>>3]+3.141592653589793;k=+h[K+(b<<6)+56>>3]+3.141592653589793;DO(o,+E(+k)*j+m,+F(+k)*j+l);if(L|0)EO(m,l,j,0,i,k,f,o);b=b+-1|0;k=m;}if(n)FO(o,k,l,j,i,i+3.141592653589793);GO(J);return o|0}function AO(a){a=a|0;var b=0.0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0;q=l;l=l+144|0;i=q+128|0;h=q+112|0;j=q+96|0;k=q+64|0;m=q;n=q+80|0;o=HO()|0;p=c[a+4>>2]|0;f=c[a>>2]|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];IO(o,i,0.0);g=m+48|0;c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];d=0;b=0.0;a:while(1){e=d+3|0;if((e|0)>=(p|0))break;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];c[m+12>>2]=c[g+12>>2];a=1;while(1){if((a|0)==4)break;r=m+(a<<4)|0;s=f+(a+d<<4)|0;c[r>>2]=c[s>>2];c[r+4>>2]=c[s+4>>2];c[r+8>>2]=c[s+8>>2];c[r+12>>2]=c[s+12>>2];a=a+1|0;}c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];a=1;while(1){if((a|0)==21){d=e;continue a}kP(n,m,3,+(a|0)*.05,0,0);c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];c[h>>2]=c[j>>2];c[h+4>>2]=c[j+4>>2];c[h+8>>2]=c[j+8>>2];c[h+12>>2]=c[j+12>>2];c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];c[i+12>>2]=c[n+12>>2];t=+JO(h,i)+b;c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];IO(o,i,t);c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];a=a+1|0;b=t;}}KO(o);l=q;return o|0}function BO(a,b){a=+a;b=+b;var c=0.0;c=a-+A(+(a/b))*b;return +(!(a<0.0)&!(a>=b)?a:c)}function CO(a,b){a=+a;b=+b;if(!(a==0.0&b==0.0)){a=+K(+a,+b);if(!(a>=0.0))a=a+6.283185307179586;}else a=0.0;return +a}function DO(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0;e=c[a>>2]|0;f=a+4|0;if((e|0)<(c[f>>2]|0))f=c[a+8>>2]|0;else {c[f>>2]=2e3;e=a+8|0;f=MK(c[e>>2]|0,32e3)|0;c[e>>2]=f;e=c[a>>2]|0;}c[a>>2]=e+1;h[f+(e<<4)>>3]=b;h[f+(e<<4)+8>>3]=d;return}function EO(a,b,c,d,e,f,g,h){a=+a;b=+b;c=+c;d=d|0;e=+e;f=+f;g=g|0;h=h|0;var i=0.0;d=(d|0)==0;i=d?e:f;do if((g|0)==1){e=(d?f:e)-i;e=!(e<=1.7453292519943296e-03)?e:e+6.283185307179586;if(e<3.141592653589793){FO(h,a,b,c,e+i,i);break}else {DO(h,+E(+i)*c+a,+F(+i)*c+a);break}}else DO(h,+E(+i)*c+a,+F(+i)*c+a);while(0);return}function FO(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;var g=0,h=0.0;DO(a,+E(+e)*d+b,+F(+e)*d+c);a:do if(!(d==0.0)){while(1){if(!(f>e))break;f=f+-6.283185307179586;}f=e-f;while(1){if(!(f>6.283185307179586))break;f=f+-6.283185307179586;}f=f*.05263157894736842;g=1;while(1){if((g|0)==20)break a;h=e-f*+(g|0);DO(a,+E(+h)*d+b,+F(+h)*d+c);g=g+1|0;}}while(0);return}function GO(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function HO(){var a=0;a=JK(12)|0;c[a+4>>2]=0;c[a+8>>2]=2e3;c[a>>2]=JK(128e3)|0;return a|0}function IO(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;i=a+4|0;e=c[i>>2]|0;f=a+8|0;g=c[f>>2]|0;if((e|0)<(g|0))a=c[a>>2]|0;else {c[f>>2]=g<<1;e=MK(c[a>>2]|0,g<<7)|0;c[a>>2]=e;a=e;e=c[i>>2]|0;}h[a+(e<<6)>>3]=+h[b>>3];h[a+(e<<6)+8>>3]=+h[b+8>>3];c[i>>2]=e+1;h[a+(e<<6)+16>>3]=d;return}function JO(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(+C(+(d*d+c*c)))}function KO(a){a=a|0;var b=0;b=c[a+4>>2]|0;if((c[a+8>>2]|0)>(b|0))c[a>>2]=MK(c[a>>2]|0,b<<6)|0;return}function LO(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;g=k+12|0;c[g>>2]=0;h=c[d+4>>2]|0;if(!h)qa(106658,106669,203,106680);e=c[h>>2]|0;if(!e)qa(106694,106669,206,106680);f=h+8|0;if(!(c[f>>2]|0))c[f>>2]=MO(e)|0;if(!0)e=0;if(!((dT(b,d,e)|0)<<24>>24))NO(d,e);do if(e|0){f=c[g>>2]|0;b=c[15712]|0;e=c[h>>2]|0;if(!f){c[j>>2]=e;w4(b,106737,j)|0;break}else {c[i>>2]=e;c[i+4>>2]=f;w4(b,106705,i)|0;break}}while(0);j=d+32|0;c[a>>2]=c[j>>2];c[a+4>>2]=c[j+4>>2];c[a+8>>2]=c[j+8>>2];c[a+12>>2]=c[j+12>>2];l=k;return}function MO(a){a=a|0;var b=0;b=c[47301]|0;if((b|0)!=0?(c3(b,a)|0)==0:0)a=c[47310]|0;else {U1(b);c[47301]=D4(a)|0;a=u5(189204,22332,35,36,95)|0;c[47310]=a;}return a|0}function NO(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0.0,j=0,k=0.0;j=c[b+4>>2]|0;e=c[j>>2]|0;i=+h[j+16>>3];j=b+32|0;h[j>>3]=0.0;h[b+40>>3]=i*1.2;h[b+16>>3]=0.0;h[b+24>>3]=i*.1;c[b+8>>2]=0;c[b+12>>2]=0;if(j3(e,106771,4)|0)if((j3(e,106776,5)|0)!=0?(j3(e,106782,9)|0)!=0:0){g=4248;e=106792;}else {g=8344;e=106828;}else {g=6296;e=106809;}if(d|0)c[d>>2]=e;e=c[b>>2]|0;if(e|0){f=0.0;while(1){b=a[e>>0]|0;if(!(b<<24>>24))break;k=f+ +h[g+((b&255)<<3)>>3];h[j>>3]=k;e=e+1|0;f=k;}h[j>>3]=f*i;}return}function OO(a,b){a=a|0;b=b|0;return c3(c[a>>2]|0,c[b>>2]|0)|0}function PO(a){a=a|0;var b=0;b=a+108|0;c[b>>2]=0;c[a+112>>2]=32;c[a+116>>2]=-1;c[a+120>>2]=33;c[a+124>>2]=63;c[a+128>>2]=55;c[a+132>>2]=0;c[a+136>>2]=0;c[a+140>>2]=0;b=Vz(b,c[4581]|0)|0;c[a+144>>2]=b;return b|0}function QO(a,b,d){a=a|0;b=b|0;d=d|0;d=V1(1,32)|0;a=c[b>>2]|0;if(a|0)c[d>>2]=D4(a)|0;a=c[b+4>>2]|0;if(a|0)c[d+4>>2]=D4(a)|0;c[d+24>>2]=c[b+24>>2]&127;h[d+16>>3]=+h[b+16>>3];c[d+8>>2]=c[b+8>>2];return d|0}function RO(a,b,d){a=a|0;b=b|0;d=d|0;U1(c[b>>2]|0);U1(c[b+4>>2]|0);U1(b);return}function SO(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0,j=0;a=c[b>>2]|0;e=c[d>>2]|0;i=(e|0)==0;if(!a)if(i)j=5;else a=-1;else if(!i){a=s2(a,e)|0;if(!a)j=5;}else a=1;do if((j|0)==5){a=c[b+4>>2]|0;e=c[d+4>>2]|0;i=(e|0)==0;if(!a){if(!i){a=-1;break}}else {if(i){a=1;break}a=s2(a,e)|0;if(a|0)break}a=(c[b+24>>2]&127)-(c[d+24>>2]&127)|0;if(!a){g=+h[b+16>>3];f=+h[d+16>>3];if(gf&1;}}while(0);return a|0}function TO(){eb(189244)|0;return}function UO(){var a=0,b=0;b=l;l=l+16|0;a=b;eb(a|0)|0;l=b;return +(+((c[a+4>>2]|0)+(c[a>>2]|0)-(c[47311]|0)-(c[47312]|0)|0)*.016666666666666666)}function VO(a){a=a|0;var b=0,d=0;b=JK(16)|0;a=(a|0)>2?a:2;d=JK(a<<2)|0;c[b>>2]=d;c[b+12>>2]=d;c[b+8>>2]=d;c[b+4>>2]=d+(a<<2);return b|0}function WO(a){a=a|0;U1(c[a>>2]|0);U1(a);return}function XO(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+12|0;e=c[d>>2]|0;c[d>>2]=e+4;c[e>>2]=b;if((c[d>>2]|0)>>>0>=(c[a+4>>2]|0)>>>0)c[d>>2]=c[a>>2];return}function YO(a){a=a|0;var b=0,d=0,e=0;d=a+8|0;b=c[d>>2]|0;if((b|0)!=(c[a+12>>2]|0)){e=b+4|0;c[d>>2]=e;b=c[b>>2]|0;if(e>>>0>=(c[a+4>>2]|0)>>>0)c[d>>2]=c[a>>2];}else b=0;return b|0}function ZO(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=l;l=l+16|0;g=i;if(((d|0)!=0?(h=RA(b,d)|0,(h|0)!=0):0)?(a[h>>0]|0)!=0:0){d=y4(h,g,10)|0;e=(h|0)==(c[g>>2]|0)?e:(d|0)<(f|0)?f:d;}l=i;return e|0}function _O(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,h=0,i=0,j=0.0;i=l;l=l+16|0;g=i;if(((b|0)!=0&(d|0)!=0?(h=RA(b,d)|0,(h|0)!=0):0)?(a[h>>0]|0)!=0:0){j=+s5(h,g);e=(h|0)==(c[g>>2]|0)?e:j0.0)){b=+_O(a,GA(a,0,107638,0)|0,-1.0,0.0);b=b==0.0?72.0:b;}return +b}function aP(a,b,c){a=a|0;b=b|0;c=c|0;if((a|0)!=0&(b|0)!=0)c=RA(a,b)|0;return c|0}function bP(b,c,d){b=b|0;c=c|0;d=d|0;b=aP(b,c,d)|0;if((b|0)!=0?(a[b>>0]|0)!=0:0)d=b;return d|0}function cP(a,b,c){a=a|0;b=b|0;c=c|0;if(!b)a=c&255;else a=dP(RA(a,b)|0)|0;return a|0}function dP(a){a=a|0;return eP(a,0)|0}function eP(b,c){b=b|0;c=c|0;var d=0;if((b|0)!=0?(d=a[b>>0]|0,d<<24>>24!=0):0)if((c3(b,137308)|0)!=0?(c3(b,107649)|0)!=0:0)if((c3(b,107652)|0)!=0?(c3(b,107657)|0)!=0:0){if(((d<<24>>24)+-48|0)>>>0<10)c=(q5(b)|0)&255;}else c=1;else c=0;return c|0}function fP(a){a=a|0;var b=0,d=0;while(1){b=(c[a+16>>2]|0)+220|0;d=c[b>>2]|0;if(!((d|0)!=(a|0)&(d|0)!=0))break;a=c[(c[d+16>>2]|0)+220>>2]|0;if(!a){a=d;continue}c[b>>2]=a;}return a|0}function gP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;if((a|0)!=(b|0)){d=c[a+16>>2]|0;e=d+220|0;if(!(c[e>>2]|0)){c[e>>2]=a;c[d+216>>2]=1;}else a=fP(a)|0;d=c[b+16>>2]|0;e=d+220|0;if(!(c[e>>2]|0)){c[e>>2]=b;c[d+216>>2]=1;}else {d=fP(b)|0;b=d;d=c[d+16>>2]|0;}g=a+16|0;e=c[g>>2]|0;f=b+16|0;h=(c[e+120>>2]|0)>(c[d+120>>2]|0);a=h?b:a;c[(h?e:d)+220>>2]=a;e=(c[(h?f:g)>>2]|0)+216|0;c[e>>2]=(c[e>>2]|0)+(c[(c[(h?g:f)>>2]|0)+216>>2]|0);}return a|0}function hP(b){b=b|0;b=c[b+16>>2]|0;c[b+216>>2]=1;c[b+220>>2]=0;a[b+159>>0]=0;return}function iP(a,b){a=a|0;b=b|0;if((fP(a)|0)==(a|0)){a=c[a+16>>2]|0;c[a+220>>2]=b;b=(c[b+16>>2]|0)+216|0;c[b>>2]=(c[b>>2]|0)+(c[a+216>>2]|0);return}else qa(107669,107661,194,107685);}function jP(a,b){a=a|0;b=b|0;var d=0.0;b=c[(c[b+16>>2]|0)+132>>2]|0;d=+h[b+8>>3]*72.0;h[a>>3]=+h[b>>3]*72.0;h[a+8>>3]=d;return}function kP(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;g=g|0;var i=0,j=0,k=0,m=0.0,n=0,o=0,p=0;o=l;l=l+576|0;n=o;i=0;while(1){if((i|0)>(d|0))break;k=n+(i<<4)|0;j=b+(i<<4)|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];i=i+1|0;}m=1.0-e;i=1;while(1){if((i|0)>(d|0))break;j=d-i|0;k=i+-1|0;b=0;while(1){if((b|0)>(j|0))break;p=b+1|0;h[n+(i*96|0)+(b<<4)>>3]=+h[n+(k*96|0)+(p<<4)>>3]*e+ +h[n+(k*96|0)+(b<<4)>>3]*m;h[n+(i*96|0)+(b<<4)+8>>3]=+h[n+(k*96|0)+(p<<4)+8>>3]*e+ +h[n+(k*96|0)+(b<<4)+8>>3]*m;b=p;}i=i+1|0;}a:do if(f|0){i=0;while(1){if((i|0)>(d|0))break a;p=f+(i<<4)|0;k=n+(i*96|0)|0;c[p>>2]=c[k>>2];c[p+4>>2]=c[k+4>>2];c[p+8>>2]=c[k+8>>2];c[p+12>>2]=c[k+12>>2];i=i+1|0;}}while(0);b:do if(g|0){i=0;while(1){if((i|0)>(d|0))break b;p=g+(i<<4)|0;f=n+((d-i|0)*96|0)+(i<<4)|0;c[p>>2]=c[f>>2];c[p+4>>2]=c[f+4>>2];c[p+8>>2]=c[f+8>>2];c[p+12>>2]=c[f+12>>2];i=i+1|0;}}while(0);p=n+(d*96|0)|0;c[a>>2]=c[p>>2];c[a+4>>2]=c[p+4>>2];c[a+8>>2]=c[p+8>>2];c[a+12>>2]=c[p+12>>2];l=o;return}function lP(b){b=b|0;var d=0,e=0,f=0,g=0;e=0;do{d=c[47315]|0;f=d+1024|0;if((d-e|0)<1024){c[47315]=f;f=MK(c[47316]|0,f)|0;c[47316]=f;d=c[47315]|0;}else f=c[47316]|0;d=c4(f+e|0,d-e|0,b)|0;if(!d){g=6;break}e=(l2(d)|0)+e|0;d=c[47316]|0;}while((a[d+(e+-1)>>0]|0)!=10);if((g|0)==6)d=c[47316]|0;return ((e|0)>0?d:0)|0}function mP(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;do if((b|0)!=0?(a[b>>0]|0)!=0:0)if(!0){d=c[47133]|0;e=c[47318]|0;if((c[47317]|0)==(d|0))d=e;else {if(e){U1(c[e>>2]|0);U1(c[47318]|0);c[47318]=0;d=c[47133]|0;}c[47317]=d;if(!d)break;if(!(a[d>>0]|0))break;d=nP(d)|0;c[47318]=d;}if(!((a[b>>0]|0)!=47&(d|0)!=0))break;b=oP(d,c[47319]|0,b)|0;break}else ;else b=0;while(0);l=f;return b|0}function nP(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=0;f=0;g=0;b=D4(a)|0;d=0;while(1){b=A4(b,107984)|0;if(!b)break;a=(g<<2)+8|0;if(!f)a=KK(a)|0;else a=MK(d,a)|0;c[a+(g<<2)>>2]=b;f=l2(b)|0;e=e>>>0>f>>>0?e:f;f=a;g=g+1|0;b=0;d=a;}c[f+(g<<2)>>2]=0;c[47319]=e;return f|0}function oP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+16|0;e=g;h=c[47320]|0;c[47320]=W1(h,b+2+(l2(d)|0)|0)|0;while(1){b=c[a>>2]|0;if(!b){a=0;break}h=c[47320]|0;c[e>>2]=b;c[e+4>>2]=107982;c[e+8>>2]=d;m4(h,107975,e)|0;if(!(_4(c[47320]|0,4)|0)){f=4;break}else a=a+4|0;}if((f|0)==4)a=c[47320]|0;l=g;return a|0}function pP(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=(b|0)==0;f=0;while(1){h=c[d+(f<<2)>>2]|0;if(!h)break;if((!g?(a[b>>0]|0)==(a[h>>0]|0):0)?(s2(b,h)|0)==0:0)break;f=f+1|0;}return c[e+(f<<2)>>2]|0}function qP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0;z=l;l=l+80|0;x=z+16|0;y=z;u=c[b+4>>2]|0;v=c[b>>2]|0;w=d+8|0;f=0;e=-1;g=1.e+38;b=-1;while(1){if((f|0)>=(u|0))break;s=c[v+(f*48|0)>>2]|0;t=c[v+(f*48|0)+4>>2]|0;r=0;while(1){if((r|0)>=(t|0))break;q=+h[s+(r<<4)>>3]-+h[d>>3];p=+h[s+(r<<4)+8>>3]-+h[w>>3];q=p*p+q*q;A=(e|0)==-1|q>2]|0;e=e+(((e|0)==((c[v+(b*48|0)+4>>2]|0)+-1|0))<<31>>31)|0;e=e-((e|0)%3|0)|0;b=0;while(1){if((b|0)==4)break;C=b+e|0;h[x+(b<<4)>>3]=+h[f+(C<<4)>>3];h[x+(b<<4)+8>>3]=+h[f+(C<<4)+8>>3];b=b+1|0;}q=+h[d>>3];k=+h[x>>3]-q;o=+h[w>>3];p=+h[x+8>>3]-o;j=+h[x+48>>3]-q;n=+h[x+56>>3]-o;b=y+8|0;g=1.0;i=0.0;j=n*n+j*j;k=p*p+k*k;while(1){p=(g+i)*.5;kP(y,x,3,p,0,0);m=+h[y>>3];n=+h[b>>3];if(+B(+(k-j))<1.0)break;if(+B(+(g-i))<1.0e-05)break;C=k>3]=m;h[a+8>>3]=n;l=z;return}function rP(){return 0}function sP(b){b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;d=+_O(b,c[47146]|0,.75,.01);g=b+16|0;h[(c[g>>2]|0)+32>>3]=d;d=+_O(b,c[47145]|0,.5,.02);h[(c[g>>2]|0)+40>>3]=d;l=jN(bP(b,c[47147]|0,107986)|0,b)|0;c[(c[g>>2]|0)+8>>2]=l;l=RA(b,c[47154]|0)|0;d=+_O(b,c[47150]|0,14.0,1.0);e=bP(b,c[47151]|0,107994)|0;f=bP(b,c[47152]|0,137314)|0;i=(iD(l)|0)!=0;k=(WM(b)|0)==2;i=zK(b,l,(k?4:0)|(i?2:0),d,e,f)|0;c[(c[g>>2]|0)+104>>2]=i;i=c[47155]|0;if((i|0?(j=RA(b,i)|0,j|0):0)?a[j>>0]|0:0){l=(iD(j)|0)!=0;l=zK(b,j,l?2:0,d,e,f)|0;c[(c[g>>2]|0)+108>>2]=l;l=(c[(xC(b)|0)+16>>2]|0)+113|0;a[l>>0]=a[l>>0]|16;}k=(ZO(b,c[47158]|0,0,0)|0)&255;l=c[g>>2]|0;a[l+144>>0]=k;tb[c[c[(c[l+8>>2]|0)+4>>2]>>2]&127](b);return}function tP(b){b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+112|0;m=v+96|0;n=v+80|0;s=v+40|0;u=v;r=b+48|0;p=xC(c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0)|0;g=m+8|0;c[g>>2]=0;o=n+8|0;c[o>>2]=0;d=c[47182]|0;if(((d|0)!=0?(e=RA(b,d)|0,(e|0)!=0):0)?(a[e>>0]|0)!=0:0){uP(b,m);t=(iD(e)|0)!=0;i=+h[m>>3];f=c[g>>2]|0;d=c[m+12>>2]|0;e=zK(b,e,t?2:0,i,f,d)|0;t=b+16|0;c[(c[t>>2]|0)+96>>2]=e;e=(c[p+16>>2]|0)+113|0;a[e>>0]=a[e>>0]|1;e=dP(aP(b,c[47192]|0,137308)|0)|0;a[(c[t>>2]|0)+114>>0]=e;t=1;e=f;}else {t=0;d=0;i=0.0;e=0;}f=c[47183]|0;if((f|0?(j=RA(b,f)|0,j|0):0)?a[j>>0]|0:0){if(!e){uP(b,m);i=+h[m>>3];e=c[g>>2]|0;d=c[m+12>>2]|0;}g=(iD(j)|0)!=0;j=zK(b,j,g?2:0,i,e,d)|0;c[(c[b+16>>2]|0)+108>>2]=j;j=(c[p+16>>2]|0)+113|0;a[j>>0]=a[j>>0]|32;}d=c[47197]|0;if(((d|0)!=0?(k=RA(b,d)|0,(k|0)!=0):0)?(a[k>>0]|0)!=0:0){vP(b,m,n);j=(iD(k)|0)!=0;i=+h[n>>3];d=c[o>>2]|0;e=c[n+12>>2]|0;k=zK(b,k,j?2:0,i,d,e)|0;c[(c[b+16>>2]|0)+100>>2]=k;k=(c[p+16>>2]|0)+113|0;a[k>>0]=a[k>>0]|2;}else {e=0;i=0.0;d=0;}f=c[47198]|0;if((f|0?(q=RA(b,f)|0,q|0):0)?a[q>>0]|0:0){if(!d){vP(b,m,n);e=c[n+12>>2]|0;i=+h[n>>3];d=c[o>>2]|0;}o=(iD(q)|0)!=0;q=zK(b,q,o?2:0,i,d,e)|0;c[(c[b+16>>2]|0)+104>>2]=q;q=(c[p+16>>2]|0)+113|0;a[q>>0]=a[q>>0]|4;}d=QA(b,111455)|0;d=d|0?d:195059;if(a[d>>0]|0)a[(c[(c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0)+16>>2]|0)+145>>0]=1;g=b+16|0;f=(c[g>>2]|0)+16|0;e=c[((c[b>>2]&3|0)==3?b:r)+40>>2]|0;wP(s,c[(c[(c[(c[e+16>>2]|0)+8>>2]|0)+4>>2]|0)+8>>2]|0,e,d);d=s;e=f+40|0;do{c[f>>2]=c[d>>2];f=f+4|0;d=d+4|0;}while((f|0)<(e|0));if((xP(b,c[47204]|0)|0)<<24>>24)a[(c[g>>2]|0)+46>>0]=0;d=QA(b,111464)|0;d=d|0?d:195059;if(!(a[d>>0]|0))e=b+-48|0;else {e=b+-48|0;a[(c[(c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0)+16>>2]|0)+145>>0]=1;}f=(c[g>>2]|0)+56|0;e=c[((c[b>>2]&3|0)==2?b:e)+40>>2]|0;wP(u,c[(c[(c[(c[e+16>>2]|0)+8>>2]|0)+4>>2]|0)+8>>2]|0,e,d);d=u;e=f+40|0;do{c[f>>2]=c[d>>2];f=f+4|0;d=d+4|0;}while((f|0)<(e|0));if((xP(b,c[47205]|0)|0)<<24>>24)a[(c[g>>2]|0)+86>>0]=0;l=v;return t|0}function uP(a,b){a=a|0;b=b|0;h[b>>3]=+_O(a,c[47179]|0,14.0,1.0);c[b+8>>2]=bP(a,c[47180]|0,107994)|0;c[b+12>>2]=bP(a,c[47181]|0,137314)|0;return}function vP(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+8|0;if(!(c[e>>2]|0))uP(a,b);h[d>>3]=+_O(a,c[47199]|0,+h[b>>3],1.0);c[d+8>>2]=bP(a,c[47200]|0,c[e>>2]|0)|0;c[d+12>>2]=bP(a,c[47201]|0,c[b+12>>2]|0)|0;return}function wP(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+128|0;k=m+80|0;h=m+40|0;g=m;if((f|0)!=0?(j=R2(f,58)|0,(j|0)!=0):0){a[j>>0]=0;i=j+1|0;xb[d&31](h,e,f,i);e=k;g=h;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0));a[j>>0]=58;f=i;}else {xb[d&31](g,e,f,0);e=k;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0))}e=b;g=k;d=e+36|0;do{c[e>>2]=c[g>>2];e=e+4|0;g=g+4|0;}while((e|0)<(d|0));c[b+36>>2]=f;l=m;return}function xP(b,c){b=b|0;c=c|0;var d=0;if(((c|0)!=0?(d=RA(b,c)|0,(d|0)!=0):0)?(a[d>>0]|0)!=0:0)b=(dP(d)|0)<<24>>24==0&1;else b=0;return b|0}function yP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;k=l;l=l+32|0;i=k;j=c[b+8>>2]|0;d=c[b+4>>2]|0;d=(c[b+44>>2]|0)+((O((d|0)>1?d+-1|0:0,j)|0)<<4)|0;e=i+16|0;c[e>>2]=c[d>>2];c[e+4>>2]=c[d+4>>2];c[e+8>>2]=c[d+8>>2];c[e+12>>2]=c[d+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];f=i+8|0;g=i+24|0;b=1;while(1){if((b|0)>=(j|0))break;m=d+(b<<4)|0;o=+h[m>>3];h[i>>3]=+h[(+h[i>>3]>3];n=+h[m+8>>3];h[f>>3]=+h[(+h[f>>3]>3];h[e>>3]=+h[(+h[e>>3]>o?e:m)>>3];h[g>>3]=+h[(+h[g>>3]>n?e:m)+8>>3];b=b+1|0;}c[a>>2]=c[i>>2];c[a+4>>2]=c[i+4>>2];c[a+8>>2]=c[i+8>>2];c[a+12>>2]=c[i+12>>2];c[a+16>>2]=c[i+16>>2];c[a+20>>2]=c[i+20>>2];c[a+24>>2]=c[i+24>>2];c[a+28>>2]=c[i+28>>2];l=k;return}function zP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=l;l=l+64|0;g=d+32|0;e=d;f=c[a+16>>2]|0;a=f+16|0;f=c[f+116>>2]&1;c[g>>2]=c[a>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[g+16>>2]=c[a+16>>2];c[g+20>>2]=c[a+20>>2];c[g+24>>2]=c[a+24>>2];c[g+28>>2]=c[a+28>>2];AP(e,g,b,f);c[a>>2]=c[e>>2];c[a+4>>2]=c[e+4>>2];c[a+8>>2]=c[e+8>>2];c[a+12>>2]=c[e+12>>2];c[a+16>>2]=c[e+16>>2];c[a+20>>2]=c[e+20>>2];c[a+24>>2]=c[e+24>>2];c[a+28>>2]=c[e+28>>2];l=d;return}function AP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0.0;g=+h[d+56>>3];l=+h[d+64>>3];j=e<<24>>24==0;k=+h[d+24>>3];i=+h[d+32>>3];m=(j?k:i)*.5;f=g-m;g=m+g;if(f<+h[b>>3])h[b>>3]=f;e=b+16|0;if(g>+h[e>>3])h[e>>3]=g;g=(j?i:k)*.5;f=l-g;g=g+l;e=b+8|0;if(f<+h[e>>3])h[e>>3]=f;e=b+24|0;if(g>+h[e>>3])h[e>>3]=g;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];return}function BP(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0.0,O=0.0,P=0.0;L=l;l=l+448|0;H=L+416|0;t=L+384|0;u=L+304|0;K=L+256|0;G=L+192|0;B=L+144|0;C=L+96|0;d=L+400|0;e=L+368|0;f=L+352|0;g=L+336|0;v=L+288|0;w=L+224|0;x=L+160|0;y=L+112|0;z=L+64|0;A=L+32|0;I=L;J=b+16|0;if((tB(b)|0)==0?(c[(c[J>>2]|0)+180>>2]|0)==0:0){CP(d,0.0,0.0);c[K>>2]=c[d>>2];c[K+4>>2]=c[d+4>>2];c[K+8>>2]=c[d+8>>2];c[K+12>>2]=c[d+12>>2];K=K+16|0;CP(e,0.0,0.0);c[K>>2]=c[e>>2];c[K+4>>2]=c[e+4>>2];c[K+8>>2]=c[e+8>>2];c[K+12>>2]=c[e+12>>2];}else {CP(f,2147483647.0,2147483647.0);c[K>>2]=c[f>>2];c[K+4>>2]=c[f+4>>2];c[K+8>>2]=c[f+8>>2];c[K+12>>2]=c[f+12>>2];F=K+16|0;CP(g,-2147483647.0,-2147483647.0);c[F>>2]=c[g>>2];c[F+4>>2]=c[g+4>>2];c[F+8>>2]=c[g+8>>2];c[F+12>>2]=c[g+12>>2];o=C+8|0;p=u+16|0;D=K+8|0;q=u+8|0;E=K+24|0;r=u+24|0;s=B+8|0;n=jC(b)|0;while(1){if(!n)break;jP(B,n);d=n+16|0;m=c[d>>2]|0;h[C>>3]=(+h[m+96>>3]+ +h[m+88>>3])*.5;h[o>>3]=+h[m+80>>3]*.5;c[t>>2]=c[B>>2];c[t+4>>2]=c[B+4>>2];c[t+8>>2]=c[B+8>>2];c[t+12>>2]=c[B+12>>2];c[H>>2]=c[C>>2];c[H+4>>2]=c[C+4>>2];c[H+8>>2]=c[C+8>>2];c[H+12>>2]=c[C+12>>2];DP(u,t,H);c[t>>2]=c[B>>2];c[t+4>>2]=c[B+4>>2];c[t+8>>2]=c[B+8>>2];c[t+12>>2]=c[B+12>>2];c[H>>2]=c[C>>2];c[H+4>>2]=c[C+4>>2];c[H+8>>2]=c[C+8>>2];c[H+12>>2]=c[C+12>>2];EP(v,t,H);c[p>>2]=c[v>>2];c[p+4>>2]=c[v+4>>2];c[p+8>>2]=c[v+8>>2];c[p+12>>2]=c[v+12>>2];h[K>>3]=+h[(+h[K>>3]<+h[u>>3]?K:u)>>3];h[D>>3]=+h[(+h[D>>3]<+h[q>>3]?K:u)+8>>3];h[F>>3]=+h[(+h[F>>3]>+h[p>>3]?K:u)+16>>3];h[E>>3]=+h[(+h[E>>3]>+h[r>>3]?K:u)+24>>3];d=c[(c[d>>2]|0)+108>>2]|0;if(d|0?a[d+81>>0]|0:0){m=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(w,H,d,m);c[K>>2]=c[w>>2];c[K+4>>2]=c[w+4>>2];c[K+8>>2]=c[w+8>>2];c[K+12>>2]=c[w+12>>2];c[K+16>>2]=c[w+16>>2];c[K+20>>2]=c[w+20>>2];c[K+24>>2]=c[w+24>>2];c[K+28>>2]=c[w+28>>2];}m=XA(b,n)|0;while(1){if(!m)break;k=m+16|0;d=c[k>>2]|0;j=d+8|0;e=c[j>>2]|0;if(e|0){i=0;while(1){if((i|0)<(c[e+4>>2]|0))g=0;else break;while(1){f=c[e>>2]|0;if((g|0)>=(c[f+(i*48|0)+4>>2]|0))break;e=(c[f+(i*48|0)>>2]|0)+(g<<4)|0;c[B>>2]=c[e>>2];c[B+4>>2]=c[e+4>>2];c[B+8>>2]=c[e+8>>2];c[B+12>>2]=c[e+12>>2];N=+h[B>>3];h[K>>3]=+h[(+h[K>>3]>3];M=+h[s>>3];h[D>>3]=+h[(+h[D>>3]>3];h[F>>3]=+h[(+h[F>>3]>N?F:B)>>3];h[E>>3]=+h[(+h[E>>3]>M?F:B)+8>>3];g=g+1|0;e=c[j>>2]|0;}i=i+1|0;}e=c[d+96>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(x,H,e,d);c[K>>2]=c[x>>2];c[K+4>>2]=c[x+4>>2];c[K+8>>2]=c[x+8>>2];c[K+12>>2]=c[x+12>>2];c[K+16>>2]=c[x+16>>2];c[K+20>>2]=c[x+20>>2];c[K+24>>2]=c[x+24>>2];c[K+28>>2]=c[x+28>>2];d=c[k>>2]|0;}e=c[d+100>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(y,H,e,d);c[K>>2]=c[y>>2];c[K+4>>2]=c[y+4>>2];c[K+8>>2]=c[y+8>>2];c[K+12>>2]=c[y+12>>2];c[K+16>>2]=c[y+16>>2];c[K+20>>2]=c[y+20>>2];c[K+24>>2]=c[y+24>>2];c[K+28>>2]=c[y+28>>2];d=c[k>>2]|0;}e=c[d+104>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(z,H,e,d);c[K>>2]=c[z>>2];c[K+4>>2]=c[z+4>>2];c[K+8>>2]=c[z+8>>2];c[K+12>>2]=c[z+12>>2];c[K+16>>2]=c[z+16>>2];c[K+20>>2]=c[z+20>>2];c[K+24>>2]=c[z+24>>2];c[K+28>>2]=c[z+28>>2];d=c[k>>2]|0;}d=c[d+108>>2]|0;if(d|0?a[d+81>>0]|0:0){k=c[(c[J>>2]|0)+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(A,H,d,k);c[K>>2]=c[A>>2];c[K+4>>2]=c[A+4>>2];c[K+8>>2]=c[A+8>>2];c[K+12>>2]=c[A+12>>2];c[K+16>>2]=c[A+16>>2];c[K+20>>2]=c[A+20>>2];c[K+24>>2]=c[A+24>>2];c[K+28>>2]=c[A+28>>2];}}m=ZA(b,m)|0;}n=kC(b,n)|0;}d=c[J>>2]|0;f=c[d+180>>2]|0;g=d+184|0;i=G+8|0;j=G+16|0;k=G+24|0;e=1;while(1){if((e|0)>(f|0))break;P=+h[(c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0)+16>>3];h[G>>3]=P;C=c[(c[(c[g>>2]|0)+(e<<2)>>2]|0)+16>>2]|0;O=+h[C+24>>3];h[i>>3]=O;M=+h[C+32>>3];h[j>>3]=M;N=+h[C+40>>3];h[k>>3]=N;h[K>>3]=+h[(+h[K>>3]>3];h[D>>3]=+h[(+h[D>>3]>3];h[F>>3]=+h[(+h[F>>3]>M?K:G)+16>>3];h[E>>3]=+h[(+h[E>>3]>N?K:G)+24>>3];e=e+1|0;}e=c[d+12>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){d=c[d+116>>2]&1;c[H>>2]=c[K>>2];c[H+4>>2]=c[K+4>>2];c[H+8>>2]=c[K+8>>2];c[H+12>>2]=c[K+12>>2];c[H+16>>2]=c[K+16>>2];c[H+20>>2]=c[K+20>>2];c[H+24>>2]=c[K+24>>2];c[H+28>>2]=c[K+28>>2];AP(I,H,e,d);c[K>>2]=c[I>>2];c[K+4>>2]=c[I+4>>2];c[K+8>>2]=c[I+8>>2];c[K+12>>2]=c[I+12>>2];c[K+16>>2]=c[I+16>>2];c[K+20>>2]=c[I+20>>2];c[K+24>>2]=c[I+24>>2];c[K+28>>2]=c[I+28>>2];d=c[J>>2]|0;}J=d+16|0;c[J>>2]=c[K>>2];c[J+4>>2]=c[K+4>>2];c[J+8>>2]=c[K+8>>2];c[J+12>>2]=c[K+12>>2];c[J+16>>2]=c[K+16>>2];c[J+20>>2]=c[K+20>>2];c[J+24>>2]=c[K+24>>2];c[J+28>>2]=c[K+28>>2];}l=L;return}function CP(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function DP(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function EP(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function FP(a){a=a|0;if((c[a+60>>2]|0)==(a|0))a=1;else a=(j3(KB(a)|0,108006,7)|0)==0&1;return a|0}function GP(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a:do if(!e)switch(IC(b)|0){case 0:{e=GA(a,0,c,195059)|0;break a}case 1:{e=GA(a,1,c,195059)|0;break a}case 2:{e=GA(a,2,c,195059)|0;break a}default:{e=0;break a}}while(0);KA(b,e,d)|0;return e|0}function HP(d){d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+144|0;g=k;i=IP(d)|0;h=Vz(23592,c[4581]|0)|0;j=ND(d,108014,1)|0;TC(j,137483,280,1)|0;kA(g,128,k+16|0);e=jC(d)|0;while(1){if(!e)break;a:do if(!(a[(c[e+16>>2]|0)+118>>0]|0)){f=XA(d,e)|0;while(1){if(!f)break a;JP(f,j,g,h,i);f=ZA(d,f)|0;}}while(0);e=kC(d,e)|0;}oA(g);Rz(h)|0;f=tB(j)|0;e=jC(j)|0;while(1){if(!e)break;h=kC(j,e)|0;wC(d,e)|0;e=h;}sB(j)|0;if(f|0){j=(c[d+16>>2]|0)+136|0;b[j>>1]=b[j>>1]|1;}Rz(i)|0;l=k;return f|0}function IP(a){a=a|0;var b=0;b=Vz(23628,c[4581]|0)|0;SP(a,b);return b|0}function JP(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+48|0;q=t+32|0;p=t+24|0;s=t+16|0;r=t+8|0;k=t;n=c[b>>2]&3;m=c[((n|0)==3?b:b+48|0)+40>>2]|0;n=c[((n|0)==2?b:b+-48|0)+40>>2]|0;do if(!(a[(c[n+16>>2]|0)+118>>0]|0)){if(!(Q2(KB(m)|0,108006,7)|0))o=KP(g,KB(m)|0)|0;else o=0;if(!(Q2(KB(n)|0,108006,7)|0))i=KP(g,KB(n)|0)|0;else i=0;h=(o|0)!=0;j=(i|0)!=0;if(h|j){if((o|0)==(i|0)){r=KB(m)|0;s=KB(m)|0;c[k>>2]=r;c[k+4>>2]=s;gA(0,108029,k)|0;break}g=LP(f,b)|0;if(g|0){MP(b,c[g+16>>2]|0,c[g+20>>2]|0)|0;break}if(!j)if(!(HC(o,n)|0)){OP(f,m,n,MP(b,NP(m,o,e,d)|0,n)|0);break}else {r=KB(n)|0;s=KB(o)|0;c[q>>2]=r;c[q+4>>2]=s;gA(0,108184,q)|0;break}if(!h)if(!(HC(i,m)|0)){OP(f,m,n,MP(b,m,NP(n,i,e,d)|0)|0);break}else {r=KB(m)|0;s=KB(i)|0;c[p>>2]=r;c[p+4>>2]=s;gA(0,108147,p)|0;break}if(HC(i,o)|0){q=KB(o)|0;s=KB(i)|0;c[r>>2]=q;c[r+4>>2]=s;gA(0,108067,r)|0;break}if(!(HC(o,i)|0)){s=NP(m,o,e,d)|0;OP(f,m,n,MP(b,s,NP(n,i,e,d)|0)|0);break}else {q=KB(i)|0;r=KB(o)|0;c[s>>2]=q;c[s+4>>2]=r;gA(0,108107,s)|0;break}}}while(0);l=t;return}function KP(a,b){a=a|0;b=b|0;a=nb[c[a>>2]&63](a,b,512)|0;if(!a)a=0;else a=c[a+12>>2]|0;return a|0}function LP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d;f=c[b>>2]&3;c[e>>2]=c[((f|0)==3?b:b+48|0)+40>>2];c[e+4>>2]=c[((f|0)==2?b:b+-48|0)+40>>2];b=nb[c[a>>2]&63](a,e,512)|0;l=d;return b|0}function MP(a,b,c){a=a|0;b=b|0;c=c|0;c=iB(xC(b)|0,b,c,0,1)|0;TC(c,137460,176,1)|0;UA(a,c)|0;return c|0}function NP(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=l;l=l+112|0;g=k;j=k+4|0;nA(e,108221)|0;i=c[47321]|0;c[47321]=i+1;c[g>>2]=i;m4(j,137395,g)|0;nA(e,j)|0;j=e+4|0;g=c[j>>2]|0;i=e+8|0;if(g>>>0>=(c[i>>2]|0)>>>0){lA(e,1)|0;g=c[j>>2]|0;}c[j>>2]=g+1;a[g>>0]=58;nA(e,KB(d)|0)|0;h=yC(d)|0;g=c[j>>2]|0;if(g>>>0>=(c[i>>2]|0)>>>0){lA(e,1)|0;g=c[j>>2]|0;}a[g>>0]=0;e=c[e>>2]|0;c[j>>2]=e;j=tC(h,e,1)|0;TC(j,137447,304,1)|0;a[(c[j+16>>2]|0)+118>>0]=1;oC(d,j,1)|0;oC(f,b,1)|0;f=xC(j)|0;c[47154]=GP(f,j,108224,195059,c[47154]|0)|0;f=xC(j)|0;c[47157]=GP(f,j,141082,134335,c[47157]|0)|0;f=xC(j)|0;c[47147]=GP(f,j,108230,108236,c[47147]|0)|0;l=k;return j|0}function OP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;f=l;l=l+32|0;g=f;n=g+8|0;c[n>>2]=b;m=g+12|0;c[m>>2]=d;o=c[e>>2]&3;i=e+48|0;j=g+16|0;c[j>>2]=c[((o|0)==3?e:i)+40>>2];k=e+-48|0;h=g+20|0;c[h>>2]=c[((o|0)==2?e:k)+40>>2];nb[c[a>>2]&63](a,g,1)|0;c[n>>2]=d;c[m>>2]=b;d=c[e>>2]&3;c[j>>2]=c[((d|0)==2?e:k)+40>>2];c[h>>2]=c[((d|0)==3?e:i)+40>>2];nb[c[a>>2]&63](a,g,1)|0;l=f;return}function PP(a,b,d){a=a|0;b=b|0;d=d|0;d=JK(24)|0;c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];c[d+16>>2]=c[b+16>>2];c[d+20>>2]=c[b+20>>2];return d|0}function QP(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function RP(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if(a>>>0>=e>>>0)if(a>>>0>e>>>0)a=1;else {b=c[b+4>>2]|0;d=c[d+4>>2]|0;return (b>>>0>>0?-1:b>>>0>d>>>0&1)|0}else a=-1;return a|0}function SP(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+16|0;g=h;f=a+16|0;e=1;while(1){a=c[f>>2]|0;if((e|0)>(c[a+180>>2]|0))break;a=c[(c[a+184>>2]|0)+(e<<2)>>2]|0;d=KB(a)|0;if(!(nb[c[b>>2]&63](b,d,512)|0)){i=JK(16)|0;c[i+8>>2]=d;c[i+12>>2]=a;nb[c[b>>2]&63](b,i,1)|0;}else {c[g>>2]=d;gA(0,108240,g)|0;}SP(a,b);e=e+1|0;}l=h;return}function TP(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function UP(a){a=a|0;var b=0,c=0,d=0;d=ND(a,108014,1)|0;TC(d,137483,280,1)|0;b=jC(a)|0;while(1){if(!b)break;c=XA(a,b)|0;while(1){if(!c)break;VP(c,d);c=ZA(a,c)|0;}b=kC(a,b)|0;}b=jC(d)|0;while(1){if(!b)break;c=kC(d,b)|0;WP(b);wC(a,b)|0;b=c;}sB(d)|0;return}function VP(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b>>2]&3;f=c[((e|0)==3?b:b+48|0)+40>>2]|0;e=c[((e|0)==2?b:b+-48|0)+40>>2]|0;if(!((a[(c[f+16>>2]|0)+118>>0]|0)==0?!(a[(c[e+16>>2]|0)+118>>0]|0):0)){f=XP(f,d)|0;e=MP(b,f,XP(e,d)|0)|0;f=c[b+16>>2]|0;d=f+8|0;e=c[e+16>>2]|0;c[e+8>>2]=c[d>>2];c[d>>2]=0;d=f+96|0;c[e+96>>2]=c[d>>2];c[d>>2]=0;d=f+108|0;c[e+108>>2]=c[d>>2];c[d>>2]=0;d=f+100|0;c[e+100>>2]=c[d>>2];c[d>>2]=0;f=f+104|0;c[e+104>>2]=c[f>>2];c[f>>2]=0;YP(b);}return}function WP(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;b=c[e>>2]|0;d=c[b+132>>2]|0;if(d){U1(d);b=c[e>>2]|0;}d=c[b+8>>2]|0;if(d){tb[c[(c[d+4>>2]|0)+4>>2]&127](a);b=c[e>>2]|0;}CK(c[b+104>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);VC(a,137447)|0;return}function XP(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=xC(b)|0;a:do if(a[(c[b+16>>2]|0)+118>>0]|0){oC(d,b,1)|0;b=R2(KB(b)|0,58)|0;if(!b)qa(111208,107661,1225,108292);d=b+1|0;b=tC(f,d,0)|0;if(!b){b=tC(f,d,1)|0;TC(b,137447,304,1)|0;d=LA(f,1,0)|0;while(1){if(!d)break a;g=RA(b,d)|0;e=c[d+12>>2]|0;if((g|0)!=(e|0))KA(b,d,e)|0;d=LA(f,1,d)|0;}}}while(0);return b|0}function YP(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+144>>2]|0);ZP(a);CK(c[(c[b>>2]|0)+96>>2]|0);CK(c[(c[b>>2]|0)+108>>2]|0);CK(c[(c[b>>2]|0)+100>>2]|0);CK(c[(c[b>>2]|0)+104>>2]|0);VC(a,137460)|0;return}function ZP(a){a=a|0;var b=0,d=0,e=0;e=a+16|0;a=c[e>>2]|0;b=c[a+8>>2]|0;if(b){d=0;while(1){a=c[b>>2]|0;if((d|0)>=(c[b+4>>2]|0))break;U1(c[a+(d*48|0)>>2]|0);d=d+1|0;b=c[(c[e>>2]|0)+8>>2]|0;}U1(a);U1(c[(c[e>>2]|0)+8>>2]|0);a=c[e>>2]|0;}c[a+8>>2]=0;return}function _P(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=GA(a,b,c,0)|0;if(!e)e=GA(a,b,c,d)|0;return e|0}function $P(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+32|0;i=o;h=o+8|0;j=o+16|0;m=R2(b,59)|0;n=d+4|0;e=c[n>>2]|0;k=d+8|0;if(e>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;e=c[n>>2]|0;}c[n>>2]=e+1;a[e>>0]=38;if(((m|0)!=0?(f=m-b|0,(f+-2|0)>>>0<=6):0)?(i4(j,b,f)|0,a[j+f>>0]=0,c[h>>2]=j,g=u5(h,23664,252,8,96)|0,(g|0)!=0):0){c[i>>2]=c[g+4>>2];m4(j,137395,i)|0;b=c[n>>2]|0;if(b>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;b=c[n>>2]|0;}c[n>>2]=b+1;a[b>>0]=35;nA(d,j)|0;b=c[n>>2]|0;if(b>>>0>=(c[k>>2]|0)>>>0){lA(d,1)|0;b=c[n>>2]|0;}c[n>>2]=b+1;a[b>>0]=59;b=m+1|0;}l=o;return b|0}function aQ(a,b){a=a|0;b=b|0;return s2(c[a>>2]|0,c[b>>2]|0)|0}function bQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+1072|0;k=q+8|0;j=q;i=q+16|0;o=q+24|0;c[i>>2]=b;if((c[47322]|0)!=(d|0)){c[47322]=d;a[194958]=0;}kA(o,1024,q+40|0);p=o+4|0;n=o+8|0;while(1){f=b+1|0;c[i>>2]=f;e=a[b>>0]|0;if(!(e<<24>>24))break;do if((e&255)<192)if(e<<24>>24==38){f=dQ(i)|0;if(!f)e=38;else {if(f>>>0<127){e=f&255;break}b=c[p>>2]|0;e=b>>>0>=(c[n>>2]|0)>>>0;if(f>>>0<2047){if(e){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>6|192;e=(f&63|128)&255;break}if(e){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>12|224;b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=f>>>6&63|128;e=(f&63|128)&255;}}else {h=0;m=9;}else if((e&255)>=224)if((e&255)>=240)if((e&255)<248){h=3;m=9;}else {if(!(a[194958]|0)){c[j>>2]=KB(d)|0;gA(0,109707,j)|0;a[194958]=1;}h=-1;e=cQ(e,o)|0;m=9;}else {h=2;m=9;}else {h=1;m=9;}while(0);do if((m|0)==9){m=0;g=0;while(1){if((g|0)>=(h|0)){m=34;break}if((a[f>>0]&-64)<<24>>24!=-128)break;b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=e;g=g+1|0;e=a[f>>0]|0;f=f+1|0;}if((m|0)==34){m=0;c[i>>2]=f;break}c[i>>2]=f;if(!(a[194958]|0)){g=KB(d)|0;c[k>>2]=h+1;c[k+4>>2]=g;gA(0,109828,k)|0;a[194958]=1;}e=cQ(e,o)|0;}while(0);b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}c[p>>2]=b+1;a[b>>0]=e;b=c[i>>2]|0;}b=c[p>>2]|0;if(b>>>0>=(c[n>>2]|0)>>>0){lA(o,1)|0;b=c[p>>2]|0;}a[b>>0]=0;n=c[o>>2]|0;c[p>>2]=n;p=D4(n)|0;oA(o);l=q;return p|0}function cQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=l;l=l+16|0;g=j;a[g>>0]=b;a[g+1>>0]=0;g=eQ(g)|0;h=d+4|0;i=d+8|0;e=l2(g)|0;f=g;while(1){if((e|0)<=1)break;b=c[h>>2]|0;if(b>>>0>=(c[i>>2]|0)>>>0){lA(d,1)|0;b=c[h>>2]|0;}k=a[f>>0]|0;c[h>>2]=b+1;a[b>>0]=k;e=e+-1|0;f=f+1|0;}k=a[f>>0]|0;U1(g);l=j;return k|0}function dQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+32|0;h=i;d=i+8|0;e=c[b>>2]|0;a:do if((a[e>>0]|0)!=35){c[h>>2]=d;g=0;b:while(1){if((g|0)>=8){d=0;break a}f=a[e+g>>0]|0;switch(f<<24>>24){case 0:{d=0;break a}case 59:break b;default:{}}a[d>>0]=f;d=d+1|0;g=g+1|0;}a[d>>0]=0;d=u5(h,23664,252,8,96)|0;if(!d)d=0;else {e=e+(g+1)|0;d=c[d+4>>2]|0;}}else {h=a[e+1>>0]|0;d=h&255;c:do if((h|32)<<24>>24==120){h=0;g=2;while(1){if((g|0)>=8){f=h;break c}f=a[e+g>>0]|0;d=f&255;if((f+-65&255)>=6)if((f+-97&255)>=6)if((f+-48&255)<10)f=-48;else {f=h;break c}else f=-87;else f=-55;d=f+d|0;h=d+(h<<4)|0;g=g+1|0;}}else {f=0;g=1;while(1){if((g|0)>=8)break c;h=a[e+g>>0]|0;d=h&255;if((h+-48&255)>=10)break c;f=(f*10|0)+-48+d|0;g=g+1|0;}}while(0);d=(d|0)==59;e=d?e+(g+1)|0:e;d=d?f:0;}while(0);c[b>>2]=e;l=i;return d|0}function eQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+1056|0;g=k;i=k+8|0;c[g>>2]=b;kA(i,1024,k+24|0);j=i+4|0;h=i+8|0;while(1){c[g>>2]=b+1;d=a[b>>0]|0;if(!(d<<24>>24))break;b=d&255;if(d<<24>>24==38){b=dQ(g)|0;if(!b){b=38;f=6;}else f=5;}else f=5;do if((f|0)==5){f=0;if(b>>>0<127)f=6;else {d=c[j>>2]|0;e=d>>>0>=(c[h>>2]|0)>>>0;if(b>>>0<2047){if(e){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>6|192;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}b=b&63|128;break}if(e){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>12|224;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}c[j>>2]=d+1;a[d>>0]=b>>>6&63|128;d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}b=b&63|128;}}while(0);if((f|0)==6){d=c[j>>2]|0;if(d>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;d=c[j>>2]|0;}}c[j>>2]=d+1;a[d>>0]=b;b=c[g>>2]|0;}b=c[j>>2]|0;if(b>>>0>=(c[h>>2]|0)>>>0){lA(i,1)|0;b=c[j>>2]|0;}a[b>>0]=0;h=c[i>>2]|0;c[j>>2]=h;j=D4(h)|0;oA(i);l=k;return j|0}function fQ(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+1040|0;g=i;kA(g,1024,i+16|0);h=g+4|0;f=g+8|0;while(1){d=b+1|0;e=a[b>>0]|0;if(!(e<<24>>24))break;if((e&255)<127){b=c[h>>2]|0;if(b>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;b=c[h>>2]|0;}c[h>>2]=b+1;a[b>>0]=e;b=d;continue}else {e=a[d>>0]&63|e<<6&255;d=c[h>>2]|0;if(d>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;d=c[h>>2]|0;}c[h>>2]=d+1;a[d>>0]=e;b=b+2|0;continue}}b=c[h>>2]|0;if(b>>>0>=(c[f>>2]|0)>>>0){lA(g,1)|0;b=c[h>>2]|0;}a[b>>0]=0;f=c[g>>2]|0;c[h>>2]=f;h=D4(f)|0;oA(g);l=i;return h|0}function gQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+80|0;e=n+48|0;d=n+32|0;f=n+64|0;g=n+16|0;i=n;j=b+16|0;k=a+16|0;m=c[k>>2]|0;if(((+h[j>>3]>=+h[m+48>>3]?+h[m+64>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=+h[m+56>>3]:0)?+h[m+72>>3]>=+h[b+8>>3]:0){m=m+16|0;c[d>>2]=c[j>>2];c[d+4>>2]=c[j+4>>2];c[d+8>>2]=c[j+8>>2];c[d+12>>2]=c[j+12>>2];c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];hQ(g,d,e);c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];c[e+8>>2]=c[g+8>>2];c[e+12>>2]=c[g+12>>2];DP(i,d,e);c[f>>2]=a;c[f+4>>2]=0;d=c[(c[(c[(c[k>>2]|0)+8>>2]|0)+4>>2]|0)+12>>2]|0;c[e>>2]=c[i>>2];c[e+4>>2]=c[i+4>>2];c[e+8>>2]=c[i+8>>2];c[e+12>>2]=c[i+12>>2];d=lb[d&127](f,e)|0;}else d=0;l=n;return d|0}function hQ(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function iQ(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;e=l;l=l+80|0;j=e+64|0;k=e+48|0;m=e;n=e+32|0;g=e+16|0;h[m>>3]=+h[a+24>>3]*.5;h[m+8>>3]=+h[a+32>>3]*.5;a=a+56|0;c[k>>2]=c[a>>2];c[k+4>>2]=c[a+4>>2];c[k+8>>2]=c[a+8>>2];c[k+12>>2]=c[a+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];DP(n,k,j);i=+h[n>>3];f=+h[n+8>>3];c[k>>2]=c[a>>2];c[k+4>>2]=c[a+4>>2];c[k+8>>2]=c[a+8>>2];c[k+12>>2]=c[a+12>>2];c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];EP(g,k,j);d=+h[g+8>>3];if((+h[b+16>>3]>=i?+h[g>>3]>=+h[b>>3]:0)?+h[b+24>>3]>=f:0)a=d>=+h[b+8>>3]&1;else a=0;l=e;return a|0}function jQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+80|0;k=n+48|0;j=n;h=a+16|0;a=c[h>>2]|0;i=c[a+8>>2]|0;a:do if((i|0)!=0?(g=i+8|0,c[j>>2]=c[g>>2],c[j+4>>2]=c[g+4>>2],c[j+8>>2]=c[g+8>>2],c[j+12>>2]=c[g+12>>2],c[j+16>>2]=c[g+16>>2],c[j+20>>2]=c[g+20>>2],c[j+24>>2]=c[g+24>>2],c[j+28>>2]=c[g+28>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(kQ(j,k)|0)!=0):0){d=i+4|0;a=0;while(1){if((a|0)>=(c[d>>2]|0))break;e=j;f=(c[i>>2]|0)+(a*48|0)|0;g=e+48|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[k+16>>2]=c[b+16>>2];c[k+20>>2]=c[b+20>>2];c[k+24>>2]=c[b+24>>2];c[k+28>>2]=c[b+28>>2];if(!((lQ(j,k)|0)<<24>>24))a=a+1|0;else {a=1;break a}}a=c[h>>2]|0;m=7;}else m=7;while(0);do if((m|0)==7){a=c[a+96>>2]|0;if(a|0?(c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(iQ(a,k)|0)<<24>>24):0){a=1;break}a=0;}while(0);l=n;return a|0}function kQ(a,b){a=a|0;b=b|0;if((+h[a+16>>3]>=+h[b>>3]?+h[b+16>>3]>=+h[a>>3]:0)?+h[a+24>>3]>=+h[b+8>>3]:0)a=+h[b+24>>3]>=+h[a+8>>3]&1;else a=0;return a|0}function lQ(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+96|0;k=n+64|0;j=n+48|0;i=n+32|0;f=n+16|0;g=n;m=a+4|0;d=c[m>>2]|0;if(!d)qa(109937,107661,1637,109945);e=c[a>>2]|0;c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];c[g+8>>2]=c[e+8>>2];c[g+12>>2]=c[e+12>>2];e=1;while(1){if((e|0)>=(d|0)){h=7;break}d=(c[a>>2]|0)+(e<<4)|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];c[i>>2]=c[d>>2];c[i+4>>2]=c[d+4>>2];c[i+8>>2]=c[d+8>>2];c[i+12>>2]=c[d+12>>2];c[j>>2]=c[g>>2];c[j+4>>2]=c[g+4>>2];c[j+8>>2]=c[g+8>>2];c[j+12>>2]=c[g+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[k+16>>2]=c[b+16>>2];c[k+20>>2]=c[b+20>>2];c[k+24>>2]=c[b+24>>2];c[k+28>>2]=c[b+28>>2];if((iK(i,j,k)|0)!=-1){d=1;break};c[g>>2]=c[f>>2];c[g+4>>2]=c[f+4>>2];c[g+8>>2]=c[f+8>>2];c[g+12>>2]=c[f+12>>2];e=e+1|0;d=c[m>>2]|0;}do if((h|0)==7){d=c[a+8>>2]|0;if(d|0?(g=a+16|0,h=c[a>>2]|0,c[i>>2]=c[g>>2],c[i+4>>2]=c[g+4>>2],c[i+8>>2]=c[g+8>>2],c[i+12>>2]=c[g+12>>2],c[j>>2]=c[h>>2],c[j+4>>2]=c[h+4>>2],c[j+8>>2]=c[h+8>>2],c[j+12>>2]=c[h+12>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(mQ(i,j,d,k)|0)<<24>>24):0){d=1;break}d=c[a+12>>2]|0;if(d|0?(h=a+32|0,m=(c[a>>2]|0)+((c[m>>2]|0)+-1<<4)|0,c[i>>2]=c[h>>2],c[i+4>>2]=c[h+4>>2],c[i+8>>2]=c[h+8>>2],c[i+12>>2]=c[h+12>>2],c[j>>2]=c[m>>2],c[j+4>>2]=c[m+4>>2],c[j+8>>2]=c[m+8>>2],c[j+12>>2]=c[m+12>>2],c[k>>2]=c[b>>2],c[k+4>>2]=c[b+4>>2],c[k+8>>2]=c[b+8>>2],c[k+12>>2]=c[b+12>>2],c[k+16>>2]=c[b+16>>2],c[k+20>>2]=c[b+20>>2],c[k+24>>2]=c[b+24>>2],c[k+28>>2]=c[b+28>>2],(mQ(i,j,d,k)|0)<<24>>24):0){d=1;break}d=0;}while(0);l=n;return d|0}function mQ(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0;m=l;l=l+160|0;g=m+144|0;f=m+128|0;n=m+96|0;i=m+64|0;j=m+32|0;k=m;o=+h[e+16>>3];c[f>>2]=c[a>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];YH(n,f,g,1.0,d);if(((o>=+h[n>>3]?(c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(i,f,g,1.0,d),+h[i+16>>3]>=+h[e>>3]):0)?(o=+h[e+24>>3],c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(j,f,g,1.0,d),o>=+h[j+8>>3]):0)?(c[f>>2]=c[a>>2],c[f+4>>2]=c[a+4>>2],c[f+8>>2]=c[a+8>>2],c[f+12>>2]=c[a+12>>2],c[g>>2]=c[b>>2],c[g+4>>2]=c[b+4>>2],c[g+8>>2]=c[b+8>>2],c[g+12>>2]=c[b+12>>2],YH(k,f,g,1.0,d),+h[k+24>>3]>=+h[e+8>>3]):0)f=1;else f=0;l=m;return f|0}function nQ(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;g=l;l=l+16|0;f=g;a:do if((b|0)!=0?(e=a[b>>0]|0,e<<24>>24!=0):0){do switch(e<<24>>24|0){case 48:{d=2;break a}case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:{d=10;break a}case 67:case 99:{e=b+1|0;if(!(c3(e,109960)|0)){d=4;break a}if(!(c3(e,109966)|0)){d=12;break a}break}case 70:case 102:{if(!(c3(b+1|0,109974)|0)){d=2;break a}break}case 76:case 108:{if(!(c3(b+1|0,109979)|0)){d=2;break a}break}case 78:case 110:{e=b+1|0;if(!(c3(e,109983)|0)){d=0;break a}if(!(c3(e,109987)|0)){d=2;break a}break}case 79:case 111:{if(!(c3(b+1|0,109989)|0)){d=8;break a}break}case 80:case 112:{if(!(c3(b+1|0,109994)|0)){d=6;break a}break}case 83:case 115:{if(!(c3(b+1|0,110002)|0)){d=10;break a}break}case 84:case 116:{if(!(c3(b+1|0,110008)|0)){d=10;break a}break}case 89:case 121:{if(!(c3(b+1|0,110012)|0)){d=10;break a}break}default:{}}while(0);c[f>>2]=b;gA(0,110015,f)|0;}while(0);l=g;return d|0}function oQ(d,f){d=d|0;f=f|0;var g=0;g=QA(d,110056)|0;if(g)if(!(a[g>>0]|0))f=0;else f=nQ(g,f)|0;d=(c[d+16>>2]|0)+136|0;b[d>>1]=f|e[d>>1];return}function pQ(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0.0,p=0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0;v=l;l=l+32|0;p=v+16|0;r=v;t=e&1;u=e&2;a:do if((c|0)==2){s=+h[a+16>>3];f=+h[a>>3];j=+h[a+24>>3];i=+h[a+8>>3];f=f-(s-f);h[p>>3]=f;h[r>>3]=s;i=i-(j-i);h[p+8>>3]=i;h[r+8>>3]=j;}else {g=+h[a>>3];h[r>>3]=g;h[p>>3]=g;j=+h[a+8>>3];m=r+8|0;h[m>>3]=j;n=p+8|0;h[n>>3]=j;e=0;f=g;i=j;while(1){if((e|0)>=(c|0)){s=g;break a}w=a+(e<<4)|0;q=+h[w>>3];k=+h[(q>3];h[p>>3]=k;s=+h[a+(e<<4)+8>>3];o=+h[(s>3];h[n>>3]=o;q=+h[(q>g?w:r)>>3];h[r>>3]=q;s=+h[(s>j?w:r)+8>>3];h[m>>3]=s;e=e+1|0;f=k;i=o;g=q;j=s;}}while(0);g=(s-f)*.5;q=g+f;o=(j-i)*.5;k=o+i;if(!t){f=j-k;j=d;i=+F(+j);j=+E(+j);if(!u){g=i*f-k;f=-k-o*i;}else {f=i*f;g=k-f;f=f+k;}h[b+8>>3]=g;h[b+24>>3]=f;d=j*(s-q);h[b>>3]=q-d;h[b+16>>3]=d+q;}else {d=+C(+(o*o+g*g));h[b+8>>3]=u|0?k:-k;h[b>>3]=q;h[b+16>>3]=d*.25;h[b+24>>3]=d;}l=v;return}function qQ(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0;e=a+16|0;f=c[e>>2]|0;if(!(b<<24>>24)){d=+h[f+32>>3]*36.0;h[f+88>>3]=d;a=f+40|0;}else {d=+h[f+40>>3]*36.0;h[f+88>>3]=d;a=f+32|0;}h[f+96>>3]=d;h[(c[e>>2]|0)+80>>3]=+h[a>>3]*72.0;return} -function Tl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+32|0;j=n+8|0;f=n+4|0;g=n;d=c[b>>2]&3;e=c[((d|0)==3?b:b+48|0)+40>>2]|0;k=(c[(c[e+16>>2]|0)+232>>2]|0)+-1|0;a=c[(c[a+16>>2]|0)+196>>2]|0;h=c[a+(k<<6)+4>>2]|0;a=c[a+(k<<6)>>2]|0;k=j+8|0;c[k>>2]=-1;c[j>>2]=-1;m=j+12|0;c[m>>2]=a;i=j+4|0;c[i>>2]=a;Vl(e,c[((d|0)==2?b:b+-48|0)+40>>2]|0,f,g);f=c[f>>2]|0;g=c[g>>2]|0;d=0;e=a;b=-1;while(1){if((d|0)>=(e|0))break;e=e+-1|0;Wl(c[h+(d<<2)>>2]|0,j,f,g);if((d|0)!=(e|0))Wl(c[h+(e<<2)>>2]|0,j,f,g);a=c[i>>2]|0;b=c[j>>2]|0;if((a-b|0)<2)break;else d=d+1|0;}if((b|0)>(a|0))a=(c[m>>2]|0)+(c[k>>2]|0)|0;else a=a+b|0;l=n;return (a+1|0)/2|0|0}function Ul(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;g=a+16|0;f=c[(c[g>>2]|0)+196>>2]|0;e=f+(b<<6)|0;f=c[f+(b<<6)+4>>2]|0;if(!f)f=KK((c[e>>2]<<2)+8|0)|0;else f=MK(f,(c[e>>2]<<2)+8|0)|0;e=c[(c[g>>2]|0)+196>>2]|0;c[e+(b<<6)+4>>2]=f;e=c[e+(b<<6)>>2]|0;while(1){if((e|0)<=(d|0))break;h=e+-1|0;i=c[f+(h<<2)>>2]|0;c[f+(e<<2)>>2]=i;i=(c[i+16>>2]|0)+236|0;c[i>>2]=(c[i>>2]|0)+1;e=h;}h=sh(a)|0;i=f+(d<<2)|0;c[i>>2]=h;h=c[h+16>>2]|0;c[h+236>>2]=d;c[h+232>>2]=b;g=(c[(c[g>>2]|0)+196>>2]|0)+(b<<6)|0;h=(c[g>>2]|0)+1|0;c[g>>2]=h;c[f+(h<<2)>>2]=0;return c[i>>2]|0}function Vl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a=c[(c[a+16>>2]|0)+236>>2]|0;b=c[(c[b+16>>2]|0)+236>>2]|0;f=(a|0)>(b|0);c[d>>2]=f?b:a;c[e>>2]=f?a:b;return}function Wl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;h=m+4|0;g=m;b=c[b+16>>2]|0;do if((a[b+156>>0]|0)==1){k=c[b+236>>2]|0;if(c[b+176>>2]|0){i=c[b+180>>2]|0;b=0;g=0;h=0;while(1){j=c[i+(h<<2)>>2]|0;if(!j)break;n=c[(c[(c[((c[j>>2]&3|0)==2?j:j+-48|0)+40>>2]|0)+16>>2]|0)+236>>2]|0;j=(n|0)>(e|0);b=j?((n|0)<(f|0)?b:1):b;g=j?g:1;h=h+1|0;}if(g<<24>>24!=0&b<<24>>24==0){c[d>>2]=k+1;break}if(!(g<<24>>24==0&b<<24>>24!=0))break;c[d+4>>2]=k+-1;break}if((c[b+184>>2]|0)!=2)qa(88397,88417,63,88424);i=c[b+180>>2]|0;n=c[i>>2]|0;i=c[i+4>>2]|0;Vl(c[((c[n>>2]&3|0)==2?n:n+-48|0)+40>>2]|0,c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0,h,g);i=c[g>>2]|0;if((i|0)<=(e|0)){c[d>>2]=k;c[d+8>>2]=k;break}b=c[h>>2]|0;if((b|0)>=(f|0)){c[d+4>>2]=k;c[d+12>>2]=k;break}g=(b|0)<(e|0);h=(i|0)>(f|0);if(!(h&g)){if(!(!g?!((i|0)<(f|0)&(b|0)==(e|0)):0))c[d+8>>2]=k;if(!h?!((i|0)==(f|0)&(b|0)>(e|0)):0)break;c[d+12>>2]=k;}}while(0);l=m;return}function Xl(a){a=a|0;c[47134]=1;pm(a);c[47134]=0;return}function Yl(a){a=a|0;c[47134]=2;pm(a);c[47134]=0;return}function Zl(a){a=a|0;var b=0;TC(a,137447,304,1)|0;sP(a);b=JK((e[(c[(xC(a)|0)+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[a+16>>2]|0)+132>>2]=b;qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);return}function _l(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0;s=l;l=l+64|0;j=s+48|0;o=s+40|0;k=s+24|0;i=s+8|0;q=s+56|0;m=s;do if((b|0)!=0?(r=e+16|0,p=c[(c[r>>2]|0)+132>>2]|0,g=RA(e,b)|0,(a[g>>0]|0)!=0):0){a[q>>0]=0;b=p+8|0;if((c[47137]|0)>2?(c[i>>2]=p,c[i+4>>2]=b,c[i+8>>2]=p+16,c[i+12>>2]=q,(b5(g,88535,i)|0)>2):0){a[(c[r>>2]|0)+119>>0]=1;g=c[47137]|0;a:do if(+h[23293]>0.0){b=0;while(1){if((b|0)>=(g|0))break a;o=p+(b<<3)|0;h[o>>3]=+h[o>>3]/+h[23293];b=b+1|0;}}while(0);if((g|0)>3)Fn(e,f,3);if((a[q>>0]|0)!=33){if(!d){b=1;break}if(!((dP(RA(e,d)|0)|0)<<24>>24)){b=1;break}}a[(c[r>>2]|0)+119>>0]=3;b=1;break}c[k>>2]=p;c[k+4>>2]=b;c[k+8>>2]=q;if((b5(g,101749,k)|0)<=1){c[j>>2]=KB(e)|0;c[j+4>>2]=g;gA(1,88549,j)|0;b=0;break}a[(c[r>>2]|0)+119>>0]=1;g=c[47137]|0;b:do if(+h[23293]>0.0){b=0;while(1){if((b|0)>=(g|0))break b;k=p+(b<<3)|0;h[k>>3]=+h[k>>3]/+h[23293];b=b+1|0;}}while(0);do if((g|0)>2){b=c[47171]|0;if((b|0?(n=RA(e,b)|0,n|0):0)?(c[o>>2]=m,(b5(n,101209,o)|0)==1):0){u=+h[23293];t=+h[m>>3];h[p+16>>3]=u>0.0?t/u:t;Fn(e,f,3);break}Gn(e,f);}while(0);if((a[q>>0]|0)!=33){if(!d){b=1;break}if(!((dP(RA(e,d)|0)|0)<<24>>24)){b=1;break}}a[(c[r>>2]|0)+119>>0]=3;b=1;}else b=0;while(0);l=s;return b|0}function $l(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}am(a);return}function am(a){a=a|0;if((c[47134]|0)!=0|(c[46795]|0)<0)Dn(a);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function bm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;m=q+32|0;o=q;k=GA(b,0,102637,0)|0;e=GA(b,0,102671,0)|0;p=(eP(QA(b,88593)|0,0)|0)<<24>>24!=0;if(!e)e=GA(b,0,102671,195059)|0;Cn(b)|0;n=b+16|0;i=0;while(1){j=c[(c[(c[n>>2]|0)+152>>2]|0)+(i<<2)>>2]|0;if(!j){f=12;break}g=j+16|0;f=c[g>>2]|0;if(!(a[f+119>>0]|0)){if(Q2(KB(j)|0,108006,7)|0){f=8;break}f=c[g>>2]|0;}f=c[f+108>>2]|0;if(f|0)cm(j,f,102633);i=i+1|0;}a:do if((f|0)==8){p=KB(j)|0;e=KB(b)|0;c[m>>2]=p;c[m+4>>2]=e;gA(1,88605,m)|0;e=-1;}else if((f|0)==12){dm(b,k,e);j=em(b)|0;e=c[(c[n>>2]|0)+8>>2]|0;if(!(c[e+88>>2]|0))e=0;else {c[e+84>>2]=0;e=1;}g=(d|0)!=0;i=(e|0)!=0;if(!(i|g&(c[47134]|0)==1^1)?(or(b)|0)!=0:0){f=c[(c[n>>2]|0)+12>>2]|0;if(!f)f=1;else {a[f+81>>0]=0;f=1;}}else f=0;BP(b);if(i){d=(c[n>>2]|0)+16|0;nI(o,b);c[d>>2]=c[o>>2];c[d+4>>2]=c[o+4>>2];c[d+8>>2]=c[o+8>>2];c[d+12>>2]=c[o+12>>2];c[d+16>>2]=c[o+16>>2];c[d+20>>2]=c[o+20>>2];c[d+24>>2]=c[o+24>>2];c[d+28>>2]=c[o+28>>2];}if(!g){c[47138]=1;f=jC(b)|0;while(1){if(!f)break a;p=c[f+16>>2]|0;o=c[p+132>>2]|0;h[p+16>>3]=+h[o>>3]*72.0;h[p+24>>3]=+h[o+8>>3]*72.0;f=kC(b,f)|0;}}do if(!(p|i)){p=c[n>>2]|0;if(!(+h[p+16>>3]!=0.0)?!(+h[p+24>>3]!=0.0):0)break;an(b);}while(0);if(!((j|0)!=0&(f|(_m(b)|0)<<24>>24!=0))){if((j|0)==2){c[47138]=1;break}}else fm(b);Zm(b,0);}while(0);l=q;return e|0}function cm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0;k=l;l=l+48|0;j=k+32|0;f=k+24|0;g=k+16|0;i=k;b=QA(b,e)|0;if(b|0?(c[j>>2]=f,c[j+4>>2]=g,(b5(b,105503,j)|0)==2):0){j=d+56|0;im(i,+h[f>>3],+h[g>>3]);c[j>>2]=c[i>>2];c[j+4>>2]=c[i+4>>2];c[j+8>>2]=c[i+8>>2];c[j+12>>2]=c[i+12>>2];a[d+81>>0]=1;}l=k;return}function dm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+48|0;k=m+32|0;f=m+24|0;g=m+16|0;i=m;j=b+16|0;if((d|0?(c[(c[j>>2]|0)+12>>2]|0)!=0:0)?(n=RA(b,d)|0,c[k>>2]=f,c[k+4>>2]=g,(b5(n,105503,k)|0)==2):0){n=(c[(c[j>>2]|0)+12>>2]|0)+56|0;im(i,+h[f>>3],+h[g>>3]);c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];a[(c[(c[j>>2]|0)+12>>2]|0)+81>>0]=1;}a:do if(e|0){f=OD(b)|0;while(1){if(!f)break a;jm(f,b,d,e);f=PD(f)|0;}}while(0);l=m;return}function em(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(uB(a)|0){f=GA(a,2,102623,0)|0;if(!((f|0)==0|(c[47134]|0)<2)){b=0;e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;g=b+((gm(f,d)|0)!=0&1)|0;d=ZA(a,d)|0;b=g;}e=kC(a,e)|0;}if(b){b=(b|0)==(uB(a)|0);b=b?2:1;}else b=0;}else b=0;}else b=2;return b|0}function fm(a){a=a|0;var b=0,d=0,e=0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;ZP(b);e=b+16|0;CK(c[(c[e>>2]|0)+96>>2]|0);CK(c[(c[e>>2]|0)+108>>2]|0);CK(c[(c[e>>2]|0)+100>>2]|0);CK(c[(c[e>>2]|0)+104>>2]|0);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function gm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;B=l;l=l+96|0;z=B+72|0;x=B+56|0;A=B+48|0;y=B+32|0;w=B+16|0;r=B+88|0;s=B+8|0;t=B;u=B+84|0;v=B+80|0;b=RA(d,b)|0;do if(a[b>>0]|0){HH(d,u,v);q=1;f=0;e=0;j=0.0;i=0.0;k=0.0;g=0.0;a:while(1){c[w>>2]=s;c[w+4>>2]=t;c[w+8>>2]=r;if((b5(b,88642,w)|0)==2){p=1;b=b+(c[r>>2]|0)|0;i=+h[s>>3];g=+h[t>>3];}else p=e;c[y>>2]=s;c[y+4>>2]=t;c[y+8>>2]=r;if((b5(b,88654,y)|0)==2){o=1;b=b+(c[r>>2]|0)|0;j=+h[s>>3];k=+h[t>>3];}else o=f;m=hm(b)|0;if(!((m|0)>3&((m|0)%3|0|0)==1)){e=8;break}n=KK(m<<4)|0;e=n;f=m;while(1){if(!f)break;c[x>>2]=s;c[x+4>>2]=t;c[x+8>>2]=r;if((b5(b,88724,x)|0)<2){e=13;break a}C=b+(c[r>>2]|0)|0;h[e>>3]=+h[s>>3];h[e+8>>3]=+h[t>>3];e=e+16|0;f=f+-1|0;b=C;}while(1){e=a[b>>0]|0;f=b+1|0;if(!(S2(e<<24>>24)|0))break;else b=f;}C=e<<24>>24==0;b=C?b:f;q=C?0:q;f=cO(d,m)|0;if(p|0){c[f+8>>2]=c[u>>2];h[f+16>>3]=i;h[f+24>>3]=g;}if(o|0){c[f+12>>2]=c[v>>2];h[f+32>>3]=j;h[f+40>>3]=k;}e=0;while(1){if((e|0)>=(m|0))break;C=(c[f>>2]|0)+(e<<4)|0;D=n+(e<<4)|0;c[C>>2]=c[D>>2];c[C+4>>2]=c[D+4>>2];c[C+8>>2]=c[D+8>>2];c[C+12>>2]=c[D+12>>2];e=e+1|0;}U1(n);if(!q){e=26;break}else {f=o;e=p;}}if((e|0)==8){ZP(d);if(a[193771]|0){b=0;break}a[193771]=1;D=KB(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;b=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;c[A>>2]=D;c[A+4>>2]=b;gA(0,88667,A)|0;b=0;break}else if((e|0)==13){if(!(a[193771]|0)){a[193771]=1;C=KB(c[((c[d>>2]&3|0)==3?d:d+48|0)+40>>2]|0)|0;D=KB(c[((c[d>>2]&3|0)==2?d:d+-48|0)+40>>2]|0)|0;c[z>>2]=C;c[z+4>>2]=D;gA(0,88734,z)|0;}U1(n);ZP(d);b=0;break}else if((e|0)==26){f=d+16|0;b=c[f>>2]|0;e=c[b+96>>2]|0;if(e){cm(d,e,102637);b=c[f>>2]|0;}e=c[b+108>>2]|0;if(e){cm(d,e,102633);b=c[f>>2]|0;}e=c[b+100>>2]|0;if(e){cm(d,e,102640);b=c[f>>2]|0;}b=c[b+104>>2]|0;if(!b){b=1;break}cm(d,b,102648);b=1;break}}else b=0;while(0);l=B;return b|0}function hm(b){b=b|0;var c=0,d=0;d=0;do{while(1){c=a[b>>0]|0;if(!(S2(c&255)|0))break;else b=b+1|0;}a:do if(!(c<<24>>24))c=0;else {d=d+1|0;while(1){if(!(c<<24>>24)){c=0;break a}if(c<<24>>24==59|(S2(c&255)|0)!=0)break a;c=b+1|0;b=c;c=a[c>>0]|0;}}while(0)}while((S2(c&255)|0)!=0);return d|0}function im(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function jm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+32|0;f=h;if((Q2(KB(a)|0,108006,7)|0)==0?(km(a,e,f)|0)!=0:0){TC(a,137483,280,1)|0;i=(c[a+16>>2]|0)+16|0;c[i>>2]=c[f>>2];c[i+4>>2]=c[f+4>>2];c[i+8>>2]=c[f+8>>2];c[i+12>>2]=c[f+12>>2];c[i+16>>2]=c[f+16>>2];c[i+20>>2]=c[f+20>>2];c[i+24>>2]=c[f+24>>2];c[i+28>>2]=c[f+28>>2];lm(b,a);dm(a,d,e);}else g=4;a:do if((g|0)==4){a=OD(a)|0;while(1){if(!a)break a;jm(a,b,d,e);a=PD(a)|0;}}while(0);l=h;return}function km(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0;i=l;l=l+48|0;j=i+32|0;g=i;k=RA(a,b)|0;a=g+8|0;b=g+24|0;c[j>>2]=g;c[j+4>>2]=a;c[j+8>>2]=g+16;c[j+12>>2]=b;if((b5(k,88782,j)|0)==4){e=+h[a>>3];f=+h[b>>3];if(e>f){h[a>>3]=f;h[b>>3]=e;};c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[d+16>>2]=c[g+16>>2];c[d+20>>2]=c[g+20>>2];c[d+24>>2]=c[g+24>>2];c[d+28>>2]=c[g+28>>2];a=1;}else a=0;l=i;return a|0}function lm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+16|0;d=c[e>>2]|0;g=d+180|0;a=c[g>>2]|0;f=a+1|0;c[g>>2]=f;d=c[d+184>>2]|0;if(!d)a=JK((a<<2)+8|0)|0;else a=LK(d,a+2|0,4,f)|0;c[(c[e>>2]|0)+184>>2]=a;c[a+(f<<2)>>2]=b;uK(b);return}function mm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+48|0;m=n+8|0;k=n;i=n+16|0;j=n+12|0;h=QA(b,88798)|0;do if((h|0)!=0?(g=a[h>>0]|0,g<<24>>24!=0):0){g=g&255;if(!(b3(g)|0))if((e|0)==2|(g+-48|0)>>>0<10)e=h;else break;else {if(!(Q2(h,88804,4)|0)){e=0;break}if(!(Q2(h,105511,7)|0)){e=1;break}if(Q2(h,88809,6)|0)if((e|0)==2)e=h;else break;else e=h+6|0;}if(!(((d[e>>0]|0)+-48|0)>>>0<10?(c[k>>2]=j,(b5(e,99933,k)|0)>=1):0)){k=X4()|0;k=(db(0)|0)^k;c[j>>2]=k;c[m>>2]=k;m4(i,99933,m)|0;SA(b,88798,i)|0;}c[f>>2]=c[j>>2];e=2;}while(0);l=n;return e|0}function nm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f+4|0;c[e>>2]=1;d=mm(a,d,e)|0;if((d|0)!=2&(c[46796]|0)!=0)gA(0,88816,f)|0;if((d|0)==1)om(a,b);z5(c[e>>2]|0);l=f;return d|0}function om(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0,k=0,l=0.0;g=+(d|0);i=6.283185307179586/g;e=jC(b)|0;f=0.0;while(1){if(!e)break;l=+E(+f)*g;j=c[e+16>>2]|0;k=c[j+132>>2]|0;h[k>>3]=l;h[k+8>>3]=+F(+f)*g;a[j+119>>0]=1;if((c[47137]|0)>2)Gn(e,d);e=kC(b,e)|0;f=f+i;}return}function pm(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0;r=l;l=l+80|0;d=r+24|0;n=r+32|0;k=r;p=r+28|0;m=r+64|0;q=+h[23293];do if(c[47134]|0){h[23293]=72.0;qm(b);rm(b);if((bm(b,1)|0)<0){gA(3,88864,d)|0;break}else {cM(b,0);f=32;break}}else {o=eP(QA(b,88593)|0,0)|0;h[23293]=+$O(b);qm(b);g=sm(b)|0;Nq(b,k,0)|0;i=tm(b)|0;j=mH(b,0,n)|0;d=lH(b,-1,8)|0;c[46795]=d;e=(d|0)<0;do if(!j){if((g|0)!=0&e){c[46795]=8;c[n+16>>2]=2;f=11;break}c[n+16>>2]=2;if((d|0)<=-1){um(b,g,i);Qq(b,k)|0;rm(b);if(!(o<<24>>24)){fn(b);break}else {vm(b);break}}else f=11;}else if(e){c[46795]=8;f=11;}else f=11;while(0);if((f|0)==11){j=sG(b,p,88892,m)|0;d=c[p>>2]|0;do if((d|0)<=1){um(b,g,i);Qq(b,k)|0;if(!(o<<24>>24)){fn(b);break}else {vm(b);break}}else {f=o<<24>>24==0;e=0;while(1){if((e|0)>=(d|0))break;d=c[j+(e<<2)>>2]|0;KG(d)|0;um(d,g,i);Qq(d,k)|0;oQ(d,2);if(f)fn(d);else vm(d);e=e+1|0;d=c[p>>2]|0;}if(!(a[m>>0]|0))e=0;else {e=JK(d)|0;a[e>>0]=1;d=c[p>>2]|0;}c[n+8>>2]=c[46795];c[n+20>>2]=e;c[n+12>>2]=1;iH(d,j,b,n)|0;U1(e);}while(0);BP(b);rm(b);d=0;while(1){if((d|0)>=(c[p>>2]|0))break;n=c[j+(d<<2)>>2]|0;Dn(n);VC(n,137483)|0;wC(b,n)|0;d=d+1|0;}U1(j);}cM(b,o<<24>>24==0&1);f=32;}while(0);if((f|0)==32)h[23293]=q;l=r;return}function qm(a){a=a|0;var d=0,e=0,f=0,g=0;oQ(a,2);f=ZO(a,GA(a,0,91368,0)|0,2,2)|0;d=(ZO(a,GA(a,0,91374,0)|0,f,2)|0)&65535;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=d;d=c[(c[a+60>>2]|0)+16>>2]|0;g=d+176|0;e=b[g>>1]|0;e=(e&65535)<10?e:10;b[g>>1]=e;e=e&65535;c[47137]=e;b[d+178>>1]=(f|0)<(e|0)?f:e;Fm(a);return}function rm(a){a=a|0;var b=0,d=0,e=0,f=0;f=l;l=l+1040|0;e=f;d=f+8|0;a:do if((c[47137]|0)>2&(c[47171]|0)!=0){b=jC(a)|0;while(1){if(!b)break a;h[e>>3]=+h[(c[(c[b+16>>2]|0)+132>>2]|0)+16>>3]*72.0;m4(d,101209,e)|0;KA(b,c[47171]|0,d)|0;b=kC(a,b)|0;}}while(0);l=f;return}function sm(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;d=QA(b,89577)|0;a:do if(!d)b=1;else {switch(a[d>>0]|0){case 0:{b=1;break a}case 75:{if(!(s2(d,89582)|0)){b=0;break a}break}case 109:{if(!(s2(d,89585)|0)){b=1;break a}break}case 104:{if(!(s2(d,89591)|0)){b=2;break a}break}default:{}}b=KB(b)|0;c[e>>2]=d;c[e+4>>2]=b;gA(0,89596,e)|0;b=1;}while(0);l=f;return b|0}function tm(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+32|0;g=h+16|0;f=h+8|0;e=h;d=QA(b,89360)|0;a:do if(!d)b=0;else {switch(a[d>>0]|0){case 0:{b=0;break a}case 99:{if(!(s2(d,89366)|0)){b=1;break a}break}case 115:{if(!(s2(d,89374)|0)){b=2;break a}if(!(s2(d,89381)|0)){b=0;break a}break}case 109:{if(!(s2(d,89391)|0)){if(GA(b,2,92493,0)|0){b=3;break a}c[e>>2]=KB(b)|0;gA(0,89395,e)|0;gA(3,89458,f)|0;b=0;break a}break}default:{}}b=KB(b)|0;c[g>>2]=d;c[g+4>>2]=b;gA(0,89515,g)|0;b=0;}while(0);l=h;return b|0}function um(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=QA(a,91061)|0;if(!e)if((b|0)==1)e=200;else e=(tB(a)|0)*100|0;else e=q5(e)|0;c[47136]=e;e=wn(a,b)|0;do if(!((e|0)<2|(c[47136]|0)<0))if(!b){xm(a,e,d);break}else {wm(a,e,b,d,c[47137]|0);break}while(0);return}function vm(a){a=a|0;BP(a);Zm(a,1);return}function wm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+64|0;r=u+40|0;o=u+24|0;n=u;p=u+48|0;t=u+44|0;q=(d|0)==2;i=nm(a,b,q?0:2)|0;j=Em(a)|0;k=j|4;s=KK(f<<2)|0;c[s>>2]=KK(O(b<<3,f)|0)|0;g=c[47137]|0;f=1;while(1){if((f|0)>=(g|0))break;c[s+(f<<2)>>2]=(c[s>>2]|0)+((O(f,b)|0)<<3);f=f+1|0;}g=(i|0)==0;f=g?k:j;if(0);n=Am(a,b,p,d,e,t)|0;if(0);if((d|0)!=1){m=+_O(a,GA(a,0,89279,0)|0,0.0,-1797693134862315708145274.0e284);if(q){f=Br(n,b,c[p>>2]|0,s,c[t>>2]|0,c[47137]|0,f,e,c[47136]|0,m)|0;g=12;}else g=14;}else {f=on(n,b,c[p>>2]|0,s,c[t>>2]|0,c[47137]|0,f,e,c[47136]|0)|0;g=12;}if((g|0)==12)if((f|0)<0)gA(3,89289,r)|0;else g=14;a:do if((g|0)==14){g=jC(a)|0;while(1){if(!g)break a;k=c[g+16>>2]|0;i=c[k+120>>2]|0;j=c[47137]|0;k=k+132|0;f=0;while(1){if((f|0)>=(j|0))break;h[(c[k>>2]|0)+(f<<3)>>3]=+h[(c[s+(f<<2)>>2]|0)+(i<<3)>>3];f=f+1|0;}g=kC(a,g)|0;}}while(0);as(n);U1(c[s>>2]|0);U1(s);U1(c[t>>2]|0);l=u;return}function xm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0;g=l;l=l+48|0;f=g+32|0;e=g;switch(d|0){case 2:{ym(a,b);break}case 1:{if(!(xr(a,b)|0)){c[e>>2]=KB(a)|0;gA(0,88902,e)|0;gA(3,93364,g+8|0)|0;gA(3,88954,g+16|0)|0;gA(3,89026,g+24|0)|0;Un(a,b);}break}default:{Un(a,b);if((d|0)==3)zm(a);}}In(a,b);Jn(a,b);if(0);Kn(a,b);l=g;return}function ym(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=l;l=l+16|0;g=Am(a,b,j,0,2,0)|0;i=ct(g,b)|0;e=a+16|0;a=0;while(1){if((a|0)>=(b|0))break;f=i+(a<<2)|0;d=0;while(1){if((d|0)==(b|0))break;h[(c[(c[(c[e>>2]|0)+160>>2]|0)+(a<<2)>>2]|0)+(d<<3)>>3]=+(c[(c[f>>2]|0)+(d<<2)>>2]|0);d=d+1|0;}a=a+1|0;}U1(c[i>>2]|0);U1(i);as(g);l=j;return}function zm(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0.0;f=a+16|0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;g=c[b>>2]&3;e=(c[c[((g|0)==3?b:b+48|0)+40>>2]>>2]|0)>>>4;g=(c[c[((g|0)==2?b:b+-48|0)+40>>2]>>2]|0)>>>4;if((e|0)!=(g|0)){j=+h[(c[b+16>>2]|0)+136>>3];i=c[(c[f>>2]|0)+160>>2]|0;h[(c[i+(g<<2)>>2]|0)+(e<<3)>>3]=j;h[(c[i+(e<<2)>>2]|0)+(g<<3)>>3]=j;}b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Am(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0;j=uB(a)|0;G=VL()|0;if((f|0)==2){k=0;D=0;}else {D=GA(a,2,92493,0)|0;k=(c[47174]|0)!=0&1;D=(D|0)!=0;}A=(e|1|0)==3;E=KK(b*20|0)|0;F=KK(b<<2)|0;l=(j<<1)+b<<2;m=KK(l)|0;z=A|D;if(z)f=KK(l)|0;else f=0;C=(k|0)!=0;if(C)j=KK(l)|0;else j=0;if(A)k=KK(l)|0;else k=0;l=0;x=jC(a)|0;y=0;while(1){if(!x)break;YL(G);if((c[(c[x+16>>2]|0)+120>>2]|0)!=(y|0)){B=12;break}c[F+(y<<2)>>2]=x;u=E+(y*20|0)+4|0;c[u>>2]=m;v=E+(y*20|0)+8|0;c[v>>2]=z?f:0;w=E+(y*20|0)+12|0;c[w>>2]=C?j:0;c[E+(y*20|0)+16>>2]=A?k:0;r=1;t=aB(a,x)|0;s=1;q=l;m=m+4|0;f=z?f+4|0:f;j=C?j+4|0:j;k=A?k+4|0:k;while(1){if(!t)break;n=c[t>>2]&3;p=t+-48|0;l=t+48|0;do if((c[((n|0)==2?t:p)+40>>2]|0)==(c[((n|0)==3?t:l)+40>>2]|0)){n=r;p=s;l=q;}else {n=Bm(G,t,r)|0;if((n|0)!=(r|0)){if(C){p=(c[w>>2]|0)+(n<<2)|0;g[p>>2]=+h[(c[t+16>>2]|0)+128>>3]+ +g[p>>2];}if(!D){n=r;p=s;l=q;break}n=(c[v>>2]|0)+(n<<2)|0;H=+h[(c[t+16>>2]|0)+136>>3];o=+(~~+g[n>>2]|0);g[n>>2]=H>o?H:o;n=r;p=s;l=q;break}I=c[t>>2]&3;l=(I|0)==3?t:l;q=q+1|0;n=r+1|0;r=m+4|0;c[m>>2]=c[(c[(c[((c[l+40>>2]|0)==(x|0)?((I|0)==2?t:p):l)+40>>2]|0)+16>>2]|0)+120>>2];if(C){g[j>>2]=+h[(c[t+16>>2]|0)+128>>3];j=j+4|0;}if(D){l=f+4|0;g[f>>2]=+h[(c[t+16>>2]|0)+136>>3];if(A){f=l;B=27;}else f=l;}else if(A){g[f>>2]=1.0;f=f+4|0;B=27;}if((B|0)==27){B=0;l=QA(t,101559)|0;if((l|0)!=0?(Q2(l,135709,4)|0)==0:0)o=0.0;else o=(x|0)==(c[((c[t>>2]&3|0)==2?t:p)+40>>2]|0)?1.0:-1.0;g[k>>2]=o;k=k+4|0;}p=s+1|0;l=q;m=r;}while(0);r=n;t=bB(a,t,x)|0;s=p;q=l;}c[E+(y*20|0)>>2]=s;c[c[u>>2]>>2]=y;l=q;x=kC(a,x)|0;y=y+1|0;}if((B|0)==12)qa(89103,89118,819,89130);if(A)Cm(E,b,e,F);n=(l|0)/2|0;a:do if((n|0)!=(uB(a)|0)){l=(n<<1)+b<<2;k=MK(c[E+4>>2]|0,l)|0;if(D)f=MK(c[E+8>>2]|0,l)|0;if(C){m=0;j=MK(c[E+12>>2]|0,l)|0;}else m=0;while(1){if((m|0)>=(b|0))break a;l=c[E+(m*20|0)>>2]|0;c[E+(m*20|0)+4>>2]=k;if(D){c[E+(m*20|0)+8>>2]=f;f=f+(l<<2)|0;}if(C){c[E+(m*20|0)+12>>2]=j;j=j+(l<<2)|0;}m=m+1|0;k=k+(l<<2)|0;}}while(0);c[d>>2]=n;if(!i)U1(F);else c[i>>2]=F;ZL(G);return E|0}function Bm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=c[b>>2]&3;e=c[(c[(c[((f|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+120>>2]|0;b=c[(c[(c[((f|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+120>>2]|0;f=(e|0)>(b|0);return _L(a,f?b:e,f?e:b,d)|0}function Cm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=0;while(1){if((g|0)>=(d|0)){g=0;break}h=c[(c[f+(g<<2)>>2]|0)+16>>2]|0;a[h+157>>0]=0;a[h+158>>0]=0;g=g+1|0;}while(1){if((g|0)>=(d|0))break;if(!(a[(c[(c[f+(g<<2)>>2]|0)+16>>2]|0)+157>>0]|0))Dm(b,g,e,f);g=g+1|0;}return}function Dm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0;q=(c[f+(d<<2)>>2]|0)+16|0;l=c[q>>2]|0;a[l+157>>0]=1;a[l+158>>0]=1;l=b+(d*20|0)|0;m=b+(d*20|0)+16|0;n=b+(d*20|0)+4|0;o=(e|0)==3?-1.0:1.0;k=1;a:while(1){if((k|0)>=(c[l>>2]|0)){h=14;break}h=(c[m>>2]|0)+(k<<2)|0;do if(!(+g[h>>2]==1.0)){p=c[(c[n>>2]|0)+(k<<2)>>2]|0;i=c[(c[f+(p<<2)>>2]|0)+16>>2]|0;if(!(a[i+158>>0]|0)){if(a[i+157>>0]|0)break;Dm(b,p,e,f);break}g[h>>2]=o;i=b+(p*20|0)+4|0;j=c[b+(p*20|0)>>2]|0;h=1;while(1){if((h|0)>=(j|0)){h=9;break a}if((c[(c[i>>2]|0)+(h<<2)>>2]|0)==(d|0))break;h=h+1|0;}g[(c[b+(p*20|0)+16>>2]|0)+(h<<2)>>2]=-1.0;}while(0);k=k+1|0;}if((h|0)==9)qa(89144,89118,721,89164);else if((h|0)==14){a[(c[q>>2]|0)+158>>0]=0;return}}function Em(a){a=a|0;var b=0,d=0;d=l;l=l+16|0;b=d;a=ZO(a,GA(a,0,89305,0)|0,2,0)|0;if((a|0)==0|(a|0)>2){c[b>>2]=89305;gA(0,89314,b)|0;a=2;}l=d;return a|0}function Fm(a){a=a|0;var b=0,d=0,e=0;d=tB(a)|0;c[46796]=GA(a,1,102623,0)|0;e=GA(a,1,90660,0)|0;b=jC(a)|0;while(1){if(!b)break;Zl(b);_l(c[46796]|0,e,b,d)|0;b=kC(a,b)|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Gm(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Gm(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,1.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function Hm(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0;a=JK(64)|0;e=a+8|0;f=d+8|0;g=e+48|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0;}while((e|0)<(g|0));d=c[d+56>>2]|0;c[a+56>>2]=d;b[(c[d+16>>2]|0)+168>>1]=1;return a|0}function Im(a,b,c){a=a|0;b=b|0;c=c|0;U1(b);return}function Jm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=c[b>>2]|0;e=c[d>>2]|0;if(a>>>0<=e>>>0)if(a>>>0>=e>>>0){e=c[b+24>>2]|0;a=c[d+24>>2]|0;if(e>>>0<=a>>>0)if(e>>>0>=a>>>0){a=~~(+h[b+8>>3]-+h[d+8>>3]);if(!a){a=~~(+h[b+16>>3]-+h[d+16>>3]);if(!a){a=~~(+h[b+32>>3]-+h[d+32>>3]);if(!a)a=~~(+h[b+40>>3]-+h[d+40>>3]);}}}else a=-1;else a=1;}else a=-1;else a=1;return a|0}function Km(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0.0;k=l;l=l+16|0;g=k;h=e+16|0;i=b[(c[h>>2]|0)+168>>1]|0;j=i<<16>>16;if(i<<16>>16!=1&(a[194954]|0)==0){i=KK(j<<2)|0;g=0;while(1){if((g|0)>=(j|0))break;c[i+(g<<2)>>2]=e;e=c[(c[e+16>>2]|0)+172>>2]|0;g=g+1|0;}m=+(f|0);lO(d,i,0,j,m,m,17792);e=0;while(1){if((e|0)>=(j|0))break;g=c[i+(e<<2)>>2]|0;h=g+16|0;if(c[(c[h>>2]|0)+96>>2]|0){f=xC(c[((c[g>>2]&3|0)==3?g:g+48|0)+40>>2]|0)|0;zP(f,c[(c[h>>2]|0)+96>>2]|0);}sO(g);e=e+1|0;}U1(i);}else {c[g>>2]=e;m=+(f|0);lO(d,g,0,1,m,m,17792);if(c[(c[h>>2]|0)+96>>2]|0){j=xC(c[((c[e>>2]&3|0)==3?e:e+48|0)+40>>2]|0)|0;zP(j,c[(c[h>>2]|0)+96>>2]|0);}sO(e);}l=k;return}function Lm(a){a=a|0;return 0}function Mm(a){a=a|0;return 0}function Nm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0,D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;Q=l;l=l+384|0;O=Q+368|0;P=Q+112|0;j=Q+32|0;r=Q+336|0;K=Q+320|0;L=Q+304|0;M=Q+288|0;N=Q+272|0;i=Q+256|0;H=Q+240|0;I=Q+224|0;J=Q+208|0;t=Q+192|0;u=Q+176|0;v=Q+160|0;z=Q+144|0;A=Q+128|0;B=Q+96|0;D=Q+16|0;G=Q;a:do switch(WM(b)|0){case 3:case 1:{f=JK(8)|0;z=b+16|0;b=c[z>>2]|0;i=c[b+12>>2]|0;do if(!(e<<24>>24)){b=c[i+8>>2]|0;if((b|0)>2){y=0.0;j=c[i+44>>2]|0;e=0;p=+g[d>>2];q=+g[d+4>>2];break}else {y=+B5()*.01;b=8;j=0;e=1;p=0.0;q=0.0;break}}else if(!(c[i+40>>2]&2048)){q=+h[b+88>>3];p=-q;y=+h[b+80>>3];x=y*-.5;h[j>>3]=p;h[j+8>>3]=x;h[j+16>>3]=q;h[j+24>>3]=x;y=y*.5;h[j+32>>3]=q;h[j+40>>3]=y;h[j+48>>3]=p;h[j+56>>3]=y;y=0.0;b=4;e=0;p=0.0;q=0.0;break}else {yP(r,i);p=+h[r>>3];x=+h[r+8>>3];q=+h[r+16>>3];y=+h[r+24>>3];h[j>>3]=p;h[j+8>>3]=x;h[j+16>>3]=q;h[j+24>>3]=x;h[j+32>>3]=q;h[j+40>>3]=y;h[j+48>>3]=p;h[j+56>>3]=y;y=0.0;b=4;e=0;p=0.0;q=0.0;break}while(0);c[f+4>>2]=b;r=JK(b<<4)|0;c[f>>2]=r;s=1.0/+(b|0);t=d+8|0;u=d+4|0;v=(b|0)==4;w=-p;x=-q;i=0;while(1){if((b|0)<=(i|0))break a;do if(e){k=+(i|0)*6.283185307179586*s+y;m=+E(+k);k=+F(+k);if(!(a[t>>0]|0)){P=c[z>>2]|0;n=k*+g[u>>2]*+h[P+80>>3];k=m*+g[d>>2]*(+h[P+96>>3]+ +h[P+88>>3]);}else {P=c[z>>2]|0;n=(+h[P+80>>3]+ +g[u>>2])*k;k=(+h[P+96>>3]+ +h[P+88>>3]+ +g[d>>2])*m;}o=k*.5;k=n*.5;}else {if(!(a[t>>0]|0)){o=+h[j+(i<<4)>>3]*p;k=+h[j+(i<<4)+8>>3]*q;break}if(!v){o=+h[j+(i<<4)>>3];k=+h[j+(i<<4)+8>>3];n=+C(+(k*k+o*o));o=(p/n+1.0)*o;k=(q/n+1.0)*k;break}switch(i|0){case 0:{m=q;k=p;break}case 1:{m=q;k=w;break}case 2:{m=x;k=w;break}case 3:{m=x;k=p;break}default:{m=0.0;k=0.0;}}o=+h[j+(i<<4)>>3]+k;k=+h[j+(i<<4)+8>>3]+m;}while(0);O=c[z>>2]|0;P=b-i+-1|0;h[r+(P<<4)>>3]=+h[O+16>>3]+o;h[r+(P<<4)+8>>3]=+h[O+24>>3]+k;i=i+1|0;}}case 2:{G=b+16|0;f=c[(c[G>>2]|0)+12>>2]|0;k=+h[f+16>>3];o=+h[f+24>>3];m=+h[f+32>>3];n=+h[f+40>>3];f=JK(8)|0;c[f+4>>2]=4;b=JK(64)|0;c[f>>2]=b;G=(c[G>>2]|0)+16|0;c[P>>2]=c[G>>2];c[P+4>>2]=c[G+4>>2];c[P+8>>2]=c[G+8>>2];c[P+12>>2]=c[G+12>>2];if(!(a[d+8>>0]|0)){c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(i,k,o,O,d);c[b>>2]=c[i>>2];c[b+4>>2]=c[i+4>>2];c[b+8>>2]=c[i+8>>2];c[b+12>>2]=c[i+12>>2];N=(c[f>>2]|0)+16|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(H,k,n,O,d);c[N>>2]=c[H>>2];c[N+4>>2]=c[H+4>>2];c[N+8>>2]=c[H+8>>2];c[N+12>>2]=c[H+12>>2];N=(c[f>>2]|0)+32|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(I,m,n,O,d);c[N>>2]=c[I>>2];c[N+4>>2]=c[I+4>>2];c[N+8>>2]=c[I+8>>2];c[N+12>>2]=c[I+12>>2];N=(c[f>>2]|0)+48|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(J,m,o,O,d);c[N>>2]=c[J>>2];c[N+4>>2]=c[J+4>>2];c[N+8>>2]=c[J+8>>2];c[N+12>>2]=c[J+12>>2];break a}else {y=k-+g[d>>2];J=d+4|0;x=o-+g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(K,y,x,O);c[b>>2]=c[K>>2];c[b+4>>2]=c[K+4>>2];c[b+8>>2]=c[K+8>>2];c[b+12>>2]=c[K+12>>2];K=(c[f>>2]|0)+16|0;x=k-+g[d>>2];y=n+ +g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(L,x,y,O);c[K>>2]=c[L>>2];c[K+4>>2]=c[L+4>>2];c[K+8>>2]=c[L+8>>2];c[K+12>>2]=c[L+12>>2];L=(c[f>>2]|0)+32|0;y=m+ +g[d>>2];x=n+ +g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(M,y,x,O);c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];M=(c[f>>2]|0)+48|0;x=m+ +g[d>>2];y=o-+g[J>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(N,x,y,O);c[M>>2]=c[N>>2];c[M+4>>2]=c[N+4>>2];c[M+8>>2]=c[N+8>>2];c[M+12>>2]=c[N+12>>2];break a}}case 4:{b=b+16|0;f=JK(8)|0;c[f+4>>2]=4;i=JK(64)|0;c[f>>2]=i;j=c[b>>2]|0;N=j+16|0;c[P>>2]=c[N>>2];c[P+4>>2]=c[N+4>>2];c[P+8>>2]=c[N+8>>2];c[P+12>>2]=c[N+12>>2];k=-+h[j+88>>3];if(!(a[d+8>>0]|0)){x=-+h[j+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(A,k,x,O,d);c[i>>2]=c[A>>2];c[i+4>>2]=c[A+4>>2];c[i+8>>2]=c[A+8>>2];c[i+12>>2]=c[A+12>>2];N=(c[f>>2]|0)+16|0;M=c[b>>2]|0;x=-+h[M+88>>3];y=+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(B,x,y,O,d);c[N>>2]=c[B>>2];c[N+4>>2]=c[B+4>>2];c[N+8>>2]=c[B+8>>2];c[N+12>>2]=c[B+12>>2];N=(c[f>>2]|0)+32|0;M=c[b>>2]|0;y=+h[M+96>>3];x=+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(D,y,x,O,d);c[N>>2]=c[D>>2];c[N+4>>2]=c[D+4>>2];c[N+8>>2]=c[D+8>>2];c[N+12>>2]=c[D+12>>2];N=(c[f>>2]|0)+48|0;M=c[b>>2]|0;x=+h[M+96>>3];y=-+h[M+80>>3];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Pm(G,x,y,O,d);c[N>>2]=c[G>>2];c[N+4>>2]=c[G+4>>2];c[N+8>>2]=c[G+8>>2];c[N+12>>2]=c[G+12>>2];break a}else {y=k-+g[d>>2];M=d+4|0;x=-+h[j+80>>3]-+g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(t,y,x,O);c[i>>2]=c[t>>2];c[i+4>>2]=c[t+4>>2];c[i+8>>2]=c[t+8>>2];c[i+12>>2]=c[t+12>>2];N=(c[f>>2]|0)+16|0;L=c[b>>2]|0;x=-+h[L+88>>3]-+g[d>>2];y=+h[L+80>>3]+ +g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(u,x,y,O);c[N>>2]=c[u>>2];c[N+4>>2]=c[u+4>>2];c[N+8>>2]=c[u+8>>2];c[N+12>>2]=c[u+12>>2];N=(c[f>>2]|0)+32|0;L=c[b>>2]|0;y=+h[L+96>>3]+ +g[d>>2];x=+h[L+80>>3]+ +g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(v,y,x,O);c[N>>2]=c[v>>2];c[N+4>>2]=c[v+4>>2];c[N+8>>2]=c[v+8>>2];c[N+12>>2]=c[v+12>>2];N=(c[f>>2]|0)+48|0;L=c[b>>2]|0;x=+h[L+96>>3]+ +g[d>>2];y=-+h[L+80>>3]-+g[M>>2];c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];Om(z,x,y,O);c[N>>2]=c[z>>2];c[N+4>>2]=c[z+4>>2];c[N+8>>2]=c[z+8>>2];c[N+12>>2]=c[z+12>>2];break a}}default:f=0;}while(0);l=Q;return f|0}function Om(a,b,c,d){a=a|0;b=+b;c=+c;d=d|0;c=+h[d+8>>3]+c;h[a>>3]=+h[d>>3]+b;h[a+8>>3]=c;return}function Pm(a,b,c,d,e){a=a|0;b=+b;c=+c;d=d|0;e=e|0;c=+g[e+4>>2]*c+ +h[d+8>>3];h[a>>3]=+g[e>>2]*b+ +h[d>>3];h[a+8>>3]=c;return}function Qm(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;o=l;l=l+112|0;j=o+88|0;i=o+72|0;k=o+32|0;m=o+16|0;n=o;f=o+56|0;g=o+40|0;h=b+48|0;r=(c[(c[((c[b>>2]&3|0)==3?b:h)+40>>2]|0)+16>>2]|0)+16|0;p=b+16|0;q=(c[p>>2]|0)+16|0;c[i>>2]=c[r>>2];c[i+4>>2]=c[r+4>>2];c[i+8>>2]=c[r+8>>2];c[i+12>>2]=c[r+12>>2];c[j>>2]=c[q>>2];c[j+4>>2]=c[q+4>>2];c[j+8>>2]=c[q+8>>2];c[j+12>>2]=c[q+12>>2];Rm(f,i,j);c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];f=b+-48|0;q=(c[(c[((c[b>>2]&3|0)==2?b:f)+40>>2]|0)+16>>2]|0)+16|0;p=(c[p>>2]|0)+56|0;c[i>>2]=c[q>>2];c[i+4>>2]=c[q+4>>2];c[i+8>>2]=c[q+8>>2];c[i+12>>2]=c[q+12>>2];c[j>>2]=c[p>>2];c[j+4>>2]=c[p+4>>2];c[j+8>>2]=c[p+8>>2];c[j+12>>2]=c[p+12>>2];Rm(g,i,j);c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];if(!e){g=-1111;f=-1111;}else {r=c[b>>2]&3;g=c[(c[(c[((r|0)==2?b:f)+40>>2]|0)+16>>2]|0)+288>>2]|0;f=c[(c[(c[((r|0)==3?b:h)+40>>2]|0)+16>>2]|0)+288>>2]|0;};c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];MX(d,i,f,j,g,k)|0;p=k;q=c[p+4>>2]|0;r=a;c[r>>2]=c[p>>2];c[r+4>>2]=q;l=o;return}function Rm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[c+8>>3]+ +h[b+8>>3];h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=d;return}function Sm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;u=l;l=l+144|0;p=u+104|0;q=u+88|0;o=u+80|0;n=u+72|0;j=u+64|0;s=u+128|0;k=u+32|0;m=u+124|0;t=u+16|0;r=u;i=u+120|0;h=(c[b+16>>2]|0)+144|0;g=c[h>>2]|0;h=c[h+4>>2]|0;v=j;c[v>>2]=g;c[v+4>>2]=h;v=g;c[t>>2]=c[v>>2];c[t+4>>2]=c[v+4>>2];c[t+8>>2]=c[v+8>>2];c[t+12>>2]=c[v+12>>2];h=g+(h+-1<<4)|0;c[r>>2]=c[h>>2];c[r+4>>2]=c[h+4>>2];c[r+8>>2]=c[h+8>>2];c[r+12>>2]=c[h+12>>2];a:do if(!(f<<24>>24)){g=-1111;f=-1111;}else {g=-1111;f=-1111;h=0;while(1){if((h|0)>=(e|0))break a;if((f|0)==-1111){f=c[d+(h<<2)>>2]|0;c[q>>2]=c[f>>2];c[q+4>>2]=c[f+4>>2];c[p>>2]=c[t>>2];c[p+4>>2]=c[t+4>>2];c[p+8>>2]=c[t+8>>2];c[p+12>>2]=c[t+12>>2];f=(NX(q,p)|0)==0;f=f?-1111:h;}if((g|0)==-1111){g=c[d+(h<<2)>>2]|0;c[q>>2]=c[g>>2];c[q+4>>2]=c[g+4>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];g=(NX(q,p)|0)==0;g=g?-1111:h;}h=h+1|0;}}while(0);Tm(d,e,f,g,i,m);c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;h=c[i>>2]|0;v=c[m>>2]|0;c[p>>2]=c[j>>2];c[p+4>>2]=c[j+4>>2];if((OX(h,v,p,k,s)|0)<0){t=KB(c[((c[b>>2]&3|0)==3?b:b+48|0)+40>>2]|0)|0;v=KB(c[((c[b>>2]&3|0)==2?b:b+-48|0)+40>>2]|0)|0;c[n>>2]=t;c[n+4>>2]=v;gA(1,89657,n)|0;}else {if(0>1);else {f=b+-48|0;g=b;}dO(b,c[((c[g>>2]&3|0)==2?b:f)+40>>2]|0,c[s>>2]|0,c[s+4>>2]|0,17792);U1(h);c[q>>2]=c[t>>2];c[q+4>>2]=c[t+4>>2];c[q+8>>2]=c[t+8>>2];c[q+12>>2]=c[t+12>>2];c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];yO(a,b,q,p);}l=u;return}function Tm(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=0;h=0;while(1){if((i|0)>=(b|0))break;if(!((i|0)==(d|0)|(i|0)==(e|0)))h=(c[(c[a+(i<<2)>>2]|0)+4>>2]|0)+h|0;i=i+1|0;}o=KK(h<<5)|0;i=0;n=0;while(1){if((n|0)>=(b|0))break;a:do if(!((n|0)==(d|0)|(n|0)==(e|0))){m=a+(n<<2)|0;l=0;while(1){j=c[m>>2]|0;k=c[j+4>>2]|0;if((l|0)>=(k|0))break a;p=l+1|0;q=o+(i<<5)|0;j=(c[j>>2]|0)+(l<<4)|0;c[q>>2]=c[j>>2];c[q+4>>2]=c[j+4>>2];c[q+8>>2]=c[j+8>>2];c[q+12>>2]=c[j+12>>2];j=o+(i<<5)+16|0;k=(c[c[m>>2]>>2]|0)+(((p|0)<(k|0)?p:0)<<4)|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];l=p;i=i+1|0;}}while(0);n=n+1|0;}if((i|0)==(h|0)){c[f>>2]=o;c[g>>2]=h;return}else qa(89719,89726,77,89741);}function Um(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+32|0;k=n+12|0;f=n;pr(f,a);c[k>>2]=c[f>>2];c[k+4>>2]=c[f+4>>2];c[k+8>>2]=c[f+8>>2];f=jC(a)|0;while(1){if(!f)break;g=XA(a,f)|0;while(1){if(!g)break;ZN(g);g=ZA(a,g)|0;}f=kC(a,f)|0;}h=Vz(17756,c[4581]|0)|0;f=jC(a)|0;while(1){if(!f)break;g=XA(a,f)|0;while(1){if(!g)break;if((c[47134]|0)>1?(i=c[g+16>>2]|0,(c[i+8>>2]|0)!=0):0){o=i+168|0;b[o>>1]=(b[o>>1]|0)+1<<16>>16;}else m=14;if((m|0)==14?(m=0,j=Vm(h,g)|0,(j|0)!=(g|0)):0){o=c[j+16>>2]|0;p=o+168|0;b[p>>1]=(b[p>>1]|0)+1<<16>>16;o=o+172|0;c[(c[g+16>>2]|0)+172>>2]=c[o>>2];c[o>>2]=g;}g=ZA(a,g)|0;}f=kC(a,f)|0;}Rz(h)|0;if(!(nb[d&63](a,k,e)|0)){c[47138]=1;f=0;}else f=1;l=n;return f|0}function Vm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0,q=0;q=l;l=l+64|0;p=q;e=c[b>>2]&3;i=c[((e|0)==3?b:b+48|0)+40>>2]|0;e=c[((e|0)==2?b:b+-48|0)+40>>2]|0;do if(i>>>0>=e>>>0){d=b+16|0;if(i>>>0>e>>>0){d=c[d>>2]|0;o=e;e=i;k=+h[d+16>>3];m=+h[d+24>>3];g=+h[d+56>>3];f=+h[d+64>>3];break}o=c[d>>2]|0;j=+h[o+56>>3];n=+h[o+64>>3];g=+h[o+16>>3];f=+h[o+24>>3];if(!(gj)){d=f>n;if(f>2]|0;o=i;k=+h[d+56>>3];m=+h[d+64>>3];g=+h[d+16>>3];f=+h[d+24>>3];}while(0);c[p+8>>2]=o;h[p+16>>3]=g;h[p+24>>3]=f;c[p+32>>2]=e;h[p+40>>3]=k;h[p+48>>3]=m;c[p+56>>2]=b;p=c[(nb[c[a>>2]&63](a,p,1)|0)+56>>2]|0;l=q;return p|0}function Wm(a,b){a=a|0;b=b|0;return Um(a,21,b)|0}function Xm(d,e,f){d=d|0;e=e|0;f=f|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0;F=l;l=l+112|0;B=F+88|0;A=F+72|0;t=F+40|0;q=F+8|0;p=F;u=F+64|0;C=F+48|0;D=F+24|0;i=(c[47134]|0)>1&1;do if((f|0)>5){s=JK((tB(d)|0)<<2)|0;o=(f|0)==8;n=o&1;m=jC(d)|0;r=0;while(1){if(!m)break;j=Nm(m,e,n)|0;k=(c[m+16>>2]|0)+288|0;if(!j){c[k>>2]=-1111;j=r;}else {c[k>>2]=r;c[s+(r<<2)>>2]=j;j=r+1|0;}m=kC(d,m)|0;r=j;}if(s){j=lt(s,r)|0;if(j|0){if(o){y=0;z=s;x=s;w=1;break}y=JX(s,r)|0;z=s;x=s;w=1;break}if(o){gA(0,89755,p)|0;j=0;y=0;z=s;x=s;w=1;break}else {G=+g[e+4>>2];h[q>>3]=+g[e>>2];h[q+8>>3]=G;gA(0,89833,q)|0;j=0;y=0;z=s;x=s;w=1;break}}else {j=0;y=0;z=0;x=0;w=0;}}else {j=0;y=0;z=0;r=0;x=0;w=0;}while(0);if(0);v=(y|0)!=0;a:do if(!v){if((f|0)==8&(j|0)!=0){rQ(d,0);i=1;}}else {k=jC(d)|0;while(1){if(!k)break a;j=XA(d,k)|0;while(1){if(!j)break;t=(c[j+16>>2]|0)+144|0;Qm(u,j,y,1,0,0);q=u;s=c[q+4>>2]|0;c[t>>2]=c[q>>2];c[t+4>>2]=s;j=ZA(d,j)|0;}k=kC(d,k)|0;}}while(0);p=(i|0)==0;q=d+60|0;s=(f|0)==10;i=0;o=jC(d)|0;j=0;while(1){if(!o)break;t=o+16|0;e=XA(d,o)|0;while(1){if(!e)break;n=c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0;k=e+16|0;m=c[k>>2]|0;if(!p?(c[m+8>>2]|0)!=0:0){H=(c[t>>2]|0)+16|0;u=m+16|0;c[A>>2]=c[H>>2];c[A+4>>2]=c[H+4>>2];c[A+8>>2]=c[H+8>>2];c[A+12>>2]=c[H+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];Rm(C,A,B);n=(c[n+16>>2]|0)+16|0;u=(c[k>>2]|0)+56|0;c[A>>2]=c[n>>2];c[A+4>>2]=c[n+4>>2];c[A+8>>2]=c[n+8>>2];c[A+12>>2]=c[n+12>>2];c[B>>2]=c[u>>2];c[B+4>>2]=c[u+4>>2];c[B+8>>2]=c[u+8>>2];c[B+12>>2]=c[u+12>>2];Rm(D,A,B);c[A>>2]=c[C>>2];c[A+4>>2]=c[C+4>>2];c[A+8>>2]=c[C+8>>2];c[A+12>>2]=c[C+12>>2];c[B>>2]=c[D>>2];c[B+4>>2]=c[D+4>>2];c[B+8>>2]=c[D+8>>2];c[B+12>>2]=c[D+12>>2];yO(d,e,A,B);}else E=35;b:do if((E|0)==35){E=0;H=b[m+168>>1]|0;k=H<<16>>16;if(H<<16>>16){if((o|0)==(n|0)){if(!i){j=JK(96)|0;c[j+84>>2]=JK(((tB(d)|0)<<5)+11520|0)|0;i=j;}Km(i,e,c[(c[(c[q>>2]|0)+16>>2]|0)+248>>2]|0);break}if(!v){OM(d,e,f,17792);break}k=a[194954]|0?1:k;m=e;n=0;while(1){if((n|0)>=(k|0))break b;if(s)Sm(d,m,z,r,1);else Ym(d,m);m=c[(c[m+16>>2]|0)+172>>2]|0;n=n+1|0;}}}while(0);e=ZA(d,e)|0;}o=kC(d,o)|0;}if(v)LX(y);if(i|0){U1(c[i+84>>2]|0);U1(j);}if(w){i=0;while(1){if((i|0)>=(r|0))break;U1(c[z+(i<<2)>>2]|0);i=i+1|0;}U1(x);}l=F;return 0}function Ym(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;k=l;l=l+96|0;g=k+64|0;f=k+48|0;d=k+40|0;h=k+80|0;e=k+32|0;i=k+16|0;j=k;m=(c[b+16>>2]|0)+144|0;n=c[m>>2]|0;m=c[m+4>>2]|0;o=e;c[o>>2]=n;c[o+4>>2]=m;o=n;c[i>>2]=c[o>>2];c[i+4>>2]=c[o+4>>2];c[i+8>>2]=c[o+8>>2];c[i+12>>2]=c[o+12>>2];m=n+(m+-1<<4)|0;c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];c[g>>2]=c[e>>2];c[g+4>>2]=c[e+4>>2];FY(g,h);if(0>1);else {d=b+-48|0;e=b;}dO(b,c[((c[e>>2]&3|0)==2?b:d)+40>>2]|0,c[h>>2]|0,c[h+4>>2]|0,17792);c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[g>>2]=c[j>>2];c[g+4>>2]=c[j+4>>2];c[g+8>>2]=c[j+8>>2];c[g+12>>2]=c[j+12>>2];yO(a,b,f,g);l=k;return}function Zm(a,d){a=a|0;d=d|0;var e=0;e=b[(c[a+16>>2]|0)+136>>1]&14;if(d<<24>>24)_m(a)|0;if(e<<16>>16)Wm(a,e&65535)|0;return}function _m(a){a=a|0;var b=0,d=0,e=0,f=0;d=$m(a)|0;b=jC(a)|0;while(1){if(!b)break;e=c[b+16>>2]|0;f=c[e+132>>2]|0;h[e+16>>3]=+h[f>>3]*72.0;h[e+24>>3]=+h[f+8>>3]*72.0;b=kC(a,b)|0;}return d|0}function $m(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0,i=0.0,j=0,k=0;a:do if((c[a+60>>2]|0)==(a|0)?(d=a+16|0,e=c[d>>2]|0,(c[(c[e+8>>2]|0)+84>>2]|0)!=0):0){if(!(+h[e+16>>3]!=0.0)?!(+h[e+24>>3]!=0.0):0)b=0;else {an(a);b=1;e=c[d>>2]|0;}j=(c[e+116>>2]&1|0)==0;if(!j){k=e+32|0;i=+h[k>>3];d=e+40|0;h[k>>3]=+h[d>>3];h[d>>3]=i;}d=c[e+8>>2]|0;b:do switch(c[d+84>>2]|0){case 2:{f=+h[d+64>>3];if(f<=0.0)break a;g=f/+h[e+32>>3];f=+h[d+72>>3]/+h[e+40>>3];if(g<1.0|f<1.0)if(g>3];if(f<=0.0)break a;g=f/+h[e+32>>3];f=+h[d+72>>3]/+h[e+40>>3];if(!(g>1.0&f>1.0))break a;f=g>3];f=+h[e+40>>3]/+h[e+32>>3];if(f1){d=jC(a)|0;while(1){if(!d)break c;b=XA(a,d)|0;while(1){if(!b)break;if(c[(c[b+16>>2]|0)+8>>2]|0)bn(b,f,g);b=ZA(a,b)|0;}d=kC(a,d)|0;}}while(0);b=jC(a)|0;while(1){if(!b)break;k=c[(c[b+16>>2]|0)+132>>2]|0;h[k>>3]=+h[k>>3]*f;k=k+8|0;h[k>>3]=+h[k>>3]*g;b=kC(a,b)|0;}cn(a,f,g);b=1;}else b=0;while(0);return b|0}function an(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;n=l;l=l+32|0;k=n+16|0;m=n;d=(c[b+16>>2]|0)+16|0;c[m>>2]=c[d>>2];c[m+4>>2]=c[d+4>>2];c[m+8>>2]=c[d+8>>2];c[m+12>>2]=c[d+12>>2];f=+h[m>>3];g=f*.013888888888888888;i=+h[m+8>>3];j=i*.013888888888888888;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;o=c[e+132>>2]|0;h[o>>3]=+h[o>>3]-g;o=o+8|0;h[o>>3]=+h[o>>3]-j;e=c[e+108>>2]|0;if(e|0?a[e+81>>0]|0:0){o=e+56|0;h[o>>3]=+h[o>>3]-f;o=e+64|0;h[o>>3]=+h[o>>3]-i;}d=kC(b,d)|0;}e=jC(b)|0;while(1){if(!e)break;d=XA(b,e)|0;while(1){if(!d)break;if(c[(c[d+16>>2]|0)+8>>2]|0){c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];dn(d,k);}d=ZA(b,d)|0;}e=kC(b,e)|0;}c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];en(b,k);l=n;return}function bn(b,d,e){b=b|0;d=+d;e=+e;var f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0;p=c[b>>2]&3;i=c[(c[(c[((p|0)==2?b:b+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;s=(d+-1.0)*72.0;q=s*+h[i>>3];t=(e+-1.0)*72.0;r=t*+h[i+8>>3];p=c[(c[(c[((p|0)==3?b:b+48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;s=s*+h[p>>3];t=t*+h[p+8>>3];p=c[b+16>>2]|0;i=c[p+8>>2]|0;j=c[i+4>>2]|0;k=j+-1|0;b=0;i=c[i>>2]|0;while(1){if((b|0)>=(j|0))break;l=c[i+4>>2]|0;m=l+-1|0;n=(b|0)==(k|0);f=0;g=c[i>>2]|0;while(1){if((f|0)>=(l|0))break;do if(f|b){o=+h[g>>3];if((f|0)==(m|0)&n){h[g>>3]=o+q;u=g+8|0;h[u>>3]=+h[u>>3]+r;break}else {h[g>>3]=o*d;u=g+8|0;h[u>>3]=+h[u>>3]*e;break}}else {h[g>>3]=+h[g>>3]+s;u=g+8|0;h[u>>3]=+h[u>>3]+t;}while(0);f=f+1|0;g=g+16|0;}if(c[i+8>>2]|0){u=i+16|0;h[u>>3]=+h[u>>3]+s;u=i+24|0;h[u>>3]=+h[u>>3]+t;}if(c[i+12>>2]|0){u=i+32|0;h[u>>3]=+h[u>>3]+q;u=i+40|0;h[u>>3]=+h[u>>3]+r;}b=b+1|0;i=i+48|0;}b=c[p+96>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]*d;u=b+64|0;h[u>>3]=+h[u>>3]*e;}b=c[p+100>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]+q;u=b+64|0;h[u>>3]=+h[u>>3]+r;}b=c[p+104>>2]|0;if(b|0?a[b+81>>0]|0:0){u=b+56|0;h[u>>3]=+h[u>>3]+s;u=b+64|0;h[u>>3]=+h[u>>3]+t;}return}function cn(b,d,e){b=b|0;d=+d;e=+e;var f=0,g=0,i=0;i=b+16|0;g=c[i>>2]|0;b=g+32|0;h[b>>3]=+h[b>>3]*d;b=g+40|0;h[b>>3]=+h[b>>3]*e;b=g+16|0;h[b>>3]=+h[b>>3]*d;b=g+24|0;h[b>>3]=+h[b>>3]*e;b=c[g+12>>2]|0;if((b|0)!=0?(a[b+81>>0]|0)!=0:0){f=b+56|0;h[f>>3]=+h[f>>3]*d;f=b+64|0;h[f>>3]=+h[f>>3]*e;f=1;b=g;}else {f=1;b=g;}while(1){if((f|0)>(c[b+180>>2]|0))break;cn(c[(c[b+184>>2]|0)+(f<<2)>>2]|0,d,e);f=f+1|0;b=c[i>>2]|0;}return}function dn(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0;k=c[b+16>>2]|0;b=c[k+8>>2]|0;j=c[b+4>>2]|0;l=d+8|0;b=c[b>>2]|0;g=0;while(1){if((g|0)>=(j|0))break;i=c[b+4>>2]|0;e=c[b>>2]|0;f=0;while(1){if((f|0)>=(i|0))break;h[e>>3]=+h[e>>3]-+h[d>>3];m=e+8|0;h[m>>3]=+h[m>>3]-+h[l>>3];e=e+16|0;f=f+1|0;}if(c[b+8>>2]|0){m=b+16|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+24|0;h[m>>3]=+h[m>>3]-+h[l>>3];}if(c[b+12>>2]|0){m=b+32|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+40|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=b+48|0;g=g+1|0;}b=c[k+96>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+108>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+100>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}b=c[k+104>>2]|0;if(b|0?a[b+81>>0]|0:0){m=b+56|0;h[m>>3]=+h[m>>3]-+h[d>>3];m=b+64|0;h[m>>3]=+h[m>>3]-+h[l>>3];}return}function en(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;j=k;g=+h[d>>3];i=b+16|0;b=c[i>>2]|0;e=b+32|0;h[e>>3]=+h[e>>3]-g;f=+h[d+8>>3];e=b+40|0;h[e>>3]=+h[e>>3]-f;e=b+16|0;h[e>>3]=+h[e>>3]-g;e=b+24|0;h[e>>3]=+h[e>>3]-f;e=c[b+12>>2]|0;if((e|0)!=0?(a[e+81>>0]|0)!=0:0){m=e+56|0;h[m>>3]=+h[m>>3]-g;e=e+64|0;h[e>>3]=+h[e>>3]-f;e=1;}else e=1;while(1){if((e|0)>(c[b+180>>2]|0))break;m=c[(c[b+184>>2]|0)+(e<<2)>>2]|0;c[j>>2]=c[d>>2];c[j+4>>2]=c[d+4>>2];c[j+8>>2]=c[d+8>>2];c[j+12>>2]=c[d+12>>2];en(m,j);e=e+1|0;b=c[i>>2]|0;}l=k;return}function fn(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0.0,i=0,j=0;i=l;l=l+16|0;d=i;BP(a);e=a+16|0;b=c[e>>2]|0;f=+h[b+16>>3]*.013888888888888888;g=+h[b+24>>3]*.013888888888888888;b=jC(a)|0;while(1){if(!b)break;j=c[(c[b+16>>2]|0)+132>>2]|0;h[j>>3]=+h[j>>3]-f;j=j+8|0;h[j>>3]=+h[j>>3]-g;b=kC(a,b)|0;}j=(c[e>>2]|0)+16|0;c[d>>2]=c[j>>2];c[d+4>>2]=c[j+4>>2];c[d+8>>2]=c[j+8>>2];c[d+12>>2]=c[j+12>>2];gn(a,d);Zm(a,1);l=i;return}function gn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0.0;g=l;l=l+16|0;f=g;d=a+16|0;a=1;while(1){e=c[d>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[(c[e+184>>2]|0)+(a<<2)>>2]|0;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];gn(e,f);a=a+1|0;}j=+h[b>>3];f=e+32|0;h[f>>3]=+h[f>>3]-j;i=+h[b+8>>3];b=e+40|0;h[b>>3]=+h[b>>3]-i;b=e+16|0;h[b>>3]=+h[b>>3]-j;b=e+24|0;h[b>>3]=+h[b>>3]-i;l=g;return}function hn(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;p=(e|0)>2;n=0;o=0;j=c[f+4>>2]|0;b=c[f>>2]|0;while(1){if((o|0)>=(d|0)){b=0;break}i=c[(c[g+(o<<2)>>2]|0)+16>>2]|0;l=a[i+119>>0]|0;a:do if(!(l<<24>>24)){k=b+8|0;h[b>>3]=+B5();i=j+8|0;h[j>>3]=+B5();if(p){b=2;while(1){if((b|0)==(e|0)){j=n;b=k;break a}q=+B5();h[(c[f+(b<<2)>>2]|0)+(o<<3)>>3]=q;b=b+1|0;}}else {j=n;b=k;}}else {k=c[i+132>>2]|0;m=b+8|0;h[b>>3]=+h[k>>3];i=j+8|0;h[j>>3]=+h[k+8>>3];b:do if(p){j=2;b=k+16|0;while(1){if((j|0)==(e|0))break b;h[(c[f+(j<<2)>>2]|0)+(o<<3)>>3]=+h[b>>3];j=j+1|0;b=b+8|0;}}while(0);j=(l&255)>1?1:n;b=m;}while(0);n=j;o=o+1|0;j=i;}while(1){if((b|0)>=(e|0))break;Ht(d,c[f+(b<<2)>>2]|0);b=b+1|0;}return n|0}function jn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0;d=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;n=un(b,b,0.0)|0;o=un(b,b,0.0)|0;a:do if(!(c[a+8>>2]|0)){e=0;while(1){if((e|0)>=(b|0))break a;i=c[a+(e*20|0)>>2]|0;j=a+(e*20|0)+4|0;k=n+(e<<2)|0;f=1;while(1){if((f|0)>=(i|0))break;m=c[(c[j>>2]|0)+(f<<2)>>2]|0;h[(c[n+(m<<2)>>2]|0)+(e<<3)>>3]=-1.0;h[(c[k>>2]|0)+(m<<3)>>3]=-1.0;f=f+1|0;}e=e+1|0;}}else {e=0;while(1){if((e|0)>=(b|0))break a;i=c[a+(e*20|0)>>2]|0;j=a+(e*20|0)+4|0;k=a+(e*20|0)+8|0;m=n+(e<<2)|0;f=1;while(1){if((f|0)>=(i|0))break;p=c[(c[j>>2]|0)+(f<<2)>>2]|0;l=-1.0/+g[(c[k>>2]|0)+(f<<2)>>2];h[(c[n+(p<<2)>>2]|0)+(e<<3)>>3]=l;h[(c[m>>2]|0)+(p<<3)>>3]=l;f=f+1|0;}e=e+1|0;}}while(0);b:do if(!(wr(b,n,o)|0)){U1(d);d=0;}else {f=0;j=0;m=b;while(1){if((j|0)>=(b|0))break b;k=o+(j<<2)|0;e=j;i=f;while(1){if((e|0)==(b|0))break;if((j|0)==(e|0))l=0.0;else {p=c[k>>2]|0;l=+h[(c[o+(e<<2)>>2]|0)+(e<<3)>>3]+ +h[p+(j<<3)>>3]+ +h[p+(e<<3)>>3]*-2.0;}g[d+(i<<2)>>2]=l;e=e+1|0;i=i+1|0;}f=f+m|0;j=j+1|0;m=m+-1|0;}}while(0);vn(n);vn(o);return d|0}function kn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+16|0;q=r;if(c[a+8>>2]|0){d=ln(a,b)|0;f=0.0;e=0;p=0;while(1){if((p|0)>=(b|0))break;e=e+p|0;o=c[a+(p*20|0)>>2]|0;k=a+(p*20|0)+4|0;m=(O(p,b)|0)-e|0;n=a+(p*20|0)+8|0;j=1;while(1){if((j|0)>=(o|0))break;i=c[(c[k>>2]|0)+(j<<2)>>2]|0;if((i|0)>=(p|0)){i=d+(m+i<<2)|0;s=+g[(c[n>>2]|0)+(j<<2)>>2];f=f+ +B(+(+g[i>>2]-s));g[i>>2]=s;}j=j+1|0;}p=p+1|0;}if(0);}else d=0;l=r;return d|0}function ln(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;h=m;i=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;j=JK(b<<2)|0;ur(h,b);d=0;f=0;k=b;while(1){if((d|0)>=(b|0))break;hs(d,a,b,j);e=d;g=f;while(1){if((e|0)==(b|0))break;c[i+(g<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;g=g+1|0;}d=d+1|0;f=f+k|0;k=k+-1|0;}U1(j);vr(h);l=m;return i|0}function mn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;i=n;j=JK(((O(b+1|0,b)|0)/2|0)<<2)|0;k=JK(b<<2)|0;ur(i,b);d=0;f=0;m=b;while(1){if((d|0)>=(b|0))break;qr(d,a,b,k,i);e=d;h=f;while(1){if((e|0)==(b|0))break;g[j+(h<<2)>>2]=+(c[k+(e<<2)>>2]|0);e=e+1|0;h=h+1|0;}d=d+1|0;f=f+m|0;m=m+-1|0;}U1(k);vr(i);l=n;return j|0}function nn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=a+8|0;d=c[r>>2]|0;e=0;f=0;while(1){if((f|0)>=(b|0))break;e=(c[a+(f*20|0)>>2]|0)+e|0;f=f+1|0;}f=JK(e<<2)|0;q=JK(b<<2)|0;e=0;while(1){if((e|0)>=(b|0))break;c[q+(e<<2)>>2]=0;e=e+1|0;}if(!(c[r>>2]|0)){h=0;while(1){if((h|0)>=(b|0))break;c[a+(h*20|0)+8>>2]=f;Zs(a,h,q);i=a+(h*20|0)|0;j=c[i>>2]|0;k=a+(h*20|0)+4|0;l=+(j+-1|0);e=1;while(1){if((e|0)>=(j|0))break;p=c[(c[k>>2]|0)+(e<<2)>>2]|0;s=+((c[a+(p*20|0)>>2]|0)+-1|0)+l;g[f+(e<<2)>>2]=s-+((Ys(a,h,p,q)|0)<<1|0);e=e+1|0;}_s(a,h,q);f=f+(c[i>>2]<<2)|0;h=h+1|0;}f=mn(a,b)|0;}else {j=0;while(1){if((j|0)>=(b|0))break;Zs(a,j,q);k=a+(j*20|0)|0;m=c[k>>2]|0;n=a+(j*20|0)+4|0;o=m+-2|0;p=a+(j*20|0)+8|0;i=1;while(1){if((i|0)>=(m|0))break;e=c[(c[n>>2]|0)+(i<<2)>>2]|0;h=o+(c[a+(e*20|0)>>2]|0)|0;s=+(h-((Ys(a,j,e,q)|0)<<1)|0);l=+g[(c[p>>2]|0)+(i<<2)>>2];if(l>2]=l;i=i+1|0;}_s(a,j,q);c[p>>2]=f;f=f+(c[k>>2]<<2)|0;j=j+1|0;}f=ln(a,b)|0;}U1(q);U1(c[r>>2]|0);c[r>>2]=0;a:do if(d|0){e=0;while(1){if((e|0)>=(b|0))break a;c[a+(e*20|0)+8>>2]=d;d=d+(c[a+(e*20|0)>>2]<<2)|0;e=e+1|0;}}while(0);return f|0}function on(a,b,e,f,i,j,k,m,n){a=a|0;b=b|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0.0,w=0,x=0.0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0,P=0.0;M=l;l=l+80|0;L=M+56|0;K=M+48|0;A=M+40|0;u=M+32|0;t=M+24|0;s=M+16|0;p=M+8|0;o=M;q=k&4;J=k&3;a:do if((n|0)<0)e=0;else {if(0);k=(m|0)==2;b:do if(k){if(0);e=nn(a,b)|0;w=14;}else {switch(m|0){case 1:{e=jn(a,b)|0;if(e|0){I=e;break b}gA(0,93315,o)|0;gA(3,93364,p)|0;w=15;break b}case 3:break;default:{w=15;break b}}if(0);e=kn(a,b)|0;w=14;}while(0);if((w|0)==14)if(!e)w=15;else I=e;do if((w|0)==15){if(0);if(!(c[a+8>>2]|0)){I=mn(a,b)|0;break}else {I=ln(a,b)|0;break}}while(0);if(0);c:do if((b|0)>1&(q|0)!=0)if((pn(a,b,f,j,q,J,k&1)|0)<0){u=0;t=0;e=-1;a=0;s=0;q=0;p=0;o=0;m=0;k=0;}else {k=0;while(1){if((k|0)>=(j|0)){y=0;w=35;break c}m=f+(k<<2)|0;r=1.0;e=0;while(1){if((e|0)==(b|0))break;x=+B(+(+h[(c[m>>2]|0)+(e<<3)>>3]));r=x>r?x:r;e=e+1|0;}r=1.0/r;e=0;while(1){if((e|0)==(b|0)){e=0;break}H=(c[m>>2]|0)+(e<<3)|0;h[H>>3]=+h[H>>3]*r;e=e+1|0;}while(1){if((e|0)==(b|0))break;x=(+B5()+-.5)*1.0e-06;H=(c[m>>2]|0)+(e<<3)|0;h[H>>3]=+h[H>>3]+x;e=e+1|0;}Ht(b,c[m>>2]|0);k=k+1|0;}}else {y=hn(0,b,j,f,i)|0;w=35;}while(0);d:do if((w|0)==35){if(0);if((b|0)==1|(n|0)==0){e=0;break a}if(0);s=j<<2;H=JK(s)|0;t=b<<2;a=O(t,j)|0;G=JK(a)|0;e=0;while(1){if((e|0)>=(j|0))break;m=G+((O(e,b)|0)<<2)|0;c[H+(e<<2)>>2]=m;o=f+(e<<2)|0;k=0;while(1){if((k|0)>=(b|0))break;g[m+(k<<2)>>2]=+h[(c[o>>2]|0)+(k<<3)>>3];k=k+1|0;}e=e+1|0;}e:do if(!J){p=b+-1|0;e=0;r=0.0;o=0;while(1){if((o|0)>=(p|0))break e;q=b-o|0;m=e;k=1;while(1){e=m+1|0;if((k|0)>=(q|0))break;m=e;r=+g[I+(e<<2)>>2]+r;k=k+1|0;}o=o+1|0;}}else r=+(b|0)*.5*+(b+-1|0);while(0);C=(O(b+1|0,b)|0)/2|0;D=(J|0)==2;if(D)bu(C,I);cu(C,I);E=b<<3;m=JK(E)|0;Y6(m|0,0,E|0)|0;F=b+-1|0;e=0;o=0;while(1){if((o|0)>=(F|0)){e=b;k=0;o=0;break}p=b-o|0;v=0.0;k=1;while(1){e=e+1|0;if((k|0)>=(p|0))break;x=+g[I+(e<<2)>>2];z=m+(k+o<<3)|0;h[z>>3]=+h[z>>3]-x;v=v+x;k=k+1|0;}z=m+(o<<3)|0;h[z>>3]=+h[z>>3]-v;o=o+1|0;}while(1){if((k|0)>=(b|0))break;g[I+(o<<2)>>2]=+h[m+(k<<3)>>3];z=e+o|0;e=e+-1|0;k=k+1|0;o=z;}z=JK(s)|0;c[z>>2]=JK(a)|0;e=1;while(1){if((e|0)>=(j|0))break;c[z+(e<<2)>>2]=(c[z>>2]|0)+((O(e,b)|0)<<2);e=e+1|0;}p=JK(t)|0;o=JK(t)|0;k=JK(C<<2)|0;if(0);w=(y|0)==0;y=c[15712]|0;e=0;q=0;x=1797693134862315708145274.0e284;while(1){if(!(q<<24>>24==0&(e|0)<(n|0)))break;Y6(m|0,0,E|0)|0;if(D){du(C,I,k);u=0;a=0;}else {u=0;a=0;}while(1){if((u|0)>=(F|0)){q=b;s=0;a=0;break}t=b-u+-1|0;$t(t,0.0,o);q=0;while(1){if((q|0)>=(j|0))break;A=H+(q<<2)|0;$t(t,+g[(c[A>>2]|0)+(u<<2)>>2],p);Wt(t,p,-1.0,(c[A>>2]|0)+(u<<2)+4|0);bu(t,p);Vt(t,p,o,o);q=q+1|0;}eu(t,o);q=0;while(1){if((q|0)>=(t|0))break;s=o+(q<<2)|0;v=+g[s>>2];if(v>=3402823466385288598117041.0e14|v<0.0)g[s>>2]=0.0;q=q+1|0;}q=a+1|0;a=u+1|0;f:do if(D){v=0.0;s=0;while(1){if((s|0)>=(t|0))break f;A=k+(q<<2)|0;N=+g[A>>2]*+g[o+(s<<2)>>2];g[A>>2]=N;A=m+(a+s<<3)|0;h[A>>3]=+h[A>>3]-N;v=v+N;q=q+1|0;s=s+1|0;}}else {v=0.0;s=0;while(1){if((s|0)>=(t|0))break f;N=+g[o+(s<<2)>>2];g[k+(q<<2)>>2]=N;A=m+(a+s<<3)|0;h[A>>3]=+h[A>>3]-N;v=v+N;q=q+1|0;s=s+1|0;}}while(0);A=m+(u<<3)|0;h[A>>3]=+h[A>>3]-v;u=a;a=q;}while(1){if((s|0)>=(b|0)){q=0;break}g[k+(a<<2)>>2]=+h[m+(s<<3)>>3];A=q+a|0;q=q+-1|0;s=s+1|0;a=A;}while(1){if((q|0)>=(j|0)){v=0.0;q=0;break}Tt(k,b,c[H+(q<<2)>>2]|0,c[z+(q<<2)>>2]|0);q=q+1|0;}while(1){if((q|0)>=(j|0))break;v=+Zt(b,c[H+(q<<2)>>2]|0,c[z+(q<<2)>>2]|0)+v;q=q+1|0;}v=v*2.0+r;q=0;while(1){if((q|0)>=(j|0))break;A=H+(q<<2)|0;Tt(I,b,c[A>>2]|0,p);v=v-+Zt(b,c[A>>2]|0,p);q=q+1|0;}P=x-v;N=+h[23294];q=(v=0.0?P:-P)/x=(j|0))break;t=H+(a<<2)|0;s=c[t>>2]|0;g:do if(w){if((Ar(I,s,c[z+(a<<2)>>2]|0,b,.001,b)|0)<0){u=z;t=I;e=-1;a=G;s=H;q=z;break d}}else {Yt(b,s,p);if((Ar(I,p,c[z+(a<<2)>>2]|0,b,.001,b)|0)<0){u=z;t=I;e=-1;a=G;s=H;q=z;break d}else s=0;while(1){if((s|0)>=(b|0))break g;if((d[(c[(c[i+(s<<2)>>2]|0)+16>>2]|0)+119>>0]|0)<=1)c[(c[t>>2]|0)+(s<<2)>>2]=c[p+(s<<2)>>2];s=s+1|0;}}while(0);a=a+1|0;}if(((e|0)%5|0|0)==0&0!=0?(h[K>>3]=v,w4(y,90371,K)|0,((e+5|0)%50|0|0)==0):0)E6(10,y)|0;e=e+1|0;x=v;}if(!0)q=0;while(1){if((q|0)>=(j|0)){u=z;t=I;a=G;s=H;q=z;break d}a=H+(q<<2)|0;t=f+(q<<2)|0;s=0;while(1){if((s|0)>=(b|0))break;h[(c[t>>2]|0)+(s<<3)>>3]=+g[(c[a>>2]|0)+(s<<2)>>2];s=s+1|0;}q=q+1|0;}}while(0);U1(a);U1(s);U1(t);if(u|0){U1(c[u>>2]|0);U1(q);}U1(p);U1(o);U1(m);U1(k);}while(0);l=M;return e|0}function pn(b,d,e,f,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;var m=0,n=0,o=0,p=0.0,q=0,r=0,s=0.0,t=0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0;R=l;l=l+32|0;o=R+24|0;Q=R+8|0;H=R+4|0;N=R;M=(d|0)<50?d:50;P=KK(M<<2)|0;G=d<<3;n=KK(O(G,M)|0)|0;m=0;while(1){if((m|0)>=(M|0))break;c[P+(m<<2)>>2]=n+((O(m,d)|0)<<3);m=m+1|0;}E=M<<1;E=(E|0)>50?E:50;E=(E|0)>(d|0)?d:E;c[o>>2]=0;rs(b,d,E,o,k);ss(c[o>>2]|0,d,E);mu(c[o>>2]|0,E,d,P,M);U1(c[c[o>>2]>>2]|0);U1(c[o>>2]|0);E=d<<2;L=KK(E)|0;m=0;while(1){if((m|0)>=(d|0))break;c[L+(m<<2)>>2]=-1;m=m+1|0;}ur(Q,d);J=c[b+8>>2]|0;I=(k|0)!=0;if(I)dt(b,d);C=KK(E)|0;K=KK(160)|0;n=KK(d*160|0)|0;D=KK(160)|0;m=0;while(1){if((m|0)==40)break;c[D+(m<<2)>>2]=n+((O(m,d)|0)<<2);m=m+1|0;}m=(x5()|0)%(d|0)|0;c[L+(m<<2)>>2]=0;c[K>>2]=m;n=c[D>>2]|0;if(I){bs(m,b,d,n);n=0;o=0;}else {qr(m,b,d,n,Q);n=0;o=0;}while(1){if((o|0)>=(d|0)){r=1;break}F=c[(c[D>>2]|0)+(o<<2)>>2]|0;c[C+(o<<2)>>2]=F;A=(F|0)>(n|0);m=A?o:m;n=A?F:n;o=o+1|0;}while(1){if((r|0)==40){m=0;break}c[L+(m<<2)>>2]=r;c[K+(r<<2)>>2]=m;t=D+(r<<2)|0;n=c[t>>2]|0;if(I){bs(m,b,d,n);q=0;n=0;}else {qr(m,b,d,n,Q);q=0;n=0;}while(1){if((q|0)>=(d|0))break;o=C+(q<<2)|0;F=c[o>>2]|0;k=c[(c[t>>2]|0)+(q<<2)>>2]|0;k=(F|0)<(k|0)?F:k;c[o>>2]=k;if((k|0)<=(n|0)){if((k|0)==(n|0)?((x5()|0)%(q+1|0)|0|0)==0:0){n=c[o>>2]|0;m=q;}}else {n=k;m=q;}q=q+1|0;}r=r+1|0;}while(1){if((m|0)>=(d|0))break;c[C+(m<<2)>>2]=-1;m=m+1|0;}w=KK(E)|0;F=KK(d<<4)|0;x=d+-1|0;y=x<<2;A=0;o=0;k=0;n=0;z=0;while(1){if((z|0)>=(d|0))break;m=L+(z<<2)|0;a:do if((c[m>>2]|0)>-1){t=F+(z<<4)+4|0;c[t>>2]=KK(y)|0;v=KK(y)|0;c[F+(z<<4)+8>>2]=v;c[F+(z<<4)>>2]=x;a[F+(z<<4)+12>>0]=1;r=D+(c[m>>2]<<2)|0;m=0;while(1){if((m|0)==(z|0)){q=z;break}c[(c[t>>2]|0)+(m<<2)>>2]=m;c[v+(m<<2)>>2]=c[(c[r>>2]|0)+(m<<2)>>2];m=m+1|0;}while(1){m=q+1|0;if((q|0)==(x|0)){m=x;break a}c[(c[t>>2]|0)+(q<<2)>>2]=m;c[v+(q<<2)>>2]=c[(c[r>>2]|0)+(m<<2)>>2];q=m;}}else {if((n|0)<40){k=KK(E)|0;o=KK(E)|0;n=d;m=1;}else m=0;a[F+(z<<4)+12>>0]=m;c[F+(z<<4)+4>>2]=k;c[F+(z<<4)+8>>2]=o;c[F+(z<<4)>>2]=40;m=0;while(1){if((m|0)==40)break;c[k+(m<<2)>>2]=c[K+(m<<2)>>2];c[o+(m<<2)>>2]=c[(c[D+(m<<2)>>2]|0)+(z<<2)>>2];m=m+1|0;}o=o+160|0;k=k+160|0;n=n+-40|0;m=40;}while(0);A=m+A|0;z=z+1|0;}U1(C);U1(w);if(D|0){U1(c[D>>2]|0);U1(D);}D=KK(d*20|0)|0;q=A+d<<2;r=KK(q)|0;v=(j|0)==2;q=KK(q)|0;t=0;while(1){if((t|0)>=(d|0))break;c[D+(t*20|0)+4>>2]=r;c[D+(t*20|0)+8>>2]=q;m=(c[F+(t<<4)>>2]|0)+1|0;w=D+(t*20|0)|0;c[w>>2]=m;o=(c[F+(t<<4)+8>>2]|0)+-4|0;k=F+(t<<4)+4|0;b:do if(v){p=0.0;n=1;while(1){if((n|0)>=(m|0))break b;c[r+(n<<2)>>2]=c[(c[k>>2]|0)+(n+-1<<2)>>2];u=+(c[o+(n<<2)>>2]|0);u=-1.0/(u*u);g[q+(n<<2)>>2]=u;p=p-u;n=n+1|0;m=c[w>>2]|0;}}else {p=0.0;n=1;while(1){if((n|0)>=(m|0))break b;c[r+(n<<2)>>2]=c[(c[k>>2]|0)+(n+-1<<2)>>2];u=-1.0/+(c[o+(n<<2)>>2]|0);g[q+(n<<2)>>2]=u;p=p-u;n=n+1|0;m=c[w>>2]|0;}}while(0);c[r>>2]=t;g[q>>2]=p;E=c[w>>2]|0;q=q+(E<<2)|0;r=r+(E<<2)|0;t=t+1|0;}C=KK(f<<2)|0;c[C>>2]=KK(O(f<<3,M)|0)|0;m=1;while(1){if((m|0)>=(f|0))break;c[C+(m<<2)>>2]=(c[C>>2]|0)+((O(m,M)|0)<<3);m=m+1|0;}c:do if(i){m=0;while(1){if((m|0)>=(f|0))break;o=C+(m<<2)|0;n=0;while(1){if((n|0)>=(M|0))break;h[(c[o>>2]|0)+(n<<3)>>3]=0.0;n=n+1|0;}m=m+1|0;}if((f|0)!=2){m=0;while(1){if((m|0)>=(f|0)){m=0;break c}h[(c[C+(m<<2)>>2]|0)+(m<<3)>>3]=1.0;m=m+1|0;}}h[c[C>>2]>>3]=1.0;m=C+4|0;if(!((nu(P,M,d,c[m>>2]|0)|0)<<24>>24)){n=c[m>>2]|0;m=0;while(1){if((m|0)>=(M|0))break;h[n+(m<<3)>>3]=0.0;m=m+1|0;}h[n+8>>3]=1.0;m=0;}else m=0;}else {n=0;while(1){if((n|0)>=(f|0)){m=0;break c}o=C+(n<<2)|0;m=0;while(1){if((m|0)>=(M|0))break;u=+(x5()|0)*4.656612875245797e-10;h[(c[o>>2]|0)+(m<<3)>>3]=u;m=m+1|0;}n=n+1|0;}}while(0);while(1){if((m|0)>=(f|0))break;Rt(P,d,M,c[C+(m<<2)>>2]|0,c[e+(m<<2)>>2]|0);m=m+1|0;}c[H>>2]=0;c[N>>2]=0;Gt(D,P,d,M,H);Et(P,c[H>>2]|0,M,d,M,N);U1(c[c[H>>2]>>2]|0);U1(c[H>>2]|0);z=KK(G)|0;A=KK(M<<3)|0;m=0;n=0;p=+rn(e,F,f,d,j);d:while(1){if((n|0)<50&m<<24>>24==0)x=0;else break;while(1){if((x|0)>=(f|0))break;y=e+(x<<2)|0;o=0;while(1){if((o|0)>=(d|0))break;q=z+(o<<3)|0;h[q>>3]=0.0;r=(c[F+(o<<4)+8>>2]|0)+-4|0;t=c[D+(o*20|0)+4>>2]|0;v=c[D+(o*20|0)+8>>2]|0;w=D+(o*20|0)|0;s=0.0;k=1;while(1){if((k|0)>=(c[w>>2]|0))break;m=c[t+(k<<2)>>2]|0;u=+ft(e,f,o,m);if(u>1.0e-30){u=-(+g[v+(k<<2)>>2]*+(c[r+(k<<2)>>2]|0))/u;h[q>>3]=u*+h[(c[y>>2]|0)+(m<<3)>>3]+ +h[q>>3];s=s-u;}k=k+1|0;}h[q>>3]=+h[q>>3]+ +h[(c[y>>2]|0)+(o<<3)>>3]*s;o=o+1|0;}Dt(P,M,d,z,A);m=C+(x<<2)|0;if(zr(c[N>>2]|0,c[m>>2]|0,A,M,.001,M,0)|0){n=-1;break d}Rt(P,d,M,c[m>>2]|0,c[y>>2]|0);x=x+1|0;}if(!(n&1)){u=+rn(e,F,f,d,j);p=+B(+(u-p))/(u+1.0e-10);m=p<+h[23294]&1;p=u;}else m=0;n=n+1|0;}U1(A);U1(z);if(I){et(b,d,J);m=0;}else m=0;while(1){if((m|0)>=(d|0))break;if(a[F+(m<<4)+12>>0]|0){U1(c[F+(m<<4)+4>>2]|0);U1(c[F+(m<<4)+8>>2]|0);}m=m+1|0;}U1(F);U1(c[D+4>>2]|0);U1(c[D+8>>2]|0);U1(D);U1(L);U1(K);U1(c[C>>2]|0);U1(C);m=c[N>>2]|0;if(m|0){U1(c[m>>2]|0);U1(c[N>>2]|0);}U1(c[P>>2]|0);U1(P);vr(Q);l=R;return n|0}function qn(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0;q=e+-1|0;o=(f|0)==2;h=0.0;f=0;m=0;while(1){if((m|0)>=(q|0))break;p=e-m|0;n=1;while(1){f=f+1|0;if((n|0)>=(p|0))break;k=n+m|0;i=0.0;j=0;while(1){if((j|0)>=(d|0))break;r=c[a+(j<<2)>>2]|0;l=+g[r+(m<<2)>>2]-+g[r+(k<<2)>>2];i=i+l*l;j=j+1|0;}i=+C(+i);l=+g[b+(f<<2)>>2];if(o){i=1.0/+C(+l)-i;i=i*i;}else {i=1.0/l-i;i=i*i;}n=n+1|0;h=i*l+h;}m=m+1|0;}return +h}function rn(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0;a:do if((f|0)==2){g=0.0;l=0;while(1){if((l|0)>=(e|0))break a;n=c[b+(l<<4)>>2]|0;o=b+(l<<4)+4|0;m=b+(l<<4)+8|0;k=0;while(1){if((k|0)>=(n|0))break;j=c[(c[o>>2]|0)+(k<<2)>>2]|0;if((j|0)>(l|0)){i=0.0;f=0;while(1){if((f|0)>=(d|0))break;q=c[a+(f<<2)>>2]|0;p=+h[q+(l<<3)>>3]-+h[q+(j<<3)>>3];i=p*p+i;f=f+1|0;}i=+C(+i);p=+(c[(c[m>>2]|0)+(k<<2)>>2]|0);i=p-i;g=i*i/(p*p)+g;}k=k+1|0;}l=l+1|0;}}else {l=0;g=0.0;while(1){if((l|0)>=(e|0))break a;m=c[b+(l<<4)>>2]|0;n=b+(l<<4)+4|0;o=b+(l<<4)+8|0;k=0;while(1){if((k|0)>=(m|0))break;j=c[(c[n>>2]|0)+(k<<2)>>2]|0;if((j|0)>(l|0)){i=0.0;f=0;while(1){if((f|0)>=(d|0))break;q=c[a+(f<<2)>>2]|0;p=+h[q+(l<<3)>>3]-+h[q+(j<<3)>>3];i=p*p+i;f=f+1|0;}i=+C(+i);p=+(c[(c[o>>2]|0)+(k<<2)>>2]|0);i=p-i;g=i*i/p+g;}k=k+1|0;}l=l+1|0;}}while(0);return +g}function sn(a){a=+a;return +(+C(+a)*a)}function tn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0;g=c[47137]|0;e=0.0;f=0;while(1){if((f|0)>=(g|0))break;i=+h[a+(f<<3)>>3]-+h[b+(f<<3)>>3];h[d+(f<<3)>>3]=i;e=i*i+e;f=f+1|0;}return +(+C(+e))}function un(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,i=0;i=JK(a<<2)|0;f=0;g=JK(O(a<<3,b)|0)|0;while(1){if((f|0)>=(a|0))break;c[i+(f<<2)>>2]=g;e=0;while(1){if((e|0)>=(b|0))break;h[g+(e<<3)>>3]=d;e=e+1|0;}f=f+1|0;g=g+(b<<3)|0;}return i|0}function vn(a){a=a|0;if(a|0){U1(c[a>>2]|0);U1(a);}return}function wn(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+16|0;n=tB(b)|0;m=uB(b)|0;k=GA(b,2,92493,0)|0;a:do if(!d){h[23294]=+(n|0)*.0001;pK(b,108886,186352);g=QA(c[b+60>>2]|0,90100)|0;if(!g)e=.99;else e=+r5(g);h[23296]=e;g=JK((n<<2)+4|0)|0;j=b+16|0;c[(c[j>>2]|0)+152>>2]=g;g=0;e=0.0;i=jC(b)|0;while(1){if(!i)break a;c[(c[(c[j>>2]|0)+152>>2]|0)+(g<<2)>>2]=i;p=c[i+16>>2]|0;c[p+120>>2]=g;c[p+124>>2]=-1;f=+zn(b,i,k)+e;g=g+1|0;e=f;i=kC(b,i)|0;}}else {h[23294]=.0001;pK(b,108886,186352);g=0;e=0.0;i=jC(b)|0;while(1){if(!i)break a;c[(c[i+16>>2]|0)+120>>2]=g;f=+zn(b,i,k)+e;g=g+1|0;e=f;i=kC(b,i)|0;}}while(0);g=QA(b,90108)|0;if((g|0)!=0?(a[g>>0]|0)!=0:0){e=+h[23294];f=+r5(g);if(!(e>f))e=f;}else e=e/+(((m|0)>1?m:1)|0)*+C(+(+(n|0)))+1.0;h[23295]=e;if(!(c[47134]|d)){d=un(n,n,e)|0;p=b+16|0;c[(c[p>>2]|0)+160>>2]=d;d=un(n,n,1.0)|0;c[(c[p>>2]|0)+164>>2]=d;d=un(n,c[47137]|0,1.0)|0;c[(c[p>>2]|0)+168>>2]=d;d=An(n,n,c[47137]|0)|0;c[(c[p>>2]|0)+172>>2]=d;}l=o;return n|0}function xn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=0;e=0;j=aB(a,b)|0;a:while(1){if(!j)break;h=c[j>>2]&3;g=c[((h|0)==2?j:j+-48|0)+40>>2]|0;h=c[((h|0)==3?j:j+48|0)+40>>2]|0;do if((g|0)!=(h|0)){i=(h|0)==(b|0);if((e|0)!=1){f=i?g:h;c[d>>2]=f;e=e+1|0;break}if(!((g|0)==(f|0)&i)?!((g|0)==(b|0)&(h|0)==(f|0)):0){e=2;break a}else e=1;}while(0);j=bB(a,j,b)|0;}return e|0}function yn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=a+60|0;a:while(1){b:while(1){if(!b)break a;switch(xn(a,b,f)|0){case 0:{e=5;break b}case 1:{e=8;break b}default:b=0;}}if((e|0)==5){if((d|0)==(b|0))d=kC(a,d)|0;wC(c[g>>2]|0,b)|0;b=0;continue}else if((e|0)==8){if((d|0)==(b|0))d=kC(a,d)|0;wC(c[g>>2]|0,b)|0;b=c[f>>2]|0;continue}}l=h;return d|0}function zn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0;k=l;l=l+32|0;i=k+8|0;g=k;b=XA(a,b)|0;e=0.0;while(1){if(!b)break;switch(Bn(b,d,g)|0){case 0:{f=+h[g>>3];break}case 2:{c[i>>2]=KB(a)|0;h[i+8>>3]=1.0;gA(3,90120,i)|0;j=6;break}default:j=6;}if((j|0)==6){j=0;h[g>>3]=1.0;f=1.0;}h[(c[b+16>>2]|0)+136>>3]=f;b=ZA(a,b)|0;e=f+e;}l=k;return +e}function An(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,l=0;j=JK((a<<2)+4|0)|0;k=(b<<2)+4|0;l=d<<3;g=0;while(1){if((g|0)>=(a|0))break;i=j+(g<<2)|0;c[i>>2]=JK(k)|0;f=0;while(1){if((f|0)>=(b|0))break;e=JK(l)|0;c[(c[i>>2]|0)+(f<<2)>>2]=e;e=0;while(1){if((e|0)>=(d|0))break;h[(c[(c[i>>2]|0)+(f<<2)>>2]|0)+(e<<3)>>3]=0.0;e=e+1|0;}f=f+1|0;}c[(c[i>>2]|0)+(f<<2)>>2]=0;g=g+1|0;}c[j+(g<<2)>>2]=0;return j|0}function Bn(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;j=k+8|0;i=k;do if((d|0)!=0?(f=RA(b,d)|0,(a[f>>0]|0)!=0):0){c[i>>2]=e;if(((b5(f,101209,i)|0)>=1?(g=+h[e>>3],!(g<0.0)):0)?g!=0.0|(c[47134]|0)!=0:0){b=0;break}c[j>>2]=f;gA(0,90147,j)|0;b=2;}else b=1;while(0);l=k;return b|0}function Cn(a){a=a|0;return wn(a,0)|0}function Dn(a){a=a|0;a=a+16|0;U1(c[(c[a>>2]|0)+152>>2]|0);if(!(c[47134]|0)){vn(c[(c[a>>2]|0)+160>>2]|0);vn(c[(c[a>>2]|0)+164>>2]|0);vn(c[(c[a>>2]|0)+168>>2]|0);En(c[(c[a>>2]|0)+172>>2]|0);c[(c[a>>2]|0)+172>>2]=0;}return}function En(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(a|0){f=0;while(1){g=a+(f<<2)|0;b=c[g>>2]|0;if(!b)break;else e=0;while(1){d=c[b+(e<<2)>>2]|0;if(!d)break;U1(d);e=e+1|0;b=c[g>>2]|0;}U1(b);f=f+1|0;}U1(a);}return}function Fn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0;e=+(b|0);b=a+16|0;while(1){if((d|0)>=(c[47137]|0))break;f=+B5()*e;h[(c[(c[b>>2]|0)+132>>2]|0)+(d<<3)>>3]=f;d=d+1|0;}return}function Gn(a,b){a=a|0;b=b|0;Fn(a,b,2);return}function Hn(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0;e=+(b|0);f=+B5()*e;d=a+16|0;h[c[(c[d>>2]|0)+132>>2]>>3]=f;e=+B5()*e;h[(c[(c[d>>2]|0)+132>>2]|0)+8>>3]=e;if((c[47137]|0)>2)Gn(a,b);return}function In(b,d){b=b|0;d=d|0;var e=0,f=0;f=l;l=l+16|0;e=f;if(0);d=nm(b,d,2)|0;a:do if((d|0)!=1){if(!(c[46797]|d)){gA(0,90192,e)|0;c[46797]=1;}e=b+16|0;d=0;while(1){b=c[(c[(c[e>>2]|0)+152>>2]|0)+(d<<2)>>2]|0;if(!b)break a;if(!(a[(c[b+16>>2]|0)+119>>0]|0))Hn(b,1);d=d+1|0;}}while(0);l=f;return}function Jn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=l;l=l+96|0;p=q+80|0;n=q;if(0);o=a+16|0;f=c[o>>2]|0;k=c[f+164>>2]|0;f=c[f+160>>2]|0;m=0;while(1){if((m|0)>=(b|0))break;i=f+(m<<2)|0;j=k+(m<<2)|0;e=0;while(1){if((e|0)==(m|0))break;g=+h[(c[i>>2]|0)+(e<<3)>>3];g=1.0/(g*g);d=c[(c[o>>2]|0)+152>>2]|0;d=iB(a,c[d+(m<<2)>>2]|0,c[d+(e<<2)>>2]|0,0,0)|0;if(d)g=+h[(c[d+16>>2]|0)+128>>3]*g;h[(c[k+(e<<2)>>2]|0)+(m<<3)>>3]=g;h[(c[j>>2]|0)+(e<<3)>>3]=g;e=e+1|0;}m=m+1|0;}a=c[47137]|0;e=0;while(1){if((e|0)<(b|0))d=0;else break;while(1){if((d|0)>=(a|0))break;h[(c[(c[(c[o>>2]|0)+168>>2]|0)+(e<<2)>>2]|0)+(d<<3)>>3]=0.0;d=d+1|0;}e=e+1|0;}i=0;while(1){d=c[(c[(c[o>>2]|0)+152>>2]|0)+(i<<2)>>2]|0;if(!d)break;a=d+16|0;d=0;while(1){if((d|0)>=(b|0))break;a:do if((i|0)!=(d|0)){g=+tn(c[(c[a>>2]|0)+132>>2]|0,c[(c[(c[(c[(c[o>>2]|0)+152>>2]|0)+(d<<2)>>2]|0)+16>>2]|0)+132>>2]|0,n);f=c[47137]|0;g=1.0/g;e=0;while(1){if((e|0)>=(f|0))break a;m=c[o>>2]|0;r=+h[n+(e<<3)>>3];r=(r-+h[(c[(c[m+160>>2]|0)+(i<<2)>>2]|0)+(d<<3)>>3]*r*g)*+h[(c[(c[m+164>>2]|0)+(i<<2)>>2]|0)+(d<<3)>>3];h[(c[(c[(c[m+172>>2]|0)+(i<<2)>>2]|0)+(d<<2)>>2]|0)+(e<<3)>>3]=r;m=(c[(c[m+168>>2]|0)+(i<<2)>>2]|0)+(e<<3)|0;h[m>>3]=+h[m>>3]+r;e=e+1|0;}}while(0);d=d+1|0;}i=i+1|0;}if(0);l=q;return}function Kn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0;i=l;l=l+32|0;g=i+24|0;f=i+8|0;e=i;j=+h[23294];h[23216]=j*j;while(1){d=Ln(a,b)|0;if(!d)break;Mn(a,b,d);}if(!0)b=a+16|0;b=c[(c[b>>2]|0)+156>>2]|0;if((b|0)==(c[47136]|0)){k=KB(a)|0;c[g>>2]=b;c[g+4>>2]=k;gA(0,90320,g)|0;}l=i;return}function Ln(a,b){a=a|0;b=b|0;var e=0.0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+16|0;q=r;o=(c[46799]|0)+1|0;c[46799]=o;a=c[a+16>>2]|0;if((c[a+156>>2]|0)<(c[47136]|0)){m=c[47137]|0;n=a+152|0;k=a+168|0;a=0;e=0.0;j=0;while(1){if((j|0)>=(b|0))break;g=c[(c[n>>2]|0)+(j<<2)>>2]|0;if((d[(c[g+16>>2]|0)+119>>0]|0)<=1){i=0.0;f=0;while(1){if((f|0)>=(m|0))break;s=+h[(c[(c[k>>2]|0)+(j<<2)>>2]|0)+(f<<3)>>3];i=s*s+i;f=f+1|0;}if(i>e){a=g;e=i;}}j=j+1|0;}if(!(e<+h[23216])){if(0!=0&((o|0)%100|0|0)==0?(p=c[15712]|0,h[q>>3]=+C(+e),w4(p,90371,q)|0,((c[46799]|0)%1e3|0|0)==0):0)E6(10,p)|0;}else a=0;}else a=0;l=r;return a|0}function Mn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o;k=d+16|0;m=c[(c[k>>2]|0)+120>>2]|0;f=c[46798]|0;if(!f){g=c[47137]|0;g=KK(O(g<<3,g)|0)|0;}else {g=c[47137]|0;g=MK(f,O(g<<3,g)|0)|0;}c[46798]=g;On(a,b,m,g);i=c[47137]|0;j=a+16|0;f=0;while(1){if((f|0)>=(i|0))break;h[185736+(f<<3)>>3]=-+h[(c[(c[(c[j>>2]|0)+168>>2]|0)+(m<<2)>>2]|0)+(f<<3)>>3];f=f+1|0;}Xu(g,185816,185736,i);f=0;while(1){if((f|0)>=(c[47137]|0))break;e=+h[23296];e=(1.0-e)*2.0*+B5()+e;i=185816+(f<<3)|0;e=e*+h[i>>3];h[i>>3]=e;i=(c[(c[k>>2]|0)+132>>2]|0)+(f<<3)|0;h[i>>3]=+h[i>>3]+e;f=f+1|0;}k=(c[j>>2]|0)+156|0;c[k>>2]=(c[k>>2]|0)+1;Pn(a,b,m);if(rP()|0);l=o;return}function Nn(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0;q=b+-1|0;n=a+16|0;o=c[47137]|0;g=0;d=0.0;a:while(1){if((g|0)>=(q|0))break;m=c[n>>2]|0;p=c[m+152>>2]|0;j=g+1|0;k=(c[p+(g<<2)>>2]|0)+16|0;l=m+164|0;m=m+160|0;i=j;while(1){if((i|0)>=(b|0)){g=j;continue a}f=(c[p+(i<<2)>>2]|0)+16|0;a=0;e=0.0;while(1){if((a|0)>=(o|0))break;r=+h[(c[(c[k>>2]|0)+132>>2]|0)+(a<<3)>>3]-+h[(c[(c[f>>2]|0)+132>>2]|0)+(a<<3)>>3];a=a+1|0;e=r*r+e;}r=+h[(c[(c[m>>2]|0)+(g<<2)>>2]|0)+(i<<3)>>3];r=((+C(+e)*-2.0+r)*r+e)*+h[(c[(c[l>>2]|0)+(g<<2)>>2]|0)+(i<<3)>>3]+d;i=i+1|0;d=r;}}return +d}function On(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+80|0;w=x;v=c[a+16>>2]|0;k=c[v+164>>2]|0;m=c[v+160>>2]|0;v=c[v+152>>2]|0;j=c[v+(d<<2)>>2]|0;g=c[47137]|0;a=0;while(1){if((a|0)>=(g|0))break;i=O(g,a)|0;f=0;while(1){if((f|0)==(g|0))break;h[e+(i+f<<3)>>3]=0.0;f=f+1|0;}a=a+1|0;}u=c[47137]|0;t=j+16|0;s=k+(d<<2)|0;k=m+(d<<2)|0;j=0;while(1){if((j|0)>=(b|0))break;a:do if((j|0)!=(d|0)){f=(c[v+(j<<2)>>2]|0)+16|0;r=0.0;a=0;while(1){if((a|0)>=(u|0))break;q=+h[(c[(c[t>>2]|0)+132>>2]|0)+(a<<3)>>3]-+h[(c[(c[f>>2]|0)+132>>2]|0)+(a<<3)>>3];h[w+(a<<3)>>3]=q;r=q*q+r;a=a+1|0;}n=1.0/+sn(r);i=0;while(1){if((i|0)>=(u|0))break a;f=(c[s>>2]|0)+(j<<3)|0;g=(c[k>>2]|0)+(j<<3)|0;o=+h[w+(i<<3)>>3];a=0;while(1){p=+h[f>>3];q=+h[g>>3];if((a|0)==(i|0))break;m=e+((O(u,a)|0)+i<<3)|0;h[m>>3]=+h[m>>3]+p*n*q*o*+h[w+(a<<3)>>3];a=a+1|0;}m=e+((O(u,i)|0)+i<<3)|0;h[m>>3]=(1.0-q*n*(r-o*o))*p+ +h[m>>3];i=i+1|0;}}while(0);j=j+1|0;}f=c[47137]|0;i=1;while(1){if((i|0)>=(f|0))break;g=O(f,i)|0;a=0;while(1){if((a|0)==(i|0))break;h[e+(g+a<<3)>>3]=+h[e+((O(f,a)|0)+i<<3)>>3];a=a+1|0;}i=i+1|0;}l=x;return}function Pn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0;m=l;l=l+80|0;k=m;j=a+16|0;f=c[j>>2]|0;g=c[(c[f+152>>2]|0)+(d<<2)>>2]|0;e=c[47137]|0;f=f+168|0;a=0;while(1){if((a|0)>=(e|0))break;h[(c[(c[f>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3]=0.0;a=a+1|0;}f=g+16|0;a=0;while(1){if((a|0)>=(b|0))break;a:do if((a|0)!=(d|0)){i=+tn(c[(c[f>>2]|0)+132>>2]|0,c[(c[(c[(c[(c[j>>2]|0)+152>>2]|0)+(a<<2)>>2]|0)+16>>2]|0)+132>>2]|0,k);g=c[47137]|0;i=1.0/i;e=0;while(1){if((e|0)>=(g|0))break a;n=c[j>>2]|0;q=c[n+172>>2]|0;r=(c[(c[q+(d<<2)>>2]|0)+(a<<2)>>2]|0)+(e<<3)|0;o=+h[k+(e<<3)>>3];o=(o-+h[(c[(c[n+160>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3]*o*i)*+h[(c[(c[n+164>>2]|0)+(d<<2)>>2]|0)+(a<<3)>>3];h[r>>3]=o;n=c[n+168>>2]|0;s=(c[n+(d<<2)>>2]|0)+(e<<3)|0;h[s>>3]=+h[s>>3]+o;q=(c[(c[q+(a<<2)>>2]|0)+(d<<2)>>2]|0)+(e<<3)|0;o=+h[q>>3];p=-+h[r>>3];h[q>>3]=p;n=(c[n+(a<<2)>>2]|0)+(e<<3)|0;h[n>>3]=p-o+ +h[n>>3];e=e+1|0;}}while(0);a=a+1|0;}l=m;return}function Qn(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0;d=a+16|0;g=c[46800]|0;b=c[(c[d>>2]|0)+124>>2]|0;while(1){if((b|0)<=0)break;i=(b+-1|0)/2|0;j=g+(i<<2)|0;e=c[j>>2]|0;f=e+16|0;if(+h[(c[f>>2]|0)+136>>3]<=+h[(c[d>>2]|0)+136>>3])break;c[j>>2]=a;c[(c[d>>2]|0)+124>>2]=i;c[g+(b<<2)>>2]=e;c[(c[f>>2]|0)+124>>2]=b;b=i;}return}function Rn(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;i=a+16|0;j=c[46801]|0;k=c[46800]|0;g=c[(c[i>>2]|0)+124>>2]|0;while(1){e=g<<1|1;if((e|0)>=(j|0))break;d=e+1|0;if((d|0)<(j|0)){f=c[k+(d<<2)>>2]|0;b=c[k+(e<<2)>>2]|0;if(+h[(c[f+16>>2]|0)+136>>3]<+h[(c[b+16>>2]|0)+136>>3]){e=d;b=f;}else l=6;}else {b=c[k+(e<<2)>>2]|0;l=6;}if((l|0)==6)l=0;d=b+16|0;if(+h[(c[i>>2]|0)+136>>3]<=+h[(c[d>>2]|0)+136>>3])break;c[k+(e<<2)>>2]=a;c[(c[i>>2]|0)+124>>2]=e;c[k+(g<<2)>>2]=b;c[(c[d>>2]|0)+124>>2]=g;g=e;}return}function Sn(a){a=a|0;var b=0,d=0;b=(c[a+16>>2]|0)+124|0;if((c[b>>2]|0)>=0)qa(90377,90397,643,90405);d=c[46801]|0;c[46801]=d+1;c[b>>2]=d;c[(c[46800]|0)+(d<<2)>>2]=a;if((d|0)>0)Qn(a);return}function Tn(){var a=0,b=0,d=0,e=0;b=c[46801]|0;if(!b)a=0;else {e=c[46800]|0;a=c[e>>2]|0;d=b+-1|0;c[46801]=d;d=c[e+(d<<2)>>2]|0;c[e>>2]=d;c[(c[d+16>>2]|0)+124>>2]=0;if((b|0)>2)Rn(d);c[(c[a+16>>2]|0)+124>>2]=-1;}return a|0}function Un(a,b){a=a|0;b=b|0;var d=0,e=0;e=l;l=l+16|0;d=e;c[46800]=JK((b<<2)+4|0)|0;if(0);b=jC(a)|0;while(1){if(!b)break;Vn(a,b);b=kC(a,b)|0;}if(0);U1(c[46800]|0);l=e;return}function Vn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0,i=0,j=0,k=0;e=c[(c[a+16>>2]|0)+152>>2]|0;f=+h[23295];d=0;while(1){g=c[e+(d<<2)>>2]|0;if(!g)break;h[(c[g+16>>2]|0)+136>>3]=f;d=d+1|0;}c[46802]=b;k=c[b+16>>2]|0;h[k+136>>3]=0.0;c[k+128>>2]=0;Sn(b);a:while(1){k=Tn()|0;if(!k)break;d=c[46802]|0;j=k+16|0;if((k|0)!=(d|0))Wn(a,d,k,+h[(c[j>>2]|0)+136>>3]);i=aB(a,k)|0;while(1){if(!i)continue a;d=c[i>>2]&3;b=c[((d|0)==3?i:i+48|0)+40>>2]|0;if((b|0)==(k|0))b=c[((d|0)==2?i:i+-48|0)+40>>2]|0;d=c[j>>2]|0;f=+h[(c[i+16>>2]|0)+136>>3]+ +h[d+136>>3];e=c[b+16>>2]|0;g=e+136|0;do if(+h[g>>3]>f){h[g>>3]=f;if((c[e+124>>2]|0)>-1){Qn(b);break}else {c[e+128>>2]=(c[d+128>>2]|0)+1;Sn(b);break}}while(0);i=bB(a,i,k)|0;}}return}function Wn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=+e;b=c[(c[b+16>>2]|0)+120>>2]|0;d=c[(c[d+16>>2]|0)+120>>2]|0;a=c[(c[a+16>>2]|0)+160>>2]|0;h[(c[a+(d<<2)>>2]|0)+(b<<3)>>3]=e;h[(c[a+(b<<2)>>2]|0)+(d<<3)>>3]=e;return}function Xn(a){a=a|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;Yn(a);return}function Yn(a){a=a|0;var b=0,d=0,e=0,f=0;b=tB(a)|0;e=JK(b*56|0)|0;b=JK((b<<2)+4|0)|0;f=a+16|0;c[(c[f>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;Zl(b);c[(c[b+16>>2]|0)+112>>2]=e+(d*56|0);c[(c[(c[f>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;b=kC(a,b)|0;d=d+1|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Zn(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Zn(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,0.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function _n(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+80|0;m=u+32|0;i=u+24|0;g=u+16|0;j=u;t=u+72|0;p=u+40|0;if(tB(b)|0){Xn(b);f=QA(b,95738)|0;if(f)if(a[f>>0]|0){d=tC(b,f,0)|0;if(!d){c[g>>2]=f;gA(0,90448,g)|0;gA(3,90488,i)|0;d=0;s=1;}else s=0;}else {d=0;s=1;}else {d=0;s=0;}n=GA(b,1,95738,0)|0;o=(n|0)!=0;f=QA(b,140742)|0;if((f|0?a[f>>0]|0:0)?(k=j+8|0,c[m>>2]=j,c[m+4>>2]=k,(b5(f,105503,m)|0)==1):0)h[k>>3]=+h[j>>3];if(tB(b)|0){m=DG(b,t,0)|0;if((c[t>>2]|0)==1){g=(d|0)!=0;do if(g)e=d;else {if(o?(e=$n(b,n)|0,e|0):0)break;e=0;}while(0);f=Zu(b,e)|0;if(!((e|0)!=0|o^1))KA(f,n,142463)|0;r=(jC(b)|0)+16|0;U1(c[(c[r>>2]|0)+112>>2]|0);c[(c[r>>2]|0)+112>>2]=0;or(b)|0;fn(b);d=(s|0)==0|g?d:f;}else {kH(b,2,8,p)|0;c[p+12>>2]=0;k=(s|0)==0;j=0;while(1){if((j|0)>=(c[t>>2]|0))break;g=c[m+(j<<2)>>2]|0;e=(d|0)!=0;if(e?(HC(g,d)|0)!=0:0)f=d;else r=23;do if((r|0)==23){r=0;if(o?(q=$n(g,n)|0,q|0):0){f=q;break}f=0;}while(0);KG(g)|0;i=Zu(g,f)|0;d=k|e?d:i;if(o?(f|0)==0|(f|0)==(d|0):0)KA(i,n,142463)|0;or(g)|0;j=j+1|0;}r=(jC(b)|0)+16|0;U1(c[(c[r>>2]|0)+112>>2]|0);c[(c[r>>2]|0)+112>>2]=0;jH(c[t>>2]|0,m,b,p)|0;fn(b);}e=0;while(1){if((e|0)>=(c[t>>2]|0))break;wC(b,c[m+(e<<2)>>2]|0)|0;e=e+1|0;}U1(m);}if(s|0)SA(b,95738,KB(d)|0)|0;tM(b);}l=u;return}function $n(a,b){a=a|0;b=b|0;var c=0;c=jC(a)|0;while(1){if(!c){c=0;break}if((dP(RA(c,b)|0)|0)<<24>>24)break;c=kC(a,c)|0;}return c|0}function ao(a){a=a|0;var b=0,c=0;b=jC(a)|0;if(b|0){while(1){if(!b)break;c=XA(a,b)|0;while(1){if(!c)break;YP(c);c=ZA(a,c)|0;}WP(b);b=kC(a,b)|0;}bo(a);}return}function bo(a){a=a|0;U1(c[(c[a+16>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function co(a){a=a|0;eo(a);if(!((tB(a)|0)==0?!(c[(c[a+16>>2]|0)+180>>2]|0):0)){nv(a);tM(a);}return}function eo(a){a=a|0;c[47147]=GA(a,1,108230,108236)|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;fo(a,0);go(a);return}function fo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;h=(b|0)==0;if(h){jo(g);b=g;}d=OD(a)|0;while(1){if(!d)break;if(!(Q2(KB(d)|0,108006,7)|0)){TC(d,137483,280,1)|0;ko(b,d);fo(d,0);}else fo(d,b);d=PD(d)|0;}if(h?(e=c[g+8>>2]|0,f=a+16|0,c[(c[f>>2]|0)+180>>2]=e,e|0):0){h=MK(c[g>>2]|0,(e<<2)+4|0)|0;c[(c[f>>2]|0)+184>>2]=h;}l=i;return}function go(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=JK((tB(a)|0)<<2)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;g=a+16|0;c[(c[g>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;TC(b,137447,304,1)|0;c[(c[b+16>>2]|0)+112>>2]=f+(d<<2);c[(c[(c[g>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;ho(b);e=XA(a,b)|0;while(1){if(!e)break;io(e);e=ZA(a,e)|0;}b=kC(a,b)|0;d=d+1|0;}return}function ho(a){a=a|0;SA(a,108230,108236)|0;return}function io(a){a=a|0;TC(a,137460,304,1)|0;return}function jo(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function ko(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function lo(a){a=a|0;var b=0,d=0;b=jC(a)|0;if(b|0){U1(c[(c[b+16>>2]|0)+112>>2]|0);while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;YP(d);d=ZA(a,d)|0;}WP(b);b=kC(a,b)|0;}mo(a);}return}function mo(a){a=a|0;U1(c[(c[a+16>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);return}function no(a){a=a|0;var d=0,e=0,f=0;oo(a);po(a,0);qo(a,0);ro(a,0);d=c[a+16>>2]|0;if(!(c[(c[d+8>>2]|0)+84>>2]|0)){d=b[d+136>>1]&14;if(d<<16>>16)Wm(a,d&65535)|0;}else {d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;e=c[f+132>>2]|0;h[e>>3]=+h[f+16>>3]*.013888888888888888;h[e+8>>3]=+h[f+24>>3]*.013888888888888888;d=kC(a,d)|0;}Zm(a,1);}tM(a);return}function oo(a){a=a|0;var d=0,e=0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;d=jC(a)|0;while(1){if(!d)break;Zl(d);d=kC(a,d)|0;}e=jC(a)|0;while(1){if(!e)break;d=XA(a,e)|0;while(1){if(!d)break;TC(d,137460,176,1)|0;tP(d)|0;d=ZA(a,d)|0;}e=kC(a,e)|0;}return}function po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;h=(b|0)==0;if(h){wo(g);b=g;}d=OD(a)|0;while(1){if(!d)break;if(!(Q2(KB(d)|0,108006,7)|0)){TC(d,137483,280,1)|0;uK(d);xo(b,d);po(d,0);}else po(d,b);d=PD(d)|0;}if(h?(e=c[g+8>>2]|0,f=a+16|0,c[(c[f>>2]|0)+180>>2]=e,e|0):0){h=MK(c[g>>2]|0,(e<<2)+4|0)|0;c[(c[f>>2]|0)+184>>2]=h;}l=i;return}function qo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;Q=l;l=l+448|0;G=Q+400|0;F=Q+384|0;P=Q+344|0;O=Q+304|0;N=Q+248|0;D=Q+192|0;x=Q+152|0;y=Q+96|0;o=Q+72|0;d=Q+64|0;I=Q+32|0;J=Q;B=Q+416|0;u=Q+328|0;w=Q+288|0;K=Q+232|0;L=Q+176|0;M=Q+136|0;H=Q+80|0;n=c[a+60>>2]|0;if(0>1);E=a+16|0;f=b+1|0;d=1;e=0;while(1){g=c[E>>2]|0;if((d|0)>(c[g+180>>2]|0))break;C=c[(c[g+184>>2]|0)+(d<<2)>>2]|0;qo(C,f);d=d+1|0;e=(tB(C)|0)+e|0;}p=(tB(a)|0)-e|0;d=c[E>>2]|0;C=(c[d+180>>2]|0)+p|0;v=(C|0)==0;if(v?(c[d+12>>2]|0)==0:0){P=d+16|0;c[P>>2]=0;c[P+4>>2]=0;c[P+8>>2]=0;c[P+12>>2]=0;h[d+40>>3]=18.0;h[d+32>>3]=18.0;}else {d=B+16|0;do if((kH(a,4,4,B)|0)>>>0>=3)if((c[d>>2]|0)==4?(c[B+28>>2]&2|0)!=0:0){e=GA(n,0,99190,0)|0;d=GA(n,1,99190,0)|0;if((e|0)!=0|(d|0)!=0){c[B+24>>2]=JK(C<<2)|0;break}else {c[o>>2]=KB(a)|0;gA(0,90577,o)|0;d=0;e=0;break}}else {d=0;e=0;}else {c[d>>2]=3;d=0;e=0;}while(0);z=JK(C<<5)|0;A=JK(C<<2)|0;s=B+24|0;n=(e|0)!=0;r=0;g=1;while(1){f=c[E>>2]|0;if((g|0)>(c[f+180>>2]|0))break;f=c[(c[f+184>>2]|0)+(g<<2)>>2]|0;t=z+(r<<5)|0;q=(c[f+16>>2]|0)+16|0;c[t>>2]=c[q>>2];c[t+4>>2]=c[q+4>>2];c[t+8>>2]=c[q+8>>2];c[t+12>>2]=c[q+12>>2];c[t+16>>2]=c[q+16>>2];c[t+20>>2]=c[q+20>>2];c[t+24>>2]=c[q+24>>2];c[t+28>>2]=c[q+28>>2];if(n&(c[s>>2]|0)!=0){t=ZO(f,e,0,0)|0;c[(c[s>>2]|0)+(r<<2)>>2]=t;}c[A+(r<<2)>>2]=f;r=r+1|0;g=g+1|0;}a:do if((p|0)>0){o=I+16|0;p=I+24|0;q=(d|0)!=0;n=jC(a)|0;e=r;while(1){if(!n)break a;f=c[n+16>>2]|0;g=f+112|0;if(!(c[g>>2]|0)){c[g>>2]=a;c[I>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;c[I+12>>2]=0;h[o>>3]=+h[f+96>>3]+ +h[f+88>>3];h[p>>3]=+h[f+80>>3];t=z+(e<<5)|0;c[t>>2]=c[I>>2];c[t+4>>2]=c[I+4>>2];c[t+8>>2]=c[I+8>>2];c[t+12>>2]=c[I+12>>2];c[t+16>>2]=c[I+16>>2];c[t+20>>2]=c[I+20>>2];c[t+24>>2]=c[I+24>>2];c[t+28>>2]=c[I+28>>2];if(q&(c[s>>2]|0)!=0){t=ZO(n,d,0,0)|0;c[(c[s>>2]|0)+(e<<2)>>2]=t;}c[A+(e<<2)>>2]=n;e=e+1|0;}n=kC(a,n)|0;}}while(0);t=dH(C,z,B)|0;d=c[s>>2]|0;if(d|0)U1(d);to(J,2147483647.0,2147483647.0);s=J+16|0;to(u,-2147483647.0,-2147483647.0);c[s>>2]=c[u>>2];c[s+4>>2]=c[u+4>>2];c[s+8>>2]=c[u+8>>2];c[s+12>>2]=c[u+12>>2];g=I+16|0;n=I+8|0;o=I+24|0;p=J+8|0;q=J+24|0;r=c[15712]|0;d=0;while(1){if((d|0)>=(C|0))break;j=+(c[t+(d<<3)>>2]|0);m=+(c[t+(d<<3)+4>>2]|0);e=z+(d<<5)|0;c[I>>2]=c[e>>2];c[I+4>>2]=c[e+4>>2];c[I+8>>2]=c[e+8>>2];c[I+12>>2]=c[e+12>>2];c[I+16>>2]=c[e+16>>2];c[I+20>>2]=c[e+20>>2];c[I+24>>2]=c[e+24>>2];c[I+28>>2]=c[e+28>>2];i=+h[I>>3]+j;h[I>>3]=i;j=+h[g>>3]+j;h[g>>3]=j;k=+h[n>>3]+m;h[n>>3]=k;m=+h[o>>3]+m;h[o>>3]=m;h[J>>3]=+h[(+h[J>>3]>3];h[p>>3]=+h[(+h[p>>3]>3];h[s>>3]=+h[(+h[s>>3]>j?J:I)+16>>3];h[q>>3]=+h[(+h[q>>3]>m?J:I)+24>>3];e=c[A+(d<<2)>>2]|0;f=e+16|0;if((d|0)<(c[(c[E>>2]|0)+180>>2]|0)){u=(c[f>>2]|0)+16|0;c[u>>2]=c[I>>2];c[u+4>>2]=c[I+4>>2];c[u+8>>2]=c[I+8>>2];c[u+12>>2]=c[I+12>>2];c[u+16>>2]=c[I+16>>2];c[u+20>>2]=c[I+20>>2];c[u+24>>2]=c[I+24>>2];c[u+28>>2]=c[I+28>>2];if(0>1);}else {u=(c[f>>2]|0)+16|0;c[F>>2]=c[I>>2];c[F+4>>2]=c[I+4>>2];c[F+8>>2]=c[I+8>>2];c[F+12>>2]=c[I+12>>2];c[G>>2]=c[g>>2];c[G+4>>2]=c[g+4>>2];c[G+8>>2]=c[g+8>>2];c[G+12>>2]=c[g+12>>2];uo(w,F,G);c[u>>2]=c[w>>2];c[u+4>>2]=c[w+4>>2];c[u+8>>2]=c[w+8>>2];c[u+12>>2]=c[w+12>>2];if(0>1);}d=d+1|0;}e=c[E>>2]|0;d=c[e+12>>2]|0;if(d|0){i=+h[d+24>>3];if(v){j=+h[d+32>>3];c[J>>2]=0;c[J+4>>2]=0;c[J+8>>2]=0;c[J+12>>2]=0;h[s>>3]=i;h[q>>3]=j;j=0.0;k=i;}else {j=+h[J>>3];k=+h[s>>3];}m=i-(k-j);i=m*.5;if(m>0.0){h[J>>3]=j-i;h[s>>3]=k+i;}}if((b|0)>0)i=+((c[B+8>>2]|0)>>>0)*.5;else i=0.0;j=+h[J>>3]-i;h[J>>3]=j;k=+h[s>>3]+i;h[s>>3]=k;m=-i-+h[e+56>>3]+ +h[p>>3];h[p>>3]=m;i=+h[e+88>>3]+i+ +h[q>>3];h[q>>3]=i;if(0>1);d=0;while(1){if((d|0)>=(C|0))break;e=c[A+(d<<2)>>2]|0;f=e+16|0;if((d|0)<(c[(c[E>>2]|0)+180>>2]|0)){D=(c[f>>2]|0)+16|0;c[I>>2]=c[D>>2];c[I+4>>2]=c[D+4>>2];c[I+8>>2]=c[D+8>>2];c[I+12>>2]=c[D+12>>2];c[I+16>>2]=c[D+16>>2];c[I+20>>2]=c[D+20>>2];c[I+24>>2]=c[D+24>>2];c[I+28>>2]=c[D+28>>2];c[F>>2]=c[D>>2];c[F+4>>2]=c[D+4>>2];c[F+8>>2]=c[D+8>>2];c[F+12>>2]=c[D+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(I,F,G);c[F>>2]=c[g>>2];c[F+4>>2]=c[g+4>>2];c[F+8>>2]=c[g+8>>2];c[F+12>>2]=c[g+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(K,F,G);c[g>>2]=c[K>>2];c[g+4>>2]=c[K+4>>2];c[g+8>>2]=c[K+8>>2];c[g+12>>2]=c[K+12>>2];D=(c[f>>2]|0)+16|0;c[D>>2]=c[I>>2];c[D+4>>2]=c[I+4>>2];c[D+8>>2]=c[I+8>>2];c[D+12>>2]=c[I+12>>2];c[D+16>>2]=c[I+16>>2];c[D+20>>2]=c[I+20>>2];c[D+24>>2]=c[I+24>>2];c[D+28>>2]=c[I+28>>2];if(0>1);}else {D=(c[f>>2]|0)+16|0;c[F>>2]=c[D>>2];c[F+4>>2]=c[D+4>>2];c[F+8>>2]=c[D+8>>2];c[F+12>>2]=c[D+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(L,F,G);c[D>>2]=c[L>>2];c[D+4>>2]=c[L+4>>2];c[D+8>>2]=c[L+8>>2];c[D+12>>2]=c[L+12>>2];if(0>1);}d=d+1|0;}c[F>>2]=c[s>>2];c[F+4>>2]=c[s+4>>2];c[F+8>>2]=c[s+8>>2];c[F+12>>2]=c[s+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(M,F,G);c[s>>2]=c[M>>2];c[s+4>>2]=c[M+4>>2];c[s+8>>2]=c[M+8>>2];c[s+12>>2]=c[M+12>>2];c[F>>2]=c[J>>2];c[F+4>>2]=c[J+4>>2];c[F+8>>2]=c[J+8>>2];c[F+12>>2]=c[J+12>>2];c[G>>2]=c[J>>2];c[G+4>>2]=c[J+4>>2];c[G+8>>2]=c[J+8>>2];c[G+12>>2]=c[J+12>>2];vo(H,F,G);c[J>>2]=c[H>>2];c[J+4>>2]=c[H+4>>2];c[J+8>>2]=c[H+8>>2];c[J+12>>2]=c[H+12>>2];O=(c[E>>2]|0)+16|0;c[O>>2]=c[J>>2];c[O+4>>2]=c[J+4>>2];c[O+8>>2]=c[J+8>>2];c[O+12>>2]=c[J+12>>2];c[O+16>>2]=c[J+16>>2];c[O+20>>2]=c[J+20>>2];c[O+24>>2]=c[J+24>>2];c[O+28>>2]=c[J+28>>2];if(0>1);U1(z);U1(A);U1(t);}l=Q;return}function ro(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0;t=l;l=l+80|0;s=t+32|0;i=t+8|0;d=t;r=a+16|0;o=c[r>>2]|0;p=+h[o+16>>3];q=+h[o+24>>3];if(0>1);o=(b|0)!=0;a:do if(o){d=jC(a)|0;e=c[15712]|0;while(1){if(!d)break a;f=d+16|0;g=c[f>>2]|0;if((c[g+112>>2]|0)==(a|0)?(u=g+16|0,h[u>>3]=+h[u>>3]+p,g=g+24|0,h[g>>3]=+h[g>>3]+q,0>1):0){so(b);u=KB(d)|0;g=c[f>>2]|0;m=+h[g+16>>3];n=+h[g+24>>3];c[i>>2]=u;h[i+8>>3]=m;h[i+16>>3]=n;w4(e,90544,i)|0;}d=kC(a,d)|0;}}else e=c[15712]|0;while(0);i=b+1|0;a=1;while(1){d=c[r>>2]|0;if((a|0)>(c[d+180>>2]|0))break;g=c[(c[d+184>>2]|0)+(a<<2)>>2]|0;if(o){f=g+16|0;d=c[f>>2]|0;j=+h[d+16>>3]+p;k=+h[d+24>>3]+q;m=+h[d+32>>3]+p;n=+h[d+40>>3]+q;if(0>1);h[d+16>>3]=j;h[d+24>>3]=k;h[d+32>>3]=m;h[d+40>>3]=n;}ro(g,i);a=a+1|0;}l=t;return}function so(a){a=a|0;var b=0;b=c[15712]|0;while(1){if((a|0)<=0)break;T4(90574,b)|0;a=a+-1|0;}return}function to(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b;h[a+8>>3]=c;return}function uo(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=(+h[c+8>>3]+ +h[b+8>>3])*.5;h[a>>3]=(+h[c>>3]+ +h[b>>3])*.5;h[a+8>>3]=d;return}function vo(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;d=+h[b+8>>3]-+h[c+8>>3];h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=d;return}function wo(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function xo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function yo(a){a=a|0;var b=0;b=jC(a)|0;while(1){if(!b)break;WP(b);b=kC(a,b)|0;}zo(a);return}function zo(a){a=a|0;var b=0,d=0,e=0;b=a+16|0;a=1;while(1){e=c[b>>2]|0;d=c[e+184>>2]|0;if((a|0)>(c[e+180>>2]|0))break;e=c[d+(a<<2)>>2]|0;CK(c[(c[e+16>>2]|0)+12>>2]|0);zo(e);a=a+1|0;}U1(d);return}function Ao(a){a=a|0;var b=0,d=0,e=0;YC(a,1,137447,304,1);HP(a)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;e=a+16|0;c[(c[e>>2]|0)+152>>2]=b;b=0;d=jC(a)|0;while(1){if(!d)break;Bo(d);c[(c[(c[e>>2]|0)+152>>2]|0)+(b<<2)>>2]=d;c[(c[d+16>>2]|0)+120>>2]=b;b=b+1|0;d=kC(a,d)|0;}e=GA(a,2,92493,0)|0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Co(b,e);b=ZA(a,b)|0;}d=kC(a,d)|0;}Do(a);return}function Bo(a){a=a|0;var b=0;sP(a);b=JK((e[(c[(xC(a)|0)+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[a+16>>2]|0)+132>>2]=b;qQ(a,c[(c[(xC(a)|0)+16>>2]|0)+116>>2]&1);return}function Co(a,b){a=a|0;b=b|0;var d=0,e=0.0;TC(a,137460,176,1)|0;e=+_O(a,c[47174]|0,1.0,0.0);d=a+16|0;h[(c[d>>2]|0)+128>>3]=e;e=+_O(a,b,+h[1371],0.0);h[(c[d>>2]|0)+136>>3]=e;tP(a)|0;return}function Do(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;r=l;l=l+32|0;q=r+16|0;p=r;m=r+24|0;n=GA(b,1,102623,0)|0;a:do if(n|0){o=GA(b,1,90660,0)|0;i=b+16|0;j=(o|0)==0;k=c[15712]|0;g=0;while(1){e=c[(c[(c[i>>2]|0)+152>>2]|0)+(g<<2)>>2]|0;if(!e)break a;b=RA(e,n)|0;do if(a[b>>0]|0){f=e+16|0;d=c[(c[f>>2]|0)+132>>2]|0;a[m>>0]=0;c[p>>2]=d;c[p+4>>2]=d+8;c[p+8>>2]=m;if((b5(b,101749,p)|0)<=1){c[q>>2]=KB(e)|0;c[q+4>>2]=b;w4(k,90664,q)|0;break}b:do if(+h[23293]>0.0){b=0;while(1){if((b|0)==2)break b;s=d+(b<<3)|0;h[s>>3]=+h[s>>3]/+h[23293];b=b+1|0;}}while(0);b=c[f>>2]|0;a[b+119>>0]=1;if((a[m>>0]|0)!=33){if(j)break;if(!((dP(RA(e,o)|0)|0)<<24>>24))break;b=c[f>>2]|0;}a[b+119>>0]=3;}while(0);g=g+1|0;}}while(0);l=r;return}function Eo(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}Fo(a);return}function Fo(a){a=a|0;Go(a);a=a+16|0;U1(c[(c[a>>2]|0)+152>>2]|0);U1(c[(c[a>>2]|0)+140>>2]|0);return}function Go(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;g=a+16|0;f=1;while(1){e=c[g>>2]|0;b=c[e+184>>2]|0;if((f|0)>(c[e+180>>2]|0))break;e=c[b+(f<<2)>>2]|0;b=e+16|0;CK(c[(c[b>>2]|0)+12>>2]|0);d=c[(c[b>>2]|0)+140>>2]|0;if(d|0){U1(c[d>>2]|0);U1(c[(c[b>>2]|0)+140>>2]|0);}Go(e);f=f+1|0;}U1(b);if((yC(a)|0)!=(a|0))VC(a,137483)|0;return}function Ho(a,b){a=a|0;b=b|0;c[b+4>>2]=GA(a,0,90716,0)|0;c[b+8>>2]=GA(a,0,141116,0)|0;c[b+12>>2]=GA(a,0,141048,0)|0;c[b>>2]=a;c[b+16>>2]=0;c[b+36>>2]=kH(a,2,4,b+20|0)|0;return}function Io(a){a=a|0;var d=0,e=0;oQ(a,2);d=JK(56)|0;e=a+16|0;c[(c[e>>2]|0)+140>>2]=d;d=(ZO(a,GA(a,0,91374,0)|0,2,2)|0)&65535;d=(d&65535)<10?d:10;b[(c[e>>2]|0)+176>>1]=d;c[47137]=d&65535;Jo(a,0,a);fp(a);Ao(a);return}function Jo(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;m=l;l=l+16|0;j=m;k=(d|0)==0;if(k){Ko(j);d=j;}g=e+16|0;f=OD(a)|0;while(1){if(!f)break;if(!(Q2(KB(f)|0,108006,7)|0)){TC(f,137483,280,1)|0;n=JK(56)|0;p=c[f+16>>2]|0;c[p+140>>2]=n;o=c[g>>2]|0;b[p+176>>1]=b[o+176>>1]|0;c[n+44>>2]=(c[(c[o+140>>2]|0)+44>>2]|0)+1;c[n+48>>2]=e;Lo(d,f);Jo(f,0,f);}else Jo(f,d,e);f=PD(f)|0;}if(k?(h=c[j+8>>2]|0,i=a+16|0,c[(c[i>>2]|0)+180>>2]=h,h|0):0){p=MK(c[j>>2]|0,(h<<2)+4|0)|0;c[(c[i>>2]|0)+184>>2]=p;}l=m;return}function Ko(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;return}function Lo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=a+8|0;d=(c[g>>2]|0)+1|0;c[g>>2]=d;e=a+4|0;h=c[e>>2]|0;f=h+10|0;if((d|0)<(h|0))a=c[a>>2]|0;else {c[e>>2]=f;d=MK(c[a>>2]|0,f<<2)|0;c[a>>2]=d;a=d;d=c[g>>2]|0;}c[a+(d<<2)>>2]=b;return}function Mo(a){a=a|0;var b=0,c=0;b=l;l=l+64|0;c=b;Ho(a,c);No(a,c);Oo(a);Po(a,a);Qo(a);l=b;return}function No(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0,w=0.0,x=0.0;s=l;l=l+64|0;r=s+48|0;e=s+40|0;o=s+56|0;n=s+52|0;m=s;if(0);e=jC(b)|0;while(1){if(!e)break;c[(c[e+16>>2]|0)+164>>2]=0;e=kC(b,e)|0;}p=Ro(b,d)|0;q=Iv(p,o,n)|0;e=q;while(1){k=e+4|0;f=c[e>>2]|0;if(!f)break;gp(f,m);e=jC(f)|0;while(1){if(!e)break;g=kC(f,e)|0;i=e+16|0;j=c[i>>2]|0;if(c[j+212>>2]|0){v=So(e,f)|0;No(v,d);v=c[(c[v+16>>2]|0)+140>>2]|0;u=+h[v+24>>3];j=c[i>>2]|0;h[j+32>>3]=u;t=+h[v+32>>3];h[j+40>>3]=t;u=u*36.0;h[j+88>>3]=u;h[j+96>>3]=u;h[j+80>>3]=t*72.0;e=g;continue}if(c[(c[j+112>>2]|0)+8>>2]|0){e=g;continue}wC(f,e)|0;e=g;}if((tB(f)|0)<=1){e=k;continue}if((c[d>>2]|0)==(b|0))Lq(f)|0;tp(f,m);e=k;}e=c[o>>2]|0;if((e|0)<=1)if((e|0)==1){BP(c[q>>2]|0);e=0;}else e=0;else {if(!(c[n>>2]|0))f=0;else {f=JK(e)|0;a[f>>0]=1;e=c[o>>2]|0;}c[d+40>>2]=f;e=QG(e,q,0,d+20|0)|0;U1(f);}To(p,c[o>>2]|0,q,e,b,d);U1(e);f=jC(p)|0;while(1){if(!f)break;g=c[f+16>>2]|0;e=c[g+212>>2]|0;if(!e){e=c[(c[g+112>>2]|0)+8>>2]|0;if(e|0){o=c[g+132>>2]|0;v=c[(c[e+16>>2]|0)+132>>2]|0;h[v>>3]=+h[o>>3];h[v+8>>3]=+h[o+8>>3];}}else {o=c[g+132>>2]|0;x=+h[g+32>>3];w=+h[o>>3]-x*.5;v=c[(c[e+16>>2]|0)+140>>2]|0;h[v+8>>3]=w;t=+h[g+40>>3];u=+h[o+8>>3]-t*.5;h[v+16>>3]=u;h[v+24>>3]=x+w;h[v+32>>3]=t+u;}f=kC(p,f)|0;}v=(c[(c[b+16>>2]|0)+140>>2]|0)+8|0;o=(c[(c[p+16>>2]|0)+140>>2]|0)+8|0;c[v>>2]=c[o>>2];c[v+4>>2]=c[o+4>>2];c[v+8>>2]=c[o+8>>2];c[v+12>>2]=c[o+12>>2];c[v+16>>2]=c[o+16>>2];c[v+20>>2]=c[o+20>>2];c[v+24>>2]=c[o+24>>2];c[v+28>>2]=c[o+28>>2];Uo(p,q);U1(q);if(0);l=s;return}function Oo(b){b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0;d=jC(b)|0;while(1){if(!d)break;e=c[d+16>>2]|0;if(a[e+118>>0]|0){k=c[(c[(c[e+212>>2]|0)+16>>2]|0)+140>>2]|0;j=+h[k+24>>3]-+h[k+8>>3];i=+h[k+32>>3]-+h[k+16>>3];g=j*36.0;f=i*36.0;k=c[e+132>>2]|0;h[k>>3]=j*.5;h[k+8>>3]=i*.5;h[e+32>>3]=j;h[e+40>>3]=i;h[e+96>>3]=g;h[e+88>>3]=g;h[e+80>>3]=i*72.0;e=c[(c[e+12>>2]|0)+44>>2]|0;h[e>>3]=g;h[e+8>>3]=f;i=-g;h[e+16>>3]=i;h[e+24>>3]=f;h[e+32>>3]=i;f=-f;h[e+40>>3]=f;h[e+48>>3]=g;h[e+56>>3]=f;}d=kC(b,d)|0;}return}function Po(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0,k=0.0,l=0,m=0.0,n=0,o=0.0,p=0;i=a+16|0;j=c[(c[i>>2]|0)+140>>2]|0;f=+h[j+8>>3];g=+h[j+16>>3];j=(a|0)!=(b|0);a:do if(j){d=jC(a)|0;while(1){if(!d){a=1;break a}e=c[d+16>>2]|0;if((c[e+212>>2]|0)==(a|0)){e=c[e+132>>2]|0;h[e>>3]=+h[e>>3]+f;e=e+8|0;h[e>>3]=+h[e>>3]+g;}d=kC(a,d)|0;}}else a=1;while(0);while(1){d=c[i>>2]|0;if((a|0)>(c[d+180>>2]|0))break;d=c[(c[d+184>>2]|0)+(a<<2)>>2]|0;if(j){e=c[(c[d+16>>2]|0)+140>>2]|0;p=e+8|0;n=e+16|0;l=e+24|0;e=e+32|0;o=+h[n>>3]+g;m=+h[l>>3]+f;k=+h[e>>3]+g;h[p>>3]=+h[p>>3]+f;h[n>>3]=o;h[l>>3]=m;h[e>>3]=k;}Po(d,b);a=a+1|0;}return}function Qo(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0;b=a+16|0;a=c[b>>2]|0;d=c[a+140>>2]|0;g=+h[d+16>>3]*72.0;f=+h[d+24>>3]*72.0;e=+h[d+32>>3]*72.0;h[a+16>>3]=+h[d+8>>3]*72.0;h[a+24>>3]=g;h[a+32>>3]=f;h[a+40>>3]=e;a=1;while(1){d=c[b>>2]|0;if((a|0)>(c[d+180>>2]|0))break;Qo(c[(c[d+184>>2]|0)+(a<<2)>>2]|0);a=a+1|0;}return}function Ro(d,e){d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+160|0;s=y+24|0;t=y+8|0;g=y;f=y+56|0;w=e+16|0;x=c[w>>2]|0;c[w>>2]=x+1;c[s>>2]=x;m4(f,90796,s)|0;if(0>1);;a[s>>0]=a[18588]|0;a[s+1>>0]=a[18589]|0;a[s+2>>0]=a[18590]|0;a[s+3>>0]=a[18591]|0;x=oB(91156,s,0)|0;TC(x,137483,280,1)|0;v=JK(56)|0;w=x+16|0;o=c[w>>2]|0;c[o+140>>2]=v;v=d+16|0;b[o+176>>1]=b[(c[v>>2]|0)+176>>1]|0;_o(d,x,92507);_o(d,x,93112);_o(d,x,91202);o=e+4|0;p=s+16|0;q=s+8|0;r=s+24|0;j=0;n=1;while(1){f=c[v>>2]|0;if((n|0)>(c[f+180>>2]|0))break;c[s>>2]=c[332];c[s+4>>2]=c[333];c[s+8>>2]=c[334];c[s+12>>2]=c[335];c[s+16>>2]=c[336];c[s+20>>2]=c[337];c[s+24>>2]=c[338];c[s+28>>2]=c[339];g=c[(c[f+184>>2]|0)+(n<<2)>>2]|0;uK(g);i=$o(x,KB(g)|0)|0;k=i+16|0;f=c[k>>2]|0;c[f+212>>2]=g;m=j+1|0;c[f+120>>2]=j;if(c[o>>2]|0)ap(g,i,e,s);f=jC(g)|0;while(1){if(!f)break;c[(c[f+16>>2]|0)+164>>2]=i;f=kC(g,f)|0;}f=c[k>>2]|0;if(a[f+119>>0]|0){k=c[f+132>>2]|0;h[k>>3]=(+h[p>>3]+ +h[s>>3])*.5;h[k+8>>3]=(+h[r>>3]+ +h[q>>3])*.5;}j=m;n=n+1|0;}k=jC(d)|0;while(1){if(!k)break;f=k+16|0;g=c[f>>2]|0;if(!(c[g+164>>2]|0)){i=g+212|0;s=c[i>>2]|0;if(s|0?(s|0)!=(c[(c[(c[v>>2]|0)+140>>2]|0)+48>>2]|0):0){u=18;break}c[i>>2]=d;if(!(a[g+118>>0]|0)){i=$o(x,KB(k)|0)|0;g=c[f>>2]|0;c[g+164>>2]=i;i=c[i+16>>2]|0;c[i+120>>2]=j;h[i+32>>3]=+h[g+32>>3];h[i+40>>3]=+h[g+40>>3];h[i+88>>3]=+h[g+88>>3];h[i+96>>3]=+h[g+96>>3];h[i+80>>3]=+h[g+80>>3];c[i+8>>2]=c[g+8>>2];c[i+12>>2]=c[g+12>>2];f=a[g+119>>0]|0;if(f<<24>>24){e=c[g+132>>2]|0;s=c[i+132>>2]|0;h[s>>3]=+h[e>>3];h[s+8>>3]=+h[e+8>>3];a[i+119>>0]=f;}c[(c[i+112>>2]|0)+8>>2]=k;f=j+1|0;}else f=j;}else f=j;k=kC(d,k)|0;j=f;}if((u|0)==18){e=KB(k)|0;s=KB(d)|0;u=KB(c[(c[f>>2]|0)+212>>2]|0)|0;c[t>>2]=e;c[t+4>>2]=s;c[t+8>>2]=u;gA(1,90826,t)|0;bb(187212,1);}m=jC(d)|0;while(1){if(!m)break;n=c[(c[m+16>>2]|0)+164>>2]|0;o=n+16|0;i=XA(d,m)|0;while(1){if(!i)break;f=c[(c[(c[((c[i>>2]&3|0)==2?i:i+-48|0)+40>>2]|0)+16>>2]|0)+164>>2]|0;if((f|0)!=(n|0)){if(f>>>0>n>>>0)k=iB(x,n,f,0,1)|0;else k=iB(x,f,n,0,1)|0;TC(k,137460,176,1)|0;g=c[i+16>>2]|0;u=c[k+16>>2]|0;h[u+136>>3]=+h[g+136>>3];h[u+128>>3]=+h[g+128>>3];f=c[(c[f+16>>2]|0)+112>>2]|0;g=f+4|0;c[g>>2]=(c[g>>2]|0)+1;g=c[(c[o>>2]|0)+112>>2]|0;t=g+4|0;c[t>>2]=(c[t>>2]|0)+1;if(!(c[u+172>>2]|0)){c[f>>2]=(c[f>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+1;}bp(k,i);}i=ZA(d,i)|0;}m=kC(d,m)|0;}f=c[(c[v>>2]|0)+140>>2]|0;g=c[f>>2]|0;if(g|0){i=JK((c[f+4>>2]<<4)+16|0)|0;c[c[(c[w>>2]|0)+140>>2]>>2]=i;f=0;while(1){if(!(c[g>>2]|0))break;m=c[(c[(c[g+4>>2]|0)+16>>2]|0)+164>>2]|0;if(m){cp(d,g);n=$o(x,193772)|0;o=n+16|0;c[(c[o>>2]|0)+120>>2]=j;if(n>>>0>m>>>0)k=iB(x,m,n,0,1)|0;else k=iB(x,n,m,0,1)|0;TC(k,137460,176,1)|0;u=c[g>>2]|0;t=c[u+16>>2]|0;v=c[k+16>>2]|0;h[v+136>>3]=+h[t+136>>3];h[v+128>>3]=+h[t+128>>3];bp(k,u);u=c[(c[o>>2]|0)+112>>2]|0;v=u+4|0;c[v>>2]=(c[v>>2]|0)+1;v=c[(c[m+16>>2]|0)+112>>2]|0;t=v+4|0;c[t>>2]=(c[t>>2]|0)+1;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+1;c[i+4>>2]=n;h[i+8>>3]=+h[g+8>>3];c[i>>2]=k;f=f+1|0;i=i+16|0;j=j+1|0;}g=g+16|0;}c[(c[(c[w>>2]|0)+140>>2]|0)+4>>2]=f;}l=y;return x|0}function So(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0,k=0,l=0;l=c[a+16>>2]|0;k=c[l+212>>2]|0;l=c[(c[l+112>>2]|0)+4>>2]|0;do if(l|0){j=JK((l<<4)+16|0)|0;f=Xo(a,b)|0;g=f+8|0;b=0;e=f;while(1){if(!(c[e>>2]|0))break;i=e+24|0;if(!(c[i>>2]|0))d=+h[g>>3]+6.283185307179586;else d=+h[e+32>>3];b=Yo(a,e,j,b,d)|0;e=i;}if((b|0)==(l|0)){a=c[(c[k+16>>2]|0)+140>>2]|0;c[a>>2]=j;c[a+4>>2]=l;U1(f);break}else qa(90742,90752,766,90761);}while(0);return k|0}function To(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0.0,j=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0.0,H=0.0;B=l;l=l+32|0;x=B+16|0;A=B;m=c[g+8>>2]|0;j=c[g+12>>2]|0;y=(c[g>>2]|0)==(f|0);z=(b|0)!=0;a:do if(z){p=c[(c[d>>2]|0)+16>>2]|0;k=+h[p+16>>3];m=~~(k+(k>=0.0?.5:-.5));c[A>>2]=m;k=+h[p+24>>3];g=~~(k+(k>=0.0?.5:-.5));u=A+4|0;c[u>>2]=g;k=+h[p+32>>3];n=~~(k+(k>=0.0?.5:-.5));v=A+8|0;c[v>>2]=n;k=+h[p+40>>3];p=~~(k+(k>=0.0?.5:-.5));w=A+12|0;c[w>>2]=p;if((b|0)>1){q=c[e>>2]|0;t=c[e+4>>2]|0;m=q+m|0;c[A>>2]=m;b=t+g|0;c[u>>2]=b;n=q+n|0;c[v>>2]=n;q=x+4|0;r=x+8|0;s=x+12|0;o=e;g=d;t=t+p|0;p=b;while(1){g=g+4|0;j=o+8|0;c[w>>2]=t;b=c[g>>2]|0;if(!b){j=0;r=p;s=t;break a}E=c[b+16>>2]|0;G=+h[E+16>>3];i=+h[E+24>>3];k=+h[E+32>>3];H=+h[E+40>>3];E=~~(H+(H>=0.0?.5:-.5));c[s>>2]=E;b=c[j>>2]|0;F=c[o+12>>2]|0;D=b+~~(G+(G>=0.0?.5:-.5))|0;c[x>>2]=D;C=F+~~(i+(i>=0.0?.5:-.5))|0;c[q>>2]=C;b=b+~~(k+(k>=0.0?.5:-.5))|0;c[r>>2]=b;E=F+E|0;c[s>>2]=E;D=c[((m|0)<(D|0)?A:x)>>2]|0;c[A>>2]=D;C=c[((p|0)<(C|0)?A:x)+4>>2]|0;c[u>>2]=C;b=c[((n|0)>(b|0)?A:x)+8>>2]|0;c[v>>2]=b;o=j;t=c[((t|0)>(E|0)?A:x)+12>>2]|0;m=D;p=C;n=b;}}else {j=0;r=g;s=p;}}else {c[A>>2]=0;c[A+4>>2]=0;n=ZO(f,m,54,3)|0;c[A+8>>2]=n;s=ZO(f,j,36,3)|0;c[A+12>>2]=s;j=1;m=0;r=0;}while(0);b=f+16|0;o=c[b>>2]|0;g=c[o+12>>2]|0;if(g){H=+h[g+24>>3];g=m-n+~~(H+(H>=0.0?.5:-.5))|0;if((g|0)>0){g=g>>>1;m=m-g|0;c[A>>2]=m;n=n+g|0;c[A+8>>2]=n;g=0;}else g=0;}else g=j;if(y|(g|0)!=0){j=0;g=o;}else {j=ZO(a,c[47144]|0,8,0)|0;g=c[b>>2]|0;}q=j-m|0;p=~~(+h[g+56>>3]+ +(j-r|0));c[A>>2]=0;c[A+4>>2]=0;o=q+j+n|0;c[A+8>>2]=o;b=~~(+h[g+88>>3]+ +(j+p|0)+ +(s|0));c[A+12>>2]=b;b:do if(z){g=e;c:while(1){n=d+4|0;j=c[d>>2]|0;if(!j)break b;if(!g){m=0;d=q;g=p;}else {m=g+8|0;d=(c[g>>2]|0)+q|0;g=(c[g+4>>2]|0)+p|0;}k=+(d|0)*.013888888888888888;i=+(g|0)*.013888888888888888;d=jC(j)|0;while(1){if(!d){d=n;g=m;continue c}F=c[(c[d+16>>2]|0)+132>>2]|0;h[F>>3]=+h[F>>3]+k;F=F+8|0;h[F>>3]=+h[F>>3]+i;d=kC(j,d)|0;}}}while(0);F=c[(c[a+16>>2]|0)+140>>2]|0;E=F+8|0;c[E>>2]=0;c[E+4>>2]=0;c[E+8>>2]=0;c[E+12>>2]=0;h[F+24>>3]=+(o|0)*.013888888888888888;h[F+32>>3]=+(b|0)*.013888888888888888;l=B;return}function Uo(a,b){a=a|0;b=b|0;var d=0,e=0;while(1){d=c[b>>2]|0;if(!d)break;Vo(d);VC(d,137483)|0;b=b+4|0;}b=c[c[(c[a+16>>2]|0)+140>>2]>>2]|0;if(b|0)U1(b);Vo(a);VC(a,137483)|0;d=jC(a)|0;while(1){if(!d)break;e=kC(a,d)|0;b=XA(a,d)|0;while(1){if(!b)break;U1(c[(c[b+16>>2]|0)+172>>2]|0);VC(b,137460)|0;b=ZA(a,b)|0;}Wo(d);d=e;}sB(a)|0;return}function Vo(a){a=a|0;U1(c[(c[a+16>>2]|0)+140>>2]|0);return}function Wo(a){a=a|0;var b=0;b=a+16|0;U1(c[(c[b>>2]|0)+112>>2]|0);U1(c[(c[b>>2]|0)+132>>2]|0);VC(a,137447)|0;return}function Xo(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0.0,i=0,j=0,k=0,l=0,m=0;k=a+16|0;l=c[c[(c[k>>2]|0)+112>>2]>>2]|0;m=JK((l*24|0)+24|0)|0;i=0;j=aB(b,a)|0;while(1){if(!j)break;f=c[j>>2]&3;e=c[((f|0)==2?j:j+-48|0)+40>>2]|0;if((e|0)==(a|0))e=c[((f|0)==3?j:j+48|0)+40>>2]|0;e=c[(c[e+16>>2]|0)+132>>2]|0;f=c[(c[k>>2]|0)+132>>2]|0;g=+h[e>>3]-+h[f>>3];d=+h[e+8>>3]-+h[f+8>>3];c[m+(i*24|0)>>2]=j;h[m+(i*24|0)+8>>3]=+K(+d,+g);h[m+(i*24|0)+16>>3]=d*d+g*g;i=i+1|0;j=bB(b,j,a)|0;}if((i|0)!=(l|0))qa(90775,90752,642,90784);o4(m,l,24,67);a:do if((l|0)>1){j=l+-1|0;e=0;b:while(1){if((e|0)>=(j|0))break a;g=+h[m+(e*24|0)+8>>3];f=e+1|0;i=f;while(1){if((i|0)>=(l|0))break;if(!(+h[m+(i*24|0)+8>>3]==g))break;i=i+1|0;}if((i|0)==(f|0)){e=f;continue}if((i|0)==(l|0))d=3.141592653589793;else d=+h[m+(i*24|0)+8>>3];d=(d-g)/+(i-e|0);d=d>.03490658503988659?.03490658503988659:d;g=0.0;while(1){if((e|0)>=(i|0))continue b;k=m+(e*24|0)+8|0;h[k>>3]=+h[k>>3]+g;g=g+d;e=e+1|0;}}}while(0);return m|0}function Yo(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0,j=0,k=0,l=0.0,m=0,n=0,o=0,p=0.0,q=0;k=c[d>>2]|0;n=c[k+16>>2]|0;m=b[n+168>>1]|0;o=m<<16>>16;j=c[k>>2]&3;i=c[((j|0)==2?k:k+-48|0)+40>>2]|0;if((i|0)==(a|0))i=c[((j|0)==3?k:k+48|0)+40>>2]|0;p=+h[d+8>>3];g=(g-p)/+(m<<16>>16);g=g>.03490658503988659?.03490658503988659:g;m=i>>>0>a>>>0;l=m?g:-g;d=m?1:-1;k=0;i=c[n+172>>2]|0;j=m?f:f+-1+o|0;g=m?p:g*+(o+-1|0)+p;while(1){if((k|0)>=(o|0))break;n=c[i>>2]|0;c[e+(j<<4)>>2]=n;m=c[n>>2]&3;q=(m|0)==3?n:n+48|0;c[e+(j<<4)+4>>2]=c[((c[(c[(c[q+40>>2]|0)+16>>2]|0)+164>>2]|0)==(a|0)?q:(m|0)==2?n:n+-48|0)+40>>2];h[e+(j<<4)+8>>3]=g;k=k+1|0;i=i+4|0;j=j+d|0;g=g+l;}return o+f|0}function Zo(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a+8>>3];d=+h[b+8>>3];if(!(c>d))if(!(c>3];c=+h[b+16>>3];if(d>c)a=1;else a=(d>31;}else a=-1;else a=1;return a|0}function _o(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=GA(a,0,c,0)|0;do if(d|0){a=RA(a,d)|0;d=GA(b,0,c,0)|0;if(!d){GA(b,0,c,a)|0;break}else {KA(b,d,a)|0;break}}while(0);return}function $o(a,b){a=a|0;b=b|0;var d=0,f=0;b=tC(a,b,1)|0;TC(b,137447,304,1)|0;f=JK(32)|0;d=b+16|0;c[(c[d>>2]|0)+112>>2]=f;a=KK((e[(c[a+16>>2]|0)+176>>1]|0)<<3)|0;c[(c[d>>2]|0)+132>>2]=a;return b|0}function ap(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+80|0;n=q+56|0;m=q+32|0;p=q;o=q+64|0;i=c[e+4>>2]|0;k=RA(b,i)|0;do if(a[k>>0]|0){if((c[e>>2]|0)!=(b|0)){e=RA(QD(b)|0,i)|0;if((e|0)==(k|0))break;if(!(s2(k,e)|0))break}a[o>>0]=0;e=p+8|0;i=p+16|0;j=p+24|0;c[m>>2]=p;c[m+4>>2]=e;c[m+8>>2]=i;c[m+12>>2]=j;c[m+16>>2]=o;if((b5(k,90937,m)|0)<=3){c[n>>2]=KB(b)|0;c[n+4>>2]=k;gA(0,90955,n)|0;break}g=+h[23293];if(g>0.0){h[p>>3]=+h[p>>3]/g;h[e>>3]=+h[e>>3]/g;h[i>>3]=+h[i>>3]/g;h[j>>3]=+h[j>>3]/g;}e=a[o>>0]|0;if(e<<24>>24==33)a[(c[d+16>>2]|0)+119>>0]=3;else a[(c[d+16>>2]|0)+119>>0]=e<<24>>24==63?2:1;c[f>>2]=c[p>>2];c[f+4>>2]=c[p+4>>2];c[f+8>>2]=c[p+8>>2];c[f+12>>2]=c[p+12>>2];c[f+16>>2]=c[p+16>>2];c[f+20>>2]=c[p+20>>2];c[f+24>>2]=c[p+24>>2];c[f+28>>2]=c[p+28>>2];}while(0);l=q;return}function bp(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;g=a+16|0;f=c[g>>2]|0;a=b[f+168>>1]|0;f=c[f+172>>2]|0;if(!f){a=a<<16>>16;e=a;a=KK((a<<2)+4|0)|0;}else {a=a<<16>>16;e=a;a=MK(f,(a<<2)+4|0)|0;}c[a+(e<<2)>>2]=d;d=c[g>>2]|0;c[d+172>>2]=a;d=d+168|0;b[d>>1]=(b[d>>1]|0)+1<<16>>16;return}function cp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;i=l;l=l+48|0;h=i+24|0;g=i;e=c[b>>2]|0;d=c[e>>2]&3;f=c[((d|0)==2?e:e+-48|0)+40>>2]|0;d=c[((d|0)==3?e:e+48|0)+40>>2]|0;b=l2(KB(a)|0)|0;j=l2(KB(f)|0)|0;j=(b+8+j+(l2(KB(d)|0)|0)|0)>999;b=KB(a)|0;if(j){d=KB(d)|0;j=KB(f)|0;h=(c[e>>2]|0)>>>4;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=j;j=g+16|0;c[j>>2]=h;c[j+4>>2]=0;m4(193772,90895,g)|0;}else {d=c[(c[d+16>>2]|0)+120>>2]|0;j=c[(c[f+16>>2]|0)+120>>2]|0;g=(c[e>>2]|0)>>>4;c[h>>2]=b;c[h+4>>2]=d;c[h+8>>2]=j;j=h+16|0;c[j>>2]=g;c[j+4>>2]=0;m4(193772,90914,h)|0;}l=i;return}function dp(a){a=a|0;var d=0,e=0,f=0.0,g=0.0,i=0,j=0,k=0;j=4;i=T1(40)|0;c[i>>2]=0;g=+h[23293];o=0;f=+Z(1,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){h[23293]=f;o=0;ia(102,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){i=U6(187212,1,i|0,j|0)|0;j=z;o=0;e=o;o=0;if((e|0)!=0&(p|0)!=0){d=V6(c[e>>2]|0,i|0,j|0)|0;if(!d)bb(e|0,p|0);z=p;}else d=-1;if((d|0)!=1)d=0;else d=z;}else d=z;}else d=z;while(1){if(d|0)break;o=0;ia(103,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}o=0;$(22,a|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}if(b[(c[a+16>>2]|0)+136>>1]&14){o=0;ia(104,a|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;continue}}o=0;ja(22,a|0,0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,i|0,j|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1)d=z;else {k=12;break}}if((k|0)==12)h[23293]=g;U1(i|0);return}function ep(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;g=i;e=a+16|0;f=b[(c[e>>2]|0)+136>>1]&14;d=f&65535;if((f&65535)>8){if(f<<16>>16==12){if(Um(a,22,10)|0){c[47134]=2;h=5;}}else h=5;do if((h|0)==5)if(!(b[(c[e>>2]|0)+136>>1]&1)){Wm(a,d)|0;break}else {gA(0,90998,g)|0;d=2;break}while(0);c[47134]=0;}if((c[47138]|0)<1)Wm(a,d)|0;l=i;return}function fp(a){a=a|0;var b=0.0,d=0.0,e=0;e=l;l=l+16|0;c[46474]=1;c[46475]=1;c[46477]=-1;c[46479]=50;h[23245]=0.0;h[23240]=0.0;h[23241]=1.0;c[46478]=ZO(a,GA(a,0,91061,0)|0,600,0)|0;d=+_O(a,GA(a,0,91202,0)|0,.3,0.0);h[23242]=d;h[1371]=d;if(-1.0==-1.0)b=+_O(a,GA(a,0,91069,0)|0,-1.0,0.0);h[23243]=b;c[46476]=1;a=mm(a,2,185904)|0;c[46488]=a;if(!a){gA(0,91072,e)|0;c[46476]=2;}c[46504]=(O(c[46478]|0,c[46479]|0)|0)/100|0;d=+h[23242];h[23247]=d*d;if(c[46474]|0){b=+h[23245];if(b<=0.0){b=d*3.0;h[23245]=b;}h[23246]=b*b;}l=e;return}function gp(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,g=0,i=0,j=0;j=l;l=l+16|0;d=j;g=c[c[(c[a+16>>2]|0)+140>>2]>>2]|0;i=hp(a,b)|0;ip(d,a,g);e=+h[d>>3];f=+h[d+8>>3];a:do if(!(c[46474]|0)){b=0;while(1){if((b|0)>=(c[46505]|0))break a;lp(a,+jp(b),g);b=b+1|0;}}else {d=Kv(tB(a)|0)|0;Pv(d,tB(a)|0);b=0;while(1){if((b|0)>=(c[46505]|0))break;kp(a,+jp(b),g,d);b=b+1|0;}Rv(d);}while(0);b:do if(e!=0.0|f!=0.0){b=jC(a)|0;while(1){if(!b)break b;g=c[(c[b+16>>2]|0)+132>>2]|0;h[g>>3]=+h[g>>3]+e;g=g+8|0;h[g>>3]=+h[g>>3]+f;b=kC(a,b)|0;}}while(0);if(i|0)mp();l=j;return}function hp(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,g=0,i=0,j=0;if(+h[23243]==-1.0){i=tB(a)|0;d=+h[23242];h[23243]=+h[23241]*.2*d*+C(+(+(i|0)));i=1;}else {i=0;d=+h[23242];}g=c[46504]|0;h[b+8>>3]=+jp(g);h[b+16>>3]=d;h[b+24>>3]=+h[23240];e=c[46478]|0;a=e-g|0;c[b>>2]=a;f=c[46477]|0;do if((f|0)>-1){if((f|0)<=(g|0)){c[46505]=f;a=0;j=10;break}if((f|0)<=(e|0)){c[46505]=g;a=f-g|0;j=10;}}else {c[46505]=g;j=10;}while(0);if((j|0)==10)c[b+32>>2]=a;return i|0}function ip(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0.0,t=0.0,u=0,v=0,w=0.0,x=0,y=0,z=0;v=tB(d)|0;x=c[(c[(c[d+16>>2]|0)+140>>2]|0)+4>>2]|0;u=jC(d)|0;q=0;r=0;g=0;k=0;n=0;while(1){if(!u)break;f=c[u+16>>2]|0;if(!(a[f+119>>0]|0))f=r;else {f=c[f+132>>2]|0;i=+h[f>>3];if(!q){k=~~i;g=~~+h[f+8>>3];n=g;f=k;}else {p=+(r|0);s=+h[f+8>>3];t=+(g|0);w=+(k|0);o=+(n|0);n=~~(s>o?s:o);f=~~(iw?i:w);}q=q+1|0;}u=kC(d,u)|0;r=f;}i=+h[23242]*(+C(+(+(v-x|0)))+1.0);s=i*.6;h[23249]=s;h[23248]=s;if((q|0)!=1)if((q|0)>1){t=+(k+r|0)*.5;w=+(n+g|0)*.5;o=+(k-r|0);p=o*1.2;l=+(n-g|0);m=l*1.2;i=i*2.4*s;j=m*p/i;do if(!(j>=1.0)){if(j>0.0){i=+C(+j)*2.0;j=p/i;h[23248]=j;i=m/i;z=20;break}if(p>0.0){j=o*.6;h[23248]=j;i=i/p*.5;z=20;break}if(m>0.0){j=i/m*.5;h[23248]=j;i=l*.6;z=20;}else {i=s;j=s;}}else {j=o*.6;h[23248]=j;i=l*.6;z=20;}while(0);if((z|0)==20)h[23249]=i;s=+K(+i,+j);j=j/+E(+s);h[23248]=j;i=i/+F(+s);h[23249]=i;}else {t=0.0;w=0.0;j=s;i=s;}else {t=+(r|0);w=+(g|0);j=s;i=s;}h[23250]=j*j;h[23251]=i*i;if((c[46488]|0)==2)f=c[46476]|0;else {f=X4()|0;f=(db(0)|0)^f;}z5(f);a:do if(!e){e=jC(d)|0;if(!q)while(1){if(!e)break a;s=+h[23248];s=(+B5()*2.0+-1.0)*s;z=e+16|0;h[c[(c[z>>2]|0)+132>>2]>>3]=s;s=+h[23249];s=(+B5()*2.0+-1.0)*s;h[(c[(c[z>>2]|0)+132>>2]|0)+8>>3]=s;e=kC(d,e)|0;}while(1){if(!e)break a;f=e+16|0;g=c[f>>2]|0;if(!(a[g+119>>0]|0)){s=+h[23248];s=(+B5()*2.0+-1.0)*s;h[c[(c[f>>2]|0)+132>>2]>>3]=s;s=+h[23249];s=(+B5()*2.0+-1.0)*s;h[(c[(c[f>>2]|0)+132>>2]|0)+8>>3]=s;}else {z=c[g+132>>2]|0;h[z>>3]=+h[z>>3]-t;z=z+8|0;h[z>>3]=+h[z>>3]-w;}e=kC(d,e)|0;}}else {while(1){if(!(c[e>>2]|0))break;u=e+8|0;s=+E(+(+h[u>>3]))*+h[23248]+t;x=c[(c[e+4>>2]|0)+16>>2]|0;v=c[x+132>>2]|0;h[v>>3]=s;h[v+8>>3]=+F(+(+h[u>>3]))*+h[23249]+w;a[x+119>>0]=1;e=e+16|0;}l=t*.1;m=w*.1;r=jC(d)|0;while(1){if(!r)break a;q=r+16|0;e=c[q>>2]|0;if(!((c[(c[e+112>>2]|0)+8>>2]|0)==0?!(c[e+212>>2]|0):0))z=32;do if((z|0)==32){z=0;if(a[e+119>>0]|0){x=c[e+132>>2]|0;h[x>>3]=+h[x>>3]-t;x=x+8|0;h[x>>3]=+h[x>>3]-w;break}n=aB(d,r)|0;e=0;j=0.0;i=0.0;while(1){if(!n)break;k=c[n>>2]&3;f=(k|0)==2?n:n+-48|0;g=c[f+40>>2]|0;k=(k|0)==3?n:n+48|0;do if((g|0)!=(c[k+40>>2]|0)?(y=c[(c[((g|0)==(r|0)?k:f)+40>>2]|0)+16>>2]|0,(a[y+119>>0]|0)!=0):0)if(!e){x=c[y+132>>2]|0;e=1;j=+h[x>>3];i=+h[x+8>>3];break}else {p=+(e|0);x=c[y+132>>2]|0;e=e+1|0;s=+(e|0);j=(+h[x>>3]+j*p)/s;i=(+h[x+8>>3]+i*p)/s;break}while(0);n=bB(d,n,r)|0;}do if((e|0)<=1)if((e|0)==1){f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=j*.98+l;i=i*.9+m;break}else {i=+B5()*6.283185307179586;s=+B5()*.9;p=s*+h[23248]*+E(+i);f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=p;i=+h[23249]*s*+F(+i);break}else {f=c[q>>2]|0;e=c[f+132>>2]|0;h[e>>3]=j;}while(0);h[e+8>>3]=i;a[f+119>>0]=1;}while(0);r=kC(d,r)|0;}}while(0);h[b>>3]=t;h[b+8>>3]=w;return}function jp(a){a=a|0;var b=0;b=c[46478]|0;return +(+h[23243]*+(b-a|0)/+(b|0))}function kp(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0,g=0,i=0,j=0.0;if(!(b<=0.0)){Qv(e);f=jC(a)|0;while(1){if(!f)break;i=c[f+16>>2]|0;g=(c[i+112>>2]|0)+16|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;i=c[i+132>>2]|0;j=+h[23245];g=~~+A(+(+h[i>>3]/j));Tv(e,g,~~+A(+(+h[i+8>>3]/j)),f);f=kC(a,f)|0;}g=jC(a)|0;while(1){if(!g)break;f=XA(a,g)|0;while(1){if(!f)break;i=c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0;if((g|0)!=(i|0))op(g,i,f);f=ZA(a,f)|0;}g=kC(a,g)|0;}Vv(e,23);pp(a,b,d);}return}function lp(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0,g=0;if(!(b<=0.0)){e=jC(a)|0;while(1){if(!e)break;g=(c[(c[e+16>>2]|0)+112>>2]|0)+16|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;e=kC(a,e)|0;}g=jC(a)|0;while(1){if(!g)break;else e=g;while(1){e=kC(a,e)|0;if(!e)break;np(g,e);}e=XA(a,g)|0;while(1){if(!e)break;f=c[((c[e>>2]&3|0)==2?e:e+-48|0)+40>>2]|0;if((g|0)!=(f|0))op(g,f,e);e=ZA(a,e)|0;}g=kC(a,g)|0;}pp(a,b,d);}return}function mp(){h[23243]=-1.0;return}function np(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0;g=c[(c[b+16>>2]|0)+132>>2]|0;f=c[(c[a+16>>2]|0)+132>>2]|0;d=+h[g>>3]-+h[f>>3];e=+h[g+8>>3]-+h[f+8>>3];qp(a,b,d,e,e*e+d*d);return}function op(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0.0,j=0,k=0;j=b+16|0;k=c[(c[j>>2]|0)+132>>2]|0;a=a+16|0;b=c[(c[a>>2]|0)+132>>2]|0;e=+h[k>>3]-+h[b>>3];f=+h[k+8>>3]-+h[b+8>>3];g=e;i=f;e=e*e;f=f*f;while(1){e=e+f;if(!(e==0.0))break;e=+(5-((x5()|0)%10|0)|0);f=+(5-((x5()|0)%10|0)|0);g=e;i=f;e=e*e;f=f*f;}f=+C(+e);b=c[d+16>>2]|0;e=+h[b+128>>3];if(!(c[46475]|0))e=e*f/+h[b+136>>3];else e=(f-+h[b+136>>3])*e/f;g=e*g;k=c[(c[j>>2]|0)+112>>2]|0;j=k+16|0;h[j>>3]=+h[j>>3]-g;i=e*i;k=k+24|0;h[k>>3]=+h[k>>3]-i;k=c[(c[a>>2]|0)+112>>2]|0;j=k+16|0;h[j>>3]=+h[j>>3]+g;k=k+24|0;h[k>>3]=+h[k>>3]+i;return}function pp(b,d,e){b=b|0;d=+d;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0;o=d*d;n=(e|0)==0;m=jC(b)|0;while(1){if(!m)break;l=c[m+16>>2]|0;if(!(a[l+119>>0]&2)){k=c[l+112>>2]|0;f=+h[k+16>>3];i=+h[k+24>>3];g=i*i+f*f;if(g>2]|0;j=+h[e>>3]+f;f=+h[e+8>>3]+i;}else {g=d/+C(+g);e=c[l+132>>2]|0;j=+h[e>>3]+g*f;f=+h[e+8>>3]+g*i;}do if(!n){g=+C(+(f*f/+h[23251]+j*j/+h[23250]));if((c[k+8>>2]|0)==0?(c[l+212>>2]|0)==0:0){h[e>>3]=j/g;f=f/g;break}if(!(g>=1.0)){h[e>>3]=j;break}else {h[e>>3]=j*.95/g;f=f*.95/g;break}}else h[e>>3]=j;while(0);h[e+8>>3]=f;}m=kC(b,m)|0;}return}function qp(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=+e;f=+f;var g=0.0,i=0,j=0;g=d;d=f;while(1){if(!(d==0.0))break;d=+(5-((x5()|0)%10|0)|0);e=+(5-((x5()|0)%10|0)|0);g=d;d=e*e+d*d;}if(!(c[46475]|0))d=+h[23247]/d;else {f=+C(+d);d=+h[23247]/(f*d);}j=c[a+16>>2]|0;a=c[j+112>>2]|0;if(((c[a+8>>2]|0)==0?(c[j+212>>2]|0)==0:0)?(i=c[b+16>>2]|0,(c[(c[i+112>>2]|0)+8>>2]|0)==0):0)d=(c[i+212>>2]|0)==0?d*10.0:d;f=d*g;j=c[(c[b+16>>2]|0)+112>>2]|0;b=j+16|0;h[b>>3]=+h[b>>3]+f;g=d*e;j=j+24|0;h[j>>3]=+h[j>>3]+g;j=a+16|0;h[j>>3]=+h[j>>3]-f;j=a+24|0;h[j>>3]=+h[j>>3]-g;return}function rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;f=c[b+8>>2]|0;g=c[b>>2]|0;e=c[b+4>>2]|0;b=f;while(1){if(!b)break;a=f;while(1){if(!a)break;if((b|0)!=(a|0))np(c[b>>2]|0,c[a>>2]|0);a=c[a+4>>2]|0;}b=c[b+4>>2]|0;}h=g+-1|0;a=e+-1|0;sp(d,h,a,f);sp(d,h,e,f);b=e+1|0;sp(d,h,b,f);sp(d,g,a,f);sp(d,g,b,f);g=g+1|0;sp(d,g,a,f);sp(d,g,e,f);sp(d,g,b,f);return 0}function sp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0,k=0,l=0,m=0;a=Wv(a,b,d)|0;if((e|0)!=0&(a|0)!=0){k=a+8|0;do{d=c[e>>2]|0;j=d+16|0;a=k;while(1){a=c[a>>2]|0;if(!a)break;b=c[a>>2]|0;m=c[(c[b+16>>2]|0)+132>>2]|0;l=c[(c[j>>2]|0)+132>>2]|0;f=+h[m>>3]-+h[l>>3];g=+h[m+8>>3]-+h[l+8>>3];i=g*g+f*f;if(i<+h[23246])qp(d,b,f,g,i);a=a+4|0;}e=c[e+4>>2]|0;}while((e|0)!=0)}return}function tp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+16|0;g=h;e=QA(b,92507)|0;if(0);if(!((e|0)!=0?(a[e>>0]|0)!=0:0))e=91125;f=R2(e,58)|0;do if(!f)f=0;else {if((f|0)!=(e|0)?((a[e>>0]|0)+-48|0)>>>0>=10:0){f=0;break}i=q5(e)|0;e=f+1|0;f=(i|0)>0?i:0;}while(0);if(0);if(!((f|0)!=0?!(up(b,d,f)|0):0))nr(b,e)|0;l=h;return}function up(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0;t=l;l=l+64|0;r=t;j=t+40|0;s=tB(b)|0;k=uB(b)|0;lr(j,b);c[46842]=c[j>>2];c[46843]=c[j+4>>2];c[46844]=c[j+8>>2];if(a[187376]|0){g[46842]=+g[46842]*.013888888888888888;g[46843]=+g[46843]*.013888888888888888;}f=vp(b)|0;a:do if(!f)f=0;else {j=r;i=j+40|0;do{c[j>>2]=c[d>>2];j=j+4|0;d=d+4|0;}while((j|0)<(i|0));j=r+16|0;q=+h[j>>3];o=+(k|0)*2.0;p=1.0/+(O(s+-1|0,s)|0);i=0;n=q;while(1){if(!((f|0)!=0&(i|0)<(e|0)))break a;wp(s,r);m=+h[23253]*+h[170];h[23254]=m;h[23255]=o*m*p;d=0;while(1){if((d|0)>=(c[46512]|0))break;m=+xp(d);if(m<=0.0)break;f=yp(b,m)|0;if(!f){f=0;break}else d=d+1|0;}m=n+q;h[j>>3]=m;i=i+1|0;n=m;}}while(0);l=t;return f|0}function vp(a){a=a|0;var b=0,c=0,d=0,e=0;b=0;e=jC(a)|0;while(1){if(!e)break;else d=e;while(1){c=kC(a,d)|0;if(!c)break;d=c;b=(Bp(e,c)|0)+b|0;}e=kC(a,e)|0;}return b|0}function wp(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0;e=+h[b+16>>3];h[171]=e;c[344]=c[b>>2];f=+h[b+8>>3];h[23257]=f;c[46512]=c[b+32>>2];d=+h[b+24>>3];if(d>0.0)h[170]=d;h[23253]=e*e;if(f==0.0)h[23257]=+C(+(+(a|0)))*.2*e;return}function xp(a){a=a|0;var b=0;b=c[344]|0;return +(+h[23257]*+(b-a|0)/+(b|0))}function yp(b,d){b=b|0;d=+d;var e=0,f=0,g=0,i=0.0,j=0,k=0.0,l=0.0,m=0.0;e=jC(b)|0;while(1){if(!e)break;j=(c[(c[e+16>>2]|0)+112>>2]|0)+16|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;e=kC(b,e)|0;}e=0;j=jC(b)|0;while(1){if(!j)break;else g=j;while(1){f=kC(b,g)|0;if(!f)break;g=f;e=(zp(j,f)|0)+e|0;}f=XA(b,j)|0;while(1){if(!f)break;Ap(j,c[((c[f>>2]&3|0)==2?f:f+-48|0)+40>>2]|0);f=ZA(b,f)|0;}j=kC(b,j)|0;}a:do if(!e)e=0;else {m=d*d;g=jC(b)|0;while(1){if(!g)break a;f=c[g+16>>2]|0;if((a[f+119>>0]|0)!=3){j=c[f+112>>2]|0;k=+h[j+16>>3];i=+h[j+24>>3];l=i*i+k*k;if(l>2]|0;h[f>>3]=+h[f>>3]+k;}else {l=+C(+l);f=c[f+132>>2]|0;h[f>>3]=+h[f>>3]+k*d/l;i=i*d/l;}j=f+8|0;h[j>>3]=+h[j>>3]+i;}g=kC(b,g)|0;}}while(0);return e|0}function zp(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0;g=c[(c[b+16>>2]|0)+132>>2]|0;f=c[(c[a+16>>2]|0)+132>>2]|0;d=+h[g>>3]-+h[f>>3];e=+h[g+8>>3]-+h[f+8>>3];return Dp(a,b,d,e,e*e+d*d)|0}function Ap(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,g=0.0,i=0,j=0.0,k=0.0,l=0,m=0;if(!(Bp(a,b)|0)){i=c[b+16>>2]|0;m=c[i+132>>2]|0;f=c[a+16>>2]|0;l=c[f+132>>2]|0;e=+h[m>>3]-+h[l>>3];d=+h[m+8>>3]-+h[l+8>>3];g=+C(+(d*d+e*e));j=+Cp(a);j=+Cp(b)+j;k=g-j;g=k*k/((+h[171]+j)*g);e=g*e;b=c[i+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]-e;d=g*d;b=b+24|0;h[b>>3]=+h[b>>3]-d;b=c[f+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]+e;b=b+24|0;h[b>>3]=+h[b>>3]+d;}return}function Bp(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,i=0.0,j=0.0,k=0,l=0;k=c[d+16>>2]|0;l=c[k+132>>2]|0;d=c[b+16>>2]|0;b=c[d+132>>2]|0;i=+h[l>>3]-+h[b>>3];j=+h[l+8>>3]-+h[b+8>>3];j=j<0.0?-j:j;b=(a[187376]|0)==0;e=+h[d+32>>3];if(b){f=+g[46842];e=e*.5*f;f=+h[k+32>>3]*.5*f;}else {f=+g[46842];e=e*.5+f;f=+h[k+32>>3]*.5+f;}if(!((i<0.0?-i:i)<=f+e))d=0;else {e=+h[d+40>>3];if(b){i=+g[46843];f=e*.5*i;e=+h[k+40>>3]*.5*i;}else {i=+g[46843];f=e*.5+i;e=+h[k+40>>3]*.5+i;}d=j<=e+f&1;}return d|0}function Cp(b){b=b|0;var d=0.0,e=0.0;b=c[b+16>>2]|0;d=+h[b+32>>3];if(!(a[187376]|0)){e=d*.5*+g[46842];d=+h[b+40>>3]*.5*+g[46843];}else {e=d*.5+ +g[46842];d=+h[b+40>>3]*.5+ +g[46843];}return +(+C(+(d*d+e*e)))}function Dp(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=+e;f=+f;var g=0,i=0;while(1){if(!(f==0.0))break;f=+(5-((x5()|0)%10|0)|0);e=+(5-((x5()|0)%10|0)|0);d=f;f=e*e+f*f;}g=Bp(a,b)|0;f=((g|0)==0?+h[23255]:+h[23254])/f;d=f*d;b=c[(c[b+16>>2]|0)+112>>2]|0;i=b+16|0;h[i>>3]=+h[i>>3]+d;f=f*e;b=b+24|0;h[b>>3]=+h[b>>3]+f;b=c[(c[a+16>>2]|0)+112>>2]|0;a=b+16|0;h[a>>3]=+h[a>>3]-d;b=b+24|0;h[b>>3]=+h[b>>3]-f;return g|0}function Ep(a){a=a|0;oQ(a,2);b[(c[a+16>>2]|0)+176>>1]=2;c[47137]=2;Fp(a);return}function Fp(a){a=a|0;var b=0,d=0,e=0,f=0;e=JK((tB(a)|0)<<2)|0;b=JK(((tB(a)|0)<<2)+4|0)|0;f=a+16|0;c[(c[f>>2]|0)+152>>2]=b;b=jC(a)|0;d=0;while(1){if(!b)break;Zl(b);c[(c[b+16>>2]|0)+112>>2]=e+(d<<2);c[(c[(c[f>>2]|0)+152>>2]|0)+(d<<2)>>2]=b;b=kC(a,b)|0;d=d+1|0;}d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;Gp(b);b=ZA(a,b)|0;}d=kC(a,d)|0;}return}function Gp(a){a=a|0;var b=0.0;TC(a,137460,176,1)|0;tP(a)|0;b=+_O(a,c[47174]|0,1.0,0.0);h[(c[a+16>>2]|0)+128>>3]=b;return}function Hp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;m=n+4|0;k=n;a[m>>0]=a[18596]|0;a[m+1>>0]=a[18597]|0;a[m+2>>0]=a[18598]|0;a[m+3>>0]=a[18599]|0;m=oB(91156,m,0)|0;TC(m,91164,280,1)|0;c[(c[b+16>>2]|0)+140>>2]=m;e=jC(b)|0;while(1){if(!e)break;f=e+16|0;if(!(c[c[(c[f>>2]|0)+112>>2]>>2]|0)){j=Ip(m,KB(e)|0,e)|0;c[c[(c[f>>2]|0)+112>>2]>>2]=j;}e=kC(b,e)|0;}f=jC(b)|0;while(1){if(!f)break;e=XA(b,f)|0;while(1){if(!e)break;h=c[e>>2]&3;g=c[c[(c[(c[((h|0)==3?e:e+48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;h=c[c[(c[(c[((h|0)==2?e:e+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;if((g|0)!=(h|0))TC(iB(m,g,h,0,1)|0,137460,176,1)|0;e=ZA(b,e)|0;}f=kC(b,f)|0;}j=DG(m,k,0)|0;f=0;while(1){if((f|0)>=(c[k>>2]|0))break;h=c[j+(f<<2)>>2]|0;e=jC(h)|0;while(1){if(!e)break;g=XA(b,c[c[(c[e+16>>2]|0)+112>>2]>>2]|0)|0;while(1){if(!g)break;i=c[c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]>>2]|0;if((e|0)!=(i|0)){i=iB(m,e,i,0,1)|0;TC(i,137460,176,1)|0;mB(h,i,1)|0;}g=ZA(b,g)|0;}e=kC(h,e)|0;}f=f+1|0;}e=jC(m)|0;while(1){if(!e)break;f=XA(m,e)|0;while(1){if(!f)break;b=JK(8)|0;c[(c[f+16>>2]|0)+120>>2]=b;f=ZA(m,f)|0;}e=kC(m,e)|0;}c[d>>2]=c[k>>2];l=n;return j|0}function Ip(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;b=tC(a,b,1)|0;TC(b,137447,304,1)|0;e=JK(40)|0;a=b+16|0;c[(c[a>>2]|0)+112>>2]=e;e=JK(c[47137]<<3)|0;a=c[a>>2]|0;c[a+132>>2]=e;e=c[d+16>>2]|0;h[a+88>>3]=+h[e+88>>3];h[a+96>>3]=+h[e+96>>3];h[a+80>>3]=+h[e+80>>3];c[c[a+112>>2]>>2]=d;return b|0}function Jp(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;h=l;l=l+48|0;b=h+32|0;e=h;if(tB(a)|0){g=Hp(a,b)|0;f=c[b>>2]|0;b=c[g>>2]|0;if((f|0)==1){bx(b,a);Kp(c[g>>2]|0);or(a)|0;}else {d=c[b+60>>2]|0;kH(a,2,8,e)|0;b=0;while(1){if((b|0)>=(f|0))break;i=c[g+(b<<2)>>2]|0;bx(i,a);or(i)|0;b=b+1|0;}jH(f,g,d,e)|0;b=0;while(1){if((b|0)>=(f|0))break;Kp(c[g+(b<<2)>>2]|0);b=b+1|0;}}U1(g);}l=h;return}function Kp(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;while(1){if(!b)break;d=c[b+16>>2]|0;e=c[d+132>>2]|0;d=c[(c[(c[c[d+112>>2]>>2]|0)+16>>2]|0)+132>>2]|0;h[d>>3]=+h[e>>3];h[d+8>>3]=+h[e+8>>3];b=kC(a,b)|0;}return}function Lp(a){a=a|0;if(tB(a)|0){Ep(a);Jp(a);U1(c[(c[(jC(a)|0)+16>>2]|0)+112>>2]|0);fn(a);tM(a);}return}function Mp(a){a=a|0;var b=0,d=0,e=0;b=jC(a)|0;if(b|0){e=a+16|0;Np(c[(c[e>>2]|0)+140>>2]|0);while(1){if(!b)break;d=XA(a,b)|0;while(1){if(!d)break;YP(d);d=ZA(a,d)|0;}WP(b);b=kC(a,b)|0;}U1(c[(c[e>>2]|0)+152>>2]|0);if((yC(a)|0)!=(a|0))ZC(a,0,137483);}return}function Np(a){a=a|0;var b=0,d=0;d=jC(a)|0;while(1){if(!d)break;b=XA(a,d)|0;while(1){if(!b)break;U1(c[(c[b+16>>2]|0)+120>>2]|0);b=ZA(a,b)|0;}b=d+16|0;U1(c[(c[b>>2]|0)+112>>2]|0);U1(c[(c[b>>2]|0)+132>>2]|0);d=kC(a,d)|0;}sB(a)|0;return}function Op(b){b=b|0;var d=0,e=0.0,f=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+112|0;m=s+40|0;n=s+16|0;r=s+100|0;o=s;j=s+88|0;p=s+56|0;Pp(b);i=(c[47137]|0)==2;d=i&1;if(tB(b)|0){q=Yp()|0;Qp(b,q);Nq(b,n,0)|0;if(i&(c[n>>2]|0)==18){c[q+124>>2]=c[n+8>>2];h[q+144>>3]=+h[n+16>>3];lr(j,b);if(!(a[j+8>>0]|0)){f=.05555555555555555;e=.05555555555555555;}else {f=+g[j+4>>2]*.013888888888888888;e=+g[j>>2]*.013888888888888888;}h[o>>3]=e;h[o+8>>3]=f;d=0;}else c[q+124>>2]=-1;if(0);k=DG(b,r,0)|0;if((c[r>>2]|0)==1){c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];Rp(b,q,m);if(d|0)Qq(b,n)|0;fn(b);d=0;}else {kH(b,2,8,p)|0;c[p+12>>2]=1;j=(d|0)==0;i=0;while(1){d=c[r>>2]|0;if((i|0)>=(d|0))break;d=c[k+(i<<2)>>2]|0;KG(d)|0;c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];Rp(d,q,m);if(!j)Qq(d,n)|0;oQ(d,2);fn(d);i=i+1|0;}jH(d,k,b,p)|0;d=0;}while(1){if((d|0)>=(c[r>>2]|0))break;wC(b,c[k+(d<<2)>>2]|0)|0;d=d+1|0;}U1(k);Zp(q);}tM(b);l=s;return}function Pp(a){a=a|0;var d=0,f=0;oQ(a,2);d=ZO(a,GA(a,0,91368,0)|0,2,2)|0;f=(ZO(a,GA(a,0,91374,0)|0,d,2)|0)&65535;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=f;if((e[(c[(yC(a)|0)+16>>2]|0)+176>>1]|0)<10)f=b[(c[(yC(a)|0)+16>>2]|0)+176>>1]|0;else f=10;b[(c[(yC(a)|0)+16>>2]|0)+176>>1]=f;f=f&65535;c[47137]=f;b[(c[(yC(a)|0)+16>>2]|0)+178>>1]=(d|0)<(f|0)?d:f;Vp(a);return}function Qp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+16|0;f=g+8|0;d=g+12|0;e=b+108|0;c[d>>2]=c[e>>2];if((mm(a,2,d)|0)!=2)gA(0,91169,g)|0;c[e>>2]=c[d>>2];h[b+24>>3]=+_O(a,GA(a,0,91202,0)|0,-1.0,0.0);h[b>>3]=-+_O(a,GA(a,0,91204,0)|0,1.0001234,0.0);c[b+40>>2]=ZO(a,GA(a,0,91219,0)|0,2147483647,0)|0;c[b+120>>2]=Tp(a,GA(a,0,91226,0)|0)|0;c[b+132>>2]=Up(a,GA(a,0,91236,0)|0)|0;c[b+136>>2]=0;c[b+112>>2]=(eP(QA(a,91245)|0,0)|0)&255;c[b+128>>2]=(eP(QA(a,91254)|0,1)|0)&255;h[b+152>>3]=+_O(a,GA(a,0,91269,0)|0,0.0,-1797693134862315708145274.0e284);d=ZO(a,GA(a,0,91278,0)|0,0,0)|0;a=b+160|0;c[a>>2]=d;if((d|0)>4){c[f>>2]=d;gA(0,91291,f)|0;c[a>>2]=0;}l=g;return}function Rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;f=q;n=q+32|0;j=q+28|0;g=q+24|0;p=q+20|0;o=q+16|0;c[g>>2]=0;c[p>>2]=0;c[o>>2]=0;i=b+136|0;e=c[47137]|0;if((c[i>>2]|0)==1)m=Kq(a,e,o)|0;else m=Kq(a,e,0)|0;do if((c[b+124>>2]|0)>-1)if((c[b+160>>2]|0)>0){c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];k=Jq(a,f,g,p)|0;break}else {c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];k=Jq(a,f,0,0)|0;break}else k=0;while(0);e=Sp(a)|0;c[n>>2]=e;switch(c[i>>2]|0){case 1:case 0:{wq(c[47137]|0,m,c[o>>2]|0,b,0,k,e,c[g>>2]|0,c[p>>2]|0,j);break}case 5:{Iq(c[47137]|0,m,e,j);break}case 4:{e=c[o>>2]|0;if(!e)e=Qw(m)|0;else e=Aw(e,0)|0;c[o>>2]=e;Dq(c[47137]|0,m,e,n,1,200,.001,j);break}default:{}}e=jC(a)|0;while(1){if(!e)break;d=c[47137]|0;g=c[e+16>>2]|0;b=(c[n>>2]|0)+((O(c[g+120>>2]|0,d)|0)<<3)|0;g=g+132|0;f=0;while(1){if((f|0)>=(d|0))break;h[(c[g>>2]|0)+(f<<3)>>3]=+h[b+(f<<3)>>3];f=f+1|0;}e=kC(a,e)|0;}U1(k);U1(c[n>>2]|0);qw(m);e=c[o>>2]|0;if(e|0)qw(e);e=c[p>>2]|0;if(e|0)U1(e);l=q;return}function Sp(b){b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0;j=c[47137]|0;j=JK(O(j<<3,tB(b)|0)|0)|0;a:do if(GA(b,1,102623,0)|0){f=jC(b)|0;while(1){if(!f)break a;d=c[f+16>>2]|0;b:do if(a[d+119>>0]|0){g=c[47137]|0;i=O(g,c[d+120>>2]|0)|0;e=d+132|0;d=0;while(1){if((d|0)>=(g|0))break b;h[j+(i+d<<3)>>3]=+h[(c[e>>2]|0)+(d<<3)>>3];d=d+1|0;}}while(0);f=kC(b,f)|0;}}while(0);return j|0}function Tp(b,c){b=b|0;c=c|0;do if(c){b=RA(b,c)|0;c=a[b>>0]|0;if((c+-48|0)>>>0<10){b=q5(b)|0;b=(b|0)<5?b:0;break}if(b3(c)|0)if(c3(b,91330)|0)if(c3(b,91339)|0)if(c3(b,135709)|0)if(!(c3(b,91350)|0))b=3;else {b=(c3(b,91361)|0)==0;b=b?4:0;}else b=0;else b=1;else b=2;else b=0;}else b=0;while(0);return b|0}function Up(b,c){b=b|0;c=c|0;do if(c){b=RA(b,c)|0;c=a[b>>0]|0;if((c+-48|0)>>>0<10){b=q5(b)|0;b=b>>>0<3?b:1;break}if(b3(c)|0)if((c3(b,135709)|0)!=0?(c3(b,137308)|0)!=0:0)if(((c3(b,99730)|0)!=0?(c3(b,107652)|0)!=0:0)?(c3(b,107657)|0)!=0:0){b=(c3(b,91325)|0)==0;b=b?2:1;}else b=1;else b=0;else b=1;}else b=1;while(0);return b|0}function Vp(a){a=a|0;var b=0,c=0;b=jC(a)|0;while(1){if(!b)break;Zl(b);b=kC(a,b)|0;}c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;Wp(b);b=ZA(a,b)|0;}c=kC(a,c)|0;}return}function Wp(a){a=a|0;TC(a,137460,176,1)|0;tP(a)|0;return}function Xp(a){a=a|0;var b=0,c=0;c=jC(a)|0;while(1){if(!c)break;b=XA(a,c)|0;while(1){if(!b)break;YP(b);b=ZA(a,b)|0;}WP(c);c=kC(a,c)|0;}return}function Yp(){var a=0,b=0;a=KK(168)|0;h[a>>3]=-1.0001234;h[a+8>>3]=1.0;c[a+16>>2]=1;h[a+24>>3]=-1.0;h[a+32>>3]=.2;c[a+40>>2]=0;c[a+44>>2]=4;c[a+48>>2]=1;c[a+52>>2]=45;c[a+56>>2]=10;h[a+64>>3]=.6;h[a+72>>3]=.001;c[a+80>>2]=500;h[a+88>>3]=.9;h[a+96>>3]=.1;c[a+104>>2]=1;c[a+108>>2]=123;b=a+112|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[a+128>>2]=1;c[a+132>>2]=3;c[a+136>>2]=0;h[a+144>>3]=-4.0;h[a+152>>3]=0.0;c[a+160>>2]=0;return a|0}function Zp(a){a=a|0;U1(a);return}function _p(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;b=l;l=l+176|0;d=b+160|0;f=b+152|0;g=b+128|0;k=b+112|0;j=b+88|0;m=b+64|0;n=b+56|0;o=b+40|0;q=b+24|0;p=b+16|0;r=b;e=c[15712]|0;U4(91378,27,1,e)|0;i=+h[a+8>>3];h[r>>3]=+h[a>>3];h[r+8>>3]=i;w4(e,91406,r)|0;r=c[a+108>>2]|0;c[p>>2]=c[a+16>>2];c[p+4>>2]=r;w4(e,91457,p)|0;i=+h[a+32>>3];h[q>>3]=+h[a+24>>3];h[q+8>>3]=i;w4(e,91484,q)|0;q=c[a+44>>2]|0;p=c[a+48>>2]|0;c[o>>2]=c[a+40>>2];c[o+4>>2]=q;c[o+8>>2]=p;w4(e,91507,o)|0;o=c[a+56>>2]|0;c[n>>2]=c[a+52>>2];c[n+4>>2]=o;w4(e,91558,n)|0;i=+h[a+72>>3];n=c[a+80>>2]|0;h[m>>3]=+h[a+64>>3];h[m+8>>3]=i;c[m+16>>2]=n;w4(e,91591,m)|0;i=+h[a+96>>3];m=c[a+104>>2]|0;h[j>>3]=+h[a+88>>3];h[j+8>>3]=i;c[j+16>>2]=m;w4(e,91649,j)|0;j=c[a+116>>2]|0;i=+h[a+152>>3];c[k>>2]=c[a+112>>2];c[k+4>>2]=j;h[k+8>>3]=i;w4(e,91695,k)|0;k=c[a+124>>2]|0;j=c[a+128>>2]|0;i=+h[a+144>>3];c[g>>2]=c[17804+(c[a+120>>2]<<2)>>2];c[g+4>>2]=k;c[g+8>>2]=j;h[g+16>>3]=i;w4(e,91748,g)|0;g=c[17848+(c[a+136>>2]<<2)>>2]|0;c[f>>2]=c[17832+(c[a+132>>2]<<2)>>2];c[f+4>>2]=g;w4(e,91813,f)|0;c[d>>2]=c[a+160>>2];w4(e,91843,d)|0;l=b;return}function $p(a){a=a|0;U1(a);return}function aq(a){a=a|0;var b=0;b=KK(184)|0;c[b>>2]=a;c[b+176>>2]=0;return b|0}function bq(a,b){a=a|0;b=+b;var d=0,e=0,f=0;e=c[a>>2]|0;h[a+8+(e<<3)>>3]=b;f=a+176|0;a:do switch(c[f>>2]|0){case 0:{d=c[a>>2]|0;if((d|0)==20){c[f>>2]=-1;d=19;}else {c[f>>2]=1;d=(d|0)>19?20:d+1|0;}c[a>>2]=d;break}case 1:{d=c[a>>2]|0;if((d|0)<20?+h[a+8+(e+-1<<3)>>3]>b:0){c[a>>2]=d+1;break a}else {c[a>>2]=d+-1;c[f>>2]=-1;break a}}default:{d=c[a>>2]|0;if((d|0)>0?+h[a+8+(e+1<<3)>>3]>b:0){c[a>>2]=d+-1;break a}else {c[a>>2]=d+1;c[f>>2]=1;break a}}}while(0);return}function cq(a){a=a|0;return c[a>>2]|0}function dq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;o=c[a+20>>2]|0;p=c[a+24>>2]|0;m=c[a>>2]|0;n=c[o+(m<<2)>>2]|0;if(!n)e=1.0;else {a=0;e=0.0;a:while(1){if((a|0)>=(m|0))break;j=a+1|0;k=c[o+(j<<2)>>2]|0;l=O(a,b)|0;i=c[o+(a<<2)>>2]|0;while(1){if((i|0)>=(k|0)){a=j;continue a}g=p+(i<<2)|0;a=0;f=0.0;while(1){if((a|0)>=(b|0))break;q=+h[d+(a+l<<3)>>3]-+h[d+((O(c[g>>2]|0,b)|0)<<3)>>3];a=a+1|0;f=q*q+f;}i=i+1|0;e=+C(+f)+e;}}e=e/+(n|0);}return +e}function eq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+10|0;if((c[d>>2]|0)<=(b|0)){c[d>>2]=e;c[a>>2]=MK(c[a>>2]|0,e<<3)|0;}return}function fq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=b+10|0;if((c[d>>2]|0)<=(b|0)){c[d>>2]=e;c[a>>2]=MK(c[a>>2]|0,e<<2)|0;}return}function gq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0,j=0,k=0;k=l;l=l+16|0;j=k;i=O(d,b)|0;b=O(c,b)|0;d=0;while(1){if((d|0)==2)break;h[j+(d<<3)>>3]=+h[a+(d+i<<3)>>3]-+h[a+(d+b<<3)>>3];d=d+1|0;}g=+h[j>>3];f=+h[j+8>>3];do if(!((g>=0.0?g:-g)<=(f>=0.0?f:-f)*1.0e-05)){e=+J(+(f/g));if(g>0.0){if(!(f<0.0))break;e=e+6.283185307179586;break}else {if(!(g<0.0))break;e=e+3.141592653589793;break}}else e=f>0.0?1.5707963267948966:4.71238898038469;while(0);l=k;return +e}function hq(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;d=+h[a>>3];c=+h[b>>3];return (d>c?1:(d>31)|0}function iq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0.0,B=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0.0,N=0,P=0,Q=0,R=0.0,S=0,T=0.0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0.0;_=l;l=l+80|0;Z=_+32|0;Y=_;p=+h[d>>3];m=d+24|0;n=+h[m>>3];o=d+32|0;j=+h[o>>3];R=+h[d+72>>3];S=c[d+80>>2]|0;T=+h[d+88>>3];q=+h[d+96>>3];U=c[d+104>>2]|0;V=d+56|0;i=c[V>>2]|0;do if(!((b|0)==0|(S|0)<1)?(W=c[b+4>>2]|0,!((a|0)<1|(W|0)<1)):0){Q=c[b>>2]|0;X=aq(i)|0;c[g>>2]=0;if((Q|0)!=(W|0)){c[g>>2]=-100;$p(X);c[V>>2]=i;break}N=vw(b,1)|0;P=c[N+20>>2]|0;Q=c[N+24>>2]|0;a:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);k=O(W,a)|0;i=0;while(1){if((i|0)>=(k|0))break a;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(n<0.0){n=+dq(N,a,f);h[m>>3]=n;}if(j<0.0){h[o>>3]=.2;j=.2;}if(p>=0.0){h[d>>3]=-1.0;p=-1.0;}M=+D(+n,+(1.0-p));A=+D(+j,+((2.0-p)*.3333333333333333))/n;B=O(W,a<<3)|0;E=KK(B)|0;F=KK(B)|0;G=d+116|0;H=d+64|0;I=c[15712]|0;J=N+8|0;K=Y+8|0;L=Y+16|0;y=0;z=0.0;v=q;while(1){W6(E|0,f|0,B|0)|0;w=cq(X)|0;x=hw(a,W,w,f,(c[G>>2]|0)==0?0:e)|0;cw(x,F,f,+h[H>>3],p,M,Y,g);m=0;b:while(1){if((m|0)>=(W|0)){q=0.0;k=0;break}o=O(m,a)|0;r=F+(o<<3)|0;s=m+1|0;t=P+(s<<2)|0;k=c[P+(m<<2)>>2]|0;while(1){if((k|0)>=(c[t>>2]|0)){m=s;continue b}u=Q+(k<<2)|0;i=c[u>>2]|0;c:do if((i|0)!=(m|0)){j=+_w(f,a,m,i)*A;i=0;while(1){if((i|0)>=(a|0))break c;q=j*(+h[f+(i+o<<3)>>3]-+h[f+((O(c[u>>2]|0,a)|0)+i<<3)>>3]);$=r+(i<<3)|0;h[$>>3]=+h[$>>3]-q;i=i+1|0;}}while(0);k=k+1|0;}}while(1){if((k|0)>=(W|0))break;m=O(k,a)|0;o=F+(m<<3)|0;j=0.0;i=0;while(1){if((i|0)>=(a|0))break;aa=+h[o+(i<<3)>>3];j=aa*aa+j;i=i+1|0;}j=+C(+j);q=j+q;d:do if(j>0.0){j=1.0/j;i=0;while(1){if((i|0)>=(a|0)){i=0;break d}$=o+(i<<3)|0;h[$>>3]=+h[$>>3]*j;i=i+1|0;}}else i=0;while(0);while(1){if((i|0)>=(a|0))break;$=f+(i+m<<3)|0;h[$>>3]=+h[$>>3]+ +h[o+(i<<3)>>3]*v;i=i+1|0;}k=k+1|0;}y=y+1|0;if(!x){if(0);}else {ow(x);bq(X,+h[K>>3]*.85+ +h[Y>>3]+ +h[L>>3]*3.3);}v=+jq(U,v,q,z,T);if(!((y|0)<(S|0)&v>R))break;else z=q;}if(c[d+112>>2]|0)kq(a,N,f);$p(X);c[V>>2]=w;U1(E);if((N|0)!=(b|0))qw(N);U1(F);}while(0);l=_;return}function jq(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;do if(a){if(c>=d){b=e*b;break}if(!(d*.95>2]|0;C=c[b+20>>2]|0;t=c[b+24>>2]|0;c[v>>2]=10;c[A>>2]=10;u=KK(B<<2)|0;f=KK(80)|0;c[y>>2]=f;e=KK(40)|0;c[z>>2]=e;b=0;while(1){if((b|0)>=(B|0)){n=0;r=f;k=e;o=e;m=f;break}c[u+(b<<2)>>2]=0;b=b+1|0;}while(1){if((n|0)>=(B|0))break;b=c[C+(n<<2)>>2]|0;a:do if((((c[C+(n+1<<2)>>2]|0)-b|0)==1?(c[u+(n<<2)>>2]|0)==0:0)?(w=c[t+(b<<2)>>2]|0,x=u+(w<<2)|0,(c[x>>2]|0)==0):0){c[x>>2]=1;q=C+(w+1<<2)|0;n=0;s=0;g=0.0;p=c[C+(w<<2)>>2]|0;k=o;b=r;while(1){if((p|0)>=(c[q>>2]|0))break;e=t+(p<<2)|0;f=c[e>>2]|0;if(((c[C+(f+1<<2)>>2]|0)-(c[C+(f<<2)>>2]|0)|0)==1){c[u+(f<<2)>>2]=1;fq(z,s,v);g=+_w(d,a,w,c[e>>2]|0)+g;k=c[z>>2]|0;c[k+(s<<2)>>2]=c[e>>2];e=n;f=s+1|0;}else {eq(y,n,A);j=+gq(d,a,w,c[e>>2]|0);b=c[y>>2]|0;h[b+(n<<3)>>3]=j;e=n+1|0;f=s;m=b;}n=e;s=f;p=p+1|0;}j=g/+(s|0);if((n|0)>0){lq(n,m);b=m;}g=(s|0)>1?6.283185307179586/+(s+-1|0):0.0;e=0;i=0.0;while(1){if((e|0)>=(s|0)){o=k;f=k;break a}mq(d,a,j,i,w,c[k+(e<<2)>>2]|0);e=e+1|0;i=i+g;}}else {e=n;f=k;b=r;}while(0);n=e+1|0;r=b;k=f;}U1(u);U1(r);U1(k);l=D;return}function lq(a,b){a=a|0;b=b|0;o4(b,a,8,68);return}function mq(a,b,c,d,e,f){a=a|0;b=b|0;c=+c;d=+d;e=e|0;f=f|0;var g=0.0;g=+E(+d)*c;e=O(e,b)|0;f=O(f,b)|0;h[a+(f<<3)>>3]=g+ +h[a+(e<<3)>>3];d=+F(+d)*c;h[a+(f+1<<3)>>3]=d+ +h[a+(e+1<<3)>>3];return}function nq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0,B=0.0,E=0.0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0.0,Q=0,R=0.0,S=0,T=0,U=0,V=0,W=0.0;o=+h[d>>3];m=d+24|0;l=+h[m>>3];n=d+32|0;k=+h[n>>3];P=+h[d+72>>3];Q=c[d+80>>2]|0;R=+h[d+88>>3];r=+h[d+96>>3];S=c[d+104>>2]|0;i=c[d+56>>2]|0;U4(92198,32,1,c[15712]|0)|0;if(!((b|0)==0|(Q|0)<1)?(T=c[b>>2]|0,j=c[b+4>>2]|0,!((a|0)<1|(j|0)<1)):0){p=a<<3;U=KK(O(p,j)|0)|0;if((j|0)<(c[d+52>>2]|0)){I=0;J=0;K=0;L=0;M=0;N=0;}else {aq(i)|0;L=KK(a*80|0)|0;M=KK(80)|0;N=KK(80)|0;I=N;J=M;K=L;}c[g>>2]=0;if((T|0)==(j|0)){F=vw(b,1)|0;G=c[F+20>>2]|0;H=c[F+24>>2]|0;a:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);j=O(T,a)|0;i=0;while(1){if((i|0)>=(j|0))break a;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(l<0.0){l=+dq(F,a,f);h[m>>3]=l;}if(k<0.0){h[n>>3]=.2;k=.2;}if(o>=0.0){h[d>>3]=-1.0;o=-1.0;}B=1.0-o;E=+D(+l,+B);z=+D(+k,+((2.0-o)*.3333333333333333))/l;A=KK(p)|0;u=O(T,p)|0;v=KK(u)|0;w=O(T,a)|0;x=d+116|0;y=(e|0)!=0;t=o==-1.0;s=0;o=0.0;while(1){i=0;while(1){if((i|0)>=(w|0))break;h[U+(i<<3)>>3]=0.0;i=i+1|0;}W6(v|0,f|0,u|0)|0;p=0;while(1){if((p|0)<(T|0))i=0;else {n=0;break}while(1){if((i|0)>=(a|0))break;h[A+(i<<3)>>3]=0.0;i=i+1|0;}n=O(p,a)|0;b:do if(y&(c[x>>2]|0)!=0){i=0;while(1){if((i|0)==(T|0)){i=0;break b}c:do if((i|0)!=(p|0)){l=+Zw(f,a,p,i);g=e+(i<<3)|0;m=O(i,a)|0;k=+D(+l,+B);k=1.0/(t?l*l:k);j=0;while(1){if((j|0)>=(a|0))break c;q=A+(j<<3)|0;h[q>>3]=+h[g>>3]*E*(+h[f+(j+n<<3)>>3]-+h[f+(j+m<<3)>>3])*k+ +h[q>>3];j=j+1|0;}}while(0);i=i+1|0;}}else {i=0;while(1){if((i|0)==(T|0)){i=0;break b}d:do if((i|0)!=(p|0)){l=+Zw(f,a,p,i);g=O(i,a)|0;k=+D(+l,+B);k=1.0/(t?l*l:k);j=0;while(1){if((j|0)>=(a|0))break d;q=A+(j<<3)|0;h[q>>3]=(+h[f+(j+n<<3)>>3]-+h[f+(j+g<<3)>>3])*E*k+ +h[q>>3];j=j+1|0;}}while(0);i=i+1|0;}}while(0);while(1){if((i|0)>=(a|0))break;q=U+(i+n<<3)|0;h[q>>3]=+h[q>>3]+ +h[A+(i<<3)>>3];i=i+1|0;}p=p+1|0;}e:while(1){if((n|0)<(T|0))i=0;else {l=0.0;j=0;break}while(1){if((i|0)>=(a|0))break;h[A+(i<<3)>>3]=0.0;i=i+1|0;}p=n+1|0;g=G+(p<<2)|0;q=O(n,a)|0;j=c[G+(n<<2)>>2]|0;while(1){if((j|0)>=(c[g>>2]|0)){i=0;break}m=H+(j<<2)|0;i=c[m>>2]|0;f:do if((i|0)!=(n|0)){k=+_w(f,a,n,i)*z;i=0;while(1){if((i|0)>=(a|0))break f;l=k*(+h[f+(i+q<<3)>>3]-+h[f+((O(c[m>>2]|0,a)|0)+i<<3)>>3]);V=A+(i<<3)|0;h[V>>3]=+h[V>>3]-l;i=i+1|0;}}while(0);j=j+1|0;}while(1){if((i|0)>=(a|0)){n=p;continue e}V=U+(i+q<<3)|0;h[V>>3]=+h[V>>3]+ +h[A+(i<<3)>>3];i=i+1|0;}}while(1){if((j|0)>=(T|0))break;g=O(j,a)|0;i=0;while(1){if((i|0)>=(a|0)){k=0.0;i=0;break}h[A+(i<<3)>>3]=+h[U+(i+g<<3)>>3];i=i+1|0;}while(1){if((i|0)>=(a|0))break;W=+h[A+(i<<3)>>3];k=W*W+k;i=i+1|0;}k=+C(+k);l=k+l;g:do if(k>0.0){k=1.0/k;i=0;while(1){if((i|0)>=(a|0)){i=0;break g}V=A+(i<<3)|0;h[V>>3]=+h[V>>3]*k;i=i+1|0;}}else i=0;while(0);while(1){if((i|0)>=(a|0))break;V=f+(i+g<<3)|0;h[V>>3]=+h[V>>3]+ +h[A+(i<<3)>>3]*r;i=i+1|0;}j=j+1|0;}s=s+1|0;r=+jq(S,r,l,o,R);if(!((s|0)<(Q|0)&r>P))break;else o=l;}if(c[d+112>>2]|0)kq(a,F,f);U1(v);if((F|0)!=(b|0))qw(F);U1(A);}else c[g>>2]=-100;if(K|0)U1(L);if(J|0)U1(M);if(I|0)U1(N);U1(U);}return}function oq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,E=0.0,F=0,G=0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0.0,P=0.0,Q=0,R=0,S=0,T=0,U=0,V=0.0,W=0,X=0.0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0.0,ia=0;ga=l;l=l+32|0;_=ga+24|0;$=ga+20|0;da=ga+16|0;ea=ga+12|0;fa=ga+8|0;U=ga;s=+h[d>>3];k=d+24|0;r=+h[k>>3];m=d+32|0;q=+h[m>>3];V=+h[d+72>>3];W=c[d+80>>2]|0;X=+h[d+88>>3];t=+h[d+96>>3];Y=c[d+104>>2]|0;c[_>>2]=0;c[$>>2]=10;c[da>>2]=0;c[ea>>2]=0;c[fa>>2]=0;h[U>>3]=0.0;ca=d+56|0;n=c[ca>>2]|0;if(!((b|0)==0|(W|0)<1)?(Z=c[b>>2]|0,i=c[b+4>>2]|0,!((a|0)<1|(i|0)<1)):0){if((i|0)<(c[d+52>>2]|0)){ba=0;aa=0;}else {ba=aq(n)|0;c[da>>2]=KK(a*80|0)|0;c[ea>>2]=KK(80)|0;c[fa>>2]=KK(80)|0;aa=1;}c[g>>2]=0;a:do if((Z|0)==(i|0)){o=vw(b,1)|0;Q=c[o+20>>2]|0;R=c[o+24>>2]|0;b:do if(c[d+16>>2]|0){w5(c[d+108>>2]|0);j=O(Z,a)|0;i=0;while(1){if((i|0)>=(j|0))break b;h[f+(i<<3)>>3]=+Sw();i=i+1|0;}}while(0);if(r<0.0){r=+dq(o,a,f);h[k>>3]=r;}if(q<0.0){h[m>>3]=.2;q=.2;}if(s>=0.0){h[d>>3]=-1.0;s=-1.0;}N=1.0-s;P=+D(+r,+N);I=+D(+q,+((2.0-s)*.3333333333333333))/r;J=a<<3;S=KK(J)|0;J=O(Z,J)|0;T=KK(J)|0;K=(aa|0)!=0;L=d+116|0;M=d+64|0;F=s==-1.0;G=(e|0)!=0;H=1.0/+(Z|0);i=0;B=0;E=0.0;while(1){B=B+1|0;W6(T|0,f|0,J|0)|0;if(K){i=cq(ba)|0;n=i;i=hw(a,Z,i,f,(c[L>>2]|0)==0?0:e)|0;}u=0.0;s=0.0;v=0;r=0.0;c:while(1){if((v|0)<(Z|0))j=0;else break;while(1){if((j|0)>=(a|0))break;h[S+(j<<3)>>3]=0.0;j=j+1|0;}z=v+1|0;m=Q+(z<<2)|0;A=O(v,a)|0;k=c[Q+(v<<2)>>2]|0;while(1){if((k|0)>=(c[m>>2]|0))break;p=R+(k<<2)|0;j=c[p>>2]|0;d:do if((j|0)!=(v|0)){q=+_w(f,a,v,j)*I;j=0;while(1){if((j|0)>=(a|0))break d;ha=q*(+h[f+(j+A<<3)>>3]-+h[f+((O(c[p>>2]|0,a)|0)+j<<3)>>3]);y=S+(j<<3)|0;h[y>>3]=+h[y>>3]-ha;j=j+1|0;}}while(0);k=k+1|0;}e:do if(!K)if(G&(c[L>>2]|0)!=0){j=0;while(1){if((j|0)==(Z|0))break e;f:do if((j|0)!=(v|0)){ha=+Zw(f,a,v,j);m=e+(j<<3)|0;p=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break f;y=S+(k<<3)|0;h[y>>3]=+h[m>>3]*P*(+h[f+(k+A<<3)>>3]-+h[f+(k+p<<3)>>3])*q+ +h[y>>3];k=k+1|0;}}while(0);j=j+1|0;}}else {j=0;while(1){if((j|0)==(Z|0))break e;g:do if((j|0)!=(v|0)){ha=+Zw(f,a,v,j);m=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break g;y=S+(k<<3)|0;h[y>>3]=(+h[f+(k+A<<3)>>3]-+h[f+(k+m<<3)>>3])*P*q+ +h[y>>3];k=k+1|0;}}while(0);j=j+1|0;}}else {bw(i,+h[M>>3],f+(A<<3)|0,v,_,$,da,ea,fa,U,g);u=+h[U>>3]+u;y=c[_>>2]|0;s=s+ +(y|0);if(c[g>>2]|0){m=S;k=T;i=S;j=T;p=67;break a}m=c[fa>>2]|0;p=c[ea>>2]|0;v=c[da>>2]|0;j=0;while(1){if((j|0)>=(y|0))break e;ha=+h[m+(j<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;w=p+(j<<3)|0;x=O(j,a)|0;q=+D(+ha,+N);q=1.0/(F?ha*ha:q);k=0;while(1){if((k|0)>=(a|0))break;ia=S+(k<<3)|0;h[ia>>3]=+h[w>>3]*P*(+h[f+(k+A<<3)>>3]-+h[v+(k+x<<3)>>3])*q+ +h[ia>>3];k=k+1|0;}j=j+1|0;}}while(0);q=0.0;j=0;while(1){if((j|0)>=(a|0))break;ha=+h[S+(j<<3)>>3];q=ha*ha+q;j=j+1|0;}q=+C(+q);r=q+r;h:do if(q>0.0){q=1.0/q;j=0;while(1){if((j|0)>=(a|0)){j=0;break h}ia=S+(j<<3)|0;h[ia>>3]=+h[ia>>3]*q;j=j+1|0;}}else j=0;while(0);while(1){if((j|0)>=(a|0)){v=z;continue c}ia=f+(j+A<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[S+(j<<3)>>3]*t;j=j+1|0;}}if(i|0){ow(i);bq(ba,s*H*5.0+u*H);}t=+jq(Y,t,r,E,X);if(!((B|0)<(W|0)&t>V))break;else E=r;}if(!(c[d+112>>2]|0)){m=S;k=T;j=T;i=S;p=66;}else {kq(a,o,f);m=S;k=T;j=T;i=S;p=66;}}else {c[g>>2]=-100;o=b;m=0;k=0;j=0;i=0;p=66;}while(0);if((p|0)==66)if(aa)p=67;if((p|0)==67){$p(ba);c[ca>>2]=n;}if(k|0)U1(j);if((o|0)!=(b|0))qw(o);if(m|0)U1(i);i=c[da>>2]|0;if(i|0)U1(i);i=c[ea>>2]|0;if(i|0)U1(i);i=c[fa>>2]|0;if(i|0)U1(i);}l=ga;return}function pq(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=+i;j=j|0;var k=0,m=0,n=0,o=0,p=0.0,q=0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0.0,z=0,A=0,B=0.0,E=0,F=0.0,G=0.0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0.0,Z=0,_=0.0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0.0,ia=0;ga=l;l=l+48|0;o=ga+8|0;ba=ga+40|0;ca=ga+36|0;W=ga+32|0;ea=ga+28|0;fa=ga+24|0;X=ga;p=+h[e>>3];q=e+32|0;r=+h[q>>3];Y=+h[e+72>>3];Z=c[e+80>>2]|0;_=+h[e+88>>3];t=+h[e+96>>3];$=c[e+104>>2]|0;c[ba>>2]=0;c[ca>>2]=10;c[W>>2]=0;c[ea>>2]=0;c[fa>>2]=0;h[X>>3]=0.0;if(!((b|0)==0|(Z|0)<1)?(aa=c[b>>2]|0,n=c[b+4>>2]|0,!((a|0)<1|(n|0)<1)):0){if((c[e+132>>2]|0)!=0?(n|0)>=(c[e+52>>2]|0):0){m=KK(a*80|0)|0;c[W>>2]=m;c[ea>>2]=KK(80)|0;c[fa>>2]=KK(80)|0;s=1;k=m;}else {s=0;k=0;m=0;}c[j>>2]=0;if((aa|0)==(n|0)){V=vw(b,1)|0;if(!d){U=0;k=V;}else {U=c[d+28>>2]|0;k=d;}T=c[k+24>>2]|0;S=c[k+20>>2]|0;if(i<0.0){G=+qq(aa,S,U);F=+(c[S+(aa<<2)>>2]|0);B=+(aa|0);i=F/(B*B-F)*i/+D(+G,+(p+1.0));R=c[15712]|0;h[o>>3]=G;h[o+8>>3]=i;w4(R,92231,o)|0;}a:do if(c[e+16>>2]|0){U4(92253,24,1,c[15712]|0)|0;w5(c[e+108>>2]|0);m=O(aa,a)|0;k=0;while(1){if((k|0)>=(m|0))break a;h[g+(k<<3)>>3]=+Sw();k=k+1|0;}}while(0);rq(aa,a,g,S,T,U);if(r<0.0)h[q>>3]=.2;if(p>=0.0){h[e>>3]=-1.0;p=-1.0;}Q=a<<3;P=KK(Q)|0;Q=O(aa,Q)|0;R=KK(Q)|0;I=(s|0)!=0;J=e+116|0;K=(U|0)==0;L=e+8|0;M=(f|0)!=0;N=p==-1.0;G=1.0-p;H=e+64|0;k=0;E=0;F=0.0;p=1.0;B=t;b:while(1){E=E+1|0;W6(R|0,g|0,Q|0)|0;if(I)k=hw(a,aa,10,g,(c[J>>2]|0)==0?0:f)|0;s=0;t=0.0;c:while(1){if((s|0)<(aa|0))m=0;else break;while(1){if((m|0)>=(a|0))break;h[P+(m<<3)>>3]=0.0;m=m+1|0;}A=s+1|0;q=S+(A<<2)|0;z=O(s,a)|0;o=c[S+(s<<2)>>2]|0;while(1){if((o|0)>=(c[q>>2]|0))break;d=T+(o<<2)|0;m=c[d>>2]|0;d:do if((m|0)!=(s|0)){y=+Zw(g,a,s,m);if(!K)p=+h[U+(o<<3)>>3];r=+h[L>>3];e:do if(!(r==2.0))if(r==1.0){r=(y-p)*(1.0/(p*p));u=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;v=r*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*u;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-v;m=m+1|0;}}else {r=1.0/+D(+p,+(r+1.0));u=y-p;v=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;ha=+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3];ha=r*ha*+D(+u,+(+h[L>>3]))*v;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}else {r=y-p;r=r*r*(1.0/(p*p*p));u=1.0/y;m=0;while(1){if((m|0)>=(a|0))break e;ha=r*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*u;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}while(0);if(M&(c[J>>2]|0)!=0){n=f+(o<<3)|0;r=+D(+y,+G);r=1.0/(N?y*y:r);m=0;while(1){if((m|0)>=(a|0))break d;ha=+h[n>>3]*i*(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*r;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}else {r=+D(+y,+G);r=1.0/(N?y*y:r);m=0;while(1){if((m|0)>=(a|0))break d;ha=(+h[g+(m+z<<3)>>3]-+h[g+((O(c[d>>2]|0,a)|0)+m<<3)>>3])*i*r;x=P+(m<<3)|0;h[x>>3]=+h[x>>3]-ha;m=m+1|0;}}}while(0);o=o+1|0;}f:do if(!I)if(M&(c[J>>2]|0)!=0){m=0;while(1){if((m|0)==(aa|0)){r=0.0;m=0;break f}g:do if((m|0)!=(s|0)){ha=+Zw(g,a,s,m);d=f+(m<<3)|0;o=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break g;x=P+(n<<3)|0;h[x>>3]=+h[d>>3]*i*(+h[g+(n+z<<3)>>3]-+h[g+(n+o<<3)>>3])*r+ +h[x>>3];n=n+1|0;}}while(0);m=m+1|0;}}else {m=0;while(1){if((m|0)==(aa|0)){r=0.0;m=0;break f}h:do if((m|0)!=(s|0)){ha=+Zw(g,a,s,m);d=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break h;x=P+(n<<3)|0;h[x>>3]=(+h[g+(n+z<<3)>>3]-+h[g+(n+d<<3)>>3])*i*r+ +h[x>>3];n=n+1|0;}}while(0);m=m+1|0;}}else {bw(k,+h[H>>3],g+(z<<3)|0,s,ba,ca,W,ea,fa,X,j);d=c[ba>>2]|0;if(c[j>>2]|0)break b;o=c[fa>>2]|0;q=c[ea>>2]|0;s=c[W>>2]|0;m=0;while(1){if((m|0)>=(d|0)){r=0.0;m=0;break f}ha=+h[o+(m<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;w=q+(m<<3)|0;x=O(m,a)|0;r=+D(+ha,+G);r=1.0/(N?ha*ha:r);n=0;while(1){if((n|0)>=(a|0))break;ia=P+(n<<3)|0;h[ia>>3]=+h[w>>3]*i*(+h[g+(n+z<<3)>>3]-+h[s+(n+x<<3)>>3])*r+ +h[ia>>3];n=n+1|0;}m=m+1|0;}}while(0);while(1){if((m|0)>=(a|0))break;ha=+h[P+(m<<3)>>3];r=ha*ha+r;m=m+1|0;}r=+C(+r);t=r+t;i:do if(r>0.0){r=1.0/r;m=0;while(1){if((m|0)>=(a|0)){m=0;break i}ia=P+(m<<3)|0;h[ia>>3]=+h[ia>>3]*r;m=m+1|0;}}else m=0;while(0);while(1){if((m|0)>=(a|0)){s=A;continue c}ia=g+(m+z<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[P+(m<<3)>>3]*B;m=m+1|0;}}if(k|0)ow(k);B=+jq($,B,t,F,_);if(!((E|0)<(Z|0)&B>Y)){da=83;break}else F=t;}if((da|0)==83?c[e+112>>2]|0:0)kq(a,V,g);U1(R);if((V|0)!=(b|0))qw(V);U1(P);k=c[W>>2]|0;m=k;}else c[j>>2]=-100;if(m|0)U1(k);k=c[ea>>2]|0;if(k|0)U1(k);k=c[fa>>2]|0;if(k|0)U1(k);}l=ga;return}function qq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0,j=0.0;if(!d)e=1.0;else {f=0;e=0.0;a:while(1){if((f|0)>=(a|0))break;g=f+1|0;i=c[b+(g<<2)>>2]|0;f=c[b+(f<<2)>>2]|0;while(1){if((f|0)>=(i|0)){f=g;continue a}j=+h[d+(f<<3)>>3]+e;f=f+1|0;e=j;}}e=e/+(c[b+(a<<2)>>2]|0);}return +e}function rq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0;v=l;l=l+16|0;u=v;t=(g|0)==0;k=0.0;m=0.0;n=1.0;j=0;a:while(1){if((j|0)>=(a|0))break;r=j+1|0;s=e+(r<<2)|0;q=c[e+(j<<2)>>2]|0;while(1){if((q|0)>=(c[s>>2]|0)){j=r;continue a}i=c[f+(q<<2)>>2]|0;b:do if((i|0)!=(j|0)){o=+Zw(d,b,j,i);if(!t)n=+h[g+(q<<3)>>3];w=1.0/(n*n);p=n*o*w;o=o*o*w;i=0;while(1){if((i|0)>=(b|0))break b;i=i+1|0;k=k+o;m=m+p;}}while(0);q=q+1|0;}}k=m/k;j=O(b,a)|0;i=0;while(1){if((i|0)>=(j|0))break;b=d+(i<<3)|0;h[b>>3]=+h[b>>3]*k;i=i+1|0;}d=c[15712]|0;h[u>>3]=k;w4(d,92278,u)|0;l=v;return}function sq(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0.0,A=0,B=0,E=0,F=0,G=0.0,H=0,I=0.0,J=0,K=0,L=0,M=0.0,N=0.0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0.0,X=0,Y=0.0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0.0,ha=0.0,ia=0;fa=l;l=l+32|0;$=fa+24|0;aa=fa+20|0;ba=fa+16|0;da=fa+12|0;ea=fa+8|0;V=fa;r=+h[e>>3];p=e+24|0;o=+h[p>>3];q=e+32|0;n=+h[q>>3];W=+h[e+72>>3];X=c[e+80>>2]|0;Y=+h[e+88>>3];v=+h[e+96>>3];Z=c[e+104>>2]|0;c[$>>2]=0;c[aa>>2]=10;c[ba>>2]=0;c[da>>2]=0;c[ea>>2]=0;h[V>>3]=0.0;if(!((b|0)==0|(X|0)<1)?(_=c[b>>2]|0,m=c[b+4>>2]|0,!((a|0)<1|(m|0)<1)):0){if((m|0)<(c[e+52>>2]|0)){s=0;j=0;k=0;}else {k=KK(a*80|0)|0;c[ba>>2]=k;c[da>>2]=KK(80)|0;c[ea>>2]=KK(80)|0;s=1;j=k;}c[i>>2]=0;if((_|0)==(m|0)){Q=vw(b,1)|0;R=c[Q+20>>2]|0;S=c[Q+24>>2]|0;T=c[d+20>>2]|0;U=c[d+24>>2]|0;P=c[d+28>>2]|0;a:do if(c[e+16>>2]|0){w5(c[e+108>>2]|0);k=O(_,a)|0;j=0;while(1){if((j|0)>=(k|0))break a;h[g+(j<<3)>>3]=+Sw();j=j+1|0;}}while(0);if(o<0.0){o=+dq(Q,a,g);h[p>>3]=o;}if(n<0.0){h[q>>3]=.2;n=.2;}if(r>=0.0){h[e>>3]=-1.0;r=-1.0;}M=1.0-r;N=+D(+o,+M);I=+D(+n,+((2.0-r)*.3333333333333333))/o;K=a<<3;J=KK(K)|0;K=O(_,K)|0;L=KK(K)|0;E=(s|0)!=0;F=e+116|0;G=I*.2;H=e+64|0;A=r==-1.0;B=(f|0)!=0;j=0;y=0;z=0.0;b:while(1){y=y+1|0;W6(L|0,g|0,K|0)|0;if(E)j=hw(a,_,10,g,(c[F>>2]|0)==0?0:f)|0;s=0;o=0.0;c:while(1){if((s|0)<(_|0))k=0;else break;while(1){if((k|0)>=(a|0))break;h[J+(k<<3)>>3]=0.0;k=k+1|0;}w=s+1|0;d=R+(w<<2)|0;x=O(s,a)|0;m=c[R+(s<<2)>>2]|0;while(1){if((m|0)>=(c[d>>2]|0))break;p=S+(m<<2)|0;k=c[p>>2]|0;d:do if((k|0)!=(s|0)){n=+_w(g,a,s,k)*I;k=0;while(1){if((k|0)>=(a|0))break d;r=n*(+h[g+(k+x<<3)>>3]-+h[g+((O(c[p>>2]|0,a)|0)+k<<3)>>3]);u=J+(k<<3)|0;h[u>>3]=+h[u>>3]-r;k=k+1|0;}}while(0);m=m+1|0;}p=T+(w<<2)|0;d=c[T+(s<<2)>>2]|0;while(1){if((d|0)>=(c[p>>2]|0))break;q=U+(d<<2)|0;k=c[q>>2]|0;e:do if((k|0)!=(s|0)){n=+Zw(g,a,s,k);m=P+(d<<3)|0;r=1.0/n;k=0;while(1){if((k|0)>=(a|0))break e;ha=+h[m>>3];ga=n-ha;ga=ga*ga*G*(+h[g+(k+x<<3)>>3]-+h[g+((O(c[q>>2]|0,a)|0)+k<<3)>>3])*r;u=J+(k<<3)|0;h[u>>3]=(n>3];k=k+1|0;}}while(0);d=d+1|0;}f:do if(!E)if(B&(c[F>>2]|0)!=0){k=0;while(1){if((k|0)==(_|0)){n=0.0;k=0;break f}g:do if((k|0)!=(s|0)){ha=+Zw(g,a,s,k);d=f+(k<<3)|0;p=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break g;u=J+(m<<3)|0;h[u>>3]=+h[d>>3]*N*(+h[g+(m+x<<3)>>3]-+h[g+(m+p<<3)>>3])*n+ +h[u>>3];m=m+1|0;}}while(0);k=k+1|0;}}else {k=0;while(1){if((k|0)==(_|0)){n=0.0;k=0;break f}h:do if((k|0)!=(s|0)){ha=+Zw(g,a,s,k);d=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break h;u=J+(m<<3)|0;h[u>>3]=(+h[g+(m+x<<3)>>3]-+h[g+(m+d<<3)>>3])*N*n+ +h[u>>3];m=m+1|0;}}while(0);k=k+1|0;}}else {bw(j,+h[H>>3],g+(x<<3)|0,s,$,aa,ba,da,ea,V,i);d=c[$>>2]|0;if(c[i>>2]|0)break b;p=c[ea>>2]|0;q=c[da>>2]|0;s=c[ba>>2]|0;k=0;while(1){if((k|0)>=(d|0)){n=0.0;k=0;break f}ha=+h[p+(k<<3)>>3];ha=ha>1.0e-15?ha:1.0e-15;t=q+(k<<3)|0;u=O(k,a)|0;n=+D(+ha,+M);n=1.0/(A?ha*ha:n);m=0;while(1){if((m|0)>=(a|0))break;ia=J+(m<<3)|0;h[ia>>3]=+h[t>>3]*N*(+h[g+(m+x<<3)>>3]-+h[s+(m+u<<3)>>3])*n+ +h[ia>>3];m=m+1|0;}k=k+1|0;}}while(0);while(1){if((k|0)>=(a|0))break;ha=+h[J+(k<<3)>>3];n=ha*ha+n;k=k+1|0;}n=+C(+n);o=n+o;i:do if(n>0.0){n=1.0/n;k=0;while(1){if((k|0)>=(a|0)){k=0;break i}ia=J+(k<<3)|0;h[ia>>3]=+h[ia>>3]*n;k=k+1|0;}}else k=0;while(0);while(1){if((k|0)>=(a|0)){s=w;continue c}ia=g+(k+x<<3)|0;h[ia>>3]=+h[ia>>3]+ +h[J+(k<<3)>>3]*v;k=k+1|0;}}if(j|0)ow(j);v=+jq(Z,v,o,z,Y);if(!((y|0)<(X|0)&v>W)){ca=70;break}else z=o;}if((ca|0)==70?c[e+112>>2]|0:0)kq(a,Q,g);U1(L);if((Q|0)!=(b|0))qw(Q);U1(J);j=c[ba>>2]|0;k=j;}else c[i>>2]=-100;if(k|0)U1(j);j=c[da>>2]|0;if(j|0)U1(j);j=c[ea>>2]|0;if(j|0)U1(j);}l=fa;return}function tq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=c[b+20>>2]|0;o=c[b+24>>2]|0;p=KK(a<<3)|0;m=c[b>>2]|0;k=0;a:while(1){if((k|0)<(m|0))b=0;else break;while(1){if((b|0)>=(a|0))break;h[p+(b<<3)>>3]=0.0;b=b+1|0;}l=k+1|0;j=c[n+(l<<2)>>2]|0;i=c[n+(k<<2)>>2]|0;b=0;while(1){if((i|0)>=(j|0))break;e=c[o+(i<<2)>>2]|0;if((e|0)!=(k|0)){g=O(e,a)|0;e=0;while(1){if((e|0)>=(a|0))break;q=p+(e<<3)|0;h[q>>3]=+h[q>>3]+ +h[d+(g+e<<3)>>3];e=e+1|0;}b=b+1|0;}i=i+1|0;}if((b|0)<=0){k=l;continue}f=.5/+(b|0);e=O(k,a)|0;b=0;while(1){if((b|0)>=(a|0)){k=l;continue a}q=d+(b+e<<3)|0;h[q>>3]=+h[p+(b<<3)>>3]*f+ +h[q>>3]*.5;b=b+1|0;}}U1(p);return}function uq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0.0;i=c[a+20>>2]|0;j=c[a+24>>2]|0;h=c[a>>2]|0;k=KK((h<<2)+4|0)|0;a=0;while(1){if((a|0)>(h|0)){d=0;e=0;break}c[k+(a<<2)>>2]=0;a=a+1|0;}while(1){if((e|0)>=(h|0))break;f=e+1|0;g=c[i+(f<<2)>>2]|0;a=0;b=c[i+(e<<2)>>2]|0;while(1){if((b|0)>=(g|0))break;a=a+((e|0)!=(c[j+(b<<2)>>2]|0)&1)|0;b=b+1|0;}g=k+(a<<2)|0;e=(c[g>>2]|0)+1|0;c[g>>2]=e;d=(d|0)>(e|0)?d:e;e=f;}l=+(c[k+4>>2]|0);if(+(d|0)*.8=(g|0)){e=0;break}h[n+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((e|0)>=(b|0)){g=0;break}h[j+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=j+(e<<3)|0;h[m>>3]=+h[m>>3]+ +h[c+(e+i<<3)>>3];e=e+1|0;}g=g+1|0;}d=1.0/+(a|0);e=0;while(1){if((e|0)>=(b|0)){g=0;break}m=j+(e<<3)|0;h[m>>3]=+h[m>>3]*d;e=e+1|0;}while(1){if((g|0)>=(a|0)){i=0;break}i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=c+(e+i<<3)|0;h[m>>3]=+h[m>>3]-+h[j+(e<<3)>>3];e=e+1|0;}g=g+1|0;}while(1){if((i|0)>=(a|0))break;j=O(i,b)|0;g=0;while(1){if((g|0)>=(b|0))break;k=c+(g+j<<3)|0;m=O(g,b)|0;e=0;while(1){if((e|0)==(b|0))break;p=n+(e+m<<3)|0;h[p>>3]=+h[p>>3]+ +h[c+(e+j<<3)>>3]*+h[k>>3];e=e+1|0;}g=g+1|0;}i=i+1|0;}d=+h[n+8>>3];if(d==0.0)d=0.0;else {q=+h[n>>3];f=+h[n+24>>3];d=-(f-q-+C(+(q*q+d*d*4.0+(q*-2.0+f)*f)))/(d*2.0);}f=+C(+(d*d+1.0));d=d/f;f=1.0/f;e=0;while(1){if((e|0)>=(a|0))break;p=O(e,b)|0;n=c+(p<<3)|0;q=+h[n>>3];p=c+(p+1<<3)|0;r=+h[p>>3];h[n>>3]=r*f+q*d;h[p>>3]=r*d-q*f;e=e+1|0;}l=o;return}function wq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;xq(a,b,c,d,e,f,g,h,i,j);return}function xq(a,b,d,e,f,g,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;M=l;l=l+192|0;I=M+176|0;H=M+168|0;K=M;W6(K|0,e|0,168)|0;c[m>>2]=0;do if(b|0?(L=c[b+4>>2]|0,!((a|0)<1|(L|0)<1)):0){if((ww(b,0)|0)!=0?(c[b+16>>2]|0)==1:0){if((c[e+136>>2]|0)==1)o=Bw(d)|0;else o=d;J=Bw(b)|0;}else t=5;do if((t|0)==5)if((c[e+136>>2]|0)==1){J=Aw(b,0)|0;o=Aw(d,0)|0;break}else {J=Qw(b)|0;o=d;break}while(0);G=e+160|0;p=c[G>>2]|0;if((p|0)==3){if((j|0)>0)t=14;}else if((j|0)>0&(p|0)==4)t=14;if((t|0)==14){d=KK(O(a<<3,c[J>>2]|0)|0)|0;L=yq(J,j,k)|0;wq(a,L,0,e,0,0,d,0,0,m);zq(a,J,j,k,i,d);lu(a,J,i,g,c[e+124>>2]|0,+h[e+144>>3],c[G>>2]|0,j,k);qw(L);U1(d);if((J|0)==(b|0))break;qw(J);break}E=fx(c[e+44>>2]|0,c[e+48>>2]|0)|0;c[E+16>>2]=c[e+40>>2];F=tx(J,o,f,E)|0;q=wx(F)|0;if(!(c[q+32>>2]|0))r=i;else r=KK(O(a<<3,c[q+4>>2]|0)|0)|0;p=uq(J)|0;if(+h[e>>3]==-1.0001234)h[e>>3]=(p|0)==0?-1.0:-1.8;v=e+136|0;w=e+24|0;x=e+16|0;y=e+104|0;z=e+96|0;A=a<<3;B=e+132|0;C=c[15712]|0;D=e+80|0;while(1){a:do switch(c[v>>2]|0){case 0:{switch(c[B>>2]|0){case 0:{nq(a,c[q+8>>2]|0,e,c[q+24>>2]|0,r,m);break a}case 2:{p=q+8|0;t=29;break}case 3:{p=q+8|0;s=c[p>>2]|0;if((c[s>>2]|0)>1e4)if(!0)t=29;else;else t=30;break}default:{s=c[q+8>>2]|0;t=30;}}if((t|0)==29){iq(a,c[p>>2]|0,e,c[q+24>>2]|0,r,m);break a}else if((t|0)==30){oq(a,s,e,c[q+24>>2]|0,r,m);break a}break}case 1:{h[z>>3]=1.0;c[y>>2]=1;u=(c[q+28>>2]|0)==0;n=u?.5:.05;c[D>>2]=u?500:100;u=(c[q+32>>2]|0)==0;p=q+8|0;s=q+12|0;t=q+24|0;pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n,m);if(u){c[x>>2]=0;h[z>>3]=.05;c[y>>2]=0;pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.5,m);pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.125,m);pq(a,c[p>>2]|0,c[s>>2]|0,e,c[t>>2]|0,r,n*.03125,m);}break}default:{}}while(0);t=c[q+32>>2]|0;if(!t){t=39;break}if(c[m>>2]|0){t=35;break}u=c[q+16>>2]|0;p=c[q+40>>2]|0;if(!(c[t+32>>2]|0))s=i;else s=KK(O(A,c[t+4>>2]|0)|0)|0;Aq(a,c[t+8>>2]|0,u,c[t+20>>2]|0,r,s,p,+h[w>>3]*.001);U1(r);c[x>>2]=0;h[w>>3]=+h[w>>3]*.75;c[y>>2]=0;h[z>>3]=((c[(c[t+28>>2]|0)+40>>2]|0)+-9|0)>>>0<2?1.0:.1;q=t;r=s;}if((t|0)==35)U1(r);else if((t|0)==39){Ux(a,J,e,f,i,m);if(0);if((a|0)==2)vq(L,2,i);n=+h[e+152>>3];if(n!=0.0)Bq(L,a,i,n);lu(a,J,i,g,c[e+124>>2]|0,+h[e+144>>3],c[G>>2]|0,j,k);}W6(e|0,K|0,168)|0;if((J|0)!=(b|0))qw(J);if(!((o|0)==0|(o|0)==(d|0)))qw(o);gx(E);hx(F);}while(0);l=M;return}function yq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;x=y;u=c[a+20>>2]|0;v=c[a+24>>2]|0;w=KK(c[a>>2]<<2)|0;e=0;while(1){if((e|0)>=(c[a>>2]|0)){e=0;break}c[w+(e<<2)>>2]=1;e=e+1|0;}while(1){if((e|0)>=(b|0)){e=0;d=0;break}c[w+(c[d+(e<<2)>>2]<<2)>>2]=-1;e=e+1|0;}while(1){m=c[a>>2]|0;if((d|0)>=(m|0)){d=0;b=0;break}b=w+(d<<2)|0;if((c[b>>2]|0)>0){c[b>>2]=e;e=e+1|0;}d=d+1|0;}a:while(1){while(1){if((b|0)>=(m|0))break a;if((c[w+(b<<2)>>2]|0)>=0)break;b=b+1|0;}j=b+1|0;k=c[u+(j<<2)>>2]|0;i=c[u+(b<<2)>>2]|0;while(1){if((i|0)>=(k|0)){b=j;continue a}f=c[v+(i<<2)>>2]|0;b:do if((c[w+(f<<2)>>2]|0)>-1)d=d+1|0;else {h=c[u+(f+1<<2)>>2]|0;g=c[u+(f<<2)>>2]|0;while(1){if((g|0)>=(h|0))break b;f=c[v+(g<<2)>>2]|0;if((f|0)!=(b|0))d=((c[w+(f<<2)>>2]|0)>>>31^1)+d|0;g=g+1|0;}}while(0);i=i+1|0;}}b=d<<2;if((d|0)>0){r=KK(b)|0;s=KK(b)|0;p=s;q=r;}else {p=0;q=0;r=0;s=0;}t=c[15712]|0;b=0;f=0;c:while(1){d=c[a>>2]|0;while(1){if((b|0)>=(d|0))break c;o=w+(b<<2)|0;if((c[o>>2]|0)>=0)break;b=b+1|0;}m=b+1|0;n=u+(m<<2)|0;k=c[u+(b<<2)>>2]|0;d=f;while(1){if((k|0)>=(c[n>>2]|0)){b=m;f=d;continue c}f=v+(k<<2)|0;g=c[f>>2]|0;d:do if((c[w+(g<<2)>>2]|0)>-1){c[q+(d<<2)>>2]=c[o>>2];c[p+(d<<2)>>2]=c[w+(c[f>>2]<<2)>>2];d=d+1|0;}else {j=u+(g+1<<2)|0;i=c[u+(g<<2)>>2]|0;while(1){if((i|0)>=(c[j>>2]|0))break d;f=v+(i<<2)|0;h=c[f>>2]|0;do if((h|0)!=(b|0)?(c[w+(h<<2)>>2]|0)>-1:0){c[q+(d<<2)>>2]=c[o>>2];h=d+1|0;c[p+(d<<2)>>2]=c[w+(c[f>>2]<<2)>>2];g=c[o>>2]|0;d=c[w+(c[f>>2]<<2)>>2]|0;if((g|0)!=68)if((d|0)==68)d=68;else {d=h;break}c[x>>2]=g;c[x+4>>2]=d;w4(t,92380,x)|0;d=h;}while(0);i=i+1|0;}}while(0);k=k+1|0;}}x=Dw(f,e,e,q,p,0,8,8)|0;U1(r);U1(s);U1(w);l=y;return x|0}function zq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0;p=KK(c[b>>2]<<2)|0;i=0;while(1){if((i|0)>=(c[b>>2]|0)){i=0;break}c[p+(i<<2)>>2]=1;i=i+1|0;}while(1){if((i|0)>=(d|0)){i=0;l=0;break}j=c[e+(i<<2)>>2]|0;if((j|0)>-1?(j|0)<(c[b>>2]|0):0)c[p+(j<<2)>>2]=-1;i=i+1|0;}while(1){n=c[b>>2]|0;if((l|0)>=(n|0)){l=0;break}j=p+(l<<2)|0;if((c[j>>2]|0)>-1){c[j>>2]=i;i=i+1|0;}l=l+1|0;}while(1){if((l|0)>=(n|0))break;i=c[p+(l<<2)>>2]|0;a:do if((i|0)>-1){m=O(l,a)|0;j=O(i,a)|0;i=0;while(1){if((i|0)>=(a|0))break a;h[f+(i+m<<3)>>3]=+h[g+(j+i<<3)>>3];i=i+1|0;}}while(0);l=l+1|0;}o=b+20|0;g=b+24|0;n=0;while(1){if((n|0)>=(d|0))break;b=c[e+(n<<2)>>2]|0;i=c[o>>2]|0;l=c[i+(b+1<<2)>>2]|0;i=c[i+(b<<2)>>2]|0;m=l-i|0;b=O(b,a)|0;j=0;while(1){if((j|0)>=(a|0))break;h[f+(j+b<<3)>>3]=0.0;j=j+1|0;}while(1){if((i|0)<(l|0))j=0;else break;while(1){if((j|0)>=(a|0))break;k=+h[f+((O(c[(c[g>>2]|0)+(i<<2)>>2]|0,a)|0)+j<<3)>>3];q=f+(j+b<<3)|0;h[q>>3]=+h[q>>3]+k;j=j+1|0;}i=i+1|0;}k=1.0/+(m|0);i=0;while(1){if((i|0)>=(a|0))break;q=f+(i+b<<3)|0;h[q>>3]=+h[q>>3]*k;i=i+1|0;}n=n+1|0;}U1(p);return}function Aq(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=+j;var k=0,m=0,n=0,o=0,p=0,q=0.0;o=l;l=l+16|0;n=o;c[n>>2]=g;Gw(d,0,f,0,n,0,a);a:do if((i+-1|0)>>>0<6){tq(a,b,c[n>>2]|0);k=c[e>>2]|0;m=c[e+20>>2]|0;g=c[e+24>>2]|0;b=0;b:while(1){if((b|0)>=(k|0))break a;i=b+1|0;e=m+(i<<2)|0;b=c[m+(b<<2)>>2]|0;c:while(1){b=b+1|0;if((b|0)>=(c[e>>2]|0)){b=i;continue b}f=g+(b<<2)|0;d=0;while(1){if((d|0)>=(a|0))continue c;q=(+Sw()+-.5)*j;p=(c[n>>2]|0)+((O(c[f>>2]|0,a)|0)+d<<3)|0;h[p>>3]=+h[p>>3]+q;d=d+1|0;}}}}while(0);l=o;return}function Bq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;k=l;l=l+16|0;j=k;e=0;while(1){if((e|0)>=(b|0)){g=0;break}h[j+(e<<3)>>3]=0.0;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=j+(e<<3)|0;h[m>>3]=+h[m>>3]+ +h[c+(e+i<<3)>>3];e=e+1|0;}g=g+1|0;}f=1.0/+(a|0);e=0;while(1){if((e|0)>=(b|0)){g=0;break}m=j+(e<<3)|0;h[m>>3]=+h[m>>3]*f;e=e+1|0;}while(1){if((g|0)>=(a|0))break;i=O(g,b)|0;e=0;while(1){if((e|0)>=(b|0))break;m=c+(e+i<<3)|0;h[m>>3]=+h[m>>3]-+h[j+(e<<3)>>3];e=e+1|0;}g=g+1|0;}d=d*-.017453277777777776;f=+E(+d);d=+F(+d);e=0;while(1){if((e|0)>=(a|0))break;m=O(e,b)|0;j=c+(m<<3)|0;n=+h[j>>3];m=c+(m+1<<3)|0;o=+h[m>>3];h[j>>3]=o*d+n*f;h[m>>3]=o*f-n*d;e=e+1|0;}l=k;return}function Cq(a,b,d,e,f,g,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;i=i|0;var j=0,k=0,l=0,m=0;m=(ww(b,0)|0)==0;j=(c[b+16>>2]|0)==1;if(m)if(j)j=Bw(vw(b,0)|0)|0;else k=5;else if(j)j=b;else k=5;if((k|0)==5)j=Qw(b)|0;m=Bw(j)|0;c[i>>2]=0;j=c[m>>2]|0;if(!d){KK(O(a<<3,j)|0)|0;ab();}l=Gx(m,a,0.0,c[d>>2]|0,(e|0)==0?0:2,1)|0;if(!l)c[i>>2]=-1;else {h[l+40>>3]=.1;c[l+24>>2]=5;+Ix(l,a,c[d>>2]|0,f,g);k=O(j,a)|0;e=l+32|0;j=0;while(1){if((j|0)>=(k|0))break;i=(c[d>>2]|0)+(j<<3)|0;h[i>>3]=+h[i>>3]/+h[e>>3];j=j+1|0;}Hx(l);}if((m|0)!=(b|0))qw(m);return}function Dq(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;h=h|0;Cq(a,c,d,e,f,g,h);return}function Eq(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=g|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0.0;v=c[b>>2]|0;w=c[b+20>>2]|0;t=c[b+24>>2]|0;u=c[b+28>>2]|0;if(!(ww(b,0)|0))qa(95795,92387,37,92404);a=KK(56)|0;k=a+20|0;c[k>>2]=0;c[a+24>>2]=2;c[a+12>>2]=0;j=KK(16)|0;c[k>>2]=j;h[j>>3]=e;h[j+8>>3]=f;c[a+16>>2]=105;h[a+40>>3]=.01;c[a+48>>2]=~~+C(+(+(c[b>>2]|0)));j=b+8|0;k=a+4|0;c[k>>2]=rw(v,v,(c[j>>2]|0)+v|0,1,1)|0;j=rw(v,v,(c[j>>2]|0)+v|0,1,1)|0;c[a+8>>2]=j;k=c[k>>2]|0;l=c[k+28>>2]|0;m=c[j+28>>2]|0;if((j|0)==0|(k|0)==0){Fx(a);a=0;}else {n=c[k+20>>2]|0;o=c[k+24>>2]|0;p=c[j+20>>2]|0;q=c[j+24>>2]|0;c[p>>2]=0;c[n>>2]=0;b=0;d=0;while(1){if((b|0)>=(v|0))break;r=b+1|0;s=w+(r<<2)|0;e=0.0;f=0.0;i=c[w+(b<<2)>>2]|0;while(1){if((i|0)>=(c[s>>2]|0))break;g=c[t+(i<<2)>>2]|0;if((g|0)!=(b|0)){x=+h[u+(i<<3)>>3];x=x>=0.0?x:-x;x=x>.01?x:.01;c[o+(d<<2)>>2]=g;c[q+(d<<2)>>2]=g;g=l+(d<<3)|0;h[g>>3]=-1.0;h[m+(d<<3)>>3]=-x;e=+h[g>>3]+e;f=f-x;d=d+1|0;}i=i+1|0;}c[o+(d<<2)>>2]=b;c[q+(d<<2)>>2]=b;h[l+(d<<3)>>3]=-e;h[m+(d<<3)>>3]=-f;d=d+1|0;c[n+(r<<2)>>2]=d;c[p+(r<<2)>>2]=d;b=r;}c[k+8>>2]=d;c[j+8>>2]=d;}return a|0}function Fq(a){a=a|0;Fx(a);return}function Gq(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +(+Jx(a,b,c,d,.001))}function Hq(a,b){a=a|0;b=+b;var d=0,e=0,f=0,g=0;if((c[a+16>>2]|0)==1)d=vw(a,0)|0;else d=Qw(a)|0;f=c[d+28>>2]|0;a:do if(b!=1.0){e=c[d+8>>2]|0;a=0;while(1){if((a|0)>=(e|0))break a;g=f+(a<<3)|0;h[g>>3]=+h[g>>3]*b;a=a+1|0;}}while(0);return d|0}function Iq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0.0;j=c[b>>2]|0;c[e>>2]=0;k=O(j,a)|0;e=0;while(1){if((e|0)>=(k|0)){e=1;f=1;break}h[d+(e<<3)>>3]=+Sw()*100.0;e=e+1|0;}while(1){if((f|0)>=(j|0))break;i=O(f,a)|0;g=0;while(1){if((g|0)>=(a|0))break;l=+h[d+(g<<3)>>3]-+h[d+(g+i<<3)>>3];if((l>=0.0?l:-l)>1.0e-16){e=0;f=j;break}else g=g+1|0;}f=f+1|0;}a:do if(e|0){w5(1);e=0;while(1){if((e|0)>=(k|0))break a;h[d+(e<<3)>>3]=+Sw()*100.0;e=e+1|0;}}while(0);e=Hq(b,1.0)|0;if(!(ww(e,0)|0))qa(92430,92387,164,92466);else {k=Eq(0,e,0,101.0e5,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,101.0e3,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,1010.0,100.0,0)|0;+Gq(k,a,d,300);Fq(k);k=Eq(0,e,0,10.1,100.0,0)|0;+Gq(k,a,d,300);Fq(k);ax(0.0,0.0,490.0,700.0,c[b>>2]|0,a,d);qw(e);return}}function Jq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,l=0,m=0;k=KK((tB(a)|0)<<4)|0;i=(e|0)!=0;j=b+8|0;g=jC(a)|0;f=0;while(1){if(!g)break;if(i)f=f+((Q2(KB(g)|0,92481,11)|0)==0&1)|0;m=c[g+16>>2]|0;l=c[m+120>>2]<<1;h[k+(l<<3)>>3]=+h[m+32>>3]*.5+ +h[b>>3];h[k+((l|1)<<3)>>3]=+h[m+40>>3]*.5+ +h[j>>3];g=kC(a,g)|0;}if(i&(f|0)!=0){b=KK(f<<2)|0;g=jC(a)|0;f=0;while(1){if(!g)break;if(!(Q2(KB(g)|0,92481,11)|0)){c[b+(f<<2)>>2]=c[(c[g+16>>2]|0)+120>>2];f=f+1|0;}g=kC(a,g)|0;}c[e>>2]=b;c[d>>2]=f;}return k|0}function Kq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;z=l;l=l+32|0;w=z+16|0;v=z+8|0;u=z;if(a){x=tB(a)|0;y=uB(a)|0;b=jC(a)|0;e=0;while(1){if(!b)break;c[(c[b+16>>2]|0)+120>>2]=e;b=kC(a,b)|0;e=e+1|0;}r=y<<2;q=KK(r)|0;r=KK(r)|0;b=y<<3;s=KK(b)|0;o=GA(a,2,101541,0)|0;t=(d|0)!=0;if(t){e=GA(a,2,92493,0)|0;p=JK(b)|0;n=p;}else {n=0;e=0;p=0;}j=(o|0)==0;k=(e|0)==0;i=jC(a)|0;b=0;while(1){if(!i)break;m=c[(c[i+16>>2]|0)+120>>2]|0;g=XA(a,i)|0;while(1){if(!g)break;c[q+(b<<2)>>2]=m;c[r+(b<<2)>>2]=c[(c[(c[((c[g>>2]&3|0)==2?g:g+-48|0)+40>>2]|0)+16>>2]|0)+120>>2];if(!j?(A=RA(g,o)|0,c[v>>2]=u,(b5(A,101209,v)|0)==1):0)f=+h[u>>3];else {h[u>>3]=1.0;f=1.0;}h[s+(b<<3)>>3]=f;if(!k){A=RA(g,e)|0;c[w>>2]=u;if((b5(A,101209,w)|0)==1)f=+h[u>>3];else {h[u>>3]=1.0;f=1.0;}h[n+(b<<3)>>3]=f;}g=ZA(a,g)|0;b=b+1|0;}i=kC(a,i)|0;}b=Dw(y,x,x,q,r,s,1,8)|0;if(t)c[d>>2]=Dw(y,x,x,q,r,p,1,8)|0;U1(q);U1(r);U1(s);if(n)U1(p);}else b=0;l=z;return b|0}function Lq(a){a=a|0;var b=0,d=0,e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,m=0,n=0,o=0.0,p=0.0;m=l;l=l+16|0;k=m;a:do if(Mq(a,k)|0){b=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;g=+h[b>>3];e=+h[b+8>>3];b=jC(a)|0;while(1){if(!b)break;f=c[(c[b+16>>2]|0)+132>>2]|0;h[f>>3]=+h[f>>3]-g;f=f+8|0;h[f>>3]=+h[f>>3]-e;b=kC(a,b)|0;}b=(g!=0.0|e!=0.0)&1;d=jC(a)|0;while(1){if(!d)break a;f=XA(a,d)|0;if(f|0)break;d=kC(a,d)|0;}n=c[f>>2]&3;d=c[(c[(c[((n|0)==2?f:f+-48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;f=c[(c[(c[((n|0)==3?f:f+48|0)+40>>2]|0)+16>>2]|0)+132>>2]|0;i=+h[f+8>>3];j=+h[f>>3];e=+K(+(+h[d+8>>3]-i),+(+h[d>>3]-j));e=+h[k>>3]-e;h[k>>3]=e;if(e!=0.0){g=+E(+e);e=+F(+e);b=jC(a)|0;while(1){if(!b){b=1;break a}k=c[(c[b+16>>2]|0)+132>>2]|0;p=+h[k>>3]-j;n=k+8|0;o=+h[n>>3]-i;h[k>>3]=p*g+j-o*e;h[n>>3]=p*e+i+o*g;b=kC(a,b)|0;}}}else b=0;while(0);l=m;return b|0}function Mq(b,d){b=b|0;d=d|0;var e=0.0,f=0,g=0;g=l;l=l+16|0;f=g;b=QA(b,92497)|0;do if((b|0)!=0?(a[b>>0]|0)!=0:0){e=+s5(b,f);if((c[f>>2]|0)==(b|0))if(!((dP(b)|0)<<24>>24)){b=0;break}else e=0.0;while(1){if(!(e>180.0))break;e=e+-360.0;}while(1){if(!(e<=-180.0))break;e=e+360.0;}h[d>>3]=e*.017453292519943295;b=1;}else b=0;while(0);l=g;return b|0}function Nq(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=QA(a,92507)|0;return Oq(a,(d|0)==0?(c|0?c:195059):d,b)|0}function Oq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0.0;n=l;l=l+32|0;m=n+16|0;j=n+8|0;i=n;if((d|0)!=0?(a[d>>0]|0)!=0:0){f=17896;while(1){g=c[f+4>>2]|0;if(!g)break;if(!(j3(d,g,c[f+8>>2]|0)|0)){k=6;break}f=f+16|0;}if((k|0)==6){if(!(c[f+12>>2]|0)){c[i>>2]=g;gA(0,92515,i)|0;f=17896;}i=c[f>>2]|0;c[e>>2]=i;c[e+4>>2]=c[f+12>>2];if((i|0)==18)Pq(b,d+(c[f+8>>2]|0)|0,e);}if(!(c[f+4>>2]|0)){f=eP(d,63)|0;if(f<<24>>24==63){c[j>>2]=d;gA(0,92557,j)|0;f=0;}else f=f&255;f=(f|0)==0;c[e>>2]=f&1;f=f?92604:135709;k=15;}}else {c[e>>2]=0;f=135709;k=15;}if((k|0)==15)c[e+4>>2]=f;if(0);l=n;return e|0}function Pq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=l;l=l+16|0;f=e;g=e+4|0;c[f>>2]=g;f=(b5(b,137395,f)|0)>0;b=c[g>>2]|0;c[d+8>>2]=f&(b|0)>-1?b:1e3;h[d+16>>3]=+_O(a,GA(a,0,92648,0)|0,-4.0,-1.0e10);l=e;return}function Qq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;h=l;l=l+16|0;g=h+8|0;f=h;do if((tB(a)|0)>=2){d=Lq(a)|0;d=(Rq(a)|0)+d|0;e=c[b>>2]|0;if(e){if(0);if(e>>>0>2){switch(e|0){case 3:{e=Sr(a,1)|0;break}case 4:{e=Sr(a,0)|0;break}case 6:case 5:{e=0;break}case 10:case 9:case 7:case 8:case 14:case 13:case 11:case 12:{Cr(a,e)|0;e=0;break}case 15:{e=Sr(a,-1)|0;break}default:{c[g>>2]=c[b+4>>2];gA(0,93e3,g)|0;e=0;}}d=e+d|0;break}if(Sq(a)|0){Tq();U1(c[46845]|0);c[46845]=0;break}Uq(a);if((c[b>>2]|0)==2)e=Vq()|0;else e=Wq()|0;if(e|0)Xq();Tq();U1(c[46845]|0);c[46845]=0;d=e+d|0;}}else d=0;while(0);l=h;return d|0}function Rq(a){a=a|0;var b=0,d=0.0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0;m=l;l=l+48|0;i=m+24|0;f=m+16|0;j=m;b=QA(a,140742)|0;a:do if(((b|0)!=0?(k=j+8|0,c[f>>2]=j,c[f+4>>2]=k,e=b5(b,105503,f)|0,(e|0)!=0):0)?(g=+h[j>>3],!(+B(+g)<1.0e-09)):0){if((e|0)!=1){d=+h[k>>3];if(+B(+d)<1.0e-09){b=0;break}}else {h[k>>3]=g;d=g;}if(!(d==1.0&g==1.0)){if(0);b=jC(a)|0;while(1){if(!b){b=1;break a}i=c[(c[b+16>>2]|0)+132>>2]|0;h[i>>3]=+h[i>>3]*+h[j>>3];i=i+8|0;h[i>>3]=+h[i>>3]*+h[k>>3];b=kC(a,b)|0;}}else b=0;}else b=0;while(0);l=m;return b|0}function Sq(b){b=b|0;var d=0,e=0,f=0,i=0.0,j=0.0,k=0,m=0,n=0,o=0;n=l;l=l+16|0;k=n;c[46854]=tB(b)|0;ts();c[46869]=KK((c[46854]|0)*96|0)|0;f=jC(b)|0;d=c[46869]|0;lr(k,b);i=+g[k>>2];j=+g[k+4>>2];k=(a[k+8>>0]|0)==0;j=k?j:j*.013888888888888888;i=k?i:i*.013888888888888888;k=k?2:1;e=0;while(1){if((e|0)>=(c[46854]|0)){d=0;break}o=c[(c[f+16>>2]|0)+132>>2]|0;h[d+8>>3]=+h[o>>3];h[d+16>>3]=+h[o+8>>3];if(mb[k&3](d+40|0,f,i,j)|0){m=4;break}c[d+24>>2]=e;c[d+28>>2]=1;c[d>>2]=f;c[d+88>>2]=0;d=d+96|0;e=e+1|0;f=kC(b,f)|0;}if((m|0)==4){U1(c[46869]|0);c[46869]=0;d=1;}l=n;return d|0}function Tq(){var a=0,b=0;a=c[46869]|0;b=0;while(1){if((b|0)>=(c[46854]|0))break;pu(a+40|0);a=a+96|0;b=b+1|0;}ou();Vs();U1(c[46869]|0);return}function Uq(b){b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0;o=l;l=l+32|0;m=o+16|0;n=o;p=c[46869]|0;i=+h[p+8>>3];k=+h[p+16>>3];f=c[46854]|0;d=p;e=1;g=+h[p+40>>3]+i;i=+h[p+56>>3]+i;j=+h[p+48>>3]+k;k=+h[p+64>>3]+k;while(1){if((e|0)>=(f|0))break;s=+h[d+104>>3];q=+h[d+112>>3];t=+h[d+136>>3]+s;r=+h[d+144>>3]+q;s=+h[d+152>>3]+s;q=+h[d+160>>3]+q;d=d+96|0;e=e+1|0;g=ti?s:i;j=rk?q:k;}d=QA(b,93100)|0;if(d|0?a[d>>0]|0:0)h[173]=+r5(d);s=+h[173];t=s*(k-j);s=s*(i-g);h[m>>3]=g-s;h[m+8>>3]=j-t;h[n>>3]=s+i;h[n+8>>3]=t+k;dr(m,n);l=o;return}function Vq(){var a=0,b=0,d=0,e=0;d=l;l=l+16|0;b=d;if(Yq(0)|0){Zq();a=0;do{kr();a=a+1|0;}while((Yq(a)|0)!=0);if(!0)a=1;}else a=0;l=d;return a|0}function Wq(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0;i=l;l=l+16|0;h=i+8|0;g=i;b=Yq(0)|0;if(!b)a=0;else {Zq();_q(0);Yu(0,1);a=0;e=0;d=0;while(1){ar();d=d+1|0;f=Yq(d)|0;if(!f)break;b=(f|0)<(b|0)?0:e+1|0;c[46846]=1;if(b){br();a=a+1|0;}_q(1);Yu(0,1);e=b;b=f;}if(0);cr();a=1;}l=i;return a|0}function Xq(){var a=0,b=0,d=0,e=0;d=c[46854]|0;a=c[46869]|0;b=0;while(1){if((b|0)>=(d|0))break;e=c[(c[(c[a>>2]|0)+16>>2]|0)+132>>2]|0;h[e>>3]=+h[a+8>>3];h[e+8>>3]=+h[a+16>>3];a=a+96|0;b=b+1|0;}return}function Yq(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+48|0;o=q+24|0;n=q+8|0;p=q;d=c[46869]|0;e=c[46854]|0;b=0;while(1){if((b|0)>=(e|0)){f=0;b=0;break}c[d+(b*96|0)+32>>2]=0;b=b+1|0;}a:while(1){if((b|0)>=(e+-1|0))break;m=d+96|0;b=b+1|0;j=d+8|0;k=d+40|0;i=d+32|0;g=m;h=b;while(1){if((h|0)>=(e|0)){d=m;continue a}e=g+8|0;c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];if(!(yu(n,k,o,g+40|0)|0))d=f;else {c[i>>2]=1;c[g+32>>2]=1;d=f+1|0;}g=g+96|0;h=h+1|0;f=d;e=c[46854]|0;}}if(0>1);l=q;return f|0}function Zq(){var a=0,b=0,d=0,e=0.0,f=0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0;ir();k=c[46848]|0;l=c[46869]|0;a=c[46845]|0;a:while(1){i=a;if(a>>>0>=k>>>0)break;b=a+4|0;if(b>>>0>=k>>>0){a=b;continue}f=c[b>>2]|0;d=c[a>>2]|0;g=+h[d>>3];if(+h[f>>3]!=g){a=b;continue}e=+h[d+8>>3];if(+h[f+8>>3]!=e){a=b;continue}j=a+8|0;f=2;while(1){if(j>>>0>=k>>>0)break;d=c[j>>2]|0;if(!(+h[d>>3]==g)){m=11;break}if(!(+h[d+8>>3]==e)){m=11;break}j=j+4|0;f=f+1|0;}if((m|0)==11){m=0;d=c[j>>2]|0;if(+h[d+8>>3]==e){e=(+h[d>>3]-g)/+(f|0);d=(((j>>>0>b>>>0?j:b)+-1+(0-i)|0)>>>2)+1|0;a=1;while(1){if((a|0)==(d|0)){a=j;continue a}i=c[b>>2]|0;h[i>>3]=+h[i>>3]+e*+(a|0);a=a+1|0;b=b+4|0;}}}while(1){if(b>>>0>=j>>>0){a=j;continue a}f=c[a>>2]|0;n=c[f+16>>2]|0;i=c[b>>2]|0;d=c[i+16>>2]|0;h[i>>3]=(+h[l+(n*96|0)+56>>3]-+h[l+(n*96|0)+40>>3]+ +h[l+(d*96|0)+56>>3]-+h[l+(d*96|0)+40>>3])*.5+ +h[f>>3];b=b+4|0;a=a+4|0;}}return}function _q(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0,g=0.0,i=0,j=0,k=0;if(a|0)ir();i=c[46845]|0;j=c[i>>2]|0;d=+h[j>>3];h[23272]=d;k=c[46854]|0;f=1;g=+h[j>>3];while(1){if((f|0)>=(k|0))break;a=c[i+(f<<2)>>2]|0;b=+h[a>>3];if(b>3];}else {e=b;b=d;}f=f+1|0;d=b;g=e>g?e:g;}e=+h[j+8>>3];h[23273]=e;h[23275]=+h[(c[i+(k+-1<<2)>>2]|0)+8>>3]-e;h[23274]=g-d;return}function $q(){var a=0;a=c[46847]|0;if(a>>>0<(c[46848]|0)>>>0){c[46847]=a+4;a=c[a>>2]|0;}else a=0;return a|0}function ar(){var a=0,b=0,d=0;a=c[46869]|0;er();d=(c[46846]|0)==0;b=0;while(1){if((b|0)>=(c[46854]|0))break;if(!(d?!(c[a+32>>2]|0):0))fr(a);a=a+96|0;b=b+1|0;}return}function br(){var a=0,b=0,c=0,d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0;a=l;l=l+32|0;c=a+16|0;b=a;j=+h[23268];i=+h[23266];g=+h[23269];e=+h[23267];d=(i-e)*.05;f=(j-g)*.05;h[b>>3]=f+j;h[b+8>>3]=i+d;h[c>>3]=g-f;h[c+8>>3]=e-d;dr(c,b);l=a;return}function cr(){Gs();Is();Ku();ms();return}function dr(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0.0;f=+h[a>>3];h[23269]=f;e=+h[b>>3];h[23268]=e;c=+h[a+8>>3];h[23267]=c;d=+h[b+8>>3];h[23266]=d;h[23258]=f;h[23260]=f;h[23262]=e;h[23264]=e;h[23265]=d;h[23261]=d;h[23263]=c;h[23259]=c;return}function er(){var a=0,b=0.0,d=0.0,e=0.0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0;m=c[46869]|0;g=m+8|0;f=+us(g,186064);e=+us(g,186080);d=+us(g,186096);a=1;b=+us(g,186112);g=m;i=m;j=m;k=m;while(1){l=m+96|0;if((a|0)>=(c[46854]|0))break;q=m+104|0;r=+us(q,186064);n=r>2]|0;o=k+8|0;b=0.0;d=0.0;e=0.0;k=c[k>>2]|0;while(1){f=c[k>>2]|0;if(!f)break;s=k+8|0;r=f+8|0;c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];q=+gr(g,i,j);c[g>>2]=c[o>>2];c[g+4>>2]=c[o+4>>2];c[g+8>>2]=c[o+8>>2];c[g+12>>2]=c[o+12>>2];c[i>>2]=c[s>>2];c[i+4>>2]=c[s+4>>2];c[i+8>>2]=c[s+8>>2];c[i+12>>2]=c[s+12>>2];c[j>>2]=c[r>>2];c[j+4>>2]=c[r+4>>2];c[j+8>>2]=c[r+8>>2];c[j+12>>2]=c[r+12>>2];hr(g,i,j,m,n);b=+h[n>>3]*q+b;d=+h[m>>3]*q+d;e=q+e;k=f;}h[a+8>>3]=d/e;h[a+16>>3]=b/e;l=p;return}function gr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;d=+h[b+8>>3];f=+h[c+8>>3];e=+h[a+8>>3];return +(+B(+((f-e)*+h[b>>3]+(d-f)*+h[a>>3]+ +h[c>>3]*(e-d)))*.5)}function hr(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;h[d>>3]=(+h[b>>3]+ +h[a>>3]+ +h[c>>3])*.3333333333333333;h[e>>3]=(+h[b+8>>3]+ +h[a+8>>3]+ +h[c+8>>3])*.3333333333333333;return}function ir(){var a=0,b=0,d=0,e=0;a=c[46845]|0;if(!a){a=KK(c[46854]<<2)|0;c[46845]=a;c[46848]=a+(c[46854]<<2);}d=c[46869]|0;Vs();e=c[46854]|0;b=0;while(1){if((b|0)>=(e|0))break;c[a>>2]=d+8;c[d+88>>2]=0;c[d+28>>2]=1;d=d+96|0;a=a+4|0;b=b+1|0;}o4(c[46845]|0,e,4,69);c[46847]=c[46845];return}function jr(a,b){a=a|0;b=b|0;var d=0.0,e=0.0;a=c[a>>2]|0;b=c[b>>2]|0;d=+h[a+8>>3];e=+h[b+8>>3];if(!(de)){e=+h[a>>3];d=+h[b>>3];if(ed&1;}else a=1;else a=-1;return a|0}function kr(){var a=0,b=0,d=0,e=0;d=c[46854]|0;a=0;b=c[46869]|0;while(1){if((a|0)>=(d|0))break;e=b+8|0;h[e>>3]=+h[e>>3]*1.05;e=b+16|0;h[e>>3]=+h[e>>3]*1.05;a=a+1|0;b=b+96|0;}return}function lr(b,e){b=b|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+48|0;k=m;j=m+24|0;f=QA(e,93112)|0;if(!((f|0)!=0?(mr(f,j,1.0,0.0)|0)!=0:0))i=3;do if((i|0)==3){e=QA(e,93116)|0;if(e|0?mr(e,j,.800000011920929,4.0)|0:0)break;g[j+4>>2]=4.0;g[j>>2]=4.0;a[j+8>>0]=1;}while(0);if(0);;c[b>>2]=c[j>>2];c[b+4>>2]=c[j+4>>2];c[b+8>>2]=c[j+8>>2];l=m;return}function mr(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0;o=l;l=l+16|0;m=o;j=o+12|0;k=o+8|0;while(1){h=a[b>>0]|0;i=b+1|0;if(!(S2(h<<24>>24)|0))break;else b=i;}p=h<<24>>24==43;h=d+8|0;a[h>>0]=p&1;c[m>>2]=j;c[m+4>>2]=k;switch(b5(p?i:b,93154,m)|0){case 0:{b=0;break}case 1:{c[k>>2]=c[j>>2];n=5;break}default:n=5;}if((n|0)==5){do if(a[h>>0]|0){if(e>1.0){q=+g[j>>2]/e;g[d>>2]=q>f?f:q;e=+g[k>>2]/e;e=e>f?f:e;break}if(e<1.0){q=+g[j>>2]/e;g[d>>2]=q>2]/e;e=e>2]=c[j>>2];e=+g[k>>2];break}}else {g[d>>2]=+g[j>>2]/e+1.0;e=+g[k>>2]/e+1.0;}while(0);g[d+4>>2]=e;b=1;}l=o;return b|0}function nr(a,b){a=a|0;b=b|0;var c=0,d=0;d=l;l=l+32|0;c=d;if((tB(a)|0)<2)a=0;else {Oq(a,b,c)|0;a=Qq(a,c)|0;}l=d;return a|0}function or(a){a=a|0;return nr(a,QA(a,92507)|0)|0}function pr(b,e){b=b|0;e=e|0;var f=0,i=0,j=0,k=0,m=0,n=0.0,o=0.0;m=l;l=l+48|0;k=m;j=m+24|0;f=QA(e,93116)|0;if(!((f|0)!=0?(mr(f,j,1.0,0.0)|0)!=0:0))i=3;do if((i|0)==3){e=QA(e,93112)|0;if(e|0?mr(e,j,1.25,3.200000047683716)|0:0)break;g[j+4>>2]=3.200000047683716;g[j>>2]=3.200000047683716;a[j+8>>0]=1;}while(0);if(0);;c[b>>2]=c[j>>2];c[b+4>>2]=c[j+4>>2];c[b+8>>2]=c[j+8>>2];l=m;return}function qr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;o=p;h=0;while(1){if((h|0)>=(d|0))break;c[e+(h<<2)>>2]=-1;h=h+1|0;}c[e+(a<<2)>>2]=0;rr(f,a);a:do if(!(c[b+8>>2]|0)){h=2147483647;b:while(1){if(!((sr(f,o)|0)<<24>>24))break a;j=c[o>>2]|0;h=c[e+(j<<2)>>2]|0;i=b+(j*20|0)|0;j=b+(j*20|0)+4|0;k=h+1|0;a=1;while(1){if((a|0)>=(c[i>>2]|0))continue b;m=c[(c[j>>2]|0)+(a<<2)>>2]|0;n=e+(m<<2)|0;if((c[n>>2]|0)<0){c[n>>2]=k;tr(f,m)|0;}a=a+1|0;}}}else {h=2147483647;c:while(1){if(!((sr(f,o)|0)<<24>>24))break a;k=c[o>>2]|0;h=c[e+(k<<2)>>2]|0;i=b+(k*20|0)|0;j=b+(k*20|0)+4|0;k=b+(k*20|0)+8|0;a=1;while(1){if((a|0)>=(c[i>>2]|0))continue c;m=c[(c[j>>2]|0)+(a<<2)>>2]|0;n=e+(m<<2)|0;if((c[n>>2]|0)<0){c[n>>2]=h+~~+g[(c[k>>2]|0)+(a<<2)>>2];tr(f,m)|0;}a=a+1|0;}}}while(0);a=h+10|0;h=0;while(1){if((h|0)>=(d|0))break;i=e+(h<<2)|0;if((c[i>>2]|0)<0)c[i>>2]=a;h=h+1|0;}l=p;return}function rr(a,b){a=a|0;b=b|0;c[c[a>>2]>>2]=b;c[a+12>>2]=0;c[a+8>>2]=1;return}function sr(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+12|0;e=c[d>>2]|0;if((e|0)<(c[a+8>>2]|0)){a=c[a>>2]|0;c[d>>2]=e+1;c[b>>2]=c[a+(e<<2)>>2];a=1;}else a=0;return a|0}function tr(a,b){a=a|0;b=b|0;var d=0,e=0;d=a+8|0;e=c[d>>2]|0;if((e|0)<(c[a+4>>2]|0)){a=c[a>>2]|0;c[d>>2]=e+1;c[a+(e<<2)>>2]=b;a=1;}else a=0;return a|0}function ur(a,b){a=a|0;b=b|0;c[a>>2]=KK(b<<2)|0;c[a+4>>2]=b;c[a+8>>2]=0;c[a+12>>2]=0;return}function vr(a){a=a|0;U1(c[a>>2]|0);return}function wr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0;if(!0)g=0;while(1){if((g|0)>=(a|0))break;i=b+(g<<2)|0;f=0;e=0.0;while(1){if((f|0)==(a|0))break;if((g|0)!=(f|0))e=+h[(c[i>>2]|0)+(f<<3)>>3]+e;f=f+1|0;}h[(c[i>>2]|0)+(g<<3)>>3]=-e;g=g+1|0;}return wt(b,d,a+-1|0)|0}function xr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0.0;j=un(b,b,0.0)|0;k=un(b,b,0.0)|0;e=jC(a)|0;while(1){if(!e)break;d=aB(a,e)|0;while(1){if(!d)break;g=c[d>>2]&3;f=(c[c[((g|0)==3?d:d+48|0)+40>>2]>>2]|0)>>>4;g=(c[c[((g|0)==2?d:d+-48|0)+40>>2]>>2]|0)>>>4;if((f|0)!=(g|0)){l=-1.0/+h[(c[d+16>>2]|0)+136>>3];h[(c[j+(g<<2)>>2]|0)+(f<<3)>>3]=l;h[(c[j+(f<<2)>>2]|0)+(g<<3)>>3]=l;}d=bB(a,d,e)|0;}e=kC(a,e)|0;}i=wr(b,j,k)|0;a:do if(i|0){f=a+16|0;e=0;while(1){if((e|0)>=(b|0))break a;g=k+(e<<2)|0;d=0;while(1){if((d|0)==(b|0))break;a=c[g>>2]|0;h[(c[(c[(c[f>>2]|0)+160>>2]|0)+(e<<2)>>2]|0)+(d<<3)>>3]=+h[(c[k+(d<<2)>>2]|0)+(d<<3)>>3]+ +h[a+(e<<3)>>3]+ +h[a+(d<<3)>>3]*-2.0;d=d+1|0;}e=e+1|0;}}while(0);vn(j);vn(k);return i|0}function yr(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;j=s;n=d<<3;o=KK(n)|0;p=KK(n)|0;q=KK(n)|0;k=KK(n)|0;m=KK(n)|0;n=KK(n)|0;Ot(d,c,n);Ht(d,n);Ht(d,b);Jt(a,d,b,k);Lt(d,n,k,o);Ot(d,o,p);i=f+-1|0;c=0;g=+Pt(d,o,o);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+Qt(d,o)>e)){c=0;break}Jt(a,d,p,q);h=+Pt(d,p,q);if(h==0.0){c=0;break}h=g/h;Nt(d,p,h,m);Mt(d,b,m,b);if((c|0)<(i|0)){Nt(d,q,h,q);Lt(d,o,q,o);h=+Pt(d,o,o);if(g==0.0){r=7;break}Nt(d,p,h/g,p);Mt(d,o,p,p);g=h;}c=c+1|0;}if((r|0)==7){gA(1,93242,j)|0;c=1;}U1(o);U1(p);U1(q);U1(k);U1(m);U1(n);l=s;return c|0}function zr(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;g=g|0;var h=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;j=s;o=d<<3;p=KK(o)|0;q=KK(o)|0;k=KK(o)|0;m=KK(o)|0;n=KK(o)|0;o=KK(o)|0;Ot(d,c,o);if(g<<24>>24){Ht(d,o);Ht(d,b);}Kt(a,d,b,m);Lt(d,o,m,p);Ot(d,p,q);g=f+-1|0;c=0;h=+Pt(d,p,p);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+Qt(d,p)>e)){c=0;break}Kt(a,d,q,k);i=+Pt(d,q,k);if(i==0.0){c=0;break}i=h/i;Nt(d,q,i,n);Mt(d,b,n,b);if((c|0)<(g|0)){Nt(d,k,i,k);Lt(d,p,k,p);i=+Pt(d,p,p);if(h==0.0){r=9;break}Nt(d,q,i/h,q);Mt(d,p,q,q);h=i;}c=c+1|0;}if((r|0)==9){gA(1,93242,j)|0;c=1;}U1(p);U1(q);U1(k);U1(m);U1(n);U1(o);l=s;return c|0}function Ar(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;var g=0.0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;j=q;k=d<<2;m=JK(k)|0;n=JK(k)|0;o=JK(k)|0;k=JK(k)|0;St(d,b);St(d,c);Tt(a,d,b,k);St(d,k);Ut(d,c,k,m);Yt(d,m,n);i=f+-1|0;c=0;g=+Zt(d,m,m);while(1){if((c|0)>=(f|0)){c=0;break}if(!(+au(d,m)>e)){c=0;break}St(d,n);St(d,b);St(d,m);Tt(a,d,n,o);St(d,o);h=+Zt(d,n,o);if(h==0.0){c=0;break}h=g/h;Wt(d,b,h,n);if((c|0)<(i|0)){Wt(d,m,-h,o);h=+Zt(d,m,m);if(g==0.0){p=7;break}Xt(d,n,h/g,n);Vt(d,m,n,n);g=h;}c=c+1|0;}if((p|0)==7){gA(1,93242,j)|0;c=1;}U1(m);U1(n);U1(o);U1(k);l=q;return c|0}function Br(a,b,d,e,f,i,j,k,m,n){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;j=j|0;k=k|0;m=m|0;n=+n;var o=0,p=0,q=0.0,r=0,s=0,t=0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0.0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0;M=l;l=l+48|0;F=M+24|0;E=M+16|0;D=M+8|0;C=M;J=M+40|0;K=M+36|0;H=M+32|0;s=j&4;c[J>>2]=0;c[K>>2]=0;a:do if(c[a+16>>2]|0){p=0;o=0;while(1){if((p|0)>=(b|0))break;t=c[a+(p*20|0)>>2]|0;u=a+(p*20|0)+16|0;r=1;while(1){if((r|0)>=(t|0))break;if(!(o<<24>>24))o=+g[(c[u>>2]|0)+(r<<2)>>2]!=0.0;else o=1;r=r+1|0;o=o&1;}p=p+1|0;}if(o<<24>>24){z=(s|0)!=0;if(z){r=e+4|0;b:do if((i|0)>2){o=i+-1|0;if((on(a,b,d,r,f,o,j,k,15)|0)<0){o=-1;break a}p=e+(o<<2)|0;o=0;while(1){if((o|0)>=(b|0))break b;h[(c[p>>2]|0)+(o<<3)>>3]=+h[(c[r>>2]|0)+(o<<3)>>3];o=o+1|0;}}while(0);y=c[e>>2]|0;w=c[r>>2]|0;if((ju(a,b,w,b)|0)==0?(ty(a,b,.01,.1,w,J,K,H)|0)==0:0){x=c[H>>2]|0;if((x|0)<1){o=on(a,b,d,e,f,i,j,k,m)|0;break}c:do if(n>0.0){s=c[J>>2]|0;t=c[K>>2]|0;u=x+-1|0;q=0.0;r=0;while(1){if((r|0)>=(x|0))break c;o=c[t+(r<<2)>>2]|0;A=n-q-+h[w+(c[s+(o<<2)>>2]<<3)>>3]+ +h[w+(c[s+(o+-1<<2)>>2]<<3)>>3];q=(A<0.0?0.0:A)+q;if((r|0)<(u|0))p=c[t+(r+1<<2)>>2]|0;else p=b;while(1){if((o|0)>=(p|0))break;I=w+(c[s+(o<<2)>>2]<<3)|0;h[I>>3]=+h[I>>3]+q;o=o+1|0;}r=r+1|0;}}while(0);if((i|0)==2?(Qu(a,b,w,y,+h[23294])|0)!=0:0){p=0;o=-1;}else L=33;}else {p=0;o=-1;}}else {hn(a,b,i,e,f)|0;if(!(ty(a,b,.01,.1,0,J,K,H)|0))L=33;else {p=0;o=-1;}}d:do if((L|0)==33){if((b|0)==1){o=0;break a}I=KK(c[H>>2]<<2)|0;if(!m){o=0;break a}if(0);switch(k|0){case 2:{if(0);o=nn(a,b)|0;L=46;break}case 1:{o=jn(a,b)|0;if(!o){gA(0,93315,C)|0;gA(3,93364,D)|0;L=47;}else G=o;break}case 3:{if(0);o=kn(a,b)|0;L=46;break}default:L=47;}if((L|0)==46)if(!o)L=47;else G=o;if((L|0)==47){if(0);G=mn(a,b)|0;}if(0);a=b+-1|0;y=(O(a,b)|0)/2|0;E=y+b|0;e:do if(!z){q=1.0;p=0;while(1){if((p|0)>=(i|0))break;r=e+(p<<2)|0;o=0;while(1){if((o|0)>=(b|0))break;A=+B(+(+h[(c[r>>2]|0)+(o<<3)>>3]));q=A>q?A:q;o=o+1|0;}p=p+1|0;}q=1.0/q;p=0;while(1){if((p|0)>=(i|0))break e;r=e+(p<<2)|0;o=0;while(1){if((o|0)>=(b|0))break;D=(c[r>>2]|0)+(o<<3)|0;h[D>>3]=+h[D>>3]*(10.0*q);o=o+1|0;}p=p+1|0;}}while(0);f:do if(n>0.0){v=+(y|0);o=0;q=0.0;s=0;g:while(1){if((s|0)>=(a|0))break;t=s+1|0;r=o;p=t;while(1){o=r+1|0;if((p|0)>=(b|0)){s=t;continue g}A=+ft(e,i,s,p);r=o;q=A/+g[G+(o<<2)>>2]+q;p=p+1|0;}}q=q/v;o=0;while(1){if((o|0)>=(E|0)){o=0;break f}D=G+(o<<2)|0;g[D>>2]=+g[D>>2]*q;o=o+1|0;}}else o=0;while(0);while(1){if((o|0)>=(i|0))break;Ht(b,c[e+(o<<2)>>2]|0);o=o+1|0;}p=c[e+4>>2]|0;q=+h[p>>3];o=0;while(1){if((o|0)>=(b|0))break;D=p+(o<<3)|0;h[D>>3]=+h[D>>3]-q;o=o+1|0;}u=i<<2;D=KK(u)|0;x=b<<2;w=O(x,i)|0;r=KK(w)|0;o=0;while(1){if((o|0)>=(i|0))break;s=r+((O(o,b)|0)<<2)|0;c[D+(o<<2)>>2]=s;t=e+(o<<2)|0;p=0;while(1){if((p|0)>=(b|0))break;g[s+(p<<2)>>2]=+h[(c[t>>2]|0)+(p<<3)>>3];p=p+1|0;}o=o+1|0;}v=+(y|0);if(0);bu(E,G);cu(E,G);C=KK(b<<3)|0;_t(b,0.0,C);o=0;r=0;while(1){if((r|0)>=(a|0)){o=b;p=0;r=0;break}s=b-r|0;q=0.0;p=1;while(1){o=o+1|0;if((p|0)>=(s|0))break;A=+g[G+(o<<2)>>2];F=C+(p+r<<3)|0;h[F>>3]=+h[F>>3]-A;q=q+A;p=p+1|0;}F=C+(r<<3)|0;h[F>>3]=+h[F>>3]-q;r=r+1|0;}while(1){if((p|0)>=(b|0))break;g[G+(r<<2)>>2]=+h[C+(p<<3)>>3];F=o+r|0;o=o+-1|0;p=p+1|0;r=F;}k=KK(u)|0;c[k>>2]=KK(w)|0;o=1;while(1){if((o|0)>=(i|0))break;c[k+(o<<2)>>2]=(c[k>>2]|0)+((O(o,b)|0)<<2);o=o+1|0;}z=KK(x)|0;f=KK(x)|0;j=KK(E<<2)|0;p=Eu(G,b)|0;d=Ju(G,b,c[J>>2]|0,c[K>>2]|0,c[H>>2]|0)|0;y=k+4|0;r=0;A=1797693134862315708145274.0e284;o=0;while(1){if(!(r<<24>>24==0&(o|0)<(m|0)))break;_t(b,0.0,C);du(E,G,j);w=0;t=0;while(1){if((w|0)>=(a|0)){r=0;s=b;t=0;break}x=b-w+-1|0;$t(b,0.0,f);r=0;while(1){if((r|0)>=(i|0))break;H=D+(r<<2)|0;$t(x,+g[(c[H>>2]|0)+(w<<2)>>2],z);Wt(x,z,-1.0,(c[H>>2]|0)+(w<<2)+4|0);bu(x,z);Vt(x,z,f,f);r=r+1|0;}eu(x,f);r=0;while(1){if((r|0)>=(x|0))break;s=f+(r<<2)|0;q=+g[s>>2];if(q>=3402823466385288598117041.0e14|q<0.0)g[s>>2]=0.0;r=r+1|0;}u=w+1|0;q=0.0;r=t;s=0;while(1){r=r+1|0;if((s|0)>=(x|0))break;H=j+(r<<2)|0;N=+g[H>>2]*+g[f+(s<<2)>>2];g[H>>2]=N;H=C+(u+s<<3)|0;h[H>>3]=+h[H>>3]-N;q=q+N;s=s+1|0;}t=C+(w<<3)|0;h[t>>3]=+h[t>>3]-q;w=u;t=r;}while(1){if((r|0)>=(b|0)){r=0;break}g[j+(t<<2)>>2]=+h[C+(r<<3)>>3];H=s+t|0;r=r+1|0;s=s+-1|0;t=H;}while(1){if((r|0)>=(i|0)){q=0.0;r=0;break}Tt(j,b,c[D+(r<<2)>>2]|0,c[k+(r<<2)>>2]|0);r=r+1|0;}while(1){if((r|0)>=(i|0))break;q=+Zt(b,c[D+(r<<2)>>2]|0,c[k+(r<<2)>>2]|0)+q;r=r+1|0;}q=q*2.0+v;r=0;while(1){if((r|0)>=(i|0))break;H=D+(r<<2)|0;Tt(G,b,c[H>>2]|0,z);q=q-+Zt(b,c[H>>2]|0,z);r=r+1|0;}N=+B(+(q-A))/+B(+(A+1.0e-10));r=((o|0)>1&q>A|N<+h[23294])&1;s=0;while(1){if((s|0)>=(i|0))break;if((s|0)!=1){if(Ar(G,c[D+(s<<2)>>2]|0,c[k+(s<<2)>>2]|0,b,.001,b)|0){o=-1;break d}}else Fu(d,c[y>>2]|0,D,i,1,15,I,n)|0;s=s+1|0;}A=q;o=o+1|0;}U1(I);Iu(d);if(D|0){r=0;while(1){if((r|0)>=(i|0))break;t=D+(r<<2)|0;u=e+(r<<2)|0;s=0;while(1){if((s|0)>=(b|0))break;h[(c[u>>2]|0)+(s<<3)>>3]=+g[(c[t>>2]|0)+(s<<2)>>2];s=s+1|0;}r=r+1|0;}U1(c[D>>2]|0);U1(D);}if(k|0){U1(c[k>>2]|0);U1(k);}U1(z);U1(f);U1(C);U1(G);U1(j);}while(0);U1(c[J>>2]|0);U1(c[K>>2]|0);if(p){U1(c[p>>2]|0);U1(p);}}else L=10;}else L=10;while(0);if((L|0)==10)o=on(a,b,d,e,f,i,j,k,m)|0;l=M;return o|0}function Cr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+48|0;f=m+24|0;g=m+12|0;d=m;i=tB(a)|0;k=KK(i*48|0)|0;lr(d,a);c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];d=jC(a)|0;e=k;while(1){if(!d)break;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];c[f+8>>2]=c[g+8>>2];Dr(d,e,f);d=kC(a,d)|0;e=e+48|0;}a:do if(!(Er(k,i)|0))d=0;else {switch(b|0){case 9:{Gr(a,k,i,70,1);Ir(a,k,i,71,1);d=0;e=k;break}case 10:{Ir(a,k,i,71,1);Gr(a,k,i,70,1);d=0;e=k;break}case 7:{Gr(a,k,i,72,1);Ir(a,k,i,71,1);j=9;break}case 8:{j=9;break}case 13:{j=10;break}case 14:{Ir(a,k,i,71,0);Gr(a,k,i,70,0);d=0;e=k;break}case 12:{Ir(a,k,i,73,0);Gr(a,k,i,70,0);d=0;e=k;break}default:{Gr(a,k,i,72,0);Ir(a,k,i,71,0);d=0;e=k;}}if((j|0)==9){Ir(a,k,i,73,1);Gr(a,k,i,70,1);j=10;}if((j|0)==10){Gr(a,k,i,70,0);Ir(a,k,i,71,0);d=0;e=k;}while(1){if((d|0)>=(i|0)){d=1;break a}g=c[e+16>>2]|0;j=c[(c[(c[e+20>>2]|0)+16>>2]|0)+132>>2]|0;h[j>>3]=+(c[e+12>>2]|0)*1.3888888888888887e-03;h[j+8>>3]=+(g|0)*1.3888888888888887e-03;d=d+1|0;e=e+48|0;}}while(0);U1(k);l=m;return d|0}function Dr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,l=0.0,m=0.0;f=c[b+16>>2]|0;k=c[f+132>>2]|0;l=+h[k>>3]*720.0;j=~~(l+(l>=0.0?.5:-.5));l=+h[k+8>>3]*720.0;k=~~(l+(l>=0.0?.5:-.5));if(!(a[e+8>>0]|0)){m=+h[f+32>>3]*72.0*(+g[e>>2]*5.0);l=+h[f+40>>3]*72.0*(+g[e+4>>2]*5.0);i=~~(m+(m>=0.0?.5:-.5));f=~~(l+(l>=0.0?.5:-.5));}else {l=+h[f+32>>3]*36.0;m=+h[f+40>>3]*36.0;i=~~((+g[e>>2]+ +(~~(l+(l>=0.0?.5:-.5))|0))*10.0);f=~~((+g[e+4>>2]+ +(~~(m+(m>=0.0?.5:-.5))|0))*10.0);}c[d+12>>2]=j;c[d+16>>2]=k;c[d+20>>2]=b;c[d+32>>2]=j-i;c[d+36>>2]=k-f;c[d+40>>2]=i+j;c[d+44>>2]=f+k;return}function Er(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=b+-1|0;d=0;a:while(1){if((d|0)>=(k|0)){a=0;break}j=a+48|0;d=d+1|0;g=a+32|0;h=a+40|0;i=a+36|0;f=a+44|0;a=j;e=d;while(1){if((e|0)>=(b|0)){a=j;continue a}if((((c[g>>2]|0)<=(c[a+40>>2]|0)?(c[a+32>>2]|0)<=(c[h>>2]|0):0)?(c[i>>2]|0)<=(c[a+44>>2]|0):0)?(c[a+36>>2]|0)<=(c[f>>2]|0):0){a=1;break a}a=a+48|0;e=e+1|0;}}return a|0}function Fr(a,b){a=a|0;b=b|0;if((c[a+36>>2]|0)>(c[b+44>>2]|0))a=0;else a=(c[b+36>>2]|0)<=(c[a+44>>2]|0)&1;return a|0}function Gr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=Vz(18168,c[4584]|0)|0;g=b;h=0;while(1){if((h|0)>=(d|0))break;c[g+8>>2]=c[g+12>>2];nb[c[i>>2]&63](i,g,1)|0;g=g+48|0;h=h+1|0;}if(!f)h=Or(a,i,e,74)|0;else h=Nr(i,e,74)|0;uL(h,2,2147483647)|0;g=0;while(1){if((g|0)>=(d|0))break;f=b+12|0;a=c[(c[(c[b+24>>2]|0)+16>>2]|0)+232>>2]|0;e=a-(c[f>>2]|0)|0;c[f>>2]=a;f=b+32|0;c[f>>2]=(c[f>>2]|0)+e;f=b+40|0;c[f>>2]=(c[f>>2]|0)+e;b=b+48|0;g=g+1|0;}Pr(h);Rz(i)|0;return}function Hr(a,b){a=a|0;b=b|0;if((c[a+32>>2]|0)>(c[b+40>>2]|0))a=0;else a=(c[b+32>>2]|0)<=(c[a+40>>2]|0)&1;return a|0}function Ir(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=Vz(18168,c[4584]|0)|0;g=b;h=0;while(1){if((h|0)>=(d|0))break;c[g+8>>2]=c[g+16>>2];nb[c[i>>2]&63](i,g,1)|0;g=g+48|0;h=h+1|0;}if(!f)h=Or(a,i,e,75)|0;else h=Nr(i,e,75)|0;uL(h,2,2147483647)|0;g=0;while(1){if((g|0)>=(d|0))break;f=b+16|0;a=c[(c[(c[b+24>>2]|0)+16>>2]|0)+232>>2]|0;e=a-(c[f>>2]|0)|0;c[f>>2]=a;f=b+36|0;c[f>>2]=(c[f>>2]|0)+e;f=b+44|0;c[f>>2]=(c[f>>2]|0)+e;b=b+48|0;g=g+1|0;}Pr(h);Rz(i)|0;return}function Jr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+32|0;e=b+32|0;if((c[a+36>>2]|0)<=(c[b+44>>2]|0)?(c[b+36>>2]|0)<=(c[a+44>>2]|0):0)if((c[a+40>>2]|0)<(c[e>>2]|0))a=1;else {g=Mr(d,e)|0;g=g-(c[b+12>>2]|0)+(c[a+12>>2]|0)|0;b=c[b+16>>2]|0;a=c[a+16>>2]|0;f=(b|0)<(a|0);e=Lr(d,e)|0;a=(g|0)<=(e-(f?a:b)+(f?b:a)|0)&1;}else a=0;return a|0}function Kr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=a+32|0;e=b+32|0;if((c[d>>2]|0)<=(c[b+40>>2]|0)?(c[e>>2]|0)<=(c[a+40>>2]|0):0)if((c[a+44>>2]|0)<(c[b+36>>2]|0))a=1;else {g=Lr(d,e)|0;g=g-(c[b+16>>2]|0)+(c[a+16>>2]|0)|0;b=c[b+12>>2]|0;a=c[a+12>>2]|0;f=(b|0)<(a|0);e=Mr(d,e)|0;a=(g|0)<=(e-(f?a:b)+(f?b:a)|0)&1;}else a=0;return a|0}function Lr(a,b){a=a|0;b=b|0;return ((c[a+12>>2]|0)-(c[a+4>>2]|0)+(c[b+12>>2]|0)-(c[b+4>>2]|0)|0)/2|0|0}function Mr(a,b){a=a|0;b=b|0;return ((c[a+8>>2]|0)-(c[a>>2]|0)+(c[b+8>>2]|0)-(c[b>>2]|0)|0)/2|0|0}function Nr(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+16|0;v=x;a[v>>0]=a[18588]|0;a[v+1>>0]=a[18589]|0;a[v+2>>0]=a[18590]|0;a[v+3>>0]=a[18591]|0;w=oB(93515,v,0)|0;TC(w,137483,280,1)|0;g=Tz(d)|0;h=-2147483647;u=0;while(1){if(!g)break;s=c[g+8>>2]|0;t=u+((h|0)!=(s|0)&1)|0;g=c[g>>2]|0;h=s;u=t;}s=w+16|0;t=(u<<3)+-4|0;n=0;j=0;g=0;h=0;m=0;r=Tz(d)|0;i=-2147483647;while(1){if(!r)break;q=c[r+8>>2]|0;if((i|0)!=(q|0)){p=tC(w,KB(c[r+20>>2]|0)|0,1)|0;TC(p,137447,304,1)|0;o=p+16|0;g=c[o>>2]|0;c[g+112>>2]=r;if(!h){c[(c[s>>2]|0)+192>>2]=p;n=p;}else {c[(c[n+16>>2]|0)+164>>2]=p;n=h;}c[g+176>>2]=0;k=j+1|0;i=JK(k<<2)|0;c[(c[o>>2]|0)+172>>2]=i;if(!m){j=k;k=p;m=p;g=p;h=n;i=q;}else {i=m+16|0;c[(c[i>>2]|0)+184>>2]=0;j=JK((m|0)==(n|0)?t:u-j<<2)|0;c[(c[i>>2]|0)+180>>2]=j;j=iB(w,m,p,0,1)|0;TC(j,137460,176,1)|0;g=c[j+16>>2]|0;b[g+170>>1]=10;c[g+156>>2]=1;g=c[i>>2]|0;h=c[g+180>>2]|0;if(!h)g=KK((c[g+184>>2]<<2)+8|0)|0;else g=MK(h,(c[g+184>>2]<<2)+8|0)|0;m=c[i>>2]|0;c[m+180>>2]=g;m=m+184|0;h=c[m>>2]|0;c[m>>2]=h+1;c[g+(h<<2)>>2]=j;g=c[i>>2]|0;c[(c[g+180>>2]|0)+(c[g+184>>2]<<2)>>2]=0;g=c[o>>2]|0;h=c[g+172>>2]|0;if(!h)g=KK((c[g+176>>2]<<2)+8|0)|0;else g=MK(h,(c[g+176>>2]<<2)+8|0)|0;h=c[o>>2]|0;c[h+172>>2]=g;h=h+176|0;m=c[h>>2]|0;c[h>>2]=m+1;c[g+(m<<2)>>2]=j;j=c[o>>2]|0;c[(c[j+172>>2]|0)+(c[j+176>>2]<<2)>>2]=0;j=k;k=p;m=p;g=p;h=n;i=q;}}else {k=g;g=n;}c[r+24>>2]=k;n=g;g=k;r=c[r>>2]|0;}m=m+16|0;c[(c[m>>2]|0)+184>>2]=0;g=JK(4)|0;c[(c[m>>2]|0)+180>>2]=g;a[v>>0]=a[18588]|0;a[v+1>>0]=a[18589]|0;a[v+2>>0]=a[18590]|0;a[v+3>>0]=a[18591]|0;m=oB(93562,v,0)|0;g=Tz(d)|0;while(1){if(!g)break;v=tC(m,KB(c[g+20>>2]|0)|0,1)|0;TC(v,137447,304,1)|0;c[g+28>>2]=v;c[(c[v+16>>2]|0)+112>>2]=g;g=c[g>>2]|0;}g=0;k=Tz(d)|0;h=-2147483647;a:while(1){if(!k)break;j=c[k+8>>2]|0;b:do if((h|0)==(j|0))j=h;else {g=k;while(1){g=c[g>>2]|0;if(!g)break a;if((c[g+8>>2]|0)!=(j|0))break b}}while(0);i=k+28|0;h=g;while(1){if(!h)break;if(lb[e&127](k,h)|0)iB(m,c[i>>2]|0,c[h+28>>2]|0,0,1)|0;h=c[h>>2]|0;}k=c[k>>2]|0;h=j;}Qr(m,w,f);sB(m)|0;l=x;return w|0}function Or(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=l;l=l+16|0;r=s;a[r>>0]=a[18588]|0;a[r+1>>0]=a[18589]|0;a[r+2>>0]=a[18590]|0;a[r+3>>0]=a[18591]|0;r=oB(93515,r,0)|0;TC(r,137483,280,1)|0;k=r+16|0;h=Tz(e)|0;i=0;while(1){if(!h)break;j=tC(r,KB(c[h+20>>2]|0)|0,1)|0;TC(j,137447,304,1)|0;p=j+16|0;n=c[p>>2]|0;c[n+112>>2]=h;c[h+24>>2]=j;c[n+176>>2]=0;n=JK(4)|0;o=c[p>>2]|0;c[o+172>>2]=n;c[o+184>>2]=0;o=JK(4)|0;c[(c[p>>2]|0)+180>>2]=o;if(!i)c[(c[k>>2]|0)+192>>2]=j;else c[(c[i+16>>2]|0)+164>>2]=j;h=c[h>>2]|0;i=j;}m=Tz(e)|0;a:while(1){if(!m)break;n=m+32|0;o=m+24|0;p=m+20|0;h=m;while(1){h=c[h>>2]|0;if(!h)break;if(lb[f&127](m,h)|0){i=lb[g&127](n,h+32|0)|0;j=iB(r,c[o>>2]|0,c[h+24>>2]|0,0,1)|0;TC(j,137460,176,1)|0;if((i|0)>=65536){q=13;break a}k=j+16|0;t=c[k>>2]|0;b[t+170>>1]=i;c[t+156>>2]=1;if(j|0?iB(d,c[p>>2]|0,c[h+20>>2]|0,0,0)|0:0)c[(c[k>>2]|0)+156>>2]=100;}}m=c[m>>2]|0;}if((q|0)==13)qa(93518,93534,254,93547);m=Tz(e)|0;while(1){if(!m)break;k=c[m+24>>2]|0;n=k+16|0;k=XA(r,k)|0;while(1){if(!k)break;h=c[n>>2]|0;i=c[h+180>>2]|0;if(!i)h=KK((c[h+184>>2]<<2)+8|0)|0;else h=MK(i,(c[h+184>>2]<<2)+8|0)|0;i=c[n>>2]|0;c[i+180>>2]=h;i=i+184|0;j=c[i>>2]|0;c[i>>2]=j+1;c[h+(j<<2)>>2]=k;j=c[n>>2]|0;c[(c[j+180>>2]|0)+(c[j+184>>2]<<2)>>2]=0;j=k+-48|0;h=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;i=c[h+172>>2]|0;if(!i)h=KK((c[h+176>>2]<<2)+8|0)|0;else h=MK(i,(c[h+176>>2]<<2)+8|0)|0;c[(c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0)+172>>2]=h;g=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;q=c[g+172>>2]|0;g=g+176|0;t=c[g>>2]|0;c[g>>2]=t+1;c[q+(t<<2)>>2]=k;t=c[(c[((c[k>>2]&3|0)==2?k:j)+40>>2]|0)+16>>2]|0;c[(c[t+172>>2]|0)+(c[t+176>>2]<<2)>>2]=0;k=ZA(r,k)|0;}m=c[m>>2]|0;}l=s;return r|0}function Pr(a){a=a|0;var b=0,d=0,e=0,f=0;f=jC(a)|0;while(1){if(!f)break;d=f+16|0;b=c[d>>2]|0;e=c[b+172>>2]|0;if(e){U1(e);b=c[d>>2]|0;}b=c[b+180>>2]|0;if(b|0)U1(b);f=kC(a,f)|0;}sB(a)|0;return}function Qr(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=jC(a)|0;while(1){if(!k)break;n=c[(c[k+16>>2]|0)+112>>2]|0;m=c[n+24>>2]|0;n=n+32|0;o=m+16|0;l=XA(a,k)|0;while(1){if(!l)break;h=c[(c[(c[((c[l>>2]&3|0)==2?l:l+-48|0)+40>>2]|0)+16>>2]|0)+112>>2]|0;p=lb[e&127](n,h+32|0)|0;h=c[h+24>>2]|0;i=iB(d,m,h,0,1)|0;TC(i,137460,176,1)|0;j=i+16|0;f=c[j>>2]|0;c[f+156>>2]=1;g=b[f+170>>1]|0;if((p|0)>(g&65535|0)){if(!(g<<16>>16)){f=c[o>>2]|0;g=c[f+180>>2]|0;if(!g)f=KK((c[f+184>>2]<<2)+8|0)|0;else f=MK(g,(c[f+184>>2]<<2)+8|0)|0;q=c[o>>2]|0;c[q+180>>2]=f;q=q+184|0;g=c[q>>2]|0;c[q>>2]=g+1;c[f+(g<<2)>>2]=i;f=c[o>>2]|0;c[(c[f+180>>2]|0)+(c[f+184>>2]<<2)>>2]=0;h=h+16|0;f=c[h>>2]|0;g=c[f+172>>2]|0;if(!g)f=KK((c[f+176>>2]<<2)+8|0)|0;else f=MK(g,(c[f+176>>2]<<2)+8|0)|0;g=c[h>>2]|0;c[g+172>>2]=f;g=g+176|0;q=c[g>>2]|0;c[g>>2]=q+1;c[f+(q<<2)>>2]=i;f=c[h>>2]|0;c[(c[f+172>>2]|0)+(c[f+176>>2]<<2)>>2]=0;f=c[j>>2]|0;}b[f+170>>1]=p;}l=ZA(a,l)|0;}k=kC(a,k)|0;}return}function Rr(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;return (c[b>>2]|0)-(c[d>>2]|0)|0}function Sr(b,d){b=b|0;d=d|0;var e=0,f=0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0;y=l;l=l+64|0;u=y+24|0;s=y+16|0;r=y+52|0;q=y+40|0;t=y;w=tB(b)|0;x=KK(w*72|0)|0;lr(q,b);k=+g[q>>2];m=+g[q+4>>2];q=(a[q+8>>0]|0)!=0;k=q?k*.013888888888888888:k;m=q?m*.013888888888888888:m;n=k*.5;o=m*.5;e=x;f=jC(b)|0;while(1){if(!f)break;p=c[f+16>>2]|0;i=+h[p+32>>3];if(q){j=+h[p+40>>3]*.5+m;i=i*.5+k;}else {j=o*+h[p+40>>3];i=n*i;}p=c[p+132>>2]|0;A=+h[p>>3];h[e>>3]=A;z=+h[p+8>>3];h[e+8>>3]=z;h[e+16>>3]=A-i;h[e+24>>3]=z-j;h[e+32>>3]=A+i;h[e+40>>3]=z+j;h[e+48>>3]=i;h[e+56>>3]=j;c[e+64>>2]=f;e=e+72|0;f=kC(b,f)|0;}do if((d|0)<0){i=+Tr(x,w);if(i==0.0){U1(x);e=0;break}if(!0){k=i;j=i;v=19;}}else {f=Ur(x,w,r)|0;e=c[r>>2]|0;if(!e){U1(f);U1(x);e=0;break}if(!d){Wr(t,f,e);i=+h[t>>3];j=+h[t+8>>3];}else {j=+Vr(f,e);i=j;}U1(f);if(!0){k=i;v=19;}}while(0);if((v|0)==19){e=0;f=x;while(1){if((e|0)>=(w|0))break;v=c[(c[(c[f+64>>2]|0)+16>>2]|0)+132>>2]|0;h[v>>3]=+h[f>>3]*k;h[v+8>>3]=+h[f+8>>3]*j;e=e+1|0;f=f+72|0;}U1(x);e=1;}l=y;return e|0}function Tr(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;c=0.0;d=0;a:while(1){if((d|0)>=(b|0))break;r=a+72|0;d=d+1|0;m=a+16|0;n=a+8|0;o=a+56|0;p=a+48|0;q=a+32|0;k=a+24|0;l=a+40|0;i=d;j=r;while(1){if((i|0)>=(b|0)){a=r;continue a}if(((+h[m>>3]<=+h[j+32>>3]?+h[j+16>>3]<=+h[q>>3]:0)?+h[k>>3]<=+h[j+40>>3]:0)?+h[j+24>>3]<=+h[l>>3]:0){c=0.0;break a}e=+h[a>>3];f=+h[j>>3];if(e==f)g=t;else {g=+B(+(e-f));g=(+h[j+48>>3]+ +h[p>>3])/g;}e=+h[n>>3];f=+h[j+8>>3];if(e==f)e=t;else {e=+B(+(e-f));e=(+h[j+56>>3]+ +h[o>>3])/e;}g=ec?g:c;}}return +c}function Ur(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;k=KK((b<<4)+16|0)|0;m=0;e=0;n=k;o=b;i=k;a:while(1){if((e|0)>=(b|0))break;z=a+72|0;e=e+1|0;y=a+16|0;r=a+32|0;s=a+24|0;u=a+40|0;v=a+8|0;w=a+56|0;x=a+48|0;p=e;q=z;l=i;while(1){if((p|0)==(b|0)){a=z;i=l;continue a}if(((+h[y>>3]<=+h[q+32>>3]?+h[q+16>>3]<=+h[r>>3]:0)?+h[s>>3]<=+h[q+40>>3]:0)?+h[q+24>>3]<=+h[u>>3]:0){i=o+b|0;if((m|0)==(o|0)){k=MK(k,(i<<4)+16|0)|0;n=k;l=k;}else i=o;f=+h[a>>3];g=+h[q>>3];if(!(f==g)){f=(+h[q+48>>3]+ +h[x>>3])/+B(+(f-g));if(f<1.0){f=1.0;A=13;}}else {f=t;A=13;}if((A|0)==13)A=0;g=+h[v>>3];j=+h[q+8>>3];if(!(g==j)){g=(+h[q+56>>3]+ +h[w>>3])/+B(+(g-j));if(g<1.0){g=1.0;A=16;}}else {g=t;A=16;}if((A|0)==16)A=0;m=m+1|0;h[n+(m<<4)>>3]=f;h[n+(m<<4)+8>>3]=g;}else i=o;p=p+1|0;q=q+72|0;o=i;}}A=MK(i,(m<<4)+16|0)|0;c[d>>2]=m;return A|0}function Vr(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0,f=0.0,g=0.0;d=1;e=0.0;while(1){c=a+16|0;if((d|0)>(b|0))break;g=+h[c>>3];f=+h[a+24>>3];f=ge?f:e;a=c;}return +e}function Wr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0,f=0,g=0,i=0.0;h[b>>3]=1.0;h[b+8>>3]=t;o4(b+16|0,c,16,76);g=KK((c<<4)+16|0)|0;h[g+(c<<4)>>3]=+h[b+(c<<4)>>3];f=c;d=1.0;while(1){h[g+(f<<4)+8>>3]=d;e=f+-1|0;if((f|0)<=0){d=t;e=0;f=0;break}h[g+(e<<4)>>3]=+h[b+(e<<4)>>3];i=+h[(+h[b+(f<<4)+8>>3]>d?b:g)+(f<<4)+8>>3];f=e;d=i;}while(1){if((f|0)>(c|0))break;i=+h[g+(f<<4)+8>>3]*+h[g+(f<<4)>>3];b=i>3];h[a>>3]=+h[g+(e<<4)>>3];h[a+8>>3]=i;return}else qa(93596,93534,832,93616);}function Xr(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3];d=+h[b>>3];if(!(cd)){d=+h[a+8>>3];c=+h[b+8>>3];if(dc&1;}else a=1;else a=-1;return a|0}function Yr(a,b,d){a=a|0;b=b|0;d=d|0;d=l;l=l+16|0;b=d;c[b>>2]=93631;gA(1,93681,b)|0;l=d;return 0}function Zr(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=l;l=l+16|0;d=e;c[d>>2]=93631;gA(1,93709,d)|0;l=e;return 0}function _r(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;a:do switch(d|0){case 2:{e=KK(16)|0;f=KK(24)|0;c[f+8>>2]=0;c[f+4>>2]=e;c[f>>2]=2;c[e>>2]=0;c[e+4>>2]=1;d=e+8|0;c[f+16>>2]=d;c[f+20>>2]=0;c[f+12>>2]=2;c[d>>2]=1;c[e+12>>2]=0;break}case 1:{e=KK(4)|0;f=KK(12)|0;c[f+8>>2]=0;c[f+4>>2]=e;c[f>>2]=1;c[e>>2]=0;break}default:{Yr(0,0,0)|0;a=(d|0)>0;if(!e){if(!a){f=0;break a}ab();}else {if(!a){f=0;break a}ab();}}}while(0);return f|0}function $r(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)U1(b);b=c[a+8>>2]|0;if(b|0)U1(b);U1(a);}return}function as(a){a=a|0;var b=0;if(a|0){b=c[a+4>>2]|0;if(b|0)U1(b);b=c[a+8>>2]|0;if(b|0)U1(b);b=c[a+16>>2]|0;if(b|0)U1(b);U1(a);}return}function bs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;n=o+8|0;m=o;k=W1(c[46849]|0,d<<2)|0;c[46849]=k;f=0;while(1){if((f|0)>=(d|0))break;c[e+(f<<2)>>2]=2147483647;f=f+1|0;}c[e+(a<<2)>>2]=0;h=b+(a*20|0)|0;i=b+(a*20|0)+8|0;j=b+(a*20|0)+4|0;f=1;while(1){if((f|0)>=(c[h>>2]|0))break;c[e+(c[(c[j>>2]|0)+(f<<2)>>2]<<2)>>2]=~~+g[(c[i>>2]|0)+(f<<2)>>2];f=f+1|0;}cs(n,a,k,e,d);i=-2147483639;while(1){if(!((ds(n,m,c[46849]|0,e)|0)<<24>>24)){f=0;break}f=c[m>>2]|0;a=c[e+(f<<2)>>2]|0;if((a|0)==2147483647){f=0;break}i=b+(f*20|0)|0;j=b+(f*20|0)+4|0;h=b+(f*20|0)+8|0;f=1;while(1){if((f|0)>=(c[i>>2]|0))break;es(n,c[(c[j>>2]|0)+(f<<2)>>2]|0,a+~~+g[(c[h>>2]|0)+(f<<2)>>2]|0,c[46849]|0,e);f=f+1|0;}i=a+10|0;}while(1){if((f|0)>=(d|0))break;h=e+(f<<2)|0;if((c[h>>2]|0)==2147483647)c[h>>2]=i;f=f+1|0;}fs(n);l=o;return}function cs(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;if((f|0)==1)i=0;else i=KK((f<<2)+-4|0)|0;c[a>>2]=i;j=f+-1|0;c[a+4>>2]=j;g=0;h=0;while(1){if((h|0)>=(f|0))break;if((h|0)!=(b|0)){c[i+(g<<2)>>2]=h;c[d+(h<<2)>>2]=g;g=g+1|0;}h=h+1|0;}g=(j|0)/2|0;while(1){if((g|0)<=-1)break;gs(a,g,d,e);g=g+-1|0;}return}function ds(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=a+4|0;if(!(c[f>>2]|0))a=0;else {g=c[a>>2]|0;c[b>>2]=c[g>>2];b=c[g+((c[f>>2]|0)+-1<<2)>>2]|0;c[g>>2]=b;c[d+(b<<2)>>2]=0;c[f>>2]=(c[f>>2]|0)+-1;gs(a,0,d,e);a=1;}return a|0}function es(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=f+(b<<2)|0;if((c[g>>2]|0)>(d|0)){j=e+(b<<2)|0;i=c[j>>2]|0;c[g>>2]=d;g=c[a>>2]|0;a=i;while(1){if((a|0)<=0)break;h=a>>>1;i=c[g+(h<<2)>>2]|0;if((c[f+(i<<2)>>2]|0)<=(d|0))break;c[g+(a<<2)>>2]=i;c[e+(i<<2)>>2]=a;a=h;}c[g+(a<<2)>>2]=b;c[j>>2]=a;}return}function fs(a){a=a|0;a=c[a>>2]|0;if(a|0)U1(a);return}function gs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;i=a+4|0;while(1){f=b<<1;g=f|1;h=c[i>>2]|0;if(!((f|0)<(h|0)?(j=c[a>>2]|0,(c[e+(c[j+(f<<2)>>2]<<2)>>2]|0)<(c[e+(c[j+(b<<2)>>2]<<2)>>2]|0)):0))f=b;if((g|0)<(h|0)){j=c[a>>2]|0;f=(c[e+(c[j+(g<<2)>>2]<<2)>>2]|0)<(c[e+(c[j+(f<<2)>>2]<<2)>>2]|0)?g:f;}if((f|0)==(b|0))break;j=c[a>>2]|0;h=j+(f<<2)|0;g=c[h>>2]|0;j=j+(b<<2)|0;c[h>>2]=c[j>>2];c[j>>2]=g;c[d+(c[h>>2]<<2)>>2]=f;c[d+(c[j>>2]<<2)>>2]=b;b=f;}return}function hs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0.0,m=0,n=0,o=0,p=0;p=l;l=l+16|0;m=p+8|0;n=p;c[n>>2]=0;o=KK(d<<2)|0;f=0;while(1){if((f|0)>=(d|0))break;g[e+(f<<2)>>2]=3402823466385288598117041.0e14;f=f+1|0;}g[e+(a<<2)>>2]=0.0;h=c[b+(a*20|0)>>2]|0;i=b+(a*20|0)+8|0;j=b+(a*20|0)+4|0;f=1;while(1){if((f|0)>=(h|0))break;c[e+(c[(c[j>>2]|0)+(f<<2)>>2]<<2)>>2]=c[(c[i>>2]|0)+(f<<2)>>2];f=f+1|0;}is(m,a,o,e,d);a:while(1){if(!((js(m,n,o,e)|0)<<24>>24))break;f=c[n>>2]|0;k=+g[e+(f<<2)>>2];if(k==3402823466385288598117041.0e14)break;i=b+(f*20|0)|0;j=b+(f*20|0)+4|0;h=b+(f*20|0)+8|0;f=1;while(1){if((f|0)>=(c[i>>2]|0))continue a;ks(m,c[(c[j>>2]|0)+(f<<2)>>2]|0,+g[(c[h>>2]|0)+(f<<2)>>2]+k,o,e);f=f+1|0;}}fs(m);U1(o);l=p;return}function is(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=f+-1|0;j=KK(i<<2)|0;c[a>>2]=j;c[a+4>>2]=i;g=0;h=0;while(1){if((h|0)>=(f|0))break;if((h|0)!=(b|0)){c[j+(g<<2)>>2]=h;c[d+(h<<2)>>2]=g;g=g+1|0;}h=h+1|0;}g=(i|0)/2|0;while(1){if((g|0)<=-1)break;ls(a,g,d,e);g=g+-1|0;}return}function js(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=a+4|0;if(!(c[f>>2]|0))a=0;else {g=c[a>>2]|0;c[b>>2]=c[g>>2];b=c[g+((c[f>>2]|0)+-1<<2)>>2]|0;c[g>>2]=b;c[d+(b<<2)>>2]=0;c[f>>2]=(c[f>>2]|0)+-1;ls(a,0,d,e);a=1;}return a|0}function ks(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var h=0,i=0,j=0,k=0;h=f+(b<<2)|0;if(!(+g[h>>2]<=d)){k=e+(b<<2)|0;j=c[k>>2]|0;g[h>>2]=d;h=c[a>>2]|0;a=j;while(1){if((a|0)<=0)break;i=a>>>1;j=c[h+(i<<2)>>2]|0;if(!(+g[f+(j<<2)>>2]>d))break;c[h+(a<<2)>>2]=j;c[e+(j<<2)>>2]=a;a=i;}c[h+(a<<2)>>2]=b;c[k>>2]=a;}return}function ls(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0;j=a+4|0;while(1){f=b<<1;h=f|1;i=c[j>>2]|0;if(!((f|0)<(i|0)?(k=c[a>>2]|0,+g[e+(c[k+(f<<2)>>2]<<2)>>2]<+g[e+(c[k+(b<<2)>>2]<<2)>>2]):0))f=b;if((h|0)<(i|0)?(k=c[a>>2]|0,+g[e+(c[k+(h<<2)>>2]<<2)>>2]<+g[e+(c[k+(f<<2)>>2]<<2)>>2]):0)f=h;if((f|0)==(b|0))break;k=c[a>>2]|0;i=k+(f<<2)|0;h=c[i>>2]|0;k=k+(b<<2)|0;c[i>>2]=c[k>>2];c[k>>2]=h;c[d+(c[i>>2]<<2)>>2]=f;c[d+(c[k>>2]<<2)>>2]=b;b=f;}return}function ms(){fu(187400,48);c[46853]=0;return}function ns(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0;i=hu(187400)|0;c[i+32>>2]=a;c[i+36>>2]=b;Pu(a);Pu(b);c[i+24>>2]=0;c[i+28>>2]=0;f=+h[a>>3];g=+h[b>>3]-f;e=+h[a+8>>3];d=+h[b+8>>3]-e;f=d*e+g*f+(d*d+g*g)*.5;b=i+16|0;h[b>>3]=f;if((g>0.0?g:-g)>(d>0.0?d:-d)){h[i>>3]=1.0;e=d/g;d=g;a=i+8|0;}else {h[i+8>>3]=1.0;e=g/d;a=i;}h[a>>3]=e;h[b>>3]=f/d;b=c[46853]|0;c[i+40>>2]=b;c[46853]=b+1;return i|0}function os(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0;l=+h[a>>3];a:do if(l==1.0){if(!(+h[a+8>>3]>=0.0)){b=c[a+28>>2]|0;d=c[a+24>>2]|0;if(!d)m=9;else m=5;}else {b=c[a+24>>2]|0;d=c[a+28>>2]|0;if(!d)m=9;else m=5;}do if((m|0)==5){e=+h[d+8>>3];if(e>+h[23266])break a;f=+h[23267];if(!(e>=f)){i=f;e=+h[a+16>>3]-+h[a+8>>3]*f;break}else {i=e;e=+h[d>>3];break}}else if((m|0)==9){f=+h[23267];i=f;e=+h[a+16>>3]-+h[a+8>>3]*f;}while(0);do if(b){g=+h[b+8>>3];if(g>3]-+h[a+8>>3]*f;break}else {f=+h[b>>3];break}}else {f=+h[23266];g=f;f=+h[a+16>>3]-+h[a+8>>3]*f;}while(0);j=+h[23268];b=e>j;d=f>j;k=+h[23269];if(!(b&d|e>3]-j)/+h[a+8>>3];e=j;}if(e>3]-k)/+h[a+8>>3];e=k;}if(d){g=(+h[a+16>>3]-j)/+h[a+8>>3];f=j;}if(f>3]-k)/+h[a+8>>3];f=k;m=46;}else m=46;}}else {d=c[a+28>>2]|0;b=c[a+24>>2]|0;do if(b){e=+h[b>>3];if(e>+h[23268])break a;g=+h[23269];if(!(e>=g)){i=+h[a+16>>3]-g*l;e=g;break}else {i=+h[b+8>>3];break}}else {g=+h[23269];i=+h[a+16>>3]-g*l;e=g;}while(0);do if(d){f=+h[d>>3];if(f>3]-l*j;f=j;break}else {g=+h[d+8>>3];break}}else {f=+h[23268];g=+h[a+16>>3]-l*f;}while(0);j=+h[23266];b=i>j;d=g>j;k=+h[23267];if(!(b&d|i>3]-j)/l;}if(i>3]-k)/l;}if(d){g=j;f=(+h[a+16>>3]-j)/l;}if(g>3]-k)/l;m=46;}else m=46;}}while(0);if((m|0)==46)ps(a,e,i,f,g);return}function ps(a,b,d,e,f){a=a|0;b=+b;d=+d;e=+e;f=+f;var g=0;g=a+32|0;Ws(c[g>>2]|0,b,d);Ws(c[g>>2]|0,e,f);a=a+36|0;Ws(c[a>>2]|0,b,d);Ws(c[a>>2]|0,e,f);return}function qs(a,b,d){a=a|0;b=b|0;d=d|0;c[a+24+(b<<2)>>2]=d;Pu(d);if(c[a+24+(1-b<<2)>>2]|0){os(a);Ou(c[a+32>>2]|0);Ou(c[a+36>>2]|0);iu(a,187400);}return}function rs(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;p=l;l=l+16|0;o=p;m=b<<2;h=KK(O(m,d)|0)|0;g=c[e>>2]|0;m=KK(m)|0;n=c[a+8>>2]|0;if(g|0){U1(c[g>>2]|0);U1(g);}k=KK(d<<2)|0;c[e>>2]=k;g=0;while(1){if((g|0)>=(d|0))break;c[k+(g<<2)>>2]=h+((O(g,b)|0)<<2);g=g+1|0;}j=(f|0)!=0;if(j)dt(a,b);e=(x5()|0)%(b|0)|0;ur(o,b);g=c[k>>2]|0;if(j){bs(e,a,b,g);f=0;g=0;}else {qr(e,a,b,g,o);f=0;g=0;}while(1){if((g|0)>=(b|0)){i=1;break}h=c[(c[k>>2]|0)+(g<<2)>>2]|0;c[m+(g<<2)>>2]=h;i=(h|0)>(f|0);f=i?h:f;e=i?g:e;g=g+1|0;}while(1){if((i|0)>=(d|0))break;h=k+(i<<2)|0;g=c[h>>2]|0;if(j){bs(e,a,b,g);g=0;f=0;}else {qr(e,a,b,g,o);g=0;f=0;}while(1){if((g|0)>=(b|0))break;s=m+(g<<2)|0;q=c[s>>2]|0;r=c[(c[h>>2]|0)+(g<<2)>>2]|0;r=(q|0)<(r|0)?q:r;c[s>>2]=r;s=(r|0)>(f|0);q=s?g:e;g=g+1|0;f=s?r:f;e=q;}i=i+1|0;}U1(m);if(j)et(a,b,n);l=p;return}function ss(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0.0,j=0,k=0;i=1.0/+(b|0);h=0;while(1){if((h|0)>=(d|0))break;j=a+(h<<2)|0;e=0.0;f=0;while(1){if((f|0)>=(b|0))break;e=e+ +(c[(c[j>>2]|0)+(f<<2)>>2]|0);f=f+1|0;}g=~~(e*i);f=0;while(1){if((f|0)>=(b|0))break;k=(c[j>>2]|0)+(f<<2)|0;c[k>>2]=(c[k>>2]|0)-g;f=f+1|0;}h=h+1|0;}return}function ts(){c[46855]=~~+C(+(+((c[46854]|0)+4|0)));return}function us(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(d*d+c*c)}function vs(a,b,c){a=a|0;b=b|0;c=c|0;h[a>>3]=+h[b>>3]-+h[c>>3];h[a+8>>3]=+h[b+8>>3]-+h[c+8>>3];return}function ws(a,b,c){a=a|0;b=b|0;c=c|0;h[a>>3]=+h[c>>3]+ +h[b>>3];h[a+8>>3]=+h[c+8>>3]+ +h[b+8>>3];return}function xs(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;d=+h[b+8>>3];e=+h[b>>3];return +((+h[c>>3]-e)*(+h[a+8>>3]-d)-(+h[a>>3]-e)*(+h[c+8>>3]-d))}function ys(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=l;l=l+48|0;f=e+32|0;g=e+16|0;h=e;c[h>>2]=c[a>>2];c[h+4>>2]=c[a+4>>2];c[h+8>>2]=c[a+8>>2];c[h+12>>2]=c[a+12>>2];c[g>>2]=c[b>>2];c[g+4>>2]=c[b+4>>2];c[g+8>>2]=c[b+8>>2];c[g+12>>2]=c[b+12>>2];c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];d=+xs(h,g,f)>0.0&1;l=e;return d|0}function zs(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;o=+h[a>>3];p=+h[d+8>>3];q=+h[c+8>>3];m=(p-q)*o;n=+h[b>>3];l=+h[d>>3];k=+h[b+8>>3];i=+h[a+8>>3];j=k-i;f=+h[c>>3];g=m+n*(q-p)+j*l+f*(i-k);if(g==0.0)d=0;else {p=(f*(i-p)+m+(q-i)*l)/g;q=-(f*j+((q-k)*o+(i-q)*n))/g;h[e>>3]=p*(n-o)+o;h[e+8>>3]=j*p+i;d=q<=1.0&(q>=0.0&(p>=0.0&p<=1.0))&1;}return d|0}function As(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0.0,i=0;c[a+20>>2]=b;Pu(b);i=a+24|0;h[i>>3]=+h[b+8>>3]+d;e=c[46856]|0;e=e+((Bs(a)|0)*40|0)|0;while(1){f=e+32|0;e=c[f>>2]|0;if(!e)break;d=+h[i>>3];g=+h[e+24>>3];if(d>g)continue;if(!(d==g))break;if(!(+h[b>>3]>+h[c[e+20>>2]>>3]))break}c[a+32>>2]=e;c[f>>2]=a;c[46857]=(c[46857]|0)+1;return}function Bs(a){a=a|0;var b=0.0,d=0,e=0.0;d=c[46858]|0;e=+(d|0);b=(+h[a+24>>3]-+h[23273])/+h[23275]*e;do if(!(b<0.0))if(!(b>=e)){a=~~b;break}else {a=d+-1|0;break}else a=0;while(0);if((a|0)<(c[46859]|0))c[46859]=a;return a|0}function Cs(a){a=a|0;var b=0,d=0,e=0;d=a+20|0;if(c[d>>2]|0){b=c[46856]|0;b=b+((Bs(a)|0)*40|0)|0;do{e=b+32|0;b=c[e>>2]|0;}while((b|0)!=(a|0));c[e>>2]=c[a+32>>2];c[46857]=(c[46857]|0)+-1;Ou(c[d>>2]|0);c[d>>2]=0;}return}function Ds(){return (c[46857]|0)==0|0}function Es(a){a=a|0;var b=0,d=0,e=0,f=0.0;b=c[46856]|0;d=c[46859]|0;while(1){e=c[b+(d*40|0)+32>>2]|0;if(e|0)break;e=d+1|0;c[46859]=e;d=e;}f=+h[e+24>>3];h[a>>3]=+h[c[e+20>>2]>>3];h[a+8>>3]=f;return}function Fs(){var a=0,b=0;b=(c[46856]|0)+((c[46859]|0)*40|0)+32|0;a=c[b>>2]|0;c[b>>2]=c[a+32>>2];c[46857]=(c[46857]|0)+-1;return a|0}function Gs(){U1(c[46856]|0);c[46856]=0;return}function Hs(){var a=0,b=0,d=0;c[46857]=0;c[46859]=0;a=c[46855]|0;b=a<<2;c[46858]=b;d=c[46856]|0;if(!d){d=KK(a*160|0)|0;c[46856]=d;b=c[46858]|0;}a=0;while(1){if((a|0)>=(b|0))break;c[d+(a*40|0)+32>>2]=0;a=a+1|0;}return}function Is(){fu(187448,40);U1(c[46865]|0);c[46865]=0;return}function Js(){var a=0,b=0,d=0;fu(187448,40);a=c[46855]|0;b=a<<1;c[46866]=b;d=c[46865]|0;if(!d){d=KK(a<<3)|0;c[46865]=d;b=c[46866]|0;}a=0;while(1){if((a|0)>=(b|0))break;c[d+(a<<2)>>2]=0;a=a+1|0;}c[46860]=Ks(0,0)|0;c[46861]=Ks(0,0)|0;c[c[46860]>>2]=0;d=c[46861]|0;b=c[46860]|0;c[b+4>>2]=d;c[d>>2]=b;c[(c[46861]|0)+4>>2]=0;d=c[46865]|0;c[d>>2]=c[46860];c[d+((c[46866]|0)+-1<<2)>>2]=c[46861];return}function Ks(b,d){b=b|0;d=d|0;var e=0;e=hu(187448)|0;c[e+8>>2]=b;a[e+16>>0]=d;c[e+32>>2]=0;c[e+20>>2]=0;c[e+12>>2]=0;return e|0}function Ls(b,d){b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0;i=c[b+8>>2]|0;k=c[d+8>>2]|0;do if((!((i|0)==0|(k|0)==0)?(o=c[i+36>>2]|0,e=c[k+36>>2]|0,(o|0)!=(e|0)):0)?(j=+h[i>>3],f=+h[k+8>>3],g=+h[i+8>>3],l=+h[k>>3],m=f*j-l*g,!(m>-1.0e-10&m<1.0e-10)):0){p=+h[i+16>>3];q=+h[k+16>>3];n=(p*f-q*g)/m;j=(q*j-p*l)/m;f=+h[o+8>>3];g=+h[e+8>>3];do if(f>3]<+h[e>>3]:0){e=o;break}b=d;}while(0);b=a[b+16>>0]|0;if(!(n>=+h[e>>3])){if(b<<24>>24==1){b=0;break}}else if(!(b<<24>>24)){b=0;break}b=Lu()|0;c[b+20>>2]=0;h[b>>3]=n;h[b+8>>3]=j;}else b=0;while(0);return b|0}function Ms(b,d){b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0,n=0,o=0.0,p=0;n=c[b+8>>2]|0;k=c[n+36>>2]|0;l=+h[d>>3];o=+h[k>>3];m=l>o;p=a[b+16>>0]|0;if(m)if(!(p<<24>>24))b=1;else f=4;else if(p<<24>>24==1)b=0;else f=4;if((f|0)==4){e=+h[n>>3];a:do if(e==1.0){e=+h[d+8>>3];g=e-+h[k+8>>3];i=l-o;j=+h[n+8>>3];d=j<0.0;do if(m?j>=0.0:d){if(g>=j*i){b=1;break a}}else {b=j*e+l>+h[n+16>>3];if(d)if(b){b=0;break a}else break;else if(b)break;else {b=0;break a}}while(0);o=o-+h[c[n+32>>2]>>3];b=j*(i*i-g*g)>3]-l*e;j=+h[d+8>>3]-i;o=l-o;l=i-+h[k+8>>3];b=j*j>l*l+o*o;}while(0);b=(b^p<<24>>24!=0)&1;}return b|0}function Ns(a,b){a=a|0;b=b|0;c[b>>2]=a;a=a+4|0;c[b+4>>2]=c[a>>2];c[c[a>>2]>>2]=b;c[a>>2]=b;return}function Os(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;f=c[46866]|0;b=~~((+h[a>>3]-+h[23272])/+h[23274]*+(f|0));b=(b|0)>0?b:0;f=(b|0)<(f|0)?b:f+-1|0;b=Ps(f)|0;if(!b){d=1;while(1){b=Ps(f-d|0)|0;if(b|0)break;b=Ps(d+f|0)|0;if(b|0)break;d=d+1|0;}c[46867]=(c[46867]|0)+d;}c[46868]=(c[46868]|0)+1;e=c[46860]|0;d=c[46861]|0;a:do if((b|0)==(e|0))g=9;else {if((b|0)!=(d|0)?(Ms(b,a)|0)!=0:0){g=9;break}while(1){b=c[b>>2]|0;if((b|0)==(e|0))break a;if(Ms(b,a)|0){e=b;break}}}while(0);if((g|0)==9){while(1){b=c[b+4>>2]|0;if((b|0)==(d|0))break;if(!(Ms(b,a)|0))break;else g=9;}e=c[b>>2]|0;}if((f|0)>0?(f|0)<((c[46866]|0)+-1|0):0){b=(c[46865]|0)+(f<<2)|0;d=c[b>>2]|0;if(d|0){g=d+12|0;c[g>>2]=(c[g>>2]|0)+-1;}c[b>>2]=e;g=e+12|0;c[g>>2]=(c[g>>2]|0)+1;}return e|0}function Ps(a){a=a|0;var b=0,d=0;if((a|0)>-1&(c[46866]|0)>(a|0)?(d=(c[46865]|0)+(a<<2)|0,b=c[d>>2]|0,(b|0)!=0):0){if((c[b+8>>2]|0)==(-2|0)){c[d>>2]=0;a=b+12|0;d=(c[a>>2]|0)+-1|0;c[a>>2]=d;if(!d){iu(b,187448);b=0;}else b=0;}}else b=0;return b|0}function Qs(a){a=a|0;var b=0,d=0;b=a+4|0;d=c[a>>2]|0;c[d+4>>2]=c[b>>2];c[c[b>>2]>>2]=d;c[a+8>>2]=-2;return}function Rs(a){a=a|0;return c[a+4>>2]|0}function Ss(a){a=a|0;return c[a>>2]|0}function Ts(b){b=b|0;var d=0;d=c[b+8>>2]|0;if(!d)b=187672;else b=(a[b+16>>0]|0)==0?d+32|0:d+36|0;return c[b>>2]|0}function Us(b){b=b|0;var d=0;d=c[b+8>>2]|0;if(!d)b=187672;else b=(a[b+16>>0]|0)==0?d+36|0:d+32|0;return c[b>>2]|0}function Vs(){fu(187480,24);return}function Ws(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0,g=0,i=0,j=0;j=l;l=l+32|0;i=j;g=(c[46869]|0)+((c[a+16>>2]|0)*96|0)+88|0;f=c[g>>2]|0;h[i+8>>3]=b;h[i+16>>3]=d;e=Xs(a,i,f)|0;do if(e|0){if((e|0)<0){i=hu(187480)|0;h[i+8>>3]=b;h[i+16>>3]=d;c[i>>2]=f;c[g>>2]=i;break}while(1){e=c[f>>2]|0;g=Xs(a,i,e)|0;if((g|0)>0)f=e;else break}if(g|0){i=hu(187480)|0;h[i+8>>3]=b;h[i+16>>3]=d;c[f>>2]=i;c[i>>2]=e;}}while(0);l=j;return}function Xs(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0;do if(c){e=+h[b+8>>3];i=+h[c+8>>3];d=+h[b+16>>3];f=+h[c+16>>3];if(!(e==i&d==f)){k=+h[a>>3];j=e-k;e=+h[a+8>>3];g=d-e;i=i-k;d=f-e;if(!(j>=0.0)){if(i>=0.0){b=1;break}e=d/i;d=g/j;if(de){b=1;break}b=j>i?-1:1;break}if(!(i<0.0)){b=i>0.0;if(!(j>0.0)){if(b){b=!(g<=0.0)?1:-1;break}if(g0.0?-1:1;break}e=d/i;d=g/j;if(de){b=1;break}b=j>2]|0;d=a+(d*20|0)+4|0;b=1;a=0;while(1){if((b|0)>=(f|0))break;g=a+((c[e+(c[(c[d>>2]|0)+(b<<2)>>2]<<2)>>2]|0)>0&1)|0;b=b+1|0;a=g;}return a|0}function Zs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+(b*20|0)|0;b=a+(b*20|0)+4|0;a=1;while(1){if((a|0)>=(c[e>>2]|0))break;c[d+(c[(c[b>>2]|0)+(a<<2)>>2]<<2)>>2]=1;a=a+1|0;}return}function _s(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+(b*20|0)|0;b=a+(b*20|0)+4|0;a=1;while(1){if((a|0)>=(c[e>>2]|0))break;c[d+(c[(c[b>>2]|0)+(a<<2)>>2]<<2)>>2]=0;a=a+1|0;}return}function $s(a,b){a=a|0;b=b|0;if(!(c[a+8>>2]|0))a=bt(a,b)|0;else a=at(a,b)|0;return a|0}function at(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=b<<2;e=KK(O(f,b)|0)|0;f=KK(f)|0;d=0;while(1){if((d|0)>=(b|0)){d=0;break}c[f+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}while(1){if((d|0)>=(b|0))break;bs(d,a,b,c[f+(d<<2)>>2]|0);d=d+1|0;}return f|0}function bt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=l;l=l+16|0;f=h;g=b<<2;e=KK(O(g,b)|0)|0;g=KK(g)|0;d=0;while(1){if((d|0)>=(b|0))break;c[g+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}ur(f,b);d=0;while(1){if((d|0)>=(b|0))break;qr(d,a,b,c[g+(d<<2)>>2]|0,f);d=d+1|0;}vr(f);l=h;return g|0}function ct(a,b){a=a|0;b=b|0;var d=0,e=0;e=c[a+8>>2]|0;dt(a,b);d=at(a,b)|0;et(a,b,e);return d|0}function dt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=KK(b<<2)|0;d=0;e=0;while(1){if((d|0)>=(b|0))break;k=(c[a+(d*20|0)>>2]|0)+e|0;d=d+1|0;e=k;}e=KK(e<<2)|0;d=0;while(1){if((d|0)>=(b|0))break;c[l+(d<<2)>>2]=0;d=d+1|0;}f=0;while(1){if((f|0)>=(b|0))break;c[a+(f*20|0)+8>>2]=e;Zs(a,f,l);h=a+(f*20|0)|0;i=c[h>>2]|0;j=a+(f*20|0)+4|0;k=i+-2|0;d=1;while(1){if((d|0)>=(i|0))break;m=c[(c[j>>2]|0)+(d<<2)>>2]|0;n=c[a+(m*20|0)>>2]|0;g[e+(d<<2)>>2]=+(k+n-((Ys(a,0,m,l)|0)<<1)|0);d=d+1|0;}_s(a,f,l);e=e+(c[h>>2]<<2)|0;f=f+1|0;}U1(l);return}function et(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+8|0;U1(c[e>>2]|0);c[e>>2]=0;a:do if(d|0){e=0;while(1){if((e|0)>=(b|0))break a;c[a+(e*20|0)+8>>2]=d;f=d+(c[a+(e*20|0)>>2]<<2)|0;e=e+1|0;d=f;}}while(0);return}function ft(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0.0,i=0.0,j=0;f=0;g=0.0;while(1){if((f|0)>=(b|0))break;j=c[a+(f<<2)>>2]|0;i=+h[j+(d<<3)>>3]-+h[j+(e<<3)>>3];f=f+1|0;g=i*i+g;}return +(+C(+g))}function gt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if((e|0)>(d|0)){c[46873]=a;o4(b+(d<<2)|0,1-d+e|0,4,77);}return}function ht(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0;f=c[46873]|0;e=+g[f+(c[a>>2]<<2)>>2];d=+g[f+(c[b>>2]<<2)>>2];return (ed&1)|0}function it(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=l;l=l+16|0;f=h;if((d|0)<(e|0)){jt(a,b,d,e,f);g=c[f>>2]|0;f=g+-1|0;it(a,b,d,f);g=g+1|0;it(a,b,g,e);if(!(kt(a,b,d,f)|0))it(a,b,d,f);if(!(kt(a,b,g,e)|0))it(a,b,g,e);}l=h;return}function jt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0.0,m=0,n=0;g=x5()|0;g=b+(((((x5()|0)<<16|g)>>>0)%((1-d+e|0)>>>0)|0)+d<<2)|0;j=c[g>>2]|0;k=b+(d<<2)|0;c[g>>2]=c[k>>2];c[k>>2]=j;l=+h[a+(j<<3)>>3];g=d+1|0;d=e;a:while(1){if((g|0)>=(d|0))break;while(1){if((g|0)>=(d|0))break;if(!(+h[a+(c[b+(g<<2)>>2]<<3)>>3]<=l))break;g=g+1|0;}while(1){if((g|0)>=(d|0))continue a;e=b+(d<<2)|0;i=c[e>>2]|0;if(!(+h[a+(i<<3)>>3]>l))break;d=d+-1|0;}n=b+(g<<2)|0;m=c[n>>2]|0;c[n>>2]=i;c[e>>2]=m;g=g+1|0;d=d+-1|0;}n=g+((+h[a+(c[b+(g<<2)>>2]<<3)>>3]>l)<<31>>31)|0;c[f>>2]=n;n=b+(n<<2)|0;c[k>>2]=c[n>>2];c[n>>2]=j;return}function kt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=1;while(1){f=d+1|0;if(!((d|0)<(e|0)&(g|0)!=0))break;g=+h[a+(c[b+(d<<2)>>2]<<3)>>3]>+h[a+(c[b+(f<<2)>>2]<<3)>>3]?0:g;d=f;}return g|0}function lt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,m=0,n=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,A=0.0;x=l;l=l+16|0;v=4;w=T1(40)|0;c[w>>2]=0;t=x;o=0;u=$(23,b*40|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){d=0;r=0;while(1){if((d|0)>=(b|0))break;s=(c[(c[a+(d<<2)>>2]|0)+4>>2]|0)+r|0;d=d+1|0;r=s;}o=0;s=$(23,r*24|0)|0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)!=1){d=0;m=0;while(1){if((m|0)>=(b|0))break;n=u+(m*40|0)|0;c[n>>2]=s+(d*24|0);q=a+(m<<2)|0;f=0;g=1797693134862315708145274.0e284;i=-1797693134862315708145274.0e284;j=-1797693134862315708145274.0e284;k=1797693134862315708145274.0e284;while(1){e=c[q>>2]|0;if((f|0)>=(c[e+4>>2]|0))break;e=c[e>>2]|0;A=+h[e+(f<<4)>>3];y=+h[e+(f<<4)+8>>3];h[s+(d*24|0)>>3]=A;h[s+(d*24|0)+8>>3]=y;c[s+(d*24|0)+16>>2]=n;c[s+(d*24|0)+20>>2]=0;f=f+1|0;d=d+1|0;g=gA?i:A;j=j>y?j:y;k=k>2]=s+((d+-1|0)*24|0);h[u+(m*40|0)+8>>3]=g;h[u+(m*40|0)+16>>3]=k;h[u+(m*40|0)+24>>3]=i;h[u+(m*40|0)+32>>3]=j;m=m+1|0;}c[t>>2]=r;c[t+4>>2]=b;w=U6(187496,1,w|0,v|0)|0;v=z;o=0;d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){d=z;q=s;m=s;n=u;}else {d=0;q=s;m=s;n=u;}}else {d=z;q=0;m=s;n=u;}}else {d=z;q=0;m=0;n=0;}while(1){if(d|0){o=0;ia(105,u|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}o=0;ia(105,m|0);d=o;o=0;if((d|0)!=0&(p|0)!=0){e=V6(c[d>>2]|0,w|0,v|0)|0;if(!e)bb(d|0,p|0);z=p;}else e=-1;if((e|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}else {e=17;break}}o=0;d=aa(78,q|0,t|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}if(!d){o=0;d=ca(24,a|0,b|0,n|0)|0;e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}}o=0;ia(105,u|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;continue}o=0;ia(105,m|0);e=o;o=0;if((e|0)!=0&(p|0)!=0){f=V6(c[e>>2]|0,w|0,v|0)|0;if(!f)bb(e|0,p|0);z=p;}else f=-1;if((f|0)==1){f=n;r=m;s=q;d=z;n=f;m=r;q=s;}else {e=24;break}}if((e|0)==17)d=0;else if((e|0)==24)d=(d|0)==0&1;U1(w|0);l=x;return d|0}function mt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;q=v;o=v+8|0;p=v+4|0;c[b+8>>2]=0;u=KK(c[b>>2]<<2)|0;f=c[b>>2]|0;e=0;while(1){if((e|0)>=(f|0))break;c[u+(e<<2)>>2]=a+(e*24|0);e=e+1|0;}o4(u,f,4,79);m=0;g=0;f=0;h=0;a:while(1){if((m|0)>=(c[b>>2]|0)){s=0;d=g;t=h;break}n=u+(m<<2)|0;e=c[n>>2]|0;c[o>>2]=e;a=c[e+16>>2]|0;if((c[a>>2]|0)==(e|0))e=c[a+4>>2]|0;else e=e+-24|0;c[p>>2]=e;k=0;a=g;j=h;while(1){if((k|0)>=2)break;switch(ot(o,p)|0){case -1:{g=0;h=a;while(1){if((g|0)>=(j|0))break;i=pt(c[h>>2]|0,e)|0;if(i|0){s=i;d=a;t=j;break a}g=g+1|0;h=c[h+4>>2]|0;}g=KK(12)|0;if(!j){f=0;a=g;}else c[f+4>>2]=g;c[g+8>>2]=f;c[g>>2]=e;c[g+4>>2]=0;c[e+20>>2]=g;h=j+1|0;break}case 1:{e=e+20|0;g=c[e>>2]|0;if(!g){r=19;break a}do if((j|0)!=1){if((g|0)==(a|0)){a=c[a+4>>2]|0;c[a+8>>2]=0;break}if((g|0)==(f|0)){f=c[f+8>>2]|0;c[f+4>>2]=0;break}else {i=g+4|0;h=c[g+8>>2]|0;c[h+4>>2]=c[i>>2];c[(c[i>>2]|0)+8>>2]=h;break}}else {a=0;f=0;}while(0);U1(g);c[e>>2]=0;g=f;h=j+-1|0;break}default:{g=f;h=j;}}e=c[n>>2]|0;f=c[e+16>>2]|0;if((e|0)==(c[f+4>>2]|0))f=c[f>>2]|0;else f=e+24|0;c[p>>2]=f;k=k+1|0;f=g;j=h;}m=m+1|0;g=a;h=j;}if((r|0)==19){gA(1,93727,q)|0;bb(187496,1);}e=0;while(1){if((e|0)>=(t|0))break;r=c[d+4>>2]|0;U1(d);e=e+1|0;d=r;}U1(u);l=v;return s|0}function nt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0,C=0,D=0,E=0.0;D=l;l=l+48|0;o=D+24|0;n=D+16|0;u=D;e=0;a:while(1){if((e|0)>=(b|0)){e=0;break}z=c[a+(e<<2)>>2]|0;A=c[z>>2]|0;c[u>>2]=c[A>>2];c[u+4>>2]=c[A+4>>2];c[u+8>>2]=c[A+8>>2];c[u+12>>2]=c[A+12>>2];A=e+1|0;B=d+(e*40|0)+8|0;p=d+(e*40|0)+24|0;q=d+(e*40|0)+32|0;g=d+(e*40|0)+16|0;e=A;while(1){if((e|0)>=(b|0)){e=A;continue a}i=c[a+(e<<2)>>2]|0;j=+h[B>>3];k=+h[d+(e*40|0)+24>>3];m=!(j<=k);f=+h[d+(e*40|0)+8>>3];if((((!(m|!(j>=f))?(r=+h[g>>3],s=+h[d+(e*40|0)+32>>3],r<=s):0)?(t=+h[d+(e*40|0)+16>>3],r>=t):0)?(E=+h[p>>3],!(!(E<=k)|!(E>=f))):0)?(E=+h[q>>3],!(!(E<=s)|!(E>=t))):0){c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[o>>2]=c[u>>2];c[o+4>>2]=c[u+4>>2];c[o+8>>2]=c[u+8>>2];c[o+12>>2]=c[u+12>>2];if(NX(n,o)|0){e=1;break a}}else C=11;if((((((C|0)==11?(C=0,v=+h[p>>3],!(!(f<=v)|!(f>=j))):0)?(w=+h[d+(e*40|0)+16>>3],x=+h[q>>3],w<=x):0)?(y=+h[g>>3],!(!(w>=y)|(!(k<=v)|m))):0)?(E=+h[d+(e*40|0)+32>>3],!(!(E<=x)|!(E>=y))):0)?(m=c[i>>2]|0,c[n>>2]=c[z>>2],c[n+4>>2]=c[z+4>>2],c[o>>2]=c[m>>2],c[o+4>>2]=c[m+4>>2],c[o+8>>2]=c[m+8>>2],c[o+12>>2]=c[m+12>>2],NX(n,o)|0):0){e=1;break a}e=e+1|0;}}l=D;return e|0}function ot(a,b){a=a|0;b=b|0;var d=0.0,e=0;e=c[a>>2]|0;a=c[b>>2]|0;d=+h[e>>3]-+h[a>>3];if(!(d!=0.0)){d=+h[e+8>>3]-+h[a+8>>3];if(d==0.0)a=0;else a=d>0.0?1:-1;}else a=d>0.0?1:-1;return a|0}function pt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,m=0;m=l;l=l+64|0;g=m+32|0;i=m+24|0;j=m+16|0;k=m;f=m+48|0;qt(a,b,f);d=f+8|0;e=c[d>>2]|0;do if((e|0)>0)d=0;else {if((e|0)<0){qt(b,a,f);d=c[d>>2]|0;if((d|0)>0){d=0;break}if((d|0)<0)d=3;else {d=c[f>>2]|0;d=rt(b,a,(d|0)>-1?d:0-d|0)|0;}if(!(st(a,b,i,j,d)|0)){d=0;break}}else {d=c[f>>2]|0;if((d|0)==(c[f+4>>2]|0)){d=rt(a,b,0)|0;d=(rt(a,b,(d|0)<=(rt(a,b,1)|0)&1)|0)<<1;}else d=rt(a,b,(d|0)>-1?d:0-d|0)|0;if(!(st(a,b,i,j,d)|0)){d=0;break}}h[k>>3]=+h[i>>3];h[k+8>>3]=+h[j>>3];c[g>>2]=c[k>>2];c[g+4>>2]=c[k+4>>2];c[g+8>>2]=c[k+8>>2];c[g+12>>2]=c[k+12>>2];d=tt(a,b,g)|0;}while(0);l=m;return d|0}function qt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0;i=+h[a>>3];j=+h[a+8>>3];e=c[a+16>>2]|0;if((c[e+4>>2]|0)==(a|0)){a=c[e>>2]|0;e=a;}else {e=a+24|0;a=a+24|0;}g=+h[e>>3]-i;f=+h[a+8>>3]-j;e=c[b+16>>2]|0;if((c[e+4>>2]|0)==(b|0)){a=c[e>>2]|0;e=a;}else {e=b+24|0;a=b+24|0;}k=+h[e>>3]-i;l=+h[a+8>>3]-j;j=(+h[b+8>>3]-j)*g-(+h[b>>3]-i)*f;b=j==0.0?0:j>0.0?1:-1;c[d>>2]=b;j=l*g-k*f;a=j==0.0?0:j>0.0?1:-1;c[d+4>>2]=a;c[d+8>>2]=O(a,b)|0;return}function rt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0.0,i=0.0,j=0.0,k=0.0,l=0.0;k=+h[a>>3];l=+h[a+8>>3];f=c[a+16>>2]|0;if((c[f+4>>2]|0)==(a|0))a=c[f>>2]|0;else a=a+24|0;j=+h[a>>3];i=+h[a+8>>3];do if(d){a=c[b+16>>2]|0;if((c[a+4>>2]|0)==(b|0)){b=c[a>>2]|0;break}else {b=b+24|0;break}}while(0);g=+h[b>>3];e=+h[b+8>>3];if(k==j)if(k==g)b=(vt(l,e,i)|0)!=-1&1;else b=0;else b=vt(k,g,j)|0;return b|0}function st(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;a:do if((f|0)<1)g=0;else {n=+h[a>>3];p=+h[a+8>>3];g=c[a+16>>2]|0;if((c[g+4>>2]|0)==(a|0))g=c[g>>2]|0;else g=a+24|0;l=+h[g>>3];j=+h[g+8>>3];m=+h[b>>3];o=+h[b+8>>3];g=c[b+16>>2]|0;if((c[g+4>>2]|0)==(b|0))g=c[g>>2]|0;else g=b+24|0;k=+h[g>>3];i=+h[g+8>>3];b:do switch(f|0){case 3:{if(n==l){h[d>>3]=n;i=(o-i)/(m-k)*(n-k)+i;break b}if(m==k){h[d>>3]=m;i=(p-j)/(n-l)*(m-l)+j;break b}else {k=(o-i)/(m-k);l=(p-j)/(n-l);o=o-k*m;p=p-l*n;i=k-l;h[d>>3]=(p-o)/i;i=(k*p-o*l)/i;break b}}case 2:{if((rt(a,b,0)|0)==-1)if((rt(b,a,1)|0)==-1){f=(rt(b,a,0)|0)==-1;l=f?l:n;k=m;j=f?j:p;i=o;}else {l=k;k=m;j=i;i=o;}else if((rt(a,b,1)|0)!=-1)if((rt(b,a,0)|0)==-1){k=n;i=p;}else {g=0;break a}else {l=m;j=o;}h[d>>3]=(k+l)*.5;i=(i+j)*.5;break}case 1:if((o-p)*(n-l)==(m-n)*(p-j)){h[d>>3]=m;i=o;break b}else {h[d>>3]=k;break b}default:{g=1;break a}}while(0);h[e>>3]=i;g=1;}while(0);return g|0}function tt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;o=+h[a>>3];p=+h[a+8>>3];e=c[a+16>>2]|0;if((c[e+4>>2]|0)==(a|0))e=c[e>>2]|0;else e=a+24|0;m=+h[e>>3];j=+h[e+8>>3];k=+h[b>>3];n=+h[b+8>>3];e=c[b+16>>2]|0;if((c[e+4>>2]|0)==(b|0))e=c[e>>2]|0;else e=b+24|0;i=+h[e>>3];g=+h[e+8>>3];a:do if(!(o!=m&k!=i)){do if(o==m){f=+h[d>>3];if(o==f?p==+h[d+8>>3]:0)break;if(!(m==f)){r=18;break a}if(!(j==+h[d+8>>3])){r=18;break a}}while(0);if(k==i){f=+h[d>>3];if(k==f?n==+h[d+8>>3]:0){e=0;break}if(i==f?g==+h[d+8>>3]:0)e=0;else r=18;}else e=0;}else r=18;while(0);if((r|0)==18)if(0>1);else e=1;l=s;return e|0}function ut(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0,m=0.0,n=0.0;k=l;l=l+48|0;j=k;f=c[15712]|0;g=+h[b>>3];i=+h[b+8>>3];d=c[b+16>>2]|0;if((c[d+4>>2]|0)==(b|0)){d=c[d>>2]|0;e=d;}else {e=b+24|0;d=b+24|0;}n=+h[e>>3];m=+h[d+8>>3];c[j>>2]=a;h[j+8>>3]=g;h[j+16>>3]=i;h[j+24>>3]=n;h[j+32>>3]=m;w4(f,93784,j)|0;l=k;return}function vt(a,b,c){a=+a;b=+b;c=+c;return (a==b|b==c?0:(a>3]=0.0;e=e+1|0;}h[f+(a<<3)>>3]=1.0;vy(c[b+(a<<2)>>2]|0,f,d);a=a+1|0;}U1(f);f=0;while(1){if((f|0)>=(d|0)){a=1;break a}e=b+(f<<2)|0;a=0;while(1){if((a|0)==(f|0))break;j=(c[e>>2]|0)+(a<<3)|0;i=+h[j>>3];g=(c[b+(a<<2)>>2]|0)+(f<<3)|0;h[j>>3]=+h[g>>3];h[g>>3]=i;a=a+1|0;}f=f+1|0;}}while(0);return a|0}function xt(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var i=0,j=0.0,k=0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=b<<3;p=KK(q)|0;q=KK(q)|0;r=b*30|0;n=(d|0)<(b|0)?d:b;o=b+-1|0;m=(g|0)==0;d=0;i=0;a:while(1){if((i|0)>=(n|0))break;k=c[e+(i<<2)>>2]|0;do{b:do if(m)d=0;else {d=0;while(1){if((d|0)==(b|0)){d=0;break b}h[k+(d<<3)>>3]=+((x5()|0)%100|0|0);d=d+1|0;}}while(0);while(1){if((d|0)==(i|0))break;g=c[e+(d<<2)>>2]|0;zt(k,0,o,-+yt(g,0,o,k),g);d=d+1|0;}j=+At(k,0,o);}while(j<1.0e-10);Bt(k,0,o,1.0/j,k);d=0;do{Ct(q,0,o,k);Dt(a,b,b,k,p);Ct(k,0,o,p);g=0;while(1){if((g|0)==(i|0))break;s=c[e+(g<<2)>>2]|0;zt(k,0,o,-+yt(s,0,o,k),s);g=g+1|0;}s=d;d=d+1|0;j=+At(k,0,o);if(!((s|0)<(r|0)&!(j<1.0e-10)))break a;Bt(k,0,o,1.0/j,k);l=+yt(k,0,o,q);}while(+B(+l)<.999);h[f+(i<<3)>>3]=l*j;i=i+1|0;}while(1){if((i|0)>=(n|0))break;k=c[e+(i<<2)>>2]|0;g=0;while(1){if((g|0)>=(b|0)){g=0;break}h[k+(g<<3)>>3]=+((x5()|0)%100|0|0);g=g+1|0;}while(1){if((g|0)>=(i|0))break;s=c[e+(g<<2)>>2]|0;zt(k,0,o,-+yt(s,0,o,k),s);g=g+1|0;}Bt(k,0,o,1.0/+At(k,0,o),k);h[f+(i<<3)>>3]=0.0;i=i+1|0;}m=n+-1|0;i=0;while(1){if((i|0)>=(m|0))break;a=f+(i<<3)|0;b=i+1|0;j=+h[a>>3];g=i;k=b;while(1){if((k|0)>=(n|0))break;l=+h[f+(k<<3)>>3];s=j>2]|0);s=e+(g<<2)|0;Ct(c[k>>2]|0,0,o,c[s>>2]|0);Ct(c[s>>2]|0,0,o,p);h[f+(g<<3)>>3]=+h[a>>3];h[a>>3]=j;i=b;}U1(p);U1(q);return (d|0)<=(r|0)|0}function yt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0;f=0.0;e=1-b+c|0;d=d+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!e)break;f=+h[d>>3]*+h[c>>3]+f;e=e+-1|0;d=d+8|0;c=c+8|0;}return +f}function zt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0;f=1-b+c|0;e=e+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!f)break;h[c>>3]=+h[c>>3]+ +h[e>>3]*d;f=f+-1|0;e=e+8|0;c=c+8|0;}return}function At(a,b,c){a=a|0;b=b|0;c=c|0;return +(+C(+(+yt(a,b,c,a))))}function Bt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0;f=1-b+c|0;e=e+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!f)break;h[c>>3]=+h[e>>3]*d;f=f+-1|0;e=e+8|0;c=c+8|0;}return}function Ct(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=1-b+c|0;d=d+(b<<3)|0;c=a+(b<<3)|0;while(1){if(!e)break;h[c>>3]=+h[d>>3];e=e+-1|0;d=d+8|0;c=c+8|0;}return}function Dt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0,k=0;j=0;while(1){if((j|0)>=(b|0))break;k=a+(j<<2)|0;g=0.0;i=0;while(1){if((i|0)>=(d|0))break;g=+h[e+(i<<3)>>3]*+h[(c[k>>2]|0)+(i<<3)>>3]+g;i=i+1|0;}h[f+(j<<3)>>3]=g;j=j+1|0;}return}function Et(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0.0,m=0,n=0,o=0,p=0.0;k=c[i>>2]|0;if(!k){o=d<<2;j=T1(O(o,f)|0)|0;o=T1(o)|0;}else {o=d<<2;j=W1(c[k>>2]|0,O(o,f)|0)|0;o=W1(k,o)|0;}c[i>>2]=o;k=0;while(1){if((k|0)>=(d|0)){i=0;break}c[o+(k<<2)>>2]=j;k=k+1|0;j=j+(f<<2)|0;}while(1){if((i|0)>=(d|0))break;m=a+(i<<2)|0;n=o+(i<<2)|0;k=0;while(1){if((k|0)<(f|0)){j=0;l=0.0;}else break;while(1){if((j|0)>=(e|0))break;p=+h[(c[m>>2]|0)+(j<<3)>>3]*+g[(c[b+(j<<2)>>2]|0)+(k<<2)>>2]+l;j=j+1|0;l=p;}g[(c[n>>2]|0)+(k<<2)>>2]=l;k=k+1|0;}i=i+1|0;}return}function Ft(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0,l=0.0,m=0,n=0,o=0;k=c[i>>2]|0;if(!k){j=T1(O(d<<3,f)|0)|0;o=T1(d<<2)|0;}else {j=W1(c[k>>2]|0,O(d<<3,f)|0)|0;o=W1(k,d<<2)|0;}c[i>>2]=o;k=0;while(1){if((k|0)>=(d|0)){i=0;break}c[o+(k<<2)>>2]=j;k=k+1|0;j=j+(f<<3)|0;}while(1){if((i|0)>=(d|0))break;m=a+(i<<2)|0;n=o+(i<<2)|0;k=0;while(1){if((k|0)<(f|0)){l=0.0;j=0;}else break;while(1){if((j|0)>=(e|0))break;l=+h[(c[m>>2]|0)+(j<<3)>>3]*+g[(c[b+(j<<2)>>2]|0)+(k<<2)>>2]+l;j=j+1|0;}h[(c[n>>2]|0)+(k<<3)>>3]=l;k=k+1|0;}i=i+1|0;}return}function Gt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var i=0,j=0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0;j=c[f>>2]|0;if(!j){i=T1(O(d*20|0,e)|0)|0;q=T1(d<<2)|0;}else {i=W1(c[j>>2]|0,O(d*20|0,e)|0)|0;q=W1(j,d<<2)|0;}c[f>>2]=q;j=0;while(1){if((j|0)>=(d|0)){f=0;break}c[q+(j<<2)>>2]=i;j=j+1|0;i=i+(e<<2)|0;}while(1){if((f|0)>=(d|0))break;l=c[a+(f*20|0)+4>>2]|0;m=c[a+(f*20|0)+8>>2]|0;n=c[a+(f*20|0)>>2]|0;o=q+(f<<2)|0;i=0;while(1){if((i|0)>=(e|0))break;p=b+(i<<2)|0;k=0.0;j=0;while(1){if((j|0)>=(n|0))break;k=+h[(c[p>>2]|0)+(c[l+(j<<2)>>2]<<3)>>3]*+g[m+(j<<2)>>2]+k;j=j+1|0;}g[(c[o>>2]|0)+(i<<2)>>2]=k;i=i+1|0;}f=f+1|0;}return}function Ht(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0;c=0.0;d=b;e=a;while(1){if(!e)break;c=+h[d>>3]+c;d=d+8|0;e=e+-1|0;}c=c/+(a|0);while(1){if(!a)break;h[b>>3]=+h[b>>3]-c;b=b+8|0;a=a+-1|0;}return}function It(a,b){a=a|0;b=b|0;var c=0;c=0;while(1){if((c|0)>=(a|0))break;h[b+(c<<3)>>3]=+((x5()|0)%500|0|0);c=c+1|0;}Ht(a,b);return}function Jt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0,l=0,m=0;j=0;while(1){if((j|0)>=(b|0))break;k=c[a+(j*20|0)>>2]|0;l=a+(j*20|0)+8|0;m=a+(j*20|0)+4|0;f=0.0;i=0;while(1){if((i|0)>=(k|0))break;f=+h[d+(c[(c[m>>2]|0)+(i<<2)>>2]<<3)>>3]*+g[(c[l>>2]|0)+(i<<2)>>2]+f;i=i+1|0;}h[e+(j<<3)>>3]=f;j=j+1|0;}return}function Kt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,i=0,j=0,k=0;j=0;while(1){if((j|0)>=(b|0))break;k=a+(j<<2)|0;f=0.0;i=0;while(1){if((i|0)==(b|0))break;f=+h[d+(i<<3)>>3]*+g[(c[k>>2]|0)+(i<<2)>>2]+f;i=i+1|0;}h[e+(j<<3)>>3]=f;j=j+1|0;}return}function Lt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[b+(e<<3)>>3]-+h[c+(e<<3)>>3];e=e+1|0;}return}function Mt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[c+(e<<3)>>3]+ +h[b+(e<<3)>>3];e=e+1|0;}return}function Nt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;h[d+(e<<3)>>3]=+h[b+(e<<3)>>3]*c;e=e+1|0;}return}function Ot(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;h[c+(d<<3)>>3]=+h[b+(d<<3)>>3];d=d+1|0;}return}function Pt(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0;d=0.0;e=0;while(1){if((e|0)>=(a|0))break;d=+h[c+(e<<3)>>3]*+h[b+(e<<3)>>3]+d;e=e+1|0;}return +d}function Qt(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0;c=0;d=-1.e+50;while(1){if((c|0)>=(a|0))break;e=+B(+(+h[b+(c<<3)>>3]));c=c+1|0;d=e>d?e:d;}return +d}function Rt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0,j=0;j=0;while(1){if((j|0)<(b|0)){g=0.0;i=0;}else break;while(1){if((i|0)>=(d|0))break;g=+h[e+(i<<3)>>3]*+h[(c[a+(i<<2)>>2]|0)+(j<<3)>>3]+g;i=i+1|0;}h[f+(j<<3)>>3]=g;j=j+1|0;}return}function St(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0;c=0.0;d=b;e=a;while(1){if(!e)break;c=+g[d>>2]+c;d=d+4|0;e=e+-1|0;}c=c/+(a|0);while(1){if(!a)break;g[b>>2]=+g[b>>2]-c;b=b+4|0;a=a+-1|0;}return}function Tt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0,k=0,l=0.0,m=0,n=0.0,o=0,p=0.0;e=0;while(1){if((e|0)>=(b|0)){h=0;j=0;m=b;break}g[d+(e<<2)>>2]=0.0;e=e+1|0;}while(1){if((j|0)>=(b|0))break;l=+g[c+(j<<2)>>2];k=j+1|0;f=+g[a+(h<<2)>>2]*l;i=k;e=h;while(1){e=e+1|0;if((i|0)==(b|0))break;p=+g[a+(e<<2)>>2];n=+g[c+(i<<2)>>2]*p+f;o=d+(i<<2)|0;g[o>>2]=+g[o>>2]+p*l;f=n;i=i+1|0;}o=d+(j<<2)|0;g[o>>2]=+g[o>>2]+f;h=h+m|0;j=k;m=m+-1|0;}return}function Ut(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[b+(e<<2)>>2]-+g[c+(e<<2)>>2];e=e+1|0;}return}function Vt(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[c+(e<<2)>>2]+ +g[b+(e<<2)>>2];e=e+1|0;}return}function Wt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0,f=0;e=0;while(1){if((e|0)>=(a|0))break;f=b+(e<<2)|0;g[f>>2]=+g[d+(e<<2)>>2]*c+ +g[f>>2];e=e+1|0;}return}function Xt(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;g[d+(e<<2)>>2]=+g[b+(e<<2)>>2]*c;e=e+1|0;}return}function Yt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(a|0))break;c[d+(e<<2)>>2]=c[b+(e<<2)>>2];e=e+1|0;}return}function Zt(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0;d=0.0;e=0;while(1){if((e|0)>=(a|0))break;d=d+ +g[c+(e<<2)>>2]*+g[b+(e<<2)>>2];e=e+1|0;}return +d}function _t(a,b,c){a=a|0;b=+b;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;h[c+(d<<3)>>3]=b;d=d+1|0;}return}function $t(a,b,c){a=a|0;b=+b;c=c|0;var d=0;d=0;while(1){if((d|0)>=(a|0))break;g[c+(d<<2)>>2]=b;d=d+1|0;}return}function au(a,b){a=a|0;b=b|0;var c=0.0,d=0,e=0.0;c=-1000000015047466219876688.0e6;d=0;while(1){if((d|0)>=(a|0))break;e=+B(+(+g[b+(d<<2)>>2]));c=e>c?e:c;d=d+1|0;}return +c}function bu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];g[d>>2]=e*e;c=c+1|0;}return}function cu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];if(e!=0.0)g[d>>2]=1.0/e;c=c+1|0;}return}function du(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0.0;d=0;while(1){if((d|0)>=(a|0))break;e=+g[b+(d<<2)>>2];if(e>=0.0)g[c+(d<<2)>>2]=+C(+e);d=d+1|0;}return}function eu(a,b){a=a|0;b=b|0;var c=0,d=0,e=0.0;c=0;while(1){if((c|0)>=(a|0))break;d=b+(c<<2)|0;e=+g[d>>2];if(e>0.0)g[d>>2]=1.0/+C(+e);c=c+1|0;}return}function fu(a,b){a=a|0;b=b|0;var d=0;c[a>>2]=0;if(b&3)if(!(4%(b>>>0)|0))b=4;else b=O(4/((gu(b)|0)>>>0)|0,b)|0;c[a+8>>2]=b;a=a+4|0;b=c[a>>2]|0;a:do if(b|0)while(1){if(!b)break a;d=c[b>>2]|0;U1(c[b+4>>2]|0);U1(b);b=d;}while(0);c[a>>2]=0;return}function gu(a){a=a|0;var b=0,c=0;c=4;a:while(1){b=c;while(1){if((b|0)==(a|0))break a;if((b|0)<=(a|0))break;b=b-a|0;}c=b;a=a-b|0;}return a|0}function hu(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;if(!b){d=c[a+8>>2]|0;e=KK(8)|0;f=KK(O(c[46855]|0,d)|0)|0;c[e+4>>2]=f;b=0;while(1){if((b|0)>=(c[46855]|0))break;iu(f+(O(b,d)|0)|0,a);b=b+1|0;}b=a+4|0;c[e>>2]=c[b>>2];c[b>>2]=e;b=c[a>>2]|0;}c[a>>2]=c[b>>2];return b|0}function iu(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[b>>2]=a;return}function ju(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0;m=JK(b<<3)|0;l=a+8|0;f=c[l>>2]|0;ku(a,b,m);It(b,d);h=0;i=0;while(1){if((i|0)>=(b|0))break;h=(c[a+(i*20|0)>>2]|0)+h|0;i=i+1|0;}h=KK(h<<2)|0;j=0;while(1){if((j|0)>=(b|0))break;c[a+(j*20|0)+8>>2]=h;k=c[a+(j*20|0)>>2]|0;g[h>>2]=+(1-k|0);i=1;while(1){if((i|0)>=(k|0))break;g[h+(i<<2)>>2]=1.0;i=i+1|0;}h=h+(k<<2)|0;j=j+1|0;}i=yr(a,d,m,b,.001,e)|0;U1(c[l>>2]|0);h=0;while(1){if((h|0)>=(b|0))break;c[a+(h*20|0)+8>>2]=f;f=f+(c[a+(h*20|0)>>2]<<2)|0;h=h+1|0;}U1(m);return i>>>31|0}function ku(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,i=0,j=0,k=0,l=0,m=0;k=a+16|0;i=0;while(1){if((i|0)>=(b|0))break;if(c[k>>2]|0){l=c[a+(i*20|0)>>2]|0;m=a+(i*20|0)+8|0;j=a+(i*20|0)+16|0;e=0.0;f=1;while(1){if((f|0)>=(l|0))break;e=e+ +g[(c[j>>2]|0)+(f<<2)>>2]*+g[(c[m>>2]|0)+(f<<2)>>2];f=f+1|0;}h[d+(i<<3)>>3]=e;}i=i+1|0;}return}function lu(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=+h;i=i|0;j=j|0;a=l;l=l+16|0;if(!(c[46913]|0)){c[46913]=1;gA(1,93820,a)|0;}l=a;return}function mu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=KK(f<<2)|0;i=b<<3;g=0;while(1){if((g|0)>=(f|0))break;c[r+(g<<2)>>2]=KK(i)|0;g=g+1|0;}p=KK(f<<3)|0;q=KK(b<<2)|0;g=KK(O(i,b)|0)|0;i=0;while(1){if((i|0)>=(b|0))break;c[q+(i<<2)>>2]=g;g=g+(b<<3)|0;i=i+1|0;}k=0;o=1;while(1){if((k|0)>=(b|0))break;l=a+(k<<2)|0;m=q+(k<<2)|0;i=0;while(1){if((i|0)==(o|0))break;n=a+(i<<2)|0;g=0;j=0.0;while(1){if((g|0)>=(d|0))break;s=j+ +(O(c[(c[n>>2]|0)+(g<<2)>>2]|0,c[(c[l>>2]|0)+(g<<2)>>2]|0)|0);g=g+1|0;j=s;}h[(c[q+(i<<2)>>2]|0)+(k<<3)>>3]=j;h[(c[m>>2]|0)+(i<<3)>>3]=j;i=i+1|0;}k=k+1|0;o=o+1|0;}xt(q,b,f,r,p,1)|0;i=0;while(1){if((i|0)>=(f|0)){g=0;break}l=r+(i<<2)|0;m=e+(i<<2)|0;k=0;while(1){if((k|0)<(d|0)){g=0;j=0.0;}else break;while(1){if((g|0)>=(b|0))break;s=+h[(c[l>>2]|0)+(g<<3)>>3]*+(c[(c[a+(g<<2)>>2]|0)+(k<<2)>>2]|0)+j;g=g+1|0;j=s;}h[(c[m>>2]|0)+(k<<3)>>3]=j;k=k+1|0;}i=i+1|0;}while(1){if((g|0)>=(f|0))break;U1(c[r+(g<<2)>>2]|0);g=g+1|0;}U1(r);U1(p);U1(c[q>>2]|0);U1(q);return}function nu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=l;l=l+32|0;g=f+16|0;j=f+20|0;i=f+12|0;h=f+8|0;c[g>>2]=e;c[i>>2]=0;c[h>>2]=0;iy(c[a>>2]|0,d,d<<2,j);Gt(c[j>>2]|0,a,d,b,i);Ft(a,c[i>>2]|0,b,d,b,h);U1(c[c[i>>2]>>2]|0);U1(c[i>>2]|0);e=(xt(c[h>>2]|0,b,1,g,f,1)|0)&255;l=f;return e|0}function ou(){c[46914]=0;U1(c[46915]|0);U1(c[46916]|0);U1(c[46917]|0);c[46915]=0;c[46916]=0;c[46917]=0;return}function pu(a){a=a|0;U1(c[a+36>>2]|0);return}function qu(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0;r=l;l=l+80|0;o=r+64|0;q=r+68|0;i=r+48|0;j=r+32|0;k=r+16|0;m=r;n=d+16|0;g=c[n>>2]|0;a:do if(!(c[g+212>>2]|0))switch(WM(d)|0){case 1:{g=c[n>>2]|0;j=c[g+12>>2]|0;k=c[j+8>>2]|0;c[q>>2]=k;g=c[c[g+8>>2]>>2]|0;switch(a[g>>0]|0){case 98:{if(!(s2(g,108236)|0))p=11;else p=8;break}case 112:{if((s2(g,105721)|0)==0?(ru(c[j+44>>2]|0,k)|0)!=0:0)p=11;else p=8;break}default:p=8;}do if((p|0)==8)if((k|0)<3){c[b+40>>2]=(c[j>>2]|0)==0?0:2;p=17;break}else {g=b+40|0;c[g>>2]=0;break}else if((p|0)==11){g=b+40|0;c[g>>2]=1;if((k|0)<=2)p=17;}while(0);if((p|0)==17){i=su(d,q,e,f)|0;p=21;break a}i=KK(k<<4)|0;j=j+44|0;if((c[g>>2]|0)==1){p=c[j>>2]|0;s=e;h[i>>3]=+h[p>>3]*.013888888888888888+s;e=f;h[i+8>>3]=+h[p+8>>3]*.013888888888888888+e;h[i+16>>3]=+h[p+16>>3]*.013888888888888888-s;h[i+24>>3]=+h[p+24>>3]*.013888888888888888+e;h[i+32>>3]=+h[p+32>>3]*.013888888888888888-s;h[i+40>>3]=+h[p+40>>3]*.013888888888888888-e;h[i+48>>3]=+h[p+48>>3]*.013888888888888888+s;h[i+56>>3]=+h[p+56>>3]*.013888888888888888-e;p=21;break a}g=0;while(1){if((g|0)>=(k|0)){p=21;break a}p=c[j>>2]|0;u=+h[p+(g<<4)>>3];s=+h[p+(g<<4)+8>>3];t=+C(+(s*s+u*u));h[i+(g<<4)>>3]=(e/t+1.0)*u*.013888888888888888;h[i+(g<<4)+8>>3]=(f/t+1.0)*s*.013888888888888888;g=g+1|0;}}case 2:{c[q>>2]=4;p=KK(64)|0;d=c[(c[n>>2]|0)+12>>2]|0;v=+h[d+32>>3];t=+h[d+40>>3];o=~~+h[d+16>>3];d=~~+h[d+24>>3];u=-e;s=-f;tu(i,o,d,u,s);c[p>>2]=c[i>>2];c[p+4>>2]=c[i+4>>2];c[p+8>>2]=c[i+8>>2];c[p+12>>2]=c[i+12>>2];i=p+16|0;n=~~v;tu(j,n,d,e,s);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];i=p+32|0;d=~~t;tu(k,n,d,e,f);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];i=p+48|0;tu(m,o,d,u,f);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[b+40>>2]=1;i=p;p=21;break a}case 3:{c[b+40>>2]=2;i=su(d,q,e,f)|0;p=21;break a}default:{c[o>>2]=c[c[(c[n>>2]|0)+8>>2]>>2];gA(1,93883,o)|0;g=1;break a}}else {c[q>>2]=4;u=+h[g+32>>3]*.5+e;v=+h[g+40>>3]*.5+f;c[b+40>>2]=1;i=KK(64)|0;h[i>>3]=u;h[i+8>>3]=v;t=-u;h[i+16>>3]=t;h[i+24>>3]=v;h[i+32>>3]=t;v=-v;h[i+40>>3]=v;h[i+48>>3]=u;h[i+56>>3]=v;p=21;}while(0);if((p|0)==21){c[b+36>>2]=i;g=c[q>>2]|0;c[b+32>>2]=g;uu(i,g,b,b+16|0);if((g|0)>(c[46914]|0)){c[46914]=g;g=0;}else g=0;}l=r;return g|0}function ru(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;do if((b|0)==4){c=+h[a+8>>3];b=a+16|0;d=+h[a+24>>3];if(c==d){if(!(+h[a+40>>3]==+h[a+56>>3])){b=0;break}if(!(+h[a>>3]==+h[a+48>>3])){b=0;break}b=+h[b>>3]==+h[a+32>>3];break}if((+h[a>>3]==+h[b>>3]?+h[a+32>>3]==+h[a+48>>3]:0)?c==+h[a+56>>3]:0)b=d==+h[a+40>>3];else b=0;}else b=0;while(0);return b&1|0}function su(a,b,d,e){a=a|0;b=b|0;d=+d;e=+e;var f=0,g=0.0,i=0,j=0,k=0.0,l=0;f=QA(a,102705)|0;if(!f)f=0;else f=q5(f)|0;i=(f|0)<3?20:f;j=KK(i<<4)|0;a=a+16|0;g=1.0/+(i|0);f=0;while(1){if((f|0)>=(i|0))break;l=c[a>>2]|0;k=g*+(f|0)*6.283185307179586;h[j+(f<<4)>>3]=(+h[l+32>>3]*.5+d)*+E(+k);h[j+(f<<4)+8>>3]=(+h[l+40>>3]*.5+e)*+F(+k);f=f+1|0;}c[b>>2]=i;return j|0}function tu(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=+e;h[a>>3]=+(b|0)*.013888888888888888+d;h[a+8>>3]=+(c|0)*.013888888888888888+e;return}function uu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,g=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0.0;j=+h[a>>3];i=+h[a+8>>3];e=1;f=i;g=j;while(1){if((e|0)>=(b|0))break;k=a+16|0;l=+h[k>>3];m=+h[a+24>>3];e=e+1|0;f=m>f?m:f;g=l>g?l:g;i=m>3]=j;h[c+8>>3]=i;h[d>>3]=g;h[d+8>>3]=f;return}function vu(b,d,e,f){b=b|0;d=d|0;e=+e;f=+f;var g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0;r=l;l=l+80|0;n=r+64|0;p=r+68|0;i=r+48|0;j=r+32|0;k=r+16|0;m=r;o=d+16|0;g=c[o>>2]|0;a:do if(!(c[g+212>>2]|0))switch(WM(d)|0){case 1:{m=c[(c[o>>2]|0)+12>>2]|0;n=m+8|0;k=c[n>>2]|0;c[p>>2]=k;b:do if((k|0)>2){i=KK(k<<4)|0;j=m+44|0;g=0;while(1){if((g|0)>=(k|0))break b;d=c[j>>2]|0;h[i+(g<<4)>>3]=+h[d+(g<<4)>>3]*.013888888888888888;h[i+(g<<4)+8>>3]=+h[d+(g<<4)+8>>3]*.013888888888888888;g=g+1|0;}}else i=su(d,p,0.0,0.0)|0;while(0);g=c[c[(c[o>>2]|0)+8>>2]>>2]|0;switch(a[g>>0]|0){case 98:{if(!(s2(g,108236)|0))g=1;else q=13;break}case 112:{if((s2(g,105721)|0)==0?(ru(i,c[p>>2]|0)|0)!=0:0)g=1;else q=13;break}default:q=13;}do if((q|0)==13){if((c[n>>2]|0)<3?c[m>>2]|0:0){g=2;break}g=0;}while(0);c[b+40>>2]=g;q=20;break a}case 2:{c[p>>2]=4;q=KK(64)|0;o=c[(c[o>>2]|0)+12>>2]|0;t=+h[o+16>>3];v=+h[o+24>>3];u=+h[o+32>>3];s=+h[o+40>>3];wu(i,t,v);c[q>>2]=c[i>>2];c[q+4>>2]=c[i+4>>2];c[q+8>>2]=c[i+8>>2];c[q+12>>2]=c[i+12>>2];i=q+16|0;wu(j,u,v);c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];i=q+32|0;wu(k,u,s);c[i>>2]=c[k>>2];c[i+4>>2]=c[k+4>>2];c[i+8>>2]=c[k+8>>2];c[i+12>>2]=c[k+12>>2];i=q+48|0;wu(m,t,s);c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];c[b+40>>2]=1;i=q;q=20;break a}case 3:{c[b+40>>2]=2;i=su(d,p,0.0,0.0)|0;q=20;break a}default:{c[n>>2]=c[c[(c[o>>2]|0)+8>>2]>>2];gA(1,93919,n)|0;g=1;break a}}else {c[p>>2]=4;u=+h[g+32>>3]*.5;v=+h[g+40>>3]*.5;c[b+40>>2]=1;i=KK(64)|0;h[i>>3]=u;h[i+8>>3]=v;t=-u;h[i+16>>3]=t;h[i+24>>3]=v;h[i+32>>3]=t;v=-v;h[i+40>>3]=v;h[i+48>>3]=u;h[i+56>>3]=v;q=20;}while(0);if((q|0)==20){g=c[p>>2]|0;if(e!=1.0|f!=1.0)xu(i,g,e,f);c[b+36>>2]=i;c[b+32>>2]=g;uu(i,g,b,b+16|0);if((g|0)>(c[46914]|0)){c[46914]=g;g=0;}else g=0;}l=r;return g|0}function wu(a,b,c){a=a|0;b=+b;c=+c;h[a>>3]=b*.013888888888888888;h[a+8>>3]=c*.013888888888888888;return}function xu(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;var e=0,f=0;e=0;while(1){if((e|0)>=(b|0))break;h[a>>3]=+h[a>>3]*c;f=a+8|0;h[f>>3]=+h[f>>3]*d;a=a+16|0;e=e+1|0;}return}function yu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0;r=l;l=l+128|0;o=r+112|0;n=r+96|0;m=r+80|0;f=r+64|0;p=r+48|0;q=r+32|0;j=r+16|0;k=r;c[n>>2]=c[a>>2];c[n+4>>2]=c[a+4>>2];c[n+8>>2]=c[a+8>>2];c[n+12>>2]=c[a+12>>2];c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];ws(p,n,o);g=b+16|0;c[n>>2]=c[a>>2];c[n+4>>2]=c[a+4>>2];c[n+8>>2]=c[a+8>>2];c[n+12>>2]=c[a+12>>2];c[o>>2]=c[g>>2];c[o+4>>2]=c[g+4>>2];c[o+8>>2]=c[g+8>>2];c[o+12>>2]=c[g+12>>2];ws(q,n,o);c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[o>>2]=c[e>>2];c[o+4>>2]=c[e+4>>2];c[o+8>>2]=c[e+8>>2];c[o+12>>2]=c[e+12>>2];ws(j,n,o);i=e+16|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[o>>2]=c[i>>2];c[o+4>>2]=c[i+4>>2];c[o+8>>2]=c[i+8>>2];c[o+12>>2]=c[i+12>>2];ws(k,n,o);c[f>>2]=c[p>>2];c[f+4>>2]=c[p+4>>2];c[f+8>>2]=c[p+8>>2];c[f+12>>2]=c[p+12>>2];c[m>>2]=c[q>>2];c[m+4>>2]=c[q+4>>2];c[m+8>>2]=c[q+8>>2];c[m+12>>2]=c[q+12>>2];c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];do if(zu(f,m,n,o)|0){f=c[b+40>>2]|0;if(f&1|0?c[e+40>>2]&1|0:0){f=1;break}if(f&2|0?c[e+40>>2]&2|0:0){s=+h[g>>3]-+h[b>>3]+ +h[i>>3]-+h[e>>3];t=+h[a>>3]-+h[d>>3];u=+h[a+8>>3]-+h[d+8>>3];f=!(u*u+t*t>s*s*.25);break}f=c[46915]|0;if(!f){c[46915]=KK(c[46914]<<4)|0;i=KK(c[46914]<<4)|0;c[46916]=i;f=c[46915]|0;}else i=c[46916]|0;v=c[b+36>>2]|0;b=b+32|0;g=c[b>>2]|0;c[o>>2]=c[a>>2];c[o+4>>2]=c[a+4>>2];c[o+8>>2]=c[a+8>>2];c[o+12>>2]=c[a+12>>2];Au(v,g,o,f);a=c[e+36>>2]|0;g=e+32|0;e=c[g>>2]|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];Au(a,e,o,i);if(!(Bu(f,i,c[b>>2]|0,c[g>>2]|0)|0)){f=c[46915]|0;c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];c[n>>2]=c[j>>2];c[n+4>>2]=c[j+4>>2];c[n+8>>2]=c[j+8>>2];c[n+12>>2]=c[j+12>>2];c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[o+8>>2]=c[k+8>>2];c[o+12>>2]=c[k+12>>2];if(Cu(m,n,o)|0?(k=c[46916]|0,v=c[g>>2]|0,c[o>>2]=c[f>>2],c[o+4>>2]=c[f+4>>2],c[o+8>>2]=c[f+8>>2],c[o+12>>2]=c[f+12>>2],Du(k,v,o)|0):0){f=1;break}f=c[46916]|0;c[m>>2]=c[f>>2];c[m+4>>2]=c[f+4>>2];c[m+8>>2]=c[f+8>>2];c[m+12>>2]=c[f+12>>2];c[n>>2]=c[p>>2];c[n+4>>2]=c[p+4>>2];c[n+8>>2]=c[p+8>>2];c[n+12>>2]=c[p+12>>2];c[o>>2]=c[q>>2];c[o+4>>2]=c[q+4>>2];c[o+8>>2]=c[q+8>>2];c[o+12>>2]=c[q+12>>2];if(!(Cu(m,n,o)|0))f=0;else {q=c[46915]|0;v=c[b>>2]|0;c[o>>2]=c[f>>2];c[o+4>>2]=c[f+4>>2];c[o+8>>2]=c[f+8>>2];c[o+12>>2]=c[f+12>>2];f=(Du(q,v,o)|0)!=0;}}else f=1;}else f=0;while(0);l=r;return f&1|0}function zu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((+h[a>>3]<=+h[d>>3]?+h[c>>3]<=+h[b>>3]:0)?+h[a+8>>3]<=+h[d+8>>3]:0)a=+h[c+8>>3]<=+h[b+8>>3]&1;else a=0;return a|0}function Au(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;f=c+8|0;e=0;while(1){if((e|0)>=(b|0))break;h[d>>3]=+h[c>>3]+ +h[a>>3];h[d+8>>3]=+h[f>>3]+ +h[a+8>>3];e=e+1|0;a=a+16|0;d=d+16|0;}return}function Bu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;A=l;l=l+112|0;s=A+96|0;r=A+80|0;q=A+64|0;p=A+48|0;u=A+32|0;v=A+16|0;w=A;x=d+-1|0;y=e+-1|0;z=d<<1;t=e<<1;f=0;g=0;h=0;i=0;while(1){B=a+(f<<4)|0;C=a+(((x+f|0)%(d|0)|0)<<4)|0;c[r>>2]=c[B>>2];c[r+4>>2]=c[B+4>>2];c[r+8>>2]=c[B+8>>2];c[r+12>>2]=c[B+12>>2];c[s>>2]=c[C>>2];c[s+4>>2]=c[C+4>>2];c[s+8>>2]=c[C+8>>2];c[s+12>>2]=c[C+12>>2];vs(u,r,s);o=b+(g<<4)|0;n=b+(((y+g|0)%(e|0)|0)<<4)|0;c[r>>2]=c[o>>2];c[r+4>>2]=c[o+4>>2];c[r+8>>2]=c[o+8>>2];c[r+12>>2]=c[o+12>>2];c[s>>2]=c[n>>2];c[s+4>>2]=c[n+4>>2];c[s+8>>2]=c[n+8>>2];c[s+12>>2]=c[n+12>>2];vs(v,r,s);c[q>>2]=c[46540];c[q+4>>2]=c[46541];c[q+8>>2]=c[46542];c[q+12>>2]=c[46543];c[r>>2]=c[u>>2];c[r+4>>2]=c[u+4>>2];c[r+8>>2]=c[u+8>>2];c[r+12>>2]=c[u+12>>2];c[s>>2]=c[v>>2];c[s+4>>2]=c[v+4>>2];c[s+8>>2]=c[v+8>>2];c[s+12>>2]=c[v+12>>2];j=+xs(q,r,s);c[q>>2]=c[C>>2];c[q+4>>2]=c[C+4>>2];c[q+8>>2]=c[C+8>>2];c[q+12>>2]=c[C+12>>2];c[r>>2]=c[B>>2];c[r+4>>2]=c[B+4>>2];c[r+8>>2]=c[B+8>>2];c[r+12>>2]=c[B+12>>2];c[s>>2]=c[o>>2];c[s+4>>2]=c[o+4>>2];c[s+8>>2]=c[o+8>>2];c[s+12>>2]=c[o+12>>2];k=ys(q,r,s)|0;c[q>>2]=c[n>>2];c[q+4>>2]=c[n+4>>2];c[q+8>>2]=c[n+8>>2];c[q+12>>2]=c[n+12>>2];c[r>>2]=c[o>>2];c[r+4>>2]=c[o+4>>2];c[r+8>>2]=c[o+8>>2];c[r+12>>2]=c[o+12>>2];c[s>>2]=c[B>>2];c[s+4>>2]=c[B+4>>2];c[s+8>>2]=c[B+8>>2];c[s+12>>2]=c[B+12>>2];m=ys(q,r,s)|0;c[p>>2]=c[C>>2];c[p+4>>2]=c[C+4>>2];c[p+8>>2]=c[C+8>>2];c[p+12>>2]=c[C+12>>2];c[q>>2]=c[B>>2];c[q+4>>2]=c[B+4>>2];c[q+8>>2]=c[B+8>>2];c[q+12>>2]=c[B+12>>2];c[r>>2]=c[n>>2];c[r+4>>2]=c[n+4>>2];c[r+8>>2]=c[n+8>>2];c[r+12>>2]=c[n+12>>2];c[s>>2]=c[o>>2];c[s+4>>2]=c[o+4>>2];c[s+8>>2]=c[o+8>>2];c[s+12>>2]=c[o+12>>2];if(zs(p,q,r,s,w)|0){f=1;break}n=(k|0)==0;o=(m|0)==0;do if(j!=0.0|(m|k|0)!=0)if(!(j>=0.0))if(o){f=(f+1|0)%(d|0)|0;h=h+1|0;break}else {g=(g+1|0)%(e|0)|0;i=i+1|0;break}else if(n){g=(g+1|0)%(e|0)|0;i=i+1|0;break}else {f=(f+1|0)%(d|0)|0;h=h+1|0;break}else {f=(f+1|0)%(d|0)|0;h=h+1|0;}while(0);if(!((i|0)<(t|0)&((h|0)<(z|0)&((i|0)<(e|0)|(h|0)<(d|0))))){f=0;break}}l=A;return f|0}function Cu(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0;e=+h[a>>3];if((e<=+h[c>>3]?e>=+h[b>>3]:0)?(d=+h[a+8>>3],d<=+h[c+8>>3]):0)a=d>=+h[b+8>>3]&1;else a=0;return a|0}function Du(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0,k=0.0,l=0;e=c[46917]|0;if(!e){e=KK(c[46914]<<4)|0;c[46917]=e;}i=d+8|0;g=0;while(1){if((g|0)>=(b|0))break;h[e+(g<<4)>>3]=+h[a+(g<<4)>>3]-+h[d>>3];h[e+(g<<4)+8>>3]=+h[a+(g<<4)+8>>3]-+h[i>>3];g=g+1|0;}d=b+-1|0;f=0.0;a=0;a:while(1){if((a|0)>=(b|0)){l=19;break}g=(d+a|0)%(b|0)|0;j=+h[e+(a<<4)+8>>3];i=j==0.0;if(i?+h[e+(g<<4)+8>>3]==0.0:0){if(+h[e+(g<<4)>>3]*+h[e+(a<<4)>>3]<0.0){e=1;break}}else l=11;do if((l|0)==11){l=0;k=+h[e+(g<<4)+8>>3];if(!(j>=0.0)|!(k<=0.0)?!(k>=0.0)|!(j<=0.0):0)break;j=(k*+h[e+(a<<4)>>3]-j*+h[e+(g<<4)>>3])/(k-j);if(j==0.0){e=1;break a}if(j>0.0)if(k==0.0|i){f=f+.5;break}else {f=f+1.0;break}}while(0);a=a+1|0;}if((l|0)==19)e=((~~f|0)%2|0|0)==1&1;return e|0}function Eu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=KK(b<<2)|0;i=O(b,b)|0;d=KK(i<<2)|0;c[j>>2]=d;$t(i,0.0,d);d=1;while(1){if((d|0)>=(b|0)){d=0;g=0;i=b;break}c[j+(d<<2)>>2]=(c[j>>2]|0)+((O(d,b)|0)<<2);d=d+1|0;}while(1){if((g|0)>=(b|0))break;h=j+(g<<2)|0;e=g;f=d;while(1){if((e|0)==(b|0))break;k=c[a+(f<<2)>>2]|0;c[(c[h>>2]|0)+(e<<2)>>2]=k;c[(c[j+(e<<2)>>2]|0)+(g<<2)>>2]=k;e=e+1|0;f=f+1|0;}d=d+i|0;g=g+1|0;i=i+-1|0;}return j|0}function Fu(a,b,d,e,f,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=+j;var k=0.0,l=0.0,m=0.0,n=0,o=0,p=0,q=0.0,r=0,s=0.0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0.0;M=c[d+(f<<2)>>2]|0;C=c[a+4>>2]|0;D=c[a>>2]|0;E=c[a+48>>2]|0;F=c[a+52>>2]|0;G=c[a+56>>2]|0;a:do if((h|0)<1)d=0;else {Hu(M,C,E,F,G,j);H=c[a+28>>2]|0;I=c[a+32>>2]|0;J=c[a+36>>2]|0;K=c[a+12>>2]|0;L=c[a+16>>2]|0;f=0;e=0;d=-1;while(1){if((f|0)>=(C|0))break;if((f|0)>=(e|0)){d=d+1|0;if((d|0)==(G|0)){e=C;d=G;}else e=c[F+(d<<2)>>2]|0;}c[L+(c[E+(f<<2)>>2]<<2)>>2]=d;f=f+1|0;}z=c[a+40>>2]|0;A=I+(C+-1<<2)|0;d=0;e=0;while(1){if(e<<24>>24==0&(d|0)<(h|0)){k=-1.0e9;f=0;e=1;}else break a;b:while(1){x=f;while(1){if((x|0)>=(C|0))break b;f=c[E+(x<<2)>>2]|0;y=+g[M+(f<<2)>>2];l=y;w=x;m=0.0;while(1){g[z+(f<<2)>>2]=m;f=w+1|0;if((f|0)>=(C|0)){v=0;break}l=(c[L+(f<<2)>>2]|0)>(c[L+(w<<2)>>2]|0)?l+j:l;a=c[E+(f<<2)>>2]|0;m=+g[M+(a<<2)>>2];if(+B(+(m-l))>1.0e-09){v=1;break}w=f;m=m-y;f=a;}n=x;while(1){if((n|0)>(w|0)){a=0;o=x;break}o=c[E+(n<<2)>>2]|0;p=c[D+(o<<2)>>2]|0;a=0;l=-+g[b+(o<<2)>>2];while(1){if((a|0)>=(C|0))break;if((a|0)!=(o|0))l=+g[M+(a<<2)>>2]*+g[p+(a<<2)>>2]+l;a=a+1|0;}g[H+(o<<2)>>2]=l/-+g[p+(o<<2)>>2]-+g[z+(o<<2)>>2];n=n+1|0;}c:while(1){if((o|0)>(w|0)){m=0.0;q=0.0;r=0;break}n=c[L+(c[E+(o<<2)>>2]<<2)>>2]|0;if((n|0)==(G|0))r=f;else {r=c[F+(n<<2)>>2]|0;r=(f|0)<(r|0)?f:r;}p=o;while(1){if((p|0)>=(r|0)){p=o;break}n=c[E+(p<<2)>>2]|0;if(+g[H+(n<<2)>>2]>2]=n;a=a+1|0;}p=p+1|0;}while(1){if((p|0)>=(r|0))break;n=c[E+(p<<2)>>2]|0;if(+g[H+(n<<2)>>2]==y){c[K+(a<<2)>>2]=n;a=a+1|0;}p=p+1|0;}while(1){if((o|0)>=(r|0)){o=r;continue c}n=c[E+(o<<2)>>2]|0;if(+g[H+(n<<2)>>2]>y){c[K+(a<<2)>>2]=n;a=a+1|0;}o=o+1|0;}}while(1){if((r|0)>=(a|0))break;o=c[K+(r<<2)>>2]|0;p=c[D+(o<<2)>>2]|0;l=0.0;n=0;while(1){if((n|0)==(r|0))break;l=l-+g[p+(c[K+(n<<2)>>2]<<2)>>2];n=n+1|0;}N=l*2.0;u=p+(o<<2)|0;s=+g[u>>2];l=N+m;s=(N*y+m*q-+g[H+(o<<2)>>2]*s)/(l-s);g[I+(r<<2)>>2]=s;m=l-+g[u>>2];q=s;r=r+1|0;}p=(a|0)==(C|0);if(p)g[A>>2]=y;u=a+-1|0;m=0.0;q=0.0;o=u;while(1){if((o|0)<=-1)break;r=c[K+(o<<2)>>2]|0;t=c[D+(r<<2)>>2]|0;l=0.0;n=o;while(1){n=n+1|0;if((n|0)>=(a|0))break;l=l-+g[t+(c[K+(n<<2)>>2]<<2)>>2];}l=l*2.0;t=t+(r<<2)|0;N=+g[t>>2];s=l+m;N=(l*y+m*q-+g[H+(r<<2)>>2]*N)/(s-N);g[J+(o<<2)>>2]=N;m=s-+g[t>>2];q=N;o=o+-1|0;}if(p){g[J>>2]=y;s=0.0;n=-1;p=0;}else {s=0.0;n=-1;p=0;}while(1){if((a|0)<=(p|0))break;q=+g[J+(p<<2)>>2];if((p|0)>0)l=+g[I+(p+-1<<2)>>2];else l=q;do if(qy;if(qs;s=t?N:s;n=t?p:n;p=p+1|0;}if((n|0)>-1)break;if(v?(c[L+(c[E+(f<<2)>>2]<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0):0){k=+g[M+(c[K+(u<<2)>>2]<<2)>>2]+j;x=f;continue}k=+g[M+(c[K+(u<<2)>>2]<<2)>>2];x=f;}m=+g[J+(n<<2)>>2];if(!n)q=m;else q=+g[I+(n+-1<<2)>>2];if(v){t=c[E+(f<<2)>>2]|0;l=+g[M+(t<<2)>>2];l=((c[L+(t<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0)?l-j:l)-+g[z+(c[K+(u<<2)>>2]<<2)>>2];}else l=1.0e9;l=mk?q:k;do if(ly;if(l=(n|0))break;t=c[K+(o<<2)>>2]|0;g[M+(t<<2)>>2]=+g[z+(t<<2)>>2]+l;o=o+1|0;}while(1){if((n|0)>=(a|0))break;t=c[K+(n<<2)>>2]|0;g[M+(t<<2)>>2]=+g[z+(t<<2)>>2]+m;n=n+1|0;}if(v?(c[L+(c[E+(f<<2)>>2]<<2)>>2]|0)>(c[L+(c[E+(w<<2)>>2]<<2)>>2]|0):0)k=+g[M+(c[K+(u<<2)>>2]<<2)>>2]+j;else k=+g[M+(c[K+(u<<2)>>2]<<2)>>2];a=x;while(1){if((a|0)>(w|0))break;c[E+(a<<2)>>2]=c[K+(a-x<<2)>>2];a=a+1|0;}if(e<<24>>24!=0?+B(+(l-y))<.01:0)e=+B(+(m-y))<.01;else e=0;e=e&1;}St(C,M);Gu(M,E,F,G,i);d=d+1|0;}}while(0);return d|0}function Gu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=0;while(1){if((g|0)>=(e|0))break;c[f+(g<<2)>>2]=c[a+(c[b+((c[d+(g<<2)>>2]|0)+-1<<2)>>2]<<2)>>2];g=g+1|0;}return}function Hu(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;var i=0.0,j=0,k=0,l=0,m=0;i=-1.0e9;k=0;j=-1;m=0;while(1){if((m|0)>=(b|0))break;if((m|0)<(k|0))l=k;else {j=j+1|0;if((j|0)==(f|0))k=b;else k=c[e+(j<<2)>>2]|0;if((m|0)>0)i=+g[a+(c[d+(m+-1<<2)>>2]<<2)>>2]+h;else i=-1.0e9;gt(a,d,m,k+-1|0);l=k;}k=a+(c[d+(m<<2)>>2]<<2)|0;if(+g[k>>2]>2]=i;k=l;m=m+1|0;}return}function Iu(a){a=a|0;U1(c[c[a>>2]>>2]|0);U1(c[a>>2]|0);U1(c[a+8>>2]|0);U1(c[a+28>>2]|0);U1(c[a+32>>2]|0);U1(c[a+36>>2]|0);U1(c[a+40>>2]|0);U1(c[a+12>>2]|0);U1(c[a+16>>2]|0);U1(c[a+20>>2]|0);U1(c[a+24>>2]|0);U1(a);return}function Ju(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;k=KK(60)|0;c[k>>2]=0;l=k+4|0;c[l>>2]=b;c[k+48>>2]=d;c[k+52>>2]=e;c[k+56>>2]=f;c[k>>2]=Eu(a,b)|0;i=b<<2;j=KK(i)|0;c[k+8>>2]=j;h=0;b=0;a=-1;while(1){if((h|0)>=(c[l>>2]|0))break;g=a+1|0;if((h|0)>=(b|0)){b=c[((g|0)==(f|0)?l:e+(g<<2)|0)>>2]|0;a=g;}c[j+(c[d+(h<<2)>>2]<<2)>>2]=a;h=h+1|0;}c[k+28>>2]=KK(i)|0;c[k+32>>2]=KK(i)|0;c[k+36>>2]=KK(i)|0;c[k+40>>2]=KK(i)|0;c[k+12>>2]=KK(i)|0;c[k+16>>2]=KK(i)|0;c[k+20>>2]=KK(i)|0;c[k+24>>2]=KK(i)|0;return k|0}function Ku(){fu(187676,24);c[46922]=0;return}function Lu(){return hu(187676)|0}function Mu(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+h[a>>3]-+h[b>>3];d=+h[a+8>>3]-+h[b+8>>3];return +(+C(+(d*d+c*c)))}function Nu(a){a=a|0;var b=0;b=c[46922]|0;c[a+16>>2]=b;c[46922]=b+1;return}function Ou(a){a=a|0;var b=0,d=0;d=a+20|0;b=(c[d>>2]|0)+-1|0;c[d>>2]=b;if(!b)iu(a,187676);return}function Pu(a){a=a|0;a=a+20|0;c[a>>2]=(c[a>>2]|0)+1;return}function Qu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var i=0.0,j=0,k=0,m=0,n=0.0,o=0,p=0.0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;x=l;l=l+16|0;o=x;c[o>>2]=e;q=b<<2;v=KK(q)|0;m=b<<3;w=KK(m)|0;u=$s(a,b)|0;a=0;while(1){if((a|0)>=(b|0))break;k=u+(a<<2)|0;j=0;while(1){if((j|0)==(b|0))break;s=(c[k>>2]|0)+(j<<2)|0;c[s>>2]=c[s>>2]<<8;j=j+1|0;}a=a+1|0;}if(!d)qa(93952,93960,283,93974);s=KK(m)|0;a=0;while(1){if((a|0)>=(b|0))break;h[s+(a<<3)>>3]=+h[d+(a<<3)>>3];a=a+1|0;}Ru(s,b);i=0.0;n=0.0;m=1;while(1){if((m|0)>=(b|0))break;j=u+(m<<2)|0;k=d+(m<<3)|0;a=0;while(1){if((a|0)==(m|0))break;y=c[(c[j>>2]|0)+(a<<2)>>2]|0;r=+h[k>>3]-+h[d+(a<<3)>>3];i=r*r*(1.0/+(O(y,y)|0))+i;n=+B(+r)*(1.0/+(y|0))+n;a=a+1|0;}m=m+1|0;}r=n/i;a=0;while(1){if((a|0)>=(b|0))break;y=d+(a<<3)|0;h[y>>3]=+h[y>>3]*r;a=a+1|0;}Su(b,o,f,d,u);k=KK(O(q,b)|0)|0;j=0;while(1){if((j|0)>=(b|0)){k=1;break}m=k+((O(j,b)|0)<<2)|0;c[v+(j<<2)>>2]=m;o=u+(j<<2)|0;i=0.0;a=0;while(1){if((a|0)==(b|0))break;if((a|0)!=(j|0)){p=+(c[(c[o>>2]|0)+(a<<2)>>2]|0);p=-1.0/(p*p);g[m+(a<<2)>>2]=p;i=i-p;}a=a+1|0;}g[m+(j<<2)>>2]=i;j=j+1|0;}while(1){if((k|0)>=(b|0)){j=0;break}i=+h[d+(k<<3)>>3];j=u+(k<<2)|0;a=0;while(1){if((a|0)==(k|0))break;y=(c[j>>2]|0)+(a<<2)|0;n=+(c[y>>2]|0);p=i-+h[d+(a<<3)>>3];p=n*n-p*p;q=~~+C(+p);q=p>0.0?q:0;c[(c[u+(a<<2)>>2]|0)+(k<<2)>>2]=q;c[y>>2]=q;a=a+1|0;}k=k+1|0;}while(1){if((j|0)>=(b|0)){q=0;a=0;break}n=+h[e+(j<<3)>>3];m=w+(j<<3)|0;h[m>>3]=0.0;o=u+(j<<2)|0;k=v+(j<<2)|0;a=0;i=0.0;while(1){if((a|0)==(b|0))break;if((a|0)!=(j|0)){p=+g[(c[k>>2]|0)+(a<<2)>>2]*+(c[(c[o>>2]|0)+(a<<2)>>2]|0);i=i+(n>=+h[e+(a<<3)>>3]?-p:p);h[m>>3]=i;}a=a+1|0;}j=j+1|0;}while(1){if(!(a<<24>>24==0&(q|0)<200)){t=42;break}if((zr(v,e,w,b,f,b,1)|0)<0){a=1;break}else {a=1;o=0;}while(1){if((o|0)>=(b|0))break;p=+h[e+(o<<3)>>3];k=u+(o<<2)|0;m=v+(o<<2)|0;i=0.0;j=0;while(1){if((j|0)==(b|0))break;do if((j|0)!=(o|0)){n=+g[(c[m>>2]|0)+(j<<2)>>2]*+(c[(c[k>>2]|0)+(j<<2)>>2]|0);if(!(p>=+h[e+(j<<3)>>3])){i=i+n;break}else {i=i+-n;break}}while(0);j=j+1|0;}j=w+(o<<3)|0;p=+h[j>>3];if(i!=p?+B(+(1.0-i/p))>1.0e-05:0){h[j>>3]=i;a=0;}o=o+1|0;}q=q+1|0;}a:do if((t|0)==42){i=1.0/r;a=0;while(1){if((a|0)>=(b|0)){a=0;break a}y=d+(a<<3)|0;h[y>>3]=+h[y>>3]*i;y=e+(a<<3)|0;h[y>>3]=+h[y>>3]*i;a=a+1|0;}}while(0);U1(c[u>>2]|0);U1(u);U1(c[v>>2]|0);U1(v);U1(s);U1(w);l=x;return a|0}function Ru(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0;c=0;d=0.0;while(1){if((c|0)>=(b|0))break;e=+h[a+(c<<3)>>3]+d;c=c+1|0;d=e;}d=d/+(b|0);c=0;while(1){if((c|0)>=(b|0))break;f=a+(c<<3)|0;h[f>>3]=+h[f>>3]-d;c=c+1|0;}f=b+-1|0;Bt(a,0,f,1.0/+At(a,0,f),a);return}function Su(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0;k=Tu(f,a)|0;l=KK(8)|0;if(!e){f=0;j=0;}else {g=KK(a<<3)|0;f=0;while(1){if((f|0)>=(a|0))break;h[g+(f<<3)>>3]=+h[e+(f<<3)>>3];f=f+1|0;}Ru(g,a);f=g;j=g;}Uu(k,a,b,l,f,d);e=0;while(1){if((e|0)==1)break;g=l+(e<<3)|0;i=b+(e<<2)|0;f=0;while(1){if((f|0)>=(a|0))break;d=+C(+(+B(+(+h[g>>3]))));m=(c[i>>2]|0)+(f<<3)|0;h[m>>3]=+h[m>>3]*d;f=f+1|0;}e=e+1|0;}U1(c[k>>2]|0);U1(k);U1(l);U1(j);return}function Tu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0.0;o=l;l=l+16|0;f=o;n=b<<2;e=KK(O(n,b)|0)|0;n=KK(n)|0;d=0;while(1){if((d|0)>=(b|0))break;c[n+(d<<2)>>2]=e+((O(d,b)|0)<<2);d=d+1|0;}m=Wu(a,b,f)|0;h=+g[f>>2];e=0;k=1;while(1){if((e|0)>=(b|0))break;f=a+(e<<2)|0;i=m+(e<<2)|0;j=n+(e<<2)|0;d=0;while(1){if((d|0)==(k|0))break;p=+(c[(c[f>>2]|0)+(d<<2)>>2]|0);p=+g[m+(d<<2)>>2]+ +g[i>>2]-p*p-h;g[(c[j>>2]|0)+(d<<2)>>2]=p;g[(c[n+(d<<2)>>2]|0)+(e<<2)>>2]=p;d=d+1|0;}e=e+1|0;k=k+1|0;}U1(m);l=o;return n|0}function Uu(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0;r=b<<3;q=KK(r)|0;r=KK(r)|0;n=1.0-g;o=(b|0)<1?b:1;p=b+-1|0;k=(f|0)==0;j=0;a:while(1){if((j|0)>=(o|0))break;l=c[d+(j<<2)>>2]|0;do{i=0;while(1){if((i|0)==(b|0))break;h[l+(i<<3)>>3]=+((x5()|0)%100|0|0);i=i+1|0;}if(k)i=0;else {zt(l,0,p,-+yt(f,0,p,l),f);i=0;}while(1){if((i|0)==(j|0))break;s=d+(i<<2)|0;m=-+yt(c[s>>2]|0,0,p,l);zt(l,0,p,m,c[s>>2]|0);i=i+1|0;}g=+At(l,0,p);}while(g<1.0e-10);Bt(l,0,p,1.0/g,l);do{Ct(r,0,p,l);Vu(a,b,b,l,q,f);Ct(l,0,p,q);i=0;while(1){if((i|0)==(j|0))break;s=d+(i<<2)|0;m=-+yt(c[s>>2]|0,0,p,l);zt(l,0,p,m,c[s>>2]|0);i=i+1|0;}g=+At(l,0,p);if(g<1.0e-10)break a;Bt(l,0,p,1.0/g,l);m=+yt(l,0,p,r);}while(+B(+m)>3]=m*g;j=j+1|0;}while(1){if((j|0)>=(o|0))break;k=c[d+(j<<2)>>2]|0;i=0;while(1){if((i|0)>=(b|0)){i=0;break}h[k+(i<<3)>>3]=+((x5()|0)%100|0|0);i=i+1|0;}while(1){if((i|0)>=(j|0))break;s=d+(i<<2)|0;n=-+yt(c[s>>2]|0,0,p,k);zt(k,0,p,n,c[s>>2]|0);i=i+1|0;}Bt(k,0,p,1.0/+At(k,0,p),k);h[e+(j<<3)>>3]=0.0;j=j+1|0;}l=o+-1|0;j=0;while(1){if((j|0)>=(l|0))break;a=e+(j<<3)|0;f=j+1|0;g=+h[a>>3];i=j;k=f;while(1){if((k|0)>=(o|0))break;n=+h[e+(k<<3)>>3];s=g>2]|0);s=d+(i<<2)|0;Ct(c[b>>2]|0,0,p,c[s>>2]|0);Ct(c[s>>2]|0,0,p,q);h[e+(i<<3)>>3]=+h[a>>3];h[a>>3]=g;j=f;}U1(q);U1(r);return}function Vu(a,b,d,e,f,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;i=i|0;var j=0,k=0.0,l=0,m=0;j=0;while(1){if((j|0)>=(b|0))break;m=a+(j<<2)|0;k=0.0;l=0;while(1){if((l|0)>=(d|0))break;k=+h[e+(l<<3)>>3]*+g[(c[m>>2]|0)+(l<<2)>>2]+k;l=l+1|0;}h[f+(j<<3)>>3]=k;j=j+1|0;}j=b+-1|0;if(i|0)zt(f,0,j,-+yt(f,0,j,i),i);return}function Wu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0,j=0,k=0.0,l=0,m=0.0;j=KK(b<<2)|0;k=1.0/+(b|0);e=0.0;i=0;while(1){if((i|0)>=(b|0))break;l=a+(i<<2)|0;f=0.0;h=0;while(1){if((h|0)==(b|0))break;m=+(c[(c[l>>2]|0)+(h<<2)>>2]|0);m=m*m;f=m+f;h=h+1|0;e=m+e;}g[j+(i<<2)>>2]=k*f;i=i+1|0;}g[d>>2]=e/+(O(b,b)|0);return j|0}function Xu(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0;q=O(d,d)|0;r=KK(q<<3)|0;s=KK(d<<3)|0;e=0;while(1){if((e|0)>=(d|0))break;h[s+(e<<3)>>3]=+h[c+(e<<3)>>3];e=e+1|0;}e=0;while(1){if((e|0)>=(q|0))break;h[r+(e<<3)>>3]=+h[a+(e<<3)>>3];e=e+1|0;}p=d+-1|0;g=0;o=0;a:while(1){if((o|0)<(p|0)){f=0.0;e=o;}else {l=21;break}while(1){if((e|0)>=(d|0))break;t=+B(+(+h[a+((O(e,d)|0)+o<<3)>>3]));m=t=(d|0))break;l=a+(e+i<<3)|0;t=+h[l>>3];m=a+(e+n<<3)|0;h[l>>3]=+h[m>>3];h[m>>3]=t;e=e+1|0;}m=c+(g<<3)|0;t=+h[m>>3];j=c+(o<<3)|0;h[m>>3]=+h[j>>3];h[j>>3]=t;m=o+1|0;k=a+(n+o<<3)|0;e=m;while(1){if((e|0)>=(d|0)){o=m;continue a}l=O(e,d)|0;f=+h[a+(l+o<<3)>>3]/+h[k>>3];i=c+(e<<3)|0;h[i>>3]=+h[i>>3]-+h[j>>3]*f;i=0;while(1){if((i|0)>=(d|0))break;u=a+(i+l<<3)|0;h[u>>3]=+h[u>>3]-+h[a+(i+n<<3)>>3]*f;i=i+1|0;}e=e+1|0;}}if((l|0)==21){f=+h[a+(q+-1<<3)>>3];if(+B(+f)<1.0e-10)l=33;else {h[b+(p<<3)>>3]=+h[c+(p<<3)>>3]/f;e=0;while(1){if((e|0)>=(p|0)){e=0;break}g=d-e|0;i=g+-2|0;f=+h[c+(i<<3)>>3];j=b+(i<<3)|0;h[j>>3]=f;k=O(i,d)|0;g=g+-1|0;while(1){if((g|0)>=(d|0))break;t=f-+h[b+(g<<3)>>3]*+h[a+(g+k<<3)>>3];h[j>>3]=t;g=g+1|0;f=t;}h[j>>3]=f/+h[a+(k+i<<3)>>3];e=e+1|0;}while(1){if((e|0)>=(d|0)){e=0;break}h[c+(e<<3)>>3]=+h[s+(e<<3)>>3];e=e+1|0;}while(1){if((e|0)>=(q|0))break;h[a+(e<<3)>>3]=+h[r+(e<<3)>>3];e=e+1|0;}U1(r);U1(s);}}if((l|0)==33){B6(93989)|0;U1(r);U1(s);}return}function Yu(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;s=l;l=l+16|0;r=s;ms();Ku();Hs();c[46918]=jb[d&3]()|0;Js();q=r+8|0;p=jb[d&3]()|0;e=0.0;f=0.0;a:while(1){n=(p|0)==0;o=p+8|0;while(1){if(!(Ds()|0)){Es(r);e=+h[r>>3];f=+h[q>>3];}if(!n){if(Ds()|0)break;g=+h[o>>3];if(g>3]>2]|0;Nu(j);qs(c[t+8>>2]|0,a[t+16>>0]|0,j);qs(c[v+8>>2]|0,a[v+16>>0]|0,j);Qs(t);Cs(v);Qs(v);v=+h[m+8>>3]>+h[u+8>>3];t=v&1;k=v?u:m;u=ns(k,v?m:u)|0;m=Ks(u,t)|0;Ns(b,m);qs(u,(t^1)&255,j);Ou(j);j=Ls(b,m)|0;if(j|0){Cs(b);As(b,j,+Mu(j,k));}b=Ls(m,i)|0;if(!b)continue;As(m,b,+Mu(b,k));}b=Os(p)|0;k=Rs(b)|0;i=ns(Us(b)|0,p)|0;m=Ks(i,0)|0;Ns(b,m);j=Ls(b,m)|0;if(j|0){Cs(b);As(b,j,+Mu(j,p));}i=Ks(i,1)|0;Ns(m,i);b=Ls(i,k)|0;if(b|0)As(i,b,+Mu(b,p));p=jb[d&3]()|0;}b=c[46860]|0;while(1){b=Rs(b)|0;if((b|0)==(c[46861]|0))break;os(c[b+8>>2]|0);}l=s;return}function Zu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=l;l=l+16|0;f=g+8|0;e=g;do if((tB(a)|0)!=1){_u(a);if(!b)b=$u(a)|0;d=av(a,b)|0;if(0);if((d|0)<0){gA(1,94039,f)|0;break}else {bv(a);cv(a,b);dv(a,b);ev(a,d);break}}else {h=c[(c[(jC(a)|0)+16>>2]|0)+132>>2]|0;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;}while(0);l=g;return b|0}function _u(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=tB(a)|0;d=O(d,d)|0;b=jC(a)|0;while(1){if(!b)break;e=b+16|0;f=c[(c[e>>2]|0)+112>>2]|0;g=f+24|0;c[g>>2]=d;c[g+4>>2]=0;h[f+48>>3]=10.0;f=(mv(a,b)|0)==0;e=c[(c[e>>2]|0)+112>>2]|0;c[e>>2]=f?d:0;c[e+4>>2]=f?0:0;b=kC(a,b)|0;}return}function $u(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=(tB(a)|0)<3;b=jC(a)|0;a:do if(!e){while(1){if(!b)break;e=c[(c[b+16>>2]|0)+112>>2]|0;if((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)lv(a,b,0);b=kC(a,b)|0;}d=0;b=0;e=jC(a)|0;while(1){if(!e)break a;h=c[(c[e+16>>2]|0)+112>>2]|0;g=c[h>>2]|0;h=c[h+4>>2]|0;f=((d|0)<0)<<31>>31;f=h>>>0>f>>>0|(h|0)==(f|0)&g>>>0>d>>>0;d=f?g:d;b=f?e:b;e=kC(a,e)|0;}}while(0);return b|0}function av(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[(c[b+16>>2]|0)+112>>2]|0;f=d+24|0;e=c[f>>2]|0;c[f>>2]=0;c[f+4>>2]=0;c[d+32>>2]=0;iv(a,b);d=jC(a)|0;e=P6(0,e|0,32)|0;f=z;b=0;while(1){if(!d)break;h=(c[(c[d+16>>2]|0)+112>>2]|0)+24|0;g=c[h>>2]|0;h=c[h+4>>2]|0;if((g|0)==(e|0)&(h|0)==(f|0)){b=-1;break}i=((b|0)<0)<<31>>31;b=h>>>0>i>>>0|(h|0)==(i|0)&g>>>0>b>>>0?g:b;d=kC(a,d)|0;}return b|0}function bv(a){a=a|0;var b=0,d=0,e=0,f=0;d=jC(a)|0;while(1){if(!d)break;b=c[(c[d+16>>2]|0)+112>>2]|0;e=b+16|0;a:do if((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)while(1){e=b+8|0;f=e;f=J6(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;c[e>>2]=f;c[e+4>>2]=z;b=c[b+32>>2]|0;if(!b)break a;b=c[(c[b+16>>2]|0)+112>>2]|0;}while(0);d=kC(a,d)|0;}return}function cv(a,b){a=a|0;b=b|0;h[(c[(c[b+16>>2]|0)+112>>2]|0)+40>>3]=6.283185307179586;hv(a,b);return}function dv(a,b){a=a|0;b=b|0;h[(c[(c[b+16>>2]|0)+112>>2]|0)+48>>3]=0.0;gv(a,b);return}function ev(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0.0,k=0.0;i=l;l=l+16|0;f=i;g=fv(a,b)|0;if(0);d=jC(a)|0;while(1){if(!d)break;f=c[d+16>>2]|0;e=c[f+112>>2]|0;j=+h[g+(c[e+24>>2]<<3)>>3];e=e+48|0;k=+E(+(+h[e>>3]))*j;f=c[f+132>>2]|0;h[f>>3]=k;h[f+8>>3]=+F(+(+h[e>>3]))*j;d=kC(a,d)|0;}U1(g);l=i;return}function fv(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,g=0,i=0.0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;m=JK((d<<3)+8|0)|0;b=aP(b,GA(c[b+60>>2]|0,0,101288,0)|0,0)|0;a:do if(!b){f=1.0;e=0.0;b=1;}else {i=0.0;e=0.0;g=1;b:while(1){if((g|0)>(d|0)){f=i;b=g;break a}f=+s5(b,k);if(!(f>0.0)){f=i;b=g;break a}i=f>.02?f:.02;e=i+e;j=g+1|0;h[m+(g<<3)>>3]=e;b=c[k>>2]|0;while(1){g=a[b>>0]|0;if(!(g<<24>>24)){g=j;continue b}if(!(g<<24>>24==58|(S2(g<<24>>24)|0)!=0)){g=j;continue b}b=b+1|0;}}}while(0);while(1){if((b|0)>(d|0))break;i=e+f;h[m+(b<<3)>>3]=i;b=b+1|0;e=i;}l=n;return m|0}function gv(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,g=0,i=0,j=0.0;d=c[(c[b+16>>2]|0)+112>>2]|0;if(!(c[d+32>>2]|0))e=0.0;else e=+h[d+48>>3]-+h[d+40>>3]*.5;g=aB(a,b)|0;while(1){if(!g)break;d=c[g>>2]&3;f=c[((d|0)==3?g:g+48|0)+40>>2]|0;if((f|0)==(b|0))f=c[((d|0)==2?g:g+-48|0)+40>>2]|0;d=c[(c[f+16>>2]|0)+112>>2]|0;if((c[d+32>>2]|0)==(b|0)?(i=d+48|0,!(+h[i>>3]!=10.0)):0){j=+h[d+40>>3];h[i>>3]=j*.5+e;e=j+e;d=d+16|0;if(!((c[d>>2]|0)==0&(c[d+4>>2]|0)==0))gv(a,f);}g=bB(a,g,b)|0;}return}function hv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0.0,i=0,j=0;e=c[(c[b+16>>2]|0)+112>>2]|0;f=e+8|0;g=+h[e+40>>3]/(+((c[f>>2]|0)>>>0)+4294967296.0*+((c[f+4>>2]|0)>>>0));f=aB(a,b)|0;while(1){if(!f)break;e=c[f>>2]&3;d=c[((e|0)==3?f:f+48|0)+40>>2]|0;if((d|0)==(b|0))d=c[((e|0)==2?f:f+-48|0)+40>>2]|0;e=c[(c[d+16>>2]|0)+112>>2]|0;if(((c[e+32>>2]|0)==(b|0)?(i=e+40|0,!(+h[i>>3]!=0.0)):0)?(j=e+8|0,h[i>>3]=g*(+((c[j>>2]|0)>>>0)+4294967296.0*+((c[j+4>>2]|0)>>>0)),e=e+16|0,!((c[e>>2]|0)==0&(c[e+4>>2]|0)==0)):0)hv(a,d);f=bB(a,f,b)|0;}return}function iv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0;p=l;l=l+16|0;n=p;o=GA(b,2,101541,0)|0;c[n+4>>2]=0;c[n>>2]=0;jv(n,d);j=(o|0)==0;a:while(1){k=kv(n)|0;if(!k)break;m=k+16|0;h=c[(c[(c[m>>2]|0)+112>>2]|0)+24>>2]|0;g=aB(b,k)|0;h=J6(0,h|0,0,1)|0;h=P6(h|0,z|0,32)|0;i=z;while(1){if(!g)continue a;if(!((!j?(a[(RA(g,o)|0)>>0]|0)==48:0)?!(s2(RA(g,o)|0,138394)|0):0)){d=c[g>>2]&3;e=c[((d|0)==3?g:g+48|0)+40>>2]|0;if((e|0)==(k|0))e=c[((d|0)==2?g:g+-48|0)+40>>2]|0;d=c[(c[e+16>>2]|0)+112>>2]|0;f=d+24|0;q=f;r=c[q+4>>2]|0;if(i>>>0>>0|((i|0)==(r|0)?h>>>0<(c[q>>2]|0)>>>0:0)){r=f;c[r>>2]=h;c[r+4>>2]=i;c[d+32>>2]=k;r=(c[(c[m>>2]|0)+112>>2]|0)+16|0;q=r;q=J6(c[q>>2]|0,c[q+4>>2]|0,1,0)|0;c[r>>2]=q;c[r+4>>2]=z;jv(n,e);}}g=bB(b,g,k)|0;}}l=p;return}function jv(a,b){a=a|0;b=b|0;var d=0,e=0;d=JK(8)|0;c[d>>2]=b;b=a+4|0;e=c[b>>2]|0;c[((e|0)==0?a:e+4|0)>>2]=d;c[b>>2]=d;return}function kv(a){a=a|0;var b=0,d=0;d=c[a>>2]|0;if(d){b=c[d>>2]|0;c[a>>2]=c[d+4>>2];U1(d);if(!(c[a>>2]|0))c[a+4>>2]=0;}else b=0;return b|0}function lv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=c[c[(c[b+16>>2]|0)+112>>2]>>2]|0;g=aB(a,b)|0;h=J6(0,h|0,0,1)|0;h=P6(h|0,z|0,32)|0;i=z;while(1){if(!g)break;f=c[g>>2]&3;e=c[((f|0)==3?g:g+48|0)+40>>2]|0;if((e|0)==(b|0))e=c[((f|0)==2?g:g+-48|0)+40>>2]|0;if((e|0)!=(d|0)?(j=c[(c[e+16>>2]|0)+112>>2]|0,f=j,k=c[f+4>>2]|0,i>>>0>>0|((i|0)==(k|0)?h>>>0<(c[f>>2]|0)>>>0:0)):0){k=j;c[k>>2]=h;c[k+4>>2]=i;lv(a,e,b);}g=bB(a,g,b)|0;}return}function mv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=0;g=aB(a,b)|0;while(1){if(!g){d=1;break}e=c[g>>2]&3;d=c[((e|0)==3?g:g+48|0)+40>>2]|0;if((d|0)==(b|0))d=c[((e|0)==2?g:g+-48|0)+40>>2]|0;if((d|0)!=(b|0)){if(f)if((f|0)==(d|0))d=f;else {d=0;break}}else d=f;f=d;g=bB(a,g,b)|0;}return d|0}function nv(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0;b=l;l=l+32|0;e=b;d=GA(a,1,94122,0)|0;g=GA(a,0,94122,0)|0;a=ov(a,g,d,GA(a,0,94127,0)|0)|0;d=a+16|0;f=+C(+(+h[a>>3]+.1));zv(e,0.0,0.0,f,f);c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];c[d+16>>2]=c[e+16>>2];c[d+20>>2]=c[e+20>>2];c[d+24>>2]=c[e+24>>2];c[d+28>>2]=c[e+28>>2];pv(a);qv(a);rv(a);l=b;return}function ov(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=JK(72)|0;c[o+60>>2]=0;c[o+56>>2]=a;k=a+16|0;f=0.0;l=0;i=1;j=0;m=0;while(1){g=c[k>>2]|0;if((i|0)>(c[g+180>>2]|0))break;g=ov(c[(c[g+184>>2]|0)+(i<<2)>>2]|0,b,d,e)|0;f=+h[g>>3]+f;if(j|0)c[j+52>>2]=g;l=l+1|0;i=i+1|0;j=g;m=(m|0)==0?g:m;}n=jC(a)|0;g=m;while(1){if(!n)break;i=n+16|0;if(!(c[c[(c[i>>2]|0)+112>>2]>>2]|0)){k=uv(n,d)|0;f=+h[k>>3]+f;if(j|0)c[j+52>>2]=k;c[c[(c[i>>2]|0)+112>>2]>>2]=a;i=l+1|0;j=k;g=(g|0)==0?k:g;}else i=l;n=kC(a,n)|0;l=i;}c[o+64>>2]=l;if(!l)f=+wv(a,b);else {h[o+8>>3]=f;f=+vv(o,e);}h[o>>3]=f;c[o+48>>2]=g;return o|0}function pv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0;p=l;l=l+176|0;f=p+144|0;n=p+64|0;k=p+32|0;i=p;o=c[a+64>>2]|0;a:do if(o|0){m=JK(o<<2)|0;b=a+48|0;e=0;d=b;while(1){d=c[d>>2]|0;if((e|0)>=(o|0))break;c[m+(e<<2)>>2]=d;e=e+1|0;d=d+52|0;}o4(m,o,4,80);j=JK(o<<3)|0;d=0;while(1){if((d|0)>=(o|0))break;h[j+(d<<3)>>3]=+h[c[m+(d<<2)>>2]>>3];d=d+1|0;}g=+h[a+8>>3];if(+h[a>>3]==g){i=a+16|0;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[f+16>>2]=c[i+16>>2];c[f+20>>2]=c[i+20>>2];c[f+24>>2]=c[i+24>>2];c[f+28>>2]=c[i+28>>2];i=xv(o,j,f)|0;}else {q=+h[a+40>>3];r=+h[a+32>>3];h[i>>3]=+h[a+16>>3];h[i+8>>3]=+h[a+24>>3];s=q-r;g=(r+q-+C(+(g*4.0+s*s)))*.5;h[i+16>>3]=r-g;h[i+24>>3]=q-g;c[f>>2]=c[i>>2];c[f+4>>2]=c[i+4>>2];c[f+8>>2]=c[i+8>>2];c[f+12>>2]=c[i+12>>2];c[f+16>>2]=c[i+16>>2];c[f+20>>2]=c[i+20>>2];c[f+24>>2]=c[i+24>>2];c[f+28>>2]=c[i+28>>2];i=xv(o,j,f)|0;}if(0);e=c[15712]|0;d=0;while(1){if((d|0)>=(o|0))break;k=(c[m+(d<<2)>>2]|0)+16|0;f=i+(d<<5)|0;c[k>>2]=c[f>>2];c[k+4>>2]=c[f+4>>2];c[k+8>>2]=c[f+8>>2];c[k+12>>2]=c[f+12>>2];c[k+16>>2]=c[f+16>>2];c[k+20>>2]=c[f+20>>2];c[k+24>>2]=c[f+24>>2];c[k+28>>2]=c[f+28>>2];if(0);d=d+1|0;}U1(m);U1(j);U1(i);d=0;while(1){b=c[b>>2]|0;if((d|0)>=(o|0))break a;if(!(c[b+60>>2]|0))pv(b);b=b+52|0;d=d+1|0;}}while(0);l=p;return}function qv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,j=0,k=0.0,m=0.0;f=l;l=l+48|0;e=f;if(c[a+60>>2]|0){k=+h[a+24>>3];i=+h[a+32>>3];g=+h[a+40>>3];b=c[a+56>>2]|0;d=b+16|0;j=c[d>>2]|0;h[j+16>>3]=+h[a+16>>3];h[j+24>>3]=k;a=c[d>>2]|0;h[a+32>>3]=i*.013888888888888888;h[a+40>>3]=g*.013888888888888888;qQ(b,c[(c[(xC(b)|0)+16>>2]|0)+116>>2]&1);sv(b);if(0);}else {b=a+48|0;while(1){b=c[b>>2]|0;if(!b)break;qv(b);b=b+52|0;}i=+h[a+32>>3];m=+h[a+40>>3];g=+h[a+16>>3]-i*.5;k=+h[a+24>>3]-m*.5;j=c[(c[a+56>>2]|0)+16>>2]|0;h[j+16>>3]=g;h[j+24>>3]=k;h[j+32>>3]=g+i;h[j+40>>3]=k+m;}l=f;return}function rv(a){a=a|0;var b=0,d=0,e=0;e=c[a+64>>2]|0;b=a+48|0;d=0;while(1){b=c[b>>2]|0;if((d|0)>=(e|0))break;rv(b);b=b+52|0;d=d+1|0;}U1(a);return}function sv(b){b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g;d=g+8|0;e=c[47150]|0;if(e|0?(a[(RA(b,e)|0)>>0]|0)==0:0){h[f>>3]=+h[(c[b+16>>2]|0)+80>>3]*.7;m4(d,94168,f)|0;KA(b,c[47150]|0,d)|0;}sP(b);l=g;return}function tv(a,b){a=a|0;b=b|0;var d=0.0;d=+h[c[a>>2]>>3]-+h[c[b>>2]>>3];return (d<0.0?1:(d>0.0)<<31>>31)|0}function uv(a,b){a=a|0;b=b|0;var d=0;d=JK(72)|0;h[d>>3]=+wv(a,b);c[d+60>>2]=1;c[d+56>>2]=a;return d|0}function vv(a,b){a=a|0;b=b|0;var d=0.0;d=+_O(c[a+56>>2]|0,b,0.0,0.0);if(d==0.0)d=+h[a+8>>3];else {d=+C(+(+h[a+8>>3]))+d*2.0;d=d*d;}return +d}function wv(a,b){a=a|0;b=b|0;var c=0.0;c=+_O(a,b,1.0,0.0);return +(c==0.0?1.0e3:c*1.0e3)}function xv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0,i=0,j=0.0;i=l;l=l+32|0;g=i;e=0;f=0.0;while(1){if((e|0)>=(a|0))break;j=+h[b+(e<<3)>>3]+f;e=e+1|0;f=j;}if(f>+h[d+24>>3]*+h[d+16>>3]+.001)e=0;else {e=JK(a<<5)|0;c[g>>2]=c[d>>2];c[g+4>>2]=c[d+4>>2];c[g+8>>2]=c[d+8>>2];c[g+12>>2]=c[d+12>>2];c[g+16>>2]=c[d+16>>2];c[g+20>>2]=c[d+20>>2];c[g+24>>2]=c[d+24>>2];c[g+28>>2]=c[d+28>>2];yv(a,b,e,0,0.0,1.0,0.0,1.0,g);}l=i;return e|0}function yv(a,b,d,e,f,g,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=+i;j=+j;k=k|0;var m=0,n=0.0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0,x=0,y=0,z=0,A=0,B=0.0;z=l;l=l+112|0;y=z+72|0;u=z+40|0;p=z+32|0;m=z;w=k+16|0;q=+h[w>>3];x=k+24|0;r=+h[x>>3];v=+h[k+16+((!(q>3];do if((a|0)>=1){if(0);if(!e){i=+h[b>>3];B=v*v;v=i/B;B=B/i;c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a,b,d,1,i,i,i,v>B?v:B,y);break}if((a|0)>(e|0)?(t=+h[b+(e<<3)>>3],n=tg?g:t,t=t+i,o=t/v,o=o*o,B=o/s,o=n/o,o=B>o?B:o,o<=j):0){c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a,b,d,e+1|0,n,s,t,o,y);break}q=i/v;if(0);n=+h[w>>3];if(v==n){o=1.0/q;p=k+8|0;n=+h[k>>3]-n*.5;m=0;while(1){if((m|0)>=(e|0))break;h[d+(m<<5)+24>>3]=q;B=+h[b+(m<<3)>>3]*o;h[d+(m<<5)+16>>3]=B;h[d+(m<<5)+8>>3]=(+h[x>>3]-q)*.5+ +h[p>>3];h[d+(m<<5)>>3]=B*.5+n;n=B+n;m=m+1|0;}h[p>>3]=+h[p>>3]-q*.5;m=1;}else {o=1.0/q;n=+h[x>>3]*.5+ +h[k+8>>3];m=0;while(1){if((m|0)>=(e|0))break;h[d+(m<<5)+16>>3]=q;B=+h[b+(m<<3)>>3]*o;h[d+(m<<5)+24>>3]=B;h[d+(m<<5)>>3]=(q-+h[w>>3])*.5+ +h[k>>3];h[d+(m<<5)+8>>3]=n-B*.5;n=n-B;m=m+1|0;}h[k>>3]=+h[k>>3]+q*.5;m=0;}A=k+16+(m<<3)|0;h[A>>3]=+h[A>>3]-q;c[y>>2]=c[k>>2];c[y+4>>2]=c[k+4>>2];c[y+8>>2]=c[k+8>>2];c[y+12>>2]=c[k+12>>2];c[y+16>>2]=c[k+16>>2];c[y+20>>2]=c[k+20>>2];c[y+24>>2]=c[k+24>>2];c[y+28>>2]=c[k+28>>2];yv(a-e|0,b+(e<<3)|0,d+(e<<5)|0,0,0.0,0.0,0.0,1.0,y);}while(0);l=z;return}function zv(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;h[a>>3]=b;h[a+8>>3]=c;h[a+16>>3]=d;h[a+24>>3]=e;return}function Av(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,i=0,j=0,k=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;D=l;l=l+96|0;C=D+48|0;B=D+24|0;A=D+16|0;z=D+8|0;u=D+80|0;v=D;w=a+16|0;x=d+4|0;y=u+4|0;s=jC(a)|0;e=0;f=0;i=0;j=0;while(1){if(!s)break;t=XA(a,s)|0;q=e;r=j;while(1){if(!t)break;e=(b[(c[t+16>>2]|0)+168>>1]|0)==0;do if((s|0)==(c[((c[t>>2]&3|0)==2?t:t+-48|0)+40>>2]|0))if(e){j=q;e=r;}else {if(!f){e=JK(96)|0;c[e+84>>2]=JK(((tB(a)|0)<<5)+11520|0)|0;f=e;}else e=r;Km(f,t,c[(c[w>>2]|0)+248>>2]|0);j=q;}else if(!e){i=Bv(t,d)|0;j=i+8|0;if(lt(c[j>>2]|0,c[i>>2]|0)|0){k=JX(c[j>>2]|0,c[i>>2]|0)|0;if(!k){gA(0,94352,z)|0;j=1;e=r;break}else e=t;while(1){if(!e)break;E=e+16|0;F=(c[E>>2]|0)+144|0;Qm(v,e,k,0,c[j>>2]|0,c[i>>2]|0);H=v;G=c[H+4>>2]|0;c[F>>2]=c[H>>2];c[F+4>>2]=G;Sm(a,e,c[j>>2]|0,c[i>>2]|0,0);e=c[(c[E>>2]|0)+172>>2]|0;}Cv(i);j=q;e=r;break}if(!q){lr(u,a);e=lH(a,8,8)|0;gA(0,94436,A)|0;n=+(e|0);o=+g[d>>2];p=+g[x>>2];if(!(o>=n)&!(p>=n)){m=+g[u>>2];n=+g[y>>2];if(!(!(m<=o)&!(n<=p))){h[C>>3]=m;h[C+8>>3]=n;h[C+16>>3]=o;h[C+24>>3]=p;gA(3,94552,C)|0;}}else {c[B>>2]=e;h[B+8>>3]=o;h[B+16>>3]=p;gA(3,94502,B)|0;}j=1;e=r;}else {j=q;e=r;}}else {j=q;e=r;}while(0);t=ZA(a,t)|0;q=j;r=e;}s=kC(a,s)|0;e=q;j=r;}Dv(i);if(f|0){U1(c[f+84>>2]|0);U1(j);}l=D;return e|0}function Bv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+16|0;m=p+4|0;n=p;e=c[b>>2]&3;f=c[((e|0)==2?b:b+-48|0)+40>>2]|0;e=c[((e|0)==3?b:b+48|0)+40>>2]|0;q=f+16|0;h=c[(c[q>>2]|0)+212>>2]|0;c[m>>2]=h;i=e+16|0;g=c[(c[i>>2]|0)+212>>2]|0;c[n>>2]=g;k=JK(12)|0;b=h;j=g;if(a[(c[q>>2]|0)+118>>0]|0){b=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2]|0;c[m>>2]=b;f=h;h=b;}if(!(a[(c[i>>2]|0)+118>>0]|0))i=j;else {i=c[(c[(c[j+16>>2]|0)+140>>2]|0)+48>>2]|0;c[n>>2]=i;e=g;g=i;}h=c[(c[(c[h+16>>2]|0)+140>>2]|0)+44>>2]|0;g=c[(c[(c[g+16>>2]|0)+140>>2]|0)+44>>2]|0;if((h|0)<=(g|0))if((g|0)>(h|0)){Ev(k,g,e,h,n,d);b=c[n>>2]|0;g=b;e=n;o=11;}else h=i;else {Ev(k,h,f,g,m,d);b=c[m>>2]|0;f=b;g=e;e=m;o=11;}while(1){if((o|0)==11){c[e>>2]=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2];e=g;b=c[m>>2]|0;h=c[n>>2]|0;}if((b|0)==(h|0))break;Fv(k,b,0,f,d);Fv(k,h,e,0,d);c[m>>2]=c[(c[(c[b+16>>2]|0)+140>>2]|0)+48>>2];f=b;g=h;e=n;b=h;o=11;}Fv(k,h,e,f,d);l=p;return k|0}function Cv(a){a=a|0;c[a>>2]=0;return}function Dv(a){a=a|0;if(a|0){U1(c[a+8>>2]|0);U1(a);}return}function Ev(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=f;while(1){h=c[i>>2]|0;if((b|0)<=(e|0))break;Fv(a,h,d,0,g);b=b+-1|0;i=(c[(c[h+16>>2]|0)+140>>2]|0)+48|0;d=h;}c[f>>2]=d;return}function Fv(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=jC(d)|0;while(1){if(!h)break;i=c[h+16>>2]|0;if(!((h|0)==(f|0)|((h|0)==(e|0)?1:(c[i+212>>2]|0)!=(d|0)))?(a[i+118>>0]|0)==0:0)Gv(b,Nm(h,g,0)|0);h=kC(d,h)|0;}i=d+16|0;d=1;while(1){h=c[i>>2]|0;if((d|0)>(c[h+180>>2]|0))break;h=c[(c[h+184>>2]|0)+(d<<2)>>2]|0;if(!((h|0)==(e|0)|(h|0)==(f|0)))Gv(b,Hv(h,g)|0);d=d+1|0;}return}function Gv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=a+4|0;f=c[e>>2]|0;g=a+8|0;d=c[g>>2]|0;do if((f|0)==(c[a>>2]|0))if(!d){d=KK(400)|0;c[g>>2]=d;c[e>>2]=100;break}else {c[e>>2]=f<<1;d=MK(d,f<<3)|0;c[g>>2]=d;break}while(0);g=c[a>>2]|0;c[a>>2]=g+1;c[d+(g<<2)>>2]=b;return}function Hv(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0.0;m=JK(8)|0;b=c[b+16>>2]|0;e=+h[b+16>>3];l=+h[b+24>>3];f=+h[b+32>>3];k=+h[b+40>>3];c[m+4>>2]=4;b=JK(64)|0;c[m>>2]=b;if(!(a[d+8>>0]|0)){p=+g[d>>2];o=+g[d+4>>2];i=(f+e)*.5*(p+-1.0);n=(k+l)*.5*(o+-1.0);j=e*p-i;i=f*p-i;f=k*o-n;e=l*o-n;}else {i=+g[d>>2];p=+g[d+4>>2];j=e-i;i=f+i;f=k+p;e=l-p;}h[b>>3]=j;h[b+8>>3]=e;h[b+16>>3]=j;h[b+24>>3]=f;h[b+32>>3]=i;h[b+40>>3]=f;h[b+48>>3]=i;h[b+56>>3]=e;return m|0}function Iv(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;o=l;l=l+160|0;n=o+16|0;j=o+8|0;g=o;k=o+24|0;m=JK(tB(b)|0)|0;h=b+16|0;f=c[c[(c[h>>2]|0)+140>>2]>>2]|0;a:do if(!f){g=0;f=0;}else {p=KB(b)|0;i=c[46923]|0;c[g>>2]=p;c[g+4>>2]=i;m4(k,94612,g)|0;i=ND(b,k,1)|0;TC(i,137483,280,1)|0;g=JK(56)|0;c[(c[i+16>>2]|0)+140>>2]=g;c[g>>2]=f;c[g+4>>2]=c[(c[(c[h>>2]|0)+140>>2]|0)+4>>2];while(1){g=c[f+4>>2]|0;if(!g){g=i;f=1;break a}if(!(a[m+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0))Jv(b,g,i,m);f=f+16|0;}}while(0);h=0;i=jC(b)|0;while(1){if(!i)break;p=c[i+16>>2]|0;if((a[m+(c[p+120>>2]|0)>>0]|0)==0?(a[p+119>>0]|0)==3:0){if(!g){p=KB(b)|0;g=(c[46923]|0)+f|0;c[j>>2]=p;c[j+4>>2]=g;m4(k,94612,j)|0;g=ND(b,k,1)|0;TC(g,137483,280,1)|0;p=JK(56)|0;c[(c[g+16>>2]|0)+140>>2]=p;f=f+1|0;}Jv(b,i,g,m);h=1;}i=kC(b,i)|0;}if(g|0)KG(g)|0;g=jC(b)|0;while(1){if(!g)break;if(!(a[m+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0)){j=KB(b)|0;p=(c[46923]|0)+f|0;c[n>>2]=j;c[n+4>>2]=p;m4(k,94620,n)|0;p=ND(b,k,1)|0;TC(p,137483,280,1)|0;j=JK(56)|0;c[(c[p+16>>2]|0)+140>>2]=j;Jv(b,g,p,m);KG(p)|0;f=f+1|0;}g=kC(b,g)|0;}U1(m);c[46923]=(c[46923]|0)+f;if(d|0)c[d>>2]=f;if(e|0)c[e>>2]=h;i=JK((f<<2)+4|0)|0;h=i;g=OD(b)|0;while(1){if(!g)break;c[h>>2]=g;h=h+4|0;g=PD(g)|0;f=f+-1|0;}if(!f){c[h>>2]=0;l=o;return i|0}else qa(94628,94639,134,94646);return 0}function Jv(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a[f+(c[(c[d+16>>2]|0)+120>>2]|0)>>0]=1;oC(e,d,1)|0;i=aB(b,d)|0;while(1){if(!i)break;h=c[i>>2]&3;g=c[((h|0)==3?i:i+48|0)+40>>2]|0;if((g|0)==(d|0))g=c[((h|0)==2?i:i+-48|0)+40>>2]|0;if(!(a[f+(c[(c[g+16>>2]|0)+120>>2]|0)>>0]|0))Jv(b,g,e,f);i=bB(b,i,d)|0;}return}function Kv(a){a=a|0;var b=0;b=KK(24)|0;c[46924]=b;c[b>>2]=Vz(18204,c[4581]|0)|0;c[b+16>>2]=0;c[b+12>>2]=0;c[b+4>>2]=Lv(a)|0;return b|0}function Lv(a){a=a|0;var b=0,d=0;b=KK(16)|0;c[b+12>>2]=0;d=KK(a*20|0)|0;c[b>>2]=d;c[b+8>>2]=d+(a*20|0);c[b+4>>2]=d;return b|0}function Mv(a,b,d){a=a|0;b=b|0;d=d|0;d=Ov(c[46924]|0)|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=0;return d|0}function Nv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;a=(c[b>>2]|0)-(c[d>>2]|0)|0;if(!a)a=(c[b+4>>2]|0)-(c[d+4>>2]|0)|0;return a|0}function Ov(a){a=a|0;var b=0,d=0,e=0,f=0;f=a+8|0;a=c[f>>2]|0;b=c[a+4>>2]|0;if((b|0)==(c[a+8>>2]|0)){d=a+12|0;e=c[d>>2]|0;if(!e){a=Lv(((b-(c[a>>2]|0)|0)/20|0)<<1)|0;c[d>>2]=a;}else a=e;c[f>>2]=a;b=c[a>>2]|0;c[a+4>>2]=b;}c[a+4>>2]=b+20;return b|0}function Pv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+12|0;d=c[f>>2]|0;if((d|0)<(b|0)){e=d<<1;e=(e|0)<(b|0)?b:e;b=a+16|0;d=c[b>>2]|0;if(d|0)U1(d);c[b>>2]=KK(e<<3)|0;c[f>>2]=e;}return}function Qv(a){a=a|0;var b=0;b=c[a>>2]|0;nb[c[b>>2]&63](b,0,64)|0;c[a+20>>2]=c[a+16>>2];b=c[a+4>>2]|0;c[a+8>>2]=b;c[b+4>>2]=c[b>>2];return}function Rv(a){a=a|0;Rz(c[a>>2]|0)|0;Sv(c[a+4>>2]|0);U1(c[a+16>>2]|0);U1(a);return}function Sv(a){a=a|0;var b=0;while(1){if(!a)break;b=c[a+12>>2]|0;U1(c[a>>2]|0);U1(a);a=b;}return}function Tv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;g=l;l=l+32|0;f=g;h=g+12|0;c[h>>2]=b;c[h+4>>2]=d;i=c[a>>2]|0;h=(nb[c[i>>2]&63](i,h,1)|0)+8|0;c[h>>2]=Uv(a,e,c[h>>2]|0)|0;if(0>2);l=g;return}function Uv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=a+20|0;a=c[e>>2]|0;c[e>>2]=a+8;c[a>>2]=b;c[a+4>>2]=d;return a|0}function Vv(a,b){a=a|0;b=b|0;aA(c[a>>2]|0,b,a)|0;return}function Wv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+32|0;f=e;c[f>>2]=b;c[f+4>>2]=d;d=c[a>>2]|0;d=nb[c[d>>2]&63](d,f,4)|0;l=e;return d|0}function Xv(a){a=a|0;U1(c[a+8>>2]|0);U1(a);return}function Yv(a){a=a|0;return +(+h[a>>3])}function Zv(a){a=a|0;return c[a+8>>2]|0}function _v(a){a=a|0;return ~~+h[a+16>>3]|0}function $v(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;b=c[b>>2]|0;if((b|0)>=(c[d>>2]|0)){b=b+10|0;c[d>>2]=b;c[e>>2]=MK(c[e>>2]|0,O(a<<3,b)|0)|0;c[f>>2]=MK(c[f>>2]|0,c[d>>2]<<3)|0;c[g>>2]=MK(c[g>>2]|0,c[d>>2]<<3)|0;}return}function aw(a,b,d,e,f,g,i,j,k,l,m){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0.0;h[l>>3]=+h[l>>3]+1.0;a:do if(a|0){q=c[a+16>>2]|0;n=c[a+40>>2]|0;if(n|0)do{$v(q,f,g,i,j,k);if((_v(zy(n)|0)|0)!=(e|0)){p=Zv(zy(n)|0)|0;o=0;while(1){if((o|0)>=(q|0))break;h[(c[i>>2]|0)+((O(c[f>>2]|0,q)|0)+o<<3)>>3]=+h[p+(o<<3)>>3];o=o+1|0;}r=+Yv(zy(n)|0);h[(c[j>>2]|0)+(c[f>>2]<<3)>>3]=r;r=+$w(d,p,q);p=c[f>>2]|0;h[(c[k>>2]|0)+(p<<3)>>3]=r;c[f>>2]=p+1;}n=Ay(n)|0;}while((n|0)!=0);p=a+36|0;if(c[p>>2]|0){r=+$w(c[a+20>>2]|0,d,q);if(!(+h[a+24>>3]=(o|0))break a;aw(c[(c[p>>2]|0)+(n<<2)>>2]|0,b,d,e,f,g,i,j,k,l,m);n=n+1|0;}}$v(q,f,g,i,j,k);o=a+32|0;n=0;while(1){if((n|0)>=(q|0))break;h[(c[i>>2]|0)+((O(c[f>>2]|0,q)|0)+n<<3)>>3]=+h[(c[o>>2]|0)+(n<<3)>>3];n=n+1|0;}h[(c[j>>2]|0)+(c[f>>2]<<3)>>3]=+h[a+8>>3];r=+$w(c[o>>2]|0,d,q);j=c[f>>2]|0;h[(c[k>>2]|0)+(j<<3)>>3]=r;c[f>>2]=j+1;}}while(0);return}function bw(a,b,d,e,f,g,i,j,k,l,m){a=a|0;b=+b;d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0;n=c[a+16>>2]|0;h[l>>3]=0.0;c[f>>2]=0;c[m>>2]=0;c[g>>2]=10;if(!(c[i>>2]|0))c[i>>2]=KK(n*80|0)|0;if(!(c[j>>2]|0))c[j>>2]=KK(c[g>>2]<<3)|0;if(!(c[k>>2]|0))c[k>>2]=KK(c[g>>2]<<3)|0;aw(a,b,d,e,f,g,i,j,k,l,m);return}function cw(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=+e;f=+f;g=+g;i=i|0;j=j|0;var k=0,l=0,m=0;m=c[a>>2]|0;l=c[a+16>>2]|0;k=0;while(1){if((k|0)==4)break;h[i+(k<<3)>>3]=0.0;k=k+1|0;}c[j>>2]=0;l=O(l,m)|0;k=0;while(1){if((k|0)>=(l|0))break;h[b+(k<<3)>>3]=0.0;k=k+1|0;}dw(a,a,d,b,e,f,g,i);ew(a,b,i);e=1.0/+(m|0);k=0;while(1){if((k|0)==4)break;m=i+(k<<3)|0;h[m>>3]=+h[m>>3]*e;k=k+1|0;}return}function dw(a,b,d,e,f,g,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;g=+g;i=+i;j=j|0;var k=0,l=0.0,m=0,n=0.0,o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0;a:do if((a|0)!=0&(b|0)!=0){if((c[a>>2]|0)>0?(c[b>>2]|0)>0:0){w=c[a+16>>2]|0;p=c[a+40>>2]|0;v=b+40|0;o=c[v>>2]|0;k=a+32|0;m=b+32|0;r=+$w(c[k>>2]|0,c[m>>2]|0,w);l=+h[a+24>>3];n=+h[b+24>>3];if(n+l>3]=+h[j>>3]+1.0;q=c[k>>2]|0;n=+h[a+8>>3];p=fw(a,w)|0;o=c[m>>2]|0;l=+h[b+8>>3];m=fw(b,w)|0;if(!(r>0.0))qa(94798,94681,191,94764);n=n*i*l;l=+D(+r,+(1.0-g));l=1.0/(g==-1.0?r*r:l);k=0;while(1){if((k|0)>=(w|0))break a;i=n*(+h[q+(k<<3)>>3]-+h[o+(k<<3)>>3])*l;e=p+(k<<3)|0;h[e>>3]=i+ +h[e>>3];e=m+(k<<3)|0;h[e>>3]=+h[e>>3]-i;k=k+1|0;}}m=(p|0)!=0;k=(o|0)!=0;u=(a|0)==(b|0);if(m&k){s=j+8|0;t=g==-1.0;f=1.0-g;m=p;while(1){if(!m)break a;p=Zv(zy(m)|0)|0;r=+Yv(zy(m)|0);q=_v(zy(m)|0)|0;a=gw(e,q,m,w)|0;r=r*i;o=c[v>>2]|0;while(1){if(!o)break;b=Zv(zy(o)|0)|0;l=+Yv(zy(o)|0);k=_v(zy(o)|0)|0;j=gw(e,k,o,w)|0;b:do if(!((q|0)==(k|0)|u&(k|0)<(q|0))){h[s>>3]=+h[s>>3]+1.0;g=+Zw(d,w,q,k);l=r*l;n=+D(+g,+f);n=1.0/(t?g*g:n);k=0;while(1){if((k|0)>=(w|0))break b;g=l*(+h[p+(k<<3)>>3]-+h[b+(k<<3)>>3])*n;x=a+(k<<3)|0;h[x>>3]=g+ +h[x>>3];x=j+(k<<3)|0;h[x>>3]=+h[x>>3]-g;k=k+1|0;}}while(0);o=Ay(o)|0;}m=Ay(m)|0;}}if(u){q=1<=(q|0))break a;p=c[(c[o>>2]|0)+(m<<2)>>2]|0;k=m;while(1){if((k|0)==(q|0))break;dw(p,c[(c[o>>2]|0)+(k<<2)>>2]|0,d,e,f,g,i,j);k=k+1|0;}m=m+1|0;}}if(!(m|!(l>n))){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,b,d,e,f,g,i,j);k=k+1|0;}}if(!(k|!(n>l))){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,a,d,e,f,g,i,j);k=k+1|0;}}if(!m){o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,b,d,e,f,g,i,j);k=k+1|0;}}if(k)qa(138394,94681,273,94764);o=1<=(o|0))break a;dw(c[(c[m>>2]|0)+(k<<2)>>2]|0,a,d,e,f,g,i,j);k=k+1|0;}}qa(94739,94681,175,94764);}while(0);return}function ew(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0;e=c[a+40>>2]|0;m=c[a+16>>2]|0;g=+h[a+8>>3];n=fw(a,m)|0;if(!(g>0.0))qa(94673,94681,289,94692);l=d+16|0;h[l>>3]=+h[l>>3]+1.0;a:do if(!e){l=1<=(l|0))break a;f=c[(c[k>>2]|0)+(a<<2)>>2]|0;if(f|0){if((c[f>>2]|0)<=0)break;j=fw(f,m)|0;i=+h[f+8>>3]*g;e=0;while(1){if((e|0)>=(m|0))break;o=j+(e<<3)|0;h[o>>3]=+h[o>>3]+ +h[n+(e<<3)>>3]*i;e=e+1|0;}ew(f,b,d);}a=a+1|0;}qa(94728,94681,307,94692);}else {i=1.0/g;while(1){if(!e)break a;f=gw(b,_v(zy(e)|0)|0,e,m)|0;g=+Yv(zy(e)|0)*i;a=0;while(1){if((a|0)>=(m|0))break;o=f+(a<<3)|0;h[o>>3]=+h[o>>3]+ +h[n+(a<<3)>>3]*g;a=a+1|0;}e=Ay(e)|0;}}while(0);return}function fw(a,b){a=a|0;b=b|0;var d=0;d=a+48|0;a=c[d>>2]|0;a:do if(!a){a=KK(b<<3)|0;c[d>>2]=a;d=0;while(1){if((d|0)>=(b|0))break a;h[a+(d<<3)>>3]=0.0;d=d+1|0;}}while(0);return a|0}function gw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[(zy(d)|0)+24>>2]|0;if(!f){f=a+((O(e,b)|0)<<3)|0;c[(zy(d)|0)+24>>2]=f;f=c[(zy(d)|0)+24>>2]|0;}return f|0}function hw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0;m=a<<3;k=KK(m)|0;l=KK(m)|0;m=KK(m)|0;if((k|0)!=0&(l|0)!=0&(m|0)!=0){f=0;while(1){if((f|0)>=(a|0)){f=0;break}h[k+(f<<3)>>3]=+h[d+(f<<3)>>3];f=f+1|0;}while(1){if((f|0)>=(a|0)){g=1;break}h[l+(f<<3)>>3]=+h[d+(f<<3)>>3];f=f+1|0;}while(1){if((g|0)>=(b|0))break;j=O(g,a)|0;f=0;while(1){if((f|0)>=(a|0))break;n=k+(f<<3)|0;i=+h[n>>3];p=d+(f+j<<3)|0;o=+h[p>>3];h[n>>3]=i>3];i=+h[p>>3];h[n>>3]=o>i?o:i;f=f+1|0;}g=g+1|0;}i=+h[l>>3]-+h[k>>3];f=0;while(1){if((f|0)>=(a|0))break;p=k+(f<<3)|0;n=l+(f<<3)|0;h[m+(f<<3)>>3]=(+h[n>>3]+ +h[p>>3])*.5;o=+h[n>>3]-+h[p>>3];i=i>o?i:o;f=f+1|0;}f=iw(a,m,i==0.0?5.2e-06:i*.52,c)|0;a:do if(!e){g=0;while(1){if((g|0)>=(b|0))break a;f=jw(f,d+((O(g,a)|0)<<3)|0,1.0,g)|0;g=g+1|0;}}else {g=0;while(1){if((g|0)>=(b|0))break a;p=d+((O(g,a)|0)<<3)|0;f=jw(f,p,+h[e+(g<<3)>>3],g)|0;g=g+1|0;}}while(0);U1(k);U1(l);U1(m);}else {U1(k);U1(l);U1(m);f=0;}return f|0}function iw(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;var f=0,g=0,i=0;g=KK(56)|0;c[g+16>>2]=a;c[g>>2]=0;i=KK(a<<3)|0;c[g+20>>2]=i;f=0;while(1){if((f|0)>=(a|0))break;h[i+(f<<3)>>3]=+h[b+(f<<3)>>3];f=f+1|0;}if(d>0.0){h[g+24>>3]=d;h[g+8>>3]=0.0;c[g+32>>2]=0;c[g+36>>2]=0;c[g+40>>2]=0;c[g+44>>2]=e;c[g+48>>2]=0;return g|0}else qa(94896,94681,410,94906);return 0}function jw(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;if(!a)a=0;else kw(a,b,c,d,0)|0;return a|0}function kw(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=a+16|0;r=c[t>>2]|0;s=c[a+44>>2]|0;m=c[a>>2]|0;do if(!m){c[a>>2]=1;h[a+8>>3]=d;j=KK(r<<3)|0;c[a+32>>2]=j;i=c[t>>2]|0;g=0;while(1){if((g|0)>=(i|0))break;h[j+(g<<3)>>3]=+h[b+(g<<3)>>3];g=g+1|0;}g=lw(i,d,b,e)|0;i=a+40|0;if(!(c[i>>2]|0)){c[i>>2]=wy(g)|0;break}else qa(94807,94681,502,94815);}else {if((s|0)<=(f|0)){if(c[a+36>>2]|0)qa(94881,94681,541,94815);g=m+1|0;c[a>>2]=g;i=a+8|0;h[i>>3]=+h[i>>3]+d;i=a+32|0;k=+(g|0);l=1.0/+(m+2|0);g=0;while(1){if((g|0)>=(r|0))break;q=(c[i>>2]|0)+(g<<3)|0;h[q>>3]=(+h[q>>3]*k+ +h[b+(g<<3)>>3])*l;g=g+1|0;}g=lw(r,d,b,e)|0;i=a+40|0;j=c[i>>2]|0;if(!j)qa(94891,94681,547,94815);else {c[i>>2]=yy(j,g)|0;break}}i=a+8|0;h[i>>3]=+h[i>>3]+d;i=a+32|0;l=+(m|0);k=1.0/+(m+1|0);g=0;while(1){if((g|0)>=(r|0))break;q=(c[i>>2]|0)+(g<<3)|0;h[q>>3]=(+h[q>>3]*l+ +h[b+(g<<3)>>3])*k;g=g+1|0;}q=a+36|0;p=1<>2]|0)){c[q>>2]=KK(p<<2)|0;g=0;while(1){if((g|0)>=(p|0))break a;c[(c[q>>2]|0)+(g<<2)>>2]=0;g=g+1|0;}}while(0);n=a+20|0;g=c[n>>2]|0;j=mw(r,g,b)|0;if(!((j|0)<(p|0)&(j|0)>-1))qa(94837,94681,515,94815);i=c[(c[q>>2]|0)+(j<<2)>>2]|0;if(!i){i=nw(c[t>>2]|0,g,+h[a+24>>3]*.5,s,j)|0;c[(c[q>>2]|0)+(j<<2)>>2]=i;i=c[(c[q>>2]|0)+(j<<2)>>2]|0;}o=f+1|0;e=kw(i,b,d,e,o)|0;c[(c[q>>2]|0)+(j<<2)>>2]=e;if(!(c[(c[q>>2]|0)+(j<<2)>>2]|0))qa(94860,94681,519,94815);b=a+40|0;g=c[b>>2]|0;do if(g|0){m=_v(zy(g)|0)|0;if((c[a>>2]|0)!=1)qa(94871,94681,523,94815);f=Zv(zy(c[b>>2]|0)|0)|0;k=+Yv(zy(c[b>>2]|0)|0);i=c[n>>2]|0;j=mw(r,i,f)|0;if(!((j|0)<(p|0)&(j|0)>-1))qa(94837,94681,527,94815);g=c[(c[q>>2]|0)+(j<<2)>>2]|0;if(!g){g=nw(c[t>>2]|0,i,+h[a+24>>3]*.5,s,j)|0;c[(c[q>>2]|0)+(j<<2)>>2]=g;g=c[(c[q>>2]|0)+(j<<2)>>2]|0;}t=kw(g,f,k,m,o)|0;c[(c[q>>2]|0)+(j<<2)>>2]=t;if(!(c[(c[q>>2]|0)+(j<<2)>>2]|0))qa(94860,94681,532,94815);else {xy(c[b>>2]|0,106);c[b>>2]=0;break}}while(0);c[a>>2]=(c[a>>2]|0)+1;}while(0);return a|0}function lw(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0,g=0;g=KK(32)|0;h[g>>3]=b;f=KK(a<<3)|0;c[g+8>>2]=f;h[g+16>>3]=+(e|0);e=0;while(1){if((e|0)>=(a|0))break;h[f+(e<<3)>>3]=+h[d+(e<<3)>>3];e=e+1|0;}c[g+24>>2]=0;return g|0}function mw(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=0;while(1){d=a+-1|0;if((a|0)<=0)break;a=d;e=e<<1|!(+h[c+(d<<3)>>3]-+h[b+(d<<3)>>3]<0.0)&1;}return e|0}function nw(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var g=0,i=0,j=0.0;g=iw(a,b,d,e)|0;i=c[g+20>>2]|0;j=-d;e=0;b=f;while(1){if((e|0)>=(a|0))break;f=i+(e<<3)|0;h[f>>3]=+h[f>>3]+((b&1|0)==0?j:d);e=e+1|0;b=(b|0)/2|0;}return g|0}function ow(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if(a|0){b=c[a+16>>2]|0;U1(c[a+20>>2]|0);U1(c[a+32>>2]|0);U1(c[a+48>>2]|0);g=a+36|0;e=c[g>>2]|0;if(e|0){f=1<=(f|0))break;ow(c[b+(d<<2)>>2]|0);d=d+1|0;b=c[g>>2]|0;}U1(b);}xy(c[a+40>>2]|0,106);U1(a);}return}function pw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0,s=0,t=0;a:do if(!a)b=0;else {l=c[a+20>>2]|0;m=c[a+24>>2]|0;d=c[a+8>>2]|0;n=c[a>>2]|0;e=c[a+4>>2]|0;i=a+16|0;if((c[a+32>>2]|0)!=1)qa(94919,94943,76,94958);b=rw(e,n,d,c[i>>2]|0,1)|0;c[b+8>>2]=d;o=c[b+20>>2]|0;k=c[b+24>>2]|0;d=0;while(1){if((d|0)>(e|0)){d=0;break}c[o+(d<<2)>>2]=0;d=d+1|0;}b:while(1){if((d|0)>=(n|0)){d=0;break}f=d+1|0;g=l+(f<<2)|0;d=c[l+(d<<2)>>2]|0;while(1){if((d|0)>=(c[g>>2]|0)){d=f;continue b}j=o+((c[m+(d<<2)>>2]|0)+1<<2)|0;c[j>>2]=(c[j>>2]|0)+1;d=d+1|0;}}while(1){if((d|0)>=(e|0))break;j=d+1|0;g=o+(j<<2)|0;c[g>>2]=(c[g>>2]|0)+(c[o+(d<<2)>>2]|0);d=j;}c:do switch(c[i>>2]|0){case 1:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;d:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue d}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;q=+h[g+(d<<3)>>3];r=o+(c[r>>2]<<2)|0;p=c[r>>2]|0;c[r>>2]=p+1;h[a+(p<<3)>>3]=q;d=d+1|0;}}}case 2:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;e:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue e}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;t=d<<1;r=o+(c[r>>2]<<2)|0;p=c[r>>2]|0;s=p<<1;h[a+(s<<3)>>3]=+h[g+(t<<3)>>3];h[a+((s|1)<<3)>>3]=+h[g+((t|1)<<3)>>3];c[r>>2]=p+1;d=d+1|0;}}}case 4:{g=c[a+28>>2]|0;a=c[b+28>>2]|0;f=0;f:while(1){if((f|0)>=(n|0))break c;i=f+1|0;j=l+(i<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[j>>2]|0)){f=i;continue f}r=m+(d<<2)|0;c[k+(c[o+(c[r>>2]<<2)>>2]<<2)>>2]=f;s=c[g+(d<<2)>>2]|0;r=o+(c[r>>2]<<2)|0;t=c[r>>2]|0;c[r>>2]=t+1;c[a+(t<<2)>>2]=s;d=d+1|0;}}}case 8:{f=0;g:while(1){if((f|0)>=(n|0))break c;g=f+1|0;a=l+(g<<2)|0;d=c[l+(f<<2)>>2]|0;while(1){if((d|0)>=(c[a>>2]|0)){f=g;continue g}s=o+(c[m+(d<<2)>>2]<<2)|0;t=c[s>>2]|0;c[s>>2]=t+1;c[k+(t<<2)>>2]=f;d=d+1|0;}}}case 16:{qw(b);b=0;break a}default:{qw(b);b=0;break a}}while(0);while(1){d=e+-1|0;if((e|0)<=0)break;c[o+(e<<2)>>2]=c[o+(d<<2)>>2];e=d;}c[o>>2]=0;}while(0);return b|0}function qw(a){a=a|0;var b=0;if(a|0){b=c[a+20>>2]|0;if(b|0)U1(b);b=c[a+24>>2]|0;if(b|0)U1(b);U1(c[a+28>>2]|0);U1(a);}return}function rw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a=tw(a,b,d,sw(d)|0,e)|0;if((c|0)>0)uw(a,c)|0;return a|0}function sw(a){a=a|0;switch(a|0){case 1:{a=8;break}case 2:{a=16;break}case 4:{a=4;break}case 8:{a=0;break}case 16:{a=0;break}default:a=0;}return a|0}function tw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=KK(44)|0;c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=d;c[g+40>>2]=e;if((f|0)==2)a=0;else a=KK((a<<2)+4|0)|0;c[g+20>>2]=a;c[g+24>>2]=0;c[g+28>>2]=0;c[g+32>>2]=f;c[g+36>>2]=0;return g|0}function uw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=c[a+32>>2]|0;f=a+28|0;c[f>>2]=0;d=b<<2;e=KK(d)|0;if((h|0)!=2){c[a+24>>2]=e;d=c[a+40>>2]|0;if((b|0)!=0&(d|0)>0)g=4;}else {c[a+20>>2]=e;c[a+24>>2]=KK(d)|0;d=c[a+40>>2]|0;g=4;}if((g|0)==4)c[f>>2]=KK(O(d,b)|0)|0;c[a+12>>2]=b;return a|0}function vw(a,b){a=a|0;b=b|0;if(!(ww(a,b)|0)){b=pw(a)|0;if(!b)b=0;else {a=yw(a,b)|0;qw(b);b=a+36|0;c[b>>2]=c[b>>2]|3;b=a;}}else b=xw(a)|0;return b|0}function ww(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0;if(a){if((c[a+32>>2]|0)!=1)qa(94919,94943,187,95074);s=a+36|0;d=c[s>>2]|0;if((d&2|0)==0?(p=(b|0)!=0,(d&1|0)==0|p^1):0)if((c[a>>2]|0)==(c[a+4>>2]|0)?(t=pw(a)|0,(t|0)!=0):0){k=c[a+20>>2]|0;l=c[a+24>>2]|0;m=c[t+20>>2]|0;n=c[t+24>>2]|0;o=c[a>>2]|0;q=KK(o<<2)|0;b=0;while(1){if((b|0)>=(o|0))break;c[q+(b<<2)>>2]=-1;b=b+1|0;}a:do switch((p?8:c[a+16>>2]|0)|0){case 1:{g=c[a+28>>2]|0;i=c[t+28>>2]|0;b=0;while(1){if((b|0)>(o|0)){d=0;break}if((c[k+(b<<2)>>2]|0)==(c[m+(b<<2)>>2]|0))b=b+1|0;else {b=0;break a}}b:while(1){if((d|0)>=(o|0)){r=54;break a}e=k+(d<<2)|0;f=d+1|0;a=k+(f<<2)|0;b=c[e>>2]|0;while(1){if((b|0)>=(c[a>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}b=c[m+(d<<2)>>2]|0;a=c[m+(f<<2)>>2]|0;d=b;while(1){if((d|0)>=(a|0))break;if((c[q+(c[n+(d<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else d=d+1|0;}while(1){if((b|0)>=(a|0)){d=f;continue b}u=+h[i+(b<<3)>>3]-+h[g+(c[q+(c[n+(b<<2)>>2]<<2)>>2]<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}else b=b+1|0;}}}case 2:{i=c[a+28>>2]|0;j=c[t+28>>2]|0;b=0;while(1){if((b|0)>(o|0)){d=0;break}if((c[k+(b<<2)>>2]|0)==(c[m+(b<<2)>>2]|0))b=b+1|0;else {b=0;break a}}c:while(1){if((d|0)>=(o|0)){r=54;break a}f=k+(d<<2)|0;g=d+1|0;a=k+(g<<2)|0;b=c[f>>2]|0;while(1){if((b|0)>=(c[a>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}d=c[m+(d<<2)>>2]|0;e=c[m+(g<<2)>>2]|0;b=d;while(1){if((b|0)>=(e|0)){b=d;break}if((c[q+(c[n+(b<<2)>>2]<<2)>>2]|0)<(c[f>>2]|0)){b=0;break a}else b=b+1|0;}while(1){if((b|0)>=(e|0)){d=g;continue c}d=b<<1;a=c[q+(c[n+(b<<2)>>2]<<2)>>2]<<1;u=+h[j+(d<<3)>>3]-+h[i+(a<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}u=+h[j+((d|1)<<3)>>3]-+h[i+((a|1)<<3)>>3];if((u>=0.0?u:-u)>1.0e-07){b=0;break a}else b=b+1|0;}}}case 4:{f=c[a+28>>2]|0;g=c[t+28>>2]|0;b=0;d:while(1){if((b|0)>=(o|0)){r=54;break a}e=k+(b<<2)|0;i=b+1|0;a=k+(i<<2)|0;d=c[e>>2]|0;while(1){if((d|0)>=(c[a>>2]|0))break;c[q+(c[l+(d<<2)>>2]<<2)>>2]=d;d=d+1|0;}b=c[m+(b<<2)>>2]|0;a=c[m+(i<<2)>>2]|0;d=b;while(1){if((d|0)>=(a|0))break;if((c[q+(c[n+(d<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else d=d+1|0;}while(1){if((b|0)>=(a|0)){b=i;continue d}if((c[g+(b<<2)>>2]|0)==(c[f+(c[q+(c[n+(b<<2)>>2]<<2)>>2]<<2)>>2]|0))b=b+1|0;else {b=0;break a}}}}case 8:{a=0;e:while(1){if((a|0)>=(o|0)){r=54;break a}e=k+(a<<2)|0;f=a+1|0;d=k+(f<<2)|0;b=c[e>>2]|0;while(1){if((b|0)>=(c[d>>2]|0))break;c[q+(c[l+(b<<2)>>2]<<2)>>2]=b;b=b+1|0;}d=c[m+(f<<2)>>2]|0;b=c[m+(a<<2)>>2]|0;while(1){if((b|0)>=(d|0)){a=f;continue e}if((c[q+(c[n+(b<<2)>>2]<<2)>>2]|0)<(c[e>>2]|0)){b=0;break a}else b=b+1|0;}}}default:b=0;}while(0);if((r|0)==54){d=c[s>>2]|0;if(p)b=1;else {c[s>>2]=d|2;b=3;}c[s>>2]=b|d;b=1;}U1(q);qw(t);}else b=0;else b=1;}else b=0;return b|0}function xw(a){a=a|0;var b=0,d=0,e=0,f=0;if(!a)b=0;else {e=a+8|0;f=a+40|0;b=zw(c[a>>2]|0,c[a+4>>2]|0,c[e>>2]|0,c[a+16>>2]|0,c[f>>2]|0,c[a+32>>2]|0)|0;d=a+20|0;W6(c[b+20>>2]|0,c[d>>2]|0,(c[a>>2]<<2)+4|0)|0;W6(c[b+24>>2]|0,c[a+24>>2]|0,c[(c[d>>2]|0)+(c[a>>2]<<2)>>2]<<2|0)|0;d=c[a+28>>2]|0;if(d|0)W6(c[b+28>>2]|0,d|0,O(c[e>>2]|0,c[f>>2]|0)|0)|0;c[b+36>>2]=c[a+36>>2];c[b+8>>2]=c[e>>2];}return b|0}function yw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;p=c[a+20>>2]|0;r=c[a+24>>2]|0;s=c[b+20>>2]|0;t=c[b+24>>2]|0;if(!((a|0)!=0&(b|0)!=0))qa(94981,94943,973,94988);q=c[a+32>>2]|0;if(!((q|0)==1?(q|0)==(c[b+32>>2]|0):0))qa(95005,94943,974,94988);e=a+16|0;d=c[e>>2]|0;if((d|0)!=(c[b+16>>2]|0))qa(95055,94943,975,94988);o=c[a>>2]|0;f=c[a+4>>2]|0;if(((o|0)==(c[b>>2]|0)?(f|0)==(c[b+4>>2]|0):0)?(u=rw(o,f,(c[b+8>>2]|0)+(c[a+8>>2]|0)|0,d,1)|0,u|0):0){m=c[u+20>>2]|0;n=c[u+24>>2]|0;q=KK(f<<2)|0;d=0;while(1){if((d|0)>=(f|0))break;c[q+(d<<2)>>2]=-1;d=d+1|0;}c[m>>2]=0;a:do switch(c[e>>2]|0){case 1:{l=c[a+28>>2]|0;i=c[b+28>>2]|0;j=c[u+28>>2]|0;d=0;f=0;while(1){if((f|0)>=(o|0))break a;k=f+1|0;e=p+(k<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;g=r+(a<<2)|0;c[q+(c[g>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[g>>2];h[j+(d<<3)>>3]=+h[l+(a<<3)>>3];a=a+1|0;d=d+1|0;}b=s+(k<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;h[j+(d<<3)>>3]=+h[i+(f<<3)>>3];d=d+1|0;}else {e=j+(e<<3)|0;h[e>>3]=+h[e>>3]+ +h[i+(f<<3)>>3];}f=f+1|0;}c[m+(k<<2)>>2]=d;f=k;}}case 2:{l=c[a+28>>2]|0;k=c[b+28>>2]|0;i=c[u+28>>2]|0;f=0;d=0;while(1){if((f|0)>=(o|0))break a;j=f+1|0;e=p+(j<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;b=r+(a<<2)|0;c[q+(c[b>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[b>>2];b=a<<1;g=d<<1;h[i+(g<<3)>>3]=+h[l+(b<<3)>>3];h[i+((g|1)<<3)>>3]=+h[l+((b|1)<<3)>>3];a=a+1|0;d=d+1|0;}b=s+(j<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;a=f<<1;e=d<<1;h[i+(e<<3)>>3]=+h[k+(a<<3)>>3];h[i+((e|1)<<3)>>3]=+h[k+((a|1)<<3)>>3];d=d+1|0;}else {a=f<<1;e=e<<1;v=i+(e<<3)|0;h[v>>3]=+h[v>>3]+ +h[k+(a<<3)>>3];e=i+((e|1)<<3)|0;h[e>>3]=+h[e>>3]+ +h[k+((a|1)<<3)>>3];}f=f+1|0;}c[m+(j<<2)>>2]=d;f=j;}}case 4:{l=c[a+28>>2]|0;i=c[b+28>>2]|0;j=c[u+28>>2]|0;f=0;d=0;while(1){if((f|0)>=(o|0))break a;k=f+1|0;e=p+(k<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;v=r+(a<<2)|0;c[q+(c[v>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[v>>2];c[j+(d<<2)>>2]=c[l+(a<<2)>>2];a=a+1|0;d=d+1|0;}b=s+(k<<2)|0;g=m+(f<<2)|0;f=c[s+(f<<2)>>2]|0;while(1){if((f|0)>=(c[b>>2]|0))break;a=c[t+(f<<2)>>2]|0;e=c[q+(a<<2)>>2]|0;if((e|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;c[j+(d<<2)>>2]=c[i+(f<<2)>>2];d=d+1|0;}else {v=j+(e<<2)|0;c[v>>2]=(c[v>>2]|0)+(c[i+(f<<2)>>2]|0);}f=f+1|0;}c[m+(k<<2)>>2]=d;f=k;}}case 8:{d=0;f=0;while(1){if((f|0)>=(o|0))break a;i=f+1|0;e=p+(i<<2)|0;a=c[p+(f<<2)>>2]|0;while(1){if((a|0)>=(c[e>>2]|0))break;v=r+(a<<2)|0;c[q+(c[v>>2]<<2)>>2]=d;c[n+(d<<2)>>2]=c[v>>2];d=d+1|0;a=a+1|0;}b=s+(i<<2)|0;g=m+(f<<2)|0;e=c[s+(f<<2)>>2]|0;while(1){if((e|0)>=(c[b>>2]|0))break;a=c[t+(e<<2)>>2]|0;if((c[q+(a<<2)>>2]|0)<(c[g>>2]|0)){c[n+(d<<2)>>2]=a;d=d+1|0;}e=e+1|0;}c[m+(i<<2)>>2]=d;f=i;}}default:d=0;}while(0);c[u+8>>2]=d;U1(q);return u|0}return 0}function zw(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;a=tw(a,b,d,e,f)|0;if((c|0)>0)uw(a,c)|0;return a|0}function Aw(a,b){a=a|0;b=b|0;var d=0;if(!(ww(a,b)|0)){b=pw(a)|0;if(!b)b=0;else {d=yw(a,b)|0;qw(b);b=d+36|0;c[b>>2]=c[b>>2]|3;b=d;d=5;}}else {b=xw(a)|0;d=5;}if((d|0)==5)b=Bw(b)|0;return b|0}function Bw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0,l=0,m=0;a:do if(!a)a=0;else {k=c[a+20>>2]|0;l=c[a+24>>2]|0;d=c[k>>2]|0;b:do switch(c[a+16>>2]|0){case 1:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;h[j+(b<<3)>>3]=+h[j+(d<<3)>>3];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 2:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;m=d<<1;e=b<<1;h[j+(e<<3)>>3]=+h[j+(m<<3)>>3];h[j+((e|1)<<3)>>3]=+h[j+((m|1)<<3)>>3];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 4:{j=c[a+28>>2]|0;i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;c[j+(b<<2)>>2]=c[j+(d<<2)>>2];b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}case 8:{i=0;b=0;while(1){if((i|0)>=(c[a>>2]|0))break b;f=i+1|0;g=k+(f<<2)|0;while(1){e=c[g>>2]|0;if((d|0)>=(e|0))break;e=c[l+(d<<2)>>2]|0;if((e|0)!=(i|0)){c[l+(b<<2)>>2]=e;b=b+1|0;}d=d+1|0;}c[g>>2]=b;i=f;d=e;}}default:{a=0;break a}}while(0);c[a+8>>2]=b;}while(0);return a|0}function Cw(a){a=a|0;if((c[a+32>>2]|0)==2)return Dw(c[a+8>>2]|0,c[a>>2]|0,c[a+4>>2]|0,c[a+20>>2]|0,c[a+24>>2]|0,c[a+28>>2]|0,c[a+16>>2]|0,c[a+40>>2]|0)|0;else qa(95100,94943,803,95126);return 0}function Dw(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;return Ew(a,b,c,d,e,f,g,h,1)|0} -function J_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=b+72|0;k=b+352|0;l=b+356|0;m=b+360|0;i=0;a:while(1){h=f-e|0;if((h|0)<=0){f=-1;break}switch(a[j+(d[e>>0]|0)>>0]|0){case 8:case 1:case 0:{n=16;break a}case 5:{if((h|0)<2){f=-2;break a}if(lb[c[k>>2]&127](b,e)|0){n=6;break a}h=i;e=e+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}if(lb[c[l>>2]&127](b,e)|0){n=10;break a}h=i;e=e+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}if(lb[c[m>>2]&127](b,e)|0){n=14;break a}h=i;e=e+4|0;i=h;continue a}case 2:{h=e+1|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=33){o=i;e=h;i=o;continue a}h=e+2|0;if((f-h|0)<=0){f=-1;break a}o=(a[h>>0]|0)==91;i=i+(o&1)|0;e=o?e+3|0:h;continue a}case 4:{h=e+1|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=93){o=i;e=h;i=o;continue a}h=e+2|0;if((f-h|0)<=0){f=-1;break a}if((a[h>>0]|0)!=62){o=i;e=h;i=o;continue a}e=e+3|0;if(!i){n=26;break a}i=i+-1|0;continue a}default:{o=i;e=e+1|0;i=o;continue a}}}if((n|0)==6){c[g>>2]=e;f=0;}else if((n|0)==10){c[g>>2]=e;f=0;}else if((n|0)==14){c[g>>2]=e;f=0;}else if((n|0)==16){c[g>>2]=e;f=0;}else if((n|0)==26){c[g>>2]=e;f=42;}return f|0}function K_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>0){l=b+72|0;i=e;a:while(1){if((k-i|0)<=0){j=24;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 3:{j=8;break a}case 2:{j=11;break a}case 10:{j=12;break a}case 9:{j=15;break a}case 21:{j=19;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=1;}i=i+h|0;}if((j|0)==8)if((i|0)==(e|0)){h=W_(b,e+1|0,f,g)|0;break}else {c[g>>2]=i;h=6;break}else if((j|0)==11){c[g>>2]=i;h=0;break}else if((j|0)==12)if((i|0)==(e|0)){c[g>>2]=e+1;h=7;break}else {c[g>>2]=i;h=6;break}else if((j|0)==15){if((i|0)!=(e|0)){c[g>>2]=i;h=6;break}h=e+1|0;if((k-h|0)<=0){h=-3;break}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break}else if((j|0)==19)if((i|0)==(e|0)){c[g>>2]=e+1;h=39;break}else {c[g>>2]=i;h=6;break}else if((j|0)==24){c[g>>2]=i;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function L_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>0){l=b+72|0;i=e;a:while(1){if((k-i|0)<=0){j=23;break}switch(a[l+(d[i>>0]|0)>>0]|0){case 3:{j=8;break a}case 30:{j=11;break a}case 10:{j=14;break a}case 9:{j=17;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=1;}i=i+h|0;}if((j|0)==8)if((i|0)==(e|0)){h=W_(b,e+1|0,f,g)|0;break}else {c[g>>2]=i;h=6;break}else if((j|0)==11)if((i|0)==(e|0)){h=X_(b,e+1|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=i;h=6;break}else if((j|0)==14)if((i|0)==(e|0)){c[g>>2]=e+1;h=7;break}else {c[g>>2]=i;h=6;break}else if((j|0)==17){if((i|0)!=(e|0)){c[g>>2]=i;h=6;break}h=e+1|0;if((k-h|0)<=0){h=-3;break}c[g>>2]=(a[l+(d[h>>0]|0)>>0]|0)==10?e+2|0:h;h=7;break}else if((j|0)==23){c[g>>2]=i;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function M_(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=6;break}if((f-b|0)<1){b=0;break}if((a[b>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+1|0;}if((g|0)==6)b=(b|0)==(d|0)&1;return b|0}function N_(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;b=c;a:while(1){switch(a[f+(d[b>>0]|0)>>0]|0){case 5:{e=2;break}case 6:{e=3;break}case 7:{e=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{e=1;break}default:break a}b=b+e|0;}return b-c|0}function O_(b,c){b=b|0;c=c|0;b=b+72|0;a:while(1){switch(a[b+(d[c>>0]|0)>>0]|0){case 21:case 9:case 10:break;default:break a}c=c+1|0;}return c|0}function P_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;l=b+72|0;j=0;k=0;b=1;a:while(1){h=e+1|0;i=a[h>>0]|0;do switch(a[l+(i&255)>>0]|0){case 5:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+2|0;k=h;j=i;continue a}case 6:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+3|0;k=h;j=i;continue a}case 7:{if(!b)if((k|0)<(f|0)){c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;b=1;}else b=1;h=k;i=j;e=e+4|0;k=h;j=i;continue a}case 24:case 22:case 29:{if(b|0){o=b;n=k;i=j;e=h;b=o;k=n;j=i;continue a}if((k|0)>=(f|0)){n=k;o=j;b=1;e=h;k=n;j=o;continue a}c[g+(k<<4)>>2]=h;a[g+(k<<4)+12>>0]=1;n=k;o=j;b=1;e=h;k=n;j=o;continue a}case 12:{if((b|0)!=2){if((k|0)>=(f|0)){o=k;j=12;b=2;e=h;k=o;continue a}c[g+(k<<4)+4>>2]=e+2;o=k;j=12;b=2;e=h;k=o;continue a}if((j|0)!=12){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if((k|0)<(f|0))c[g+(k<<4)+8>>2]=h;j=12;k=k+1|0;b=0;e=h;continue a}case 13:{if((b|0)!=2){if((k|0)>=(f|0)){o=k;j=13;b=2;e=h;k=o;continue a}c[g+(k<<4)+4>>2]=e+2;o=k;j=13;b=2;e=h;k=o;continue a}if((j|0)!=13){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if((k|0)<(f|0))c[g+(k<<4)+8>>2]=h;j=13;k=k+1|0;b=0;e=h;continue a}case 3:{if((k|0)>=(f|0)){i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}a[g+(k<<4)+12>>0]=0;i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}case 21:{switch(b|0){case 1:{n=k;o=j;b=0;e=h;k=n;j=o;continue a}case 2:break;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}if((k|0)>=(f|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}b=g+(k<<4)+12|0;if(!(a[b>>0]|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}if(((i<<24>>24==32?(h|0)!=(c[g+(k<<4)+4>>2]|0):0)?(m=a[e+2>>0]|0,m<<24>>24!=32):0)?(j|0)!=(d[l+(m&255)>>0]|0):0){n=k;o=j;b=2;e=h;k=n;j=o;continue a}a[b>>0]=0;n=k;o=j;b=2;e=h;k=n;j=o;continue a}case 10:case 9:{switch(b|0){case 1:{n=k;o=j;b=0;e=h;k=n;j=o;continue a}case 2:break;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}if((k|0)>=(f|0)){n=k;o=j;b=2;e=h;k=n;j=o;continue a}a[g+(k<<4)+12>>0]=0;n=k;o=j;b=2;e=h;k=n;j=o;continue a}case 17:case 11:if((b|0)==2){n=k;o=j;b=2;e=h;k=n;j=o;continue a}else break a;default:{i=b;n=k;o=j;e=h;b=i;k=n;j=o;continue a}}while(0)}return k|0}function Q_(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+2|0;d=a[b>>0]|0;a:do if(d<<24>>24==120){d=c+3|0;b=0;while(1){b:while(1){e=a[d>>0]|0;c=e<<24>>24;if(e<<24>>24==59){e=14;break a}switch(c|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=7;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=8;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=9;break b}default:{}}d=d+1|0;}if((e|0)==7){e=0;b=c+-48|b<<4;}else if((e|0)==8){e=0;b=(b<<4)+-55+c|0;}else if((e|0)==9){e=0;b=(b<<4)+-87+c|0;}if((b|0)<1114112)d=d+1|0;else {b=-1;break}}}else {c=b;b=0;while(1){if(d<<24>>24==59){e=14;break a}b=(d<<24>>24)+-48+(b*10|0)|0;if((b|0)>=1114112){b=-1;break a}d=c+1|0;c=d;d=a[d>>0]|0;}}while(0);if((e|0)==14)b=A_(b)|0;return b|0}function R_(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch(d-c|0){case 2:{if((a[c+1>>0]|0)==116){b=a[c>>0]|0;b=b<<24>>24==108?60:b<<24>>24==103?62:0;}else e=14;break}case 3:{if(((a[c>>0]|0)==97?(a[c+1>>0]|0)==109:0)?(a[c+2>>0]|0)==112:0)b=38;else e=14;break}case 4:switch(a[c>>0]|0){case 113:{if((a[c+1>>0]|0)!=117){e=14;break a}if((a[c+2>>0]|0)!=111){e=14;break a}if((a[c+3>>0]|0)==116){b=34;break a}else {e=14;break a}}case 97:{if((a[c+1>>0]|0)!=112){e=14;break a}if((a[c+2>>0]|0)!=111){e=14;break a}if((a[c+3>>0]|0)==115){b=39;break a}else {e=14;break a}}default:{e=14;break a}}default:e=14;}while(0);if((e|0)==14)b=0;return b|0}function S_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=b+72|0;i=g+4|0;while(1){if((f-e|0)<=0)break;switch(a[h+(d[e>>0]|0)>>0]|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[i>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+1|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;b=e+1|0;if((f-b|0)>0)e=(a[h+(d[b>>0]|0)>>0]|0)==10?e+2|0:b;else e=b;c[i>>2]=-1;break}default:e=e+1|0;}c[i>>2]=(c[i>>2]|0)+1;}return}function T_(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=e+-1|0;b=b+72|0;a:while(1){d=d+1|0;if((g-d|0)<=0){d=1;break}e=a[d>>0]|0;switch(a[b+(e&255)>>0]|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:continue a;case 21:if(e<<24>>24==9){h=7;break a}else continue a;case 22:case 26:{if(e<<24>>24>=0)continue a;break}default:{}}switch(e<<24>>24|0){case 64:case 36:break;default:{h=7;break a}}}if((h|0)==7){c[f>>2]=d;d=0;}return d|0}function U_(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;i=h;while(1){j=c[e>>2]|0;if((j|0)==(f|0)){b=0;break}k=d[j>>0]|0;b=c[g>>2]|0;if(!(k&128)){if((b|0)==(h|0)){b=2;break}c[e>>2]=j+1;j=a[j>>0]|0;k=c[g>>2]|0;c[g>>2]=k+1;a[k>>0]=j;continue}else {if((i-b|0)<2){b=2;break}c[g>>2]=b+1;a[b>>0]=k>>>6|192;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=k&63|128;c[e>>2]=(c[e>>2]|0)+1;continue}}return b|0}function V_(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;while(1){a=c[e>>2]|0;i=a>>>0>>0;j=c[g>>2]|0;if(!(i&j>>>0>>0))break;c[e>>2]=a+1;i=d[a>>0]|0;j=c[g>>2]|0;c[g>>2]=j+2;b[j>>1]=i;}return ((j|0)!=(h|0)|i^1?0:2)|0}function W_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;h=k-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{f=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=4;break}case 19:{f=Y_(b,e+1|0,f,g)|0;break a}default:{c[g>>2]=e;f=0;break a}}h=b+328|0;i=b+332|0;j=b+336|0;e=e+f|0;b:while(1){f=k-e|0;if((f|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=18;break b}case 18:{h=29;break b}case 27:case 26:case 25:case 24:case 22:{f=1;break}case 5:{if((f|0)<2){f=-2;break a}if(!(lb[c[h>>2]&127](b,e)|0)){h=21;break b}else f=2;break}case 6:{if((f|0)<3){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=24;break b}else f=3;break}case 7:{if((f|0)<4){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=27;break b}else f=4;break}default:{h=30;break b}}e=e+f|0;}if((h|0)==18){c[g>>2]=e;f=0;break}else if((h|0)==21){c[g>>2]=e;f=0;break}else if((h|0)==24){c[g>>2]=e;f=0;break}else if((h|0)==27){c[g>>2]=e;f=0;break}else if((h|0)==29){c[g>>2]=e+1;f=9;break}else if((h|0)==30){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function X_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;e=e+h|0;b:while(1){h=f-e|0;if((h|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=18;break b}case 18:{h=29;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=21;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=24;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,e)|0)){h=27;break b}else h=4;break}default:{h=30;break b}}e=e+h|0;}if((h|0)==18){c[g>>2]=e;f=0;break}else if((h|0)==21){c[g>>2]=e;f=0;break}else if((h|0)==24){c[g>>2]=e;f=0;break}else if((h|0)==27){c[g>>2]=e;f=0;break}else if((h|0)==29){c[g>>2]=e+1;f=28;break}else if((h|0)==30){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function Y_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=f;a:do if((i-e|0)>0){h=a[e>>0]|0;if(h<<24>>24==120){b=Z_(b,e+1|0,f,g)|0;break}f=b+72|0;if((a[f+(h&255)>>0]|0)!=25){c[g>>2]=e;b=0;break}b:while(1){b=e+1|0;if((i-b|0)<=0){b=-1;break a}switch(a[f+(d[b>>0]|0)>>0]|0){case 25:{e=b;break}case 18:{f=8;break b}default:{f=9;break b}}}if((f|0)==8){c[g>>2]=e+2;b=10;break}else if((f|0)==9){c[g>>2]=b;b=0;break}}else b=-1;while(0);return b|0}function Z_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0;a:do if((f-e|0)>0){b=b+72|0;if((a[b+(d[e>>0]|0)>>0]&-2)<<24>>24!=24){c[g>>2]=e;f=0;break}b:while(1){h=e+1|0;if((f-h|0)<=0){f=-1;break a}switch(a[b+(d[h>>0]|0)>>0]|0){case 24:case 25:{e=h;break}case 18:{b=6;break b}default:{b=7;break b}}}if((b|0)==6){c[g>>2]=e+2;f=10;break}else if((b|0)==7){c[g>>2]=h;f=0;break}}else f=-1;while(0);return f|0}function __(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=f;h=q-e|0;a:do if((h|0)>0){p=b+72|0;switch(a[p+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;h=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){h=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=2;break}case 6:{if((h|0)<3){h=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=3;break}case 7:{if((h|0)<4){h=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;h=0;break a}else h=4;break}case 16:{h=e+1|0;if((q-h|0)<=0){h=-1;break a}switch(a[p+(d[h>>0]|0)>>0]|0){case 27:{h=$_(b,e+2|0,f,g)|0;break a}case 20:{h=a$(e+2|0,f,g)|0;break a}default:{c[g>>2]=h;h=0;break a}}}case 15:{h=b$(b,e+1|0,f,g)|0;break a}case 17:{h=c$(b,e+1|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}j=b+328|0;k=b+332|0;l=b+336|0;m=b+340|0;n=b+344|0;o=b+348|0;i=0;h=e+h|0;b:while(1){e=q-h|0;if((e|0)<=0){h=-1;break a}c:do switch(a[p+(d[h>>0]|0)>>0]|0){case 29:{r=24;break b}case 10:case 9:case 21:{r=50;break b}case 11:{r=64;break b}case 17:break b;case 27:case 26:case 25:case 24:case 22:{e=1;break}case 5:{if((e|0)<2){h=-2;break a}if(!(lb[c[j>>2]&127](b,h)|0)){r=27;break b}else e=2;break}case 6:{if((e|0)<3){h=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){r=30;break b}else e=3;break}case 7:{if((e|0)<4){h=-2;break a}if(!(lb[c[l>>2]&127](b,h)|0)){r=33;break b}else e=4;break}case 23:{if(i|0){r=35;break b}i=h+1|0;e=q-i|0;if((e|0)<=0){h=-1;break a}switch(a[p+(d[i>>0]|0)>>0]|0){case 29:{r=38;break b}case 24:case 22:{i=1;e=2;break c}case 5:{if((e|0)<2){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){r=42;break b}else {i=1;e=3;break c}}case 6:{if((e|0)<3){h=-2;break a}if(!(lb[c[n>>2]&127](b,i)|0)){r=45;break b}else {i=1;e=4;break c}}case 7:{if((e|0)<4){h=-2;break a}if(!(lb[c[o>>2]&127](b,i)|0)){r=48;break b}else {i=1;e=5;break c}}default:{r=49;break b}}}default:{r=69;break b}}while(0);h=h+e|0;}d:switch(r|0){case 24:{c[g>>2]=h;h=0;break a}case 27:{c[g>>2]=h;h=0;break a}case 30:{c[g>>2]=h;h=0;break a}case 33:{c[g>>2]=h;h=0;break a}case 35:{c[g>>2]=h;h=0;break a}case 38:{c[g>>2]=i;h=0;break a}case 42:{c[g>>2]=i;h=0;break a}case 45:{c[g>>2]=i;h=0;break a}case 48:{c[g>>2]=i;h=0;break a}case 49:{c[g>>2]=i;h=0;break a}case 50:{e:while(1){r=0;i=h+1|0;e=q-i|0;if((e|0)<=0){h=-1;break a}switch(a[p+(d[i>>0]|0)>>0]|0){case 11:{h=i;r=64;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;r=50;break}case 29:{r=52;break e}case 24:case 22:{i=2;break e}case 5:{r=53;break e}case 6:{r=56;break e}case 7:{r=59;break e}default:{r=62;break e}}}if((r|0)==52){c[g>>2]=i;h=0;break a}else if((r|0)==53){if((e|0)<2){h=-2;break a}if(!(lb[c[m>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=3;}else if((r|0)==56){if((e|0)<3){h=-2;break a}if(!(lb[c[n>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=4;}else if((r|0)==59){if((e|0)<4){h=-2;break a}if(!(lb[c[o>>2]&127](b,i)|0)){c[g>>2]=i;h=0;break a}else i=5;}else if((r|0)==62){c[g>>2]=i;h=0;break a}h=d$(b,h+i|0,f,g)|0;break a}case 69:{c[g>>2]=h;h=0;break a}}if((r|0)==64){c[g>>2]=h+1;h=2;break}i=h+1|0;if((q-i|0)>0)if((a[i>>0]|0)==62){c[g>>2]=h+2;h=4;break}else {c[g>>2]=i;h=0;break}else h=-1;}else h=-1;while(0);return h|0}function $_(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;a:do if((f-e|0)>0){if((a[e>>0]|0)!=45){c[g>>2]=e;f=0;break}h=b+72|0;i=b+352|0;j=b+356|0;k=b+360|0;l=e+1|0;b:while(1){e=f-l|0;if((e|0)<=0){f=-1;break a}switch(a[h+(d[l>>0]|0)>>0]|0){case 8:case 1:case 0:{e=19;break b}case 5:{if((e|0)<2){f=-2;break a}if(lb[c[i>>2]&127](b,l)|0){e=9;break b}l=l+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}if(lb[c[j>>2]&127](b,l)|0){e=13;break b}l=l+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}if(lb[c[k>>2]&127](b,l)|0){e=17;break b}l=l+4|0;continue b}case 27:{e=l+1|0;if((f-e|0)<=0){f=-1;break a}if((a[e>>0]|0)==45){e=22;break b}else {l=e;continue b}}default:{l=l+1|0;continue b}}}if((e|0)==9){c[g>>2]=l;f=0;break}else if((e|0)==13){c[g>>2]=l;f=0;break}else if((e|0)==17){c[g>>2]=l;f=0;break}else if((e|0)==19){c[g>>2]=l;f=0;break}else if((e|0)==22){e=l+2|0;if((f-e|0)<=0){f=-1;break}if((a[e>>0]|0)==62){c[g>>2]=l+3;f=13;break}else {c[g>>2]=e;f=0;break}}}else f=-1;while(0);return f|0}function a$(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>5){d=0;while(1){if((d|0)>=6){d=8;break}if((a[b>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+1|0;}c[e>>2]=b;}else d=-1;return d|0}function b$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;f=o-e|0;a:do if((f|0)>0){n=b+72|0;switch(a[n+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{f=1;break}case 5:{if((f|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=2;break}case 6:{if((f|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=3;break}case 7:{if((f|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else f=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;f=e+f|0;b:while(1){h=o-f|0;if((h|0)<=0){f=-1;break a}switch(a[n+(d[f>>0]|0)>>0]|0){case 29:{m=17;break b}case 10:case 9:case 21:{m=28;break b}case 15:{m=50;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,f)|0)){m=20;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,f)|0)){m=23;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,f)|0)){m=26;break b}else h=4;break}default:break b}f=f+h|0;}if((m|0)==17){c[g>>2]=f;f=0;break}else if((m|0)==20){c[g>>2]=f;f=0;break}else if((m|0)==23){c[g>>2]=f;f=0;break}else if((m|0)==26){c[g>>2]=f;f=0;break}else if((m|0)==28){if(!(e$(e,f,p)|0)){c[g>>2]=f;f=0;break}i=b+352|0;j=b+356|0;k=b+360|0;h=f+1|0;c:while(1){f=o-h|0;if((f|0)<=0){f=-1;break a}switch(a[n+(d[h>>0]|0)>>0]|0){case 8:case 1:case 0:{m=45;break c}case 5:{if((f|0)<2){f=-2;break a}if(lb[c[i>>2]&127](b,h)|0){m=35;break c}h=h+2|0;continue c}case 6:{if((f|0)<3){f=-2;break a}if(lb[c[j>>2]&127](b,h)|0){m=39;break c}h=h+3|0;continue c}case 7:{if((f|0)<4){f=-2;break a}if(lb[c[k>>2]&127](b,h)|0){m=43;break c}h=h+4|0;continue c}case 15:{f=h+1|0;if((o-f|0)<=0){f=-1;break a}if((a[f>>0]|0)==62){m=48;break c}else {h=f;continue c}}default:{h=h+1|0;continue c}}}if((m|0)==35){c[g>>2]=h;f=0;break}else if((m|0)==39){c[g>>2]=h;f=0;break}else if((m|0)==43){c[g>>2]=h;f=0;break}else if((m|0)==45){c[g>>2]=h;f=0;break}else if((m|0)==48){c[g>>2]=h+2;f=c[p>>2]|0;break}}else if((m|0)==50){if(!(e$(e,f,p)|0)){c[g>>2]=f;f=0;break}h=f+1|0;if((o-h|0)<=0){f=-1;break}if((a[h>>0]|0)==62){c[g>>2]=f+2;f=c[p>>2]|0;break}else f=h;}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function c$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;h=e+h|0;b:while(1){e=f-h|0;if((e|0)<=0){f=-1;break a}switch(a[l+(d[h>>0]|0)>>0]|0){case 29:{i=17;break b}case 10:case 9:case 21:{i=27;break b}case 11:{i=32;break b}case 23:case 27:case 26:case 25:case 24:case 22:{e=1;break}case 5:{if((e|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,h)|0)){i=20;break b}else e=2;break}case 6:{if((e|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,h)|0)){i=23;break b}else e=3;break}case 7:{if((e|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){i=26;break b}else e=4;break}default:{i=33;break b}}h=h+e|0;}if((i|0)==17){c[g>>2]=h;f=0;break}else if((i|0)==20){c[g>>2]=h;f=0;break}else if((i|0)==23){c[g>>2]=h;f=0;break}else if((i|0)==26){c[g>>2]=h;f=0;break}else if((i|0)==27){c:while(1){e=h+1|0;if((f-e|0)<=0){f=-1;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 10:case 9:case 21:{h=e;i=27;break}case 11:{i=29;break c}default:{i=30;break c}}}if((i|0)==29){c[g>>2]=h+2;f=5;break}else if((i|0)==30){c[g>>2]=e;f=0;break}}else if((i|0)==32){c[g>>2]=h+1;f=5;break}else if((i|0)==33){c[g>>2]=h;f=0;break}}else f=-1;while(0);return f|0}function d$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;v=y;c[v>>2]=e;w=f;r=b+72|0;s=b+328|0;t=b+332|0;u=b+336|0;k=b+340|0;m=b+344|0;n=b+348|0;o=b+352|0;p=b+356|0;q=b+360|0;i=0;a:while(1){h=w-e|0;if((h|0)<=0){e=-1;break}b:do switch(a[r+(d[e>>0]|0)>>0]|0){case 29:{x=4;break a}case 27:case 26:case 25:case 24:case 22:{h=e+1|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 5:{if((h|0)<2){e=-2;break a}if(!(lb[c[s>>2]&127](b,e)|0)){x=8;break a}h=e+2|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 6:{if((h|0)<3){e=-2;break a}if(!(lb[c[t>>2]&127](b,e)|0)){x=12;break a}h=e+3|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 7:{if((h|0)<4){e=-2;break a}if(!(lb[c[u>>2]&127](b,e)|0)){x=16;break a}h=e+4|0;c[v>>2]=h;j=i;e=h;i=j;continue a}case 23:{if(i|0){x=19;break a}h=e+1|0;c[v>>2]=h;i=w-h|0;if((i|0)<=0){e=-1;break a}switch(a[r+(d[h>>0]|0)>>0]|0){case 29:{x=22;break a}case 24:case 22:{j=e+2|0;c[v>>2]=j;i=1;e=j;continue a}case 5:{if((i|0)<2){e=-2;break a}if(!(lb[c[k>>2]&127](b,h)|0)){x=26;break a}j=e+3|0;c[v>>2]=j;i=1;e=j;continue a}case 6:{if((i|0)<3){e=-2;break a}if(!(lb[c[m>>2]&127](b,h)|0)){x=30;break a}j=e+4|0;c[v>>2]=j;i=1;e=j;continue a}case 7:{if((i|0)<4){e=-2;break a}if(!(lb[c[n>>2]&127](b,h)|0)){x=34;break a}j=e+5|0;c[v>>2]=j;i=1;e=j;continue a}default:{x=36;break a}}}case 10:case 9:case 21:while(1){e=e+1|0;c[v>>2]=e;if((w-e|0)<=0){e=-1;break a}switch(a[r+(d[e>>0]|0)>>0]|0){case 14:break b;case 9:case 10:case 21:break;default:{x=39;break a}}}case 14:break;default:{x=92;break a}}while(0);while(1){h=e+1|0;c[v>>2]=h;if((w-h|0)<=0){e=-1;break a}j=a[r+(d[h>>0]|0)>>0]|0;if((j|1)<<24>>24==13)break;switch(j<<24>>24){case 9:case 10:case 21:{e=h;break}default:{x=43;break a}}}e=e+2|0;c[v>>2]=e;c:while(1){h=w-e|0;if((h|0)<=0){e=-1;break a}i=a[r+(d[e>>0]|0)>>0]|0;if(i<<24>>24==j<<24>>24)break;switch(i<<24>>24){case 8:case 1:case 0:{x=60;break a}case 2:{x=65;break a}case 5:{if((h|0)<2){e=-2;break a}if(lb[c[o>>2]&127](b,e)|0){x=50;break a}i=e+2|0;c[v>>2]=i;e=i;continue c}case 6:{if((h|0)<3){e=-2;break a}if(lb[c[p>>2]&127](b,e)|0){x=54;break a}i=e+3|0;c[v>>2]=i;e=i;continue c}case 7:{if((h|0)<4){e=-2;break a}if(lb[c[q>>2]&127](b,e)|0){x=58;break a}i=e+4|0;c[v>>2]=i;e=i;continue c}case 3:{e=W_(b,e+1|0,f,v)|0;if((e|0)<1){x=63;break a}e=c[v>>2]|0;continue c}default:{i=e+1|0;c[v>>2]=i;e=i;continue c}}}h=e+1|0;c[v>>2]=h;if((w-h|0)<=0){e=-1;break}switch(a[r+(d[h>>0]|0)>>0]|0){case 11:{x=86;break a}case 17:{x=87;break a}case 10:case 9:case 21:{e=h;break}default:{x=69;break a}}d:while(1){h=e+1|0;c[v>>2]=h;i=w-h|0;if((i|0)<=0){e=-1;break a}switch(a[r+(d[h>>0]|0)>>0]|0){case 29:{x=72;break a}case 11:{x=86;break a}case 17:{x=87;break a}case 10:case 9:case 21:{e=h;break}case 24:case 22:{x=73;break d}case 5:{x=74;break d}case 6:{x=78;break d}case 7:{x=82;break d}default:{x=91;break a}}}if((x|0)==73){x=0;e=e+2|0;c[v>>2]=e;i=0;continue}else if((x|0)==74){x=0;if((i|0)<2){e=-2;break}if(!(lb[c[k>>2]&127](b,h)|0)){x=76;break}e=e+3|0;c[v>>2]=e;i=0;continue}else if((x|0)==78){x=0;if((i|0)<3){e=-2;break}if(!(lb[c[m>>2]&127](b,h)|0)){x=80;break}e=e+4|0;c[v>>2]=e;i=0;continue}else if((x|0)==82){x=0;if((i|0)<4){e=-2;break}if(!(lb[c[n>>2]&127](b,h)|0)){x=84;break}e=e+5|0;c[v>>2]=e;i=0;continue}}switch(x|0){case 4:{c[g>>2]=e;e=0;break}case 8:{c[g>>2]=e;e=0;break}case 12:{c[g>>2]=e;e=0;break}case 16:{c[g>>2]=e;e=0;break}case 19:{c[g>>2]=e;e=0;break}case 22:{c[g>>2]=h;e=0;break}case 26:{c[g>>2]=h;e=0;break}case 30:{c[g>>2]=h;e=0;break}case 34:{c[g>>2]=h;e=0;break}case 36:{c[g>>2]=h;e=0;break}case 39:{c[g>>2]=e;e=0;break}case 43:{c[g>>2]=h;e=0;break}case 50:{c[g>>2]=e;e=0;break}case 54:{c[g>>2]=e;e=0;break}case 58:{c[g>>2]=e;e=0;break}case 60:{c[g>>2]=e;e=0;break}case 63:{if(!e){c[g>>2]=c[v>>2];e=0;}break}case 65:{c[g>>2]=e;e=0;break}case 69:{c[g>>2]=h;e=0;break}case 72:{c[g>>2]=h;e=0;break}case 76:{c[g>>2]=h;e=0;break}case 80:{c[g>>2]=h;e=0;break}case 84:{c[g>>2]=h;e=0;break}case 86:{c[g>>2]=e+2;e=1;break}case 87:{e=h+1|0;c[v>>2]=e;if((w-e|0)>0)if((a[e>>0]|0)==62){c[g>>2]=h+2;e=3;break}else {c[g>>2]=e;e=0;break}else e=-1;break}case 91:{c[g>>2]=h;e=0;break}case 92:{c[g>>2]=e;e=0;break}}l=y;return e|0}function e$(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==3){switch(a[b>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}switch(a[b+1>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}switch(a[b+2>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;while(0);return d|0}function f$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=e+72|0;l=e+352|0;m=e+356|0;n=e+360|0;a:while(1){i=g-f|0;if((i|0)<=0){g=-1;break}j=a[k+(d[f>>0]|0)>>0]|0;switch(j<<24>>24){case 8:case 1:case 0:{o=16;break a}case 5:{if((i|0)<2){g=-2;break a}if(lb[c[l>>2]&127](e,f)|0){o=6;break a}f=f+2|0;continue a}case 6:{if((i|0)<3){g=-2;break a}if(lb[c[m>>2]&127](e,f)|0){o=10;break a}f=f+3|0;continue a}case 7:{if((i|0)<4){g=-2;break a}if(lb[c[n>>2]&127](e,f)|0){o=14;break a}f=f+4|0;continue a}case 13:case 12:{f=f+1|0;if((j&255|0)==(b|0)){o=18;break a}else continue a}default:{f=f+1|0;continue a}}}b:do if((o|0)==6){c[h>>2]=f;g=0;}else if((o|0)==10){c[h>>2]=f;g=0;}else if((o|0)==14){c[h>>2]=f;g=0;}else if((o|0)==16){c[h>>2]=f;g=0;}else if((o|0)==18)if((g-f|0)>0){c[h>>2]=f;switch(a[k+(d[f>>0]|0)>>0]|0){case 20:case 30:case 11:case 10:case 9:case 21:{g=27;break b}default:{}}g=0;}else g=-27;while(0);return g|0}function g$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;h=f;a:do if((h-e|0)>0){i=b+72|0;switch(a[i+(d[e>>0]|0)>>0]|0){case 27:{b=$_(b,e+1|0,f,g)|0;break a}case 20:{c[g>>2]=e+1;b=33;break a}case 24:case 22:{b:while(1){b=e+1|0;f=h-b|0;if((f|0)<=0){b=-1;break a}switch(a[i+(d[b>>0]|0)>>0]|0){case 24:case 22:{e=b;break}case 30:{j=8;break b}case 10:case 9:case 21:break b;default:{j=12;break b}}}if((j|0)==12){c[g>>2]=b;b=0;break a}c:do if((j|0)==8){if((f|0)<=1){b=-1;break a}switch(a[i+(d[e+2>>0]|0)>>0]|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=b;b=0;break a}while(0);c[g>>2]=b;b=16;break a}default:{c[g>>2]=e;b=0;break a}}}else b=-1;while(0);return b|0}function h$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;h=f-e|0;a:do if((h|0)>0){l=b+72|0;switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{c[g>>2]=e;f=0;break a}case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[b+340>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[b+344>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[b+348>>2]&127](b,e)|0)){c[g>>2]=e;f=0;break a}else h=4;break}default:{c[g>>2]=e;f=0;break a}}i=b+328|0;j=b+332|0;k=b+336|0;e=e+h|0;b:while(1){h=f-e|0;if((h|0)<=0){f=-20;break a}switch(a[l+(d[e>>0]|0)>>0]|0){case 29:{h=17;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=28;break b}case 27:case 26:case 25:case 24:case 22:{h=1;break}case 5:{if((h|0)<2){f=-2;break a}if(!(lb[c[i>>2]&127](b,e)|0)){h=20;break b}else h=2;break}case 6:{if((h|0)<3){f=-2;break a}if(!(lb[c[j>>2]&127](b,e)|0)){h=23;break b}else h=3;break}case 7:{if((h|0)<4){f=-2;break a}if(!(lb[c[k>>2]&127](b,e)|0)){h=26;break b}else h=4;break}default:{h=29;break b}}e=e+h|0;}if((h|0)==17){c[g>>2]=e;f=0;break}else if((h|0)==20){c[g>>2]=e;f=0;break}else if((h|0)==23){c[g>>2]=e;f=0;break}else if((h|0)==26){c[g>>2]=e;f=0;break}else if((h|0)==28){c[g>>2]=e;f=20;break}else if((h|0)==29){c[g>>2]=e;f=0;break}}else f=-1;while(0);return f|0}function i$(){return 58220}function j$(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;i=l;l=l+16|0;g=i;c[g>>2]=d;h=c[b>>2]|0;a=f-(c[e>>2]|0)|0;if((d-h|0)>(a|0)){a=h+a|0;c[g>>2]=a;f=1;}else {f=0;a=d;}w_(h,g);h=c[g>>2]|0;d=c[b>>2]|0;g=h-d|0;W6(c[e>>2]|0,d|0,g|0)|0;c[b>>2]=(c[b>>2]|0)+g;c[e>>2]=(c[e>>2]|0)+g;l=i;return (f?2:h>>>0>>0&1)|0}function k$(d,e,f,g,h){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=d+72|0;k=f;l=h;m=c[e>>2]|0;n=c[g>>2]|0;a:while(1){d=m>>>0>>0;if(!(n>>>0>>0&d)){o=12;break}d=a[m>>0]|0;i=d&255;switch(a[j+i>>0]|0){case 5:{if((k-m|0)<2){d=1;break a}b[n>>1]=(d&31)<<6|a[m+1>>0]&63;m=m+2|0;n=n+2|0;continue a}case 6:{if((k-m|0)<3){d=1;break a}b[n>>1]=(a[m+1>>0]&63)<<6|i<<12|a[m+2>>0]&63;m=m+3|0;n=n+2|0;continue a}case 7:{if((l-n|0)<4){d=2;break a}if((k-m|0)<4){d=1;break a}i=((a[m+1>>0]&63)<<12|(d&7)<<18|(a[m+2>>0]&63)<<6|a[m+3>>0]&63)+-65536|0;b[n>>1]=i>>>10|55296;b[n+2>>1]=i&1023|56320;m=m+4|0;n=n+4|0;continue a}default:{b[n>>1]=d<<24>>24;m=m+1|0;n=n+2|0;continue a}}}if((o|0)==12)d=d?2:0;c[e>>2]=m;c[g>>2]=n;return d|0}function l$(a,b){a=a|0;b=b|0;a=d[b>>0]|0;b=d[b+1>>0]|0;return 1<<(b&31)&c[56940+(((d[144044+(a>>>2&7)>>0]|0)<<3|a<<1&6|b>>>5&1)<<2)>>2]|0}function m$(b,e){b=b|0;e=e|0;var f=0;f=d[e+1>>0]|0;b=d[e+2>>0]|0;return 1<<(b&31)&c[56940+(((d[144044+(f>>>2&15|a[e>>0]<<4&255)>>0]|0)<<3|f<<1&6|b>>>5&1)<<2)>>2]|0}function n$(a,b){a=a|0;b=b|0;return 0}function o$(a,b){a=a|0;b=b|0;a=d[b>>0]|0;b=d[b+1>>0]|0;return 1<<(b&31)&c[56940+(((d[143788+(a>>>2&7)>>0]|0)<<3|a<<1&6|b>>>5&1)<<2)>>2]|0}function p$(b,e){b=b|0;e=e|0;var f=0;f=d[e+1>>0]|0;b=d[e+2>>0]|0;return 1<<(b&31)&c[56940+(((d[143788+(f>>>2&15|a[e>>0]<<4&255)>>0]|0)<<3|f<<1&6|b>>>5&1)<<2)>>2]|0}function q$(a,b){a=a|0;b=b|0;if((d[b>>0]|0)<194)return 1;else {b=d[b+1>>0]|0;return b>>>7^1|(b&192|0)==192|0}return 0}function r$(b,c){b=b|0;c=c|0;var d=0;b=a[c+2>>0]|0;do if(b<<24>>24>-1)b=1;else {d=a[c>>0]|0;if(d<<24>>24==-17?(a[c+1>>0]|0)==-65:0)if((b&255)>189){b=1;break}else {b=191;c=-65;}else {if((b&255)>191){b=1;break}c=a[c+1>>0]|0;b=c&255;if(d<<24>>24==-32){b=(c&255)<160|(b&192|0)==192;break}}b=(b&128|0)==0?1:d<<24>>24==-19?(c&255)>159:(b&192|0)==192;}while(0);return b&1|0}function s$(b,c){b=b|0;c=c|0;var e=0;e=d[c+3>>0]|0;do if(!((e&128|0)==0|(e&192|0)==192)?(e=d[c+2>>0]|0,!((e&128|0)==0|(e&192|0)==192)):0){e=a[c>>0]|0;b=a[c+1>>0]|0;c=b&255;if(e<<24>>24==-16){b=(b&255)<144|(c&192|0)==192;break}else {b=(c&128|0)==0?1:e<<24>>24==-12?(b&255)>143:(c&192|0)==192;break}}else b=1;while(0);return b&1|0}function t$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){i=e;m=f-i|0;k=(m&1|0)==0;m=m&-2;l=(m|0)==0;m=k|l?f:e+m|0;if(k|l^1){f=a[e+1>>0]|0;if(!(f<<24>>24)){h=a[e>>0]|0;j=h;h=d[b+72+(h&255)>>0]|0;}else {h=a[e>>0]|0;j=h;h=J$(f,h)|0;}do switch(h|0){case 12:{f=V$(12,b,e+2|0,m,g)|0;break a}case 13:{f=V$(13,b,e+2|0,m,g)|0;break a}case 2:{h=e+2|0;if((m-h|0)<=1){f=-1;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;switch(f|0){case 16:{f=W$(b,e+4|0,m,g)|0;break a}case 15:{f=R$(b,e+4|0,m,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;f=29;break a}default:{c[g>>2]=h;f=0;break a}}}case 9:{if((e+2|0)==(m|0)){c[g>>2]=m;f=-15;break a}else i=7;break}case 10:case 21:{i=7;break}case 30:{f=L$(b,e+2|0,m,g)|0;break a}case 35:{c[g>>2]=e+2;f=38;break a}case 20:{c[g>>2]=e+2;f=25;break a}case 4:{h=e+2|0;f=m-h|0;if((f|0)<=1){f=-26;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){if((f|0)<=3){f=-1;break a}if((a[e+5>>0]|0)==0?(a[e+4>>0]|0)==62:0){c[g>>2]=e+6;f=34;break a}}c[g>>2]=h;f=26;break a}case 31:{c[g>>2]=e+2;f=23;break a}case 32:{h=e+2|0;if((m-h|0)<=1){f=-24;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;switch(f|0){case 33:{c[g>>2]=e+4;f=36;break a}case 15:{c[g>>2]=e+4;f=35;break a}case 34:{c[g>>2]=e+4;f=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;f=24;break a}default:{c[g>>2]=h;f=0;break a}}}case 36:{c[g>>2]=e+2;f=21;break a}case 11:{c[g>>2]=e+2;f=17;break a}case 19:{f=X$(b,e+2|0,m,g)|0;break a}case 5:{if((m-i|0)<2){f=-2;break a}c[g>>2]=e;f=0;break a}case 6:{if((m-i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((m-i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 24:case 22:{f=18;i=61;break}case 23:case 27:case 26:case 25:{f=19;i=61;break}case 29:{i=f&255;h=j&255;f=h>>>5;h=1<<(h&31);if(!(h&c[56940+((f|d[143788+i>>0]<<3)<<2)>>2]))if(!(c[56940+((d[144044+i>>0]<<3|f)<<2)>>2]&h))i=64;else {f=19;i=61;}else {f=18;i=61;}break}default:i=64;}while(0);if((i|0)==7){k=m;b=b+72|0;j=e;b:while(1){i=j;j=j+2|0;if((k-j|0)<=1){i=28;break}f=a[i+3>>0]|0;h=a[j>>0]|0;if(!(f<<24>>24))f=d[b+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 21:continue b;case 9:break;default:{i=27;break b}}if((i+4|0)==(m|0)){i=27;break}}if((i|0)==27){c[g>>2]=j;f=15;break}else if((i|0)==28){c[g>>2]=j;f=15;break}}else if((i|0)==61){l=b+72|0;h=e+2|0;c:while(1){e=f&255;d:while(1){k=m-h|0;if((k|0)<=1){i=104;break c}i=a[h+1>>0]|0;j=a[h>>0]|0;if(!(i<<24>>24))b=d[l+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 5:{i=73;break c}case 6:{i=74;break c}case 7:{i=76;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{i=78;break c}case 34:{i=94;break c}case 33:{i=97;break c}case 15:{i=100;break c}case 29:{k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){i=71;break c}break}case 27:case 26:case 25:case 24:case 22:break;case 23:{k=h+2|0;switch(e&63){case 41:{f=19;h=k;continue c}case 18:break d;default:{h=k;continue d}}}default:{i=103;break c}}h=h+2|0;}b=m-k|0;if((b|0)<=1){f=-1;break a}f=a[h+3>>0]|0;i=a[k>>0]|0;if(!(f<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(f,i)|0;switch(j|0){case 5:{i=89;break c}case 6:{i=90;break c}case 7:{i=92;break c}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(f&255)>>0]<<3)<<2)>>2])){i=87;break c}break}case 27:case 26:case 25:case 24:case 22:break;default:{f=19;h=k;continue c}}f=41;h=h+4|0;}switch(i|0){case 71:{c[g>>2]=h;f=0;break a}case 73:{c[g>>2]=h;f=0;break a}case 74:{if((k|0)<3){f=-2;break a}c[g>>2]=h;f=0;break a}case 76:{if((k|0)<4){f=-2;break a}c[g>>2]=h;f=0;break a}case 78:{c[g>>2]=h;break a}case 87:{c[g>>2]=k;f=0;break a}case 89:{c[g>>2]=k;f=0;break a}case 90:{if((b|0)<3){f=-2;break a}c[g>>2]=k;f=0;break a}case 92:{if((b|0)<4){f=-2;break a}c[g>>2]=k;f=0;break a}case 94:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=32;break a}case 97:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=31;break a}case 100:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=30;break a}case 103:{c[g>>2]=h;f=0;break a}case 104:{f=0-f|0;break a}}}else if((i|0)==64){c[g>>2]=e;f=0;break}}else f=-1;}else f=-4;while(0);return f|0}function u$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e+1>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e>>0]|0)>>0]|0;else f=J$(f,a[e>>0]|0)|0;do switch(f|0){case 2:{f=O$(b,e+2|0,i,g)|0;break a}case 3:{f=K$(b,e+2|0,i,g)|0;break a}case 9:{h=e+2|0;if((i-h|0)<=1){f=-3;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 4:{h=e+2|0;if((i-h|0)<=1){f=-5;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-5;break a}if((a[e+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=f;f=0;break a}else f=i;}else f=i;break}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:{h=e+2|0;f=i;}}while(0);j=b+72|0;b=h;b:while(1){e=f-b|0;if((e|0)<=1){h=52;break}h=a[b+1>>0]|0;i=a[b>>0]|0;if(!(h<<24>>24))h=d[j+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{h=50;break b}case 5:{b=b+2|0;continue b}case 6:{if((e|0)<3){h=38;break b}b=b+3|0;continue b}case 7:{if((e|0)<4){h=41;break b}b=b+4|0;continue b}case 4:{if((e|0)<=3){h=50;break b}h=b+2|0;if(a[b+3>>0]|0){b=h;continue b}if((a[h>>0]|0)!=93){b=h;continue b}if((e|0)<=5){h=50;break b}i=b+4|0;if(a[b+5>>0]|0){b=h;continue b}if((a[i>>0]|0)==62){h=49;break b}else {b=h;continue b}}default:{b=b+2|0;continue b}}}if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==41){c[g>>2]=b;f=6;break}else if((h|0)==49){c[g>>2]=i;f=0;break}else if((h|0)==50){c[g>>2]=b;f=6;break}else if((h|0)==52){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function v$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e+1>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e>>0]|0)>>0]|0;else f=J$(f,a[e>>0]|0)|0;switch(f|0){case 4:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}if((a[e+3>>0]|0)==0?(a[h>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-1;break a}if((a[e+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=e+6;f=40;break a}}break}case 9:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}f=a[e+3>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[h>>0]|0)>>0]|0;else f=J$(f,a[h>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;i=f;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;i=f;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;i=f;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:h=e+2|0;}j=b+72|0;b=h;b:while(1){e=i-b|0;if((e|0)<=1){h=40;break}f=a[b+1>>0]|0;h=a[b>>0]|0;if(!(f<<24>>24))f=d[j+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 9:case 8:case 1:case 0:case 4:{h=38;break b}case 6:{if((e|0)<3){h=35;break b}else f=3;break}case 7:{if((e|0)<4){h=37;break b}else f=4;break}default:f=2;}b=b+f|0;}if((h|0)==35){c[g>>2]=b;f=6;break}else if((h|0)==37){c[g>>2]=b;f=6;break}else if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==40){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function w$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f-e|0;k=(k&1|0)==0?f:e+(k&-2)|0;j=b+72|0;i=0;f=e;a:while(1){h=k-f|0;if((h|0)<=1){f=-1;break}b=a[f+1>>0]|0;e=a[f>>0]|0;if(!(b<<24>>24))b=d[j+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 8:case 1:case 0:{l=12;break a}case 5:{h=i;f=f+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}h=i;f=f+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}h=i;f=f+4|0;i=h;continue a}case 2:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[f+3>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=33){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[f+5>>0]|0){h=i;f=b;i=h;continue a}h=(a[b>>0]|0)==91;i=i+(h&1)|0;f=h?f+6|0:b;continue a}case 4:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[f+3>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=93){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[f+5>>0]|0){h=i;f=b;i=h;continue a}if((a[b>>0]|0)!=62){h=i;f=b;i=h;continue a}f=f+6|0;if(!i){l=26;break a}i=i+-1|0;continue a}default:{h=i;f=f+2|0;i=h;continue a}}}if((l|0)==12){c[g>>2]=f;f=0;}else if((l|0)==26){c[g>>2]=f;f=42;}return f|0}function x$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=30;break}h=a[j+1>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 2:{i=14;break a}case 10:{i=15;break a}case 9:{i=18;break a}case 21:{i=25;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=K$(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14){c[g>>2]=j;h=0;break}else if((i|0)==15)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==18){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==25)if((j|0)==(e|0)){c[g>>2]=e+2;h=39;break}else {c[g>>2]=j;h=6;break}else if((i|0)==30){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function y$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=29;break}h=a[j+1>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 30:{i=14;break a}case 10:{i=17;break a}case 9:{i=20;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=K$(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14)if((j|0)==(e|0)){h=L$(b,e+2|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=j;h=6;break}else if((i|0)==17)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==20){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==29){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function z$(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=7;break}if((f-b|0)<2){b=0;break}if(a[b+1>>0]|0){b=0;break}if((a[b>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+2|0;}if((g|0)==7)b=(b|0)==(d|0)&1;return b|0}function A$(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=b+72|0;f=c;a:while(1){b=a[f+1>>0]|0;e=a[f>>0]|0;if(!(b<<24>>24))b=d[g+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 5:{b=2;break}case 6:{b=3;break}case 7:{b=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{b=2;break}default:break a}f=f+b|0;}return f-c|0}function B$(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;a:while(1){b=a[c+1>>0]|0;e=a[c>>0]|0;if(!(b<<24>>24))b=d[f+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 21:case 9:case 10:break;default:break a}c=c+2|0;}return c|0}function C$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=b+72|0;m=0;n=0;b=1;a:while(1){l=e+2|0;i=e+3|0;h=a[i>>0]|0;j=h<<24>>24==0;k=a[l>>0]|0;if(j)h=d[o+(k&255)>>0]|0;else h=J$(h,k)|0;do switch(h|0){case 5:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 6:{if(b|0){j=b;k=n;l=m;e=i;b=j;n=k;m=l;continue a}if((n|0)>=(f|0)){k=n;l=m;b=1;e=i;n=k;m=l;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;k=n;l=m;b=1;e=i;n=k;m=l;continue a}case 7:{if(!b)if((n|0)<(f|0)){c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;b=1;}else b=1;k=n;l=m;e=e+4|0;n=k;m=l;continue a}case 24:case 22:case 29:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 12:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=12;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=12;b=2;e=l;n=k;continue a}if((m|0)!=12){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=12;n=n+1|0;b=0;e=l;continue a}case 13:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=13;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=13;b=2;e=l;n=k;continue a}if((m|0)!=13){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=13;n=n+1|0;b=0;e=l;continue a}case 3:{if((n|0)>=(f|0)){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}case 21:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}i=g+(n<<4)+12|0;if(!(a[i>>0]|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}do if(j&(l|0)!=(c[g+(n<<4)+4>>2]|0)&k<<24>>24==32){h=a[e+5>>0]|0;b=a[e+4>>0]|0;if(!(h<<24>>24)){if(b<<24>>24==32)break;b=d[o+(b&255)>>0]|0;}else b=J$(h,b)|0;if((b|0)!=(m|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}}while(0);a[i>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 10:case 9:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 17:case 11:if((b|0)==2){j=n;k=m;b=2;e=l;n=j;m=k;continue a}else break a;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}while(0)}return n|0}function D$(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+4|0;a:do if((a[c+5>>0]|0)==0?(a[b>>0]|0)==120:0){c=c+6|0;b=0;while(1){b:while(1){if(!(a[c+1>>0]|0)){d=a[c>>0]|0;if(d<<24>>24==59){e=17;break a}d=d<<24>>24;switch(d|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=8;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=9;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=10;break b}default:{}}}c=c+2|0;}if((e|0)==8){e=0;b=d+-48|b<<4;}else if((e|0)==9){e=0;b=(b<<4)+-55+d|0;}else if((e|0)==10){e=0;b=(b<<4)+-87+d|0;}if((b|0)<1114112)c=c+2|0;else {b=-1;break}}}else {d=b;b=0;e=13;}while(0);c:do if((e|0)==13)while(1){e=0;if(!(a[d+1>>0]|0)){c=a[d>>0]|0;if(c<<24>>24==59){e=17;break c}c=c<<24>>24;}else c=-1;b=(b*10|0)+-48+c|0;if((b|0)>=1114112){b=-1;break}else {d=d+2|0;e=13;}}while(0);if((e|0)==17)b=A_(b)|0;return b|0}function E$(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch((d-c|0)/2|0|0){case 2:{if((a[c+3>>0]|0)==0?(a[c+2>>0]|0)==116:0){if(!(a[c+1>>0]|0))b=a[c>>0]|0;else b=-1;b=(b|0)==108?60:(b|0)==103?62:0;}else e=27;break}case 3:{if((((((a[c+1>>0]|0)==0?(a[c>>0]|0)==97:0)?(a[c+3>>0]|0)==0:0)?(a[c+2>>0]|0)==109:0)?(a[c+5>>0]|0)==0:0)?(a[c+4>>0]|0)==112:0)b=38;else e=27;break}case 4:{if(!(a[c+1>>0]|0))switch(a[c>>0]|0){case 113:{if(a[c+3>>0]|0){e=27;break a}if((a[c+2>>0]|0)!=117){e=27;break a}if(a[c+5>>0]|0){e=27;break a}if((a[c+4>>0]|0)!=111){e=27;break a}if(a[c+7>>0]|0){e=27;break a}if((a[c+6>>0]|0)==116){b=34;break a}else {e=27;break a}}case 97:{if(a[c+3>>0]|0){e=27;break a}if((a[c+2>>0]|0)!=112){e=27;break a}if(a[c+5>>0]|0){e=27;break a}if((a[c+4>>0]|0)!=111){e=27;break a}if(a[c+7>>0]|0){e=27;break a}if((a[c+6>>0]|0)==115){b=39;break a}else {e=27;break a}}default:{e=27;break a}}else e=27;break}default:e=27;}while(0);if((e|0)==27)b=0;return b|0}function F$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=b+72|0;k=g+4|0;while(1){if((f-e|0)<=1)break;b=a[e+1>>0]|0;h=a[e>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;switch(b|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[k>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+2|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;i=e+2|0;if((f-i|0)>1){b=a[e+3>>0]|0;h=a[i>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;e=(b|0)==10?e+4|0:i;}else e=i;c[k>>2]=-1;break}default:e=e+2|0;}c[k>>2]=(c[k>>2]|0)+1;}return}function G$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f+-2|0;i=b+72|0;f=e;a:while(1){h=f+2|0;if((j-h|0)<=1){f=1;break}f=a[f+3>>0]|0;b=f<<24>>24==0;e=a[h>>0]|0;if(b)f=d[i+(e&255)>>0]|0;else f=J$(f,e)|0;switch(f|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:{f=h;continue a}case 21:if(b&e<<24>>24==9){k=12;break a}else {f=h;continue a}case 22:case 26:{if(!b){k=12;break a}if(e<<24>>24>=0){f=h;continue a}break}default:if(!b){k=12;break a}}switch(e<<24>>24|0){case 64:case 36:{f=h;break}default:{k=12;break a}}}if((k|0)==12){c[g>>2]=h;f=0;}return f|0}function H$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[e>>2]|0;k=j+(f-j&-2)|0;l=k;m=h;a:while(1){if(j>>>0>=k>>>0){b=0;break}i=a[j>>0]|0;b=a[j+1>>0]|0;f=b&255;switch(b<<24>>24){case 0:{if(i<<24>>24>-1){b=c[g>>2]|0;if((b|0)==(h|0)){b=2;break a}c[g>>2]=b+1;a[b>>0]=i;b=j;}else n=7;break}case 7:case 6:case 5:case 4:case 3:case 2:case 1:{n=7;break}case -37:case -38:case -39:case -40:{b=c[g>>2]|0;if((m-b|0)<4){b=2;break a}if((l-j|0)<4){b=1;break a}o=i&255;i=(f<<2&12|o>>>6)+1|0;c[g>>2]=b+1;a[b>>0]=i>>>2|240;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>2&15|i<<4&48|128;b=j+2|0;i=d[b>>0]|0;f=(o<<4&48|i>>>6|a[j+3>>0]<<2&12|128)&255;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=f;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=i&63|128;break}default:{b=c[g>>2]|0;if((m-b|0)<3){b=2;break a}c[g>>2]=b+1;a[b>>0]=f>>>4|224;o=i&255;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2&60|128;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}}if((n|0)==7){n=0;b=c[g>>2]|0;if((m-b|0)<2){b=2;break}o=i&255;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2|192;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}j=b+2|0;}c[e>>2]=j;return b|0}function I$(e,f,g,h,i){e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0;j=c[f>>2]|0;l=g-j&-2;e=j+l|0;if((l|0)>(i-(c[h>>2]|0)|0)){k=e+-2|0;g=(a[k+1>>0]&-8)<<24>>24==-40;l=g&1;e=g?k:e;}else l=0;g=j;while(1){j=g>>>0>>0;k=c[h>>2]|0;if(!(j&k>>>0>>0))break;j=((d[g+1>>0]|0)<<8|(d[g>>0]|0))&65535;c[h>>2]=k+2;b[k>>1]=j;k=(c[f>>2]|0)+2|0;c[f>>2]=k;g=k;}return ((k|0)!=(i|0)|j^1?l:2)|0}function J$(a,b){a=a|0;b=b|0;var c=0;switch(a<<24>>24){case -37:case -38:case -39:case -40:{a=7;break}case -33:case -34:case -35:case -36:{a=8;break}case -1:{if((b&255)>253)a=0;else c=4;break}default:c=4;}if((c|0)==4)a=29;return a|0}function K$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=f;j=l-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;b=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;b=0;break a}case 6:{if((j|0)<3){b=-2;break a}c[g>>2]=e;b=0;break a}case 7:{if((j|0)<4){b=-2;break a}c[g>>2]=e;b=0;break a}case 19:{b=M$(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;b=0;break a}}k=b+72|0;j=e;b:while(1){i=j+2|0;e=l-i|0;if((e|0)<=1){b=-1;break a}b=a[j+3>>0]|0;h=a[i>>0]|0;if(!(b<<24>>24))f=d[k+(h&255)>>0]|0;else f=J$(b,h)|0;switch(f|0){case 27:case 26:case 25:case 24:case 22:{j=i;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=h&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(b&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else j=i;}if((h|0)==22){c[g>>2]=i;b=0;break}else if((h|0)==23){c[g>>2]=i;b=0;break}else if((h|0)==24){if((e|0)<3){b=-2;break}c[g>>2]=i;b=0;break}else if((h|0)==26){if((e|0)<4){b=-2;break}c[g>>2]=i;b=0;break}else if((h|0)==28){c[g>>2]=j+4;b=9;break}else if((h|0)==29){c[g>>2]=i;b=0;break}}else b=-1;while(0);return b|0}function L$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){k=b+2|0;e=f-k|0;if((e|0)<=1){f=-1;break a}h=a[b+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:{b=k;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else b=k;}if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){c[g>>2]=k;f=0;break}else if((h|0)==24){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==26){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==28){c[g>>2]=b+4;f=28;break}else if((h|0)==29){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function M$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=f;a:do if((k-e|0)>1){i=a[e+1>>0]|0;h=a[e>>0]|0;do if(!(i<<24>>24))if(h<<24>>24==120){h=N$(b,e+2|0,f,g)|0;break a}else {h=d[b+72+(h&255)>>0]|0;break}else h=J$(i,h)|0;while(0);if((h|0)!=25){c[g>>2]=e;h=0;break}j=b+72|0;b=e;b:while(1){i=b+2|0;if((k-i|0)<=1){h=-1;break a}h=a[b+3>>0]|0;f=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(f&255)>>0]|0;else h=J$(h,f)|0;switch(h|0){case 25:{b=i;break}case 18:{f=15;break b}default:{f=16;break b}}}if((f|0)==15){c[g>>2]=b+4;h=10;break}else if((f|0)==16){c[g>>2]=i;h=0;break}}else h=-1;while(0);return h|0}function N$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;a:do if((f-e|0)>1){h=a[e+1>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e>>0]|0)>>0]|0;else h=J$(h,a[e>>0]|0)|0;if((h&-2|0)!=24){c[g>>2]=e;f=0;break}j=b+72|0;b:while(1){i=e+2|0;if((f-i|0)<=1){f=-1;break a}h=a[e+3>>0]|0;b=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 25:{e=i;break}case 18:{h=13;break b}default:{h=14;break b}}}if((h|0)==13){c[g>>2]=e+4;f=10;break}else if((h|0)==14){c[g>>2]=i;f=0;break}}else f=-1;while(0);return f|0}function O$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=f;j=o-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;h=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;h=0;break a}case 6:{if((j|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 7:{if((j|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 16:{i=e+2|0;if((o-i|0)<=1){h=-1;break a}h=a[e+3>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[i>>0]|0)>>0]|0;else h=J$(h,a[i>>0]|0)|0;switch(h|0){case 27:{h=P$(b,e+4|0,f,g)|0;break a}case 20:{h=Q$(e+4|0,f,g)|0;break a}default:{c[g>>2]=i;h=0;break a}}}case 15:{h=R$(b,e+2|0,f,g)|0;break a}case 17:{h=S$(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}m=b+72|0;l=0;h=e+2|0;b:while(1){c:while(1){i=o-h|0;if((i|0)<=1){h=-1;break a}j=a[h+1>>0]|0;k=a[h>>0]|0;if(!(j<<24>>24))e=d[m+(k&255)>>0]|0;else e=J$(j,k)|0;switch(e|0){case 5:{n=34;break b}case 6:{n=35;break b}case 7:{n=37;break b}case 10:case 9:case 21:{n=55;break b}case 11:{n=69;break b}case 17:break b;case 23:break c;case 29:{e=k&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(j&255)>>0]<<3)<<2)>>2])){n=32;break b}break}case 27:case 26:case 25:case 24:case 22:break;default:{n=75;break b}}h=h+2|0;}if(l|0){n=40;break}k=h+2|0;e=o-k|0;if((e|0)<=1){h=-1;break a}l=a[h+3>>0]|0;i=a[k>>0]|0;if(!(l<<24>>24))j=d[m+(i&255)>>0]|0;else j=J$(l,i)|0;switch(j|0){case 5:{n=49;break b}case 6:{n=50;break b}case 7:{n=52;break b}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[143788+(l&255)>>0]<<3)<<2)>>2])){n=47;break b}break}case 24:case 22:break;default:{n=54;break b}}l=1;h=h+4|0;}d:switch(n|0){case 32:{c[g>>2]=h;h=0;break a}case 34:{c[g>>2]=h;h=0;break a}case 35:{if((i|0)<3){h=-2;break a}c[g>>2]=h;h=0;break a}case 37:{if((i|0)<4){h=-2;break a}c[g>>2]=h;h=0;break a}case 40:{c[g>>2]=h;h=0;break a}case 47:{c[g>>2]=k;h=0;break a}case 49:{c[g>>2]=k;h=0;break a}case 50:{if((e|0)<3){h=-2;break a}c[g>>2]=k;h=0;break a}case 52:{if((e|0)<4){h=-2;break a}c[g>>2]=k;h=0;break a}case 54:{c[g>>2]=k;h=0;break a}case 55:{e:while(1){n=0;i=h+2|0;j=o-i|0;if((j|0)<=1){h=-1;break a}k=a[h+3>>0]|0;e=a[i>>0]|0;if(!(k<<24>>24))l=d[m+(e&255)>>0]|0;else l=J$(k,e)|0;switch(l|0){case 11:{h=i;n=69;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;n=55;break}case 29:{n=60;break e}case 24:case 22:break e;case 5:{n=63;break e}case 6:{n=64;break e}case 7:{n=66;break e}default:{n=68;break e}}}if((n|0)==60){o=e&255;if(!(1<<(o&31)&c[56940+((o>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=i;h=0;break a}}else if((n|0)==63){c[g>>2]=i;h=0;break a}else if((n|0)==64){if((j|0)<3){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==66){if((j|0)<4){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==68){c[g>>2]=i;h=0;break a}h=T$(b,h+4|0,f,g)|0;break a}case 75:{c[g>>2]=h;h=0;break a}}if((n|0)==69){c[g>>2]=h+2;h=2;break}i=h+2|0;if((o-i|0)>1){if((a[h+3>>0]|0)==0?(a[i>>0]|0)==62:0){c[g>>2]=h+4;h=4;break}c[g>>2]=i;h=0;}else h=-1;}else h=-1;while(0);return h|0}function P$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f;a:do if((j-e|0)>1){if((a[e+1>>0]|0)==0?(a[e>>0]|0)==45:0){i=b+72|0;h=e+2|0;b:while(1){e=j-h|0;if((e|0)<=1){f=-1;break a}f=a[h+1>>0]|0;b=a[h>>0]|0;if(!(f<<24>>24))f=d[i+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 8:case 1:case 0:{k=16;break b}case 5:{h=h+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}h=h+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}h=h+4|0;continue b}case 27:{f=h+2|0;if((j-f|0)<=1){f=-1;break a}if(a[h+3>>0]|0){h=f;continue b}if((a[f>>0]|0)==45)break b;else {h=f;continue b}}default:{h=h+2|0;continue b}}}if((k|0)==16){c[g>>2]=h;f=0;break}f=h+4|0;if((j-f|0)<=1){f=-1;break}if((a[h+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=h+6;f=13;break}c[g>>2]=f;f=0;break}c[g>>2]=e;f=0;}else f=-1;while(0);return f|0}function Q$(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>11){d=0;while(1){if((d|0)>=6){d=8;break}if(a[b+1>>0]|0){d=0;break}if((a[b>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+2|0;}c[e>>2]=b;}else d=-1;return d|0}function R$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;j=o-e|0;a:do if((j|0)>1){f=a[e+1>>0]|0;if(!(f<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(f,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(f&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}m=b+72|0;k=e;b:while(1){f=k+2|0;h=o-f|0;if((h|0)<=1){f=-1;break a}i=a[k+3>>0]|0;j=a[f>>0]|0;if(!(i<<24>>24))b=d[m+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 27:case 26:case 25:case 24:case 22:{k=f;continue b}case 5:{n=22;break b}case 6:{n=23;break b}case 7:{n=25;break b}case 10:case 9:case 21:{n=27;break b}case 15:{n=46;break b}case 29:break;default:break b}k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){n=21;break}else k=f;}if((n|0)==21){c[g>>2]=f;f=0;break}else if((n|0)==22){c[g>>2]=f;f=0;break}else if((n|0)==23){if((h|0)<3){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==25){if((h|0)<4){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==27){if(!(U$(e,f,p)|0)){c[g>>2]=f;f=0;break}j=k+4|0;c:while(1){i=o-j|0;if((i|0)<=1){f=-1;break a}f=a[j+1>>0]|0;h=a[j>>0]|0;if(!(f<<24>>24))f=d[m+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 8:case 1:case 0:{n=40;break c}case 5:{j=j+2|0;continue c}case 6:{if((i|0)<3){f=-2;break a}j=j+3|0;continue c}case 7:{if((i|0)<4){f=-2;break a}j=j+4|0;continue c}case 15:{f=j+2|0;if((o-f|0)<=1){f=-1;break a}if(a[j+3>>0]|0){j=f;continue c}if((a[f>>0]|0)==62){n=44;break c}else {j=f;continue c}}default:{j=j+2|0;continue c}}}if((n|0)==40){c[g>>2]=j;f=0;break}else if((n|0)==44){c[g>>2]=j+4;f=c[p>>2]|0;break}}else if((n|0)==46){if(!(U$(e,f,p)|0)){c[g>>2]=f;f=0;break}f=k+4|0;if((o-f|0)<=1){f=-1;break}if((a[k+5>>0]|0)==0?(a[f>>0]|0)==62:0){c[g>>2]=k+6;f=c[p>>2]|0;break}}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function S$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){j=b+2|0;e=f-j|0;if((e|0)<=1){f=-1;break a}h=a[b+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))k=d[l+(i&255)>>0]|0;else k=J$(h,i)|0;switch(k|0){case 23:case 27:case 26:case 25:case 24:case 22:{b=j;continue b}case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 10:case 9:case 21:{h=27;break b}case 11:{h=34;break b}case 29:break;default:{h=35;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}else b=j;}if((h|0)==21){c[g>>2]=j;f=0;break}else if((h|0)==22){c[g>>2]=j;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==27){c:while(1){k=j+2|0;if((f-k|0)<=1){f=-1;break a}h=a[j+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 21:{j=k;h=27;break}case 11:{h=32;break c}default:{h=33;break c}}}if((h|0)==32){c[g>>2]=j+4;f=5;break}else if((h|0)==33){c[g>>2]=k;f=0;break}}else if((h|0)==34){c[g>>2]=b+4;f=5;break}else if((h|0)==35){c[g>>2]=j;f=0;break}}else f=-1;while(0);return f|0}function T$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;c[q>>2]=e;r=f;o=b+72|0;h=0;a:while(1){b:while(1){m=r-e|0;if((m|0)<=1){e=-1;break a}i=a[e+1>>0]|0;j=a[e>>0]|0;if(!(i<<24>>24))k=d[o+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{p=11;break a}case 6:{p=12;break a}case 7:{p=14;break a}case 23:{p=16;break b}case 10:case 9:case 21:{p=31;break b}case 14:{p=37;break b}case 29:{n=j&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){p=9;break a}break}case 27:case 26:case 25:case 24:case 22:break;default:{p=89;break a}}n=e+2|0;c[q>>2]=n;e=n;}c:do if((p|0)==16){p=0;if(h|0){p=17;break a}h=e+2|0;c[q>>2]=h;i=h;j=r-i|0;if((j|0)<=1){e=-1;break a}k=a[e+3>>0]|0;m=a[h>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=25;break a}case 6:{p=26;break a}case 7:{p=28;break a}case 24:case 22:{h=1;break c}case 29:break;default:{p=30;break a}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=24;break a}else h=1;}else if((p|0)==31)while(1){p=0;i=e+2|0;c[q>>2]=i;j=i;if((r-j|0)<=1){e=-1;break a}e=a[e+3>>0]|0;h=a[i>>0]|0;if(!(e<<24>>24))e=d[o+(h&255)>>0]|0;else e=J$(e,h)|0;switch(e|0){case 14:{e=i;p=37;break c}case 9:case 10:case 21:{e=i;p=31;break}default:{p=36;break a}}}while(0);d:do if((p|0)==37){while(1){p=0;j=e+2|0;c[q>>2]=j;k=j;if((r-k|0)<=1){e=-1;break a}h=a[e+3>>0]|0;i=a[j>>0]|0;if(!(h<<24>>24))m=d[o+(i&255)>>0]|0;else m=J$(h,i)|0;if((m|1|0)==13)break;switch(m|0){case 9:case 10:case 21:{e=j;p=37;break}default:{p=43;break a}}}e=e+4|0;c[q>>2]=e;e:while(1){j=r-e|0;if((j|0)<=1){e=-1;break a}h=a[e+1>>0]|0;i=a[e>>0]|0;if(!(h<<24>>24))h=d[o+(i&255)>>0]|0;else h=J$(h,i)|0;if((h|0)==(m|0))break;switch(h|0){case 8:case 1:case 0:{p=56;break a}case 2:{p=61;break a}case 5:{n=e+2|0;c[q>>2]=n;e=n;continue e}case 6:{if((j|0)<3){e=-2;break a}n=e+3|0;c[q>>2]=n;e=n;continue e}case 7:{if((j|0)<4){e=-2;break a}n=e+4|0;c[q>>2]=n;e=n;continue e}case 3:{e=K$(b,e+2|0,f,q)|0;if((e|0)<1){p=59;break a}e=c[q>>2]|0;continue e}default:{n=e+2|0;c[q>>2]=n;e=n;continue e}}}i=e+2|0;c[q>>2]=i;k=i;if((r-k|0)<=1){e=-1;break a}h=a[e+3>>0]|0;j=a[i>>0]|0;if(!(h<<24>>24))h=d[o+(j&255)>>0]|0;else h=J$(h,j)|0;switch(h|0){case 11:{p=81;break a}case 17:{p=82;break a}case 10:case 9:case 21:{e=i;break}default:{p=68;break a}}f:while(1){i=e+2|0;c[q>>2]=i;h=i;j=r-h|0;if((j|0)<=1){e=-1;break a}k=a[e+3>>0]|0;m=a[i>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=76;break a}case 6:{p=77;break a}case 7:{p=79;break a}case 11:{p=81;break a}case 17:{p=82;break a}case 24:case 22:{h=0;break d}case 10:case 9:case 21:{e=i;break}case 29:break f;default:{p=87;break a}}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=75;break a}else h=0;}while(0);e=e+4|0;c[q>>2]=e;}switch(p|0){case 9:{c[g>>2]=e;e=0;break}case 11:{c[g>>2]=e;e=0;break}case 12:{if((m|0)<3)e=-2;else {c[g>>2]=e;e=0;}break}case 14:{if((m|0)<4)e=-2;else {c[g>>2]=e;e=0;}break}case 17:{c[g>>2]=e;e=0;break}case 24:{c[g>>2]=h;e=0;break}case 25:{c[g>>2]=h;e=0;break}case 26:{if((j|0)<3)e=-2;else {c[g>>2]=h;e=0;}break}case 28:{if((j|0)<4)e=-2;else {c[g>>2]=h;e=0;}break}case 30:{c[g>>2]=i;e=0;break}case 36:{c[g>>2]=j;e=0;break}case 43:{c[g>>2]=k;e=0;break}case 56:{c[g>>2]=e;e=0;break}case 59:{if(!e){c[g>>2]=c[q>>2];e=0;}break}case 61:{c[g>>2]=e;e=0;break}case 68:{c[g>>2]=k;e=0;break}case 75:{c[g>>2]=i;e=0;break}case 76:{c[g>>2]=i;e=0;break}case 77:{if((j|0)<3)e=-2;else {c[g>>2]=i;e=0;}break}case 79:{if((j|0)<4)e=-2;else {c[g>>2]=i;e=0;}break}case 81:{c[g>>2]=e+4;e=1;break}case 82:{h=i+2|0;c[q>>2]=h;e=h;if((r-e|0)>1){if((a[i+3>>0]|0)==0?(a[h>>0]|0)==62:0){c[g>>2]=i+4;e=3;break}c[g>>2]=e;e=0;}else e=-1;break}case 87:{c[g>>2]=h;e=0;break}case 89:{c[g>>2]=e;e=0;break}}l=s;return e|0}function U$(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==6?(a[b+1>>0]|0)==0:0){switch(a[b>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}if(!(a[b+3>>0]|0)){switch(a[b+2>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}if(!(a[b+5>>0]|0)){switch(a[b+4>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;}else d=1;}else d=1;while(0);return d|0}function V$(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;k=e+72|0;a:while(1){b:while(1){j=g-f|0;if((j|0)<=1){f=-1;break a}e=a[f+1>>0]|0;i=a[f>>0]|0;if(!(e<<24>>24))e=d[k+(i&255)>>0]|0;else e=J$(e,i)|0;switch(e|0){case 8:case 1:case 0:{l=10;break a}case 6:{l=9;break b}case 7:{l=19;break b}case 5:{f=f+2|0;continue b}case 13:case 12:{i=f+2|0;if((e|0)==(b|0)){l=12;break a}else {f=i;continue b}}default:{f=f+2|0;continue b}}}if((l|0)==9){l=0;if((j|0)<3){f=-2;break}else {f=f+3|0;continue}}else if((l|0)==19){l=0;if((j|0)<4){f=-2;break}else {f=f+4|0;continue}}}c:do if((l|0)==10){c[h>>2]=f;f=0;}else if((l|0)==12)if((g-i|0)>1){c[h>>2]=i;g=a[f+3>>0]|0;f=a[i>>0]|0;if(!(g<<24>>24))f=d[k+(f&255)>>0]|0;else f=J$(g,f)|0;switch(f|0){case 20:case 30:case 11:case 10:case 9:case 21:{f=27;break c}default:{}}f=0;}else f=-27;while(0);return f|0}function W$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;a:do if((k-e|0)>1){h=a[e+1>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e>>0]|0)>>0]|0;else h=J$(h,a[e>>0]|0)|0;switch(h|0){case 27:{h=P$(b,e+2|0,f,g)|0;break a}case 20:{c[g>>2]=e+2;h=33;break a}case 24:case 22:{j=b+72|0;b:while(1){i=e+2|0;f=k-i|0;if((f|0)<=1){h=-1;break a}h=a[e+3>>0]|0;b=a[i>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 22:{e=i;break}case 30:{l=15;break b}case 10:case 9:case 21:break b;default:{l=22;break b}}}if((l|0)==22){c[g>>2]=i;h=0;break a}c:do if((l|0)==15){if((f|0)<=3){h=-1;break a}b=a[e+5>>0]|0;h=a[e+4>>0]|0;if(!(b<<24>>24))h=d[j+(h&255)>>0]|0;else h=J$(b,h)|0;switch(h|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=i;h=0;break a}while(0);c[g>>2]=i;h=16;break a}default:{c[g>>2]=e;h=0;break a}}}else h=-1;while(0);return h|0}function X$(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f-e|0;a:do if((j|0)>1){k=a[e+1>>0]|0;if(!(k<<24>>24)){i=a[e>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}b=b+72|0;k=e;b:while(1){h=k;k=k+2|0;e=f-k|0;if((e|0)<=1){f=-20;break a}h=a[h+3>>0]|0;i=a[k>>0]|0;if(!(h<<24>>24))j=d[b+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:continue b;case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=27;break b}case 29:break;default:{h=28;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}}if((h|0)==21){c[g>>2]=k;f=0;break}else if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==27){c[g>>2]=k;f=20;break}else if((h|0)==28){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function Y$(b,d,e){b=b|0;d=d|0;e=e|0;e=Z$(e)|0;if((e|0)==-1)e=0;else {a[b+69>>0]=e;c[b>>2]=67;c[b+4>>2]=68;c[b+48>>2]=31;c[b+72>>2]=d;c[d>>2]=b;e=1;}return e|0}function Z$(a){a=a|0;var b=0;a:do if(!a)b=6;else {b=0;while(1){if((b|0)>=6){b=-1;break a}if(H0(a,c[60068+(b<<2)>>2]|0)|0)break a;b=b+1|0;}}while(0);return b|0}function _$(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(58948,a,0,b,c,d)|0}function $$(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(58948,a,1,b,c,d)|0}function a0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S_(58584,b,c,d);return}function b0(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;a:do if(f>>>0>>0){l=c[d+72>>2]|0;i=f+1|0;b:do if((i|0)==(g|0)){i=a[d+69>>0]|0;if(((i<<24>>24)+-3|0)>>>0<3){i=-1;break a}switch(a[f>>0]|0){case 60:case 0:{i=-1;break a}case -17:case -1:case -2:break;default:break b}if(!((e|0)==1&i<<24>>24==0)){i=-1;break a}}else {k=a[f>>0]|0;i=a[i>>0]|0;j=((k&255)<<8|i&255)&65535;c:do if(j<<16>>16<-2){if(j<<16>>16>=-257){switch(j<<16>>16){case -257:break;default:break c}if((e|0)==1&(a[d+69>>0]|0)==0)break b;c[h>>2]=f+2;c[l>>2]=c[b+16>>2];i=14;break a}switch(j<<16>>16){case -4165:break;default:break c}if((e|0)==1)switch(a[d+69>>0]|0){case 0:case 3:case 4:case 5:break b;default:{}}i=f+2|0;if((i|0)==(g|0)){i=-1;break a}if((a[i>>0]|0)!=-65)break b;c[h>>2]=f+3;c[l>>2]=c[b+8>>2];i=14;break a}else {if(j<<16>>16<15360){switch(j<<16>>16){case -2:break;default:break c}if((e|0)==1&(a[d+69>>0]|0)==0)break b;c[h>>2]=f+2;c[l>>2]=c[b+20>>2];i=14;break a}switch(j<<16>>16){case 15360:break;default:break c}i=a[d+69>>0]|0;if(i<<24>>24==4){if((e|0)==1)break b}else if((e|0)==1&i<<24>>24==3)break b;i=c[b+20>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}while(0);if(k<<24>>24){if((e|0)==1|i<<24>>24!=0)break;i=c[b+20>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}if((e|0)==1?(a[d+69>>0]|0)==5:0)break;i=c[b+16>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;break a}while(0);i=c[b+(a[d+69>>0]<<2)>>2]|0;c[l>>2]=i;i=ob[c[i+(e<<2)>>2]&127](i,f,g,h)|0;}else i=-4;while(0);return i|0}function c0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a:do if(e>>>0>>0){i=e;m=f-i|0;k=(m&1|0)==0;m=m&-2;l=(m|0)==0;m=k|l?f:e+m|0;if(k|l^1){f=a[e>>0]|0;if(!(f<<24>>24)){h=a[e+1>>0]|0;j=h;h=d[b+72+(h&255)>>0]|0;}else {h=a[e+1>>0]|0;j=h;h=J$(f,h)|0;}do switch(h|0){case 12:{f=D0(12,b,e+2|0,m,g)|0;break a}case 13:{f=D0(13,b,e+2|0,m,g)|0;break a}case 2:{h=e+2|0;if((m-h|0)<=1){f=-1;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;switch(f|0){case 16:{f=E0(b,e+4|0,m,g)|0;break a}case 15:{f=z0(b,e+4|0,m,g)|0;break a}case 7:case 6:case 5:case 29:case 24:case 22:{c[g>>2]=e;f=29;break a}default:{c[g>>2]=h;f=0;break a}}}case 9:{if((e+2|0)==(m|0)){c[g>>2]=m;f=-15;break a}else i=7;break}case 10:case 21:{i=7;break}case 30:{f=t0(b,e+2|0,m,g)|0;break a}case 35:{c[g>>2]=e+2;f=38;break a}case 20:{c[g>>2]=e+2;f=25;break a}case 4:{h=e+2|0;f=m-h|0;if((f|0)<=1){f=-26;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){if((f|0)<=3){f=-1;break a}if((a[e+4>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=e+6;f=34;break a}}c[g>>2]=h;f=26;break a}case 31:{c[g>>2]=e+2;f=23;break a}case 32:{h=e+2|0;if((m-h|0)<=1){f=-24;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;switch(f|0){case 33:{c[g>>2]=e+4;f=36;break a}case 15:{c[g>>2]=e+4;f=35;break a}case 34:{c[g>>2]=e+4;f=37;break a}case 32:case 36:case 35:case 11:case 21:case 10:case 9:{c[g>>2]=h;f=24;break a}default:{c[g>>2]=h;f=0;break a}}}case 36:{c[g>>2]=e+2;f=21;break a}case 11:{c[g>>2]=e+2;f=17;break a}case 19:{f=F0(b,e+2|0,m,g)|0;break a}case 5:{if((m-i|0)<2){f=-2;break a}c[g>>2]=e;f=0;break a}case 6:{if((m-i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((m-i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 24:case 22:{f=18;i=61;break}case 23:case 27:case 26:case 25:{f=19;i=61;break}case 29:{i=f&255;h=j&255;f=h>>>5;h=1<<(h&31);if(!(h&c[56940+((f|d[143788+i>>0]<<3)<<2)>>2]))if(!(c[56940+((d[144044+i>>0]<<3|f)<<2)>>2]&h))i=64;else {f=19;i=61;}else {f=18;i=61;}break}default:i=64;}while(0);if((i|0)==7){k=m;b=b+72|0;j=e;b:while(1){i=j;j=j+2|0;if((k-j|0)<=1){i=28;break}f=a[j>>0]|0;h=a[i+3>>0]|0;if(!(f<<24>>24))f=d[b+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 21:continue b;case 9:break;default:{i=27;break b}}if((i+4|0)==(m|0)){i=27;break}}if((i|0)==27){c[g>>2]=j;f=15;break}else if((i|0)==28){c[g>>2]=j;f=15;break}}else if((i|0)==61){l=b+72|0;h=e+2|0;c:while(1){e=f&255;d:while(1){k=m-h|0;if((k|0)<=1){i=104;break c}i=a[h>>0]|0;j=a[h+1>>0]|0;if(!(i<<24>>24))b=d[l+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 5:{i=73;break c}case 6:{i=74;break c}case 7:{i=76;break c}case 10:case 9:case 21:case 30:case 20:case 36:case 35:case 32:case 11:{i=78;break c}case 34:{i=94;break c}case 33:{i=97;break c}case 15:{i=100;break c}case 29:{k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){i=71;break c}break}case 27:case 26:case 25:case 24:case 22:break;case 23:{k=h+2|0;switch(e&63){case 41:{f=19;h=k;continue c}case 18:break d;default:{h=k;continue d}}}default:{i=103;break c}}h=h+2|0;}b=m-k|0;if((b|0)<=1){f=-1;break a}f=a[k>>0]|0;i=a[h+3>>0]|0;if(!(f<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(f,i)|0;switch(j|0){case 5:{i=89;break c}case 6:{i=90;break c}case 7:{i=92;break c}case 29:{e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(f&255)>>0]<<3)<<2)>>2])){i=87;break c}break}case 27:case 26:case 25:case 24:case 22:break;default:{f=19;h=k;continue c}}f=41;h=h+4|0;}switch(i|0){case 71:{c[g>>2]=h;f=0;break a}case 73:{c[g>>2]=h;f=0;break a}case 74:{if((k|0)<3){f=-2;break a}c[g>>2]=h;f=0;break a}case 76:{if((k|0)<4){f=-2;break a}c[g>>2]=h;f=0;break a}case 78:{c[g>>2]=h;break a}case 87:{c[g>>2]=k;f=0;break a}case 89:{c[g>>2]=k;f=0;break a}case 90:{if((b|0)<3){f=-2;break a}c[g>>2]=k;f=0;break a}case 92:{if((b|0)<4){f=-2;break a}c[g>>2]=k;f=0;break a}case 94:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=32;break a}case 97:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=31;break a}case 100:if((f|0)==19){c[g>>2]=h;f=0;break a}else {c[g>>2]=h+2;f=30;break a}case 103:{c[g>>2]=h;f=0;break a}case 104:{f=0-f|0;break a}}}else if((i|0)==64){c[g>>2]=e;f=0;break}}else f=-1;}else f=-4;while(0);return f|0}function d0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+1>>0]|0)>>0]|0;else f=J$(f,a[e+1>>0]|0)|0;do switch(f|0){case 2:{f=w0(b,e+2|0,i,g)|0;break a}case 3:{f=s0(b,e+2|0,i,g)|0;break a}case 9:{h=e+2|0;if((i-h|0)<=1){f=-3;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 4:{h=e+2|0;if((i-h|0)<=1){f=-5;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-5;break a}if((a[f>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=f;f=0;break a}else f=i;}else f=i;break}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:{h=e+2|0;f=i;}}while(0);j=b+72|0;b=h;b:while(1){e=f-b|0;if((e|0)<=1){h=52;break}h=a[b>>0]|0;i=a[b+1>>0]|0;if(!(h<<24>>24))h=d[j+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 8:case 1:case 0:case 2:case 3:{h=50;break b}case 5:{b=b+2|0;continue b}case 6:{if((e|0)<3){h=38;break b}b=b+3|0;continue b}case 7:{if((e|0)<4){h=41;break b}b=b+4|0;continue b}case 4:{if((e|0)<=3){h=50;break b}h=b+2|0;if(a[h>>0]|0){b=h;continue b}if((a[b+3>>0]|0)!=93){b=h;continue b}if((e|0)<=5){h=50;break b}i=b+4|0;if(a[i>>0]|0){b=h;continue b}if((a[b+5>>0]|0)==62){h=49;break b}else {b=h;continue b}}default:{b=b+2|0;continue b}}}if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==41){c[g>>2]=b;f=6;break}else if((h|0)==49){c[g>>2]=i;f=0;break}else if((h|0)==50){c[g>>2]=b;f=6;break}else if((h|0)==52){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function e0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(e>>>0>>0){h=e;i=f-h|0;k=(i&1|0)==0;i=i&-2;j=(i|0)==0;i=k|j?f:e+i|0;if(k|j^1){f=a[e>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+1>>0]|0)>>0]|0;else f=J$(f,a[e+1>>0]|0)|0;switch(f|0){case 4:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}if((a[h>>0]|0)==0?(a[e+3>>0]|0)==93:0){f=e+4|0;if((i-f|0)<=1){f=-1;break a}if((a[f>>0]|0)==0?(a[e+5>>0]|0)==62:0){c[g>>2]=e+6;f=40;break a}}break}case 9:{h=e+2|0;if((i-h|0)<=1){f=-1;break a}f=a[h>>0]|0;if(!(f<<24>>24))f=d[b+72+(d[e+3>>0]|0)>>0]|0;else f=J$(f,a[e+3>>0]|0)|0;c[g>>2]=(f|0)==10?e+4|0:h;f=7;break a}case 10:{c[g>>2]=e+2;f=7;break a}case 5:{f=i;if((f-h|0)<2){f=-2;break a}h=e+2|0;i=f;break}case 6:{f=i;if((f-h|0)<3){f=-2;break a}h=e+3|0;i=f;break}case 7:{f=i;if((f-h|0)<4){f=-2;break a}h=e+4|0;i=f;break}case 8:case 1:case 0:{c[g>>2]=e;f=0;break a}default:h=e+2|0;}j=b+72|0;b=h;b:while(1){e=i-b|0;if((e|0)<=1){h=40;break}f=a[b>>0]|0;h=a[b+1>>0]|0;if(!(f<<24>>24))f=d[j+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 10:case 9:case 8:case 1:case 0:case 4:{h=38;break b}case 6:{if((e|0)<3){h=35;break b}else f=3;break}case 7:{if((e|0)<4){h=37;break b}else f=4;break}default:f=2;}b=b+f|0;}if((h|0)==35){c[g>>2]=b;f=6;break}else if((h|0)==37){c[g>>2]=b;f=6;break}else if((h|0)==38){c[g>>2]=b;f=6;break}else if((h|0)==40){c[g>>2]=b;f=6;break}}else f=-1;}else f=-4;while(0);return f|0}function f0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f-e|0;k=(k&1|0)==0?f:e+(k&-2)|0;j=b+72|0;i=0;f=e;a:while(1){h=k-f|0;if((h|0)<=1){f=-1;break}b=a[f>>0]|0;e=a[f+1>>0]|0;if(!(b<<24>>24))b=d[j+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 8:case 1:case 0:{l=12;break a}case 5:{h=i;f=f+2|0;i=h;continue a}case 6:{if((h|0)<3){f=-2;break a}h=i;f=f+3|0;i=h;continue a}case 7:{if((h|0)<4){f=-2;break a}h=i;f=f+4|0;i=h;continue a}case 2:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+3>>0]|0)!=33){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}h=(a[f+5>>0]|0)==91;i=i+(h&1)|0;f=h?f+6|0:b;continue a}case 4:{b=f+2|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+3>>0]|0)!=93){h=i;f=b;i=h;continue a}b=f+4|0;if((k-b|0)<=1){f=-1;break a}if(a[b>>0]|0){h=i;f=b;i=h;continue a}if((a[f+5>>0]|0)!=62){h=i;f=b;i=h;continue a}f=f+6|0;if(!i){l=26;break a}i=i+-1|0;continue a}default:{h=i;f=f+2|0;i=h;continue a}}}if((l|0)==12){c[g>>2]=f;f=0;}else if((l|0)==26){c[g>>2]=f;f=42;}return f|0}function g0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=30;break}h=a[j>>0]|0;i=a[j+1>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 2:{i=14;break a}case 10:{i=15;break a}case 9:{i=18;break a}case 21:{i=25;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=s0(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14){c[g>>2]=j;h=0;break}else if((i|0)==15)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==18){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==25)if((j|0)==(e|0)){c[g>>2]=e+2;h=39;break}else {c[g>>2]=j;h=6;break}else if((i|0)==30){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function h0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;do if(e>>>0>>0){k=f;if((k-e|0)>1){l=b+72|0;j=e;a:while(1){if((k-j|0)<=1){i=29;break}h=a[j>>0]|0;i=a[j+1>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 3:{i=11;break a}case 30:{i=14;break a}case 10:{i=17;break a}case 9:{i=20;break a}case 5:{h=2;break}case 6:{h=3;break}case 7:{h=4;break}default:h=2;}j=j+h|0;}if((i|0)==11)if((j|0)==(e|0)){h=s0(b,e+2|0,f,g)|0;break}else {c[g>>2]=j;h=6;break}else if((i|0)==14)if((j|0)==(e|0)){h=t0(b,e+2|0,f,g)|0;h=(h|0)==22?0:h;break}else {c[g>>2]=j;h=6;break}else if((i|0)==17)if((j|0)==(e|0)){c[g>>2]=e+2;h=7;break}else {c[g>>2]=j;h=6;break}else if((i|0)==20){if((j|0)!=(e|0)){c[g>>2]=j;h=6;break}j=e+2|0;if((k-j|0)<=1){h=-3;break}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;c[g>>2]=(h|0)==10?e+4|0:j;h=7;break}else if((i|0)==29){c[g>>2]=j;h=6;break}}else h=-1;}else h=-4;while(0);return h|0}function i0(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=d;b=c;while(1){c=a[e>>0]|0;if(!(c<<24>>24)){g=7;break}if((f-b|0)<2){b=0;break}if(a[b>>0]|0){b=0;break}if((a[b+1>>0]|0)!=c<<24>>24){b=0;break}e=e+1|0;b=b+2|0;}if((g|0)==7)b=(b|0)==(d|0)&1;return b|0}function j0(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=b+72|0;f=c;a:while(1){b=a[f>>0]|0;e=a[f+1>>0]|0;if(!(b<<24>>24))b=d[g+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 5:{b=2;break}case 6:{b=3;break}case 7:{b=4;break}case 27:case 26:case 25:case 24:case 23:case 22:case 29:{b=2;break}default:break a}f=f+b|0;}return f-c|0}function k0(b,c){b=b|0;c=c|0;var e=0,f=0;f=b+72|0;a:while(1){b=a[c>>0]|0;e=a[c+1>>0]|0;if(!(b<<24>>24))b=d[f+(e&255)>>0]|0;else b=J$(b,e)|0;switch(b|0){case 21:case 9:case 10:break;default:break a}c=c+2|0;}return c|0}function l0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=b+72|0;m=0;n=0;b=1;a:while(1){l=e+2|0;h=a[l>>0]|0;j=h<<24>>24==0;i=e+3|0;k=a[i>>0]|0;if(j)h=d[o+(k&255)>>0]|0;else h=J$(h,k)|0;do switch(h|0){case 5:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 6:{if(b|0){j=b;k=n;l=m;e=i;b=j;n=k;m=l;continue a}if((n|0)>=(f|0)){k=n;l=m;b=1;e=i;n=k;m=l;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;k=n;l=m;b=1;e=i;n=k;m=l;continue a}case 7:{if(!b)if((n|0)<(f|0)){c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;b=1;}else b=1;k=n;l=m;e=e+4|0;n=k;m=l;continue a}case 24:case 22:case 29:{if(b|0){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}if((n|0)>=(f|0)){j=n;k=m;b=1;e=l;n=j;m=k;continue a}c[g+(n<<4)>>2]=l;a[g+(n<<4)+12>>0]=1;j=n;k=m;b=1;e=l;n=j;m=k;continue a}case 12:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=12;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=12;b=2;e=l;n=k;continue a}if((m|0)!=12){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=12;n=n+1|0;b=0;e=l;continue a}case 13:{if((b|0)!=2){if((n|0)>=(f|0)){k=n;m=13;b=2;e=l;n=k;continue a}c[g+(n<<4)+4>>2]=e+4;k=n;m=13;b=2;e=l;n=k;continue a}if((m|0)!=13){j=n;k=m;b=2;e=l;n=j;m=k;continue a}if((n|0)<(f|0))c[g+(n<<4)+8>>2]=l;m=13;n=n+1|0;b=0;e=l;continue a}case 3:{if((n|0)>=(f|0)){i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}case 21:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}i=g+(n<<4)+12|0;if(!(a[i>>0]|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}do if(j&(l|0)!=(c[g+(n<<4)+4>>2]|0)&k<<24>>24==32){h=a[e+4>>0]|0;b=a[e+5>>0]|0;if(!(h<<24>>24)){if(b<<24>>24==32)break;b=d[o+(b&255)>>0]|0;}else b=J$(h,b)|0;if((b|0)!=(m|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}}while(0);a[i>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 10:case 9:{switch(b|0){case 1:{j=n;k=m;b=0;e=l;n=j;m=k;continue a}case 2:break;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}if((n|0)>=(f|0)){j=n;k=m;b=2;e=l;n=j;m=k;continue a}a[g+(n<<4)+12>>0]=0;j=n;k=m;b=2;e=l;n=j;m=k;continue a}case 17:case 11:if((b|0)==2){j=n;k=m;b=2;e=l;n=j;m=k;continue a}else break a;default:{i=b;j=n;k=m;e=l;b=i;n=j;m=k;continue a}}while(0)}return n|0}function m0(b,c){b=b|0;c=c|0;var d=0,e=0;b=c+4|0;a:do if(!(a[b>>0]|0))if((a[c+5>>0]|0)==120){c=c+6|0;b=0;while(1){b:while(1){if(!(a[c>>0]|0)){d=a[c+1>>0]|0;if(d<<24>>24==59){e=18;break a}d=d<<24>>24;switch(d|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{e=8;break b}case 70:case 69:case 68:case 67:case 66:case 65:{e=9;break b}case 102:case 101:case 100:case 99:case 98:case 97:{e=10;break b}default:{}}}c=c+2|0;}if((e|0)==8)b=d+-48|b<<4;else if((e|0)==9)b=(b<<4)+-55+d|0;else if((e|0)==10)b=(b<<4)+-87+d|0;if((b|0)<1114112)c=c+2|0;else {b=-1;e=19;break}}}else {c=b;b=0;e=13;}else {d=b;b=0;c=-1;e=16;}while(0);while(1)if((e|0)==13){if(a[c>>0]|0){d=c;c=-1;e=16;continue}if((a[c+1>>0]|0)==59){e=18;continue}d=c;c=a[c+1>>0]|0;e=16;continue}else if((e|0)==16){b=(b*10|0)+-48+c|0;if((b|0)>=1114112){b=-1;e=19;continue}c=d+2|0;e=13;continue}else if((e|0)==18){b=A_(b)|0;e=19;continue}else if((e|0)==19)return b|0;return 0}function n0(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;a:do switch((d-c|0)/2|0|0){case 2:{if((a[c+2>>0]|0)==0?(a[c+3>>0]|0)==116:0){if(!(a[c>>0]|0))b=a[c+1>>0]|0;else b=-1;b=(b|0)==108?60:(b|0)==103?62:0;}else e=27;break}case 3:{if((((((a[c>>0]|0)==0?(a[c+1>>0]|0)==97:0)?(a[c+2>>0]|0)==0:0)?(a[c+3>>0]|0)==109:0)?(a[c+4>>0]|0)==0:0)?(a[c+5>>0]|0)==112:0)b=38;else e=27;break}case 4:{if(!(a[c>>0]|0))switch(a[c+1>>0]|0){case 113:{if(a[c+2>>0]|0){e=27;break a}if((a[c+3>>0]|0)!=117){e=27;break a}if(a[c+4>>0]|0){e=27;break a}if((a[c+5>>0]|0)!=111){e=27;break a}if(a[c+6>>0]|0){e=27;break a}if((a[c+7>>0]|0)==116){b=34;break a}else {e=27;break a}}case 97:{if(a[c+2>>0]|0){e=27;break a}if((a[c+3>>0]|0)!=112){e=27;break a}if(a[c+4>>0]|0){e=27;break a}if((a[c+5>>0]|0)!=111){e=27;break a}if(a[c+6>>0]|0){e=27;break a}if((a[c+7>>0]|0)==115){b=39;break a}else {e=27;break a}}default:{e=27;break a}}else e=27;break}default:e=27;}while(0);if((e|0)==27)b=0;return b|0}function o0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=b+72|0;k=g+4|0;while(1){if((f-e|0)<=1)break;b=a[e>>0]|0;h=a[e+1>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;switch(b|0){case 5:{e=e+2|0;break}case 6:{e=e+3|0;break}case 7:{e=e+4|0;break}case 10:{c[k>>2]=-1;c[g>>2]=(c[g>>2]|0)+1;e=e+2|0;break}case 9:{c[g>>2]=(c[g>>2]|0)+1;i=e+2|0;if((f-i|0)>1){b=a[i>>0]|0;h=a[e+3>>0]|0;if(!(b<<24>>24))b=d[j+(h&255)>>0]|0;else b=J$(b,h)|0;e=(b|0)==10?e+4|0:i;}else e=i;c[k>>2]=-1;break}default:e=e+2|0;}c[k>>2]=(c[k>>2]|0)+1;}return}function p0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f+-2|0;j=b+72|0;a:while(1){h=e+2|0;if((k-h|0)<=1){f=1;break}f=a[h>>0]|0;i=f<<24>>24==0;b=a[e+3>>0]|0;if(i)f=d[j+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 23:case 19:case 30:case 33:case 16:case 18:case 10:case 9:case 15:case 14:case 17:case 35:case 34:case 32:case 31:case 13:case 27:case 24:case 25:{e=h;continue a}case 21:if(i&b<<24>>24==9){l=12;break a}else {e=h;continue a}case 22:case 26:{if(!i){l=12;break a}if(b<<24>>24>=0){e=h;continue a}break}default:if(!i){l=12;break a}}switch(b<<24>>24|0){case 64:case 36:{e=h;break}default:{l=12;break a}}}if((l|0)==12){c[g>>2]=h;f=0;}return f|0}function q0(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;j=c[e>>2]|0;k=j+(f-j&-2)|0;l=k;m=h;a:while(1){if(j>>>0>=k>>>0){b=0;break}i=a[j+1>>0]|0;b=a[j>>0]|0;f=b&255;switch(b<<24>>24){case 0:{if(i<<24>>24>-1){b=c[g>>2]|0;if((b|0)==(h|0)){b=2;break a}c[g>>2]=b+1;a[b>>0]=i;b=j;}else n=7;break}case 7:case 6:case 5:case 4:case 3:case 2:case 1:{n=7;break}case -37:case -38:case -39:case -40:{b=c[g>>2]|0;if((m-b|0)<4){b=2;break a}if((l-j|0)<4){b=1;break a}o=i&255;i=(f<<2&12|o>>>6)+1|0;c[g>>2]=b+1;a[b>>0]=i>>>2|240;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>2&15|i<<4&48|128;b=j+2|0;i=d[j+3>>0]|0;f=(o<<4&48|i>>>6|a[b>>0]<<2&12|128)&255;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=f;j=c[g>>2]|0;c[g>>2]=j+1;a[j>>0]=i&63|128;break}default:{b=c[g>>2]|0;if((m-b|0)<3){b=2;break a}c[g>>2]=b+1;a[b>>0]=f>>>4|224;o=i&255;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2&60|128;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}}if((n|0)==7){n=0;b=c[g>>2]|0;if((m-b|0)<2){b=2;break}o=i&255;c[g>>2]=b+1;a[b>>0]=o>>>6|f<<2|192;b=c[g>>2]|0;c[g>>2]=b+1;a[b>>0]=o&63|128;b=j;}j=b+2|0;}c[e>>2]=j;return b|0}function r0(e,f,g,h,i){e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0;j=c[f>>2]|0;l=g-j&-2;e=j+l|0;if((l|0)>(i-(c[h>>2]|0)|0)){k=e+-2|0;g=(a[k>>0]&-8)<<24>>24==-40;l=g&1;e=g?k:e;}else l=0;g=j;while(1){j=g>>>0>>0;k=c[h>>2]|0;if(!(j&k>>>0>>0))break;j=((d[g>>0]|0)<<8|(d[g+1>>0]|0))&65535;c[h>>2]=k+2;b[k>>1]=j;k=(c[f>>2]|0)+2|0;c[f>>2]=k;g=k;}return ((k|0)!=(i|0)|j^1?l:2)|0}function s0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;l=f;j=l-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;b=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;b=0;break a}case 6:{if((j|0)<3){b=-2;break a}c[g>>2]=e;b=0;break a}case 7:{if((j|0)<4){b=-2;break a}c[g>>2]=e;b=0;break a}case 19:{b=u0(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;b=0;break a}}k=b+72|0;j=e;b:while(1){i=j+2|0;e=l-i|0;if((e|0)<=1){b=-1;break a}b=a[i>>0]|0;f=a[j+3>>0]|0;if(!(b<<24>>24))h=d[k+(f&255)>>0]|0;else h=J$(b,f)|0;switch(h|0){case 27:case 26:case 25:case 24:case 22:{j=i;continue b}case 5:{f=23;break b}case 6:{f=24;break b}case 7:{f=26;break b}case 18:{f=28;break b}case 29:break;default:{f=29;break b}}e=f&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(b&255)>>0]|0)<<3)<<2)>>2])){f=22;break}else j=i;}if((f|0)==22){c[g>>2]=i;b=0;break}else if((f|0)==23){c[g>>2]=i;b=0;break}else if((f|0)==24){if((e|0)<3){b=-2;break}c[g>>2]=i;b=0;break}else if((f|0)==26){if((e|0)<4){b=-2;break}c[g>>2]=i;b=0;break}else if((f|0)==28){c[g>>2]=j+4;b=9;break}else if((f|0)==29){c[g>>2]=i;b=0;break}}else b=-1;while(0);return b|0}function t0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}case 30:case 9:case 10:case 21:{c[g>>2]=e;f=22;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){k=b+2|0;e=f-k|0;if((e|0)<=1){f=-1;break a}h=a[k>>0]|0;i=a[b+3>>0]|0;if(!(h<<24>>24))j=d[l+(i&255)>>0]|0;else j=J$(h,i)|0;switch(j|0){case 27:case 26:case 25:case 24:case 22:{b=k;continue b}case 5:{h=23;break b}case 6:{h=24;break b}case 7:{h=26;break b}case 18:{h=28;break b}case 29:break;default:{h=29;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=22;break}else b=k;}if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){c[g>>2]=k;f=0;break}else if((h|0)==24){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==26){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==28){c[g>>2]=b+4;f=28;break}else if((h|0)==29){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function u0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;k=f;a:do if((k-e|0)>1){i=a[e>>0]|0;h=a[e+1>>0]|0;do if(!(i<<24>>24))if(h<<24>>24==120){h=v0(b,e+2|0,f,g)|0;break a}else {h=d[b+72+(h&255)>>0]|0;break}else h=J$(i,h)|0;while(0);if((h|0)!=25){c[g>>2]=e;h=0;break}j=b+72|0;b=e;b:while(1){i=b+2|0;if((k-i|0)<=1){h=-1;break a}h=a[i>>0]|0;f=a[b+3>>0]|0;if(!(h<<24>>24))h=d[j+(f&255)>>0]|0;else h=J$(h,f)|0;switch(h|0){case 25:{b=i;break}case 18:{f=15;break b}default:{f=16;break b}}}if((f|0)==15){c[g>>2]=b+4;h=10;break}else if((f|0)==16){c[g>>2]=i;h=0;break}}else h=-1;while(0);return h|0}function v0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0;a:do if((f-e|0)>1){h=a[e>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+1>>0]|0)>>0]|0;else h=J$(h,a[e+1>>0]|0)|0;if((h&-2|0)!=24){c[g>>2]=e;f=0;break}j=b+72|0;b:while(1){i=e+2|0;if((f-i|0)<=1){f=-1;break a}h=a[i>>0]|0;b=a[e+3>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 25:{e=i;break}case 18:{h=13;break b}default:{h=14;break b}}}if((h|0)==13){c[g>>2]=e+4;f=10;break}else if((h|0)==14){c[g>>2]=i;f=0;break}}else f=-1;while(0);return f|0}function w0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=f;j=o-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{m=i&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;h=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;h=0;break a}case 6:{if((j|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 7:{if((j|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 16:{i=e+2|0;if((o-i|0)<=1){h=-1;break a}h=a[i>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+3>>0]|0)>>0]|0;else h=J$(h,a[e+3>>0]|0)|0;switch(h|0){case 27:{h=x0(b,e+4|0,f,g)|0;break a}case 20:{h=y0(e+4|0,f,g)|0;break a}default:{c[g>>2]=i;h=0;break a}}}case 15:{h=z0(b,e+2|0,f,g)|0;break a}case 17:{h=A0(b,e+2|0,f,g)|0;break a}default:{c[g>>2]=e;h=0;break a}}m=b+72|0;l=0;h=e+2|0;b:while(1){c:while(1){i=o-h|0;if((i|0)<=1){h=-1;break a}j=a[h>>0]|0;k=a[h+1>>0]|0;if(!(j<<24>>24))e=d[m+(k&255)>>0]|0;else e=J$(j,k)|0;switch(e|0){case 5:{n=34;break b}case 6:{n=35;break b}case 7:{n=37;break b}case 10:case 9:case 21:{n=55;break b}case 11:{n=69;break b}case 17:break b;case 23:break c;case 29:{e=k&255;if(!(1<<(e&31)&c[56940+((e>>>5|d[144044+(j&255)>>0]<<3)<<2)>>2])){n=32;break b}break}case 27:case 26:case 25:case 24:case 22:break;default:{n=75;break b}}h=h+2|0;}if(l|0){n=40;break}e=h+2|0;l=o-e|0;if((l|0)<=1){h=-1;break a}i=a[e>>0]|0;j=a[h+3>>0]|0;if(!(i<<24>>24))k=d[m+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{n=49;break b}case 6:{n=50;break b}case 7:{n=52;break b}case 29:{l=j&255;if(!(1<<(l&31)&c[56940+((l>>>5|d[143788+(i&255)>>0]<<3)<<2)>>2])){n=47;break b}break}case 24:case 22:break;default:{n=54;break b}}l=1;h=h+4|0;}d:switch(n|0){case 32:{c[g>>2]=h;h=0;break a}case 34:{c[g>>2]=h;h=0;break a}case 35:{if((i|0)<3){h=-2;break a}c[g>>2]=h;h=0;break a}case 37:{if((i|0)<4){h=-2;break a}c[g>>2]=h;h=0;break a}case 40:{c[g>>2]=h;h=0;break a}case 47:{c[g>>2]=e;h=0;break a}case 49:{c[g>>2]=e;h=0;break a}case 50:{if((l|0)<3){h=-2;break a}c[g>>2]=e;h=0;break a}case 52:{if((l|0)<4){h=-2;break a}c[g>>2]=e;h=0;break a}case 54:{c[g>>2]=e;h=0;break a}case 55:{e:while(1){n=0;i=h+2|0;j=o-i|0;if((j|0)<=1){h=-1;break a}k=a[i>>0]|0;e=a[h+3>>0]|0;if(!(k<<24>>24))l=d[m+(e&255)>>0]|0;else l=J$(k,e)|0;switch(l|0){case 11:{h=i;n=69;break d}case 17:{h=i;break d}case 10:case 9:case 21:{h=i;n=55;break}case 29:{n=60;break e}case 24:case 22:break e;case 5:{n=63;break e}case 6:{n=64;break e}case 7:{n=66;break e}default:{n=68;break e}}}if((n|0)==60){o=e&255;if(!(1<<(o&31)&c[56940+((o>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){c[g>>2]=i;h=0;break a}}else if((n|0)==63){c[g>>2]=i;h=0;break a}else if((n|0)==64){if((j|0)<3){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==66){if((j|0)<4){h=-2;break a}c[g>>2]=i;h=0;break a}else if((n|0)==68){c[g>>2]=i;h=0;break a}h=B0(b,h+4|0,f,g)|0;break a}case 75:{c[g>>2]=h;h=0;break a}}if((n|0)==69){c[g>>2]=h+2;h=2;break}i=h+2|0;if((o-i|0)>1){if((a[i>>0]|0)==0?(a[h+3>>0]|0)==62:0){c[g>>2]=h+4;h=4;break}c[g>>2]=i;h=0;}else h=-1;}else h=-1;while(0);return h|0}function x0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f;a:do if((j-e|0)>1){if((a[e>>0]|0)==0?(a[e+1>>0]|0)==45:0){i=b+72|0;h=e+2|0;b:while(1){e=j-h|0;if((e|0)<=1){f=-1;break a}f=a[h>>0]|0;b=a[h+1>>0]|0;if(!(f<<24>>24))f=d[i+(b&255)>>0]|0;else f=J$(f,b)|0;switch(f|0){case 8:case 1:case 0:{k=16;break b}case 5:{h=h+2|0;continue b}case 6:{if((e|0)<3){f=-2;break a}h=h+3|0;continue b}case 7:{if((e|0)<4){f=-2;break a}h=h+4|0;continue b}case 27:{f=h+2|0;if((j-f|0)<=1){f=-1;break a}if(a[f>>0]|0){h=f;continue b}if((a[h+3>>0]|0)==45)break b;else {h=f;continue b}}default:{h=h+2|0;continue b}}}if((k|0)==16){c[g>>2]=h;f=0;break}f=h+4|0;if((j-f|0)<=1){f=-1;break}if((a[f>>0]|0)==0?(a[h+5>>0]|0)==62:0){c[g>>2]=h+6;f=13;break}c[g>>2]=f;f=0;break}c[g>>2]=e;f=0;}else f=-1;while(0);return f|0}function y0(b,d,e){b=b|0;d=d|0;e=e|0;if((d-b|0)>11){d=0;while(1){if((d|0)>=6){d=8;break}if(a[b>>0]|0){d=0;break}if((a[b+1>>0]|0)!=(a[144300+d>>0]|0)){d=0;break}d=d+1|0;b=b+2|0;}c[e>>2]=b;}else d=-1;return d|0}function z0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;q=l;l=l+16|0;p=q;o=f;i=o-e|0;a:do if((i|0)>1){j=a[e>>0]|0;if(!(j<<24>>24)){h=a[e+1>>0]|0;f=d[b+72+(h&255)>>0]|0;}else {h=a[e+1>>0]|0;f=J$(j,h)|0;}switch(f|0){case 29:{m=h&255;if(!(1<<(m&31)&c[56940+((m>>>5|d[143788+(j&255)>>0]<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((i|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((i|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}m=b+72|0;k=e;b:while(1){f=k+2|0;h=o-f|0;if((h|0)<=1){f=-1;break a}i=a[f>>0]|0;j=a[k+3>>0]|0;if(!(i<<24>>24))b=d[m+(j&255)>>0]|0;else b=J$(i,j)|0;switch(b|0){case 27:case 26:case 25:case 24:case 22:{k=f;continue b}case 5:{n=22;break b}case 6:{n=23;break b}case 7:{n=25;break b}case 10:case 9:case 21:{n=27;break b}case 15:{n=46;break b}case 29:break;default:break b}k=j&255;if(!(1<<(k&31)&c[56940+((k>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){n=21;break}else k=f;}if((n|0)==21){c[g>>2]=f;f=0;break}else if((n|0)==22){c[g>>2]=f;f=0;break}else if((n|0)==23){if((h|0)<3){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==25){if((h|0)<4){f=-2;break}c[g>>2]=f;f=0;break}else if((n|0)==27){if(!(C0(e,f,p)|0)){c[g>>2]=f;f=0;break}j=k+4|0;c:while(1){i=o-j|0;if((i|0)<=1){f=-1;break a}f=a[j>>0]|0;h=a[j+1>>0]|0;if(!(f<<24>>24))f=d[m+(h&255)>>0]|0;else f=J$(f,h)|0;switch(f|0){case 8:case 1:case 0:{n=40;break c}case 5:{j=j+2|0;continue c}case 6:{if((i|0)<3){f=-2;break a}j=j+3|0;continue c}case 7:{if((i|0)<4){f=-2;break a}j=j+4|0;continue c}case 15:{f=j+2|0;if((o-f|0)<=1){f=-1;break a}if(a[f>>0]|0){j=f;continue c}if((a[j+3>>0]|0)==62){n=44;break c}else {j=f;continue c}}default:{j=j+2|0;continue c}}}if((n|0)==40){c[g>>2]=j;f=0;break}else if((n|0)==44){c[g>>2]=j+4;f=c[p>>2]|0;break}}else if((n|0)==46){if(!(C0(e,f,p)|0)){c[g>>2]=f;f=0;break}f=k+4|0;if((o-f|0)<=1){f=-1;break}if((a[f>>0]|0)==0?(a[k+5>>0]|0)==62:0){c[g>>2]=k+6;f=c[p>>2]|0;break}}c[g>>2]=f;f=0;}else f=-1;while(0);l=q;return f|0}function A0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{l=i&255;if(!(1<<(l&31)&c[56940+((l>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}l=b+72|0;b=e;b:while(1){j=b+2|0;e=f-j|0;if((e|0)<=1){f=-1;break a}h=a[j>>0]|0;i=a[b+3>>0]|0;if(!(h<<24>>24))k=d[l+(i&255)>>0]|0;else k=J$(h,i)|0;switch(k|0){case 23:case 27:case 26:case 25:case 24:case 22:{b=j;continue b}case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 10:case 9:case 21:{h=27;break b}case 11:{h=34;break b}case 29:break;default:{h=35;break b}}e=i&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(h&255)>>0]|0)<<3)<<2)>>2])){h=21;break}else b=j;}if((h|0)==21){c[g>>2]=j;f=0;break}else if((h|0)==22){c[g>>2]=j;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=j;f=0;break}else if((h|0)==27){c:while(1){k=j+2|0;if((f-k|0)<=1){f=-1;break a}h=a[k>>0]|0;i=a[j+3>>0]|0;if(!(h<<24>>24))h=d[l+(i&255)>>0]|0;else h=J$(h,i)|0;switch(h|0){case 10:case 9:case 21:{j=k;h=27;break}case 11:{h=32;break c}default:{h=33;break c}}}if((h|0)==32){c[g>>2]=j+4;f=5;break}else if((h|0)==33){c[g>>2]=k;f=0;break}}else if((h|0)==34){c[g>>2]=b+4;f=5;break}else if((h|0)==35){c[g>>2]=j;f=0;break}}else f=-1;while(0);return f|0}function B0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+16|0;q=s;c[q>>2]=e;r=f;o=b+72|0;h=0;a:while(1){b:while(1){m=r-e|0;if((m|0)<=1){e=-1;break a}i=a[e>>0]|0;j=a[e+1>>0]|0;if(!(i<<24>>24))k=d[o+(j&255)>>0]|0;else k=J$(i,j)|0;switch(k|0){case 5:{p=11;break a}case 6:{p=12;break a}case 7:{p=14;break a}case 23:{p=16;break b}case 10:case 9:case 21:{p=31;break b}case 14:{p=37;break b}case 29:{n=j&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[144044+(i&255)>>0]<<3)<<2)>>2])){p=9;break a}break}case 27:case 26:case 25:case 24:case 22:break;default:{p=89;break a}}n=e+2|0;c[q>>2]=n;e=n;}c:do if((p|0)==16){p=0;if(h|0){p=17;break a}h=e+2|0;c[q>>2]=h;i=h;j=r-i|0;if((j|0)<=1){e=-1;break a}k=a[h>>0]|0;m=a[e+3>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=25;break a}case 6:{p=26;break a}case 7:{p=28;break a}case 24:case 22:{h=1;break c}case 29:break;default:{p=30;break a}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=24;break a}else h=1;}else if((p|0)==31)while(1){p=0;i=e+2|0;c[q>>2]=i;j=i;if((r-j|0)<=1){e=-1;break a}h=a[i>>0]|0;e=a[e+3>>0]|0;if(!(h<<24>>24))e=d[o+(e&255)>>0]|0;else e=J$(h,e)|0;switch(e|0){case 14:{e=i;p=37;break c}case 9:case 10:case 21:{e=i;p=31;break}default:{p=36;break a}}}while(0);d:do if((p|0)==37){while(1){p=0;j=e+2|0;c[q>>2]=j;k=j;if((r-k|0)<=1){e=-1;break a}h=a[j>>0]|0;i=a[e+3>>0]|0;if(!(h<<24>>24))m=d[o+(i&255)>>0]|0;else m=J$(h,i)|0;if((m|1|0)==13)break;switch(m|0){case 9:case 10:case 21:{e=j;p=37;break}default:{p=43;break a}}}e=e+4|0;c[q>>2]=e;e:while(1){j=r-e|0;if((j|0)<=1){e=-1;break a}h=a[e>>0]|0;i=a[e+1>>0]|0;if(!(h<<24>>24))h=d[o+(i&255)>>0]|0;else h=J$(h,i)|0;if((h|0)==(m|0))break;switch(h|0){case 8:case 1:case 0:{p=56;break a}case 2:{p=61;break a}case 5:{n=e+2|0;c[q>>2]=n;e=n;continue e}case 6:{if((j|0)<3){e=-2;break a}n=e+3|0;c[q>>2]=n;e=n;continue e}case 7:{if((j|0)<4){e=-2;break a}n=e+4|0;c[q>>2]=n;e=n;continue e}case 3:{e=s0(b,e+2|0,f,q)|0;if((e|0)<1){p=59;break a}e=c[q>>2]|0;continue e}default:{n=e+2|0;c[q>>2]=n;e=n;continue e}}}i=e+2|0;c[q>>2]=i;k=i;if((r-k|0)<=1){e=-1;break a}h=a[i>>0]|0;j=a[e+3>>0]|0;if(!(h<<24>>24))h=d[o+(j&255)>>0]|0;else h=J$(h,j)|0;switch(h|0){case 11:{p=81;break a}case 17:{p=82;break a}case 10:case 9:case 21:{e=i;break}default:{p=68;break a}}f:while(1){i=e+2|0;c[q>>2]=i;h=i;j=r-h|0;if((j|0)<=1){e=-1;break a}k=a[i>>0]|0;m=a[e+3>>0]|0;if(!(k<<24>>24))n=d[o+(m&255)>>0]|0;else n=J$(k,m)|0;switch(n|0){case 5:{p=76;break a}case 6:{p=77;break a}case 7:{p=79;break a}case 11:{p=81;break a}case 17:{p=82;break a}case 24:case 22:{h=0;break d}case 10:case 9:case 21:{e=i;break}case 29:break f;default:{p=87;break a}}}n=m&255;if(!(1<<(n&31)&c[56940+((n>>>5|d[143788+(k&255)>>0]<<3)<<2)>>2])){p=75;break a}else h=0;}while(0);e=e+4|0;c[q>>2]=e;}switch(p|0){case 9:{c[g>>2]=e;e=0;break}case 11:{c[g>>2]=e;e=0;break}case 12:{if((m|0)<3)e=-2;else {c[g>>2]=e;e=0;}break}case 14:{if((m|0)<4)e=-2;else {c[g>>2]=e;e=0;}break}case 17:{c[g>>2]=e;e=0;break}case 24:{c[g>>2]=h;e=0;break}case 25:{c[g>>2]=h;e=0;break}case 26:{if((j|0)<3)e=-2;else {c[g>>2]=h;e=0;}break}case 28:{if((j|0)<4)e=-2;else {c[g>>2]=h;e=0;}break}case 30:{c[g>>2]=i;e=0;break}case 36:{c[g>>2]=j;e=0;break}case 43:{c[g>>2]=k;e=0;break}case 56:{c[g>>2]=e;e=0;break}case 59:{if(!e){c[g>>2]=c[q>>2];e=0;}break}case 61:{c[g>>2]=e;e=0;break}case 68:{c[g>>2]=k;e=0;break}case 75:{c[g>>2]=i;e=0;break}case 76:{c[g>>2]=i;e=0;break}case 77:{if((j|0)<3)e=-2;else {c[g>>2]=i;e=0;}break}case 79:{if((j|0)<4)e=-2;else {c[g>>2]=i;e=0;}break}case 81:{c[g>>2]=e+4;e=1;break}case 82:{h=i+2|0;c[q>>2]=h;e=h;if((r-e|0)>1){if((a[h>>0]|0)==0?(a[i+3>>0]|0)==62:0){c[g>>2]=i+4;e=3;break}c[g>>2]=e;e=0;}else e=-1;break}case 87:{c[g>>2]=h;e=0;break}case 89:{c[g>>2]=e;e=0;break}}l=s;return e|0}function C0(b,d,e){b=b|0;d=d|0;e=e|0;c[e>>2]=11;a:do if((d-b|0)==6?(a[b>>0]|0)==0:0){switch(a[b+1>>0]|0){case 120:{d=0;break}case 88:{d=1;break}default:{d=1;break a}}if(!(a[b+2>>0]|0)){switch(a[b+3>>0]|0){case 109:break;case 77:{d=1;break}default:{d=1;break a}}if(!(a[b+4>>0]|0)){switch(a[b+5>>0]|0){case 108:break;case 76:{d=0;break a}default:{d=1;break a}}if(!d){c[e>>2]=12;d=1;}else d=0;}else d=1;}else d=1;}else d=1;while(0);return d|0}function D0(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;k=e+72|0;a:while(1){b:while(1){j=g-f|0;if((j|0)<=1){f=-1;break a}e=a[f>>0]|0;i=a[f+1>>0]|0;if(!(e<<24>>24))i=d[k+(i&255)>>0]|0;else i=J$(e,i)|0;switch(i|0){case 8:case 1:case 0:{l=10;break a}case 6:{l=9;break b}case 7:{l=19;break b}case 5:{f=f+2|0;continue b}case 13:case 12:{e=f+2|0;if((i|0)==(b|0)){l=12;break a}else {f=e;continue b}}default:{f=f+2|0;continue b}}}if((l|0)==9){l=0;if((j|0)<3){f=-2;break}else {f=f+3|0;continue}}else if((l|0)==19){l=0;if((j|0)<4){f=-2;break}else {f=f+4|0;continue}}}c:do if((l|0)==10){c[h>>2]=f;f=0;}else if((l|0)==12)if((g-e|0)>1){c[h>>2]=e;g=a[e>>0]|0;f=a[f+3>>0]|0;if(!(g<<24>>24))f=d[k+(f&255)>>0]|0;else f=J$(g,f)|0;switch(f|0){case 20:case 30:case 11:case 10:case 9:case 21:{f=27;break c}default:{}}f=0;}else f=-27;while(0);return f|0}function E0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0;k=f;a:do if((k-e|0)>1){h=a[e>>0]|0;if(!(h<<24>>24))h=d[b+72+(d[e+1>>0]|0)>>0]|0;else h=J$(h,a[e+1>>0]|0)|0;switch(h|0){case 27:{h=x0(b,e+2|0,f,g)|0;break a}case 20:{c[g>>2]=e+2;h=33;break a}case 24:case 22:{j=b+72|0;b:while(1){i=e+2|0;f=k-i|0;if((f|0)<=1){h=-1;break a}h=a[i>>0]|0;b=a[e+3>>0]|0;if(!(h<<24>>24))h=d[j+(b&255)>>0]|0;else h=J$(h,b)|0;switch(h|0){case 24:case 22:{e=i;break}case 30:{l=15;break b}case 10:case 9:case 21:break b;default:{l=22;break b}}}if((l|0)==22){c[g>>2]=i;h=0;break a}c:do if((l|0)==15){if((f|0)<=3){h=-1;break a}b=a[e+4>>0]|0;h=a[e+5>>0]|0;if(!(b<<24>>24))h=d[j+(h&255)>>0]|0;else h=J$(b,h)|0;switch(h|0){case 30:case 10:case 9:case 21:break;default:break c}c[g>>2]=i;h=0;break a}while(0);c[g>>2]=i;h=16;break a}default:{c[g>>2]=e;h=0;break a}}}else h=-1;while(0);return h|0}function F0(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;j=f-e|0;a:do if((j|0)>1){k=a[e>>0]|0;if(!(k<<24>>24)){i=a[e+1>>0]|0;h=d[b+72+(i&255)>>0]|0;}else {i=a[e+1>>0]|0;h=J$(k,i)|0;}switch(h|0){case 29:{j=i&255;if(!(1<<(j&31)&c[56940+((j>>>5|(d[143788+(k&255)>>0]|0)<<3)<<2)>>2])){c[g>>2]=e;f=0;break a}break}case 24:case 22:break;case 5:{c[g>>2]=e;f=0;break a}case 6:{if((j|0)<3){f=-2;break a}c[g>>2]=e;f=0;break a}case 7:{if((j|0)<4){f=-2;break a}c[g>>2]=e;f=0;break a}default:{c[g>>2]=e;f=0;break a}}b=b+72|0;k=e;b:while(1){h=k;k=k+2|0;e=f-k|0;if((e|0)<=1){f=-20;break a}j=a[k>>0]|0;h=a[h+3>>0]|0;if(!(j<<24>>24))i=d[b+(h&255)>>0]|0;else i=J$(j,h)|0;switch(i|0){case 27:case 26:case 25:case 24:case 22:continue b;case 5:{h=22;break b}case 6:{h=23;break b}case 7:{h=25;break b}case 36:case 30:case 11:case 32:case 21:case 10:case 9:{h=27;break b}case 29:break;default:{h=28;break b}}e=h&255;if(!(1<<(e&31)&c[56940+((e>>>5|(d[144044+(j&255)>>0]|0)<<3)<<2)>>2])){h=21;break}}if((h|0)==21){c[g>>2]=k;f=0;break}else if((h|0)==22){c[g>>2]=k;f=0;break}else if((h|0)==23){if((e|0)<3){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==25){if((e|0)<4){f=-2;break}c[g>>2]=k;f=0;break}else if((h|0)==27){c[g>>2]=k;f=20;break}else if((h|0)==28){c[g>>2]=k;f=0;break}}else f=-1;while(0);return f|0}function G0(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;while(1){b=c[d>>2]|0;h=b>>>0>>0;i=c[f>>2]|0;if(!(h&i>>>0>>0))break;c[d>>2]=b+1;h=a[b>>0]|0;i=c[f>>2]|0;c[f>>2]=i+1;a[i>>0]=h;}return ((i|0)!=(g|0)|h^1?0:2)|0}function H0(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;a:while(1){f=a[b>>0]|0;g=a[c>>0]|0;f=(f+-97&255)<26?(f&255)+224&255:f;switch((f<<24>>24==((g+-97&255)<26?(g&255)+224&255:g)<<24>>24?(f<<24>>24==0?2:0):1)&3){case 0:{c=c+1|0;b=b+1|0;break}case 1:{e=3;break a}case 2:{d=1;break a}default:{e=5;break a}}}if((e|0)==3)d=0;return d|0}function I0(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return K0(39,a,b,c,d,e,f,g,h,i,j)|0}function J0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+144|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+127|0)|0;do if((c[i>>2]|0)==(e|0)){a[c[g>>2]>>0]=0;if(H0(f,144315)|0?(c[b+64>>2]|0)==2:0)break;b=Z$(f)|0;if((b|0)!=-1)b=c[58948+(b<<2)>>2]|0;else b=0;}else b=0;while(0);l=h;return b|0}function K0(a,b,d,e,f,g,h,i,j,k,m){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+16|0;t=v+8|0;q=v+12|0;o=v+4|0;p=v;c[q>>2]=0;c[o>>2]=0;c[p>>2]=0;u=d+64|0;s=c[u>>2]|0;r=e+(s*5|0)|0;c[t>>2]=r;s=f+(0-(s<<1))|0;r=(L0(d,r,s,o,p,q,t)|0)!=0;n=c[o>>2]|0;e=n;a:do if(r&(n|0)!=0){r=d+24|0;f=c[p>>2]|0;do if(!(ob[c[r>>2]&127](d,n,f,144340)|0)){if(!b){c[g>>2]=e;e=0;break a}}else {if(h|0)c[h>>2]=c[q>>2];if(!i)e=c[t>>2]|0;else {e=c[t>>2]|0;c[i>>2]=e;}if(!(L0(d,e,s,o,p,q,t)|0)){c[g>>2]=c[t>>2];e=0;break a}f=c[o>>2]|0;if(f|0){e=f;n=f;f=c[p>>2]|0;break}if(!b){e=1;break a}c[g>>2]=c[t>>2];e=0;break a}while(0);if(ob[c[r>>2]&127](d,n,f,144348)|0){f=c[q>>2]|0;e=f;if((((M0(d,f,s)|0)&-33)+-65|0)>>>0>=26){c[g>>2]=e;e=0;break}if(j|0)c[j>>2]=e;e=c[t>>2]|0;if(k|0)c[k>>2]=nb[a&63](d,f,e+(0-(c[u>>2]|0))|0)|0;if(!(L0(d,e,s,o,p,q,t)|0)){c[g>>2]=c[t>>2];e=0;break}e=c[o>>2]|0;if(!e){e=1;break}n=e;f=c[p>>2]|0;}if((b|0)!=0|(ob[c[r>>2]&127](d,n,f,144357)|0)==0){c[g>>2]=e;e=0;break}f=c[q>>2]|0;e=c[t>>2]|0;n=f;if(!(ob[c[r>>2]&127](d,f,e+(0-(c[u>>2]|0))|0,107657)|0)){if(!(ob[c[r>>2]&127](d,f,e+(0-(c[u>>2]|0))|0,107649)|0)){c[g>>2]=n;e=0;break}if(m)c[m>>2]=0;}else if(m)c[m>>2]=1;while(1){if(!(N0(M0(d,e,s)|0)|0))break;e=e+(c[u>>2]|0)|0;}c[t>>2]=e;if((e|0)==(s|0))e=1;else {c[g>>2]=e;e=0;}}else {c[g>>2]=c[t>>2];e=0;}while(0);l=v;return e|0}function L0(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0;a:do if((b|0)!=(d|0)){if(!(N0(M0(a,b,d)|0)|0)){c[h>>2]=b;b=0;break}j=a+64|0;do b=b+(c[j>>2]|0)|0;while((N0(M0(a,b,d)|0)|0)!=0);if((b|0)==(d|0)){c[e>>2]=0;b=1;break}c[e>>2]=b;b:while(1){i=M0(a,b,d)|0;switch(i|0){case -1:{i=11;break b}case 61:{i=12;break b}default:{}}if(N0(i)|0){i=14;break}b=b+(c[j>>2]|0)|0;}if((i|0)==11){c[h>>2]=b;b=0;break}else if((i|0)==12)c[f>>2]=b;else if((i|0)==14){c[f>>2]=b;do{b=b+(c[j>>2]|0)|0;i=M0(a,b,d)|0;}while((N0(i)|0)!=0);if((i|0)!=61){c[h>>2]=b;b=0;break}}if((b|0)==(c[e>>2]|0)){c[h>>2]=b;b=0;break}do{b=b+(c[j>>2]|0)|0;i=M0(a,b,d)|0;}while((N0(i)|0)!=0);switch(i|0){case 34:case 39:break;default:{c[h>>2]=b;b=0;break a}}f=b+(c[j>>2]|0)|0;c[g>>2]=f;b=i<<24>>24;c:while(1){i=M0(a,f,d)|0;if((i|0)==(b|0)){i=30;break}if((i+-48|0)>>>0>9&((i&-33)+-65|0)>>>0>25)switch(i|0){case 45:case 46:case 95:break;default:{i=28;break c}}f=f+(c[j>>2]|0)|0;}if((i|0)==28){c[h>>2]=f;b=0;break}else if((i|0)==30){c[h>>2]=f+(c[j>>2]|0);b=1;break}}else {c[e>>2]=0;b=1;}while(0);return b|0}function M0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+16|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+1|0)|0;l=h;return ((c[g>>2]|0)==(f|0)?-1:a[f>>0]|0)|0}function N0(a){a=a|0;switch(a|0){case 9:case 10:case 13:case 32:{a=1;break}default:a=0;}return a|0}function O0(){return 60092}function P0(b,d,e){b=b|0;d=d|0;e=e|0;e=Z$(e)|0;if((e|0)==-1)e=0;else {a[b+69>>0]=e;c[b>>2]=69;c[b+4>>2]=70;c[b+48>>2]=31;c[b+72>>2]=d;c[d>>2]=b;e=1;}return e|0}function Q0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(60456,a,0,b,c,d)|0}function R0(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return b0(60456,a,1,b,c,d)|0}function S0(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return K0(40,a,b,c,d,e,f,g,h,i,j)|0}function T0(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=l;l=l+144|0;i=h+4|0;f=h+8|0;g=h;c[i>>2]=d;c[g>>2]=f;pb[c[b+56>>2]&127](b,i,e,g,f+127|0)|0;do if((c[i>>2]|0)==(e|0)){a[c[g>>2]>>0]=0;if(H0(f,144315)|0?(c[b+64>>2]|0)==2:0)break;b=Z$(f)|0;if((b|0)!=-1)b=c[60456+(b<<2)>>2]|0;else b=0;}else b=0;while(0);l=h;return b|0}function U0(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;b=z_(b,c,d,e)|0;if(b|0)a[b+72+58>>0]=23;return b|0}function V0(a){a=a|0;c[a>>2]=15;c[a+16>>2]=1;c[a+12>>2]=0;c[a+20>>2]=0;return}function W0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{c[a>>2]=16;a=0;break}case 12:{c[a>>2]=16;a=1;break}case 11:{c[a>>2]=16;a=55;break}case 13:{c[a>>2]=16;a=56;break}case 14:{a=0;break}case 16:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]<<1)|0,e,144368)|0))g=9;else {c[a>>2]=17;a=3;}break}case 29:{c[a>>2]=18;a=2;break}default:g=9;}if((g|0)==9)a=_0(a,b)|0;return a|0}function X0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 14:case 15:{a=0;break}case 11:{a=55;break}case 13:{a=56;break}case 16:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]<<1)|0,e,144368)|0))g=7;else {c[a>>2]=17;a=3;}break}case 29:{c[a>>2]=18;a=2;break}default:g=7;}if((g|0)==7)a=_0(a,b)|0;return a|0}function Y0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 41:case 18:{c[a>>2]=19;a=4;break}default:a=_0(a,b)|0;}return a|0}function Z0(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0}function _0(a,b){a=a|0;b=b|0;if((b|0)==28&(c[a+16>>2]|0)==0)a=59;else {c[a>>2]=18;a=-1;}return a|0}function $0(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=3;break}case 25:{c[a>>2]=20;a=7;break}case 17:{c[a>>2]=21;a=8;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=22;a=3;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=8;else {c[a>>2]=23;a=3;}break}default:h=8;}while(0);if((h|0)==8)a=_0(a,b)|0;return a|0}function a1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a:do switch(b|0){case -4:case 15:{a=0;break}case 16:{g=f+24|0;h=f+64|0;if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144390)|0){c[a>>2]=24;a=11;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144397)|0){c[a>>2]=25;a=33;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144405)|0){c[a>>2]=26;a=39;break a}if(!(ob[c[g>>2]&127](f,d+(c[h>>2]<<1)|0,e,144413)|0))i=14;else {c[a>>2]=27;a=17;}break}case 11:{a=55;break}case 13:{a=56;break}case 28:{a=60;break}case 26:{c[a>>2]=28;a=3;break}default:i=14;}while(0);if((i|0)==14)a=_0(a,b)|0;return a|0}function b1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;f=b+-11|0;switch(f>>>1|f<<31|0){case 2:{a=0;break}case 0:{a=55;break}case 1:{a=56;break}case 9:{c[a>>2]=18;a=2;break}default:a=_0(a,b)|0;}return a|0}function c1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 27:{c[a>>2]=29;a=5;break}default:a=_0(a,b)|0;}return a|0}function d1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 27:{c[a>>2]=22;a=6;break}default:a=_0(a,b)|0;}return a|0}function e1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 25:{c[a>>2]=20;a=7;break}case 17:{c[a>>2]=21;a=8;break}default:a=_0(a,b)|0;}return a|0}function f1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 22:{c[a>>2]=30;a=11;break}case 18:{c[a>>2]=31;a=9;break}default:a=_0(a,b)|0;}return a|0}function g1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 41:case 18:{c[a>>2]=32;a=34;break}default:a=_0(a,b)|0;}return a|0}function h1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 41:case 18:{c[a>>2]=33;a=40;break}default:a=_0(a,b)|0;}return a|0}function i1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 18:{c[a>>2]=34;a=18;break}default:a=_0(a,b)|0;}return a|0}function j1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=3;break}case 17:{c[a>>2]=21;a=8;break}default:a=_0(a,b)|0;}return a|0}function k1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=17;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=35;a=17;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=6;else {c[a>>2]=36;a=17;}break}default:h=6;}while(0);if((h|0)==6)a=_0(a,b)|0;return a|0}function l1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=37;c[a+8>>2]=17;a=19;break}default:a=_0(a,b)|0;}return a|0}function m1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=38;a=21;break}default:a=_0(a,b)|0;}return a|0}function n1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=17;break}case 27:{c[a>>2]=37;c[a+8>>2]=17;a=19;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=20;break}default:a=_0(a,b)|0;}return a|0}function o1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=c[a+8>>2]|0;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=c[a+8>>2]|0;break}default:a=_0(a,b)|0;}return a|0}function p1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 33:{c[a>>2]=40;d=0;break}case 34:{d=a+12|0;e=c[d>>2]|0;if(!e)g=7;else {c[d>>2]=e+-1;d=0;}break}case 15:{d=0;break}case 26:{g=7;break}case -4:{if(!(c[a+12>>2]|0))d=0;else g=7;break}default:d=a1(a,b,d,e,f)|0;}if((g|0)==7)d=_0(a,b)|0;return d|0}function q1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=0;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144422)|0){c[a>>2]=41;a=0;break a}if(!(ob[c[g>>2]&127](f,d,e,144430)|0))h=6;else {c[a>>2]=42;a=0;}break}default:h=6;}while(0);if((h|0)==6)a=_0(a,b)|0;return a|0}function r1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=0;break}case 25:{c[a>>2]=39;a=a+12|0;c[a>>2]=(c[a>>2]|0)+1;a=0;break}default:a=_0(a,b)|0;}return a|0}function s1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=0;break}case 25:{c[a>>2]=39;a=58;break}default:a=_0(a,b)|0;}return a|0}function t1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=39;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144437)|0){c[a>>2]=37;c[a+8>>2]=39;a=42;break a}if(!(ob[c[g>>2]&127](f,d,e,144443)|0))h=7;else {c[a>>2]=37;c[a+8>>2]=39;a=41;}break}case 23:{c[a>>2]=43;c[a+4>>2]=1;a=44;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function u1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{a=39;break}case 20:{if(!(ob[c[f+24>>2]&127](f,d+(c[f+64>>2]|0)|0,e,144447)|0))g=9;else {c[a>>2]=44;a=43;}break}case 23:{c[a+4>>2]=2;c[a>>2]=45;a=44;break}case 41:case 18:{c[a>>2]=46;a=51;break}case 30:{c[a>>2]=46;a=53;break}case 31:{c[a>>2]=46;a=52;break}case 32:{c[a>>2]=46;a=54;break}default:g=9;}if((g|0)==9)a=_0(a,b)|0;return a|0}function v1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 24:{c[a>>2]=37;c[a+8>>2]=39;a=45;break}case 36:{c[a>>2]=37;c[a+8>>2]=39;a=46;break}case 21:{c[a>>2]=47;a=39;break}default:a=_0(a,b)|0;}return a|0}function w1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 23:{a=a+4|0;c[a>>2]=(c[a>>2]|0)+1;a=44;break}case 41:case 18:{c[a>>2]=46;a=51;break}case 30:{c[a>>2]=46;a=53;break}case 31:{c[a>>2]=46;a=52;break}case 32:{c[a>>2]=46;a=54;break}default:a=_0(a,b)|0;}return a|0}function x1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 24:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=45;}else a=45;break}case 36:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=46;}else a=46;break}case 35:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=47;}else a=47;break}case 37:{e=a+4|0;f=(c[e>>2]|0)+-1|0;c[e>>2]=f;if(!f){c[a>>2]=37;c[a+8>>2]=39;a=48;}else a=48;break}case 38:{c[a>>2]=45;a=50;break}case 21:{c[a>>2]=45;a=49;break}default:a=_0(a,b)|0;}return a|0}function y1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 41:case 18:{c[a>>2]=48;a=51;break}default:a=_0(a,b)|0;}return a|0}function z1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=39;break}case 36:{c[a>>2]=37;c[a+8>>2]=39;a=46;break}case 21:{c[a>>2]=47;a=39;break}default:a=_0(a,b)|0;}return a|0}function A1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=33;break}case 41:case 18:{c[a>>2]=49;a=22;break}default:a=_0(a,b)|0;}return a|0}function B1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;a:do switch(b|0){case 15:{g=33;break}case 18:{h=f+24|0;g=0;while(1){i=c[h>>2]|0;if((g|0)>=8)break;if(ob[i&127](f,d,e,c[62304+(g<<2)>>2]|0)|0){j=6;break}g=g+1|0;}if((j|0)==6){c[a>>2]=50;g=g+23|0;break a}if(!(ob[i&127](f,d,e,144413)|0))j=10;else {c[a>>2]=51;g=33;}break}case 23:{c[a>>2]=52;g=33;break}default:j=10;}while(0);if((j|0)==10)g=_0(a,b)|0;return g|0}function C1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a:do switch(b|0){case 15:{a=33;break}case 20:{g=f+24|0;h=f+64|0;if(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144454)|0){c[a>>2]=32;a=35;break a}if(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144462)|0){c[a>>2]=32;a=36;break a}if(!(ob[c[g>>2]&127](f,d+(c[h>>2]|0)|0,e,144471)|0))i=9;else {c[a>>2]=53;a=33;}break}case 27:{c[a>>2]=32;a=37;break}default:i=9;}while(0);if((i|0)==9)a=_0(a,b)|0;return a|0}function D1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 23:{c[a>>2]=54;a=33;break}default:a=_0(a,b)|0;}return a|0}function E1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 41:case 18:case 19:{c[a>>2]=55;a=31;break}default:a=_0(a,b)|0;}return a|0}function F1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 24:{c[a>>2]=50;a=33;break}case 21:{c[a>>2]=52;a=33;break}default:a=_0(a,b)|0;}return a|0}function G1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 18:{c[a>>2]=56;a=32;break}default:a=_0(a,b)|0;}return a|0}function H1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 24:{c[a>>2]=50;a=33;break}case 21:{c[a>>2]=54;a=33;break}default:a=_0(a,b)|0;}return a|0}function I1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=33;break}case 27:{c[a>>2]=32;a=38;break}default:a=_0(a,b)|0;}return a|0}function J1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 18:{c[a>>2]=57;a=10;break}default:a=_0(a,b)|0;}return a|0}function K1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=11;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=58;a=11;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=7;else {c[a>>2]=59;a=11;}break}case 27:{c[a>>2]=37;c[a+8>>2]=11;a=12;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function L1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=60;a=13;break}default:a=_0(a,b)|0;}return a|0}function M1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=58;a=14;break}default:a=_0(a,b)|0;}return a|0}function N1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;switch(b|0){case 15:{a=11;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=15;break}case 18:{if(!(ob[c[f+24>>2]&127](f,d,e,144525)|0))g=5;else {c[a>>2]=61;a=11;}break}default:g=5;}if((g|0)==5)a=_0(a,b)|0;return a|0}function O1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 18:{c[a>>2]=37;c[a+8>>2]=11;a=16;break}default:a=_0(a,b)|0;}return a|0}function P1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do switch(b|0){case 15:{a=11;break}case 18:{g=f+24|0;if(ob[c[g>>2]&127](f,d,e,144376)|0){c[a>>2]=62;a=11;break a}if(!(ob[c[g>>2]&127](f,d,e,144383)|0))h=7;else {c[a>>2]=63;a=11;}break}case 27:{c[a>>2]=37;c[a+8>>2]=11;a=12;break}default:h=7;}while(0);if((h|0)==7)a=_0(a,b)|0;return a|0}function Q1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=64;a=13;break}default:a=_0(a,b)|0;}return a|0}function R1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 27:{c[a>>2]=62;a=14;break}default:a=_0(a,b)|0;}return a|0}function S1(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;switch(b|0){case 15:{a=11;break}case 17:{c[a>>2]=c[a+16>>2]|0?20:39;a=15;break}default:a=_0(a,b)|0;}return a|0}function T1(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;x=l;l=l+16|0;p=x;do if(a>>>0<245){m=a>>>0<11?16:a+11&-8;a=m>>>3;o=c[47519]|0;d=o>>>a;if(d&3|0){b=(d&1^1)+a|0;a=190116+(b<<1<<2)|0;d=a+8|0;e=c[d>>2]|0;f=e+8|0;g=c[f>>2]|0;if((g|0)==(a|0))c[47519]=o&~(1<>2]=a;c[d>>2]=g;}w=b<<3;c[e+4>>2]=w|3;w=e+w+4|0;c[w>>2]=c[w>>2]|1;w=f;l=x;return w|0}n=c[47521]|0;if(m>>>0>n>>>0){if(d|0){b=2<>>12&16;b=b>>>i;d=b>>>5&8;b=b>>>d;g=b>>>2&4;b=b>>>g;a=b>>>1&2;b=b>>>a;e=b>>>1&1;e=(d|i|g|a|e)+(b>>>e)|0;b=190116+(e<<1<<2)|0;a=b+8|0;g=c[a>>2]|0;i=g+8|0;d=c[i>>2]|0;if((d|0)==(b|0)){a=o&~(1<>2]=b;c[a>>2]=d;a=o;}w=e<<3;h=w-m|0;c[g+4>>2]=m|3;f=g+m|0;c[f+4>>2]=h|1;c[g+w>>2]=h;if(n|0){e=c[47524]|0;b=n>>>3;d=190116+(b<<1<<2)|0;b=1<>2]|0;}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d;}c[47521]=h;c[47524]=f;w=i;l=x;return w|0}j=c[47520]|0;if(j){d=(j&0-j)+-1|0;i=d>>>12&16;d=d>>>i;h=d>>>5&8;d=d>>>h;k=d>>>2&4;d=d>>>k;e=d>>>1&2;d=d>>>e;a=d>>>1&1;a=c[190380+((h|i|k|e|a)+(d>>>a)<<2)>>2]|0;d=(c[a+4>>2]&-8)-m|0;e=c[a+16+(((c[a+16>>2]|0)==0&1)<<2)>>2]|0;if(!e){k=a;h=d;}else {do{i=(c[e+4>>2]&-8)-m|0;k=i>>>0>>0;d=k?i:d;a=k?e:a;e=c[e+16+(((c[e+16>>2]|0)==0&1)<<2)>>2]|0;}while((e|0)!=0);k=a;h=d;}i=k+m|0;if(i>>>0>k>>>0){f=c[k+24>>2]|0;b=c[k+12>>2]|0;do if((b|0)==(k|0)){a=k+20|0;b=c[a>>2]|0;if(!b){a=k+16|0;b=c[a>>2]|0;if(!b){d=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;d=b;}else {d=c[k+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b;}while(0);do if(f|0){b=c[k+28>>2]|0;a=190380+(b<<2)|0;if((k|0)==(c[a>>2]|0)){c[a>>2]=d;if(!d){c[47520]=j&~(1<>2]|0)!=(k|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=f;b=c[k+16>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d;}b=c[k+20>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d;}}while(0);if(h>>>0<16){w=h+m|0;c[k+4>>2]=w|3;w=k+w+4|0;c[w>>2]=c[w>>2]|1;}else {c[k+4>>2]=m|3;c[i+4>>2]=h|1;c[i+h>>2]=h;if(n|0){e=c[47524]|0;b=n>>>3;d=190116+(b<<1<<2)|0;b=1<>2]|0;}c[a>>2]=e;c[b+12>>2]=e;c[e+8>>2]=b;c[e+12>>2]=d;}c[47521]=h;c[47524]=i;}w=k+8|0;l=x;return w|0}else n=m;}else n=m;}else n=m;}else if(a>>>0<=4294967231){a=a+11|0;m=a&-8;k=c[47520]|0;if(k){e=0-m|0;a=a>>>8;if(a)if(m>>>0>16777215)j=31;else {o=(a+1048320|0)>>>16&8;v=a<>>16&4;v=v<>>16&2;j=14-(n|o|j)+(v<>>15)|0;j=m>>>(j+7|0)&1|j<<1;}else j=0;d=c[190380+(j<<2)>>2]|0;a:do if(!d){d=0;a=0;v=57;}else {a=0;i=d;h=m<<((j|0)==31?0:25-(j>>>1)|0);d=0;while(1){f=(c[i+4>>2]&-8)-m|0;if(f>>>0>>0)if(!f){e=0;d=i;a=i;v=61;break a}else {a=i;e=f;}f=c[i+20>>2]|0;i=c[i+16+(h>>>31<<2)>>2]|0;d=(f|0)==0|(f|0)==(i|0)?d:f;f=(i|0)==0;if(f){v=57;break}else h=h<<((f^1)&1);}}while(0);if((v|0)==57){if((d|0)==0&(a|0)==0){a=2<>>12&16;o=o>>>i;h=o>>>5&8;o=o>>>h;j=o>>>2&4;o=o>>>j;n=o>>>1&2;o=o>>>n;d=o>>>1&1;a=0;d=c[190380+((h|i|j|n|d)+(o>>>d)<<2)>>2]|0;}if(!d){i=a;h=e;}else v=61;}if((v|0)==61)while(1){v=0;n=(c[d+4>>2]&-8)-m|0;o=n>>>0>>0;e=o?n:e;a=o?d:a;d=c[d+16+(((c[d+16>>2]|0)==0&1)<<2)>>2]|0;if(!d){i=a;h=e;break}else v=61;}if((i|0)!=0?h>>>0<((c[47521]|0)-m|0)>>>0:0){g=i+m|0;if(g>>>0<=i>>>0){w=0;l=x;return w|0}f=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){a=i+20|0;b=c[a>>2]|0;if(!b){a=i+16|0;b=c[a>>2]|0;if(!b){b=0;break}}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;}else {w=c[i+8>>2]|0;c[w+12>>2]=b;c[b+8>>2]=w;}while(0);do if(f){a=c[i+28>>2]|0;d=190380+(a<<2)|0;if((i|0)==(c[d>>2]|0)){c[d>>2]=b;if(!b){e=k&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=b;if(!b){e=k;break}}c[b+24>>2]=f;a=c[i+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b;}a=c[i+20>>2]|0;if(a){c[b+20>>2]=a;c[a+24>>2]=b;e=k;}else e=k;}else e=k;while(0);do if(h>>>0>=16){c[i+4>>2]=m|3;c[g+4>>2]=h|1;c[g+h>>2]=h;b=h>>>3;if(h>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=g;c[b+12>>2]=g;c[g+8>>2]=b;c[g+12>>2]=d;break}b=h>>>8;if(b)if(h>>>0>16777215)b=31;else {v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;b=14-(u|v|b)+(w<>>15)|0;b=h>>>(b+7|0)&1|b<<1;}else b=0;d=190380+(b<<2)|0;c[g+28>>2]=b;a=g+16|0;c[a+4>>2]=0;c[a>>2]=0;a=1<>2]=g;c[g+24>>2]=d;c[g+12>>2]=g;c[g+8>>2]=g;break}a=h<<((b|0)==31?0:25-(b>>>1)|0);d=c[d>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(h|0)){v=97;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=96;break}else {a=a<<1;d=b;}}if((v|0)==96){c[e>>2]=g;c[g+24>>2]=d;c[g+12>>2]=g;c[g+8>>2]=g;break}else if((v|0)==97){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=g;c[v>>2]=g;c[g+8>>2]=w;c[g+12>>2]=d;c[g+24>>2]=0;break}}else {w=h+m|0;c[i+4>>2]=w|3;w=i+w+4|0;c[w>>2]=c[w>>2]|1;}while(0);w=i+8|0;l=x;return w|0}else n=m;}else n=m;}else n=-1;while(0);d=c[47521]|0;if(d>>>0>=n>>>0){b=d-n|0;a=c[47524]|0;if(b>>>0>15){w=a+n|0;c[47524]=w;c[47521]=b;c[w+4>>2]=b|1;c[a+d>>2]=b;c[a+4>>2]=n|3;}else {c[47521]=0;c[47524]=0;c[a+4>>2]=d|3;w=a+d+4|0;c[w>>2]=c[w>>2]|1;}w=a+8|0;l=x;return w|0}i=c[47522]|0;if(i>>>0>n>>>0){u=i-n|0;c[47522]=u;w=c[47525]|0;v=w+n|0;c[47525]=v;c[v+4>>2]=u|1;c[w+4>>2]=n|3;w=w+8|0;l=x;return w|0}if(!(c[47637]|0)){c[47639]=4096;c[47638]=4096;c[47640]=-1;c[47641]=-1;c[47642]=0;c[47630]=0;c[47637]=p&-16^1431655768;a=4096;}else a=c[47639]|0;j=n+48|0;k=n+47|0;h=a+k|0;f=0-a|0;m=h&f;if(m>>>0<=n>>>0){w=0;l=x;return w|0}a=c[47629]|0;if(a|0?(o=c[47627]|0,p=o+m|0,p>>>0<=o>>>0|p>>>0>a>>>0):0){w=0;l=x;return w|0}b:do if(!(c[47630]&4)){d=c[47525]|0;c:do if(d){e=190524;while(1){a=c[e>>2]|0;if(a>>>0<=d>>>0?(s=e+4|0,(a+(c[s>>2]|0)|0)>>>0>d>>>0):0)break;a=c[e+8>>2]|0;if(!a){v=118;break c}else e=a;}b=h-i&f;if(b>>>0<2147483647){a=Z6(b|0)|0;if((a|0)==((c[e>>2]|0)+(c[s>>2]|0)|0)){if((a|0)!=(-1|0)){h=b;g=a;v=135;break b}}else {e=a;v=126;}}else b=0;}else v=118;while(0);do if((v|0)==118){d=Z6(0)|0;if((d|0)!=(-1|0)?(b=d,q=c[47638]|0,r=q+-1|0,b=((r&b|0)==0?0:(r+b&0-q)-b|0)+m|0,q=c[47627]|0,r=b+q|0,b>>>0>n>>>0&b>>>0<2147483647):0){s=c[47629]|0;if(s|0?r>>>0<=q>>>0|r>>>0>s>>>0:0){b=0;break}a=Z6(b|0)|0;if((a|0)==(d|0)){h=b;g=d;v=135;break b}else {e=a;v=126;}}else b=0;}while(0);do if((v|0)==126){d=0-b|0;if(!(j>>>0>b>>>0&(b>>>0<2147483647&(e|0)!=(-1|0))))if((e|0)==(-1|0)){b=0;break}else {h=b;g=e;v=135;break b}a=c[47639]|0;a=k-b+a&0-a;if(a>>>0>=2147483647){h=b;g=e;v=135;break b}if((Z6(a|0)|0)==(-1|0)){Z6(d|0)|0;b=0;break}else {h=a+b|0;g=e;v=135;break b}}while(0);c[47630]=c[47630]|4;v=133;}else {b=0;v=133;}while(0);if(((v|0)==133?m>>>0<2147483647:0)?(g=Z6(m|0)|0,s=Z6(0)|0,t=s-g|0,u=t>>>0>(n+40|0)>>>0,!((g|0)==(-1|0)|u^1|g>>>0>>0&((g|0)!=(-1|0)&(s|0)!=(-1|0))^1)):0){h=u?t:b;v=135;}if((v|0)==135){b=(c[47627]|0)+h|0;c[47627]=b;if(b>>>0>(c[47628]|0)>>>0)c[47628]=b;j=c[47525]|0;do if(j){b=190524;while(1){a=c[b>>2]|0;d=b+4|0;e=c[d>>2]|0;if((g|0)==(a+e|0)){v=143;break}f=c[b+8>>2]|0;if(!f)break;else b=f;}if(((v|0)==143?(c[b+12>>2]&8|0)==0:0)?g>>>0>j>>>0&a>>>0<=j>>>0:0){c[d>>2]=e+h;w=(c[47522]|0)+h|0;u=j+8|0;u=(u&7|0)==0?0:0-u&7;v=j+u|0;u=w-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[j+w+4>>2]=40;c[47526]=c[47641];break}if(g>>>0<(c[47523]|0)>>>0)c[47523]=g;a=g+h|0;b=190524;while(1){if((c[b>>2]|0)==(a|0)){v=151;break}b=c[b+8>>2]|0;if(!b){a=190524;break}}if((v|0)==151)if(!(c[b+12>>2]&8)){c[b>>2]=g;m=b+4|0;c[m>>2]=(c[m>>2]|0)+h;m=g+8|0;m=g+((m&7|0)==0?0:0-m&7)|0;b=a+8|0;b=a+((b&7|0)==0?0:0-b&7)|0;k=m+n|0;i=b-m-n|0;c[m+4>>2]=n|3;do if((j|0)!=(b|0)){if((c[47524]|0)==(b|0)){w=(c[47521]|0)+i|0;c[47521]=w;c[47524]=k;c[k+4>>2]=w|1;c[k+w>>2]=w;break}a=c[b+4>>2]|0;if((a&3|0)==1){h=a&-8;e=a>>>3;d:do if(a>>>0<256){a=c[b+8>>2]|0;d=c[b+12>>2]|0;if((d|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=a;break}}else {g=c[b+24>>2]|0;a=c[b+12>>2]|0;do if((a|0)==(b|0)){e=b+16|0;d=e+4|0;a=c[d>>2]|0;if(!a){a=c[e>>2]|0;if(!a){a=0;break}else d=e;}while(1){e=a+20|0;f=c[e>>2]|0;if(f|0){a=f;d=e;continue}e=a+16|0;f=c[e>>2]|0;if(!f)break;else {a=f;d=e;}}c[d>>2]=0;}else {w=c[b+8>>2]|0;c[w+12>>2]=a;c[a+8>>2]=w;}while(0);if(!g)break;d=c[b+28>>2]|0;e=190380+(d<<2)|0;do if((c[e>>2]|0)!=(b|0)){c[g+16+(((c[g+16>>2]|0)!=(b|0)&1)<<2)>>2]=a;if(!a)break d}else {c[e>>2]=a;if(a|0)break;c[47520]=c[47520]&~(1<>2]=g;d=b+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a;}d=c[d+4>>2]|0;if(!d)break;c[a+20>>2]=d;c[d+24>>2]=a;}while(0);b=b+h|0;f=h+i|0;}else f=i;b=b+4|0;c[b>>2]=c[b>>2]&-2;c[k+4>>2]=f|1;c[k+f>>2]=f;b=f>>>3;if(f>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=k;c[b+12>>2]=k;c[k+8>>2]=b;c[k+12>>2]=d;break}b=f>>>8;do if(!b)b=0;else {if(f>>>0>16777215){b=31;break}v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;b=14-(u|v|b)+(w<>>15)|0;b=f>>>(b+7|0)&1|b<<1;}while(0);e=190380+(b<<2)|0;c[k+28>>2]=b;a=k+16|0;c[a+4>>2]=0;c[a>>2]=0;a=c[47520]|0;d=1<>2]=k;c[k+24>>2]=e;c[k+12>>2]=k;c[k+8>>2]=k;break}a=f<<((b|0)==31?0:25-(b>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){v=192;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=191;break}else {a=a<<1;d=b;}}if((v|0)==191){c[e>>2]=k;c[k+24>>2]=d;c[k+12>>2]=k;c[k+8>>2]=k;break}else if((v|0)==192){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=k;c[v>>2]=k;c[k+8>>2]=w;c[k+12>>2]=d;c[k+24>>2]=0;break}}else {w=(c[47522]|0)+i|0;c[47522]=w;c[47525]=k;c[k+4>>2]=w|1;}while(0);w=m+8|0;l=x;return w|0}else a=190524;while(1){b=c[a>>2]|0;if(b>>>0<=j>>>0?(w=b+(c[a+4>>2]|0)|0,w>>>0>j>>>0):0)break;a=c[a+8>>2]|0;}f=w+-47|0;a=f+8|0;a=f+((a&7|0)==0?0:0-a&7)|0;f=j+16|0;a=a>>>0>>0?j:a;b=a+8|0;d=h+-40|0;u=g+8|0;u=(u&7|0)==0?0:0-u&7;v=g+u|0;u=d-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[g+d+4>>2]=40;c[47526]=c[47641];d=a+4|0;c[d>>2]=27;c[b>>2]=c[47631];c[b+4>>2]=c[47632];c[b+8>>2]=c[47633];c[b+12>>2]=c[47634];c[47631]=g;c[47632]=h;c[47634]=0;c[47633]=b;b=a+24|0;do{v=b;b=b+4|0;c[b>>2]=7;}while((v+8|0)>>>0>>0);if((a|0)!=(j|0)){g=a-j|0;c[d>>2]=c[d>>2]&-2;c[j+4>>2]=g|1;c[a>>2]=g;b=g>>>3;if(g>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=j;c[b+12>>2]=j;c[j+8>>2]=b;c[j+12>>2]=d;break}b=g>>>8;if(b)if(g>>>0>16777215)d=31;else {v=(b+1048320|0)>>>16&8;w=b<>>16&4;w=w<>>16&2;d=14-(u|v|d)+(w<>>15)|0;d=g>>>(d+7|0)&1|d<<1;}else d=0;e=190380+(d<<2)|0;c[j+28>>2]=d;c[j+20>>2]=0;c[f>>2]=0;b=c[47520]|0;a=1<>2]=j;c[j+24>>2]=e;c[j+12>>2]=j;c[j+8>>2]=j;break}a=g<<((d|0)==31?0:25-(d>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(g|0)){v=213;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){v=212;break}else {a=a<<1;d=b;}}if((v|0)==212){c[e>>2]=j;c[j+24>>2]=d;c[j+12>>2]=j;c[j+8>>2]=j;break}else if((v|0)==213){v=d+8|0;w=c[v>>2]|0;c[w+12>>2]=j;c[v>>2]=j;c[j+8>>2]=w;c[j+12>>2]=d;c[j+24>>2]=0;break}}}else {w=c[47523]|0;if((w|0)==0|g>>>0>>0)c[47523]=g;c[47631]=g;c[47632]=h;c[47634]=0;c[47528]=c[47637];c[47527]=-1;c[47532]=190116;c[47531]=190116;c[47534]=190124;c[47533]=190124;c[47536]=190132;c[47535]=190132;c[47538]=190140;c[47537]=190140;c[47540]=190148;c[47539]=190148;c[47542]=190156;c[47541]=190156;c[47544]=190164;c[47543]=190164;c[47546]=190172;c[47545]=190172;c[47548]=190180;c[47547]=190180;c[47550]=190188;c[47549]=190188;c[47552]=190196;c[47551]=190196;c[47554]=190204;c[47553]=190204;c[47556]=190212;c[47555]=190212;c[47558]=190220;c[47557]=190220;c[47560]=190228;c[47559]=190228;c[47562]=190236;c[47561]=190236;c[47564]=190244;c[47563]=190244;c[47566]=190252;c[47565]=190252;c[47568]=190260;c[47567]=190260;c[47570]=190268;c[47569]=190268;c[47572]=190276;c[47571]=190276;c[47574]=190284;c[47573]=190284;c[47576]=190292;c[47575]=190292;c[47578]=190300;c[47577]=190300;c[47580]=190308;c[47579]=190308;c[47582]=190316;c[47581]=190316;c[47584]=190324;c[47583]=190324;c[47586]=190332;c[47585]=190332;c[47588]=190340;c[47587]=190340;c[47590]=190348;c[47589]=190348;c[47592]=190356;c[47591]=190356;c[47594]=190364;c[47593]=190364;w=h+-40|0;u=g+8|0;u=(u&7|0)==0?0:0-u&7;v=g+u|0;u=w-u|0;c[47525]=v;c[47522]=u;c[v+4>>2]=u|1;c[g+w+4>>2]=40;c[47526]=c[47641];}while(0);b=c[47522]|0;if(b>>>0>n>>>0){u=b-n|0;c[47522]=u;w=c[47525]|0;v=w+n|0;c[47525]=v;c[v+4>>2]=u|1;c[w+4>>2]=n|3;w=w+8|0;l=x;return w|0}}c[(d2()|0)>>2]=12;w=0;l=x;return w|0}function U1(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!a)return;d=a+-8|0;f=c[47523]|0;a=c[a+-4>>2]|0;b=a&-8;j=d+b|0;do if(!(a&1)){e=c[d>>2]|0;if(!(a&3))return;h=d+(0-e)|0;g=e+b|0;if(h>>>0>>0)return;if((c[47524]|0)==(h|0)){a=j+4|0;b=c[a>>2]|0;if((b&3|0)!=3){i=h;b=g;break}c[47521]=g;c[a>>2]=b&-2;c[h+4>>2]=g|1;c[h+g>>2]=g;return}d=e>>>3;if(e>>>0<256){a=c[h+8>>2]|0;b=c[h+12>>2]|0;if((b|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=b;c[b+8>>2]=a;i=h;b=g;break}}f=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){d=h+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){a=0;break}else b=d;}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else {a=e;b=d;}}c[b>>2]=0;}else {i=c[h+8>>2]|0;c[i+12>>2]=a;c[a+8>>2]=i;}while(0);if(f){b=c[h+28>>2]|0;d=190380+(b<<2)|0;if((c[d>>2]|0)==(h|0)){c[d>>2]=a;if(!a){c[47520]=c[47520]&~(1<>2]|0)!=(h|0)&1)<<2)>>2]=a;if(!a){i=h;b=g;break}}c[a+24>>2]=f;b=h+16|0;d=c[b>>2]|0;if(d|0){c[a+16>>2]=d;c[d+24>>2]=a;}b=c[b+4>>2]|0;if(b){c[a+20>>2]=b;c[b+24>>2]=a;i=h;b=g;}else {i=h;b=g;}}else {i=h;b=g;}}else {i=d;h=d;}while(0);if(h>>>0>=j>>>0)return;a=j+4|0;e=c[a>>2]|0;if(!(e&1))return;if(!(e&2)){if((c[47525]|0)==(j|0)){j=(c[47522]|0)+b|0;c[47522]=j;c[47525]=i;c[i+4>>2]=j|1;if((i|0)!=(c[47524]|0))return;c[47524]=0;c[47521]=0;return}if((c[47524]|0)==(j|0)){j=(c[47521]|0)+b|0;c[47521]=j;c[47524]=h;c[i+4>>2]=j|1;c[h+j>>2]=j;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){b=c[j+8>>2]|0;a=c[j+12>>2]|0;if((a|0)==(b|0)){c[47519]=c[47519]&~(1<>2]=a;c[a+8>>2]=b;break}}else {g=c[j+24>>2]|0;a=c[j+12>>2]|0;do if((a|0)==(j|0)){d=j+16|0;b=d+4|0;a=c[b>>2]|0;if(!a){a=c[d>>2]|0;if(!a){d=0;break}else b=d;}while(1){d=a+20|0;e=c[d>>2]|0;if(e|0){a=e;b=d;continue}d=a+16|0;e=c[d>>2]|0;if(!e)break;else {a=e;b=d;}}c[b>>2]=0;d=a;}else {d=c[j+8>>2]|0;c[d+12>>2]=a;c[a+8>>2]=d;d=a;}while(0);if(g|0){a=c[j+28>>2]|0;b=190380+(a<<2)|0;if((c[b>>2]|0)==(j|0)){c[b>>2]=d;if(!d){c[47520]=c[47520]&~(1<>2]|0)!=(j|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=g;a=j+16|0;b=c[a>>2]|0;if(b|0){c[d+16>>2]=b;c[b+24>>2]=d;}a=c[a+4>>2]|0;if(a|0){c[d+20>>2]=a;c[a+24>>2]=d;}}}while(0);c[i+4>>2]=f|1;c[h+f>>2]=f;if((i|0)==(c[47524]|0)){c[47521]=f;return}}else {c[a>>2]=e&-2;c[i+4>>2]=b|1;c[h+b>>2]=b;f=b;}a=f>>>3;if(f>>>0<256){d=190116+(a<<1<<2)|0;b=c[47519]|0;a=1<>2]|0;}c[b>>2]=i;c[a+12>>2]=i;c[i+8>>2]=a;c[i+12>>2]=d;return}a=f>>>8;if(a)if(f>>>0>16777215)a=31;else {h=(a+1048320|0)>>>16&8;j=a<>>16&4;j=j<>>16&2;a=14-(g|h|a)+(j<>>15)|0;a=f>>>(a+7|0)&1|a<<1;}else a=0;e=190380+(a<<2)|0;c[i+28>>2]=a;c[i+20>>2]=0;c[i+16>>2]=0;b=c[47520]|0;d=1<>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){a=73;break}e=d+16+(b>>>31<<2)|0;a=c[e>>2]|0;if(!a){a=72;break}else {b=b<<1;d=a;}}if((a|0)==72){c[e>>2]=i;c[i+24>>2]=d;c[i+12>>2]=i;c[i+8>>2]=i;break}else if((a|0)==73){h=d+8|0;j=c[h>>2]|0;c[j+12>>2]=i;c[h>>2]=i;c[i+8>>2]=j;c[i+12>>2]=d;c[i+24>>2]=0;break}}else {c[47520]=b|d;c[e>>2]=i;c[i+24>>2]=e;c[i+12>>2]=i;c[i+8>>2]=i;}while(0);j=(c[47527]|0)+-1|0;c[47527]=j;if(!j)a=190532;else return;while(1){a=c[a>>2]|0;if(!a)break;else a=a+8|0;}c[47527]=-1;return}function V1(a,b){a=a|0;b=b|0;var d=0;if(a){d=O(b,a)|0;if((b|a)>>>0>65535)d=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1;}else d=0;a=T1(d)|0;if(!a)return a|0;if(!(c[a+-4>>2]&3))return a|0;Y6(a|0,0,d|0)|0;return a|0}function W1(a,b){a=a|0;b=b|0;var d=0,e=0;if(!a){b=T1(b)|0;return b|0}if(b>>>0>4294967231){c[(d2()|0)>>2]=12;b=0;return b|0}d=X1(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(d|0){b=d+8|0;return b|0}d=T1(b)|0;if(!d){b=0;return b|0}e=c[a+-4>>2]|0;e=(e&-8)-((e&3|0)==0?8:4)|0;W6(d|0,a|0,(e>>>0>>0?e:b)|0)|0;U1(a);b=d;return b|0}function X1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=a+4|0;m=c[l>>2]|0;d=m&-8;i=a+d|0;if(!(m&3)){if(b>>>0<256){a=0;return a|0}if(d>>>0>=(b+4|0)>>>0?(d-b|0)>>>0<=c[47639]<<1>>>0:0)return a|0;a=0;return a|0}if(d>>>0>=b>>>0){d=d-b|0;if(d>>>0<=15)return a|0;k=a+b|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|3;m=i+4|0;c[m>>2]=c[m>>2]|1;Y1(k,d);return a|0}if((c[47525]|0)==(i|0)){k=(c[47522]|0)+d|0;d=k-b|0;e=a+b|0;if(k>>>0<=b>>>0){a=0;return a|0}c[l>>2]=m&1|b|2;c[e+4>>2]=d|1;c[47525]=e;c[47522]=d;return a|0}if((c[47524]|0)==(i|0)){e=(c[47521]|0)+d|0;if(e>>>0>>0){a=0;return a|0}d=e-b|0;if(d>>>0>15){k=a+b|0;e=a+e|0;c[l>>2]=m&1|b|2;c[k+4>>2]=d|1;c[e>>2]=d;e=e+4|0;c[e>>2]=c[e>>2]&-2;e=k;}else {c[l>>2]=m&1|e|2;e=a+e+4|0;c[e>>2]=c[e>>2]|1;e=0;d=0;}c[47521]=d;c[47524]=e;return a|0}e=c[i+4>>2]|0;if(e&2|0){a=0;return a|0}j=(e&-8)+d|0;if(j>>>0>>0){a=0;return a|0}k=j-b|0;f=e>>>3;do if(e>>>0<256){e=c[i+8>>2]|0;d=c[i+12>>2]|0;if((d|0)==(e|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=e;break}}else {h=c[i+24>>2]|0;d=c[i+12>>2]|0;do if((d|0)==(i|0)){f=i+16|0;e=f+4|0;d=c[e>>2]|0;if(!d){d=c[f>>2]|0;if(!d){f=0;break}else g=f;}else g=e;while(1){f=d+20|0;e=c[f>>2]|0;if(e|0){d=e;g=f;continue}e=d+16|0;f=c[e>>2]|0;if(!f)break;else {d=f;g=e;}}c[g>>2]=0;f=d;}else {f=c[i+8>>2]|0;c[f+12>>2]=d;c[d+8>>2]=f;f=d;}while(0);if(h|0){d=c[i+28>>2]|0;e=190380+(d<<2)|0;if((c[e>>2]|0)==(i|0)){c[e>>2]=f;if(!f){c[47520]=c[47520]&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=f;if(!f)break}c[f+24>>2]=h;d=i+16|0;e=c[d>>2]|0;if(e|0){c[f+16>>2]=e;c[e+24>>2]=f;}d=c[d+4>>2]|0;if(d|0){c[f+20>>2]=d;c[d+24>>2]=f;}}}while(0);if(k>>>0<16){c[l>>2]=j|m&1|2;m=a+j+4|0;c[m>>2]=c[m>>2]|1;return a|0}else {i=a+b|0;c[l>>2]=m&1|b|2;c[i+4>>2]=k|3;m=a+j+4|0;c[m>>2]=c[m>>2]|1;Y1(i,k);return a|0}return 0}function Y1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;i=a+b|0;d=c[a+4>>2]|0;do if(!(d&1)){f=c[a>>2]|0;if(!(d&3))return;h=a+(0-f)|0;b=f+b|0;if((c[47524]|0)==(h|0)){a=i+4|0;d=c[a>>2]|0;if((d&3|0)!=3)break;c[47521]=b;c[a>>2]=d&-2;c[h+4>>2]=b|1;c[i>>2]=b;return}e=f>>>3;if(f>>>0<256){a=c[h+8>>2]|0;d=c[h+12>>2]|0;if((d|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=d;c[d+8>>2]=a;break}}g=c[h+24>>2]|0;a=c[h+12>>2]|0;do if((a|0)==(h|0)){e=h+16|0;d=e+4|0;a=c[d>>2]|0;if(!a){a=c[e>>2]|0;if(!a){a=0;break}else d=e;}while(1){e=a+20|0;f=c[e>>2]|0;if(f|0){a=f;d=e;continue}e=a+16|0;f=c[e>>2]|0;if(!f)break;else {a=f;d=e;}}c[d>>2]=0;}else {f=c[h+8>>2]|0;c[f+12>>2]=a;c[a+8>>2]=f;}while(0);if(g){d=c[h+28>>2]|0;e=190380+(d<<2)|0;if((c[e>>2]|0)==(h|0)){c[e>>2]=a;if(!a){c[47520]=c[47520]&~(1<>2]|0)!=(h|0)&1)<<2)>>2]=a;if(!a)break}c[a+24>>2]=g;d=h+16|0;e=c[d>>2]|0;if(e|0){c[a+16>>2]=e;c[e+24>>2]=a;}d=c[d+4>>2]|0;if(d){c[a+20>>2]=d;c[d+24>>2]=a;}}}else h=a;while(0);a=i+4|0;e=c[a>>2]|0;if(!(e&2)){if((c[47525]|0)==(i|0)){i=(c[47522]|0)+b|0;c[47522]=i;c[47525]=h;c[h+4>>2]=i|1;if((h|0)!=(c[47524]|0))return;c[47524]=0;c[47521]=0;return}if((c[47524]|0)==(i|0)){i=(c[47521]|0)+b|0;c[47521]=i;c[47524]=h;c[h+4>>2]=i|1;c[h+i>>2]=i;return}f=(e&-8)+b|0;d=e>>>3;do if(e>>>0<256){a=c[i+8>>2]|0;b=c[i+12>>2]|0;if((b|0)==(a|0)){c[47519]=c[47519]&~(1<>2]=b;c[b+8>>2]=a;break}}else {g=c[i+24>>2]|0;b=c[i+12>>2]|0;do if((b|0)==(i|0)){d=i+16|0;a=d+4|0;b=c[a>>2]|0;if(!b){b=c[d>>2]|0;if(!b){d=0;break}else a=d;}while(1){d=b+20|0;e=c[d>>2]|0;if(e|0){b=e;a=d;continue}d=b+16|0;e=c[d>>2]|0;if(!e)break;else {b=e;a=d;}}c[a>>2]=0;d=b;}else {d=c[i+8>>2]|0;c[d+12>>2]=b;c[b+8>>2]=d;d=b;}while(0);if(g|0){b=c[i+28>>2]|0;a=190380+(b<<2)|0;if((c[a>>2]|0)==(i|0)){c[a>>2]=d;if(!d){c[47520]=c[47520]&~(1<>2]|0)!=(i|0)&1)<<2)>>2]=d;if(!d)break}c[d+24>>2]=g;b=i+16|0;a=c[b>>2]|0;if(a|0){c[d+16>>2]=a;c[a+24>>2]=d;}b=c[b+4>>2]|0;if(b|0){c[d+20>>2]=b;c[b+24>>2]=d;}}}while(0);c[h+4>>2]=f|1;c[h+f>>2]=f;if((h|0)==(c[47524]|0)){c[47521]=f;return}}else {c[a>>2]=e&-2;c[h+4>>2]=b|1;c[h+b>>2]=b;f=b;}b=f>>>3;if(f>>>0<256){d=190116+(b<<1<<2)|0;a=c[47519]|0;b=1<>2]|0;}c[a>>2]=h;c[b+12>>2]=h;c[h+8>>2]=b;c[h+12>>2]=d;return}b=f>>>8;if(b)if(f>>>0>16777215)b=31;else {g=(b+1048320|0)>>>16&8;i=b<>>16&4;i=i<>>16&2;b=14-(e|g|b)+(i<>>15)|0;b=f>>>(b+7|0)&1|b<<1;}else b=0;e=190380+(b<<2)|0;c[h+28>>2]=b;c[h+20>>2]=0;c[h+16>>2]=0;a=c[47520]|0;d=1<>2]=h;c[h+24>>2]=e;c[h+12>>2]=h;c[h+8>>2]=h;return}a=f<<((b|0)==31?0:25-(b>>>1)|0);d=c[e>>2]|0;while(1){if((c[d+4>>2]&-8|0)==(f|0)){b=69;break}e=d+16+(a>>>31<<2)|0;b=c[e>>2]|0;if(!b){b=68;break}else {a=a<<1;d=b;}}if((b|0)==68){c[e>>2]=h;c[h+24>>2]=d;c[h+12>>2]=h;c[h+8>>2]=h;return}else if((b|0)==69){g=d+8|0;i=c[g>>2]|0;c[i+12>>2]=h;c[g>>2]=h;c[h+8>>2]=i;c[h+12>>2]=d;c[h+24>>2]=0;return}}function Z1(a,b){a=a|0;b=b|0;if(a>>>0<9){b=T1(b)|0;return b|0}else {b=_1(a,b)|0;return b|0}return 0}function _1(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;a=a>>>0>16?a:16;if(a+-1&a){d=16;while(1)if(d>>>0>>0)d=d<<1;else {a=d;break}}if((-64-a|0)>>>0<=b>>>0){c[(d2()|0)>>2]=12;h=0;return h|0}g=b>>>0<11?16:b+11&-8;d=T1(g+12+a|0)|0;if(!d){h=0;return h|0}f=d+-8|0;do if(a+-1&d){e=(d+a+-1&0-a)+-8|0;b=f;e=(e-b|0)>>>0>15?e:e+a|0;b=e-b|0;a=d+-4|0;i=c[a>>2]|0;d=(i&-8)-b|0;if(!(i&3)){c[e>>2]=(c[f>>2]|0)+b;c[e+4>>2]=d;a=e;b=e;break}else {i=e+4|0;c[i>>2]=d|c[i>>2]&1|2;d=e+d+4|0;c[d>>2]=c[d>>2]|1;c[a>>2]=b|c[a>>2]&1|2;c[i>>2]=c[i>>2]|1;Y1(f,b);a=e;b=e;break}}else {a=f;b=f;}while(0);a=a+4|0;d=c[a>>2]|0;if(d&3|0?(h=d&-8,h>>>0>(g+16|0)>>>0):0){i=h-g|0;f=b+g|0;c[a>>2]=g|d&1|2;c[f+4>>2]=i|3;h=b+h+4|0;c[h>>2]=c[h>>2]|1;Y1(f,i);}i=b+8|0;return i|0}function $1(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=e2(c[a+60>>2]|0)|0;a=c2(Ja(6,d|0)|0)|0;l=b;return a|0}function a2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+32|0;f=k;i=k+16|0;c[i>>2]=d;g=i+4|0;j=b+48|0;m=c[j>>2]|0;c[g>>2]=e-((m|0)!=0&1);h=b+44|0;c[i+8>>2]=c[h>>2];c[i+12>>2]=m;c[f>>2]=c[b+60>>2];c[f+4>>2]=i;c[f+8>>2]=2;f=c2(ya(145,f|0)|0)|0;if((f|0)>=1){i=c[g>>2]|0;if(f>>>0>i>>>0){g=c[h>>2]|0;h=b+4|0;c[h>>2]=g;c[b+8>>2]=g+(f-i);if(!(c[j>>2]|0))f=e;else {c[h>>2]=g+1;a[d+(e+-1)>>0]=a[g>>0]|0;f=e;}}}else c[b>>2]=c[b>>2]|f&48^16;l=k;return f|0}function b2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=l;l=l+32|0;g=f;e=f+20|0;c[g>>2]=c[a+60>>2];c[g+4>>2]=0;c[g+8>>2]=b;c[g+12>>2]=e;c[g+16>>2]=d;if((c2(xa(140,g|0)|0)|0)<0){c[e>>2]=-1;a=-1;}else a=c[e>>2]|0;l=f;return a|0}function c2(a){a=a|0;if(a>>>0>4294963200){c[(d2()|0)>>2]=0-a;a=-1;}return a|0}function d2(){return 190572}function e2(a){a=a|0;return a|0}function f2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+32|0;f=g;c[b+36>>2]=18;if((c[b>>2]&64|0)==0?(c[f>>2]=c[b+60>>2],c[f+4>>2]=21523,c[f+8>>2]=g+16,Ia(54,f|0)|0):0)a[b+75>>0]=-1;f=g2(b,d,e)|0;l=g;return f|0}function g2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;n=l;l=l+48|0;k=n+16|0;g=n;f=n+32|0;i=a+28|0;e=c[i>>2]|0;c[f>>2]=e;j=a+20|0;e=(c[j>>2]|0)-e|0;c[f+4>>2]=e;c[f+8>>2]=b;c[f+12>>2]=d;e=e+d|0;h=a+60|0;c[g>>2]=c[h>>2];c[g+4>>2]=f;c[g+8>>2]=2;g=c2(za(146,g|0)|0)|0;a:do if((e|0)!=(g|0)){b=2;while(1){if((g|0)<0)break;e=e-g|0;p=c[f+4>>2]|0;o=g>>>0>p>>>0;f=o?f+8|0:f;b=b+(o<<31>>31)|0;p=g-(o?p:0)|0;c[f>>2]=(c[f>>2]|0)+p;o=f+4|0;c[o>>2]=(c[o>>2]|0)-p;c[k>>2]=c[h>>2];c[k+4>>2]=f;c[k+8>>2]=b;g=c2(za(146,k|0)|0)|0;if((e|0)==(g|0)){m=3;break a}}c[a+16>>2]=0;c[i>>2]=0;c[j>>2]=0;c[a>>2]=c[a>>2]|32;if((b|0)==2)d=0;else d=d-(c[f+4>>2]|0)|0;}else m=3;while(0);if((m|0)==3){p=c[a+44>>2]|0;c[a+16>>2]=p+(c[a+48>>2]|0);c[i>>2]=p;c[j>>2]=p;}l=n;return d|0}function h2(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=a;c[e+4>>2]=b;b=c2(Ka(91,e|0)|0)|0;l=d;return b|0}function i2(){return}function j2(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=l;l=l+32|0;h=i;do if((g&4095|0)==0&(((g|0)<0)<<31>>31&-4096|0)==0){if(b>>>0>2147483646){c[(d2()|0)>>2]=12;a=-1;break}c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=d;c[h+12>>2]=e;c[h+16>>2]=f;c[h+20>>2]=g>>12;a=c2(Aa(192,h|0)|0)|0;}else {c[(d2()|0)>>2]=22;a=-1;}while(0);l=i;return a|0}function k2(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;f=d&255;a:do if(!f)b=b+(l2(b)|0)|0;else {if(b&3){e=d&255;do{g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break a;b=b+1|0;}while((b&3|0)!=0)}f=O(f,16843009)|0;e=c[b>>2]|0;b:do if(!((e&-2139062144^-2139062144)&e+-16843009))do{g=e^f;if((g&-2139062144^-2139062144)&g+-16843009|0)break b;b=b+4|0;e=c[b>>2]|0;}while(!((e&-2139062144^-2139062144)&e+-16843009|0));while(0);e=d&255;while(1){g=a[b>>0]|0;if(g<<24>>24==0?1:g<<24>>24==e<<24>>24)break;else b=b+1|0;}}while(0);return b|0}function l2(b){b=b|0;var d=0,e=0,f=0;f=b;a:do if(!(f&3))e=4;else {d=f;while(1){if(!(a[b>>0]|0)){b=d;break a}b=b+1|0;d=b;if(!(d&3)){e=4;break}}}while(0);if((e|0)==4){while(1){d=c[b>>2]|0;if(!((d&-2139062144^-2139062144)&d+-16843009))b=b+4|0;else break}if((d&255)<<24>>24)do b=b+1|0;while((a[b>>0]|0)!=0)}return b-f|0}function m2(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+48|0;g=h+16|0;f=h;e=h+32|0;if(!(b&4194368))e=0;else {c[e>>2]=d;i=(c[e>>2]|0)+(4-1)&~(4-1);d=c[i>>2]|0;c[e>>2]=i+4;e=d;}c[f>>2]=a;c[f+4>>2]=b|32768;c[f+8>>2]=e;e=Ha(5,f|0)|0;if(!((b&524288|0)==0|(e|0)<0)){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;}i=c2(e)|0;l=h;return i|0}function n2(b,e){b=b|0;e=e|0;var f=0,g=0;g=0;while(1){if((d[144531+g>>0]|0)==(b|0)){b=2;break}f=g+1|0;if((f|0)==87){f=144619;g=87;b=5;break}else g=f;}if((b|0)==2)if(!g)f=144619;else {f=144619;b=5;}if((b|0)==5)while(1){do{b=f;f=f+1|0;}while((a[b>>0]|0)!=0);g=g+-1|0;if(!g)break;else b=5;}return o2(f,c[e+20>>2]|0)|0}function o2(a,b){a=a|0;b=b|0;return p2(a,b)|0}function p2(a,b){a=a|0;b=b|0;if(!b)b=0;else b=q2(c[b>>2]|0,c[b+4>>2]|0,a)|0;return (b|0?b:a)|0}function q2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=(c[b>>2]|0)+1794895138|0;h=r2(c[b+8>>2]|0,o)|0;f=r2(c[b+12>>2]|0,o)|0;g=r2(c[b+16>>2]|0,o)|0;a:do if((h>>>0>>2>>>0?(n=d-(h<<2)|0,f>>>0>>0&g>>>0>>0):0)?((g|f)&3|0)==0:0){n=f>>>2;m=g>>>2;l=0;while(1){j=h>>>1;k=l+j|0;i=k<<1;g=i+n|0;f=r2(c[b+(g<<2)>>2]|0,o)|0;g=r2(c[b+(g+1<<2)>>2]|0,o)|0;if(!(g>>>0>>0&f>>>0<(d-g|0)>>>0)){f=0;break a}if(a[b+(g+f)>>0]|0){f=0;break a}f=s2(e,b+g|0)|0;if(!f)break;f=(f|0)<0;if((h|0)==1){f=0;break a}else {l=f?l:k;h=f?j:h-j|0;}}f=i+m|0;g=r2(c[b+(f<<2)>>2]|0,o)|0;f=r2(c[b+(f+1<<2)>>2]|0,o)|0;if(f>>>0>>0&g>>>0<(d-f|0)>>>0)f=(a[b+(f+g)>>0]|0)==0?b+f|0:0;else f=0;}else f=0;while(0);return f|0}function r2(a,b){a=a|0;b=b|0;var c=0;c=T6(a|0)|0;return ((b|0)==0?a:c)|0}function s2(b,c){b=b|0;c=c|0;var d=0,e=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24)b=e;else {do{b=b+1|0;c=c+1|0;d=a[b>>0]|0;e=a[c>>0]|0;}while(!(d<<24>>24==0?1:d<<24>>24!=e<<24>>24));b=e;}return (d&255)-(b&255)|0}function t2(a){a=a|0;return n2(a,c[(u2()|0)+188>>2]|0)|0}function u2(){return v2()|0}function v2(){return 62976}function w2(a,b,c){a=+a;b=+b;c=c|0;var d=0.0,e=0.0,f=0.0;f=a*a;d=f*(f*f)*(f*1.58969099521155e-10+-2.5050760253406863e-08)+(f*(f*2.7557313707070068e-06+-1.984126982985795e-04)+.00833333333332249);e=f*a;if(!c)a=e*(f*d+-.16666666666666632)+a;else a=a-(e*.16666666666666632+(f*(b*.5-e*d)-b));return +a}function x2(a){a=+a;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,k=0.0,l=0.0,m=0.0;h[j>>3]=a;b=c[j>>2]|0;d=c[j+4>>2]|0;e=(d|0)<0;do if(e|d>>>0<1048576){if((b|0)==0&(d&2147483647|0)==0){a=-1.0/(a*a);break}if(e){a=(a-a)/0.0;break}else {h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;e=-1077;b=c[j>>2]|0;f=9;break}}else if(d>>>0<=2146435071)if((b|0)==0&0==0&(d|0)==1072693248)a=0.0;else {e=-1023;f=9;}while(0);if((f|0)==9){f=d+614242|0;c[j>>2]=b;c[j+4>>2]=(f&1048575)+1072079006;m=+h[j>>3]+-1.0;k=m*(m*.5);i=m/(m+2.0);l=i*i;g=l*l;h[j>>3]=m-k;d=c[j+4>>2]|0;c[j>>2]=0;c[j+4>>2]=d;a=+h[j>>3];g=m-a-k+i*(k+(g*(g*(g*.15313837699209373+.22222198432149784)+.3999999999940942)+l*(g*(g*(g*.14798198605116586+.1818357216161805)+.2857142874366239)+.6666666666666735)));l=a*1.4426950407214463;k=+(e+(f>>>20)|0);i=l+k;a=i+(l+(k-i)+(g*1.4426950407214463+(g+a)*1.6751713164886512e-10));}return +a}function y2(a,b){a=+a;b=b|0;var d=0,e=0,f=0;h[j>>3]=a;d=c[j>>2]|0;e=c[j+4>>2]|0;f=Q6(d|0,e|0,52)|0;switch(f&2047){case 0:{if(a!=0.0){a=+y2(a*18446744073709551616.0,b);d=(c[b>>2]|0)+-64|0;}else d=0;c[b>>2]=d;break}case 2047:break;default:{c[b>>2]=(f&2047)+-1022;c[j>>2]=d;c[j+4>>2]=e&-2146435073|1071644672;a=+h[j>>3];}}return +a}function z2(a,b){a=+a;b=+b;var c=0.0,d=0.0,e=0.0,f=0.0;c=a*a;d=c*c;e=c*.5;f=1.0-e;return +(f+(1.0-f-e+(c*(c*(c*(c*2.480158728947673e-05+-.001388888888887411)+.0416666666666666)+d*d*(c*(2.087572321298175e-09-c*1.1359647557788195e-11)+-2.7557314351390663e-07))-a*b)))}function A2(a){a=+a;var b=0,d=0,e=0,f=0,g=0.0,i=0.0,k=0.0,l=0.0,m=0.0;h[j>>3]=a;b=c[j>>2]|0;d=c[j+4>>2]|0;e=(d|0)<0;do if(e|d>>>0<1048576){if((b|0)==0&(d&2147483647|0)==0){a=-1.0/(a*a);break}if(e){a=(a-a)/0.0;break}else {h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;e=-1077;b=c[j>>2]|0;f=9;break}}else if(d>>>0<=2146435071)if((b|0)==0&0==0&(d|0)==1072693248)a=0.0;else {e=-1023;f=9;}while(0);if((f|0)==9){f=d+614242|0;c[j>>2]=b;c[j+4>>2]=(f&1048575)+1072079006;k=+h[j>>3]+-1.0;i=k*(k*.5);l=k/(k+2.0);m=l*l;g=m*m;h[j>>3]=k-i;d=c[j+4>>2]|0;c[j>>2]=0;c[j+4>>2]=d;a=+h[j>>3];g=k-a-i+l*(i+(g*(g*(g*.15313837699209373+.22222198432149784)+.3999999999940942)+m*(g*(g*(g*.14798198605116586+.1818357216161805)+.2857142874366239)+.6666666666666735)));m=a*.4342944818781689;i=+(e+(f>>>20)|0);l=i*.30102999566361177;k=l+m;a=k+(m+(l-k)+(g*.4342944818781689+(i*3.694239077158931e-13+(g+a)*2.5082946711645275e-11)));}return +a}function B2(a,b){a=+a;b=b|0;var d=0,e=0.0,f=0.0,g=0.0,i=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0;r=l;l=l+48|0;m=r+16|0;n=r;h[j>>3]=a;d=c[j>>2]|0;i=c[j+4>>2]|0;o=Q6(d|0,i|0,63)|0;q=i&2147483647;do if(q>>>0<1074752123)if((i&1048575|0)!=598523){d=(o|0)!=0;if(q>>>0<1073928573)if(d){g=a+1.5707963267341256;k=g+6.077100506506192e-11;h[b>>3]=k;h[b+8>>3]=g-k+6.077100506506192e-11;d=-1;break}else {g=a+-1.5707963267341256;k=g+-6.077100506506192e-11;h[b>>3]=k;h[b+8>>3]=g-k+-6.077100506506192e-11;d=1;break}else if(d){g=a+3.1415926534682512;k=g+1.2154201013012384e-10;h[b>>3]=k;h[b+8>>3]=g-k+1.2154201013012384e-10;d=-2;break}else {g=a+-3.1415926534682512;k=g+-1.2154201013012384e-10;h[b>>3]=k;h[b+8>>3]=g-k+-1.2154201013012384e-10;d=2;break}}else p=21;else {if(q>>>0<1075594812)if(q>>>0<1075183037){if((q|0)==1074977148){p=21;break}if(!o){g=a+-4.712388980202377;k=g+-1.8231301519518578e-10;h[b>>3]=k;h[b+8>>3]=g-k+-1.8231301519518578e-10;d=3;break}else {g=a+4.712388980202377;k=g+1.8231301519518578e-10;h[b>>3]=k;h[b+8>>3]=g-k+1.8231301519518578e-10;d=-3;break}}else {if((q|0)==1075388923){p=21;break}if(!o){g=a+-6.2831853069365025;k=g+-2.430840202602477e-10;h[b>>3]=k;h[b+8>>3]=g-k+-2.430840202602477e-10;d=4;break}else {g=a+6.2831853069365025;k=g+2.430840202602477e-10;h[b>>3]=k;h[b+8>>3]=g-k+2.430840202602477e-10;d=-4;break}}if(q>>>0>=1094263291){if(q>>>0>2146435071){k=a-a;h[b+8>>3]=k;h[b>>3]=k;d=0;break}c[j>>2]=d;c[j+4>>2]=i&1048575|1096810496;a=+h[j>>3];d=0;do{k=+(~~a|0);h[m+(d<<3)>>3]=k;a=(a-k)*16777216.0;d=d+1|0;}while((d|0)!=2);h[m+16>>3]=a;if(a==0.0){d=1;while(1)if(+h[m+(d<<3)>>3]==0.0)d=d+-1|0;else break}else d=2;d=C2(m,n,(q>>>20)+-1046|0,d+1|0,1)|0;a=+h[n>>3];if(!o){h[b>>3]=a;h[b+8>>3]=+h[n+8>>3];break}else {h[b>>3]=-a;h[b+8>>3]=-+h[n+8>>3];d=0-d|0;break}}else p=21;}while(0);if((p|0)==21){g=a*.6366197723675814+6755399441055744.0+-6755399441055744.0;d=~~g;e=a-g*1.5707963267341256;f=g*6.077100506506192e-11;a=e-f;h[b>>3]=a;h[j>>3]=a;p=Q6(c[j>>2]|0,c[j+4>>2]|0,52)|0;i=q>>>20;if((i-(p&2047)|0)>16){f=g*6.077100506303966e-11;k=e-f;f=g*2.0222662487959506e-21-(e-k-f);a=k-f;h[b>>3]=a;h[j>>3]=a;q=Q6(c[j>>2]|0,c[j+4>>2]|0,52)|0;s=g*2.0222662487111665e-21;e=k-s;g=g*8.4784276603689e-32-(k-e-s);if((i-(q&2047)|0)>49){a=e-g;h[b>>3]=a;f=g;}else e=k;}h[b+8>>3]=e-a-f;}l=r;return d|0}function C2(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0.0,i=0.0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0;H=l;l=l+560|0;C=H+480|0;z=H+320|0;G=H+160|0;E=H;D=c[63220+(f<<2)>>2]|0;p=e+-1|0;y=(d+-3|0)/24|0;y=(y|0)>0?y:0;B=O(y,-24)|0;j=d+-24+B|0;if((D+p|0)>=0){n=D+e|0;k=y-p|0;m=0;while(1){if((k|0)<0)g=0.0;else g=+(c[63236+(k<<2)>>2]|0);h[z+(m<<3)>>3]=g;m=m+1|0;if((m|0)==(n|0))break;else k=k+1|0;}}o=(e|0)>0;n=0;while(1){if(o){m=n+p|0;g=0.0;k=0;do{g=g+ +h[a+(k<<3)>>3]*+h[z+(m-k<<3)>>3];k=k+1|0;}while((k|0)!=(e|0))}else g=0.0;h[E+(n<<3)>>3]=g;if((n|0)<(D|0))n=n+1|0;else break}t=(j|0)>0;u=24-j|0;v=23-j|0;w=(e|0)>0;x=(j|0)==0;k=D;a:while(1){g=+h[E+(k<<3)>>3];o=(k|0)>0;if(o){m=k;n=0;while(1){i=+(~~(g*5.9604644775390625e-08)|0);c[C+(n<<2)>>2]=~~(g-i*16777216.0);s=m;m=m+-1|0;g=+h[E+(m<<3)>>3]+i;if((s|0)<=1)break;else n=n+1|0;}}g=+D2(g,j);g=g-+A(+(g*.125))*8.0;m=~~g;g=g-+(m|0);do if(!t)if(!x)if(!(g>=.5)){p=0;s=m;break}else {n=2;F=20;break}else {n=c[C+(k+-1<<2)>>2]>>23;F=19;break}else {s=C+(k+-1<<2)|0;n=c[s>>2]|0;F=n>>u;n=n-(F<>2]=n;n=n>>v;m=F+m|0;F=19;}while(0);if((F|0)==19){F=0;if((n|0)>0)F=20;else {p=n;s=m;}}if((F|0)==20){F=0;s=m+1|0;if(o){m=0;r=0;do{p=C+(r<<2)|0;q=c[p>>2]|0;if(!m)if(!q)m=0;else {m=1;o=16777216;F=23;}else {o=16777215;F=23;}if((F|0)==23){F=0;c[p>>2]=o-q;}r=r+1|0;}while((r|0)!=(k|0))}else m=0;b:do if(t){switch(j|0){case 1:{o=8388607;break}case 2:{o=4194303;break}default:break b}r=C+(k+-1<<2)|0;c[r>>2]=c[r>>2]&o;}while(0);if((n|0)==2){g=1.0-g;if(!m)p=2;else {p=2;g=g-+D2(1.0,j);}}else p=n;}if(!(g==0.0)){F=42;break}if((k|0)>(D|0)){m=0;n=k;do{n=n+-1|0;m=c[C+(n<<2)>>2]|m;}while((n|0)>(D|0));if(m){F=41;break}else m=1;}else m=1;while(1)if(!(c[C+(D-m<<2)>>2]|0))m=m+1|0;else break;o=m+k|0;if((m|0)<=0){k=o;continue}while(1){n=k+1|0;m=k+e|0;h[z+(m<<3)>>3]=+(c[63236+(n+y<<2)>>2]|0);if(w){g=0.0;k=0;do{g=g+ +h[a+(k<<3)>>3]*+h[z+(m-k<<3)>>3];k=k+1|0;}while((k|0)!=(e|0))}else g=0.0;h[E+(n<<3)>>3]=g;if((n|0)<(o|0))k=n;else {k=o;continue a}}}if((F|0)==41)while(1){F=0;j=j+-24|0;k=k+-1|0;if(!(c[C+(k<<2)>>2]|0))F=41;else {o=k;break}}else if((F|0)==42){g=+D2(g,0-j|0);if(g>=16777216.0){i=+(~~(g*5.9604644775390625e-08)|0);c[C+(k<<2)>>2]=~~(g-i*16777216.0);j=B+d|0;k=k+1|0;g=i;}c[C+(k<<2)>>2]=~~g;o=k;}n=(o|0)>-1;if(n){g=+D2(1.0,j);j=o;while(1){h[E+(j<<3)>>3]=g*+(c[C+(j<<2)>>2]|0);if((j|0)>0){g=g*5.9604644775390625e-08;j=j+-1|0;}else break}if(n){k=o;while(1){m=o-k|0;j=0;g=0.0;while(1){g=g+ +h[10904+(j<<3)>>3]*+h[E+(j+k<<3)>>3];if((j|0)>=(D|0)|(j|0)>=(m|0))break;else j=j+1|0;}h[G+(m<<3)>>3]=g;if((k|0)>0)k=k+-1|0;else break}}}switch(f|0){case 0:{if(n){g=0.0;j=o;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)>0)j=j+-1|0;else break}}else g=0.0;i=(p|0)==0?g:-g;F=73;break}case 2:case 1:{if(n){g=0.0;j=o;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)>0)j=j+-1|0;else break}}else g=0.0;k=(p|0)==0;h[b>>3]=k?g:-g;g=+h[G>>3]-g;if((o|0)>=1){j=1;while(1){g=g+ +h[G+(j<<3)>>3];if((j|0)==(o|0))break;else j=j+1|0;}}i=k?g:-g;b=b+8|0;F=73;break}case 3:{if((o|0)>0){j=o;g=+h[G+(o<<3)>>3];do{F=j;j=j+-1|0;E=G+(j<<3)|0;i=+h[E>>3];I=g;g=i+g;h[G+(F<<3)>>3]=I+(i-g);h[E>>3]=g;}while((F|0)>1);k=(o|0)>1;if(k){j=o;g=+h[G+(o<<3)>>3];do{F=j;j=j+-1|0;E=G+(j<<3)|0;I=+h[E>>3];i=g;g=I+g;h[G+(F<<3)>>3]=i+(I-g);h[E>>3]=g;}while((F|0)>2);if(k){j=o;i=0.0;while(1){i=i+ +h[G+(j<<3)>>3];if((j|0)>2)j=j+-1|0;else break}}else i=0.0;}else i=0.0;}else i=0.0;g=+h[G>>3];if(!p){h[b>>3]=g;g=+h[G+8>>3];}else {h[b>>3]=-g;i=-i;g=-+h[G+8>>3];}h[b+8>>3]=g;b=b+16|0;F=73;break}default:{}}if((F|0)==73)h[b>>3]=i;l=H;return s&7|0}function D2(a,b){a=+a;b=b|0;var d=0,e=0;if((b|0)<=1023){if((b|0)<-1022){a=a*2.2250738585072014e-308;e=(b|0)<-2044;d=b+2044|0;a=e?a*2.2250738585072014e-308:a;b=e?((d|0)>-1022?d:-1022):b+1022|0;}}else {a=a*8988465674311579538646525.0e283;d=(b|0)>2046;e=b+-2046|0;a=d?a*8988465674311579538646525.0e283:a;b=d?((e|0)<1023?e:1023):b+-1023|0;}d=R6(b+1023|0,0,52)|0;e=z;c[j>>2]=d;c[j+4>>2]=e;return +(a*+h[j>>3])}function E2(a){a=+a;var b=0,d=0,e=0,f=0.0,g=0.0;h[j>>3]=a;d=c[j+4>>2]|0;b=d&2147483647;do if(b>>>0>2146435071)a=a+a;else {if(b>>>0<1048576){h[j>>3]=a*18014398509481984.0;d=c[j+4>>2]|0;b=d&2147483647;if(!b)break;else e=696219795;}else e=715094163;c[j>>2]=0;c[j+4>>2]=((b>>>0)/3|0)+e|d&-2147483648;f=+h[j>>3];g=f*f*(f/a);h[j>>3]=(g*(g*g)*(g*.14599619288661245+-.758397934778766)+(g*(g*1.6214297201053545+-1.8849797954337717)+1.87595182427177))*f;d=J6(c[j>>2]|0,c[j+4>>2]|0,-2147483648,0)|0;e=z;c[j>>2]=d&-1073741824;c[j+4>>2]=e;f=+h[j>>3];a=a/(f*f);a=(a-f)/(f+f+a)*f+f;}while(0);return +a}function F2(a,b){a=+a;b=+b;var d=0,e=0;h[j>>3]=a;e=c[j>>2]|0;d=c[j+4>>2]|0;h[j>>3]=b;d=c[j+4>>2]&-2147483648|d&2147483647;c[j>>2]=e;c[j+4>>2]=d;return +(+h[j>>3])}function G2(a,b){a=+a;b=+b;return +(+F2(a,b))}function H2(a,b){a=+a;b=b|0;return +(+D2(a,b))}function I2(a,b){a=+a;b=+b;return +(+J2(a,b))}function J2(a,b){a=+a;b=+b;var d=0,e=0,f=0,g=0,i=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h[j>>3]=a;i=c[j>>2]|0;l=c[j+4>>2]|0;h[j>>3]=b;n=c[j>>2]|0;o=c[j+4>>2]|0;e=Q6(i|0,l|0,52)|0;e=e&2047;m=Q6(n|0,o|0,52)|0;m=m&2047;p=l&-2147483648;g=R6(n|0,o|0,1)|0;k=z;a:do if(!((g|0)==0&(k|0)==0)?(f=K2(b)|0,d=z&2147483647,!((e|0)==2047|(d>>>0>2146435072|(d|0)==2146435072&f>>>0>0))):0){d=R6(i|0,l|0,1)|0;f=z;if(!(f>>>0>k>>>0|(f|0)==(k|0)&d>>>0>g>>>0))return +((d|0)==(g|0)&(f|0)==(k|0)?a*0.0:a);if(!e){d=R6(i|0,l|0,12)|0;f=z;if((f|0)>-1|(f|0)==-1&d>>>0>4294967295){e=0;do{e=e+-1|0;d=R6(d|0,f|0,1)|0;f=z;}while((f|0)>-1|(f|0)==-1&d>>>0>4294967295)}else e=0;i=R6(i|0,l|0,1-e|0)|0;g=z;}else g=l&1048575|1048576;if(!m){f=R6(n|0,o|0,12)|0;k=z;if((k|0)>-1|(k|0)==-1&f>>>0>4294967295){d=0;do{d=d+-1|0;f=R6(f|0,k|0,1)|0;k=z;}while((k|0)>-1|(k|0)==-1&f>>>0>4294967295)}else d=0;n=R6(n|0,o|0,1-d|0)|0;m=d;l=z;}else l=o&1048575|1048576;f=K6(i|0,g|0,n|0,l|0)|0;d=z;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;b:do if((e|0)>(m|0)){while(1){if(k){if((f|0)==0&(d|0)==0)break}else {f=i;d=g;}i=R6(f|0,d|0,1)|0;g=z;e=e+-1|0;f=K6(i|0,g|0,n|0,l|0)|0;d=z;k=(d|0)>-1|(d|0)==-1&f>>>0>4294967295;if((e|0)<=(m|0))break b}b=a*0.0;break a}while(0);if(k){if((f|0)==0&(d|0)==0){b=a*0.0;break}}else {d=g;f=i;}if(d>>>0<1048576|(d|0)==1048576&f>>>0<0)do{f=R6(f|0,d|0,1)|0;d=z;e=e+-1|0;}while(d>>>0<1048576|(d|0)==1048576&f>>>0<0);if((e|0)>0){o=J6(f|0,d|0,0,-1048576)|0;d=z;e=R6(e|0,0,52)|0;d=d|z;e=o|e;}else {e=Q6(f|0,d|0,1-e|0)|0;d=z;}c[j>>2]=e;c[j+4>>2]=d|p;b=+h[j>>3];}else q=3;while(0);if((q|0)==3){b=a*b;b=b/b;}return +b}function K2(a){a=+a;var b=0;h[j>>3]=a;b=c[j>>2]|0;z=c[j+4>>2]|0;return b|0}function L2(a,b){a=+a;b=+b;var d=0.0,e=0,f=0,g=0,i=0,k=0.0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;q=l;l=l+32|0;m=q+24|0;n=q+16|0;o=q+8|0;p=q;h[j>>3]=a;t=c[j>>2]|0;g=c[j+4>>2]|0;h[j>>3]=b;e=c[j>>2]|0;g=g&2147483647;f=c[j+4>>2]&2147483647;i=g>>>0>>0|(g|0)==(f|0)&t>>>0>>0;s=i?e:t;r=i?f:g;e=i?t:e;f=i?g:f;g=Q6(s|0,r|0,52)|0;i=Q6(e|0,f|0,52)|0;c[j>>2]=s;c[j+4>>2]=r;a=+h[j>>3];c[j>>2]=e;c[j+4>>2]=f;k=+h[j>>3];do if((i|0)!=2047){if(!((e|0)==0&(f|0)==0|(g|0)==2047)){if((g-i|0)>64){a=a+k;break}if((g|0)>1533){d=5260135901548373507240989.0e186;b=a*1.90109156629516e-211;a=k*1.90109156629516e-211;}else {t=(i|0)<573;d=t?1.90109156629516e-211:1.0;b=t?a*5260135901548373507240989.0e186:a;a=t?k*5260135901548373507240989.0e186:k;}M2(m,n,b);M2(o,p,a);a=d*+C(+(+h[p>>3]+ +h[n>>3]+ +h[o>>3]+ +h[m>>3]));}}else a=k;while(0);l=q;return +a}function M2(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0.0;e=c*134217729.0;e=e+(c-e);d=c-e;c=c*c;h[a>>3]=c;h[b>>3]=d*d+(e*e-c+e*2.0*d);return}function N2(a,b,d){a=+a;b=b|0;d=d|0;var e=0.0,f=0,g=0,i=0.0,k=0,m=0;k=l;l=l+16|0;g=k;h[j>>3]=a;f=c[j+4>>2]&2147483647;do if(f>>>0<1072243196)if(f>>>0<1044816030){h[b>>3]=a;h[d>>3]=1.0;break}else {h[b>>3]=+w2(a,0.0,0);h[d>>3]=+z2(a,0.0);break}else {if(f>>>0>2146435071){i=a-a;h[d>>3]=i;h[b>>3]=i;break}f=B2(a,g)|0;m=g+8|0;e=+w2(+h[g>>3],+h[m>>3],1);a=+z2(+h[g>>3],+h[m>>3]);switch(f&3){case 0:{h[b>>3]=e;i=a;break}case 1:{h[b>>3]=a;i=-e;break}case 2:{h[b>>3]=-e;i=-a;break}case 3:{h[b>>3]=-a;i=e;break}default:{}}h[d>>3]=i;}while(0);l=k;return}function O2(a,b){a=+a;b=b|0;return +(+y2(a,b))}function P2(a){a=a|0;if(a>>>0<131072)a=(d[146423+((d[146423+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=0;return a|0}function Q2(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0;if(!e)f=0;else {f=a[b>>0]|0;a:do if(!(f<<24>>24))f=0;else while(1){e=e+-1|0;g=a[c>>0]|0;if(!(f<<24>>24==g<<24>>24&((e|0)!=0&g<<24>>24!=0)))break a;b=b+1|0;c=c+1|0;f=a[b>>0]|0;if(!(f<<24>>24)){f=0;break}}while(0);f=(f&255)-(d[c>>0]|0)|0;}return f|0}function R2(b,c){b=b|0;c=c|0;b=k2(b,c)|0;return ((a[b>>0]|0)==(c&255)<<24>>24?b:0)|0}function S2(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function T2(a,b,c){a=a|0;b=b|0;c=c|0;c=V2(a,b,c,-1,0)|0;return c|0}function U2(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=d&255;f=(e|0)!=0;a:do if(f&(b&3|0)!=0){g=d&255;while(1){if((a[b>>0]|0)==g<<24>>24){i=6;break a}b=b+1|0;e=e+-1|0;f=(e|0)!=0;if(!(f&(b&3|0)!=0)){i=5;break}}}else i=5;while(0);if((i|0)==5)if(f)i=6;else e=0;b:do if((i|0)==6){g=d&255;if((a[b>>0]|0)!=g<<24>>24){f=O(h,16843009)|0;c:do if(e>>>0>3)while(1){h=c[b>>2]^f;if((h&-2139062144^-2139062144)&h+-16843009|0)break;b=b+4|0;e=e+-4|0;if(e>>>0<=3){i=11;break c}}else i=11;while(0);if((i|0)==11)if(!e){e=0;break}while(1){if((a[b>>0]|0)==g<<24>>24)break b;b=b+1|0;e=e+-1|0;if(!e){e=0;break}}}}while(0);return (e|0?b:0)|0}function V2(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+128|0;h=j;c[h>>2]=0;i=h+4|0;c[i>>2]=a;c[h+44>>2]=a;g=h+8|0;c[g>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;W2(h,0);d=X2(h,d,1,e,f)|0;if(b|0)c[b>>2]=a+((c[i>>2]|0)+(c[h+108>>2]|0)-(c[g>>2]|0));l=j;return d|0}function W2(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;c[a+104>>2]=b;d=c[a+8>>2]|0;e=c[a+4>>2]|0;f=d-e|0;c[a+108>>2]=f;c[a+100>>2]=(b|0)!=0&(f|0)>(b|0)?e+b|0:d;return}function X2(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a:do if(e>>>0>36){c[(d2()|0)>>2]=22;h=0;g=0;}else {r=b+4|0;q=b+100|0;do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while((S2(i)|0)!=0);b:do switch(i|0){case 43:case 45:{i=((i|0)==45)<<31>>31;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;p=i;i=d[j>>0]|0;break b}else {p=i;i=Y2(b)|0;break b}}default:p=0;}while(0);j=(e|0)==0;do if((e|16|0)==16&(i|0)==48){i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((i|32|0)!=120)if(j){e=8;n=46;break}else {n=32;break}i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((d[149592+i>>0]|0)>15){g=(c[q>>2]|0)==0;if(!g)c[r>>2]=(c[r>>2]|0)+-1;if(!f){W2(b,0);h=0;g=0;break a}if(g){h=0;g=0;break a}c[r>>2]=(c[r>>2]|0)+-1;h=0;g=0;break a}else {e=16;n=46;}}else {e=j?10:e;if(e>>>0>(d[149592+i>>0]|0)>>>0)n=32;else {if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;W2(b,0);c[(d2()|0)>>2]=22;h=0;g=0;break a}}while(0);c:do if((n|0)==32)if((e|0)==10){e=i+-48|0;if(e>>>0<10){i=0;j=e;do{i=(i*10|0)+j|0;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;j=e+-48|0;}while(j>>>0<10&i>>>0<429496729);f=0;}else {e=i;i=0;f=0;}k=e+-48|0;if(k>>>0<10){j=e;do{e=I6(i|0,f|0,10,0)|0;l=z;m=((k|0)<0)<<31>>31;o=~m;if(l>>>0>o>>>0|(l|0)==(o|0)&e>>>0>~k>>>0){e=10;n=72;break c}i=J6(e|0,l|0,k|0,m|0)|0;f=z;e=c[r>>2]|0;if(e>>>0<(c[q>>2]|0)>>>0){c[r>>2]=e+1;j=d[e>>0]|0;}else j=Y2(b)|0;k=j+-48|0;}while(k>>>0<10&(f>>>0<429496729|(f|0)==429496729&i>>>0<2576980378));if(k>>>0>9){j=p;e=f;}else {e=10;n=72;}}else {j=p;e=f;}}else n=46;while(0);d:do if((n|0)==46){if(!(e+-1&e)){n=a[149848+((e*23|0)>>>5&7)>>0]|0;f=a[149592+i>>0]|0;j=f&255;if(e>>>0>j>>>0){i=0;k=j;do{i=k|i<>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;k=f&255;}while(i>>>0<134217728&e>>>0>k>>>0);k=0;}else {j=i;k=0;i=0;}l=Q6(-1,-1,n|0)|0;m=z;if(e>>>0<=(f&255)>>>0|(m>>>0>>0|(m|0)==(k|0)&l>>>0>>0)){f=k;n=72;break}else j=k;while(1){i=R6(i|0,j|0,n|0)|0;k=z;i=i|f&255;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;if(e>>>0<=(f&255)>>>0|(k>>>0>m>>>0|(k|0)==(m|0)&i>>>0>l>>>0)){f=k;n=72;break d}else j=k;}}f=a[149592+i>>0]|0;j=f&255;if(e>>>0>j>>>0){i=0;k=j;do{i=k+(O(i,e)|0)|0;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;k=f&255;}while(i>>>0<119304647&e>>>0>k>>>0);k=0;}else {j=i;i=0;k=0;}if(e>>>0>(f&255)>>>0){n=N6(-1,-1,e|0,0)|0;o=z;m=k;while(1){if(m>>>0>o>>>0|(m|0)==(o|0)&i>>>0>n>>>0){f=m;n=72;break d}k=I6(i|0,m|0,e|0,0)|0;l=z;f=f&255;if(l>>>0>4294967295|(l|0)==-1&k>>>0>~f>>>0){f=m;n=72;break d}i=J6(k|0,l|0,f|0,0)|0;k=z;j=c[r>>2]|0;if(j>>>0<(c[q>>2]|0)>>>0){c[r>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;f=a[149592+j>>0]|0;if(e>>>0<=(f&255)>>>0){f=k;n=72;break}else m=k;}}else {f=k;n=72;}}while(0);if((n|0)==72)if(e>>>0>(d[149592+j>>0]|0)>>>0){do{i=c[r>>2]|0;if(i>>>0<(c[q>>2]|0)>>>0){c[r>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while(e>>>0>(d[149592+i>>0]|0)>>>0);c[(d2()|0)>>2]=34;j=(g&1|0)==0&0==0?p:0;e=h;i=g;}else {j=p;e=f;}if(c[q>>2]|0)c[r>>2]=(c[r>>2]|0)+-1;if(!(e>>>0>>0|(e|0)==(h|0)&i>>>0>>0)){if(!((g&1|0)!=0|0!=0|(j|0)!=0)){c[(d2()|0)>>2]=34;g=J6(g|0,h|0,-1,-1)|0;h=z;break}if(e>>>0>h>>>0|(e|0)==(h|0)&i>>>0>g>>>0){c[(d2()|0)>>2]=34;break}}g=((j|0)<0)<<31>>31;g=K6(i^j|0,e^g|0,j|0,g|0)|0;h=z;}while(0);z=h;return g|0}function Y2(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=b+104|0;h=c[f>>2]|0;if((h|0)!=0?(c[b+108>>2]|0)>=(h|0):0)i=4;else {e=Z2(b)|0;if((e|0)>=0){g=c[f>>2]|0;f=b+8|0;if(g){j=c[f>>2]|0;h=c[b+4>>2]|0;f=g-(c[b+108>>2]|0)|0;g=j;if((j-h|0)<(f|0))f=g;else f=h+(f+-1)|0;}else {g=c[f>>2]|0;f=g;}c[b+100>>2]=f;f=b+4|0;if(!g)f=c[f>>2]|0;else {f=c[f>>2]|0;j=b+108|0;c[j>>2]=g+1-f+(c[j>>2]|0);}f=f+-1|0;if((e|0)!=(d[f>>0]|0|0))a[f>>0]=e;}else i=4;}if((i|0)==4){c[b+100>>2]=0;e=-1;}return e|0}function Z2(a){a=a|0;var b=0,e=0;e=l;l=l+16|0;b=e;if((_2(a)|0)==0?(nb[c[a+32>>2]&63](a,b,1)|0)==1:0)a=d[b>>0]|0;else a=-1;l=e;return a|0}function _2(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=b+20|0;e=b+28|0;if((c[d>>2]|0)>>>0>(c[e>>2]|0)>>>0)nb[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[e>>2]=0;c[d>>2]=0;d=c[b>>2]|0;if(!(d&4)){e=(c[b+44>>2]|0)+(c[b+48>>2]|0)|0;c[b+8>>2]=e;c[b+4>>2]=e;d=d<<27>>31;}else {c[b>>2]=d|32;d=-1;}return d|0}function $2(a){a=a|0;return (a+-48|0)>>>0<10|0}function a3(a){a=a|0;return ((a+-48|0)>>>0<10|(b3(a)|0)!=0)&1|0}function b3(a){a=a|0;return ((a|32)+-97|0)>>>0<26|0}function c3(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;e=a[b>>0]|0;a:do if(!(e<<24>>24))e=0;else {g=e&255;while(1){f=a[c>>0]|0;if(!(f<<24>>24))break a;if(e<<24>>24!=f<<24>>24?(g=d3(g)|0,(g|0)!=(d3(f&255)|0)):0)break a;b=b+1|0;c=c+1|0;e=a[b>>0]|0;if(!(e<<24>>24)){e=0;break}else g=e&255;}}while(0);g=d3(e&255)|0;return g-(d3(d[c>>0]|0)|0)|0}function d3(a){a=a|0;var b=0;b=(e3(a)|0)==0;return (b?a:a|32)|0}function e3(a){a=a|0;return (a+-65|0)>>>0<26|0}function f3(a){a=a|0;return g3(a,0)|0}function g3(c,f){c=c|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=(f<<1)+-1|0;l=f+-1|0;a:do if(!((c+-43008|0)>>>0<22272|((c+-11776|0)>>>0<30784|((c+-1536|0)>>>0<2560|(h3(c)|0)==0)))){g=(f|0)!=0;if(g&(c+-4256|0)>>>0<46){if((c|0)>4293)switch(c|0){case 4295:case 4301:break;default:break a}c=c+7264|0;break}if((c+-11520|0)>>>0<38&(g^1)){c=c+-7264|0;break}else g=0;do{i=a[66346+(g<<2)+2>>0]|0;j=i<<24>>24;h=c-(e[66346+(g<<2)>>1]|0)|0;if((h-(l&j)|0)>>>0<(d[66346+(g<<2)+3>>0]|0)>>>0){m=11;break}g=g+1|0;}while((g|0)!=61);if((m|0)==11)if(i<<24>>24==1){c=f+c-(h&1)|0;break}else {c=(O(k,j)|0)+c|0;break}i=1-f|0;g=b[65858+(i<<1)>>1]|0;b:do if(g<<16>>16){h=0;while(1){if((g&65535|0)==(c|0))break;h=h+1|0;g=b[65858+(h<<2)+(i<<1)>>1]|0;if(!(g<<16>>16))break b}c=e[65858+(h<<2)+(f<<1)>>1]|0;break a}while(0);return ((c+-66600+(f*40|0)|0)>>>0<40?c+-40+(f*80|0)|0:c)|0}while(0);return c|0}function h3(a){a=a|0;if(a>>>0<131072)a=(d[149857+((d[149857+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else a=a>>>0<196606&1;return a|0}function i3(a){a=a|0;var b=0;b=a;while(1)if(!(c[b>>2]|0))break;else b=b+4|0;return b-a>>2|0}function j3(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;if(!e)b=0;else {f=a[b>>0]|0;a:do if(!(f<<24>>24))b=0;else {h=b;b=f;f=f&255;while(1){e=e+-1|0;g=a[c>>0]|0;if(!((e|0)!=0&g<<24>>24!=0))break a;if(b<<24>>24!=g<<24>>24?(f=d3(f)|0,(f|0)!=(d3(g&255)|0)):0)break a;h=h+1|0;c=c+1|0;f=a[h>>0]|0;if(!(f<<24>>24)){b=0;break}else {b=f;f=f&255;}}}while(0);b=d3(b&255)|0;b=b-(d3(d[c>>0]|0)|0)|0;}return b|0}function k3(a){a=a|0;if(a>>>0>=255)if((a+-57344|0)>>>0<8185|(a>>>0<8232|(a+-8234|0)>>>0<47062))a=1;else return (a&65534|0)!=65534&(a+-65532|0)>>>0<1048580&1|0;else a=(a+1&127)>>>0>32&1;return a|0}function l3(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0;k=l;l=l+16|0;g=k;i=(f|0)==0?190640:f;f=c[i>>2]|0;a:do if(!d)if(!f)f=0;else j=17;else {h=(b|0)==0?g:b;if(!e)f=-2;else {if(!f){f=a[d>>0]|0;if(f<<24>>24>-1){c[h>>2]=f&255;f=f<<24>>24!=0&1;break}g=(c[c[(p3()|0)+188>>2]>>2]|0)==0;f=a[d>>0]|0;if(g){c[h>>2]=f<<24>>24&57343;f=1;break}f=(f&255)+-194|0;if(f>>>0>50){j=17;break}f=c[62384+(f<<2)>>2]|0;g=e+-1|0;if(g){d=d+1|0;j=11;}}else {g=e;j=11;}b:do if((j|0)==11){b=a[d>>0]|0;m=(b&255)>>>3;if((m+-16|m+(f>>26))>>>0>7){j=17;break a}while(1){d=d+1|0;f=(b&255)+-128|f<<6;g=g+-1|0;if((f|0)>=0)break;if(!g)break b;b=a[d>>0]|0;if((b&-64)<<24>>24!=-128){j=17;break a}}c[i>>2]=0;c[h>>2]=f;f=e-g|0;break a}while(0);c[i>>2]=f;f=-2;}}while(0);if((j|0)==17){c[i>>2]=0;c[(d2()|0)>>2]=84;f=-1;}l=k;return f|0}function m3(a,b){a=a|0;b=b|0;if(!a)a=0;else a=n3(a,b,0)|0;return a|0}function n3(b,d,e){b=b|0;d=d|0;e=e|0;do if(b){if(d>>>0<128){a[b>>0]=d;b=1;break}if(!(c[c[(o3()|0)+188>>2]>>2]|0))if((d&-128|0)==57216){a[b>>0]=d;b=1;break}else {c[(d2()|0)>>2]=84;b=-1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;b=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;b=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=d>>>18|240;a[b+1>>0]=d>>>12&63|128;a[b+2>>0]=d>>>6&63|128;a[b+3>>0]=d&63|128;b=4;break}else {c[(d2()|0)>>2]=84;b=-1;break}}else b=1;while(0);return b|0}function o3(){return v2()|0}function p3(){return v2()|0}function q3(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0;p=l;l=l+272|0;n=p+8|0;o=p;do if(!(a[d>>0]|0)){d=Ta(152833)|0;if(d|0?a[d>>0]|0:0)break;d=Ta(152840+(b*12|0)|0)|0;if(d|0?a[d>>0]|0:0)break;d=Ta(152912)|0;if(d|0?a[d>>0]|0:0)break;d=152917;}while(0);e=0;a:do{switch(a[d+e>>0]|0){case 47:case 0:break a;default:{}}e=e+1|0;}while(e>>>0<15);f=a[d>>0]|0;if(f<<24>>24!=46?(a[d+e>>0]|0)==0:0)if(f<<24>>24==67)m=15;else {k=d;m=16;}else {d=152917;m=15;}if((m|0)==15)if(!(a[d+1>>0]|0))m=18;else {k=d;m=16;}b:do if((m|0)==16)if((s2(k,152917)|0)!=0?(s2(k,152925)|0)!=0:0){d=c[47661]|0;if(d|0)do{if(!(s2(k,d+8|0)|0))break b;d=c[d+24>>2]|0;}while((d|0)!=0);ta(190648);d=c[47661]|0;c:do if(d|0){while(1){if(!(s2(k,d+8|0)|0))break;d=c[d+24>>2]|0;if(!d)break c}La(190648);break b}while(0);d:do if(((c[47646]|0)==0?(g=Ta(152931)|0,(g|0)!=0):0)?(a[g>>0]|0)!=0:0){i=254-e|0;j=e+1|0;f=g;while(1){h=k2(f,58)|0;d=a[h>>0]|0;g=h-f+((d<<24>>24!=0)<<31>>31)|0;if(g>>>0>>0){W6(n|0,f|0,g|0)|0;f=n+g|0;a[f>>0]=47;W6(f+1|0,k|0,e|0)|0;a[n+(j+g)>>0]=0;f=ua(n|0,o|0)|0;if(f|0)break;d=a[h>>0]|0;}f=h+(d<<24>>24!=0&1)|0;if(!(a[f>>0]|0)){m=41;break d}}d=T1(28)|0;if(!d){h2(f,c[o>>2]|0)|0;m=41;break}else {c[d>>2]=f;c[d+4>>2]=c[o>>2];o=d+8|0;W6(o|0,k|0,e|0)|0;a[o+e>>0]=0;c[d+24>>2]=c[47661];c[47661]=d;break}}else m=41;while(0);if((m|0)==41){d=T1(28)|0;if(d){c[d>>2]=c[15584];c[d+4>>2]=c[15585];o=d+8|0;W6(o|0,k|0,e|0)|0;a[o+e>>0]=0;c[d+24>>2]=c[47661];c[47661]=d;}}La(190648);d=(b|0)==0&(d|0)==0?62336:d;}else {d=k;m=18;}while(0);do if((m|0)==18){if((b|0)==0?(a[d+1>>0]|0)==46:0){d=62336;break}d=0;}while(0);l=p;return d|0}function r3(a,b){a=a|0;b=b|0;s3(a,b)|0;return a|0}function s3(b,d){b=b|0;d=d|0;var e=0,f=0;e=d;a:do if(!((e^b)&3)){if(e&3)do{e=a[d>>0]|0;a[b>>0]=e;if(!(e<<24>>24))break a;d=d+1|0;b=b+1|0;}while((d&3|0)!=0);e=c[d>>2]|0;if(!((e&-2139062144^-2139062144)&e+-16843009)){f=b;while(1){d=d+4|0;b=f+4|0;c[f>>2]=e;e=c[d>>2]|0;if((e&-2139062144^-2139062144)&e+-16843009|0)break;else f=b;}}f=8;}else f=8;while(0);if((f|0)==8){f=a[d>>0]|0;a[b>>0]=f;if(f<<24>>24)do{d=d+1|0;b=b+1|0;f=a[d>>0]|0;a[b>>0]=f;}while(f<<24>>24!=0)}return b|0}function t3(a){a=a|0;return ((a|0)==32|(a|0)==9)&1|0}function u3(a){a=a|0;if(!a)a=0;else a=(v3(63500,a)|0)!=0&1;return a|0}function v3(a,b){a=a|0;b=b|0;var d=0;if(!b)a=a+((i3(a)|0)<<2)|0;else {while(1){d=c[a>>2]|0;if((d|0)==0|(d|0)==(b|0))break;else a=a+4|0;}a=d|0?a:0;}return a|0}function w3(a,b){a=a|0;b=b|0;do switch(b|0){case 1:{a=x3(a)|0;break}case 2:{a=h3(a)|0;break}case 3:{a=y3(a)|0;break}case 4:{a=z3(a)|0;break}case 5:{a=$2(a)|0;break}case 6:{a=A3(a)|0;break}case 7:{a=B3(a)|0;break}case 8:{a=k3(a)|0;break}case 9:{a=P2(a)|0;break}case 10:{a=u3(a)|0;break}case 11:{a=C3(a)|0;break}case 12:{a=D3(a)|0;break}default:a=0;}while(0);return a|0}function x3(a){a=a|0;if(!($2(a)|0))a=(h3(a)|0)!=0&1;else a=1;return a|0}function y3(a){a=a|0;return t3(a)|0}function z3(a){a=a|0;return ((a+-65529|0)>>>0<3|((a&-2|0)==8232|(a>>>0<32|(a+-127|0)>>>0<33)))&1|0}function A3(a){a=a|0;if(!(u3(a)|0))a=(k3(a)|0)!=0&1;else a=0;return a|0}function B3(a){a=a|0;return (f3(a)|0)!=(a|0)|0}function C3(a){a=a|0;return (E3(a)|0)!=(a|0)|0}function D3(a){a=a|0;return ((a+-48|0)>>>0<10|((a|32)+-97|0)>>>0<6)&1|0}function E3(a){a=a|0;return g3(a,1)|0}function F3(a){a=a|0;return (a+-97|0)>>>0<26|0}function G3(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+128|0;g=n+124|0;m=n;h=m;i=63588;j=h+124|0;do{c[h>>2]=c[i>>2];h=h+4|0;i=i+4|0;}while((h|0)<(j|0));if((d+-1|0)>>>0>2147483646)if(!d){b=g;d=1;k=4;}else {c[(d2()|0)>>2]=75;d=-1;}else k=4;if((k|0)==4){k=-2-b|0;k=d>>>0>k>>>0?k:d;c[m+48>>2]=k;g=m+20|0;c[g>>2]=b;c[m+44>>2]=b;d=b+k|0;b=m+16|0;c[b>>2]=d;c[m+28>>2]=d;d=H3(m,e,f)|0;if(k){m=c[g>>2]|0;a[m+(((m|0)==(c[b>>2]|0))<<31>>31)>>0]=0;}}l=n;return d|0}function H3(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+224|0;n=s+120|0;p=s+80|0;q=s;r=s+136|0;f=p;g=f+40|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));c[n>>2]=c[e>>2];if((I3(0,d,n,q,p)|0)<0)e=-1;else {if((c[b+76>>2]|0)>-1)o=J3(b)|0;else o=0;e=c[b>>2]|0;m=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;f=b+48|0;if(!(c[f>>2]|0)){g=b+44|0;h=c[g>>2]|0;c[g>>2]=r;i=b+28|0;c[i>>2]=r;j=b+20|0;c[j>>2]=r;c[f>>2]=80;k=b+16|0;c[k>>2]=r+80;e=I3(b,d,n,q,p)|0;if(h){nb[c[b+36>>2]&63](b,0,0)|0;e=(c[j>>2]|0)==0?-1:e;c[g>>2]=h;c[f>>2]=0;c[k>>2]=0;c[i>>2]=0;c[j>>2]=0;}}else e=I3(b,d,n,q,p)|0;f=c[b>>2]|0;c[b>>2]=f|m;if(o|0)K3(b);e=(f&32|0)==0?e:-1;}l=s;return e|0}function I3(d,e,f,g,i){d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+64|0;D=H+16|0;E=H;B=H+24|0;F=H+8|0;G=H+20|0;c[D>>2]=e;x=(d|0)!=0;y=B+40|0;A=y;B=B+39|0;C=F+4|0;k=0;j=0;p=0;a:while(1){do if((j|0)>-1)if((k|0)>(2147483647-j|0)){c[(d2()|0)>>2]=75;j=-1;break}else {j=k+j|0;break}while(0);k=a[e>>0]|0;if(!(k<<24>>24)){w=86;break}else m=e;b:while(1){switch(k<<24>>24){case 37:{k=m;w=9;break b}case 0:{k=m;break b}default:{}}v=m+1|0;c[D>>2]=v;k=a[v>>0]|0;m=v;}c:do if((w|0)==9)while(1){w=0;if((a[m+1>>0]|0)!=37)break c;k=k+1|0;m=m+2|0;c[D>>2]=m;if((a[m>>0]|0)==37)w=9;else break}while(0);k=k-e|0;if(x)L3(d,e,k);if(k|0){e=m;continue}n=m+1|0;k=(a[n>>0]|0)+-48|0;if(k>>>0<10){v=(a[m+2>>0]|0)==36;t=v?k:-1;p=v?1:p;n=v?m+3|0:n;}else t=-1;c[D>>2]=n;k=a[n>>0]|0;v=(k<<24>>24)+-32|0;if(v>>>0>31|(1<>24)+-32|m;n=n+1|0;c[D>>2]=n;k=a[n>>0]|0;v=(k<<24>>24)+-32|0;}while(!(v>>>0>31|(1<>24==42){o=n+1|0;k=(a[o>>0]|0)+-48|0;if(k>>>0<10?(a[n+2>>0]|0)==36:0){c[i+(k<<2)>>2]=10;k=c[g+((a[o>>0]|0)+-48<<3)>>2]|0;p=1;n=n+3|0;}else {if(p|0){j=-1;break}if(x){p=(c[f>>2]|0)+(4-1)&~(4-1);k=c[p>>2]|0;c[f>>2]=p+4;p=0;n=o;}else {k=0;p=0;n=o;}}c[D>>2]=n;u=(k|0)<0;k=u?0-k|0:k;u=u?m|8192:m;}else {k=M3(D)|0;if((k|0)<0){j=-1;break}u=m;n=c[D>>2]|0;}do if((a[n>>0]|0)==46){if((a[n+1>>0]|0)!=42){c[D>>2]=n+1;m=M3(D)|0;n=c[D>>2]|0;break}o=n+2|0;m=(a[o>>0]|0)+-48|0;if(m>>>0<10?(a[n+3>>0]|0)==36:0){c[i+(m<<2)>>2]=10;m=c[g+((a[o>>0]|0)+-48<<3)>>2]|0;n=n+4|0;c[D>>2]=n;break}if(p|0){j=-1;break a}if(x){v=(c[f>>2]|0)+(4-1)&~(4-1);m=c[v>>2]|0;c[f>>2]=v+4;}else m=0;c[D>>2]=o;n=o;}else m=-1;while(0);s=0;while(1){if(((a[n>>0]|0)+-65|0)>>>0>57){j=-1;break a}v=n+1|0;c[D>>2]=v;o=a[(a[n>>0]|0)+-65+(152944+(s*58|0))>>0]|0;q=o&255;if((q+-1|0)>>>0<8){s=q;n=v;}else break}if(!(o<<24>>24)){j=-1;break}r=(t|0)>-1;do if(o<<24>>24==19)if(r){j=-1;break a}else w=48;else {if(r){c[i+(t<<2)>>2]=q;r=g+(t<<3)|0;t=c[r+4>>2]|0;w=E;c[w>>2]=c[r>>2];c[w+4>>2]=t;w=48;break}if(!x){j=0;break a}N3(E,q,f);}while(0);if((w|0)==48?(w=0,!x):0){k=0;e=v;continue}n=a[n>>0]|0;n=(s|0)!=0&(n&15|0)==3?n&-33:n;t=u&-65537;u=(u&8192|0)==0?u:t;d:do switch(n|0){case 110:switch((s&255)<<24>>24){case 0:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 1:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 2:{k=c[E>>2]|0;c[k>>2]=j;c[k+4>>2]=((j|0)<0)<<31>>31;k=0;e=v;continue a}case 3:{b[c[E>>2]>>1]=j;k=0;e=v;continue a}case 4:{a[c[E>>2]>>0]=j;k=0;e=v;continue a}case 6:{c[c[E>>2]>>2]=j;k=0;e=v;continue a}case 7:{k=c[E>>2]|0;c[k>>2]=j;c[k+4>>2]=((j|0)<0)<<31>>31;k=0;e=v;continue a}default:{k=0;e=v;continue a}}case 112:{n=120;m=m>>>0>8?m:8;e=u|8;w=60;break}case 88:case 120:{e=u;w=60;break}case 111:{n=E;e=c[n>>2]|0;n=c[n+4>>2]|0;r=P3(e,n,y)|0;s=A-r|0;o=0;q=153408;m=(u&8|0)==0|(m|0)>(s|0)?m:s+1|0;s=u;w=66;break}case 105:case 100:{n=E;e=c[n>>2]|0;n=c[n+4>>2]|0;if((n|0)<0){e=K6(0,0,e|0,n|0)|0;n=z;o=E;c[o>>2]=e;c[o+4>>2]=n;o=1;q=153408;w=65;break d}else {o=(u&2049|0)!=0&1;q=(u&2048|0)==0?((u&1|0)==0?153408:153410):153409;w=65;break d}}case 117:{n=E;o=0;q=153408;e=c[n>>2]|0;n=c[n+4>>2]|0;w=65;break}case 99:{a[B>>0]=c[E>>2];e=B;o=0;q=153408;r=y;n=1;m=t;break}case 109:{n=t2(c[(d2()|0)>>2]|0)|0;w=70;break}case 115:{n=c[E>>2]|0;n=n|0?n:153418;w=70;break}case 67:{c[F>>2]=c[E>>2];c[C>>2]=0;c[E>>2]=F;r=-1;n=F;w=74;break}case 83:{e=c[E>>2]|0;if(!m){R3(d,32,k,0,u);e=0;w=83;}else {r=m;n=e;w=74;}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{k=S3(d,+h[E>>3],k,m,u,n)|0;e=v;continue a}default:{o=0;q=153408;r=y;n=m;m=u;}}while(0);e:do if((w|0)==60){u=E;t=c[u>>2]|0;u=c[u+4>>2]|0;r=O3(t,u,y,n&32)|0;q=(e&8|0)==0|(t|0)==0&(u|0)==0;o=q?0:2;q=q?153408:153408+(n>>4)|0;s=e;e=t;n=u;w=66;}else if((w|0)==65){r=Q3(e,n,y)|0;s=u;w=66;}else if((w|0)==70){w=0;u=U2(n,0,m)|0;s=(u|0)==0;e=n;o=0;q=153408;r=s?n+m|0:u;n=s?m:u-n|0;m=t;}else if((w|0)==74){w=0;q=n;e=0;m=0;while(1){o=c[q>>2]|0;if(!o)break;m=m3(G,o)|0;if((m|0)<0|m>>>0>(r-e|0)>>>0)break;e=m+e|0;if(r>>>0>e>>>0)q=q+4|0;else break}if((m|0)<0){j=-1;break a}R3(d,32,k,e,u);if(!e){e=0;w=83;}else {o=0;while(1){m=c[n>>2]|0;if(!m){w=83;break e}m=m3(G,m)|0;o=m+o|0;if((o|0)>(e|0)){w=83;break e}L3(d,G,m);if(o>>>0>=e>>>0){w=83;break}else n=n+4|0;}}}while(0);if((w|0)==66){w=0;n=(e|0)!=0|(n|0)!=0;u=(m|0)!=0|n;n=A-r+((n^1)&1)|0;e=u?r:y;r=y;n=u?((m|0)>(n|0)?m:n):m;m=(m|0)>-1?s&-65537:s;}else if((w|0)==83){w=0;R3(d,32,k,e,u^8192);k=(k|0)>(e|0)?k:e;e=v;continue}t=r-e|0;s=(n|0)<(t|0)?t:n;u=s+o|0;k=(k|0)<(u|0)?u:k;R3(d,32,k,u,m);L3(d,q,o);R3(d,48,k,u,m^65536);R3(d,48,s,t,0);L3(d,e,t);R3(d,32,k,u,m^8192);e=v;}f:do if((w|0)==86)if(!d)if(p){j=1;while(1){e=c[i+(j<<2)>>2]|0;if(!e)break;N3(g+(j<<3)|0,e,f);e=j+1|0;if((j|0)<9)j=e;else {j=e;break}}if((j|0)<10)while(1){if(c[i+(j<<2)>>2]|0){j=-1;break f}if((j|0)<9)j=j+1|0;else {j=1;break}}else j=1;}else j=0;while(0);l=H;return j|0}function J3(a){a=a|0;return 0}function K3(a){a=a|0;return}function L3(a,b,d){a=a|0;b=b|0;d=d|0;if(!(c[a>>2]&32))U3(b,d,a)|0;return}function M3(b){b=b|0;var d=0,e=0,f=0;e=c[b>>2]|0;f=(a[e>>0]|0)+-48|0;if(f>>>0<10){d=0;do{d=f+(d*10|0)|0;e=e+1|0;c[b>>2]=e;f=(a[e>>0]|0)+-48|0;}while(f>>>0<10)}else d=0;return d|0}function N3(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=b;break a}case 10:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=((b|0)<0)<<31>>31;break a}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=b;c[e+4>>2]=0;break a}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);b=e;f=c[b>>2]|0;b=c[b+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=f;c[e+4>>2]=b;break a}case 13:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&65535)<<16>>16;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 14:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&65535;c[f+4>>2]=0;break a}case 15:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;e=(e&255)<<24>>24;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a}case 16:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e&255;c[f+4>>2]=0;break a}case 17:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}case 18:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}default:break a}while(0);while(0);return}function O3(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;if(!((b|0)==0&(c|0)==0))do{e=e+-1|0;a[e>>0]=d[153456+(b&15)>>0]|0|f;b=Q6(b|0,c|0,4)|0;c=z;}while(!((b|0)==0&(c|0)==0));return e|0}function P3(b,c,d){b=b|0;c=c|0;d=d|0;if(!((b|0)==0&(c|0)==0))do{d=d+-1|0;a[d>>0]=b&7|48;b=Q6(b|0,c|0,3)|0;c=z;}while(!((b|0)==0&(c|0)==0));return d|0}function Q3(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){while(1){e=O6(b|0,c|0,10,0)|0;d=d+-1|0;a[d>>0]=e&255|48;e=b;b=N6(b|0,c|0,10,0)|0;if(!(c>>>0>9|(c|0)==9&e>>>0>4294967295))break;else c=z;}c=b;}else c=b;if(c)while(1){d=d+-1|0;a[d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0;}return d|0}function R3(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+256|0;f=g;if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;Y6(f|0,b|0,(e>>>0<256?e:256)|0)|0;if(e>>>0>255){b=c-d|0;do{L3(a,f,256);e=e+-256|0;}while(e>>>0>255);e=b&255;}L3(a,f,e);}l=g;return}function S3(b,e,f,g,h,i){b=b|0;e=+e;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;H=l;l=l+560|0;m=H+8|0;u=H;G=H+524|0;F=G;n=H+512|0;c[u>>2]=0;E=n+12|0;T3(e)|0;if((z|0)<0){e=-e;C=1;B=153425;}else {C=(h&2049|0)!=0&1;B=(h&2048|0)==0?((h&1|0)==0?153426:153431):153428;}T3(e)|0;do if(0==0&(z&2146435072|0)==2146435072){G=(i&32|0)!=0;j=C+3|0;R3(b,32,f,j,h&-65537);L3(b,B,C);L3(b,e!=e|0.0!=0.0?(G?153593:153452):G?153444:153448,3);R3(b,32,f,j,h^8192);}else {r=+O2(e,u)*2.0;j=r!=0.0;if(j)c[u>>2]=(c[u>>2]|0)+-1;w=i|32;if((w|0)==97){p=i&32;s=(p|0)==0?B:B+9|0;q=C|2;j=12-g|0;do if(!(g>>>0>11|(j|0)==0)){e=8.0;do{j=j+-1|0;e=e*16.0;}while((j|0)!=0);if((a[s>>0]|0)==45){e=-(e+(-r-e));break}else {e=r+e-e;break}}else e=r;while(0);k=c[u>>2]|0;j=(k|0)<0?0-k|0:k;j=Q3(j,((j|0)<0)<<31>>31,E)|0;if((j|0)==(E|0)){j=n+11|0;a[j>>0]=48;}a[j+-1>>0]=(k>>31&2)+43;o=j+-2|0;a[o>>0]=i+15;m=(g|0)<1;n=(h&8|0)==0;j=G;do{D=~~e;k=j+1|0;a[j>>0]=p|d[153456+D>>0];e=(e-+(D|0))*16.0;if((k-F|0)==1?!(n&(m&e==0.0)):0){a[k>>0]=46;j=j+2|0;}else j=k;}while(e!=0.0);if((g|0)!=0?(-2-F+j|0)<(g|0):0){k=j-F|0;j=g+2|0;}else {j=j-F|0;k=j;}E=E-o|0;F=E+q+j|0;R3(b,32,f,F,h);L3(b,s,q);R3(b,48,f,F,h^65536);L3(b,G,k);R3(b,48,j-k|0,0,0);L3(b,o,E);R3(b,32,f,F,h^8192);j=F;break}k=(g|0)<0?6:g;if(j){j=(c[u>>2]|0)+-28|0;c[u>>2]=j;e=r*268435456.0;}else {e=r;j=c[u>>2]|0;}D=(j|0)<0?m:m+288|0;m=D;do{y=~~e>>>0;c[m>>2]=y;m=m+4|0;e=(e-+(y>>>0))*1.0e9;}while(e!=0.0);if((j|0)>0){n=D;p=m;while(1){o=(j|0)<29?j:29;j=p+-4|0;if(j>>>0>=n>>>0){m=0;do{x=R6(c[j>>2]|0,0,o|0)|0;x=J6(x|0,z|0,m|0,0)|0;y=z;v=O6(x|0,y|0,1e9,0)|0;c[j>>2]=v;m=N6(x|0,y|0,1e9,0)|0;j=j+-4|0;}while(j>>>0>=n>>>0);if(m){n=n+-4|0;c[n>>2]=m;}}m=p;while(1){if(m>>>0<=n>>>0)break;j=m+-4|0;if(!(c[j>>2]|0))m=j;else break}j=(c[u>>2]|0)-o|0;c[u>>2]=j;if((j|0)>0)p=m;else break}}else n=D;if((j|0)<0){g=((k+25|0)/9|0)+1|0;t=(w|0)==102;do{s=0-j|0;s=(s|0)<9?s:9;if(n>>>0>>0){o=(1<>>s;q=0;j=n;do{y=c[j>>2]|0;c[j>>2]=(y>>>s)+q;q=O(y&o,p)|0;j=j+4|0;}while(j>>>0>>0);j=(c[n>>2]|0)==0?n+4|0:n;if(!q){n=j;j=m;}else {c[m>>2]=q;n=j;j=m+4|0;}}else {n=(c[n>>2]|0)==0?n+4|0:n;j=m;}m=t?D:n;m=(j-m>>2|0)>(g|0)?m+(g<<2)|0:j;j=(c[u>>2]|0)+s|0;c[u>>2]=j;}while((j|0)<0);j=n;g=m;}else {j=n;g=m;}y=D;if(j>>>0>>0){m=(y-j>>2)*9|0;o=c[j>>2]|0;if(o>>>0>=10){n=10;do{n=n*10|0;m=m+1|0;}while(o>>>0>=n>>>0)}}else m=0;t=(w|0)==103;v=(k|0)!=0;n=k-((w|0)!=102?m:0)+((v&t)<<31>>31)|0;if((n|0)<(((g-y>>2)*9|0)+-9|0)){n=n+9216|0;s=D+4+(((n|0)/9|0)+-1024<<2)|0;n=(n|0)%9|0;if((n|0)<8){o=10;while(1){o=o*10|0;if((n|0)<7)n=n+1|0;else break}}else o=10;p=c[s>>2]|0;q=(p>>>0)%(o>>>0)|0;n=(s+4|0)==(g|0);if(!(n&(q|0)==0)){r=(((p>>>0)/(o>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;x=(o|0)/2|0;e=q>>>0>>0?.5:n&(q|0)==(x|0)?1.0:1.5;if(C){x=(a[B>>0]|0)==45;e=x?-e:e;r=x?-r:r;}n=p-q|0;c[s>>2]=n;if(r+e!=r){x=n+o|0;c[s>>2]=x;if(x>>>0>999999999){m=s;while(1){n=m+-4|0;c[m>>2]=0;if(n>>>0>>0){j=j+-4|0;c[j>>2]=0;}x=(c[n>>2]|0)+1|0;c[n>>2]=x;if(x>>>0>999999999)m=n;else break}}else n=s;m=(y-j>>2)*9|0;p=c[j>>2]|0;if(p>>>0>=10){o=10;do{o=o*10|0;m=m+1|0;}while(p>>>0>=o>>>0)}}else n=s;}else n=s;n=n+4|0;n=g>>>0>n>>>0?n:g;x=j;}else {n=g;x=j;}w=n;while(1){if(w>>>0<=x>>>0){u=0;break}j=w+-4|0;if(!(c[j>>2]|0))w=j;else {u=1;break}}g=0-m|0;do if(t){j=k+((v^1)&1)|0;if((j|0)>(m|0)&(m|0)>-5){o=i+-1|0;k=j+-1-m|0;}else {o=i+-2|0;k=j+-1|0;}j=h&8;if(!j){if(u?(A=c[w+-4>>2]|0,(A|0)!=0):0)if(!((A>>>0)%10|0)){n=0;j=10;do{j=j*10|0;n=n+1|0;}while(!((A>>>0)%(j>>>0)|0|0))}else n=0;else n=9;j=((w-y>>2)*9|0)+-9|0;if((o|32|0)==102){s=j-n|0;s=(s|0)>0?s:0;k=(k|0)<(s|0)?k:s;s=0;break}else {s=j+m-n|0;s=(s|0)>0?s:0;k=(k|0)<(s|0)?k:s;s=0;break}}else s=j;}else {o=i;s=h&8;}while(0);t=k|s;p=(t|0)!=0&1;q=(o|32|0)==102;if(q){v=0;j=(m|0)>0?m:0;}else {j=(m|0)<0?g:m;j=Q3(j,((j|0)<0)<<31>>31,E)|0;n=E;if((n-j|0)<2)do{j=j+-1|0;a[j>>0]=48;}while((n-j|0)<2);a[j+-1>>0]=(m>>31&2)+43;j=j+-2|0;a[j>>0]=o;v=j;j=n-j|0;}j=C+1+k+p+j|0;R3(b,32,f,j,h);L3(b,B,C);R3(b,48,f,j,h^65536);if(q){o=x>>>0>D>>>0?D:x;s=G+9|0;p=s;q=G+8|0;n=o;do{m=Q3(c[n>>2]|0,0,s)|0;if((n|0)==(o|0)){if((m|0)==(s|0)){a[q>>0]=48;m=q;}}else if(m>>>0>G>>>0){Y6(G|0,48,m-F|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}L3(b,m,p-m|0);n=n+4|0;}while(n>>>0<=D>>>0);if(t|0)L3(b,153472,1);if(n>>>0>>0&(k|0)>0)while(1){m=Q3(c[n>>2]|0,0,s)|0;if(m>>>0>G>>>0){Y6(G|0,48,m-F|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}L3(b,m,(k|0)<9?k:9);n=n+4|0;m=k+-9|0;if(!(n>>>0>>0&(k|0)>9)){k=m;break}else k=m;}R3(b,48,k+9|0,9,0);}else {t=u?w:x+4|0;if((k|0)>-1){u=G+9|0;s=(s|0)==0;g=u;p=0-F|0;q=G+8|0;o=x;do{m=Q3(c[o>>2]|0,0,u)|0;if((m|0)==(u|0)){a[q>>0]=48;m=q;}do if((o|0)==(x|0)){n=m+1|0;L3(b,m,1);if(s&(k|0)<1){m=n;break}L3(b,153472,1);m=n;}else {if(m>>>0<=G>>>0)break;Y6(G|0,48,m+p|0)|0;do m=m+-1|0;while(m>>>0>G>>>0)}while(0);F=g-m|0;L3(b,m,(k|0)>(F|0)?F:k);k=k-F|0;o=o+4|0;}while(o>>>0>>0&(k|0)>-1)}R3(b,48,k+18|0,18,0);L3(b,v,E-v|0);}R3(b,32,f,j,h^8192);}while(0);l=H;return ((j|0)<(f|0)?f:j)|0}function T3(a){a=+a;var b=0;h[j>>3]=a;b=c[j>>2]|0;z=c[j+4>>2]|0;return b|0}function U3(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(V3(e)|0)){g=c[f>>2]|0;h=5;}else f=0;else h=5;a:do if((h|0)==5){j=e+20|0;i=c[j>>2]|0;f=i;if((g-i|0)>>>0>>0){f=nb[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)>-1){i=d;while(1){if(!i){h=0;g=b;break b}g=i+-1|0;if((a[b+g>>0]|0)==10)break;else i=g;}f=nb[c[e+36>>2]&63](e,b,i)|0;if(f>>>0>>0)break a;h=i;g=b+i|0;d=d-i|0;f=c[j>>2]|0;}else {h=0;g=b;}while(0);W6(f|0,g|0,d|0)|0;c[j>>2]=(c[j>>2]|0)+d;f=h+d|0;}while(0);return f|0}function V3(b){b=b|0;var d=0,e=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;d=c[b>>2]|0;if(!(d&8)){c[b+8>>2]=0;c[b+4>>2]=0;e=c[b+44>>2]|0;c[b+28>>2]=e;c[b+20>>2]=e;c[b+16>>2]=e+(c[b+48>>2]|0);b=0;}else {c[b>>2]=d|32;b=-1;}return b|0}function W3(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=a+20|0;f=c[e>>2]|0;a=(c[a+16>>2]|0)-f|0;a=a>>>0>d>>>0?d:a;W6(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function X3(b){b=b|0;var c=0,d=0,e=0,f=0;e=a[b>>0]|0;c=1;d=153474;f=97;while(1){if(e<<24>>24==f<<24>>24?(s2(b,d)|0)==0:0)break;d=d+6|0;f=a[d>>0]|0;if(!(f<<24>>24)){c=0;break}else c=c+1|0;}return c|0}function Y3(a){a=a|0;var b=0;b=(F3(a)|0)==0;return (b?a:a&95)|0}function Z3(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;h=l;l=l+16|0;g=h;do if(b>>>0>6)d=0;else {ta(190656);if((b|0)!=6){d=_3(b,d)|0;La(190656);break}if(!d){d=197132;b=0;}else {b=g;e=153547;f=b+16|0;do{a[b>>0]=a[e>>0]|0;b=b+1|0;e=e+1|0;}while((b|0)<(f|0));f=0;do{b=k2(d,59)|0;e=b-d|0;if((e|0)<16){W6(g|0,d|0,e|0)|0;a[g+e>>0]=0;d=(a[b>>0]|0)==0?d:b+1|0;}_3(f,g)|0;f=f+1|0;}while((f|0)!=6);d=197132;b=0;}while(1){f=c[190616+(b<<2)>>2]|0;f=f|0?f+8|0:153563;e=l2(f)|0;W6(d|0,f|0,e|0)|0;f=d+e|0;a[f>>0]=59;b=b+1|0;if((b|0)==6)break;else d=d+(e+1)|0;}a[f>>0]=0;La(190656);d=197132;}while(0);l=h;return d|0}function _3(a,b){a=a|0;b=b|0;if(!b)a=c[190616+(a<<2)>>2]|0;else {b=q3(a,b)|0;c[190616+(a<<2)>>2]=b;a=b;}return (a|0?a+8|0:153563)|0}function $3(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;a:do if(!d)b=0;else {while(1){e=a[b>>0]|0;f=a[c>>0]|0;if(e<<24>>24!=f<<24>>24)break;d=d+-1|0;if(!d){b=0;break a}else {b=b+1|0;c=c+1|0;}}b=(e&255)-(f&255)|0;}while(0);return b|0}function a4(a){a=a|0;return b4(a)|0}function b4(a){a=a|0;return S6(a|0)|0}function c4(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if((c[f+76>>2]|0)>-1)m=J3(f)|0;else m=0;g=e+-1|0;if((e|0)<2){n=f+74|0;l=a[n>>0]|0;a[n>>0]=l+255|l;if(m|0)K3(f);if(!g)a[b>>0]=0;else b=0;}else {a:do if(g){k=f+4|0;l=f+8|0;e=b;while(1){h=c[k>>2]|0;o=h;p=(c[l>>2]|0)-o|0;i=U2(h,10,p)|0;j=(i|0)==0;i=j?p:1-o+i|0;i=i>>>0>>0?i:g;W6(e|0,h|0,i|0)|0;h=(c[k>>2]|0)+i|0;c[k>>2]=h;e=e+i|0;i=g-i|0;if(!(j&(i|0)!=0)){n=17;break a}if(h>>>0>=(c[l>>2]|0)>>>0){g=Z2(f)|0;if((g|0)<0)break;else j=g;}else {c[k>>2]=h+1;j=d[h>>0]|0;}g=i+-1|0;h=e+1|0;a[e>>0]=j;if(!((g|0)!=0&(j&255|0)!=10)){e=h;n=17;break a}else e=h;}if((e|0)!=(b|0)?(c[f>>2]&16|0)!=0:0)n=17;else b=0;}else {e=b;n=17;}while(0);if((n|0)==17)if(!b)b=0;else a[e>>0]=0;if(m)K3(f);}return b|0}function d4(b,c){b=b|0;c=c|0;var d=0;d=a[c>>0]|0;do if(d<<24>>24){b=R2(b,d<<24>>24)|0;if(b){if(a[c+1>>0]|0)if(a[b+1>>0]|0){if(!(a[c+2>>0]|0)){b=e4(b,c)|0;break}if(a[b+2>>0]|0){if(!(a[c+3>>0]|0)){b=f4(b,c)|0;break}if(a[b+3>>0]|0)if(!(a[c+4>>0]|0)){b=g4(b,c)|0;break}else {b=h4(b,c)|0;break}else b=0;}else b=0;}else b=0;}else b=0;}while(0);return b|0}function e4(b,c){b=b|0;c=c|0;var e=0,f=0,g=0;g=(d[c>>0]|0)<<8|(d[c+1>>0]|0);f=d[b>>0]|0;while(1){c=b+1|0;e=a[c>>0]|0;if(!(e<<24>>24))break;f=f<<8&65280|e&255;if((f|0)==(g|0))break;else b=c;}return (e<<24>>24?b:0)|0}function f4(b,c){b=b|0;c=c|0;var e=0,f=0;f=(d[c+1>>0]|0)<<16|(d[c>>0]|0)<<24|(d[c+2>>0]|0)<<8;e=b+2|0;c=a[e>>0]|0;b=(d[b+1>>0]|0)<<16|(d[b>>0]|0)<<24|(c&255)<<8;if(!((b|0)==(f|0)|c<<24>>24==0))do{e=e+1|0;c=a[e>>0]|0;b=(b|c&255)<<8;}while(!((b|0)==(f|0)|c<<24>>24==0));return (c<<24>>24?e+-2|0:0)|0}function g4(b,c){b=b|0;c=c|0;var e=0,f=0;f=(d[c+1>>0]|0)<<16|(d[c>>0]|0)<<24|(d[c+2>>0]|0)<<8|(d[c+3>>0]|0);c=b+3|0;e=a[c>>0]|0;b=(d[b+1>>0]|0)<<16|(d[b>>0]|0)<<24|(d[b+2>>0]|0)<<8|e&255;if(!(e<<24>>24==0|(b|0)==(f|0)))do{c=c+1|0;e=a[c>>0]|0;b=b<<8|e&255;}while(!(e<<24>>24==0|(b|0)==(f|0)));return (e<<24>>24?c+-3|0:0)|0}function h4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=l;l=l+1056|0;t=v+1024|0;u=v;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;c[t+20>>2]=0;c[t+24>>2]=0;c[t+28>>2]=0;e=a[d>>0]|0;a:do if(e<<24>>24){s=0;do{if(!(a[b+s>>0]|0)){e=0;break a}r=t+(((e&255)>>>5&255)<<2)|0;c[r>>2]=c[r>>2]|1<<(e&31);s=s+1|0;c[u+((e&255)<<2)>>2]=s;e=a[d+s>>0]|0;}while(e<<24>>24!=0);m=s>>>0>1;if(m){f=0;k=-1;g=1;b:while(1){h=1;e=f;while(1){f=g;c:while(1){j=1;while(1){g=a[d+(j+k)>>0]|0;i=a[d+f>>0]|0;if(g<<24>>24!=i<<24>>24)break c;if((j|0)==(h|0))break;j=j+1|0;f=j+e|0;if(f>>>0>=s>>>0){n=h;e=k;break b}}e=h+e|0;f=e+1|0;if(f>>>0>=s>>>0){n=h;e=k;break b}}h=f-k|0;if((g&255)<=(i&255))break;g=f+1|0;if(g>>>0>=s>>>0){n=h;e=k;break b}else e=f;}g=e+2|0;if(g>>>0>=s>>>0){n=1;break}else {f=e+1|0;k=e;}}if(m){h=0;m=-1;i=1;while(1){f=1;g=h;while(1){h=i;d:while(1){k=1;while(1){i=a[d+(k+m)>>0]|0;j=a[d+h>>0]|0;if(i<<24>>24!=j<<24>>24)break d;if((k|0)==(f|0))break;k=k+1|0;h=k+g|0;if(h>>>0>=s>>>0){i=n;g=m;h=26;break a}}g=f+g|0;h=g+1|0;if(h>>>0>=s>>>0){i=n;g=m;h=26;break a}}f=h-m|0;if((i&255)>=(j&255))break;i=h+1|0;if(i>>>0>=s>>>0){i=n;g=m;h=26;break a}else g=h;}i=g+2|0;if(i>>>0>=s>>>0){i=n;f=1;h=26;break}else {h=g+1|0;m=g;}}}else {i=n;f=1;g=-1;h=26;}}else {i=1;e=-1;f=1;g=-1;h=26;}}else {i=1;e=-1;s=0;f=1;g=-1;h=26;}while(0);e:do if((h|0)==26){q=(g+1|0)>>>0>(e+1|0)>>>0;f=q?f:i;q=q?g:e;r=q+1|0;if(!($3(d,d+f|0,r)|0))p=s-f|0;else {f=s-q+-1|0;p=0;f=(q>>>0>f>>>0?q:f)+1|0;}k=s|63;m=s+-1|0;n=(p|0)!=0;o=s-f|0;e=b;j=0;g=b;while(1){h=e;do if((g-h|0)>>>0>>0){i=U2(g,0,k)|0;if(i)if((i-h|0)>>>0>>0){e=0;break e}else break;else {i=g+k|0;break}}else i=g;while(0);g=a[e+m>>0]|0;f:do if(!(1<<(g&31)&c[t+(((g&255)>>>5&255)<<2)>>2])){h=0;g=s;}else {g=s-(c[u+((g&255)<<2)>>2]|0)|0;if(g|0){h=0;g=n&(j|0)!=0&g>>>0>>0?o:g;break}g=r>>>0>j>>>0?r:j;h=a[d+g>>0]|0;g:do if(!(h<<24>>24))g=r;else {while(1){if(h<<24>>24!=(a[e+g>>0]|0))break;g=g+1|0;h=a[d+g>>0]|0;if(!(h<<24>>24)){g=r;break g}}h=0;g=g-q|0;break f}while(0);while(1){if(g>>>0<=j>>>0)break e;g=g+-1|0;if((a[d+g>>0]|0)!=(a[e+g>>0]|0)){h=p;g=f;break}}}while(0);e=e+g|0;j=h;g=i;}}while(0);l=v;return e|0}function i4(a,b,c){a=a|0;b=b|0;c=c|0;j4(a,b,c)|0;return a|0}function j4(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=d;a:do if(!((g^b)&3)){f=(e|0)!=0;if(f&(g&3|0)!=0)do{g=a[d>>0]|0;a[b>>0]=g;if(!(g<<24>>24))break a;e=e+-1|0;d=d+1|0;b=b+1|0;f=(e|0)!=0;}while(f&(d&3|0)!=0);if(f){if(a[d>>0]|0){b:do if(e>>>0>3){f=d;while(1){d=c[f>>2]|0;if((d&-2139062144^-2139062144)&d+-16843009|0){d=f;break b}c[b>>2]=d;e=e+-4|0;d=f+4|0;b=b+4|0;if(e>>>0>3)f=d;else break}}while(0);h=11;}}else e=0;}else h=11;while(0);c:do if((h|0)==11)if(!e)e=0;else while(1){h=a[d>>0]|0;a[b>>0]=h;if(!(h<<24>>24))break c;e=e+-1|0;b=b+1|0;if(!e){e=0;break}else d=d+1|0;}while(0);Y6(b|0,0,e|0)|0;return b|0}function k4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+32|0;f=g;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;e=a[d>>0]|0;do if(!(e<<24>>24))d=0;else {if(!(a[d+1>>0]|0)){d=b;while(1)if((a[d>>0]|0)==e<<24>>24)d=d+1|0;else break;d=d-b|0;break}do{h=f+(((e&255)>>>5&255)<<2)|0;c[h>>2]=c[h>>2]|1<<(e&31);d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0);e=a[b>>0]|0;a:do if(!(e<<24>>24))d=b;else {d=b;do{if(!(c[f+(((e&255)>>>5&255)<<2)>>2]&1<<(e&31)))break a;d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0)}while(0);d=d-b|0;}while(0);l=g;return d|0}function l4(a){a=a|0;var b=0,d=0;b=l;l=l+16|0;d=b;c[d>>2]=e2(a)|0;a=Ja(6,d|0)|0;a=c2((a|0)==-4?0:a)|0;l=b;return a|0}function m4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=n4(a,b,f)|0;l=e;return d|0}function n4(a,b,c){a=a|0;b=b|0;c=c|0;return G3(a,2147483647,b,c)|0}function o4(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+208|0;j=m+8|0;k=m;h=O(d,b)|0;i=k;c[i>>2]=1;c[i+4>>2]=0;a:do if(h|0){i=0-d|0;c[j+4>>2]=d;c[j>>2]=d;f=2;b=d;g=d;while(1){b=b+d+g|0;c[j+(f<<2)>>2]=b;if(b>>>0>>0){n=g;f=f+1|0;g=b;b=n;}else break}g=a+h+i|0;if(g>>>0>a>>>0){h=g;f=1;b=1;do{do if((b&3|0)!=3){b=f+-1|0;if((c[j+(b<<2)>>2]|0)>>>0<(h-a|0)>>>0)p4(a,d,e,f,j);else r4(a,d,e,k,f,0,j);if((f|0)==1){s4(k,1);f=0;break}else {s4(k,b);f=1;break}}else {p4(a,d,e,f,j);q4(k,2);f=f+2|0;}while(0);b=c[k>>2]|1;c[k>>2]=b;a=a+d|0;}while(a>>>0>>0)}else {f=1;b=1;}r4(a,d,e,k,f,0,j);g=k+4|0;while(1){if((f|0)==1&(b|0)==1){if(!(c[g>>2]|0))break a}else if((f|0)>=2){s4(k,2);n=f+-2|0;c[k>>2]=c[k>>2]^7;q4(k,1);r4(a+(0-(c[j+(n<<2)>>2]|0))+i|0,d,e,k,f+-1|0,1,j);s4(k,1);b=c[k>>2]|1;c[k>>2]=b;h=a+i|0;r4(h,d,e,k,n,1,j);a=h;f=n;continue}b=t4(k)|0;q4(k,b);a=a+i|0;f=b+f|0;b=c[k>>2]|0;}}while(0);l=m;return}function p4(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+240|0;m=n;c[m>>2]=a;a:do if((e|0)>1){k=0-b|0;g=a;j=e;e=1;while(1){h=g+k|0;i=j+-2|0;g=h+(0-(c[f+(i<<2)>>2]|0))|0;if((lb[d&127](a,g)|0)>-1?(lb[d&127](a,h)|0)>-1:0)break a;a=e+1|0;e=m+(e<<2)|0;if((lb[d&127](g,h)|0)>-1){c[e>>2]=g;e=j+-1|0;}else {c[e>>2]=h;g=h;e=i;}if((e|0)<=1){e=a;break a}j=e;e=a;a=c[m>>2]|0;}}else e=1;while(0);v4(b,m,e);l=n;return}function q4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[f>>2]|0;c[a>>2]=e;c[f>>2]=0;b=b+-32|0;d=0;}else {d=c[f>>2]|0;e=c[a>>2]|0;}c[a>>2]=d<<32-b|e>>>b;c[f>>2]=d>>>b;return}function r4(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0;p=l;l=l+240|0;n=p+232|0;o=p;q=c[e>>2]|0;c[n>>2]=q;j=c[e+4>>2]|0;k=n+4|0;c[k>>2]=j;c[o>>2]=a;a:do if((q|0)!=1|(j|0)!=0?(m=0-b|0,i=a+(0-(c[h+(f<<2)>>2]|0))|0,(lb[d&127](i,a)|0)>=1):0){e=1;g=(g|0)==0;j=i;while(1){if(g&(f|0)>1){g=a+m|0;i=c[h+(f+-2<<2)>>2]|0;if((lb[d&127](g,j)|0)>-1){i=10;break a}if((lb[d&127](g+(0-i)|0,j)|0)>-1){i=10;break a}}g=e+1|0;c[o+(e<<2)>>2]=j;q=t4(n)|0;q4(n,q);f=q+f|0;if(!((c[n>>2]|0)!=1|(c[k>>2]|0)!=0)){e=g;a=j;i=10;break a}a=j+(0-(c[h+(f<<2)>>2]|0))|0;if((lb[d&127](a,c[o>>2]|0)|0)<1){a=j;e=g;g=0;i=9;break}else {q=j;e=g;g=1;j=a;a=q;}}}else {e=1;i=9;}while(0);if((i|0)==9?(g|0)==0:0)i=10;if((i|0)==10){v4(b,o,e);p4(a,b,d,f,h);}l=p;return}function s4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=a+4|0;if(b>>>0>31){e=c[a>>2]|0;c[f>>2]=e;c[a>>2]=0;b=b+-32|0;d=0;}else {d=c[a>>2]|0;e=c[f>>2]|0;}c[f>>2]=d>>>(32-b|0)|e<>2]=d<>2]|0)+-1|0)|0;if(!b){b=u4(c[a+4>>2]|0)|0;return ((b|0)==0?0:b+32|0)|0}else return b|0;return 0}function u4(a){a=a|0;var b=0;if(a)if(!(a&1)){b=a;a=0;do{a=a+1|0;b=b>>>1;}while(!(b&1|0))}else a=0;else a=32;return a|0}function v4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+256|0;e=h;a:do if((d|0)>=2?(g=b+(d<<2)|0,c[g>>2]=e,a|0):0)while(1){f=a>>>0<256?a:256;W6(e|0,c[b>>2]|0,f|0)|0;e=0;do{i=b+(e<<2)|0;e=e+1|0;W6(c[i>>2]|0,c[b+(e<<2)>>2]|0,f|0)|0;c[i>>2]=(c[i>>2]|0)+f;}while((e|0)!=(d|0));a=a-f|0;if(!a)break a;e=c[g>>2]|0;}while(0);l=h;return}function w4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=H3(a,b,f)|0;l=e;return d|0}function x4(b){b=b|0;var d=0,e=0,f=0;f=l;l=l+16|0;e=f;sa(0,e|0)|0;d=0;e=(c[e+4>>2]|0)*65537^(e>>>4)+b;while(1){a[b+d>>0]=(e&15)+65|e<<1&32;d=d+1|0;if((d|0)==6)break;else e=e>>>5;}l=f;return b|0}function y4(a,b,c){a=a|0;b=b|0;c=c|0;c=V2(a,b,c,-2147483648,0)|0;return c|0}function z4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;h=l;l=l+32|0;f=h;e=a[d>>0]|0;a:do if(e<<24>>24!=0?(a[d+1>>0]|0)!=0:0){c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;do{i=f+(((e&255)>>>5&255)<<2)|0;c[i>>2]=c[i>>2]|1<<(e&31);d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0);e=a[b>>0]|0;if(!(e<<24>>24))d=b;else {d=b;do{if(c[f+(((e&255)>>>5&255)<<2)>>2]&1<<(e&31)|0)break a;d=d+1|0;e=a[d>>0]|0;}while(e<<24>>24!=0)}}else g=3;while(0);if((g|0)==3)d=k2(b,e<<24>>24)|0;l=h;return d-b|0}function A4(b,d){b=b|0;d=d|0;var e=0;if(!b){b=c[47666]|0;if(!b)b=0;else e=3;}else e=3;do if((e|0)==3){b=b+(k4(b,d)|0)|0;if(!(a[b>>0]|0)){c[47666]=0;b=0;break}d=b+(z4(b,d)|0)|0;c[47666]=d;if(!(a[d>>0]|0)){c[47666]=0;break}else {c[47666]=d+1;a[d>>0]=0;break}}while(0);return b|0}function B4(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;e=c&255;do{if(!d){c=0;break}d=d+-1|0;c=b+d|0;}while((a[c>>0]|0)!=e<<24>>24);return c|0}function C4(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if(!b){b=c[e>>2]|0;if(!b)b=0;else f=3;}else f=3;do if((f|0)==3){b=b+(k4(b,d)|0)|0;if(!(a[b>>0]|0)){c[e>>2]=0;b=0;break}d=b+(z4(b,d)|0)|0;c[e>>2]=d;if(!(a[d>>0]|0)){c[e>>2]=0;break}else {c[e>>2]=d+1;a[d>>0]=0;break}}while(0);return b|0}function D4(a){a=a|0;var b=0,c=0;c=(l2(a)|0)+1|0;b=T1(c)|0;if(!b)b=0;else W6(b|0,a|0,c|0)|0;return b|0}function E4(a,b){a=a|0;b=b|0;return B4(a,b,(l2(a)|0)+1|0)|0}function F4(a,b){a=a|0;b=b|0;r3(a+(l2(a)|0)|0,b)|0;return a|0}function G4(b,c){b=b|0;c=c|0;c=b+(z4(b,c)|0)|0;return (a[c>>0]|0?c:0)|0}function H4(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(J3(a)|0)==0;a=(c[a>>2]|0)>>>4&1;}else a=(c[a>>2]|0)>>>4&1;return a|0}function I4(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;if((c[a+76>>2]|0)>-1)f=J3(a)|0;else f=0;J4(a);g=(c[a>>2]&1|0)!=0;if(!g){e=K4()|0;d=c[a+52>>2]|0;b=a+56|0;if(d|0)c[d+56>>2]=c[b>>2];b=c[b>>2]|0;if(b|0)c[b+52>>2]=d;if((c[e>>2]|0)==(a|0))c[e>>2]=b;L4();}b=M4(a)|0;b=kb[c[a+12>>2]&63](a)|0|b;d=c[a+92>>2]|0;if(d|0)U1(d);if(g){if(f|0)K3(a);}else U1(a);return b|0}function J4(a){a=a|0;var b=0;if(c[a+68>>2]|0){b=c[a+116>>2]|0;a=a+112|0;if(b|0)c[b+112>>2]=c[a>>2];a=c[a>>2]|0;if(!a)a=(O4()|0)+232|0;else a=a+116|0;c[a>>2]=b;}return}function K4(){ta(190668);return 190676}function L4(){La(190668);return}function M4(a){a=a|0;var b=0,d=0;do if(a){if((c[a+76>>2]|0)<=-1){b=N4(a)|0;break}d=(J3(a)|0)==0;b=N4(a)|0;if(!d)K3(a);}else {if(!(c[15711]|0))b=0;else b=M4(c[15711]|0)|0;a=c[(K4()|0)>>2]|0;if(a)do{if((c[a+76>>2]|0)>-1)d=J3(a)|0;else d=0;if((c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0)b=N4(a)|0|b;if(d|0)K3(a);a=c[a+56>>2]|0;}while((a|0)!=0);L4();}while(0);return b|0}function N4(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;h=a+28|0;if((c[b>>2]|0)>>>0>(c[h>>2]|0)>>>0?(nb[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)a=-1;else {d=a+4|0;e=c[d>>2]|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>>0)nb[c[a+40>>2]&63](a,e-g|0,1)|0;c[a+16>>2]=0;c[h>>2]=0;c[b>>2]=0;c[f>>2]=0;c[d>>2]=0;a=0;}return a|0}function O4(){return v2()|0}function P4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+64|0;n=o+40|0;k=o+24|0;j=o+16|0;g=o;m=o+56|0;f=a[d>>0]|0;if(U2(153580,f<<24>>24,4)|0){e=T1(1156)|0;if(!e)e=0;else {h=e;i=h+124|0;do{c[h>>2]=0;h=h+4|0;}while((h|0)<(i|0));if(!(R2(d,43)|0))c[e>>2]=f<<24>>24==114?8:4;if(R2(d,101)|0){c[g>>2]=b;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;f=a[d>>0]|0;}if(f<<24>>24==97){c[j>>2]=b;c[j+4>>2]=3;f=Ea(221,j|0)|0;if(!(f&1024)){c[k>>2]=b;c[k+4>>2]=4;c[k+8>>2]=f|1024;Ea(221,k|0)|0;}d=c[e>>2]|128;c[e>>2]=d;}else d=c[e>>2]|0;c[e+60>>2]=b;c[e+44>>2]=e+132;c[e+48>>2]=1024;f=e+75|0;a[f>>0]=-1;if((d&8|0)==0?(c[n>>2]=b,c[n+4>>2]=21523,c[n+8>>2]=m,(Ia(54,n|0)|0)==0):0)a[f>>0]=10;c[e+32>>2]=15;c[e+36>>2]=18;c[e+40>>2]=16;c[e+12>>2]=17;if(!(c[47645]|0))c[e+76>>2]=-1;Q4(e)|0;}}else {c[(d2()|0)>>2]=22;e=0;}l=o;return e|0}function Q4(a){a=a|0;var b=0,d=0;b=K4()|0;c[a+56>>2]=c[b>>2];d=c[b>>2]|0;if(d|0)c[d+52>>2]=a;c[b>>2]=a;L4();return a|0}function R4(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;g=j;a:do if(!e)b=0;else {do if(f|0){i=(b|0)==0?g:b;b=a[e>>0]|0;if(b<<24>>24>-1){c[i>>2]=b&255;b=b<<24>>24!=0&1;break a}h=(c[c[(S4()|0)+188>>2]>>2]|0)==0;b=a[e>>0]|0;if(h){c[i>>2]=b<<24>>24&57343;b=1;break a}b=(b&255)+-194|0;if(b>>>0<=50){g=e+1|0;h=c[62384+(b<<2)>>2]|0;if(f>>>0<4?h&-2147483648>>>((f*6|0)+-6|0)|0:0)break;b=d[g>>0]|0;f=b>>>3;if((f+-16|f+(h>>26))>>>0<=7){b=b+-128|h<<6;if((b|0)>=0){c[i>>2]=b;b=2;break a}g=(d[e+2>>0]|0)+-128|0;if(g>>>0<=63){g=g|b<<6;if((g|0)>=0){c[i>>2]=g;b=3;break a}b=(d[e+3>>0]|0)+-128|0;if(b>>>0<=63){c[i>>2]=b|g<<6;b=4;break a}}}}}while(0);c[(d2()|0)>>2]=84;b=-1;}while(0);l=j;return b|0}function S4(){return v2()|0}function T4(a,b){a=a|0;b=b|0;var c=0;c=l2(a)|0;return ((U4(a,1,c,b)|0)!=(c|0))<<31>>31|0}function U4(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=O(d,b)|0;d=(b|0)==0?0:d;if((c[e+76>>2]|0)>-1){g=(J3(e)|0)==0;a=U3(a,f,e)|0;if(!g)K3(e);}else a=U3(a,f,e)|0;if((a|0)!=(f|0))d=(a>>>0)/(b>>>0)|0;return d|0}function V4(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,m=0;m=l;l=l+16|0;j=m;k=e&255;a[j>>0]=k;g=b+16|0;h=c[g>>2]|0;if(!h)if(!(V3(b)|0)){h=c[g>>2]|0;i=4;}else f=-1;else i=4;do if((i|0)==4){i=b+20|0;g=c[i>>2]|0;if(g>>>0>>0?(f=e&255,(f|0)!=(a[b+75>>0]|0)):0){c[i>>2]=g+1;a[g>>0]=k;break}if((nb[c[b+36>>2]&63](b,j,1)|0)==1)f=d[j>>0]|0;else f=-1;}while(0);l=m;return f|0}function W4(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=c2(Fa(3,f|0)|0)|0;l=e;return d|0}function X4(){var a=0,b=0;b=l;l=l+16|0;a=Da(20,b|0)|0;l=b;return a|0}function Y4(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;d=b;e=153565;f=d+15|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0;}while((d|0)<(f|0));if(!c){a[b+14>>0]=48;a[b+15>>0]=0;}else {e=c;d=14;while(1){d=d+1|0;if(e>>>0<10)break;else e=(e>>>0)/10|0;}a[b+d>>0]=0;while(1){d=d+-1|0;a[b+d>>0]=(c>>>0)%10|0|48;if(c>>>0<10)break;else c=(c>>>0)/10|0;}}return}function Z4(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=l;l=l+48|0;f=g+40|0;e=g+8|0;d=g;c[d>>2]=a;c[d+4>>2]=b;d=Ca(197,d|0)|0;if((d|0)==-9?(c[e>>2]=a,c[e+4>>2]=1,(Ea(221,e|0)|0)>=0):0){Y4(e,a);c[f>>2]=e;c[f+4>>2]=b;b=c2(Ba(195,f|0)|0)|0;}else b=c2(d)|0;l=g;return b|0}function _4(a,b){a=a|0;b=b|0;var d=0,e=0;d=l;l=l+16|0;e=d;c[e>>2]=a;c[e+4>>2]=b;b=c2(Ga(33,e|0)|0)|0;l=d;return b|0}function $4(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;i=l;l=l+48|0;h=i+32|0;g=i+16|0;e=i;if(U2(153580,a[d>>0]|0,4)|0){f=a5(d)|0;c[e>>2]=b;c[e+4>>2]=f|32768;c[e+8>>2]=438;e=c2(Ha(5,e|0)|0)|0;if((e|0)>=0){if(f&524288|0){c[g>>2]=e;c[g+4>>2]=2;c[g+8>>2]=1;Ea(221,g|0)|0;}b=P4(e,d)|0;if(!b){c[h>>2]=e;Ja(6,h|0)|0;b=0;}}else b=0;}else {c[(d2()|0)>>2]=22;b=0;}l=i;return b|0}function a5(b){b=b|0;var c=0,d=0,e=0;d=(R2(b,43)|0)==0;c=a[b>>0]|0;d=d?c<<24>>24!=114&1:2;e=(R2(b,120)|0)==0;d=e?d:d|128;b=(R2(b,101)|0)==0;b=b?d:d|524288;b=c<<24>>24==114?b:b|64;b=c<<24>>24==119?b|512:b;return (c<<24>>24==97?b|1024:b)|0}function b5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=l;l=l+16|0;f=e;c[f>>2]=d;d=c5(a,b,f)|0;l=e;return d|0}function c5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=l;l=l+128|0;e=g;f=e;h=f+124|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(h|0));c[e+32>>2]=41;c[e+44>>2]=a;c[e+76>>2]=-1;c[e+84>>2]=a;h=e5(e,b,d)|0;l=g;return h|0}function d5(a,b,c){a=a|0;b=b|0;c=c|0;return m5(a,b,c)|0}function e5(b,e,f){b=b|0;e=e|0;f=f|0;var i=0,j=0,k=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;P=l;l=l+288|0;J=P+8|0;K=P+17|0;L=P;M=P+16|0;if((c[b+76>>2]|0)>-1)O=J3(b)|0;else O=0;i=a[e>>0]|0;a:do if(i<<24>>24){B=b+4|0;C=b+100|0;D=b+108|0;E=b+8|0;F=K+10|0;G=K+33|0;A=J+4|0;H=K+1|0;I=K+1|0;m=e;t=0;e=0;k=0;j=0;b:while(1){c:do if(!(S2(i&255)|0)){i=i<<24>>24==37;d:do if(i){p=m+1|0;n=a[p>>0]|0;e:do switch(n<<24>>24){case 37:break d;case 42:{y=0;m=m+2|0;break}default:{i=(n&255)+-48|0;if(i>>>0<10?(a[m+2>>0]|0)==36:0){y=f5(f,i)|0;m=m+3|0;break e}m=(c[f>>2]|0)+(4-1)&~(4-1);y=c[m>>2]|0;c[f>>2]=m+4;m=p;}}while(0);i=a[m>>0]|0;n=i&255;if((n+-48|0)>>>0<10){p=0;do{p=(p*10|0)+-48+n|0;m=m+1|0;i=a[m>>0]|0;n=i&255;}while((n+-48|0)>>>0<10)}else p=0;i=i<<24>>24==109;x=(y|0)!=0;k=i?0:k;j=i?0:j;m=i?m+1|0:m;i=x&i;n=m+1|0;switch(a[m>>0]|0){case 104:{w=(a[n>>0]|0)==104;q=w?-2:-1;m=w?m+2|0:n;break}case 108:{w=(a[n>>0]|0)==108;q=w?3:1;m=w?m+2|0:n;break}case 106:{q=3;m=n;break}case 116:case 122:{q=1;m=n;break}case 76:{q=2;m=n;break}case 110:case 112:case 67:case 83:case 91:case 99:case 115:case 88:case 71:case 70:case 69:case 65:case 103:case 102:case 101:case 97:case 120:case 117:case 111:case 105:case 100:{q=0;break}default:{N=135;break b}}s=d[m>>0]|0;u=(s&47|0)==3;s=u?s|32:s;u=u?1:q;r=s&255;switch(r<<24>>24){case 99:{p=(p|0)>1?p:1;w=t;break}case 91:{w=t;break}case 110:{g5(y,u,t,((t|0)<0)<<31>>31);n=t;break c}default:{W2(b,0);do{n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;}while((S2(n)|0)!=0);if(!(c[C>>2]|0))n=c[B>>2]|0;else {n=(c[B>>2]|0)+-1|0;c[B>>2]=n;}w=(c[D>>2]|0)+t+n-(c[E>>2]|0)|0;}}W2(b,p);n=c[B>>2]|0;q=c[C>>2]|0;if(n>>>0>>0)c[B>>2]=n+1;else {if((Y2(b)|0)<0){N=135;break b}q=c[C>>2]|0;}if(q|0)c[B>>2]=(c[B>>2]|0)+-1;f:do switch(r<<24>>24){case 91:case 99:case 115:{v=(s|0)==99;g:do if((s|16|0)==115){Y6(H|0,-1,256)|0;a[K>>0]=0;if((s|0)==115){a[G>>0]=0;a[F>>0]=0;a[F+1>>0]=0;a[F+2>>0]=0;a[F+3>>0]=0;a[F+4>>0]=0;}}else {s=m+1|0;n=(a[s>>0]|0)==94;t=n&1;m=n?m+2|0:s;Y6(I|0,n&1|0,256)|0;a[K>>0]=0;n=a[m>>0]|0;switch(n<<24>>24){case 45:{n=46;N=63;break}case 93:{n=94;N=63;break}default:{}}while(1){if((N|0)==63){N=0;a[K+n>>0]=t^1;n=m+1|0;m=n;n=a[n>>0]|0;}h:do switch(n<<24>>24){case 0:{N=135;break b}case 93:break g;case 45:{s=m+1|0;n=a[s>>0]|0;switch(n<<24>>24){case 93:case 0:{n=45;break h}default:{}}m=a[m+-1>>0]|0;if((m&255)<(n&255)){r=(t^1)&255;m=m&255;do{m=m+1|0;a[K+m>>0]=r;n=a[s>>0]|0;}while((m|0)<(n&255|0));m=s;}else m=s;break}default:{}}while(0);n=(n&255)+1|0;N=63;}}while(0);n=v?p+1|0:31;s=(u|0)==1;i:do if(s){if(i){j=T1(n<<2)|0;if(!j){k=0;j=0;i=1;N=135;break b}}else j=y;c[J>>2]=0;c[A>>2]=0;r=n;k=0;j:while(1){q=(j|0)==0;do{k:while(1){n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;if(!(a[K+(n+1)>>0]|0))break j;a[M>>0]=n;switch(l3(L,M,1,J)|0){case -1:{k=0;N=135;break b}case -2:break;default:break k}}if(!q){c[j+(k<<2)>>2]=c[L>>2];k=k+1|0;}}while(!(i&(k|0)==(r|0)));k=r<<1|1;n=W1(j,k<<2)|0;if(!n){k=0;i=1;N=135;break b}else {u=r;r=k;j=n;k=u;}}if(!(h5(J)|0)){k=0;N=135;break b}else {n=k;k=0;r=j;}}else {if(i){k=T1(n)|0;if(!k){k=0;j=0;i=1;N=135;break b}else {q=n;j=0;}while(1){do{n=c[B>>2]|0;if(n>>>0<(c[C>>2]|0)>>>0){c[B>>2]=n+1;n=d[n>>0]|0;}else n=Y2(b)|0;if(!(a[K+(n+1)>>0]|0)){n=j;r=0;j=0;break i}a[k+j>>0]=n;j=j+1|0;}while((j|0)!=(q|0));j=q<<1|1;n=W1(k,j)|0;if(!n){j=0;i=1;N=135;break b}else {u=q;q=j;k=n;j=u;}}}if(!y){k=q;while(1){j=c[B>>2]|0;if(j>>>0>>0){c[B>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;if(!(a[K+(j+1)>>0]|0)){n=0;k=0;r=0;j=0;break i}k=c[C>>2]|0;}}else {n=0;k=q;while(1){j=c[B>>2]|0;if(j>>>0>>0){c[B>>2]=j+1;j=d[j>>0]|0;}else j=Y2(b)|0;if(!(a[K+(j+1)>>0]|0)){k=y;r=0;j=0;break i}a[y+n>>0]=j;n=n+1|0;k=c[C>>2]|0;}}}while(0);if(!(c[C>>2]|0))q=c[B>>2]|0;else {q=(c[B>>2]|0)+-1|0;c[B>>2]=q;}q=q-(c[E>>2]|0)+(c[D>>2]|0)|0;if(!q){N=137;break b}if(!((q|0)==(p|0)|v^1)){N=137;break b}do if(i)if(s){c[y>>2]=r;break}else {c[y>>2]=k;break}while(0);if(!v){if(r|0)c[r+(n<<2)>>2]=0;if(!k){k=0;break f}a[k+n>>0]=0;}break}case 120:case 88:case 112:{n=16;N=123;break}case 111:{n=8;N=123;break}case 117:case 100:{n=10;N=123;break}case 105:{n=0;N=123;break}case 71:case 103:case 70:case 102:case 69:case 101:case 65:case 97:{o=+i5(b,u,0);if((c[D>>2]|0)==((c[E>>2]|0)-(c[B>>2]|0)|0)){N=137;break b}if(y)switch(u|0){case 0:{g[y>>2]=o;break f}case 1:{h[y>>3]=o;break f}case 2:{h[y>>3]=o;break f}default:break f}break}default:{}}while(0);do if((N|0)==123){N=0;n=X2(b,n,0,-1,-1)|0;if((c[D>>2]|0)==((c[E>>2]|0)-(c[B>>2]|0)|0)){N=137;break b}if(x&(s|0)==112){c[y>>2]=n;break}else {g5(y,u,n,z);break}}while(0);e=e+(x&1)|0;n=(c[D>>2]|0)+w+(c[B>>2]|0)-(c[E>>2]|0)|0;break c}while(0);m=m+(i&1)|0;W2(b,0);i=c[B>>2]|0;if(i>>>0<(c[C>>2]|0)>>>0){c[B>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;if((i|0)!=(d[m>>0]|0)){N=22;break b}n=t+1|0;}else {while(1){i=m+1|0;if(!(S2(d[i>>0]|0)|0))break;else m=i;}W2(b,0);do{i=c[B>>2]|0;if(i>>>0<(c[C>>2]|0)>>>0){c[B>>2]=i+1;i=d[i>>0]|0;}else i=Y2(b)|0;}while((S2(i)|0)!=0);if(!(c[C>>2]|0))i=c[B>>2]|0;else {i=(c[B>>2]|0)+-1|0;c[B>>2]=i;}n=(c[D>>2]|0)+t+i-(c[E>>2]|0)|0;}while(0);m=m+1|0;i=a[m>>0]|0;if(!(i<<24>>24))break a;else t=n;}if((N|0)==22){if(c[C>>2]|0)c[B>>2]=(c[B>>2]|0)+-1;if((e|0)!=0|(i|0)>-1)break;else {i=0;N=136;}}else if((N|0)==135){i=i&1;if(!e)N=136;}else if((N|0)==137)i=i&1;if((N|0)==136)e=-1;if(i){U1(k);U1(j);}}else e=0;while(0);if(O|0)K3(b);l=P;return e|0}function f5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=l;l=l+16|0;d=e;c[d>>2]=c[a>>2];while(1){f=(c[d>>2]|0)+(4-1)&~(4-1);a=c[f>>2]|0;c[d>>2]=f+4;if(b>>>0>1)b=b+-1|0;else break}l=e;return a|0}function g5(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;a:do if(d|0)switch(e|0){case -2:{a[d>>0]=f;break a}case -1:{b[d>>1]=f;break a}case 0:{c[d>>2]=f;break a}case 1:{c[d>>2]=f;break a}case 3:{e=d;c[e>>2]=f;c[e+4>>2]=g;break a}default:break a}while(0);return}function h5(a){a=a|0;if(!a)a=1;else a=(c[a>>2]|0)==0&1;return a|0}function i5(b,e,f){b=b|0;e=e|0;f=f|0;var g=0.0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;switch(e|0){case 0:{l=-149;m=24;j=4;break}case 1:{l=-1074;m=53;j=4;break}case 2:{l=-1074;m=53;j=4;break}default:g=0.0;}a:do if((j|0)==4){o=b+4|0;n=b+100|0;do{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;}while((S2(e)|0)!=0);b:do switch(e|0){case 43:case 45:{i=1-(((e|0)==45&1)<<1)|0;e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;h=d[e>>0]|0;break b}else {h=Y2(b)|0;break b}}default:{h=e;i=1;}}while(0);e=0;do{if((h|32|0)!=(a[153584+e>>0]|0))break;do if(e>>>0<7){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else {h=Y2(b)|0;break}}while(0);e=e+1|0;}while(e>>>0<8);c:do switch(e|0){case 8:break;case 3:{j=23;break}default:{k=(f|0)!=0;if(k&e>>>0>3)if((e|0)==8)break c;else {j=23;break c}d:do if(!e){e=0;do{if((h|32|0)!=(a[153593+e>>0]|0))break d;do if(e>>>0<2){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;break}else {h=Y2(b)|0;break}}while(0);e=e+1|0;}while(e>>>0<3)}while(0);switch(e|0){case 3:{e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;if((e|0)==40)e=1;else {if(!(c[n>>2]|0)){g=s;break a}c[o>>2]=(c[o>>2]|0)+-1;g=s;break a}while(1){h=c[o>>2]|0;if(h>>>0<(c[n>>2]|0)>>>0){c[o>>2]=h+1;h=d[h>>0]|0;}else h=Y2(b)|0;if(!((h+-48|0)>>>0<10|(h+-65|0)>>>0<26)?!((h|0)==95|(h+-97|0)>>>0<26):0)break;e=e+1|0;}if((h|0)==41){g=s;break a}h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!k){c[(d2()|0)>>2]=22;W2(b,0);g=0.0;break a}if(!e){g=s;break a}while(1){e=e+-1|0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if(!e){g=s;break a}}}case 0:{if((h|0)==48){e=c[o>>2]|0;if(e>>>0<(c[n>>2]|0)>>>0){c[o>>2]=e+1;e=d[e>>0]|0;}else e=Y2(b)|0;if((e|32|0)==120){g=+j5(b,m,l,i,f);break a}if(!(c[n>>2]|0))e=48;else {c[o>>2]=(c[o>>2]|0)+-1;e=48;}}else e=h;g=+k5(b,e,m,l,i,f);break a}default:{if(c[n>>2]|0)c[o>>2]=(c[o>>2]|0)+-1;c[(d2()|0)>>2]=22;W2(b,0);g=0.0;break a}}}}while(0);if((j|0)==23){h=(c[n>>2]|0)==0;if(!h)c[o>>2]=(c[o>>2]|0)+-1;if((f|0)!=0&e>>>0>3)do{if(!h)c[o>>2]=(c[o>>2]|0)+-1;e=e+-1|0;}while(e>>>0>3)}g=+(i|0)*t;}while(0);return +g}function j5(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0.0,i=0,j=0,k=0.0,l=0,m=0,n=0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=a+4|0;i=c[y>>2]|0;x=a+100|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;l=0;}else {j=Y2(a)|0;l=0;}a:while(1){switch(j|0){case 46:{w=8;break a}case 48:break;default:{s=0;n=0;o=1.0;h=0.0;i=0;m=j;t=l;v=0;u=0;l=0;j=0;break a}}i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;l=1;continue}else {j=Y2(a)|0;l=1;continue}}if((w|0)==8){i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;j=d[i>>0]|0;}else j=Y2(a)|0;if((j|0)==48){l=0;j=0;do{i=c[y>>2]|0;if(i>>>0<(c[x>>2]|0)>>>0){c[y>>2]=i+1;m=d[i>>0]|0;}else m=Y2(a)|0;l=J6(l|0,j|0,-1,-1)|0;j=z;}while((m|0)==48);s=1;n=0;o=1.0;h=0.0;i=0;t=1;v=0;u=0;}else {s=1;n=0;o=1.0;h=0.0;i=0;m=j;t=l;v=0;u=0;l=0;j=0;}}while(1){q=m+-48|0;p=m|32;if(q>>>0>=10){r=(m|0)==46;if(!(r|(p+-97|0)>>>0<6))break;if(r)if(!s){s=1;k=o;r=t;l=u;j=v;q=u;p=v;}else {m=46;break}else w=20;}else w=20;if((w|0)==20){w=0;m=(m|0)>57?p+-87|0:q;do if(!((v|0)<0|(v|0)==0&u>>>0<8))if((v|0)<0|(v|0)==0&u>>>0<14){o=o*.0625;k=o;h=h+o*+(m|0);break}else {t=(n|0)!=0|(m|0)==0;n=t?n:1;k=o;h=t?h:h+o*.5;break}else {k=o;i=m+(i<<4)|0;}while(0);q=J6(u|0,v|0,1,0)|0;r=1;p=z;}m=c[y>>2]|0;if(m>>>0<(c[x>>2]|0)>>>0){c[y>>2]=m+1;o=k;m=d[m>>0]|0;t=r;v=p;u=q;continue}else {o=k;m=Y2(a)|0;t=r;v=p;u=q;continue}}do if(!t){i=(c[x>>2]|0)==0;if(!i)c[y>>2]=(c[y>>2]|0)+-1;if(g){if(!i)c[y>>2]=(c[y>>2]|0)+-1;if(!((s|0)==0|i))c[y>>2]=(c[y>>2]|0)+-1;}else W2(a,0);h=+(f|0)*0.0;}else {p=(s|0)==0;q=p?u:l;p=p?v:j;if((v|0)<0|(v|0)==0&u>>>0<8){l=u;j=v;while(1){i=i<<4;w=l;l=J6(l|0,j|0,1,0)|0;if(!((j|0)<0|(j|0)==0&w>>>0<7)){n=i;break}else j=z;}}else n=i;if((m|32|0)==112){j=l5(a,g)|0;i=z;if((j|0)==0&(i|0)==-2147483648){if(!g){W2(a,0);h=0.0;break}if(!(c[x>>2]|0)){j=0;i=0;}else {c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0;}}}else if(!(c[x>>2]|0)){j=0;i=0;}else {c[y>>2]=(c[y>>2]|0)+-1;j=0;i=0;}l=R6(q|0,p|0,2)|0;l=J6(l|0,z|0,-32,-1)|0;l=J6(l|0,z|0,j|0,i|0)|0;i=z;if(!n){h=+(f|0)*0.0;break}y=0-e|0;g=((y|0)<0)<<31>>31;if((i|0)>(g|0)|(i|0)==(g|0)&l>>>0>y>>>0){c[(d2()|0)>>2]=34;h=+(f|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}y=e+-106|0;g=((y|0)<0)<<31>>31;if((i|0)<(g|0)|(i|0)==(g|0)&l>>>0>>0){c[(d2()|0)>>2]=34;h=+(f|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if((n|0)>-1){j=n;do{y=!(h>=.5);j=j<<1|(y^1)&1;h=h+(y?h:h+-1.0);l=J6(l|0,i|0,-1,-1)|0;i=z;}while((j|0)>-1);o=h;m=j;}else {o=h;m=n;}y=((b|0)<0)<<31>>31;e=K6(32,0,e|0,((e|0)<0)<<31>>31|0)|0;i=J6(e|0,z|0,l|0,i|0)|0;e=z;if((e|0)<(y|0)|(e|0)==(y|0)&i>>>0>>0)if((i|0)>0)w=59;else {j=0;i=84;w=61;}else {i=b;w=59;}if((w|0)==59)if((i|0)<53){j=i;i=84-i|0;w=61;}else {k=0.0;h=+(f|0);}if((w|0)==61){h=+(f|0);k=+G2(+D2(1.0,i),h);i=j;}f=(m&1|0)==0&(o!=0.0&(i|0)<32);h=(f?0.0:o)*h+(k+h*+((m+(f&1)|0)>>>0))-k;if(!(h!=0.0))c[(d2()|0)>>2]=34;h=+H2(h,l);}while(0);return +h}function k5(a,b,e,f,g,h){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0.0,j=0.0,k=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0;J=l;l=l+512|0;G=J;H=f+e|0;I=0-H|0;D=a+4|0;E=a+100|0;k=0;a:while(1){switch(b|0){case 46:{A=6;break a}case 48:break;default:{v=0;p=k;q=0;o=0;break a}}b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;k=1;continue}else {b=Y2(a)|0;k=1;continue}}if((A|0)==6){b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;if((b|0)==48){k=0;b=0;while(1){k=J6(k|0,b|0,-1,-1)|0;o=z;b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;if((b|0)==48)b=o;else {v=1;p=1;q=k;break}}}else {v=1;p=k;q=0;o=0;}}c[G>>2]=0;n=b+-48|0;m=(b|0)==46;b:do if(m|n>>>0<10){C=G+496|0;w=0;k=0;u=0;x=v;y=p;A=n;p=0;n=0;c:while(1){do if(m)if(!x){x=1;q=p;o=n;}else break c;else {p=J6(p|0,n|0,1,0)|0;n=z;v=(b|0)!=48;if((k|0)>=125){if(!v)break;c[C>>2]=c[C>>2]|1;break}m=G+(k<<2)|0;if(!w)b=A;else b=b+-48+((c[m>>2]|0)*10|0)|0;c[m>>2]=b;w=w+1|0;y=(w|0)==9;w=y?0:w;k=k+(y&1)|0;u=v?p:u;y=1;}while(0);b=c[D>>2]|0;if(b>>>0<(c[E>>2]|0)>>>0){c[D>>2]=b+1;b=d[b>>0]|0;}else b=Y2(a)|0;A=b+-48|0;m=(b|0)==46;if(!(m|A>>>0<10)){v=x;m=y;A=29;break b}}b=w;m=(y|0)!=0;A=37;}else {w=0;k=0;u=0;m=p;p=0;n=0;A=29;}while(0);do if((A|0)==29){C=(v|0)==0;q=C?p:q;o=C?n:o;m=(m|0)!=0;if(!(m&(b|32|0)==101))if((b|0)>-1){b=w;A=37;break}else {b=w;A=39;break}m=l5(a,h)|0;b=z;if((m|0)==0&(b|0)==-2147483648){if(!h){W2(a,0);i=0.0;break}if(!(c[E>>2]|0)){m=0;b=0;}else {c[D>>2]=(c[D>>2]|0)+-1;m=0;b=0;}}y=J6(m|0,b|0,q|0,o|0)|0;b=w;o=z;A=41;}while(0);if((A|0)==37)if(c[E>>2]|0){c[D>>2]=(c[D>>2]|0)+-1;if(m){y=q;A=41;}else A=40;}else A=39;if((A|0)==39)if(m){y=q;A=41;}else A=40;do if((A|0)==40){c[(d2()|0)>>2]=22;W2(a,0);i=0.0;}else if((A|0)==41){m=c[G>>2]|0;if(!m){i=+(g|0)*0.0;break}if(((n|0)<0|(n|0)==0&p>>>0<10)&((y|0)==(p|0)&(o|0)==(n|0))?(e|0)>30|(m>>>e|0)==0:0){i=+(g|0)*+(m>>>0);break}a=(f|0)/-2|0;E=((a|0)<0)<<31>>31;if((o|0)>(E|0)|(o|0)==(E|0)&y>>>0>a>>>0){c[(d2()|0)>>2]=34;i=+(g|0)*1797693134862315708145274.0e284*1797693134862315708145274.0e284;break}a=f+-106|0;E=((a|0)<0)<<31>>31;if((o|0)<(E|0)|(o|0)==(E|0)&y>>>0>>0){c[(d2()|0)>>2]=34;i=+(g|0)*2.2250738585072014e-308*2.2250738585072014e-308;break}if(b){if((b|0)<9){n=G+(k<<2)|0;m=c[n>>2]|0;while(1){m=m*10|0;if((b|0)>=8)break;else b=b+1|0;}c[n>>2]=m;}k=k+1|0;}if((u|0)<9?(u|0)<=(y|0)&(y|0)<18:0){if((y|0)==9){i=+(g|0)*+((c[G>>2]|0)>>>0);break}if((y|0)<9){i=+(g|0)*+((c[G>>2]|0)>>>0)/+(c[63712+(8-y<<2)>>2]|0);break}a=e+27+(O(y,-3)|0)|0;b=c[G>>2]|0;if((a|0)>30|(b>>>a|0)==0){i=+(g|0)*+(b>>>0)*+(c[63712+(y+-10<<2)>>2]|0);break}}b=(y|0)%9|0;if(!b){b=0;n=0;}else {u=(y|0)>-1?b:b+9|0;p=c[63712+(8-u<<2)>>2]|0;if(k){q=1e9/(p|0)|0;n=0;o=0;m=y;b=0;do{D=G+(b<<2)|0;E=c[D>>2]|0;a=((E>>>0)/(p>>>0)|0)+n|0;c[D>>2]=a;n=O(q,(E>>>0)%(p>>>0)|0)|0;a=(b|0)==(o|0)&(a|0)==0;m=a?m+-9|0:m;o=a?o+1&127:o;b=b+1|0;}while((b|0)!=(k|0));if(!n)n=o;else {c[G+(k<<2)>>2]=n;n=o;k=k+1|0;}}else {n=0;k=0;m=y;}b=0;y=9-u+m|0;}d:while(1){u=(y|0)<18;v=(y|0)==18;w=G+(n<<2)|0;while(1){if(!u){if(!v){m=y;break d}if((c[w>>2]|0)>>>0>=9007199){m=18;break d}}m=0;x=k;k=k+127|0;while(1){o=k&127;p=G+(o<<2)|0;k=R6(c[p>>2]|0,0,29)|0;k=J6(k|0,z|0,m|0,0)|0;m=z;if(m>>>0>0|(m|0)==0&k>>>0>1e9){q=N6(k|0,m|0,1e9,0)|0;k=O6(k|0,m|0,1e9,0)|0;}else q=0;c[p>>2]=k;a=(o|0)==(n|0);x=(k|0)==0&(((o|0)!=(x+127&127|0)|a)^1)?o:x;if(a)break;else {m=q;k=o+-1|0;}}b=b+-29|0;if(q|0)break;else k=x;}n=n+127&127;k=x+127&127;m=G+((x+126&127)<<2)|0;if((n|0)==(x|0))c[m>>2]=c[m>>2]|c[G+(k<<2)>>2];else k=x;c[G+(n<<2)>>2]=q;y=y+9|0;}e:while(1){w=k+1&127;x=G+((k+127&127)<<2)|0;while(1){q=(m|0)==18;v=(m|0)>27?9:1;y=n;while(1){p=0;while(1){n=p+y&127;if((n|0)==(k|0)){F=2;A=88;break}n=c[G+(n<<2)>>2]|0;o=c[63744+(p<<2)>>2]|0;if(n>>>0>>0){F=2;A=88;break}if(n>>>0>o>>>0)break;n=p+1|0;if((p|0)<1)p=n;else {F=n;A=88;break}}if((A|0)==88?(A=0,q&(F|0)==2):0){i=0.0;o=0;break e}b=v+b|0;if((y|0)==(k|0))y=k;else break}q=(1<>>v;p=0;n=y;o=y;do{D=G+(o<<2)|0;E=c[D>>2]|0;a=(E>>>v)+p|0;c[D>>2]=a;p=O(E&q,u)|0;a=(o|0)==(n|0)&(a|0)==0;m=a?m+-9|0:m;n=a?n+1&127:n;o=o+1&127;}while((o|0)!=(k|0));if(!p)continue;if((w|0)!=(n|0))break;c[x>>2]=c[x>>2]|1;}c[G+(k<<2)>>2]=p;k=w;}do{n=o+y&127;m=k+1&127;if((n|0)==(k|0)){c[G+(m+-1<<2)>>2]=0;k=m;}i=i*1.0e9+ +((c[G+(n<<2)>>2]|0)>>>0);o=o+1|0;}while((o|0)!=2);t=+(g|0);j=i*t;o=b+53|0;p=o-f|0;q=(p|0)<(e|0);n=q?((p|0)>0?p:0):e;if((n|0)<53){K=+G2(+D2(1.0,105-n|0),j);r=+I2(j,+D2(1.0,53-n|0));s=K;i=r;r=K+(j-r);}else {s=0.0;i=0.0;r=j;}m=y+2&127;if((m|0)!=(k|0)){m=c[G+(m<<2)>>2]|0;do if(m>>>0>=5e8){if((m|0)!=5e8){i=t*.75+i;break}if((y+3&127|0)==(k|0)){i=t*.5+i;break}else {i=t*.75+i;break}}else {if((m|0)==0?(y+3&127|0)==(k|0):0)break;i=t*.25+i;}while(0);if((53-n|0)>1?!(+I2(i,1.0)!=0.0):0)j=i+1.0;else j=i;}else j=i;i=r+j-s;do if((o&2147483647|0)>(-2-H|0)){H=!(+B(+i)>=9007199254740992.0);b=b+((H^1)&1)|0;i=H?i:i*.5;if((b+50|0)<=(I|0)?!(j!=0.0&(q&((n|0)!=(p|0)|H))):0)break;c[(d2()|0)>>2]=34;}while(0);i=+H2(i,b);}while(0);l=J;return +i}function l5(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0;h=a+4|0;e=c[h>>2]|0;i=a+100|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;switch(e|0){case 43:case 45:{f=(e|0)==45&1;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;if((b|0)!=0&(e+-48|0)>>>0>9?(c[i>>2]|0)!=0:0)c[h>>2]=(c[h>>2]|0)+-1;break}default:f=0;}if((e+-48|0)>>>0>9)if(!(c[i>>2]|0)){f=-2147483648;e=0;}else {c[h>>2]=(c[h>>2]|0)+-1;f=-2147483648;e=0;}else {g=0;do{g=e+-48+(g*10|0)|0;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10&(g|0)<214748364);b=((g|0)<0)<<31>>31;if((e+-48|0)>>>0<10)do{b=I6(g|0,b|0,10,0)|0;g=z;e=J6(e|0,((e|0)<0)<<31>>31|0,-48,-1)|0;g=J6(e|0,z|0,b|0,g|0)|0;b=z;e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10&((b|0)<21474836|(b|0)==21474836&g>>>0<2061584302));if((e+-48|0)>>>0<10)do{e=c[h>>2]|0;if(e>>>0<(c[i>>2]|0)>>>0){c[h>>2]=e+1;e=d[e>>0]|0;}else e=Y2(a)|0;}while((e+-48|0)>>>0<10);if(c[i>>2]|0)c[h>>2]=(c[h>>2]|0)+-1;i=(f|0)!=0;e=K6(0,0,g|0,b|0)|0;f=i?z:b;e=i?e:g;}z=f;return e|0}function m5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=a+84|0;g=c[e>>2]|0;h=d+256|0;f=U2(g,0,h)|0;f=(f|0)==0?h:f-g|0;d=f>>>0>>0?f:d;W6(b|0,g|0,d|0)|0;c[a+4>>2]=g+d;b=g+f|0;c[a+8>>2]=b;c[e>>2]=b;return d|0}function n5(a,b,c){a=a|0;b=b|0;c=c|0;return o5(a,b,c)|0}function o5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if((c[a+76>>2]|0)>-1){e=(J3(a)|0)==0;b=p5(a,b,d)|0;if(!e)K3(a);}else b=p5(a,b,d)|0;return b|0}function p5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;if((d|0)==1)b=b-(c[a+8>>2]|0)+(c[a+4>>2]|0)|0;e=a+20|0;f=a+28|0;if((c[e>>2]|0)>>>0>(c[f>>2]|0)>>>0?(nb[c[a+36>>2]&63](a,0,0)|0,(c[e>>2]|0)==0):0)b=-1;else {c[a+16>>2]=0;c[f>>2]=0;c[e>>2]=0;if((nb[c[a+40>>2]&63](a,b,d)|0)<0)b=-1;else {c[a+8>>2]=0;c[a+4>>2]=0;c[a>>2]=c[a>>2]&-17;b=0;}}return b|0}function q5(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;while(1){e=a[b>>0]|0;c=e<<24>>24;f=b+1|0;if(!(S2(c)|0))break;else b=f;}switch(c|0){case 45:{b=1;g=5;break}case 43:{b=0;g=5;break}default:{h=0;d=b;b=e;}}if((g|0)==5){h=b;d=f;b=a[f>>0]|0;}c=(b<<24>>24)+-48|0;if(c>>>0<10){b=0;do{d=d+1|0;b=(b*10|0)-c|0;c=(a[d>>0]|0)+-48|0;}while(c>>>0<10)}else b=0;return (h|0?b:0-b|0)|0}function r5(a){a=a|0;return +(+s5(a,0))}function s5(a,b){a=a|0;b=b|0;return +(+t5(a,b,1))}function t5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,g=0,h=0,i=0;i=l;l=l+128|0;h=i;f=h;g=f+124|0;do{c[f>>2]=0;f=f+4|0;}while((f|0)<(g|0));f=h+4|0;c[f>>2]=a;g=h+8|0;c[g>>2]=-1;c[h+44>>2]=a;c[h+76>>2]=-1;W2(h,0);e=+i5(h,d,1);d=(c[f>>2]|0)-(c[g>>2]|0)+(c[h+108>>2]|0)|0;if(b|0)c[b>>2]=d|0?a+d|0:a;l=i;return +e}function u5(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if(!c)b=0;else {h=b;while(1){g=c>>>1;b=h+(O(g,d)|0)|0;f=lb[e&127](a,b)|0;if(!f)break a;if((c|0)==1){b=0;break a}f=(f|0)<0;c=f?g:c-g|0;if(!c){b=0;break}else h=f?h:b;}}while(0);return b|0}function v5(a,c){a=a|0;c=c|0;var d=0,f=0,g=0;g=a+2|0;f=a+4|0;d=I6((e[c+2>>1]|0)<<16|(e[c>>1]|0)|0,e[c+4>>1]|0|0,(e[g>>1]|0)<<16|(e[a>>1]|0)|0,e[f>>1]|0|0)|0;c=J6(d|0,z|0,e[c+6>>1]|0|0,0)|0;d=z;b[a>>1]=c;a=Q6(c|0,d|0,16)|0;b[g>>1]=a;b[f>>1]=d;z=d&65535;return c|0}function w5(a){a=a|0;var b=0;b=186608;c[b>>2]=a+-1;c[b+4>>2]=0;return}function x5(){var a=0,b=0,d=0;b=186608;b=I6(c[b>>2]|0,c[b+4>>2]|0,1284865837,1481765933)|0;b=J6(b|0,z|0,1,0)|0;a=z;d=186608;c[d>>2]=b;c[d+4>>2]=a;a=Q6(b|0,a|0,33)|0;return a|0}function y5(a){a=a|0;b[96876]=b[32922]|0;b[96877]=b[32923]|0;b[96878]=b[32924]|0;b[32922]=b[a>>1]|0;b[32923]=b[a+2>>1]|0;b[32924]=b[a+4>>1]|0;return 193752}function z5(a){a=a|0;var c=0,d=0;c=l;l=l+16|0;d=c;b[d>>1]=13070;b[d+2>>1]=a;b[d+4>>1]=a>>>16;y5(d)|0;l=c;return}function A5(a){a=a|0;var b=0;b=v5(a,65850)|0;b=R6(b|0,z|0,4)|0;a=z|1072693248;c[j>>2]=b;c[j+4>>2]=a;return +(+h[j>>3]+-1.0)}function B5(){return +(+A5(65844))}function C5(a,b){a=a|0;b=b|0;if(!a)b=V1(1,24)|0;else {c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;}return b|0}function D5(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(b|0)do{U1(c[b>>2]|0);d=b;b=c[b+4>>2]|0;U1(d);}while((b|0)!=0);U1(a);return}function E5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;h=a+16|0;a:do if(!(c[h>>2]|0)){k=a+12|0;g=c[k>>2]|0;if(g>>>0>>0){do if(b)if(!d){c[h>>2]=1;b=0;break a}else {h=a+8|0;c[h>>2]=d;g=1024;b=d;break}else {g=f<<3;g=g>>>0>1024?g:1024;j=T1(8)|0;if(!j){c[h>>2]=1;b=0;break a}b=T1(g)|0;c[j>>2]=b;d=b;if(!b){U1(j);c[h>>2]=1;b=0;break a}c[j+4>>2]=0;h=a+4|0;i=c[h>>2]|0;if(i|0)c[i+4>>2]=j;if(!(c[a>>2]|0))c[a>>2]=j;c[h>>2]=j;h=a+8|0;c[h>>2]=d;}while(0);c[k>>2]=g;}else {h=a+8|0;b=c[h>>2]|0;d=b;}d=d+f&3;d=((d|0)==0?0:4-d|0)+f|0;c[h>>2]=b+d;c[k>>2]=g-d;if(e)Y6(b|0,0,d|0)|0;}else b=0;while(0);return b|0}function F5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;v=l;l=l+48|0;i=v;t=G5()|0;a:do if(!t)b=12;else {u=C5(0,0)|0;if(!u){H5(t);b=12;break}e=i+8|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[i>>2]=u;c[i+4>>2]=t;c[i+16>>2]=b;c[i+32>>2]=d;e=i+28|0;c[e>>2]=-1;b=I5(i)|0;b:do if(!b){h=i+20|0;f=c[h>>2]|0;c[a>>2]=f+-1;j=c[i+8>>2]|0;b=c[e>>2]|0;if((b|0)<(f|0)){g=V1(1,68)|0;if(g){r=b>>>31^1;c[g+60>>2]=r;c[g+28>>2]=f;if((d&8|0)==0|(r|0)!=0){b=J5(0,t,j,g)|0;if(b|0){h=0;i=0;f=0;e=0;break}f=c[g+40>>2]|0;if((f|0)>0){b=(f<<2)+4|0;e=T1(b)|0;if(!e){h=0;i=0;b=12;f=0;e=0;break}c[g+32>>2]=e;Y6(e|0,-1,b|0)|0;}else e=0;r=V1(f<<1|1,4)|0;c[g+36>>2]=r;if(!r){h=0;i=0;b=12;f=0;e=0;break}b=V1(c[h>>2]|0,12)|0;if(!b){h=0;i=0;b=12;f=0;e=0;break}c[g+16>>2]=b;b=J5(u,t,j,g)|0;if(!b)b=e;else {h=0;i=0;f=0;e=0;break}}else b=0;r=i+24|0;b=K5(u,t,j,r,b)|0;if(!b){b=c[r>>2]|0;c[r>>2]=b+1;b=L5(u,0,0,b)|0;if((b|0)!=0?(s=M5(u,j,b)|0,(s|0)!=0):0){b=N5(u,t,s)|0;if(!b){e=c[r>>2]|0;b=e<<2;p=T1(b)|0;if(p){q=T1(b)|0;if(q){if((e|0)>0)Y6(p|0,0,e<<2|0)|0;O5(s,0,p,0)|0;f=c[r>>2]|0;if((f|0)>0){b=0;e=0;do{c[q+(e<<2)>>2]=b;o=p+(e<<2)|0;b=b+1+(c[o>>2]|0)|0;c[o>>2]=0;e=e+1|0;}while((e|0)<(f|0));m=b;}else m=0;n=V1(m+1|0,32)|0;if(n){c[g>>2]=n;o=g+4|0;c[o>>2]=m;b=O5(s,n,p,q)|0;if(!b){c[g+20>>2]=0;f=s+24|0;b=c[f>>2]|0;e=0;while(1){e=e+1|0;if((c[b>>2]|0)<=-1)break;else b=b+32|0;}k=V1(e,32)|0;if(!k){h=p;i=q;b=12;f=p;e=q;}else {c[g+8>>2]=k;e=c[f>>2]|0;f=c[e>>2]|0;if((f|0)>-1){b=0;do{c[k+(b<<5)+8>>2]=n+(c[q+(f<<2)>>2]<<5);c[k+(b<<5)+12>>2]=f;i=k+(b<<5)+16|0;c[i>>2]=0;j=e+12|0;h=c[j>>2]|0;if(h|0){f=0;do{w=f;f=f+1|0;}while((c[h+(w<<2)>>2]|0)>-1);f=f<<2;h=T1(f)|0;c[i>>2]=h;if(!h){h=p;i=q;b=12;f=p;e=q;break b}W6(h|0,c[j>>2]|0,f|0)|0;}c[k+(b<<5)+20>>2]=c[e+16>>2];b=b+1|0;e=e+32|0;f=c[e>>2]|0;}while((f|0)>-1)}else b=0;c[k+(b<<5)+8>>2]=0;c[o>>2]=m;c[g+12>>2]=n+(c[q+(c[c[s+28>>2]>>2]<<2)>>2]<<5);c[g+52>>2]=c[r>>2];c[g+56>>2]=d;D5(u);H5(t);U1(p);U1(q);c[a+4>>2]=g;b=0;break a}}else {h=p;i=q;f=p;e=q;}}else {h=p;i=q;b=12;f=p;e=q;}}else {h=p;i=q;b=12;f=p;e=0;}}else {h=p;i=0;b=12;f=0;e=0;}}else {h=0;i=0;f=0;e=0;}}else {h=0;i=0;b=12;f=0;e=0;}}else {h=0;i=0;f=0;e=0;}}else {h=0;i=0;b=12;f=0;e=0;}}else {g=0;h=0;i=0;b=6;f=0;e=0;}}else {g=0;h=0;i=0;f=0;e=0;}while(0);D5(u);H5(t);if(h|0)U1(f);if(i|0)U1(e);c[a+4>>2]=g;P5(a);}while(0);l=v;return b|0}function G5(){var a=0,b=0;a=T1(20)|0;do if(a){b=T1(2048)|0;c[a+16>>2]=b;if(!b){U1(a);a=0;break}else {c[a>>2]=512;c[a+4>>2]=1024e3;c[a+8>>2]=128;c[a+12>>2]=0;break}}while(0);return a|0}function H5(a){a=a|0;U1(c[a+16>>2]|0);U1(a);return}function I5(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;u=l;l=l+16|0;p=u+4|0;q=u;r=c[b+32>>2]&1;s=b+16|0;e=c[s>>2]|0;t=c[b+4>>2]|0;d=T5(t,0)|0;a:do if(!d){m=(r|0)!=0;n=b+8|0;o=b+12|0;d=0;k=1;b:while(1){g=0;h=d;f=0;c:while(1){d=a[e>>0]|0;if(m){if(d<<24>>24==40)break;if((h|0)!=0&d<<24>>24==41)j=13;else j=14;}else if(d<<24>>24==92)switch(a[e+1>>0]|0){case 40:break c;case 41:{j=13;break}default:j=14;}else j=14;if((j|0)==13){j=0;i=L5(c[b>>2]|0,-1,-1,-1)|0;c[n>>2]=i;if(!i){d=12;break a}else i=f;}else if((j|0)==14){j=0;d=g6(b,e)|0;if(d|0)break a;i=f;e=c[o>>2]|0;}d:while(1){e:while(1){d=a[e>>0]|0;switch(d<<24>>24){case 42:case 92:break;default:{if(!m)break e;switch(d<<24>>24){case 123:case 63:case 43:break;default:break e}}}d=d<<24>>24==92;if(m&d)break;f=e+1|0;if(d)switch(a[f>>0]|0){case 123:case 63:case 43:break;default:break e}e=d?f:e;if((!m?(e|0)==((c[s>>2]|0)+1|0):0)?(a[e+-1>>0]|0)==94:0)break;if((a[e>>0]|0)==123){e=h6(e+1|0,r,p,q)|0;if(!e){j=28;break b}d=c[q>>2]|0;f=c[b>>2]|0;if(!d)d=L5(f,-1,-1,-1)|0;else j=36;}else {c[p>>2]=0;c[q>>2]=-1;d=a[e>>0]|0;if(d<<24>>24==43){c[p>>2]=1;d=a[e>>0]|0;}if(d<<24>>24==63){c[q>>2]=1;d=1;}else d=-1;e=e+1|0;f=c[b>>2]|0;j=36;}if((j|0)==36){j=0;d=b6(f,c[n>>2]|0,c[p>>2]|0,d,0)|0;}c[n>>2]=d;if(!d){d=12;break a}}d=M5(c[b>>2]|0,g,c[n>>2]|0)|0;f=a[e>>0]|0;f:do if(m){if(f<<24>>24==124){j=40;break d}if((h|0)!=0&f<<24>>24==41|f<<24>>24==0)j=47;else {g=d;f=i;continue c}}else {switch(f<<24>>24){case 0:{j=47;break f}case 92:break;default:{g=d;f=i;continue c}}switch(a[e+1>>0]|0){case 124:case 41:break;default:{g=d;f=i;continue c}}d=c6(c[b>>2]|0,i,d)|0;if((a[e+1>>0]|0)==124){f=2;break d}if(!h){d=8;break a}e=e+2|0;f=92;}while(0);if((j|0)==47){j=0;d=c6(c[b>>2]|0,i,d)|0;e=f<<24>>24==41?e+1|0:e;}d=i6(b,d,U5(t)|0)|0;if(d|0)break a;d=f<<24>>24==0;f=(h|0)<1;if(f&d){j=50;break b}if(f|d){d=8;break a}g=V5(t)|0;h=h+-1|0;i=V5(t)|0;}if((j|0)==40){f=1;d=c6(c[b>>2]|0,i,d)|0;}g=0;e=e+f|0;f=d;}d=S5(t,f)|0;if(d|0)break a;d=S5(t,g)|0;if(d|0)break a;d=T5(t,k)|0;if(d|0)break a;d=h+1|0;k=k+1|0;e=m?e+1|0:e+2|0;}if((j|0)==28){d=10;break}else if((j|0)==50){c[b+20>>2]=k;d=0;break}}while(0);l=u;return d|0}function J5(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;x=R5(d)|0;y=(b|0)==0|(f|0)==0;if(!y){c[f+48>>2]=0;c[c[f+36>>2]>>2]=-1;}h=c[f+28>>2]|0;z=T1((h<<3)+8|0)|0;do if(!z)g=12;else {c[z>>2]=-1;A=T1((h<<2)+4|0)|0;if(!A){U1(z);g=12;break}c[A>>2]=-1;g=0;while(1)if(g>>>0>h>>>0)break;else g=g+1|0;S5(d,e)|0;g=T5(d,0)|0;a:do if((g|0)!=0|(R5(d)|0)<=(x|0)){e=z;n=0;h=0;m=0;l=-1;}else {u=f+32|0;v=f+36|0;w=f+16|0;e=z;n=0;h=0;m=0;t=1;l=-1;s=0;while(1){b:do switch(U5(d)|0){case 6:{i=U5(d)|0;g=0;do{j=e+(g<<2)|0;g=g+1|0;}while((c[j>>2]|0)>-1);c[j>>2]=i<<1|1;c[e+(g<<2)>>2]=-1;g=0;while(1)if((c[A+(g<<2)>>2]|0)>-1)g=g+1|0;else break;c[A+(g+-1<<2)>>2]=-1;g=0;j=t;i=s;break}case 0:{q=V5(d)|0;r=q+12|0;j=c[r>>2]|0;if((j|0)>-1){g=0;do{i=e+(g<<2)|0;g=g+1|0;}while((c[i>>2]|0)>-1);c[i>>2]=j<<1;c[e+(g<<2)>>2]=-1;if(!y){g=0;while(1)if((c[A+(g<<2)>>2]|0)>-1)g=g+1|0;else break;i=(c[w>>2]|0)+(j*12|0)+8|0;c[i>>2]=0;if((g|0)>0){g=T1((g<<2)+4|0)|0;if(!g){g=12;j=t;i=s;break b}c[i>>2]=g;i=c[A>>2]|0;if((i|0)>-1){k=0;j=g;do{c[j>>2]=i;k=k+1|0;i=c[A+(k<<2)>>2]|0;j=g+(k<<2)|0;}while((i|0)>-1);g=j;}c[g>>2]=-1;}}g=T5(d,c[r>>2]|0)|0;if(g|0){j=t;i=s;break b}g=T5(d,6)|0;if(g|0){j=t;i=s;break b}}c:do switch(c[q>>2]|0){case 0:{p=c[c[q+4>>2]>>2]|0;if((p|0)>-1|(p|0)==-4?(c[e>>2]|0)>-1:0){if(y){c[q+20>>2]=1;g=0;}else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=s;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;p=t+1|0;o=s;n=n+1|0;m=t;}else {p=t;g=0;o=s;}break}case 1:{j=c[q+4>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;g=S5(d,q)|0;if(!g){g=T5(d,5)|0;if(!g){g=S5(d,j)|0;if(!g){g=T5(d,0)|0;if(!g){i=k+20|0;g=T5(d,(c[i>>2]|0)+t|0)|0;if(!g){if((c[i>>2]|0)>0){i=(c[j+20>>2]|0)>0;g=i?t:-1;i=t+(i&1)|0;}else {g=-1;i=t;}g=T5(d,g)|0;if(!g){g=T5(d,4)|0;if(!g){g=S5(d,k)|0;if(!g){p=i;g=T5(d,0)|0;o=s;}else {p=i;o=s;}}else {p=i;o=s;}}else {p=i;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}case 2:{i=c[q+4>>2]|0;if(y){if((c[e>>2]|0)>-1)g=1;else g=(a[i+12>>0]&1)!=0;g=T5(d,g&1)|0;if(g|0){p=t;o=s;break c}}else {g=T5(d,m)|0;if(g|0){p=t;o=s;break c}g=T5(d,a[i+12>>0]&1)|0;if(g|0){p=t;o=s;break c}}g=S5(d,q)|0;if(!g){g=T5(d,1)|0;if(!g){g=S5(d,c[i>>2]|0)|0;if(!g){g=T5(d,0)|0;if(!g){if((c[e>>2]|0)<=-1?(a[i+12>>0]&1)==0:0){p=t;g=0;o=0;break c}if(y)g=0;else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=(a[i+12>>0]&1)==0?s:1;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;p=t+1|0;o=0;n=n+1|0;m=t;}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}case 3:{j=c[q+4>>2]|0;k=c[j>>2]|0;j=c[j+4>>2]|0;i=(c[e>>2]|0)>-1;p=t+1|0;g=T5(d,i?p:t)|0;if(!g){g=T5(d,i?t:m)|0;if(!g){g=S5(d,e)|0;if(!g){g=T5(d,(c[e>>2]|0)>>>31^1)|0;if(!g){g=S5(d,q)|0;if(!g){g=S5(d,j)|0;if(!g){g=S5(d,k)|0;if(!g){g=T5(d,3)|0;if(!g){g=S5(d,j)|0;if(!g){g=T5(d,0)|0;if(!g){g=T5(d,2)|0;if(g|0){p=t;o=s;break c}g=S5(d,k)|0;if(g|0){p=t;o=s;break c}g=T5(d,0)|0;if(g|0){p=t;o=s;break c}if((c[e>>2]|0)>-1){if(y)g=0;else {g=d6(b,q,m)|0;c[(c[u>>2]|0)+(m<<2)>>2]=s;if((l|0)>-1){j=c[v>>2]|0;i=0;while(1){k=j+(i<<2)|0;o=i+1|0;if((c[k>>2]|0)>-1)i=o;else break}c[k>>2]=m;c[j+(o<<2)>>2]=l;c[j+(i+2<<2)>>2]=-1;h=h+1|0;l=-1;}e6(e,f,m);}c[e>>2]=-1;n=n+1|0;m=t;i=p;}else {g=0;i=t;}t=(c[q+16>>2]|0)>0;p=t?i+2|0:i;o=s;m=t?i+1|0:m;}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}}else {p=t;o=s;}break}default:{p=t;g=0;o=s;}}while(0);j=c[r>>2]|0;if((j|0)>-1){i=0;do{k=A+(i<<2)|0;i=i+1|0;}while((c[k>>2]|0)>-1);c[k>>2]=j;c[A+(i<<2)>>2]=-1;j=p;i=o;}else {j=p;i=o;}break}case 1:{g=V5(d)|0;if(y){i=c[(c[c[g+4>>2]>>2]|0)+20>>2]|0;c[g+20>>2]=(U5(d)|0)+i;i=0;l=-1;}else {q=U5(d)|0;r=U5(d)|0;i=q;l=(q|0)==0?l:r;}g=0;j=t;i=y?s:(i|0)==0&1;break}case 4:{i=U5(d)|0;j=U5(d)|0;g=0;m=(i|0)>-1?i:m;i=s;break}case 5:{g=V5(d)|0;if(y){j=c[g+4>>2]|0;c[g+20>>2]=(c[(c[j+4>>2]|0)+20>>2]|0)+(c[(c[j>>2]|0)+20>>2]|0);g=0;j=t;i=s;}else {g=0;j=t;i=s;}break}case 2:{while(1)if((c[e>>2]|0)>-1)e=e+4|0;else {g=0;j=t;i=s;break}break}case 3:{j=V5(d)|0;o=V5(d)|0;g=V5(d)|0;e=U5(d)|0;if(y){r=c[g+4>>2]|0;s=g+16|0;c[g+20>>2]=(c[(c[r>>2]|0)+20>>2]|0)+e+(c[(c[r+4>>2]|0)+20>>2]|0)+((c[s>>2]|0)>0?2:0);g=s;}else g=g+16|0;e=V5(d)|0;i=U5(d)|0;k=U5(d)|0;if((c[g>>2]|0)>0){if(y)g=0;else {g=f6(b,j,i)|0;c[(c[u>>2]|0)+(i<<2)>>2]=1;if(!g)g=f6(b,o,k)|0;c[(c[u>>2]|0)+(k<<2)>>2]=1;}n=n+2|0;j=t;i=1;}else {g=0;j=t;i=1;}break}default:{g=0;j=t;i=s;}}while(0);if((g|0)!=0|(R5(d)|0)<=(x|0))break a;else {t=j;s=i;}}}while(0);if(!y?(e6(e,f,m),(l|0)>-1):0){i=c[f+36>>2]|0;e=0;while(1){j=i+(e<<2)|0;k=e+1|0;if((c[j>>2]|0)>-1)e=k;else break}c[j>>2]=m;c[i+(k<<2)>>2]=l;c[i+(e+2<<2)>>2]=-1;h=h+1|0;}c[f+48>>2]=n;c[f+40>>2]=n;c[f+44>>2]=h;U1(z);U1(A);}while(0);return g|0}function K5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;y=l;l=l+16|0;t=y+12|0;x=y+8|0;u=y+4|0;v=y;w=R5(b)|0;c[t>>2]=0;c[x>>2]=0;d=S5(b,d)|0;a:do if(!d){d=T5(b,0)|0;if(!d){b:do if((R5(b)|0)>(w|0)){g=0;i=0;j=0;c:while(1){q=U5(b)|0;r=V5(b)|0;d:do switch(q|0){case 0:{switch(c[r>>2]|0){case 0:{d=c[r+4>>2]|0;r=c[d>>2]|0;if(!((r|0)>-1|(r|0)==-4)){d=j;break d}r=d+8|0;d=(c[r>>2]|0)+j|0;c[r>>2]=d;if((d|0)<=(c[x>>2]|0)){d=j;break d}c[x>>2]=d;d=j;break d}case 3:{h=c[r+4>>2]|0;d=S5(b,c[h+4>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;break}case 1:{h=c[r+4>>2]|0;d=S5(b,c[h+4>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;break}case 2:{h=c[r+4>>2]|0;d=T5(b,j)|0;if(d|0)break b;d=S5(b,r)|0;if(d|0)break b;d=T5(b,1)|0;if(d|0)break b;d=S5(b,c[h>>2]|0)|0;if(d|0)break b;d=T5(b,0)|0;if(d|0)break b;if((c[h+4>>2]|0)<=1?(c[h+8>>2]|0)<=1:0)d=j;else {c[t>>2]=0;d=0;}i=i+1|0;break d}default:{d=j;break d}}d=T5(b,0)|0;if(!d)d=j;else break b;break}case 1:{p=r+4|0;o=c[p>>2]|0;q=U5(b)|0;c[t>>2]=q;n=o+4|0;j=c[n>>2]|0;if((j|0)<=1)if((c[o+8>>2]|0)>1){c[u>>2]=0;if((j|0)>0)s=30;else {d=q;h=0;s=37;}}else d=q;else {c[u>>2]=0;s=30;}e:do if((s|0)==30){d=a6(a,b,c[o>>2]|0,(j|0)>1?1:2,t,f,v,x)|0;if(!d){h=0;k=q;m=1;}else {s=34;break c}while(1){d=c[v>>2]|0;if(!h)h=d;else h=M5(a,h,d)|0;if(!h){d=12;s=34;break c}j=c[n>>2]|0;if((m|0)>=(j|0)){d=k;s=37;break e}k=c[t>>2]|0;m=m+1|0;d=a6(a,b,c[o>>2]|0,(m|0)<(j|0)?1:2,t,f,v,x)|0;if(d|0){s=34;break c}}}while(0);if((s|0)==37){s=0;n=o+8|0;k=c[n>>2]|0;if((k|0)==-1){k=c[t>>2]|0;d=a6(a,b,c[o>>2]|0,0,t,0,u,x)|0;if(d|0)break c;j=b6(a,c[u>>2]|0,0,-1,0)|0;c[u>>2]=j;if(!j){d=12;break c}else d=k;}else if((j|0)<(k|0)){k=j;j=0;while(1){m=c[t>>2]|0;d=a6(a,b,c[o>>2]|0,0,t,0,v,x)|0;if(d|0){s=49;break c}if(!j){d=c[v>>2]|0;c[u>>2]=d;}else {d=M5(a,c[v>>2]|0,j)|0;c[u>>2]=d;}if(!d){d=12;s=49;break c}j=L5(a,-1,-1,-1)|0;if(!j){d=12;s=49;break c}j=c6(a,j,d)|0;c[u>>2]=j;if(!j){d=12;s=49;break c}k=k+1|0;if((k|0)>=(c[n>>2]|0)){d=m;break}}}else j=0;c[t>>2]=d;if(h){if(j){h=M5(a,h,j)|0;s=54;}}else {h=j;s=54;}if((s|0)==54){s=0;if(!h){d=12;break c}}c[p>>2]=c[h+4>>2];c[r>>2]=c[h>>2];}i=i+-1|0;h=d-q+g|0;if(!i){c[t>>2]=h;g=h;i=0;d=h;}else g=h;break}default:d=j;}while(0);if((R5(b)|0)>(w|0))j=d;else {d=0;break b}}break a}else {d=0;g=0;}while(0);w=(c[e>>2]|0)+g|0;x=c[x>>2]|0;c[e>>2]=(x|0)>(w|0)?x:w;}}while(0);l=y;return d|0}function L5(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=E5(a,0,0,1,20)|0;a=$5(a,0,f)|0;if(!a)a=0;else {c[f>>2]=b;c[f+4>>2]=d;c[f+8>>2]=e;}return a|0}function M5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(b){e=E5(a,0,0,1,8)|0;a=$5(a,1,e)|0;if(!a)d=0;else {c[e>>2]=b;c[e+4>>2]=d;c[a+16>>2]=(c[d+16>>2]|0)+(c[b+16>>2]|0);d=a;}}return d|0}function N5(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0;o=l;l=l+16|0;j=o+4|0;k=o;m=R5(b)|0;d=S5(b,d)|0;a:do if(!d){d=T5(b,0)|0;if(!d)if((R5(b)|0)>(m|0)){b:while(1){h=U5(b)|0;i=V5(b)|0;c:do switch(h|0){case 0:switch(c[i>>2]|0){case 0:{g=c[i+4>>2]|0;f=c[g>>2]|0;if((f|0)==-4){c[i+8>>2]=0;d=g+8|0;h=W5(a,c[d>>2]|0,0,1114111,0,0,-1)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=W5(a,c[d>>2]|0,0,1114111,0,0,c[g+4>>2]|0)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}d=i+8|0;if((f|0)<0){c[d>>2]=1;h=X5(a)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=X5(a)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}else {c[d>>2]=0;d=g+8|0;e=g+4|0;h=W5(a,c[d>>2]|0,f,c[e>>2]|0,0,0,-1)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=W5(a,c[d>>2]|0,c[g>>2]|0,c[e>>2]|0,c[g+12>>2]|0,c[g+16>>2]|0,-1)|0;c[i+28>>2]=h;if(!h){d=12;break a}else break c}}case 3:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,1)|0;if(d|0)break a;e=i+4|0;d=S5(b,c[(c[e>>2]|0)+4>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(d|0)break a;d=S5(b,c[c[e>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}case 1:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,2)|0;if(d|0)break a;e=i+4|0;d=S5(b,c[(c[e>>2]|0)+4>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(d|0)break a;d=S5(b,c[c[e>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}case 2:{d=S5(b,i)|0;if(d|0)break a;d=T5(b,3)|0;if(d|0)break a;d=S5(b,c[c[i+4>>2]>>2]|0)|0;if(d|0)break a;d=T5(b,0)|0;if(!d)break c;else break a}default:break c}case 1:{d=c[i+4>>2]|0;e=c[d>>2]|0;f=d+4|0;g=c[f>>2]|0;if(!(c[e+8>>2]|0))h=(c[g+8>>2]|0)!=0;else h=1;c[i+8>>2]=h&1;h=Y5(a,c[e+24>>2]|0,c[g+24>>2]|0,0,0)|0;c[i+24>>2]=h;if(!h){d=12;break a}h=Y5(a,c[(c[d>>2]|0)+28>>2]|0,c[(c[f>>2]|0)+28>>2]|0,0,0)|0;c[i+28>>2]=h;if(!h){d=12;break a}break}case 3:{h=c[i+4>>2]|0;d=c[h>>2]|0;if(!(c[h+4>>2]|0))e=1;else e=(c[d+8>>2]|0)!=0&1;c[i+8>>2]=e;c[i+24>>2]=c[d+24>>2];c[i+28>>2]=c[d+28>>2];break}case 2:{g=c[i+4>>2]|0;d=c[g>>2]|0;e=d+8|0;if(!(c[e>>2]|0))f=0;else f=(c[(c[g+4>>2]|0)+8>>2]|0)!=0;c[i+8>>2]=f&1;if(c[e>>2]|0){d=Z5(b,d,0,0,j)|0;if(d|0)break b;e=T1((c[j>>2]<<2)+4|0)|0;if(!e){d=12;break b}c[e>>2]=-1;c[k>>2]=0;d=Z5(b,c[g>>2]|0,e,k,0)|0;if(d|0){n=45;break b}d=g+4|0;h=i+24|0;c[h>>2]=Y5(a,c[(c[d>>2]|0)+24>>2]|0,c[(c[g>>2]|0)+24>>2]|0,e,c[k>>2]|0)|0;U1(e);if(!(c[h>>2]|0)){d=12;break b}else f=d;}else {c[i+24>>2]=c[d+24>>2];f=g+4|0;}d=c[f>>2]|0;if(c[d+8>>2]|0){d=Z5(b,d,0,0,j)|0;if(d|0)break b;e=T1((c[j>>2]<<2)+4|0)|0;if(!e){d=12;break b}c[e>>2]=-1;c[k>>2]=0;d=Z5(b,c[f>>2]|0,e,k,0)|0;if(d|0){n=52;break b}i=i+28|0;c[i>>2]=Y5(a,c[(c[g>>2]|0)+28>>2]|0,c[(c[f>>2]|0)+28>>2]|0,e,c[k>>2]|0)|0;U1(e);if(!(c[i>>2]|0)){d=12;break b}}else c[i+28>>2]=c[d+28>>2];break}default:{}}while(0);if((R5(b)|0)<=(m|0)){d=0;break a}}if((n|0)==45)U1(e);else if((n|0)==52)U1(e);}else d=0;}while(0);l=o;return d|0}function O5(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:while(1){switch(c[a>>2]|0){case 2:{a=c[a+4>>2]|0;if((c[a+8>>2]|0)==-1?(h=c[a>>2]|0,h=Q5(c[h+28>>2]|0,c[h+24>>2]|0,b,d,e)|0,(h|0)!=0):0){a=h;break a}break}case 3:{f=c[a+4>>2]|0;a=O5(c[f>>2]|0,b,d,e)|0;if(a|0)break a;a=f+4|0;break}case 1:{f=c[a+4>>2]|0;g=f+4|0;a=Q5(c[(c[f>>2]|0)+28>>2]|0,c[(c[g>>2]|0)+24>>2]|0,b,d,e)|0;if(a|0)break a;a=O5(c[f>>2]|0,b,d,e)|0;if(!a)a=g;else break a;break}default:{a=0;break a}}a=c[a>>2]|0;}return a|0}function P5(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;h=c[a+4>>2]|0;if(h|0){e=h+4|0;a=c[h>>2]|0;if(c[e>>2]|0){d=0;do{if(c[a+(d<<5)+8>>2]|0){b=c[a+(d<<5)+16>>2]|0;if(b){U1(b);a=c[h>>2]|0;}b=c[a+(d<<5)+28>>2]|0;if(b){U1(b);a=c[h>>2]|0;}}d=d+1|0;}while(d>>>0<(c[e>>2]|0)>>>0)}if(a|0)U1(a);d=h+8|0;a=c[d>>2]|0;if(a|0){if(c[a+8>>2]|0){while(1){b=c[a+16>>2]|0;if(b|0)U1(b);if(!(c[a+40>>2]|0))break;else a=a+32|0;}a=c[d>>2]|0;}U1(a);}f=h+16|0;a=c[f>>2]|0;if(a|0){g=h+28|0;b=c[g>>2]|0;if(b){e=0;do{d=c[a+(e*12|0)+8>>2]|0;if(d){U1(d);b=c[g>>2]|0;a=c[f>>2]|0;}e=e+1|0;}while(e>>>0>>0)}U1(a);}a=c[h+32>>2]|0;if(a|0)U1(a);a=c[h+20>>2]|0;if(a|0)U1(a);a=c[h+36>>2]|0;if(a|0)U1(a);U1(h);}return}function Q5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=c[a>>2]|0;h=(g|0)>-1;a:do if(!d)if(h){h=b+32|0;do{if((c[b>>2]|0)>-1?(y=e+(g<<2)|0,c[y>>2]=(c[y>>2]|0)+1,(c[h>>2]|0)>-1):0){g=h;do{y=e+(c[a>>2]<<2)|0;c[y>>2]=(c[y>>2]|0)+1;g=g+32|0;}while((c[g>>2]|0)>-1)}a=a+32|0;g=c[a>>2]|0;}while((g|0)>-1);g=0;}else g=0;else if(h)while(1){h=c[b>>2]|0;b:do if((h|0)>-1){p=a+4|0;q=a+8|0;r=a+16|0;s=a+20|0;t=a+24|0;u=a+28|0;v=a+12|0;e=-1;g=b;while(1){o=h;while(1){if((o|0)!=(e|0))break;g=g+32|0;h=c[g>>2]|0;if((h|0)>-1)o=h;else break b}l=d+(c[f+(c[a>>2]<<2)>>2]<<5)|0;while(1){h=l+8|0;if(!(c[h>>2]|0))break;else l=l+32|0;}c[l+40>>2]=0;c[l>>2]=c[p>>2];c[l+4>>2]=c[q>>2];c[h>>2]=d+(c[f+(o<<2)>>2]<<5);c[l+12>>2]=o;h=c[s>>2]|0;e=c[g+16>>2]|c[r>>2]|(h|0?4:0)|(c[t>>2]|0?8:0);i=l+20|0;c[i>>2]=e;j=c[u>>2]|0;if((j|0)>-1){c[i>>2]=e|256;h=j;}c[l+24>>2]=h;e=c[t>>2]|0;if(!e)c[l+28>>2]=0;else {h=0;do{n=h;h=h+1|0;}while((c[e+(n<<2)>>2]|0)!=0);h=T1(h<<2)|0;c[l+28>>2]=h;if(!h){g=12;break a}k=c[t>>2]|0;e=c[k>>2]|0;if(e){j=0;i=h;do{c[i>>2]=e;j=j+1|0;e=c[k+(j<<2)>>2]|0;i=h+(j<<2)|0;}while((e|0)!=0);h=i;}c[h>>2]=0;}e=c[v>>2]|0;if(!e)h=0;else {h=0;while(1)if((c[e+(h<<2)>>2]|0)>-1)h=h+1|0;else break}k=g+12|0;i=c[k>>2]|0;if(!i)e=0;else {e=0;while(1)if((c[i+(e<<2)>>2]|0)>-1)e=e+1|0;else break}j=l+16|0;i=c[j>>2]|0;if(i|0)U1(i);c[j>>2]=0;h=e+h|0;if((h|0)>0){n=T1((h<<2)+4|0)|0;c[j>>2]=n;if(!n){g=12;break a}e=c[v>>2]|0;if((e|0)!=0?(w=c[e>>2]|0,(w|0)>-1):0){h=0;i=w;do{c[n+(h<<2)>>2]=i;h=h+1|0;i=c[e+(h<<2)>>2]|0;}while((i|0)>-1);m=h;}else m=0;j=c[k>>2]|0;if((j|0)!=0?(x=c[j>>2]|0,(x|0)>-1):0){k=(m|0)>0;h=m;i=0;l=x;do{c:do if(k){e=0;while(1){if((c[n+(e<<2)>>2]|0)==(l|0))break c;e=e+1|0;if((e|0)>=(m|0)){y=39;break}}}else y=39;while(0);if((y|0)==39){y=0;c[n+(h<<2)>>2]=l;h=h+1|0;}i=i+1|0;l=c[j+(i<<2)>>2]|0;}while((l|0)>-1)}else h=m;c[n+(h<<2)>>2]=-1;}g=g+32|0;h=c[g>>2]|0;if((h|0)<=-1)break;else e=o;}}while(0);a=a+32|0;if((c[a>>2]|0)<=-1){g=0;break}}else g=0;while(0);return g|0}function R5(a){a=a|0;return c[a+12>>2]|0}function S5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d+4|0;f=d;c[f>>2]=b;c[e>>2]=c[f>>2];b=_5(a,e)|0;l=d;return b|0}function T5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=l;l=l+16|0;e=d+4|0;f=d;c[f>>2]=b;c[e>>2]=c[f>>2];b=_5(a,e)|0;l=d;return b|0}function U5(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;d=a+12|0;a=(c[d>>2]|0)+-1|0;c[d>>2]=a;return c[b+(a<<2)>>2]|0}function V5(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;d=a+12|0;a=(c[d>>2]|0)+-1|0;c[d>>2]=a;return c[b+(a<<2)>>2]|0}function W5(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;a=E5(a,0,0,1,64)|0;if(!a)a=0;else {c[a>>2]=b;c[a+4>>2]=d;c[a+8>>2]=e;c[a+20>>2]=f;c[a+24>>2]=g;c[a+28>>2]=h;c[a+32>>2]=-1;c[a+36>>2]=-1;c[a+40>>2]=-1;}return a|0}function X5(a){a=a|0;a=E5(a,0,0,1,32)|0;if(!a)a=0;else {c[a>>2]=-1;c[a+4>>2]=-1;c[a+8>>2]=-1;}return a|0}function Y5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=(e|0)==0;if(o)n=0;else {g=0;while(1)if((c[e+(g<<2)>>2]|0)>-1)g=g+1|0;else {n=g;break}}h=0;while(1)if((c[b+(h<<5)>>2]|0)>-1)h=h+1|0;else {g=0;break}while(1)if((c[d+(g<<5)>>2]|0)>-1)g=g+1|0;else break;g=E5(a,0,0,1,(g+h<<5)+32|0)|0;a:do if(!g)g=0;else {h=c[b>>2]|0;if((h|0)>-1){m=(n|0)>0;i=0;while(1){c[g+(i<<5)>>2]=h;c[g+(i<<5)+4>>2]=c[b+(i<<5)+4>>2];c[g+(i<<5)+8>>2]=c[b+(i<<5)+8>>2];c[g+(i<<5)+16>>2]=c[b+(i<<5)+16>>2]|f;c[g+(i<<5)+20>>2]=c[b+(i<<5)+20>>2];c[g+(i<<5)+24>>2]=c[b+(i<<5)+24>>2];c[g+(i<<5)+28>>2]=c[b+(i<<5)+28>>2];l=b+(i<<5)+12|0;j=c[l>>2]|0;h=(j|0)==0;if(o&h)h=0;else {if(h)k=0;else {h=0;while(1)if((c[j+(h<<2)>>2]|0)>-1)h=h+1|0;else {k=h;break}}h=E5(a,0,0,0,(k+n<<2)+4|0)|0;if(!h){g=0;break a}if((k|0)>0){l=c[l>>2]|0;j=0;do{c[h+(j<<2)>>2]=c[l+(j<<2)>>2];j=j+1|0;}while((j|0)!=(k|0))}else k=0;if(m){j=0;do{c[h+(j+k<<2)>>2]=c[e+(j<<2)>>2];j=j+1|0;}while((j|0)!=(n|0));j=n;}else j=0;c[h+(j+k<<2)>>2]=-1;}c[g+(i<<5)+12>>2]=h;i=i+1|0;h=c[b+(i<<5)>>2]|0;if((h|0)<=-1){n=i;break}}}else n=0;i=c[d>>2]|0;h=g+(n<<5)|0;if((i|0)>-1){m=0;l=n;do{c[h>>2]=i;c[g+(l<<5)+4>>2]=c[d+(m<<5)+4>>2];c[g+(l<<5)+8>>2]=c[d+(m<<5)+8>>2];c[g+(l<<5)+16>>2]=c[d+(m<<5)+16>>2];c[g+(l<<5)+20>>2]=c[d+(m<<5)+20>>2];c[g+(l<<5)+24>>2]=c[d+(m<<5)+24>>2];c[g+(l<<5)+28>>2]=c[d+(m<<5)+28>>2];j=d+(m<<5)+12|0;h=c[j>>2]|0;if(!h)h=0;else {i=0;while(1)if((c[h+(i<<2)>>2]|0)>-1)i=i+1|0;else break;h=E5(a,0,0,0,(i<<2)+4|0)|0;if(!h){g=0;break a}if((i|0)>0){k=c[j>>2]|0;j=0;do{c[h+(j<<2)>>2]=c[k+(j<<2)>>2];j=j+1|0;}while((j|0)!=(i|0))}else i=0;c[h+(i<<2)>>2]=-1;}c[g+(l<<5)+12>>2]=h;m=m+1|0;i=c[d+(m<<5)>>2]|0;l=m+n|0;h=g+(l<<5)|0;}while((i|0)>-1)}c[h>>2]=-1;}while(0);return g|0}function Z5(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=R5(a)|0;p=(f|0)!=0;if(p)c[f>>2]=0;b=S5(a,b)|0;a:do if(!b){m=(d|0)==0;l=(e|0)==0;if((R5(a)|0)>(o|0))while(1){b=V5(a)|0;b:do switch(c[b>>2]|0){case 0:{b=c[b+4>>2]|0;switch(c[b>>2]|0){case -3:break;case -2:{if(l)break b;c[e>>2]=c[e>>2]|c[b+4>>2];break b}default:break b}h=c[b+4>>2]|0;if((h|0)>-1){c:do if(!m){b=0;while(1){i=d+(b<<2)|0;j=c[i>>2]|0;if((j|0)<=-1)break;if((j|0)==(h|0))break c;else b=b+1|0;}c[i>>2]=h;c[d+(b+1<<2)>>2]=-1;}while(0);if(p)c[f>>2]=(c[f>>2]|0)+1;}break}case 3:{b=c[b+4>>2]|0;h=c[b>>2]|0;if(c[h+8>>2]|0){k=h;n=6;break b}b=c[b+4>>2]|0;if(c[b+8>>2]|0){k=b;n=6;}break}case 1:{b=c[b+4>>2]|0;h=S5(a,c[b>>2]|0)|0;if(h|0){g=h;break a}k=c[b+4>>2]|0;n=6;break}case 2:{b=c[c[b+4>>2]>>2]|0;if(c[b+8>>2]|0){k=b;n=6;}break}default:{}}while(0);if((n|0)==6?(n=0,g=S5(a,k)|0,g|0):0)break a;if((R5(a)|0)<=(o|0)){g=0;break a}}else g=0;}else g=b;while(0);return g|0}function _5(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+16|0;g=k;d=a+12|0;e=c[d>>2]|0;j=c[a>>2]|0;if((e|0)>=(j|0)){d=c[a+4>>2]|0;if((j|0)<(d|0)?(f=(c[a+8>>2]|0)+j|0,f=(f|0)>(d|0)?d:f,h=a+16|0,i=W1(c[h>>2]|0,f<<2)|0,(i|0)!=0):0){c[a>>2]=f;c[h>>2]=i;c[g>>2]=c[b>>2];_5(a,g)|0;d=0;}else d=12;}else {c[(c[a+16>>2]|0)+(e<<2)>>2]=c[b>>2];c[d>>2]=(c[d>>2]|0)+1;d=0;}l=k;return d|0}function $5(a,b,d){a=a|0;b=b|0;d=d|0;a=E5(a,0,0,1,32)|0;if((d|0)!=0&(a|0)!=0){c[a+4>>2]=d;c[a>>2]=b;c[a+8>>2]=-1;c[a+12>>2]=-1;}else a=0;return a|0}function a6(b,d,e,f,g,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=R5(d)|0;S5(d,e)|0;e=T5(d,0)|0;a:do if(!e){q=(f&1|0)==0;p=(f&2|0)!=0;o=0;l=1;e=i;while(1){if((R5(d)|0)>(r|0))n=e;else {f=o;e=0;break a}b:while(1){c:while(1){switch(U5(d)|0){case 1:{i=7;break c}case 0:{e=V5(d)|0;switch(c[e>>2]|0){case 0:{i=9;break b}case 3:{i=19;break b}case 1:{i=26;break b}case 2:{i=33;break c}default:{}}break}default:{}}if((R5(d)|0)<=(r|0)){f=o;e=0;break a}}if((i|0)==7)e=V5(d)|0;else if((i|0)==33){f=c[e+4>>2]|0;e=S5(d,c[f>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=b6(b,c[f>>2]|0,c[f+4>>2]|0,c[f+8>>2]|0,a[f+12>>0]&1)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}e=c[e+4>>2]|0;}if((R5(d)|0)>(r|0))n=e;else {f=o;e=0;break a}}if((i|0)==9){m=c[e+4>>2]|0;i=c[m+8>>2]|0;f=c[m>>2]|0;e=c[m+4>>2]|0;if(!((f|0)>-1|(f|0)==-4))if(q|(f|0)!=-3)if((f|0)==-3)if(p&(l|0)!=0){c[h+(e<<2)>>2]=1;f=-3;k=o;l=0;}else {f=-3;k=o;}else k=o;else {e=-1;f=-1;i=-1;k=o;}else {i=(c[g>>2]|0)+i|0;k=o+1|0;}e=L5(b,f,e,i)|0;c[n>>2]=e;if(!e)e=12;else {e=c[e+4>>2]|0;c[e+12>>2]=c[m+12>>2];c[e+16>>2]=c[m+16>>2];e=0;}if((i|0)>(c[j>>2]|0)){c[j>>2]=i;f=n;}else f=n;}else if((i|0)==19){i=c[e+4>>2]|0;f=i+4|0;e=c6(b,c[i>>2]|0,c[f>>2]|0)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}m=c[e+4>>2]|0;e=S5(d,c[f>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=S5(d,m+4|0)|0;if(e|0){f=o;break a}e=T5(d,1)|0;if(e|0){f=o;break a}e=S5(d,c[i>>2]|0)|0;if(e|0){f=o;break a}k=o;f=m;e=T5(d,0)|0;}else if((i|0)==26){m=c[e+4>>2]|0;i=m+4|0;e=M5(b,c[m>>2]|0,c[i>>2]|0)|0;c[n>>2]=e;if(!e){f=o;e=12;break a}f=c[e+4>>2]|0;c[f>>2]=0;k=f+4|0;c[k>>2]=0;e=S5(d,c[i>>2]|0)|0;if(e|0){f=o;break a}e=T5(d,0)|0;if(e|0){f=o;break a}e=S5(d,k)|0;if(e|0){f=o;break a}e=T5(d,1)|0;if(e|0){f=o;break a}e=S5(d,c[m>>2]|0)|0;if(e|0){f=o;break a}k=o;e=T5(d,0)|0;}if(!e){o=k;e=f;}else {f=k;break}}}else f=0;while(0);c[g>>2]=(c[g>>2]|0)+f;return e|0}function b6(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=E5(b,0,0,1,16)|0;b=$5(b,2,h)|0;if(!b)b=0;else {c[h>>2]=d;c[h+4>>2]=e;c[h+8>>2]=f;h=h+12|0;a[h>>0]=a[h>>0]&-2|g&1;c[b+16>>2]=c[d+16>>2];}return b|0}function c6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if(b){e=E5(a,0,0,1,8)|0;a=$5(a,3,e)|0;if((d|0)!=0&(a|0)!=0){c[e>>2]=b;c[e+4>>2]=d;c[a+16>>2]=(c[d+16>>2]|0)+(c[b+16>>2]|0);d=a;}else d=0;}return d|0}function d6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=E5(a,0,0,0,8)|0;if(((e|0)!=0?(d=L5(a,-3,d,-1)|0,c[e>>2]=d,(d|0)!=0):0)?(f=E5(a,0,0,0,32)|0,c[e+4>>2]=f,(f|0)!=0):0){a=b+4|0;c[f+4>>2]=c[a>>2];c[f>>2]=c[b>>2];c[f+8>>2]=-1;c[f+12>>2]=-1;f=f+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[a>>2]=e;c[b>>2]=1;a=0;}else a=12;return a|0}function e6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=c[a>>2]|0;if((f|0)>-1){g=c[b+16>>2]|0;e=0;b=f;do{f=b>>>1;c[((b&1|0)==0?g+(f*12|0)|0:g+(f*12|0)+4|0)>>2]=d;e=e+1|0;b=c[a+(e<<2)>>2]|0;}while((b|0)>-1)}c[a>>2]=-1;return}function f6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=E5(a,0,0,0,8)|0;if(((e|0)!=0?(d=L5(a,-3,d,-1)|0,c[e+4>>2]=d,(d|0)!=0):0)?(f=E5(a,0,0,0,32)|0,c[e>>2]=f,(f|0)!=0):0){a=b+4|0;c[f+4>>2]=c[a>>2];c[f>>2]=c[b>>2];c[f+8>>2]=-1;c[f+12>>2]=-1;f=f+16|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[a>>2]=e;c[b>>2]=1;a=0;}else a=12;return a|0}function g6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0;m=l;l=l+16|0;j=m;i=b+32|0;h=c[i>>2]|0;g=h&1;a:do switch(a[d>>0]|0){case 91:{e=k6(b,d+1|0)|0;break}case 92:{e=d+1|0;f=l6(e)|0;if(f|0){e=g6(b,f)|0;c[b+12>>2]=d+2;break a}f=a[e>>0]|0;switch(f|0){case 0:{e=5;break a}case 98:{f=L5(c[b>>2]|0,-2,64,-1)|0;break}case 66:{f=L5(c[b>>2]|0,-2,128,-1)|0;break}case 60:{f=L5(c[b>>2]|0,-2,16,-1)|0;break}case 62:{f=L5(c[b>>2]|0,-2,32,-1)|0;break}case 120:{h=d+2|0;i=(a[h>>0]|0)==123;g=i?8:2;h=i?d+3|0:h;e=0;f=0;do{d=m6(a[h+e>>0]|0)|0;if((d|0)<0)break;f=d+(f<<4)|0;e=e+1|0;}while((f|0)<1114112&(e|0)<(g|0));e=h+e|0;if(i){if((a[e>>0]|0)!=125){e=9;break a}e=e+1|0;}j=c[b>>2]|0;i=b+24|0;k=c[i>>2]|0;c[i>>2]=k+1;f=L5(j,f,f,k)|0;e=e+-1|0;break}case 63:case 43:case 123:if(!g){e=13;break a}else {k=37;break a}case 124:{if(g|0){k=37;break a}e=L5(c[b>>2]|0,-1,-1,-1)|0;k=45;break a}default:{if(!((g|0)==0&(f+-49|0)>>>0<9)){k=37;break a}j=f+-48|0;k=c[b>>2]|0;i=b+24|0;f=c[i>>2]|0;c[i>>2]=f+1;f=L5(k,-4,j,f)|0;k=b+28|0;i=c[k>>2]|0;c[k>>2]=(j|0)<(i|0)?i:j;}}d=e+1|0;e=f;k=45;break}case 46:{e=c[b>>2]|0;g=b+24|0;f=c[g>>2]|0;c[g>>2]=f+1;if(h&4){f=L5(e,0,9,f)|0;k=c[b>>2]|0;e=c[g>>2]|0;c[g>>2]=e+1;e=L5(k,11,1114111,e)|0;if((f|0)!=0&(e|0)!=0)e=c6(c[b>>2]|0,f,e)|0;else e=0;}else e=L5(e,0,1114111,f)|0;d=d+1|0;k=45;break}case 94:{if((g|0)==0?(c[b+16>>2]|0)!=(d|0):0){e=d;k=37;break a}d=d+1|0;e=L5(c[b>>2]|0,-2,1,-1)|0;k=45;break}case 36:{e=d+1|0;if((g|0)==0?a[e>>0]|0:0){e=d;k=37;break a}d=e;e=L5(c[b>>2]|0,-2,2,-1)|0;k=45;break}case 63:case 43:case 123:case 42:{if(!g){e=d;k=37;}else e=13;break}case 124:{if(!g){e=d;k=37;}else k=36;break}case 0:{k=36;break}default:{e=d;k=37;}}while(0);if((k|0)==36){e=L5(c[b>>2]|0,-1,-1,-1)|0;k=45;}else if((k|0)==37){h=R4(j,e,-1)|0;if((h|0)<0)e=2;else {do if(c[i>>2]&2){if((C3(c[j>>2]|0)|0)==0?(B3(c[j>>2]|0)|0)==0:0){k=43;break}i=c[b>>2]|0;n=f3(c[j>>2]|0)|0;g=f3(c[j>>2]|0)|0;f=b+24|0;g=L5(i,n,g,c[f>>2]|0)|0;n=c[b>>2]|0;i=E3(c[j>>2]|0)|0;d=E3(c[j>>2]|0)|0;d=L5(n,i,d,c[f>>2]|0)|0;if((g|0)!=0&(d|0)!=0)g=c6(c[b>>2]|0,g,d)|0;else g=0;}else k=43;while(0);if((k|0)==43){g=c[j>>2]|0;f=b+24|0;g=L5(c[b>>2]|0,g,g,c[f>>2]|0)|0;}c[f>>2]=(c[f>>2]|0)+1;d=e+h|0;e=g;k=45;}}if((k|0)==45)if(!e)e=12;else {c[b+8>>2]=e;c[b+12>>2]=d;e=0;}l=m;return e|0}function h6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;j=l;l=l+16|0;i=j+4|0;g=j;b=j6(b,i)|0;if((a[b>>0]|0)==44){b=j6(b+1|0,g)|0;h=c[g>>2]|0;g=c[i>>2]|0;}else {i=c[i>>2]|0;c[g>>2]=i;h=i;g=i;}do if(!(g>>>0>255|((h|0)>255|(h|0)>-1&(h|0)<(g|0)))){if(!d)if((a[b>>0]|0)==92)b=b+1|0;else {b=0;break}if((a[b>>0]|0)==125){c[e>>2]=g;c[f>>2]=h;b=b+1|0;}else b=0;}else b=0;while(0);l=j;return b|0}function i6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((c[b+12>>2]|0)>-1){e=L5(c[a>>2]|0,-1,-1,-1)|0;if((e|0)!=0?(f=M5(c[a>>2]|0,e,b)|0,(f|0)!=0):0){e=c[b+16>>2]|0;c[f+16>>2]=e;g=6;}else e=12;}else {f=b;e=c[b+16>>2]|0;g=6;}if((g|0)==6){c[f+12>>2]=d;c[f+16>>2]=e+1;c[a+8>>2]=f;e=0;}return e|0}function j6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;c[d>>2]=-1;if(((a[b>>0]|0)+-48|0)>>>0<10){c[d>>2]=0;e=b;g=0;f=a[b>>0]|0;while(1){g=(g*10|0)+-48+(f<<24>>24)|0;c[d>>2]=g;b=e+1|0;f=a[b>>0]|0;if((g|0)>255|((f<<24>>24)+-48|0)>>>0>9)break;else e=b;}}return b|0}function k6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;s=l;l=l+288|0;e=s+264|0;g=s;c[e>>2]=c[b>>2];h=e+8|0;c[h>>2]=0;c[e+12>>2]=32;p=T1(128)|0;r=e+4|0;c[r>>2]=p;if(!p)d=12;else {f=g+4|0;c[f>>2]=0;p=(a[d>>0]|0)==94;c[g>>2]=p&1;d=n6(b,p?d+1|0:d,e,g)|0;a:do if(!d){p=(c[g>>2]|0)==0;if(!p){o4(c[r>>2]|0,c[h>>2]|0,4,111);d=p6(e)|0;if(!d){d=12;e=0;break}c[d>>2]=1114112;c[d+4>>2]=1114112;c[d+8>>2]=-1;d=c[f>>2]|0;if(d){e=d<<2;f=E5(c[b>>2]|0,0,0,0,e+4|0)|0;if(!f){d=12;e=0;break}W6(f|0,g+8|0,e|0)|0;c[f+(d<<2)>>2]=0;}else f=0;}else f=0;m=c[h>>2]|0;if((m|0)>0){n=c[r>>2]|0;o=b+24|0;e=0;d=0;k=0;while(1){j=c[n+(k<<2)>>2]|0;g=c[j>>2]|0;h=j+4|0;i=c[h>>2]|0;do if(!p)if((g|0)>(d|0)){c[j>>2]=d;c[h>>2]=g+-1;d=i+1|0;q=14;break}else {j=i+1|0;d=(j|0)>=(d|0)?j:d;break}else q=14;while(0);if((q|0)==14){q=0;c[j+8>>2]=c[o>>2];c[j+16>>2]=f;j=$5(c[b>>2]|0,0,j)|0;e=c6(c[b>>2]|0,e,j)|0;if(!e){d=12;e=0;break a}}k=k+1|0;if((k|0)>=(m|0)){d=0;break}}}else {d=0;e=0;}}else e=0;while(0);U1(c[r>>2]|0);r=b+24|0;c[r>>2]=(c[r>>2]|0)+1;c[b+8>>2]=e;}l=s;return d|0}function l6(b){b=b|0;var d=0;d=a[b>>0]|0;b=0;while(1){if((a[63752+(b<<3)>>0]|0)==d<<24>>24)break;b=b+1|0;if((b|0)==12){b=12;break}}return c[63752+(b<<3)+4>>2]|0}function m6(a){a=a|0;var b=0;b=a+-48|0;if(b>>>0<10)return b|0;else {b=a|32;return ((b+-97|0)>>>0<6?b+-87|0:-1)|0}return 0}function n6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=l;l=l+32|0;o=t;q=t+4|0;i=R4(o,d,-1)|0;g=a[d>>0]|0;a:do if((i|0)>=1){r=f+4|0;n=b+32|0;h=d;j=i;b:while(1){i=(h|0)==(d|0);if(!(i|g<<24>>24!=93)){s=5;break}c:do if(!(i|g<<24>>24!=45)){switch(a[h+1>>0]|0){case 93:break c;case 45:break;default:{g=11;break a}}if((a[h+2>>0]|0)==93){g=11;break a}}while(0);d:do if(g<<24>>24==91){switch(a[h+1>>0]|0){case 61:case 46:{g=3;break a}case 58:break;default:{s=17;break d}}i=h+2|0;g=0;e:while(1){switch(a[i+g>>0]|0){case 0:{s=16;break b}case 58:break e;default:{}}if((g|0)<13)g=g+1|0;else {s=16;break b}}W6(q|0,i|0,g|0)|0;a[q+g>>0]=0;j=X3(q)|0;if(!j){s=16;break b}h=i+(g+2)|0;if((a[i+(g+1)>>0]|0)!=93){s=16;break b}if(!(c[f>>2]|0)){g=1114111;m=0;k=1;s=25;}else {g=c[r>>2]|0;if((g|0)>63){g=12;break a}c[r>>2]=g+1;c[f+8+(g<<2)>>2]=j;}}else s=17;while(0);if((s|0)==17){s=0;i=c[o>>2]|0;h=h+j|0;if((a[h>>0]|0)==45?(p=h+1|0,(a[p>>0]|0)!=93):0){h=R4(o,p,-1)|0;g=c[o>>2]|0;if((h|0)<1|(i|0)>(g|0)){g=11;break a}j=0;m=i;h=p+h|0;k=0;s=25;}else {j=0;g=i;m=i;k=0;s=25;}}if((s|0)==25){s=0;i=p6(e)|0;if(!i){g=12;break a}c[i>>2]=m;c[i+4>>2]=g;c[i+12>>2]=j;c[i+8>>2]=-1;if(!(k|(c[n>>2]&2|0)==0)?(q6(e,m,g)|0)!=0:0){g=12;break a}}j=R4(o,h,-1)|0;g=a[h>>0]|0;if((j|0)<1){s=3;break a}}if((s|0)==5){c[b+12>>2]=h+1;g=0;break}else if((s|0)==16){g=4;break}}else s=3;while(0);if((s|0)==3)g=g<<24>>24?2:7;l=t;return g|0}function o6(a,b){a=a|0;b=b|0;return (c[c[a>>2]>>2]|0)-(c[c[b>>2]>>2]|0)|0}function p6(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;h=a+8|0;d=c[h>>2]|0;e=a+12|0;f=c[e>>2]|0;if((d|0)>=(f|0))if((f|0)<=32767?(c[e>>2]=f<<1,g=a+4|0,b=W1(c[g>>2]|0,f<<3)|0,(b|0)!=0):0){c[g>>2]=b;d=c[h>>2]|0;i=6;}else b=0;else {b=c[a+4>>2]|0;i=6;}if((i|0)==6){c[h>>2]=d+1;i=E5(c[a>>2]|0,0,0,1,20)|0;c[b+(d<<2)>>2]=i;b=i;}return b|0}function q6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;a:do if((b|0)>(d|0))b=0;else while(1){b:do if(!(B3(b)|0)){if(!(C3(b)|0)){b=b+1|0;break}f=E3(b)|0;e=f;while(1){g=b+1|0;e=e+1|0;if((b|0)>=(d|0)){h=f;b=g;g=12;break b}if((E3(g)|0)==(e|0))b=g;else {h=f;b=g;g=12;break}}}else {f=f3(b)|0;e=f;while(1){g=b+1|0;e=e+1|0;if((b|0)>=(d|0)){h=f;b=g;g=12;break b}if((f3(g)|0)==(e|0))b=g;else {h=f;b=g;g=12;break}}}while(0);if((g|0)==12){g=0;f=p6(a)|0;if(!f){b=-1;break a}c[f>>2]=h;c[f+4>>2]=e+-1;c[f+8>>2]=-1;}if((b|0)>(d|0)){b=0;break}}while(0);return b|0}function r6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0;n=l;l=l+16|0;k=n;i=c[a+4>>2]|0;j=i+56|0;h=(c[j>>2]&8|0)==0?d:0;a=c[i+40>>2]|0;if((a|0)>0&(h|0)!=0){a=T1(a<<2)|0;if(!a)a=12;else {g=a;d=a;m=3;}}else {g=0;d=0;m=3;}if((m|0)==3){if(!(c[i+60>>2]|0))a=t6(i,b,g,f,k)|0;else a=s6(i,b,g,f,k)|0;if(!a)u6(h,e,c[j>>2]|0,i,g,c[k>>2]|0);if(g)U1(d);}l=n;return a|0}function s6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0;V=l;l=l+16|0;T=V;c[T>>2]=0;o=e&1;R=e&2;S=a+56|0;n=c[S>>2]&4;U=C5(0,0)|0;a:do if(U){p=E5(U,0,0,0,32)|0;if(!p){D5(U);e=12;break}c[p+24>>2]=0;c[p+28>>2]=0;Q=a+40|0;q=c[Q>>2]|0;if(q){e=T1(q<<2)|0;if(!e){m=0;k=0;j=e;e=12;i=0;h=0;g=0;}else {j=e;i=e;C=6;}}else {j=0;i=0;C=6;}b:do if((C|0)==6){e=c[a+28>>2]|0;if(e){e=T1(e<<3)|0;if(!e){m=e;k=0;e=12;h=0;g=0;break}else {m=e;h=e;}}else {m=0;h=0;}P=a+52|0;e=c[P>>2]|0;if(e){e=T1(e<<2)|0;if(!e){k=e;e=12;g=0;break}else {k=e;g=e;}}else {k=0;g=0;}K=a+8|0;L=a+12|0;M=(d|0)==0;N=(d|0)!=0;O=a+32|0;J=(n|0)!=0;I=(o|0)==0;s=b;e=1;r=-1;v=-1;n=q;B=0;c:while(1){if((n|0)>0){o=0;do{c[j+(o<<2)>>2]=-1;if(!M){c[d+(o<<2)>>2]=-1;n=c[Q>>2]|0;}o=o+1|0;}while((o|0)<(n|0))}n=c[P>>2]|0;if((n|0)>0)Y6(g|0,0,n<<2|0)|0;G=e+r|0;e=R4(T,s,4)|0;if((e|0)<1)if((e|0)<0){e=1;break b}else e=1;F=s+e|0;H=c[T>>2]|0;n=c[K>>2]|0;o=n+8|0;if(c[o>>2]|0){w=(G|0)!=0;x=(B|0)==95;y=(G|0)==0;A=J&(B|0)==10;z=(G|0)<1&I;u=n;n=0;t=0;s=o;while(1){r=u+20|0;o=c[r>>2]|0;d:do if(o)if((o&1|0)==0|z|A){if(o&2|0?(E=c[T>>2]|0,!((E|R|0)==0|J&(E|0)==10)):0){q=t;break}do if(o&16|0){if(x){q=t;break d}if(x3(B)|0){q=t;break d}o=c[T>>2]|0;if((o|0)==95)break;if(!(x3(o)|0)){q=t;break d}}while(0);o=c[r>>2]|0;if(o&32){if(x){o=c[T>>2]|0;if((o|0)==95){q=t;break}}else {E=(x3(B)|0)==0;o=c[T>>2]|0;if(E|(o|0)==95){q=t;break}}if(x3(o)|0){q=t;break}o=c[r>>2]|0;}q=c[T>>2]|0;do if((q|0)!=0&(w&(o&64|0)!=0)){if(x)o=1;else {o=(x3(B)|0)!=0;q=c[T>>2]|0;}if((q|0)==95)if(o){q=t;break d}else break;else if(o^(x3(q)|0)!=0)break;else {q=t;break d}}while(0);if(!(c[r>>2]&128)){C=49;break}o=c[T>>2]|0;if(y|(o|0)==0){q=t;break}if(x)q=1;else {q=(x3(B)|0)!=0;o=c[T>>2]|0;}if((o|0)==95)if(q){C=49;break}else {q=t;break}else if(q^(x3(o)|0)!=0){q=t;break}else {C=49;break}}else q=t;else C=49;while(0);do if((C|0)==49){C=0;if(!t){n=c[u+16>>2]|0;q=c[s>>2]|0;break}q=p+28|0;o=c[q>>2]|0;if(!o){o=E5(U,0,0,0,32)|0;if(!o){C=53;break c}c[o+24>>2]=p;c[o+28>>2]=0;E=E5(U,0,0,0,c[Q>>2]<<2)|0;c[o+20>>2]=E;if(!E){C=60;break c}c[q>>2]=o;p=o;}else p=o;c[p>>2]=G;c[p+4>>2]=F;c[p+8>>2]=c[s>>2];c[p+12>>2]=c[u+12>>2];c[p+16>>2]=c[T>>2];if((c[Q>>2]|0)>0){q=c[p+20>>2]|0;o=0;do{c[q+(o<<2)>>2]=c[j+(o<<2)>>2];o=o+1|0;}while((o|0)<(c[Q>>2]|0))}o=c[u+16>>2]|0;if(!o)q=t;else {q=c[o>>2]|0;if((q|0)<=-1){q=t;break}r=c[p+20>>2]|0;do{o=o+4|0;c[r+(q<<2)>>2]=G;q=c[o>>2]|0;}while((q|0)>-1);q=t;}}while(0);s=u+40|0;if(!(c[s>>2]|0))break;else {u=u+32|0;t=q;}}if(n){o=c[n>>2]|0;if((o|0)>-1)do{c[j+(o<<2)>>2]=G;n=n+4|0;o=c[n>>2]|0;}while((o|0)>-1)}else n=0;if(!q)C=171;else {s=G;r=F;w=q;x=n;C=79;}}else {n=0;C=171;}e:while(1){if((C|0)==79){if((w|0)==(c[L>>2]|0)){if((v|0)>=(s|0)){if(!(N&(v|0)==(s|0))){n=x;C=171;continue}n=c[Q>>2]|0;if(!(w6(n,c[O>>2]|0,j,d)|0)){n=x;C=171;continue}}else {if(M){v=s;n=x;C=171;continue}n=c[Q>>2]|0;}if((n|0)>0)n=0;else {v=s;n=x;C=171;continue}while(1){c[d+(n<<2)>>2]=c[j+(n<<2)>>2];n=n+1|0;if((n|0)>=(c[Q>>2]|0)){v=s;n=x;C=171;continue e}}}u=w+8|0;if((c[u>>2]|0)!=0?(c[w+20>>2]&256|0)!=0:0){o=c[w+24>>2]|0;u6(o+1|0,m,c[S>>2]&-9,a,j,s);E=c[m+(o<<3)>>2]|0;o=(c[m+(o<<3)+4>>2]|0)-E|0;if(Q2(b+E|0,r+-1|0,o)|0){n=x;C=171;continue}E=(o|0)==0;n=E&1;q=c[w+12>>2]|0;if(E?c[k+(q<<2)>>2]|0:0){n=x;C=171;continue}c[k+(q<<2)>>2]=n;o=o+-1|0;r=r+o|0;o=o+s|0;q=c[T>>2]|0;n=R4(T,r,4)|0;if((n|0)<1)if((n|0)<0){e=1;break b}else n=1;D=r+n|0;E=n;}else {q=c[T>>2]|0;if(!q){n=x;C=171;continue}n=R4(T,r,4)|0;if((n|0)<1)if((n|0)<0){e=1;break b}else n=1;o=s;D=r+n|0;E=n;}s=o+e|0;if(!(c[u>>2]|0)){e=E;n=x;C=171;continue}y=(s|0)!=0;z=(q|0)==95;A=(s|0)==0;C=J&(q|0)==10;B=(s|0)<1&I;t=0;n=x;while(1){f:do if((c[w>>2]|0)>>>0<=q>>>0){if((c[w+4>>2]|0)>>>0>>0)break;r=w+20|0;e=c[r>>2]|0;do if(e|0){if(!((e&1|0)==0|B|C))break f;if(e&2|0?(x=c[T>>2]|0,!((x|R|0)==0|J&(x|0)==10)):0)break f;do if(e&16|0){if(z)break f;if(x3(q)|0)break f;e=c[T>>2]|0;if((e|0)==95)break;if(!(x3(e)|0))break f}while(0);e=c[r>>2]|0;if(e&32){if(z){e=c[T>>2]|0;if((e|0)==95)break f}else {x=(x3(q)|0)==0;e=c[T>>2]|0;if(x|(e|0)==95)break f}if(x3(e)|0)break f;e=c[r>>2]|0;}o=c[T>>2]|0;do if((o|0)!=0&(y&(e&64|0)!=0)){if(z)e=1;else {e=(x3(q)|0)!=0;o=c[T>>2]|0;}if((o|0)==95)if(e)break f;else break;else if(e^(x3(o)|0)!=0)break;else break f}while(0);do if(c[r>>2]&128|0){e=c[T>>2]|0;if(A|(e|0)==0)break f;if(z)o=1;else {o=(x3(q)|0)!=0;e=c[T>>2]|0;}if((e|0)==95)if(o)break;else break f;else if(o^(x3(e)|0)!=0)break f;else break}while(0);e=c[r>>2]|0;do if(e&4){if(c[S>>2]&2|0)break;if(!(w3(q,c[w+24>>2]|0)|0))break f;e=c[r>>2]|0;}while(0);do if(e&4|0){if(!(c[S>>2]&2))break;x=E3(q)|0;e=w+24|0;if(w3(x,c[e>>2]|0)|0)break;x=f3(q)|0;if(!(w3(x,c[e>>2]|0)|0))break f}while(0);if(!(c[r>>2]&8))break;if(v6(c[w+28>>2]|0,q,c[S>>2]&2)|0)break f}while(0);if(!t){t=c[u>>2]|0;n=c[w+16>>2]|0;break}o=p+28|0;e=c[o>>2]|0;if(!e){e=E5(U,0,0,0,32)|0;if(!e){C=145;break c}c[e+24>>2]=p;c[e+28>>2]=0;x=E5(U,0,0,0,c[Q>>2]<<2)|0;c[e+20>>2]=x;if(!x){C=152;break c}c[o>>2]=e;p=e;}else p=e;c[p>>2]=s;c[p+4>>2]=D;c[p+8>>2]=c[u>>2];c[p+12>>2]=c[w+12>>2];c[p+16>>2]=c[T>>2];if((c[Q>>2]|0)>0){o=c[p+20>>2]|0;e=0;do{c[o+(e<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;}while((e|0)<(c[Q>>2]|0))}e=c[w+16>>2]|0;if(!e)break;o=c[e>>2]|0;if((o|0)<=-1)break;r=c[p+20>>2]|0;do{c[r+(o<<2)>>2]=s;e=e+4|0;o=c[e>>2]|0;}while((o|0)>-1)}while(0);u=w+40|0;if(!(c[u>>2]|0))break;else w=w+32|0;}if(!t){e=E;C=171;continue}if(n){e=c[n>>2]|0;if((e|0)>-1){do{n=n+4|0;c[j+(e<<2)>>2]=s;e=c[n>>2]|0;}while((e|0)>-1);q=v;o=D;e=E;}else {q=v;o=D;e=E;}}else {q=v;o=D;e=E;n=0;}}else if((C|0)==171){C=0;r=c[p+24>>2]|0;if(!r)break;t=c[p+8>>2]|0;if(c[t+20>>2]&256|0)c[k+(c[p+12>>2]<<2)>>2]=0;s=c[p>>2]|0;u=c[p+4>>2]|0;c[T>>2]=c[p+16>>2];q=c[Q>>2]|0;if((q|0)>0){p=c[p+20>>2]|0;o=0;do{c[j+(o<<2)>>2]=c[p+(o<<2)>>2];o=o+1|0;}while((o|0)<(q|0));p=r;q=v;o=u;}else {p=r;q=v;o=u;}}r=o;v=q;w=t;x=n;C=79;}n=(v|0)>-1;if(n|(c[T>>2]|0)==0){C=180;break}c[T>>2]=H;s=F;r=G;n=c[Q>>2]|0;B=H;}if((C|0)==53){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==60){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==145){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==152){D5(U);if(j|0)U1(i);if(m|0)U1(h);if(!k){e=12;break a}U1(g);e=12;break a}else if((C|0)==180){c[f>>2]=v;e=(n^1)&1;break}}while(0);D5(U);if(j|0)U1(i);if(m|0)U1(h);if(k)U1(g);}else e=12;while(0);l=V;return e|0}function t6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;W=l;l=l+16|0;T=W;c[T>>2]=0;k=e&1;Q=e&2;R=a+56|0;j=c[R>>2]&4;if(!d)N=0;else N=c[a+40>>2]|0;P=N<<2;i=c[a+52>>2]|0;h=i<<3;g=h+8|0;e=P+12+h+(g+(O(P,i)|0)<<1)|0;U=T1(e)|0;if(!U)e=12;else {Y6(U|0,0,e|0)|0;e=U+P|0;m=e&3;m=e+((m|0)==0?0:4-m|0)|0;e=m+g|0;n=e&3;n=e+((n|0)==0?0:4-n|0)|0;e=n+g|0;M=e&3;M=e+((M|0)==0?0:4-M|0)|0;e=M+h|0;g=e&3;h=(i|0)>0;if(h){e=e+((g|0)==0?0:4-g|0)|0;g=0;while(1){c[n+(g<<3)+4>>2]=e;e=e+P|0;c[m+(g<<3)+4>>2]=e;g=g+1|0;if((g|0)>=(i|0))break;else e=e+P|0;}if(h){e=0;do{c[M+(e<<3)>>2]=-1;e=e+1|0;}while((e|0)<(i|0))}}e=R4(T,b,4)|0;if((e|0)<1)if((e|0)<0)e=1;else {i=1;V=11;}else {i=e;V=11;}a:do if((V|0)==11){L=a+8|0;K=(j|0)!=0;E=(k|0)==0;F=(N|0)>0;G=a+12|0;H=(N|0)<1;I=a+44|0;J=a+32|0;C=a+36|0;D=(N|0)==0;h=0;v=b+i|0;u=0;j=0;e=-1;g=m;A=U;x=m;w=n;while(1){if((e|0)<0){a=c[L>>2]|0;k=a+8|0;b:do if(c[k>>2]|0){p=(u|0)!=0;q=(h|0)==95;r=(u|0)==0;t=K&(h|0)==10;s=(u|0)<1&E;while(1){c:while(1){o=a+12|0;if((c[M+(c[o>>2]<<3)>>2]|0)>=(u|0))break;n=a+20|0;b=c[n>>2]|0;if(!b){V=46;break}d:do if((b&1|0)==0|s|t){if(b&2|0?(B=c[T>>2]|0,!((B|Q|0)==0|K&(B|0)==10)):0)break;do if(b&16|0){if(q)break d;if(x3(h)|0)break d;b=c[T>>2]|0;if((b|0)==95)break;if(!(x3(b)|0))break d}while(0);b=c[n>>2]|0;if(b&32){if(q){b=c[T>>2]|0;if((b|0)==95)break}else {B=(x3(h)|0)==0;b=c[T>>2]|0;if(B|(b|0)==95)break}if(x3(b)|0)break;b=c[n>>2]|0;}m=c[T>>2]|0;do if((m|0)!=0&(p&(b&64|0)!=0)){if(q)b=1;else {b=(x3(h)|0)!=0;m=c[T>>2]|0;}if((m|0)==95)if(b)break d;else break;else if(b^(x3(m)|0)!=0)break;else break d}while(0);if(!(c[n>>2]&128)){V=46;break c}b=c[T>>2]|0;if(r|(b|0)==0)break;if(q)m=1;else {m=(x3(h)|0)!=0;b=c[T>>2]|0;}if((b|0)==95)if(m){V=46;break c}else break;else if(m^(x3(b)|0)!=0)break;else {V=46;break c}}while(0);k=a+40|0;if(!(c[k>>2]|0))break b;else a=a+32|0;}if((V|0)==46){V=0;c[g>>2]=c[k>>2];if(F)Y6(c[g+4>>2]|0,-1,P|0)|0;k=c[a+16>>2]|0;if(k|0?(S=c[k>>2]|0,(S|0)>-1):0){m=g+4|0;b=S;do{if((b|0)<(N|0))c[(c[m>>2]|0)+(b<<2)>>2]=u;k=k+4|0;b=c[k>>2]|0;}while((b|0)>-1)}k=(c[g>>2]|0)!=(c[G>>2]|0);if(k|H){j=k?j:1;e=k?e:u;k=g+4|0;}else {k=g+4|0;j=c[k>>2]|0;e=0;do{c[d+(e<<2)>>2]=c[j+(e<<2)>>2];e=e+1|0;}while((e|0)!=(N|0));j=1;e=u;}B=c[o>>2]|0;c[M+(B<<3)>>2]=u;c[M+(B<<3)+4>>2]=k;g=g+8|0;}k=a+40|0;if(!(c[k>>2]|0))break;else a=a+32|0;}}while(0);c[g>>2]=0;g=c[T>>2]|0;if(!g)break;else h=g;}else {if(D)break;h=c[T>>2]|0;if(!((g|0)!=(x|0)&(h|0)!=0))break}B=u+i|0;g=R4(T,v,4)|0;if((g|0)<1)if((g|0)<0){e=1;break a}else i=1;else i=g;z=v+i|0;if((j|0)!=0&(c[I>>2]|0)!=0){if(!(c[x>>2]|0))g=w;else {o=c[C>>2]|0;p=c[o>>2]|0;q=(p|0)>-1;n=x;g=w;do{m=n+4|0;e:do if(q){k=0;b=p;do{a=c[o+((k|1)<<2)>>2]|0;if((b|0)>=(N|0))break e;j=c[m>>2]|0;if((c[j+(a<<2)>>2]|0)==(c[d+(a<<2)>>2]|0)?(c[j+(b<<2)>>2]|0)<(c[d+(b<<2)>>2]|0):0)break e;k=k+2|0;b=c[o+(k<<2)>>2]|0;}while((b|0)>-1);k=m;V=75;}else {k=m;j=c[m>>2]|0;V=75;}while(0);if((V|0)==75){V=0;c[g>>2]=c[n>>2];v=g+4|0;y=c[v>>2]|0;c[v>>2]=j;c[k>>2]=y;g=g+8|0;}n=n+8|0;}while((c[n>>2]|0)!=0)}c[g>>2]=0;y=x;j=0;}else {y=w;w=x;}k=c[w>>2]|0;if(!k){k=A;g=y;}else {r=(B|0)!=0;s=(h|0)==95;t=(B|0)==0;v=K&(h|0)==10;u=(B|0)<1&E;q=w;a=A;g=y;while(1){b=k+8|0;if(c[b>>2]|0){p=q+4|0;o=a;n=b;while(1){f:do if((c[k>>2]|0)>>>0<=h>>>0?(c[k+4>>2]|0)>>>0>=h>>>0:0){m=k+20|0;a=c[m>>2]|0;do if(a|0){if(!((a&1|0)==0|u|v)){a=o;break f}if(a&2|0?(A=c[T>>2]|0,!((A|Q|0)==0|K&(A|0)==10)):0){a=o;break f}do if(a&16|0){if(s){a=o;break f}if(x3(h)|0){a=o;break f}a=c[T>>2]|0;if((a|0)==95)break;if(!(x3(a)|0)){a=o;break f}}while(0);a=c[m>>2]|0;if(a&32){if(s){a=c[T>>2]|0;if((a|0)==95){a=o;break f}}else {A=(x3(h)|0)==0;a=c[T>>2]|0;if(A|(a|0)==95){a=o;break f}}if(x3(a)|0){a=o;break f}a=c[m>>2]|0;}b=c[T>>2]|0;do if((b|0)!=0&(r&(a&64|0)!=0)){if(s)a=1;else {a=(x3(h)|0)!=0;b=c[T>>2]|0;}if((b|0)==95)if(a){a=o;break f}else break;else if(a^(x3(b)|0)!=0)break;else {a=o;break f}}while(0);do if(c[m>>2]&128|0){a=c[T>>2]|0;if(t|(a|0)==0){a=o;break f}if(s)b=1;else {b=(x3(h)|0)!=0;a=c[T>>2]|0;}if((a|0)==95)if(b)break;else {a=o;break f}else if(b^(x3(a)|0)!=0){a=o;break f}else break}while(0);a=c[m>>2]|0;do if(a&4){if(c[R>>2]&2|0)break;if(!(w3(h,c[k+24>>2]|0)|0)){a=o;break f}a=c[m>>2]|0;}while(0);do if(a&4|0){if(!(c[R>>2]&2))break;A=E3(h)|0;a=k+24|0;if(w3(A,c[a>>2]|0)|0)break;A=f3(h)|0;if(!(w3(A,c[a>>2]|0)|0)){a=o;break f}}while(0);if(!(c[m>>2]&8))break;if(v6(c[k+28>>2]|0,h,c[R>>2]&2)|0){a=o;break f}}while(0);if(F){b=c[p>>2]|0;a=0;do{c[o+(a<<2)>>2]=c[b+(a<<2)>>2];a=a+1|0;}while((a|0)!=(N|0))}a=c[k+16>>2]|0;do if(a|0){b=c[a>>2]|0;if((b|0)<=-1)break;do{if((b|0)<(N|0))c[o+(b<<2)>>2]=B;a=a+4|0;b=c[a>>2]|0;}while((b|0)>-1)}while(0);a=c[k+12>>2]|0;b=M+(a<<3)|0;if((c[b>>2]|0)>=(B|0)){a=c[M+(a<<3)+4>>2]|0;b=c[a>>2]|0;if(!(w6(N,c[J>>2]|0,o,b)|0)){a=o;break}c[a>>2]=o;if((c[n>>2]|0)!=(c[G>>2]|0)){a=b;break}if(F)e=0;else {j=1;a=b;e=B;break}while(1){c[d+(e<<2)>>2]=c[o+(e<<2)>>2];e=e+1|0;if((e|0)==(N|0)){j=1;a=b;e=B;break f}}}A=c[n>>2]|0;c[g>>2]=A;x=g+4|0;m=c[x>>2]|0;c[x>>2]=o;c[b>>2]=B;c[M+(a<<3)+4>>2]=x;do if((c[G>>2]|0)==(A|0)){if((e|0)==-1)if(F)e=0;else {e=B;j=1;break}else {if(!F)break;if((c[o>>2]|0)>(c[d>>2]|0))break;else e=0;}do{c[d+(e<<2)>>2]=c[o+(e<<2)>>2];e=e+1|0;}while((e|0)<(N|0));e=B;j=1;}while(0);a=m;g=g+8|0;}else a=o;while(0);n=k+40|0;if(!(c[n>>2]|0))break;else {k=k+32|0;o=a;}}}q=q+8|0;k=c[q>>2]|0;if(!k){k=a;break}}}c[g>>2]=0;v=z;u=B;A=k;x=y;}c[f>>2]=e;e=e>>>31;}while(0);U1(U);}l=W;return e|0}function u6(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if((d&8|0)==0&(g|0)>-1?(m=c[e+16>>2]|0,n=c[e+28>>2]|0,l=(a|0)!=0&(n|0)!=0,l):0){k=c[e+48>>2]|0;j=0;do{d=c[m+(j*12|0)>>2]|0;if((d|0)==(k|0))i=g;else i=c[f+(d<<2)>>2]|0;h=b+(j<<3)|0;c[h>>2]=i;d=c[m+(j*12|0)+4>>2]|0;if((d|0)==(k|0))d=g;else d=c[f+(d<<2)>>2]|0;e=b+(j<<3)+4|0;c[e>>2]=d;if((d|0)==-1|(i|0)==-1){c[e>>2]=-1;c[h>>2]=-1;}j=j+1|0;}while(j>>>0>>0&j>>>0>>0);if(l){d=0;do{i=b+(d<<3)+4|0;j=c[m+(d*12|0)+8>>2]|0;if(j|0?(o=c[j>>2]|0,(o|0)>-1):0){k=b+(d<<3)|0;h=0;f=o;e=c[k>>2]|0;do{if(!((e|0)>=(c[b+(f<<3)>>2]|0)?(c[i>>2]|0)<=(c[b+(f<<3)+4>>2]|0):0)){c[i>>2]=-1;c[k>>2]=-1;e=-1;}h=h+1|0;f=c[j+(h<<2)>>2]|0;}while((f|0)>-1)}d=d+1|0;}while(d>>>0>>0&d>>>0>>0)}else d=0;}else d=0;if(d>>>0>>0)Y6(b+(d<<3)|0,-1,a-d<<3|0)|0;return}function v6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=c[a>>2]|0;a:do if(!e)d=0;else {f=(d|0)==0;d=e;while(1){if(f){if(w3(b,d)|0){d=1;break a}}else {e=f3(b)|0;if(w3(e,c[a>>2]|0)|0){d=1;break a}e=E3(b)|0;if(w3(e,c[a>>2]|0)|0){d=1;break a}}a=a+4|0;d=c[a>>2]|0;if(!d){d=0;break}}}while(0);return d|0}function w6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;a:do if((a|0)>0){f=0;while(1){h=c[d+(f<<2)>>2]|0;g=c[e+(f<<2)>>2]|0;if(!(c[b+(f<<2)>>2]|0)){if((h|0)<(g|0)){f=1;break a}if((h|0)>(g|0)){f=0;break a}}else {if((h|0)>(g|0)){f=1;break a}if((h|0)<(g|0)){f=0;break a}}f=f+1|0;if((f|0)>=(a|0)){f=0;break}}}else f=0;while(0);return f|0}function x6(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;k=O(e,d)|0;e=(d|0)==0?0:e;if((c[f+76>>2]|0)>-1)j=J3(f)|0;else j=0;g=f+74|0;h=a[g>>0]|0;a[g>>0]=h+255|h;g=f+4|0;h=c[g>>2]|0;m=(c[f+8>>2]|0)-h|0;i=m>>>0>>0?m:k;if((m|0)>0){W6(b|0,h|0,i|0)|0;c[g>>2]=h+i;g=k-i|0;b=b+i|0;}else g=k;a:do if(!g)l=13;else {i=f+32|0;while(1){if(_2(f)|0)break;h=nb[c[i>>2]&63](f,b,g)|0;if((h+1|0)>>>0<2)break;g=g-h|0;if(!g){l=13;break a}else b=b+h|0;}if(j|0)K3(f);e=((k-g|0)>>>0)/(d>>>0)|0;}while(0);if((l|0)==13)if(j)K3(f);return e|0}function y6(a){a=a|0;var b=0;if((c[a+76>>2]|0)>-1){b=(J3(a)|0)==0;a=z6(a)|0;}else a=z6(a)|0;return a|0}function z6(a){a=a|0;var b=0;if(!(c[a>>2]&128))b=1;else b=(c[a+20>>2]|0)>>>0>(c[a+28>>2]|0)>>>0?2:1;b=nb[c[a+40>>2]&63](a,0,b)|0;if((b|0)>=0)b=b-(c[a+8>>2]|0)+(c[a+4>>2]|0)+(c[a+20>>2]|0)-(c[a+28>>2]|0)|0;return b|0}function A6(a){a=a|0;(c[a+76>>2]|0)>-1?J3(a)|0:0;return c[a+60>>2]|0}function B6(b){b=b|0;var d=0,e=0,f=0,g=0;f=c[15679]|0;if((c[f+76>>2]|0)>-1)g=J3(f)|0;else g=0;do if((T4(b,f)|0)<0)b=-1;else {if((a[f+75>>0]|0)!=10?(d=f+20|0,e=c[d>>2]|0,e>>>0<(c[f+16>>2]|0)>>>0):0){c[d>>2]=e+1;a[e>>0]=10;b=0;break}b=(V4(f,10)|0)>>31;}while(0);if(g|0)K3(f);return b|0}function C6(){var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=l;l=l+48|0;i=k+24|0;h=k+16|0;g=k;d=k+28|0;b=d;e=153686;f=b+20|0;do{a[b>>0]=a[e>>0]|0;b=b+1|0;e=e+1|0;}while((b|0)<(f|0));e=d+13|0;b=0;while(1){x4(e)|0;c[g>>2]=d;c[g+4>>2]=32962;c[g+8>>2]=384;f=c2(Ha(5,g|0)|0)|0;if((f|0)>-1){j=4;break}if((b|0)<99)b=b+1|0;else {b=0;break}}if((j|0)==4){c[h>>2]=d;wa(10,h|0)|0;b=P4(f,153706)|0;if(!b){c[i>>2]=f;Ja(6,i|0)|0;b=0;}}l=k;return b|0}function D6(a){a=a|0;var b=0,e=0,f=0;if((c[a+76>>2]|0)>=0?(J3(a)|0)!=0:0){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0;}else b=Z2(a)|0;}else f=3;do if((f|0)==3){b=a+4|0;e=c[b>>2]|0;if(e>>>0<(c[a+8>>2]|0)>>>0){c[b>>2]=e+1;b=d[e>>0]|0;break}else {b=Z2(a)|0;break}}while(0);return b|0}function E6(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;if((c[d+76>>2]|0)>=0?(J3(d)|0)!=0:0){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(i=d+20|0,j=c[i>>2]|0,j>>>0<(c[d+16>>2]|0)>>>0):0){c[i>>2]=j+1;a[j>>0]=f;}else e=V4(d,b)|0;K3(d);}else k=3;do if((k|0)==3){f=b&255;e=b&255;if((e|0)!=(a[d+75>>0]|0)?(g=d+20|0,h=c[g>>2]|0,h>>>0<(c[d+16>>2]|0)>>>0):0){c[g>>2]=h+1;a[h>>0]=f;break}e=V4(d,b)|0;}while(0);return e|0}function F6(a){a=a|0;return y6(a)|0}function G6(){}function H6(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;e=b&65535;c=O(e,f)|0;d=a>>>16;a=(c>>>16)+(O(e,d)|0)|0;e=b>>>16;b=O(e,f)|0;return (z=(a>>>16)+(O(e,d)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|c&65535|0)|0}function I6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;c=H6(e,f)|0;a=z;return (z=(O(b,f)|0)+(O(d,e)|0)+a|a&0,c|0|0)|0}function J6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return (z=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function K6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (z=d,a-c>>>0|0)|0}function L6(b){b=b|0;var c=0;c=a[n+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[n+(b>>>24)>>0]|0)+24|0} -function M6(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=a;j=b;k=j;h=d;n=e;i=n;if(!k){g=(f|0)!=0;if(!i){if(g){c[f>>2]=(l>>>0)%(h>>>0);c[f+4>>2]=0;}n=0;f=(l>>>0)/(h>>>0)>>>0;return (z=n,f)|0}else {if(!g){n=0;f=0;return (z=n,f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;f=0;return (z=n,f)|0}}g=(i|0)==0;do if(h){if(!g){g=(R(i|0)|0)-(R(k|0)|0)|0;if(g>>>0<=31){m=g+1|0;i=31-g|0;b=g-31>>31;h=m;a=l>>>(m>>>0)&b|k<>>(m>>>0)&b;g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;n=0;f=0;return (z=n,f)|0}g=h-1|0;if(g&h|0){i=(R(h|0)|0)+33-(R(k|0)|0)|0;p=64-i|0;m=32-i|0;j=m>>31;o=i-32|0;b=o>>31;h=i;a=m-1>>31&k>>>(o>>>0)|(k<>>(i>>>0))&b;b=b&k>>>(i>>>0);g=l<>>(o>>>0))&j|l<>31;break}if(f|0){c[f>>2]=g&l;c[f+4>>2]=0;}if((h|0)==1){o=j|b&0;p=a|0|0;return (z=o,p)|0}else {p=L6(h|0)|0;o=k>>>(p>>>0)|0;p=k<<32-p|l>>>(p>>>0)|0;return (z=o,p)|0}}else {if(g){if(f|0){c[f>>2]=(k>>>0)%(h>>>0);c[f+4>>2]=0;}o=0;p=(k>>>0)/(h>>>0)>>>0;return (z=o,p)|0}if(!l){if(f|0){c[f>>2]=0;c[f+4>>2]=(k>>>0)%(i>>>0);}o=0;p=(k>>>0)/(i>>>0)>>>0;return (z=o,p)|0}g=i-1|0;if(!(g&i)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=g&k|b&0;}o=0;p=k>>>((L6(i|0)|0)>>>0);return (z=o,p)|0}g=(R(i|0)|0)-(R(k|0)|0)|0;if(g>>>0<=30){b=g+1|0;i=31-g|0;h=b;a=k<>>(b>>>0);b=k>>>(b>>>0);g=0;i=l<>2]=a|0;c[f+4>>2]=j|b&0;o=0;p=0;return (z=o,p)|0}while(0);if(!h){k=i;j=0;i=0;}else {m=d|0|0;l=n|e&0;k=J6(m|0,l|0,-1,-1)|0;d=z;j=i;i=0;do{e=j;j=g>>>31|j<<1;g=i|g<<1;e=a<<1|e>>>31|0;n=a>>>31|b<<1|0;K6(k|0,d|0,e|0,n|0)|0;p=z;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;a=K6(e|0,n|0,o&m|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l|0)|0;b=z;h=h-1|0;}while((h|0)!=0);k=j;j=0;}h=0;if(f|0){c[f>>2]=a;c[f+4>>2]=b;}o=(g|0)>>>31|(k|h)<<1|(h<<1|g>>>31)&0|j;p=(g<<1|0>>>31)&-2|i;return (z=o,p)|0}function N6(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return M6(a,b,c,d,0)|0}function O6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=l;l=l+16|0;f=g|0;M6(a,b,d,e,f)|0;l=g;return (z=c[f+4>>2]|0,c[f>>2]|0)|0}function P6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b>>c;return a>>>c|(b&(1<>c-32|0}function Q6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b>>>c;return a>>>c|(b&(1<>>c-32|0}function R6(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){z=b<>>32-c;return a<>8&255|0}function T6(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function U6(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;q=q+1|0;c[a>>2]=q;while((f|0)<(e|0)){if(!(c[d+(f<<3)>>2]|0)){c[d+(f<<3)>>2]=q;c[d+((f<<3)+4)>>2]=b;c[d+((f<<3)+8)>>2]=0;z=e;return d|0}f=f+1|0;}e=e*2|0;d=W1(d|0,8*(e+1|0)|0)|0;d=U6(a|0,b|0,d|0,e|0)|0;z=e;return d|0}function V6(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;while((f|0)<(d|0)){e=c[b+(f<<3)>>2]|0;if(!e)break;if((e|0)==(a|0))return c[b+((f<<3)+4)>>2]|0;f=f+1|0;}return 0}function W6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192)return Ra(b|0,d|0,e|0)|0;h=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return h|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0;}e=g&-4|0;f=e-64|0;while((b|0)<=(f|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0;}while((b|0)<(e|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;}}else {e=g-4|0;while((b|0)<(e|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0;}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;}return h|0}function X6(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0;}b=e;}else W6(b,c,d)|0;return b|0}function Y6(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0;}f=h&-4|0;g=f-64|0;i=d|d<<8|d<<16|d<<24;while((b|0)<=(g|0)){c[b>>2]=i;c[b+4>>2]=i;c[b+8>>2]=i;c[b+12>>2]=i;c[b+16>>2]=i;c[b+20>>2]=i;c[b+24>>2]=i;c[b+28>>2]=i;c[b+32>>2]=i;c[b+36>>2]=i;c[b+40>>2]=i;c[b+44>>2]=i;c[b+48>>2]=i;c[b+52>>2]=i;c[b+56>>2]=i;c[b+60>>2]=i;b=b+64|0;}while((b|0)<(f|0)){c[b>>2]=i;b=b+4|0;}}while((b|0)<(h|0)){a[b>>0]=d;b=b+1|0;}return h-e|0}function Z6(a){a=a|0;var b=0,d=0;d=a+15&-16|0;b=c[i>>2]|0;a=b+d|0;if((d|0)>0&(a|0)<(b|0)|(a|0)<0){W()|0;va(12);return -1}c[i>>2]=a;if((a|0)>(V()|0)?(U()|0)==0:0){c[i>>2]=b;va(12);return -1}return b|0}function _6(a){a=a|0;return +gb[a&1]()}function $6(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;return +hb[a&7](+b,+c,+d)}function a7(a,b){a=a|0;b=b|0;return +ib[a&1](b|0)}function b7(a){a=a|0;return jb[a&3]()|0}function c7(a,b){a=a|0;b=b|0;return kb[a&63](b|0)|0}function d7(a,b,c){a=a|0;b=b|0;c=c|0;return lb[a&127](b|0,c|0)|0}function e7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=+e;return mb[a&3](b|0,c|0,+d,+e)|0}function f7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nb[a&63](b|0,c|0,d|0)|0}function g7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return ob[a&127](b|0,c|0,d|0,e|0)|0}function h7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return pb[a&127](b|0,c|0,d|0,e|0,f|0)|0}function i7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return qb[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function j7(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;return rb[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)|0}function k7(a){a=a|0;sb[a&15]();}function l7(a,b){a=a|0;b=b|0;tb[a&127](b|0);}function m7(a,b,c){a=a|0;b=b|0;c=c|0;ub[a&63](b|0,c|0);}function n7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;vb[a&127](b|0,c|0,d|0);}function o7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;g=g|0;wb[a&15](b|0,c|0,d|0,+e,+f,g|0);}function p7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;xb[a&31](b|0,c|0,d|0,e|0);}function q7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;yb[a&15](b|0,c|0,d|0,e|0,f|0);}function r7(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;zb[a&15](b|0,c|0,d|0,e|0,f|0,g|0);}function s7(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;Ab[a&0](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0);}function t7(){S(0);return 0.0}function u7(a,b,c){a=+a;b=+b;c=+c;S(1);return 0.0}function v7(a){a=a|0;S(2);return 0.0}function w7(){S(3);return 0}function x7(a){a=a|0;S(4);return 0}function y7(a,b){a=a|0;b=b|0;S(5);return 0}function z7(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;S(6);return 0}function A7(a,b,c){a=a|0;b=b|0;c=c|0;S(7);return 0}function B7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S(8);return 0}function C7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;S(9);return 0}function D7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;S(10);return 0}function E7(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;S(11);return 0}function F7(){S(12);}function G7(a){a=a|0;S(13);}function H7(a,b){a=a|0;b=b|0;S(14);}function I7(a,b,c){a=a|0;b=b|0;c=c|0;S(15);}function J7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=+e;f=f|0;S(16);}function K7(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;S(17);}function L7(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;S(18);}function M7(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;S(19);}function N7(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;S(20);} - -// EMSCRIPTEN_END_FUNCS -var gb=[t7,UO];var hb=[u7,eJ,dJ,fJ,gJ,u7,u7,u7];var ib=[v7,$O];var jb=[w7,$q,TK,KL];var kb=[x7,ch,xg,Lm,Mm,YB,$B,HQ,IQ,zS,AS,BS,CS,DS,ES,FS,GS,$1,Ib,qF,yl,Bl,_m,KK,tB,jC,sB,PK,UK,uB,tQ,JK,yQ,zQ,sY,T1,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7,x7];var lb=[y7,AB,XB,aC,TN,UN,LN,HN,pN,$W,aX,bX,cX,dX,eX,gX,hX,iX,jX,kX,lX,mX,nX,oX,pX,qX,rX,sX,tX,uX,vX,wX,xX,yX,zX,AX,BX,CX,DX,EX,N_,O_,Q_,l$,m$,n$,o$,p$,q$,r$,s$,j0,k0,m0,A$,B$,D$,oF,ng,bh,Eh,gi,yi,Jk,Hk,zl,Cl,Zo,hq,jr,Fr,Hr,Jr,Kr,Mr,Lr,Xr,ht,mt,ot,tv,sx,EE,DE,CE,vG,kC,MK,IG,YG,TG,UG,VH,T4,E6,OO,aQ,QA,eV,XA,ZA,uQ,s2,FT,_W,oY,pY,W1,B_,C_,D_,o6,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7,y7];var mb=[z7,qu,vu,z7];var nb=[A7,Hm,Mv,Dz,Lz,Uz,Zz,WB,_B,WL,PP,QU,R_,n0,E$,a2,b2,f2,g2,W3,gA,Xm,Av,rp,nt,Vx,Xx,_x,$z,tG,m4,ND,w4,QO,SL,HR,lY,Y$,P0,J0,T0,d5,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7,A7];var ob=[B7,Jm,Rr,Nv,Fz,Nz,VA,SD,WA,nB,CB,EB,PB,OB,bC,fC,hC,ML,RP,iR,gR,eT,SU,mV,lV,G_,H_,I_,J_,K_,L_,M_,P_,T_,c0,d0,e0,f0,g0,h0,i0,l0,p0,t$,u$,v$,w$,x$,y$,z$,C$,G$,cA,TC,xG,SO,fZ,iZ,pZ,AZ,JZ,PZ,NZ,QZ,z_,U0,m_,_$,$$,Q0,R0,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7,B7];var pb=[C7,BB,qN,MN,U_,V_,j$,k$,G0,q0,r0,H$,I$,E_,F_,W0,X0,Y0,Z0,$0,a1,b1,c1,d1,f1,g1,h1,i1,j1,e1,J1,K1,A1,t1,k1,l1,m1,o1,n1,p1,q1,r1,s1,u1,v1,w1,x1,y1,z1,B1,C1,D1,E1,I1,G1,F1,H1,P1,L1,M1,N1,O1,Q1,R1,S1,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7,C7];var qb=[D7,RX];var rb=[E7,I0,S0,E7];var sb=[F7,TO,QK,RK,SK,WK,XK,YK,WU,F7,F7,F7,F7,F7,F7,F7];var tb=[G7,Mb,Nb,Rb,Sb,Tb,lc,mc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,ad,bd,ed,fd,gd,hd,id,jd,kd,wd,xd,yd,Ad,Bd,Cd,Dd,Ed,Fd,Gd,Hd,Sd,Td,Ud,Wd,Xd,Yd,Zd,_d,$d,ae,be,ce,ee,re,se,te,ue,Fe,Ge,He,Je,We,Xe,Ye,_e,$e,af,bf,cf,df,ef,ff,gf,qf,rf,sf,tf,Wf,Rf,pm,$l,dp,Eo,Op,Xp,_n,ao,Lp,Mp,Xl,Yl,co,lo,no,yo,FB,XM,nN,ZM,YM,JN,uM,xM,HS,MS,Kf,Dl,Io,Mo,ep,U1,Xv,tA,yG,rI,VU,AR,BQ,NL,nV,QX,jY,kY,qY,G7,G7,G7,G7,G7,G7,G7,G7,G7];var ub=[H7,Sc,Xc,md,rd,Od,ke,Ae,Pe,nf,zf,cC,rN,VN,NN,IN,lN,mN,RN,SN,KS,OS,cM,jA,uG,VK,sQ,RW,PX,mY,nY,rY,tY,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7,H7];var vb=[I7,Ub,Vb,Yb,Jc,Rc,Tc,Wc,ld,nd,qd,Jd,Kd,Nd,fe,ge,je,ve,we,ze,Ke,Le,Oe,hf,jf,mf,uf,vf,yf,ok,pk,qk,Im,Ez,Mz,qA,GB,gC,PC,TD,lG,QJ,LL,XL,wM,QP,TP,hR,fR,IS,JS,LS,NS,PS,RU,EW,DW,JA,jB,uC,XC,_C,OK,RO,QL,wQ,AQ,FW,HW,IW,QW,SW,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7,I7];var wb=[J7,MH,NH,OH,PH,QH,RH,SH,TH,J7,J7,J7,J7,J7,J7,J7];var xb=[K7,Wb,Uc,od,zd,Ld,Vd,he,xe,Me,Ze,kf,wf,Nf,Mf,Lf,Jf,If,Hf,kc,Gf,Ff,DB,oN,KN,S_,o0,F$,o4,vQ,xQ,a0];var yb=[L7,cd,Id,Pd,de,Ie,Al,wG,CQ,L7,L7,L7,L7,L7,L7,L7];var zb=[M7,Xb,Vc,pd,Md,ie,ye,Ne,lf,xf,DQ,M7,M7,M7,M7,M7];var Ab=[N7];return {___errno_location:d2,___muldi3:I6,___udivdi3:N6,___uremdi3:O6,_bitshift64Ashr:P6,_bitshift64Lshr:Q6,_bitshift64Shl:R6,_dtextract:Sz,_free:U1,_htons:a4,_i64Add:J6,_i64Subtract:K6,_llvm_bswap_i16:S6,_llvm_bswap_i32:T6,_malloc:T1,_memalign:Z1,_memcpy:W6,_memmove:X6,_memset:Y6,_realloc:W1,_saveSetjmp:U6,_sbrk:Z6,_testSetjmp:V6,_vizCreateFile:Kb,_vizLastErrorMessage:Jb,_vizRenderFromString:Lb,dynCall_d:_6,dynCall_dddd:$6,dynCall_di:a7,dynCall_i:b7,dynCall_ii:c7,dynCall_iii:d7,dynCall_iiidd:e7,dynCall_iiii:f7,dynCall_iiiii:g7,dynCall_iiiiii:h7,dynCall_iiiiiii:i7,dynCall_iiiiiiiiiii:j7,dynCall_v:k7,dynCall_vi:l7,dynCall_vii:m7,dynCall_viii:n7,dynCall_viiiddi:o7,dynCall_viiii:p7,dynCall_viiiii:q7,dynCall_viiiiii:r7,dynCall_viiiiiiiii:s7,establishStackSpace:Eb,getTempRet0:Hb,runPostSets:G6,setTempRet0:Gb,setThrew:Fb,stackAlloc:Bb,stackRestore:Db,stackSave:Cb}}) - - -// EMSCRIPTEN_END_ASM -(Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["___errno_location"]=asm["___errno_location"];Module["___muldi3"]=asm["___muldi3"];Module["___udivdi3"]=asm["___udivdi3"];Module["___uremdi3"]=asm["___uremdi3"];Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];Module["_bitshift64Shl"]=asm["_bitshift64Shl"];Module["_dtextract"]=asm["_dtextract"];var _free=Module["_free"]=asm["_free"];Module["_htons"]=asm["_htons"];Module["_i64Add"]=asm["_i64Add"];Module["_i64Subtract"]=asm["_i64Subtract"];Module["_llvm_bswap_i16"]=asm["_llvm_bswap_i16"];Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memalign=Module["_memalign"]=asm["_memalign"];Module["_memcpy"]=asm["_memcpy"];Module["_memmove"]=asm["_memmove"];var _memset=Module["_memset"]=asm["_memset"];Module["_realloc"]=asm["_realloc"];Module["_saveSetjmp"]=asm["_saveSetjmp"];Module["_sbrk"]=asm["_sbrk"];Module["_testSetjmp"]=asm["_testSetjmp"];Module["_vizCreateFile"]=asm["_vizCreateFile"];Module["_vizLastErrorMessage"]=asm["_vizLastErrorMessage"];Module["_vizRenderFromString"]=asm["_vizRenderFromString"];Module["establishStackSpace"]=asm["establishStackSpace"];Module["getTempRet0"]=asm["getTempRet0"];Module["runPostSets"]=asm["runPostSets"];Module["setTempRet0"]=asm["setTempRet0"];Module["setThrew"]=asm["setThrew"];var stackAlloc=Module["stackAlloc"]=asm["stackAlloc"];var stackRestore=Module["stackRestore"]=asm["stackRestore"];var stackSave=Module["stackSave"]=asm["stackSave"];Module["dynCall_d"]=asm["dynCall_d"];Module["dynCall_dddd"]=asm["dynCall_dddd"];Module["dynCall_di"]=asm["dynCall_di"];Module["dynCall_i"]=asm["dynCall_i"];Module["dynCall_ii"]=asm["dynCall_ii"];Module["dynCall_iii"]=asm["dynCall_iii"];Module["dynCall_iiidd"]=asm["dynCall_iiidd"];Module["dynCall_iiii"]=asm["dynCall_iiii"];Module["dynCall_iiiii"]=asm["dynCall_iiiii"];Module["dynCall_iiiiii"]=asm["dynCall_iiiiii"];Module["dynCall_iiiiiii"]=asm["dynCall_iiiiiii"];Module["dynCall_iiiiiiiiiii"]=asm["dynCall_iiiiiiiiiii"];Module["dynCall_v"]=asm["dynCall_v"];Module["dynCall_vi"]=asm["dynCall_vi"];Module["dynCall_vii"]=asm["dynCall_vii"];Module["dynCall_viii"]=asm["dynCall_viii"];Module["dynCall_viiiddi"]=asm["dynCall_viiiddi"];Module["dynCall_viiii"]=asm["dynCall_viiii"];Module["dynCall_viiiii"]=asm["dynCall_viiiii"];Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];Module["dynCall_viiiiiiiii"]=asm["dynCall_viiiiiiiii"];Module["asm"]=asm;Module["ccall"]=ccall;Module["Pointer_stringify"]=Pointer_stringify;Module["UTF8ToString"]=UTF8ToString;if(memoryInitializer){if(!isDataURI(memoryInitializer)){if(typeof Module["locateFile"]==="function"){memoryInitializer=Module["locateFile"](memoryInitializer);}else if(Module["memoryInitializerPrefixURL"]){memoryInitializer=Module["memoryInitializerPrefixURL"]+memoryInitializer;}}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=Module["readBinary"](memoryInitializer);HEAPU8.set(data,GLOBAL_BASE);}else {addRunDependency();var applyMemoryInitializer=(function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,GLOBAL_BASE);if(Module["memoryInitializerRequest"])delete Module["memoryInitializerRequest"].response;removeRunDependency();});function doBrowserLoad(){Module["readAsync"](memoryInitializer,applyMemoryInitializer,(function(){throw "could not load memory initializer "+memoryInitializer}));}var memoryInitializerBytes=tryParseAsDataURI(memoryInitializer);if(memoryInitializerBytes){applyMemoryInitializer(memoryInitializerBytes.buffer);}else if(Module["memoryInitializerRequest"]){function useRequest(){var request=Module["memoryInitializerRequest"];var response=request.response;if(request.status!==200&&request.status!==0){var data=tryParseAsDataURI(Module["memoryInitializerRequestURL"]);if(data){response=data.buffer;}else {console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+request.status+", retrying "+memoryInitializer);doBrowserLoad();return}}applyMemoryInitializer(response);}if(Module["memoryInitializerRequest"].response){setTimeout(useRequest,0);}else {Module["memoryInitializerRequest"].addEventListener("load",useRequest);}}else {doBrowserLoad();}}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller;};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("");}),1);doRun();}),1);}else {doRun();}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]);else {ABORT=true;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status);}if(ENVIRONMENT_IS_NODE){process["exit"](status);}Module["quit"](status,new ExitStatus(status));}Module["exit"]=exit;function abort(what){if(Module["onAbort"]){Module["onAbort"](what);}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what);}else {what="";}ABORT=true;throw "abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()();}}Module["noExitRuntime"]=true;run(); - - - - - return Module; -}; -function Viz(src) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - var format = options.format === undefined ? "svg" : options.format; - var engine = options.engine === undefined ? "dot" : options.engine; - var scale = options.scale; - var totalMemory = options.totalMemory; - var files = options.files === undefined ? [] : options.files; - var images = options.images === undefined ? [] : options.images; - var i; - - for (i = 0; i < images.length; i++) { - files.push({ path: images[i].path, data: "\n\n" }); - } - - if (format == "png-image-element") { - return Viz.svgXmlToPngImageElement(render(src, "svg", engine, totalMemory, files), scale); - } else { - return render(src, format, engine, totalMemory, files); - } -} - -function render(src, format, engine, totalMemory, files) { - var graphviz = Module({ TOTAL_MEMORY: totalMemory }); - var i; - - for (i = 0; i < files.length; i++) { - graphviz["ccall"]("vizCreateFile", "number", ["string", "string"], [files[i].path, files[i].data]); - } - - var resultPointer = graphviz["ccall"]("vizRenderFromString", "number", ["string", "string", "string"], [src, format, engine]); - var resultString = graphviz["Pointer_stringify"](resultPointer); - - var errorMessagePointer = graphviz["ccall"]("vizLastErrorMessage", "number", [], []); - var errorMessageString = graphviz["Pointer_stringify"](errorMessagePointer); - - if (errorMessageString != "") { - throw new Error(errorMessageString); - } - - return resultString; -} - -// https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding -function b64EncodeUnicode(str) { - return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { - return String.fromCharCode('0x' + p1); - })); -} - -Viz.svgXmlToPngImageElement = function(svgXml, scale, callback) { - if (scale === undefined) { - if ("devicePixelRatio" in window && window.devicePixelRatio > 1) { - scale = window.devicePixelRatio; - } else { - scale = 1; - } - } - - var pngImage = new Image(); - - try { - if (typeof fabric === "object" && fabric.loadSVGFromString) { - fabric.loadSVGFromString(svgXml, function(objects, options) { - // If there's something wrong with the SVG, Fabric may return an empty array of objects. Graphviz appears to give us at least one element back even given an empty graph, so we will assume an error in this case. - if (objects.length == 0) { - if (callback !== undefined) { - callback(new Error("Error loading SVG with Fabric")); - return; - } else { - throw new Error("Error loading SVG with Fabric"); - } - } - - var element = document.createElement("canvas"); - element.width = options.width; - element.height = options.height; - - var canvas = new fabric.Canvas(element, { enableRetinaScaling: false }); - var obj = fabric.util.groupSVGElements(objects, options); - canvas.add(obj).renderAll(); - - pngImage.src = canvas.toDataURL({ multiplier: scale }); - pngImage.width = options.width; - pngImage.height = options.height; - - if (callback !== undefined) { - callback(null, pngImage); - } - }); - } else { - var svgImage = new Image(); - - svgImage.onload = function() { - var canvas = document.createElement("canvas"); - canvas.width = svgImage.width * scale; - canvas.height = svgImage.height * scale; - - var context = canvas.getContext("2d"); - context.drawImage(svgImage, 0, 0, canvas.width, canvas.height); - - pngImage.src = canvas.toDataURL("image/png"); - pngImage.width = svgImage.width; - pngImage.height = svgImage.height; - - if (callback !== undefined) { - callback(null, pngImage); - } - }; - - svgImage.onerror = function(e) { - var error; - - if ('error' in e) { - error = e.error; - } else { - error = new Error('Error loading SVG'); - } - - if (callback !== undefined) { - callback(error); - } else { - throw error; - } - }; - - svgImage.src = "data:image/svg+xml;base64," + b64EncodeUnicode(svgXml); - } - } catch (e) { - if (callback !== undefined) { - callback(e); - } else { - throw e; - } - } - - if (callback === undefined) { - return pngImage; - } -}; - -Viz.svgXmlToPngBase64 = function(svgXml, scale, callback) { - Viz.svgXmlToPngImageElement(svgXml, scale, function(err, image) { - if (err) { - callback(err); - } else { - callback(null, image.src.slice("data:image/png;base64,".length)); - } - }); -}; -{ - module.exports = Viz; -} - -})(); -}(viz)); - -function formatDecimal(x) { - return Math.abs(x = Math.round(x)) >= 1e21 - ? x.toLocaleString("en").replace(/,/g, "") - : x.toString(10); -} - -// Computes the decimal coefficient and exponent of the specified number x with -// significant digits p, where x is positive and p is in [1, 21] or undefined. -// For example, formatDecimalParts(1.23) returns ["123", 0]. -function formatDecimalParts(x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - var i, coefficient = x.slice(0, i); - - // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x.slice(i + 1) - ]; -} - -function exponent(x) { - return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; -} - -function formatGroup(grouping, thousands) { - return function(value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - - return t.reverse().join(thousands); - }; -} - -function formatNumerals(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; -} - -// [[fill]align][sign][symbol][0][width][,][.precision][~][type] -var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - -function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); -} - -formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof - -function FormatSpecifier(specifier) { - this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; - this.align = specifier.align === undefined ? ">" : specifier.align + ""; - this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? "" : specifier.type + ""; -} - -FormatSpecifier.prototype.toString = function() { - return this.fill - + this.align - + this.sign - + this.symbol - + (this.zero ? "0" : "") - + (this.width === undefined ? "" : Math.max(1, this.width | 0)) - + (this.comma ? "," : "") - + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) - + (this.trim ? "~" : "") - + this.type; -}; - -// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. -function formatTrim(s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": i0 = i1 = i; break; - case "0": if (i0 === 0) i0 = i; i1 = i; break; - default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; - } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; -} - -var prefixExponent; - -function formatPrefixAuto(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient - : i > n ? coefficient + new Array(i - n + 1).join("0") - : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) - : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! -} - -function formatRounded(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient - : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) - : coefficient + new Array(exponent - coefficient.length + 2).join("0"); -} - -var formatTypes = { - "%": function(x, p) { return (x * 100).toFixed(p); }, - "b": function(x) { return Math.round(x).toString(2); }, - "c": function(x) { return x + ""; }, - "d": formatDecimal, - "e": function(x, p) { return x.toExponential(p); }, - "f": function(x, p) { return x.toFixed(p); }, - "g": function(x, p) { return x.toPrecision(p); }, - "o": function(x) { return Math.round(x).toString(8); }, - "p": function(x, p) { return formatRounded(x * 100, p); }, - "r": formatRounded, - "s": formatPrefixAuto, - "X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, - "x": function(x) { return Math.round(x).toString(16); } -}; - -function identity$1(x) { - return x; -} - -var map = Array.prototype.map, - prefixes$1 = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; - -function formatLocale(locale) { - var group = locale.grouping === undefined || locale.thousands === undefined ? identity$1 : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), - currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", - currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", - decimal = locale.decimal === undefined ? "." : locale.decimal + "", - numerals = locale.numerals === undefined ? identity$1 : formatNumerals(map.call(locale.numerals, String)), - percent = locale.percent === undefined ? "%" : locale.percent + "", - minus = locale.minus === undefined ? "-" : locale.minus + "", - nan = locale.nan === undefined ? "NaN" : locale.nan + ""; - - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; - - // The "n" type is an alias for ",g". - if (type === "n") comma = true, type = "g"; - - // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; - - // If zero fill is specified, padding goes after sign and before digits. - if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; - - // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; - - // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); - - // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - precision = precision === undefined ? 6 - : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) - : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, n, c; - - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - - // Determine the sign. -0 is not less than 0, but 1 / -0 is! - var valueNegative = value < 0 || 1 / value < 0; - - // Perform the initial formatting. - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - - // Trim insignificant zeros. - if (trim) value = formatTrim(value); - - // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; - - // Compute the prefix and suffix. - valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes$1[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); - - // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - - // If the fill character is not "0", grouping is applied before padding. - if (comma && !zero) value = group(value, Infinity); - - // Compute the padding. - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; - - // If the fill character is "0", grouping is applied after padding. - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; - - // Reconstruct the final output based on the desired alignment. - switch (align) { - case "<": value = valuePrefix + value + valueSuffix + padding; break; - case "=": value = valuePrefix + padding + value + valueSuffix; break; - case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; - default: value = padding + valuePrefix + value + valueSuffix; break; - } - - return numerals(value); - } - - format.toString = function() { - return specifier + ""; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes$1[8 + e / 3]; - return function(value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix - }; -} - -var locale; -var format$6; -var formatPrefix; - -defaultLocale({ - decimal: ".", - thousands: ",", - grouping: [3], - currency: ["$", ""], - minus: "-" -}); - -function defaultLocale(definition) { - locale = formatLocale(definition); - format$6 = locale.format; - formatPrefix = locale.formatPrefix; - return locale; -} - -function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); -} - -function precisionPrefix(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); -} - -function precisionRound(step, max) { - step = Math.abs(step), max = Math.abs(max) - step; - return Math.max(0, exponent(max) - exponent(step)) + 1; -} - -var src$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - formatDefaultLocale: defaultLocale, - get format () { return format$6; }, - get formatPrefix () { return formatPrefix; }, - formatLocale: formatLocale, - formatSpecifier: formatSpecifier, - FormatSpecifier: FormatSpecifier, - precisionFixed: precisionFixed, - precisionPrefix: precisionPrefix, - precisionRound: precisionRound -}); - -var require$$7 = /*@__PURE__*/getAugmentedNamespace(src$5); - -var pi = Math.PI, - tau = 2 * pi, - epsilon = 1e-6, - tauEpsilon = tau - epsilon; - -function Path$a() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; // end of current subpath - this._ = ""; -} - -function path$h() { - return new Path$a; -} - -Path$a.prototype = path$h.prototype = { - constructor: Path$a, - moveTo: function(x, y) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y); - }, - closePath: function() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._ += "Z"; - } - }, - lineTo: function(x, y) { - this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y); - }, - quadraticCurveTo: function(x1, y1, x, y) { - this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - bezierCurveTo: function(x1, y1, x2, y2, x, y) { - this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - arcTo: function(x1, y1, x2, y2, r) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; - var x0 = this._x1, - y0 = this._y1, - x21 = x2 - x1, - y21 = y2 - y1, - x01 = x0 - x1, - y01 = y0 - y1, - l01_2 = x01 * x01 + y01 * y01; - - // Is the radius negative? Error. - if (r < 0) throw new Error("negative radius: " + r); - - // Is this path empty? Move to (x1,y1). - if (this._x1 === null) { - this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); - } - - // Or, is (x1,y1) coincident with (x0,y0)? Do nothing. - else if (!(l01_2 > epsilon)); - - // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? - // Equivalently, is (x1,y1) coincident with (x2,y2)? - // Or, is the radius zero? Line to (x1,y1). - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } - - // Otherwise, draw an arc! - else { - var x20 = x2 - x0, - y20 = y2 - y0, - l21_2 = x21 * x21 + y21 * y21, - l20_2 = x20 * x20 + y20 * y20, - l21 = Math.sqrt(l21_2), - l01 = Math.sqrt(l01_2), - l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), - t01 = l / l01, - t21 = l / l21; - - // If the start tangent is not coincident with (x0,y0), line to. - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } - - this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); - } - }, - arc: function(x, y, r, a0, a1, ccw) { - x = +x, y = +y, r = +r, ccw = !!ccw; - var dx = r * Math.cos(a0), - dy = r * Math.sin(a0), - x0 = x + dx, - y0 = y + dy, - cw = 1 ^ ccw, - da = ccw ? a0 - a1 : a1 - a0; - - // Is the radius negative? Error. - if (r < 0) throw new Error("negative radius: " + r); - - // Is this path empty? Move to (x0,y0). - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } - - // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). - else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } - - // Is this arc empty? We’re done. - if (!r) return; - - // Does the angle go the wrong way? Flip the direction. - if (da < 0) da = da % tau + tau; - - // Is this a complete circle? Draw two arcs to complete the circle. - if (da > tauEpsilon) { - this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); - } - - // Is this arc non-empty? Draw an arc! - else if (da > epsilon) { - this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); - } - }, - rect: function(x, y, w, h) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z"; - }, - toString: function() { - return this._; - } -}; - -var src$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - path: path$h -}); - -var require$$8 = /*@__PURE__*/getAugmentedNamespace(src$4); - -(function (module, exports) { -(function (global, factory) { - factory(exports, require$$0$3, require$$1$2, require$$2$1, require$$3, require$$4, require$$5$1, viz.exports, require$$7, require$$8) ; -}(commonjsGlobal, (function (exports,d3,d3Dispatch,d3Transition,d3Timer,d3Interpolate,d3Zoom,Viz,d3Format,d3Path) { -Viz = Viz && Viz.hasOwnProperty('default') ? Viz['default'] : Viz; - -function extractElementData(element) { - - var datum = {}; - var tag = element.node().nodeName; - datum.tag = tag; - if (tag == '#text') { - datum.text = element.text(); - } else if (tag == '#comment') { - datum.comment = element.text(); - } - datum.attributes = {}; - var attributes = element.node().attributes; - if (attributes) { - for (var i = 0; i < attributes.length; i++) { - var attribute = attributes[i]; - var name = attribute.name; - var value = attribute.value; - datum.attributes[name] = value; - } - } - var transform = element.node().transform; - if (transform && transform.baseVal.numberOfItems != 0) { - var matrix = transform.baseVal.consolidate().matrix; - datum.translation = { x: matrix.e, y: matrix.f }; - datum.scale = matrix.a; - } - if (tag == 'ellipse') { - datum.center = { - x: datum.attributes.cx, - y: datum.attributes.cy - }; - } - if (tag == 'polygon') { - var points = element.attr('points').split(' '); - var x = points.map(function (p) { - return p.split(',')[0]; - }); - var y = points.map(function (p) { - return p.split(',')[1]; - }); - var xmin = Math.min.apply(null, x); - var xmax = Math.max.apply(null, x); - var ymin = Math.min.apply(null, y); - var ymax = Math.max.apply(null, y); - var bbox = { - x: xmin, - y: ymin, - width: xmax - xmin, - height: ymax - ymin - }; - datum.bbox = bbox; - datum.center = { - x: (xmin + xmax) / 2, - y: (ymin + ymax) / 2 - }; - } - if (tag == 'path') { - var d = element.attr('d'); - var points = d.split(/[A-Z ]/); - points.shift(); - var x = points.map(function (p) { - return +p.split(',')[0]; - }); - var y = points.map(function (p) { - return +p.split(',')[1]; - }); - var xmin = Math.min.apply(null, x); - var xmax = Math.max.apply(null, x); - var ymin = Math.min.apply(null, y); - var ymax = Math.max.apply(null, y); - var bbox = { - x: xmin, - y: ymin, - width: xmax - xmin, - height: ymax - ymin - }; - datum.bbox = bbox; - datum.center = { - x: (xmin + xmax) / 2, - y: (ymin + ymax) / 2 - }; - datum.totalLength = element.node().getTotalLength(); - } - if (tag == 'text') { - datum.center = { - x: element.attr('x'), - y: element.attr('y') - }; - } - if (tag == '#text') { - datum.text = element.text(); - } else if (tag == '#comment') { - datum.comment = element.text(); - } - return datum; -} - -function extractAllElementsData(element) { - - var datum = extractElementData(element); - datum.children = []; - var children = d3.selectAll(element.node().childNodes); - children.each(function () { - var childData = extractAllElementsData(d3.select(this)); - childData.parent = datum; - datum.children.push(childData); - }); - return datum; -} - -function createElement(data) { - - if (data.tag == '#text') { - return document.createTextNode(""); - } else if (data.tag == '#comment') { - return document.createComment(data.comment); - } else { - return document.createElementNS('http://www.w3.org/2000/svg', data.tag); - } -} - -function createElementWithAttributes(data) { - - var elementNode = createElement(data); - var element = d3.select(elementNode); - var attributes = data.attributes; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var attributeName = _step.value; - - var attributeValue = attributes[attributeName]; - element.attr(attributeName, attributeValue); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return elementNode; -} - -function replaceElement(element, data) { - var parent = d3.select(element.node().parentNode); - var newElementNode = createElementWithAttributes(data); - var newElement = parent.insert(function () { - return newElementNode; - }, function () { - return element.node(); - }); - element.remove(); - return newElement; -} - -function insertElementData(element, datum) { - element.datum(datum); - element.data([datum], function (d) { - return d.key; - }); -} - -function insertAllElementsData(element, datum) { - insertElementData(element, datum); - var children = d3.selectAll(element.node().childNodes); - children.each(function (d, i) { - insertAllElementsData(d3.select(this), datum.children[i]); - }); -} - -function insertChildren(element, index) { - var children = element.selectAll(function () { - return element.node().childNodes; - }); - - children = children.data(function (d) { - return d.children; - }, function (d) { - return d.tag + '-' + index; - }); - var childrenEnter = children.enter().append(function (d) { - return createElement(d); - }); - - var childrenExit = children.exit(); - childrenExit = childrenExit.remove(); - children = childrenEnter.merge(children); - var childTagIndexes = {}; - children.each(function (childData) { - var childTag = childData.tag; - if (childTagIndexes[childTag] == null) { - childTagIndexes[childTag] = 0; - } - var childIndex = childTagIndexes[childTag]++; - attributeElement.call(this, childData, childIndex); - }); -} - -function attributeElement(data) { - var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var element = d3.select(this); - data.tag; - var attributes = data.attributes; - var currentAttributes = element.node().attributes; - if (currentAttributes) { - for (var i = 0; i < currentAttributes.length; i++) { - var currentAttribute = currentAttributes[i]; - var name = currentAttribute.name; - if (name.split(':')[0] != 'xmlns' && currentAttribute.namespaceURI) { - var namespaceURIParts = currentAttribute.namespaceURI.split('/'); - var namespace = namespaceURIParts[namespaceURIParts.length - 1]; - name = namespace + ':' + name; - } - if (!(name in attributes)) { - attributes[name] = null; - } - } - } - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = Object.keys(attributes)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attributeName = _step2.value; - - element.attr(attributeName, attributes[attributeName]); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - if (data.text) { - element.text(data.text); - } - insertChildren(element, index); -} - -function shallowCopyObject(obj) { - return Object.assign({}, obj); -} - -function roundTo4Decimals(x) { - return Math.round(x * 10000.0) / 10000.0; -} - -var zoom$1 = function (enable) { - - this._options.zoom = enable; - - if (this._options.zoom && !this._zoomBehavior) { - createZoomBehavior.call(this); - } - - return this; -}; - -function createZoomBehavior() { - - function zoomed() { - var g = d3.select(svg.node().querySelector("g")); - g.attr('transform', d3.event.transform); - } - - var root = this._selection; - var svg = d3.select(root.node().querySelector("svg")); - if (svg.size() == 0) { - return this; - } - this._zoomSelection = svg; - var zoomBehavior = d3Zoom.zoom().scaleExtent(this._options.zoomScaleExtent).translateExtent(this._options.zoomTranslateExtent).interpolate(d3Interpolate.interpolate).on("zoom", zoomed); - this._zoomBehavior = zoomBehavior; - var g = d3.select(svg.node().querySelector("g")); - svg.call(zoomBehavior); - if (!this._active) { - translateZoomBehaviorTransform.call(this, g); - } - this._originalTransform = d3Zoom.zoomTransform(svg.node()); - - return this; -} - -function getTranslatedZoomTransform(selection$$1) { - - // Get the current zoom transform for the top level svg and - // translate it uniformly with the given selection, using the - // difference between the translation specified in the selection's - // data and it's saved previous translation. The selection is - // normally the top level g element of the graph. - var oldTranslation = this._translation; - var oldScale = this._scale; - var newTranslation = selection$$1.datum().translation; - var newScale = selection$$1.datum().scale; - var t = d3Zoom.zoomTransform(this._zoomSelection.node()); - if (oldTranslation) { - t = t.scale(1 / oldScale); - t = t.translate(-oldTranslation.x, -oldTranslation.y); - } - t = t.translate(newTranslation.x, newTranslation.y); - t = t.scale(newScale); - return t; -} - -function translateZoomBehaviorTransform(selection$$1) { - - // Translate the current zoom transform for the top level svg - // uniformly with the given selection, using the difference - // between the translation specified in the selection's data and - // it's saved previous translation. The selection is normally the - // top level g element of the graph. - this._zoomBehavior.transform(this._zoomSelection, getTranslatedZoomTransform.call(this, selection$$1)); - - // Save the selections's new translation and scale. - this._translation = selection$$1.datum().translation; - this._scale = selection$$1.datum().scale; - - // Set the original zoom transform to the translation and scale specified in - // the selection's data. - this._originalTransform = d3Zoom.zoomIdentity.translate(selection$$1.datum().translation.x, selection$$1.datum().translation.y).scale(selection$$1.datum().scale); -} - -function resetZoom(transition$$1) { - - // Reset the zoom transform to the original zoom transform. - var selection$$1 = this._zoomSelection; - if (transition$$1) { - selection$$1 = selection$$1.transition(transition$$1); - } - selection$$1.call(this._zoomBehavior.transform, this._originalTransform); - - return this; -} - -function zoomScaleExtent(extent) { - - this._options.zoomScaleExtent = extent; - - return this; -} - -function zoomTranslateExtent(extent) { - - this._options.zoomTranslateExtent = extent; - - return this; -} - -function zoomBehavior() { - return this._zoomBehavior || null; -} - -function zoomSelection() { - return this._zoomSelection || null; -} - -function pathTween(points, d1) { - return function () { - var pointInterpolators = points.map(function (p) { - return d3Interpolate.interpolate([p[0][0], p[0][1]], [p[1][0], p[1][1]]); - }); - return function (t) { - return t < 1 ? "M" + pointInterpolators.map(function (p) { - return p(t); - }).join("L") : d1; - }; - }; -} - -function pathTweenPoints(node, d1, precision, precisionIsRelative) { - var path0 = node; - var path1 = path0.cloneNode(); - var n0 = path0.getTotalLength(); - var n1 = (path1.setAttribute("d", d1), path1).getTotalLength(); - - // Uniform sampling of distance based on specified precision. - var distances = [0]; - var i = 0; - var dt = precisionIsRelative ? precision : precision / Math.max(n0, n1); - while ((i += dt) < 1) { - distances.push(i); - } - distances.push(1); - - // Compute point-interpolators at each distance. - var points = distances.map(function (t) { - var p0 = path0.getPointAtLength(t * n0); - var p1 = path1.getPointAtLength(t * n1); - return [[p0.x, p0.y], [p1.x, p1.y]]; - }); - return points; -} - -var data = function () { - return this._data || null; -}; - -function isEdgeElementParent(datum) { - return datum.attributes.class == 'edge' || datum.tag == 'a' && datum.parent.tag == 'g' && datum.parent.parent.attributes.class == 'edge'; -} - -function isEdgeElement(datum) { - return datum.parent && isEdgeElementParent(datum.parent); -} - -function getEdgeGroup(datum) { - if (datum.parent.attributes.class == 'edge') { - return datum.parent; - } else { - // datum.parent.tag == 'g' && datum.parent.parent.tag == 'g' && datum.parent.parent.parent.attributes.class == 'edge' - return datum.parent.parent.parent; - } -} - -function getEdgeTitle(datum) { - return getEdgeGroup(datum).children.find(function (e) { - return e.tag == 'title'; - }); -} - -var render = function (callback) { - - if (this._busy) { - this._queue.push(this.render.bind(this, callback)); - return this; - } - this._dispatch.call('renderStart', this); - - if (this._transitionFactory) { - d3Timer.timeout(function () { - // Decouple from time spent. See https://github.com/d3/d3-timer/issues/27 - this._transition = d3Transition.transition(this._transitionFactory()); - _render.call(this, callback); - }.bind(this), 0); - } else { - _render.call(this, callback); - } - return this; -}; - -function _render(callback) { - - var transitionInstance = this._transition; - var fade = this._options.fade && transitionInstance != null; - var tweenPaths = this._options.tweenPaths; - var tweenShapes = this._options.tweenShapes; - var convertEqualSidedPolygons = this._options.convertEqualSidedPolygons; - var growEnteringEdges = this._options.growEnteringEdges && transitionInstance != null; - var attributer = this._attributer; - var graphvizInstance = this; - - function insertChildren(element) { - var children = element.selectAll(function () { - return element.node().childNodes; - }); - - children = children.data(function (d) { - return d.children; - }, function (d) { - return d.key; - }); - var childrenEnter = children.enter().append(function (d) { - var element = createElement(d); - if (d.tag == '#text' && fade) { - element.nodeValue = d.text; - } - return element; - }); - - if (fade || growEnteringEdges && isEdgeElementParent(element.datum())) { - var childElementsEnter = childrenEnter.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).each(function (d) { - var childEnter = d3.select(this); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(d.attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var attributeName = _step.value; - - var attributeValue = d.attributes[attributeName]; - childEnter.attr(attributeName, attributeValue); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - }); - childElementsEnter.filter(function (d) { - return d.tag == 'svg' || d.tag == 'g' ? null : this; - }).style("opacity", 0.0); - } - var childrenExit = children.exit(); - if (attributer) { - childrenExit.each(attributer); - } - if (transitionInstance) { - childrenExit = childrenExit.transition(transitionInstance); - if (fade) { - childrenExit.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).style("opacity", 0.0); - } - } - childrenExit = childrenExit.remove(); - children = childrenEnter.merge(children); - children.each(attributeElement$$1); - } - - function attributeElement$$1(data$$1) { - var element = d3.select(this); - if (data$$1.tag == "svg") { - var options = graphvizInstance._options; - if (options.width != null || options.height != null) { - var width = options.width; - var height = options.height; - if (width == null) { - width = data$$1.attributes.width.replace('pt', '') * 4 / 3; - } else { - element.attr("width", width); - data$$1.attributes.width = width; - } - if (height == null) { - height = data$$1.attributes.height.replace('pt', '') * 4 / 3; - } else { - element.attr("height", height); - data$$1.attributes.height = height; - } - if (!options.fit) { - element.attr("viewBox", "0 0 " + width * 3 / 4 / options.scale + " " + height * 3 / 4 / options.scale); - data$$1.attributes.viewBox = "0 0 " + width * 3 / 4 / options.scale + " " + height * 3 / 4 / options.scale; - } - } - if (options.scale != 1 && (options.fit || options.width == null && options.height == null)) { - width = data$$1.attributes.viewBox.split(' ')[2]; - height = data$$1.attributes.viewBox.split(' ')[3]; - element.attr("viewBox", "0 0 " + width / options.scale + " " + height / options.scale); - data$$1.attributes.viewBox = "0 0 " + width / options.scale + " " + height / options.scale; - } - } - if (attributer) { - element.each(attributer); - } - var tag = data$$1.tag; - var attributes = data$$1.attributes; - var currentAttributes = element.node().attributes; - if (currentAttributes) { - for (var i = 0; i < currentAttributes.length; i++) { - var currentAttribute = currentAttributes[i]; - var name = currentAttribute.name; - if (name.split(':')[0] != 'xmlns' && currentAttribute.namespaceURI) { - var namespaceURIParts = currentAttribute.namespaceURI.split('/'); - var namespace = namespaceURIParts[namespaceURIParts.length - 1]; - name = namespace + ':' + name; - } - if (!(name in attributes)) { - attributes[name] = null; - } - } - } - var convertShape = false; - var convertPrevShape = false; - if (tweenShapes && transitionInstance) { - if ((this.nodeName == 'polygon' || this.nodeName == 'ellipse') && data$$1.alternativeOld) { - convertPrevShape = true; - } - if ((tag == 'polygon' || tag == 'ellipse') && data$$1.alternativeNew) { - convertShape = true; - } - if (this.nodeName == 'polygon' && tag == 'polygon') { - var prevData = extractElementData(element); - var prevPoints = prevData.attributes.points; - if (!convertEqualSidedPolygons) { - var nPrevPoints = prevPoints.split(' ').length; - var points = data$$1.attributes.points; - var nPoints = points.split(' ').length; - if (nPoints == nPrevPoints) { - convertShape = false; - convertPrevShape = false; - } - } - } - if (convertPrevShape) { - var prevPathData = data$$1.alternativeOld; - var pathElement = replaceElement(element, prevPathData); - pathElement.data([data$$1], function () { - return data$$1.key; - }); - element = pathElement; - } - if (convertShape) { - var newPathData = data$$1.alternativeNew; - tag = 'path'; - attributes = newPathData.attributes; - } - } - var elementTransition = element; - if (transitionInstance) { - elementTransition = elementTransition.transition(transitionInstance); - if (fade) { - elementTransition.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).style("opacity", 1.0); - } - elementTransition.filter(function (d) { - return d.tag[0] == '#' ? null : this; - }).on("end", function () { - d3.select(this).attr('style', null); - }); - } - var growThisPath = growEnteringEdges && tag == 'path' && data$$1.offset; - if (growThisPath) { - var totalLength = data$$1.totalLength; - element.attr("stroke-dasharray", totalLength + " " + totalLength).attr("stroke-dashoffset", totalLength).attr('transform', 'translate(' + data$$1.offset.x + ',' + data$$1.offset.y + ')'); - attributes["stroke-dashoffset"] = 0; - attributes['transform'] = 'translate(0,0)'; - elementTransition.attr("stroke-dashoffset", attributes["stroke-dashoffset"]).attr('transform', attributes['transform']).on("start", function () { - d3.select(this).style('opacity', null); - }).on("end", function () { - d3.select(this).attr('stroke-dashoffset', null).attr('stroke-dasharray', null).attr('transform', null); - }); - } - var moveThisPolygon = growEnteringEdges && tag == 'polygon' && isEdgeElement(data$$1) && data$$1.offset; - if (moveThisPolygon) { - var edgePath = d3.select(element.node().parentNode.querySelector("path")); - var p0 = edgePath.node().getPointAtLength(0); - var p1 = edgePath.node().getPointAtLength(data$$1.totalLength); - var p2 = edgePath.node().getPointAtLength(data$$1.totalLength - 1); - var angle1 = Math.atan2(p1.y - p2.y, p1.x - p2.x) * 180 / Math.PI; - var x = p0.x - p1.x + data$$1.offset.x; - var y = p0.y - p1.y + data$$1.offset.y; - element.attr('transform', 'translate(' + x + ',' + y + ')'); - elementTransition.attrTween("transform", function () { - return function (t) { - var p = edgePath.node().getPointAtLength(data$$1.totalLength * t); - var p2 = edgePath.node().getPointAtLength(data$$1.totalLength * t + 1); - var angle = Math.atan2(p2.y - p.y, p2.x - p.x) * 180 / Math.PI - angle1; - x = p.x - p1.x + data$$1.offset.x * (1 - t); - y = p.y - p1.y + data$$1.offset.y * (1 - t); - return 'translate(' + x + ',' + y + ') rotate(' + angle + ' ' + p1.x + ' ' + p1.y + ')'; - }; - }).on("start", function () { - d3.select(this).style('opacity', null); - }).on("end", function () { - d3.select(this).attr('transform', null); - }); - } - var tweenThisPath = tweenPaths && transitionInstance && tag == 'path' && element.attr('d') != null; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = Object.keys(attributes)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attributeName = _step2.value; - - var attributeValue = attributes[attributeName]; - if (tweenThisPath && attributeName == 'd') { - var points = (data$$1.alternativeOld || data$$1).points; - if (points) { - elementTransition.attrTween("d", pathTween(points, attributeValue)); - } - } else { - if (attributeName == 'transform' && data$$1.translation) { - if (transitionInstance) { - var onEnd = elementTransition.on("end"); - elementTransition.on("start", function () { - if (graphvizInstance._zoomBehavior) { - // Update the transform to transition to, just before the transition starts - // in order to catch changes between the transition scheduling to its start. - elementTransition.tween("attr.transform", function () { - var node = this; - return function (t) { - node.setAttribute("transform", d3Interpolate.interpolateTransformSvg(d3Zoom.zoomTransform(graphvizInstance._zoomSelection.node()).toString(), getTranslatedZoomTransform.call(graphvizInstance, element).toString())(t)); - }; - }); - } - }).on("end", function () { - onEnd.call(this); - // Update the zoom transform to the new translated transform - if (graphvizInstance._zoomBehavior) { - translateZoomBehaviorTransform.call(graphvizInstance, element); - } - }); - } else { - if (graphvizInstance._zoomBehavior) { - // Update the transform attribute to set with the current pan translation - attributeValue = getTranslatedZoomTransform.call(graphvizInstance, element).toString(); - } - } - } - elementTransition.attr(attributeName, attributeValue); - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - if (convertShape) { - elementTransition.on("end", function (d, i, nodes) { - pathElement = d3.select(this); - var newElement = replaceElement(pathElement, d); - newElement.data([d], function () { - return d.key; - }); - }); - } - if (data$$1.text) { - elementTransition.text(data$$1.text); - } - insertChildren(element); - } - - var root = this._selection; - - if (transitionInstance != null) { - // Ensure original SVG shape elements are restored after transition before rendering new graph - var jobs = this._jobs; - if (graphvizInstance._active) { - jobs.push(null); - return this; - } else { - root.transition(transitionInstance).transition().duration(0).on("end", function () { - graphvizInstance._active = false; - if (jobs.length != 0) { - jobs.shift(); - graphvizInstance.render(); - } - }); - this._active = true; - } - } - - if (transitionInstance != null) { - root.transition(transitionInstance).on("start", function () { - graphvizInstance._dispatch.call('transitionStart', graphvizInstance); - }).on("end", function () { - graphvizInstance._dispatch.call('transitionEnd', graphvizInstance); - }).transition().duration(0).on("start", function () { - graphvizInstance._dispatch.call('restoreEnd', graphvizInstance); - graphvizInstance._dispatch.call('end', graphvizInstance); - if (callback) { - callback.call(graphvizInstance); - } - }); - } - - var data$$1 = this._data; - - var svg = root.selectAll("svg").data([data$$1], function (d) { - return d.key; - }); - svg = svg.enter().append("svg").merge(svg); - - attributeElement$$1.call(svg.node(), data$$1); - - if (this._options.zoom && !this._zoomBehavior) { - createZoomBehavior.call(this); - } - - graphvizInstance._dispatch.call('renderEnd', graphvizInstance); - - if (transitionInstance == null) { - this._dispatch.call('end', this); - if (callback) { - callback.call(this); - } - } - - return this; -} - -function convertToPathData(originalData, guideData) { - if (originalData.tag == 'polygon') { - var newData = shallowCopyObject(originalData); - newData.tag = 'path'; - var originalAttributes = originalData.attributes; - var newAttributes = shallowCopyObject(originalAttributes); - var newPointsString = originalAttributes.points; - if (guideData.tag == 'polygon') { - var bbox = originalData.bbox; - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - var pointsString = originalAttributes.points; - var pointStrings = pointsString.split(' '); - var normPoints = pointStrings.map(function (p) { - var xy = p.split(',');return [xy[0] - bbox.cx, xy[1] - bbox.cy]; - }); - var x0 = normPoints[normPoints.length - 1][0]; - var y0 = normPoints[normPoints.length - 1][1]; - for (var i = 0; i < normPoints.length; i++, x0 = x1, y0 = y1) { - var x1 = normPoints[i][0]; - var y1 = normPoints[i][1]; - var dx = x1 - x0; - var dy = y1 - y0; - if (dy == 0) { - continue; - } else { - var x2 = x0 - y0 * dx / dy; - } - if (0 <= x2 && x2 < Infinity && (x0 <= x2 && x2 <= x1 || x1 <= x2 && x2 <= x0)) { - break; - } - } - var newPointStrings = [[bbox.cx + x2, bbox.cy + 0].join(',')]; - newPointStrings = newPointStrings.concat(pointStrings.slice(i)); - newPointStrings = newPointStrings.concat(pointStrings.slice(0, i)); - newPointsString = newPointStrings.join(' '); - } - newAttributes['d'] = 'M' + newPointsString + 'z'; - delete newAttributes.points; - newData.attributes = newAttributes; - } else /* if (originalData.tag == 'ellipse') */{ - var newData = shallowCopyObject(originalData); - newData.tag = 'path'; - var originalAttributes = originalData.attributes; - var newAttributes = shallowCopyObject(originalAttributes); - var cx = originalAttributes.cx; - var cy = originalAttributes.cy; - var rx = originalAttributes.rx; - var ry = originalAttributes.ry; - if (guideData.tag == 'polygon') { - var bbox = guideData.bbox; - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - var p = guideData.attributes.points.split(' ')[0].split(','); - var sx = p[0]; - var sy = p[1]; - var dx = sx - bbox.cx; - var dy = sy - bbox.cy; - var l = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); - var cosA = dx / l; - var sinA = -dy / l; - } else { - // if (guideData.tag == 'path') { - // FIXME: add support for getting start position from path - var cosA = 1; - var sinA = 0; - } - var x1 = rx * cosA; - var y1 = -ry * sinA; - var x2 = rx * -cosA; - var y2 = -ry * -sinA; - var dx = x2 - x1; - var dy = y2 - y1; - newAttributes['d'] = 'M ' + cx + ' ' + cy + ' m ' + x1 + ',' + y1 + ' a ' + rx + ',' + ry + ' 0 1,0 ' + dx + ',' + dy + ' a ' + rx + ',' + ry + ' 0 1,0 ' + -dx + ',' + -dy + 'z'; - delete newAttributes.cx; - delete newAttributes.cy; - delete newAttributes.rx; - delete newAttributes.ry; - newData.attributes = newAttributes; - } - return newData; -} - -function translatePointsAttribute(pointsString, x, y) { - var pointStrings = pointsString.split(' '); - var points = pointStrings.map(function (p) { - return p.split(','); - }); - var points = pointStrings.map(function (p) { - return [roundTo4Decimals(+x + +p.split(',')[0]), roundTo4Decimals(+y + +p.split(',')[1])]; - }); - var pointStrings = points.map(function (p) { - return p.join(','); - }); - var pointsString = pointStrings.join(' '); - pointsString = pointsString.replace(/-0\./g, '-.').replace(/ 0\./g, ' .'); - return pointsString; -} - -function translateDAttribute(d, x, y) { - var pointStrings = d.split(/[A-Z ]/); - pointStrings.shift(); - var commands = d.split(/[^[A-Z ]+/); - var points = pointStrings.map(function (p) { - return p.split(','); - }); - var points = pointStrings.map(function (p) { - return [roundTo4Decimals(+x + +p.split(',')[0]), roundTo4Decimals(+y + +p.split(',')[1])]; - }); - var pointStrings = points.map(function (p) { - return p.join(','); - }); - d = commands.reduce(function (arr, v, i) { - return arr.concat(v, pointStrings[i]); - }, []).join(''); - d = d.replace(/-0\./g, '-.').replace(/ 0\./g, ' .'); - return d; -} - -function initViz() { - // force JIT compilation of Viz.js - if (this._worker == null) { - Viz(""); - this._dispatch.call("initEnd", this); - } else { - var vizURL = this._vizURL; - var graphvizInstance = this; - this._worker.onmessage = function (event$$1) { - graphvizInstance._dispatch.call("initEnd", this); - }; - if (!vizURL.match(/^https?:\/\/|^\/\//i)) { - // Local URL. Prepend with local domain to be usable in web worker - vizURL = new window.URL(vizURL, document.location.href).href; - } - this._worker.postMessage({ dot: "", vizURL: vizURL }); - } -} - -var dot = function (src, callback) { - - var graphvizInstance = this; - var worker = this._worker; - var engine = this._options.engine; - var images = this._images; - var totalMemory = this._options.totalMemory; - var keyMode = this._options.keyMode; - var tweenPaths = this._options.tweenPaths; - var tweenShapes = this._options.tweenShapes; - if (typeof this._options.tweenPrecision == 'string' && this._options.tweenPrecision.includes('%')) { - var tweenPrecision = +this._options.tweenPrecision.split('%')[0] / 100; - var tweenPrecisionIsRelative = this._options.tweenPrecision.includes('%'); - } else { - var tweenPrecision = this._options.tweenPrecision; - var tweenPrecisionIsRelative = false; - } - var growEnteringEdges = this._options.growEnteringEdges; - var dictionary = {}; - var prevDictionary = this._dictionary || {}; - var nodeDictionary = {}; - var prevNodeDictionary = this._nodeDictionary || {}; - - function setKey(datum, index) { - var tag = datum.tag; - if (keyMode == 'index') { - datum.key = index; - } else if (tag[0] != '#') { - if (keyMode == 'id') { - datum.key = datum.attributes.id; - } else if (keyMode == 'title') { - var title = datum.children.find(function (childData) { - return childData.tag == 'title'; - }); - if (title) { - if (title.children.length > 0) { - datum.key = title.children[0].text; - } else { - datum.key = ''; - } - } - } - } - if (datum.key == null) { - if (tweenShapes) { - if (tag == 'ellipse' || tag == 'polygon') { - tag = 'path'; - } - } - datum.key = tag + '-' + index; - } - } - - function setId(datum, parentData) { - var id = (parentData ? parentData.id + '.' : '') + datum.key; - datum.id = id; - } - - function addToDictionary(datum) { - dictionary[datum.id] = datum; - } - - function calculateAlternativeShapeData(datum, prevDatum) { - if (tweenShapes && datum.id in prevDictionary) { - if ((prevDatum.tag == 'polygon' || prevDatum.tag == 'ellipse' || prevDatum.tag == 'path') && (prevDatum.tag != datum.tag || datum.tag == 'polygon')) { - if (prevDatum.tag != 'path') { - datum.alternativeOld = convertToPathData(prevDatum, datum); - } - if (datum.tag != 'path') { - datum.alternativeNew = convertToPathData(datum, prevDatum); - } - } - } - } - - function calculatePathTweenPoints(datum, prevDatum) { - if (tweenPaths && prevDatum && (prevDatum.tag == 'path' || datum.alternativeOld && datum.alternativeOld.tag == 'path')) { - var attribute_d = (datum.alternativeNew || datum).attributes.d; - if (datum.alternativeOld) { - var oldNode = createElementWithAttributes(datum.alternativeOld); - } else { - var oldNode = createElementWithAttributes(prevDatum); - } - (datum.alternativeOld || (datum.alternativeOld = {})).points = pathTweenPoints(oldNode, attribute_d, tweenPrecision, tweenPrecisionIsRelative); - } - } - - function postProcessDataPass1Local(datum) { - var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var parentData = arguments[2]; - - setKey(datum, index); - setId(datum, parentData); - var id = datum.id; - var prevDatum = prevDictionary[id]; - addToDictionary(datum); - calculateAlternativeShapeData(datum, prevDatum); - calculatePathTweenPoints(datum, prevDatum); - var childTagIndexes = {}; - datum.children.forEach(function (childData) { - var childTag = childData.tag; - if (childTag == 'ellipse' || childTag == 'polygon') { - childTag = 'path'; - } - if (childTagIndexes[childTag] == null) { - childTagIndexes[childTag] = 0; - } - var childIndex = childTagIndexes[childTag]++; - postProcessDataPass1Local(childData, childIndex, datum); - }); - } - - function addToNodeDictionary(datum) { - var tag = datum.tag; - if (growEnteringEdges && datum.parent) { - if (datum.parent.attributes.class == 'node') { - if (tag == 'title') { - if (datum.children.length > 0) { - var child = datum.children[0]; - var nodeId = child.text; - } else { - var nodeId = ''; - } - nodeDictionary[nodeId] = datum.parent; - } - } - } - } - - function extractGrowingEdgesData(datum) { - var id = datum.id; - var tag = datum.tag; - var prevDatum = prevDictionary[id]; - if (growEnteringEdges && !prevDatum && datum.parent) { - if (isEdgeElement(datum)) { - if (tag == 'path' || tag == 'polygon') { - if (tag == 'polygon') { - var path$$1 = datum.parent.children.find(function (e) { - return e.tag == 'path'; - }); - datum.totalLength = path$$1.totalLength; - } - var title = getEdgeTitle(datum); - var child = title.children[0]; - var nodeIds = child.text.split('->'); - if (nodeIds.length != 2) { - nodeIds = child.text.split('--'); - } - var startNodeId = nodeIds[0]; - var startNode = nodeDictionary[startNodeId]; - var prevStartNode = prevNodeDictionary[startNodeId]; - if (prevStartNode) { - var i = startNode.children.findIndex(function (element, index) { - return element.tag == 'g'; - }); - if (i >= 0) { - var j = startNode.children[i].children.findIndex(function (element, index) { - return element.tag == 'a'; - }); - startNode = startNode.children[i].children[j]; - } - var i = prevStartNode.children.findIndex(function (element, index) { - return element.tag == 'g'; - }); - if (i >= 0) { - var j = prevStartNode.children[i].children.findIndex(function (element, index) { - return element.tag == 'a'; - }); - prevStartNode = prevStartNode.children[i].children[j]; - } - var startShapes = startNode.children; - for (var i = 0; i < startShapes.length; i++) { - if (startShapes[i].tag == 'polygon' || startShapes[i].tag == 'ellipse' || startShapes[i].tag == 'path' || startShapes[i].tag == 'text') { - var startShape = startShapes[i]; - break; - } - } - var prevStartShapes = prevStartNode.children; - for (var i = 0; i < prevStartShapes.length; i++) { - if (prevStartShapes[i].tag == 'polygon' || prevStartShapes[i].tag == 'ellipse' || prevStartShapes[i].tag == 'path' || prevStartShapes[i].tag == 'text') { - var prevStartShape = prevStartShapes[i]; - break; - } - } - if (prevStartShape && startShape) { - datum.offset = { - x: prevStartShape.center.x - startShape.center.x, - y: prevStartShape.center.y - startShape.center.y - }; - } else { - datum.offset = { x: 0, y: 0 }; - } - } - } - } - } - } - - function postProcessDataPass2Global(datum) { - addToNodeDictionary(datum); - extractGrowingEdgesData(datum); - datum.children.forEach(function (childData) { - postProcessDataPass2Global(childData); - }); - } - - this._dispatch.call("start", this); - this._busy = true; - this._dispatch.call("layoutStart", this); - var vizOptions = { - format: "svg", - engine: engine, - images: images, - totalMemory: totalMemory - }; - if (this._worker) { - worker.postMessage({ - dot: src, - options: vizOptions - }); - - worker.onmessage = function (event$$1) { - switch (event$$1.data.type) { - case "done": - return layoutDone.call(graphvizInstance, event$$1.data.svg); - case "error": - if (graphvizInstance._onerror) { - graphvizInstance._onerror(event$$1.data.error); - } else { - throw event$$1.data.error; - } - break; - } - }; - } else { - try { - var svgDoc = Viz(src, vizOptions); - } catch (error) { - if (graphvizInstance._onerror) { - graphvizInstance._onerror(error.message); - return this; - } else { - throw error.message; - } - } - layoutDone.call(this, svgDoc); - } - - function layoutDone(svgDoc) { - this._dispatch.call("layoutEnd", this); - - var newDoc = d3.select(document.createDocumentFragment()).append('div'); - - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - - newDoc.append(function () { - return doc.documentElement; - }); - - var newSvg = newDoc.select('svg'); - - var data$$1 = extractAllElementsData(newSvg); - this._dispatch.call('dataExtractEnd', this); - postProcessDataPass1Local(data$$1); - this._dispatch.call('dataProcessPass1End', this); - postProcessDataPass2Global(data$$1); - this._dispatch.call('dataProcessPass2End', this); - this._data = data$$1; - this._dictionary = dictionary; - this._nodeDictionary = nodeDictionary; - - this._extractData = function (element, childIndex, parentData) { - var data$$1 = extractAllElementsData(element); - postProcessDataPass1Local(data$$1, childIndex, parentData); - postProcessDataPass2Global(data$$1); - return data$$1; - }; - this._busy = false; - this._dispatch.call('dataProcessEnd', this); - if (callback) { - callback.call(this); - } - if (this._queue.length > 0) { - var job = this._queue.shift(); - job.call(this); - } - } - - return this; -}; - -var renderDot = function (src, callback) { - - var graphvizInstance = this; - - this.dot(src, render); - - function render() { - graphvizInstance.render(callback); - } - - return this; -}; - -var transition$1 = function (name) { - - if (name instanceof Function) { - this._transitionFactory = name; - } else { - this._transition = d3Transition.transition(name); - } - - return this; -}; - -function active$1(name) { - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - if (svg.size() != 0) { - return d3Transition.active(svg.node(), name); - } else { - return null; - } -} - -var options = function (options) { - - if (typeof options == 'undefined') { - return Object.assign({}, this._options); - } else { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var option = _step.value; - - this._options[option] = options[option]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return this; - } -}; - -var width = function (width) { - - this._options.width = width; - - return this; -}; - -var height = function (height) { - - this._options.height = height; - - return this; -}; - -var scale = function (scale) { - - this._options.scale = scale; - - return this; -}; - -var fit = function (fit) { - - this._options.fit = fit; - - return this; -}; - -var attributer = function (callback) { - - this._attributer = callback; - - return this; -}; - -var engine = function (engine) { - - this._options.engine = engine; - - return this; -}; - -var images = function (path$$1, width, height) { - - this._images.push({ path: path$$1, width: width, height: height }); - - return this; -}; - -var totalMemory = function (size) { - - this._options.totalMemory = size; - - return this; -}; - -var keyMode = function (keyMode) { - - if (!this._keyModes.has(keyMode)) { - throw Error('Illegal keyMode: ' + keyMode); - } - if (keyMode != this._options.keyMode && this._data != null) { - throw Error('Too late to change keyMode'); - } - this._options.keyMode = keyMode; - - return this; -}; - -var fade = function (enable) { - - this._options.fade = enable; - - return this; -}; - -var tweenPaths = function (enable) { - - this._options.tweenPaths = enable; - - return this; -}; - -var tweenShapes = function (enable) { - - this._options.tweenShapes = enable; - if (enable) { - this._options.tweenPaths = true; - } - - return this; -}; - -var convertEqualSidedPolygons = function (enable) { - - this._options.convertEqualSidedPolygons = enable; - - return this; -}; - -var tweenPrecision = function (precision) { - - this._options.tweenPrecision = precision; - - return this; -}; - -var growEnteringEdges = function (enable) { - - this._options.growEnteringEdges = enable; - - return this; -}; - -var on = function (typenames, callback) { - - this._dispatch.on(typenames, callback); - - return this; -}; - -var onerror = function (callback) { - - this._onerror = callback; - - return this; -}; - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -}; - -var logEvents = function (enable) { - var _this = this; - - var t0 = Date.now(); - var times = {}; - var eventTypes = this._eventTypes; - var maxEventTypeLength = Math.max.apply(Math, toConsumableArray(eventTypes.map(function (eventType) { - return eventType.length; - }))); - - var _loop = function _loop(i) { - var eventType = eventTypes[i]; - times[eventType] = []; - graphvizInstance = _this; - - _this.on(eventType + '.log', enable ? function () { - var t = Date.now(); - var seqNo = times[eventType].length; - times[eventType].push(t); - var string = ''; - string += 'Event '; - string += d3Format.format(' >2')(i) + ' '; - string += eventType + ' '.repeat(maxEventTypeLength - eventType.length); - string += d3Format.format(' >5')(t - t0) + ' '; - if (eventType != 'initEnd') { - string += d3Format.format(' >5')(t - times['start'][seqNo]); - } - if (eventType == 'dataProcessEnd') { - string += ' prepare ' + d3Format.format(' >5')(t - times['layoutEnd'][seqNo]); - } - if (eventType == 'renderEnd' && graphvizInstance._transition) { - string += ' transition start margin ' + d3Format.format(' >5')(graphvizInstance._transition.delay() - (t - times['renderStart'][seqNo])); - expectedDelay = graphvizInstance._transition.delay(); - expectedDuration = graphvizInstance._transition.duration(); - } - if (eventType == 'transitionStart') { - var actualDelay = t - times['renderStart'][seqNo]; - string += ' transition delay ' + d3Format.format(' >5')(t - times['renderStart'][seqNo]); - string += ' expected ' + d3Format.format(' >5')(expectedDelay); - string += ' diff ' + d3Format.format(' >5')(actualDelay - expectedDelay); - } - if (eventType == 'transitionEnd') { - var actualDuration = t - times['transitionStart'][seqNo]; - string += ' transition duration ' + d3Format.format(' >5')(actualDuration); - string += ' expected ' + d3Format.format(' >5')(expectedDuration); - string += ' diff ' + d3Format.format(' >5')(actualDuration - expectedDuration); - } - console.log(string); - t0 = t; - } : null); - }; - - for (var i in eventTypes) { - var graphvizInstance; - var expectedDelay; - var expectedDuration; - - _loop(i); - } - return this; -}; - -function rotate(x, y, cosA, sinA) { - // (x + j * y) * (cosA + j * sinA) = x * cosA - y * sinA + j * (x * sinA + y * cosA) - y = -y; - sinA = -sinA; - var _ref = [x * cosA - y * sinA, x * sinA + y * cosA]; - x = _ref[0]; - y = _ref[1]; - - y = -y; - return [x, y]; -} - -function drawEdge(x1, y1, x2, y2, attributes) { - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; - - attributes = Object.assign({}, attributes); - if (attributes.style && attributes.style.includes('invis')) { - var newEdge = d3.select(null); - } else { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var newEdge0 = createEdge(attributes); - var edgeData = extractAllElementsData(newEdge0); - var newEdge = graph0.append('g').data([edgeData]); - attributeElement.call(newEdge.node(), edgeData); - _updateEdge(newEdge, x1, y1, x2, y2, attributes, options); - } - this._drawnEdge = { - g: newEdge, - x1: x1, - y1: y1, - x2: x2, - y2: y2, - attributes: attributes - }; - - return this; -} - -function updateDrawnEdge(x1, y1, x2, y2) { - var attributes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - var edge = this._drawnEdge.g; - attributes = Object.assign(this._drawnEdge.attributes, attributes); - this._drawnEdge.x1 = x1; - this._drawnEdge.y1 = y1; - this._drawnEdge.x2 = x2; - this._drawnEdge.y2 = y2; - if (edge.empty() && !(attributes.style && attributes.style.includes('invis'))) { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var edge = graph0.append('g'); - this._drawnEdge.g = edge; - } - if (!edge.empty()) { - _updateEdge(edge, x1, y1, x2, y2, attributes, options); - } - - return this; -} - -function _updateEdge(edge, x1, y1, x2, y2, attributes, options) { - - var newEdge = createEdge(attributes); - var edgeData = extractAllElementsData(newEdge); - edge.data([edgeData]); - attributeElement.call(edge.node(), edgeData); - _moveEdge(edge, x1, y1, x2, y2, attributes, options); -} - -function _moveEdge(edge, x1, y1, x2, y2, attributes, options) { - - var shortening = options.shortening || 0; - var arrowHeadLength = 10; - var arrowHeadWidth = 7; - var margin = 0.174; - - var arrowHeadPoints = [[0, -arrowHeadWidth / 2], [arrowHeadLength, 0], [0, arrowHeadWidth / 2], [0, -arrowHeadWidth / 2]]; - - var dx = x2 - x1; - var dy = y2 - y1; - var length = Math.sqrt(dx * dx + dy * dy); - if (length == 0) { - var cosA = 1; - var sinA = 0; - } else { - var cosA = dx / length; - var sinA = dy / length; - } - x2 = x1 + (length - shortening - arrowHeadLength - margin) * cosA; - y2 = y1 + (length - shortening - arrowHeadLength - margin) * sinA; - - if (attributes.URL || attributes.tooltip) { - var a = edge.selectWithoutDataPropagation("g").selectWithoutDataPropagation("a"); - var line = a.selectWithoutDataPropagation("path"); - var arrowHead = a.selectWithoutDataPropagation("polygon"); - } else { - var line = edge.selectWithoutDataPropagation("path"); - var arrowHead = edge.selectWithoutDataPropagation("polygon"); - } - - var path1 = d3Path.path(); - path1.moveTo(x1, y1); - path1.lineTo(x2, y2); - - line.attr("d", path1); - - x2 = x1 + (length - shortening - arrowHeadLength) * cosA; - y2 = y1 + (length - shortening - arrowHeadLength) * sinA; - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - arrowHeadPoints[i] = rotate(point[0], point[1], cosA, sinA); - } - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - arrowHeadPoints[i] = [x2 + point[0], y2 + point[1]]; - } - var allPoints = []; - for (var i = 0; i < arrowHeadPoints.length; i++) { - var point = arrowHeadPoints[i]; - allPoints.push(point.join(',')); - } - var pointsAttr = allPoints.join(' '); - - arrowHead.attr("points", pointsAttr); - - return this; -} - -function moveDrawnEdgeEndPoint(x2, y2) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - var edge = this._drawnEdge.g; - var x1 = this._drawnEdge.x1; - var y1 = this._drawnEdge.y1; - var attributes = this._drawnEdge.attributes; - - this._drawnEdge.x2 = x2; - this._drawnEdge.y2 = y2; - _moveEdge(edge, x1, y1, x2, y2, attributes, options); - - return this; -} - -function removeDrawnEdge() { - - if (!this._drawnEdge) { - return this; - } - - var edge = this._drawnEdge.g; - - edge.remove(); - - this._drawnEdge = null; - - return this; -} - -function insertDrawnEdge(name) { - - if (!this._drawnEdge) { - throw Error('No edge has been drawn'); - } - - var edge = this._drawnEdge.g; - if (edge.empty()) { - return this; - } - this._drawnEdge.attributes; - - var title = edge.selectWithoutDataPropagation("title"); - title.text(name); - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var graph0Datum = graph0.datum(); - var edgeData = this._extractData(edge, graph0Datum.children.length, graph0.datum()); - graph0Datum.children.push(edgeData); - - insertAllElementsData(edge, edgeData); - - this._drawnEdge = null; - - return this; -} - -function drawnEdgeSelection() { - - if (this._drawnEdge) { - return this._drawnEdge.g; - } else { - return d3.select(null); - } -} - -function createEdge(attributes) { - var attributesString = ''; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var name = _step.value; - - if (attributes[name] != null) { - attributesString += ' "' + name + '"="' + attributes[name] + '"'; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var dotSrc = 'digraph {a -> b [' + attributesString + ']}'; - var svgDoc = Viz(dotSrc, { format: 'svg' }); - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - var newDoc = d3.select(document.createDocumentFragment()).append(function () { - return doc.documentElement; - }); - var edge = newDoc.select('.edge'); - - return edge; -} - -function drawNode(x, y, nodeId) { - var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - attributes = Object.assign({}, attributes); - if (attributes.style && attributes.style.includes('invis')) { - var newNode = d3.select(null); - } else { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var newNode0 = createNode(nodeId, attributes); - var nodeData = extractAllElementsData(newNode0); - var newNode = graph0.append('g').data([nodeData]); - attributeElement.call(newNode.node(), nodeData); - _updateNode(newNode, x, y, nodeId, attributes); - } - this._drawnNode = { - g: newNode, - nodeId: nodeId, - x: x, - y: y, - attributes: attributes - }; - - return this; -} - -function updateDrawnNode(x, y, nodeId) { - var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - - var node = this._drawnNode.g; - if (nodeId == null) { - nodeId = this._drawnNode.nodeId; - } - attributes = Object.assign(this._drawnNode.attributes, attributes); - this._drawnNode.nodeId = nodeId; - this._drawnNode.x = x; - this._drawnNode.y = y; - if (node.empty() && !(attributes.style && attributes.style.includes('invis'))) { - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var node = graph0.append('g'); - this._drawnNode.g = node; - } - if (!node.empty()) { - _updateNode(node, x, y, nodeId, attributes); - } - - return this; -} - -function _updateNode(node, x, y, nodeId, attributes, options) { - - var newNode = createNode(nodeId, attributes); - var nodeData = extractAllElementsData(newNode); - node.data([nodeData]); - attributeElement.call(node.node(), nodeData); - _moveNode(node, x, y, attributes); - - return this; -} - -function _moveNode(node, x, y, attributes, options) { - if (attributes.URL || attributes.tooltip) { - var subParent = node.selectWithoutDataPropagation("g").selectWithoutDataPropagation("a"); - } else { - var subParent = node; - } - var svgElements = subParent.selectAll('ellipse,polygon,path,polyline'); - var text = node.selectWithoutDataPropagation("text"); - - if (svgElements.size() != 0) { - var bbox = svgElements.node().getBBox(); - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; - } else if (text.size() != 0) { - bbox = { - x: +text.attr('x'), - y: +text.attr('y'), - width: 0, - height: 0, - cx: +text.attr('x'), - cy: +text.attr('y') - }; - } - svgElements.each(function (data, index) { - var svgElement = d3.select(this); - if (svgElement.attr("cx")) { - svgElement.attr("cx", roundTo4Decimals(x)).attr("cy", roundTo4Decimals(y)); - } else if (svgElement.attr("points")) { - var pointsString = svgElement.attr('points').trim(); - svgElement.attr("points", translatePointsAttribute(pointsString, x - bbox.cx, y - bbox.cy)); - } else { - var d = svgElement.attr('d'); - svgElement.attr("d", translateDAttribute(d, x - bbox.cx, y - bbox.cy)); - } - }); - - if (text.size() != 0) { - text.attr("x", roundTo4Decimals(+text.attr("x") + x - bbox.cx)).attr("y", roundTo4Decimals(+text.attr("y") + y - bbox.cy)); - } - return this; -} - -function moveDrawnNode(x, y) { - - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - var node = this._drawnNode.g; - var attributes = this._drawnNode.attributes; - - this._drawnNode.x = x; - this._drawnNode.y = y; - - if (!node.empty()) { - _moveNode(node, x, y, attributes); - } - - return this; -} - -function removeDrawnNode() { - - if (!this._drawnNode) { - return this; - } - - var node = this._drawnNode.g; - - if (!node.empty()) { - node.remove(); - } - - this._drawnNode = null; - - return this; -} - -function insertDrawnNode(nodeId) { - - if (!this._drawnNode) { - throw Error('No node has been drawn'); - } - - if (nodeId == null) { - nodeId = this._drawnNode.nodeId; - } - var node = this._drawnNode.g; - if (node.empty()) { - return this; - } - var attributes = this._drawnNode.attributes; - - var title = node.selectWithoutDataPropagation("title"); - title.text(nodeId); - if (attributes.URL || attributes.tooltip) { - var ga = node.selectWithoutDataPropagation("g"); - var a = ga.selectWithoutDataPropagation("a"); - a.selectWithoutDataPropagation('ellipse,polygon,path,polyline'); - var text = a.selectWithoutDataPropagation('text'); - } else { - node.selectWithoutDataPropagation('ellipse,polygon,path,polyline'); - var text = node.selectWithoutDataPropagation('text'); - } - text.text(attributes.label || nodeId); - - var root = this._selection; - var svg = root.selectWithoutDataPropagation("svg"); - var graph0 = svg.selectWithoutDataPropagation("g"); - var graph0Datum = graph0.datum(); - var nodeData = this._extractData(node, graph0Datum.children.length, graph0.datum()); - graph0Datum.children.push(nodeData); - - insertAllElementsData(node, nodeData); - - this._drawnNode = null; - - return this; -} - -function drawnNodeSelection() { - - if (this._drawnNode) { - return this._drawnNode.g; - } else { - return d3.select(null); - } -} - -function createNode(nodeId, attributes) { - var attributesString = ''; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var name = _step.value; - - if (attributes[name] != null) { - attributesString += ' "' + name + '"="' + attributes[name] + '"'; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var dotSrc = 'graph {"' + nodeId + '" [' + attributesString + ']}'; - var svgDoc = Viz(dotSrc, { format: 'svg' }); - var parser = new window.DOMParser(); - var doc = parser.parseFromString(svgDoc, "image/svg+xml"); - var newDoc = d3.select(document.createDocumentFragment()).append(function () { - return doc.documentElement; - }); - var node = newDoc.select('.node'); - - return node; -} - -var _graphviz$prototype; - -function Graphviz(selection$$1, options$$1) { - this._options = { - useWorker: true, - engine: 'dot', - totalMemory: undefined, - keyMode: 'title', - fade: true, - tweenPaths: true, - tweenShapes: true, - convertEqualSidedPolygons: true, - tweenPrecision: 1, - growEnteringEdges: true, - zoom: true, - zoomScaleExtent: [0.1, 10], - zoomTranslateExtent: [[-Infinity, -Infinity], [+Infinity, +Infinity]], - width: null, - height: null, - scale: 1, - fit: false - }; - if (options$$1 instanceof Object) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.keys(options$$1)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var option = _step.value; - - this._options[option] = options$$1[option]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } else if (typeof options$$1 == 'boolean') { - this._options.useWorker = options$$1; - } - var useWorker = this._options.useWorker; - if (typeof Worker == 'undefined') { - useWorker = false; - } - if (useWorker) { - var scripts = d3.selectAll('script'); - var vizScript = scripts.filter(function () { - return d3.select(this).attr('type') == 'javascript/worker' || d3.select(this).attr('src') && d3.select(this).attr('src').match(/.*\/viz.js$/); - }); - if (vizScript.size() == 0) { - console.warn('No script tag of type "javascript/worker" was found and "useWorker" is true. Not using web worker.'); - useWorker = false; - } else { - this._vizURL = vizScript.attr('src'); - if (!this._vizURL) { - console.warn('No "src" attribute of was found on the "javascript/worker" script tag and "useWorker" is true. Not using web worker.'); - useWorker = false; - } - } - } - if (useWorker) { - var js = "\n onmessage = function(event) {\n if (event.data.vizURL) {\n importScripts(event.data.vizURL);\n }\n try {\n var svg = Viz(event.data.dot, event.data.options);\n }\n catch(error) {\n postMessage({\n type: \"error\",\n error: error.message,\n });\n return;\n }\n if (svg) {\n postMessage({\n type: \"done\",\n svg: svg,\n });\n } else {\n postMessage({\n type: \"skip\",\n });\n }\n }\n "; - var blob = new Blob([js]); - var blobURL = window.URL.createObjectURL(blob); - this._worker = new Worker(blobURL); - } - this._selection = selection$$1; - this._active = false; - this._busy = false; - this._jobs = []; - this._queue = []; - this._keyModes = new Set(['title', 'id', 'tag-index', 'index']); - this._images = []; - this._translation = undefined; - this._scale = undefined; - this._eventTypes = ['initEnd', 'start', 'layoutStart', 'layoutEnd', 'dataExtractEnd', 'dataProcessPass1End', 'dataProcessPass2End', 'dataProcessEnd', 'renderStart', 'renderEnd', 'transitionStart', 'transitionEnd', 'restoreEnd', 'end']; - this._dispatch = d3Dispatch.dispatch.apply(undefined, toConsumableArray(this._eventTypes)); - initViz.call(this); - selection$$1.node().__graphviz__ = this; -} - -function graphviz(selector, options$$1) { - var g = d3.select(selector).graphviz(options$$1); - return g; -} - -Graphviz.prototype = graphviz.prototype = (_graphviz$prototype = { - constructor: Graphviz, - engine: engine, - addImage: images, - totalMemory: totalMemory, - keyMode: keyMode, - fade: fade, - tweenPaths: tweenPaths, - tweenShapes: tweenShapes, - convertEqualSidedPolygons: convertEqualSidedPolygons, - tweenPrecision: tweenPrecision, - growEnteringEdges: growEnteringEdges, - zoom: zoom$1, - resetZoom: resetZoom, - zoomBehavior: zoomBehavior, - zoomSelection: zoomSelection, - zoomScaleExtent: zoomScaleExtent, - zoomTranslateExtent: zoomTranslateExtent, - render: render, - dot: dot, - data: data, - renderDot: renderDot, - transition: transition$1, - active: active$1, - options: options, - width: width, - height: height, - scale: scale, - fit: fit, - attributer: attributer, - on: on, - onerror: onerror, - logEvents: logEvents, - drawEdge: drawEdge, - updateDrawnEdge: updateDrawnEdge, - moveDrawnEdgeEndPoint: moveDrawnEdgeEndPoint, - insertDrawnEdge: insertDrawnEdge, - removeDrawnEdge: removeDrawnEdge }, defineProperty(_graphviz$prototype, "removeDrawnEdge", removeDrawnEdge), defineProperty(_graphviz$prototype, "drawnEdgeSelection", drawnEdgeSelection), defineProperty(_graphviz$prototype, "drawnEdgeSelection", drawnEdgeSelection), defineProperty(_graphviz$prototype, "drawNode", drawNode), defineProperty(_graphviz$prototype, "updateDrawnNode", updateDrawnNode), defineProperty(_graphviz$prototype, "moveDrawnNode", moveDrawnNode), defineProperty(_graphviz$prototype, "insertDrawnNode", insertDrawnNode), defineProperty(_graphviz$prototype, "removeDrawnNode", removeDrawnNode), defineProperty(_graphviz$prototype, "removeDrawnNode", removeDrawnNode), defineProperty(_graphviz$prototype, "drawnNodeSelection", drawnNodeSelection), defineProperty(_graphviz$prototype, "drawnNodeSelection", drawnNodeSelection), _graphviz$prototype); - -var selection_graphviz = function (options) { - - var g = this.node().__graphviz__; - if (g) { - g.options(options); - g._dispatch.call("initEnd", this); - } else { - g = new Graphviz(this, options); - } - return g; -}; - -var selection_selectWithoutDataPropagation = function (name) { - - return d3.select(this.size() > 0 ? this.node().querySelector(name) : null); -}; - -d3.selection.prototype.graphviz = selection_graphviz; -d3.selection.prototype.selectWithoutDataPropagation = selection_selectWithoutDataPropagation; - -exports.graphviz = graphviz; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -}(d3Graphviz, d3Graphviz.exports)); - -var lodash_merge = {exports: {}}; - -/** - * Lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -(function (module, exports) { -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeMax = Math.max, - nativeNow = Date.now; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -/** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -/** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -/** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); -} - -/** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ -function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); -} - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} - -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} - -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; -} - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -/** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { - return; - } - - if (key == '__proto__') { - return; - } - - return object[key]; -} - -/** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var setToString = shortOut(baseSetToString); - -/** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ -function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -/** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ -function toPlainObject(value) { - return copyObject(value, keysIn(value)); -} - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} - -/** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ -var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); -}); - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = merge; -}(lodash_merge, lodash_merge.exports)); - -var hasOwn$1 = Object.prototype.hasOwnProperty; -var toString$i = Object.prototype.toString; - -var foreach$1 = function forEach (obj, fn, ctx) { - if (toString$i.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn$1.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - -var each$1 = foreach$1; -var jsonPointer$1 = api$1; - - -/** - * Convenience wrapper around the api. - * Calls `.get` when called with an `object` and a `pointer`. - * Calls `.set` when also called with `value`. - * If only supplied `object`, returns a partially applied function, mapped to the object. - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - * @returns {*} - */ - -function api$1 (obj, pointer, value) { - // .set() - if (arguments.length === 3) { - return api$1.set(obj, pointer, value); - } - // .get() - if (arguments.length === 2) { - return api$1.get(obj, pointer); - } - // Return a partially applied function on `obj`. - var wrapped = api$1.bind(api$1, obj); - - // Support for oo style - for (var name in api$1) { - if (api$1.hasOwnProperty(name)) { - wrapped[name] = api$1[name].bind(wrapped, obj); - } - } - return wrapped; -} - - -/** - * Lookup a json pointer in an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @returns {*} - */ -api$1.get = function get (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer); - - for (var i = 0; i < refTokens.length; ++i) { - var tok = refTokens[i]; - if (!(typeof obj == 'object' && tok in obj)) { - throw new Error('Invalid reference token: ' + tok); - } - obj = obj[tok]; - } - return obj; -}; - -/** - * Sets a value on an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - */ -api$1.set = function set (obj, pointer, value) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer), - nextTok = refTokens[0]; - - if (refTokens.length === 0) { - throw Error('Can not set the root object'); - } - - for (var i = 0; i < refTokens.length - 1; ++i) { - var tok = refTokens[i]; - if (typeof tok !== 'string' && typeof tok !== 'number') { - tok = String(tok); - } - if (tok === "__proto__" || tok === "constructor" || tok === "prototype") { - continue - } - if (tok === '-' && Array.isArray(obj)) { - tok = obj.length; - } - nextTok = refTokens[i + 1]; - - if (!(tok in obj)) { - if (nextTok.match(/^(\d+|-)$/)) { - obj[tok] = []; - } else { - obj[tok] = {}; - } - } - obj = obj[tok]; - } - if (nextTok === '-' && Array.isArray(obj)) { - nextTok = obj.length; - } - obj[nextTok] = value; - return this; -}; - -/** - * Removes an attribute - * - * @param {Object} obj - * @param {String|Array} pointer - */ -api$1.remove = function (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api$1.parse(pointer); - var finalToken = refTokens[refTokens.length -1]; - if (finalToken === undefined) { - throw new Error('Invalid JSON pointer for remove: "' + pointer + '"'); - } - - var parent = api$1.get(obj, refTokens.slice(0, -1)); - if (Array.isArray(parent)) { - var index = +finalToken; - if (finalToken === '' && isNaN(index)) { - throw new Error('Invalid array index: "' + finalToken + '"'); - } - - Array.prototype.splice.call(parent, index, 1); - } else { - delete parent[finalToken]; - } -}; - -/** - * Returns a (pointer -> value) dictionary for an object - * - * @param obj - * @param {function} descend - * @returns {} - */ -api$1.dict = function dict (obj, descend) { - var results = {}; - api$1.walk(obj, function (value, pointer) { - results[pointer] = value; - }, descend); - return results; -}; - -/** - * Iterates over an object - * Iterator: function (value, pointer) {} - * - * @param obj - * @param {function} iterator - * @param {function} descend - */ -api$1.walk = function walk (obj, iterator, descend) { - var refTokens = []; - - descend = descend || function (value) { - var type = Object.prototype.toString.call(value); - return type === '[object Object]' || type === '[object Array]'; - }; - - (function next (cur) { - each$1(cur, function (value, key) { - refTokens.push(String(key)); - if (descend(value)) { - next(value); - } else { - iterator(value, api$1.compile(refTokens)); - } - refTokens.pop(); - }); - }(obj)); -}; - -/** - * Tests if an object has a value for a json pointer - * - * @param obj - * @param pointer - * @returns {boolean} - */ -api$1.has = function has (obj, pointer) { - try { - api$1.get(obj, pointer); - } catch (e) { - return false; - } - return true; -}; - -/** - * Escapes a reference token - * - * @param str - * @returns {string} - */ -api$1.escape = function escape (str) { - return str.toString().replace(/~/g, '~0').replace(/\//g, '~1'); -}; - -/** - * Unescapes a reference token - * - * @param str - * @returns {string} - */ -api$1.unescape = function unescape (str) { - return str.replace(/~1/g, '/').replace(/~0/g, '~'); -}; - -/** - * Converts a json pointer into a array of reference tokens - * - * @param pointer - * @returns {Array} - */ -api$1.parse = function parse (pointer) { - if (pointer === '') { return []; } - if (pointer.charAt(0) !== '/') { throw new Error('Invalid JSON pointer: ' + pointer); } - return pointer.substring(1).split(/\//).map(api$1.unescape); -}; - -/** - * Builds a json pointer from a array of reference tokens - * - * @param refTokens - * @returns {string} - */ -api$1.compile = function compile (refTokens) { - if (refTokens.length === 0) { return ''; } - return '/' + refTokens.map(api$1.escape).join('/'); -}; - -var duplex = {}; - -var helpers = {}; - -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017 Joachim Wester - * MIT license - */ - -var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(helpers, "__esModule", { value: true }); -var _hasOwnProperty = Object.prototype.hasOwnProperty; -function hasOwnProperty$3(obj, key) { - return _hasOwnProperty.call(obj, key); -} -helpers.hasOwnProperty = hasOwnProperty$3; -function _objectKeys(obj) { - if (Array.isArray(obj)) { - var keys = new Array(obj.length); - for (var k = 0; k < keys.length; k++) { - keys[k] = "" + k; - } - return keys; - } - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var i in obj) { - if (hasOwnProperty$3(obj, i)) { - keys.push(i); - } - } - return keys; -} -helpers._objectKeys = _objectKeys; -/** -* Deeply clone the object. -* https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy) -* @param {any} obj value to clone -* @return {any} cloned obj -*/ -function _deepClone(obj) { - switch (typeof obj) { - case "object": - return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5 - case "undefined": - return null; //this is how JSON.stringify behaves for array items - default: - return obj; //no need to clone primitives - } -} -helpers._deepClone = _deepClone; -//3x faster than cached /^\d+$/.test(str) -function isInteger$1(str) { - var i = 0; - var len = str.length; - var charCode; - while (i < len) { - charCode = str.charCodeAt(i); - if (charCode >= 48 && charCode <= 57) { - i++; - continue; - } - return false; - } - return true; -} -helpers.isInteger = isInteger$1; -/** -* Escapes a json pointer path -* @param path The raw pointer -* @return the Escaped path -*/ -function escapePathComponent(path) { - if (path.indexOf('/') === -1 && path.indexOf('~') === -1) - return path; - return path.replace(/~/g, '~0').replace(/\//g, '~1'); -} -helpers.escapePathComponent = escapePathComponent; -/** - * Unescapes a json pointer path - * @param path The escaped pointer - * @return The unescaped path - */ -function unescapePathComponent(path) { - return path.replace(/~1/g, '/').replace(/~0/g, '~'); -} -helpers.unescapePathComponent = unescapePathComponent; -function _getPathRecursive(root, obj) { - var found; - for (var key in root) { - if (hasOwnProperty$3(root, key)) { - if (root[key] === obj) { - return escapePathComponent(key) + '/'; - } - else if (typeof root[key] === 'object') { - found = _getPathRecursive(root[key], obj); - if (found != '') { - return escapePathComponent(key) + '/' + found; - } - } - } - } - return ''; -} -helpers._getPathRecursive = _getPathRecursive; -function getPath(root, obj) { - if (root === obj) { - return '/'; - } - var path = _getPathRecursive(root, obj); - if (path === '') { - throw new Error("Object not found in root"); - } - return '/' + path; -} -helpers.getPath = getPath; -/** -* Recursively checks whether an object has any undefined values inside. -*/ -function hasUndefined(obj) { - if (obj === undefined) { - return true; - } - if (obj) { - if (Array.isArray(obj)) { - for (var i = 0, len = obj.length; i < len; i++) { - if (hasUndefined(obj[i])) { - return true; - } - } - } - else if (typeof obj === "object") { - var objKeys = _objectKeys(obj); - var objKeysLength = objKeys.length; - for (var i = 0; i < objKeysLength; i++) { - if (hasUndefined(obj[objKeys[i]])) { - return true; - } - } - } - } - return false; -} -helpers.hasUndefined = hasUndefined; -function patchErrorMessageFormatter(message, args) { - var messageParts = [message]; - for (var key in args) { - var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print - if (typeof value !== 'undefined') { - messageParts.push(key + ": " + value); - } - } - return messageParts.join('\n'); -} -var PatchError = /** @class */ (function (_super) { - __extends(PatchError, _super); - function PatchError(message, name, index, operation, tree) { - var _newTarget = this.constructor; - var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this; - _this.name = name; - _this.index = index; - _this.operation = operation; - _this.tree = tree; - Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359 - _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree }); - return _this; - } - return PatchError; -}(Error)); -helpers.PatchError = PatchError; - -var core$2 = {}; - -var isArray$h = Array.isArray; -var keyList = Object.keys; -var hasProp = Object.prototype.hasOwnProperty; - -var fastDeepEqual = function equal(a, b) { - if (a === b) return true; - - if (a && b && typeof a == 'object' && typeof b == 'object') { - var arrA = isArray$h(a) - , arrB = isArray$h(b) - , i - , length - , key; - - if (arrA && arrB) { - length = a.length; - if (length != b.length) return false; - for (i = length; i-- !== 0;) - if (!equal(a[i], b[i])) return false; - return true; - } - - if (arrA != arrB) return false; - - var dateA = a instanceof Date - , dateB = b instanceof Date; - if (dateA != dateB) return false; - if (dateA && dateB) return a.getTime() == b.getTime(); - - var regexpA = a instanceof RegExp - , regexpB = b instanceof RegExp; - if (regexpA != regexpB) return false; - if (regexpA && regexpB) return a.toString() == b.toString(); - - var keys = keyList(a); - length = keys.length; - - if (length !== keyList(b).length) - return false; - - for (i = length; i-- !== 0;) - if (!hasProp.call(b, keys[i])) return false; - - for (i = length; i-- !== 0;) { - key = keys[i]; - if (!equal(a[key], b[key])) return false; - } - - return true; - } - - return a!==a && b!==b; -}; - -(function (exports) { -Object.defineProperty(exports, "__esModule", { value: true }); -var areEquals = fastDeepEqual; -var helpers_1 = helpers; -exports.JsonPatchError = helpers_1.PatchError; -exports.deepClone = helpers_1._deepClone; -/* We use a Javascript hash to store each - function. Each hash entry (property) uses - the operation identifiers specified in rfc6902. - In this way, we can map each patch operation - to its dedicated function in efficient way. - */ -/* The operations applicable to an object */ -var objOps = { - add: function (obj, key, document) { - obj[key] = this.value; - return { newDocument: document }; - }, - remove: function (obj, key, document) { - var removed = obj[key]; - delete obj[key]; - return { newDocument: document, removed: removed }; - }, - replace: function (obj, key, document) { - var removed = obj[key]; - obj[key] = this.value; - return { newDocument: document, removed: removed }; - }, - move: function (obj, key, document) { - /* in case move target overwrites an existing value, - return the removed value, this can be taxing performance-wise, - and is potentially unneeded */ - var removed = getValueByPointer(document, this.path); - if (removed) { - removed = helpers_1._deepClone(removed); - } - var originalValue = applyOperation(document, { op: "remove", path: this.from }).removed; - applyOperation(document, { op: "add", path: this.path, value: originalValue }); - return { newDocument: document, removed: removed }; - }, - copy: function (obj, key, document) { - var valueToCopy = getValueByPointer(document, this.from); - // enforce copy by value so further operations don't affect source (see issue #177) - applyOperation(document, { op: "add", path: this.path, value: helpers_1._deepClone(valueToCopy) }); - return { newDocument: document }; - }, - test: function (obj, key, document) { - return { newDocument: document, test: areEquals(obj[key], this.value) }; - }, - _get: function (obj, key, document) { - this.value = obj[key]; - return { newDocument: document }; - } -}; -/* The operations applicable to an array. Many are the same as for the object */ -var arrOps = { - add: function (arr, i, document) { - if (helpers_1.isInteger(i)) { - arr.splice(i, 0, this.value); - } - else { // array props - arr[i] = this.value; - } - // this may be needed when using '-' in an array - return { newDocument: document, index: i }; - }, - remove: function (arr, i, document) { - var removedList = arr.splice(i, 1); - return { newDocument: document, removed: removedList[0] }; - }, - replace: function (arr, i, document) { - var removed = arr[i]; - arr[i] = this.value; - return { newDocument: document, removed: removed }; - }, - move: objOps.move, - copy: objOps.copy, - test: objOps.test, - _get: objOps._get -}; -/** - * Retrieves a value from a JSON document by a JSON pointer. - * Returns the value. - * - * @param document The document to get the value from - * @param pointer an escaped JSON pointer - * @return The retrieved value - */ -function getValueByPointer(document, pointer) { - if (pointer == '') { - return document; - } - var getOriginalDestination = { op: "_get", path: pointer }; - applyOperation(document, getOriginalDestination); - return getOriginalDestination.value; -} -exports.getValueByPointer = getValueByPointer; -/** - * Apply a single JSON Patch Operation on a JSON document. - * Returns the {newDocument, result} of the operation. - * It modifies the `document` and `operation` objects - it gets the values by reference. - * If you would like to avoid touching your values, clone them: - * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`. - * - * @param document The document to patch - * @param operation The operation to apply - * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation. - * @param mutateDocument Whether to mutate the original document or clone it before applying - * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`. - * @return `{newDocument, result}` after the operation - */ -function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) { - if (validateOperation === void 0) { validateOperation = false; } - if (mutateDocument === void 0) { mutateDocument = true; } - if (banPrototypeModifications === void 0) { banPrototypeModifications = true; } - if (index === void 0) { index = 0; } - if (validateOperation) { - if (typeof validateOperation == 'function') { - validateOperation(operation, 0, document, operation.path); - } - else { - validator(operation, 0); - } - } - /* ROOT OPERATIONS */ - if (operation.path === "") { - var returnValue = { newDocument: document }; - if (operation.op === 'add') { - returnValue.newDocument = operation.value; - return returnValue; - } - else if (operation.op === 'replace') { - returnValue.newDocument = operation.value; - returnValue.removed = document; //document we removed - return returnValue; - } - else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root - returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field - if (operation.op === 'move') { // report removed item - returnValue.removed = document; - } - return returnValue; - } - else if (operation.op === 'test') { - returnValue.test = areEquals(document, operation.value); - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - returnValue.newDocument = document; - return returnValue; - } - else if (operation.op === 'remove') { // a remove on root - returnValue.removed = document; - returnValue.newDocument = null; - return returnValue; - } - else if (operation.op === '_get') { - operation.value = document; - return returnValue; - } - else { /* bad operation */ - if (validateOperation) { - throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document); - } - else { - return returnValue; - } - } - } /* END ROOT OPERATIONS */ - else { - if (!mutateDocument) { - document = helpers_1._deepClone(document); - } - var path = operation.path || ""; - var keys = path.split('/'); - var obj = document; - var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift - var len = keys.length; - var existingPathFragment = undefined; - var key = void 0; - var validateFunction = void 0; - if (typeof validateOperation == 'function') { - validateFunction = validateOperation; - } - else { - validateFunction = validator; - } - while (true) { - key = keys[t]; - if (banPrototypeModifications && key == '__proto__') { - throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README'); - } - if (validateOperation) { - if (existingPathFragment === undefined) { - if (obj[key] === undefined) { - existingPathFragment = keys.slice(0, t).join('/'); - } - else if (t == len - 1) { - existingPathFragment = operation.path; - } - if (existingPathFragment !== undefined) { - validateFunction(operation, 0, document, existingPathFragment); - } - } - } - t++; - if (Array.isArray(obj)) { - if (key === '-') { - key = obj.length; - } - else { - if (validateOperation && !helpers_1.isInteger(key)) { - throw new exports.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document); - } // only parse key when it's an integer for `arr.prop` to work - else if (helpers_1.isInteger(key)) { - key = ~~key; - } - } - if (t >= len) { - if (validateOperation && operation.op === "add" && key > obj.length) { - throw new exports.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index, operation, document); - } - var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return returnValue; - } - } - else { - if (key && key.indexOf('~') != -1) { - key = helpers_1.unescapePathComponent(key); - } - if (t >= len) { - var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch - if (returnValue.test === false) { - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return returnValue; - } - } - obj = obj[key]; - } - } -} -exports.applyOperation = applyOperation; -/** - * Apply a full JSON Patch array on a JSON document. - * Returns the {newDocument, result} of the patch. - * It modifies the `document` object and `patch` - it gets the values by reference. - * If you would like to avoid touching your values, clone them: - * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`. - * - * @param document The document to patch - * @param patch The patch to apply - * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation. - * @param mutateDocument Whether to mutate the original document or clone it before applying - * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`. - * @return An array of `{newDocument, result}` after the patch - */ -function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) { - if (mutateDocument === void 0) { mutateDocument = true; } - if (banPrototypeModifications === void 0) { banPrototypeModifications = true; } - if (validateOperation) { - if (!Array.isArray(patch)) { - throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY'); - } - } - if (!mutateDocument) { - document = helpers_1._deepClone(document); - } - var results = new Array(patch.length); - for (var i = 0, length_1 = patch.length; i < length_1; i++) { - // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true` - results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i); - document = results[i].newDocument; // in case root was replaced - } - results.newDocument = document; - return results; -} -exports.applyPatch = applyPatch; -/** - * Apply a single JSON Patch Operation on a JSON document. - * Returns the updated document. - * Suitable as a reducer. - * - * @param document The document to patch - * @param operation The operation to apply - * @return The updated document - */ -function applyReducer(document, operation, index) { - var operationResult = applyOperation(document, operation); - if (operationResult.test === false) { // failed test - throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document); - } - return operationResult.newDocument; -} -exports.applyReducer = applyReducer; -/** - * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error. - * @param {object} operation - operation object (patch) - * @param {number} index - index of operation in the sequence - * @param {object} [document] - object where the operation is supposed to be applied - * @param {string} [existingPathFragment] - comes along with `document` - */ -function validator(operation, index, document, existingPathFragment) { - if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) { - throw new exports.JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document); - } - else if (!objOps[operation.op]) { - throw new exports.JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document); - } - else if (typeof operation.path !== 'string') { - throw new exports.JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document); - } - else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) { - // paths that aren't empty string should start with "/" - throw new exports.JsonPatchError('Operation `path` property must start with "/"', 'OPERATION_PATH_INVALID', index, operation, document); - } - else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') { - throw new exports.JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document); - } - else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) { - throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document); - } - else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && helpers_1.hasUndefined(operation.value)) { - throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document); - } - else if (document) { - if (operation.op == "add") { - var pathLen = operation.path.split("/").length; - var existingPathLen = existingPathFragment.split("/").length; - if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) { - throw new exports.JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document); - } - } - else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') { - if (operation.path !== existingPathFragment) { - throw new exports.JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document); - } - } - else if (operation.op === 'move' || operation.op === 'copy') { - var existingValue = { op: "_get", path: operation.from, value: undefined }; - var error = validate([existingValue], document); - if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') { - throw new exports.JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document); - } - } - } -} -exports.validator = validator; -/** - * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document. - * If error is encountered, returns a JsonPatchError object - * @param sequence - * @param document - * @returns {JsonPatchError|undefined} - */ -function validate(sequence, document, externalValidator) { - try { - if (!Array.isArray(sequence)) { - throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY'); - } - if (document) { - //clone document and sequence so that we can safely try applying operations - applyPatch(helpers_1._deepClone(document), helpers_1._deepClone(sequence), externalValidator || true); - } - else { - externalValidator = externalValidator || validator; - for (var i = 0; i < sequence.length; i++) { - externalValidator(sequence[i], i, document, undefined); - } - } - } - catch (e) { - if (e instanceof exports.JsonPatchError) { - return e; - } - else { - throw e; - } - } -} -exports.validate = validate; -/** - * Default export for backwards compat - */ -exports.default = { - JsonPatchError: exports.JsonPatchError, - deepClone: exports.deepClone, - getValueByPointer: getValueByPointer, - applyOperation: applyOperation, - applyPatch: applyPatch, - applyReducer: applyReducer, - validator: validator, - validate: validate -}; -}(core$2)); - -var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(duplex, "__esModule", { value: true }); -/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017 Joachim Wester - * MIT license - */ -var helpers_1 = helpers; -var core_1 = core$2; -/* export all core functions and types */ -var core_2 = core$2; -duplex.applyOperation = core_2.applyOperation; -duplex.applyPatch = core_2.applyPatch; -duplex.applyReducer = core_2.applyReducer; -duplex.getValueByPointer = core_2.getValueByPointer; -duplex.validate = core_2.validate; -duplex.validator = core_2.validator; -/* export some helpers */ -var helpers_2 = helpers; -duplex.JsonPatchError = helpers_2.PatchError; -duplex.deepClone = helpers_2._deepClone; -duplex.escapePathComponent = helpers_2.escapePathComponent; -duplex.unescapePathComponent = helpers_2.unescapePathComponent; -var beforeDict = new WeakMap(); -var Mirror = /** @class */ (function () { - function Mirror(obj) { - this.observers = new Map(); - this.obj = obj; - } - return Mirror; -}()); -var ObserverInfo = /** @class */ (function () { - function ObserverInfo(callback, observer) { - this.callback = callback; - this.observer = observer; - } - return ObserverInfo; -}()); -function getMirror(obj) { - return beforeDict.get(obj); -} -function getObserverFromMirror(mirror, callback) { - return mirror.observers.get(callback); -} -function removeObserverFromMirror(mirror, observer) { - mirror.observers.delete(observer.callback); -} -/** - * Detach an observer from an object - */ -function unobserve(root, observer) { - observer.unobserve(); -} -duplex.unobserve = unobserve; -/** - * Observes changes made to an object, which can then be retrieved using generate - */ -function observe(obj, callback) { - var patches = []; - var observer; - var mirror = getMirror(obj); - if (!mirror) { - mirror = new Mirror(obj); - beforeDict.set(obj, mirror); - } - else { - var observerInfo = getObserverFromMirror(mirror, callback); - observer = observerInfo && observerInfo.observer; - } - if (observer) { - return observer; - } - observer = {}; - mirror.value = helpers_1._deepClone(obj); - if (callback) { - observer.callback = callback; - observer.next = null; - var dirtyCheck = function () { - generate(observer); - }; - var fastCheck = function () { - clearTimeout(observer.next); - observer.next = setTimeout(dirtyCheck); - }; - if (typeof window !== 'undefined') { //not Node - window.addEventListener('mouseup', fastCheck); - window.addEventListener('keyup', fastCheck); - window.addEventListener('mousedown', fastCheck); - window.addEventListener('keydown', fastCheck); - window.addEventListener('change', fastCheck); - } - } - observer.patches = patches; - observer.object = obj; - observer.unobserve = function () { - generate(observer); - clearTimeout(observer.next); - removeObserverFromMirror(mirror, observer); - if (typeof window !== 'undefined') { - window.removeEventListener('mouseup', fastCheck); - window.removeEventListener('keyup', fastCheck); - window.removeEventListener('mousedown', fastCheck); - window.removeEventListener('keydown', fastCheck); - window.removeEventListener('change', fastCheck); - } - }; - mirror.observers.set(callback, new ObserverInfo(callback, observer)); - return observer; -} -duplex.observe = observe; -/** - * Generate an array of patches from an observer - */ -function generate(observer, invertible) { - if (invertible === void 0) { invertible = false; } - var mirror = beforeDict.get(observer.object); - _generate(mirror.value, observer.object, observer.patches, "", invertible); - if (observer.patches.length) { - core_1.applyPatch(mirror.value, observer.patches); - } - var temp = observer.patches; - if (temp.length > 0) { - observer.patches = []; - if (observer.callback) { - observer.callback(temp); - } - } - return temp; -} -duplex.generate = generate; -// Dirty check if obj is different from mirror, generate patches and update mirror -function _generate(mirror, obj, patches, path, invertible) { - if (obj === mirror) { - return; - } - if (typeof obj.toJSON === "function") { - obj = obj.toJSON(); - } - var newKeys = helpers_1._objectKeys(obj); - var oldKeys = helpers_1._objectKeys(mirror); - var deleted = false; - //if ever "move" operation is implemented here, make sure this test runs OK: "should not generate the same patch twice (move)" - for (var t = oldKeys.length - 1; t >= 0; t--) { - var key = oldKeys[t]; - var oldVal = mirror[key]; - if (helpers_1.hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) { - var newVal = obj[key]; - if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null) { - _generate(oldVal, newVal, patches, path + "/" + helpers_1.escapePathComponent(key), invertible); - } - else { - if (oldVal !== newVal) { - if (invertible) { - patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) }); - } - patches.push({ op: "replace", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(newVal) }); - } - } - } - else if (Array.isArray(mirror) === Array.isArray(obj)) { - if (invertible) { - patches.push({ op: "test", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(oldVal) }); - } - patches.push({ op: "remove", path: path + "/" + helpers_1.escapePathComponent(key) }); - deleted = true; // property has been deleted - } - else { - if (invertible) { - patches.push({ op: "test", path: path, value: mirror }); - } - patches.push({ op: "replace", path: path, value: obj }); - } - } - if (!deleted && newKeys.length == oldKeys.length) { - return; - } - for (var t = 0; t < newKeys.length; t++) { - var key = newKeys[t]; - if (!helpers_1.hasOwnProperty(mirror, key) && obj[key] !== undefined) { - patches.push({ op: "add", path: path + "/" + helpers_1.escapePathComponent(key), value: helpers_1._deepClone(obj[key]) }); - } - } -} -/** - * Create an array of patches from the differences in two objects - */ -function compare$k(tree1, tree2, invertible) { - if (invertible === void 0) { invertible = false; } - var patches = []; - _generate(tree1, tree2, patches, '', invertible); - return patches; -} -duplex.compare = compare$k; -/** - * Default export for backwards compat - */ -// import just to re-export as default -var core$1 = core$2; -var helpers_3 = helpers; -duplex.default = __assign({}, core$1, { - // duplex - unobserve: unobserve, - observe: observe, - generate: generate, - compare: compare$k, - // helpers - JsonPatchError: helpers_3.PatchError, deepClone: helpers_1._deepClone, escapePathComponent: helpers_1.escapePathComponent, - unescapePathComponent: helpers_3.unescapePathComponent }); - -const crypto$o = require$$0$4; - -/** - * Simple interaction with 256-bit spaces. - */ -class Hash256$9 { - /** - * Create an instance of a `Hash256` object by calling `new Hash256()`, - * where `settings` can be provided to supply a particular input object. - * - * If the `settings` is not a string, `input` must be provided. - * @param {Object} settings - * @param {String} settings.input Input string to map as 256-bit hash. - */ - constructor (settings = {}) { - if (typeof settings === 'string') settings = { input: settings }; - if (!settings.input) settings.input = crypto$o.randomBytes(32).toString('hex'); - - this.settings = Object.assign({ - hash: Hash256$9.digest(settings.input) - }, settings); - } - - /** - * Produce a SHA256 digest of some input data. - * @param {String|Buffer} input Content to digest. - * @returns {String} `SHA256(input)` as a hexadecimal string. - */ - static digest (input) { - if (typeof input !== 'string' && !(input instanceof Buffer)) { - throw new Error(`Input to process must be of type "String" or "Buffer" to digest.`); - } - - // consume and output as string - return crypto$o.createHash('sha256').update(input).digest('hex'); - } - - // TODO: document `hash256.value` - get value () { - return Hash256$9.digest(this.settings.input); - } - - /** - * Reverses the bytes of the digest. - */ - static reverse (input = '') { - return Buffer.from(input, 'hex').reverse().toString('hex'); - } - - reverse (input = this.value) { - return Hash256$9.reverse(input); - } -} - -var hash256$l = Hash256$9; - -/** - * Create a new {@link Object} with sorted properties. - * @param {Object} [state] Object to sort. - * @returns {Object} Re-sorted instance of `state` as provided. - */ - -var _sortKeys$1 = function _sortKeys (state = {}) { - return Object.keys(state).sort().reduce((obj, key) => { - obj[key] = state[key]; - return obj; - }, {}); -}; - -// Dependencies -const crypto$n = require$$0$4; -const { EventEmitter: EventEmitter$w } = require$$1$4; - -// -const monitor$6 = duplex; -const pointer$6 = jsonPointer$1; - -// Fabric Types -const Hash256$8 = hash256$l; - -// Fabric Functions -const _sortKeys = _sortKeys$1; - -/** - * Generic Fabric Actor. - * @access protected - * @emits message Fabric {@link Message} objects. - * @property {String} id Unique identifier for this Actor (id === SHA256(preimage)). - * @property {String} preimage Input hash for the `id` property (preimage === SHA256(ActorState)). - */ -class Actor$g extends EventEmitter$w { - /** - * Creates an {@link Actor}, which emits messages for other - * Actors to subscribe to. You can supply certain parameters - * for the actor, including key material [!!!] — be mindful of - * what you share with others! - * @param {Object} [actor] Object to use as the actor. - * @param {String} [actor.seed] BIP24 Mnemonic to use as a seed phrase. - * @param {Buffer} [actor.public] Public key. - * @param {Buffer} [actor.private] Private key. - * @returns {Actor} Instance of the Actor. Call {@link Actor#sign} to emit a {@link Signature}. - */ - constructor (actor = {}) { - super(actor); - - this.commits = []; - // this.signature = Buffer.alloc(64); - this.value = this._readObject(actor); // TODO: use Buffer? - - // Internal State - this._state = { - type: 'Actor', - data: this.value, - status: 'PAUSED', - content: this.value || {} - }; - - // this.observer = monitor.observe(this._state.content, this._handleMonitorChanges.bind(this)); - - // Chainable - return this; - /* return new Proxy(this, { - get: function (obj, name) { - return Object.hasOwnProperty.call(obj, name) ? obj[name] : obj._getField(name); - } - }); */ - } - - static fromAny (input = {}) { - let state = null; - - if (typeof input === 'string') { - state = { content: input }; - } else if (input instanceof Buffer) { - state = { content: input.toString('hex') }; - } else { - state = Object.assign({}, input); - } - - return new Actor$g(state); - } - - static fromJSON (input) { - let result = null; - - if (typeof input === 'string' && input.length) { - console.log('trying to parse as JSON:', input); - try { - result = JSON.parse(input); - } catch (E) { - console.error('Failure in fromJSON:', E); - } - } else { - console.trace('Invalid input:', typeof input); - } - - return result; - } - - static randomBytes (count = 32) { - return crypto$n.randomBytes(count); - } - - get id () { - const buffer = Buffer.from(this.preimage, 'hex'); - return Hash256$8.digest(buffer); - } - - get preimage () { - const input = { - 'type': 'FabricActorState', - 'object': this.toObject() - }; - - // console.log('input:', input['object']); - - const string = JSON.stringify(input, null, ' '); - const buffer = Buffer.from(string, 'utf8'); - - return Hash256$8.digest(buffer); - } - - get state () { - return Object.assign({}, this._state.content); - } - - get status () { - return this._state.status; - } - - get type () { - return this._state['@type']; - } - - set state (value) { - this._state.content = value; - } - - set status (value) { - this._state.status = value; - } - - /** - * Resolve the current state to a commitment. - * @emits Actor Current malleable state. - * @returns {String} 32-byte ID - */ - commit () { - const state = new Actor$g(this.state); - const changes = monitor$6.generate(this.observer); - const parent = this.history[this.history.length - 1].state; - const commit = new Actor$g({ - changes: changes, - parent: parent, - state: state.id - }); - - this.history.push(commit); - this.emit('commit', commit); - return commit.id; - } - - debug (...params) { - this.emit('debug', params); - } - - get (path) { - return pointer$6.get(this._state.content, path); - } - - log (...params) { - this.emit('log', ...params); - } - - mutate (seed) { - if (seed === 0 || !seed) seed = this.randomBytes(32).toString('hex'); - - const patches = [ - { op: 'replace', path: '/seed', value: seed } - ]; - - monitor$6.applyPatch(this._state.content, patches); - console.log('new state:', this._state.content); - this.commit(); - - return this; - } - - set (path, value) { - pointer$6.set(this._state.content, path, value); - this.commit(); - return this; - } - - /** - * Casts the Actor to a normalized Buffer. - * @returns {Buffer} - */ - toBuffer () { - return Buffer.from(this.serialize(), 'utf8'); - } - - /** - * Returns the Actor's current state as an {@link Object}. - * @returns {Object} - */ - toObject () { - // console.log('toObject() state:', this.state); - return _sortKeys(this.state); - } - - toString (format = 'json') { - switch (format) { - case 'hex': - return Buffer.from(this.serialize(), 'utf8').toString('hex'); - case 'json': - default: - return this.serialize(); - } - } - - pause () { - this.status = 'PAUSING'; - this.commit(); - return this; - } - - randomBytes (count = 32) { - return crypto$n.randomBytes(count); - } - - /** - * Serialize the Actor's current state into a JSON-formatted string. - * @returns {String} - */ - serialize () { - let json = null; - - try { - json = JSON.stringify(this.toObject(), null, ' '); - } catch (exception) { - json = JSON.stringify({ - type: 'Error', - content: `Exception serializing: ${exception}` - }, null, ' '); - } - - return json; - } - - sha256 (value) { - return Hash256$8.digest(value); - } - - /** - * Signs the Actor. - * @returns {Actor} - */ - sign () { - throw new Error('Unimplemented on this branch. Use @fabric/core/types/signer instead.'); - /* this.signature = this.key._sign(this.toBuffer()); - this.emit('signature', this.signature); - return this; */ - } - - /** - * Toggles `status` property to unpaused. - * @ - * @returns {Actor} - */ - unpause () { - this.status = 'UNPAUSING'; - this.commit(); - this.status = 'UNPAUSED'; - return this; - } - - _getField (name) { - return this._state.content[name]; - } - - /** - * Incurs 1 SYSCALL - * @access private - * @returns {Object} - */ - _getState () { - return this.state; - } - - _handleMonitorChanges (changes) { - console.log('got monitor changes from actor:', changes); - // TODO: emit global state event here - // after verify, commit - } - - /** - * Parse an Object into a corresponding Fabric state. - * @param {Object} input Object to read as input. - * @returns {Object} Fabric state. - */ - _readObject (input = {}) { - let state = {}; - - if (typeof input === 'string') { - state = Object.assign(state, { - type: 'String', - size: input.length, - content: input, - encoding: 'utf8' - }); - } else if (input instanceof Buffer) { - state = Object.assign(state, { - type: 'Buffer', - size: input.length, - content: input.toString('hex'), - encoding: 'hex' - }); - } else { - state = Object.assign(state, input); - } - - return state; - } -} - -var actor = Actor$g; - -var pluralize$5 = {exports: {}}; - -/* global define */ - -(function (module, exports) { -(function (root, pluralize) { - /* istanbul ignore else */ - if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { - // Node. - module.exports = pluralize(); - } else { - // Browser global. - root.pluralize = pluralize(); - } -})(commonjsGlobal, function () { - // Rule storage - pluralize and singularize need to be run sequentially, - // while other rules can be optimized using an object for instant lookups. - var pluralRules = []; - var singularRules = []; - var uncountables = {}; - var irregularPlurals = {}; - var irregularSingles = {}; - - /** - * Sanitize a pluralization rule to a usable regular expression. - * - * @param {(RegExp|string)} rule - * @return {RegExp} - */ - function sanitizeRule (rule) { - if (typeof rule === 'string') { - return new RegExp('^' + rule + '$', 'i'); - } - - return rule; - } - - /** - * Pass in a word token to produce a function that can replicate the case on - * another word. - * - * @param {string} word - * @param {string} token - * @return {Function} - */ - function restoreCase (word, token) { - // Tokens are an exact match. - if (word === token) return token; - - // Lower cased words. E.g. "hello". - if (word === word.toLowerCase()) return token.toLowerCase(); - - // Upper cased words. E.g. "WHISKY". - if (word === word.toUpperCase()) return token.toUpperCase(); - - // Title cased words. E.g. "Title". - if (word[0] === word[0].toUpperCase()) { - return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); - } - - // Lower cased words. E.g. "test". - return token.toLowerCase(); - } - - /** - * Interpolate a regexp string. - * - * @param {string} str - * @param {Array} args - * @return {string} - */ - function interpolate (str, args) { - return str.replace(/\$(\d{1,2})/g, function (match, index) { - return args[index] || ''; - }); - } - - /** - * Replace a word using a rule. - * - * @param {string} word - * @param {Array} rule - * @return {string} - */ - function replace (word, rule) { - return word.replace(rule[0], function (match, index) { - var result = interpolate(rule[1], arguments); - - if (match === '') { - return restoreCase(word[index - 1], result); - } - - return restoreCase(match, result); - }); - } - - /** - * Sanitize a word by passing in the word and sanitization rules. - * - * @param {string} token - * @param {string} word - * @param {Array} rules - * @return {string} - */ - function sanitizeWord (token, word, rules) { - // Empty string or doesn't need fixing. - if (!token.length || uncountables.hasOwnProperty(token)) { - return word; - } - - var len = rules.length; - - // Iterate over the sanitization rules and use the first one to match. - while (len--) { - var rule = rules[len]; - - if (rule[0].test(word)) return replace(word, rule); - } - - return word; - } - - /** - * Replace a word with the updated word. - * - * @param {Object} replaceMap - * @param {Object} keepMap - * @param {Array} rules - * @return {Function} - */ - function replaceWord (replaceMap, keepMap, rules) { - return function (word) { - // Get the correct token and case restoration functions. - var token = word.toLowerCase(); - - // Check against the keep object map. - if (keepMap.hasOwnProperty(token)) { - return restoreCase(word, token); - } - - // Check against the replacement map for a direct word replacement. - if (replaceMap.hasOwnProperty(token)) { - return restoreCase(word, replaceMap[token]); - } - - // Run all the rules against the word. - return sanitizeWord(token, word, rules); - }; - } - - /** - * Check if a word is part of the map. - */ - function checkWord (replaceMap, keepMap, rules, bool) { - return function (word) { - var token = word.toLowerCase(); - - if (keepMap.hasOwnProperty(token)) return true; - if (replaceMap.hasOwnProperty(token)) return false; - - return sanitizeWord(token, token, rules) === token; - }; - } - - /** - * Pluralize or singularize a word based on the passed in count. - * - * @param {string} word The word to pluralize - * @param {number} count How many of the word exist - * @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks) - * @return {string} - */ - function pluralize (word, count, inclusive) { - var pluralized = count === 1 - ? pluralize.singular(word) : pluralize.plural(word); - - return (inclusive ? count + ' ' : '') + pluralized; - } - - /** - * Pluralize a word. - * - * @type {Function} - */ - pluralize.plural = replaceWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Check if a word is plural. - * - * @type {Function} - */ - pluralize.isPlural = checkWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Singularize a word. - * - * @type {Function} - */ - pluralize.singular = replaceWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Check if a word is singular. - * - * @type {Function} - */ - pluralize.isSingular = checkWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Add a pluralization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addPluralRule = function (rule, replacement) { - pluralRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add a singularization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addSingularRule = function (rule, replacement) { - singularRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add an uncountable word rule. - * - * @param {(string|RegExp)} word - */ - pluralize.addUncountableRule = function (word) { - if (typeof word === 'string') { - uncountables[word.toLowerCase()] = true; - return; - } - - // Set singular and plural references for the word. - pluralize.addPluralRule(word, '$0'); - pluralize.addSingularRule(word, '$0'); - }; - - /** - * Add an irregular word definition. - * - * @param {string} single - * @param {string} plural - */ - pluralize.addIrregularRule = function (single, plural) { - plural = plural.toLowerCase(); - single = single.toLowerCase(); - - irregularSingles[single] = plural; - irregularPlurals[plural] = single; - }; - - /** - * Irregular rules. - */ - [ - // Pronouns. - ['I', 'we'], - ['me', 'us'], - ['he', 'they'], - ['she', 'they'], - ['them', 'them'], - ['myself', 'ourselves'], - ['yourself', 'yourselves'], - ['itself', 'themselves'], - ['herself', 'themselves'], - ['himself', 'themselves'], - ['themself', 'themselves'], - ['is', 'are'], - ['was', 'were'], - ['has', 'have'], - ['this', 'these'], - ['that', 'those'], - // Words ending in with a consonant and `o`. - ['echo', 'echoes'], - ['dingo', 'dingoes'], - ['volcano', 'volcanoes'], - ['tornado', 'tornadoes'], - ['torpedo', 'torpedoes'], - // Ends with `us`. - ['genus', 'genera'], - ['viscus', 'viscera'], - // Ends with `ma`. - ['stigma', 'stigmata'], - ['stoma', 'stomata'], - ['dogma', 'dogmata'], - ['lemma', 'lemmata'], - ['schema', 'schemata'], - ['anathema', 'anathemata'], - // Other irregular rules. - ['ox', 'oxen'], - ['axe', 'axes'], - ['die', 'dice'], - ['yes', 'yeses'], - ['foot', 'feet'], - ['eave', 'eaves'], - ['goose', 'geese'], - ['tooth', 'teeth'], - ['quiz', 'quizzes'], - ['human', 'humans'], - ['proof', 'proofs'], - ['carve', 'carves'], - ['valve', 'valves'], - ['looey', 'looies'], - ['thief', 'thieves'], - ['groove', 'grooves'], - ['pickaxe', 'pickaxes'], - ['passerby', 'passersby'] - ].forEach(function (rule) { - return pluralize.addIrregularRule(rule[0], rule[1]); - }); - - /** - * Pluralization rules. - */ - [ - [/s?$/i, 's'], - [/[^\u0000-\u007F]$/i, '$0'], - [/([^aeiou]ese)$/i, '$1'], - [/(ax|test)is$/i, '$1es'], - [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'], - [/(e[mn]u)s?$/i, '$1s'], - [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], - [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], - [/(seraph|cherub)(?:im)?$/i, '$1im'], - [/(her|at|gr)o$/i, '$1oes'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], - [/sis$/i, 'ses'], - [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], - [/([^aeiouy]|qu)y$/i, '$1ies'], - [/([^ch][ieo][ln])ey$/i, '$1ies'], - [/(x|ch|ss|sh|zz)$/i, '$1es'], - [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], - [/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'], - [/(pe)(?:rson|ople)$/i, '$1ople'], - [/(child)(?:ren)?$/i, '$1ren'], - [/eaux$/i, '$0'], - [/m[ae]n$/i, 'men'], - ['thou', 'you'] - ].forEach(function (rule) { - return pluralize.addPluralRule(rule[0], rule[1]); - }); - - /** - * Singularization rules. - */ - [ - [/s$/i, ''], - [/(ss)$/i, '$1'], - [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], - [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], - [/ies$/i, 'y'], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'], - [/\b(mon|smil)ies$/i, '$1ey'], - [/\b((?:tit)?m|l)ice$/i, '$1ouse'], - [/(seraph|cherub)im$/i, '$1'], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'], - [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'], - [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'], - [/(test)(?:is|es)$/i, '$1is'], - [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], - [/(alumn|alg|vertebr)ae$/i, '$1a'], - [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], - [/(matr|append)ices$/i, '$1ix'], - [/(pe)(rson|ople)$/i, '$1rson'], - [/(child)ren$/i, '$1'], - [/(eau)x?$/i, '$1'], - [/men$/i, 'man'] - ].forEach(function (rule) { - return pluralize.addSingularRule(rule[0], rule[1]); - }); - - /** - * Uncountable rules. - */ - [ - // Singular words with no plurals. - 'adulthood', - 'advice', - 'agenda', - 'aid', - 'aircraft', - 'alcohol', - 'ammo', - 'analytics', - 'anime', - 'athletics', - 'audio', - 'bison', - 'blood', - 'bream', - 'buffalo', - 'butter', - 'carp', - 'cash', - 'chassis', - 'chess', - 'clothing', - 'cod', - 'commerce', - 'cooperation', - 'corps', - 'debris', - 'diabetes', - 'digestion', - 'elk', - 'energy', - 'equipment', - 'excretion', - 'expertise', - 'firmware', - 'flounder', - 'fun', - 'gallows', - 'garbage', - 'graffiti', - 'hardware', - 'headquarters', - 'health', - 'herpes', - 'highjinks', - 'homework', - 'housework', - 'information', - 'jeans', - 'justice', - 'kudos', - 'labour', - 'literature', - 'machinery', - 'mackerel', - 'mail', - 'media', - 'mews', - 'moose', - 'music', - 'mud', - 'manga', - 'news', - 'only', - 'personnel', - 'pike', - 'plankton', - 'pliers', - 'police', - 'pollution', - 'premises', - 'rain', - 'research', - 'rice', - 'salmon', - 'scissors', - 'series', - 'sewage', - 'shambles', - 'shrimp', - 'software', - 'species', - 'staff', - 'swine', - 'tennis', - 'traffic', - 'transportation', - 'trout', - 'tuna', - 'wealth', - 'welfare', - 'whiting', - 'wildebeest', - 'wildlife', - 'you', - /pok[eé]mon$/i, - // Regexes. - /[^aeiou]ese$/i, // "chinese", "japanese" - /deer$/i, // "deer", "reindeer" - /fish$/i, // "fish", "blowfish", "angelfish" - /measles$/i, - /o[iu]s$/i, // "carnivorous" - /pox$/i, // "chickpox", "smallpox" - /sheep$/i - ].forEach(pluralize.addUncountableRule); - - return pluralize; -}); -}(pluralize$5)); - -const crypto$m = require$$0$4; -const { EventEmitter: EventEmitter$v } = require$$1$4; - -/** - * Live instance of an ARC in Fabric. - * @type {Object} - */ -class Entity$8 extends EventEmitter$v { - /** - * Generic template for virtual objects. - * @param {Object} [data={}] Pass an object to use. - * @return {Entity} Instance of the {@link Entity}. - */ - constructor (data = {}) { - super(data); - - // allow this entity to be run without the new keyword - if (!(this instanceof Entity$8)) return new Entity$8(data); - - // set internal properties - this.settings = { - verbosity: 2 // Information && Warnings - }; - - // configure defaults - this.actor = Object.assign({}, this._downsample(data)); - this.data = Object.assign({}, data); - - // TODO: use getters/setters to restrict access to these elements - // remove EventEmitter cruft - Object.defineProperty(this, '_events', { enumerable: false }); - Object.defineProperty(this, '_eventsCount', { enumerable: false }); - Object.defineProperty(this, '_maxListeners', { enumerable: false }); - - // remove mutable variables - Object.defineProperty(this, 'actor', { enumerable: false }); - // Object.defineProperty(this, 'machine', { enumerable: false }); - - // return instance - return this; - } - - get version () { - return 1; - } - - set state (state) { - if (!state) throw new Error('State must be provided.'); - this._state = state; - } - - get state () { - return Object.assign({}, this._state); - } - - get buffer () { - let entity = this; - return function buffer () { - return Buffer.from(entity.toJSON(), 'utf8'); - } - } - - get id () { - let data = this.toJSON(); - let hash = crypto$m.createHash('sha256').update(data).digest('hex'); - if (this.settings.verbosity >= 5) console.log('[FABRIC:ENTITY (pending upstream!)]', 'hash:', hash, 'data:', data); - return hash; - } - - serialize () { - return this.toJSON(); - } - - toBuffer () { - return Buffer.from(this.toString(), 'utf8'); - } - - /** - * Produces a string of JSON, representing the entity. - * @return {String} JSON-encoded object. - */ - toJSON () { - let result = null; - - switch (this.actor['@type']) { - default: - result = JSON.stringify(this.toObject()); - break; - case 'Function': - result = this._downsample(); - break; - case 'Buffer': - case 'String': - result = JSON.stringify(this.toString()); - break; - } - - return result; - } - - toString () { - let result = null; - - switch (this.actor['@type']) { - default: - result = JSON.stringify(this.actor['@data']); - break; - case 'Buffer': - new Uint8Array(this.data); - const values = Object.values(this.data); - result = JSON.stringify(values); - break; - case 'String': - // TODO: write up longer-form explanation as to why we use an Array here - result = this.actor['@data'].map(x => String.fromCharCode(x)).join(''); - // console.log('was string in array? now:', result); - break; - } - - return result; - } - - toObject () { - return this.actor['@data']; - } - - /** - * As a {@link Buffer}. - * @return {Buffer} Slice of memory. - */ - toRaw () { - return Buffer.from(this.toJSON(), 'utf8'); - } - - /** - * Return a {@link Fabric}-labeled {@link Object} for this {@link Entity}. - * @param {Mixed} [input] Input to downsample. If not provided, current Entity will be used. - */ - _downsample (input = this.data) { - let result = {}; - - if (typeof input === 'string') { - result = { - '@type': 'String', - '@data': input.split('').map(x => x.charCodeAt(0)) - }; - } else if (input instanceof Array) { - result = { - '@type': 'Array', - '@data': input - }; - } else if (input instanceof Buffer) { - result = { - '@type': 'Buffer', - '@data': JSON.parse(JSON.stringify(input))[0] - }; - } else if (input instanceof Function) { - try { - result = { - '@type': 'Function', - '@data': JSON.stringify(input) - }; - } catch (E) { - console.error('Something could not be converted:', E, input); - process.exit(); - } - } else { - try { - result = { - '@type': 'Entity', - '@data': JSON.parse(JSON.stringify(input)) - }; - } catch (E) { - console.error('Something could not be converted:', E, input); - process.exit(); - } - } - - return result; - } -} - -var entity = Entity$8; - -/** - * Parse input to a JSON string. - * @param {Object} [input] Any input object. - * @returns {String} - */ - -var json$1 = function (input) { - return JSON.stringify(input, null, ' '); -}; - -// Constants -const { - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$2 -} = constants$1; - -// Dependencies -const crypto$l = require$$0$4; -const monitor$5 = duplex; -const pointer$5 = jsonPointer$1; - -// Fabric Types -const Actor$f = actor; - -// Local Services -const json = json$1; - -/** - * The {@link State} is the core of most {@link User}-facing interactions. To - * interact with the {@link User}, simply propose a change in the state by - * committing to the outcome. This workflow keeps app design quite simple! - * @access protected - * @augments EventEmitter - * @property {Number} size Size of state in bytes. - * @property {Buffer} @buffer Byte-for-byte memory representation of state. - * @property {String} @type Named type. - * @property {Mixed} @data Local instance of the state. - * @property {String} @id Unique identifier for this data. - */ -class State$9 extends Actor$f { - /** - * Creates a snapshot of some information. - * @param {Mixed} data Input data. - * @return {State} Resulting state. - */ - constructor (data = {}) { - super(data); - - this['@input'] = data || null; - this['@data'] = data || {}; - this['@meta'] = {}; - this['@encoding'] = 'json'; - - // Literal Entity Structure - this['@entity'] = { - '@type': 'State', - '@data': data - }; - - // TODO: test and document memory alignment - // this['@buffer'] = Buffer.alloc(Constants.MAX_MESSAGE_SIZE); - this['@allocation'] = Buffer.alloc(MAX_MESSAGE_SIZE$2); - this['@buffer'] = Buffer.from(this.serialize(this['@entity']['@data'])); - - // if not destined to be an object... - if (typeof this['@data'] === 'string') { - this['@entity']['@type'] = 'String'; - this['@entity']['@data'] = this['@data'].split('').map(x => x.charCodeAt(0)); - } else if (this['@data'] instanceof Array) { - this['@entity']['@type'] = 'Array'; - } else if (this['@data'] instanceof Buffer) { - this['@entity']['@type'] = 'Buffer'; - } else if ( - this['@data'] && - this['@data']['@type'] && - this['@data']['@data'] - ) { - switch (this['@data']['@type']) { - default: - this['@entity']['@type'] = this['@data']['@type']; - this['@entity']['@data'] = this['@data']['@data']; - break; - } - } else { - this['@entity']['@type'] = 'Object'; - this['@entity']['@data'] = data; - } - - // start at zero - this._clock = 0; - - // set various #meta - this['@type'] = this['@entity']['@type']; - // this['@id'] = null; - // this['@id'] = this.id; - - // set internal data - this.services = { json }; - this.name = this['@entity'].name || this.id; - - if (this['@entity']['@data']) { - try { - this.observer = monitor$5.observe(this['@entity']['@data']); - } catch (E) { - console.error('Could not create observer:', E, this['@entity']['@data']); - } - } - - this.value = {}; - - // TODO: document hidden properties - // Remove various undesired clutter from output - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, 'key', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - Object.defineProperty(this, 'size', { - enumerable: true, - get: function count () { - return this['@buffer'].length; - } - }); - - Object.defineProperty(this, 'domain', { - enumerable: false - }); - - Object.defineProperty(this, '_events', { - enumerable: false - }); - - Object.defineProperty(this, '_eventsCount', { - enumerable: false - }); - - Object.defineProperty(this, '_maxListeners', { - enumerable: false - }); - - return this; - } - - static get json () { - return json; - } - - static get html () { - return json; - } - - static get pointer () { - return pointer$5; - } - - get path () { - return `/entities/${this.id}`; - } - - get state () { - return this.value; - // TODO: re-enable the below, map security considerations - // return Object.assign({}, this.value); - } - - set path (value) { - return this.path; - } - - set state (value) { - this.value = value; - } - - /** - * Marshall an input into an instance of a {@link State}. States have - * absolute authority over their own domain, so choose your States wisely. - * @param {String} input Arbitrary input. - * @return {State} Resulting instance of the {@link State}. - */ - static fromJSON (input) { - let result = null; - - if (typeof input === 'string') { - try { - result = JSON.parse(input); - } catch (E) { - console.error('Failure in fromJSON:', E); - } - } - - return result; - } - - static fromHex (input) { - if (typeof input !== 'string') return null; - return this.fromJSON(Buffer.from(input, 'hex').toString('utf8')); - } - - static fromString (input) { - if (typeof input !== 'string') return null; - return this.fromJSON(input); - } - - sha256 (value) { - return crypto$l.createHash('sha256').update(value).digest('hex'); - } - - async _applyChanges (ops) { - try { - monitor$5.applyPatch(this['@data'], ops); - - await this.commit(); - } catch (E) { - this.error('Error applying changes:', E); - } - - return this; - } - - fingerprint () { - const map = {}; - map['@method'] = 'sha256'; - map['@input'] = this.serialize(this['@entity']['@data']); - map['@buffer'] = crypto$l.createHash('sha256').update(map['@input'], 'utf8'); - map['@output'] = map['@buffer'].digest('hex'); - return map['@output']; - } - - isRoot () { - return this['@parent'] === this.id; - } - - toBuffer () { - if (this['@data'] instanceof Buffer) return this['@data']; - if (this['@data']) return this.serialize(); - - return Buffer.from(this['@data']['@data']); - } - - /** Converts the State to an HTML document. */ - toHTML () { - const state = this; - const solution = state['@output'].toString('utf8'); - const confirmed = String(solution); - const raw = `X-Claim-ID: ${this.id} -X-Claim-Integrity: sha256 -X-Claim-Type: Response -X-Claim-Result: ${state.id} -Body: -# STOP! -Here is your opportunity to read the documentation: https://dev.fabric.pub - -Document ID: ${this.id} -Document Type (local JSON): ${this.constructor.name} -Document Path: ${this.path} -Document Name: ${this.name} -Document Integrity: sha256:${this.id} -Document Data (local JSON, <${confirmed.length}> bytes: ${confirmed} -Document Source: -\`\`\` -${confirmed} -\`\`\` - -## Source Code -### Free as in _freedom_. -Labs: https://github.com/FabricLabs - -To edit this message, visit this URL: https://github.com/FabricLabs/fabric/edit/master/types/state.js - -## Onboarding -When you're ready to continue, visit the following URL: https://dev.fabric.pub/WELCOME.html -`; - - return raw; - } - - /** - * Unmarshall an existing state to an instance of a {@link Blob}. - * @return {String} Serialized {@link Blob}. - */ - toString () { - return this.serialize(); - } - - overlay (data) { - let state = new State$9(data); - this['@parent'] = this['@id']; - this['@data'] = Object.assign({}, this['@data'], state['@data']); - this['@did'] = `did:fabric:${this.id}`; - this['@id'] = this.id; - return this; - } - - pack (data) { - if (!data) data = this['@data']; - return json(data); - } - - /** - * Convert to {@link Buffer}. - * @param {Mixed} [input] Input to serialize. - * @return {Buffer} {@link Store}-able blob. - */ - serialize (input = this.state, encoding = 'json') { - let result = null; - - if (typeof input === 'string') { - return Buffer.from(`${json(input)}`, 'utf8'); - } else if (input instanceof Array) { - result = Buffer.from(`${JSON.stringify(input)}`, 'utf8'); - } else if (input instanceof Buffer) { - result = input; - } else if (input['@type'] && input['@data']) { - return this.serialize(input['@data']); - } else { - switch (input.constructor.name) { - case 'Function': - result = Buffer.from(input.toString('utf8')); - break; - case 'Boolean': - result = Buffer.from(JSON.stringify(input)); - break; - case 'Buffer': - result = Buffer.from(JSON.stringify(input.toString('utf8'))); - break; - case 'Object': - result = Buffer.from(JSON.stringify(input)); - break; - default: - result = input.toString('utf8'); - break; - } - - // strip special fields - // TODO: order? - for (const name in input) { - if (name.charAt(0) === '@') { - continue; - } - } - } - - return JSON.parse(json(result)); - } - - /** - * Take a hex-encoded input and convert to a {@link State} object. - * @param {String} input [description] - * @return {State} [description] - */ - deserialize (input) { - let output = null; - - if (typeof input === 'string') { - // Let's create a state object... - try { - let state = new State$9(input); - // Assign our output to the state data - output = state['@data']; - } catch (E) { - this.error('Could not parse string as Buffer:', E); - } - - return output; - } else { - this.log('WARNING:', `input not a string`, input); - } - - if (!output) return null; - - switch (output['@type']) { - case 'String': - output = output['@buffer'].toString(output['@encoding']); - break; - } - - return output; - } - - flatten () { - let map = {}; - - for (let k in this['@data']) { - map[k] = this.serialize(this['@data'][k]); - } - - return map; - } - - /** - * Creates a new child {@link State}, with `@parent` set to - * the current {@link State} by immutable identifier. - * @returns {State} - */ - fork () { - let data = Object.assign({ - '@parent': this.id - }, this['@data']); - return new State$9(data); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path = '') { - // return pointer.get(this.state, path); - let result = null; - try { - result = pointer$5.get(this['@entity']['@data'], path); - } catch (exception) { - console.error('[FABRIC:STATE]', 'Could not retrieve path:', path, pointer$5.get(this['@entity']['@data'], '/'), exception); - } - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - // console.log('setting:', path, value); - pointer$5.set(this.value, path, value); - pointer$5.set(this['@entity']['@data'], path, value); - const result = pointer$5.set(this.value, path, value); - this.commit(); - return result; - } - - /** - * Increment the vector clock, broadcast all changes as a transaction. - */ - commit () { - ++this._clock; - - this['@parent'] = this.id; - this['@preimage'] = this.toString(); - this['@constructor'] = this.constructor; - - if (this.observer) { - this['@changes'] = monitor$5.generate(this.observer); - } - - this['@id'] = this.id; - - if (this['@changes'] && this['@changes'].length) { - this.emit('changes', this['@changes']); - this.emit('state', this['@state']); - this.emit('message', { - '@type': 'Transaction', - '@data': { - 'changes': this['@changes'], - 'state': this['@changes'] - } - }); - } - - return this; - } - - /** - * Compose a JSON string for network consumption. - * @return {String} JSON-encoded {@link String}. - */ - render () { - this['@id'] = this.id; - this['@encoding'] = 'json'; - this['@output'] = this.serialize(this['@entity']['@data'], 'json'); - this['@commit'] = this.commit(); - - return this['@output'].toString('utf8'); - } -} - -var state$2 = State$9; - -var dist$1 = {}; - -var bufferReverse = function reverse (src) { - var buffer = new Buffer(src.length); - - for (var i = 0, j = src.length - 1; i <= j; ++i, --j) { - buffer[i] = src[j]; - buffer[j] = src[i]; - } - - return buffer -}; - -var cryptoJs = {exports: {}}; - -var core = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(); - } -}(commonjsGlobal, function () { - - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined$1) { - /* - * Local polyfil of Object.create - */ - var create = Object.create || (function () { - function F() {} - return function (obj) { - var subtype; - - F.prototype = obj; - - subtype = new F(); - - F.prototype = null; - - return subtype; - }; - }()); - - /** - * CryptoJS namespace. - */ - var C = {}; - - /** - * Library namespace. - */ - var C_lib = C.lib = {}; - - /** - * Base object for prototypal inheritance. - */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); - - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } - - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; - - // Reference supertype - subtype.$super = this; - - return subtype; - }, - - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); - - return instance; - }, - - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, - - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } - } - - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; - } - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); - } - }; - }()); - - /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined$1) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } - }, - - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, - - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; - - // Clamp excess bits - this.clamp(); - - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var i = 0; i < thatSigBytes; i += 4) { - thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - var r = (function (m_w) { - var m_w = m_w; - var m_z = 0x3ade68b1; - var mask = 0xffffffff; - - return function () { - m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; - m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; - var result = ((m_z << 0x10) + m_w) & mask; - result /= 0x100000000; - result += 0.5; - return result * (Math.random() > .5 ? 1 : -1); - } - }); - - for (var i = 0, rcache; i < nBytes; i += 4) { - var _r = r((rcache || Math.random()) * 0x100000000); - - rcache = _r() * 0x3ade67b7; - words.push((_r() * 0x100000000) | 0); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - var processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512/32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - return CryptoJS; - -})); -}(core)); - -var x64Core = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; - - /** - * x64 namespace. - */ - var C_x64 = C.x64 = {}; - - /** - * A 64-bit word. - */ - C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } - - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, - - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, - - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; - - // return X64Word.create(high, low); - // } - }); - - /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - C_x64.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined$1) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; - } - }, - - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { - // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, - - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - - // Clone "words" array - var words = clone.words = this.words.slice(0); - - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); - } - - return clone; - } - }); - }()); - - - return CryptoJS; - -})); -}(x64Core)); - -var libTypedarrays = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Check if typed arrays are supported - if (typeof ArrayBuffer != 'function') { - return; - } - - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - - // Reference original init - var superInit = WordArray.init; - - // Augment WordArray.init to handle typed arrays - var subInit = WordArray.init = function (typedArray) { - // Convert buffers to uint8 - if (typedArray instanceof ArrayBuffer) { - typedArray = new Uint8Array(typedArray); - } - - // Convert other array views to uint8 - if ( - typedArray instanceof Int8Array || - (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || - typedArray instanceof Int16Array || - typedArray instanceof Uint16Array || - typedArray instanceof Int32Array || - typedArray instanceof Uint32Array || - typedArray instanceof Float32Array || - typedArray instanceof Float64Array - ) { - typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); - } - - // Handle Uint8Array - if (typedArray instanceof Uint8Array) { - // Shortcut - var typedArrayByteLength = typedArray.byteLength; - - // Extract bytes - var words = []; - for (var i = 0; i < typedArrayByteLength; i++) { - words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); - } - - // Initialize this word array - superInit.call(this, words, typedArrayByteLength); - } else { - // Else call normal init - superInit.apply(this, arguments); - } - }; - - subInit.prototype = WordArray; - }()); - - - return CryptoJS.lib.WordArray; - -})); -}(libTypedarrays)); - -var encUtf16 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * UTF-16 BE encoding strategy. - */ - C_enc.Utf16 = C_enc.Utf16BE = { - /** - * Converts a word array to a UTF-16 BE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 BE string. - * - * @static - * - * @example - * - * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 BE string to a word array. - * - * @param {string} utf16Str The UTF-16 BE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - /** - * UTF-16 LE encoding strategy. - */ - C_enc.Utf16LE = { - /** - * Converts a word array to a UTF-16 LE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 LE string. - * - * @static - * - * @example - * - * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 LE string to a word array. - * - * @param {string} utf16Str The UTF-16 LE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - function swapEndian(word) { - return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); - } - }()); - - - return CryptoJS.enc.Utf16; - -})); -}(encUtf16)); - -var encBase64 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64 encoding strategy. - */ - C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); - */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); - - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; - - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); - - - return CryptoJS.enc.Base64; - -})); -}(encBase64)); - -var md5 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); - - /** - * MD5 hash algorithm. - */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working varialbes - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); - - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); - - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); - - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); - - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; - - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); - */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); - - - return CryptoJS.MD5; - -})); -}(md5)); - -var sha1$4 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Reusable object - var W = []; - - /** - * SHA-1 hash algorithm. - */ - var SHA1 = C_algo.SHA1 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476, - 0xc3d2e1f0 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - // Computation - for (var i = 0; i < 80; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = (n << 1) | (n >>> 31); - } - - var t = ((a << 5) | (a >>> 27)) + e + W[i]; - if (i < 20) { - t += ((b & c) | (~b & d)) + 0x5a827999; - } else if (i < 40) { - t += (b ^ c ^ d) + 0x6ed9eba1; - } else if (i < 60) { - t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; - } else /* if (i < 80) */ { - t += (b ^ c ^ d) - 0x359d3e2a; - } - - e = d; - d = c; - c = (b << 30) | (b >>> 2); - b = a; - a = t; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA1('message'); - * var hash = CryptoJS.SHA1(wordArray); - */ - C.SHA1 = Hasher._createHelper(SHA1); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA1(message, key); - */ - C.HmacSHA1 = Hasher._createHmacHelper(SHA1); - }()); - - - return CryptoJS.SHA1; - -})); -}(sha1$4)); - -var sha256$b = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Initialization and round constants tables - var H = []; - var K = []; - - // Compute constants - (function () { - function isPrime(n) { - var sqrtN = Math.sqrt(n); - for (var factor = 2; factor <= sqrtN; factor++) { - if (!(n % factor)) { - return false; - } - } - - return true; - } - - function getFractionalBits(n) { - return ((n - (n | 0)) * 0x100000000) | 0; - } - - var n = 2; - var nPrime = 0; - while (nPrime < 64) { - if (isPrime(n)) { - if (nPrime < 8) { - H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); - } - K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); - - nPrime++; - } - - n++; - } - }()); - - // Reusable object - var W = []; - - /** - * SHA-256 hash algorithm. - */ - var SHA256 = C_algo.SHA256 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init(H.slice(0)); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - var f = H[5]; - var g = H[6]; - var h = H[7]; - - // Computation - for (var i = 0; i < 64; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var gamma0x = W[i - 15]; - var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ - ((gamma0x << 14) | (gamma0x >>> 18)) ^ - (gamma0x >>> 3); - - var gamma1x = W[i - 2]; - var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ - ((gamma1x << 13) | (gamma1x >>> 19)) ^ - (gamma1x >>> 10); - - W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; - } - - var ch = (e & f) ^ (~e & g); - var maj = (a & b) ^ (a & c) ^ (b & c); - - var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); - var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); - - var t1 = h + sigma1 + ch + K[i] + W[i]; - var t2 = sigma0 + maj; - - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - H[5] = (H[5] + f) | 0; - H[6] = (H[6] + g) | 0; - H[7] = (H[7] + h) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA256('message'); - * var hash = CryptoJS.SHA256(wordArray); - */ - C.SHA256 = Hasher._createHelper(SHA256); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA256(message, key); - */ - C.HmacSHA256 = Hasher._createHmacHelper(SHA256); - }(Math)); - - - return CryptoJS.SHA256; - -})); -}(sha256$b)); - -var sha224 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha256$b.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA256 = C_algo.SHA256; - - /** - * SHA-224 hash algorithm. - */ - var SHA224 = C_algo.SHA224 = SHA256.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - ]); - }, - - _doFinalize: function () { - var hash = SHA256._doFinalize.call(this); - - hash.sigBytes -= 4; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA224('message'); - * var hash = CryptoJS.SHA224(wordArray); - */ - C.SHA224 = SHA256._createHelper(SHA224); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA224(message, key); - */ - C.HmacSHA224 = SHA256._createHmacHelper(SHA224); - }()); - - - return CryptoJS.SHA224; - -})); -}(sha224)); - -var sha512$6 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - - function X64Word_create() { - return X64Word.create.apply(X64Word, arguments); - } - - // Constants - var K = [ - X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), - X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), - X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), - X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), - X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), - X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), - X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), - X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), - X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), - X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), - X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), - X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), - X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), - X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), - X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), - X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), - X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), - X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), - X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), - X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), - X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), - X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), - X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), - X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), - X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), - X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), - X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), - X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), - X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), - X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), - X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), - X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), - X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), - X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), - X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), - X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), - X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), - X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), - X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), - X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) - ]; - - // Reusable objects - var W = []; - (function () { - for (var i = 0; i < 80; i++) { - W[i] = X64Word_create(); - } - }()); - - /** - * SHA-512 hash algorithm. - */ - var SHA512 = C_algo.SHA512 = Hasher.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), - new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), - new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), - new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var H = this._hash.words; - - var H0 = H[0]; - var H1 = H[1]; - var H2 = H[2]; - var H3 = H[3]; - var H4 = H[4]; - var H5 = H[5]; - var H6 = H[6]; - var H7 = H[7]; - - var H0h = H0.high; - var H0l = H0.low; - var H1h = H1.high; - var H1l = H1.low; - var H2h = H2.high; - var H2l = H2.low; - var H3h = H3.high; - var H3l = H3.low; - var H4h = H4.high; - var H4l = H4.low; - var H5h = H5.high; - var H5l = H5.low; - var H6h = H6.high; - var H6l = H6.low; - var H7h = H7.high; - var H7l = H7.low; - - // Working variables - var ah = H0h; - var al = H0l; - var bh = H1h; - var bl = H1l; - var ch = H2h; - var cl = H2l; - var dh = H3h; - var dl = H3l; - var eh = H4h; - var el = H4l; - var fh = H5h; - var fl = H5l; - var gh = H6h; - var gl = H6l; - var hh = H7h; - var hl = H7l; - - // Rounds - for (var i = 0; i < 80; i++) { - // Shortcut - var Wi = W[i]; - - // Extend message - if (i < 16) { - var Wih = Wi.high = M[offset + i * 2] | 0; - var Wil = Wi.low = M[offset + i * 2 + 1] | 0; - } else { - // Gamma0 - var gamma0x = W[i - 15]; - var gamma0xh = gamma0x.high; - var gamma0xl = gamma0x.low; - var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); - var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); - - // Gamma1 - var gamma1x = W[i - 2]; - var gamma1xh = gamma1x.high; - var gamma1xl = gamma1x.low; - var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); - var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); - - // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] - var Wi7 = W[i - 7]; - var Wi7h = Wi7.high; - var Wi7l = Wi7.low; - - var Wi16 = W[i - 16]; - var Wi16h = Wi16.high; - var Wi16l = Wi16.low; - - var Wil = gamma0l + Wi7l; - var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); - var Wil = Wil + gamma1l; - var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); - var Wil = Wil + Wi16l; - var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); - - Wi.high = Wih; - Wi.low = Wil; - } - - var chh = (eh & fh) ^ (~eh & gh); - var chl = (el & fl) ^ (~el & gl); - var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); - var majl = (al & bl) ^ (al & cl) ^ (bl & cl); - - var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); - var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); - var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); - var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); - - // t1 = h + sigma1 + ch + K[i] + W[i] - var Ki = K[i]; - var Kih = Ki.high; - var Kil = Ki.low; - - var t1l = hl + sigma1l; - var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); - var t1l = t1l + chl; - var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); - var t1l = t1l + Kil; - var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); - var t1l = t1l + Wil; - var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - - // t2 = sigma0 + maj - var t2l = sigma0l + majl; - var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); - - // Update working variables - hh = gh; - hl = gl; - gh = fh; - gl = fl; - fh = eh; - fl = el; - el = (dl + t1l) | 0; - eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; - dh = ch; - dl = cl; - ch = bh; - cl = bl; - bh = ah; - bl = al; - al = (t1l + t2l) | 0; - ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; - } - - // Intermediate hash value - H0l = H0.low = (H0l + al); - H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); - H1l = H1.low = (H1l + bl); - H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); - H2l = H2.low = (H2l + cl); - H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); - H3l = H3.low = (H3l + dl); - H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); - H4l = H4.low = (H4l + el); - H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); - H5l = H5.low = (H5l + fl); - H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); - H6l = H6.low = (H6l + gl); - H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); - H7l = H7.low = (H7l + hl); - H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Convert hash to 32-bit word array before returning - var hash = this._hash.toX32(); - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - }, - - blockSize: 1024/32 - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA512('message'); - * var hash = CryptoJS.SHA512(wordArray); - */ - C.SHA512 = Hasher._createHelper(SHA512); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA512(message, key); - */ - C.HmacSHA512 = Hasher._createHmacHelper(SHA512); - }()); - - - return CryptoJS.SHA512; - -})); -}(sha512$6)); - -var sha384 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports, sha512$6.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - var SHA512 = C_algo.SHA512; - - /** - * SHA-384 hash algorithm. - */ - var SHA384 = C_algo.SHA384 = SHA512.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), - new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), - new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), - new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) - ]); - }, - - _doFinalize: function () { - var hash = SHA512._doFinalize.call(this); - - hash.sigBytes -= 16; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA384('message'); - * var hash = CryptoJS.SHA384(wordArray); - */ - C.SHA384 = SHA512._createHelper(SHA384); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA384(message, key); - */ - C.HmacSHA384 = SHA512._createHmacHelper(SHA384); - }()); - - - return CryptoJS.SHA384; - -})); -}(sha384)); - -var sha3 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; - - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; - - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } - - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; - } - } - - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } - - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } - } - - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); - - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); - } - }()); - - /** - * SHA-3 hash algorithm. - */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ - /** - * Configuration options. - * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 - */ - cfg: Hasher.cfg.extend({ - outputLength: 512 - }), - - _doReset: function () { - var state = this._state = []; - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; - - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; - - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); - - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } - - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } - - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; - - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } - - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; - - // Rotate lanes - if (rhoOffset < 32) { - var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } - - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } - - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; - - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } - - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low; } - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; - - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; - - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); - - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } - - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, - - clone: function () { - var clone = Hasher.clone.call(this); - - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); - - - return CryptoJS.SHA3; - -})); -}(sha3)); - -var ripemd160$4 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var _zl = WordArray.create([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); - var _zr = WordArray.create([ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); - var _sl = WordArray.create([ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); - var _sr = WordArray.create([ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); - - var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); - var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); - - /** - * RIPEMD160 hash algorithm. - */ - var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ - _doReset: function () { - this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); - }, - - _doProcessBlock: function (M, offset) { - - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - // Swap - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - // Shortcut - var H = this._hash.words; - var hl = _hl.words; - var hr = _hr.words; - var zl = _zl.words; - var zr = _zr.words; - var sl = _sl.words; - var sr = _sr.words; - - // Working variables - var al, bl, cl, dl, el; - var ar, br, cr, dr, er; - - ar = al = H[0]; - br = bl = H[1]; - cr = cl = H[2]; - dr = dl = H[3]; - er = el = H[4]; - // Computation - var t; - for (var i = 0; i < 80; i += 1) { - t = (al + M[offset+zl[i]])|0; - if (i<16){ - t += f1(bl,cl,dl) + hl[0]; - } else if (i<32) { - t += f2(bl,cl,dl) + hl[1]; - } else if (i<48) { - t += f3(bl,cl,dl) + hl[2]; - } else if (i<64) { - t += f4(bl,cl,dl) + hl[3]; - } else {// if (i<80) { - t += f5(bl,cl,dl) + hl[4]; - } - t = t|0; - t = rotl(t,sl[i]); - t = (t+el)|0; - al = el; - el = dl; - dl = rotl(cl, 10); - cl = bl; - bl = t; - - t = (ar + M[offset+zr[i]])|0; - if (i<16){ - t += f5(br,cr,dr) + hr[0]; - } else if (i<32) { - t += f4(br,cr,dr) + hr[1]; - } else if (i<48) { - t += f3(br,cr,dr) + hr[2]; - } else if (i<64) { - t += f2(br,cr,dr) + hr[3]; - } else {// if (i<80) { - t += f1(br,cr,dr) + hr[4]; - } - t = t|0; - t = rotl(t,sr[i]) ; - t = (t+er)|0; - ar = er; - er = dr; - dr = rotl(cr, 10); - cr = br; - br = t; - } - // Intermediate hash value - t = (H[1] + cl + dr)|0; - H[1] = (H[2] + dl + er)|0; - H[2] = (H[3] + el + ar)|0; - H[3] = (H[4] + al + br)|0; - H[4] = (H[0] + bl + cr)|0; - H[0] = t; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | - (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) - ); - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 5; i++) { - // Shortcut - var H_i = H[i]; - - // Swap - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - - function f1(x, y, z) { - return ((x) ^ (y) ^ (z)); - - } - - function f2(x, y, z) { - return (((x)&(y)) | ((~x)&(z))); - } - - function f3(x, y, z) { - return (((x) | (~(y))) ^ (z)); - } - - function f4(x, y, z) { - return (((x) & (z)) | ((y)&(~(z)))); - } - - function f5(x, y, z) { - return ((x) ^ ((y) |(~(z)))); - - } - - function rotl(x,n) { - return (x<>>(32-n)); - } - - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.RIPEMD160('message'); - * var hash = CryptoJS.RIPEMD160(wordArray); - */ - C.RIPEMD160 = Hasher._createHelper(RIPEMD160); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacRIPEMD160(message, key); - */ - C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); - }()); - - - return CryptoJS.RIPEMD160; - -})); -}(ripemd160$4)); - -var hmac$2 = {exports: {}}; - -(function (module, exports) { -(function (root, factory) { - { - // CommonJS - module.exports = factory(core.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var C_algo = C.algo; - - /** - * HMAC algorithm. - */ - C_algo.HMAC = Base.extend({ - /** - * Initializes a newly created HMAC. - * - * @param {Hasher} hasher The hash algorithm to use. - * @param {WordArray|string} key The secret key. - * - * @example - * - * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); - */ - init: function (hasher, key) { - // Init hasher - hasher = this._hasher = new hasher.init(); - - // Convert string to WordArray, else assume WordArray already - if (typeof key == 'string') { - key = Utf8.parse(key); - } - - // Shortcuts - var hasherBlockSize = hasher.blockSize; - var hasherBlockSizeBytes = hasherBlockSize * 4; - - // Allow arbitrary length keys - if (key.sigBytes > hasherBlockSizeBytes) { - key = hasher.finalize(key); - } - - // Clamp excess bits - key.clamp(); - - // Clone key for inner and outer pads - var oKey = this._oKey = key.clone(); - var iKey = this._iKey = key.clone(); - - // Shortcuts - var oKeyWords = oKey.words; - var iKeyWords = iKey.words; - - // XOR keys with pad constants - for (var i = 0; i < hasherBlockSize; i++) { - oKeyWords[i] ^= 0x5c5c5c5c; - iKeyWords[i] ^= 0x36363636; - } - oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; - - // Set initial values - this.reset(); - }, - - /** - * Resets this HMAC to its initial state. - * - * @example - * - * hmacHasher.reset(); - */ - reset: function () { - // Shortcut - var hasher = this._hasher; - - // Reset - hasher.reset(); - hasher.update(this._iKey); - }, - - /** - * Updates this HMAC with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {HMAC} This HMAC instance. - * - * @example - * - * hmacHasher.update('message'); - * hmacHasher.update(wordArray); - */ - update: function (messageUpdate) { - this._hasher.update(messageUpdate); - - // Chainable - return this; - }, - - /** - * Finalizes the HMAC computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The HMAC. - * - * @example - * - * var hmac = hmacHasher.finalize(); - * var hmac = hmacHasher.finalize('message'); - * var hmac = hmacHasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Shortcut - var hasher = this._hasher; - - // Compute HMAC - var innerHash = hasher.finalize(messageUpdate); - hasher.reset(); - var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); - - return hmac; - } - }); - }()); - - -})); -}(hmac$2)); - -var pbkdf2$8 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha1$4.exports, hmac$2.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; - - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: SHA1, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); - - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); - - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; - - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); - - // Shortcut - var intermediateWords = intermediate.words; - - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } - - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); - - - return CryptoJS.PBKDF2; - -})); -}(pbkdf2$8)); - -var evpkdf = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, sha1$4.exports, hmac$2.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var MD5 = C_algo.MD5; - - /** - * This key derivation function is meant to conform with EVP_BytesToKey. - * www.openssl.org/docs/crypto/EVP_BytesToKey.html - */ - var EvpKDF = C_algo.EvpKDF = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hash algorithm to use. Default: MD5 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: MD5, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.EvpKDF.create(); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init hasher - var hasher = cfg.hasher.create(); - - // Initial values - var derivedKey = WordArray.create(); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - if (block) { - hasher.update(block); - } - var block = hasher.update(password).finalize(salt); - hasher.reset(); - - // Iterations - for (var i = 1; i < iterations; i++) { - block = hasher.finalize(block); - hasher.reset(); - } - - derivedKey.concat(block); - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.EvpKDF(password, salt); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.EvpKDF = function (password, salt, cfg) { - return EvpKDF.create(cfg).compute(password, salt); - }; - }()); - - - return CryptoJS.EvpKDF; - -})); -}(evpkdf)); - -var cipherCore = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, evpkdf.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Cipher core components. - */ - CryptoJS.lib.Cipher || (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; - var C_enc = C.enc; - C_enc.Utf8; - var Base64 = C_enc.Base64; - var C_algo = C.algo; - var EvpKDF = C_algo.EvpKDF; - - /** - * Abstract base cipher template. - * - * @property {number} keySize This cipher's key size. Default: 4 (128 bits) - * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) - * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. - * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. - */ - var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - * - * @property {WordArray} iv The IV to use for this operation. - */ - cfg: Base.extend(), - - /** - * Creates this cipher in encryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); - */ - createEncryptor: function (key, cfg) { - return this.create(this._ENC_XFORM_MODE, key, cfg); - }, - - /** - * Creates this cipher in decryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); - */ - createDecryptor: function (key, cfg) { - return this.create(this._DEC_XFORM_MODE, key, cfg); - }, - - /** - * Initializes a newly created cipher. - * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @example - * - * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); - */ - init: function (xformMode, key, cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Store transform mode and key - this._xformMode = xformMode; - this._key = key; - - // Set initial values - this.reset(); - }, - - /** - * Resets this cipher to its initial state. - * - * @example - * - * cipher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-cipher logic - this._doReset(); - }, - - /** - * Adds data to be encrypted or decrypted. - * - * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. - * - * @return {WordArray} The data after processing. - * - * @example - * - * var encrypted = cipher.process('data'); - * var encrypted = cipher.process(wordArray); - */ - process: function (dataUpdate) { - // Append - this._append(dataUpdate); - - // Process available blocks - return this._process(); - }, - - /** - * Finalizes the encryption or decryption process. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. - * - * @return {WordArray} The data after final processing. - * - * @example - * - * var encrypted = cipher.finalize(); - * var encrypted = cipher.finalize('data'); - * var encrypted = cipher.finalize(wordArray); - */ - finalize: function (dataUpdate) { - // Final data update - if (dataUpdate) { - this._append(dataUpdate); - } - - // Perform concrete-cipher logic - var finalProcessedData = this._doFinalize(); - - return finalProcessedData; - }, - - keySize: 128/32, - - ivSize: 128/32, - - _ENC_XFORM_MODE: 1, - - _DEC_XFORM_MODE: 2, - - /** - * Creates shortcut functions to a cipher's object interface. - * - * @param {Cipher} cipher The cipher to create a helper for. - * - * @return {Object} An object with encrypt and decrypt shortcut functions. - * - * @static - * - * @example - * - * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); - */ - _createHelper: (function () { - function selectCipherStrategy(key) { - if (typeof key == 'string') { - return PasswordBasedCipher; - } else { - return SerializableCipher; - } - } - - return function (cipher) { - return { - encrypt: function (message, key, cfg) { - return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); - }, - - decrypt: function (ciphertext, key, cfg) { - return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); - } - }; - }; - }()) - }); - - /** - * Abstract base stream cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) - */ - C_lib.StreamCipher = Cipher.extend({ - _doFinalize: function () { - // Process partial blocks - var finalProcessedBlocks = this._process(!!'flush'); - - return finalProcessedBlocks; - }, - - blockSize: 1 - }); - - /** - * Mode namespace. - */ - var C_mode = C.mode = {}; - - /** - * Abstract base block cipher mode template. - */ - var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ - /** - * Creates this mode for encryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); - */ - createEncryptor: function (cipher, iv) { - return this.Encryptor.create(cipher, iv); - }, - - /** - * Creates this mode for decryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); - */ - createDecryptor: function (cipher, iv) { - return this.Decryptor.create(cipher, iv); - }, - - /** - * Initializes a newly created mode. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @example - * - * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); - */ - init: function (cipher, iv) { - this._cipher = cipher; - this._iv = iv; - } - }); - - /** - * Cipher Block Chaining mode. - */ - var CBC = C_mode.CBC = (function () { - /** - * Abstract base CBC mode. - */ - var CBC = BlockCipherMode.extend(); - - /** - * CBC encryptor. - */ - CBC.Encryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // XOR and encrypt - xorBlock.call(this, words, offset, blockSize); - cipher.encryptBlock(words, offset); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - /** - * CBC decryptor. - */ - CBC.Decryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - // Decrypt and XOR - cipher.decryptBlock(words, offset); - xorBlock.call(this, words, offset, blockSize); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function xorBlock(words, offset, blockSize) { - // Shortcut - var iv = this._iv; - - // Choose mixing block - if (iv) { - var block = iv; - - // Remove IV for subsequent blocks - this._iv = undefined$1; - } else { - var block = this._prevBlock; - } - - // XOR blocks - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= block[i]; - } - } - - return CBC; - }()); - - /** - * Padding namespace. - */ - var C_pad = C.pad = {}; - - /** - * PKCS #5/7 padding strategy. - */ - var Pkcs7 = C_pad.Pkcs7 = { - /** - * Pads data using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to pad. - * @param {number} blockSize The multiple that the data should be padded to. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.pad(wordArray, 4); - */ - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Create padding word - var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; - - // Create padding - var paddingWords = []; - for (var i = 0; i < nPaddingBytes; i += 4) { - paddingWords.push(paddingWord); - } - var padding = WordArray.create(paddingWords, nPaddingBytes); - - // Add padding - data.concat(padding); - }, - - /** - * Unpads data that had been padded using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to unpad. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.unpad(wordArray); - */ - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - /** - * Abstract base block cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) - */ - C_lib.BlockCipher = Cipher.extend({ - /** - * Configuration options. - * - * @property {Mode} mode The block mode to use. Default: CBC - * @property {Padding} padding The padding strategy to use. Default: Pkcs7 - */ - cfg: Cipher.cfg.extend({ - mode: CBC, - padding: Pkcs7 - }), - - reset: function () { - // Reset cipher - Cipher.reset.call(this); - - // Shortcuts - var cfg = this.cfg; - var iv = cfg.iv; - var mode = cfg.mode; - - // Reset block mode - if (this._xformMode == this._ENC_XFORM_MODE) { - var modeCreator = mode.createEncryptor; - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - var modeCreator = mode.createDecryptor; - // Keep at least one block in the buffer for unpadding - this._minBufferSize = 1; - } - - if (this._mode && this._mode.__creator == modeCreator) { - this._mode.init(this, iv && iv.words); - } else { - this._mode = modeCreator.call(mode, this, iv && iv.words); - this._mode.__creator = modeCreator; - } - }, - - _doProcessBlock: function (words, offset) { - this._mode.processBlock(words, offset); - }, - - _doFinalize: function () { - // Shortcut - var padding = this.cfg.padding; - - // Finalize - if (this._xformMode == this._ENC_XFORM_MODE) { - // Pad data - padding.pad(this._data, this.blockSize); - - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - - // Unpad data - padding.unpad(finalProcessedBlocks); - } - - return finalProcessedBlocks; - }, - - blockSize: 128/32 - }); - - /** - * A collection of cipher parameters. - * - * @property {WordArray} ciphertext The raw ciphertext. - * @property {WordArray} key The key to this ciphertext. - * @property {WordArray} iv The IV used in the ciphering operation. - * @property {WordArray} salt The salt used with a key derivation function. - * @property {Cipher} algorithm The cipher algorithm. - * @property {Mode} mode The block mode used in the ciphering operation. - * @property {Padding} padding The padding scheme used in the ciphering operation. - * @property {number} blockSize The block size of the cipher. - * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. - */ - var CipherParams = C_lib.CipherParams = Base.extend({ - /** - * Initializes a newly created cipher params object. - * - * @param {Object} cipherParams An object with any of the possible cipher parameters. - * - * @example - * - * var cipherParams = CryptoJS.lib.CipherParams.create({ - * ciphertext: ciphertextWordArray, - * key: keyWordArray, - * iv: ivWordArray, - * salt: saltWordArray, - * algorithm: CryptoJS.algo.AES, - * mode: CryptoJS.mode.CBC, - * padding: CryptoJS.pad.PKCS7, - * blockSize: 4, - * formatter: CryptoJS.format.OpenSSL - * }); - */ - init: function (cipherParams) { - this.mixIn(cipherParams); - }, - - /** - * Converts this cipher params object to a string. - * - * @param {Format} formatter (Optional) The formatting strategy to use. - * - * @return {string} The stringified cipher params. - * - * @throws Error If neither the formatter nor the default formatter is set. - * - * @example - * - * var string = cipherParams + ''; - * var string = cipherParams.toString(); - * var string = cipherParams.toString(CryptoJS.format.OpenSSL); - */ - toString: function (formatter) { - return (formatter || this.formatter).stringify(this); - } - }); - - /** - * Format namespace. - */ - var C_format = C.format = {}; - - /** - * OpenSSL formatting strategy. - */ - var OpenSSLFormatter = C_format.OpenSSL = { - /** - * Converts a cipher params object to an OpenSSL-compatible string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The OpenSSL-compatible string. - * - * @static - * - * @example - * - * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); - */ - stringify: function (cipherParams) { - // Shortcuts - var ciphertext = cipherParams.ciphertext; - var salt = cipherParams.salt; - - // Format - if (salt) { - var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); - } else { - var wordArray = ciphertext; - } - - return wordArray.toString(Base64); - }, - - /** - * Converts an OpenSSL-compatible string to a cipher params object. - * - * @param {string} openSSLStr The OpenSSL-compatible string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); - */ - parse: function (openSSLStr) { - // Parse base64 - var ciphertext = Base64.parse(openSSLStr); - - // Shortcut - var ciphertextWords = ciphertext.words; - - // Test for salt - if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { - // Extract salt - var salt = WordArray.create(ciphertextWords.slice(2, 4)); - - // Remove salt from ciphertext - ciphertextWords.splice(0, 4); - ciphertext.sigBytes -= 16; - } - - return CipherParams.create({ ciphertext: ciphertext, salt: salt }); - } - }; - - /** - * A cipher wrapper that returns ciphertext as a serializable cipher params object. - */ - var SerializableCipher = C_lib.SerializableCipher = Base.extend({ - /** - * Configuration options. - * - * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL - */ - cfg: Base.extend({ - format: OpenSSLFormatter - }), - - /** - * Encrypts a message. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Encrypt - var encryptor = cipher.createEncryptor(key, cfg); - var ciphertext = encryptor.finalize(message); - - // Shortcut - var cipherCfg = encryptor.cfg; - - // Create and return serializable cipher params - return CipherParams.create({ - ciphertext: ciphertext, - key: key, - iv: cipherCfg.iv, - algorithm: cipher, - mode: cipherCfg.mode, - padding: cipherCfg.padding, - blockSize: cipher.blockSize, - formatter: cfg.format - }); - }, - - /** - * Decrypts serialized ciphertext. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Decrypt - var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - - return plaintext; - }, - - /** - * Converts serialized ciphertext to CipherParams, - * else assumed CipherParams already and returns ciphertext unchanged. - * - * @param {CipherParams|string} ciphertext The ciphertext. - * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. - * - * @return {CipherParams} The unserialized ciphertext. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); - */ - _parse: function (ciphertext, format) { - if (typeof ciphertext == 'string') { - return format.parse(ciphertext, this); - } else { - return ciphertext; - } - } - }); - - /** - * Key derivation function namespace. - */ - var C_kdf = C.kdf = {}; - - /** - * OpenSSL key derivation function. - */ - var OpenSSLKdf = C_kdf.OpenSSL = { - /** - * Derives a key and IV from a password. - * - * @param {string} password The password to derive from. - * @param {number} keySize The size in words of the key to generate. - * @param {number} ivSize The size in words of the IV to generate. - * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. - * - * @return {CipherParams} A cipher params object with the key, IV, and salt. - * - * @static - * - * @example - * - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); - */ - execute: function (password, keySize, ivSize, salt) { - // Generate random salt - if (!salt) { - salt = WordArray.random(64/8); - } - - // Derive key and IV - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - - // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; - - // Return params - return CipherParams.create({ key: key, iv: iv, salt: salt }); - } - }; - - /** - * A serializable cipher wrapper that derives the key from a password, - * and returns ciphertext as a serializable cipher params object. - */ - var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ - /** - * Configuration options. - * - * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL - */ - cfg: SerializableCipher.cfg.extend({ - kdf: OpenSSLKdf - }), - - /** - * Encrypts a message using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Encrypt - var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); - - // Mix in derived params - ciphertext.mixIn(derivedParams); - - return ciphertext; - }, - - /** - * Decrypts serialized ciphertext using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Decrypt - var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); - - return plaintext; - } - }); - }()); - - -})); -}(cipherCore)); - -var modeCfb = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Cipher Feedback block mode. - */ - CryptoJS.mode.CFB = (function () { - var CFB = CryptoJS.lib.BlockCipherMode.extend(); - - CFB.Encryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - CFB.Decryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { - // Shortcut - var iv = this._iv; - - // Generate keystream - if (iv) { - var keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var keystream = this._prevBlock; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - - return CFB; - }()); - - - return CryptoJS.mode.CFB; - -})); -}(modeCfb)); - -var modeCtr = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Counter block mode. - */ - CryptoJS.mode.CTR = (function () { - var CTR = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = CTR.Encryptor = CTR.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Increment counter - counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0; - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTR.Decryptor = Encryptor; - - return CTR; - }()); - - - return CryptoJS.mode.CTR; - -})); -}(modeCtr)); - -var modeCtrGladman = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - */ - CryptoJS.mode.CTRGladman = (function () { - var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - - function incWord(word) - { - if (((word >> 24) & 0xff) === 0xff) { //overflow - var b1 = (word >> 16)&0xff; - var b2 = (word >> 8)&0xff; - var b3 = word & 0xff; - - if (b1 === 0xff) // overflow b1 - { - b1 = 0; - if (b2 === 0xff) - { - b2 = 0; - if (b3 === 0xff) - { - b3 = 0; - } - else - { - ++b3; - } - } - else - { - ++b2; - } - } - else - { - ++b1; - } - - word = 0; - word += (b1 << 16); - word += (b2 << 8); - word += b3; - } - else - { - word += (0x01 << 24); - } - return word; - } - - function incCounter(counter) - { - if ((counter[0] = incWord(counter[0])) === 0) - { - // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 - counter[1] = incWord(counter[1]); - } - return counter; - } - - var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - - incCounter(counter); - - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTRGladman.Decryptor = Encryptor; - - return CTRGladman; - }()); - - - - - return CryptoJS.mode.CTRGladman; - -})); -}(modeCtrGladman)); - -var modeOfb = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Output Feedback block mode. - */ - CryptoJS.mode.OFB = (function () { - var OFB = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = OFB.Encryptor = OFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - var iv = this._iv; - var keystream = this._keystream; - - // Generate keystream - if (iv) { - keystream = this._keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - OFB.Decryptor = Encryptor; - - return OFB; - }()); - - - return CryptoJS.mode.OFB; - -})); -}(modeOfb)); - -var modeEcb = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Electronic Codebook block mode. - */ - CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); - - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); - - return ECB; - }()); - - - return CryptoJS.mode.ECB; - -})); -}(modeEcb)); - -var padAnsix923 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * ANSI X.923 padding strategy. - */ - CryptoJS.pad.AnsiX923 = { - pad: function (data, blockSize) { - // Shortcuts - var dataSigBytes = data.sigBytes; - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; - - // Compute last byte position - var lastBytePos = dataSigBytes + nPaddingBytes - 1; - - // Pad - data.clamp(); - data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); - data.sigBytes += nPaddingBytes; - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - return CryptoJS.pad.Ansix923; - -})); -}(padAnsix923)); - -var padIso10126 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * ISO 10126 padding strategy. - */ - CryptoJS.pad.Iso10126 = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Pad - data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). - concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - return CryptoJS.pad.Iso10126; - -})); -}(padIso10126)); - -var padIso97971 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * ISO/IEC 9797-1 Padding Method 2. - */ - CryptoJS.pad.Iso97971 = { - pad: function (data, blockSize) { - // Add 0x80 byte - data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); - - // Zero pad the rest - CryptoJS.pad.ZeroPadding.pad(data, blockSize); - }, - - unpad: function (data) { - // Remove zero padding - CryptoJS.pad.ZeroPadding.unpad(data); - - // Remove one more byte -- the 0x80 byte - data.sigBytes--; - } - }; - - - return CryptoJS.pad.Iso97971; - -})); -}(padIso97971)); - -var padZeropadding = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * Zero padding strategy. - */ - CryptoJS.pad.ZeroPadding = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Pad - data.clamp(); - data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); - }, - - unpad: function (data) { - // Shortcut - var dataWords = data.words; - - // Unpad - var i = data.sigBytes - 1; - while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { - i--; - } - data.sigBytes = i + 1; - } - }; - - - return CryptoJS.pad.ZeroPadding; - -})); -}(padZeropadding)); - -var padNopadding = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - /** - * A noop padding strategy. - */ - CryptoJS.pad.NoPadding = { - pad: function () { - }, - - unpad: function () { - } - }; - - - return CryptoJS.pad.NoPadding; - -})); -}(padNopadding)); - -var formatHex = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function (undefined$1) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var CipherParams = C_lib.CipherParams; - var C_enc = C.enc; - var Hex = C_enc.Hex; - var C_format = C.format; - - C_format.Hex = { - /** - * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The hexadecimally encoded string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.format.Hex.stringify(cipherParams); - */ - stringify: function (cipherParams) { - return cipherParams.ciphertext.toString(Hex); - }, - - /** - * Converts a hexadecimally encoded ciphertext string to a cipher params object. - * - * @param {string} input The hexadecimally encoded string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.Hex.parse(hexString); - */ - parse: function (input) { - var ciphertext = Hex.parse(input); - return CipherParams.create({ ciphertext: ciphertext }); - } - }; - }()); - - - return CryptoJS.format.Hex; - -})); -}(formatHex)); - -var aes$6 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Lookup tables - var SBOX = []; - var INV_SBOX = []; - var SUB_MIX_0 = []; - var SUB_MIX_1 = []; - var SUB_MIX_2 = []; - var SUB_MIX_3 = []; - var INV_SUB_MIX_0 = []; - var INV_SUB_MIX_1 = []; - var INV_SUB_MIX_2 = []; - var INV_SUB_MIX_3 = []; - - // Compute lookup tables - (function () { - // Compute double table - var d = []; - for (var i = 0; i < 256; i++) { - if (i < 128) { - d[i] = i << 1; - } else { - d[i] = (i << 1) ^ 0x11b; - } - } - - // Walk GF(2^8) - var x = 0; - var xi = 0; - for (var i = 0; i < 256; i++) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; - SBOX[x] = sx; - INV_SBOX[sx] = x; - - // Compute multiplication - var x2 = d[x]; - var x4 = d[x2]; - var x8 = d[x4]; - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100); - SUB_MIX_0[x] = (t << 24) | (t >>> 8); - SUB_MIX_1[x] = (t << 16) | (t >>> 16); - SUB_MIX_2[x] = (t << 8) | (t >>> 24); - SUB_MIX_3[x] = t; - - // Compute inv sub bytes, inv mix columns tables - var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); - INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); - INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); - INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); - INV_SUB_MIX_3[sx] = t; - - // Compute next counter - if (!x) { - x = xi = 1; - } else { - x = x2 ^ d[d[d[x8 ^ x2]]]; - xi ^= d[d[xi]]; - } - } - }()); - - // Precomputed Rcon lookup - var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; - - /** - * AES block cipher algorithm. - */ - var AES = C_algo.AES = BlockCipher.extend({ - _doReset: function () { - // Skip reset of nRounds has been set before and key did not change - if (this._nRounds && this._keyPriorReset === this._key) { - return; - } - - // Shortcuts - var key = this._keyPriorReset = this._key; - var keyWords = key.words; - var keySize = key.sigBytes / 4; - - // Compute number of rounds - var nRounds = this._nRounds = keySize + 6; - - // Compute number of key schedule rows - var ksRows = (nRounds + 1) * 4; - - // Compute key schedule - var keySchedule = this._keySchedule = []; - for (var ksRow = 0; ksRow < ksRows; ksRow++) { - if (ksRow < keySize) { - keySchedule[ksRow] = keyWords[ksRow]; - } else { - var t = keySchedule[ksRow - 1]; - - if (!(ksRow % keySize)) { - // Rot word - t = (t << 8) | (t >>> 24); - - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - - // Mix Rcon - t ^= RCON[(ksRow / keySize) | 0] << 24; - } else if (keySize > 6 && ksRow % keySize == 4) { - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - } - - keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; - } - } - - // Compute inv key schedule - var invKeySchedule = this._invKeySchedule = []; - for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { - var ksRow = ksRows - invKsRow; - - if (invKsRow % 4) { - var t = keySchedule[ksRow]; - } else { - var t = keySchedule[ksRow - 4]; - } - - if (invKsRow < 4 || ksRow <= 4) { - invKeySchedule[invKsRow] = t; - } else { - invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ - INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; - } - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); - }, - - decryptBlock: function (M, offset) { - // Swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - - this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); - - // Inv swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - }, - - _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { - // Shortcut - var nRounds = this._nRounds; - - // Get input, add round key - var s0 = M[offset] ^ keySchedule[0]; - var s1 = M[offset + 1] ^ keySchedule[1]; - var s2 = M[offset + 2] ^ keySchedule[2]; - var s3 = M[offset + 3] ^ keySchedule[3]; - - // Key schedule row counter - var ksRow = 4; - - // Rounds - for (var round = 1; round < nRounds; round++) { - // Shift rows, sub bytes, mix columns, add round key - var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; - var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; - var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; - var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; - - // Update state - s0 = t0; - s1 = t1; - s2 = t2; - s3 = t3; - } - - // Shift rows, sub bytes, add round key - var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; - var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; - var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; - var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; - - // Set output - M[offset] = t0; - M[offset + 1] = t1; - M[offset + 2] = t2; - M[offset + 3] = t3; - }, - - keySize: 256/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); - */ - C.AES = BlockCipher._createHelper(AES); - }()); - - - return CryptoJS.AES; - -})); -}(aes$6)); - -var tripledes = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Permuted Choice 1 constants - var PC1 = [ - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, 27, 19, 11, 3, - 60, 52, 44, 36, 63, 55, 47, 39, - 31, 23, 15, 7, 62, 54, 46, 38, - 30, 22, 14, 6, 61, 53, 45, 37, - 29, 21, 13, 5, 28, 20, 12, 4 - ]; - - // Permuted Choice 2 constants - var PC2 = [ - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 - ]; - - // Cumulative bit shift constants - var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; - - // SBOXes and round permutation constants - var SBOX_P = [ - { - 0x0: 0x808200, - 0x10000000: 0x8000, - 0x20000000: 0x808002, - 0x30000000: 0x2, - 0x40000000: 0x200, - 0x50000000: 0x808202, - 0x60000000: 0x800202, - 0x70000000: 0x800000, - 0x80000000: 0x202, - 0x90000000: 0x800200, - 0xa0000000: 0x8200, - 0xb0000000: 0x808000, - 0xc0000000: 0x8002, - 0xd0000000: 0x800002, - 0xe0000000: 0x0, - 0xf0000000: 0x8202, - 0x8000000: 0x0, - 0x18000000: 0x808202, - 0x28000000: 0x8202, - 0x38000000: 0x8000, - 0x48000000: 0x808200, - 0x58000000: 0x200, - 0x68000000: 0x808002, - 0x78000000: 0x2, - 0x88000000: 0x800200, - 0x98000000: 0x8200, - 0xa8000000: 0x808000, - 0xb8000000: 0x800202, - 0xc8000000: 0x800002, - 0xd8000000: 0x8002, - 0xe8000000: 0x202, - 0xf8000000: 0x800000, - 0x1: 0x8000, - 0x10000001: 0x2, - 0x20000001: 0x808200, - 0x30000001: 0x800000, - 0x40000001: 0x808002, - 0x50000001: 0x8200, - 0x60000001: 0x200, - 0x70000001: 0x800202, - 0x80000001: 0x808202, - 0x90000001: 0x808000, - 0xa0000001: 0x800002, - 0xb0000001: 0x8202, - 0xc0000001: 0x202, - 0xd0000001: 0x800200, - 0xe0000001: 0x8002, - 0xf0000001: 0x0, - 0x8000001: 0x808202, - 0x18000001: 0x808000, - 0x28000001: 0x800000, - 0x38000001: 0x200, - 0x48000001: 0x8000, - 0x58000001: 0x800002, - 0x68000001: 0x2, - 0x78000001: 0x8202, - 0x88000001: 0x8002, - 0x98000001: 0x800202, - 0xa8000001: 0x202, - 0xb8000001: 0x808200, - 0xc8000001: 0x800200, - 0xd8000001: 0x0, - 0xe8000001: 0x8200, - 0xf8000001: 0x808002 - }, - { - 0x0: 0x40084010, - 0x1000000: 0x4000, - 0x2000000: 0x80000, - 0x3000000: 0x40080010, - 0x4000000: 0x40000010, - 0x5000000: 0x40084000, - 0x6000000: 0x40004000, - 0x7000000: 0x10, - 0x8000000: 0x84000, - 0x9000000: 0x40004010, - 0xa000000: 0x40000000, - 0xb000000: 0x84010, - 0xc000000: 0x80010, - 0xd000000: 0x0, - 0xe000000: 0x4010, - 0xf000000: 0x40080000, - 0x800000: 0x40004000, - 0x1800000: 0x84010, - 0x2800000: 0x10, - 0x3800000: 0x40004010, - 0x4800000: 0x40084010, - 0x5800000: 0x40000000, - 0x6800000: 0x80000, - 0x7800000: 0x40080010, - 0x8800000: 0x80010, - 0x9800000: 0x0, - 0xa800000: 0x4000, - 0xb800000: 0x40080000, - 0xc800000: 0x40000010, - 0xd800000: 0x84000, - 0xe800000: 0x40084000, - 0xf800000: 0x4010, - 0x10000000: 0x0, - 0x11000000: 0x40080010, - 0x12000000: 0x40004010, - 0x13000000: 0x40084000, - 0x14000000: 0x40080000, - 0x15000000: 0x10, - 0x16000000: 0x84010, - 0x17000000: 0x4000, - 0x18000000: 0x4010, - 0x19000000: 0x80000, - 0x1a000000: 0x80010, - 0x1b000000: 0x40000010, - 0x1c000000: 0x84000, - 0x1d000000: 0x40004000, - 0x1e000000: 0x40000000, - 0x1f000000: 0x40084010, - 0x10800000: 0x84010, - 0x11800000: 0x80000, - 0x12800000: 0x40080000, - 0x13800000: 0x4000, - 0x14800000: 0x40004000, - 0x15800000: 0x40084010, - 0x16800000: 0x10, - 0x17800000: 0x40000000, - 0x18800000: 0x40084000, - 0x19800000: 0x40000010, - 0x1a800000: 0x40004010, - 0x1b800000: 0x80010, - 0x1c800000: 0x0, - 0x1d800000: 0x4010, - 0x1e800000: 0x40080010, - 0x1f800000: 0x84000 - }, - { - 0x0: 0x104, - 0x100000: 0x0, - 0x200000: 0x4000100, - 0x300000: 0x10104, - 0x400000: 0x10004, - 0x500000: 0x4000004, - 0x600000: 0x4010104, - 0x700000: 0x4010000, - 0x800000: 0x4000000, - 0x900000: 0x4010100, - 0xa00000: 0x10100, - 0xb00000: 0x4010004, - 0xc00000: 0x4000104, - 0xd00000: 0x10000, - 0xe00000: 0x4, - 0xf00000: 0x100, - 0x80000: 0x4010100, - 0x180000: 0x4010004, - 0x280000: 0x0, - 0x380000: 0x4000100, - 0x480000: 0x4000004, - 0x580000: 0x10000, - 0x680000: 0x10004, - 0x780000: 0x104, - 0x880000: 0x4, - 0x980000: 0x100, - 0xa80000: 0x4010000, - 0xb80000: 0x10104, - 0xc80000: 0x10100, - 0xd80000: 0x4000104, - 0xe80000: 0x4010104, - 0xf80000: 0x4000000, - 0x1000000: 0x4010100, - 0x1100000: 0x10004, - 0x1200000: 0x10000, - 0x1300000: 0x4000100, - 0x1400000: 0x100, - 0x1500000: 0x4010104, - 0x1600000: 0x4000004, - 0x1700000: 0x0, - 0x1800000: 0x4000104, - 0x1900000: 0x4000000, - 0x1a00000: 0x4, - 0x1b00000: 0x10100, - 0x1c00000: 0x4010000, - 0x1d00000: 0x104, - 0x1e00000: 0x10104, - 0x1f00000: 0x4010004, - 0x1080000: 0x4000000, - 0x1180000: 0x104, - 0x1280000: 0x4010100, - 0x1380000: 0x0, - 0x1480000: 0x10004, - 0x1580000: 0x4000100, - 0x1680000: 0x100, - 0x1780000: 0x4010004, - 0x1880000: 0x10000, - 0x1980000: 0x4010104, - 0x1a80000: 0x10104, - 0x1b80000: 0x4000004, - 0x1c80000: 0x4000104, - 0x1d80000: 0x4010000, - 0x1e80000: 0x4, - 0x1f80000: 0x10100 - }, - { - 0x0: 0x80401000, - 0x10000: 0x80001040, - 0x20000: 0x401040, - 0x30000: 0x80400000, - 0x40000: 0x0, - 0x50000: 0x401000, - 0x60000: 0x80000040, - 0x70000: 0x400040, - 0x80000: 0x80000000, - 0x90000: 0x400000, - 0xa0000: 0x40, - 0xb0000: 0x80001000, - 0xc0000: 0x80400040, - 0xd0000: 0x1040, - 0xe0000: 0x1000, - 0xf0000: 0x80401040, - 0x8000: 0x80001040, - 0x18000: 0x40, - 0x28000: 0x80400040, - 0x38000: 0x80001000, - 0x48000: 0x401000, - 0x58000: 0x80401040, - 0x68000: 0x0, - 0x78000: 0x80400000, - 0x88000: 0x1000, - 0x98000: 0x80401000, - 0xa8000: 0x400000, - 0xb8000: 0x1040, - 0xc8000: 0x80000000, - 0xd8000: 0x400040, - 0xe8000: 0x401040, - 0xf8000: 0x80000040, - 0x100000: 0x400040, - 0x110000: 0x401000, - 0x120000: 0x80000040, - 0x130000: 0x0, - 0x140000: 0x1040, - 0x150000: 0x80400040, - 0x160000: 0x80401000, - 0x170000: 0x80001040, - 0x180000: 0x80401040, - 0x190000: 0x80000000, - 0x1a0000: 0x80400000, - 0x1b0000: 0x401040, - 0x1c0000: 0x80001000, - 0x1d0000: 0x400000, - 0x1e0000: 0x40, - 0x1f0000: 0x1000, - 0x108000: 0x80400000, - 0x118000: 0x80401040, - 0x128000: 0x0, - 0x138000: 0x401000, - 0x148000: 0x400040, - 0x158000: 0x80000000, - 0x168000: 0x80001040, - 0x178000: 0x40, - 0x188000: 0x80000040, - 0x198000: 0x1000, - 0x1a8000: 0x80001000, - 0x1b8000: 0x80400040, - 0x1c8000: 0x1040, - 0x1d8000: 0x80401000, - 0x1e8000: 0x400000, - 0x1f8000: 0x401040 - }, - { - 0x0: 0x80, - 0x1000: 0x1040000, - 0x2000: 0x40000, - 0x3000: 0x20000000, - 0x4000: 0x20040080, - 0x5000: 0x1000080, - 0x6000: 0x21000080, - 0x7000: 0x40080, - 0x8000: 0x1000000, - 0x9000: 0x20040000, - 0xa000: 0x20000080, - 0xb000: 0x21040080, - 0xc000: 0x21040000, - 0xd000: 0x0, - 0xe000: 0x1040080, - 0xf000: 0x21000000, - 0x800: 0x1040080, - 0x1800: 0x21000080, - 0x2800: 0x80, - 0x3800: 0x1040000, - 0x4800: 0x40000, - 0x5800: 0x20040080, - 0x6800: 0x21040000, - 0x7800: 0x20000000, - 0x8800: 0x20040000, - 0x9800: 0x0, - 0xa800: 0x21040080, - 0xb800: 0x1000080, - 0xc800: 0x20000080, - 0xd800: 0x21000000, - 0xe800: 0x1000000, - 0xf800: 0x40080, - 0x10000: 0x40000, - 0x11000: 0x80, - 0x12000: 0x20000000, - 0x13000: 0x21000080, - 0x14000: 0x1000080, - 0x15000: 0x21040000, - 0x16000: 0x20040080, - 0x17000: 0x1000000, - 0x18000: 0x21040080, - 0x19000: 0x21000000, - 0x1a000: 0x1040000, - 0x1b000: 0x20040000, - 0x1c000: 0x40080, - 0x1d000: 0x20000080, - 0x1e000: 0x0, - 0x1f000: 0x1040080, - 0x10800: 0x21000080, - 0x11800: 0x1000000, - 0x12800: 0x1040000, - 0x13800: 0x20040080, - 0x14800: 0x20000000, - 0x15800: 0x1040080, - 0x16800: 0x80, - 0x17800: 0x21040000, - 0x18800: 0x40080, - 0x19800: 0x21040080, - 0x1a800: 0x0, - 0x1b800: 0x21000000, - 0x1c800: 0x1000080, - 0x1d800: 0x40000, - 0x1e800: 0x20040000, - 0x1f800: 0x20000080 - }, - { - 0x0: 0x10000008, - 0x100: 0x2000, - 0x200: 0x10200000, - 0x300: 0x10202008, - 0x400: 0x10002000, - 0x500: 0x200000, - 0x600: 0x200008, - 0x700: 0x10000000, - 0x800: 0x0, - 0x900: 0x10002008, - 0xa00: 0x202000, - 0xb00: 0x8, - 0xc00: 0x10200008, - 0xd00: 0x202008, - 0xe00: 0x2008, - 0xf00: 0x10202000, - 0x80: 0x10200000, - 0x180: 0x10202008, - 0x280: 0x8, - 0x380: 0x200000, - 0x480: 0x202008, - 0x580: 0x10000008, - 0x680: 0x10002000, - 0x780: 0x2008, - 0x880: 0x200008, - 0x980: 0x2000, - 0xa80: 0x10002008, - 0xb80: 0x10200008, - 0xc80: 0x0, - 0xd80: 0x10202000, - 0xe80: 0x202000, - 0xf80: 0x10000000, - 0x1000: 0x10002000, - 0x1100: 0x10200008, - 0x1200: 0x10202008, - 0x1300: 0x2008, - 0x1400: 0x200000, - 0x1500: 0x10000000, - 0x1600: 0x10000008, - 0x1700: 0x202000, - 0x1800: 0x202008, - 0x1900: 0x0, - 0x1a00: 0x8, - 0x1b00: 0x10200000, - 0x1c00: 0x2000, - 0x1d00: 0x10002008, - 0x1e00: 0x10202000, - 0x1f00: 0x200008, - 0x1080: 0x8, - 0x1180: 0x202000, - 0x1280: 0x200000, - 0x1380: 0x10000008, - 0x1480: 0x10002000, - 0x1580: 0x2008, - 0x1680: 0x10202008, - 0x1780: 0x10200000, - 0x1880: 0x10202000, - 0x1980: 0x10200008, - 0x1a80: 0x2000, - 0x1b80: 0x202008, - 0x1c80: 0x200008, - 0x1d80: 0x0, - 0x1e80: 0x10000000, - 0x1f80: 0x10002008 - }, - { - 0x0: 0x100000, - 0x10: 0x2000401, - 0x20: 0x400, - 0x30: 0x100401, - 0x40: 0x2100401, - 0x50: 0x0, - 0x60: 0x1, - 0x70: 0x2100001, - 0x80: 0x2000400, - 0x90: 0x100001, - 0xa0: 0x2000001, - 0xb0: 0x2100400, - 0xc0: 0x2100000, - 0xd0: 0x401, - 0xe0: 0x100400, - 0xf0: 0x2000000, - 0x8: 0x2100001, - 0x18: 0x0, - 0x28: 0x2000401, - 0x38: 0x2100400, - 0x48: 0x100000, - 0x58: 0x2000001, - 0x68: 0x2000000, - 0x78: 0x401, - 0x88: 0x100401, - 0x98: 0x2000400, - 0xa8: 0x2100000, - 0xb8: 0x100001, - 0xc8: 0x400, - 0xd8: 0x2100401, - 0xe8: 0x1, - 0xf8: 0x100400, - 0x100: 0x2000000, - 0x110: 0x100000, - 0x120: 0x2000401, - 0x130: 0x2100001, - 0x140: 0x100001, - 0x150: 0x2000400, - 0x160: 0x2100400, - 0x170: 0x100401, - 0x180: 0x401, - 0x190: 0x2100401, - 0x1a0: 0x100400, - 0x1b0: 0x1, - 0x1c0: 0x0, - 0x1d0: 0x2100000, - 0x1e0: 0x2000001, - 0x1f0: 0x400, - 0x108: 0x100400, - 0x118: 0x2000401, - 0x128: 0x2100001, - 0x138: 0x1, - 0x148: 0x2000000, - 0x158: 0x100000, - 0x168: 0x401, - 0x178: 0x2100400, - 0x188: 0x2000001, - 0x198: 0x2100000, - 0x1a8: 0x0, - 0x1b8: 0x2100401, - 0x1c8: 0x100401, - 0x1d8: 0x400, - 0x1e8: 0x2000400, - 0x1f8: 0x100001 - }, - { - 0x0: 0x8000820, - 0x1: 0x20000, - 0x2: 0x8000000, - 0x3: 0x20, - 0x4: 0x20020, - 0x5: 0x8020820, - 0x6: 0x8020800, - 0x7: 0x800, - 0x8: 0x8020000, - 0x9: 0x8000800, - 0xa: 0x20800, - 0xb: 0x8020020, - 0xc: 0x820, - 0xd: 0x0, - 0xe: 0x8000020, - 0xf: 0x20820, - 0x80000000: 0x800, - 0x80000001: 0x8020820, - 0x80000002: 0x8000820, - 0x80000003: 0x8000000, - 0x80000004: 0x8020000, - 0x80000005: 0x20800, - 0x80000006: 0x20820, - 0x80000007: 0x20, - 0x80000008: 0x8000020, - 0x80000009: 0x820, - 0x8000000a: 0x20020, - 0x8000000b: 0x8020800, - 0x8000000c: 0x0, - 0x8000000d: 0x8020020, - 0x8000000e: 0x8000800, - 0x8000000f: 0x20000, - 0x10: 0x20820, - 0x11: 0x8020800, - 0x12: 0x20, - 0x13: 0x800, - 0x14: 0x8000800, - 0x15: 0x8000020, - 0x16: 0x8020020, - 0x17: 0x20000, - 0x18: 0x0, - 0x19: 0x20020, - 0x1a: 0x8020000, - 0x1b: 0x8000820, - 0x1c: 0x8020820, - 0x1d: 0x20800, - 0x1e: 0x820, - 0x1f: 0x8000000, - 0x80000010: 0x20000, - 0x80000011: 0x800, - 0x80000012: 0x8020020, - 0x80000013: 0x20820, - 0x80000014: 0x20, - 0x80000015: 0x8020000, - 0x80000016: 0x8000000, - 0x80000017: 0x8000820, - 0x80000018: 0x8020820, - 0x80000019: 0x8000020, - 0x8000001a: 0x8000800, - 0x8000001b: 0x0, - 0x8000001c: 0x20800, - 0x8000001d: 0x820, - 0x8000001e: 0x20020, - 0x8000001f: 0x8020800 - } - ]; - - // Masks that select the SBOX input - var SBOX_MASK = [ - 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, - 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f - ]; - - /** - * DES block cipher algorithm. - */ - var DES = C_algo.DES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Select 56 bits according to PC1 - var keyBits = []; - for (var i = 0; i < 56; i++) { - var keyBitPos = PC1[i] - 1; - keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; - } - - // Assemble 16 subkeys - var subKeys = this._subKeys = []; - for (var nSubKey = 0; nSubKey < 16; nSubKey++) { - // Create subkey - var subKey = subKeys[nSubKey] = []; - - // Shortcut - var bitShift = BIT_SHIFTS[nSubKey]; - - // Select 48 bits according to PC2 - for (var i = 0; i < 24; i++) { - // Select from the left 28 key bits - subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); - - // Select from the right 28 key bits - subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); - } - - // Since each subkey is applied to an expanded 32-bit input, - // the subkey can be broken into 8 values scaled to 32-bits, - // which allows the key to be used without expansion - subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); - for (var i = 1; i < 7; i++) { - subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); - } - subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); - } - - // Compute inverse subkeys - var invSubKeys = this._invSubKeys = []; - for (var i = 0; i < 16; i++) { - invSubKeys[i] = subKeys[15 - i]; - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._subKeys); - }, - - decryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._invSubKeys); - }, - - _doCryptBlock: function (M, offset, subKeys) { - // Get input - this._lBlock = M[offset]; - this._rBlock = M[offset + 1]; - - // Initial permutation - exchangeLR.call(this, 4, 0x0f0f0f0f); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeRL.call(this, 2, 0x33333333); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeLR.call(this, 1, 0x55555555); - - // Rounds - for (var round = 0; round < 16; round++) { - // Shortcuts - var subKey = subKeys[round]; - var lBlock = this._lBlock; - var rBlock = this._rBlock; - - // Feistel function - var f = 0; - for (var i = 0; i < 8; i++) { - f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; - } - this._lBlock = rBlock; - this._rBlock = lBlock ^ f; - } - - // Undo swap from last round - var t = this._lBlock; - this._lBlock = this._rBlock; - this._rBlock = t; - - // Final permutation - exchangeLR.call(this, 1, 0x55555555); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeRL.call(this, 2, 0x33333333); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeLR.call(this, 4, 0x0f0f0f0f); - - // Set output - M[offset] = this._lBlock; - M[offset + 1] = this._rBlock; - }, - - keySize: 64/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - // Swap bits across the left and right words - function exchangeLR(offset, mask) { - var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; - this._rBlock ^= t; - this._lBlock ^= t << offset; - } - - function exchangeRL(offset, mask) { - var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; - this._lBlock ^= t; - this._rBlock ^= t << offset; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); - */ - C.DES = BlockCipher._createHelper(DES); - - /** - * Triple-DES block cipher algorithm. - */ - var TripleDES = C_algo.TripleDES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Create DES instances - this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); - this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); - this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); - }, - - encryptBlock: function (M, offset) { - this._des1.encryptBlock(M, offset); - this._des2.decryptBlock(M, offset); - this._des3.encryptBlock(M, offset); - }, - - decryptBlock: function (M, offset) { - this._des3.decryptBlock(M, offset); - this._des2.encryptBlock(M, offset); - this._des1.decryptBlock(M, offset); - }, - - keySize: 192/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); - */ - C.TripleDES = BlockCipher._createHelper(TripleDES); - }()); - - - return CryptoJS.TripleDES; - -})); -}(tripledes)); - -var rc4 = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - /** - * RC4 stream cipher algorithm. - */ - var RC4 = C_algo.RC4 = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - var keySigBytes = key.sigBytes; - - // Init sbox - var S = this._S = []; - for (var i = 0; i < 256; i++) { - S[i] = i; - } - - // Key setup - for (var i = 0, j = 0; i < 256; i++) { - var keyByteIndex = i % keySigBytes; - var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; - - j = (j + S[i] + keyByte) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - } - - // Counters - this._i = this._j = 0; - }, - - _doProcessBlock: function (M, offset) { - M[offset] ^= generateKeystreamWord.call(this); - }, - - keySize: 256/32, - - ivSize: 0 - }); - - function generateKeystreamWord() { - // Shortcuts - var S = this._S; - var i = this._i; - var j = this._j; - - // Generate keystream word - var keystreamWord = 0; - for (var n = 0; n < 4; n++) { - i = (i + 1) % 256; - j = (j + S[i]) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - - keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); - } - - // Update counters - this._i = i; - this._j = j; - - return keystreamWord; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); - */ - C.RC4 = StreamCipher._createHelper(RC4); - - /** - * Modified RC4 stream cipher algorithm. - */ - var RC4Drop = C_algo.RC4Drop = RC4.extend({ - /** - * Configuration options. - * - * @property {number} drop The number of keystream words to drop. Default 192 - */ - cfg: RC4.cfg.extend({ - drop: 192 - }), - - _doReset: function () { - RC4._doReset.call(this); - - // Drop - for (var i = this.cfg.drop; i > 0; i--) { - generateKeystreamWord.call(this); - } - } - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); - */ - C.RC4Drop = StreamCipher._createHelper(RC4Drop); - }()); - - - return CryptoJS.RC4; - -})); -}(rc4)); - -var rabbit = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm - */ - var Rabbit = C_algo.Rabbit = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Swap endian - for (var i = 0; i < 4; i++) { - K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | - (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); - } - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); - * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); - */ - C.Rabbit = StreamCipher._createHelper(Rabbit); - }()); - - - return CryptoJS.Rabbit; - -})); -}(rabbit)); - -var rabbitLegacy = {exports: {}}; - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm. - * - * This is a legacy version that neglected to convert the key to little-endian. - * This error doesn't affect the cipher's security, - * but it does affect its compatibility with other implementations. - */ - var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); - */ - C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); - }()); - - - return CryptoJS.RabbitLegacy; - -})); -}(rabbitLegacy)); - -(function (module, exports) { -(function (root, factory, undef) { - { - // CommonJS - module.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, md5.exports, sha1$4.exports, sha256$b.exports, sha224.exports, sha512$6.exports, sha384.exports, sha3.exports, ripemd160$4.exports, hmac$2.exports, pbkdf2$8.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes$6.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports); - } -}(commonjsGlobal, function (CryptoJS) { - - return CryptoJS; - -})); -}(cryptoJs)); - -var treeify = {exports: {}}; - -(function (module, exports) { -// treeify.js -// Luke Plaster -// https://github.com/notatestuser/treeify.js - -// do the universal module definition dance -(function (root, factory) { - - { - module.exports = factory(); - } - -}(commonjsGlobal, function() { - - function makePrefix(key, last) { - var str = (last ? '└' : '├'); - if (key) { - str += '─ '; - } else { - str += '──┐'; - } - return str; - } - - function filterKeys(obj, hideFunctions) { - var keys = []; - for (var branch in obj) { - // always exclude anything in the object's prototype - if (!obj.hasOwnProperty(branch)) { - continue; - } - // ... and hide any keys mapped to functions if we've been told to - if (hideFunctions && ((typeof obj[branch])==="function")) { - continue; - } - keys.push(branch); - } - return keys; - } - - function growBranch(key, root, last, lastStates, showValues, hideFunctions, callback) { - var line = '', index = 0, lastKey, circular, lastStatesCopy = lastStates.slice(0); - - if (lastStatesCopy.push([ root, last ]) && lastStates.length > 0) { - // based on the "was last element" states of whatever we're nested within, - // we need to append either blankness or a branch to our line - lastStates.forEach(function(lastState, idx) { - if (idx > 0) { - line += (lastState[1] ? ' ' : '│') + ' '; - } - if ( ! circular && lastState[0] === root) { - circular = true; - } - }); - - // the prefix varies based on whether the key contains something to show and - // whether we're dealing with the last element in this collection - line += makePrefix(key, last) + key; - - // append values and the circular reference indicator - showValues && (typeof root !== 'object' || root instanceof Date) && (line += ': ' + root); - circular && (line += ' (circular ref.)'); - - callback(line); - } - - // can we descend into the next item? - if ( ! circular && typeof root === 'object') { - var keys = filterKeys(root, hideFunctions); - keys.forEach(function(branch){ - // the last key is always printed with a different prefix, so we'll need to know if we have it - lastKey = ++index === keys.length; - - // hold your breath for recursive action - growBranch(branch, root[branch], lastKey, lastStatesCopy, showValues, hideFunctions, callback); - }); - } - } - // -------------------- - - var Treeify = {}; - - // Treeify.asLines - // -------------------- - // Outputs the tree line-by-line, calling the lineCallback when each one is available. - - Treeify.asLines = function(obj, showValues, hideFunctions, lineCallback) { - /* hideFunctions and lineCallback are curried, which means we don't break apps using the older form */ - var hideFunctionsArg = typeof hideFunctions !== 'function' ? hideFunctions : false; - growBranch('.', obj, false, [], showValues, hideFunctionsArg, lineCallback || hideFunctions); - }; - - // Treeify.asTree - // -------------------- - // Outputs the entire tree, returning it as a string with line breaks. - - Treeify.asTree = function(obj, showValues, hideFunctions) { - var tree = ''; - growBranch('.', obj, false, [], showValues, hideFunctions, function(line) { - tree += line + '\n'; - }); - return tree; - }; - - // -------------------- - - return Treeify; - -})); -}(treeify)); - -(function (exports) { -exports.__esModule = true; -var reverse = bufferReverse; -var CryptoJS = cryptoJs.exports; -var treeify$1 = treeify.exports; -/** - * Class reprensenting a Merkle Tree - * @namespace MerkleTree - */ -var MerkleTree = /** @class */ (function () { - /** - * @desc Constructs a Merkle Tree. - * All nodes and leaves are stored as Buffers. - * Lonely leaf nodes are promoted to the next level up without being hashed again. - * @param {Buffer[]} leaves - Array of hashed leaves. Each leaf must be a Buffer. - * @param {Function} hashAlgorithm - Algorithm used for hashing leaves and nodes - * @param {Object} options - Additional options - * @example - *```js - *const MerkleTree = require('merkletreejs') - *const crypto = require('crypto') - * - *function sha256(data) { - * // returns Buffer - * return crypto.createHash('sha256').update(data).digest() - *} - * - *const leaves = ['a', 'b', 'c'].map(x => keccak(x)) - * - *const tree = new MerkleTree(leaves, sha256) - *``` - */ - function MerkleTree(leaves, hashAlgorithm, options) { - if (options === void 0) { options = {}; } - this.isBitcoinTree = !!options.isBitcoinTree; - this.hashLeaves = !!options.hashLeaves; - this.sortLeaves = !!options.sortLeaves; - this.sortPairs = !!options.sortPairs; - this.sort = !!options.sort; - if (this.sort) { - this.sortLeaves = true; - this.sortPairs = true; - } - this.duplicateOdd = !!options.duplicateOdd; - this.hashAlgo = bufferifyFn(hashAlgorithm); - if (this.hashLeaves) { - leaves = leaves.map(this.hashAlgo); - } - this.leaves = leaves.map(bufferify); - if (this.sortLeaves) { - this.leaves = this.leaves.sort(Buffer.compare); - } - this.layers = [this.leaves]; - this.createHashes(this.leaves); - } - // TODO: documentation - MerkleTree.prototype.createHashes = function (nodes) { - while (nodes.length > 1) { - var layerIndex = this.layers.length; - this.layers.push([]); - for (var i = 0; i < nodes.length; i += 2) { - if (i + 1 === nodes.length) { - if (nodes.length % 2 === 1) { - var data_1 = nodes[nodes.length - 1]; - var hash_1 = data_1; - // is bitcoin tree - if (this.isBitcoinTree) { - // Bitcoin method of duplicating the odd ending nodes - data_1 = Buffer.concat([reverse(data_1), reverse(data_1)]); - hash_1 = this.hashAlgo(data_1); - hash_1 = reverse(this.hashAlgo(hash_1)); - this.layers[layerIndex].push(hash_1); - continue; - } - else { - if (!this.duplicateOdd) { - this.layers[layerIndex].push(nodes[i]); - continue; - } - } - } - } - var left = nodes[i]; - var right = i + 1 == nodes.length ? left : nodes[i + 1]; - var data = null; - var combined = null; - if (this.isBitcoinTree) { - combined = [reverse(left), reverse(right)]; - } - else { - combined = [left, right]; - } - if (this.sortPairs) { - combined.sort(Buffer.compare); - } - data = Buffer.concat(combined); - var hash = this.hashAlgo(data); - // double hash if bitcoin tree - if (this.isBitcoinTree) { - hash = reverse(this.hashAlgo(hash)); - } - this.layers[layerIndex].push(hash); - } - nodes = this.layers[layerIndex]; - } - }; - /** - * getLeaves - * @desc Returns array of leaves of Merkle Tree. - * @return {Buffer[]} - * @example - *```js - *const leaves = tree.getLeaves() - *``` - */ - MerkleTree.prototype.getLeaves = function () { - return this.leaves; - }; - /** - * getLayers - * @desc Returns array of all layers of Merkle Tree, including leaves and root. - * @return {Buffer[]} - * @example - *```js - *const layers = tree.getLayers() - *``` - */ - MerkleTree.prototype.getLayers = function () { - return this.layers; - }; - /** - * getRoot - * @desc Returns the Merkle root hash as a Buffer. - * @return {Buffer} - * @example - *```js - *const root = tree.getRoot() - *``` - */ - MerkleTree.prototype.getRoot = function () { - return this.layers[this.layers.length - 1][0] || Buffer.from([]); - }; - // TODO: documentation - MerkleTree.prototype.getHexRoot = function () { - return bufferToHex(this.getRoot()); - }; - /** - * getProof - * @desc Returns the proof for a target leaf. - * @param {Buffer} leaf - Target leaf - * @param {Number} [index] - Target leaf index in leaves array. - * Use if there are leaves containing duplicate data in order to distinguish it. - * @return {Object[]} - Array of objects containing a position property of type string - * with values of 'left' or 'right' and a data property of type Buffer. - *@example - * ```js - *const proof = tree.getProof(leaves[2]) - *``` - * - * @example - *```js - *const leaves = ['a', 'b', 'a'].map(x => keccak(x)) - *const tree = new MerkleTree(leaves, keccak) - *const proof = tree.getProof(leaves[2], 2) - *``` - */ - MerkleTree.prototype.getProof = function (leaf, index) { - leaf = bufferify(leaf); - var proof = []; - if (typeof index !== 'number') { - index = -1; - for (var i = 0; i < this.leaves.length; i++) { - if (Buffer.compare(leaf, this.leaves[i]) === 0) { - index = i; - } - } - } - if (index <= -1) { - return []; - } - if (this.isBitcoinTree && index === (this.leaves.length - 1)) { - // Proof Generation for Bitcoin Trees - for (var i = 0; i < this.layers.length - 1; i++) { - var layer = this.layers[i]; - var isRightNode = index % 2; - var pairIndex = (isRightNode ? index - 1 : index); - if (pairIndex < layer.length) { - proof.push({ - data: layer[pairIndex] - }); - } - // set index to parent index - index = (index / 2) | 0; - } - return proof; - } - else { - // Proof Generation for Non-Bitcoin Trees - for (var i = 0; i < this.layers.length; i++) { - var layer = this.layers[i]; - var isRightNode = index % 2; - var pairIndex = (isRightNode ? index - 1 : index + 1); - if (pairIndex < layer.length) { - proof.push({ - position: isRightNode ? 'left' : 'right', - data: layer[pairIndex] - }); - } - // set index to parent index - index = (index / 2) | 0; - } - return proof; - } - }; - // TODO: documentation - MerkleTree.prototype.getHexProof = function (leaf, index) { - return this.getProof(leaf, index).map(function (x) { return bufferToHex(x.data); }); - }; - /** - * verify - * @desc Returns true if the proof path (array of hashes) can connect the target node - * to the Merkle root. - * @param {Object[]} proof - Array of proof objects that should connect - * target node to Merkle root. - * @param {Buffer} targetNode - Target node Buffer - * @param {Buffer} root - Merkle root Buffer - * @return {Boolean} - * @example - *```js - *const root = tree.getRoot() - *const proof = tree.getProof(leaves[2]) - *const verified = tree.verify(proof, leaves[2], root) - *``` - */ - MerkleTree.prototype.verify = function (proof, targetNode, root) { - var hash = bufferify(targetNode); - root = bufferify(root); - if (!Array.isArray(proof) || - !proof.length || - !targetNode || - !root) { - return false; - } - for (var i = 0; i < proof.length; i++) { - var node = proof[i]; - var data = null; - var isLeftNode = null; - // NOTE: case for when proof is hex values only - if (typeof node === 'string') { - data = bufferify(node); - isLeftNode = true; - } - else { - data = node.data; - isLeftNode = (node.position === 'left'); - } - var buffers = []; - if (this.isBitcoinTree) { - buffers.push(reverse(hash)); - buffers[isLeftNode ? 'unshift' : 'push'](reverse(data)); - hash = this.hashAlgo(Buffer.concat(buffers)); - hash = reverse(this.hashAlgo(hash)); - } - else { - if (this.sortPairs) { - if (Buffer.compare(hash, data) === -1) { - buffers.push(hash, data); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - else { - buffers.push(data, hash); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - } - else { - buffers.push(hash); - buffers[isLeftNode ? 'unshift' : 'push'](data); - hash = this.hashAlgo(Buffer.concat(buffers)); - } - } - } - return Buffer.compare(hash, root) === 0; - }; - // TODO: documentation - MerkleTree.prototype.getLayersAsObject = function () { - var _a; - var layers = this.getLayers().map(function (x) { return x.map(function (x) { return x.toString('hex'); }); }); - var objs = []; - for (var i = 0; i < layers.length; i++) { - var arr = []; - for (var j = 0; j < layers[i].length; j++) { - var obj = (_a = {}, _a[layers[i][j]] = null, _a); - if (objs.length) { - obj[layers[i][j]] = {}; - var a = objs.shift(); - var akey = Object.keys(a)[0]; - obj[layers[i][j]][akey] = a[akey]; - if (objs.length) { - var b = objs.shift(); - var bkey = Object.keys(b)[0]; - obj[layers[i][j]][bkey] = b[bkey]; - } - } - arr.push(obj); - } - objs.push.apply(objs, arr); - } - return objs[0]; - }; - // TODO: documentation - MerkleTree.prototype.print = function () { - MerkleTree.print(this); - }; - // TODO: documentation - MerkleTree.prototype.toTreeString = function () { - var obj = this.getLayersAsObject(); - return treeify$1.asTree(obj, true); - }; - // TODO: documentation - MerkleTree.prototype.toString = function () { - return this.toTreeString(); - }; - // TODO: documentation - MerkleTree.bufferify = function (x) { - return bufferify(x); - }; - // TODO: documentation - MerkleTree.print = function (tree) { - console.log(tree.toString()); - }; - return MerkleTree; -}()); -exports.MerkleTree = MerkleTree; -function bufferToHex(value) { - return '0x' + value.toString('hex'); -} -function bufferify(x) { - if (!Buffer.isBuffer(x)) { - // crypto-js support - if (typeof x === 'object' && x.words) { - return Buffer.from(x.toString(CryptoJS.enc.Hex), 'hex'); - } - else if (isHexStr(x)) { - return Buffer.from(x.replace(/^0x/, ''), 'hex'); - } - else if (typeof x === 'string') { - return Buffer.from(x); - } - } - return x; -} -function bufferifyFn(f) { - return function (x) { - var v = f(x); - if (Buffer.isBuffer(v)) { - return v; - } - if (isHexStr(v)) { - return Buffer.from(v, 'hex'); - } - // crypto-js support - return Buffer.from(f(CryptoJS.enc.Hex.parse(x.toString('hex'))).toString(CryptoJS.enc.Hex), 'hex'); - }; -} -function isHexStr(v) { - return (typeof v === 'string' && /^(0x)?[0-9A-Fa-f]*$/.test(v)); -} -exports["default"] = MerkleTree; -}(dist$1)); - -const { - MAX_MEMORY_ALLOC, - MAX_FRAME_SIZE -} = constants$1; - -const State$8 = state$2; -const { MerkleTree: MerkleTree$1 } = dist$1; - -/** - * Manage stacks of data. - */ -class Stack$a extends State$8 { - /** - * Create a {@link Stack} instance. - * @param {Array} [list=[]] Genesis state for the {@link Stack} instance. - * @return {Stack} Instance of the {@link Stack}. - */ - constructor (list = []) { - super(list); - - this.limit = MAX_MEMORY_ALLOC; - this.frame = Buffer.alloc(MAX_FRAME_SIZE); - this.config = list || []; - - // Patch for new Collection inheritance - this.settings = Object.assign({ - verbosity: 2 - }, list); - - this['@type'] = this.config['@type']; - this['@entity'].frames = {}; - this['@entity'].states = {}; - this['@states'] = {}; - this['@data'] = []; - - if (list instanceof Array) { - for (let i in list) { - this.push(list[i]); - } - } - - this['@entity']['@type'] = this['@type']; - this['@entity']['@data'] = this['@data']; - this['@id'] = this.id; - - return this; - } - - get size () { - return this['@data'].length; - } - - /** - * Push data onto the stack. Changes the {@link Stack#frame} and - * {@link Stack#id}. - * @param {Mixed} data Treated as a {@link State}. - * @return {Number} Resulting size of the stack. - */ - push (data) { - let state = new State$8(data); - - this['@entity'].states[this.id] = this['@data']; - this['@entity'].states[state.id] = state['@data']; - this['@entity'].frames[this.id] = this['@data']; - this['@entity'].frames[state.id] = state['@data']; - - // write the frame - // NOTE: no garbage collection - this.frame = Buffer.from(state.id); - - // push frame onto stack - this['@data'].push(this.frame); - this['@type'] = 'Stack'; - this['@size'] = this['@data'].length * MAX_FRAME_SIZE; - - this.commit(); - - return this['@data'].length; - } - - dedupe () { - return new Stack$a([...new Set(this.asArray())]); - } - - pop () { - let element = this['@data'].pop(); - return element; - } - - asArray () { - return Array.from(this['@data']); - } - - asMerkleTree () { - return new MerkleTree$1(this.asArray(), this.sha256, { - isBitcoinTree: true - }); - } - - snapshot () { - return this.id || { '@id': `${this.sha256(this.state['@data'])}` }; - } - - commit () { - let stack = this; - let changes = super.commit(); - - if (changes.length) { - let data = Object.assign({}, { - parent: stack.tip, - changes: changes - }); - - stack.state['@data'] = data; - stack.history.push(stack.state.id); - } - - // TODO: return Transaction - return changes; - } -} - -var stack$2 = Stack$a; - -const pluralize$4 = pluralize$5.exports; -const monitor$4 = duplex; -const pointer$4 = jsonPointer$1; - -const Entity$7 = entity; -const Stack$9 = stack$2; -const State$7 = state$2; - -/** - * The {@link Collection} type maintains an ordered list of {@link State} items. - * @property {Object} @entity Fabric-bound entity object. - */ -class Collection$6 extends Stack$9 { - /** - * Create a list of {@link Entity}-like objects for later retrieval. - * @param {Object} [configuration={}] Configuration object. - * @return {Collection} Configured instance of the the {@link Collection}. - */ - constructor (configuration = {}) { - super(configuration); - - // TODO: document `listeners` handler (currently only `create`) - this.settings = Object.assign({ - atomic: true, - type: Entity$7, - deterministic: true, - name: '@fabric/store', - path: `./collections`, - fields: { id: 'id' }, - key: 'id' - }, configuration); - - this['@type'] = 'Collection'; - this['@entity']['@type'] = 'Collection'; - - // Set name to plural version, define path for storage - this.name = pluralize$4(this.settings.name); - this.path = `/` + this.name.toLowerCase(); - - this._state = {}; - this.value = {}; - - this.set(`${this.path}`, this.settings.data || {}); - this.observer = monitor$4.observe(this.value); - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - get routes () { - return this.settings.routes; - } - - /** - * Current elements of the collection as a {@link MerkleTree}. - * @returns {MerkleTree} - */ - asMerkleTree () { - let list = pointer$4.get(this.value, this.path); - let stack = new Stack$9(Object.keys(list)); - return stack.asMerkleTree(); - } - - /** - * Sets the `key` property of collection settings. - * @param {String} name Value to set the `key` setting to. - */ - _setKey (name) { - this.settings.key = name; - } - - /** - * Retrieve an element from the collection by ID. - * @param {String} id Document identifier. - */ - getByID (id) { - if (!id) return null; - - let result = null; - - try { - if (this.settings.verbosity >= 5) console.log(`getting ${this.path}/${id} from:`, this.value); - result = pointer$4.get(this.value, `${this.path}/${id}`); - } catch (E) { - // console.debug('[FABRIC:COLLECTION]', `@${this.name}`, Date.now(), `Could not find ID "${id}" in tree ${this.asMerkleTree()}`); - } - - result = this._wrapResult(result); - - return result; - } - - /** - * Retrieve the most recent element in the collection. - */ - getLatest () { - let items = pointer$4.get(this.value, this.path); - return items[items.length - 1]; - } - - /** - * Find a document by specific field. - * @param {String} name Name of field to search. - * @param {String} value Value to match. - */ - findByField (name, value) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - if (items[id][name] === value) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - /** - * Find a document by the "name" field. - * @param {String} name Name to search for. - */ - findByName (name) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - if (items[id].name === name) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - /** - * Find a document by the "symbol" field. - * @param {String} symbol Value to search for. - */ - findBySymbol (symbol) { - let result = null; - let items = pointer$4.get(this.value, this.path); - // constant-time loop - for (let id in items) { - // TODO: fix bug here (check for symbol) - if (items[id].symbol === symbol) { - // use only first result - result = (result) ? result : items[id]; - } - } - return result; - } - - // TODO: deep search, consider GraphQL (!!!: to discuss) - match (query = {}) { - let result = null; - let items = pointer$4.get(this.value, this.path); - let list = Object.keys(items).map((x) => { - return items[x]; - }); - - try { - result = list.filter((x) => { - for (let field in query) { - if (x[field] !== query[field]) return false; - } - return true; - }); - } catch (E) { - console.error('Could not match:', E); - } - - return result; - } - - _wrapResult (result) { - // TODO: enable upstream specification via pure JSON - if (this.settings.type.name !== 'Entity') { - let Type = this.settings.type; - result = new Type(result || {}); - } - - // TODO: validation of result by calling result.validate() - // TODO: signing of result by calling result.signWith() - return result; - } - - /** - * Modify a target document using an array of atomic updates. - * @param {String} path Path to the document to modify. - * @param {Array} patches List of operations to apply. - */ - async _patchTarget (path, patches) { - let link = `${path}`; - let result = null; - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'Patching target:', path, patches); - - try { - result = monitor$4.applyPatch(this.value, patches.map((op) => { - op.path = `${link}${op.path}`; - return op; - })).newDocument; - } catch (E) { - console.error('Could not patch target:', E, path, patches); - } - - await this.commit(); - - return result; - } - - /** - * Adds an {@link Entity} to the {@link Collection}. - * @param {Mixed} data {@link Entity} to add. - * @return {Number} Length of the collection. - */ - async push (data, commit = true) { - super.push(data); - - let state = new State$7(data); - - this['@entity'].states[this.id] = this['@data']; - this['@entity'].states[state.id] = state['@data']; - - this['@entity']['@data'] = this['@data'].map(x => x.toString()); - this['@data'] = this['@entity']['@data']; - - this['@id'] = this.id; - - if (commit) { - try { - this['@commit'] = await this.commit(); - } catch (E) { - console.error('Could not commit.', E); - } - } - - return this['@data'].length; - } - - async populate () { - return Promise.all(this['@entity']['@data'].map(id => { - return this['@entity'].states[id.toString('hex')]; - })); - } - - async query (path) { - return this.get(path); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path) { - let result = null; - - try { - result = pointer$4.get(this['@entity']['@data'], path); - } catch (exception) { - this.emit('warning', `[FABRIC:COLLECTION] Could not retrieve path: ${path} ${JSON.stringify(exception)}`); - // console.error('[FABRIC:COLLECTION]', 'Could not retrieve path:', path, exception); - } - - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - pointer$4.set(this._state, path, value); - pointer$4.set(this.value, path, value); - pointer$4.set(this['@entity']['@data'], path, value); - - this.commit(); - return true; - } - - /** - * Generate a list of elements in the collection. - * @deprecated - * @returns {Array} - */ - list () { - let map = this.map(); - let ids = Object.keys(map); - // TODO: `list()` should return an Array - let result = {}; - - for (let i = 0; i < ids.length; i++) { - result[ids[i]] = this._wrapResult(map[ids[i]]); - } - - return result; - } - - /** - * Provides the {@link Collection} as an {@link Array} of typed - * elements. The type of these elments are defined by the collection's - * type, supplied in the constructor. - */ - toTypedArray () { - let map = this.map(); - let ids = Object.keys(map); - return ids.map((x) => this._wrapResult(map[ids[x]])); - } - - typedMap () { - let map = this.map(); - let ids = Object.keys(map); - // TODO: `list()` should return an Array - let result = {}; - - for (let i = 0; i < ids.length; i++) { - result[ids[i]] = this._wrapResult(map[ids[i]]); - } - - return result; - } - - /** - * Generate a hashtable of elements in the collection. - * @returns {Array} - */ - map () { - return Collection$6.pointer.get(this.value, `${this.path}`); - } - - /** - * Create an instance of an {@link Entity}. - * @param {Object} entity Object with properties. - * @return {Promise} Resolves with instantiated {@link Entity}. - */ - async create (input, commit = true) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:COLLECTION]', 'Creating object:', input); - if (!this.settings.deterministic) input.created = Date.now(); - - let result = null; - let entity = new Entity$7(input); - let link = `${this.path}/${entity.id}`; - // TODO: enable specifying names (again) - // let link = `${this.path}/${(entity.data[this.settings.fields.id] || entity.id)}`; - // TODO: handle duplicates (when desired, i.e., "unique" in settings) - let current = await this.getByID(entity.id); - if (current) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:COLLECTION]', 'Exact entity exists:', current); - } - - if (this.settings.methods && this.settings.methods.create) { - result = await this.settings.methods.create.call(this, input); - } else { - result = entity; - } - - pointer$4.set(this._state, link, result.data); - - this.set(link, result.data || result); - - this.emit('message', { - '@type': 'Create', - '@data': Object.assign({}, result.data, { - id: entity.id - }) - }); - - if (commit) { - try { - this['@commit'] = await this.commit(); - this.emit('commit', this['@commit']); - } catch (E) { - console.error('Could not commit.', E); - } - } - - if (this.settings.listeners && this.settings.listeners.create) { - await this.settings.listeners.create(entity.data); - } - - result = result.data || entity.data; - result.id = entity.id; - - return result; - } - - /** - * Loads {@link State} into memory. - * @param {State} state State to import. - * @param {Boolean} commit Whether or not to commit the result. - * @emits message Will emit one {@link Snapshot} message. - */ - async import (input, commit = true) { - if (input['@data']) input = input['@data']; - - let result = null; - let size = await this.push(input, false); - let state = this['@entity'].states[this['@data'][size - 1]]; - let entity = new Entity$7(state); - let link = `${this.path}/${input.id || entity.id}`; - - if (this.settings.verbosity >= 4) console.log('state.data:', state.data); - if (this.settings.verbosity >= 4) console.log('state:', state); - if (this.settings.verbosity >= 4) console.log('link:', link); - - this.set(link, state.data || state); - - if (commit) { - try { - this['@commit'] = await this.commit(); - } catch (E) { - console.error('Could not commit.', E); - } - } - - result = state.data || entity.data; - result.id = input.id || entity.id; - - // TODO: ensure updates sent on subscriber channels - // ESPECIALLY when an ID is supplied... - // TODO: test upstream attack vectors - if (this.settings.verbosity >= 4) console.log('input.id', input.id); - - this.emit('message', { - '@type': 'Snapshot', - '@data': { - path: this.path, - state: pointer$4.get(this.value, this.path) - } - }); - - return result; - } - - async importList (list) { - let ids = []; - - for (let i = 0; i < list.length; i++) { - let item = await this.import(list[i]); - ids.push(item.id); - } - - return ids; - } - - async importMap (map) { - return this.importList(Object.values(map)); - } - - commit () { - if (this.settings.verbosity >= 4) this.emit('debug', '[FABRIC:COLLECTION] Committing...'); - const patches = monitor$4.generate(this.observer); - - if (patches && patches.length) { - const body = { - changes: patches, - state: this.value - }; - - this.emit('transaction', body); - this.emit('patches', patches); - this.emit('message', { - '@type': 'Transaction', - '@data': body - }); - } - } - - get len () { - return Object.keys(this.list()).length; - } -} - -var collection$1 = Collection$6; - -var deferredLeveldown = {exports: {}}; - -var abstractLeveldown$1 = {}; - -var levelSupports = function supports (...manifests) { - const manifest = manifests.reduce((acc, m) => Object.assign(acc, m), {}); - - return Object.assign(manifest, { - // Features of abstract-leveldown - bufferKeys: manifest.bufferKeys || false, - snapshots: manifest.snapshots || false, - permanence: manifest.permanence || false, - seek: manifest.seek || false, - clear: manifest.clear || false, - getMany: manifest.getMany || false, - keyIterator: manifest.keyIterator || false, - valueIterator: manifest.valueIterator || false, - iteratorNextv: manifest.iteratorNextv || false, - iteratorAll: manifest.iteratorAll || false, - - // Features of abstract-leveldown that levelup doesn't have - status: manifest.status || false, - idempotentOpen: manifest.idempotentOpen || false, - passiveOpen: manifest.passiveOpen || false, - serialize: manifest.serialize || false, - - // Features of disk-based implementations - createIfMissing: manifest.createIfMissing || false, - errorIfExists: manifest.errorIfExists || false, - - // Features of level(up) that abstract-leveldown doesn't have yet - deferredOpen: manifest.deferredOpen || false, - openCallback: manifest.openCallback || false, - promises: manifest.promises || false, - streams: manifest.streams || false, - encodings: maybeObject(manifest.encodings), - events: maybeObject(manifest.events), - - // Methods that are not part of abstract-leveldown or levelup - additionalMethods: Object.assign({}, manifest.additionalMethods) - }) -}; - -function maybeObject (value) { - return !value ? false : Object.assign({}, value) -} - -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -var isBuffer$h = function isBuffer (obj) { - return obj != null && obj.constructor != null && - typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -}; - -var catering$3 = {}; - -var nextTick$5 = process.nextTick.bind(process); - -var nextTick$4 = nextTick$5; - -catering$3.fromCallback = function (callback, symbol) { - if (callback === undefined) { - var promise = new Promise(function (resolve, reject) { - callback = function (err, res) { - if (err) reject(err); - else resolve(res); - }; - }); - - callback[symbol !== undefined ? symbol : 'promise'] = promise; - } else if (typeof callback !== 'function') { - throw new TypeError('Callback must be a function') - } - - return callback -}; - -catering$3.fromPromise = function (promise, callback) { - if (callback === undefined) return promise - - promise - .then(function (res) { nextTick$4(() => callback(null, res)); }) - .catch(function (err) { nextTick$4(() => callback(err)); }); -}; - -var nextTick$3 = process.nextTick; - -function AbstractIterator$4 (db) { - if (typeof db !== 'object' || db === null) { - throw new TypeError('First argument must be an abstract-leveldown compliant store') - } - - this.db = db; - this._ended = false; - this._nexting = false; -} - -AbstractIterator$4.prototype.next = function (callback) { - // In callback mode, we return `this` - let ret = this; - - if (callback === undefined) { - ret = new Promise(function (resolve, reject) { - callback = function (err, key, value) { - if (err) reject(err); - else if (key === undefined && value === undefined) resolve(); - else resolve([key, value]); - }; - }); - } else if (typeof callback !== 'function') { - throw new Error('next() requires a callback argument') - } - - if (this._ended) { - this._nextTick(callback, new Error('cannot call next() after end()')); - return ret - } - - if (this._nexting) { - this._nextTick(callback, new Error('cannot call next() before previous next() has completed')); - return ret - } - - this._nexting = true; - this._next((err, ...rest) => { - this._nexting = false; - callback(err, ...rest); - }); - - return ret -}; - -AbstractIterator$4.prototype._next = function (callback) { - this._nextTick(callback); -}; - -AbstractIterator$4.prototype.seek = function (target) { - if (this._ended) { - throw new Error('cannot call seek() after end()') - } - if (this._nexting) { - throw new Error('cannot call seek() before next() has completed') - } - - target = this.db._serializeKey(target); - this._seek(target); -}; - -AbstractIterator$4.prototype._seek = function (target) {}; - -AbstractIterator$4.prototype.end = function (callback) { - let promise; - - if (callback === undefined) { - promise = new Promise(function (resolve, reject) { - callback = function (err) { - if (err) reject(err); - else resolve(); - }; - }); - } else if (typeof callback !== 'function') { - throw new Error('end() requires a callback argument') - } - - if (this._ended) { - this._nextTick(callback, new Error('end() already called on iterator')); - return promise - } - - this._ended = true; - this._end(callback); - - return promise -}; - -AbstractIterator$4.prototype._end = function (callback) { - this._nextTick(callback); -}; - -AbstractIterator$4.prototype[Symbol.asyncIterator] = async function * () { - try { - let kv; - - while ((kv = (await this.next())) !== undefined) { - yield kv; - } - } finally { - if (!this._ended) await this.end(); - } -}; - -// Expose browser-compatible nextTick for dependents -AbstractIterator$4.prototype._nextTick = nextTick$3; - -var abstractIterator = AbstractIterator$4; - -const emptyOptions = Object.freeze({}); - -function AbstractChainedBatch$4 (db) { - if (typeof db !== 'object' || db === null) { - throw new TypeError('First argument must be an abstract-leveldown compliant store') - } - - this.db = db; - this._operations = []; - this._written = false; -} - -AbstractChainedBatch$4.prototype._checkWritten = function () { - if (this._written) { - throw new Error('write() already called on this batch') - } -}; - -AbstractChainedBatch$4.prototype.put = function (key, value, options) { - this._checkWritten(); - - const err = this.db._checkKey(key) || this.db._checkValue(value); - if (err) throw err - - key = this.db._serializeKey(key); - value = this.db._serializeValue(value); - - this._put(key, value, options != null ? options : emptyOptions); - - return this -}; - -AbstractChainedBatch$4.prototype._put = function (key, value, options) { - this._operations.push({ ...options, type: 'put', key, value }); -}; - -AbstractChainedBatch$4.prototype.del = function (key, options) { - this._checkWritten(); - - const err = this.db._checkKey(key); - if (err) throw err - - key = this.db._serializeKey(key); - this._del(key, options != null ? options : emptyOptions); - - return this -}; - -AbstractChainedBatch$4.prototype._del = function (key, options) { - this._operations.push({ ...options, type: 'del', key }); -}; - -AbstractChainedBatch$4.prototype.clear = function () { - this._checkWritten(); - this._clear(); - - return this -}; - -AbstractChainedBatch$4.prototype._clear = function () { - this._operations = []; -}; - -AbstractChainedBatch$4.prototype.write = function (options, callback) { - this._checkWritten(); - - if (typeof options === 'function') { - callback = options; - } - if (typeof callback !== 'function') { - throw new Error('write() requires a callback argument') - } - if (typeof options !== 'object' || options === null) { - options = {}; - } - - this._written = true; - this._write(options, callback); -}; - -AbstractChainedBatch$4.prototype._write = function (options, callback) { - this.db._batch(this._operations, options, callback); -}; - -// Expose browser-compatible nextTick for dependents -AbstractChainedBatch$4.prototype._nextTick = nextTick$3; - -var abstractChainedBatch = AbstractChainedBatch$4; - -var common$A = {}; - -common$A.getCallback = function (options, callback) { - return typeof options === 'function' ? options : callback -}; - -common$A.getOptions = function (options) { - return typeof options === 'object' && options !== null ? options : {} -}; - -const supports$1 = levelSupports; -const isBuffer$g = isBuffer$h; -const catering$2 = catering$3; -const AbstractIterator$3 = abstractIterator; -const AbstractChainedBatch$3 = abstractChainedBatch; -const getCallback$4 = common$A.getCallback; -const getOptions$2 = common$A.getOptions; - -const hasOwnProperty$2 = Object.prototype.hasOwnProperty; -const rangeOptions$1 = ['lt', 'lte', 'gt', 'gte']; - -function AbstractLevelDOWN$3 (manifest) { - this.status = 'new'; - - // TODO (next major): make this mandatory - this.supports = supports$1(manifest, { - status: true - }); -} - -AbstractLevelDOWN$3.prototype.open = function (options, callback) { - const oldStatus = this.status; - - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('open() requires a callback argument') - } - - if (typeof options !== 'object' || options === null) options = {}; - - options.createIfMissing = options.createIfMissing !== false; - options.errorIfExists = !!options.errorIfExists; - - this.status = 'opening'; - this._open(options, (err) => { - if (err) { - this.status = oldStatus; - return callback(err) - } - this.status = 'open'; - callback(); - }); -}; - -AbstractLevelDOWN$3.prototype._open = function (options, callback) { - this._nextTick(callback); -}; - -AbstractLevelDOWN$3.prototype.close = function (callback) { - const oldStatus = this.status; - - if (typeof callback !== 'function') { - throw new Error('close() requires a callback argument') - } - - this.status = 'closing'; - this._close((err) => { - if (err) { - this.status = oldStatus; - return callback(err) - } - this.status = 'closed'; - callback(); - }); -}; - -AbstractLevelDOWN$3.prototype._close = function (callback) { - this._nextTick(callback); -}; - -AbstractLevelDOWN$3.prototype.get = function (key, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('get() requires a callback argument') - } - - const err = this._checkKey(key); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - - if (typeof options !== 'object' || options === null) options = {}; - - options.asBuffer = options.asBuffer !== false; - - this._get(key, options, callback); -}; - -AbstractLevelDOWN$3.prototype._get = function (key, options, callback) { - this._nextTick(function () { callback(new Error('NotFound')); }); -}; - -AbstractLevelDOWN$3.prototype.getMany = function (keys, options, callback) { - callback = getCallback$4(options, callback); - callback = catering$2.fromCallback(callback); - options = getOptions$2(options); - - if (maybeError$1(this, callback)) { - return callback.promise - } - - if (!Array.isArray(keys)) { - this._nextTick(callback, new Error('getMany() requires an array argument')); - return callback.promise - } - - if (keys.length === 0) { - this._nextTick(callback, null, []); - return callback.promise - } - - if (typeof options.asBuffer !== 'boolean') { - options = { ...options, asBuffer: true }; - } - - const serialized = new Array(keys.length); - - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const err = this._checkKey(key); - - if (err) { - this._nextTick(callback, err); - return callback.promise - } - - serialized[i] = this._serializeKey(key); - } - - this._getMany(serialized, options, callback); - return callback.promise -}; - -AbstractLevelDOWN$3.prototype._getMany = function (keys, options, callback) { - this._nextTick(callback, null, new Array(keys.length).fill(undefined)); -}; - -AbstractLevelDOWN$3.prototype.put = function (key, value, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('put() requires a callback argument') - } - - const err = this._checkKey(key) || this._checkValue(value); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - value = this._serializeValue(value); - - if (typeof options !== 'object' || options === null) options = {}; - - this._put(key, value, options, callback); -}; - -AbstractLevelDOWN$3.prototype._put = function (key, value, options, callback) { - this._nextTick(callback); -}; - -AbstractLevelDOWN$3.prototype.del = function (key, options, callback) { - if (typeof options === 'function') callback = options; - - if (typeof callback !== 'function') { - throw new Error('del() requires a callback argument') - } - - const err = this._checkKey(key); - if (err) return this._nextTick(callback, err) - - key = this._serializeKey(key); - - if (typeof options !== 'object' || options === null) options = {}; - - this._del(key, options, callback); -}; - -AbstractLevelDOWN$3.prototype._del = function (key, options, callback) { - this._nextTick(callback); -}; - -AbstractLevelDOWN$3.prototype.batch = function (array, options, callback) { - if (!arguments.length) return this._chainedBatch() - - if (typeof options === 'function') callback = options; - - if (typeof array === 'function') callback = array; - - if (typeof callback !== 'function') { - throw new Error('batch(array) requires a callback argument') - } - - if (!Array.isArray(array)) { - return this._nextTick(callback, new Error('batch(array) requires an array argument')) - } - - if (array.length === 0) { - return this._nextTick(callback) - } - - if (typeof options !== 'object' || options === null) options = {}; - - const serialized = new Array(array.length); - - for (let i = 0; i < array.length; i++) { - if (typeof array[i] !== 'object' || array[i] === null) { - return this._nextTick(callback, new Error('batch(array) element must be an object and not `null`')) - } - - const e = Object.assign({}, array[i]); - - if (e.type !== 'put' && e.type !== 'del') { - return this._nextTick(callback, new Error("`type` must be 'put' or 'del'")) - } - - const err = this._checkKey(e.key); - if (err) return this._nextTick(callback, err) - - e.key = this._serializeKey(e.key); - - if (e.type === 'put') { - const valueErr = this._checkValue(e.value); - if (valueErr) return this._nextTick(callback, valueErr) - - e.value = this._serializeValue(e.value); - } - - serialized[i] = e; - } - - this._batch(serialized, options, callback); -}; - -AbstractLevelDOWN$3.prototype._batch = function (array, options, callback) { - this._nextTick(callback); -}; - -AbstractLevelDOWN$3.prototype.clear = function (options, callback) { - if (typeof options === 'function') { - callback = options; - } else if (typeof callback !== 'function') { - throw new Error('clear() requires a callback argument') - } - - options = cleanRangeOptions(this, options); - options.reverse = !!options.reverse; - options.limit = 'limit' in options ? options.limit : -1; - - this._clear(options, callback); -}; - -AbstractLevelDOWN$3.prototype._clear = function (options, callback) { - // Avoid setupIteratorOptions, would serialize range options a second time. - options.keys = true; - options.values = false; - options.keyAsBuffer = true; - options.valueAsBuffer = true; - - const iterator = this._iterator(options); - const emptyOptions = {}; - - const next = (err) => { - if (err) { - return iterator.end(function () { - callback(err); - }) - } - - iterator.next((err, key) => { - if (err) return next(err) - if (key === undefined) return iterator.end(callback) - - // This could be optimized by using a batch, but the default _clear - // is not meant to be fast. Implementations have more room to optimize - // if they override _clear. Note: using _del bypasses key serialization. - this._del(key, emptyOptions, next); - }); - }; - - next(); -}; - -AbstractLevelDOWN$3.prototype._setupIteratorOptions = function (options) { - options = cleanRangeOptions(this, options); - - options.reverse = !!options.reverse; - options.keys = options.keys !== false; - options.values = options.values !== false; - options.limit = 'limit' in options ? options.limit : -1; - options.keyAsBuffer = options.keyAsBuffer !== false; - options.valueAsBuffer = options.valueAsBuffer !== false; - - return options -}; - -function cleanRangeOptions (db, options) { - const result = {}; - - for (const k in options) { - if (!hasOwnProperty$2.call(options, k)) continue - - if (k === 'start' || k === 'end') { - throw new Error('Legacy range options ("start" and "end") have been removed') - } - - let opt = options[k]; - - if (isRangeOption(k)) { - // Note that we don't reject nullish and empty options here. While - // those types are invalid as keys, they are valid as range options. - opt = db._serializeKey(opt); - } - - result[k] = opt; - } - - return result -} - -function isRangeOption (k) { - return rangeOptions$1.indexOf(k) !== -1 -} - -AbstractLevelDOWN$3.prototype.iterator = function (options) { - if (typeof options !== 'object' || options === null) options = {}; - options = this._setupIteratorOptions(options); - return this._iterator(options) -}; - -AbstractLevelDOWN$3.prototype._iterator = function (options) { - return new AbstractIterator$3(this) -}; - -AbstractLevelDOWN$3.prototype._chainedBatch = function () { - return new AbstractChainedBatch$3(this) -}; - -AbstractLevelDOWN$3.prototype._serializeKey = function (key) { - return key -}; - -AbstractLevelDOWN$3.prototype._serializeValue = function (value) { - return value -}; - -AbstractLevelDOWN$3.prototype._checkKey = function (key) { - if (key === null || key === undefined) { - return new Error('key cannot be `null` or `undefined`') - } else if (isBuffer$g(key) && key.length === 0) { // TODO: replace with typed array check - return new Error('key cannot be an empty Buffer') - } else if (key === '') { - return new Error('key cannot be an empty String') - } else if (Array.isArray(key) && key.length === 0) { - return new Error('key cannot be an empty Array') - } -}; - -AbstractLevelDOWN$3.prototype._checkValue = function (value) { - if (value === null || value === undefined) { - return new Error('value cannot be `null` or `undefined`') - } -}; - -// TODO: docs and tests -AbstractLevelDOWN$3.prototype.isOperational = function () { - return this.status === 'open' || this._isOperational() -}; - -// Implementation may accept operations in other states too -AbstractLevelDOWN$3.prototype._isOperational = function () { - return false -}; - -// Expose browser-compatible nextTick for dependents -// TODO: rename _nextTick to _queueMicrotask -// TODO: after we drop node 10, also use queueMicrotask in node -AbstractLevelDOWN$3.prototype._nextTick = nextTick$3; - -var abstractLeveldown = AbstractLevelDOWN$3; - -function maybeError$1 (db, callback) { - if (!db.isOperational()) { - db._nextTick(callback, new Error('Database is not open')); - return true - } - - return false -} - -abstractLeveldown$1.AbstractLevelDOWN = abstractLeveldown; -abstractLeveldown$1.AbstractIterator = abstractIterator; -abstractLeveldown$1.AbstractChainedBatch = abstractChainedBatch; - -var inherits$9 = {exports: {}}; - -var inherits_browser = {exports: {}}; - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - inherits_browser.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; -} else { - // old school shim for old browsers - inherits_browser.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; -} - -try { - var util$D = require('util'); - /* istanbul ignore next */ - if (typeof util$D.inherits !== 'function') throw ''; - inherits$9.exports = util$D.inherits; -} catch (e) { - /* istanbul ignore next */ - inherits$9.exports = inherits_browser.exports; -} - -var util$C = {}; - -util$C.getCallback = function (args, symbol, map) { - let callback = args[args.length - 1]; - - if (typeof callback !== 'function') { - const promise = new Promise((resolve, reject) => { - args.push(callback = function (err, ...results) { - if (err) reject(err); - else resolve(map ? map(...results) : results[0]); - }); - }); - - callback[symbol] = promise; - } - - return callback -}; - -const { AbstractIterator: AbstractIterator$2 } = abstractLeveldown$1; -const inherits$8 = inherits$9.exports; -const getCallback$3 = util$C.getCallback; - -const kOptions = Symbol('options'); -const kIterator = Symbol('iterator'); -const kOperations$2 = Symbol('operations'); -const kPromise$1 = Symbol('promise'); - -function DeferredIterator$1 (db, options) { - AbstractIterator$2.call(this, db); - - this[kOptions] = options; - this[kIterator] = null; - this[kOperations$2] = []; -} - -inherits$8(DeferredIterator$1, AbstractIterator$2); - -DeferredIterator$1.prototype.setDb = function (db) { - this[kIterator] = db.iterator(this[kOptions]); - - for (const op of this[kOperations$2].splice(0, this[kOperations$2].length)) { - this[kIterator][op.method](...op.args); - } -}; - -DeferredIterator$1.prototype.next = function (...args) { - if (this.db.status === 'open') { - return this[kIterator].next(...args) - } - - const callback = getCallback$3(args, kPromise$1, function map (key, value) { - if (key === undefined && value === undefined) { - return undefined - } else { - return [key, value] - } - }); - - if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'next', args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise$1] || this -}; - -DeferredIterator$1.prototype.seek = function (...args) { - if (this.db.status === 'open') { - this[kIterator].seek(...args); - } else if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'seek', args }); - } else { - throw new Error('Database is not open') - } -}; - -DeferredIterator$1.prototype.end = function (...args) { - if (this.db.status === 'open') { - return this[kIterator].end(...args) - } - - const callback = getCallback$3(args, kPromise$1); - - if (this.db.status === 'opening') { - this[kOperations$2].push({ method: 'end', args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise$1] || this -}; - -for (const method of ['next', 'seek', 'end']) { - DeferredIterator$1.prototype['_' + method] = function () { - /* istanbul ignore next: assertion */ - throw new Error('Did not expect private method to be called: ' + method) - }; -} - -var deferredIterator = DeferredIterator$1; - -const { AbstractChainedBatch: AbstractChainedBatch$2 } = abstractLeveldown$1; -const kOperations$1 = Symbol('operations'); - -var deferredChainedBatch = class DeferredChainedBatch extends AbstractChainedBatch$2 { - constructor (db) { - super(db); - this[kOperations$1] = []; - } - - _put (key, value, options) { - this[kOperations$1].push({ ...options, type: 'put', key, value }); - } - - _del (key, options) { - this[kOperations$1].push({ ...options, type: 'del', key }); - } - - _clear () { - this[kOperations$1] = []; - } - - _write (options, callback) { - // AbstractChainedBatch would call _batch(), we call batch() - this.db.batch(this[kOperations$1], options, callback); - } -}; - -const { AbstractLevelDOWN: AbstractLevelDOWN$2 } = abstractLeveldown$1; -const inherits$7 = inherits$9.exports; -const DeferredIterator = deferredIterator; -const DeferredChainedBatch = deferredChainedBatch; -const getCallback$2 = util$C.getCallback; - -const deferrables = ['put', 'get', 'getMany', 'del', 'batch', 'clear']; -const optionalDeferrables = ['approximateSize', 'compactRange']; - -const kInnerDb = Symbol('innerDb'); -const kOperations = Symbol('operations'); -const kPromise = Symbol('promise'); - -function DeferredLevelDOWN$1 (db) { - AbstractLevelDOWN$2.call(this, db.supports || {}); - - // TODO (future major): remove this fallback; db must have manifest that - // declares approximateSize and compactRange in additionalMethods. - for (const m of optionalDeferrables) { - if (typeof db[m] === 'function' && !this.supports.additionalMethods[m]) { - this.supports.additionalMethods[m] = true; - } - } - - this[kInnerDb] = db; - this[kOperations] = []; - - implement(this); -} - -inherits$7(DeferredLevelDOWN$1, AbstractLevelDOWN$2); - -DeferredLevelDOWN$1.prototype.type = 'deferred-leveldown'; - -// Backwards compatibility for reachdown and subleveldown -Object.defineProperty(DeferredLevelDOWN$1.prototype, '_db', { - enumerable: true, - get () { - return this[kInnerDb] - } -}); - -DeferredLevelDOWN$1.prototype._open = function (options, callback) { - const onopen = (err) => { - if (err || this[kInnerDb].status !== 'open') { - // TODO: reject scheduled operations - return callback(err || new Error('Database is not open')) - } - - const operations = this[kOperations]; - this[kOperations] = []; - - for (const op of operations) { - if (op.iterator) { - op.iterator.setDb(this[kInnerDb]); - } else { - this[kInnerDb][op.method](...op.args); - } - } - - /* istanbul ignore if: assertion */ - if (this[kOperations].length > 0) { - throw new Error('Did not expect further operations') - } - - callback(); - }; - - if (this[kInnerDb].status === 'new' || this[kInnerDb].status === 'closed') { - this[kInnerDb].open(options, onopen); - } else { - this._nextTick(onopen); - } -}; - -DeferredLevelDOWN$1.prototype._close = function (callback) { - this[kInnerDb].close(callback); -}; - -DeferredLevelDOWN$1.prototype._isOperational = function () { - return this.status === 'opening' -}; - -function implement (self) { - const additionalMethods = Object.keys(self.supports.additionalMethods); - - for (const method of deferrables.concat(additionalMethods)) { - // Override the public rather than private methods to cover cases where abstract-leveldown - // has a fast-path like on db.batch([]) which bypasses _batch() because the array is empty. - self[method] = function (...args) { - if (method === 'batch' && args.length === 0) { - return new DeferredChainedBatch(this) - } else if (this.status === 'open') { - return this[kInnerDb][method](...args) - } - - const callback = getCallback$2(args, kPromise); - - if (this.status === 'opening') { - this[kOperations].push({ method, args }); - } else { - this._nextTick(callback, new Error('Database is not open')); - } - - return callback[kPromise] - }; - } - - self.iterator = function (options) { - if (this.status === 'open') { - return this[kInnerDb].iterator(options) - } else if (this.status === 'opening') { - const iterator = new DeferredIterator(this, options); - this[kOperations].push({ iterator }); - return iterator - } else { - throw new Error('Database is not open') - } - }; - - for (const method of deferrables.concat(['iterator'])) { - self['_' + method] = function () { - /* istanbul ignore next: assertion */ - throw new Error('Did not expect private method to be called: ' + method) - }; - } -} - -deferredLeveldown.exports = DeferredLevelDOWN$1; -deferredLeveldown.exports.DeferredIterator = DeferredIterator; - -var readable = {exports: {}}; - -var stream$2 = require$$2$2; - -function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } - -function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var _require$2 = require$$0$6, - Buffer$7 = _require$2.Buffer; - -var _require2 = require$$0$7, - inspect$5 = _require2.inspect; - -var custom$9 = inspect$5 && inspect$5.custom || 'inspect'; - -function copyBuffer(src, target, offset) { - Buffer$7.prototype.copy.call(src, target, offset); -} - -var buffer_list = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck$1(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass$1(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer$7.alloc(0); - var ret = Buffer$7.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer$7.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom$9, - value: function value(_, options) { - return inspect$5(this, _objectSpread$1({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; -}(); - -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - - if (this._readableState) { - this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - - - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - - return this; -} - -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} - -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -function errorOrDestroy$2(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} - -var destroy_1 = { - destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy$2 -}; - -var errors$6 = {}; - -const codes$4 = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes$4[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -errors$6.codes = codes$4; - -var ERR_INVALID_OPT_VALUE = errors$6.codes.ERR_INVALID_OPT_VALUE; - -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} - -function getHighWaterMark$2(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; -} - -var state$1 = { - getHighWaterMark: getHighWaterMark$2 -}; - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -var node$4 = require$$0$7.deprecate; - -var _stream_writable = Writable$1; -// there will be only 2 of these for each stream - - -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ - - -var Duplex$3; -/**/ - -Writable$1.WritableState = WritableState; -/**/ - -var internalUtil = { - deprecate: node$4 -}; -/**/ - -/**/ - -var Stream$4 = stream$2; -/**/ - - -var Buffer$6 = require$$0$6.Buffer; - -var OurUint8Array$1 = commonjsGlobal.Uint8Array || function () {}; - -function _uint8ArrayToBuffer$1(chunk) { - return Buffer$6.from(chunk); -} - -function _isUint8Array$1(obj) { - return Buffer$6.isBuffer(obj) || obj instanceof OurUint8Array$1; -} - -var destroyImpl$1 = destroy_1; - -var _require$1 = state$1, - getHighWaterMark$1 = _require$1.getHighWaterMark; - -var _require$codes$3 = errors$6.codes, - ERR_INVALID_ARG_TYPE$2 = _require$codes$3.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED$2 = _require$codes$3.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK$1 = _require$codes$3.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes$3.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED$1 = _require$codes$3.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes$3.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes$3.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes$3.ERR_UNKNOWN_ENCODING; - -var errorOrDestroy$1 = destroyImpl$1.errorOrDestroy; - -inherits$9.exports(Writable$1, Stream$4); - -function nop$3() {} - -function WritableState(options, stream, isDuplex) { - Duplex$3 = Duplex$3 || _stream_duplex; - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex$3; // object stream flag to indicate whether or not this stream - // contains buffers or objects. - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - - this.highWaterMark = getHighWaterMark$1(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. - - this.needDrain = false; // at the start of calling end() - - this.ending = false; // when end() has been called, and returned - - this.ended = false; // when 'finish' is emitted - - this.finished = false; // has it been destroyed - - this.destroyed = false; // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - - this.length = 0; // a flag to see when we're in the middle of a write. - - this.writing = false; // when true all writes will be buffered until .uncork() call - - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - - this.sync = true; // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - - this.onwrite = function (er) { - onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - - - this.writecb = null; // the amount that is being written when _write is called. - - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - - this.prefinished = false; // True if the error was already emitted and should not be thrown again - - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - - while (current) { - out.push(current); - current = current.next; - } - - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); // Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. - - -var realHasInstance; - -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable$1, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable$1) return false; - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function realHasInstance(object) { - return object instanceof this; - }; -} - -function Writable$1(options) { - Duplex$3 = Duplex$3 || _stream_duplex; // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex$3; - if (!isDuplex && !realHasInstance.call(Writable$1, this)) return new Writable$1(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. - - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - if (typeof options.writev === 'function') this._writev = options.writev; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } - - Stream$4.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. - - -Writable$1.prototype.pipe = function () { - errorOrDestroy$1(this, new ERR_STREAM_CANNOT_PIPE()); -}; - -function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb - - errorOrDestroy$1(stream, er); - process.nextTick(cb, er); -} // Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. - - -function validChunk(stream, state, chunk, cb) { - var er; - - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE$2('chunk', ['string', 'Buffer'], chunk); - } - - if (er) { - errorOrDestroy$1(stream, er); - process.nextTick(cb, er); - return false; - } - - return true; -} - -Writable$1.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - var isBuf = !state.objectMode && _isUint8Array$1(chunk); - - if (isBuf && !Buffer$6.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer$1(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (typeof cb !== 'function') cb = nop$3; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; -}; - -Writable$1.prototype.cork = function () { - this._writableState.corked++; -}; - -Writable$1.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable$1.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -Object.defineProperty(Writable$1.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer$6.from(chunk, encoding); - } - - return chunk; -} - -Object.defineProperty(Writable$1.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); // if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. - -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED$1('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen - // after error - - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy$1(stream, er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy$1(stream, er); // this can emit finish, but finish must - // always follow error - - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK$1(); - onwriteStateUpdate(state); - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} // Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. - - -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} // if there's something in the buffer waiting, then process it - - -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - - state.pendingcb++; - state.lastBufferedRequest = null; - - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable$1.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED$2('_write()')); -}; - -Writable$1.prototype._writev = null; - -Writable$1.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks - - if (state.corked) { - state.corked = 1; - this.uncork(); - } // ignore unnecessary end() calls. - - - if (!state.ending) endWritable(this, state, cb); - return this; -}; - -Object.defineProperty(Writable$1.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - - if (err) { - errorOrDestroy$1(stream, err); - } - - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} - -function prefinish$1(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - - if (need) { - prefinish$1(stream, state); - - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); - } - - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; -} - -Object.defineProperty(Writable$1.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === undefined) { - return false; - } - - return this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._writableState.destroyed = value; - } -}); -Writable$1.prototype.destroy = destroyImpl$1.destroy; -Writable$1.prototype._undestroy = destroyImpl$1.undestroy; - -Writable$1.prototype._destroy = function (err, cb) { - cb(err); -}; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - - for (var key in obj) { - keys.push(key); - } - - return keys; -}; -/**/ - - -var _stream_duplex = Duplex$2; - -var Readable$2 = _stream_readable; - -var Writable = _stream_writable; - -inherits$9.exports(Duplex$2, Readable$2); - -{ - // Allow the keys array to be GC'ed. - var keys = objectKeys(Writable.prototype); - - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex$2.prototype[method]) Duplex$2.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex$2(options) { - if (!(this instanceof Duplex$2)) return new Duplex$2(options); - Readable$2.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; - - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } -} - -Object.defineProperty(Duplex$2.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } -}); -Object.defineProperty(Duplex$2.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex$2.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer - -function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. - - process.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex$2.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -var ERR_STREAM_PREMATURE_CLOSE = errors$6.codes.ERR_STREAM_PREMATURE_CLOSE; - -function once$1(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; -} - -function noop$1() {} - -function isRequest$1(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function eos$1(stream, opts, callback) { - if (typeof opts === 'function') return eos$1(stream, null, opts); - if (!opts) opts = {}; - callback = once$1(callback || noop$1); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest$1(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} - -var endOfStream = eos$1; - -var _Object$setPrototypeO; - -function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var finished = endOfStream; - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} - -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} - -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} - -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} - -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty$1(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty$1(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator$1 = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty$1(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty$1(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty$1(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty$1(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; - -var async_iterator = createReadableStreamAsyncIterator$1; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$g(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var ERR_INVALID_ARG_TYPE$1 = errors$6.codes.ERR_INVALID_ARG_TYPE; - -function from$1(Readable, iterable, opts) { - var iterator; - - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE$1('iterable', ['Iterable'], iterable); - - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); // Reading boolean to protect against _read - // being called before last iteration completion. - - var reading = false; - - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - - function next() { - return _next2.apply(this, arguments); - } - - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), - value = _ref.value, - done = _ref.done; - - if (done) { - readable.push(null); - } else if (readable.push((yield value))) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - - return readable; -} - -var from_1 = from$1; - -var _stream_readable = Readable$1; -/**/ - -var Duplex$1; -/**/ - -Readable$1.ReadableState = ReadableState; -/**/ - -require$$1$4.EventEmitter; - -var EElistenerCount = function EElistenerCount(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ - - -var Stream$3 = stream$2; -/**/ - - -var Buffer$5 = require$$0$6.Buffer; - -var OurUint8Array = commonjsGlobal.Uint8Array || function () {}; - -function _uint8ArrayToBuffer(chunk) { - return Buffer$5.from(chunk); -} - -function _isUint8Array(obj) { - return Buffer$5.isBuffer(obj) || obj instanceof OurUint8Array; -} -/**/ - - -var debugUtil = require$$0$7; - -var debug; - -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function debug() {}; -} -/**/ - - -var BufferList = buffer_list; - -var destroyImpl = destroy_1; - -var _require = state$1, - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes$2 = errors$6.codes, - ERR_INVALID_ARG_TYPE = _require$codes$2.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes$2.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED$1 = _require$codes$2.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes$2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - -var StringDecoder$3; -var createReadableStreamAsyncIterator; -var from; - -inherits$9.exports(Readable$1, Stream$3); - -var errorOrDestroy = destroyImpl.errorOrDestroy; -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream, isDuplex) { - Duplex$1 = Duplex$1 || _stream_duplex; - options = options || {}; // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex$1; // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - - this.sync = true; // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') - - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled - - this.readingMore = false; - this.decoder = null; - this.encoding = null; - - if (options.encoding) { - if (!StringDecoder$3) StringDecoder$3 = require$$10$1.StringDecoder; - this.decoder = new StringDecoder$3(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable$1(options) { - Duplex$1 = Duplex$1 || _stream_duplex; - if (!(this instanceof Readable$1)) return new Readable$1(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - - var isDuplex = this instanceof Duplex$1; - this._readableState = new ReadableState(options, this, isDuplex); // legacy - - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream$3.call(this); -} - -Object.defineProperty(Readable$1.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === undefined) { - return false; - } - - return this._readableState.destroyed; - }, - set: function set(value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } // backward compatibility, the user is explicitly - // managing destroyed - - - this._readableState.destroyed = value; - } -}); -Readable$1.prototype.destroy = destroyImpl.destroy; -Readable$1.prototype._undestroy = destroyImpl.undestroy; - -Readable$1.prototype._destroy = function (err, cb) { - cb(err); -}; // Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. - - -Readable$1.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - - if (encoding !== state.encoding) { - chunk = Buffer$5.from(chunk, encoding); - encoding = ''; - } - - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() - - -Readable$1.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); - var state = stream._readableState; - - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$5.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - - - return !state.ended && (state.length < state.highWaterMark || state.length === 0); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit('data', chunk); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (state.needReadable) emitReadable(stream); - } - - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); - } - - return er; -} - -Readable$1.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; // backwards compatibility. - - -Readable$1.prototype.setEncoding = function (enc) { - if (!StringDecoder$3) StringDecoder$3 = require$$10$1.StringDecoder; - var decoder = new StringDecoder$3(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; -}; // Don't raise the hwm > 1GB - - -var MAX_HWM = 0x40000000; - -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - - return n; -} // This function is designed to be inlinable, so please take care when making -// changes to the function body. - - -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - - if (!state.ended) { - state.needReadable = true; - return 0; - } - - return state.length; -} // you can override either this method, or the async _read(n) below. - - -Readable$1.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. - - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - - - var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some - - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - - - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - - this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - return ret; -}; - -function onEofChunk(stream, state) { - debug('onEofChunk'); - if (state.ended) return; - - if (state.decoder) { - var chunk = state.decoder.end(); - - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - - state.ended = true; - - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; - - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} // Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. - - -function emitReadable(stream) { - var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); - state.needReadable = false; - - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } -} - -function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); -} // at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. - - -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; - } - - state.readingMore = false; -} // abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. - - -Readable$1.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED$1('_read()')); -}; - -Readable$1.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - - case 1: - state.pipes = [state.pipes, dest]; - break; - - default: - state.pipes.push(dest); - break; - } - - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); - - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - - - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - var cleanedUp = false; - - function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; - } - - src.pause(); - } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - - - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - - - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. - - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - - dest.once('close', onclose); - - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } // tell the dest that it's being piped to - - - dest.emit('pipe', src); // start the flow if it hasn't been started already. - - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable$1.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. - - if (state.pipesCount === 0) return this; // just one destination. most common case. - - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. - - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } // slow case. multiple pipe destinations. - - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - - - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - dest.emit('unpipe', this, unpipeInfo); - return this; -}; // set up data events if they are asked for -// Ensure readable listeners eventually get something - - -Readable$1.prototype.on = function (ev, fn) { - var res = Stream$3.prototype.on.call(this, ev, fn); - var state = this._readableState; - - if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); - } else if (ev === 'readable') { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - - return res; -}; - -Readable$1.prototype.addListener = Readable$1.prototype.on; - -Readable$1.prototype.removeListener = function (ev, fn) { - var res = Stream$3.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -Readable$1.prototype.removeAllListeners = function (ev) { - var res = Stream$3.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} // pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. - - -Readable$1.prototype.resume = function () { - var state = this._readableState; - - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; - resume(this, state); - } - - state.paused = false; - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - debug('resume', state.reading); - - if (!state.reading) { - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable$1.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - - this._readableState.paused = true; - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - - while (state.flowing && stream.read() !== null) { - } -} // wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. - - -Readable$1.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - stream.on('end', function () { - debug('wrapped end'); - - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode - - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - - if (!ret) { - paused = true; - stream.pause(); - } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. - - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } // proxy certain important events. - - - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - - - this._read = function (n) { - debug('wrapped _read', n); - - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -if (typeof Symbol === 'function') { - Readable$1.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = async_iterator; - } - - return createReadableStreamAsyncIterator(this); - }; -} - -Object.defineProperty(Readable$1.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } -}); -Object.defineProperty(Readable$1.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable$1.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. - -Readable$1._fromList = fromList; -Object.defineProperty(Readable$1.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. - -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = state.buffer.consume(n, state.decoder); - } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - debug('endReadable', state.endEmitted); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } -} - -if (typeof Symbol === 'function') { - Readable$1.from = function (iterable, opts) { - if (from === undefined) { - from = from_1; - } - - return from(Readable$1, iterable, opts); - }; -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - - return -1; -} - -var _stream_transform = Transform$1; - -var _require$codes$1 = errors$6.codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes$1.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes$1.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0; - -var Duplex = _stream_duplex; - -inherits$9.exports(Transform$1, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); - } - - ts.writechunk = null; - ts.writecb = null; - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform$1(options) { - if (!(this instanceof Transform$1)) return new Transform$1(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; // start out asking for a readable event once data is transformed. - - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. - - - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function' && !this._readableState.destroyed) { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform$1.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; // This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. - - -Transform$1.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); -}; - -Transform$1.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; // Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. - - -Transform$1.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform$1.prototype._destroy = function (err, cb) { - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); -} - -var _stream_passthrough = PassThrough; - -var Transform = _stream_transform; - -inherits$9.exports(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; - -var eos; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} - -var _require$codes = errors$6.codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = endOfStream; - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} - -function call$2(fn) { - fn(); -} - -function pipe(from, to) { - return from.pipe(to); -} - -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} - -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call$2); - if (reading) return; - destroys.forEach(call$2); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -var pipeline_1 = pipeline; - -(function (module, exports) { -var Stream = require$$2$2; -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; -} else { - exports = module.exports = _stream_readable; - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = _stream_writable; - exports.Duplex = _stream_duplex; - exports.Transform = _stream_transform; - exports.PassThrough = _stream_passthrough; - exports.finished = endOfStream; - exports.pipeline = pipeline_1; -} -}(readable, readable.exports)); - -const inherits$6 = inherits$9.exports; -const { Readable } = readable.exports; - -var levelIteratorStream = ReadStream; -inherits$6(ReadStream, Readable); - -function ReadStream (iterator, options) { - if (!(this instanceof ReadStream)) return new ReadStream(iterator, options) - options = options || {}; - Readable.call(this, Object.assign({}, options, { - objectMode: true - })); - this._iterator = iterator; - this._options = options; - this.on('end', this.destroy.bind(this, null, null)); -} - -ReadStream.prototype._read = function () { - if (this.destroyed) return - - this._iterator.next((err, key, value) => { - if (this.destroyed) return - if (err) return this.destroy(err) - - if (key === undefined && value === undefined) { - this.push(null); - } else if (this._options.keys !== false && this._options.values === false) { - this.push(key); - } else if (this._options.keys === false && this._options.values !== false) { - this.push(value); - } else { - this.push({ key, value }); - } - }); -}; - -ReadStream.prototype._destroy = function (err, callback) { - this._iterator.end(function (err2) { - callback(err || err2); - }); -}; - -var errors$5 = {exports: {}}; - -(function (module) { - -function createError (type, Proto) { - const Err = function (message, cause) { - if (typeof message === 'object' && message !== null) { - // Can be passed just a cause - cause = cause || message; - message = message.message || message.name; - } - - message = message || ''; - cause = cause || undefined; - - // If input is already of type, return as-is to keep its stack trace. - // Avoid instanceof, for when node_modules has multiple copies of level-errors. - if (typeof cause === 'object' && cause.type === type && cause.message === message) { - return cause - } - - Object.defineProperty(this, 'type', { value: type, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'name', { value: type, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'cause', { value: cause, enumerable: false, writable: true, configurable: true }); - Object.defineProperty(this, 'message', { value: message, enumerable: false, writable: true, configurable: true }); - - Error.call(this); - - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, Err); - } - }; - - Err.prototype = new Proto(); - return Err -} - -const LevelUPError = createError('LevelUPError', Error); - -module.exports = { - LevelUPError: LevelUPError, - InitializationError: createError('InitializationError', LevelUPError), - OpenError: createError('OpenError', LevelUPError), - ReadError: createError('ReadError', LevelUPError), - WriteError: createError('WriteError', LevelUPError), - NotFoundError: createError('NotFoundError', LevelUPError), - EncodingError: createError('EncodingError', LevelUPError) -}; - -module.exports.NotFoundError.prototype.notFound = true; -module.exports.NotFoundError.prototype.status = 404; -}(errors$5)); - -var common$z = {}; - -common$z.getCallback = function (options, callback) { - return typeof options === 'function' ? options : callback -}; - -common$z.getOptions = function (options) { - return typeof options === 'object' && options !== null ? options : {} -}; - -const WriteError$1 = errors$5.exports.WriteError; -const catering$1 = catering$3; -const getCallback$1 = common$z.getCallback; -const getOptions$1 = common$z.getOptions; - -function Batch$5 (levelup) { - this.db = levelup; - this.batch = levelup.db.batch(); - this.ops = []; - this.length = 0; -} - -Batch$5.prototype.put = function (key, value, options) { - try { - this.batch.put(key, value, options); - } catch (e) { - throw new WriteError$1(e) - } - - this.ops.push({ ...options, type: 'put', key, value }); - this.length++; - - return this -}; - -Batch$5.prototype.del = function (key, options) { - try { - this.batch.del(key, options); - } catch (err) { - throw new WriteError$1(err) - } - - this.ops.push({ ...options, type: 'del', key }); - this.length++; - - return this -}; - -Batch$5.prototype.clear = function () { - try { - this.batch.clear(); - } catch (err) { - throw new WriteError$1(err) - } - - this.ops = []; - this.length = 0; - - return this -}; - -Batch$5.prototype.write = function (options, callback) { - const levelup = this.db; - const ops = this.ops; - - callback = getCallback$1(options, callback); - callback = catering$1.fromCallback(callback); - options = getOptions$1(options); - - try { - this.batch.write(options, function (err) { - if (err) { return callback(new WriteError$1(err)) } - levelup.emit('batch', ops); - callback(); - }); - } catch (err) { - throw new WriteError$1(err) - } - - return callback.promise -}; - -var batch = Batch$5; - -var nextTick$2 = process.nextTick; - -const EventEmitter$u = require$$1$4.EventEmitter; -const inherits$5 = require$$0$7.inherits; -const DeferredLevelDOWN = deferredLeveldown.exports; -const IteratorStream = levelIteratorStream; -const Batch$4 = batch; -const errors$4 = errors$5.exports; -const supports = levelSupports; -const catering = catering$3; -const getCallback = common$z.getCallback; -const getOptions = common$z.getOptions; - -// TODO: after we drop node 10, also use queueMicrotask() in node -const nextTick$1 = nextTick$2; - -const WriteError = errors$4.WriteError; -const ReadError = errors$4.ReadError; -const NotFoundError = errors$4.NotFoundError; -const OpenError = errors$4.OpenError; -const InitializationError = errors$4.InitializationError; - -function LevelUP (db, options, callback) { - if (!(this instanceof LevelUP)) { - return new LevelUP(db, options, callback) - } - - let error; - - EventEmitter$u.call(this); - this.setMaxListeners(Infinity); - - if (typeof options === 'function') { - callback = options; - options = {}; - } - - options = options || {}; - - if (!db || typeof db !== 'object') { - error = new InitializationError('First argument must be an abstract-leveldown compliant store'); - if (typeof callback === 'function') { - return nextTick$1(callback, error) - } - throw error - } - - if (typeof db.status !== 'string') { - throw new Error('.status required, old abstract-leveldown') - } - - this.options = getOptions(options); - this._db = db; - this.db = null; - this.open(callback || ((err) => { - if (err) this.emit('error', err); - })); - - // Create manifest based on deferred-leveldown's - this.supports = supports(this.db.supports, { - status: true, - deferredOpen: true, - openCallback: true, - promises: true, - streams: true - }); - - // Experimental: enrich levelup interface - for (const method of Object.keys(this.supports.additionalMethods)) { - if (this[method] != null) continue - - // Don't do this.db[method].bind() because this.db is dynamic. - this[method] = function (...args) { - return this.db[method](...args) - }; - } -} - -LevelUP.prototype.emit = EventEmitter$u.prototype.emit; -LevelUP.prototype.once = EventEmitter$u.prototype.once; -inherits$5(LevelUP, EventEmitter$u); - -// TODO: tests -Object.defineProperty(LevelUP.prototype, 'status', { - enumerable: true, - get () { - return this.db.status - } -}); - -// TODO: tests -LevelUP.prototype.isOperational = function () { - return this.db.status === 'open' || this.db.status === 'opening' -}; - -LevelUP.prototype.open = function (opts, callback) { - if (typeof opts === 'function') { - callback = opts; - opts = null; - } - - callback = catering.fromCallback(callback); - - if (!opts) { - opts = this.options; - } - - // 1) Don't check db.status until levelup has opened, - // in order for levelup events to be consistent - if (this.db && this.isOpen()) { - nextTick$1(callback, null, this); - return callback.promise - } - - if (this.db && this._isOpening()) { - this.once('open', () => { callback(null, this); }); - return callback.promise - } - - // 2) Instead let deferred-leveldown handle already-open cases. - // TODO: ideally though, levelup would have its own status - this.db = new DeferredLevelDOWN(this._db); - this.emit('opening'); - - this.db.open(opts, (err) => { - if (err) { - return callback(new OpenError(err)) - } - this.db = this._db; - callback(null, this); - this.emit('open'); - this.emit('ready'); - }); - - return callback.promise -}; - -LevelUP.prototype.close = function (callback) { - callback = catering.fromCallback(callback); - - if (this.isOpen()) { - this.db.close((err, ...rest) => { - this.emit('closed'); - callback(err, ...rest); - }); - this.emit('closing'); - } else if (this.isClosed()) { - nextTick$1(callback); - } else if (this.db.status === 'closing') { - this.once('closed', callback); - } else if (this._isOpening()) { - this.once('open', () => { - this.close(callback); - }); - } - - return callback.promise -}; - -// TODO: remove in future major -LevelUP.prototype.isOpen = function () { - return this.db.status === 'open' -}; - -// TODO: remove in future major -LevelUP.prototype._isOpening = function () { - return this.db.status === 'opening' -}; - -// TODO: remove in future major -LevelUP.prototype.isClosed = function () { - return (/^clos|new/).test(this.db.status) -}; - -LevelUP.prototype.get = function (key, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.get(key, options, function (err, value) { - if (err) { - if ((/notfound/i).test(err) || err.notFound) { - err = new NotFoundError('Key not found in database [' + key + ']', err); - } else { - err = new ReadError(err); - } - return callback(err) - } - callback(null, value); - }); - - return callback.promise -}; - -LevelUP.prototype.getMany = function (keys, options, callback) { - return this.db.getMany(keys, options, callback) -}; - -LevelUP.prototype.put = function (key, value, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.put(key, value, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('put', key, value); - callback(); - }); - - return callback.promise -}; - -LevelUP.prototype.del = function (key, options, callback) { - callback = getCallback(options, callback); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.del(key, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('del', key); - callback(); - }); - - return callback.promise -}; - -LevelUP.prototype.batch = function (arr, options, callback) { - if (!arguments.length) { - return new Batch$4(this) - } - - if (typeof arr === 'function') callback = arr; - else callback = getCallback(options, callback); - - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - options = getOptions(options); - - this.db.batch(arr, options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('batch', arr); - callback(); - }); - - return callback.promise -}; - -LevelUP.prototype.iterator = function (options) { - return this.db.iterator(options) -}; - -LevelUP.prototype.clear = function (options, callback) { - callback = getCallback(options, callback); - options = getOptions(options); - callback = catering.fromCallback(callback); - - if (maybeError(this, callback)) { - return callback.promise - } - - this.db.clear(options, (err) => { - if (err) { - return callback(new WriteError(err)) - } - this.emit('clear', options); - callback(); - }); - - return callback.promise -}; - -LevelUP.prototype.readStream = -LevelUP.prototype.createReadStream = function (options) { - options = Object.assign({ keys: true, values: true }, options); - if (typeof options.limit !== 'number') { options.limit = -1; } - return new IteratorStream(this.db.iterator(options), options) -}; - -LevelUP.prototype.keyStream = -LevelUP.prototype.createKeyStream = function (options) { - return this.createReadStream(Object.assign({}, options, { keys: true, values: false })) -}; - -LevelUP.prototype.valueStream = -LevelUP.prototype.createValueStream = function (options) { - return this.createReadStream(Object.assign({}, options, { keys: false, values: true })) -}; - -LevelUP.prototype.toString = function () { - return 'LevelUP' -}; - -LevelUP.prototype.type = 'levelup'; - -// Expose nextTick for API parity with abstract-leveldown -LevelUP.prototype._nextTick = nextTick$1; - -function maybeError (db, callback) { - if (!db.isOperational()) { - nextTick$1(callback, new ReadError('Database is not open')); - return true - } - - return false -} - -LevelUP.errors = errors$4; -var levelup$1 = LevelUP; - -var encodings$1 = {}; - -(function (exports) { - -const { Buffer } = require$$0$6; - -exports.utf8 = exports['utf-8'] = { - encode: function (data) { - return isBinary(data) ? data : String(data) - }, - decode: identity, - buffer: false, - type: 'utf8' -}; - -exports.json = { - encode: JSON.stringify, - decode: JSON.parse, - buffer: false, - type: 'json' -}; - -exports.binary = { - encode: function (data) { - return isBinary(data) ? data : Buffer.from(data) - }, - decode: identity, - buffer: true, - type: 'binary' -}; - -exports.none = { - encode: identity, - decode: identity, - buffer: false, - type: 'id' -}; - -exports.id = exports.none; - -const bufferEncodings = [ - 'hex', - 'ascii', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le' -]; - -for (const type of bufferEncodings) { - exports[type] = { - encode: function (data) { - return isBinary(data) ? data : Buffer.from(data, type) - }, - decode: function (buffer) { - return buffer.toString(type) - }, - buffer: true, - type: type - }; -} - -function identity (value) { - return value -} - -function isBinary (data) { - return data === undefined || data === null || Buffer.isBuffer(data) -} -}(encodings$1)); - -const encodings = encodings$1; -const rangeOptions = new Set(['lt', 'gt', 'lte', 'gte']); - -var levelCodec = Codec$3; - -function Codec$3 (opts) { - if (!(this instanceof Codec$3)) { - return new Codec$3(opts) - } - this.opts = opts || {}; - this.encodings = encodings; -} - -Codec$3.prototype._encoding = function (encoding) { - if (typeof encoding === 'string') encoding = encodings[encoding]; - if (!encoding) encoding = encodings.id; - return encoding -}; - -Codec$3.prototype._keyEncoding = function (opts, batchOpts) { - return this._encoding((batchOpts && batchOpts.keyEncoding) || - (opts && opts.keyEncoding) || - this.opts.keyEncoding) -}; - -Codec$3.prototype._valueEncoding = function (opts, batchOpts) { - return this._encoding((batchOpts && (batchOpts.valueEncoding || batchOpts.encoding)) || - (opts && (opts.valueEncoding || opts.encoding)) || - (this.opts.valueEncoding || this.opts.encoding)) -}; - -Codec$3.prototype.encodeKey = function (key, opts, batchOpts) { - return this._keyEncoding(opts, batchOpts).encode(key) -}; - -Codec$3.prototype.encodeValue = function (value, opts, batchOpts) { - return this._valueEncoding(opts, batchOpts).encode(value) -}; - -Codec$3.prototype.decodeKey = function (key, opts) { - return this._keyEncoding(opts).decode(key) -}; - -Codec$3.prototype.decodeValue = function (value, opts) { - return this._valueEncoding(opts).decode(value) -}; - -Codec$3.prototype.encodeBatch = function (ops, opts) { - return ops.map((_op) => { - const op = { - type: _op.type, - key: this.encodeKey(_op.key, opts, _op) - }; - if (this.keyAsBuffer(opts, _op)) op.keyEncoding = 'binary'; - if (_op.prefix) op.prefix = _op.prefix; - if ('value' in _op) { - op.value = this.encodeValue(_op.value, opts, _op); - if (this.valueAsBuffer(opts, _op)) op.valueEncoding = 'binary'; - } - return op - }) -}; - -Codec$3.prototype.encodeLtgt = function (ltgt) { - const ret = {}; - - for (const key of Object.keys(ltgt)) { - if (key === 'start' || key === 'end') { - throw new Error('Legacy range options ("start" and "end") have been removed') - } - - ret[key] = rangeOptions.has(key) - ? this.encodeKey(ltgt[key], ltgt) - : ltgt[key]; - } - - return ret -}; - -Codec$3.prototype.createStreamDecoder = function (opts) { - if (opts.keys && opts.values) { - return (key, value) => { - return { - key: this.decodeKey(key, opts), - value: this.decodeValue(value, opts) - } - } - } else if (opts.keys) { - return (key) => { - return this.decodeKey(key, opts) - } - } else if (opts.values) { - return (_, value) => { - return this.decodeValue(value, opts) - } - } else { - return function () {} - } -}; - -Codec$3.prototype.keyAsBuffer = function (opts) { - return this._keyEncoding(opts).buffer -}; - -Codec$3.prototype.valueAsBuffer = function (opts) { - return this._valueEncoding(opts).buffer -}; - -const AbstractLevelDOWN$1 = abstractLeveldown$1.AbstractLevelDOWN; -const AbstractChainedBatch$1 = abstractLeveldown$1.AbstractChainedBatch; -const AbstractIterator$1 = abstractLeveldown$1.AbstractIterator; -const inherits$4 = inherits$9.exports; -const Codec$2 = levelCodec; -const EncodingError$6 = errors$5.exports.EncodingError; -const rangeMethods = ['approximateSize', 'compactRange']; - -var encodingDown = DB$2; - -function DB$2 (db, opts) { - if (!(this instanceof DB$2)) return new DB$2(db, opts) - - const manifest = db.supports || {}; - const additionalMethods = manifest.additionalMethods || {}; - - AbstractLevelDOWN$1.call(this, manifest); - - this.supports.encodings = true; - this.supports.additionalMethods = {}; - - rangeMethods.forEach(function (m) { - // TODO (future major): remove this fallback - const fallback = typeof db[m] === 'function'; - - if (additionalMethods[m] || fallback) { - this.supports.additionalMethods[m] = true; - - this[m] = function (start, end, opts, cb) { - start = this.codec.encodeKey(start, opts); - end = this.codec.encodeKey(end, opts); - return this.db[m](start, end, opts, cb) - }; - } - }, this); - - opts = opts || {}; - if (typeof opts.keyEncoding === 'undefined') opts.keyEncoding = 'utf8'; - if (typeof opts.valueEncoding === 'undefined') opts.valueEncoding = 'utf8'; - - this.db = db; - this.codec = new Codec$2(opts); -} - -inherits$4(DB$2, AbstractLevelDOWN$1); - -DB$2.prototype.type = 'encoding-down'; - -DB$2.prototype._serializeKey = -DB$2.prototype._serializeValue = function (datum) { - return datum -}; - -DB$2.prototype._open = function (opts, cb) { - this.db.open(opts, cb); -}; - -DB$2.prototype._close = function (cb) { - this.db.close(cb); -}; - -DB$2.prototype._put = function (key, value, opts, cb) { - key = this.codec.encodeKey(key, opts); - value = this.codec.encodeValue(value, opts); - this.db.put(key, value, opts, cb); -}; - -DB$2.prototype._get = function (key, opts, cb) { - key = this.codec.encodeKey(key, opts); - opts.asBuffer = this.codec.valueAsBuffer(opts); - - this.db.get(key, opts, (err, value) => { - if (err) return cb(err) - - try { - value = this.codec.decodeValue(value, opts); - } catch (err) { - return cb(new EncodingError$6(err)) - } - - cb(null, value); - }); -}; - -DB$2.prototype._getMany = function (keys, opts, cb) { - keys = keys.map((key) => this.codec.encodeKey(key, opts)); - opts.asBuffer = this.codec.valueAsBuffer(opts); - - this.db.getMany(keys, opts, (err, values) => { - if (err) return cb(err) - - const decoded = new Array(values.length); - - for (let i = 0; i < values.length; i++) { - if (values[i] === undefined) { - decoded[i] = undefined; - continue - } - - try { - decoded[i] = this.codec.decodeValue(values[i], opts); - } catch (err) { - return cb(new EncodingError$6(err)) - } - } - - cb(null, decoded); - }); -}; - -DB$2.prototype._del = function (key, opts, cb) { - key = this.codec.encodeKey(key, opts); - this.db.del(key, opts, cb); -}; - -DB$2.prototype._chainedBatch = function () { - return new Batch$3(this) -}; - -DB$2.prototype._batch = function (ops, opts, cb) { - ops = this.codec.encodeBatch(ops, opts); - this.db.batch(ops, opts, cb); -}; - -DB$2.prototype._iterator = function (opts) { - opts.keyAsBuffer = this.codec.keyAsBuffer(opts); - opts.valueAsBuffer = this.codec.valueAsBuffer(opts); - return new Iterator$5(this, opts) -}; - -DB$2.prototype._clear = function (opts, callback) { - opts = this.codec.encodeLtgt(opts); - this.db.clear(opts, callback); -}; - -function Iterator$5 (db, opts) { - AbstractIterator$1.call(this, db); - this.codec = db.codec; - this.keys = opts.keys; - this.values = opts.values; - this.opts = this.codec.encodeLtgt(opts); - this.it = db.db.iterator(this.opts); -} - -inherits$4(Iterator$5, AbstractIterator$1); - -Iterator$5.prototype._next = function (cb) { - this.it.next((err, key, value) => { - if (err) return cb(err) - - try { - if (this.keys && typeof key !== 'undefined') { - key = this.codec.decodeKey(key, this.opts); - } else { - key = undefined; - } - - if (this.values && typeof value !== 'undefined') { - value = this.codec.decodeValue(value, this.opts); - } else { - value = undefined; - } - } catch (err) { - return cb(new EncodingError$6(err)) - } - - cb(null, key, value); - }); -}; - -Iterator$5.prototype._seek = function (key) { - key = this.codec.encodeKey(key, this.opts); - this.it.seek(key); -}; - -Iterator$5.prototype._end = function (cb) { - this.it.end(cb); -}; - -function Batch$3 (db, codec) { - AbstractChainedBatch$1.call(this, db); - this.codec = db.codec; - this.batch = db.db.batch(); -} - -inherits$4(Batch$3, AbstractChainedBatch$1); - -Batch$3.prototype._put = function (key, value, options) { - key = this.codec.encodeKey(key, options); - value = this.codec.encodeValue(value, options); - this.batch.put(key, value); -}; - -Batch$3.prototype._del = function (key, options) { - key = this.codec.encodeKey(key, options); - this.batch.del(key); -}; - -Batch$3.prototype._clear = function () { - this.batch.clear(); -}; - -Batch$3.prototype._write = function (opts, cb) { - this.batch.write(opts, cb); -}; - -const levelup = levelup$1; -const encode$7 = encodingDown; - -function packager (leveldown) { - function Level (location, options, callback) { - if (typeof location === 'function') { - callback = location; - } else if (typeof options === 'function') { - callback = options; - } - - if (!isObject(options)) { - options = isObject(location) ? location : {}; - } - - return levelup(encode$7(leveldown(location, options), options), options, callback) - } - - function isObject (o) { - return typeof o === 'object' && o !== null - } - - for (const m of ['destroy', 'repair']) { - if (typeof leveldown[m] === 'function') { - Level[m] = function (...args) { - leveldown[m](...args); - }; - } - } - - Level.errors = levelup.errors; - - return Level -} - -var levelPackager = packager; - -var fs$l = require$$0$5; -var path$g = require$$1$3; -var os$2 = require$$1$5; - -// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression' -var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : commonjsRequire; // eslint-disable-line - -var vars = (process.config && process.config.variables) || {}; -var prebuildsOnly = !!process.env.PREBUILDS_ONLY; -var abi = process.versions.modules; // TODO: support old node where this is undef -var runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node'); - -var arch = os$2.arch(); -var platform = os$2.platform(); -var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc'); -var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''; -var uv = (process.versions.uv || '').split('.')[0]; - -var nodeGypBuild = load$2; - -function load$2 (dir) { - return runtimeRequire(load$2.path(dir)) -} - -load$2.path = function (dir) { - dir = path$g.resolve(dir || '.'); - - try { - var name = runtimeRequire(path$g.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_'); - if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']; - } catch (err) {} - - if (!prebuildsOnly) { - var release = getFirst(path$g.join(dir, 'build/Release'), matchBuild); - if (release) return release - - var debug = getFirst(path$g.join(dir, 'build/Debug'), matchBuild); - if (debug) return debug - } - - var prebuild = resolve(dir); - if (prebuild) return prebuild - - var nearby = resolve(path$g.dirname(process.execPath)); - if (nearby) return nearby - - var target = [ - 'platform=' + platform, - 'arch=' + arch, - 'runtime=' + runtime, - 'abi=' + abi, - 'uv=' + uv, - armv ? 'armv=' + armv : '', - 'libc=' + libc, - 'node=' + process.versions.node, - process.versions.electron ? 'electron=' + process.versions.electron : '', - typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line - ].filter(Boolean).join(' '); - - throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n') - - function resolve (dir) { - // Find matching "prebuilds/-" directory - var tuples = readdirSync$1(path$g.join(dir, 'prebuilds')).map(parseTuple); - var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]; - if (!tuple) return - - // Find most specific flavor first - var prebuilds = path$g.join(dir, 'prebuilds', tuple.name); - var parsed = readdirSync$1(prebuilds).map(parseTags); - var candidates = parsed.filter(matchTags(runtime, abi)); - var winner = candidates.sort(compareTags(runtime))[0]; - if (winner) return path$g.join(prebuilds, winner.file) - } -}; - -function readdirSync$1 (dir) { - try { - return fs$l.readdirSync(dir) - } catch (err) { - return [] - } -} - -function getFirst (dir, filter) { - var files = readdirSync$1(dir).filter(filter); - return files[0] && path$g.join(dir, files[0]) -} - -function matchBuild (name) { - return /\.node$/.test(name) -} - -function parseTuple (name) { - // Example: darwin-x64+arm64 - var arr = name.split('-'); - if (arr.length !== 2) return - - var platform = arr[0]; - var architectures = arr[1].split('+'); - - if (!platform) return - if (!architectures.length) return - if (!architectures.every(Boolean)) return - - return { name, platform, architectures } -} - -function matchTuple (platform, arch) { - return function (tuple) { - if (tuple == null) return false - if (tuple.platform !== platform) return false - return tuple.architectures.includes(arch) - } -} - -function compareTuples (a, b) { - // Prefer single-arch prebuilds over multi-arch - return a.architectures.length - b.architectures.length -} - -function parseTags (file) { - var arr = file.split('.'); - var extension = arr.pop(); - var tags = { file: file, specificity: 0 }; - - if (extension !== 'node') return - - for (var i = 0; i < arr.length; i++) { - var tag = arr[i]; - - if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') { - tags.runtime = tag; - } else if (tag === 'napi') { - tags.napi = true; - } else if (tag.slice(0, 3) === 'abi') { - tags.abi = tag.slice(3); - } else if (tag.slice(0, 2) === 'uv') { - tags.uv = tag.slice(2); - } else if (tag.slice(0, 4) === 'armv') { - tags.armv = tag.slice(4); - } else if (tag === 'glibc' || tag === 'musl') { - tags.libc = tag; - } else { - continue - } - - tags.specificity++; - } - - return tags -} - -function matchTags (runtime, abi) { - return function (tags) { - if (tags == null) return false - if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false - if (tags.abi !== abi && !tags.napi) return false - if (tags.uv && tags.uv !== uv) return false - if (tags.armv && tags.armv !== armv) return false - if (tags.libc && tags.libc !== libc) return false - - return true - } -} - -function runtimeAgnostic (tags) { - return tags.runtime === 'node' && tags.napi -} - -function compareTags (runtime) { - // Precedence: non-agnostic runtime, abi over napi, then by specificity. - return function (a, b) { - if (a.runtime !== b.runtime) { - return a.runtime === runtime ? -1 : 1 - } else if (a.abi !== b.abi) { - return a.abi ? -1 : 1 - } else if (a.specificity !== b.specificity) { - return a.specificity > b.specificity ? -1 : 1 - } else { - return 0 - } - } -} - -function isNwjs () { - return !!(process.versions && process.versions.nw) -} - -function isElectron () { - if (process.versions && process.versions.electron) return true - if (process.env.ELECTRON_RUN_AS_NODE) return true - return typeof window !== 'undefined' && window.process && window.process.type === 'renderer' -} - -function isAlpine (platform) { - return platform === 'linux' && fs$l.existsSync('/etc/alpine-release') -} - -// Exposed for unit tests -// TODO: move to lib -load$2.parseTags = parseTags; -load$2.matchTags = matchTags; -load$2.compareTags = compareTags; -load$2.parseTuple = parseTuple; -load$2.matchTuple = matchTuple; -load$2.compareTuples = compareTuples; - -var binding$k = nodeGypBuild(__dirname); - -const util$B = require$$0$7; -const AbstractChainedBatch = abstractLeveldown$1.AbstractChainedBatch; -const binding$j = binding$k; - -function ChainedBatch$1 (db) { - AbstractChainedBatch.call(this, db); - this.context = binding$j.batch_init(db.context); -} - -ChainedBatch$1.prototype._put = function (key, value) { - binding$j.batch_put(this.context, key, value); -}; - -ChainedBatch$1.prototype._del = function (key) { - binding$j.batch_del(this.context, key); -}; - -ChainedBatch$1.prototype._clear = function () { - binding$j.batch_clear(this.context); -}; - -ChainedBatch$1.prototype._write = function (options, callback) { - binding$j.batch_write(this.context, options, callback); -}; - -util$B.inherits(ChainedBatch$1, AbstractChainedBatch); - -var chainedBatch = ChainedBatch$1; - -const util$A = require$$0$7; -const AbstractIterator = abstractLeveldown$1.AbstractIterator; -const binding$i = binding$k; - -function Iterator$4 (db, options) { - AbstractIterator.call(this, db); - - this.context = binding$i.iterator_init(db.context, options); - this.cache = null; - this.finished = false; -} - -util$A.inherits(Iterator$4, AbstractIterator); - -Iterator$4.prototype._seek = function (target) { - if (target.length === 0) { - throw new Error('cannot seek() to an empty target') - } - - this.cache = null; - binding$i.iterator_seek(this.context, target); - this.finished = false; -}; - -Iterator$4.prototype._next = function (callback) { - if (this.cache && this.cache.length) { - process.nextTick(callback, null, this.cache.pop(), this.cache.pop()); - } else if (this.finished) { - process.nextTick(callback); - } else { - binding$i.iterator_next(this.context, (err, array, finished) => { - if (err) return callback(err) - - this.cache = array; - this.finished = finished; - this._next(callback); - }); - } - - return this -}; - -Iterator$4.prototype._end = function (callback) { - delete this.cache; - binding$i.iterator_end(this.context, callback); -}; - -var iterator = Iterator$4; - -const util$z = require$$0$7; -const AbstractLevelDOWN = abstractLeveldown$1.AbstractLevelDOWN; -const binding$h = binding$k; -const ChainedBatch = chainedBatch; -const Iterator$3 = iterator; - -function LevelDOWN$1 (location) { - if (!(this instanceof LevelDOWN$1)) { - return new LevelDOWN$1(location) - } - - if (typeof location !== 'string') { - throw new Error('constructor requires a location string argument') - } - - AbstractLevelDOWN.call(this, { - bufferKeys: true, - snapshots: true, - permanence: true, - seek: true, - clear: true, - getMany: true, - createIfMissing: true, - errorIfExists: true, - additionalMethods: { - approximateSize: true, - compactRange: true - } - }); - - this.location = location; - this.context = binding$h.db_init(); -} - -util$z.inherits(LevelDOWN$1, AbstractLevelDOWN); - -LevelDOWN$1.prototype._open = function (options, callback) { - binding$h.db_open(this.context, this.location, options, callback); -}; - -LevelDOWN$1.prototype._close = function (callback) { - binding$h.db_close(this.context, callback); -}; - -LevelDOWN$1.prototype._serializeKey = function (key) { - return Buffer.isBuffer(key) ? key : String(key) -}; - -LevelDOWN$1.prototype._serializeValue = function (value) { - return Buffer.isBuffer(value) ? value : String(value) -}; - -LevelDOWN$1.prototype._put = function (key, value, options, callback) { - binding$h.db_put(this.context, key, value, options, callback); -}; - -LevelDOWN$1.prototype._get = function (key, options, callback) { - binding$h.db_get(this.context, key, options, callback); -}; - -LevelDOWN$1.prototype._getMany = function (keys, options, callback) { - binding$h.db_get_many(this.context, keys, options, callback); -}; - -LevelDOWN$1.prototype._del = function (key, options, callback) { - binding$h.db_del(this.context, key, options, callback); -}; - -LevelDOWN$1.prototype._clear = function (options, callback) { - binding$h.db_clear(this.context, options, callback); -}; - -LevelDOWN$1.prototype._chainedBatch = function () { - return new ChainedBatch(this) -}; - -LevelDOWN$1.prototype._batch = function (operations, options, callback) { - binding$h.batch_do(this.context, operations, options, callback); -}; - -LevelDOWN$1.prototype.approximateSize = function (start, end, callback) { - if (start == null || - end == null || - typeof start === 'function' || - typeof end === 'function') { - throw new Error('approximateSize() requires valid `start` and `end` arguments') - } - - if (typeof callback !== 'function') { - throw new Error('approximateSize() requires a callback argument') - } - - start = this._serializeKey(start); - end = this._serializeKey(end); - - binding$h.db_approximate_size(this.context, start, end, callback); -}; - -LevelDOWN$1.prototype.compactRange = function (start, end, callback) { - if (start == null || - end == null || - typeof start === 'function' || - typeof end === 'function') { - throw new Error('compactRange() requires valid `start` and `end` arguments') - } - - if (typeof callback !== 'function') { - throw new Error('compactRange() requires a callback argument') - } - - start = this._serializeKey(start); - end = this._serializeKey(end); - - binding$h.db_compact_range(this.context, start, end, callback); -}; - -LevelDOWN$1.prototype.getProperty = function (property) { - if (typeof property !== 'string') { - throw new Error('getProperty() requires a valid `property` argument') - } - - return binding$h.db_get_property(this.context, property) -}; - -LevelDOWN$1.prototype._iterator = function (options) { - if (this.status !== 'open') { - // Prevent segfault - throw new Error('cannot call iterator() before open()') - } - - return new Iterator$3(this, options) -}; - -LevelDOWN$1.destroy = function (location, callback) { - if (arguments.length < 2) { - throw new Error('destroy() requires `location` and `callback` arguments') - } - if (typeof location !== 'string') { - throw new Error('destroy() requires a location string argument') - } - if (typeof callback !== 'function') { - throw new Error('destroy() requires a callback function argument') - } - - binding$h.destroy_db(location, callback); -}; - -LevelDOWN$1.repair = function (location, callback) { - if (arguments.length < 2) { - throw new Error('repair() requires `location` and `callback` arguments') - } - if (typeof location !== 'string') { - throw new Error('repair() requires a location string argument') - } - if (typeof callback !== 'function') { - throw new Error('repair() requires a callback function argument') - } - - binding$h.repair_db(location, callback); -}; - -var leveldown = LevelDOWN$1; - -var level$4 = levelPackager(leveldown); - -// Dependencies -const level$3 = level$4; -const crypto$k = require$$0$4; -const pointer$3 = jsonPointer$1; - -// Fabric Types -const Actor$e = actor; -const Collection$5 = collection$1; -const Entity$6 = entity; -const Stack$8 = stack$2; - -/** - * Long-term storage. - * @property {Mixed} settings Current configuration. - */ -class Store$4 extends Actor$e { - /** - * Create an instance of a {@link Store} to manage long-term storage, which is - * particularly useful when building a user-facing {@link Product}. - * @param {Object} [settings={}] configuration object. - * @return {Store} Instance of the Store, ready to start. - */ - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - name: '@fabric/store', - path: './stores/store', - type: 'leveldb', - persistent: true, - verbosity: 2, // 0 none, 1 error, 2 warning, 3 notice, 4 debug - }, settings); - - this['@entity'] = { - '@type': 'Store', - '@data': {} - }; - - this.keys = {}; - this.commits = new Collection$5({ - type: 'State' - }); - - this._state = { - actors: {}, - collections: {}, - content: {}, - documents: {}, - metadata: {}, - indices: {}, - routes: {}, - status: 'PAUSED', - tips: {} - }; - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - _getPathForKey (key) { - const path = pointer$3.escape(key); - return this.sha256(path); - } - - async _errorHandler (err) { - console.error('[FABRIC:STORE]', 'Error condition:', err); - } - - async _setEncrypted (path, value, passphrase = '') { - const secret = value; // TODO: encrypt value - const name = crypto$k.createHash('sha256').createHash(path).digest('hex'); - return this.set(`/secrets/${name}`, secret); - } - - async _getEncrypted (path, passphrase = '') { - const name = crypto$k.createHash('sha256').createHash(path).digest('hex'); - const secret = this.get(`/secrets/${name}`); - const decrypted = secret; // TODO: decrypt value - return decrypted; - } - - /** - * Registers an {@link Actor}. Necessary to store in a collection. - * @param {Object} obj Instance of the object to store. - * @return {Vector} Returned from `storage.set` - */ - async _REGISTER (obj) { - const actor = new Actor$e(obj); - await this._GET(`/entities/${actor.id}`); - - store.log('[STORE]', '_REGISTER', vector.id, vector['@type']); - - try { - let item = await this._GET(`/entities/${vector.id}`); - } catch (E) { - this.warn('[STORE]', '_REGISTER', `Could not read from store:`, E); - } - - try { - await this._SET(`/types/${vector.id}`, vector['@type']); - } catch (E) { - this.error('Error creating object:', E, obj); - } - - try { - result = await this._SET(`/entities/${vector.id}`, vector['@data']); - } catch (E) { - this.error('Error creating object:', E, obj); - } - - return result; - } - - async _GET (key) { - let result = null; - - if (this.settings.verbosity >= 5) this.log('[STORE]', '_GET', key); - - try { - result = await this.get(key); - } catch (E) { - if (this.settings.verbosity >= 5) this.warn('[STORE]', '[_GET]', '[FAILURE]', E); - } - - return result; - } - - async _SET (key, value) { - return this.set(key, value); - } - - async _PUT (key, value) { - return this.set(key, value); - } - - async _DELETE (key) { - await this._PUT(key, null); - return null; - } - - async _PATCH (key, patch) { - this.log('[STORE]', '_PATCH', 'patch:', key, typeof patch, patch); - - const root = {}; - const current = await this._GET(key); - - if (this.settings.verbosity >= 3) console.warn('current value, no typecheck:', typeof current, current); - const result = Object.assign(root, current || {}, patch); - if (this.settings.verbosity >= 5) console.log('[STORE]', 'Patch result:', result); - - try { - let action = await this._PUT(key, result); - } catch (E) { - console.error('Could not modify:', E); - } - - return result; - } - - /** - * Insert something into a collection. - * @param {String} key Path to add data to. - * @param {Mixed} value Object to store. - * @return {Promise} Resolves on success with a String pointer. - */ - async _POST (key, value) { - if (this.settings.verbosity >= 5) console.log('[STORE]', '_POST', key, typeof value, value); - - this['@method'] = '_POST'; - - // preamble - let self = this; - let path = pointer$3.escape(key); - let router = this.sha256(path); - let address = `/collections/${router}`; - - if (!this.keys[address]) { - // TODO: store metadata - this.keys[address] = { - path: key, - address: address - }; - } - - // TODO: check for commit state - self['@entity']['@data'].addresses[router] = address; - - let state = new State(value); - let serial = state.serialize(); - this.sha256(serial); - - if (!self.db) { - await self.open().catch(self._errorHandler.bind(self)); - } - - let family = null; - let origin = null; - let entity = null; - - // TODO: use ._GET - try { - entity = await self.db.get(address); - // console.log('loading entity:', entity.toString('utf8')); - } catch (E) { - if (this.settings.verbosity >= 3) console.warn('Creating new collection:', E); - } - - if (entity) { - try { - entity = JSON.parse(entity); - } catch (E) { - console.warn(`Couldn't parse: ${entity}`, E); - } - } - - try { - if (entity) { - family = await self.populate(entity); - if (this.settings.verbosity >= 5) console.warn('WARNING:', 'family exists, expecting restoration:', family); - origin = new Collection$5(family); - } else { - origin = new Collection$5(); - } - - // Add Element to Collection - let height = origin.push(value); - - // Store the object at an entity locale - let object = await self._PUT(`/entities/${state.id}`, value); - let serialized = await origin.serialize(); - - // Write serialized Collection to disk - let answer = await self.db.put(address, serialized.toString()); - } catch (E) { - console.log('Could not POST:', key, value, E); - return false; - } - - return state.link; - } - - async _PUSH (key, data) { - let id = pointer$3.escape(key); - let path = `/stacks/${id}`; - let list = await this._GET(path); - if (!list) list = []; - let vector = new State(data); - let stack = new Stack$8(list); - stack.push(vector.id); - await this._REGISTER(data); - await this._PUT(`/blobs/${vector.id}`, vector['@data']); - await this._SET(path, stack['@data']); - await this.commit(); - let output = await this._GET(`/blobs/${vector.id}`); - return output; - } - - async encodeValue (value) { - if (!(value instanceof String)) { - switch (value.constructor.name) { - default: - value = JSON.stringify(value); - break; - } - } - - return Buffer.from(value, 'utf8').toString('hex'); - } - - async getDataInfo (value) { - let type = null; - let size = null; - let hash = null; - - switch (value.constructor.name) { - case 'String': - type = 'JSONString'; - size = value.length; - hash = this.sha256(value); - break; - default: - console.error('unhandled type:', value.constructor.name); - type = 'Unhandled'; - break; - } - - return { - hash, - size, - type - }; - } - - async getRouteInfo (path) { - if (path.substring(0, 1) !== '/') path = '/' + path; - - const id = pointer$3.escape(path); - const router = this.sha256(id); - - return { - path: path, - pointer: id, - index: router - }; - } - - async populate (element) { - let map = []; - - for (let i = 0; i < element.length; i++) { - map[i] = await this._GET(`/entities/${element[i]}`); - } - - return map; - } - - /** - * Barebones getter. - * @param {String} key Name of data to retrieve. - * @return {Promise} Resolves on complete. `null` if not found. - */ - async get (key) { - const route = await this.getRouteInfo(key); - const result = pointer$3.get(this._state.content, route.path); - const type = this._state.metadata[route.index].type; - - let output = null; - - switch (type) { - default: - output = result; - break; - } - - return output; - } - - /** - * Set a `key` to a specific `value`. - * @param {String} key Address of the information. - * @param {Mixed} value Content to store at `key`. - */ - async set (key, value) { - const route = await this.getRouteInfo(key); - const info = await this.getDataInfo(value); - const data = await this.encodeValue(value); - - // Let's use the document's key as the identifying value. - // This is what defines our key => value store. - // All functions can be run as a map of an original input vector, allowing - // binary scoping across trees of varying complexity. - const hash = this.sha256(value); - const actor = new Actor$e({ - type: 'FabricDocument', - content: data, - encoding: 'json', - original: value - }); - - this._state.actors[actor.id] = actor; - this._state.documents[hash] = value; - this._state.indices[route.index] = route.pointer; - this._state.metadata[route.index] = info; - - pointer$3.set(this._state.content, route.path, value); - - this.commit(); - - return this.get(key); - } - - async open () { - // await super.open(); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opening:', this.settings.path); - // if (this.db) return this; - - try { - this.db = level$3(this.settings.path); - this.trust(this.db); - this.status = 'opened'; - await this.commit(); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opened!'); - } catch (E) { - console.error('[FABRIC:STORE]', E); - this.status = 'error'; - } - - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Opened!'); - - return this; - } - - async close () { - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Closing:', this.settings.path); - if (this.db) { - try { - await this.db.close(); - } catch (E) { - this.error('[STORE]', 'closing store:', this.settings.path, E); - } - } - - // await super.close(); - return this; - } - - /** - * Implicitly trust an {@link Event} source. - * @param {EventEmitter} source Event-emitting source. - * @return {Store} Resulting instance of {@link Store} with new trust. - */ - trust (source) { - let store = this; - let name = `/sources/${store.id}`; - - source.on('put', function (key, value) { - // store.log('[TRUST:SOURCE]', source.constructor.name, 'emitted a put event', name, key, value.constructor.name, value); - if (store.settings.verbosity >= 5) console.log('[TRUST:SOURCE]', source.constructor.name, 'emitted a put event', name, key, value.constructor.name, value); - - let id = pointer$3.escape(key); - let router = store.sha256(id); - let state = new State(value); - - pointer$3.set(store['@entity']['@data'], `${name}`, value); - pointer$3.set(store['@entity']['@data'], `/states/${state.id}`, value); - pointer$3.set(store['@entity']['@data'], `/blobs/${state.id}`, state.serialize()); - pointer$3.set(store['@entity']['@data'], `/types/${state.id}`, value.constructor.name); - pointer$3.set(store['@entity']['@data'], `/tips/${router}`, state.id); - pointer$3.set(store['@entity']['@data'], `/names/${router}`, id); - - store.emit('source/events', { - '@type': 'Request', - '@method': 'put', - '@actor': '~level', - '@object': state['@link'], - '@target': key, - '@data': value - }); - }); - - return this; - } - - /** - * Remove a {@link Value} by {@link Path}. - * @param {Path} key Key to remove. - */ - async del (key) { - if (!this.db) { - await this.open(); - } - - const deleted = await this.db.del(key); - return deleted; - } - - async batch (ops) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:STORE]', 'Batching:', ops); - let result = null; - - if (!this.db || this.db._status === 'closed') { - await this.open(); - } - - // Core function - try { - result = await this.db.batch(ops); - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Batched:', result); - } catch (E) { - console.error('[FABRIC:STORE]', 'Could not batch updates:', E); - } - - return result; - } - - async commit () { - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:STORE]', 'Committing:', this.state); - const entity = new Entity$6(this.state.state); - this.emit('commit', entity.id, entity.data); - // TODO: document re-opening of store - return entity; - } - - createReadStream () { - return this.db.createReadStream(); - } - - /** - * Wipes the storage. - */ - async flush () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:STORE]', 'Flushing database...'); - - for (let name in this['@entity']['@data'].addresses) { - let address = this['@entity']['@data'].addresses[name]; - if (this.settings.verbosity >= 3) console.log('found address:', address); - if (address) await this.del(address); - } - - try { - await this.del(`/collections`); - await this.commit(); - } catch (E) { - console.error('Could not wipe database:', E); - } - - return this; - } - - noop () { - this.emit('noop'); - return this; - } - - rotate () { - return this; - } - - /** - * Start running the process. - * @return {Promise} Resolves on complete. - */ - async start () { - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Starting:', this.settings.path); - this.status = 'starting'; - - try { - await this.open(); - this.status = 'started'; - // await this.commit(); - } catch (E) { - console.error('[FABRIC:STORE]', 'Could not open db:', E); - } - - if (this.settings.verbosity >= 3) console.log('[FABRIC:STORE]', 'Started on path:', this.settings.path); - return this; - } - - async stop () { - this.status = 'stopping'; - - if (this.settings.persistent !== true) { - await this.flush(); - } - - try { - await this.close(); - } catch (E) { - console.error('Could not stop store:', E); - } - - this.status = 'stopped'; - - return this; - } -} - -var store_1 = Store$4; - -const crypto$j = require$$0$4; -const pluralize$3 = pluralize$5.exports; - -const State$6 = state$2; -const Store$3 = store_1; - -/** - * Generic interface for collections of digital objects. - * @param {Object} definition Initial parameters - * @constructor - */ -class Resource$6 extends Store$3 { - constructor (definition = {}) { - super(definition); - - if (!(this instanceof Resource$6)) { - return new Resource$6(definition); - } - - this['@data'] = definition; - this.name = definition.name || 'Radical'; - this.names = [ this.name, pluralize$3(this.name) ]; - this.definition = definition; - - this.routes = Object.assign({ - list: `/${this.names[1].toLowerCase()}`, // TODO: unpin, offer larger name list - view: `/${this.names[1].toLowerCase()}/:id` - }, definition.routes); - - this.components = Object.assign({ - list: [this.name.toLowerCase(), 'list'].join('-'), - view: [this.name.toLowerCase(), 'view'].join('-') - }, definition.components); - - return this; - } - - static asStruct () { - var obj = this.prototype; - obj.name = this.name; - return obj; - } - - get hash () { - return crypto$j.createHash('sha256').update(this.render()).digest('hex'); - } - - attach (app) { - this.store = app.stash; - } - - async list () { - return this.store.get(this.routes.list); - } - - async describe () { - this.http.put(this.routes.set, this.router); - this.http.get(this.routes.get, this.router); - this.http.post(this.routes.insert, this.router); - this.http.patch(this.routes.update, this.router); - this.http.delete(this.routes.delete, this.router); - this.http.options(this.routes.options, this.router); - } - - /** - * Create an instance of the Resource's type. - * @param {Object} obj Map of the instance's properties and values. - * @return {Vector} Resulting Vector with deterministic identifier. - */ - async create (obj) { - let self = this; - let vector = new State$6(obj); - await self.store._POST(self.routes.list, vector['@data']); - return vector; - } - - /** - * Modify an existing instance of a Resource by its unique identifier. Produces a new instance. - * @param {String} id Unique ID to update. - * @param {Object} update Map of change to make (keys -> values). - * @return {Vector} Resulting Vector instance with updated identifier. - */ - async update (id, update) { - let self = this; - let path = `${self.routes.list}/${id}`; - new State$6(update); - self.store._PATCH(path, update); - let result = self.store._GET(path); - return result; - } - - async query (inquiry) { - let self = this; - let collection = await self.store._GET(self.routes.list); - return collection; - } - - render () { - return `${JSON.stringify(this.definition)}`; - } -} - -var resource$1 = Resource$6; - -var dist = {exports: {}}; - -(function (module, exports) { -(function(f){{module.exports=f();}})(function(){return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof commonjsRequire=="function"&&commonjsRequire;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r);}return n[o].exports}var i=typeof commonjsRequire=="function"&&commonjsRequire;for(var o=0;o 32) { - throw new Error('Generator.bits()\'s bitCount parameter must be in the range [1 - 32]. Provided bitCount=' + bitCount); - } - // Use the higher bits as the lower bits have a low period. I haven't looked into the exact - // math of why, but in my tests in masking off the lower bits and graphing them it tended - // to loop very quickly. - // TODO: Test the above concern and in general do some analysis of the quality of generated - // numbers using different places of the number. - return this._state >>> 32 - bitCount; - } - - // Move the generators internal state - // forward one step - - }, { - key: 'next', - get: function get() { - this._state = lcg(this._state); - return this; - } - - // Move the generators internal state - // forward one step - - }, { - key: 'prev', - get: function get() { - this._state = rlcg(this._state); - return this; - } - - // Set the state of the generator. Must be a valid u32 integer - - }, { - key: 'state', - set: function set(state) { - if (state < 0 || state >= _MaxU2.default) { - throw new Error('Generator.state must be a number between 0 and (2^32 - 1). Provided state was ' + state + '.'); - } - this._state = state; - } - - // Get the current internal state - , - get: function get() { - return this._state; - } - }]); - - return Generator; -}(); - -exports.default = Generator; - - -function lcg(state) { - state = (a * state + c) % m; - return state; -} - -function rlcg(state) { - var result = _Long2.default.fromInt(aInverse).multiply(_Long2.default.fromNumber(state - 1013904223)); // - var pow2to32 = new _Long2.default(0, 1); - - // Modulo doesn't work as we want (negatives stay negatives, we want wrapping around ) - if (result.isNegative()) { - result = pow2to32.add(result.modulo(pow2to32)); - } else { - result = result.modulo(pow2to32); - } - - result = result.toNumber(); - state = result; - return state; -} - -},{"./Long":2,"./MaxU32":3}],2:[function(require,module,exports){ - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Copyright 2009 The Closure Library Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @fileoverview Defines a Long class for representing a 64-bit two's-complement - * integer value, which faithfully simulates the behavior of a Java "long". This - * implementation is derived from LongLib in GWT. - * - */ - -/** - * Constructs a 64-bit two's-complement integer, given its low and high 32-bit - * values as *signed* integers. See the from* functions below for more - * convenient ways of constructing Longs. - * - * The internal representation of a long is the two given signed, 32-bit values. - * We use 32-bit pieces because these are the size of integers on which - * Javascript performs bit-operations. For operations like addition and - * multiplication, we split each number into 16-bit pieces, which can easily be - * multiplied within Javascript's floating-point representation without overflow - * or change in sign. - * - * In the algorithms below, we frequently reduce the negative case to the - * positive case by negating the input(s) and then post-processing the result. - * Note that we must ALWAYS check specially whether those values are MIN_VALUE - * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as - * a positive number, it overflows back into a negative). Not handling this - * case would often result in infinite recursion. - * - * @param {number} low The low (signed) 32 bits of the long. - * @param {number} high The high (signed) 32 bits of the long. - * @struct - * @constructor - * @final - */ -var Long = function Long(low, high) { - /** - * @type {number} - * @private - */ - this.low_ = low | 0; // force into 32 signed bits. - - /** - * @type {number} - * @private - */ - this.high_ = high | 0; // force into 32 signed bits. -}; - -/** - * Returns a Long representing the given (32-bit) integer value. - * @param {number} value The 32-bit integer in question. - * @return {!Long} The corresponding Long value. - */ -Long.fromInt = function (value) { - return new Long(value | 0, value < 0 ? -1 : 0); -}; - -/** - * Returns a Long representing the given value. - * NaN will be returned as zero. Infinity is converted to max value and - * -Infinity to min value. - * @param {number} value The number in question. - * @return {!Long} The corresponding Long value. - */ -Long.fromNumber = function (value) { - if (isNaN(value)) { - return Long.getZero(); - } else if (value <= -Long.TWO_PWR_63_DBL_) { - return Long.getMinValue(); - } else if (value + 1 >= Long.TWO_PWR_63_DBL_) { - return Long.getMaxValue(); - } else if (value < 0) { - return Long.fromNumber(-value).negate(); - } else { - return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0); - } -}; - -/** - * Returns a Long representing the 64-bit integer that comes by concatenating - * the given high and low bits. Each is assumed to use 32 bits. - * @param {number} lowBits The low 32-bits. - * @param {number} highBits The high 32-bits. - * @return {!Long} The corresponding Long value. - */ -Long.fromBits = function (lowBits, highBits) { - return new Long(lowBits, highBits); -}; - -/** - * Returns a Long representation of the given string, written using the given - * radix. - * @param {string} str The textual representation of the Long. - * @param {number=} opt_radix The radix in which the text is written. - * @return {!Long} The corresponding Long value. - */ -Long.fromString = function (str, opt_radix) { - if (str.length == 0) { - throw Error('number format error: empty string'); - } - - var radix = opt_radix || 10; - if (radix < 2 || 36 < radix) { - throw Error('radix out of range: ' + radix); - } - - if (str.charAt(0) == '-') { - return Long.fromString(str.substring(1), radix).negate(); - } else if (str.indexOf('-') >= 0) { - throw Error('number format error: interior "-" character: ' + str); - } - - // Do several (8) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = Long.fromNumber(Math.pow(radix, 8)); - - var result = Long.getZero(); - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i); - var value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = Long.fromNumber(Math.pow(radix, size)); - result = result.multiply(power).add(Long.fromNumber(value)); - } else { - result = result.multiply(radixToPower); - result = result.add(Long.fromNumber(value)); - } - } - return result; -}; - -// NOTE: the compiler should inline these constant values below and then remove -// these variables, so there should be no runtime penalty for these. - - -/** - * Number used repeated below in calculations. This must appear before the - * first call to any from* function below. - * @type {number} - * @private - */ -Long.TWO_PWR_16_DBL_ = 1 << 16; - -/** - * @type {number} - * @private - */ -Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_; - -/** - * @type {number} - * @private - */ -Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_; - -/** - * @type {number} - * @private - */ -Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2; - -/** - * @return {!Long} - * @public - */ -Long.getZero = function () { - return Long.fromInt(0); -}; - -/** - * @return {!Long} - * @public - */ -Long.getOne = function () { - return Long.fromInt(1); -}; - -/** - * @return {!Long} - * @public - */ -Long.getNegOne = function () { - return Long.fromInt(-1); -}; - -/** - * @return {!Long} - * @public - */ -Long.getMaxValue = function () { - return Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0); -}; - -/** - * @return {!Long} - * @public - */ -Long.getMinValue = function () { - return Long.fromBits(0, 0x80000000 | 0); -}; - -/** - * @return {!Long} - * @public - */ -Long.getTwoPwr24 = function () { - return Long.fromInt(1 << 24); -}; - -/** @return {number} The value, assuming it is a 32-bit integer. */ -Long.prototype.toInt = function () { - return this.low_; -}; - -/** @return {number} The closest floating-point representation to this value. */ -Long.prototype.toNumber = function () { - return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned(); -}; - -/** - * @param {number=} opt_radix The radix in which the text should be written. - * @return {string} The textual representation of this value. - * @override - */ -Long.prototype.toString = function (opt_radix) { - var radix = opt_radix || 10; - if (radix < 2 || 36 < radix) { - throw Error('radix out of range: ' + radix); - } - - if (this.isZero()) { - return '0'; - } - - if (this.isNegative()) { - if (this.equals(Long.getMinValue())) { - // We need to change the Long value before it can be negated, so we remove - // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = Long.fromNumber(radix); - var div = this.div(radixLong); - var rem = div.multiply(radixLong).subtract(this); - return div.toString(radix) + rem.toInt().toString(radix); - } else { - return '-' + this.negate().toString(radix); - } - } - - // Do several (6) digits each time through the loop, so as to - // minimize the calls to the very expensive emulated div. - var radixToPower = Long.fromNumber(Math.pow(radix, 6)); - - var rem = this; - var result = ''; - while (true) { - var remDiv = rem.div(radixToPower); - // The right shifting fixes negative values in the case when - // intval >= 2^31; for more details see - // https://github.com/google/closure-library/pull/498 - var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() >>> 0; - var digits = intval.toString(radix); - - rem = remDiv; - if (rem.isZero()) { - return digits + result; - } else { - while (digits.length < 6) { - digits = '0' + digits; - } - result = '' + digits + result; - } - } -}; - -/** @return {number} The high 32-bits as a signed value. */ -Long.prototype.getHighBits = function () { - return this.high_; -}; - -/** @return {number} The low 32-bits as a signed value. */ -Long.prototype.getLowBits = function () { - return this.low_; -}; - -/** @return {number} The low 32-bits as an unsigned value. */ -Long.prototype.getLowBitsUnsigned = function () { - return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_; -}; - -/** - * @return {number} Returns the number of bits needed to represent the absolute - * value of this Long. - */ -Long.prototype.getNumBitsAbs = function () { - if (this.isNegative()) { - if (this.equals(Long.getMinValue())) { - return 64; - } else { - return this.negate().getNumBitsAbs(); - } - } else { - var val = this.high_ != 0 ? this.high_ : this.low_; - for (var bit = 31; bit > 0; bit--) { - if ((val & 1 << bit) != 0) { - break; - } - } - return this.high_ != 0 ? bit + 33 : bit + 1; - } -}; - -/** @return {boolean} Whether this value is zero. */ -Long.prototype.isZero = function () { - return this.high_ == 0 && this.low_ == 0; -}; - -/** @return {boolean} Whether this value is negative. */ -Long.prototype.isNegative = function () { - return this.high_ < 0; -}; - -/** @return {boolean} Whether this value is odd. */ -Long.prototype.isOdd = function () { - return (this.low_ & 1) == 1; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long equals the other. - */ -Long.prototype.equals = function (other) { - return this.high_ == other.high_ && this.low_ == other.low_; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long does not equal the other. - */ -Long.prototype.notEquals = function (other) { - return this.high_ != other.high_ || this.low_ != other.low_; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is less than the other. - */ -Long.prototype.lessThan = function (other) { - return this.compare(other) < 0; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is less than or equal to the other. - */ -Long.prototype.lessThanOrEqual = function (other) { - return this.compare(other) <= 0; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is greater than the other. - */ -Long.prototype.greaterThan = function (other) { - return this.compare(other) > 0; -}; - -/** - * @param {Long} other Long to compare against. - * @return {boolean} Whether this Long is greater than or equal to the other. - */ -Long.prototype.greaterThanOrEqual = function (other) { - return this.compare(other) >= 0; -}; - -/** - * Compares this Long with the given one. - * @param {Long} other Long to compare against. - * @return {number} 0 if they are the same, 1 if the this is greater, and -1 - * if the given one is greater. - */ -Long.prototype.compare = function (other) { - if (this.equals(other)) { - return 0; - } - - var thisNeg = this.isNegative(); - var otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) { - return -1; - } - if (!thisNeg && otherNeg) { - return 1; - } - - // at this point, the signs are the same, so subtraction will not overflow - if (this.subtract(other).isNegative()) { - return -1; - } else { - return 1; - } -}; - -/** @return {!Long} The negation of this value. */ -Long.prototype.negate = function () { - if (this.equals(Long.getMinValue())) { - return Long.getMinValue(); - } else { - return this.not().add(Long.getOne()); - } -}; - -/** - * Returns the sum of this and the given Long. - * @param {Long} other Long to add to this one. - * @return {!Long} The sum of this and the given Long. - */ -Long.prototype.add = function (other) { - // Divide each number into 4 chunks of 16 bits, and then sum the chunks. - - var a48 = this.high_ >>> 16; - var a32 = this.high_ & 0xFFFF; - var a16 = this.low_ >>> 16; - var a00 = this.low_ & 0xFFFF; - - var b48 = other.high_ >>> 16; - var b32 = other.high_ & 0xFFFF; - var b16 = other.low_ >>> 16; - var b00 = other.low_ & 0xFFFF; - - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 + b48; - c48 &= 0xFFFF; - return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32); -}; - -/** - * Returns the difference of this and the given Long. - * @param {Long} other Long to subtract from this. - * @return {!Long} The difference of this and the given Long. - */ -Long.prototype.subtract = function (other) { - return this.add(other.negate()); -}; - -/** - * Returns the product of this and the given long. - * @param {Long} other Long to multiply with this. - * @return {!Long} The product of this and the other. - */ -Long.prototype.multiply = function (other) { - if (this.isZero()) { - return Long.getZero(); - } else if (other.isZero()) { - return Long.getZero(); - } - - if (this.equals(Long.getMinValue())) { - return other.isOdd() ? Long.getMinValue() : Long.getZero(); - } else if (other.equals(Long.getMinValue())) { - return this.isOdd() ? Long.getMinValue() : Long.getZero(); - } - - if (this.isNegative()) { - if (other.isNegative()) { - return this.negate().multiply(other.negate()); - } else { - return this.negate().multiply(other).negate(); - } - } else if (other.isNegative()) { - return this.multiply(other.negate()).negate(); - } - - // If both longs are small, use float multiplication - if (this.lessThan(Long.getTwoPwr24()) && other.lessThan(Long.getTwoPwr24())) { - return Long.fromNumber(this.toNumber() * other.toNumber()); - } - - // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. - // We can skip products that would overflow. - - var a48 = this.high_ >>> 16; - var a32 = this.high_ & 0xFFFF; - var a16 = this.low_ >>> 16; - var a00 = this.low_ & 0xFFFF; - - var b48 = other.high_ >>> 16; - var b32 = other.high_ & 0xFFFF; - var b16 = other.low_ >>> 16; - var b00 = other.low_ & 0xFFFF; - - var c48 = 0, - c32 = 0, - c16 = 0, - c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 0xFFFF; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 0xFFFF; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 0xFFFF; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 0xFFFF; - return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32); -}; - -/** - * Returns this Long divided by the given one. - * @param {Long} other Long by which to divide. - * @return {!Long} This Long divided by the given one. - */ -Long.prototype.div = function (other) { - if (other.isZero()) { - throw Error('division by zero'); - } else if (this.isZero()) { - return Long.getZero(); - } - - if (this.equals(Long.getMinValue())) { - if (other.equals(Long.getOne()) || other.equals(Long.getNegOne())) { - return Long.getMinValue(); // recall -MIN_VALUE == MIN_VALUE - } else if (other.equals(Long.getMinValue())) { - return Long.getOne(); - } else { - // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. - var halfThis = this.shiftRight(1); - var approx = halfThis.div(other).shiftLeft(1); - if (approx.equals(Long.getZero())) { - return other.isNegative() ? Long.getOne() : Long.getNegOne(); - } else { - var rem = this.subtract(other.multiply(approx)); - var result = approx.add(rem.div(other)); - return result; - } - } - } else if (other.equals(Long.getMinValue())) { - return Long.getZero(); - } - - if (this.isNegative()) { - if (other.isNegative()) { - return this.negate().div(other.negate()); - } else { - return this.negate().div(other).negate(); - } - } else if (other.isNegative()) { - return this.div(other.negate()).negate(); - } - - // Repeat the following until the remainder is less than other: find a - // floating-point that approximates remainder / other *from below*, add this - // into the result, and subtract it from the remainder. It is critical that - // the approximate value is less than or equal to the real value so that the - // remainder never becomes negative. - var res = Long.getZero(); - var rem = this; - while (rem.greaterThanOrEqual(other)) { - // Approximate the result of division. This may be a little greater or - // smaller than the actual value. - var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber())); - - // We will tweak the approximate result by changing it in the 48-th digit or - // the smallest non-fractional digit, whichever is larger. - var log2 = Math.ceil(Math.log(approx) / Math.LN2); - var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); - - // Decrease the approximation until it is smaller than the remainder. Note - // that if it is too large, the product overflows and is negative. - var approxRes = Long.fromNumber(approx); - var approxRem = approxRes.multiply(other); - while (approxRem.isNegative() || approxRem.greaterThan(rem)) { - approx -= delta; - approxRes = Long.fromNumber(approx); - approxRem = approxRes.multiply(other); - } - - // We know the answer can't be zero... and actually, zero would cause - // infinite recursion since we would make no progress. - if (approxRes.isZero()) { - approxRes = Long.getOne(); - } - - res = res.add(approxRes); - rem = rem.subtract(approxRem); - } - return res; -}; - -/** - * Returns this Long modulo the given one. - * @param {Long} other Long by which to mod. - * @return {!Long} This Long modulo the given one. - */ -Long.prototype.modulo = function (other) { - return this.subtract(this.div(other).multiply(other)); -}; - -/** @return {!Long} The bitwise-NOT of this value. */ -Long.prototype.not = function () { - return Long.fromBits(~this.low_, ~this.high_); -}; - -/** - * Returns the bitwise-AND of this Long and the given one. - * @param {Long} other The Long with which to AND. - * @return {!Long} The bitwise-AND of this and the other. - */ -Long.prototype.and = function (other) { - return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_); -}; - -/** - * Returns the bitwise-OR of this Long and the given one. - * @param {Long} other The Long with which to OR. - * @return {!Long} The bitwise-OR of this and the other. - */ -Long.prototype.or = function (other) { - return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_); -}; - -/** - * Returns the bitwise-XOR of this Long and the given one. - * @param {Long} other The Long with which to XOR. - * @return {!Long} The bitwise-XOR of this and the other. - */ -Long.prototype.xor = function (other) { - return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_); -}; - -/** - * Returns this Long with bits shifted to the left by the given amount. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the left by the given amount. - */ -Long.prototype.shiftLeft = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var low = this.low_; - if (numBits < 32) { - var high = this.high_; - return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits); - } else { - return Long.fromBits(0, low << numBits - 32); - } - } -}; - -/** - * Returns this Long with bits shifted to the right by the given amount. - * The new leading bits match the current sign bit. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the right by the given amount. - */ -Long.prototype.shiftRight = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var high = this.high_; - if (numBits < 32) { - var low = this.low_; - return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits); - } else { - return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1); - } - } -}; - -/** - * Returns this Long with bits shifted to the right by the given amount, with - * zeros placed into the new leading bits. - * @param {number} numBits The number of bits by which to shift. - * @return {!Long} This shifted to the right by the given amount, with - * zeros placed into the new leading bits. - */ -Long.prototype.shiftRightUnsigned = function (numBits) { - numBits &= 63; - if (numBits == 0) { - return this; - } else { - var high = this.high_; - if (numBits < 32) { - var low = this.low_; - return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits); - } else if (numBits == 32) { - return Long.fromBits(high, 0); - } else { - return Long.fromBits(high >>> numBits - 32, 0); - } - } -}; - -/** - * @enum {number} Ids of commonly requested Long instances. - * @private - */ -Long.ValueCacheId_ = { - MAX_VALUE: 1, - MIN_VALUE: 2, - ZERO: 3, - ONE: 4, - NEG_ONE: 5, - TWO_PWR_24: 6 -}; - -exports.default = Long; - -},{}],3:[function(require,module,exports){ - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var MAX_U32 = Math.pow(2, 32); - -exports.default = MAX_U32; - -},{}],4:[function(require,module,exports){ - -/* - **Francois**: - Based on an implementation that's based on further implementations, most significant - change is removing the use of Buffers and ArrayBuffers. Original implementation was forked - here (hopefully the original repo still exists, to play it safe I've forked it) - https://github.com/francoislaberge/node-skip32 - - ** Original Comments in skip32.js's implementation ** - Skip32PureJS.js - public domain javascript implementation of: - - SKIP32 -- 32 bit block cipher based on SKIPJACK. - Written by Greg Rose, QUALCOMM Australia, 1999/04/27. - - In common: F-table, G-permutation, key schedule. - Different: 24 round feistel structure. - Based on: Unoptimized test implementation of SKIPJACK algorithm - Panu Rissanen - - SKIPJACK and KEA Algorithm Specifications - Version 2.0 - 29 May 1998 - - Not copyright, no rights reserved. -*/ -function Skip32() { - // Francois: I have modified the code to have a hardcoded key. values - // were taken from the example code in the node-skip32 project: - // https://github.com/0x4139/node-skip32#example - this.key = [0x9b, 0x21, 0x96, 0xe, 0x1a, 0xcf, 0x24, 0x5f, 0x14, 0x93]; -} -Skip32.prototype.init = function () {}; - -// Francois: I have modified the code to remove the use of Buffers and ArrayBuffers -// so that the code is more portable to other browsers and environments -var ftable = [0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, 0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e, 0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28, 0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68, 0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53, 0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19, 0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2, 0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b, 0xee, 0xb4, 0x1a, 0xea, 0xd0, 0x91, 0x2f, 0xb8, 0x55, 0xb9, 0xda, 0x85, 0x3f, 0x41, 0xbf, 0xe0, 0x5a, 0x58, 0x80, 0x5f, 0x66, 0x0b, 0xd8, 0x90, 0x35, 0xd5, 0xc0, 0xa7, 0x33, 0x06, 0x65, 0x69, 0x45, 0x00, 0x94, 0x56, 0x6d, 0x98, 0x9b, 0x76, 0x97, 0xfc, 0xb2, 0xc2, 0xb0, 0xfe, 0xdb, 0x20, 0xe1, 0xeb, 0xd6, 0xe4, 0xdd, 0x47, 0x4a, 0x1d, 0x42, 0xed, 0x9e, 0x6e, 0x49, 0x3c, 0xcd, 0x43, 0x27, 0xd2, 0x07, 0xd4, 0xde, 0xc7, 0x67, 0x18, 0x89, 0xcb, 0x30, 0x1f, 0x8d, 0xc6, 0x8f, 0xaa, 0xc8, 0x74, 0xdc, 0xc9, 0x5d, 0x5c, 0x31, 0xa4, 0x70, 0x88, 0x61, 0x2c, 0x9f, 0x0d, 0x2b, 0x87, 0x50, 0x82, 0x54, 0x64, 0x26, 0x7d, 0x03, 0x40, 0x34, 0x4b, 0x1c, 0x73, 0xd1, 0xc4, 0xfd, 0x3b, 0xcc, 0xfb, 0x7f, 0xab, 0xe6, 0x3e, 0x5b, 0xa5, 0xad, 0x04, 0x23, 0x9c, 0x14, 0x51, 0x22, 0xf0, 0x29, 0x79, 0x71, 0x7e, 0xff, 0x8c, 0x0e, 0xe2, 0x0c, 0xef, 0xbc, 0x72, 0x75, 0x6f, 0x37, 0xa1, 0xec, 0xd3, 0x8e, 0x62, 0x8b, 0x86, 0x10, 0xe8, 0x08, 0x77, 0x11, 0xbe, 0x92, 0x4f, 0x24, 0xc5, 0x32, 0x36, 0x9d, 0xcf, 0xf3, 0xa6, 0xbb, 0xac, 0x5e, 0x6c, 0xa9, 0x13, 0x57, 0x25, 0xb5, 0xe3, 0xbd, 0xa8, 0x3a, 0x01, 0x05, 0x59, 0x2a, 0x46]; - -Skip32.prototype.round16 = function (k, n) { - var g1, g2, g3, g4, g5, g6; - g1 = n >> 8 & 0xff; - g2 = n >> 0 & 0xff; - g3 = ftable[g2 ^ this.key[(4 * k + 0) % 10]] ^ g1; - g4 = ftable[g3 ^ this.key[(4 * k + 1) % 10]] ^ g2; - g5 = ftable[g4 ^ this.key[(4 * k + 2) % 10]] ^ g3; - g6 = ftable[g5 ^ this.key[(4 * k + 3) % 10]] ^ g4; - return (g5 << 8) + g6; -}; - -Skip32.prototype.core = function (n, k, d) { - var i, k, wl, wr; - wl = ((n >> 24 & 0xff) << 8) + ((n >> 16 & 0xff) << 0); - wr = ((n >> 8 & 0xff) << 8) + ((n >> 0 & 0xff) << 0); - for (i = 0; i < 24 / 2; i++) { - wr ^= this.round16(k, wl) ^ k; - k += d; - wl ^= this.round16(k, wr) ^ k; - k += d; - } - return (wr << 16 | wl) >>> 0; -}; - -Skip32.prototype.encrypt = function (n) { - return this.core(n, 0, 1); -}; - -Skip32.prototype.decrypt = function (n) { - return this.core(n, 23, -1); -}; - -module.exports.Skip32 = Skip32; - -},{}],5:[function(require,module,exports){ - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Generator = require('./Generator'); - -var _Generator2 = _interopRequireDefault(_Generator); - -var _scrambler = require('./scrambler'); - -var _MaxU = require('./MaxU32'); - -var _MaxU2 = _interopRequireDefault(_MaxU); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var arbitrary = { - MAX_U32: _MaxU2.default, - Generator: _Generator2.default, - scramble: _scrambler.scramble, - descramble: _scrambler.descramble -}; - -exports.default = arbitrary; - -},{"./Generator":1,"./MaxU32":3,"./scrambler":6}],6:[function(require,module,exports){ - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.scramble = scramble; -exports.descramble = descramble; -var Skip32 = require('./Skip32PureJS').Skip32; -var cypher = new Skip32(); - -/* - * Takes a unsigned 32 bit integer and returns an unsigned 32 bit integer - * with it's bits scrambled. - * - * Ideal for taking a series of incrementing numbers and creating a pseudo random version. - * Is reversible via calling descramble() on a scrambled number. - */ -function scramble(number) { - return cypher.encrypt(number); -} - -/* - * Takes a scrambled unsigned 32 bit integer and returns the unscrambled unsigned 32 bit - * integer version. - * - * Ideal for taking a series of incrementing numbers and creating a pseudo random version. - * Use this to figure out the original number crated from calls to scramble() - */ -function descramble(scrambledNumber) { - return cypher.decrypt(scrambledNumber); -} - -},{"./Skip32PureJS":4}]},{},[5])(5) -}); - - -}(dist)); - -var bn$2 = {exports: {}}; - -(function (module) { -(function (module, exports) { - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { - Buffer = window.Buffer; - } else { - Buffer = require('buffer').Buffer; - } - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - this.negative = 1; - } - - if (start < number.length) { - if (base === 16) { - this._parseHex(number, start, endian); - } else { - this._parseBase(number, base, start); - if (endian === 'le') { - this._initArray(this.toArray(), base, endian); - } - } - } - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex4Bits (string, index) { - var c = string.charCodeAt(index); - // 'A' - 'F' - if (c >= 65 && c <= 70) { - return c - 55; - // 'a' - 'f' - } else if (c >= 97 && c <= 102) { - return c - 87; - // '0' - '9' - } else { - return (c - 48) & 0xf; - } - } - - function parseHexByte (string, lowerBound, index) { - var r = parseHex4Bits(string, index); - if (index - 1 >= lowerBound) { - r |= parseHex4Bits(string, index - 1) << 4; - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start, endian) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - // 24-bits chunks - var off = 0; - var j = 0; - - var w; - if (endian === 'be') { - for (i = number.length - 1; i >= start; i -= 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number.length - start; - for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } - - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - this.strip(); - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - var groupSizes = [ - 0, 0, - 25, 16, 12, 11, 10, 9, 8, - 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - if (r.strip !== undefined) { - // r is BN v4 instance - r.strip(); - } else { - // r is BN v5 instance - r._strip(); - } - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1).toRed(this); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(module, commonjsGlobal); -}(bn$2)); - -var elliptic$2 = {}; - -var _args$1 = [ - [ - "elliptic@6.5.4", - "/Users/eric/fabric" - ] -]; -var _from$1 = "elliptic@6.5.4"; -var _id$1 = "elliptic@6.5.4"; -var _inBundle$1 = false; -var _integrity$1 = "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ=="; -var _location$1 = "/elliptic"; -var _phantomChildren$1 = { -}; -var _requested$1 = { - type: "version", - registry: true, - raw: "elliptic@6.5.4", - name: "elliptic", - escapedName: "elliptic", - rawSpec: "6.5.4", - saveSpec: null, - fetchSpec: "6.5.4" -}; -var _requiredBy$1 = [ - "/", - "/@fabric/core", - "/browserify-sign", - "/create-ecdh", - "/eccrypto", - "/secp256k1" -]; -var _resolved$1 = "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz"; -var _spec$1 = "6.5.4"; -var _where$1 = "/Users/eric/fabric"; -var author$1 = { - name: "Fedor Indutny", - email: "fedor@indutny.com" -}; -var bugs$1 = { - url: "https://github.com/indutny/elliptic/issues" -}; -var dependencies$1 = { - "bn.js": "^4.11.9", - brorand: "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - inherits: "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" -}; -var description$2 = "EC cryptography"; -var devDependencies$1 = { - brfs: "^2.0.2", - coveralls: "^3.1.0", - eslint: "^7.6.0", - grunt: "^1.2.1", - "grunt-browserify": "^5.3.0", - "grunt-cli": "^1.3.2", - "grunt-contrib-connect": "^3.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "^5.0.0", - "grunt-mocha-istanbul": "^5.0.2", - "grunt-saucelabs": "^9.0.1", - istanbul: "^0.4.5", - mocha: "^8.0.1" -}; -var files = [ - "lib" -]; -var homepage$1 = "https://github.com/indutny/elliptic"; -var keywords$1 = [ - "EC", - "Elliptic", - "curve", - "Cryptography" -]; -var license$1 = "MIT"; -var main$4 = "lib/elliptic.js"; -var name$2 = "elliptic"; -var repository$1 = { - type: "git", - url: "git+ssh://git@github.com/indutny/elliptic.git" -}; -var scripts$1 = { - lint: "eslint lib test", - "lint:fix": "npm run lint -- --fix", - test: "npm run lint && npm run unit", - unit: "istanbul test _mocha --reporter=spec test/index.js", - version: "grunt dist && git add dist/" -}; -var version$2 = "6.5.4"; -var require$$0$2 = { - _args: _args$1, - _from: _from$1, - _id: _id$1, - _inBundle: _inBundle$1, - _integrity: _integrity$1, - _location: _location$1, - _phantomChildren: _phantomChildren$1, - _requested: _requested$1, - _requiredBy: _requiredBy$1, - _resolved: _resolved$1, - _spec: _spec$1, - _where: _where$1, - author: author$1, - bugs: bugs$1, - dependencies: dependencies$1, - description: description$2, - devDependencies: devDependencies$1, - files: files, - homepage: homepage$1, - keywords: keywords$1, - license: license$1, - main: main$4, - name: name$2, - repository: repository$1, - scripts: scripts$1, - version: version$2 -}; - -var utils$n = {}; - -var minimalisticAssert = assert$3d; - -function assert$3d(val, msg) { - if (!val) - throw new Error(msg || 'Assertion failed'); -} - -assert$3d.equal = function assertEqual(l, r, msg) { - if (l != r) - throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); -}; - -var utils$m = {}; - -(function (exports) { - -var utils = exports; - -function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg !== 'string') { - for (var i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - return res; - } - if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (var i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } else { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } - return res; -} -utils.toArray = toArray; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -utils.zero2 = zero2; - -function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -utils.toHex = toHex; - -utils.encode = function encode(arr, enc) { - if (enc === 'hex') - return toHex(arr); - else - return arr; -}; -}(utils$m)); - -(function (exports) { - -var utils = exports; -var BN = bn$2.exports; -var minAssert = minimalisticAssert; -var minUtils = utils$m; - -utils.assert = minAssert; -utils.toArray = minUtils.toArray; -utils.zero2 = minUtils.zero2; -utils.toHex = minUtils.toHex; -utils.encode = minUtils.encode; - -// Represent num in a w-NAF form -function getNAF(num, w, bits) { - var naf = new Array(Math.max(num.bitLength(), bits) + 1); - naf.fill(0); - - var ws = 1 << (w + 1); - var k = num.clone(); - - for (var i = 0; i < naf.length; i++) { - var z; - var mod = k.andln(ws - 1); - if (k.isOdd()) { - if (mod > (ws >> 1) - 1) - z = (ws >> 1) - mod; - else - z = mod; - k.isubn(z); - } else { - z = 0; - } - - naf[i] = z; - k.iushrn(1); - } - - return naf; -} -utils.getNAF = getNAF; - -// Represent k1, k2 in a Joint Sparse Form -function getJSF(k1, k2) { - var jsf = [ - [], - [], - ]; - - k1 = k1.clone(); - k2 = k2.clone(); - var d1 = 0; - var d2 = 0; - var m8; - while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { - // First phase - var m14 = (k1.andln(3) + d1) & 3; - var m24 = (k2.andln(3) + d2) & 3; - if (m14 === 3) - m14 = -1; - if (m24 === 3) - m24 = -1; - var u1; - if ((m14 & 1) === 0) { - u1 = 0; - } else { - m8 = (k1.andln(7) + d1) & 7; - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - jsf[0].push(u1); - - var u2; - if ((m24 & 1) === 0) { - u2 = 0; - } else { - m8 = (k2.andln(7) + d2) & 7; - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - jsf[1].push(u2); - - // Second phase - if (2 * d1 === u1 + 1) - d1 = 1 - d1; - if (2 * d2 === u2 + 1) - d2 = 1 - d2; - k1.iushrn(1); - k2.iushrn(1); - } - - return jsf; -} -utils.getJSF = getJSF; - -function cachedProperty(obj, name, computer) { - var key = '_' + name; - obj.prototype[name] = function cachedProperty() { - return this[key] !== undefined ? this[key] : - this[key] = computer.call(this); - }; -} -utils.cachedProperty = cachedProperty; - -function parseBytes(bytes) { - return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : - bytes; -} -utils.parseBytes = parseBytes; - -function intFromLE(bytes) { - return new BN(bytes, 'hex', 'le'); -} -utils.intFromLE = intFromLE; -}(utils$n)); - -var brorand = {exports: {}}; - -var r$2; - -brorand.exports = function rand(len) { - if (!r$2) - r$2 = new Rand(null); - - return r$2.generate(len); -}; - -function Rand(rand) { - this.rand = rand; -} -brorand.exports.Rand = Rand; - -Rand.prototype.generate = function generate(len) { - return this._rand(len); -}; - -// Emulate crypto API using randy -Rand.prototype._rand = function _rand(n) { - if (this.rand.getBytes) - return this.rand.getBytes(n); - - var res = new Uint8Array(n); - for (var i = 0; i < res.length; i++) - res[i] = this.rand.getByte(); - return res; -}; - -if (typeof self === 'object') { - if (self.crypto && self.crypto.getRandomValues) { - // Modern browsers - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.crypto.getRandomValues(arr); - return arr; - }; - } else if (self.msCrypto && self.msCrypto.getRandomValues) { - // IE - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - self.msCrypto.getRandomValues(arr); - return arr; - }; - - // Safari's WebWorkers do not have `crypto` - } else if (typeof window === 'object') { - // Old junk - Rand.prototype._rand = function() { - throw new Error('Not implemented yet'); - }; - } -} else { - // Node.js or Web worker with no crypto support - try { - var crypto$i = require('crypto'); - if (typeof crypto$i.randomBytes !== 'function') - throw new Error('Not supported'); - - Rand.prototype._rand = function _rand(n) { - return crypto$i.randomBytes(n); - }; - } catch (e) { - } -} - -var curve$1 = {}; - -var BN$j = bn$2.exports; -var utils$l = utils$n; -var getNAF$1 = utils$l.getNAF; -var getJSF$1 = utils$l.getJSF; -var assert$3c = utils$l.assert; - -function BaseCurve(type, conf) { - this.type = type; - this.p = new BN$j(conf.p, 16); - - // Use Montgomery, when there is no fast reduction for the prime - this.red = conf.prime ? BN$j.red(conf.prime) : BN$j.mont(this.p); - - // Useful for many curves - this.zero = new BN$j(0).toRed(this.red); - this.one = new BN$j(1).toRed(this.red); - this.two = new BN$j(2).toRed(this.red); - - // Curve configuration, optional - this.n = conf.n && new BN$j(conf.n, 16); - this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); - - // Temporary arrays - this._wnafT1 = new Array(4); - this._wnafT2 = new Array(4); - this._wnafT3 = new Array(4); - this._wnafT4 = new Array(4); - - this._bitLength = this.n ? this.n.bitLength() : 0; - - // Generalized Greg Maxwell's trick - var adjustCount = this.n && this.p.div(this.n); - if (!adjustCount || adjustCount.cmpn(100) > 0) { - this.redN = null; - } else { - this._maxwellTrick = true; - this.redN = this.n.toRed(this.red); - } -} -var base$2 = BaseCurve; - -BaseCurve.prototype.point = function point() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype.validate = function validate() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { - assert$3c(p.precomputed); - var doubles = p._getDoubles(); - - var naf = getNAF$1(k, 1, this._bitLength); - var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); - I /= 3; - - // Translate into more windowed form - var repr = []; - var j; - var nafW; - for (j = 0; j < naf.length; j += doubles.step) { - nafW = 0; - for (var l = j + doubles.step - 1; l >= j; l--) - nafW = (nafW << 1) + naf[l]; - repr.push(nafW); - } - - var a = this.jpoint(null, null, null); - var b = this.jpoint(null, null, null); - for (var i = I; i > 0; i--) { - for (j = 0; j < repr.length; j++) { - nafW = repr[j]; - if (nafW === i) - b = b.mixedAdd(doubles.points[j]); - else if (nafW === -i) - b = b.mixedAdd(doubles.points[j].neg()); - } - a = a.add(b); - } - return a.toP(); -}; - -BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { - var w = 4; - - // Precompute window - var nafPoints = p._getNAFPoints(w); - w = nafPoints.wnd; - var wnd = nafPoints.points; - - // Get NAF form - var naf = getNAF$1(k, w, this._bitLength); - - // Add `this`*(N+1) for every w-NAF index - var acc = this.jpoint(null, null, null); - for (var i = naf.length - 1; i >= 0; i--) { - // Count zeroes - for (var l = 0; i >= 0 && naf[i] === 0; i--) - l++; - if (i >= 0) - l++; - acc = acc.dblp(l); - - if (i < 0) - break; - var z = naf[i]; - assert$3c(z !== 0); - if (p.type === 'affine') { - // J +- P - if (z > 0) - acc = acc.mixedAdd(wnd[(z - 1) >> 1]); - else - acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); - } else { - // J +- J - if (z > 0) - acc = acc.add(wnd[(z - 1) >> 1]); - else - acc = acc.add(wnd[(-z - 1) >> 1].neg()); - } - } - return p.type === 'affine' ? acc.toP() : acc; -}; - -BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, - points, - coeffs, - len, - jacobianResult) { - var wndWidth = this._wnafT1; - var wnd = this._wnafT2; - var naf = this._wnafT3; - - // Fill all arrays - var max = 0; - var i; - var j; - var p; - for (i = 0; i < len; i++) { - p = points[i]; - var nafPoints = p._getNAFPoints(defW); - wndWidth[i] = nafPoints.wnd; - wnd[i] = nafPoints.points; - } - - // Comb small window NAFs - for (i = len - 1; i >= 1; i -= 2) { - var a = i - 1; - var b = i; - if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { - naf[a] = getNAF$1(coeffs[a], wndWidth[a], this._bitLength); - naf[b] = getNAF$1(coeffs[b], wndWidth[b], this._bitLength); - max = Math.max(naf[a].length, max); - max = Math.max(naf[b].length, max); - continue; - } - - var comb = [ - points[a], /* 1 */ - null, /* 3 */ - null, /* 5 */ - points[b], /* 7 */ - ]; - - // Try to avoid Projective points, if possible - if (points[a].y.cmp(points[b].y) === 0) { - comb[1] = points[a].add(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].add(points[b].neg()); - } else { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } - - var index = [ - -3, /* -1 -1 */ - -1, /* -1 0 */ - -5, /* -1 1 */ - -7, /* 0 -1 */ - 0, /* 0 0 */ - 7, /* 0 1 */ - 5, /* 1 -1 */ - 1, /* 1 0 */ - 3, /* 1 1 */ - ]; - - var jsf = getJSF$1(coeffs[a], coeffs[b]); - max = Math.max(jsf[0].length, max); - naf[a] = new Array(max); - naf[b] = new Array(max); - for (j = 0; j < max; j++) { - var ja = jsf[0][j] | 0; - var jb = jsf[1][j] | 0; - - naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; - naf[b][j] = 0; - wnd[a] = comb; - } - } - - var acc = this.jpoint(null, null, null); - var tmp = this._wnafT4; - for (i = max; i >= 0; i--) { - var k = 0; - - while (i >= 0) { - var zero = true; - for (j = 0; j < len; j++) { - tmp[j] = naf[j][i] | 0; - if (tmp[j] !== 0) - zero = false; - } - if (!zero) - break; - k++; - i--; - } - if (i >= 0) - k++; - acc = acc.dblp(k); - if (i < 0) - break; - - for (j = 0; j < len; j++) { - var z = tmp[j]; - if (z === 0) - continue; - else if (z > 0) - p = wnd[j][(z - 1) >> 1]; - else if (z < 0) - p = wnd[j][(-z - 1) >> 1].neg(); - - if (p.type === 'affine') - acc = acc.mixedAdd(p); - else - acc = acc.add(p); - } - } - // Zeroify references - for (i = 0; i < len; i++) - wnd[i] = null; - - if (jacobianResult) - return acc; - else - return acc.toP(); -}; - -function BasePoint(curve, type) { - this.curve = curve; - this.type = type; - this.precomputed = null; -} -BaseCurve.BasePoint = BasePoint; - -BasePoint.prototype.eq = function eq(/*other*/) { - throw new Error('Not implemented'); -}; - -BasePoint.prototype.validate = function validate() { - return this.curve.validate(this); -}; - -BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - bytes = utils$l.toArray(bytes, enc); - - var len = this.p.byteLength(); - - // uncompressed, hybrid-odd, hybrid-even - if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && - bytes.length - 1 === 2 * len) { - if (bytes[0] === 0x06) - assert$3c(bytes[bytes.length - 1] % 2 === 0); - else if (bytes[0] === 0x07) - assert$3c(bytes[bytes.length - 1] % 2 === 1); - - var res = this.point(bytes.slice(1, 1 + len), - bytes.slice(1 + len, 1 + 2 * len)); - - return res; - } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && - bytes.length - 1 === len) { - return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); - } - throw new Error('Unknown point format'); -}; - -BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { - return this.encode(enc, true); -}; - -BasePoint.prototype._encode = function _encode(compact) { - var len = this.curve.p.byteLength(); - var x = this.getX().toArray('be', len); - - if (compact) - return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); - - return [ 0x04 ].concat(x, this.getY().toArray('be', len)); -}; - -BasePoint.prototype.encode = function encode(enc, compact) { - return utils$l.encode(this._encode(compact), enc); -}; - -BasePoint.prototype.precompute = function precompute(power) { - if (this.precomputed) - return this; - - var precomputed = { - doubles: null, - naf: null, - beta: null, - }; - precomputed.naf = this._getNAFPoints(8); - precomputed.doubles = this._getDoubles(4, power); - precomputed.beta = this._getBeta(); - this.precomputed = precomputed; - - return this; -}; - -BasePoint.prototype._hasDoubles = function _hasDoubles(k) { - if (!this.precomputed) - return false; - - var doubles = this.precomputed.doubles; - if (!doubles) - return false; - - return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); -}; - -BasePoint.prototype._getDoubles = function _getDoubles(step, power) { - if (this.precomputed && this.precomputed.doubles) - return this.precomputed.doubles; - - var doubles = [ this ]; - var acc = this; - for (var i = 0; i < power; i += step) { - for (var j = 0; j < step; j++) - acc = acc.dbl(); - doubles.push(acc); - } - return { - step: step, - points: doubles, - }; -}; - -BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { - if (this.precomputed && this.precomputed.naf) - return this.precomputed.naf; - - var res = [ this ]; - var max = (1 << wnd) - 1; - var dbl = max === 1 ? null : this.dbl(); - for (var i = 1; i < max; i++) - res[i] = res[i - 1].add(dbl); - return { - wnd: wnd, - points: res, - }; -}; - -BasePoint.prototype._getBeta = function _getBeta() { - return null; -}; - -BasePoint.prototype.dblp = function dblp(k) { - var r = this; - for (var i = 0; i < k; i++) - r = r.dbl(); - return r; -}; - -var utils$k = utils$n; -var BN$i = bn$2.exports; -var inherits$3 = inherits$9.exports; -var Base$2 = base$2; - -var assert$3b = utils$k.assert; - -function ShortCurve$1(conf) { - Base$2.call(this, 'short', conf); - - this.a = new BN$i(conf.a, 16).toRed(this.red); - this.b = new BN$i(conf.b, 16).toRed(this.red); - this.tinv = this.two.redInvm(); - - this.zeroA = this.a.fromRed().cmpn(0) === 0; - this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; - - // If the curve is endomorphic, precalculate beta and lambda - this.endo = this._getEndomorphism(conf); - this._endoWnafT1 = new Array(4); - this._endoWnafT2 = new Array(4); -} -inherits$3(ShortCurve$1, Base$2); -var short = ShortCurve$1; - -ShortCurve$1.prototype._getEndomorphism = function _getEndomorphism(conf) { - // No efficient endomorphism - if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) - return; - - // Compute beta and lambda, that lambda * P = (beta * Px; Py) - var beta; - var lambda; - if (conf.beta) { - beta = new BN$i(conf.beta, 16).toRed(this.red); - } else { - var betas = this._getEndoRoots(this.p); - // Choose the smallest beta - beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; - beta = beta.toRed(this.red); - } - if (conf.lambda) { - lambda = new BN$i(conf.lambda, 16); - } else { - // Choose the lambda that is matching selected beta - var lambdas = this._getEndoRoots(this.n); - if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { - lambda = lambdas[0]; - } else { - lambda = lambdas[1]; - assert$3b(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); - } - } - - // Get basis vectors, used for balanced length-two representation - var basis; - if (conf.basis) { - basis = conf.basis.map(function(vec) { - return { - a: new BN$i(vec.a, 16), - b: new BN$i(vec.b, 16), - }; - }); - } else { - basis = this._getEndoBasis(lambda); - } - - return { - beta: beta, - lambda: lambda, - basis: basis, - }; -}; - -ShortCurve$1.prototype._getEndoRoots = function _getEndoRoots(num) { - // Find roots of for x^2 + x + 1 in F - // Root = (-1 +- Sqrt(-3)) / 2 - // - var red = num === this.p ? this.red : BN$i.mont(num); - var tinv = new BN$i(2).toRed(red).redInvm(); - var ntinv = tinv.redNeg(); - - var s = new BN$i(3).toRed(red).redNeg().redSqrt().redMul(tinv); - - var l1 = ntinv.redAdd(s).fromRed(); - var l2 = ntinv.redSub(s).fromRed(); - return [ l1, l2 ]; -}; - -ShortCurve$1.prototype._getEndoBasis = function _getEndoBasis(lambda) { - // aprxSqrt >= sqrt(this.n) - var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); - - // 3.74 - // Run EGCD, until r(L + 1) < aprxSqrt - var u = lambda; - var v = this.n.clone(); - var x1 = new BN$i(1); - var y1 = new BN$i(0); - var x2 = new BN$i(0); - var y2 = new BN$i(1); - - // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) - var a0; - var b0; - // First vector - var a1; - var b1; - // Second vector - var a2; - var b2; - - var prevR; - var i = 0; - var r; - var x; - while (u.cmpn(0) !== 0) { - var q = v.div(u); - r = v.sub(q.mul(u)); - x = x2.sub(q.mul(x1)); - var y = y2.sub(q.mul(y1)); - - if (!a1 && r.cmp(aprxSqrt) < 0) { - a0 = prevR.neg(); - b0 = x1; - a1 = r.neg(); - b1 = x; - } else if (a1 && ++i === 2) { - break; - } - prevR = r; - - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - } - a2 = r.neg(); - b2 = x; - - var len1 = a1.sqr().add(b1.sqr()); - var len2 = a2.sqr().add(b2.sqr()); - if (len2.cmp(len1) >= 0) { - a2 = a0; - b2 = b0; - } - - // Normalize signs - if (a1.negative) { - a1 = a1.neg(); - b1 = b1.neg(); - } - if (a2.negative) { - a2 = a2.neg(); - b2 = b2.neg(); - } - - return [ - { a: a1, b: b1 }, - { a: a2, b: b2 }, - ]; -}; - -ShortCurve$1.prototype._endoSplit = function _endoSplit(k) { - var basis = this.endo.basis; - var v1 = basis[0]; - var v2 = basis[1]; - - var c1 = v2.b.mul(k).divRound(this.n); - var c2 = v1.b.neg().mul(k).divRound(this.n); - - var p1 = c1.mul(v1.a); - var p2 = c2.mul(v2.a); - var q1 = c1.mul(v1.b); - var q2 = c2.mul(v2.b); - - // Calculate answer - var k1 = k.sub(p1).sub(p2); - var k2 = q1.add(q2).neg(); - return { k1: k1, k2: k2 }; -}; - -ShortCurve$1.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN$i(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - // XXX Is there any way to tell if the number is odd without converting it - // to non-red form? - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -ShortCurve$1.prototype.validate = function validate(point) { - if (point.inf) - return true; - - var x = point.x; - var y = point.y; - - var ax = this.a.redMul(x); - var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); - return y.redSqr().redISub(rhs).cmpn(0) === 0; -}; - -ShortCurve$1.prototype._endoWnafMulAdd = - function _endoWnafMulAdd(points, coeffs, jacobianResult) { - var npoints = this._endoWnafT1; - var ncoeffs = this._endoWnafT2; - for (var i = 0; i < points.length; i++) { - var split = this._endoSplit(coeffs[i]); - var p = points[i]; - var beta = p._getBeta(); - - if (split.k1.negative) { - split.k1.ineg(); - p = p.neg(true); - } - if (split.k2.negative) { - split.k2.ineg(); - beta = beta.neg(true); - } - - npoints[i * 2] = p; - npoints[i * 2 + 1] = beta; - ncoeffs[i * 2] = split.k1; - ncoeffs[i * 2 + 1] = split.k2; - } - var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); - - // Clean-up references to points and coefficients - for (var j = 0; j < i * 2; j++) { - npoints[j] = null; - ncoeffs[j] = null; - } - return res; - }; - -function Point$3(curve, x, y, isRed) { - Base$2.BasePoint.call(this, curve, 'affine'); - if (x === null && y === null) { - this.x = null; - this.y = null; - this.inf = true; - } else { - this.x = new BN$i(x, 16); - this.y = new BN$i(y, 16); - // Force redgomery representation when loading from JSON - if (isRed) { - this.x.forceRed(this.curve.red); - this.y.forceRed(this.curve.red); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - this.inf = false; - } -} -inherits$3(Point$3, Base$2.BasePoint); - -ShortCurve$1.prototype.point = function point(x, y, isRed) { - return new Point$3(this, x, y, isRed); -}; - -ShortCurve$1.prototype.pointFromJSON = function pointFromJSON(obj, red) { - return Point$3.fromJSON(this, obj, red); -}; - -Point$3.prototype._getBeta = function _getBeta() { - if (!this.curve.endo) - return; - - var pre = this.precomputed; - if (pre && pre.beta) - return pre.beta; - - var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); - if (pre) { - var curve = this.curve; - var endoMul = function(p) { - return curve.point(p.x.redMul(curve.endo.beta), p.y); - }; - pre.beta = beta; - beta.precomputed = { - beta: null, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(endoMul), - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(endoMul), - }, - }; - } - return beta; -}; - -Point$3.prototype.toJSON = function toJSON() { - if (!this.precomputed) - return [ this.x, this.y ]; - - return [ this.x, this.y, this.precomputed && { - doubles: this.precomputed.doubles && { - step: this.precomputed.doubles.step, - points: this.precomputed.doubles.points.slice(1), - }, - naf: this.precomputed.naf && { - wnd: this.precomputed.naf.wnd, - points: this.precomputed.naf.points.slice(1), - }, - } ]; -}; - -Point$3.fromJSON = function fromJSON(curve, obj, red) { - if (typeof obj === 'string') - obj = JSON.parse(obj); - var res = curve.point(obj[0], obj[1], red); - if (!obj[2]) - return res; - - function obj2point(obj) { - return curve.point(obj[0], obj[1], red); - } - - var pre = obj[2]; - res.precomputed = { - beta: null, - doubles: pre.doubles && { - step: pre.doubles.step, - points: [ res ].concat(pre.doubles.points.map(obj2point)), - }, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: [ res ].concat(pre.naf.points.map(obj2point)), - }, - }; - return res; -}; - -Point$3.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point$3.prototype.isInfinity = function isInfinity() { - return this.inf; -}; - -Point$3.prototype.add = function add(p) { - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P = 2P - if (this.eq(p)) - return this.dbl(); - - // P + (-P) = O - if (this.neg().eq(p)) - return this.curve.point(null, null); - - // P + Q = O - if (this.x.cmp(p.x) === 0) - return this.curve.point(null, null); - - var c = this.y.redSub(p.y); - if (c.cmpn(0) !== 0) - c = c.redMul(this.x.redSub(p.x).redInvm()); - var nx = c.redSqr().redISub(this.x).redISub(p.x); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point$3.prototype.dbl = function dbl() { - if (this.inf) - return this; - - // 2P = O - var ys1 = this.y.redAdd(this.y); - if (ys1.cmpn(0) === 0) - return this.curve.point(null, null); - - var a = this.curve.a; - - var x2 = this.x.redSqr(); - var dyinv = ys1.redInvm(); - var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); - - var nx = c.redSqr().redISub(this.x.redAdd(this.x)); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point$3.prototype.getX = function getX() { - return this.x.fromRed(); -}; - -Point$3.prototype.getY = function getY() { - return this.y.fromRed(); -}; - -Point$3.prototype.mul = function mul(k) { - k = new BN$i(k, 16); - if (this.isInfinity()) - return this; - else if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else if (this.curve.endo) - return this.curve._endoWnafMulAdd([ this ], [ k ]); - else - return this.curve._wnafMul(this, k); -}; - -Point$3.prototype.mulAdd = function mulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2); -}; - -Point$3.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs, true); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2, true); -}; - -Point$3.prototype.eq = function eq(p) { - return this === p || - this.inf === p.inf && - (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); -}; - -Point$3.prototype.neg = function neg(_precompute) { - if (this.inf) - return this; - - var res = this.curve.point(this.x, this.y.redNeg()); - if (_precompute && this.precomputed) { - var pre = this.precomputed; - var negate = function(p) { - return p.neg(); - }; - res.precomputed = { - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(negate), - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(negate), - }, - }; - } - return res; -}; - -Point$3.prototype.toJ = function toJ() { - if (this.inf) - return this.curve.jpoint(null, null, null); - - var res = this.curve.jpoint(this.x, this.y, this.curve.one); - return res; -}; - -function JPoint$1(curve, x, y, z) { - Base$2.BasePoint.call(this, curve, 'jacobian'); - if (x === null && y === null && z === null) { - this.x = this.curve.one; - this.y = this.curve.one; - this.z = new BN$i(0); - } else { - this.x = new BN$i(x, 16); - this.y = new BN$i(y, 16); - this.z = new BN$i(z, 16); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z === this.curve.one; -} -inherits$3(JPoint$1, Base$2.BasePoint); - -ShortCurve$1.prototype.jpoint = function jpoint(x, y, z) { - return new JPoint$1(this, x, y, z); -}; - -JPoint$1.prototype.toP = function toP() { - if (this.isInfinity()) - return this.curve.point(null, null); - - var zinv = this.z.redInvm(); - var zinv2 = zinv.redSqr(); - var ax = this.x.redMul(zinv2); - var ay = this.y.redMul(zinv2).redMul(zinv); - - return this.curve.point(ax, ay); -}; - -JPoint$1.prototype.neg = function neg() { - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); -}; - -JPoint$1.prototype.add = function add(p) { - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // 12M + 4S + 7A - var pz2 = p.z.redSqr(); - var z2 = this.z.redSqr(); - var u1 = this.x.redMul(pz2); - var u2 = p.x.redMul(z2); - var s1 = this.y.redMul(pz2.redMul(p.z)); - var s2 = p.y.redMul(z2.redMul(this.z)); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype.mixedAdd = function mixedAdd(p) { - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - // 8M + 3S + 7A - var z2 = this.z.redSqr(); - var u1 = this.x; - var u2 = p.x.redMul(z2); - var s1 = this.y; - var s2 = p.y.redMul(z2).redMul(this.z); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype.dblp = function dblp(pow) { - if (pow === 0) - return this; - if (this.isInfinity()) - return this; - if (!pow) - return this.dbl(); - - var i; - if (this.curve.zeroA || this.curve.threeA) { - var r = this; - for (i = 0; i < pow; i++) - r = r.dbl(); - return r; - } - - // 1M + 2S + 1A + N * (4S + 5M + 8A) - // N = 1 => 6M + 6S + 9A - var a = this.curve.a; - var tinv = this.curve.tinv; - - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - // Reuse results - var jyd = jy.redAdd(jy); - for (i = 0; i < pow; i++) { - var jx2 = jx.redSqr(); - var jyd2 = jyd.redSqr(); - var jyd4 = jyd2.redSqr(); - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var t1 = jx.redMul(jyd2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - var dny = c.redMul(t2); - dny = dny.redIAdd(dny).redISub(jyd4); - var nz = jyd.redMul(jz); - if (i + 1 < pow) - jz4 = jz4.redMul(jyd4); - - jx = nx; - jz = nz; - jyd = dny; - } - - return this.curve.jpoint(jx, jyd.redMul(tinv), jz); -}; - -JPoint$1.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - if (this.curve.zeroA) - return this._zeroDbl(); - else if (this.curve.threeA) - return this._threeDbl(); - else - return this._dbl(); -}; - -JPoint$1.prototype._zeroDbl = function _zeroDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 14A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // T = M ^ 2 - 2*S - var t = m.redSqr().redISub(s).redISub(s); - - // 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2*Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-dbl-2009-l - // 2M + 5S + 13A - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = B^2 - var c = b.redSqr(); - // D = 2 * ((X1 + B)^2 - A - C) - var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); - d = d.redIAdd(d); - // E = 3 * A - var e = a.redAdd(a).redIAdd(a); - // F = E^2 - var f = e.redSqr(); - - // 8 * C - var c8 = c.redIAdd(c); - c8 = c8.redIAdd(c8); - c8 = c8.redIAdd(c8); - - // X3 = F - 2 * D - nx = f.redISub(d).redISub(d); - // Y3 = E * (D - X3) - 8 * C - ny = e.redMul(d.redISub(nx)).redISub(c8); - // Z3 = 2 * Y1 * Z1 - nz = this.y.redMul(this.z); - nz = nz.redIAdd(nz); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype._threeDbl = function _threeDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 15A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a - var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); - // T = M^2 - 2 * S - var t = m.redSqr().redISub(s).redISub(s); - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2 * Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S - - // delta = Z1^2 - var delta = this.z.redSqr(); - // gamma = Y1^2 - var gamma = this.y.redSqr(); - // beta = X1 * gamma - var beta = this.x.redMul(gamma); - // alpha = 3 * (X1 - delta) * (X1 + delta) - var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); - alpha = alpha.redAdd(alpha).redIAdd(alpha); - // X3 = alpha^2 - 8 * beta - var beta4 = beta.redIAdd(beta); - beta4 = beta4.redIAdd(beta4); - var beta8 = beta4.redAdd(beta4); - nx = alpha.redSqr().redISub(beta8); - // Z3 = (Y1 + Z1)^2 - gamma - delta - nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - var ggamma8 = gamma.redSqr(); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype._dbl = function _dbl() { - var a = this.curve.a; - - // 4M + 6S + 10A - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - var jx2 = jx.redSqr(); - var jy2 = jy.redSqr(); - - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var jxd4 = jx.redAdd(jx); - jxd4 = jxd4.redIAdd(jxd4); - var t1 = jxd4.redMul(jy2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - - var jyd8 = jy2.redSqr(); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - var ny = c.redMul(t2).redISub(jyd8); - var nz = jy.redAdd(jy).redMul(jz); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype.trpl = function trpl() { - if (!this.curve.zeroA) - return this.dbl().add(this); - - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl - // 5M + 10S + ... - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // ZZ = Z1^2 - var zz = this.z.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // M = 3 * XX + a * ZZ2; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // MM = M^2 - var mm = m.redSqr(); - // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM - var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - e = e.redIAdd(e); - e = e.redAdd(e).redIAdd(e); - e = e.redISub(mm); - // EE = E^2 - var ee = e.redSqr(); - // T = 16*YYYY - var t = yyyy.redIAdd(yyyy); - t = t.redIAdd(t); - t = t.redIAdd(t); - t = t.redIAdd(t); - // U = (M + E)^2 - MM - EE - T - var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); - // X3 = 4 * (X1 * EE - 4 * YY * U) - var yyu4 = yy.redMul(u); - yyu4 = yyu4.redIAdd(yyu4); - yyu4 = yyu4.redIAdd(yyu4); - var nx = this.x.redMul(ee).redISub(yyu4); - nx = nx.redIAdd(nx); - nx = nx.redIAdd(nx); - // Y3 = 8 * Y1 * (U * (T - U) - E * EE) - var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - // Z3 = (Z1 + E)^2 - ZZ - EE - var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint$1.prototype.mul = function mul(k, kbase) { - k = new BN$i(k, kbase); - - return this.curve._wnafMul(this, k); -}; - -JPoint$1.prototype.eq = function eq(p) { - if (p.type === 'affine') - return this.eq(p.toJ()); - - if (this === p) - return true; - - // x1 * z2^2 == x2 * z1^2 - var z2 = this.z.redSqr(); - var pz2 = p.z.redSqr(); - if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) - return false; - - // y1 * z2^3 == y2 * z1^3 - var z3 = z2.redMul(this.z); - var pz3 = pz2.redMul(p.z); - return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; -}; - -JPoint$1.prototype.eqXToP = function eqXToP(x) { - var zs = this.z.redSqr(); - var rx = x.toRed(this.curve.red).redMul(zs); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(zs); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } -}; - -JPoint$1.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -JPoint$1.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; - -var BN$h = bn$2.exports; -var inherits$2 = inherits$9.exports; -var Base$1 = base$2; - -var utils$j = utils$n; - -function MontCurve$1(conf) { - Base$1.call(this, 'mont', conf); - - this.a = new BN$h(conf.a, 16).toRed(this.red); - this.b = new BN$h(conf.b, 16).toRed(this.red); - this.i4 = new BN$h(4).toRed(this.red).redInvm(); - this.two = new BN$h(2).toRed(this.red); - this.a24 = this.i4.redMul(this.a.redAdd(this.two)); -} -inherits$2(MontCurve$1, Base$1); -var mont = MontCurve$1; - -MontCurve$1.prototype.validate = function validate(point) { - var x = point.normalize().x; - var x2 = x.redSqr(); - var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); - var y = rhs.redSqrt(); - - return y.redSqr().cmp(rhs) === 0; -}; - -function Point$2(curve, x, z) { - Base$1.BasePoint.call(this, curve, 'projective'); - if (x === null && z === null) { - this.x = this.curve.one; - this.z = this.curve.zero; - } else { - this.x = new BN$h(x, 16); - this.z = new BN$h(z, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } -} -inherits$2(Point$2, Base$1.BasePoint); - -MontCurve$1.prototype.decodePoint = function decodePoint(bytes, enc) { - return this.point(utils$j.toArray(bytes, enc), 1); -}; - -MontCurve$1.prototype.point = function point(x, z) { - return new Point$2(this, x, z); -}; - -MontCurve$1.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point$2.fromJSON(this, obj); -}; - -Point$2.prototype.precompute = function precompute() { - // No-op -}; - -Point$2.prototype._encode = function _encode() { - return this.getX().toArray('be', this.curve.p.byteLength()); -}; - -Point$2.fromJSON = function fromJSON(curve, obj) { - return new Point$2(curve, obj[0], obj[1] || curve.one); -}; - -Point$2.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point$2.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; - -Point$2.prototype.dbl = function dbl() { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A - - // A = X1 + Z1 - var a = this.x.redAdd(this.z); - // AA = A^2 - var aa = a.redSqr(); - // B = X1 - Z1 - var b = this.x.redSub(this.z); - // BB = B^2 - var bb = b.redSqr(); - // C = AA - BB - var c = aa.redSub(bb); - // X3 = AA * BB - var nx = aa.redMul(bb); - // Z3 = C * (BB + A24 * C) - var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); - return this.curve.point(nx, nz); -}; - -Point$2.prototype.add = function add() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point$2.prototype.diffAdd = function diffAdd(p, diff) { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 - // 4M + 2S + 6A - - // A = X2 + Z2 - var a = this.x.redAdd(this.z); - // B = X2 - Z2 - var b = this.x.redSub(this.z); - // C = X3 + Z3 - var c = p.x.redAdd(p.z); - // D = X3 - Z3 - var d = p.x.redSub(p.z); - // DA = D * A - var da = d.redMul(a); - // CB = C * B - var cb = c.redMul(b); - // X5 = Z1 * (DA + CB)^2 - var nx = diff.z.redMul(da.redAdd(cb).redSqr()); - // Z5 = X1 * (DA - CB)^2 - var nz = diff.x.redMul(da.redISub(cb).redSqr()); - return this.curve.point(nx, nz); -}; - -Point$2.prototype.mul = function mul(k) { - var t = k.clone(); - var a = this; // (N / 2) * Q + Q - var b = this.curve.point(null, null); // (N / 2) * Q - var c = this; // Q - - for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) - bits.push(t.andln(1)); - - for (var i = bits.length - 1; i >= 0; i--) { - if (bits[i] === 0) { - // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q - a = a.diffAdd(b, c); - // N * Q = 2 * ((N / 2) * Q + Q)) - b = b.dbl(); - } else { - // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) - b = a.diffAdd(b, c); - // N * Q + Q = 2 * ((N / 2) * Q + Q) - a = a.dbl(); - } - } - return b; -}; - -Point$2.prototype.mulAdd = function mulAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point$2.prototype.jumlAdd = function jumlAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point$2.prototype.eq = function eq(other) { - return this.getX().cmp(other.getX()) === 0; -}; - -Point$2.prototype.normalize = function normalize() { - this.x = this.x.redMul(this.z.redInvm()); - this.z = this.curve.one; - return this; -}; - -Point$2.prototype.getX = function getX() { - // Normalize coordinates - this.normalize(); - - return this.x.fromRed(); -}; - -var utils$i = utils$n; -var BN$g = bn$2.exports; -var inherits$1 = inherits$9.exports; -var Base = base$2; - -var assert$3a = utils$i.assert; - -function EdwardsCurve$1(conf) { - // NOTE: Important as we are creating point in Base.call() - this.twisted = (conf.a | 0) !== 1; - this.mOneA = this.twisted && (conf.a | 0) === -1; - this.extended = this.mOneA; - - Base.call(this, 'edwards', conf); - - this.a = new BN$g(conf.a, 16).umod(this.red.m); - this.a = this.a.toRed(this.red); - this.c = new BN$g(conf.c, 16).toRed(this.red); - this.c2 = this.c.redSqr(); - this.d = new BN$g(conf.d, 16).toRed(this.red); - this.dd = this.d.redAdd(this.d); - - assert$3a(!this.twisted || this.c.fromRed().cmpn(1) === 0); - this.oneC = (conf.c | 0) === 1; -} -inherits$1(EdwardsCurve$1, Base); -var edwards = EdwardsCurve$1; - -EdwardsCurve$1.prototype._mulA = function _mulA(num) { - if (this.mOneA) - return num.redNeg(); - else - return this.a.redMul(num); -}; - -EdwardsCurve$1.prototype._mulC = function _mulC(num) { - if (this.oneC) - return num; - else - return this.c.redMul(num); -}; - -// Just for compatibility with Short curve -EdwardsCurve$1.prototype.jpoint = function jpoint(x, y, z, t) { - return this.point(x, y, z, t); -}; - -EdwardsCurve$1.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN$g(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var x2 = x.redSqr(); - var rhs = this.c2.redSub(this.a.redMul(x2)); - var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); - - var y2 = rhs.redMul(lhs.redInvm()); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve$1.prototype.pointFromY = function pointFromY(y, odd) { - y = new BN$g(y, 16); - if (!y.red) - y = y.toRed(this.red); - - // x^2 = (y^2 - c^2) / (c^2 d y^2 - a) - var y2 = y.redSqr(); - var lhs = y2.redSub(this.c2); - var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); - var x2 = lhs.redMul(rhs.redInvm()); - - if (x2.cmp(this.zero) === 0) { - if (odd) - throw new Error('invalid point'); - else - return this.point(this.zero, y); - } - - var x = x2.redSqrt(); - if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - if (x.fromRed().isOdd() !== odd) - x = x.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve$1.prototype.validate = function validate(point) { - if (point.isInfinity()) - return true; - - // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) - point.normalize(); - - var x2 = point.x.redSqr(); - var y2 = point.y.redSqr(); - var lhs = x2.redMul(this.a).redAdd(y2); - var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); - - return lhs.cmp(rhs) === 0; -}; - -function Point$1(curve, x, y, z, t) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && y === null && z === null) { - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - } else { - this.x = new BN$g(x, 16); - this.y = new BN$g(y, 16); - this.z = z ? new BN$g(z, 16) : this.curve.one; - this.t = t && new BN$g(t, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - this.zOne = this.z === this.curve.one; - - // Use extended coordinates - if (this.curve.extended && !this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redMul(this.z.redInvm()); - } - } -} -inherits$1(Point$1, Base.BasePoint); - -EdwardsCurve$1.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point$1.fromJSON(this, obj); -}; - -EdwardsCurve$1.prototype.point = function point(x, y, z, t) { - return new Point$1(this, x, y, z, t); -}; - -Point$1.fromJSON = function fromJSON(curve, obj) { - return new Point$1(curve, obj[0], obj[1], obj[2]); -}; - -Point$1.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point$1.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.x.cmpn(0) === 0 && - (this.y.cmp(this.z) === 0 || - (this.zOne && this.y.cmp(this.curve.c) === 0)); -}; - -Point$1.prototype._extDbl = function _extDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #doubling-dbl-2008-hwcd - // 4M + 4S - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = 2 * Z1^2 - var c = this.z.redSqr(); - c = c.redIAdd(c); - // D = a * A - var d = this.curve._mulA(a); - // E = (X1 + Y1)^2 - A - B - var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - // G = D + B - var g = d.redAdd(b); - // F = G - C - var f = g.redSub(c); - // H = D - B - var h = d.redSub(b); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point$1.prototype._projDbl = function _projDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #doubling-dbl-2008-bbjlp - // #doubling-dbl-2007-bl - // and others - // Generally 3M + 4S or 2M + 4S - - // B = (X1 + Y1)^2 - var b = this.x.redAdd(this.y).redSqr(); - // C = X1^2 - var c = this.x.redSqr(); - // D = Y1^2 - var d = this.y.redSqr(); - - var nx; - var ny; - var nz; - var e; - var h; - var j; - if (this.curve.twisted) { - // E = a * C - e = this.curve._mulA(c); - // F = E + D - var f = e.redAdd(d); - if (this.zOne) { - // X3 = (B - C - D) * (F - 2) - nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F^2 - 2 * F - nz = f.redSqr().redSub(f).redSub(f); - } else { - // H = Z1^2 - h = this.z.redSqr(); - // J = F - 2 * H - j = f.redSub(h).redISub(h); - // X3 = (B-C-D)*J - nx = b.redSub(c).redISub(d).redMul(j); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F * J - nz = f.redMul(j); - } - } else { - // E = C + D - e = c.redAdd(d); - // H = (c * Z1)^2 - h = this.curve._mulC(this.z).redSqr(); - // J = E - 2 * H - j = e.redSub(h).redSub(h); - // X3 = c * (B - E) * J - nx = this.curve._mulC(b.redISub(e)).redMul(j); - // Y3 = c * E * (C - D) - ny = this.curve._mulC(e).redMul(c.redISub(d)); - // Z3 = E * J - nz = e.redMul(j); - } - return this.curve.point(nx, ny, nz); -}; - -Point$1.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - // Double in extended coordinates - if (this.curve.extended) - return this._extDbl(); - else - return this._projDbl(); -}; - -Point$1.prototype._extAdd = function _extAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #addition-add-2008-hwcd-3 - // 8M - - // A = (Y1 - X1) * (Y2 - X2) - var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - // B = (Y1 + X1) * (Y2 + X2) - var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - // C = T1 * k * T2 - var c = this.t.redMul(this.curve.dd).redMul(p.t); - // D = Z1 * 2 * Z2 - var d = this.z.redMul(p.z.redAdd(p.z)); - // E = B - A - var e = b.redSub(a); - // F = D - C - var f = d.redSub(c); - // G = D + C - var g = d.redAdd(c); - // H = B + A - var h = b.redAdd(a); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point$1.prototype._projAdd = function _projAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #addition-add-2008-bbjlp - // #addition-add-2007-bl - // 10M + 1S - - // A = Z1 * Z2 - var a = this.z.redMul(p.z); - // B = A^2 - var b = a.redSqr(); - // C = X1 * X2 - var c = this.x.redMul(p.x); - // D = Y1 * Y2 - var d = this.y.redMul(p.y); - // E = d * C * D - var e = this.curve.d.redMul(c).redMul(d); - // F = B - E - var f = b.redSub(e); - // G = B + E - var g = b.redAdd(e); - // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) - var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); - var nx = a.redMul(f).redMul(tmp); - var ny; - var nz; - if (this.curve.twisted) { - // Y3 = A * G * (D - a * C) - ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); - // Z3 = F * G - nz = f.redMul(g); - } else { - // Y3 = A * G * (D - C) - ny = a.redMul(g).redMul(d.redSub(c)); - // Z3 = c * F * G - nz = this.curve._mulC(f).redMul(g); - } - return this.curve.point(nx, ny, nz); -}; - -Point$1.prototype.add = function add(p) { - if (this.isInfinity()) - return p; - if (p.isInfinity()) - return this; - - if (this.curve.extended) - return this._extAdd(p); - else - return this._projAdd(p); -}; - -Point$1.prototype.mul = function mul(k) { - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else - return this.curve._wnafMul(this, k); -}; - -Point$1.prototype.mulAdd = function mulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); -}; - -Point$1.prototype.jmulAdd = function jmulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); -}; - -Point$1.prototype.normalize = function normalize() { - if (this.zOne) - return this; - - // Normalize coordinates - var zi = this.z.redInvm(); - this.x = this.x.redMul(zi); - this.y = this.y.redMul(zi); - if (this.t) - this.t = this.t.redMul(zi); - this.z = this.curve.one; - this.zOne = true; - return this; -}; - -Point$1.prototype.neg = function neg() { - return this.curve.point(this.x.redNeg(), - this.y, - this.z, - this.t && this.t.redNeg()); -}; - -Point$1.prototype.getX = function getX() { - this.normalize(); - return this.x.fromRed(); -}; - -Point$1.prototype.getY = function getY() { - this.normalize(); - return this.y.fromRed(); -}; - -Point$1.prototype.eq = function eq(other) { - return this === other || - this.getX().cmp(other.getX()) === 0 && - this.getY().cmp(other.getY()) === 0; -}; - -Point$1.prototype.eqXToP = function eqXToP(x) { - var rx = x.toRed(this.curve.red).redMul(this.z); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(this.z); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } -}; - -// Compatibility with BaseCurve -Point$1.prototype.toP = Point$1.prototype.normalize; -Point$1.prototype.mixedAdd = Point$1.prototype.add; - -(function (exports) { - -var curve = exports; - -curve.base = base$2; -curve.short = short; -curve.mont = mont; -curve.edwards = edwards; -}(curve$1)); - -var curves$3 = {}; - -var hash$3 = {}; - -var utils$h = {}; - -var assert$39 = minimalisticAssert; -var inherits = inherits$9.exports; - -utils$h.inherits = inherits; - -function isSurrogatePair(msg, i) { - if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) { - return false; - } - if (i < 0 || i + 1 >= msg.length) { - return false; - } - return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00; -} - -function toArray$1(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg === 'string') { - if (!enc) { - // Inspired by stringToUtf8ByteArray() in closure-library by Google - // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143 - // Apache License 2.0 - // https://github.com/google/closure-library/blob/master/LICENSE - var p = 0; - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - if (c < 128) { - res[p++] = c; - } else if (c < 2048) { - res[p++] = (c >> 6) | 192; - res[p++] = (c & 63) | 128; - } else if (isSurrogatePair(msg, i)) { - c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF); - res[p++] = (c >> 18) | 240; - res[p++] = ((c >> 12) & 63) | 128; - res[p++] = ((c >> 6) & 63) | 128; - res[p++] = (c & 63) | 128; - } else { - res[p++] = (c >> 12) | 224; - res[p++] = ((c >> 6) & 63) | 128; - res[p++] = (c & 63) | 128; - } - } - } else if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } - } else { - for (i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - } - return res; -} -utils$h.toArray = toArray$1; - -function toHex$2(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -utils$h.toHex = toHex$2; - -function htonl(w) { - var res = (w >>> 24) | - ((w >>> 8) & 0xff00) | - ((w << 8) & 0xff0000) | - ((w & 0xff) << 24); - return res >>> 0; -} -utils$h.htonl = htonl; - -function toHex32(msg, endian) { - var res = ''; - for (var i = 0; i < msg.length; i++) { - var w = msg[i]; - if (endian === 'little') - w = htonl(w); - res += zero8(w.toString(16)); - } - return res; -} -utils$h.toHex32 = toHex32; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -utils$h.zero2 = zero2; - -function zero8(word) { - if (word.length === 7) - return '0' + word; - else if (word.length === 6) - return '00' + word; - else if (word.length === 5) - return '000' + word; - else if (word.length === 4) - return '0000' + word; - else if (word.length === 3) - return '00000' + word; - else if (word.length === 2) - return '000000' + word; - else if (word.length === 1) - return '0000000' + word; - else - return word; -} -utils$h.zero8 = zero8; - -function join32(msg, start, end, endian) { - var len = end - start; - assert$39(len % 4 === 0); - var res = new Array(len / 4); - for (var i = 0, k = start; i < res.length; i++, k += 4) { - var w; - if (endian === 'big') - w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; - else - w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; - res[i] = w >>> 0; - } - return res; -} -utils$h.join32 = join32; - -function split32(msg, endian) { - var res = new Array(msg.length * 4); - for (var i = 0, k = 0; i < msg.length; i++, k += 4) { - var m = msg[i]; - if (endian === 'big') { - res[k] = m >>> 24; - res[k + 1] = (m >>> 16) & 0xff; - res[k + 2] = (m >>> 8) & 0xff; - res[k + 3] = m & 0xff; - } else { - res[k + 3] = m >>> 24; - res[k + 2] = (m >>> 16) & 0xff; - res[k + 1] = (m >>> 8) & 0xff; - res[k] = m & 0xff; - } - } - return res; -} -utils$h.split32 = split32; - -function rotr32$1(w, b) { - return (w >>> b) | (w << (32 - b)); -} -utils$h.rotr32 = rotr32$1; - -function rotl32$6(w, b) { - return (w << b) | (w >>> (32 - b)); -} -utils$h.rotl32 = rotl32$6; - -function sum32$3(a, b) { - return (a + b) >>> 0; -} -utils$h.sum32 = sum32$3; - -function sum32_3$1(a, b, c) { - return (a + b + c) >>> 0; -} -utils$h.sum32_3 = sum32_3$1; - -function sum32_4$2(a, b, c, d) { - return (a + b + c + d) >>> 0; -} -utils$h.sum32_4 = sum32_4$2; - -function sum32_5$2(a, b, c, d, e) { - return (a + b + c + d + e) >>> 0; -} -utils$h.sum32_5 = sum32_5$2; - -function sum64$2(buf, pos, ah, al) { - var bh = buf[pos]; - var bl = buf[pos + 1]; - - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - buf[pos] = hi >>> 0; - buf[pos + 1] = lo; -} -utils$h.sum64 = sum64$2; - -function sum64_hi$2(ah, al, bh, bl) { - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - return hi >>> 0; -} -utils$h.sum64_hi = sum64_hi$2; - -function sum64_lo$2(ah, al, bh, bl) { - var lo = al + bl; - return lo >>> 0; -} -utils$h.sum64_lo = sum64_lo$2; - -function sum64_4_hi$2(ah, al, bh, bl, ch, cl, dh, dl) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - - var hi = ah + bh + ch + dh + carry; - return hi >>> 0; -} -utils$h.sum64_4_hi = sum64_4_hi$2; - -function sum64_4_lo$2(ah, al, bh, bl, ch, cl, dh, dl) { - var lo = al + bl + cl + dl; - return lo >>> 0; -} -utils$h.sum64_4_lo = sum64_4_lo$2; - -function sum64_5_hi$2(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - lo = (lo + el) >>> 0; - carry += lo < el ? 1 : 0; - - var hi = ah + bh + ch + dh + eh + carry; - return hi >>> 0; -} -utils$h.sum64_5_hi = sum64_5_hi$2; - -function sum64_5_lo$2(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var lo = al + bl + cl + dl + el; - - return lo >>> 0; -} -utils$h.sum64_5_lo = sum64_5_lo$2; - -function rotr64_hi$2(ah, al, num) { - var r = (al << (32 - num)) | (ah >>> num); - return r >>> 0; -} -utils$h.rotr64_hi = rotr64_hi$2; - -function rotr64_lo$2(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -utils$h.rotr64_lo = rotr64_lo$2; - -function shr64_hi$2(ah, al, num) { - return ah >>> num; -} -utils$h.shr64_hi = shr64_hi$2; - -function shr64_lo$2(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -utils$h.shr64_lo = shr64_lo$2; - -var common$y = {}; - -var utils$g = utils$h; -var assert$38 = minimalisticAssert; - -function BlockHash$4() { - this.pending = null; - this.pendingTotal = 0; - this.blockSize = this.constructor.blockSize; - this.outSize = this.constructor.outSize; - this.hmacStrength = this.constructor.hmacStrength; - this.padLength = this.constructor.padLength / 8; - this.endian = 'big'; - - this._delta8 = this.blockSize / 8; - this._delta32 = this.blockSize / 32; -} -common$y.BlockHash = BlockHash$4; - -BlockHash$4.prototype.update = function update(msg, enc) { - // Convert message to array, pad it, and join into 32bit blocks - msg = utils$g.toArray(msg, enc); - if (!this.pending) - this.pending = msg; - else - this.pending = this.pending.concat(msg); - this.pendingTotal += msg.length; - - // Enough data, try updating - if (this.pending.length >= this._delta8) { - msg = this.pending; - - // Process pending data in blocks - var r = msg.length % this._delta8; - this.pending = msg.slice(msg.length - r, msg.length); - if (this.pending.length === 0) - this.pending = null; - - msg = utils$g.join32(msg, 0, msg.length - r, this.endian); - for (var i = 0; i < msg.length; i += this._delta32) - this._update(msg, i, i + this._delta32); - } - - return this; -}; - -BlockHash$4.prototype.digest = function digest(enc) { - this.update(this._pad()); - assert$38(this.pending === null); - - return this._digest(enc); -}; - -BlockHash$4.prototype._pad = function pad() { - var len = this.pendingTotal; - var bytes = this._delta8; - var k = bytes - ((len + this.padLength) % bytes); - var res = new Array(k + this.padLength); - res[0] = 0x80; - for (var i = 1; i < k; i++) - res[i] = 0; - - // Append length - len <<= 3; - if (this.endian === 'big') { - for (var t = 8; t < this.padLength; t++) - res[i++] = 0; - - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = (len >>> 24) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = len & 0xff; - } else { - res[i++] = len & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 24) & 0xff; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - - for (t = 8; t < this.padLength; t++) - res[i++] = 0; - } - - return res; -}; - -var sha = {}; - -var common$x = {}; - -var utils$f = utils$h; -var rotr32 = utils$f.rotr32; - -function ft_1$2(s, x, y, z) { - if (s === 0) - return ch32$2(x, y, z); - if (s === 1 || s === 3) - return p32$1(x, y, z); - if (s === 2) - return maj32$2(x, y, z); -} -common$x.ft_1 = ft_1$2; - -function ch32$2(x, y, z) { - return (x & y) ^ ((~x) & z); -} -common$x.ch32 = ch32$2; - -function maj32$2(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); -} -common$x.maj32 = maj32$2; - -function p32$1(x, y, z) { - return x ^ y ^ z; -} -common$x.p32 = p32$1; - -function s0_256$1(x) { - return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); -} -common$x.s0_256 = s0_256$1; - -function s1_256$1(x) { - return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); -} -common$x.s1_256 = s1_256$1; - -function g0_256$1(x) { - return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); -} -common$x.g0_256 = g0_256$1; - -function g1_256$1(x) { - return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); -} -common$x.g1_256 = g1_256$1; - -var utils$e = utils$h; -var common$w = common$y; -var shaCommon$1 = common$x; - -var rotl32$5 = utils$e.rotl32; -var sum32$2 = utils$e.sum32; -var sum32_5$1 = utils$e.sum32_5; -var ft_1$1 = shaCommon$1.ft_1; -var BlockHash$3 = common$w.BlockHash; - -var sha1_K = [ - 0x5A827999, 0x6ED9EBA1, - 0x8F1BBCDC, 0xCA62C1D6 -]; - -function SHA1$2() { - if (!(this instanceof SHA1$2)) - return new SHA1$2(); - - BlockHash$3.call(this); - this.h = [ - 0x67452301, 0xefcdab89, 0x98badcfe, - 0x10325476, 0xc3d2e1f0 ]; - this.W = new Array(80); -} - -utils$e.inherits(SHA1$2, BlockHash$3); -var _1 = SHA1$2; - -SHA1$2.blockSize = 512; -SHA1$2.outSize = 160; -SHA1$2.hmacStrength = 80; -SHA1$2.padLength = 64; - -SHA1$2.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - - for(; i < W.length; i++) - W[i] = rotl32$5(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - - for (i = 0; i < W.length; i++) { - var s = ~~(i / 20); - var t = sum32_5$1(rotl32$5(a, 5), ft_1$1(s, b, c, d), e, W[i], sha1_K[s]); - e = d; - d = c; - c = rotl32$5(b, 30); - b = a; - a = t; - } - - this.h[0] = sum32$2(this.h[0], a); - this.h[1] = sum32$2(this.h[1], b); - this.h[2] = sum32$2(this.h[2], c); - this.h[3] = sum32$2(this.h[3], d); - this.h[4] = sum32$2(this.h[4], e); -}; - -SHA1$2.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$e.toHex32(this.h, 'big'); - else - return utils$e.split32(this.h, 'big'); -}; - -var utils$d = utils$h; -var common$v = common$y; -var shaCommon = common$x; -var assert$37 = minimalisticAssert; - -var sum32$1 = utils$d.sum32; -var sum32_4$1 = utils$d.sum32_4; -var sum32_5 = utils$d.sum32_5; -var ch32$1 = shaCommon.ch32; -var maj32$1 = shaCommon.maj32; -var s0_256 = shaCommon.s0_256; -var s1_256 = shaCommon.s1_256; -var g0_256 = shaCommon.g0_256; -var g1_256 = shaCommon.g1_256; - -var BlockHash$2 = common$v.BlockHash; - -var sha256_K = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]; - -function SHA256$8() { - if (!(this instanceof SHA256$8)) - return new SHA256$8(); - - BlockHash$2.call(this); - this.h = [ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]; - this.k = sha256_K; - this.W = new Array(64); -} -utils$d.inherits(SHA256$8, BlockHash$2); -var _256 = SHA256$8; - -SHA256$8.blockSize = 512; -SHA256$8.outSize = 256; -SHA256$8.hmacStrength = 192; -SHA256$8.padLength = 64; - -SHA256$8.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - for (; i < W.length; i++) - W[i] = sum32_4$1(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - var f = this.h[5]; - var g = this.h[6]; - var h = this.h[7]; - - assert$37(this.k.length === W.length); - for (i = 0; i < W.length; i++) { - var T1 = sum32_5(h, s1_256(e), ch32$1(e, f, g), this.k[i], W[i]); - var T2 = sum32$1(s0_256(a), maj32$1(a, b, c)); - h = g; - g = f; - f = e; - e = sum32$1(d, T1); - d = c; - c = b; - b = a; - a = sum32$1(T1, T2); - } - - this.h[0] = sum32$1(this.h[0], a); - this.h[1] = sum32$1(this.h[1], b); - this.h[2] = sum32$1(this.h[2], c); - this.h[3] = sum32$1(this.h[3], d); - this.h[4] = sum32$1(this.h[4], e); - this.h[5] = sum32$1(this.h[5], f); - this.h[6] = sum32$1(this.h[6], g); - this.h[7] = sum32$1(this.h[7], h); -}; - -SHA256$8.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$d.toHex32(this.h, 'big'); - else - return utils$d.split32(this.h, 'big'); -}; - -var utils$c = utils$h; -var SHA256$7 = _256; - -function SHA224() { - if (!(this instanceof SHA224)) - return new SHA224(); - - SHA256$7.call(this); - this.h = [ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; -} -utils$c.inherits(SHA224, SHA256$7); -var _224 = SHA224; - -SHA224.blockSize = 512; -SHA224.outSize = 224; -SHA224.hmacStrength = 192; -SHA224.padLength = 64; - -SHA224.prototype._digest = function digest(enc) { - // Just truncate output - if (enc === 'hex') - return utils$c.toHex32(this.h.slice(0, 7), 'big'); - else - return utils$c.split32(this.h.slice(0, 7), 'big'); -}; - -var utils$b = utils$h; -var common$u = common$y; -var assert$36 = minimalisticAssert; - -var rotr64_hi$1 = utils$b.rotr64_hi; -var rotr64_lo$1 = utils$b.rotr64_lo; -var shr64_hi$1 = utils$b.shr64_hi; -var shr64_lo$1 = utils$b.shr64_lo; -var sum64$1 = utils$b.sum64; -var sum64_hi$1 = utils$b.sum64_hi; -var sum64_lo$1 = utils$b.sum64_lo; -var sum64_4_hi$1 = utils$b.sum64_4_hi; -var sum64_4_lo$1 = utils$b.sum64_4_lo; -var sum64_5_hi$1 = utils$b.sum64_5_hi; -var sum64_5_lo$1 = utils$b.sum64_5_lo; - -var BlockHash$1 = common$u.BlockHash; - -var sha512_K = [ - 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, - 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, - 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, - 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, - 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, - 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, - 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, - 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, - 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, - 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, - 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, - 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, - 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, - 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, - 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, - 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, - 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, - 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, - 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, - 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, - 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, - 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, - 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, - 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, - 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, - 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, - 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, - 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, - 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, - 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, - 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, - 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, - 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, - 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, - 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, - 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, - 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, - 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, - 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, - 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 -]; - -function SHA512$3() { - if (!(this instanceof SHA512$3)) - return new SHA512$3(); - - BlockHash$1.call(this); - this.h = [ - 0x6a09e667, 0xf3bcc908, - 0xbb67ae85, 0x84caa73b, - 0x3c6ef372, 0xfe94f82b, - 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, - 0x9b05688c, 0x2b3e6c1f, - 0x1f83d9ab, 0xfb41bd6b, - 0x5be0cd19, 0x137e2179 ]; - this.k = sha512_K; - this.W = new Array(160); -} -utils$b.inherits(SHA512$3, BlockHash$1); -var _512 = SHA512$3; - -SHA512$3.blockSize = 1024; -SHA512$3.outSize = 512; -SHA512$3.hmacStrength = 192; -SHA512$3.padLength = 128; - -SHA512$3.prototype._prepareBlock = function _prepareBlock(msg, start) { - var W = this.W; - - // 32 x 32bit words - for (var i = 0; i < 32; i++) - W[i] = msg[start + i]; - for (; i < W.length; i += 2) { - var c0_hi = g1_512_hi$1(W[i - 4], W[i - 3]); // i - 2 - var c0_lo = g1_512_lo$1(W[i - 4], W[i - 3]); - var c1_hi = W[i - 14]; // i - 7 - var c1_lo = W[i - 13]; - var c2_hi = g0_512_hi$1(W[i - 30], W[i - 29]); // i - 15 - var c2_lo = g0_512_lo$1(W[i - 30], W[i - 29]); - var c3_hi = W[i - 32]; // i - 16 - var c3_lo = W[i - 31]; - - W[i] = sum64_4_hi$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - W[i + 1] = sum64_4_lo$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - } -}; - -SHA512$3.prototype._update = function _update(msg, start) { - this._prepareBlock(msg, start); - - var W = this.W; - - var ah = this.h[0]; - var al = this.h[1]; - var bh = this.h[2]; - var bl = this.h[3]; - var ch = this.h[4]; - var cl = this.h[5]; - var dh = this.h[6]; - var dl = this.h[7]; - var eh = this.h[8]; - var el = this.h[9]; - var fh = this.h[10]; - var fl = this.h[11]; - var gh = this.h[12]; - var gl = this.h[13]; - var hh = this.h[14]; - var hl = this.h[15]; - - assert$36(this.k.length === W.length); - for (var i = 0; i < W.length; i += 2) { - var c0_hi = hh; - var c0_lo = hl; - var c1_hi = s1_512_hi$1(eh, el); - var c1_lo = s1_512_lo$1(eh, el); - var c2_hi = ch64_hi$1(eh, el, fh, fl, gh); - var c2_lo = ch64_lo$1(eh, el, fh, fl, gh, gl); - var c3_hi = this.k[i]; - var c3_lo = this.k[i + 1]; - var c4_hi = W[i]; - var c4_lo = W[i + 1]; - - var T1_hi = sum64_5_hi$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - var T1_lo = sum64_5_lo$1( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - - c0_hi = s0_512_hi$1(ah, al); - c0_lo = s0_512_lo$1(ah, al); - c1_hi = maj64_hi$1(ah, al, bh, bl, ch); - c1_lo = maj64_lo$1(ah, al, bh, bl, ch, cl); - - var T2_hi = sum64_hi$1(c0_hi, c0_lo, c1_hi, c1_lo); - var T2_lo = sum64_lo$1(c0_hi, c0_lo, c1_hi, c1_lo); - - hh = gh; - hl = gl; - - gh = fh; - gl = fl; - - fh = eh; - fl = el; - - eh = sum64_hi$1(dh, dl, T1_hi, T1_lo); - el = sum64_lo$1(dl, dl, T1_hi, T1_lo); - - dh = ch; - dl = cl; - - ch = bh; - cl = bl; - - bh = ah; - bl = al; - - ah = sum64_hi$1(T1_hi, T1_lo, T2_hi, T2_lo); - al = sum64_lo$1(T1_hi, T1_lo, T2_hi, T2_lo); - } - - sum64$1(this.h, 0, ah, al); - sum64$1(this.h, 2, bh, bl); - sum64$1(this.h, 4, ch, cl); - sum64$1(this.h, 6, dh, dl); - sum64$1(this.h, 8, eh, el); - sum64$1(this.h, 10, fh, fl); - sum64$1(this.h, 12, gh, gl); - sum64$1(this.h, 14, hh, hl); -}; - -SHA512$3.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$b.toHex32(this.h, 'big'); - else - return utils$b.split32(this.h, 'big'); -}; - -function ch64_hi$1(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ ((~xh) & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function ch64_lo$1(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ ((~xl) & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_hi$1(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_lo$1(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 28); - var c1_hi = rotr64_hi$1(xl, xh, 2); // 34 - var c2_hi = rotr64_hi$1(xl, xh, 7); // 39 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 28); - var c1_lo = rotr64_lo$1(xl, xh, 2); // 34 - var c2_lo = rotr64_lo$1(xl, xh, 7); // 39 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 14); - var c1_hi = rotr64_hi$1(xh, xl, 18); - var c2_hi = rotr64_hi$1(xl, xh, 9); // 41 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 14); - var c1_lo = rotr64_lo$1(xh, xl, 18); - var c2_lo = rotr64_lo$1(xl, xh, 9); // 41 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 1); - var c1_hi = rotr64_hi$1(xh, xl, 8); - var c2_hi = shr64_hi$1(xh, xl, 7); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 1); - var c1_lo = rotr64_lo$1(xh, xl, 8); - var c2_lo = shr64_lo$1(xh, xl, 7); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_hi$1(xh, xl) { - var c0_hi = rotr64_hi$1(xh, xl, 19); - var c1_hi = rotr64_hi$1(xl, xh, 29); // 61 - var c2_hi = shr64_hi$1(xh, xl, 6); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_lo$1(xh, xl) { - var c0_lo = rotr64_lo$1(xh, xl, 19); - var c1_lo = rotr64_lo$1(xl, xh, 29); // 61 - var c2_lo = shr64_lo$1(xh, xl, 6); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -var utils$a = utils$h; - -var SHA512$2 = _512; - -function SHA384() { - if (!(this instanceof SHA384)) - return new SHA384(); - - SHA512$2.call(this); - this.h = [ - 0xcbbb9d5d, 0xc1059ed8, - 0x629a292a, 0x367cd507, - 0x9159015a, 0x3070dd17, - 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, - 0x8eb44a87, 0x68581511, - 0xdb0c2e0d, 0x64f98fa7, - 0x47b5481d, 0xbefa4fa4 ]; -} -utils$a.inherits(SHA384, SHA512$2); -var _384 = SHA384; - -SHA384.blockSize = 1024; -SHA384.outSize = 384; -SHA384.hmacStrength = 192; -SHA384.padLength = 128; - -SHA384.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$a.toHex32(this.h.slice(0, 12), 'big'); - else - return utils$a.split32(this.h.slice(0, 12), 'big'); -}; - -sha.sha1 = _1; -sha.sha224 = _224; -sha.sha256 = _256; -sha.sha384 = _384; -sha.sha512 = _512; - -var ripemd = {}; - -var utils$9 = utils$h; -var common$t = common$y; - -var rotl32$4 = utils$9.rotl32; -var sum32 = utils$9.sum32; -var sum32_3 = utils$9.sum32_3; -var sum32_4 = utils$9.sum32_4; -var BlockHash = common$t.BlockHash; - -function RIPEMD160$3() { - if (!(this instanceof RIPEMD160$3)) - return new RIPEMD160$3(); - - BlockHash.call(this); - - this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; - this.endian = 'little'; -} -utils$9.inherits(RIPEMD160$3, BlockHash); -ripemd.ripemd160 = RIPEMD160$3; - -RIPEMD160$3.blockSize = 512; -RIPEMD160$3.outSize = 160; -RIPEMD160$3.hmacStrength = 192; -RIPEMD160$3.padLength = 64; - -RIPEMD160$3.prototype._update = function update(msg, start) { - var A = this.h[0]; - var B = this.h[1]; - var C = this.h[2]; - var D = this.h[3]; - var E = this.h[4]; - var Ah = A; - var Bh = B; - var Ch = C; - var Dh = D; - var Eh = E; - for (var j = 0; j < 80; j++) { - var T = sum32( - rotl32$4( - sum32_4(A, f$1(j, B, C, D), msg[r$1[j] + start], K$4(j)), - s$1[j]), - E); - A = E; - E = D; - D = rotl32$4(C, 10); - C = B; - B = T; - T = sum32( - rotl32$4( - sum32_4(Ah, f$1(79 - j, Bh, Ch, Dh), msg[rh$1[j] + start], Kh$1(j)), - sh$1[j]), - Eh); - Ah = Eh; - Eh = Dh; - Dh = rotl32$4(Ch, 10); - Ch = Bh; - Bh = T; - } - T = sum32_3(this.h[1], C, Dh); - this.h[1] = sum32_3(this.h[2], D, Eh); - this.h[2] = sum32_3(this.h[3], E, Ah); - this.h[3] = sum32_3(this.h[4], A, Bh); - this.h[4] = sum32_3(this.h[0], B, Ch); - this.h[0] = T; -}; - -RIPEMD160$3.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils$9.toHex32(this.h, 'little'); - else - return utils$9.split32(this.h, 'little'); -}; - -function f$1(j, x, y, z) { - if (j <= 15) - return x ^ y ^ z; - else if (j <= 31) - return (x & y) | ((~x) & z); - else if (j <= 47) - return (x | (~y)) ^ z; - else if (j <= 63) - return (x & z) | (y & (~z)); - else - return x ^ (y | (~z)); -} - -function K$4(j) { - if (j <= 15) - return 0x00000000; - else if (j <= 31) - return 0x5a827999; - else if (j <= 47) - return 0x6ed9eba1; - else if (j <= 63) - return 0x8f1bbcdc; - else - return 0xa953fd4e; -} - -function Kh$1(j) { - if (j <= 15) - return 0x50a28be6; - else if (j <= 31) - return 0x5c4dd124; - else if (j <= 47) - return 0x6d703ef3; - else if (j <= 63) - return 0x7a6d76e9; - else - return 0x00000000; -} - -var r$1 = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 -]; - -var rh$1 = [ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 -]; - -var s$1 = [ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 -]; - -var sh$1 = [ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 -]; - -var utils$8 = utils$h; -var assert$35 = minimalisticAssert; - -function Hmac(hash, key, enc) { - if (!(this instanceof Hmac)) - return new Hmac(hash, key, enc); - this.Hash = hash; - this.blockSize = hash.blockSize / 8; - this.outSize = hash.outSize / 8; - this.inner = null; - this.outer = null; - - this._init(utils$8.toArray(key, enc)); -} -var hmac$1 = Hmac; - -Hmac.prototype._init = function init(key) { - // Shorten key, if needed - if (key.length > this.blockSize) - key = new this.Hash().update(key).digest(); - assert$35(key.length <= this.blockSize); - - // Add padding to key - for (var i = key.length; i < this.blockSize; i++) - key.push(0); - - for (i = 0; i < key.length; i++) - key[i] ^= 0x36; - this.inner = new this.Hash().update(key); - - // 0x36 ^ 0x5c = 0x6a - for (i = 0; i < key.length; i++) - key[i] ^= 0x6a; - this.outer = new this.Hash().update(key); -}; - -Hmac.prototype.update = function update(msg, enc) { - this.inner.update(msg, enc); - return this; -}; - -Hmac.prototype.digest = function digest(enc) { - this.outer.update(this.inner.digest()); - return this.outer.digest(enc); -}; - -(function (exports) { -var hash = exports; - -hash.utils = utils$h; -hash.common = common$y; -hash.sha = sha; -hash.ripemd = ripemd; -hash.hmac = hmac$1; - -// Proxy hash functions to the main object -hash.sha1 = hash.sha.sha1; -hash.sha256 = hash.sha.sha256; -hash.sha224 = hash.sha.sha224; -hash.sha384 = hash.sha.sha384; -hash.sha512 = hash.sha.sha512; -hash.ripemd160 = hash.ripemd.ripemd160; -}(hash$3)); - -(function (exports) { - -var curves = exports; - -var hash = hash$3; -var curve = curve$1; -var utils = utils$n; - -var assert = utils.assert; - -function PresetCurve(options) { - if (options.type === 'short') - this.curve = new curve.short(options); - else if (options.type === 'edwards') - this.curve = new curve.edwards(options); - else - this.curve = new curve.mont(options); - this.g = this.curve.g; - this.n = this.curve.n; - this.hash = options.hash; - - assert(this.g.validate(), 'Invalid curve'); - assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); -} -curves.PresetCurve = PresetCurve; - -function defineCurve(name, options) { - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - get: function() { - var curve = new PresetCurve(options); - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - value: curve, - }); - return curve; - }, - }); -} - -defineCurve('p192', { - type: 'short', - prime: 'p192', - p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', - b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', - n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', - hash: hash.sha256, - gRed: false, - g: [ - '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', - '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811', - ], -}); - -defineCurve('p224', { - type: 'short', - prime: 'p224', - p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', - b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', - n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', - hash: hash.sha256, - gRed: false, - g: [ - 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', - 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34', - ], -}); - -defineCurve('p256', { - type: 'short', - prime: null, - p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', - a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', - b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', - n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', - hash: hash.sha256, - gRed: false, - g: [ - '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5', - ], -}); - -defineCurve('p384', { - type: 'short', - prime: null, - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 ffffffff', - a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 fffffffc', - b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + - '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', - n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + - 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', - hash: hash.sha384, - gRed: false, - g: [ - 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + - '5502f25d bf55296c 3a545e38 72760ab7', - '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f', - ], -}); - -defineCurve('p521', { - type: 'short', - prime: null, - p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff', - a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff fffffffc', - b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + - '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + - '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', - n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + - 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', - hash: hash.sha512, - gRed: false, - g: [ - '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + - '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + - 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', - '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + - '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + - '3fad0761 353c7086 a272c240 88be9476 9fd16650', - ], -}); - -defineCurve('curve25519', { - type: 'mont', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '76d06', - b: '1', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '9', - ], -}); - -defineCurve('ed25519', { - type: 'edwards', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '-1', - c: '1', - // -121665 * (121666^(-1)) (mod P) - d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', - - // 4/5 - '6666666666666666666666666666666666666666666666666666666666666658', - ], -}); - -var pre; -try { - pre = require('./precomputed/secp256k1'); -} catch (e) { - pre = undefined; -} - -defineCurve('secp256k1', { - type: 'short', - prime: 'k256', - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', - a: '0', - b: '7', - n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', - h: '1', - hash: hash.sha256, - - // Precomputed endomorphism - beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', - lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3', - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15', - }, - ], - - gRed: false, - g: [ - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', - pre, - ], -}); -}(curves$3)); - -var hash$2 = hash$3; -var utils$7 = utils$m; -var assert$34 = minimalisticAssert; - -function HmacDRBG$4(options) { - if (!(this instanceof HmacDRBG$4)) - return new HmacDRBG$4(options); - this.hash = options.hash; - this.predResist = !!options.predResist; - - this.outLen = this.hash.outSize; - this.minEntropy = options.minEntropy || this.hash.hmacStrength; - - this._reseed = null; - this.reseedInterval = null; - this.K = null; - this.V = null; - - var entropy = utils$7.toArray(options.entropy, options.entropyEnc || 'hex'); - var nonce = utils$7.toArray(options.nonce, options.nonceEnc || 'hex'); - var pers = utils$7.toArray(options.pers, options.persEnc || 'hex'); - assert$34(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - this._init(entropy, nonce, pers); -} -var hmacDrbg$3 = HmacDRBG$4; - -HmacDRBG$4.prototype._init = function init(entropy, nonce, pers) { - var seed = entropy.concat(nonce).concat(pers); - - this.K = new Array(this.outLen / 8); - this.V = new Array(this.outLen / 8); - for (var i = 0; i < this.V.length; i++) { - this.K[i] = 0x00; - this.V[i] = 0x01; - } - - this._update(seed); - this._reseed = 1; - this.reseedInterval = 0x1000000000000; // 2^48 -}; - -HmacDRBG$4.prototype._hmac = function hmac() { - return new hash$2.hmac(this.hash, this.K); -}; - -HmacDRBG$4.prototype._update = function update(seed) { - var kmac = this._hmac() - .update(this.V) - .update([ 0x00 ]); - if (seed) - kmac = kmac.update(seed); - this.K = kmac.digest(); - this.V = this._hmac().update(this.V).digest(); - if (!seed) - return; - - this.K = this._hmac() - .update(this.V) - .update([ 0x01 ]) - .update(seed) - .digest(); - this.V = this._hmac().update(this.V).digest(); -}; - -HmacDRBG$4.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { - // Optional entropy enc - if (typeof entropyEnc !== 'string') { - addEnc = add; - add = entropyEnc; - entropyEnc = null; - } - - entropy = utils$7.toArray(entropy, entropyEnc); - add = utils$7.toArray(add, addEnc); - - assert$34(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - - this._update(entropy.concat(add || [])); - this._reseed = 1; -}; - -HmacDRBG$4.prototype.generate = function generate(len, enc, add, addEnc) { - if (this._reseed > this.reseedInterval) - throw new Error('Reseed is required'); - - // Optional encoding - if (typeof enc !== 'string') { - addEnc = add; - add = enc; - enc = null; - } - - // Optional additional data - if (add) { - add = utils$7.toArray(add, addEnc || 'hex'); - this._update(add); - } - - var temp = []; - while (temp.length < len) { - this.V = this._hmac().update(this.V).digest(); - temp = temp.concat(this.V); - } - - var res = temp.slice(0, len); - this._update(add); - this._reseed++; - return utils$7.encode(res, enc); -}; - -var BN$f = bn$2.exports; -var utils$6 = utils$n; -var assert$33 = utils$6.assert; - -function KeyPair$3(ec, options) { - this.ec = ec; - this.priv = null; - this.pub = null; - - // KeyPair(ec, { priv: ..., pub: ... }) - if (options.priv) - this._importPrivate(options.priv, options.privEnc); - if (options.pub) - this._importPublic(options.pub, options.pubEnc); -} -var key$3 = KeyPair$3; - -KeyPair$3.fromPublic = function fromPublic(ec, pub, enc) { - if (pub instanceof KeyPair$3) - return pub; - - return new KeyPair$3(ec, { - pub: pub, - pubEnc: enc, - }); -}; - -KeyPair$3.fromPrivate = function fromPrivate(ec, priv, enc) { - if (priv instanceof KeyPair$3) - return priv; - - return new KeyPair$3(ec, { - priv: priv, - privEnc: enc, - }); -}; - -KeyPair$3.prototype.validate = function validate() { - var pub = this.getPublic(); - - if (pub.isInfinity()) - return { result: false, reason: 'Invalid public key' }; - if (!pub.validate()) - return { result: false, reason: 'Public key is not a point' }; - if (!pub.mul(this.ec.curve.n).isInfinity()) - return { result: false, reason: 'Public key * N != O' }; - - return { result: true, reason: null }; -}; - -KeyPair$3.prototype.getPublic = function getPublic(compact, enc) { - // compact is optional argument - if (typeof compact === 'string') { - enc = compact; - compact = null; - } - - if (!this.pub) - this.pub = this.ec.g.mul(this.priv); - - if (!enc) - return this.pub; - - return this.pub.encode(enc, compact); -}; - -KeyPair$3.prototype.getPrivate = function getPrivate(enc) { - if (enc === 'hex') - return this.priv.toString(16, 2); - else - return this.priv; -}; - -KeyPair$3.prototype._importPrivate = function _importPrivate(key, enc) { - this.priv = new BN$f(key, enc || 16); - - // Ensure that the priv won't be bigger than n, otherwise we may fail - // in fixed multiplication method - this.priv = this.priv.umod(this.ec.curve.n); -}; - -KeyPair$3.prototype._importPublic = function _importPublic(key, enc) { - if (key.x || key.y) { - // Montgomery points only have an `x` coordinate. - // Weierstrass/Edwards points on the other hand have both `x` and - // `y` coordinates. - if (this.ec.curve.type === 'mont') { - assert$33(key.x, 'Need x coordinate'); - } else if (this.ec.curve.type === 'short' || - this.ec.curve.type === 'edwards') { - assert$33(key.x && key.y, 'Need both x and y coordinate'); - } - this.pub = this.ec.curve.point(key.x, key.y); - return; - } - this.pub = this.ec.curve.decodePoint(key, enc); -}; - -// ECDH -KeyPair$3.prototype.derive = function derive(pub) { - if(!pub.validate()) { - assert$33(pub.validate(), 'public point not validated'); - } - return pub.mul(this.priv).getX(); -}; - -// ECDSA -KeyPair$3.prototype.sign = function sign(msg, enc, options) { - return this.ec.sign(msg, this, enc, options); -}; - -KeyPair$3.prototype.verify = function verify(msg, signature) { - return this.ec.verify(msg, signature, this); -}; - -KeyPair$3.prototype.inspect = function inspect() { - return ''; -}; - -var BN$e = bn$2.exports; - -var utils$5 = utils$n; -var assert$32 = utils$5.assert; - -function Signature$3(options, enc) { - if (options instanceof Signature$3) - return options; - - if (this._importDER(options, enc)) - return; - - assert$32(options.r && options.s, 'Signature without r or s'); - this.r = new BN$e(options.r, 16); - this.s = new BN$e(options.s, 16); - if (options.recoveryParam === undefined) - this.recoveryParam = null; - else - this.recoveryParam = options.recoveryParam; -} -var signature$1 = Signature$3; - -function Position() { - this.place = 0; -} - -function getLength(buf, p) { - var initial = buf[p.place++]; - if (!(initial & 0x80)) { - return initial; - } - var octetLen = initial & 0xf; - - // Indefinite length or overflow - if (octetLen === 0 || octetLen > 4) { - return false; - } - - var val = 0; - for (var i = 0, off = p.place; i < octetLen; i++, off++) { - val <<= 8; - val |= buf[off]; - val >>>= 0; - } - - // Leading zeroes - if (val <= 0x7f) { - return false; - } - - p.place = off; - return val; -} - -function rmPadding(buf) { - var i = 0; - var len = buf.length - 1; - while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { - i++; - } - if (i === 0) { - return buf; - } - return buf.slice(i); -} - -Signature$3.prototype._importDER = function _importDER(data, enc) { - data = utils$5.toArray(data, enc); - var p = new Position(); - if (data[p.place++] !== 0x30) { - return false; - } - var len = getLength(data, p); - if (len === false) { - return false; - } - if ((len + p.place) !== data.length) { - return false; - } - if (data[p.place++] !== 0x02) { - return false; - } - var rlen = getLength(data, p); - if (rlen === false) { - return false; - } - var r = data.slice(p.place, rlen + p.place); - p.place += rlen; - if (data[p.place++] !== 0x02) { - return false; - } - var slen = getLength(data, p); - if (slen === false) { - return false; - } - if (data.length !== slen + p.place) { - return false; - } - var s = data.slice(p.place, slen + p.place); - if (r[0] === 0) { - if (r[1] & 0x80) { - r = r.slice(1); - } else { - // Leading zeroes - return false; - } - } - if (s[0] === 0) { - if (s[1] & 0x80) { - s = s.slice(1); - } else { - // Leading zeroes - return false; - } - } - - this.r = new BN$e(r); - this.s = new BN$e(s); - this.recoveryParam = null; - - return true; -}; - -function constructLength(arr, len) { - if (len < 0x80) { - arr.push(len); - return; - } - var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); - arr.push(octets | 0x80); - while (--octets) { - arr.push((len >>> (octets << 3)) & 0xff); - } - arr.push(len); -} - -Signature$3.prototype.toDER = function toDER(enc) { - var r = this.r.toArray(); - var s = this.s.toArray(); - - // Pad values - if (r[0] & 0x80) - r = [ 0 ].concat(r); - // Pad values - if (s[0] & 0x80) - s = [ 0 ].concat(s); - - r = rmPadding(r); - s = rmPadding(s); - - while (!s[0] && !(s[1] & 0x80)) { - s = s.slice(1); - } - var arr = [ 0x02 ]; - constructLength(arr, r.length); - arr = arr.concat(r); - arr.push(0x02); - constructLength(arr, s.length); - var backHalf = arr.concat(s); - var res = [ 0x30 ]; - constructLength(res, backHalf.length); - res = res.concat(backHalf); - return utils$5.encode(res, enc); -}; - -var BN$d = bn$2.exports; -var HmacDRBG$3 = hmacDrbg$3; -var utils$4 = utils$n; -var curves$2 = curves$3; -var rand$1 = brorand.exports; -var assert$31 = utils$4.assert; - -var KeyPair$2 = key$3; -var Signature$2 = signature$1; - -function EC$1(options) { - if (!(this instanceof EC$1)) - return new EC$1(options); - - // Shortcut `elliptic.ec(curve-name)` - if (typeof options === 'string') { - assert$31(Object.prototype.hasOwnProperty.call(curves$2, options), - 'Unknown curve ' + options); - - options = curves$2[options]; - } - - // Shortcut for `elliptic.ec(elliptic.curves.curveName)` - if (options instanceof curves$2.PresetCurve) - options = { curve: options }; - - this.curve = options.curve.curve; - this.n = this.curve.n; - this.nh = this.n.ushrn(1); - this.g = this.curve.g; - - // Point on curve - this.g = options.curve.g; - this.g.precompute(options.curve.n.bitLength() + 1); - - // Hash for function for DRBG - this.hash = options.hash || options.curve.hash; -} -var ec$1 = EC$1; - -EC$1.prototype.keyPair = function keyPair(options) { - return new KeyPair$2(this, options); -}; - -EC$1.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { - return KeyPair$2.fromPrivate(this, priv, enc); -}; - -EC$1.prototype.keyFromPublic = function keyFromPublic(pub, enc) { - return KeyPair$2.fromPublic(this, pub, enc); -}; - -EC$1.prototype.genKeyPair = function genKeyPair(options) { - if (!options) - options = {}; - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG$3({ - hash: this.hash, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - entropy: options.entropy || rand$1(this.hash.hmacStrength), - entropyEnc: options.entropy && options.entropyEnc || 'utf8', - nonce: this.n.toArray(), - }); - - var bytes = this.n.byteLength(); - var ns2 = this.n.sub(new BN$d(2)); - for (;;) { - var priv = new BN$d(drbg.generate(bytes)); - if (priv.cmp(ns2) > 0) - continue; - - priv.iaddn(1); - return this.keyFromPrivate(priv); - } -}; - -EC$1.prototype._truncateToN = function _truncateToN(msg, truncOnly) { - var delta = msg.byteLength() * 8 - this.n.bitLength(); - if (delta > 0) - msg = msg.ushrn(delta); - if (!truncOnly && msg.cmp(this.n) >= 0) - return msg.sub(this.n); - else - return msg; -}; - -EC$1.prototype.sign = function sign(msg, key, enc, options) { - if (typeof enc === 'object') { - options = enc; - enc = null; - } - if (!options) - options = {}; - - key = this.keyFromPrivate(key, enc); - msg = this._truncateToN(new BN$d(msg, 16)); - - // Zero-extend key to provide enough entropy - var bytes = this.n.byteLength(); - var bkey = key.getPrivate().toArray('be', bytes); - - // Zero-extend nonce to have the same byte size as N - var nonce = msg.toArray('be', bytes); - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG$3({ - hash: this.hash, - entropy: bkey, - nonce: nonce, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - }); - - // Number of bytes to generate - var ns1 = this.n.sub(new BN$d(1)); - - for (var iter = 0; ; iter++) { - var k = options.k ? - options.k(iter) : - new BN$d(drbg.generate(this.n.byteLength())); - k = this._truncateToN(k, true); - if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) - continue; - - var kp = this.g.mul(k); - if (kp.isInfinity()) - continue; - - var kpX = kp.getX(); - var r = kpX.umod(this.n); - if (r.cmpn(0) === 0) - continue; - - var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); - s = s.umod(this.n); - if (s.cmpn(0) === 0) - continue; - - var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | - (kpX.cmp(r) !== 0 ? 2 : 0); - - // Use complement of `s`, if it is > `n / 2` - if (options.canonical && s.cmp(this.nh) > 0) { - s = this.n.sub(s); - recoveryParam ^= 1; - } - - return new Signature$2({ r: r, s: s, recoveryParam: recoveryParam }); - } -}; - -EC$1.prototype.verify = function verify(msg, signature, key, enc) { - msg = this._truncateToN(new BN$d(msg, 16)); - key = this.keyFromPublic(key, enc); - signature = new Signature$2(signature, 'hex'); - - // Perform primitive values validation - var r = signature.r; - var s = signature.s; - if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) - return false; - if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) - return false; - - // Validate signature - var sinv = s.invm(this.n); - var u1 = sinv.mul(msg).umod(this.n); - var u2 = sinv.mul(r).umod(this.n); - var p; - - if (!this.curve._maxwellTrick) { - p = this.g.mulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - return p.getX().umod(this.n).cmp(r) === 0; - } - - // NOTE: Greg Maxwell's trick, inspired by: - // https://git.io/vad3K - - p = this.g.jmulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - // Compare `p.x` of Jacobian point with `r`, - // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the - // inverse of `p.z^2` - return p.eqXToP(r); -}; - -EC$1.prototype.recoverPubKey = function(msg, signature, j, enc) { - assert$31((3 & j) === j, 'The recovery param is more than two bits'); - signature = new Signature$2(signature, enc); - - var n = this.n; - var e = new BN$d(msg); - var r = signature.r; - var s = signature.s; - - // A set LSB signifies that the y-coordinate is odd - var isYOdd = j & 1; - var isSecondKey = j >> 1; - if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) - throw new Error('Unable to find sencond key candinate'); - - // 1.1. Let x = r + jn. - if (isSecondKey) - r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); - else - r = this.curve.pointFromX(r, isYOdd); - - var rInv = signature.r.invm(n); - var s1 = n.sub(e).mul(rInv).umod(n); - var s2 = s.mul(rInv).umod(n); - - // 1.6.1 Compute Q = r^-1 (sR - eG) - // Q = r^-1 (sR + -eG) - return this.g.mulAdd(s1, r, s2); -}; - -EC$1.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { - signature = new Signature$2(signature, enc); - if (signature.recoveryParam !== null) - return signature.recoveryParam; - - for (var i = 0; i < 4; i++) { - var Qprime; - try { - Qprime = this.recoverPubKey(e, signature, i); - } catch (e) { - continue; - } - - if (Qprime.eq(Q)) - return i; - } - throw new Error('Unable to find valid recovery factor'); -}; - -var utils$3 = utils$n; -var assert$30 = utils$3.assert; -var parseBytes$2 = utils$3.parseBytes; -var cachedProperty$1 = utils$3.cachedProperty; - -/** -* @param {EDDSA} eddsa - instance -* @param {Object} params - public/private key parameters -* -* @param {Array} [params.secret] - secret seed bytes -* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) -* @param {Array} [params.pub] - public key point encoded as bytes -* -*/ -function KeyPair$1(eddsa, params) { - this.eddsa = eddsa; - this._secret = parseBytes$2(params.secret); - if (eddsa.isPoint(params.pub)) - this._pub = params.pub; - else - this._pubBytes = parseBytes$2(params.pub); -} - -KeyPair$1.fromPublic = function fromPublic(eddsa, pub) { - if (pub instanceof KeyPair$1) - return pub; - return new KeyPair$1(eddsa, { pub: pub }); -}; - -KeyPair$1.fromSecret = function fromSecret(eddsa, secret) { - if (secret instanceof KeyPair$1) - return secret; - return new KeyPair$1(eddsa, { secret: secret }); -}; - -KeyPair$1.prototype.secret = function secret() { - return this._secret; -}; - -cachedProperty$1(KeyPair$1, 'pubBytes', function pubBytes() { - return this.eddsa.encodePoint(this.pub()); -}); - -cachedProperty$1(KeyPair$1, 'pub', function pub() { - if (this._pubBytes) - return this.eddsa.decodePoint(this._pubBytes); - return this.eddsa.g.mul(this.priv()); -}); - -cachedProperty$1(KeyPair$1, 'privBytes', function privBytes() { - var eddsa = this.eddsa; - var hash = this.hash(); - var lastIx = eddsa.encodingLength - 1; - - var a = hash.slice(0, eddsa.encodingLength); - a[0] &= 248; - a[lastIx] &= 127; - a[lastIx] |= 64; - - return a; -}); - -cachedProperty$1(KeyPair$1, 'priv', function priv() { - return this.eddsa.decodeInt(this.privBytes()); -}); - -cachedProperty$1(KeyPair$1, 'hash', function hash() { - return this.eddsa.hash().update(this.secret()).digest(); -}); - -cachedProperty$1(KeyPair$1, 'messagePrefix', function messagePrefix() { - return this.hash().slice(this.eddsa.encodingLength); -}); - -KeyPair$1.prototype.sign = function sign(message) { - assert$30(this._secret, 'KeyPair can only verify'); - return this.eddsa.sign(message, this); -}; - -KeyPair$1.prototype.verify = function verify(message, sig) { - return this.eddsa.verify(message, sig, this); -}; - -KeyPair$1.prototype.getSecret = function getSecret(enc) { - assert$30(this._secret, 'KeyPair is public only'); - return utils$3.encode(this.secret(), enc); -}; - -KeyPair$1.prototype.getPublic = function getPublic(enc) { - return utils$3.encode(this.pubBytes(), enc); -}; - -var key$2 = KeyPair$1; - -var BN$c = bn$2.exports; -var utils$2 = utils$n; -var assert$2$ = utils$2.assert; -var cachedProperty = utils$2.cachedProperty; -var parseBytes$1 = utils$2.parseBytes; - -/** -* @param {EDDSA} eddsa - eddsa instance -* @param {Array|Object} sig - -* @param {Array|Point} [sig.R] - R point as Point or bytes -* @param {Array|bn} [sig.S] - S scalar as bn or bytes -* @param {Array} [sig.Rencoded] - R point encoded -* @param {Array} [sig.Sencoded] - S scalar encoded -*/ -function Signature$1(eddsa, sig) { - this.eddsa = eddsa; - - if (typeof sig !== 'object') - sig = parseBytes$1(sig); - - if (Array.isArray(sig)) { - sig = { - R: sig.slice(0, eddsa.encodingLength), - S: sig.slice(eddsa.encodingLength), - }; - } - - assert$2$(sig.R && sig.S, 'Signature without R or S'); - - if (eddsa.isPoint(sig.R)) - this._R = sig.R; - if (sig.S instanceof BN$c) - this._S = sig.S; - - this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; - this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; -} - -cachedProperty(Signature$1, 'S', function S() { - return this.eddsa.decodeInt(this.Sencoded()); -}); - -cachedProperty(Signature$1, 'R', function R() { - return this.eddsa.decodePoint(this.Rencoded()); -}); - -cachedProperty(Signature$1, 'Rencoded', function Rencoded() { - return this.eddsa.encodePoint(this.R()); -}); - -cachedProperty(Signature$1, 'Sencoded', function Sencoded() { - return this.eddsa.encodeInt(this.S()); -}); - -Signature$1.prototype.toBytes = function toBytes() { - return this.Rencoded().concat(this.Sencoded()); -}; - -Signature$1.prototype.toHex = function toHex() { - return utils$2.encode(this.toBytes(), 'hex').toUpperCase(); -}; - -var signature = Signature$1; - -var hash$1 = hash$3; -var curves$1 = curves$3; -var utils$1 = utils$n; -var assert$2_ = utils$1.assert; -var parseBytes = utils$1.parseBytes; -var KeyPair = key$2; -var Signature = signature; - -function EDDSA(curve) { - assert$2_(curve === 'ed25519', 'only tested with ed25519 so far'); - - if (!(this instanceof EDDSA)) - return new EDDSA(curve); - - curve = curves$1[curve].curve; - this.curve = curve; - this.g = curve.g; - this.g.precompute(curve.n.bitLength() + 1); - - this.pointClass = curve.point().constructor; - this.encodingLength = Math.ceil(curve.n.bitLength() / 8); - this.hash = hash$1.sha512; -} - -var eddsa = EDDSA; - -/** -* @param {Array|String} message - message bytes -* @param {Array|String|KeyPair} secret - secret bytes or a keypair -* @returns {Signature} - signature -*/ -EDDSA.prototype.sign = function sign(message, secret) { - message = parseBytes(message); - var key = this.keyFromSecret(secret); - var r = this.hashInt(key.messagePrefix(), message); - var R = this.g.mul(r); - var Rencoded = this.encodePoint(R); - var s_ = this.hashInt(Rencoded, key.pubBytes(), message) - .mul(key.priv()); - var S = r.add(s_).umod(this.curve.n); - return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); -}; - -/** -* @param {Array} message - message bytes -* @param {Array|String|Signature} sig - sig bytes -* @param {Array|String|Point|KeyPair} pub - public key -* @returns {Boolean} - true if public key matches sig of message -*/ -EDDSA.prototype.verify = function verify(message, sig, pub) { - message = parseBytes(message); - sig = this.makeSignature(sig); - var key = this.keyFromPublic(pub); - var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); - var SG = this.g.mul(sig.S()); - var RplusAh = sig.R().add(key.pub().mul(h)); - return RplusAh.eq(SG); -}; - -EDDSA.prototype.hashInt = function hashInt() { - var hash = this.hash(); - for (var i = 0; i < arguments.length; i++) - hash.update(arguments[i]); - return utils$1.intFromLE(hash.digest()).umod(this.curve.n); -}; - -EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { - return KeyPair.fromPublic(this, pub); -}; - -EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { - return KeyPair.fromSecret(this, secret); -}; - -EDDSA.prototype.makeSignature = function makeSignature(sig) { - if (sig instanceof Signature) - return sig; - return new Signature(this, sig); -}; - -/** -* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 -* -* EDDSA defines methods for encoding and decoding points and integers. These are -* helper convenience methods, that pass along to utility functions implied -* parameters. -* -*/ -EDDSA.prototype.encodePoint = function encodePoint(point) { - var enc = point.getY().toArray('le', this.encodingLength); - enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; - return enc; -}; - -EDDSA.prototype.decodePoint = function decodePoint(bytes) { - bytes = utils$1.parseBytes(bytes); - - var lastIx = bytes.length - 1; - var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); - var xIsOdd = (bytes[lastIx] & 0x80) !== 0; - - var y = utils$1.intFromLE(normed); - return this.curve.pointFromY(y, xIsOdd); -}; - -EDDSA.prototype.encodeInt = function encodeInt(num) { - return num.toArray('le', this.encodingLength); -}; - -EDDSA.prototype.decodeInt = function decodeInt(bytes) { - return utils$1.intFromLE(bytes); -}; - -EDDSA.prototype.isPoint = function isPoint(val) { - return val instanceof this.pointClass; -}; - -(function (exports) { - -var elliptic = exports; - -elliptic.version = require$$0$2.version; -elliptic.utils = utils$n; -elliptic.rand = brorand.exports; -elliptic.curve = curve$1; -elliptic.curves = curves$3; - -// Protocols -elliptic.ec = ec$1; -elliptic.eddsa = eddsa; -}(elliptic$2)); - -const HEX_STRINGS = "0123456789abcdefABCDEF"; -HEX_STRINGS.split("").map((c) => c.codePointAt(0)); -Array(256) - .fill(true) - .map((_, i) => { - const s = String.fromCodePoint(i); - const index = HEX_STRINGS.indexOf(s); - // ABCDEF will use 10 - 15 - return index < 0 ? undefined : index < 16 ? index : index - 6; -}); -new TextEncoder(); -new TextDecoder("ascii"); -// Same behavior as Buffer.compare() -function compare$j(v1, v2) { - const minLength = Math.min(v1.length, v2.length); - for (let i = 0; i < minLength; ++i) { - if (v1[i] !== v2[i]) { - return v1[i] < v2[i] ? -1 : 1; - } - } - return v1.length === v2.length ? 0 : v1.length > v2.length ? 1 : -1; -} - -const ERROR_BAD_PRIVATE = 0; -const ERROR_BAD_POINT = 1; -const ERROR_BAD_TWEAK = 2; -const ERROR_BAD_HASH = 3; -const ERROR_BAD_SIGNATURE = 4; -const ERROR_BAD_EXTRA_DATA = 5; -const ERROR_BAD_PARITY = 6; -const ERROR_BAD_RECOVERY_ID = 7; -const ERRORS_MESSAGES = { - [ERROR_BAD_PRIVATE.toString()]: "Expected Private", - [ERROR_BAD_POINT.toString()]: "Expected Point", - [ERROR_BAD_TWEAK.toString()]: "Expected Tweak", - [ERROR_BAD_HASH.toString()]: "Expected Hash", - [ERROR_BAD_SIGNATURE.toString()]: "Expected Signature", - [ERROR_BAD_EXTRA_DATA.toString()]: "Expected Extra Data (32 bytes)", - [ERROR_BAD_PARITY.toString()]: "Expected Parity (1 | 0)", - [ERROR_BAD_RECOVERY_ID.toString()]: "Bad Recovery Id", -}; -function throwError(errcode) { - const message = ERRORS_MESSAGES[errcode.toString()] || `Unknow error code: ${errcode}`; - throw new TypeError(message); -} - -var validate_error = /*#__PURE__*/Object.freeze({ - __proto__: null, - ERROR_BAD_PRIVATE: ERROR_BAD_PRIVATE, - ERROR_BAD_POINT: ERROR_BAD_POINT, - ERROR_BAD_TWEAK: ERROR_BAD_TWEAK, - ERROR_BAD_HASH: ERROR_BAD_HASH, - ERROR_BAD_SIGNATURE: ERROR_BAD_SIGNATURE, - ERROR_BAD_EXTRA_DATA: ERROR_BAD_EXTRA_DATA, - ERROR_BAD_PARITY: ERROR_BAD_PARITY, - ERROR_BAD_RECOVERY_ID: ERROR_BAD_RECOVERY_ID, - throwError: throwError -}); - -const PRIVATE_KEY_SIZE = 32; -const PUBLIC_KEY_COMPRESSED_SIZE = 33; -const PUBLIC_KEY_UNCOMPRESSED_SIZE = 65; -const X_ONLY_PUBLIC_KEY_SIZE = 32; -const TWEAK_SIZE = 32; -const HASH_SIZE = 32; -const EXTRA_DATA_SIZE = 32; -const SIGNATURE_SIZE = 64; -const BN32_ZERO = new Uint8Array(32); -const BN32_N = new Uint8Array([ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 254, 186, 174, 220, 230, 175, 72, 160, 59, 191, 210, 94, 140, 208, 54, 65, 65, -]); -// Difference between field and order -const BN32_P_MINUS_N = new Uint8Array([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 69, 81, 35, 25, 80, 183, 95, - 196, 64, 45, 161, 114, 47, 201, 186, 238, -]); -function isUint8Array(value) { - return value instanceof Uint8Array; -} -function cmpBN32(data1, data2) { - for (let i = 0; i < 32; ++i) { - if (data1[i] !== data2[i]) { - return data1[i] < data2[i] ? -1 : 1; - } - } - return 0; -} -function isZero(x) { - return cmpBN32(x, BN32_ZERO) === 0; -} -function isPrivate$1(x) { - return (isUint8Array(x) && - x.length === PRIVATE_KEY_SIZE && - cmpBN32(x, BN32_ZERO) > 0 && - cmpBN32(x, BN32_N) < 0); -} -function isPoint$1(p) { - return (isUint8Array(p) && - (p.length === PUBLIC_KEY_COMPRESSED_SIZE || - p.length === PUBLIC_KEY_UNCOMPRESSED_SIZE || - p.length === X_ONLY_PUBLIC_KEY_SIZE)); -} -function isXOnlyPoint$1(p) { - return isUint8Array(p) && p.length === X_ONLY_PUBLIC_KEY_SIZE; -} -function isDERPoint(p) { - return (isUint8Array(p) && - (p.length === PUBLIC_KEY_COMPRESSED_SIZE || - p.length === PUBLIC_KEY_UNCOMPRESSED_SIZE)); -} -function isPointCompressed$1(p) { - return isUint8Array(p) && p.length === PUBLIC_KEY_COMPRESSED_SIZE; -} -function isTweak(tweak) { - return (isUint8Array(tweak) && - tweak.length === TWEAK_SIZE && - cmpBN32(tweak, BN32_N) < 0); -} -function isHash(h) { - return isUint8Array(h) && h.length === HASH_SIZE; -} -function isExtraData(e) { - return e === undefined || (isUint8Array(e) && e.length === EXTRA_DATA_SIZE); -} -function isSignature(signature) { - return (isUint8Array(signature) && - signature.length === 64 && - cmpBN32(signature.subarray(0, 32), BN32_N) < 0 && - cmpBN32(signature.subarray(32, 64), BN32_N) < 0); -} -function isSigrLessThanPMinusN(signature) { - return (isUint8Array(signature) && - signature.length === 64 && - cmpBN32(signature.subarray(0, 32), BN32_P_MINUS_N) < 0); -} -function validateParity(p) { - if (p !== 0 && p !== 1) - throwError(ERROR_BAD_PARITY); -} -function validatePrivate(d) { - if (!isPrivate$1(d)) - throwError(ERROR_BAD_PRIVATE); -} -function validatePoint(p) { - if (!isPoint$1(p)) - throwError(ERROR_BAD_POINT); -} -function validateXOnlyPoint(p) { - if (!isXOnlyPoint$1(p)) - throwError(ERROR_BAD_POINT); -} -function validateTweak(tweak) { - if (!isTweak(tweak)) - throwError(ERROR_BAD_TWEAK); -} -function validateHash(h) { - if (!isHash(h)) - throwError(ERROR_BAD_HASH); -} -function validateExtraData(e) { - if (!isExtraData(e)) - throwError(ERROR_BAD_EXTRA_DATA); -} -function validateSignature$1(signature) { - if (!isSignature(signature)) - throwError(ERROR_BAD_SIGNATURE); -} -function validateSignatureCustom(validatorFn) { - if (!validatorFn()) - throwError(ERROR_BAD_SIGNATURE); -} -function validateSignatureNonzeroRS(signature) { - if (isZero(signature.subarray(0, 32))) - throwError(ERROR_BAD_SIGNATURE); - if (isZero(signature.subarray(32, 64))) - throwError(ERROR_BAD_SIGNATURE); -} -function validateSigrPMinusN(signature) { - if (!isSigrLessThanPMinusN(signature)) - throwError(ERROR_BAD_RECOVERY_ID); -} - -function path$f(wasmFilename) { - const url = new URL$6(wasmFilename, import.meta.url); - return fileURLToPath$1(url); -} - -function generateInt32() { - return randomBytes$3(4).readInt32BE(0); -} - -var rand = /*#__PURE__*/Object.freeze({ - __proto__: null, - generateInt32: generateInt32 -}); - -const binary$5 = readFileSync(path$f("secp256k1.wasm")); -const imports = { - "./rand.js": rand, - "./validate_error.js": validate_error, -}; -const mod$1 = new WebAssembly.Module(binary$5); -const instance = new WebAssembly.Instance(mod$1, imports); -var wasm = instance.exports; - -const WASM_BUFFER = new Uint8Array(wasm.memory.buffer); -const WASM_PRIVATE_KEY_PTR = wasm.PRIVATE_INPUT.value; -const WASM_PUBLIC_KEY_INPUT_PTR = wasm.PUBLIC_KEY_INPUT.value; -const WASM_PUBLIC_KEY_INPUT_PTR2 = wasm.PUBLIC_KEY_INPUT2.value; -const WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR = wasm.X_ONLY_PUBLIC_KEY_INPUT.value; -const WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR = wasm.X_ONLY_PUBLIC_KEY_INPUT2.value; -const WASM_TWEAK_INPUT_PTR = wasm.TWEAK_INPUT.value; -const WASM_HASH_INPUT_PTR = wasm.HASH_INPUT.value; -const WASM_EXTRA_DATA_INPUT_PTR = wasm.EXTRA_DATA_INPUT.value; -const WASM_SIGNATURE_INPUT_PTR = wasm.SIGNATURE_INPUT.value; -const PRIVATE_KEY_INPUT = WASM_BUFFER.subarray(WASM_PRIVATE_KEY_PTR, WASM_PRIVATE_KEY_PTR + PRIVATE_KEY_SIZE); -const PUBLIC_KEY_INPUT = WASM_BUFFER.subarray(WASM_PUBLIC_KEY_INPUT_PTR, WASM_PUBLIC_KEY_INPUT_PTR + PUBLIC_KEY_UNCOMPRESSED_SIZE); -const PUBLIC_KEY_INPUT2 = WASM_BUFFER.subarray(WASM_PUBLIC_KEY_INPUT_PTR2, WASM_PUBLIC_KEY_INPUT_PTR2 + PUBLIC_KEY_UNCOMPRESSED_SIZE); -const X_ONLY_PUBLIC_KEY_INPUT = WASM_BUFFER.subarray(WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR, WASM_X_ONLY_PUBLIC_KEY_INPUT_PTR + X_ONLY_PUBLIC_KEY_SIZE); -const X_ONLY_PUBLIC_KEY_INPUT2 = WASM_BUFFER.subarray(WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR, WASM_X_ONLY_PUBLIC_KEY_INPUT2_PTR + X_ONLY_PUBLIC_KEY_SIZE); -const TWEAK_INPUT = WASM_BUFFER.subarray(WASM_TWEAK_INPUT_PTR, WASM_TWEAK_INPUT_PTR + TWEAK_SIZE); -const HASH_INPUT = WASM_BUFFER.subarray(WASM_HASH_INPUT_PTR, WASM_HASH_INPUT_PTR + HASH_SIZE); -const EXTRA_DATA_INPUT = WASM_BUFFER.subarray(WASM_EXTRA_DATA_INPUT_PTR, WASM_EXTRA_DATA_INPUT_PTR + EXTRA_DATA_SIZE); -const SIGNATURE_INPUT = WASM_BUFFER.subarray(WASM_SIGNATURE_INPUT_PTR, WASM_SIGNATURE_INPUT_PTR + SIGNATURE_SIZE); -function assumeCompression(compressed, p) { - if (compressed === undefined) { - return p !== undefined ? p.length : PUBLIC_KEY_COMPRESSED_SIZE; - } - return compressed - ? PUBLIC_KEY_COMPRESSED_SIZE - : PUBLIC_KEY_UNCOMPRESSED_SIZE; -} -function _isPoint(p) { - try { - PUBLIC_KEY_INPUT.set(p); - return wasm.isPoint(p.length) === 1; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - } -} -function __initializeContext() { - wasm.initializeContext(); -} -function isPoint(p) { - return isDERPoint(p) && _isPoint(p); -} -function isPointCompressed(p) { - return isPointCompressed$1(p) && _isPoint(p); -} -function isXOnlyPoint(p) { - return isXOnlyPoint$1(p) && _isPoint(p); -} -function isPrivate(d) { - return isPrivate$1(d); -} -function pointAdd(pA, pB, compressed) { - validatePoint(pA); - validatePoint(pB); - const outputlen = assumeCompression(compressed, pA); - try { - PUBLIC_KEY_INPUT.set(pA); - PUBLIC_KEY_INPUT2.set(pB); - return wasm.pointAdd(pA.length, pB.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - PUBLIC_KEY_INPUT2.fill(0); - } -} -function pointAddScalar(p, tweak, compressed) { - validatePoint(p); - validateTweak(tweak); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - return wasm.pointAddScalar(p.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } -} -function pointCompress(p, compressed) { - validatePoint(p); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - wasm.pointCompress(p.length, outputlen); - return PUBLIC_KEY_INPUT.slice(0, outputlen); - } - finally { - PUBLIC_KEY_INPUT.fill(0); - } -} -function pointFromScalar(d, compressed) { - validatePrivate(d); - const outputlen = assumeCompression(compressed); - try { - PRIVATE_KEY_INPUT.set(d); - return wasm.pointFromScalar(outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - } -} -function xOnlyPointFromScalar(d) { - validatePrivate(d); - try { - PRIVATE_KEY_INPUT.set(d); - wasm.xOnlyPointFromScalar(); - return X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - } - finally { - PRIVATE_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - } -} -function xOnlyPointFromPoint(p) { - validatePoint(p); - try { - PUBLIC_KEY_INPUT.set(p); - wasm.xOnlyPointFromPoint(p.length); - return X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - } - finally { - PUBLIC_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - } -} -function pointMultiply(p, tweak, compressed) { - validatePoint(p); - validateTweak(tweak); - const outputlen = assumeCompression(compressed, p); - try { - PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - return wasm.pointMultiply(p.length, outputlen) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } -} -function privateAdd(d, tweak) { - validatePrivate(d); - validateTweak(tweak); - try { - PRIVATE_KEY_INPUT.set(d); - TWEAK_INPUT.set(tweak); - return wasm.privateAdd() === 1 - ? PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } -} -function privateSub(d, tweak) { - validatePrivate(d); - validateTweak(tweak); - // We can not pass zero tweak to WASM, because WASM use `secp256k1_ec_seckey_negate` for tweak negate. - // (zero is not valid seckey) - if (isZero(tweak)) { - return new Uint8Array(d); - } - try { - PRIVATE_KEY_INPUT.set(d); - TWEAK_INPUT.set(tweak); - return wasm.privateSub() === 1 - ? PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE) - : null; - } - finally { - PRIVATE_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } -} -function privateNegate(d) { - validatePrivate(d); - try { - PRIVATE_KEY_INPUT.set(d); - wasm.privateNegate(); - return PRIVATE_KEY_INPUT.slice(0, PRIVATE_KEY_SIZE); - } - finally { - PRIVATE_KEY_INPUT.fill(0); - } -} -function xOnlyPointAddTweak(p, tweak) { - validateXOnlyPoint(p); - validateTweak(tweak); - try { - X_ONLY_PUBLIC_KEY_INPUT.set(p); - TWEAK_INPUT.set(tweak); - const parity = wasm.xOnlyPointAddTweak(); - return parity !== -1 - ? { - parity, - xOnlyPubkey: X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE), - } - : null; - } - finally { - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - TWEAK_INPUT.fill(0); - } -} -function xOnlyPointAddTweakCheck(point, tweak, resultToCheck, tweakParity) { - validateXOnlyPoint(point); - validateXOnlyPoint(resultToCheck); - validateTweak(tweak); - const hasParity = tweakParity !== undefined; - if (hasParity) - validateParity(tweakParity); - try { - X_ONLY_PUBLIC_KEY_INPUT.set(point); - X_ONLY_PUBLIC_KEY_INPUT2.set(resultToCheck); - TWEAK_INPUT.set(tweak); - if (hasParity) { - return wasm.xOnlyPointAddTweakCheck(tweakParity) === 1; - } - else { - wasm.xOnlyPointAddTweak(); - const newKey = X_ONLY_PUBLIC_KEY_INPUT.slice(0, X_ONLY_PUBLIC_KEY_SIZE); - return compare$j(newKey, resultToCheck) === 0; - } - } - finally { - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT2.fill(0); - TWEAK_INPUT.fill(0); - } -} -function sign$1(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - wasm.sign(e === undefined ? 0 : 1); - return SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } -} -function signRecoverable$1(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - const recoveryId = wasm.signRecoverable(e === undefined ? 0 : 1); - const signature = SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - return { - signature, - recoveryId, - }; - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } -} -function signSchnorr(h, d, e) { - validateHash(h); - validatePrivate(d); - validateExtraData(e); - try { - HASH_INPUT.set(h); - PRIVATE_KEY_INPUT.set(d); - if (e !== undefined) - EXTRA_DATA_INPUT.set(e); - wasm.signSchnorr(e === undefined ? 0 : 1); - return SIGNATURE_INPUT.slice(0, SIGNATURE_SIZE); - } - finally { - HASH_INPUT.fill(0); - PRIVATE_KEY_INPUT.fill(0); - if (e !== undefined) - EXTRA_DATA_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } -} -function verify$1(h, Q, signature, strict = false) { - validateHash(h); - validatePoint(Q); - validateSignature$1(signature); - try { - HASH_INPUT.set(h); - PUBLIC_KEY_INPUT.set(Q); - SIGNATURE_INPUT.set(signature); - return wasm.verify(Q.length, strict === true ? 1 : 0) === 1 ? true : false; - } - finally { - HASH_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } -} -function recover$1(h, signature, recoveryId, compressed = false) { - validateHash(h); - validateSignature$1(signature); - validateSignatureNonzeroRS(signature); - if (recoveryId & 2) { - validateSigrPMinusN(signature); - } - validateSignatureCustom(() => isXOnlyPoint(signature.subarray(0, 32))); - const outputlen = assumeCompression(compressed); - try { - HASH_INPUT.set(h); - SIGNATURE_INPUT.set(signature); - return wasm.recover(outputlen, recoveryId) === 1 - ? PUBLIC_KEY_INPUT.slice(0, outputlen) - : null; - } - finally { - HASH_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - PUBLIC_KEY_INPUT.fill(0); - } -} -function verifySchnorr(h, Q, signature) { - validateHash(h); - validateXOnlyPoint(Q); - validateSignature$1(signature); - try { - HASH_INPUT.set(h); - X_ONLY_PUBLIC_KEY_INPUT.set(Q); - SIGNATURE_INPUT.set(signature); - return wasm.verifySchnorr() === 1 ? true : false; - } - finally { - HASH_INPUT.fill(0); - X_ONLY_PUBLIC_KEY_INPUT.fill(0); - SIGNATURE_INPUT.fill(0); - } -} - -var lib = /*#__PURE__*/Object.freeze({ - __proto__: null, - __initializeContext: __initializeContext, - isPoint: isPoint, - isPointCompressed: isPointCompressed, - isXOnlyPoint: isXOnlyPoint, - isPrivate: isPrivate, - pointAdd: pointAdd, - pointAddScalar: pointAddScalar, - pointCompress: pointCompress, - pointFromScalar: pointFromScalar, - xOnlyPointFromScalar: xOnlyPointFromScalar, - xOnlyPointFromPoint: xOnlyPointFromPoint, - pointMultiply: pointMultiply, - privateAdd: privateAdd, - privateSub: privateSub, - privateNegate: privateNegate, - xOnlyPointAddTweak: xOnlyPointAddTweak, - xOnlyPointAddTweakCheck: xOnlyPointAddTweakCheck, - sign: sign$1, - signRecoverable: signRecoverable$1, - signSchnorr: signSchnorr, - verify: verify$1, - recover: recover$1, - verifySchnorr: verifySchnorr -}); - -var require$$5 = /*@__PURE__*/getAugmentedNamespace(lib); - -var src$3 = {}; - -var bip32$1 = {}; - -var crypto$h = {}; - -var createHash$3 = require$$0$4.createHash; - -var createHmac$2 = require$$0$4.createHmac; - -Object.defineProperty(crypto$h, "__esModule", { value: true }); -const createHash$2 = createHash$3; -const createHmac$1 = createHmac$2; -function hash160$a(buffer) { - const sha256Hash = createHash$2('sha256') - .update(buffer) - .digest(); - try { - return createHash$2('rmd160') - .update(sha256Hash) - .digest(); - } - catch (err) { - return createHash$2('ripemd160') - .update(sha256Hash) - .digest(); - } -} -crypto$h.hash160 = hash160$a; -function hmacSHA512(key, data) { - return createHmac$1('sha512', key) - .update(data) - .digest(); -} -crypto$h.hmacSHA512 = hmacSHA512; - -var testecc = {}; - -Object.defineProperty(testecc, "__esModule", { value: true }); -const h = (hex) => Buffer.from(hex, 'hex'); -function testEcc(ecc) { - assert$2Z(ecc.isPoint(h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))); - assert$2Z(!ecc.isPoint(h('030000000000000000000000000000000000000000000000000000000000000005'))); - assert$2Z(ecc.isPrivate(h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))); - // order - 1 - assert$2Z(ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))); - // 0 - assert$2Z(!ecc.isPrivate(h('0000000000000000000000000000000000000000000000000000000000000000'))); - // order - assert$2Z(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'))); - // order + 1 - assert$2Z(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142'))); - assert$2Z(Buffer.from(ecc.pointFromScalar(h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'))).equals(h('02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99'))); - assert$2Z(Buffer.from(ecc.pointAddScalar(h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('0000000000000000000000000000000000000000000000000000000000000003'))).equals(h('02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5'))); - assert$2Z(Buffer.from(ecc.privateAdd(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'), h('0000000000000000000000000000000000000000000000000000000000000002'))).equals(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))); - assert$2Z(Buffer.from(ecc.sign(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))).equals(h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5'))); - assert$2Z(ecc.verify(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5'))); - if (ecc.signSchnorr) { - assert$2Z(Buffer.from(ecc.signSchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9'), h('c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906'))).equals(h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7'))); - } - if (ecc.verifySchnorr) { - assert$2Z(ecc.verifySchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8'), h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7'))); - } -} -testecc.testEcc = testEcc; -function assert$2Z(bool) { - if (!bool) - throw new Error('ecc library invalid'); -} - -var safeBuffer = {exports: {}}; - -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ - -(function (module, exports) { -/* eslint-disable node/no-deprecated-api */ -var buffer = require$$0$6; -var Buffer = buffer.Buffer; - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key]; - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer; -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports); - exports.Buffer = SafeBuffer; -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype); - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer); - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -}; - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size); - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf -}; - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -}; - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -}; -}(safeBuffer, safeBuffer.exports)); - -// base-x encoding / decoding -// Copyright (c) 2018 base-x contributors -// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp) -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php. -// @ts-ignore -var _Buffer$1 = safeBuffer.exports.Buffer; -function base$1 (ALPHABET) { - if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up - var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up - function encode (source) { - if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer$1.from(source); } - if (!_Buffer$1.isBuffer(source)) { throw new TypeError('Expected Buffer') } - if (source.length === 0) { return '' } - // Skip & count leading zeroes. - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - // Allocate enough space in big-endian base58 representation. - var size = ((pend - pbegin) * iFACTOR + 1) >>> 0; - var b58 = new Uint8Array(size); - // Process the bytes. - while (pbegin !== pend) { - var carry = source[pbegin]; - // Apply "b58 = b58 * 256 + ch". - var i = 0; - for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) { - carry += (256 * b58[it1]) >>> 0; - b58[it1] = (carry % BASE) >>> 0; - carry = (carry / BASE) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - pbegin++; - } - // Skip leading zeroes in base58 result. - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - // Translate the result into a string. - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); } - return str - } - function decodeUnsafe (source) { - if (typeof source !== 'string') { throw new TypeError('Expected String') } - if (source.length === 0) { return _Buffer$1.alloc(0) } - var psz = 0; - // Skip and count leading '1's. - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - // Allocate enough space in big-endian base256 representation. - var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up. - var b256 = new Uint8Array(size); - // Process the characters. - while (source[psz]) { - // Decode character - var carry = BASE_MAP[source.charCodeAt(psz)]; - // Invalid character - if (carry === 255) { return } - var i = 0; - for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) { - carry += (BASE * b256[it3]) >>> 0; - b256[it3] = (carry % 256) >>> 0; - carry = (carry / 256) >>> 0; - } - if (carry !== 0) { throw new Error('Non-zero carry') } - length = i; - psz++; - } - // Skip leading zeroes in b256. - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = _Buffer$1.allocUnsafe(zeroes + (size - it4)); - vch.fill(0x00, 0, zeroes); - var j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch - } - function decode (string) { - var buffer = decodeUnsafe(string); - if (buffer) { return buffer } - throw new Error('Non-base' + BASE + ' character') - } - return { - encode: encode, - decodeUnsafe: decodeUnsafe, - decode: decode - } -} -var src$2 = base$1; - -var basex = src$2; -var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - -var bs58 = basex(ALPHABET); - -var base58$a = bs58; -var Buffer$4 = safeBuffer.exports.Buffer; - -var base = function (checksumFn) { - // Encode a buffer as a base58-check encoded string - function encode (payload) { - var checksum = checksumFn(payload); - - return base58$a.encode(Buffer$4.concat([ - payload, - checksum - ], payload.length + 4)) - } - - function decodeRaw (buffer) { - var payload = buffer.slice(0, -4); - var checksum = buffer.slice(-4); - var newChecksum = checksumFn(payload); - - if (checksum[0] ^ newChecksum[0] | - checksum[1] ^ newChecksum[1] | - checksum[2] ^ newChecksum[2] | - checksum[3] ^ newChecksum[3]) return - - return payload - } - - // Decode a base58-check encoded string to a buffer, no result if checksum is wrong - function decodeUnsafe (string) { - var buffer = base58$a.decodeUnsafe(string); - if (!buffer) return - - return decodeRaw(buffer) - } - - function decode (string) { - var buffer = base58$a.decode(string); - var payload = decodeRaw(buffer); - if (!payload) throw new Error('Invalid checksum') - return payload - } - - return { - encode: encode, - decode: decode, - decodeUnsafe: decodeUnsafe - } -}; - -var createHash$1 = createHash$3; -var bs58checkBase = base; - -// SHA256(SHA256(buffer)) -function sha256x2 (buffer) { - var tmp = createHash$1('sha256').update(buffer).digest(); - return createHash$1('sha256').update(tmp).digest() -} - -var bs58check$2 = bs58checkBase(sha256x2); - -var types$e = { - Array: function (value) { return value !== null && value !== undefined && value.constructor === Array }, - Boolean: function (value) { return typeof value === 'boolean' }, - Function: function (value) { return typeof value === 'function' }, - Nil: function (value) { return value === undefined || value === null }, - Number: function (value) { return typeof value === 'number' }, - Object: function (value) { return typeof value === 'object' }, - String: function (value) { return typeof value === 'string' }, - '': function () { return true } -}; - -// TODO: deprecate -types$e.Null = types$e.Nil; - -for (var typeName$2 in types$e) { - types$e[typeName$2].toJSON = function (t) { - return t - }.bind(null, typeName$2); -} - -var native$2 = types$e; - -var native$1 = native$2; - -function getTypeName (fn) { - return fn.name || fn.toString().match(/function (.*?)\s*\(/)[1] -} - -function getValueTypeName$1 (value) { - return native$1.Nil(value) ? '' : getTypeName(value.constructor) -} - -function getValue (value) { - if (native$1.Function(value)) return '' - if (native$1.String(value)) return JSON.stringify(value) - if (value && native$1.Object(value)) return '' - return value -} - -function captureStackTrace (e, t) { - if (Error.captureStackTrace) { - Error.captureStackTrace(e, t); - } -} - -function tfJSON$1 (type) { - if (native$1.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type) - if (native$1.Array(type)) return 'Array' - if (type && native$1.Object(type)) return 'Object' - - return type !== undefined ? type : '' -} - -function tfErrorString (type, value, valueTypeName) { - var valueJson = getValue(value); - - return 'Expected ' + tfJSON$1(type) + ', got' + - (valueTypeName !== '' ? ' ' + valueTypeName : '') + - (valueJson !== '' ? ' ' + valueJson : '') -} - -function TfTypeError$1 (type, value, valueTypeName) { - valueTypeName = valueTypeName || getValueTypeName$1(value); - this.message = tfErrorString(type, value, valueTypeName); - - captureStackTrace(this, TfTypeError$1); - this.__type = type; - this.__value = value; - this.__valueTypeName = valueTypeName; -} - -TfTypeError$1.prototype = Object.create(Error.prototype); -TfTypeError$1.prototype.constructor = TfTypeError$1; - -function tfPropertyErrorString (type, label, name, value, valueTypeName) { - var description = '" of type '; - if (label === 'key') description = '" with key type '; - - return tfErrorString('property "' + tfJSON$1(name) + description + tfJSON$1(type), value, valueTypeName) -} - -function TfPropertyTypeError$1 (type, property, label, value, valueTypeName) { - if (type) { - valueTypeName = valueTypeName || getValueTypeName$1(value); - this.message = tfPropertyErrorString(type, label, property, value, valueTypeName); - } else { - this.message = 'Unexpected property "' + property + '"'; - } - - captureStackTrace(this, TfTypeError$1); - this.__label = label; - this.__property = property; - this.__type = type; - this.__value = value; - this.__valueTypeName = valueTypeName; -} - -TfPropertyTypeError$1.prototype = Object.create(Error.prototype); -TfPropertyTypeError$1.prototype.constructor = TfTypeError$1; - -function tfCustomError (expected, actual) { - return new TfTypeError$1(expected, {}, actual) -} - -function tfSubError$1 (e, property, label) { - // sub child? - if (e instanceof TfPropertyTypeError$1) { - property = property + '.' + e.__property; - - e = new TfPropertyTypeError$1( - e.__type, property, e.__label, e.__value, e.__valueTypeName - ); - - // child? - } else if (e instanceof TfTypeError$1) { - e = new TfPropertyTypeError$1( - e.__type, property, label, e.__value, e.__valueTypeName - ); - } - - captureStackTrace(e); - return e -} - -var errors$3 = { - TfTypeError: TfTypeError$1, - TfPropertyTypeError: TfPropertyTypeError$1, - tfCustomError: tfCustomError, - tfSubError: tfSubError$1, - tfJSON: tfJSON$1, - getValueTypeName: getValueTypeName$1 -}; - -var NATIVE$1 = native$2; -var ERRORS$1 = errors$3; - -function _Buffer (value) { - return Buffer.isBuffer(value) -} - -function Hex (value) { - return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value) -} - -function _LengthN (type, length) { - var name = type.toJSON(); - - function Length (value) { - if (!type(value)) return false - if (value.length === length) return true - - throw ERRORS$1.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')') - } - Length.toJSON = function () { return name }; - - return Length -} - -var _ArrayN = _LengthN.bind(null, NATIVE$1.Array); -var _BufferN = _LengthN.bind(null, _Buffer); -var _HexN = _LengthN.bind(null, Hex); -var _StringN = _LengthN.bind(null, NATIVE$1.String); - -function Range (a, b, f) { - f = f || NATIVE$1.Number; - function _range (value, strict) { - return f(value, strict) && (value > a) && (value < b) - } - _range.toJSON = function () { - return `${f.toJSON()} between [${a}, ${b}]` - }; - return _range -} - -var INT53_MAX = Math.pow(2, 53) - 1; - -function Finite (value) { - return typeof value === 'number' && isFinite(value) -} -function Int8 (value) { return ((value << 24) >> 24) === value } -function Int16 (value) { return ((value << 16) >> 16) === value } -function Int32 (value) { return (value | 0) === value } -function Int53 (value) { - return typeof value === 'number' && - value >= -INT53_MAX && - value <= INT53_MAX && - Math.floor(value) === value -} -function UInt8 (value) { return (value & 0xff) === value } -function UInt16 (value) { return (value & 0xffff) === value } -function UInt32 (value) { return (value >>> 0) === value } -function UInt53 (value) { - return typeof value === 'number' && - value >= 0 && - value <= INT53_MAX && - Math.floor(value) === value -} - -var types$d = { - ArrayN: _ArrayN, - Buffer: _Buffer, - BufferN: _BufferN, - Finite: Finite, - Hex: Hex, - HexN: _HexN, - Int8: Int8, - Int16: Int16, - Int32: Int32, - Int53: Int53, - Range: Range, - StringN: _StringN, - UInt8: UInt8, - UInt16: UInt16, - UInt32: UInt32, - UInt53: UInt53 -}; - -for (var typeName$1 in types$d) { - types$d[typeName$1].toJSON = function (t) { - return t - }.bind(null, typeName$1); -} - -var extra$2 = types$d; - -var ERRORS = errors$3; -var NATIVE = native$2; - -// short-hand -var tfJSON = ERRORS.tfJSON; -var TfTypeError = ERRORS.TfTypeError; -var TfPropertyTypeError = ERRORS.TfPropertyTypeError; -var tfSubError = ERRORS.tfSubError; -var getValueTypeName = ERRORS.getValueTypeName; - -var TYPES = { - arrayOf: function arrayOf (type, options) { - type = compile$3(type); - options = options || {}; - - function _arrayOf (array, strict) { - if (!NATIVE.Array(array)) return false - if (NATIVE.Nil(array)) return false - if (options.minLength !== undefined && array.length < options.minLength) return false - if (options.maxLength !== undefined && array.length > options.maxLength) return false - if (options.length !== undefined && array.length !== options.length) return false - - return array.every(function (value, i) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - throw tfSubError(e, i) - } - }) - } - _arrayOf.toJSON = function () { - var str = '[' + tfJSON(type) + ']'; - if (options.length !== undefined) { - str += '{' + options.length + '}'; - } else if (options.minLength !== undefined || options.maxLength !== undefined) { - str += '{' + - (options.minLength === undefined ? 0 : options.minLength) + ',' + - (options.maxLength === undefined ? Infinity : options.maxLength) + '}'; - } - return str - }; - - return _arrayOf - }, - - maybe: function maybe (type) { - type = compile$3(type); - - function _maybe (value, strict) { - return NATIVE.Nil(value) || type(value, strict, maybe) - } - _maybe.toJSON = function () { return '?' + tfJSON(type) }; - - return _maybe - }, - - map: function map (propertyType, propertyKeyType) { - propertyType = compile$3(propertyType); - if (propertyKeyType) propertyKeyType = compile$3(propertyKeyType); - - function _map (value, strict) { - if (!NATIVE.Object(value)) return false - if (NATIVE.Nil(value)) return false - - for (var propertyName in value) { - try { - if (propertyKeyType) { - typeforce$1(propertyKeyType, propertyName, strict); - } - } catch (e) { - throw tfSubError(e, propertyName, 'key') - } - - try { - var propertyValue = value[propertyName]; - typeforce$1(propertyType, propertyValue, strict); - } catch (e) { - throw tfSubError(e, propertyName) - } - } - - return true - } - - if (propertyKeyType) { - _map.toJSON = function () { - return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}' - }; - } else { - _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }; - } - - return _map - }, - - object: function object (uncompiled) { - var type = {}; - - for (var typePropertyName in uncompiled) { - type[typePropertyName] = compile$3(uncompiled[typePropertyName]); - } - - function _object (value, strict) { - if (!NATIVE.Object(value)) return false - if (NATIVE.Nil(value)) return false - - var propertyName; - - try { - for (propertyName in type) { - var propertyType = type[propertyName]; - var propertyValue = value[propertyName]; - - typeforce$1(propertyType, propertyValue, strict); - } - } catch (e) { - throw tfSubError(e, propertyName) - } - - if (strict) { - for (propertyName in value) { - if (type[propertyName]) continue - - throw new TfPropertyTypeError(undefined, propertyName) - } - } - - return true - } - _object.toJSON = function () { return tfJSON(type) }; - - return _object - }, - - anyOf: function anyOf () { - var types = [].slice.call(arguments).map(compile$3); - - function _anyOf (value, strict) { - return types.some(function (type) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - return false - } - }) - } - _anyOf.toJSON = function () { return types.map(tfJSON).join('|') }; - - return _anyOf - }, - - allOf: function allOf () { - var types = [].slice.call(arguments).map(compile$3); - - function _allOf (value, strict) { - return types.every(function (type) { - try { - return typeforce$1(type, value, strict) - } catch (e) { - return false - } - }) - } - _allOf.toJSON = function () { return types.map(tfJSON).join(' & ') }; - - return _allOf - }, - - quacksLike: function quacksLike (type) { - function _quacksLike (value) { - return type === getValueTypeName(value) - } - _quacksLike.toJSON = function () { return type }; - - return _quacksLike - }, - - tuple: function tuple () { - var types = [].slice.call(arguments).map(compile$3); - - function _tuple (values, strict) { - if (NATIVE.Nil(values)) return false - if (NATIVE.Nil(values.length)) return false - if (strict && (values.length !== types.length)) return false - - return types.every(function (type, i) { - try { - return typeforce$1(type, values[i], strict) - } catch (e) { - throw tfSubError(e, i) - } - }) - } - _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }; - - return _tuple - }, - - value: function value (expected) { - function _value (actual) { - return actual === expected - } - _value.toJSON = function () { return expected }; - - return _value - } -}; - -// TODO: deprecate -TYPES.oneOf = TYPES.anyOf; - -function compile$3 (type) { - if (NATIVE.String(type)) { - if (type[0] === '?') return TYPES.maybe(type.slice(1)) - - return NATIVE[type] || TYPES.quacksLike(type) - } else if (type && NATIVE.Object(type)) { - if (NATIVE.Array(type)) { - if (type.length !== 1) throw new TypeError('Expected compile() parameter of type Array of length 1') - return TYPES.arrayOf(type[0]) - } - - return TYPES.object(type) - } else if (NATIVE.Function(type)) { - return type - } - - return TYPES.value(type) -} - -function typeforce$1 (type, value, strict, surrogate) { - if (NATIVE.Function(type)) { - if (type(value, strict)) return true - - throw new TfTypeError(surrogate || type, value) - } - - // JIT - return typeforce$1(compile$3(type), value, strict) -} - -// assign types to typeforce function -for (var typeName in NATIVE) { - typeforce$1[typeName] = NATIVE[typeName]; -} - -for (typeName in TYPES) { - typeforce$1[typeName] = TYPES[typeName]; -} - -var EXTRA = extra$2; -for (typeName in EXTRA) { - typeforce$1[typeName] = EXTRA[typeName]; -} - -typeforce$1.compile = compile$3; -typeforce$1.TfTypeError = TfTypeError; -typeforce$1.TfPropertyTypeError = TfPropertyTypeError; - -var typeforce_1 = typeforce$1; - -var bs58check$1 = bs58check$2; - -function decodeRaw (buffer, version) { - // check version only if defined - if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version') - - // uncompressed - if (buffer.length === 33) { - return { - version: buffer[0], - privateKey: buffer.slice(1, 33), - compressed: false - } - } - - // invalid length - if (buffer.length !== 34) throw new Error('Invalid WIF length') - - // invalid compression flag - if (buffer[33] !== 0x01) throw new Error('Invalid compression flag') - - return { - version: buffer[0], - privateKey: buffer.slice(1, 33), - compressed: true - } -} - -function encodeRaw (version, privateKey, compressed) { - var result = new Buffer(compressed ? 34 : 33); - - result.writeUInt8(version, 0); - privateKey.copy(result, 1); - - if (compressed) { - result[33] = 0x01; - } - - return result -} - -function decode$5 (string, version) { - return decodeRaw(bs58check$1.decode(string), version) -} - -function encode$6 (version, privateKey, compressed) { - if (typeof version === 'number') return bs58check$1.encode(encodeRaw(version, privateKey, compressed)) - - return bs58check$1.encode( - encodeRaw( - version.version, - version.privateKey, - version.compressed - ) - ) -} - -var wif$1 = { - decode: decode$5, - decodeRaw: decodeRaw, - encode: encode$6, - encodeRaw: encodeRaw -}; - -Object.defineProperty(bip32$1, "__esModule", { value: true }); -const crypto$g = crypto$h; -const testecc_1 = testecc; -const bs58check = bs58check$2; -const typeforce = typeforce_1; -const wif = wif$1; -function BIP32Factory(ecc) { - testecc_1.testEcc(ecc); - const UINT256_TYPE = typeforce.BufferN(32); - const NETWORK_TYPE = typeforce.compile({ - wif: typeforce.UInt8, - bip32: { - public: typeforce.UInt32, - private: typeforce.UInt32, - }, - }); - const BITCOIN = { - messagePrefix: '\x18Bitcoin Signed Message:\n', - bech32: 'bc', - bip32: { - public: 0x0488b21e, - private: 0x0488ade4, - }, - pubKeyHash: 0x00, - scriptHash: 0x05, - wif: 0x80, - }; - const HIGHEST_BIT = 0x80000000; - const UINT31_MAX = Math.pow(2, 31) - 1; - function BIP32Path(value) { - return (typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/) !== null); - } - function UInt31(value) { - return typeforce.UInt32(value) && value <= UINT31_MAX; - } - class BIP32 { - constructor(__D, __Q, chainCode, network, __DEPTH = 0, __INDEX = 0, __PARENT_FINGERPRINT = 0x00000000) { - this.__D = __D; - this.__Q = __Q; - this.chainCode = chainCode; - this.network = network; - this.__DEPTH = __DEPTH; - this.__INDEX = __INDEX; - this.__PARENT_FINGERPRINT = __PARENT_FINGERPRINT; - typeforce(NETWORK_TYPE, network); - this.lowR = false; - } - get depth() { - return this.__DEPTH; - } - get index() { - return this.__INDEX; - } - get parentFingerprint() { - return this.__PARENT_FINGERPRINT; - } - get publicKey() { - if (this.__Q === undefined) - this.__Q = Buffer.from(ecc.pointFromScalar(this.__D, true)); - return this.__Q; - } - get privateKey() { - return this.__D; - } - get identifier() { - return crypto$g.hash160(this.publicKey); - } - get fingerprint() { - return this.identifier.slice(0, 4); - } - get compressed() { - return true; - } - // Private === not neutered - // Public === neutered - isNeutered() { - return this.__D === undefined; - } - neutered() { - return fromPublicKeyLocal(this.publicKey, this.chainCode, this.network, this.depth, this.index, this.parentFingerprint); - } - toBase58() { - const network = this.network; - const version = !this.isNeutered() - ? network.bip32.private - : network.bip32.public; - const buffer = Buffer.allocUnsafe(78); - // 4 bytes: version bytes - buffer.writeUInt32BE(version, 0); - // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, .... - buffer.writeUInt8(this.depth, 4); - // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key) - buffer.writeUInt32BE(this.parentFingerprint, 5); - // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized. - // This is encoded in big endian. (0x00000000 if master key) - buffer.writeUInt32BE(this.index, 9); - // 32 bytes: the chain code - this.chainCode.copy(buffer, 13); - // 33 bytes: the public key or private key data - if (!this.isNeutered()) { - // 0x00 + k for private keys - buffer.writeUInt8(0, 45); - this.privateKey.copy(buffer, 46); - // 33 bytes: the public key - } - else { - // X9.62 encoding for public keys - this.publicKey.copy(buffer, 45); - } - return bs58check.encode(buffer); - } - toWIF() { - if (!this.privateKey) - throw new TypeError('Missing private key'); - return wif.encode(this.network.wif, this.privateKey, true); - } - // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions - derive(index) { - typeforce(typeforce.UInt32, index); - const isHardened = index >= HIGHEST_BIT; - const data = Buffer.allocUnsafe(37); - // Hardened child - if (isHardened) { - if (this.isNeutered()) - throw new TypeError('Missing private key for hardened child key'); - // data = 0x00 || ser256(kpar) || ser32(index) - data[0] = 0x00; - this.privateKey.copy(data, 1); - data.writeUInt32BE(index, 33); - // Normal child - } - else { - // data = serP(point(kpar)) || ser32(index) - // = serP(Kpar) || ser32(index) - this.publicKey.copy(data, 0); - data.writeUInt32BE(index, 33); - } - const I = crypto$g.hmacSHA512(this.chainCode, data); - const IL = I.slice(0, 32); - const IR = I.slice(32); - // if parse256(IL) >= n, proceed with the next value for i - if (!ecc.isPrivate(IL)) - return this.derive(index + 1); - // Private parent key -> private child key - let hd; - if (!this.isNeutered()) { - // ki = parse256(IL) + kpar (mod n) - const ki = Buffer.from(ecc.privateAdd(this.privateKey, IL)); - // In case ki == 0, proceed with the next value for i - if (ki == null) - return this.derive(index + 1); - hd = fromPrivateKeyLocal(ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0)); - // Public parent key -> public child key - } - else { - // Ki = point(parse256(IL)) + Kpar - // = G*IL + Kpar - const Ki = Buffer.from(ecc.pointAddScalar(this.publicKey, IL, true)); - // In case Ki is the point at infinity, proceed with the next value for i - if (Ki === null) - return this.derive(index + 1); - hd = fromPublicKeyLocal(Ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0)); - } - return hd; - } - deriveHardened(index) { - typeforce(UInt31, index); - // Only derives hardened private keys by default - return this.derive(index + HIGHEST_BIT); - } - derivePath(path) { - typeforce(BIP32Path, path); - let splitPath = path.split('/'); - if (splitPath[0] === 'm') { - if (this.parentFingerprint) - throw new TypeError('Expected master, got child'); - splitPath = splitPath.slice(1); - } - return splitPath.reduce((prevHd, indexStr) => { - let index; - if (indexStr.slice(-1) === `'`) { - index = parseInt(indexStr.slice(0, -1), 10); - return prevHd.deriveHardened(index); - } - else { - index = parseInt(indexStr, 10); - return prevHd.derive(index); - } - }, this); - } - sign(hash, lowR) { - if (!this.privateKey) - throw new Error('Missing private key'); - if (lowR === undefined) - lowR = this.lowR; - if (lowR === false) { - return Buffer.from(ecc.sign(hash, this.privateKey)); - } - else { - let sig = Buffer.from(ecc.sign(hash, this.privateKey)); - const extraData = Buffer.alloc(32, 0); - let counter = 0; - // if first try is lowR, skip the loop - // for second try and on, add extra entropy counting up - while (sig[0] > 0x7f) { - counter++; - extraData.writeUIntLE(counter, 0, 6); - sig = Buffer.from(ecc.sign(hash, this.privateKey, extraData)); - } - return sig; - } - } - signSchnorr(hash) { - if (!this.privateKey) - throw new Error('Missing private key'); - if (!ecc.signSchnorr) - throw new Error('signSchnorr not supported by ecc library'); - return Buffer.from(ecc.signSchnorr(hash, this.privateKey)); - } - verify(hash, signature) { - return ecc.verify(hash, this.publicKey, signature); - } - verifySchnorr(hash, signature) { - if (!ecc.verifySchnorr) - throw new Error('verifySchnorr not supported by ecc library'); - return ecc.verifySchnorr(hash, this.publicKey.subarray(1, 33), signature); - } - } - function fromBase58(inString, network) { - const buffer = bs58check.decode(inString); - if (buffer.length !== 78) - throw new TypeError('Invalid buffer length'); - network = network || BITCOIN; - // 4 bytes: version bytes - const version = buffer.readUInt32BE(0); - if (version !== network.bip32.private && version !== network.bip32.public) - throw new TypeError('Invalid network version'); - // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ... - const depth = buffer[4]; - // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key) - const parentFingerprint = buffer.readUInt32BE(5); - if (depth === 0) { - if (parentFingerprint !== 0x00000000) - throw new TypeError('Invalid parent fingerprint'); - } - // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized. - // This is encoded in MSB order. (0x00000000 if master key) - const index = buffer.readUInt32BE(9); - if (depth === 0 && index !== 0) - throw new TypeError('Invalid index'); - // 32 bytes: the chain code - const chainCode = buffer.slice(13, 45); - let hd; - // 33 bytes: private key data (0x00 + k) - if (version === network.bip32.private) { - if (buffer.readUInt8(45) !== 0x00) - throw new TypeError('Invalid private key'); - const k = buffer.slice(46, 78); - hd = fromPrivateKeyLocal(k, chainCode, network, depth, index, parentFingerprint); - // 33 bytes: public key data (0x02 + X or 0x03 + X) - } - else { - const X = buffer.slice(45, 78); - hd = fromPublicKeyLocal(X, chainCode, network, depth, index, parentFingerprint); - } - return hd; - } - function fromPrivateKey(privateKey, chainCode, network) { - return fromPrivateKeyLocal(privateKey, chainCode, network); - } - function fromPrivateKeyLocal(privateKey, chainCode, network, depth, index, parentFingerprint) { - typeforce({ - privateKey: UINT256_TYPE, - chainCode: UINT256_TYPE, - }, { privateKey, chainCode }); - network = network || BITCOIN; - if (!ecc.isPrivate(privateKey)) - throw new TypeError('Private key not in range [1, n)'); - return new BIP32(privateKey, undefined, chainCode, network, depth, index, parentFingerprint); - } - function fromPublicKey(publicKey, chainCode, network) { - return fromPublicKeyLocal(publicKey, chainCode, network); - } - function fromPublicKeyLocal(publicKey, chainCode, network, depth, index, parentFingerprint) { - typeforce({ - publicKey: typeforce.BufferN(33), - chainCode: UINT256_TYPE, - }, { publicKey, chainCode }); - network = network || BITCOIN; - // verify the X coordinate is a point on the curve - if (!ecc.isPoint(publicKey)) - throw new TypeError('Point is not on the curve'); - return new BIP32(undefined, publicKey, chainCode, network, depth, index, parentFingerprint); - } - function fromSeed(seed, network) { - typeforce(typeforce.Buffer, seed); - if (seed.length < 16) - throw new TypeError('Seed should be at least 128 bits'); - if (seed.length > 64) - throw new TypeError('Seed should be at most 512 bits'); - network = network || BITCOIN; - const I = crypto$g.hmacSHA512(Buffer.from('Bitcoin seed', 'utf8'), seed); - const IL = I.slice(0, 32); - const IR = I.slice(32); - return fromPrivateKey(IL, IR, network); - } - return { - fromSeed, - fromBase58, - fromPublicKey, - fromPrivateKey, - }; -} -bip32$1.BIP32Factory = BIP32Factory; - -Object.defineProperty(src$3, "__esModule", { value: true }); -var bip32_1 = bip32$1; -src$3.default = bip32_1.BIP32Factory; -src$3.BIP32Factory = bip32_1.BIP32Factory; - -var src$1 = {}; - -var pbkdf2$7 = {}; - -var MAX_ALLOC = Math.pow(2, 30) - 1; // default in iojs - -var precondition = function (iterations, keylen) { - if (typeof iterations !== 'number') { - throw new TypeError('Iterations not a number') - } - - if (iterations < 0) { - throw new TypeError('Bad iterations') - } - - if (typeof keylen !== 'number') { - throw new TypeError('Key length not a number') - } - - if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ - throw new TypeError('Bad key length') - } -}; - -var defaultEncoding$3; -/* istanbul ignore next */ -if (commonjsGlobal.process && commonjsGlobal.process.browser) { - defaultEncoding$3 = 'utf-8'; -} else if (commonjsGlobal.process && commonjsGlobal.process.version) { - var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10); - - defaultEncoding$3 = pVersionMajor >= 6 ? 'utf-8' : 'binary'; -} else { - defaultEncoding$3 = 'utf-8'; -} -var defaultEncoding_1 = defaultEncoding$3; - -var Buffer$3 = safeBuffer.exports.Buffer; - -var toBuffer$8 = function (thing, encoding, name) { - if (Buffer$3.isBuffer(thing)) { - return thing - } else if (typeof thing === 'string') { - return Buffer$3.from(thing, encoding) - } else if (ArrayBuffer.isView(thing)) { - return Buffer$3.from(thing.buffer) - } else { - throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView') - } -}; - -var sizes = { - md5: 16, - sha1: 20, - sha224: 28, - sha256: 32, - sha384: 48, - sha512: 64, - rmd160: 20, - ripemd160: 20 -}; - -var createHmac = createHmac$2; -var Buffer$2 = safeBuffer.exports.Buffer; - -var checkParameters$2 = precondition; -var defaultEncoding$2 = defaultEncoding_1; -var toBuffer$7 = toBuffer$8; - -function pbkdf2$6 (password, salt, iterations, keylen, digest) { - checkParameters$2(iterations, keylen); - password = toBuffer$7(password, defaultEncoding$2, 'Password'); - salt = toBuffer$7(salt, defaultEncoding$2, 'Salt'); - - digest = digest || 'sha1'; - - var DK = Buffer$2.allocUnsafe(keylen); - var block1 = Buffer$2.allocUnsafe(salt.length + 4); - salt.copy(block1, 0, 0, salt.length); - - var destPos = 0; - var hLen = sizes[digest]; - var l = Math.ceil(keylen / hLen); - - for (var i = 1; i <= l; i++) { - block1.writeUInt32BE(i, salt.length); - - var T = createHmac(digest, password).update(block1).digest(); - var U = T; - - for (var j = 1; j < iterations; j++) { - U = createHmac(digest, password).update(U).digest(); - for (var k = 0; k < hLen; k++) T[k] ^= U[k]; - } - - T.copy(DK, destPos); - destPos += hLen; - } - - return DK -} - -var sync$1 = pbkdf2$6; - -var Buffer$1 = safeBuffer.exports.Buffer; - -var checkParameters$1 = precondition; -var defaultEncoding$1 = defaultEncoding_1; -var sync = sync$1; -var toBuffer$6 = toBuffer$8; - -var ZERO_BUF; -var subtle$1 = commonjsGlobal.crypto && commonjsGlobal.crypto.subtle; -var toBrowser = { - sha: 'SHA-1', - 'sha-1': 'SHA-1', - sha1: 'SHA-1', - sha256: 'SHA-256', - 'sha-256': 'SHA-256', - sha384: 'SHA-384', - 'sha-384': 'SHA-384', - 'sha-512': 'SHA-512', - sha512: 'SHA-512' -}; -var checks = []; -function checkNative (algo) { - if (commonjsGlobal.process && !commonjsGlobal.process.browser) { - return Promise.resolve(false) - } - if (!subtle$1 || !subtle$1.importKey || !subtle$1.deriveBits) { - return Promise.resolve(false) - } - if (checks[algo] !== undefined) { - return checks[algo] - } - ZERO_BUF = ZERO_BUF || Buffer$1.alloc(8); - var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) - .then(function () { - return true - }).catch(function () { - return false - }); - checks[algo] = prom; - return prom -} -var nextTick; -function getNextTick () { - if (nextTick) { - return nextTick - } - if (commonjsGlobal.process && commonjsGlobal.process.nextTick) { - nextTick = commonjsGlobal.process.nextTick; - } else if (commonjsGlobal.queueMicrotask) { - nextTick = commonjsGlobal.queueMicrotask; - } else if (commonjsGlobal.setImmediate) { - nextTick = commonjsGlobal.setImmediate; - } else { - nextTick = commonjsGlobal.setTimeout; - } - return nextTick -} -function browserPbkdf2 (password, salt, iterations, length, algo) { - return subtle$1.importKey( - 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits'] - ).then(function (key) { - return subtle$1.deriveBits({ - name: 'PBKDF2', - salt: salt, - iterations: iterations, - hash: { - name: algo - } - }, key, length << 3) - }).then(function (res) { - return Buffer$1.from(res) - }) -} - -function resolvePromise (promise, callback) { - promise.then(function (out) { - getNextTick()(function () { - callback(null, out); - }); - }, function (e) { - getNextTick()(function () { - callback(e); - }); - }); -} -var async = function (password, salt, iterations, keylen, digest, callback) { - if (typeof digest === 'function') { - callback = digest; - digest = undefined; - } - - digest = digest || 'sha1'; - var algo = toBrowser[digest.toLowerCase()]; - - if (!algo || typeof commonjsGlobal.Promise !== 'function') { - getNextTick()(function () { - var out; - try { - out = sync(password, salt, iterations, keylen, digest); - } catch (e) { - return callback(e) - } - callback(null, out); - }); - return - } - - checkParameters$1(iterations, keylen); - password = toBuffer$6(password, defaultEncoding$1, 'Password'); - salt = toBuffer$6(salt, defaultEncoding$1, 'Salt'); - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - resolvePromise(checkNative(algo).then(function (resp) { - if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo) - - return sync(password, salt, iterations, keylen, digest) - }), callback); -}; - -var native = require$$0$4; - -var checkParameters = precondition; -var defaultEncoding = defaultEncoding_1; -var toBuffer$5 = toBuffer$8; - -function nativePBKDF2 (password, salt, iterations, keylen, digest, callback) { - checkParameters(iterations, keylen); - password = toBuffer$5(password, defaultEncoding, 'Password'); - salt = toBuffer$5(salt, defaultEncoding, 'Salt'); - - if (typeof digest === 'function') { - callback = digest; - digest = 'sha1'; - } - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - return native.pbkdf2(password, salt, iterations, keylen, digest, callback) -} - -function nativePBKDF2Sync (password, salt, iterations, keylen, digest) { - checkParameters(iterations, keylen); - password = toBuffer$5(password, defaultEncoding, 'Password'); - salt = toBuffer$5(salt, defaultEncoding, 'Salt'); - digest = digest || 'sha1'; - return native.pbkdf2Sync(password, salt, iterations, keylen, digest) -} - -/* istanbul ignore next */ -if (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) { - pbkdf2$7.pbkdf2Sync = sync$1; - pbkdf2$7.pbkdf2 = async; - -// native -} else { - pbkdf2$7.pbkdf2Sync = nativePBKDF2Sync; - pbkdf2$7.pbkdf2 = nativePBKDF2; -} - -var randombytes = require$$0$4.randomBytes; - -var _wordlists = {}; - -Object.defineProperty(_wordlists, "__esModule", { value: true }); -// browserify by default only pulls in files that are hard coded in requires -// In order of last to first in this file, the default wordlist will be chosen -// based on what is present. (Bundles may remove wordlists they don't need) -const wordlists = {}; -_wordlists.wordlists = wordlists; -let _default; -var _default_1 = _wordlists._default = _default; -try { - _default_1 = _wordlists._default = _default = require('./wordlists/czech.json'); - wordlists.czech = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/chinese_simplified.json'); - wordlists.chinese_simplified = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/chinese_traditional.json'); - wordlists.chinese_traditional = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/korean.json'); - wordlists.korean = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/french.json'); - wordlists.french = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/italian.json'); - wordlists.italian = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/spanish.json'); - wordlists.spanish = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/japanese.json'); - wordlists.japanese = _default; - wordlists.JA = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/portuguese.json'); - wordlists.portuguese = _default; -} -catch (err) { } -try { - _default_1 = _wordlists._default = _default = require('./wordlists/english.json'); - wordlists.english = _default; - wordlists.EN = _default; -} -catch (err) { } - -Object.defineProperty(src$1, "__esModule", { value: true }); -const createHash = createHash$3; -const pbkdf2_1 = pbkdf2$7; -const randomBytes$2 = randombytes; -const _wordlists_1 = _wordlists; -let DEFAULT_WORDLIST = _wordlists_1._default; -const INVALID_MNEMONIC = 'Invalid mnemonic'; -const INVALID_ENTROPY = 'Invalid entropy'; -const INVALID_CHECKSUM = 'Invalid mnemonic checksum'; -const WORDLIST_REQUIRED = 'A wordlist is required but a default could not be found.\n' + - 'Please pass a 2048 word array explicitly.'; -function pbkdf2Promise(password, saltMixin, iterations, keylen, digest) { - return Promise.resolve().then(() => new Promise((resolve, reject) => { - const callback = (err, derivedKey) => { - if (err) { - return reject(err); - } - else { - return resolve(derivedKey); - } - }; - pbkdf2_1.pbkdf2(password, saltMixin, iterations, keylen, digest, callback); - })); -} -function normalize$4(str) { - return (str || '').normalize('NFKD'); -} -function lpad(str, padString, length) { - while (str.length < length) { - str = padString + str; - } - return str; -} -function binaryToByte(bin) { - return parseInt(bin, 2); -} -function bytesToBinary(bytes) { - return bytes.map((x) => lpad(x.toString(2), '0', 8)).join(''); -} -function deriveChecksumBits(entropyBuffer) { - const ENT = entropyBuffer.length * 8; - const CS = ENT / 32; - const hash = createHash('sha256') - .update(entropyBuffer) - .digest(); - return bytesToBinary(Array.from(hash)).slice(0, CS); -} -function salt(password) { - return 'mnemonic' + (password || ''); -} -function mnemonicToSeedSync(mnemonic, password) { - const mnemonicBuffer = Buffer.from(normalize$4(mnemonic), 'utf8'); - const saltBuffer = Buffer.from(salt(normalize$4(password)), 'utf8'); - return pbkdf2_1.pbkdf2Sync(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512'); -} -src$1.mnemonicToSeedSync = mnemonicToSeedSync; -function mnemonicToSeed(mnemonic, password) { - return Promise.resolve().then(() => { - const mnemonicBuffer = Buffer.from(normalize$4(mnemonic), 'utf8'); - const saltBuffer = Buffer.from(salt(normalize$4(password)), 'utf8'); - return pbkdf2Promise(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512'); - }); -} -src$1.mnemonicToSeed = mnemonicToSeed; -function mnemonicToEntropy(mnemonic, wordlist) { - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - const words = normalize$4(mnemonic).split(' '); - if (words.length % 3 !== 0) { - throw new Error(INVALID_MNEMONIC); - } - // convert word indices to 11 bit binary strings - const bits = words - .map((word) => { - const index = wordlist.indexOf(word); - if (index === -1) { - throw new Error(INVALID_MNEMONIC); - } - return lpad(index.toString(2), '0', 11); - }) - .join(''); - // split the binary string into ENT/CS - const dividerIndex = Math.floor(bits.length / 33) * 32; - const entropyBits = bits.slice(0, dividerIndex); - const checksumBits = bits.slice(dividerIndex); - // calculate the checksum and compare - const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte); - if (entropyBytes.length < 16) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length > 32) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length % 4 !== 0) { - throw new Error(INVALID_ENTROPY); - } - const entropy = Buffer.from(entropyBytes); - const newChecksum = deriveChecksumBits(entropy); - if (newChecksum !== checksumBits) { - throw new Error(INVALID_CHECKSUM); - } - return entropy.toString('hex'); -} -src$1.mnemonicToEntropy = mnemonicToEntropy; -function entropyToMnemonic(entropy, wordlist) { - if (!Buffer.isBuffer(entropy)) { - entropy = Buffer.from(entropy, 'hex'); - } - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - // 128 <= ENT <= 256 - if (entropy.length < 16) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length > 32) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length % 4 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - const entropyBits = bytesToBinary(Array.from(entropy)); - const checksumBits = deriveChecksumBits(entropy); - const bits = entropyBits + checksumBits; - const chunks = bits.match(/(.{1,11})/g); - const words = chunks.map((binary) => { - const index = binaryToByte(binary); - return wordlist[index]; - }); - return wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093' // Japanese wordlist - ? words.join('\u3000') - : words.join(' '); -} -src$1.entropyToMnemonic = entropyToMnemonic; -function generateMnemonic(strength, rng, wordlist) { - strength = strength || 128; - if (strength % 32 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - rng = rng || randomBytes$2; - return entropyToMnemonic(rng(strength / 8), wordlist); -} -src$1.generateMnemonic = generateMnemonic; -function validateMnemonic(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } - catch (e) { - return false; - } - return true; -} -src$1.validateMnemonic = validateMnemonic; -function setDefaultWordlist(language) { - const result = _wordlists_1.wordlists[language]; - if (result) { - DEFAULT_WORDLIST = result; - } - else { - throw new Error('Could not find wordlist for language "' + language + '"'); - } -} -src$1.setDefaultWordlist = setDefaultWordlist; -function getDefaultWordlist() { - if (!DEFAULT_WORDLIST) { - throw new Error('No Default Wordlist set'); - } - return Object.keys(_wordlists_1.wordlists).filter((lang) => { - if (lang === 'JA' || lang === 'EN') { - return false; - } - return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]); - })[0]; -} -src$1.getDefaultWordlist = getDefaultWordlist; -var _wordlists_2 = _wordlists; -src$1.wordlists = _wordlists_2.wordlists; - -// Constants -const { - FABRIC_KEY_DERIVATION_PATH -} = constants$1; - -// Node Modules -const crypto$f = require$$0$4; - -// Dependencies -const Generator = dist.exports.default.Generator; -const BN$b = bn$2.exports; -const EC = elliptic$2.ec; -const ec = new EC('secp256k1'); -const ecc = require$$5; - -// External Dependencies -// TODO: remove all external dependencies -const BIP32 = src$3.default; -const bip32 = new BIP32(ecc); -const bip39 = src$1; - -/** - * Represents a cryptographic key. - */ -class Key$9 { - /** - * Create an instance of a Fabric Key, either restoring from some known - * values or from prior knowledge. For instance, you can call `new Key()` - * to create a fresh keypair, or `new Key({ public: 'deadbeef...' })` to - * create it from a known public key. - * @param {Object} [settings] Initialization for the key. - * @param {String} [settings.network] Network string. - * @param {String} [settings.seed] Mnemonic seed for initializing the key. - * @param {String} [settings.public] Public key in hex. - * @param {String} [settings.private] Private key in hex. - */ - constructor (input = {}) { - this.settings = Object.assign({ - debug: false, - network: 'main', - curve: 'secp256k1', - derivation: FABRIC_KEY_DERIVATION_PATH, - mode: 'aes-256-cbc', - prefix: '00', - public: null, - private: null, - bits: 256, - hd: true, - seed: null, - password: null, - index: 0, - cipher: { - iv: { - size: 16 - } - }, - witness: true - }, input); - - this.clock = 0; - this.master = null; - this.private = null; - this.public = null; - - // Configure Deterministic Random - // WARNING: this will currently loop after 2^32 bits - // TODO: evaluate compression when treating seed phrase as ascii - // TODO: consider using sha256(masterprivkey) or sha256(sha256(...))? - this._starseed = this.settings.seed || crypto$f.randomBytes(4).readUInt32BE(); - - // TODO: design state machine for input (configuration) - if (this.settings.seed) { - this._mode = 'FROM_SEED'; - } else if (this.settings.private) { - this._mode = 'FROM_PRIVATE_KEY'; - } else if (this.settings.xprv) { - this._mode = 'FROM_XPRV'; - } else if (this.settings.xpub) { - this._mode = 'FROM_XPUB'; - } else if (this.settings.pubkey || this.settings.public) { - this._mode = 'FROM_PUBLIC_KEY'; - } else { - this._mode = 'FROM_RANDOM'; - } - - if (this.settings.debug) console.debug('mode:', this._mode, crypto$f.createHash('sha256').update(this.settings.seed).digest('hex'), this.settings.seed); - - switch (this._mode) { - case 'FROM_SEED': - const seed = bip39.mnemonicToSeedSync(this.settings.seed); - const root = bip32.fromSeed(seed); - this.xprv = root.toBase58(); - this.xpub = root.neutered().toBase58(); - this.master = root; - this.keypair = ec.keyFromPrivate(root.privateKey); - // this.address = this.keyring.getAddress().toString(); - this.status = 'seeded'; - break; - case 'FROM_XPRV': - const restored = bip32.fromBase58(this.settings.xprv); - this.xprv = restored.toBase58(); - this.xpub = restored.neutered().toBase58(); - this.master = restored; - this.keypair = ec.keyFromPrivate(restored.privateKey); - break; - case 'FROM_XPUB': - const xpub = bip32.fromBase58(this.settings.xpub); - this.keypair = ec.keyFromPublic(xpub.publicKey); - break; - case 'FROM_PRIVATE_KEY': - // Key is private - (this.settings.private instanceof Buffer) ? this.settings.private : Buffer.from(this.settings.private, 'hex'); - this.keypair = ec.keyFromPrivate(this.settings.private); - break; - case 'FROM_PUBLIC_KEY': - const pubkey = this.settings.pubkey || this.settings.public; - // Key is only public - this.keypair = ec.keyFromPublic((pubkey instanceof Buffer) ? pubkey : Buffer.from(pubkey, 'hex')); - break; - case 'FROM_RANDOM': - const mnemonic = bip39.generateMnemonic(); - const interim = bip39.mnemonicToSeedSync(mnemonic); - this.master = bip32.fromSeed(interim); - this.keypair = ec.keyFromPrivate(this.master.privateKey); - break; - } - - // Read the pair - this.private = ( - !this.settings.seed && - !this.settings.private && - !this.settings.xprv - ) ? false : this.keypair.getPrivate(); - - this.public = this.keypair.getPublic(true); - - // TODO: determine if this makes sense / needs to be private - this.privkey = (this.private) ? this.private.toString() : null; - - // STANDARD BEGINS HERE - this.pubkey = this.public.encodeCompressed('hex'); - - // BELOW THIS NON-STANDARD - // DO NOT USE IN PRODUCTION - // this.pubkeyhash = this.keyring.getKeyHash('hex'); - this.pubkeyhash = ''; - this.generator = new Generator(parseInt(this._starseed, 10)); - - this['@data'] = { - type: 'Key', - public: this.pubkey, - address: this.address - }; - - this._state = { - pubkey: this.pubkey - }; - - // Object.defineProperty(this, 'keyring', { enumerable: false }); - Object.defineProperty(this, 'keypair', { enumerable: false }); - Object.defineProperty(this, 'private', { enumerable: false }); - - return this; - } - - static Mnemonic (seed) { - return new Key$9({ seed }); - } - - get id () { - return this.pubkeyhash; - } - - get iv () { - const self = this; - const bits = new BN$b([...Array(128)].map(() => { - return self.bit().toString(); - }).join(''), 2).toString(16); - return Buffer.from(bits.toString(16), 'hex'); - } - - bit () { - return this.generator.next.bits(1); - } - - encrypt (value) { - try { - const ivbuff = Buffer.from(this.iv, 'hex'); - const cipher = crypto$f.createCipheriv(this.settings.mode, this.private.toBuffer(), ivbuff); - let encrypted = cipher.update(value); - encrypted = Buffer.concat([ - encrypted, - cipher.final() - ]); - return ivbuff.toString('hex') + ':' + encrypted.toString('hex'); - } catch (exception) { - console.error('err:', exception); - } - } - - decrypt (text) { - if (text instanceof Buffer) text = text.toString('utf8'); - - try { - const parts = text.split(':'); - const iv = Buffer.from(parts.shift(), 'hex'); - const blob = Buffer.from(parts.join(':'), 'hex'); - const decipher = crypto$f.createDecipheriv(this.settings.mode, this.private.toBuffer(), iv); - let decrypted = decipher.update(blob); - decrypted = Buffer.concat([ - decrypted, - decipher.final() - ]); - return decrypted.toString(); - } catch (exception) { - console.error('err:', exception); - } - } - - _sign (msg) { - if (typeof msg !== 'string') msg = JSON.stringify(msg); - const hmac = crypto$f.createHash('sha256').update(msg).digest('hex'); - return this.keypair.sign(hmac).toDER(); - } - - _verify (msg, sig) { - const hmac = crypto$f.createHash('sha256').update(msg).digest('hex'); - const valid = this.keypair.verify(hmac, sig); - return valid; - } - - derive (path = this.settings.derivation) { - if (!this.master) throw new Error('You cannot derive without a master key. Provide a seed phrase or an xprv.'); - const derived = this.master.derivePath(path); - const options = { - private: derived.privateKey.encodeCompressed('hex'), - public: derived.publicKey.encodeCompressed('hex') - }; - - return new Key$9(options); - } -} - -var key$1 = Key$9; - -var struct$3 = {exports: {}}; - -/** - * Default export `Struct`. - */ - -(function (module, exports) { -// export default Struct; -module.exports = exports = Struct; - -// compatibility -exports.Struct = Struct; - -function boolField(p, offset, length) { - this.length = length; - this.offset = offset; - this.get = function() { - return (p.buf[offset] > 0); - }; - this.set = function (val) { - p.buf[offset] = val ? 1 : 0; - }; -} - -function intField(p, offset, length, le, signed) { - this.length = length; - this.offset = offset; - - function bec(cb) { - for (var i = 0; i < length; i++) - cb(i, length - i - 1); - } - - function lec(cb) { - for (var i = 0; i < length; i++) - cb(i, i); - } - - function getUVal(bor) { - var val = 0; - bor(function (i, o) { - val += Math.pow(256, o) * p.buf[offset + i]; - }); - return val; - } - - function getSVal(bor) { - - var val = getUVal(bor); - if ((p.buf[offset + (le ? (length - 1) : 0)] & 0x80) == 0x80) { - val -= Math.pow(256, length); - } - return val; - } - - function setVal(bor, val) { - bor(function (i, o) { - p.buf[offset + i] = Math.floor(val / Math.pow(256, o)) & 0xff; - }); - } - - var - nativeSuff = (signed?'':'U') + 'Int' + (length * 8) + (le?'LE':'BE'), - readMethod = Buffer.prototype['read' + nativeSuff], writeMethod = Buffer.prototype['write' + nativeSuff]; - - - if (!readMethod) { - this.get = function () { - var bor = le ? lec : bec; - return (signed ? getSVal(bor) : getUVal(bor)); - }; - } - else { - this.get = function () { - return readMethod.call(p.buf, offset); - }; - } - - - if (!writeMethod) { - this.set = function (val) { - var bor = le ? lec : bec; - setVal(bor, val); - }; - } - else { - this.set = function (val) { - writeMethod.call(p.buf, val, offset); - }; - } - -} - -function floatField(p, offset, le) { - this.length = 4; - this.offset = offset; - this.get = function () { - return le ? p.buf.readFloatLE(offset) : p.buf.readFloatBE(offset); - }; - this.set = function (val) { - return le ? p.buf.writeFloatLE(val, offset) : p.buf.writeFloatBE(val, offset); - }; -} - -function doubleField(p, offset, le) { - this.length = 8; - this.offset = offset; - this.get = function () { - return le ? p.buf.readDoubleLE(offset) : p.buf.readDoubleBE(offset); - }; - this.set = function (val) { - return le ? p.buf.writeDoubleLE(val, offset) : p.buf.writeDoubleBE(val, offset); - }; -} - -function charField(p, offset, length, encoding, secure) { - var self = this; - self.length = length; - self.offset = offset; - self.encoding = encoding; - self.secure = secure; - self.get = function () { - if (!length) - return; - - var result = p.buf.toString(self.encoding, offset, (offset + length)); - var strlen = result.indexOf("\0"); - if (strlen == -1) { - return result; - } else { - return result.slice(0, strlen); - } - }; - self.set = function (val) { - if (!length) - return; - - // Be string is terminated with the null char, else troncate it - if (secure === true) { - - // Append \0 to the string - val += "\0"; - if (val.length >= length) { - val = val.substring(0, length - 1); - val += "\0"; - } - - // Write to buffer - p.buf.write(val, offset, val.length, self.encoding); - - // Fill rest of the buffer with \0 - var remainSpace = (length - val.length); - if (remainSpace > 0) { - p.buf.fill(0, (offset + val.length), offset + length); - } - - } else { - // Trust Buffer class to write the string into the buffer - p.buf.write(val, offset, length, self.encoding); - } - }; -} - -function structField(p, offset, struct) { - this.length = struct.length(); - this.offset = offset; - this.get = function () { - return struct; - }; - this.set = function (val) { - struct.set(val); - }; - this.allocate = function () { - struct._setBuff(p.buf.slice(offset, offset + struct.length())); - }; -} - -function arrayField(p, offset, len, type) { - var as = Struct(); - var args = [].slice.call(arguments, 4); - args.unshift(0); - for (var i = 0; i < len; i++) { - if (type instanceof Struct) { - as.struct(i, type.clone()); - } else if (type in as) { - args[0] = i; - as[type].apply(as, args); - } - } - this.length = as.length(); - this.offset = offset; - this.allocate = function () { - as._setBuff(p.buf.slice(offset, offset + as.length())); - }; - this.get = function () { - return as; - }; - this.set = function (val) { - as.set(val); - }; -} - -function Struct() { - if (!(this instanceof Struct)) - return new Struct; - - var priv = { - buf : {}, - allocated : false, - len : 0, - fields : {}, - closures : [] - }, self = this; - - function checkAllocated() { - if (priv.allocated) - throw new Error('Cant change struct after allocation'); - } - - // Create handlers for various float Field Variants - [true, false].forEach(function (le) { - self['float' + (le ? 'le' : 'be')] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - var n = 4; - p.fields[key] = new floatField(p, p.len, le); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various double Field Variants - [true, false].forEach(function (le) { - self['double' + (le ? 'le' : 'be')] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - var n = 8; - p.fields[key] = new doubleField(p, p.len, le); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various Bool Field Variants - [1, 2, 3, 4].forEach(function (n) { - self['bool' + (n == 1 ? '' : n)] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new boolField(p, p.len, n); - p.len += n; - }); - return this; - }; - }); - - // Create handlers for various Integer Field Variants - [1, 2, 3, 4, 6, 8].forEach(function (n) { - [true, false].forEach(function (le) { - [true, false].forEach(function (signed) { - var name = 'word' + (n * 8) + (signed ? 'S' : 'U') + (le ? 'le' : 'be'); - self[name] = function (key) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new intField(p, p.len, n, le, signed); - p.len += n; - }); - return this; - }; - }); - }); - }); - this.word8 = this.word8Ule; - - ['chars', 'charsnt'].forEach(function (c) { - self[c] = function (key, length, encoding) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new charField(p, p.len, length, encoding || 'ascii', (c == 'charsnt')); - p.len += length; - }); - return this; - }; - }); - - this.struct = function (key, struct) { - checkAllocated(); - priv.closures.push(function (p) { - p.fields[key] = new structField(p, p.len, struct.clone()); - p.len += p.fields[key].length; - }); - return this; - }; - function construct(constructor, args) { - function F() { - return constructor.apply(this, args); - } - - F.prototype = constructor.prototype; - return new F(); - } - - - this.array = function (key, length, type) { - checkAllocated(); - var args = [].slice.call(arguments, 1); - args.unshift(null); - args.unshift(null); - priv.closures.push(function (p) { - args[0] = p; - args[1] = p.len; - p.fields[key] = construct(arrayField, args); - p.len += p.fields[key].length; - }); - - return this; - }; - var beenHere = false; - - function applyClosures(p) { - if (beenHere) - return; - p.closures.forEach(function (el) { - el(p); - }); - beenHere = true; - } - - function allocateFields() { - for (var key in priv.fields) { - if ('allocate' in priv.fields[key]) - priv.fields[key].allocate(); - } - } - - this._setBuff = this.setBuffer = function (buff, buffLength) { - applyClosures(priv); - if (typeof (buffLength) === 'number') { - if (buffLength > buff.length) { - throw new Error('Invalid specified buffer size !'); - } - priv.buf = buff.slice(0, buffLength); - } else { - priv.buf = buff; - } - if (priv.buf.length < priv.len) { - throw new Error('Buffer size too small for struct layout !'); - } - allocateFields(); - priv.allocated = true; - }; - - this.allocate = function () { - applyClosures(priv); - if (Buffer.alloc) { - priv.buf = Buffer.alloc(priv.len); - } else { - priv.buf = new Buffer(priv.len); - priv.buf.fill(0); - } - allocateFields(); - priv.allocated = true; - return this; - }; - - this._getPriv = function () { - return priv; - }; - - this.getOffset = function (field) { - if (priv.fields[field]) return priv.fields[field].offset; - }; - - this.clone = function () { - var c = new Struct; - var p = c._getPriv(); - p.closures = priv.closures.slice(0); - return c; - }; - - this.length = function () { - applyClosures(priv); - return priv.len; - }; - - this.get = function (key) { - if (key in priv.fields) { - return priv.fields[key].get(); - } else - throw new Error('Can not find field ' + key); - }; - - this.set = function (key, val) { - if (arguments.length == 2) { - if (key in priv.fields) { - priv.fields[key].set(val); - } else - throw new Error('Can not find field ' + key); - } else if (Buffer.isBuffer(key)) { - this._setBuff(key); - } else { - for (var k in key) { - this.set(k, key[k]); - } - } - }; - this.buffer = function () { - return priv.buf; - }; - - - function getFields() { - var fields = {}; - Object.keys(priv.fields).forEach(function (key) { - var setFunc, getFunc; - if (priv.fields[key] instanceof structField || - priv.fields[key] instanceof arrayField) { - getFunc = function () { - return priv.fields[key].get().fields; - }; - setFunc = function (newVal) { - self.set(key, newVal); - }; - } - else { - getFunc = priv.fields[key].get; - setFunc = priv.fields[key].set; - } - Object.defineProperty(fields, key, { - get : getFunc, - set : setFunc, - enumerable : true - }); - }); - return fields; - } - var _fields; - Object.defineProperty(this, 'fields', { - get : function () { - if (_fields) - return _fields; - return (_fields = getFields()); - }, - enumerable : true, - configurable : true - }); - -} -}(struct$3, struct$3.exports)); - -const Actor$d = actor; -const Hash256$7 = hash256$l; - -class Label$2 extends Actor$d { - constructor (input = '') { - super(input); - if (typeof input != 'string') input = super.serialize(input); - this._id = Hash256$7.digest(`@labels/${input}`); - return this; - } -} - -var label = Label$2; - -var padDigits$1 = function padDigits (number, digits) { - return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; -}; - -const { - MAGIC_BYTES: MAGIC_BYTES$1, - VERSION_NUMBER, - HEADER_SIZE: HEADER_SIZE$1, - MAX_MESSAGE_SIZE: MAX_MESSAGE_SIZE$1, - OP_CYCLE, - GENERIC_MESSAGE_TYPE, - LOG_MESSAGE_TYPE, - GENERIC_LIST_TYPE, - P2P_GENERIC, - P2P_IDENT_REQUEST: P2P_IDENT_REQUEST$1, - P2P_IDENT_RESPONSE: P2P_IDENT_RESPONSE$1, - P2P_ROOT: P2P_ROOT$1, - P2P_PING: P2P_PING$1, - P2P_PONG: P2P_PONG$1, - P2P_START_CHAIN: P2P_START_CHAIN$1, - P2P_INSTRUCTION: P2P_INSTRUCTION$1, - P2P_BASE_MESSAGE: P2P_BASE_MESSAGE$1, - P2P_CHAIN_SYNC_REQUEST, - P2P_STATE_ROOT: P2P_STATE_ROOT$1, - P2P_STATE_COMMITTMENT: P2P_STATE_COMMITTMENT$1, - P2P_STATE_CHANGE: P2P_STATE_CHANGE$1, - P2P_STATE_REQUEST, - P2P_TRANSACTION, - P2P_CALL, - CHAT_MESSAGE, - DOCUMENT_PUBLISH_TYPE, - DOCUMENT_REQUEST_TYPE, - BLOCK_CANDIDATE, - PEER_CANDIDATE, - SESSION_START -} = constants$1; - -// Dependencies -const crypto$e = require$$0$4; -const struct$2 = struct$3.exports; - -// Fabric Types -const Actor$c = actor; -const Label$1 = label; - -// Function Definitions -const padDigits = padDigits$1; - -// Type Labels -const TYPE_ETHEREUM_BLOCK = parseInt((new Label$1('types/EthereumBlock'))._id, 16); -const TYPE_ETHEREUM_BLOCK_NUMBER = parseInt((new Label$1('types/EthereumBlockNumber'))._id, 16); - -/** - * The {@link Message} type defines the Application Messaging Protocol, or AMP. - * Each {@link Actor} in the network receives and broadcasts messages, - * selectively disclosing new routes to peers which may have open circuits. - * @type {Object} - */ -class Message$5 extends Actor$c { - /** - * The `Message` type is standardized in {@link Fabric} as a {@link Array}, which can be added to any other vector to compute a resulting state. - * @param {Object} message Message vector. Will be serialized by {@link Array#_serialize}. - * @return {Message} Instance of the message. - */ - constructor (input = {}) { - super(input); - - this.raw = { - magic: Buffer.alloc(4), - version: Buffer.alloc(4), - parent: Buffer.alloc(32), - type: Buffer.alloc(4), // TODO: 8, 32 - size: Buffer.alloc(4), // TODO: 8, 32 - hash: Buffer.alloc(32), - signature: Buffer.alloc(64), - data: null - }; - - this.raw.magic.write(MAGIC_BYTES$1.toString(16), 'hex'); - this.raw.version.write(padDigits(VERSION_NUMBER.toString(16), 8), 'hex'); - - if (input.data && input.type) { - this.type = input.type; - - if (typeof input.data !== 'string') { - this.data = JSON.stringify(input.data); - } else { - this.data = input.data; - } - } - - // Set various properties to be unenumerable - for (let name of [ - '@input', - '@entity', - '_state', - 'config', - 'settings', - 'stack', - 'observer' - ]) Object.defineProperty(this, name, { enumerable: false }); - - return this; - } - - get body () { - return this.raw.data.toString('utf8'); - } - - get byte () { - const input = 0 + ''; - const num = Buffer.from(`0x${padDigits(input, 8)}`, 'hex'); - return num; - } - - get tu16 () { - return parseInt(0); - } - - get tu32 () { - return parseInt(0); - } - - get tu64 () { - return parseInt(0); - } - - get Uint256 () { - // 256 bits - return Buffer.from((this.raw && this.raw.hash) ? `0x${padDigits(this.raw.hash, 8)}` : crypto$e.randomBytes(32)); - } - - set signature (value) { - if (value instanceof Buffer) value = value.toString('hex'); - this.raw.signature.write(value, 'hex'); - } - - toBuffer () { - return this.asRaw(); - } - - /** - * Returns a {@link Buffer} of the complete message. - * @return {Buffer} Buffer of the encoded {@link Message}. - */ - asRaw () { - console.log('header:', this.header); - console.log('data:', this.raw.data); - return Buffer.concat([this.header, this.raw.data]); - } - - toRaw () { - return this.asRaw(); - } - - asTypedArray () { - return new Uint8Array(this.asRaw()); - // TODO: Node 12 - // return new TypedArray(this.asRaw()); - } - - asBlob () { - return this.asRaw().map(byte => parseInt(byte, 16)); - } - - toObject () { - return { - headers: { - magic: parseInt(`${this.raw.magic.toString('hex')}`, 16), - version: parseInt(`${this.raw.version.toString('hex')}`, 16), - parent: this.raw.parent.toString('hex'), - type: parseInt(`${this.raw.type.toString('hex')}`, 16), - size: parseInt(`${this.raw.size.toString('hex')}`, 16), - signature: this.raw.signature.toString('hex'), - hash: this.raw.hash.toString('hex') - }, - type: this.type, - data: this.data - }; - } - - fromObject (input) { - return new Message$5(input); - } - - static parseBuffer (buffer) { - const message = struct$2() - .charsnt('magic', 4, 'hex') - .charsnt('version', 4, 'hex') - .charsnt('parent', 32, 'hex') - .charsnt('type', 4, 'hex') - .charsnt('size', 4, 'hex') - .charsnt('hash', 32, 'hex') - .charsnt('signature', 64, 'hex') - .charsnt('data', buffer.length - HEADER_SIZE$1); - - message.allocate(); - message._setBuff(buffer); - - return message; - } - - static parseRawMessage (buffer) { - const message = { - magic: buffer.slice(0, 4), - version: buffer.slice(4, 8), - parent: buffer.slice(8, 40), - type: buffer.slice(40, 44), - size: buffer.slice(44, 48), - hash: buffer.slice(48, 80), - signature: buffer.slice(80, 144) - }; - - if (buffer.length >= 144) { - message.data = buffer.slice(144, buffer.length); - } - - return message; - }; - - static fromBuffer (buffer) { - return Message$5.fromRaw(buffer); - } - - static fromRaw (input) { - if (!input) return null; - if (!(input instanceof Buffer)) throw new Error('Input must be a buffer.'); - // if (input.length < HEADER_SIZE) return null; - // if (input.length > MAX_MESSAGE_SIZE) return new Error('Input too large.'); - - const message = new Message$5(); - - message.raw = { - magic: input.slice(0, 4), - version: input.slice(4, 8), - parent: input.slice(8, 40), - type: input.slice(40, 44), - size: input.slice(40, 48), - hash: input.slice(40, 80), - signature: input.slice(0, 144) - }; - - message.data = input.slice(HEADER_SIZE$1); - - console.log('raw:', message.raw); - - return message; - } - - static fromVector (vector = ['LogMessage', 'No vector provided.']) { - let message = null; - - try { - message = new Message$5({ - type: vector[0], - data: vector[1] - }); - } catch (exception) { - console.error('[FABRIC:MESSAGE]', 'Could not construct Message:', exception); - } - - return message; - } - - /* get [Symbol.toStringTag] () { - return ``; - } */ - - get id () { - return crypto$e.createHash('sha256').update(this.asRaw()).digest('hex'); - } - - get types () { - // Message Types - return { - 'GenericMessage': GENERIC_MESSAGE_TYPE, - 'GenericLogMessage': LOG_MESSAGE_TYPE, - 'GenericList': GENERIC_LIST_TYPE, - 'GenericQueue': GENERIC_LIST_TYPE, - 'FabricLogMessage': LOG_MESSAGE_TYPE, - 'FabricServiceLogMessage': LOG_MESSAGE_TYPE, - 'GenericTransferQueue': GENERIC_LIST_TYPE, - // TODO: document Generic type - // P2P Commands - 'Generic': P2P_GENERIC, - 'Cycle': OP_CYCLE, - 'IdentityRequest': P2P_IDENT_REQUEST$1, - 'IdentityResponse': P2P_IDENT_RESPONSE$1, - 'ChainSyncRequest': P2P_CHAIN_SYNC_REQUEST, - // TODO: restore this type - // 'StateRoot': P2P_ROOT, - 'Ping': P2P_PING$1, - 'Pong': P2P_PONG$1, - 'DocumentRequest': DOCUMENT_REQUEST_TYPE, - 'DocumentPublish': DOCUMENT_PUBLISH_TYPE, - 'BlockCandidate': BLOCK_CANDIDATE, - 'PeerCandidate': PEER_CANDIDATE, - 'PeerInstruction': P2P_INSTRUCTION$1, - 'PeerMessage': P2P_BASE_MESSAGE$1, - 'StartSession': SESSION_START, - 'ChatMessage': CHAT_MESSAGE, - 'StartChain': P2P_START_CHAIN$1, - // TODO: restore above StateRoot type - 'StateRoot': P2P_STATE_ROOT$1, - 'StateCommitment': P2P_STATE_COMMITTMENT$1, - 'StateChange': P2P_STATE_CHANGE$1, - 'StateRequest': P2P_STATE_REQUEST, - 'Transaction': P2P_TRANSACTION, - 'Call': P2P_CALL, - 'LogMessage': LOG_MESSAGE_TYPE, - 'EthereumBlock': TYPE_ETHEREUM_BLOCK, - 'EthereumBlockNumber': TYPE_ETHEREUM_BLOCK_NUMBER - }; - } - - get codes () { - return Object.entries(this.types).reduce((ret, entry) => { - const [ key, value ] = entry; - ret[ value ] = key; - return ret; - }, {}); - } - - get magic () { - return this.raw.magic; - } - - get signature () { - return parseInt(Buffer.from(this.raw.signature, 'hex')); - } - - get size () { - return parseInt(Buffer.from(this.raw.size, 'hex')); - } - - get version () { - return parseInt(Buffer.from(this.raw.version)); - } - - get header () { - const parts = [ - Buffer.from(this.raw.magic, 'hex'), - Buffer.from(this.raw.version, 'hex'), - Buffer.from(this.raw.type, 'hex'), - Buffer.from(this.raw.size, 'hex'), - Buffer.from(this.raw.signature, 'hex'), - Buffer.from(this.raw.hash, 'hex') - ]; - - return Buffer.concat(parts); - } -} - -Object.defineProperty(Message$5.prototype, 'type', { - get () { - const code = parseInt(this.raw.type.toString('hex'), 16); - switch (code) { - case GENERIC_MESSAGE_TYPE: - return 'GenericMessage'; - case LOG_MESSAGE_TYPE: - return 'GenericLogMessage'; - case GENERIC_LIST_TYPE: - return 'GenericList'; - case DOCUMENT_PUBLISH_TYPE: - return 'DocumentPublish'; - case DOCUMENT_REQUEST_TYPE: - return 'DocumentRequest'; - case BLOCK_CANDIDATE: - return 'BlockCandidate'; - case OP_CYCLE: - return 'Cycle'; - case P2P_PING$1: - return 'Ping'; - case P2P_PONG$1: - return 'Pong'; - case P2P_GENERIC: - return 'Generic'; - case P2P_CHAIN_SYNC_REQUEST: - return 'ChainSyncRequest'; - case P2P_IDENT_REQUEST$1: - return 'IdentityRequest'; - case P2P_IDENT_RESPONSE$1: - return 'IdentityResponse'; - case P2P_BASE_MESSAGE$1: - return 'PeerMessage'; - case P2P_STATE_ROOT$1: - return 'StateRoot'; - case P2P_STATE_CHANGE$1: - return 'StateChange'; - case P2P_STATE_REQUEST: - return 'StateRequest'; - case P2P_TRANSACTION: - return 'Transaction'; - case P2P_CALL: - return 'Call'; - case PEER_CANDIDATE: - return 'PeerCandidate'; - case SESSION_START: - return 'StartSession'; - case CHAT_MESSAGE: - return 'ChatMessage'; - case P2P_START_CHAIN$1: - return 'StartChain'; - case TYPE_ETHEREUM_BLOCK: - return 'EthereumBlock'; - case TYPE_ETHEREUM_BLOCK_NUMBER: - return 'EthereumBlockNumber'; - default: - return 'GenericMessage'; - } - }, - set (value) { - let code = this.types[value]; - // Default to GenericMessage; - if (!code) { - this.emit('warning', `Unknown message type: ${value}`); - code = this.types['GenericMessage']; - } - - const padded = padDigits(code.toString(16), 8); - this['@type'] = value; - this.raw.type.write(padded, 'hex'); - } -}); - -Object.defineProperty(Message$5.prototype, 'data', { - get () { - if (!this.raw.data) return ''; - return this.raw.data.toString('utf8'); - }, - set (value) { - if (!value) value = ''; - const hash = crypto$e.createHash('sha256').update(value.toString('utf8')); - this.raw.hash = hash.digest(); - this.raw.data = Buffer.from(value); - this.raw.size.write(padDigits(this.raw.data.byteLength.toString(16), 8), 'hex'); - } -}); - -var message$1 = Message$5; - -// Dependencies -const crypto$d = require$$0$4; -const stream$1 = require$$2$2; -const path$e = require$$1$3; - -// Public modules -// TODO: remove -const merge$8 = lodash_merge.exports; -const pointer$2 = jsonPointer$1; -const manager = duplex; - -// Fabric Types -const Actor$b = actor; -const Collection$4 = collection$1; -const Resource$5 = resource$1; -const Entity$5 = entity; -const Hash256$6 = hash256$l; -const Key$8 = key$1; -const Message$4 = message$1; -const Store$2 = store_1; - -/** - * The "Service" is a simple model for processing messages in a distributed - * system. {@link Service} instances are public interfaces for outside systems, - * and typically advertise their presence to the network. - * - * To implement a Service, you will typically need to implement all methods from - * this prototype. In general, `connect` and `send` are the highest-priority - * jobs, and by default the `fabric` property will serve as an I/O stream using - * familiar semantics. - * @access protected - * @property map The "map" is a hashtable of "key" => "value" pairs. - */ -class Service$8 extends Actor$b { - /** - * Create an instance of a Service. - * @param {Object} settings Configuration for this service. - * @param {Boolean} [settings.networking=true] Whether or not to connect to the network. - * @param {Object} [settings.@data] Internal data to assign. - */ - constructor (settings = {}) { - // Initialize Scribe, our logging tool - super(settings); - - // Configure (with defaults) - this.settings = merge$8({ - name: 'service', - path: './stores/service', - networking: true, - persistent: false, - interval: 60000, // Mandatory Checkpoint Interval - verbosity: 2, // 0 none, 1 error, 2 warning, 3 notice, 4 debug - // TODO: export this as the default data in `inputs/fabric.json` - // If the sha256(JSON.stringify(this.data)) is equal to this, it's - // considered a valid Fabric object (for now!) - /* '@data': { - channels: {}, - messages: {}, - members: {} - } */ - }, this.settings, settings); - - // Reserve a place for ourselves - this.agent = null; - this.actor = null; - this.name = this.settings.name; - - this.collections = {}; - this.definitions = {}; - this.resources = {}; - this.services = {}; - this.methods = {}; - this.clients = {}; - this.targets = []; - this.history = []; - this.origin = ''; - - // TODO: fix this - // 2) RPG Lite - // Canvas - // can draw a canvas: - // Error: Not implemented yet - this.key = new Key$8(this.settings.key); - - if (this.settings.persistent) { - try { - this.store = new Store$2(this.settings); - } catch (E) { - console.error('Error:', E); - } - } - - // set local state to whatever configuration supplies... - /* this.state = Object.assign({ - messages: {} // always define a list of messages for Fabric services - }, this.config['@data']); */ - this._state = { - clock: 0, - epochs: {}, // snapshots of history (by ID) - history: [], // list of ... - services: {}, // stores sub-service state - status: 'PAUSED', - content: {}, - version: 0 // TODO: change to 1 for 0.1.0 - }; - - // Keeps track of changes - this.observer = null; - - /* if (this.settings.networking) { - this.swarm = new Swarm(this.settings); - } */ - - // Remove mutable variables - Object.defineProperty(this, '@version', { enumerable: false }); - Object.defineProperty(this, '@input', { enumerable: false }); - Object.defineProperty(this, '@data', { enumerable: false }); - Object.defineProperty(this, '@meta', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@entity', { enumerable: false }); - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - - // Remove sensitive objects - // Object.defineProperty(this, 'store', { enumerable: false }); - Object.defineProperty(this, 'observer', { enumerable: false }); - - // Provide the instance - return this; - } - - get clock () { - return parseInt(this._state.clock); - } - - get heartbeat () { - return this._heart; - } - - get status () { - return this._state.status; - } - - get members () { - return this['@data'].members; - } - - get targets () { - return this._targets; - } - - get state () { - return Object.assign({}, this._state.content); - } - - set clock (value) { - this._state.clock = parseInt(value); - } - - set state (value) { - // console.trace('[FABRIC:SERVICE]', 'Setting state:', value); - this._state = value; - } - - set status (value) { - if (!value) return this.status; - if (!this._state.status) this._state.status = 'PAUSED'; - this._state.status = value.toUpperCase(); - return this.status; - } - - set targets (value) { - this._targets = value; - } - - static fromName (name) { - let local = `services/${name}`; - let deep = `/../node_modules/@fabric/core/${local}.js`; - let fallback = path$e.dirname(require.main.filename) + deep; - let plugin = null; - - try { - plugin = commonjsRequire(local); - } catch (E) { - console.log('could not load main:', E); - try { - plugin = commonjsRequire(fallback); - } catch (E) { - console.log('Fallback service failed to load:', E); - } - } - - return plugin; - } - - alert (msg) { - // TODO: promise - // return Promise.all(Object.entries(this.services).filter().map()) - for (const [name, service] of Object.entries(this.services)) { - if (!this.settings.services.includes(name)) continue; - if (!service.alert) { - console.error('Service', name, 'does not have an alert function?'); - continue; - } - - service.alert(msg); - } - } - - identify () { - this.emit('auth', this.key.pubkey); - return this.key.pubkey; - } - - /** - * Called by Web Components. - * TODO: move to @fabric/http/types/spa - */ - init () { - this.components = {}; - } - - /** - * Move forward one clock cycle. - * @returns {Number} - */ - tick () { - return this.beat(); - } - - beat () { - const now = (new Date()).toISOString(); - - // Increment clock - ++this._clock; - - // TODO: remove async, use local state instead - // i.e., queue worker job - const beat = Message$4.fromVector(['Generic', { - clock: this._clock, - created: now, - state: this._state - }]); - - if (!beat) { - this.emit('error', 'Beat could not construct a Message!'); - console.trace(); - process.exit(); - } - - // TODO: parse JSON types in @fabric/core/types/message - let data = beat.data; - - try { - const parsed = JSON.parse(data); - data = JSON.stringify(parsed, null, ' '); - } catch (exception) { - this.emit('error', `Exception parsing beat: ${exception}`); - } - - this.emit('beat', beat); - this.commit(); - - return this; - } - - append (block) { - if (this.best !== block.parent) throw new Error(`Block does not attach to current chain. Block ID: ${block.id} Block Parent: ${block.parent} Current Best: ${this.best}`); - } - - /** - * Retrieve a key from the {@link State}. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - get (path = '') { - let result = null; - try { - result = pointer$2.get(this._state.content, path); - } catch (exception) { - console.error('[FABRIC:STATE]', 'Could not retrieve path:', path, pointer$2.get(this['@entity']['@data'], '/'), exception); - } - return result; - } - - /** - * Set a key in the {@link State} to a particular value. - * @param {Path} path Key to retrieve. - * @returns {Mixed} - */ - set (path, value) { - const result = pointer$2.set(this._state.content, path, value); - this.commit(); - return result; - } - - /** - * Explicitly trust all events from a known source. - * @param {EventEmitter} source Emitter of events. - * @return {Service} Instance of Service after binding events. - */ - trust (source, name = source.constructor.name) { - // Constants - const self = this; - - // Attach Event Listeners - if (source.settings && source.settings.debug) source.on('debug', this._handleTrustedDebug.bind(this)); - if (source.settings && source.settings.verbosity >= 0) { - source.on('audit', async function _handleTrustedAudit (audit) { - /* - const now = (new Date()).toISOString(); - const template = { - content: audit, - created: now, - type: 'Audit' - }; - - const actor = new Actor(template); - // TODO: transaction log - */ - }); - } - - return { - _handleActor: source.on('actor', async function (actor) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted actor:`, actor); - }), - _handleAlert: source.on('alert', async function (alert) { - self.alert(`[FABRIC:SERVICE] [ALERT] [!!!] ${name} alerted: ${alert}`); - }), - _handleBeat: source.on('beat', async function (beat) { - self.emit('debug', `[FABRIC:SERVICE] Source "${name}" emitted beat: ${JSON.stringify(beat, null, ' ')}`); - const ops = [ - { op: 'replace', path: `/services/${name}`, value: beat.state } - ]; - - try { - manager.applyPatch(self._state, ops); - await self.commit(); - } catch (exception) { - self.emit('error', `Could not process beat: ${exception}`); - } - }), - _handleChanges: source.on('changes', async function (changes) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted changes:`, changes); - }), - _handleChannel: source.on('channel', async function (channel) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted channel:`, channel); - }), - _handleCommit: source.on('commit', async function (commit) { - console.log(`[FABRIC:SERVICE] Source "${name}" committed:`, commit); - }), - _handleError: source.on('error', async function _handleTrustedError (error) { - console.error(`[FABRIC:SERVICE] Source "${name}" emitted error:`, error); - }), - _handleLog: source.on('log', async function _handleTrustedLog (log) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted log:`, log); - }), - _handleMessage: source.on('message', async function (message) { - self.emit('debug', `[FABRIC:SERVICE] Source "${name}" emitted message: ${JSON.stringify(message.toObject ? message.toObject() : message, null, ' ')}`); - await self._handleTrustedMessage(message); - }), - _handlePatches: source.on('patches', async function (patches) { - self.emit('debug', `[FABRIC:SERVICE] [${name}] Service State:`, source._state); - // TODO: apply changes to parent (self) - }), - _handleReady: source.on('ready', async function _handleTrustedReady (info) { - console.log(`[FABRIC:SERVICE] Source "${name}" emitted ready:`, info); - }), - _handleTip: source.on('tip', async function (hash) { - self.alert(`[FABRIC:SERVICE] New ${name} chaintip: ${hash}`); - }), - _handleWarning: source.on('warning', async function _handleTrustedWarning (warning) { - console.warn(`[FABRIC:SERVICE] Source "${name}" emitted warning:`, warning); - }) - }; - } - - define (name, value) { - this.definitions[name] = Object.assign({ - data: {}, - handler: function handler (msg) { - return null; - } - }, value); - - return this; - } - - ready () { - this.emit('ready'); - } - - replay (list = []) { - for (let i = 0; i < list.length; i++) { - this.route(list[i]); - } - - return this; - } - - toString () { - let entity = new Entity$5(this.state); - return entity.toString(); - } - - /** - * Default route handler for an incoming message. Follows the Activity - * Streams 2.0 spec: https://www.w3.org/TR/activitystreams-core/ - * @param {Activity} message Message object. - * @return {Service} Chainable method. - */ - handler (message) { - try { - this.emit('message', { - actor: message.actor, - target: message.target, - object: message.object - }); - } catch (E) { - this.error('Malformed message:', message); - } - - return this; - } - - /** - * Attempt to acquire a lock for `duration` seconds. - * @param {Number} [duration=1000] Number of milliseconds to hold lock. - * @returns {Boolean} true if locked, false if unable to lock. - */ - lock (duration = 1000) { - if (this._state.status === 'LOCKED') return false; - this._state.status = 'LOCKED'; - this.locker = new Actor$b({ - created: (new Date()).toISOString(), - contract: (setTimeout(() => { - delete this.locker; - this._state.status = 'UNLOCKED'; - }, duration)) - }); - - return true; - } - - _defineResource (name, definition) { - const resource = Object.assign({ name }, definition); - this.resources[name] = new Resource$5(resource); - this.emit('resource', this.resources[name]); - } - - _handleTrustedDebug (message) { - this.emit('debug', `[FABRIC:SERVICE] Trusted Source emitted debug: ${message}`); - } - - _handleTrustedMessage (message) { - this.emit('message', message); - } - - async process () { - console.log('process created'); - } - - async broadcast (msg) { - if (!msg['@type']) throw new Error('Message must have a @type property.'); - if (!msg['@data']) throw new Error('Message must have a @data property.'); - - for (let name in this.clients) { - let target = this.clients[name]; - console.log('[FABRIC:SERVICE]', 'Sending broadcast to client:', target); - } - - this.emit('message', msg); - } - - /** - * Resolve a {@link State} from a particular {@link Message} object. - * @param {Message} msg Explicit Fabric {@link Message}. - * @return {Promise} Resolves with resulting {@link State}. - */ - async route (msg) { - console.log('[FABRIC:SERVICE]', 'routing message:', msg); - console.log('[FABRIC:SERVICE]', 'definitions:', Object.keys(this.definitions)); - - let result = null; - - if (this.definitions[msg.type]) { - console.log('[FABRIC:SERVICE]', this.name, 'received a well-defined message type from message in requested route:', msg); - - let handler = this.definitions[msg.type].handler; - let state = handler.apply(this.state, [msg]); - - console.log('sample:', state); - console.log('sample.channels:', state.channels); - console.log('sample.messages:', state.messages); - - result = state; - - let commit = await this.commit(); - console.log('commit:', commit); - } - - return result; - } - - /** - * Start the service, including the initiation of an outbound connection - * to any peers designated in the service's configuration. - */ - async start () { - this.emit('debug', `[FABRIC:SERVICE] Starting as ${this.id}...`); - - const service = this; - - // Assign status and process - this.status = 'starting'; - - // Define an Actor with all current settings - this.actor = new Actor$b(this.settings); - - /* await this.define('message', { - name: 'message', - handler: this.process.bind(this.state), - exclusive: true // override all previous types - }); */ - - for (const name in this.settings.resources) { - const resource = this.settings.resources[name]; - const attribute = resource.routes.list.split('/')[1]; - const key = crypto$d.createHash('sha256').update(resource.routes.list).digest('hex'); - - // Assign collection - this.collections[key] = new Collection$4(resource); - - // Add to targets - this.targets.push(this.collections[key].routes.list); - - // Define mappings - Object.defineProperty(this, attribute, { - get: function () { - return this.collections[key]; - } - }); - - // Attach events - this.collections[key].on('commit', (commit) => { - service.broadcast({ - '@type': 'StateUpdate', - '@data': service.state - }); - }); - - this.collections[key].on('message', (message) => { - console.log('[FABRIC:SERVICE]', 'Internal message:', key, message); - }); - - this.collections[key].on('transaction', (transaction) => { - console.log('[FABRIC:SERVICE]', 'Internal transaction:', key, transaction); - }); - - this.collections[key].on('changes', (changes) => { - service._applyChanges(changes); - service.emit('change', { - type: 'Change', - data: changes - }); - }); - } - - if (this.settings.persistent) { - try { - await this.store.start(); - } catch (E) { - console.error('[FABRIC:SERVICE]', 'Could not start store:', E); - } - } - - await this._startAllServices(); - - if (this.settings.networking) { - await this.connect(); - } - - // TODO: re-re-evaluate a better approach... oh how I long for Object.observe! - // this.observer = manager.observe(this.state, this._handleStateChange.bind(this)); - this.observer = manager.observe(this._state); - - // Set a heartbeat - await this._startHeart(); - - this.status = 'ready'; - this.emit('log', '[FABRIC:SERVICE] Started!'); - this.ready(); - - return this; - } - - async stop () { - if (this.settings.networking) { - await this.disconnect(); - } - - if (this._heart) { - clearInterval(this._heart); - } - - if (this.settings.persistent) { - try { - await this.store.stop(); - } catch (E) { - console.error('[FABRIC:SERVICE]', 'Exception stopping store:', E); - } - } - - return this; - } - - /** - * Retrieve a value from the Service's state. - * @param {String} path Path of the value to retrieve. - * @return {Promise} Resolves with the result. - */ - async _GET (path) { - let result = null; - if (typeof path !== 'string') return null; - - let parts = path.split('/'); - let list = `/${parts[1]}`; - let name = crypto$d.createHash('sha256').update(list).digest('hex'); - - if (path === '/') return this.state; - if (this.collections[name]) { - if (parts[2]) { - let inner = this.collections[name].filter((x) => { - return (x.address === parts[2]); - })[0]; - return inner; - } - } - - try { - result = pointer$2.get(this.state, path); - } catch (E) { - console.trace(`Could not _GET() ${path}:`, E); - } - - return result; - } - - /** - * Store a value in the Service's state. - * @param {String} path Path to store the value at. - * @param {Object} value Document to store. - * @param {Boolean} [commit=false] Sign the resulting state. - * @return {Promise} Resolves with with stored document. - */ - async _PUT (path, value, commit = true) { - let result = null; - - if (path === '/') { - this.state = value; - } else { - try { - result = pointer$2.set(this.state, path, value); - } catch (E) { - this.error(`Could not _PUT() ${path}:`, E); - } - } - - if (commit) { - await this.commit(); - } - - return result; - } - - async _POST (path, data, commit = true) { - if (!path) throw new Error('Path must be provided.'); - if (!data) throw new Error('Data must be provided.'); - - const name = crypto$d.createHash('sha256').update(path).digest('hex'); - const hash = crypto$d.createHash('sha256').update(JSON.stringify(data)).digest('hex'); - - let result = null; - - // always use locally computed values - data.address = hash; - - let object = new Entity$5(data); - let collection = null; - let memory = null; - - try { - memory = await pointer$2.get(this.state, path); - } catch (E) { - this.emit('warning', `[FABRIC:SERVICE] posting to unloaded collection: ${path}`); - memory = []; - } - - try { - collection = new Collection$4(memory); - } catch (E) { - console.error('Could not create collection:', E, memory); - } - - // TODO: use Resource definition to de-deuplicate by fields.id - collection.push(object.toObject()); - this.collections[name] = await collection.populate(); - - // TODO: reduce storage to references - try { - await this._PUT(path, await collection.populate()); - await this.set(path, await collection.populate()); - result = `${path}/${data.address}`; - } catch (E) { - console.log('NOPE:', E); - } - - if (commit) await this.commit(); - - return result; - } - - /** - * Attach to network. - * @param {Boolean} notify Commit to changes. - * @return {Promise} Resolves to {@link Fabric}. - */ - async connect (notify = true) { - // TODO: implement a basic Stream - this.status = 'connecting'; - - // stub for a transform stream - this.fabric = new stream$1.Transform({ - transform (chunk, encoding, callback) { - callback(null, chunk); - } - }); - - if (this.store) { - try { - const prior = await this.store.get('/'); - this.state = JSON.parse(prior); - } catch (exception) { - this.emit('warning', `[FABRIC:SERVICE] Could not restore state: ${exception}`); - } - } - - if (this.settings.networking && this.swarm) { - await this.swarm.start(); - } - - this.connection = null; - this.status = 'connected'; - - if (notify) { - await this.ready(); - } - - return this.fabric; - } - - async disconnect () { - this.status = 'disconnecting'; - // if (this.status !== 'active') return this; - if (this.settings.networking && this.swarm) await this.swarm.stop(); - this.status = 'disconnected'; - return this; - } - - async subscribe (actorID, channelID) { - if (!actorID) throw new Error('Must provide actor ID.'); - if (!channelID) throw new Error('Must provide channel ID.'); - - const label = Hash256$6.digest(actorID + channelID); - const actor = await this._getActor(actorID); - const channel = await this._getChannel(channelID); - - if (!actor) throw new Error(`Actor does not exist: ${actorID}`); - if (!channel) throw new Error(`Channel does not exist: ${channelID}`); - - const link = await this._POST('/subscriptions', { label }); - - await this._applyChanges([ - { op: 'add', value: channelID, path: `/actors/${actor.id}/subscriptions/0` }, - { op: 'add', value: channelID, path: `/channels/${channel.id}/members/0` } - ]); - - await this.commit(); - - const result = await this._GET(link); - this.emit('subscription', result); - - return result; - } - - async join (id) { - this.log('join() is not yet implemented for this service.'); - } - - async whisper (target, message) { - this.log('The "whisper" function is not yet implemented.'); - return this; - } - - /** - * Send a message to a channel. - * @param {String} channel Channel name to which the message will be sent. - * @param {String} message Content of the message to send. - * @return {Service} Chainable method. - */ - async send (channel, message, extra) { - if (this.debug) console.log('[SERVICE]', 'send()', 'Sending:', channel, message, extra); - - const path = Buffer.alloc(256); - const payload = Buffer.alloc(2048); - const checksum = Buffer.alloc(64); - const entropy = Buffer.alloc(1726); // fill to 4096 - - path.write(channel); - payload.write(message); - - const msg = Buffer.concat([ path, payload ]); - const hash = crypto$d.createHash('sha256').update(msg).digest('hex'); - - checksum.write(hash); - - const block = Buffer.concat([ - Buffer.from([0x01]), // version byte - Buffer.from([0x00]), // placeholder - checksum, - msg, - entropy - ]); - - this.fabric.write(block); - - return this; - } - - commit () { - if (this.settings.verbosity >= 4) this.emit('log', '[FABRIC:SERVICE] Committing...'); - - const self = this; - const ops = []; - - // assemble all necessary info, emit Snapshot regardless of storage status - try { - ops.push({ type: 'put', key: 'snapshot', value: self.state }); - this.emit('debug', JSON.stringify({ - '@data': self.state, - '@from': 'COMMIT', - '@type': 'Snapshot' - })); - } catch (E) { - console.error('Error saving state:', self.state); - console.error('Could not commit to state:', E); - } - - if (this.settings.persistent) { - // TODO: add robust + convenient database opener - this.store.batch(ops, function shareChanges () { - // TODO: notify status? - }).catch((exception) => { - self.emit('error', `Could not write to store: ${exception}`); - }).then((output) => { - self.emit('commit', { output }); - }); - } - - const commit = new Actor$b({ - type: 'Commit', - state: self.state - }); - - this.emit('commit', { ...commit.toObject(), id: commit.id }); - - return commit.id; - } - - async _handleBitcoinCommit (commit) { - console.log('[FABRIC:SERVICE] Handling (Bitcoin?) commit:', commit); - } - - async _attachBindings (emitter) { - const service = this; - - emitter.on('attached', function () { - service.emit('attached', { - type: 'Notification', - message: 'Bindings complete!' - }); - }); - - emitter.emit('attached'); - - return service; - } - - async _bindStore (store) { - this.store = store; - return this; - } - - async _getActor (id) { - if (!id) return this.error('Parameter "id" is required.'); - let path = pointer$2.escape(id); - return this._GET(`/actors/${path}`); - } - - async _getChannel (id) { - if (!id) return this.error('Parameter "id" is required.'); - let target = pointer$2.escape(id); - return this._GET(`/channels/${target}`); - } - - /** - * Register an {@link Actor} with the {@link Service}. - * @param {Object} actor Instance of the {@link Actor}. - * @return {Promise} Resolves upon successful registration. - */ - async _registerActor (actor = {}) { - if (!actor.id) { - const entity = new Actor$b(actor); - actor = { ...entity.toObject(), id: entity.id }; - } - - const id = pointer$2.escape(actor.id); - const path = `/actors/${id}`; - - try { - await this._PUT(path, merge$8({ - name: actor.id, - subscriptions: [] - }, actor, { id })); - } catch (E) { - return this.error('Something went wrong saving:', E); - } - - await this.commit(); - - const registration = await this._GET(path); - this.emit('actor', registration); - - return registration; - } - - async _registerChannel (channel) { - if (!channel.id) { - const entity = new Actor$b(channel); - channel = merge$8({ - id: entity.id, - members: [] - }, channel); - } - - const target = pointer$2.escape(channel.id); - const path = `/channels/${target}`; - - try { - this._PUT(path, merge$8({ - members: [] - }, channel)); - } catch (E) { - this.log(`Failed to register channel "${channel.id}":`, E); - } - - await this.commit(); - - const registration = await this._GET(path); - this.emit('channel', registration); - - return registration; - } - - async _addMemberToChannel (memberID, channelID) { - return this.subscribe(memberID, channelID); - } - - async _registerMethod (name, method) { - this.methods[name] = method.bind(this); - } - - async _updatePresence (id, status) { - const target = pointer$2.escape(id); - const presence = (status === 'online') ? 'online' : 'offline'; - return this._PUT(`/actors/${target}/presence`, presence); - } - - async _getPresence (id) { - const member = await this._GET(`/actors/${id}`); - return member.presence || null; - } - - async _getMembers (id) { - const channel = await this._GET(`/channels/${id}`); - if (!channel) throw new Error(`No such channel: ${id}`); - return channel.members || null; - } - - async _getSubscriptions (id) { - const member = await this._GET(`/actors/${id}`); - return member.subscriptions || null; - } - - async _listActors () { - return Object.values(await this._GET('/actors')); - } - - async _listChannels () { - return Object.values(await this._GET('/channels')); - } - - async _applyChanges (changes) { - let result = null; - - try { - // TODO: allow configurable validators - result = manager.applyPatch(this.state, changes, function isValid () { - return true; - }, true /* mutate doc (1st param) */); - } catch (exception) { - console.error('Could not apply changes:', changes, exception); - } - - await this.commit(); - - return result; - } - - async _handleStateChange (changes) { - console.log('MAGIC HANDLER:', changes); - this.emit('message', { - '@type': 'Transaction', - '@data': { - // TODO: update this in constructor - parent: this.origin, - changes: changes - } - }); - } - - async _heartbeat () { - return this.tick(); - } - - /** - * Sends a message. - * @param {Mixed} message Message to send. - */ - async _send (message) { - const entity = new Entity$5(message); - await this._PUT(`/messages/${entity.id}`, message); - return entity.id; - } - - async _registerService (name, Service) { - const self = this; - const settings = merge$8({}, this.settings, this.settings[name]); - const service = new Service(settings); - - if (this.services[name]) { - return this._appendWarning(`Service already registered: ${name}`); - } - - this.services[name] = service; - this.services[name].on('error', function (msg) { - self.emit('error', `Service "${name}" emitted error: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('warning', function (msg) { - self.emit('warning', `Service warning from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('message', function (msg) { - self.emit('message', `Service message from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.on('identity', async function _registerActor (identity) { - if (self.settings.services && self.settings.services.includes(name)) { - self.emit('log', `Registering actor on service "${name}": ${JSON.stringify(identity)}`); - - try { - let registration = await self.services[name]._registerActor(identity); - self.emit('log', `Registered Actor: ${JSON.stringify(registration, null, ' ')}`); - } catch (exception) { - self.emit('error', `Error from service "${name}" during _registerActor: ${exception}`); - } - } - }); - - if (service.routes && service.routes.length) { - for (let i = 0; i < service.routes.length; i++) { - const route = service.routes[i]; - this.http._addRoute(route.method, route.path, route.handler); - } - } - - await this.commit(); - - return this; - } - - async _startAllServices () { - if (!this.services) return this.emit('warning', 'Tried to start subservices, but none existed.'); - // Start all Services - for (const [name, service] of Object.entries(this.services)) { - // TODO: re-evaluate inclusion on Service itself - if (this.settings.services && this.settings.services.includes(name)) { - this.emit('debug', `Starting service "${name}" (with trust)`); - // TODO: evaluate @fabric/core/types/store - // TODO: isomorphic @fabric/core/types/store - // await this.services[name]._bindStore(this.store); - this.trust(this.services[name], name); - - try { - await this.services[name].start(); - } catch (exception) { - this.emit('warning', `Could not start the "${name}" service due to exception: ${JSON.stringify(exception, null, ' ')}`); - } - } - } - - return this; - } - - async _startHeart () { - this._heart = setInterval(this.beat.bind(this), this.settings.interval); - } -} - -var service_1 = Service$8; - -/* - * Generated by PEG.js 0.10.0. - * - * http://pegjs.org/ - */ - -function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); -} - -function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; - - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } -} - -peg$subclass(peg$SyntaxError, Error); - -peg$SyntaxError.buildMessage = function(expected, found) { - var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - "class": function(expectation) { - var escapedParts = "", - i; - - for (i = 0; i < expectation.parts.length; i++) { - escapedParts += expectation.parts[i] instanceof Array - ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) - : classEscape(expectation.parts[i]); - } - - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, - - any: function(expectation) { - return "any character"; - }, - - end: function(expectation) { - return "end of input"; - }, - - other: function(expectation) { - return expectation.description; - } - }; - - function hex(ch) { - return ch.charCodeAt(0).toString(16).toUpperCase(); - } - - function literalEscape(s) { - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\0/g, '\\0') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); - } - - function classEscape(s) { - return s - .replace(/\\/g, '\\\\') - .replace(/\]/g, '\\]') - .replace(/\^/g, '\\^') - .replace(/-/g, '\\-') - .replace(/\0/g, '\\0') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); - } - - function describeExpectation(expectation) { - return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); - } - - function describeExpected(expected) { - var descriptions = new Array(expected.length), - i, j; - - for (i = 0; i < expected.length; i++) { - descriptions[i] = describeExpectation(expected[i]); - } - - descriptions.sort(); - - if (descriptions.length > 0) { - for (i = 1, j = 1; i < descriptions.length; i++) { - if (descriptions[i - 1] !== descriptions[i]) { - descriptions[j] = descriptions[i]; - j++; - } - } - descriptions.length = j; - } - - switch (descriptions.length) { - case 1: - return descriptions[0]; - - case 2: - return descriptions[0] + " or " + descriptions[1]; - - default: - return descriptions.slice(0, -1).join(", ") - + ", or " - + descriptions[descriptions.length - 1]; - } - } - - function describeFound(found) { - return found ? "\"" + literalEscape(found) + "\"" : "end of input"; - } - - return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; -}; - -function peg$parse(input, options) { - options = options !== void 0 ? options : {}; - - var peg$FAILED = {}, - - peg$startRuleFunctions = { start: peg$parsestart }, - peg$startRuleFunction = peg$parsestart, - - peg$c0 = "strict", - peg$c1 = peg$literalExpectation("strict", true), - peg$c2 = "graph", - peg$c3 = peg$literalExpectation("graph", true), - peg$c4 = "digraph", - peg$c5 = peg$literalExpectation("digraph", true), - peg$c6 = "{", - peg$c7 = peg$literalExpectation("{", false), - peg$c8 = "}", - peg$c9 = peg$literalExpectation("}", false), - peg$c10 = function(strict, type, id, children) { - if (children === null) children = []; - var ret = {type:type.toLowerCase(), children:children}; - if (strict) { ret.strict = true; } - if (id) { ret.id = id; } - return ret; - }, - peg$c11 = ";", - peg$c12 = peg$literalExpectation(";", false), - peg$c13 = function(s, other) { return other; }, - peg$c14 = function(s, e) { return [s].concat(e); }, - peg$c15 = "=", - peg$c16 = peg$literalExpectation("=", false), - peg$c17 = function(left, right) { - return { - type:'attr_stmt', - target:'graph', - attr_list:[{ - type:'attr', - id:left, - eq:right - }] - }; - }, - peg$c18 = "node", - peg$c19 = peg$literalExpectation("node", true), - peg$c20 = "edge", - peg$c21 = peg$literalExpectation("edge", true), - peg$c22 = function(target, attr) { - return { - type:'attr_stmt', - target:target, - attr_list:attr - }; - }, - peg$c23 = "[", - peg$c24 = peg$literalExpectation("[", false), - peg$c25 = "]", - peg$c26 = peg$literalExpectation("]", false), - peg$c27 = function(list, rest) { - return (list || []).concat(rest || []); - }, - peg$c28 = function(id, v) {return v}, - peg$c29 = ",", - peg$c30 = peg$literalExpectation(",", false), - peg$c31 = function(id, eq, rest) { - return [{ - type:'attr', - id:id, - eq: eq - }].concat(rest || []); - }, - peg$c32 = function(id, rhs, attr) { - var edge_list = [id]; - edge_list = edge_list.concat(rhs.map(function(v){return v.id})); - - return { - type:'edge_stmt', - edge_list:edge_list, - attr_list:attr || [] - }; - }, - peg$c33 = "->", - peg$c34 = peg$literalExpectation("->", false), - peg$c35 = "--", - peg$c36 = peg$literalExpectation("--", false), - peg$c37 = function(edgeop, id, rest) { - return [{ - type:'edgeRHS', - edgeop:edgeop, - id:id - }].concat(rest || []); - }, - peg$c38 = function(id, attr) { - return { - type:'node_stmt', - node_id:id, - attr_list:attr || [] - }; - }, - peg$c39 = function(id, port) { - return port ? { - type:'node_id', id:id, port:port - } : { - type:'node_id', id:id - }; - }, - peg$c40 = peg$otherExpectation("port"), - peg$c41 = ":", - peg$c42 = peg$literalExpectation(":", false), - peg$c43 = function(id, pt) {return pt}, - peg$c44 = function(id, pt) { - return { - type:'port', - id:id, - compass_pt:pt || null - }; - }, - peg$c45 = function(pt) { - return { - type:'port', - compass_pt:pt || null - } - }, - peg$c46 = "subgraph", - peg$c47 = peg$literalExpectation("subgraph", true), - peg$c48 = function(id) { - return id ? { - type:'subgraph', id:id - } : { - type:'subgraph' - } - }, - peg$c49 = function(g, s) { - g = g || { - type:'subgraph' - }; - g.children = s || []; - return g; - }, - peg$c50 = "n", - peg$c51 = peg$literalExpectation("n", false), - peg$c52 = "ne", - peg$c53 = peg$literalExpectation("ne", false), - peg$c54 = "e", - peg$c55 = peg$literalExpectation("e", false), - peg$c56 = "se", - peg$c57 = peg$literalExpectation("se", false), - peg$c58 = "s", - peg$c59 = peg$literalExpectation("s", false), - peg$c60 = "sw", - peg$c61 = peg$literalExpectation("sw", false), - peg$c62 = "w", - peg$c63 = peg$literalExpectation("w", false), - peg$c64 = "nw", - peg$c65 = peg$literalExpectation("nw", false), - peg$c66 = peg$otherExpectation("UNICODE_STRING"), - peg$c67 = function(first, rest) { - return first + rest.join(''); - }, - peg$c68 = "$", - peg$c69 = peg$literalExpectation("$", false), - peg$c70 = "_", - peg$c71 = peg$literalExpectation("_", false), - peg$c72 = peg$otherExpectation("NUMBER"), - peg$c73 = "-", - peg$c74 = peg$literalExpectation("-", false), - peg$c75 = ".", - peg$c76 = peg$literalExpectation(".", false), - peg$c77 = /^[0-9]/, - peg$c78 = peg$classExpectation([["0", "9"]], false, false), - peg$c79 = function(n) { - return parseFloat(text()); - }, - peg$c80 = function(v) { - return { - type:'id', - value:v.slice(1,v.length-1), - html:true - }; - }, - peg$c81 = "<", - peg$c82 = peg$literalExpectation("<", false), - peg$c83 = ">", - peg$c84 = peg$literalExpectation(">", false), - peg$c85 = function(v) { - return '<' + v.join('') + '>'; - }, - peg$c86 = peg$anyExpectation(), - peg$c87 = function(v) { return v; }, - peg$c88 = function(v) { return v.join(""); }, - peg$c89 = "\"", - peg$c90 = peg$literalExpectation("\"", false), - peg$c91 = function(chars) { return chars.join(""); }, - peg$c92 = function() { return text(); }, - peg$c93 = "\\", - peg$c94 = peg$literalExpectation("\\", false), - peg$c95 = function(v) { return v[1] === '"' ? '"' : v[0] + v[1]; }, - peg$c96 = function() { return ""; }, - peg$c97 = /^[\n\r\u2028\u2029]/, - peg$c98 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false), - peg$c99 = peg$otherExpectation("end of line"), - peg$c100 = "\n", - peg$c101 = peg$literalExpectation("\n", false), - peg$c102 = "\r\n", - peg$c103 = peg$literalExpectation("\r\n", false), - peg$c104 = "\r", - peg$c105 = peg$literalExpectation("\r", false), - peg$c106 = "\u2028", - peg$c107 = peg$literalExpectation("\u2028", false), - peg$c108 = "\u2029", - peg$c109 = peg$literalExpectation("\u2029", false), - peg$c116 = peg$otherExpectation("COMMENT"), - peg$c117 = peg$otherExpectation("BLOCK_COMMENT"), - peg$c118 = "/*", - peg$c119 = peg$literalExpectation("/*", false), - peg$c120 = "*/", - peg$c121 = peg$literalExpectation("*/", false), - peg$c122 = function(v) {return v;}, - peg$c123 = function(v) { return v.join('') }, - peg$c124 = peg$otherExpectation("C_COMMENT"), - peg$c125 = "//", - peg$c126 = peg$literalExpectation("//", false), - peg$c127 = /^[\n]/, - peg$c128 = peg$classExpectation(["\n"], false, false), - peg$c129 = function(v) { return v.join(''); }, - peg$c130 = peg$otherExpectation("MACRO_COMMENT"), - peg$c131 = "#", - peg$c132 = peg$literalExpectation("#", false), - peg$c133 = peg$otherExpectation("WHITESPACE"), - peg$c134 = /^[\n\r]/, - peg$c135 = peg$classExpectation(["\n", "\r"], false, false), - peg$c136 = /^[ \t]/, - peg$c137 = peg$classExpectation([" ", "\t"], false, false), - peg$c138 = /^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/, - peg$c139 = peg$classExpectation([["a", "z"], "\xB5", ["\xDF", "\xF6"], ["\xF8", "\xFF"], "\u0101", "\u0103", "\u0105", "\u0107", "\u0109", "\u010B", "\u010D", "\u010F", "\u0111", "\u0113", "\u0115", "\u0117", "\u0119", "\u011B", "\u011D", "\u011F", "\u0121", "\u0123", "\u0125", "\u0127", "\u0129", "\u012B", "\u012D", "\u012F", "\u0131", "\u0133", "\u0135", ["\u0137", "\u0138"], "\u013A", "\u013C", "\u013E", "\u0140", "\u0142", "\u0144", "\u0146", ["\u0148", "\u0149"], "\u014B", "\u014D", "\u014F", "\u0151", "\u0153", "\u0155", "\u0157", "\u0159", "\u015B", "\u015D", "\u015F", "\u0161", "\u0163", "\u0165", "\u0167", "\u0169", "\u016B", "\u016D", "\u016F", "\u0171", "\u0173", "\u0175", "\u0177", "\u017A", "\u017C", ["\u017E", "\u0180"], "\u0183", "\u0185", "\u0188", ["\u018C", "\u018D"], "\u0192", "\u0195", ["\u0199", "\u019B"], "\u019E", "\u01A1", "\u01A3", "\u01A5", "\u01A8", ["\u01AA", "\u01AB"], "\u01AD", "\u01B0", "\u01B4", "\u01B6", ["\u01B9", "\u01BA"], ["\u01BD", "\u01BF"], "\u01C6", "\u01C9", "\u01CC", "\u01CE", "\u01D0", "\u01D2", "\u01D4", "\u01D6", "\u01D8", "\u01DA", ["\u01DC", "\u01DD"], "\u01DF", "\u01E1", "\u01E3", "\u01E5", "\u01E7", "\u01E9", "\u01EB", "\u01ED", ["\u01EF", "\u01F0"], "\u01F3", "\u01F5", "\u01F9", "\u01FB", "\u01FD", "\u01FF", "\u0201", "\u0203", "\u0205", "\u0207", "\u0209", "\u020B", "\u020D", "\u020F", "\u0211", "\u0213", "\u0215", "\u0217", "\u0219", "\u021B", "\u021D", "\u021F", "\u0221", "\u0223", "\u0225", "\u0227", "\u0229", "\u022B", "\u022D", "\u022F", "\u0231", ["\u0233", "\u0239"], "\u023C", ["\u023F", "\u0240"], "\u0242", "\u0247", "\u0249", "\u024B", "\u024D", ["\u024F", "\u0293"], ["\u0295", "\u02AF"], "\u0371", "\u0373", "\u0377", ["\u037B", "\u037D"], "\u0390", ["\u03AC", "\u03CE"], ["\u03D0", "\u03D1"], ["\u03D5", "\u03D7"], "\u03D9", "\u03DB", "\u03DD", "\u03DF", "\u03E1", "\u03E3", "\u03E5", "\u03E7", "\u03E9", "\u03EB", "\u03ED", ["\u03EF", "\u03F3"], "\u03F5", "\u03F8", ["\u03FB", "\u03FC"], ["\u0430", "\u045F"], "\u0461", "\u0463", "\u0465", "\u0467", "\u0469", "\u046B", "\u046D", "\u046F", "\u0471", "\u0473", "\u0475", "\u0477", "\u0479", "\u047B", "\u047D", "\u047F", "\u0481", "\u048B", "\u048D", "\u048F", "\u0491", "\u0493", "\u0495", "\u0497", "\u0499", "\u049B", "\u049D", "\u049F", "\u04A1", "\u04A3", "\u04A5", "\u04A7", "\u04A9", "\u04AB", "\u04AD", "\u04AF", "\u04B1", "\u04B3", "\u04B5", "\u04B7", "\u04B9", "\u04BB", "\u04BD", "\u04BF", "\u04C2", "\u04C4", "\u04C6", "\u04C8", "\u04CA", "\u04CC", ["\u04CE", "\u04CF"], "\u04D1", "\u04D3", "\u04D5", "\u04D7", "\u04D9", "\u04DB", "\u04DD", "\u04DF", "\u04E1", "\u04E3", "\u04E5", "\u04E7", "\u04E9", "\u04EB", "\u04ED", "\u04EF", "\u04F1", "\u04F3", "\u04F5", "\u04F7", "\u04F9", "\u04FB", "\u04FD", "\u04FF", "\u0501", "\u0503", "\u0505", "\u0507", "\u0509", "\u050B", "\u050D", "\u050F", "\u0511", "\u0513", "\u0515", "\u0517", "\u0519", "\u051B", "\u051D", "\u051F", "\u0521", "\u0523", "\u0525", "\u0527", ["\u0561", "\u0587"], ["\u1D00", "\u1D2B"], ["\u1D6B", "\u1D77"], ["\u1D79", "\u1D9A"], "\u1E01", "\u1E03", "\u1E05", "\u1E07", "\u1E09", "\u1E0B", "\u1E0D", "\u1E0F", "\u1E11", "\u1E13", "\u1E15", "\u1E17", "\u1E19", "\u1E1B", "\u1E1D", "\u1E1F", "\u1E21", "\u1E23", "\u1E25", "\u1E27", "\u1E29", "\u1E2B", "\u1E2D", "\u1E2F", "\u1E31", "\u1E33", "\u1E35", "\u1E37", "\u1E39", "\u1E3B", "\u1E3D", "\u1E3F", "\u1E41", "\u1E43", "\u1E45", "\u1E47", "\u1E49", "\u1E4B", "\u1E4D", "\u1E4F", "\u1E51", "\u1E53", "\u1E55", "\u1E57", "\u1E59", "\u1E5B", "\u1E5D", "\u1E5F", "\u1E61", "\u1E63", "\u1E65", "\u1E67", "\u1E69", "\u1E6B", "\u1E6D", "\u1E6F", "\u1E71", "\u1E73", "\u1E75", "\u1E77", "\u1E79", "\u1E7B", "\u1E7D", "\u1E7F", "\u1E81", "\u1E83", "\u1E85", "\u1E87", "\u1E89", "\u1E8B", "\u1E8D", "\u1E8F", "\u1E91", "\u1E93", ["\u1E95", "\u1E9D"], "\u1E9F", "\u1EA1", "\u1EA3", "\u1EA5", "\u1EA7", "\u1EA9", "\u1EAB", "\u1EAD", "\u1EAF", "\u1EB1", "\u1EB3", "\u1EB5", "\u1EB7", "\u1EB9", "\u1EBB", "\u1EBD", "\u1EBF", "\u1EC1", "\u1EC3", "\u1EC5", "\u1EC7", "\u1EC9", "\u1ECB", "\u1ECD", "\u1ECF", "\u1ED1", "\u1ED3", "\u1ED5", "\u1ED7", "\u1ED9", "\u1EDB", "\u1EDD", "\u1EDF", "\u1EE1", "\u1EE3", "\u1EE5", "\u1EE7", "\u1EE9", "\u1EEB", "\u1EED", "\u1EEF", "\u1EF1", "\u1EF3", "\u1EF5", "\u1EF7", "\u1EF9", "\u1EFB", "\u1EFD", ["\u1EFF", "\u1F07"], ["\u1F10", "\u1F15"], ["\u1F20", "\u1F27"], ["\u1F30", "\u1F37"], ["\u1F40", "\u1F45"], ["\u1F50", "\u1F57"], ["\u1F60", "\u1F67"], ["\u1F70", "\u1F7D"], ["\u1F80", "\u1F87"], ["\u1F90", "\u1F97"], ["\u1FA0", "\u1FA7"], ["\u1FB0", "\u1FB4"], ["\u1FB6", "\u1FB7"], "\u1FBE", ["\u1FC2", "\u1FC4"], ["\u1FC6", "\u1FC7"], ["\u1FD0", "\u1FD3"], ["\u1FD6", "\u1FD7"], ["\u1FE0", "\u1FE7"], ["\u1FF2", "\u1FF4"], ["\u1FF6", "\u1FF7"], "\u210A", ["\u210E", "\u210F"], "\u2113", "\u212F", "\u2134", "\u2139", ["\u213C", "\u213D"], ["\u2146", "\u2149"], "\u214E", "\u2184", ["\u2C30", "\u2C5E"], "\u2C61", ["\u2C65", "\u2C66"], "\u2C68", "\u2C6A", "\u2C6C", "\u2C71", ["\u2C73", "\u2C74"], ["\u2C76", "\u2C7B"], "\u2C81", "\u2C83", "\u2C85", "\u2C87", "\u2C89", "\u2C8B", "\u2C8D", "\u2C8F", "\u2C91", "\u2C93", "\u2C95", "\u2C97", "\u2C99", "\u2C9B", "\u2C9D", "\u2C9F", "\u2CA1", "\u2CA3", "\u2CA5", "\u2CA7", "\u2CA9", "\u2CAB", "\u2CAD", "\u2CAF", "\u2CB1", "\u2CB3", "\u2CB5", "\u2CB7", "\u2CB9", "\u2CBB", "\u2CBD", "\u2CBF", "\u2CC1", "\u2CC3", "\u2CC5", "\u2CC7", "\u2CC9", "\u2CCB", "\u2CCD", "\u2CCF", "\u2CD1", "\u2CD3", "\u2CD5", "\u2CD7", "\u2CD9", "\u2CDB", "\u2CDD", "\u2CDF", "\u2CE1", ["\u2CE3", "\u2CE4"], "\u2CEC", "\u2CEE", "\u2CF3", ["\u2D00", "\u2D25"], "\u2D27", "\u2D2D", "\uA641", "\uA643", "\uA645", "\uA647", "\uA649", "\uA64B", "\uA64D", "\uA64F", "\uA651", "\uA653", "\uA655", "\uA657", "\uA659", "\uA65B", "\uA65D", "\uA65F", "\uA661", "\uA663", "\uA665", "\uA667", "\uA669", "\uA66B", "\uA66D", "\uA681", "\uA683", "\uA685", "\uA687", "\uA689", "\uA68B", "\uA68D", "\uA68F", "\uA691", "\uA693", "\uA695", "\uA697", "\uA723", "\uA725", "\uA727", "\uA729", "\uA72B", "\uA72D", ["\uA72F", "\uA731"], "\uA733", "\uA735", "\uA737", "\uA739", "\uA73B", "\uA73D", "\uA73F", "\uA741", "\uA743", "\uA745", "\uA747", "\uA749", "\uA74B", "\uA74D", "\uA74F", "\uA751", "\uA753", "\uA755", "\uA757", "\uA759", "\uA75B", "\uA75D", "\uA75F", "\uA761", "\uA763", "\uA765", "\uA767", "\uA769", "\uA76B", "\uA76D", "\uA76F", ["\uA771", "\uA778"], "\uA77A", "\uA77C", "\uA77F", "\uA781", "\uA783", "\uA785", "\uA787", "\uA78C", "\uA78E", "\uA791", "\uA793", "\uA7A1", "\uA7A3", "\uA7A5", "\uA7A7", "\uA7A9", "\uA7FA", ["\uFB00", "\uFB06"], ["\uFB13", "\uFB17"], ["\uFF41", "\uFF5A"]], false, false), - peg$c140 = /^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uAA70\uAADD\uAAF3-\uAAF4\uFF70\uFF9E-\uFF9F]/, - peg$c141 = peg$classExpectation([["\u02B0", "\u02C1"], ["\u02C6", "\u02D1"], ["\u02E0", "\u02E4"], "\u02EC", "\u02EE", "\u0374", "\u037A", "\u0559", "\u0640", ["\u06E5", "\u06E6"], ["\u07F4", "\u07F5"], "\u07FA", "\u081A", "\u0824", "\u0828", "\u0971", "\u0E46", "\u0EC6", "\u10FC", "\u17D7", "\u1843", "\u1AA7", ["\u1C78", "\u1C7D"], ["\u1D2C", "\u1D6A"], "\u1D78", ["\u1D9B", "\u1DBF"], "\u2071", "\u207F", ["\u2090", "\u209C"], ["\u2C7C", "\u2C7D"], "\u2D6F", "\u2E2F", "\u3005", ["\u3031", "\u3035"], "\u303B", ["\u309D", "\u309E"], ["\u30FC", "\u30FE"], "\uA015", ["\uA4F8", "\uA4FD"], "\uA60C", "\uA67F", ["\uA717", "\uA71F"], "\uA770", "\uA788", ["\uA7F8", "\uA7F9"], "\uA9CF", "\uAA70", "\uAADD", ["\uAAF3", "\uAAF4"], "\uFF70", ["\uFF9E", "\uFF9F"]], false, false), - peg$c142 = /^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58-\u0C59\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, - peg$c143 = peg$classExpectation(["\xAA", "\xBA", "\u01BB", ["\u01C0", "\u01C3"], "\u0294", ["\u05D0", "\u05EA"], ["\u05F0", "\u05F2"], ["\u0620", "\u063F"], ["\u0641", "\u064A"], ["\u066E", "\u066F"], ["\u0671", "\u06D3"], "\u06D5", ["\u06EE", "\u06EF"], ["\u06FA", "\u06FC"], "\u06FF", "\u0710", ["\u0712", "\u072F"], ["\u074D", "\u07A5"], "\u07B1", ["\u07CA", "\u07EA"], ["\u0800", "\u0815"], ["\u0840", "\u0858"], "\u08A0", ["\u08A2", "\u08AC"], ["\u0904", "\u0939"], "\u093D", "\u0950", ["\u0958", "\u0961"], ["\u0972", "\u0977"], ["\u0979", "\u097F"], ["\u0985", "\u098C"], ["\u098F", "\u0990"], ["\u0993", "\u09A8"], ["\u09AA", "\u09B0"], "\u09B2", ["\u09B6", "\u09B9"], "\u09BD", "\u09CE", ["\u09DC", "\u09DD"], ["\u09DF", "\u09E1"], ["\u09F0", "\u09F1"], ["\u0A05", "\u0A0A"], ["\u0A0F", "\u0A10"], ["\u0A13", "\u0A28"], ["\u0A2A", "\u0A30"], ["\u0A32", "\u0A33"], ["\u0A35", "\u0A36"], ["\u0A38", "\u0A39"], ["\u0A59", "\u0A5C"], "\u0A5E", ["\u0A72", "\u0A74"], ["\u0A85", "\u0A8D"], ["\u0A8F", "\u0A91"], ["\u0A93", "\u0AA8"], ["\u0AAA", "\u0AB0"], ["\u0AB2", "\u0AB3"], ["\u0AB5", "\u0AB9"], "\u0ABD", "\u0AD0", ["\u0AE0", "\u0AE1"], ["\u0B05", "\u0B0C"], ["\u0B0F", "\u0B10"], ["\u0B13", "\u0B28"], ["\u0B2A", "\u0B30"], ["\u0B32", "\u0B33"], ["\u0B35", "\u0B39"], "\u0B3D", ["\u0B5C", "\u0B5D"], ["\u0B5F", "\u0B61"], "\u0B71", "\u0B83", ["\u0B85", "\u0B8A"], ["\u0B8E", "\u0B90"], ["\u0B92", "\u0B95"], ["\u0B99", "\u0B9A"], "\u0B9C", ["\u0B9E", "\u0B9F"], ["\u0BA3", "\u0BA4"], ["\u0BA8", "\u0BAA"], ["\u0BAE", "\u0BB9"], "\u0BD0", ["\u0C05", "\u0C0C"], ["\u0C0E", "\u0C10"], ["\u0C12", "\u0C28"], ["\u0C2A", "\u0C33"], ["\u0C35", "\u0C39"], "\u0C3D", ["\u0C58", "\u0C59"], ["\u0C60", "\u0C61"], ["\u0C85", "\u0C8C"], ["\u0C8E", "\u0C90"], ["\u0C92", "\u0CA8"], ["\u0CAA", "\u0CB3"], ["\u0CB5", "\u0CB9"], "\u0CBD", "\u0CDE", ["\u0CE0", "\u0CE1"], ["\u0CF1", "\u0CF2"], ["\u0D05", "\u0D0C"], ["\u0D0E", "\u0D10"], ["\u0D12", "\u0D3A"], "\u0D3D", "\u0D4E", ["\u0D60", "\u0D61"], ["\u0D7A", "\u0D7F"], ["\u0D85", "\u0D96"], ["\u0D9A", "\u0DB1"], ["\u0DB3", "\u0DBB"], "\u0DBD", ["\u0DC0", "\u0DC6"], ["\u0E01", "\u0E30"], ["\u0E32", "\u0E33"], ["\u0E40", "\u0E45"], ["\u0E81", "\u0E82"], "\u0E84", ["\u0E87", "\u0E88"], "\u0E8A", "\u0E8D", ["\u0E94", "\u0E97"], ["\u0E99", "\u0E9F"], ["\u0EA1", "\u0EA3"], "\u0EA5", "\u0EA7", ["\u0EAA", "\u0EAB"], ["\u0EAD", "\u0EB0"], ["\u0EB2", "\u0EB3"], "\u0EBD", ["\u0EC0", "\u0EC4"], ["\u0EDC", "\u0EDF"], "\u0F00", ["\u0F40", "\u0F47"], ["\u0F49", "\u0F6C"], ["\u0F88", "\u0F8C"], ["\u1000", "\u102A"], "\u103F", ["\u1050", "\u1055"], ["\u105A", "\u105D"], "\u1061", ["\u1065", "\u1066"], ["\u106E", "\u1070"], ["\u1075", "\u1081"], "\u108E", ["\u10D0", "\u10FA"], ["\u10FD", "\u1248"], ["\u124A", "\u124D"], ["\u1250", "\u1256"], "\u1258", ["\u125A", "\u125D"], ["\u1260", "\u1288"], ["\u128A", "\u128D"], ["\u1290", "\u12B0"], ["\u12B2", "\u12B5"], ["\u12B8", "\u12BE"], "\u12C0", ["\u12C2", "\u12C5"], ["\u12C8", "\u12D6"], ["\u12D8", "\u1310"], ["\u1312", "\u1315"], ["\u1318", "\u135A"], ["\u1380", "\u138F"], ["\u13A0", "\u13F4"], ["\u1401", "\u166C"], ["\u166F", "\u167F"], ["\u1681", "\u169A"], ["\u16A0", "\u16EA"], ["\u1700", "\u170C"], ["\u170E", "\u1711"], ["\u1720", "\u1731"], ["\u1740", "\u1751"], ["\u1760", "\u176C"], ["\u176E", "\u1770"], ["\u1780", "\u17B3"], "\u17DC", ["\u1820", "\u1842"], ["\u1844", "\u1877"], ["\u1880", "\u18A8"], "\u18AA", ["\u18B0", "\u18F5"], ["\u1900", "\u191C"], ["\u1950", "\u196D"], ["\u1970", "\u1974"], ["\u1980", "\u19AB"], ["\u19C1", "\u19C7"], ["\u1A00", "\u1A16"], ["\u1A20", "\u1A54"], ["\u1B05", "\u1B33"], ["\u1B45", "\u1B4B"], ["\u1B83", "\u1BA0"], ["\u1BAE", "\u1BAF"], ["\u1BBA", "\u1BE5"], ["\u1C00", "\u1C23"], ["\u1C4D", "\u1C4F"], ["\u1C5A", "\u1C77"], ["\u1CE9", "\u1CEC"], ["\u1CEE", "\u1CF1"], ["\u1CF5", "\u1CF6"], ["\u2135", "\u2138"], ["\u2D30", "\u2D67"], ["\u2D80", "\u2D96"], ["\u2DA0", "\u2DA6"], ["\u2DA8", "\u2DAE"], ["\u2DB0", "\u2DB6"], ["\u2DB8", "\u2DBE"], ["\u2DC0", "\u2DC6"], ["\u2DC8", "\u2DCE"], ["\u2DD0", "\u2DD6"], ["\u2DD8", "\u2DDE"], "\u3006", "\u303C", ["\u3041", "\u3096"], "\u309F", ["\u30A1", "\u30FA"], "\u30FF", ["\u3105", "\u312D"], ["\u3131", "\u318E"], ["\u31A0", "\u31BA"], ["\u31F0", "\u31FF"], ["\u3400", "\u4DB5"], ["\u4E00", "\u9FCC"], ["\uA000", "\uA014"], ["\uA016", "\uA48C"], ["\uA4D0", "\uA4F7"], ["\uA500", "\uA60B"], ["\uA610", "\uA61F"], ["\uA62A", "\uA62B"], "\uA66E", ["\uA6A0", "\uA6E5"], ["\uA7FB", "\uA801"], ["\uA803", "\uA805"], ["\uA807", "\uA80A"], ["\uA80C", "\uA822"], ["\uA840", "\uA873"], ["\uA882", "\uA8B3"], ["\uA8F2", "\uA8F7"], "\uA8FB", ["\uA90A", "\uA925"], ["\uA930", "\uA946"], ["\uA960", "\uA97C"], ["\uA984", "\uA9B2"], ["\uAA00", "\uAA28"], ["\uAA40", "\uAA42"], ["\uAA44", "\uAA4B"], ["\uAA60", "\uAA6F"], ["\uAA71", "\uAA76"], "\uAA7A", ["\uAA80", "\uAAAF"], "\uAAB1", ["\uAAB5", "\uAAB6"], ["\uAAB9", "\uAABD"], "\uAAC0", "\uAAC2", ["\uAADB", "\uAADC"], ["\uAAE0", "\uAAEA"], "\uAAF2", ["\uAB01", "\uAB06"], ["\uAB09", "\uAB0E"], ["\uAB11", "\uAB16"], ["\uAB20", "\uAB26"], ["\uAB28", "\uAB2E"], ["\uABC0", "\uABE2"], ["\uAC00", "\uD7A3"], ["\uD7B0", "\uD7C6"], ["\uD7CB", "\uD7FB"], ["\uF900", "\uFA6D"], ["\uFA70", "\uFAD9"], "\uFB1D", ["\uFB1F", "\uFB28"], ["\uFB2A", "\uFB36"], ["\uFB38", "\uFB3C"], "\uFB3E", ["\uFB40", "\uFB41"], ["\uFB43", "\uFB44"], ["\uFB46", "\uFBB1"], ["\uFBD3", "\uFD3D"], ["\uFD50", "\uFD8F"], ["\uFD92", "\uFDC7"], ["\uFDF0", "\uFDFB"], ["\uFE70", "\uFE74"], ["\uFE76", "\uFEFC"], ["\uFF66", "\uFF6F"], ["\uFF71", "\uFF9D"], ["\uFFA0", "\uFFBE"], ["\uFFC2", "\uFFC7"], ["\uFFCA", "\uFFCF"], ["\uFFD2", "\uFFD7"], ["\uFFDA", "\uFFDC"]], false, false), - peg$c144 = /^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/, - peg$c145 = peg$classExpectation(["\u01C5", "\u01C8", "\u01CB", "\u01F2", ["\u1F88", "\u1F8F"], ["\u1F98", "\u1F9F"], ["\u1FA8", "\u1FAF"], "\u1FBC", "\u1FCC", "\u1FFC"], false, false), - peg$c146 = /^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A]/, - peg$c147 = peg$classExpectation([["A", "Z"], ["\xC0", "\xD6"], ["\xD8", "\xDE"], "\u0100", "\u0102", "\u0104", "\u0106", "\u0108", "\u010A", "\u010C", "\u010E", "\u0110", "\u0112", "\u0114", "\u0116", "\u0118", "\u011A", "\u011C", "\u011E", "\u0120", "\u0122", "\u0124", "\u0126", "\u0128", "\u012A", "\u012C", "\u012E", "\u0130", "\u0132", "\u0134", "\u0136", "\u0139", "\u013B", "\u013D", "\u013F", "\u0141", "\u0143", "\u0145", "\u0147", "\u014A", "\u014C", "\u014E", "\u0150", "\u0152", "\u0154", "\u0156", "\u0158", "\u015A", "\u015C", "\u015E", "\u0160", "\u0162", "\u0164", "\u0166", "\u0168", "\u016A", "\u016C", "\u016E", "\u0170", "\u0172", "\u0174", "\u0176", ["\u0178", "\u0179"], "\u017B", "\u017D", ["\u0181", "\u0182"], "\u0184", ["\u0186", "\u0187"], ["\u0189", "\u018B"], ["\u018E", "\u0191"], ["\u0193", "\u0194"], ["\u0196", "\u0198"], ["\u019C", "\u019D"], ["\u019F", "\u01A0"], "\u01A2", "\u01A4", ["\u01A6", "\u01A7"], "\u01A9", "\u01AC", ["\u01AE", "\u01AF"], ["\u01B1", "\u01B3"], "\u01B5", ["\u01B7", "\u01B8"], "\u01BC", "\u01C4", "\u01C7", "\u01CA", "\u01CD", "\u01CF", "\u01D1", "\u01D3", "\u01D5", "\u01D7", "\u01D9", "\u01DB", "\u01DE", "\u01E0", "\u01E2", "\u01E4", "\u01E6", "\u01E8", "\u01EA", "\u01EC", "\u01EE", "\u01F1", "\u01F4", ["\u01F6", "\u01F8"], "\u01FA", "\u01FC", "\u01FE", "\u0200", "\u0202", "\u0204", "\u0206", "\u0208", "\u020A", "\u020C", "\u020E", "\u0210", "\u0212", "\u0214", "\u0216", "\u0218", "\u021A", "\u021C", "\u021E", "\u0220", "\u0222", "\u0224", "\u0226", "\u0228", "\u022A", "\u022C", "\u022E", "\u0230", "\u0232", ["\u023A", "\u023B"], ["\u023D", "\u023E"], "\u0241", ["\u0243", "\u0246"], "\u0248", "\u024A", "\u024C", "\u024E", "\u0370", "\u0372", "\u0376", "\u0386", ["\u0388", "\u038A"], "\u038C", ["\u038E", "\u038F"], ["\u0391", "\u03A1"], ["\u03A3", "\u03AB"], "\u03CF", ["\u03D2", "\u03D4"], "\u03D8", "\u03DA", "\u03DC", "\u03DE", "\u03E0", "\u03E2", "\u03E4", "\u03E6", "\u03E8", "\u03EA", "\u03EC", "\u03EE", "\u03F4", "\u03F7", ["\u03F9", "\u03FA"], ["\u03FD", "\u042F"], "\u0460", "\u0462", "\u0464", "\u0466", "\u0468", "\u046A", "\u046C", "\u046E", "\u0470", "\u0472", "\u0474", "\u0476", "\u0478", "\u047A", "\u047C", "\u047E", "\u0480", "\u048A", "\u048C", "\u048E", "\u0490", "\u0492", "\u0494", "\u0496", "\u0498", "\u049A", "\u049C", "\u049E", "\u04A0", "\u04A2", "\u04A4", "\u04A6", "\u04A8", "\u04AA", "\u04AC", "\u04AE", "\u04B0", "\u04B2", "\u04B4", "\u04B6", "\u04B8", "\u04BA", "\u04BC", "\u04BE", ["\u04C0", "\u04C1"], "\u04C3", "\u04C5", "\u04C7", "\u04C9", "\u04CB", "\u04CD", "\u04D0", "\u04D2", "\u04D4", "\u04D6", "\u04D8", "\u04DA", "\u04DC", "\u04DE", "\u04E0", "\u04E2", "\u04E4", "\u04E6", "\u04E8", "\u04EA", "\u04EC", "\u04EE", "\u04F0", "\u04F2", "\u04F4", "\u04F6", "\u04F8", "\u04FA", "\u04FC", "\u04FE", "\u0500", "\u0502", "\u0504", "\u0506", "\u0508", "\u050A", "\u050C", "\u050E", "\u0510", "\u0512", "\u0514", "\u0516", "\u0518", "\u051A", "\u051C", "\u051E", "\u0520", "\u0522", "\u0524", "\u0526", ["\u0531", "\u0556"], ["\u10A0", "\u10C5"], "\u10C7", "\u10CD", "\u1E00", "\u1E02", "\u1E04", "\u1E06", "\u1E08", "\u1E0A", "\u1E0C", "\u1E0E", "\u1E10", "\u1E12", "\u1E14", "\u1E16", "\u1E18", "\u1E1A", "\u1E1C", "\u1E1E", "\u1E20", "\u1E22", "\u1E24", "\u1E26", "\u1E28", "\u1E2A", "\u1E2C", "\u1E2E", "\u1E30", "\u1E32", "\u1E34", "\u1E36", "\u1E38", "\u1E3A", "\u1E3C", "\u1E3E", "\u1E40", "\u1E42", "\u1E44", "\u1E46", "\u1E48", "\u1E4A", "\u1E4C", "\u1E4E", "\u1E50", "\u1E52", "\u1E54", "\u1E56", "\u1E58", "\u1E5A", "\u1E5C", "\u1E5E", "\u1E60", "\u1E62", "\u1E64", "\u1E66", "\u1E68", "\u1E6A", "\u1E6C", "\u1E6E", "\u1E70", "\u1E72", "\u1E74", "\u1E76", "\u1E78", "\u1E7A", "\u1E7C", "\u1E7E", "\u1E80", "\u1E82", "\u1E84", "\u1E86", "\u1E88", "\u1E8A", "\u1E8C", "\u1E8E", "\u1E90", "\u1E92", "\u1E94", "\u1E9E", "\u1EA0", "\u1EA2", "\u1EA4", "\u1EA6", "\u1EA8", "\u1EAA", "\u1EAC", "\u1EAE", "\u1EB0", "\u1EB2", "\u1EB4", "\u1EB6", "\u1EB8", "\u1EBA", "\u1EBC", "\u1EBE", "\u1EC0", "\u1EC2", "\u1EC4", "\u1EC6", "\u1EC8", "\u1ECA", "\u1ECC", "\u1ECE", "\u1ED0", "\u1ED2", "\u1ED4", "\u1ED6", "\u1ED8", "\u1EDA", "\u1EDC", "\u1EDE", "\u1EE0", "\u1EE2", "\u1EE4", "\u1EE6", "\u1EE8", "\u1EEA", "\u1EEC", "\u1EEE", "\u1EF0", "\u1EF2", "\u1EF4", "\u1EF6", "\u1EF8", "\u1EFA", "\u1EFC", "\u1EFE", ["\u1F08", "\u1F0F"], ["\u1F18", "\u1F1D"], ["\u1F28", "\u1F2F"], ["\u1F38", "\u1F3F"], ["\u1F48", "\u1F4D"], "\u1F59", "\u1F5B", "\u1F5D", "\u1F5F", ["\u1F68", "\u1F6F"], ["\u1FB8", "\u1FBB"], ["\u1FC8", "\u1FCB"], ["\u1FD8", "\u1FDB"], ["\u1FE8", "\u1FEC"], ["\u1FF8", "\u1FFB"], "\u2102", "\u2107", ["\u210B", "\u210D"], ["\u2110", "\u2112"], "\u2115", ["\u2119", "\u211D"], "\u2124", "\u2126", "\u2128", ["\u212A", "\u212D"], ["\u2130", "\u2133"], ["\u213E", "\u213F"], "\u2145", "\u2183", ["\u2C00", "\u2C2E"], "\u2C60", ["\u2C62", "\u2C64"], "\u2C67", "\u2C69", "\u2C6B", ["\u2C6D", "\u2C70"], "\u2C72", "\u2C75", ["\u2C7E", "\u2C80"], "\u2C82", "\u2C84", "\u2C86", "\u2C88", "\u2C8A", "\u2C8C", "\u2C8E", "\u2C90", "\u2C92", "\u2C94", "\u2C96", "\u2C98", "\u2C9A", "\u2C9C", "\u2C9E", "\u2CA0", "\u2CA2", "\u2CA4", "\u2CA6", "\u2CA8", "\u2CAA", "\u2CAC", "\u2CAE", "\u2CB0", "\u2CB2", "\u2CB4", "\u2CB6", "\u2CB8", "\u2CBA", "\u2CBC", "\u2CBE", "\u2CC0", "\u2CC2", "\u2CC4", "\u2CC6", "\u2CC8", "\u2CCA", "\u2CCC", "\u2CCE", "\u2CD0", "\u2CD2", "\u2CD4", "\u2CD6", "\u2CD8", "\u2CDA", "\u2CDC", "\u2CDE", "\u2CE0", "\u2CE2", "\u2CEB", "\u2CED", "\u2CF2", "\uA640", "\uA642", "\uA644", "\uA646", "\uA648", "\uA64A", "\uA64C", "\uA64E", "\uA650", "\uA652", "\uA654", "\uA656", "\uA658", "\uA65A", "\uA65C", "\uA65E", "\uA660", "\uA662", "\uA664", "\uA666", "\uA668", "\uA66A", "\uA66C", "\uA680", "\uA682", "\uA684", "\uA686", "\uA688", "\uA68A", "\uA68C", "\uA68E", "\uA690", "\uA692", "\uA694", "\uA696", "\uA722", "\uA724", "\uA726", "\uA728", "\uA72A", "\uA72C", "\uA72E", "\uA732", "\uA734", "\uA736", "\uA738", "\uA73A", "\uA73C", "\uA73E", "\uA740", "\uA742", "\uA744", "\uA746", "\uA748", "\uA74A", "\uA74C", "\uA74E", "\uA750", "\uA752", "\uA754", "\uA756", "\uA758", "\uA75A", "\uA75C", "\uA75E", "\uA760", "\uA762", "\uA764", "\uA766", "\uA768", "\uA76A", "\uA76C", "\uA76E", "\uA779", "\uA77B", ["\uA77D", "\uA77E"], "\uA780", "\uA782", "\uA784", "\uA786", "\uA78B", "\uA78D", "\uA790", "\uA792", "\uA7A0", "\uA7A2", "\uA7A4", "\uA7A6", "\uA7A8", "\uA7AA", ["\uFF21", "\uFF3A"]], false, false), - peg$c148 = /^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/, - peg$c149 = peg$classExpectation([["\u16EE", "\u16F0"], ["\u2160", "\u2182"], ["\u2185", "\u2188"], "\u3007", ["\u3021", "\u3029"], ["\u3038", "\u303A"], ["\uA6E6", "\uA6EF"]], false, false), - peg$c150 = /^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/, - peg$c151 = peg$classExpectation([["0", "9"], ["\u0660", "\u0669"], ["\u06F0", "\u06F9"], ["\u07C0", "\u07C9"], ["\u0966", "\u096F"], ["\u09E6", "\u09EF"], ["\u0A66", "\u0A6F"], ["\u0AE6", "\u0AEF"], ["\u0B66", "\u0B6F"], ["\u0BE6", "\u0BEF"], ["\u0C66", "\u0C6F"], ["\u0CE6", "\u0CEF"], ["\u0D66", "\u0D6F"], ["\u0E50", "\u0E59"], ["\u0ED0", "\u0ED9"], ["\u0F20", "\u0F29"], ["\u1040", "\u1049"], ["\u1090", "\u1099"], ["\u17E0", "\u17E9"], ["\u1810", "\u1819"], ["\u1946", "\u194F"], ["\u19D0", "\u19D9"], ["\u1A80", "\u1A89"], ["\u1A90", "\u1A99"], ["\u1B50", "\u1B59"], ["\u1BB0", "\u1BB9"], ["\u1C40", "\u1C49"], ["\u1C50", "\u1C59"], ["\uA620", "\uA629"], ["\uA8D0", "\uA8D9"], ["\uA900", "\uA909"], ["\uA9D0", "\uA9D9"], ["\uAA50", "\uAA59"], ["\uABF0", "\uABF9"], ["\uFF10", "\uFF19"]], false, false), - - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1 }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, - - peg$result; - - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } - - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } - - function text() { - return input.substring(peg$savedPos, peg$currPos); - } - - function peg$literalExpectation(text, ignoreCase) { - return { type: "literal", text: text, ignoreCase: ignoreCase }; - } - - function peg$classExpectation(parts, inverted, ignoreCase) { - return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; - } - - function peg$anyExpectation() { - return { type: "any" }; - } - - function peg$endExpectation() { - return { type: "end" }; - } - - function peg$otherExpectation(description) { - return { type: "other", description: description }; - } - - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], p; - - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; - } - - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column - }; - - while (p < pos) { - if (input.charCodeAt(p) === 10) { - details.line++; - details.column = 1; - } else { - details.column++; - } - - p++; - } - - peg$posDetailsCache[pos] = details; - return details; - } - } - - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); - - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } - - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } - - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } - - peg$maxFailExpected.push(expected); - } - - function peg$buildStructuredError(expected, found, location) { - return new peg$SyntaxError( - peg$SyntaxError.buildMessage(expected, found), - expected, - found, - location - ); - } - - function peg$parsestart() { - var s0, s1; - - s0 = []; - s1 = peg$parsegraph(); - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsegraph(); - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsegraph() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 6).toLowerCase() === peg$c0) { - s2 = input.substr(peg$currPos, 6); - peg$currPos += 6; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c1); } - } - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c2) { - s4 = input.substr(peg$currPos, 5); - peg$currPos += 5; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } - } - if (s4 === peg$FAILED) { - if (input.substr(peg$currPos, 7).toLowerCase() === peg$c4) { - s4 = input.substr(peg$currPos, 7); - peg$currPos += 7; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c5); } - } - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parseID(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 123) { - s8 = peg$c6; - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s8 !== peg$FAILED) { - s9 = peg$parsestmt_list(); - if (s9 === peg$FAILED) { - s9 = null; - } - if (s9 !== peg$FAILED) { - s10 = peg$parse_(); - if (s10 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s11 = peg$c8; - peg$currPos++; - } else { - s11 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } - } - if (s11 !== peg$FAILED) { - s12 = peg$parse_(); - if (s12 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s2, s4, s6, s9); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsestmt_list() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parsestmt(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s4 = peg$c11; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$currPos; - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parsestmt(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_(); - if (s9 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s10 = peg$c11; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c13(s2, s8); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$currPos; - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parsestmt(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_(); - if (s9 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s10 = peg$c11; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - peg$savedPos = s6; - s7 = peg$c13(s2, s8); - s6 = s7; - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } else { - peg$currPos = s6; - s6 = peg$FAILED; - } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c14(s2, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsestmt() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c15; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - s5 = peg$parseID(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c17(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseattr_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$parseedge_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$parsesubgraph(); - if (s0 === peg$FAILED) { - s0 = peg$parsenode_stmt(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s2 = peg$c15; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parseID(); - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - } - } - } - } - - return s0; - } - - function peg$parseattr_stmt() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.substr(peg$currPos, 5).toLowerCase() === peg$c2) { - s1 = input.substr(peg$currPos, 5); - peg$currPos += 5; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c3); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c18) { - s1 = input.substr(peg$currPos, 4); - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 4).toLowerCase() === peg$c20) { - s1 = input.substr(peg$currPos, 4); - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseattr_list(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c22(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseattr_list() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 91) { - s2 = peg$c23; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c24); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsea_list(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 93) { - s6 = peg$c25; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - if (s7 !== peg$FAILED) { - s8 = peg$parseattr_list(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c27(s4, s8); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsea_list() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - s2 = peg$parseID(); - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s5 = peg$c15; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c16); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (s6 !== peg$FAILED) { - s7 = peg$parseID(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c28(s2, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c29; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } - } - if (s5 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 59) { - s5 = peg$c11; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } - } - } - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsea_list(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c31(s2, s3, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseedge_stmt() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$parsesubgraph(); - if (s1 === peg$FAILED) { - s1 = peg$parsenode_id(); - } - if (s1 !== peg$FAILED) { - s2 = peg$parseedgeRHS(); - if (s2 !== peg$FAILED) { - s3 = peg$parseattr_list(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c32(s1, s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseedgeRHS() { - var s0, s1, s2, s3, s4, s5, s6; - - s0 = peg$currPos; - s1 = peg$parse_(); - if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c33) { - s2 = peg$c33; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } - } - if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c35) { - s2 = peg$c35; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } - } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parsesubgraph(); - if (s4 === peg$FAILED) { - s4 = peg$parsenode_id(); - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - s6 = peg$parseedgeRHS(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c37(s2, s4, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsenode_stmt() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parsenode_id(); - if (s1 !== peg$FAILED) { - s2 = peg$parseattr_list(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c38(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsenode_id() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parseID(); - if (s1 !== peg$FAILED) { - s2 = peg$parseport(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c39(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseport() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c41; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseID(); - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s4 = peg$c41; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parsecompass_pt(); - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c43(s2, s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c44(s2, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 58) { - s1 = peg$c41; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsecompass_pt(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c45(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } - } - - return s0; - } - - function peg$parsesubgraph() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$currPos; - if (input.substr(peg$currPos, 8).toLowerCase() === peg$c46) { - s2 = input.substr(peg$currPos, 8); - peg$currPos += 8; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_(); - if (s3 !== peg$FAILED) { - s4 = peg$parseID(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_(); - if (s5 !== peg$FAILED) { - peg$savedPos = s1; - s2 = peg$c48(s4); - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 === peg$FAILED) { - s1 = null; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 123) { - s2 = peg$c6; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c7); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsestmt_list(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_(); - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 125) { - s5 = peg$c8; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c49(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsecompass_pt() { - var s0; - - if (input.charCodeAt(peg$currPos) === 110) { - s0 = peg$c50; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c52) { - s0 = peg$c52; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 101) { - s0 = peg$c54; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c56) { - s0 = peg$c56; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 115) { - s0 = peg$c58; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c60) { - s0 = peg$c60; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 119) { - s0 = peg$c62; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c63); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c64) { - s0 = peg$c64; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } - } - } - } - } - } - } - } - } - - return s0; - } - - function peg$parseID() { - var s0; - - s0 = peg$parseSTRING(); - if (s0 === peg$FAILED) { - s0 = peg$parseNUMBER(); - if (s0 === peg$FAILED) { - s0 = peg$parseQUOTED_STRING(); - if (s0 === peg$FAILED) { - s0 = peg$parseHTML_STRING(); - } - } - } - - return s0; - } - - function peg$parseSTRING() { - var s0, s1, s2, s3; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parseStringStart(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseStringPart(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseStringPart(); - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c67(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c66); } - } - - return s0; - } - - function peg$parseStringStart() { - var s0; - - s0 = peg$parseUnicodeLetter(); - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 36) { - s0 = peg$c68; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 95) { - s0 = peg$c70; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } - } - } - } - - return s0; - } - - function peg$parseStringPart() { - var s0; - - s0 = peg$parseStringStart(); - if (s0 === peg$FAILED) { - s0 = peg$parseNd(); - } - - return s0; - } - - function peg$parseNUMBER() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 45) { - s2 = peg$c73; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c74); } - } - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s4 = peg$c75; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } - } - if (s4 !== peg$FAILED) { - s5 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s6 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - if (peg$c77.test(input.charAt(peg$currPos))) { - s6 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - } else { - s5 = peg$FAILED; - } - if (s5 !== peg$FAILED) { - s4 = [s4, s5]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; - s4 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - if (s5 !== peg$FAILED) { - while (s5 !== peg$FAILED) { - s4.push(s5); - if (peg$c77.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - } else { - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - s5 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s6 = peg$c75; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } - } - if (s6 !== peg$FAILED) { - s7 = []; - if (peg$c77.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - while (s8 !== peg$FAILED) { - s7.push(s8); - if (peg$c77.test(input.charAt(peg$currPos))) { - s8 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } - } - } - if (s7 !== peg$FAILED) { - s6 = [s6, s7]; - s5 = s6; - } else { - peg$currPos = s5; - s5 = peg$FAILED; - } - } else { - peg$currPos = s5; - s5 = peg$FAILED; - } - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s4 = [s4, s5]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c79(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c72); } - } - - return s0; - } - - function peg$parseHTML_STRING() { - var s0, s1; - - s0 = peg$currPos; - s1 = peg$parsehtml_raw_string(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c80(s1); - } - s0 = s1; - - return s0; - } - - function peg$parsehtml_raw_string() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c81; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parsehtml_char(); - if (s3 === peg$FAILED) { - s3 = peg$parsehtml_raw_string(); - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsehtml_char(); - if (s3 === peg$FAILED) { - s3 = peg$parsehtml_raw_string(); - } - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 62) { - s3 = peg$c83; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c85(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsehtml_char() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - s1 = []; - s2 = peg$currPos; - s3 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 62) { - s4 = peg$c83; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s4 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s4 = peg$c81; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - } - peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = void 0; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - if (input.length > peg$currPos) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c87(s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$currPos; - s3 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 62) { - s4 = peg$c83; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c84); } - } - if (s4 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s4 = peg$c81; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c82); } - } - } - peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = void 0; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - if (input.length > peg$currPos) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s2; - s3 = peg$c87(s4); - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c88(s1); - } - s0 = s1; - - return s0; - } - - function peg$parseQUOTED_STRING() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c89; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parseDoubleStringCharacter(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parseDoubleStringCharacter(); - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c89; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c91(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseDoubleStringCharacter() { - var s0, s1, s2; - - s0 = peg$parseQuoteEscape(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c89; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } - } - if (s2 === peg$FAILED) { - s2 = peg$parseLineTerminator(); - } - peg$silentFails--; - if (s2 === peg$FAILED) { - s1 = void 0; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseSourceCharacter(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c92(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseLineContinuation(); - } - } - - return s0; - } - - function peg$parseQuoteEscape() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c93; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } - } - if (s2 !== peg$FAILED) { - if (input.length > peg$currPos) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s3 !== peg$FAILED) { - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c95(s1); - } - s0 = s1; - - return s0; - } - - function peg$parseLineContinuation() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c93; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseLineTerminatorSequence(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c96(); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseLineTerminator() { - var s0; - - if (peg$c97.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c98); } - } - - return s0; - } - - function peg$parseLineTerminatorSequence() { - var s0; - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c100; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c102) { - s0 = peg$c102; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c104; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c105); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 8232) { - s0 = peg$c106; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c107); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 8233) { - s0 = peg$c108; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c109); } - } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - if (peg$silentFails === 0) { peg$fail(peg$c99); } - } - - return s0; - } - - function peg$parseSourceCharacter() { - var s0; - - if (input.length > peg$currPos) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - - return s0; - } - - function peg$parseCOMMENT() { - var s0; - - peg$silentFails++; - s0 = peg$parseBLOCK_COMMENT(); - if (s0 === peg$FAILED) { - s0 = peg$parseC_COMMENT(); - if (s0 === peg$FAILED) { - s0 = peg$parseMACRO_COMMENT(); - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - if (peg$silentFails === 0) { peg$fail(peg$c116); } - } - - return s0; - } - - function peg$parseBLOCK_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c118) { - s1 = peg$c118; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c120) { - s5 = peg$c120; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c122(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c120) { - s5 = peg$c120; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c122(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c120) { - s3 = peg$c120; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c123(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } - } - - return s0; - } - - function peg$parseC_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c125) { - s1 = peg$c125; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c126); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (peg$c127.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c129(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c124); } - } - - return s0; - } - - function peg$parseMACRO_COMMENT() { - var s0, s1, s2, s3, s4, s5; - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 35) { - s1 = peg$c131; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c132); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$currPos; - peg$silentFails++; - if (peg$c127.test(input.charAt(peg$currPos))) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - peg$silentFails--; - if (s5 === peg$FAILED) { - s4 = void 0; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.length > peg$currPos) { - s5 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c87(s5); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (peg$c127.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c128); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c129(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c130); } - } - - return s0; - } - - function peg$parse_() { - var s0, s1; - - peg$silentFails++; - s0 = []; - s1 = peg$parseWHITESPACE(); - if (s1 === peg$FAILED) { - s1 = peg$parseCOMMENT(); - } - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parseWHITESPACE(); - if (s1 === peg$FAILED) { - s1 = peg$parseCOMMENT(); - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c133); } - } - - return s0; - } - - function peg$parseNEWLINE() { - var s0, s1; - - s0 = []; - if (peg$c134.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c135); } - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c134.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c135); } - } - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseWHITESPACE() { - var s0, s1; - - s0 = []; - if (peg$c136.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c137); } - } - if (s1 === peg$FAILED) { - s1 = peg$parseNEWLINE(); - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c136.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c137); } - } - if (s1 === peg$FAILED) { - s1 = peg$parseNEWLINE(); - } - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseUnicodeLetter() { - var s0; - - s0 = peg$parseLu(); - if (s0 === peg$FAILED) { - s0 = peg$parseLl(); - if (s0 === peg$FAILED) { - s0 = peg$parseLt(); - if (s0 === peg$FAILED) { - s0 = peg$parseLm(); - if (s0 === peg$FAILED) { - s0 = peg$parseLo(); - if (s0 === peg$FAILED) { - s0 = peg$parseNl(); - } - } - } - } - } - - return s0; - } - - function peg$parseLl() { - var s0; - - if (peg$c138.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c139); } - } - - return s0; - } - - function peg$parseLm() { - var s0; - - if (peg$c140.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c141); } - } - - return s0; - } - - function peg$parseLo() { - var s0; - - if (peg$c142.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c143); } - } - - return s0; - } - - function peg$parseLt() { - var s0; - - if (peg$c144.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c145); } - } - - return s0; - } - - function peg$parseLu() { - var s0; - - if (peg$c146.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c147); } - } - - return s0; - } - - function peg$parseNl() { - var s0; - - if (peg$c148.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c149); } - } - - return s0; - } - - function peg$parseNd() { - var s0; - - if (peg$c150.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c151); } - } - - return s0; - } - - peg$result = peg$startRuleFunction(); - - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail(peg$endExpectation()); - } - - throw peg$buildStructuredError( - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); - } -} - -var dot = { - SyntaxError: peg$SyntaxError, - parse: peg$parse -}; - -var parser$5 = dot; -var dotparser = parser$5.parse; - -var visualize$1 = {exports: {}}; - -(function (module, exports) { -(function webpackUniversalModuleDefinition(root, factory) { - module.exports = factory(); -})(commonjsGlobal, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - -module.exports = function(target, sources) { - var n, source, key; - for(n = 1 ; n < arguments.length ; n++) { - source = arguments[n]; - for(key in source) { - if (source.hasOwnProperty(key)) - target[key] = source[key]; - } - } - return target; -}; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - -//------------------------------------------------------------------------------------------------- - -var mixin = __webpack_require__(0); - -//------------------------------------------------------------------------------------------------- - -function visualize(fsm, options) { - return dotify(dotcfg(fsm, options)); -} - -//------------------------------------------------------------------------------------------------- - -function dotcfg(fsm, options) { - - options = options || {}; - - var config = dotcfg.fetch(fsm), - name = options.name, - rankdir = dotcfg.rankdir(options.orientation), - states = dotcfg.states(config, options), - transitions = dotcfg.transitions(config, options), - result = { }; - - if (name) - result.name = name; - - if (rankdir) - result.rankdir = rankdir; - - if (states && states.length > 0) - result.states = states; - - if (transitions && transitions.length > 0) - result.transitions = transitions; - - return result -} - -//------------------------------------------------------------------------------------------------- - -dotcfg.fetch = function(fsm) { - return (typeof fsm === 'function') ? fsm.prototype._fsm.config - : fsm._fsm.config -}; - -dotcfg.rankdir = function(orientation) { - if (orientation === 'horizontal') - return 'LR'; - else if (orientation === 'vertical') - return 'TB'; -}; - -dotcfg.states = function(config, options) { - var index, states = config.states; - if (!options.init) { // if not showing init transition, then slice out the implied init :from state - index = states.indexOf(config.init.from); - states = states.slice(0, index).concat(states.slice(index+1)); - } - return states; -}; - -dotcfg.transitions = function(config, options) { - var n, max, transition, - init = config.init, - transitions = config.options.transitions || [], // easier to visualize using the ORIGINAL transition declarations rather than our run-time mapping - output = []; - if (options.init && init.active) - dotcfg.transition(init.name, init.from, init.to, init.dot, config, options, output); - for (n = 0, max = transitions.length ; n < max ; n++) { - transition = config.options.transitions[n]; - dotcfg.transition(transition.name, transition.from, transition.to, transition.dot, config, options, output); - } - return output -}; - -dotcfg.transition = function(name, from, to, dot, config, options, output) { - var n, max, wildcard = config.defaults.wildcard; - - if (Array.isArray(from)) { - for(n = 0, max = from.length ; n < max ; n++) - dotcfg.transition(name, from[n], to, dot, config, options, output); - } - else if (from === wildcard || from === undefined) { - for(n = 0, max = config.states.length ; n < max ; n++) - dotcfg.transition(name, config.states[n], to, dot, config, options, output); - } - else if (to === wildcard || to === undefined) { - dotcfg.transition(name, from, from, dot, config, options, output); - } - else if (typeof to === 'function') ; - else { - output.push(mixin({}, { from: from, to: to, label: pad(name) }, dot || {})); - } - -}; - -//------------------------------------------------------------------------------------------------- - -function pad(name) { - return " " + name + " " -} - -function quote(name) { - return "\"" + name + "\"" -} - -function dotify(dotcfg) { - - dotcfg = dotcfg || {}; - - var name = dotcfg.name || 'fsm', - states = dotcfg.states || [], - transitions = dotcfg.transitions || [], - rankdir = dotcfg.rankdir, - output = [], - n, max; - - output.push("digraph " + quote(name) + " {"); - if (rankdir) - output.push(" rankdir=" + rankdir + ";"); - for(n = 0, max = states.length ; n < max ; n++) - output.push(dotify.state(states[n])); - for(n = 0, max = transitions.length ; n < max ; n++) - output.push(dotify.edge(transitions[n])); - output.push("}"); - return output.join("\n") - -} - -dotify.state = function(state) { - return " " + quote(state) + ";" -}; - -dotify.edge = function(edge) { - return " " + quote(edge.from) + " -> " + quote(edge.to) + dotify.edge.attr(edge) + ";" -}; - -dotify.edge.attr = function(edge) { - var n, max, key, keys = Object.keys(edge).sort(), output = []; - for(n = 0, max = keys.length ; n < max ; n++) { - key = keys[n]; - if (key !== 'from' && key !== 'to') - output.push(key + "=" + quote(edge[key])); - } - return output.length > 0 ? " [ " + output.join(" ; ") + " ]" : "" -}; - -//------------------------------------------------------------------------------------------------- - -visualize.dotcfg = dotcfg; -visualize.dotify = dotify; - -//------------------------------------------------------------------------------------------------- - -module.exports = visualize; - -//------------------------------------------------------------------------------------------------- - - -/***/ }) -/******/ ]); -}); -}(visualize$1)); - -var stateMachine = {exports: {}}; - -(function (module, exports) { -(function webpackUniversalModuleDefinition(root, factory) { - module.exports = factory(); -})(commonjsGlobal, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 5); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - - -module.exports = function(target, sources) { - var n, source, key; - for(n = 1 ; n < arguments.length ; n++) { - source = arguments[n]; - for(key in source) { - if (source.hasOwnProperty(key)) - target[key] = source[key]; - } - } - return target; -}; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - - -//------------------------------------------------------------------------------------------------- - -var mixin = __webpack_require__(0); - -//------------------------------------------------------------------------------------------------- - -module.exports = { - - build: function(target, config) { - var n, max, plugin, plugins = config.plugins; - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - if (plugin.methods) - mixin(target, plugin.methods); - if (plugin.properties) - Object.defineProperties(target, plugin.properties); - } - }, - - hook: function(fsm, name, additional) { - var n, max, method, plugin, - plugins = fsm.config.plugins, - args = [fsm.context]; - - if (additional) - args = args.concat(additional); - - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - method = plugins[n][name]; - if (method) - method.apply(plugin, args); - } - } - -}; - -//------------------------------------------------------------------------------------------------- - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - - -//------------------------------------------------------------------------------------------------- - -function camelize(label) { - - if (label.length === 0) - return label; - - var n, result, words = label.split(/[_-]/); - - // single word with first character already lowercase, return untouched - if ((words.length === 1) && (words[0][0].toLowerCase() === words[0][0])) - return label; - - result = words[0].toLowerCase(); - for(n = 1 ; n < words.length ; n++) { - result = result + words[n].charAt(0).toUpperCase() + words[n].substring(1).toLowerCase(); - } - - return result; -} - -//------------------------------------------------------------------------------------------------- - -camelize.prepended = function(prepend, label) { - label = camelize(label); - return prepend + label[0].toUpperCase() + label.substring(1); -}; - -//------------------------------------------------------------------------------------------------- - -module.exports = camelize; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - - -//------------------------------------------------------------------------------------------------- - -var mixin = __webpack_require__(0), - camelize = __webpack_require__(2); - -//------------------------------------------------------------------------------------------------- - -function Config(options, StateMachine) { - - options = options || {}; - - this.options = options; // preserving original options can be useful (e.g visualize plugin) - this.defaults = StateMachine.defaults; - this.states = []; - this.transitions = []; - this.map = {}; - this.lifecycle = this.configureLifecycle(); - this.init = this.configureInitTransition(options.init); - this.data = this.configureData(options.data); - this.methods = this.configureMethods(options.methods); - - this.map[this.defaults.wildcard] = {}; - - this.configureTransitions(options.transitions || []); - - this.plugins = this.configurePlugins(options.plugins, StateMachine.plugin); - -} - -//------------------------------------------------------------------------------------------------- - -mixin(Config.prototype, { - - addState: function(name) { - if (!this.map[name]) { - this.states.push(name); - this.addStateLifecycleNames(name); - this.map[name] = {}; - } - }, - - addStateLifecycleNames: function(name) { - this.lifecycle.onEnter[name] = camelize.prepended('onEnter', name); - this.lifecycle.onLeave[name] = camelize.prepended('onLeave', name); - this.lifecycle.on[name] = camelize.prepended('on', name); - }, - - addTransition: function(name) { - if (this.transitions.indexOf(name) < 0) { - this.transitions.push(name); - this.addTransitionLifecycleNames(name); - } - }, - - addTransitionLifecycleNames: function(name) { - this.lifecycle.onBefore[name] = camelize.prepended('onBefore', name); - this.lifecycle.onAfter[name] = camelize.prepended('onAfter', name); - this.lifecycle.on[name] = camelize.prepended('on', name); - }, - - mapTransition: function(transition) { - var name = transition.name, - from = transition.from, - to = transition.to; - this.addState(from); - if (typeof to !== 'function') - this.addState(to); - this.addTransition(name); - this.map[from][name] = transition; - return transition; - }, - - configureLifecycle: function() { - return { - onBefore: { transition: 'onBeforeTransition' }, - onAfter: { transition: 'onAfterTransition' }, - onEnter: { state: 'onEnterState' }, - onLeave: { state: 'onLeaveState' }, - on: { transition: 'onTransition' } - }; - }, - - configureInitTransition: function(init) { - if (typeof init === 'string') { - return this.mapTransition(mixin({}, this.defaults.init, { to: init, active: true })); - } - else if (typeof init === 'object') { - return this.mapTransition(mixin({}, this.defaults.init, init, { active: true })); - } - else { - this.addState(this.defaults.init.from); - return this.defaults.init; - } - }, - - configureData: function(data) { - if (typeof data === 'function') - return data; - else if (typeof data === 'object') - return function() { return data; } - else - return function() { return {}; } - }, - - configureMethods: function(methods) { - return methods || {}; - }, - - configurePlugins: function(plugins, builtin) { - plugins = plugins || []; - var n, max, plugin; - for(n = 0, max = plugins.length ; n < max ; n++) { - plugin = plugins[n]; - if (typeof plugin === 'function') - plugins[n] = plugin = plugin(); - if (plugin.configure) - plugin.configure(this); - } - return plugins - }, - - configureTransitions: function(transitions) { - var i, n, transition, from, to, wildcard = this.defaults.wildcard; - for(n = 0 ; n < transitions.length ; n++) { - transition = transitions[n]; - from = Array.isArray(transition.from) ? transition.from : [transition.from || wildcard]; - to = transition.to || wildcard; - for(i = 0 ; i < from.length ; i++) { - this.mapTransition({ name: transition.name, from: from[i], to: to }); - } - } - }, - - transitionFor: function(state, transition) { - var wildcard = this.defaults.wildcard; - return this.map[state][transition] || - this.map[wildcard][transition]; - }, - - transitionsFor: function(state) { - var wildcard = this.defaults.wildcard; - return Object.keys(this.map[state]).concat(Object.keys(this.map[wildcard])); - }, - - allStates: function() { - return this.states; - }, - - allTransitions: function() { - return this.transitions; - } - -}); - -//------------------------------------------------------------------------------------------------- - -module.exports = Config; - -//------------------------------------------------------------------------------------------------- - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - - -var mixin = __webpack_require__(0), - Exception = __webpack_require__(6), - plugin = __webpack_require__(1), - UNOBSERVED = [ null, [] ]; - -//------------------------------------------------------------------------------------------------- - -function JSM(context, config) { - this.context = context; - this.config = config; - this.state = config.init.from; - this.observers = [context]; -} - -//------------------------------------------------------------------------------------------------- - -mixin(JSM.prototype, { - - init: function(args) { - mixin(this.context, this.config.data.apply(this.context, args)); - plugin.hook(this, 'init'); - if (this.config.init.active) - return this.fire(this.config.init.name, []); - }, - - is: function(state) { - return Array.isArray(state) ? (state.indexOf(this.state) >= 0) : (this.state === state); - }, - - isPending: function() { - return this.pending; - }, - - can: function(transition) { - return !this.isPending() && !!this.seek(transition); - }, - - cannot: function(transition) { - return !this.can(transition); - }, - - allStates: function() { - return this.config.allStates(); - }, - - allTransitions: function() { - return this.config.allTransitions(); - }, - - transitions: function() { - return this.config.transitionsFor(this.state); - }, - - seek: function(transition, args) { - var wildcard = this.config.defaults.wildcard, - entry = this.config.transitionFor(this.state, transition), - to = entry && entry.to; - if (typeof to === 'function') - return to.apply(this.context, args); - else if (to === wildcard) - return this.state - else - return to - }, - - fire: function(transition, args) { - return this.transit(transition, this.state, this.seek(transition, args), args); - }, - - transit: function(transition, from, to, args) { - - var lifecycle = this.config.lifecycle, - changed = this.config.options.observeUnchangedState || (from !== to); - - if (!to) - return this.context.onInvalidTransition(transition, from, to); - - if (this.isPending()) - return this.context.onPendingTransition(transition, from, to); - - this.config.addState(to); // might need to add this state if it's unknown (e.g. conditional transition or goto) - - this.beginTransit(); - - args.unshift({ // this context will be passed to each lifecycle event observer - transition: transition, - from: from, - to: to, - fsm: this.context - }); - - return this.observeEvents([ - this.observersForEvent(lifecycle.onBefore.transition), - this.observersForEvent(lifecycle.onBefore[transition]), - changed ? this.observersForEvent(lifecycle.onLeave.state) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onLeave[from]) : UNOBSERVED, - this.observersForEvent(lifecycle.on.transition), - changed ? [ 'doTransit', [ this ] ] : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onEnter.state) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.onEnter[to]) : UNOBSERVED, - changed ? this.observersForEvent(lifecycle.on[to]) : UNOBSERVED, - this.observersForEvent(lifecycle.onAfter.transition), - this.observersForEvent(lifecycle.onAfter[transition]), - this.observersForEvent(lifecycle.on[transition]) - ], args); - }, - - beginTransit: function() { this.pending = true; }, - endTransit: function(result) { this.pending = false; return result; }, - failTransit: function(result) { this.pending = false; throw result; }, - doTransit: function(lifecycle) { this.state = lifecycle.to; }, - - observe: function(args) { - if (args.length === 2) { - var observer = {}; - observer[args[0]] = args[1]; - this.observers.push(observer); - } - else { - this.observers.push(args[0]); - } - }, - - observersForEvent: function(event) { // TODO: this could be cached - var n = 0, max = this.observers.length, observer, result = []; - for( ; n < max ; n++) { - observer = this.observers[n]; - if (observer[event]) - result.push(observer); - } - return [ event, result, true ] - }, - - observeEvents: function(events, args, previousEvent, previousResult) { - if (events.length === 0) { - return this.endTransit(previousResult === undefined ? true : previousResult); - } - - var event = events[0][0], - observers = events[0][1], - pluggable = events[0][2]; - - args[0].event = event; - if (event && pluggable && event !== previousEvent) - plugin.hook(this, 'lifecycle', args); - - if (observers.length === 0) { - events.shift(); - return this.observeEvents(events, args, event, previousResult); - } - else { - var observer = observers.shift(), - result = observer[event].apply(observer, args); - if (result && typeof result.then === 'function') { - return result.then(this.observeEvents.bind(this, events, args, event)) - .catch(this.failTransit.bind(this)) - } - else if (result === false) { - return this.endTransit(false); - } - else { - return this.observeEvents(events, args, event, result); - } - } - }, - - onInvalidTransition: function(transition, from, to) { - throw new Exception("transition is invalid in current state", transition, from, to, this.state); - }, - - onPendingTransition: function(transition, from, to) { - throw new Exception("transition is invalid while previous transition is still in progress", transition, from, to, this.state); - } - -}); - -//------------------------------------------------------------------------------------------------- - -module.exports = JSM; - -//------------------------------------------------------------------------------------------------- - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - - -//----------------------------------------------------------------------------------------------- - -var mixin = __webpack_require__(0), - camelize = __webpack_require__(2), - plugin = __webpack_require__(1), - Config = __webpack_require__(3), - JSM = __webpack_require__(4); - -//----------------------------------------------------------------------------------------------- - -var PublicMethods = { - is: function(state) { return this._fsm.is(state) }, - can: function(transition) { return this._fsm.can(transition) }, - cannot: function(transition) { return this._fsm.cannot(transition) }, - observe: function() { return this._fsm.observe(arguments) }, - transitions: function() { return this._fsm.transitions() }, - allTransitions: function() { return this._fsm.allTransitions() }, - allStates: function() { return this._fsm.allStates() }, - onInvalidTransition: function(t, from, to) { return this._fsm.onInvalidTransition(t, from, to) }, - onPendingTransition: function(t, from, to) { return this._fsm.onPendingTransition(t, from, to) }, -}; - -var PublicProperties = { - state: { - configurable: false, - enumerable: true, - get: function() { - return this._fsm.state; - }, - set: function(state) { - throw Error('use transitions to change state') - } - } -}; - -//----------------------------------------------------------------------------------------------- - -function StateMachine(options) { - return apply(this || {}, options); -} - -function factory() { - var cstor, options; - if (typeof arguments[0] === 'function') { - cstor = arguments[0]; - options = arguments[1] || {}; - } - else { - cstor = function() { this._fsm.apply(this, arguments); }; - options = arguments[0] || {}; - } - var config = new Config(options, StateMachine); - build(cstor.prototype, config); - cstor.prototype._fsm.config = config; // convenience access to shared config without needing an instance - return cstor; -} - -//------------------------------------------------------------------------------------------------- - -function apply(instance, options) { - var config = new Config(options, StateMachine); - build(instance, config); - instance._fsm(); - return instance; -} - -function build(target, config) { - if ((typeof target !== 'object') || Array.isArray(target)) - throw Error('StateMachine can only be applied to objects'); - plugin.build(target, config); - Object.defineProperties(target, PublicProperties); - mixin(target, PublicMethods); - mixin(target, config.methods); - config.allTransitions().forEach(function(transition) { - target[camelize(transition)] = function() { - return this._fsm.fire(transition, [].slice.call(arguments)) - }; - }); - target._fsm = function() { - this._fsm = new JSM(this, config); - this._fsm.init(arguments); - }; -} - -//----------------------------------------------------------------------------------------------- - -StateMachine.version = '3.0.1'; -StateMachine.factory = factory; -StateMachine.apply = apply; -StateMachine.defaults = { - wildcard: '*', - init: { - name: 'init', - from: 'none' - } -}; - -//=============================================================================================== - -module.exports = StateMachine; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - - -module.exports = function(message, transition, from, to, current) { - this.message = message; - this.transition = transition; - this.from = from; - this.to = to; - this.current = current; -}; - - -/***/ }) -/******/ ]); -}); -}(stateMachine)); - -// Dependencies -const arbitrary = dist.exports; -const monitor$3 = duplex; -const BN$a = bn$2.exports; - -// Fabric Types -const Hash256$5 = hash256$l; -const Actor$a = actor; -const State$5 = state$2; - -/** - * General-purpose state machine with {@link Vector}-based instructions. - */ -class Machine$6 extends Actor$a { - /** - * Create a Machine. - * @param {Object} settings Run-time configuration. - */ - constructor (settings) { - super(settings); - - this.settings = Object.assign({ - path: './stores/machine', - clock: 0, - debug: false, - deterministic: true, - frequency: 1, // Hz - script: [], - seed: 1, // TODO: select seed for production - type: 'x86' - }, settings); - - // internal clock - this.clock = this.settings.clock; - - // define integer field - this.seed = Hash256$5.digest(this.settings.seed + ''); - this.q = parseInt(this.seed.substring(0, 4), 16); - - // deterministic entropy and RNG - this.generator = new arbitrary.default.Generator(this.q); - this.entropy = this.sip(); - - this.known = {}; // definitions - this.script = this.settings.script; // input - this.stack = []; // output - this.history = []; // State tree - - this._state = { - content: { - clock: this.clock - }, - status: 'PAUSED' - }; - - this.observer = monitor$3.observe(this._state.content); - - // Tip - Object.defineProperty(this, 'tip', function (val) { - this.log(`tip requested: ${val}`); - this.log(`tip requested, history: ${JSON.stringify(this.history)}`); - return this.history[this.history.length - 1] || null; - }); - - return this; - } - - bit () { - return this.generator.next.bits(1); - } - - /** - * Get `n` bits of deterministic random data. - * @param {Number} [n=128] Number of bits to retrieve. - * @return {Number} Random bits from {@link Generator}. - */ - sip (n = 128) { - const self = this; - return new BN$a([...Array(n)].map(() => { - return self.bit().toString(); - }).join(''), 2).toString(16); - } - - /** - * Get `n` bytes of deterministic random data. - * @param {Number} [n=32] Number of bytes to retrieve. - * @return {Number} Random bytes from {@link Generator}. - */ - slurp (n = 32) { - const self = this; - return new BN$a([...Array(n * 8)].map(() => { - return self.bit(); - }).join(''), 2).toString(16); - } - - /** - * Computes the next "step" for our current Vector. Analagous to `sum`. - * The top item on the stack is always the memory held at current position, - * so counts should always begin with 0. - * @param {Vector} input - Input state, undefined if desired. - * @return {Promise} - */ - async compute (input) { - this._state.content.clock = ++this.clock; - - this.emit('tick', this.clock); - - for (const i in this.script) { - const instruction = this.script[i]; - console.log('known:', this.known); - if (this.known[instruction]) { - const op = new State$5({ - '@type': 'Cycle', - parent: this.id, - state: this.state, - known: this.known, - input: input - }); - const data = this.known[instruction].call(op, input); - this.stack.push(data); - } else { - this.stack.push(instruction | 0); - } - } - - if (this.stack.length > 1) ; - - // this.state['@data'] = this.stack; - // this.state['@id'] = this.id; - - console.log('stack:', this.stack); - this._state.content = this.stack[this.stack.length - 1]; - - this.commit(); - - return this.state; - } - - asBuffer () { - const data = this.serialize(this.state['@data']); - return Buffer.from(data); - } - - // register a local function - define (name, op) { - this.known[name] = op.bind(this); - } - - applyOperation (op) { - monitor$3.applyOperation(this.state, op); - } - - commit () { - const self = this; - if (!self.observer) return false; - - const changes = monitor$3.generate(self.observer); - - if (changes && changes.length) { - let vector = new State$5({ - '@type': 'Change', - '@data': changes, - method: 'patch', - parent: self.id, - params: changes - }); - - if (!self.history) self.history = []; - self.history.push(vector); - - self.emit('transaction', vector); - self.emit('changes', changes); - } - - return changes; - } - - async start () { - this.status = 'STARTING'; - this._governor = setInterval(this.compute.bind(this), this.settings.frequency * 1000); - this.status = 'STARTED'; - return this; - } - - async stop () { - this.status = 'STOPPING'; - if (this._governor) clearInterval(this._governor); - this.status = 'STOPPED'; - return this; - } -} - -var machine = Machine$6; - -// External dependencies -const crypto$c = require$$0$4; -const parser$4 = dotparser; -const visualize = visualize$1.exports; -const StateMachine = stateMachine.exports; - -// Fabric Types -const Machine$5 = machine; -const Actor$9 = actor; - -/** - * The {@link Circuit} is the mechanism through which {@link Fabric} - * operates, a computable directed graph describing a network of - * {@link Peer} components and their interactions (side effects). - * See also {@link Swarm} for deeper *inspection of {@link Machine} - * mechanics. - */ -class Circuit$3 extends Actor$9 { - constructor (config = {}) { - super(config); - - this.settings = Object.assign({ - edges: [], - gates: [], - loops: [], - nodes: [], - wires: [], - methods: {} - }, config); - - this['@data'] = this.settings; - - this.gates = []; - this.transitions = []; - this.methods = {}; - - // External State - this.state = { - edges: [], - nodes: [] - }; - - for (let i in this.settings.gates) { - this.transitions.push({ - name: `step`, - from: 'cycle()', - to: `${this.settings.gates[i]}` - }); - } - - for (let i in this.settings.wires) { - let wire = this.settings.wires[i]; - this.transitions.push({ name: wire.name, from: wire.from, to: wire.to }); - } - - this.graph = new StateMachine({ - init: 'start()', - data: this.state, - transitions: this.transitions, - methods: this.methods - }); - - // Internal State - this._state = { - steps: [ - 'load', // load from storage - 'bootstrap', // configure memory - 'step', // single cycle before start - 'start', // create services - 'listen' // listen for input - ] - }; - - return this; - } - - get hash () { - return crypto$c.createHash('sha256').update(this.dot).digest('hex'); - } - - get dot () { - // TODO: generate polynomial for circuit - return visualize(this.graph, { - orientation: 'horizontal' - }); - } - - _registerMethod (name, method) { - this.methods[name] = method; - } - - toObject () { - return parser$4(this.dot); - } - - parse (input) { - return parser$4(input); - } - - compute (input) { - let output = input; - - // empty resolves to Identity function f(x) = x - - return output; - } - - scramble () { - let key = crypto$c.randomBytes(32); - let machine = new Machine$5({ seed: key }); - machine.sip(); - let gates = []; - - for (let i = 0; i < this._state.steps.length; i++) { - gates.push({ - name: this._state.steps[i], - seed: machine.sip() - }); - } - - gates.sort((a, b) => { - return a.seed - b.seed; - }); - - return gates; - } - - render () { - let hash = crypto$c.createHash('sha256').update(this.dot).digest('base64'); - return ` - ${this.dot} - - - - - - - - - - - - - - - - -`; - } - - _draw () { - return this; - } - - async _step () { - let circuit = this; - let origin = circuit.hash + ''; - - console.log('[CIRCUIT:STEP]', this.graph); - console.log('[CIRCUIT:STEP]', 'woo:', this.toObject()); - console.log('[CIRCUIT:STEP]', 'zkc:', this.toObject().map((x) => { - return x.children.filter(x => { - return x.type === 'edge_stmt'; - }).map((y) => { - return y.edge_list.map(z => { - return z.id; - }); - }); - })[0]); - - console.log('[CIRCUIT:STEP]', 'fsm:', this.graph._fsm); - console.log('[CIRCUIT:STEP]', 'origin:', origin); - console.log('[CIRCUIT:STEP]', 'origin hash:', this.hash); - console.log('[CIRCUIT:STEP]', 'origin data:', this.dot); - console.log('[CIRCUIT:STEP]', 'current:', this.graph.state); - - switch (this.graph.state) { - default: - console.error('unhandled state:', this.graph.state); - break; - case 'init': - this.graph.ready(); - break; - case 'ready': - this.graph.step1(); - break; - case '1': - this.graph.step2(); - break; - case '2': - this.graph.step3(); - break; - case '3': - this.graph.done(); - break; - case 'complete': - console.log('#winning'); - this.emit('complete'); - break; - } - - console.log('[CIRCUIT:STEP]', 'after:', this.graph.state); - - this.emit(origin, this.dot); - - await this._PUT(`/output`, Buffer.alloc((256 ** 3) / 8), false); - await this._PUT(`/source`, this.dot, false); - await this._PUT(`/status`, this.graph.state, false); - - let commit = await this.commit(); - - console.log('commit:', commit); - - return commit; - } - - async start () { - return this; - } -} - -var circuit = Circuit$3; - -var isarray = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -/** - * Expose `pathToRegexp`. - */ -var pathToRegexp_1 = pathToRegexp$2; -var parse_1 = parse$2; -var compile_1 = compile$2; -var tokensToFunction_1 = tokensToFunction$1; -var tokensToRegExp_1 = tokensToRegExp; - -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g'); - -/** - * Parse a string for the raw tokens. - * - * @param {String} str - * @return {Array} - */ -function parse$2 (str) { - var tokens = []; - var key = 0; - var index = 0; - var path = ''; - var res; - - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0]; - var escaped = res[1]; - var offset = res.index; - path += str.slice(index, offset); - index = offset + m.length; - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1]; - continue - } - - // Push the current path onto the tokens. - if (path) { - tokens.push(path); - path = ''; - } - - var prefix = res[2]; - var name = res[3]; - var capture = res[4]; - var group = res[5]; - var suffix = res[6]; - var asterisk = res[7]; - - var repeat = suffix === '+' || suffix === '*'; - var optional = suffix === '?' || suffix === '*'; - var delimiter = prefix || '/'; - var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?'); - - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - pattern: escapeGroup(pattern) - }); - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index); - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path); - } - - return tokens -} - -/** - * Compile a string to a template function for the path. - * - * @param {String} str - * @return {Function} - */ -function compile$2 (str) { - return tokensToFunction$1(parse$2(str)) -} - -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction$1 (tokens) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length); - - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^' + tokens[i].pattern + '$'); - } - } - - return function (obj) { - var path = ''; - var data = obj || {}; - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - - if (typeof token === 'string') { - path += token; - - continue - } - - var value = data[token.name]; - var segment; - - if (value == null) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received "' + value + '"') - } - - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } - } - - for (var j = 0; j < value.length; j++) { - segment = encodeURIComponent(value[j]); - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += (j === 0 ? token.prefix : token.delimiter) + segment; - } - - continue - } - - segment = encodeURIComponent(value); - - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += token.prefix + segment; - } - - return path - } -} - -/** - * Escape a regular expression string. - * - * @param {String} str - * @return {String} - */ -function escapeString$1 (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/])/g, '\\$1') -} - -/** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {String} group - * @return {String} - */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') -} - -/** - * Attach the keys as a property of the regexp. - * - * @param {RegExp} re - * @param {Array} keys - * @return {RegExp} - */ -function attachKeys (re, keys) { - re.keys = keys; - return re -} - -/** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {String} - */ -function flags$1 (options) { - return options.sensitive ? '' : 'i' -} - -/** - * Pull out keys from a regexp. - * - * @param {RegExp} path - * @param {Array} keys - * @return {RegExp} - */ -function regexpToRegexp$1 (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g); - - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - pattern: null - }); - } - } - - return attachKeys(path, keys) -} - -/** - * Transform an array into a regexp. - * - * @param {Array} path - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ -function arrayToRegexp$1 (path, keys, options) { - var parts = []; - - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp$2(path[i], keys, options).source); - } - - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags$1(options)); - - return attachKeys(regexp, keys) -} - -/** - * Create a path regexp from string input. - * - * @param {String} path - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ -function stringToRegexp$1 (path, keys, options) { - var tokens = parse$2(path); - var re = tokensToRegExp(tokens, options); - - // Attach keys back to the regexp. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] !== 'string') { - keys.push(tokens[i]); - } - } - - return attachKeys(re, keys) -} - -/** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {Array} tokens - * @param {Array} keys - * @param {Object} options - * @return {RegExp} - */ -function tokensToRegExp (tokens, options) { - options = options || {}; - - var strict = options.strict; - var end = options.end !== false; - var route = ''; - var lastToken = tokens[tokens.length - 1]; - var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken); - - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - - if (typeof token === 'string') { - route += escapeString$1(token); - } else { - var prefix = escapeString$1(token.prefix); - var capture = token.pattern; - - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*'; - } - - if (token.optional) { - if (prefix) { - capture = '(?:' + prefix + '(' + capture + '))?'; - } else { - capture = '(' + capture + ')?'; - } - } else { - capture = prefix + '(' + capture + ')'; - } - - route += capture; - } - } - - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; - } - - if (end) { - route += '$'; - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithSlash ? '' : '(?=\\/|$)'; - } - - return new RegExp('^' + route, flags$1(options)) -} - -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(String|RegExp|Array)} path - * @param {Array} [keys] - * @param {Object} [options] - * @return {RegExp} - */ -function pathToRegexp$2 (path, keys, options) { - keys = keys || []; - - if (!isarray(keys)) { - options = keys; - keys = []; - } else if (!options) { - options = {}; - } - - if (path instanceof RegExp) { - return regexpToRegexp$1(path, keys) - } - - if (isarray(path)) { - return arrayToRegexp$1(path, keys, options) - } - - return stringToRegexp$1(path, keys, options) -} - -pathToRegexp_1.parse = parse_1; -pathToRegexp_1.compile = compile_1; -pathToRegexp_1.tokensToFunction = tokensToFunction_1; -pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; - -/** - * Module dependencies. - */ - - - - /** - * Short-cuts for global-object checks - */ - - var hasDocument = ('undefined' !== typeof document); - var hasWindow = ('undefined' !== typeof window); - var hasHistory = ('undefined' !== typeof history); - var hasProcess = typeof process !== 'undefined'; - - /** - * Detect click event - */ - var clickEvent = hasDocument && document.ontouchstart ? 'touchstart' : 'click'; - - /** - * To work properly with the URL - * history.location generated polyfill in https://github.com/devote/HTML5-History-API - */ - - var isLocation = hasWindow && !!(window.history.location || window.location); - - /** - * The page instance - * @api private - */ - function Page() { - // public things - this.callbacks = []; - this.exits = []; - this.current = ''; - this.len = 0; - - // private things - this._decodeURLComponents = true; - this._base = ''; - this._strict = false; - this._running = false; - this._hashbang = false; - - // bound functions - this.clickHandler = this.clickHandler.bind(this); - this._onpopstate = this._onpopstate.bind(this); - } - - /** - * Configure the instance of page. This can be called multiple times. - * - * @param {Object} options - * @api public - */ - - Page.prototype.configure = function(options) { - var opts = options || {}; - - this._window = opts.window || (hasWindow && window); - this._decodeURLComponents = opts.decodeURLComponents !== false; - this._popstate = opts.popstate !== false && hasWindow; - this._click = opts.click !== false && hasDocument; - this._hashbang = !!opts.hashbang; - - var _window = this._window; - if(this._popstate) { - _window.addEventListener('popstate', this._onpopstate, false); - } else if(hasWindow) { - _window.removeEventListener('popstate', this._onpopstate, false); - } - - if (this._click) { - _window.document.addEventListener(clickEvent, this.clickHandler, false); - } else if(hasDocument) { - _window.document.removeEventListener(clickEvent, this.clickHandler, false); - } - - if(this._hashbang && hasWindow && !hasHistory) { - _window.addEventListener('hashchange', this._onpopstate, false); - } else if(hasWindow) { - _window.removeEventListener('hashchange', this._onpopstate, false); - } - }; - - /** - * Get or set basepath to `path`. - * - * @param {string} path - * @api public - */ - - Page.prototype.base = function(path) { - if (0 === arguments.length) return this._base; - this._base = path; - }; - - /** - * Gets the `base`, which depends on whether we are using History or - * hashbang routing. - - * @api private - */ - Page.prototype._getBase = function() { - var base = this._base; - if(!!base) return base; - var loc = hasWindow && this._window && this._window.location; - - if(hasWindow && this._hashbang && loc && loc.protocol === 'file:') { - base = loc.pathname; - } - - return base; - }; - - /** - * Get or set strict path matching to `enable` - * - * @param {boolean} enable - * @api public - */ - - Page.prototype.strict = function(enable) { - if (0 === arguments.length) return this._strict; - this._strict = enable; - }; - - - /** - * Bind with the given `options`. - * - * Options: - * - * - `click` bind to click events [true] - * - `popstate` bind to popstate [true] - * - `dispatch` perform initial dispatch [true] - * - * @param {Object} options - * @api public - */ - - Page.prototype.start = function(options) { - var opts = options || {}; - this.configure(opts); - - if (false === opts.dispatch) return; - this._running = true; - - var url; - if(isLocation) { - var window = this._window; - var loc = window.location; - - if(this._hashbang && ~loc.hash.indexOf('#!')) { - url = loc.hash.substr(2) + loc.search; - } else if (this._hashbang) { - url = loc.search + loc.hash; - } else { - url = loc.pathname + loc.search + loc.hash; - } - } - - this.replace(url, null, true, opts.dispatch); - }; - - /** - * Unbind click and popstate event handlers. - * - * @api public - */ - - Page.prototype.stop = function() { - if (!this._running) return; - this.current = ''; - this.len = 0; - this._running = false; - - var window = this._window; - this._click && window.document.removeEventListener(clickEvent, this.clickHandler, false); - hasWindow && window.removeEventListener('popstate', this._onpopstate, false); - hasWindow && window.removeEventListener('hashchange', this._onpopstate, false); - }; - - /** - * Show `path` with optional `state` object. - * - * @param {string} path - * @param {Object=} state - * @param {boolean=} dispatch - * @param {boolean=} push - * @return {!Context} - * @api public - */ - - Page.prototype.show = function(path, state, dispatch, push) { - var ctx = new Context(path, state, this), - prev = this.prevContext; - this.prevContext = ctx; - this.current = ctx.path; - if (false !== dispatch) this.dispatch(ctx, prev); - if (false !== ctx.handled && false !== push) ctx.pushState(); - return ctx; - }; - - /** - * Goes back in the history - * Back should always let the current route push state and then go back. - * - * @param {string} path - fallback path to go back if no more history exists, if undefined defaults to page.base - * @param {Object=} state - * @api public - */ - - Page.prototype.back = function(path, state) { - var page = this; - if (this.len > 0) { - var window = this._window; - // this may need more testing to see if all browsers - // wait for the next tick to go back in history - hasHistory && window.history.back(); - this.len--; - } else if (path) { - setTimeout(function() { - page.show(path, state); - }); - } else { - setTimeout(function() { - page.show(page._getBase(), state); - }); - } - }; - - /** - * Register route to redirect from one path to other - * or just redirect to another route - * - * @param {string} from - if param 'to' is undefined redirects to 'from' - * @param {string=} to - * @api public - */ - Page.prototype.redirect = function(from, to) { - var inst = this; - - // Define route from a path to another - if ('string' === typeof from && 'string' === typeof to) { - page$1.call(this, from, function(e) { - setTimeout(function() { - inst.replace(/** @type {!string} */ (to)); - }, 0); - }); - } - - // Wait for the push state and replace it with another - if ('string' === typeof from && 'undefined' === typeof to) { - setTimeout(function() { - inst.replace(from); - }, 0); - } - }; - - /** - * Replace `path` with optional `state` object. - * - * @param {string} path - * @param {Object=} state - * @param {boolean=} init - * @param {boolean=} dispatch - * @return {!Context} - * @api public - */ - - - Page.prototype.replace = function(path, state, init, dispatch) { - var ctx = new Context(path, state, this), - prev = this.prevContext; - this.prevContext = ctx; - this.current = ctx.path; - ctx.init = init; - ctx.save(); // save before dispatching, which may redirect - if (false !== dispatch) this.dispatch(ctx, prev); - return ctx; - }; - - /** - * Dispatch the given `ctx`. - * - * @param {Context} ctx - * @api private - */ - - Page.prototype.dispatch = function(ctx, prev) { - var i = 0, j = 0, page = this; - - function nextExit() { - var fn = page.exits[j++]; - if (!fn) return nextEnter(); - fn(prev, nextExit); - } - - function nextEnter() { - var fn = page.callbacks[i++]; - - if (ctx.path !== page.current) { - ctx.handled = false; - return; - } - if (!fn) return unhandled.call(page, ctx); - fn(ctx, nextEnter); - } - - if (prev) { - nextExit(); - } else { - nextEnter(); - } - }; - - /** - * Register an exit route on `path` with - * callback `fn()`, which will be called - * on the previous context when a new - * page is visited. - */ - Page.prototype.exit = function(path, fn) { - if (typeof path === 'function') { - return this.exit('*', path); - } - - var route = new Route$2(path, null, this); - for (var i = 1; i < arguments.length; ++i) { - this.exits.push(route.middleware(arguments[i])); - } - }; - - /** - * Handle "click" events. - */ - - /* jshint +W054 */ - Page.prototype.clickHandler = function(e) { - if (1 !== this._which(e)) return; - - if (e.metaKey || e.ctrlKey || e.shiftKey) return; - if (e.defaultPrevented) return; - - // ensure link - // use shadow dom when available if not, fall back to composedPath() - // for browsers that only have shady - var el = e.target; - var eventPath = e.path || (e.composedPath ? e.composedPath() : null); - - if(eventPath) { - for (var i = 0; i < eventPath.length; i++) { - if (!eventPath[i].nodeName) continue; - if (eventPath[i].nodeName.toUpperCase() !== 'A') continue; - if (!eventPath[i].href) continue; - - el = eventPath[i]; - break; - } - } - - // continue ensure link - // el.nodeName for svg links are 'a' instead of 'A' - while (el && 'A' !== el.nodeName.toUpperCase()) el = el.parentNode; - if (!el || 'A' !== el.nodeName.toUpperCase()) return; - - // check if link is inside an svg - // in this case, both href and target are always inside an object - var svg = (typeof el.href === 'object') && el.href.constructor.name === 'SVGAnimatedString'; - - // Ignore if tag has - // 1. "download" attribute - // 2. rel="external" attribute - if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') return; - - // ensure non-hash for the same path - var link = el.getAttribute('href'); - if(!this._hashbang && this._samePath(el) && (el.hash || '#' === link)) return; - - // Check for mailto: in the href - if (link && link.indexOf('mailto:') > -1) return; - - // check target - // svg target is an object and its desired value is in .baseVal property - if (svg ? el.target.baseVal : el.target) return; - - // x-origin - // note: svg links that are not relative don't call click events (and skip page.js) - // consequently, all svg links tested inside page.js are relative and in the same origin - if (!svg && !this.sameOrigin(el.href)) return; - - // rebuild path - // There aren't .pathname and .search properties in svg links, so we use href - // Also, svg href is an object and its desired value is in .baseVal property - var path = svg ? el.href.baseVal : (el.pathname + el.search + (el.hash || '')); - - path = path[0] !== '/' ? '/' + path : path; - - // strip leading "/[drive letter]:" on NW.js on Windows - if (hasProcess && path.match(/^\/[a-zA-Z]:\//)) { - path = path.replace(/^\/[a-zA-Z]:\//, '/'); - } - - // same page - var orig = path; - var pageBase = this._getBase(); - - if (path.indexOf(pageBase) === 0) { - path = path.substr(pageBase.length); - } - - if (this._hashbang) path = path.replace('#!', ''); - - if (pageBase && orig === path && (!isLocation || this._window.location.protocol !== 'file:')) { - return; - } - - e.preventDefault(); - this.show(orig); - }; - - /** - * Handle "populate" events. - * @api private - */ - - Page.prototype._onpopstate = (function () { - var loaded = false; - if ( ! hasWindow ) { - return function () {}; - } - if (hasDocument && document.readyState === 'complete') { - loaded = true; - } else { - window.addEventListener('load', function() { - setTimeout(function() { - loaded = true; - }, 0); - }); - } - return function onpopstate(e) { - if (!loaded) return; - var page = this; - if (e.state) { - var path = e.state.path; - page.replace(path, e.state); - } else if (isLocation) { - var loc = page._window.location; - page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); - } - }; - })(); - - /** - * Event button. - */ - Page.prototype._which = function(e) { - e = e || (hasWindow && this._window.event); - return null == e.which ? e.button : e.which; - }; - - /** - * Convert to a URL object - * @api private - */ - Page.prototype._toURL = function(href) { - var window = this._window; - if(typeof URL === 'function' && isLocation) { - return new URL(href, window.location.toString()); - } else if (hasDocument) { - var anc = window.document.createElement('a'); - anc.href = href; - return anc; - } - }; - - /** - * Check if `href` is the same origin. - * @param {string} href - * @api public - */ - Page.prototype.sameOrigin = function(href) { - if(!href || !isLocation) return false; - - var url = this._toURL(href); - var window = this._window; - - var loc = window.location; - - /* - When the port is the default http port 80 for http, or 443 for - https, internet explorer 11 returns an empty string for loc.port, - so we need to compare loc.port with an empty string if url.port - is the default port 80 or 443. - Also the comparition with `port` is changed from `===` to `==` because - `port` can be a string sometimes. This only applies to ie11. - */ - return loc.protocol === url.protocol && - loc.hostname === url.hostname && - (loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line - }; - - /** - * @api private - */ - Page.prototype._samePath = function(url) { - if(!isLocation) return false; - var window = this._window; - var loc = window.location; - return url.pathname === loc.pathname && - url.search === loc.search; - }; - - /** - * Remove URL encoding from the given `str`. - * Accommodates whitespace in both x-www-form-urlencoded - * and regular percent-encoded form. - * - * @param {string} val - URL component to decode - * @api private - */ - Page.prototype._decodeURLEncodedURIComponent = function(val) { - if (typeof val !== 'string') { return val; } - return this._decodeURLComponents ? decodeURIComponent(val.replace(/\+/g, ' ')) : val; - }; - - /** - * Create a new `page` instance and function - */ - function createPage() { - var pageInstance = new Page(); - - function pageFn(/* args */) { - return page$1.apply(pageInstance, arguments); - } - - // Copy all of the things over. In 2.0 maybe we use setPrototypeOf - pageFn.callbacks = pageInstance.callbacks; - pageFn.exits = pageInstance.exits; - pageFn.base = pageInstance.base.bind(pageInstance); - pageFn.strict = pageInstance.strict.bind(pageInstance); - pageFn.start = pageInstance.start.bind(pageInstance); - pageFn.stop = pageInstance.stop.bind(pageInstance); - pageFn.show = pageInstance.show.bind(pageInstance); - pageFn.back = pageInstance.back.bind(pageInstance); - pageFn.redirect = pageInstance.redirect.bind(pageInstance); - pageFn.replace = pageInstance.replace.bind(pageInstance); - pageFn.dispatch = pageInstance.dispatch.bind(pageInstance); - pageFn.exit = pageInstance.exit.bind(pageInstance); - pageFn.configure = pageInstance.configure.bind(pageInstance); - pageFn.sameOrigin = pageInstance.sameOrigin.bind(pageInstance); - pageFn.clickHandler = pageInstance.clickHandler.bind(pageInstance); - - pageFn.create = createPage; - - Object.defineProperty(pageFn, 'len', { - get: function(){ - return pageInstance.len; - }, - set: function(val) { - pageInstance.len = val; - } - }); - - Object.defineProperty(pageFn, 'current', { - get: function(){ - return pageInstance.current; - }, - set: function(val) { - pageInstance.current = val; - } - }); - - // In 2.0 these can be named exports - pageFn.Context = Context; - pageFn.Route = Route$2; - - return pageFn; - } - - /** - * Register `path` with callback `fn()`, - * or route `path`, or redirection, - * or `page.start()`. - * - * page(fn); - * page('*', fn); - * page('/user/:id', load, user); - * page('/user/' + user.id, { some: 'thing' }); - * page('/user/' + user.id); - * page('/from', '/to') - * page(); - * - * @param {string|!Function|!Object} path - * @param {Function=} fn - * @api public - */ - - function page$1(path, fn) { - // - if ('function' === typeof path) { - return page$1.call(this, '*', path); - } - - // route to - if ('function' === typeof fn) { - var route = new Route$2(/** @type {string} */ (path), null, this); - for (var i = 1; i < arguments.length; ++i) { - this.callbacks.push(route.middleware(arguments[i])); - } - // show with [state] - } else if ('string' === typeof path) { - this['string' === typeof fn ? 'redirect' : 'show'](path, fn); - // start [options] - } else { - this.start(path); - } - } - - /** - * Unhandled `ctx`. When it's not the initial - * popstate then redirect. If you wish to handle - * 404s on your own use `page('*', callback)`. - * - * @param {Context} ctx - * @api private - */ - function unhandled(ctx) { - if (ctx.handled) return; - var current; - var page = this; - var window = page._window; - - if (page._hashbang) { - current = isLocation && this._getBase() + window.location.hash.replace('#!', ''); - } else { - current = isLocation && window.location.pathname + window.location.search; - } - - if (current === ctx.canonicalPath) return; - page.stop(); - ctx.handled = false; - isLocation && (window.location.href = ctx.canonicalPath); - } - - /** - * Escapes RegExp characters in the given string. - * - * @param {string} s - * @api private - */ - function escapeRegExp(s) { - return s.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1'); - } - - /** - * Initialize a new "request" `Context` - * with the given `path` and optional initial `state`. - * - * @constructor - * @param {string} path - * @param {Object=} state - * @api public - */ - - function Context(path, state, pageInstance) { - var _page = this.page = pageInstance || page$1; - var window = _page._window; - var hashbang = _page._hashbang; - - var pageBase = _page._getBase(); - if ('/' === path[0] && 0 !== path.indexOf(pageBase)) path = pageBase + (hashbang ? '#!' : '') + path; - var i = path.indexOf('?'); - - this.canonicalPath = path; - var re = new RegExp('^' + escapeRegExp(pageBase)); - this.path = path.replace(re, '') || '/'; - if (hashbang) this.path = this.path.replace('#!', '') || '/'; - - this.title = (hasDocument && window.document.title); - this.state = state || {}; - this.state.path = path; - this.querystring = ~i ? _page._decodeURLEncodedURIComponent(path.slice(i + 1)) : ''; - this.pathname = _page._decodeURLEncodedURIComponent(~i ? path.slice(0, i) : path); - this.params = {}; - - // fragment - this.hash = ''; - if (!hashbang) { - if (!~this.path.indexOf('#')) return; - var parts = this.path.split('#'); - this.path = this.pathname = parts[0]; - this.hash = _page._decodeURLEncodedURIComponent(parts[1]) || ''; - this.querystring = this.querystring.split('#')[0]; - } - } - - /** - * Push state. - * - * @api private - */ - - Context.prototype.pushState = function() { - var page = this.page; - var window = page._window; - var hashbang = page._hashbang; - - page.len++; - if (hasHistory) { - window.history.pushState(this.state, this.title, - hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); - } - }; - - /** - * Save the context state. - * - * @api public - */ - - Context.prototype.save = function() { - var page = this.page; - if (hasHistory) { - page._window.history.replaceState(this.state, this.title, - page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); - } - }; - - /** - * Initialize `Route` with the given HTTP `path`, - * and an array of `callbacks` and `options`. - * - * Options: - * - * - `sensitive` enable case-sensitive routes - * - `strict` enable strict matching for trailing slashes - * - * @constructor - * @param {string} path - * @param {Object=} options - * @api private - */ - - function Route$2(path, options, page) { - var _page = this.page = page || globalPage; - var opts = options || {}; - opts.strict = opts.strict || _page._strict; - this.path = (path === '*') ? '(.*)' : path; - this.method = 'GET'; - this.regexp = pathToRegexp_1(this.path, this.keys = [], opts); - } - - /** - * Return route middleware with - * the given callback `fn()`. - * - * @param {Function} fn - * @return {Function} - * @api public - */ - - Route$2.prototype.middleware = function(fn) { - var self = this; - return function(ctx, next) { - if (self.match(ctx.path, ctx.params)) { - ctx.routePath = self.path; - return fn(ctx, next); - } - next(); - }; - }; - - /** - * Check if this route matches `path`, if so - * populate `params`. - * - * @param {string} path - * @param {Object} params - * @return {boolean} - * @api private - */ - - Route$2.prototype.match = function(path, params) { - var keys = this.keys, - qsIndex = path.indexOf('?'), - pathname = ~qsIndex ? path.slice(0, qsIndex) : path, - m = this.regexp.exec(decodeURIComponent(pathname)); - - if (!m) return false; - - delete params[0]; - - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - var val = this.page._decodeURLEncodedURIComponent(m[i]); - if (val !== undefined || !(hasOwnProperty.call(params, key.name))) { - params[key.name] = val; - } - } - - return true; - }; - - - /** - * Module exports. - */ - - var globalPage = createPage(); - var page_js = globalPage; - var default_1 = globalPage; - -page_js.default = default_1; - -var page$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': page_js -}); - -var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(page$2); - -var pluralize$2 = {exports: {}}; - -/* global define */ - -(function (module, exports) { -(function (root, pluralize) { - /* istanbul ignore else */ - if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { - // Node. - module.exports = pluralize(); - } else { - // Browser global. - root.pluralize = pluralize(); - } -})(commonjsGlobal, function () { - // Rule storage - pluralize and singularize need to be run sequentially, - // while other rules can be optimized using an object for instant lookups. - var pluralRules = []; - var singularRules = []; - var uncountables = {}; - var irregularPlurals = {}; - var irregularSingles = {}; - - /** - * Sanitize a pluralization rule to a usable regular expression. - * - * @param {(RegExp|string)} rule - * @return {RegExp} - */ - function sanitizeRule (rule) { - if (typeof rule === 'string') { - return new RegExp('^' + rule + '$', 'i'); - } - - return rule; - } - - /** - * Pass in a word token to produce a function that can replicate the case on - * another word. - * - * @param {string} word - * @param {string} token - * @return {Function} - */ - function restoreCase (word, token) { - // Tokens are an exact match. - if (word === token) return token; - - // Upper cased words. E.g. "HELLO". - if (word === word.toUpperCase()) return token.toUpperCase(); - - // Title cased words. E.g. "Title". - if (word[0] === word[0].toUpperCase()) { - return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); - } - - // Lower cased words. E.g. "test". - return token.toLowerCase(); - } - - /** - * Interpolate a regexp string. - * - * @param {string} str - * @param {Array} args - * @return {string} - */ - function interpolate (str, args) { - return str.replace(/\$(\d{1,2})/g, function (match, index) { - return args[index] || ''; - }); - } - - /** - * Replace a word using a rule. - * - * @param {string} word - * @param {Array} rule - * @return {string} - */ - function replace (word, rule) { - return word.replace(rule[0], function (match, index) { - var result = interpolate(rule[1], arguments); - - if (match === '') { - return restoreCase(word[index - 1], result); - } - - return restoreCase(match, result); - }); - } - - /** - * Sanitize a word by passing in the word and sanitization rules. - * - * @param {string} token - * @param {string} word - * @param {Array} rules - * @return {string} - */ - function sanitizeWord (token, word, rules) { - // Empty string or doesn't need fixing. - if (!token.length || uncountables.hasOwnProperty(token)) { - return word; - } - - var len = rules.length; - - // Iterate over the sanitization rules and use the first one to match. - while (len--) { - var rule = rules[len]; - - if (rule[0].test(word)) return replace(word, rule); - } - - return word; - } - - /** - * Replace a word with the updated word. - * - * @param {Object} replaceMap - * @param {Object} keepMap - * @param {Array} rules - * @return {Function} - */ - function replaceWord (replaceMap, keepMap, rules) { - return function (word) { - // Get the correct token and case restoration functions. - var token = word.toLowerCase(); - - // Check against the keep object map. - if (keepMap.hasOwnProperty(token)) { - return restoreCase(word, token); - } - - // Check against the replacement map for a direct word replacement. - if (replaceMap.hasOwnProperty(token)) { - return restoreCase(word, replaceMap[token]); - } - - // Run all the rules against the word. - return sanitizeWord(token, word, rules); - }; - } - - /** - * Check if a word is part of the map. - */ - function checkWord (replaceMap, keepMap, rules, bool) { - return function (word) { - var token = word.toLowerCase(); - - if (keepMap.hasOwnProperty(token)) return true; - if (replaceMap.hasOwnProperty(token)) return false; - - return sanitizeWord(token, token, rules) === token; - }; - } - - /** - * Pluralize or singularize a word based on the passed in count. - * - * @param {string} word - * @param {number} count - * @param {boolean} inclusive - * @return {string} - */ - function pluralize (word, count, inclusive) { - var pluralized = count === 1 - ? pluralize.singular(word) : pluralize.plural(word); - - return (inclusive ? count + ' ' : '') + pluralized; - } - - /** - * Pluralize a word. - * - * @type {Function} - */ - pluralize.plural = replaceWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Check if a word is plural. - * - * @type {Function} - */ - pluralize.isPlural = checkWord( - irregularSingles, irregularPlurals, pluralRules - ); - - /** - * Singularize a word. - * - * @type {Function} - */ - pluralize.singular = replaceWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Check if a word is singular. - * - * @type {Function} - */ - pluralize.isSingular = checkWord( - irregularPlurals, irregularSingles, singularRules - ); - - /** - * Add a pluralization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addPluralRule = function (rule, replacement) { - pluralRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add a singularization rule to the collection. - * - * @param {(string|RegExp)} rule - * @param {string} replacement - */ - pluralize.addSingularRule = function (rule, replacement) { - singularRules.push([sanitizeRule(rule), replacement]); - }; - - /** - * Add an uncountable word rule. - * - * @param {(string|RegExp)} word - */ - pluralize.addUncountableRule = function (word) { - if (typeof word === 'string') { - uncountables[word.toLowerCase()] = true; - return; - } - - // Set singular and plural references for the word. - pluralize.addPluralRule(word, '$0'); - pluralize.addSingularRule(word, '$0'); - }; - - /** - * Add an irregular word definition. - * - * @param {string} single - * @param {string} plural - */ - pluralize.addIrregularRule = function (single, plural) { - plural = plural.toLowerCase(); - single = single.toLowerCase(); - - irregularSingles[single] = plural; - irregularPlurals[plural] = single; - }; - - /** - * Irregular rules. - */ - [ - // Pronouns. - ['I', 'we'], - ['me', 'us'], - ['he', 'they'], - ['she', 'they'], - ['them', 'them'], - ['myself', 'ourselves'], - ['yourself', 'yourselves'], - ['itself', 'themselves'], - ['herself', 'themselves'], - ['himself', 'themselves'], - ['themself', 'themselves'], - ['is', 'are'], - ['was', 'were'], - ['has', 'have'], - ['this', 'these'], - ['that', 'those'], - // Words ending in with a consonant and `o`. - ['echo', 'echoes'], - ['dingo', 'dingoes'], - ['volcano', 'volcanoes'], - ['tornado', 'tornadoes'], - ['torpedo', 'torpedoes'], - // Ends with `us`. - ['genus', 'genera'], - ['viscus', 'viscera'], - // Ends with `ma`. - ['stigma', 'stigmata'], - ['stoma', 'stomata'], - ['dogma', 'dogmata'], - ['lemma', 'lemmata'], - ['schema', 'schemata'], - ['anathema', 'anathemata'], - // Other irregular rules. - ['ox', 'oxen'], - ['axe', 'axes'], - ['die', 'dice'], - ['yes', 'yeses'], - ['foot', 'feet'], - ['eave', 'eaves'], - ['goose', 'geese'], - ['tooth', 'teeth'], - ['quiz', 'quizzes'], - ['human', 'humans'], - ['proof', 'proofs'], - ['carve', 'carves'], - ['valve', 'valves'], - ['looey', 'looies'], - ['thief', 'thieves'], - ['groove', 'grooves'], - ['pickaxe', 'pickaxes'], - ['whiskey', 'whiskies'] - ].forEach(function (rule) { - return pluralize.addIrregularRule(rule[0], rule[1]); - }); - - /** - * Pluralization rules. - */ - [ - [/s?$/i, 's'], - [/[^\u0000-\u007F]$/i, '$0'], - [/([^aeiou]ese)$/i, '$1'], - [/(ax|test)is$/i, '$1es'], - [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'], - [/(e[mn]u)s?$/i, '$1s'], - [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], - [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], - [/(seraph|cherub)(?:im)?$/i, '$1im'], - [/(her|at|gr)o$/i, '$1oes'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], - [/sis$/i, 'ses'], - [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], - [/([^aeiouy]|qu)y$/i, '$1ies'], - [/([^ch][ieo][ln])ey$/i, '$1ies'], - [/(x|ch|ss|sh|zz)$/i, '$1es'], - [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], - [/(m|l)(?:ice|ouse)$/i, '$1ice'], - [/(pe)(?:rson|ople)$/i, '$1ople'], - [/(child)(?:ren)?$/i, '$1ren'], - [/eaux$/i, '$0'], - [/m[ae]n$/i, 'men'], - ['thou', 'you'] - ].forEach(function (rule) { - return pluralize.addPluralRule(rule[0], rule[1]); - }); - - /** - * Singularization rules. - */ - [ - [/s$/i, ''], - [/(ss)$/i, '$1'], - [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], - [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], - [/ies$/i, 'y'], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'], - [/\b(mon|smil)ies$/i, '$1ey'], - [/(m|l)ice$/i, '$1ouse'], - [/(seraph|cherub)im$/i, '$1'], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'], - [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'], - [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'], - [/(test)(?:is|es)$/i, '$1is'], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], - [/(alumn|alg|vertebr)ae$/i, '$1a'], - [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], - [/(matr|append)ices$/i, '$1ix'], - [/(pe)(rson|ople)$/i, '$1rson'], - [/(child)ren$/i, '$1'], - [/(eau)x?$/i, '$1'], - [/men$/i, 'man'] - ].forEach(function (rule) { - return pluralize.addSingularRule(rule[0], rule[1]); - }); - - /** - * Uncountable rules. - */ - [ - // Singular words with no plurals. - 'adulthood', - 'advice', - 'agenda', - 'aid', - 'alcohol', - 'ammo', - 'anime', - 'athletics', - 'audio', - 'bison', - 'blood', - 'bream', - 'buffalo', - 'butter', - 'carp', - 'cash', - 'chassis', - 'chess', - 'clothing', - 'cod', - 'commerce', - 'cooperation', - 'corps', - 'debris', - 'diabetes', - 'digestion', - 'elk', - 'energy', - 'equipment', - 'excretion', - 'expertise', - 'flounder', - 'fun', - 'gallows', - 'garbage', - 'graffiti', - 'headquarters', - 'health', - 'herpes', - 'highjinks', - 'homework', - 'housework', - 'information', - 'jeans', - 'justice', - 'kudos', - 'labour', - 'literature', - 'machinery', - 'mackerel', - 'mail', - 'media', - 'mews', - 'moose', - 'music', - 'manga', - 'news', - 'pike', - 'plankton', - 'pliers', - 'pollution', - 'premises', - 'rain', - 'research', - 'rice', - 'salmon', - 'scissors', - 'series', - 'sewage', - 'shambles', - 'shrimp', - 'species', - 'staff', - 'swine', - 'tennis', - 'traffic', - 'transporation', - 'trout', - 'tuna', - 'wealth', - 'welfare', - 'whiting', - 'wildebeest', - 'wildlife', - 'you', - // Regexes. - /[^aeiou]ese$/i, // "chinese", "japanese" - /deer$/i, // "deer", "reindeer" - /fish$/i, // "fish", "blowfish", "angelfish" - /measles$/i, - /o[iu]s$/i, // "carnivorous" - /pox$/i, // "chickpox", "smallpox" - /sheep$/i - ].forEach(pluralize.addUncountableRule); - - return pluralize; -}); -}(pluralize$2)); - -var js = {exports: {}}; - -var src = {}; - -var javascript = {exports: {}}; - -var beautifier$2 = {}; - -var output$1 = {}; - -/*jshint node:true */ - -function OutputLine(parent) { - this.__parent = parent; - this.__character_count = 0; - // use indent_count as a marker for this.__lines that have preserved indentation - this.__indent_count = -1; - this.__alignment_count = 0; - this.__wrap_point_index = 0; - this.__wrap_point_character_count = 0; - this.__wrap_point_indent_count = -1; - this.__wrap_point_alignment_count = 0; - - this.__items = []; -} - -OutputLine.prototype.clone_empty = function() { - var line = new OutputLine(this.__parent); - line.set_indent(this.__indent_count, this.__alignment_count); - return line; -}; - -OutputLine.prototype.item = function(index) { - if (index < 0) { - return this.__items[this.__items.length + index]; - } else { - return this.__items[index]; - } -}; - -OutputLine.prototype.has_match = function(pattern) { - for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) { - if (this.__items[lastCheckedOutput].match(pattern)) { - return true; - } - } - return false; -}; - -OutputLine.prototype.set_indent = function(indent, alignment) { - if (this.is_empty()) { - this.__indent_count = indent || 0; - this.__alignment_count = alignment || 0; - this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count); - } -}; - -OutputLine.prototype._set_wrap_point = function() { - if (this.__parent.wrap_line_length) { - this.__wrap_point_index = this.__items.length; - this.__wrap_point_character_count = this.__character_count; - this.__wrap_point_indent_count = this.__parent.next_line.__indent_count; - this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count; - } -}; - -OutputLine.prototype._should_wrap = function() { - return this.__wrap_point_index && - this.__character_count > this.__parent.wrap_line_length && - this.__wrap_point_character_count > this.__parent.next_line.__character_count; -}; - -OutputLine.prototype._allow_wrap = function() { - if (this._should_wrap()) { - this.__parent.add_new_line(); - var next = this.__parent.current_line; - next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count); - next.__items = this.__items.slice(this.__wrap_point_index); - this.__items = this.__items.slice(0, this.__wrap_point_index); - - next.__character_count += this.__character_count - this.__wrap_point_character_count; - this.__character_count = this.__wrap_point_character_count; - - if (next.__items[0] === " ") { - next.__items.splice(0, 1); - next.__character_count -= 1; - } - return true; - } - return false; -}; - -OutputLine.prototype.is_empty = function() { - return this.__items.length === 0; -}; - -OutputLine.prototype.last = function() { - if (!this.is_empty()) { - return this.__items[this.__items.length - 1]; - } else { - return null; - } -}; - -OutputLine.prototype.push = function(item) { - this.__items.push(item); - var last_newline_index = item.lastIndexOf('\n'); - if (last_newline_index !== -1) { - this.__character_count = item.length - last_newline_index; - } else { - this.__character_count += item.length; - } -}; - -OutputLine.prototype.pop = function() { - var item = null; - if (!this.is_empty()) { - item = this.__items.pop(); - this.__character_count -= item.length; - } - return item; -}; - - -OutputLine.prototype._remove_indent = function() { - if (this.__indent_count > 0) { - this.__indent_count -= 1; - this.__character_count -= this.__parent.indent_size; - } -}; - -OutputLine.prototype._remove_wrap_indent = function() { - if (this.__wrap_point_indent_count > 0) { - this.__wrap_point_indent_count -= 1; - } -}; -OutputLine.prototype.trim = function() { - while (this.last() === ' ') { - this.__items.pop(); - this.__character_count -= 1; - } -}; - -OutputLine.prototype.toString = function() { - var result = ''; - if (this.is_empty()) { - if (this.__parent.indent_empty_lines) { - result = this.__parent.get_indent_string(this.__indent_count); - } - } else { - result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count); - result += this.__items.join(''); - } - return result; -}; - -function IndentStringCache(options, baseIndentString) { - this.__cache = ['']; - this.__indent_size = options.indent_size; - this.__indent_string = options.indent_char; - if (!options.indent_with_tabs) { - this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char); - } - - // Set to null to continue support for auto detection of base indent - baseIndentString = baseIndentString || ''; - if (options.indent_level > 0) { - baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string); - } - - this.__base_string = baseIndentString; - this.__base_string_length = baseIndentString.length; -} - -IndentStringCache.prototype.get_indent_size = function(indent, column) { - var result = this.__base_string_length; - column = column || 0; - if (indent < 0) { - result = 0; - } - result += indent * this.__indent_size; - result += column; - return result; -}; - -IndentStringCache.prototype.get_indent_string = function(indent_level, column) { - var result = this.__base_string; - column = column || 0; - if (indent_level < 0) { - indent_level = 0; - result = ''; - } - column += indent_level * this.__indent_size; - this.__ensure_cache(column); - result += this.__cache[column]; - return result; -}; - -IndentStringCache.prototype.__ensure_cache = function(column) { - while (column >= this.__cache.length) { - this.__add_column(); - } -}; - -IndentStringCache.prototype.__add_column = function() { - var column = this.__cache.length; - var indent = 0; - var result = ''; - if (this.__indent_size && column >= this.__indent_size) { - indent = Math.floor(column / this.__indent_size); - column -= indent * this.__indent_size; - result = new Array(indent + 1).join(this.__indent_string); - } - if (column) { - result += new Array(column + 1).join(' '); - } - - this.__cache.push(result); -}; - -function Output$c(options, baseIndentString) { - this.__indent_cache = new IndentStringCache(options, baseIndentString); - this.raw = false; - this._end_with_newline = options.end_with_newline; - this.indent_size = options.indent_size; - this.wrap_line_length = options.wrap_line_length; - this.indent_empty_lines = options.indent_empty_lines; - this.__lines = []; - this.previous_line = null; - this.current_line = null; - this.next_line = new OutputLine(this); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; - // initialize - this.__add_outputline(); -} - -Output$c.prototype.__add_outputline = function() { - this.previous_line = this.current_line; - this.current_line = this.next_line.clone_empty(); - this.__lines.push(this.current_line); -}; - -Output$c.prototype.get_line_number = function() { - return this.__lines.length; -}; - -Output$c.prototype.get_indent_string = function(indent, column) { - return this.__indent_cache.get_indent_string(indent, column); -}; - -Output$c.prototype.get_indent_size = function(indent, column) { - return this.__indent_cache.get_indent_size(indent, column); -}; - -Output$c.prototype.is_empty = function() { - return !this.previous_line && this.current_line.is_empty(); -}; - -Output$c.prototype.add_new_line = function(force_newline) { - // never newline at the start of file - // otherwise, newline only if we didn't just add one or we're forced - if (this.is_empty() || - (!force_newline && this.just_added_newline())) { - return false; - } - - // if raw output is enabled, don't print additional newlines, - // but still return True as though you had - if (!this.raw) { - this.__add_outputline(); - } - return true; -}; - -Output$c.prototype.get_code = function(eol) { - this.trim(true); - - // handle some edge cases where the last tokens - // has text that ends with newline(s) - var last_item = this.current_line.pop(); - if (last_item) { - if (last_item[last_item.length - 1] === '\n') { - last_item = last_item.replace(/\n+$/g, ''); - } - this.current_line.push(last_item); - } - - if (this._end_with_newline) { - this.__add_outputline(); - } - - var sweet_code = this.__lines.join('\n'); - - if (eol !== '\n') { - sweet_code = sweet_code.replace(/[\n]/g, eol); - } - return sweet_code; -}; - -Output$c.prototype.set_wrap_point = function() { - this.current_line._set_wrap_point(); -}; - -Output$c.prototype.set_indent = function(indent, alignment) { - indent = indent || 0; - alignment = alignment || 0; - - // Next line stores alignment values - this.next_line.set_indent(indent, alignment); - - // Never indent your first output indent at the start of the file - if (this.__lines.length > 1) { - this.current_line.set_indent(indent, alignment); - return true; - } - - this.current_line.set_indent(); - return false; -}; - -Output$c.prototype.add_raw_token = function(token) { - for (var x = 0; x < token.newlines; x++) { - this.__add_outputline(); - } - this.current_line.set_indent(-1); - this.current_line.push(token.whitespace_before); - this.current_line.push(token.text); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; -}; - -Output$c.prototype.add_token = function(printable_token) { - this.__add_space_before_token(); - this.current_line.push(printable_token); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = this.current_line._allow_wrap(); -}; - -Output$c.prototype.__add_space_before_token = function() { - if (this.space_before_token && !this.just_added_newline()) { - if (!this.non_breaking_space) { - this.set_wrap_point(); - } - this.current_line.push(' '); - } -}; - -Output$c.prototype.remove_indent = function(index) { - var output_length = this.__lines.length; - while (index < output_length) { - this.__lines[index]._remove_indent(); - index++; - } - this.current_line._remove_wrap_indent(); -}; - -Output$c.prototype.trim = function(eat_newlines) { - eat_newlines = (eat_newlines === undefined) ? false : eat_newlines; - - this.current_line.trim(); - - while (eat_newlines && this.__lines.length > 1 && - this.current_line.is_empty()) { - this.__lines.pop(); - this.current_line = this.__lines[this.__lines.length - 1]; - this.current_line.trim(); - } - - this.previous_line = this.__lines.length > 1 ? - this.__lines[this.__lines.length - 2] : null; -}; - -Output$c.prototype.just_added_newline = function() { - return this.current_line.is_empty(); -}; - -Output$c.prototype.just_added_blankline = function() { - return this.is_empty() || - (this.current_line.is_empty() && this.previous_line.is_empty()); -}; - -Output$c.prototype.ensure_empty_line_above = function(starts_with, ends_with) { - var index = this.__lines.length - 2; - while (index >= 0) { - var potentialEmptyLine = this.__lines[index]; - if (potentialEmptyLine.is_empty()) { - break; - } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && - potentialEmptyLine.item(-1) !== ends_with) { - this.__lines.splice(index + 1, 0, new OutputLine(this)); - this.previous_line = this.__lines[this.__lines.length - 2]; - break; - } - index--; - } -}; - -output$1.Output = Output$c; - -var token = {}; - -/*jshint node:true */ - -function Token$2(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; -} - - -token.Token = Token$2; - -var acorn$2 = {}; - -/* jshint node: true, curly: false */ - -(function (exports) { - -// acorn used char codes to squeeze the last bit of performance out -// Beautifier is okay without that, so we're using regex -// permit # (23), $ (36), and @ (64). @ is used in ES7 decorators. -// 65 through 91 are uppercase letters. -// permit _ (95). -// 97 through 123 are lowercase letters. -var baseASCIIidentifierStartChars = "\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"; - -// inside an identifier @ is not allowed but 0-9 are. -var baseASCIIidentifierChars = "\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a"; - -// Big ugly regular expressions that match characters in the -// whitespace, identifier, and identifier-start categories. These -// are only applied when a character is found to actually have a -// code point above 128. -var nonASCIIidentifierStartChars = "\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc"; -var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f"; -//var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -//var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - -var identifierStart = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; -var identifierChars = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; - -exports.identifier = new RegExp(identifierStart + identifierChars, 'g'); -exports.identifierStart = new RegExp(identifierStart); -exports.identifierMatch = new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); - -// Whether a single character denotes a newline. - -exports.newline = /[\n\r\u2028\u2029]/; - -// Matches a whole line break (where CRLF is considered a single -// line break). Used to count lines. - -// in javascript, these two differ -// in python they are the same, different methods are called on them -exports.lineBreak = new RegExp('\r\n|' + exports.newline.source); -exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); -}(acorn$2)); - -var options$4 = {}; - -var options$3 = {}; - -/*jshint node:true */ - -function Options$9(options, merge_child_field) { - this.raw_options = _mergeOpts(options, merge_child_field); - - // Support passing the source text back with no change - this.disabled = this._get_boolean('disabled'); - - this.eol = this._get_characters('eol', 'auto'); - this.end_with_newline = this._get_boolean('end_with_newline'); - this.indent_size = this._get_number('indent_size', 4); - this.indent_char = this._get_characters('indent_char', ' '); - this.indent_level = this._get_number('indent_level'); - - this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); - if (!this.preserve_newlines) { - this.max_preserve_newlines = 0; - } - - this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t'); - if (this.indent_with_tabs) { - this.indent_char = '\t'; - - // indent_size behavior changed after 1.8.6 - // It used to be that indent_size would be - // set to 1 for indent_with_tabs. That is no longer needed and - // actually doesn't make sense - why not use spaces? Further, - // that might produce unexpected behavior - tabs being used - // for single-column alignment. So, when indent_with_tabs is true - // and indent_size is 1, reset indent_size to 4. - if (this.indent_size === 1) { - this.indent_size = 4; - } - } - - // Backwards compat with 1.3.x - this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); - - this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - - // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] - // For now, 'auto' = all off for javascript, all on for html (and inline javascript). - // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); -} - -Options$9.prototype._get_array = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || []; - if (typeof option_value === 'object') { - if (option_value !== null && typeof option_value.concat === 'function') { - result = option_value.concat(); - } - } else if (typeof option_value === 'string') { - result = option_value.split(/[^a-zA-Z0-9_\/\-]+/); - } - return result; -}; - -Options$9.prototype._get_boolean = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = option_value === undefined ? !!default_value : !!option_value; - return result; -}; - -Options$9.prototype._get_characters = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || ''; - if (typeof option_value === 'string') { - result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t'); - } - return result; -}; - -Options$9.prototype._get_number = function(name, default_value) { - var option_value = this.raw_options[name]; - default_value = parseInt(default_value, 10); - if (isNaN(default_value)) { - default_value = 0; - } - var result = parseInt(option_value, 10); - if (isNaN(result)) { - result = default_value; - } - return result; -}; - -Options$9.prototype._get_selection = function(name, selection_list, default_value) { - var result = this._get_selection_list(name, selection_list, default_value); - if (result.length !== 1) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result[0]; -}; - - -Options$9.prototype._get_selection_list = function(name, selection_list, default_value) { - if (!selection_list || selection_list.length === 0) { - throw new Error("Selection list cannot be empty."); - } - - default_value = default_value || [selection_list[0]]; - if (!this._is_valid_selection(default_value, selection_list)) { - throw new Error("Invalid Default Value!"); - } - - var result = this._get_array(name, default_value); - if (!this._is_valid_selection(result, selection_list)) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result; -}; - -Options$9.prototype._is_valid_selection = function(result, selection_list) { - return result.length && selection_list.length && - !result.some(function(item) { return selection_list.indexOf(item) === -1; }); -}; - - -// merges child options up with the parent options object -// Example: obj = {a: 1, b: {a: 2}} -// mergeOpts(obj, 'b') -// -// Returns: {a: 2} -function _mergeOpts(allOptions, childFieldName) { - var finalOpts = {}; - allOptions = _normalizeOpts(allOptions); - var name; - - for (name in allOptions) { - if (name !== childFieldName) { - finalOpts[name] = allOptions[name]; - } - } - - //merge in the per type settings for the childFieldName - if (childFieldName && allOptions[childFieldName]) { - for (name in allOptions[childFieldName]) { - finalOpts[name] = allOptions[childFieldName][name]; - } - } - return finalOpts; -} - -function _normalizeOpts(options) { - var convertedOpts = {}; - var key; - - for (key in options) { - var newKey = key.replace(/-/g, "_"); - convertedOpts[newKey] = options[key]; - } - return convertedOpts; -} - -options$3.Options = Options$9; -options$3.normalizeOpts = _normalizeOpts; -options$3.mergeOpts = _mergeOpts; - -/*jshint node:true */ - -var BaseOptions$2 = options$3.Options; - -var validPositionValues$1 = ['before-newline', 'after-newline', 'preserve-newline']; - -function Options$8(options) { - BaseOptions$2.call(this, options, 'js'); - - // compatibility, re - var raw_brace_style = this.raw_options.brace_style || null; - if (raw_brace_style === "expand-strict") { //graceful handling of deprecated option - this.raw_options.brace_style = "expand"; - } else if (raw_brace_style === "collapse-preserve-inline") { //graceful handling of deprecated option - this.raw_options.brace_style = "collapse,preserve-inline"; - } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option - this.raw_options.brace_style = this.raw_options.braces_on_own_line ? "expand" : "collapse"; - // } else if (!raw_brace_style) { //Nothing exists to set it - // raw_brace_style = "collapse"; - } - - //preserve-inline in delimited string will trigger brace_preserve_inline, everything - //else is considered a brace_style and the last one only will have an effect - - var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); - - this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option - this.brace_style = "collapse"; - - for (var bs = 0; bs < brace_style_split.length; bs++) { - if (brace_style_split[bs] === "preserve-inline") { - this.brace_preserve_inline = true; - } else { - this.brace_style = brace_style_split[bs]; - } - } - - this.unindent_chained_methods = this._get_boolean('unindent_chained_methods'); - this.break_chained_methods = this._get_boolean('break_chained_methods'); - this.space_in_paren = this._get_boolean('space_in_paren'); - this.space_in_empty_paren = this._get_boolean('space_in_empty_paren'); - this.jslint_happy = this._get_boolean('jslint_happy'); - this.space_after_anon_function = this._get_boolean('space_after_anon_function'); - this.space_after_named_function = this._get_boolean('space_after_named_function'); - this.keep_array_indentation = this._get_boolean('keep_array_indentation'); - this.space_before_conditional = this._get_boolean('space_before_conditional', true); - this.unescape_strings = this._get_boolean('unescape_strings'); - this.e4x = this._get_boolean('e4x'); - this.comma_first = this._get_boolean('comma_first'); - this.operator_position = this._get_selection('operator_position', validPositionValues$1); - - // For testing of beautify preserve:start directive - this.test_output_raw = this._get_boolean('test_output_raw'); - - // force this._options.space_after_anon_function to true if this._options.jslint_happy - if (this.jslint_happy) { - this.space_after_anon_function = true; - } - -} -Options$8.prototype = new BaseOptions$2(); - - - -options$4.Options = Options$8; - -var tokenizer$2 = {}; - -var inputscanner = {}; - -/*jshint node:true */ - -var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky'); - -function InputScanner$3(input_string) { - this.__input = input_string || ''; - this.__input_length = this.__input.length; - this.__position = 0; -} - -InputScanner$3.prototype.restart = function() { - this.__position = 0; -}; - -InputScanner$3.prototype.back = function() { - if (this.__position > 0) { - this.__position -= 1; - } -}; - -InputScanner$3.prototype.hasNext = function() { - return this.__position < this.__input_length; -}; - -InputScanner$3.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__input.charAt(this.__position); - this.__position += 1; - } - return val; -}; - -InputScanner$3.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__input_length) { - val = this.__input.charAt(index); - } - return val; -}; - -// This is a JavaScript only helper function (not in python) -// Javascript doesn't have a match method -// and not all implementation support "sticky" flag. -// If they do not support sticky then both this.match() and this.test() method -// must get the match and check the index of the match. -// If sticky is supported and set, this method will use it. -// Otherwise it will check that global is set, and fall back to the slower method. -InputScanner$3.prototype.__match = function(pattern, index) { - pattern.lastIndex = index; - var pattern_match = pattern.exec(this.__input); - - if (pattern_match && !(regexp_has_sticky && pattern.sticky)) { - if (pattern_match.index !== index) { - pattern_match = null; - } - } - - return pattern_match; -}; - -InputScanner$3.prototype.test = function(pattern, index) { - index = index || 0; - index += this.__position; - - if (index >= 0 && index < this.__input_length) { - return !!this.__match(pattern, index); - } else { - return false; - } -}; - -InputScanner$3.prototype.testChar = function(pattern, index) { - // test one character regex match - var val = this.peek(index); - pattern.lastIndex = 0; - return val !== null && pattern.test(val); -}; - -InputScanner$3.prototype.match = function(pattern) { - var pattern_match = this.__match(pattern, this.__position); - if (pattern_match) { - this.__position += pattern_match[0].length; - } else { - pattern_match = null; - } - return pattern_match; -}; - -InputScanner$3.prototype.read = function(starting_pattern, until_pattern, until_after) { - var val = ''; - var match; - if (starting_pattern) { - match = this.match(starting_pattern); - if (match) { - val += match[0]; - } - } - if (until_pattern && (match || !starting_pattern)) { - val += this.readUntil(until_pattern, until_after); - } - return val; -}; - -InputScanner$3.prototype.readUntil = function(pattern, until_after) { - var val = ''; - var match_index = this.__position; - pattern.lastIndex = this.__position; - var pattern_match = pattern.exec(this.__input); - if (pattern_match) { - match_index = pattern_match.index; - if (until_after) { - match_index += pattern_match[0].length; - } - } else { - match_index = this.__input_length; - } - - val = this.__input.substring(this.__position, match_index); - this.__position = match_index; - return val; -}; - -InputScanner$3.prototype.readUntilAfter = function(pattern) { - return this.readUntil(pattern, true); -}; - -InputScanner$3.prototype.get_regexp = function(pattern, match_from) { - var result = null; - var flags = 'g'; - if (match_from && regexp_has_sticky) { - flags = 'y'; - } - // strings are converted to regexp - if (typeof pattern === "string" && pattern !== '') { - // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags); - result = new RegExp(pattern, flags); - } else if (pattern) { - result = new RegExp(pattern.source, flags); - } - return result; -}; - -InputScanner$3.prototype.get_literal_regexp = function(literal_string) { - return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')); -}; - -/* css beautifier legacy helpers */ -InputScanner$3.prototype.peekUntilAfter = function(pattern) { - var start = this.__position; - var val = this.readUntilAfter(pattern); - this.__position = start; - return val; -}; - -InputScanner$3.prototype.lookBack = function(testVal) { - var start = this.__position - 1; - return start >= testVal.length && this.__input.substring(start - testVal.length, start) - .toLowerCase() === testVal; -}; - -inputscanner.InputScanner = InputScanner$3; - -var tokenizer$1 = {}; - -var tokenstream = {}; - -/*jshint node:true */ - -function TokenStream$1(parent_token) { - // private - this.__tokens = []; - this.__tokens_length = this.__tokens.length; - this.__position = 0; - this.__parent_token = parent_token; -} - -TokenStream$1.prototype.restart = function() { - this.__position = 0; -}; - -TokenStream$1.prototype.isEmpty = function() { - return this.__tokens_length === 0; -}; - -TokenStream$1.prototype.hasNext = function() { - return this.__position < this.__tokens_length; -}; - -TokenStream$1.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__tokens[this.__position]; - this.__position += 1; - } - return val; -}; - -TokenStream$1.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__tokens_length) { - val = this.__tokens[index]; - } - return val; -}; - -TokenStream$1.prototype.add = function(token) { - if (this.__parent_token) { - token.parent = this.__parent_token; - } - this.__tokens.push(token); - this.__tokens_length += 1; -}; - -tokenstream.TokenStream = TokenStream$1; - -var whitespacepattern = {}; - -var pattern = {}; - -/*jshint node:true */ - -function Pattern$4(input_scanner, parent) { - this._input = input_scanner; - this._starting_pattern = null; - this._match_pattern = null; - this._until_pattern = null; - this._until_after = false; - - if (parent) { - this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true); - this._match_pattern = this._input.get_regexp(parent._match_pattern, true); - this._until_pattern = this._input.get_regexp(parent._until_pattern); - this._until_after = parent._until_after; - } -} - -Pattern$4.prototype.read = function() { - var result = this._input.read(this._starting_pattern); - if (!this._starting_pattern || result) { - result += this._input.read(this._match_pattern, this._until_pattern, this._until_after); - } - return result; -}; - -Pattern$4.prototype.read_match = function() { - return this._input.match(this._match_pattern); -}; - -Pattern$4.prototype.until_after = function(pattern) { - var result = this._create(); - result._until_after = true; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; -}; - -Pattern$4.prototype.until = function(pattern) { - var result = this._create(); - result._until_after = false; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; -}; - -Pattern$4.prototype.starting_with = function(pattern) { - var result = this._create(); - result._starting_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; -}; - -Pattern$4.prototype.matching = function(pattern) { - var result = this._create(); - result._match_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; -}; - -Pattern$4.prototype._create = function() { - return new Pattern$4(this._input, this); -}; - -Pattern$4.prototype._update = function() {}; - -pattern.Pattern = Pattern$4; - -/*jshint node:true */ - -var Pattern$3 = pattern.Pattern; - -function WhitespacePattern$1(input_scanner, parent) { - Pattern$3.call(this, input_scanner, parent); - if (parent) { - this._line_regexp = this._input.get_regexp(parent._line_regexp); - } else { - this.__set_whitespace_patterns('', ''); - } - - this.newline_count = 0; - this.whitespace_before_token = ''; -} -WhitespacePattern$1.prototype = new Pattern$3(); - -WhitespacePattern$1.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) { - whitespace_chars += '\\t '; - newline_chars += '\\n\\r'; - - this._match_pattern = this._input.get_regexp( - '[' + whitespace_chars + newline_chars + ']+', true); - this._newline_regexp = this._input.get_regexp( - '\\r\\n|[' + newline_chars + ']'); -}; - -WhitespacePattern$1.prototype.read = function() { - this.newline_count = 0; - this.whitespace_before_token = ''; - - var resulting_string = this._input.read(this._match_pattern); - if (resulting_string === ' ') { - this.whitespace_before_token = ' '; - } else if (resulting_string) { - var matches = this.__split(this._newline_regexp, resulting_string); - this.newline_count = matches.length - 1; - this.whitespace_before_token = matches[this.newline_count]; - } - - return resulting_string; -}; - -WhitespacePattern$1.prototype.matching = function(whitespace_chars, newline_chars) { - var result = this._create(); - result.__set_whitespace_patterns(whitespace_chars, newline_chars); - result._update(); - return result; -}; - -WhitespacePattern$1.prototype._create = function() { - return new WhitespacePattern$1(this._input, this); -}; - -WhitespacePattern$1.prototype.__split = function(regexp, input_string) { - regexp.lastIndex = 0; - var start_index = 0; - var result = []; - var next_match = regexp.exec(input_string); - while (next_match) { - result.push(input_string.substring(start_index, next_match.index)); - start_index = next_match.index + next_match[0].length; - next_match = regexp.exec(input_string); - } - - if (start_index < input_string.length) { - result.push(input_string.substring(start_index, input_string.length)); - } else { - result.push(''); - } - - return result; -}; - - - -whitespacepattern.WhitespacePattern = WhitespacePattern$1; - -/*jshint node:true */ - -var InputScanner$2 = inputscanner.InputScanner; -var Token$1 = token.Token; -var TokenStream = tokenstream.TokenStream; -var WhitespacePattern = whitespacepattern.WhitespacePattern; - -var TOKEN$4 = { - START: 'TK_START', - RAW: 'TK_RAW', - EOF: 'TK_EOF' -}; - -var Tokenizer$4 = function(input_string, options) { - this._input = new InputScanner$2(input_string); - this._options = options || {}; - this.__tokens = null; - - this._patterns = {}; - this._patterns.whitespace = new WhitespacePattern(this._input); -}; - -Tokenizer$4.prototype.tokenize = function() { - this._input.restart(); - this.__tokens = new TokenStream(); - - this._reset(); - - var current; - var previous = new Token$1(TOKEN$4.START, ''); - var open_token = null; - var open_stack = []; - var comments = new TokenStream(); - - while (previous.type !== TOKEN$4.EOF) { - current = this._get_next_token(previous, open_token); - while (this._is_comment(current)) { - comments.add(current); - current = this._get_next_token(previous, open_token); - } - - if (!comments.isEmpty()) { - current.comments_before = comments; - comments = new TokenStream(); - } - - current.parent = open_token; - - if (this._is_opening(current)) { - open_stack.push(open_token); - open_token = current; - } else if (open_token && this._is_closing(current, open_token)) { - current.opened = open_token; - open_token.closed = current; - open_token = open_stack.pop(); - current.parent = open_token; - } - - current.previous = previous; - previous.next = current; - - this.__tokens.add(current); - previous = current; - } - - return this.__tokens; -}; - - -Tokenizer$4.prototype._is_first_token = function() { - return this.__tokens.isEmpty(); -}; - -Tokenizer$4.prototype._reset = function() {}; - -Tokenizer$4.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - this._readWhitespace(); - var resulting_string = this._input.read(/.+/g); - if (resulting_string) { - return this._create_token(TOKEN$4.RAW, resulting_string); - } else { - return this._create_token(TOKEN$4.EOF, ''); - } -}; - -Tokenizer$4.prototype._is_comment = function(current_token) { // jshint unused:false - return false; -}; - -Tokenizer$4.prototype._is_opening = function(current_token) { // jshint unused:false - return false; -}; - -Tokenizer$4.prototype._is_closing = function(current_token, open_token) { // jshint unused:false - return false; -}; - -Tokenizer$4.prototype._create_token = function(type, text) { - var token = new Token$1(type, text, - this._patterns.whitespace.newline_count, - this._patterns.whitespace.whitespace_before_token); - return token; -}; - -Tokenizer$4.prototype._readWhitespace = function() { - return this._patterns.whitespace.read(); -}; - - - -tokenizer$1.Tokenizer = Tokenizer$4; -tokenizer$1.TOKEN = TOKEN$4; - -var directives = {}; - -/*jshint node:true */ - -function Directives$3(start_block_pattern, end_block_pattern) { - start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source; - end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source; - this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g'); - this.__directive_pattern = / (\w+)[:](\w+)/g; - - this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g'); -} - -Directives$3.prototype.get_directives = function(text) { - if (!text.match(this.__directives_block_pattern)) { - return null; - } - - var directives = {}; - this.__directive_pattern.lastIndex = 0; - var directive_match = this.__directive_pattern.exec(text); - - while (directive_match) { - directives[directive_match[1]] = directive_match[2]; - directive_match = this.__directive_pattern.exec(text); - } - - return directives; -}; - -Directives$3.prototype.readIgnored = function(input) { - return input.readUntilAfter(this.__directives_end_ignore_pattern); -}; - - -directives.Directives = Directives$3; - -var templatablepattern = {}; - -/*jshint node:true */ - -var Pattern$2 = pattern.Pattern; - - -var template_names = { - django: false, - erb: false, - handlebars: false, - php: false, - smarty: false -}; - -// This lets templates appear anywhere we would do a readUntil -// The cost is higher but it is pay to play. -function TemplatablePattern$2(input_scanner, parent) { - Pattern$2.call(this, input_scanner, parent); - this.__template_pattern = null; - this._disabled = Object.assign({}, template_names); - this._excluded = Object.assign({}, template_names); - - if (parent) { - this.__template_pattern = this._input.get_regexp(parent.__template_pattern); - this._excluded = Object.assign(this._excluded, parent._excluded); - this._disabled = Object.assign(this._disabled, parent._disabled); - } - var pattern = new Pattern$2(input_scanner); - this.__patterns = { - handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/), - handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/), - handlebars: pattern.starting_with(/{{/).until_after(/}}/), - php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/), - erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/), - // django coflicts with handlebars a bit. - django: pattern.starting_with(/{%/).until_after(/%}/), - django_value: pattern.starting_with(/{{/).until_after(/}}/), - django_comment: pattern.starting_with(/{#/).until_after(/#}/), - smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/), - smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/), - smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/) - }; -} -TemplatablePattern$2.prototype = new Pattern$2(); - -TemplatablePattern$2.prototype._create = function() { - return new TemplatablePattern$2(this._input, this); -}; - -TemplatablePattern$2.prototype._update = function() { - this.__set_templated_pattern(); -}; - -TemplatablePattern$2.prototype.disable = function(language) { - var result = this._create(); - result._disabled[language] = true; - result._update(); - return result; -}; - -TemplatablePattern$2.prototype.read_options = function(options) { - var result = this._create(); - for (var language in template_names) { - result._disabled[language] = options.templating.indexOf(language) === -1; - } - result._update(); - return result; -}; - -TemplatablePattern$2.prototype.exclude = function(language) { - var result = this._create(); - result._excluded[language] = true; - result._update(); - return result; -}; - -TemplatablePattern$2.prototype.read = function() { - var result = ''; - if (this._match_pattern) { - result = this._input.read(this._starting_pattern); - } else { - result = this._input.read(this._starting_pattern, this.__template_pattern); - } - var next = this._read_template(); - while (next) { - if (this._match_pattern) { - next += this._input.read(this._match_pattern); - } else { - next += this._input.readUntil(this.__template_pattern); - } - result += next; - next = this._read_template(); - } - - if (this._until_after) { - result += this._input.readUntilAfter(this._until_pattern); - } - return result; -}; - -TemplatablePattern$2.prototype.__set_templated_pattern = function() { - var items = []; - - if (!this._disabled.php) { - items.push(this.__patterns.php._starting_pattern.source); - } - if (!this._disabled.handlebars) { - items.push(this.__patterns.handlebars._starting_pattern.source); - } - if (!this._disabled.erb) { - items.push(this.__patterns.erb._starting_pattern.source); - } - if (!this._disabled.django) { - items.push(this.__patterns.django._starting_pattern.source); - // The starting pattern for django is more complex because it has different - // patterns for value, comment, and other sections - items.push(this.__patterns.django_value._starting_pattern.source); - items.push(this.__patterns.django_comment._starting_pattern.source); - } - if (!this._disabled.smarty) { - items.push(this.__patterns.smarty._starting_pattern.source); - } - - if (this._until_pattern) { - items.push(this._until_pattern.source); - } - this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')'); -}; - -TemplatablePattern$2.prototype._read_template = function() { - var resulting_string = ''; - var c = this._input.peek(); - if (c === '<') { - var peek1 = this._input.peek(1); - //if we're in a comment, do something special - // We treat all comments as literals, even more than preformatted tags - // we just look for the appropriate close tag - if (!this._disabled.php && !this._excluded.php && peek1 === '?') { - resulting_string = resulting_string || - this.__patterns.php.read(); - } - if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') { - resulting_string = resulting_string || - this.__patterns.erb.read(); - } - } else if (c === '{') { - if (!this._disabled.handlebars && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.handlebars_comment.read(); - resulting_string = resulting_string || - this.__patterns.handlebars_unescaped.read(); - resulting_string = resulting_string || - this.__patterns.handlebars.read(); - } - if (!this._disabled.django) { - // django coflicts with handlebars a bit. - if (!this._excluded.django && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.django_value.read(); - } - if (!this._excluded.django) { - resulting_string = resulting_string || - this.__patterns.django_comment.read(); - resulting_string = resulting_string || - this.__patterns.django.read(); - } - } - if (!this._disabled.smarty) { - // smarty cannot be enabled with django or handlebars enabled - if (this._disabled.django && this._disabled.handlebars) { - resulting_string = resulting_string || - this.__patterns.smarty_comment.read(); - resulting_string = resulting_string || - this.__patterns.smarty_literal.read(); - resulting_string = resulting_string || - this.__patterns.smarty.read(); - } - } - } - return resulting_string; -}; - - -templatablepattern.TemplatablePattern = TemplatablePattern$2; - -/*jshint node:true */ - -var InputScanner$1 = inputscanner.InputScanner; -var BaseTokenizer$1 = tokenizer$1.Tokenizer; -var BASETOKEN$1 = tokenizer$1.TOKEN; -var Directives$2 = directives.Directives; -var acorn$1 = acorn$2; -var Pattern$1 = pattern.Pattern; -var TemplatablePattern$1 = templatablepattern.TemplatablePattern; - - -function in_array$2(what, arr) { - return arr.indexOf(what) !== -1; -} - - -var TOKEN$3 = { - START_EXPR: 'TK_START_EXPR', - END_EXPR: 'TK_END_EXPR', - START_BLOCK: 'TK_START_BLOCK', - END_BLOCK: 'TK_END_BLOCK', - WORD: 'TK_WORD', - RESERVED: 'TK_RESERVED', - SEMICOLON: 'TK_SEMICOLON', - STRING: 'TK_STRING', - EQUALS: 'TK_EQUALS', - OPERATOR: 'TK_OPERATOR', - COMMA: 'TK_COMMA', - BLOCK_COMMENT: 'TK_BLOCK_COMMENT', - COMMENT: 'TK_COMMENT', - DOT: 'TK_DOT', - UNKNOWN: 'TK_UNKNOWN', - START: BASETOKEN$1.START, - RAW: BASETOKEN$1.RAW, - EOF: BASETOKEN$1.EOF -}; - - -var directives_core$2 = new Directives$2(/\/\*/, /\*\//); - -var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/; - -var digit = /[0-9]/; - -// Dot "." must be distinguished from "..." and decimal -var dot_pattern = /[^\d\.]/; - -var positionable_operators$1 = ( - ">>> === !== &&= ??= ||= " + - "<< && >= ** != == <= >> || ?? |> " + - "< / - + > : & % ? ^ | *").split(' '); - -// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work. -// Also, you must update possitionable operators separately from punct -var punct = - ">>>= " + - "... >>= <<= === >>> !== **= &&= ??= ||= " + - "=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> " + - "= ! ? > < : / ^ - + * & % ~ |"; - -punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&"); -// ?. but not if followed by a number -punct = '\\?\\.(?!\\d) ' + punct; -punct = punct.replace(/ /g, '|'); - -var punct_pattern = new RegExp(punct); - -// words which should always start on new line. -var line_starters$1 = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(','); -var reserved_words = line_starters$1.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as']); -var reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$'); - -// var template_pattern = /(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g; - -var in_html_comment; - -var Tokenizer$3 = function(input_string, options) { - BaseTokenizer$1.call(this, input_string, options); - - this._patterns.whitespace = this._patterns.whitespace.matching( - /\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source, - /\u2028\u2029/.source); - - var pattern_reader = new Pattern$1(this._input); - var templatable = new TemplatablePattern$1(this._input) - .read_options(this._options); - - this.__patterns = { - template: templatable, - identifier: templatable.starting_with(acorn$1.identifier).matching(acorn$1.identifierMatch), - number: pattern_reader.matching(number_pattern), - punct: pattern_reader.matching(punct_pattern), - // comment ends just before nearest linefeed or end of file - comment: pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/), - // /* ... */ comment ends with nearest */ or end of file - block_comment: pattern_reader.starting_with(/\/\*/).until_after(/\*\//), - html_comment_start: pattern_reader.matching(//), - include: pattern_reader.starting_with(/#include/).until_after(acorn$1.lineBreak), - shebang: pattern_reader.starting_with(/#!/).until_after(acorn$1.lineBreak), - xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/), - single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), - double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), - template_text: templatable.until(/[`\\$]/), - template_expression: templatable.until(/[`}\\]/) - }; - -}; -Tokenizer$3.prototype = new BaseTokenizer$1(); - -Tokenizer$3.prototype._is_comment = function(current_token) { - return current_token.type === TOKEN$3.COMMENT || current_token.type === TOKEN$3.BLOCK_COMMENT || current_token.type === TOKEN$3.UNKNOWN; -}; - -Tokenizer$3.prototype._is_opening = function(current_token) { - return current_token.type === TOKEN$3.START_BLOCK || current_token.type === TOKEN$3.START_EXPR; -}; - -Tokenizer$3.prototype._is_closing = function(current_token, open_token) { - return (current_token.type === TOKEN$3.END_BLOCK || current_token.type === TOKEN$3.END_EXPR) && - (open_token && ( - (current_token.text === ']' && open_token.text === '[') || - (current_token.text === ')' && open_token.text === '(') || - (current_token.text === '}' && open_token.text === '{'))); -}; - -Tokenizer$3.prototype._reset = function() { - in_html_comment = false; -}; - -Tokenizer$3.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - var token = null; - this._readWhitespace(); - var c = this._input.peek(); - - if (c === null) { - return this._create_token(TOKEN$3.EOF, ''); - } - - token = token || this._read_non_javascript(c); - token = token || this._read_string(c); - token = token || this._read_word(previous_token); - token = token || this._read_singles(c); - token = token || this._read_comment(c); - token = token || this._read_regexp(c, previous_token); - token = token || this._read_xml(c, previous_token); - token = token || this._read_punctuation(); - token = token || this._create_token(TOKEN$3.UNKNOWN, this._input.next()); - - return token; -}; - -Tokenizer$3.prototype._read_word = function(previous_token) { - var resulting_string; - resulting_string = this.__patterns.identifier.read(); - if (resulting_string !== '') { - resulting_string = resulting_string.replace(acorn$1.allLineBreaks, '\n'); - if (!(previous_token.type === TOKEN$3.DOT || - (previous_token.type === TOKEN$3.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) && - reserved_word_pattern.test(resulting_string)) { - if (resulting_string === 'in' || resulting_string === 'of') { // hack for 'in' and 'of' operators - return this._create_token(TOKEN$3.OPERATOR, resulting_string); - } - return this._create_token(TOKEN$3.RESERVED, resulting_string); - } - return this._create_token(TOKEN$3.WORD, resulting_string); - } - - resulting_string = this.__patterns.number.read(); - if (resulting_string !== '') { - return this._create_token(TOKEN$3.WORD, resulting_string); - } -}; - -Tokenizer$3.prototype._read_singles = function(c) { - var token = null; - if (c === '(' || c === '[') { - token = this._create_token(TOKEN$3.START_EXPR, c); - } else if (c === ')' || c === ']') { - token = this._create_token(TOKEN$3.END_EXPR, c); - } else if (c === '{') { - token = this._create_token(TOKEN$3.START_BLOCK, c); - } else if (c === '}') { - token = this._create_token(TOKEN$3.END_BLOCK, c); - } else if (c === ';') { - token = this._create_token(TOKEN$3.SEMICOLON, c); - } else if (c === '.' && dot_pattern.test(this._input.peek(1))) { - token = this._create_token(TOKEN$3.DOT, c); - } else if (c === ',') { - token = this._create_token(TOKEN$3.COMMA, c); - } - - if (token) { - this._input.next(); - } - return token; -}; - -Tokenizer$3.prototype._read_punctuation = function() { - var resulting_string = this.__patterns.punct.read(); - - if (resulting_string !== '') { - if (resulting_string === '=') { - return this._create_token(TOKEN$3.EQUALS, resulting_string); - } else if (resulting_string === '?.') { - return this._create_token(TOKEN$3.DOT, resulting_string); - } else { - return this._create_token(TOKEN$3.OPERATOR, resulting_string); - } - } -}; - -Tokenizer$3.prototype._read_non_javascript = function(c) { - var resulting_string = ''; - - if (c === '#') { - if (this._is_first_token()) { - resulting_string = this.__patterns.shebang.read(); - - if (resulting_string) { - return this._create_token(TOKEN$3.UNKNOWN, resulting_string.trim() + '\n'); - } - } - - // handles extendscript #includes - resulting_string = this.__patterns.include.read(); - - if (resulting_string) { - return this._create_token(TOKEN$3.UNKNOWN, resulting_string.trim() + '\n'); - } - - c = this._input.next(); - - // Spidermonkey-specific sharp variables for circular references. Considered obsolete. - var sharp = '#'; - if (this._input.hasNext() && this._input.testChar(digit)) { - do { - c = this._input.next(); - sharp += c; - } while (this._input.hasNext() && c !== '#' && c !== '='); - if (c === '#') ; else if (this._input.peek() === '[' && this._input.peek(1) === ']') { - sharp += '[]'; - this._input.next(); - this._input.next(); - } else if (this._input.peek() === '{' && this._input.peek(1) === '}') { - sharp += '{}'; - this._input.next(); - this._input.next(); - } - return this._create_token(TOKEN$3.WORD, sharp); - } - - this._input.back(); - - } else if (c === '<' && this._is_first_token()) { - resulting_string = this.__patterns.html_comment_start.read(); - if (resulting_string) { - while (this._input.hasNext() && !this._input.testChar(acorn$1.newline)) { - resulting_string += this._input.next(); - } - in_html_comment = true; - return this._create_token(TOKEN$3.COMMENT, resulting_string); - } - } else if (in_html_comment && c === '-') { - resulting_string = this.__patterns.html_comment_end.read(); - if (resulting_string) { - in_html_comment = false; - return this._create_token(TOKEN$3.COMMENT, resulting_string); - } - } - - return null; -}; - -Tokenizer$3.prototype._read_comment = function(c) { - var token = null; - if (c === '/') { - var comment = ''; - if (this._input.peek(1) === '*') { - // peek for comment /* ... */ - comment = this.__patterns.block_comment.read(); - var directives = directives_core$2.get_directives(comment); - if (directives && directives.ignore === 'start') { - comment += directives_core$2.readIgnored(this._input); - } - comment = comment.replace(acorn$1.allLineBreaks, '\n'); - token = this._create_token(TOKEN$3.BLOCK_COMMENT, comment); - token.directives = directives; - } else if (this._input.peek(1) === '/') { - // peek for comment // ... - comment = this.__patterns.comment.read(); - token = this._create_token(TOKEN$3.COMMENT, comment); - } - } - return token; -}; - -Tokenizer$3.prototype._read_string = function(c) { - if (c === '`' || c === "'" || c === '"') { - var resulting_string = this._input.next(); - this.has_char_escapes = false; - - if (c === '`') { - resulting_string += this._read_string_recursive('`', true, '${'); - } else { - resulting_string += this._read_string_recursive(c); - } - - if (this.has_char_escapes && this._options.unescape_strings) { - resulting_string = unescape_string(resulting_string); - } - - if (this._input.peek() === c) { - resulting_string += this._input.next(); - } - - resulting_string = resulting_string.replace(acorn$1.allLineBreaks, '\n'); - - return this._create_token(TOKEN$3.STRING, resulting_string); - } - - return null; -}; - -Tokenizer$3.prototype._allow_regexp_or_xml = function(previous_token) { - // regex and xml can only appear in specific locations during parsing - return (previous_token.type === TOKEN$3.RESERVED && in_array$2(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) || - (previous_token.type === TOKEN$3.END_EXPR && previous_token.text === ')' && - previous_token.opened.previous.type === TOKEN$3.RESERVED && in_array$2(previous_token.opened.previous.text, ['if', 'while', 'for'])) || - (in_array$2(previous_token.type, [TOKEN$3.COMMENT, TOKEN$3.START_EXPR, TOKEN$3.START_BLOCK, TOKEN$3.START, - TOKEN$3.END_BLOCK, TOKEN$3.OPERATOR, TOKEN$3.EQUALS, TOKEN$3.EOF, TOKEN$3.SEMICOLON, TOKEN$3.COMMA - ])); -}; - -Tokenizer$3.prototype._read_regexp = function(c, previous_token) { - - if (c === '/' && this._allow_regexp_or_xml(previous_token)) { - // handle regexp - // - var resulting_string = this._input.next(); - var esc = false; - - var in_char_class = false; - while (this._input.hasNext() && - ((esc || in_char_class || this._input.peek() !== c) && - !this._input.testChar(acorn$1.newline))) { - resulting_string += this._input.peek(); - if (!esc) { - esc = this._input.peek() === '\\'; - if (this._input.peek() === '[') { - in_char_class = true; - } else if (this._input.peek() === ']') { - in_char_class = false; - } - } else { - esc = false; - } - this._input.next(); - } - - if (this._input.peek() === c) { - resulting_string += this._input.next(); - - // regexps may have modifiers /regexp/MOD , so fetch those, too - // Only [gim] are valid, but if the user puts in garbage, do what we can to take it. - resulting_string += this._input.read(acorn$1.identifier); - } - return this._create_token(TOKEN$3.STRING, resulting_string); - } - return null; -}; - -Tokenizer$3.prototype._read_xml = function(c, previous_token) { - - if (this._options.e4x && c === "<" && this._allow_regexp_or_xml(previous_token)) { - var xmlStr = ''; - var match = this.__patterns.xml.read_match(); - // handle e4x xml literals - // - if (match) { - // Trim root tag to attempt to - var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}'); - var isCurlyRoot = rootTag.indexOf('{') === 0; - var depth = 0; - while (match) { - var isEndTag = !!match[1]; - var tagName = match[2]; - var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA["); - if (!isSingletonTag && - (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) { - if (isEndTag) { - --depth; - } else { - ++depth; - } - } - xmlStr += match[0]; - if (depth <= 0) { - break; - } - match = this.__patterns.xml.read_match(); - } - // if we didn't close correctly, keep unformatted. - if (!match) { - xmlStr += this._input.match(/[\s\S]*/g)[0]; - } - xmlStr = xmlStr.replace(acorn$1.allLineBreaks, '\n'); - return this._create_token(TOKEN$3.STRING, xmlStr); - } - } - - return null; -}; - -function unescape_string(s) { - // You think that a regex would work for this - // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) { - // return String.fromCharCode(parseInt(val, 16)); - // }) - // However, dealing with '\xff', '\\xff', '\\\xff' makes this more fun. - var out = '', - escaped = 0; - - var input_scan = new InputScanner$1(s); - var matched = null; - - while (input_scan.hasNext()) { - // Keep any whitespace, non-slash characters - // also keep slash pairs. - matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g); - - if (matched) { - out += matched[0]; - } - - if (input_scan.peek() === '\\') { - input_scan.next(); - if (input_scan.peek() === 'x') { - matched = input_scan.match(/x([0-9A-Fa-f]{2})/g); - } else if (input_scan.peek() === 'u') { - matched = input_scan.match(/u([0-9A-Fa-f]{4})/g); - } else { - out += '\\'; - if (input_scan.hasNext()) { - out += input_scan.next(); - } - continue; - } - - // If there's some error decoding, return the original string - if (!matched) { - return s; - } - - escaped = parseInt(matched[1], 16); - - if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) { - // we bail out on \x7f..\xff, - // leaving whole string escaped, - // as it's probably completely binary - return s; - } else if (escaped >= 0x00 && escaped < 0x20) { - // leave 0x00...0x1f escaped - out += '\\' + matched[0]; - continue; - } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) { - // single-quote, apostrophe, backslash - escape these - out += '\\' + String.fromCharCode(escaped); - } else { - out += String.fromCharCode(escaped); - } - } - } - - return out; -} - -// handle string -// -Tokenizer$3.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) { - var current_char; - var pattern; - if (delimiter === '\'') { - pattern = this.__patterns.single_quote; - } else if (delimiter === '"') { - pattern = this.__patterns.double_quote; - } else if (delimiter === '`') { - pattern = this.__patterns.template_text; - } else if (delimiter === '}') { - pattern = this.__patterns.template_expression; - } - - var resulting_string = pattern.read(); - var next = ''; - while (this._input.hasNext()) { - next = this._input.next(); - if (next === delimiter || - (!allow_unescaped_newlines && acorn$1.newline.test(next))) { - this._input.back(); - break; - } else if (next === '\\' && this._input.hasNext()) { - current_char = this._input.peek(); - - if (current_char === 'x' || current_char === 'u') { - this.has_char_escapes = true; - } else if (current_char === '\r' && this._input.peek(1) === '\n') { - this._input.next(); - } - next += this._input.next(); - } else if (start_sub) { - if (start_sub === '${' && next === '$' && this._input.peek() === '{') { - next += this._input.next(); - } - - if (start_sub === next) { - if (delimiter === '`') { - next += this._read_string_recursive('}', allow_unescaped_newlines, '`'); - } else { - next += this._read_string_recursive('`', allow_unescaped_newlines, '${'); - } - if (this._input.hasNext()) { - next += this._input.next(); - } - } - } - next += pattern.read(); - resulting_string += next; - } - - return resulting_string; -}; - -tokenizer$2.Tokenizer = Tokenizer$3; -tokenizer$2.TOKEN = TOKEN$3; -tokenizer$2.positionable_operators = positionable_operators$1.slice(); -tokenizer$2.line_starters = line_starters$1.slice(); - -/*jshint node:true */ - -var Output$b = output$1.Output; -var Token = token.Token; -var acorn = acorn$2; -var Options$7 = options$4.Options; -var Tokenizer$2 = tokenizer$2.Tokenizer; -var line_starters = tokenizer$2.line_starters; -var positionable_operators = tokenizer$2.positionable_operators; -var TOKEN$2 = tokenizer$2.TOKEN; - - -function in_array$1(what, arr) { - return arr.indexOf(what) !== -1; -} - -function ltrim(s) { - return s.replace(/^\s+/g, ''); -} - -function generateMapFromStrings(list) { - var result = {}; - for (var x = 0; x < list.length; x++) { - // make the mapped names underscored instead of dash - result[list[x].replace(/-/g, '_')] = list[x]; - } - return result; -} - -function reserved_word(token, word) { - return token && token.type === TOKEN$2.RESERVED && token.text === word; -} - -function reserved_array(token, words) { - return token && token.type === TOKEN$2.RESERVED && in_array$1(token.text, words); -} -// Unsure of what they mean, but they work. Worth cleaning up in future. -var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async']; - -var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline']; - -// Generate map from array -var OPERATOR_POSITION = generateMapFromStrings(validPositionValues); - -var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline]; - -var MODE = { - BlockStatement: 'BlockStatement', // 'BLOCK' - Statement: 'Statement', // 'STATEMENT' - ObjectLiteral: 'ObjectLiteral', // 'OBJECT', - ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]', - ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)', - Conditional: 'Conditional', //'(COND-EXPRESSION)', - Expression: 'Expression' //'(EXPRESSION)' -}; - -function remove_redundant_indentation(output, frame) { - // This implementation is effective but has some issues: - // - can cause line wrap to happen too soon due to indent removal - // after wrap points are calculated - // These issues are minor compared to ugly indentation. - - if (frame.multiline_frame || - frame.mode === MODE.ForInitializer || - frame.mode === MODE.Conditional) { - return; - } - - // remove one indent from each line inside this section - output.remove_indent(frame.start_line_index); -} - -// we could use just string.split, but -// IE doesn't like returning empty strings -function split_linebreaks(s) { - //return s.split(/\x0d\x0a|\x0a/); - - s = s.replace(acorn.allLineBreaks, '\n'); - var out = [], - idx = s.indexOf("\n"); - while (idx !== -1) { - out.push(s.substring(0, idx)); - s = s.substring(idx + 1); - idx = s.indexOf("\n"); - } - if (s.length) { - out.push(s); - } - return out; -} - -function is_array(mode) { - return mode === MODE.ArrayLiteral; -} - -function is_expression(mode) { - return in_array$1(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]); -} - -function all_lines_start_with(lines, c) { - for (var i = 0; i < lines.length; i++) { - var line = lines[i].trim(); - if (line.charAt(0) !== c) { - return false; - } - } - return true; -} - -function each_line_matches_indent(lines, indent) { - var i = 0, - len = lines.length, - line; - for (; i < len; i++) { - line = lines[i]; - // allow empty lines to pass through - if (line && line.indexOf(indent) !== 0) { - return false; - } - } - return true; -} - - -function Beautifier$5(source_text, options) { - options = options || {}; - this._source_text = source_text || ''; - - this._output = null; - this._tokens = null; - this._last_last_text = null; - this._flags = null; - this._previous_flags = null; - - this._flag_store = null; - this._options = new Options$7(options); -} - -Beautifier$5.prototype.create_flags = function(flags_base, mode) { - var next_indent_level = 0; - if (flags_base) { - next_indent_level = flags_base.indentation_level; - if (!this._output.just_added_newline() && - flags_base.line_indent_level > next_indent_level) { - next_indent_level = flags_base.line_indent_level; - } - } - - var next_flags = { - mode: mode, - parent: flags_base, - last_token: flags_base ? flags_base.last_token : new Token(TOKEN$2.START_BLOCK, ''), // last token text - last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed - declaration_statement: false, - declaration_assignment: false, - multiline_frame: false, - inline_frame: false, - if_block: false, - else_block: false, - do_block: false, - do_while: false, - import_block: false, - in_case_statement: false, // switch(..){ INSIDE HERE } - in_case: false, // we're on the exact line with "case 0:" - case_body: false, // the indented case-action block - case_block: false, // the indented case-action block is wrapped with {} - indentation_level: next_indent_level, - alignment: 0, - line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level, - start_line_index: this._output.get_line_number(), - ternary_depth: 0 - }; - return next_flags; -}; - -Beautifier$5.prototype._reset = function(source_text) { - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - this._last_last_text = ''; // pre-last token text - this._output = new Output$b(this._options, baseIndentString); - - // If testing the ignore directive, start with output disable set to true - this._output.raw = this._options.test_output_raw; - - - // Stack of parsing/formatting states, including MODE. - // We tokenize, parse, and output in an almost purely a forward-only stream of token input - // and formatted output. This makes the beautifier less accurate than full parsers - // but also far more tolerant of syntax errors. - // - // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type - // MODE.BlockStatement on the the stack, even though it could be object literal. If we later - // encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";", - // most full parsers would die, but the beautifier gracefully falls back to - // MODE.BlockStatement and continues on. - this._flag_store = []; - this.set_mode(MODE.BlockStatement); - var tokenizer = new Tokenizer$2(source_text, this._options); - this._tokens = tokenizer.tokenize(); - return source_text; -}; - -Beautifier$5.prototype.beautify = function() { - // if disabled, return the input unchanged. - if (this._options.disabled) { - return this._source_text; - } - - var sweet_code; - var source_text = this._reset(this._source_text); - - var eol = this._options.eol; - if (this._options.eol === 'auto') { - eol = '\n'; - if (source_text && acorn.lineBreak.test(source_text || '')) { - eol = source_text.match(acorn.lineBreak)[0]; - } - } - - var current_token = this._tokens.next(); - while (current_token) { - this.handle_token(current_token); - - this._last_last_text = this._flags.last_token.text; - this._flags.last_token = current_token; - - current_token = this._tokens.next(); - } - - sweet_code = this._output.get_code(eol); - - return sweet_code; -}; - -Beautifier$5.prototype.handle_token = function(current_token, preserve_statement_flags) { - if (current_token.type === TOKEN$2.START_EXPR) { - this.handle_start_expr(current_token); - } else if (current_token.type === TOKEN$2.END_EXPR) { - this.handle_end_expr(current_token); - } else if (current_token.type === TOKEN$2.START_BLOCK) { - this.handle_start_block(current_token); - } else if (current_token.type === TOKEN$2.END_BLOCK) { - this.handle_end_block(current_token); - } else if (current_token.type === TOKEN$2.WORD) { - this.handle_word(current_token); - } else if (current_token.type === TOKEN$2.RESERVED) { - this.handle_word(current_token); - } else if (current_token.type === TOKEN$2.SEMICOLON) { - this.handle_semicolon(current_token); - } else if (current_token.type === TOKEN$2.STRING) { - this.handle_string(current_token); - } else if (current_token.type === TOKEN$2.EQUALS) { - this.handle_equals(current_token); - } else if (current_token.type === TOKEN$2.OPERATOR) { - this.handle_operator(current_token); - } else if (current_token.type === TOKEN$2.COMMA) { - this.handle_comma(current_token); - } else if (current_token.type === TOKEN$2.BLOCK_COMMENT) { - this.handle_block_comment(current_token, preserve_statement_flags); - } else if (current_token.type === TOKEN$2.COMMENT) { - this.handle_comment(current_token, preserve_statement_flags); - } else if (current_token.type === TOKEN$2.DOT) { - this.handle_dot(current_token); - } else if (current_token.type === TOKEN$2.EOF) { - this.handle_eof(current_token); - } else if (current_token.type === TOKEN$2.UNKNOWN) { - this.handle_unknown(current_token, preserve_statement_flags); - } else { - this.handle_unknown(current_token, preserve_statement_flags); - } -}; - -Beautifier$5.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) { - var newlines = current_token.newlines; - var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode); - - if (current_token.comments_before) { - var comment_token = current_token.comments_before.next(); - while (comment_token) { - // The cleanest handling of inline comments is to treat them as though they aren't there. - // Just continue formatting and the behavior should be logical. - // Also ignore unknown tokens. Again, this should result in better behavior. - this.handle_whitespace_and_comments(comment_token, preserve_statement_flags); - this.handle_token(comment_token, preserve_statement_flags); - comment_token = current_token.comments_before.next(); - } - } - - if (keep_whitespace) { - for (var i = 0; i < newlines; i += 1) { - this.print_newline(i > 0, preserve_statement_flags); - } - } else { - if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) { - newlines = this._options.max_preserve_newlines; - } - - if (this._options.preserve_newlines) { - if (newlines > 1) { - this.print_newline(false, preserve_statement_flags); - for (var j = 1; j < newlines; j += 1) { - this.print_newline(true, preserve_statement_flags); - } - } - } - } - -}; - -var newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield']; - -Beautifier$5.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) { - force_linewrap = (force_linewrap === undefined) ? false : force_linewrap; - - // Never wrap the first token on a line - if (this._output.just_added_newline()) { - return; - } - - var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap; - var operatorLogicApplies = in_array$1(this._flags.last_token.text, positionable_operators) || - in_array$1(current_token.text, positionable_operators); - - if (operatorLogicApplies) { - var shouldPrintOperatorNewline = ( - in_array$1(this._flags.last_token.text, positionable_operators) && - in_array$1(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE) - ) || - in_array$1(current_token.text, positionable_operators); - shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline; - } - - if (shouldPreserveOrForce) { - this.print_newline(false, true); - } else if (this._options.wrap_line_length) { - if (reserved_array(this._flags.last_token, newline_restricted_tokens)) { - // These tokens should never have a newline inserted - // between them and the following expression. - return; - } - this._output.set_wrap_point(); - } -}; - -Beautifier$5.prototype.print_newline = function(force_newline, preserve_statement_flags) { - if (!preserve_statement_flags) { - if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN$2.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) { - var next_token = this._tokens.peek(); - while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && reserved_word(next_token, 'else')) && - !this._flags.do_block) { - this.restore_mode(); - } - } - } - - if (this._output.add_new_line(force_newline)) { - this._flags.multiline_frame = true; - } -}; - -Beautifier$5.prototype.print_token_line_indentation = function(current_token) { - if (this._output.just_added_newline()) { - if (this._options.keep_array_indentation && - current_token.newlines && - (current_token.text === '[' || is_array(this._flags.mode))) { - this._output.current_line.set_indent(-1); - this._output.current_line.push(current_token.whitespace_before); - this._output.space_before_token = false; - } else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) { - this._flags.line_indent_level = this._flags.indentation_level; - } - } -}; - -Beautifier$5.prototype.print_token = function(current_token) { - if (this._output.raw) { - this._output.add_raw_token(current_token); - return; - } - - if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN$2.COMMA && - this._output.just_added_newline()) { - if (this._output.previous_line.last() === ',') { - var popped = this._output.previous_line.pop(); - // if the comma was already at the start of the line, - // pull back onto that line and reprint the indentation - if (this._output.previous_line.is_empty()) { - this._output.previous_line.push(popped); - this._output.trim(true); - this._output.current_line.pop(); - this._output.trim(); - } - - // add the comma in front of the next token - this.print_token_line_indentation(current_token); - this._output.add_token(','); - this._output.space_before_token = true; - } - } - - this.print_token_line_indentation(current_token); - this._output.non_breaking_space = true; - this._output.add_token(current_token.text); - if (this._output.previous_token_wrapped) { - this._flags.multiline_frame = true; - } -}; - -Beautifier$5.prototype.indent = function() { - this._flags.indentation_level += 1; - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); -}; - -Beautifier$5.prototype.deindent = function() { - if (this._flags.indentation_level > 0 && - ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) { - this._flags.indentation_level -= 1; - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - } -}; - -Beautifier$5.prototype.set_mode = function(mode) { - if (this._flags) { - this._flag_store.push(this._flags); - this._previous_flags = this._flags; - } else { - this._previous_flags = this.create_flags(null, mode); - } - - this._flags = this.create_flags(this._previous_flags, mode); - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); -}; - - -Beautifier$5.prototype.restore_mode = function() { - if (this._flag_store.length > 0) { - this._previous_flags = this._flags; - this._flags = this._flag_store.pop(); - if (this._previous_flags.mode === MODE.Statement) { - remove_redundant_indentation(this._output, this._previous_flags); - } - this._output.set_indent(this._flags.indentation_level, this._flags.alignment); - } -}; - -Beautifier$5.prototype.start_of_object_property = function() { - return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && ( - (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set']))); -}; - -Beautifier$5.prototype.start_of_statement = function(current_token) { - var start = false; - start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN$2.WORD; - start = start || reserved_word(this._flags.last_token, 'do'); - start = start || (!(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement)) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines; - start = start || reserved_word(this._flags.last_token, 'else') && - !(reserved_word(current_token, 'if') && !current_token.comments_before); - start = start || (this._flags.last_token.type === TOKEN$2.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional)); - start = start || (this._flags.last_token.type === TOKEN$2.WORD && this._flags.mode === MODE.BlockStatement && - !this._flags.in_case && - !(current_token.text === '--' || current_token.text === '++') && - this._last_last_text !== 'function' && - current_token.type !== TOKEN$2.WORD && current_token.type !== TOKEN$2.RESERVED); - start = start || (this._flags.mode === MODE.ObjectLiteral && ( - (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set']))); - - if (start) { - this.set_mode(MODE.Statement); - this.indent(); - - this.handle_whitespace_and_comments(current_token, true); - - // Issue #276: - // If starting a new statement with [if, for, while, do], push to a new line. - // if (a) if (b) if(c) d(); else e(); else f(); - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token, - reserved_array(current_token, ['do', 'for', 'if', 'while'])); - } - return true; - } - return false; -}; - -Beautifier$5.prototype.handle_start_expr = function(current_token) { - // The conditional starts the statement if appropriate. - if (!this.start_of_statement(current_token)) { - this.handle_whitespace_and_comments(current_token); - } - - var next_mode = MODE.Expression; - if (current_token.text === '[') { - - if (this._flags.last_token.type === TOKEN$2.WORD || this._flags.last_token.text === ')') { - // this is array index specifier, break immediately - // a[x], fn()[x] - if (reserved_array(this._flags.last_token, line_starters)) { - this._output.space_before_token = true; - } - this.print_token(current_token); - this.set_mode(next_mode); - this.indent(); - if (this._options.space_in_paren) { - this._output.space_before_token = true; - } - return; - } - - next_mode = MODE.ArrayLiteral; - if (is_array(this._flags.mode)) { - if (this._flags.last_token.text === '[' || - (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) { - // ], [ goes to new line - // }, [ goes to new line - if (!this._options.keep_array_indentation) { - this.print_newline(); - } - } - } - - if (!in_array$1(this._flags.last_token.type, [TOKEN$2.START_EXPR, TOKEN$2.END_EXPR, TOKEN$2.WORD, TOKEN$2.OPERATOR, TOKEN$2.DOT])) { - this._output.space_before_token = true; - } - } else { - if (this._flags.last_token.type === TOKEN$2.RESERVED) { - if (this._flags.last_token.text === 'for') { - this._output.space_before_token = this._options.space_before_conditional; - next_mode = MODE.ForInitializer; - } else if (in_array$1(this._flags.last_token.text, ['if', 'while', 'switch'])) { - this._output.space_before_token = this._options.space_before_conditional; - next_mode = MODE.Conditional; - } else if (in_array$1(this._flags.last_word, ['await', 'async'])) { - // Should be a space between await and an IIFE, or async and an arrow function - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') { - this._output.space_before_token = false; - } else if (in_array$1(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') { - this._output.space_before_token = true; - } - } else if (this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - // Support of this kind of newline preservation. - // a = (b && - // (c || d)); - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } else if (this._flags.last_token.type === TOKEN$2.WORD) { - this._output.space_before_token = false; - - // function name() vs function name () - // function* name() vs function* name () - // async name() vs async name () - // In ES6, you can also define the method properties of an object - // var obj = {a: function() {}} - // It can be abbreviated - // var obj = {a() {}} - // var obj = { a() {}} vs var obj = { a () {}} - // var obj = { * a() {}} vs var obj = { * a () {}} - var peek_back_two = this._tokens.peek(-3); - if (this._options.space_after_named_function && peek_back_two) { - // peek starts at next character so -1 is current token - var peek_back_three = this._tokens.peek(-4); - if (reserved_array(peek_back_two, ['async', 'function']) || - (peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) { - this._output.space_before_token = true; - } else if (this._flags.mode === MODE.ObjectLiteral) { - if ((peek_back_two.text === '{' || peek_back_two.text === ',') || - (peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) { - this._output.space_before_token = true; - } - } - } - } else { - // Support preserving wrapped arrow function expressions - // a.b('c', - // () => d.e - // ) - this.allow_wrap_or_preserved_newline(current_token); - } - - // function() vs function () - // yield*() vs yield* () - // function*() vs function* () - if ((this._flags.last_token.type === TOKEN$2.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) || - (this._flags.last_token.text === '*' && - (in_array$1(this._last_last_text, ['function', 'yield']) || - (this._flags.mode === MODE.ObjectLiteral && in_array$1(this._last_last_text, ['{', ',']))))) { - this._output.space_before_token = this._options.space_after_anon_function; - } - } - - if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN$2.START_BLOCK) { - this.print_newline(); - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN$2.COMMA) { - // do nothing on (( and )( and ][ and ]( and .( - // TODO: Consider whether forcing this is required. Review failing tests when removed. - this.allow_wrap_or_preserved_newline(current_token, current_token.newlines); - } - - this.print_token(current_token); - this.set_mode(next_mode); - if (this._options.space_in_paren) { - this._output.space_before_token = true; - } - - // In all cases, if we newline while inside an expression it should be indented. - this.indent(); -}; - -Beautifier$5.prototype.handle_end_expr = function(current_token) { - // statements inside expressions are not valid syntax, but... - // statements must all be closed when their container closes - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - this.handle_whitespace_and_comments(current_token); - - if (this._flags.multiline_frame) { - this.allow_wrap_or_preserved_newline(current_token, - current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation); - } - - if (this._options.space_in_paren) { - if (this._flags.last_token.type === TOKEN$2.START_EXPR && !this._options.space_in_empty_paren) { - // () [] no inner space in empty parens like these, ever, ref #320 - this._output.trim(); - this._output.space_before_token = false; - } else { - this._output.space_before_token = true; - } - } - this.deindent(); - this.print_token(current_token); - this.restore_mode(); - - remove_redundant_indentation(this._output, this._previous_flags); - - // do {} while () // no statement required after - if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) { - this._previous_flags.mode = MODE.Expression; - this._flags.do_block = false; - this._flags.do_while = false; - - } -}; - -Beautifier$5.prototype.handle_start_block = function(current_token) { - this.handle_whitespace_and_comments(current_token); - - // Check if this is should be treated as a ObjectLiteral - var next_token = this._tokens.peek(); - var second_token = this._tokens.peek(1); - if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN$2.END_EXPR) { - this.set_mode(MODE.BlockStatement); - this._flags.in_case_statement = true; - } else if (this._flags.case_body) { - this.set_mode(MODE.BlockStatement); - } else if (second_token && ( - (in_array$1(second_token.text, [':', ',']) && in_array$1(next_token.type, [TOKEN$2.STRING, TOKEN$2.WORD, TOKEN$2.RESERVED])) || - (in_array$1(next_token.text, ['get', 'set', '...']) && in_array$1(second_token.type, [TOKEN$2.WORD, TOKEN$2.RESERVED])) - )) { - // We don't support TypeScript,but we didn't break it for a very long time. - // We'll try to keep not breaking it. - if (in_array$1(this._last_last_text, ['class', 'interface']) && !in_array$1(second_token.text, [':', ','])) { - this.set_mode(MODE.BlockStatement); - } else { - this.set_mode(MODE.ObjectLiteral); - } - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR && this._flags.last_token.text === '=>') { - // arrow function: (param1, paramN) => { statements } - this.set_mode(MODE.BlockStatement); - } else if (in_array$1(this._flags.last_token.type, [TOKEN$2.EQUALS, TOKEN$2.START_EXPR, TOKEN$2.COMMA, TOKEN$2.OPERATOR]) || - reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default']) - ) { - // Detecting shorthand function syntax is difficult by scanning forward, - // so check the surrounding context. - // If the block is being returned, imported, export default, passed as arg, - // assigned with = or assigned in a nested object, treat as an ObjectLiteral. - this.set_mode(MODE.ObjectLiteral); - } else { - this.set_mode(MODE.BlockStatement); - } - - var empty_braces = !next_token.comments_before && next_token.text === '}'; - var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' && - this._flags.last_token.type === TOKEN$2.END_EXPR; - - if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so - { - // search forward for a newline wanted inside this block - var index = 0; - var check_token = null; - this._flags.inline_frame = true; - do { - index += 1; - check_token = this._tokens.peek(index - 1); - if (check_token.newlines) { - this._flags.inline_frame = false; - break; - } - } while (check_token.type !== TOKEN$2.EOF && - !(check_token.type === TOKEN$2.END_BLOCK && check_token.opened === current_token)); - } - - if ((this._options.brace_style === "expand" || - (this._options.brace_style === "none" && current_token.newlines)) && - !this._flags.inline_frame) { - if (this._flags.last_token.type !== TOKEN$2.OPERATOR && - (empty_anonymous_function || - this._flags.last_token.type === TOKEN$2.EQUALS || - (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) { - this._output.space_before_token = true; - } else { - this.print_newline(false, true); - } - } else { // collapse || inline_frame - if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.COMMA)) { - if (this._flags.last_token.type === TOKEN$2.COMMA || this._options.space_in_paren) { - this._output.space_before_token = true; - } - - if (this._flags.last_token.type === TOKEN$2.COMMA || (this._flags.last_token.type === TOKEN$2.START_EXPR && this._flags.inline_frame)) { - this.allow_wrap_or_preserved_newline(current_token); - this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame; - this._flags.multiline_frame = false; - } - } - if (this._flags.last_token.type !== TOKEN$2.OPERATOR && this._flags.last_token.type !== TOKEN$2.START_EXPR) { - if (this._flags.last_token.type === TOKEN$2.START_BLOCK && !this._flags.inline_frame) { - this.print_newline(); - } else { - this._output.space_before_token = true; - } - } - } - this.print_token(current_token); - this.indent(); - - // Except for specific cases, open braces are followed by a new line. - if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) { - this.print_newline(); - } -}; - -Beautifier$5.prototype.handle_end_block = function(current_token) { - // statements must all be closed when their container closes - this.handle_whitespace_and_comments(current_token); - - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - var empty_braces = this._flags.last_token.type === TOKEN$2.START_BLOCK; - - if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first - this._output.space_before_token = true; - } else if (this._options.brace_style === "expand") { - if (!empty_braces) { - this.print_newline(); - } - } else { - // skip {} - if (!empty_braces) { - if (is_array(this._flags.mode) && this._options.keep_array_indentation) { - // we REALLY need a newline here, but newliner would skip that - this._options.keep_array_indentation = false; - this.print_newline(); - this._options.keep_array_indentation = true; - - } else { - this.print_newline(); - } - } - } - this.restore_mode(); - this.print_token(current_token); -}; - -Beautifier$5.prototype.handle_word = function(current_token) { - if (current_token.type === TOKEN$2.RESERVED) { - if (in_array$1(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) { - current_token.type = TOKEN$2.WORD; - } else if (current_token.text === 'import' && in_array$1(this._tokens.peek().text, ['(', '.'])) { - current_token.type = TOKEN$2.WORD; - } else if (in_array$1(current_token.text, ['as', 'from']) && !this._flags.import_block) { - current_token.type = TOKEN$2.WORD; - } else if (this._flags.mode === MODE.ObjectLiteral) { - var next_token = this._tokens.peek(); - if (next_token.text === ':') { - current_token.type = TOKEN$2.WORD; - } - } - } - - if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN$2.WORD) { - this._flags.declaration_statement = true; - } - } else if (current_token.newlines && !is_expression(this._flags.mode) && - (this._flags.last_token.type !== TOKEN$2.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) && - this._flags.last_token.type !== TOKEN$2.EQUALS && - (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) { - this.handle_whitespace_and_comments(current_token); - this.print_newline(); - } else { - this.handle_whitespace_and_comments(current_token); - } - - if (this._flags.do_block && !this._flags.do_while) { - if (reserved_word(current_token, 'while')) { - // do {} ## while () - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; - this._flags.do_while = true; - return; - } else { - // do {} should always have while as the next word. - // if we don't see the expected while, recover - this.print_newline(); - this._flags.do_block = false; - } - } - - // if may be followed by else, or not - // Bare/inline ifs are tricky - // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e(); - if (this._flags.if_block) { - if (!this._flags.else_block && reserved_word(current_token, 'else')) { - this._flags.else_block = true; - } else { - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - this._flags.if_block = false; - this._flags.else_block = false; - } - } - - if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) { - this.print_newline(); - if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) { - // switch cases following one another - this.deindent(); - } - this._flags.case_body = false; - - this.print_token(current_token); - this._flags.in_case = true; - return; - } - - if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } - - if (reserved_word(current_token, 'function')) { - if (in_array$1(this._flags.last_token.text, ['}', ';']) || - (this._output.just_added_newline() && !(in_array$1(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN$2.OPERATOR))) { - // make sure there is a nice clean space of at least one blank line - // before a new function definition - if (!this._output.just_added_blankline() && !current_token.comments_before) { - this.print_newline(); - this.print_newline(true); - } - } - if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD) { - if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) || - reserved_array(this._flags.last_token, newline_restricted_tokens)) { - this._output.space_before_token = true; - } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') { - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'declare') { - // accomodates Typescript declare function formatting - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR || this._flags.last_token.text === '=') { - // foo = function - this._output.space_before_token = true; - } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) ; else { - this.print_newline(); - } - - this.print_token(current_token); - this._flags.last_word = current_token.text; - return; - } - - var prefix = 'NONE'; - - if (this._flags.last_token.type === TOKEN$2.END_BLOCK) { - - if (this._previous_flags.inline_frame) { - prefix = 'SPACE'; - } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) { - prefix = 'NEWLINE'; - } else { - if (this._options.brace_style === "expand" || - this._options.brace_style === "end-expand" || - (this._options.brace_style === "none" && current_token.newlines)) { - prefix = 'NEWLINE'; - } else { - prefix = 'SPACE'; - this._output.space_before_token = true; - } - } - } else if (this._flags.last_token.type === TOKEN$2.SEMICOLON && this._flags.mode === MODE.BlockStatement) { - // TODO: Should this be for STATEMENT as well? - prefix = 'NEWLINE'; - } else if (this._flags.last_token.type === TOKEN$2.SEMICOLON && is_expression(this._flags.mode)) { - prefix = 'SPACE'; - } else if (this._flags.last_token.type === TOKEN$2.STRING) { - prefix = 'NEWLINE'; - } else if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD || - (this._flags.last_token.text === '*' && - (in_array$1(this._last_last_text, ['function', 'yield']) || - (this._flags.mode === MODE.ObjectLiteral && in_array$1(this._last_last_text, ['{', ',']))))) { - prefix = 'SPACE'; - } else if (this._flags.last_token.type === TOKEN$2.START_BLOCK) { - if (this._flags.inline_frame) { - prefix = 'SPACE'; - } else { - prefix = 'NEWLINE'; - } - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR) { - this._output.space_before_token = true; - prefix = 'NEWLINE'; - } - - if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { - if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') { - prefix = 'SPACE'; - } else { - prefix = 'NEWLINE'; - } - - } - - if (reserved_array(current_token, ['else', 'catch', 'finally'])) { - if ((!(this._flags.last_token.type === TOKEN$2.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) || - this._options.brace_style === "expand" || - this._options.brace_style === "end-expand" || - (this._options.brace_style === "none" && current_token.newlines)) && - !this._flags.inline_frame) { - this.print_newline(); - } else { - this._output.trim(true); - var line = this._output.current_line; - // If we trimmed and there's something other than a close block before us - // put a newline back in. Handles '} // comment' scenario. - if (line.last() !== '}') { - this.print_newline(); - } - this._output.space_before_token = true; - } - } else if (prefix === 'NEWLINE') { - if (reserved_array(this._flags.last_token, special_words)) { - // no newline between 'return nnn' - this._output.space_before_token = true; - } else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) { - // accomodates Typescript declare formatting - this._output.space_before_token = true; - } else if (this._flags.last_token.type !== TOKEN$2.END_EXPR) { - if ((this._flags.last_token.type !== TOKEN$2.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') { - // no need to force newline on 'var': for (var x = 0...) - if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) { - // no newline for } else if { - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } - } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') { - this.print_newline(); - } - } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') { - this.print_newline(); // }, in lists get a newline treatment - } else if (prefix === 'SPACE') { - this._output.space_before_token = true; - } - if (current_token.previous && (current_token.previous.type === TOKEN$2.WORD || current_token.previous.type === TOKEN$2.RESERVED)) { - this._output.space_before_token = true; - } - this.print_token(current_token); - this._flags.last_word = current_token.text; - - if (current_token.type === TOKEN$2.RESERVED) { - if (current_token.text === 'do') { - this._flags.do_block = true; - } else if (current_token.text === 'if') { - this._flags.if_block = true; - } else if (current_token.text === 'import') { - this._flags.import_block = true; - } else if (this._flags.import_block && reserved_word(current_token, 'from')) { - this._flags.import_block = false; - } - } -}; - -Beautifier$5.prototype.handle_semicolon = function(current_token) { - if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - // Semicolon can be the start (and end) of a statement - this._output.space_before_token = false; - } else { - this.handle_whitespace_and_comments(current_token); - } - - var next_token = this._tokens.peek(); - while (this._flags.mode === MODE.Statement && - !(this._flags.if_block && reserved_word(next_token, 'else')) && - !this._flags.do_block) { - this.restore_mode(); - } - - // hacky but effective for the moment - if (this._flags.import_block) { - this._flags.import_block = false; - } - this.print_token(current_token); -}; - -Beautifier$5.prototype.handle_string = function(current_token) { - if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN$2.WORD)) ; else if (this.start_of_statement(current_token)) { - // The conditional starts the statement if appropriate. - // One difference - strings want at least a space before - this._output.space_before_token = true; - } else { - this.handle_whitespace_and_comments(current_token); - if (this._flags.last_token.type === TOKEN$2.RESERVED || this._flags.last_token.type === TOKEN$2.WORD || this._flags.inline_frame) { - this._output.space_before_token = true; - } else if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR || this._flags.last_token.type === TOKEN$2.EQUALS || this._flags.last_token.type === TOKEN$2.OPERATOR) { - if (!this.start_of_object_property()) { - this.allow_wrap_or_preserved_newline(current_token); - } - } else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN$2.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) { - this._output.space_before_token = true; - } else { - this.print_newline(); - } - } - this.print_token(current_token); -}; - -Beautifier$5.prototype.handle_equals = function(current_token) { - if (this.start_of_statement(current_token)) ; else { - this.handle_whitespace_and_comments(current_token); - } - - if (this._flags.declaration_statement) { - // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done - this._flags.declaration_assignment = true; - } - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; -}; - -Beautifier$5.prototype.handle_comma = function(current_token) { - this.handle_whitespace_and_comments(current_token, true); - - this.print_token(current_token); - this._output.space_before_token = true; - if (this._flags.declaration_statement) { - if (is_expression(this._flags.parent.mode)) { - // do not break on comma, for(var a = 1, b = 2) - this._flags.declaration_assignment = false; - } - - if (this._flags.declaration_assignment) { - this._flags.declaration_assignment = false; - this.print_newline(false, true); - } else if (this._options.comma_first) { - // for comma-first, we want to allow a newline before the comma - // to turn into a newline after the comma, which we will fixup later - this.allow_wrap_or_preserved_newline(current_token); - } - } else if (this._flags.mode === MODE.ObjectLiteral || - (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) { - if (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - - if (!this._flags.inline_frame) { - this.print_newline(); - } - } else if (this._options.comma_first) { - // EXPR or DO_BLOCK - // for comma-first, we want to allow a newline before the comma - // to turn into a newline after the comma, which we will fixup later - this.allow_wrap_or_preserved_newline(current_token); - } -}; - -Beautifier$5.prototype.handle_operator = function(current_token) { - var isGeneratorAsterisk = current_token.text === '*' && - (reserved_array(this._flags.last_token, ['function', 'yield']) || - (in_array$1(this._flags.last_token.type, [TOKEN$2.START_BLOCK, TOKEN$2.COMMA, TOKEN$2.END_BLOCK, TOKEN$2.SEMICOLON])) - ); - var isUnary = in_array$1(current_token.text, ['-', '+']) && ( - in_array$1(this._flags.last_token.type, [TOKEN$2.START_BLOCK, TOKEN$2.START_EXPR, TOKEN$2.EQUALS, TOKEN$2.OPERATOR]) || - in_array$1(this._flags.last_token.text, line_starters) || - this._flags.last_token.text === ',' - ); - - if (this.start_of_statement(current_token)) ; else { - var preserve_statement_flags = !isGeneratorAsterisk; - this.handle_whitespace_and_comments(current_token, preserve_statement_flags); - } - - if (reserved_array(this._flags.last_token, special_words)) { - // "return" had a special handling in TK_WORD. Now we need to return the favor - this._output.space_before_token = true; - this.print_token(current_token); - return; - } - - // hack for actionscript's import .*; - if (current_token.text === '*' && this._flags.last_token.type === TOKEN$2.DOT) { - this.print_token(current_token); - return; - } - - if (current_token.text === '::') { - // no spaces around exotic namespacing syntax operator - this.print_token(current_token); - return; - } - - // Allow line wrapping between operators when operator_position is - // set to before or preserve - if (this._flags.last_token.type === TOKEN$2.OPERATOR && in_array$1(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { - this.allow_wrap_or_preserved_newline(current_token); - } - - if (current_token.text === ':' && this._flags.in_case) { - this.print_token(current_token); - - this._flags.in_case = false; - this._flags.case_body = true; - if (this._tokens.peek().type !== TOKEN$2.START_BLOCK) { - this.indent(); - this.print_newline(); - this._flags.case_block = false; - } else { - this._flags.case_block = true; - this._output.space_before_token = true; - } - return; - } - - var space_before = true; - var space_after = true; - var in_ternary = false; - if (current_token.text === ':') { - if (this._flags.ternary_depth === 0) { - // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant. - space_before = false; - } else { - this._flags.ternary_depth -= 1; - in_ternary = true; - } - } else if (current_token.text === '?') { - this._flags.ternary_depth += 1; - } - - // let's handle the operator_position option prior to any conflicting logic - if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array$1(current_token.text, positionable_operators)) { - var isColon = current_token.text === ':'; - var isTernaryColon = (isColon && in_ternary); - var isOtherColon = (isColon && !in_ternary); - - switch (this._options.operator_position) { - case OPERATOR_POSITION.before_newline: - // if the current token is : and it's not a ternary statement then we set space_before to false - this._output.space_before_token = !isOtherColon; - - this.print_token(current_token); - - if (!isColon || isTernaryColon) { - this.allow_wrap_or_preserved_newline(current_token); - } - - this._output.space_before_token = true; - return; - - case OPERATOR_POSITION.after_newline: - // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement, - // then print a newline. - - this._output.space_before_token = true; - - if (!isColon || isTernaryColon) { - if (this._tokens.peek().newlines) { - this.print_newline(false, true); - } else { - this.allow_wrap_or_preserved_newline(current_token); - } - } else { - this._output.space_before_token = false; - } - - this.print_token(current_token); - - this._output.space_before_token = true; - return; - - case OPERATOR_POSITION.preserve_newline: - if (!isOtherColon) { - this.allow_wrap_or_preserved_newline(current_token); - } - - // if we just added a newline, or the current token is : and it's not a ternary statement, - // then we set space_before to false - space_before = !(this._output.just_added_newline() || isOtherColon); - - this._output.space_before_token = space_before; - this.print_token(current_token); - this._output.space_before_token = true; - return; - } - } - - if (isGeneratorAsterisk) { - this.allow_wrap_or_preserved_newline(current_token); - space_before = false; - var next_token = this._tokens.peek(); - space_after = next_token && in_array$1(next_token.type, [TOKEN$2.WORD, TOKEN$2.RESERVED]); - } else if (current_token.text === '...') { - this.allow_wrap_or_preserved_newline(current_token); - space_before = this._flags.last_token.type === TOKEN$2.START_BLOCK; - space_after = false; - } else if (in_array$1(current_token.text, ['--', '++', '!', '~']) || isUnary) { - // unary operators (and binary +/- pretending to be unary) special cases - if (this._flags.last_token.type === TOKEN$2.COMMA || this._flags.last_token.type === TOKEN$2.START_EXPR) { - this.allow_wrap_or_preserved_newline(current_token); - } - - space_before = false; - space_after = false; - - // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1 - // if there is a newline between -- or ++ and anything else we should preserve it. - if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) { - this.print_newline(false, true); - } - - if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) { - // for (;; ++i) - // ^^^ - space_before = true; - } - - if (this._flags.last_token.type === TOKEN$2.RESERVED) { - space_before = true; - } else if (this._flags.last_token.type === TOKEN$2.END_EXPR) { - space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++')); - } else if (this._flags.last_token.type === TOKEN$2.OPERATOR) { - // a++ + ++b; - // a - -b - space_before = in_array$1(current_token.text, ['--', '-', '++', '+']) && in_array$1(this._flags.last_token.text, ['--', '-', '++', '+']); - // + and - are not unary when preceeded by -- or ++ operator - // a-- + b - // a * +b - // a - -b - if (in_array$1(current_token.text, ['+', '-']) && in_array$1(this._flags.last_token.text, ['--', '++'])) { - space_after = true; - } - } - - - if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) && - (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) { - // { foo; --i } - // foo(); --bar; - this.print_newline(); - } - } - - this._output.space_before_token = this._output.space_before_token || space_before; - this.print_token(current_token); - this._output.space_before_token = space_after; -}; - -Beautifier$5.prototype.handle_block_comment = function(current_token, preserve_statement_flags) { - if (this._output.raw) { - this._output.add_raw_token(current_token); - if (current_token.directives && current_token.directives.preserve === 'end') { - // If we're testing the raw output behavior, do not allow a directive to turn it off. - this._output.raw = this._options.test_output_raw; - } - return; - } - - if (current_token.directives) { - this.print_newline(false, preserve_statement_flags); - this.print_token(current_token); - if (current_token.directives.preserve === 'start') { - this._output.raw = true; - } - this.print_newline(false, true); - return; - } - - // inline block - if (!acorn.newline.test(current_token.text) && !current_token.newlines) { - this._output.space_before_token = true; - this.print_token(current_token); - this._output.space_before_token = true; - return; - } else { - this.print_block_commment(current_token, preserve_statement_flags); - } -}; - -Beautifier$5.prototype.print_block_commment = function(current_token, preserve_statement_flags) { - var lines = split_linebreaks(current_token.text); - var j; // iterator for this case - var javadoc = false; - var starless = false; - var lastIndent = current_token.whitespace_before; - var lastIndentLength = lastIndent.length; - - // block comment starts with a new line - this.print_newline(false, preserve_statement_flags); - - // first line always indented - this.print_token_line_indentation(current_token); - this._output.add_token(lines[0]); - this.print_newline(false, preserve_statement_flags); - - - if (lines.length > 1) { - lines = lines.slice(1); - javadoc = all_lines_start_with(lines, '*'); - starless = each_line_matches_indent(lines, lastIndent); - - if (javadoc) { - this._flags.alignment = 1; - } - - for (j = 0; j < lines.length; j++) { - if (javadoc) { - // javadoc: reformat and re-indent - this.print_token_line_indentation(current_token); - this._output.add_token(ltrim(lines[j])); - } else if (starless && lines[j]) { - // starless: re-indent non-empty content, avoiding trim - this.print_token_line_indentation(current_token); - this._output.add_token(lines[j].substring(lastIndentLength)); - } else { - // normal comments output raw - this._output.current_line.set_indent(-1); - this._output.add_token(lines[j]); - } - - // for comments on their own line or more than one line, make sure there's a new line after - this.print_newline(false, preserve_statement_flags); - } - - this._flags.alignment = 0; - } -}; - - -Beautifier$5.prototype.handle_comment = function(current_token, preserve_statement_flags) { - if (current_token.newlines) { - this.print_newline(false, preserve_statement_flags); - } else { - this._output.trim(true); - } - - this._output.space_before_token = true; - this.print_token(current_token); - this.print_newline(false, preserve_statement_flags); -}; - -Beautifier$5.prototype.handle_dot = function(current_token) { - if (this.start_of_statement(current_token)) ; else { - this.handle_whitespace_and_comments(current_token, true); - } - - if (reserved_array(this._flags.last_token, special_words)) { - this._output.space_before_token = false; - } else { - // allow preserved newlines before dots in general - // force newlines on dots after close paren when break_chained - for bar().baz() - this.allow_wrap_or_preserved_newline(current_token, - this._flags.last_token.text === ')' && this._options.break_chained_methods); - } - - // Only unindent chained method dot if this dot starts a new line. - // Otherwise the automatic extra indentation removal will handle the over indent - if (this._options.unindent_chained_methods && this._output.just_added_newline()) { - this.deindent(); - } - - this.print_token(current_token); -}; - -Beautifier$5.prototype.handle_unknown = function(current_token, preserve_statement_flags) { - this.print_token(current_token); - - if (current_token.text[current_token.text.length - 1] === '\n') { - this.print_newline(false, preserve_statement_flags); - } -}; - -Beautifier$5.prototype.handle_eof = function(current_token) { - // Unwind any open statements - while (this._flags.mode === MODE.Statement) { - this.restore_mode(); - } - this.handle_whitespace_and_comments(current_token); -}; - -beautifier$2.Beautifier = Beautifier$5; - -/*jshint node:true */ - -var Beautifier$4 = beautifier$2.Beautifier, - Options$6 = options$4.Options; - -function js_beautify$1(js_source_text, options) { - var beautifier = new Beautifier$4(js_source_text, options); - return beautifier.beautify(); -} - -javascript.exports = js_beautify$1; -javascript.exports.defaultOptions = function() { - return new Options$6(); -}; - -var css = {exports: {}}; - -var beautifier$1 = {}; - -var options$2 = {}; - -/*jshint node:true */ - -var BaseOptions$1 = options$3.Options; - -function Options$5(options) { - BaseOptions$1.call(this, options, 'css'); - - this.selector_separator_newline = this._get_boolean('selector_separator_newline', true); - this.newline_between_rules = this._get_boolean('newline_between_rules', true); - var space_around_selector_separator = this._get_boolean('space_around_selector_separator'); - this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator; - - var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']); - this.brace_style = 'collapse'; - for (var bs = 0; bs < brace_style_split.length; bs++) { - if (brace_style_split[bs] !== 'expand') { - // default to collapse, as only collapse|expand is implemented for now - this.brace_style = 'collapse'; - } else { - this.brace_style = brace_style_split[bs]; - } - } -} -Options$5.prototype = new BaseOptions$1(); - - - -options$2.Options = Options$5; - -/*jshint node:true */ - -var Options$4 = options$2.Options; -var Output$a = output$1.Output; -var InputScanner = inputscanner.InputScanner; -var Directives$1 = directives.Directives; - -var directives_core$1 = new Directives$1(/\/\*/, /\*\//); - -var lineBreak$1 = /\r\n|[\r\n]/; -var allLineBreaks$1 = /\r\n|[\r\n]/g; - -// tokenizer -var whitespaceChar = /\s/; -var whitespacePattern = /(?:\s|\n)+/g; -var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g; -var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g; - -function Beautifier$3(source_text, options) { - this._source_text = source_text || ''; - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - this._options = new Options$4(options); - this._ch = null; - this._input = null; - - // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule - this.NESTED_AT_RULE = { - "@page": true, - "@font-face": true, - "@keyframes": true, - // also in CONDITIONAL_GROUP_RULE below - "@media": true, - "@supports": true, - "@document": true - }; - this.CONDITIONAL_GROUP_RULE = { - "@media": true, - "@supports": true, - "@document": true - }; - this.NON_SEMICOLON_NEWLINE_PROPERTY = [ - "grid-template" - ]; - -} - -Beautifier$3.prototype.eatString = function(endChars) { - var result = ''; - this._ch = this._input.next(); - while (this._ch) { - result += this._ch; - if (this._ch === "\\") { - result += this._input.next(); - } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") { - break; - } - this._ch = this._input.next(); - } - return result; -}; - -// Skips any white space in the source text from the current position. -// When allowAtLeastOneNewLine is true, will output new lines for each -// newline character found; if the user has preserve_newlines off, only -// the first newline will be output -Beautifier$3.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { - var result = whitespaceChar.test(this._input.peek()); - var newline_count = 0; - while (whitespaceChar.test(this._input.peek())) { - this._ch = this._input.next(); - if (allowAtLeastOneNewLine && this._ch === '\n') { - if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { - newline_count++; - this._output.add_new_line(true); - } - } - } - return result; -}; - -// Nested pseudo-class if we are insideRule -// and the next special character found opens -// a new block -Beautifier$3.prototype.foundNestedPseudoClass = function() { - var openParen = 0; - var i = 1; - var ch = this._input.peek(i); - while (ch) { - if (ch === "{") { - return true; - } else if (ch === '(') { - // pseudoclasses can contain () - openParen += 1; - } else if (ch === ')') { - if (openParen === 0) { - return false; - } - openParen -= 1; - } else if (ch === ";" || ch === "}") { - return false; - } - i++; - ch = this._input.peek(i); - } - return false; -}; - -Beautifier$3.prototype.print_string = function(output_string) { - this._output.set_indent(this._indentLevel); - this._output.non_breaking_space = true; - this._output.add_token(output_string); -}; - -Beautifier$3.prototype.preserveSingleSpace = function(isAfterSpace) { - if (isAfterSpace) { - this._output.space_before_token = true; - } -}; - -Beautifier$3.prototype.indent = function() { - this._indentLevel++; -}; - -Beautifier$3.prototype.outdent = function() { - if (this._indentLevel > 0) { - this._indentLevel--; - } -}; - -/*_____________________--------------------_____________________*/ - -Beautifier$3.prototype.beautify = function() { - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak$1.test(source_text || '')) { - eol = source_text.match(lineBreak$1)[0]; - } - } - - - // HACK: newline parsing inconsistent. This brute force normalizes the this._input. - source_text = source_text.replace(allLineBreaks$1, '\n'); - - // reset - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - this._output = new Output$a(this._options, baseIndentString); - this._input = new InputScanner(source_text); - this._indentLevel = 0; - this._nestedLevel = 0; - - this._ch = null; - var parenLevel = 0; - - var insideRule = false; - // This is the value side of a property value pair (blue in the following ex) - // label { content: blue } - var insidePropertyValue = false; - var enteringConditionalGroup = false; - var insideAtExtend = false; - var insideAtImport = false; - var insideScssMap = false; - var topCharacter = this._ch; - var insideNonSemiColonValues = false; - var whitespace; - var isAfterSpace; - var previous_ch; - - while (true) { - whitespace = this._input.read(whitespacePattern); - isAfterSpace = whitespace !== ''; - previous_ch = topCharacter; - this._ch = this._input.next(); - if (this._ch === '\\' && this._input.hasNext()) { - this._ch += this._input.next(); - } - topCharacter = this._ch; - - if (!this._ch) { - break; - } else if (this._ch === '/' && this._input.peek() === '*') { - // /* css comment */ - // Always start block comments on a new line. - // This handles scenarios where a block comment immediately - // follows a property definition on the same line or where - // minified code is being beautified. - this._output.add_new_line(); - this._input.back(); - - var comment = this._input.read(block_comment_pattern); - - // Handle ignore directive - var directives = directives_core$1.get_directives(comment); - if (directives && directives.ignore === 'start') { - comment += directives_core$1.readIgnored(this._input); - } - - this.print_string(comment); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - - // Block comments are followed by a new line so they don't - // share a line with other properties - this._output.add_new_line(); - } else if (this._ch === '/' && this._input.peek() === '/') { - // // single line comment - // Preserves the space before a comment - // on the same line as a rule - this._output.space_before_token = true; - this._input.back(); - this.print_string(this._input.read(comment_pattern)); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - } else if (this._ch === '@' || this._ch === '$') { - this.preserveSingleSpace(isAfterSpace); - - // deal with less propery mixins @{...} - if (this._input.peek() === '{') { - this.print_string(this._ch + this.eatString('}')); - } else { - this.print_string(this._ch); - - // strip trailing space, if present, for hash property checks - var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); - - if (variableOrRule.match(/[ :]$/)) { - // we have a variable or pseudo-class, add it and insert one space before continuing - variableOrRule = this.eatString(": ").replace(/\s$/, ''); - this.print_string(variableOrRule); - this._output.space_before_token = true; - } - - variableOrRule = variableOrRule.replace(/\s$/, ''); - - if (variableOrRule === 'extend') { - insideAtExtend = true; - } else if (variableOrRule === 'import') { - insideAtImport = true; - } - - // might be a nesting at-rule - if (variableOrRule in this.NESTED_AT_RULE) { - this._nestedLevel += 1; - if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { - enteringConditionalGroup = true; - } - // might be less variable - } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { - insidePropertyValue = true; - this.indent(); - } - } - } else if (this._ch === '#' && this._input.peek() === '{') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString('}')); - } else if (this._ch === '{') { - if (insidePropertyValue) { - insidePropertyValue = false; - this.outdent(); - } - - // when entering conditional groups, only rulesets are allowed - if (enteringConditionalGroup) { - enteringConditionalGroup = false; - insideRule = (this._indentLevel >= this._nestedLevel); - } else { - // otherwise, declarations are also allowed - insideRule = (this._indentLevel >= this._nestedLevel - 1); - } - if (this._options.newline_between_rules && insideRule) { - if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') { - this._output.ensure_empty_line_above('/', ','); - } - } - - this._output.space_before_token = true; - - // The difference in print_string and indent order is necessary to indent the '{' correctly - if (this._options.brace_style === 'expand') { - this._output.add_new_line(); - this.print_string(this._ch); - this.indent(); - this._output.set_indent(this._indentLevel); - } else { - // inside mixin and first param is object - if (previous_ch === '(') { - this._output.space_before_token = false; - } else if (previous_ch !== ',') { - this.indent(); - } - this.print_string(this._ch); - } - - this.eatWhitespace(true); - this._output.add_new_line(); - } else if (this._ch === '}') { - this.outdent(); - this._output.add_new_line(); - if (previous_ch === '{') { - this._output.trim(true); - } - insideAtImport = false; - insideAtExtend = false; - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - this.print_string(this._ch); - insideRule = false; - if (this._nestedLevel) { - this._nestedLevel--; - } - - this.eatWhitespace(true); - this._output.add_new_line(); - - if (this._options.newline_between_rules && !this._output.just_added_blankline()) { - if (this._input.peek() !== '}') { - this._output.add_new_line(true); - } - } - if (this._input.peek() === ')') { - this._output.trim(true); - if (this._options.brace_style === "expand") { - this._output.add_new_line(true); - } - } - } else if (this._ch === ":") { - - for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) { - if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) { - insideNonSemiColonValues = true; - break; - } - } - - if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel === 0) { - // 'property: value' delimiter - // which could be in a conditional group query - this.print_string(':'); - if (!insidePropertyValue) { - insidePropertyValue = true; - this._output.space_before_token = true; - this.eatWhitespace(true); - this.indent(); - } - } else { - // sass/less parent reference don't use a space - // sass nested pseudo-class don't use a space - - // preserve space before pseudoclasses/pseudoelements, as it means "in any child" - if (this._input.lookBack(" ")) { - this._output.space_before_token = true; - } - if (this._input.peek() === ":") { - // pseudo-element - this._ch = this._input.next(); - this.print_string("::"); - } else { - // pseudo-class - this.print_string(':'); - } - } - } else if (this._ch === '"' || this._ch === '\'') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString(this._ch)); - this.eatWhitespace(true); - } else if (this._ch === ';') { - insideNonSemiColonValues = false; - if (parenLevel === 0) { - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - insideAtExtend = false; - insideAtImport = false; - this.print_string(this._ch); - this.eatWhitespace(true); - - // This maintains single line comments on the same - // line. Block comments are also affected, but - // a new line is always output before one inside - // that section - if (this._input.peek() !== '/') { - this._output.add_new_line(); - } - } else { - this.print_string(this._ch); - this.eatWhitespace(true); - this._output.space_before_token = true; - } - } else if (this._ch === '(') { // may be a url - if (this._input.lookBack("url")) { - this.print_string(this._ch); - this.eatWhitespace(); - parenLevel++; - this.indent(); - this._ch = this._input.next(); - if (this._ch === ')' || this._ch === '"' || this._ch === '\'') { - this._input.back(); - } else if (this._ch) { - this.print_string(this._ch + this.eatString(')')); - if (parenLevel) { - parenLevel--; - this.outdent(); - } - } - } else { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - - // handle scss/sass map - if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) { - this._output.add_new_line(); - insideScssMap = true; - } else { - this.eatWhitespace(); - parenLevel++; - this.indent(); - } - } - } else if (this._ch === ')') { - if (parenLevel) { - parenLevel--; - this.outdent(); - } - if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) { - insideScssMap = false; - this.outdent(); - this._output.add_new_line(); - } - this.print_string(this._ch); - } else if (this._ch === ',') { - this.print_string(this._ch); - this.eatWhitespace(true); - if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideAtImport && !insideAtExtend) { - this._output.add_new_line(); - } else { - this._output.space_before_token = true; - } - } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) { - //handle combinator spacing - if (this._options.space_around_combinator) { - this._output.space_before_token = true; - this.print_string(this._ch); - this._output.space_before_token = true; - } else { - this.print_string(this._ch); - this.eatWhitespace(); - // squash extra whitespace - if (this._ch && whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } - } else if (this._ch === ']') { - this.print_string(this._ch); - } else if (this._ch === '[') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - } else if (this._ch === '=') { // no whitespace before or after - this.eatWhitespace(); - this.print_string('='); - if (whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important - this.print_string(' '); - this.print_string(this._ch); - } else { - var preserveAfterSpace = previous_ch === '"' || previous_ch === '\''; - this.preserveSingleSpace(preserveAfterSpace || isAfterSpace); - this.print_string(this._ch); - - if (!this._output.just_added_newline() && this._input.peek() === '\n' && insideNonSemiColonValues) { - this._output.add_new_line(); - } - } - } - - var sweetCode = this._output.get_code(eol); - - return sweetCode; -}; - -beautifier$1.Beautifier = Beautifier$3; - -/*jshint node:true */ - -var Beautifier$2 = beautifier$1.Beautifier, - Options$3 = options$2.Options; - -function css_beautify$1(source_text, options) { - var beautifier = new Beautifier$2(source_text, options); - return beautifier.beautify(); -} - -css.exports = css_beautify$1; -css.exports.defaultOptions = function() { - return new Options$3(); -}; - -var html = {exports: {}}; - -var beautifier = {}; - -var options$1 = {}; - -/*jshint node:true */ - -var BaseOptions = options$3.Options; - -function Options$2(options) { - BaseOptions.call(this, options, 'html'); - if (this.templating.length === 1 && this.templating[0] === 'auto') { - this.templating = ['django', 'erb', 'handlebars', 'php']; - } - - this.indent_inner_html = this._get_boolean('indent_inner_html'); - this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true); - this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true); - - this.indent_handlebars = this._get_boolean('indent_handlebars', true); - this.wrap_attributes = this._get_selection('wrap_attributes', - ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple', 'preserve', 'preserve-aligned']); - this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size); - this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']); - - // Block vs inline elements - // https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements - // https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements - // https://www.w3.org/TR/html5/dom.html#phrasing-content - this.inline = this._get_array('inline', [ - 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite', - 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', - 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript', - 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small', - 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var', - 'video', 'wbr', 'text', - // obsolete inline tags - 'acronym', 'big', 'strike', 'tt' - ]); - this.void_elements = this._get_array('void_elements', [ - // HTLM void elements - aka self-closing tags - aka singletons - // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements - 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', - 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr', - // NOTE: Optional tags are too complex for a simple list - // they are hard coded in _do_optional_end_element - - // Doctype and xml elements - '!doctype', '?xml', - - // obsolete tags - // basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm - // isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex - 'basefont', 'isindex' - ]); - this.unformatted = this._get_array('unformatted', []); - this.content_unformatted = this._get_array('content_unformatted', [ - 'pre', 'textarea' - ]); - this.unformatted_content_delimiter = this._get_characters('unformatted_content_delimiter'); - this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']); - -} -Options$2.prototype = new BaseOptions(); - - - -options$1.Options = Options$2; - -var tokenizer = {}; - -/*jshint node:true */ - -var BaseTokenizer = tokenizer$1.Tokenizer; -var BASETOKEN = tokenizer$1.TOKEN; -var Directives = directives.Directives; -var TemplatablePattern = templatablepattern.TemplatablePattern; -var Pattern = pattern.Pattern; - -var TOKEN$1 = { - TAG_OPEN: 'TK_TAG_OPEN', - TAG_CLOSE: 'TK_TAG_CLOSE', - ATTRIBUTE: 'TK_ATTRIBUTE', - EQUALS: 'TK_EQUALS', - VALUE: 'TK_VALUE', - COMMENT: 'TK_COMMENT', - TEXT: 'TK_TEXT', - UNKNOWN: 'TK_UNKNOWN', - START: BASETOKEN.START, - RAW: BASETOKEN.RAW, - EOF: BASETOKEN.EOF -}; - -var directives_core = new Directives(/<\!--/, /-->/); - -var Tokenizer$1 = function(input_string, options) { - BaseTokenizer.call(this, input_string, options); - this._current_tag_name = ''; - - // Words end at whitespace or when a tag starts - // if we are indenting handlebars, they are considered tags - var templatable_reader = new TemplatablePattern(this._input).read_options(this._options); - var pattern_reader = new Pattern(this._input); - - this.__patterns = { - word: templatable_reader.until(/[\n\r\t <]/), - single_quote: templatable_reader.until_after(/'/), - double_quote: templatable_reader.until_after(/"/), - attribute: templatable_reader.until(/[\n\r\t =>]|\/>/), - element_name: templatable_reader.until(/[\n\r\t >\/]/), - - handlebars_comment: pattern_reader.starting_with(/{{!--/).until_after(/--}}/), - handlebars: pattern_reader.starting_with(/{{/).until_after(/}}/), - handlebars_open: pattern_reader.until(/[\n\r\t }]/), - handlebars_raw_close: pattern_reader.until(/}}/), - comment: pattern_reader.starting_with(//), - cdata: pattern_reader.starting_with(//), - // https://en.wikipedia.org/wiki/Conditional_comment - conditional_comment: pattern_reader.starting_with(//), - processing: pattern_reader.starting_with(/<\?/).until_after(/\?>/) - }; - - if (this._options.indent_handlebars) { - this.__patterns.word = this.__patterns.word.exclude('handlebars'); - } - - this._unformatted_content_delimiter = null; - - if (this._options.unformatted_content_delimiter) { - var literal_regexp = this._input.get_literal_regexp(this._options.unformatted_content_delimiter); - this.__patterns.unformatted_content_delimiter = - pattern_reader.matching(literal_regexp) - .until_after(literal_regexp); - } -}; -Tokenizer$1.prototype = new BaseTokenizer(); - -Tokenizer$1.prototype._is_comment = function(current_token) { // jshint unused:false - return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN; -}; - -Tokenizer$1.prototype._is_opening = function(current_token) { - return current_token.type === TOKEN$1.TAG_OPEN; -}; - -Tokenizer$1.prototype._is_closing = function(current_token, open_token) { - return current_token.type === TOKEN$1.TAG_CLOSE && - (open_token && ( - ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') || - (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{'))); -}; - -Tokenizer$1.prototype._reset = function() { - this._current_tag_name = ''; -}; - -Tokenizer$1.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - var token = null; - this._readWhitespace(); - var c = this._input.peek(); - - if (c === null) { - return this._create_token(TOKEN$1.EOF, ''); - } - - token = token || this._read_open_handlebars(c, open_token); - token = token || this._read_attribute(c, previous_token, open_token); - token = token || this._read_close(c, open_token); - token = token || this._read_raw_content(c, previous_token, open_token); - token = token || this._read_content_word(c); - token = token || this._read_comment_or_cdata(c); - token = token || this._read_processing(c); - token = token || this._read_open(c, open_token); - token = token || this._create_token(TOKEN$1.UNKNOWN, this._input.next()); - - return token; -}; - -Tokenizer$1.prototype._read_comment_or_cdata = function(c) { // jshint unused:false - var token = null; - var resulting_string = null; - var directives = null; - - if (c === '<') { - var peek1 = this._input.peek(1); - // We treat all comments as literals, even more than preformatted tags - // we only look for the appropriate closing marker - if (peek1 === '!') { - resulting_string = this.__patterns.comment.read(); - - // only process directive on html comments - if (resulting_string) { - directives = directives_core.get_directives(resulting_string); - if (directives && directives.ignore === 'start') { - resulting_string += directives_core.readIgnored(this._input); - } - } else { - resulting_string = this.__patterns.cdata.read(); - } - } - - if (resulting_string) { - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - token.directives = directives; - } - } - - return token; -}; - -Tokenizer$1.prototype._read_processing = function(c) { // jshint unused:false - var token = null; - var resulting_string = null; - var directives = null; - - if (c === '<') { - var peek1 = this._input.peek(1); - if (peek1 === '!' || peek1 === '?') { - resulting_string = this.__patterns.conditional_comment.read(); - resulting_string = resulting_string || this.__patterns.processing.read(); - } - - if (resulting_string) { - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - token.directives = directives; - } - } - - return token; -}; - -Tokenizer$1.prototype._read_open = function(c, open_token) { - var resulting_string = null; - var token = null; - if (!open_token) { - if (c === '<') { - - resulting_string = this._input.next(); - if (this._input.peek() === '/') { - resulting_string += this._input.next(); - } - resulting_string += this.__patterns.element_name.read(); - token = this._create_token(TOKEN$1.TAG_OPEN, resulting_string); - } - } - return token; -}; - -Tokenizer$1.prototype._read_open_handlebars = function(c, open_token) { - var resulting_string = null; - var token = null; - if (!open_token) { - if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') { - if (this._input.peek(2) === '!') { - resulting_string = this.__patterns.handlebars_comment.read(); - resulting_string = resulting_string || this.__patterns.handlebars.read(); - token = this._create_token(TOKEN$1.COMMENT, resulting_string); - } else { - resulting_string = this.__patterns.handlebars_open.read(); - token = this._create_token(TOKEN$1.TAG_OPEN, resulting_string); - } - } - } - return token; -}; - - -Tokenizer$1.prototype._read_close = function(c, open_token) { - var resulting_string = null; - var token = null; - if (open_token) { - if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) { - resulting_string = this._input.next(); - if (c === '/') { // for close tag "/>" - resulting_string += this._input.next(); - } - token = this._create_token(TOKEN$1.TAG_CLOSE, resulting_string); - } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') { - this._input.next(); - this._input.next(); - token = this._create_token(TOKEN$1.TAG_CLOSE, '}}'); - } - } - - return token; -}; - -Tokenizer$1.prototype._read_attribute = function(c, previous_token, open_token) { - var token = null; - var resulting_string = ''; - if (open_token && open_token.text[0] === '<') { - - if (c === '=') { - token = this._create_token(TOKEN$1.EQUALS, this._input.next()); - } else if (c === '"' || c === "'") { - var content = this._input.next(); - if (c === '"') { - content += this.__patterns.double_quote.read(); - } else { - content += this.__patterns.single_quote.read(); - } - token = this._create_token(TOKEN$1.VALUE, content); - } else { - resulting_string = this.__patterns.attribute.read(); - - if (resulting_string) { - if (previous_token.type === TOKEN$1.EQUALS) { - token = this._create_token(TOKEN$1.VALUE, resulting_string); - } else { - token = this._create_token(TOKEN$1.ATTRIBUTE, resulting_string); - } - } - } - } - return token; -}; - -Tokenizer$1.prototype._is_content_unformatted = function(tag_name) { - // void_elements have no content and so cannot have unformatted content - // script and style tags should always be read as unformatted content - // finally content_unformatted and unformatted element contents are unformatted - return this._options.void_elements.indexOf(tag_name) === -1 && - (this._options.content_unformatted.indexOf(tag_name) !== -1 || - this._options.unformatted.indexOf(tag_name) !== -1); -}; - - -Tokenizer$1.prototype._read_raw_content = function(c, previous_token, open_token) { // jshint unused:false - var resulting_string = ''; - if (open_token && open_token.text[0] === '{') { - resulting_string = this.__patterns.handlebars_raw_close.read(); - } else if (previous_token.type === TOKEN$1.TAG_CLOSE && - previous_token.opened.text[0] === '<' && previous_token.text[0] !== '/') { - // ^^ empty tag has no content - var tag_name = previous_token.opened.text.substr(1).toLowerCase(); - if (tag_name === 'script' || tag_name === 'style') { - // Script and style tags are allowed to have comments wrapping their content - // or just have regular content. - var token = this._read_comment_or_cdata(c); - if (token) { - token.type = TOKEN$1.TEXT; - return token; - } - resulting_string = this._input.readUntil(new RegExp('', 'ig')); - } else if (this._is_content_unformatted(tag_name)) { - - resulting_string = this._input.readUntil(new RegExp('', 'ig')); - } - } - - if (resulting_string) { - return this._create_token(TOKEN$1.TEXT, resulting_string); - } - - return null; -}; - -Tokenizer$1.prototype._read_content_word = function(c) { - var resulting_string = ''; - if (this._options.unformatted_content_delimiter) { - if (c === this._options.unformatted_content_delimiter[0]) { - resulting_string = this.__patterns.unformatted_content_delimiter.read(); - } - } - - if (!resulting_string) { - resulting_string = this.__patterns.word.read(); - } - if (resulting_string) { - return this._create_token(TOKEN$1.TEXT, resulting_string); - } -}; - -tokenizer.Tokenizer = Tokenizer$1; -tokenizer.TOKEN = TOKEN$1; - -/*jshint node:true */ - -var Options$1 = options$1.Options; -var Output$9 = output$1.Output; -var Tokenizer = tokenizer.Tokenizer; -var TOKEN = tokenizer.TOKEN; - -var lineBreak = /\r\n|[\r\n]/; -var allLineBreaks = /\r\n|[\r\n]/g; - -var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions - - this.indent_level = 0; - this.alignment_size = 0; - this.max_preserve_newlines = options.max_preserve_newlines; - this.preserve_newlines = options.preserve_newlines; - - this._output = new Output$9(options, base_indent_string); - -}; - -Printer.prototype.current_line_has_match = function(pattern) { - return this._output.current_line.has_match(pattern); -}; - -Printer.prototype.set_space_before_token = function(value, non_breaking) { - this._output.space_before_token = value; - this._output.non_breaking_space = non_breaking; -}; - -Printer.prototype.set_wrap_point = function() { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.set_wrap_point(); -}; - - -Printer.prototype.add_raw_token = function(token) { - this._output.add_raw_token(token); -}; - -Printer.prototype.print_preserved_newlines = function(raw_token) { - var newlines = 0; - if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) { - newlines = raw_token.newlines ? 1 : 0; - } - - if (this.preserve_newlines) { - newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1; - } - for (var n = 0; n < newlines; n++) { - this.print_newline(n > 0); - } - - return newlines !== 0; -}; - -Printer.prototype.traverse_whitespace = function(raw_token) { - if (raw_token.whitespace_before || raw_token.newlines) { - if (!this.print_preserved_newlines(raw_token)) { - this._output.space_before_token = true; - } - return true; - } - return false; -}; - -Printer.prototype.previous_token_wrapped = function() { - return this._output.previous_token_wrapped; -}; - -Printer.prototype.print_newline = function(force) { - this._output.add_new_line(force); -}; - -Printer.prototype.print_token = function(token) { - if (token.text) { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.add_token(token.text); - } -}; - -Printer.prototype.indent = function() { - this.indent_level++; -}; - -Printer.prototype.get_full_indent = function(level) { - level = this.indent_level + (level || 0); - if (level < 1) { - return ''; - } - - return this._output.get_indent_string(level); -}; - -var get_type_attribute = function(start_token) { - var result = null; - var raw_token = start_token.next; - - // Search attributes for a type attribute - while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) { - if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') { - if (raw_token.next && raw_token.next.type === TOKEN.EQUALS && - raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) { - result = raw_token.next.next.text; - } - break; - } - raw_token = raw_token.next; - } - - return result; -}; - -var get_custom_beautifier_name = function(tag_check, raw_token) { - var typeAttribute = null; - var result = null; - - if (!raw_token.closed) { - return null; - } - - if (tag_check === 'script') { - typeAttribute = 'text/javascript'; - } else if (tag_check === 'style') { - typeAttribute = 'text/css'; - } - - typeAttribute = get_type_attribute(raw_token) || typeAttribute; - - // For script and style tags that have a type attribute, only enable custom beautifiers for matching values - // For those without a type attribute use default; - if (typeAttribute.search('text/css') > -1) { - result = 'css'; - } else if (typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/) > -1) { - result = 'javascript'; - } else if (typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/) > -1) { - result = 'html'; - } else if (typeAttribute.search(/test\/null/) > -1) { - // Test only mime-type for testing the beautifier when null is passed as beautifing function - result = 'null'; - } - - return result; -}; - -function in_array(what, arr) { - return arr.indexOf(what) !== -1; -} - -function TagFrame(parent, parser_token, indent_level) { - this.parent = parent || null; - this.tag = parser_token ? parser_token.tag_name : ''; - this.indent_level = indent_level || 0; - this.parser_token = parser_token || null; -} - -function TagStack(printer) { - this._printer = printer; - this._current_frame = null; -} - -TagStack.prototype.get_parser_token = function() { - return this._current_frame ? this._current_frame.parser_token : null; -}; - -TagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object - var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level); - this._current_frame = new_frame; -}; - -TagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer - var parser_token = null; - - if (frame) { - parser_token = frame.parser_token; - this._printer.indent_level = frame.indent_level; - this._current_frame = frame.parent; - } - - return parser_token; -}; - -TagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._current_frame; - - while (frame) { //till we reach '' (the initial value); - if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it - break; - } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) { - frame = null; - break; - } - frame = frame.parent; - } - - return frame; -}; - -TagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._get_frame([tag], stop_list); - return this._try_pop_frame(frame); -}; - -TagStack.prototype.indent_to_tag = function(tag_list) { - var frame = this._get_frame(tag_list); - if (frame) { - this._printer.indent_level = frame.indent_level; - } -}; - -function Beautifier$1(source_text, options, js_beautify, css_beautify) { - //Wrapper function to invoke all the necessary constructors and deal with the output. - this._source_text = source_text || ''; - options = options || {}; - this._js_beautify = js_beautify; - this._css_beautify = css_beautify; - this._tag_stack = null; - - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - var optionHtml = new Options$1(options, 'html'); - - this._options = optionHtml; - - this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force'; - this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline'); - this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned'); - this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple'); - this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, 'preserve'.length) === 'preserve'; - this._is_wrap_attributes_preserve_aligned = (this._options.wrap_attributes === 'preserve-aligned'); -} - -Beautifier$1.prototype.beautify = function() { - - // if disabled, return the input unchanged. - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (this._options.eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak.test(source_text)) { - eol = source_text.match(lineBreak)[0]; - } - } - - // HACK: newline parsing inconsistent. This brute force normalizes the input. - source_text = source_text.replace(allLineBreaks, '\n'); - - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - var last_token = { - text: '', - type: '' - }; - - var last_tag_token = new TagOpenParserToken(); - - var printer = new Printer(this._options, baseIndentString); - var tokens = new Tokenizer(source_text, this._options).tokenize(); - - this._tag_stack = new TagStack(printer); - - var parser_token = null; - var raw_token = tokens.next(); - while (raw_token.type !== TOKEN.EOF) { - - if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) { - parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token); - last_tag_token = parser_token; - } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) || - (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) { - parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens); - } else if (raw_token.type === TOKEN.TAG_CLOSE) { - parser_token = this._handle_tag_close(printer, raw_token, last_tag_token); - } else if (raw_token.type === TOKEN.TEXT) { - parser_token = this._handle_text(printer, raw_token, last_tag_token); - } else { - // This should never happen, but if it does. Print the raw token - printer.add_raw_token(raw_token); - } - - last_token = parser_token; - - raw_token = tokens.next(); - } - var sweet_code = printer._output.get_code(eol); - - return sweet_code; -}; - -Beautifier$1.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - printer.alignment_size = 0; - last_tag_token.tag_complete = true; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else { - if (last_tag_token.tag_start_char === '<') { - printer.set_space_before_token(raw_token.text[0] === '/', true); // space before />, no space before > - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) { - printer.print_newline(false); - } - } - printer.print_token(raw_token); - - } - - if (last_tag_token.indent_content && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.indent(); - - // only indent once per opened tag - last_tag_token.indent_content = false; - } - - if (!last_tag_token.is_inline_element && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.set_wrap_point(); - } - - return parser_token; -}; - -Beautifier$1.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) { - var wrapped = last_tag_token.has_wrapped_attrs; - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else if (last_tag_token.tag_start_char === '{' && raw_token.type === TOKEN.TEXT) { - // For the insides of handlebars allow newlines or a single space between open and contents - if (printer.print_preserved_newlines(raw_token)) { - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - } else { - printer.print_token(raw_token); - } - } else { - if (raw_token.type === TOKEN.ATTRIBUTE) { - printer.set_space_before_token(true); - last_tag_token.attr_count += 1; - } else if (raw_token.type === TOKEN.EQUALS) { //no space before = - printer.set_space_before_token(false); - } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value - printer.set_space_before_token(false); - } - - if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === '<') { - if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) { - printer.traverse_whitespace(raw_token); - wrapped = wrapped || raw_token.newlines !== 0; - } - - - if (this._is_wrap_attributes_force) { - var force_attr_wrap = last_tag_token.attr_count > 1; - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) { - var is_only_attribute = true; - var peek_index = 0; - var peek_token; - do { - peek_token = tokens.peek(peek_index); - if (peek_token.type === TOKEN.ATTRIBUTE) { - is_only_attribute = false; - break; - } - peek_index += 1; - } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE); - - force_attr_wrap = !is_only_attribute; - } - - if (force_attr_wrap) { - printer.print_newline(false); - wrapped = true; - } - } - } - printer.print_token(raw_token); - wrapped = wrapped || printer.previous_token_wrapped(); - last_tag_token.has_wrapped_attrs = wrapped; - } - return parser_token; -}; - -Beautifier$1.prototype._handle_text = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: 'TK_CONTENT' - }; - if (last_tag_token.custom_beautifier_name) { //check if we need to format javascript - this._print_custom_beatifier_text(printer, raw_token, last_tag_token); - } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) { - printer.add_raw_token(raw_token); - } else { - printer.traverse_whitespace(raw_token); - printer.print_token(raw_token); - } - return parser_token; -}; - -Beautifier$1.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) { - var local = this; - if (raw_token.text !== '') { - - var text = raw_token.text, - _beautifier, - script_indent_level = 1, - pre = '', - post = ''; - if (last_tag_token.custom_beautifier_name === 'javascript' && typeof this._js_beautify === 'function') { - _beautifier = this._js_beautify; - } else if (last_tag_token.custom_beautifier_name === 'css' && typeof this._css_beautify === 'function') { - _beautifier = this._css_beautify; - } else if (last_tag_token.custom_beautifier_name === 'html') { - _beautifier = function(html_source, options) { - var beautifier = new Beautifier$1(html_source, options, local._js_beautify, local._css_beautify); - return beautifier.beautify(); - }; - } - - if (this._options.indent_scripts === "keep") { - script_indent_level = 0; - } else if (this._options.indent_scripts === "separate") { - script_indent_level = -printer.indent_level; - } - - var indentation = printer.get_full_indent(script_indent_level); - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - // Handle the case where content is wrapped in a comment or cdata. - if (last_tag_token.custom_beautifier_name !== 'html' && - text[0] === '<' && text.match(/^(|]]>)$/.exec(text); - - // if we start to wrap but don't finish, print raw - if (!matched) { - printer.add_raw_token(raw_token); - return; - } - - pre = indentation + matched[1] + '\n'; - text = matched[4]; - if (matched[5]) { - post = indentation + matched[5]; - } - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - if (matched[2] || matched[3].indexOf('\n') !== -1) { - // if the first line of the non-comment text has spaces - // use that as the basis for indenting in null case. - matched = matched[3].match(/[ \t]+$/); - if (matched) { - raw_token.whitespace_before = matched[0]; - } - } - } - - if (text) { - if (_beautifier) { - - // call the Beautifier if avaliable - var Child_options = function() { - this.eol = '\n'; - }; - Child_options.prototype = this._options.raw_options; - var child_options = new Child_options(); - text = _beautifier(indentation + text, child_options); - } else { - // simply indent the string otherwise - var white = raw_token.whitespace_before; - if (white) { - text = text.replace(new RegExp('\n(' + white + ')?', 'g'), '\n'); - } - - text = indentation + text.replace(/\n/g, '\n' + indentation); - } - } - - if (pre) { - if (!text) { - text = pre + post; - } else { - text = pre + text + '\n' + post; - } - } - - printer.print_newline(false); - if (text) { - raw_token.text = text; - raw_token.whitespace_before = ''; - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - printer.print_newline(true); - } - } -}; - -Beautifier$1.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) { - var parser_token = this._get_tag_open_token(raw_token); - - if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) && - !last_tag_token.is_empty_element && - raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - } else { - tag_check_match = raw_token.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - - // handle "{{#> myPartial}} - if (raw_token.text === '{{#>' && this.tag_check === '>' && raw_token.next !== null) { - this.tag_check = raw_token.next.text.split(' ')[0]; - } - } - this.tag_check = this.tag_check.toLowerCase(); - - if (raw_token.type === TOKEN.COMMENT) { - this.tag_complete = true; - } - - this.is_start_tag = this.tag_check.charAt(0) !== '/'; - this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check; - this.is_end_tag = !this.is_start_tag || - (raw_token.closed && raw_token.closed.text === '/>'); - - // handlebars tags that don't start with # or ^ are single_tags, and so also start and end. - this.is_end_tag = this.is_end_tag || - (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\^]/.test(this.text.charAt(2))))); - } -}; - -Beautifier$1.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type - var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token); - - parser_token.alignment_size = this._options.wrap_attributes_indent_size; - - parser_token.is_end_tag = parser_token.is_end_tag || - in_array(parser_token.tag_check, this._options.void_elements); - - parser_token.is_empty_element = parser_token.tag_complete || - (parser_token.is_start_tag && parser_token.is_end_tag); - - parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted); - parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted); - parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{'; - - return parser_token; -}; - -Beautifier$1.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) { - - if (!parser_token.is_empty_element) { - if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors - } else { // it's a start-tag - // check if this tag is starting an element that has optional end element - // and do an ending needed - if (this._do_optional_end_element(parser_token)) { - if (!parser_token.is_inline_element) { - printer.print_newline(false); - } - } - - this._tag_stack.record_tag(parser_token); //push it on the tag stack - - if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') && - !(parser_token.is_unformatted || parser_token.is_content_unformatted)) { - parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token); - } - } - } - - if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line - printer.print_newline(false); - if (!printer._output.just_added_blankline()) { - printer.print_newline(true); - } - } - - if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /) - - // if you hit an else case, reset the indent level if you are inside an: - // 'if', 'unless', or 'each' block. - if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') { - this._tag_stack.indent_to_tag(['if', 'unless', 'each']); - parser_token.indent_content = true; - // Don't add a newline if opening {{#if}} tag is on the current line - var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/); - if (!foundIfOnCurrentLine) { - printer.print_newline(false); - } - } - - // Don't add a newline before elements that should remain where they are. - if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE && - last_tag_token.is_end_tag && parser_token.text.indexOf('\n') === -1) ; else { - if (!(parser_token.is_inline_element || parser_token.is_unformatted)) { - printer.print_newline(false); - } - this._calcluate_parent_multiline(printer, parser_token); - } - } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - var do_end_expand = false; - - // deciding whether a block is multiline should not be this hard - do_end_expand = parser_token.start_tag_token && parser_token.start_tag_token.multiline_content; - do_end_expand = do_end_expand || (!parser_token.is_inline_element && - !(last_tag_token.is_inline_element || last_tag_token.is_unformatted) && - !(last_token.type === TOKEN.TAG_CLOSE && parser_token.start_tag_token === last_tag_token) && - last_token.type !== 'TK_CONTENT' - ); - - if (parser_token.is_content_unformatted || parser_token.is_unformatted) { - do_end_expand = false; - } - - if (do_end_expand) { - printer.print_newline(false); - } - } else { // it's a start-tag - parser_token.indent_content = !parser_token.custom_beautifier_name; - - if (parser_token.tag_start_char === '<') { - if (parser_token.tag_name === 'html') { - parser_token.indent_content = this._options.indent_inner_html; - } else if (parser_token.tag_name === 'head') { - parser_token.indent_content = this._options.indent_head_inner_html; - } else if (parser_token.tag_name === 'body') { - parser_token.indent_content = this._options.indent_body_inner_html; - } - } - - if (!(parser_token.is_inline_element || parser_token.is_unformatted) && - (last_token.type !== 'TK_CONTENT' || parser_token.is_content_unformatted)) { - printer.print_newline(false); - } - - this._calcluate_parent_multiline(printer, parser_token); - } -}; - -Beautifier$1.prototype._calcluate_parent_multiline = function(printer, parser_token) { - if (parser_token.parent && printer._output.just_added_newline() && - !((parser_token.is_inline_element || parser_token.is_unformatted) && parser_token.parent.is_inline_element)) { - parser_token.parent.multiline_content = true; - } -}; - -//To be used for

tag special case: -var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul']; -var p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video']; - -Beautifier$1.prototype._do_optional_end_element = function(parser_token) { - var result = null; - // NOTE: cases of "if there is no more content in the parent element" - // are handled automatically by the beautifier. - // It assumes parent or ancestor close tag closes all children. - // https://www.w3.org/TR/html5/syntax.html#optional-tags - if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) { - return; - - } - - if (parser_token.tag_name === 'body') { - // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment. - result = result || this._tag_stack.try_pop('head'); - - //} else if (parser_token.tag_name === 'body') { - // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment. - - } else if (parser_token.tag_name === 'li') { - // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element. - result = result || this._tag_stack.try_pop('li', ['ol', 'ul']); - - } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') { - // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element. - // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element. - result = result || this._tag_stack.try_pop('dt', ['dl']); - result = result || this._tag_stack.try_pop('dd', ['dl']); - - - } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) { - // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method - // check for the parent element is an HTML element that is not an ,

Index of ${title}

\n`; - body += '
    \n'; - body += `
  • ../
  • \n`; - - const list = await fsReaddir(parent); - const dirs = []; - const files = []; - - for (const file of list) { - const path = Path$6.join(parent, file); - const stat = await fsStat(path); - - if (stat.isDirectory()) - dirs.push(file); - else - files.push(file); - } - - for (const file of dirs.sort()) { - const name = escapeHTML(file); - const href = `${prefix}${name}`; - body += `
  • ${name}/
  • \n`; - } - - for (const file of files.sort()) { - const name = escapeHTML(file); - const href = `${prefix}${name}`; - body += `
  • ${name}
  • \n`; - } - - body += '
\n'; - body += ' \n'; - body += '\n'; - - return body; -} - -/* - * Expose - */ - -var file_1 = fileServer; - -/*! - * jsonrpc.js - json-rpc middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - -const assert$u = assert_1$1; - -/** - * JSON rpc middleware. - * @param {Object} rpc - * @returns {Function} - */ - -function jsonRPC(rpc) { - assert$u(rpc && typeof rpc === 'object'); - assert$u(typeof rpc.call === 'function'); - - return async (req, res) => { - if (req.method !== 'POST') - return; - - if (req.pathname !== '/') - return; - - if (req.body instanceof Array) { - for (const request of req.body) { - if (typeof request.method !== 'string') - return; - } - } else { - if (typeof req.body.method !== 'string') - return; - } - - let json = await rpc.call(req.body, req.query); - - if (json == null) - json = null; - - json = JSON.stringify(json); - json += '\n'; - - res.setHeader('X-Long-Polling', '/?longpoll=1'); - - res.send(200, json, 'application/json'); - }; -} - -/* - * Expose - */ - -var jsonrpc = jsonRPC; - -/*! - * router.js - router middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - -const assert$t = assert_1$1; - -/** - * Router middleware. - * @returns {Function} - */ - -function router$2(routes) { - assert$t(routes && typeof routes === 'object'); - assert$t(typeof routes.handle === 'function'); - return async (req, res) => { - return routes.handle(req, res); - }; -} - -/* - * Expose - */ - -var router_1 = router$2; - -/*! - * middleware.js - middleware for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - -middleware$2.basicAuth = basicauth; -middleware$2.bodyParser = bodyparser; -middleware$2.cookieParser = cookie; -middleware$2.cors = cors_1; -middleware$2.fileServer = file_1; -middleware$2.jsonRPC = jsonrpc; -middleware$2.router = router_1; - -/*! - * server.js - http server for bweb - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - -const assert$s = assert_1$1; -const fs$3 = require$$0$5; -const Path$5 = require$$1$3; -const EventEmitter$3 = require$$1$4; -const bsock = bsock$1; -const Request = request; -const Response = response; -const Router$6 = router$3; -const Hook = hook; -const RPC$6 = rpc$2; -const middleware$1 = middleware$2; - -/** - * HTTP Server - * @extends EventEmitter - */ - -class Server$3 extends EventEmitter$3 { - /** - * Create an http server. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super(); - - this.options = options || {}; - this.config = new ServerOptions(options); - this.config.load(); - - const http = this.config.getBackend(); - const opt = this.config.toHTTP(); - - this.http = http.createServer(opt); - this.io = bsock.server(); - this.rpc = new RPC$6(); - this.routes = new Router$6(); - this.mounts = []; - this.stack = []; - this.opened = false; - this.mounted = false; - this.parent = null; - this.bound = false; - this._reject = null; - } - - /** - * Bind to events. - * @private - */ - - _bind() { - if (this.bound) - return; - - this.bound = true; - - this.http.on('close', () => { - this.emit('close'); - }); - - this.http.on('connection', (socket) => { - socket.on('error', (err) => { - if (err.message === 'Parse Error') { - let msg = 'HttpParser execute failure'; - msg += ` (parsed=${err.bytesParsed || -1}`; - msg += ` code=${err.code})`; - err = new Error(msg); - } - - this.emit('error', err); - - try { - socket.destroy(); - } catch (e) { - this.emit('error', e); - } - }); - }); - - this.http.on('error', (err) => { - const reject = this._reject; - - if (reject) { - this._reject = null; - reject(err); - return; - } - - this.emit('error', err); - }); - - this.http.on('listening', () => { - this.emit('listening', this.address()); - }); - - this.http.on('request', async (hreq, hres) => { - let req = null; - let res = null; - - try { - hreq.on('error', e => this.emit('error', e)); - hreq.pause(); - req = new Request(hreq, hres, hreq.url); - res = new Response(hreq, hres); - } catch (e) { - this.emit('error', e); - try { - hres.destroy(); - } catch (e) { - this.emit('error', e); - } - return; - } - - try { - await this._handleRequest(req, res); - } catch (e) { - await this._handleError(e, req, res); - } - }); - - if (this.config.sockets) - this.io.attach(this.http); - - this.io.on('error', (err) => { - this.emit('error', err); - }); - - this.io.on('socket', (socket) => { - socket.on('error', (err) => { - this.emit('error', err); - }); - - this.handleSocket(socket); - this.emit('socket', socket); - }); - - this.rpc.on('error', (err) => { - this.emit('error', err); - }); - - this.rpc.on('call', (cmd, query) => { - this.handleCall(cmd, query); - this.emit('call', cmd, query); - }); - } - - /** - * Handle an error. - * @private - * @param {Error} err - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleError(err, req, res) { - const code = err.statusCode || 500; - - if (code === 500) - this.emit('error', err); - - if (res.sent) - return; - - if (!this.onError) { - res.send(code, `HTTP Error: ${code}.`); - return; - } - - try { - await this.onError(err, req, res); - } catch (e) { - this.emit('error', e); - res.send(500, 'Internal Server Error.'); - } - } - - /** - * Handle a request. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleRequest(req, res) { - if (await this._handleMounts(req, res)) - return undefined; - - this.emit('request', req, res); - - if (await this._handleStack(req, res)) - return undefined; - - const err = new Error('Not found.'); - err.statusCode = 404; - - return this._handleError(err, req, res); - } - - /** - * Handle mount stack. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleMounts(req, res) { - const url = req.url; - - for (const hook of this.mounts) { - const server = hook.handler; - - if (!hook.isPrefix(req.pathname)) - continue; - - const uri = url.substring(hook.path.length); - - req.navigate(uri); - - try { - await server._handleRequest(req, res); - } catch (e) { - try { - await server._handleError(e, req, res); - } finally { - req.navigate(url); - } - return true; - } - - req.navigate(url); - - return true; - } - - return false; - } - - /** - * Handle middleware stack. - * @private - * @param {Request} req - * @param {Response} res - * @returns {Promise} - */ - - async _handleStack(req, res) { - const url = req.url; - - let err = null; - - for (const hook of this.stack) { - if (!hook.isPrefix(req.pathname)) - continue; - - if (hook.path !== '/') { - const uri = url.substring(hook.path.length); - req.navigate(uri); - } - - if (err) { - if (hook.arity !== 3) - continue; - - try { - await hook.handler(err, req, res); - if (res.sent) - return true; - } finally { - if (hook.path !== '/') - req.navigate(url); - } - - continue; - } - - if (hook.arity !== 2) - continue; - - try { - await hook.handler(req, res); - if (res.sent) - return true; - } catch (e) { - err = e; - } finally { - if (hook.path !== '/') - req.navigate(url); - } - } - - if (err) - throw err; - - return false; - } - - /** - * Handle socket (abstract). - * @param {Object} socket - */ - - handleSocket(socket) {} - - /** - * Handle call (abstract). - * @param {Object} cmd - * @param {Object} query - */ - - handleCall(cmd, query) {} - - /** - * Open the server. - * @returns {Promise} - */ - - async open() { - assert$s(!this.opened, 'Already opened.'); - - this.opened = true; - - this._bind(); - - if (this.mounted) - return this.parent.address(); - - const {port, host} = this.config; - - return new Promise((resolve, reject) => { - this._reject = reject; - - const cb = () => { - this._reject = null; - resolve(this.address()); - }; - - try { - this.http.listen(port, host, cb); - } catch (e) { - this._reject = null; - reject(e); - } - }); - } - - /** - * Close the server. - * @returns {Promise} - */ - - async close() { - assert$s(this.opened, 'Not open.'); - - this.opened = false; - - if (this.mounted) - return undefined; - - return new Promise((resolve, reject) => { - this._reject = reject; - - const cb = (err) => { - this._reject = null; - - if (err) { - reject(err); - return; - } - - resolve(); - }; - - try { - this.io.close(); - this.http.close(cb); - } catch (e) { - this._reject = null; - reject(e); - } - }); - } - - /** - * Setup error handler. - * @param {Function} handler - */ - - error(handler) { - assert$s(typeof handler === 'function'); - this.onError = handler; - } - - /** - * Mount a server. - * @param {String} path - * @param {Server} server - */ - - mount(path, server) { - assert$s(typeof path === 'string'); - assert$s(server && typeof server === 'object'); - assert$s(!server.opened); - assert$s(!server.mounted); - - if (server.config.sockets) - this.io.mount(server.io); - - this.rpc.mount(server.rpc); - - server.parent = this; - server.mounted = true; - - this.mounts.push(new Hook(path, server)); - } - - /** - * Attach a server. - * @param {String} path - * @param {Server} server - */ - - attach(path, server) { - this._bind(); - server.mount(path, this); - } - - /** - * Add a middleware to the stack. - * @param {String?} path - * @param {Function} handler - */ - - use(path, handler) { - if (!handler) { - handler = path; - path = '/'; - } - this.stack.push(new Hook(path, handler)); - } - - /** - * Add a hook to the stack. - * @param {String?} path - * @param {Function} handler - */ - - hook(path, handler) { - this.routes.hook(path, handler); - } - - /** - * Add a GET route. - * @param {String} path - * @param {Function} handler - */ - - get(path, handler) { - this.routes.get(path, handler); - } - - /** - * Add a POST route. - * @param {String} path - * @param {Function} handler - */ - - post(path, handler) { - this.routes.post(path, handler); - } - - /** - * Add a PUT route. - * @param {String} path - * @param {Function} handler - */ - - put(path, handler) { - this.routes.put(path, handler); - } - - /** - * Add a DELETE route. - * @param {String} path - * @param {Function} handler - */ - - del(path, handler) { - this.routes.del(path, handler); - } - - /** - * Add a PATCH route. - * @param {String} path - * @param {Function} handler - */ - - patch(path, handler) { - this.routes.patch(path, handler); - } - - /** - * Get a channel. - * @param {String} name - * @returns {Set|null} - */ - - channel(name) { - return this.io.channel(name); - } - - /** - * Join a channel. - * @param {Object} socket - * @param {String} name - */ - - join(socket, name) { - return this.io.join(socket, name); - } - - /** - * Leave a channel. - * @param {Object} socket - * @param {String} name - */ - - leave(socket, name) { - return this.io.leave(socket, name); - } - - /** - * Emit event to channel. - */ - - to(...args) { - return this.io.to(...args); - } - - /** - * Emit event to all sockets. - */ - - all(...args) { - return this.io.all(...args); - } - - /** - * Execute an RPC call. - * @private - * @param {Object} json - * @param {Boolean} help - * @returns {Promise} - */ - - execute(json, help) { - return this.rpc.execute(json, help); - } - - /** - * Add an RPC call. - * @param {String} name - * @param {Function} func - * @param {Object?} ctx - */ - - add(name, func, ctx) { - return this.rpc.add(name, func, ctx); - } - - /** - * Get server address. - * @returns {Object} - */ - - address() { - return this.http.address(); - } - - /** - * Router middleware. - * @returns {Function} - */ - - router(routes) { - if (!routes) - routes = this.routes; - - return middleware$1.router(routes); - } - - /** - * CORS middleware. - * @returns {Function} - */ - - cors() { - return middleware$1.cors(); - } - - /** - * Basic auth middleware. - * @param {Object} options - * @returns {Function} - */ - - basicAuth(options) { - return middleware$1.basicAuth(options); - } - - /** - * Body parser middleware. - * @param {Object} options - * @returns {Function} - */ - - bodyParser(options) { - return middleware$1.bodyParser(options); - } - - /** - * JSON rpc middleware. - * @param {Object} rpc - * @returns {Function} - */ - - jsonRPC(rpc) { - if (rpc == null) - rpc = this.rpc; - - return middleware$1.jsonRPC(rpc); - } - - /** - * Static file middleware. - * @param {String} prefix - * @returns {Function} - */ - - fileServer(prefix) { - return middleware$1.fileServer(prefix); - } - - /** - * Cookie parsing middleware. - * @returns {Function} - */ - - cookieParser() { - return middleware$1.cookieParser(); - } -} - -/** - * HTTP Server Options - */ - -class ServerOptions { - /** - * Create http server options. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.host = '127.0.0.1'; - this.port = 8080; - - this.ssl = false; - this.keyFile = null; - this.certFile = null; - this.key = null; - this.cert = null; - this.ca = null; - - this.sockets = true; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {ServerOptions} - */ - - fromOptions(options) { - assert$s(options); - - if (options.host != null) { - assert$s(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$s((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.prefix != null) { - assert$s(typeof options.prefix === 'string'); - this.keyFile = Path$5.join(options.prefix, 'key.pem'); - this.certFile = Path$5.join(options.prefix, 'cert.pem'); - } - - if (options.ssl != null) { - assert$s(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$s(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$s(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - if (options.key != null) { - assert$s(typeof options.key === 'string' || Buffer.isBuffer(options.key)); - this.key = options.key; - } - - if (options.cert != null) { - assert$s(typeof options.cert === 'string' || Buffer.isBuffer(options.cert)); - this.cert = options.cert; - } - - if (options.ca != null) { - assert$s(Array.isArray(options.ca)); - this.ca = options.ca; - } - - if (options.sockets != null) { - assert$s(typeof options.sockets === 'boolean'); - this.sockets = options.sockets; - } - - if (this.ssl) { - assert$s(this.key || this.keyFile, 'SSL specified with no provided key.'); - assert$s(this.cert || this.certFile, - 'SSL specified with no provided cert.'); - } - - return this; - } - - /** - * Instantiate http server options from object. - * @param {Object} options - * @returns {ServerOptions} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Load key and cert file. - * @private - */ - - load() { - if (!this.ssl) - return; - - if (this.keyFile) - this.key = fs$3.readFileSync(this.keyFile); - - if (this.certFile) - this.cert = fs$3.readFileSync(this.certFile); - } - - /** - * Get HTTP server backend. - * @private - * @returns {Object} - */ - - getBackend() { - return this.ssl ? require$$6$1 : require$$5$2; - } - - /** - * Get HTTP server options. - * @private - * @returns {Object} - */ - - toHTTP() { - if (!this.ssl) - return undefined; - - return { - key: this.key, - cert: this.cert, - ca: this.ca - }; - } -} - -/* - * Expose - */ - -var server = Server$3; - -/*! - * bweb.js - a web server - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bweb - */ - -const Server$2 = server; -const Router$5 = router$3; -const {RPC: RPC$5, RPCError: RPCError$2, errors} = rpc$2; -const middleware = middleware$2; - -bweb$2.Server = Server$2; -bweb$2.createServer = options => new Server$2(options); -bweb$2.server = options => new Server$2(options); - -bweb$2.Router = Router$5; -bweb$2.router = () => new Router$5(); - -bweb$2.RPC = RPC$5; -bweb$2.rpc = () => new RPC$5(); - -bweb$2.RPCError = RPCError$2; -bweb$2.errors = errors; - -bweb$2.middleware = middleware; - -/*! - * assert.js - assertions for javascript - * Copyright (c) 2018, Christopher Jeffrey (MIT License). - * https://github.com/chjj/bsert - */ - -/** - * AssertionError - */ - -class AssertionError extends Error { - constructor(options) { - if (typeof options === 'string') - options = { message: options }; - - if (options === null || typeof options !== 'object') - options = {}; - - let message = null; - let operator = 'fail'; - let generatedMessage = Boolean(options.generatedMessage); - - if (options.message != null) - message = toString$2(options.message); - - if (typeof options.operator === 'string') - operator = options.operator; - - if (message == null) { - if (operator === 'fail') { - message = 'Assertion failed.'; - } else { - const a = stringify(options.actual); - const b = stringify(options.expected); - - message = `${a} ${operator} ${b}`; - } - - generatedMessage = true; - } - - super(message); - - let start = this.constructor; - - if (typeof options.stackStartFunction === 'function') - start = options.stackStartFunction; - else if (typeof options.stackStartFn === 'function') - start = options.stackStartFn; - - this.type = 'AssertionError'; - this.name = 'AssertionError [ERR_ASSERTION]'; - this.code = 'ERR_ASSERTION'; - this.generatedMessage = generatedMessage; - this.actual = options.actual; - this.expected = options.expected; - this.operator = operator; - - if (Error.captureStackTrace) - Error.captureStackTrace(this, start); - } -} - -/* - * Assert - */ - -function assert$r(value, message) { - if (!value) { - let generatedMessage = false; - - if (arguments.length === 0) { - message = 'No value argument passed to `assert()`.'; - generatedMessage = true; - } else if (message == null) { - message = 'Assertion failed.'; - generatedMessage = true; - } else if (isError(message)) { - throw message; - } - - throw new AssertionError({ - message, - actual: value, - expected: true, - operator: '==', - generatedMessage, - stackStartFn: assert$r - }); - } -} - -function equal(actual, expected, message) { - if (!Object.is(actual, expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'strictEqual', - stackStartFn: equal - }); - } -} - -function notEqual(actual, expected, message) { - if (Object.is(actual, expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'notStrictEqual', - stackStartFn: notEqual - }); - } -} - -function fail(message) { - let generatedMessage = false; - - if (isError(message)) - throw message; - - if (message == null) { - message = 'Assertion failed.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: false, - expected: true, - operator: 'fail', - generatedMessage, - stackStartFn: fail - }); -} - -function throws(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - enforce$2(typeof func === 'function', 'func', 'function'); - - try { - func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) { - let generatedMessage = false; - - if (message == null) { - message = 'Missing expected exception.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'throws', - generatedMessage, - stackStartFn: throws - }); - } - - if (!testError(err, expected, message, throws)) - throw err; -} - -function doesNotThrow(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - enforce$2(typeof func === 'function', 'func', 'function'); - - try { - func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) - return; - - if (testError(err, expected, message, doesNotThrow)) { - let generatedMessage = false; - - if (message == null) { - message = 'Got unwanted exception.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: err, - expected, - operator: 'doesNotThrow', - generatedMessage, - stackStartFn: doesNotThrow - }); - } - - throw err; -} - -async function rejects(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - if (typeof func !== 'function') - enforce$2(isPromise(func), 'func', 'promise'); - - try { - if (isPromise(func)) - await func; - else - await func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) { - let generatedMessage = false; - - if (message == null) { - message = 'Missing expected rejection.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'rejects', - generatedMessage, - stackStartFn: rejects - }); - } - - if (!testError(err, expected, message, rejects)) - throw err; -} - -async function doesNotReject(func, expected, message) { - if (typeof expected === 'string') { - message = expected; - expected = undefined; - } - - let thrown = false; - let err = null; - - if (typeof func !== 'function') - enforce$2(isPromise(func), 'func', 'promise'); - - try { - if (isPromise(func)) - await func; - else - await func(); - } catch (e) { - thrown = true; - err = e; - } - - if (!thrown) - return; - - if (testError(err, expected, message, doesNotReject)) { - let generatedMessage = false; - - if (message == null) { - message = 'Got unwanted rejection.'; - generatedMessage = true; - } - - throw new AssertionError({ - message, - actual: undefined, - expected, - operator: 'doesNotReject', - generatedMessage, - stackStartFn: doesNotReject - }); - } - - throw err; -} - -function ifError(err) { - if (err != null) { - let message = 'ifError got unwanted exception: '; - - if (typeof err === 'object' && typeof err.message === 'string') { - if (err.message.length === 0 && err.constructor) - message += err.constructor.name; - else - message += err.message; - } else { - message += stringify(err); - } - - throw new AssertionError({ - message, - actual: err, - expected: null, - operator: 'ifError', - generatedMessage: true, - stackStartFn: ifError - }); - } -} - -function deepEqual(actual, expected, message) { - if (!isDeepEqual(actual, expected, false)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'deepStrictEqual', - stackStartFn: deepEqual - }); - } -} - -function notDeepEqual(actual, expected, message) { - if (isDeepEqual(actual, expected, true)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual, - expected, - operator: 'notDeepStrictEqual', - stackStartFn: notDeepEqual - }); - } -} - -function bufferEqual(actual, expected, enc, message) { - if (!isEncoding(enc)) { - message = enc; - enc = null; - } - - if (enc == null) - enc = 'hex'; - - expected = bufferize(actual, expected, enc); - - enforce$2(isBuffer(actual), 'actual', 'buffer'); - enforce$2(isBuffer(expected), 'expected', 'buffer'); - - if (actual !== expected && !actual.equals(expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual: actual.toString(enc), - expected: expected.toString(enc), - operator: 'bufferEqual', - stackStartFn: bufferEqual - }); - } -} - -function notBufferEqual(actual, expected, enc, message) { - if (!isEncoding(enc)) { - message = enc; - enc = null; - } - - if (enc == null) - enc = 'hex'; - - expected = bufferize(actual, expected, enc); - - enforce$2(isBuffer(actual), 'actual', 'buffer'); - enforce$2(isBuffer(expected), 'expected', 'buffer'); - - if (actual === expected || actual.equals(expected)) { - if (isError(message)) - throw message; - - throw new AssertionError({ - message, - actual: actual.toString(enc), - expected: expected.toString(enc), - operator: 'notBufferEqual', - stackStartFn: notBufferEqual - }); - } -} - -function enforce$2(value, name, type) { - if (!value) { - let msg; - - if (name == null) { - msg = 'Invalid type for parameter.'; - } else { - if (type == null) - msg = `Invalid type for "${name}".`; - else - msg = `"${name}" must be a(n) ${type}.`; - } - - const err = new TypeError(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, enforce$2); - - throw err; - } -} - -function range(value, name) { - if (!value) { - const msg = name != null - ? `"${name}" is out of range.` - : 'Parameter is out of range.'; - - const err = new RangeError(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, range); - - throw err; - } -} - -/* - * Stringification - */ - -function stringify(value) { - switch (typeof value) { - case 'undefined': - return 'undefined'; - case 'object': - if (value === null) - return 'null'; - return `[${objectName(value)}]`; - case 'boolean': - return `${value}`; - case 'number': - return `${value}`; - case 'string': - if (value.length > 80) - value = `${value.substring(0, 77)}...`; - return JSON.stringify(value); - case 'symbol': - return tryString(value); - case 'function': - return `[${funcName(value)}]`; - case 'bigint': - return `${value}n`; - default: - return `[${typeof value}]`; - } -} - -function toString$2(value) { - if (typeof value === 'string') - return value; - - if (isError(value)) - return tryString(value); - - return stringify(value); -} - -function tryString(value) { - try { - return String(value); - } catch (e) { - return 'Object'; - } -} - -/* - * Error Testing - */ - -function testError(err, expected, message, func) { - if (expected == null) - return true; - - if (isRegExp(expected)) - return expected.test(err); - - if (typeof expected !== 'function') { - if (func === doesNotThrow || func === doesNotReject) - throw new TypeError('"expected" must not be an object.'); - - if (typeof expected !== 'object') - throw new TypeError('"expected" must be an object.'); - - let generatedMessage = false; - - if (message == null) { - const name = func === rejects ? 'rejection' : 'exception'; - message = `Missing expected ${name}.`; - generatedMessage = true; - } - - if (err == null || typeof err !== 'object') { - throw new AssertionError({ - actual: err, - expected, - message, - operator: func.name, - generatedMessage, - stackStartFn: func - }); - } - - const keys = Object.keys(expected); - - if (isError(expected)) - keys.push('name', 'message'); - - if (keys.length === 0) - throw new TypeError('"expected" may not be an empty object.'); - - for (const key of keys) { - const expect = expected[key]; - const value = err[key]; - - if (typeof value === 'string' - && isRegExp(expect) - && expect.test(value)) { - continue; - } - - if ((key in err) && isDeepEqual(value, expect, false)) - continue; - - throw new AssertionError({ - actual: err, - expected: expected, - message, - operator: func.name, - generatedMessage, - stackStartFn: func - }); - } - - return true; - } - - if (expected.prototype !== undefined && (err instanceof expected)) - return true; - - if (Error.isPrototypeOf(expected)) - return false; - - return expected.call({}, err) === true; -} - -/* - * Comparisons - */ - -function isDeepEqual(x, y, fail) { - try { - return compare(x, y, null); - } catch (e) { - return fail; - } -} - -function compare(a, b, cache) { - // Primitives. - if (Object.is(a, b)) - return true; - - if (!isObject(a) || !isObject(b)) - return false; - - // Semi-primitives. - if (objectString(a) !== objectString(b)) - return false; - - if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) - return false; - - if (isBuffer(a) && isBuffer(b)) - return a.equals(b); - - if (isDate(a)) - return Object.is(a.getTime(), b.getTime()); - - if (isRegExp(a)) { - return a.source === b.source - && a.global === b.global - && a.multiline === b.multiline - && a.lastIndex === b.lastIndex - && a.ignoreCase === b.ignoreCase; - } - - if (isError(a)) { - if (a.message !== b.message) - return false; - } - - if (isArrayBuffer(a)) { - a = new Uint8Array(a); - b = new Uint8Array(b); - } - - if (isView(a) && !isBuffer(a)) { - if (isBuffer(b)) - return false; - - const x = new Uint8Array(a.buffer); - const y = new Uint8Array(b.buffer); - - if (x.length !== y.length) - return false; - - for (let i = 0; i < x.length; i++) { - if (x[i] !== y[i]) - return false; - } - - return true; - } - - if (isSet(a)) { - if (a.size !== b.size) - return false; - - const keys = new Set([...a, ...b]); - - return keys.size === a.size; - } - - // Recursive. - if (!cache) { - cache = { - a: new Map(), - b: new Map(), - p: 0 - }; - } else { - const aa = cache.a.get(a); - - if (aa != null) { - const bb = cache.b.get(b); - if (bb != null) - return aa === bb; - } - - cache.p += 1; - } - - cache.a.set(a, cache.p); - cache.b.set(b, cache.p); - - const ret = recurse(a, b, cache); - - cache.a.delete(a); - cache.b.delete(b); - - return ret; -} - -function recurse(a, b, cache) { - if (isMap(a)) { - if (a.size !== b.size) - return false; - - const keys = new Set([...a.keys(), ...b.keys()]); - - if (keys.size !== a.size) - return false; - - for (const key of keys) { - if (!compare(a.get(key), b.get(key), cache)) - return false; - } - - return true; - } - - if (isArray(a)) { - if (a.length !== b.length) - return false; - - for (let i = 0; i < a.length; i++) { - if (!compare(a[i], b[i], cache)) - return false; - } - - return true; - } - - const ak = ownKeys(a); - const bk = ownKeys(b); - - if (ak.length !== bk.length) - return false; - - const keys = new Set([...ak, ...bk]); - - if (keys.size !== ak.length) - return false; - - for (const key of keys) { - if (!compare(a[key], b[key], cache)) - return false; - } - - return true; -} - -function ownKeys(obj) { - const keys = Object.keys(obj); - - if (!Object.getOwnPropertySymbols) - return keys; - - if (!Object.getOwnPropertyDescriptor) - return keys; - - const symbols = Object.getOwnPropertySymbols(obj); - - for (const symbol of symbols) { - const desc = Object.getOwnPropertyDescriptor(obj, symbol); - - if (desc && desc.enumerable) - keys.push(symbol); - } - - return keys; -} - -/* - * Helpers - */ - -function objectString(obj) { - if (obj === undefined) - return '[object Undefined]'; - - if (obj === null) - return '[object Null]'; - - try { - return Object.prototype.toString.call(obj); - } catch (e) { - return '[object Object]'; - } -} - -function objectType(obj) { - return objectString(obj).slice(8, -1); -} - -function objectName(obj) { - const type = objectType(obj); - - if (obj == null) - return type; - - if (type !== 'Object' && type !== 'Error') - return type; - - let ctor, name; - - try { - ctor = obj.constructor; - } catch (e) { - } - - if (ctor == null) - return type; - - try { - name = ctor.name; - } catch (e) { - return type; - } - - if (typeof name !== 'string' || name.length === 0) - return type; - - return name; -} - -function funcName(func) { - let name; - - try { - name = func.name; - } catch (e) { - } - - if (typeof name !== 'string' || name.length === 0) - return 'Function'; - - return `Function: ${name}`; -} - -function isArray(obj) { - return Array.isArray(obj); -} - -function isArrayBuffer(obj) { - return obj instanceof ArrayBuffer; -} - -function isBuffer(obj) { - return isObject(obj) - && typeof obj.writeUInt32LE === 'function' - && typeof obj.equals === 'function'; -} - -function isDate(obj) { - return obj instanceof Date; -} - -function isError(obj) { - return obj instanceof Error; -} - -function isMap(obj) { - return obj instanceof Map; -} - -function isObject(obj) { - return obj && typeof obj === 'object'; -} - -function isPromise(obj) { - return obj instanceof Promise; -} - -function isRegExp(obj) { - return obj instanceof RegExp; -} - -function isSet(obj) { - return obj instanceof Set; -} - -function isView(obj) { - return ArrayBuffer.isView(obj); -} - -function isEncoding(enc) { - if (typeof enc !== 'string') - return false; - - switch (enc) { - case 'ascii': - case 'binary': - case 'base64': - case 'hex': - case 'latin1': - case 'ucs2': - case 'utf8': - case 'utf16le': - return true; - } - - return false; -} - -function bufferize(actual, expected, enc) { - if (typeof expected === 'string') { - if (!isBuffer(actual)) - return null; - - const {constructor} = actual; - - if (!constructor || typeof constructor.from !== 'function') - return null; - - if (!isEncoding(enc)) - return null; - - if (enc === 'hex' && (expected.length & 1)) - return null; - - const raw = constructor.from(expected, enc); - - if (enc === 'hex' && raw.length !== (expected.length >>> 1)) - return null; - - return raw; - } - - return expected; -} - -/* - * API - */ - -assert$r.AssertionError = AssertionError; -assert$r.assert = assert$r; -assert$r.strict = assert$r; -assert$r.ok = assert$r; -assert$r.equal = equal; -assert$r.notEqual = notEqual; -assert$r.strictEqual = equal; -assert$r.notStrictEqual = notEqual; -assert$r.fail = fail; -assert$r.throws = throws; -assert$r.doesNotThrow = doesNotThrow; -assert$r.rejects = rejects; -assert$r.doesNotReject = doesNotReject; -assert$r.ifError = ifError; -assert$r.deepEqual = deepEqual; -assert$r.notDeepEqual = notDeepEqual; -assert$r.deepStrictEqual = deepEqual; -assert$r.notDeepStrictEqual = notDeepEqual; -assert$r.bufferEqual = bufferEqual; -assert$r.notBufferEqual = notBufferEqual; -assert$r.enforce = enforce$2; -assert$r.range = range; - -/* - * Expose - */ - -var assert_1 = assert$r; - -/*! - * validator.js - validator for bcoin - * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$q = assert_1; - -/** - * Validator - */ - -class Validator$4 { - /** - * Create a validator. - * @constructor - * @param {Object} map - * @param {Boolean} [loose=false] - */ - - constructor(map, loose) { - if (!map || typeof map !== 'object') - throw new ValidationError('map', 'object'); - - this.map = map; - this.loose = loose || false; - } - - /** - * Create a multi validator. - * @param {Object[]} maps - * @param {Boolean} [loose=false] - * @returns {MultiValidator} - */ - - static multi(maps, loose) { - return new MultiValidator(maps, loose); - } - - /** - * Create a multi validator from an http request. - * @param {Object} req - * @returns {MultiValidator} - */ - - static fromRequest(req) { - const query = new Validator$4(req.query, true); - const params = new Validator$4(req.params, true); - const body = new Validator$4(req.body, false); - return new MultiValidator([query, params, body]); - } - - /** - * Create a child validator. - * @param {String} key - * @returns {Validator} - */ - - child(key) { - return new this.constructor(this.get(key)); - } - - /** - * Test whether value is present. - * @param {String} key - * @returns {Boolean} - */ - - has(key) { - return this.get(key) != null; - } - - /** - * Get a value (no type validation). - * @param {String} key - * @param {Object?} fallback - * @returns {Object|null} - */ - - get(key, fallback) { - if (fallback === undefined) - fallback = null; - - if (Array.isArray(key)) { - const keys = key; - for (const key of keys) { - const value = this.get(key); - if (value !== null) - return value; - } - return fallback; - } - - assert$q(typeof key === 'string' || typeof key === 'number', - 'Key must be a string or number.'); - - const value = this.map[key]; - - if (value != null) - return value; - - return fallback; - } - - /** - * Get a value's type. - * @param {String} key - * @returns {String} - */ - - typeOf(key) { - const value = this.get(key); - - if (value == null) - return 'null'; - - return typeof value; - } - - /** - * Get a value (as a string). - * @param {String} key - * @param {Object?} fallback - * @returns {String|null} - */ - - str(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') - throw new ValidationError(key, 'string'); - - return value; - } - - /** - * Get a value (as an integer). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - int(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (typeof value !== 'number') - throw new ValidationError(key, 'int'); - - if (!Number.isSafeInteger(value)) - throw new ValidationError(key, 'int'); - - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'int'); - - if (!/^\-?\d+$/.test(value)) - throw new ValidationError(key, 'int'); - - const num = parseInt(value, 10); - - if (!Number.isSafeInteger(num)) - throw new ValidationError(key, 'int'); - - return num; - } - - /** - * Get a value (as a signed integer). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - uint(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'uint'); - - return value; - } - - /** - * Get a value (as a float). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - float(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (typeof value !== 'number') - throw new ValidationError(key, 'float'); - - if (!isFinite(value)) - throw new ValidationError(key, 'float'); - - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'float'); - - if (!/^\-?\d*(?:\.\d*)?$/.test(value)) - throw new ValidationError(key, 'float'); - - if (!/\d/.test(value)) - throw new ValidationError(key, 'float'); - - const num = parseFloat(value); - - if (!isFinite(num)) - throw new ValidationError(key, 'float'); - - return num; - } - - /** - * Get a value (as a positive float). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - ufloat(key, fallback) { - const value = this.float(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'positive float'); - - return value; - } - - /** - * Get a value (as a fixed number). - * @param {String} key - * @param {Number?} exp - * @param {Object?} fallback - * @returns {Number|null} - */ - - fixed(key, exp, fallback) { - const value = this.float(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - try { - return fromFloat(value, exp || 0); - } catch (e) { - throw new ValidationError(key, 'fixed number'); - } - } - - /** - * Get a value (as a positive fixed number). - * @param {String} key - * @param {Number?} exp - * @param {Object?} fallback - * @returns {Number|null} - */ - - ufixed(key, exp, fallback) { - const value = this.fixed(key, exp); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < 0) - throw new ValidationError(key, 'positive fixed number'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i8(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < -0x80 || value > 0x7f) - throw new ValidationError(key, 'i8'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i16(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (value < -0x8000 || value > 0x7fff) - throw new ValidationError(key, 'i16'); - - return value; - } - - /** - * Get a value (as an int32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i32(key, fallback) { - const value = this.int(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value | 0) !== value) - throw new ValidationError(key, 'int32'); - - return value; - } - - /** - * Get a value (as an int64). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - i64(key, fallback) { - return this.int(key, fallback); - } - - /** - * Get a value (as a uint32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u8(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value & 0xff) !== value) - throw new ValidationError(key, 'uint8'); - - return value; - } - - /** - * Get a value (as a uint16). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u16(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value & 0xffff) !== value) - throw new ValidationError(key, 'uint16'); - - return value; - } - - /** - * Get a value (as a uint32). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u32(key, fallback) { - const value = this.uint(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if ((value >>> 0) !== value) - throw new ValidationError(key, 'uint32'); - - return value; - } - - /** - * Get a value (as a uint64). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|null} - */ - - u64(key, fallback) { - return this.uint(key, fallback); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Hash|null} - */ - - hash(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'hash'); - - if (value.length !== 32) - throw new ValidationError(key, 'hash'); - - return value.toString('hex'); - } - - if (value.length !== 64) - throw new ValidationError(key, 'hex string'); - - if (!/^[0-9a-f]+$/i.test(value)) - throw new ValidationError(key, 'hex string'); - - return value.toLowerCase(); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Buffer|null} - */ - - bhash(key, fallback) { - const value = this.hash(key, fallback); - - if (!value) - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a number or hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Hash|null} - */ - - uinthash(key, fallback) { - const value = this.get(key); - - if (fallback == null) - fallback = null; - - if (value == null) - return fallback; - - if (Buffer.isBuffer(value)) - return this.hash(key, fallback); - - if (typeof value === 'string') { - if (!this.loose || value.length === 64) - return this.hash(key, fallback); - } - - return this.uint(key, fallback); - } - - /** - * Get a value (as a number or hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Buffer|null} - */ - - uintbhash(key, fallback) { - const value = this.uinthash(key, fallback); - - if (typeof value !== 'string') - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Hash|null} - */ - - rhash(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'hash'); - - if (value.length !== 32) - throw new ValidationError(key, 'hash'); - - return value.toString('hex'); - } - - if (value.length !== 64) - throw new ValidationError(key, 'hex string'); - - if (!/^[0-9a-f]+$/i.test(value)) - throw new ValidationError(key, 'hex string'); - - let out = ''; - - for (let i = 0; i < value.length; i += 2) - out = value.slice(i, i + 2) + out; - - return out.toLowerCase(); - } - - /** - * Get a value (as a reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Buffer|null} - */ - - brhash(key, fallback) { - const value = this.rhash(key, fallback); - - if (!value) - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a number or reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Hash|null} - */ - - uintrhash(key, fallback) { - const value = this.get(key); - - if (fallback == null) - fallback = null; - - if (value == null) - return fallback; - - if (Buffer.isBuffer(value)) - return this.rhash(key, fallback); - - if (typeof value === 'string') { - if (!this.loose || value.length === 64) - return this.rhash(key, fallback); - } - - return this.uint(key, fallback); - } - - /** - * Get a value (as a number or reverse hash). - * @param {String} key - * @param {Object?} fallback - * @returns {Number|Buffer|null} - */ - - uintbrhash(key, fallback) { - const value = this.uintrhash(key, fallback); - - if (typeof value !== 'string') - return value; - - return Buffer.from(value, 'hex'); - } - - /** - * Get a value (as a boolean). - * @param {String} key - * @param {Object?} fallback - * @returns {Boolean|null} - */ - - bool(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - // Bitcoin Core compat. - if (typeof value === 'number') { - if (value === 1) - return true; - - if (value === 0) - return false; - } - - if (typeof value !== 'string') { - if (typeof value !== 'boolean') - throw new ValidationError(key, 'boolean'); - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'boolean'); - - if (value === 'true' || value === '1') - return true; - - if (value === 'false' || value === '0') - return false; - - throw new ValidationError(key, 'boolean'); - } - - /** - * Get a value (as a buffer). - * @param {String} key - * @param {Object?} fallback - * @param {String?} enc - * @returns {Buffer|null} - */ - - buf(key, fallback, enc) { - const value = this.get(key); - - if (!enc) - enc = 'hex'; - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Buffer.isBuffer(value)) - throw new ValidationError(key, 'buffer'); - return value; - } - - const data = Buffer.from(value, enc); - - if (data.length !== Buffer.byteLength(value, enc)) - throw new ValidationError(key, `${enc} string`); - - return data; - } - - /** - * Get a value (as an array). - * @param {String} key - * @param {Object?} fallback - * @returns {Array|String[]|null} - */ - - array(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'string') { - if (!Array.isArray(value)) - throw new ValidationError(key, 'array'); - return value; - } - - if (!this.loose) - throw new ValidationError(key, 'array'); - - const parts = value.trim().split(/\s*,\s*/); - const result = []; - - for (const part of parts) { - if (part.length === 0) - continue; - - result.push(part); - } - - return result; - } - - /** - * Get a value (as an object). - * @param {String} key - * @param {Object?} fallback - * @returns {Object|null} - */ - - obj(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'object' || Array.isArray(value)) - throw new ValidationError(key, 'object'); - - return value; - } - - /** - * Get a value (as a function). - * @param {String} key - * @param {Object?} fallback - * @returns {Function|null} - */ - - func(key, fallback) { - const value = this.get(key); - - if (fallback === undefined) - fallback = null; - - if (value === null) - return fallback; - - if (typeof value !== 'function') - throw new ValidationError(key, 'function'); - - return value; - } -} - -/* - * Constants - */ - -const SENTINEL = new Validator$4(Object.create(null)); - -/** - * Multi Validator - * @extends Validator - */ - -class MultiValidator { - /** - * Create a multi validator. - * @constructor - * @param {Object[]} maps - * @param {Boolean} [loose=false] - */ - - constructor(maps, loose) { - this.maps = []; - - this.init(maps, loose); - } - - /** - * Initialize the validator. - * @private - * @param {Object[]} maps - * @param {Boolean} [loose=false] - */ - - init(maps, loose) { - assert$q(Array.isArray(maps)); - assert$q(maps.length > 0); - - for (const map of maps) { - if (!(map instanceof Validator$4)) { - assert$q(map && typeof map === 'object'); - this.maps.push(new Validator$4(map, loose)); - continue; - } - this.maps.push(map); - } - } - - /** - * Get a validator. - * @private - * @param {String} key - * @returns {Validator} - */ - - find(key) { - for (const map of this.maps) { - if (map.has(key)) - return map; - } - return SENTINEL; - } - - child(key) { - return this.find(key).child(key); - } - - has(key) { - return this.find(key).has(key); - } - - get(key, fallback) { - return this.find(key).get(key, fallback); - } - - typeOf(key) { - return this.find(key).typeOf(key); - } - - str(key, fallback) { - return this.find(key).str(key, fallback); - } - - int(key, fallback) { - return this.find(key).int(key, fallback); - } - - uint(key, fallback) { - return this.find(key).uint(key, fallback); - } - - float(key, fallback) { - return this.find(key).float(key, fallback); - } - - ufloat(key, fallback) { - return this.find(key).ufloat(key, fallback); - } - - fixed(key, exp, fallback) { - return this.find(key).fixed(key, exp, fallback); - } - - ufixed(key, exp, fallback) { - return this.find(key).ufixed(key, exp, fallback); - } - - i8(key, fallback) { - return this.find(key).i8(key, fallback); - } - - i16(key, fallback) { - return this.find(key).i16(key, fallback); - } - - i32(key, fallback) { - return this.find(key).i32(key, fallback); - } - - i64(key, fallback) { - return this.find(key).i64(key, fallback); - } - - u8(key, fallback) { - return this.find(key).u8(key, fallback); - } - - u16(key, fallback) { - return this.find(key).u16(key, fallback); - } - - u32(key, fallback) { - return this.find(key).u32(key, fallback); - } - - u64(key, fallback) { - return this.find(key).u64(key, fallback); - } - - hash(key, fallback) { - return this.find(key).hash(key, fallback); - } - - bhash(key, fallback) { - return this.find(key).bhash(key, fallback); - } - - uinthash(key, fallback) { - return this.find(key).uinthash(key, fallback); - } - - uintbhash(key, fallback) { - return this.find(key).uintbhash(key, fallback); - } - - rhash(key, fallback) { - return this.find(key).rhash(key, fallback); - } - - brhash(key, fallback) { - return this.find(key).brhash(key, fallback); - } - - uintrhash(key, fallback) { - return this.find(key).uintrhash(key, fallback); - } - - uintbrhash(key, fallback) { - return this.find(key).uintbrhash(key, fallback); - } - - bool(key, fallback) { - return this.find(key).bool(key, fallback); - } - - buf(key, fallback, enc) { - return this.find(key).buf(key, fallback, enc); - } - - array(key, fallback) { - return this.find(key).array(key, fallback); - } - - obj(key, fallback) { - return this.find(key).obj(key, fallback); - } - - func(key, fallback) { - return this.find(key).func(key, fallback); - } -} - -/* - * Helpers - */ - -function fmt(key) { - if (Array.isArray(key)) - key = key[0]; - - if (typeof key === 'number') - return `Param #${key}`; - - return key; -} - -class ValidationError extends Error { - constructor(key, type) { - super(); - - this.type = 'ValidationError'; - this.message = `${fmt(key)} must be a ${type}.`; - - if (Error.captureStackTrace) - Error.captureStackTrace(this, ValidationError); - } -} - -function fromFloat(num, exp) { - assert$q(typeof num === 'number' && isFinite(num)); - assert$q(Number.isSafeInteger(exp)); - - let str = num.toFixed(exp); - let sign = 1; - - if (str.length > 0 && str[0] === '-') { - str = str.substring(1); - sign = -1; - } - - let hi = str; - let lo = '0'; - - const index = str.indexOf('.'); - - if (index !== -1) { - hi = str.substring(0, index); - lo = str.substring(index + 1); - } - - hi = hi.replace(/^0+/, ''); - lo = lo.replace(/0+$/, ''); - - assert$q(hi.length <= 16 - exp, - 'Fixed number string exceeds 2^53-1.'); - - assert$q(lo.length <= exp, - 'Too many decimal places in fixed number string.'); - - if (hi.length === 0) - hi = '0'; - - while (lo.length < exp) - lo += '0'; - - if (lo.length === 0) - lo = '0'; - - assert$q(/^\d+$/.test(hi) && /^\d+$/.test(lo), - 'Non-numeric characters in fixed number string.'); - - hi = parseInt(hi, 10); - lo = parseInt(lo, 10); - - const mult = Math.pow(10, exp); - const maxLo = Number.MAX_SAFE_INTEGER % mult; - const maxHi = (Number.MAX_SAFE_INTEGER - maxLo) / mult; - - assert$q(hi < maxHi || (hi === maxHi && lo <= maxLo), - 'Fixed number string exceeds 2^53-1.'); - - return sign * (hi * mult + lo); -} - -/* - * Expose - */ - -var validator = Validator$4; - -var bval = validator; - -var safe = {}; - -/*! - * safe.js - constant-time equals for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on golang/go: - * Copyright (c) 2009 The Go Authors. All rights reserved. - * https://github.com/golang/go - * - * Resources: - * https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go - */ - -const assert$p = assert_1$d; - -/* - * Safe - */ - -function safeCompare(x, y) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - - if (safeEqualInt(x.length, 0)) - return safeEqualInt(y.length, 0); - - // Assumes `y` is the "constant size" - // parameter. Note that constant size - // doesn't necessarily mean secret. - // Assuming we have a constant-size - // secret key or passphrase. This - // function should be called as: - // - // if (!safeCompare(input, key)) - // throw new Error('Bad passphrase.'); - let v = x.length ^ y.length; - - for (let i = 0; i < y.length; i++) - v |= x[i % x.length] ^ y[i]; - - return (v - 1) >>> 31; -} - -function safeEqual$5(x, y) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - - // Assumes the lengths of both - // `x` and `y` are not secret. - if (!safeEqualInt(x.length, y.length)) - return 0; - - let v = 0; - - for (let i = 0; i < x.length; i++) - v |= x[i] ^ y[i]; - - return (v - 1) >>> 31; -} - -function safeEqualByte(x, y) { - return safeEqualInt(x & 0xff, y & 0xff); -} - -function safeEqualInt(x, y) { - return ((x ^ y) - 1) >>> 31; -} - -function safeSelect(x, y, v) { - return (x & (v - 1)) | (y & ~(v - 1)); -} - -function safeLT(x, y) { - return (x - y) >>> 31; -} - -function safeLTE(x, y) { - return (x - y - 1) >>> 31; -} - -function safeGT(x, y) { - return (y - x) >>> 31; -} - -function safeGTE(x, y) { - return (y - x - 1) >>> 31; -} - -function safeMin(x, y) { - return safeSelect(x, y, safeLT(y, x)); -} - -function safeMax(x, y) { - return safeSelect(x, y, safeGT(y, x)); -} - -function safeAbs(x) { - return (x | 0) * ((x >> 31) | 1); -} - -function safeBool(x) { - return ((x >> 31) | (-x >> 31)) & 1; -} - -function safeCopy(x, y, v) { - assert$p(Buffer.isBuffer(x)); - assert$p(Buffer.isBuffer(y)); - assert$p(safeEqualInt(x.length, y.length)); - - const xmask = (v - 1) & 0xff; - const ymask = ~(v - 1) & 0xff; - - for (let i = 0; i < x.length; i++) - x[i] = (x[i] & xmask) | (y[i] & ymask); -} - -/* - * Expose - */ - -safe.safeCompare = safeCompare; -safe.safeEqual = safeEqual$5; -safe.safeEqualByte = safeEqualByte; -safe.safeEqualInt = safeEqualInt; -safe.safeSelect = safeSelect; -safe.safeLT = safeLT; -safe.safeLTE = safeLTE; -safe.safeGT = safeGT; -safe.safeGTE = safeGTE; -safe.safeMin = safeMin; -safe.safeMax = safeMax; -safe.safeAbs = safeAbs; -safe.safeBool = safeBool; -safe.safeCopy = safeCopy; - -/*! - * server.js - http server for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$o = assert_1$g; -const path$4 = require$$1$3; -const {Server: Server$1} = bweb$2; -const Validator$3 = bval; -const base58$2 = base58$9.exports; -const {BloomFilter: BloomFilter$1} = bfilter; -const sha256$2 = sha256$9.exports; -const random$2 = random$9; -const {safeEqual: safeEqual$4} = safe; -const util$6 = util$y; -const Address$7 = address$1; -const TX$3 = tx; -const Outpoint$6 = outpoint; -const Network$4 = network; -const pkg$3 = pkg$4; - -/** - * HTTP - * @alias module:http.Server - */ - -class HTTP$4 extends Server$1 { - /** - * Create an http server. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(new HTTPOptions$1(options)); - - this.network = this.options.network; - this.logger = this.options.logger.context('node-http'); - this.node = this.options.node; - - this.chain = this.node.chain; - this.mempool = this.node.mempool; - this.pool = this.node.pool; - this.fees = this.node.fees; - this.miner = this.node.miner; - this.rpc = this.node.rpc; - - this.init(); - } - - /** - * Initialize routes. - * @private - */ - - init() { - this.on('request', (req, res) => { - if (req.method === 'POST' && req.pathname === '/') - return; - - this.logger.debug('Request for method=%s path=%s (%s).', - req.method, req.pathname, req.socket.remoteAddress); - }); - - this.on('listening', (address) => { - this.logger.info('Node HTTP server listening on %s (port=%d).', - address.address, address.port); - }); - - this.initRouter(); - this.initSockets(); - } - - /** - * Initialize routes. - * @private - */ - - initRouter() { - if (this.options.cors) - this.use(this.cors()); - - if (!this.options.noAuth) { - this.use(this.basicAuth({ - hash: sha256$2.digest, - password: this.options.apiKey, - realm: 'node' - })); - } - - this.use(this.bodyParser({ - type: 'json' - })); - - this.use(this.jsonRPC()); - this.use(this.router()); - - this.error((err, req, res) => { - const code = err.statusCode || 500; - res.json(code, { - error: { - type: err.type, - code: err.code, - message: err.message - } - }); - }); - - this.get('/', async (req, res) => { - const totalTX = this.mempool ? this.mempool.map.size : 0; - const size = this.mempool ? this.mempool.getSize() : 0; - const orphans = this.mempool ? this.mempool.orphans.size : 0; - - let addr = this.pool.hosts.getLocal(); - - if (!addr) - addr = this.pool.hosts.address; - - res.json(200, { - version: pkg$3.version, - network: this.network.type, - chain: { - height: this.chain.height, - tip: this.chain.tip.rhash(), - progress: this.chain.getProgress() - }, - indexes: { - addr: { - enabled: Boolean(this.node.addrindex), - height: this.node.addrindex ? this.node.addrindex.height : 0 - }, - tx: { - enabled: Boolean(this.node.txindex), - height: this.node.txindex ? this.node.txindex.height : 0 - }, - filter: { - enabled: Boolean(this.node.filterindex), - height: this.node.filterindex ? this.node.filterindex.height : 0 - } - }, - pool: { - host: addr.host, - port: addr.port, - agent: this.pool.options.agent, - services: this.pool.options.services.toString(2), - outbound: this.pool.peers.outbound, - inbound: this.pool.peers.inbound - }, - mempool: { - tx: totalTX, - size: size, - orphans: orphans - }, - time: { - uptime: this.node.uptime(), - system: util$6.now(), - adjusted: this.network.now(), - offset: this.network.time.offset - }, - memory: this.logger.memoryUsage() - }); - }); - - // UTXO by id - this.get('/coin/:hash/:index', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce$1(hash, 'Hash is required.'); - enforce$1(index != null, 'Index is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get coins in SPV mode.'); - - const coin = await this.node.getCoin(hash, index); - - if (!coin) { - res.json(404); - return; - } - - res.json(200, coin.getJSON(this.network)); - }); - - // TX by hash - this.get('/tx/:hash', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce$1(hash, 'Hash is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get TX in SPV mode.'); - - const meta = await this.node.getMeta(hash); - - if (!meta) { - res.json(404); - return; - } - - const view = await this.node.getMetaView(meta); - - res.json(200, meta.getJSON(this.network, view, this.chain.height)); - }); - - // TX by address - this.get('/tx/address/:address', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const address = valid.str('address'); - const limit = valid.uint('limit', this.options.maxTxs); - const reverse = valid.bool('reverse', false); - const after = valid.brhash('after', null); - - enforce$1(address, 'Address is required.'); - enforce$1(!this.chain.options.spv, 'Cannot get TX in SPV mode.'); - enforce$1(limit <= this.options.maxTxs, - `Limit above max of ${this.options.maxTxs}.`); - - const addr = Address$7.fromString(address, this.network); - - const metas = await this.node.getMetaByAddress( - addr, {limit, reverse, after}); - - const result = []; - - for (const meta of metas) { - const view = await this.node.getMetaView(meta); - result.push(meta.getJSON(this.network, view, this.chain.height)); - } - - res.json(200, result); - }); - - // Block by hash/height - this.get('/block/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - enforce$1(!this.chain.options.spv, 'Cannot get block in SPV mode.'); - - const block = await this.chain.getBlock(hash); - - if (!block) { - res.json(404); - return; - } - - const view = await this.chain.getBlockView(block); - - if (!view) { - res.json(404); - return; - } - - const height = await this.chain.getHeight(hash); - const depth = this.chain.height - height + 1; - - res.json(200, block.getJSON(this.network, view, height, depth)); - }); - - // Block Header by hash/height - this.get('/header/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) { - res.json(404); - return; - } - - res.json(200, entry.toJSON()); - }); - - // Filters by hash/height - this.get('/filter/:block', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const hash = valid.uintbrhash('block'); - - enforce$1(hash != null, 'Hash or height required.'); - - const filter = await this.node.getBlockFilter(hash); - - if (!filter) { - res.json(404); - return; - } - - res.json(200, filter.toJSON()); - }); - - // Mempool snapshot - this.get('/mempool', async (req, res) => { - enforce$1(this.mempool, 'No mempool available.'); - - const hashes = this.mempool.getSnapshot(); - const result = []; - - for (const hash of hashes) - result.push(util$6.revHex(hash)); - - res.json(200, result); - }); - - // Broadcast TX - this.post('/broadcast', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const raw = valid.buf('tx'); - - enforce$1(raw, 'TX is required.'); - - const tx = TX$3.fromRaw(raw); - - await this.node.sendTX(tx); - - res.json(200, { success: true }); - }); - - // Estimate fee - this.get('/fee', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const blocks = valid.u32('blocks', 1); - - if (!this.fees) { - res.json(200, { rate: this.network.feeRate }); - return; - } - - const fee = this.fees.estimateFee(blocks); - - res.json(200, { rate: fee }); - }); - - // Reset chain - this.post('/reset', async (req, res) => { - const valid = Validator$3.fromRequest(req); - const height = valid.u32('height'); - - enforce$1(height != null, 'Height is required.'); - enforce$1(height <= this.chain.height, - 'Height cannot be greater than chain tip.'); - - await this.chain.reset(height); - - res.json(200, { success: true }); - }); - } - - /** - * Handle new websocket. - * @private - * @param {WebSocket} socket - */ - - handleSocket(socket) { - socket.hook('auth', (...args) => { - if (socket.channel('auth')) - throw new Error('Already authed.'); - - if (!this.options.noAuth) { - const valid = new Validator$3(args); - const key = valid.str(0, ''); - - if (key.length > 255) - throw new Error('Invalid API key.'); - - const data = Buffer.from(key, 'ascii'); - const hash = sha256$2.digest(data); - - if (!safeEqual$4(hash, this.options.apiHash)) - throw new Error('Invalid API key.'); - } - - socket.join('auth'); - - this.logger.info('Successful auth from %s.', socket.host); - this.handleAuth(socket); - - return null; - }); - - socket.fire('version', { - version: pkg$3.version, - network: this.network.type - }); - } - - /** - * Handle new auth'd websocket. - * @private - * @param {WebSocket} socket - */ - - handleAuth(socket) { - socket.hook('watch chain', () => { - socket.join('chain'); - return null; - }); - - socket.hook('unwatch chain', () => { - socket.leave('chain'); - return null; - }); - - socket.hook('watch mempool', () => { - socket.join('mempool'); - return null; - }); - - socket.hook('unwatch mempool', () => { - socket.leave('mempool'); - return null; - }); - - socket.hook('set filter', (...args) => { - const valid = new Validator$3(args); - const data = valid.buf(0); - - if (!data) - throw new Error('Invalid parameter.'); - - socket.filter = BloomFilter$1.fromRaw(data); - - return null; - }); - - socket.hook('get tip', () => { - return this.chain.tip.toRaw(); - }); - - socket.hook('get entry', async (...args) => { - const valid = new Validator$3(args); - const block = valid.uintbrhash(0); - - if (block == null) - throw new Error('Invalid parameter.'); - - const entry = await this.chain.getEntry(block); - - if (!entry) - return null; - - if (!await this.chain.isMainChain(entry)) - return null; - - return entry.toRaw(); - }); - - socket.hook('get hashes', async (...args) => { - const valid = new Validator$3(args); - const start = valid.i32(0, -1); - const end = valid.i32(1, -1); - - return this.chain.getHashes(start, end); - }); - - socket.hook('add filter', (...args) => { - const valid = new Validator$3(args); - const chunks = valid.array(0); - - if (!chunks) - throw new Error('Invalid parameter.'); - - if (!socket.filter) - throw new Error('No filter set.'); - - const items = new Validator$3(chunks); - - for (let i = 0; i < chunks.length; i++) { - const data = items.buf(i); - - if (!data) - throw new Error('Bad data chunk.'); - - socket.filter.add(data); - - if (this.node.spv) - this.pool.watch(data); - } - - return null; - }); - - socket.hook('reset filter', () => { - socket.filter = null; - return null; - }); - - socket.hook('estimate fee', (...args) => { - const valid = new Validator$3(args); - const blocks = valid.u32(0); - - if (!this.fees) - return this.network.feeRate; - - return this.fees.estimateFee(blocks); - }); - - socket.hook('send', (...args) => { - const valid = new Validator$3(args); - const data = valid.buf(0); - - if (!data) - throw new Error('Invalid parameter.'); - - const tx = TX$3.fromRaw(data); - - this.node.relay(tx); - - return null; - }); - - socket.hook('rescan', (...args) => { - const valid = new Validator$3(args); - const start = valid.uintbrhash(0); - - if (start == null) - throw new Error('Invalid parameter.'); - - return this.scan(socket, start); - }); - } - - /** - * Bind to chain events. - * @private - */ - - initSockets() { - const pool = this.mempool || this.pool; - - this.chain.on('connect', (entry, block, view) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - const raw = entry.toRaw(); - - this.to('chain', 'chain connect', raw); - - for (const socket of sockets) { - const txs = this.filterBlock(socket, block); - socket.fire('block connect', raw, txs); - } - }); - - this.chain.on('disconnect', (entry, block, view) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - const raw = entry.toRaw(); - - this.to('chain', 'chain disconnect', raw); - this.to('chain', 'block disconnect', raw); - }); - - this.chain.on('reset', (tip) => { - const sockets = this.channel('chain'); - - if (!sockets) - return; - - this.to('chain', 'chain reset', tip.toRaw()); - }); - - pool.on('tx', (tx) => { - const sockets = this.channel('mempool'); - - if (!sockets) - return; - - const raw = tx.toRaw(); - - for (const socket of sockets) { - if (!this.filterTX(socket, tx)) - continue; - - socket.fire('tx', raw); - } - }); - } - - /** - * Filter block by socket. - * @private - * @param {WebSocket} socket - * @param {Block} block - * @returns {TX[]} - */ - - filterBlock(socket, block) { - if (!socket.filter) - return []; - - const txs = []; - - for (const tx of block.txs) { - if (this.filterTX(socket, tx)) - txs.push(tx.toRaw()); - } - - return txs; - } - - /** - * Filter transaction by socket. - * @private - * @param {WebSocket} socket - * @param {TX} tx - * @returns {Boolean} - */ - - filterTX(socket, tx) { - if (!socket.filter) - return false; - - let found = false; - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const hash = output.getHash(); - - if (!hash) - continue; - - if (socket.filter.test(hash)) { - const prevout = Outpoint$6.fromTX(tx, i); - socket.filter.add(prevout.toRaw()); - found = true; - } - } - - if (found) - return true; - - if (!tx.isCoinbase()) { - for (const {prevout} of tx.inputs) { - if (socket.filter.test(prevout.toRaw())) - return true; - } - } - - return false; - } - - /** - * Scan using a socket's filter. - * @private - * @param {WebSocket} socket - * @param {Hash} start - * @returns {Promise} - */ - - async scan(socket, start) { - if (!socket.filter) - return null; - - await this.node.scan(start, socket.filter, (entry, txs) => { - const block = entry.toRaw(); - const raw = []; - - for (const tx of txs) - raw.push(tx.toRaw()); - - return socket.call('block rescan', block, raw); - }); - return null; - } -} - -class HTTPOptions$1 { - /** - * HTTPOptions - * @alias module:http.HTTPOptions - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network$4.primary; - this.logger = null; - this.node = null; - this.apiKey = base58$2.encode(random$2.randomBytes(20)); - this.apiHash = sha256$2.digest(Buffer.from(this.apiKey, 'ascii')); - this.noAuth = false; - this.cors = false; - this.maxTxs = 100; - - this.prefix = null; - this.host = '127.0.0.1'; - this.port = 8080; - this.ssl = false; - this.keyFile = null; - this.certFile = null; - - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {HTTPOptions} - */ - - fromOptions(options) { - assert$o(options); - assert$o(options.node && typeof options.node === 'object', - 'HTTP Server requires a Node.'); - - this.node = options.node; - this.network = options.node.network; - this.logger = options.node.logger; - - this.port = this.network.rpcPort; - - if (options.logger != null) { - assert$o(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.apiKey != null) { - assert$o(typeof options.apiKey === 'string', - 'API key must be a string.'); - assert$o(options.apiKey.length <= 255, - 'API key must be under 256 bytes.'); - this.apiKey = options.apiKey; - this.apiHash = sha256$2.digest(Buffer.from(this.apiKey, 'ascii')); - } - - if (options.noAuth != null) { - assert$o(typeof options.noAuth === 'boolean'); - this.noAuth = options.noAuth; - } - - if (options.cors != null) { - assert$o(typeof options.cors === 'boolean'); - this.cors = options.cors; - } - - if (options.prefix != null) { - assert$o(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.keyFile = path$4.join(this.prefix, 'key.pem'); - this.certFile = path$4.join(this.prefix, 'cert.pem'); - } - - if (options.host != null) { - assert$o(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$o((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.ssl != null) { - assert$o(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$o(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$o(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - if (options.maxTxs != null) { - assert$o(Number.isSafeInteger(options.maxTxs)); - this.maxTxs = options.maxTxs; - } - - // Allow no-auth implicitly - // if we're listening locally. - if (!options.apiKey) { - if (this.host === '127.0.0.1' || this.host === '::1') - this.noAuth = true; - } - - return this; - } - - /** - * Instantiate http options from object. - * @param {Object} options - * @returns {HTTPOptions} - */ - - static fromOptions(options) { - return new HTTPOptions$1().fromOptions(options); - } -} - -/* - * Helpers - */ - -function enforce$1(value, msg) { - if (!value) { - const err = new Error(msg); - err.statusCode = 400; - throw err; - } -} - -/* - * Expose - */ - -var http$1 = HTTP$4; - -/*! - * rpc.js - bitcoind-compatible json rpc for bcoin. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$n = assert_1$g; -const bweb$1 = bweb$2; -const {Lock: Lock$4} = bmutex; -const IP = binet$2; -const Validator$2 = bval; -const {BufferMap: BufferMap$2, BufferSet: BufferSet$3} = bufferMap; -const hash160$1 = hash160$9.exports; -const {safeEqual: safeEqual$3} = safe; -const secp256k1$2 = secp256k1$b.exports; -const util$5 = util$y; -const messageUtil$1 = message; -const common$7 = common$m; -const Amount$2 = amount; -const NetAddress = netaddress; -const Script$8 = script$2; -const Address$6 = address$1; -const Block$4 = block$1; -const Headers = headers; -const Input = input; -const KeyRing$3 = keyring; -const MerkleBlock$1 = merkleblock; -const MTX$4 = mtx$1.exports; -const Network$3 = network; -const Outpoint$5 = outpoint; -const Output$2 = output; -const TX$2 = tx; -const consensus$5 = consensus$s; -const pkg$2 = pkg$4; -const RPCBase$1 = bweb$1.RPC; -const RPCError$1 = bweb$1.RPCError; - -/* - * Constants - */ - -const errs$1 = { - // Standard JSON-RPC 2.0 errors - INVALID_REQUEST: bweb$1.errors.INVALID_REQUEST, - METHOD_NOT_FOUND: bweb$1.errors.METHOD_NOT_FOUND, - INVALID_PARAMS: bweb$1.errors.INVALID_PARAMS, - INTERNAL_ERROR: bweb$1.errors.INTERNAL_ERROR, - PARSE_ERROR: bweb$1.errors.PARSE_ERROR, - - // General application defined errors - MISC_ERROR: -1, - FORBIDDEN_BY_SAFE_MODE: -2, - TYPE_ERROR: -3, - INVALID_ADDRESS_OR_KEY: -5, - OUT_OF_MEMORY: -7, - INVALID_PARAMETER: -8, - DATABASE_ERROR: -20, - DESERIALIZATION_ERROR: -22, - VERIFY_ERROR: -25, - VERIFY_REJECTED: -26, - VERIFY_ALREADY_IN_CHAIN: -27, - IN_WARMUP: -28, - - // P2P client errors - CLIENT_NOT_CONNECTED: -9, - CLIENT_IN_INITIAL_DOWNLOAD: -10, - CLIENT_NODE_ALREADY_ADDED: -23, - CLIENT_NODE_NOT_ADDED: -24, - CLIENT_NODE_NOT_CONNECTED: -29, - CLIENT_INVALID_IP_OR_SUBNET: -30, - CLIENT_P2P_DISABLED: -31 -}; - -/** - * Bitcoin RPC - * @alias module:http.RPC - * @extends bweb.RPC - */ - -class RPC$4 extends RPCBase$1 { - /** - * Create RPC. - * @param {Node} node - */ - - constructor(node) { - super(); - - assert$n(node, 'RPC requires a Node.'); - - this.node = node; - this.network = node.network; - this.workers = node.workers; - this.chain = node.chain; - this.mempool = node.mempool; - this.pool = node.pool; - this.fees = node.fees; - this.miner = node.miner; - this.logger = node.logger.context('node-rpc'); - this.locker = new Lock$4(); - - this.mining = false; - this.procLimit = 0; - this.attempt = null; - this.lastActivity = 0; - this.boundChain = false; - this.nonce1 = 0; - this.nonce2 = 0; - this.merkleMap = new BufferMap$2(); - this.pollers = []; - - this.init(); - } - - getCode(err) { - switch (err.type) { - case 'RPCError': - return err.code; - case 'ValidationError': - return errs$1.TYPE_ERROR; - case 'EncodingError': - return errs$1.DESERIALIZATION_ERROR; - default: - return errs$1.INTERNAL_ERROR; - } - } - - handleCall(cmd, query) { - if (cmd.method !== 'getwork' - && cmd.method !== 'getblocktemplate' - && cmd.method !== 'getbestblockhash') { - this.logger.debug('Handling RPC call: %s.', cmd.method); - if (cmd.method !== 'submitblock' - && cmd.method !== 'getmemorypool') { - this.logger.debug(cmd.params); - } - } - - if (cmd.method === 'getwork') { - if (query.longpoll) - cmd.method = 'getworklp'; - } - } - - init() { - this.add('stop', this.stop); - this.add('help', this.help); - - this.add('getblockchaininfo', this.getBlockchainInfo); - this.add('getbestblockhash', this.getBestBlockHash); - this.add('getblockcount', this.getBlockCount); - this.add('getblock', this.getBlock); - this.add('getblockbyheight', this.getBlockByHeight); - this.add('getblockhash', this.getBlockHash); - this.add('getblockheader', this.getBlockHeader); - this.add('getblockfilter', this.getBlockFilter); - this.add('getchaintips', this.getChainTips); - this.add('getdifficulty', this.getDifficulty); - this.add('getmempoolancestors', this.getMempoolAncestors); - this.add('getmempooldescendants', this.getMempoolDescendants); - this.add('getmempoolentry', this.getMempoolEntry); - this.add('getmempoolinfo', this.getMempoolInfo); - this.add('getrawmempool', this.getRawMempool); - this.add('gettxout', this.getTXOut); - this.add('gettxoutsetinfo', this.getTXOutSetInfo); - this.add('pruneblockchain', this.pruneBlockchain); - this.add('verifychain', this.verifyChain); - - this.add('invalidateblock', this.invalidateBlock); - this.add('reconsiderblock', this.reconsiderBlock); - - this.add('getnetworkhashps', this.getNetworkHashPS); - this.add('getmininginfo', this.getMiningInfo); - this.add('prioritisetransaction', this.prioritiseTransaction); - this.add('getwork', this.getWork); - this.add('getworklp', this.getWorkLongpoll); - this.add('getblocktemplate', this.getBlockTemplate); - this.add('submitblock', this.submitBlock); - this.add('verifyblock', this.verifyBlock); - - this.add('setgenerate', this.setGenerate); - this.add('getgenerate', this.getGenerate); - this.add('generate', this.generate); - this.add('generatetoaddress', this.generateToAddress); - - this.add('estimatefee', this.estimateFee); - this.add('estimatepriority', this.estimatePriority); - this.add('estimatesmartfee', this.estimateSmartFee); - this.add('estimatesmartpriority', this.estimateSmartPriority); - - this.add('getinfo', this.getInfo); - this.add('validateaddress', this.validateAddress); - this.add('createmultisig', this.createMultisig); - this.add('createwitnessaddress', this.createWitnessAddress); - this.add('verifymessage', this.verifyMessage); - this.add('signmessagewithprivkey', this.signMessageWithPrivkey); - - this.add('setmocktime', this.setMockTime); - - this.add('getconnectioncount', this.getConnectionCount); - this.add('ping', this.ping); - this.add('getpeerinfo', this.getPeerInfo); - this.add('addnode', this.addNode); - this.add('disconnectnode', this.disconnectNode); - this.add('getaddednodeinfo', this.getAddedNodeInfo); - this.add('getnettotals', this.getNetTotals); - this.add('getnetworkinfo', this.getNetworkInfo); - this.add('setban', this.setBan); - this.add('listbanned', this.listBanned); - this.add('clearbanned', this.clearBanned); - - this.add('getrawtransaction', this.getRawTransaction); - this.add('createrawtransaction', this.createRawTransaction); - this.add('decoderawtransaction', this.decodeRawTransaction); - this.add('decodescript', this.decodeScript); - this.add('sendrawtransaction', this.sendRawTransaction); - this.add('signrawtransaction', this.signRawTransaction); - - this.add('gettxoutproof', this.getTXOutProof); - this.add('verifytxoutproof', this.verifyTXOutProof); - - this.add('getmemoryinfo', this.getMemoryInfo); - this.add('setloglevel', this.setLogLevel); - } - - /* - * Overall control/query calls - */ - - async getInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getinfo'); - - return { - version: pkg$2.version, - protocolversion: this.pool.options.version, - walletversion: 0, - balance: 0, - blocks: this.chain.height, - timeoffset: this.network.time.offset, - connections: this.pool.peers.size(), - proxy: '', - difficulty: toDifficulty(this.chain.tip.bits), - testnet: this.network !== Network$3.main, - keypoololdest: 0, - keypoolsize: 0, - unlocked_until: 0, - paytxfee: Amount$2.btc(this.network.feeRate, true), - relayfee: Amount$2.btc(this.network.minRelay, true), - errors: '' - }; - } - - async help(args, _help) { - if (args.length === 0) - return `Select a command:\n${Object.keys(this.calls).join('\n')}`; - - const json = { - method: args[0], - params: [] - }; - - return await this.execute(json, true); - } - - async stop(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'stop'); - - this.node.close().catch((err) => { - setImmediate(() => { - throw err; - }); - }); - - return 'Stopping.'; - } - - /* - * P2P networking - */ - - async getNetworkInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnetworkinfo'); - - const hosts = this.pool.hosts; - const locals = []; - - for (const local of hosts.local.values()) { - locals.push({ - address: local.addr.host, - port: local.addr.port, - score: local.score - }); - } - - return { - version: pkg$2.version, - subversion: this.pool.options.agent, - protocolversion: this.pool.options.version, - localservices: hex32(this.pool.options.services), - localservicenames: this.pool.getServiceNames(), - localrelay: !this.pool.options.noRelay, - timeoffset: this.network.time.offset, - networkactive: this.pool.connected, - connections: this.pool.peers.size(), - networks: [], - relayfee: Amount$2.btc(this.network.minRelay, true), - incrementalfee: 0, - localaddresses: locals, - warnings: '' - }; - } - - async addNode(args, help) { - if (help || args.length !== 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'addnode "node" "add|remove|onetry"'); - - const valid = new Validator$2(args); - const node = valid.str(0, ''); - const cmd = valid.str(1, ''); - - switch (cmd) { - case 'add': { - this.pool.hosts.addNode(node); - } - case 'onetry': { - const addr = parseNetAddress(node, this.network); - - if (!this.pool.peers.get(addr.hostname)) { - const peer = this.pool.createOutbound(addr); - this.pool.peers.add(peer); - } - - break; - } - case 'remove': { - this.pool.hosts.removeNode(node); - break; - } - } - - return null; - } - - async disconnectNode(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'disconnectnode "node"'); - - const valid = new Validator$2(args); - const str = valid.str(0, ''); - - const addr = parseIP(str, this.network); - const peer = this.pool.peers.get(addr.hostname); - - if (peer) - peer.destroy(); - - return null; - } - - async getAddedNodeInfo(args, help) { - if (help || args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getaddednodeinfo ( "node" )'); - - const hosts = this.pool.hosts; - const valid = new Validator$2(args); - const addr = valid.str(0, ''); - - let target; - if (args.length === 1) - target = parseIP(addr, this.network); - - const result = []; - - for (const node of hosts.nodes) { - if (target) { - if (node.host !== target.host) - continue; - - if (node.port !== target.port) - continue; - } - - const peer = this.pool.peers.get(node.hostname); - - if (!peer || !peer.connected) { - result.push({ - addednode: node.hostname, - connected: false, - addresses: [] - }); - continue; - } - - result.push({ - addednode: node.hostname, - connected: peer.connected, - addresses: [ - { - address: peer.hostname(), - connected: peer.outbound - ? 'outbound' - : 'inbound' - } - ] - }); - } - - if (target && result.length === 0) { - throw new RPCError$1(errs$1.CLIENT_NODE_NOT_ADDED, - 'Node has not been added.'); - } - - return result; - } - - async getConnectionCount(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getconnectioncount'); - - return this.pool.peers.size(); - } - - async getNetTotals(args, help) { - let sent = 0; - let recv = 0; - - if (help || args.length > 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnettotals'); - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) { - sent += peer.socket.bytesWritten; - recv += peer.socket.bytesRead; - } - - return { - totalbytesrecv: recv, - totalbytessent: sent, - timemillis: Date.now() - }; - } - - async getPeerInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getpeerinfo'); - - const peers = []; - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) { - const offset = this.network.time.known.get(peer.hostname()) || 0; - const hashes = []; - - for (const hash in peer.blockMap.keys()) { - const str = util$5.revHex(hash); - hashes.push(str); - } - - peer.getName(); - - peers.push({ - id: peer.id, - addr: peer.hostname(), - addrlocal: !peer.local.isNull() - ? peer.local.hostname - : undefined, - name: peer.name || undefined, - services: hex32(peer.services), - servicenames: peer.getServiceNames(), - relaytxes: !peer.noRelay, - lastsend: peer.lastSend / 1000 | 0, - lastrecv: peer.lastRecv / 1000 | 0, - bytessent: peer.socket.bytesWritten, - bytesrecv: peer.socket.bytesRead, - conntime: peer.time !== 0 ? (Date.now() - peer.time) / 1000 | 0 : 0, - timeoffset: offset, - pingtime: peer.lastPong !== -1 - ? (peer.lastPong - peer.lastPing) / 1000 - : -1, - minping: peer.minPing !== -1 ? peer.minPing / 1000 : -1, - version: peer.version, - subver: peer.agent, - inbound: !peer.outbound, - startingheight: peer.height, - besthash: peer.bestHash ? util$5.revHex(peer.bestHash) : null, - bestheight: peer.bestHeight, - banscore: peer.banScore, - inflight: hashes, - whitelisted: false - }); - } - - return peers; - } - - async ping(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'ping'); - - for (let peer = this.pool.peers.head(); peer; peer = peer.next) - peer.sendPing(); - - return null; - } - - async setBan(args, help) { - const valid = new Validator$2(args); - const str = valid.str(0, ''); - const action = valid.str(1, ''); - - if (help - || args.length < 2 - || (action !== 'add' && action !== 'remove')) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'setban "ip(/netmask)" "add|remove" (bantime) (absolute)'); - } - - const addr = parseNetAddress(str, this.network); - - switch (action) { - case 'add': - this.pool.ban(addr); - break; - case 'remove': - this.pool.unban(addr); - break; - } - - return null; - } - - async listBanned(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'listbanned'); - - const banned = []; - - for (const [host, time] of this.pool.hosts.banned) { - banned.push({ - address: host, - banned_until: time + this.pool.options.banTime, - ban_created: time, - ban_reason: '' - }); - } - - return banned; - } - - async clearBanned(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'clearbanned'); - - this.pool.hosts.clearBanned(); - - return null; - } - - /* Block chain and UTXO */ - async getBlockchainInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockchaininfo'); - - return { - chain: this.network.type !== 'testnet' - ? this.network.type - : 'test', - blocks: this.chain.height, - headers: this.chain.height, - bestblockhash: this.chain.tip.rhash(), - difficulty: toDifficulty(this.chain.tip.bits), - mediantime: await this.chain.getMedianTime(this.chain.tip), - verificationprogress: this.chain.getProgress(), - chainwork: this.chain.tip.chainwork.toString('hex', 64), - pruned: this.chain.options.prune, - softforks: this.getSoftforks(), - bip9_softforks: await this.getBIP9Softforks(), - pruneheight: this.chain.options.prune - ? Math.max(0, this.chain.height - this.network.block.keepBlocks) - : null - }; - } - - async getBestBlockHash(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getbestblockhash'); - - return this.chain.tip.rhash(); - } - - async getBlockCount(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockcount'); - - return this.chain.tip.height; - } - - async getBlock(args, help) { - if (help || args.length < 1 || args.length > 3) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblock "hash" ( verbose )'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, true); - const details = valid.bool(2, false); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - const block = await this.chain.getBlock(entry.hash); - - if (!block) { - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not available (spv mode)'); - - if (this.chain.options.prune) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Block not available (pruned data)'); - } - - throw new RPCError$1(errs$1.MISC_ERROR, 'Can\'t read block from disk'); - } - - if (!verbose) - return block.toRaw().toString('hex'); - - return await this.blockToJSON(entry, block, details); - } - - async getBlockByHeight(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getblockbyheight "height" ( verbose )'); - } - - const valid = new Validator$2(args); - const height = valid.u32(0, -1); - const verbose = valid.bool(1, true); - const details = valid.bool(2, false); - - if (height === -1) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block height.'); - - const entry = await this.chain.getEntry(height); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - const block = await this.chain.getBlock(entry.hash); - - if (!block) { - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not available (spv mode)'); - - if (this.chain.options.prune) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Block not available (pruned data)'); - } - - throw new RPCError$1(errs$1.DATABASE_ERROR, 'Can\'t read block from disk'); - } - - if (!verbose) - return block.toRaw().toString('hex'); - - return await this.blockToJSON(entry, block, details); - } - - async getBlockHash(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockhash index'); - - const valid = new Validator$2(args); - const height = valid.u32(0); - - if (height == null || height > this.chain.height) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Block height out of range.'); - - const hash = await this.chain.getHash(height); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Not found.'); - - return util$5.revHex(hash); - } - - async getBlockHeader(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockheader "hash" ( verbose )'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, true); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Invalid block hash.'); - - const entry = await this.chain.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - if (!verbose) - return entry.toRaw().toString('hex', 0, 80); - - return await this.headerToJSON(entry); - } - - async getBlockFilter(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getblockfilter "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.MISC_ERROR, 'Invalid block hash.'); - - const filter = await this.node.getBlockFilter(hash); - - if (!filter) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block filter not found.'); - - return filter.toJSON(); - } - - async getChainTips(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getchaintips'); - - const tips = await this.chain.getTips(); - const result = []; - - for (const hash of tips) { - const entry = await this.chain.getEntry(hash); - - assert$n(entry); - - const fork = await this.findFork(entry); - const main = await this.chain.isMainChain(entry); - - result.push({ - height: entry.height, - hash: entry.rhash(), - branchlen: entry.height - fork.height, - status: main ? 'active' : 'valid-headers' - }); - } - - return result; - } - - async getDifficulty(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getdifficulty'); - - return toDifficulty(this.chain.tip.bits); - } - - async getMempoolInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolinfo'); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - return { - size: this.mempool.map.size, - bytes: this.mempool.getSize(), - usage: this.mempool.getSize(), - maxmempool: this.mempool.options.maxSize, - mempoolminfee: Amount$2.btc(this.mempool.options.minRelay, true) - }; - } - - async getMempoolAncestors(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolancestors txid (verbose)'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - const entries = this.mempool.getAncestors(entry); - const out = []; - - if (verbose) { - for (const entry of entries) - out.push(this.entryToJSON(entry)); - } else { - for (const entry of entries) - out.push(entry.txid()); - } - - return out; - } - - async getMempoolDescendants(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getmempooldescendants txid (verbose)'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - const entries = this.mempool.getDescendants(entry); - const out = []; - - if (verbose) { - for (const entry of entries) - out.push(this.entryToJSON(entry)); - } else { - for (const entry of entries) - out.push(entry.txid()); - } - - return out; - } - - async getMempoolEntry(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmempoolentry txid'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - return this.entryToJSON(entry); - } - - async getRawMempool(args, help) { - if (help || args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getrawmempool ( verbose )'); - - const valid = new Validator$2(args); - const verbose = valid.bool(0, false); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (verbose) { - const out = {}; - - for (const entry of this.mempool.map.values()) - out[entry.txid()] = this.entryToJSON(entry); - - return out; - } - - const hashes = this.mempool.getSnapshot(); - - return hashes.map(util$5.revHex); - } - - async getTXOut(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'gettxout "txid" n ( includemempool )'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const index = valid.u32(1); - const mempool = valid.bool(2, true); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins when pruned.'); - - if (!hash || index == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid outpoint.'); - - let coin; - if (mempool) { - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - coin = this.mempool.getCoin(hash, index); - } - - if (!coin) - coin = await this.chain.getCoin(hash, index); - - if (!coin) - return null; - - return { - bestblock: this.chain.tip.rhash(), - confirmations: coin.getDepth(this.chain.height), - value: Amount$2.btc(coin.value, true), - scriptPubKey: this.scriptToJSON(coin.script, true), - version: coin.version, - coinbase: coin.coinbase - }; - } - - async getTXOutProof(args, help) { - if (help || (args.length !== 1 && args.length !== 2)) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'gettxoutproof ["txid",...] ( blockhash )'); - } - - const valid = new Validator$2(args); - const txids = valid.array(0); - const hash = valid.brhash(1); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot get coins when pruned.'); - - if (!txids || txids.length === 0) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid TXIDs.'); - - const items = new Validator$2(txids); - const set = new BufferSet$3(); - const hashes = []; - - let last = null; - - for (let i = 0; i < txids.length; i++) { - const hash = items.brhash(i); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - if (set.has(hash)) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Duplicate txid.'); - - set.add(hash); - hashes.push(hash); - - last = hash; - } - - let block = null; - - if (hash) { - block = await this.chain.getBlock(hash); - } else if (await this.node.hasTX(last)) { - const tx = await this.node.getMeta(last); - if (tx) - block = await this.chain.getBlock(tx.block); - } else { - const coin = await this.chain.getCoin(last, 0); - if (coin) - block = await this.chain.getBlock(coin.height); - } - - if (!block) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found.'); - - for (const hash of hashes) { - if (!block.hasTX(hash)) { - throw new RPCError$1(errs$1.VERIFY_ERROR, - 'Block does not contain all txids.'); - } - } - - block = MerkleBlock$1.fromHashes(block, hashes); - - return block.toRaw().toString('hex'); - } - - async verifyTXOutProof(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'verifytxoutproof "proof"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const block = MerkleBlock$1.fromRaw(data); - - if (!block.verify()) - return []; - - const entry = await this.chain.getEntry(block.hash()); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Block not found in chain.'); - - const tree = block.getTree(); - const out = []; - - for (const hash of tree.matches) - out.push(util$5.revHex(hash)); - - return out; - } - - async getTXOutSetInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'gettxoutsetinfo'); - - if (this.chain.options.spv) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'Chainstate not available (SPV mode).'); - } - - return { - height: this.chain.height, - bestblock: this.chain.tip.rhash(), - transactions: this.chain.db.state.tx, - txouts: this.chain.db.state.coin, - bytes_serialized: 0, - hash_serialized: 0, - total_amount: Amount$2.btc(this.chain.db.state.value, true) - }; - } - - async pruneBlockchain(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'pruneblockchain'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot prune chain in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Chain is already pruned.'); - - if (this.chain.height < this.network.block.pruneAfterHeight) - throw new RPCError$1(errs$1.MISC_ERROR, 'Chain is too short for pruning.'); - - try { - await this.chain.prune(); - } catch (e) { - throw new RPCError$1(errs$1.DATABASE_ERROR, e.message); - } - } - - async verifyChain(args, help) { - if (help || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'verifychain ( checklevel numblocks )'); - } - - const valid = new Validator$2(args); - const level = valid.u32(0); - const blocks = valid.u32(1); - - if (level == null || blocks == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Missing parameters.'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify chain in SPV mode.'); - - if (this.chain.options.prune) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify chain when pruned.'); - - return null; - } - - /* - * Mining - */ - - async submitWork(data) { - const unlock = await this.locker.lock(); - try { - return await this._submitWork(data); - } finally { - unlock(); - } - } - - async _submitWork(data) { - const attempt = this.attempt; - - if (!attempt) - return false; - - if (data.length !== 128) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid work size.'); - - const raw = data.slice(0, 80); - swap32(raw); - - const header = Headers.fromHead(raw); - - if (header.prevBlock !== attempt.prevBlock - || header.bits !== attempt.bits) { - return false; - } - - if (!header.verify()) - return false; - - const nonces = this.merkleMap.get(header.merkleRoot); - - if (!nonces) - return false; - - const [n1, n2] = nonces; - const nonce = header.nonce; - const time = header.time; - - const proof = attempt.getProof(n1, n2, time, nonce); - - if (!proof.verify(attempt.target)) - return false; - - const block = attempt.commit(proof); - - let entry; - try { - entry = await this.chain.add(block); - } catch (err) { - if (err.type === 'VerifyError') { - this.logger.warning('RPC block rejected: %h (%s).', - block.hash(), err.reason); - return false; - } - throw err; - } - - if (!entry) { - this.logger.warning('RPC block rejected: %h (bad-prevblk).', - block.hash()); - return false; - } - - return true; - } - - async createWork(data) { - const unlock = await this.locker.lock(); - try { - return await this._createWork(data); - } finally { - unlock(); - } - } - - async _createWork() { - const attempt = await this.updateWork(); - const n1 = this.nonce1; - const n2 = this.nonce2; - const time = attempt.time; - - const data = Buffer.allocUnsafe(128); - data.fill(0); - - const root = attempt.getRoot(n1, n2); - const head = attempt.getHeader(root, time, 0); - - head.copy(data, 0); - - data[80] = 0x80; - data.writeUInt32BE(80 * 8, data.length - 4, true); - - swap32(data); - - return { - data: data.toString('hex'), - target: attempt.target.toString('hex'), - height: attempt.height - }; - } - - async getWorkLongpoll(args, help) { - await this.longpoll(); - return await this.createWork(); - } - - async getWork(args, help) { - if (args.length > 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'getwork ( "data" )'); - - if (args.length === 1) { - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid work data.'); - - return await this.submitWork(data); - } - - return await this.createWork(); - } - - async submitBlock(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'submitblock "hexdata" ( "jsonparametersobject" )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - - const block = Block$4.fromRaw(data); - - return await this.addBlock(block); - } - - async getBlockTemplate(args, help) { - if (help || args.length > 1) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getblocktemplate ( "jsonrequestobject" )'); - } - - const validator = new Validator$2(args); - const options = validator.obj(0, {}); - const valid = new Validator$2(options); - const mode = valid.str('mode', 'template'); - - if (mode !== 'template' && mode !== 'proposal') - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid mode.'); - - if (mode === 'proposal') { - const data = valid.buf('data'); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Missing data parameter.'); - - const block = Block$4.fromRaw(data); - - if (!block.prevBlock.equals(this.chain.tip.hash)) - return 'inconclusive-not-best-prevblk'; - - try { - await this.chain.verifyBlock(block); - } catch (e) { - if (e.type === 'VerifyError') - return e.reason; - throw e; - } - - return null; - } - - let maxVersion = valid.u32('maxversion', -1); - let rules = valid.array('rules'); - - if (rules) - maxVersion = -1; - - const capabilities = valid.array('capabilities'); - let coinbase = false; - - if (capabilities) { - let txnCap = false; - let valueCap = false; - - for (const capability of capabilities) { - if (typeof capability !== 'string') - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid capability.'); - - switch (capability) { - case 'coinbasetxn': - txnCap = true; - break; - case 'coinbasevalue': - // Prefer value if they support it. - valueCap = true; - break; - } - } - - // BIP22 states that we can't have coinbasetxn - // _and_ coinbasevalue in the same template. - // The problem is, many clients _say_ they - // support coinbasetxn when they don't (ckpool). - // To make matters worse, some clients will - // parse an undefined `coinbasevalue` as zero. - // Because of all of this, coinbasetxn is - // disabled for now. - valueCap = true; - - if (txnCap && !valueCap) { - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - coinbase = true; - } - } - - if (!this.network.selfConnect) { - if (this.pool.peers.size() === 0) { - throw new RPCError$1(errs$1.CLIENT_NOT_CONNECTED, - 'Bitcoin is not connected!'); - } - - if (!this.chain.synced) { - throw new RPCError$1(errs$1.CLIENT_IN_INITIAL_DOWNLOAD, - 'Bitcoin is downloading blocks...'); - } - } - - const lpid = valid.str('longpollid'); - - if (lpid) - await this.handleLongpoll(lpid); - - if (!rules) - rules = []; - - return await this.createTemplate(maxVersion, coinbase, rules); - } - - async createTemplate(maxVersion, coinbase, rules) { - const unlock = await this.locker.lock(); - try { - return await this._createTemplate(maxVersion, coinbase, rules); - } finally { - unlock(); - } - } - - async _createTemplate(maxVersion, coinbase, rules) { - const attempt = await this.getTemplate(); - const scale = attempt.witness ? 1 : consensus$5.WITNESS_SCALE_FACTOR; - - // Default mutable fields. - const mutable = ['time', 'transactions', 'prevblock']; - - // The miner doesn't support - // versionbits. Force them to - // encode our version. - if (maxVersion >= 2) - mutable.push('version/force'); - - // Allow the miner to change - // our provided coinbase. - // Note that these are implied - // without `coinbasetxn`. - if (coinbase) { - mutable.push('coinbase'); - mutable.push('coinbase/append'); - mutable.push('generation'); - } - - // Build an index of every transaction. - const index = new BufferMap$2(); - for (let i = 0; i < attempt.items.length; i++) { - const entry = attempt.items[i]; - index.set(entry.hash, i + 1); - } - - // Calculate dependencies for each transaction. - const txs = []; - for (let i = 0; i < attempt.items.length; i++) { - const entry = attempt.items[i]; - const tx = entry.tx; - const deps = []; - - for (let j = 0; j < tx.inputs.length; j++) { - const input = tx.inputs[j]; - const dep = index.get(input.prevout.hash); - - if (dep == null) - continue; - - if (deps.indexOf(dep) === -1) { - assert$n(dep < i + 1); - deps.push(dep); - } - } - - txs.push({ - data: tx.toRaw().toString('hex'), - txid: tx.txid(), - hash: tx.wtxid(), - depends: deps, - fee: entry.fee, - sigops: entry.sigops / scale | 0, - weight: tx.getWeight() - }); - } - - if (this.chain.options.bip91) { - rules.push('segwit'); - rules.push('segsignal'); - } - - if (this.chain.options.bip148) - rules.push('segwit'); - - // Calculate version based on given rules. - let version = attempt.version; - const vbavailable = {}; - const vbrules = []; - - for (const deploy of this.network.deploys) { - const state = await this.chain.getState(this.chain.tip, deploy); - let name = deploy.name; - - switch (state) { - case common$7.thresholdStates.DEFINED: - case common$7.thresholdStates.FAILED: - break; - case common$7.thresholdStates.LOCKED_IN: - version |= 1 << deploy.bit; - case common$7.thresholdStates.STARTED: - if (!deploy.force) { - if (rules.indexOf(name) === -1) - version &= ~(1 << deploy.bit); - if (deploy.required) - name = '!' + name; - } - vbavailable[name] = deploy.bit; - break; - case common$7.thresholdStates.ACTIVE: - if (!deploy.force && deploy.required) { - if (rules.indexOf(name) === -1) { - throw new RPCError$1(errs$1.INVALID_PARAMETER, - `Client must support ${name}.`); - } - name = '!' + name; - } - vbrules.push(name); - break; - default: - assert$n(false, 'Bad state.'); - break; - } - } - - version >>>= 0; - - const json = { - capabilities: ['proposal'], - mutable: mutable, - version: version, - rules: vbrules, - vbavailable: vbavailable, - vbrequired: 0, - height: attempt.height, - previousblockhash: util$5.revHex(attempt.prevBlock), - target: util$5.revHex(attempt.target), - bits: hex32(attempt.bits), - noncerange: '00000000ffffffff', - curtime: attempt.time, - mintime: attempt.mtp + 1, - maxtime: attempt.time + 7200, - expires: attempt.time + 7200, - sigoplimit: consensus$5.MAX_BLOCK_SIGOPS_COST / scale | 0, - sizelimit: consensus$5.MAX_BLOCK_SIZE, - weightlimit: undefined, - longpollid: this.chain.tip.rhash() + hex32(this.totalTX()), - submitold: false, - coinbaseaux: { - flags: attempt.coinbaseFlags.toString('hex') - }, - coinbasevalue: undefined, - coinbasetxn: undefined, - default_witness_commitment: undefined, - transactions: txs - }; - - // See: - // bitcoin/bitcoin#9fc7f0bce94f1cea0239b1543227f22a3f3b9274 - if (attempt.witness) { - json.sizelimit = consensus$5.MAX_RAW_BLOCK_SIZE; - json.weightlimit = consensus$5.MAX_BLOCK_WEIGHT; - } - - // The client wants a coinbasetxn - // instead of a coinbasevalue. - if (coinbase) { - const tx = attempt.toCoinbase(); - const input = tx.inputs[0]; - - // Pop off the nonces. - input.script.pop(); - input.script.compile(); - - if (attempt.witness) { - // We don't include the commitment - // output (see bip145). - const output = tx.outputs.pop(); - assert$n(output.script.isCommitment()); - - // Also not including the witness nonce. - input.witness.clear(); - } - - tx.refresh(); - - json.coinbasetxn = { - data: tx.toRaw().toString('hex'), - txid: tx.txid(), - hash: tx.wtxid(), - depends: [], - fee: 0, - sigops: tx.getSigopsCost() / scale | 0, - weight: tx.getWeight() - }; - } else { - json.coinbasevalue = attempt.getReward(); - } - - if (rules.indexOf('segwit') !== -1) - json.default_witness_commitment = attempt.getWitnessScript().toJSON(); - - return json; - } - - async getMiningInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmininginfo'); - - const attempt = this.attempt; - - let size = 0; - let weight = 0; - let txs = 0; - let diff = 0; - - if (attempt) { - weight = attempt.weight; - txs = attempt.items.length + 1; - diff = attempt.getDifficulty(); - size = 1000; - for (const item of attempt.items) - size += item.tx.getBaseSize(); - } - - return { - blocks: this.chain.height, - currentblocksize: size, - currentblockweight: weight, - currentblocktx: txs, - difficulty: diff, - errors: '', - genproclimit: this.procLimit, - networkhashps: await this.getHashRate(120), - pooledtx: this.totalTX(), - testnet: this.network !== Network$3.main, - chain: this.network.type !== 'testnet' - ? this.network.type - : 'test', - generate: this.mining - }; - } - - async getNetworkHashPS(args, help) { - if (help || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'getnetworkhashps ( blocks height )'); - - const valid = new Validator$2(args); - const lookup = valid.u32(0, 120); - const height = valid.u32(1); - - return await this.getHashRate(lookup, height); - } - - async prioritiseTransaction(args, help) { - if (help || args.length !== 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'prioritisetransaction '); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const pri = valid.i64(1); - const fee = valid.i64(2); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID'); - - if (pri == null || fee == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid fee or priority.'); - - const entry = this.mempool.getEntry(hash); - - if (!entry) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not in mempool.'); - - this.mempool.prioritise(entry, pri, fee); - - return true; - } - - async verifyBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'verifyblock "block-hex"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hex.'); - - if (this.chain.options.spv) - throw new RPCError$1(errs$1.MISC_ERROR, 'Cannot verify block in SPV mode.'); - - const block = Block$4.fromRaw(data); - - try { - await this.chain.verifyBlock(block); - } catch (e) { - if (e.type === 'VerifyError') - return e.reason; - throw e; - } - - return null; - } - - /* - * Coin generation - */ - - async getGenerate(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getgenerate'); - return this.mining; - } - - async setGenerate(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'setgenerate mine ( proclimit )'); - - const valid = new Validator$2(args); - const mine = valid.bool(0, false); - const limit = valid.u32(1, 0); - - if (mine && this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - this.mining = mine; - this.procLimit = limit; - - if (mine) { - this.miner.cpu.start(); - return true; - } - - await this.miner.cpu.stop(); - - return false; - } - - async generate(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError$1(errs$1.MISC_ERROR, 'generate numblocks ( maxtries )'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - const tries = valid.u32(1); - - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - return await this.mineBlocks(blocks, null, tries); - } - - async generateToAddress(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'generatetoaddress numblocks address ( maxtries )'); - } - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - const str = valid.str(1, ''); - const tries = valid.u32(2); - - const addr = parseAddress$1(str, this.network); - - return await this.mineBlocks(blocks, addr, tries); - } - - /* - * Raw transactions - */ - - async createRawTransaction(args, help) { - if (help || args.length < 2 || args.length > 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'createrawtransaction' - + ' [{"txid":"id","vout":n},...]' - + ' {"address":amount,"data":"hex",...}' - + ' ( locktime )'); - } - - const valid = new Validator$2(args); - const inputs = valid.array(0); - const sendTo = valid.obj(1); - const locktime = valid.u32(2); - - if (!inputs || !sendTo) { - throw new RPCError$1(errs$1.TYPE_ERROR, - 'Invalid parameters (inputs and sendTo).'); - } - - const tx = new MTX$4(); - - if (locktime != null) - tx.locktime = locktime; - - for (const obj of inputs) { - const valid = new Validator$2(obj); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - let sequence = valid.u32('sequence', 0xffffffff); - - if (tx.locktime) - sequence--; - - if (!hash || index == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid outpoint.'); - - const input = new Input(); - input.prevout.hash = hash; - input.prevout.index = index; - input.sequence = sequence; - - tx.inputs.push(input); - } - - const sends = new Validator$2(sendTo); - const uniq = new Set(); - - for (const key of Object.keys(sendTo)) { - if (key === 'data') { - const value = sends.buf(key); - - if (!value) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid nulldata..'); - - const output = new Output$2(); - output.value = 0; - output.script.fromNulldata(value); - tx.outputs.push(output); - - continue; - } - - const addr = parseAddress$1(key, this.network); - const b58 = addr.toString(this.network); - - if (uniq.has(b58)) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Duplicate address'); - - uniq.add(b58); - - const value = sends.ufixed(key, 8); - - if (value == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid output value.'); - - const output = new Output$2(); - output.value = value; - output.script.fromAddress(addr); - - tx.outputs.push(output); - } - - return tx.toRaw().toString('hex'); - } - - async decodeRawTransaction(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'decoderawtransaction "hexstring"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const tx = TX$2.fromRaw(data); - - return this.txToJSON(tx); - } - - async decodeScript(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'decodescript "hex"'); - - const valid = new Validator$2(args); - const data = valid.buf(0); - - let script = new Script$8(); - - if (data) - script = Script$8.fromRaw(data); - - const addr = Address$6.fromScripthash(script.hash160()); - - const json = this.scriptToJSON(script); - json.p2sh = addr.toString(this.network); - - return json; - } - - async getRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'getrawtransaction "txid" ( verbose )'); - } - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - const verbose = valid.bool(1, false); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid TXID.'); - - const meta = await this.node.getMeta(hash); - - if (!meta) - throw new RPCError$1(errs$1.MISC_ERROR, 'Transaction not found.'); - - const tx = meta.tx; - - if (!verbose) - return tx.toRaw().toString('hex'); - - let entry; - if (meta.block) - entry = await this.chain.getEntry(meta.block); - - const json = this.txToJSON(tx, entry); - json.time = meta.mtime; - json.hex = tx.toRaw().toString('hex'); - - return json; - } - - async sendRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'sendrawtransaction "hexstring" ( allowhighfees )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - const tx = TX$2.fromRaw(data); - - this.node.relay(tx); - - return tx.txid(); - } - - async signRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 4) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'signrawtransaction' - + ' "hexstring" (' - + ' [{"txid":"id","vout":n,"scriptPubKey":"hex",' - + 'redeemScript":"hex"},...] ["privatekey1",...]' - + ' sighashtype )'); - } - - const valid = new Validator$2(args); - const data = valid.buf(0); - const prevout = valid.array(1); - const secrets = valid.array(2); - const sighash = valid.str(3); - - if (!data) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid hex string.'); - - if (!this.mempool) - throw new RPCError$1(errs$1.MISC_ERROR, 'No mempool available.'); - - const tx = MTX$4.fromRaw(data); - tx.view = await this.mempool.getSpentView(tx); - - const map = new BufferMap$2(); - const keys = []; - - if (secrets) { - const valid = new Validator$2(secrets); - for (let i = 0; i < secrets.length; i++) { - const secret = valid.str(i, ''); - const key = parseSecret$1(secret, this.network); - map.set(key.getPublicKey(), key); - keys.push(key); - } - } - - if (prevout) { - for (const prev of prevout) { - const valid = new Validator$2(prev); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - const scriptRaw = valid.buf('scriptPubKey'); - const value = valid.ufixed('amount', 8); - const redeemRaw = valid.buf('redeemScript'); - - if (!hash || index == null || !scriptRaw || value == null) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid UTXO.'); - - const outpoint = new Outpoint$5(hash, index); - - const script = Script$8.fromRaw(scriptRaw); - const coin = Output$2.fromScript(script, value); - - tx.view.addOutput(outpoint, coin); - - if (keys.length === 0 || !redeemRaw) - continue; - - if (!script.isScripthash() && !script.isWitnessScripthash()) - continue; - - if (!redeemRaw) { - throw new RPCError$1(errs$1.INVALID_PARAMETER, - 'P2SH requires redeem script.'); - } - - const redeem = Script$8.fromRaw(redeemRaw); - - for (const op of redeem.code) { - if (!op.data) - continue; - - const key = map.get(op.data); - - if (key) { - key.script = redeem; - key.witness = script.isWitnessScripthash(); - key.refresh(); - break; - } - } - } - } - - let type = Script$8.hashType.ALL; - if (sighash) { - const parts = sighash.split('|'); - - if (parts.length < 1 || parts.length > 2) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - - type = Script$8.hashType[parts[0]]; - - if (type == null) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - - if (parts.length === 2) { - if (parts[1] !== 'ANYONECANPAY') - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid sighash type.'); - type |= Script$8.hashType.ANYONECANPAY; - } - } - - await tx.signAsync(keys, type, this.workers); - - return { - hex: tx.toRaw().toString('hex'), - complete: tx.isSigned() - }; - } - - /* - * Utility Functions - */ - - async createMultisig(args, help) { - if (help || args.length < 2 || args.length > 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'createmultisig nrequired ["key",...]'); - } - - const valid = new Validator$2(args); - const keys = valid.array(1, []); - const m = valid.u32(0, 0); - const n = keys.length; - - if (m < 1 || n < m || n > 16) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid m and n values.'); - - const items = new Validator$2(keys); - - for (let i = 0; i < keys.length; i++) { - const key = items.buf(i); - - if (!key) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid key.'); - - if (!secp256k1$2.publicKeyVerify(key)) - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - - keys[i] = key; - } - - const script = Script$8.fromMultisig(m, n, keys); - - if (script.getSize() > consensus$5.MAX_SCRIPT_PUSH) { - throw new RPCError$1(errs$1.VERIFY_ERROR, - 'Redeem script exceeds size limit.'); - } - - const addr = script.getAddress(); - - return { - address: addr.toString(this.network), - redeemScript: script.toJSON() - }; - } - - async createWitnessAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'createwitnessaddress "script"'); - - const valid = new Validator$2(args); - const raw = valid.buf(0); - - if (!raw) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid script hex.'); - - const script = Script$8.fromRaw(raw); - const program = script.forWitness(); - const addr = program.getAddress(); - - return { - address: addr.toString(this.network), - witnessScript: program.toJSON() - }; - } - - async validateAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'validateaddress "bitcoinaddress"'); - - const valid = new Validator$2(args); - const str = valid.str(0, ''); - - let addr; - try { - addr = Address$6.fromString(str, this.network); - } catch (e) { - return { - isvalid: false - }; - } - - const script = Script$8.fromAddress(addr); - const isWitness = addr.isProgram(); - const isScript = script.isScripthash() || script.isWitnessScripthash(); - - const result = { - isvalid: true, - address: addr.toString(this.network), - scriptPubKey: script.toJSON(), - isscript: isScript, - iswitness: isWitness - }; - - if (isWitness) { - result.witness_version = addr.version; - result.witness_program = addr.hash.toString('hex'); - } - - return result; - } - - async verifyMessage(args, help) { - if (help || args.length !== 3) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'verifymessage "bitcoinaddress" "signature" "message"'); - } - - const valid = new Validator$2(args); - const b58 = valid.str(0, ''); - const sig = valid.buf(1, null, 'base64'); - const str = valid.str(2); - - if (!sig || !str) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid parameters.'); - - const addr = parseAddress$1(b58, this.network); - const key = messageUtil$1.recover(str, sig); - - if (!key) - return false; - - return safeEqual$3(hash160$1.digest(key), addr.hash) === 1; - } - - async signMessageWithPrivkey(args, help) { - if (help || args.length !== 2) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'signmessagewithprivkey "privkey" "message"'); - } - - const valid = new Validator$2(args); - const wif = valid.str(0, ''); - const str = valid.str(1, ''); - - const key = parseSecret$1(wif, this.network); - const sig = messageUtil$1.sign(str, key); - - return sig.toString('base64'); - } - - async estimateFee(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatefee nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Fee estimation not available.'); - - const fee = this.fees.estimateFee(blocks, false); - - if (fee === 0) - return -1; - - return Amount$2.btc(fee, true); - } - - async estimatePriority(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatepriority nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Priority estimation not available.'); - - return this.fees.estimatePriority(blocks, false); - } - - async estimateSmartFee(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatesmartfee nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Fee estimation not available.'); - - let fee = this.fees.estimateFee(blocks, true); - - if (fee === 0) - fee = -1; - else - fee = Amount$2.btc(fee, true); - - return { - fee: fee, - blocks: blocks - }; - } - - async estimateSmartPriority(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'estimatesmartpriority nblocks'); - - const valid = new Validator$2(args); - const blocks = valid.u32(0, 1); - - if (!this.fees) - throw new RPCError$1(errs$1.MISC_ERROR, 'Priority estimation not available.'); - - const pri = this.fees.estimatePriority(blocks, true); - - return { - priority: pri, - blocks: blocks - }; - } - - async invalidateBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'invalidateblock "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - await this.chain.invalidate(hash); - - return null; - } - - async reconsiderBlock(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'reconsiderblock "hash"'); - - const valid = new Validator$2(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid block hash.'); - - this.chain.removeInvalid(hash); - - return null; - } - - async setMockTime(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'setmocktime timestamp'); - - const valid = new Validator$2(args); - const time = valid.u32(0); - - if (time == null) - throw new RPCError$1(errs$1.TYPE_ERROR, 'Invalid timestamp.'); - - this.network.time.offset = 0; - - const delta = this.network.now() - time; - - this.network.time.offset = -delta; - - return null; - } - - async getMemoryInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError$1(errs$1.MISC_ERROR, 'getmemoryinfo'); - - return this.logger.memoryUsage(); - } - - async setLogLevel(args, help) { - if (help || args.length !== 1) - throw new RPCError$1(errs$1.MISC_ERROR, 'setloglevel "level"'); - - const valid = new Validator$2(args); - const level = valid.str(0, ''); - - this.logger.setLevel(level); - - return null; - } - - /* - * Helpers - */ - - async handleLongpoll(lpid) { - if (lpid.length !== 72) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid longpoll ID.'); - - const watched = lpid.slice(0, 64); - const lastTX = parseInt(lpid.slice(64, 72), 16); - - if ((lastTX >>> 0) !== lastTX) - throw new RPCError$1(errs$1.INVALID_PARAMETER, 'Invalid longpoll ID.'); - - const hash = util$5.revHex(watched); - - if (!this.chain.tip.hash.equals(hash)) - return; - - await this.longpoll(); - } - - longpoll() { - return new Promise((resolve, reject) => { - this.pollers.push({ resolve, reject }); - }); - } - - refreshBlock() { - const pollers = this.pollers; - - this.attempt = null; - this.lastActivity = 0; - this.merkleMap.clear(); - this.nonce1 = 0; - this.nonce2 = 0; - this.pollers = []; - - for (const job of pollers) - job.resolve(); - } - - bindChain() { - if (this.boundChain) - return; - - this.boundChain = true; - - this.node.on('connect', () => { - if (!this.attempt) - return; - - this.refreshBlock(); - }); - - if (!this.mempool) - return; - - this.node.on('tx', () => { - if (!this.attempt) - return; - - if (util$5.now() - this.lastActivity > 10) - this.refreshBlock(); - }); - } - - async getTemplate() { - this.bindChain(); - - let attempt = this.attempt; - - if (attempt) { - this.miner.updateTime(attempt); - } else { - attempt = await this.miner.createBlock(); - this.attempt = attempt; - this.lastActivity = util$5.now(); - } - - return attempt; - } - - async updateWork() { - this.bindChain(); - - let attempt = this.attempt; - - if (attempt) { - if (attempt.address.isNull()) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - this.miner.updateTime(attempt); - - if (++this.nonce2 === 0x100000000) { - this.nonce2 = 0; - this.nonce1++; - } - - const n1 = this.nonce1; - const n2 = this.nonce2; - - const root = attempt.getRoot(n1, n2); - - this.merkleMap.set(root, [n1, n2]); - - return attempt; - } - - if (this.miner.addresses.length === 0) { - throw new RPCError$1(errs$1.MISC_ERROR, - 'No addresses available for coinbase.'); - } - - attempt = await this.miner.createBlock(); - - const n1 = this.nonce1; - const n2 = this.nonce2; - - const root = attempt.getRoot(n1, n2); - - this.attempt = attempt; - this.lastActivity = util$5.now(); - this.merkleMap.set(root, [n1, n2]); - - return attempt; - } - - async addBlock(block) { - const unlock1 = await this.locker.lock(); - const unlock2 = await this.chain.locker.lock(); - try { - return await this._addBlock(block); - } finally { - unlock2(); - unlock1(); - } - } - - async _addBlock(block) { - this.logger.info('Handling submitted block: %h.', block.hash()); - - const prev = await this.chain.getEntry(block.prevBlock); - - if (prev) { - const state = await this.chain.getDeployments(block.time, prev); - - // Fix eloipool bug (witness nonce is not present). - if (state.hasWitness() && block.getCommitmentHash()) { - const tx = block.txs[0]; - const input = tx.inputs[0]; - if (!tx.hasWitness()) { - this.logger.warning('Submitted block had no witness nonce.'); - this.logger.debug(tx); - - // Recreate witness nonce (all zeroes). - input.witness.push(consensus$5.ZERO_HASH); - input.witness.compile(); - - tx.refresh(); - block.refresh(); - } - } - } - - let entry; - try { - entry = await this.chain._add(block); - } catch (err) { - if (err.type === 'VerifyError') { - this.logger.warning('RPC block rejected: %h (%s).', - block.hash(), err.reason); - return `rejected: ${err.reason}`; - } - throw err; - } - - if (!entry) { - this.logger.warning('RPC block rejected: %h (bad-prevblk).', - block.hash()); - return 'rejected: bad-prevblk'; - } - - return null; - } - - totalTX() { - return this.mempool ? this.mempool.map.size : 0; - } - - getSoftforks() { - return [ - toDeployment('bip34', 2, this.chain.state.hasBIP34()), - toDeployment('bip66', 3, this.chain.state.hasBIP66()), - toDeployment('bip65', 4, this.chain.state.hasCLTV()) - ]; - } - - async getBIP9Softforks() { - const tip = this.chain.tip; - const forks = {}; - - for (const deployment of this.network.deploys) { - const state = await this.chain.getState(tip, deployment); - let status; - - switch (state) { - case common$7.thresholdStates.DEFINED: - status = 'defined'; - break; - case common$7.thresholdStates.STARTED: - status = 'started'; - break; - case common$7.thresholdStates.LOCKED_IN: - status = 'locked_in'; - break; - case common$7.thresholdStates.ACTIVE: - status = 'active'; - break; - case common$7.thresholdStates.FAILED: - status = 'failed'; - break; - default: - assert$n(false, 'Bad state.'); - break; - } - - forks[deployment.name] = { - status: status, - bit: deployment.bit, - startTime: deployment.startTime, - timeout: deployment.timeout - }; - } - - return forks; - } - - async getHashRate(lookup, height) { - let tip = this.chain.tip; - - if (height != null) - tip = await this.chain.getEntry(height); - - if (!tip) - return 0; - - assert$n(typeof lookup === 'number'); - assert$n(lookup >= 0); - - if (lookup === 0) - lookup = tip.height % this.network.pow.retargetInterval + 1; - - if (lookup > tip.height) - lookup = tip.height; - - let min = tip.time; - let max = min; - let entry = tip; - - for (let i = 0; i < lookup; i++) { - entry = await this.chain.getPrevious(entry); - - if (!entry) - throw new RPCError$1(errs$1.DATABASE_ERROR, 'Not found.'); - - min = Math.min(entry.time, min); - max = Math.max(entry.time, max); - } - - const diff = max - min; - - if (diff === 0) - return 0; - - const work = tip.chainwork.sub(entry.chainwork); - - return Number(work.toString()) / diff; - } - - async mineBlocks(blocks, addr, tries) { - const unlock = await this.locker.lock(); - try { - return await this._mineBlocks(blocks, addr, tries); - } finally { - unlock(); - } - } - - async _mineBlocks(blocks, addr, tries) { - const hashes = []; - - for (let i = 0; i < blocks; i++) { - const block = await this.miner.mineBlock(null, addr); - const entry = await this.chain.add(block); - assert$n(entry); - hashes.push(entry.rhash()); - } - - return hashes; - } - - async findFork(entry) { - while (entry) { - if (await this.chain.isMainChain(entry)) - return entry; - entry = await this.chain.getPrevious(entry); - } - throw new Error('Fork not found.'); - } - - txToJSON(tx, entry) { - let height = -1; - let time = 0; - let hash = null; - let conf = 0; - - if (entry) { - height = entry.height; - time = entry.time; - hash = entry.rhash(); - conf = this.chain.height - height + 1; - } - - const vin = []; - - for (const input of tx.inputs) { - const json = { - coinbase: undefined, - txid: undefined, - scriptSig: undefined, - txinwitness: undefined, - sequence: input.sequence - }; - - if (tx.isCoinbase()) { - json.coinbase = input.script.toJSON(); - } else { - json.txid = input.prevout.txid(); - json.vout = input.prevout.index; - json.scriptSig = { - asm: input.script.toASM(), - hex: input.script.toJSON() - }; - } - - if (input.witness.items.length > 0) { - json.txinwitness = input.witness.items.map((item) => { - return item.toString('hex'); - }); - } - - vin.push(json); - } - - const vout = []; - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - vout.push({ - value: Amount$2.btc(output.value, true), - n: i, - scriptPubKey: this.scriptToJSON(output.script, true) - }); - } - - return { - txid: tx.txid(), - hash: tx.wtxid(), - size: tx.getSize(), - vsize: tx.getVirtualSize(), - version: tx.version, - locktime: tx.locktime, - vin: vin, - vout: vout, - blockhash: hash, - confirmations: conf, - time: time, - blocktime: time, - hex: undefined - }; - } - - scriptToJSON(script, hex) { - const type = script.getType(); - - const json = { - asm: script.toASM(), - hex: undefined, - type: Script$8.typesByVal[type], - reqSigs: 1, - addresses: [], - p2sh: undefined - }; - - if (hex) - json.hex = script.toJSON(); - - const [m] = script.getMultisig(); - - if (m !== -1) - json.reqSigs = m; - - const addr = script.getAddress(); - - if (addr) { - const str = addr.toString(this.network); - json.addresses.push(str); - } - - return json; - } - - async headerToJSON(entry) { - const mtp = await this.chain.getMedianTime(entry); - const next = await this.chain.getNextHash(entry.hash); - - let confirmations = -1; - if (await this.chain.isMainChain(entry)) - confirmations = this.chain.height - entry.height + 1; - - return { - hash: entry.rhash(), - confirmations: confirmations, - height: entry.height, - version: entry.version, - versionHex: hex32(entry.version), - merkleroot: util$5.revHex(entry.merkleRoot), - time: entry.time, - mediantime: mtp, - nonce: entry.nonce, - bits: hex32(entry.bits), - difficulty: toDifficulty(entry.bits), - chainwork: entry.chainwork.toString('hex', 64), - previousblockhash: !entry.prevBlock.equals(consensus$5.ZERO_HASH) - ? util$5.revHex(entry.prevBlock) - : null, - nextblockhash: next ? util$5.revHex(next) : null - }; - } - - async blockToJSON(entry, block, details) { - const mtp = await this.chain.getMedianTime(entry); - const next = await this.chain.getNextHash(entry.hash); - - let confirmations = -1; - if (await this.chain.isMainChain(entry)) - confirmations = this.chain.height - entry.height + 1; - - const txs = []; - - for (const tx of block.txs) { - if (details) { - const json = this.txToJSON(tx, entry); - txs.push(json); - continue; - } - txs.push(tx.txid()); - } - - return { - hash: entry.rhash(), - confirmations: confirmations, - strippedsize: block.getBaseSize(), - size: block.getSize(), - weight: block.getWeight(), - height: entry.height, - version: entry.version, - versionHex: hex32(entry.version), - merkleroot: util$5.revHex(entry.merkleRoot), - coinbase: block.txs[0].inputs[0].script.toJSON(), - tx: txs, - time: entry.time, - mediantime: mtp, - nonce: entry.nonce, - bits: hex32(entry.bits), - difficulty: toDifficulty(entry.bits), - chainwork: entry.chainwork.toString('hex', 64), - nTx: txs.length, - previousblockhash: !entry.prevBlock.equals(consensus$5.ZERO_HASH) - ? util$5.revHex(entry.prevBlock) - : null, - nextblockhash: next ? util$5.revHex(next) : null - }; - } - - entryToJSON(entry) { - return { - size: entry.size, - fee: Amount$2.btc(entry.deltaFee, true), - modifiedfee: 0, - time: entry.time, - height: entry.height, - startingpriority: entry.priority, - currentpriority: entry.getPriority(this.chain.height), - descendantcount: this.mempool.countDescendants(entry), - descendantsize: entry.descSize, - descendantfees: entry.descFee, - ancestorcount: this.mempool.countAncestors(entry), - ancestorsize: 0, - ancestorfees: 0, - depends: this.mempool.getDepends(entry.tx).map(util$5.revHex) - }; - } -} - -/* - * Helpers - */ - -function swap32(data) { - for (let i = 0; i < data.length; i += 4) { - const field = data.readUInt32LE(i, true); - data.writeUInt32BE(field, i, true); - } - return data; -} - -function toDeployment(id, version, status) { - return { - id: id, - version: version, - reject: { - status: status - } - }; -} - -function parseAddress$1(raw, network) { - try { - return Address$6.fromString(raw, network); - } catch (e) { - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid address.'); - } -} - -function parseSecret$1(raw, network) { - try { - return KeyRing$3.fromSecret(raw, network); - } catch (e) { - throw new RPCError$1(errs$1.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - } -} - -function parseIP(addr, network) { - try { - return IP.fromHostname(addr, network.port); - } catch (e) { - throw new RPCError$1(errs$1.CLIENT_INVALID_IP_OR_SUBNET, - 'Invalid IP address or subnet.'); - } -} - -function parseNetAddress(addr, network) { - try { - return NetAddress.fromHostname(addr, network); - } catch (e) { - throw new RPCError$1(errs$1.CLIENT_INVALID_IP_OR_SUBNET, - 'Invalid IP address or subnet.'); - } -} - -function toDifficulty(bits) { - let shift = (bits >>> 24) & 0xff; - let diff = 0x0000ffff / (bits & 0x00ffffff); - - while (shift < 29) { - diff *= 256.0; - shift++; - } - - while (shift > 29) { - diff /= 256.0; - shift--; - } - - return diff; -} - -function hex32(num) { - assert$n(num >= 0); - - num = num.toString(16); - - assert$n(num.length <= 8); - - while (num.length < 8) - num = '0' + num; - - return num; -} - -/* - * Expose - */ - -var rpc$1 = RPC$4; - -var blockstore$1 = {}; - -/*! - * blockstore/abstract.js - abstract blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const Logger$1 = blgr; - -/** - * Abstract Block Store - * - * @alias module:blockstore.AbstractBlockStore - * @abstract - */ - -class AbstractBlockStore$3 { - /** - * Create an abstract blockstore. - * @constructor - */ - - constructor(options) { - this.options = options || {}; - - if (this.options.logger != null) - this.logger = this.options.logger.context('blockstore'); - else - this.logger = Logger$1.global.context('blockstore'); - } - - /** - * This method ensures that resources are available - * before opening. - * @returns {Promise} - */ - - async ensure() { - throw new Error('Abstract method.'); - } - - /** - * This method opens any necessary resources and - * initializes the store to be ready to be queried. - * @returns {Promise} - */ - - async open() { - throw new Error('Abstract method.'); - } - - /** - * This method closes resources and prepares - * the store to be closed. - * @returns {Promise} - */ - - async close() { - throw new Error('Abstract method.'); - } - - /** - * This method stores merkle blocks including - * all the relevant transactions. - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores block undo coin data. - * @returns {Promise} - */ - - async writeUndo(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores serialized block filter data in files. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method stores block data. - * @returns {Promise} - */ - - async write(hash, data) { - throw new Error('Abstract method.'); - } - - /** - * This method reads merkle block data. - * @returns {Promise} - */ - - async readMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve serialized block filter data. - * @returns {Promise} - */ - - async readFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block filter header only. - * @returns {Promise} - */ - - async readFilterHeader(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block undo coin data. - * @returns {Promise} - */ - - async readUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This method will retrieve block data. Smaller portions of - * the block can be read by using the offset and size arguments. - * @returns {Promise} - */ - - async read(hash, offset, size) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the merkle block data. - * @returns {Promise} - */ - - async pruneMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the block undo coin data. - * @returns {Promise} - */ - - async pruneUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the serialized block filter data. - * @returns {Promise} - */ - - async pruneFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will free resources for storing the block data. - * @returns {Promise} - */ - - async prune(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if merkle block data has been stored - * and is available. - * @returns {Promise} - */ - - async hasMerkle(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block undo coin data has been stored - * and is available. - * @returns {Promise} - */ - - async hasUndo(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @returns {Promise} - */ - - async hasFilter(hash) { - throw new Error('Abstract method.'); - } - - /** - * This will check if a block has been stored and is available. - * @returns {Promise} - */ - - async has(hash) { - throw new Error('Abstract method.'); - } -} - -/* - * Expose - */ - -var abstract = AbstractBlockStore$3; - -/*! - * blockstore/layout.js - file blockstore data layout for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const bdb$5 = bdb$d; - -/* - * Database Layout: - * V -> db version - * F[type] -> last file record by type - * f[type][fileno] -> file record by type and file number - * b[type][hash] -> block record by type and block hash - */ - -const layout$5 = { - V: bdb$5.key('V'), - F: bdb$5.key('F', ['uint32']), - f: bdb$5.key('f', ['uint32', 'uint32']), - b: bdb$5.key('b', ['uint32', 'hash256']) -}; - -/* - * Expose - */ - -var layout_1 = layout$5; - -var common$6 = {}; - -/*! - * common.js - blockstore constants for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module blockstore/common - */ - -/** - * Block data types. - * @enum {Number} - */ - -common$6.types = { - BLOCK: 1, - UNDO: 2, - FILTER: 3, - MERKLE: 4 -}; - -/** - * File prefixes for block data types. - * @enum {String} - */ - -common$6.prefixes = { - 1: 'blk', - 2: 'blu', - 3: 'blf', - 4: 'blm' -}; - -/*! - * blockstore/level.js - leveldb blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const bdb$4 = bdb$d; -const fs$2 = bfile; -const AbstractBlockStore$2 = abstract; -const layout$4 = layout_1; -const {types: types$1} = common$6; - -/** - * LevelDB Block Store - * - * @alias module:blockstore:LevelBlockStore - * @abstract - */ - -class LevelBlockStore$1 extends AbstractBlockStore$2 { - /** - * Create a blockstore that stores blocks in LevelDB. - * @constructor - */ - - constructor(options) { - super(options); - - this.location = options.location; - - this.db = bdb$4.create({ - location: this.location, - cacheSize: options.cacheSize, - compression: false, - memory: options.memory - }); - } - - /** - * This method ensures that the storage directory exists - * before opening. - * @returns {Promise} - */ - - async ensure() { - return fs$2.mkdirp(this.location); - } - - /** - * Opens the block storage. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening LevelBlockStore...'); - - await this.db.open(); - await this.db.verify(layout$4.V.encode(), 'levelblockstore', 0); - } - - /** - * Closes the block storage. - */ - - async close() { - this.logger.info('Closing LevelBlockStore...'); - - await this.db.close(); - } - - /** - * This method stores merkle block data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - return this.db.put(layout$4.b.encode(types$1.MERKLE, hash), data); - } - - /** - * This method stores block undo coin data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeUndo(hash, data) { - return this.db.put(layout$4.b.encode(types$1.UNDO, hash), data); - } - - /** - * This method stores block data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async write(hash, data) { - return this.db.put(layout$4.b.encode(types$1.BLOCK, hash), data); - } - - /** - * This method stores serialized block filter data in LevelDB. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The serialized block filter data. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - return this.db.put(layout$4.b.encode(types$1.FILTER, hash), data); - } - - /** - * This method will retrieve merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readMerkle(hash) { - return this.db.get(layout$4.b.encode(types$1.MERKLE, hash)); - } - - /** - * This method will retrieve block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readUndo(hash) { - return this.db.get(layout$4.b.encode(types$1.UNDO, hash)); - } - - /** - * This method will retrieve serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilter(hash) { - return this.db.get(layout$4.b.encode(types$1.FILTER, hash)); - } - - /** - * This method will retrieve block filter header only. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilterHeader(hash) { - const data = await this.db.get(layout$4.b.encode(types$1.FILTER, hash)); - - if (!data) - return null; - - return data.slice(0, 32); - } - - /** - * This method will retrieve block data. Smaller portions of the - * block (e.g. transactions) can be returned using the offset and - * length arguments. However, the entire block will be read as the - * data is stored in a key/value database. - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async read(hash, offset, length) { - let raw = await this.db.get(layout$4.b.encode(types$1.BLOCK, hash)); - - if (offset) { - if (offset + length > raw.length) - throw new Error('Out-of-bounds read.'); - - raw = raw.slice(offset, offset + length); - } - - return raw; - } - - /** - * This will free resources for storing merkle block data. - * The block data may not be immediately removed from disk, and will - * be reclaimed during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneMerkle(hash) { - if (!await this.hasMerkle(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.MERKLE, hash)); - - return true; - } - - /** - * This will free resources for storing the block undo coin data. - * The block data may not be immediately removed from disk, and will - * be reclaimed during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneUndo(hash) { - if (!await this.hasUndo(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.UNDO, hash)); - - return true; - } - - /** - * This will free resources for storing the serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneFilter(hash) { - if (!await this.hasFilter(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.FILTER, hash)); - - return true; - } - - /** - * This will free resources for storing the block data. The block - * data may not be immediately removed from disk, and will be reclaimed - * during LevelDB compaction. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async prune(hash) { - if (!await this.has(hash)) - return false; - - await this.db.del(layout$4.b.encode(types$1.BLOCK, hash)); - - return true; - } - - /** - * This will check if a merkle block data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasMerkle(hash) { - return this.db.has(layout$4.b.encode(types$1.MERKLE, hash)); - } - - /** - * This will check if a block undo coin data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasUndo(hash) { - return this.db.has(layout$4.b.encode(types$1.UNDO, hash)); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasFilter(hash) { - return this.db.has(layout$4.b.encode(types$1.FILTER, hash)); - } - - /** - * This will check if a block has been stored and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async has(hash) { - return this.db.has(layout$4.b.encode(types$1.BLOCK, hash)); - } -} - -/* - * Expose - */ - -var level = LevelBlockStore$1; - -var records$3 = {exports: {}}; - -/*! - * blockstore/records.js - blockstore records - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -(function (module, exports) { - -const assert = assert_1$g; -const bio = bufio; - -/** - * @module blockstore/records - */ - -/** - * Block Record - */ - -class BlockRecord { - /** - * Create a block record. - * @constructor - */ - - constructor(options = {}) { - this.file = options.file || 0; - this.position = options.position || 0; - this.length = options.length || 0; - - assert((this.file >>> 0) === this.file); - assert((this.position >>> 0) === this.position); - assert((this.length >>> 0) === this.length); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.file = br.readU32(); - this.position = br.readU32(); - this.length = br.readU32(); - - return this; - } - - /** - * Instantiate block record from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {BlockRecord} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the block record. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(12); - - bw.writeU32(this.file); - bw.writeU32(this.position); - bw.writeU32(this.length); - - return bw.render(); - } -} - -/** - * File Record - */ - -class FileRecord { - /** - * Create a file record. - * @constructor - */ - - constructor(options = {}) { - this.blocks = options.blocks || 0; - this.used = options.used || 0; - this.length = options.length || 0; - - assert((this.blocks >>> 0) === this.blocks); - assert((this.used >>> 0) === this.used); - assert((this.length >>> 0) === this.length); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.blocks = br.readU32(); - this.used = br.readU32(); - this.length = br.readU32(); - - return this; - } - - /** - * Instantiate file record from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {ChainState} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the file record. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(12); - - bw.writeU32(this.blocks); - bw.writeU32(this.used); - bw.writeU32(this.length); - - return bw.render(); - } -} - -/* - * Expose - */ - -exports.BlockRecord = BlockRecord; -exports.FileRecord = FileRecord; - -module.exports = exports; -}(records$3, records$3.exports)); - -/*! - * blockstore/file.js - file blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const {isAbsolute, resolve, join: join$1} = require$$1$3; -const bdb$3 = bdb$d; -const assert$m = assert_1$g; -const fs$1 = bfile; -const bio$7 = bufio; -const hash256$3 = hash256$k.exports; -const Network$2 = network; -const AbstractBlockStore$1 = abstract; -const {BlockRecord: BlockRecord$1, FileRecord} = records$3.exports; -const layout$3 = layout_1; -const {types, prefixes} = common$6; - -/** - * File Block Store - * - * @alias module:blockstore:FileBlockStore - * @abstract - */ - -class FileBlockStore$1 extends AbstractBlockStore$1 { - /** - * Create a blockstore that stores blocks in files. - * @constructor - */ - - constructor(options) { - super(options); - - assert$m(isAbsolute(options.location), 'Location not absolute.'); - - this.location = options.location; - this.indexLocation = resolve(this.location, './index'); - - this.db = bdb$3.create({ - location: this.indexLocation, - cacheSize: options.cacheSize, - compression: false - }); - - this.maxFileLength = options.maxFileLength || 128 * 1024 * 1024; - - assert$m(Number.isSafeInteger(this.maxFileLength), - 'Invalid max file length.'); - - this.network = Network$2.primary; - - if (options.network != null) - this.network = Network$2.get(options.network); - - this.writing = Object.create(null); - } - - /** - * Compares the number of files in the directory - * with the recorded number of files. - * @param {Number} type - The type of block data - * @private - * @returns {Promise} - */ - - async check(type) { - const prefix = prefixes[type]; - const regexp = new RegExp(`^${prefix}(\\d{5})\\.dat$`); - const all = await fs$1.readdir(this.location); - const dats = all.filter(f => regexp.test(f)); - const filenos = dats.map(f => parseInt(f.match(regexp)[1])); - - let missing = false; - - for (const fileno of filenos) { - const rec = await this.db.get(layout$3.f.encode(type, fileno)); - if (!rec) { - missing = true; - break; - } - } - - return {missing, filenos}; - } - - /** - * Creates indexes from files for a block type. Reads the hash of - * the block data from the magic prefix, except for a block which - * the hash is read from the block header. - * @private - * @param {Number} type - The type of block data - * @returns {Promise} - */ - - async _index(type) { - const {missing, filenos} = await this.check(type); - - if (!missing) - return; - - this.logger.info('Indexing block type %d...', type); - - for (const fileno of filenos) { - const b = this.db.batch(); - const filepath = this.filepath(type, fileno); - const data = await fs$1.readFile(filepath); - const reader = bio$7.read(data); - let magic = null; - let blocks = 0; - - while (reader.left() >= 4) { - magic = reader.readU32(); - - // Move forward a byte from the last read - // if the magic doesn't match. - if (magic !== this.network.magic) { - reader.seek(-3); - continue; - } - - let hash = null; - let position = 0; - let length = 0; - - try { - length = reader.readU32(); - - if (type === types.BLOCK || type === types.MERKLE) { - position = reader.offset; - hash = hash256$3.digest(reader.readBytes(80, true)); - reader.seek(length - 80); - } else { - hash = reader.readHash(); - position = reader.offset; - reader.seek(length); - } - } catch (err) { - this.logger.warning( - 'Unknown block in file: %s, reason: %s', - filepath, err.message); - continue; - } - - const blockrecord = new BlockRecord$1({ - file: fileno, - position: position, - length: length - }); - - blocks += 1; - b.put(layout$3.b.encode(type, hash), blockrecord.toRaw()); - } - - const filerecord = new FileRecord({ - blocks: blocks, - used: reader.offset, - length: this.maxFileLength - }); - - b.put(layout$3.f.encode(type, fileno), filerecord.toRaw()); - - await b.write(); - - this.logger.info('Indexed %d blocks (file=%s).', blocks, filepath); - } - } - - /** - * Compares the number of files in the directory - * with the recorded number of files. If there are any - * inconsistencies it will reindex all blocks. - * @private - * @returns {Promise} - */ - - async index() { - await this._index(types.BLOCK); - await this._index(types.MERKLE); - await this._index(types.UNDO); - } - - /** - * This method ensures that both the block storage directory - * and index directory exist. - * before opening. - * @returns {Promise} - */ - - async ensure() { - return fs$1.mkdirp(this.indexLocation); - } - - /** - * Opens the file block store. It will regenerate necessary block - * indexing if the index is missing or inconsistent. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening FileBlockStore...'); - - await this.db.open(); - await this.db.verify(layout$3.V.encode(), 'fileblockstore', 0); - - await this.index(); - } - - /** - * This closes the file block store and underlying - * indexing databases. - */ - - async close() { - this.logger.info('Closing FileBlockStore...'); - - await this.db.close(); - } - - /** - * This method will determine the file path based on the file number - * and the current block data location. - * @private - * @param {Number} type - The type of block data - * @param {Number} fileno - The number of the file. - * @returns {Promise} - */ - - filepath(type, fileno) { - const pad = 5; - - let num = fileno.toString(10); - - if (num.length > pad) - throw new Error('File number too large.'); - - while (num.length < pad) - num = `0${num}`; - - let filepath = null; - - const prefix = prefixes[type]; - - if (!prefix) - throw new Error('Unknown file prefix.'); - - filepath = join$1(this.location, `${prefix}${num}.dat`); - - return filepath; - } - - /** - * This method will select and potentially allocate a file to - * write a block based on the size and type. - * @private - * @param {Number} type - The type of block data - * @param {Number} length - The number of bytes - * @returns {Promise} - */ - - async allocate(type, length) { - if (length > this.maxFileLength) - throw new Error('Block length above max file length.'); - - let fileno = 0; - let filerecord = null; - let filepath = null; - - const last = await this.db.get(layout$3.F.encode(type)); - if (last) - fileno = bio$7.readU32(last, 0); - - filepath = this.filepath(type, fileno); - - const rec = await this.db.get(layout$3.f.encode(type, fileno)); - - let touch = false; - - if (rec) { - filerecord = FileRecord.fromRaw(rec); - } else { - touch = true; - filerecord = new FileRecord({ - blocks: 0, - used: 0, - length: this.maxFileLength - }); - } - - if (filerecord.used + length > filerecord.length) { - fileno += 1; - filepath = this.filepath(type, fileno); - touch = true; - filerecord = new FileRecord({ - blocks: 0, - used: 0, - length: this.maxFileLength - }); - } - - if (touch) { - const fd = await fs$1.open(filepath, 'w'); - await fs$1.close(fd); - } - - return {fileno, filerecord, filepath}; - } - - /** - * This method stores merkle block data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeMerkle(hash, data) { - return this._write(types.MERKLE, hash, data); - } - - /** - * This method stores block undo coin data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async writeUndo(hash, data) { - return this._write(types.UNDO, hash, data); - } - - /** - * This method stores block data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async write(hash, data) { - return this._write(types.BLOCK, hash, data); - } - - /** - * This method stores serialized block filter data in files. - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The serialized block filter data. - * @returns {Promise} - */ - - async writeFilter(hash, data) { - return this._write(types.FILTER, hash, data); - } - - /** - * This method stores block data in files with by appending - * data to the last written file and updating indexes to point - * to the file and position. - * @private - * @param {Number} type - The type of block data - * @param {Buffer} hash - The block hash - * @param {Buffer} data - The block data - * @returns {Promise} - */ - - async _write(type, hash, data) { - if (this.writing[type]) - throw new Error('Already writing.'); - - this.writing[type] = true; - - if (await this.db.has(layout$3.b.encode(type, hash))) { - this.writing[type] = false; - return false; - } - - let mlength = 8; - - // Hash for a block is not stored with - // the magic prefix as it's read from the header - // of the block data. - if (type !== types.BLOCK && type !== types.MERKLE) - mlength += 32; - - const blength = data.length; - const length = data.length + mlength; - - const bwm = bio$7.write(mlength); - - bwm.writeU32(this.network.magic); - bwm.writeU32(blength); - - if (type !== types.BLOCK && type !== types.MERKLE) - bwm.writeHash(hash); - - const magic = bwm.render(); - - const { - fileno, - filerecord, - filepath - } = await this.allocate(type, length); - - const mposition = filerecord.used; - const bposition = filerecord.used + mlength; - - const fd = await fs$1.open(filepath, 'r+'); - - let mwritten = 0; - let bwritten = 0; - - try { - mwritten = await fs$1.write(fd, magic, 0, mlength, mposition); - bwritten = await fs$1.write(fd, data, 0, blength, bposition); - } finally { - await fs$1.close(fd); - } - - if (mwritten !== mlength) { - this.writing[type] = false; - throw new Error('Could not write block magic.'); - } - - if (bwritten !== blength) { - this.writing[type] = false; - throw new Error('Could not write block.'); - } - - filerecord.blocks += 1; - filerecord.used += length; - - const b = this.db.batch(); - - const blockrecord = new BlockRecord$1({ - file: fileno, - position: bposition, - length: blength - }); - - b.put(layout$3.b.encode(type, hash), blockrecord.toRaw()); - b.put(layout$3.f.encode(type, fileno), filerecord.toRaw()); - - const last = bio$7.write(4).writeU32(fileno).render(); - b.put(layout$3.F.encode(type), last); - - await b.write(); - - this.writing[type] = false; - - return true; - } - - /** - * This method will retrieve merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readMerkle(hash) { - return this._read(types.MERKLE, hash); - } - - /** - * This method will retrieve block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readUndo(hash) { - return this._read(types.UNDO, hash); - } - - /** - * This method will retrieve block data. Smaller portions of the - * block (e.g. transactions) can be read by using the offset and - * length arguments. - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async read(hash, offset, length) { - return this._read(types.BLOCK, hash, offset, length); - } - - /** - * This method will retrieve serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilter(hash) { - return this._read(types.FILTER, hash); - } - - /** - * This method will retrieve block filter header only. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async readFilterHeader(hash) { - return this._read(types.FILTER, hash, 0, 32); - } - - /** - * This methods reads data from disk by retrieving the index of - * the data and reading from the corresponding file and location. - * @private - * @param {Number} type - The type of block data - * @param {Buffer} hash - The block hash - * @param {Number} offset - The offset within the block - * @param {Number} length - The number of bytes of the data - * @returns {Promise} - */ - - async _read(type, hash, offset, length) { - const raw = await this.db.get(layout$3.b.encode(type, hash)); - if (!raw) - return null; - - const blockrecord = BlockRecord$1.fromRaw(raw); - - const filepath = this.filepath(type, blockrecord.file); - - let position = blockrecord.position; - - if (offset) - position += offset; - - if (!length && offset > 0) - length = blockrecord.length - offset; - - if (!length) - length = blockrecord.length; - - if (offset + length > blockrecord.length) - throw new Error('Out-of-bounds read.'); - - const data = Buffer.alloc(length); - - const fd = await fs$1.open(filepath, 'r'); - let bytes = 0; - - try { - bytes = await fs$1.read(fd, data, 0, length, position); - } finally { - await fs$1.close(fd); - } - - if (bytes !== length) - throw new Error('Wrong number of bytes read.'); - - return data; - } - - /** - * This will free resources for storing merkle block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneMerkle(hash) { - return this._prune(types.MERKLE, hash); - } - - /** - * This will free resources for storing the block undo coin data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneUndo(hash) { - return this._prune(types.UNDO, hash); - } - - /** - * This will free resources for storing the block data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async prune(hash) { - return this._prune(types.BLOCK, hash); - } - - /** - * This will free resources for storing the serialized block filter data. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async pruneFilter(hash) { - return this._prune(types.FILTER, hash); - } - - /** - * This will free resources for storing the block data. The block - * data may not be deleted from disk immediately, the index for the - * block is removed and will not be able to be read. The underlying - * file is unlinked when all blocks in a file have been pruned. - * @private - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async _prune(type, hash) { - const braw = await this.db.get(layout$3.b.encode(type, hash)); - if (!braw) - return false; - - const blockrecord = BlockRecord$1.fromRaw(braw); - - const fraw = await this.db.get(layout$3.f.encode(type, blockrecord.file)); - if (!fraw) - return false; - - const filerecord = FileRecord.fromRaw(fraw); - - filerecord.blocks -= 1; - - const b = this.db.batch(); - - if (filerecord.blocks === 0) - b.del(layout$3.f.encode(type, blockrecord.file)); - else - b.put(layout$3.f.encode(type, blockrecord.file), filerecord.toRaw()); - - b.del(layout$3.b.encode(type, hash)); - - await b.write(); - - if (filerecord.blocks === 0) - await fs$1.unlink(this.filepath(type, blockrecord.file)); - - return true; - } - - /** - * This will check if merkle block data has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasMerkle(hash) { - return await this.db.has(layout$3.b.encode(types.MERKLE, hash)); - } - - /** - * This will check if a block undo coin has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasUndo(hash) { - return await this.db.has(layout$3.b.encode(types.UNDO, hash)); - } - - /** - * This will check if a block filter has been stored - * and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async hasFilter(hash) { - return await this.db.has(layout$3.b.encode(types.FILTER, hash)); - } - - /** - * This will check if a block has been stored and is available. - * @param {Buffer} hash - The block hash - * @returns {Promise} - */ - - async has(hash) { - return await this.db.has(layout$3.b.encode(types.BLOCK, hash)); - } -} - -/* - * Expose - */ - -var file = FileBlockStore$1; - -/*! - * blockstore/index.js - bitcoin blockstore for bcoin - * Copyright (c) 2019, Braydon Fuller (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const {join} = require$$1$3; - -const AbstractBlockStore = abstract; -const LevelBlockStore = level; -const FileBlockStore = file; - -/** - * @module blockstore - */ - -blockstore$1.create = (options) => { - if (options.memory) { - return new LevelBlockStore({ - network: options.network, - logger: options.logger, - cacheSize: options.cacheSize, - memory: options.memory - }); - } - - const location = join(options.prefix, 'blocks'); - - return new FileBlockStore({ - network: options.network, - logger: options.logger, - location: location, - cacheSize: options.cacheSize - }); -}; - -blockstore$1.AbstractBlockStore = AbstractBlockStore; -blockstore$1.FileBlockStore = FileBlockStore; -blockstore$1.LevelBlockStore = LevelBlockStore; - -/*! - * filters.js - filter object for bcoin - * Copyright (c) 2019, the bcoin developers (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$l = assert_1$g; -const bio$6 = bufio; -const util$4 = util$y; -const consensus$4 = consensus$s; -const {inspectSymbol: inspectSymbol$5} = utils; - -/* - * Constants - */ - -const EMPTY_BUFFER = Buffer.alloc(0); - -/** - * Filter - * Represents a GCSFilter. - * @alias module:primitives.Filter - * @property {Hash} hash - * @property {Number} index - */ - -class Filter$1 { - /** - * Create an filter. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - this.header = consensus$4.ZERO_HASH; - this.filter = EMPTY_BUFFER; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$l(options, 'Filter data is required.'); - assert$l(Buffer.isBuffer(options.header)); - assert$l(Buffer.isBuffer(options.filter)); - this.header = options.header; - this.filter = options.filter; - return this; - } - - /** - * Instantate outpoint from options object. - * @param {Object} options - * @returns {Filter} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Write filter to a buffer writer. - * @param {BufferWriter} bw - */ - - toWriter(bw) { - bw.writeHash(this.header); - bw.writeBytes(this.filter); - return bw; - } - - /** - * Calculate size of filter. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 32; - size += this.filter.length; - return size; - } - - /** - * Serialize filter. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio$6.write(size)).render(); - } - - /** - * Inject properties from buffer reader. - * @private - * @param {BufferReader} br - */ - - fromReader(br) { - this.header = br.readHash(); - this.filter = br.readBytes(br.getSize() - br.offset); - return this; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - return this.fromReader(bio$6.read(data)); - } - - /** - * Instantiate filter from a buffer reader. - * @param {BufferReader} br - * @returns {Filter} - */ - - static fromReader(br) { - return new this().fromReader(br); - } - - /** - * Instantiate filter from serialized data. - * @param {Buffer} data - * @returns {Filter} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Inject properties from json object. - * @private - * @params {Object} json - */ - - fromJSON(json) { - assert$l(json, 'Filter data is required.'); - assert$l(typeof json.filter === 'string', 'Filter must be a string.'); - assert$l(typeof json.header === 'string', 'Header must be a string.'); - this.filter = Buffer.from(json.filter); - this.header = Buffer.from(json.header); - return this; - } - - /** - * Convert the filter to an object suitable - * for JSON serialization. - * @returns {Object} - */ - - toJSON() { - return { - filter: this.filter.toString('hex'), - header: util$4.revHex(this.header) - }; - } - - /** - * Instantiate filter from json object. - * @param {Object} json - * @returns {Filter} - */ - - static fromJSON(json) { - return new this().fromJSON(json); - } - - /** - * Convert the filter to a user-friendly string. - * @returns {String} - */ - - [inspectSymbol$5]() { - return ``; - } - - /** - * Test an object to see if it is an filter. - * @param {Object} obj - * @returns {Boolean} - */ - - static isFilter(obj) { - return obj instanceof Filter$1; - } -} - -/* - * Expose - */ - -var filter = Filter$1; - -/*! - * filterindexer.js - filter indexer - * Copyright (c) 2018, the bcoin developers (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const bdb$2 = bdb$d; -const assert$k = assert_1$g; -const Indexer = indexer; -const consensus$3 = consensus$s; -const Filter = filter; - -/** - * FilterIndexer - * @alias module:indexer.FilterIndexer - * @extends Indexer - */ - -class FilterIndexer$1 extends Indexer { - /** - * Create a indexer - * @constructor - * @param {Object} options - */ - - constructor(options) { - super('filter', options); - - this.db = bdb$2.create(this.options); - } - - /** - * Store genesis previous filter header. - * @private - * @returns {Promise} - */ - - async saveGenesis() { - const prevHash = this.network.genesis.prevBlock; - - // Genesis prev filter headers are defined to be zero hashes - const filter = new Filter(); - filter.header = consensus$3.ZERO_HASH; - await this.blocks.writeFilter(prevHash, filter.toRaw()); - - await super.saveGenesis(); - } - - /** - * Index compact filters. - * @private - * @param {BlockMeta} meta - * @param {Block} block - * @param {CoinView} view - */ - - async indexBlock(meta, block, view) { - const hash = block.hash(); - const prev = await this.getFilterHeader(block.prevBlock); - const basic = block.toFilter(view); - - const filter = new Filter(); - filter.header = basic.header(prev); - filter.filter = basic.toRaw(); - await this.blocks.writeFilter(hash, filter.toRaw()); - } - - /** - * Prune compact filters. - * @private - * @param {BlockMeta} meta - */ - - async pruneBlock(meta) { - await this.blocks.pruneFilter(meta.hash); - } - - /** - * Retrieve compact filter by hash. - * @param {Hash} hash - * @param {Number} type - * @returns {Promise} - Returns {@link Filter}. - */ - - async getFilter(hash) { - assert$k(hash); - - const filter = await this.blocks.readFilter(hash); - if (!filter) - return null; - - return Filter.fromRaw(filter); - } - - /** - * Retrieve compact filter header by hash. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Hash}. - */ - - async getFilterHeader(hash) { - assert$k(hash); - - return this.blocks.readFilterHeader(hash); - } -} - -var filterindexer = FilterIndexer$1; - -/*! - * fullnode.js - full node for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$j = assert_1$g; -const Chain$3 = chain$1; -const Fees = fees; -const Mempool = mempool; -const Pool$1 = pool; -const Miner = miner; -const Node$2 = node$1; -const HTTP$3 = http$1; -const RPC$3 = rpc$1; -const blockstore = blockstore$1; -const TXIndexer = txindexer; -const AddrIndexer = addrindexer$1; -const FilterIndexer = filterindexer; - -/** - * Full Node - * Respresents a fullnode complete with a - * chain, mempool, miner, etc. - * @alias module:node.FullNode - * @extends Node - */ - -class FullNode extends Node$2 { - /** - * Create a full node. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super('bcoin', 'bcoin.conf', 'debug.log', options); - - this.opened = false; - - // SPV flag. - this.spv = false; - - // Instantiate block storage. - this.blocks = blockstore.create({ - network: this.network, - logger: this.logger, - prefix: this.config.prefix, - cacheSize: this.config.mb('block-cache-size'), - memory: this.memory - }); - - // Chain needs access to blocks. - this.chain = new Chain$3({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - workers: this.workers, - memory: this.config.bool('memory'), - prefix: this.config.prefix, - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - forceFlags: this.config.bool('force-flags'), - bip91: this.config.bool('bip91'), - bip148: this.config.bool('bip148'), - prune: this.config.bool('prune'), - checkpoints: this.config.bool('checkpoints'), - entryCache: this.config.uint('entry-cache'), - indexTX: this.config.bool('index-tx'), - indexAddress: this.config.bool('index-address') - }); - - // Fee estimation. - this.fees = new Fees(this.logger); - this.fees.init(); - - // Mempool needs access to the chain. - this.mempool = new Mempool({ - network: this.network, - logger: this.logger, - workers: this.workers, - chain: this.chain, - fees: this.fees, - memory: this.memory, - prefix: this.config.prefix, - persistent: this.config.bool('persistent-mempool'), - maxSize: this.config.mb('mempool-size'), - limitFree: this.config.bool('limit-free'), - limitFreeRelay: this.config.uint('limit-free-relay'), - requireStandard: this.config.bool('require-standard'), - rejectAbsurdFees: this.config.bool('reject-absurd-fees'), - replaceByFee: this.config.bool('replace-by-fee'), - indexAddress: this.config.bool('index-address') - }); - - // Pool needs access to the chain and mempool. - this.pool = new Pool$1({ - network: this.network, - logger: this.logger, - chain: this.chain, - mempool: this.mempool, - prefix: this.config.prefix, - selfish: this.config.bool('selfish'), - compact: this.config.bool('compact'), - bip37: this.config.bool('bip37'), - maxOutbound: this.config.uint('max-outbound'), - maxInbound: this.config.uint('max-inbound'), - createSocket: this.config.func('create-socket'), - proxy: this.config.str('proxy'), - onion: this.config.bool('onion'), - upnp: this.config.bool('upnp'), - seeds: this.config.array('seeds'), - nodes: this.config.array('nodes'), - only: this.config.array('only'), - publicHost: this.config.str('public-host'), - publicPort: this.config.uint('public-port'), - host: this.config.str('host'), - port: this.config.uint('port'), - listen: this.config.bool('listen'), - memory: this.memory - }); - - // Miner needs access to the chain and mempool. - this.miner = new Miner({ - network: this.network, - logger: this.logger, - workers: this.workers, - chain: this.chain, - mempool: this.mempool, - address: this.config.array('coinbase-address'), - coinbaseFlags: this.config.str('coinbase-flags'), - preverify: this.config.bool('preverify'), - maxWeight: this.config.uint('max-weight'), - reservedWeight: this.config.uint('reserved-weight'), - reservedSigops: this.config.uint('reserved-sigops') - }); - - // RPC needs access to the node. - this.rpc = new RPC$3(this); - - // HTTP needs access to the node. - this.http = new HTTP$3({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - maxTxs: this.config.uint('max-txs') - }); - - // Indexers - if (this.config.bool('index-tx')) { - this.txindex = new TXIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - prune: this.config.bool('prune'), - memory: this.memory, - prefix: this.config.str('index-prefix', this.config.prefix) - }); - } - - if (this.config.bool('index-address')) { - this.addrindex= new AddrIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - prune: this.config.bool('prune'), - memory: this.memory, - prefix: this.config.str('index-prefix', this.config.prefix), - maxTxs: this.config.uint('max-txs') - }); - } - - if (this.config.bool('index-filter')) { - this.filterindex = new FilterIndexer({ - network: this.network, - logger: this.logger, - blocks: this.blocks, - chain: this.chain, - memory: this.config.bool('memory'), - prefix: this.config.str('index-prefix', this.config.prefix) - }); - } - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - // Bind to errors - this.chain.on('error', err => this.error(err)); - this.mempool.on('error', err => this.error(err)); - this.pool.on('error', err => this.error(err)); - this.miner.on('error', err => this.error(err)); - - if (this.txindex) - this.txindex.on('error', err => this.error(err)); - - if (this.addrindex) - this.addrindex.on('error', err => this.error(err)); - - if (this.filterindex) - this.filterindex.on('error', err => this.error(err)); - - if (this.http) - this.http.on('error', err => this.error(err)); - - this.mempool.on('tx', (tx) => { - this.miner.cpu.notifyEntry(); - this.emit('tx', tx); - }); - - this.chain.on('connect', async (entry, block) => { - try { - await this.mempool._addBlock(entry, block.txs); - } catch (e) { - this.error(e); - } - this.emit('block', block); - this.emit('connect', entry, block); - }); - - this.chain.on('disconnect', async (entry, block) => { - try { - await this.mempool._removeBlock(entry, block.txs); - } catch (e) { - this.error(e); - } - this.emit('disconnect', entry, block); - }); - - this.chain.on('reorganize', async (tip, competitor) => { - try { - await this.mempool._handleReorg(); - } catch (e) { - this.error(e); - } - this.emit('reorganize', tip, competitor); - }); - - this.chain.on('reset', async (tip) => { - try { - await this.mempool._reset(); - } catch (e) { - this.error(e); - } - this.emit('reset', tip); - }); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @alias FullNode#open - * @returns {Promise} - */ - - async open() { - assert$j(!this.opened, 'FullNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.blocks.open(); - await this.chain.open(); - await this.mempool.open(); - await this.miner.open(); - await this.pool.open(); - - if (this.txindex) - await this.txindex.open(); - - if (this.addrindex) - await this.addrindex.open(); - - if (this.filterindex) - await this.filterindex.open(); - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @alias FullNode#close - * @returns {Promise} - */ - - async close() { - assert$j(this.opened, 'FullNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - if (this.txindex) - await this.txindex.close(); - - if (this.addrindex) - await this.addrindex.close(); - - if (this.filterindex) - await this.filterindex.close(); - - await this.closePlugins(); - - await this.pool.close(); - await this.miner.close(); - await this.mempool.close(); - await this.chain.close(); - await this.blocks.close(); - - await this.handleClose(); - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - scan(start, filter, iter) { - return this.chain.scan(start, filter, iter); - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX|Block} item - * @returns {Promise} - */ - - async broadcast(item) { - try { - await this.pool.broadcast(item); - } catch (e) { - this.emit('error', e); - } - } - - /** - * Add transaction to mempool, broadcast. - * @param {TX} tx - * @returns {Promise} - */ - - async sendTX(tx) { - let missing; - - try { - missing = await this.mempool.addTX(tx); - } catch (err) { - if (err.type === 'VerifyError' && err.score === 0) { - this.error(err); - this.logger.warning('Verification failed for tx: %h.', tx.hash()); - this.logger.warning('Attempting to broadcast anyway...'); - this.broadcast(tx); - return; - } - throw err; - } - - if (missing) { - this.logger.warning('TX was orphaned in mempool: %h.', tx.hash()); - this.logger.warning('Attempting to broadcast anyway...'); - this.broadcast(tx); - return; - } - - // We need to announce by hand if - // we're running in selfish mode. - if (this.pool.options.selfish) - this.broadcast(tx); - } - - /** - * Add transaction to mempool, broadcast. Silence errors. - * @param {TX} tx - * @returns {Promise} - */ - - async relay(tx) { - try { - await this.sendTX(tx); - } catch (e) { - this.error(e); - } - } - - /** - * Connect to the network. - * @returns {Promise} - */ - - connect() { - return this.pool.connect(); - } - - /** - * Disconnect from the network. - * @returns {Promise} - */ - - disconnect() { - return this.pool.disconnect(); - } - - /** - * Start the blockchain sync. - */ - - startSync() { - if (this.txindex) - this.txindex.sync(); - - if (this.addrindex) - this.addrindex.sync(); - - if (this.filterindex) - this.filterindex.sync(); - - return this.pool.startSync(); - } - - /** - * Stop syncing the blockchain. - */ - - stopSync() { - return this.pool.stopSync(); - } - - /** - * Retrieve a block from the chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Block}. - */ - - getBlock(hash) { - return this.chain.getBlock(hash); - } - - /** - * Retrieve a coin from the mempool or chain database. - * Takes into account spent coins in the mempool. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCoin(hash, index) { - const coin = this.mempool.getCoin(hash, index); - - if (coin) - return coin; - - if (this.mempool.isSpent(hash, index)) - return null; - - return this.chain.getCoin(hash, index); - } - - /** - * Retrieve transactions pertaining to an - * address from the mempool or chain database. - * @param {Address} addr - * @param {Object} options - * @param {Number} options.limit - * @param {Number} options.reverse - * @param {Buffer} options.after - * @returns {Promise} - Returns {@link TXMeta}[]. - */ - - async getMetaByAddress(addr, options = {}) { - if (!this.txindex || !this.addrindex) - return []; - - const {reverse, after} = options; - let {limit} = options; - - let metas = []; - - const confirmed = async () => { - const hashes = await this.addrindex.getHashesByAddress( - addr, {limit, reverse, after}); - - for (const hash of hashes) { - const mtx = await this.txindex.getMeta(hash); - assert$j(mtx); - metas.push(mtx); - } - }; - - const unconfirmed = () => { - const mempool = this.mempool.getMetaByAddress( - addr, {limit, reverse, after}); - - metas = metas.concat(mempool); - }; - - if (reverse) - unconfirmed(); - else - await confirmed(); - - if (metas.length > 0) - limit -= metas.length; - - if (limit <= 0) - return metas; - - if (reverse) - await confirmed(); - else - unconfirmed(); - - return metas; - } - - /** - * Retrieve a transaction from the mempool or chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TXMeta}. - */ - - async getMeta(hash) { - const meta = this.mempool.getMeta(hash); - - if (meta) - return meta; - - if (this.txindex) - return this.txindex.getMeta(hash); - - return null; - } - - /** - * Retrieve a spent coin viewpoint from mempool or chain database. - * @param {TXMeta} meta - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getMetaView(meta) { - if (meta.height === -1) - return this.mempool.getSpentView(meta.tx); - - if (this.txindex) - return this.txindex.getSpentView(meta.tx); - - return null; - } - - /** - * Retrieve transactions pertaining to an - * address from the mempool or chain database. - * @param {Address} addr - * @param {Object} options - * @param {Number} options.limit - * @param {Number} options.reverse - * @param {Buffer} options.after - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getTXByAddress(addr, options = {}) { - const mtxs = await this.getMetaByAddress(addr, options); - const out = []; - - for (const mtx of mtxs) - out.push(mtx.tx); - - return out; - } - - /** - * Retrieve a transaction from the mempool or chain database. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - async getTX(hash) { - const mtx = await this.getMeta(hash); - - if (!mtx) - return null; - - return mtx.tx; - } - - /** - * Test whether the mempool or chain contains a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasTX(hash) { - if (this.mempool.hasEntry(hash)) - return true; - - if (this.txindex) - return this.txindex.hasTX(hash); - - return false; - } - - /** - * Retrieve compact filter by hash. - * @param {Hash | Number} hash - * @returns {Promise} - Returns {@link Buffer}. - */ - - async getBlockFilter(hash) { - if (!this.filterindex) - return null; - - if (typeof hash === 'number') - hash = await this.chain.getHash(hash); - - if (!hash) - return null; - - return this.filterindex.getFilter(hash); - } -} - -/* - * Expose - */ - -var fullnode = FullNode; - -/*! - * spvnode.js - spv node for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$i = assert_1$g; -const Chain$2 = chain$1; -const Pool = pool; -const Node$1 = node$1; -const HTTP$2 = http$1; -const RPC$2 = rpc$1; - -/** - * SPV Node - * Create an spv node which only maintains - * a chain, a pool, and an http server. - * @alias module:node.SPVNode - * @extends Node - */ - -class SPVNode extends Node$1 { - /** - * Create SPV node. - * @constructor - * @param {Object?} options - * @param {Buffer?} options.sslKey - * @param {Buffer?} options.sslCert - * @param {Number?} options.httpPort - * @param {String?} options.httpHost - */ - - constructor(options) { - super('bcoin', 'bcoin.conf', 'debug.log', options); - - this.opened = false; - - // SPV flag. - this.spv = true; - - this.chain = new Chain$2({ - network: this.network, - logger: this.logger, - prefix: this.config.prefix, - memory: this.memory, - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - entryCache: this.config.uint('entry-cache'), - forceFlags: this.config.bool('force-flags'), - checkpoints: this.config.bool('checkpoints'), - bip91: this.config.bool('bip91'), - bip148: this.config.bool('bip148'), - spv: true - }); - - this.pool = new Pool({ - network: this.network, - logger: this.logger, - chain: this.chain, - prefix: this.config.prefix, - proxy: this.config.str('proxy'), - onion: this.config.bool('onion'), - upnp: this.config.bool('upnp'), - seeds: this.config.array('seeds'), - nodes: this.config.array('nodes'), - only: this.config.array('only'), - maxOutbound: this.config.uint('max-outbound'), - createSocket: this.config.func('create-socket'), - memory: this.memory, - selfish: true, - listen: false - }); - - this.rpc = new RPC$2(this); - - this.http = new HTTP$2({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors') - }); - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - // Bind to errors - this.chain.on('error', err => this.error(err)); - this.pool.on('error', err => this.error(err)); - - if (this.http) - this.http.on('error', err => this.error(err)); - - this.pool.on('tx', (tx) => { - this.emit('tx', tx); - }); - - this.chain.on('block', (block) => { - this.emit('block', block); - }); - - this.chain.on('connect', async (entry, block) => { - this.emit('connect', entry, block); - }); - - this.chain.on('disconnect', (entry, block) => { - this.emit('disconnect', entry, block); - }); - - this.chain.on('reorganize', (tip, competitor) => { - this.emit('reorganize', tip, competitor); - }); - - this.chain.on('reset', (tip) => { - this.emit('reset', tip); - }); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @returns {Promise} - */ - - async open() { - assert$i(!this.opened, 'SPVNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.chain.open(); - await this.pool.open(); - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @returns {Promise} - */ - - async close() { - assert$i(this.opened, 'SPVNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - await this.closePlugins(); - - await this.pool.close(); - await this.chain.close(); - await this.handleClose(); - } - - /** - * Scan for any missed transactions. - * Note that this will replay the blockchain sync. - * @param {Number|Hash} start - Start block. - * @returns {Promise} - */ - - async scan(start) { - throw new Error('Not implemented.'); - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX|Block} item - * @returns {Promise} - */ - - async broadcast(item) { - try { - await this.pool.broadcast(item); - } catch (e) { - this.emit('error', e); - } - } - - /** - * Broadcast a transaction (note that this will _not_ be verified - * by the mempool - use with care, lest you get banned from - * bitcoind nodes). - * @param {TX} tx - * @returns {Promise} - */ - - sendTX(tx) { - return this.broadcast(tx); - } - - /** - * Broadcast a transaction. Silence errors. - * @param {TX} tx - * @returns {Promise} - */ - - relay(tx) { - return this.broadcast(tx); - } - - /** - * Connect to the network. - * @returns {Promise} - */ - - connect() { - return this.pool.connect(); - } - - /** - * Disconnect from the network. - * @returns {Promise} - */ - - disconnect() { - return this.pool.disconnect(); - } - - /** - * Start the blockchain sync. - */ - - startSync() { - return this.pool.startSync(); - } - - /** - * Stop syncing the blockchain. - */ - - stopSync() { - return this.pool.stopSync(); - } -} - -/* - * Expose - */ - -var spvnode = SPVNode; - -/*! - * node/index.js - node for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module node - */ - -node$2.FullNode = fullnode; -node$2.HTTP = http$1; -node$2.Node = node$1; -node$2.RPC = rpc$1; -node$2.SPVNode = spvnode; - -var primitives = {}; - -/*! - * primitives/index.js - bitcoin primitives for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module primitives - */ - -primitives.AbstractBlock = abstractblock; -primitives.Address = address$1; -primitives.Block = block$1; -primitives.Coin = coin; -primitives.Headers = headers; -primitives.Input = input; -primitives.InvItem = invitem; -primitives.KeyRing = keyring; -primitives.MemBlock = memblock; -primitives.MerkleBlock = merkleblock; -primitives.MTX = mtx$1.exports; -primitives.Outpoint = outpoint; -primitives.Output = output; -primitives.TX = tx; -primitives.TXMeta = txmeta; - -var protocol = {}; - -/*! - * protocol/index.js - protocol constants for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module protocol - */ - -protocol.consensus = consensus$s; -protocol.errors = errors$2; -protocol.Network = network; -protocol.networks = networks$1; -protocol.policy = policy$9; -protocol.timedata = timedata; - -var script$1 = {}; - -/*! - * sigcache.js - signature cache for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$h = assert_1$g; -const {BufferMap: BufferMap$1} = bufferMap; -const secp256k1$1 = secp256k1$b.exports; - -/** - * Signature cache. - * @alias module:script.SigCache - * @property {Number} size - * @property {Hash[]} keys - * @property {Object} valid - */ - -class SigCache { - /** - * Create a signature cache. - * @constructor - * @param {Number} [size=10000] - */ - - constructor(size) { - if (size == null) - size = 10000; - - assert$h((size >>> 0) === size); - - this.size = size; - this.keys = []; - this.valid = new BufferMap$1(); - } - - /** - * Resize the sigcache. - * @param {Number} size - */ - - resize(size) { - assert$h((size >>> 0) === size); - - this.size = size; - this.keys.length = 0; - this.valid.clear(); - } - - /** - * Add item to the sigcache. - * Potentially evict a random member. - * @param {Hash} msg - Sig hash. - * @param {Buffer} sig - * @param {Buffer} key - */ - - add(msg, sig, key) { - if (this.size === 0) - return; - - this.valid.set(msg, new SigCacheEntry(sig, key)); - - if (this.keys.length >= this.size) { - const i = Math.floor(Math.random() * this.keys.length); - const k = this.keys[i]; - this.valid.delete(k); - this.keys[i] = msg; - } else { - this.keys.push(msg); - } - } - - /** - * Test whether the sig exists. - * @param {Hash} msg - Sig hash. - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - has(msg, sig, key) { - const entry = this.valid.get(msg); - - if (!entry) - return false; - - return entry.equals(sig, key); - } - - /** - * Verify a signature, testing - * it against the cache first. - * @param {Buffer} msg - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - verify(msg, sig, key) { - if (this.size === 0) - return secp256k1$1.verifyDER(msg, sig, key); - - if (this.has(msg, sig, key)) - return true; - - const result = secp256k1$1.verifyDER(msg, sig, key); - - if (!result) - return false; - - this.add(msg, sig, key); - - return true; - } -} - -/** - * Signature Cache Entry - * @ignore - * @property {Buffer} sig - * @property {Buffer} key - */ - -class SigCacheEntry { - /** - * Create a cache entry. - * @constructor - * @param {Buffer} sig - * @param {Buffer} key - */ - - constructor(sig, key) { - this.sig = Buffer.from(sig); - this.key = Buffer.from(key); - } - - /** - * Compare an entry to a sig and key. - * @param {Buffer} sig - * @param {Buffer} key - * @returns {Boolean} - */ - - equals(sig, key) { - return this.sig.equals(sig) && this.key.equals(key); - } -} - -/* - * Expose - */ - -var sigcache = SigCache; - -/*! - * script/index.js - bitcoin scripting for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module script - */ - -script$1.common = common$s; -script$1.Opcode = opcode$1; -script$1.Program = program$1; -script$1.Script = script$2; -script$1.ScriptError = scripterror; -script$1.ScriptNum = scriptnum; -script$1.sigcache = sigcache; -script$1.Stack = stack; -script$1.Witness = witness; - -var wallet$2 = {}; - -/*! - * path.js - path object for wallets - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$g = assert_1$g; -const bio$5 = bufio; -const Address$5 = address$1; -const {encoding: encoding$2} = bio$5; -const {inspectSymbol: inspectSymbol$4} = utils; - -/** - * Path - * @alias module:wallet.Path - * @property {String} name - Account name. - * @property {Number} account - Account index. - * @property {Number} branch - Branch index. - * @property {Number} index - Address index. - */ - -class Path$4 { - /** - * Create a path. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - this.keyType = Path$4.types.HD; - - this.name = null; // Passed in by caller. - this.account = 0; - - this.type = Address$5.types.PUBKEYHASH; - this.version = -1; - - this.branch = -1; - this.index = -1; - - this.encrypted = false; - this.data = null; - - this.hash = null; // Passed in by caller. - - if (options) - this.fromOptions(options); - } - - /** - * Instantiate path from options object. - * @private - * @param {Object} options - * @returns {Path} - */ - - fromOptions(options) { - this.keyType = options.keyType; - - this.name = options.name; - this.account = options.account; - this.branch = options.branch; - this.index = options.index; - - this.encrypted = options.encrypted; - this.data = options.data; - - this.type = options.type; - this.version = options.version; - this.hash = options.hash; - - return this; - } - - /** - * Instantiate path from options object. - * @param {Object} options - * @returns {Path} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Clone the path object. - * @returns {Path} - */ - - clone() { - const path = new this.constructor(); - - path.keyType = this.keyType; - - path.name = this.name; - path.account = this.account; - path.branch = this.branch; - path.index = this.index; - - path.encrypted = this.encrypted; - path.data = this.data; - - path.type = this.type; - path.version = this.version; - path.hash = this.hash; - - return path; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$5.read(data); - - this.account = br.readU32(); - this.keyType = br.readU8(); - - const flags = br.readU8(); - - this.type = flags & 7; - this.version = flags >>> 3; - - if (this.version === 0x1f) - this.version = -1; - - switch (this.keyType) { - case Path$4.types.HD: - this.branch = br.readU32(); - this.index = br.readU32(); - break; - case Path$4.types.KEY: - this.encrypted = br.readU8() === 1; - this.data = br.readVarBytes(); - break; - case Path$4.types.ADDRESS: - // Hash will be passed in by caller. - break; - default: - assert$g(false); - break; - } - - return this; - } - - /** - * Instantiate path from serialized data. - * @param {Buffer} data - * @returns {Path} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - size += 6; - - switch (this.keyType) { - case Path$4.types.HD: - size += 8; - break; - case Path$4.types.KEY: - size += 1; - size += encoding$2.sizeVarBytes(this.data); - break; - } - - return size; - } - - /** - * Serialize path. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$5.write(size); - - bw.writeU32(this.account); - bw.writeU8(this.keyType); - - let version = this.version; - - if (version === -1) - version = 0x1f; - - const flags = (version << 3) | this.type; - - bw.writeU8(flags); - - switch (this.keyType) { - case Path$4.types.HD: - assert$g(!this.data); - assert$g(this.index !== -1); - bw.writeU32(this.branch); - bw.writeU32(this.index); - break; - case Path$4.types.KEY: - assert$g(this.data); - assert$g(this.index === -1); - bw.writeU8(this.encrypted ? 1 : 0); - bw.writeVarBytes(this.data); - break; - case Path$4.types.ADDRESS: - assert$g(!this.data); - assert$g(this.index === -1); - break; - default: - assert$g(false); - break; - } - - return bw.render(); - } - - /** - * Inject properties from address. - * @private - * @param {Account} account - * @param {Address} address - */ - - fromAddress(account, address) { - this.keyType = Path$4.types.ADDRESS; - this.name = account.name; - this.account = account.accountIndex; - this.version = address.version; - this.type = address.type; - this.hash = address.getHash(); - return this; - } - - /** - * Instantiate path from address. - * @param {Account} account - * @param {Address} address - * @returns {Path} - */ - - static fromAddress(account, address) { - return new this().fromAddress(account, address); - } - - /** - * Convert path object to string derivation path. - * @returns {String} - */ - - toPath() { - if (this.keyType !== Path$4.types.HD) - return null; - - return `m/${this.account}'/${this.branch}/${this.index}`; - } - - /** - * Convert path object to an address (currently unused). - * @returns {Address} - */ - - toAddress() { - return Address$5.fromHash(this.hash, this.type, this.version); - } - - /** - * Convert path to a json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - name: this.name, - account: this.account, - change: this.branch === 1, - derivation: this.toPath() - }; - } - - /** - * Inspect the path. - * @returns {String} - */ - - [inspectSymbol$4]() { - return ``; - } -} - -/** - * Path types. - * @enum {Number} - * @default - */ - -Path$4.types = { - HD: 0, - KEY: 1, - ADDRESS: 2 -}; - -/** - * Path types. - * @enum {Number} - * @default - */ - -Path$4.typesByVal = [ - 'HD', - 'KEY', - 'ADDRESS' -]; - -/** - * Expose - */ - -var path$3 = Path$4; - -var common$5 = {}; - -/*! - * common.js - commonly required functions for wallet. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -(function (exports) { - -const {BufferMap} = bufferMap; - -/** - * @exports wallet/common - */ - -const common = exports; - -/** - * Test whether a string is eligible - * to be used as a name or ID. - * @param {String} key - * @returns {Boolean} - */ - -common.isName = function isName(key) { - if (typeof key !== 'string') - return false; - - if (key.length === 0) - return false; - - if (!/^[\-\._0-9A-Za-z]+$/.test(key)) - return false; - - // Prevents __proto__ - // from being used. - switch (key[0]) { - case '_': - case '-': - case '.': - return false; - } - - switch (key[key.length - 1]) { - case '_': - case '-': - case '.': - return false; - } - - return key.length >= 1 && key.length <= 40; -}; - -/** - * Sort an array of transactions by time. - * @param {TX[]} txs - * @returns {TX[]} - */ - -common.sortTX = function sortTX(txs) { - return txs.sort((a, b) => { - return a.mtime - b.mtime; - }); -}; - -/** - * Sort an array of coins by height. - * @param {Coin[]} txs - * @returns {Coin[]} - */ - -common.sortCoins = function sortCoins(coins) { - return coins.sort((a, b) => { - a = a.height === -1 ? 0x7fffffff : a.height; - b = b.height === -1 ? 0x7fffffff : b.height; - return a - b; - }); -}; - -/** - * Sort an array of transactions in dependency order. - * @param {TX[]} txs - * @returns {TX[]} - */ - -common.sortDeps = function sortDeps(txs) { - const map = new BufferMap(); - - for (const tx of txs) { - const hash = tx.hash(); - map.set(hash, tx); - } - - const depMap = new BufferMap(); - const depCount = new BufferMap(); - const top = []; - - for (const [hash, tx] of map) { - depCount.set(hash, 0); - - let hasDeps = false; - - for (const input of tx.inputs) { - const prev = input.prevout.hash; - - if (!map.has(prev)) - continue; - - const count = depCount.get(hash); - depCount.set(hash, count + 1); - hasDeps = true; - - if (!depMap.has(prev)) - depMap.set(prev, []); - - depMap.get(prev).push(tx); - } - - if (hasDeps) - continue; - - top.push(tx); - } - - const result = []; - - for (const tx of top) { - const deps = depMap.get(tx.hash()); - - result.push(tx); - - if (!deps) - continue; - - for (const tx of deps) { - let count = depCount.get(tx.hash()); - - if (--count === 0) - top.push(tx); - - depCount.set(tx.hash(), count); - } - } - - return result; -}; -}(common$5)); - -/*! - * walletkey.js - walletkey object for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const Address$4 = address$1; -const KeyRing$2 = keyring; -const Path$3 = path$3; - -/** - * Wallet Key - * Represents a key ring which amounts to an address. - * @alias module:wallet.WalletKey - * @extends KeyRing - */ - -class WalletKey$2 extends KeyRing$2 { - /** - * Create a wallet key. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super(options); - - this.keyType = Path$3.types.HD; - - this.name = null; - this.account = -1; - this.branch = -1; - this.index = -1; - } - - /** - * Convert an WalletKey to a more json-friendly object. - * @returns {Object} - */ - - toJSON(network) { - return { - name: this.name, - account: this.account, - branch: this.branch, - index: this.index, - witness: this.witness, - nested: this.nested, - publicKey: this.publicKey.toString('hex'), - script: this.script ? this.script.toRaw().toString('hex') : null, - program: this.witness ? this.getProgram().toRaw().toString('hex') : null, - type: Address$4.typesByVal[this.getType()].toLowerCase(), - address: this.getAddress('string', network) - }; - } - - /** - * Inject properties from hd key. - * @private - * @param {Account} account - * @param {HDPrivateKey|HDPublicKey} key - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - fromHD(account, key, branch, index) { - this.keyType = Path$3.types.HD; - this.name = account.name; - this.account = account.accountIndex; - this.branch = branch; - this.index = index; - this.witness = account.witness; - this.nested = branch === 2; - - if (key.privateKey) - return this.fromPrivate(key.privateKey); - - return this.fromPublic(key.publicKey); - } - - /** - * Instantiate a wallet key from hd key. - * @param {Account} account - * @param {HDPrivateKey|HDPublicKey} key - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - static fromHD(account, key, branch, index) { - return new this().fromHD(account, key, branch, index); - } - - /** - * Inject properties from imported data. - * @private - * @param {Account} account - * @param {Buffer} data - * @returns {WalletKey} - */ - - fromImport(account, data) { - this.keyType = Path$3.types.KEY; - this.name = account.name; - this.account = account.accountIndex; - this.witness = account.witness; - return this.fromRaw(data); - } - - /** - * Instantiate a wallet key from imported data. - * @param {Account} account - * @param {Buffer} data - * @returns {WalletKey} - */ - - static fromImport(account, data) { - return new this().fromImport(account, data); - } - - /** - * Inject properties from key. - * @private - * @param {Account} account - * @param {KeyRing} ring - * @returns {WalletKey} - */ - - fromRing(account, ring) { - this.keyType = Path$3.types.KEY; - this.name = account.name; - this.account = account.accountIndex; - this.witness = account.witness; - return this.fromOptions(ring); - } - - /** - * Instantiate a wallet key from regular key. - * @param {Account} account - * @param {KeyRing} ring - * @returns {WalletKey} - */ - - static fromRing(account, ring) { - return new this().fromRing(account, ring); - } - - /** - * Convert wallet key to a path. - * @returns {Path} - */ - - toPath() { - const path = new Path$3(); - - path.name = this.name; - path.account = this.account; - - switch (this.keyType) { - case Path$3.types.HD: - path.branch = this.branch; - path.index = this.index; - break; - case Path$3.types.KEY: - path.data = this.toRaw(); - break; - } - - path.keyType = this.keyType; - - path.version = this.getVersion(); - path.type = this.getType(); - path.hash = this.getHash(); - - return path; - } - - /** - * Test whether an object is a WalletKey. - * @param {Object} obj - * @returns {Boolean} - */ - - static isWalletKey(obj) { - return obj instanceof WalletKey$2; - } -} - -/* - * Expose - */ - -var walletkey = WalletKey$2; - -/*! - * account.js - account object for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$f = assert_1$g; -const bio$4 = bufio; -const binary = binary$4; -const Path$2 = path$3; -const common$4 = common$5; -const Script$7 = script$2; -const WalletKey$1 = walletkey; -const {HDPublicKey: HDPublicKey$1} = hd$1; -const {inspectSymbol: inspectSymbol$3} = utils; - -/** - * Account - * Represents a BIP44 Account belonging to a {@link Wallet}. - * Note that this object does not enforce locks. Any method - * that does a write is internal API only and will lead - * to race conditions if used elsewhere. - * @alias module:wallet.Account - */ - -class Account$2 { - /** - * Create an account. - * @constructor - * @param {Object} options - */ - - constructor(wdb, options) { - assert$f(wdb, 'Database is required.'); - - this.wdb = wdb; - this.network = wdb.network; - - this.wid = 0; - this.id = null; - this.accountIndex = 0; - this.name = null; - this.initialized = false; - this.witness = wdb.options.witness === true; - this.watchOnly = false; - this.type = Account$2.types.PUBKEYHASH; - this.m = 1; - this.n = 1; - this.receiveDepth = 0; - this.changeDepth = 0; - this.nestedDepth = 0; - this.lookahead = 10; - this.accountKey = null; - this.keys = []; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$f(options, 'Options are required.'); - assert$f((options.wid >>> 0) === options.wid); - assert$f(common$4.isName(options.id), 'Bad Wallet ID.'); - assert$f(HDPublicKey$1.isHDPublicKey(options.accountKey), - 'Account key is required.'); - assert$f((options.accountIndex >>> 0) === options.accountIndex, - 'Account index is required.'); - - this.wid = options.wid; - this.id = options.id; - - if (options.accountIndex != null) { - assert$f((options.accountIndex >>> 0) === options.accountIndex); - this.accountIndex = options.accountIndex; - } - - if (options.name != null) { - assert$f(common$4.isName(options.name), 'Bad account name.'); - this.name = options.name; - } - - if (options.initialized != null) { - assert$f(typeof options.initialized === 'boolean'); - this.initialized = options.initialized; - } - - if (options.witness != null) { - assert$f(typeof options.witness === 'boolean'); - this.witness = options.witness; - } - - if (options.watchOnly != null) { - assert$f(typeof options.watchOnly === 'boolean'); - this.watchOnly = options.watchOnly; - } - - if (options.type != null) { - if (typeof options.type === 'string') { - this.type = Account$2.types[options.type.toUpperCase()]; - assert$f(this.type != null); - } else { - assert$f(typeof options.type === 'number'); - this.type = options.type; - assert$f(Account$2.typesByVal[this.type]); - } - } - - if (options.m != null) { - assert$f((options.m & 0xff) === options.m); - this.m = options.m; - } - - if (options.n != null) { - assert$f((options.n & 0xff) === options.n); - this.n = options.n; - } - - if (options.receiveDepth != null) { - assert$f((options.receiveDepth >>> 0) === options.receiveDepth); - this.receiveDepth = options.receiveDepth; - } - - if (options.changeDepth != null) { - assert$f((options.changeDepth >>> 0) === options.changeDepth); - this.changeDepth = options.changeDepth; - } - - if (options.nestedDepth != null) { - assert$f((options.nestedDepth >>> 0) === options.nestedDepth); - this.nestedDepth = options.nestedDepth; - } - - if (options.lookahead != null) { - assert$f((options.lookahead >>> 0) === options.lookahead); - assert$f(options.lookahead >= 0); - assert$f(options.lookahead <= Account$2.MAX_LOOKAHEAD); - this.lookahead = options.lookahead; - } - - this.accountKey = options.accountKey; - - if (this.n > 1) - this.type = Account$2.types.MULTISIG; - - if (!this.name) - this.name = this.accountIndex.toString(10); - - if (this.m < 1 || this.m > this.n) - throw new Error('m ranges between 1 and n'); - - if (options.keys) { - assert$f(Array.isArray(options.keys)); - for (const key of options.keys) - this.pushKey(key); - } - - return this; - } - - /** - * Instantiate account from options. - * @param {WalletDB} wdb - * @param {Object} options - * @returns {Account} - */ - - static fromOptions(wdb, options) { - return new this(wdb).fromOptions(options); - } - - /** - * Attempt to intialize the account (generating - * the first addresses along with the lookahead - * addresses). Called automatically from the - * walletdb. - * @returns {Promise} - */ - - async init(b) { - // Waiting for more keys. - if (this.keys.length !== this.n - 1) { - assert$f(!this.initialized); - this.save(b); - return; - } - - assert$f(this.receiveDepth === 0); - assert$f(this.changeDepth === 0); - assert$f(this.nestedDepth === 0); - - this.initialized = true; - - await this.initDepth(b); - } - - /** - * Add a public account key to the account (multisig). - * Does not update the database. - * @param {HDPublicKey} key - Account (bip44) - * key (can be in base58 form). - * @throws Error on non-hdkey/non-accountkey. - */ - - pushKey(key) { - if (typeof key === 'string') - key = HDPublicKey$1.fromBase58(key, this.network); - - if (!HDPublicKey$1.isHDPublicKey(key)) - throw new Error('Must add HD keys to wallet.'); - - if (!key.isAccount()) - throw new Error('Must add HD account keys to BIP44 wallet.'); - - if (this.type !== Account$2.types.MULTISIG) - throw new Error('Cannot add keys to non-multisig wallet.'); - - if (key.equals(this.accountKey)) - throw new Error('Cannot add own key.'); - - const index = binary.insert(this.keys, key, cmp, true); - - if (index === -1) - return false; - - if (this.keys.length > this.n - 1) { - binary.remove(this.keys, key, cmp); - throw new Error('Cannot add more keys.'); - } - - return true; - } - - /** - * Remove a public account key to the account (multisig). - * Does not update the database. - * @param {HDPublicKey} key - Account (bip44) - * key (can be in base58 form). - * @throws Error on non-hdkey/non-accountkey. - */ - - spliceKey(key) { - if (typeof key === 'string') - key = HDPublicKey$1.fromBase58(key, this.network); - - if (!HDPublicKey$1.isHDPublicKey(key)) - throw new Error('Must add HD keys to wallet.'); - - if (!key.isAccount()) - throw new Error('Must add HD account keys to BIP44 wallet.'); - - if (this.type !== Account$2.types.MULTISIG) - throw new Error('Cannot remove keys from non-multisig wallet.'); - - if (this.keys.length === this.n - 1) - throw new Error('Cannot remove key.'); - - return binary.remove(this.keys, key, cmp); - } - - /** - * Add a public account key to the account (multisig). - * Saves the key in the wallet database. - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async addSharedKey(b, key) { - const result = this.pushKey(key); - - if (await this.hasDuplicate()) { - this.spliceKey(key); - throw new Error('Cannot add a key from another account.'); - } - - // Try to initialize again. - await this.init(b); - - return result; - } - - /** - * Ensure accounts are not sharing keys. - * @private - * @returns {Promise} - */ - - async hasDuplicate() { - if (this.keys.length !== this.n - 1) - return false; - - const ring = this.deriveReceive(0); - const hash = ring.getScriptHash(); - - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Remove a public account key from the account (multisig). - * Remove the key from the wallet database. - * @param {HDPublicKey} key - * @returns {Promise} - */ - - removeSharedKey(b, key) { - const result = this.spliceKey(key); - - if (!result) - return false; - - this.save(b); - - return true; - } - - /** - * Create a new receiving address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createReceive(b) { - return this.createKey(b, 0); - } - - /** - * Create a new change address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createChange(b) { - return this.createKey(b, 1); - } - - /** - * Create a new change address (increments receiveDepth). - * @returns {Promise} - Returns {@link WalletKey} - */ - - createNested(b) { - return this.createKey(b, 2); - } - - /** - * Create a new address (increments depth). - * @param {Boolean} change - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async createKey(b, branch) { - let key, lookahead; - - switch (branch) { - case 0: - key = this.deriveReceive(this.receiveDepth); - lookahead = this.deriveReceive(this.receiveDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.receiveDepth += 1; - this.receive = key; - break; - case 1: - key = this.deriveChange(this.changeDepth); - lookahead = this.deriveChange(this.changeDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.changeDepth += 1; - this.change = key; - break; - case 2: - key = this.deriveNested(this.nestedDepth); - lookahead = this.deriveNested(this.nestedDepth + this.lookahead); - await this.saveKey(b, lookahead); - this.nestedDepth += 1; - this.nested = key; - break; - default: - throw new Error(`Bad branch: ${branch}.`); - } - - this.save(b); - - return key; - } - - /** - * Derive a receiving address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveReceive(index, master) { - return this.deriveKey(0, index, master); - } - - /** - * Derive a change address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveChange(index, master) { - return this.deriveKey(1, index, master); - } - - /** - * Derive a nested address at `index`. Do not increment depth. - * @param {Number} index - * @returns {WalletKey} - */ - - deriveNested(index, master) { - if (!this.witness) - throw new Error('Cannot derive nested on non-witness account.'); - - return this.deriveKey(2, index, master); - } - - /** - * Derive an address from `path` object. - * @param {Path} path - * @param {MasterKey} master - * @returns {WalletKey} - */ - - derivePath(path, master) { - switch (path.keyType) { - case Path$2.types.HD: { - return this.deriveKey(path.branch, path.index, master); - } - case Path$2.types.KEY: { - assert$f(this.type === Account$2.types.PUBKEYHASH); - - let data = path.data; - - if (path.encrypted) { - data = master.decipher(data, path.hash); - if (!data) - return null; - } - - return WalletKey$1.fromImport(this, data); - } - case Path$2.types.ADDRESS: { - return null; - } - default: { - throw new Error('Bad key type.'); - } - } - } - - /** - * Derive an address at `index`. Do not increment depth. - * @param {Number} branch - * @param {Number} index - * @returns {WalletKey} - */ - - deriveKey(branch, index, master) { - assert$f(typeof branch === 'number'); - - const keys = []; - - let key; - if (master && master.key && !this.watchOnly) { - const type = this.network.keyPrefix.coinType; - key = master.key.deriveAccount(44, type, this.accountIndex); - key = key.derive(branch).derive(index); - } else { - key = this.accountKey.derive(branch).derive(index); - } - - const ring = WalletKey$1.fromHD(this, key, branch, index); - - switch (this.type) { - case Account$2.types.PUBKEYHASH: - break; - case Account$2.types.MULTISIG: - keys.push(key.publicKey); - - for (const shared of this.keys) { - const key = shared.derive(branch).derive(index); - keys.push(key.publicKey); - } - - ring.script = Script$7.fromMultisig(this.m, this.n, keys); - - break; - } - - return ring; - } - - /** - * Save the account to the database. Necessary - * when address depth and keys change. - * @returns {Promise} - */ - - save(b) { - return this.wdb.saveAccount(b, this); - } - - /** - * Save addresses to path map. - * @param {WalletKey[]} rings - * @returns {Promise} - */ - - saveKey(b, ring) { - return this.wdb.saveKey(b, this.wid, ring); - } - - /** - * Save paths to path map. - * @param {Path[]} rings - * @returns {Promise} - */ - - savePath(b, path) { - return this.wdb.savePath(b, this.wid, path); - } - - /** - * Initialize address depths (including lookahead). - * @returns {Promise} - */ - - async initDepth(b) { - // Receive Address - this.receiveDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - } - - // Change Address - this.changeDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - - // Nested Address - if (this.witness) { - this.nestedDepth = 1; - - for (let i = 0; i <= this.lookahead; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - } - } - - this.save(b); - } - - /** - * Allocate new lookahead addresses if necessary. - * @param {Number} receiveDepth - * @param {Number} changeDepth - * @param {Number} nestedDepth - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async syncDepth(b, receive, change, nested) { - let derived = false; - let result = null; - - if (receive > this.receiveDepth) { - const depth = this.receiveDepth + this.lookahead; - - assert$f(receive <= depth + 1); - - for (let i = depth; i < receive + this.lookahead; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - result = key; - } - - this.receiveDepth = receive; - - derived = true; - } - - if (change > this.changeDepth) { - const depth = this.changeDepth + this.lookahead; - - assert$f(change <= depth + 1); - - for (let i = depth; i < change + this.lookahead; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - - this.changeDepth = change; - - derived = true; - } - - if (this.witness && nested > this.nestedDepth) { - const depth = this.nestedDepth + this.lookahead; - - assert$f(nested <= depth + 1); - - for (let i = depth; i < nested + this.lookahead; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - result = key; - } - - this.nestedDepth = nested; - - derived = true; - result = this.nested; - } - - if (derived) - this.save(b); - - return result; - } - - /** - * Allocate new lookahead addresses. - * @param {Number} lookahead - * @returns {Promise} - */ - - async setLookahead(b, lookahead) { - if (lookahead === this.lookahead) - return; - - if (lookahead < this.lookahead) { - const diff = this.lookahead - lookahead; - - this.receiveDepth += diff; - this.changeDepth += diff; - - if (this.witness) - this.nestedDepth += diff; - - this.lookahead = lookahead; - - this.save(b); - - return; - } - - { - const depth = this.receiveDepth + this.lookahead; - const target = this.receiveDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveReceive(i); - await this.saveKey(b, key); - } - } - - { - const depth = this.changeDepth + this.lookahead; - const target = this.changeDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveChange(i); - await this.saveKey(b, key); - } - } - - if (this.witness) { - const depth = this.nestedDepth + this.lookahead; - const target = this.nestedDepth + lookahead; - - for (let i = depth; i < target; i++) { - const key = this.deriveNested(i); - await this.saveKey(b, key); - } - } - - this.lookahead = lookahead; - this.save(b); - } - - /** - * Get current receive key. - * @returns {WalletKey} - */ - - receiveKey() { - if (!this.initialized) - return null; - - return this.deriveReceive(this.receiveDepth - 1); - } - - /** - * Get current change key. - * @returns {WalletKey} - */ - - changeKey() { - if (!this.initialized) - return null; - - return this.deriveChange(this.changeDepth - 1); - } - - /** - * Get current nested key. - * @returns {WalletKey} - */ - - nestedKey() { - if (!this.initialized) - return null; - - if (!this.witness) - return null; - - return this.deriveNested(this.nestedDepth - 1); - } - - /** - * Get current receive address. - * @returns {Address} - */ - - receiveAddress() { - const key = this.receiveKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Get current change address. - * @returns {Address} - */ - - changeAddress() { - const key = this.changeKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Get current nested address. - * @returns {Address} - */ - - nestedAddress() { - const key = this.nestedKey(); - - if (!key) - return null; - - return key.getAddress(); - } - - /** - * Convert the account to a more inspection-friendly object. - * @returns {Object} - */ - - [inspectSymbol$3]() { - const receive = this.receiveAddress(); - const change = this.changeAddress(); - const nested = this.nestedAddress(); - - return { - id: this.id, - wid: this.wid, - name: this.name, - network: this.network.type, - initialized: this.initialized, - witness: this.witness, - watchOnly: this.watchOnly, - type: Account$2.typesByVal[this.type].toLowerCase(), - m: this.m, - n: this.n, - accountIndex: this.accountIndex, - receiveDepth: this.receiveDepth, - changeDepth: this.changeDepth, - nestedDepth: this.nestedDepth, - lookahead: this.lookahead, - receiveAddress: receive ? receive.toString(this.network) : null, - changeAddress: change ? change.toString(this.network) : null, - nestedAddress: nested ? nested.toString(this.network) : null, - accountKey: this.accountKey.toBase58(this.network), - keys: this.keys.map(key => key.toBase58(this.network)) - }; - } - - /** - * Convert the account to an object suitable for - * serialization. - * @returns {Object} - */ - - toJSON(balance) { - const receive = this.receiveAddress(); - const change = this.changeAddress(); - const nested = this.nestedAddress(); - - return { - name: this.name, - initialized: this.initialized, - witness: this.witness, - watchOnly: this.watchOnly, - type: Account$2.typesByVal[this.type].toLowerCase(), - m: this.m, - n: this.n, - accountIndex: this.accountIndex, - receiveDepth: this.receiveDepth, - changeDepth: this.changeDepth, - nestedDepth: this.nestedDepth, - lookahead: this.lookahead, - receiveAddress: receive ? receive.toString(this.network) : null, - changeAddress: change ? change.toString(this.network) : null, - nestedAddress: nested ? nested.toString(this.network) : null, - accountKey: this.accountKey.toBase58(this.network), - keys: this.keys.map(key => key.toBase58(this.network)), - balance: balance ? balance.toJSON(true) : null - }; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 92; - size += this.keys.length * 74; - return size; - } - - /** - * Serialize the account. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$4.write(size); - - let flags = 0; - - if (this.initialized) - flags |= 1; - - if (this.witness) - flags |= 2; - - bw.writeU8(flags); - bw.writeU8(this.type); - bw.writeU8(this.m); - bw.writeU8(this.n); - bw.writeU32(this.receiveDepth); - bw.writeU32(this.changeDepth); - bw.writeU32(this.nestedDepth); - bw.writeU8(this.lookahead); - writeKey(this.accountKey, bw); - bw.writeU8(this.keys.length); - - for (const key of this.keys) - writeKey(key, bw); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - * @returns {Object} - */ - - fromRaw(data) { - const br = bio$4.read(data); - const flags = br.readU8(); - - this.initialized = (flags & 1) !== 0; - this.witness = (flags & 2) !== 0; - this.type = br.readU8(); - this.m = br.readU8(); - this.n = br.readU8(); - this.receiveDepth = br.readU32(); - this.changeDepth = br.readU32(); - this.nestedDepth = br.readU32(); - this.lookahead = br.readU8(); - this.accountKey = readKey(br); - - assert$f(this.type < Account$2.typesByVal.length); - - const count = br.readU8(); - - for (let i = 0; i < count; i++) { - const key = readKey(br); - binary.insert(this.keys, key, cmp, true); - } - - return this; - } - - /** - * Instantiate a account from serialized data. - * @param {WalletDB} data - * @param {Buffer} data - * @returns {Account} - */ - - static fromRaw(wdb, data) { - return new this(wdb).fromRaw(data); - } - - /** - * Test an object to see if it is a Account. - * @param {Object} obj - * @returns {Boolean} - */ - - static isAccount(obj) { - return obj instanceof Account$2; - } -} - -/** - * Account types. - * @enum {Number} - * @default - */ - -Account$2.types = { - PUBKEYHASH: 0, - MULTISIG: 1 -}; - -/** - * Account types by value. - * @const {Object} - */ - -Account$2.typesByVal = [ - 'PUBKEYHASH', - 'MULTISIG' -]; - -/** - * Default address lookahead. - * @const {Number} - */ - -Account$2.MAX_LOOKAHEAD = 40; - -/* - * Helpers - */ - -function cmp(a, b) { - return a.compare(b); -} - -function writeKey(key, bw) { - bw.writeU8(key.depth); - bw.writeU32BE(key.parentFingerPrint); - bw.writeU32BE(key.childIndex); - bw.writeBytes(key.chainCode); - bw.writeBytes(key.publicKey); -} - -function readKey(br) { - const key = new HDPublicKey$1(); - key.depth = br.readU8(); - key.parentFingerPrint = br.readU32BE(); - key.childIndex = br.readU32BE(); - key.chainCode = br.readBytes(32); - key.publicKey = br.readBytes(33); - return key; -} - -/* - * Expose - */ - -var account = Account$2; - -/*! - * client.js - http client for wallets - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$e = assert_1$g; -const NodeClient$1 = node$3; -const util$3 = util$y; -const TX$1 = tx; -const hash256$2 = hash256$k.exports; - -const parsers = { - 'block connect': (entry, txs) => parseBlock(entry, txs), - 'block disconnect': entry => [parseEntry(entry)], - 'block rescan': (entry, txs) => parseBlock(entry, txs), - 'chain reset': entry => [parseEntry(entry)], - 'tx': tx => [TX$1.fromRaw(tx)] -}; - -class WalletClient extends NodeClient$1 { - constructor(options) { - super(options); - } - - bind(event, handler) { - const parser = parsers[event]; - - if (!parser) { - super.bind(event, handler); - return; - } - - super.bind(event, (...args) => { - return handler(...parser(...args)); - }); - } - - hook(event, handler) { - const parser = parsers[event]; - - if (!parser) { - super.hook(event, handler); - return; - } - - super.hook(event, (...args) => { - return handler(...parser(...args)); - }); - } - - async getTip() { - return parseEntry(await super.getTip()); - } - - async getEntry(block) { - if (Buffer.isBuffer(block)) - block = util$3.revHex(block); - - return parseEntry(await super.getEntry(block)); - } - - async send(tx) { - return super.send(tx.toRaw()); - } - - async setFilter(filter) { - return super.setFilter(filter.toRaw()); - } - - async rescan(start) { - if (Buffer.isBuffer(start)) - start = util$3.revHex(start); - - return super.rescan(start); - } -} - -/* - * Helpers - */ - -function parseEntry(data) { - assert$e(Buffer.isBuffer(data)); - assert$e(data.length >= 84); - - const hash = hash256$2.digest(data.slice(0, 80)); - - return { - hash: hash, - height: data.readUInt32LE(80, true), - time: data.readUInt32LE(68, true) - }; -} - -function parseBlock(entry, txs) { - const block = parseEntry(entry); - const out = []; - - for (const tx of txs) - out.push(TX$1.fromRaw(tx)); - - return [block, out]; -} - -/* - * Expose - */ - -var client = WalletClient; - -/*! - * server.js - http server for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$d = assert_1$g; -const path$2 = require$$1$3; -const {Server} = bweb$2; -const Validator$1 = bval; -const base58$1 = base58$9.exports; -const MTX$3 = mtx$1.exports; -const Outpoint$4 = outpoint; -const Script$6 = script$2; -const sha256$1 = sha256$9.exports; -const random$1 = random$9; -const {safeEqual: safeEqual$2} = safe; -const Network$1 = network; -const Address$3 = address$1; -const KeyRing$1 = keyring; -const Mnemonic$3 = mnemonic; -const HDPrivateKey$1 = _private; -const HDPublicKey = _public; -const common$3 = common$5; -const pkg$1 = pkg$4; - -/** - * HTTP - * @alias module:wallet.HTTP - */ - -class HTTP$1 extends Server { - /** - * Create an http server. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(new HTTPOptions(options)); - - this.network = this.options.network; - this.logger = this.options.logger.context('wallet-http'); - this.wdb = this.options.node.wdb; - this.rpc = this.options.node.rpc; - - this.init(); - } - - /** - * Initialize http server. - * @private - */ - - init() { - this.on('request', (req, res) => { - if (req.method === 'POST' && req.pathname === '/') - return; - - this.logger.debug('Request for method=%s path=%s (%s).', - req.method, req.pathname, req.socket.remoteAddress); - }); - - this.on('listening', (address) => { - this.logger.info('Wallet HTTP server listening on %s (port=%d).', - address.address, address.port); - }); - - this.initRouter(); - this.initSockets(); - } - - /** - * Initialize routes. - * @private - */ - - initRouter() { - if (this.options.cors) - this.use(this.cors()); - - if (!this.options.noAuth) { - this.use(this.basicAuth({ - hash: sha256$1.digest, - password: this.options.apiKey, - realm: 'wallet' - })); - } - - this.use(this.bodyParser({ - type: 'json' - })); - - this.use(async (req, res) => { - if (!this.options.walletAuth) { - req.admin = true; - return; - } - - const valid = Validator$1.fromRequest(req); - const token = valid.buf('token'); - - if (token && safeEqual$2(token, this.options.adminToken)) { - req.admin = true; - return; - } - - if (req.method === 'POST' && req.path.length === 0) { - res.json(403); - return; - } - }); - - this.use(this.jsonRPC()); - this.use(this.router()); - - this.error((err, req, res) => { - const code = err.statusCode || 500; - res.json(code, { - error: { - type: err.type, - code: err.code, - message: err.message - } - }); - }); - - this.hook(async (req, res) => { - if (req.path.length < 2) - return; - - if (req.path[0] !== 'wallet') - return; - - if (req.method === 'PUT' && req.path.length === 2) - return; - - const valid = Validator$1.fromRequest(req); - const id = valid.str('id'); - const token = valid.buf('token'); - - if (!id) { - res.json(403); - return; - } - - if (req.admin || !this.options.walletAuth) { - const wallet = await this.wdb.get(id); - - if (!wallet) { - res.json(404); - return; - } - - req.wallet = wallet; - - return; - } - - if (!token) { - res.json(403); - return; - } - - let wallet; - try { - wallet = await this.wdb.auth(id, token); - } catch (err) { - this.logger.info('Auth failure for %s: %s.', id, err.message); - res.json(403); - return; - } - - if (!wallet) { - res.json(404); - return; - } - - req.wallet = wallet; - - this.logger.info('Successful auth for %s.', id); - }); - - // Info - this.get('/', async (req, res) => { - res.json(200, { - version: pkg$1.version, - network: this.network.type - }); - }); - - // Rescan - this.post('/rescan', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const valid = Validator$1.fromRequest(req); - const height = valid.u32('height'); - - res.json(200, { success: true }); - - await this.wdb.rescan(height); - }); - - // Resend - this.post('/resend', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - await this.wdb.resend(); - - res.json(200, { success: true }); - }); - - // Backup WalletDB - this.post('/backup', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const valid = Validator$1.fromRequest(req); - const path = valid.str('path'); - - enforce(path, 'Path is required.'); - - await this.wdb.backup(path); - - res.json(200, { success: true }); - }); - - // List wallets - this.get('/wallet', async (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - const wallets = await this.wdb.getWallets(); - res.json(200, wallets); - }); - - // Get wallet - this.get('/wallet/:id', async (req, res) => { - const balance = await req.wallet.getBalance(); - res.json(200, req.wallet.toJSON(false, balance)); - }); - - // Get wallet master key - this.get('/wallet/:id/master', (req, res) => { - if (!req.admin) { - res.json(403); - return; - } - - res.json(200, req.wallet.master.toJSON(this.network, true)); - }); - - // Create wallet - this.put('/wallet/:id', async (req, res) => { - const valid = Validator$1.fromRequest(req); - - let master = valid.str('master'); - let mnemonic = valid.str('mnemonic'); - let accountKey = valid.str('accountKey'); - - if (master) - master = HDPrivateKey$1.fromBase58(master, this.network); - - if (mnemonic) - mnemonic = Mnemonic$3.fromPhrase(mnemonic); - - if (accountKey) - accountKey = HDPublicKey.fromBase58(accountKey, this.network); - - const wallet = await this.wdb.create({ - id: valid.str('id'), - type: valid.str('type'), - m: valid.u32('m'), - n: valid.u32('n'), - passphrase: valid.str('passphrase'), - master: master, - mnemonic: mnemonic, - witness: valid.bool('witness'), - accountKey: accountKey, - watchOnly: valid.bool('watchOnly') - }); - - const balance = await wallet.getBalance(); - - res.json(200, wallet.toJSON(false, balance)); - }); - - // List accounts - this.get('/wallet/:id/account', async (req, res) => { - const accounts = await req.wallet.getAccounts(); - res.json(200, accounts); - }); - - // Get account - this.get('/wallet/:id/account/:account', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const account = await req.wallet.getAccount(acct); - - if (!account) { - res.json(404); - return; - } - - const balance = await req.wallet.getBalance(account.accountIndex); - - res.json(200, account.toJSON(balance)); - }); - - // Create account - this.put('/wallet/:id/account/:account', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - - let accountKey = valid.get('accountKey'); - - if (accountKey) - accountKey = HDPublicKey.fromBase58(accountKey, this.network); - - const options = { - name: valid.str('account'), - witness: valid.bool('witness'), - type: valid.str('type'), - m: valid.u32('m'), - n: valid.u32('n'), - accountKey: accountKey, - lookahead: valid.u32('lookahead') - }; - - const account = await req.wallet.createAccount(options, passphrase); - const balance = await req.wallet.getBalance(account.accountIndex); - - res.json(200, account.toJSON(balance)); - }); - - // Change passphrase - this.post('/wallet/:id/passphrase', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const old = valid.str('old'); - - enforce(passphrase, 'Passphrase is required.'); - - await req.wallet.setPassphrase(passphrase, old); - - res.json(200, { success: true }); - }); - - // Unlock wallet - this.post('/wallet/:id/unlock', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const timeout = valid.u32('timeout'); - - enforce(passphrase, 'Passphrase is required.'); - - await req.wallet.unlock(passphrase, timeout); - - res.json(200, { success: true }); - }); - - // Lock wallet - this.post('/wallet/:id/lock', async (req, res) => { - await req.wallet.lock(); - res.json(200, { success: true }); - }); - - // Import key - this.post('/wallet/:id/import', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const passphrase = valid.str('passphrase'); - const pub = valid.buf('publicKey'); - const priv = valid.str('privateKey'); - const address = valid.str('address'); - - if (pub) { - const key = KeyRing$1.fromPublic(pub); - await req.wallet.importKey(acct, key); - res.json(200, { success: true }); - return; - } - - if (priv) { - const key = KeyRing$1.fromSecret(priv, this.network); - await req.wallet.importKey(acct, key, passphrase); - res.json(200, { success: true }); - return; - } - - if (address) { - const addr = Address$3.fromString(address, this.network); - await req.wallet.importAddress(acct, addr); - res.json(200, { success: true }); - return; - } - - enforce(false, 'Key or address is required.'); - }); - - // Generate new token - this.post('/wallet/:id/retoken', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const token = await req.wallet.retoken(passphrase); - - res.json(200, { - token: token.toString('hex') - }); - }); - - // Send TX - this.post('/wallet/:id/send', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs', []); - - const options = { - rate: valid.u64('rate'), - blocks: valid.u32('blocks'), - maxFee: valid.u64('maxFee'), - selection: valid.str('selection'), - smart: valid.bool('smart'), - account: valid.str('account'), - sort: valid.bool('sort'), - subtractFee: valid.bool('subtractFee'), - subtractIndex: valid.i32('subtractIndex'), - depth: valid.u32(['confirmations', 'depth']), - outputs: [] - }; - - for (const output of outputs) { - const valid = new Validator$1(output); - - let addr = valid.str('address'); - let script = valid.buf('script'); - - if (addr) - addr = Address$3.fromString(addr, this.network); - - if (script) - script = Script$6.fromRaw(script); - - options.outputs.push({ - address: addr, - script: script, - value: valid.u64('value') - }); - } - - const tx = await req.wallet.send(options, passphrase); - - const details = await req.wallet.getDetails(tx.hash()); - - res.json(200, details.toJSON(this.network, this.wdb.height)); - }); - - // Create TX - this.post('/wallet/:id/create', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs', []); - const sign = valid.bool('sign', true); - - const options = { - rate: valid.u64('rate'), - blocks: valid.u32('blocks'), - maxFee: valid.u64('maxFee'), - selection: valid.str('selection'), - smart: valid.bool('smart'), - account: valid.str('account'), - sort: valid.bool('sort'), - subtractFee: valid.bool('subtractFee'), - subtractIndex: valid.i32('subtractIndex'), - depth: valid.u32(['confirmations', 'depth']), - template: valid.bool('template', sign), - outputs: [] - }; - - for (const output of outputs) { - const valid = new Validator$1(output); - - let addr = valid.str('address'); - let script = valid.buf('script'); - - if (addr) - addr = Address$3.fromString(addr, this.network); - - if (script) - script = Script$6.fromRaw(script); - - options.outputs.push({ - address: addr, - script: script, - value: valid.u64('value') - }); - } - - const tx = await req.wallet.createTX(options); - - if (sign) - await req.wallet.sign(tx, passphrase); - - res.json(200, tx.getJSON(this.network)); - }); - - // Sign TX - this.post('/wallet/:id/sign', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const passphrase = valid.str('passphrase'); - const raw = valid.buf('tx'); - - enforce(raw, 'TX is required.'); - - const tx = MTX$3.fromRaw(raw); - tx.view = await req.wallet.getCoinView(tx); - - await req.wallet.sign(tx, passphrase); - - res.json(200, tx.getJSON(this.network)); - }); - - // Zap Wallet TXs - this.post('/wallet/:id/zap', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const age = valid.u32('age'); - - enforce(age, 'Age is required.'); - - await req.wallet.zap(acct, age); - - res.json(200, { success: true }); - }); - - // Abandon Wallet TX - this.del('/wallet/:id/tx/:hash', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce(hash, 'Hash is required.'); - - await req.wallet.abandon(hash); - - res.json(200, { success: true }); - }); - - // List blocks - this.get('/wallet/:id/block', async (req, res) => { - const heights = await req.wallet.getBlocks(); - res.json(200, heights); - }); - - // Get Block Record - this.get('/wallet/:id/block/:height', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const height = valid.u32('height'); - - enforce(height != null, 'Height is required.'); - - const block = await req.wallet.getBlock(height); - - if (!block) { - res.json(404); - return; - } - - res.json(200, block.toJSON()); - }); - - // Add key - this.put('/wallet/:id/shared-key', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const b58 = valid.str('accountKey'); - - enforce(b58, 'Key is required.'); - - const key = HDPublicKey.fromBase58(b58, this.network); - - const added = await req.wallet.addSharedKey(acct, key); - - res.json(200, { - success: true, - addedKey: added - }); - }); - - // Remove key - this.del('/wallet/:id/shared-key', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const b58 = valid.str('accountKey'); - - enforce(b58, 'Key is required.'); - - const key = HDPublicKey.fromBase58(b58, this.network); - - const removed = await req.wallet.removeSharedKey(acct, key); - - res.json(200, { - success: true, - removedKey: removed - }); - }); - - // Get key by address - this.get('/wallet/:id/key/:address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const b58 = valid.str('address'); - - enforce(b58, 'Address is required.'); - - const addr = Address$3.fromString(b58, this.network); - const key = await req.wallet.getKey(addr); - - if (!key) { - res.json(404); - return; - } - - res.json(200, key.toJSON(this.network)); - }); - - // Get private key - this.get('/wallet/:id/wif/:address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const address = valid.str('address'); - const passphrase = valid.str('passphrase'); - - enforce(address, 'Address is required.'); - - const addr = Address$3.fromString(address, this.network); - const key = await req.wallet.getPrivateKey(addr, passphrase); - - if (!key) { - res.json(404); - return; - } - - res.json(200, { privateKey: key.toSecret(this.network) }); - }); - - // Create address - this.post('/wallet/:id/address', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createReceive(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Create change address - this.post('/wallet/:id/change', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createChange(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Create nested address - this.post('/wallet/:id/nested', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const addr = await req.wallet.createNested(acct); - - res.json(200, addr.toJSON(this.network)); - }); - - // Wallet Balance - this.get('/wallet/:id/balance', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const balance = await req.wallet.getBalance(acct); - - if (!balance) { - res.json(404); - return; - } - - res.json(200, balance.toJSON()); - }); - - // Wallet UTXOs - this.get('/wallet/:id/coin', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const coins = await req.wallet.getCoins(acct); - const result = []; - - common$3.sortCoins(coins); - - for (const coin of coins) - result.push(coin.getJSON(this.network)); - - res.json(200, result); - }); - - // Locked coins - this.get('/wallet/:id/locked', async (req, res) => { - const locked = req.wallet.getLocked(); - const result = []; - - for (const outpoint of locked) - result.push(outpoint.toJSON()); - - res.json(200, result); - }); - - // Lock coin - this.put('/wallet/:id/locked/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const outpoint = new Outpoint$4(hash, index); - - req.wallet.lockCoin(outpoint); - - res.json(200, { success: true }); - }); - - // Unlock coin - this.del('/wallet/:id/locked/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const outpoint = new Outpoint$4(hash, index); - - req.wallet.unlockCoin(outpoint); - - res.json(200, { success: true }); - }); - - // Wallet Coin - this.get('/wallet/:id/coin/:hash/:index', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - const index = valid.u32('index'); - - enforce(hash, 'Hash is required.'); - enforce(index != null, 'Index is required.'); - - const coin = await req.wallet.getCoin(hash, index); - - if (!coin) { - res.json(404); - return; - } - - res.json(200, coin.getJSON(this.network)); - }); - - // Wallet TXs - this.get('/wallet/:id/tx/history', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const txs = await req.wallet.getHistory(acct); - - common$3.sortTX(txs); - - const details = await req.wallet.toDetails(txs); - - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet Pending TXs - this.get('/wallet/:id/tx/unconfirmed', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const txs = await req.wallet.getPending(acct); - - common$3.sortTX(txs); - - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet TXs within time range - this.get('/wallet/:id/tx/range', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - - const options = { - start: valid.u32('start'), - end: valid.u32('end'), - limit: valid.u32('limit'), - reverse: valid.bool('reverse') - }; - - const txs = await req.wallet.getRange(acct, options); - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Last Wallet TXs - this.get('/wallet/:id/tx/last', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const acct = valid.str('account'); - const limit = valid.u32('limit'); - const txs = await req.wallet.getLast(acct, limit); - const details = await req.wallet.toDetails(txs); - const result = []; - - for (const item of details) - result.push(item.toJSON(this.network, this.wdb.height)); - - res.json(200, result); - }); - - // Wallet TX - this.get('/wallet/:id/tx/:hash', async (req, res) => { - const valid = Validator$1.fromRequest(req); - const hash = valid.brhash('hash'); - - enforce(hash, 'Hash is required.'); - - const tx = await req.wallet.getTX(hash); - - if (!tx) { - res.json(404); - return; - } - - const details = await req.wallet.toDetails(tx); - - res.json(200, details.toJSON(this.network, this.wdb.height)); - }); - - // Resend - this.post('/wallet/:id/resend', async (req, res) => { - await req.wallet.resend(); - res.json(200, { success: true }); - }); - } - - /** - * Initialize websockets. - * @private - */ - - initSockets() { - const handleTX = (event, wallet, tx, details) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = details.toJSON(this.network, this.wdb.liveHeight()); - - if (this.channel(name)) - this.to(name, event, wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', event, wallet.id, json); - }; - - this.wdb.on('tx', (wallet, tx, details) => { - handleTX('tx', wallet, tx, details); - }); - - this.wdb.on('confirmed', (wallet, tx, details) => { - handleTX('confirmed', wallet, tx, details); - }); - - this.wdb.on('unconfirmed', (wallet, tx, details) => { - handleTX('unconfirmed', wallet, tx, details); - }); - - this.wdb.on('conflict', (wallet, tx, details) => { - handleTX('conflict', wallet, tx, details); - }); - - this.wdb.on('balance', (wallet, balance) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = balance.toJSON(); - - if (this.channel(name)) - this.to(name, 'balance', wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', 'balance', wallet.id, json); - }); - - this.wdb.on('address', (wallet, receive) => { - const name = `w:${wallet.id}`; - - if (!this.channel(name) && !this.channel('w:*')) - return; - - const json = []; - - for (const addr of receive) - json.push(addr.toJSON(this.network)); - - if (this.channel(name)) - this.to(name, 'address', wallet.id, json); - - if (this.channel('w:*')) - this.to('w:*', 'address', wallet.id, json); - }); - } - - /** - * Handle new websocket. - * @private - * @param {WebSocket} socket - */ - - handleSocket(socket) { - socket.hook('auth', (...args) => { - if (socket.channel('auth')) - throw new Error('Already authed.'); - - if (!this.options.noAuth) { - const valid = new Validator$1(args); - const key = valid.str(0, ''); - - if (key.length > 255) - throw new Error('Invalid API key.'); - - const data = Buffer.from(key, 'utf8'); - const hash = sha256$1.digest(data); - - if (!safeEqual$2(hash, this.options.apiHash)) - throw new Error('Invalid API key.'); - } - - socket.join('auth'); - - this.logger.info('Successful auth from %s.', socket.host); - - this.handleAuth(socket); - - return null; - }); - } - - /** - * Handle new auth'd websocket. - * @private - * @param {WebSocket} socket - */ - - handleAuth(socket) { - socket.hook('join', async (...args) => { - const valid = new Validator$1(args); - const id = valid.str(0, ''); - const token = valid.buf(1); - - if (!id) - throw new Error('Invalid parameter.'); - - if (!this.options.walletAuth) { - socket.join('admin'); - } else if (token) { - if (safeEqual$2(token, this.options.adminToken)) - socket.join('admin'); - } - - if (socket.channel('admin') || !this.options.walletAuth) { - socket.join(`w:${id}`); - return null; - } - - if (id === '*') - throw new Error('Bad token.'); - - if (!token) - throw new Error('Invalid parameter.'); - - let wallet; - try { - wallet = await this.wdb.auth(id, token); - } catch (e) { - this.logger.info('Wallet auth failure for %s: %s.', id, e.message); - throw new Error('Bad token.'); - } - - if (!wallet) - throw new Error('Wallet does not exist.'); - - this.logger.info('Successful wallet auth for %s.', id); - - socket.join(`w:${id}`); - - return null; - }); - - socket.hook('leave', (...args) => { - const valid = new Validator$1(args); - const id = valid.str(0, ''); - - if (!id) - throw new Error('Invalid parameter.'); - - socket.leave(`w:${id}`); - - return null; - }); - } -} - -class HTTPOptions { - /** - * HTTPOptions - * @alias module:http.HTTPOptions - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network$1.primary; - this.logger = null; - this.node = null; - this.apiKey = base58$1.encode(random$1.randomBytes(20)); - this.apiHash = sha256$1.digest(Buffer.from(this.apiKey, 'ascii')); - this.adminToken = random$1.randomBytes(32); - this.serviceHash = this.apiHash; - this.noAuth = false; - this.cors = false; - this.walletAuth = false; - - this.prefix = null; - this.host = '127.0.0.1'; - this.port = 8080; - this.ssl = false; - this.keyFile = null; - this.certFile = null; - - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {HTTPOptions} - */ - - fromOptions(options) { - assert$d(options); - assert$d(options.node && typeof options.node === 'object', - 'HTTP Server requires a WalletDB.'); - - this.node = options.node; - this.network = options.node.network; - this.logger = options.node.logger; - this.port = this.network.walletPort; - - if (options.logger != null) { - assert$d(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.apiKey != null) { - assert$d(typeof options.apiKey === 'string', - 'API key must be a string.'); - assert$d(options.apiKey.length <= 255, - 'API key must be under 255 bytes.'); - this.apiKey = options.apiKey; - this.apiHash = sha256$1.digest(Buffer.from(this.apiKey, 'ascii')); - } - - if (options.adminToken != null) { - if (typeof options.adminToken === 'string') { - assert$d(options.adminToken.length === 64, - 'Admin token must be a 32 byte hex string.'); - const token = Buffer.from(options.adminToken, 'hex'); - assert$d(token.length === 32, - 'Admin token must be a 32 byte hex string.'); - this.adminToken = token; - } else { - assert$d(Buffer.isBuffer(options.adminToken), - 'Admin token must be a hex string or buffer.'); - assert$d(options.adminToken.length === 32, - 'Admin token must be 32 bytes.'); - this.adminToken = options.adminToken; - } - } - - if (options.noAuth != null) { - assert$d(typeof options.noAuth === 'boolean'); - this.noAuth = options.noAuth; - } - - if (options.cors != null) { - assert$d(typeof options.cors === 'boolean'); - this.cors = options.cors; - } - - if (options.walletAuth != null) { - assert$d(typeof options.walletAuth === 'boolean'); - this.walletAuth = options.walletAuth; - } - - if (options.prefix != null) { - assert$d(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.keyFile = path$2.join(this.prefix, 'key.pem'); - this.certFile = path$2.join(this.prefix, 'cert.pem'); - } - - if (options.host != null) { - assert$d(typeof options.host === 'string'); - this.host = options.host; - } - - if (options.port != null) { - assert$d((options.port & 0xffff) === options.port, - 'Port must be a number.'); - this.port = options.port; - } - - if (options.ssl != null) { - assert$d(typeof options.ssl === 'boolean'); - this.ssl = options.ssl; - } - - if (options.keyFile != null) { - assert$d(typeof options.keyFile === 'string'); - this.keyFile = options.keyFile; - } - - if (options.certFile != null) { - assert$d(typeof options.certFile === 'string'); - this.certFile = options.certFile; - } - - // Allow no-auth implicitly - // if we're listening locally. - if (!options.apiKey) { - if (this.host === '127.0.0.1' || this.host === '::1') - this.noAuth = true; - } - - return this; - } - - /** - * Instantiate http options from object. - * @param {Object} options - * @returns {HTTPOptions} - */ - - static fromOptions(options) { - return new HTTPOptions().fromOptions(options); - } -} - -/* - * Helpers - */ - -function enforce(value, msg) { - if (!value) { - const err = new Error(msg); - err.statusCode = 400; - throw err; - } -} - -/* - * Expose - */ - -var http = HTTP$1; - -var layout$2 = {}; - -/*! - * layout.js - data layout for wallets - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const bdb$1 = bdb$d; - -/* - * Wallet Database Layout: - * V -> db version - * O -> flags - * R -> chain sync state - * D -> wallet id depth - * p[addr-hash] -> wallet ids - * P[wid][addr-hash] -> path data - * r[wid][index][hash] -> path account index - * w[wid] -> wallet - * W[wid] -> wallet id - * l[id] -> wid - * a[wid][index] -> account - * i[wid][name] -> account index - * n[wid][index] -> account name - * h[height] -> recent block hash - * b[height] -> block->wid map - * o[hash][index] -> outpoint->wid map - * T[hash] -> tx->wid map - * t[wid]* -> txdb - */ - -layout$2.wdb = { - V: bdb$1.key('V'), - O: bdb$1.key('O'), - R: bdb$1.key('R'), - D: bdb$1.key('D'), - p: bdb$1.key('p', ['hash']), - P: bdb$1.key('P', ['uint32', 'hash']), - r: bdb$1.key('r', ['uint32', 'uint32', 'hash']), - w: bdb$1.key('w', ['uint32']), - W: bdb$1.key('W', ['uint32']), - l: bdb$1.key('l', ['ascii']), - a: bdb$1.key('a', ['uint32', 'uint32']), - i: bdb$1.key('i', ['uint32', 'ascii']), - n: bdb$1.key('n', ['uint32', 'uint32']), - h: bdb$1.key('h', ['uint32']), - b: bdb$1.key('b', ['uint32']), - o: bdb$1.key('o', ['hash256', 'uint32']), - T: bdb$1.key('T', ['hash256']), - t: bdb$1.key('t', ['uint32']) -}; - -/* - * TXDB Database Layout: - * R -> wallet balance - * r[account] -> account balance - * t[hash] -> extended tx - * c[hash][index] -> coin - * d[hash][index] -> undo coin - * s[hash][index] -> spent by hash - * p[hash] -> dummy (pending flag) - * m[time][hash] -> dummy (tx by time) - * h[height][hash] -> dummy (tx by height) - * T[account][hash] -> dummy (tx by account) - * P[account][hash] -> dummy (pending tx by account) - * M[account][time][hash] -> dummy (tx by time + account) - * H[account][height][hash] -> dummy (tx by height + account) - * C[account][hash][index] -> dummy (coin by account) - * b[height] -> block record - */ - -layout$2.txdb = { - prefix: bdb$1.key('t', ['uint32']), - R: bdb$1.key('R'), - r: bdb$1.key('r', ['uint32']), - t: bdb$1.key('t', ['hash256']), - c: bdb$1.key('c', ['hash256', 'uint32']), - d: bdb$1.key('d', ['hash256', 'uint32']), - s: bdb$1.key('s', ['hash256', 'uint32']), - p: bdb$1.key('p', ['hash256']), - m: bdb$1.key('m', ['uint32', 'hash256']), - h: bdb$1.key('h', ['uint32', 'hash256']), - T: bdb$1.key('T', ['uint32', 'hash256']), - P: bdb$1.key('P', ['uint32', 'hash256']), - M: bdb$1.key('M', ['uint32', 'uint32', 'hash256']), - H: bdb$1.key('H', ['uint32', 'uint32', 'hash256']), - C: bdb$1.key('C', ['uint32', 'hash256', 'uint32']), - b: bdb$1.key('b', ['uint32']) -}; - -var aes$5 = {exports: {}}; - -var aes$4 = {}; - -/*! - * aes.js - aes128/192/256 for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on openssl/openssl: - * Based on code entered into the public domain by Vincent Rijmen. - * https://github.com/openssl/openssl/blob/master/crypto/aes/aes_core.c - * - * Resources: - * https://en.wikipedia.org/wiki/Advanced_Encryption_Standard - * http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf - * https://github.com/openssl/openssl/blob/master/crypto/aes/aes_core.c - */ - -const assert$c = assert_1$d; - -/* - * Constants - */ - -const TE0 = new Uint32Array([ - 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, - 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, - 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, - 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, - 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, - 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, - 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, - 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, - 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, - 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, - 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, - 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, - 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, - 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, - 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, - 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, - 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, - 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, - 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, - 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, - 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, - 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, - 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, - 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, - 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, - 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, - 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, - 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, - 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, - 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, - 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, - 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, - 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, - 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, - 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, - 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, - 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, - 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, - 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, - 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, - 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, - 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, - 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, - 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, - 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, - 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, - 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, - 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, - 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, - 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, - 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, - 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, - 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, - 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, - 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, - 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, - 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, - 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, - 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, - 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, - 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, - 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, - 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, - 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a -]); - -const TE1 = new Uint32Array([ - 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, - 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, - 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, - 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, - 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, - 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, - 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, - 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, - 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, - 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, - 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, - 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, - 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, - 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, - 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, - 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, - 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, - 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, - 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, - 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, - 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, - 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, - 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, - 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, - 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, - 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, - 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, - 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, - 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, - 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, - 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, - 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, - 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, - 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, - 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, - 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, - 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, - 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, - 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, - 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, - 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, - 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, - 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, - 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, - 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, - 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, - 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, - 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, - 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, - 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, - 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, - 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, - 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, - 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, - 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, - 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, - 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, - 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, - 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, - 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, - 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, - 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, - 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, - 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616 -]); - -const TE2 = new Uint32Array([ - 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, - 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, - 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, - 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, - 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, - 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, - 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, - 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, - 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, - 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, - 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, - 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, - 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, - 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, - 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, - 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, - 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, - 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, - 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, - 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, - 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, - 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, - 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, - 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, - 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, - 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, - 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, - 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, - 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, - 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, - 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, - 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, - 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, - 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, - 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, - 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, - 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, - 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, - 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, - 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, - 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, - 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, - 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, - 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, - 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, - 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, - 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, - 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, - 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, - 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, - 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, - 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, - 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, - 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, - 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, - 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, - 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, - 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, - 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, - 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, - 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, - 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, - 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, - 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16 -]); - -const TE3 = new Uint32Array([ - 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, - 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, - 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, - 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, - 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, - 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, - 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, - 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, - 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, - 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, - 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, - 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, - 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, - 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, - 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, - 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, - 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, - 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, - 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, - 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, - 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, - 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, - 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, - 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, - 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, - 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, - 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, - 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, - 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, - 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, - 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, - 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, - 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, - 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, - 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, - 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, - 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, - 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, - 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, - 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, - 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, - 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, - 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, - 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, - 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, - 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, - 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, - 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, - 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, - 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, - 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, - 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, - 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, - 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, - 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, - 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, - 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, - 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, - 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, - 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, - 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, - 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, - 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, - 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c -]); - -const TD0 = new Uint32Array([ - 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, - 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, - 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, - 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, - 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, - 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, - 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, - 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, - 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, - 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, - 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, - 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, - 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, - 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, - 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, - 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, - 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, - 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, - 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, - 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, - 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, - 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, - 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, - 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, - 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, - 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, - 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, - 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, - 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, - 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, - 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, - 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, - 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, - 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, - 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, - 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, - 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, - 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, - 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, - 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, - 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, - 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, - 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, - 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, - 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, - 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, - 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, - 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, - 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, - 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, - 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, - 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, - 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, - 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, - 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, - 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, - 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, - 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, - 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, - 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, - 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, - 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, - 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, - 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742 -]); - -const TD1 = new Uint32Array([ - 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, - 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, - 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, - 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, - 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, - 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, - 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, - 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, - 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, - 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, - 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, - 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, - 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, - 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, - 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, - 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, - 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, - 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, - 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, - 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, - 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, - 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, - 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, - 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, - 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, - 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, - 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, - 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, - 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, - 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, - 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, - 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, - 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, - 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, - 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, - 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, - 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, - 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, - 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, - 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, - 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, - 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, - 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, - 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, - 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, - 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, - 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, - 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, - 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, - 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, - 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, - 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, - 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, - 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, - 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, - 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, - 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, - 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, - 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, - 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, - 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, - 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, - 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, - 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857 -]); - -const TD2 = new Uint32Array([ - 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, - 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, - 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, - 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, - 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, - 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, - 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, - 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, - 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, - 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, - 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, - 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, - 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, - 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, - 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, - 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, - 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, - 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, - 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, - 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, - 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, - 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, - 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, - 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, - 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, - 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, - 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, - 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, - 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, - 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, - 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, - 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, - 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, - 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, - 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, - 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, - 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, - 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, - 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, - 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, - 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, - 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, - 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, - 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, - 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, - 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, - 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, - 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, - 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, - 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, - 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, - 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, - 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, - 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, - 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, - 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, - 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, - 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, - 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, - 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, - 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, - 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, - 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, - 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8 -]); - -const TD3 = new Uint32Array([ - 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, - 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, - 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, - 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, - 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, - 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, - 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, - 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, - 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, - 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, - 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, - 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, - 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, - 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, - 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, - 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, - 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, - 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, - 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, - 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, - 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, - 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, - 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, - 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, - 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, - 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, - 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, - 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, - 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, - 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, - 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, - 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, - 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, - 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, - 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, - 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, - 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, - 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, - 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, - 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, - 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, - 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, - 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, - 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, - 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, - 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, - 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, - 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, - 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, - 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, - 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, - 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, - 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, - 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, - 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, - 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, - 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, - 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, - 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, - 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, - 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, - 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, - 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, - 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0 -]); - -const TD4 = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, - 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, - 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, - 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, - 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, - 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, - 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, - 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, - 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, - 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, - 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, - 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, - 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, - 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, - 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, - 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, - 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, - 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, - 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, - 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, - 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, - 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d -]); - -const RCON = new Uint32Array([ - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1b000000, 0x36000000 -]); - -/** - * AES - */ - -class AES$1 { - constructor(bits = 256) { - assert$c((bits >>> 0) === bits); - - this.bits = bits; - this.rounds = getRounds(bits); - this.key = null; - this.encKey = null; - this.decKey = null; - } - - get blockSize() { - return 16; - } - - init(key) { - assert$c(Buffer.isBuffer(key)); - - if (key.length !== (this.bits >>> 3)) - throw new Error('Invalid key size.'); - - this.destroy(); - this.key = Buffer.from(key); - this.encKey = null; - this.decKey = null; - - return this; - } - - createEncryptKey() { - if (!this.key) - throw new Error('Cipher is not initialized.'); - - const ukey = this.key; - - if (ukey.length !== (this.bits >>> 3)) - throw new Error('Invalid key size.'); - - const key = new Uint32Array(60); - - key[0] = readU32$1(ukey, 0); - key[1] = readU32$1(ukey, 4); - key[2] = readU32$1(ukey, 8); - key[3] = readU32$1(ukey, 12); - - let p = 0; - let i = 0; - - if (this.bits === 128) { - for (;;) { - const tmp = key[p + 3]; - - key[p + 4] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 5] = key[p + 1] ^ key[p + 4]; - key[p + 6] = key[p + 2] ^ key[p + 5]; - key[p + 7] = key[p + 3] ^ key[p + 6]; - - i += 1; - - if (i === 10) - break; - - p += 4; - } - - return key; - } - - key[p + 4] = readU32$1(ukey, 16); - key[p + 5] = readU32$1(ukey, 20); - - if (this.bits === 192) { - for (;;) { - const tmp = key[p + 5]; - - key[p + 6] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 7] = key[p + 1] ^ key[p + 6]; - key[p + 8] = key[p + 2] ^ key[p + 7]; - key[p + 9] = key[p + 3] ^ key[p + 8]; - - i += 1; - - if (i === 8) - break; - - key[p + 10] = key[p + 4] ^ key[p + 9]; - key[p + 11] = key[p + 5] ^ key[p + 10]; - p += 6; - } - - return key; - } - - key[p + 6] = readU32$1(ukey, 24); - key[p + 7] = readU32$1(ukey, 28); - - if (this.bits === 256) { - for (;;) { - let tmp = key[p + 7]; - - key[p + 8] = key[p] - ^ (TE2[(tmp >>> 16) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 8) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 0) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 24) & 0xff] & 0x000000ff) - ^ RCON[i]; - - key[p + 9] = key[p + 1] ^ key[p + 8]; - key[p + 10] = key[p + 2] ^ key[p + 9]; - key[p + 11] = key[p + 3] ^ key[p + 10]; - - i += 1; - - if (i === 7) - break; - - tmp = key[p + 11]; - - key[p + 12] = key[p + 4] - ^ (TE2[(tmp >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(tmp >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(tmp >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(tmp >>> 0) & 0xff] & 0x000000ff); - - key[p + 13] = key[p + 5] ^ key[p + 12]; - key[p + 14] = key[p + 6] ^ key[p + 13]; - key[p + 15] = key[p + 7] ^ key[p + 14]; - - p += 8; - } - - return key; - } - - throw new Error('Bad key size.'); - } - - createDecryptKey() { - // First, start with an encryption schedule. - const key = this.createEncryptKey(); - - let p = 0; - - // Invert the order of the round keys. - for (let i = 0, j = 4 * this.rounds; i < j; i += 4, j -= 4) { - let tmp = key[p + i + 0]; - - key[p + i + 0] = key[p + j + 0]; - key[p + j + 0] = tmp; - - tmp = key[p + i + 1]; - key[p + i + 1] = key[p + j + 1]; - key[p + j + 1] = tmp; - - tmp = key[p + i + 2]; - key[p + i + 2] = key[p + j + 2]; - key[p + j + 2] = tmp; - - tmp = key[p + i + 3]; - key[p + i + 3] = key[p + j + 3]; - key[p + j + 3] = tmp; - } - - // Apply the inverse MixColumn transform to - // all round keys but the first and the last. - for (let i = 1; i < this.rounds; i++) { - p += 4; - - key[p + 0] = TD0[TE1[(key[p + 0] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 0] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 0] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 0] >>> 0) & 0xff] & 0xff]; - - key[p + 1] = TD0[TE1[(key[p + 1] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 1] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 1] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 1] >>> 0) & 0xff] & 0xff]; - - key[p + 2] = TD0[TE1[(key[p + 2] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 2] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 2] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 2] >>> 0) & 0xff] & 0xff]; - - key[p + 3] = TD0[TE1[(key[p + 3] >>> 24) & 0xff] & 0xff] - ^ TD1[TE1[(key[p + 3] >>> 16) & 0xff] & 0xff] - ^ TD2[TE1[(key[p + 3] >>> 8) & 0xff] & 0xff] - ^ TD3[TE1[(key[p + 3] >>> 0) & 0xff] & 0xff]; - } - - return key; - } - - getEncryptKey() { - if (!this.encKey) - this.encKey = this.createEncryptKey(); - return this.encKey; - } - - getDecryptKey() { - if (!this.decKey) - this.decKey = this.createDecryptKey(); - return this.decKey; - } - - encrypt(output, opos, input, ipos) { - const key = this.getEncryptKey(); - - // Map byte array block to cipher - // state and add initial round key. - let s0 = readU32$1(input, ipos + 0) ^ key[0]; - let s1 = readU32$1(input, ipos + 4) ^ key[1]; - let s2 = readU32$1(input, ipos + 8) ^ key[2]; - let s3 = readU32$1(input, ipos + 12) ^ key[3]; - - // Nr - 1 full rounds - let r = this.rounds >>> 1; - let p = 0; - let t0, t1, t2, t3; - - for (;;) { - t0 = TE0[(s0 >>> 24) & 0xff] - ^ TE1[(s1 >>> 16) & 0xff] - ^ TE2[(s2 >>> 8) & 0xff] - ^ TE3[(s3 >>> 0) & 0xff] - ^ key[p + 4]; - - t1 = TE0[(s1 >>> 24) & 0xff] - ^ TE1[(s2 >>> 16) & 0xff] - ^ TE2[(s3 >>> 8) & 0xff] - ^ TE3[(s0 >>> 0) & 0xff] - ^ key[p + 5]; - - t2 = TE0[(s2 >>> 24) & 0xff] - ^ TE1[(s3 >>> 16) & 0xff] - ^ TE2[(s0 >>> 8) & 0xff] - ^ TE3[(s1 >>> 0) & 0xff] - ^ key[p + 6]; - - t3 = TE0[(s3 >>> 24) & 0xff] - ^ TE1[(s0 >>> 16) & 0xff] - ^ TE2[(s1 >>> 8) & 0xff] - ^ TE3[(s2 >>> 0) & 0xff] - ^ key[p + 7]; - - p += 8; - r -= 1; - - if (r === 0) - break; - - s0 = TE0[(t0 >>> 24) & 0xff] - ^ TE1[(t1 >>> 16) & 0xff] - ^ TE2[(t2 >>> 8) & 0xff] - ^ TE3[(t3 >>> 0) & 0xff] - ^ key[p + 0]; - - s1 = TE0[(t1 >>> 24) & 0xff] - ^ TE1[(t2 >>> 16) & 0xff] - ^ TE2[(t3 >>> 8) & 0xff] - ^ TE3[(t0 >>> 0) & 0xff] - ^ key[p + 1]; - - s2 = TE0[(t2 >>> 24) & 0xff] - ^ TE1[(t3 >>> 16) & 0xff] - ^ TE2[(t0 >>> 8) & 0xff] - ^ TE3[(t1 >>> 0) & 0xff] - ^ key[p + 2]; - - s3 = TE0[(t3 >>> 24) & 0xff] - ^ TE1[(t0 >>> 16) & 0xff] - ^ TE2[(t1 >>> 8) & 0xff] - ^ TE3[(t2 >>> 0) & 0xff] - ^ key[p + 3]; - } - - // Apply last round and map cipher - // state to byte array block. - s0 = (TE2[(t0 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t1 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t2 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t3 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 0]; - - s1 = (TE2[(t1 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t2 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t3 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t0 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 1]; - - s2 = (TE2[(t2 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t3 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t0 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t1 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 2]; - - s3 = (TE2[(t3 >>> 24) & 0xff] & 0xff000000) - ^ (TE3[(t0 >>> 16) & 0xff] & 0x00ff0000) - ^ (TE0[(t1 >>> 8) & 0xff] & 0x0000ff00) - ^ (TE1[(t2 >>> 0) & 0xff] & 0x000000ff) - ^ key[p + 3]; - - writeU32$1(output, s0, opos + 0); - writeU32$1(output, s1, opos + 4); - writeU32$1(output, s2, opos + 8); - writeU32$1(output, s3, opos + 12); - - return this; - } - - decrypt(output, opos, input, ipos) { - const key = this.getDecryptKey(); - - // Map byte array block to cipher - // state and add initial round key. - let s0 = readU32$1(input, ipos + 0) ^ key[0]; - let s1 = readU32$1(input, ipos + 4) ^ key[1]; - let s2 = readU32$1(input, ipos + 8) ^ key[2]; - let s3 = readU32$1(input, ipos + 12) ^ key[3]; - - // Nr - 1 full rounds - let r = this.rounds >>> 1; - let p = 0; - let t0, t1, t2, t3; - - for (;;) { - t0 = TD0[(s0 >>> 24) & 0xff] - ^ TD1[(s3 >>> 16) & 0xff] - ^ TD2[(s2 >>> 8) & 0xff] - ^ TD3[(s1 >>> 0) & 0xff] - ^ key[p + 4]; - - t1 = TD0[(s1 >>> 24) & 0xff] - ^ TD1[(s0 >>> 16) & 0xff] - ^ TD2[(s3 >>> 8) & 0xff] - ^ TD3[(s2 >>> 0) & 0xff] - ^ key[p + 5]; - - t2 = TD0[(s2 >>> 24) & 0xff] - ^ TD1[(s1 >>> 16) & 0xff] - ^ TD2[(s0 >>> 8) & 0xff] - ^ TD3[(s3 >>> 0) & 0xff] - ^ key[p + 6]; - - t3 = TD0[(s3 >>> 24) & 0xff] - ^ TD1[(s2 >>> 16) & 0xff] - ^ TD2[(s1 >>> 8) & 0xff] - ^ TD3[(s0 >>> 0) & 0xff] - ^ key[p + 7]; - - p += 8; - r -= 1; - - if (r === 0) - break; - - s0 = TD0[(t0 >>> 24) & 0xff] - ^ TD1[(t3 >>> 16) & 0xff] - ^ TD2[(t2 >>> 8) & 0xff] - ^ TD3[(t1 >>> 0) & 0xff] - ^ key[p + 0]; - - s1 = TD0[(t1 >>> 24) & 0xff] - ^ TD1[(t0 >>> 16) & 0xff] - ^ TD2[(t3 >>> 8) & 0xff] - ^ TD3[(t2 >>> 0) & 0xff] - ^ key[p + 1]; - - s2 = TD0[(t2 >>> 24) & 0xff] - ^ TD1[(t1 >>> 16) & 0xff] - ^ TD2[(t0 >>> 8) & 0xff] - ^ TD3[(t3 >>> 0) & 0xff] - ^ key[p + 2]; - - s3 = TD0[(t3 >>> 24) & 0xff] - ^ TD1[(t2 >>> 16) & 0xff] - ^ TD2[(t1 >>> 8) & 0xff] - ^ TD3[(t0 >>> 0) & 0xff] - ^ key[p + 3]; - } - - // Apply last round and map cipher - // state to byte array block. - s0 = (TD4[(t0 >>> 24) & 0xff] << 24) - ^ (TD4[(t3 >>> 16) & 0xff] << 16) - ^ (TD4[(t2 >>> 8) & 0xff] << 8) - ^ (TD4[(t1 >>> 0) & 0xff] << 0) - ^ key[p + 0]; - - s1 = (TD4[(t1 >>> 24) & 0xff] << 24) - ^ (TD4[(t0 >>> 16) & 0xff] << 16) - ^ (TD4[(t3 >>> 8) & 0xff] << 8) - ^ (TD4[(t2 >>> 0) & 0xff] << 0) - ^ key[p + 1]; - - s2 = (TD4[(t2 >>> 24) & 0xff] << 24) - ^ (TD4[(t1 >>> 16) & 0xff] << 16) - ^ (TD4[(t0 >>> 8) & 0xff] << 8) - ^ (TD4[(t3 >>> 0) & 0xff] << 0) - ^ key[p + 2]; - - s3 = (TD4[(t3 >>> 24) & 0xff] << 24) - ^ (TD4[(t2 >>> 16) & 0xff] << 16) - ^ (TD4[(t1 >>> 8) & 0xff] << 8) - ^ (TD4[(t0 >>> 0) & 0xff] << 0) - ^ key[p + 3]; - - writeU32$1(output, s0, opos + 0); - writeU32$1(output, s1, opos + 4); - writeU32$1(output, s2, opos + 8); - writeU32$1(output, s3, opos + 12); - - return this; - } - - destroy() { - if (this.key) { - for (let i = 0; i < this.key.length; i++) - this.key[i] = 0; - } - - if (this.encKey) { - for (let i = 0; i < 60; i++) - this.encKey[i] = 0; - } - - if (this.decKey) { - for (let i = 0; i < 60; i++) - this.decKey[i] = 0; - } - - this.key = null; - this.encKey = null; - this.decKey = null; - - return this; - } -} - -/* - * Helpers - */ - -function getRounds(bits) { - switch (bits) { - case 128: - return 10; - case 192: - return 12; - case 256: - return 14; - default: - throw new Error('Bad key size.'); - } -} - -function readU32$1(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off]); -} - -function writeU32$1(dst, num, off) { - dst[off++] = num >>> 24; - dst[off++] = num >>> 16; - dst[off++] = num >>> 8; - dst[off++] = num; - return off; -} - -/* - * Expose - */ - -var aes$3 = AES$1; - -var modes = {}; - -/*! - * ghash.js - ghash for javascript - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Parts of this software are based on golang/go: - * Copyright (c) 2009, The Go Authors. All rights reserved. - * https://github.com/golang/go - * - * Resources: - * https://en.wikipedia.org/wiki/Galois/Counter_Mode - * https://dx.doi.org/10.6028/NIST.SP.800-38D - * https://github.com/golang/go/blob/master/src/crypto/cipher/gcm.go - * https://github.com/golang/go/blob/master/src/crypto/cipher/gcm_test.go - * https://github.com/DaGenix/rust-crypto/blob/master/src/ghash.rs - */ - -const assert$b = assert_1$d; - -/* - * Constants - */ - -const PADDING = Buffer.alloc(16, 0x00); -const FINALIZED = -1; - -const REDUCTION = new Uint16Array([ - 0x0000, 0x1c20, 0x3840, 0x2460, - 0x7080, 0x6ca0, 0x48c0, 0x54e0, - 0xe100, 0xfd20, 0xd940, 0xc560, - 0x9180, 0x8da0, 0xa9c0, 0xb5e0 -]); - -/** - * GHASH - */ - -class GHASH$1 { - constructor() { - this.state = new Uint32Array(4); - this.block = Buffer.alloc(16); - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - this.table = new Array(16); - - for (let i = 0; i < 16; i++) - this.table[i] = new Uint32Array(4); - } - - init(key) { - assert$b(Buffer.isBuffer(key)); - assert$b(key.length === 16); - - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - this.size = 0; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - - const x = new Uint32Array(4); - - x[1] = readU32(key, 0); - x[0] = readU32(key, 4); - x[3] = readU32(key, 8); - x[2] = readU32(key, 12); - - this.table[reverse(1)] = x; - - for (let i = 2; i < 16; i += 2) { - this.table[reverse(i)] = this.double(this.table[reverse(i >>> 1)]); - this.table[reverse(i + 1)] = this.add(this.table[reverse(i)], x); - } - - return this; - } - - absorb(data) { - this._absorb(data, data.length); - return this; - } - - _absorb(data, len) { - assert$b(this.size !== FINALIZED, 'Context is not initialized.'); - - let pos = this.size & 15; - let off = 0; - - this.size += len; - - if (pos > 0) { - let want = 16 - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < 16) - return; - - this.transform(this.block, 0); - } - - while (len >= 16) { - this.transform(data, off); - off += 16; - len -= 16; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - } - - transform(block, off) { - this.state[1] ^= readU32(block, off + 0); - this.state[0] ^= readU32(block, off + 4); - this.state[3] ^= readU32(block, off + 8); - this.state[2] ^= readU32(block, off + 12); - this.mul(this.state); - } - - pad() { - const pos = this.size & 15; - - if (pos !== 0) - this._absorb(PADDING, 16 - pos); - } - - aad(data) { - assert$b(Buffer.isBuffer(data)); - assert$b(this.ctLen === 0); - - this.adLen += data.length; - - return this.absorb(data); - } - - update(data) { - assert$b(Buffer.isBuffer(data)); - - if (data.length === 0) - return this; - - if (this.ctLen === 0) - this.pad(); - - this.ctLen += data.length; - - return this.absorb(data); - } - - final() { - const out = Buffer.alloc(16); - - this.pad(); - - const adLen = this.adLen * 8; - const ctLen = this.ctLen * 8; - - this.state[1] ^= hi32(adLen); - this.state[0] ^= lo32(adLen); - this.state[3] ^= hi32(ctLen); - this.state[2] ^= lo32(ctLen); - - this.mul(this.state); - - writeU32(out, this.state[1], 0); - writeU32(out, this.state[0], 4); - writeU32(out, this.state[3], 8); - writeU32(out, this.state[2], 12); - - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - for (let i = 0; i < 16; i++) - this.block[i] = 0; - - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - - return out; - } - - destroy() { - for (let i = 0; i < 4; i++) - this.state[i] = 0; - - for (let i = 0; i < 16; i++) - this.block[i] = 0; - - this.size = FINALIZED; - this.adLen = 0; - this.ctLen = 0; - - for (let i = 0; i < 16; i++) { - for (let j = 0; j < 4; j++) - this.table[i][j] = 0; - } - } - - add(x, y) { - assert$b(x instanceof Uint32Array); - assert$b(x.length === 4); - assert$b(y instanceof Uint32Array); - assert$b(y.length === 4); - - const z = new Uint32Array(4); - - z[0] = x[0] ^ y[0]; - z[1] = x[1] ^ y[1]; - z[2] = x[2] ^ y[2]; - z[3] = x[3] ^ y[3]; - - return z; - } - - double(x) { - assert$b(x instanceof Uint32Array); - assert$b(x.length === 4); - - const d = new Uint32Array(4); - const msb = (x[2] & 1) === 1; - - let v; - - d[3] = x[3]; - d[2] = x[2]; - v = d[3] & 1; - d[3] >>>= 1; - d[2] >>>= 1; - d[2] |= v << 31; - - d[3] |= (x[0] & 1) << 31; - - d[1] = x[1]; - d[0] = x[0]; - v = d[1] & 1; - d[1] >>>= 1; - d[0] >>>= 1; - d[0] |= v << 31; - - if (msb) { - d[1] ^= 0xe1000000; - d[0] ^= 0x00000000; - } - - return d; - } - - mul(y) { - assert$b(y instanceof Uint32Array); - assert$b(y.length === 4); - - const z = new Uint32Array(4); - const w = new Uint32Array(2); - - let v, t; - - for (let i = 0; i < 2; i++) { - w[0] = y[2]; - w[1] = y[3]; - - if (i === 1) { - w[0] = y[0]; - w[1] = y[1]; - } - - for (let j = 0; j < 64; j += 4) { - const msw = z[2] & 0x0f; - - v = z[3] & 0x0f; - z[3] >>>= 4; - z[2] >>>= 4; - z[2] |= v << 28; - - z[3] |= z[0] << 28; - - v = z[1] & 0x0f; - z[1] >>>= 4; - z[0] >>>= 4; - z[0] |= v << 28; - - z[1] ^= REDUCTION[msw] << 16; - - t = this.table[w[0] & 0x0f]; - - z[0] ^= t[0]; - z[1] ^= t[1]; - - z[2] ^= t[2]; - z[3] ^= t[3]; - - v = w[1] & 0x0f; - w[1] >>>= 4; - w[0] >>>= 4; - w[0] |= v << 28; - } - } - - y[0] = z[0]; - y[1] = z[1]; - y[2] = z[2]; - y[3] = z[3]; - } -} - -/* - * Helpers - */ - -function hi32(num) { - return (num * (1 / 0x100000000)) >>> 0; -} - -function lo32(num) { - return num >>> 0; -} - -function reverse(i) { - i = ((i << 2) & 0x0c) | ((i >>> 2) & 0x03); - i = ((i << 1) & 0x0a) | ((i >>> 1) & 0x05); - return i; -} - -function readU32(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off++]); -} - -function writeU32(dst, num, off) { - dst[off++] = num >>> 24; - dst[off++] = num >>> 16; - dst[off++] = num >>> 8; - dst[off++] = num; - return off; -} - -/* - * Expose - */ - -var ghash = GHASH$1; - -/*! - * modes.js - cipher modes for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Resources: - * https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation - */ - -const assert$a = assert_1$d; -const GHASH = ghash; - -/* - * Constants - */ - -const EMPTY = Buffer.alloc(0); - -// Shifted by four. -const polyTable = new Uint32Array([ - 0x00001b, // 8 - 0x000087, // 16 - 0x000425, // 32 - 0x000000, - 0x000125, // 64 - 0x000000, - 0x000000, - 0x000000, - 0x080043 // 128 -]); - -/* - * Mode - */ - -class Mode { - constructor(ctx) { - assert$a(ctx && typeof ctx.encrypt === 'function'); - assert$a(typeof ctx.blockSize === 'number'); - - this.ctx = ctx; - } - - get blockSize() { - return this.ctx.blockSize; - } - - init(key, iv) { - throw new Error('Not implemented.'); - } - - update(data) { - throw new Error('Not implemented.'); - } - - crypt(output, input) { - throw new Error('Not implemented.'); - } - - final() { - throw new Error('Not implemented.'); - } - - destroy() { - throw new Error('Not implemented.'); - } - - setAutoPadding(padding) { - assert$a(typeof padding === 'boolean'); - - this._setAutoPadding(padding); - - return this; - } - - setAAD(data) { - assert$a(Buffer.isBuffer(data)); - this._setAAD(data); - return this; - } - - setCCM(msgLen, tagLen, aad) { - assert$a((msgLen >>> 0) === msgLen); - assert$a((tagLen >>> 0) === tagLen); - assert$a(aad == null || Buffer.isBuffer(aad)); - - this._setCCM(msgLen, tagLen, aad); - - return this; - } - - getAuthTag() { - return this._getAuthTag(); - } - - setAuthTag(tag) { - assert$a(Buffer.isBuffer(tag)); - this._setAuthTag(tag); - return this; - } - - _setAutoPadding(padding) { - throw new Error('Not available.'); - } - - _setAAD(data) { - throw new Error('Cipher is not authenticated.'); - } - - _setCCM(msgLen, tagLen, aad) { - throw new Error('Not available.'); - } - - _getAuthTag() { - throw new Error('Cipher is not authenticated.'); - } - - _setAuthTag(tag) { - throw new Error('Cipher is not authenticated.'); - } -} - -/** - * Block Mode - */ - -class Block$3 extends Mode { - constructor(ctx, unpad) { - super(ctx); - - this.padding = true; - this.unpad = unpad; - this.block = Buffer.alloc(this.blockSize); - this.blockPos = -1; - this.last = null; - this.lastSize = 0; - - if (unpad) - this.last = Buffer.alloc(this.blockSize); - } - - init(key, iv) { - if (iv == null) - iv = EMPTY; - - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - - this.ctx.init(key); - - this.blockPos = 0; - this.lastSize = 0; - - this._init(key, iv); - - return this; - } - - _updateSize(ilen) { - if (this.blockPos + ilen < this.blockSize) - return 0; - - let olen = 0; - - if (this.unpad) - olen += this.lastSize; - - if (this.blockPos > 0) { - ilen -= this.blockSize - this.blockPos; - olen += this.blockSize; - } - - if (ilen >= this.blockSize) - olen += ilen - (ilen % this.blockSize); - - assert$a(olen >= this.blockSize); - - return olen; - } - - update(input) { - assert$a(Buffer.isBuffer(input)); - - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - const olen = this._updateSize(input.length); - const output = Buffer.alloc(olen); - - if (this.blockPos + input.length < this.blockSize) { - this.blockPos += input.copy(this.block, this.blockPos, 0, input.length); - return output; - } - - let ilen = input.length; - let ipos = 0; - let opos = 0; - - if (this.unpad) - opos += this.last.copy(output, opos, 0, this.lastSize); - - if (this.blockPos > 0) { - const want = this.blockSize - this.blockPos; - - ipos += input.copy(this.block, this.blockPos, ipos, ipos + want); - ilen -= want; - - this._update(output, opos, this.block, 0); - - opos += this.blockSize; - - this.blockPos = 0; - } - - while (ilen >= this.blockSize) { - this._update(output, opos, input, ipos); - - ipos += this.blockSize; - ilen -= this.blockSize; - opos += this.blockSize; - } - - if (ilen > 0) - this.blockPos = input.copy(this.block, 0, ipos, ipos + ilen); - - assert$a(opos === olen); - - if (this.unpad) { - this.lastSize = output.copy(this.last, 0, olen - this.blockSize, olen); - return output.slice(0, olen - this.blockSize); - } - - return output; - } - - crypt(output, input) { - assert$a(Buffer.isBuffer(output)); - assert$a(Buffer.isBuffer(input)); - assert$a(output.length === input.length); - - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - if (this.unpad || this.blockPos !== 0) - throw new Error('Cannot crypt while buffering.'); - - if ((input.length % this.blockSize) !== 0) - throw new Error('Input must be a multiple of the block size.'); - - const size = this.blockSize; - - let len = input.length; - let pos = 0; - - while (len > 0) { - this._update(output, pos, input, pos); - pos += size; - len -= size; - } - - return output; - } - - final() { - if (this.blockPos === -1) - throw new Error('Cipher is not initialized.'); - - try { - return this._final(); - } finally { - this.destroy(); - } - } - - destroy() { - this.ctx.destroy(); - - this.blockPos = -1; - this.lastSize = 0; - - for (let i = 0; i < this.blockSize; i++) - this.block[i] = 0; - - if (this.unpad) { - for (let i = 0; i < this.blockSize; i++) - this.last[i] = 0; - } - - this._destroy(); - - return this; - } - - _init(key, iv) { - throw new Error('Not implemented.'); - } - - _update(output, opos, input, ipos) { - throw new Error('Not implemented.'); - } - - _final() { - throw new Error('Not implemented.'); - } - - _destroy() { - throw new Error('Not implemented.'); - } -} - -/* - * Stream Mode - */ - -class Stream extends Mode { - constructor(ctx) { - super(ctx); - this.pos = -1; - } - - init(key, iv) { - if (iv == null) - iv = EMPTY; - - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - - this.ctx.init(key); - - this.pos = 0; - - this._init(key, iv); - - return this; - } - - update(input) { - assert$a(Buffer.isBuffer(input)); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - const output = Buffer.alloc(input.length); - - this._crypt(output, input); - - return output; - } - - crypt(output, input) { - assert$a(Buffer.isBuffer(output)); - assert$a(Buffer.isBuffer(input)); - assert$a(output.length === input.length); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this._crypt(output, input); - - return output; - } - - final() { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - try { - return this._final(); - } finally { - this.destroy(); - } - } - - destroy() { - this.ctx.destroy(); - - this.pos = -1; - - this._destroy(); - - return this; - } - - _init(key, iv) { - throw new Error('Not implemented.'); - } - - _crypt(output, input) { - throw new Error('Not implemented.'); - } - - _final() { - throw new Error('Not implemented.'); - } - - _destroy() { - throw new Error('Not implemented.'); - } -} - -/** - * Raw Cipher - */ - -class RawCipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.encrypt(output, opos, input, ipos); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - _destroy() { - return; - } -} - -/** - * Raw Decipher - */ - -class RawDecipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.decrypt(output, opos, input, ipos); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - _destroy() { - return; - } -} - -/** - * PKCS#7 Cipher - */ - -class PKCS7Cipher extends Block$3 { - constructor(ctx) { - super(ctx, false); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - const left = this.blockSize - this.blockPos; - const block = Buffer.from(this.block); - - for (let i = this.blockPos; i < this.blockSize; i++) - block[i] = left; - - this._update(block, 0, block, 0); - - return block; - } - - _setAutoPadding(padding) { - this.padding = padding; - } -} - -/** - * PKCS#7 Decipher - */ - -class PKCS7Decipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - } - - _final() { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - if (!this.padding) - return Buffer.alloc(0); - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - assert$a(this.lastSize === this.last.length); - assert$a(this.lastSize === this.blockSize); - - const block = Buffer.from(this.last); - - let left = block[block.length - 1]; - let res = 1; - - // left != 0 - res &= ((left - 1) >>> 31) ^ 1; - - // left <= block_size - res &= (left - this.blockSize - 1) >>> 31; - - // left = 0 if left == 0 or left > block_size - left &= -res; - - // Verify padding in constant time. - const end = this.blockSize - left; - - for (let i = 0; i < this.blockSize; i++) { - const ch = block[i]; - - // i < end or ch == left - res &= ((i - end) >>> 31) | (((ch ^ left) - 1) >>> 31); - } - - if (!res) - throw new Error('Bad decrypt (padding).'); - - return block.slice(0, end); - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } -} - -/** - * ECB Cipher - */ - -class ECBCipher extends PKCS7Cipher { - constructor(ctx) { - super(ctx); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.encrypt(output, opos, input, ipos); - } - - _destroy() { - return; - } -} - -/** - * ECB Decipher - */ - -class ECBDecipher extends PKCS7Decipher { - constructor(ctx) { - super(ctx); - } - - _init(key, iv) { - assert$a(iv.length === 0); - } - - _update(output, opos, input, ipos) { - this.ctx.decrypt(output, opos, input, ipos); - } - - _destroy() { - return; - } -} - -/** - * CBC Cipher - */ - -class CBCCipher$1 extends PKCS7Cipher { - constructor(ctx) { - super(ctx); - - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] ^= input[ipos + i]; - - this.ctx.encrypt(output, opos, this.prev, 0); - - output.copy(this.prev, 0, opos, opos + this.blockSize); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] = 0; - } -} - -/** - * CBC Decipher - */ - -class CBCDecipher$1 extends PKCS7Decipher { - constructor(ctx) { - super(ctx); - - this.prev = Buffer.alloc(this.blockSize); - this.tmp = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - if (overlap(output, opos, input, ipos)) { - this.prev.copy(this.tmp, 0); - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tmp[i]; - } else { - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.prev[i]; - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - } - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.prev[i] = 0; - this.tmp[i] = 0; - } - } -} - -/** - * CTS Cipher - */ - -class CTSCipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] ^= input[ipos + i]; - - this.ctx.encrypt(output, opos, this.prev, 0); - - output.copy(this.prev, 0, opos, opos + this.blockSize); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad encrypt (no data).'); - - for (let i = 0; i < this.blockPos; i++) - this.prev[i] ^= this.block[i]; - - this.ctx.encrypt(this.prev, 0, this.prev, 0); - - const last = this.last.slice(0, this.blockPos); - - return Buffer.concat([this.prev, last]); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.prev[i] = 0; - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } -} - -/** - * CTS Decipher - */ - -class CTSDecipher extends Block$3 { - constructor(ctx) { - super(ctx, true); - - this.prev = Buffer.alloc(this.blockSize); - this.tmp = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - iv.copy(this.prev, 0); - } - - _update(output, opos, input, ipos) { - if (overlap(output, opos, input, ipos)) { - this.prev.copy(this.tmp, 0); - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tmp[i]; - } else { - this.ctx.decrypt(output, opos, input, ipos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.prev[i]; - - input.copy(this.prev, 0, ipos, ipos + this.blockSize); - } - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - const tmp = Buffer.alloc(this.blockSize); - - this.ctx.decrypt(this.prev, 0, this.prev, 0); - - // Recreate the previous (x2) ciphertext (`this.tmp`), - // which is normally only available on overlap. - for (let i = 0; i < this.blockSize; i++) - tmp[i] = this.last[i] ^ this.prev[i]; - - for (let i = 0; i < this.blockPos; i++) { - this.last[i] = this.block[i]; - this.block[i] ^= this.prev[i]; - } - - for (let i = this.blockPos; i < this.blockSize; i++) - this.last[i] = this.prev[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= tmp[i]; - - const block = this.block.slice(0, this.blockPos); - - return Buffer.concat([this.last, block]); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.prev[i] = 0; - this.tmp[i] = 0; - } - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } -} - -/** - * XTS - */ - -class XTS extends Block$3 { - constructor(ctx, encrypt) { - super(ctx, true); - - this.encrypt = encrypt; - this.poly = polyTable[this.blockSize >>> 4]; - this.tweak = Buffer.alloc(this.blockSize); - this.prev = Buffer.alloc(this.blockSize); - } - - init(key, iv) { - assert$a(Buffer.isBuffer(key)); - assert$a(Buffer.isBuffer(iv)); - assert$a(key.length > 0 && (key.length & 1) === 0); - assert$a(iv.length === this.blockSize); - - const size = key.length >>> 1; - const k1 = key.slice(0, size); - const k2 = key.slice(size); - - if (safeEqual$1(k1, k2, size)) - throw new Error('XTS keys are equal.'); - - this.ctx.init(k2); - this.ctx.encrypt(this.tweak, 0, iv, 0); - - this.ctx.init(k1); - - this.blockPos = 0; - this.lastSize = 0; - - return this; - } - - _shift() { - let cy = 0; - - if (!this.encrypt) - this.tweak.copy(this.prev, 0); - - for (let i = 0; i < this.blockSize; i++) { - const c = this.tweak[i] >> 7; - - this.tweak[i] <<= 1; - this.tweak[i] |= cy; - - cy = c; - } - - cy = -cy & 0xff; - - this.tweak[2] ^= (this.poly >> 16) & cy; - this.tweak[1] ^= (this.poly >> 8) & cy; - this.tweak[0] ^= (this.poly >> 0) & cy; - } - - _update(output, opos, input, ipos) { - for (let i = 0; i < this.blockSize; i++) - output[opos + i] = input[ipos + i] ^ this.tweak[i]; - - if (this.encrypt) - this.ctx.encrypt(output, opos, output, opos); - else - this.ctx.decrypt(output, opos, output, opos); - - for (let i = 0; i < this.blockSize; i++) - output[opos + i] ^= this.tweak[i]; - - this._shift(); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.tweak[i] = 0; - this.prev[i] = 0; - } - } - - _setAutoPadding(padding) { - if (this.lastSize !== 0 || this.blockPos !== 0) - throw new Error('Cannot set auto padding.'); - - this.padding = padding; - this.unpad = padding; - } -} - -/* - * XTS Cipher - */ - -class XTSCipher extends XTS { - constructor(ctx) { - super(ctx, true); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad encrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad encrypt (no data).'); - - if (this.blockPos === 0) - return Buffer.from(this.last); - - // Use ciphertext stealing for partial blocks. - const out = Buffer.alloc(this.blockPos); - - for (let i = 0; i < this.blockPos; i++) { - out[i] = this.last[i]; - - this.last[i] = this.block[i]; - } - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - this.ctx.encrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - return Buffer.concat([this.last, out]); - } -} - -/* - * XTS Decipher - */ - -class XTSDecipher extends XTS { - constructor(ctx) { - super(ctx, false); - } - - _final() { - if (!this.padding) { - if (this.blockPos !== 0) - throw new Error('Bad decrypt (trailing bytes).'); - - return Buffer.alloc(0); - } - - if (this.lastSize === 0) - throw new Error('Bad decrypt (no data).'); - - if (this.blockPos === 0) - return Buffer.from(this.last); - - // Undo Block mode object's behavior of - // running _update on the last full block. - // Could avoid this somehow in the future. - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - this.ctx.encrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - // Recreate the last partial plaintext - // block (out) and the last ciphertext - // block (last). - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.tweak[i]; - - const out = Buffer.alloc(this.blockPos); - - for (let i = 0; i < this.blockPos; i++) { - out[i] = this.last[i]; - - this.last[i] = this.block[i]; - } - - // Now decrypt the last ciphertext block. - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - this.ctx.decrypt(this.last, 0, this.last, 0); - - for (let i = 0; i < this.blockSize; i++) - this.last[i] ^= this.prev[i]; - - return Buffer.concat([this.last, out]); - } -} - -/** - * CTR - */ - -class CTR extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - this.ctr = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - - iv.copy(this.ctr, 0); - } - - _increment() { - for (let i = this.ctr.length - 1; i >= 0; i--) { - this.ctr[i] += 1; - - if (this.ctr[i] !== 0x00) - break; - } - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - } - } -} - -/** - * CTR Cipher - */ - -class CTRCipher extends CTR { - constructor(ctx) { - super(ctx); - } -} - -/** - * CTR Decipher - */ - -class CTRDecipher extends CTR { - constructor(ctx) { - super(ctx); - } -} - -/** - * CFB - */ - -class CFB extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - this.prev = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(iv.length === this.blockSize); - - iv.copy(this.prev, 0); - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.prev[i] = 0; - } - } -} - -/** - * CFB Cipher - */ - -class CFBCipher extends CFB { - constructor(ctx) { - super(ctx); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.prev, 0); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos]; - - this.prev[this.pos] = output[i]; - - this.pos += 1; - } - } -} - -/** - * CFB Decipher - */ - -class CFBDecipher extends CFB { - constructor(ctx) { - super(ctx); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.prev, 0); - this.pos = 0; - } - - this.prev[this.pos] = input[i]; - - output[i] = input[i] ^ this.state[this.pos]; - - this.pos += 1; - } - } -} - -/** - * OFB - */ - -class OFB extends Stream { - constructor(ctx) { - super(ctx); - - this.state = Buffer.alloc(this.blockSize); - } - - _init(key, iv) { - assert$a(Buffer.isBuffer(iv)); - assert$a(iv.length === this.blockSize); - - iv.copy(this.state, 0); - } - - _crypt(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.state, 0); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _final() { - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) - this.state[i] = 0; - } -} - -/** - * OFB Cipher - */ - -class OFBCipher extends OFB { - constructor(ctx) { - super(ctx); - } -} - -/** - * OFB Decipher - */ - -class OFBDecipher extends OFB { - constructor(ctx) { - super(ctx); - } -} - -/** - * GCM - */ - -class GCM extends Stream { - constructor(ctx, encrypt) { - assert$a(ctx.blockSize === 16); - - super(ctx); - - this.encrypt = encrypt; - this.hash = new GHASH(); - this.ctr = Buffer.alloc(16); - this.state = Buffer.alloc(16); - this.key = Buffer.alloc(16); - this.mask = Buffer.alloc(16); - this.tag = null; - this.mac = null; - } - - _init(key, iv) { - for (let i = 0; i < 16; i++) { - this.ctr[i] = 0; - this.key[i] = 0; - this.mask[i] = 0; - } - - this._encipher(this.key, this.key); - - this.hash.init(this.key); - - // Full round of ghash with same key. - if (iv.length !== 12) { - this.hash.update(iv); - iv = this.hash.final(); - this.hash.init(this.key); - } - - iv.copy(this.ctr, 0); - - if (iv.length === 12) { - this.ctr[12] = 0x00; - this.ctr[13] = 0x00; - this.ctr[14] = 0x00; - this.ctr[15] = 0x01; - } - - this._encipher(this.mask, this.mask); - - this.tag = null; - this.mac = null; - - return this; - } - - _increment() { - let cy = 1; - let i = 4; - - while (i--) { - cy += this.ctr[12 + i]; - this.ctr[12 + i] = cy; - cy >>= 8; - } - } - - _encipher(output, input) { - for (let i = 0; i < input.length; i++) { - if ((this.pos & 15) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _crypt(output, input) { - if (this.encrypt) { - this._encipher(output, input); - this.hash.update(output); - } else { - this.hash.update(input); - this._encipher(output, input); - } - } - - _final() { - const mac = this.hash.final(); - - for (let i = 0; i < 16; i++) - mac[i] ^= this.mask[i]; - - if (this.encrypt) { - this.mac = mac; - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tag.length)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - this.hash.destroy(); - - for (let i = 0; i < 16; i++) { - this.ctr[i] = 0; - this.state[i] = 0; - this.key[i] = 0; - this.mask[i] = 0; - } - - if (this.tag) { - for (let i = 0; i < this.tag.length; i++) - this.tag[i] = 0; - - this.tag = null; - } - } - - _setAAD(data) { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this.hash.aad(data); - - return this; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (tag.length !== 4 && tag.length !== 8 - && (tag.length < 12 || tag.length > 16)) { - throw new RangeError('Invalid tag size.'); - } - - this.tag = Buffer.from(tag); - - return this; - } -} - -/** - * GCM Cipher - */ - -class GCMCipher extends GCM { - constructor(ctx) { - super(ctx, true); - } -} - -/** - * GCM Decipher - */ - -class GCMDecipher extends GCM { - constructor(ctx) { - super(ctx, false); - } -} - -/** - * CBC-MAC - */ - -class CBCMAC { - constructor(ctx) { - this.ctx = ctx; - this.size = ctx.blockSize; - this.mac = Buffer.alloc(this.size); - this.pos = -1; - } - - init() { - this.mac.fill(0); - this.pos = 0; - return this; - } - - update(data) { - assert$a(Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - this.mac[this.pos++] ^= data[i]; - - if (this.pos === this.size) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - } - } - - pad() { - if (this.pos > 0) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - } - - final() { - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - this.pad(); - this.pos = -1; - - return Buffer.from(this.mac); - } -} - -/** - * CCM - * https://tools.ietf.org/html/rfc3610 - */ - -class CCM extends Stream { - constructor(ctx, encrypt) { - assert$a(ctx.blockSize === 16); - - super(ctx); - - this.encrypt = encrypt; - this.hash = new CBCMAC(ctx); - this.state = Buffer.alloc(16); - this.ctr = Buffer.alloc(16); - this.tagLen = 0; - this.iv = null; - this.mac = null; - this.tag = null; - } - - _increment() { - for (let i = 15; i >= 1; i--) { - this.ctr[i] += 1; - - if (this.ctr[i] !== 0x00) - break; - } - } - - _encipher(output, input) { - for (let i = 0; i < input.length; i++) { - if ((this.pos & 15) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _init(key, iv) { - // sjcl compat: no upper limit on l(N). - if (iv.length < 7) - throw new RangeError('Invalid nonce length.'); - - if (iv.length > 13) - iv = iv.slice(0, 13); - - this.iv = Buffer.from(iv); - this.pos = -1; - this.tagLen = 0; - this.mac = null; - this.tag = null; - } - - _setCCM(msgLen, tagLen, aad) { - if (!this.iv) - throw new Error('Cipher is not initialized.'); - - // Compute L, M, and N. - let lm = msgLen; - let L = Math.ceil((32 - Math.clz32(lm)) / 8); - - if (L < 2) - L = 2; - - const M = tagLen; - const N = 15 - L; - const Adata = (aad && aad.length > 0) | 0; - const block = Buffer.alloc(16); - - if (M < 4 || M > 16 || (M & 1) !== 0) - throw new RangeError('Invalid tag length.'); - - // Compute flags. - block[0] = 64 * Adata + 8 * ((M - 2) / 2) + (L - 1); - - // sjcl compat: clamp nonces to 15-L. - this.iv.copy(block, 1, 0, Math.min(N, this.iv.length)); - - // Serialize message length. - for (let i = 15; i >= 1 + N; i--) { - block[i] = lm & 0xff; - lm >>>= 8; - } - - assert$a(lm === 0); - - this.hash.init(); - this.hash.update(block); - - if (Adata) { - if (aad.length < 0xff00) { - const buf = Buffer.alloc(2); - - buf[0] = aad.length >>> 8; - buf[1] = aad.length >>> 0; - - this.hash.update(buf); - } else if (aad.length < 0xffffffff) { - const buf = Buffer.alloc(6); - - buf[0] = 0xff; - buf[1] = 0xfe; - buf[2] = aad.length >>> 24; - buf[3] = aad.length >>> 16; - buf[4] = aad.length >>> 8; - buf[5] = aad.length >>> 0; - - this.hash.update(buf); - } else { - throw new RangeError('Invalid AAD length.'); - } - - this.hash.update(aad); - this.hash.pad(); - } - - block[0] &= 7; - block[15] = 1; - - for (let i = 14; i >= 1 + N; i--) - block[i] = 0; - - block.copy(this.ctr, 0); - - this.pos = 0; - this.tagLen = M; - this.iv = null; - } - - _crypt(output, input) { - if (this.encrypt) { - this.hash.update(input); - this._encipher(output, input); - } else { - this._encipher(output, input); - this.hash.update(output); - } - } - - _final() { - const mac = this.hash.final(); - - // Recreate S_0. - let i = 16 - ((this.ctr[0] & 7) + 1); - - while (i < 16) - this.ctr[i++] = 0; - - this.pos = 0; - this._encipher(mac, mac); - - if (this.encrypt) { - this.mac = mac.slice(0, this.tagLen); - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tagLen)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < 16; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - } - - this.tagLen = 0; - this.iv = null; - this.tag = null; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (this.tagLen === 0 || tag.length !== this.tagLen) - throw new RangeError('Invalid tag size.'); - - this.tag = Buffer.from(tag); - - return this; - } -} - -/** - * CCM Cipher - */ - -class CCMCipher extends CCM { - constructor(ctx) { - super(ctx, true); - } -} - -/** - * CCM Decipher - */ - -class CCMDecipher extends CCM { - constructor(ctx) { - super(ctx, false); - } -} - -/** - * CMAC - * https://tools.ietf.org/html/rfc4493 - */ - -class CMAC { - constructor(ctx) { - this.ctx = ctx; - this.poly = polyTable[ctx.blockSize >>> 4]; - this.size = ctx.blockSize; - this.mac = Buffer.alloc(this.size); - this.pos = -1; - } - - init(flag) { - this.mac.fill(0); - this.pos = 0; - - if (flag != null) { - this.mac[this.size - 1] ^= flag; - this.pos = this.size; - } - - return this; - } - - shift(dst, src) { - let cy = 0; - - for (let i = this.size - 1; i >= 0; i--) { - const c = src[i] >> 7; - - dst[i] = (src[i] << 1) | cy; - - cy = c; - } - - cy = -cy & 0xff; - - dst[this.size - 3] ^= (this.poly >> 16) & cy; - dst[this.size - 2] ^= (this.poly >> 8) & cy; - dst[this.size - 1] ^= (this.poly >> 0) & cy; - } - - update(data) { - assert$a(Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - if (this.pos === this.size) { - this.ctx.encrypt(this.mac, 0, this.mac, 0); - this.pos = 0; - } - - this.mac[this.pos++] ^= data[i]; - } - } - - final() { - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - const k = Buffer.alloc(this.size); - - this.ctx.encrypt(k, 0, k, 0); - - this.shift(k, k); - - if (this.pos < this.size) { - this.mac[this.pos] ^= 0x80; - this.shift(k, k); - } - - for (let i = 0; i < this.size; i++) - this.mac[i] ^= k[i]; - - this.ctx.encrypt(this.mac, 0, this.mac, 0); - - this.pos = -1; - - return Buffer.from(this.mac); - } -} - -/** - * EAX - */ - -class EAX extends Stream { - constructor(ctx, encrypt) { - super(ctx); - - this.encrypt = encrypt; - this.hash1 = new CMAC(ctx); - this.hash2 = new CMAC(ctx); - this.state = Buffer.alloc(this.blockSize); - this.ctr = Buffer.alloc(this.blockSize); - this.mask = Buffer.alloc(this.blockSize); - this.mac = null; - this.tag = null; - } - - _increment() { - let i = this.blockSize; - let cy = 1; - - while (i--) { - cy += this.ctr[i]; - this.ctr[i] = cy; - cy >>= 8; - } - } - - _encipher(output, input) { - const mask = this.blockSize - 1; - - for (let i = 0; i < input.length; i++) { - if ((this.pos & mask) === 0) { - this.ctx.encrypt(this.state, 0, this.ctr, 0); - this._increment(); - this.pos = 0; - } - - output[i] = input[i] ^ this.state[this.pos++]; - } - } - - _init(key, iv) { - assert$a(iv.length > 0); - - this.hash1.init(0); - this.hash1.update(iv); - - this.mask = this.hash1.final(); - this.mask.copy(this.ctr, 0); - - this.hash1.init(1); - this.hash2.init(2); - - this.mac = null; - this.tag = null; - } - - _crypt(output, input) { - if (this.encrypt) { - this._encipher(output, input); - this.hash2.update(output); - } else { - this.hash2.update(input); - this._encipher(output, input); - } - } - - _final() { - const mac = Buffer.alloc(this.blockSize); - const mac1 = this.hash1.final(); - const mac2 = this.hash2.final(); - - for (let i = 0; i < this.blockSize; i++) - mac[i] = mac1[i] ^ mac2[i] ^ this.mask[i]; - - if (this.encrypt) { - this.mac = mac; - return Buffer.alloc(0); - } - - if (!this.tag) - throw new Error('No tag provided.'); - - if (!safeEqual$1(mac, this.tag, this.tag.length)) - throw new Error('Invalid tag.'); - - return Buffer.alloc(0); - } - - _destroy() { - for (let i = 0; i < this.blockSize; i++) { - this.state[i] = 0; - this.ctr[i] = 0; - this.mask[i] = 0; - } - - this.tag = null; - } - - _setAAD(data) { - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - this.hash1.update(data); - - return this; - } - - _getAuthTag() { - if (!this.encrypt) - throw new Error('Must be a cipher context.'); - - if (!this.mac) - throw new Error('Cipher is not finalized.'); - - return Buffer.from(this.mac); - } - - _setAuthTag(tag) { - if (this.encrypt) - throw new Error('Must be a decipher context.'); - - if (this.pos === -1) - throw new Error('Cipher is not initialized.'); - - if (tag.length === 0 || tag.length > this.blockSize) - throw new RangeError('Invalid tag size.'); - - this.tag = Buffer.from(tag); - - return this; - } -} - -/** - * EAX Cipher - */ - -class EAXCipher extends EAX { - constructor(ctx) { - super(ctx, true); - } -} - -/** - * EAX Decipher - */ - -class EAXDecipher extends EAX { - constructor(ctx) { - super(ctx, false); - } -} - -/* - * Helpers - */ - -function get(name, encrypt = true) { - assert$a(typeof name === 'string'); - assert$a(typeof encrypt === 'boolean'); - - switch (name) { - case 'RAW': - return encrypt ? RawCipher : RawDecipher; - case 'ECB': - return encrypt ? ECBCipher : ECBDecipher; - case 'CBC': - return encrypt ? CBCCipher$1 : CBCDecipher$1; - case 'CTS': - return encrypt ? CTSCipher : CTSDecipher; - case 'XTS': - return encrypt ? XTSCipher : XTSDecipher; - case 'CTR': - return encrypt ? CTRCipher : CTRDecipher; - case 'CFB': - return encrypt ? CFBCipher : CFBDecipher; - case 'OFB': - return encrypt ? OFBCipher : OFBDecipher; - case 'GCM': - return encrypt ? GCMCipher : GCMDecipher; - case 'CCM': - return encrypt ? CCMCipher : CCMDecipher; - case 'EAX': - return encrypt ? EAXCipher : EAXDecipher; - default: - throw new Error(`Unknown mode: ${name}.`); - } -} - -function overlap(output, opos, input, ipos) { - return output.buffer === input.buffer - && output.byteOffset === input.byteOffset - && opos === ipos; -} - -function safeEqual$1(x, y, len) { - let z = 0; - - for (let i = 0; i < len; i++) - z |= x[i] ^ y[i]; - - return (z - 1) >>> 31; -} - -/* - * Expose - */ - -modes.Mode = Mode; -modes.Block = Block$3; -modes.Stream = Stream; -modes.RawCipher = RawCipher; -modes.RawDecipher = RawDecipher; -modes.PKCS7Cipher = PKCS7Cipher; -modes.PKCS7Decipher = PKCS7Decipher; -modes.ECBCipher = ECBCipher; -modes.ECBDecipher = ECBDecipher; -modes.CBCCipher = CBCCipher$1; -modes.CBCDecipher = CBCDecipher$1; -modes.CTSCipher = CTSCipher; -modes.CTSDecipher = CTSDecipher; -modes.XTS = XTS; -modes.XTSCipher = XTSCipher; -modes.XTSDecipher = XTSDecipher; -modes.CTR = CTR; -modes.CTRCipher = CTRCipher; -modes.CTRDecipher = CTRDecipher; -modes.CFB = CFB; -modes.CFBCipher = CFBCipher; -modes.CFBDecipher = CFBDecipher; -modes.OFB = OFB; -modes.OFBCipher = OFBCipher; -modes.OFBDecipher = OFBDecipher; -modes.GCM = GCM; -modes.GCMCipher = GCMCipher; -modes.GCMDecipher = GCMDecipher; -modes.CBCMAC = CBCMAC; -modes.CCM = CCM; -modes.CCMCipher = CCMCipher; -modes.CCMDecipher = CCMDecipher; -modes.CMAC = CMAC; -modes.EAX = EAX; -modes.EAXCipher = EAXCipher; -modes.EAXDecipher = EAXDecipher; -modes.get = get; - -/*! - * aes.js - aes128/192/256 for bcrypto - * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -const AES = aes$3; -const {CBCCipher, CBCDecipher} = modes; - -/** - * Encrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - -function encipher$1(data, key, iv) { - const ctx = new CBCCipher(new AES(256)); - ctx.init(key, iv); - return Buffer.concat([ctx.update(data), ctx.final()]); -} - -/** - * Decrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - -function decipher$1(data, key, iv) { - const ctx = new CBCDecipher(new AES(256)); - ctx.init(key, iv); - return Buffer.concat([ctx.update(data), ctx.final()]); -} - -/* - * Expose - */ - -aes$4.native = 0; -aes$4.encipher = encipher$1; -aes$4.decipher = decipher$1; - -var aes$2 = {}; - -/*! - * aes.js - aes for bcrypto - * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -const assert$9 = assert_1$d; -const binding = binding_1; - -/* - * Constants - */ - -const type = binding.ciphers.AES256; -const mode = binding.modes.CBC; - -/** - * Encrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - -function encipher(data, key, iv) { - assert$9(Buffer.isBuffer(data)); - assert$9(Buffer.isBuffer(key)); - assert$9(Buffer.isBuffer(iv)); - - const {buffer, length} = binding.cipher_encrypt(type, mode, key, iv, data); - - return Buffer.from(buffer, 0, length); -} - -/** - * Decrypt data with aes 256 cbc. - * @param {Buffer} data - * @param {Buffer} key - * @param {Buffer} iv - * @returns {Buffer} - */ - -function decipher(data, key, iv) { - assert$9(Buffer.isBuffer(data)); - assert$9(Buffer.isBuffer(key)); - assert$9(Buffer.isBuffer(iv)); - - const {buffer, length} = binding.cipher_decrypt(type, mode, key, iv, data); - - return Buffer.from(buffer, 0, length); -} - -/* - * Expose - */ - -aes$2.native = 2; -aes$2.encipher = encipher; -aes$2.decipher = decipher; - -/*! - * aes.js - aes for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -if (process.env.NODE_BACKEND === 'js') - aes$5.exports = aes$4; -else - aes$5.exports = aes$2; - -/*! - * masterkey.js - master bip32 key object for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$8 = assert_1$g; -const bio$3 = bufio; -const {Lock: Lock$3} = bmutex; -const random = random$9; -const cleanse$1 = cleanse$7.exports; -const aes$1 = aes$5.exports; -const sha256 = sha256$9.exports; -const hash256$1 = hash256$k.exports; -const secp256k1 = secp256k1$b.exports; -const pbkdf2 = pbkdf2$5.exports; -const scrypt = scrypt$3.exports; -const util$2 = util$y; -const HDPrivateKey = _private; -const Mnemonic$2 = mnemonic; -const {encoding: encoding$1} = bio$3; -const {inspectSymbol: inspectSymbol$2} = utils; - -/** - * Master Key - * Master BIP32 key which can exist - * in a timed out encrypted state. - * @alias module:wallet.MasterKey - */ - -class MasterKey$1 { - /** - * Create a master key. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - this.key = null; - this.mnemonic = null; - - this.alg = MasterKey$1.alg.PBKDF2; - this.n = 50000; - this.r = 0; - this.p = 0; - - this.aesKey = null; - this.timer = null; - this.until = 0; - this.locker = new Lock$3(); - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - assert$8(options); - - if (options.encrypted != null) { - assert$8(typeof options.encrypted === 'boolean'); - this.encrypted = options.encrypted; - } - - if (options.iv) { - assert$8(Buffer.isBuffer(options.iv)); - this.iv = options.iv; - } - - if (options.ciphertext) { - assert$8(Buffer.isBuffer(options.ciphertext)); - this.ciphertext = options.ciphertext; - } - - if (options.key) { - assert$8(HDPrivateKey.isHDPrivateKey(options.key)); - this.key = options.key; - } - - if (options.mnemonic) { - assert$8(options.mnemonic instanceof Mnemonic$2); - this.mnemonic = options.mnemonic; - } - - if (options.alg != null) { - if (typeof options.alg === 'string') { - this.alg = MasterKey$1.alg[options.alg.toUpperCase()]; - assert$8(this.alg != null, 'Unknown algorithm.'); - } else { - assert$8(typeof options.alg === 'number'); - assert$8(MasterKey$1.algByVal[options.alg]); - this.alg = options.alg; - } - } - - if (options.rounds != null) { - assert$8((options.rounds >>> 0) === options.rounds); - this.rounds = options.rounds; - } - - if (options.n != null) { - assert$8((options.n >>> 0) === options.n); - this.n = options.n; - } - - if (options.r != null) { - assert$8((options.r >>> 0) === options.r); - this.r = options.r; - } - - if (options.p != null) { - assert$8((options.p >>> 0) === options.p); - this.p = options.p; - } - - assert$8(this.encrypted ? !this.key : this.key); - - return this; - } - - /** - * Instantiate master key from options. - * @returns {MasterKey} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } - - /** - * Decrypt the key and set a timeout to destroy decrypted data. - * @param {Buffer|String} passphrase - Zero this yourself. - * @param {Number} [timeout=60000] timeout in ms. - * @returns {Promise} - Returns {@link HDPrivateKey}. - */ - - async unlock(passphrase, timeout) { - const _unlock = await this.locker.lock(); - try { - return await this._unlock(passphrase, timeout); - } finally { - _unlock(); - } - } - - /** - * Decrypt the key without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @param {Number} [timeout=60000] timeout in ms. - * @returns {Promise} - Returns {@link HDPrivateKey}. - */ - - async _unlock(passphrase, timeout) { - if (this.key) { - if (this.encrypted) { - assert$8(this.timer != null); - this.start(timeout); - } - return this.key; - } - - if (!passphrase) - throw new Error('No passphrase.'); - - assert$8(this.encrypted); - - const key = await this.derive(passphrase); - const data = aes$1.decipher(this.ciphertext, key, this.iv); - - this.readKey(data); - - this.start(timeout); - - this.aesKey = key; - - return this.key; - } - - /** - * Start the destroy timer. - * @private - * @param {Number} [timeout=60] timeout in seconds. - */ - - start(timeout) { - if (!timeout) - timeout = 60; - - this.stop(); - - if (timeout === -1) - return; - - assert$8((timeout >>> 0) === timeout); - - this.until = util$2.now() + timeout; - this.timer = setTimeout(() => this.lock(), timeout * 1000); - } - - /** - * Stop the destroy timer. - * @private - */ - - stop() { - if (this.timer != null) { - clearTimeout(this.timer); - this.timer = null; - this.until = 0; - } - } - - /** - * Derive an aes key based on params. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async derive(passwd) { - const salt = MasterKey$1.SALT; - const n = this.n; - const r = this.r; - const p = this.p; - - if (typeof passwd === 'string') - passwd = Buffer.from(passwd, 'utf8'); - - switch (this.alg) { - case MasterKey$1.alg.PBKDF2: - return pbkdf2.deriveAsync(sha256, passwd, salt, n, 32); - case MasterKey$1.alg.SCRYPT: - return scrypt.deriveAsync(passwd, salt, n, r, p, 32); - default: - throw new Error(`Unknown algorithm: ${this.alg}.`); - } - } - - /** - * Encrypt data with in-memory aes key. - * @param {Buffer} data - * @param {Buffer} iv - * @returns {Buffer} - */ - - encipher(data, iv) { - if (!this.aesKey) - return null; - - return aes$1.encipher(data, this.aesKey, iv.slice(0, 16)); - } - - /** - * Decrypt data with in-memory aes key. - * @param {Buffer} data - * @param {Buffer} iv - * @returns {Buffer} - */ - - decipher(data, iv) { - if (!this.aesKey) - return null; - - return aes$1.decipher(data, this.aesKey, iv.slice(0, 16)); - } - - /** - * Destroy the key by zeroing the - * privateKey and chainCode. Stop - * the timer if there is one. - * @returns {Promise} - */ - - async lock() { - const unlock = await this.locker.lock(); - try { - return await this._lock(); - } finally { - unlock(); - } - } - - /** - * Destroy the key by zeroing the - * privateKey and chainCode. Stop - * the timer if there is one. - */ - - _lock() { - if (!this.encrypted) { - assert$8(this.timer == null); - assert$8(this.key); - return; - } - - this.stop(); - - if (this.key) { - this.key.destroy(true); - this.key = null; - } - - if (this.aesKey) { - cleanse$1(this.aesKey); - this.aesKey = null; - } - } - - /** - * Destroy the key permanently. - */ - - async destroy() { - await this.lock(); - this.locker.destroy(); - } - - /** - * Decrypt the key permanently. - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async decrypt(passphrase, clean) { - const unlock = await this.locker.lock(); - try { - return await this._decrypt(passphrase, clean); - } finally { - unlock(); - } - } - - /** - * Decrypt the key permanently without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async _decrypt(passphrase, clean) { - if (!this.encrypted) - throw new Error('Master key is not encrypted.'); - - if (!passphrase) - throw new Error('No passphrase provided.'); - - this._lock(); - - const key = await this.derive(passphrase); - const data = aes$1.decipher(this.ciphertext, key, this.iv); - - this.readKey(data); - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - - if (!clean) { - cleanse$1(key); - return null; - } - - return key; - } - - /** - * Encrypt the key permanently. - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async encrypt(passphrase, clean) { - const unlock = await this.locker.lock(); - try { - return await this._encrypt(passphrase, clean); - } finally { - unlock(); - } - } - - /** - * Encrypt the key permanently without a lock. - * @private - * @param {Buffer|String} passphrase - Zero this yourself. - * @returns {Promise} - */ - - async _encrypt(passphrase, clean) { - if (this.encrypted) - throw new Error('Master key is already encrypted.'); - - if (!passphrase) - throw new Error('No passphrase provided.'); - - const raw = this.writeKey(); - const iv = random.randomBytes(16); - - this.stop(); - - const key = await this.derive(passphrase); - const data = aes$1.encipher(raw, key, iv); - - this.key = null; - this.mnemonic = null; - this.encrypted = true; - this.iv = iv; - this.ciphertext = data; - - if (!clean) { - cleanse$1(key); - return null; - } - - return key; - } - - /** - * Calculate key serialization size. - * @returns {Number} - */ - - keySize() { - let size = 0; - - size += 64; - size += 1; - - if (this.mnemonic) - size += this.mnemonic.getSize(); - - return size; - } - - /** - * Serialize key and menmonic to a single buffer. - * @returns {Buffer} - */ - - writeKey() { - const bw = bio$3.write(this.keySize()); - - bw.writeBytes(this.key.chainCode); - bw.writeBytes(this.key.privateKey); - - if (this.mnemonic) { - bw.writeU8(1); - this.mnemonic.toWriter(bw); - } else { - bw.writeU8(0); - } - - return bw.render(); - } - - /** - * Inject properties from serialized key. - * @param {Buffer} data - */ - - readKey(data) { - const br = bio$3.read(data); - - this.key = new HDPrivateKey(); - - if (isLegacy(data)) { - br.seek(13); - this.key.chainCode = br.readBytes(32); - assert$8(br.readU8() === 0); - this.key.privateKey = br.readBytes(32); - } else { - this.key.chainCode = br.readBytes(32); - this.key.privateKey = br.readBytes(32); - } - - this.key.publicKey = secp256k1.publicKeyCreate(this.key.privateKey, true); - - if (br.readU8() === 1) - this.mnemonic = Mnemonic$2.fromReader(br); - - return this; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - if (this.encrypted) { - size += 1; - size += encoding$1.sizeVarBytes(this.iv); - size += encoding$1.sizeVarBytes(this.ciphertext); - size += 13; - return size; - } - - size += 1; - size += this.keySize(); - - return size; - } - - /** - * Serialize the key in the form of: - * `[enc-flag][iv?][ciphertext?][extended-key?]` - * @returns {Buffer} - */ - - toWriter(bw) { - if (this.encrypted) { - bw.writeU8(1); - bw.writeVarBytes(this.iv); - bw.writeVarBytes(this.ciphertext); - - bw.writeU8(this.alg); - bw.writeU32(this.n); - bw.writeU32(this.r); - bw.writeU32(this.p); - - return bw; - } - - bw.writeU8(0); - - bw.writeBytes(this.key.chainCode); - bw.writeBytes(this.key.privateKey); - - if (this.mnemonic) { - bw.writeU8(1); - this.mnemonic.toWriter(bw); - } else { - bw.writeU8(0); - } - - return bw; - } - - /** - * Serialize the key in the form of: - * `[enc-flag][iv?][ciphertext?][extended-key?]` - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio$3.write(size)).render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} raw - */ - - fromReader(br) { - this.encrypted = br.readU8() === 1; - - if (this.encrypted) { - this.iv = br.readVarBytes(); - this.ciphertext = br.readVarBytes(); - - this.alg = br.readU8(); - - assert$8(this.alg < MasterKey$1.algByVal.length); - - this.n = br.readU32(); - this.r = br.readU32(); - this.p = br.readU32(); - - return this; - } - - this.key = new HDPrivateKey(); - this.key.chainCode = br.readBytes(32); - this.key.privateKey = br.readBytes(32); - this.key.publicKey = secp256k1.publicKeyCreate(this.key.privateKey, true); - - if (br.readU8() === 1) - this.mnemonic = Mnemonic$2.fromReader(br); - - return this; - } - - /** - * Instantiate master key from serialized data. - * @returns {MasterKey} - */ - - static fromReader(br) { - return new this().fromReader(br); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} raw - */ - - fromRaw(raw) { - return this.fromReader(bio$3.read(raw)); - } - - /** - * Instantiate master key from serialized data. - * @returns {MasterKey} - */ - - static fromRaw(raw) { - return new this().fromRaw(raw); - } - - /** - * Inject properties from an HDPrivateKey. - * @private - * @param {HDPrivateKey} key - * @param {Mnemonic?} mnemonic - */ - - fromKey(key, mnemonic) { - this.encrypted = false; - this.iv = null; - this.ciphertext = null; - this.key = key; - this.mnemonic = mnemonic || null; - return this; - } - - /** - * Instantiate master key from an HDPrivateKey. - * @param {HDPrivateKey} key - * @param {Mnemonic?} mnemonic - * @returns {MasterKey} - */ - - static fromKey(key, mnemonic) { - return new this().fromKey(key, mnemonic); - } - - /** - * Convert master key to a jsonifiable object. - * @param {Network?} network - * @param {Boolean?} unsafe - Whether to include - * the key data in the JSON. - * @returns {Object} - */ - - toJSON(network, unsafe) { - if (!this.key) { - return { - encrypted: true, - until: this.until, - iv: this.iv.toString('hex'), - ciphertext: unsafe ? this.ciphertext.toString('hex') : undefined, - algorithm: MasterKey$1.algByVal[this.alg].toLowerCase(), - n: this.n, - r: this.r, - p: this.p - }; - } - - return { - encrypted: false, - key: unsafe ? this.key.toJSON(network) : undefined, - mnemonic: unsafe && this.mnemonic ? this.mnemonic.toJSON() : undefined - }; - } - - /** - * Inspect the key. - * @returns {Object} - */ - - [inspectSymbol$2]() { - const json = this.toJSON(null, true); - - if (this.key) - json.key = this.key.toJSON(); - - if (this.mnemonic) - json.mnemonic = this.mnemonic.toJSON(); - - return json; - } - - /** - * Test whether an object is a MasterKey. - * @param {Object} obj - * @returns {Boolean} - */ - - static isMasterKey(obj) { - return obj instanceof MasterKey$1; - } -} - -/** - * Key derivation salt. - * @const {Buffer} - * @default - */ - -MasterKey$1.SALT = Buffer.from('bcoin', 'ascii'); - -/** - * Key derivation algorithms. - * @enum {Number} - * @default - */ - -MasterKey$1.alg = { - PBKDF2: 0, - SCRYPT: 1 -}; - -/** - * Key derivation algorithms by value. - * @enum {String} - * @default - */ - -MasterKey$1.algByVal = [ - 'PBKDF2', - 'SCRYPT' -]; - -/* - * Helpers - */ - -function isLegacy(data) { - if (data.length < 82) - return false; - - const key = data.slice(0, 78); - const chk = data.readUInt32LE(78, true); - - const hash = hash256$1.digest(key); - - return hash.readUInt32LE(0, true) === chk; -} - -/* - * Expose - */ - -var masterkey = MasterKey$1; - -/*! - * nodeclient.js - node client for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$7 = assert_1$g; -const AsyncEmitter = bevent; - -/** - * Node Client - * @alias module:node.NodeClient - */ - -class NodeClient extends AsyncEmitter { - /** - * Create a node client. - * @constructor - */ - - constructor(node) { - super(); - - this.node = node; - this.network = node.network; - this.filter = null; - this.opened = false; - - this.init(); - } - - /** - * Initialize the client. - */ - - init() { - this.node.chain.on('connect', async (entry, block) => { - if (!this.opened) - return; - - await this.emitAsync('block connect', entry, block.txs); - }); - - this.node.chain.on('disconnect', async (entry, block) => { - if (!this.opened) - return; - - await this.emitAsync('block disconnect', entry); - }); - - this.node.on('tx', (tx) => { - if (!this.opened) - return; - - this.emit('tx', tx); - }); - - this.node.on('reset', (tip) => { - if (!this.opened) - return; - - this.emit('chain reset', tip); - }); - } - - /** - * Open the client. - * @returns {Promise} - */ - - async open(options) { - assert$7(!this.opened, 'NodeClient is already open.'); - this.opened = true; - setImmediate(() => this.emit('connect')); - } - - /** - * Close the client. - * @returns {Promise} - */ - - async close() { - assert$7(this.opened, 'NodeClient is not open.'); - this.opened = false; - setImmediate(() => this.emit('disconnect')); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - bind(type, handler) { - return this.on(type, handler); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - hook(type, handler) { - return this.on(type, handler); - } - - /** - * Get chain tip. - * @returns {Promise} - */ - - async getTip() { - return this.node.chain.tip; - } - - /** - * Get chain entry. - * @param {Hash} hash - * @returns {Promise} - */ - - async getEntry(hash) { - const entry = await this.node.chain.getEntry(hash); - - if (!entry) - return null; - - if (!await this.node.chain.isMainChain(entry)) - return null; - - return entry; - } - - /** - * Send a transaction. Do not wait for promise. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - this.node.relay(tx); - } - - /** - * Set bloom filter. - * @param {Bloom} filter - * @returns {Promise} - */ - - async setFilter(filter) { - this.filter = filter; - this.node.pool.setFilter(filter); - } - - /** - * Add data to filter. - * @param {Buffer} data - * @returns {Promise} - */ - - async addFilter(data) { - this.node.pool.queueFilterLoad(); - } - - /** - * Reset filter. - * @returns {Promise} - */ - - async resetFilter() { - this.node.pool.queueFilterLoad(); - } - - /** - * Estimate smart fee. - * @param {Number?} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - if (!this.node.fees) - return {rate: this.network.feeRate}; - - const fee = this.node.fees.estimateFee(blocks); - return {rate: fee}; - } - - /** - * Get hash range. - * @param {Number} start - * @param {Number} end - * @returns {Promise} - */ - - async getHashes(start = -1, end = -1) { - return this.node.chain.getHashes(start, end); - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - async rescan(start) { - if (this.node.spv) - return this.node.chain.reset(start); - - return this.node.chain.scan(start, this.filter, (entry, txs) => { - return this.emitAsync('block rescan', entry, txs); - }); - } -} - -/* - * Expose - */ - -var nodeclient = NodeClient; - -var plugin = {}; - -var records$2 = {exports: {}}; - -/*! - * records.js - walletdb records - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -(function (module, exports) { - -/** - * @module wallet/records - */ - -const assert = assert_1$g; -const bio = bufio; -const util = util$y; -const TX = tx; -const consensus = consensus$s; - -/** - * Chain State - */ - -class ChainState { - /** - * Create a chain state. - * @constructor - */ - - constructor() { - this.startHeight = 0; - this.startHash = consensus.ZERO_HASH; - this.height = 0; - this.marked = false; - } - - /** - * Clone the state. - * @returns {ChainState} - */ - - clone() { - const state = new ChainState(); - state.startHeight = this.startHeight; - state.startHash = this.startHash; - state.height = this.height; - state.marked = this.marked; - return state; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.startHeight = br.readU32(); - this.startHash = br.readHash(); - this.height = br.readU32(); - this.marked = br.readU8() === 1; - - return this; - } - - /** - * Instantiate chain state from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {ChainState} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the chain state. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(41); - - bw.writeU32(this.startHeight); - bw.writeHash(this.startHash); - bw.writeU32(this.height); - bw.writeU8(this.marked ? 1 : 0); - - return bw.render(); - } -} - -/** - * Block Meta - */ - -class BlockMeta { - /** - * Create block meta. - * @constructor - * @param {Hash} hash - * @param {Number} height - * @param {Number} time - */ - - constructor(hash, height, time) { - this.hash = hash || consensus.ZERO_HASH; - this.height = height != null ? height : -1; - this.time = time || 0; - } - - /** - * Clone the block. - * @returns {BlockMeta} - */ - - clone() { - return new this.constructor(this.hash, this.height, this.time); - } - - /** - * Get block meta hash as a buffer. - * @returns {Buffer} - */ - - toHash() { - return this.hash; - } - - /** - * Instantiate block meta from chain entry. - * @private - * @param {ChainEntry} entry - */ - - fromEntry(entry) { - this.hash = entry.hash; - this.height = entry.height; - this.time = entry.time; - return this; - } - - /** - * Instantiate block meta from json object. - * @private - * @param {Object} json - */ - - fromJSON(json) { - this.hash = util.revHex(json.hash); - this.height = json.height; - this.time = json.time; - return this; - } - - /** - * Instantiate block meta from serialized tip data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - this.hash = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - return this; - } - - /** - * Instantiate block meta from chain entry. - * @param {ChainEntry} entry - * @returns {BlockMeta} - */ - - static fromEntry(entry) { - return new this().fromEntry(entry); - } - - /** - * Instantiate block meta from json object. - * @param {Object} json - * @returns {BlockMeta} - */ - - static fromJSON(json) { - return new this().fromJSON(json); - } - - /** - * Instantiate block meta from serialized data. - * @param {Hash} hash - * @param {Buffer} data - * @returns {BlockMeta} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Serialize the block meta. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio.write(42); - bw.writeHash(this.hash); - bw.writeU32(this.height); - bw.writeU32(this.time); - return bw.render(); - } - - /** - * Convert the block meta to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - hash: util.revHex(this.hash), - height: this.height, - time: this.time - }; - } -} - -/** - * TX Record - */ - -class TXRecord { - /** - * Create tx record. - * @constructor - * @param {TX} tx - * @param {BlockMeta?} block - */ - - constructor(tx, block) { - this.tx = null; - this.hash = null; - this.mtime = util.now(); - this.height = -1; - this.block = null; - this.index = -1; - this.time = 0; - - if (tx) - this.fromTX(tx, block); - } - - /** - * Inject properties from tx and block. - * @private - * @param {TX} tx - * @param {Block?} block - * @returns {TXRecord} - */ - - fromTX(tx, block) { - this.tx = tx; - this.hash = tx.hash(); - - if (block) - this.setBlock(block); - - return this; - } - - /** - * Instantiate tx record from tx and block. - * @param {TX} tx - * @param {Block?} block - * @returns {TXRecord} - */ - - static fromTX(tx, block) { - return new this().fromTX(tx, block); - } - - /** - * Set block data (confirm). - * @param {BlockMeta} block - */ - - setBlock(block) { - this.height = block.height; - this.block = block.hash; - this.time = block.time; - } - - /** - * Unset block (unconfirm). - */ - - unsetBlock() { - this.height = -1; - this.block = null; - this.time = 0; - } - - /** - * Convert tx record to a block meta. - * @returns {BlockMeta} - */ - - getBlock() { - if (this.height === -1) - return null; - - return new BlockMeta(this.block, this.height, this.time); - } - - /** - * Calculate current number of transaction confirmations. - * @param {Number} height - Current chain height. - * @returns {Number} confirmations - */ - - getDepth(height) { - assert(typeof height === 'number', 'Must pass in height.'); - - if (this.height === -1) - return 0; - - if (height < this.height) - return 0; - - return height - this.height + 1; - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - - size += this.tx.getSize(); - size += 4; - - if (this.block) { - size += 1; - size += 32; - size += 4 * 3; - } else { - size += 1; - } - - return size; - } - - /** - * Serialize a transaction to "extended format". - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio.write(size); - - let index = this.index; - - this.tx.toWriter(bw); - - bw.writeU32(this.mtime); - - if (this.block) { - if (index === -1) - index = 0x7fffffff; - - bw.writeU8(1); - bw.writeHash(this.block); - bw.writeU32(this.height); - bw.writeU32(this.time); - bw.writeU32(index); - } else { - bw.writeU8(0); - } - - return bw.render(); - } - - /** - * Inject properties from "extended" format. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio.read(data); - - this.tx = new TX(); - this.tx.fromReader(br); - - this.hash = this.tx.hash(); - this.mtime = br.readU32(); - - if (br.readU8() === 1) { - this.block = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - this.index = br.readU32(); - if (this.index === 0x7fffffff) - this.index = -1; - } - - return this; - } - - /** - * Instantiate a transaction from a buffer - * in "extended" serialization format. - * @param {Buffer} data - * @returns {TX} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } -} - -/** - * Map Record - */ - -class MapRecord { - /** - * Create map record. - * @constructor - */ - - constructor() { - this.wids = new Set(); - } - - add(wid) { - if (this.wids.has(wid)) - return false; - - this.wids.add(wid); - - return true; - } - - remove(wid) { - return this.wids.delete(wid); - } - - toWriter(bw) { - bw.writeU32(this.wids.size); - - for (const wid of this.wids) - bw.writeU32(wid); - - return bw; - } - - getSize() { - return 4 + this.wids.size * 4; - } - - toRaw() { - const size = this.getSize(); - return this.toWriter(bio.write(size)).render(); - } - - fromReader(br) { - const count = br.readU32(); - - for (let i = 0; i < count; i++) - this.wids.add(br.readU32()); - - return this; - } - - fromRaw(data) { - return this.fromReader(bio.read(data)); - } - - static fromReader(br) { - return new this().fromReader(br); - } - - static fromRaw(data) { - return new this().fromRaw(data); - } -} - -/* - * Expose - */ - -exports.ChainState = ChainState; -exports.BlockMeta = BlockMeta; -exports.TXRecord = TXRecord; -exports.MapRecord = MapRecord; - -module.exports = exports; -}(records$2, records$2.exports)); - -/*! - * txdb.js - persistent transaction pool - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$6 = assert_1$g; -const bio$2 = bufio; -const {BufferSet: BufferSet$2} = bufferMap; -const util$1 = util$y; -const Amount$1 = amount; -const CoinView = coinview; -const Coin$1 = coin; -const Outpoint$3 = outpoint; -const records$1 = records$2.exports; -const layout$1 = layout$2.txdb; -const consensus$2 = consensus$s; -const policy$1 = policy$9; -const {TXRecord: TXRecord$1} = records$1; -const {inspectSymbol: inspectSymbol$1} = utils; - -/** - * TXDB - * @alias module:wallet.TXDB - */ - -class TXDB$1 { - /** - * Create a TXDB. - * @constructor - * @param {WalletDB} wdb - */ - - constructor(wdb, wid) { - this.wdb = wdb; - this.db = wdb.db; - this.logger = wdb.logger; - - this.wid = wid || 0; - this.bucket = null; - this.wallet = null; - this.locked = new BufferSet$2(); - } - - /** - * Open TXDB. - * @returns {Promise} - */ - - async open(wallet) { - const prefix = layout$1.prefix.encode(wallet.wid); - - this.wid = wallet.wid; - this.bucket = this.db.bucket(prefix); - this.wallet = wallet; - } - - /** - * Emit transaction event. - * @private - * @param {String} event - * @param {Object} data - * @param {Details} details - */ - - emit(event, data, details) { - this.wdb.emit(event, this.wallet, data, details); - this.wallet.emit(event, data, details); - } - - /** - * Get wallet path for output. - * @param {Output} output - * @returns {Promise} - Returns {@link Path}. - */ - - getPath(output) { - const hash = output.getHash(); - - if (!hash) - return null; - - return this.wdb.getPath(this.wid, hash); - } - - /** - * Test whether path exists for output. - * @param {Output} output - * @returns {Promise} - Returns Boolean. - */ - - hasPath(output) { - const hash = output.getHash(); - - if (!hash) - return false; - - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Save credit. - * @param {Credit} credit - * @param {Path} path - */ - - async saveCredit(b, credit, path) { - const {coin} = credit; - - b.put(layout$1.c.encode(coin.hash, coin.index), credit.toRaw()); - b.put(layout$1.C.encode(path.account, coin.hash, coin.index), null); - - return this.addOutpointMap(b, coin.hash, coin.index); - } - - /** - * Remove credit. - * @param {Credit} credit - * @param {Path} path - */ - - async removeCredit(b, credit, path) { - const {coin} = credit; - - b.del(layout$1.c.encode(coin.hash, coin.index)); - b.del(layout$1.C.encode(path.account, coin.hash, coin.index)); - - return this.removeOutpointMap(b, coin.hash, coin.index); - } - - /** - * Spend credit. - * @param {Credit} credit - * @param {TX} tx - * @param {Number} index - */ - - spendCredit(b, credit, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.put(layout$1.s.encode(prevout.hash, prevout.index), spender.toRaw()); - b.put(layout$1.d.encode(spender.hash, spender.index), credit.coin.toRaw()); - } - - /** - * Unspend credit. - * @param {TX} tx - * @param {Number} index - */ - - unspendCredit(b, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.del(layout$1.s.encode(prevout.hash, prevout.index)); - b.del(layout$1.d.encode(spender.hash, spender.index)); - } - - /** - * Write input record. - * @param {TX} tx - * @param {Number} index - */ - - async writeInput(b, tx, index) { - const prevout = tx.inputs[index].prevout; - const spender = Outpoint$3.fromTX(tx, index); - b.put(layout$1.s.encode(prevout.hash, prevout.index), spender.toRaw()); - return this.addOutpointMap(b, prevout.hash, prevout.index); - } - - /** - * Remove input record. - * @param {TX} tx - * @param {Number} index - */ - - async removeInput(b, tx, index) { - const prevout = tx.inputs[index].prevout; - b.del(layout$1.s.encode(prevout.hash, prevout.index)); - return this.removeOutpointMap(b, prevout.hash, prevout.index); - } - - /** - * Update wallet balance. - * @param {BalanceDelta} state - */ - - async updateBalance(b, state) { - const balance = await this.getWalletBalance(); - state.applyTo(balance); - b.put(layout$1.R.encode(), balance.toRaw()); - return balance; - } - - /** - * Update account balance. - * @param {Number} acct - * @param {Balance} delta - */ - - async updateAccountBalance(b, acct, delta) { - const balance = await this.getAccountBalance(acct); - delta.applyTo(balance); - b.put(layout$1.r.encode(acct), balance.toRaw()); - return balance; - } - - /** - * Test a whether a coin has been spent. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns Boolean. - */ - - async getSpent(hash, index) { - const data = await this.bucket.get(layout$1.s.encode(hash, index)); - - if (!data) - return null; - - return Outpoint$3.fromRaw(data); - } - - /** - * Test a whether a coin has been spent. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns Boolean. - */ - - isSpent(hash, index) { - return this.bucket.has(layout$1.s.encode(hash, index)); - } - - /** - * Append to global map. - * @param {Number} height - * @returns {Promise} - */ - - addBlockMap(b, height) { - return this.wdb.addBlockMap(b.root(), height, this.wid); - } - - /** - * Remove from global map. - * @param {Number} height - * @returns {Promise} - */ - - removeBlockMap(b, height) { - return this.wdb.removeBlockMap(b.root(), height, this.wid); - } - - /** - * Append to global map. - * @param {Hash} hash - * @returns {Promise} - */ - - addTXMap(b, hash) { - return this.wdb.addTXMap(b.root(), hash, this.wid); - } - - /** - * Remove from global map. - * @param {Hash} hash - * @returns {Promise} - */ - - removeTXMap(b, hash) { - return this.wdb.removeTXMap(b.root(), hash, this.wid); - } - - /** - * Append to global map. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - */ - - addOutpointMap(b, hash, index) { - return this.wdb.addOutpointMap(b.root(), hash, index, this.wid); - } - - /** - * Remove from global map. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - */ - - removeOutpointMap(b, hash, index) { - return this.wdb.removeOutpointMap(b.root(), hash, index, this.wid); - } - - /** - * List block records. - * @returns {Promise} - */ - - getBlocks() { - return this.bucket.keys({ - gte: layout$1.b.min(), - lte: layout$1.b.max(), - parse: key => layout$1.b.decode(key)[0] - }); - } - - /** - * Get block record. - * @param {Number} height - * @returns {Promise} - */ - - async getBlock(height) { - const data = await this.bucket.get(layout$1.b.encode(height)); - - if (!data) - return null; - - return BlockRecord.fromRaw(data); - } - - /** - * Append to the global block record. - * @param {Hash} hash - * @param {BlockMeta} block - * @returns {Promise} - */ - - async addBlock(b, hash, block) { - const key = layout$1.b.encode(block.height); - const data = await this.bucket.get(key); - - if (!data) { - const blk = BlockRecord.fromMeta(block); - blk.add(hash); - b.put(key, blk.toRaw()); - return; - } - - const raw = Buffer.allocUnsafe(data.length + 32); - data.copy(raw, 0); - - const size = raw.readUInt32LE(40, true); - raw.writeUInt32LE(size + 1, 40, true); - hash.copy(raw, data.length); - - b.put(key, raw); - } - - /** - * Remove from the global block record. - * @param {Hash} hash - * @param {Number} height - * @returns {Promise} - */ - - async removeBlock(b, hash, height) { - const key = layout$1.b.encode(height); - const data = await this.bucket.get(key); - - if (!data) - return; - - const size = data.readUInt32LE(40, true); - - assert$6(size > 0); - assert$6(data.slice(-32).equals(hash)); - - if (size === 1) { - b.del(key); - return; - } - - const raw = data.slice(0, -32); - raw.writeUInt32LE(size - 1, 40, true); - - b.put(key, raw); - } - - /** - * Remove from the global block record. - * @param {Hash} hash - * @param {Number} height - * @returns {Promise} - */ - - async spliceBlock(b, hash, height) { - const block = await this.getBlock(height); - - if (!block) - return; - - if (!block.remove(hash)) - return; - - if (block.hashes.size === 0) { - b.del(layout$1.b.encode(height)); - return; - } - - b.put(layout$1.b.encode(height), block.toRaw()); - } - - /** - * Add transaction without a batch. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async add(tx, block) { - const hash = tx.hash(); - const existing = await this.getTX(hash); - - assert$6(!tx.mutable, 'Cannot add mutable TX to wallet.'); - - if (existing) { - // Existing tx is already confirmed. Ignore. - if (existing.height !== -1) - return null; - - // The incoming tx won't confirm the - // existing one anyway. Ignore. - if (!block) - return null; - - // Confirm transaction. - return this.confirm(existing, block); - } - - const wtx = TXRecord$1.fromTX(tx, block); - - if (!block) { - // Potentially remove double-spenders. - // Only remove if they're not confirmed. - if (!await this.removeConflicts(tx, true)) - return null; - } else { - // Potentially remove double-spenders. - await this.removeConflicts(tx, false); - } - - // Finally we can do a regular insertion. - return this.insert(wtx, block); - } - - /** - * Insert transaction. - * @private - * @param {TXRecord} wtx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async insert(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block ? block.height : -1; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - let own = false; - - if (!tx.isCoinbase()) { - // We need to potentially spend some coins here. - for (let i = 0; i < tx.inputs.length; i++) { - const input = tx.inputs[i]; - const {hash, index} = input.prevout; - const credit = await this.getCredit(hash, index); - - if (!credit) { - // Watch all inputs for incoming txs. - // This allows us to check for double spends. - if (!block) - await this.writeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - const path = await this.getPath(coin); - assert$6(path); - - // Build the tx details object - // as we go, for speed. - details.setInput(i, path, coin); - - // Write an undo coin for the credit - // and add it to the stxo set. - this.spendCredit(b, credit, tx, i); - - // Unconfirmed balance should always - // be updated as it reflects the on-chain - // balance _and_ mempool balance assuming - // everything in the mempool were to confirm. - state.tx(path, 1); - state.coin(path, -1); - state.unconfirmed(path, -coin.value); - - if (!block) { - // If the tx is not mined, we do not - // disconnect the coin, we simply mark - // a `spent` flag on the credit. This - // effectively prevents the mempool - // from altering our utxo state - // permanently. It also makes it - // possible to compare the on-chain - // state vs. the mempool state. - credit.spent = true; - await this.saveCredit(b, credit, path); - } else { - // If the tx is mined, we can safely - // remove the coin being spent. This - // coin will be indexed as an undo - // coin so it can be reconnected - // later during a reorg. - state.confirmed(path, -coin.value); - await this.removeCredit(b, credit, path); - } - - own = true; - } - } - - // Potentially add coins to the utxo set. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - const credit = Credit.fromTX(tx, i, height); - credit.own = own; - - state.tx(path, 1); - state.coin(path, 1); - state.unconfirmed(path, output.value); - - if (block) - state.confirmed(path, output.value); - - await this.saveCredit(b, credit, path); - } - - // If this didn't update any coins, - // it's not our transaction. - if (!state.updated()) - return null; - - // Save and index the transaction record. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.put(layout$1.m.encode(wtx.mtime, hash), null); - - if (!block) - b.put(layout$1.p.encode(hash), null); - else - b.put(layout$1.h.encode(height, hash), null); - - // Do some secondary indexing for account-based - // queries. This saves us a lot of time for - // queries later. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - - b.put(layout$1.T.encode(acct, hash), null); - b.put(layout$1.M.encode(acct, wtx.mtime, hash), null); - - if (!block) - b.put(layout$1.P.encode(acct, hash), null); - else - b.put(layout$1.H.encode(acct, height, hash), null); - } - - // Update block records. - if (block) { - await this.addBlockMap(b, height); - await this.addBlock(b, tx.hash(), block); - } else { - await this.addTXMap(b, hash); - } - - // Commit the new state. - const balance = await this.updateBalance(b, state); - - await b.write(); - - // This transaction may unlock some - // coins now that we've seen it. - this.unlockTX(tx); - - // Emit events for potential local and - // websocket listeners. Note that these - // will only be emitted if the batch is - // successfully written to disk. - this.emit('tx', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Attempt to confirm a transaction. - * @private - * @param {TXRecord} wtx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async confirm(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block.height; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - let own = false; - - wtx.setBlock(block); - - if (!tx.isCoinbase()) { - const credits = await this.getSpentCredits(tx); - - // Potentially spend coins. Now that the tx - // is mined, we can actually _remove_ coins - // from the utxo state. - for (let i = 0; i < tx.inputs.length; i++) { - const input = tx.inputs[i]; - const {hash, index} = input.prevout; - - let resolved = false; - - // There may be new credits available - // that we haven't seen yet. - if (!credits[i]) { - await this.removeInput(b, tx, i); - - const credit = await this.getCredit(hash, index); - - if (!credit) - continue; - - // Add a spend record and undo coin - // for the coin we now know is ours. - // We don't need to remove the coin - // since it was never added in the - // first place. - this.spendCredit(b, credit, tx, i); - - credits[i] = credit; - resolved = true; - } - - const credit = credits[i]; - const coin = credit.coin; - - assert$6(coin.height !== -1); - - const path = await this.getPath(coin); - assert$6(path); - own = true; - - details.setInput(i, path, coin); - - if (resolved) { - state.coin(path, -1); - state.unconfirmed(path, -coin.value); - } - - // We can now safely remove the credit - // entirely, now that we know it's also - // been removed on-chain. - state.confirmed(path, -coin.value); - - await this.removeCredit(b, credit, path); - } - } - - // Update credit heights, including undo coins. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - let credit = await this.getCredit(hash, i); - - if (!credit) { - // This credit didn't belong to us the first time we - // saw the transaction (before confirmation or rescan). - // Create new credit for database. - credit = Credit.fromTX(tx, i, height); - - // If this tx spent any of our own coins, we "own" this output, - // meaning if it becomes unconfirmed, we can still confidently spend it. - credit.own = own; - - // Add coin to "unconfirmed" balance (which includes confirmed coins) - state.coin(path, 1); - state.unconfirmed(path, credit.coin.value); - } - - // Credits spent in the mempool add an - // undo coin for ease. If this credit is - // spent in the mempool, we need to - // update the undo coin's height. - if (credit.spent) - await this.updateSpentCoin(b, tx, i, height); - - // Update coin height and confirmed - // balance. Save once again. - state.confirmed(path, output.value); - credit.coin.height = height; - - await this.saveCredit(b, credit, path); - } - - // Save the new serialized transaction as - // the block-related properties have been - // updated. Also reindex for height. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.del(layout$1.p.encode(hash)); - b.put(layout$1.h.encode(height, hash), null); - - // Secondary indexing also needs to change. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - b.del(layout$1.P.encode(acct, hash)); - b.put(layout$1.H.encode(acct, height, hash), null); - } - - await this.removeTXMap(b, hash); - await this.addBlockMap(b, height); - await this.addBlock(b, tx.hash(), block); - - // Commit the new state. The balance has updated. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.unlockTX(tx); - - this.emit('confirmed', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Recursively remove a transaction - * from the database. - * @param {Hash} hash - * @returns {Promise} - */ - - async remove(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - return this.removeRecursive(wtx); - } - - /** - * Remove a transaction from the - * database. Disconnect inputs. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async erase(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash} = wtx; - const height = block ? block.height : -1; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - if (!tx.isCoinbase()) { - // We need to undo every part of the - // state this transaction ever touched. - // Start by getting the undo coins. - const credits = await this.getSpentCredits(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const credit = credits[i]; - - if (!credit) { - if (!block) - await this.removeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - const path = await this.getPath(coin); - assert$6(path); - - details.setInput(i, path, coin); - - // Recalculate the balance, remove - // from stxo set, remove the undo - // coin, and resave the credit. - state.tx(path, -1); - state.coin(path, 1); - state.unconfirmed(path, coin.value); - - if (block) - state.confirmed(path, coin.value); - - this.unspendCredit(b, tx, i); - - credit.spent = false; - await this.saveCredit(b, credit, path); - } - } - - // We need to remove all credits - // this transaction created. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - details.setOutput(i, path); - - const credit = Credit.fromTX(tx, i, height); - - state.tx(path, -1); - state.coin(path, -1); - state.unconfirmed(path, -output.value); - - if (block) - state.confirmed(path, -output.value); - - await this.removeCredit(b, credit, path); - } - - // Remove the transaction data - // itself as well as unindex. - b.del(layout$1.t.encode(hash)); - b.del(layout$1.m.encode(wtx.mtime, hash)); - - if (!block) - b.del(layout$1.p.encode(hash)); - else - b.del(layout$1.h.encode(height, hash)); - - // Remove all secondary indexing. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - - b.del(layout$1.T.encode(acct, hash)); - b.del(layout$1.M.encode(acct, wtx.mtime, hash)); - - if (!block) - b.del(layout$1.P.encode(acct, hash)); - else - b.del(layout$1.H.encode(acct, height, hash)); - } - - // Update block records. - if (block) { - await this.removeBlockMap(b, height); - await this.spliceBlock(b, hash, height); - } else { - await this.removeTXMap(b, hash); - } - - // Update the transaction counter - // and commit new state due to - // balance change. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.emit('remove tx', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Remove a transaction and recursively - * remove all of its spenders. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async removeRecursive(wtx) { - const {tx, hash} = wtx; - - if (!await this.hasTX(hash)) - return null; - - for (let i = 0; i < tx.outputs.length; i++) { - const spent = await this.getSpent(hash, i); - - if (!spent) - continue; - - // Remove all of the spender's spenders first. - const stx = await this.getTX(spent.hash); - - assert$6(stx); - - await this.removeRecursive(stx); - } - - // Remove the spender. - return this.erase(wtx, wtx.getBlock()); - } - - /** - * Revert a block. - * @param {Number} height - * @returns {Promise} - */ - - async revert(height) { - const block = await this.getBlock(height); - - if (!block) - return 0; - - this.logger.debug('Rescan: reverting block %d', height); - const hashes = block.toArray(); - - for (let i = hashes.length - 1; i >= 0; i--) { - const hash = hashes[i]; - await this.unconfirm(hash); - } - - return hashes.length; - } - - /** - * Unconfirm a transaction without a batch. - * @private - * @param {Hash} hash - * @returns {Promise} - */ - - async unconfirm(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - if (wtx.height === -1) - return null; - - return this.disconnect(wtx, wtx.getBlock()); - } - - /** - * Unconfirm a transaction. Necessary after a reorg. - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async disconnect(wtx, block) { - const b = this.bucket.batch(); - const {tx, hash, height} = wtx; - const details = new Details(wtx, block); - const state = new BalanceDelta(); - - assert$6(block); - - wtx.unsetBlock(); - - if (!tx.isCoinbase()) { - // We need to reconnect the coins. Start - // by getting all of the undo coins we know - // about. - const credits = await this.getSpentCredits(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const credit = credits[i]; - - if (!credit) { - await this.writeInput(b, tx, i); - continue; - } - - const coin = credit.coin; - - assert$6(coin.height !== -1); - - const path = await this.getPath(coin); - assert$6(path); - - details.setInput(i, path, coin); - - state.confirmed(path, coin.value); - - // Resave the credit and mark it - // as spent in the mempool instead. - credit.spent = true; - await this.saveCredit(b, credit, path); - } - } - - // We need to remove heights on - // the credits and undo coins. - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - - if (!path) - continue; - - const credit = await this.getCredit(hash, i); - - // Potentially update undo coin height. - if (!credit) { - await this.updateSpentCoin(b, tx, i, height); - continue; - } - - if (credit.spent) - await this.updateSpentCoin(b, tx, i, height); - - details.setOutput(i, path); - - // Update coin height and confirmed - // balance. Save once again. - credit.coin.height = -1; - - state.confirmed(path, -output.value); - - await this.saveCredit(b, credit, path); - } - - await this.addTXMap(b, hash); - await this.removeBlockMap(b, height); - await this.removeBlock(b, tx.hash(), height); - - // We need to update the now-removed - // block properties and reindex due - // to the height change. - b.put(layout$1.t.encode(hash), wtx.toRaw()); - b.put(layout$1.p.encode(hash), null); - b.del(layout$1.h.encode(height, hash)); - - // Secondary indexing also needs to change. - for (const [acct, delta] of state.accounts) { - await this.updateAccountBalance(b, acct, delta); - b.put(layout$1.P.encode(acct, hash), null); - b.del(layout$1.H.encode(acct, height, hash)); - } - - // Commit state due to unconfirmed - // vs. confirmed balance change. - const balance = await this.updateBalance(b, state); - - await b.write(); - - this.emit('unconfirmed', tx, details); - this.emit('balance', balance); - - return details; - } - - /** - * Remove spenders that have not been confirmed. We do this in the - * odd case of stuck transactions or when a coin is double-spent - * by a newer transaction. All previously-spending transactions - * of that coin that are _not_ confirmed will be removed from - * the database. - * @private - * @param {Hash} hash - * @param {TX} ref - Reference tx, the tx that double-spent. - * @returns {Promise} - Returns Boolean. - */ - - async removeConflict(wtx) { - const tx = wtx.tx; - - this.logger.warning('Handling conflicting tx: %h.', tx.hash()); - - const details = await this.removeRecursive(wtx); - - if (!details) - return null; - - this.logger.warning('Removed conflict: %h.', tx.hash()); - - // Emit the _removed_ transaction. - this.emit('conflict', tx, details); - - return details; - } - - /** - * Retrieve coins for own inputs, remove - * double spenders, and verify inputs. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async removeConflicts(tx, conf) { - if (tx.isCoinbase()) - return true; - - const txid = tx.hash(); - const spends = []; - - // Gather all spent records first. - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - - // Is it already spent? - const spent = await this.getSpent(hash, index); - - if (!spent) - continue; - - // Did _we_ spend it? - if (spent.hash.equals(txid)) - continue; - - const spender = await this.getTX(spent.hash); - assert$6(spender); - - if (conf && spender.height !== -1) - return false; - - spends.push(spender); - } - - // Once we know we're not going to - // screw things up, remove the double - // spenders. - for (const spender of spends) { - // Remove the double spender. - await this.removeConflict(spender); - } - - return true; - } - - /** - * Lock all coins in a transaction. - * @param {TX} tx - */ - - lockTX(tx) { - if (tx.isCoinbase()) - return; - - for (const input of tx.inputs) - this.lockCoin(input.prevout); - } - - /** - * Unlock all coins in a transaction. - * @param {TX} tx - */ - - unlockTX(tx) { - if (tx.isCoinbase()) - return; - - for (const input of tx.inputs) - this.unlockCoin(input.prevout); - } - - /** - * Lock a single coin. - * @param {Coin|Outpoint} coin - */ - - lockCoin(coin) { - const key = coin.toKey(); - this.locked.add(key); - } - - /** - * Unlock a single coin. - * @param {Coin|Outpoint} coin - */ - - unlockCoin(coin) { - const key = coin.toKey(); - return this.locked.delete(key); - } - - /** - * Unlock all coins. - */ - - unlockCoins() { - for (const coin of this.getLocked()) - this.unlockCoin(coin); - } - - /** - * Test locked status of a single coin. - * @param {Coin|Outpoint} coin - */ - - isLocked(coin) { - const key = coin.toKey(); - return this.locked.has(key); - } - - /** - * Filter array of coins or outpoints - * for only unlocked ones. - * @param {Coin[]|Outpoint[]} - * @returns {Array} - */ - - filterLocked(coins) { - const out = []; - - for (const coin of coins) { - if (!this.isLocked(coin)) - out.push(coin); - } - - return out; - } - - /** - * Return an array of all locked outpoints. - * @returns {Outpoint[]} - */ - - getLocked() { - const outpoints = []; - - for (const key of this.locked.keys()) - outpoints.push(Outpoint$3.fromKey(key)); - - return outpoints; - } - - /** - * Get hashes of all transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountHistoryHashes(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.T.min(acct), - lte: layout$1.T.max(acct), - parse: (key) => { - const [, hash] = layout$1.T.decode(key); - return hash; - } - }); - } - - /** - * Get hashes of all transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHistoryHashes(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountHistoryHashes(acct); - - return this.bucket.keys({ - gte: layout$1.t.min(), - lte: layout$1.t.max(), - parse: key => layout$1.t.decode(key)[0] - }); - } - - /** - * Get hashes of all unconfirmed transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountPendingHashes(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.P.min(acct), - lte: layout$1.P.max(acct), - parse: (key) => { - const [, hash] = layout$1.P.decode(key); - return hash; - } - }); - } - - /** - * Get hashes of all unconfirmed transactions in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getPendingHashes(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountPendingHashes(acct); - - return this.bucket.keys({ - gte: layout$1.p.min(), - lte: layout$1.p.max(), - parse: key => layout$1.p.decode(key)[0] - }); - } - - /** - * Test whether the database has a pending transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasPending(hash) { - return this.bucket.has(layout$1.p.encode(hash)); - } - - /** - * Get all coin hashes in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountOutpoints(acct) { - assert$6(typeof acct === 'number'); - return this.bucket.keys({ - gte: layout$1.C.min(acct), - lte: layout$1.C.max(acct), - parse: (key) => { - const [, hash, index] = layout$1.C.decode(key); - return new Outpoint$3(hash, index); - } - }); - } - - /** - * Get all coin hashes in the database. - * @param {Number} acct - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getOutpoints(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountOutpoints(acct); - - return this.bucket.keys({ - gte: layout$1.c.min(), - lte: layout$1.c.max(), - parse: (key) => { - const [hash, index] = layout$1.c.decode(key); - return new Outpoint$3(hash, index); - } - }); - } - - /** - * Get TX hashes by height range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountHeightRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.H.min(acct, start), - lte: layout$1.H.max(acct, end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [,, hash] = layout$1.H.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by height range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHeightRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountHeightRangeHashes(acct, options); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.h.min(start), - lte: layout$1.h.max(end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [, hash] = layout$1.h.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by height. - * @param {Number} height - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getHeightHashes(height) { - return this.getHeightRangeHashes({ start: height, end: height }); - } - - /** - * Get TX hashes by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getAccountRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.M.min(acct, start), - lte: layout$1.M.max(acct, end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [,, hash] = layout$1.M.decode(key); - return hash; - } - }); - } - - /** - * Get TX hashes by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start height. - * @param {Number} options.end - End height. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link Hash}[]. - */ - - getRangeHashes(acct, options) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountRangeHashes(acct, options); - - const start = options.start || 0; - const end = options.end || 0xffffffff; - - return this.bucket.keys({ - gte: layout$1.m.min(start), - lte: layout$1.m.max(end), - limit: options.limit, - reverse: options.reverse, - parse: (key) => { - const [, hash] = layout$1.m.decode(key); - return hash; - } - }); - } - - /** - * Get transactions by timestamp range. - * @param {Number} acct - * @param {Object} options - * @param {Number} options.start - Start time. - * @param {Number} options.end - End time. - * @param {Number?} options.limit - Max number of records. - * @param {Boolean?} options.reverse - Reverse order. - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getRange(acct, options) { - const hashes = await this.getRangeHashes(acct, options); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get last N transactions. - * @param {Number} acct - * @param {Number} limit - Max number of transactions. - * @returns {Promise} - Returns {@link TX}[]. - */ - - getLast(acct, limit) { - return this.getRange(acct, { - start: 0, - end: 0xffffffff, - reverse: true, - limit: limit || 10 - }); - } - - /** - * Get all transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - getHistory(acct) { - assert$6(typeof acct === 'number'); - - // Slow case - if (acct !== -1) - return this.getAccountHistory(acct); - - // Fast case - return this.bucket.values({ - gte: layout$1.t.min(), - lte: layout$1.t.max(), - parse: data => TXRecord$1.fromRaw(data) - }); - } - - /** - * Get all acct transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getAccountHistory(acct) { - const hashes = await this.getHistoryHashes(acct); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get unconfirmed transactions. - * @param {Number} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getPending(acct) { - const hashes = await this.getPendingHashes(acct); - const txs = []; - - for (const hash of hashes) { - const tx = await this.getTX(hash); - assert$6(tx); - txs.push(tx); - } - - return txs; - } - - /** - * Get coins. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - getCredits(acct) { - assert$6(typeof acct === 'number'); - - // Slow case - if (acct !== -1) - return this.getAccountCredits(acct); - - // Fast case - return this.bucket.range({ - gte: layout$1.c.min(), - lte: layout$1.c.max(), - parse: (key, value) => { - const [hash, index] = layout$1.c.decode(key); - const credit = Credit.fromRaw(value); - credit.coin.hash = hash; - credit.coin.index = index; - return credit; - } - }); - } - - /** - * Get coins by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getAccountCredits(acct) { - const outpoints = await this.getOutpoints(acct); - const credits = []; - - for (const {hash, index} of outpoints) { - const credit = await this.getCredit(hash, index); - if (!credit) - continue; - credits.push(credit); - } - - return credits; - } - - /** - * Fill a transaction with coins (all historical coins). - * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. - */ - - async getSpentCredits(tx) { - if (tx.isCoinbase()) - return []; - - const hash = tx.hash(); - const credits = []; - - for (let i = 0; i < tx.inputs.length; i++) - credits.push(null); - - await this.bucket.range({ - gte: layout$1.d.min(hash), - lte: layout$1.d.max(hash), - parse: (key, value) => { - const [, index] = layout$1.d.decode(key); - const coin = Coin$1.fromRaw(value); - const input = tx.inputs[index]; - assert$6(input); - coin.hash = input.prevout.hash; - coin.index = input.prevout.index; - credits[index] = new Credit(coin); - } - }); - - return credits; - } - - /** - * Get coins. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getCoins(acct) { - const credits = await this.getCredits(acct); - const coins = []; - - for (const credit of credits) { - if (credit.spent) - continue; - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get coins by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getAccountCoins(acct) { - const credits = await this.getAccountCredits(acct); - const coins = []; - - for (const credit of credits) { - if (credit.spent) - continue; - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get historical coins for a transaction. - * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. - */ - - async getSpentCoins(tx) { - if (tx.isCoinbase()) - return []; - - const credits = await this.getSpentCredits(tx); - const coins = []; - - for (const credit of credits) { - if (!credit) { - coins.push(null); - continue; - } - - coins.push(credit.coin); - } - - return coins; - } - - /** - * Get a coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getCoinView(tx) { - const view = new CoinView(); - - if (tx.isCoinbase()) - return view; - - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - const coin = await this.getCoin(hash, index); - - if (!coin) - continue; - - view.addCoin(coin); - } - - return view; - } - - /** - * Get historical coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - async getSpentView(tx) { - const view = new CoinView(); - - if (tx.isCoinbase()) - return view; - - const coins = await this.getSpentCoins(tx); - - for (const coin of coins) { - if (!coin) - continue; - - view.addCoin(coin); - } - - return view; - } - - /** - * Get transaction. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - async getTX(hash) { - const raw = await this.bucket.get(layout$1.t.encode(hash)); - - if (!raw) - return null; - - return TXRecord$1.fromRaw(raw); - } - - /** - * Get transaction details. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TXDetails}. - */ - - async getDetails(hash) { - const wtx = await this.getTX(hash); - - if (!wtx) - return null; - - return this.toDetails(wtx); - } - - /** - * Convert transaction to transaction details. - * @param {TXRecord[]} wtxs - * @returns {Promise} - */ - - async toDetails(wtxs) { - const out = []; - - if (!Array.isArray(wtxs)) - return this._toDetails(wtxs); - - for (const wtx of wtxs) { - const details = await this._toDetails(wtx); - - if (!details) - continue; - - out.push(details); - } - - return out; - } - - /** - * Convert transaction to transaction details. - * @private - * @param {TXRecord} wtx - * @returns {Promise} - */ - - async _toDetails(wtx) { - const tx = wtx.tx; - const block = wtx.getBlock(); - const details = new Details(wtx, block); - const coins = await this.getSpentCoins(tx); - - for (let i = 0; i < tx.inputs.length; i++) { - const coin = coins[i]; - - let path = null; - - if (coin) - path = await this.getPath(coin); - - details.setInput(i, path, coin); - } - - for (let i = 0; i < tx.outputs.length; i++) { - const output = tx.outputs[i]; - const path = await this.getPath(output); - details.setOutput(i, path); - } - - return details; - } - - /** - * Test whether the database has a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - hasTX(hash) { - return this.bucket.has(layout$1.t.encode(hash)); - } - - /** - * Get coin. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCoin(hash, index) { - const credit = await this.getCredit(hash, index); - - if (!credit) - return null; - - return credit.coin; - } - - /** - * Get coin. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - async getCredit(hash, index) { - const data = await this.bucket.get(layout$1.c.encode(hash, index)); - - if (!data) - return null; - - const credit = Credit.fromRaw(data); - credit.coin.hash = hash; - credit.coin.index = index; - - return credit; - } - - /** - * Get spender coin. - * @param {Outpoint} spent - * @param {Outpoint} prevout - * @returns {Promise} - Returns {@link Coin}. - */ - - async getSpentCoin(spent, prevout) { - const data = await this.bucket.get(layout$1.d.encode( - spent.hash, - spent.index - )); - - if (!data) - return null; - - const coin = Coin$1.fromRaw(data); - coin.hash = prevout.hash; - coin.index = prevout.index; - - return coin; - } - - /** - * Test whether the database has a spent coin. - * @param {Outpoint} spent - * @returns {Promise} - Returns {@link Coin}. - */ - - hasSpentCoin(spent) { - return this.bucket.has(layout$1.d.encode(spent.hash, spent.index)); - } - - /** - * Update spent coin height in storage. - * @param {TX} tx - Sending transaction. - * @param {Number} index - * @param {Number} height - * @returns {Promise} - */ - - async updateSpentCoin(b, tx, index, height) { - const prevout = Outpoint$3.fromTX(tx, index); - const spent = await this.getSpent(prevout.hash, prevout.index); - - if (!spent) - return; - - const coin = await this.getSpentCoin(spent, prevout); - - if (!coin) - return; - - coin.height = height; - - b.put(layout$1.d.encode(spent.hash, spent.index), coin.toRaw()); - } - - /** - * Test whether the database has a transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - async hasCoin(hash, index) { - return this.bucket.has(layout$1.c.encode(hash, index)); - } - - /** - * Calculate balance. - * @param {Number?} account - * @returns {Promise} - Returns {@link Balance}. - */ - - async getBalance(acct) { - assert$6(typeof acct === 'number'); - - if (acct !== -1) - return this.getAccountBalance(acct); - - return this.getWalletBalance(); - } - - /** - * Calculate balance. - * @returns {Promise} - Returns {@link Balance}. - */ - - async getWalletBalance() { - const data = await this.bucket.get(layout$1.R.encode()); - - if (!data) - return new Balance(); - - return Balance.fromRaw(-1, data); - } - - /** - * Calculate balance by account. - * @param {Number} acct - * @returns {Promise} - Returns {@link Balance}. - */ - - async getAccountBalance(acct) { - const data = await this.bucket.get(layout$1.r.encode(acct)); - - if (!data) - return new Balance(acct); - - return Balance.fromRaw(acct, data); - } - - /** - * Zap pending transactions older than `age`. - * @param {Number} acct - * @param {Number} age - Age delta. - * @returns {Promise} - */ - - async zap(acct, age) { - assert$6((age >>> 0) === age); - - const now = util$1.now(); - - const txs = await this.getRange(acct, { - start: 0, - end: now - age - }); - - const hashes = []; - - for (const wtx of txs) { - if (wtx.height !== -1) - continue; - - assert$6(now - wtx.mtime >= age); - - this.logger.debug('Zapping TX: %h (%d)', - wtx.tx.hash(), this.wid); - - await this.remove(wtx.hash); - - hashes.push(wtx.hash); - } - - return hashes; - } - - /** - * Abandon transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async abandon(hash) { - const result = await this.bucket.has(layout$1.p.encode(hash)); - - if (!result) - throw new Error('TX not eligible.'); - - return this.remove(hash); - } -} - -/** - * Balance - * @alias module:wallet.Balance - */ - -class Balance { - /** - * Create a balance. - * @constructor - * @param {Number} account - */ - - constructor(acct = -1) { - assert$6(typeof acct === 'number'); - - this.account = acct; - this.tx = 0; - this.coin = 0; - this.unconfirmed = 0; - this.confirmed = 0; - } - - /** - * Apply delta. - * @param {Balance} balance - */ - - applyTo(balance) { - balance.tx += this.tx; - balance.coin += this.coin; - balance.unconfirmed += this.unconfirmed; - balance.confirmed += this.confirmed; - - assert$6(balance.tx >= 0); - assert$6(balance.coin >= 0); - assert$6(balance.unconfirmed >= 0); - assert$6(balance.confirmed >= 0); - } - - /** - * Serialize balance. - * @returns {Buffer} - */ - - toRaw() { - const bw = bio$2.write(32); - - bw.writeU64(this.tx); - bw.writeU64(this.coin); - bw.writeU64(this.unconfirmed); - bw.writeU64(this.confirmed); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - * @returns {TXDBState} - */ - - fromRaw(data) { - const br = bio$2.read(data); - this.tx = br.readU64(); - this.coin = br.readU64(); - this.unconfirmed = br.readU64(); - this.confirmed = br.readU64(); - return this; - } - - /** - * Instantiate balance from serialized data. - * @param {Number} acct - * @param {Buffer} data - * @returns {TXDBState} - */ - - static fromRaw(acct, data) { - return new this(acct).fromRaw(data); - } - - /** - * Convert balance to a more json-friendly object. - * @param {Boolean?} minimal - * @returns {Object} - */ - - toJSON(minimal) { - return { - account: !minimal ? this.account : undefined, - tx: this.tx, - coin: this.coin, - unconfirmed: this.unconfirmed, - confirmed: this.confirmed - }; - } - - /** - * Inspect balance. - * @param {String} - */ - - [inspectSymbol$1]() { - return ''; - } -} - -/** - * Balance Delta - * @ignore - */ - -class BalanceDelta { - /** - * Create a balance delta. - * @constructor - */ - - constructor() { - this.wallet = new Balance(); - this.accounts = new Map(); - } - - updated() { - return this.wallet.tx !== 0; - } - - applyTo(balance) { - this.wallet.applyTo(balance); - } - - get(path) { - if (!this.accounts.has(path.account)) - this.accounts.set(path.account, new Balance()); - - return this.accounts.get(path.account); - } - - tx(path, value) { - const account = this.get(path); - account.tx = value; - this.wallet.tx = value; - } - - coin(path, value) { - const account = this.get(path); - account.coin += value; - this.wallet.coin += value; - } - - unconfirmed(path, value) { - const account = this.get(path); - account.unconfirmed += value; - this.wallet.unconfirmed += value; - } - - confirmed(path, value) { - const account = this.get(path); - account.confirmed += value; - this.wallet.confirmed += value; - } -} - -/** - * Credit (wrapped coin) - * @alias module:wallet.Credit - * @property {Coin} coin - * @property {Boolean} spent - */ - -class Credit { - /** - * Create a credit. - * @constructor - * @param {Coin} coin - * @param {Boolean?} spent - */ - - constructor(coin, spent) { - this.coin = coin || new Coin$1(); - this.spent = spent || false; - this.own = false; - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$2.read(data); - this.coin.fromReader(br); - this.spent = br.readU8() === 1; - this.own = br.readU8() === 1; - return this; - } - - /** - * Instantiate credit from serialized data. - * @param {Buffer} data - * @returns {Credit} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - return this.coin.getSize() + 2; - } - - /** - * Serialize credit. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$2.write(size); - this.coin.toWriter(bw); - bw.writeU8(this.spent ? 1 : 0); - bw.writeU8(this.own ? 1 : 0); - return bw.render(); - } - - /** - * Inject properties from tx object. - * @private - * @param {TX} tx - * @param {Number} index - * @returns {Credit} - */ - - fromTX(tx, index, height) { - this.coin.fromTX(tx, index, height); - this.spent = false; - this.own = false; - return this; - } - - /** - * Instantiate credit from transaction. - * @param {TX} tx - * @param {Number} index - * @returns {Credit} - */ - - static fromTX(tx, index, height) { - return new this().fromTX(tx, index, height); - } -} - -/** - * Transaction Details - * @alias module:wallet.Details - */ - -class Details { - /** - * Create transaction details. - * @constructor - * @param {TXRecord} wtx - * @param {BlockMeta} block - */ - - constructor(wtx, block) { - this.hash = wtx.hash; - this.tx = wtx.tx; - this.mtime = wtx.mtime; - this.size = this.tx.getSize(); - this.vsize = this.tx.getVirtualSize(); - - this.block = null; - this.height = -1; - this.time = 0; - - if (block) { - this.block = block.hash; - this.height = block.height; - this.time = block.time; - } - - this.inputs = []; - this.outputs = []; - - this.init(); - } - - /** - * Initialize transaction details. - * @private - */ - - init() { - for (const input of this.tx.inputs) { - const member = new DetailsMember(); - member.address = input.getAddress(); - this.inputs.push(member); - } - - for (const output of this.tx.outputs) { - const member = new DetailsMember(); - member.value = output.value; - member.address = output.getAddress(); - this.outputs.push(member); - } - } - - /** - * Add necessary info to input member. - * @param {Number} i - * @param {Path} path - * @param {Coin} coin - */ - - setInput(i, path, coin) { - const member = this.inputs[i]; - - if (coin) { - member.value = coin.value; - member.address = coin.getAddress(); - } - - if (path) - member.path = path; - } - - /** - * Add necessary info to output member. - * @param {Number} i - * @param {Path} path - */ - - setOutput(i, path) { - const member = this.outputs[i]; - - if (path) - member.path = path; - } - - /** - * Calculate confirmations. - * @returns {Number} - */ - - getDepth(height) { - if (this.height === -1) - return 0; - - if (height == null) - return 0; - - const depth = height - this.height; - - if (depth < 0) - return 0; - - return depth + 1; - } - - /** - * Calculate fee. Only works if wallet - * owns all inputs. Returns 0 otherwise. - * @returns {Amount} - */ - - getFee() { - let inputValue = 0; - let outputValue = 0; - - for (const input of this.inputs) { - if (!input.path) - return 0; - - inputValue += input.value; - } - - for (const output of this.outputs) - outputValue += output.value; - - return inputValue - outputValue; - } - - /** - * Calculate fee rate. Only works if wallet - * owns all inputs. Returns 0 otherwise. - * @param {Amount} fee - * @returns {Rate} - */ - - getRate(fee) { - return policy$1.getRate(this.vsize, fee); - } - - /** - * Convert details to a more json-friendly object. - * @returns {Object} - */ - - toJSON(network, height) { - const fee = this.getFee(); - const rate = this.getRate(fee); - - return { - hash: util$1.revHex(this.hash), - height: this.height, - block: this.block ? util$1.revHex(this.block) : null, - time: this.time, - mtime: this.mtime, - date: util$1.date(this.time), - mdate: util$1.date(this.mtime), - size: this.size, - virtualSize: this.vsize, - fee: fee, - rate: rate, - confirmations: this.getDepth(height), - inputs: this.inputs.map((input) => { - return input.getJSON(network); - }), - outputs: this.outputs.map((output) => { - return output.getJSON(network); - }), - tx: this.tx.toRaw().toString('hex') - }; - } -} - -/** - * Transaction Details Member - * @property {Number} value - * @property {Address} address - * @property {Path} path - */ - -class DetailsMember { - /** - * Create details member. - * @constructor - */ - - constructor() { - this.value = 0; - this.address = null; - this.path = null; - } - - /** - * Convert the member to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return this.getJSON(); - } - - /** - * Convert the member to a more json-friendly object. - * @param {Network} network - * @returns {Object} - */ - - getJSON(network) { - return { - value: this.value, - address: this.address - ? this.address.toString(network) - : null, - path: this.path - ? this.path.toJSON() - : null - }; - } -} - -/** - * Block Record - * @alias module:wallet.BlockRecord - */ - -class BlockRecord { - /** - * Create a block record. - * @constructor - * @param {Hash} hash - * @param {Number} height - * @param {Number} time - */ - - constructor(hash, height, time) { - this.hash = hash || consensus$2.ZERO_HASH; - this.height = height != null ? height : -1; - this.time = time || 0; - this.hashes = new BufferSet$2(); - } - - /** - * Add transaction to block record. - * @param {Hash} hash - * @returns {Boolean} - */ - - add(hash) { - if (this.hashes.has(hash)) - return false; - - this.hashes.add(hash); - - return true; - } - - /** - * Remove transaction from block record. - * @param {Hash} hash - * @returns {Boolean} - */ - - remove(hash) { - return this.hashes.delete(hash); - } - - /** - * Instantiate wallet block from serialized tip data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$2.read(data); - - this.hash = br.readHash(); - this.height = br.readU32(); - this.time = br.readU32(); - - const count = br.readU32(); - - for (let i = 0; i < count; i++) { - const hash = br.readHash(); - this.hashes.add(hash); - } - - return this; - } - - /** - * Instantiate wallet block from serialized data. - * @param {Buffer} data - * @returns {BlockRecord} - */ - - static fromRaw(data) { - return new this().fromRaw(data); - } - - /** - * Get serialization size. - * @returns {Number} - */ - - getSize() { - return 44 + this.hashes.size * 32; - } - - /** - * Serialize the wallet block as a tip (hash and height). - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$2.write(size); - - bw.writeHash(this.hash); - bw.writeU32(this.height); - bw.writeU32(this.time); - - bw.writeU32(this.hashes.size); - - for (const hash of this.hashes) - bw.writeHash(hash); - - return bw.render(); - } - - /** - * Convert hashes set to an array. - * @returns {Hash[]} - */ - - toArray() { - const hashes = []; - for (const hash of this.hashes) - hashes.push(hash); - return hashes; - } - - /** - * Convert the block to a more json-friendly object. - * @returns {Object} - */ - - toJSON() { - return { - hash: util$1.revHex(this.hash), - height: this.height, - time: this.time, - hashes: this.toArray().map(util$1.revHex) - }; - } - - /** - * Instantiate wallet block from block meta. - * @private - * @param {BlockMeta} block - */ - - fromMeta(block) { - this.hash = block.hash; - this.height = block.height; - this.time = block.time; - return this; - } - - /** - * Instantiate wallet block from block meta. - * @param {BlockMeta} block - * @returns {BlockRecord} - */ - - static fromMeta(block) { - return new this().fromMeta(block); - } -} - -/* - * Expose - */ - -var txdb = TXDB$1; - -/*! - * wallet.js - wallet object for bcoin - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$5 = assert_1$g; -const EventEmitter$2 = require$$1$4; -const {Lock: Lock$2} = bmutex; -const base58 = base58$9.exports; -const bio$1 = bufio; -const hash160 = hash160$9.exports; -const hash256 = hash256$k.exports; -const cleanse = cleanse$7.exports; -const TXDB = txdb; -const Path$1 = path$3; -const common$2 = common$5; -const Address$2 = address$1; -const MTX$2 = mtx$1.exports; -const Script$5 = script$2; -const WalletKey = walletkey; -const HD = hd$1; -const Output$1 = output; -const Account$1 = account; -const MasterKey = masterkey; -const policy = policy$9; -const consensus$1 = consensus$s; -const {encoding} = bio$1; -const {Mnemonic: Mnemonic$1} = HD; -const {inspectSymbol} = utils; -const {BufferSet: BufferSet$1} = bufferMap; - -/** - * Wallet - * @alias module:wallet.Wallet - * @extends EventEmitter - */ - -class Wallet$4 extends EventEmitter$2 { - /** - * Create a wallet. - * @constructor - * @param {Object} options - */ - - constructor(wdb, options) { - super(); - - assert$5(wdb, 'WDB required.'); - - this.wdb = wdb; - this.db = wdb.db; - this.network = wdb.network; - this.logger = wdb.logger; - this.writeLock = new Lock$2(); - this.fundLock = new Lock$2(); - - this.wid = 0; - this.id = null; - this.watchOnly = false; - this.accountDepth = 0; - this.token = consensus$1.ZERO_HASH; - this.tokenDepth = 0; - this.master = new MasterKey(); - - this.txdb = new TXDB(this.wdb); - - this.maxAncestors = policy.MEMPOOL_MAX_ANCESTORS; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from options object. - * @private - * @param {Object} options - */ - - fromOptions(options) { - if (!options) - return this; - - let key = options.master; - let id, token, mnemonic; - - if (key) { - if (typeof key === 'string') - key = HD.PrivateKey.fromBase58(key, this.network); - - assert$5(HD.isPrivate(key), - 'Must create wallet with hd private key.'); - } else { - mnemonic = new Mnemonic$1(options.mnemonic); - key = HD.fromMnemonic(mnemonic, options.password); - } - - this.master.fromKey(key, mnemonic); - - if (options.wid != null) { - assert$5((options.wid >>> 0) === options.wid); - this.wid = options.wid; - } - - if (options.id) { - assert$5(common$2.isName(options.id), 'Bad wallet ID.'); - id = options.id; - } - - if (options.watchOnly != null) { - assert$5(typeof options.watchOnly === 'boolean'); - this.watchOnly = options.watchOnly; - } - - if (options.accountDepth != null) { - assert$5((options.accountDepth >>> 0) === options.accountDepth); - this.accountDepth = options.accountDepth; - } - - if (options.token) { - assert$5(Buffer.isBuffer(options.token)); - assert$5(options.token.length === 32); - token = options.token; - } - - if (options.tokenDepth != null) { - assert$5((options.tokenDepth >>> 0) === options.tokenDepth); - this.tokenDepth = options.tokenDepth; - } - - if (options.maxAncestors != null) { - assert$5((options.maxAncestors >>> 0) === options.maxAncestors); - this.maxAncestors = options.maxAncestors; - } - - if (!id) - id = this.getID(); - - if (!token) - token = this.getToken(this.tokenDepth); - - this.id = id; - this.token = token; - - return this; - } - - /** - * Instantiate wallet from options. - * @param {WalletDB} wdb - * @param {Object} options - * @returns {Wallet} - */ - - static fromOptions(wdb, options) { - return new this(wdb).fromOptions(options); - } - - /** - * Attempt to intialize the wallet (generating - * the first addresses along with the lookahead - * addresses). Called automatically from the - * walletdb. - * @returns {Promise} - */ - - async init(options, passphrase) { - if (passphrase) - await this.master.encrypt(passphrase); - - const account = await this._createAccount(options, passphrase); - assert$5(account); - - this.logger.info('Wallet initialized (%s).', this.id); - - return this.txdb.open(this); - } - - /** - * Open wallet (done after retrieval). - * @returns {Promise} - */ - - async open() { - const account = await this.getAccount(0); - - if (!account) - throw new Error('Default account not found.'); - - this.logger.info('Wallet opened (%s).', this.id); - - return this.txdb.open(this); - } - - /** - * Close the wallet, unregister with the database. - * @returns {Promise} - */ - - async destroy() { - const unlock1 = await this.writeLock.lock(); - const unlock2 = await this.fundLock.lock(); - try { - await this.master.destroy(); - this.writeLock.destroy(); - this.fundLock.destroy(); - } finally { - unlock2(); - unlock1(); - } - } - - /** - * Add a public account key to the wallet (multisig). - * Saves the key in the wallet database. - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async addSharedKey(acct, key) { - const unlock = await this.writeLock.lock(); - try { - return await this._addSharedKey(acct, key); - } finally { - unlock(); - } - } - - /** - * Add a public account key to the wallet without a lock. - * @private - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async _addSharedKey(acct, key) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const result = await account.addSharedKey(b, key); - await b.write(); - - return result; - } - - /** - * Remove a public account key from the wallet (multisig). - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async removeSharedKey(acct, key) { - const unlock = await this.writeLock.lock(); - try { - return await this._removeSharedKey(acct, key); - } finally { - unlock(); - } - } - - /** - * Remove a public account key from the wallet (multisig). - * @private - * @param {(Number|String)} acct - * @param {HDPublicKey} key - * @returns {Promise} - */ - - async _removeSharedKey(acct, key) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const result = await account.removeSharedKey(b, key); - await b.write(); - - return result; - } - - /** - * Change or set master key's passphrase. - * @param {String|Buffer} passphrase - * @param {String|Buffer} old - * @returns {Promise} - */ - - async setPassphrase(passphrase, old) { - if (old != null) - await this.decrypt(old); - - await this.encrypt(passphrase); - } - - /** - * Encrypt the wallet permanently. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async encrypt(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._encrypt(passphrase); - } finally { - unlock(); - } - } - - /** - * Encrypt the wallet permanently, without a lock. - * @private - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async _encrypt(passphrase) { - const key = await this.master.encrypt(passphrase, true); - const b = this.db.batch(); - - try { - await this.wdb.encryptKeys(b, this.wid, key); - } finally { - cleanse(key); - } - - this.save(b); - - await b.write(); - } - - /** - * Decrypt the wallet permanently. - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async decrypt(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._decrypt(passphrase); - } finally { - unlock(); - } - } - - /** - * Decrypt the wallet permanently, without a lock. - * @private - * @param {String|Buffer} passphrase - * @returns {Promise} - */ - - async _decrypt(passphrase) { - const key = await this.master.decrypt(passphrase, true); - const b = this.db.batch(); - - try { - await this.wdb.decryptKeys(b, this.wid, key); - } finally { - cleanse(key); - } - - this.save(b); - - await b.write(); - } - - /** - * Generate a new token. - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async retoken(passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._retoken(passphrase); - } finally { - unlock(); - } - } - - /** - * Generate a new token without a lock. - * @private - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _retoken(passphrase) { - if (passphrase) - await this.unlock(passphrase); - - this.tokenDepth += 1; - this.token = this.getToken(this.tokenDepth); - - const b = this.db.batch(); - this.save(b); - - await b.write(); - - return this.token; - } - - /** - * Rename the wallet. - * @param {String} id - * @returns {Promise} - */ - - async rename(id) { - const unlock = await this.writeLock.lock(); - try { - return await this.wdb.rename(this, id); - } finally { - unlock(); - } - } - - /** - * Rename account. - * @param {(String|Number)?} acct - * @param {String} name - * @returns {Promise} - */ - - async renameAccount(acct, name) { - const unlock = await this.writeLock.lock(); - try { - return await this._renameAccount(acct, name); - } finally { - unlock(); - } - } - - /** - * Rename account without a lock. - * @private - * @param {(String|Number)?} acct - * @param {String} name - * @returns {Promise} - */ - - async _renameAccount(acct, name) { - if (!common$2.isName(name)) - throw new Error('Bad account name.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.accountIndex === 0) - throw new Error('Cannot rename default account.'); - - if (await this.hasAccount(name)) - throw new Error('Account name not available.'); - - const b = this.db.batch(); - - this.wdb.renameAccount(b, account, name); - - await b.write(); - } - - /** - * Lock the wallet, destroy decrypted key. - */ - - async lock() { - const unlock1 = await this.writeLock.lock(); - const unlock2 = await this.fundLock.lock(); - try { - await this.master.lock(); - } finally { - unlock2(); - unlock1(); - } - } - - /** - * Unlock the key for `timeout` seconds. - * @param {Buffer|String} passphrase - * @param {Number?} [timeout=60] - */ - - unlock(passphrase, timeout) { - return this.master.unlock(passphrase, timeout); - } - - /** - * Generate the wallet ID if none was passed in. - * It is represented as HASH160(m/44->public|magic) - * converted to an "address" with a prefix - * of `0x03be04` (`WLT` in base58). - * @private - * @returns {Base58String} - */ - - getID() { - assert$5(this.master.key, 'Cannot derive id.'); - - const key = this.master.key.derive(44); - - const bw = bio$1.write(37); - bw.writeBytes(key.publicKey); - bw.writeU32(this.network.magic); - - const hash = hash160.digest(bw.render()); - - const b58 = bio$1.write(27); - b58.writeU8(0x03); - b58.writeU8(0xbe); - b58.writeU8(0x04); - b58.writeBytes(hash); - b58.writeChecksum(hash256.digest); - - return base58.encode(b58.render()); - } - - /** - * Generate the wallet api key if none was passed in. - * It is represented as HASH256(m/44'->private|nonce). - * @private - * @param {HDPrivateKey} master - * @param {Number} nonce - * @returns {Buffer} - */ - - getToken(nonce) { - if (!this.master.key) - throw new Error('Cannot derive token.'); - - const key = this.master.key.derive(44, true); - - const bw = bio$1.write(36); - bw.writeBytes(key.privateKey); - bw.writeU32(nonce); - - return hash256.digest(bw.render()); - } - - /** - * Create an account. Requires passphrase if master key is encrypted. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async createAccount(options, passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._createAccount(options, passphrase); - } finally { - unlock(); - } - } - - /** - * Create an account without a lock. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async _createAccount(options, passphrase) { - let name = options.name; - - if (!name) - name = this.accountDepth.toString(10); - - if (await this.hasAccount(name)) - throw new Error('Account already exists.'); - - await this.unlock(passphrase); - - let key; - if (this.watchOnly) { - key = options.accountKey; - - if (typeof key === 'string') - key = HD.PublicKey.fromBase58(key, this.network); - - if (!HD.isPublic(key)) - throw new Error('Must add HD public keys to watch only wallet.'); - } else { - assert$5(this.master.key); - const type = this.network.keyPrefix.coinType; - key = this.master.key.deriveAccount(44, type, this.accountDepth); - key = key.toPublic(); - } - - const opt = { - wid: this.wid, - id: this.id, - name: this.accountDepth === 0 ? 'default' : name, - witness: options.witness, - watchOnly: this.watchOnly, - accountKey: key, - accountIndex: this.accountDepth, - type: options.type, - m: options.m, - n: options.n, - keys: options.keys - }; - - const b = this.db.batch(); - - const account = Account$1.fromOptions(this.wdb, opt); - - await account.init(b); - - this.logger.info('Created account %s/%s/%d.', - account.id, - account.name, - account.accountIndex); - - this.accountDepth += 1; - this.save(b); - - if (this.accountDepth === 1) - this.increment(b); - - await b.write(); - - return account; - } - - /** - * Ensure an account. Requires passphrase if master key is encrypted. - * @param {Object} options - See {@link Account} options. - * @returns {Promise} - Returns {@link Account}. - */ - - async ensureAccount(options, passphrase) { - const name = options.name; - const account = await this.getAccount(name); - - if (account) - return account; - - return this.createAccount(options, passphrase); - } - - /** - * List account names and indexes from the db. - * @returns {Promise} - Returns Array. - */ - - getAccounts() { - return this.wdb.getAccounts(this.wid); - } - - /** - * Get all wallet address hashes. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns Array. - */ - - getAddressHashes(acct) { - if (acct != null) - return this.getAccountHashes(acct); - return this.wdb.getWalletHashes(this.wid); - } - - /** - * Get all account address hashes. - * @param {String|Number} acct - * @returns {Promise} - Returns Array. - */ - - async getAccountHashes(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - return this.wdb.getAccountHashes(this.wid, index); - } - - /** - * Retrieve an account from the database. - * @param {Number|String} acct - * @returns {Promise} - Returns {@link Account}. - */ - - async getAccount(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - return null; - - const account = await this.wdb.getAccount(this.wid, index); - - if (!account) - return null; - - account.wid = this.wid; - account.id = this.id; - account.watchOnly = this.watchOnly; - - return account; - } - - /** - * Lookup the corresponding account name's index. - * @param {String|Number} acct - Account name/index. - * @returns {Promise} - Returns Number. - */ - - getAccountIndex(acct) { - if (acct == null) - return -1; - - if (typeof acct === 'number') - return acct; - - return this.wdb.getAccountIndex(this.wid, acct); - } - - /** - * Lookup the corresponding account name's index. - * @param {String|Number} acct - Account name/index. - * @returns {Promise} - Returns Number. - * @throws on non-existent account - */ - - async ensureIndex(acct) { - if (acct == null || acct === -1) - return -1; - - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - return index; - } - - /** - * Lookup the corresponding account index's name. - * @param {Number} index - Account index. - * @returns {Promise} - Returns String. - */ - - async getAccountName(index) { - if (typeof index === 'string') - return index; - - return this.wdb.getAccountName(this.wid, index); - } - - /** - * Test whether an account exists. - * @param {Number|String} acct - * @returns {Promise} - Returns {@link Boolean}. - */ - - async hasAccount(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - return false; - - return this.wdb.hasAccount(this.wid, index); - } - - /** - * Create a new receiving address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createReceive(acct = 0) { - return this.createKey(acct, 0); - } - - /** - * Create a new change address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createChange(acct = 0) { - return this.createKey(acct, 1); - } - - /** - * Create a new nested address (increments receiveDepth). - * @param {(Number|String)?} acct - * @returns {Promise} - Returns {@link WalletKey}. - */ - - createNested(acct = 0) { - return this.createKey(acct, 2); - } - - /** - * Create a new address (increments depth). - * @param {(Number|String)?} acct - * @param {Number} branch - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async createKey(acct, branch) { - const unlock = await this.writeLock.lock(); - try { - return await this._createKey(acct, branch); - } finally { - unlock(); - } - } - - /** - * Create a new address (increments depth) without a lock. - * @private - * @param {(Number|String)?} acct - * @param {Number} branch - * @returns {Promise} - Returns {@link WalletKey}. - */ - - async _createKey(acct, branch) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - const key = await account.createKey(b, branch); - await b.write(); - - return key; - } - - /** - * Save the wallet to the database. Necessary - * when address depth and keys change. - * @returns {Promise} - */ - - save(b) { - return this.wdb.save(b, this); - } - - /** - * Increment the wid depth. - * @returns {Promise} - */ - - increment(b) { - return this.wdb.increment(b, this.wid); - } - - /** - * Test whether the wallet possesses an address. - * @param {Address|Hash} address - * @returns {Promise} - Returns Boolean. - */ - - async hasAddress(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - return path != null; - } - - /** - * Get path by address hash. - * @param {Address|Hash} address - * @returns {Promise} - Returns {@link Path}. - */ - - async getPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.getPath(this.wid, hash); - } - - /** - * Get path by address hash (without account name). - * @private - * @param {Address|Hash} address - * @returns {Promise} - Returns {@link Path}. - */ - - async readPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.readPath(this.wid, hash); - } - - /** - * Test whether the wallet contains a path. - * @param {Address|Hash} address - * @returns {Promise} - Returns {Boolean}. - */ - - async hasPath(address) { - const hash = Address$2.getHash(address); - return this.wdb.hasPath(this.wid, hash); - } - - /** - * Get all wallet paths. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link Path}. - */ - - async getPaths(acct) { - if (acct != null) - return this.getAccountPaths(acct); - - return this.wdb.getWalletPaths(this.wid); - } - - /** - * Get all account paths. - * @param {String|Number} acct - * @returns {Promise} - Returns {@link Path}. - */ - - async getAccountPaths(acct) { - const index = await this.getAccountIndex(acct); - - if (index === -1) - throw new Error('Account not found.'); - - const hashes = await this.getAccountHashes(index); - const name = await this.getAccountName(acct); - - assert$5(name); - - const result = []; - - for (const hash of hashes) { - const path = await this.readPath(hash); - - assert$5(path); - assert$5(path.account === index); - - path.name = name; - - result.push(path); - } - - return result; - } - - /** - * Import a keyring (will not exist on derivation chain). - * Rescanning must be invoked manually. - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async importKey(acct, ring, passphrase) { - const unlock = await this.writeLock.lock(); - try { - return await this._importKey(acct, ring, passphrase); - } finally { - unlock(); - } - } - - /** - * Import a keyring (will not exist on derivation chain) without a lock. - * @private - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _importKey(acct, ring, passphrase) { - if (!this.watchOnly) { - if (!ring.privateKey) - throw new Error('Cannot import pubkey into non watch-only wallet.'); - } else { - if (ring.privateKey) - throw new Error('Cannot import privkey into watch-only wallet.'); - } - - const hash = ring.getHash(); - - if (await this.getPath(hash)) - throw new Error('Key already exists.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.type !== Account$1.types.PUBKEYHASH) - throw new Error('Cannot import into non-pkh account.'); - - await this.unlock(passphrase); - - const key = WalletKey.fromRing(account, ring); - const path = key.toPath(); - - if (this.master.encrypted) { - path.data = this.master.encipher(path.data, path.hash); - assert$5(path.data); - path.encrypted = true; - } - - const b = this.db.batch(); - await account.savePath(b, path); - await b.write(); - } - - /** - * Import a keyring (will not exist on derivation chain). - * Rescanning must be invoked manually. - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async importAddress(acct, address) { - const unlock = await this.writeLock.lock(); - try { - return await this._importAddress(acct, address); - } finally { - unlock(); - } - } - - /** - * Import a keyring (will not exist on derivation chain) without a lock. - * @private - * @param {(String|Number)?} acct - * @param {WalletKey} ring - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - */ - - async _importAddress(acct, address) { - if (!this.watchOnly) - throw new Error('Cannot import address into non watch-only wallet.'); - - if (await this.getPath(address)) - throw new Error('Address already exists.'); - - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - if (account.type !== Account$1.types.PUBKEYHASH) - throw new Error('Cannot import into non-pkh account.'); - - const path = Path$1.fromAddress(account, address); - - const b = this.db.batch(); - await account.savePath(b, path); - await b.write(); - } - - /** - * Fill a transaction with inputs, estimate - * transaction size, calculate fee, and add a change output. - * @see MTX#selectCoins - * @see MTX#fill - * @param {MTX} mtx - _Must_ be a mutable transaction. - * @param {Object?} options - * @param {(String|Number)?} options.account - If no account is - * specified, coins from the entire wallet will be filled. - * @param {String?} options.selection - Coin selection priority. Can - * be `age`, `random`, or `all`. (default=age). - * @param {Boolean} options.round - Whether to round to the nearest - * kilobyte for fee calculation. - * See {@link TX#getMinFee} vs. {@link TX#getRoundFee}. - * @param {Rate} options.rate - Rate used for fee calculation. - * @param {Boolean} options.confirmed - Select only confirmed coins. - * @param {Boolean} options.free - Do not apply a fee if the - * transaction priority is high enough to be considered free. - * @param {Amount?} options.hardFee - Use a hard fee rather than - * calculating one. - * @param {Number|Boolean} options.subtractFee - Whether to subtract the - * fee from existing outputs rather than adding more inputs. - */ - - async fund(mtx, options, force) { - const unlock = await this.fundLock.lock(force); - try { - return await this._fund(mtx, options); - } finally { - unlock(); - } - } - - /** - * Fill a transaction with inputs without a lock. - * @private - * @see MTX#selectCoins - * @see MTX#fill - */ - - async _fund(mtx, options) { - if (!options) - options = {}; - - const acct = options.account || 0; - const change = await this.changeAddress(acct); - - if (!change) - throw new Error('Account not found.'); - - let rate = options.rate; - if (rate == null) - rate = await this.wdb.estimateFee(options.blocks); - - let coins; - if (options.smart) { - coins = await this.getSmartCoins(options.account); - } else { - coins = await this.getCoins(options.account); - coins = this.txdb.filterLocked(coins); - } - - await mtx.fund(coins, { - selection: options.selection, - round: options.round, - depth: options.depth, - hardFee: options.hardFee, - subtractFee: options.subtractFee, - subtractIndex: options.subtractIndex, - changeAddress: change, - height: this.wdb.state.height, - rate: rate, - maxFee: options.maxFee, - estimate: prev => this.estimateSize(prev) - }); - - assert$5(mtx.getFee() <= MTX$2.Selector.MAX_FEE, 'TX exceeds MAX_FEE.'); - } - - /** - * Get account by address. - * @param {Address} address - * @returns {Account} - */ - - async getAccountByAddress(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - return this.getAccount(path.account); - } - - /** - * Input size estimator for max possible tx size. - * @param {Script} prev - * @returns {Number} - */ - - async estimateSize(prev) { - const scale = consensus$1.WITNESS_SCALE_FACTOR; - const address = prev.getAddress(); - - if (!address) - return -1; - - const account = await this.getAccountByAddress(address); - - if (!account) - return -1; - - let size = 0; - - if (prev.isScripthash()) { - // Nested bullshit. - if (account.witness) { - switch (account.type) { - case Account$1.types.PUBKEYHASH: - size += 23; // redeem script - size *= 4; // vsize - break; - case Account$1.types.MULTISIG: - size += 35; // redeem script - size *= 4; // vsize - break; - } - } - } - - switch (account.type) { - case Account$1.types.PUBKEYHASH: - // P2PKH - // OP_PUSHDATA0 [signature] - size += 1 + 73; - // OP_PUSHDATA0 [key] - size += 1 + 33; - break; - case Account$1.types.MULTISIG: - // P2SH Multisig - // OP_0 - size += 1; - // OP_PUSHDATA0 [signature] ... - size += (1 + 73) * account.m; - // OP_PUSHDATA2 [redeem] - size += 3; - // m value - size += 1; - // OP_PUSHDATA0 [key] ... - size += (1 + 33) * account.n; - // n value - size += 1; - // OP_CHECKMULTISIG - size += 1; - break; - } - - if (account.witness) { - // Varint witness items length. - size += 1; - // Calculate vsize if - // we're a witness program. - size = (size + scale - 1) / scale | 0; - } else { - // Byte for varint - // size of input script. - size += encoding.sizeVarint(size); - } - - return size; - } - - /** - * Build a transaction, fill it with outputs and inputs, - * sort the members according to BIP69 (set options.sort=false - * to avoid sorting), set locktime, and template it. - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @param {Boolean} options.sort - Sort inputs and outputs (BIP69). - * @param {Boolean} options.template - Build scripts for inputs. - * @param {Number} options.locktime - TX locktime - * @returns {Promise} - Returns {@link MTX}. - */ - - async createTX(options, force) { - const outputs = options.outputs; - const mtx = new MTX$2(); - - assert$5(Array.isArray(outputs), 'Outputs must be an array.'); - assert$5(outputs.length > 0, 'At least one output required.'); - - // Add the outputs - for (const obj of outputs) { - const output = new Output$1(obj); - const addr = output.getAddress(); - - if (output.isDust()) - throw new Error('Output is dust.'); - - if (output.value > 0) { - if (!addr) - throw new Error('Cannot send to unknown address.'); - - if (addr.isNull()) - throw new Error('Cannot send to null address.'); - } - - mtx.outputs.push(output); - } - - // Fill the inputs with unspents - await this.fund(mtx, options, force); - - // Sort members a la BIP69 - if (options.sort !== false) - mtx.sortMembers(); - - // Set the locktime to target value. - if (options.locktime != null) - mtx.setLocktime(options.locktime); - - // Consensus sanity checks. - assert$5(mtx.isSane(), 'TX failed sanity check.'); - assert$5(mtx.verifyInputs(this.wdb.state.height + 1), - 'TX failed context check.'); - - if (options.template === false) - return mtx; - - const total = await this.template(mtx); - - if (total === 0) - throw new Error('Templating failed.'); - - return mtx; - } - - /** - * Build a transaction, fill it with outputs and inputs, - * sort the members according to BIP69, set locktime, - * sign and broadcast. Doing this all in one go prevents - * coins from being double spent. - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @returns {Promise} - Returns {@link TX}. - */ - - async send(options, passphrase) { - const unlock = await this.fundLock.lock(); - try { - return await this._send(options, passphrase); - } finally { - unlock(); - } - } - - /** - * Build and send a transaction without a lock. - * @private - * @param {Object} options - See {@link Wallet#fund options}. - * @param {Object[]} options.outputs - See {@link MTX#addOutput}. - * @returns {Promise} - Returns {@link TX}. - */ - - async _send(options, passphrase) { - const mtx = await this.createTX(options, true); - - await this.sign(mtx, passphrase); - - if (!mtx.isSigned()) - throw new Error('TX could not be fully signed.'); - - const tx = mtx.toTX(); - - // Policy sanity checks. - if (tx.getSigopsCost(mtx.view) > policy.MAX_TX_SIGOPS_COST) - throw new Error('TX exceeds policy sigops.'); - - if (tx.getWeight() > policy.MAX_TX_WEIGHT) - throw new Error('TX exceeds policy weight.'); - - const ancestors = await this.getPendingAncestors(tx); - if (ancestors.size + 1 > this.maxAncestors) - throw new Error('TX exceeds maximum unconfirmed ancestors.'); - - await this.wdb.addTX(tx); - - this.logger.debug('Sending wallet tx (%s): %h', this.id, tx.hash()); - - await this.wdb.send(tx); - - return tx; - } - - /** - * Intentionally double-spend outputs by - * increasing fee for an existing transaction. - * @param {Hash} hash - * @param {Rate} rate - * @param {(String|Buffer)?} passphrase - * @returns {Promise} - Returns {@link TX}. - */ - - async increaseFee(hash, rate, passphrase) { - assert$5((rate >>> 0) === rate, 'Rate must be a number.'); - - const wtx = await this.getTX(hash); - - if (!wtx) - throw new Error('Transaction not found.'); - - if (wtx.height !== -1) - throw new Error('Transaction is confirmed.'); - - const tx = wtx.tx; - - if (tx.isCoinbase()) - throw new Error('Transaction is a coinbase.'); - - const view = await this.getSpentView(tx); - - if (!tx.hasCoins(view)) - throw new Error('Not all coins available.'); - - const oldFee = tx.getFee(view); - - let fee = tx.getMinFee(null, rate); - - if (fee > MTX$2.Selector.MAX_FEE) - fee = MTX$2.Selector.MAX_FEE; - - if (oldFee >= fee) - throw new Error('Fee is not increasing.'); - - const mtx = MTX$2.fromTX(tx); - mtx.view = view; - - for (const input of mtx.inputs) { - input.script.clear(); - input.witness.clear(); - } - - let change; - for (let i = 0; i < mtx.outputs.length; i++) { - const output = mtx.outputs[i]; - const addr = output.getAddress(); - - if (!addr) - continue; - - const path = await this.getPath(addr); - - if (!path) - continue; - - if (path.branch === 1) { - change = output; - mtx.changeIndex = i; - break; - } - } - - if (!change) - throw new Error('No change output.'); - - change.value += oldFee; - - if (mtx.getFee() !== 0) - throw new Error('Arithmetic error for change.'); - - change.value -= fee; - - if (change.value < 0) - throw new Error('Fee is too high.'); - - if (change.isDust()) { - mtx.outputs.splice(mtx.changeIndex, 1); - mtx.changeIndex = -1; - } - - await this.sign(mtx, passphrase); - - if (!mtx.isSigned()) - throw new Error('TX could not be fully signed.'); - - const ntx = mtx.toTX(); - - this.logger.debug( - 'Increasing fee for wallet tx (%s): %h', - this.id, ntx.hash()); - - await this.wdb.addTX(ntx); - await this.wdb.send(ntx); - - return ntx; - } - - /** - * Resend pending wallet transactions. - * @returns {Promise} - */ - - async resend() { - const wtxs = await this.getPending(); - - if (wtxs.length > 0) - this.logger.info('Rebroadcasting %d transactions.', wtxs.length); - - const txs = []; - - for (const wtx of wtxs) - txs.push(wtx.tx); - - const sorted = common$2.sortDeps(txs); - - for (const tx of sorted) - await this.wdb.send(tx); - - return txs; - } - - /** - * Derive necessary addresses for signing a transaction. - * @param {MTX} mtx - * @param {Number?} index - Input index. - * @returns {Promise} - Returns {@link WalletKey}[]. - */ - - async deriveInputs(mtx) { - assert$5(mtx.mutable); - - const paths = await this.getInputPaths(mtx); - const rings = []; - - for (const path of paths) { - const account = await this.getAccount(path.account); - - if (!account) - continue; - - const ring = account.derivePath(path, this.master); - - if (ring) - rings.push(ring); - } - - return rings; - } - - /** - * Retrieve a single keyring by address. - * @param {Address|Hash} hash - * @returns {Promise} - */ - - async getKey(address) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - const account = await this.getAccount(path.account); - - if (!account) - return null; - - return account.derivePath(path, this.master); - } - - /** - * Retrieve a single keyring by address - * (with the private key reference). - * @param {Address|Hash} hash - * @param {(Buffer|String)?} passphrase - * @returns {Promise} - */ - - async getPrivateKey(address, passphrase) { - const hash = Address$2.getHash(address); - const path = await this.getPath(hash); - - if (!path) - return null; - - const account = await this.getAccount(path.account); - - if (!account) - return null; - - await this.unlock(passphrase); - - const key = account.derivePath(path, this.master); - - if (!key.privateKey) - return null; - - return key; - } - - /** - * Map input addresses to paths. - * @param {MTX} mtx - * @returns {Promise} - Returns {@link Path}[]. - */ - - async getInputPaths(mtx) { - assert$5(mtx.mutable); - - if (!mtx.hasCoins()) - throw new Error('Not all coins available.'); - - const hashes = mtx.getInputHashes(); - const paths = []; - - for (const hash of hashes) { - const path = await this.getPath(hash); - if (path) - paths.push(path); - } - - return paths; - } - - /** - * Map output addresses to paths. - * @param {TX} tx - * @returns {Promise} - Returns {@link Path}[]. - */ - - async getOutputPaths(tx) { - const paths = []; - const hashes = tx.getOutputHashes(); - - for (const hash of hashes) { - const path = await this.getPath(hash); - if (path) - paths.push(path); - } - - return paths; - } - - /** - * Increase lookahead for account. - * @param {(Number|String)?} account - * @param {Number} lookahead - * @returns {Promise} - */ - - async setLookahead(acct, lookahead) { - const unlock = await this.writeLock.lock(); - try { - return this._setLookahead(acct, lookahead); - } finally { - unlock(); - } - } - - /** - * Increase lookahead for account (without a lock). - * @private - * @param {(Number|String)?} account - * @param {Number} lookahead - * @returns {Promise} - */ - - async _setLookahead(acct, lookahead) { - const account = await this.getAccount(acct); - - if (!account) - throw new Error('Account not found.'); - - const b = this.db.batch(); - await account.setLookahead(b, lookahead); - await b.write(); - } - - /** - * Sync address depths based on a transaction's outputs. - * This is used for deriving new addresses when - * a confirmed transaction is seen. - * @param {TX} tx - * @returns {Promise} - */ - - async syncOutputDepth(tx) { - const map = new Map(); - - for (const hash of tx.getOutputHashes()) { - const path = await this.readPath(hash); - - if (!path) - continue; - - if (path.index === -1) - continue; - - if (!map.has(path.account)) - map.set(path.account, []); - - map.get(path.account).push(path); - } - - const derived = []; - const b = this.db.batch(); - - for (const [acct, paths] of map) { - let receive = -1; - let change = -1; - let nested = -1; - - for (const path of paths) { - switch (path.branch) { - case 0: - if (path.index > receive) - receive = path.index; - break; - case 1: - if (path.index > change) - change = path.index; - break; - case 2: - if (path.index > nested) - nested = path.index; - break; - } - } - - receive += 2; - change += 2; - nested += 2; - - const account = await this.getAccount(acct); - assert$5(account); - - const ring = await account.syncDepth(b, receive, change, nested); - - if (ring) - derived.push(ring); - } - - await b.write(); - - return derived; - } - - /** - * Build input scripts templates for a transaction (does not - * sign, only creates signature slots). Only builds scripts - * for inputs that are redeemable by this wallet. - * @param {MTX} mtx - * @returns {Promise} - Returns Number - * (total number of scripts built). - */ - - async template(mtx) { - const rings = await this.deriveInputs(mtx); - return mtx.template(rings); - } - - /** - * Build input scripts and sign inputs for a transaction. Only attempts - * to build/sign inputs that are redeemable by this wallet. - * @param {MTX} tx - * @param {Object|String|Buffer} options - Options or passphrase. - * @returns {Promise} - Returns Number (total number - * of inputs scripts built and signed). - */ - - async sign(mtx, passphrase) { - if (this.watchOnly) - throw new Error('Cannot sign from a watch-only wallet.'); - - await this.unlock(passphrase); - - const rings = await this.deriveInputs(mtx); - - return mtx.signAsync(rings, Script$5.hashType.ALL, this.wdb.workers); - } - - /** - * Get pending ancestors up to the policy limit - * @param {TX} tx - * @returns {Promise} - Returns {BufferSet} with Hash - */ - - async getPendingAncestors(tx) { - return this._getPendingAncestors(tx, new BufferSet$1()); - } - - /** - * Get pending ancestors up to the policy limit. - * @param {TX} tx - * @param {Object} set - * @returns {Promise} - Returns {BufferSet} with Hash - */ - - async _getPendingAncestors(tx, set) { - for (const {prevout} of tx.inputs) { - const hash = prevout.hash; - - if (set.has(hash)) - continue; - - if (!await this.hasPending(hash)) - continue; - - set.add(hash); - - if (set.size > this.maxAncestors) - break; - - const parent = await this.getTX(hash); - await this._getPendingAncestors(parent.tx, set); - - if (set.size > this.maxAncestors) - break; - } - - return set; - } - - /** - * Test whether the database has a pending transaction. - * @param {Hash} hash - * @returns {Promise} - Returns Boolean. - */ - - hasPending(hash) { - return this.txdb.hasPending(hash); - } - - /** - * Get a coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - getCoinView(tx) { - return this.txdb.getCoinView(tx); - } - - /** - * Get a historical coin viewpoint. - * @param {TX} tx - * @returns {Promise} - Returns {@link CoinView}. - */ - - getSpentView(tx) { - return this.txdb.getSpentView(tx); - } - - /** - * Convert transaction to transaction details. - * @param {TXRecord} wtx - * @returns {Promise} - Returns {@link Details}. - */ - - toDetails(wtx) { - return this.txdb.toDetails(wtx); - } - - /** - * Get transaction details. - * @param {Hash} hash - * @returns {Promise} - Returns {@link Details}. - */ - - getDetails(hash) { - return this.txdb.getDetails(hash); - } - - /** - * Get a coin from the wallet. - * @param {Hash} hash - * @param {Number} index - * @returns {Promise} - Returns {@link Coin}. - */ - - getCoin(hash, index) { - return this.txdb.getCoin(hash, index); - } - - /** - * Get a transaction from the wallet. - * @param {Hash} hash - * @returns {Promise} - Returns {@link TX}. - */ - - getTX(hash) { - return this.txdb.getTX(hash); - } - - /** - * List blocks for the wallet. - * @returns {Promise} - Returns {@link BlockRecord}. - */ - - getBlocks() { - return this.txdb.getBlocks(); - } - - /** - * Get a block from the wallet. - * @param {Number} height - * @returns {Promise} - Returns {@link BlockRecord}. - */ - - getBlock(height) { - return this.txdb.getBlock(height); - } - - /** - * Add a transaction to the wallets TX history. - * @param {TX} tx - * @returns {Promise} - */ - - async add(tx, block) { - const unlock = await this.writeLock.lock(); - try { - return await this._add(tx, block); - } finally { - unlock(); - } - } - - /** - * Add a transaction to the wallet without a lock. - * Potentially resolves orphans. - * @private - * @param {TX} tx - * @returns {Promise} - */ - - async _add(tx, block) { - const details = await this.txdb.add(tx, block); - - if (details) { - const derived = await this.syncOutputDepth(tx); - if (derived.length > 0) { - this.wdb.emit('address', this, derived); - this.emit('address', derived); - } - } - - return details; - } - - /** - * Revert a block. - * @param {Number} height - * @returns {Promise} - */ - - async revert(height) { - const unlock = await this.writeLock.lock(); - try { - return await this.txdb.revert(height); - } finally { - unlock(); - } - } - - /** - * Remove a wallet transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async remove(hash) { - const unlock = await this.writeLock.lock(); - try { - return await this.txdb.remove(hash); - } finally { - unlock(); - } - } - - /** - * Zap stale TXs from wallet. - * @param {(Number|String)?} acct - * @param {Number} age - Age threshold (unix time). - * @returns {Promise} - */ - - async zap(acct, age) { - const unlock = await this.writeLock.lock(); - try { - return await this._zap(acct, age); - } finally { - unlock(); - } - } - - /** - * Zap stale TXs from wallet without a lock. - * @private - * @param {(Number|String)?} acct - * @param {Number} age - * @returns {Promise} - */ - - async _zap(acct, age) { - const account = await this.ensureIndex(acct); - return this.txdb.zap(account, age); - } - - /** - * Abandon transaction. - * @param {Hash} hash - * @returns {Promise} - */ - - async abandon(hash) { - const unlock = await this.writeLock.lock(); - try { - return await this._abandon(hash); - } finally { - unlock(); - } - } - - /** - * Abandon transaction without a lock. - * @private - * @param {Hash} hash - * @returns {Promise} - */ - - _abandon(hash) { - return this.txdb.abandon(hash); - } - - /** - * Lock a single coin. - * @param {Coin|Outpoint} coin - */ - - lockCoin(coin) { - return this.txdb.lockCoin(coin); - } - - /** - * Unlock a single coin. - * @param {Coin|Outpoint} coin - */ - - unlockCoin(coin) { - return this.txdb.unlockCoin(coin); - } - - /** - * Unlock all locked coins. - */ - - unlockCoins() { - return this.txdb.unlockCoins(); - } - - /** - * Test locked status of a single coin. - * @param {Coin|Outpoint} coin - */ - - isLocked(coin) { - return this.txdb.isLocked(coin); - } - - /** - * Return an array of all locked outpoints. - * @returns {Outpoint[]} - */ - - getLocked() { - return this.txdb.getLocked(); - } - - /** - * Get all transactions in transaction history. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getHistory(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getHistory(account); - } - - /** - * Get all available coins. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getCoins(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getCoins(account); - } - - /** - * Get all available credits. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Credit}[]. - */ - - async getCredits(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getCredits(account); - } - - /** - * Get "smart" coins. - * @param {(String|Number)?} account - * @returns {Promise} - Returns {@link Coin}[]. - */ - - async getSmartCoins(acct) { - const credits = await this.getCredits(acct); - const coins = []; - - for (const credit of credits) { - const coin = credit.coin; - - if (credit.spent) - continue; - - if (this.txdb.isLocked(coin)) - continue; - - // Always use confirmed coins. - if (coin.height !== -1) { - coins.push(coin); - continue; - } - - // Use unconfirmed only if they were - // created as a result of one of our - // _own_ transactions. i.e. they're - // not low-fee and not in danger of - // being double-spent by a bad actor. - if (!credit.own) - continue; - - coins.push(coin); - } - - return coins; - } - - /** - * Get all pending/unconfirmed transactions. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getPending(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getPending(account); - } - - /** - * Get wallet balance. - * @param {(String|Number)?} acct - * @returns {Promise} - Returns {@link Balance}. - */ - - async getBalance(acct) { - const account = await this.ensureIndex(acct); - return this.txdb.getBalance(account); - } - - /** - * Get a range of transactions between two timestamps. - * @param {(String|Number)?} acct - * @param {Object} options - * @param {Number} options.start - * @param {Number} options.end - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getRange(acct, options) { - const account = await this.ensureIndex(acct); - return this.txdb.getRange(account, options); - } - - /** - * Get the last N transactions. - * @param {(String|Number)?} acct - * @param {Number} limit - * @returns {Promise} - Returns {@link TX}[]. - */ - - async getLast(acct, limit) { - const account = await this.ensureIndex(acct); - return this.txdb.getLast(account, limit); - } - - /** - * Get account key. - * @param {Number} [acct=0] - * @returns {HDPublicKey} - */ - - async accountKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.accountKey; - } - - /** - * Get current receive depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async receiveDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveDepth; - } - - /** - * Get current change depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async changeDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeDepth; - } - - /** - * Get current nested depth. - * @param {Number} [acct=0] - * @returns {Number} - */ - - async nestedDepth(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedDepth; - } - - /** - * Get current receive address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async receiveAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveAddress(); - } - - /** - * Get current change address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async changeAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeAddress(); - } - - /** - * Get current nested address. - * @param {Number} [acct=0] - * @returns {Address} - */ - - async nestedAddress(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedAddress(); - } - - /** - * Get current receive key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async receiveKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.receiveKey(); - } - - /** - * Get current change key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async changeKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.changeKey(); - } - - /** - * Get current nested key. - * @param {Number} [acct=0] - * @returns {WalletKey} - */ - - async nestedKey(acct = 0) { - const account = await this.getAccount(acct); - if (!account) - throw new Error('Account not found.'); - return account.nestedKey(); - } - - /** - * Convert the wallet to a more inspection-friendly object. - * @returns {Object} - */ - - [inspectSymbol]() { - return { - wid: this.wid, - id: this.id, - network: this.network.type, - accountDepth: this.accountDepth, - token: this.token.toString('hex'), - tokenDepth: this.tokenDepth, - master: this.master - }; - } - - /** - * Convert the wallet to an object suitable for - * serialization. - * @param {Boolean?} unsafe - Whether to include - * the master key in the JSON. - * @returns {Object} - */ - - toJSON(unsafe, balance) { - return { - network: this.network.type, - wid: this.wid, - id: this.id, - watchOnly: this.watchOnly, - accountDepth: this.accountDepth, - token: this.token.toString('hex'), - tokenDepth: this.tokenDepth, - master: this.master.toJSON(this.network, unsafe), - balance: balance ? balance.toJSON(true) : null - }; - } - - /** - * Calculate serialization size. - * @returns {Number} - */ - - getSize() { - let size = 0; - size += 41; - size += this.master.getSize(); - return size; - } - - /** - * Serialize the wallet. - * @returns {Buffer} - */ - - toRaw() { - const size = this.getSize(); - const bw = bio$1.write(size); - - let flags = 0; - - if (this.watchOnly) - flags |= 1; - - bw.writeU8(flags); - bw.writeU32(this.accountDepth); - bw.writeBytes(this.token); - bw.writeU32(this.tokenDepth); - this.master.toWriter(bw); - - return bw.render(); - } - - /** - * Inject properties from serialized data. - * @private - * @param {Buffer} data - */ - - fromRaw(data) { - const br = bio$1.read(data); - - const flags = br.readU8(); - - this.watchOnly = (flags & 1) !== 0; - this.accountDepth = br.readU32(); - this.token = br.readBytes(32); - this.tokenDepth = br.readU32(); - this.master.fromReader(br); - - return this; - } - - /** - * Instantiate a wallet from serialized data. - * @param {Buffer} data - * @returns {Wallet} - */ - - static fromRaw(wdb, data) { - return new this(wdb).fromRaw(data); - } - - /** - * Test an object to see if it is a Wallet. - * @param {Object} obj - * @returns {Boolean} - */ - - static isWallet(obj) { - return obj instanceof Wallet$4; - } -} - -/* - * Expose - */ - -var wallet$1 = Wallet$4; - -/*! - * nullclient.js - node client for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$4 = assert_1$g; -const EventEmitter$1 = require$$1$4; - -/** - * Null Client - * Sort of a fake local client for separation of concerns. - * @alias module:node.NullClient - */ - -class NullClient$1 extends EventEmitter$1 { - /** - * Create a client. - * @constructor - */ - - constructor(wdb) { - super(); - - this.wdb = wdb; - this.network = wdb.network; - this.opened = false; - } - - /** - * Open the client. - * @returns {Promise} - */ - - async open(options) { - assert$4(!this.opened, 'NullClient is already open.'); - this.opened = true; - setImmediate(() => this.emit('connect')); - } - - /** - * Close the client. - * @returns {Promise} - */ - - async close() { - assert$4(this.opened, 'NullClient is not open.'); - this.opened = false; - setImmediate(() => this.emit('disconnect')); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - bind(type, handler) { - return this.on(type, handler); - } - - /** - * Add a listener. - * @param {String} type - * @param {Function} handler - */ - - hook(type, handler) { - return this.on(type, handler); - } - - /** - * Get chain tip. - * @returns {Promise} - */ - - async getTip() { - const {hash, height, time} = this.network.genesis; - return { hash, height, time }; - } - - /** - * Get chain entry. - * @param {Hash} hash - * @returns {Promise} - */ - - async getEntry(hash) { - return { hash, height: 0, time: 0 }; - } - - /** - * Send a transaction. Do not wait for promise. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - this.wdb.emit('send', tx); - } - - /** - * Set bloom filter. - * @param {Bloom} filter - * @returns {Promise} - */ - - async setFilter(filter) { - this.wdb.emit('set filter', filter); - } - - /** - * Add data to filter. - * @param {Buffer} data - * @returns {Promise} - */ - - async addFilter(data) { - this.wdb.emit('add filter', data); - } - - /** - * Reset filter. - * @returns {Promise} - */ - - async resetFilter() { - this.wdb.emit('reset filter'); - } - - /** - * Esimate smart fee. - * @param {Number?} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - return {rate: this.network.feeRate}; - } - - /** - * Get hash range. - * @param {Number} start - * @param {Number} end - * @returns {Promise} - */ - - async getHashes(start = -1, end = -1) { - return [this.network.genesis.hash]; - } - - /** - * Rescan for any missed transactions. - * @param {Number|Hash} start - Start block. - * @param {Bloom} filter - * @param {Function} iter - Iterator. - * @returns {Promise} - */ - - async rescan(start) { - } -} - -/* - * Expose - */ - -var nullclient = NullClient$1; - -/*! - * walletdb.js - storage for wallets - * Copyright (c) 2014-2015, Fedor Indutny (MIT License) - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$3 = assert_1$g; -const path$1 = require$$1$3; -const EventEmitter = require$$1$4; -const bio = bufio; -const {BloomFilter} = bfilter; -const {Lock: Lock$1, MapLock} = bmutex; -const bdb = bdb$d; -const Logger = blgr; -const {safeEqual} = safe; -const aes = aes$5.exports; -const Network = network; -const Path = path$3; -const common$1 = common$5; -const Wallet$3 = wallet$1; -const Account = account; -const Outpoint$2 = outpoint; -const layouts = layout$2; -const records = records$2.exports; -const NullClient = nullclient; -const layout = layouts.wdb; -const tlayout = layouts.txdb; - -const { - ChainState, - BlockMeta: BlockMeta$1, - TXRecord, - MapRecord -} = records; - -/** - * WalletDB - * @alias module:wallet.WalletDB - * @extends EventEmitter - */ - -class WalletDB$2 extends EventEmitter { - /** - * Create a wallet db. - * @constructor - * @param {Object} options - */ - - constructor(options) { - super(); - - this.options = new WalletOptions(options); - - this.network = this.options.network; - this.logger = this.options.logger.context('wallet'); - this.workers = this.options.workers; - this.client = this.options.client || new NullClient(this); - this.feeRate = this.options.feeRate; - this.db = bdb.create(this.options); - - this.primary = null; - this.state = new ChainState(); - this.confirming = false; - this.height = 0; - this.wallets = new Map(); - this.depth = 0; - this.rescanning = false; - this.filterSent = false; - - // Wallet read lock. - this.readLock = new MapLock(); - - // Wallet write lock (creation and rename). - this.writeLock = new Lock$1(); - - // Lock for handling anything tx related. - this.txLock = new Lock$1(); - - // Address and outpoint filter. - this.filter = new BloomFilter(); - - this.init(); - } - - /** - * Initialize walletdb. - * @private - */ - - init() { - let items = 3000000; - let flag = -1; - - // Highest number of items with an - // FPR of 0.001. We have to do this - // by hand because BloomFilter.fromRate's - // policy limit enforcing is fairly - // naive. - if (this.options.spv) { - items = 20000; - flag = BloomFilter.flags.ALL; - } - - this.filter = BloomFilter.fromRate(items, 0.001, flag); - this._bind(); - } - - /** - * Bind to node events. - * @private - */ - - _bind() { - this.client.on('error', (err) => { - this.emit('error', err); - }); - - this.client.on('connect', async () => { - try { - await this.syncNode(); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.on('disconnect', async () => { - this.filterSent = false; - }); - - this.client.bind('block connect', async (entry, txs) => { - try { - await this.addBlock(entry, txs); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('block disconnect', async (entry) => { - try { - await this.removeBlock(entry); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.hook('block rescan', async (entry, txs) => { - try { - await this.rescanBlock(entry, txs); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('tx', async (tx) => { - try { - await this.addTX(tx); - } catch (e) { - this.emit('error', e); - } - }); - - this.client.bind('chain reset', async (tip) => { - try { - await this.resetChain(tip); - } catch (e) { - this.emit('error', e); - } - }); - } - - /** - * Open the walletdb, wait for the database to load. - * @returns {Promise} - */ - - async open() { - this.logger.info('Opening WalletDB...'); - await this.db.open(); - await this.db.verify(layout.V.encode(), 'wallet', 7); - - await this.verifyNetwork(); - - this.depth = await this.getDepth(); - - if (this.options.wipeNoReally) - await this.wipe(); - - await this.watch(); - await this.connect(); - - this.logger.info( - 'WalletDB loaded (depth=%d, height=%d, start=%d).', - this.depth, - this.state.height, - this.state.startHeight); - - const wallet = await this.ensure({ - id: 'primary' - }); - - const addr = await wallet.receiveAddress(); - - this.logger.info( - 'Loaded primary wallet (id=%s, wid=%d, address=%s)', - wallet.id, wallet.wid, addr.toString(this.network)); - - this.primary = wallet; - } - - /** - * Verify network. - * @returns {Promise} - */ - - async verifyNetwork() { - const raw = await this.db.get(layout.O.encode()); - - if (!raw) { - const b = this.db.batch(); - b.put(layout.O.encode(), fromU32(this.network.magic)); - return b.write(); - } - - const magic = raw.readUInt32LE(0, true); - - if (magic !== this.network.magic) - throw new Error('Network mismatch for WalletDB.'); - - return undefined; - } - - /** - * Close the walletdb, wait for the database to close. - * @returns {Promise} - */ - - async close() { - await this.disconnect(); - - for (const wallet of this.wallets.values()) { - await wallet.destroy(); - this.unregister(wallet); - } - - return this.db.close(); - } - - /** - * Watch addresses and outpoints. - * @private - * @returns {Promise} - */ - - async watch() { - const piter = this.db.iterator({ - gte: layout.p.min(), - lte: layout.p.max() - }); - - let hashes = 0; - - await piter.each((key) => { - const [data] = layout.p.decode(key); - - this.filter.add(data); - - hashes += 1; - }); - - this.logger.info('Added %d hashes to WalletDB filter.', hashes); - - const oiter = this.db.iterator({ - gte: layout.o.min(), - lte: layout.o.max() - }); - - let outpoints = 0; - - await oiter.each((key) => { - const [hash, index] = layout.o.decode(key); - const outpoint = new Outpoint$2(hash, index); - const data = outpoint.toRaw(); - - this.filter.add(data); - - outpoints += 1; - }); - - this.logger.info('Added %d outpoints to WalletDB filter.', outpoints); - } - - /** - * Connect to the node server (client required). - * @returns {Promise} - */ - - async connect() { - return this.client.open(); - } - - /** - * Disconnect from node server (client required). - * @returns {Promise} - */ - - async disconnect() { - return this.client.close(); - } - - /** - * Sync state with server on every connect. - * @returns {Promise} - */ - - async syncNode() { - const unlock = await this.txLock.lock(); - try { - this.logger.info('Resyncing from server...'); - await this.syncState(); - await this.syncFilter(); - await this.syncChain(); - await this.resend(); - } finally { - unlock(); - } - } - - /** - * Initialize and write initial sync state. - * @returns {Promise} - */ - - async syncState() { - const cache = await this.getState(); - - if (cache) { - if (!await this.getBlock(0)) - return this.migrateState(cache); - - this.state = cache; - this.height = cache.height; - - return undefined; - } - - this.logger.info('Initializing database state from server.'); - - const b = this.db.batch(); - const hashes = await this.client.getHashes(); - - let tip = null; - - for (let height = 0; height < hashes.length; height++) { - const hash = hashes[height]; - const meta = new BlockMeta$1(hash, height); - b.put(layout.h.encode(height), meta.toHash()); - tip = meta; - } - - assert$3(tip); - - const state = this.state.clone(); - state.startHeight = tip.height; - state.startHash = tip.hash; - state.height = tip.height; - state.marked = false; - - b.put(layout.R.encode(), state.toRaw()); - - await b.write(); - - this.state = state; - this.height = state.height; - - return undefined; - } - - /** - * Migrate sync state. - * @private - * @param {ChainState} state - * @returns {Promise} - */ - - async migrateState(state) { - const b = this.db.batch(); - - this.logger.info('Migrating to new sync state.'); - - const hashes = await this.client.getHashes(0, state.height); - - for (let height = 0; height < hashes.length; height++) { - const hash = hashes[height]; - const meta = new BlockMeta$1(hash, height); - b.put(layout.h.encode(height), meta.toHash()); - } - - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Connect and sync with the chain server. - * @private - * @returns {Promise} - */ - - async syncChain() { - let height = this.state.height; - - this.logger.info('Syncing state from height %d.', height); - - for (;;) { - const tip = await this.getBlock(height); - assert$3(tip); - - if (await this.client.getEntry(tip.hash)) - break; - - assert$3(height !== 0); - height -= 1; - } - - return this.scan(height); - } - - /** - * Rescan blockchain from a given height. - * @private - * @param {Number?} height - * @returns {Promise} - */ - - async scan(height) { - if (height == null) - height = this.state.startHeight; - - assert$3((height >>> 0) === height, 'WDB: Must pass in a height.'); - - this.logger.info( - 'WalletDB is scanning %d blocks.', - this.state.height - height + 1); - - await this.rollback(height); - - const tip = await this.getTip(); - - try { - this.rescanning = true; - await this.client.rescan(tip.hash); - } finally { - this.rescanning = false; - } - } - - /** - * Force a rescan. - * @param {Number} height - * @returns {Promise} - */ - - async rescan(height) { - const unlock = await this.txLock.lock(); - try { - return await this._rescan(height); - } finally { - unlock(); - } - } - - /** - * Force a rescan (without a lock). - * @private - * @param {Number} height - * @returns {Promise} - */ - - async _rescan(height) { - return this.scan(height); - } - - /** - * Broadcast a transaction via chain server. - * @param {TX} tx - * @returns {Promise} - */ - - async send(tx) { - return this.client.send(tx); - } - - /** - * Estimate smart fee from chain server. - * @param {Number} blocks - * @returns {Promise} - */ - - async estimateFee(blocks) { - if (this.feeRate > 0) - return this.feeRate; - - const json = await this.client.estimateFee(blocks); - - if (!json) - throw new Error('Fee not found.'); - - if (!Number.isInteger(json.rate)) - throw new Error('Fee is not an integer.'); - - if (json.rate < this.network.feeRate) - return this.network.feeRate; - - if (json.rate > this.network.maxFeeRate) - return this.network.maxFeeRate; - - return json.rate; - } - - /** - * Send filter to the remote node. - * @private - * @returns {Promise} - */ - - syncFilter() { - this.logger.info('Sending filter to server (%dmb).', - this.filter.size / 8 / (1 << 20)); - - this.filterSent = true; - return this.client.setFilter(this.filter); - } - - /** - * Add data to remote filter. - * @private - * @param {Buffer} data - * @returns {Promise} - */ - - addFilter(data) { - if (!this.filterSent) - return undefined; - return this.client.addFilter(data); - } - - /** - * Reset remote filter. - * @private - * @returns {Promise} - */ - - resetFilter() { - if (!this.filterSent) - return undefined; - return this.client.resetFilter(); - } - - /** - * Backup the wallet db. - * @param {String} path - * @returns {Promise} - */ - - backup(path) { - return this.db.backup(path); - } - - /** - * Wipe the txdb - NEVER USE. - * @returns {Promise} - */ - - async wipe() { - this.logger.warning('Wiping WalletDB TXDB...'); - this.logger.warning('I hope you know what you\'re doing.'); - - const iter = this.db.iterator(); - const b = this.db.batch(); - - let total = 0; - - await iter.each((key) => { - switch (key[0]) { - case 0x62: // b - case 0x63: // c - case 0x65: // e - case 0x74: // t - case 0x6f: // o - case 0x68: // h - case 0x52: // R - b.del(key); - total += 1; - break; - } - }); - - this.logger.warning('Wiped %d txdb records.', total); - - return b.write(); - } - - /** - * Get current wallet wid depth. - * @private - * @returns {Promise} - */ - - async getDepth() { - const raw = await this.db.get(layout.D.encode()); - - if (!raw) - return 0; - - return raw.readUInt32LE(0, true); - } - - /** - * Test the bloom filter against a tx or address hash. - * @private - * @param {Hash} hash - * @returns {Boolean} - */ - - testFilter(data) { - return this.filter.test(data); - } - - /** - * Add hash to local and remote filters. - * @private - * @param {Hash} hash - */ - - addHash(hash) { - this.filter.add(hash); - return this.addFilter(hash); - } - - /** - * Add outpoint to local filter. - * @private - * @param {Hash} hash - * @param {Number} index - */ - - addOutpoint(hash, index) { - const outpoint = new Outpoint$2(hash, index); - this.filter.add(outpoint.toRaw()); - } - - /** - * Dump database (for debugging). - * @returns {Promise} - Returns Object. - */ - - dump() { - return this.db.dump(); - } - - /** - * Register an object with the walletdb. - * @param {Object} object - */ - - register(wallet) { - assert$3(!this.wallets.has(wallet.wid)); - this.wallets.set(wallet.wid, wallet); - } - - /** - * Unregister a object with the walletdb. - * @param {Object} object - * @returns {Boolean} - */ - - unregister(wallet) { - assert$3(this.wallets.has(wallet.wid)); - this.wallets.delete(wallet.wid); - } - - /** - * Map wallet id to wid. - * @param {String|Number} id - * @returns {Promise} - Returns {Number}. - */ - - async ensureWID(id) { - if (typeof id === 'number') { - if (!await this.db.has(layout.W.encode(id))) - return -1; - return id; - } - - return this.getWID(id); - } - - /** - * Map wallet id to wid. - * @param {String} id - * @returns {Promise} - Returns {Number}. - */ - - async getWID(id) { - const data = await this.db.get(layout.l.encode(id)); - - if (!data) - return -1; - - assert$3(data.length === 4); - - return data.readUInt32LE(0, true); - } - - /** - * Map wallet wid to id. - * @param {Number} wid - * @returns {Promise} - Returns {String}. - */ - - async getID(wid) { - const data = await this.db.get(layout.W.encode(wid)); - - if (!data) - return null; - - return toString$1(data); - } - - /** - * Get a wallet from the database, setup watcher. - * @param {Number|String} id - * @returns {Promise} - Returns {@link Wallet}. - */ - - async get(id) { - const wid = await this.ensureWID(id); - - if (wid === -1) - return null; - - const unlock = await this.readLock.lock(wid); - - try { - return await this._get(wid); - } finally { - unlock(); - } - } - - /** - * Get a wallet from the database without a lock. - * @private - * @param {Number} wid - * @returns {Promise} - Returns {@link Wallet}. - */ - - async _get(wid) { - const cache = this.wallets.get(wid); - - if (cache) - return cache; - - const id = await this.getID(wid); - - if (!id) - return null; - - const data = await this.db.get(layout.w.encode(wid)); - assert$3(data); - - const wallet = Wallet$3.fromRaw(this, data); - - wallet.wid = wid; - wallet.id = id; - - await wallet.open(); - - this.register(wallet); - - return wallet; - } - - /** - * Save a wallet to the database. - * @param {Wallet} wallet - */ - - save(b, wallet) { - const wid = wallet.wid; - const id = wallet.id; - - b.put(layout.w.encode(wid), wallet.toRaw()); - b.put(layout.W.encode(wid), fromString(id)); - b.put(layout.l.encode(id), fromU32(wid)); - } - - /** - * Increment the wid depth. - * @param {Batch} b - * @param {Number} wid - */ - - increment(b, wid) { - b.put(layout.D.encode(), fromU32(wid + 1)); - } - - /** - * Rename a wallet. - * @param {Wallet} wallet - * @param {String} id - * @returns {Promise} - */ - - async rename(wallet, id) { - const unlock = await this.writeLock.lock(); - try { - return await this._rename(wallet, id); - } finally { - unlock(); - } - } - - /** - * Rename a wallet without a lock. - * @private - * @param {Wallet} wallet - * @param {String} id - * @returns {Promise} - */ - - async _rename(wallet, id) { - if (!common$1.isName(id)) - throw new Error('WDB: Bad wallet ID.'); - - if (await this.has(id)) - throw new Error('WDB: ID not available.'); - - const b = this.db.batch(); - - // Update wid->id index. - b.put(layout.W.encode(wallet.wid), fromString(id)); - - // Delete old id->wid index. - b.del(layout.l.encode(wallet.id)); - - // Add new id->wid index. - b.put(layout.l.encode(id), fromU32(wallet.wid)); - - await b.write(); - - wallet.id = id; - } - - /** - * Rename an account. - * @param {Account} account - * @param {String} name - */ - - renameAccount(b, account, name) { - const wid = account.wid; - const index = account.accountIndex; - - // Remove old wid/name->account index. - b.del(layout.i.encode(wid, account.name)); - - // Name->Index lookups - b.put(layout.i.encode(wid, name), fromU32(index)); - - // Index->Name lookups - b.put(layout.n.encode(wid, index), fromString(name)); - - account.name = name; - } - - /** - * Remove a wallet. - * @param {Number|String} id - * @returns {Promise} - */ - - async remove(id) { - const wid = await this.ensureWID(id); - - if (wid === -1) - return false; - - // Grab all locks. - const unlock1 = await this.readLock.lock(wid); - const unlock2 = await this.writeLock.lock(); - const unlock3 = await this.txLock.lock(); - - try { - return await this._remove(wid); - } finally { - unlock3(); - unlock2(); - unlock1(); - } - } - - /** - * Remove a wallet (without a lock). - * @private - * @param {Number} wid - * @returns {Promise} - */ - - async _remove(wid) { - const id = await this.getID(wid); - - if (!id) - return false; - - if (id === 'primary') - throw new Error('Cannot remove primary wallet.'); - - const b = this.db.batch(); - - b.del(layout.w.encode(wid)); - b.del(layout.W.encode(wid)); - b.del(layout.l.encode(id)); - - const piter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid) - }); - - await piter.each((key, value) => { - const [, hash] = layout.P.decode(key); - b.del(key); - return this.removePathMap(b, hash, wid); - }); - - const removeRange = (opt) => { - return this.db.iterator(opt).each(key => b.del(key)); - }; - - await removeRange({ - gte: layout.r.min(wid), - lte: layout.r.max(wid) - }); - - await removeRange({ - gte: layout.a.min(wid), - lte: layout.a.max(wid) - }); - - await removeRange({ - gte: layout.i.min(wid), - lte: layout.i.max(wid) - }); - - await removeRange({ - gte: layout.n.min(wid), - lte: layout.n.max(wid) - }); - - await removeRange({ - gt: layout.t.encode(wid), - lt: layout.t.encode(wid + 1) - }); - - const bucket = this.db.bucket(layout.t.encode(wid)); - - const biter = bucket.iterator({ - gte: tlayout.b.min(), - lte: tlayout.b.max() - }); - - await biter.each((key, value) => { - const [height] = tlayout.b.decode(key); - return this.removeBlockMap(b, height, wid); - }); - - const siter = bucket.iterator({ - gte: tlayout.s.min(), - lte: tlayout.s.max(), - keys: true - }); - - await siter.each((key, value) => { - const [hash, index] = tlayout.s.decode(key); - return this.removeOutpointMap(b, hash, index, wid); - }); - - const uiter = bucket.iterator({ - gte: tlayout.p.min(), - lte: tlayout.p.max(), - keys: true - }); - - await uiter.each((key, value) => { - const [hash] = tlayout.p.decode(key); - return this.removeTXMap(b, hash, wid); - }); - - const wallet = this.wallets.get(wid); - - if (wallet) { - await wallet.destroy(); - this.unregister(wallet); - } - - await b.write(); - - return true; - } - - /** - * Get a wallet with token auth first. - * @param {Number|String} id - * @param {Buffer} token - * @returns {Promise} - Returns {@link Wallet}. - */ - - async auth(id, token) { - const wallet = await this.get(id); - - if (!wallet) - return null; - - // Compare in constant time: - if (!safeEqual(token, wallet.token)) - throw new Error('WDB: Authentication error.'); - - return wallet; - } - - /** - * Create a new wallet, save to database, setup watcher. - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async create(options) { - const unlock = await this.writeLock.lock(); - - if (!options) - options = {}; - - try { - return await this._create(options); - } finally { - unlock(); - } - } - - /** - * Create a new wallet, save to database without a lock. - * @private - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async _create(options) { - if (options.id) { - if (await this.has(options.id)) - throw new Error('WDB: Wallet already exists.'); - } - - const wallet = Wallet$3.fromOptions(this, options); - - wallet.wid = this.depth; - - await wallet.init(options, options.passphrase); - - this.depth += 1; - - this.register(wallet); - - this.logger.info('Created wallet %s in WalletDB.', wallet.id); - - return wallet; - } - - /** - * Test for the existence of a wallet. - * @param {Number|String} id - * @returns {Promise} - */ - - async has(id) { - const wid = await this.ensureWID(id); - return wid !== -1; - } - - /** - * Attempt to create wallet, return wallet if already exists. - * @param {Object} options - See {@link Wallet}. - * @returns {Promise} - */ - - async ensure(options) { - if (options.id) { - const wallet = await this.get(options.id); - - if (wallet) - return wallet; - } - - return this.create(options); - } - - /** - * Get an account from the database by wid. - * @private - * @param {Number} wid - * @param {Number} index - Account index. - * @returns {Promise} - Returns {@link Wallet}. - */ - - async getAccount(wid, index) { - const name = await this.getAccountName(wid, index); - - if (!name) - return null; - - const data = await this.db.get(layout.a.encode(wid, index)); - assert$3(data); - - const account = Account.fromRaw(this, data); - - account.accountIndex = index; - account.name = name; - - return account; - } - - /** - * List account names and indexes from the db. - * @param {Number} wid - * @returns {Promise} - Returns Array. - */ - - async getAccounts(wid) { - return this.db.values({ - gte: layout.n.min(wid), - lte: layout.n.max(wid), - parse: toString$1 - }); - } - - /** - * Lookup the corresponding account name's index. - * @param {Number} wid - * @param {String} name - Account name/index. - * @returns {Promise} - Returns Number. - */ - - async getAccountIndex(wid, name) { - const index = await this.db.get(layout.i.encode(wid, name)); - - if (!index) - return -1; - - return index.readUInt32LE(0, true); - } - - /** - * Lookup the corresponding account index's name. - * @param {Number} wid - * @param {Number} index - * @returns {Promise} - Returns Number. - */ - - async getAccountName(wid, index) { - const name = await this.db.get(layout.n.encode(wid, index)); - - if (!name) - return null; - - return toString$1(name); - } - - /** - * Save an account to the database. - * @param {Account} account - * @returns {Promise} - */ - - saveAccount(b, account) { - const wid = account.wid; - const index = account.accountIndex; - const name = account.name; - - // Account data - b.put(layout.a.encode(wid, index), account.toRaw()); - - // Name->Index lookups - b.put(layout.i.encode(wid, name), fromU32(index)); - - // Index->Name lookups - b.put(layout.n.encode(wid, index), fromString(name)); - } - - /** - * Test for the existence of an account. - * @param {Number} wid - * @param {String|Number} acct - * @returns {Promise} - Returns Boolean. - */ - - async hasAccount(wid, index) { - return this.db.has(layout.a.encode(wid, index)); - } - - /** - * Save an address to the path map. - * @param {Wallet} wallet - * @param {WalletKey} ring - * @returns {Promise} - */ - - async saveKey(b, wid, ring) { - return this.savePath(b, wid, ring.toPath()); - } - - /** - * Save a path to the path map. - * - * The path map exists in the form of: - * - `p[address-hash] -> wid map` - * - `P[wid][address-hash] -> path data` - * - `r[wid][account-index][address-hash] -> dummy` - * - * @param {Wallet} wallet - * @param {Path} path - * @returns {Promise} - */ - - async savePath(b, wid, path) { - // Address Hash -> Wallet Map - await this.addPathMap(b, path.hash, wid); - - // Wallet ID + Address Hash -> Path Data - b.put(layout.P.encode(wid, path.hash), path.toRaw()); - - // Wallet ID + Account Index + Address Hash -> Dummy - b.put(layout.r.encode(wid, path.account, path.hash), null); - } - - /** - * Retrieve path by hash. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async getPath(wid, hash) { - const path = await this.readPath(wid, hash); - - if (!path) - return null; - - path.name = await this.getAccountName(wid, path.account); - assert$3(path.name); - - return path; - } - - /** - * Retrieve path by hash. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async readPath(wid, hash) { - const data = await this.db.get(layout.P.encode(wid, hash)); - - if (!data) - return null; - - const path = Path.fromRaw(data); - path.hash = hash; - - return path; - } - - /** - * Test whether a wallet contains a path. - * @param {Number} wid - * @param {Hash} hash - * @returns {Promise} - */ - - async hasPath(wid, hash) { - return this.db.has(layout.P.encode(wid, hash)); - } - - /** - * Get all address hashes. - * @returns {Promise} - */ - - async getHashes() { - return this.db.keys({ - gte: layout.p.min(), - lte: layout.p.max(), - parse: key => layout.p.decode(key)[0] - }); - } - - /** - * Get all outpoints. - * @returns {Promise} - */ - - async getOutpoints() { - return this.db.keys({ - gte: layout.o.min(), - lte: layout.o.max(), - parse: (key) => { - const [hash, index] = layout.o.decode(key); - return new Outpoint$2(hash, index); - } - }); - } - - /** - * Get all address hashes. - * @param {Number} wid - * @returns {Promise} - */ - - async getWalletHashes(wid) { - return this.db.keys({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - parse: key => layout.P.decode(key)[1] - }); - } - - /** - * Get all account address hashes. - * @param {Number} wid - * @param {Number} account - * @returns {Promise} - */ - - async getAccountHashes(wid, account) { - return this.db.keys({ - gte: layout.r.min(wid, account), - lte: layout.r.max(wid, account), - parse: key => layout.r.decode(key)[2] - }); - } - - /** - * Get all paths for a wallet. - * @param {Number} wid - * @returns {Promise} - */ - - async getWalletPaths(wid) { - const items = await this.db.range({ - gte: layout.P.min(wid), - lte: layout.P.max(wid) - }); - - const paths = []; - - for (const {key, value} of items) { - const [, hash] = layout.P.decode(key); - const path = Path.fromRaw(value); - - path.hash = hash; - path.name = await this.getAccountName(wid, path.account); - assert$3(path.name); - - paths.push(path); - } - - return paths; - } - - /** - * Get all wallet ids. - * @returns {Promise} - */ - - async getWallets() { - return this.db.values({ - gte: layout.W.min(), - lte: layout.W.max(), - parse: toString$1 - }); - } - - /** - * Encrypt all imported keys for a wallet. - * @param {Number} wid - * @param {Buffer} key - * @returns {Promise} - */ - - async encryptKeys(b, wid, key) { - const iter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - values: true - }); - - await iter.each((k, value) => { - const [, hash] = layout.P.decode(k); - const path = Path.fromRaw(value); - - if (!path.data) - return; - - assert$3(!path.encrypted); - - const iv = hash.slice(0, 16); - - path.data = aes.encipher(path.data, key, iv); - path.encrypted = true; - - b.put(k, path.toRaw()); - }); - } - - /** - * Decrypt all imported keys for a wallet. - * @param {Number} wid - * @param {Buffer} key - * @returns {Promise} - */ - - async decryptKeys(b, wid, key) { - const iter = this.db.iterator({ - gte: layout.P.min(wid), - lte: layout.P.max(wid), - values: true - }); - - await iter.each((k, value) => { - const [, hash] = layout.P.decode(k); - const path = Path.fromRaw(value); - - if (!path.data) - return; - - assert$3(path.encrypted); - - const iv = hash.slice(0, 16); - - path.data = aes.decipher(path.data, key, iv); - path.encrypted = false; - - b.put(k, path.toRaw()); - }); - } - - /** - * Resend all pending transactions. - * @returns {Promise} - */ - - async resend() { - const wids = await this.db.keys({ - gte: layout.w.min(), - lte: layout.w.max(), - parse: key => layout.w.decode(key)[0] - }); - - this.logger.info('Resending from %d wallets.', wids.length); - - for (const wid of wids) - await this.resendPending(wid); - } - - /** - * Resend all pending transactions for a specific wallet. - * @private - * @param {Number} wid - * @returns {Promise} - */ - - async resendPending(wid) { - const prefix = layout.t.encode(wid); - const b = this.db.bucket(prefix); - - const hashes = await b.keys({ - gte: tlayout.p.min(), - lte: tlayout.p.max(), - parse: key => tlayout.p.decode(key)[0] - }); - - if (hashes.length === 0) - return; - - this.logger.info( - 'Rebroadcasting %d transactions for %d.', - hashes.length, - wid); - - const txs = []; - - for (const hash of hashes) { - const data = await b.get(tlayout.t.encode(hash)); - - if (!data) - continue; - - const wtx = TXRecord.fromRaw(data); - - if (wtx.tx.isCoinbase()) - continue; - - txs.push(wtx.tx); - } - - for (const tx of common$1.sortDeps(txs)) - await this.send(tx); - } - - /** - * Get all wallet ids by output addresses and outpoints. - * @param {Hash[]} hashes - * @returns {Promise} - */ - - async getWalletsByTX(tx) { - const wids = new Set(); - - if (!tx.isCoinbase()) { - for (const {prevout} of tx.inputs) { - const {hash, index} = prevout; - - if (!this.testFilter(prevout.toRaw())) - continue; - - const map = await this.getOutpointMap(hash, index); - - if (!map) - continue; - - for (const wid of map.wids) - wids.add(wid); - } - } - - const hashes = tx.getOutputHashes(); - - for (const hash of hashes) { - if (!this.testFilter(hash)) - continue; - - const map = await this.getPathMap(hash); - - if (!map) - continue; - - for (const wid of map.wids) - wids.add(wid); - } - - if (wids.size === 0) - return null; - - return wids; - } - - /** - * Get the best block hash. - * @returns {Promise} - */ - - async getState() { - const data = await this.db.get(layout.R.encode()); - - if (!data) - return null; - - return ChainState.fromRaw(data); - } - - /** - * Sync the current chain state to tip. - * @param {BlockMeta} tip - * @returns {Promise} - */ - - async setTip(tip) { - const b = this.db.batch(); - const state = this.state.clone(); - - if (tip.height < state.height) { - // Hashes ahead of our new tip - // that we need to delete. - while (state.height !== tip.height) { - b.del(layout.h.encode(state.height)); - state.height -= 1; - } - } else if (tip.height > state.height) { - assert$3(tip.height === state.height + 1, 'Bad chain sync.'); - state.height += 1; - } - - if (tip.height < state.startHeight) { - state.startHeight = tip.height; - state.startHash = tip.hash; - state.marked = false; - } - - // Save tip and state. - b.put(layout.h.encode(tip.height), tip.toHash()); - b.put(layout.R.encode(), state.toRaw()); - - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Will return the current height and will increment - * to the current height of a block currently being - * added to the wallet. - * @returns {Number} - */ - - liveHeight() { - let height = this.height; - - if (this.confirming) - height += 1; - - return height; - } - - /** - * Mark current state. - * @param {BlockMeta} block - * @returns {Promise} - */ - - async markState(block) { - const state = this.state.clone(); - state.startHeight = block.height; - state.startHash = block.hash; - state.marked = true; - - const b = this.db.batch(); - b.put(layout.R.encode(), state.toRaw()); - await b.write(); - - this.state = state; - this.height = state.height; - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getMap(key) { - const data = await this.db.get(key); - - if (!data) - return null; - - return MapRecord.fromRaw(data); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addMap(b, key, wid) { - const data = await this.db.get(key); - - if (!data) { - const map = new MapRecord(); - map.add(wid); - b.put(key, map.toRaw()); - return; - } - - assert$3(data.length >= 4); - - const len = data.readUInt32LE(0, true); - const bw = bio.write(data.length + 4); - - bw.writeU32(len + 1); - bw.copy(data, 4, data.length); - bw.writeU32(wid); - - b.put(key, bw.render()); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeMap(b, key, wid) { - const map = await this.getMap(key); - - if (!map) - return; - - if (!map.remove(wid)) - return; - - if (map.size === 0) { - b.del(key); - return; - } - - b.put(key, map.toRaw()); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getPathMap(hash) { - return this.getMap(layout.p.encode(hash)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addPathMap(b, hash, wid) { - await this.addHash(hash); - return this.addMap(b, layout.p.encode(hash), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removePathMap(b, hash, wid) { - return this.removeMap(b, layout.p.encode(hash), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getBlockMap(height) { - return this.getMap(layout.b.encode(height)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addBlockMap(b, height, wid) { - return this.addMap(b, layout.b.encode(height), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeBlockMap(b, height, wid) { - return this.removeMap(b, layout.b.encode(height), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getTXMap(hash) { - return this.getMap(layout.T.encode(hash)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addTXMap(b, hash, wid) { - return this.addMap(b, layout.T.encode(hash), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeTXMap(b, hash, wid) { - return this.removeMap(b, layout.T.encode(hash), wid); - } - - /** - * Get a wallet map. - * @param {Buffer} key - * @returns {Promise} - */ - - async getOutpointMap(hash, index) { - return this.getMap(layout.o.encode(hash, index)); - } - - /** - * Add wid to a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async addOutpointMap(b, hash, index, wid) { - await this.addOutpoint(hash, index); - return this.addMap(b, layout.o.encode(hash, index), wid); - } - - /** - * Remove wid from a wallet map. - * @param {Wallet} wallet - * @param {Buffer} key - * @param {Number} wid - */ - - async removeOutpointMap(b, hash, index, wid) { - return this.removeMap(b, layout.o.encode(hash, index), wid); - } - - /** - * Get a wallet block meta. - * @param {Hash} hash - * @returns {Promise} - */ - - async getBlock(height) { - const data = await this.db.get(layout.h.encode(height)); - - if (!data) - return null; - - const block = new BlockMeta$1(); - block.hash = data; - block.height = height; - - return block; - } - - /** - * Get wallet tip. - * @param {Hash} hash - * @returns {Promise} - */ - - async getTip() { - const tip = await this.getBlock(this.state.height); - - if (!tip) - throw new Error('WDB: Tip not found!'); - - return tip; - } - - /** - * Sync with chain height. - * @param {Number} height - * @returns {Promise} - */ - - async rollback(height) { - if (height > this.state.height) - throw new Error('WDB: Cannot rollback to the future.'); - - if (height === this.state.height) { - this.logger.info('Rolled back to same height (%d).', height); - return; - } - - this.logger.info( - 'Rolling back %d WalletDB blocks to height %d.', - this.state.height - height, height); - - const tip = await this.getBlock(height); - assert$3(tip); - - await this.revert(tip.height); - await this.setTip(tip); - } - - /** - * Revert TXDB to an older state. - * @param {Number} target - * @returns {Promise} - */ - - async revert(target) { - const iter = this.db.iterator({ - gte: layout.b.encode(target + 1), - lte: layout.b.max(), - reverse: true, - values: true - }); - - let total = 0; - - await iter.each(async (key, value) => { - const [height] = layout.b.decode(key); - const block = MapRecord.fromRaw(value); - - for (const wid of block.wids) { - const wallet = await this.get(wid); - assert$3(wallet); - total += await wallet.revert(height); - } - }); - - this.logger.info('Rolled back %d WalletDB transactions.', total); - } - - /** - * Add a block's transactions and write the new best hash. - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async addBlock(entry, txs) { - const unlock = await this.txLock.lock(); - try { - return await this._addBlock(entry, txs); - } finally { - unlock(); - } - } - - /** - * Add a block's transactions without a lock. - * @private - * @param {ChainEntry} entry - * @param {TX[]} txs - * @returns {Promise} - */ - - async _addBlock(entry, txs) { - const tip = BlockMeta$1.fromEntry(entry); - - if (tip.height < this.state.height) { - this.logger.warning( - 'WalletDB is connecting low blocks (%d).', - tip.height); - return 0; - } - - if (tip.height >= this.network.block.slowHeight) - this.logger.debug('Adding block: %d.', tip.height); - - if (tip.height === this.state.height) { - // We let blocks of the same height - // through specifically for rescans: - // we always want to rescan the last - // block since the state may have - // updated before the block was fully - // processed (in the case of a crash). - this.logger.warning('Already saw WalletDB block (%d).', tip.height); - } else if (tip.height !== this.state.height + 1) { - await this.scan(this.state.height); - return 0; - } - - let total = 0; - - try { - // We set the state as confirming so that - // anything that uses the current height can - // increment by one until the block is fully - // added and the height is updated. - this.confirming = true; - for (const tx of txs) { - if (await this._addTX(tx, tip)) - total += 1; - } - - // Sync the state to the new tip. - await this.setTip(tip); - } finally { - this.confirming = false; - } - - if (total > 0) { - this.logger.info('Connected WalletDB block %h (tx=%d).', - tip.hash, total); - } - - return total; - } - - /** - * Unconfirm a block's transactions - * and write the new best hash (SPV version). - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async removeBlock(entry) { - const unlock = await this.txLock.lock(); - try { - return await this._removeBlock(entry); - } finally { - unlock(); - } - } - - /** - * Unconfirm a block's transactions. - * @private - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async _removeBlock(entry) { - const tip = BlockMeta$1.fromEntry(entry); - - if (tip.height === 0) - throw new Error('WDB: Bad disconnection (genesis block).'); - - if (tip.height > this.state.height) { - this.logger.warning( - 'WalletDB is disconnecting high blocks (%d).', - tip.height); - return 0; - } - - if (tip.height !== this.state.height) - throw new Error('WDB: Bad disconnection (height mismatch).'); - - const prev = await this.getBlock(tip.height - 1); - assert$3(prev); - - // Get the map of block->wids. - const map = await this.getBlockMap(tip.height); - - if (!map) { - await this.setTip(prev); - return 0; - } - - let total = 0; - - for (const wid of map.wids) { - const wallet = await this.get(wid); - assert$3(wallet); - total += await wallet.revert(tip.height); - } - - // Sync the state to the previous tip. - await this.setTip(prev); - - this.logger.warning('Disconnected wallet block %h (tx=%d).', - tip.hash, total); - - return total; - } - - /** - * Rescan a block. - * @private - * @param {ChainEntry} entry - * @param {TX[]} txs - * @returns {Promise} - */ - - async rescanBlock(entry, txs) { - if (!this.rescanning) { - this.logger.warning('Unsolicited rescan block: %d.', entry.height); - return; - } - - if (entry.height > this.state.height + 1) { - this.logger.warning('Rescan block too high: %d.', entry.height); - return; - } - - try { - await this._addBlock(entry, txs); - } catch (e) { - this.emit('error', e); - throw e; - } - } - - /** - * Add a transaction to the database, map addresses - * to wallet IDs, potentially store orphans, resolve - * orphans, or confirm a transaction. - * @param {TX} tx - * @param {BlockMeta?} block - * @returns {Promise} - */ - - async addTX(tx, block) { - const unlock = await this.txLock.lock(); - try { - return await this._addTX(tx, block); - } finally { - unlock(); - } - } - - /** - * Add a transaction to the database without a lock. - * @private - * @param {TX} tx - * @param {BlockMeta} block - * @returns {Promise} - */ - - async _addTX(tx, block) { - const wids = await this.getWalletsByTX(tx); - - assert$3(!tx.mutable, 'WDB: Cannot add mutable TX.'); - - if (!wids) - return null; - - if (block && !this.state.marked) - await this.markState(block); - - this.logger.info( - 'Incoming transaction for %d wallets in WalletDB (%h).', - wids.size, tx.hash()); - - let result = false; - - // Insert the transaction - // into every matching wallet. - for (const wid of wids) { - const wallet = await this.get(wid); - - assert$3(wallet); - - if (await wallet.add(tx, block)) { - this.logger.info( - 'Added transaction to wallet in WalletDB: %s (%d).', - wallet.id, wid); - result = true; - } - } - - if (!result) - return null; - - return wids; - } - - /** - * Handle a chain reset. - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async resetChain(entry) { - const unlock = await this.txLock.lock(); - try { - return await this._resetChain(entry); - } finally { - unlock(); - } - } - - /** - * Handle a chain reset without a lock. - * @private - * @param {ChainEntry} entry - * @returns {Promise} - */ - - async _resetChain(entry) { - if (entry.height > this.state.height) - throw new Error('WDB: Bad reset height.'); - - return this.rollback(entry.height); - } -} - -/** - * Wallet Options - * @alias module:wallet.WalletOptions - */ - -class WalletOptions { - /** - * Create wallet options. - * @constructor - * @param {Object} options - */ - - constructor(options) { - this.network = Network.primary; - this.logger = Logger.global; - this.workers = null; - this.client = null; - this.feeRate = 0; - - this.prefix = null; - this.location = null; - this.memory = true; - this.maxFiles = 64; - this.cacheSize = 16 << 20; - this.compression = true; - - this.spv = false; - this.witness = true; - this.wipeNoReally = false; - - if (options) - this.fromOptions(options); - } - - /** - * Inject properties from object. - * @private - * @param {Object} options - * @returns {WalletOptions} - */ - - fromOptions(options) { - if (options.network != null) - this.network = Network.get(options.network); - - if (options.logger != null) { - assert$3(typeof options.logger === 'object'); - this.logger = options.logger; - } - - if (options.workers != null) { - assert$3(typeof options.workers === 'object'); - this.workers = options.workers; - } - - if (options.client != null) { - assert$3(typeof options.client === 'object'); - this.client = options.client; - } - - if (options.feeRate != null) { - assert$3((options.feeRate >>> 0) === options.feeRate); - this.feeRate = options.feeRate; - } - - if (options.prefix != null) { - assert$3(typeof options.prefix === 'string'); - this.prefix = options.prefix; - this.location = path$1.join(this.prefix, 'wallet'); - } - - if (options.location != null) { - assert$3(typeof options.location === 'string'); - this.location = options.location; - } - - if (options.memory != null) { - assert$3(typeof options.memory === 'boolean'); - this.memory = options.memory; - } - - if (options.maxFiles != null) { - assert$3((options.maxFiles >>> 0) === options.maxFiles); - this.maxFiles = options.maxFiles; - } - - if (options.cacheSize != null) { - assert$3(Number.isSafeInteger(options.cacheSize) && options.cacheSize >= 0); - this.cacheSize = options.cacheSize; - } - - if (options.compression != null) { - assert$3(typeof options.compression === 'boolean'); - this.compression = options.compression; - } - - if (options.spv != null) { - assert$3(typeof options.spv === 'boolean'); - this.spv = options.spv; - } - - if (options.witness != null) { - assert$3(typeof options.witness === 'boolean'); - this.witness = options.witness; - } - - if (options.wipeNoReally != null) { - assert$3(typeof options.wipeNoReally === 'boolean'); - this.wipeNoReally = options.wipeNoReally; - } - - return this; - } - - /** - * Instantiate chain options from object. - * @param {Object} options - * @returns {WalletOptions} - */ - - static fromOptions(options) { - return new this().fromOptions(options); - } -} - -/* - * Helpers - */ - -function fromU32(num) { - const data = Buffer.allocUnsafe(4); - data.writeUInt32LE(num, 0, true); - return data; -} - -function fromString(str) { - const buf = Buffer.alloc(1 + str.length); - buf[0] = str.length; - buf.write(str, 1, str.length, 'ascii'); - return buf; -} - -function toString$1(buf) { - assert$3(buf.length > 0); - assert$3(buf[0] === buf.length - 1); - return buf.toString('ascii', 1, buf.length); -} - -/* - * Expose - */ - -var walletdb = WalletDB$2; - -/*! - * rpc.js - bitcoind-compatible json rpc for bcoin. - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$2 = assert_1$g; -const {format} = require$$0$7; -const bweb = bweb$2; -const {Lock} = bmutex; -const fs = bfile; -const Validator = bval; -const {BufferMap, BufferSet} = bufferMap; -const util = util$y; -const messageUtil = message; -const Amount = amount; -const Script$4 = script$2; -const Address$1 = address$1; -const KeyRing = keyring; -const MerkleBlock = merkleblock; -const MTX$1 = mtx$1.exports; -const Outpoint$1 = outpoint; -const Output = output; -const TX = tx; -const consensus = consensus$s; -const pkg = pkg$4; -const common = common$5; -const {BlockMeta} = records$2.exports; -const RPCBase = bweb.RPC; -const RPCError = bweb.RPCError; - -/* - * Constants - */ - -const errs = { - // Standard JSON-RPC 2.0 errors - INVALID_REQUEST: bweb.errors.INVALID_REQUEST, - METHOD_NOT_FOUND: bweb.errors.METHOD_NOT_FOUND, - INVALID_PARAMS: bweb.errors.INVALID_PARAMS, - INTERNAL_ERROR: bweb.errors.INTERNAL_ERROR, - PARSE_ERROR: bweb.errors.PARSE_ERROR, - - // General application defined errors - MISC_ERROR: -1, - FORBIDDEN_BY_SAFE_MODE: -2, - TYPE_ERROR: -3, - INVALID_ADDRESS_OR_KEY: -5, - OUT_OF_MEMORY: -7, - INVALID_PARAMETER: -8, - DATABASE_ERROR: -20, - DESERIALIZATION_ERROR: -22, - VERIFY_ERROR: -25, - VERIFY_REJECTED: -26, - VERIFY_ALREADY_IN_CHAIN: -27, - IN_WARMUP: -28, - - // Wallet errors - WALLET_ERROR: -4, - WALLET_INSUFFICIENT_FUNDS: -6, - WALLET_INVALID_ACCOUNT_NAME: -11, - WALLET_KEYPOOL_RAN_OUT: -12, - WALLET_UNLOCK_NEEDED: -13, - WALLET_PASSPHRASE_INCORRECT: -14, - WALLET_WRONG_ENC_STATE: -15, - WALLET_ENCRYPTION_FAILED: -16, - WALLET_ALREADY_UNLOCKED: -17 -}; - -/** - * Wallet RPC - * @alias module:wallet.RPC - * @extends bweb.RPC - */ - -class RPC$1 extends RPCBase { - /** - * Create an RPC. - * @param {WalletDB} wdb - */ - - constructor(node) { - super(); - - assert$2(node, 'RPC requires a WalletDB.'); - - this.wdb = node.wdb; - this.network = node.network; - this.logger = node.logger.context('wallet-rpc'); - this.client = node.client; - this.locker = new Lock(); - - this.wallet = null; - - this.init(); - } - - getCode(err) { - switch (err.type) { - case 'RPCError': - return err.code; - case 'ValidationError': - return errs.TYPE_ERROR; - case 'EncodingError': - return errs.DESERIALIZATION_ERROR; - case 'FundingError': - return errs.WALLET_INSUFFICIENT_FUNDS; - default: - return errs.INTERNAL_ERROR; - } - } - - handleCall(cmd, query) { - this.logger.debug('Handling RPC call: %s.', cmd.method); - } - - init() { - this.add('help', this.help); - this.add('stop', this.stop); - this.add('fundrawtransaction', this.fundRawTransaction); - this.add('resendwallettransactions', this.resendWalletTransactions); - this.add('abandontransaction', this.abandonTransaction); - this.add('addmultisigaddress', this.addMultisigAddress); - this.add('addwitnessaddress', this.addWitnessAddress); - this.add('backupwallet', this.backupWallet); - this.add('dumpprivkey', this.dumpPrivKey); - this.add('dumpwallet', this.dumpWallet); - this.add('encryptwallet', this.encryptWallet); - this.add('getaddressinfo', this.getAddressInfo); - this.add('getaccountaddress', this.getAccountAddress); - this.add('getaccount', this.getAccount); - this.add('getaddressesbyaccount', this.getAddressesByAccount); - this.add('getbalance', this.getBalance); - this.add('getnewaddress', this.getNewAddress); - this.add('getrawchangeaddress', this.getRawChangeAddress); - this.add('getreceivedbyaccount', this.getReceivedByAccount); - this.add('getreceivedbyaddress', this.getReceivedByAddress); - this.add('gettransaction', this.getTransaction); - this.add('getunconfirmedbalance', this.getUnconfirmedBalance); - this.add('getwalletinfo', this.getWalletInfo); - this.add('importprivkey', this.importPrivKey); - this.add('importwallet', this.importWallet); - this.add('importaddress', this.importAddress); - this.add('importprunedfunds', this.importPrunedFunds); - this.add('importpubkey', this.importPubkey); - this.add('keypoolrefill', this.keyPoolRefill); - this.add('listaccounts', this.listAccounts); - this.add('listaddressgroupings', this.listAddressGroupings); - this.add('listlockunspent', this.listLockUnspent); - this.add('listreceivedbyaccount', this.listReceivedByAccount); - this.add('listreceivedbyaddress', this.listReceivedByAddress); - this.add('listsinceblock', this.listSinceBlock); - this.add('listtransactions', this.listTransactions); - this.add('listunspent', this.listUnspent); - this.add('lockunspent', this.lockUnspent); - this.add('move', this.move); - this.add('sendfrom', this.sendFrom); - this.add('sendmany', this.sendMany); - this.add('sendtoaddress', this.sendToAddress); - this.add('setaccount', this.setAccount); - this.add('settxfee', this.setTXFee); - this.add('signmessage', this.signMessage); - this.add('walletlock', this.walletLock); - this.add('walletpassphrasechange', this.walletPassphraseChange); - this.add('walletpassphrase', this.walletPassphrase); - this.add('removeprunedfunds', this.removePrunedFunds); - this.add('selectwallet', this.selectWallet); - this.add('getmemoryinfo', this.getMemoryInfo); - this.add('setloglevel', this.setLogLevel); - } - - async help(args, _help) { - if (args.length === 0) - return `Select a command:\n${Object.keys(this.calls).join('\n')}`; - - const json = { - method: args[0], - params: [] - }; - - return await this.execute(json, true); - } - - async stop(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'stop'); - - this.wdb.close(); - - return 'Stopping.'; - } - - async fundRawTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'fundrawtransaction "hexstring" ( options )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const data = valid.buf(0); - const options = valid.obj(1); - - if (!data) - throw new RPCError(errs.TYPE_ERROR, 'Invalid hex string.'); - - const tx = MTX$1.fromRaw(data); - - if (tx.outputs.length === 0) { - throw new RPCError(errs.INVALID_PARAMETER, - 'TX must have at least one output.'); - } - - let rate = null; - let change = null; - - if (options) { - const valid = new Validator(options); - - rate = valid.ufixed('feeRate', 8); - change = valid.str('changeAddress'); - - if (change) - change = parseAddress(change, this.network); - } - - await wallet.fund(tx, { - rate: rate, - changeAddress: change - }); - - return { - hex: tx.toRaw().toString('hex'), - changepos: tx.changeIndex, - fee: Amount.btc(tx.getFee(), true) - }; - } - - /* - * Wallet - */ - - async resendWalletTransactions(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'resendwallettransactions'); - - const wallet = this.wallet; - const txs = await wallet.resend(); - const hashes = []; - - for (const tx of txs) - hashes.push(tx.txid()); - - return hashes; - } - - async addMultisigAddress(args, help) { - // Impossible to implement in bcoin (no address book). - throw new Error('Not implemented.'); - } - - async addWitnessAddress(args, help) { - // Unlikely to be implemented. - throw new Error('Not implemented.'); - } - - async backupWallet(args, help) { - const valid = new Validator(args); - const dest = valid.str(0); - - if (help || args.length !== 1 || !dest) - throw new RPCError(errs.MISC_ERROR, 'backupwallet "destination"'); - - await this.wdb.backup(dest); - - return null; - } - - async dumpPrivKey(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'dumpprivkey "bitcoinaddress"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const hash = parseHash(addr, this.network); - const ring = await wallet.getPrivateKey(hash); - - if (!ring) - throw new RPCError(errs.MISC_ERROR, 'Key not found.'); - - return ring.toSecret(this.network); - } - - async dumpWallet(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'dumpwallet "filename"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const file = valid.str(0); - - if (!file) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const tip = await this.wdb.getTip(); - const time = util.date(); - - const out = [ - format('# Wallet Dump created by Bcoin %s', pkg.version), - format('# * Created on %s', time), - format('# * Best block at time of backup was %d (%s).', - tip.height, util.revHex(tip.hash)), - format('# * File: %s', file), - '' - ]; - - const hashes = await wallet.getAddressHashes(); - - for (const hash of hashes) { - const ring = await wallet.getPrivateKey(hash); - - if (!ring) - continue; - - const addr = ring.getAddress('string', this.network); - - let fmt = '%s %s label= addr=%s'; - - if (ring.branch === 1) - fmt = '%s %s change=1 addr=%s'; - - const str = format(fmt, ring.toSecret(this.network), time, addr); - - out.push(str); - } - - out.push(''); - out.push('# End of dump'); - out.push(''); - - const dump = out.join('\n'); - - if (fs.unsupported) - return dump; - - await fs.writeFile(file, dump, 'utf8'); - - return null; - } - - async encryptWallet(args, help) { - const wallet = this.wallet; - - if (!wallet.master.encrypted && (help || args.length !== 1)) - throw new RPCError(errs.MISC_ERROR, 'encryptwallet "passphrase"'); - - const valid = new Validator(args); - const passphrase = valid.str(0, ''); - - if (wallet.master.encrypted) { - throw new RPCError(errs.WALLET_WRONG_ENC_STATE, - 'Already running with an encrypted wallet.'); - } - - if (passphrase.length < 1) - throw new RPCError(errs.MISC_ERROR, 'encryptwallet "passphrase"'); - - try { - await wallet.encrypt(passphrase); - } catch (e) { - throw new RPCError(errs.WALLET_ENCRYPTION_FAILED, 'Encryption failed.'); - } - - return 'wallet encrypted; we do not need to stop!'; - } - - async getAccountAddress(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaccountaddress "account"'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0, ''); - - if (!name) - name = 'default'; - - const addr = await wallet.receiveAddress(name); - - if (!addr) - return ''; - - return addr.toString(this.network); - } - - async getAccount(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaccount "bitcoinaddress"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const hash = parseHash(addr, this.network); - const path = await wallet.getPath(hash); - - if (!path) - return ''; - - return path.name; - } - - async getAddressesByAccount(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaddressesbyaccount "account"'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0, ''); - const addrs = []; - - if (name === '') - name = 'default'; - - let paths; - try { - paths = await wallet.getPaths(name); - } catch (e) { - if (e.message === 'Account not found.') - return []; - throw e; - } - - for (const path of paths) { - const addr = path.toAddress(); - addrs.push(addr.toString(this.network)); - } - - return addrs; - } - - async getAddressInfo(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'getaddressinfo "address"'); - - const valid = new Validator(args); - const addr = valid.str(0, ''); - - const address = parseAddress(addr, this.network); - const script = Script$4.fromAddress(address); - const wallet = this.wallet.toJSON(); - - const path = await this.wallet.getPath(address); - - const isScript = script.isScripthash() || script.isWitnessScripthash(); - const isWitness = address.isProgram(); - - const result = { - address: address.toString(this.network), - scriptPubKey: script ? script.toJSON() : undefined, - ismine: path != null, - ischange: path ? path.branch === 1 : false, - iswatchonly: wallet.watchOnly, - isscript: isScript, - iswitness: isWitness - }; - - if (isWitness) { - result.witness_version = address.version; - result.witness_program = address.hash.toString('hex'); - } - - return result; - } - - async getBalance(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'getbalance ( "account" minconf includeWatchonly )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const minconf = valid.u32(1, 1); - const watchOnly = valid.bool(2, false); - - if (name === '') - name = 'default'; - - if (name === '*') - name = null; - - if (wallet.watchOnly !== watchOnly) - return 0; - - const balance = await wallet.getBalance(name); - - let value; - if (minconf > 0) - value = balance.confirmed; - else - value = balance.unconfirmed; - - return Amount.btc(value, true); - } - - async getNewAddress(args, help) { - if (help || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'getnewaddress ( "account" )'); - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - - if (name === '' || args.length === 0) - name = 'default'; - - const addr = await wallet.createReceive(name); - - return addr.getAddress('string', this.network); - } - - async getRawChangeAddress(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getrawchangeaddress'); - - const wallet = this.wallet; - const addr = await wallet.createChange(); - - return addr.getAddress('string', this.network); - } - - async getReceivedByAccount(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'getreceivedbyaccount "account" ( minconf )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const minconf = valid.u32(1, 0); - const height = this.wdb.state.height; - - if (name === '') - name = 'default'; - - const paths = await wallet.getPaths(name); - const filter = new BufferSet(); - - for (const path of paths) - filter.add(path.hash); - - const txs = await wallet.getHistory(name); - - let total = 0; - - for (const wtx of txs) { - const conf = wtx.getDepth(height); - - if (conf < minconf) - continue; - - for (const output of wtx.tx.outputs) { - const hash = output.getHash(); - if (hash && filter.has(hash)) - total += output.value; - } - } - - return Amount.btc(total, true); - } - - async getReceivedByAddress(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'getreceivedbyaddress "bitcoinaddress" ( minconf )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const addr = valid.str(0, ''); - const minconf = valid.u32(1, 0); - const height = this.wdb.state.height; - - const hash = parseHash(addr, this.network); - const txs = await wallet.getHistory(); - - let total = 0; - - for (const wtx of txs) { - if (wtx.getDepth(height) < minconf) - continue; - - for (const output of wtx.tx.outputs) { - // Some transaction outputs don't have scripts with address hashes. - // One example is OP_RETURN data, like a coinbase witness commitment. - const addr = output.getAddress(); - - if (!addr) - continue; - - if (addr.getHash().equals(hash)) - total += output.value; - } - } - - return Amount.btc(total, true); - } - - async _toWalletTX(wtx) { - const wallet = this.wallet; - const details = await wallet.toDetails(wtx); - - if (!details) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - let receive = true; - for (const member of details.inputs) { - if (member.path) { - receive = false; - break; - } - } - - const det = []; - let sent = 0; - let received = 0; - - for (let i = 0; i < details.outputs.length; i++) { - const member = details.outputs[i]; - - if (member.path) { - if (member.path.branch === 1) - continue; - - det.push({ - account: member.path.name, - address: member.address.toString(this.network), - category: 'receive', - amount: Amount.btc(member.value, true), - label: member.path.name, - vout: i - }); - - received += member.value; - - continue; - } - - if (receive) - continue; - - det.push({ - account: '', - address: member.address - ? member.address.toString(this.network) - : null, - category: 'send', - amount: -(Amount.btc(member.value, true)), - fee: -(Amount.btc(details.fee, true)), - vout: i - }); - - sent += member.value; - } - - return { - amount: Amount.btc(receive ? received : -sent, true), - confirmations: details.confirmations, - blockhash: details.block ? util.revHex(details.block) : null, - blockindex: details.index, - blocktime: details.time, - txid: util.revHex(details.hash), - walletconflicts: [], - time: details.mtime, - timereceived: details.mtime, - 'bip125-replaceable': 'no', - details: det, - hex: details.tx.toRaw().toString('hex') - }; - } - - async getTransaction(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'gettransaction "txid" ( includeWatchonly )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - const watchOnly = valid.bool(1, false); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter'); - - const wtx = await wallet.getTX(hash); - - if (!wtx) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - return await this._toWalletTX(wtx, watchOnly); - } - - async abandonTransaction(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'abandontransaction "txid"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const result = await wallet.abandon(hash); - - if (!result) - throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.'); - - return null; - } - - async getUnconfirmedBalance(args, help) { - if (help || args.length > 0) - throw new RPCError(errs.MISC_ERROR, 'getunconfirmedbalance'); - - const wallet = this.wallet; - const balance = await wallet.getBalance(); - - return Amount.btc(balance.unconfirmed, true); - } - - async getWalletInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getwalletinfo'); - - const wallet = this.wallet; - const balance = await wallet.getBalance(); - - return { - walletid: wallet.id, - walletversion: 6, - balance: Amount.btc(balance.unconfirmed, true), - unconfirmed_balance: Amount.btc(balance.unconfirmed, true), - txcount: balance.tx, - keypoololdest: 0, - keypoolsize: 0, - unlocked_until: wallet.master.until, - paytxfee: Amount.btc(this.wdb.feeRate, true) - }; - } - - async importPrivKey(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'importprivkey "bitcoinprivkey" ( "label" rescan )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const secret = valid.str(0); - const rescan = valid.bool(2, false); - - const key = parseSecret(secret, this.network); - - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importWallet(args, help) { - if (help || args.length < 1 || args.length > 2) - throw new RPCError(errs.MISC_ERROR, 'importwallet "filename" ( rescan )'); - - const wallet = this.wallet; - const valid = new Validator(args); - const file = valid.str(0); - const rescan = valid.bool(1, false); - - if (fs.unsupported) - throw new RPCError(errs.INTERNAL_ERROR, 'FS not available.'); - - let data; - try { - data = await fs.readFile(file, 'utf8'); - } catch (e) { - throw new RPCError(errs.INTERNAL_ERROR, e.code || ''); - } - - const lines = data.split(/\n+/); - const keys = []; - - for (let line of lines) { - line = line.trim(); - - if (line.length === 0) - continue; - - if (/^\s*#/.test(line)) - continue; - - const parts = line.split(/\s+/); - - if (parts.length < 4) - throw new RPCError(errs.DESERIALIZATION_ERROR, 'Malformed wallet.'); - - const secret = parseSecret(parts[0], this.network); - - keys.push(secret); - } - - for (const key of keys) - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importAddress(args, help) { - if (help || args.length < 1 || args.length > 4) { - throw new RPCError(errs.MISC_ERROR, - 'importaddress "address" ( "label" rescan p2sh )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let addr = valid.str(0, ''); - const rescan = valid.bool(2, false); - const p2sh = valid.bool(3, false); - - if (p2sh) { - let script = valid.buf(0); - - if (!script) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameters.'); - - script = Script$4.fromRaw(script); - script = Script$4.fromScripthash(script.hash160()); - - addr = script.getAddress(); - } else { - addr = parseAddress(addr, this.network); - } - - try { - await wallet.importAddress(0, addr); - } catch (e) { - if (e.message !== 'Address already exists.') - throw e; - } - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async importPubkey(args, help) { - if (help || args.length < 1 || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'importpubkey "pubkey" ( "label" rescan )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const data = valid.buf(0); - const rescan = valid.bool(2, false); - - if (!data) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const key = KeyRing.fromPublic(data, this.network); - - await wallet.importKey(0, key); - - if (rescan) - await this.wdb.rescan(0); - - return null; - } - - async keyPoolRefill(args, help) { - if (help || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'keypoolrefill ( newsize )'); - return null; - } - - async listAccounts(args, help) { - if (help || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'listaccounts ( minconf includeWatchonly)'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const watchOnly = valid.bool(1, false); - - const accounts = await wallet.getAccounts(); - const map = {}; - - for (const account of accounts) { - const balance = await wallet.getBalance(account); - let value = balance.unconfirmed; - - if (minconf > 0) - value = balance.confirmed; - - if (wallet.watchOnly !== watchOnly) - value = 0; - - map[account] = Amount.btc(value, true); - } - - return map; - } - - async listAddressGroupings(args, help) { - throw new Error('Not implemented.'); - } - - async listLockUnspent(args, help) { - if (help || args.length > 0) - throw new RPCError(errs.MISC_ERROR, 'listlockunspent'); - - const wallet = this.wallet; - const outpoints = wallet.getLocked(); - const out = []; - - for (const outpoint of outpoints) { - out.push({ - txid: outpoint.txid(), - vout: outpoint.index - }); - } - - return out; - } - - async listReceivedByAccount(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listreceivedbyaccount ( minconf includeempty includeWatchonly )'); - } - - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const includeEmpty = valid.bool(1, false); - const watchOnly = valid.bool(2, false); - - return await this._listReceived(minconf, includeEmpty, watchOnly, true); - } - - async listReceivedByAddress(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listreceivedbyaddress ( minconf includeempty includeWatchonly )'); - } - - const valid = new Validator(args); - const minconf = valid.u32(0, 0); - const includeEmpty = valid.bool(1, false); - const watchOnly = valid.bool(2, false); - - return await this._listReceived(minconf, includeEmpty, watchOnly, false); - } - - async _listReceived(minconf, empty, watchOnly, account) { - const wallet = this.wallet; - const paths = await wallet.getPaths(); - const height = this.wdb.state.height; - - const map = new BufferMap(); - for (const path of paths) { - const addr = path.toAddress(); - map.set(path.hash, { - involvesWatchonly: wallet.watchOnly, - address: addr.toString(this.network), - account: path.name, - amount: 0, - confirmations: -1, - label: '' - }); - } - - const txs = await wallet.getHistory(); - - for (const wtx of txs) { - const conf = wtx.getDepth(height); - - if (conf < minconf) - continue; - - for (const output of wtx.tx.outputs) { - const addr = output.getAddress(); - - if (!addr) - continue; - - const hash = addr.getHash(); - const entry = map.get(hash); - - if (entry) { - if (entry.confirmations === -1 || conf < entry.confirmations) - entry.confirmations = conf; - entry.address = addr.toString(this.network); - entry.amount += output.value; - } - } - } - - let out = []; - for (const entry of map.values()) - out.push(entry); - - if (account) { - const map = new Map(); - - for (const entry of out) { - const item = map.get(entry.account); - if (!item) { - map.set(entry.account, entry); - entry.address = undefined; - continue; - } - item.amount += entry.amount; - } - - out = []; - - for (const entry of map.values()) - out.push(entry); - } - - const result = []; - for (const entry of out) { - if (!empty && entry.amount === 0) - continue; - - if (entry.confirmations === -1) - entry.confirmations = 0; - - entry.amount = Amount.btc(entry.amount, true); - result.push(entry); - } - - return result; - } - - async listSinceBlock(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listsinceblock ( "blockhash" target-confirmations includeWatchonly)'); - } - - const wallet = this.wallet; - const chainHeight = this.wdb.state.height; - const valid = new Validator(args); - const block = valid.brhash(0); - const minconf = valid.u32(1, 0); - const watchOnly = valid.bool(2, false); - - if (wallet.watchOnly !== watchOnly) - return []; - - let height = -1; - - if (block) { - const entry = await this.client.getEntry(block); - if (entry) - height = entry.height; - else - throw new RPCError(errs.MISC_ERROR, 'Block not found.'); - } - - if (height === -1) - height = chainHeight; - - const txs = await wallet.getHistory(); - const out = []; - - let highest = null; - - for (const wtx of txs) { - if (wtx.height < height) - continue; - - if (wtx.getDepth(chainHeight) < minconf) - continue; - - if (!highest || wtx.height > highest) - highest = wtx; - - const json = await this._toListTX(wtx); - - out.push(json); - } - - return { - transactions: out, - lastblock: highest && highest.block - ? util.revHex(highest.block) - : util.revHex(consensus.ZERO_HASH) - }; - } - - async _toListTX(wtx) { - const wallet = this.wallet; - const details = await wallet.toDetails(wtx); - - if (!details) - throw new RPCError(errs.WALLET_ERROR, 'TX not found.'); - - let receive = true; - for (const member of details.inputs) { - if (member.path) { - receive = false; - break; - } - } - - let sent = 0; - let received = 0; - let sendMember = null; - let recMember = null; - let sendIndex = -1; - let recIndex = -1; - - for (let i = 0; i < details.outputs.length; i++) { - const member = details.outputs[i]; - - if (member.path) { - if (member.path.branch === 1) - continue; - received += member.value; - recMember = member; - recIndex = i; - continue; - } - - sent += member.value; - sendMember = member; - sendIndex = i; - } - - let member = null; - let index = -1; - - if (receive) { - assert$2(recMember); - member = recMember; - index = recIndex; - } else { - if (sendMember) { - member = sendMember; - index = sendIndex; - } else { - // In the odd case where we send to ourselves. - receive = true; - received = 0; - member = recMember; - index = recIndex; - } - } - - let rbf = false; - - if (wtx.height === -1 && wtx.tx.isRBF()) - rbf = true; - - return { - account: member.path ? member.path.name : '', - address: member.address - ? member.address.toString(this.network) - : null, - category: receive ? 'receive' : 'send', - amount: Amount.btc(receive ? received : -sent, true), - label: member.path ? member.path.name : undefined, - vout: index, - confirmations: details.getDepth(this.wdb.height), - blockhash: details.block ? util.revHex(details.block) : null, - blockindex: -1, - blocktime: details.time, - blockheight: details.height, - txid: util.revHex(details.hash), - walletconflicts: [], - time: details.mtime, - timereceived: details.mtime, - 'bip125-replaceable': rbf ? 'yes' : 'no' - }; - } - - async listTransactions(args, help) { - if (help || args.length > 4) { - throw new RPCError(errs.MISC_ERROR, - 'listtransactions ( "account" count from includeWatchonly)'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const count = valid.u32(1, 10); - const from = valid.u32(2, 0); - const watchOnly = valid.bool(3, false); - - if (wallet.watchOnly !== watchOnly) - return []; - - if (name === '') - name = 'default'; - - const txs = await wallet.getHistory(name); - - common.sortTX(txs); - - const end = from + count; - const to = Math.min(end, txs.length); - const out = []; - - for (let i = from; i < to; i++) { - const wtx = txs[i]; - const json = await this._toListTX(wtx); - out.push(json); - } - - return out; - } - - async listUnspent(args, help) { - if (help || args.length > 3) { - throw new RPCError(errs.MISC_ERROR, - 'listunspent ( minconf maxconf ["address",...] )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const minDepth = valid.u32(0, 1); - const maxDepth = valid.u32(1, 9999999); - const addrs = valid.array(2); - const height = this.wdb.state.height; - - const map = new BufferSet(); - - if (addrs) { - const valid = new Validator(addrs); - for (let i = 0; i < addrs.length; i++) { - const addr = valid.str(i, ''); - const hash = parseHash(addr, this.network); - - if (map.has(hash)) - throw new RPCError(errs.INVALID_PARAMETER, 'Duplicate address.'); - - map.add(hash); - } - } - - const coins = await wallet.getCoins(); - - common.sortCoins(coins); - - const out = []; - - for (const coin of coins) { - const depth = coin.getDepth(height); - - if (depth < minDepth || depth > maxDepth) - continue; - - const addr = coin.getAddress(); - - if (!addr) - continue; - - const hash = coin.getHash(); - - if (addrs) { - if (!hash || !map.has(hash)) - continue; - } - - const ring = await wallet.getKey(hash); - - out.push({ - txid: coin.txid(), - vout: coin.index, - address: addr ? addr.toString(this.network) : null, - account: ring ? ring.name : undefined, - redeemScript: ring && ring.script - ? ring.script.toJSON() - : undefined, - scriptPubKey: coin.script.toJSON(), - amount: Amount.btc(coin.value, true), - confirmations: depth, - spendable: !wallet.isLocked(coin), - solvable: true - }); - } - - return out; - } - - async lockUnspent(args, help) { - if (help || args.length < 1 || args.length > 2) { - throw new RPCError(errs.MISC_ERROR, - 'lockunspent unlock ([{"txid":"txid","vout":n},...])'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const unlock = valid.bool(0, false); - const outputs = valid.array(1); - - if (args.length === 1) { - if (unlock) - wallet.unlockCoins(); - return true; - } - - if (!outputs) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - for (const output of outputs) { - const valid = new Validator(output); - const hash = valid.brhash('txid'); - const index = valid.u32('vout'); - - if (hash == null || index == null) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter.'); - - const outpoint = new Outpoint$1(hash, index); - - if (unlock) { - wallet.unlockCoin(outpoint); - continue; - } - - wallet.lockCoin(outpoint); - } - - return true; - } - - async move(args, help) { - // Not implementing: stupid and deprecated. - throw new Error('Not implemented.'); - } - - async sendFrom(args, help) { - if (help || args.length < 3 || args.length > 6) { - throw new RPCError(errs.MISC_ERROR, - 'sendfrom "fromaccount" "tobitcoinaddress"' - + ' amount ( minconf "comment" "comment-to" )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const str = valid.str(1); - const value = valid.ufixed(2, 8); - const minconf = valid.u32(3, 0); - - const addr = parseAddress(str, this.network); - - if (!addr || value == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - if (name === '') - name = 'default'; - - const options = { - account: name, - depth: minconf, - outputs: [{ - address: addr, - value: value - }] - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async sendMany(args, help) { - if (help || args.length < 2 || args.length > 5) { - throw new RPCError(errs.MISC_ERROR, - 'sendmany "fromaccount" {"address":amount,...}' - + ' ( minconf "comment" subtractfee )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - let name = valid.str(0); - const sendTo = valid.obj(1); - const minconf = valid.u32(2, 1); - const subtract = valid.bool(4, false); - - if (name === '') - name = 'default'; - - if (!sendTo) - throw new RPCError(errs.TYPE_ERROR, 'Invalid send-to address.'); - - const to = new Validator(sendTo); - const uniq = new BufferSet(); - const outputs = []; - - for (const key of Object.keys(sendTo)) { - const value = to.ufixed(key, 8); - const addr = parseAddress(key, this.network); - const hash = addr.getHash(); - - if (value == null) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid amount.'); - - if (uniq.has(hash)) - throw new RPCError(errs.INVALID_PARAMETER, - 'Each send-to address must be unique.'); - - uniq.add(hash); - - const output = new Output(); - output.value = value; - output.script.fromAddress(addr); - outputs.push(output); - } - - const options = { - outputs: outputs, - subtractFee: subtract, - account: name, - depth: minconf - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async sendToAddress(args, help) { - if (help || args.length < 2 || args.length > 5) { - throw new RPCError(errs.MISC_ERROR, - 'sendtoaddress "bitcoinaddress" amount' - + ' ( "comment" "comment-to" subtractfeefromamount )'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const str = valid.str(0); - const value = valid.ufixed(1, 8); - const subtract = valid.bool(4, false); - - const addr = parseAddress(str, this.network); - - if (!addr || value == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const options = { - subtractFee: subtract, - outputs: [{ - address: addr, - value: value - }] - }; - - const tx = await wallet.send(options); - - return tx.txid(); - } - - async setAccount(args, help) { - // Impossible to implement in bcoin: - throw new Error('Not implemented.'); - } - - async setTXFee(args, help) { - const valid = new Validator(args); - const rate = valid.ufixed(0, 8); - - if (help || args.length < 1 || args.length > 1) - throw new RPCError(errs.MISC_ERROR, 'settxfee amount'); - - if (rate == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - this.wdb.feeRate = rate; - - return true; - } - - async signMessage(args, help) { - if (help || args.length !== 2) { - throw new RPCError(errs.MISC_ERROR, - 'signmessage "bitcoinaddress" "message"'); - } - - const wallet = this.wallet; - const valid = new Validator(args); - const b58 = valid.str(0, ''); - const str = valid.str(1, ''); - - const addr = parseHash(b58, this.network); - - const ring = await wallet.getKey(addr); - - if (!ring) - throw new RPCError(errs.WALLET_ERROR, 'Address not found.'); - - if (!wallet.master.key) - throw new RPCError(errs.WALLET_UNLOCK_NEEDED, 'Wallet is locked.'); - - const sig = messageUtil.sign(str, ring); - - return sig.toString('base64'); - } - - async walletLock(args, help) { - const wallet = this.wallet; - - if (help || (wallet.master.encrypted && args.length !== 0)) - throw new RPCError(errs.MISC_ERROR, 'walletlock'); - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - await wallet.lock(); - - return null; - } - - async walletPassphraseChange(args, help) { - const wallet = this.wallet; - - if (help || (wallet.master.encrypted && args.length !== 2)) { - throw new RPCError(errs.MISC_ERROR, 'walletpassphrasechange' - + ' "oldpassphrase" "newpassphrase"'); - } - - const valid = new Validator(args); - const old = valid.str(0, ''); - const passphrase = valid.str(1, ''); - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - if (old.length < 1 || passphrase.length < 1) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter'); - - await wallet.setPassphrase(passphrase, old); - - return null; - } - - async walletPassphrase(args, help) { - const wallet = this.wallet; - const valid = new Validator(args); - const passphrase = valid.str(0, ''); - const timeout = valid.u32(1); - - if (help || (wallet.master.encrypted && args.length !== 2)) { - throw new RPCError(errs.MISC_ERROR, - 'walletpassphrase "passphrase" timeout'); - } - - if (!wallet.master.encrypted) { - throw new RPCError( - errs.WALLET_WRONG_ENC_STATE, - 'Wallet is not encrypted.'); - } - - if (passphrase.length < 1) - throw new RPCError(errs.INVALID_PARAMETER, 'Invalid parameter'); - - if (timeout == null) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter'); - - await wallet.unlock(passphrase, timeout); - - return null; - } - - async importPrunedFunds(args, help) { - if (help || args.length !== 2) { - throw new RPCError(errs.MISC_ERROR, - 'importprunedfunds "rawtransaction" "txoutproof"'); - } - - const valid = new Validator(args); - const txRaw = valid.buf(0); - const blockRaw = valid.buf(1); - - if (!txRaw || !blockRaw) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - const tx = TX.fromRaw(txRaw); - const block = MerkleBlock.fromRaw(blockRaw); - const hash = block.hash(); - - if (!block.verify()) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - if (!block.hasTX(tx.hash())) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - const entry = await this.client.getEntry(hash); - - if (!entry) - throw new RPCError(errs.VERIFY_ERROR, 'Invalid proof.'); - - const meta = BlockMeta.fromEntry(entry); - - if (!await this.wdb.addTX(tx, meta)) - throw new RPCError(errs.WALLET_ERROR, - 'Address for TX not in wallet, or TX already in wallet'); - - return null; - } - - async removePrunedFunds(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'removeprunedfunds "txid"'); - - const wallet = this.wallet; - const valid = new Validator(args); - const hash = valid.brhash(0); - - if (!hash) - throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.'); - - if (!await wallet.remove(hash)) - throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.'); - - return null; - } - - async selectWallet(args, help) { - const valid = new Validator(args); - const id = valid.str(0); - - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'selectwallet "id"'); - - const wallet = await this.wdb.get(id); - - if (!wallet) - throw new RPCError(errs.WALLET_ERROR, 'Wallet not found.'); - - this.wallet = wallet; - - return null; - } - - async getMemoryInfo(args, help) { - if (help || args.length !== 0) - throw new RPCError(errs.MISC_ERROR, 'getmemoryinfo'); - - return this.logger.memoryUsage(); - } - - async setLogLevel(args, help) { - if (help || args.length !== 1) - throw new RPCError(errs.MISC_ERROR, 'setloglevel "level"'); - - const valid = new Validator(args); - const level = valid.str(0, ''); - - this.logger.setLevel(level); - - return null; - } -} - -/* - * Helpers - */ - -function parseHash(raw, network) { - const addr = parseAddress(raw, network); - return addr.getHash(); -} - -function parseAddress(raw, network) { - try { - return Address$1.fromString(raw, network); - } catch (e) { - throw new RPCError(errs.INVALID_ADDRESS_OR_KEY, 'Invalid address.'); - } -} - -function parseSecret(raw, network) { - try { - return KeyRing.fromSecret(raw, network); - } catch (e) { - throw new RPCError(errs.INVALID_ADDRESS_OR_KEY, 'Invalid key.'); - } -} - -/* - * Expose - */ - -var rpc = RPC$1; - -/*! - * plugin.js - wallet plugin for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -(function (exports) { - -const EventEmitter = require$$1$4; -const WalletDB = walletdb; -const NodeClient = nodeclient; -const HTTP = http; -const RPC = rpc; - -/** - * @exports wallet/plugin - */ - -const plugin = exports; - -/** - * Plugin - * @extends EventEmitter - */ - -class Plugin extends EventEmitter { - /** - * Create a plugin. - * @constructor - * @param {Node} node - */ - - constructor(node) { - super(); - - this.config = node.config.filter('wallet'); - - if (node.config.options.file) - this.config.open('wallet.conf'); - - this.network = node.network; - this.logger = node.logger; - - this.client = new NodeClient(node); - - this.wdb = new WalletDB({ - network: this.network, - logger: this.logger, - workers: this.workers, - client: this.client, - prefix: this.config.prefix, - memory: this.config.bool('memory', node.memory), - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - witness: this.config.bool('witness'), - wipeNoReally: this.config.bool('wipe-no-really'), - spv: node.spv - }); - - this.rpc = new RPC(this); - - this.http = new HTTP({ - network: this.network, - logger: this.logger, - node: this, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key', node.config.str('api-key')), - walletAuth: this.config.bool('wallet-auth'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - adminToken: this.config.str('admin-token') - }); - - this.init(); - } - - init() { - this.wdb.on('error', err => this.emit('error', err)); - this.http.on('error', err => this.emit('error', err)); - } - - async open() { - await this.wdb.open(); - this.rpc.wallet = this.wdb.primary; - await this.http.open(); - } - - async close() { - await this.http.close(); - this.rpc.wallet = null; - await this.wdb.close(); - } -} - -/** - * Plugin name. - * @const {String} - */ - -plugin.id = 'walletdb'; - -/** - * Plugin initialization. - * @param {Node} node - * @returns {WalletDB} - */ - -plugin.init = function init(node) { - return new Plugin(node); -}; -}(plugin)); - -/*! - * server.js - wallet server for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -const assert$1 = assert_1$g; -const Node = node$1; -const WalletDB$1 = walletdb; -const HTTP = http; -const Client = client; -const RPC = rpc; - -/** - * Wallet Node - * @extends Node - */ - -class WalletNode extends Node { - /** - * Create a wallet node. - * @constructor - * @param {Object?} options - */ - - constructor(options) { - super('bcoin', 'wallet.conf', 'wallet.log', options); - - this.opened = false; - - this.client = new Client({ - network: this.network, - url: this.config.str('node-url'), - host: this.config.str('node-host'), - port: this.config.uint('node-port', this.network.rpcPort), - ssl: this.config.bool('node-ssl'), - apiKey: this.config.str('node-api-key') - }); - - this.wdb = new WalletDB$1({ - network: this.network, - logger: this.logger, - workers: this.workers, - client: this.client, - prefix: this.config.prefix, - memory: this.config.bool('memory'), - maxFiles: this.config.uint('max-files'), - cacheSize: this.config.mb('cache-size'), - witness: this.config.bool('witness'), - wipeNoReally: this.config.bool('wipe-no-really'), - spv: this.config.bool('spv') - }); - - this.rpc = new RPC(this); - - this.http = new HTTP({ - network: this.network, - logger: this.logger, - node: this, - prefix: this.config.prefix, - ssl: this.config.bool('ssl'), - keyFile: this.config.path('ssl-key'), - certFile: this.config.path('ssl-cert'), - host: this.config.str('http-host'), - port: this.config.uint('http-port'), - apiKey: this.config.str('api-key'), - walletAuth: this.config.bool('wallet-auth'), - noAuth: this.config.bool('no-auth'), - cors: this.config.bool('cors'), - adminToken: this.config.str('admin-token') - }); - - this.init(); - } - - /** - * Initialize the node. - * @private - */ - - init() { - this.wdb.on('error', err => this.error(err)); - this.http.on('error', err => this.error(err)); - - this.loadPlugins(); - } - - /** - * Open the node and all its child objects, - * wait for the database to load. - * @returns {Promise} - */ - - async open() { - assert$1(!this.opened, 'WalletNode is already open.'); - this.opened = true; - - await this.handlePreopen(); - await this.wdb.open(); - - this.rpc.wallet = this.wdb.primary; - - await this.openPlugins(); - - await this.http.open(); - await this.handleOpen(); - - this.logger.info('Wallet node is loaded.'); - } - - /** - * Close the node, wait for the database to close. - * @returns {Promise} - */ - - async close() { - assert$1(this.opened, 'WalletNode is not open.'); - this.opened = false; - - await this.handlePreclose(); - await this.http.close(); - - await this.closePlugins(); - - this.rpc.wallet = null; - - await this.wdb.close(); - await this.handleClose(); - } -} - -/* - * Expose - */ - -var node = WalletNode; - -/*! - * wallet/index.js - wallet for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module wallet - */ - -wallet$2.Account = account; -wallet$2.Client = client; -wallet$2.common = common$5; -wallet$2.HTTP = http; -wallet$2.layout = layout$2; -wallet$2.MasterKey = masterkey; -wallet$2.NodeClient = nodeclient; -wallet$2.Path = path$3; -wallet$2.plugin = plugin; -wallet$2.records = records$2.exports; -wallet$2.RPC = rpc; -wallet$2.Node = node; -wallet$2.TXDB = txdb; -wallet$2.WalletDB = walletdb; -wallet$2.Wallet = wallet$1; -wallet$2.WalletKey = walletkey; - -var workers = {}; - -/*! - * workers/index.js - workers for bcoin - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -/** - * @module workers - */ - -workers.Framer = framer; -workers.jobs = jobs$1; -workers.packets = packets$2; -workers.Parser = parser$1; -workers.WorkerPool = workerpool; - -/*! - * bcoin.js - a javascript bitcoin library. - * Copyright (c) 2014-2015, Fedor Indutny (MIT License). - * Copyright (c) 2014-2017, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcoin - */ - -(function (exports) { - -/** - * A bcoin "environment" which exposes all - * constructors for primitives, the blockchain, - * mempool, wallet, etc. It also exposes a - * global worker pool. - * - * @exports bcoin - * @type {Object} - */ - -const bcoin = exports; - -/** - * Set the default network. - * @param {String} network - */ - -bcoin.set = function set(network) { - bcoin.Network.set(network); - return bcoin; -}; - -/* - * Expose - */ - -// Blockchain -bcoin.blockchain = blockchain; -bcoin.Chain = chain$1; -bcoin.ChainEntry = chainentry; - -// BTC -bcoin.btc = btc; -bcoin.Amount = amount; -bcoin.URI = uri; - -// Client -bcoin.client = client$2; -bcoin.NodeClient = node$3; -bcoin.WalletClient = wallet$3; - -// Coins -bcoin.coins = coins; -bcoin.Coins = coins$1; -bcoin.CoinEntry = coinentry; -bcoin.CoinView = coinview; - -// HD -bcoin.hd = hd; -bcoin.HDPrivateKey = _private; -bcoin.HDPublicKey = _public; -bcoin.Mnemonic = mnemonic; - -// Index -bcoin.indexer = indexer$1; -bcoin.Indexer = indexer; -bcoin.TXIndexer = txindexer; -bcoin.AddrIndexer = addrindexer$1; - -// Mempool -bcoin.mempool = mempool$1; -bcoin.Fees = fees; -bcoin.Mempool = mempool; -bcoin.MempoolEntry = mempoolentry; - -// Miner -bcoin.mining = mining; -bcoin.Miner = miner; - -// Net -bcoin.net = net$3; -bcoin.packets = packets$6; -bcoin.Peer = peer$1; -bcoin.Pool = pool; - -// Node -bcoin.node = node$2; -bcoin.Node = node$1; -bcoin.FullNode = fullnode; -bcoin.SPVNode = spvnode; - -// Primitives -bcoin.primitives = primitives; -bcoin.Address = address$1; -bcoin.Block = block$1; -bcoin.Coin = coin; -bcoin.Headers = headers; -bcoin.Input = input; -bcoin.InvItem = invitem; -bcoin.KeyRing = keyring; -bcoin.MerkleBlock = merkleblock; -bcoin.MTX = mtx$1.exports; -bcoin.Outpoint = outpoint; -bcoin.Output = output; -bcoin.TX = tx; - -// Protocol -bcoin.protocol = protocol; -bcoin.consensus = consensus$s; -bcoin.Network = network; -bcoin.networks = networks$1; -bcoin.policy = policy$9; - -// Script -bcoin.script = script$1; -bcoin.Opcode = opcode$1; -bcoin.Program = program$1; -bcoin.Script = script$2; -bcoin.ScriptNum = scriptnum; -bcoin.SigCache = sigcache; -bcoin.Stack = stack; -bcoin.Witness = witness; - -// Utils -bcoin.utils = utils; -bcoin.util = util$y; - -// Wallet -bcoin.wallet = wallet$2; -bcoin.WalletDB = walletdb; - -// Workers -bcoin.workers = workers; -bcoin.WorkerPool = workerpool; - -// Package Info -bcoin.pkg = pkg$4; -}(bcoinBrowser)); - -const config = require$$0$1; -const merge$3 = lodash_merge.exports; - -// External Dependencies -const BN = bn$2.exports; - -// Types -const Actor$5 = actor; -const EncryptedPromise = promise; -const Collection$3 = collection$1; -const Consensus = consensus$t; -const Channel = channel; -const Hash256 = hash256$l; -const Service$7 = service_1; -const Secret = secret; -const State$3 = state$2; - -// Bcoin -// For the browser... -// const bcoin = require('bcoin/lib/bcoin-browser'); -// For the node... -const bcoin = bcoinBrowser; - -// TODO: most of these should be converted to use Consensus, -// provided above. Refactor these to use `this.provider` or -// `this.consensus` for maximum portability. -// ATTN: @martindale -// Convenience classes... -const Address = bcoin.Address; -const Coin = bcoin.Coin; -const WalletDB = bcoin.WalletDB; -bcoin.wallet.WalletKey; -const Outpoint = bcoin.Outpoint; -bcoin.Output; -bcoin.wallet.WalletKey; -const Mnemonic = bcoin.hd.Mnemonic; -bcoin.hd; -const MTX = bcoin.MTX; -const Script$3 = bcoin.Script; - -/** - * Manage keys and track their balances. - * @property {String} id Unique identifier for this {@link Wallet}. - * @type {Object} - */ -class Wallet$2 extends Service$7 { - /** - * Create an instance of a {@link Wallet}. - * @param {Object} [settings={}] Configure the wallet. - * @param {Number} [settings.verbosity=2] One of: 0 (none), 1 (error), 2 (warning), 3 (notice), 4 (debug), 5 (audit) - * @param {Object} [settings.key] Key to restore from. - * @param {String} [settings.key.seed] Mnemonic seed for a restored wallet. - * @return {Wallet} Instance of the wallet. - */ - constructor (settings = {}) { - super(settings); - - // Create a Marshalling object - this.marshall = { - agents: [], - collections: { - transactions: null, // not yet loaded, seek for Buffer, - orders: null - } - }; - - this.settings = merge$3({ - name: 'primary', - network: config.network, - language: config.language, - locktime: 144, - decimals: 8, - shardsize: 4, - verbosity: 2, - witness: true, - key: null - }, settings); - - bcoin.set(this.settings.network); - - this.database = new WalletDB({ - network: 'regtest' - }); - - this.account = null; - this.manager = null; - this.wallet = null; - this.master = null; - this.ring = null; - this.seed = null; - this.key = null; - - // TODO: enable wordlist translations - // this.words = Mnemonic.getWordlist(this.settings.language).words; - this.mnemonic = null; - this.index = 0; - - this.accounts = new Collection$3(); - this.addresses = new Collection$3(); - this.keys = new Collection$3(); - this.coins = new Collection$3(); - this.secrets = new Collection$3({ - methods: { - create: this._prepareSecret.bind(this) - } - }); - - this.transactions = new Collection$3(); - this.txids = new Collection$3(); - this.outputs = new Collection$3(); - - this.entity = new Actor$5(this.settings); - this.consensus = new Consensus(); - - // Internal State - this._state = merge$3(this._state, { - actors: {}, - asset: this.settings.asset || null, - balances: { - confirmed: 0, - unconfirmed: 0 - }, - space: {}, // tracks addresses in shard - keys: {}, - services: {}, - status: 'PAUSED', - transactions: {}, - orders: {}, - outputs: {} - }); - - Object.defineProperty(this, 'database', { enumerable: false }); - // TODO: remove these - Object.defineProperty(this, 'accounts', { enumerable: false }); - Object.defineProperty(this, 'addresses', { enumerable: false }); - Object.defineProperty(this, 'utxos', { enumerable: false }); - Object.defineProperty(this, 'keys', { enumerable: false }); - Object.defineProperty(this, 'outputs', { enumerable: false }); - Object.defineProperty(this, 'secrets', { enumerable: false }); - Object.defineProperty(this, 'swarm', { enumerable: false }); - Object.defineProperty(this, 'transactions', { enumerable: false }); - Object.defineProperty(this, 'wallet', { enumerable: false }); - - return this; - } - - get balance () { - return this.get('/balances/confirmed'); - } - - get orders () { - return this.get('/orders'); - } - - trust (emitter) { - const wallet = this; - const listener = emitter.on('message', this._handleGenericMessage.bind(this)); - - // Keep track of all event handlers - this.marshall.agents.push(listener); - - emitter.on('transaction', async function trustedHandler (msg) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Received transaction from trusted event emitter:', msg); - await wallet.addTransactionToWallet(msg); - }); - - return this; - } - - _handleGenericMessage (msg) { - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Received message from trusted event emitter:', msg); - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:WALLET]', 'Trusted emitter gave us:', msg); - - // TODO: bind @fabric/core/services/bitcoin to addresses on wallet... - // ATTN: Eric - - // TODO: update channels - // TODO: parse as {@link Message} - // TODO: store in this.messages - switch (msg['@type']) { - case 'ServiceMessage': - return this._processServiceMessage(msg['@data']); - default: - return console.warn('[FABRIC:WALLET]', `Unhandled message type: ${msg['@type']}`); - } - } - - async _processServiceMessage (msg) { - switch (msg['@type']) { - case 'BitcoinBlock': - this.processBitcoinBlock(msg['@data']); - break; - case 'BitcoinTransaction': - // TODO: validate destination is this wallet - this.addTransactionToWallet(msg['@data']); - break; - default: - return console.warn('[FABRIC:WALLET]', `Unhandled message type: ${msg['@type']}`); - } - } - - async processBitcoinBlock (block) { - if (this.settings.verbosity >= 4) console.log('[FABRIC:WALLET]', 'Processing block:', block); - if (!block.block) return 0; - for (let i = 0; i < block.block.hashes.length; i++) { - const txid = block.block.hashes[i].toString('hex'); - // ATTN: Eric - // TODO: process transaction - console.log('found txid in block:', txid); - } - } - - async _attachTXID (txid) { - // TODO: check that `txid` is a proper TXID - let txp = await this.txids.create(txid); - if (this.settings.verbosity >= 5) console.log('[AUDIT]', `Attached TXID ${txid} to Wallet ID ${this.id}, result:`, txp); - return txp; - } - - async _handleFabricTransaction (tx) { - console.log('[FABRIC:WALLET]', 'Handling Fabric Transaction:', tx); - } - - async addTransactionToWallet (transaction) { - if (this.settings.verbosity >= 5) console.log('[AUDIT]', '[FABRIC:WALLET]', 'Adding transaction to Wallet:', transaction); - let entity = new Actor$5(transaction); - if (!transaction.spent) transaction.spent = false; - if (!transaction.outputs) transaction.outputs = []; - this._state.transactions.push(transaction); - await this.commit(); - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Wallet transactions now:', this._state.transactions); - - for (let i = 0; i < transaction.outputs.length; i++) { - let output = transaction.outputs[i].toJSON(); - let address = await this._findAddressInCurrentShard(output.address); - - // TODO: test these outputs - // console.log('output to parse:', output); - // console.log('address found:', address); - - if (address) { - this._state.outputs.push(output); - this._state.utxos.push(new Coin(transaction.outputs[i])); - this.emit('payment', { - '@type': 'WalletPayment', - '@data': { - id: entity.id, - transaction: transaction - } - }); - } - - /* switch (output.type) { - default: - console.warn('[FABRIC:WALLET]', 'Unhandled output type:', output.type); - break; - case 'pubkeyhash': - let address = await this._findAddressInCurrentShard(output.address); - break; - } */ - } - - await this.commit(); - } - - async _findAddressInCurrentShard (address) { - for (let i = 0; i < this.shard.length; i++) { - let slice = this.shard[i]; - if (slice.string === address) return slice; - } - return null; - } - - async _createMultisigAddress (m, n, keys) { - let result = null; - - // Check for required fields - if (!m) throw new Error('Parameter 0 required: m'); - if (!m) throw new Error('Parameter 1 required: n'); - if (!keys || !keys.length) throw new Error('Parameter 2 required: keys'); - - try { - // Compose the address - const multisig = Script$3.fromMultisig(m, n, keys); - const address = multisig.getAddress().toBase58(this.settings.network); - - // TODO: remove this audit message - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'Created multisig address:', address); - - // Assign to output - result = address; - } catch (exception) { - console.error('[FABRIC:WALLET]', 'Could not create multisig address:', exception); - } - - return result; - } - - async _spendToAddress (amount, address) { - const mtx = new MTX(); - const change = await this.wallet.receiveAddress(); - const coins = await this.wallet.getCoins(); - - this.emit('log', `Amount to send: ${amount}`); - - mtx.addOutput({ - address: recipient, - value: parseInt(amount) - }); - - await mtx.fund(coins, { - rate: 10, - changeAddress: change - }); - - mtx.sign(this.ring); - const tx = mtx.toTX(); - tx.check(mtx.view); - - return tx; - } - - async _getUnspentOutput (amount) { - if (!this._state.utxos.length) throw new Error('No available funds.'); - // TODO: use coin selection - const mtx = new MTX(); - - // Send 10,000 satoshis to ourself. - mtx.addOutput({ - address: this.ring.getAddress(), - value: amount - }); - - await mtx.fund(this._state.utxos, { - // Use a rate of 10,000 satoshis per kb. - // With the `fullnode` object, you can - // use the fee estimator for this instead - // of blindly guessing. - rate: 10000, - // Send the change back to ourselves. - changeAddress: this.ring.getAddress() - }); - // TODO: use the MTX to select outputs - - return this._state.utxos[0]; - } - - /** - * Returns a bech32 address for the provided {@link Script}. - * @param {Script} script - */ - getAddressForScript (script) { - // TODO: use Fabric.Script - let p2wsh = script.forWitness(); - let address = p2wsh.getAddress().toBech32(this.settings.network); - return address; - } - - /** - * Generate a {@link BitcoinAddress} for the supplied {@link BitcoinScript}. - * @param {BitcoinScript} redeemScript - */ - getAddressFromRedeemScript (redeemScript) { - if (!redeemScript) return null; - return Address.fromScripthash(redeemScript.hash160()); - } - - /** - * Create a priced order. - * @param {Object} order - * @param {Object} order.asset - * @param {Object} order.amount - */ - async createPricedOrder (order) { - if (!order.asset) throw new Error('Order parameter "asset" is required.'); - if (!order.amount) throw new Error('Order parameter "amount" is required.'); - - order.amount % (10 * this.settings.decimals); - let parts = order.amount / (10 * this.settings.decimals); - - let partials = []; - // TODO: remove short-circuit - await this._generateFakeCoinbase(order.amount); - new MTX(); - let script = new Script$3(); - - let secret = await this.generateSecret(); - let image = Buffer.from(secret.hash); - - console.log('secret generated:', secret); - console.log('image of secret:', image); - - let refund = await this.ring.getPublicKey(); - console.log('refund:', refund); - - script.pushSym('OP_IF'); - script.pushSym('OP_SHA256'); - script.pushData(image); - script.pushSym('OP_EQUALVERIFY'); - script.pushData(order.counterparty); - script.pushSym('OP_ELSE'); - script.pushInt(this.settings.locktime); - script.pushSym('OP_CHECKSEQUENCEVERIFY'); - script.pushSym('OP_DROP'); - script.pushData(refund); - script.pushSym('OP_ENDIF'); - script.pushSym('OP_CHECKSIG'); - script.compile(); - - // TODO: complete order construction - for (let i = 0; i < parts; i++) { - // TODO: should be split parts - partials.push(script); - } - - let entity = new Actor$5({ - comment: 'List of transactions to validate.', - orders: partials, - transactions: partials - }); - - return entity; - } - - async createHTLC (contract) { - // if (!contract.asset) throw new Error('Contract parameter "asset" is required.'); - if (!contract.amount) throw new Error('Contract parameter "amount" is required.'); - // TODO: remove short-circuit - if (!contract.counterparty) { - // TODO: replace this with a randomly-generated input - // sha256 - // -> pubkey - contract.counterparty = await this.ring.getPublicKey(); - console.log('contract counterparty artificially generated:', contract.counterparty); - } - - let leftover = contract.amount % this.settings.decimals; - let parts = contract.amount / this.settings.decimals; - - let partials = []; - // TODO: remove short-circuit - await this._generateFakeCoinbase(contract.amount); - new MTX(); - let script = new Script$3(); - - let secret = await this.generateSecret(); - let image = Buffer.from(secret.hash); - - console.log('secret generated:', secret); - console.log('image of secret:', image); - - let refund = await this.ring.getPublicKey(); - console.log('refund:', refund); - - script.pushSym('OP_IF'); - script.pushSym('OP_SHA256'); - script.pushData(image); - script.pushSym('OP_EQUALVERIFY'); - script.pushData(contract.counterparty); - script.pushSym('OP_ELSE'); - script.pushInt(this.settings.locktime); - script.pushSym('OP_CHECKSEQUENCEVERIFY'); - script.pushSym('OP_DROP'); - script.pushData(refund); - script.pushSym('OP_ENDIF'); - script.pushSym('OP_CHECKSIG'); - script.compile(); - - // TODO: complete order construction - for (let i = 0; i < parts; i++) { - // TODO: should be split parts - partials.push(script); - } - - console.log('parts:', partials); - console.log('leftover:', leftover); - - let entity = new Actor$5({ - comment: 'List of transactions to validate.', - orders: partials, - transactions: partials, - type: 'BitcoinTransaction' - }); - - return entity; - } - - async generateSecret () { - const secret = new Secret(); - const entity = await this.secrets.create({ - hash: secret.hash - }); - console.log('created secret:', entity); - return entity; - } - - async generateSignedTransactionTo (address, amount) { - if (!address) throw new Error(`Parameter "address" is required.`); - if (!amount) throw new Error(`Parameter "amount" is required.`); - - new BN(amount + '', 10); - // TODO: labeled keypairs - await this.generateCleanKeyPair(); - let change = await this.generateCleanKeyPair(); - - let mtx = new MTX(); - await this._generateFakeCoinbase(amount); - - mtx.addOutput({ - address: address, - amount: amount - }); - - await mtx.fund(this._state.utxos, { - rate: 10000, // TODO: fee calculation - changeAddress: change.address - }); - - mtx.sign(this.ring); - // mtx.signInput(0, this.ring); - - let tx = mtx.toTX(); - let output = Coin.fromTX(mtx, 0, -1); - let raw = mtx.toRaw(); - let hash = Hash256.digest(raw.toString('hex')); - - return { - type: 'BitcoinTransaction', - data: { - tx: tx, - output: output, - raw: raw.toString('hex'), - hash: hash - } - }; - } - - async generateOrderRootTo (pubkey, amount) { - if (!pubkey) throw new Error(`Parameter "pubkey" is required.`); - if (!amount) throw new Error(`Parameter "amount" is required.`); - - new BN(amount + '', 10); - // TODO: labeled keypairs - await this.generateCleanKeyPair(); - let change = await this.generateCleanKeyPair(); - - let mtx = new MTX(); - await this._generateFakeCoinbase(amount); - - mtx.addOutput({ - address: address, - amount: amount - }); - - await mtx.fund(this._state.utxos, { - rate: 10000, // TODO: fee calculation - changeAddress: change.address - }); - - mtx.sign(this.ring); - // mtx.signInput(0, this.ring); - - let tx = mtx.toTX(); - let output = null; - - try { - output = Coin.fromTX(mtx, 0, -1); - } catch (exception) { - console.error('[FABRIC:WALLET]', 'Could not generate output:', exception); - } - - let raw = mtx.toRaw(); - let hash = Hash256.digest(raw.toString('hex')); - - return { - type: 'BitcoinTransaction', - data: { - tx: tx, - output: output, - raw: raw.toString('hex'), - hash: hash - } - }; - } - - addInputForCrowdfund (coin, inputIndex, mtx, keyring, hashType) { - let sampleCoin = coin instanceof Coin ? coin : Coin.fromJSON(coin); - if (!hashType) hashType = Script$3.hashType.ANYONECANPAY | Script$3.hashType.ALL; - - mtx.addCoin(sampleCoin); - mtx.scriptInput(inputIndex, sampleCoin, keyring); - mtx.signInput(inputIndex, sampleCoin, keyring, hashType); - - console.log('MTX after Input added (and signed):', mtx); - - // TODO: return a full object for Fabric - return mtx; - } - - balanceFromState (state) { - if (!state.transactions) throw new Error('State does not provide a `transactions` property.'); - if (!state.transactions.length) return 0; - return state.transactions.reduce((acc, obj, i) => { - if (!acc.value) acc.value = 0; - acc.value += obj.value; - }); - } - - getFeeForInput (coin, address, keyring, rate) { - let testMTX = new MTX(); - - // TODO: restore swap code, abstract input types - // this.addInputForCrowdfund(coin, 0, testMTX, this.keyring); - - return testMTX.getMinFee(null, rate); - } - - async _createAccount (data) { - // console.log('wallet creating account with data:', data); - await this._load(); - let existing = await this.wallet.getAccount(data.name); - if (existing) return existing; - let account = await this.wallet.createAccount(data); - return account; - } - - async _updateBalance (amount) { - return this.set('/balances/confirmed', amount); - } - - _handleWalletTransaction (tx) { - console.log('[BRIDGE:WALLET]', 'incoming transaction:', tx); - } - - _getDepositAddress () { - return this.ring.getAddress().toString(); - } - - _getSeed () { - return this.seed; - } - - _getAccountByIndex (index = 0) { - return { - address: this.account.deriveReceive(index).getAddress('string') - }; - } - - async _splitCoinbase (funderKeyring, coin, targetAmount, txRate) { - // loop through each coinbase coin to split - let coins = []; - - const mtx = new MTX(); - - assert(coin.value > targetAmount, 'coin value is not enough!'); - - // creating a transaction that will have an output equal to what we want to fund - mtx.addOutput({ - address: funderKeyring.getAddress(), - value: targetAmount - }); - - // the fund method will automatically split - // the remaining funds to the change address - // Note that in a real application these splitting transactions will also - // have to be broadcast to the network - await mtx.fund([coin], { - rate: txRate, - // send change back to an address belonging to the funder - changeAddress: funderKeyring.getAddress() - }).then(() => { - // sign the mtx to finalize split - mtx.sign(funderKeyring); - assert(mtx.verify()); - - const tx = mtx.toTX(); - assert(tx.verify(mtx.view)); - - const outputs = tx.outputs; - - // get coins from tx - outputs.forEach((outputs, index) => { - coins.push(Coin.fromTX(tx, index, -1)); - }); - }).catch(e => console.log('There was an error: ', e)); - - return coins; - } - - async composeCrowdfund (coins) { - // Loop through each coinbase - for (let index in coins) { - const coinbase = coins[index][0]; - // estimate fee for each coin (assuming their split coins will use same tx type) - const estimatedFee = getFeeForInput(coinbase, fundeeAddress, funders[index], txRate); - const targetPlusFee = amountToFund + estimatedFee; - - // split the coinbase with targetAmount plus estimated fee - await Utils.splitCoinbase(funders[index], coinbase, targetPlusFee, txRate); - } - // ... we'll keep filling out the rest of the code here - } - - async _addOutputToSpendables (coin) { - this._state.utxos.push(coin); - return this; - } - - async getUnusedAddress () { - let clean = await this.wallet.receiveAddress(); - this.emit('log', `unused address: ${clean}`); - return clean; - } - - async getUnspentTransactionOutputs () { - return this._state.transactions.filter(x => { - return (x.spent === 0); - }); - } - - async _generateFakeCoinbase (amount = 1) { - // TODO: use Satoshis for all calculations - new BN(amount, 10); - - // TODO: remove all fake coinbases - // TODO: remove all short-circuits - // fake coinbase - let cb = new MTX(); - let clean = await this.generateCleanKeyPair(); - - // Coinbase Input - cb.addInput({ - prevout: new Outpoint(), - script: new Script$3(), - sequence: 0xffffffff - }); - - // Add Output to pay ourselves - cb.addOutput({ - address: clean.address, - value: 5000000000 - }); - - // TODO: remove short-circuit - let coin = Coin.fromTX(cb, 0, -1); - cb.toTX(); - - // TODO: remove entirely, test short-circuit removal - // await this._addOutputToSpendables(coin); - - return { - type: 'BitcoinTransactionOutput', - data: { - tx: cb, - coin: coin - } - }; - } - - async _getFreeCoinbase (amount = 1) { - let num = new BN(amount, 10); - let max = new BN('5000000000000', 10); // upper limit per coinbase - let hun = new BN('100000000', 10); // one hundred million - let value = num.mul(hun); // amount in Satoshis - - if (value.gt(max)) { - console.warn('Value (in satoshis) higher than max:', value.toString(10), `(max was ${max.toString(10)})`); - value = max; - } - - let v = value.toString(10); - let w = parseInt(v); - - await this._load(); - const coinbase = new MTX(); - - // INSERT 1 Input - coinbase.addInput({ - prevout: new Outpoint(), - script: new Script$3(), - sequence: 0xffffffff - }); - - try { - // INSERT 1 Output - coinbase.addOutput({ - address: this._getDepositAddress(), - value: w - }); - } catch (E) { - console.error('Could not add output:', E); - } - - // TODO: wallet._getSpendableOutput() - let coin = Coin.fromTX(coinbase, 0, -1); - this._state.utxos.push(coin); - - // console.log('coinbase:', coinbase); - - return coinbase; - } - - /** - * Signs a transaction with the keyring. - * @param {BcoinTX} tx - */ - async _sign (tx) { - let signature = await tx.sign(this.keyring); - console.log('signing tx:', tx); - console.log('signing sig:', signature); - return Object.assign({}, tx, { signature }); - } - - /** - * Create a crowdfunding transaction. - * @param {Object} fund - */ - async _createCrowdfund (fund = {}) { - if (!fund.amount) return null; - if (!fund.address) return null; - - let index = fund.index || 0; - let hashType = Script$3.hashType.ANYONECANPAY | Script$3.hashType.ALL; - - mtx.addCoin(this._state.utxos[0]); - mtx.scriptInput(index, this._state.utxos[0], this.keyring); - mtx.signInput(index, this._state.utxos[0], this.keyring, hashType); - - await this.commit(); - - return { - tx: mtx.toTX(), - mtx: mtx - }; - } - - async _createSeed (password = null) { - const mnemonic = new Mnemonic({ bits: 256 }); - const master = bcoin.hd.fromMnemonic(mnemonic); - - await this._load(); - - const wallet = await this.database.create({ - network: this.settings.network, - master: master - }); - - // TODO: allow override of wallet name - const account = await wallet.getAccount('default'); - const data = { - seed: mnemonic.toString(), - master: master.privateKey.toString('hex'), - xpub: { - meta: { - depth: account.accountKey.depth, - parentFingerPrint: account.accountKey.parentFingerPrint, - childIndex: account.accountKey.childIndex, - chainCode: account.accountKey.chainCode.toString('hex'), - publicKey: account.accountKey.publicKey.toString('hex'), - fingerPrint: account.accountKey.fingerPrint - }, - public: account.accountKey.publicKey.toString('hex') - }, - key: { - private: master.privateKey.toString('hex'), - public: master.publicKey.toString('hex') - } - }; - - return data; - } - - async _importSeed (seed) { - let mnemonic = new Mnemonic(seed); - return this._loadSeed(mnemonic.toString()); - } - - async _createIncentivizedTransaction (config) { - console.log('creating incentivized transaction with config:', config); - - let mtx = new MTX(); - let data = new Script$3(); - let clean = await this.generateCleanKeyPair(); - - data.pushSym('OP_IF'); - data.pushSym('OP_SHA256'); - data.pushData(Buffer.from(config.hash)); - data.pushSym('OP_EQUALVERIFY'); - data.pushData(Buffer.from(config.payee)); - data.pushSym('OP_CHECKSIG'); - data.pushSym('OP_ELSE'); - data.pushInt(config.locktime); - data.pushSym('OP_CHECKSEQUENCEVERIFY'); - data.pushSym('OP_DROP'); - data.pushData(Buffer.from(clean.public)); - data.pushSym('OP_CHECKSIG'); - data.pushSym('OP_ENDIF'); - data.compile(); - - console.log('address data:', data); - let segwitAddress = await this.getAddressForScript(data); - - mtx.addOutput({ - address: segwitAddress, - value: 0 - }); - - // TODO: load available outputs from wallet - let out = await mtx.fund([] /* coins */, { - // TODO: fee estimation - rate: 10000, - changeAddress: this.ring.getAddress() - }); - - console.log('transaction:', out); - return out; - } - - async _getBondAddress () { - await this._load(); - - new Script$3(); - let clean = await this.generateCleanKeyPair(); - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'getting bond address, clean:', clean); - - // write the contract - // script.pushData(clean.public.toString('hex')); - // script.pushSym('OP_CHECKSIG'); - - // compile the script - // script.compile(); - - return { - pubkey: clean.public.toString(), - address: clean.address - }; - } - - async _getSpendableOutput (target, amount = 0) { - let self = this; - let out = null; - let mtx = new MTX(); - - await this._load(); - - console.log('funding transaction with coins:', this._state.utxos); - - // INSERT 1 Output - mtx.addOutput({ - address: target, - value: amount - }); - - out = await mtx.fund(this._state.utxos, { - // TODO: fee estimation - rate: 10000, - changeAddress: self.ring.getAddress() - }); - - console.log('out:', out); - - console.trace('created mutable transaction:', mtx); - console.trace('created immutable transaction:', mtx.toTX()); - - return { - tx: mtx.toTX(), - mtx: mtx - }; - } - - async signInput (mtx, index, redeemScript, value, privateKey, sigHashType, version_or_flags) { - return mtx.signature( - index, - redeemScript, - value, - privateKey, - sigHashType, - version_or_flags - ); - } - - async getRedeemTX (address, fee, fundingTX, fundingTXoutput, redeemScript, inputScript, locktime, privateKey) { - // Create a mutable transaction object - let redeemTX = new MTX(); - - // Get the output we want to spend (coins sent to the P2SH address) - let coin = Coin.fromTX(fundingTX, fundingTXoutput, -1); - - // Add that coin as an input to our transaction - redeemTX.addCoin(coin); - - // Redeem the input coin with either the swap or refund script - redeemTX.inputs[0].script = inputScript; - - // Create the output back to our primary wallet - redeemTX.addOutput({ - address: address, - value: coin.value - fee - }); - - // If this was a refund redemption we need to set the sequence - // Sequence is the relative timelock value applied to individual inputs - if (locktime) { - redeemTX.setSequence(0, locktime, this.CSV_seconds); - } else { - redeemTX.inputs[0].sequence = 0xffffffff; - } - - // Set SIGHASH and replay protection bits - let version_or_flags = 0; - let type = null; - - if (this.libName === 'bcash') { - version_or_flags = this.flags; - type = Script$3.hashType.SIGHASH_FORKID | Script$3.hashType.ALL; - } - - // Create the signature authorizing the input script to spend the coin - let sig = await this.signInput( - redeemTX, - 0, - redeemScript, - coin.value, - privateKey, - type, - version_or_flags - ); - - // Insert the signature into the input script where we had a `0` placeholder - inputScript.setData(0, sig); - - // Finish up and return - inputScript.compile(); - - return redeemTX; - } - - /** - * Generate {@link Script} for claiming a {@link Swap}. - * @param {*} redeemScript - * @param {*} secret - */ - async _getSwapInputScript (redeemScript, secret) { - let inputSwap = new Script$3(); - - inputSwap.pushInt(0); // signature placeholder - inputSwap.pushData(secret); - inputSwap.pushInt(1); // - inputSwap.pushData(redeemScript.toRaw()); // P2SH - inputSwap.compile(); - - return inputSwap; - } - - /** - * Generate {@link Script} for reclaiming funds commited to a {@link Swap}. - * @param {*} redeemScript - */ - async _getRefundInputScript (redeemScript) { - let inputRefund = new Script$3(); - - inputRefund.pushInt(0); // signature placeholder - inputRefund.pushInt(0); // - inputRefund.pushData(redeemScript.toRaw()); // P2SH - inputRefund.compile(); - - return inputRefund; - } - - async _createOrderForPubkey (pubkey) { - this.emit('log', `creating ORDER transaction with pubkey: ${pubkey}`); - - let mtx = new MTX(); - let data = new Script$3(); - let clean = await this.generateCleanKeyPair(); - - let secret = 'fixed secret :)'; - let sechash = require$$0$4.createHash('sha256').update(secret).digest('hex'); - - this.emit('log', `SECRET CREATED: ${secret}`); - this.emit('log', `SECHASH: ${sechash}`); - - data.pushSym('OP_IF'); - data.pushSym('OP_SHA256'); - data.pushData(Buffer.from(sechash)); - data.pushSym('OP_EQUALVERIFY'); - data.pushData(Buffer.from(pubkey)); - data.pushSym('OP_ELSE'); - data.pushInt(86400); - data.pushSym('OP_CHECKSEQUENCEVERIFY'); - data.pushSym('OP_DROP'); - data.pushData(Buffer.from(clean.public)); - data.pushSym('OP_ENDIF'); - data.pushSym('OP_CHECKSIG'); - data.compile(); - - this.emit('log', `[AUDIT] address data: ${data}`); - let segwitAddress = await this.getAddressForScript(data); - let address = await this.getAddressFromRedeemScript(data); - - this.emit('log', `[AUDIT] segwit address: ${segwitAddress}`); - this.emit('log', `[AUDIT] normal address: ${address}`); - - mtx.addOutput({ - address: address, - value: 25000000 - }); - - // ensure a coin exists... - // NOTE: this is tracked in this._state.coins - // and thus does not need to be cast to a variable... - await this._getFreeCoinbase(); - - // TODO: load available outputs from wallet - await mtx.fund(this._state.utxos, { - // TODO: fee estimation - rate: 10000, - changeAddress: this.ring.getAddress() - }); - - let tx = mtx.toTX(); - let sig = await mtx.sign(this.ring); - - this.emit('log', 'transaction:', tx); - this.emit('log', 'sig:', sig); - - return { - tx: tx, - mtx: mtx, - sig: sig - }; - } - - async _scanBlockForTransactions (block) { - console.log('[AUDIT]', 'Scanning block for transactions:', block); - } - - async _scanChainForTransactions (chain) { - console.log('[AUDIT]', 'Scanning chain for transactions:', chain); - - let transactions = []; - - for (let i = 0; i < chain.blocks.length; i++) { - transactions.concat(await this._scanBlockForTransactions(chain.blocks[i])); - } - - return transactions; - } - - async _createChannel (channel) { - let element = new Channel(channel); - return element; - } - - async _allocateSlot () { - for (let i = 0; i < Object.keys(this._state.space).length; i++) { - let slot = this._state.space[Object.keys(this._state.space)[i]]; - if (!slot.allocation) { - this._state.space[Object.keys(this._state.space)[i]].allocation = new Secret(); - return this._state.space[Object.keys(this._state.space)[i]]; - } - } - } - - async getFirstAddressSlice (size = 256) { - await this._load(); - - // aggregate results for return - let slice = []; - - if (this.settings.verbosity >= 5) console.log('[AUDIT]', 'generating {@link Space} with settings:', this.settings); - - // iterate over length of shard, aggregate addresses - for (let i = 0; i < size; i++) { - let addr = this.account.deriveReceive(i).getAddress('string', this.settings.network); - let address = await this.addresses.create({ - string: addr, - label: `shared address ${i} for wallet ${this.id}`, - allocation: null - }); - - // TODO: restore address tracking in state - // this._state.space[addr] = address; - - slice.push(address); - } - - return slice; - } - - /** - * Create a public key from a string. - * @param {String} input Hex-encoded string to create key from. - */ - publicKeyFromString (input) { - const buf = Buffer.from(input, 'hex'); - return bcoin.KeyRing.fromPublic(buf).publicKey; - } - - async generateCleanKeyPair () { - if (this.status !== 'loaded') await this._load(); - - this.index++; - - let key = this.master.derivePath(`m/44'/0'/0'/0/${this.index}`); - let keyring = bcoin.KeyRing.fromPrivate(key.privateKey); - - return { - index: this.index, - public: keyring.publicKey.toString('hex'), - address: keyring.getAddress('string'), - keyring: keyring - }; - } - - async _handleWalletBalance (balance) { - await this._PUT('/balance', balance); - const depositor = new State$3({ name: this.settings.name || 'default' }); - await this._PUT(`/depositors/${depositor.id}/balance`, balance); - this.emit('balance', balance); - } - - async _registerAccount (obj) { - if (!obj.name) throw new Error('Account must have "name" property.'); - if (!this.database.db.loaded) { - await this.database.open(); - } - - const account = await this.accounts.create(obj); - if (this.settings.verbosity >= 4) console.log('registering account, created:', account); - - if (this.manager) { - this.manager.on('tx', this._handleWalletTransaction.bind(this)); - this.manager.on('balance', this._handleWalletBalance.bind(this)); - // TODO: check on above events, should be more like... - // this.manager.on('changes', this._handleWalletBalance.bind(this)); - } - - return account; - } - - async _prepareSecret (state) { - const entity = new Actor$5(state); - return entity; - } - - async _loadSeed (seed) { - this.settings.key = { seed }; - await this._load(); - return this.seed; - } - - async _unload () { - return this.database.close(); - } - - /** - * Initialize the wallet, including keys and addresses. - * @param {Object} settings Settings to load. - */ - async _load (settings = {}) { - if (this.wallet) return this; - - this.status = 'loading'; - this.master = null; - - if (!this.database.db.loaded) { - await this.database.open(); - } - - if (this.settings.key && this.settings.key.seed) { - this.emit('log', 'Restoring wallet from seed...'); - if (this.settings.verbosity >= 3) console.log('[AUDIT]', 'Restoring wallet from provided seed:', this.settings.key.seed); - const mnemonic = new Mnemonic(this.settings.key.seed); - this.master = bcoin.hd.fromMnemonic(mnemonic); - this.seed = new EncryptedPromise({ data: this.settings.key.seed }); - } else { - if (this.settings.verbosity >= 3) console.log('[AUDIT]', 'Generating new HD key for wallet...'); - this.master = bcoin.hd.generate(this.settings.network); - } - - try { - this.wallet = await this.database.create({ - network: this.settings.network, - master: this.master - }); - } catch (E) { - console.error('Could not create wallet:', E); - } - - // Setup Ring - this.ring = new bcoin.KeyRing(this.master, this.settings.network); - this.ring.witness = this.settings.witness; // designates witness - - if (this.settings.verbosity >= 4) console.log('keyring:', this.ring); - if (this.settings.verbosity >= 4) console.log('address from keyring:', this.ring.getAddress().toString()); - - // TODO: allow override of wallet name - this.account = await this.wallet.getAccount('default'); - - // Let's call it a shard! - this.shard = await this.getFirstAddressSlice(this.settings.shardsize); - // console.log('shard created:', await this.addresses.asMerkleTree()); - // console.log('shard created:', this.shard); - - if (this.settings.verbosity >= 3) this.emit('log', `[AUDIT] Wallet account ${JSON.stringify(this.account, null, ' ')}`); - // TODO: also retrieve key for address - // let key = this.master.derivePath('m/44/0/0/0/0'); - // TODO: label as identity address - // this.address = await this.account.receiveAddress(); - // TODO: notify downstream of short-circuit removal - - // finally, assign state... - this._state.transactions = this.settings.transaction; - this._state.orders = this.settings.orders; - this._state.outputs = this.state.actors; - - if (this.settings.verbosity >= 5) console.log('[FABRIC:WALLET]', 'state after loading:', this._state); - - this.status = 'loaded'; - this.emit('ready'); - - return this; - } - - /** - * Start the wallet, including listening for transactions. - */ - async start () { - this.status = 'STARTING'; - await this._load(); - this.status = 'STARTED'; - } -} - -var wallet = Wallet$2; - -// Constants -const { - P2P_IDENT_REQUEST, - P2P_IDENT_RESPONSE, - P2P_ROOT, - P2P_PING, - P2P_PONG, - P2P_START_CHAIN, - P2P_INSTRUCTION, - P2P_BASE_MESSAGE, - P2P_STATE_COMMITTMENT, - P2P_STATE_CHANGE, - P2P_STATE_ROOT, - ZERO_LENGTH_PLAINTEXT -} = constants$1; - -// Internals -const net = require$$6; -const crypto$4 = require$$0$4; -const stream = require$$2$2; - -// Dependencies -const merge$2 = lodash_merge.exports; -// const upnp = require('nat-upnp'); - -// Fabric Types -const Actor$4 = actor; -const Key$2 = key$1; -const Machine$4 = machine; -const Message$2 = message$1; -const Session = session; -const Reader = reader$2; -const Wallet$1 = wallet; - -/** - * An in-memory representation of a node in our network. - */ -class Peer$1 extends Actor$4 { - /** - * Create an instance of {@link Peer}. - * @param {Object} [config] Initialization Vector for this peer. - * @param {Boolean} [config.listen] Whether or not to listen for connections. - * @param {Boolean} [config.upnp] Whether or not to use UPNP for automatic configuration. - * @param {Number} [config.port=7777] Port to use for P2P connections. - * @param {Array} [config.peers=[]] List of initial peers. - */ - constructor (config = {}) { - super(config); - - this.name = 'Peer'; - this.settings = merge$2({ - address: '0.0.0.0', - network: 'regtest', - networking: true, - listen: false, - peers: [], - port: 7777, - upnp: false - }, config); - - // Network Internals - this.upnp = null; - this.server = net.createServer(this._handleConnection.bind(this)); - this.stream = new stream.Transform({ - transform (chunk, encoding, callback) { - // TODO: parse as encrypted data - callback(null, chunk); - } - }); - - this.key = new Key$2({ - network: this.settings.network, - seed: (this.settings.wallet && this.settings.wallet.seed) ? this.settings.wallet.seed : this.settings.seed - }); - - // TODO: document wallet settings - this.wallet = new Wallet$1({ - key: { - seed: (this.settings.wallet && this.settings.wallet.seed) ? this.settings.wallet.seed : this.settings.seed - } - }); - - // this.hex = this.key.public.encodeCompressed('hex'); - // this.pkh = crypto.createHash('sha256').update(this.hex).digest('hex'); - - // Public Details - this.public = { - ip: null, - port: this.settings.port - }; - - // Internal properties - this.chains = {}; - this.connections = {}; - this.peers = {}; - this.memory = {}; - this.handlers = {}; - this.messages = new Set(); - - // Internal Stack Machine - this.machine = new Machine$4(); - - this.meta = { - messages: { - inbound: 0, - outbound: 0 - } - }; - - this._state = { - peers: {}, - chains: {}, - connections: {}, - status: 'sleeping' - }; - - return this; - } - - get id () { - return this.key.pubkey; - } - - get pubkeyhash () { - return this.wallet.ring.getKeyHash('hex'); - } - - get state () { - // TODO: use Proxy - return Object.assign({}, this._state); - } - - get address () { - return this.settings.interface || this.settings.address; - } - - get port () { - return this.settings.port || 7777; - } - - set state (value) { - this._state = value; - } - - /** - * Start the Peer. - */ - async start () { - let address = null; - - if (this.settings.verbosity >= 4) console.log('[FABRIC:PEER]', 'Peer starting...'); - if (this.settings.upnp) { - this.upnp = upnp.createClient(); - } - - try { - await this.wallet.start(); - } catch (E) { - console.error('[FABRIC:PEER]', 'Could not start wallet:', E); - } - - if (this.settings.listen) { - address = await this.listen(); - } - - if (this.settings.networking) { - for (const candidate of this.settings.peers) { - this._connect(candidate); - } - } - - this.emit('ready', { - id: this.id, - address: address, - pubkey: this.key.pubkey - }); - - return this; - } - - /** - * Stop the peer. - */ - async stop () { - const peer = this; - - // Alert listeners - peer.emit('log', 'Peer stopping...'); - - if (peer.settings.upnp && peer.upnp) { - peer.upnp.close(); - } - - for (const id in peer.connections) { - peer.emit('log', `Closing connection: ${id}`); - const connection = peer.connections[id]; - const closer = async function () { - return new Promise((resolve, reject) => { - // Give socket a timeout to close cleanly, destroy if failed - let deadline = setTimeout(function () { - console.warn('[FABRIC:PEER]', 'end() timed out for peer:', id, 'Calling destroy...'); - connection.destroy(); - resolve(); - }, 5000); - - // TODO: notify remote peer of closure - // Use end(SOME_CLOSE_MESSAGE, ...) - return connection.end(function socketClosed (error) { - if (error) return reject(error); - clearTimeout(deadline); - resolve(); - }); - }); - }; - await closer(); - } - - const terminator = async function () { - return new Promise((resolve, reject) => { - if (!peer.server.address()) return resolve(); - return peer.server.close(function serverClosed (error) { - if (error) return reject(error); - resolve(); - }); - }); - }; - - await terminator(); - - return this; - } - - async _setState (value) { - if (!value) return new Error('You must provide a State to set the value to.'); - this.state.state = value; - return this.state.state; - } - - // TODO: use in _connect - async _sessionStart (socket, target) { - const self = this; - const address = `${target.address}:${target.port}`; - self.emit('log', `Starting session with address: ${target.pubkey}@${address}`); - self.connections[address].session = new Session({ recipient: target.pubkey }); - await self.connections[address].session.start(); - self.emit('log', `Session created: ${JSON.stringify(self.connections[address].session)}`); - - if (!self.public.ip) { - self.public.ip = socket.localAddress; - self.emit('log', `Local socket was null, changed to: ${self.public.ip}`); - } - - // TODO: consolidate with similar _handleConnection segment - // TODO: check peer ID, eject if self or known - - // TODO re-enable (disabled to reduce spammy messaging) - // /* - // TODO: re-evaluate use of IdentityRequest - // const vector = ['IdentityRequest', self.id]; - const vector = ['StartSession', JSON.stringify({ - id: self.connections[address].session.id, - identity: self.id, - advertise: `${self.key.pubkey}@${self.public.ip}:${self.public.port}`, - signature: self.connections[address].session.key._sign(self.id) - })]; - const message = Message$2.fromVector(vector); - - if (!socket.writable) { - self.emit('error', `Socket is not writable.`); - return false; - } - - self.sendToSocket(address, message); - - // Emit notification of a newly opened connection - self.emit('connections:open', { - address: address, - status: 'unauthenticated', - initiator: true - }); - - if (self.settings.verbosity >= 4) console.log('[FABRIC:PEER]', `Connection to ${address} established!`); - } - - async _processCompleteDataPacket (socket, address, data) { - // Constants - const self = this; - // TODO: actually decrypt packet - const decrypted = socket.session.decrypt(data); - - // Variables - let message = null; - - try { - message = self._parseMessage(decrypted); - } catch (exception) { - console.error('[FABRIC:PEER]', 'Could not parse inbound messsage:', exception); - } - - // disconnect from any peer sending invalid messages - if (!message) return socket.destroy(); - - const response = await self._handleMessage({ - message: message, - origin: address, - peer: { - address: address, - id: socket.id - } - }); - - if (response) { - self.meta.messages.outbound++; - self.sendToSocket(address, response); - } - } - - async _handleSocketData (socket, address, data) { - const self = this; - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Received data from peer:', data); - - if (!socket.session) { - self.emit('error', `Received data on socket without a session! Violator: ${address}`); - return false; - } - - socket._reader._addData(data); - } - - _connect (address) { - let self = this; - let parts = address.split(':'); - let known = Object.keys(self.connections); - let keyparts = parts[0].split('@'); - let target = { - pubkey: null, - address: null, - port: null - }; - - if (keyparts.length === 2) { - target.pubkey = keyparts[0]; - target.address = keyparts[1]; - target.port = parts[1]; - } else { - target.address = parts[0]; - target.port = parts[1]; - } - - if (target.pubkey === self.id) return this.emit('error', 'Cannot connect to self.'); - - const authority = `${target.address}:${target.port}`; - - if (this.settings.verbosity >= 4) console.log('[FABRIC:PEER]', 'Connecting to address:', authority); - - if (parts.length !== 2) return console.debug('Invalid address:', address); - if (known.includes(authority)) return self.connections[authority]; - - // TODO: refactor to use local functions + specific unbindings - try { - self.connections[authority] = new net.Socket(); - self.connections[authority]._reader = new Reader(); - self.connections[authority]._reader.on('debug', function (msg) { - self.emit('debug', msg); - }); - - self.connections[authority]._reader.on('message', function (msg) { - self._processCompleteDataPacket.apply(self, [ self.connections[authority], authority, msg ]); - }); - - self.connections[authority].on('error', function (err) { - const text = `could not connect to peer ${authority} — Reason: ${err}`; - self.emit('connection:error', { - message: text - }); - // console.debug('[PEER]', `could not connect to peer ${authority} — Reason:`, err); - }); - - self.connections[authority].on('close', function _handleSocketClose (err) { - if (err) self.debug('socket closed on error:', err); - if (err) self.emit('log', `socket closed on error: ${err}`); - - self.emit('warning', `Connection closed: ${authority}`); - - self.connections[authority].removeAllListeners(); - - // TODO: consider using `process.nextTick` to only clean up after event? - delete self.connections[authority]; - self.emit('connections:close', { - address: authority - }); - }); - - // TODO: unify as _dataHandler - self.connections[authority].on('data', async function peerDataHandler (data) { - self._handleSocketData.apply(self, [ this, authority, data ]); - }); - - self.emit('log', `Starting connection to address: ${authority}`); - - // TODO: replace with handshake - // NOTE: the handler is only called once per connection! - self.connections[authority].connect(target.port, target.address, async function connectionAttemptComplete (error) { - if (error) return new Error(`Could not establish connection: ${error}`); - await self._sessionStart.apply(self, [ this, target ]); - self._maintainConnection(authority); - }); - } catch (E) { - self.log('[PEER]', 'failed to connect:', E); - } - - return self.connections[authority]; - } - - _disconnect (address) { - if (!this.connections[address]) return false; - - // Halt any heartbeat - if (this.connections[address].heartbeat) { - clearInterval(this.connections[address].heartbeat); - } - - // Destroy the connection - this.connections[address].destroy(); - - // Remove connection from map - delete this.connections[address]; - } - - _parseMessage (data) { - if (!data) return false; - if (this.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Parsing message:', data); - - // Variables - let message = null; - - try { - message = Message$2.fromRaw(data); - } catch (exception) { - this.emit('debug', `[FABRIC:PEER] error parsing message: ${exception}`); - } - - if (this.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Parsed message into:', message.type, message.data); - return message; - } - - async _handleConnection (socket) { - const self = this; - const address = [socket.remoteAddress, socket.remotePort].join(':'); - if (this.settings.verbosity >= 4) self.emit('log', `[FABRIC:PEER] [0x${self.id}] Incoming connection from address: ${address}`); - - self.emit('connections:open', { - address: address, - status: 'connected', - initiator: false - }); - - // TODO: use known key - socket.session = new Session(); - - socket.on('close', function terminate () { - self.emit('log', `connection closed: ${address}`); - self.emit('connections:close', { address: address }); - self._disconnect(address); - }); - - socket.on('data', function inboundPeerHandler (data) { - try { - self._handleSocketData.apply(self, [ socket, address, data ]); - } catch (exception) { - self.emit('error', `Could not handle socket data: ${exception}`); - } - }); - - // add this socket to the list of known connections - this.connections[address] = socket; - this.connections[address]._reader = new Reader(); - self.connections[address]._reader.on('debug', function (msg) { - self.emit('debug', msg); - }); - - this.connections[address]._reader.on('message', function (msg) { - self._processCompleteDataPacket.apply(self, [ self.connections[address], address, msg ]); - }); - - self._maintainConnection(address); - } - - _maintainConnection (address) { - const peer = this; - if (!peer.connections[address]) return new Error(`Connection for address "${address}" does not exist.`); - /* peer.connections[address]._player = setInterval(function () { - peer._pingConnection.apply(peer, [ address ]); - }, 60000); */ - } - - _pingConnection (address) { - const ping = Message$2.fromVector(['Ping', `${Date.now().toString()}`]); - - try { - this.sendToSocket(address, ping); - } catch (exception) { - this.emit('error', `Couldn't deliver message to socket: ${exception}`); - } - } - - _updateLiveness (address) { - // Return Error if no connection - if (!this.connections[address]) { - const error = `No connection for address: ${address}`; - this.emit('error', error); - return new Error(error); - } - - // Set the _lastMessage property - this.connections[address]._lastMessage = Date.now(); - - // Make chainable - return this; - } - - _registerHandler (type, method) { - if (this.handlers[type]) return new Error(`Handler for method "${type}" is already registered.`); - this.handlers[type] = method.bind(this); - return this.handlers[type]; - } - - _registerPeer (peer) { - if (this.settings.verbosity >= 6) console.warn('[AUDIT]', 'Registering peer:', peer); - let self = this; - - if (!peer) return false; - if (!peer.id) { - self.log(`Peer attribute 'id' is required.`); - return false; - } - - self.peers[peer.id] = peer; - - // console.log('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Peer registered:', peer); - // console.log('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Peer list:', self.peers); - - self.emit('peer', peer); - - // TODO: document peer announcement - // TODO: eliminate use of JSON in messaging - const announcement = Message$2.fromVector(['PeerCandidate', JSON.stringify(peer)]); - - try { - self.relayFrom(peer.id, announcement); - } catch (exception) { - self.emit('error', `Could not relay peer registration: ${exception}`); - } - - return true; - } - - async _requestStateFromAllPeers () { - const message = Message$2.fromVector(['StateRequest']); - this.broadcast(message); - } - - async _handleMessage (packet) { - if (!packet) return false; - - // Constants - const self = this; - const message = packet.message; - const origin = packet.origin; - - // Variables - let relay = false; - let response = null; - - this._updateLiveness(origin); - - if (!message) return console.error('Hard failure:', packet); - if (this.messages.has(message.id)) { - // this.emit('debug', `Received duplicate message ${message.id} from [${origin}] in packet: ${JSON.stringify(packet, null, ' ')}`); - return false; - } else { - this.memory[message.id] = message; - this.messages.add(message.id); - } - - this.emit('log', `Evaluting message with purported type "${message.type}":`); - - // Build a response to various message types - switch (message.type) { - case 'ChatMessage': - relay = true; - this.emit('debug', `Message: ${JSON.stringify({ - type: message.type, - data: message.data, - size: message.data.length - }, null, ' ')}`); - this.emit('debug', `Data (${typeof message.data}): \n\t${message.data}`); - - try { - const data = JSON.parse(message.data); - this.emit('debug', `Parsed (${typeof data}): ${JSON.stringify(data, null, ' ')}`); - this.emit('log', `[${data.object.created}] @${data.actor}: ${data.object.content}`); - this.emit('message', message.data); - } catch (exception) { - this.emit('error', `Could not process ChatMessage: ${exception}`); - } - break; - case 'Generic': - relay = true; - break; - case 'Ping': - response = Message$2.fromVector(['Pong', message.id]); - break; - case 'Pong': - // self.emit('message', `Received Pong: ${message}`); - break; - case 'StartChain': - break; - case 'GenericMessage': - console.warn('[FABRIC:PEER]', 'Received Generic Message:', message.data); - relay = true; - break; - case 'IdentityRequest': - console.log('[FABRIC:PEER]', 'Peer sent IdentityRequest. Responding with IdentityResponse (node id)...', self.id); - response = Message$2.fromVector(['IdentityResponse', self.id]); - break; - case 'IdentityResponse': - if (!self.peers[message.data]) { - ({ - id: message.data, - address: packet.origin - }); - - // TODO: remove in favor of StartSession - // Why? Duplicate "peer" event is sent within _registerPeer - // Try to register peer... - /* try { - self._registerPeer(peer); - } catch (exception) { - self.emit('error', `Could not register peer ${message.data} because: ${exception}`); - } */ - } - - response = Message$2.fromVector(['StateRoot', JSON.stringify(self.state)]); - break; - case 'DocumentPublish': - this.emit('log', `Document published from peer: ${message.data}`); - this.emit('DocumentPublish', message.data); - break; - case 'DocumentRequest': - this.emit('DocumentRequest', message.data); - break; - case 'BlockCandidate': - break; - case 'PeerCandidate': - let candidate = null; - - try { - candidate = JSON.parse(message.data); - } catch (exception) { - console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, 'Could not parse PeerCandidate message:', message.data, exception); - } - - self.emit('peer:candidate', candidate); - break; - case 'PeerMessage': - // console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, `Received "PeerMessage" from ${packet.origin} on socket:`, message.raw); - // console.error('[FABRIC:PEER]', `[@ID:$${self.id}]`, `Packet origin:`, packet.origin); - // TODO: use packet's peer ID, not socket address - // Likely need to track connection? - self.relayFrom(packet.origin, message); - break; - case 'StartSession': - if (self.settings.verbosity >= 6) console.warn('[AUDIT]', '[FABRIC:PEER]', `[0x${self.id}]`, 'Received "StartSession" message on socket:', message.raw); - let session = null; - - try { - session = JSON.parse(message.data.toString('utf8')); - } catch (exception) { - console.error('[FABRIC:PEER]', 'Session body could not be parsed:', exception); - } - - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Proposed session:', session); - // TODO: restore session identity - if (session/* && session.identity */) { - if (self.settings.verbosity >= 6) console.log('[AUDIT]', 'Session is valid...'); - - let peer = { - id: session.identity, - address: packet.origin, - advertise: `${self.pubkeyhash}@${self.public.ip}:${self.public.port}`, - status: 'unfunded' - }; - - if (self.settings.verbosity >= 5) console.log('[FABRIC:PEER]', 'Peer to register:', peer); - - // TODO: document peer registration process - self._registerPeer(peer); - - // TODO: use message type for next phase of session (i.e., NOISE) - response = Message$2.fromVector(['StartSession', { identity: self.id }]); - if (self.settings.verbosity >= 6) console.log('[AUDIT]', 'Will send response:', response); - } - - break; - case 'StateRoot': - if (self.settings.verbosity >= 5) console.log('[AUDIT]', 'Message was a state root:', message.data); - - // TODO: test protocol flow (i.e., understand StateRoot) - console.log('[AUDIT]', 'Message was a state root:', message.raw, message.data); - - try { - const state = JSON.parse(message.data); - self.emit('state', state); - response = { - 'type': 'Receipt', - 'data': state - }; - } catch (E) { - console.error('[FABRIC:PEER]', 'Could not parse StateRoot:', E); - } - break; - case 'StateChange': - console.log('message was a state change:', message.data); - break; - case P2P_BASE_MESSAGE: - self._handleBasePacket(packet); - break; - case P2P_ROOT: - response = Message$2.fromVector([P2P_STATE_COMMITTMENT, self.state]); - self.log('type was ROOT, sending state root:', response); - self.log('type was ROOT, state was:', self.state); - break; - case P2P_INSTRUCTION: - // TODO: use Fabric.Script / Fabric.Machine - let stack = message.data.split(' '); - switch (stack[1]) { - case 'SIGN': - let signature = self.key._sign(stack[0]); - let buffer = Buffer.from(signature); - let script = [buffer.toString('hex'), 'CHECKSIG'].join(' '); - - response = Message$2.fromVector([P2P_INSTRUCTION, script]); - break; - default: - console.log('[PEER]', `unhandled peer instruction "${stack[1]}"`); - break; - } - - break; - default: - console.error('[PEER]', `unhandled message type "${message.type}"`); - self.emit('error', `Unhandled message type "${message.type}"`); - break; - } - - // Emit for listeners - // self.emit('message', message); - - if (relay) { - self.relayFrom(origin, message); - } - - return response; - } - - _handleBasePacket (packet) { - let message = null; - - try { - message = JSON.parse(packet.message.data); - } catch (E) { - return this.log('Error parsing message:', E); - } - - switch (message.type) { - case 'collections:post': - this.emit('collections:post', message.data); - break; - default: - console.log('unhandled base packet type:', message.type); - break; - } - } - - async sendToSocket (address, raw) { - if (raw instanceof Message$2) { - raw = raw.asRaw(); - } - - if (!this.connections[address]) { - this.emit('error', `Could not deliver message to unconnected address: ${address}`); - return false; - } - - if (!this.connections[address].session) { - this.emit('error', `Connection does not have a Session: ${address}`); - return false; - } - - if (!this.connections[address].writable) { - this.emit('error', `Connection is not writable: ${address}`); - return false; - } - - this.emit('debug', `Writing ${raw.length} bytes to socket: \n\t${raw.toString('hex')}`); - // const signature = await this.connections[address].session._appendMessage(raw); - // self.emit('debug', `Signature: ${signature}`); - - try { - const result = this.connections[address].write(raw); - if (!result) { - this.emit('warning', 'Stream result false.'); - } - } catch (exception) { - this.emit('error', `Exception writing to $[${address}]: ${exception}`); - } - } - - relayFrom (origin, message) { - if (!origin) { - this.emit('error', 'Must provide an origin.'); - return false; - } - - if (!message) { - this.emit('error', 'Must provide a message.'); - return false; - } - - if (!(message instanceof Message$2)) { - this.emit('error', 'Must provide a valid Fabric message.'); - return false; - } - - this.emit('log', `Relaying ${message.type} from ${origin}: <${typeof message.data}> ${message.data}}`); - - let authorized = false; - - if (message.type) { - switch (message.type) { - case 'ChatMessage': - authorized = true; - break; - case 'PeerCandidate': - break; - default: - this.emit('debug', `Unhandled type: ${message.type}`); - break; - } - } else { - this.emit('warning', `Unknown message structure: <${message.constructor.name} ${JSON.stringify(message, null, ' ')} />`); - } - - // For each known peer, send to the corresponding socket - for (const id in this.peers) { - this.emit('debug', `Is ${id} === ${origin}?`); - if (id === origin) continue; - const peer = this.peers[id]; - - // TODO: select type byte for state updates - // TODO: require `Message` type before broadcast (or, preferrably, cast as necessary) - // let msg = Message.fromVector([P2P_BASE_MESSAGE, message]); - const msg = Message$2.fromVector([ - message.type, - message.data - ]); - - const raw = msg.asRaw(); - this.emit('debug', `Preparing write (${raw.length} bytes): <${raw.constructor.name}> \n\t${raw.toString('hex')}`); - - if (authorized) { - try { - this.emit('debug', `Sending ${raw.length} bytes to address $[${peer.address}]: \n\t${raw.toString('hex')}`); - this.sendToSocket(peer.address, raw); - } catch (exception) { - this.emit('error', `Could not write message to connection "${peer.address}":`, exception); - } - } else { - this.emit('debug', 'Would have sent to socket:'); - this.emit('debug', `sendToSocket (${raw.length} bytes): from ${origin} to ${peer.address}: ${raw.toString('hex')})`); - } - } - } - - broadcast (message) { - // Coerce to Object - if (message instanceof Message$2) { - message = message.toObject(); - } - - if (typeof message !== 'string') message = JSON.stringify(message); - let hash = crypto$4.createHash('sha256').update(message).digest('hex'); - - // Do not relay duplicate messages - if (this.messages.has(hash)) { - if (this.settings.verbosity >= 3) console.warn('[FABRIC:PEER]', `Attempted to broadcast duplicate message ${hash} with content:`, message); - return false; - } else { - this.memory[hash] = message; - this.messages.add(hash); - } - - for (let id in this.peers) { - let peer = this.peers[id]; - // TODO: select type byte for state updates - // TODO: require `Message` type before broadcast (or, preferrably, cast as necessary) - // let msg = Message.fromVector([P2P_BASE_MESSAGE, message]); - let msg = Message$2.fromVector(['PeerMessage', message]); - - try { - this.sendToSocket(peer.address, msg); - } catch (exception) { - console.error('[FABRIC:PEER]', `Could not write message to connection "${peer.address}":`, exception); - } - } - } - - _broadcastTypedMessage (type, message) { - if (!message) message = ''; - if (typeof message !== 'string') message = JSON.stringify(message); - - let id = crypto$4.createHash('sha256').update(message).digest('hex'); - - if (this.messages.has(id)) { - this.log('attempted to broadcast duplicate message'); - return false; - } else { - this.memory[id] = message; - this.messages.add(id); - } - - for (let id in this.peers) { - let peer = this.peers[id]; - // TODO: select type byte for state updates - let msg = Message$2.fromVector([type, message]); - this.sendToSocket(peer.address, msg); - } - } - - /** - * Start listening for connections. - * @fires Peer#ready - * @return {Peer} Chainable method. - */ - async listen () { - const self = this; - const promise = new Promise((resolve, reject) => { - self.server.listen(self.port, self.address, function listenComplete (error) { - if (error) return reject(error); - - const details = self.server.address(); - const address = `tcp://${details.address}:${details.port}`; - const complete = function () { - self.emit('log', `Now listening on ${address} [!!!]`); - return resolve(address); - }; - - if (!self.settings.upnp) { - return complete(); - } - - // UPNP - self.upnp.portMapping({ - public: 7777, - private: 7777, - ttl: 10 - }, function (err) { - if (err) { - self.emit('log', `error configuring upnp: ${err}`); - return complete(); - } - - self.upnp.externalIp(function (err, ip) { - if (err) { - self.emit('log', `Could not retrieve public IP: ${err}`); - } else { - self.public.ip = ip; - self.emit('log', `UPNP configured! External IP: ${ip}`); - } - - return complete(); - }); - }); - }); - }); - - return promise; - } -} - -var peer = Peer$1; - -// Dependencies -const merge$1 = lodash_merge.exports; - -// Types -const Actor$3 = actor; -const KeyStore = keystore; -const Machine$3 = machine; -const Message$1 = message$1; -const Peer = peer; -// const Remote = require('./remote'); -const Resource$4 = resource$1; -const Service$6 = service_1; -const Storage = store_1; -// const Swarm = require('./swarm'); - -/** - * Web-friendly application framework for building single-page applications with - * Fabric-based networking and storage. - * @extends Service - * @property {Collection} components Interface elements. - * @property {Store} stash Routable {@link Datastore}. - */ -// class App extends Scribe { -class App$4 extends Service$6 { - /** - * Generic bundle for building Fabric applications. - * @param {Object} definition Application definition. See `config` for examples. - * @return {App} Returns an instance of `App`. - */ - constructor (definition = {}) { - super(definition); - - if (!definition.resources) definition.resources = {}; - - this.settings = Object.assign({ - seed: null, - path: './stores/fabric-application', - prefix: '/', - services: [], - verbosity: 1 - }, definition); - - // Internal Components - this.node = new Peer(this.settings); - this.actor = new Actor$3(this.settings); - this.machine = new Machine$3(this.settings); - this.store = new KeyStore(this.settings); - - // TODO: replace these with KeyStore - this.tips = new Storage({ path: './stores/tips' }); - this.stash = new Storage({ path: './stores/stash' }); - - // TODO: debug these in browser - // this.swarm = new Swarm(); - // this.worker = new Worker(); - - this.name = 'application'; - this.network = {}; - - // TODO: debug this in browser - // this.element = document.createElement('fabric-app'); - - // Assign Properties - this.bindings = {}; - this.authorities = {}; - this.components = {}; - this.elements = {}; - this.services = {}; - this.commands = {}; - this.resources = {}; - this.templates = {}; - this.keys = []; - - // Listen for Patches - this.stash.on('patches', function (patches) { - console.log('[FABRIC:APP]', 'heard patches!', patches); - }); - - if (this.settings.resources) { - for (const name in this.resources) { - this.set(this.settings.prefix + this.resources[name].components.list, []); - } - } - - // State - this._state = { - anchor: 'BTC', - chains: {} - }; - - this.commit(); - - return this; - } - - _bindEvents (element) { - for (const name in this.bindings) element.addEventListener(name, this.bindings[name]); - return element; - } - - _unbindEvents (element) { - for (const name in this.bindings) element.removeEventListener(this.bindings[name]); - return element; - } - - async bootstrap () { - return true; - } - - async _signWithOwnID (input) { - return this.key.sign(input); - } - - /** - * Start the program. - * @return {Promise} - */ - async start () { - this._appendMessage(`[FABRIC:APP] @${this.id} -- Starting...`); - this.status = 'STARTING'; - - for (const [name, service] of Object.entries(this.services)) { - this._appendWarning(`@${this.id} -- Checking for Service: ${name}`); - if (this.settings.services.includes(name)) { - this._appendWarning(`Starting service: ${name}`); - await this.services[name]._bindStore(this.store); - await this.services[name].start(); - } - } - - // Start P2P node - this.node.start(); - this.status = 'STARTED'; - this.emit('ready'); - this._appendMessage(`[FABRIC:APP] @${this.id} -- Started!`); - - return this; - } - - /** - * Stop the program. - * @return {Promise} - */ - async stop () { - this.emit('log', '[FABRIC:APP] Stopping...'); - await this.node.stop(); - await this.tips.close(); - await this.stash.close(); - this.emit('log', '[FABRIC:APP] Stopped!'); - return this; - } - - /** - * Define a Resource, or "Type", used by the application. - * @param {String} name Human-friendly name for the Resource. - * @param {Object} structure Map of attribute names -> definitions. - * @return {Object} [description] - */ - async define (name, structure) { - const self = this; - - self.log('[APP]', 'defining:', name, structure); - - try { - const resource = new Resource$4(structure); - - resource._sign(); - resource.trust(self.stash); - - // self.use(name, structure); - // TODO: decide on resource['@data'] vs. resource (new) - self.resources[name] = resource; - - self._sign(); - } catch (E) { - console.error(E); - } - - return this; - } - - async register (component) { - this.components[component.name] = component; - } - - /** - * Defer control of this application to an outside authority. - * @param {String} authority Hostname to trust. - * @return {App} The configured application as deferred to `authority`. - */ - async defer (authority) { - let self = this; - let resources = {}; - - console.warn('[APP]', 'deferring authority:', authority); - - /* if (typeof authority === 'string') { - self.remote = new Remote({ - host: authority - }); - resources = await self.remote.enumerate(); - } else { - resources = authority.resources; - } */ - - if (!resources) { - resources = {}; - } - - self.consume(resources); - - if (window && window.page) { - // load the Index - window.page('/', function (context) { - self.log('Hello, navigator.'); - self.log('Context:', context); - self.element.navigate('fabric-splash', context); - }); - - window.page(); - } - - return this; - } - - async _appendMessage (msg) { - if (this.settings.verbosity > 2) console.log(`[${(new Date()).toISOString()}]: ${msg}`); - } - - async _appendWarning (msg) { - console.warn(`[${(new Date()).toISOString()}]: ${msg}`); - } - - async _appendError (msg) { - console.error(`[${(new Date()).toISOString()}]: ${msg}`); - } - - /** - * Configure the Application to use a specific element. - * @param {DOMElement} element DOM element to bind to. - * @return {App} Configured instance of the Application. - */ - attach (element) { - this.element = element; - return this; - } - - /** - * Define the Application's resources from an existing resource map. - * @param {Object} resources Map of resource definitions by name. - * @return {App} Configured instance of the Application. - */ - consume (resources) { - let self = this; - - self.element.resources = resources; - - for (let key in resources) { - let def = resources[key]; - self.define(def.name, def); - } - - return this; - } - - /** - * Use a CSS selector to find an element in the current document's tree and - * bind to it as the render target. - * @param {String} selector CSS selector. - * @return {App} Instance of app with bound element. - */ - envelop (selector) { - try { - let element = document.querySelector(selector); - - if (!element) { - this.log('[FABRIC:APP]', 'envelop()', 'could not find element:', selector); - return null; - } - - this._bindEvents(element); - this.attach(element); - } catch (E) { - console.error('Could not envelop element:', E); - } - - return this; - } - - /** - * Define a named {@link Resource}. - * @param {String} name Human-friendly name for this resource. - * @param {Object} definition Map of configuration values. - * @return {App} Configurated instance of the {@link App}. - */ - use (name, definition) { - this.log('[APP]', 'using:', name, definition); - super.use(name, definition); - return this; - } - - /** - * Get the output of our program. - * @return {String} Output of the program. - */ - render () { - const actor = new Actor$3(this._state); - const html = `` + - `\n ` + - `\n ${actor.serialize()}` + - '\n ' + - `\n\n`; - - const sample = new Actor$3(html); - - if (this.element) { - this.element.setAttribute('integrity', `sha256:${sample.preimage}`); - this.element.innerHTML = html; - } - - return html; - } - - _registerCommand (command, method) { - this.commands[command] = method.bind(this); - } - - /** - * Registers a named {@link Service} with the application. Services are - * standardized interfaces for Fabric contracts, emitting {@link Message} - * events with a predictable lifecycle. - * @internal - * @param {String} name Internal name of the service. - * @param {Class} Service The ES6 class definition implementing {@link Service}. - * @returns {Service} The registered service instance. - */ - _registerService (name, Service) { - const self = this; - const service = new Service(merge$1({}, this.settings, this.settings[name])); - - if (this.services[name]) { - return this._appendWarning(`Service already registered: ${name}`); - } - - this.services[name] = service; - - this.services[name].on('error', function (msg) { - self._appendError(`Service "${name}" emitted error: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('warning', function (msg) { - self._appendWarning(`Service warning from ${name}: ${JSON.stringify(msg, null, ' ')}`); - }); - - this.services[name].on('message', function (msg) { - self._appendMessage(`@services/${name} -- (${typeof msg}) ${JSON.stringify(msg, null, ' ')}`); - switch (msg['@type']) { - case 'ChatMessage': - self.node.relayFrom(self.node.id, Message$1.fromVector(['ChatMessage', JSON.stringify(msg)])); - break; - } - }); - - this.on('identity', function _registerActor (identity) { - if (this.settings.services.includes(name)) { - self._appendMessage(`Registering actor on service "${name}": ${JSON.stringify(identity)}`); - - try { - this.services[name]._registerActor(identity); - } catch (exception) { - self._appendError(`Error from service "${name}" during _registerActor: ${exception}`); - } - } - }); - - return this.services[name]; - } -} - -var app$1 = App$4; - -const Actor$2 = actor; -const merge = lodash_merge.exports; - -class Block$2 extends Actor$2 { - constructor (input = {}) { - super(input); - - this._state = merge({ - parent: null, - transactions: {}, - signatures: [] - }, input); - - Object.defineProperty(this, '_events', { enumerable: false }); - Object.defineProperty(this, '_eventCount', { enumerable: false }); - Object.defineProperty(this, 'observer', { enumerable: false }); - - return this; - } - - get transactions () { - return this._state.transactions; - } - - sign () { - const actor = new Actor$2(this._state); - const data = actor.toString(); - const array = this.key._sign(data); - this._state.signature = Buffer.from(array); - return this._state.signature; - } - - validate () { - // TODO: implement validators - } -} - -var block = Block$2; - -const { - MAX_TX_PER_BLOCK -} = constants$1; - -const monitor$1 = duplex; - -const Actor$1 = actor; -const Block$1 = block; -const Stack$4 = stack$2; -const State$2 = state$2; - -/** - * Chain. - * @property {String} name Current name. - * @property {Map} indices - * @property {Storage} storage - */ -class Chain$1 extends Actor$1 { - /** - * Holds an immutable chain of events. - * @param {Vector} genesis Initial state for the chain of events. - */ - constructor (origin = {}) { - super(origin); - - this.name = (origin) ? origin.name : '@fabric/playnet'; - this.settings = Object.assign({ - name: this.name, - type: 'sha256', - validator: this.validate.bind(this) - }, origin); - - // Internal State - this._state = { - blocks: {}, - genesis: null, - consensus: null, - transactions: {}, - mempool: [], - ledger: [] - }; - - return this; - } - - static fromObject (data) { - return new Chain$1(data); - } - - get consensus () { - return this.tip; - } - - get tip () { - return this._state.consensus; - } - - get root () { - return this.mast.getRoot(); - } - - get blocks () { - return this._state.ledger; - } - - get leaves () { - return this.blocks.map(x => Buffer.from(x, 'hex')); - } - - get subsidy () { - return 50; - } - - get mempool () { - return this._state.mempool; - } - - get _tree () { - const stack = new Stack$4(this.leaves); - return stack.asMerkleTree(); - } - - trust (source) { - const self = this; - - source.on('message', function TODO (message) { - self.emit('debug', `Message from trusted source: ${message}`); - }); - - return self; - } - - async start () { - const chain = this; - - // Monitor changes - this.observer = monitor$1.observe(this._state); - - // before returning, ensure a commit - await chain.commit(); - - return chain; - } - - async stop () { - await this.commit(); - return this; - } - - async attach (application) { - if (!application.store) { - this.emit('error', `Application has no "store" property.`); - } else { - this.store = application.store; - } - - return this; - } - - async open () { - return this.storage.open(); - } - - async close () { - return this.storage.close(); - } - - async _load () { - const chain = this; - - const query = await chain.storage.get('/blocks'); - const response = new State$2(query); - - this.log('query:', query); - this.log('response:', response); - this.log('response id:', response.id); - - return chain; - } - - async append (block) { - if (!block) throw new Error('Must provide a block.'); - if (!(block instanceof Block$1)) { - block = new Block$1(block); - } - - if (this.blocks.length <= 0) { - this._state.genesis = block.id; - } - - this._state.blocks[block.id] = block; - this._state.ledger.push(block.id); - this._state.consensus = block.id; - - await this.commit(); - - this.emit('block', block); - - return this; - } - - async _listBlocks () { - return this.blocks; - } - - async proposeTransaction (transaction) { - const actor = new Actor$1(transaction); - - this._state.transactions[actor.id] = actor; - this._state.mempool.push(actor.id); - - return actor; - } - - async generateBlock () { - const proposal = { - parent: this.consensus, - transactions: [] - }; - - // TODO: _sortFees - if (this.mempool.length) { - for (let i = 0; i < MAX_TX_PER_BLOCK; i++) { - const candidate = this.mempool.shift(); - if (candidate) { - proposal.transactions.push(candidate); - } - } - } - - const block = new Block$1(proposal); - await this.append(block); - - return block; - } - - async generateBlocks (count = 1) { - const blocks = []; - - for (let i = 0; i < count; i++) { - const block = await this.generateBlock(); - blocks.push(block); - } - - return blocks; - } - - async commit () { - let changes = null; - - if (this.observer) { - changes = monitor$1.generate(this.observer); - } - - if (changes) { - this.emit('changes', { - type: 'StateChanges', - data: changes - }); - } - - const state = new Actor$1(this._state); - return state.id; - } - - async verify (level = 4, depth = 6) { - this.log(`Verification Level ${level} running from -${depth}...`); - console.log('root:', this.root); - return (this['@id'] === this.root); - } - - validate (chain) { - let valid = false; - for (let i = 0; i < chain.height; i++) { - chain.blocks[i]; - } - return valid; - } - - render () { - console.log('[CHAIN]', '[RENDER]', this); - return ``; - } -} - -var chain = Chain$1; - -const Scribe$3 = scribe; -const Stack$3 = stack$2; - -/** - * An ordered stack of pages. - * @property {Buffer} memory The ledger's memory (4096 bytes). - * @property {Stack} stack The ledger's stack. - * @property {Mixed} tip The most recent page in the ledger. - * @extends Scribe - */ -class Ledger$1 extends Scribe$3 { - constructor (state) { - super(state); - - this.memory = Buffer.alloc(4096); - this.pages = new Stack$3(state || []); - - return this; - } - - get tip () { - return this.pages[this.pages.length - 1]; - } - - async start () { - await super.start(); - - if (!this.pages.length) { - await this.append({ - name: 'genesis' - }); - } - - this.status = 'started'; - - return this; - } - - /** - * Attempts to append a {@link Page} to the ledger. - * @param {Mixed} item Item to store. - * @return {Promise} Resolves after the change has been committed. - */ - async append (item) { - this.pages.push(item); - await this.pages.commit(); - await this.commit(); - return this; - } - - commit () { - if (!this.pages) return null; - this['@data'] = this.pages['@data']; - return this.id; - } - - consume (ink) { - if (!this.ink) this.ink = ink; - return this.ink; - } - - render () { - return ``; - } -} - -var ledger = Ledger$1; - -const monitor = duplex; - -class Observer$1 { - constructor (target) { - this.observer = monitor.observe(target); - return this; - } -} - -var observer = Observer$1; - -const Scribe$2 = scribe; -const Stack$2 = stack$2; - -class Vector$2 extends Scribe$2 { - /** - * An "Initialization" Vector. - * @param {Object} - Input state (will map to `@data`.) - * @constructor - */ - constructor (origin) { - super(origin); - - this.settings = Object.assign({}, origin); - - this.known = {}; - this.registry = {}; - - this.stack = new Stack$2(); - this.script = []; - - this.status = 'initialized'; - - return this; - } - - static fromObjectString (input = '') { - if (!input) throw new Error('Must provide input.'); - if (typeof input !== 'string') input = JSON.stringify(input); - let result = []; - let object = JSON.parse(input); - - for (let i in object) { - let element = object[i]; - - if (element instanceof Array) { - element = Buffer.from(element); - } else { - element = Buffer.from(element.data); - } - - result.push(element); - } - - return result; - } - - /** - * _serialize is a placeholder, should be discussed. - * @param {String} input - What to serialize. Defaults to `this.state`. - * @return {String} - resulting string [JSON-encoded version of the local `@data` value.] - */ - _serialize (input) { - return this.toString(input); - } - - _deserialize (input) { - return this.fromString(input); - } - - // TODO: standardize on a serialization format - fromString (input) { - return JSON.parse(input); - } - - toObject () { - let object = {}; - for (let property in this['@data']) { - if (property.charAt(0) !== '@') { - object[property] = this['@data'][property]; - } - } - return object; - } - - /** - * Render the output to a {@link String}. - * @param {Mixed} input Arbitrary input. - * @return {String} - */ - toString (input) { - if (!input) input = this.state; - // TODO: standardize on a serialization format - return JSON.stringify(input); - } - - validate (input) { - return true; - } - - async step () { - return super.compute((this.clock | 0)); - } -} - -var vector$1 = Vector$2; - -const Vector$1 = vector$1; - -class Opcode$1 { - constructor (definition) { - let opcode = this; - - opcode.config = Object.assign({}, definition); - opcode.vector = new Vector$1(definition)._sign(); - - return function Opcode (input) { - opcode.output = definition.call({ - id: opcode.vector['@id'] - }, input); - - return opcode.output; - }; - } -} - -var opcode = Opcode$1; - -const Machine$2 = machine; -const Resource$3 = resource$1; -const Store$1 = store_1; - -/** - * An Oracle manages one or more collections, using a mempool for - * transitive state. - * @extends Store - */ -class Oracle$1 extends Store$1 { - /** - * Trusted point-of-reference for external services. - * @param {Object} initial - Initialization vector. - */ - constructor (init) { - super(init); - - this.name = 'Oracle'; - this.config = Object.assign({ - path: './stores/oracle', - services: ['http'], - resources: { - Actors: {}, - Keys: {} - } - }, init); - - this.machine = new Machine$2(this.config); - this.mempool = []; - - this.resources = new Set(); - this.keys = new Set(); - - Object.defineProperty(this, '@allocation', { enumerable: false }); - Object.defineProperty(this, '@buffer', { enumerable: false }); - Object.defineProperty(this, '@encoding', { enumerable: false }); - Object.defineProperty(this, '@parent', { enumerable: false }); - Object.defineProperty(this, '@preimage', { enumerable: false }); - Object.defineProperty(this, 'frame', { enumerable: false }); - Object.defineProperty(this, 'services', { enumerable: false }); - - return this; - } - - _handleStateChange (changes) { - this.mempool.push(changes); - // this.emit('changes', changes); - } - - /** - * Core messaging function for interacting with this object in system-time. - * @param {Message} msg Instance of a {@link module:Message} object, validated then transmitted verbatim. - * @return {Boolean} Returns `true` on success, `false` on failure. - */ - broadcast (msg) { - return this.emit('message', msg); - } - - async define (name, definition) { - const resource = Object.assign({ - name: name - }, definition); - - this.resources[name] = new Resource$3(resource); - this.emit('resource', this.resources[name]); - - return this.resources[name]; - } - - async start () { - try { - await this.open(); - } catch (E) { - console.error('Could not open Oracle:', E); - } - - // TODO: define all resources - await Promise.all([ - this.define('Actor', { - attributes: { - name: { type: 'String', required: true, max: 220 } - } - }), - this.define('Asset', { - attributes: { - name: { type: 'String', required: true, max: 220 } - } - }), - this.define('Hash', { - attributes: { - 'sha256': { type: 'String', required: true, max: 32 }, - '@data': { type: 'String', required: true, max: 2048 } - } - }) - ]); - - // TODO: pre-populate - // this.state = await this._GET('/'); - // console.log('state retrieved:', this.state); - // this.machine.on('changes', this._handleStateChange.bind(this)); - - return this; - } - - async stop () { - try { - await this.close(); - } catch (E) { - console.error('Could not close Oracle:', E); - } - - return this; - } - - async _sync () { - for (let name in this.machine.state) { - let data = this.machine.state[name]; - let path = `/${name}`; - await this._PUT(path, data); - } - } - - async flush () { - this.log('[ORACLE]', 'flush requested:', this.keys); - - for (let item of this.keys) { - this.log('...flushing:', item); - try { - await this._DELETE(item); - } catch (E) { - console.error(E); - } - } - } -} - -var oracle = Oracle$1; - -const Stack$1 = stack$2; - -// addresses of known operators -const known = { - 'OP_0': '0x5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9', - 'OP_1': '0x6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b' -}; - -class Script$2 extends Stack$1 { - /** - * Compose a {@link Script} for inclusion within a {@link Contract}. - * @param {Mixed} config Configuration options for the script. - * @return {Script} Instance of the {@link Script}, ready for use. - */ - constructor (config) { - super(config); - this.stack = new Stack$1(); - this['@data'] = this.stack['@data']; - return this; - } - - compile () { - return this.stack.map(x => { - return known[x] || x; - }); - } - - render () { - return this.stack.join(' '); - } -} - -var script = Script$2; - -const Circuit$2 = circuit; -const Script$1 = script; - -class Program$1 extends Circuit$2 { - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - instructions: [] - }, settings); - - this.circuit = new Circuit$2(); - this.script = new Script$1(); - - this.state = {}; - - return this; - } - - step () { - console.log('[FABRIC:PROGRAM]', 'Executing step...'); - } - - async start () { - console.log('[FABRIC:PROGRAM]', 'Starting execution...'); - } -} - -var program = Program$1; - -const Scribe$1 = scribe; - -// TODO: re-define this class for Fabric messages -// Current code is specific to @fabric/doorman — should be a general- -// purpose Router, not for strings and triggers in chat messages. - -/** - * Process incoming messages. - * @extends Scribe - */ -class Router$4 extends Scribe$1 { - /** - * Maintains a list of triggers ("commands") and their behaviors. - * @param {Object} map Map of command names => behaviors. - */ - constructor (config) { - super(config); - - this.settings = Object.assign({ - routes: {}, - handlers: {}, - trigger: '!' - }, config); - - this.handlers = {}; - this.status = 'ready'; - - return this; - } - - /** - * Assembles a list of possible responses to the incoming request. - * @param {String} msg Input message to route. - * @return {Array} List of outputs generated from the input string. - */ - async route (msg) { - if (!msg.actor || !msg.object || !msg.target) return null; - if (typeof msg.object !== 'string') return null; - - let output = []; - let parts = msg.object - .split(/\s+/g) - .filter(x => x.charAt(0) === this.settings.trigger) - .map(x => x.substr(1)); - - for (let i in parts) { - let token = parts[i]; - let command = token.toLowerCase(); - let handler = this.handlers[command]; - let result = null; - - if (handler) { - switch (typeof handler.value) { - case 'string': - result = handler.value; - break; - default: - this.log('no such native trigger, calling...', command); - // TODO: remove this.fabric.plugins call - result = await handler.value.apply(this.fabric.plugins[handler.plugin], [msg]); - break; - } - - if (result) { - output.push(result); - } - } - } - - return output; - } - - /** - * Attaches a new handler to the router. - * @param {Plugin} plugin Instance of the plugin. - * @param {Plugin.name} name Name of the plugin. - * @return {Router} Configured instance of the router. - */ - use (plugin) { - if (!plugin.name) throw new Error('Cannot use plugin: no "name" attribute specified.'); - this.handlers[plugin.name] = plugin; - return this; - } -} - -var router$1 = Router$4; - -const Machine$1 = machine; -const Router$3 = router$1; -const Service$5 = service_1; - -/** - * Workers are arbitrary containers for processing data. They can be thought of - * almost like "threads", as they run asynchronously over the duration of a - * contract's lifetime as "fulfillment conditions" for its closure. - * @param {Function} method Pure function. - * @constructor - */ -class Worker$2 extends Service$5 { - constructor (method) { - super(method); - // self.worker = new Worker('validator.js'); - this.method = method; - this.machine = new Machine$1(); - this.router = new Router$3(); - this.behaviors = {}; - } - - use (definition) { - return this.router.use(definition); - } - - /** - * Handle a task. - * @param {Vector} input Input vector. - * @return {String} Outcome of the requested job. - */ - async compute (input) { - let output = await this.machine.compute(input); - - console.log('[FABRIC:WORKER]', this.machine.clock, 'Computed output:', output); - - switch (input) { - case 'PING': - this.emit('pong'); - break; - } - - return output; - } - - async route (path) { - switch (path) { - default: - await this.compute(path); - break; - } - } -} - -var worker = Worker$2; - -const Service$4 = service_1; - -class Local extends Service$4 { - constructor (config) { - super(config); - this.config = Object.assign({ - path: './stores/local' - }, config); - return this; - } - - handler (message) { - this.log('[LOCAL:HANDLER]', 'handling message:', message); - let data = Object.assign({ - actor: message.user, - target: message.channel, - object: message.text, - origin: { - type: 'Link', - name: 'Internal' - } - }, message); - this.emit('message', data); - } - - async start () { - this.log('[LOCAL:START]', 'starting...'); - return super.start(); - } -} - -var local = Local; - -// external dependencies -const crypto$3 = require$$0$4; - -// components -const Actor = actor; -const App$3 = app$1; -const Block = block; -const Chain = chain; -const Circuit$1 = circuit; -const Collection$2 = collection$1; -// const Contract = require('./contract'); -// const Disk = require('./disk'); -const Entity$1 = entity; -const Key$1 = key$1; -const Ledger = ledger; -const Machine = machine; -const Message = message$1; -const Observer = observer; -const Opcode = opcode; -const Oracle = oracle; -// const Peer = require('./peer'); -const Program = program; -// const Remote = require('../types/remote'); -const Resource$2 = resource$1; -const Service$3 = service_1; -const Scribe = scribe; -const Script = script; -const Stack = stack$2; -const State$1 = state$2; -const Store = store_1; -// const Swarm = require('../types/swarm'); -// const Transaction = require('./transaction'); -const Vector = vector$1; -const Wallet = wallet; -const Worker$1 = worker; - -/** - * Reliable decentralized infrastructure. - * @property {Class} Block - */ -class Fabric$5 extends Service$3 { - /** - * The {@link Fabric} type implements a peer-to-peer protocol for - * establishing and settling of mutually-agreed upon proofs of - * work. Contract execution takes place in the local node first, - * then is optionally shared with the network. - * - * Utilizing - * @exports Fabric - * @constructor - * @param {Vector} config - Initial configuration for the Fabric engine. This can be considered the "genesis" state for any contract using the system. If a chain of events is maintained over long periods of time, `state` can be considered "in contention", and it is demonstrated that the outstanding value of the contract remains to be settled. - * @emits Fabric#thread - * @emits Fabric#step Emitted on a `compute` step. - */ - constructor (vector = {}) { - super(vector); - - // local settings - this.settings = Object.assign({ - path: './stores/fabric', - persistent: false - }, vector); - - // start with reference to object - this.ident = new Actor(this.config); - this.state = new Actor(vector); // State - - // build maps - this.agent = {}; // Identity - this.modules = {}; // List - this.opcodes = {}; // Map - this.peers = {}; // Map - this.plugins = {}; // Map - this.services = {}; // Map - - // initialize components - this.chain = new Chain(this.config); - this.machine = new Machine(this.config); - this.store = new Store(this.config); - // this.script = new Script(this.config); - - this._state = { - status: 'PAUSED', - content: this.state.data - }; - - // provide instance - return this; - } - - static get registry () { - return { - local: local - }; - } - - static get App () { return App$3; } - static get Block () { return Block; } - static get Chain () { return Chain; } - static get Circuit () { return Circuit$1; } - static get Collection () { return Collection$2; } - // static get Contract () { return Contract; } - // static get Disk () { return Disk; } - static get Entity () { return Entity$1; } - static get Key () { return Key$1; } - static get Ledger () { return Ledger; } - static get Machine () { return Machine; } - static get Message () { return Message; } - static get Observer () { return Observer; } - static get Oracle () { return Oracle; } - // static get Peer () { return Peer; } - static get Program () { return Program; } - static get Remote () { return Remote; } - static get Resource () { return Resource$2; } - static get Service () { return Service$3; } - static get Scribe () { return Scribe; } - static get Script () { return Script; } - static get Stack () { return Stack; } - static get State () { return State$1; } - static get Store () { return Store; } - static get Swarm () { return Swarm; } - // static get Transaction () { return Transaction; } - static get Vector () { return Vector; } - static get Wallet () { return Wallet; } - static get Worker () { return Worker$1; } - - static sha256 (data) { - return crypto$3.createHash('sha256').update(data).digest('hex'); - } - - static random () { - // TODO: select random function - // do not trust keys until this is determined! - return Math.random(); - } - - async _GET (key) { - return this.store._GET(key); - } - - async _SET (key, value) { - return this.store._SET(key, value); - } - - async _PUT (key, value) { - return this.store._SET(key, value); - } - - async _POST (collection, value) { - return this.store._POST(collection, value); - } - - async _PATCH (key, overlay) { - return this.store._PATCH(key, overlay); - } - - async _DELETE (key) { - return this.store._DELETE(key); - } - - /** - * Register an available {@link Service} using an ES6 {@link Class}. - * @param {Class} service The ES6 {@link Class}. - */ - async register (service) { - if (!service) return new Error('Service must be provided.'); - - try { - let name = service.name || service.constructor.name; - this.modules[name.toLowerCase()] = service; - this.emit('message', { - '@type': 'ServiceRegistration', - '@data': { name: name } - }); - } catch (E) { - this.error('Could not register service:', E); - } - - return this; - } - - async enable (name) { - let self = this; - let Module = null; - let config = Object.assign({ - name: name, - path: `./stores/${name}` - }, this.config[name]); - - if (this.modules[name]) { - Module = this.modules[name]; - } else { - return this.error(`Could not enable module ${name}. Check local registry.`); - } - - // configure the service - this.services[name] = new Module(config); - this.services[name].on('ready', function () { - self.emit('service:ready', { name }); - }); - - // bind all events - self.trust(this.services[name]); - - try { - await this.services[name].start(); - this.emit('message', { - '@type': 'ServiceStartup', - '@data': { name: name } - }); - } catch (E) { - console.error(`exceptioning:`, E); - } - - return this; - } - - append (value) { - return this.chain.append(value); - } - - set (key, value) { - return State$1.pointer.set(this['@entity'], key, value); - } - - get (key) { - return State$1.pointer.get(this['@entity'], key); - } - - /** - * Push an instruction onto the stack. - * @param {Instruction} value - * @return {Stack} - */ - push (value) { - let name = value.constructor.name; - if (name !== 'Vector') value = new Vector(value)._sign(); - this.machine.script.push(value); - return this.machine.script; - } - - use (name, description) { - this.log('[FABRIC]', `defining ${name} as:`, description); - this.opcodes[name] = new Opcode(description); - return this.define(name, description); - } - - define (name, description) { - this.log(`Defining resource "${name}":`, description); - let vector = new Fabric$5.State(description); - let resource = new Fabric$5.Resource(name, description); - this.log(`Resource:`, resource); - this.log(`Resource as vector:`, vector); - return resource; - } - - identify (vector) { - if (!vector) vector = {}; - - let self = this; - let key = new Key$1(); - - self.identity = { key }; - - // a "vector" is a known truth, something that we've generated ourselves - // or otherwise derived truth from an origin (a genesis vector - // TODO: remove lodash - self['@data'] = Object.assign({}, self['@data'], vector, key); // should be equivalent to `f(x + y)` - - this.emit('auth', { - key: { - public: key.public - } - }); - - return this; - } - - send (target, message) { - // console.log('sending:', target, message); - return this.emit('message', { - 'target': target, - 'object': message - }); - } - - broadcast (msg, data) { - var self = this; - - self.emit(msg, data); - - Object.keys(self.peers).forEach(function tell (id) { - var peer = self.peers[id]; - peer.send(msg); - }); - - return true; - } - - /** - * Blindly consume messages from a {@link Source}, relying on `this.chain` to - * verify results. - * @param {EventEmitter} source Any object which implements the `EventEmitter` pattern. - * @return {Fabric} Returns itself. - */ - trust (source) { - let self = this; - - this.warn('[TRUST]', 'trusting:', typeof source); - - source.on('changes', async function (changes) { - self.log('source', typeof source, 'emitted:', changes); - }); - - source.on('transaction', async function (transaction) { - // console.log('[FABRIC:CORE]', '[EVENT:TRANSACTION]', `source (${source.constructor.name}):`, transaction); - // console.log('[PROPOSAL]', 'apply this transaction to local state:', transaction); - }); - - source.on('block', async function (block) { - await self.chain.append(block).catch(self.log.bind(self)); - }); - - source.on('patch', function (patch) { - console.log('source', typeof source, 'emitted patch:', patch); - self.emit('patch', Object.assign({}, patch, { - path: source.name + patch.path // TODO: check in Vector Machine that this is safe - })); - }); - - // normalized bindings - source.on('actor', function (actor) { - self.log(typeof source, 'source emitted actor:', actor); - self.emit('actor', { - id: [source.name, 'actors', actor.id].join('/'), - name: actor.name, - online: actor.online || false, - subscriptions: [] - }); - }); - - source.on('channel', function (channel) { - self.emit('channel', { - id: [source.name, 'channels', channel.id].join('/'), - name: channel.name, - members: [] - }); - }); - - source.on('join', async function (join) { - self.emit('join', { - user: [source.name, 'actors', join.user].join('/'), - channel: [source.name, 'channels', join.channel].join('/') - }); - }); - - source.on('message', async function (msg) { - let now = Date.now(); - let id = [now, msg.actor, msg.target, msg.object].join('/'); - let hash = crypto$3.createHash('sha256').update(id).digest('hex'); - let message = { - id: [source.name, 'messages', (msg.id || hash)].join('/'), - actor: [source.name, 'actors', msg.actor].join('/'), - target: [source.name, 'channels', msg.target].join('/'), - object: msg.object, - origin: { - type: 'Link', - name: source.name - }, - created: now - }; - - this.log('message:', message); - self.emit('message', message); - - let response = await self.parse(message); - if (response) { - await source.send(msg.target, response, { - parent: message - }); - - self.emit('response', { - parent: message, - response: response - }); - } - }); - - return self; - } - - /** - * Process the current stack. - * @return {Fabric} Resulting instance of the stack. - */ - compute () { - ++this.clock; - // console.log('[FABRIC:COMPUTE]', '[COMMIT:RESULT]', this.commit()); - return this; - } - - render () { - return ``; - } -} - -var fabric$2 = Fabric$5; - -/** - * # Fabric: an experimental p2p framework - * Providing an interface to Fabric network, this file defines the available - * components and abstractions used when relying on this library. - */ - -const Fabric$4 = fabric$2; - -/** - * Default interface to {@link Fabric}. Provides immutable types for all - * elements of the `components` option. - * @property {Configuration} config Initial {@link Vector}. - * @property {Map} config.components Transformation function of `Σ ⇒ Δ`. - */ -class App$2 extends Fabric$4 { - /** - * Create a new instance of the Fabric App. - * @param {Object} [config] Configuration object. - * @param {Object} [config.store] Path to local storage. - * @param {Object} [config.components] Map of components. - * @param {Object} [config.components.list] Name of "list" component. - * @param {Object} [config.components.view] Name of "view" component. - * @return {App} - */ - constructor (config) { - super(config); - - // Store the configuration - this.config = Object.assign({ - store: `./stores/${this.constructor.name.toLowerCase()}` - }, config); - - return this; - } - - /** - * Draw the application to canvas (display). - * @return {Mixed} - */ - render () { - return ``; - } -} - -var fabric$1 = App$2; - -/** - * Tokenize input string. - */ -function lexer(str) { - var tokens = []; - var i = 0; - while (i < str.length) { - var char = str[i]; - if (char === "*" || char === "+" || char === "?") { - tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); - continue; - } - if (char === "\\") { - tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); - continue; - } - if (char === "{") { - tokens.push({ type: "OPEN", index: i, value: str[i++] }); - continue; - } - if (char === "}") { - tokens.push({ type: "CLOSE", index: i, value: str[i++] }); - continue; - } - if (char === ":") { - var name = ""; - var j = i + 1; - while (j < str.length) { - var code = str.charCodeAt(j); - if ( - // `0-9` - (code >= 48 && code <= 57) || - // `A-Z` - (code >= 65 && code <= 90) || - // `a-z` - (code >= 97 && code <= 122) || - // `_` - code === 95) { - name += str[j++]; - continue; - } - break; - } - if (!name) - throw new TypeError("Missing parameter name at ".concat(i)); - tokens.push({ type: "NAME", index: i, value: name }); - i = j; - continue; - } - if (char === "(") { - var count = 1; - var pattern = ""; - var j = i + 1; - if (str[j] === "?") { - throw new TypeError("Pattern cannot start with \"?\" at ".concat(j)); - } - while (j < str.length) { - if (str[j] === "\\") { - pattern += str[j++] + str[j++]; - continue; - } - if (str[j] === ")") { - count--; - if (count === 0) { - j++; - break; - } - } - else if (str[j] === "(") { - count++; - if (str[j + 1] !== "?") { - throw new TypeError("Capturing groups are not allowed at ".concat(j)); - } - } - pattern += str[j++]; - } - if (count) - throw new TypeError("Unbalanced pattern at ".concat(i)); - if (!pattern) - throw new TypeError("Missing pattern at ".concat(i)); - tokens.push({ type: "PATTERN", index: i, value: pattern }); - i = j; - continue; - } - tokens.push({ type: "CHAR", index: i, value: str[i++] }); - } - tokens.push({ type: "END", index: i, value: "" }); - return tokens; -} -/** - * Parse a string for the raw tokens. - */ -function parse$1(str, options) { - if (options === void 0) { options = {}; } - var tokens = lexer(str); - var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; - var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?"); - var result = []; - var key = 0; - var i = 0; - var path = ""; - var tryConsume = function (type) { - if (i < tokens.length && tokens[i].type === type) - return tokens[i++].value; - }; - var mustConsume = function (type) { - var value = tryConsume(type); - if (value !== undefined) - return value; - var _a = tokens[i], nextType = _a.type, index = _a.index; - throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); - }; - var consumeText = function () { - var result = ""; - var value; - while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { - result += value; - } - return result; - }; - while (i < tokens.length) { - var char = tryConsume("CHAR"); - var name = tryConsume("NAME"); - var pattern = tryConsume("PATTERN"); - if (name || pattern) { - var prefix = char || ""; - if (prefixes.indexOf(prefix) === -1) { - path += prefix; - prefix = ""; - } - if (path) { - result.push(path); - path = ""; - } - result.push({ - name: name || key++, - prefix: prefix, - suffix: "", - pattern: pattern || defaultPattern, - modifier: tryConsume("MODIFIER") || "", - }); - continue; - } - var value = char || tryConsume("ESCAPED_CHAR"); - if (value) { - path += value; - continue; - } - if (path) { - result.push(path); - path = ""; - } - var open = tryConsume("OPEN"); - if (open) { - var prefix = consumeText(); - var name_1 = tryConsume("NAME") || ""; - var pattern_1 = tryConsume("PATTERN") || ""; - var suffix = consumeText(); - mustConsume("CLOSE"); - result.push({ - name: name_1 || (pattern_1 ? key++ : ""), - pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, - prefix: prefix, - suffix: suffix, - modifier: tryConsume("MODIFIER") || "", - }); - continue; - } - mustConsume("END"); - } - return result; -} -/** - * Compile a string to a template function for the path. - */ -function compile$1(str, options) { - return tokensToFunction(parse$1(str, options), options); -} -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction(tokens, options) { - if (options === void 0) { options = {}; } - var reFlags = flags(options); - var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; - // Compile all the tokens into regexps. - var matches = tokens.map(function (token) { - if (typeof token === "object") { - return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); - } - }); - return function (data) { - var path = ""; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (typeof token === "string") { - path += token; - continue; - } - var value = data ? data[token.name] : undefined; - var optional = token.modifier === "?" || token.modifier === "*"; - var repeat = token.modifier === "*" || token.modifier === "+"; - if (Array.isArray(value)) { - if (!repeat) { - throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array")); - } - if (value.length === 0) { - if (optional) - continue; - throw new TypeError("Expected \"".concat(token.name, "\" to not be empty")); - } - for (var j = 0; j < value.length; j++) { - var segment = encode(value[j], token); - if (validate && !matches[i].test(segment)) { - throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); - } - path += token.prefix + segment + token.suffix; - } - continue; - } - if (typeof value === "string" || typeof value === "number") { - var segment = encode(String(value), token); - if (validate && !matches[i].test(segment)) { - throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); - } - path += token.prefix + segment + token.suffix; - continue; - } - if (optional) - continue; - var typeOfMessage = repeat ? "an array" : "a string"; - throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage)); - } - return path; - }; -} -/** - * Create path match function from `path-to-regexp` spec. - */ -function match$1(str, options) { - var keys = []; - var re = pathToRegexp$1(str, keys, options); - return regexpToFunction(re, keys, options); -} -/** - * Create a path match function from `path-to-regexp` output. - */ -function regexpToFunction(re, keys, options) { - if (options === void 0) { options = {}; } - var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; - return function (pathname) { - var m = re.exec(pathname); - if (!m) - return false; - var path = m[0], index = m.index; - var params = Object.create(null); - var _loop_1 = function (i) { - if (m[i] === undefined) - return "continue"; - var key = keys[i - 1]; - if (key.modifier === "*" || key.modifier === "+") { - params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { - return decode(value, key); - }); - } - else { - params[key.name] = decode(m[i], key); - } - }; - for (var i = 1; i < m.length; i++) { - _loop_1(i); - } - return { path: path, index: index, params: params }; - }; -} -/** - * Escape a regular expression string. - */ -function escapeString(str) { - return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); -} -/** - * Get the flags for a regexp from the options. - */ -function flags(options) { - return options && options.sensitive ? "" : "i"; -} -/** - * Pull out keys from a regexp. - */ -function regexpToRegexp(path, keys) { - if (!keys) - return path; - var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; - var index = 0; - var execResult = groupsRegex.exec(path.source); - while (execResult) { - keys.push({ - // Use parenthesized substring match if available, index otherwise - name: execResult[1] || index++, - prefix: "", - suffix: "", - modifier: "", - pattern: "", - }); - execResult = groupsRegex.exec(path.source); - } - return path; -} -/** - * Transform an array into a regexp. - */ -function arrayToRegexp(paths, keys, options) { - var parts = paths.map(function (path) { return pathToRegexp$1(path, keys, options).source; }); - return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); -} -/** - * Create a path regexp from string input. - */ -function stringToRegexp(path, keys, options) { - return tokensToRegexp(parse$1(path, options), keys, options); -} -/** - * Expose a function for taking tokens and returning a RegExp. - */ -function tokensToRegexp(tokens, keys, options) { - if (options === void 0) { options = {}; } - var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; - var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); - var delimiterRe = "[".concat(escapeString(delimiter), "]"); - var route = start ? "^" : ""; - // Iterate over the tokens and create our regexp string. - for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { - var token = tokens_1[_i]; - if (typeof token === "string") { - route += escapeString(encode(token)); - } - else { - var prefix = escapeString(encode(token.prefix)); - var suffix = escapeString(encode(token.suffix)); - if (token.pattern) { - if (keys) - keys.push(token); - if (prefix || suffix) { - if (token.modifier === "+" || token.modifier === "*") { - var mod = token.modifier === "*" ? "?" : ""; - route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod); - } - else { - route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); - } - } - else { - if (token.modifier === "+" || token.modifier === "*") { - route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")"); - } - else { - route += "(".concat(token.pattern, ")").concat(token.modifier); - } - } - } - else { - route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); - } - } - } - if (end) { - if (!strict) - route += "".concat(delimiterRe, "?"); - route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); - } - else { - var endToken = tokens[tokens.length - 1]; - var isEndDelimited = typeof endToken === "string" - ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 - : endToken === undefined; - if (!strict) { - route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); - } - if (!isEndDelimited) { - route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); - } - } - return new RegExp(route, flags(options)); -} -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - */ -function pathToRegexp$1(path, keys, options) { - if (path instanceof RegExp) - return regexpToRegexp(path, keys); - if (Array.isArray(path)) - return arrayToRegexp(path, keys, options); - return stringToRegexp(path, keys, options); -} - -var dist_es2015 = /*#__PURE__*/Object.freeze({ - __proto__: null, - parse: parse$1, - compile: compile$1, - tokensToFunction: tokensToFunction, - match: match$1, - regexpToFunction: regexpToFunction, - tokensToRegexp: tokensToRegexp, - pathToRegexp: pathToRegexp$1 -}); - -var require$$1 = /*@__PURE__*/getAugmentedNamespace(dist_es2015); - -const { pathToRegexp, match, parse, compile } = require$$1; - -const Entity = entity; -const Service$2 = service_1; - -/** - * Simple router. - * @type {Object} - */ -class Router$2 extends Service$2 { - /** - * Builds a new {@link Router}. - * @param {Object} [settings={}] Configuration for the router. - * @return {Router} Instance of the {@link Router}. - */ - constructor (settings = {}) { - super(settings); - - let fee = { - '@type': 'BasisPointsOnValue', - '@data': 20 - }; - - this.current = null; - this.settings = Object.assign({ fee }, settings); - this.components = {}; - this.resources = {}; - this.routes = {}; - this.page = null; - - return this; - } - - define (name, definition) { - let result = super.define(name, definition); - - if (definition.components) { - if (definition.components.list) { - this.components[definition.components.list] = 'name/list'; - } - if (definition.components.view) { - this.components[definition.components.view] = 'name/view'; - } - } - - return result; - } - - route (msg) { - console.log('[MAKI:ROUTER]', 'ROUTING THE FOLLOWING MESSAGE', msg, this.routes); - let route = this._route(msg); - console.log('THE ROUTE:', route); - this.current = msg; - return Object.assign({ - fee: this.settings.fee, - route: route - }); - } - - _addRoute (route, component) { - this.routes[component] = { - path: route, - regex: pathToRegexp(route) - }; - // this.router.use(route.path, this._handleRoutableRequest.bind(this)); - return this.routes[route.name]; - } - - _route (path) { - for (let name in this.routes) { - let route = this.routes[name]; - let match = route.regex.exec(path); - if (match) { - return { - resource: route.resource, - component: name - }; - } - } - return null; - } - - /** - * Add a named definition. - * @param {String} path Flat path. - * @param {Object} definition Resource definition? - * @return {Promise} Resolves once added. - */ - async _addFlat (path, definition) { - this.routes[path] = definition; - } - - async _deliver (target, msg) { - console.log('delivering:', target, msg); - return this.members[target]; - } - - async _handleRoutableRequest (event) { - return this.router.route(event); - } - - async start () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'starting...'); - this.status = 'starting'; - - for (let name in this.routes) { - new Entity(this.routes[name].path); - /* this.state.channels[route.id] = Object.assign({ - path: this.routes[name].path, - members: [], - messages: [] - }); */ - } - - this.status = 'started'; - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'started!', this.state); - return this; - } - - async stop () { - if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'Stopping...'); - this.status = 'stopping'; - this.status = 'stopped'; - return this; - } -} - -var router = Router$2; - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -var foreach = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - -var each = foreach; -var jsonPointer = api; - - -/** - * Convenience wrapper around the api. - * Calls `.get` when called with an `object` and a `pointer`. - * Calls `.set` when also called with `value`. - * If only supplied `object`, returns a partially applied function, mapped to the object. - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - * @returns {*} - */ - -function api (obj, pointer, value) { - // .set() - if (arguments.length === 3) { - return api.set(obj, pointer, value); - } - // .get() - if (arguments.length === 2) { - return api.get(obj, pointer); - } - // Return a partially applied function on `obj`. - var wrapped = api.bind(api, obj); - - // Support for oo style - for (var name in api) { - if (api.hasOwnProperty(name)) { - wrapped[name] = api[name].bind(wrapped, obj); - } - } - return wrapped; -} - - -/** - * Lookup a json pointer in an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @returns {*} - */ -api.get = function get (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer); - - for (var i = 0; i < refTokens.length; ++i) { - var tok = refTokens[i]; - if (!(typeof obj == 'object' && tok in obj)) { - throw new Error('Invalid reference token: ' + tok); - } - obj = obj[tok]; - } - return obj; -}; - -/** - * Sets a value on an object - * - * @param {Object} obj - * @param {String|Array} pointer - * @param value - */ -api.set = function set (obj, pointer, value) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer), - nextTok = refTokens[0]; - - if (refTokens.length === 0) { - throw Error('Can not set the root object'); - } - - for (var i = 0; i < refTokens.length - 1; ++i) { - var tok = refTokens[i]; - if (typeof tok !== 'string' && typeof tok !== 'number') { - tok = String(tok); - } - if (tok === "__proto__" || tok === "constructor" || tok === "prototype") { - continue - } - if (tok === '-' && Array.isArray(obj)) { - tok = obj.length; - } - nextTok = refTokens[i + 1]; - - if (!(tok in obj)) { - if (nextTok.match(/^(\d+|-)$/)) { - obj[tok] = []; - } else { - obj[tok] = {}; - } - } - obj = obj[tok]; - } - if (nextTok === '-' && Array.isArray(obj)) { - nextTok = obj.length; - } - obj[nextTok] = value; - return this; -}; - -/** - * Removes an attribute - * - * @param {Object} obj - * @param {String|Array} pointer - */ -api.remove = function (obj, pointer) { - var refTokens = Array.isArray(pointer) ? pointer : api.parse(pointer); - var finalToken = refTokens[refTokens.length -1]; - if (finalToken === undefined) { - throw new Error('Invalid JSON pointer for remove: "' + pointer + '"'); - } - - var parent = api.get(obj, refTokens.slice(0, -1)); - if (Array.isArray(parent)) { - var index = +finalToken; - if (finalToken === '' && isNaN(index)) { - throw new Error('Invalid array index: "' + finalToken + '"'); - } - - Array.prototype.splice.call(parent, index, 1); - } else { - delete parent[finalToken]; - } -}; - -/** - * Returns a (pointer -> value) dictionary for an object - * - * @param obj - * @param {function} descend - * @returns {} - */ -api.dict = function dict (obj, descend) { - var results = {}; - api.walk(obj, function (value, pointer) { - results[pointer] = value; - }, descend); - return results; -}; - -/** - * Iterates over an object - * Iterator: function (value, pointer) {} - * - * @param obj - * @param {function} iterator - * @param {function} descend - */ -api.walk = function walk (obj, iterator, descend) { - var refTokens = []; - - descend = descend || function (value) { - var type = Object.prototype.toString.call(value); - return type === '[object Object]' || type === '[object Array]'; - }; - - (function next (cur) { - each(cur, function (value, key) { - refTokens.push(String(key)); - if (descend(value)) { - next(value); - } else { - iterator(value, api.compile(refTokens)); - } - refTokens.pop(); - }); - }(obj)); -}; - -/** - * Tests if an object has a value for a json pointer - * - * @param obj - * @param pointer - * @returns {boolean} - */ -api.has = function has (obj, pointer) { - try { - api.get(obj, pointer); - } catch (e) { - return false; - } - return true; -}; - -/** - * Escapes a reference token - * - * @param str - * @returns {string} - */ -api.escape = function escape (str) { - return str.toString().replace(/~/g, '~0').replace(/\//g, '~1'); -}; - -/** - * Unescapes a reference token - * - * @param str - * @returns {string} - */ -api.unescape = function unescape (str) { - return str.replace(/~1/g, '/').replace(/~0/g, '~'); -}; - -/** - * Converts a json pointer into a array of reference tokens - * - * @param pointer - * @returns {Array} - */ -api.parse = function parse (pointer) { - if (pointer === '') { return []; } - if (pointer.charAt(0) !== '/') { throw new Error('Invalid JSON pointer: ' + pointer); } - return pointer.substring(1).split(/\//).map(api.unescape); -}; - -/** - * Builds a json pointer from a array of reference tokens - * - * @param refTokens - * @returns {string} - */ -api.compile = function compile (refTokens) { - if (refTokens.length === 0) { return ''; } - return '/' + refTokens.map(api.escape).join('/'); -}; - -// const Component = require('../types/component'); - -class BrowserContent$1 { - constructor (settings = {}) { - // super(settings); - - this.settings = Object.assign({ - name: 'UnsafeBrowserContent', - title: 'UnsafeBrowserContent', - handle: 'fabric-browser-content' - }, settings); - - return this; - } - - init () { - console.log('[BROWSER:CONTENT]', 'init()'); - } - - _getInnerHTML () { - let html = ``; - html += `
`; - html += `

Preparing content...

`; - html += `

The application is compiling your document.

`; - html += `
`; - return html; - } - - render () { - return `${this._getInnerHTML()}`; - } -} - -var browserContent = BrowserContent$1; - -// Defaults -require('../settings/state'); - -const crypto$2 = require('crypto'); -const Service$1 = require('@fabric/core/types/service'); -// const Fabric = require('@fabric/core'); - -/** - * Generic component. - */ -class FabricComponent extends Service$1 { - /** - * Create a component. - * @param {Object} [settings={}] Settings for the component. - * @return {Component} Fully-configured component. - */ - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - handle: 'fabric-component', - path: '/' - }, settings); - - this.state = settings; - this.element = null; - - // Healthy Cleanup - this._boundFunctions = {}; - this._listeners = {}; - - return this; - } - - get path () { - return this.settings.path; - } - - get data () { - return JSON.stringify(this.state || {}); - } - - get hash () { - // TODO: cache and skip - return crypto$2.createHash('sha256').update(this.render()).digest('hex'); - } - - get integrity () { - // TODO: cache and skip - let hash = crypto$2.createHash('sha256').update(this.data).digest('base64'); - return `sha256-${hash}`; - } - - attributeChangedCallback (name, old, value) { - console.log('[MAKI:COMPONENT]', 'Component notified a change:', name, 'changed to:', value, `(was ${old})`); - } - - connectedCallback () { - console.log('[MAKI:COMPONENT]', 'Component added to page:', this); - let html = this._getInnerHTML(this.state); - - this.setAttribute('data-integrity', Fabric.sha256(html)); - this.setAttribute('data-fingerprint', this.fingerprint); - // this.innerHTML = html; - this.innerHTML = html + ''; - - /* let binding = this.getAttribute('data-bind'); - - if (binding) { - // TODO: use Fabric.Remote - fetch(`fabric:${binding}`) - .then((response) => response.text()) - .then((responseText) => { - this.render(JSON.parse(responseText)); - }) - .catch((error) => { - console.error(error); - }); - } */ - - // Reflect.construct(HTMLElement, [], this.constructor); - return this; - } - - disconnectedCallback () { - console.log('[MAKI:COMPONENT]', 'Component removed from page:', this); - - for (let name in this._boundFunctions) { - this.removeEventListener('message', this._boundFunctions[name]); - } - } - - _bind (element) { - if (this.element) ; - - this.element = element; - this.element.addEventListener('refresh', this.refresh.bind(this)); - this.element.addEventListener('message', this._handleComponentMessage.bind(this)); - - this.render(); - - return this; - } - - _handleComponentMessage (msg) { - console.log('[FABRIC:COMPONENT]', 'Element emitted message:', msg); - } - - _toElement () { - let element = document.createElement(this.settings.handle); - element.innerHTML = this._getInnerHTML(this.state); - return element; - } - - _loadHTML (content) { - let hash = crypto$2.createHash('sha256').update(content).digest('base64'); - return `<${this.settings.handle} integrity="sha256-${hash}">${content}`; - } - - _getInnerHTML (state) { - return `${JSON.stringify(state || this.state)}`; - } - - _renderState (state) { - // TODO: render Template here - // cc: @melnx @lel @lllllll:fabric.pub - let content = this._getInnerHTML(state); - return this._loadHTML(content); - } - - refresh () { - if (this.element) { - this.element.innerHTML = this._getInnerHTML(this.state); - } - } - - register () { - customElements.define(this.settings.handle, Component, { extends: 'div' }); - } - - render () { - if (this.element) { - this.element.innerHTML = this._getInnerHTML(); - } - return this._renderState(this.state); - } -} - -// TODO: debug why this can't be used on this parent class... -// ``` -// TypeError: Class extends value # is not a constructor or null -// Module. -// src/components/FabricIdentityManager.js:19 -// 16 | import IdentityPicker from './IdentityPicker'; -// 17 | import SeedEntryForm from './SeedEntryForm'; -// 18 | -// > 19 | class FabricIdentityManager extends FabricComponent { -// 20 | constructor (props) { -// 21 | super(props); -// 22 | -// ``` -// export default connect(FabricStateMapper)(FabricComponent); -// -// ... -// End of @fabric/core/types/component - -var component = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': FabricComponent -}); - -var require$$10 = /*@__PURE__*/getAugmentedNamespace(component); - -// const Component = require('./component'); -const Component$5 = require$$10; - -class Introduction$2 extends Component$5 { - constructor (settings = {}) { - super(settings); - - this.settings = Object.assign({ - title: 'Introduction to Maki, a cross-platform UI designer', - handle: 'fabric-introduction' - }, settings); - - return this; - } - - _getInnerHTML () { - return `
-

${this.settings.title}

-

Welcome to Fabric, friend.

-

Help Wanted

-

Curious adventurers inquire within.

-
`; - } -} - -var introduction = Introduction$2; - -var jquery = {exports: {}}; - -/*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2021-03-02T17:08Z - */ - -(function (module) { -( function( global, factory ) { - - { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : commonjsGlobal, function( window, noGlobal ) { - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - `; - return content; - } - - async _toggleFullscreen () { - // TODO: implement fullscreen from RPG - } - - /** - * Generate the rendered HTML output of the application's user interface. - * @return {String} HTML string. - */ - render () { - let page = this.page.render(); - let html = this._loadHTML(page); - let pretty = beautify.html(html, { - indent_size: 2, - extra_liners: [] - }); - - return pretty; - } - - /** - * Launches any necessary processes and notifies the user on ready. - * @return {Promise} Resolves on completion. - */ - async start () { - if (typeof window !== 'undefined' && window.app) await window.app.stop(); - - if (this.store) { - try { - await this.store.start(); - } catch (E) { - console.error('Could not open store:', E); - } - } - - await this.define('FabricMenu', Menu); - await this.define('ResourceList', ResourceList); - - for (const name in this.resources) { - const definition = this.resources[name]; - if (definition.data) { - // TODO: move this to `types/resource.js` - if (!definition.names) { - definition.names = { - singular: name, - plural: pluralize(name) - }; - } - await this.set(`/${definition.names.plural.toLowerCase()}`, definition.data); - } - } - - this.on('call', this._handleCall.bind(this)); - - // await this.fabric.start(); - try { - await this.circuit.start(); - await this.browser.start(); - await this.router.start(); - } catch (E) { - console.error('Could not start, Exception:', E); - } - - return true; - } - - async stop () { - await this.router.stop(); - await this.browser.stop(); - await this.circuit.stop(); - if (this.store) await this.store.stop(); - - return true; - } -} - -var app = App$1; - -const D3GraphViz = d3Graphviz.exports; +const D3GraphViz = require('d3-graphviz'); // TODO: switch core to types -const Service = service_1; -const Circuit = circuit; -const App = app; +const Service = require('@fabric/core/types/service'); +const Circuit = require('@fabric/core/types/circuit'); +const App = require('../types/app'); async function main () { window.App = App; @@ -254300,5 +122,3 @@ async function main () { } main(); - -export { scripts$2 as default }; diff --git a/docs/App.html b/docs/App.html new file mode 100644 index 00000000..65e87b9a --- /dev/null +++ b/docs/App.html @@ -0,0 +1,3374 @@ + + + + + Class: App · Docs + + + + + + + +
+

Class: App

+ + + + + +
+ +
+ +

App(settingsopt) → {App}

+ +
Applications can be deployed to the legacy web using App, a powerful +template for building modern web applications.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new App(settingsopt) → {App}

+ + + + + + +
+ Create a Web application. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Application settings. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
circuit + + +Circuit + + + + + + <optional>
+ + + + + +
Instance of an existing Circuit.
resources + + +Object + + + + + + <optional>
+ + + + + +
Map of Resource classes.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the application. +
+ + + +
+
+ Type +
+
+ +App + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate the rendered HTML output of the application's user interface. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML string. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate the rendered HTML output of the application's user interface. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML string. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

App(settingsopt) → {App}

+ +
Applications can be deployed to the legacy web using App, a powerful +template for building modern web applications.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new App(settingsopt) → {App}

+ + + + + + +
+ Create a Web application. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Application settings. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
circuit + + +Circuit + + + + + + <optional>
+ + + + + +
Instance of an existing Circuit.
resources + + +Object + + + + + + <optional>
+ + + + + +
Map of Resource classes.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the application. +
+ + + +
+
+ Type +
+
+ +App + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate the rendered HTML output of the application's user interface. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML string. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate the rendered HTML output of the application's user interface. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML string. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Application.html b/docs/Application.html new file mode 100644 index 00000000..57690faa --- /dev/null +++ b/docs/Application.html @@ -0,0 +1,602 @@ + + + + + Class: Application · Docs + + + + + + + +
+

Class: Application

+ + + + + +
+ +
+ +

Application(configurationopt) → {Application}

+ +
Primary Application Definition
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Application(configurationopt) → {Application}

+ + + + + + +
+ Create an instance of the RPG client. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
configuration + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Key/value map of configuration options.
+ + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
rpg + + +Object + + + + Instance of the RPG engine.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of our Application. +
+ + + +
+
+ Type +
+
+ +Application + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _deliver(destination, message) → {Promise}

+ + + + + + +
+ Deliver a message to an address. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
destination + + +String + + + + Address in the Fabric network.
message + + +Mixed + + + + Message to deliver.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves once the message has been broadcast. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Get the output of our program. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Output of the program. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Compiler.html b/docs/Compiler.html new file mode 100644 index 00000000..48a290ed --- /dev/null +++ b/docs/Compiler.html @@ -0,0 +1,1162 @@ + + + + + Class: Compiler · Docs + + + + + + + +
+

Class: Compiler

+ + + + + +
+ +
+ +

Compiler(settingsopt)

+ +
Builder for Fabric-based applications.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Compiler(settingsopt)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
Map of settings. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
document + + +Mixed + + + + + + <optional>
+ + + + + +
Document to use.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

compile(input) → {String}

+ + + + + + +
+ Build a String representing the HTML-encoded Document. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Mixed + + + + Input data to use for local rendering.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

compile(input) → {String}

+ + + + + + +
+ Build a String representing the HTML-encoded Document. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Mixed + + + + Input data to use for local rendering.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Compiler(settingsopt)

+ +
Builder for Fabric-based applications.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Compiler(settingsopt)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
Map of settings. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
document + + +Mixed + + + + + + <optional>
+ + + + + +
Document to use.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

compile(input) → {String}

+ + + + + + +
+ Build a String representing the HTML-encoded Document. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Mixed + + + + Input data to use for local rendering.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

compile(input) → {String}

+ + + + + + +
+ Build a String representing the HTML-encoded Document. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Mixed + + + + Input data to use for local rendering.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Component.html b/docs/Component.html new file mode 100644 index 00000000..bc5ee381 --- /dev/null +++ b/docs/Component.html @@ -0,0 +1,682 @@ + + + + + Class: Component · Docs + + + + + + + +
+

Class: Component

+ + + + + +
+ +
+ +

Component()

+ +
The Component element is a generic class for creating interactive DOM +elements, usually for later composition in an App.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Component()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Definition.html b/docs/Definition.html new file mode 100644 index 00000000..fcc5927e --- /dev/null +++ b/docs/Definition.html @@ -0,0 +1,620 @@ + + + + + Class: Definition · Docs + + + + + + + +
+

Class: Definition

+ + + + + +
+ +
+ +

Definition()

+ + +
+ +
+
+ + + + + + +

new Definition()

+ + + + + + + + + + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name for this type.
name + + +String + + + + Human-friendly plural name for this type.
routes + + +Object + + + + Path hint for retrieving an index. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +String + + + + Path hint for retrieving an index.
view + + +String + + + + Path hint for retrieving a single entity.
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Definition()

+ + +
+ +
+
+ + + + + + +

new Definition()

+ + + + + + + + + + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name for this type.
name + + +String + + + + Human-friendly plural name for this type.
routes + + +Object + + + + Path hint for retrieving an index. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +String + + + + Path hint for retrieving an index.
view + + +String + + + + Path hint for retrieving a single entity.
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/FabricComponent.html b/docs/FabricComponent.html new file mode 100644 index 00000000..3d8615b6 --- /dev/null +++ b/docs/FabricComponent.html @@ -0,0 +1,480 @@ + + + + + Class: FabricComponent · Docs + + + + + + + +
+

Class: FabricComponent

+ + + + + +
+ +
+ +

FabricComponent(settingsopt) → {Component}

+ +
Generic component.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new FabricComponent(settingsopt) → {Component}

+ + + + + + +
+ Create a component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the component.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-configured component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

FabricComponent(settingsopt) → {Component}

+ +
Generic component.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new FabricComponent(settingsopt) → {Component}

+ + + + + + +
+ Create a component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the component.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-configured component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/FabricHTTPServer.html b/docs/FabricHTTPServer.html new file mode 100644 index 00000000..7d8af3fd --- /dev/null +++ b/docs/FabricHTTPServer.html @@ -0,0 +1,3538 @@ + + + + + Class: FabricHTTPServer · Docs + + + + + + + +
+

Class: FabricHTTPServer

+ + + + + +
+ +
+ +

FabricHTTPServer(settingsopt) → {FabricHTTPServer}

+ +
The primary web server.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new FabricHTTPServer(settingsopt) → {FabricHTTPServer}

+ + + + + + +
+ Create an instance of the HTTP server. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
Configuration values. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +String + + + + + + <optional>
+ + + + + +
+ + "FabricHTTPServer" + + User-friendly name of this server.
port + + +Number + + + + + + <optional>
+ + + + + +
+ + 9999 + + Port to listen for HTTP connections on.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-configured instance of the HTTP server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Service
  • +
+ + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_addRoute(method, path, handler)

+ + + + + + +
+ Add a route manually. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
method + + +String + + + + HTTP verb.
path + + +String + + + + HTTP route.
handler + + +function + + + + HTTP handler (req, res, next)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_addRoute(method, path, handler)

+ + + + + + +
+ Add a route manually. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
method + + +String + + + + HTTP verb.
path + + +String + + + + HTTP route.
handler + + +function + + + + HTTP handler (req, res, next)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleIndexRequest(req, res)

+ + + + + + +
+ Special handler for first-page requests. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
req + + +HTTPRequest + + + + Incoming request.
res + + +HTTPResponse + + + + Outgoing response.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleIndexRequest(req, res)

+ + + + + + +
+ Special handler for first-page requests. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
req + + +HTTPRequest + + + + Incoming request.
res + + +HTTPResponse + + + + Outgoing response.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleWebSocket(socket, request) → {WebSocket}

+ + + + + + +
+ Connection manager for WebSockets. Called once the handshake is complete. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +WebSocket + + + + The associated WebSocket.
request + + +http.IncomingMessage + + + + Incoming HTTP request.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Returns the connected socket. +
+ + + +
+
+ Type +
+
+ +WebSocket + + +
+
+ + + + + + + + + + + + + +

_handleWebSocket(socket, request) → {WebSocket}

+ + + + + + +
+ Connection manager for WebSockets. Called once the handshake is complete. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +WebSocket + + + + The associated WebSocket.
request + + +http.IncomingMessage + + + + Incoming HTTP request.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Returns the connected socket. +
+ + + +
+
+ Type +
+
+ +WebSocket + + +
+
+ + + + + + + + + + + + + +

(async) define(name, definition) → {FabricHTTPServer}

+ + + + + + +
+ Define a Type by name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name of the type.
definition + + +Definition + + + + Configuration object for the type.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the configured server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + + + + + + +

(async) define(name, definition) → {FabricHTTPServer}

+ + + + + + +
+ Define a Type by name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name of the type.
definition + + +Definition + + + + Configuration object for the type.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the configured server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

FabricHTTPServer(settingsopt) → {FabricHTTPServer}

+ +
The primary web server.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new FabricHTTPServer(settingsopt) → {FabricHTTPServer}

+ + + + + + +
+ Create an instance of the HTTP server. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
Configuration values. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +String + + + + + + <optional>
+ + + + + +
+ + "FabricHTTPServer" + + User-friendly name of this server.
port + + +Number + + + + + + <optional>
+ + + + + +
+ + 9999 + + Port to listen for HTTP connections on.
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-configured instance of the HTTP server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Service
  • +
+ + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_addRoute(method, path, handler)

+ + + + + + +
+ Add a route manually. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
method + + +String + + + + HTTP verb.
path + + +String + + + + HTTP route.
handler + + +function + + + + HTTP handler (req, res, next)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_addRoute(method, path, handler)

+ + + + + + +
+ Add a route manually. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
method + + +String + + + + HTTP verb.
path + + +String + + + + HTTP route.
handler + + +function + + + + HTTP handler (req, res, next)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleIndexRequest(req, res)

+ + + + + + +
+ Special handler for first-page requests. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
req + + +HTTPRequest + + + + Incoming request.
res + + +HTTPResponse + + + + Outgoing response.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleIndexRequest(req, res)

+ + + + + + +
+ Special handler for first-page requests. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
req + + +HTTPRequest + + + + Incoming request.
res + + +HTTPResponse + + + + Outgoing response.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_handleWebSocket(socket, request) → {WebSocket}

+ + + + + + +
+ Connection manager for WebSockets. Called once the handshake is complete. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +WebSocket + + + + The associated WebSocket.
request + + +http.IncomingMessage + + + + Incoming HTTP request.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Returns the connected socket. +
+ + + +
+
+ Type +
+
+ +WebSocket + + +
+
+ + + + + + + + + + + + + +

_handleWebSocket(socket, request) → {WebSocket}

+ + + + + + +
+ Connection manager for WebSockets. Called once the handshake is complete. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
socket + + +WebSocket + + + + The associated WebSocket.
request + + +http.IncomingMessage + + + + Incoming HTTP request.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Returns the connected socket. +
+ + + +
+
+ Type +
+
+ +WebSocket + + +
+
+ + + + + + + + + + + + + +

(async) define(name, definition) → {FabricHTTPServer}

+ + + + + + +
+ Define a Type by name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name of the type.
definition + + +Definition + + + + Configuration object for the type.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the configured server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + + + + + + +

(async) define(name, definition) → {FabricHTTPServer}

+ + + + + + +
+ Define a Type by name. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Human-friendly name of the type.
definition + + +Definition + + + + Configuration object for the type.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the configured server. +
+ + + +
+
+ Type +
+
+ +FabricHTTPServer + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Hub.html b/docs/Hub.html new file mode 100644 index 00000000..876a605b --- /dev/null +++ b/docs/Hub.html @@ -0,0 +1,782 @@ + + + + + Class: Hub · Docs + + + + + + + +
+

Class: Hub

+ + + + + +
+ +
+ +

Hub(configuration)

+ +
The Hub is a temporary class in the Fabric HTTP library +which handles WebRTC and WebSocket connections, wrapping the core +Fabric protocol for legacy web clients (including browsers).
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Hub(configuration)

+ + + + + + +
+ Create an instance of the Hub. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
configuration + + +Object + + + + Settings for the Hub.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Oracle
  • +
+ + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) start()

+ + + + + + +
+ Start the Hub and listen for incoming connections. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) start()

+ + + + + + +
+ Start the Hub and listen for incoming connections. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Hub(configuration)

+ +
The Hub is a temporary class in the Fabric HTTP library +which handles WebRTC and WebSocket connections, wrapping the core +Fabric protocol for legacy web clients (including browsers).
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Hub(configuration)

+ + + + + + +
+ Create an instance of the Hub. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
configuration + + +Object + + + + Settings for the Hub.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Oracle
  • +
+ + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) start()

+ + + + + + +
+ Start the Hub and listen for incoming connections. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) start()

+ + + + + + +
+ Start the Hub and listen for incoming connections. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Maki.html b/docs/Maki.html new file mode 100644 index 00000000..c618bc0f --- /dev/null +++ b/docs/Maki.html @@ -0,0 +1,928 @@ + + + + + Class: Maki · Docs + + + + + + + +
+

Class: Maki

+ + + + + +
+ +
+ +

Maki(settingsopt) → {Maki}

+ +
Maki makes building beautiful apps a breeze.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Maki(settingsopt) → {Maki}

+ + + + + + +
+ Build a new application. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configuration for the Maki app.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of Maki. +
+ + + +
+
+ Type +
+
+ +Maki + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

render() → {String}

+ + + + + + +
+ Generate an HTML string representing the current state of the app. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML-encoded string representing the application. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate an HTML string representing the current state of the app. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML-encoded string representing the application. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Maki(settingsopt) → {Maki}

+ +
Maki makes building beautiful apps a breeze.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Maki(settingsopt) → {Maki}

+ + + + + + +
+ Build a new application. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configuration for the Maki app.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of Maki. +
+ + + +
+
+ Type +
+
+ +Maki + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

render() → {String}

+ + + + + + +
+ Generate an HTML string representing the current state of the app. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML-encoded string representing the application. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Generate an HTML string representing the current state of the app. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ HTML-encoded string representing the application. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Modal.html b/docs/Modal.html new file mode 100644 index 00000000..65da6bc7 --- /dev/null +++ b/docs/Modal.html @@ -0,0 +1,1100 @@ + + + + + Class: Modal · Docs + + + + + + + +
+

Class: Modal

+ + + + + +
+ +
+ +

Modal(settingsopt) → {Component}

+ +
Prompt the user for some input with a Modal.
+ + +
+ +
+
+ + + + +

Constructor

+ + + + + + + + + + +
+ The Modal Component provides an interrupting prompt for the +user to answer. Progress is blocked until the prompt is complete, and no +computations will take place until user input is provided. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Modal.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_setContent(content)

+ + + + + + +
+ Sets the content of the modal. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
content + + +Modal + + + + String of HTML to add as content.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

submit(event) → {Component}

+ + + + + + +
+ Submit a form contained within the modal's content window. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + +Event + + + + Event from application.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Remote.html b/docs/Remote.html new file mode 100644 index 00000000..72c98fcf --- /dev/null +++ b/docs/Remote.html @@ -0,0 +1,6462 @@ + + + + + Class: Remote · Docs + + + + + + + +
+

Class: Remote

+ + + + + +
+ +
+ +

Remote(target)

+ +
Interact with a remote Resource. This is currently the only +HTTP-related code that should remain in @fabric/core — all else must +be moved to @fabric/http before final release!
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Remote(target)

+ + + + + + +
+ An in-memory representation of a node in our network. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +Object + + + + Target object. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
host + + +String + + + + Named host, e.g. "localhost".
secure + + +String + + + + Require TLS session.
+ +
+ + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +
secure + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _DELETE(path, params) → {Object}

+ + + + + + +
+ HTTP DELETE on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _DELETE(path, params) → {Object}

+ + + + + + +
+ HTTP DELETE on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _GET(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP GET against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _GET(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP GET against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _OPTIONS(path, params) → {Object}

+ + + + + + +
+ HTTP OPTIONS on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _OPTIONS(path, params) → {Object}

+ + + + + + +
+ HTTP OPTIONS on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _PATCH(path, body) → {Object}

+ + + + + + +
+ HTTP PATCH on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _PATCH(path, body) → {Object}

+ + + + + + +
+ HTTP PATCH on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _POST(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP POST against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _POST(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP POST against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _PUT(path, body) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP PUT against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _PUT(path, body) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP PUT against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) enumerate() → {Configuration}

+ + + + + + +
+ Enumerate the available Resources on the remote host. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ An object with enumerable key/value pairs for the Application Resource Contract. +
+ + + +
+
+ Type +
+
+ +Configuration + + +
+
+ + + + + + + + + + + + + +

(async) enumerate() → {Configuration}

+ + + + + + +
+ Enumerate the available Resources on the remote host. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ An object with enumerable key/value pairs for the Application Resource Contract. +
+ + + +
+
+ Type +
+
+ +Configuration + + +
+
+ + + + + + + + + + + + + +

(async) request(type, path, paramsopt) → {FabricHTTPResult}

+ + + + + + +
+ Make an HTTP request to the configured authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +String + + + + + + + + + + One of `GET`, `PUT`, `POST`, `DELETE`, or `OPTIONS`.
path + + +String + + + + + + + + + + The path to request from the authority.
params + + +Object + + + + + + <optional>
+ + + + + +
Options.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +FabricHTTPResult + + +
+
+ + + + + + + + + + + + + +

(async) request(type, path, paramsopt) → {FabricHTTPResult}

+ + + + + + +
+ Make an HTTP request to the configured authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +String + + + + + + + + + + One of `GET`, `PUT`, `POST`, `DELETE`, or `OPTIONS`.
path + + +String + + + + + + + + + + The path to request from the authority.
params + + +Object + + + + + + <optional>
+ + + + + +
Options.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +FabricHTTPResult + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Remote(target)

+ +
Interact with a remote Resource. This is currently the only +HTTP-related code that should remain in @fabric/core — all else must +be moved to @fabric/http before final release!
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Remote(target)

+ + + + + + +
+ An in-memory representation of a node in our network. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + +Object + + + + Target object. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
host + + +String + + + + Named host, e.g. "localhost".
secure + + +String + + + + Require TLS session.
+ +
+ + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +
secure + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _DELETE(path, params) → {Object}

+ + + + + + +
+ HTTP DELETE on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _DELETE(path, params) → {Object}

+ + + + + + +
+ HTTP DELETE on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _GET(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP GET against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _GET(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP GET against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _OPTIONS(path, params) → {Object}

+ + + + + + +
+ HTTP OPTIONS on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _OPTIONS(path, params) → {Object}

+ + + + + + +
+ HTTP OPTIONS on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _PATCH(path, body) → {Object}

+ + + + + + +
+ HTTP PATCH on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _PATCH(path, body) → {Object}

+ + + + + + +
+ HTTP PATCH on the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ - Full description of remote resource. +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(async) _POST(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP POST against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _POST(path, params) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP POST against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
params + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _PUT(path, body) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP PUT against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) _PUT(path, body) → {FabricHTTPResult|String}

+ + + + + + +
+ HTTP PUT against the configured Authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + HTTP Path to request.
body + + +Object + + + + Map of parameters to supply.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Result of request. +
+ + + +
+
+ Type +
+
+ +FabricHTTPResult +| + +String + + +
+
+ + + + + + + + + + + + + +

(async) enumerate() → {Configuration}

+ + + + + + +
+ Enumerate the available Resources on the remote host. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ An object with enumerable key/value pairs for the Application Resource Contract. +
+ + + +
+
+ Type +
+
+ +Configuration + + +
+
+ + + + + + + + + + + + + +

(async) enumerate() → {Configuration}

+ + + + + + +
+ Enumerate the available Resources on the remote host. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ An object with enumerable key/value pairs for the Application Resource Contract. +
+ + + +
+
+ Type +
+
+ +Configuration + + +
+
+ + + + + + + + + + + + + +

(async) request(type, path, paramsopt) → {FabricHTTPResult}

+ + + + + + +
+ Make an HTTP request to the configured authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +String + + + + + + + + + + One of `GET`, `PUT`, `POST`, `DELETE`, or `OPTIONS`.
path + + +String + + + + + + + + + + The path to request from the authority.
params + + +Object + + + + + + <optional>
+ + + + + +
Options.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +FabricHTTPResult + + +
+
+ + + + + + + + + + + + + +

(async) request(type, path, paramsopt) → {FabricHTTPResult}

+ + + + + + +
+ Make an HTTP request to the configured authority. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +String + + + + + + + + + + One of `GET`, `PUT`, `POST`, `DELETE`, or `OPTIONS`.
path + + +String + + + + + + + + + + The path to request from the authority.
params + + +Object + + + + + + <optional>
+ + + + + +
Options.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +FabricHTTPResult + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Router.html b/docs/Router.html new file mode 100644 index 00000000..2c1064a6 --- /dev/null +++ b/docs/Router.html @@ -0,0 +1,1216 @@ + + + + + Class: Router · Docs + + + + + + + +
+

Class: Router

+ + + + + +
+ +
+ +

Router(settingsopt) → {Router}

+ +
Simple router.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Router(settingsopt) → {Router}

+ + + + + + +
+ Builds a new Router. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configuration for the router.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Router. +
+ + + +
+
+ Type +
+
+ +Router + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _addFlat(path, definition) → {Promise}

+ + + + + + +
+ Add a named definition. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + Flat path.
definition + + +Object + + + + Resource definition?
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves once added. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) _addFlat(path, definition) → {Promise}

+ + + + + + +
+ Add a named definition. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + Flat path.
definition + + +Object + + + + Resource definition?
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves once added. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Router(settingsopt) → {Router}

+ +
Simple router.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Router(settingsopt) → {Router}

+ + + + + + +
+ Builds a new Router. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configuration for the router.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Router. +
+ + + +
+
+ Type +
+
+ +Router + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _addFlat(path, definition) → {Promise}

+ + + + + + +
+ Add a named definition. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + Flat path.
definition + + +Object + + + + Resource definition?
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves once added. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

(async) _addFlat(path, definition) → {Promise}

+ + + + + + +
+ Add a named definition. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +String + + + + Flat path.
definition + + +Object + + + + Resource definition?
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves once added. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/SPA.html b/docs/SPA.html new file mode 100644 index 00000000..54d3da24 --- /dev/null +++ b/docs/SPA.html @@ -0,0 +1,2930 @@ + + + + + Class: SPA · Docs + + + + + + + +
+

Class: SPA

+ + + + + +
+ +
+ +

SPA(settingsopt, componentsopt) → {App}

+ +
Fully-managed HTML application.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SPA(settingsopt, componentsopt) → {App}

+ + + + + + +
+ Create a single-page app. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the application. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +String + + + + + + <optional>
+ + + + + +
+ + "@fabric/maki" + + Name of the app.
offline + + +Boolean + + + + + + <optional>
+ + + + + +
+ + true + + Hint offline mode to browsers.
+ +
components + + +Object + + + + + + <optional>
+ + + + + +
+ + Map of Web Components for the application to utilize.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the application. +
+ + + +
+
+ Type +
+
+ +App + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Return a string of HTML for the application. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-rendered HTML document. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Return a string of HTML for the application. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-rendered HTML document. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

SPA(settingsopt, componentsopt) → {App}

+ +
Fully-managed HTML application.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SPA(settingsopt, componentsopt) → {App}

+ + + + + + +
+ Create a single-page app. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the application. +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +String + + + + + + <optional>
+ + + + + +
+ + "@fabric/maki" + + Name of the app.
offline + + +Boolean + + + + + + <optional>
+ + + + + +
+ + true + + Hint offline mode to browsers.
+ +
components + + +Object + + + + + + <optional>
+ + + + + +
+ + Map of Web Components for the application to utilize.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the application. +
+ + + +
+
+ Type +
+
+ +App + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) _handleNavigation(ctx, next) → {Promise}

+ + + + + + +
+ Trigger navigation. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ctx + + +Context + + + + Navigating context.
next + + +function + + + + Function called if no route found.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolved on routing complete. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Return a string of HTML for the application. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-rendered HTML document. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

render() → {String}

+ + + + + + +
+ Return a string of HTML for the application. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Fully-rendered HTML document. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

(async) start() → {Promise}

+ + + + + + +
+ Launches any necessary processes and notifies the user on ready. +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Resolves on completion. +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Stash.html b/docs/Stash.html new file mode 100644 index 00000000..b33bee36 --- /dev/null +++ b/docs/Stash.html @@ -0,0 +1,161 @@ + + + + + Class: Stash · Docs + + + + + + + +
+

Class: Stash

+ + + + + +
+ +
+ +

Stash()

+ +
Deprecated 2021-10-16.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Stash()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • Yes
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Steps.html b/docs/Steps.html new file mode 100644 index 00000000..4b2e2de7 --- /dev/null +++ b/docs/Steps.html @@ -0,0 +1,804 @@ + + + + + Class: Steps · Docs + + + + + + + +
+

Class: Steps

+ + + + + +
+ +
+ +

Steps(settingsopt) → {Component}

+ +
Prompt the user for some input with a Steps.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Steps(settingsopt) → {Component}

+ + + + + + +
+ The Steps Component provides an interrupting prompt for the +user to answer. Progress is blocked until the prompt is complete, and no +computations will take place until user input is provided. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Steps.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_redraw(stateopt) → {Component}

+ + + + + + +
+ Re-draw the component, using provided state or existing state. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + State to render with (optional).
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +

_registerHandler(name, method)

+ + + + + + +
+ Attach a handler to an event. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +String + + + + Name of the event to listen for.
method + + +function + + + + Function to execute.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(settingsopt) → {Component}

+ + + + + + +
+ Create a new Fabric Component. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Settings for the Component.
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the Component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/Wallet.html b/docs/Wallet.html new file mode 100644 index 00000000..9f04921d --- /dev/null +++ b/docs/Wallet.html @@ -0,0 +1,480 @@ + + + + + Class: Wallet · Docs + + + + + + + +
+

Class: Wallet

+ + + + + +
+ +
+ +

Wallet(settingsopt) → {Wallet}

+ +
Manage keys and track their balances.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Wallet(settingsopt) → {Wallet}

+ + + + + + +
+ Create an instance of a Wallet. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configure the wallet.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the wallet. +
+ + + +
+
+ Type +
+
+ +Wallet + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

Wallet(settingsopt) → {Wallet}

+ +
Manage keys and track their balances.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Wallet(settingsopt) → {Wallet}

+ + + + + + +
+ Create an instance of a Wallet. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configure the wallet.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the wallet. +
+ + + +
+
+ Type +
+
+ +Wallet + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/WalletCard.html b/docs/WalletCard.html new file mode 100644 index 00000000..bf0d4c27 --- /dev/null +++ b/docs/WalletCard.html @@ -0,0 +1,254 @@ + + + + + Class: WalletCard · Docs + + + + + + + +
+

Class: WalletCard

+ + + + + +
+ +
+ +

WalletCard(settingsopt) → {Wallet}

+ +
Manage keys and track their balances.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new WalletCard(settingsopt) → {Wallet}

+ + + + + + +
+ Create an instance of a Wallet. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + Configure the wallet.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the wallet. +
+ + + +
+
+ Type +
+
+ +Wallet + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/WalletCreator.html b/docs/WalletCreator.html new file mode 100644 index 00000000..d90f1a9f --- /dev/null +++ b/docs/WalletCreator.html @@ -0,0 +1,254 @@ + + + + + Class: WalletCreator · Docs + + + + + + + +
+

Class: WalletCreator

+ + + + + +
+ +
+ +

WalletCreator(settingsopt) → {Component}

+ +
Simple user interface for creating a Wallet.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new WalletCreator(settingsopt) → {Component}

+ + + + + + +
+ Create an instance of the Wallet Creator. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
settings + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + + [description]
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ Instance of the component. +
+ + + +
+
+ Type +
+
+ +Component + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/components_application.js.html b/docs/components_application.js.html new file mode 100644 index 00000000..3a5b745c --- /dev/null +++ b/docs/components_application.js.html @@ -0,0 +1,343 @@ + + + + + Source: components/application.js · Docs + + + + + + + +
+

Source: components/application.js

+ + + + + +
+
+
'use strict';
+
+const Fabric = require('@fabric/core');
+const App = require('../types/app');
+
+const RPG = require('../types/rpg');
+const Authority = require('./authority');
+const Canvas = require('./canvas');
+
+const Identity = require('../types/identity');
+const Swarm = require('../types/swarm');
+
+/**
+ * Primary Application Definition
+ * @property {Object} rpg Instance of the RPG engine.
+ */
+class Application extends App {
+  /**
+   * Create an instance of the RPG client.
+   * @param  {Object} [configuration={}] Key/value map of configuration options.
+   * @return {Application}               Instance of our {@link Application}.
+   */
+  constructor (configuration = {}) {
+    super(configuration);
+
+    // An authority is required when running in a browser.
+    this.authority = null;
+    this.identity = null;
+    this.identities = {};
+
+    this['@data'] = Object.assign({
+      handle: 'rpg-app',
+      authority: 'alpha.roleplaygateway.com:9999',
+      canvas: {
+        height: 480,
+        width: 640
+      }
+    }, configuration);
+
+    this.rpg = new RPG(configuration);
+    this.swarm = new Swarm({
+      port: this['@data'].port,
+      secure: (this['@data'].secure !== false)
+    });
+
+    // configure remote retrieval
+    this.remote = new Fabric.Remote({
+      host: this['@data'].authority,
+      secure: (this['@data'].secure !== false)
+    });
+
+    return this;
+  }
+
+  /**
+   * Deliver a message to an address.
+   * @param  {String}  destination Address in the Fabric network.
+   * @param  {Mixed}  message     Message to deliver.
+   * @return {Promise}             Resolves once the message has been broadcast.
+   */
+  async _deliver (destination, message) {
+    console.log('[APPLICATION]', 'delivering:', destination, message);
+    if (!this.swarm.connections[destination]) console.error('Not connected to peer:', destination);
+    let delivery = await this.swarm.connections[destination].send({
+      '@type': 'UntypedDocument',
+      '@destination': destination,
+      '@data': message
+    });
+    this.log('message delivered:', delivery);
+    return delivery;
+  }
+
+  async _handleAuthorityReady () {
+    console.log('authority ready!  announcing player:', this.identity);
+    await this._announcePlayer(this.identity);
+
+    let peers = await this.remote._GET('/peers');
+
+    for (let i = 0; i < peers.length; i++) {
+      this.swarm.connect(peers[i].address);
+    }
+  }
+
+  async _handleMessage (msg) {
+    if (!msg.data) return console.error(`Malformed message:`, msg);
+
+    let parsed = null;
+
+    try {
+      parsed = JSON.parse(msg.data);
+    } catch (E) {
+      return console.error(`Couldn't parse data:`, E);
+    }
+
+    if (!parsed['@type']) return console.error(`No type provided:`, parsed);
+    if (!parsed['@data']) return console.error(`No data provided:`, parsed);
+
+    if (typeof parsed['@data'] === 'string') {
+      console.warn('Found string:', parsed);
+      parsed['@data'] = JSON.parse(parsed['@data']);
+    }
+
+    console.log('hello:', parsed['@type'], parsed);
+
+    switch (parsed['@type']) {
+      default:
+        console.error('[APP:_handleMessage]', `Unhandled type:`, parsed['type'], parsed);
+        break;
+      case 'PeerMessage':
+        let content = parsed['@data'].object;
+
+        console.log('parsed data:', parsed['@data']);
+
+        switch (content['@type']) {
+          default:
+            console.log('[PEER:MESSAGE]', 'unhandled type', parsed['@data'].object['@type']);
+            break;
+          case 'GET':
+            // TODO: deduct funds from channel
+            console.log('this:', this);
+            console.log('path:', parsed['@data'].object['@data'].path);
+            let answer = await this.stash._GET(parsed['@data'].object['@data'].path);
+            let parts = parsed['@data'].actor.split('/');
+            let result = await this._deliver(parts[2], answer);
+            console.log('answer:', answer);
+            console.log('result:', result);
+            break;
+          case 'PATCH':
+            console.log('peer gave us PATCH:', content);
+
+            try {
+              // let result = await this.authority.patch(content['@data'].path, content['@data'].value);
+              let answer = await this.stash._PATCH(content['@data'].path, content['@data'].value);
+              console.log('answer:', answer);
+            } catch (E) {
+              console.log('could not patch:', E);
+            }
+
+            break;
+        }
+        break;
+      case 'PATCH':
+        this._processInstruction(parsed['@data']);
+        break;
+      case 'POST':
+        this._processInstruction(parsed['@data']);
+        break;
+    }
+  }
+
+  async _onMessage (message) {
+    console.log('hello, message:', message);
+
+    switch (message['@type']) {
+      default:
+        console.log('application onMessage received unknown type:', message['@type']);
+        break;
+      case 'PeerMessage':
+        console.log('hi peermessage:', message);
+
+        await this.stash._POST(`/messages/${message.id}`, message);
+
+        let fake = {
+          data: JSON.stringify(message)
+        };
+
+        await this._handleMessage(fake);
+
+        break;
+    }
+  }
+
+  async _onPeer (peer) {
+    console.log('swarm notified of peer:', peer);
+  }
+
+  async _onSwarmReady () {
+    console.log('swarm ready!  adding self to stash...');
+    // Add self to stash.
+    let link = await this.stash._POST(`/peers`, {
+      address: this.identity.address
+    });
+  }
+
+  async _onConnection (id) {
+    console.log('hello, connection:', id);
+    let connection = { address: id };
+    let posted = await this.stash._POST(`/connections`, connection);
+    console.log('posted:', posted);
+    console.log('connections:', this.swarm.connections);
+  }
+
+  async _updatePosition (x, y, z) {
+    if (!this.player) return;
+    return console.log('short circuited position patch');
+    await this.authority.patch(`/players/${this.player.id}`, {
+      id: this.player.id,
+      position: {
+        x: x,
+        y: y,
+        z: z
+      }
+    });
+  }
+
+  _toggleFullscreen () {
+    if (this.element.webkitRequestFullScreen) {
+      this.element.webkitRequestFullScreen();
+    }
+  }
+
+  _processInstruction (instruction) {
+    console.log('process instruction:', instruction);
+  }
+
+  /**
+   * Get the output of our program.
+   * @return {String}           Output of the program.
+   */
+  render () {
+    let canvas = this.canvas = new Canvas({
+      height: this.config.height,
+      width: this.config.width
+    });
+
+    // let drawn = canvas.draw();
+    let content = canvas.render();
+    let state = new Fabric.State(content);
+    let rendered = `<rpg-application integrity="sha256:${state.id}">${canvas.render()}</rpg-application><rpg-debugger data-bind="${state.id}" />`;
+    let sample = new Fabric.State(rendered);
+
+    if (this.element) {
+      this.element.setAttribute('integrity', `sha256:${sample.id}`);
+      this.element.innerHTML = rendered;
+    }
+
+    canvas.envelop('rpg-application canvas');
+    let html = this._loadHTML(rendered);
+    console.log('html rendered:', html);
+    return html;
+  }
+
+  async start () {
+    console.log('[APP]', 'Starting...');
+    let script = null;
+
+    await super.start();
+
+    try {
+      await this.rpg.start();
+    } catch (E) {
+      this.error('Could not start RPG:', E);
+      return null;
+    }
+
+    // this.menu.bind(document.querySelector('#menu'));
+    this.identity = await this._restoreIdentity();
+
+    console.log('[APP:DEBUG]', 'identity (in start):', this.identity);
+    console.log('[SWARM]', 'binding events...');
+
+    this.swarm.on('peer', this._onPeer.bind(this));
+    this.swarm.on('ready', this._onSwarmReady.bind(this));
+    this.swarm.on('message', this._onMessage.bind(this));
+    this.swarm.on('connection', this._onConnection.bind(this));
+    // this.swarm.connect('test');
+
+    await this.swarm.identify(this.identity.address);
+    await this.swarm.start();
+
+    // lastly, connect to an authority
+    try {
+      this.authority = new Authority(this['@data']);
+      this.authority.on('connection:ready', this._handleAuthorityReady.bind(this));
+      // TODO: enable message handler for production
+      // this.authority.on('message', this._handleMessage.bind(this));
+      // this.authority.on('changes', this._handleChanges.bind(this));
+      this.authority._connect();
+    } catch (E) {
+      this.error('Could not establish connection to authority:', E);
+    }
+
+    try {
+      // temporary measure for demo
+      // TODO: fix with webpack/maki
+      script = document.createElement('script');
+      script.setAttribute('src', '/scripts/semantic.js');
+
+      setTimeout(function () {
+        document.querySelector('#ephemeral-content').appendChild(script);
+      }, 1000);
+    } catch (E) {
+      console.error('[FABRIC:APP]', 'Could not create app:', E);
+    }
+
+    this.log('[APP]', 'Started!');
+    this.log('[APP]', 'State:', this.authority);
+
+    return this;
+  }
+}
+
+module.exports = Application;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_component.js.html b/docs/components_component.js.html new file mode 100644 index 00000000..8a49507b --- /dev/null +++ b/docs/components_component.js.html @@ -0,0 +1,274 @@ + + + + + Source: components/component.js · Docs + + + + + + + +
+

Source: components/component.js

+ + + + + +
+
+
'use strict';
+
+const Fabric = require('@fabric/core');
+const FabricElement = require('../types/element');
+
+const crypto = require('crypto');
+const manager = require('fast-json-patch');
+const pointer = require('json-pointer');
+
+/**
+ * The {@link Component} element is a generic class for creating interactive DOM
+ * elements, usually for later composition in an {@link App}.
+ */
+class Component extends FabricElement {
+  /**
+   * Create a new {@link Fabric} {@link Component}.
+   * @param  {Object} [settings={}] Settings for the {@link Component}.
+   * @return {Component}               Instance of the {@link Component}.
+   */
+  init (settings = {}) {
+    super.init(settings);
+
+    this.settings = Object.assign({
+      title: 'Fabric Component',
+      handle: 'fabric-component'
+    }, settings);
+
+    // this.element = document.createElement(this.settings.handle);
+    // this.fabric = new Fabric();
+    this._boundFunctions = {};
+    this._listeners = {};
+
+    this.remote = new Fabric.Remote({
+      host: window.host,
+      port: window.port
+    });
+
+    this._state = {
+      methods: {},
+      handlers: {}
+    };
+
+    return this;
+  }
+
+  get fingerprint () {
+    return crypto.createHash('sha256').update(JSON.stringify(this.state)).digest('hex');
+  }
+
+  get title () {
+    return this.settings.title;
+  }
+
+  get methods () {
+    return Object.keys(this.state.methods);
+  }
+
+  set state (state) {
+    if (!state) throw new Error('State must be provided.');
+    this._state = state;
+    this._redraw(this._state);
+  }
+
+  get state () {
+    return Object.assign({}, this._state);
+  }
+
+  /* init (state = {}) {
+    // Assign Settings
+    this.settings = Object.assign({
+      handle: 'starforge-component'
+    }, state);
+
+    // Assign State
+    this._state = {
+      handlers: {}
+    };
+
+    this._registerHandler('click', this.click.bind(this));
+    // this.addEventListener('click', this.click.bind(this));
+  } */
+
+  attributeChangedCallback (name, old, value) {
+    console.log('[MAKI:COMPONENT]', 'Component notified a change:', name, 'changed to:', value, `(was ${old})`);
+  }
+
+  connectedCallback () {
+    console.log('[MAKI:COMPONENT]', 'Component added to page:', this);
+    const state = (typeof window !== 'undefined' && window.app) ? window.app.state : this.state;
+    const html = this._getInnerHTML(state);
+
+    this.setAttribute('data-integrity', Fabric.sha256(html));
+    this.setAttribute('data-fingerprint', this.fingerprint);
+    // this.innerHTML = html;
+    this.innerHTML = html + '';
+
+    let binding = this.getAttribute('data-bind');
+
+    if (binding) {
+      // TODO: use Fabric.Remote
+      fetch(`fabric:${binding}`)
+        .then((response) => response.text())
+        .then((responseText) => {
+          this.render(JSON.parse(responseText));
+        })
+        .catch((error) => {
+          console.error(error);
+        });
+    }
+
+    // Reflect.construct(HTMLElement, [], this.constructor);
+    return this;
+  }
+
+  disconnectedCallback () {
+    console.log('[MAKI:COMPONENT]', 'Component removed from page:', this);
+    for (let name in this._boundFunctions) {
+      this.removeEventListener('message', this._boundFunctions[name]);
+    }
+  }
+
+  integrity (data = '') {
+    // TODO: cache and skip
+    return `sha256-${crypto.createHash('sha256').update(data).digest('base64')}`;
+  }
+
+  _getElement () {
+    return this.element;
+  }
+
+  /**
+   * Attach a handler to an event.
+   * @param {String} name Name of the event to listen for.
+   * @param {Function} method Function to execute.
+   */
+  _registerHandler (name, method) {
+    this.state.handlers[name] = method.bind(this);
+
+    switch (name) {
+      default:
+        console.warn('[MAKI:COMPONENT]', 'Unknown method for handler:', name);
+        break;
+      case 'click':
+      case 'submit':
+        // let listener = document.addEventListener(name, method);
+        // console.log('listener created:', listener);
+        let local = this.addEventListener(name, method);
+        break;
+    }
+  }
+
+  _registerMethod (name, method) {
+    this.state.methods[name] = method.bind(this);
+
+    if (window && window.app && window.app.circuit) {
+      window.app.circuit._registerMethod(name, this.state.methods[name]);
+    }
+  }
+
+  _handleLocalChange (patches) {
+    console.log('[MAKI:COMPONENT]', 'local changes:', patches);
+
+    for (let i = 0; i < patches.length; i++) {
+      let patch = patches[i];
+      switch (patch.op) {
+        case 'add':
+        case 'replace':
+          this.emit(patch.path, {
+            '@type': 'Snapshot',
+            '@data': patch.value
+          });
+          break;
+      }
+    }
+
+    this.emit('/', {
+      '@type': 'Snapshot',
+      '@data': this.state
+    });
+  }
+
+  /**
+   * Re-draw the component, using provided state or existing state.
+   * @param  {Object} [state={}] State to render with (optional).
+   * @return {Component}         Instance of the {@link Component}.
+   */
+  _redraw (state = {}) {
+    if (!state) state = this.state;
+    if (this.settings.verbosity >= 5) console.log('[MAKI:COMPONENT]', 'redrawing with state:', state);
+    this.innerHTML = this._getInnerHTML(state);
+    return this;
+  }
+
+  commit () {
+    let id = this.fingerprint();
+    return id;
+  }
+
+  _getInnerHTML (state) {
+    if (!state) state = (typeof window !== 'undefined') ? window.app.state : this.state;
+    return `<code integrity="${this.integrity}">${JSON.stringify(this.state)}</code>`;
+  }
+
+  renderToHTML () {
+    let content = this._getInnerHTML();
+    let hash = Fabric.sha256(content);
+    return `<${this.settings.handle} integrity="${this.integrity(content)}" data-hash="${hash}">${content}</${this.settings.handle}>`;
+  }
+
+  render () {
+    return this.renderToHTML();
+  }
+
+  async _GET (path) {
+    return pointer.get(this.state, path);
+  }
+
+  async _SET (path, value) {
+    return pointer.set(this.state, path, value);
+  }
+
+  async _applyChanges (ops) {
+    try {
+      monitor.applyPatch(this.state, ops);
+      await this.commit();
+    } catch (E) {
+      console.error('Error applying changes:', E);
+    }
+
+    return this;
+  }
+}
+
+module.exports = Component;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_modal.js.html b/docs/components_modal.js.html new file mode 100644 index 00000000..b11438f6 --- /dev/null +++ b/docs/components_modal.js.html @@ -0,0 +1,181 @@ + + + + + Source: components/modal.js · Docs + + + + + + + +
+

Source: components/modal.js

+ + + + + +
+
+
'use strict';
+
+const Component = require('./component');
+
+/**
+ * Prompt the user for some input with a {@link Modal}.
+ * @extends {Component}
+ */
+class Modal extends Component {
+  /**
+   * The {@link Modal} {@link Component} provides an interrupting prompt for the
+   * user to answer.  Progress is blocked until the prompt is complete, and no
+   * computations will take place until user input is provided.
+   * @param  {Object} [settings={}] Settings for the {@link Modal}.
+   * @return {Component}            Instance of the the {@link Component}.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      title: 'Modal',
+      description: 'An empty modal.',
+      content: 'Nothing to see here.  Move along, adventurer.',
+      actions: [
+        {
+          title: 'Cancel',
+          action: '_closeModal'
+        }
+      ],
+      methods: {},
+      handle: 'maki-modal'
+    }, settings);
+
+    this.state = {
+      actions: this.settings.actions,
+      content: this.settings.content,
+      methods: this.settings.methods
+    };
+
+    return this;
+  }
+
+  connectedCallback () {
+    super.connectedCallback();
+    console.log('[MAKI:MODAL]', 'connected!');
+
+    $(this).addClass('ui modal');
+
+    window.app.circuit._registerMethod('_closeModal', this._closeModal.bind(this));
+    window.app.circuit._registerMethod('_submitModalForm', this._submitModalForm.bind(this));
+  }
+
+  /**
+   * Submit a form contained within the modal's content window.
+   * @param  {Event} event Event from application.
+   * @return {Component}       Instance of the component.
+   */
+  submit (event) {
+    console.log('SUBMIT!', event, this);
+    let self = this;
+    let form = this.querySelector('.content .content form');
+    let fields = $(form).serializeArray();
+    let data = {};
+
+    this.status = 'submitting';
+
+    for (let i = 0; i < fields.length; i++) {
+      data[fields[i].name] = fields[i].value;
+    }
+
+    // TODO: call child method
+    let action = form.getAttribute('data-action');
+    let target = form.getAttribute('action');
+
+    window.app._POST(target, data).then(function (result) {
+      console.log('[MAKI:MODAL]', 'submitted, result:', result);
+      self.status = 'queueing';
+      self._closeModal();
+    });
+
+    return this;
+  }
+
+  _openModal (event) {
+    this.status = 'opening';
+    $(this).modal('show');
+    this.status = 'open';
+  }
+
+  _closeModal (event) {
+    this.status = 'closing';
+    $('.ui.modal').modal('hide');
+    this.status = 'closed';
+    $('maki-modal').remove();
+    return this;
+  }
+
+  _submitModalForm (event) {
+    event.preventDefault();
+    console.log('TODO: submit modal form here', event, event.target, this);
+    // if (window.app.modal) window.app.modal.submit();
+    window.app.modal.submit();
+  }
+
+  /**
+   * Sets the content of the modal.
+   * @param {Modal} content String of HTML to add as content.
+   */
+  _setContent (content) {
+    this.settings.content = content;
+    this.innerHTML = this._getInnerHTML();
+    return this;
+  }
+
+  _getInnerHTML () {
+    let html = `<div class="header">${this.settings.title}</div><div class="content">`;
+    html += `<div class="description">${this.settings.description}</div>`;
+
+    if (this.settings.content) {
+      html += `<div class="content ui segment">${this.settings.content}</div>`;
+    }
+
+    html += '</div>';
+    html += `<div class="ui actions fluid buttons">`;
+
+    for (let i = 0; i < this.settings.actions.length; i++) {
+      let action = this.settings.actions[i];
+      html += `<div class="ui button${(action.type === 'primary') ? ' primary' : ''}${(action.icon) ? ' right labeled icon ' + action.icon : ''}" data-action="${action.action}">${action.title}${(action.icon) ? '<i class="' + action.icon + ' icon"></i>' : ''}</div>`;
+    }
+
+    html += '</div>';
+
+    return html;
+  }
+
+  render () {
+    return `<${this.settings.handle}${(this.settings.id) ? ' id="' + this.settings.id + '"' : ''} class="ui modal">${this._getInnerHTML()}</${this.settings.handle}>`;
+  }
+}
+
+module.exports = Modal;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_steps.js.html b/docs/components_steps.js.html new file mode 100644 index 00000000..b90e6908 --- /dev/null +++ b/docs/components_steps.js.html @@ -0,0 +1,167 @@ + + + + + Source: components/steps.js · Docs + + + + + + + +
+

Source: components/steps.js

+ + + + + +
+
+
'use strict';
+
+const Component = require('./component');
+
+/**
+ * Prompt the user for some input with a {@link Steps}.
+ * @extends {Component}
+ */
+class Steps extends Component {
+  /**
+   * The {@link Steps} {@link Component} provides an interrupting prompt for the
+   * user to answer.  Progress is blocked until the prompt is complete, and no
+   * computations will take place until user input is provided.
+   * @param  {Object} [settings={}] Settings for the {@link Steps}.
+   * @return {Component}            Instance of the the {@link Component}.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      title: 'Steps',
+      description: 'A list of steps.',
+      controls: false,
+      content: 'Nothing to see here.  Move along, adventurer.',
+      current: null,
+      steps: [
+        {
+          title: 'Step 0:',
+          icon: 'anvil',
+          description: 'Configure your client.',
+          validator: '_validateSteps'
+        }
+      ],
+      methods: {},
+      handle: 'maki-steps'
+    }, settings);
+
+    this.state = {
+      clock: 0,
+      steps: this.settings.steps,
+      content: this.settings.content,
+      methods: this.settings.methods
+    };
+
+    return this;
+  }
+
+  connectedCallback () {
+    super.connectedCallback();
+
+    console.log('[MAKI:STEPS]', 'connected!  current clock:', this.state.clock);
+
+    window.app.circuit._registerMethod('_advanceStep', this._advanceStep.bind(this));
+
+    let target = document.querySelector(`.maki-step[data-step="${this.state.clock}"]`);
+    let others = document.querySelectorAll(`.maki-step:not([data-step="${this.state.clock}"])`);
+
+    $(target).show();
+    $(others).hide();
+  }
+
+  _advanceStep (event) {
+    event.preventDefault();
+
+    this.state.clock = this.state.clock++;
+
+    let elements = document.querySelectorAll('.tab');
+
+    console.log('candidate elements:', elements);
+
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+
+      $(element).removeClass('active');
+
+      if (element.getAttribute('data-tab') == i) {
+        element.className += ' active';
+      }
+    }
+  }
+
+  _getInnerHTML () {
+    let html = `<div class="ui segment">`;
+    let progress = parseFloat(1 / this.settings.steps.length, 2);
+
+    html += `<div class="ui top attached evenly spaced steps">`;
+    for (let i = 0; i < this.settings.steps.length; i++) {
+      let step = this.settings.steps[i];
+      html += `<div class="step">`;
+      if (step.icon) html += `<i class="${step.icon} icon"></i>`;
+      html += `<div class="content">`;
+      html += `<div class="title">${step.title}</div>`;
+      html += `<div class="description">${step.description}</div>`;
+      html += `</div>`;
+      html += `</div>`;
+    }
+    html += '</div>';
+
+    html += `<div class="ui bottom attached segment">`;
+
+    html += `<div class="ui blue indeterminate progress">`;
+    html += `<div class="bar"><div class="progress">loading...</div></div>`;
+    html += `</div>`;
+
+    for (let i = 0; i < this.settings.steps.length; i++) {
+      let step = this.settings.steps[i];
+      html += `<div class="ui maki-step ${(step.active) ? ' active' : ' hidden'}${(this.status === 'loading') ? ' loading' : ''} segment" data-step="${i}">`;
+      html += `<div class="content">${step.content + ''}</div>`;
+      html += `</div>`;
+    }
+
+    html += `</div>`;
+
+    if (this.settings.controls) {
+      html += `<div class="ui segment controls">`;
+      html += `<div class="ui buttons"><div class="ui button">Back</div><div class="ui button" data-action="_advanceStep">Forward</div></div>`;
+      html += `</div>`;
+    }
+
+    html += '</div>';
+    html += `</div>`;
+
+    return html;
+  }
+}
+
+module.exports = Steps;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_table.js.html b/docs/components_table.js.html new file mode 100644 index 00000000..92bddaa4 --- /dev/null +++ b/docs/components_table.js.html @@ -0,0 +1,128 @@ + + + + + Source: components/table.js · Docs + + + + + + + +
+

Source: components/table.js

+ + + + + +
+
+
'use strict';
+
+const Component = require('./component');
+
+/**
+ * Manage a table of columnar data.
+ * @extends {Component}
+ */
+class Table extends Component {
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      title: 'Table',
+      description: 'An empty table.',
+      rows: [],
+      methods: {},
+      handle: 'maki-table'
+    }, settings);
+
+    this._state = {
+      rows: this.settings.rows
+    };
+
+    return this;
+  }
+
+  connectedCallback () {
+    super.connectedCallback();
+    console.log('[MAKI:TABLE]', 'connected!');
+    window.app.circuit._registerMethod('_resortRows', this._resortRows.bind(this));
+  }
+
+  _resortRows (event) {
+    this.status = 'resorting';
+    // TODO: implement
+    // this.emit('resort');
+    this.status = 'resorted';
+    return this;
+  }
+
+  /**
+   * Sets the content of the modal.
+   * @param {Table} content String of HTML to add as content.
+   */
+  _setContent (content) {
+    this.settings.content = content;
+    this.innerHTML = this._getInnerHTML();
+    return this;
+  }
+
+  _getInnerHTML () {
+    let html = `<div class="header">${this.settings.title}</div>`;
+    html += `<div class="content">`;
+    html += `<div class="description">${this.settings.description}</div>`;
+
+    if (this.settings.content) {
+      html += `<div class="content ui segment">${this.settings.content}</div>`;
+    }
+
+    html += '</div>';
+    html += `<table class="ui table">`;
+    html += `<tbody>`;
+
+    for (let i = 0; i < this._state.rows.length; i++) {
+      let row = this._state.rows[i];
+      let fields = Object.keys(row);
+
+      html += `<tr>`;
+
+      for (let j = 0; j < fields.length; j++) {
+        html += `<td>`;
+        html += `<code>${row}</code>`;
+        html += `</td>`;
+      }
+
+      html += `</tr>`;
+    }
+
+    html += '</tbody>';
+    html += '</table>';
+    html += '</div>';
+
+    return html;
+  }
+}
+
+module.exports = Table;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_wallet-card.js.html b/docs/components_wallet-card.js.html new file mode 100644 index 00000000..a101d4e7 --- /dev/null +++ b/docs/components_wallet-card.js.html @@ -0,0 +1,145 @@ + + + + + Source: components/wallet-card.js · Docs + + + + + + + +
+

Source: components/wallet-card.js

+ + + + + +
+
+
'use strict';
+
+const Fabric = require('@fabric/core');
+const Component = require('../types/component');
+
+/**
+ * Manage keys and track their balances.
+ * @type {Object}
+ */
+class WalletCard extends Component {
+  /**
+   * Create an instance of a {@link Wallet}.
+   * @param  {Object} [settings={}] Configure the wallet.
+   * @return {Wallet}               Instance of the wallet.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      name: 'default',
+      network: 'testnet',
+      handle: 'fabric-wallet-card'
+    }, settings);
+
+    this.account = null;
+    this.manager = null;
+    this.wallet = null;
+    this.master = null;
+    this.seed = null;
+
+    this.status = 'closed';
+
+    return this;
+  }
+
+  _handleWalletTransaction (tx) {
+    console.log('[BRIDGE:WALLET]', 'incoming transaction:', tx);
+  }
+
+  _getDepositAddress () {
+    return this.address;
+  }
+
+  async _handleWalletBalance (balance) {
+    console.log('wallet balance:', balance);
+    await this._PUT(`/balance`, balance);
+
+    let depositor = new Fabric.State({ name: 'eric' });
+    await this._PUT(`/depositors/${depositor.id}/balance`, balance);
+    this.emit('balance', balance);
+  }
+
+  async _registerAccount (obj) {
+    this.status = 'creating';
+
+    if (!this.database.db.loaded) {
+      await this.database.open();
+    }
+
+    try {
+      this.wallet = await this.database.create();
+    } catch (E) {
+      console.error('Could not create wallet:', E);
+    }
+
+    if (this.manager) {
+      this.manager.on('tx', this._handleWalletTransaction.bind(this));
+      this.manager.on('balance', this._handleWalletBalance.bind(this));
+    }
+
+    return this.account;
+  }
+
+  async _unload () {
+    return this.database.close();
+  }
+
+  async _load (settings = {}) {
+    this.status = 'loading';
+
+    await this.database.open();
+
+    this.wallet = await this.database.create();
+    this.account = await this.wallet.getAccount('default');
+    this.address = await this.account.receiveAddress();
+
+    this.status = 'loaded';
+
+    this.emit('ready');
+
+    console.log('[FABRIC:WALLET]', 'Wallet opened:', this.wallet);
+
+    return this.wallet;
+  }
+
+  async start () {
+    return this._load();
+  }
+
+  _getInnerHTML () {
+    return `<div class="ui card"><div class="content"><h3 class="ui header">${this.title}</h3></div><div class="extra content"><div class="ui large transparent disabled left icon input"><i class="bitcoin icon"></i> <input type="text" value="0.00000000" disabled /></div></div></div>`;
+  }
+}
+
+module.exports = WalletCard;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/components_wallet-creator.js.html b/docs/components_wallet-creator.js.html new file mode 100644 index 00000000..694b0ace --- /dev/null +++ b/docs/components_wallet-creator.js.html @@ -0,0 +1,379 @@ + + + + + Source: components/wallet-creator.js · Docs + + + + + + + +
+

Source: components/wallet-creator.js

+ + + + + +
+
+
'use strict';
+
+const Component = require('./component');
+const Wallet = require('../types/wallet');
+
+/**
+ * Simple user interface for creating a {@link Wallet}.
+ */
+class WalletCreator extends Component {
+  /**
+   * Create an instance of the Wallet Creator.
+   * @param  {Object} [settings={}] [description]
+   * @return {Component}            Instance of the component.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      input: null,
+      handle: 'fabric-wallet-creator'
+    }, settings);
+
+    this.wallet = new Wallet();
+    this.state = {
+      clock: 0,
+      wallets: []
+    };
+
+    return this;
+  }
+
+  _submitFormWithData (event) {
+    event.preventDefault();
+    console.log('WHOA EVENT:', event);
+  }
+
+  _loadConfirmedPanel (html) {
+    let steps = document.querySelector('maki-steps');
+    let elements = document.querySelectorAll('.tab');
+
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+      if (parseInt(element.getAttribute('data-step')) === this.state.clock) {
+        let content = element.querySelector('.content');
+        content.innerHTML = `<div class="ui message">
+          <h4 class="ui header">Ready to Generate Keys</h4>
+          <maki-canvas id="entropy-viewer"></maki-canvas>
+          <p>Ready to generate. <a class="ui button" data-action="_loadGeneratorPanel">Generate</a></p>
+        </div>`;
+      }
+    }
+  }
+
+  _loadGeneratorPanel () {
+    let self = this;
+    let steps = this.querySelector('maki-steps');
+    let elements = document.querySelectorAll('.tab');
+
+    console.log('steps:', steps);
+
+    for (let i = 0; i < steps.length; i++) {
+      let step = steps[i];
+      if (i === this.state.clock) {
+        step.className += ' active';
+      }
+    }
+
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+      if (parseInt(element.getAttribute('data-step')) === this.state.clock) {
+        let content = element.querySelector('.content');
+        let wallet = new Wallet();
+
+        content.innerHTML = `<div class="ui message">
+          <h4 class="ui header">Generating keys...</h4>
+          <maki-canvas id="entropy-viewer"></maki-canvas>
+          <p><div class="ui loading button">Generating...</div><p>
+        </div>`;
+
+        wallet._load().then(function (data) {
+          let memory = {
+            address: wallet.account.receiveAddress(),
+            seed: wallet.wallet.master.mnemonic.phrase
+          };
+
+          window.app._POST('/wallets', memory).then(function (data) {
+            console.log('data:', data);
+            wallet.set('/wallets', [window.app.get(data)]);
+            window.wallet = wallet;
+            self._loadSuccessPanel();
+          });
+        });
+      }
+    }
+  }
+
+  _loadSuccessPanel () {
+    let steps = document.querySelector('maki-steps');
+    let elements = document.querySelectorAll('.tab');
+
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+      if (parseInt(element.getAttribute('data-step')) === this.state.clock) {
+        let content = element.querySelector('.content');
+        content.innerHTML = `<div class="ui message">
+          <h4 class="ui header">Keys Generated</h4>
+          <code class="code">${window.wallet}</code>
+          <maki-canvas id="entropy-viewer"></maki-canvas>
+          <p><div class="ui green right labeled icon button" data-action="_loadStepTwo">Next Step <i class="right chevron icon"></i></div><p>
+        </div>`;
+      }
+    }
+  }
+
+  _loadStepTwo () {
+    let elements = document.querySelectorAll('.tab');
+
+    this.state.clock = 1;
+
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+      if (parseInt(element.getAttribute('data-step')) === this.state.clock) {
+        let content = element.querySelector('.content');
+        let steps = element.querySelector('maki-steps');
+        console.log('steps:', steps);
+        content.innerHTML = `<div class="ui message">
+          <h4 class="ui header">Verify Your Keys</h4>
+          <maki-canvas id="entropy-viewer"></maki-canvas>
+          <p>Double-check that the address matches your device and <a href="">the transaction on the blockchain</a>.  <div class="ui green right labeled icon button" data-action="_loadStepTwo">Next Step <i class="right chevron icon"></i></div><p>
+        </div>`;
+      }
+    }
+  }
+
+  _advanceToLabeling (event) {
+    event.preventDefault();
+
+    this.status = 'advancing';
+
+    let steps = this.querySelector('maki-steps');
+
+    steps.state.clock = 2;
+    steps.connectedCallback();
+
+    this.status = 'labeling';
+  }
+
+  _advanceToKeyGeneration (event) {
+    console.log('KEY GENERATION:', event, this);
+    let self = this;
+
+    self.status = 'advancing';
+
+    let steps = this.querySelector('maki-steps');
+    let element = document.querySelector('.maki-step[data-step="0"]');
+    let content = element.querySelector('.content');
+
+    console.log('element:', element);
+    console.log('content:', content);
+
+    let old = content.innerHTML;
+
+    content.innerHTML = `<h4>Generating key...</h4>
+      <button class="ui loading button">generating...</button>`;
+
+    this.status = 'waiting';
+    this.wallet._load().then(function (data) {
+      let seed = self.wallet._getSeed();
+
+      if (seed) {
+        steps.state.clock = 1;
+
+        let target = document.querySelector('.maki-step[data-step="1"]');
+        let message = target.querySelector('.content');
+
+        message.innerHTML = `<h4>Your Wallet Seed</h4>
+          <p>Write this down and store it somewhere safe & secure.  <strong>Your funds will be permanently lost without this.</p>
+          <code>${seed}</code>
+          <button class="ui fluid right labeled icon button" data-action="_advanceToLabeling">I've saved this, move forward<i class="right chevron icon"></i></button>`;
+
+        steps.connectedCallback();
+      } else {
+        content.innerHTML = old;
+      }
+    });
+
+    this.status = 'loaded';
+    steps.innerHTML = steps._getInnerHTML();
+    // this.innerHTML = this._getInnerHTML();
+  }
+
+  _advanceToKeyRestoration (event) {
+    console.log('KEY RESTORATION:', event, this);
+    let self = this;
+
+    let steps = this.querySelector('maki-steps');
+    let element = document.querySelector('.maki-step[data-step="0"]');
+    let content = element.querySelector('.content');
+
+    console.log('element:', element);
+    console.log('content:', content);
+
+    let html = `<h4>Provide Wallet Seed</h4>
+      <p>For improved security, turn off your network connection and ensure there are no cameras recording your screen.</p>
+      <select multiple class="ui fluid search multiple dropdown" name="seed" placeholder="Enter your 24-word restoration seed"><option></option>`;
+    for (let i = 0; i < this.wallet.words.length; i++) {
+      let word = self.wallet.words[i];
+      html += `<option value="${word}">${word}</option>`;
+    }
+    html += `</select>
+      <button class="ui fluid right icon labeled button" data-action="_confirmSeedPhrase">Confirm <i class="right chevron icon"></i></button>`;
+
+    content.innerHTML = html;
+    steps.innerHTML = steps._getInnerHTML();
+
+    $('.ui.dropdown').dropdown();
+  }
+
+  _confirmSeedPhrase (event) {
+    event.preventDefault();
+
+    this.state.clock = 1;
+
+    let steps = this.querySelector('maki-steps');
+    let element = document.querySelector('.maki-step[data-step="1"]');
+    let content = element.querySelector('.content');
+
+    content.innerHTML = `<code>${this.wallet.seed}</code>
+      <button class="ui fluid button">Confirm</button>`;
+
+    steps.innerHTML = steps._getInnerHTML();
+  }
+
+  async _publishIdentityAndCommitWallet (event) {
+    event.preventDefault();
+
+    $('.ui.modal').addClass('loading');
+
+    let modal = document.querySelector('maki-modal');
+    let account = this.wallet._getAccountByIndex(0);
+    let identity = await this._publishIdentity(event);
+    let wallet = await window.app._registerWallet({ account });
+
+
+    modal._closeModal();
+  }
+
+  async _publishIdentity (event) {
+    event.preventDefault();
+
+    let modal = document.querySelector('maki-modal');
+    let account = this.wallet._getAccountByIndex(0);
+    let identity = null;
+
+    try {
+      let data = { id: account.address, address: account.address };
+      let actor = await window.app._registerActor(data);
+      let link = await window.app._POST('/identities', data);
+      identity = Object.assign({
+        link: link
+      }, data);
+
+      window.app._setIdentity(data);
+    } catch (E) {
+      console.error('Could not create identity:', E);
+    }
+
+    return identity;
+  }
+
+  connectedCallback () {
+    super.connectedCallback();
+    console.log('wallet creator attached!');
+
+    window.app.circuit._registerMethod('_submitFormWithData', this._submitFormWithData.bind(this));
+    window.app.circuit._registerMethod('_advanceToKeyGeneration', this._advanceToKeyGeneration.bind(this));
+    window.app.circuit._registerMethod('_advanceToKeyRestoration', this._advanceToKeyRestoration.bind(this));
+    window.app.circuit._registerMethod('_loadConfirmedPanel', this._loadConfirmedPanel.bind(this));
+    window.app.circuit._registerMethod('_loadGeneratorPanel', this._loadGeneratorPanel.bind(this));
+    window.app.circuit._registerMethod('_loadSuccessPanel', this._loadSuccessPanel.bind(this));
+    window.app.circuit._registerMethod('_loadStepTwo', this._loadStepTwo.bind(this));
+    window.app.circuit._registerMethod('_confirmSeedPhrase', this._confirmSeedPhrase.bind(this));
+    window.app.circuit._registerMethod('_advanceToLabeling', this._advanceToLabeling.bind(this));
+    window.app.circuit._registerMethod('_publishIdentity', this._publishIdentity.bind(this));
+    window.app.circuit._registerMethod('_publishIdentityAndCommitWallet', this._publishIdentityAndCommitWallet.bind(this));
+
+    let steps = this.querySelector('maki-steps');
+    let progress = this.querySelector('maki-progress');
+
+    console.log('FOUND STEPS:', steps);
+    console.log('progress:', progress);
+
+    steps.settings.steps = [
+      {
+        active: true,
+        icon: 'lock',
+        title: `Step 1: Insert Key`,
+        description: 'Generate or restore from memory?',
+        content: `<h4>Insert Key</h4>
+          <div class="ui two buttons">
+            <div class="ui blue left labeled icon button" data-action="_advanceToKeyRestoration"><i class="brain icon"></i>Restore from Memory</div>
+            <div class="or">or</div>
+            <div class="ui green right labeled icon button" data-action="_advanceToKeyGeneration">Generate New Key<i class="right chevron icon"></i></div>
+          </div>`
+      },
+      {
+        title: `Step 2: Verify`,
+        icon: 'eye',
+        description: 'Inspect the key.',
+        content: '<code data-bind="/seed">key to verify</code>'
+      },
+      {
+        title: `Step 3: Set Name`,
+        icon: 'settings',
+        description: 'Give it a name!',
+        content: `<h4>Label This Wallet</h4>
+        <div>
+          <p>Set a local name.</p>
+          <form class="ui form">
+            <div class="field">
+              <label for="name">Name</label>
+              <input type="text" name="name" placeholder="Label for this wallet (local only)" class="required input" /><button data-action="_publishIdentityAndCommitWallet" class="ui fluid right labeled green icon button">Save & Open <i class="icon right chevron"></i></button>
+            </div>
+          </form>
+        </div>`
+      }
+    ];
+
+    steps.innerHTML = steps._getInnerHTML();
+  }
+
+  _getInnerHTML () {
+    return `<form class="ui fluid form" action="/wallets" method="POST" data-action="_submitFormWithData">
+      <maki-steps id="${this.settings.handle}-steps"></maki-steps>
+    </form>`;
+  }
+}
+
+module.exports = WalletCreator;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/fonts/OpenSans-Bold-webfont.eot b/docs/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 00000000..5d20d916 Binary files /dev/null and b/docs/fonts/OpenSans-Bold-webfont.eot differ diff --git a/docs/fonts/OpenSans-Bold-webfont.svg b/docs/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 00000000..3ed7be4b --- /dev/null +++ b/docs/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Bold-webfont.woff b/docs/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 00000000..1205787b Binary files /dev/null and b/docs/fonts/OpenSans-Bold-webfont.woff differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.eot b/docs/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 00000000..1f639a15 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.svg b/docs/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 00000000..6a2607b9 --- /dev/null +++ b/docs/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.woff b/docs/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 00000000..ed760c06 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Italic-webfont.eot b/docs/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 00000000..0c8a0ae0 Binary files /dev/null and b/docs/fonts/OpenSans-Italic-webfont.eot differ diff --git a/docs/fonts/OpenSans-Italic-webfont.svg b/docs/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 00000000..e1075dcc --- /dev/null +++ b/docs/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Italic-webfont.woff b/docs/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 00000000..ff652e64 Binary files /dev/null and b/docs/fonts/OpenSans-Italic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Light-webfont.eot b/docs/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 00000000..14868406 Binary files /dev/null and b/docs/fonts/OpenSans-Light-webfont.eot differ diff --git a/docs/fonts/OpenSans-Light-webfont.svg b/docs/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 00000000..11a472ca --- /dev/null +++ b/docs/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Light-webfont.woff b/docs/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 00000000..e7860748 Binary files /dev/null and b/docs/fonts/OpenSans-Light-webfont.woff differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.eot b/docs/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 00000000..8f445929 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.svg b/docs/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 00000000..431d7e35 --- /dev/null +++ b/docs/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-LightItalic-webfont.woff b/docs/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 00000000..43e8b9e6 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Regular-webfont.eot b/docs/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 00000000..6bbc3cf5 Binary files /dev/null and b/docs/fonts/OpenSans-Regular-webfont.eot differ diff --git a/docs/fonts/OpenSans-Regular-webfont.svg b/docs/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 00000000..25a39523 --- /dev/null +++ b/docs/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Regular-webfont.woff b/docs/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 00000000..e231183d Binary files /dev/null and b/docs/fonts/OpenSans-Regular-webfont.woff differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..71fa8e76 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,95 @@ + + + + + @fabric/http · Docs + + + + + + + +
+

@fabric/http

+ + + + + + + +

+ + + + + + + + + + + + + + + +
+

@fabric/http

+

Project Status +Build Status +Coverage Status +GitHub contributors +Community

+

Fabric module for serving the legacy web.

+

Quick Start

+

Building applications with @fabric/http is easy.

+
mkdir myapp && cd myapp
+npm install @fabric/http
+
+

app.js

+
'use strict';
+
+const SPA = require('@fabric/http/types/spa');
+
+async function main () {
+  let spa = new SPA(
+    name: 'Example App',
+    synopsis: 'Simple demonstration of a single-page app.',
+    resources: {
+      'Todo': {
+        description: 'A to-do list item.'
+      }
+    }
+  );
+
+  await spa.start();
+}
+
+main();
+
+

Run node app.js to start the app, or webpack app.js -o assets/app.min.js to +build a browser version.

+

Advanced: @maki/roller

+

Maki, making beautiful apps a breeze

+

Try maki roll examples in this repo for a mind-blowing experience.

+
+ + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/docs/scripts/linenumber.js b/docs/scripts/linenumber.js new file mode 100644 index 00000000..8d52f7ea --- /dev/null +++ b/docs/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/docs/scripts/prettify/Apache-License-2.0.txt b/docs/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/docs/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/scripts/prettify/lang-css.js b/docs/scripts/prettify/lang-css.js new file mode 100644 index 00000000..041e1f59 --- /dev/null +++ b/docs/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/docs/scripts/prettify/prettify.js b/docs/scripts/prettify/prettify.js new file mode 100644 index 00000000..eef5ad7e --- /dev/null +++ b/docs/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p + + + + Source: settings/deprecations.js · Docs + + + + + + + +
+

Source: settings/deprecations.js

+ + + + + +
+
+
'use strict';
+
+/**
+ * Deprecated 2021-10-16.
+ * @deprecated
+ */
+class Stash {}
+
+module.exports = {
+  Stash
+};
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/styles/jsdoc-default.css b/docs/styles/jsdoc-default.css new file mode 100644 index 00000000..7d1729dc --- /dev/null +++ b/docs/styles/jsdoc-default.css @@ -0,0 +1,358 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + +html +{ + overflow: auto; + background-color: #fff; + font-size: 14px; +} + +body +{ + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; +} + +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +header +{ + display: block; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0; +} + +#main { + float: left; + width: 70%; +} + +article dl { + margin-bottom: 40px; +} + +article img { + max-width: 100%; +} + +section +{ + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; +} + +.variation { + display: none; +} + +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +nav +{ + display: block; + float: right; + margin-top: 28px; + width: 30%; + box-sizing: border-box; + border-left: 1px solid #ccc; + padding-left: 16px; +} + +nav ul { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; +} + +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; +} + +nav h3 { + margin-top: 12px; +} + +nav li { + margin-top: 6px; +} + +footer { + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; +} + +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + +h1 +{ + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; +} + +h2, h3.subsection-title +{ + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; +} + +h3 +{ + font-size: 24px; + letter-spacing: -0.5px; + margin-bottom: 12px; +} + +h4 +{ + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; +} + +h5, .container-overview .subsection-title +{ + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 +{ + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +table +{ + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +td, th +{ + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; +} + +thead tr +{ + background-color: #ddd; + font-weight: bold; +} + +th { border-right: 1px solid #aaa; } +tr > th:last-child { border-right: 1px solid #ddd; } + +.ancestors, .attribs { color: #999; } +.ancestors a, .attribs a +{ + color: #999 !important; + text-decoration: none; +} + +.clear +{ + clear: both; +} + +.important +{ + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; +} + +.source +{ + border: 1px solid #ddd; + width: 80%; + overflow: auto; +} + +.prettyprint.source { + width: inherit; +} + +.source code +{ + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4D4E53; +} + +.prettyprint code span.line +{ + display: inline-block; +} + +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td.description > p:first-child, +.props td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, +.props td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + +.disabled { + color: #454545; +} diff --git a/docs/styles/prettify-jsdoc.css b/docs/styles/prettify-jsdoc.css new file mode 100644 index 00000000..5a2526e3 --- /dev/null +++ b/docs/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/docs/styles/prettify-tomorrow.css b/docs/styles/prettify-tomorrow.css new file mode 100644 index 00000000..b6f92a78 --- /dev/null +++ b/docs/styles/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/docs/types_app.js.html b/docs/types_app.js.html new file mode 100644 index 00000000..d6f3bb57 --- /dev/null +++ b/docs/types_app.js.html @@ -0,0 +1,582 @@ + + + + + Source: types/app.js · Docs + + + + + + + +
+

Source: types/app.js

+ + + + + +
+
+
'use strict';
+
+const {
+  HTTP_SERVER_PORT,
+  BROWSER_TARGET
+} = require('../constants');
+
+const page = require('page');
+const crypto = require('crypto');
+const pluralize = require('pluralize');
+const beautify = require('js-beautify');
+// const d3 = require('d3');
+
+const Fabric = require('@fabric/core');
+// const Stash = require('@fabric/core/types/stash');
+
+// Internal Types
+const Router = require('./router');
+const Browser = require('./browser');
+const Resource = require('./resource');
+const Identity = require('./identity');
+// const Wallet = require('./wallet');
+const Component = require('./component');
+
+// TODO: move component imports to components/ or scripts/
+const Introduction = require('../components/introduction');
+const ResourceList = require('../components/resource-list');
+const Menu = require('../components/menu');
+
+/**
+ * Applications can be deployed to the legacy web using {@link App}, a powerful
+ * template for building modern web applications.
+ * @extends Component
+ */
+class App extends Component {
+  /**
+   * Create a {@link Web} application.
+   * @param  {Object} [settings={}] Application settings.
+   * @param  {Circuit} [settings.circuit] Instance of an existing {@link Circuit}.
+   * @param  {Object} [settings.resources] Map of {@link Resource} classes.
+   * @return {App}               Instance of the application.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'creating new APP with:', settings);
+
+    // settings
+    this.settings = Object.assign({
+      name: '@fabric/http',
+      synopsis: 'HTTP, WebSockets, WebRTC, and more.',
+      controls: false,
+      language: 'en',
+      namespace: 'maki',
+      components: {
+        index: 'maki-introduction'
+      },
+      identities: {},
+      resources: {},
+      seeds: [
+        'hub.fabric.pub:9999',
+        'chat.roleplaygateway.com:9999',
+        'hub.roleplaygateway.com:9999'
+      ],
+      path: './stores/fabric-app',
+      peers: {},
+      port: HTTP_SERVER_PORT
+    }, settings);
+
+    this.menu = new Menu();
+    this.types = new ResourceList();
+    this.router = new Router(this.settings);
+    // this.wallet = new Wallet();
+    this.browser = new Browser(Object.assign({}, this.settings, {
+      component: 'fabric-welcome',
+      path: './stores/fabric-browser'
+    }));
+
+    // TODO: define these elsewhere!
+    // These are internal components, should be on prototype.
+    /* this.state = {
+      methods: {},
+      channels: {},
+      components: {},
+      resources: {},
+      messages: {}
+    }; */
+    this._state = {};
+
+    this.modal = null;
+    this.target = null;
+    this.identity = null;
+    this.history = [];
+
+    this.stash = new Fabric.Store(Object.assign({}, this.settings, {
+      path: 'stores/stash'
+    }));
+
+    this.stash.on('patches', function (patches) {
+      console.log('[HTTP:APP]', 'heard patches!', patches);
+    });
+
+    this.secrets = new Fabric.Store({
+      path: 'stores/secrets'
+    });
+
+    this.wallets = new Fabric.Collection({
+      name: 'Wallet',
+      listeners: {
+        'changes': this._handleWalletChanges.bind(this)
+      }
+    });
+
+    this.circuit = this.settings.circuit || new Fabric.Circuit();
+
+    // Add index menu item
+    // this.menu._addItem({ name: this.settings.name, path: '/', brand: true });
+    this.router._addRoute('/', this.settings.components.index);
+    this.handler('/', this._handleNavigation.bind(this));
+
+    // properties
+    this.identities = {};
+    this.peers = {};
+    this.components = { ResourceList };
+    this.resources = {};
+    this.elements = {};
+    this.routes = [];
+
+    for (let name in this.settings.resources) {
+      let definition = this.settings.resources[name];
+      let plural = pluralize(name);
+
+      this.define(name, definition);
+
+      // this.router._addFlat(`/${plural.toLowerCase()}`, definition);
+      this.router._addRoute(`/${plural.toLowerCase()}/:id`, definition.components.view);
+      this.router._addRoute(`/${plural.toLowerCase()}`, definition.components.list);
+
+      // add menu items & handler
+      if (!definition.hidden) {
+        this.menu._addItem({ name: plural, path: `/${plural.toLowerCase()}`, icon: definition.icon });
+      }
+
+      // page.js router...
+      this.handler(`/${plural.toLowerCase()}`, this._handleNavigation.bind(this));
+      this.handler(`/${plural.toLowerCase()}/:id`, this._handleNavigation.bind(this));
+    }
+
+    // Some default Components, available to all
+    // TODO: expose this as the Library, namespace `alexandria`
+    this.define('Introduction', Introduction);
+    this._defineElement('maki-introduction', Introduction);
+
+    this.route = '/';
+    this.status = 'ready';
+
+    return this;
+  }
+
+  get handler () {
+    return page;
+  }
+
+  get page () {
+    // TODO: return current page
+    return new Resource({
+      name: 'BlankPage'
+    });
+  }
+
+  get state () {
+    return this._state;
+  }
+
+  set state (value) {
+    return this._state = value;
+  }
+
+  get version () {
+    return this.settings.version;
+  }
+
+  connectedCallback () {
+    super.connectedCallback();
+  }
+
+  define (name, definition) {
+    let route = this.router.define(name, definition);
+    if (this.settings.verbosity >= 4) console.log('[WEB:APP]', 'Defining', name, route);
+    this.types.state[name] = definition;
+    this.resources[name] = definition;
+    this._state[pluralize(name).toLowerCase()] = definition.data || {};
+  }
+
+  dispatch (name, data = {}) {
+    console.log('[WEB:APP]', 'dispatching:', name, data);
+    this.emit('call', {
+      type: name,
+      data: data
+    });
+  }
+
+  _route (path) {
+    this.route = path;
+  }
+
+  _addRoute (definition) {
+    this.routes.push(definition);
+  }
+
+  _addHandler (name, method) {
+    this.circuit.methods[name] = method;
+  }
+
+  _registerMethod (name, method) {
+    return this._addHandler(name, method);
+  }
+
+  _checkIntegrity (data, integrity) {
+    let parts = integrity.split('-');
+    let hash = crypto.createHash('sha256').update(data).digest('base64');
+    return hash === parts[1];
+  }
+
+  _defineElement (handle, definition) {
+    this.components[handle] = definition;
+
+    // TODO: custom elements polyfill
+    if (typeof customElements !== 'undefined') {
+      try {
+        customElements.define(handle, definition);
+      } catch (E) {
+        console.error('[MAKI:APP]', 'Could not define Custom Element:', E, handle, definition);
+      }
+    }
+  }
+
+  _setIdentity (identity) {
+    this.identity = identity;
+  }
+
+  _verifyElements () {
+    let elements = document.querySelectorAll('*[integrity]');
+    for (let i = 0; i < elements.length; i++) {
+      let element = elements[i];
+      let integrity = element.getAttribute('integrity');
+      let valid = this._checkIntegrity(element.innerHTML, integrity);
+      console.log('[MAKI:APP]', 'checking integrity:', 'element:', element);
+      console.log('[MAKI:APP]', 'checking integrity:', 'innerHTML:', element.innerHTML);
+      console.log('[MAKI:APP]', 'checking integrity:', 'valid', valid);
+    }
+  }
+
+  _flush () {
+    while (this.target.firstChild) {
+      this.target.removeChild(this.target.firstChild);
+    }
+  }
+
+  _appendElement (element) {
+    this.target.appendChild(element);
+    element.innerHTML = element._getInnerHTML();
+    return this;
+  }
+
+  async _loadIndex (ctx) {
+    let Index = this.components[this.settings.components.index];
+    if (!Index) throw new Error(`Could not find component: ${this.settings.components.index}`);
+    let resource = new Index(this.state);
+    let content = resource.render();
+    this._setTitle(resource.name);
+    this._renderContent(content);
+  }
+
+  /**
+   * Trigger navigation.
+   * @param  {Context}   ctx  Navigating context.
+   * @param  {Function} next Function called if no route found.
+   * @return {Promise}       Resolved on routing complete.
+   */
+  async _handleNavigation (ctx, next) {
+    console.log('[MAKI:APP]', 'handling navigation intent:', ctx);
+
+    let self = this;
+    let address = await self.browser.route(ctx.path);
+    let sample = await self.browser.load(ctx.path);
+
+    console.log('[MAKI:APP]', 'final testing:', sample);
+
+    let element = document.createElement(address.route.component);
+
+    if (!element.state) element.state = {};
+    if (address) {
+      console.log('[MAKI:APP]', 'resolved address:', address);
+      console.log('[MAKI:APP]', 'appending element:', element);
+      console.log('[MAKI:APP]', 'self data:', self.state);
+
+      for (let name in self.state) {
+        element.state[name] = self.state[name];
+      }
+
+      /* self._GET(ctx.path).then(async function (x) {
+        console.log('GOT DATA:', x);
+        element._redraw(x);
+      }, function (e) {
+        console.error('WAT:', e);
+      }); */
+
+      self._setTitle(element.title);
+
+      self.browser._setAddress(ctx.path);
+      self.browser._setElement(element);
+
+      self.target = element;
+    }
+  }
+
+  async _handleWalletChanges (event) {
+    console.log('WALLET CHANGES:', event);
+  }
+
+  async _restoreIdentity () {
+    let identities = null;
+
+    try {
+      identities = await this.secrets._GET(`/identities`);
+    } catch (E) {
+      console.error('Could not load history:', E);
+    }
+
+    if (!identities || !identities.length) {
+      return this._generateIdentity();
+    }
+
+    return new Identity(identities[0]);
+  }
+
+  async _generateIdentity () {
+    let item = null;
+    let result = null;
+    let link = null;
+
+    // TODO: async generation
+    let key = new Fabric.Key();
+    let struct = {
+      name: prompt('What shall be your name?'),
+      address: key.address,
+      private: key.private.toString('hex'),
+      public: key.public
+    };
+
+    let existing = await this._getIdentityByName(struct.name);
+    console.log('existing check:', existing);
+
+    if (!existing) {
+      try {
+        let id = await this.secrets._POST(`/identities`, struct);
+        link = id;
+      } catch (E) {
+        console.error('broken:', E);
+      }
+    } else {
+      link = existing;
+    }
+
+    // TODO: verify login here
+    // TODO: encrypt local storage with password
+
+    this.identities[struct.address] = struct;
+    this.identity = struct;
+
+    // TODO: remove public key from character, use only address (or direct hash)
+    return {
+      address: struct.address,
+      public: struct.public
+    };
+  }
+
+  async _getIdentityByName (name) {
+    let candidates = Object.keys(this.identities).map((x) => {
+      return this.identities[x];
+    }).filter((x) => {
+      return x.name === name;
+    });
+
+    console.log('candidates:', candidates);
+    return candidates[0] || null;
+  }
+
+  async _handleCall (event) {
+    console.log('[WEB:APP]', 'call received:', event);
+    if (this.methods && this.methods[event.type] instanceof Function) {
+      return this.methods[event.type](event.data || {});
+    } else {
+      return false;
+    }
+  }
+
+  async _registerWallet (input) {
+    let wallet = await this.wallets.create(input);
+    console.log('[MAKI:APP]', 'wallet registered:', wallet);
+    return wallet;
+  }
+
+  _setTitle (title) {
+    this.title = `${title} &middot; ${this.settings.name}`;
+    document.querySelector('title').innerHTML = this.title;
+  }
+
+  _refresh () {
+    let resource = new Fabric.Resource();
+    this.target.innerHTML = this._loadHTML(resource.render());
+    return this;
+  }
+
+  _renderContent (html) {
+    // TODO: enable multi-view composition?
+    // NOTE: this means to iterate over all bound targets, instead of the first one...
+    if (!this.target) this.target = document.querySelector(BROWSER_TARGET);
+    if (!this.target) return console.log('COULD NOT ACQUIRE TARGET:', document);
+    this.target.innerHTML = html;
+    return this.target;
+  }
+
+  // TODO: write Purity-based version, use in production
+  _loadHTML (html) {
+    let blob = JSON.stringify(this.state, null, '  ');
+    let verification = crypto.createHash('sha256').update(blob).digest('hex');
+    let content = ``;
+
+    // Begin Content Body
+    content += `<fabric-application route="${this.route}" integrity="${this.integrity}" class="window">`;
+
+    if (this.settings.header) {
+      content += `<header>
+        <fabric-grid-row id="details" class="ui grid">
+          <div class="wide column">
+            <div class="ui inverted header">
+              <a href="/"><img src="/images/brand.png" class="ui small image" /></a>
+              <h1 class="content"><a href="/">${this.settings.name}</a></h1>
+              <p class="sub header">${this.settings.synopsis}</p>
+            </div>
+          </div>
+        </fabric-grid-row>
+      </header>`;
+    }
+
+    // Main Browser Viewport
+    content += `<fabric-grid-row id="browser">${this.browser.render()}</fabric-grid-row>`;
+
+    if (this.settings.footer) {
+      content += `<footer>
+        <fabric-debug></fabric-debug>
+      </footer>`;
+    }
+
+    content += `<div id="ephemeral-content"></div>
+      <!-- TODO: rollup semantic into build process -->
+      <!-- <script type="text/javascript" src="/scripts/semantic.min.js"></script> -->
+      <!-- <script type="text/javascript" src="/scripts/index.min.js"></script> -->
+      <!-- <script type="text/javascript" src="/scripts/rpg.min.js"></script> -->
+      <script type="text/javascript" src="/scripts/app.js"></script>
+    </fabric-application>`;
+    return content;
+  }
+
+  async _toggleFullscreen () {
+    // TODO: implement fullscreen from RPG
+  }
+
+  /**
+   * Generate the rendered HTML output of the application's user interface.
+   * @return {String} HTML string.
+   */
+  render () {
+    let page = this.page.render();
+    let html = this._loadHTML(page);
+    let pretty = beautify.html(html, {
+      indent_size: 2,
+      extra_liners: []
+    });
+
+    return pretty;
+  }
+
+  /**
+   * Launches any necessary processes and notifies the user on ready.
+   * @return {Promise} Resolves on completion.
+   */
+  async start () {
+    if (typeof window !== 'undefined' && window.app) await window.app.stop();
+
+    if (this.store) {
+      try {
+        await this.store.start();
+      } catch (E) {
+        console.error('Could not open store:', E);
+      }
+    }
+
+    await this.define('FabricMenu', Menu);
+    await this.define('ResourceList', ResourceList);
+
+    for (const name in this.resources) {
+      const definition = this.resources[name];
+      if (definition.data) {
+        // TODO: move this to `types/resource.js`
+        if (!definition.names) {
+          definition.names = {
+            singular: name,
+            plural: pluralize(name)
+          };
+        }
+        await this.set(`/${definition.names.plural.toLowerCase()}`, definition.data);
+      }
+    }
+
+    this.on('call', this._handleCall.bind(this));
+
+    // await this.fabric.start();
+    try {
+      await this.circuit.start();
+      await this.browser.start();
+      await this.router.start();
+    } catch (E) {
+      console.error('Could not start, Exception:', E);
+    }
+
+    return true;
+  }
+
+  async stop () {
+    await this.router.stop();
+    await this.browser.stop();
+    await this.circuit.stop();
+    if (this.store) await this.store.stop();
+
+    return true;
+  }
+}
+
+module.exports = App;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_bridge.js.html b/docs/types_bridge.js.html new file mode 100644 index 00000000..9335e382 --- /dev/null +++ b/docs/types_bridge.js.html @@ -0,0 +1,226 @@ + + + + + Source: types/bridge.js · Docs + + + + + + + +
+

Source: types/bridge.js

+ + + + + +
+
+
'use strict';
+
+// TODO: audit this library
+const WebSocket = require('isomorphic-ws');
+const URL = require('url');
+
+// Fabric Types
+const Service = require('@fabric/core/types/service');
+const Message = require('@fabric/core/types/message');
+
+// Internal Types
+const Remote = require('./remote');
+
+class Bridge extends Service {
+  constructor (settings = {}) {
+    super(settings);
+
+    // Assign settings
+    this.settings = Object.assign({
+      authority: 'localhost',
+      port: 9999,
+      path: './stores/bridge',
+      reconnect: true
+    }, this.settings, settings);
+
+    // Raw socket tracking
+    this.websocket = null;
+
+    // Track bound functions
+    this._boundFunctions = {};
+    this._remotes = [];
+
+    return this;
+  }
+
+  async connect () {
+    if (this.settings.verbosity >= 3) console.log('[WEB:BRIDGE]', 'Connecting...');
+    if (this.websocket) {
+      console.log('[WEB:BRIDGE]', 'Already connected!  Using existing socket.');
+      return this.websocket;
+    }
+
+    // TODO: document significance of `/` as the document
+    // Used for subscribing to all state paths for the host.
+    // TODO: secure
+    const protocol = (this.settings.secure) ? 'wss' : 'ws';
+    this.websocket = new WebSocket(`${protocol}://${this.settings.hostname}:${this.settings.port}/`);
+
+    this._boundFunctions['onopen'] = this._handleSuccessfulConnection.bind(this);
+    this._boundFunctions['onclose'] = this._handleConnectionClose.bind(this);
+    this._boundFunctions['onmessage'] = this._handleHostMessage.bind(this);
+    this._boundFunctions['onerror'] = this._handleHostError.bind(this);
+
+    this.websocket.onopen = this._boundFunctions['onopen'];
+    this.websocket.onclose = this._boundFunctions['onclose'];
+    this.websocket.onmessage = this._boundFunctions['onmessage'];
+    this.websocket.onerror = this._boundFunctions['onerror'];
+
+    return this;
+  }
+ 
+  async start () {
+    // TODO: reconsider inheriting from Service
+    // await super.start();
+    if (this.settings && this.settings.hubs && this.settings.hubs.length) {
+      if (this.settings.verbosity >= 4) console.log('[HTTP:BRIDGE]', 'Connecting to Hubs:', this.settings.hubs);
+      for (let i = 0; i < this.settings.hubs.length; i++) {
+        try {
+          let hub = this.settings.hubs[i];
+          let parts = URL.parse(hub);
+          let remote = new Remote({
+            authority: parts.hostname,
+            port: parts.port,
+            secure: (parts.protocol === 'https:') ? true : false
+          });
+
+          let options = await remote._OPTIONS('/');
+          if (this.settings.verbosity >= 4) console.log('[HTTP:BRIDGE]', 'Got options from Remote:', options);
+
+          this._remotes.push(remote);
+        } catch (exception) {
+          console.error('Could not connect to remote:', exception);
+        }
+      } 
+    }
+ 
+    await this.connect();
+  }
+
+  async stop () {
+    this.settings.reconnect = false;
+    await super.stop();
+  }
+
+  async send (msg) {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:BRIDGE]', 'Sending input to WebSocket:', typeof msg, msg);
+    this.websocket.send(msg);
+  }
+
+  /**
+   * Request a Document from our Peers.
+   * @param {Object} request Request to send. 
+   * @param {String} request.path Document path.
+   */
+  async query (request = { path: '/' }) {
+    if (typeof request === 'string') request = { path: request };
+    if (!request.path) throw new Error('Request must have "path" property.');
+
+    let results = [];
+
+    // Remotes as first promises
+    const promises = this._remotes.map((remote) => {
+      return remote._GET(request.path);
+    });
+
+    // Remotes first..
+    try {
+      results = await Promise.all(promises);
+    } catch (exception) {
+      console.error('Could not query:', request, exception);
+    }
+
+    console.log('got results:', results);
+
+    return results;
+  }
+
+  async _handleSuccessfulConnection () {
+    if (this.settings.verbosity >= 2) console.log('[HTTP:BRIDGE]', 'Successful connection...');
+    const now = Date.now();
+    const message = Message.fromVector(['Ping', now.toString()]);
+    const ping = JSON.stringify(message.toObject());
+    console.log('ping:', typeof ping, ping);
+    // if (this.settings.verbosity >= 5) console.log('[HTTP:BRIDGE]', 'Message To Send:', typeof message, message, message.asRaw());
+    this.websocket.send(message.asRaw());
+    this.emit('connected');
+  }
+
+  async _handleHostMessage (msg) {
+    // if (this.settings.verbosity >= 4) console.log('[HTTP:BRIDGE]', 'Host message:', msg);
+    // if (this.settings.verbosity >= 2) console.log('[HTTP:BRIDGE]', 'Host message data:', typeof msg.data, msg.data);
+    let message = null;
+
+    if (!msg.type && msg['@type']) msg.type = msg['@type'];
+    if (!msg.data && msg['@data']) msg.data = msg['@data'];
+
+    try {
+      message = JSON.parse(msg.data);
+    } catch (exception) {
+      if (this.settings.verbosity >= 3) console.error('[HTTP:BRIDGE]', 'Could not parse message data as JSON:', msg.data);
+    }
+
+    // TODO: binary parsing
+    if (!message) {
+      try {
+        message = Message.fromRaw(msg.data);
+      } catch (exception) {
+        if (this.settings.verbosity >= 3) console.error('[HTTP:BRIDGE]', 'Could not parse message data as binary:', msg.data, exception);
+      }
+
+    }
+
+    if (!message) throw new Error(`Input could not be processed: ${typeof msg} ${msg}`);
+    this.emit('message', message);
+  }
+
+  async _handleConnectionClose () {
+    if (this.settings.verbosity >= 2) console.log('[HTTP:BRIDGE]', 'Connection closed.');
+    const bridge = this;
+
+    bridge.websocket = null;
+    bridge._retryTime = 0;
+
+    if (bridge.settings.reconnect) {
+      bridge._retryTimeout = setTimeout(function () {
+        bridge.connect();
+      }, 1000);
+    }
+  }
+
+  async _handleHostError (err) {
+    this.websocket.onerror = this._handleHostError.bind(this);
+  }
+}
+
+module.exports = Bridge;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_compiler.js.html b/docs/types_compiler.js.html new file mode 100644 index 00000000..9a7a2db3 --- /dev/null +++ b/docs/types_compiler.js.html @@ -0,0 +1,95 @@ + + + + + Source: types/compiler.js · Docs + + + + + + + +
+

Source: types/compiler.js

+ + + + + +
+
+
'use strict';
+
+const fs = require('fs');
+const crypto = require('crypto');
+const beautify = require('js-beautify').html;
+
+/**
+ * Builder for {@link Fabric}-based applications.
+ */
+class Compiler {
+  /**
+   * 
+   * @param {Object} [settings] Map of settings.
+   * @param {Mixed} [settings.document] Document to use.
+   */
+  constructor (settings = {}) {
+    this.settings = Object.assign({
+      document: null
+    }, settings);
+
+    return this;
+  }
+
+  /**
+   * Build a {@link String} representing the HTML-encoded Document.
+   * @param {Mixed} input Input data to use for local rendering.
+   * @returns {String}
+   */
+  compile (data) {
+    return this.settings.document.render();
+  }
+
+  compileTo (target) {
+    console.log('[MAKI:ROLLER]', `Compiling SPA to ${target}...`);
+
+    let html = this.compile();
+    let clean = beautify(html, {
+      indent_size: 2,
+      extra_liners: []
+    });
+    let hash = crypto.createHash('sha256').update(clean).digest('hex');
+
+    try {
+      fs.writeFileSync(target, clean);
+    } catch (E) {
+      console.error('[MAKI:ROLLER]', 'Could not write SPA:', E);
+    }
+
+    console.log('[MAKI:ROLLER]', `${clean.length} bytes written to ${target} with sha256(H) = ${hash} ~`);
+
+    return true;
+  }
+}
+
+module.exports = Compiler;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_component.js.html b/docs/types_component.js.html new file mode 100644 index 00000000..0c24d39a --- /dev/null +++ b/docs/types_component.js.html @@ -0,0 +1,209 @@ + + + + + Source: types/component.js · Docs + + + + + + + +
+

Source: types/component.js

+ + + + + +
+
+
// Defaults
+const state = require('../settings/state');
+
+const crypto = require('crypto');
+const Service = require('@fabric/core/types/service');
+// const Fabric = require('@fabric/core');
+
+/**
+ * Generic component.
+ */
+class FabricComponent extends Service {
+  /**
+   * Create a component.
+   * @param  {Object} [settings={}] Settings for the component.
+   * @return {Component}            Fully-configured component.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      handle: 'fabric-component',
+      path: '/'
+    }, settings);
+
+    this.state = settings;
+    this.element = null;
+
+    // Healthy Cleanup
+    this._boundFunctions = {};
+    this._listeners = {};
+
+    return this;
+  }
+
+  get path () {
+    return this.settings.path;
+  }
+
+  get data () {
+    return JSON.stringify(this.state || {});
+  }
+
+  get hash () {
+    // TODO: cache and skip
+    return crypto.createHash('sha256').update(this.render()).digest('hex');
+  }
+
+  get integrity () {
+    // TODO: cache and skip
+    let hash = crypto.createHash('sha256').update(this.data).digest('base64');
+    return `sha256-${hash}`;
+  }
+
+  attributeChangedCallback (name, old, value) {
+    console.log('[MAKI:COMPONENT]', 'Component notified a change:', name, 'changed to:', value, `(was ${old})`);
+  }
+
+  connectedCallback () {
+    console.log('[MAKI:COMPONENT]', 'Component added to page:', this);
+    let html = this._getInnerHTML(this.state);
+
+    this.setAttribute('data-integrity', Fabric.sha256(html));
+    this.setAttribute('data-fingerprint', this.fingerprint);
+    // this.innerHTML = html;
+    this.innerHTML = html + '';
+
+    /* let binding = this.getAttribute('data-bind');
+
+    if (binding) {
+      // TODO: use Fabric.Remote
+      fetch(`fabric:${binding}`)
+        .then((response) => response.text())
+        .then((responseText) => {
+          this.render(JSON.parse(responseText));
+        })
+        .catch((error) => {
+          console.error(error);
+        });
+    } */
+
+    // Reflect.construct(HTMLElement, [], this.constructor);
+    return this;
+  }
+
+  disconnectedCallback () {
+    console.log('[MAKI:COMPONENT]', 'Component removed from page:', this);
+
+    for (let name in this._boundFunctions) {
+      this.removeEventListener('message', this._boundFunctions[name]);
+    }
+  }
+
+  _bind (element) {
+    if (this.element) {
+      // TODO: unbind old handlers
+    }
+
+    this.element = element;
+    this.element.addEventListener('refresh', this.refresh.bind(this));
+    this.element.addEventListener('message', this._handleComponentMessage.bind(this));
+
+    this.render();
+
+    return this;
+  }
+
+  _handleComponentMessage (msg) {
+    console.log('[FABRIC:COMPONENT]', 'Element emitted message:', msg);
+  }
+
+  _toElement () {
+    let element = document.createElement(this.settings.handle);
+    element.innerHTML = this._getInnerHTML(this.state);
+    return element;
+  }
+
+  _loadHTML (content) {
+    let hash = crypto.createHash('sha256').update(content).digest('base64');
+    return `<${this.settings.handle} integrity="sha256-${hash}">${content}</${this.settings.handle}>`;
+  }
+
+  _getInnerHTML (state) {
+    return `<code class="unconfigured" data-name="_getInnerHTML">${JSON.stringify(state || this.state)}</code>`;
+  }
+
+  _renderState (state) {
+    // TODO: render Template here
+    // cc: @melnx @lel @lllllll:fabric.pub
+    let content = this._getInnerHTML(state);
+    return this._loadHTML(content);
+  }
+
+  refresh () {
+    if (this.element) {
+      this.element.innerHTML = this._getInnerHTML(this.state);
+    }
+  }
+
+  register () {
+    customElements.define(this.settings.handle, Component, { extends: 'div' });
+  }
+
+  render () {
+    if (this.element) {
+      this.element.innerHTML = this._getInnerHTML();
+    }
+    return this._renderState(this.state);
+  }
+}
+
+export default FabricComponent;
+
+// TODO: debug why this can't be used on this parent class...
+// ```
+// TypeError: Class extends value #<Object> is not a constructor or null
+// Module.<anonymous>
+// src/components/FabricIdentityManager.js:19
+//   16 | import IdentityPicker from './IdentityPicker';
+//   17 | import SeedEntryForm from './SeedEntryForm';
+//   18 | 
+// > 19 | class FabricIdentityManager extends FabricComponent {
+//   20 |   constructor (props) {
+//   21 |     super(props);
+//   22 | 
+// ```
+// export default connect(FabricStateMapper)(FabricComponent);
+//
+// ...
+// End of @fabric/core/types/component
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_definition.js.html b/docs/types_definition.js.html new file mode 100644 index 00000000..dda203d6 --- /dev/null +++ b/docs/types_definition.js.html @@ -0,0 +1,65 @@ + + + + + Source: types/definition.js · Docs + + + + + + + +
+

Source: types/definition.js

+ + + + + +
+
+
'use strict';
+
+const pluralize = require('plural');
+
+/**
+ * @class Definition
+ * @type {Object}
+ * @property {String} name Human-friendly name for this type.
+ * @property {String} name Human-friendly plural name for this type.
+ * @property {Object} routes Path hint for retrieving an index.
+ * @property {String} routes.list Path hint for retrieving an index.
+ * @property {String} routes.view Path hint for retrieving a single entity.
+ */
+class Definition {
+  constructor (options = {}) {
+    this.name = options.name || 'Type';
+    this.plural = pluralize(this.name);
+    this.routes = {
+      'list': `/${this.plural.toLowerCase()}`,
+      'view': `/${this.plural.toLowerCase()}/:id`
+    };
+  }
+}
+
+module.exports = Definition;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_element.js.html b/docs/types_element.js.html new file mode 100644 index 00000000..8f34101b --- /dev/null +++ b/docs/types_element.js.html @@ -0,0 +1,60 @@ + + + + + Source: types/element.js · Docs + + + + + + + +
+

Source: types/element.js

+ + + + + +
+
+
'use strict';
+
+class HTMLCustomElement extends HTMLElement {
+  constructor (...$) {
+    const _ = super(...$);
+    _.init();
+    return _;
+  }
+
+  /**
+   * Initialize the element.  Use in place of constructor behavior.
+   */
+  init () {
+    if (this.settings && this.settings.verbosity >= 5) {
+      console.log('[FABRIC:ELEMENT]', 'Initializing...');
+    }
+  }
+}
+
+module.exports = HTMLCustomElement;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_hub.js.html b/docs/types_hub.js.html new file mode 100644 index 00000000..1c591f4f --- /dev/null +++ b/docs/types_hub.js.html @@ -0,0 +1,328 @@ + + + + + Source: types/hub.js · Docs + + + + + + + +
+

Source: types/hub.js

+ + + + + +
+
+
'use strict';
+
+const {
+  TICK_INTERVAL,
+  HTTP_SERVER_PORT,
+  SESSION_SEED
+} = require('../constants');
+
+const http = require('http');
+
+// TODO: remove express
+const express = require('express');
+const session = require('express-session');
+const parsers = require('body-parser');
+
+// WebRTC & WebSockets
+const WebSocket = require('ws');
+const PeerServer = require('peer').ExpressPeerServer;
+
+// Fabric Types
+const Machine = require('@fabric/core/types/machine');
+const Oracle = require('@fabric/core/types/oracle');
+const Server = require('../types/server');
+
+/**
+ * The {@link Hub} is a temporary class in the Fabric HTTP library
+ * which handles WebRTC and WebSocket connections, wrapping the core
+ * {@link Fabric} protocol for legacy web clients (including browsers).
+ * @extends Oracle
+ */
+class Hub extends Oracle {
+  /**
+   * Create an instance of the Hub.
+   * @param {Object} configuration Settings for the {@link Hub}.
+   */
+  constructor (configuration = {}) {
+    super(configuration);
+
+    this.config = Object.assign({
+      path: './stores/server',
+      port: HTTP_SERVER_PORT,
+      seed: SESSION_SEED
+    }, configuration);
+
+    this.connections = {};
+    this.machine = new Machine();
+
+    this.wss = null;
+    this.http = null;
+    this.express = express();
+    this.sessions = session({ secret: this.config.seed });
+    this.peer = new PeerServer(this.express, {
+      // path: '/services/peering'
+    });
+
+    this.server = new Server();
+    this.timer = setInterval(this._tick.bind(this), TICK_INTERVAL);
+
+    return this;
+  }
+
+  _tick () {
+    if (this.settings.verbosity >= 4) console.log('[FABRIC:HUB]', 'Tick started...');
+    const tick = this.machine.tick();
+    return {
+      '@type': 'Tick',
+      '@data': {
+        tick: tick
+      }
+    };
+  }
+
+  _handleRequest (req, res) {
+    res.writeHead(200, {
+      'Content-Type': 'application/json'
+    });
+    res.end(JSON.stringify(this.state));
+  }
+
+  _handleWebSocket (socket, request) {
+    // console.log('incoming WebSocket:', socket);
+
+    let buffer = Buffer.from(request.headers['sec-websocket-key'], 'base64');
+    let server = this;
+    let player = new Fabric.State({
+      connection: buffer.toString('hex'),
+      entropy: buffer.toString('hex')
+    });
+
+    socket.on('close', function () {
+      delete server.connections[player['@data'].connection];
+    });
+
+    // TODO: message handler on base class
+    socket.on('message', async function handler (msg) {
+      console.log('websocket incoming message:', msg);
+
+      socket.send(JSON.stringify({
+        '@type': 'Receipt',
+        '@actor': buffer.toString('hex'),
+        '@data': msg,
+        '@version': 1
+      }));
+
+      try {
+        let message = JSON.parse(msg);
+        let type = message['@type'];
+
+        switch (type) {
+          default:
+            console.log('[SERVER]', 'unhandled type:', type);
+            break;
+          case 'GET':
+            let answer = await server._GET(message['@data']['path']);
+            console.log('answer:', answer);
+            return answer;
+          case 'POST':
+            let link = await server._POST(message['@data']['path'], message['@data']['value']);
+            console.log('[SERVER]', 'posted link:', link);
+            break;
+          case 'PATCH':
+            let result = await server._PATCH(message['@data']['path'], message['@data']['value']);
+            console.log('[SERVER]', 'patched:', result);
+            break;
+        }
+
+        server._relayFrom(buffer.toString('hex'), msg);
+      } catch (E) {
+        console.error('could not parse message:', E);
+        console.log('you should disconnect from this peer:', buffer.toString('hex'));
+      }
+    });
+
+    socket.oracle = server.on('patches', function (patches) {
+      console.log('magic oracle patches:', patches);
+    });
+
+    server.connections[player['@data'].connection] = socket;
+    server.players[player['@data'].connection] = player;
+
+    socket.send(JSON.stringify({
+      '@type': 'State',
+      '@data': server.state,
+      '@version': 1
+    }));
+  }
+
+  _relayFrom (actor, msg) {
+    let peers = Object.keys(this.connections).filter(key => {
+      return key !== actor;
+    });
+
+    console.log(`relaying message from ${actor} to peers:`, peers);
+
+    for (let i = 0; i < peers.length; i++) {
+      try {
+        this.connections[peers[i]].send(msg);
+      } catch (E) {
+        console.error('Could not relay to peer:', E);
+      }
+    }
+  }
+
+  define (name, definition) {
+    super.define(name, definition);
+  }
+
+  trust (source) {
+    source.on('message', function (msg) {
+      console.log('[FABRIC:HUB]', 'trusted source:', source.constructor.name, 'sent message:', msg);
+    });
+  }
+
+  /**
+   * Start the {@link Hub} and listen for incoming connections.
+   */
+  async start () {
+    let server = this;
+
+    // configure router
+    server.express.use(express.static('assets'));
+    server.express.use(server.sessions);
+    server.express.use(parsers.urlencoded());
+    server.express.use(parsers.json());
+
+    // session manager
+    server.express.get('/sessions', async function (req, res) {
+      let sessions = await server._GET('/sessions');
+      res.send(sessions);
+    });
+
+    // login with POST /sessions
+    server.express.post('/sessions', async function (req, res) {
+      let result = await server._POST('/sessions', req.body);
+      req.session.link = result;
+      res.redirect(303, result);
+    });
+
+    // destroy session manually (instead of timeout)
+    server.express.delete('/sessions/:id', async function (req, res) {
+      let sessions = await server._GET('/sessions');
+      req.session.destroy();
+      res.send({
+        '@type': 'KnownSessions',
+        '@data': sessions
+      });
+    });
+
+    server.express.get('/entities/:hash', async function (req, res) {
+      let result = await server._GET(req.path);
+      return res.send(result);
+    });
+
+    // peer manager
+    server.express.post('/peers', async function (req, res) {
+      let proposal = req.body;
+      let peers = await server._GET('/peers');
+
+      if (!peers) peers = [];
+      if (!proposal.address) return res.send({ '@type': 'Error', '@data': { 'message': 'An address is required.' } });
+
+      // duplicate checking
+      // TODO: use Fabric implementation
+      let checklist = peers.map(x => x.address);
+      if (checklist.includes(proposal.address)) return res.redirect(303, `/peers/${proposal.address}`);
+
+      let result = await server._POST('/peers', proposal);
+      if (!result) return res.end(500, { '@type': 'Error', '@data': { 'message': 'Something went wrong saving.' } });
+
+      return res.redirect(303, result);
+    });
+
+    server.express.get('/peers', async function (req, res) {
+      let peers = await server._GET('/peers');
+      if (!peers) peers = [];
+      res.send(peers);
+    });
+
+    // player manager
+    server.express.post('/players', async function (req, res) {
+      let proposal = req.body;
+      let players = await server._GET('/players');
+
+      if (!players) players = [];
+      if (!proposal.address) return res.send({ '@type': 'Error', '@data': { 'message': 'An address is required.' } });
+
+      // duplicate checking
+      // TODO: use Fabric implementation
+      let checklist = players.map(x => x.address);
+      if (checklist.includes(proposal.address)) return res.redirect(303, `/players/${proposal.address}`);
+
+      let result = await server._POST('/players', proposal);
+      if (!result) return res.end(500, { '@type': 'Error', '@data': { 'message': 'Something went wrong saving.' } });
+
+      return res.redirect(303, result);
+    });
+
+    server.express.get('/players', async function (req, res) {
+      let players = await server._GET('/players');
+      if (!players) players = [];
+      return res.send(players);
+    });
+
+    server.http = http.createServer(server.express);
+
+    this.wss = new WebSocket.Server({
+      server: server.http,
+      // TODO: enable client verification
+      /* verifyClient: (info, done) => {
+        server.sessions(info.req, {}, () => {
+          // TODO: reject unknown (!info.req.session.identity)
+          done();
+        });
+      } */
+    });
+    this.wss.on('connection', this._handleWebSocket.bind(this));
+
+    server.http.listen(this.config.port);
+
+    return server;
+  }
+
+  async stop () {
+    this.http.close();
+  }
+}
+
+module.exports = Hub;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_maki.js.html b/docs/types_maki.js.html new file mode 100644 index 00000000..d9da29b4 --- /dev/null +++ b/docs/types_maki.js.html @@ -0,0 +1,74 @@ + + + + + Source: types/maki.js · Docs + + + + + + + +
+

Source: types/maki.js

+ + + + + +
+
+
'use strict';
+
+const Fabric = require('@fabric/core');
+const SPA = require('./spa');
+
+/**
+ * Maki makes building beautiful apps a breeze.
+ * @type {Object}
+ */
+class Maki extends Fabric.Program {
+  /**
+   * Build a new application.
+   * @param  {Object} [settings={}] Configuration for the Maki app.
+   * @return {Maki}                 Instance of Maki.
+   */
+  constructor (settings = {}) {
+    super(settings);
+    this.spa = new SPA(settings);
+    return this;
+  }
+
+  /**
+   * Generate an HTML string representing the current state of the app.
+   * @return {String} HTML-encoded string representing the application.
+   */
+  render () {
+    return `<maki-application>
+  <fabric-state><code>${JSON.stringify(this.state)}</code></fabric-state>
+  <maki-canvas>${this.spa._renderWith('Hello, world!')}</maki-canvas>
+</maki-application>`;
+  }
+}
+
+module.exports = Maki;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_remote.js.html b/docs/types_remote.js.html new file mode 100644 index 00000000..91135870 --- /dev/null +++ b/docs/types_remote.js.html @@ -0,0 +1,472 @@ + + + + + Source: types/remote.js · Docs + + + + + + + +
+

Source: types/remote.js

+ + + + + +
+
+
'use strict';
+
+const {
+  P2P_CALL
+} = require('@fabric/core/constants');
+
+// Internal Dependencies
+const http = require('http');
+const https = require('https');
+const querystring = require('querystring');
+
+// External Dependencies
+const fetch = require('cross-fetch');
+const parser = require('content-type');
+const ws = require('ws').WebSocket;
+
+// Internal Types
+const Actor = require('@fabric/core/types/actor');
+const Message = require('@fabric/core/types/message');
+const CONTENT_TYPE = 'application/json';
+
+/**
+ * Interact with a remote {@link Resource}.  This is currently the only
+ * HTTP-related code that should remain in @fabric/core — all else must
+ * be moved to @fabric/http before final release!
+ * @type {Remote}
+ * @property {Object} config
+ * @property {Boolean} secure
+ */
+class Remote extends Actor {
+  /**
+   * An in-memory representation of a node in our network.
+   * @param       {Object} target - Target object.
+   * @param       {String} target.host - Named host, e.g. "localhost".
+   * @param       {String} target.secure - Require TLS session.
+   * @constructor
+   */
+  constructor (config = {}) {
+    super(config);
+
+    this.settings = Object.assign({
+      authority: 'localhost',
+      backoff: 2,
+      entropy: Math.random(),
+      secure: true,
+      host: 'hub.fabric.pub',
+      port: 443
+    }, config);
+
+    this.host = this.settings.host || this.settings.authority;
+    this.secure = this.settings.secure;
+    this.socket = null;
+
+    this.endpoint = `${(this.secure) ? 'wss' : 'ws'}:${this.host}:${this.port}/`;
+
+    this._nextReconnect = 0;
+    this._reconnectAttempts = 0;
+    this._state = {
+      status: 'PAUSED',
+      messages: [],
+      meta: {
+        messages: {
+          count: 0
+        }
+      }
+    };
+
+    return this;
+  }
+
+  get port () {
+    return this.settings.port;
+  }
+
+  get authority () {
+    // TODO: use onion address for secure mode
+    const parts = this.settings.authority.split(':');
+    const state = {
+      host: null,
+      secure: null,
+      protocol: null,
+      port: null
+    };
+
+    // Check number of components
+    switch (parts.length) {
+      default:
+        // TODO: warn about unexpected values
+        state.host = this.settings.host;
+        state.port = this.settings.port;
+        state.secure = this.settings.secure;
+        break;
+      case 1:
+        state.host = parts[0];
+        state.port = this.settings.port;
+        state.secure = this.settings.secure;
+        break;
+      case 2:
+        state.host = parts[0];
+        state.port = parts[1];
+        state.secure = this.settings.secure;
+        break;
+      case 3:
+        state.host = parts[1];
+        state.port = parts[2];
+        // TODO: should settings override protocol inclusion?
+        state.secure = (parts[0].charAt(4) === 's');
+        break;
+    }
+
+    // Finally set protocol for all cases...
+    state.protocol = (!state.secure) ? 'http' : 'https';
+
+    return `${state.protocol}://${state.host}:${state.port}`;
+  }
+
+  get isArrayBufferSupported () {
+    return (new Buffer(new Uint8Array([1]).buffer)[0] === 1);
+  }
+
+  get arrayBufferToBuffer () {
+    return this.isArrayBufferSupported ? this.arrayBufferToBufferAsArgument : this.arrayBufferToBufferCycle;
+  }
+    
+  arrayBufferToBufferAsArgument (ab) {
+    return new Buffer(ab);
+  }
+
+  arrayBufferToBufferCycle (ab) {
+    var buffer = new Buffer(ab.byteLength);
+    var view = new Uint8Array(ab);
+    for (var i = 0; i < buffer.length; ++i) {
+        buffer[i] = view[i];
+    }
+    return buffer;
+  }
+
+  async _handleSocketClose (message) {
+    this._state.status = 'CLOSED';
+    console.log('[FABRIC:REMOTE]', 'Socket close:', message);
+    this._reconnectAttempts++;
+    this._reconnector = setTimeout(this.connect.bind(this), this._nextReconnect);
+    this._nextReconnect = Math.pow(this.settings.backoff, this._reconnectAttempts) * 1000 * Math.random();
+  }
+
+  async _handleSocketError (message) {
+    console.error('[FABRIC:REMOTE]', 'Socket error:', message);
+    this.emit('error', message);
+  }
+
+  async _handleSocketMessage (packet) {
+    this.emit('debug', `[FABRIC:REMOTE] Socket packet ${JSON.stringify(packet)}`);
+    const length = packet.data.byteLength;
+    console.log('length:', length);
+    const buffer = Buffer.from(packet.data);
+    console.log('buffer:', buffer);
+    const message = Message.fromRaw(buffer).toObject();
+    console.log('message:', message);
+    this._state.messages.push(message);
+    ++this._state.meta.messages.count;
+    this.emit('message', message);
+  }
+
+  async _handleSocketOpen (message) {
+    this._nextReconnect = 0;
+    this._reconnectAttempts = 0;
+    if (this._reconnector) clearTimeout(this._reconnector);
+    this._state.status = 'CONNECTED';
+    this.emit('ready');
+  }
+
+  async executeMethod (name, params = []) {
+    const call = Message.fromVector([P2P_CALL, JSON.stringify([name, params])]);
+    console.log('call:', call);
+    console.log('raw:', call.toRaw());
+    return this.socket.send(call.toRaw());
+  }
+
+  async connect () {
+    this._state.status = 'CONNECTING';
+
+    try {
+      this.socket = new WebSocket(this.endpoint);
+      console.log('socket:', this.socket);
+    } catch (exception) {
+      console.error('[FABRIC:REMOTE]', 'Unable to connect:', exception);
+    }
+
+    if (this.socket) {
+      this.socket.binaryType = 'arraybuffer';
+      this.socket.addEventListener('close', this._handleSocketClose.bind(this));
+      this.socket.addEventListener('open', this._handleSocketOpen.bind(this));
+      this.socket.addEventListener('message', this._handleSocketMessage.bind(this));
+      this.socket.addEventListener('error', this._handleSocketError.bind(this));
+    }
+
+    return this;
+  }
+
+  /**
+   * Enumerate the available Resources on the remote host.
+   * @return {Configuration} An object with enumerable key/value pairs for the Application Resource Contract.
+   */
+  async enumerate () {
+    const options = await this._OPTIONS('/');
+    const results = [];
+
+    for (const name in options) {
+      const definition = options[name];
+      results.push({
+        name: definition.name,
+        description: definition.description,
+        components: Object.assign({
+          list: 'maki-resource-list',
+          view: 'maki-resource-view'
+        }, definition.components),
+        routes: definition.routes,
+        attributes: definition.attributes,
+        names: definition.names
+      });
+    }
+
+    return options;
+  }
+
+  /**
+   * Make an HTTP request to the configured authority.
+   * @param {String} type One of `GET`, `PUT`, `POST`, `DELETE`, or `OPTIONS`.
+   * @param {String} path The path to request from the authority.
+   * @param {Object} [params] Options.
+   * @returns {FabricHTTPResult}
+   */
+  async request (type, path, params = {}) {
+    const self = this;
+
+    let url = this.authority + path;
+    let result = null;
+    let response = null;
+    let headers = {
+      'Accept': CONTENT_TYPE,
+      'Content-Type': CONTENT_TYPE
+    };
+
+    let opts = {
+      method: type,
+      headers: headers
+    };
+
+    // TODO: break out into independent auth module
+    if (this.settings.username || this.settings.password) {
+      headers['Authorization'] = `Basic ${Buffer.from([
+        this.settings.username || '',
+        this.settings.password || ''
+      ].join(':')).toString('base64')}`;
+    }
+
+    switch (params.mode) {
+      case 'query':
+        url += '?' + querystring.stringify(params.body);
+        break;
+      default:
+        try {
+          opts.body = JSON.stringify(params.body);
+        } catch (exception) {
+          console.error('[FABRIC:REMOTE] Could not prepare request:', exception);
+        }
+
+        opts = Object.assign(opts, {
+          body: params.body || null
+        });
+        break;
+    }
+
+    // Core Logic
+    try {
+      response = await fetch(url, opts);
+    } catch (e) {
+      self.emit('error', `[REMOTE] exception: ${e}`);
+    }
+
+    if (!response) {
+      return {
+        status: 'error',
+        message: 'No response to request.'
+      };
+    }
+
+    switch (response.status) {
+      case 404:
+        result = {
+          status: 'error',
+          message: 'Document not found.'
+        };
+        break;
+      default:
+        if (response.ok) {
+          const formatter = parser.parse(response.headers.get('content-type'));
+          switch (formatter.type) {
+            case 'application/json':
+              try {
+                result = await response.json();
+              } catch (E) {
+                console.error('[REMOTE]', 'Could not parse JSON:', E);
+              }
+              break;
+            default:
+              if (this.settings.verbosity >= 4) self.emit('warning', `[FABRIC:REMOTE] Unhandled headers content type: ${formatter.type}`);
+              result = await response.text();
+              break;
+          }
+        } else {
+          if (this.settings.verbosity >= 4) console.warn('[FABRIC:REMOTE]', 'Unmanaged HTTP status code:', response.status);
+
+          try {
+            result = response.json();
+          } catch (exception) {
+            result = response.text();
+          }
+        }
+        break;
+    }
+
+    return result;
+  }
+
+  async ping () {
+    this.send({
+      created: (new Date()).toISOString(),
+      type: 'PING'
+    });
+  }
+
+  async send (message) {
+    const msg = Message.fromVector(['GenericMessage', JSON.stringify(message)]);
+    const raw = msg.toRaw();
+    const actor = new Actor({ content: raw.toString('hex') });
+    this.socket.send(raw);
+    return actor.id;
+  }
+
+  async sendAsJSON (message) {
+    this.socket.send({
+      content: message
+    });
+  }
+
+  /**
+   * HTTP PUT against the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} body - Map of parameters to supply.
+   * @return {FabricHTTPResult|String} Result of request.
+   */
+  async _PUT (key, body) {
+    return this.request('put', key, { body });
+  }
+
+  /**
+   * HTTP GET against the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} params - Map of parameters to supply.
+   * @return {FabricHTTPResult|String} Result of request.
+   */
+  async _GET (key, params) {
+    return this.request('get', key, params);
+  }
+
+  /**
+   * HTTP POST against the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} params - Map of parameters to supply.
+   * @return {FabricHTTPResult|String} Result of request.
+   */
+  async _POST (key, obj, params = {}) {
+    let result = null;
+    let options = null;
+
+    switch (params.mode) {
+      case 'query':
+        options = Object.assign({}, {
+          body: obj,
+          mode: 'query'
+        });
+        break;
+      default:
+        options = Object.assign({}, params, {
+          body: obj,
+          mode: 'body'
+        });
+        break;
+    }
+
+    result = await this.request('post', key, options);
+
+    return result;
+  }
+
+  /**
+   * HTTP OPTIONS on the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} params - Map of parameters to supply.
+   * @return {Object} - Full description of remote resource.
+   */
+  async _OPTIONS (key, params) {
+    return this.request('options', key, params);
+  }
+
+  /**
+   * HTTP PATCH on the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} body - Map of parameters to supply.
+   * @return {Object} - Full description of remote resource.
+   */
+  async _PATCH (key, body) {
+    return this.request('patch', key, { body });
+  }
+
+  /**
+   * HTTP DELETE on the configured Authority.
+   * @param  {String} path - HTTP Path to request.
+   * @param  {Object} params - Map of parameters to supply.
+   * @return {Object} - Full description of remote resource.
+   */
+  async _DELETE (key, params) {
+    return this.request('delete', key, params);
+  }
+
+  async _SEARCH (key, params) {
+    return this.request('search', key, params);
+  }
+}
+
+module.exports = Remote;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_router.js.html b/docs/types_router.js.html new file mode 100644 index 00000000..0d08a895 --- /dev/null +++ b/docs/types_router.js.html @@ -0,0 +1,171 @@ + + + + + Source: types/router.js · Docs + + + + + + + +
+

Source: types/router.js

+ + + + + +
+
+
'use strict';
+
+const pluralize = require('pluralize');
+const { pathToRegexp, match, parse, compile } = require('path-to-regexp');
+
+const Entity = require('@fabric/core/types/entity');
+const Service = require('@fabric/core/types/service');
+
+/**
+ * Simple router.
+ * @type {Object}
+ */
+class Router extends Service {
+  /**
+   * Builds a new {@link Router}.
+   * @param  {Object} [settings={}] Configuration for the router.
+   * @return {Router}               Instance of the {@link Router}.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    let fee = {
+      '@type': 'BasisPointsOnValue',
+      '@data': 20
+    };
+
+    this.current = null;
+    this.settings = Object.assign({ fee }, settings);
+    this.components = {};
+    this.resources = {};
+    this.routes = {};
+    this.page = null;
+
+    return this;
+  }
+
+  define (name, definition) {
+    let result = super.define(name, definition);
+
+    if (definition.components) {
+      if (definition.components.list) {
+        this.components[definition.components.list] = 'name/list';
+      }
+      if (definition.components.view) {
+        this.components[definition.components.view] = 'name/view';
+      }
+    }
+
+    return result;
+  }
+
+  route (msg) {
+    console.log('[MAKI:ROUTER]', 'ROUTING THE FOLLOWING MESSAGE', msg, this.routes);
+    let route = this._route(msg);
+    console.log('THE ROUTE:', route);
+    this.current = msg;
+    return Object.assign({
+      fee: this.settings.fee,
+      route: route
+    });
+  }
+
+  _addRoute (route, component) {
+    this.routes[component] = {
+      path: route,
+      regex: pathToRegexp(route)
+    };
+    // this.router.use(route.path, this._handleRoutableRequest.bind(this));
+    return this.routes[route.name];
+  }
+
+  _route (path) {
+    for (let name in this.routes) {
+      let route = this.routes[name];
+      let match = route.regex.exec(path);
+      if (match) {
+        return {
+          resource: route.resource,
+          component: name
+        };
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Add a named definition.
+   * @param  {String}  path       Flat path.
+   * @param  {Object}  definition Resource definition?
+   * @return {Promise}            Resolves once added.
+   */
+  async _addFlat (path, definition) {
+    this.routes[path] = definition;
+  }
+
+  async _deliver (target, msg) {
+    console.log('delivering:', target, msg);
+    return this.members[target];
+  }
+
+  async _handleRoutableRequest (event) {
+    return this.router.route(event);
+  }
+
+  async start () {
+    if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'starting...');
+    this.status = 'starting';
+
+    for (let name in this.routes) {
+      let route = new Entity(this.routes[name].path);
+      /* this.state.channels[route.id] = Object.assign({
+        path: this.routes[name].path,
+        members: [],
+        messages: []
+      }); */
+    }
+
+    this.status = 'started';
+    if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'started!', this.state);
+    return this;
+  }
+
+  async stop () {
+    if (this.settings.verbosity >= 4) console.log('[FABRIC:HTTP]', 'ROUTER()', 'Stopping...');
+    this.status = 'stopping';
+    this.status = 'stopped';
+    return this;
+  }
+}
+
+module.exports = Router;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_server.js.html b/docs/types_server.js.html new file mode 100644 index 00000000..f1b9f7a8 --- /dev/null +++ b/docs/types_server.js.html @@ -0,0 +1,930 @@ + + + + + Source: types/server.js · Docs + + + + + + + +
+

Source: types/server.js

+ + + + + +
+
+
'use strict';
+
+const {
+  HTTP_SERVER_PORT,
+  HTTPS_SERVER_PORT,
+  MAXIMUM_PING,
+  P2P_SESSION_ACK,
+  WEBSOCKET_KEEPALIVE
+} = require('../constants');
+
+// Dependencies
+const http = require('http');
+const crypto = require('crypto');
+const merge = require('lodash.merge');
+// TODO: remove Express entirely...
+// NOTE: current blockers include PeerServer...
+const express = require('express');
+const session = require('express-session');
+// TODO: check with Riddle about this
+const parsers = require('body-parser');
+const monitor = require('fast-json-patch');
+const extractor = require('express-bearer-token');
+const pluralize = require('pluralize');
+const stoppable = require('stoppable');
+
+// Pathing
+const pathToRegexp = require('path-to-regexp').pathToRegexp;
+
+// Fabric Types
+const Actor = require('@fabric/core/types/actor');
+// const Oracle = require('@fabric/core/types/oracle');
+const Collection = require('@fabric/core/types/collection');
+// const Resource = require('@fabric/core/types/resource');
+const Service = require('@fabric/core/types/service');
+const Message = require('@fabric/core/types/message');
+const Entity = require('@fabric/core/types/entity');
+const State = require('@fabric/core/types/state');
+
+// Internal Components
+// const App = require('./app');
+// const Client = require('./client');
+// const Component = require('./component');
+// const Browser = require('./browser');
+// const SPA = require('./spa');
+
+// Dependencies
+const WebSocket = require('ws');
+const PeerServer = require('peer').ExpressPeerServer;
+
+/**
+ * The primary web server.
+ * @extends Service
+ */
+class FabricHTTPServer extends Service {
+  /**
+   * Create an instance of the HTTP server.
+   * @param {Object} [settings] Configuration values.
+   * @param {String} [settings.name="FabricHTTPServer"] User-friendly name of this server.
+   * @param {Number} [settings.port=9999] Port to listen for HTTP connections on.
+   * @return {FabricHTTPServer} Fully-configured instance of the HTTP server.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    // Assign defaults
+    this.settings = merge({
+      name: 'FabricHTTPServer',
+      description: 'Service delivering a Fabric application across the HTTP protocol.',
+      // TODO: document host as listening on all interfaces by default
+      host: '0.0.0.0',
+      path: './stores/server',
+      port: HTTP_SERVER_PORT,
+      listen: true,
+      resources: {},
+      components: {},
+      services: {
+        audio: {
+          address: '/devices/audio'
+        }
+      },
+      // TODO: replace with crypto random
+      seed: Math.random(),
+      sessions: false
+    }, settings);
+
+    this.connections = {};
+    this.definitions = {};
+    this.methods = {};
+    this.stores = {};
+
+    // this.browser = new Browser(this.settings);
+    // TODO: compile & boot (load state) SPA (React + Redux?)
+    /* this.app = new SPA(Object.assign({}, this.settings, {
+      path: './stores/server-application'
+    })); */
+
+    /* this.compiler = webpack({
+      // webpack options
+    }); */
+
+    this.wss = null;
+    this.http = null;
+
+    this.express = express();
+    this.sessions = session({
+      resave: true,
+      saveUninitialized: false,
+      secret: this.settings.seed
+    });
+
+    this._state = {};
+    this.observer = monitor.observe(this.state);
+    this.coordinator = new PeerServer(this.express, {
+      path: '/services/peering'
+    });
+
+    this.collections = [];
+    this.routes = [];
+    this.customRoutes = [];
+
+    return this;
+  }
+
+  get link () {
+    return `http://${this.settings.host}:${this.settings.port}`;
+  }
+
+  get state () {
+    return this._state;
+  }
+
+  set state (value) {
+    this._state = value;
+  }
+
+  async commit () {
+    ++this.clock;
+
+    this['@id'] = this.id;
+    // TODO: define parent path
+    // this['@parent'] = this.id;
+    // this['@preimage'] = this.toString();
+    this['@constructor'] = this.constructor;
+
+    if (this.observer) {
+      this['@changes'] = monitor.generate(this.observer);
+    }
+
+    if (this['@changes'] && this['@changes'].length) {
+      const message = {
+        '@type': 'Transaction',
+        '@data': {
+          changes: this['@changes'],
+          state: this.state
+        }
+      };
+
+      this.emit('changes', this['@changes']);
+      this.emit('state', this.state);
+      this.emit('message', message);
+
+      // Broadcast to connected peers
+      this.broadcast(message);
+    }
+
+    return this;
+  }
+
+  /**
+   * Define a {@link Type} by name.
+   * @param  {String} name       Human-friendly name of the type.
+   * @param  {Definition} definition Configuration object for the type.
+   * @return {FabricHTTPServer}            Instance of the configured server.
+   */
+  async define (name, definition) {
+    if (this.settings.verbosity >= 5) console.log('[HTTP:SERVER]', 'Defining:', name, definition);
+    const server = this;
+    const resource = await super.define(name, definition);
+
+    const snapshot = Object.assign({
+      name: name,
+      names: { plural: pluralize(name) }
+    }, resource);
+
+    const address = snapshot.routes.list.split('/')[1];
+    const store = new Collection(snapshot);
+
+    if (this.settings.verbosity >= 6) console.log('[HTTP:SERVER]', 'Collection as store:', store);
+    if (this.settings.verbosity >= 6) console.log('[HTTP:SERVER]', 'Snapshot:', snapshot);
+
+    this.stores[name] = store;
+    this.definitions[name] = snapshot;
+    this.collections.push(snapshot.routes.list);
+    this.keys.add(snapshot.routes.list);
+
+    this.stores[name].on('error', async (error) => {
+      console.error('[HTTP:SERVER]', '[ERROR]', error);
+    });
+
+    this.stores[name].on('warning', async (warning) => {
+      console.warn('[HTTP:SERVER]', 'Warning:', warning);
+    });
+
+    this.stores[name].on('message', async (message) => {
+      let entity = null;
+      switch (message['@type']) {
+        case 'Create':
+          entity = new Entity({
+            '@type': name,
+            '@data': message['@data']
+          });
+
+          console.log('[HTTP:SERVER]', `Resource "${name}" created:`, entity.data);
+          server.emit('message', entity.data);
+          break;
+        case 'Transaction':
+          await server._applyChanges(message['@data'].changes);
+          break;
+        default:
+          console.warn('[HTTP:SERVER]', 'Unhandled message type:', message['@type']);
+          break;
+      }
+
+      server.broadcast({
+        '@type': 'StateUpdate',
+        '@data': server.state
+      });
+    });
+
+    this.stores[name].on('commit', (commit) => {
+      server.broadcast({
+        '@type': 'StateUpdate',
+        '@data': server.state
+      });
+    });
+
+    this.routes.push({
+      path: snapshot.routes.view,
+      route: pathToRegexp(snapshot.routes.view),
+      resource: name
+    });
+
+    this.routes.push({
+      path: snapshot.routes.list,
+      route: pathToRegexp(snapshot.routes.list),
+      resource: name
+    });
+
+    // Also define on app
+    await this.app.define(name, definition);
+
+    // TODO: document pathing
+    this.state[address] = {};
+    this.app.state[address] = {};
+
+    // if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Routes:', this.routes);
+    return this;
+  }
+
+  broadcast (message) {
+    let peers = Object.keys(this.connections);
+    for (let i = 0; i < peers.length; i++) {
+      try {
+        this.connections[peers[i]].send(JSON.stringify(message));
+      } catch (E) {
+        console.error('Could not send message to peer:', E);
+      }
+    }
+  }
+
+  trust (source) {
+    super.trust(source);
+
+    source.on('message', function (msg) {
+      console.log('[HTTP:SERVER]', 'trusted source:', source.constructor.name, 'sent message:', msg);
+    });
+  }
+
+  _registerMethod (name, method) {
+    this.methods[name] = method.bind(this);
+  }
+
+  _handleAppMessage (msg) {
+    console.trace('[HTTP:SERVER]', 'Internal app emitted message:', msg);
+  }
+
+  _handleCall (call) {
+    if (!call.method) throw new Error('Call requires "method" parameter.');
+    if (!call.params) throw new Error('Call requires "params" parameter.');
+    if (!this.methods[call.method]) throw new Error(`Method "${call.method}" has not been registered.`);
+    return this.methods[call.method].apply(this, call.params);
+  }
+
+  /**
+   * Connection manager for WebSockets.  Called once the handshake is complete.
+   * @param  {WebSocket} socket The associated WebSocket.
+   * @param  {http.IncomingMessage} request Incoming HTTP request.
+   * @return {WebSocket} Returns the connected socket.
+   */
+  _handleWebSocket (socket, request) {
+    const server = this;
+    server.emit('debug', `Handling WebSocket: ${Object.keys(socket)}`);
+
+    // TODO: check security of common defaults for `sec-websocket-key` params
+    // Chrome?  Firefox?  Safari?  Opera?  What defaults do they use?
+    const buffer = Buffer.from(request.headers['sec-websocket-key'], 'base64');
+    const handle = buffer.toString('hex');
+    const player = new State({
+      connection: buffer.toString('hex'),
+      entropy: buffer.toString('hex')
+    });
+
+    socket._resetKeepAlive = function () {
+      clearInterval(socket._heartbeat);
+      socket._heartbeat = setInterval(function () {
+        const now = Date.now();
+        const message = Message.fromVector(['Ping', now.toString()]);
+        // TODO: refactor _sendTo to accept Message type
+        const ping = JSON.stringify(message.toObject());
+
+        try {
+          server._sendTo(handle, ping);
+        } catch (exception) {
+          console.error('could not ping peer:', handle, exception);
+        }
+      }, WEBSOCKET_KEEPALIVE);
+    };
+
+    socket._timeout = null;
+    socket._resetKeepAlive();
+
+    // Clean up memory when the connection has been safely closed (ideal case).
+    socket.on('close', function () {
+      clearInterval(socket._heartbeat);
+      delete server.connections[player['@data'].connection];
+    });
+
+    // TODO: message handler on base class
+    socket.on('message', async function handler (msg) {
+      console.log('[SERVER:WEBSOCKET]', 'incoming message:', typeof msg, msg);
+
+      let message = null;
+      let type = null;
+
+      if (msg.type && msg.data) {
+        console.log('spec:', {
+          type: msg.type,
+          data: msg.data
+        });
+      }
+
+      try {
+        message = Message.fromRaw(msg);
+        type = message.type;
+      } catch (exception) {
+        console.error('could not parse message:', exception);
+      }
+
+      if (!message) {
+        // Fall back to JSON parsing
+        try {
+          if (msg instanceof Buffer) {
+            msg = msg.toString('utf8');
+          }
+
+          message = JSON.parse(msg);
+          type = message['@type'] || message.type;
+        } catch (E) {
+          console.error('could not parse message:', typeof msg, msg, E);
+          // TODO: disconnect from peer
+          console.warn('you should disconnect from this peer:', handle);
+        }
+      }
+
+      const obj = message.toObject();
+      const actor = new Actor(obj);
+
+      let local = null;
+
+      switch (type) {
+        default:
+          console.log('[SERVER]', 'unhandled type:', type);
+          break;
+        case 'GET':
+          let answer = await server._GET(message['@data']['path']);
+          console.log('answer:', answer);
+          return answer;
+        case 'POST':
+          let link = await server._POST(message['@data']['path'], message['@data']['value']);
+          console.log('[SERVER]', 'posted link:', link);
+          break;
+        case 'PATCH':
+          let result = await server._PATCH(message['@data']['path'], message['@data']['value']);
+          console.log('[SERVER]', 'patched:', result);
+          break;
+        case 'Ping':
+          let now = Date.now();
+          local = Message.fromVector(['Pong', now.toString()]);
+          let pong = JSON.stringify(local.toObject());
+          return server._sendTo(handle, pong);
+        case 'GenericMessage':
+          local = Message.fromVector(['GenericMessage', JSON.stringify({
+            type: 'GenericMessageReceipt',
+            content: actor.id
+          })]);
+
+          let msg = null;
+
+          try {
+            msg = JSON.parse(obj.data);
+          } catch (exception) {}
+
+          if (msg) {
+            server.emit('call', msg.data || {
+              method: 'GenericMessage',
+              params: [msg.data]
+            });
+          }
+
+          break;
+        case 'Pong':
+          socket._resetKeepAlive();
+          return;
+          break;
+        case 'Call':
+          server.emit('call', {
+            method: message['@data'].data.method,
+            params: message['@data'].data.params
+          });
+          break;
+      }
+
+      // TODO: enable relays
+      // server._relayFrom(handle, msg);
+
+      // always send a receipt of acknowledgement
+      socket.send(JSON.stringify({
+        '@type': 'Receipt',
+        '@actor': handle,
+        '@data': message,
+        '@version': 1
+      }));
+    });
+
+    // set up an oracle, which listens to patches from server
+    socket.oracle = server.on('patches', function (patches) {
+      console.log('magic oracle patches:', patches);
+    });
+
+    // insert connection to library
+    server.connections[player['@data'].connection] = socket;
+    // server.players[player['@data'].connection] = player;
+
+    const ack = Message.fromVector([P2P_SESSION_ACK, crypto.randomBytes(32).toString('hex')]);
+    const raw = ack.toBuffer();
+    socket.send(raw);
+
+    // send result
+    /* socket.send(JSON.stringify({
+      '@type': 'VerAck',
+      '@version': 1
+    })); */
+
+    if (this.app) {
+      socket.send(JSON.stringify({
+        '@type': 'Inventory',
+        '@parent': server.app.id,
+        '@version': 1
+      }));
+
+      socket.send(JSON.stringify({
+        '@type': 'State',
+        '@data': server.app.state,
+        '@version': 1
+      }));
+    }
+
+    return socket;
+  }
+
+  _sendTo (actor, msg) {
+    console.log('[SERVER:WEBSOCKET]', 'sending message to actor', actor, msg);
+    let target = this.connections[actor];
+    if (!target) throw new Error('No such target.');
+    let result = target.send(msg);
+  }
+
+  _relayFrom (actor, msg) {
+    let peers = Object.keys(this.connections).filter(key => {
+      return key !== actor;
+    });
+
+    this.log(`relaying message from ${actor} to peers:`, peers);
+
+    for (let i = 0; i < peers.length; i++) {
+      try {
+        this.connections[peers[i]].send(msg);
+      } catch (E) {
+        console.error('Could not relay to peer:', E);
+      }
+    }
+  }
+
+  /**
+   * Special handler for first-page requests.
+   * @param {HTTPRequest} req Incoming request.
+   * @param {HTTPResponse} res Outgoing response.
+   */
+  _handleIndexRequest (req, res) {
+    console.log('[HTTP:SERVER]', 'Handling request for Index...');
+    let html = '';
+
+    if (this.app) {
+      html = this.app.render(this.state);
+    } else {
+      html = '<fabric-application><fabric-card>Failed to load, as no application was available.</fabric-card></fabric-application>';
+    }
+    console.log('[HTTP:SERVER]', 'Generated HTML:', html);
+    res.set('Content-Type', 'text/html');
+    res.send(`${html}`);
+  }
+
+  _handleOptionsRequest (req, res) {
+    res.send({
+      name: this.settings.name,
+      description: this.settings.description,
+      resources: this.definitions
+    });
+  }
+
+  _logMiddleware (req, res, next) {
+    // if (!this.settings.verbosity < 2) return next();
+    // TODO: switch to this.log
+    console.log([
+      `${req.hostname}:${this.settings.port}`,
+      req.hostname,
+      req.user,
+      `"${req.method} ${req.path} HTTP/${req.httpVersion}"`,
+      res.statusCode,
+      res.getHeader('content-length')
+    ].join(' '));
+    return next();
+  }
+
+  _headerMiddleware (req, res, next) {
+    res.header('X-Powered-By', '@fabric/http');
+    res.header('Access-Control-Allow-Origin', '*');
+    res.header('Access-Control-Allow-Headers', 'content-type');
+    return next();
+  }
+
+  _verifyClient (info, done) {
+    console.log('[HTTP:SERVER]', '_verifyClient', info);
+    if (!this.settings.sessions) return done();
+    this.sessions(info.req, {}, () => {
+      // TODO: reject unknown (!info.req.session.identity)
+      done();
+    });
+  }
+
+  /**
+   * Add a route manually.
+   * @param {String} method  HTTP verb.
+   * @param {String} path    HTTP route.
+   * @param {Function} handler HTTP handler (req, res, next)
+   */
+  _addRoute (method, path, handler) {
+    this.emit('debug', `[HTTP:SERVER] Adding route: ${path}`);
+    this.customRoutes.push({ method, path, handler });
+  }
+
+  _roleMiddleware (req, res, next) {
+    next();
+  }
+
+  async _applyChanges (ops) {
+    try {
+      monitor.applyPatch(this.state, ops);
+      await this.commit();
+    } catch (E) {
+      this.error('Error applying changes:', E);
+    }
+
+    return this;
+  }
+
+  async _handleRoutableRequest (req, res, next) {
+    if (this.settings.verbosity >= 5) console.log('[HTTP:SERVER]', 'Handling routable request:', req.method, req.path);
+    const server = this;
+
+    // Prepare variables
+    let result = null;
+    let route = null;
+    let resource = null;
+
+    for (let i in this.routes) {
+      let local = this.routes[i];
+      if (req.path.match(local.route)) {
+        route = local;
+        resource = local.resource;
+        break;
+      }
+    }
+
+    switch (req.method.toUpperCase()) {
+      // Discard unhandled methods
+      default:
+        return next();
+      case 'HEAD':
+        let existing = await server._GET(req.path);
+        if (!existing) return res.status(404).end();
+        break;
+      case 'GET':
+        if (resource) {
+          try {
+            result = await server.stores[resource].get(req.path);
+          } catch (exception) {
+            console.warn('[HTTP:SERVER]', 'Warning:', exception);
+          }
+        }
+
+        // TODO: re-optimize querying from memory (i.e., don't touch disk / restore)
+        // If a result was found, use it by breaking immediately
+        // if (result) break;
+
+        // No result found, call _GET locally
+        result = await server._GET(req.path);
+        // let content = await server.stores[resource].get(req.path);
+        break;
+      case 'PUT':
+        result = await server._PUT(req.path, req.body);
+        break;
+      case 'POST':
+        if (resource) {
+          result = await server.stores[resource].create(req.body);
+        }
+
+        if (!result) return res.status(500).end();
+
+        // Call parent method (2 options)
+        // Option 1 (original): Assigns the direct result
+        // let link = await server._POST(req.path, result);
+        // Option 2 (testing): Assigns the raw body
+        let link = await server._POST(req.path, req.body);
+
+        // POST requests return a 303 header with a pointer to the object
+        return res.redirect(303, link);
+      case 'PATCH':
+        let patch = await server._PATCH(req.path, req.body);
+        result = patch;
+        break;
+      case 'DELETE':
+        await server._DELETE(req.path);
+        return res.sendStatus(204);
+      case 'OPTIONS':
+        return res.send({
+          '@type': 'Error',
+          '@data': 'Not yet supported.'
+        });
+    }
+
+    // If no result found, return 404
+    if (!result) {
+      return res.status(404).send({
+        status: 'error',
+        message: 'Document not found.',
+        request: {
+          method: req.method.toUpperCase(),
+          path: req.path
+        }
+      });
+    }
+
+    return res.format({
+      json: function () {
+        res.header('Content-Type', 'application/json');
+        return res.send(result);
+      },
+      html: function () {
+        // TODO: re-enable for HTML
+        // let output = server.app._loadHTML(resource.render(result));
+        // return res.send(server.app._renderWith(output));
+
+        // TODO: re-write above code, render app with data
+        res.header('Content-Type', 'application/json');
+        return res.send(result);
+      }
+    });
+  }
+
+  async start () {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Starting...');
+    const server = this;
+    server.status = 'starting';
+
+    if (!server.settings.resources || !Object.keys(server.settings.resources).length) {
+      console.trace('[HTTP:SERVER]', 'No Resources have been defined for this server.  Please provide a "resources" map in the configuration.');
+    }
+
+    for (let name in server.settings.resources) {
+      const definition = server.settings.resources[name];
+      const resource = await server._defineResource(name, definition);
+      if (server.settings.verbosity >= 6) console.log('[AUDIT]', 'Created resource:', resource);
+    }
+
+    // configure router
+    server.express.use(server._logMiddleware.bind(server));
+    server.express.use(server._headerMiddleware.bind(server));
+
+    // TODO: defer to an in-memory datastore for requested files
+    // NOTE: disable this line to compile on-the-fly
+    server.express.use(express.static('assets'));
+    server.express.use(extractor());
+    server.express.use(server._roleMiddleware.bind(server));
+
+    // configure sessions & parsers
+    // TODO: migrate to {@link Session} or abolish entirely
+    if (server.settings.sessions) server.express.use(server.sessions);
+
+    // Other Middlewares
+    server.express.use(parsers.urlencoded({ extended: true }));
+    server.express.use(parsers.json());
+
+    // TODO: render page
+    server.express.options('/', server._handleOptionsRequest.bind(server));
+    // TODO: enable this route by disabling or moving the static asset handler above
+    // NOTE: see `server.express.use(express.static('assets'));`
+    server.express.get('/', server._handleIndexRequest.bind(server));
+
+    // handle custom routes.
+    // TODO: abolish this garbage in favor of resources.
+    for (let i = 0; i < server.customRoutes.length; i++) {
+      const route = server.customRoutes[i];
+      switch (route.method.toLowerCase()) {
+        case 'get':
+        case 'put':
+        case 'post':
+        case 'patch':
+        case 'delete':
+          server.express[route.method.toLowerCase()](route.path, route.handler);
+          break;
+      }
+    }
+
+    // Attach the internal router
+    server.express.get('/*', server._handleRoutableRequest.bind(server));
+    server.express.put('/*', server._handleRoutableRequest.bind(server));
+    server.express.post('/*', server._handleRoutableRequest.bind(server));
+    server.express.patch('/*', server._handleRoutableRequest.bind(server));
+    server.express.delete('/*', server._handleRoutableRequest.bind(server));
+    server.express.options('/*', server._handleRoutableRequest.bind(server));
+
+    // create the HTTP server
+    server.http = stoppable(http.createServer(server.express), 0);
+
+    // attach a WebSocket handler
+    server.wss = new WebSocket.Server({
+      server: server.http,
+      // TODO: validate entire verification chain
+      // verifyClient: this._verifyClient.bind(this)
+    });
+
+    // set up the WebSocket connection handler
+    server.wss.on('connection', server._handleWebSocket.bind(server));
+
+    // Handle messages from internal app
+    if (server.app) {
+      server.app.on('snapshot', server._handleAppMessage.bind(server));
+      server.app.on('message', server._handleAppMessage.bind(server));
+      server.app.on('commit', server._handleAppMessage.bind(server));
+    }
+
+    // Handle interna call requests
+    server.on('call', server._handleCall.bind(server));
+
+    // TODO: convert to bound functions
+    server.on('commit', async function (msg) {
+      console.log('[HTTP:SERVER]', 'Internal commit:', msg);
+    });
+
+    server.on('message', async function (msg) {
+      console.log('[HTTP:SERVER]', 'Internal message:', msg);
+    });
+
+    if (server.app) {
+      try {
+        await server.app.start();
+      } catch (E) {
+        console.error('Could not start server app:', E);
+      }
+    }
+
+    if (this.settings.listen) {
+      server.http.on('listening', notifyReady);
+      await server.http.listen(this.settings.port, this.settings.host);
+    } else {
+      console.warn('[HTTP:SERVER]', 'Listening is disabled.  Only events will be emitted!');
+      notifyReady();
+    }
+
+    function notifyReady () {
+      server.status = 'STARTED';
+      server.emit('ready', {
+        id: server.id
+      });
+    }
+
+    // commit to our results
+    // await this.commit();
+
+    // TODO: include somewhere
+    // console.log('[FABRIC:WEB]', 'You should consider changing the `host` property in your config,');
+    // console.log('[FABRIC:WEB]', 'or set up a TLS server to encrypt traffic to and from this node.');
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Started!');
+
+    return server;
+  }
+
+  async flush () {
+    // console.log('[HTTP:SERVER]', 'flush requested:', this.keys);
+
+    for (let item of this.keys) {
+      // console.log('...flushing:', item);
+      try {
+        await this._DELETE(item);
+      } catch (E) {
+        console.error(E);
+      }
+    }
+  }
+
+  async stop () {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Stopping...');
+    const server = this;
+    this.status = 'stopping';
+
+    try {
+      await server.http.stop();
+    } catch (E) {
+      console.error('Could not stop HTTP listener:', E);
+    }
+
+    if (server.app) {
+      try {
+        await server.app.stop();
+      } catch (E) {
+        console.error('Could not stop server app:', E);
+      }
+    }
+
+    this.status = 'stopped';
+    server.emit('stopped');
+
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Stopped!');
+    return server;
+  }
+
+  async _GET (path) {
+    if (!this.app || !this.app.store) return null;
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Handling GET to', path);
+    let result = await this.app.store._GET(path);
+    if (this.settings.verbosity >= 5) console.log('[HTTP:SERVER]', 'Retrieved:', result);
+    if (!result && this.collections.includes(path)) result = [];
+    return result;
+  }
+
+  async _PUT (path, data) {
+    if (!this.app || !this.app.store) return null;
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Handling PUT to', path, data);
+    return this.app.store._PUT(path, data);
+  }
+
+  async _POST (path, data) {
+    if (this.settings.verbosity >= 4) console.trace('[HTTP:SERVER]', 'Handling POST to', path, data);
+    return this.app.store._POST(path, data);
+  }
+
+  async _PATCH (path, data) {
+    if (!this.app || !this.app.store) return null;
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Handling PATCH to', path, data);
+    return this.app.store._PATCH(path, data);
+  }
+
+  async _DELETE (path) {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SERVER]', 'Handling DELETE to', path);
+    return this.app.store._DELETE(path);
+  }
+}
+
+module.exports = FabricHTTPServer;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_spa.js.html b/docs/types_spa.js.html new file mode 100644 index 00000000..e6feb7f2 --- /dev/null +++ b/docs/types_spa.js.html @@ -0,0 +1,439 @@ + + + + + Source: types/spa.js · Docs + + + + + + + +
+

Source: types/spa.js

+ + + + + +
+
+
'use strict';
+
+const {
+  BROWSER_TARGET
+} = require('../constants');
+
+const config = {
+  title: '@fabric/http',
+  synopsis: 'Making beautiful apps a breeze.',
+  description: 'Legacy web support for Fabric.',
+  handle: 'html',
+  language: 'en',
+  components: {},
+  offline: false
+};
+
+// core dependencies
+const crypto = require('crypto');
+const page = require('page');
+const pluralize = require('pluralize');
+
+// Requisite Types
+const App = require('./app');
+const Bridge = require('./bridge');
+const Browser = require('./browser');
+const Router = require('./router');
+
+// Fabric Types
+const Message = require('@fabric/core/types/message');
+const Circuit = require('@fabric/core/types/circuit');
+const Resource = require('@fabric/core/types/resource');
+const Store = require('@fabric/core/types/store');
+
+/**
+ * Fully-managed HTML application.
+ * @extends App
+ */
+class SPA extends App {
+  /**
+   * Create a single-page app.
+   * @param  {Object} [settings={}] Settings for the application.
+   * @param  {String} [settings.name="@fabric/maki"] Name of the app.
+   * @param  {Boolean} [settings.offline=true] Hint offline mode to browsers.
+   * @param  {Object} [components] Map of Web Components for the application to utilize.
+   * @return {App}               Instance of the application.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    // Assist in debugging
+    if (settings.verbosity >= 4) console.log('[WEB:SPA]', 'Creating instance with constructor settings:', settings);
+
+    // Assign defaults
+    this.settings = Object.assign({
+      name: "@fabric/maki",
+      authority: 'localhost.localdomain:9999',
+      persistent: true,
+      // TODO: enable by default?
+      websockets: false,
+      secure: false, // TODO: default to secure (i.e., TLS on all connections)
+      components: {}
+    }, config, settings);
+
+    // TODO: enable Web Worker integration
+    /* this.worker = new Worker('./worker', {
+      type: 'module'
+    }); */
+
+    this.bridge = new Bridge(this.settings);
+    this.router = new Router(this.settings);
+    this.store = new Store(this.settings);
+
+    this.routes = [];
+    this.bindings = {
+      'click': this._handleClick.bind(this)
+    };
+
+    return this;
+  }
+
+  // TODO: reconcile with super(), document use of constructor vs. CustomElements
+  init (settings = {}) {
+    if (settings && settings.verbosity >= 5) console.trace('[WEB:SPA]', 'Calling init() with settings:', settings);
+    this.bridge = new Bridge(this.settings);
+    this.browser = new Browser(this.settings);
+    this.store = new Store(Object.assign({}, this.settings, { path: './stores/spa' }));
+    this.settings = Object.assign({}, this.settings, settings);
+    this._state = (window.app && window.app.state) ? window.app.state : {};
+  }
+
+  get handler () {
+    return page;
+  }
+
+  set state (state) {
+    if (!state) throw new Error('State must be provided.');
+    this._state = state;
+    this._redraw(this._state);
+  }
+
+  get state () {
+    return Object.assign({}, this._state);
+  }
+
+  define (name, definition) {
+    if (this.settings.verbosity >= 5) console.trace('[WEB:SPA]', 'Defining for SPA:', name, definition);
+    // TODO: check for async compatibility in HTTP.App
+    super.define(name, definition);
+
+    let resource = new Resource(definition);
+    let snapshot = Object.assign({
+      name: name,
+      names: { plural: pluralize(name) }
+    }, resource);
+
+    let address = snapshot.routes.list.split('/')[1];
+
+    // TODO: reconcile with server.define
+    // if (this.settings.verbosity >= 5) console.log('[WEB:SPA]', 'Defining for SPA:', name, definition);
+    let route = this.router.define(name, definition);
+    // if (this.settings.verbosity >= 5) console.log('[WEB:SPA]', 'Defined:', name, route);
+    this.types.state[name] = definition;
+    this.resources[name] = definition;
+
+    this.state[address] = {};
+
+    return this.resources[name];
+  }
+
+  // TODO: document this vs. @fabric/core/types/app
+  _defineElement (handle, definition) {
+    this.components[handle] = definition;
+
+    // TODO: custom elements polyfill
+    if (typeof customElements !== 'undefined') {
+      try {
+        customElements.define(handle, definition);
+      } catch (E) {
+        console.error('[MAKI:APP]', 'Could not define Custom Element:', E, handle, definition);
+      }
+    }
+  }
+
+  register () {
+    return this;
+  }
+
+  route (path) {
+    for (let i = 0; i < this.routes.length; i++) {
+      console.log('[MAKI:SPA]', 'testing route:', this.routes[i]);
+    }
+  }
+
+  disconnectedCallback () {
+    for (let name in this._boundFunctions) {
+      this.removeEventListener('message', this._boundFunctions[name]);
+    }
+  }
+
+  _handleClick (e) {
+    console.log('SPA CLICK EVENT:', e);
+  }
+
+  async _handleNavigation (ctx) {
+    let address = await this.browser.route(ctx.path);
+    let element = document.createElement(address.route.component);
+
+    this.target = element;
+
+    this.browser._setAddress(ctx.path);
+    this.browser._setElement(element);
+
+    element.state = (typeof window !== 'undefined' && window.app) ? window.app.state : this.state; 
+  }
+
+  /* async _loadIndex (ctx) {
+    console.log('[WEB:SPA]','loading index, app:', this);
+    console.log('[WEB:SPA]','loading index, app.settings:', this.settings);
+    console.log('[WEB:SPA]','loading index, ctx:', ctx);
+    console.log('[WEB:SPA]','all components:', Object.keys(this.components));
+    console.log('[WEB:SPA]','Seeking for index:', this.settings.components.index);
+    let address = await this.browser.route(ctx.path);
+    let Index = this.components[this.settings.components.index];
+    if (!Index) throw new Error(`Could not find component: ${this.settings.components.index}`);
+    let resource = new Index(this.state);
+    let content = resource.render();
+    // this._setTitle(resource.name);
+    // this._renderContent(content);
+
+    let element = document.createElement(address.route.component);
+    console.log('created element:', element);
+
+    this.target = element;
+
+    this.browser._setAddress(ctx.path);
+    this.browser._setElement(element);
+
+    for (let name in this.state) {
+      element.state[name] = this.state[name];
+    }
+  } */
+
+  _setTitle (title) {
+    this.title = `${title} &middot; ${this.settings.name}`;
+    document.querySelector('title').innerHTML = this.title;
+  }
+
+  _redraw (state = {}) {
+    if (!state) state = this.state;
+    // if (this.settings && this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'redrawing with state:', state);
+    this.innerHTML = this._getInnerHTML(state);
+    // this.init(state);
+    return this;
+  }
+
+  _renderContent (html) {
+    // TODO: enable multi-view composition?
+    // NOTE: this means to iterate over all bound targets, instead of the first one...
+    if (!this.target) this.target = document.querySelector(BROWSER_TARGET);
+    if (!this.target) return console.log('COULD NOT ACQUIRE TARGET:', document);
+    this.target.innerHTML = html;
+    return this.target;
+  }
+
+  _renderWith (html) {
+    let hash = crypto.createHash('sha256').update(html).digest('hex');
+
+    // TODO: move CSS to inline from webpack
+    return `<!DOCTYPE html>
+<html lang="${this.settings.language}"${(this.settings.offline) ? 'manifest="cache.manifest"' : ''}>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>${this.title}</title>
+  <!-- <link rel="manifest" href="/manifest.json"> -->
+  <link rel="stylesheet" type="text/css" href="/styles/screen.css" />
+  <link rel="stylesheet" type="text/css" href="/styles/semantic.css" />
+</head>
+<body data-bind="${hash}">${html}</body>
+<script type="text/javascript" src="/scripts/jquery-3.4.1.js"></script>
+<script type="text/javascript" src="/scripts/semantic.js"></script>
+</html>`;
+  }
+
+  /**
+   * Return a string of HTML for the application.
+   * @return {String} Fully-rendered HTML document.
+   */
+  render () {
+    let body = super.render();
+    // TODO: define Custom Element
+    // let app = SPA.toString('base64');
+    // definition = customElements.define(name, SPA);
+
+    return this._renderWith(body);
+  }
+
+  async stop () {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Stopping...');
+
+    try {
+      if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Stopping bridge...');
+      await this.bridge.stop();
+    } catch (E) {
+      console.error('Could not stop SPA bridge:', E);
+    }
+
+    try {
+      if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Stopping router...');
+      await this.router.stop();
+    } catch (E) {
+      console.error('Could not stop SPA router:', E);
+    }
+
+    try {
+      if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Stopping store...');
+      await this.store.stop();
+    } catch (E) {
+      console.error('Could not stop SPA store:', E);
+    }
+
+    // await super.stop();
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Stopped!');
+    return this;
+  }
+
+  async _handleBridgeMessage (msg) {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Handling message from Bridge:', msg);
+    if (!msg.type && msg['@type']) msg.type = msg['@type'];
+    if (!msg.data && msg['@data']) msg.data = msg['@data'];
+
+    switch (msg.type) {
+      default:
+        console.warn('[HTTP:SPA]', 'Unhandled message type (origin: bridge)', msg.type);
+        break;
+      case 'Receipt':
+        console.log('Receipt for your message:', msg);
+        break;
+      case 'Pong':
+        console.log('Received pong:', msg.data);
+        let time = new Date(msg.data / 1000);
+        console.log('time:', time, time.toISOString());
+      case 'Ping':
+        const now = Date.now();
+        const message = Message.fromVector(['Pong', now.toString()]);
+        const pong = JSON.stringify(message.toObject());
+        this.bridge.send(pong);
+        break;
+      case 'State':
+        console.log('RAD STATE:', msg);
+        this.state = msg.data;
+        break;
+      case 'Transaction':
+        this._applyChanges(msg['@data']['changes']);
+        await this.commit();
+        break;
+      case 'GenericMessage':
+        console.warn('[AUDIT]', 'GENERIC MESSAGE:', msg);
+        break;
+    }
+  }
+
+  async start () {
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Starting...');
+    // await super.start();
+
+    this.on('error', (error) => {
+      console.error('got error:', error);
+    });
+
+    this.bridge.on('message', this._handleBridgeMessage.bind(this));
+
+    if (this.settings.persistent) {
+      try {
+        if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Starting bridge...');
+        await this.store.start();
+      } catch (E) {
+        console.error('Could not start SPA store:', E);
+      }
+    }
+
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Defining resources from settings...');
+
+    /* Resources */
+    for (let name in this.settings.resources) {
+      if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Defining Resource:', name);
+      let definition = this.settings.resources[name];
+      let plural = pluralize(name);
+      let resource = await this.define(name, definition);
+      // console.log('[AUDIT]', 'Created resource:', resource);
+
+      // this.router._addFlat(`/${plural.toLowerCase()}`, definition);
+      this.router._addRoute(`/${plural.toLowerCase()}/:id`, definition.components.view);
+      this.router._addRoute(`/${plural.toLowerCase()}`, definition.components.list);
+
+      // add menu items & handler
+      if (!definition.hidden) {
+        this.menu._addItem({ name: plural, path: `/${plural.toLowerCase()}`, icon: definition.icon });
+      }
+
+      // page.js router...
+      this.handler(`/${plural.toLowerCase()}`, this._handleNavigation.bind(this));
+      this.handler(`/${plural.toLowerCase()}/:id`, this._handleNavigation.bind(this));
+    }
+
+    /* Components */
+    for (let name in this.settings.components) {
+      if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Defining Component:', name);
+      let definition = this.settings.components[name];
+      // TODO: consider async _defineElement (define at `function _defineElement`)
+      let component = this._defineElement(name, definition);
+    }
+
+    /* Services */
+    try {
+      if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Starting router...');
+      await this.router.start();
+    } catch (E) {
+      console.error('Could not start SPA router:', E);
+    }
+
+    if (this.settings.websockets) {
+      try {
+        if (this.settings.verbosity >= 5) console.log('[HTTP:SPA]', 'Starting bridge...');
+        this.bridge.start();
+      } catch (exception) {
+        console.error('Could not connect to bridge:', exception);
+      }
+    }
+
+    /* HTML-specific traits */
+    // Set page title
+    this.title = `${this.settings.synopsis} &middot; ${this.settings.name}`;
+
+    if (this.settings.verbosity >= 4) console.log('[HTTP:SPA]', 'Started!');
+    return this;
+  }
+}
+
+module.exports = SPA;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/docs/types_wallet.js.html b/docs/types_wallet.js.html new file mode 100644 index 00000000..c6e44779 --- /dev/null +++ b/docs/types_wallet.js.html @@ -0,0 +1,167 @@ + + + + + Source: types/wallet.js · Docs + + + + + + + +
+

Source: types/wallet.js

+ + + + + +
+
+
'use strict';
+
+const Fabric = require('@fabric/core');
+const bcoin = require('bcoin/lib/bcoin-browser').set('regtest');
+
+const WalletDB = bcoin.WalletDB;
+const WalletKey = bcoin.wallet.WalletKey;
+const KeyRing = bcoin.KeyRing;
+const Mnemonic = bcoin.hd.Mnemonic;
+const HD = bcoin.hd;
+
+/**
+ * Manage keys and track their balances.
+ * @type {Object}
+ */
+class Wallet extends Fabric.Service {
+  /**
+   * Create an instance of a {@link Wallet}.
+   * @param  {Object} [settings={}] Configure the wallet.
+   * @return {Wallet}               Instance of the wallet.
+   */
+  constructor (settings = {}) {
+    super(settings);
+
+    this.settings = Object.assign({
+      name: 'default',
+      network: 'regtest'
+    }, settings);
+
+    this.database = new WalletDB({
+      db: 'memory',
+      network: 'regtest'
+    });
+
+    this.account = null;
+    this.manager = null;
+    this.wallet = null;
+    this.master = null;
+    this.seed = null;
+
+    this.words = Mnemonic.getWordlist('english').words;
+    this.mnemonic = new Mnemonic();
+
+    this.status = 'closed';
+
+    return this;
+  }
+
+  _handleWalletTransaction (tx) {
+    console.log('[BRIDGE:WALLET]', 'incoming transaction:', tx);
+  }
+
+  _getDepositAddress () {
+    return this.address;
+  }
+
+  _getSeed () {
+    return this.seed;
+  }
+
+  _getAccountByIndex (index = 0) {
+    return {
+      address: this.account.deriveReceive(index).getAddress('string')
+    };
+  }
+
+  async _handleWalletBalance (balance) {
+    console.log('wallet balance:', balance);
+    await this._PUT(`/balance`, balance);
+
+    let depositor = new Fabric.State({ name: 'eric' });
+    await this._PUT(`/depositors/${depositor.id}/balance`, balance);
+    this.emit('balance', balance);
+  }
+
+  async _registerAccount (obj) {
+    this.status = 'creating';
+
+    if (!this.database.db.loaded) {
+      await this.database.open();
+    }
+
+    try {
+      this.wallet = await this.database.create();
+    } catch (E) {
+      console.error('Could not create wallet:', E);
+    }
+
+    if (this.manager) {
+      this.manager.on('tx', this._handleWalletTransaction.bind(this));
+      this.manager.on('balance', this._handleWalletBalance.bind(this));
+    }
+
+    return this.account;
+  }
+
+  async _unload () {
+    return this.database.close();
+  }
+
+  async _load (settings = {}) {
+    let self = this;
+
+    this.status = 'loading';
+
+    await this.database.open();
+
+    this.wallet = await this.database.create();
+    this.account = await this.wallet.getAccount('default');
+    this.address = await this.account.receiveAddress();
+    this.seed = this.wallet.master.mnemonic.phrase;
+
+    this.status = 'loaded';
+
+    this.emit('ready');
+
+    console.log('[FABRIC:WALLET]', 'Wallet opened:', this.wallet);
+
+    return this.wallet;
+  }
+
+  async start () {
+    return this._load();
+  }
+}
+
+module.exports = Wallet;
+
+
+
+ + + + +
+ +
+ + + + + diff --git a/package-lock.json b/package-lock.json index 6cbb5886..b6e3e532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,71 +9,159 @@ "version": "0.1.0-RC1", "license": "MIT", "dependencies": { - "body-parser": "^1.18.3", - "cross-fetch": "^3.1.5", - "d3": "^5.9.2", - "d3-graphviz": "^2.6.1", - "express": "^4.16.4", + "body-parser": "^1.20.0", + "d3": "^7.4.4", + "d3-graphviz": "^4.1.1", + "express": "^4.18.1", "express-bearer-token": "^2.4.0", - "express-session": "^1.15.6", + "express-session": "^1.17.3", "http-server": "^14.1.1", "isomorphic-ws": "^4.0.1", "jade-lexer": "0.0.9", "jade-parser": "0.0.9", - "jquery": "^3.4.1", - "level": "5", + "jquery": "^3.6.0", + "js-beautify": "^1.14.3", + "jsdoc": "FabricLabs/jsdoc#fabric", + "level": "8", "lightning-client": "^0.5.2-beta.8", "lodash.merge": "^4.6.2", - "metascraper": "^5.29.5", - "page": "^1.11.4", - "path-to-regexp": "^6.1.0", - "peer": "^0.2.10", - "peerjs": "^1.0.0", - "pluralize": "^7.0.0", + "metascraper": "^5.29.8", + "node-fetch": "^3.2.6", + "page": "^1.11.6", + "path-to-regexp": "^6.2.1", + "peer": "^0.6.1", + "peerjs": "^1.4.6", + "pluralize": "^8.0.0", + "rollup-plugin-polyfill-node": "^0.10.1", "stoppable": "^1.1.0", - "ws": "^6.2.1" + "ws": "^8.8.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^21.1.0", + "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.2.1", - "@rollup/plugin-typescript": "^8.3.2", + "@rollup/plugin-node-resolve": "^13.3.0", + "@rollup/plugin-typescript": "^8.3.3", + "cross-fetch": "^3.1.5", "debug-trace": "^2.2.3", + "fast-json-patch": "^3.1.1", "gulp": "^4.0.2", - "js-beautify": "^1.10.0", - "jsdoc": "FabricLabs/jsdoc#fabric", - "jsdom": "^11.12.0", - "mocha": "^6.0.2", - "nyc": "^13.3.0", - "rollup": "^2.70.2", - "rollup-plugin-dts": "^4.2.1", - "semistandard": "^13.0.1", - "showdown": "^1.9.1", - "typescript": "^4.6.3" + "jsdom": "^19.0.0", + "mocha": "^10.0.0", + "nyc": "^15.1.0", + "rollup": "^2.75.6", + "rollup-plugin-dts": "^4.2.2", + "rollup-plugin-node-globals": "^1.4.0", + "semistandard": "^16.0.1", + "showdown": "^2.1.0", + "typescript": "^4.7.3" }, "peerDependencies": { "@fabric/core": "FabricLabs/fabric#feature/node-16" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz", + "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.2.tgz", + "integrity": "sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-compilation-targets": "^7.18.2", + "@babel/helper-module-transforms": "^7.18.0", + "@babel/helpers": "^7.18.2", + "@babel/parser": "^7.18.0", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.6.tgz", - "integrity": "sha512-AIwwoOS8axIC5MZbhNHRLKi3D+DMpvDf9XUcu3pIVAfOHFT45f4AoDAltRbHIQomCipkCZxrNkfpOEHhJz/VKw==", + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", + "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6", + "@babel/types": "^7.18.2", "@jridgewell/gen-mapping": "^0.3.0", "jsesc": "^2.5.1" }, @@ -81,68 +169,175 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz", + "integrity": "sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.17.10", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.20.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz", - "integrity": "sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q==", + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz", + "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz", - "integrity": "sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, "dependencies": { - "@babel/template": "^7.18.6", - "@babel/types": "^7.18.6" + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz", + "integrity": "sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.0", + "@babel/types": "^7.18.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz", + "integrity": "sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.18.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz", + "integrity": "sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg==", "dev": true, + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2" + }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -213,9 +408,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.6.tgz", - "integrity": "sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==", + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.4.tgz", + "integrity": "sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -225,33 +420,33 @@ } }, "node_modules/@babel/template": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz", - "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.6", - "@babel/types": "^7.18.6" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.6.tgz", - "integrity": "sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.6", - "@babel/helper-function-name": "^7.18.6", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.18.6", - "@babel/types": "^7.18.6", + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz", + "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-environment-visitor": "^7.18.2", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.18.0", + "@babel/types": "^7.18.2", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -283,21 +478,103 @@ "dev": true }, "node_modules/@babel/types": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.6.tgz", - "integrity": "sha512-NdBNzPDwed30fZdDQtVR7ZgaO4UKjuaQFH9VArS+HMnurlOY0JWN+4ROlu/iapMFwjRQU4pOG4StZfDmulEwGA==", + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz", + "integrity": "sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@fabric/core": { "version": "0.1.0-dev", - "resolved": "git+ssh://git@github.com/FabricLabs/fabric.git#df0a01cfdf0282bfe5e155158c992dab5482b537", + "resolved": "git+ssh://git@github.com/FabricLabs/fabric.git#d35eac2368f5739fe0f757a7f64e75bc2b7bde86", "license": "MIT", "peer": true, "dependencies": { @@ -366,30 +643,6 @@ "node": ">=10" } }, - "node_modules/@fabric/core/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/@fabric/core/node_modules/deferred-leveldown": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-7.0.0.tgz", @@ -418,6 +671,18 @@ "node": ">=10" } }, + "node_modules/@fabric/core/node_modules/fast-json-patch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", + "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", + "peer": true, + "dependencies": { + "fast-deep-equal": "^2.0.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/@fabric/core/node_modules/level": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level/-/level-7.0.1.tgz", @@ -549,40 +814,6 @@ "node": ">=10" } }, - "node_modules/@fabric/core/node_modules/node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "peer": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/@fabric/core/node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@fabric/core/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@fabric/zmq": { "version": "0.1.0", "resolved": "git+ssh://git@github.com/FabricLabs/fabric-zmq.git#b7a86035f74bac97f272d3adcd708546b034785d", @@ -600,48 +831,231 @@ "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, + "node_modules/@hpcc-js/wasm": { + "version": "1.12.8", + "resolved": "https://registry.npmjs.org/@hpcc-js/wasm/-/wasm-1.12.8.tgz", + "integrity": "sha512-n4q9ARKco2hpCLsuVaW6Az3cDVaua7B3DSONHkc49WtEzgY/btvcDG5Zr1P6PZDv0sQ7oPnAi9Y+W2DI++MgcQ==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "yargs": "^17.3.1" }, - "engines": { - "node": ">=6.0.0" + "bin": { + "dot-wasm": "bin/cli.js" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.8.tgz", - "integrity": "sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w==", - "dev": true, + "node_modules/@hpcc-js/wasm/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@hpcc-js/wasm/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@hpcc-js/wasm/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@hpcc-js/wasm/node_modules/yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@hpcc-js/wasm/node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", - "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -649,9 +1063,9 @@ } }, "node_modules/@metascraper/helpers": { - "version": "5.29.11", - "resolved": "https://registry.npmjs.org/@metascraper/helpers/-/helpers-5.29.11.tgz", - "integrity": "sha512-e9hboiNOVoghDImOXQIWsQccTyTSJRAtpUW0vALqGagxPqDfQ1IZwLpHpx9zBGa76kQEQcKpvyfVPtd3o6SEsg==", + "version": "5.29.7", + "resolved": "https://registry.npmjs.org/@metascraper/helpers/-/helpers-5.29.7.tgz", + "integrity": "sha512-YfhqbwErZdW3V/Bp5XBzEK8Q0apv+7eriQ+NKm7fctBUjx+BpbdMhncqX5r6gjnNAkcY1N2+KEt09WAg0n5spA==", "dependencies": { "audio-extensions": "0.0.0", "chrono-node": "2.3.8", @@ -664,13 +1078,13 @@ "is-uri": "~1.2.4", "iso-639-3": "~2.2.0", "isostring": "0.0.1", - "jsdom": "~20.0.0", + "jsdom": "~19.0.0", "lodash": "~4.17.21", "memoize-one": "~6.0.0", "microsoft-capitalize": "~1.0.5", "mime-types": "~2.1.35", "normalize-url": "~6.1.0", - "re2": "~1.17.7", + "re2": "~1.17.4", "smartquotes": "~2.3.2", "url-regex-safe": "~3.0.0", "video-extensions": "~1.2.0" @@ -679,366 +1093,101 @@ "node": ">= 12" } }, - "node_modules/@metascraper/helpers/node_modules/acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", - "bin": { - "acorn": "bin/acorn" - }, + "node_modules/@metascraper/helpers/node_modules/entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", "engines": { - "node": ">=0.4.0" + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/@metascraper/helpers/node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "peer": true, "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "node_modules/@metascraper/helpers/node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "bin": { - "acorn": "bin/acorn" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": ">=0.4.0" + "node": ">= 8" } }, - "node_modules/@metascraper/helpers/node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "peer": true, "engines": { - "node": ">=0.4.0" + "node": ">= 8" } }, - "node_modules/@metascraper/helpers/node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==" - }, - "node_modules/@metascraper/helpers/node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "peer": true, "dependencies": { - "cssom": "~0.3.6" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/@metascraper/helpers/node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" - }, - "node_modules/@metascraper/helpers/node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" - }, - "engines": { - "node": ">=12" + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" } }, - "node_modules/@metascraper/helpers/node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "node_modules/@npmcli/fs/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { - "webidl-conversions": "^7.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=12" - } - }, - "node_modules/@metascraper/helpers/node_modules/entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "node": ">=10" } }, - "node_modules/@metascraper/helpers/node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" + "lru-cache": "^6.0.0" }, "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" + "semver": "bin/semver.js" }, "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" + "node": ">=10" } }, - "node_modules/@metascraper/helpers/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/@npmcli/fs/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, "engines": { - "node": ">=4.0" - } - }, - "node_modules/@metascraper/helpers/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@metascraper/helpers/node_modules/jsdom": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.0.tgz", - "integrity": "sha512-x4a6CKCgx00uCmP+QakBDFXwjAJ69IkkIWHmtmjd3wvXPcdOS44hfX2vqkOQrVrq8l9DhNNADZRXaCEWvgXtVA==", - "dependencies": { - "abab": "^2.0.6", - "acorn": "^8.7.1", - "acorn-globals": "^6.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.3.1", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "^7.0.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^3.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.8.0", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/@metascraper/helpers/node_modules/parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "dependencies": { - "entities": "^4.3.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/@metascraper/helpers/node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@metascraper/helpers/node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@metascraper/helpers/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@metascraper/helpers/node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@metascraper/helpers/node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@metascraper/helpers/node_modules/ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/@metascraper/helpers/node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "peer": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", - "dependencies": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/fs/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/fs/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=10" } }, "node_modules/@npmcli/move-file/node_modules/rimraf": { @@ -1056,9 +1205,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "21.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz", - "integrity": "sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -1070,10 +1219,23 @@ "resolve": "^1.17.0" }, "engines": { - "node": ">= 8.0.0" + "node": ">= 12.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0" + } + }, + "node_modules/@rollup/plugin-inject": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "estree-walker": "^2.0.1", + "magic-string": "^0.25.7" }, "peerDependencies": { - "rollup": "^2.38.3" + "rollup": "^1.20.0 || ^2.0.0" } }, "node_modules/@rollup/plugin-json": { @@ -1135,7 +1297,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, "dependencies": { "@types/estree": "0.0.39", "estree-walker": "^1.0.1", @@ -1151,8 +1312,7 @@ "node_modules/@rollup/pluginutils/node_modules/estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" }, "node_modules/@swc/helpers": { "version": "0.3.17", @@ -1163,11 +1323,11 @@ } }, "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "engines": { - "node": ">= 10" + "node": ">= 6" } }, "node_modules/@ts-morph/common": { @@ -1182,54 +1342,85 @@ "path-browserify": "^1.0.1" } }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "peer": true, "dependencies": { "@types/node": "*" } }, + "node_modules/@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + }, "node_modules/@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" + }, + "node_modules/@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", - "peer": true, + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@types/lodash": { "version": "4.14.182", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", "peer": true }, + "node_modules/@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" + }, "node_modules/@types/node": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", - "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==" + "version": "17.0.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.39.tgz", + "integrity": "sha512-JDU3YLlnPK3WDao6/DlXLOgSNpG13ct+CwIO17V8q0/9fWJyeMJJ/VyZ1lv8kDprihvZMydzVwf0tQOqGiY2Nw==" }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "peer": true + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, "node_modules/@types/range-parser": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "peer": true + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, "node_modules/@types/resolve": { "version": "1.17.1", @@ -1240,17 +1431,31 @@ "@types/node": "*" } }, + "node_modules/@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "peer": true, "dependencies": { "@types/node": "*" } }, - "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "peer": true, @@ -1304,16 +1509,21 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, - "node_modules/abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "node_modules/abstract-level": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", + "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", "dependencies": { - "level-concat-iterator": "~2.0.0", - "xtend": "~4.0.0" + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" }, "engines": { - "node": ">=6" + "node": ">=12" } }, "node_modules/accepts": { @@ -1340,20 +1550,18 @@ } }, "node_modules/acorn-globals": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", - "dev": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dependencies": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" } }, "node_modules/acorn-globals/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "bin": { "acorn": "bin/acorn" }, @@ -1362,10 +1570,9 @@ } }, "node_modules/acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", - "dev": true, + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "engines": { "node": ">=0.4.0" } @@ -1472,15 +1679,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/ajv/node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1499,15 +1697,6 @@ "node": ">=0.10.0" } }, - "node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/ansi-gray": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", @@ -1585,6 +1774,18 @@ "node": ">=0.10.0" } }, + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", @@ -1614,24 +1815,10 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -1696,12 +1883,6 @@ "node": ">=0.10.0" } }, - "node_modules/array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA==", - "dev": true - }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -1792,6 +1973,15 @@ "node": ">=0.10.0" } }, + "node_modules/array-sort/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -1801,17 +1991,16 @@ "node": ">=0.10.0" } }, - "node_modules/array.prototype.reduce": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz", - "integrity": "sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw==", + "node_modules/array.prototype.flat": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.2", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -1820,22 +2009,22 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "node_modules/array.prototype.flatmap": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", + "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", "dev": true, "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true, + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, "engines": { - "node": ">=0.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/assign-symbols": { @@ -1847,6 +2036,15 @@ "node": ">=0.10.0" } }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/async": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", @@ -1874,11 +2072,6 @@ "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, - "node_modules/async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, "node_modules/async-settle": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", @@ -1916,98 +2109,10 @@ "node": ">=0.10.0" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, - "node_modules/babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "node_modules/babel-code-frame/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", - "dev": true - }, - "node_modules/babel-code-frame/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/babylon": { "version": "7.0.0-beta.19", "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true, "bin": { "babylon": "bin/babylon.js" }, @@ -2520,15 +2625,6 @@ "license": "MIT", "peer": true }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/bech32": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", @@ -2686,8 +2782,7 @@ "node_modules/bluebird": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", - "dev": true + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" }, "node_modules/bn.js": { "version": "4.12.0", @@ -2759,6 +2854,17 @@ "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", "peer": true }, + "node_modules/browser-level": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", + "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.1", + "module-error": "^1.0.2", + "run-parallel-limit": "^1.1.0" + } + }, "node_modules/browser-process-hrtime": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", @@ -2770,6 +2876,35 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "node_modules/browserslist": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz", + "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001332", + "electron-to-chromium": "^1.4.118", + "escalade": "^3.1.1", + "node-releases": "^2.0.3", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/bs58": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bs58/-/bs58-3.1.0.tgz", @@ -2809,9 +2944,9 @@ } }, "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -2828,7 +2963,7 @@ ], "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "ieee754": "^1.2.1" } }, "node_modules/buffer-equal": { @@ -2840,6 +2975,12 @@ "node": ">=0.4.0" } }, + "node_modules/buffer-es6": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/buffer-es6/-/buffer-es6-4.9.3.tgz", + "integrity": "sha512-Ibt+oXxhmeYJSsCkODPqNpPmyegefiD8rfutH1NYGhMZQhSp95Rz7haemgnJ6dxa6LT+JLLbtgOMORRluwKktw==", + "dev": true + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2873,73 +3014,39 @@ } }, "node_modules/cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", "dependencies": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", + "ssri": "^8.0.1", + "tar": "^6.0.2", "unique-filename": "^1.1.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/cacache/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 10" } }, "node_modules/cacache/node_modules/lru-cache": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.2.tgz", - "integrity": "sha512-9zDbhgmXAUvUMPV81A705K3tVzcPiZL3Bf5/5JC/FjYJlLZ5AJCeqIRFHJqyBppiLosqF+uKB7p8/RDXylqBIw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/cacache/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { - "brace-expansion": "^2.0.1" + "yallist": "^4.0.0" }, "engines": { "node": ">=10" @@ -2959,63 +3066,44 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacache/node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } + "node_modules/cacache/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, - "node_modules/cacache/node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/cacache/node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "node": ">=0.10.0" } }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/call-bind": { @@ -3030,18 +3118,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha512-UJiE1otjXPF5/x+T3zTnSFiTOEmJoGTD9HmBoxnCUwho61a2eSNn/VwtwuIBDAo2SEOv1AJ7ARI5gCmohFLu/g==", - "dev": true, - "dependencies": { - "callsites": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", @@ -3052,34 +3128,42 @@ } }, "node_modules/callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha512-Zv4Dns9IbXXmPkgRRUjAaJQgfN4xX5p6+RQFhWUqscdvvK2xK/ZL8b3IXIJsj+4sD+f24NwnWy2BY8AJ82JB0A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", - "dev": true, + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "node_modules/caniuse-lite": { + "version": "1.0.30001346", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001346.tgz", + "integrity": "sha512-q6ibZUO2t88QCIPayP/euuDREq+aMAxFE5S70PkrLh0iTDj/zEhgvJRKC2+CvXY6EWc6oQwUR48lL5vCW6jiXQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] }, "node_modules/catering": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "peer": true, "engines": { "node": ">=6" } @@ -3088,7 +3172,6 @@ "version": "0.8.11", "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", - "dev": true, "dependencies": { "lodash": "^4.17.14" }, @@ -3119,16 +3202,10 @@ "is-regex": "^1.0.3" } }, - "node_modules/chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==", - "dev": true - }, "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz", + "integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -3136,7 +3213,8 @@ "domutils": "^3.0.1", "htmlparser2": "^8.0.1", "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "tslib": "^2.4.0" }, "engines": { "node": ">= 6" @@ -3206,6 +3284,28 @@ "fsevents": "^1.2.7" } }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/chokidar/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -3232,13 +3332,6 @@ "safe-buffer": "^5.0.1" } }, - "node_modules/circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "deprecated": "CircularJSON is in maintenance only, flatted is its successor.", - "dev": true - }, "node_modules/class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -3334,31 +3427,38 @@ "node": ">=0.10.0" } }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "node_modules/class-utils/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", - "dev": true, + "node_modules/classic-level": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", + "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "hasInstallScript": true, "dependencies": { - "restore-cursor": "^2.0.0" + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "^4.3.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "engines": { + "node": ">=6" + } }, "node_modules/clightningjs": { "version": "0.2.2", @@ -3367,61 +3467,13 @@ "peer": true }, "node_modules/cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, "node_modules/clone": { @@ -3459,6 +3511,27 @@ "readable-stream": "^2.3.5" } }, + "node_modules/cloneable-readable/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/cloneable-readable/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/code-block-writer": { "version": "10.1.1", "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.1.tgz", @@ -3577,6 +3650,27 @@ "typedarray": "^0.0.6" } }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/condense-whitespace": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/condense-whitespace/-/condense-whitespace-2.0.0.tgz", @@ -3599,15 +3693,6 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, - "node_modules/contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha512-OKZnPGeMQy2RPaUIBPFFd71iNf4791H12MCRuVQDnzGRwCYNYmTDy5pdafo2SLAcEMKzTOQnLWG4QdcjeJUMEg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -3751,73 +3836,135 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dev": true, "dependencies": { "node-fetch": "2.6.7" } }, - "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/cross-fetch/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dev": true, "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">=4.8" - } - }, - "node_modules/crypto-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", - "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", - "peer": true - }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" + "node": "4.x || >=6.0.0" }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "engines": { - "node": ">= 6" + "peerDependencies": { + "encoding": "^0.1.0" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "node_modules/cross-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, - "node_modules/cssstyle": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", - "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", + "node_modules/cross-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/cross-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { - "cssom": "0.3.x" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", + "peer": true + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==" + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" } }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -3829,339 +3976,544 @@ } }, "node_modules/d3": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/d3/-/d3-5.16.0.tgz", - "integrity": "sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==", - "dependencies": { - "d3-array": "1", - "d3-axis": "1", - "d3-brush": "1", - "d3-chord": "1", - "d3-collection": "1", - "d3-color": "1", - "d3-contour": "1", - "d3-dispatch": "1", - "d3-drag": "1", - "d3-dsv": "1", - "d3-ease": "1", - "d3-fetch": "1", - "d3-force": "1", - "d3-format": "1", - "d3-geo": "1", - "d3-hierarchy": "1", - "d3-interpolate": "1", - "d3-path": "1", - "d3-polygon": "1", - "d3-quadtree": "1", - "d3-random": "1", - "d3-scale": "2", - "d3-scale-chromatic": "1", - "d3-selection": "1", - "d3-shape": "1", - "d3-time": "1", - "d3-time-format": "2", - "d3-timer": "1", - "d3-transition": "1", - "d3-voronoi": "1", - "d3-zoom": "1" + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.4.4.tgz", + "integrity": "sha512-97FE+MYdAlV3R9P74+R3Uar7wUKkIFu89UWMjEaDhiJ9VxKvqaMxauImy8PC2DdBkdM2BxJOIoLxPrcZUyrKoQ==", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "3", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.1.6.tgz", + "integrity": "sha512-DCbBBNuKOeiR9h04ySRBMW52TFVc91O9wJziuyXw6Ztmy8D3oZbmCkOO3UHKC7ceNJsN2Mavo9+vwV8EAEUXzA==", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } }, "node_modules/d3-axis": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-1.0.12.tgz", - "integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "engines": { + "node": ">=12" + } }, "node_modules/d3-brush": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.6.tgz", - "integrity": "sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", "dependencies": { - "d3-dispatch": "1", - "d3-drag": "1", - "d3-interpolate": "1", - "d3-selection": "1", - "d3-transition": "1" + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush/node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" } }, "node_modules/d3-chord": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-1.0.6.tgz", - "integrity": "sha512-JXA2Dro1Fxw9rJe33Uv+Ckr5IrAa74TlfDEhE/jfLOaXegMQFQTAgAw9WnZL8+HxVBRXaRGCkrNU7pJeylRIuA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", "dependencies": { - "d3-array": "1", - "d3-path": "1" + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" } }, - "node_modules/d3-collection": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", - "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==" - }, "node_modules/d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "engines": { + "node": ">=12" + } }, "node_modules/d3-contour": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-1.3.2.tgz", - "integrity": "sha512-hoPp4K/rJCu0ladiH6zmJUEz6+u3lgR+GSm/QdM2BBvDraU39Vr7YdDCicJcxP1z8i9B/2dJLgDC1NcvlF8WCg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-3.0.1.tgz", + "integrity": "sha512-0Oc4D0KyhwhM7ZL0RMnfGycLN7hxHB8CMmwZ3+H26PWAG0ozNuYG5hXSDNgmP1SgJkQMrlG6cP20HoaSbvcJTQ==", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.2.tgz", + "integrity": "sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ==", "dependencies": { - "d3-array": "^1.1.1" + "delaunator": "5" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-dispatch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "engines": { + "node": ">=12" + } }, "node_modules/d3-drag": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", - "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", "dependencies": { - "d3-dispatch": "1", - "d3-selection": "1" + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag/node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" } }, "node_modules/d3-dsv": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.2.0.tgz", - "integrity": "sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", "dependencies": { - "commander": "2", - "iconv-lite": "0.4", + "commander": "7", + "iconv-lite": "0.6", "rw": "1" }, "bin": { - "csv2json": "bin/dsv2json", - "csv2tsv": "bin/dsv2dsv", - "dsv2dsv": "bin/dsv2dsv", - "dsv2json": "bin/dsv2json", - "json2csv": "bin/json2dsv", - "json2dsv": "bin/json2dsv", - "json2tsv": "bin/json2dsv", - "tsv2csv": "bin/dsv2dsv", - "tsv2json": "bin/dsv2json" + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-dsv/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-dsv/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/d3-ease": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", - "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "engines": { + "node": ">=12" + } }, "node_modules/d3-fetch": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.2.0.tgz", - "integrity": "sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", "dependencies": { - "d3-dsv": "1" + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-force": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", - "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", "dependencies": { - "d3-collection": "1", - "d3-dispatch": "1", - "d3-quadtree": "1", - "d3-timer": "1" + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-format": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", - "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "engines": { + "node": ">=12" + } }, "node_modules/d3-geo": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", - "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.0.1.tgz", + "integrity": "sha512-Wt23xBych5tSy9IYAM1FR2rWIBFWa52B/oF/GYe5zbdHrg08FU8+BuI6X4PvTwPDdqdAdq04fuWJpELtsaEjeA==", "dependencies": { - "d3-array": "1" + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" } }, "node_modules/d3-graphviz": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/d3-graphviz/-/d3-graphviz-2.6.1.tgz", - "integrity": "sha512-878AFSagQyr5tTOrM7YiVYeUC2/NoFcOB3/oew+LAML0xekyJSw9j3WOCUMBsc95KYe9XBYZ+SKKuObVya1tJQ==", - "dependencies": { - "d3-dispatch": "^1.0.3", - "d3-format": "^1.2.0", - "d3-interpolate": "^1.1.5", - "d3-path": "^1.0.5", - "d3-selection": "^1.1.0", - "d3-timer": "^1.0.6", - "d3-transition": "^1.1.1", - "d3-zoom": "^1.5.0", - "viz.js": "^1.8.2" - } - }, - "node_modules/d3-hierarchy": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==" - }, - "node_modules/d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", - "dependencies": { - "d3-color": "1" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/d3-graphviz/-/d3-graphviz-4.1.1.tgz", + "integrity": "sha512-s0IVbKf8rs4eJI2xo5Umr7nXDX/LEZw/x2WtKxmlyQxR0qUY49UiLhBNOX7VDHZywMle43NKEXnU6fn22fpJvQ==", + "dependencies": { + "@hpcc-js/wasm": "1.12.8", + "d3-dispatch": "^2.0.0", + "d3-format": "^2.0.0", + "d3-interpolate": "^2.0.1", + "d3-path": "^2.0.0", + "d3-timer": "^2.0.0", + "d3-transition": "^2.0.0", + "d3-zoom": "^2.0.0" + }, + "peerDependencies": { + "d3-selection": "^2.0.0" } }, - "node_modules/d3-path": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", - "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" - }, - "node_modules/d3-polygon": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-1.0.6.tgz", - "integrity": "sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ==" - }, - "node_modules/d3-quadtree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", - "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==" + "node_modules/d3-graphviz/node_modules/d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" }, - "node_modules/d3-random": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-1.1.2.tgz", - "integrity": "sha512-6AK5BNpIFqP+cx/sreKzNjWbwZQCSUatxq+pPRmFIQaWuoD+NrbVWw7YWpHiXpCQ/NanKdtGDuB+VQcZDaEmYQ==" + "node_modules/d3-graphviz/node_modules/d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-2.0.0.tgz", + "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" }, - "node_modules/d3-scale": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-2.2.2.tgz", - "integrity": "sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw==", + "node_modules/d3-graphviz/node_modules/d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-2.0.0.tgz", + "integrity": "sha512-g9y9WbMnF5uqB9qKqwIIa/921RYWzlUDv9Jl1/yONQwxbOfszAWTCm8u7HOTgJgRDXiRZN56cHT9pd24dmXs8w==", "dependencies": { - "d3-array": "^1.2.0", - "d3-collection": "1", - "d3-format": "1", - "d3-interpolate": "1", - "d3-time": "1", - "d3-time-format": "2" + "d3-dispatch": "1 - 2", + "d3-selection": "2" } }, - "node_modules/d3-scale-chromatic": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz", - "integrity": "sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg==", - "dependencies": { - "d3-color": "1", - "d3-interpolate": "1" - } + "node_modules/d3-graphviz/node_modules/d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", + "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" }, - "node_modules/d3-selection": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" + "node_modules/d3-graphviz/node_modules/d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" }, - "node_modules/d3-shape": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", - "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "node_modules/d3-graphviz/node_modules/d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", "dependencies": { - "d3-path": "1" + "d3-color": "1 - 2" } }, - "node_modules/d3-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", - "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" + "node_modules/d3-graphviz/node_modules/d3-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-2.0.0.tgz", + "integrity": "sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA==" }, - "node_modules/d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", + "node_modules/d3-graphviz/node_modules/d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", + "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + }, + "node_modules/d3-graphviz/node_modules/d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", + "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", "dependencies": { - "d3-time": "1" + "d3-color": "1 - 2", + "d3-dispatch": "1 - 2", + "d3-ease": "1 - 2", + "d3-interpolate": "1 - 2", + "d3-timer": "1 - 2" + }, + "peerDependencies": { + "d3-selection": "2" } }, - "node_modules/d3-timer": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" - }, - "node_modules/d3-transition": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", - "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", + "node_modules/d3-graphviz/node_modules/d3-zoom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-2.0.0.tgz", + "integrity": "sha512-fFg7aoaEm9/jf+qfstak0IYpnesZLiMX6GZvXtUSdv8RH2o4E2qeelgdU09eKS6wGuiGMfcnMI0nTIqWzRHGpw==", "dependencies": { - "d3-color": "1", - "d3-dispatch": "1", - "d3-ease": "1", - "d3-interpolate": "1", - "d3-selection": "^1.1.0", - "d3-timer": "1" + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" } }, - "node_modules/d3-voronoi": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.4.tgz", - "integrity": "sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==" - }, - "node_modules/d3-zoom": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", - "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", - "dependencies": { - "d3-dispatch": "1", - "d3-drag": "1", - "d3-interpolate": "1", - "d3-selection": "1", - "d3-transition": "1" + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "engines": { + "node": ">=12" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", "dependencies": { - "assert-plus": "^1.0.0" + "d3-color": "1 - 3" }, "engines": { - "node": ">=0.10" + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.0.1.tgz", + "integrity": "sha512-gq6gZom9AFZby0YLduxT1qmrp4xpBA1YZr19OI717WIdKE2OM5ETq5qrHLb301IgxhLwcuxvGZVLeeWc/k1I6w==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz", + "integrity": "sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", + "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" + }, + "node_modules/d3-shape": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.1.0.tgz", + "integrity": "sha512-tGDh1Muf8kWjEDT/LswZJ8WF85yDZLvVJpYU9Nq+8+yW1Z5enxrmXOhTArlkaElU+CTn0OTVNli+/i+HP45QEQ==", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.0.0.tgz", + "integrity": "sha512-zmV3lRnlaLI08y9IMRXSDshQb5Nj77smnfpnd2LrBa/2K281Jijactokeak14QacHs/kKq0AQ121nidNYlarbQ==", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "engines": { + "node": ">= 12" } }, "node_modules/data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", - "dev": true, + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "dependencies": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/data-urls/node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/dayjs": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.3.tgz", - "integrity": "sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==" + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.2.tgz", + "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" }, "node_modules/debug": { "version": "2.6.9", @@ -4171,15 +4523,6 @@ "ms": "2.0.0" } }, - "node_modules/debug-log": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha512-gV/pe1YIaKNgLYnd1g9VNW80tcb7oV5qvNUxG7NM8rbDpnl6RGunzlAtlGSb0wEs3nesu2vHNiX9TSsZ+Y+RjA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/debug-trace": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/debug-trace/-/debug-trace-2.2.3.tgz", @@ -4193,7 +4536,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4238,40 +4580,43 @@ "node": ">=0.10.0" } }, - "node_modules/default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==", + "node_modules/default-compare/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "node_modules/default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, "dependencies": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" + "strip-bom": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/deferred-leveldown/node_modules/abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, + "node_modules/default-require-extensions/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==", + "dev": true, + "engines": { + "node": ">= 0.10" } }, "node_modules/define-properties": { @@ -4309,27 +4654,12 @@ "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==", "peer": true }, - "node_modules/deglob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-3.1.0.tgz", - "integrity": "sha512-al10l5QAYaM/PeuXkAr1Y9AQz0LCtWsnJG23pIgh44hDxHFOj36l6qvhfjnIWBYwZOqM1fXUFV9tkjL7JPdGvw==", - "dev": true, + "node_modules/delaunator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.0.tgz", + "integrity": "sha512-AyLvtyJdbv/U1GkiS6gUUzclRoAY4Gs75qkMygJJhU75LW4DNuSF2RMzpxs9jw9Oz1BobHjTdkG3zdP55VxAqw==", "dependencies": { - "find-root": "^1.0.0", - "glob": "^7.0.5", - "ignore": "^5.0.0", - "pkg-config": "^1.1.0", - "run-parallel": "^1.1.2", - "uniq": "^1.0.1" - } - }, - "node_modules/deglob/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" + "robust-predicates": "^3.0.0" } }, "node_modules/delay": { @@ -4393,24 +4723,24 @@ } }, "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=6.0.0" } }, "node_modules/dom-serializer": { @@ -4449,12 +4779,14 @@ ] }, "node_modules/domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dependencies": { - "webidl-conversions": "^4.0.2" + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/domhandler": { @@ -4502,6 +4834,27 @@ "stream-shift": "^1.0.0" } }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/each-props": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", @@ -4524,16 +4877,6 @@ "node": ">=0.10.0" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/ecpair": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ecpair/-/ecpair-2.0.1.tgz", @@ -4582,6 +4925,12 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, + "node_modules/electron-to-chromium": { + "version": "1.4.146", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz", + "integrity": "sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg==", + "dev": true + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -4619,35 +4968,6 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "dependencies": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/encoding-down/node_modules/abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/encoding/node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -4669,11 +4989,31 @@ "once": "^1.4.0" } }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/enquirer/node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, "node_modules/env-paths": { "version": "2.2.1", @@ -4688,17 +5028,6 @@ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" }, - "node_modules/errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", - "dependencies": { - "prr": "~1.0.1" - }, - "bin": { - "errno": "cli.js" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4745,30 +5074,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-abstract/node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "has": "^1.0.3" } }, - "node_modules/es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true - }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -4801,6 +5115,12 @@ "node": ">=0.10" } }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "node_modules/es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", @@ -4849,6 +5169,14 @@ "es6-symbol": "^3.1.1" } }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -4858,19 +5186,17 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dev": true, + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dependencies": { "esprima": "^4.0.1", - "estraverse": "^4.2.0", + "estraverse": "^5.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1" }, @@ -4879,99 +5205,130 @@ "esgenerate": "bin/esgenerate.js" }, "engines": { - "node": ">=4.0" + "node": ">=6.0" }, "optionalDependencies": { "source-map": "~0.6.1" } }, "node_modules/eslint": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", - "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", - "dev": true, - "dependencies": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", - "esquery": "^1.0.1", + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.2", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.0", - "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^4.0.3", - "text-table": "^0.2.0" + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-semistandard": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-13.0.0.tgz", - "integrity": "sha512-ZuImKnf/9LeZjr6dtRJ0zEdQbjBwXu0PJR3wXJXoQeMooICMrYPyD70O1tIA9Ng+wutgLjB7UXvZOKYPvzHg+w==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-16.0.0.tgz", + "integrity": "sha512-oD8QOo4mSInRJhQb3Zi6L8HebwZaB6SI3A+NNrPdVN0nN1K45L5pXK3joY+ksWDlT3ew/M+fJk2tuMCjIpjRzQ==", "dev": true, "peerDependencies": { - "eslint": ">=5.4.0", - "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": ">=2.14.0", - "eslint-plugin-node": ">=7.0.1", - "eslint-plugin-promise": ">=4.0.0", - "eslint-plugin-standard": ">=4.0.0" + "eslint": ">=7.12.1", + "eslint-config-standard": ">=16.0.3", + "eslint-plugin-import": ">=2.22.1", + "eslint-plugin-node": ">=11.1.0", + "eslint-plugin-promise": ">=4.2.1" } }, "node_modules/eslint-config-standard": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", - "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==", + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", + "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "peerDependencies": { - "eslint": ">=5.0.0", - "eslint-plugin-import": ">=2.13.0", - "eslint-plugin-node": ">=7.0.0", - "eslint-plugin-promise": ">=4.0.0", - "eslint-plugin-standard": ">=4.0.0" + "eslint": "^7.12.1", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1 || ^5.0.0" } }, "node_modules/eslint-config-standard-jsx": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz", - "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-10.0.0.tgz", + "integrity": "sha512-hLeA2f5e06W1xyr/93/QJulN/rLbUVUmqTlexv9PRKHFwEC9ffJcH2LvJhMoEqYQBEYafedgGZXH2W8NUpt5lA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "peerDependencies": { - "eslint": ">=5.0.0", - "eslint-plugin-react": ">=7.11.1" + "eslint": "^7.12.1", + "eslint-plugin-react": "^7.21.5" } }, "node_modules/eslint-import-resolver-node": { @@ -5085,156 +5442,198 @@ "node": ">=4" } }, + "node_modules/eslint-module-utils/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-es": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz", - "integrity": "sha512-5fa/gR2yR3NxQf+UXkeLeP8FBBl6tSgdrAz1+cF84v1FMM4twGwQoqTnn+QxFLcPOrF4pdKEJKDB/q9GoyJrCA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", "dev": true, "dependencies": { - "eslint-utils": "^1.4.2", - "regexpp": "^2.0.1" + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" }, "engines": { - "node": ">=6.5.0" + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { "eslint": ">=4.19.1" } }, "node_modules/eslint-plugin-import": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", - "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "dependencies": { - "contains-path": "^0.1.0", - "debug": "^2.6.8", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.1", - "eslint-module-utils": "^2.2.0", - "has": "^1.0.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.3", - "read-pkg-up": "^2.0.0", - "resolve": "^1.6.0" + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "2.x - 5.x" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha512-lsGyRuYr4/PIB0txi+Fy2xOMI2dGaTguCaotzFGkVZuKR5usKfcRWIFKNM3QNrU7hh/+w2bwTW+ZeXPK5l8uVg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "dependencies": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" + "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" } }, "node_modules/eslint-plugin-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", - "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dev": true, "dependencies": { - "eslint-plugin-es": "^1.3.1", - "eslint-utils": "^1.3.1", - "ignore": "^4.0.2", + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" + "resolve": "^1.10.1", + "semver": "^6.1.0" }, "engines": { - "node": ">=6" + "node": ">=8.10.0" }, "peerDependencies": { - "eslint": ">=4.19.1" + "eslint": ">=5.16.0" + } + }, + "node_modules/eslint-plugin-node/node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint-plugin-node/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/eslint-plugin-promise": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", - "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.2.0.tgz", + "integrity": "sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw==", "dev": true, "engines": { - "node": ">=6" + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0" } }, "node_modules/eslint-plugin-react": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz", - "integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==", + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz", + "integrity": "sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g==", "dev": true, "dependencies": { - "array-includes": "^3.0.3", + "array-includes": "^3.1.1", + "array.prototype.flatmap": "^1.2.3", "doctrine": "^2.1.0", "has": "^1.0.3", - "jsx-ast-utils": "^2.0.1", - "prop-types": "^15.6.2" + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "object.entries": "^1.1.2", + "object.fromentries": "^2.0.2", + "object.values": "^1.1.1", + "prop-types": "^15.7.2", + "resolve": "^1.18.1", + "string.prototype.matchall": "^4.0.2" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0" + "eslint": "^3 || ^4 || ^5 || ^6 || ^7" } }, - "node_modules/eslint-plugin-standard": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.2.tgz", - "integrity": "sha512-nKptN8l7jksXkwFk++PhJB3cCDTcXOEyhISIN86Ue2feJ1LFyY3PrY3/xT2keXlJSY5bpmbiTG0f885/YKAvTA==", + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peerDependencies": { - "eslint": ">=5.0.0" + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { - "node": ">=4.0.0" + "node": ">=8.0.0" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" } }, "node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "dependencies": { "eslint-visitor-keys": "^1.1.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/eslint-visitor-keys": { + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", @@ -5243,134 +5642,206 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/eslint/node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" + "@babel/highlight": "^7.10.4" } }, - "node_modules/eslint/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/eslint/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ms": "2.1.2" }, "engines": { - "node": ">=4" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/eslint/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "color-name": "1.1.3" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "node_modules/eslint/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/eslint/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/eslint/node_modules/globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/eslint/node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "node_modules/eslint/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "minimist": "^1.2.6" + "yallist": "^4.0.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=10" } }, "node_modules/eslint/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "node_modules/eslint/node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/eslint/node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/espree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", - "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "node_modules/eslint/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { - "acorn": "^6.0.2", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/espree/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -5388,6 +5859,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -5412,15 +5892,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -5433,20 +5904,10 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "engines": { "node": ">=4.0" } @@ -5454,8 +5915,7 @@ "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "node_modules/esutils": { "version": "2.0.3", @@ -5576,6 +6036,15 @@ "node": ">=0.10.0" } }, + "node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -5713,20 +6182,6 @@ "node": ">=0.10.0" } }, - "node_modules/external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, - "dependencies": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -5758,15 +6213,6 @@ "node": ">=0.10.0" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, "node_modules/eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", @@ -5837,18 +6283,6 @@ "node": ">=8" } }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "peer": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fast-glob/node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -5884,16 +6318,10 @@ } }, "node_modules/fast-json-patch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", - "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", - "peer": true, - "dependencies": { - "fast-deep-equal": "^2.0.1" - }, - "engines": { - "node": ">= 0.4.0" - } + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", + "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", + "dev": true }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", @@ -5925,29 +6353,38 @@ "inherits": "^2.0.1" } }, - "node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, + "node_modules/fetch-blob": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.5.tgz", + "integrity": "sha512-N64ZpKqoLejlrwkIAnb9iLSA3Vx/kjgzpcDhygcqJ2KKjky8nCgUQ+dzXtbrLaWZGZNmNfQTsiQ0weZ1svglHg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], "dependencies": { - "escape-string-regexp": "^1.0.5" + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" }, "engines": { - "node": ">=4" + "node": "^12.20 || >= 14.13" } }, "node_modules/file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha512-uXP/zGzxxFvFfcZGgBIwotm+Tdc55ddPAzF7iHshP4YGaXMww7rSF9peD9D1sui5ebONg5UobsZv+FfgEpGv/w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=0.10.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/file-extension": { @@ -5997,22 +6434,37 @@ "node": ">= 0.8" } }, - "node_modules/find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } }, "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/findup-sync": { @@ -6068,44 +6520,48 @@ } }, "node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, "bin": { "flat": "cli.js" } }, "node_modules/flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=0.10.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flat-cache/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, "node_modules/flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -6116,6 +6572,27 @@ "readable-stream": "^2.3.6" } }, + "node_modules/flush-write-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/flush-write-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", @@ -6162,27 +6639,41 @@ "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", "peer": true }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, "engines": { - "node": "*" + "node": ">=8.0.0" } }, "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" }, "engines": { - "node": ">= 0.12" + "node": ">= 6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" } }, "node_modules/forwarded": { @@ -6213,6 +6704,26 @@ "node": ">= 0.6" } }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -6325,32 +6836,55 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-symbol-description": { @@ -6378,15 +6912,6 @@ "node": ">=0.10.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -6407,25 +6932,14 @@ } }, "node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", - "dev": true, - "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/glob-parent/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", - "dev": true, + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dependencies": { - "is-extglob": "^2.1.0" + "is-glob": "^4.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, "node_modules/glob-run": { @@ -6462,6 +6976,49 @@ "node": ">= 0.10" } }, + "node_modules/glob-stream/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/glob-stream/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/glob-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/glob-watcher": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", @@ -6536,15 +7093,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, "node_modules/gulp": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", @@ -6595,56 +7143,77 @@ "node": ">= 0.10" } }, - "node_modules/gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", + "node_modules/gulp-cli/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, - "dependencies": { - "glogg": "^1.0.0" - }, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "node_modules/gulp-cli/node_modules/camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.10.0" + } + }, + "node_modules/gulp-cli/node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", + "node_modules/gulp-cli/node_modules/get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", "dev": true, "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "number-is-nan": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/gulp-cli/node_modules/require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, "dependencies": { - "function-bind": "^1.1.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" }, "engines": { - "node": ">= 0.4.0" + "node": ">=0.10.0" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "node_modules/gulp-cli/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, "dependencies": { "ansi-regex": "^2.0.0" @@ -6653,15 +7222,85 @@ "node": ">=0.10.0" } }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "node_modules/gulp-cli/node_modules/which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", "dev": true, + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, "engines": { "node": ">=0.10.0" } }, + "node_modules/gulp-cli/node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/gulp-cli/node_modules/yargs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", + "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.1" + } + }, + "node_modules/gulp-cli/node_modules/yargs-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "dev": true, + "dependencies": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "node_modules/gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", + "dev": true, + "dependencies": { + "glogg": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6777,14 +7416,6 @@ "node": ">=6" } }, - "node_modules/has-values/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -6799,20 +7430,6 @@ "node": ">=4" } }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -6823,6 +7440,22 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -6871,6 +7504,12 @@ "node": ">=12" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "node_modules/htmlparser2": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", @@ -6934,11 +7573,11 @@ } }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dependencies": { - "@tootallnate/once": "2", + "@tootallnate/once": "1", "agent-base": "6", "debug": "4" }, @@ -6993,21 +7632,6 @@ "node": ">=12" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -7096,10 +7720,21 @@ "node": ">=0.10.0" } }, - "node_modules/immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==" + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/imurmurhash": { "version": "0.1.4", @@ -7141,139 +7776,10 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, - "node_modules/inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", - "dev": true, - "dependencies": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.1.0", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^5.5.2", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/inquirer/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/inquirer/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/inquirer/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/inquirer/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/install-artifact-from-github": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.1.tgz", - "integrity": "sha512-3l3Bymg2eKDsN5wQuMfgGEj2x6l5MCAv0zPL6rxHESufFVlEAKW/6oY9F1aGgvY/EgWm5+eWGRjINveL4X7Hgg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.0.tgz", + "integrity": "sha512-iT8v1GwOAX0pPXifF/5ihnMhHOCo3OeK7z3TQa4CtSNCIg8k0UxqBEk9jRwz8OP68hHXvJ2gxRa89KYHtBkqGA==", "bin": { "install-from-cache": "bin/install-from-cache.js", "save-to-github-cache": "bin/save-to-github-cache.js" @@ -7293,6 +7799,14 @@ "node": ">= 0.4" } }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "engines": { + "node": ">=12" + } + }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -7365,15 +7879,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7490,15 +7995,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -7528,15 +8024,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-expression": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-1.0.2.tgz", @@ -7659,6 +8146,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -7720,12 +8216,6 @@ "node": ">=8" } }, - "node_modules/is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", @@ -7738,6 +8228,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -7771,7 +8273,8 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true }, "node_modules/is-unc-path": { "version": "1.0.0", @@ -7785,6 +8288,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-uri": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-uri/-/is-uri-1.2.4.tgz", @@ -7875,37 +8390,40 @@ "resolved": "https://registry.npmjs.org/isostring/-/isostring-0.0.1.tgz", "integrity": "sha512-wRcdJtXCe2LGtXnD14fXMkduWVdbeGkzBIKg8WcKeEOi6SIc+hRjYYw76WNx3v5FebhUWZrBTWB0NOl3/sagdQ==" }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, "node_modules/istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "dependencies": { + "append-transform": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "dependencies": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { @@ -7917,6 +8435,114 @@ "semver": "bin/semver.js" } }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/istanbul-reports": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", + "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/jade-error": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/jade-error/-/jade-error-1.2.0.tgz", @@ -8018,9 +8644,9 @@ "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" }, "node_modules/js-beautify": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.4.tgz", - "integrity": "sha512-+b4A9c3glceZEmxyIbxDOYB0ZJdReLvyU1077RqKsO4dZx9FUHjTOJn8VHwpg33QoucIykOiYbh7MfqBOghnrA==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.3.tgz", + "integrity": "sha512-f1ra8PHtOEu/70EBnmiUlV8nJePS58y9qKjl4JHfYWlFH6bo7ogZBz//FAZp7jDuXtYnGYKymZPlrg2I/9Zo4g==", "dependencies": { "config-chain": "^1.1.13", "editorconfig": "^0.15.3", @@ -8065,21 +8691,14 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", "integrity": "sha512-CSOkdn0/GhRFwxnipmhXfqJ+FG6+wkWBi46kKSsPx6+j65176ZiQcrCYpg6K8x3iLbO4k3zScBnZ7I/L80dAtw==", - "dev": true, "dependencies": { "xmlcreate": "^1.0.1" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, "node_modules/jsdoc": { "version": "3.6.0-dev", "resolved": "git+ssh://git@github.com/FabricLabs/jsdoc.git#1a9aee2aed164d3dd96abaa4629e2417520d7ade", - "dev": true, + "integrity": "sha512-zAT2KHcG6J8dfhvCmUd+QhzkaMEpsIMtPxYymJyyyLfwMKehBxwzFKEr32HaWRpTeFZ8BSPJ4W/3y6K+fXyHxw==", "license": "Apache-2.0", "dependencies": { "babylon": "7.0.0-beta.19", @@ -8108,7 +8727,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -8117,44 +8735,62 @@ } }, "node_modules/jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "dependencies": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", + "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", + "dependencies": { + "abab": "^2.0.5", + "acorn": "^8.5.0", + "acorn-globals": "^6.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.1", + "decimal.js": "^10.3.1", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^3.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0", + "ws": "^8.2.3", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "engines": { + "node": ">= 10" } }, "node_modules/jsdom/node_modules/acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", - "dev": true, + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "bin": { "acorn": "bin/acorn" }, @@ -8162,32 +8798,39 @@ "node": ">=0.4.0" } }, - "node_modules/jsdom/node_modules/html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, + "node_modules/jsdom/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { - "whatwg-encoding": "^1.0.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/jsdom/node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, + "node_modules/jsdom/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dependencies": { - "iconv-lite": "0.4.24" + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "node_modules/jsdom/node_modules/ws": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz", - "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==", - "dev": true, - "dependencies": { - "async-limiter": "~1.0.0" - } + "node_modules/jsdom/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/jsesc": { "version": "2.5.2", @@ -8216,12 +8859,6 @@ "foreach": "^2.0.4" } }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -8237,7 +8874,20 @@ "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "peer": true + }, + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } }, "node_modules/jsonparse": { "version": "1.3.1", @@ -8264,29 +8914,14 @@ "node": "*" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/jsx-ast-utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz", - "integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.0.tgz", + "integrity": "sha512-XzO9luP6L0xkxwhIJMTJQpZo/eeN60K08jHdexfD569AGxeNug6UketeHXEhROoM8aR7EcUoOQmIhcJQjcuq8Q==", "dev": true, "dependencies": { - "array-includes": "^3.1.1", - "object.assign": "^4.1.0" + "array-includes": "^3.1.4", + "object.assign": "^4.1.2" }, "engines": { "node": ">=4.0" @@ -8299,10 +8934,9 @@ "dev": true }, "node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "engines": { "node": ">=0.10.0" } @@ -8311,7 +8945,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", "integrity": "sha512-Hx5PvgJKTWpMkNJCYrBUNBLlxYIkxN4FVU/BnZP4CFh5BpiHOgujAPx7iFVz/phD0bP8rsqD48gtqcvNlUt0lQ==", - "dev": true, "dependencies": { "graceful-fs": "^4.1.9" } @@ -8341,6 +8974,27 @@ "node": ">= 0.6.3" } }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -8365,161 +9019,40 @@ "node": ">= 0.10" } }, - "node_modules/left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "deprecated": "use String.prototype.padStart()", - "dev": true - }, "node_modules/level": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-5.0.1.tgz", - "integrity": "sha512-wcak5OQeA4rURGacqS62R/xNHjCYnJSQDBOlm4KNUGJVE9bWv2B04TclqReYejN+oD65PzD4FsqeWoI5wNC5Lg==", - "hasInstallScript": true, - "dependencies": { - "level-js": "^4.0.0", - "level-packager": "^5.0.0", - "leveldown": "^5.0.0", - "opencollective-postinstall": "^2.0.0" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "dependencies": { - "buffer": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "dependencies": { - "errno": "~0.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", + "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "browser-level": "^1.0.1", + "classic-level": "^1.2.0" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/level-js": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-4.0.2.tgz", - "integrity": "sha512-PeGjZsyMG4O89KHiez1zoMJxStnkM+oBIqgACjoo5PJqFiSUUm3GNod/KcbqN5ktyZa8jkG7I1T0P2u6HN9lIg==", - "dependencies": { - "abstract-leveldown": "~6.0.1", - "immediate": "~3.2.3", - "inherits": "^2.0.3", - "ltgt": "^2.1.2", - "typedarray-to-buffer": "~3.1.5" - } - }, - "node_modules/level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "dependencies": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" + "node": ">=12" }, - "engines": { - "node": ">=6" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/level" } }, "node_modules/level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "dependencies": { - "xtend": "^4.0.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/leveldown": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", - "hasInstallScript": true, - "dependencies": { - "abstract-leveldown": "~6.2.1", - "napi-macros": "~2.0.0", - "node-gyp-build": "~4.1.0" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/leveldown/node_modules/abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", + "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", "engines": { - "node": ">=6" + "node": ">=12" } }, - "node_modules/levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "node_modules/level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", "dependencies": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" + "buffer": "^6.0.3", + "module-error": "^1.0.1" }, "engines": { - "node": ">=6" + "node": ">=12" } }, "node_modules/levn": { @@ -8591,37 +9124,48 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, "dependencies": { "uc.micro": "^1.0.1" } }, "node_modules/load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" }, "engines": { - "node": ">=4" + "node": ">=6" + } + }, + "node_modules/load-json-file/node_modules/type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true, + "engines": { + "node": ">=6" } }, "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -8629,89 +9173,37 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", "dev": true }, "node_modules/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^2.0.1" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/loose-envify": { @@ -8738,51 +9230,83 @@ "node_modules/ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "peer": true }, "node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", - "dev": true, "dependencies": { "sourcemap-codec": "^1.4.8" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-fetch-happen": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.8.tgz", - "integrity": "sha512-0ASJbG12Au6+N5I84W+8FhGS6iM8MyzvZady+zaQAu+6IOaESFzCLLD0AR1sAFF3Jufi8bxm586ABN6hWd3k7g==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", + "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", + "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", + "negotiator": "^0.6.2", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">= 10" } }, "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.2.tgz", - "integrity": "sha512-9zDbhgmXAUvUMPV81A705K3tVzcPiZL3Bf5/5JC/FjYJlLZ5AJCeqIRFHJqyBppiLosqF+uKB7p8/RDXylqBIw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": ">=10" } }, + "node_modules/make-fetch-happen/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -8795,15 +9319,6 @@ "node": ">=0.10.0" } }, - "node_modules/make-iterator/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -8829,7 +9344,6 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.3.2.tgz", "integrity": "sha512-4J92IhJq1kGoyXddwzzfjr9cEKGexBfFsZooKYMhMLLlWa4+dlSPDUUP7y+xQOCebIj61aLmKlowg//YcdPP1w==", - "dev": true, "dependencies": { "argparse": "^1.0.7", "entities": "~1.1.1", @@ -8845,7 +9359,6 @@ "version": "0.0.4", "resolved": "https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.4.tgz", "integrity": "sha512-2uuJ9urchbulz9F7q6VVQmeGxSXjxFeeGcb4ebKiz3+nuKOho1rLw8866a6zs1EeAe9xdSOKEpqeF5Dv22ZDxw==", - "dev": true, "dependencies": { "string": "^3.0.1" } @@ -8854,7 +9367,6 @@ "version": "0.3.19", "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true, "bin": { "marked": "bin/marked" }, @@ -8918,8 +9430,7 @@ "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -8971,14 +9482,14 @@ } }, "node_modules/metascraper": { - "version": "5.29.12", - "resolved": "https://registry.npmjs.org/metascraper/-/metascraper-5.29.12.tgz", - "integrity": "sha512-zbgDC3UyRf+AESJzQrefPvZbmcm4Z03RqlNggpHsR01+DopPUXRhqXjEztjsqdx4y/ITO7Qh4RZ7Um6cYyaZ3Q==", + "version": "5.29.8", + "resolved": "https://registry.npmjs.org/metascraper/-/metascraper-5.29.8.tgz", + "integrity": "sha512-UU0XOj7jT9x9MsBM9VSZUqve0MFJ2B3+OjT1gadmTt4CuBjoqDptC1FrUgLTTB1WtHkiZO9ys5cAm2ZopOAWhA==", "dependencies": { - "@metascraper/helpers": "^5.29.11", - "cheerio": "~1.0.0-rc.12", + "@metascraper/helpers": "^5.29.7", + "cheerio": "~1.0.0-rc.11", "lodash": "~4.17.21", - "whoops": "~4.1.1" + "whoops": "~4.1.0" }, "engines": { "node": ">= 12" @@ -9053,15 +9564,6 @@ "node": ">=0.10.0" } }, - "node_modules/micromatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/microsoft-capitalize": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/microsoft-capitalize/-/microsoft-capitalize-1.0.5.tgz", @@ -9100,15 +9602,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -9138,9 +9631,9 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/minipass": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.3.tgz", - "integrity": "sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", "dependencies": { "yallist": "^4.0.0" }, @@ -9160,19 +9653,19 @@ } }, "node_modules/minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", "dependencies": { - "minipass": "^3.1.6", + "minipass": "^3.1.0", "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" + "minizlib": "^2.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=8" }, "optionalDependencies": { - "encoding": "^0.1.13" + "encoding": "^0.1.12" } }, "node_modules/minipass-flush": { @@ -9285,163 +9778,218 @@ } }, "node_modules/mocha": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.3.tgz", - "integrity": "sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", "dev": true, "dependencies": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.4", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" } }, - "node_modules/mocha/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "node_modules/mocha/node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, "engines": { - "node": ">=6" + "node": ">= 8" } }, - "node_modules/mocha/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/mocha/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/mocha/node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "fill-range": "^7.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/mocha/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "node_modules/mocha/node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "node_modules/mocha/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { - "color-name": "1.1.3" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "node_modules/mocha/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "node_modules/mocha/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/mocha/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/mocha/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "node_modules/mocha/node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "to-regex-range": "^5.0.1" }, "engines": { - "node": "*" + "node": ">=8" } }, - "node_modules/mocha/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/mocha/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=4" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/mocha/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">=4" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -9450,111 +9998,167 @@ "node": "*" } }, - "node_modules/mocha/node_modules/mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "node_modules/mocha/node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "dependencies": { - "minimist": "^1.2.5" + "binary-extensions": "^2.0.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=8" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "node_modules/mocha/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } }, - "node_modules/mocha/node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } }, - "node_modules/mocha/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/mocha/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "picomatch": "^2.2.1" }, "engines": { - "node": ">=6" + "node": ">=8.10.0" + } + }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true + "node_modules/mocha/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } }, "node_modules/mocha/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/mocha/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } }, "node_modules/mocha/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "engines": { + "node": ">=10" } }, "node_modules/ms": { @@ -9571,17 +10175,23 @@ "node": ">= 0.10" } }, - "node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", - "dev": true - }, "node_modules/nan": { "version": "2.16.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" }, + "node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -9641,15 +10251,6 @@ "node": ">=0.10.0" } }, - "node_modules/nanomatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/napi-macros": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", @@ -9675,69 +10276,50 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", - "dev": true, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" } }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.6.tgz", + "integrity": "sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw==", "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/node-gyp": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", - "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", + "make-fetch-happen": "^9.1.0", "nopt": "^5.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", @@ -9749,13 +10331,13 @@ "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^12.22 || ^14.13 || >=16" + "node": ">= 10.12.0" } }, "node_modules/node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -9820,6 +10402,24 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==", + "dev": true + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -9913,10517 +10513,7027 @@ } }, "node_modules/nwsapi": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz", - "integrity": "sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" }, "node_modules/nyc": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", - "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", - "bundleDependencies": [ - "archy", - "arrify", - "caching-transform", - "convert-source-map", - "find-cache-dir", - "find-up", - "foreground-child", - "glob", - "istanbul-lib-coverage", - "istanbul-lib-hook", - "istanbul-lib-report", - "istanbul-lib-source-maps", - "istanbul-reports", - "make-dir", - "merge-source-map", - "resolve-from", - "rimraf", - "signal-exit", - "spawn-wrap", - "test-exclude", - "uuid", - "yargs", - "yargs-parser" - ], + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "dependencies": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^3.0.1", - "convert-source-map": "^1.6.0", - "find-cache-dir": "^2.0.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "make-dir": "^1.3.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.1.0", - "uuid": "^3.3.2", - "yargs": "^12.0.5", - "yargs-parser": "^11.1.1" + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" }, "bin": { "nyc": "bin/nyc.js" }, "engines": { - "node": ">=6" - } - }, - "node_modules/nyc/node_modules/ansi-regex": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=4" + "node": ">=8.9" } }, - "node_modules/nyc/node_modules/append-transform": { - "version": "1.0.0", + "node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "default-require-extensions": "^2.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/nyc/node_modules/archy": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/arrify": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/nyc/node_modules/async": { - "version": "2.6.2", + "node_modules/nyc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "lodash": "^4.17.11" + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/nyc/node_modules/balanced-match": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/brace-expansion": { - "version": "1.1.11", + "node_modules/nyc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/nyc/node_modules/caching-transform": { - "version": "3.0.1", + "node_modules/nyc/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "hasha": "^3.0.0", - "make-dir": "^1.3.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.3.0" + "aggregate-error": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/nyc/node_modules/camelcase": { + "node_modules/nyc/node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/nyc/node_modules/cliui": { - "version": "4.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/nyc/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/nyc/node_modules/code-point-at": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/commander": { - "version": "2.17.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/nyc/node_modules/commondir": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/convert-source-map": { - "version": "1.6.0", + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "safe-buffer": "~5.1.1" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/cross-spawn": { - "version": "4.0.2", + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/debug": { - "version": "4.1.1", + "node_modules/object-copy/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "ms": "^2.1.1" + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/decamelize": { - "version": "1.2.0", + "node_modules/object-copy/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/object-copy/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", "dev": true, - "inBundle": true, - "license": "MIT", + "dependencies": { + "kind-of": "^3.0.2" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/default-require-extensions": { - "version": "2.0.0", + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "strip-bom": "^3.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/end-of-stream": { - "version": "1.4.1", + "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/error-ex": { - "version": "1.3.2", + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "is-arrayish": "^0.2.1" + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/es6-error": { - "version": "4.1.1", - "dev": true, - "inBundle": true, - "license": "MIT" + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/nyc/node_modules/execa": { - "version": "1.0.0", + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/nyc/node_modules/execa/node_modules/cross-spawn": { - "version": "6.0.5", + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "isobject": "^3.0.0" }, "engines": { - "node": ">=4.8" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/find-cache-dir": { - "version": "2.0.0", + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/nyc/node_modules/find-up": { - "version": "3.0.0", + "node_modules/object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "locate-path": "^3.0.0" + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/foreground-child": { - "version": "1.5.6", + "node_modules/object.entries": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/nyc/node_modules/fs.realpath": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/get-caller-file": { - "version": "1.0.3", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/get-stream": { - "version": "4.1.0", + "node_modules/object.fromentries": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", + "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "pump": "^3.0.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/nyc/node_modules/glob": { - "version": "7.1.3", + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" }, "engines": { - "node": "*" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/graceful-fs": { - "version": "4.1.15", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/handlebars": { - "version": "4.1.0", + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1" - }, - "bin": { - "handlebars": "bin/handlebars" + "isobject": "^3.0.1" }, "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/handlebars/node_modules/source-map": { - "version": "0.6.1", + "node_modules/object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==", "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/has-flag": { - "version": "3.0.0", + "node_modules/object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", "dev": true, - "inBundle": true, - "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/nyc/node_modules/hasha": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "is-stream": "^1.0.1" + "ee-first": "1.1.1" }, "engines": { - "node": ">=4" + "node": ">= 0.8" } }, - "node_modules/nyc/node_modules/hosted-git-info": { - "version": "2.7.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/imurmurhash": { - "version": "0.1.4", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "engines": { - "node": ">=0.8.19" + "node": ">= 0.8" } }, - "node_modules/nyc/node_modules/inflight": { - "version": "1.0.6", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dependencies": { - "once": "^1.3.0", "wrappy": "1" } }, - "node_modules/nyc/node_modules/inherits": { - "version": "2.0.3", - "dev": true, - "inBundle": true, - "license": "ISC" + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "bin": { + "opener": "bin/opener-bin.js" + } }, - "node_modules/nyc/node_modules/invert-kv": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/nyc/node_modules/is-arrayish": { - "version": "0.2.1", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", + "node_modules/ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==", "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=4" + "dependencies": { + "readable-stream": "^2.0.1" } }, - "node_modules/nyc/node_modules/is-stream": { - "version": "1.1.0", + "node_modules/ordered-read-streams/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/nyc/node_modules/isexe": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" + "node_modules/ordered-read-streams/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, - "node_modules/nyc/node_modules/istanbul-lib-coverage": { - "version": "2.0.3", + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", + "dependencies": { + "lcid": "^1.0.0" + }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/istanbul-lib-hook": { - "version": "2.0.3", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", + "node_modules/p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "peer": true, "dependencies": { - "append-transform": "^1.0.0" + "p-timeout": "^3.1.0" }, "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/istanbul-lib-report": { - "version": "2.0.4", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" - }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "peer": true, "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/nyc/node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "6.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { - "has-flag": "^3.0.0" + "p-try": "^2.0.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/istanbul-lib-source-maps": { - "version": "3.0.2", + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/istanbul-lib-source-maps/node_modules/source-map": { - "version": "0.6.1", + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", + "dependencies": { + "yocto-queue": "^0.1.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/istanbul-reports": { - "version": "2.1.1", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dependencies": { - "handlebars": "^4.1.0" + "aggregate-error": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/json-parse-better-errors": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/lcid": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "peer": true, "dependencies": { - "invert-kv": "^2.0.0" + "p-finally": "^1.0.0" }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "engines": { "node": ">=6" } }, - "node_modules/nyc/node_modules/load-json-file": { + "node_modules/package-hash": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/nyc/node_modules/locate-path": { - "version": "3.0.0", + "node_modules/page": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/page/-/page-1.11.6.tgz", + "integrity": "sha512-P6e2JfzkBrPeFCIPplLP7vDDiU84RUUZMrWdsH4ZBGJ8OosnwFkcUkBHp1DTIjuipLliw9yQn/ZJsXZvarsO+g==", + "dependencies": { + "path-to-regexp": "~1.2.1" + } + }, + "node_modules/page/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/page/node_modules/path-to-regexp": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.2.1.tgz", + "integrity": "sha512-DBw9IhWfevR2zCVwEZURTuQNseCvu/Q9f5ZgqMCK0Rh61bDa4uyjPAOy9b55yKiPT59zZn+7uYKxmWwsguInwg==", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "callsites": "^3.0.0" }, "engines": { "node": ">=6" } }, - "node_modules/nyc/node_modules/lodash": { - "version": "4.17.11", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/lodash.flattendeep": { - "version": "4.4.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/lru-cache": { - "version": "4.1.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/nyc/node_modules/make-dir": { - "version": "1.3.0", + "node_modules/parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "pify": "^3.0.0" + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" }, "engines": { - "node": ">=4" + "node": ">=0.8" } }, - "node_modules/nyc/node_modules/map-age-cleaner": { - "version": "0.1.3", + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "p-defer": "^1.0.0" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" }, "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/nyc/node_modules/mem": { - "version": "4.1.0", + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^2.0.0" - }, "engines": { - "node": ">=6" - } - }, - "node_modules/nyc/node_modules/merge-source-map": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "source-map": "^0.6.1" + "node": ">= 0.10" } }, - "node_modules/nyc/node_modules/merge-source-map/node_modules/source-map": { - "version": "0.6.1", + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/mimic-fn": { - "version": "1.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/parse-uri": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/parse-uri/-/parse-uri-1.0.7.tgz", + "integrity": "sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg==", "engines": { - "node": ">=4" + "node": ">= 0.10" } }, - "node_modules/nyc/node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dependencies": { - "brace-expansion": "^1.1.7" + "domhandler": "^5.0.2", + "parse5": "^7.0.0" }, - "engines": { - "node": "*" + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/nyc/node_modules/minimist": { - "version": "0.0.10", - "dev": true, - "inBundle": true, - "license": "MIT" + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } }, - "node_modules/nyc/node_modules/mkdirp": { - "version": "0.5.1", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", "dependencies": { - "minimist": "0.0.8" + "entities": "^4.3.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/nyc/node_modules/mkdirp/node_modules/minimist": { - "version": "0.0.8", - "dev": true, - "inBundle": true, - "license": "MIT" + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } }, - "node_modules/nyc/node_modules/ms": { - "version": "2.1.1", + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", "dev": true, - "inBundle": true, - "license": "MIT" + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/nyc/node_modules/nice-try": { - "version": "1.0.5", - "dev": true, - "inBundle": true, - "license": "MIT" + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "peer": true }, - "node_modules/nyc/node_modules/normalize-package-data": { - "version": "2.5.0", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", + "dev": true }, - "node_modules/nyc/node_modules/npm-run-path": { - "version": "2.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "path-key": "^2.0.0" - }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/nyc/node_modules/number-is-nan": { + "node_modules/path-is-absolute": { "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/once": { - "version": "1.4.0", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "inBundle": true, - "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-match": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/path-match/-/path-match-1.2.4.tgz", + "integrity": "sha512-UWlehEdqu36jmh4h5CWJ7tARp1OEVKGHKm6+dg9qMq5RKUTV5WJrGgaZ3dN2m7WFAXDbjlHzvJvL/IUpy84Ktw==", + "peer": true, "dependencies": { - "wrappy": "1" + "http-errors": "~1.4.0", + "path-to-regexp": "^1.0.0" } }, - "node_modules/nyc/node_modules/optimist": { - "version": "0.6.1", - "dev": true, - "inBundle": true, - "license": "MIT/X11", + "node_modules/path-match/node_modules/http-errors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.4.0.tgz", + "integrity": "sha512-oLjPqve1tuOl5aRhv8GK5eHpqP1C9fb+Ol+XTLjKfLltE44zdDbEdjPSbU7Ch5rSNsVFqZn97SrMmZLdu1/YMw==", + "peer": true, "dependencies": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "inherits": "2.0.1", + "statuses": ">= 1.2.1 < 2" + }, + "engines": { + "node": ">= 0.6" } }, - "node_modules/nyc/node_modules/os-homedir": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/path-match/node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", + "peer": true + }, + "node_modules/path-match/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "peer": true + }, + "node_modules/path-match/node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "peer": true, + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/path-match/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/nyc/node_modules/os-locale": { - "version": "3.1.0", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "path-root-regex": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/p-defer": { - "version": "1.0.0", + "node_modules/path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/p-finally": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/path-to-regexp": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + }, + "node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/p-is-promise": { - "version": "2.0.0", + "node_modules/path-type/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/p-limit": { - "version": "2.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "peer": true, "dependencies": { - "p-try": "^2.0.0" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" }, "engines": { - "node": ">=6" + "node": ">=0.12" } }, - "node_modules/nyc/node_modules/p-locate": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "p-limit": "^2.0.0" + "node_modules/peer": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/peer/-/peer-0.6.1.tgz", + "integrity": "sha512-zPJSPoZvo+83sPJNrW8o93QTktx7dKk67965RRDDNAIelWw1ZwE6ZmmhsvRrdNRlK0knQb3rR8GBdZlbWzCYJw==", + "dependencies": { + "@types/cors": "^2.8.6", + "@types/express": "^4.17.3", + "@types/ws": "^7.2.3", + "body-parser": "^1.19.0", + "cors": "^2.8.5", + "express": "^4.17.1", + "uuid": "^3.4.0", + "ws": "^7.2.3", + "yargs": "^15.3.1" + }, + "bin": { + "peerjs": "bin/peerjs" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/nyc/node_modules/p-try": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/peer/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/peer/node_modules/ws": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", + "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", "engines": { - "node": ">=6" + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, - "node_modules/nyc/node_modules/package-hash": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/peerjs": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/peerjs/-/peerjs-1.4.6.tgz", + "integrity": "sha512-0XA105/9yBFGxfpyCjlI1bcBiyPmXHs8+UDvO2j1WGnY+FXilMn35+P/3t8HzKnUnR1SX0PRkDSk8kM17ciNxA==", "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "@swc/helpers": "^0.3.13", + "eventemitter3": "^4.0.7", + "peerjs-js-binarypack": "1.0.1", + "webrtc-adapter": "^7.7.1" }, "engines": { - "node": ">=6" + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/peer" } }, - "node_modules/nyc/node_modules/parse-json": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - }, + "node_modules/peerjs-js-binarypack": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/peerjs-js-binarypack/-/peerjs-js-binarypack-1.0.1.tgz", + "integrity": "sha512-N6aeia3NhdpV7kiGxJV5xQiZZCVEEVjRz2T2C6UZQiBkHWHzUv/oWA4myQLcwBwO8LUoR1KWW5oStvwVesmfCg==" + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { - "node": ">=4" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/nyc/node_modules/path-exists": { - "version": "3.0.0", + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { - "node": ">=4" + "node": ">=6" } }, - "node_modules/nyc/node_modules/path-is-absolute": { - "version": "1.0.1", + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/path-key": { + "node_modules/pinkie-promise": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, - "inBundle": true, - "license": "MIT", + "dependencies": { + "pinkie": "^2.0.0" + }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/path-parse": { - "version": "1.0.6", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/path-type": { - "version": "3.0.0", + "node_modules/pkg-conf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "pify": "^3.0.0" + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" }, "engines": { - "node": ">=4" + "node": ">=6" } }, - "node_modules/nyc/node_modules/pify": { + "node_modules/pkg-conf/node_modules/find-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, - "inBundle": true, - "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, "engines": { - "node": ">=4" + "node": ">=6" } }, - "node_modules/nyc/node_modules/pkg-dir": { + "node_modules/pkg-conf/node_modules/locate-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "find-up": "^3.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" }, "engines": { "node": ">=6" } }, - "node_modules/nyc/node_modules/pseudomap": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/pump": { + "node_modules/pkg-conf/node_modules/p-locate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, - "node_modules/nyc/node_modules/read-pkg": { + "node_modules/pkg-conf/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, "engines": { "node": ">=4" } }, - "node_modules/nyc/node_modules/read-pkg-up": { - "version": "4.0.0", + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "find-up": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/nyc/node_modules/release-zalgo": { - "version": "1.0.0", + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "es6-error": "^4.0.1" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/nyc/node_modules/require-directory": { - "version": "2.1.1", + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "inBundle": true, - "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/nyc/node_modules/require-main-filename": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/resolve": { - "version": "1.10.0", + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "path-parse": "^1.0.6" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/nyc/node_modules/resolve-from": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "engines": { "node": ">=4" } }, - "node_modules/nyc/node_modules/rimraf": { - "version": "2.6.3", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/portfinder": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", + "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", "dependencies": { - "glob": "^7.1.3" + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.5" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">= 0.12.0" } }, - "node_modules/nyc/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/nyc/node_modules/semver": { - "version": "5.6.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" + "node_modules/portfinder/node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dependencies": { + "lodash": "^4.17.14" } }, - "node_modules/nyc/node_modules/set-blocking": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" + "node_modules/portfinder/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } }, - "node_modules/nyc/node_modules/shebang-command": { - "version": "1.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/portfinder/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dependencies": { - "shebang-regex": "^1.0.0" + "minimist": "^1.2.6" }, - "engines": { - "node": ">=0.10.0" + "bin": { + "mkdirp": "bin/cmd.js" } }, - "node_modules/nyc/node_modules/shebang-regex": { - "version": "1.0.0", + "node_modules/portfinder/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", "dev": true, - "inBundle": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/nyc/node_modules/signal-exit": { - "version": "3.0.2", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/spawn-wrap": { - "version": "1.4.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/nyc/node_modules/spdx-correct": { - "version": "3.1.0", + "node_modules/pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "engines": { + "node": ">= 0.8" } }, - "node_modules/nyc/node_modules/spdx-exceptions": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "CC-BY-3.0" - }, - "node_modules/nyc/node_modules/spdx-expression-parse": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } + "node_modules/process-es6": { + "version": "0.11.6", + "resolved": "https://registry.npmjs.org/process-es6/-/process-es6-0.11.6.tgz", + "integrity": "sha512-GYBRQtL4v3wgigq10Pv58jmTbFXlIiTbSfgnNqZLY0ldUPqy1rRxDI5fCjoCpnM6TqmHQI8ydzTBXW86OYc0gA==", + "dev": true }, - "node_modules/nyc/node_modules/spdx-license-ids": { - "version": "3.0.3", - "dev": true, - "inBundle": true, - "license": "CC0-1.0" + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, - "node_modules/nyc/node_modules/string-width": { - "version": "2.1.1", + "node_modules/process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, - "inBundle": true, - "license": "MIT", "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "fromentries": "^1.2.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/nyc/node_modules/strip-ansi": { - "version": "4.0.0", + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=0.4.0" } }, - "node_modules/nyc/node_modules/strip-bom": { - "version": "3.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=4" - } + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==" }, - "node_modules/nyc/node_modules/strip-eof": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/nyc/node_modules/test-exclude": { - "version": "5.1.0", + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "arrify": "^1.0.1", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" - }, - "engines": { - "node": ">=6" + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" } }, - "node_modules/nyc/node_modules/uglify-js": { - "version": "3.4.9", - "dev": true, - "inBundle": true, - "license": "BSD-2-Clause", - "optional": true, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dependencies": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "bin": { - "uglifyjs": "bin/uglifyjs" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" }, "engines": { - "node": ">=0.8.0" + "node": ">= 0.10" } }, - "node_modules/nyc/node_modules/uglify-js/node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" }, - "node_modules/nyc/node_modules/uuid": { - "version": "3.3.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "node_modules/nyc/node_modules/validate-npm-package-license": { - "version": "3.0.4", + "node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, - "inBundle": true, - "license": "Apache-2.0", "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, - "node_modules/nyc/node_modules/which": { - "version": "1.3.1", + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" } }, - "node_modules/nyc/node_modules/which-module": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } }, - "node_modules/nyc/node_modules/wordwrap": { - "version": "0.0.3", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/punycode2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/punycode2/-/punycode2-1.0.1.tgz", + "integrity": "sha512-+TXpd9YRW4YUZZPoRHJ3DILtWwootGc2DsgvfHmklQ8It1skINAuqSdqizt5nlTaBmwrYACHkHApCXjc9gHk2Q==", "engines": { - "node": ">=0.4.0" + "node": ">=0.10" } }, - "node_modules/nyc/node_modules/wrap-ansi": { - "version": "2.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "side-channel": "^1.0.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/nyc/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/nyc/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "node_modules/random-bytes": { "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "number-is-nan": "^1.0.0" - }, + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, - "node_modules/nyc/node_modules/wrap-ansi/node_modules/string-width": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/nyc/node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dependencies": { - "ansi-regex": "^2.0.0" + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, - "node_modules/nyc/node_modules/wrappy": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/write-file-atomic": { - "version": "2.4.2", - "dev": true, - "inBundle": true, - "license": "ISC", + "node_modules/re2": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/re2/-/re2-1.17.4.tgz", + "integrity": "sha512-xyZ4h5PqE8I9tAxTh3G0UttcK5ufrcUxReFjGzfX61vtanNbS1XZHjnwRSyPcLgChI4KLxVgOT/ioZXnUAdoTA==", + "hasInstallScript": true, "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "install-artifact-from-github": "^1.3.0", + "nan": "^2.15.0", + "node-gyp": "^8.4.1" } }, - "node_modules/nyc/node_modules/y18n": { - "version": "4.0.0", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/yallist": { - "version": "2.1.2", - "dev": true, - "inBundle": true, - "license": "ISC" - }, - "node_modules/nyc/node_modules/yargs": { - "version": "12.0.5", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true }, - "node_modules/nyc/node_modules/yargs-parser": { - "version": "11.1.1", + "node_modules/read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dev": true, - "inBundle": true, - "license": "ISC", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "node_modules/read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dev": true, "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "pinkie-promise": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "node_modules/read-pkg/node_modules/load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "node_modules/read-pkg/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "error-ex": "^1.2.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "node_modules/read-pkg/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/read-pkg/node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "is-utf8": "^0.2.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, "engines": { - "node": ">= 0.4" + "node": ">= 6" } }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "dependencies": { - "isobject": "^3.0.0" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10" } }, - "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "node_modules/readdirp/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "node_modules/readdirp/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", "dev": true, "dependencies": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" + "resolve": "^1.1.6" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz", - "integrity": "sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ==", - "dev": true, + "node_modules/redis": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", + "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "peer": true, "dependencies": { - "array.prototype.reduce": "^1.0.4", - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.1" + "denque": "^1.5.0", + "redis-commands": "^1.7.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/node-redis" } }, - "node_modules/object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "node_modules/redis-commands": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", + "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==", + "peer": true + }, + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "peer": true, + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "node_modules/regex-not/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/object.reduce": { + "node_modules/regex-not/node_modules/is-extendable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" + "is-plain-object": "^2.0.4" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "node_modules/regex-not/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, "dependencies": { - "ee-first": "1.1.1" + "isobject": "^3.0.1" }, "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "dependencies": { - "mimic-fn": "^1.0.0" + "es6-error": "^4.0.1" }, "engines": { "node": ">=4" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "bin": { - "opencollective-postinstall": "index.js" - } - }, - "node_modules/opener": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", - "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", - "bin": { - "opener": "bin/opener-bin.js" - } - }, - "node_modules/optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", + "node_modules/remove-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, "dependencies": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/optimist/node_modules/minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==" + "node_modules/remove-bom-buffer/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "node_modules/remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==", + "dev": true, "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.10" } }, - "node_modules/ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==", + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", "dev": true, - "dependencies": { - "readable-stream": "^2.0.1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", "dev": true, - "dependencies": { - "lcid": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, - "node_modules/p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", - "peer": true, + "node_modules/replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==", + "dev": true, "dependencies": { - "p-timeout": "^3.1.0" + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.10" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "peer": true, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "node_modules/requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" }, - "engines": { - "node": ">=6" + "bin": { + "resolve": "bin/resolve" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/p-map": { + "node_modules/resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dependencies": { - "aggregate-error": "^3.0.0" - }, + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "peer": true, + "node_modules/resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==", + "dev": true, "dependencies": { - "p-finally": "^1.0.0" + "value-or-function": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=0.12" } }, - "node_modules/page": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/page/-/page-1.11.6.tgz", - "integrity": "sha512-P6e2JfzkBrPeFCIPplLP7vDDiU84RUUZMrWdsH4ZBGJ8OosnwFkcUkBHp1DTIjuipLliw9yQn/ZJsXZvarsO+g==", - "dependencies": { - "path-to-regexp": "~1.2.1" + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "engines": { + "node": ">= 4" } }, - "node_modules/page/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } }, - "node_modules/page/node_modules/path-to-regexp": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.2.1.tgz", - "integrity": "sha512-DBw9IhWfevR2zCVwEZURTuQNseCvu/Q9f5ZgqMCK0Rh61bDa4uyjPAOy9b55yKiPT59zZn+7uYKxmWwsguInwg==", + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "peer": true, "dependencies": { - "isarray": "0.0.1" + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" } }, - "node_modules/parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", - "dev": true, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "peer": true, "dependencies": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/robust-predicates": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.1.tgz", + "integrity": "sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g==" + }, + "node_modules/rollup": { + "version": "2.75.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", + "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", + "bin": { + "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=0.8" + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "node_modules/rollup-plugin-dts": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", + "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", "dev": true, "dependencies": { - "error-ex": "^1.2.0" + "magic-string": "^0.26.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=v12.22.11" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.16.7" + }, + "peerDependencies": { + "rollup": "^2.55", + "typescript": "^4.1" } }, - "node_modules/parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "node_modules/rollup-plugin-dts/node_modules/magic-string": { + "version": "0.26.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", + "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + }, "engines": { - "node": ">= 0.10" + "node": ">=12" } }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", + "node_modules/rollup-plugin-node-globals": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz", + "integrity": "sha512-xRkB+W/m1KLIzPUmG0ofvR+CPNcvuCuNdjVBVS7ALKSxr3EDhnzNceGkGi1m8MToSli13AzKFYH4ie9w3I5L3g==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "acorn": "^5.7.3", + "buffer-es6": "^4.9.3", + "estree-walker": "^0.5.2", + "magic-string": "^0.22.5", + "process-es6": "^0.11.6", + "rollup-pluginutils": "^2.3.1" } }, - "node_modules/parse-uri": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/parse-uri/-/parse-uri-1.0.7.tgz", - "integrity": "sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg==", + "node_modules/rollup-plugin-node-globals/node_modules/acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">= 0.10" + "node": ">=0.4.0" } }, - "node_modules/parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "node_modules/rollup-plugin-node-globals/node_modules/estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", "dev": true }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "node_modules/rollup-plugin-node-globals/node_modules/magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, "dependencies": { - "domhandler": "^5.0.2", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "vlq": "^0.2.2" } }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", - "engines": { - "node": ">=0.12" + "node_modules/rollup-plugin-polyfill-node": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.10.1.tgz", + "integrity": "sha512-PT9OfHuOya8juO0YJZE0JDyeZGXjY0SOhFGvvldzR6JwwzCVoJFMWK44pEuzdoDoOodEYD9ltwLVJ+3JnrPpRQ==", + "dependencies": { + "@rollup/plugin-inject": "^4.0.0" }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "dependencies": { - "entities": "^4.3.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" } }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "node_modules/rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "estree-walker": "^0.6.1" } }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "peer": true - }, - "node_modules/path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, - "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "node_modules/rollup/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=0.10.0" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "dev": true - }, - "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, + "node_modules/rtcpeerconnection-shim": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz", + "integrity": "sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw==", + "dependencies": { + "sdp": "^2.6.0" + }, "engines": { - "node": ">=4" + "node": ">=6.0.0", + "npm": ">=3.10.0" } }, - "node_modules/path-match": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/path-match/-/path-match-1.2.4.tgz", - "integrity": "sha512-UWlehEdqu36jmh4h5CWJ7tARp1OEVKGHKm6+dg9qMq5RKUTV5WJrGgaZ3dN2m7WFAXDbjlHzvJvL/IUpy84Ktw==", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "peer": true, "dependencies": { - "http-errors": "~1.4.0", - "path-to-regexp": "^1.0.0" + "queue-microtask": "^1.2.2" } }, - "node_modules/path-match/node_modules/http-errors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.4.0.tgz", - "integrity": "sha512-oLjPqve1tuOl5aRhv8GK5eHpqP1C9fb+Ol+XTLjKfLltE44zdDbEdjPSbU7Ch5rSNsVFqZn97SrMmZLdu1/YMw==", - "peer": true, + "node_modules/run-parallel-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", + "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "inherits": "2.0.1", - "statuses": ">= 1.2.1 < 2" - }, - "engines": { - "node": ">= 0.6" + "queue-microtask": "^1.2.2" } }, - "node_modules/path-match/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", - "peer": true + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" }, - "node_modules/path-match/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "peer": true + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/path-match/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "peer": true, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "dev": true, "dependencies": { - "isarray": "0.0.1" + "ret": "~0.1.10" } }, - "node_modules/path-match/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", - "peer": true, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dependencies": { + "xmlchars": "^2.2.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=10" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "node_modules/sdp": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.12.0.tgz", + "integrity": "sha512-jhXqQAQVM+8Xj5EjJGVweuEzgtGWb3tmEEpl3CLP3cStInSbVHSg0QWOGQzNq8pSID4JkpeV2mPqlMDLrm0/Vw==" }, - "node_modules/path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", + "node_modules/secure-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", + "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=" + }, + "node_modules/semistandard": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/semistandard/-/semistandard-16.0.1.tgz", + "integrity": "sha512-ApAJ9fMAIwYuk5xI2HWSCd8s5o5L95abxU4dYl6ovUX6Rcww/7oxtaSuu9wLFL/Gfj/EXx1h6S4itXy5vyL60Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "path-root-regex": "^0.1.0" + "eslint": "^7.27.0", + "eslint-config-semistandard": "16.0.0", + "eslint-config-standard": "16.0.3", + "eslint-config-standard-jsx": "10.0.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-react": "~7.21.5", + "standard-engine": "^14.0.0" + }, + "bin": { + "semistandard": "bin/cmd.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=10.12.0" } }, - "node_modules/path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" } }, - "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" - }, - "node_modules/path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==", + "node_modules/semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==", "dev": true, "dependencies": { - "pify": "^2.0.0" + "sver-compat": "^1.5.0" }, "engines": { - "node": ">=4" + "node": ">= 0.10" } }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "peer": true, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" }, "engines": { - "node": ">=0.12" + "node": ">= 0.8.0" } }, - "node_modules/peer": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/peer/-/peer-0.2.10.tgz", - "integrity": "sha512-G0HACAPv6mK0i+4v/pICouo7YG2qJi5Fkikayfv/+IDovTeOW4VpsRJ9YXe+49MfknXJrc6O93GE7qg7knBEeA==", - "dependencies": { - "body-parser": "^1.18.3", - "cors": "~2.8.4", - "express": "^4.16.3", - "optimist": "~0.6.1", - "ws": "6.0.0" - }, - "bin": { - "peerjs": "bin/peerjs" - }, - "engines": { - "node": ">=0.8" - } + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, - "node_modules/peer/node_modules/ws": { + "node_modules/serialize-javascript": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.0.0.tgz", - "integrity": "sha512-c2UlYcAZp1VS8AORtpq6y4RJIkJ9dQz18W32SpR/qXGfLDZ2jU4y4wKvvZwqbi7U6gxFQTeE+urMbXU/tsDy4w==", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, "dependencies": { - "async-limiter": "~1.0.0" + "randombytes": "^2.1.0" } }, - "node_modules/peerjs": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/peerjs/-/peerjs-1.4.6.tgz", - "integrity": "sha512-0XA105/9yBFGxfpyCjlI1bcBiyPmXHs8+UDvO2j1WGnY+FXilMn35+P/3t8HzKnUnR1SX0PRkDSk8kM17ciNxA==", + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dependencies": { - "@swc/helpers": "^0.3.13", - "eventemitter3": "^4.0.7", - "peerjs-js-binarypack": "1.0.1", - "webrtc-adapter": "^7.7.1" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/peer" - } - }, - "node_modules/peerjs-js-binarypack": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/peerjs-js-binarypack/-/peerjs-js-binarypack-1.0.1.tgz", - "integrity": "sha512-N6aeia3NhdpV7kiGxJV5xQiZZCVEEVjRz2T2C6UZQiBkHWHzUv/oWA4myQLcwBwO8LUoR1KWW5oStvwVesmfCg==" - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, - "node_modules/pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "node_modules/pinkie-promise": { + "node_modules/set-value": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "dependencies": { - "pinkie": "^2.0.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", + "node_modules/set-value/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" + "isobject": "^3.0.1" }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/pkg-conf/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "node_modules/pkg-conf/node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", - "dev": true, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "peer": true, "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" }, - "engines": { - "node": ">=4" + "bin": { + "sha.js": "bin.js" } }, - "node_modules/pkg-conf/node_modules/locate-path": { + "node_modules/shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/pkg-conf/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/pkg-conf/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "node_modules/showdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz", + "integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" + "commander": "^9.0.0" }, - "engines": { - "node": ">=4" + "bin": { + "showdown": "bin/showdown.js" + }, + "funding": { + "type": "individual", + "url": "https://www.paypal.me/tiviesantos" } }, - "node_modules/pkg-conf/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "node_modules/showdown/node_modules/commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", "dev": true, "engines": { - "node": ">=4" + "node": "^12.20.0 || >=14" } }, - "node_modules/pkg-conf/node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", - "dev": true, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pkg-conf/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" }, - "node_modules/pkg-config": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", - "integrity": "sha512-ft/WI9YK6FuTuw4Ql+QUaNXtm/ASQNqDUUsZEgFZKyFpW6amyP8Gx01xrRs8KdiNbbqXfYxkOXplpq1euWbOjw==", + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/simple-aes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/simple-aes/-/simple-aes-0.1.1.tgz", + "integrity": "sha512-R4Dqz3TlzCyG3qkunLvYWC/gToWvOBqyR9EHIAQQZq2KOnybprjt2zcrWi1DZOyEH9QGLbDl9hqk4TTsxwLIqw==", + "peer": true + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "dependencies": { - "debug-log": "^1.0.0", - "find-root": "^1.0.0", - "xtend": "^4.0.1" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "engines": { - "node": ">=0.10" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "engines": { - "node": ">=4" + "node": ">= 6.0.0", + "npm": ">= 3.0.0" } }, - "node_modules/pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true + "node_modules/smartquotes": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/smartquotes/-/smartquotes-2.3.2.tgz", + "integrity": "sha512-0R6YJ5hLpDH4mZR7N5eZ12oCMLspvGOHL9A9SEm2e3b/CQmQidekW4SWSKEmor/3x6m3NCBBEqLzikcZC9VJNQ==", + "engines": { + "node": ">=4.0.0" + } }, - "node_modules/portfinder": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", - "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, "dependencies": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.5" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "engines": { - "node": ">= 0.12.0" - } - }, - "node_modules/portfinder/node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" + "node": ">=0.10.0" } }, - "node_modules/portfinder/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, "dependencies": { - "ms": "^2.1.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/portfinder/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "dev": true, "dependencies": { - "minimist": "^1.2.6" + "is-descriptor": "^1.0.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/portfinder/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } + "node_modules/snapdragon-util/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, - "node_modules/pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, "engines": { - "node": ">=0.4.0" + "node": ">=0.10.0" } }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==" - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "node_modules/snapdragon/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "dev": true, "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" + "kind-of": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" + "node_modules/snapdragon/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "node_modules/snapdragon/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "dev": true, "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "kind-of": "^3.0.2" }, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" - }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" - }, - "node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "node_modules/snapdragon/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/punycode2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/punycode2/-/punycode2-1.0.1.tgz", - "integrity": "sha512-+TXpd9YRW4YUZZPoRHJ3DILtWwootGc2DsgvfHmklQ8It1skINAuqSdqizt5nlTaBmwrYACHkHApCXjc9gHk2Q==", + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, "engines": { - "node": ">=0.10" + "node": ">=0.10.0" } }, - "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "node_modules/socks": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", "dependencies": { - "side-channel": "^1.0.4" + "ip": "^1.1.5", + "smart-buffer": "^4.2.0" }, "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, "engines": { - "node": ">= 0.8" + "node": ">= 10" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "peer": true, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "ms": "2.1.2" + }, "engines": { - "node": ">= 0.6" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "devOptional": true, "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/re2": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/re2/-/re2-1.17.7.tgz", - "integrity": "sha512-X8GSuiBoVWwcjuppqSjsIkRxNUKDdjhkO9SBekQbZ2ksqWUReCy7DQPWOVpoTnpdtdz5PIpTTxTFzvJv5UMfjA==", - "hasInstallScript": true, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, "dependencies": { - "install-artifact-from-github": "^1.3.1", - "nan": "^2.16.0", - "node-gyp": "^9.0.0" + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, - "node_modules/read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==", + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, + "node_modules/sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", "dev": true, - "dependencies": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - }, "engines": { - "node": ">=4" + "node": ">= 0.10" } }, - "node_modules/read-pkg-up": { + "node_modules/spawn-wrap": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "dependencies": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "node_modules/spawn-wrap/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { - "locate-path": "^2.0.0" + "glob": "^7.1.3" }, - "engines": { - "node": ">=4" + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "node_modules/spawn-wrap/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" }, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/read-pkg-up/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/read-pkg-up/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "node_modules/spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "is-plain-object": "^2.0.4" }, "engines": { - "node": ">=0.10" + "node": ">=0.10.0" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "node_modules/split-string/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "resolve": "^1.1.6" + "isobject": "^3.0.1" }, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", - "peer": true, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", "dependencies": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" + "minipass": "^3.1.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-redis" + "node": ">= 8" } }, - "node_modules/redis-commands": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", - "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==", - "peer": true - }, - "node_modules/redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", - "peer": true, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "dev": true, "engines": { - "node": ">=4" + "node": "*" } }, - "node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "peer": true, + "node_modules/standard-engine": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-14.0.1.tgz", + "integrity": "sha512-7FEzDwmHDOGva7r9ifOzD3BGdTbA7ujJ50afLVdW/tK14zQEptJjbFuUfn50irqdHDcTbNh0DTIoMPynMCXb0Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "redis-errors": "^1.0.0" + "get-stdin": "^8.0.0", + "minimist": "^1.2.5", + "pkg-conf": "^3.1.0", + "xdg-basedir": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8.10" } }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", "dev": true, "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/regex-not/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "is-descriptor": "^0.1.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/regex-not/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "node_modules/static-extend/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", "dev": true, "dependencies": { - "is-plain-object": "^2.0.4" + "kind-of": "^3.0.2" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/regex-not/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "is-buffer": "^1.1.5" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "node_modules/static-extend/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/static-extend/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" + "kind-of": "^3.0.2" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true, "engines": { - "node": ">=6.5.0" + "node": ">=0.10.0" } }, - "node_modules/remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" + "is-buffer": "^1.1.5" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/remove-bom-buffer/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==", + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "dependencies": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", - "dev": true - }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "node_modules/static-extend/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", - "dev": true, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "engines": { - "node": ">=0.10" + "node": ">= 0.8" } }, - "node_modules/replace-ext": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", - "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", - "dev": true, + "node_modules/stoppable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", "engines": { - "node": ">= 0.10" + "node": ">=4", + "npm": ">=6" } }, - "node_modules/replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==", - "dev": true, + "node_modules/stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/string": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", + "integrity": "sha512-LbvprpPZT/39QKfNrlPX9vXtS7If80vqbPQ7clnHQb5oVOM5hz/cs3iQCCZjvQDwsAWl+HpLQX3gRgN6IC8t3g==" + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - }, - "engines": { - "node": ">= 0.10" + "safe-buffer": "~5.1.0" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "node_modules/request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { - "lodash": "^4.17.19" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" + "node": ">=8" } }, - "node_modules/request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", + "node_modules/string.prototype.matchall": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", + "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", "dev": true, "dependencies": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "engines": { - "node": ">=0.12.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.1", + "side-channel": "^1.0.4" }, - "peerDependencies": { - "request": "^2.34" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "node_modules/string.prototype.trimend": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, - "engines": { - "node": ">=0.6" + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "node_modules/string.prototype.trimstart": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, - "bin": { - "uuid": "bin/uuid" + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", - "dev": true - }, - "node_modules/require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha512-Xct+41K3twrbBHdxAgMoOS+cNcoqIjfM2/VxBF4LL2hVph7YsF8VSKyQ3BDFZwEVbok9yeDl2le/qo0S77WG2w==", + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "dependencies": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "engines": { "node": ">=0.10.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + "node_modules/struct": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/struct/-/struct-0.0.12.tgz", + "integrity": "sha512-PV2nfc79Od13idbDWQZcsBZlmeDTdPP67cOYTUWZfYE77MWGhEGgGIAFtpO1UdOvDzB3I//jbFaA09JXNRAO3A==", + "peer": true, + "engines": { + "node": ">0.6.0" + } }, - "node_modules/requizzle": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", - "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": { - "lodash": "^4.17.14" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "node_modules/sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==", "dev": true, "dependencies": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" } }, - "node_modules/resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha512-kT10v4dhrlLNcnO084hEjvXCI1wUG9qZLoz2RogxqDQQYy7IxjI/iMUkOtQTNEh6rzHxvdQWHsJyel1pKOVCxg==", + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + }, + "node_modules/table": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10.0.0" } }, - "node_modules/resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==", + "node_modules/table/node_modules/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, "dependencies": { - "value-or-function": "^3.0.0" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">= 0.10" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "node_modules/table/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" + }, + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">= 10" } }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, "engines": { - "node": ">=0.12" + "node": ">=8" } }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "engines": { - "node": ">= 4" - } + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "peer": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "peer": true }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "peer": true, + "node_modules/through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" + "through2": "~2.0.0", + "xtend": "~4.0.0" } }, - "node_modules/rollup": { - "version": "2.75.7", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz", - "integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==", + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/rollup-plugin-dts": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", - "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==", "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tiny-secp256k1": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-2.2.1.tgz", + "integrity": "sha512-/U4xfVqnVxJXN4YVsru0E6t5wVncu2uunB8+RVR40fYUxkKYUPS10f+ePQZgFBoE/Jbf9H1NBveupF2VmB58Ng==", + "peer": true, "dependencies": { - "magic-string": "^0.26.1" + "uint8array-tools": "0.0.7" }, "engines": { - "node": ">=v12.22.11" - }, - "funding": { - "url": "https://github.com/sponsors/Swatinem" - }, - "optionalDependencies": { - "@babel/code-frame": "^7.16.7" - }, - "peerDependencies": { - "rollup": "^2.55", - "typescript": "^4.1" + "node": ">=14.0.0" } }, - "node_modules/rollup-plugin-dts/node_modules/magic-string": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", - "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", + "node_modules/tlds": { + "version": "1.231.0", + "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.231.0.tgz", + "integrity": "sha512-L7UQwueHSkGxZHQBXHVmXW64oi+uqNtzFt2x6Ssk7NVnpIbw16CRs4eb/jmKOZ9t2JnqZ/b3Cfvo97lnXqKrhw==", + "bin": { + "tlds": "bin.js" + } + }, + "node_modules/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==", "dev": true, "dependencies": { - "sourcemap-codec": "^1.4.8" + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" }, "engines": { - "node": ">=12" + "node": ">=0.10.0" } }, - "node_modules/rollup/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=4" } }, - "node_modules/rtcpeerconnection-shim": { - "version": "1.2.15", - "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz", - "integrity": "sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw==", + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "dev": true, "dependencies": { - "sdp": "^2.6.0" + "kind-of": "^3.0.2" }, "engines": { - "node": ">=6.0.0", - "npm": ">=3.10.0" + "node": ">=0.10.0" } }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } + "node_modules/to-object-path/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, "dependencies": { - "queue-microtask": "^1.2.2" + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/run-parallel-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", - "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "dependencies": { - "queue-microtask": "^1.2.2" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" - }, - "node_modules/rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", + "node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", "dev": true, "dependencies": { - "symbol-observable": "1.0.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" }, "engines": { - "npm": ">=2.0.0" + "node": ">=0.10.0" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "node_modules/to-regex/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "dependencies": { - "ret": "~0.1.10" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "node_modules/saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "node_modules/to-regex/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "dependencies": { - "xmlchars": "^2.2.0" + "is-plain-object": "^2.0.4" }, "engines": { - "node": ">=v12.22.7" + "node": ">=0.10.0" } }, - "node_modules/sdp": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.12.0.tgz", - "integrity": "sha512-jhXqQAQVM+8Xj5EjJGVweuEzgtGWb3tmEEpl3CLP3cStInSbVHSg0QWOGQzNq8pSID4JkpeV2mPqlMDLrm0/Vw==" - }, - "node_modules/secure-compare": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", - "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==" - }, - "node_modules/semistandard": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/semistandard/-/semistandard-13.0.1.tgz", - "integrity": "sha512-2GkuX4BsoMEYoufJYRz8/ERbYDfgOO3yP29IBaoXtxl202azlkV1MsFyoSFiM6GBUfL7MSUxSy38KfM9oDAE2g==", - "dev": true, - "dependencies": { - "eslint": "~5.4.0", - "eslint-config-semistandard": "13.0.0", - "eslint-config-standard": "12.0.0", - "eslint-config-standard-jsx": "6.0.2", - "eslint-plugin-import": "~2.14.0", - "eslint-plugin-node": "~7.0.1", - "eslint-plugin-promise": "~4.0.0", - "eslint-plugin-react": "~7.11.1", - "eslint-plugin-standard": "~4.0.0", - "standard-engine": "~10.0.0" - }, - "bin": { - "semistandard": "bin/cmd.js" + "node_modules/to-regex/node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==", + "node_modules/to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==", "dev": true, "dependencies": { - "sver-compat": "^1.5.0" + "through2": "^2.0.3" }, "engines": { "node": ">= 0.10" } }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "engines": { - "node": ">= 0.8.0" + "node": ">=0.6" } }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "node_modules/token-stream": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", + "integrity": "sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=" }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "node_modules/tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" }, "engines": { - "node": ">= 0.8.0" + "node": ">=6" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" + "punycode": "^2.1.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/set-value/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, + "node_modules/treeify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", + "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==", + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.6" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "node_modules/ts-morph": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-10.1.0.tgz", + "integrity": "sha512-hfskRPAbc+N1+2QvPLvJ0MOrhcwxJuBlCbX+D+9T7UnrZZqsdbmWb6FfywQ7sghyqwok6Pc8ZPwzaumlOJ8OBA==", "peer": true, "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" + "@ts-morph/common": "~0.9.2", + "code-block-writer": "^10.1.1" } }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" } }, - "node_modules/showdown": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/showdown/-/showdown-1.9.1.tgz", - "integrity": "sha512-9cGuS382HcvExtf5AHk7Cb4pAeQQ+h0eTr33V1mu+crYWV4KvWAw6el92bDrqGEk5d46Ai/fhbEUwqJ/mTCNEA==", + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "dependencies": { - "yargs": "^14.2" + "minimist": "^1.2.0" }, "bin": { - "showdown": "bin/showdown.js" + "json5": "lib/cli.js" } }, - "node_modules/showdown/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } + "node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, - "node_modules/showdown/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "dependencies": { - "color-convert": "^1.9.0" + "prelude-ls": "~1.1.2" }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/showdown/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { - "node": ">=6" - } - }, - "node_modules/showdown/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "node": ">=8" } }, - "node_modules/showdown/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/showdown/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/showdown/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/showdown/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/showdown/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, "engines": { - "node": ">=4" + "node": ">= 0.6" } }, - "node_modules/showdown/node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true }, - "node_modules/showdown/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "is-typedarray": "^1.0.0" } }, - "node_modules/showdown/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/typeforce": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", + "peer": true + }, + "node_modules/typescript": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": ">=6" + "node": ">=4.2.0" } }, - "node_modules/showdown/node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, - "node_modules/showdown/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, + "node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "random-bytes": "~1.0.0" }, "engines": { - "node": ">=6" + "node": ">= 0.8" } }, - "node_modules/showdown/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/showdown/node_modules/yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" + "node_modules/uint8array-tools": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/uint8array-tools/-/uint8array-tools-0.0.7.tgz", + "integrity": "sha512-vrrNZJiusLWoFWBqz5Y5KMCgP9W9hnjZHzZiZRT8oNAkq3d5Z5Oe76jAvVVSRh4U8GGR90N2X1dWtrhvx6L8UQ==", + "peer": true, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/showdown/node_modules/yargs-parser": { - "version": "15.0.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.3.tgz", - "integrity": "sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==", + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==" - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/simple-aes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/simple-aes/-/simple-aes-0.1.1.tgz", - "integrity": "sha512-R4Dqz3TlzCyG3qkunLvYWC/gToWvOBqyR9EHIAQQZq2KOnybprjt2zcrWi1DZOyEH9QGLbDl9hqk4TTsxwLIqw==", - "peer": true + "node_modules/underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha512-5WsVTFcH1ut/kkhAaHf4PVgI8c7++GiVcpCGxPouI6ZVjsqPnSDf8h/8HtVqc0t4fzRXwnMK70EcZeAs3PIddg==" }, - "node_modules/slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "node_modules/undertaker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", + "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", "dev": true, "dependencies": { - "is-fullwidth-code-point": "^2.0.0" + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "fast-levenshtein": "^1.0.0", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" }, "engines": { - "node": ">=4" + "node": ">= 0.10" } }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==", "dev": true, "engines": { - "node": ">=4" + "node": ">= 0.10" } }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } + "node_modules/undertaker/node_modules/fast-levenshtein": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", + "integrity": "sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==", + "dev": true }, - "node_modules/smartquotes": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/smartquotes/-/smartquotes-2.3.2.tgz", - "integrity": "sha512-0R6YJ5hLpDH4mZR7N5eZ12oCMLspvGOHL9A9SEm2e3b/CQmQidekW4SWSKEmor/3x6m3NCBBEqLzikcZC9VJNQ==", + "node_modules/union": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", + "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", + "dependencies": { + "qs": "^6.4.0" + }, "engines": { - "node": ">=4.0.0" + "node": ">= 0.8.0" } }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "unique-slug": "^2.0.0" } }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "imurmurhash": "^0.1.4" } }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "node_modules/unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", "dev": true, "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" } }, - "node_modules/snapdragon-util/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "isarray": "1.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/snapdragon/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/snapdragon/node_modules/is-data-descriptor": { + "node_modules/unset-value/node_modules/has-values": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { "node": ">=0.10.0" } }, - "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4", + "yarn": "*" } }, - "node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" + "punycode": "^2.1.0" } }, - "node_modules/snapdragon/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true }, - "node_modules/socks": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", - "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", - "dependencies": { - "ip": "^1.1.5", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" }, - "node_modules/socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "node_modules/url-regex-safe": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-regex-safe/-/url-regex-safe-3.0.0.tgz", + "integrity": "sha512-+2U40NrcmtWFVjuxXVt9bGRw6c7/MgkGKN9xIfPrT/2RX0LTkkae6CCEDp93xqUN0UKm/rr821QnHd2dHQmN3A==", "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "ip-regex": "4.3.0", + "tlds": "^1.228.0" }, "engines": { - "node": ">= 10" - } - }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" + "node": ">= 10.12.0" }, - "engines": { - "node": ">=6.0" + "peerDependencies": { + "re2": "^1.17.2" }, "peerDependenciesMeta": { - "supports-color": { + "re2": { "optional": true } } }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", - "dev": true - }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "node_modules/sparkles": { + "node_modules/utils-merge": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true, + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "engines": { - "node": ">= 0.10" + "node": ">= 0.4.0" } }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" } }, - "node_modules/spdx-exceptions": { + "node_modules/v8-compile-cache": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "node_modules/v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "dev": true, "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", - "dev": true - }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, - "node_modules/split-string/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "node_modules/value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==", "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, - "node_modules/split-string/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, + "node_modules/varuint-bitcoin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", + "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", + "peer": true, "dependencies": { - "is-plain-object": "^2.0.4" - }, + "safe-buffer": "^5.1.1" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, - "node_modules/split-string/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, + "node_modules/video-extensions": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/video-extensions/-/video-extensions-1.2.0.tgz", + "integrity": "sha512-TriMl18BHEsh2KuuSA065tbu4SNAC9fge7k8uKoTTofTq89+Xsg4K1BGbmSVETwUZhqSjd9KwRCNwXAW/buXMg==", "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "dev": true, "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, - "node_modules/ssri": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", - "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "node_modules/vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", "dev": true, + "dependencies": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, "engines": { - "node": "*" + "node": ">= 0.10" } }, - "node_modules/standard-engine": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-10.0.0.tgz", - "integrity": "sha512-91BjmzIRZbFmyOY73R6vaDd/7nw5qDWsfpJW5/N+BCXFgmvreyfrRg7oBSu4ihL0gFGXfnwCImJm6j+sZDQQyw==", + "node_modules/vinyl-fs/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "dependencies": { - "deglob": "^3.0.0", - "get-stdin": "^6.0.0", - "minimist": "^1.1.0", - "pkg-conf": "^2.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "node_modules/vinyl-fs/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==", "dev": true, "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "node_modules/vinyl-sourcemap/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "remove-trailing-separator": "^1.0.1" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", - "dev": true, + "node_modules/vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "node_modules/w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "browser-process-hrtime": "^1.0.0" } }, - "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, + "node_modules/w3c-xmlserializer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", + "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", "dependencies": { - "is-buffer": "^1.1.5" + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/static-extend/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, - "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, + "node_modules/webrtc-adapter": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/webrtc-adapter/-/webrtc-adapter-7.7.1.tgz", + "integrity": "sha512-TbrbBmiQBL9n0/5bvDdORc6ZfRY/Z7JnEj+EYOD1ghseZdpJ+nF2yx14k3LgQKc7JZnG7HAcL+zHnY25So9d7A==", "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "rtcpeerconnection-shim": "^1.2.15", + "sdp": "^2.12.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6.0.0", + "npm": ">=3.10.0" } }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dependencies": { + "iconv-lite": "0.6.3" + }, "engines": { - "node": ">= 0.8" + "node": ">=12" } }, - "node_modules/stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==", - "dev": true, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/stoppable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "engines": { - "node": ">=4", - "npm": ">=6" - } - }, - "node_modules/stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", - "dev": true - }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "node_modules/string": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", - "integrity": "sha512-LbvprpPZT/39QKfNrlPX9vXtS7If80vqbPQ7clnHQb5oVOM5hz/cs3iQCCZjvQDwsAWl+HpLQX3gRgN6IC8t3g==", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" + "node": ">=12" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/whatwg-url": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", + "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "isexe": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "which": "bin/which" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "node_modules/whoops": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/whoops/-/whoops-4.1.1.tgz", + "integrity": "sha512-FuLcMHGFfTLJvnwEy6OlxDzRKzjuWibogBVBGBICHQY1LRozEbmNDKea22fNI4fQsMt99aiP/Hyp0Z5CDGxq/Q==", "dependencies": { - "ansi-regex": "^5.0.1" + "clean-stack": "~3.0.0", + "mimic-fn": "~3.1.0" }, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, + "node_modules/whoops/node_modules/clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "dependencies": { + "escape-string-regexp": "4.0.0" + }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, + "node_modules/whoops/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/struct": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/struct/-/struct-0.0.12.tgz", - "integrity": "sha512-PV2nfc79Od13idbDWQZcsBZlmeDTdPP67cOYTUWZfYE77MWGhEGgGIAFtpO1UdOvDzB3I//jbFaA09JXNRAO3A==", + "node_modules/whoops/node_modules/mimic-fn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wif": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", + "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", "peer": true, + "dependencies": { + "bs58check": "<3.0.0" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "engines": { - "node": ">0.6.0" + "node": ">=0.10.0" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dependencies": { - "has-flag": "^4.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/ws": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", + "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", "engines": { - "node": ">= 0.4" + "node": ">=10.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, - "node_modules/sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==", + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true, - "dependencies": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" + "engines": { + "node": ">=8" } }, - "node_modules/symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "dev": true, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, - "node_modules/table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", - "dev": true, - "dependencies": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "engines": { - "node": ">=4.0.0" - } + "node_modules/xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=" }, - "node_modules/table/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.4" } }, - "node_modules/table/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dependencies": { - "color-convert": "^1.9.0" + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/table/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/table/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { - "color-name": "1.1.3" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/table/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/table/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/table/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, + "node_modules/yargs/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/table/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, + "node_modules/yargs/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { - "ansi-regex": "^3.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/table/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, + "node_modules/yargs/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dependencies": { - "has-flag": "^3.0.0" + "p-limit": "^2.2.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==", - "dev": true - }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "node_modules/yargs/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "engines": { - "node": ">= 10" - } - }, - "node_modules/tar/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "~4.0.0" + "node": ">=6" } }, - "node_modules/time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tiny-secp256k1": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-2.2.1.tgz", - "integrity": "sha512-/U4xfVqnVxJXN4YVsru0E6t5wVncu2uunB8+RVR40fYUxkKYUPS10f+ePQZgFBoE/Jbf9H1NBveupF2VmB58Ng==", + "node_modules/zeromq": { + "version": "5.2.8", + "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-5.2.8.tgz", + "integrity": "sha512-bXzsk7KOmgLSv1tC0Ms1VXBy90+Rz27ZYf27cLuldRYbpqYpuWJfxxHFhO710t22zgWBnmdUP0m3SKFpLI0u5g==", + "hasInstallScript": true, "peer": true, "dependencies": { - "uint8array-tools": "0.0.7" + "nan": "2.14.2", + "node-gyp-build": "^4.2.3" }, "engines": { - "node": ">=14.0.0" + "node": ">=6.0" } }, - "node_modules/tlds": { - "version": "1.231.0", - "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.231.0.tgz", - "integrity": "sha512-L7UQwueHSkGxZHQBXHVmXW64oi+uqNtzFt2x6Ssk7NVnpIbw16CRs4eb/jmKOZ9t2JnqZ/b3Cfvo97lnXqKrhw==", - "bin": { - "tlds": "bin.js" + "node_modules/zeromq/node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "peer": true + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" } }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" + "requires": { + "@babel/highlight": "^7.16.7" } }, - "node_modules/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==", + "@babel/compat-data": { + "version": "7.17.10", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz", + "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==", + "dev": true + }, + "@babel/core": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.2.tgz", + "integrity": "sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ==", "dev": true, - "dependencies": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" + "requires": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-compilation-targets": "^7.18.2", + "@babel/helper-module-transforms": "^7.18.0", + "@babel/helpers": "^7.18.2", + "@babel/parser": "^7.18.0", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "@babel/generator": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", + "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@babel/types": "^7.18.2", + "@jridgewell/gen-mapping": "^0.3.0", + "jsesc": "^2.5.1" + }, + "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", + "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + } } }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "@babel/helper-compilation-targets": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz", + "integrity": "sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" + "requires": { + "@babel/compat-data": "^7.17.10", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.20.2", + "semver": "^6.3.0" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, - "node_modules/to-object-path/node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "@babel/helper-environment-visitor": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz", + "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==", "dev": true }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "@babel/helper-function-name": { + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz", + "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/template": "^7.16.7", + "@babel/types": "^7.17.0" } }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/to-regex/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "@babel/helper-module-transforms": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz", + "integrity": "sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA==", "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.0", + "@babel/types": "^7.18.0" } }, - "node_modules/to-regex/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "@babel/helper-simple-access": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz", + "integrity": "sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ==", "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.18.2" } }, - "node_modules/to-regex/node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==", + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true + }, + "@babel/helpers": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz", + "integrity": "sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg==", "dev": true, - "dependencies": { - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" + "requires": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.18.2", + "@babel/types": "^7.18.2" } }, - "node_modules/token-stream": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", - "integrity": "sha512-nfjOAu/zAWmX9tgwi5NRp7O7zTDUD1miHiB40klUnAh9qnL1iXdgzcz/i5dMaL5jahcBAaSfmNOBBJBLJW8TEg==" - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "@babel/highlight": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", + "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/treeify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", - "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==", - "peer": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/ts-morph": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-10.1.0.tgz", - "integrity": "sha512-hfskRPAbc+N1+2QvPLvJ0MOrhcwxJuBlCbX+D+9T7UnrZZqsdbmWb6FfywQ7sghyqwok6Pc8ZPwzaumlOJ8OBA==", - "peer": true, "dependencies": { - "@ts-morph/common": "~0.9.2", - "code-block-writer": "^10.1.1" + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "@babel/parser": { + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.4.tgz", + "integrity": "sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow==", + "dev": true }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" + "@babel/traverse": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz", + "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.18.2", + "@babel/helper-environment-visitor": "^7.18.2", + "@babel/helper-function-name": "^7.17.9", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.18.0", + "@babel/types": "^7.18.2", + "debug": "^4.1.0", + "globals": "^11.1.0" }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" + "@babel/types": { + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz", + "integrity": "sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" } }, - "node_modules/typeforce": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", - "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", - "peer": true - }, - "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } } }, - "node_modules/uint8array-tools": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/uint8array-tools/-/uint8array-tools-0.0.7.tgz", - "integrity": "sha512-vrrNZJiusLWoFWBqz5Y5KMCgP9W9hnjZHzZiZRT8oNAkq3d5Z5Oe76jAvVVSRh4U8GGR90N2X1dWtrhvx6L8UQ==", + "@fabric/core": { + "version": "git+ssh://git@github.com/FabricLabs/fabric.git#d35eac2368f5739fe0f757a7f64e75bc2b7bde86", + "from": "@fabric/core@FabricLabs/fabric#feature/node-16", "peer": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha512-5WsVTFcH1ut/kkhAaHf4PVgI8c7++GiVcpCGxPouI6ZVjsqPnSDf8h/8HtVqc0t4fzRXwnMK70EcZeAs3PIddg==", - "dev": true - }, - "node_modules/undertaker": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", - "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "fast-levenshtein": "^1.0.0", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" + "requires": { + "@fabric/zmq": "github:FabricLabs/fabric-zmq#master", + "@webassemblyjs/ast": "^1.8.5", + "arbitrary": "^1.4.10", + "base58check": "^2.0.0", + "bcoin": "github:bcoin-org/bcoin#v2.2.0", + "bech32-buffer": "^0.2.0", + "bip-schnorr": "^0.6.6", + "bip32": "^3.0.1", + "bip39": "^3.0.4", + "bip65": "^1.0.3", + "bip68": "^1.0.4", + "bitcoinjs-lib": "^6.0.0", + "blessed": "^0.1.81", + "clightningjs": "^0.2.2", + "commander": "^6.1.0", + "content-type": "^1.0.4", + "dotparser": "^0.3.0", + "ecpair": "^2.0.1", + "elliptic": "^6.5.4", + "fast-json-patch": "^2.0.7", + "fd-chunk-store": "^2.0.0", + "glob-run": "^0.1.6", + "javascript-state-machine": "^3.1.0", + "jayson": "^3.4.4", + "js-beautify": "^1.14.3", + "json-pointer": "^0.6.0", + "level": "^7.0.1", + "lodash.merge": "^4.6.2", + "merkletreejs": "^0.1.6", + "minsc": "^0.2.0", + "mkdirp": "^1.0.4", + "p-event": "^4.2.0", + "path-match": "^1.2.4", + "pluralize": "^8.0.0", + "redis": "^3.1.2", + "rimraf": "^2.6.2", + "simple-aes": "^0.1.1", + "struct": "^0.0.12", + "tiny-secp256k1": "^2.2.1", + "ts-morph": "^10.0.2" }, - "engines": { - "node": ">= 0.10" + "dependencies": { + "abstract-leveldown": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", + "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", + "peer": true, + "requires": { + "buffer": "^6.0.3", + "catering": "^2.0.0", + "is-buffer": "^2.0.5", + "level-concat-iterator": "^3.0.0", + "level-supports": "^2.0.1", + "queue-microtask": "^1.2.3" + } + }, + "deferred-leveldown": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-7.0.0.tgz", + "integrity": "sha512-QKN8NtuS3BC6m0B8vAnBls44tX1WXAFATUsJlruyAYbZpysWV3siH6o/i3g9DCHauzodksO60bdj5NazNbjCmg==", + "peer": true, + "requires": { + "abstract-leveldown": "^7.2.0", + "inherits": "^2.0.3" + } + }, + "encoding-down": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-7.1.0.tgz", + "integrity": "sha512-ky47X5jP84ryk5EQmvedQzELwVJPjCgXDQZGeb9F6r4PdChByCGHTBrVcF3h8ynKVJ1wVbkxTsDC8zBROPypgQ==", + "peer": true, + "requires": { + "abstract-leveldown": "^7.2.0", + "inherits": "^2.0.3", + "level-codec": "^10.0.0", + "level-errors": "^3.0.0" + } + }, + "fast-json-patch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", + "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", + "peer": true, + "requires": { + "fast-deep-equal": "^2.0.1" + } + }, + "level": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level/-/level-7.0.1.tgz", + "integrity": "sha512-w3E64+ALx2eZf8RV5JL4kIcE0BFAvQscRYd1yU4YVqZN9RGTQxXSvH202xvK15yZwFFxRXe60f13LJjcJ//I4Q==", + "peer": true, + "requires": { + "level-js": "^6.1.0", + "level-packager": "^6.0.1", + "leveldown": "^6.1.0" + } + }, + "level-codec": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-10.0.0.tgz", + "integrity": "sha512-QW3VteVNAp6c/LuV6nDjg7XDXx9XHK4abmQarxZmlRSDyXYk20UdaJTSX6yzVvQ4i0JyWSB7jert0DsyD/kk6g==", + "peer": true, + "requires": { + "buffer": "^6.0.3" + } + }, + "level-concat-iterator": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-3.1.0.tgz", + "integrity": "sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==", + "peer": true, + "requires": { + "catering": "^2.1.0" + } + }, + "level-errors": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-3.0.1.tgz", + "integrity": "sha512-tqTL2DxzPDzpwl0iV5+rBCv65HWbHp6eutluHNcVIftKZlQN//b6GEnZDM2CvGZvzGYMwyPtYppYnydBQd2SMQ==", + "peer": true + }, + "level-iterator-stream": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-5.0.0.tgz", + "integrity": "sha512-wnb1+o+CVFUDdiSMR/ZymE2prPs3cjVLlXuDeSq9Zb8o032XrabGEXcTCsBxprAtseO3qvFeGzh6406z9sOTRA==", + "peer": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "level-js": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/level-js/-/level-js-6.1.0.tgz", + "integrity": "sha512-i7mPtkZm68aewfv0FnIUWvFUFfoyzIvVKnUmuQGrelEkP72vSPTaA1SGneWWoCV5KZJG4wlzbJLp1WxVNGuc6A==", + "peer": true, + "requires": { + "abstract-leveldown": "^7.2.0", + "buffer": "^6.0.3", + "inherits": "^2.0.3", + "ltgt": "^2.1.2", + "run-parallel-limit": "^1.1.0" + } + }, + "level-packager": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-6.0.1.tgz", + "integrity": "sha512-8Ezr0XM6hmAwqX9uu8IGzGNkWz/9doyPA8Oo9/D7qcMI6meJC+XhIbNYHukJhIn8OGdlzQs/JPcL9B8lA2F6EQ==", + "peer": true, + "requires": { + "encoding-down": "^7.1.0", + "levelup": "^5.1.1" + } + }, + "level-supports": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-2.1.0.tgz", + "integrity": "sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==", + "peer": true + }, + "leveldown": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-6.1.1.tgz", + "integrity": "sha512-88c+E+Eizn4CkQOBHwqlCJaTNEjGpaEIikn1S+cINc5E9HEvJ77bqY4JY/HxT5u0caWqsc3P3DcFIKBI1vHt+A==", + "peer": true, + "requires": { + "abstract-leveldown": "^7.2.0", + "napi-macros": "~2.0.0", + "node-gyp-build": "^4.3.0" + } + }, + "levelup": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-5.1.1.tgz", + "integrity": "sha512-0mFCcHcEebOwsQuk00WJwjLI6oCjbBuEYdh/RaRqhjnyVlzqf41T1NnDtCedumZ56qyIh8euLFDqV1KfzTAVhg==", + "peer": true, + "requires": { + "catering": "^2.0.0", + "deferred-leveldown": "^7.0.0", + "level-errors": "^3.0.1", + "level-iterator-stream": "^5.0.0", + "level-supports": "^2.0.1", + "queue-microtask": "^1.2.3" + } + } } }, - "node_modules/undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==", - "dev": true, - "engines": { - "node": ">= 0.10" + "@fabric/zmq": { + "version": "git+ssh://git@github.com/FabricLabs/fabric-zmq.git#b7a86035f74bac97f272d3adcd708546b034785d", + "from": "@fabric/zmq@github:FabricLabs/fabric-zmq#master", + "peer": true, + "requires": { + "zeromq": "^5.2.8" } }, - "node_modules/undertaker/node_modules/fast-levenshtein": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", - "integrity": "sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==", - "dev": true + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" }, - "node_modules/union": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", - "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", - "dependencies": { - "qs": "^6.4.0" + "@hpcc-js/wasm": { + "version": "1.12.8", + "resolved": "https://registry.npmjs.org/@hpcc-js/wasm/-/wasm-1.12.8.tgz", + "integrity": "sha512-n4q9ARKco2hpCLsuVaW6Az3cDVaua7B3DSONHkc49WtEzgY/btvcDG5Zr1P6PZDv0sQ7oPnAi9Y+W2DI++MgcQ==", + "requires": { + "yargs": "^17.3.1" }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", - "dev": true - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dependencies": { - "imurmurhash": "^0.1.4" + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" + } } }, - "node_modules/unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, "dependencies": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", - "dev": true, "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } } }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" - } + "@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } + "@jridgewell/set-array": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", + "dev": true }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", "dev": true }, - "node_modules/url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" + "@jridgewell/trace-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", + "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } }, - "node_modules/url-regex-safe": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-regex-safe/-/url-regex-safe-3.0.0.tgz", - "integrity": "sha512-+2U40NrcmtWFVjuxXVt9bGRw6c7/MgkGKN9xIfPrT/2RX0LTkkae6CCEDp93xqUN0UKm/rr821QnHd2dHQmN3A==", - "dependencies": { - "ip-regex": "4.3.0", - "tlds": "^1.228.0" - }, - "engines": { - "node": ">= 10.12.0" - }, - "peerDependencies": { - "re2": "^1.17.2" + "@metascraper/helpers": { + "version": "5.29.7", + "resolved": "https://registry.npmjs.org/@metascraper/helpers/-/helpers-5.29.7.tgz", + "integrity": "sha512-YfhqbwErZdW3V/Bp5XBzEK8Q0apv+7eriQ+NKm7fctBUjx+BpbdMhncqX5r6gjnNAkcY1N2+KEt09WAg0n5spA==", + "requires": { + "audio-extensions": "0.0.0", + "chrono-node": "2.3.8", + "condense-whitespace": "~2.0.0", + "entities": "~4.3.0", + "file-extension": "~4.0.5", + "has-values": "~2.0.1", + "image-extensions": "~1.1.0", + "is-relative-url": "~3.0.0", + "is-uri": "~1.2.4", + "iso-639-3": "~2.2.0", + "isostring": "0.0.1", + "jsdom": "~19.0.0", + "lodash": "~4.17.21", + "memoize-one": "~6.0.0", + "microsoft-capitalize": "~1.0.5", + "mime-types": "~2.1.35", + "normalize-url": "~6.1.0", + "re2": "~1.17.4", + "smartquotes": "~2.3.2", + "url-regex-safe": "~3.0.0", + "video-extensions": "~1.2.0" }, - "peerDependenciesMeta": { - "re2": { - "optional": true + "dependencies": { + "entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" } } }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "peer": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "peer": true }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "peer": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" } }, - "node_modules/v8flags": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", - "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", - "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" + "@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==", - "dev": true, - "engines": { - "node": ">= 0.10" + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } } }, - "node_modules/varuint-bitcoin": { + "@npmcli/move-file": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", - "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", - "peer": true, + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, "dependencies": { - "safe-buffer": "^5.1.1" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + } } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "@rollup/plugin-commonjs": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", + "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "requires": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" } }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "node_modules/video-extensions": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/video-extensions/-/video-extensions-1.2.0.tgz", - "integrity": "sha512-TriMl18BHEsh2KuuSA065tbu4SNAC9fge7k8uKoTTofTq89+Xsg4K1BGbmSVETwUZhqSjd9KwRCNwXAW/buXMg==", - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@rollup/plugin-inject": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz", + "integrity": "sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==", + "requires": { + "@rollup/pluginutils": "^3.1.0", + "estree-walker": "^2.0.1", + "magic-string": "^0.25.7" } }, - "node_modules/vinyl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", - "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", "dev": true, - "dependencies": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" + "requires": { + "@rollup/pluginutils": "^3.0.8" } }, - "node_modules/vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "@rollup/plugin-node-resolve": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", + "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", "dev": true, - "dependencies": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - }, - "engines": { - "node": ">= 0.10" + "requires": { + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.19.0" } }, - "node_modules/vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==", + "@rollup/plugin-typescript": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.3.tgz", + "integrity": "sha512-55L9SyiYu3r/JtqdjhwcwaECXP7JeJ9h1Sg1VWRJKIutla2MdZQodTgcCNybXLMCnqpNLEhS2vGENww98L1npg==", "dev": true, - "dependencies": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" + "requires": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" } }, - "node_modules/vinyl-sourcemap/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/viz.js": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/viz.js/-/viz.js-1.8.2.tgz", - "integrity": "sha512-W+1+N/hdzLpQZEcvz79n2IgUE9pfx6JLdHh3Kh8RGvLL8P1LdJVQmi2OsDcLdY4QVID4OUy+FPelyerX0nJxIQ==", - "deprecated": "no longer supported" - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "dependencies": { - "browser-process-hrtime": "^1.0.0" + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" + } } }, - "node_modules/w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", - "dependencies": { - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=12" + "@swc/helpers": { + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.3.17.tgz", + "integrity": "sha512-tb7Iu+oZ+zWJZ3HJqwx8oNwSDIU440hmVMDPhpACWQWnrZHK99Bxs70gT1L2dnr5Hg50ZRWEFkQCAnOVVV0z1Q==", + "requires": { + "tslib": "^2.4.0" } }, - "node_modules/w3c-xmlserializer/node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "engines": { - "node": ">=12" - } + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, - "node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "node_modules/webrtc-adapter": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/webrtc-adapter/-/webrtc-adapter-7.7.1.tgz", - "integrity": "sha512-TbrbBmiQBL9n0/5bvDdORc6ZfRY/Z7JnEj+EYOD1ghseZdpJ+nF2yx14k3LgQKc7JZnG7HAcL+zHnY25So9d7A==", - "dependencies": { - "rtcpeerconnection-shim": "^1.2.15", - "sdp": "^2.12.0" - }, - "engines": { - "node": ">=6.0.0", - "npm": ">=3.10.0" + "@ts-morph/common": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.9.2.tgz", + "integrity": "sha512-IPyg+c3Am0EBoa63W0f/AKeLrJhvzMzQ4BIvD1baxLopmiHOj1HFTXYxC6e8iTZ+UYtN+/WFM9UyGRnoA20b8g==", + "peer": true, + "requires": { + "fast-glob": "^3.2.5", + "minimatch": "^3.0.4", + "mkdirp": "^1.0.4", + "path-browserify": "^1.0.1" } }, - "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=12" + "@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "requires": { + "@types/connect": "*", + "@types/node": "*" } }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "requires": { + "@types/node": "*" } }, - "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, - "node_modules/whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" + "@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" } }, - "node_modules/which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/whoops": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/whoops/-/whoops-4.1.1.tgz", - "integrity": "sha512-FuLcMHGFfTLJvnwEy6OlxDzRKzjuWibogBVBGBICHQY1LRozEbmNDKea22fNI4fQsMt99aiP/Hyp0Z5CDGxq/Q==", - "dependencies": { - "clean-stack": "~3.0.0", - "mimic-fn": "~3.1.0" - }, - "engines": { - "node": ">= 8" - } + "@types/lodash": { + "version": "4.14.182", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", + "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", + "peer": true }, - "node_modules/whoops/node_modules/clean-stack": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", - "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", - "dependencies": { - "escape-string-regexp": "4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, - "node_modules/whoops/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "@types/node": { + "version": "17.0.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.39.tgz", + "integrity": "sha512-JDU3YLlnPK3WDao6/DlXLOgSNpG13ct+CwIO17V8q0/9fWJyeMJJ/VyZ1lv8kDprihvZMydzVwf0tQOqGiY2Nw==" }, - "node_modules/whoops/node_modules/mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "engines": { - "node": ">=8" - } + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "@types/resolve": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@types/node": "*" } }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" + "@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "requires": { + "@types/mime": "^1", + "@types/node": "*" } }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" + "@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "requires": { + "@types/node": "*" } }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true }, - "node_modules/wif": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", - "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", + "@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "peer": true, - "dependencies": { - "bs58check": "<3.0.0" + "requires": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "engines": { - "node": ">=0.10.0" - } + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "peer": true }, - "node_modules/wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", - "engines": { - "node": ">=0.4.0" - } + "@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "peer": true }, - "node_modules/wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "peer": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "peer": true }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "peer": true }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "abstract-level": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", + "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "requires": { + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "acorn": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", + "integrity": "sha512-pXK8ez/pVjqFdAgBkF1YPVRacuLQ9EXBKaKWaeh58WNfMkCmZhOZzu+NtKSPD5PHmCCHheQ5cD29qM1K4QTxIg==" }, - "node_modules/write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha512-CJ17OoULEKXpA5pef3qLj5AxTJ6mSt7g84he2WIskKwqFO4T97d5V7Tadl0DYDk7qyUOQD5WlUlOMChaYrhxeA==", - "dev": true, - "dependencies": { - "mkdirp": "^0.5.1" + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" + } } }, - "node_modules/write/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "dependencies": { - "minimist": "^1.2.6" + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==" + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" }, - "bin": { - "mkdirp": "bin/cmd.js" + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, - "node_modules/ws": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", - "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, "dependencies": { - "async-limiter": "~1.0.0" + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, - "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" - }, - "node_modules/xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha512-Mbe56Dvj00onbnSo9J0qj/XlY5bfN9KidsOnpd5tRCsR3ekB3hyyNU9fGrTdqNT5ZNvv4BsA2TcQlignsZyVcw==", - "dev": true - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" } }, - "node_modules/y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - }, - "node_modules/yargs": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", - "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, "dependencies": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.1" + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + } } }, - "node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "requires": { + "ansi-wrap": "^0.1.0" } }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "ansi-wrap": "0.1.0" } }, - "node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dev": true, - "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "engines": { - "node": ">=6" - } + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, - "node_modules/yargs-unparser/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" } }, - "node_modules/yargs-unparser/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", + "dev": true }, - "node_modules/yargs-unparser/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, "dependencies": { - "color-name": "1.1.3" + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, - "node_modules/yargs-unparser/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==", "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" + "requires": { + "buffer-equal": "^1.0.0" } }, - "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point": { + "append-transform": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "default-require-extensions": "^3.0.0" } }, - "node_modules/yargs-unparser/node_modules/require-main-filename": { + "aproba": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "arbitrary": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/arbitrary/-/arbitrary-1.4.10.tgz", + "integrity": "sha512-YU4rMv5yk9GS/1e8pWgrhnWfnE3SaTnS17fcX2VEY2stilqL5++SI4nPAyF5RZkY2DWRkXy/i+Opl8XHBNvNSA==", + "peer": true + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, - "node_modules/yargs-unparser/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "are-we-there-yet": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", + "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" } }, - "node_modules/yargs-unparser/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" } }, - "node_modules/yargs-unparser/node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", "dev": true }, - "node_modules/yargs-unparser/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==", "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" + "requires": { + "make-iterator": "^1.0.0" } }, - "node_modules/yargs-unparser/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, - "node_modules/yargs-unparser/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==", "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "requires": { + "make-iterator": "^1.0.0" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "dev": true }, - "node_modules/yargs/node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "dev": true, - "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", + "dev": true }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "array-includes": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" } }, - "node_modules/yargs/node_modules/load-json-file": { + "array-initial": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } } }, - "node_modules/yargs/node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", "dev": true, - "dependencies": { - "pinkie-promise": "^2.0.0" + "requires": { + "is-number": "^4.0.0" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } } }, - "node_modules/yargs/node_modules/path-type": { + "array-slice": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" + "requires": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" }, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, - "node_modules/yargs/node_modules/read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "dev": true, - "dependencies": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "dev": true }, - "node_modules/yargs/node_modules/read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", + "array.prototype.flat": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, - "dependencies": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" } }, - "node_modules/yargs/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "array.prototype.flatmap": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz", + "integrity": "sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==", "dev": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" } }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "dev": true }, - "node_modules/yargs/node_modules/strip-bom": { + "astral-regex": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "dev": true, - "dependencies": { - "is-utf8": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", - "dev": true, - "dependencies": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" - } - }, - "node_modules/zeromq": { - "version": "5.2.8", - "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-5.2.8.tgz", - "integrity": "sha512-bXzsk7KOmgLSv1tC0Ms1VXBy90+Rz27ZYf27cLuldRYbpqYpuWJfxxHFhO710t22zgWBnmdUP0m3SKFpLI0u5g==", - "hasInstallScript": true, - "peer": true, - "dependencies": { - "nan": "2.14.2", - "node-gyp-build": "^4.2.3" - }, - "engines": { - "node": ">=6.0" - } + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true }, - "node_modules/zeromq/node_modules/nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", "peer": true }, - "node_modules/zeromq/node_modules/node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "peer": true, - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" } }, - "@babel/generator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.6.tgz", - "integrity": "sha512-AIwwoOS8axIC5MZbhNHRLKi3D+DMpvDf9XUcu3pIVAfOHFT45f4AoDAltRbHIQomCipkCZxrNkfpOEHhJz/VKw==", + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==", "dev": true, "requires": { - "@babel/types": "^7.18.6", - "@jridgewell/gen-mapping": "^0.3.0", - "jsesc": "^2.5.1" + "async-done": "^1.2.2" } }, - "@babel/helper-environment-visitor": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz", - "integrity": "sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q==", + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "@babel/helper-function-name": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz", - "integrity": "sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw==", - "dev": true, - "requires": { - "@babel/template": "^7.18.6", - "@babel/types": "^7.18.6" - } + "audio-extensions": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/audio-extensions/-/audio-extensions-0.0.0.tgz", + "integrity": "sha512-yj9C819u3ED3/OyRd9mLKMXGy8wsElaf6bkkv6OqZEKrNAT461TjiznS4IfPBy8Mmh6DWaXCQCVYSq3+VHkpjQ==" }, - "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==" }, - "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" } }, - "@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", - "dev": true + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "is-descriptor": "^1.0.0" } } } }, - "@babel/parser": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.6.tgz", - "integrity": "sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==", - "dev": true + "base-x": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", + "integrity": "sha512-c0WLeG3K5OlL4Skz2/LVdS+MjggByKhowxQpG+JpCLA48s/bGwIDyzA1naFjywtNvp/37fLK0p0FpjTNNLLUXQ==", + "peer": true }, - "@babel/template": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz", - "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==", - "dev": true, + "base58check": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base58check/-/base58check-2.0.0.tgz", + "integrity": "sha512-sTzsDAOC9+i2Ukr3p1Ie2DWpD117ua+vBJRDnpsSlScGwImeeiTg/IatwcFLsz9K9wEGoBLVd5ahNZzrZ/jZyg==", + "peer": true, "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.6", - "@babel/types": "^7.18.6" + "bs58": "^3.0.0" } }, - "@babel/traverse": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.6.tgz", - "integrity": "sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.6", - "@babel/helper-function-name": "^7.18.6", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.18.6", - "@babel/types": "^7.18.6", - "debug": "^4.1.0", - "globals": "^11.1.0" + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "requires": { + "safe-buffer": "5.1.2" }, "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, - "@babel/types": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.6.tgz", - "integrity": "sha512-NdBNzPDwed30fZdDQtVR7ZgaO4UKjuaQFH9VArS+HMnurlOY0JWN+4ROlu/iapMFwjRQU4pOG4StZfDmulEwGA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "to-fast-properties": "^2.0.0" - } - }, - "@fabric/core": { - "version": "git+ssh://git@github.com/FabricLabs/fabric.git#df0a01cfdf0282bfe5e155158c992dab5482b537", - "from": "@fabric/core@FabricLabs/fabric#feature/node-16", + "bcoin": { + "version": "git+ssh://git@github.com/bcoin-org/bcoin.git#acdeb84767f3ceb82b4a75931fe353229c3bc7b5", + "from": "bcoin@github:bcoin-org/bcoin#v2.2.0", "peer": true, "requires": { - "@fabric/zmq": "github:FabricLabs/fabric-zmq#master", - "@webassemblyjs/ast": "^1.8.5", - "arbitrary": "^1.4.10", - "base58check": "^2.0.0", - "bcoin": "github:bcoin-org/bcoin#v2.2.0", - "bech32-buffer": "^0.2.0", - "bip-schnorr": "^0.6.6", - "bip32": "^3.0.1", - "bip39": "^3.0.4", - "bip65": "^1.0.3", - "bip68": "^1.0.4", - "bitcoinjs-lib": "^6.0.0", - "blessed": "^0.1.81", - "clightningjs": "^0.2.2", - "commander": "^6.1.0", - "content-type": "^1.0.4", - "dotparser": "^0.3.0", - "ecpair": "^2.0.1", - "elliptic": "^6.5.4", - "fast-json-patch": "^2.0.7", - "fd-chunk-store": "^2.0.0", - "glob-run": "^0.1.6", - "javascript-state-machine": "^3.1.0", - "jayson": "^3.4.4", - "js-beautify": "^1.14.3", - "json-pointer": "^0.6.0", - "level": "^7.0.1", - "lodash.merge": "^4.6.2", - "merkletreejs": "^0.1.6", - "minsc": "^0.2.0", - "mkdirp": "^1.0.4", - "p-event": "^4.2.0", - "path-match": "^1.2.4", - "pluralize": "^8.0.0", - "redis": "^3.1.2", - "rimraf": "^2.6.2", - "simple-aes": "^0.1.1", - "struct": "^0.0.12", - "tiny-secp256k1": "^2.2.1", - "ts-morph": "^10.0.2" + "bcfg": "git+https://github.com/bcoin-org/bcfg.git#semver:~0.1.7", + "bcrypto": "git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0", + "bcurl": "git+https://github.com/bcoin-org/bcurl.git#semver:^0.1.6", + "bdb": "git+https://github.com/bcoin-org/bdb.git#semver:~1.2.1", + "bdns": "git+https://github.com/bcoin-org/bdns.git#semver:~0.1.5", + "bevent": "git+https://github.com/bcoin-org/bevent.git#semver:~0.1.5", + "bfile": "git+https://github.com/bcoin-org/bfile.git#semver:~0.2.1", + "bfilter": "git+https://github.com/bcoin-org/bfilter.git#semver:~2.3.0", + "bheep": "git+https://github.com/bcoin-org/bheep.git#semver:~0.1.5", + "binet": "git+https://github.com/bcoin-org/binet.git#semver:~0.3.5", + "blgr": "git+https://github.com/bcoin-org/blgr.git#semver:~0.2.0", + "blru": "git+https://github.com/bcoin-org/blru.git#semver:~0.1.6", + "blst": "git+https://github.com/bcoin-org/blst.git#semver:~0.1.5", + "bmutex": "git+https://github.com/bcoin-org/bmutex.git#semver:~0.1.6", + "brq": "git+https://github.com/bcoin-org/brq.git#semver:~0.1.7", + "bs32": "git+https://github.com/bcoin-org/bs32.git#semver:=0.1.6", + "bsert": "git+https://github.com/chjj/bsert.git#semver:~0.0.10", + "bsock": "git+https://github.com/bcoin-org/bsock.git#semver:~0.1.9", + "bsocks": "git+https://github.com/bcoin-org/bsocks.git#semver:~0.2.6", + "btcp": "git+https://github.com/bcoin-org/btcp.git#semver:~0.1.5", + "buffer-map": "git+https://github.com/chjj/buffer-map.git#semver:~0.0.7", + "bufio": "git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6", + "bupnp": "git+https://github.com/bcoin-org/bupnp.git#semver:~0.2.6", + "bval": "git+https://github.com/bcoin-org/bval.git#semver:~0.1.6", + "bweb": "git+https://github.com/bcoin-org/bweb.git#semver:=0.1.9", + "loady": "git+https://github.com/chjj/loady.git#semver:~0.0.1", + "n64": "git+https://github.com/chjj/n64.git#semver:~0.2.10", + "nan": "git+https://github.com/braydonf/nan.git#semver:=2.14.0" }, "dependencies": { - "abstract-leveldown": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", - "integrity": "sha512-DnhQwcFEaYsvYDnACLZhMmCWd3rkOeEvglpa4q5i/5Jlm3UIsWaxVzuXvDLFCSCWRO3yy2/+V/G7FusFgejnfQ==", + "bcfg": { + "version": "0.1.7", + "bundled": true, "peer": true, "requires": { - "buffer": "^6.0.3", - "catering": "^2.0.0", - "is-buffer": "^2.0.5", - "level-concat-iterator": "^3.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" + "bsert": "~0.0.10" } }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "bcrypto": { + "version": "5.5.0", + "bundled": true, "peer": true, "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "bufio": "~1.0.7", + "loady": "~0.0.5" } }, - "deferred-leveldown": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-7.0.0.tgz", - "integrity": "sha512-QKN8NtuS3BC6m0B8vAnBls44tX1WXAFATUsJlruyAYbZpysWV3siH6o/i3g9DCHauzodksO60bdj5NazNbjCmg==", + "bcurl": { + "version": "0.1.9", + "bundled": true, "peer": true, "requires": { - "abstract-leveldown": "^7.2.0", - "inherits": "^2.0.3" + "brq": "~0.1.8", + "bsert": "~0.0.10", + "bsock": "~0.1.9" } }, - "encoding-down": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-7.1.0.tgz", - "integrity": "sha512-ky47X5jP84ryk5EQmvedQzELwVJPjCgXDQZGeb9F6r4PdChByCGHTBrVcF3h8ynKVJ1wVbkxTsDC8zBROPypgQ==", + "bdb": { + "version": "1.2.2", + "bundled": true, "peer": true, "requires": { - "abstract-leveldown": "^7.2.0", - "inherits": "^2.0.3", - "level-codec": "^10.0.0", - "level-errors": "^3.0.0" + "bsert": "~0.0.10", + "loady": "~0.0.1" } }, - "level": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-7.0.1.tgz", - "integrity": "sha512-w3E64+ALx2eZf8RV5JL4kIcE0BFAvQscRYd1yU4YVqZN9RGTQxXSvH202xvK15yZwFFxRXe60f13LJjcJ//I4Q==", + "bdns": { + "version": "0.1.5", + "bundled": true, "peer": true, "requires": { - "level-js": "^6.1.0", - "level-packager": "^6.0.1", - "leveldown": "^6.1.0" + "bsert": "~0.0.10" } }, - "level-codec": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-10.0.0.tgz", - "integrity": "sha512-QW3VteVNAp6c/LuV6nDjg7XDXx9XHK4abmQarxZmlRSDyXYk20UdaJTSX6yzVvQ4i0JyWSB7jert0DsyD/kk6g==", + "bevent": { + "version": "0.1.5", + "bundled": true, "peer": true, "requires": { - "buffer": "^6.0.3" + "bsert": "~0.0.10" } }, - "level-concat-iterator": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-3.1.0.tgz", - "integrity": "sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==", + "bfile": { + "version": "0.2.2", + "bundled": true, + "peer": true + }, + "bfilter": { + "version": "2.3.0", + "bundled": true, "peer": true, "requires": { - "catering": "^2.1.0" + "bcrypto": "git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0", + "bsert": "git+https://github.com/chjj/bsert.git#semver:~0.0.10", + "bufio": "git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6", + "loady": "git+https://github.com/chjj/loady.git#semver:~0.0.1" } }, - "level-errors": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-3.0.1.tgz", - "integrity": "sha512-tqTL2DxzPDzpwl0iV5+rBCv65HWbHp6eutluHNcVIftKZlQN//b6GEnZDM2CvGZvzGYMwyPtYppYnydBQd2SMQ==", - "peer": true - }, - "level-iterator-stream": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-5.0.0.tgz", - "integrity": "sha512-wnb1+o+CVFUDdiSMR/ZymE2prPs3cjVLlXuDeSq9Zb8o032XrabGEXcTCsBxprAtseO3qvFeGzh6406z9sOTRA==", + "bheep": { + "version": "0.1.5", + "bundled": true, "peer": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "bsert": "~0.0.10" } }, - "level-js": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-6.1.0.tgz", - "integrity": "sha512-i7mPtkZm68aewfv0FnIUWvFUFfoyzIvVKnUmuQGrelEkP72vSPTaA1SGneWWoCV5KZJG4wlzbJLp1WxVNGuc6A==", + "binet": { + "version": "0.3.6", + "bundled": true, "peer": true, "requires": { - "abstract-leveldown": "^7.2.0", - "buffer": "^6.0.3", - "inherits": "^2.0.3", - "ltgt": "^2.1.2", - "run-parallel-limit": "^1.1.0" + "bs32": "~0.1.5", + "bsert": "~0.0.10" } }, - "level-packager": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-6.0.1.tgz", - "integrity": "sha512-8Ezr0XM6hmAwqX9uu8IGzGNkWz/9doyPA8Oo9/D7qcMI6meJC+XhIbNYHukJhIn8OGdlzQs/JPcL9B8lA2F6EQ==", + "blgr": { + "version": "0.2.0", + "bundled": true, "peer": true, "requires": { - "encoding-down": "^7.1.0", - "levelup": "^5.1.1" + "bsert": "~0.0.10" } }, - "level-supports": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-2.1.0.tgz", - "integrity": "sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==", - "peer": true - }, - "leveldown": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-6.1.1.tgz", - "integrity": "sha512-88c+E+Eizn4CkQOBHwqlCJaTNEjGpaEIikn1S+cINc5E9HEvJ77bqY4JY/HxT5u0caWqsc3P3DcFIKBI1vHt+A==", + "blru": { + "version": "0.1.6", + "bundled": true, "peer": true, "requires": { - "abstract-leveldown": "^7.2.0", - "napi-macros": "~2.0.0", - "node-gyp-build": "^4.3.0" + "bsert": "~0.0.10" } }, - "levelup": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-5.1.1.tgz", - "integrity": "sha512-0mFCcHcEebOwsQuk00WJwjLI6oCjbBuEYdh/RaRqhjnyVlzqf41T1NnDtCedumZ56qyIh8euLFDqV1KfzTAVhg==", + "blst": { + "version": "0.1.5", + "bundled": true, "peer": true, "requires": { - "catering": "^2.0.0", - "deferred-leveldown": "^7.0.0", - "level-errors": "^3.0.1", - "level-iterator-stream": "^5.0.0", - "level-supports": "^2.0.1", - "queue-microtask": "^1.2.3" + "bsert": "~0.0.10" } }, - "node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "peer": true - }, - "pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "peer": true - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "bmutex": { + "version": "0.1.6", + "bundled": true, "peer": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "bsert": "~0.0.10" } - } - } - }, - "@fabric/zmq": { - "version": "git+ssh://git@github.com/FabricLabs/fabric-zmq.git#b7a86035f74bac97f272d3adcd708546b034785d", - "from": "@fabric/zmq@github:FabricLabs/fabric-zmq#master", - "peer": true, - "requires": { - "zeromq": "^5.2.8" - } - }, - "@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" - }, - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.8.tgz", - "integrity": "sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", - "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "@metascraper/helpers": { - "version": "5.29.11", - "resolved": "https://registry.npmjs.org/@metascraper/helpers/-/helpers-5.29.11.tgz", - "integrity": "sha512-e9hboiNOVoghDImOXQIWsQccTyTSJRAtpUW0vALqGagxPqDfQ1IZwLpHpx9zBGa76kQEQcKpvyfVPtd3o6SEsg==", - "requires": { - "audio-extensions": "0.0.0", - "chrono-node": "2.3.8", - "condense-whitespace": "~2.0.0", - "entities": "~4.3.0", - "file-extension": "~4.0.5", - "has-values": "~2.0.1", - "image-extensions": "~1.1.0", - "is-relative-url": "~3.0.0", - "is-uri": "~1.2.4", - "iso-639-3": "~2.2.0", - "isostring": "0.0.1", - "jsdom": "~20.0.0", - "lodash": "~4.17.21", - "memoize-one": "~6.0.0", - "microsoft-capitalize": "~1.0.5", - "mime-types": "~2.1.35", - "normalize-url": "~6.1.0", - "re2": "~1.17.7", - "smartquotes": "~2.3.2", - "url-regex-safe": "~3.0.0", - "video-extensions": "~1.2.0" - }, - "dependencies": { - "acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==" }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "brq": { + "version": "0.1.8", + "bundled": true, + "peer": true, "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" - } + "bsert": "~0.0.10" } }, - "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==" - }, - "cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==" - }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "bs32": { + "version": "0.1.6", + "bundled": true, + "peer": true, "requires": { - "cssom": "~0.3.6" - }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" - } + "bsert": "~0.0.10" } }, - "data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", - "requires": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" - } + "bsert": { + "version": "0.0.10", + "bundled": true, + "peer": true }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "bsock": { + "version": "0.1.9", + "bundled": true, + "peer": true, "requires": { - "webidl-conversions": "^7.0.0" + "bsert": "~0.0.10" } }, - "entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" - }, - "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "bsocks": { + "version": "0.2.6", + "bundled": true, + "peer": true, "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "binet": "~0.3.5", + "bsert": "~0.0.10" } }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } + "btcp": { + "version": "0.1.5", + "bundled": true, + "peer": true }, - "jsdom": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.0.tgz", - "integrity": "sha512-x4a6CKCgx00uCmP+QakBDFXwjAJ69IkkIWHmtmjd3wvXPcdOS44hfX2vqkOQrVrq8l9DhNNADZRXaCEWvgXtVA==", - "requires": { - "abab": "^2.0.6", - "acorn": "^8.7.1", - "acorn-globals": "^6.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.3.1", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "^7.0.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^3.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.8.0", - "xml-name-validator": "^4.0.0" - } + "buffer-map": { + "version": "0.0.7", + "bundled": true, + "peer": true }, - "parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "requires": { - "entities": "^4.3.0" - } + "bufio": { + "version": "1.0.7", + "bundled": true, + "peer": true }, - "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "bupnp": { + "version": "0.2.6", + "bundled": true, + "peer": true, "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" + "binet": "~0.3.5", + "brq": "~0.1.7", + "bsert": "~0.0.10" } }, - "tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "bval": { + "version": "0.1.6", + "bundled": true, + "peer": true, "requires": { - "punycode": "^2.1.1" + "bsert": "~0.0.10" } }, - "webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" - }, - "whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==" - }, - "whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "bweb": { + "version": "0.1.9", + "bundled": true, + "peer": true, "requires": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" + "bsert": "~0.0.10", + "bsock": "~0.1.8" } }, - "ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", - "requires": {} + "loady": { + "version": "0.0.5", + "bundled": true, + "peer": true }, - "xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==" - } - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "peer": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "peer": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "peer": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", - "requires": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } + "n64": { + "version": "0.2.10", + "bundled": true, + "peer": true }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } - }, - "@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "@rollup/plugin-commonjs": { - "version": "21.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz", - "integrity": "sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-json": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", - "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8" - } - }, - "@rollup/plugin-node-resolve": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz", - "integrity": "sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "deepmerge": "^4.2.2", - "is-builtin-module": "^3.1.0", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - } - }, - "@rollup/plugin-typescript": { - "version": "8.3.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.3.tgz", - "integrity": "sha512-55L9SyiYu3r/JtqdjhwcwaECXP7JeJ9h1Sg1VWRJKIutla2MdZQodTgcCNybXLMCnqpNLEhS2vGENww98L1npg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "resolve": "^1.17.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - } - } - }, - "@swc/helpers": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.3.17.tgz", - "integrity": "sha512-tb7Iu+oZ+zWJZ3HJqwx8oNwSDIU440hmVMDPhpACWQWnrZHK99Bxs70gT1L2dnr5Hg50ZRWEFkQCAnOVVV0z1Q==", - "requires": { - "tslib": "^2.4.0" - } - }, - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" - }, - "@ts-morph/common": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.9.2.tgz", - "integrity": "sha512-IPyg+c3Am0EBoa63W0f/AKeLrJhvzMzQ4BIvD1baxLopmiHOj1HFTXYxC6e8iTZ+UYtN+/WFM9UyGRnoA20b8g==", - "peer": true, - "requires": { - "fast-glob": "^3.2.5", - "minimatch": "^3.0.4", - "mkdirp": "^1.0.4", - "path-browserify": "^1.0.1" - } - }, - "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "peer": true, - "requires": { - "@types/node": "*" - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", - "peer": true, - "requires": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "@types/lodash": { - "version": "4.14.182", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", - "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", - "peer": true - }, - "@types/node": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz", - "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==" - }, - "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "peer": true - }, - "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "peer": true - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "peer": true, - "requires": { - "@types/node": "*" - } - }, - "@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", - "peer": true, - "requires": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", - "peer": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", - "peer": true - }, - "@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", - "peer": true, - "requires": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", - "peer": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "peer": true - }, - "abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", - "requires": { - "level-concat-iterator": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - } - }, - "acorn": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", - "integrity": "sha512-pXK8ez/pVjqFdAgBkF1YPVRacuLQ9EXBKaKWaeh58WNfMkCmZhOZzu+NtKSPD5PHmCCHheQ5cD29qM1K4QTxIg==" - }, - "acorn-globals": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", - "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - } - } - }, - "acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", - "dev": true - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "dependencies": { - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - } - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "requires": { - "ansi-wrap": "^0.1.0" - } - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==", - "dev": true, - "requires": { - "buffer-equal": "^1.0.0" - } - }, - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "arbitrary": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/arbitrary/-/arbitrary-1.4.10.tgz", - "integrity": "sha512-YU4rMv5yk9GS/1e8pWgrhnWfnE3SaTnS17fcX2VEY2stilqL5++SI4nPAyF5RZkY2DWRkXy/i+Opl8XHBNvNSA==", - "peer": true - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true - }, - "are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", - "dev": true - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", - "dev": true - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA==", - "dev": true - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "array-includes": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", - "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5", - "get-intrinsic": "^1.1.1", - "is-string": "^1.0.7" - } - }, - "array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==", - "dev": true, - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true - }, - "array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "dev": true, - "requires": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - } - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", - "dev": true - }, - "array.prototype.reduce": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz", - "integrity": "sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.2", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - } - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", - "dev": true - }, - "async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", - "peer": true - }, - "async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, - "async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==", - "dev": true, - "requires": { - "async-done": "^1.2.2" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "audio-extensions": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/audio-extensions/-/audio-extensions-0.0.0.tgz", - "integrity": "sha512-yj9C819u3ED3/OyRd9mLKMXGy8wsElaf6bkkv6OqZEKrNAT461TjiznS4IfPBy8Mmh6DWaXCQCVYSq3+VHkpjQ==" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true - } - } - }, - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - }, - "bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==", - "dev": true, - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "base-x": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", - "integrity": "sha512-c0WLeG3K5OlL4Skz2/LVdS+MjggByKhowxQpG+JpCLA48s/bGwIDyzA1naFjywtNvp/37fLK0p0FpjTNNLLUXQ==", - "peer": true - }, - "base58check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base58check/-/base58check-2.0.0.tgz", - "integrity": "sha512-sTzsDAOC9+i2Ukr3p1Ie2DWpD117ua+vBJRDnpsSlScGwImeeiTg/IatwcFLsz9K9wEGoBLVd5ahNZzrZ/jZyg==", - "peer": true, - "requires": { - "bs58": "^3.0.0" - } - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "requires": { - "safe-buffer": "5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "bcoin": { - "version": "git+ssh://git@github.com/bcoin-org/bcoin.git#acdeb84767f3ceb82b4a75931fe353229c3bc7b5", - "from": "bcoin@github:bcoin-org/bcoin#v2.2.0", - "peer": true, - "requires": { - "bcfg": "git+https://github.com/bcoin-org/bcfg.git#semver:~0.1.7", - "bcrypto": "git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0", - "bcurl": "git+https://github.com/bcoin-org/bcurl.git#semver:^0.1.6", - "bdb": "git+https://github.com/bcoin-org/bdb.git#semver:~1.2.1", - "bdns": "git+https://github.com/bcoin-org/bdns.git#semver:~0.1.5", - "bevent": "git+https://github.com/bcoin-org/bevent.git#semver:~0.1.5", - "bfile": "git+https://github.com/bcoin-org/bfile.git#semver:~0.2.1", - "bfilter": "git+https://github.com/bcoin-org/bfilter.git#semver:~2.3.0", - "bheep": "git+https://github.com/bcoin-org/bheep.git#semver:~0.1.5", - "binet": "git+https://github.com/bcoin-org/binet.git#semver:~0.3.5", - "blgr": "git+https://github.com/bcoin-org/blgr.git#semver:~0.2.0", - "blru": "git+https://github.com/bcoin-org/blru.git#semver:~0.1.6", - "blst": "git+https://github.com/bcoin-org/blst.git#semver:~0.1.5", - "bmutex": "git+https://github.com/bcoin-org/bmutex.git#semver:~0.1.6", - "brq": "git+https://github.com/bcoin-org/brq.git#semver:~0.1.7", - "bs32": "git+https://github.com/bcoin-org/bs32.git#semver:=0.1.6", - "bsert": "git+https://github.com/chjj/bsert.git#semver:~0.0.10", - "bsock": "git+https://github.com/bcoin-org/bsock.git#semver:~0.1.9", - "bsocks": "git+https://github.com/bcoin-org/bsocks.git#semver:~0.2.6", - "btcp": "git+https://github.com/bcoin-org/btcp.git#semver:~0.1.5", - "buffer-map": "git+https://github.com/chjj/buffer-map.git#semver:~0.0.7", - "bufio": "git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6", - "bupnp": "git+https://github.com/bcoin-org/bupnp.git#semver:~0.2.6", - "bval": "git+https://github.com/bcoin-org/bval.git#semver:~0.1.6", - "bweb": "git+https://github.com/bcoin-org/bweb.git#semver:=0.1.9", - "loady": "git+https://github.com/chjj/loady.git#semver:~0.0.1", - "n64": "git+https://github.com/chjj/n64.git#semver:~0.2.10", - "nan": "git+https://github.com/braydonf/nan.git#semver:=2.14.0" - }, - "dependencies": { - "bcfg": { - "version": "0.1.7", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bcrypto": { - "version": "5.5.0", - "bundled": true, - "peer": true, - "requires": { - "bufio": "~1.0.7", - "loady": "~0.0.5" - } - }, - "bcurl": { - "version": "0.1.9", - "bundled": true, - "peer": true, - "requires": { - "brq": "~0.1.8", - "bsert": "~0.0.10", - "bsock": "~0.1.9" - } - }, - "bdb": { - "version": "1.2.2", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10", - "loady": "~0.0.1" - } - }, - "bdns": { - "version": "0.1.5", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bevent": { - "version": "0.1.5", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bfile": { - "version": "0.2.2", - "bundled": true, - "peer": true - }, - "bfilter": { - "version": "2.3.0", - "bundled": true, - "peer": true, - "requires": { - "bcrypto": "git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0", - "bsert": "git+https://github.com/chjj/bsert.git#semver:~0.0.10", - "bufio": "git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6", - "loady": "git+https://github.com/chjj/loady.git#semver:~0.0.1" - } - }, - "bheep": { - "version": "0.1.5", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "binet": { - "version": "0.3.6", - "bundled": true, - "peer": true, - "requires": { - "bs32": "~0.1.5", - "bsert": "~0.0.10" - } - }, - "blgr": { - "version": "0.2.0", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "blru": { - "version": "0.1.6", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "blst": { - "version": "0.1.5", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bmutex": { - "version": "0.1.6", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "brq": { - "version": "0.1.8", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bs32": { - "version": "0.1.6", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bsert": { - "version": "0.0.10", - "bundled": true, - "peer": true - }, - "bsock": { - "version": "0.1.9", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bsocks": { - "version": "0.2.6", - "bundled": true, - "peer": true, - "requires": { - "binet": "~0.3.5", - "bsert": "~0.0.10" - } - }, - "btcp": { - "version": "0.1.5", - "bundled": true, - "peer": true - }, - "buffer-map": { - "version": "0.0.7", - "bundled": true, - "peer": true - }, - "bufio": { - "version": "1.0.7", - "bundled": true, - "peer": true - }, - "bupnp": { - "version": "0.2.6", - "bundled": true, - "peer": true, - "requires": { - "binet": "~0.3.5", - "brq": "~0.1.7", - "bsert": "~0.0.10" - } - }, - "bval": { - "version": "0.1.6", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10" - } - }, - "bweb": { - "version": "0.1.9", - "bundled": true, - "peer": true, - "requires": { - "bsert": "~0.0.10", - "bsock": "~0.1.8" - } - }, - "loady": { - "version": "0.0.5", - "bundled": true, - "peer": true - }, - "n64": { - "version": "0.2.10", - "bundled": true, - "peer": true - }, - "nan": { - "version": "2.14.0", - "bundled": true, - "peer": true - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "peer": true - }, - "bech32-buffer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bech32-buffer/-/bech32-buffer-0.2.0.tgz", - "integrity": "sha512-Ez8s82a+Xnn/m3/ftGaQJUSFG4EwNIj9adIJBw8OrHASQsXgvwLSducbcJ9El0rsrwJYJ71yBhC/hZzz3FPSCQ==", - "peer": true - }, - "bigi": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz", - "integrity": "sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw==", - "peer": true - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip-schnorr": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.6.6.tgz", - "integrity": "sha512-QZmVN37kaKfEk6M61gfcREa5JxWVQ0LvA95UQQD5mdyZsN6542PwfrvlAARZufTLn2ZIQQ0ph6XHD0vq8J3ouw==", - "peer": true, - "requires": { - "bigi": "^1.4.2", - "ecurve": "^1.0.6", - "js-sha256": "^0.9.0", - "randombytes": "^2.1.0", - "safe-buffer": "^5.2.1" - } - }, - "bip174": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/bip174/-/bip174-2.1.0.tgz", - "integrity": "sha512-lkc0XyiX9E9KiVAS1ZiOqK1xfiwvf4FXDDdkDq5crcDzOq+xGytY+14qCsqz7kCiy8rpN1CRNfacRhf9G3JNSA==", - "peer": true - }, - "bip32": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bip32/-/bip32-3.0.1.tgz", - "integrity": "sha512-Uhpp9aEx3iyiO7CpbNGFxv9WcMIVdGoHG04doQ5Ln0u60uwDah7jUSc3QMV/fSZGm/Oo01/OeAmYevXV+Gz5jQ==", - "peer": true, - "requires": { - "@types/node": "10.12.18", - "bs58check": "^2.1.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "typeforce": "^1.11.5", - "wif": "^2.0.6" - }, - "dependencies": { - "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", - "peer": true - } - } - }, - "bip39": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", - "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", - "peer": true, - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==", - "peer": true - } - } - }, - "bip65": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bip65/-/bip65-1.0.3.tgz", - "integrity": "sha512-RQ1nc7xtnLa5XltnCqkoR2zmhuz498RjMJwrLKQzOE049D1HUqnYfon7cVSbwS5UGm0/EQlC2CH+NY3MyITA4Q==", - "peer": true - }, - "bip68": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/bip68/-/bip68-1.0.4.tgz", - "integrity": "sha512-O1htyufFTYy3EO0JkHg2CLykdXEtV2ssqw47Gq9A0WByp662xpJnMEB9m43LZjsSDjIAOozWRExlFQk2hlV1XQ==", - "peer": true - }, - "bitcoinjs-lib": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.1.tgz", - "integrity": "sha512-x/7D4jDj/MMkmO6t3p2CSDXTqpwZ/jRsRiJDmaiXabrR9XRo7jwby8HRn7EyK1h24rKFFI7vI0ay4czl6bDOZQ==", - "peer": true, - "requires": { - "bech32": "^2.0.0", - "bip174": "^2.0.1", - "bs58check": "^2.1.2", - "create-hash": "^1.1.0", - "typeforce": "^1.11.3", - "varuint-bitcoin": "^1.1.2", - "wif": "^2.0.1" - } - }, - "blessed": { - "version": "0.1.81", - "resolved": "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz", - "integrity": "sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==", - "peer": true - }, - "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", - "dev": true - }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "peer": true - }, - "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.10.3", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "peer": true - }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "bs58": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-3.1.0.tgz", - "integrity": "sha512-9C2bRFTGy3meqO65O9jLvVTyawvhLVp4h2ECm5KlRPuV5KPDNJZcJIj3gl+aA0ENXcYrUSLCkPAeqbTcI2uWyQ==", - "peer": true, - "requires": { - "base-x": "^1.1.0" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "peer": true, - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "peer": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "peer": true, - "requires": { - "base-x": "^3.0.2" - } - } - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ==", - "dev": true - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "buffer-reverse": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-reverse/-/buffer-reverse-1.0.1.tgz", - "integrity": "sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg==", - "peer": true - }, - "builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" - }, - "cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", - "requires": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^1.1.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "requires": { - "balanced-match": "^1.0.0" - } - }, - "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "lru-cache": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.2.tgz", - "integrity": "sha512-9zDbhgmXAUvUMPV81A705K3tVzcPiZL3Bf5/5JC/FjYJlLZ5AJCeqIRFHJqyBppiLosqF+uKB7p8/RDXylqBIw==" - }, - "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha512-UJiE1otjXPF5/x+T3zTnSFiTOEmJoGTD9HmBoxnCUwho61a2eSNn/VwtwuIBDAo2SEOv1AJ7ARI5gCmohFLu/g==", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", - "dev": true - }, - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha512-Zv4Dns9IbXXmPkgRRUjAaJQgfN4xX5p6+RQFhWUqscdvvK2xK/ZL8b3IXIJsj+4sD+f24NwnWy2BY8AJ82JB0A==", - "dev": true - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, - "catering": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", - "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "peer": true - }, - "catharsis": { - "version": "0.8.11", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", - "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "character-parser": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", - "integrity": "sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==", - "requires": { - "is-regex": "^1.0.3" - } - }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==", - "dev": true - }, - "cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "requires": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - }, - "dependencies": { - "entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" - }, - "parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "requires": { - "entities": "^4.3.0" - } - } - } - }, - "cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "requires": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, - "chrono-node": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/chrono-node/-/chrono-node-2.3.8.tgz", - "integrity": "sha512-cOCUKFHkGKJ//2VK0Vjwd8qh/tDJNraZHYb4DNB48mRUyfL7ag9lCDXgos30fPmV1pha4sP4qHLYItKNS0YpRw==", - "requires": { - "dayjs": "^1.10.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "peer": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - } - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "clightningjs": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/clightningjs/-/clightningjs-0.2.2.tgz", - "integrity": "sha512-9fdWYNxe/IUe0uG0b1XdxWGlev1IPlWZpN6Hrsr3uTOZe1kSR+ySBMzdsgD73Rc3LeX7DfdKhT3uuT8B77HIqg==", - "peer": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", - "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - } - }, - "code-block-writer": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.1.tgz", - "integrity": "sha512-67ueh2IRGst/51p0n6FvPrnRjAGHY5F8xdjkgrYE7DDzpJe6qA07RYQ9VcoUeo5ATOjSOiWpSL3SWBRRbempMw==", - "peer": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", - "dev": true - }, - "collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==", - "dev": true, - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "peer": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "condense-whitespace": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/condense-whitespace/-/condense-whitespace-2.0.0.tgz", - "integrity": "sha512-Ath9o58/0rxZXbyoy3zZgrVMoIemi30sukG/btuMKCLyqfQt3dNOWc9N3EHEMa2Q3i0tXQPDJluYFLwy7pJuQw==" - }, - "config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha512-OKZnPGeMQy2RPaUIBPFFd71iNf4791H12MCRuVQDnzGRwCYNYmTDy5pdafo2SLAcEMKzTOQnLWG4QdcjeJUMEg==", - "dev": true - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { - "safe-buffer": "5.2.1" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } - } - }, - "cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" - }, - "cookie-parser": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", - "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", - "requires": { - "cookie": "0.4.1", - "cookie-signature": "1.0.6" - }, - "dependencies": { - "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" - } - } - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", - "dev": true - }, - "copy-props": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", - "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", - "dev": true, - "requires": { - "each-props": "^1.3.2", - "is-plain-object": "^5.0.0" - } - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "corser": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", - "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==" - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "peer": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "peer": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-fetch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", - "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", - "requires": { - "node-fetch": "2.6.7" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", - "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", - "peer": true - }, - "css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "requires": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - } - }, - "css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" - }, - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, - "cssstyle": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", - "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "d3": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/d3/-/d3-5.16.0.tgz", - "integrity": "sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==", - "requires": { - "d3-array": "1", - "d3-axis": "1", - "d3-brush": "1", - "d3-chord": "1", - "d3-collection": "1", - "d3-color": "1", - "d3-contour": "1", - "d3-dispatch": "1", - "d3-drag": "1", - "d3-dsv": "1", - "d3-ease": "1", - "d3-fetch": "1", - "d3-force": "1", - "d3-format": "1", - "d3-geo": "1", - "d3-hierarchy": "1", - "d3-interpolate": "1", - "d3-path": "1", - "d3-polygon": "1", - "d3-quadtree": "1", - "d3-random": "1", - "d3-scale": "2", - "d3-scale-chromatic": "1", - "d3-selection": "1", - "d3-shape": "1", - "d3-time": "1", - "d3-time-format": "2", - "d3-timer": "1", - "d3-transition": "1", - "d3-voronoi": "1", - "d3-zoom": "1" - } - }, - "d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" - }, - "d3-axis": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-1.0.12.tgz", - "integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==" - }, - "d3-brush": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.6.tgz", - "integrity": "sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==", - "requires": { - "d3-dispatch": "1", - "d3-drag": "1", - "d3-interpolate": "1", - "d3-selection": "1", - "d3-transition": "1" - } - }, - "d3-chord": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-1.0.6.tgz", - "integrity": "sha512-JXA2Dro1Fxw9rJe33Uv+Ckr5IrAa74TlfDEhE/jfLOaXegMQFQTAgAw9WnZL8+HxVBRXaRGCkrNU7pJeylRIuA==", - "requires": { - "d3-array": "1", - "d3-path": "1" - } - }, - "d3-collection": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", - "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==" - }, - "d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" - }, - "d3-contour": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-1.3.2.tgz", - "integrity": "sha512-hoPp4K/rJCu0ladiH6zmJUEz6+u3lgR+GSm/QdM2BBvDraU39Vr7YdDCicJcxP1z8i9B/2dJLgDC1NcvlF8WCg==", - "requires": { - "d3-array": "^1.1.1" - } - }, - "d3-dispatch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" - }, - "d3-drag": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", - "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", - "requires": { - "d3-dispatch": "1", - "d3-selection": "1" - } - }, - "d3-dsv": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.2.0.tgz", - "integrity": "sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g==", - "requires": { - "commander": "2", - "iconv-lite": "0.4", - "rw": "1" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - } - } - }, - "d3-ease": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", - "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" - }, - "d3-fetch": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.2.0.tgz", - "integrity": "sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==", - "requires": { - "d3-dsv": "1" - } - }, - "d3-force": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", - "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", - "requires": { - "d3-collection": "1", - "d3-dispatch": "1", - "d3-quadtree": "1", - "d3-timer": "1" - } - }, - "d3-format": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", - "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==" - }, - "d3-geo": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", - "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", - "requires": { - "d3-array": "1" - } - }, - "d3-graphviz": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/d3-graphviz/-/d3-graphviz-2.6.1.tgz", - "integrity": "sha512-878AFSagQyr5tTOrM7YiVYeUC2/NoFcOB3/oew+LAML0xekyJSw9j3WOCUMBsc95KYe9XBYZ+SKKuObVya1tJQ==", - "requires": { - "d3-dispatch": "^1.0.3", - "d3-format": "^1.2.0", - "d3-interpolate": "^1.1.5", - "d3-path": "^1.0.5", - "d3-selection": "^1.1.0", - "d3-timer": "^1.0.6", - "d3-transition": "^1.1.1", - "d3-zoom": "^1.5.0", - "viz.js": "^1.8.2" - } - }, - "d3-hierarchy": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==" - }, - "d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", - "requires": { - "d3-color": "1" - } - }, - "d3-path": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", - "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" - }, - "d3-polygon": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-1.0.6.tgz", - "integrity": "sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ==" - }, - "d3-quadtree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", - "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==" - }, - "d3-random": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-1.1.2.tgz", - "integrity": "sha512-6AK5BNpIFqP+cx/sreKzNjWbwZQCSUatxq+pPRmFIQaWuoD+NrbVWw7YWpHiXpCQ/NanKdtGDuB+VQcZDaEmYQ==" - }, - "d3-scale": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-2.2.2.tgz", - "integrity": "sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw==", - "requires": { - "d3-array": "^1.2.0", - "d3-collection": "1", - "d3-format": "1", - "d3-interpolate": "1", - "d3-time": "1", - "d3-time-format": "2" - } - }, - "d3-scale-chromatic": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz", - "integrity": "sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg==", - "requires": { - "d3-color": "1", - "d3-interpolate": "1" - } - }, - "d3-selection": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" - }, - "d3-shape": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", - "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", - "requires": { - "d3-path": "1" - } - }, - "d3-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", - "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" - }, - "d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "requires": { - "d3-time": "1" - } - }, - "d3-timer": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" - }, - "d3-transition": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", - "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", - "requires": { - "d3-color": "1", - "d3-dispatch": "1", - "d3-ease": "1", - "d3-interpolate": "1", - "d3-selection": "^1.1.0", - "d3-timer": "1" - } - }, - "d3-voronoi": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.4.tgz", - "integrity": "sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==" - }, - "d3-zoom": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", - "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", - "requires": { - "d3-dispatch": "1", - "d3-drag": "1", - "d3-interpolate": "1", - "d3-selection": "1", - "d3-transition": "1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - } - } - }, - "dayjs": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.3.tgz", - "integrity": "sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "debug-log": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", - "integrity": "sha512-gV/pe1YIaKNgLYnd1g9VNW80tcb7oV5qvNUxG7NM8rbDpnl6RGunzlAtlGSb0wEs3nesu2vHNiX9TSsZ+Y+RjA==", - "dev": true - }, - "debug-trace": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/debug-trace/-/debug-trace-2.2.3.tgz", - "integrity": "sha512-NGScbAeLr3Z+6L7aoTbMLr0Bo9ZvmEOhT+BMavnueyqCN4dyCpZ41XP19p8HtCFau0ry/aWk1jWNGb4e9sQpsQ==", - "dev": true, - "requires": { - "callsite": "~1.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true - }, - "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", - "dev": true - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "dev": true, - "requires": { - "kind-of": "^5.0.2" - } - }, - "default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==", - "dev": true - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==", - "peer": true - }, - "deglob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/deglob/-/deglob-3.1.0.tgz", - "integrity": "sha512-al10l5QAYaM/PeuXkAr1Y9AQz0LCtWsnJG23pIgh44hDxHFOj36l6qvhfjnIWBYwZOqM1fXUFV9tkjL7JPdGvw==", - "dev": true, - "requires": { - "find-root": "^1.0.0", - "glob": "^7.0.5", - "ignore": "^5.0.0", - "pkg-config": "^1.1.0", - "run-parallel": "^1.1.2", - "uniq": "^1.0.1" - }, - "dependencies": { - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - } - } - }, - "delay": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", - "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", - "peer": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", - "peer": true - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "requires": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "dependencies": { - "entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" - } - } - }, - "domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==" - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "requires": { - "domelementtype": "^2.3.0" - } - }, - "domutils": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", - "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", - "requires": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.1" + "nan": { + "version": "2.14.0", + "bundled": true, + "peer": true + } } }, - "dotparser": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/dotparser/-/dotparser-0.3.0.tgz", - "integrity": "sha512-TfIlRRKpYFu/KwJq/dm+BWqb4KtwTO1XIwWMaElu/EF3s+r1FRNGIS2bzK0uuAQ+dd3TlJKaoSiHp8Y09Q0ZZA==", + "bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", "peer": true }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } + "bech32-buffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bech32-buffer/-/bech32-buffer-0.2.0.tgz", + "integrity": "sha512-Ez8s82a+Xnn/m3/ftGaQJUSFG4EwNIj9adIJBw8OrHASQsXgvwLSducbcJ9El0rsrwJYJ71yBhC/hZzz3FPSCQ==", + "peer": true }, - "each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" - }, - "dependencies": { - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - } - } + "bigi": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz", + "integrity": "sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw==", + "peer": true }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, + "optional": true, "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "file-uri-to-path": "1.0.0" } }, - "ecpair": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ecpair/-/ecpair-2.0.1.tgz", - "integrity": "sha512-iT3wztQMeE/nDTlfnAg8dAFUfBS7Tq2BXzq3ae6L+pWgFU0fQ3l0woTzdTBrJV3OxBjxbzjq8EQhAbEmJNWFSw==", + "bip-schnorr": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.6.6.tgz", + "integrity": "sha512-QZmVN37kaKfEk6M61gfcREa5JxWVQ0LvA95UQQD5mdyZsN6542PwfrvlAARZufTLn2ZIQQ0ph6XHD0vq8J3ouw==", "peer": true, "requires": { + "bigi": "^1.4.2", + "ecurve": "^1.0.6", + "js-sha256": "^0.9.0", "randombytes": "^2.1.0", - "typeforce": "^1.18.0", - "wif": "^2.0.6" - } - }, - "ecurve": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/ecurve/-/ecurve-1.0.6.tgz", - "integrity": "sha512-/BzEjNfiSuB7jIWKcS/z8FK9jNjmEWvUV2YZ4RLSmcDtP7Lq0m6FvDuSnJpBlDpGRpfRQeTLGLBI8H+kEv0r+w==", - "peer": true, - "requires": { - "bigi": "^1.1.0", - "safe-buffer": "^5.0.1" - } - }, - "editorconfig": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", - "requires": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - } + "safe-buffer": "^5.2.1" } }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + "bip174": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bip174/-/bip174-2.1.0.tgz", + "integrity": "sha512-lkc0XyiX9E9KiVAS1ZiOqK1xfiwvf4FXDDdkDq5crcDzOq+xGytY+14qCsqz7kCiy8rpN1CRNfacRhf9G3JNSA==", + "peer": true }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "bip32": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bip32/-/bip32-3.0.1.tgz", + "integrity": "sha512-Uhpp9aEx3iyiO7CpbNGFxv9WcMIVdGoHG04doQ5Ln0u60uwDah7jUSc3QMV/fSZGm/Oo01/OeAmYevXV+Gz5jQ==", "peer": true, "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "requires": { - "iconv-lite": "^0.6.2" - }, - "dependencies": { - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" + "@types/node": "10.12.18", + "bs58check": "^2.1.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "typeforce": "^1.11.5", + "wif": "^2.0.6" }, "dependencies": { - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } + "@types/node": { + "version": "10.12.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "peer": true } } }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" - }, - "err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" - }, - "errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", - "dev": true, + "bip39": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", + "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", + "peer": true, "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" }, "dependencies": { - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==", + "peer": true } } }, - "es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true + "bip65": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bip65/-/bip65-1.0.3.tgz", + "integrity": "sha512-RQ1nc7xtnLa5XltnCqkoR2zmhuz498RjMJwrLKQzOE049D1HUqnYfon7cVSbwS5UGm0/EQlC2CH+NY3MyITA4Q==", + "peer": true }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } + "bip68": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bip68/-/bip68-1.0.4.tgz", + "integrity": "sha512-O1htyufFTYy3EO0JkHg2CLykdXEtV2ssqw47Gq9A0WByp662xpJnMEB9m43LZjsSDjIAOozWRExlFQk2hlV1XQ==", + "peer": true }, - "es5-ext": { - "version": "0.10.61", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", - "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", - "dev": true, + "bitcoinjs-lib": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.0.1.tgz", + "integrity": "sha512-x/7D4jDj/MMkmO6t3p2CSDXTqpwZ/jRsRiJDmaiXabrR9XRo7jwby8HRn7EyK1h24rKFFI7vI0ay4czl6bDOZQ==", + "peer": true, "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" + "bech32": "^2.0.0", + "bip174": "^2.0.1", + "bs58check": "^2.1.2", + "create-hash": "^1.1.0", + "typeforce": "^1.11.3", + "varuint-bitcoin": "^1.1.2", + "wif": "^2.0.1" } }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } + "blessed": { + "version": "0.1.81", + "resolved": "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz", + "integrity": "sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==", + "peer": true }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + }, + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "peer": true }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", - "peer": true, + "body-parser": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "requires": { - "es6-promise": "^4.0.3" + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" } }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" } }, - "eslint": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", - "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", - "dev": true, - "requires": { - "ajv": "^6.5.0", - "babel-code-frame": "^6.26.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.2", - "imurmurhash": "^0.1.4", - "inquirer": "^5.2.0", - "is-resolvable": "^1.1.0", - "js-yaml": "^3.11.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^2.0.0", - "require-uncached": "^1.0.3", - "semver": "^5.5.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^4.0.3", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "peer": true + }, + "browser-level": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", + "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", + "requires": { + "abstract-level": "^1.0.2", + "catering": "^2.1.1", + "module-error": "^1.0.2", + "run-parallel-limit": "^1.1.0" } }, - "eslint-config-semistandard": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-13.0.0.tgz", - "integrity": "sha512-ZuImKnf/9LeZjr6dtRJ0zEdQbjBwXu0PJR3wXJXoQeMooICMrYPyD70O1tIA9Ng+wutgLjB7UXvZOKYPvzHg+w==", - "dev": true, - "requires": {} + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" }, - "eslint-config-standard": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", - "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==", - "dev": true, - "requires": {} + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true }, - "eslint-config-standard-jsx": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz", - "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==", + "browserslist": { + "version": "4.20.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz", + "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==", "dev": true, - "requires": {} + "requires": { + "caniuse-lite": "^1.0.30001332", + "electron-to-chromium": "^1.4.118", + "escalade": "^3.1.1", + "node-releases": "^2.0.3", + "picocolors": "^1.0.0" + } }, - "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", - "dev": true, + "bs58": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-3.1.0.tgz", + "integrity": "sha512-9C2bRFTGy3meqO65O9jLvVTyawvhLVp4h2ECm5KlRPuV5KPDNJZcJIj3gl+aA0ENXcYrUSLCkPAeqbTcI2uWyQ==", + "peer": true, "requires": { - "debug": "^3.2.7", - "resolve": "^1.20.0" + "base-x": "^1.1.0" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "peer": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" }, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, + "base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "peer": true, "requires": { - "ms": "^2.1.1" + "safe-buffer": "^5.0.1" } }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "peer": true, + "requires": { + "base-x": "^3.0.2" + } } } }, - "eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", - "dev": true, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha512-tcBWO2Dl4e7Asr9hTGcpVrCe+F7DubpmqWCTbj4FHLmjqO2hIaC383acQubWtRJhdceqs5uBHs6Es+Sk//RKiQ==", + "dev": true + }, + "buffer-es6": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/buffer-es6/-/buffer-es6-4.9.3.tgz", + "integrity": "sha512-Ibt+oXxhmeYJSsCkODPqNpPmyegefiD8rfutH1NYGhMZQhSp95Rz7haemgnJ6dxa6LT+JLLbtgOMORRluwKktw==", + "dev": true + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "buffer-reverse": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-reverse/-/buffer-reverse-1.0.1.tgz", + "integrity": "sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg==", + "peer": true + }, + "builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" }, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { - "p-try": "^1.0.0" + "yallist": "^4.0.0" } }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { - "p-limit": "^1.1.0" + "glob": "^7.1.3" } }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } }, - "eslint-plugin-es": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz", - "integrity": "sha512-5fa/gR2yR3NxQf+UXkeLeP8FBBl6tSgdrAz1+cF84v1FMM4twGwQoqTnn+QxFLcPOrF4pdKEJKDB/q9GoyJrCA==", + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "eslint-utils": "^1.4.2", - "regexpp": "^2.0.1" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, - "eslint-plugin-import": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", - "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { - "contains-path": "^0.1.0", - "debug": "^2.6.8", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.1", - "eslint-module-utils": "^2.2.0", - "has": "^1.0.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.3", - "read-pkg-up": "^2.0.0", - "resolve": "^1.6.0" - }, - "dependencies": { - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha512-lsGyRuYr4/PIB0txi+Fy2xOMI2dGaTguCaotzFGkVZuKR5usKfcRWIFKNM3QNrU7hh/+w2bwTW+ZeXPK5l8uVg==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - } + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" } }, - "eslint-plugin-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", - "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", - "dev": true, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "requires": { - "eslint-plugin-es": "^1.3.1", - "eslint-utils": "^1.3.1", - "ignore": "^4.0.2", - "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" } }, - "eslint-plugin-promise": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", - "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==", + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "eslint-plugin-react": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz", - "integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==", - "dev": true, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "caniuse-lite": { + "version": "1.0.30001346", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001346.tgz", + "integrity": "sha512-q6ibZUO2t88QCIPayP/euuDREq+aMAxFE5S70PkrLh0iTDj/zEhgvJRKC2+CvXY6EWc6oQwUR48lL5vCW6jiXQ==", + "dev": true + }, + "catering": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", + "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==" + }, + "catharsis": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", "requires": { - "array-includes": "^3.0.3", - "doctrine": "^2.1.0", - "has": "^1.0.3", - "jsx-ast-utils": "^2.0.1", - "prop-types": "^15.6.2" + "lodash": "^4.17.14" } }, - "eslint-plugin-standard": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.2.tgz", - "integrity": "sha512-nKptN8l7jksXkwFk++PhJB3cCDTcXOEyhISIN86Ue2feJ1LFyY3PrY3/xT2keXlJSY5bpmbiTG0f885/YKAvTA==", - "dev": true, - "requires": {} - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, + "character-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", + "integrity": "sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==", "requires": { - "eslint-visitor-keys": "^1.1.0" + "is-regex": "^1.0.3" } }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - }, - "espree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", - "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", - "dev": true, + "cheerio": { + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz", + "integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==", "requires": { - "acorn": "^6.0.2", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "tslib": "^2.4.0" }, "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true + "entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} + "parse5": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "requires": { + "entities": "^4.3.0" + } } } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, + "cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" } }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", "dev": true, "requires": { - "estraverse": "^5.2.0" + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" }, "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } } } }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + "chrono-node": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/chrono-node/-/chrono-node-2.3.8.tgz", + "integrity": "sha512-cOCUKFHkGKJ//2VK0Vjwd8qh/tDJNraZHYb4DNB48mRUyfL7ag9lCDXgos30fPmV1pha4sP4qHLYItKNS0YpRw==", + "requires": { + "dayjs": "^1.10.0" + } }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "peer": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "debug": "^2.3.3", + "arr-union": "^3.1.0", "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -20487,4473 +17597,5569 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "classic-level": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", + "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "requires": { + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "^4.3.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, + "clightningjs": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/clightningjs/-/clightningjs-0.2.2.tgz", + "integrity": "sha512-9fdWYNxe/IUe0uG0b1XdxWGlev1IPlWZpN6Hrsr3uTOZe1kSR+ySBMzdsgD73Rc3LeX7DfdKhT3uuT8B77HIqg==", + "peer": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "code-block-writer": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.1.tgz", + "integrity": "sha512-67ueh2IRGst/51p0n6FvPrnRjAGHY5F8xdjkgrYE7DDzpJe6qA07RYQ9VcoUeo5ATOjSOiWpSL3SWBRRbempMw==", + "peer": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "dev": true + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==", "dev": true, "requires": { - "homedir-polyfill": "^1.0.1" + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" } }, - "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "dev": true, "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.0", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.10.3", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - } + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, - "express-bearer-token": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/express-bearer-token/-/express-bearer-token-2.4.0.tgz", - "integrity": "sha512-2+kRZT2xo+pmmvSY7Ma5FzxTJpO3kGaPCEXPbAm3GaoZ/z6FE4K6L7cvs1AUZwY2xkk15PcQw7t4dWjsl5rdJw==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "cookie": "^0.3.1", - "cookie-parser": "^1.4.4" - }, - "dependencies": { - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==" - } + "color-name": "~1.1.4" } }, - "express-session": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.3.tgz", - "integrity": "sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==", + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { - "cookie": "0.4.2", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.0.2", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "dependencies": { - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" - } + "delayed-stream": "~1.0.0" } }, - "ext": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "peer": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "type": "^2.5.0" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "dependencies": { - "type": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==", + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "condense-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/condense-whitespace/-/condense-whitespace-2.0.0.tgz", + "integrity": "sha512-Ath9o58/0rxZXbyoy3zZgrVMoIemi30sukG/btuMKCLyqfQt3dNOWc9N3EHEMa2Q3i0tXQPDJluYFLwy7pJuQw==" }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dev": true, + "config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", "requires": { - "is-extendable": "^0.1.0" + "ini": "^1.3.4", + "proto-list": "~1.2.1" } }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" + "safe-buffer": "5.2.1" } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" + }, + "cookie-parser": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", + "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", + "requires": { + "cookie": "0.4.1", + "cookie-signature": "1.0.6" }, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" } } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "eyes": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", - "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", - "peer": true + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "dev": true }, - "fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "copy-props": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", "dev": true, "requires": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" } }, - "fast-deep-equal": { + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "corser": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", - "peer": true + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==" }, - "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "peer": true, "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "peer": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dev": true, + "requires": { + "node-fetch": "2.6.7" }, "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "peer": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "peer": true, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "whatwg-url": "^5.0.0" } }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "peer": true, - "requires": { - "is-glob": "^4.0.1" - } + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "peer": true + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "peer": true, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "peer": true, + } + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "requires": { - "is-number": "^7.0.0" + "isexe": "^2.0.0" } } } }, - "fast-json-patch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", - "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", - "peer": true, + "crypto-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", + "peer": true + }, + "css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "requires": { - "fast-deep-equal": "^2.0.1" + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" } }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==" }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "peer": true, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", "requires": { - "reusify": "^1.0.4" + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" + } } }, - "fd-chunk-store": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fd-chunk-store/-/fd-chunk-store-2.0.0.tgz", - "integrity": "sha512-KudkwWpVD7GzHf+V0D9r+9AjkzyHya/iu1dj4Uf0VaWWqtFvQRThVYIReIP6WUs7x644rUv5r+K5SaVBNwWmjQ==", - "peer": true, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, "requires": { - "defined": "^1.0.0", - "inherits": "^2.0.1" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" + "d3": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.4.4.tgz", + "integrity": "sha512-97FE+MYdAlV3R9P74+R3Uar7wUKkIFu89UWMjEaDhiJ9VxKvqaMxauImy8PC2DdBkdM2BxJOIoLxPrcZUyrKoQ==", + "requires": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "3", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "dependencies": { + "d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==" + } } }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha512-uXP/zGzxxFvFfcZGgBIwotm+Tdc55ddPAzF7iHshP4YGaXMww7rSF9peD9D1sui5ebONg5UobsZv+FfgEpGv/w==", - "dev": true, + "d3-array": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.1.6.tgz", + "integrity": "sha512-DCbBBNuKOeiR9h04ySRBMW52TFVc91O9wJziuyXw6Ztmy8D3oZbmCkOO3UHKC7ceNJsN2Mavo9+vwV8EAEUXzA==", "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "internmap": "1 - 2" } }, - "file-extension": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/file-extension/-/file-extension-4.0.5.tgz", - "integrity": "sha512-l0rOL3aKkoi6ea7MNZe6OHgqYYpn48Qfflr8Pe9G9JPPTx5A+sfboK91ZufzIs59/lPqh351l0eb6iKU9J5oGg==" - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true + "d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==" }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", - "dev": true, + "d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "dependencies": { + "d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==" + } } }, - "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" + "d3-path": "1 - 3" } }, - "find-root": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true + "d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==" }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, + "d3-contour": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-3.0.1.tgz", + "integrity": "sha512-0Oc4D0KyhwhM7ZL0RMnfGycLN7hxHB8CMmwZ3+H26PWAG0ozNuYG5hXSDNgmP1SgJkQMrlG6cP20HoaSbvcJTQ==", "requires": { - "locate-path": "^3.0.0" + "d3-array": "2 - 3" } }, - "findup-sync": { + "d3-delaunay": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.2.tgz", + "integrity": "sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ==", + "requires": { + "delaunator": "5" + } + }, + "d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==" + }, + "d3-drag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "dependencies": { + "d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==" + } } }, - "fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", - "dev": true, + "d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" }, "dependencies": { - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "requires": { - "isobject": "^3.0.1" + "safer-buffer": ">= 2.1.2 < 3.0.0" } } } }, - "flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", - "dev": true + "d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==" }, - "flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", - "dev": true, + "d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", "requires": { - "is-buffer": "~2.0.3" + "d3-dsv": "1 - 3" } }, - "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", - "dev": true, + "d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + } + }, + "d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==" + }, + "d3-geo": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.0.1.tgz", + "integrity": "sha512-Wt23xBych5tSy9IYAM1FR2rWIBFWa52B/oF/GYe5zbdHrg08FU8+BuI6X4PvTwPDdqdAdq04fuWJpELtsaEjeA==", + "requires": { + "d3-array": "2.5.0 - 3" + } + }, + "d3-graphviz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/d3-graphviz/-/d3-graphviz-4.1.1.tgz", + "integrity": "sha512-s0IVbKf8rs4eJI2xo5Umr7nXDX/LEZw/x2WtKxmlyQxR0qUY49UiLhBNOX7VDHZywMle43NKEXnU6fn22fpJvQ==", + "requires": { + "@hpcc-js/wasm": "1.12.8", + "d3-dispatch": "^2.0.0", + "d3-format": "^2.0.0", + "d3-interpolate": "^2.0.1", + "d3-path": "^2.0.0", + "d3-timer": "^2.0.0", + "d3-transition": "^2.0.0", + "d3-zoom": "^2.0.0" }, "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, + "d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" + }, + "d3-dispatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-2.0.0.tgz", + "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" + }, + "d3-drag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-2.0.0.tgz", + "integrity": "sha512-g9y9WbMnF5uqB9qKqwIIa/921RYWzlUDv9Jl1/yONQwxbOfszAWTCm8u7HOTgJgRDXiRZN56cHT9pd24dmXs8w==", "requires": { - "glob": "^7.1.3" + "d3-dispatch": "1 - 2", + "d3-selection": "2" + } + }, + "d3-ease": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", + "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" + }, + "d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" + }, + "d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", + "requires": { + "d3-color": "1 - 2" + } + }, + "d3-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-2.0.0.tgz", + "integrity": "sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA==" + }, + "d3-timer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", + "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + }, + "d3-transition": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", + "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", + "requires": { + "d3-color": "1 - 2", + "d3-dispatch": "1 - 2", + "d3-ease": "1 - 2", + "d3-interpolate": "1 - 2", + "d3-timer": "1 - 2" + } + }, + "d3-zoom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-2.0.0.tgz", + "integrity": "sha512-fFg7aoaEm9/jf+qfstak0IYpnesZLiMX6GZvXtUSdv8RH2o4E2qeelgdU09eKS6wGuiGMfcnMI0nTIqWzRHGpw==", + "requires": { + "d3-dispatch": "1 - 2", + "d3-drag": "2", + "d3-interpolate": "1 - 2", + "d3-selection": "2", + "d3-transition": "2" } } } }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, + "d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==" + }, + "d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" + "d3-color": "1 - 3" } }, - "follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", - "dev": true + "d3-path": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.0.1.tgz", + "integrity": "sha512-gq6gZom9AFZby0YLduxT1qmrp4xpBA1YZr19OI717WIdKE2OM5ETq5qrHLb301IgxhLwcuxvGZVLeeWc/k1I6w==" }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } + "d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==" }, - "foreach": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", - "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", - "peer": true + "d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==" }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true + "d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==" }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, + "d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" } }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", - "dev": true, + "d3-scale-chromatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz", + "integrity": "sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==", "requires": { - "map-cache": "^0.2.2" + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" } }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + "d3-selection": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", + "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "d3-shape": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.1.0.tgz", + "integrity": "sha512-tGDh1Muf8kWjEDT/LswZJ8WF85yDZLvVJpYU9Nq+8+yW1Z5enxrmXOhTArlkaElU+CTn0OTVNli+/i+HP45QEQ==", "requires": { - "minipass": "^3.0.0" + "d3-path": "1 - 3" } }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==", - "dev": true, + "d3-time": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.0.0.tgz", + "integrity": "sha512-zmV3lRnlaLI08y9IMRXSDshQb5Nj77smnfpnd2LrBa/2K281Jijactokeak14QacHs/kKq0AQ121nidNYlarbQ==", "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" + "d3-array": "2 - 3" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, + "d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" + "d3-time": "1 - 3" } }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==" }, - "function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", - "dev": true, + "d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" } }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true + "d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "requires": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + } }, - "functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" }, - "gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" }, "dependencies": { - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" } } } }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true + "dayjs": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.2.tgz", + "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" }, - "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "ms": "2.0.0" } }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, - "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "debug-trace": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/debug-trace/-/debug-trace-2.2.3.tgz", + "integrity": "sha512-NGScbAeLr3Z+6L7aoTbMLr0Bo9ZvmEOhT+BMavnueyqCN4dyCpZ41XP19p8HtCFau0ry/aWk1jWNGb4e9sQpsQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "callsite": "~1.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "kind-of": "^5.0.2" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" + "strip-bom": "^4.0.0" }, "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true } } }, - "glob-run": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/glob-run/-/glob-run-0.1.7.tgz", - "integrity": "sha512-8zLtPFAhK1kL6nghJfwDW5LEggkEXJxsq+bvTzwiluAjvGCIoyi3grpWs0dESSPqYOJ/184oIYqT3+szTqwyjw==", - "peer": true, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==", + "dev": true + }, + "define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, "requires": { - "async": "^3.1.0", - "glob": "^7.1.4" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" } }, - "glob-watcher": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", - "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", - "dev": true, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==", + "peer": true + }, + "delaunator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.0.tgz", + "integrity": "sha512-AyLvtyJdbv/U1GkiS6gUUzclRoAY4Gs75qkMygJJhU75LW4DNuSF2RMzpxs9jw9Oz1BobHjTdkG3zdP55VxAqw==", "requires": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "normalize-path": "^3.0.0", - "object.defaults": "^1.1.0" + "robust-predicates": "^3.0.0" } }, - "global-modules": { + "delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "peer": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "denque": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", + "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", + "peer": true + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "detect-file": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", + "dev": true + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" + "esutils": "^2.0.2" } }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", - "dev": true, + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "dependencies": { + "entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" + } } }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==" }, - "glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "dev": true, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "requires": { - "sparkles": "^1.0.0" + "webidl-conversions": "^7.0.0" } }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "requires": { + "domelementtype": "^2.3.0" + } }, - "gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "dev": true, + "domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", "requires": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" } }, - "gulp-cli": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", - "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "dotparser": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dotparser/-/dotparser-0.3.0.tgz", + "integrity": "sha512-TfIlRRKpYFu/KwJq/dm+BWqb4KtwTO1XIwWMaElu/EF3s+r1FRNGIS2bzK0uuAQ+dd3TlJKaoSiHp8Y09Q0ZZA==", + "peer": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.4.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.2.0", - "yargs": "^7.1.0" + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", + "each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", "dev": true, "requires": { - "glogg": "^1.0.0" + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + }, + "dependencies": { + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + } } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, + "ecpair": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ecpair/-/ecpair-2.0.1.tgz", + "integrity": "sha512-iT3wztQMeE/nDTlfnAg8dAFUfBS7Tq2BXzq3ae6L+pWgFU0fQ3l0woTzdTBrJV3OxBjxbzjq8EQhAbEmJNWFSw==", + "peer": true, "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "randombytes": "^2.1.0", + "typeforce": "^1.18.0", + "wif": "^2.0.6" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "ecurve": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/ecurve/-/ecurve-1.0.6.tgz", + "integrity": "sha512-/BzEjNfiSuB7jIWKcS/z8FK9jNjmEWvUV2YZ4RLSmcDtP7Lq0m6FvDuSnJpBlDpGRpfRQeTLGLBI8H+kEv0r+w==", + "peer": true, "requires": { - "function-bind": "^1.1.1" + "bigi": "^1.1.0", + "safe-buffer": "^5.0.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, + "editorconfig": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", + "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", "requires": { - "ansi-regex": "^2.0.0" + "commander": "^2.19.0", + "lru-cache": "^4.1.5", + "semver": "^5.6.0", + "sigmund": "^1.0.1" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" } } }, - "has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "electron-to-chromium": { + "version": "1.4.146", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz", + "integrity": "sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg==", + "dev": true }, - "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "peer": true, "requires": { - "get-intrinsic": "^1.1.1" + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" } }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "requires": { - "has-symbols": "^1.0.2" - } + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", - "dev": true, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" + "iconv-lite": "^0.6.2" }, "dependencies": { - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", - "dev": true, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, "requires": { - "is-buffer": "^1.1.5" + "safer-buffer": ">= 2.1.2 < 3.0.0" } } } }, - "has-values": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-2.0.1.tgz", - "integrity": "sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w==", + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, "requires": { - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" - } + "once": "^1.4.0" } }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "peer": true, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "ansi-colors": "^4.1.1" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true } } }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "peer": true, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "is-arrayish": "^0.2.1" } }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + "es-abstract": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "peer": true, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "has": "^1.0.3" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { - "parse-passwd": "^1.0.0" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "es5-ext": { + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", + "dev": true, + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "dev": true, "requires": { - "whatwg-encoding": "^2.0.0" + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, - "htmlparser2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", - "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "peer": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "peer": true, "requires": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "entities": "^4.3.0" - }, - "dependencies": { - "entities": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", - "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" - } + "es6-promise": "^4.0.3" } }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } }, - "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" } }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" } }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "dependencies": { + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "requires": { "ms": "2.1.2" } }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } }, - "http-server": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", - "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", - "requires": { - "basic-auth": "^2.0.1", - "chalk": "^4.1.2", - "corser": "^2.0.1", - "he": "^1.2.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy": "^1.18.1", - "mime": "^1.6.0", - "minimist": "^1.2.6", - "opener": "^1.5.1", - "portfinder": "^1.0.28", - "secure-compare": "3.0.1", - "union": "~0.5.0", - "url-join": "^4.0.1" - } + "eslint-config-semistandard": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-16.0.0.tgz", + "integrity": "sha512-oD8QOo4mSInRJhQb3Zi6L8HebwZaB6SI3A+NNrPdVN0nN1K45L5pXK3joY+ksWDlT3ew/M+fJk2tuMCjIpjRzQ==", + "dev": true, + "requires": {} }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "eslint-config-standard": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", + "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } + "requires": {} }, - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "eslint-config-standard-jsx": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-10.0.0.tgz", + "integrity": "sha512-hLeA2f5e06W1xyr/93/QJulN/rLbUVUmqTlexv9PRKHFwEC9ffJcH2LvJhMoEqYQBEYafedgGZXH2W8NUpt5lA==", + "dev": true, + "requires": {} + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, "requires": { - "agent-base": "6", - "debug": "4" + "debug": "^3.2.7", + "resolve": "^1.20.0" }, "dependencies": { "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "requires": { - "ms": "2.1.2" + "ms": "^2.1.1" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true } } }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "image-extensions": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/image-extensions/-/image-extensions-1.1.0.tgz", - "integrity": "sha512-P0t7ByhK8Jk9TU05ct/7+f7h8dNuXq5OY4m0IO/T+1aga/qHkpC0Wf472x3FLdq/zFDG17pgapCM3JDTxwZzow==" - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==" - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "inquirer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", - "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", + "eslint-module-utils": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.1.0", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^5.5.2", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" + "debug": "^3.2.7", + "find-up": "^2.1.0" }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "ms": "^2.1.1" } }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "locate-path": "^2.0.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "requires": { - "color-name": "1.1.3" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "p-try": "^1.0.0" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "p-limit": "^1.1.0" } }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true } } }, - "install-artifact-from-github": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.1.tgz", - "integrity": "sha512-3l3Bymg2eKDsN5wQuMfgGEj2x6l5MCAv0zPL6rxHESufFVlEAKW/6oY9F1aGgvY/EgWm5+eWGRjINveL4X7Hgg==" + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + } }, - "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "side-channel": "^1.0.4" + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + } } }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", - "dev": true - }, - "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" - }, - "ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==" + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + "eslint-plugin-promise": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.2.0.tgz", + "integrity": "sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw==", + "dev": true, + "requires": {} }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "eslint-plugin-react": { + "version": "7.21.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz", + "integrity": "sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g==", "dev": true, "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" + "array-includes": "^3.1.1", + "array.prototype.flatmap": "^1.2.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "object.entries": "^1.1.2", + "object.fromentries": "^2.0.2", + "object.values": "^1.1.1", + "prop-types": "^15.7.2", + "resolve": "^1.18.1", + "string.prototype.matchall": "^4.0.2" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + } } }, - "is-absolute-url": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", - "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==" - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" }, "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { - "has-bigints": "^1.0.1" + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { - "binary-extensions": "^1.0.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, - "is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "estraverse": "^5.1.0" } }, - "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" - }, - "is-builtin-module": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", - "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "builtin-modules": "^3.0.0" + "estraverse": "^5.2.0" } }, - "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", - "dev": true + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, - "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "requires": { - "has": "^1.0.3" - } + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", "dev": true, "requires": { - "kind-of": "^6.0.0" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", "dev": true, "requires": { - "has-tostringtag": "^1.0.0" + "homedir-polyfill": "^1.0.1" } }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, + "express": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.0", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.10.3", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" } } }, - "is-expression": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-1.0.2.tgz", - "integrity": "sha512-ynWEmX/S8I+WxXHWkHzrMbyjHTDzqreNdVOQBFwI9Pmdok9OOnTK1ytxg7JTNgQPjoAOEGFMW+9d0b9UtZsvIw==", + "express-bearer-token": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/express-bearer-token/-/express-bearer-token-2.4.0.tgz", + "integrity": "sha512-2+kRZT2xo+pmmvSY7Ma5FzxTJpO3kGaPCEXPbAm3GaoZ/z6FE4K6L7cvs1AUZwY2xkk15PcQw7t4dWjsl5rdJw==", "requires": { - "acorn": "~2.7.0", - "object-assign": "^4.0.1" + "cookie": "^0.3.1", + "cookie-parser": "^1.4.4" + }, + "dependencies": { + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==" + } } }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "express-session": { + "version": "1.17.3", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.3.tgz", + "integrity": "sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==", "requires": { - "is-extglob": "^2.1.1" + "cookie": "0.4.2", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-headers": "~1.0.2", + "parseurl": "~1.3.3", + "safe-buffer": "5.2.1", + "uid-safe": "~2.1.5" + }, + "dependencies": { + "cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + } } }, - "is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true + "ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "dev": true, + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==", + "dev": true + } + } }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==", + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "kind-of": "^3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "is-descriptor": "^1.0.0" } } } }, - "is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "peer": true + }, + "fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", "dev": true, "requires": { - "has-tostringtag": "^1.0.0" + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" } }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", + "peer": true + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "peer": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "peer": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "peer": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "peer": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "peer": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "peer": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "fast-json-patch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", + "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", "dev": true }, - "is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "peer": true, "requires": { - "@types/estree": "*" + "reusify": "^1.0.4" } }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "fd-chunk-store": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fd-chunk-store/-/fd-chunk-store-2.0.0.tgz", + "integrity": "sha512-KudkwWpVD7GzHf+V0D9r+9AjkzyHya/iu1dj4Uf0VaWWqtFvQRThVYIReIP6WUs7x644rUv5r+K5SaVBNwWmjQ==", + "peer": true, "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "defined": "^1.0.0", + "inherits": "^2.0.1" } }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, + "fetch-blob": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.5.tgz", + "integrity": "sha512-N64ZpKqoLejlrwkIAnb9iLSA3Vx/kjgzpcDhygcqJ2KKjky8nCgUQ+dzXtbrLaWZGZNmNfQTsiQ0weZ1svglHg==", "requires": { - "is-unc-path": "^1.0.0" + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" } }, - "is-relative-url": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-relative-url/-/is-relative-url-3.0.0.tgz", - "integrity": "sha512-U1iSYRlY2GIMGuZx7gezlB5dp1Kheaym7zKzO1PV06mOihiWTXejLwm4poEJysPyXF+HtK/BEd0DVlcCh30pEA==", + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, "requires": { - "is-absolute-url": "^3.0.0" + "flat-cache": "^3.0.4" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true + "file-extension": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/file-extension/-/file-extension-4.0.5.tgz", + "integrity": "sha512-l0rOL3aKkoi6ea7MNZe6OHgqYYpn48Qfflr8Pe9G9JPPTx5A+sfboK91ZufzIs59/lPqh351l0eb6iKU9J5oGg==" }, - "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" } }, - "is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "requires": { - "has-tostringtag": "^1.0.0" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" } }, - "is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "has-symbols": "^1.0.2" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", "dev": true, "requires": { - "unc-path-regex": "^0.1.2" + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, - "is-uri": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-uri/-/is-uri-1.2.4.tgz", - "integrity": "sha512-8sHi5gEARwpMYwJD9uSAkU9Bb7YkSagcM10EYqSe+osqOErXln4VL+EgLSG40e9lVTpcpygpvb9Z6ohZpECDGA==", + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, "requires": { - "parse-uri": "~1.0.3", - "punycode2": "~1.0.0" + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "dependencies": { + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + } } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", "dev": true }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==", + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, - "is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "call-bind": "^1.0.2" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "iso-639-3": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/iso-639-3/-/iso-639-3-2.2.0.tgz", - "integrity": "sha512-v9w/U4XDSfXCrXxf4E6ertGC/lTRX8MLLv7XC1j6N5oL3ympe38jp77zgeyMsn3MbufuAAoGeVzDJbOXnPTMhQ==" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", - "dev": true - }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "requires": {} - }, - "isostring": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isostring/-/isostring-0.0.1.tgz", - "integrity": "sha512-wRcdJtXCe2LGtXnD14fXMkduWVdbeGkzBIKg8WcKeEOi6SIc+hRjYYw76WNx3v5FebhUWZrBTWB0NOl3/sagdQ==" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, - "jade-error": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/jade-error/-/jade-error-1.2.0.tgz", - "integrity": "sha512-CFrPTxhgf4tf2yNJlUyh7uSx/hw0jSJl37FJ630WQ0+HplYdYyc3jrgdkb1B7+m4XFjgc+oay4doQrkzkbbYOw==" + "follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" }, - "jade-lexer": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/jade-lexer/-/jade-lexer-0.0.9.tgz", - "integrity": "sha512-Utwt3x/hAObIf2xCfbN6xOgjxQljvYuEplJtLuxMXvjzvpJGndVcCfqme1nYcxy4c7RRBI02+fPB+4hldqUnEg==", + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "dev": true, "requires": { - "character-parser": "^2.1.1", - "is-expression": "^1.0.0", - "jade-error": "^1.0.0" + "for-in": "^1.0.1" } }, - "jade-parser": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/jade-parser/-/jade-parser-0.0.9.tgz", - "integrity": "sha512-nTAf2CRJklcirLip+oHSd+Y+QYaJvS/D7oRvX9ENsYz5Bbzz/GqDFZZC3faI8ZloP/GiKZedlSPuePuJD3+Gnw==", + "foreach": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.6.tgz", + "integrity": "sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==", + "peer": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, "requires": { - "jade-error": "^1.0.0", - "token-stream": "0.0.1" + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" } }, - "javascript-state-machine": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/javascript-state-machine/-/javascript-state-machine-3.1.0.tgz", - "integrity": "sha512-BwhYxQ1OPenBPXC735RgfB+ZUG8H3kjsx8hrYTgWnoy6TPipEy4fiicyhT2lxRKAXq9pG7CfFT8a2HLr6Hmwxg==", - "peer": true + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } }, - "jayson": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", - "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", - "peer": true, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "requires": { - "@types/connect": "^3.4.33", - "@types/express-serve-static-core": "^4.17.9", - "@types/lodash": "^4.14.159", - "@types/node": "^12.12.54", - "@types/ws": "^7.4.4", - "commander": "^2.20.3", - "delay": "^5.0.0", - "es6-promisify": "^5.0.0", - "eyes": "^0.1.8", - "isomorphic-ws": "^4.0.1", - "json-stringify-safe": "^5.0.1", - "JSONStream": "^1.3.5", - "lodash": "^4.17.20", - "uuid": "^8.3.2", - "ws": "^7.4.5" - }, - "dependencies": { - "@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "peer": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "peer": true - }, - "ws": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", - "peer": true, - "requires": {} - } + "fetch-blob": "^3.1.2" } }, - "jquery": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", - "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" }, - "js-beautify": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.4.tgz", - "integrity": "sha512-+b4A9c3glceZEmxyIbxDOYB0ZJdReLvyU1077RqKsO4dZx9FUHjTOJn8VHwpg33QoucIykOiYbh7MfqBOghnrA==", + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "dev": true, "requires": { - "config-chain": "^1.1.13", - "editorconfig": "^0.15.3", - "glob": "^7.1.3", - "nopt": "^5.0.0" + "map-cache": "^0.2.2" } }, - "js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", - "peer": true + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" } }, - "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha512-CSOkdn0/GhRFwxnipmhXfqJ+FG6+wkWBi46kKSsPx6+j65176ZiQcrCYpg6K8x3iLbO4k3zScBnZ7I/L80dAtw==", + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, + "optional": true, "requires": { - "xmlcreate": "^1.0.1" + "bindings": "^1.5.0", + "nan": "^2.12.1" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, - "jsdoc": { - "version": "git+ssh://git@github.com/FabricLabs/jsdoc.git#1a9aee2aed164d3dd96abaa4629e2417520d7ade", + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, - "from": "jsdoc@FabricLabs/jsdoc#fabric", "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "~3.5.0", - "catharsis": "~0.8.9", - "escape-string-regexp": "~1.0.5", - "js2xmlparser": "~3.0.0", - "klaw": "~2.0.0", - "markdown-it": "~8.3.1", - "markdown-it-named-headers": "~0.0.4", - "marked": "~0.3.6", - "mkdirp": "~0.5.1", - "requizzle": "~0.2.1", - "strip-json-comments": "~2.0.1", - "taffydb": "2.6.2", - "underscore": "~1.8.3" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - } + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" } }, - "jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" }, "dependencies": { - "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "ws": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz", - "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==", - "dev": true, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "requires": { - "async-limiter": "~1.0.0" + "string-width": "^1.0.2 || 2 || 3 || 4" } } } }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, - "json-pointer": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", - "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", - "peer": true, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "requires": { - "foreach": "^2.0.4" + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" } }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", - "peer": true - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "peer": true, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" } }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "jsx-ast-utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz", - "integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==", - "dev": true, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "requires": { - "array-includes": "^3.1.1", - "object.assign": "^4.1.0" + "is-glob": "^4.0.1" } }, - "just-debounce": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz", - "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - }, - "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha512-Hx5PvgJKTWpMkNJCYrBUNBLlxYIkxN4FVU/BnZP4CFh5BpiHOgujAPx7iFVz/phD0bP8rsqD48gtqcvNlUt0lQ==", - "dev": true, + "glob-run": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/glob-run/-/glob-run-0.1.7.tgz", + "integrity": "sha512-8zLtPFAhK1kL6nghJfwDW5LEggkEXJxsq+bvTzwiluAjvGCIoyi3grpWs0dESSPqYOJ/184oIYqT3+szTqwyjw==", + "peer": true, "requires": { - "graceful-fs": "^4.1.9" + "async": "^3.1.0", + "glob": "^7.1.4" } }, - "last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==", + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", "dev": true, "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, - "lazystream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "glob-watcher": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", + "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", "dev": true, "requires": { - "readable-stream": "^2.0.5" + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "normalize-path": "^3.0.0", + "object.defaults": "^1.1.0" } }, - "lcid": { + "global-modules": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { - "invert-kv": "^1.0.0" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==", + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", "dev": true, "requires": { - "flush-write-stream": "^1.0.2" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "level": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-5.0.1.tgz", - "integrity": "sha512-wcak5OQeA4rURGacqS62R/xNHjCYnJSQDBOlm4KNUGJVE9bWv2B04TclqReYejN+oD65PzD4FsqeWoI5wNC5Lg==", - "requires": { - "level-js": "^4.0.0", - "level-packager": "^5.0.0", - "leveldown": "^5.0.0", - "opencollective-postinstall": "^2.0.0" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, "requires": { - "buffer": "^5.6.0" + "sparkles": "^1.0.0" } }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, "requires": { - "errno": "~0.1.1" + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" } }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "gulp-cli": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "dev": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.4.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.2.0", + "yargs": "^7.1.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "dev": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "yargs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", + "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.1" + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" } } } }, - "level-js": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-4.0.2.tgz", - "integrity": "sha512-PeGjZsyMG4O89KHiez1zoMJxStnkM+oBIqgACjoo5PJqFiSUUm3GNod/KcbqN5ktyZa8jkG7I1T0P2u6HN9lIg==", - "requires": { - "abstract-leveldown": "~6.0.1", - "immediate": "~3.2.3", - "inherits": "^2.0.3", - "ltgt": "^2.1.2", - "typedarray-to-buffer": "~3.1.5" - } - }, - "level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "requires": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" - } - }, - "level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", + "dev": true, "requires": { - "xtend": "^4.0.2" + "glogg": "^1.0.0" } }, - "leveldown": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "requires": { - "abstract-leveldown": "~6.2.1", - "napi-macros": "~2.0.0", - "node-gyp-build": "~4.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } + "function-bind": "^1.1.1" } }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" + "get-intrinsic": "^1.1.1" } }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "has-symbols": "^1.0.2" } }, - "liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", "dev": true, "requires": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" }, "dependencies": { - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", "dev": true, "requires": { - "isobject": "^3.0.1" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" } } } }, - "lightning-client": { - "version": "0.5.2-beta.8", - "resolved": "https://registry.npmjs.org/lightning-client/-/lightning-client-0.5.2-beta.8.tgz", - "integrity": "sha512-kSTzu4yYSrxYZv6TGk2ZyVT6kZdQXhBOnwh1jkTHCdfDXcvuheb+sesBGjaNyH+yqz4986GeWp4ZgVm82xmWjA==", + "has-values": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-2.0.1.tgz", + "integrity": "sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w==", "requires": { - "debug": "^3.1.0", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } + "kind-of": "^6.0.2" } }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "peer": true, "requires": { - "uc.micro": "^1.0.1" + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" } }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==", - "dev": true, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "peer": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" } }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", - "dev": true + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "peer": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "requires": { - "chalk": "^2.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "parse-passwd": "^1.0.0" } }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" + "whatwg-encoding": "^2.0.0" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + }, + "dependencies": { + "entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==" + } } }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" }, - "magic-string": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", - "dev": true, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "requires": { - "sourcemap-codec": "^1.4.8" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" } }, - "make-fetch-happen": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.8.tgz", - "integrity": "sha512-0ASJbG12Au6+N5I84W+8FhGS6iM8MyzvZady+zaQAu+6IOaESFzCLLD0AR1sAFF3Jufi8bxm586ABN6hWd3k7g==", + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "requires": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" }, "dependencies": { - "lru-cache": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.10.2.tgz", - "integrity": "sha512-9zDbhgmXAUvUMPV81A705K3tVzcPiZL3Bf5/5JC/FjYJlLZ5AJCeqIRFHJqyBppiLosqF+uKB7p8/RDXylqBIw==" + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, - "make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "dev": true, + "http-server": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", + "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", "requires": { - "kind-of": "^6.0.2" + "basic-auth": "^2.0.1", + "chalk": "^4.1.2", + "corser": "^2.0.1", + "he": "^1.2.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy": "^1.18.1", + "mime": "^1.6.0", + "minimist": "^1.2.6", + "opener": "^1.5.1", + "portfinder": "^1.0.28", + "secure-compare": "3.0.1", + "union": "~0.5.0", + "url-join": "^4.0.1" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "requires": { + "agent-base": "6", + "debug": "4" }, "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", - "dev": true, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "requires": { - "object-visit": "^1.0.0" + "ms": "^2.0.0" } }, - "markdown-it": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.3.2.tgz", - "integrity": "sha512-4J92IhJq1kGoyXddwzzfjr9cEKGexBfFsZooKYMhMLLlWa4+dlSPDUUP7y+xQOCebIj61aLmKlowg//YcdPP1w==", - "dev": true, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "argparse": "^1.0.7", - "entities": "~1.1.1", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.3" + "safer-buffer": ">= 2.1.2 < 3" } }, - "markdown-it-named-headers": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.4.tgz", - "integrity": "sha512-2uuJ9urchbulz9F7q6VVQmeGxSXjxFeeGcb4ebKiz3+nuKOho1rLw8866a6zs1EeAe9xdSOKEpqeF5Dv22ZDxw==", + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "image-extensions": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/image-extensions/-/image-extensions-1.1.0.tgz", + "integrity": "sha512-P0t7ByhK8Jk9TU05ct/7+f7h8dNuXq5OY4m0IO/T+1aga/qHkpC0Wf472x3FLdq/zFDG17pgapCM3JDTxwZzow==" + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { - "string": "^3.0.1" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" } }, - "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" }, - "matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==", - "dev": true, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "requires": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } + "once": "^1.3.0", + "wrappy": "1" } }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "peer": true, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "install-artifact-from-github": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/install-artifact-from-github/-/install-artifact-from-github-1.3.0.tgz", + "integrity": "sha512-iT8v1GwOAX0pPXifF/5ihnMhHOCo3OeK7z3TQa4CtSNCIg8k0UxqBEk9jRwz8OP68hHXvJ2gxRa89KYHtBkqGA==" + }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" } }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + "internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==" }, - "memoize-one": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", - "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", + "dev": true }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "peer": true + "ip": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" }, - "merkle-lib": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/merkle-lib/-/merkle-lib-2.0.10.tgz", - "integrity": "sha512-XrNQvUbn1DL5hKNe46Ccs+Tu3/PYOlrcZILuGUhb95oKBPjc/nmIC8D462PQkipVDGKRvwhn+QFg2cCdIvmDJA==", - "peer": true + "ip-regex": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", + "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==" }, - "merkletreejs": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.1.11.tgz", - "integrity": "sha512-nJN3VIHeIAyB/PjO5Dj/Y0SEK7CGCCLD2IbV4el2kUIwlOtX3GOr5MwVO4EU+0AXvoDnJ0nmaLe5O86uIjWz/Q==", - "peer": true, - "requires": { - "buffer-reverse": "^1.0.1", - "crypto-js": "^3.1.9-1", - "is-buffer": "^2.0.3", - "merkle-lib": "^2.0.10", - "treeify": "^1.1.0" - } + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, - "metascraper": { - "version": "5.29.12", - "resolved": "https://registry.npmjs.org/metascraper/-/metascraper-5.29.12.tgz", - "integrity": "sha512-zbgDC3UyRf+AESJzQrefPvZbmcm4Z03RqlNggpHsR01+DopPUXRhqXjEztjsqdx4y/ITO7Qh4RZ7Um6cYyaZ3Q==", + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, "requires": { - "@metascraper/helpers": "^5.29.11", - "cheerio": "~1.0.0-rc.12", - "lodash": "~4.17.21", - "whoops": "~4.1.1" + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" } }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==" }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - } + "kind-of": "^6.0.0" } }, - "microsoft-capitalize": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/microsoft-capitalize/-/microsoft-capitalize-1.0.5.tgz", - "integrity": "sha512-iqDMU9J643BHg8Zp7EMZNLTp6Pgs2f1S2SMnCW2VlUqMs17xCZ5vwVjalBJEGVcUfG+/1ePqeEGcMW3VfzHK5A==" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, "requires": { - "mime-db": "1.52.0" + "has-bigints": "^1.0.1" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "peer": true - }, - "minimalistic-crypto-utils": { + "is-binary-path": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "peer": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "binary-extensions": "^1.0.0" } }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "minipass": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.3.tgz", - "integrity": "sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA==", + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, "requires": { - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, - "minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" + }, + "is-builtin-module": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", + "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "dev": true, "requires": { - "minipass": "^3.0.0" + "builtin-modules": "^3.0.0" } }, - "minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", + "is-callable": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, "requires": { - "encoding": "^0.1.13", - "minipass": "^3.1.6", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" + "has": "^1.0.3" } }, - "minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { - "minipass": "^3.0.0" + "kind-of": "^6.0.0" } }, - "minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, "requires": { - "minipass": "^3.0.0" + "has-tostringtag": "^1.0.0" } }, - "minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { - "minipass": "^3.0.0" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "is-expression": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-1.0.2.tgz", + "integrity": "sha512-ynWEmX/S8I+WxXHWkHzrMbyjHTDzqreNdVOQBFwI9Pmdok9OOnTK1ytxg7JTNgQPjoAOEGFMW+9d0b9UtZsvIw==", "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } + "acorn": "~2.7.0", + "object-assign": "^4.0.1" } }, - "minsc": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/minsc/-/minsc-0.2.0.tgz", - "integrity": "sha512-cvIke62kbnZQv59LS5d0R921bkcq3FVz2MmN4RsWnQrusozQpxh/wbOOR5JlrRtNFLkceIz470Dj+kflYjzgzQ==", - "peer": true + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "dev": true }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - } - } + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, - "mocha": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.3.tgz", - "integrity": "sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==", - "dev": true, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.4", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" - }, - "dependencies": { - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true - }, - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - } + "is-extglob": "^2.1.1" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "mute-stdout": { + "is-lambda": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", "dev": true }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==", "dev": true }, - "nan": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", - "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "kind-of": "^3.0.2" }, "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "requires": { - "isobject": "^3.0.1" + "is-buffer": "^1.1.5" } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true } } }, - "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" - }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" }, - "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "@types/estree": "*" } }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "requires": { - "whatwg-url": "^5.0.0" - }, - "dependencies": { - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, - "node-gyp": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", - "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } + "is-unc-path": "^1.0.0" } }, - "node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" - }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "is-relative-url": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-relative-url/-/is-relative-url-3.0.0.tgz", + "integrity": "sha512-U1iSYRlY2GIMGuZx7gezlB5dp1Kheaym7zKzO1PV06mOihiWTXejLwm4poEJysPyXF+HtK/BEd0DVlcCh30pEA==", "requires": { - "abbrev": "1" + "is-absolute-url": "^3.0.0" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "call-bind": "^1.0.2" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, - "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==" + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true }, - "now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "dev": true, "requires": { - "once": "^1.3.2" + "unc-path-regex": "^0.1.2" } }, - "npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true }, - "nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "is-uri": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-uri/-/is-uri-1.2.4.tgz", + "integrity": "sha512-8sHi5gEARwpMYwJD9uSAkU9Bb7YkSagcM10EYqSe+osqOErXln4VL+EgLSG40e9lVTpcpygpvb9Z6ohZpECDGA==", "requires": { - "boolbase": "^1.0.0" + "parse-uri": "~1.0.3", + "punycode2": "~1.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true }, - "nwsapi": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz", - "integrity": "sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg==" + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==", + "dev": true }, - "nyc": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", - "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^3.0.1", - "convert-source-map": "^1.6.0", - "find-cache-dir": "^2.0.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "make-dir": "^1.3.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.1.0", - "uuid": "^3.3.2", - "yargs": "^12.0.5", - "yargs-parser": "^11.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "async": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "caching-transform": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "hasha": "^3.0.0", - "make-dir": "^1.3.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.3.0" - } - }, - "camelcase": { - "version": "5.0.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "commander": { - "version": "2.17.1", - "bundled": true, - "dev": true, - "optional": true - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es6-error": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "execa": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "bundled": true, - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "find-cache-dir": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "bundled": true, + "call-bind": "^1.0.2" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "iso-639-3": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/iso-639-3/-/iso-639-3-2.2.0.tgz", + "integrity": "sha512-v9w/U4XDSfXCrXxf4E6ertGC/lTRX8MLLv7XC1j6N5oL3ympe38jp77zgeyMsn3MbufuAAoGeVzDJbOXnPTMhQ==" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true + }, + "isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "requires": {} + }, + "isostring": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isostring/-/isostring-0.0.1.tgz", + "integrity": "sha512-wRcdJtXCe2LGtXnD14fXMkduWVdbeGkzBIKg8WcKeEOi6SIc+hRjYYw76WNx3v5FebhUWZrBTWB0NOl3/sagdQ==" + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, - "handlebars": { - "version": "4.1.0", - "bundled": true, + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } + "aggregate-error": "^3.0.0" } }, - "has-flag": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "hasha": { - "version": "3.0.0", - "bundled": true, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { - "is-stream": "^1.0.1" + "glob": "^7.1.3" } - }, - "hosted-git-info": { - "version": "2.7.1", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "ms": "2.1.2" } }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", + "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jade-error": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jade-error/-/jade-error-1.2.0.tgz", + "integrity": "sha512-CFrPTxhgf4tf2yNJlUyh7uSx/hw0jSJl37FJ630WQ0+HplYdYyc3jrgdkb1B7+m4XFjgc+oay4doQrkzkbbYOw==" + }, + "jade-lexer": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/jade-lexer/-/jade-lexer-0.0.9.tgz", + "integrity": "sha512-Utwt3x/hAObIf2xCfbN6xOgjxQljvYuEplJtLuxMXvjzvpJGndVcCfqme1nYcxy4c7RRBI02+fPB+4hldqUnEg==", + "requires": { + "character-parser": "^2.1.1", + "is-expression": "^1.0.0", + "jade-error": "^1.0.0" + } + }, + "jade-parser": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/jade-parser/-/jade-parser-0.0.9.tgz", + "integrity": "sha512-nTAf2CRJklcirLip+oHSd+Y+QYaJvS/D7oRvX9ENsYz5Bbzz/GqDFZZC3faI8ZloP/GiKZedlSPuePuJD3+Gnw==", + "requires": { + "jade-error": "^1.0.0", + "token-stream": "0.0.1" + } + }, + "javascript-state-machine": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/javascript-state-machine/-/javascript-state-machine-3.1.0.tgz", + "integrity": "sha512-BwhYxQ1OPenBPXC735RgfB+ZUG8H3kjsx8hrYTgWnoy6TPipEy4fiicyhT2lxRKAXq9pG7CfFT8a2HLr6Hmwxg==", + "peer": true + }, + "jayson": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-3.6.6.tgz", + "integrity": "sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ==", + "peer": true, + "requires": { + "@types/connect": "^3.4.33", + "@types/express-serve-static-core": "^4.17.9", + "@types/lodash": "^4.14.159", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "lodash": "^4.17.20", + "uuid": "^8.3.2", + "ws": "^7.4.5" + }, + "dependencies": { + "@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "peer": true }, - "istanbul-lib-coverage": { - "version": "2.0.3", - "bundled": true, - "dev": true + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true }, - "istanbul-lib-hook": { - "version": "2.0.3", - "bundled": true, - "dev": true, + "ws": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", + "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", + "peer": true, + "requires": {} + } + } + }, + "jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, + "js-beautify": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.3.tgz", + "integrity": "sha512-f1ra8PHtOEu/70EBnmiUlV8nJePS58y9qKjl4JHfYWlFH6bo7ogZBz//FAZp7jDuXtYnGYKymZPlrg2I/9Zo4g==", + "requires": { + "config-chain": "^1.1.13", + "editorconfig": "^0.15.3", + "glob": "^7.1.3", + "nopt": "^5.0.0" + } + }, + "js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "peer": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha512-CSOkdn0/GhRFwxnipmhXfqJ+FG6+wkWBi46kKSsPx6+j65176ZiQcrCYpg6K8x3iLbO4k3zScBnZ7I/L80dAtw==", + "requires": { + "xmlcreate": "^1.0.1" + } + }, + "jsdoc": { + "version": "git+ssh://git@github.com/FabricLabs/jsdoc.git#1a9aee2aed164d3dd96abaa4629e2417520d7ade", + "integrity": "sha512-zAT2KHcG6J8dfhvCmUd+QhzkaMEpsIMtPxYymJyyyLfwMKehBxwzFKEr32HaWRpTeFZ8BSPJ4W/3y6K+fXyHxw==", + "from": "jsdoc@FabricLabs/jsdoc#fabric", + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "markdown-it": "~8.3.1", + "markdown-it-named-headers": "~0.0.4", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", + "taffydb": "2.6.2", + "underscore": "~1.8.3" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "requires": { - "append-transform": "^1.0.0" + "minimist": "^1.2.6" } + } + } + }, + "jsdom": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-19.0.0.tgz", + "integrity": "sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A==", + "requires": { + "abab": "^2.0.5", + "acorn": "^8.5.0", + "acorn-globals": "^6.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.1", + "decimal.js": "^10.3.1", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^3.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^10.0.0", + "ws": "^8.2.3", + "xml-name-validator": "^4.0.0" + }, + "dependencies": { + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" }, - "istanbul-lib-report": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } + "acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==" }, - "istanbul-lib-source-maps": { - "version": "3.0.2", - "bundled": true, - "dev": true, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } + "ms": "2.1.2" } }, - "istanbul-reports": { - "version": "2.1.1", - "bundled": true, - "dev": true, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "requires": { - "handlebars": "^4.1.0" + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" } }, - "json-parse-better-errors": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "lcid": { - "version": "2.0.0", - "bundled": true, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-pointer": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.2.tgz", + "integrity": "sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==", + "peer": true, + "requires": { + "foreach": "^2.0.4" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "peer": true + }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "peer": true + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "peer": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "jsx-ast-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.0.tgz", + "integrity": "sha512-XzO9luP6L0xkxwhIJMTJQpZo/eeN60K08jHdexfD569AGxeNug6UketeHXEhROoM8aR7EcUoOQmIhcJQjcuq8Q==", + "dev": true, + "requires": { + "array-includes": "^3.1.4", + "object.assign": "^4.1.2" + } + }, + "just-debounce": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz", + "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha512-Hx5PvgJKTWpMkNJCYrBUNBLlxYIkxN4FVU/BnZP4CFh5BpiHOgujAPx7iFVz/phD0bP8rsqD48gtqcvNlUt0lQ==", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==", + "dev": true, + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { - "invert-kv": "^2.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "load-json-file": { - "version": "4.0.0", - "bundled": true, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "level": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", + "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", + "requires": { + "browser-level": "^1.0.1", + "classic-level": "^1.2.0" + } + }, + "level-supports": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", + "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==" + }, + "level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "requires": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "dependencies": { + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "isobject": "^3.0.1" } - }, - "locate-path": { - "version": "3.0.0", - "bundled": true, - "dev": true, + } + } + }, + "lightning-client": { + "version": "0.5.2-beta.8", + "resolved": "https://registry.npmjs.org/lightning-client/-/lightning-client-0.5.2-beta.8.tgz", + "integrity": "sha512-kSTzu4yYSrxYZv6TGk2ZyVT6kZdQXhBOnwh1jkTHCdfDXcvuheb+sesBGjaNyH+yqz4986GeWp4ZgVm82xmWjA==", + "requires": { + "debug": "^3.1.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "ms": "^2.1.1" } }, - "lodash": { - "version": "4.17.11", - "bundled": true, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + }, + "dependencies": { + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "bundled": true, + } + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "peer": true + }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, + } + } + }, + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "requires": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "dependencies": { "lru-cache": { - "version": "4.1.5", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "mem": { - "version": "4.1.0", - "bundled": true, - "dev": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^2.0.0" + "yallist": "^4.0.0" } }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "markdown-it": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.3.2.tgz", + "integrity": "sha512-4J92IhJq1kGoyXddwzzfjr9cEKGexBfFsZooKYMhMLLlWa4+dlSPDUUP7y+xQOCebIj61aLmKlowg//YcdPP1w==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.3" + } + }, + "markdown-it-named-headers": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-named-headers/-/markdown-it-named-headers-0.0.4.tgz", + "integrity": "sha512-2uuJ9urchbulz9F7q6VVQmeGxSXjxFeeGcb4ebKiz3+nuKOho1rLw8866a6zs1EeAe9xdSOKEpqeF5Dv22ZDxw==", + "requires": { + "string": "^3.0.1" + } + }, + "marked": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==" + }, + "matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==", + "dev": true, + "requires": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==", "dev": true, "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "is-extglob": "^2.1.0" } - }, - "minimist": { - "version": "0.0.10", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, + } + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "peer": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "peer": true + }, + "merkle-lib": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/merkle-lib/-/merkle-lib-2.0.10.tgz", + "integrity": "sha512-XrNQvUbn1DL5hKNe46Ccs+Tu3/PYOlrcZILuGUhb95oKBPjc/nmIC8D462PQkipVDGKRvwhn+QFg2cCdIvmDJA==", + "peer": true + }, + "merkletreejs": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.1.11.tgz", + "integrity": "sha512-nJN3VIHeIAyB/PjO5Dj/Y0SEK7CGCCLD2IbV4el2kUIwlOtX3GOr5MwVO4EU+0AXvoDnJ0nmaLe5O86uIjWz/Q==", + "peer": true, + "requires": { + "buffer-reverse": "^1.0.1", + "crypto-js": "^3.1.9-1", + "is-buffer": "^2.0.3", + "merkle-lib": "^2.0.10", + "treeify": "^1.1.0" + } + }, + "metascraper": { + "version": "5.29.8", + "resolved": "https://registry.npmjs.org/metascraper/-/metascraper-5.29.8.tgz", + "integrity": "sha512-UU0XOj7jT9x9MsBM9VSZUqve0MFJ2B3+OjT1gadmTt4CuBjoqDptC1FrUgLTTB1WtHkiZO9ys5cAm2ZopOAWhA==", + "requires": { + "@metascraper/helpers": "^5.29.7", + "cheerio": "~1.0.0-rc.11", + "lodash": "~4.17.21", + "whoops": "~4.1.0" + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - } + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "bundled": true, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "is-plain-object": "^2.0.4" } }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "path-key": "^2.0.0" + "isobject": "^3.0.1" } - }, - "number-is-nan": { + } + } + }, + "microsoft-capitalize": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/microsoft-capitalize/-/microsoft-capitalize-1.0.5.tgz", + "integrity": "sha512-iqDMU9J643BHg8Zp7EMZNLTp6Pgs2f1S2SMnCW2VlUqMs17xCZ5vwVjalBJEGVcUfG+/1ePqeEGcMW3VfzHK5A==" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "peer": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "peer": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "requires": { + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "requires": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "minsc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/minsc/-/minsc-0.2.0.tgz", + "integrity": "sha512-cvIke62kbnZQv59LS5d0R921bkcq3FVz2MmN4RsWnQrusozQpxh/wbOOR5JlrRtNFLkceIz470Dj+kflYjzgzQ==", + "peer": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { "version": "1.0.1", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "wrappy": "1" + "is-plain-object": "^2.0.4" } }, - "optimist": { - "version": "0.6.1", - "bundled": true, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "isobject": "^3.0.1" } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "mocha": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, - "os-locale": { - "version": "3.1.0", - "bundled": true, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" } }, - "p-defer": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "p-is-promise": { - "version": "2.0.0", - "bundled": true, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, - "p-limit": { - "version": "2.1.0", - "bundled": true, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "p-try": "^2.0.0" + "fill-range": "^7.0.1" } }, - "p-locate": { - "version": "3.0.0", - "bundled": true, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" } }, - "p-try": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "package-hash": { - "version": "3.0.0", - "bundled": true, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "parse-json": { - "version": "4.0.0", - "bundled": true, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "bundled": true, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, - "path-type": { - "version": "3.0.0", - "bundled": true, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "pify": "^3.0.0" + "to-regex-range": "^5.0.1" } }, - "pify": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "bundled": true, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true + "optional": true }, - "pump": { - "version": "3.0.0", - "bundled": true, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, - "read-pkg": { - "version": "3.0.0", - "bundled": true, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "binary-extensions": "^2.0.0" } }, - "read-pkg-up": { - "version": "4.0.0", - "bundled": true, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "argparse": "^2.0.1" } }, - "release-zalgo": { - "version": "1.0.0", - "bundled": true, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { - "es6-error": "^4.0.1" + "brace-expansion": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + } } }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "resolve": { - "version": "1.10.0", - "bundled": true, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { - "path-parse": "^1.0.6" + "picomatch": "^2.2.1" } }, - "resolve-from": { - "version": "4.0.0", - "bundled": true, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, - "rimraf": { - "version": "2.6.3", - "bundled": true, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "glob": "^7.1.3" + "has-flag": "^4.0.0" } }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.6.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "signal-exit": { + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } + } + }, + "module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "dev": true + }, + "nan": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", + "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" + }, + "nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { "version": "3.0.2", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" } }, - "spdx-license-ids": { - "version": "3.0.3", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.1.1", - "bundled": true, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "is-plain-object": "^2.0.4" } }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "isobject": "^3.0.1" } - }, - "strip-bom": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "test-exclude": { - "version": "5.1.0", - "bundled": true, - "dev": true, + } + } + }, + "napi-macros": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "dev": true + }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, + "node-fetch": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.6.tgz", + "integrity": "sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, + "node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { - "arrify": "^1.0.1", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" + "yallist": "^4.0.0" } }, - "uglify-js": { - "version": "3.4.9", - "bundled": true, - "dev": true, - "optional": true, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - } + "glob": "^7.1.3" } }, - "uuid": { - "version": "3.3.2", - "bundled": true, - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "bundled": true, - "dev": true, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "lru-cache": "^6.0.0" } }, "which": { - "version": "1.3.1", - "bundled": true, - "dev": true, + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "node-gyp-build": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "node-releases": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==", + "dev": true + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "requires": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + } + }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "requires": { + "boolbase": "^1.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", + "dev": true + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" + }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "2.4.2", - "bundled": true, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "p-locate": "^4.1.0" } }, - "y18n": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, - "dev": true + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } }, - "yargs": { - "version": "12.0.5", - "bundled": true, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "aggregate-error": "^3.0.0" } }, - "yargs-parser": { - "version": "11.1.1", - "bundled": true, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "glob": "^7.1.3" } } } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -25054,15 +23260,15 @@ } }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, "object.defaults": { @@ -25077,16 +23283,26 @@ "isobject": "^3.0.0" } }, - "object.getownpropertydescriptors": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz", - "integrity": "sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ==", + "object.entries": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", "dev": true, "requires": { - "array.prototype.reduce": "^1.0.4", "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.fromentries": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.5.tgz", + "integrity": "sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" } }, "object.map": { @@ -25118,6 +23334,17 @@ "make-iterator": "^1.0.0" } }, + "object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, "on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -25139,41 +23366,11 @@ "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==" - }, "opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==" }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==" - } - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -25194,6 +23391,29 @@ "dev": true, "requires": { "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "os-locale": { @@ -25205,12 +23425,6 @@ "lcid": "^1.0.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true - }, "p-event": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", @@ -25230,18 +23444,28 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" + }, + "dependencies": { + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + } } }, "p-map": { @@ -25264,8 +23488,19 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } }, "page": { "version": "1.11.6", @@ -25290,6 +23525,15 @@ } } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -25302,12 +23546,13 @@ } }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, "requires": { - "error-ex": "^1.2.0" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "parse-node-version": { @@ -25328,10 +23573,9 @@ "integrity": "sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg==" }, "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" }, "parse5-htmlparser2-tree-adapter": { "version": "7.0.0", @@ -25381,26 +23625,19 @@ "dev": true }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", - "dev": true - }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-match": { @@ -25479,12 +23716,22 @@ "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "dev": true, "requires": { - "pify": "^2.0.0" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true + } } }, "pbkdf2": { @@ -25501,24 +23748,31 @@ } }, "peer": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/peer/-/peer-0.2.10.tgz", - "integrity": "sha512-G0HACAPv6mK0i+4v/pICouo7YG2qJi5Fkikayfv/+IDovTeOW4VpsRJ9YXe+49MfknXJrc6O93GE7qg7knBEeA==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/peer/-/peer-0.6.1.tgz", + "integrity": "sha512-zPJSPoZvo+83sPJNrW8o93QTktx7dKk67965RRDDNAIelWw1ZwE6ZmmhsvRrdNRlK0knQb3rR8GBdZlbWzCYJw==", "requires": { - "body-parser": "^1.18.3", - "cors": "~2.8.4", - "express": "^4.16.3", - "optimist": "~0.6.1", - "ws": "6.0.0" + "@types/cors": "^2.8.6", + "@types/express": "^4.17.3", + "@types/ws": "^7.2.3", + "body-parser": "^1.19.0", + "cors": "^2.8.5", + "express": "^4.17.1", + "uuid": "^3.4.0", + "ws": "^7.2.3", + "yargs": "^15.3.1" }, "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, "ws": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.0.0.tgz", - "integrity": "sha512-c2UlYcAZp1VS8AORtpq6y4RJIkJ9dQz18W32SpR/qXGfLDZ2jU4y4wKvvZwqbi7U6gxFQTeE+urMbXU/tsDy4w==", - "requires": { - "async-limiter": "~1.0.0" - } + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", + "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", + "requires": {} } } }, @@ -25538,10 +23792,10 @@ "resolved": "https://registry.npmjs.org/peerjs-js-binarypack/-/peerjs-js-binarypack-1.0.1.tgz", "integrity": "sha512-N6aeia3NhdpV7kiGxJV5xQiZZCVEEVjRz2T2C6UZQiBkHWHzUv/oWA4myQLcwBwO8LUoR1KWW5oStvwVesmfCg==" }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { @@ -25550,9 +23804,9 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, "pinkie": { @@ -25571,109 +23825,94 @@ } }, "pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", "dev": true, "requires": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" }, "dependencies": { "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" + "locate-path": "^3.0.0" } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "^2.0.0", + "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "p-limit": "^2.0.0" } }, - "pify": { + "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true } } }, - "pkg-config": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", - "integrity": "sha512-ft/WI9YK6FuTuw4Ql+QUaNXtm/ASQNqDUUsZEgFZKyFpW6amyP8Gx01xrRs8KdiNbbqXfYxkOXplpq1euWbOjw==", + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "debug-log": "^1.0.0", - "find-root": "^1.0.0", - "xtend": "^4.0.1" + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } } }, "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==" }, "portfinder": { "version": "1.0.28", @@ -25733,12 +23972,27 @@ "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", "dev": true }, + "process-es6": { + "version": "0.11.6", + "resolved": "https://registry.npmjs.org/process-es6/-/process-es6-0.11.6.tgz", + "integrity": "sha512-GYBRQtL4v3wgigq10Pv58jmTbFXlIiTbSfgnNqZLY0ldUPqy1rRxDI5fCjoCpnM6TqmHQI8ydzTBXW86OYc0gA==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -25784,11 +24038,6 @@ "ipaddr.js": "1.9.1" } }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -25852,7 +24101,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "peer": true, "requires": { "safe-buffer": "^5.1.0" } @@ -25874,13 +24122,13 @@ } }, "re2": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/re2/-/re2-1.17.7.tgz", - "integrity": "sha512-X8GSuiBoVWwcjuppqSjsIkRxNUKDdjhkO9SBekQbZ2ksqWUReCy7DQPWOVpoTnpdtdz5PIpTTxTFzvJv5UMfjA==", + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/re2/-/re2-1.17.4.tgz", + "integrity": "sha512-xyZ4h5PqE8I9tAxTh3G0UttcK5ufrcUxReFjGzfX61vtanNbS1XZHjnwRSyPcLgChI4KLxVgOT/ioZXnUAdoTA==", "requires": { - "install-artifact-from-github": "^1.3.1", - "nan": "^2.16.0", - "node-gyp": "^9.0.0" + "install-artifact-from-github": "^1.3.0", + "nan": "^2.15.0", + "node-gyp": "^8.4.1" } }, "react-is": { @@ -25890,94 +24138,96 @@ "dev": true }, "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dev": true, "requires": { - "load-json-file": "^2.0.0", + "load-json-file": "^1.0.0", "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "path-type": "^1.0.0" }, "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "error-ex": "^1.2.0" } }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true }, - "p-locate": { + "strip-bom": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "is-utf8": "^0.2.0" } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true } } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } } } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -25987,6 +24237,29 @@ "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", "readable-stream": "^2.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "rechoir": { @@ -26083,11 +24356,20 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "remove-bom-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", @@ -26152,111 +24434,42 @@ "remove-trailing-separator": "^1.1.0" } }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - } - } - }, - "request-promise-core": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", - "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", - "dev": true, - "requires": { - "lodash": "^4.17.19" - } - }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "dev": true, - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha512-Xct+41K3twrbBHdxAgMoOS+cNcoqIjfM2/VxBF4LL2hVph7YsF8VSKyQ3BDFZwEVbok9yeDl2le/qo0S77WG2w==", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, "requizzle": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", - "dev": true, "requires": { "lodash": "^4.17.14" } }, "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dev": true, "requires": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.8.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -26272,9 +24485,9 @@ } }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha512-kT10v4dhrlLNcnO084hEjvXCI1wUG9qZLoz2RogxqDQQYy7IxjI/iMUkOtQTNEh6rzHxvdQWHsJyel1pKOVCxg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "resolve-options": { @@ -26292,16 +24505,6 @@ "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -26311,7 +24514,7 @@ "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" }, "reusify": { "version": "1.0.4", @@ -26323,6 +24526,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "peer": true, "requires": { "glob": "^7.1.3" } @@ -26337,11 +24541,15 @@ "inherits": "^2.0.1" } }, + "robust-predicates": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.1.tgz", + "integrity": "sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g==" + }, "rollup": { - "version": "2.75.7", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz", - "integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==", - "dev": true, + "version": "2.75.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.6.tgz", + "integrity": "sha512-OEf0TgpC9vU6WGROJIk1JA3LR5vk/yvqlzxqdrE2CzzXnqKXNzbAwlWUXis8RS3ZPe7LAq+YUxsRa0l3r27MLA==", "requires": { "fsevents": "~2.3.2" }, @@ -26350,29 +24558,90 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true } } }, - "rollup-plugin-dts": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", - "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", + "rollup-plugin-dts": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.2.2.tgz", + "integrity": "sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "magic-string": "^0.26.1" + }, + "dependencies": { + "magic-string": { + "version": "0.26.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", + "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + } + } + }, + "rollup-plugin-node-globals": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz", + "integrity": "sha512-xRkB+W/m1KLIzPUmG0ofvR+CPNcvuCuNdjVBVS7ALKSxr3EDhnzNceGkGi1m8MToSli13AzKFYH4ie9w3I5L3g==", + "dev": true, + "requires": { + "acorn": "^5.7.3", + "buffer-es6": "^4.9.3", + "estree-walker": "^0.5.2", + "magic-string": "^0.22.5", + "process-es6": "^0.11.6", + "rollup-pluginutils": "^2.3.1" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + }, + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "^0.2.2" + } + } + } + }, + "rollup-plugin-polyfill-node": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.10.1.tgz", + "integrity": "sha512-PT9OfHuOya8juO0YJZE0JDyeZGXjY0SOhFGvvldzR6JwwzCVoJFMWK44pEuzdoDoOodEYD9ltwLVJ+3JnrPpRQ==", + "requires": { + "@rollup/plugin-inject": "^4.0.0" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "magic-string": "^0.26.1" + "estree-walker": "^0.6.1" }, "dependencies": { - "magic-string": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", - "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.8" - } + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true } } }, @@ -26384,16 +24653,11 @@ "sdp": "^2.6.0" } }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "peer": true, "requires": { "queue-microtask": "^1.2.2" } @@ -26402,7 +24666,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "peer": true, "requires": { "queue-microtask": "^1.2.2" } @@ -26412,15 +24675,6 @@ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" }, - "rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", - "dev": true, - "requires": { - "symbol-observable": "1.0.1" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -26440,16 +24694,10 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, "saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", "requires": { "xmlchars": "^2.2.0" } @@ -26462,24 +24710,23 @@ "secure-compare": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", - "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==" + "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=" }, "semistandard": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/semistandard/-/semistandard-13.0.1.tgz", - "integrity": "sha512-2GkuX4BsoMEYoufJYRz8/ERbYDfgOO3yP29IBaoXtxl202azlkV1MsFyoSFiM6GBUfL7MSUxSy38KfM9oDAE2g==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/semistandard/-/semistandard-16.0.1.tgz", + "integrity": "sha512-ApAJ9fMAIwYuk5xI2HWSCd8s5o5L95abxU4dYl6ovUX6Rcww/7oxtaSuu9wLFL/Gfj/EXx1h6S4itXy5vyL60Q==", "dev": true, "requires": { - "eslint": "~5.4.0", - "eslint-config-semistandard": "13.0.0", - "eslint-config-standard": "12.0.0", - "eslint-config-standard-jsx": "6.0.2", - "eslint-plugin-import": "~2.14.0", - "eslint-plugin-node": "~7.0.1", - "eslint-plugin-promise": "~4.0.0", - "eslint-plugin-react": "~7.11.1", - "eslint-plugin-standard": "~4.0.0", - "standard-engine": "~10.0.0" + "eslint": "^7.27.0", + "eslint-config-semistandard": "16.0.0", + "eslint-config-standard": "16.0.3", + "eslint-config-standard-jsx": "10.0.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-react": "~7.21.5", + "standard-engine": "^14.0.0" } }, "semver": { @@ -26523,6 +24770,15 @@ } } }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "serve-static": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", @@ -26537,7 +24793,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { "version": "2.0.1", @@ -26578,171 +24834,34 @@ } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "showdown": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/showdown/-/showdown-1.9.1.tgz", - "integrity": "sha512-9cGuS382HcvExtf5AHk7Cb4pAeQQ+h0eTr33V1mu+crYWV4KvWAw6el92bDrqGEk5d46Ai/fhbEUwqJ/mTCNEA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz", + "integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==", "dev": true, "requires": { - "yargs": "^14.2" + "commander": "^9.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", "dev": true - }, - "yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" - } - }, - "yargs-parser": { - "version": "15.0.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.3.tgz", - "integrity": "sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, @@ -26759,7 +24878,7 @@ "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==" + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" }, "signal-exit": { "version": "3.0.7", @@ -26773,20 +24892,14 @@ "peer": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - } + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } }, "smart-buffer": { @@ -26881,6 +24994,12 @@ "kind-of": "^5.0.0" } }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -26947,9 +25066,9 @@ } }, "socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", "requires": { "agent-base": "^6.0.2", "debug": "^4.3.3", @@ -26975,7 +25094,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true + "devOptional": true }, "source-map-resolve": { "version": "0.5.3", @@ -26999,8 +25118,7 @@ "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" }, "sparkles": { "version": "1.0.1", @@ -27008,6 +25126,40 @@ "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", "dev": true }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -27082,30 +25234,12 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, - "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssri": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", - "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", "requires": { "minipass": "^3.1.1" } @@ -27117,15 +25251,15 @@ "dev": true }, "standard-engine": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-10.0.0.tgz", - "integrity": "sha512-91BjmzIRZbFmyOY73R6vaDd/7nw5qDWsfpJW5/N+BCXFgmvreyfrRg7oBSu4ihL0gFGXfnwCImJm6j+sZDQQyw==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-14.0.1.tgz", + "integrity": "sha512-7FEzDwmHDOGva7r9ifOzD3BGdTbA7ujJ50afLVdW/tK14zQEptJjbFuUfn50irqdHDcTbNh0DTIoMPynMCXb0Q==", "dev": true, "requires": { - "deglob": "^3.0.0", - "get-stdin": "^6.0.0", - "minimist": "^1.1.0", - "pkg-conf": "^2.0.0" + "get-stdin": "^8.0.0", + "minimist": "^1.2.5", + "pkg-conf": "^3.1.0", + "xdg-basedir": "^4.0.0" } }, "static-extend": { @@ -27203,6 +25337,12 @@ "is-data-descriptor": "^0.1.4", "kind-of": "^5.0.0" } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -27211,12 +25351,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==", - "dev": true - }, "stoppable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", @@ -27237,8 +25371,7 @@ "string": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", - "integrity": "sha512-LbvprpPZT/39QKfNrlPX9vXtS7If80vqbPQ7clnHQb5oVOM5hz/cs3iQCCZjvQDwsAWl+HpLQX3gRgN6IC8t3g==", - "dev": true + "integrity": "sha512-LbvprpPZT/39QKfNrlPX9vXtS7If80vqbPQ7clnHQb5oVOM5hz/cs3iQCCZjvQDwsAWl+HpLQX3gRgN6IC8t3g==" }, "string_decoder": { "version": "1.1.1", @@ -27265,6 +25398,22 @@ "strip-ansi": "^6.0.1" } }, + "string.prototype.matchall": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz", + "integrity": "sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.1", + "side-channel": "^1.0.4" + } + }, "string.prototype.trimend": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", @@ -27304,8 +25453,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "struct": { "version": "0.0.12", @@ -27327,129 +25475,64 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==", - "dev": true, - "requires": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "dev": true - }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" - }, - "table": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", - "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", - "dev": true, - "requires": { - "ajv": "^6.0.1", - "ajv-keywords": "^3.0.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==", + "dev": true, + "requires": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + }, + "table": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, "requires": { - "color-name": "1.1.3" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "taffydb": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==", - "dev": true + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" }, "tar": { "version": "6.1.11", @@ -27471,6 +25554,17 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -27480,7 +25574,8 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "peer": true }, "through2": { "version": "2.0.5", @@ -27490,6 +25585,29 @@ "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "through2-filter": { @@ -27522,15 +25640,6 @@ "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.231.0.tgz", "integrity": "sha512-L7UQwueHSkGxZHQBXHVmXW64oi+uqNtzFt2x6Ssk7NVnpIbw16CRs4eb/jmKOZ9t2JnqZ/b3Cfvo97lnXqKrhw==" }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "to-absolute-glob": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", @@ -27544,7 +25653,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, "to-object-path": { @@ -27642,25 +25751,24 @@ "token-stream": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", - "integrity": "sha512-nfjOAu/zAWmX9tgwi5NRp7O7zTDUD1miHiB40klUnAh9qnL1iXdgzcz/i5dMaL5jahcBAaSfmNOBBJBLJW8TEg==" + "integrity": "sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=" }, "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" } }, "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "requires": { - "punycode": "^2.1.0" + "punycode": "^2.1.1" } }, "treeify": { @@ -27679,25 +25787,33 @@ "code-block-writer": "^10.1.1" } }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "type": { "version": "1.2.0", @@ -27713,6 +25829,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -27732,6 +25854,7 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, "requires": { "is-typedarray": "^1.0.0" } @@ -27743,16 +25866,15 @@ "peer": true }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", + "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", "dev": true }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" }, "uid-safe": { "version": "2.1.5", @@ -27789,8 +25911,7 @@ "underscore": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha512-5WsVTFcH1ut/kkhAaHf4PVgI8c7++GiVcpCGxPouI6ZVjsqPnSDf8h/8HtVqc0t4fzRXwnMK70EcZeAs3PIddg==", - "dev": true + "integrity": "sha512-5WsVTFcH1ut/kkhAaHf4PVgI8c7++GiVcpCGxPouI6ZVjsqPnSDf8h/8HtVqc0t4fzRXwnMK70EcZeAs3PIddg==" }, "undertaker": { "version": "1.3.0", @@ -27844,12 +25965,6 @@ "set-value": "^2.0.1" } }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", - "dev": true - }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -27884,7 +25999,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, "unset-value": { "version": "1.0.0", @@ -27970,18 +26085,24 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, "v8flags": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", @@ -28019,26 +26140,7 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - } - } + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "video-extensions": { "version": "1.2.0", @@ -28082,6 +26184,29 @@ "value-or-function": "^3.0.0", "vinyl": "^2.0.0", "vinyl-sourcemap": "^1.1.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "vinyl-sourcemap": { @@ -28110,10 +26235,11 @@ } } }, - "viz.js": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/viz.js/-/viz.js-1.8.2.tgz", - "integrity": "sha512-W+1+N/hdzLpQZEcvz79n2IgUE9pfx6JLdHh3Kh8RGvLL8P1LdJVQmi2OsDcLdY4QVID4OUy+FPelyerX0nJxIQ==" + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true }, "w3c-hr-time": { "version": "1.0.2", @@ -28129,20 +26255,17 @@ "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", "requires": { "xml-name-validator": "^4.0.0" - }, - "dependencies": { - "xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==" - } } }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + }, "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" }, "webrtc-adapter": { "version": "7.7.1", @@ -28172,20 +26295,17 @@ } }, "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==" }, "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", + "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" } }, "which": { @@ -28211,10 +26331,9 @@ } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "whoops": { "version": "4.1.1", @@ -28245,48 +26364,6 @@ } } }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "wif": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", @@ -28301,97 +26378,56 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } + "workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha512-CJ17OoULEKXpA5pef3qLj5AxTJ6mSt7g84he2WIskKwqFO4T97d5V7Tadl0DYDk7qyUOQD5WlUlOMChaYrhxeA==", + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { - "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - } + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, "ws": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", - "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", - "requires": { - "async-limiter": "~1.0.0" - } + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", + "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "requires": {} }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true }, + "xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==" + }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -28400,323 +26436,116 @@ "xmlcreate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha512-Mbe56Dvj00onbnSo9J0qj/XlY5bfN9KidsOnpd5tRCsR3ekB3hyyNU9fGrTdqNT5ZNvv4BsA2TcQlignsZyVcw==", - "dev": true + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=" }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true }, "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", - "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", - "dev": true, + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.1" + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "requires": { - "ansi-regex": "^2.0.0" + "p-locate": "^4.1.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "dev": true, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "requires": { - "is-utf8": "^0.2.0" + "p-limit": "^2.2.0" } }, "yargs-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", - "dev": true, + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "requires": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } } } }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + }, "zeromq": { "version": "5.2.8", "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-5.2.8.tgz", @@ -28732,12 +26561,6 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", "peer": true - }, - "node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "peer": true } } } diff --git a/package.json b/package.json index 45eab3b9..b018b22d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "compile": "node examples/build.js && npm run build:scripts", "coverage": "nyc npm run test", "docs": "npm run build:docs && http-server docs", - "report:coverage": "npm run coverage && nyc report --reporter=text-lcov > reports/coverage.lcov && codecov", + "report:coverage": "npm run coverage && nyc report --reporter=text-lcov > reports/coverage.lcov", "review:coverage": "npm run build:coverage && http-server reports/coverage", "start": "npm run compile && node examples/server.js", "static": "npm run build:scripts && http-server assets", @@ -39,47 +39,54 @@ "Eric Martindale" ], "dependencies": { - "body-parser": "^1.18.3", + "body-parser": "^1.20.0", "cross-fetch": "^3.1.5", - "d3": "^5.9.2", - "d3-graphviz": "^2.6.1", - "express": "^4.16.4", + "d3": "^7.4.4", + "d3-graphviz": "^4.1.1", + "express": "^4.18.1", "express-bearer-token": "^2.4.0", - "express-session": "^1.15.6", + "express-session": "^1.17.3", "http-server": "^14.1.1", "isomorphic-ws": "^4.0.1", "jade-lexer": "0.0.9", "jade-parser": "0.0.9", - "jquery": "^3.4.1", - "level": "5", + "jquery": "^3.6.0", + "js-beautify": "^1.14.3", + "jsdoc": "FabricLabs/jsdoc#fabric", + "level": "8", "lightning-client": "^0.5.2-beta.8", "lodash.merge": "^4.6.2", - "metascraper": "^5.29.5", - "page": "^1.11.4", - "path-to-regexp": "^6.1.0", - "peer": "^0.2.10", - "peerjs": "^1.0.0", - "pluralize": "^7.0.0", + "metascraper": "^5.29.8", + "node-fetch": "^3.2.6", + "page": "^1.11.6", + "path-to-regexp": "^6.2.1", + "peer": "^0.6.1", + "peerjs": "^1.4.6", + "pluralize": "^8.0.0", + "rollup-plugin-polyfill-node": "^0.10.1", "stoppable": "^1.1.0", - "ws": "^6.2.1" + "ws": "^8.8.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^21.1.0", + "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.2.1", - "@rollup/plugin-typescript": "^8.3.2", + "@rollup/plugin-node-resolve": "^13.3.0", + "@rollup/plugin-typescript": "^8.3.3", + "cross-fetch": "^3.1.5", "debug-trace": "^2.2.3", + "fast-json-patch": "^3.1.1", "gulp": "^4.0.2", "js-beautify": "^1.10.0", "jsdoc": "FabricLabs/jsdoc#fabric", - "jsdom": "^11.12.0", - "mocha": "^6.0.2", - "nyc": "^13.3.0", - "rollup": "^2.70.2", - "rollup-plugin-dts": "^4.2.1", - "semistandard": "^13.0.1", - "showdown": "^1.9.1", - "typescript": "^4.6.3" + "jsdom": "^19.0.0", + "mocha": "^10.0.0", + "nyc": "^15.1.0", + "rollup": "^2.75.6", + "rollup-plugin-dts": "^4.2.2", + "rollup-plugin-node-globals": "^1.4.0", + "semistandard": "^16.0.1", + "showdown": "^2.1.0", + "typescript": "^4.7.3" }, "peerDependencies": { "@fabric/core": "FabricLabs/fabric#feature/node-16" diff --git a/reports/coverage.lcov b/reports/coverage.lcov new file mode 100644 index 00000000..5dab67fd --- /dev/null +++ b/reports/coverage.lcov @@ -0,0 +1,1002 @@ +TN: +SF:constants.js +FNF:0 +FNH:0 +DA:5,1 +DA:8,1 +DA:9,1 +DA:12,1 +DA:13,1 +DA:16,1 +DA:17,1 +DA:20,1 +DA:21,1 +DA:24,1 +DA:27,1 +LF:11 +LH:11 +BRF:0 +BRH:0 +end_of_record +TN: +SF:types/client.js +FN:10,(anonymous_0) +FN:25,(anonymous_1) +FN:29,(anonymous_2) +FN:33,(anonymous_3) +FN:37,(anonymous_4) +FN:41,(anonymous_5) +FN:45,(anonymous_6) +FNF:7 +FNH:2 +FNDA:1,(anonymous_0) +FNDA:1,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +DA:3,1 +DA:6,1 +DA:7,1 +DA:11,1 +DA:18,1 +DA:26,1 +DA:30,0 +DA:34,0 +DA:38,0 +DA:42,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:49,0 +DA:54,0 +DA:58,1 +LF:16 +LH:7 +BRDA:10,0,0,0 +BRF:1 +BRH:0 +end_of_record +TN: +SF:types/remote.js +FN:38,(anonymous_0) +FN:71,(anonymous_1) +FN:75,(anonymous_2) +FN:117,(anonymous_3) +FN:121,(anonymous_4) +FN:125,(anonymous_5) +FN:129,(anonymous_6) +FN:138,(anonymous_7) +FN:146,(anonymous_8) +FN:151,(anonymous_9) +FN:164,(anonymous_10) +FN:172,(anonymous_11) +FN:179,(anonymous_12) +FN:204,(anonymous_13) +FN:233,(anonymous_14) +FN:326,(anonymous_15) +FN:333,(anonymous_16) +FN:341,(anonymous_17) +FN:353,(anonymous_18) +FN:363,(anonymous_19) +FN:373,(anonymous_20) +FN:403,(anonymous_21) +FN:413,(anonymous_22) +FN:423,(anonymous_23) +FN:427,(anonymous_24) +FNF:25 +FNH:5 +FNDA:1,(anonymous_0) +FNDA:1,(anonymous_1) +FNDA:1,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:1,(anonymous_14) +FNDA:0,(anonymous_15) +FNDA:0,(anonymous_16) +FNDA:0,(anonymous_17) +FNDA:0,(anonymous_18) +FNDA:1,(anonymous_19) +FNDA:0,(anonymous_20) +FNDA:0,(anonymous_21) +FNDA:0,(anonymous_22) +FNDA:0,(anonymous_23) +FNDA:0,(anonymous_24) +DA:5,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:13,1 +DA:14,1 +DA:15,1 +DA:18,1 +DA:19,1 +DA:20,1 +DA:39,1 +DA:41,1 +DA:50,1 +DA:51,1 +DA:52,1 +DA:54,1 +DA:56,1 +DA:57,1 +DA:58,1 +DA:68,1 +DA:72,1 +DA:77,1 +DA:78,1 +DA:86,1 +DA:89,0 +DA:90,0 +DA:91,0 +DA:92,0 +DA:94,1 +DA:95,1 +DA:96,1 +DA:97,1 +DA:99,0 +DA:100,0 +DA:101,0 +DA:102,0 +DA:104,0 +DA:105,0 +DA:107,0 +DA:108,0 +DA:112,1 +DA:114,1 +DA:118,0 +DA:122,0 +DA:126,0 +DA:130,0 +DA:131,0 +DA:132,0 +DA:133,0 +DA:135,0 +DA:139,0 +DA:140,0 +DA:141,0 +DA:142,0 +DA:143,0 +DA:147,0 +DA:148,0 +DA:152,0 +DA:153,0 +DA:154,0 +DA:155,0 +DA:156,0 +DA:157,0 +DA:158,0 +DA:159,0 +DA:160,0 +DA:161,0 +DA:165,0 +DA:166,0 +DA:167,0 +DA:168,0 +DA:169,0 +DA:173,0 +DA:174,0 +DA:175,0 +DA:176,0 +DA:180,0 +DA:182,0 +DA:183,0 +DA:184,0 +DA:186,0 +DA:189,0 +DA:190,0 +DA:191,0 +DA:192,0 +DA:193,0 +DA:194,0 +DA:197,0 +DA:205,0 +DA:206,0 +DA:208,0 +DA:209,0 +DA:210,0 +DA:223,0 +DA:234,1 +DA:236,1 +DA:237,1 +DA:238,1 +DA:239,1 +DA:244,1 +DA:250,1 +DA:251,0 +DA:257,1 +DA:259,0 +DA:260,0 +DA:262,1 +DA:263,1 +DA:265,0 +DA:268,1 +DA:271,1 +DA:275,1 +DA:276,1 +DA:278,0 +DA:281,1 +DA:282,0 +DA:288,1 +DA:290,0 +DA:294,0 +DA:296,1 +DA:297,1 +DA:298,1 +DA:300,0 +DA:301,0 +DA:303,0 +DA:305,0 +DA:307,1 +DA:308,1 +DA:309,1 +DA:312,0 +DA:314,0 +DA:315,0 +DA:317,0 +DA:320,1 +DA:323,1 +DA:327,0 +DA:334,0 +DA:335,0 +DA:336,0 +DA:337,0 +DA:338,0 +DA:342,0 +DA:354,0 +DA:364,1 +DA:374,0 +DA:375,0 +DA:377,0 +DA:379,0 +DA:383,0 +DA:385,0 +DA:389,0 +DA:392,0 +DA:394,0 +DA:404,0 +DA:414,0 +DA:424,0 +DA:428,0 +DA:432,1 +LF:157 +LH:56 +BRDA:38,0,0,0 +BRDA:50,1,0,1 +BRDA:50,1,1,0 +BRDA:54,2,0,0 +BRDA:54,2,1,1 +BRDA:86,3,0,0 +BRDA:86,3,1,1 +BRDA:86,3,2,0 +BRDA:86,3,3,0 +BRDA:112,4,0,1 +BRDA:112,4,1,0 +BRDA:122,5,0,0 +BRDA:122,5,1,0 +BRDA:167,6,0,0 +BRDA:167,6,1,0 +BRDA:172,7,0,0 +BRDA:189,8,0,0 +BRDA:189,8,1,0 +BRDA:233,9,0,1 +BRDA:250,10,0,0 +BRDA:250,10,1,1 +BRDA:250,11,0,1 +BRDA:250,11,1,1 +BRDA:252,12,0,0 +BRDA:252,12,1,0 +BRDA:253,13,0,0 +BRDA:253,13,1,0 +BRDA:257,14,0,0 +BRDA:257,14,1,1 +BRDA:269,15,0,1 +BRDA:269,15,1,1 +BRDA:281,16,0,0 +BRDA:281,16,1,1 +BRDA:288,17,0,0 +BRDA:288,17,1,1 +BRDA:296,18,0,1 +BRDA:296,18,1,0 +BRDA:298,19,0,0 +BRDA:298,19,1,1 +BRDA:307,20,0,0 +BRDA:307,20,1,1 +BRDA:312,21,0,0 +BRDA:312,21,1,0 +BRDA:373,22,0,0 +BRDA:377,23,0,0 +BRDA:377,23,1,0 +BRF:46 +BRH:16 +end_of_record +TN: +SF:types/router.js +FN:19,(anonymous_0) +FN:37,(anonymous_1) +FN:52,(anonymous_2) +FN:63,(anonymous_3) +FN:72,(anonymous_4) +FN:92,(anonymous_5) +FN:96,(anonymous_6) +FN:101,(anonymous_7) +FN:105,(anonymous_8) +FN:123,(anonymous_9) +FNF:10 +FNH:3 +FNDA:1,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:1,(anonymous_8) +FNDA:1,(anonymous_9) +DA:3,1 +DA:4,1 +DA:6,1 +DA:7,1 +DA:20,1 +DA:22,1 +DA:27,1 +DA:28,1 +DA:29,1 +DA:30,1 +DA:31,1 +DA:32,1 +DA:34,1 +DA:38,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:44,0 +DA:45,0 +DA:49,0 +DA:53,0 +DA:54,0 +DA:55,0 +DA:56,0 +DA:57,0 +DA:64,0 +DA:69,0 +DA:73,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:77,0 +DA:83,0 +DA:93,0 +DA:97,0 +DA:98,0 +DA:102,0 +DA:106,1 +DA:107,1 +DA:109,1 +DA:110,0 +DA:118,1 +DA:119,1 +DA:120,1 +DA:124,1 +DA:125,1 +DA:126,1 +DA:127,1 +DA:131,1 +LF:49 +LH:24 +BRDA:19,0,0,1 +BRDA:40,1,0,0 +BRDA:40,1,1,0 +BRDA:41,2,0,0 +BRDA:41,2,1,0 +BRDA:44,3,0,0 +BRDA:44,3,1,0 +BRDA:76,4,0,0 +BRDA:76,4,1,0 +BRDA:106,5,0,0 +BRDA:106,5,1,1 +BRDA:119,6,0,0 +BRDA:119,6,1,1 +BRDA:124,7,0,0 +BRDA:124,7,1,1 +BRF:15 +BRH:4 +end_of_record +TN: +SF:types/server.js +FN:62,(anonymous_0) +FN:124,(anonymous_1) +FN:128,(anonymous_2) +FN:132,(anonymous_3) +FN:136,(anonymous_4) +FN:175,(anonymous_5) +FN:196,(anonymous_6) +FN:200,(anonymous_7) +FN:204,(anonymous_8) +FN:230,(anonymous_9) +FN:260,(anonymous_10) +FN:271,(anonymous_11) +FN:274,(anonymous_12) +FN:279,(anonymous_13) +FN:283,(anonymous_14) +FN:287,(anonymous_15) +FN:300,(anonymous_16) +FN:313,(anonymous_17) +FN:315,(anonymous_18) +FN:333,(anonymous_19) +FN:339,handler +FN:446,(anonymous_21) +FN:481,(anonymous_22) +FN:488,(anonymous_23) +FN:489,(anonymous_24) +FN:509,(anonymous_25) +FN:523,(anonymous_26) +FN:531,(anonymous_27) +FN:545,(anonymous_28) +FN:552,(anonymous_29) +FN:555,(anonymous_30) +FN:567,(anonymous_31) +FN:572,(anonymous_32) +FN:576,(anonymous_33) +FN:587,(anonymous_34) +FN:675,(anonymous_35) +FN:679,(anonymous_36) +FN:691,(anonymous_37) +FN:777,(anonymous_38) +FN:781,(anonymous_39) +FN:801,notifyReady +FN:819,(anonymous_41) +FN:832,(anonymous_42) +FN:858,(anonymous_43) +FN:867,(anonymous_44) +FN:873,(anonymous_45) +FN:878,(anonymous_46) +FN:884,(anonymous_47) +FNF:48 +FNH:7 +FNDA:4,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:6,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:0,(anonymous_14) +FNDA:0,(anonymous_15) +FNDA:0,(anonymous_16) +FNDA:0,(anonymous_17) +FNDA:0,(anonymous_18) +FNDA:0,(anonymous_19) +FNDA:0,handler +FNDA:0,(anonymous_21) +FNDA:0,(anonymous_22) +FNDA:0,(anonymous_23) +FNDA:0,(anonymous_24) +FNDA:0,(anonymous_25) +FNDA:0,(anonymous_26) +FNDA:1,(anonymous_27) +FNDA:1,(anonymous_28) +FNDA:0,(anonymous_29) +FNDA:0,(anonymous_30) +FNDA:0,(anonymous_31) +FNDA:0,(anonymous_32) +FNDA:0,(anonymous_33) +FNDA:0,(anonymous_34) +FNDA:0,(anonymous_35) +FNDA:0,(anonymous_36) +FNDA:2,(anonymous_37) +FNDA:0,(anonymous_38) +FNDA:0,(anonymous_39) +FNDA:2,notifyReady +FNDA:0,(anonymous_41) +FNDA:2,(anonymous_42) +FNDA:0,(anonymous_43) +FNDA:0,(anonymous_44) +FNDA:0,(anonymous_45) +FNDA:0,(anonymous_46) +FNDA:0,(anonymous_47) +DA:9,1 +DA:12,1 +DA:13,1 +DA:14,1 +DA:17,1 +DA:18,1 +DA:20,1 +DA:21,1 +DA:22,1 +DA:23,1 +DA:24,1 +DA:27,1 +DA:30,1 +DA:32,1 +DA:34,1 +DA:35,1 +DA:36,1 +DA:37,1 +DA:47,1 +DA:48,1 +DA:63,4 +DA:66,4 +DA:86,4 +DA:87,4 +DA:88,4 +DA:89,4 +DA:101,4 +DA:102,4 +DA:104,4 +DA:105,4 +DA:111,4 +DA:112,4 +DA:113,4 +DA:117,4 +DA:118,4 +DA:119,4 +DA:121,4 +DA:125,0 +DA:129,6 +DA:133,0 +DA:137,0 +DA:139,0 +DA:143,0 +DA:145,0 +DA:146,0 +DA:149,0 +DA:150,0 +DA:158,0 +DA:159,0 +DA:160,0 +DA:163,0 +DA:166,0 +DA:176,0 +DA:177,0 +DA:178,0 +DA:180,0 +DA:185,0 +DA:186,0 +DA:188,0 +DA:189,0 +DA:191,0 +DA:192,0 +DA:193,0 +DA:194,0 +DA:196,0 +DA:197,0 +DA:200,0 +DA:201,0 +DA:204,0 +DA:205,0 +DA:206,0 +DA:208,0 +DA:213,0 +DA:214,0 +DA:215,0 +DA:217,0 +DA:218,0 +DA:220,0 +DA:221,0 +DA:224,0 +DA:230,0 +DA:231,0 +DA:237,0 +DA:243,0 +DA:250,0 +DA:253,0 +DA:254,0 +DA:257,0 +DA:261,0 +DA:262,0 +DA:263,0 +DA:264,0 +DA:266,0 +DA:272,0 +DA:274,0 +DA:275,0 +DA:280,0 +DA:284,0 +DA:288,0 +DA:289,0 +DA:290,0 +DA:291,0 +DA:301,0 +DA:302,0 +DA:306,0 +DA:307,0 +DA:308,0 +DA:313,0 +DA:314,0 +DA:315,0 +DA:316,0 +DA:317,0 +DA:319,0 +DA:321,0 +DA:322,0 +DA:324,0 +DA:329,0 +DA:330,0 +DA:333,0 +DA:334,0 +DA:335,0 +DA:339,0 +DA:340,0 +DA:342,0 +DA:343,0 +DA:345,0 +DA:346,0 +DA:352,0 +DA:353,0 +DA:354,0 +DA:356,0 +DA:359,0 +DA:361,0 +DA:362,0 +DA:363,0 +DA:366,0 +DA:367,0 +DA:369,0 +DA:371,0 +DA:375,0 +DA:376,0 +DA:378,0 +DA:380,0 +DA:382,0 +DA:383,0 +DA:385,0 +DA:386,0 +DA:387,0 +DA:389,0 +DA:390,0 +DA:391,0 +DA:393,0 +DA:394,0 +DA:395,0 +DA:397,0 +DA:398,0 +DA:399,0 +DA:400,0 +DA:402,0 +DA:407,0 +DA:409,0 +DA:410,0 +DA:413,0 +DA:414,0 +DA:420,0 +DA:422,0 +DA:423,0 +DA:424,0 +DA:426,0 +DA:430,0 +DA:437,0 +DA:446,0 +DA:447,0 +DA:451,0 +DA:454,0 +DA:455,0 +DA:456,0 +DA:464,0 +DA:465,0 +DA:471,0 +DA:478,0 +DA:482,0 +DA:483,0 +DA:484,0 +DA:485,0 +DA:489,0 +DA:490,0 +DA:493,0 +DA:495,0 +DA:496,0 +DA:497,0 +DA:499,0 +DA:510,0 +DA:511,0 +DA:513,0 +DA:514,0 +DA:516,0 +DA:518,0 +DA:519,0 +DA:520,0 +DA:524,0 +DA:534,1 +DA:542,1 +DA:546,1 +DA:547,1 +DA:548,1 +DA:549,1 +DA:553,0 +DA:554,0 +DA:555,0 +DA:557,0 +DA:568,0 +DA:569,0 +DA:573,0 +DA:577,0 +DA:578,0 +DA:579,0 +DA:581,0 +DA:584,0 +DA:588,0 +DA:589,0 +DA:592,0 +DA:593,0 +DA:594,0 +DA:596,0 +DA:597,0 +DA:598,0 +DA:599,0 +DA:600,0 +DA:601,0 +DA:605,0 +DA:608,0 +DA:610,0 +DA:611,0 +DA:612,0 +DA:614,0 +DA:615,0 +DA:616,0 +DA:618,0 +DA:627,0 +DA:629,0 +DA:631,0 +DA:632,0 +DA:634,0 +DA:635,0 +DA:638,0 +DA:644,0 +DA:647,0 +DA:649,0 +DA:650,0 +DA:651,0 +DA:653,0 +DA:654,0 +DA:656,0 +DA:663,0 +DA:664,0 +DA:674,0 +DA:676,0 +DA:677,0 +DA:685,0 +DA:686,0 +DA:692,2 +DA:693,2 +DA:694,2 +DA:696,2 +DA:697,0 +DA:700,2 +DA:701,2 +DA:702,2 +DA:703,2 +DA:707,2 +DA:708,2 +DA:712,2 +DA:713,2 +DA:714,2 +DA:718,2 +DA:721,2 +DA:722,2 +DA:725,2 +DA:728,2 +DA:732,2 +DA:733,0 +DA:734,0 +DA:740,0 +DA:741,0 +DA:746,2 +DA:747,2 +DA:748,2 +DA:749,2 +DA:750,2 +DA:751,2 +DA:754,2 +DA:757,2 +DA:764,2 +DA:767,2 +DA:768,0 +DA:769,0 +DA:770,0 +DA:774,2 +DA:777,2 +DA:778,0 +DA:781,2 +DA:782,0 +DA:785,2 +DA:786,0 +DA:787,0 +DA:789,0 +DA:793,2 +DA:794,2 +DA:795,2 +DA:797,0 +DA:798,0 +DA:802,2 +DA:803,2 +DA:814,2 +DA:816,2 +DA:822,0 +DA:824,0 +DA:825,0 +DA:827,0 +DA:833,2 +DA:834,2 +DA:835,2 +DA:837,2 +DA:838,2 +DA:840,0 +DA:843,2 +DA:844,0 +DA:845,0 +DA:847,0 +DA:851,2 +DA:852,2 +DA:854,2 +DA:855,2 +DA:859,0 +DA:860,0 +DA:861,0 +DA:862,0 +DA:863,0 +DA:864,0 +DA:868,0 +DA:869,0 +DA:870,0 +DA:874,0 +DA:875,0 +DA:879,0 +DA:880,0 +DA:881,0 +DA:885,0 +DA:886,0 +DA:890,1 +LF:351 +LH:95 +BRDA:62,0,0,0 +BRDA:145,1,0,0 +BRDA:145,1,1,0 +BRDA:149,2,0,0 +BRDA:149,2,1,0 +BRDA:149,3,0,0 +BRDA:149,3,1,0 +BRDA:176,4,0,0 +BRDA:176,4,1,0 +BRDA:188,5,0,0 +BRDA:188,5,1,0 +BRDA:189,6,0,0 +BRDA:189,6,1,0 +BRDA:206,7,0,0 +BRDA:206,7,1,0 +BRDA:206,7,2,0 +BRDA:288,8,0,0 +BRDA:288,8,1,0 +BRDA:289,9,0,0 +BRDA:289,9,1,0 +BRDA:290,10,0,0 +BRDA:290,10,1,0 +BRDA:345,11,0,0 +BRDA:345,11,1,0 +BRDA:345,12,0,0 +BRDA:345,12,1,0 +BRDA:359,13,0,0 +BRDA:359,13,1,0 +BRDA:362,14,0,0 +BRDA:362,14,1,0 +BRDA:367,15,0,0 +BRDA:367,15,1,0 +BRDA:380,16,0,0 +BRDA:380,16,1,0 +BRDA:380,16,2,0 +BRDA:380,16,3,0 +BRDA:380,16,4,0 +BRDA:380,16,5,0 +BRDA:380,16,6,0 +BRDA:380,16,7,0 +BRDA:413,17,0,0 +BRDA:413,17,1,0 +BRDA:414,18,0,0 +BRDA:414,18,1,0 +BRDA:464,19,0,0 +BRDA:464,19,1,0 +BRDA:484,20,0,0 +BRDA:484,20,1,0 +BRDA:513,21,0,0 +BRDA:513,21,1,0 +BRDA:554,22,0,0 +BRDA:554,22,1,0 +BRDA:588,23,0,0 +BRDA:588,23,1,0 +BRDA:598,24,0,0 +BRDA:598,24,1,0 +BRDA:605,25,0,0 +BRDA:605,25,1,0 +BRDA:605,25,2,0 +BRDA:605,25,3,0 +BRDA:605,25,4,0 +BRDA:605,25,5,0 +BRDA:605,25,6,0 +BRDA:605,25,7,0 +BRDA:611,26,0,0 +BRDA:611,26,1,0 +BRDA:614,27,0,0 +BRDA:614,27,1,0 +BRDA:634,28,0,0 +BRDA:634,28,1,0 +BRDA:638,29,0,0 +BRDA:638,29,1,0 +BRDA:663,30,0,0 +BRDA:663,30,1,0 +BRDA:692,31,0,0 +BRDA:692,31,1,2 +BRDA:696,32,0,0 +BRDA:696,32,1,2 +BRDA:696,33,0,2 +BRDA:696,33,1,2 +BRDA:703,34,0,0 +BRDA:703,34,1,2 +BRDA:718,35,0,0 +BRDA:718,35,1,2 +BRDA:734,36,0,0 +BRDA:734,36,1,0 +BRDA:734,36,2,0 +BRDA:734,36,3,0 +BRDA:734,36,4,0 +BRDA:767,37,0,0 +BRDA:767,37,1,2 +BRDA:785,38,0,0 +BRDA:785,38,1,2 +BRDA:793,39,0,2 +BRDA:793,39,1,0 +BRDA:814,40,0,0 +BRDA:814,40,1,2 +BRDA:833,41,0,0 +BRDA:833,41,1,2 +BRDA:843,42,0,0 +BRDA:843,42,1,2 +BRDA:854,43,0,0 +BRDA:854,43,1,2 +BRDA:859,44,0,0 +BRDA:859,44,1,0 +BRDA:859,45,0,0 +BRDA:859,45,1,0 +BRDA:860,46,0,0 +BRDA:860,46,1,0 +BRDA:862,47,0,0 +BRDA:862,47,1,0 +BRDA:863,48,0,0 +BRDA:863,48,1,0 +BRDA:863,49,0,0 +BRDA:863,49,1,0 +BRDA:868,50,0,0 +BRDA:868,50,1,0 +BRDA:868,51,0,0 +BRDA:868,51,1,0 +BRDA:869,52,0,0 +BRDA:869,52,1,0 +BRDA:874,53,0,0 +BRDA:874,53,1,0 +BRDA:879,54,0,0 +BRDA:879,54,1,0 +BRDA:879,55,0,0 +BRDA:879,55,1,0 +BRDA:880,56,0,0 +BRDA:880,56,1,0 +BRDA:885,57,0,0 +BRDA:885,57,1,0 +BRF:131 +BRH:13 +end_of_record diff --git a/reports/nyc/8823c08b-f48c-4c6a-825f-f29cedd362f9.json b/reports/nyc/8823c08b-f48c-4c6a-825f-f29cedd362f9.json new file mode 100644 index 00000000..fa8bf0cf --- /dev/null +++ b/reports/nyc/8823c08b-f48c-4c6a-825f-f29cedd362f9.json @@ -0,0 +1 @@ +{"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/client.js":{"path":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/client.js","statementMap":{"0":{"start":{"line":3,"column":15},"end":{"line":3,"column":34}},"1":{"start":{"line":6,"column":15},"end":{"line":6,"column":37}},"2":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}},"3":{"start":{"line":11,"column":4},"end":{"line":15,"column":17}},"4":{"start":{"line":18,"column":4},"end":{"line":22,"column":7}},"5":{"start":{"line":26,"column":4},"end":{"line":26,"column":34}},"6":{"start":{"line":30,"column":4},"end":{"line":30,"column":40}},"7":{"start":{"line":34,"column":4},"end":{"line":34,"column":41}},"8":{"start":{"line":38,"column":4},"end":{"line":38,"column":42}},"9":{"start":{"line":42,"column":4},"end":{"line":42,"column":37}},"10":{"start":{"line":46,"column":14},"end":{"line":46,"column":30}},"11":{"start":{"line":47,"column":17},"end":{"line":47,"column":51}},"12":{"start":{"line":48,"column":18},"end":{"line":48,"column":49}},"13":{"start":{"line":49,"column":19},"end":{"line":52,"column":6}},"14":{"start":{"line":54,"column":4},"end":{"line":54,"column":33}},"15":{"start":{"line":58,"column":0},"end":{"line":58,"column":28}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":10,"column":2},"end":{"line":10,"column":3}},"loc":{"start":{"line":10,"column":30},"end":{"line":23,"column":3}},"line":10},"1":{"name":"(anonymous_1)","decl":{"start":{"line":25,"column":2},"end":{"line":25,"column":3}},"loc":{"start":{"line":25,"column":20},"end":{"line":27,"column":3}},"line":25},"2":{"name":"(anonymous_2)","decl":{"start":{"line":29,"column":2},"end":{"line":29,"column":3}},"loc":{"start":{"line":29,"column":26},"end":{"line":31,"column":3}},"line":29},"3":{"name":"(anonymous_3)","decl":{"start":{"line":33,"column":2},"end":{"line":33,"column":3}},"loc":{"start":{"line":33,"column":27},"end":{"line":35,"column":3}},"line":33},"4":{"name":"(anonymous_4)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":3}},"loc":{"start":{"line":37,"column":28},"end":{"line":39,"column":3}},"line":37},"5":{"name":"(anonymous_5)","decl":{"start":{"line":41,"column":2},"end":{"line":41,"column":3}},"loc":{"start":{"line":41,"column":23},"end":{"line":43,"column":3}},"line":41},"6":{"name":"(anonymous_6)","decl":{"start":{"line":45,"column":2},"end":{"line":45,"column":3}},"loc":{"start":{"line":45,"column":24},"end":{"line":55,"column":3}},"line":45}},"branchMap":{"0":{"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":28}},"type":"default-arg","locations":[{"start":{"line":10,"column":26},"end":{"line":10,"column":28}}],"line":10}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":1},"f":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0},"b":{"0":[0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c55aae0dd4e6039655767d519fd5c1b769a41f1d","contentHash":"e46297b89711bdc521f74f7ac933a5ee616eb564610718cc7242110fd1d3d824"},"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/remote.js":{"path":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/remote.js","statementMap":{"0":{"start":{"line":5,"column":4},"end":{"line":5,"column":37}},"1":{"start":{"line":8,"column":13},"end":{"line":8,"column":28}},"2":{"start":{"line":9,"column":14},"end":{"line":9,"column":30}},"3":{"start":{"line":10,"column":20},"end":{"line":10,"column":42}},"4":{"start":{"line":13,"column":14},"end":{"line":13,"column":36}},"5":{"start":{"line":14,"column":15},"end":{"line":14,"column":38}},"6":{"start":{"line":15,"column":11},"end":{"line":15,"column":34}},"7":{"start":{"line":18,"column":14},"end":{"line":18,"column":49}},"8":{"start":{"line":19,"column":16},"end":{"line":19,"column":53}},"9":{"start":{"line":20,"column":21},"end":{"line":20,"column":39}},"10":{"start":{"line":39,"column":4},"end":{"line":39,"column":18}},"11":{"start":{"line":41,"column":4},"end":{"line":48,"column":15}},"12":{"start":{"line":50,"column":4},"end":{"line":50,"column":62}},"13":{"start":{"line":51,"column":4},"end":{"line":51,"column":39}},"14":{"start":{"line":52,"column":4},"end":{"line":52,"column":23}},"15":{"start":{"line":54,"column":4},"end":{"line":54,"column":81}},"16":{"start":{"line":56,"column":4},"end":{"line":56,"column":28}},"17":{"start":{"line":57,"column":4},"end":{"line":57,"column":32}},"18":{"start":{"line":58,"column":4},"end":{"line":66,"column":6}},"19":{"start":{"line":68,"column":4},"end":{"line":68,"column":16}},"20":{"start":{"line":72,"column":4},"end":{"line":72,"column":30}},"21":{"start":{"line":77,"column":18},"end":{"line":77,"column":52}},"22":{"start":{"line":78,"column":18},"end":{"line":83,"column":5}},"23":{"start":{"line":86,"column":4},"end":{"line":109,"column":5}},"24":{"start":{"line":89,"column":8},"end":{"line":89,"column":40}},"25":{"start":{"line":90,"column":8},"end":{"line":90,"column":40}},"26":{"start":{"line":91,"column":8},"end":{"line":91,"column":44}},"27":{"start":{"line":92,"column":8},"end":{"line":92,"column":14}},"28":{"start":{"line":94,"column":8},"end":{"line":94,"column":30}},"29":{"start":{"line":95,"column":8},"end":{"line":95,"column":40}},"30":{"start":{"line":96,"column":8},"end":{"line":96,"column":44}},"31":{"start":{"line":97,"column":8},"end":{"line":97,"column":14}},"32":{"start":{"line":99,"column":8},"end":{"line":99,"column":30}},"33":{"start":{"line":100,"column":8},"end":{"line":100,"column":30}},"34":{"start":{"line":101,"column":8},"end":{"line":101,"column":44}},"35":{"start":{"line":102,"column":8},"end":{"line":102,"column":14}},"36":{"start":{"line":104,"column":8},"end":{"line":104,"column":30}},"37":{"start":{"line":105,"column":8},"end":{"line":105,"column":30}},"38":{"start":{"line":107,"column":8},"end":{"line":107,"column":52}},"39":{"start":{"line":108,"column":8},"end":{"line":108,"column":14}},"40":{"start":{"line":112,"column":4},"end":{"line":112,"column":56}},"41":{"start":{"line":114,"column":4},"end":{"line":114,"column":61}},"42":{"start":{"line":118,"column":4},"end":{"line":118,"column":61}},"43":{"start":{"line":122,"column":4},"end":{"line":122,"column":108}},"44":{"start":{"line":126,"column":4},"end":{"line":126,"column":26}},"45":{"start":{"line":130,"column":17},"end":{"line":130,"column":42}},"46":{"start":{"line":131,"column":15},"end":{"line":131,"column":33}},"47":{"start":{"line":132,"column":4},"end":{"line":134,"column":5}},"48":{"start":{"line":132,"column":17},"end":{"line":132,"column":18}},"49":{"start":{"line":133,"column":8},"end":{"line":133,"column":28}},"50":{"start":{"line":135,"column":4},"end":{"line":135,"column":18}},"51":{"start":{"line":139,"column":4},"end":{"line":139,"column":34}},"52":{"start":{"line":140,"column":4},"end":{"line":140,"column":61}},"53":{"start":{"line":141,"column":4},"end":{"line":141,"column":30}},"54":{"start":{"line":142,"column":4},"end":{"line":142,"column":81}},"55":{"start":{"line":143,"column":4},"end":{"line":143,"column":106}},"56":{"start":{"line":147,"column":4},"end":{"line":147,"column":63}},"57":{"start":{"line":148,"column":4},"end":{"line":148,"column":32}},"58":{"start":{"line":152,"column":4},"end":{"line":152,"column":82}},"59":{"start":{"line":153,"column":19},"end":{"line":153,"column":41}},"60":{"start":{"line":154,"column":4},"end":{"line":154,"column":35}},"61":{"start":{"line":155,"column":19},"end":{"line":155,"column":43}},"62":{"start":{"line":156,"column":4},"end":{"line":156,"column":35}},"63":{"start":{"line":157,"column":20},"end":{"line":157,"column":54}},"64":{"start":{"line":158,"column":4},"end":{"line":158,"column":37}},"65":{"start":{"line":159,"column":4},"end":{"line":159,"column":39}},"66":{"start":{"line":160,"column":4},"end":{"line":160,"column":38}},"67":{"start":{"line":161,"column":4},"end":{"line":161,"column":34}},"68":{"start":{"line":165,"column":4},"end":{"line":165,"column":28}},"69":{"start":{"line":166,"column":4},"end":{"line":166,"column":32}},"70":{"start":{"line":167,"column":4},"end":{"line":167,"column":59}},"71":{"start":{"line":167,"column":27},"end":{"line":167,"column":59}},"72":{"start":{"line":168,"column":4},"end":{"line":168,"column":37}},"73":{"start":{"line":169,"column":4},"end":{"line":169,"column":23}},"74":{"start":{"line":173,"column":17},"end":{"line":173,"column":79}},"75":{"start":{"line":174,"column":4},"end":{"line":174,"column":31}},"76":{"start":{"line":175,"column":4},"end":{"line":175,"column":38}},"77":{"start":{"line":176,"column":4},"end":{"line":176,"column":42}},"78":{"start":{"line":180,"column":4},"end":{"line":180,"column":38}},"79":{"start":{"line":182,"column":4},"end":{"line":187,"column":5}},"80":{"start":{"line":183,"column":6},"end":{"line":183,"column":49}},"81":{"start":{"line":184,"column":6},"end":{"line":184,"column":42}},"82":{"start":{"line":186,"column":6},"end":{"line":186,"column":72}},"83":{"start":{"line":189,"column":4},"end":{"line":195,"column":5}},"84":{"start":{"line":190,"column":6},"end":{"line":190,"column":45}},"85":{"start":{"line":191,"column":6},"end":{"line":191,"column":80}},"86":{"start":{"line":192,"column":6},"end":{"line":192,"column":78}},"87":{"start":{"line":193,"column":6},"end":{"line":193,"column":84}},"88":{"start":{"line":194,"column":6},"end":{"line":194,"column":80}},"89":{"start":{"line":197,"column":4},"end":{"line":197,"column":16}},"90":{"start":{"line":205,"column":20},"end":{"line":205,"column":44}},"91":{"start":{"line":206,"column":20},"end":{"line":206,"column":22}},"92":{"start":{"line":208,"column":4},"end":{"line":221,"column":5}},"93":{"start":{"line":209,"column":25},"end":{"line":209,"column":38}},"94":{"start":{"line":210,"column":6},"end":{"line":220,"column":9}},"95":{"start":{"line":223,"column":4},"end":{"line":223,"column":19}},"96":{"start":{"line":234,"column":17},"end":{"line":234,"column":21}},"97":{"start":{"line":236,"column":14},"end":{"line":236,"column":35}},"98":{"start":{"line":237,"column":17},"end":{"line":237,"column":21}},"99":{"start":{"line":238,"column":19},"end":{"line":238,"column":23}},"100":{"start":{"line":239,"column":18},"end":{"line":242,"column":5}},"101":{"start":{"line":244,"column":15},"end":{"line":247,"column":5}},"102":{"start":{"line":250,"column":4},"end":{"line":255,"column":5}},"103":{"start":{"line":251,"column":6},"end":{"line":254,"column":40}},"104":{"start":{"line":257,"column":4},"end":{"line":272,"column":5}},"105":{"start":{"line":259,"column":8},"end":{"line":259,"column":56}},"106":{"start":{"line":260,"column":8},"end":{"line":260,"column":14}},"107":{"start":{"line":262,"column":8},"end":{"line":266,"column":9}},"108":{"start":{"line":263,"column":10},"end":{"line":263,"column":50}},"109":{"start":{"line":265,"column":10},"end":{"line":265,"column":81}},"110":{"start":{"line":268,"column":8},"end":{"line":270,"column":11}},"111":{"start":{"line":271,"column":8},"end":{"line":271,"column":14}},"112":{"start":{"line":275,"column":4},"end":{"line":279,"column":5}},"113":{"start":{"line":276,"column":6},"end":{"line":276,"column":40}},"114":{"start":{"line":278,"column":6},"end":{"line":278,"column":53}},"115":{"start":{"line":281,"column":4},"end":{"line":286,"column":5}},"116":{"start":{"line":282,"column":6},"end":{"line":285,"column":8}},"117":{"start":{"line":288,"column":4},"end":{"line":321,"column":5}},"118":{"start":{"line":290,"column":8},"end":{"line":293,"column":10}},"119":{"start":{"line":294,"column":8},"end":{"line":294,"column":14}},"120":{"start":{"line":296,"column":8},"end":{"line":319,"column":9}},"121":{"start":{"line":297,"column":28},"end":{"line":297,"column":78}},"122":{"start":{"line":298,"column":10},"end":{"line":310,"column":11}},"123":{"start":{"line":300,"column":14},"end":{"line":304,"column":15}},"124":{"start":{"line":301,"column":16},"end":{"line":301,"column":47}},"125":{"start":{"line":303,"column":16},"end":{"line":303,"column":70}},"126":{"start":{"line":305,"column":14},"end":{"line":305,"column":20}},"127":{"start":{"line":307,"column":14},"end":{"line":307,"column":138}},"128":{"start":{"line":307,"column":48},"end":{"line":307,"column":138}},"129":{"start":{"line":308,"column":14},"end":{"line":308,"column":45}},"130":{"start":{"line":309,"column":14},"end":{"line":309,"column":20}},"131":{"start":{"line":312,"column":10},"end":{"line":312,"column":124}},"132":{"start":{"line":312,"column":44},"end":{"line":312,"column":124}},"133":{"start":{"line":314,"column":10},"end":{"line":318,"column":11}},"134":{"start":{"line":315,"column":12},"end":{"line":315,"column":37}},"135":{"start":{"line":317,"column":12},"end":{"line":317,"column":37}},"136":{"start":{"line":320,"column":8},"end":{"line":320,"column":14}},"137":{"start":{"line":323,"column":4},"end":{"line":323,"column":18}},"138":{"start":{"line":327,"column":4},"end":{"line":330,"column":7}},"139":{"start":{"line":334,"column":16},"end":{"line":334,"column":79}},"140":{"start":{"line":335,"column":16},"end":{"line":335,"column":27}},"141":{"start":{"line":336,"column":18},"end":{"line":336,"column":61}},"142":{"start":{"line":337,"column":4},"end":{"line":337,"column":26}},"143":{"start":{"line":338,"column":4},"end":{"line":338,"column":20}},"144":{"start":{"line":342,"column":4},"end":{"line":344,"column":7}},"145":{"start":{"line":354,"column":4},"end":{"line":354,"column":46}},"146":{"start":{"line":364,"column":4},"end":{"line":364,"column":44}},"147":{"start":{"line":374,"column":17},"end":{"line":374,"column":21}},"148":{"start":{"line":375,"column":18},"end":{"line":375,"column":22}},"149":{"start":{"line":377,"column":4},"end":{"line":390,"column":5}},"150":{"start":{"line":379,"column":8},"end":{"line":382,"column":11}},"151":{"start":{"line":383,"column":8},"end":{"line":383,"column":14}},"152":{"start":{"line":385,"column":8},"end":{"line":388,"column":11}},"153":{"start":{"line":389,"column":8},"end":{"line":389,"column":14}},"154":{"start":{"line":392,"column":4},"end":{"line":392,"column":54}},"155":{"start":{"line":394,"column":4},"end":{"line":394,"column":18}},"156":{"start":{"line":404,"column":4},"end":{"line":404,"column":48}},"157":{"start":{"line":414,"column":4},"end":{"line":414,"column":48}},"158":{"start":{"line":424,"column":4},"end":{"line":424,"column":47}},"159":{"start":{"line":428,"column":4},"end":{"line":428,"column":47}},"160":{"start":{"line":432,"column":0},"end":{"line":432,"column":24}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":38,"column":2},"end":{"line":38,"column":3}},"loc":{"start":{"line":38,"column":28},"end":{"line":69,"column":3}},"line":38},"1":{"name":"(anonymous_1)","decl":{"start":{"line":71,"column":2},"end":{"line":71,"column":3}},"loc":{"start":{"line":71,"column":14},"end":{"line":73,"column":3}},"line":71},"2":{"name":"(anonymous_2)","decl":{"start":{"line":75,"column":2},"end":{"line":75,"column":3}},"loc":{"start":{"line":75,"column":19},"end":{"line":115,"column":3}},"line":75},"3":{"name":"(anonymous_3)","decl":{"start":{"line":117,"column":2},"end":{"line":117,"column":3}},"loc":{"start":{"line":117,"column":32},"end":{"line":119,"column":3}},"line":117},"4":{"name":"(anonymous_4)","decl":{"start":{"line":121,"column":2},"end":{"line":121,"column":3}},"loc":{"start":{"line":121,"column":29},"end":{"line":123,"column":3}},"line":121},"5":{"name":"(anonymous_5)","decl":{"start":{"line":125,"column":2},"end":{"line":125,"column":3}},"loc":{"start":{"line":125,"column":37},"end":{"line":127,"column":3}},"line":125},"6":{"name":"(anonymous_6)","decl":{"start":{"line":129,"column":2},"end":{"line":129,"column":3}},"loc":{"start":{"line":129,"column":32},"end":{"line":136,"column":3}},"line":129},"7":{"name":"(anonymous_7)","decl":{"start":{"line":138,"column":2},"end":{"line":138,"column":3}},"loc":{"start":{"line":138,"column":37},"end":{"line":144,"column":3}},"line":138},"8":{"name":"(anonymous_8)","decl":{"start":{"line":146,"column":2},"end":{"line":146,"column":3}},"loc":{"start":{"line":146,"column":37},"end":{"line":149,"column":3}},"line":146},"9":{"name":"(anonymous_9)","decl":{"start":{"line":151,"column":2},"end":{"line":151,"column":3}},"loc":{"start":{"line":151,"column":38},"end":{"line":162,"column":3}},"line":151},"10":{"name":"(anonymous_10)","decl":{"start":{"line":164,"column":2},"end":{"line":164,"column":3}},"loc":{"start":{"line":164,"column":36},"end":{"line":170,"column":3}},"line":164},"11":{"name":"(anonymous_11)","decl":{"start":{"line":172,"column":2},"end":{"line":172,"column":3}},"loc":{"start":{"line":172,"column":42},"end":{"line":177,"column":3}},"line":172},"12":{"name":"(anonymous_12)","decl":{"start":{"line":179,"column":2},"end":{"line":179,"column":3}},"loc":{"start":{"line":179,"column":19},"end":{"line":198,"column":3}},"line":179},"13":{"name":"(anonymous_13)","decl":{"start":{"line":204,"column":2},"end":{"line":204,"column":3}},"loc":{"start":{"line":204,"column":21},"end":{"line":224,"column":3}},"line":204},"14":{"name":"(anonymous_14)","decl":{"start":{"line":233,"column":2},"end":{"line":233,"column":3}},"loc":{"start":{"line":233,"column":42},"end":{"line":324,"column":3}},"line":233},"15":{"name":"(anonymous_15)","decl":{"start":{"line":326,"column":2},"end":{"line":326,"column":3}},"loc":{"start":{"line":326,"column":16},"end":{"line":331,"column":3}},"line":326},"16":{"name":"(anonymous_16)","decl":{"start":{"line":333,"column":2},"end":{"line":333,"column":3}},"loc":{"start":{"line":333,"column":23},"end":{"line":339,"column":3}},"line":333},"17":{"name":"(anonymous_17)","decl":{"start":{"line":341,"column":2},"end":{"line":341,"column":3}},"loc":{"start":{"line":341,"column":29},"end":{"line":345,"column":3}},"line":341},"18":{"name":"(anonymous_18)","decl":{"start":{"line":353,"column":2},"end":{"line":353,"column":3}},"loc":{"start":{"line":353,"column":25},"end":{"line":355,"column":3}},"line":353},"19":{"name":"(anonymous_19)","decl":{"start":{"line":363,"column":2},"end":{"line":363,"column":3}},"loc":{"start":{"line":363,"column":27},"end":{"line":365,"column":3}},"line":363},"20":{"name":"(anonymous_20)","decl":{"start":{"line":373,"column":2},"end":{"line":373,"column":3}},"loc":{"start":{"line":373,"column":38},"end":{"line":395,"column":3}},"line":373},"21":{"name":"(anonymous_21)","decl":{"start":{"line":403,"column":2},"end":{"line":403,"column":3}},"loc":{"start":{"line":403,"column":31},"end":{"line":405,"column":3}},"line":403},"22":{"name":"(anonymous_22)","decl":{"start":{"line":413,"column":2},"end":{"line":413,"column":3}},"loc":{"start":{"line":413,"column":27},"end":{"line":415,"column":3}},"line":413},"23":{"name":"(anonymous_23)","decl":{"start":{"line":423,"column":2},"end":{"line":423,"column":3}},"loc":{"start":{"line":423,"column":30},"end":{"line":425,"column":3}},"line":423},"24":{"name":"(anonymous_24)","decl":{"start":{"line":427,"column":2},"end":{"line":427,"column":3}},"loc":{"start":{"line":427,"column":30},"end":{"line":429,"column":3}},"line":427}},"branchMap":{"0":{"loc":{"start":{"line":38,"column":15},"end":{"line":38,"column":26}},"type":"default-arg","locations":[{"start":{"line":38,"column":24},"end":{"line":38,"column":26}}],"line":38},"1":{"loc":{"start":{"line":50,"column":16},"end":{"line":50,"column":61}},"type":"binary-expr","locations":[{"start":{"line":50,"column":16},"end":{"line":50,"column":34}},{"start":{"line":50,"column":38},"end":{"line":50,"column":61}}],"line":50},"2":{"loc":{"start":{"line":54,"column":23},"end":{"line":54,"column":51}},"type":"cond-expr","locations":[{"start":{"line":54,"column":39},"end":{"line":54,"column":44}},{"start":{"line":54,"column":47},"end":{"line":54,"column":51}}],"line":54},"3":{"loc":{"start":{"line":86,"column":4},"end":{"line":109,"column":5}},"type":"switch","locations":[{"start":{"line":87,"column":6},"end":{"line":92,"column":14}},{"start":{"line":93,"column":6},"end":{"line":97,"column":14}},{"start":{"line":98,"column":6},"end":{"line":102,"column":14}},{"start":{"line":103,"column":6},"end":{"line":108,"column":14}}],"line":86},"4":{"loc":{"start":{"line":112,"column":21},"end":{"line":112,"column":55}},"type":"cond-expr","locations":[{"start":{"line":112,"column":39},"end":{"line":112,"column":45}},{"start":{"line":112,"column":48},"end":{"line":112,"column":55}}],"line":112},"5":{"loc":{"start":{"line":122,"column":11},"end":{"line":122,"column":107}},"type":"cond-expr","locations":[{"start":{"line":122,"column":41},"end":{"line":122,"column":75}},{"start":{"line":122,"column":78},"end":{"line":122,"column":107}}],"line":122},"6":{"loc":{"start":{"line":167,"column":4},"end":{"line":167,"column":59}},"type":"if","locations":[{"start":{"line":167,"column":4},"end":{"line":167,"column":59}},{"start":{"line":167,"column":4},"end":{"line":167,"column":59}}],"line":167},"7":{"loc":{"start":{"line":172,"column":29},"end":{"line":172,"column":40}},"type":"default-arg","locations":[{"start":{"line":172,"column":38},"end":{"line":172,"column":40}}],"line":172},"8":{"loc":{"start":{"line":189,"column":4},"end":{"line":195,"column":5}},"type":"if","locations":[{"start":{"line":189,"column":4},"end":{"line":195,"column":5}},{"start":{"line":189,"column":4},"end":{"line":195,"column":5}}],"line":189},"9":{"loc":{"start":{"line":233,"column":29},"end":{"line":233,"column":40}},"type":"default-arg","locations":[{"start":{"line":233,"column":38},"end":{"line":233,"column":40}}],"line":233},"10":{"loc":{"start":{"line":250,"column":4},"end":{"line":255,"column":5}},"type":"if","locations":[{"start":{"line":250,"column":4},"end":{"line":255,"column":5}},{"start":{"line":250,"column":4},"end":{"line":255,"column":5}}],"line":250},"11":{"loc":{"start":{"line":250,"column":8},"end":{"line":250,"column":56}},"type":"binary-expr","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":30}},{"start":{"line":250,"column":34},"end":{"line":250,"column":56}}],"line":250},"12":{"loc":{"start":{"line":252,"column":8},"end":{"line":252,"column":36}},"type":"binary-expr","locations":[{"start":{"line":252,"column":8},"end":{"line":252,"column":30}},{"start":{"line":252,"column":34},"end":{"line":252,"column":36}}],"line":252},"13":{"loc":{"start":{"line":253,"column":8},"end":{"line":253,"column":36}},"type":"binary-expr","locations":[{"start":{"line":253,"column":8},"end":{"line":253,"column":30}},{"start":{"line":253,"column":34},"end":{"line":253,"column":36}}],"line":253},"14":{"loc":{"start":{"line":257,"column":4},"end":{"line":272,"column":5}},"type":"switch","locations":[{"start":{"line":258,"column":6},"end":{"line":260,"column":14}},{"start":{"line":261,"column":6},"end":{"line":271,"column":14}}],"line":257},"15":{"loc":{"start":{"line":269,"column":16},"end":{"line":269,"column":35}},"type":"binary-expr","locations":[{"start":{"line":269,"column":16},"end":{"line":269,"column":27}},{"start":{"line":269,"column":31},"end":{"line":269,"column":35}}],"line":269},"16":{"loc":{"start":{"line":281,"column":4},"end":{"line":286,"column":5}},"type":"if","locations":[{"start":{"line":281,"column":4},"end":{"line":286,"column":5}},{"start":{"line":281,"column":4},"end":{"line":286,"column":5}}],"line":281},"17":{"loc":{"start":{"line":288,"column":4},"end":{"line":321,"column":5}},"type":"switch","locations":[{"start":{"line":289,"column":6},"end":{"line":294,"column":14}},{"start":{"line":295,"column":6},"end":{"line":320,"column":14}}],"line":288},"18":{"loc":{"start":{"line":296,"column":8},"end":{"line":319,"column":9}},"type":"if","locations":[{"start":{"line":296,"column":8},"end":{"line":319,"column":9}},{"start":{"line":296,"column":8},"end":{"line":319,"column":9}}],"line":296},"19":{"loc":{"start":{"line":298,"column":10},"end":{"line":310,"column":11}},"type":"switch","locations":[{"start":{"line":299,"column":12},"end":{"line":305,"column":20}},{"start":{"line":306,"column":12},"end":{"line":309,"column":20}}],"line":298},"20":{"loc":{"start":{"line":307,"column":14},"end":{"line":307,"column":138}},"type":"if","locations":[{"start":{"line":307,"column":14},"end":{"line":307,"column":138}},{"start":{"line":307,"column":14},"end":{"line":307,"column":138}}],"line":307},"21":{"loc":{"start":{"line":312,"column":10},"end":{"line":312,"column":124}},"type":"if","locations":[{"start":{"line":312,"column":10},"end":{"line":312,"column":124}},{"start":{"line":312,"column":10},"end":{"line":312,"column":124}}],"line":312},"22":{"loc":{"start":{"line":373,"column":25},"end":{"line":373,"column":36}},"type":"default-arg","locations":[{"start":{"line":373,"column":34},"end":{"line":373,"column":36}}],"line":373},"23":{"loc":{"start":{"line":377,"column":4},"end":{"line":390,"column":5}},"type":"switch","locations":[{"start":{"line":378,"column":6},"end":{"line":383,"column":14}},{"start":{"line":384,"column":6},"end":{"line":389,"column":14}}],"line":377}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":0,"25":0,"26":0,"27":0,"28":1,"29":1,"30":1,"31":1,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":1,"41":1,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":1,"97":1,"98":1,"99":1,"100":1,"101":1,"102":1,"103":0,"104":1,"105":0,"106":0,"107":1,"108":1,"109":0,"110":1,"111":1,"112":1,"113":1,"114":0,"115":1,"116":0,"117":1,"118":0,"119":0,"120":1,"121":1,"122":1,"123":0,"124":0,"125":0,"126":0,"127":1,"128":0,"129":1,"130":1,"131":0,"132":0,"133":0,"134":0,"135":0,"136":1,"137":1,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":1,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":1},"f":{"0":1,"1":1,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":1,"15":0,"16":0,"17":0,"18":0,"19":1,"20":0,"21":0,"22":0,"23":0,"24":0},"b":{"0":[0],"1":[1,0],"2":[0,1],"3":[0,1,0,0],"4":[1,0],"5":[0,0],"6":[0,0],"7":[0],"8":[0,0],"9":[1],"10":[0,1],"11":[1,1],"12":[0,0],"13":[0,0],"14":[0,1],"15":[1,1],"16":[0,1],"17":[0,1],"18":[1,0],"19":[0,1],"20":[0,1],"21":[0,0],"22":[0],"23":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"6276ab807cdd49e2510c37b15aac29cf1b49793c","contentHash":"117cec3f86d220697f21b875fa3a271ee5a75d8a3f968f78b4da945e3913f228"},"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/server.js":{"path":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/server.js","statementMap":{"0":{"start":{"line":9,"column":4},"end":{"line":9,"column":27}},"1":{"start":{"line":12,"column":13},"end":{"line":12,"column":28}},"2":{"start":{"line":13,"column":15},"end":{"line":13,"column":32}},"3":{"start":{"line":14,"column":14},"end":{"line":14,"column":37}},"4":{"start":{"line":17,"column":16},"end":{"line":17,"column":34}},"5":{"start":{"line":18,"column":16},"end":{"line":18,"column":42}},"6":{"start":{"line":20,"column":16},"end":{"line":20,"column":38}},"7":{"start":{"line":21,"column":16},"end":{"line":21,"column":42}},"8":{"start":{"line":22,"column":18},"end":{"line":22,"column":49}},"9":{"start":{"line":23,"column":18},"end":{"line":23,"column":38}},"10":{"start":{"line":24,"column":18},"end":{"line":24,"column":38}},"11":{"start":{"line":27,"column":21},"end":{"line":27,"column":59}},"12":{"start":{"line":30,"column":14},"end":{"line":30,"column":49}},"13":{"start":{"line":32,"column":19},"end":{"line":32,"column":59}},"14":{"start":{"line":34,"column":16},"end":{"line":34,"column":53}},"15":{"start":{"line":35,"column":16},"end":{"line":35,"column":53}},"16":{"start":{"line":36,"column":15},"end":{"line":36,"column":51}},"17":{"start":{"line":37,"column":14},"end":{"line":37,"column":49}},"18":{"start":{"line":47,"column":18},"end":{"line":47,"column":31}},"19":{"start":{"line":48,"column":19},"end":{"line":48,"column":52}},"20":{"start":{"line":63,"column":4},"end":{"line":63,"column":20}},"21":{"start":{"line":66,"column":4},"end":{"line":84,"column":17}},"22":{"start":{"line":86,"column":4},"end":{"line":86,"column":26}},"23":{"start":{"line":87,"column":4},"end":{"line":87,"column":26}},"24":{"start":{"line":88,"column":4},"end":{"line":88,"column":22}},"25":{"start":{"line":89,"column":4},"end":{"line":89,"column":21}},"26":{"start":{"line":101,"column":4},"end":{"line":101,"column":20}},"27":{"start":{"line":102,"column":4},"end":{"line":102,"column":21}},"28":{"start":{"line":104,"column":4},"end":{"line":104,"column":29}},"29":{"start":{"line":105,"column":4},"end":{"line":109,"column":7}},"30":{"start":{"line":111,"column":4},"end":{"line":111,"column":21}},"31":{"start":{"line":112,"column":4},"end":{"line":112,"column":48}},"32":{"start":{"line":113,"column":4},"end":{"line":115,"column":7}},"33":{"start":{"line":117,"column":4},"end":{"line":117,"column":26}},"34":{"start":{"line":118,"column":4},"end":{"line":118,"column":21}},"35":{"start":{"line":119,"column":4},"end":{"line":119,"column":27}},"36":{"start":{"line":121,"column":4},"end":{"line":121,"column":16}},"37":{"start":{"line":125,"column":4},"end":{"line":125,"column":64}},"38":{"start":{"line":129,"column":4},"end":{"line":129,"column":23}},"39":{"start":{"line":133,"column":4},"end":{"line":133,"column":24}},"40":{"start":{"line":137,"column":4},"end":{"line":137,"column":17}},"41":{"start":{"line":139,"column":4},"end":{"line":139,"column":26}},"42":{"start":{"line":143,"column":4},"end":{"line":143,"column":44}},"43":{"start":{"line":145,"column":4},"end":{"line":147,"column":5}},"44":{"start":{"line":146,"column":6},"end":{"line":146,"column":57}},"45":{"start":{"line":149,"column":4},"end":{"line":164,"column":5}},"46":{"start":{"line":150,"column":22},"end":{"line":156,"column":7}},"47":{"start":{"line":158,"column":6},"end":{"line":158,"column":45}},"48":{"start":{"line":159,"column":6},"end":{"line":159,"column":37}},"49":{"start":{"line":160,"column":6},"end":{"line":160,"column":36}},"50":{"start":{"line":163,"column":6},"end":{"line":163,"column":30}},"51":{"start":{"line":166,"column":4},"end":{"line":166,"column":16}},"52":{"start":{"line":176,"column":4},"end":{"line":176,"column":98}},"53":{"start":{"line":176,"column":38},"end":{"line":176,"column":98}},"54":{"start":{"line":177,"column":19},"end":{"line":177,"column":23}},"55":{"start":{"line":178,"column":21},"end":{"line":178,"column":57}},"56":{"start":{"line":180,"column":21},"end":{"line":183,"column":16}},"57":{"start":{"line":185,"column":20},"end":{"line":185,"column":54}},"58":{"start":{"line":186,"column":18},"end":{"line":186,"column":42}},"59":{"start":{"line":188,"column":4},"end":{"line":188,"column":98}},"60":{"start":{"line":188,"column":38},"end":{"line":188,"column":98}},"61":{"start":{"line":189,"column":4},"end":{"line":189,"column":90}},"62":{"start":{"line":189,"column":38},"end":{"line":189,"column":90}},"63":{"start":{"line":191,"column":4},"end":{"line":191,"column":30}},"64":{"start":{"line":192,"column":4},"end":{"line":192,"column":38}},"65":{"start":{"line":193,"column":4},"end":{"line":193,"column":48}},"66":{"start":{"line":194,"column":4},"end":{"line":194,"column":40}},"67":{"start":{"line":196,"column":4},"end":{"line":198,"column":7}},"68":{"start":{"line":197,"column":6},"end":{"line":197,"column":55}},"69":{"start":{"line":200,"column":4},"end":{"line":202,"column":7}},"70":{"start":{"line":201,"column":6},"end":{"line":201,"column":57}},"71":{"start":{"line":204,"column":4},"end":{"line":228,"column":7}},"72":{"start":{"line":205,"column":19},"end":{"line":205,"column":23}},"73":{"start":{"line":206,"column":6},"end":{"line":222,"column":7}},"74":{"start":{"line":208,"column":10},"end":{"line":211,"column":13}},"75":{"start":{"line":213,"column":10},"end":{"line":213,"column":83}},"76":{"start":{"line":214,"column":10},"end":{"line":214,"column":46}},"77":{"start":{"line":215,"column":10},"end":{"line":215,"column":16}},"78":{"start":{"line":217,"column":10},"end":{"line":217,"column":63}},"79":{"start":{"line":218,"column":10},"end":{"line":218,"column":16}},"80":{"start":{"line":220,"column":10},"end":{"line":220,"column":85}},"81":{"start":{"line":221,"column":10},"end":{"line":221,"column":16}},"82":{"start":{"line":224,"column":6},"end":{"line":227,"column":9}},"83":{"start":{"line":230,"column":4},"end":{"line":235,"column":7}},"84":{"start":{"line":231,"column":6},"end":{"line":234,"column":9}},"85":{"start":{"line":237,"column":4},"end":{"line":241,"column":7}},"86":{"start":{"line":243,"column":4},"end":{"line":247,"column":7}},"87":{"start":{"line":250,"column":4},"end":{"line":250,"column":44}},"88":{"start":{"line":253,"column":4},"end":{"line":253,"column":29}},"89":{"start":{"line":254,"column":4},"end":{"line":254,"column":33}},"90":{"start":{"line":257,"column":4},"end":{"line":257,"column":16}},"91":{"start":{"line":261,"column":16},"end":{"line":261,"column":45}},"92":{"start":{"line":262,"column":4},"end":{"line":268,"column":5}},"93":{"start":{"line":262,"column":17},"end":{"line":262,"column":18}},"94":{"start":{"line":263,"column":6},"end":{"line":267,"column":7}},"95":{"start":{"line":264,"column":8},"end":{"line":264,"column":65}},"96":{"start":{"line":266,"column":8},"end":{"line":266,"column":60}},"97":{"start":{"line":272,"column":4},"end":{"line":272,"column":24}},"98":{"start":{"line":274,"column":4},"end":{"line":276,"column":7}},"99":{"start":{"line":275,"column":6},"end":{"line":275,"column":101}},"100":{"start":{"line":280,"column":4},"end":{"line":280,"column":43}},"101":{"start":{"line":284,"column":4},"end":{"line":284,"column":73}},"102":{"start":{"line":288,"column":4},"end":{"line":288,"column":75}},"103":{"start":{"line":288,"column":22},"end":{"line":288,"column":75}},"104":{"start":{"line":289,"column":4},"end":{"line":289,"column":75}},"105":{"start":{"line":289,"column":22},"end":{"line":289,"column":75}},"106":{"start":{"line":290,"column":4},"end":{"line":290,"column":104}},"107":{"start":{"line":290,"column":36},"end":{"line":290,"column":104}},"108":{"start":{"line":291,"column":4},"end":{"line":291,"column":62}},"109":{"start":{"line":301,"column":19},"end":{"line":301,"column":23}},"110":{"start":{"line":302,"column":4},"end":{"line":302,"column":71}},"111":{"start":{"line":306,"column":19},"end":{"line":306,"column":78}},"112":{"start":{"line":307,"column":19},"end":{"line":307,"column":41}},"113":{"start":{"line":308,"column":19},"end":{"line":311,"column":6}},"114":{"start":{"line":313,"column":4},"end":{"line":327,"column":6}},"115":{"start":{"line":314,"column":6},"end":{"line":314,"column":39}},"116":{"start":{"line":315,"column":6},"end":{"line":326,"column":30}},"117":{"start":{"line":316,"column":20},"end":{"line":316,"column":30}},"118":{"start":{"line":317,"column":24},"end":{"line":317,"column":68}},"119":{"start":{"line":319,"column":21},"end":{"line":319,"column":55}},"120":{"start":{"line":321,"column":8},"end":{"line":325,"column":9}},"121":{"start":{"line":322,"column":10},"end":{"line":322,"column":39}},"122":{"start":{"line":324,"column":10},"end":{"line":324,"column":67}},"123":{"start":{"line":329,"column":4},"end":{"line":329,"column":27}},"124":{"start":{"line":330,"column":4},"end":{"line":330,"column":29}},"125":{"start":{"line":333,"column":4},"end":{"line":336,"column":7}},"126":{"start":{"line":334,"column":6},"end":{"line":334,"column":39}},"127":{"start":{"line":335,"column":6},"end":{"line":335,"column":60}},"128":{"start":{"line":339,"column":4},"end":{"line":443,"column":7}},"129":{"start":{"line":340,"column":6},"end":{"line":340,"column":78}},"130":{"start":{"line":342,"column":20},"end":{"line":342,"column":24}},"131":{"start":{"line":343,"column":17},"end":{"line":343,"column":21}},"132":{"start":{"line":345,"column":6},"end":{"line":350,"column":7}},"133":{"start":{"line":346,"column":8},"end":{"line":349,"column":11}},"134":{"start":{"line":352,"column":6},"end":{"line":357,"column":7}},"135":{"start":{"line":353,"column":8},"end":{"line":353,"column":39}},"136":{"start":{"line":354,"column":8},"end":{"line":354,"column":28}},"137":{"start":{"line":356,"column":8},"end":{"line":356,"column":61}},"138":{"start":{"line":359,"column":6},"end":{"line":373,"column":7}},"139":{"start":{"line":361,"column":8},"end":{"line":372,"column":9}},"140":{"start":{"line":362,"column":10},"end":{"line":364,"column":11}},"141":{"start":{"line":363,"column":12},"end":{"line":363,"column":39}},"142":{"start":{"line":366,"column":10},"end":{"line":366,"column":36}},"143":{"start":{"line":367,"column":10},"end":{"line":367,"column":50}},"144":{"start":{"line":369,"column":10},"end":{"line":369,"column":72}},"145":{"start":{"line":371,"column":10},"end":{"line":371,"column":72}},"146":{"start":{"line":375,"column":18},"end":{"line":375,"column":36}},"147":{"start":{"line":376,"column":20},"end":{"line":376,"column":34}},"148":{"start":{"line":378,"column":18},"end":{"line":378,"column":22}},"149":{"start":{"line":380,"column":6},"end":{"line":431,"column":7}},"150":{"start":{"line":382,"column":10},"end":{"line":382,"column":59}},"151":{"start":{"line":383,"column":10},"end":{"line":383,"column":16}},"152":{"start":{"line":385,"column":23},"end":{"line":385,"column":66}},"153":{"start":{"line":386,"column":10},"end":{"line":386,"column":41}},"154":{"start":{"line":387,"column":10},"end":{"line":387,"column":24}},"155":{"start":{"line":389,"column":21},"end":{"line":389,"column":92}},"156":{"start":{"line":390,"column":10},"end":{"line":390,"column":56}},"157":{"start":{"line":391,"column":10},"end":{"line":391,"column":16}},"158":{"start":{"line":393,"column":23},"end":{"line":393,"column":95}},"159":{"start":{"line":394,"column":10},"end":{"line":394,"column":54}},"160":{"start":{"line":395,"column":10},"end":{"line":395,"column":16}},"161":{"start":{"line":397,"column":20},"end":{"line":397,"column":30}},"162":{"start":{"line":398,"column":10},"end":{"line":398,"column":63}},"163":{"start":{"line":399,"column":21},"end":{"line":399,"column":53}},"164":{"start":{"line":400,"column":10},"end":{"line":400,"column":46}},"165":{"start":{"line":402,"column":10},"end":{"line":405,"column":15}},"166":{"start":{"line":407,"column":20},"end":{"line":407,"column":24}},"167":{"start":{"line":409,"column":10},"end":{"line":411,"column":32}},"168":{"start":{"line":410,"column":12},"end":{"line":410,"column":39}},"169":{"start":{"line":413,"column":10},"end":{"line":418,"column":11}},"170":{"start":{"line":414,"column":12},"end":{"line":417,"column":15}},"171":{"start":{"line":420,"column":10},"end":{"line":420,"column":16}},"172":{"start":{"line":422,"column":10},"end":{"line":422,"column":35}},"173":{"start":{"line":423,"column":10},"end":{"line":423,"column":17}},"174":{"start":{"line":424,"column":10},"end":{"line":424,"column":16}},"175":{"start":{"line":426,"column":10},"end":{"line":429,"column":13}},"176":{"start":{"line":430,"column":10},"end":{"line":430,"column":16}},"177":{"start":{"line":437,"column":6},"end":{"line":442,"column":10}},"178":{"start":{"line":446,"column":4},"end":{"line":448,"column":7}},"179":{"start":{"line":447,"column":6},"end":{"line":447,"column":52}},"180":{"start":{"line":451,"column":4},"end":{"line":451,"column":60}},"181":{"start":{"line":454,"column":16},"end":{"line":454,"column":93}},"182":{"start":{"line":455,"column":16},"end":{"line":455,"column":30}},"183":{"start":{"line":456,"column":4},"end":{"line":456,"column":21}},"184":{"start":{"line":464,"column":4},"end":{"line":476,"column":5}},"185":{"start":{"line":465,"column":6},"end":{"line":469,"column":10}},"186":{"start":{"line":471,"column":6},"end":{"line":475,"column":10}},"187":{"start":{"line":478,"column":4},"end":{"line":478,"column":18}},"188":{"start":{"line":482,"column":4},"end":{"line":482,"column":78}},"189":{"start":{"line":483,"column":17},"end":{"line":483,"column":40}},"190":{"start":{"line":484,"column":4},"end":{"line":484,"column":52}},"191":{"start":{"line":484,"column":17},"end":{"line":484,"column":52}},"192":{"start":{"line":485,"column":17},"end":{"line":485,"column":33}},"193":{"start":{"line":489,"column":16},"end":{"line":491,"column":6}},"194":{"start":{"line":490,"column":6},"end":{"line":490,"column":27}},"195":{"start":{"line":493,"column":4},"end":{"line":493,"column":64}},"196":{"start":{"line":495,"column":4},"end":{"line":501,"column":5}},"197":{"start":{"line":495,"column":17},"end":{"line":495,"column":18}},"198":{"start":{"line":496,"column":6},"end":{"line":500,"column":7}},"199":{"start":{"line":497,"column":8},"end":{"line":497,"column":45}},"200":{"start":{"line":499,"column":8},"end":{"line":499,"column":53}},"201":{"start":{"line":510,"column":4},"end":{"line":510,"column":66}},"202":{"start":{"line":511,"column":15},"end":{"line":511,"column":17}},"203":{"start":{"line":513,"column":4},"end":{"line":517,"column":5}},"204":{"start":{"line":514,"column":6},"end":{"line":514,"column":41}},"205":{"start":{"line":516,"column":6},"end":{"line":516,"column":132}},"206":{"start":{"line":518,"column":4},"end":{"line":518,"column":58}},"207":{"start":{"line":519,"column":4},"end":{"line":519,"column":41}},"208":{"start":{"line":520,"column":4},"end":{"line":520,"column":24}},"209":{"start":{"line":524,"column":4},"end":{"line":528,"column":7}},"210":{"start":{"line":534,"column":4},"end":{"line":541,"column":17}},"211":{"start":{"line":542,"column":4},"end":{"line":542,"column":18}},"212":{"start":{"line":546,"column":4},"end":{"line":546,"column":47}},"213":{"start":{"line":547,"column":4},"end":{"line":547,"column":51}},"214":{"start":{"line":548,"column":4},"end":{"line":548,"column":63}},"215":{"start":{"line":549,"column":4},"end":{"line":549,"column":18}},"216":{"start":{"line":553,"column":4},"end":{"line":553,"column":56}},"217":{"start":{"line":554,"column":4},"end":{"line":554,"column":47}},"218":{"start":{"line":554,"column":33},"end":{"line":554,"column":47}},"219":{"start":{"line":555,"column":4},"end":{"line":558,"column":7}},"220":{"start":{"line":557,"column":6},"end":{"line":557,"column":13}},"221":{"start":{"line":568,"column":4},"end":{"line":568,"column":62}},"222":{"start":{"line":569,"column":4},"end":{"line":569,"column":54}},"223":{"start":{"line":573,"column":4},"end":{"line":573,"column":11}},"224":{"start":{"line":577,"column":4},"end":{"line":582,"column":5}},"225":{"start":{"line":578,"column":6},"end":{"line":578,"column":42}},"226":{"start":{"line":579,"column":6},"end":{"line":579,"column":26}},"227":{"start":{"line":581,"column":6},"end":{"line":581,"column":47}},"228":{"start":{"line":584,"column":4},"end":{"line":584,"column":16}},"229":{"start":{"line":588,"column":4},"end":{"line":588,"column":119}},"230":{"start":{"line":588,"column":38},"end":{"line":588,"column":119}},"231":{"start":{"line":589,"column":19},"end":{"line":589,"column":23}},"232":{"start":{"line":592,"column":17},"end":{"line":592,"column":21}},"233":{"start":{"line":593,"column":16},"end":{"line":593,"column":20}},"234":{"start":{"line":594,"column":19},"end":{"line":594,"column":23}},"235":{"start":{"line":596,"column":4},"end":{"line":603,"column":5}},"236":{"start":{"line":597,"column":18},"end":{"line":597,"column":32}},"237":{"start":{"line":598,"column":6},"end":{"line":602,"column":7}},"238":{"start":{"line":599,"column":8},"end":{"line":599,"column":22}},"239":{"start":{"line":600,"column":8},"end":{"line":600,"column":34}},"240":{"start":{"line":601,"column":8},"end":{"line":601,"column":14}},"241":{"start":{"line":605,"column":4},"end":{"line":660,"column":5}},"242":{"start":{"line":608,"column":8},"end":{"line":608,"column":22}},"243":{"start":{"line":610,"column":23},"end":{"line":610,"column":50}},"244":{"start":{"line":611,"column":8},"end":{"line":611,"column":52}},"245":{"start":{"line":611,"column":23},"end":{"line":611,"column":52}},"246":{"start":{"line":612,"column":8},"end":{"line":612,"column":14}},"247":{"start":{"line":614,"column":8},"end":{"line":620,"column":9}},"248":{"start":{"line":615,"column":10},"end":{"line":619,"column":11}},"249":{"start":{"line":616,"column":12},"end":{"line":616,"column":65}},"250":{"start":{"line":618,"column":12},"end":{"line":618,"column":65}},"251":{"start":{"line":627,"column":8},"end":{"line":627,"column":45}},"252":{"start":{"line":629,"column":8},"end":{"line":629,"column":14}},"253":{"start":{"line":631,"column":8},"end":{"line":631,"column":55}},"254":{"start":{"line":632,"column":8},"end":{"line":632,"column":14}},"255":{"start":{"line":634,"column":8},"end":{"line":636,"column":9}},"256":{"start":{"line":635,"column":10},"end":{"line":635,"column":66}},"257":{"start":{"line":638,"column":8},"end":{"line":638,"column":50}},"258":{"start":{"line":638,"column":21},"end":{"line":638,"column":50}},"259":{"start":{"line":644,"column":19},"end":{"line":644,"column":57}},"260":{"start":{"line":647,"column":8},"end":{"line":647,"column":39}},"261":{"start":{"line":649,"column":20},"end":{"line":649,"column":59}},"262":{"start":{"line":650,"column":8},"end":{"line":650,"column":23}},"263":{"start":{"line":651,"column":8},"end":{"line":651,"column":14}},"264":{"start":{"line":653,"column":8},"end":{"line":653,"column":39}},"265":{"start":{"line":654,"column":8},"end":{"line":654,"column":35}},"266":{"start":{"line":656,"column":8},"end":{"line":659,"column":11}},"267":{"start":{"line":663,"column":4},"end":{"line":672,"column":5}},"268":{"start":{"line":664,"column":6},"end":{"line":671,"column":9}},"269":{"start":{"line":674,"column":4},"end":{"line":688,"column":7}},"270":{"start":{"line":676,"column":8},"end":{"line":676,"column":55}},"271":{"start":{"line":677,"column":8},"end":{"line":677,"column":32}},"272":{"start":{"line":685,"column":8},"end":{"line":685,"column":55}},"273":{"start":{"line":686,"column":8},"end":{"line":686,"column":32}},"274":{"start":{"line":692,"column":4},"end":{"line":692,"column":82}},"275":{"start":{"line":692,"column":38},"end":{"line":692,"column":82}},"276":{"start":{"line":693,"column":19},"end":{"line":693,"column":23}},"277":{"start":{"line":694,"column":4},"end":{"line":694,"column":31}},"278":{"start":{"line":696,"column":4},"end":{"line":698,"column":5}},"279":{"start":{"line":697,"column":6},"end":{"line":697,"column":144}},"280":{"start":{"line":700,"column":4},"end":{"line":704,"column":5}},"281":{"start":{"line":701,"column":25},"end":{"line":701,"column":56}},"282":{"start":{"line":702,"column":23},"end":{"line":702,"column":69}},"283":{"start":{"line":703,"column":6},"end":{"line":703,"column":96}},"284":{"start":{"line":703,"column":42},"end":{"line":703,"column":96}},"285":{"start":{"line":707,"column":4},"end":{"line":707,"column":59}},"286":{"start":{"line":708,"column":4},"end":{"line":708,"column":62}},"287":{"start":{"line":712,"column":4},"end":{"line":712,"column":49}},"288":{"start":{"line":713,"column":4},"end":{"line":713,"column":36}},"289":{"start":{"line":714,"column":4},"end":{"line":714,"column":60}},"290":{"start":{"line":718,"column":4},"end":{"line":718,"column":70}},"291":{"start":{"line":718,"column":34},"end":{"line":718,"column":70}},"292":{"start":{"line":721,"column":4},"end":{"line":721,"column":63}},"293":{"start":{"line":722,"column":4},"end":{"line":722,"column":39}},"294":{"start":{"line":725,"column":4},"end":{"line":725,"column":75}},"295":{"start":{"line":728,"column":4},"end":{"line":728,"column":69}},"296":{"start":{"line":732,"column":4},"end":{"line":743,"column":5}},"297":{"start":{"line":732,"column":17},"end":{"line":732,"column":18}},"298":{"start":{"line":733,"column":20},"end":{"line":733,"column":42}},"299":{"start":{"line":734,"column":6},"end":{"line":742,"column":7}},"300":{"start":{"line":740,"column":10},"end":{"line":740,"column":80}},"301":{"start":{"line":741,"column":10},"end":{"line":741,"column":16}},"302":{"start":{"line":746,"column":4},"end":{"line":746,"column":73}},"303":{"start":{"line":747,"column":4},"end":{"line":747,"column":73}},"304":{"start":{"line":748,"column":4},"end":{"line":748,"column":74}},"305":{"start":{"line":749,"column":4},"end":{"line":749,"column":75}},"306":{"start":{"line":750,"column":4},"end":{"line":750,"column":76}},"307":{"start":{"line":751,"column":4},"end":{"line":751,"column":77}},"308":{"start":{"line":754,"column":4},"end":{"line":754,"column":66}},"309":{"start":{"line":757,"column":4},"end":{"line":761,"column":7}},"310":{"start":{"line":764,"column":4},"end":{"line":764,"column":70}},"311":{"start":{"line":767,"column":4},"end":{"line":771,"column":5}},"312":{"start":{"line":768,"column":6},"end":{"line":768,"column":71}},"313":{"start":{"line":769,"column":6},"end":{"line":769,"column":70}},"314":{"start":{"line":770,"column":6},"end":{"line":770,"column":69}},"315":{"start":{"line":774,"column":4},"end":{"line":774,"column":55}},"316":{"start":{"line":777,"column":4},"end":{"line":779,"column":7}},"317":{"start":{"line":778,"column":6},"end":{"line":778,"column":60}},"318":{"start":{"line":781,"column":4},"end":{"line":783,"column":7}},"319":{"start":{"line":782,"column":6},"end":{"line":782,"column":61}},"320":{"start":{"line":785,"column":4},"end":{"line":791,"column":5}},"321":{"start":{"line":786,"column":6},"end":{"line":790,"column":7}},"322":{"start":{"line":787,"column":8},"end":{"line":787,"column":33}},"323":{"start":{"line":789,"column":8},"end":{"line":789,"column":56}},"324":{"start":{"line":793,"column":4},"end":{"line":799,"column":5}},"325":{"start":{"line":794,"column":6},"end":{"line":794,"column":47}},"326":{"start":{"line":795,"column":6},"end":{"line":795,"column":71}},"327":{"start":{"line":797,"column":6},"end":{"line":797,"column":92}},"328":{"start":{"line":798,"column":6},"end":{"line":798,"column":20}},"329":{"start":{"line":802,"column":6},"end":{"line":802,"column":32}},"330":{"start":{"line":803,"column":6},"end":{"line":805,"column":9}},"331":{"start":{"line":814,"column":4},"end":{"line":814,"column":79}},"332":{"start":{"line":814,"column":38},"end":{"line":814,"column":79}},"333":{"start":{"line":816,"column":4},"end":{"line":816,"column":18}},"334":{"start":{"line":822,"column":4},"end":{"line":829,"column":5}},"335":{"start":{"line":824,"column":6},"end":{"line":828,"column":7}},"336":{"start":{"line":825,"column":8},"end":{"line":825,"column":33}},"337":{"start":{"line":827,"column":8},"end":{"line":827,"column":25}},"338":{"start":{"line":833,"column":4},"end":{"line":833,"column":82}},"339":{"start":{"line":833,"column":38},"end":{"line":833,"column":82}},"340":{"start":{"line":834,"column":19},"end":{"line":834,"column":23}},"341":{"start":{"line":835,"column":4},"end":{"line":835,"column":29}},"342":{"start":{"line":837,"column":4},"end":{"line":841,"column":5}},"343":{"start":{"line":838,"column":6},"end":{"line":838,"column":31}},"344":{"start":{"line":840,"column":6},"end":{"line":840,"column":56}},"345":{"start":{"line":843,"column":4},"end":{"line":849,"column":5}},"346":{"start":{"line":844,"column":6},"end":{"line":848,"column":7}},"347":{"start":{"line":845,"column":8},"end":{"line":845,"column":32}},"348":{"start":{"line":847,"column":8},"end":{"line":847,"column":55}},"349":{"start":{"line":851,"column":4},"end":{"line":851,"column":28}},"350":{"start":{"line":852,"column":4},"end":{"line":852,"column":27}},"351":{"start":{"line":854,"column":4},"end":{"line":854,"column":79}},"352":{"start":{"line":854,"column":38},"end":{"line":854,"column":79}},"353":{"start":{"line":855,"column":4},"end":{"line":855,"column":18}},"354":{"start":{"line":859,"column":4},"end":{"line":859,"column":50}},"355":{"start":{"line":859,"column":38},"end":{"line":859,"column":50}},"356":{"start":{"line":860,"column":4},"end":{"line":860,"column":92}},"357":{"start":{"line":860,"column":38},"end":{"line":860,"column":92}},"358":{"start":{"line":861,"column":17},"end":{"line":861,"column":48}},"359":{"start":{"line":862,"column":4},"end":{"line":862,"column":89}},"360":{"start":{"line":862,"column":38},"end":{"line":862,"column":89}},"361":{"start":{"line":863,"column":4},"end":{"line":863,"column":64}},"362":{"start":{"line":863,"column":52},"end":{"line":863,"column":64}},"363":{"start":{"line":864,"column":4},"end":{"line":864,"column":18}},"364":{"start":{"line":868,"column":4},"end":{"line":868,"column":50}},"365":{"start":{"line":868,"column":38},"end":{"line":868,"column":50}},"366":{"start":{"line":869,"column":4},"end":{"line":869,"column":98}},"367":{"start":{"line":869,"column":38},"end":{"line":869,"column":98}},"368":{"start":{"line":870,"column":4},"end":{"line":870,"column":43}},"369":{"start":{"line":874,"column":4},"end":{"line":874,"column":101}},"370":{"start":{"line":874,"column":38},"end":{"line":874,"column":101}},"371":{"start":{"line":875,"column":4},"end":{"line":875,"column":44}},"372":{"start":{"line":879,"column":4},"end":{"line":879,"column":50}},"373":{"start":{"line":879,"column":38},"end":{"line":879,"column":50}},"374":{"start":{"line":880,"column":4},"end":{"line":880,"column":100}},"375":{"start":{"line":880,"column":38},"end":{"line":880,"column":100}},"376":{"start":{"line":881,"column":4},"end":{"line":881,"column":45}},"377":{"start":{"line":885,"column":4},"end":{"line":885,"column":95}},"378":{"start":{"line":885,"column":38},"end":{"line":885,"column":95}},"379":{"start":{"line":886,"column":4},"end":{"line":886,"column":40}},"380":{"start":{"line":890,"column":0},"end":{"line":890,"column":34}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":62,"column":2},"end":{"line":62,"column":3}},"loc":{"start":{"line":62,"column":30},"end":{"line":122,"column":3}},"line":62},"1":{"name":"(anonymous_1)","decl":{"start":{"line":124,"column":2},"end":{"line":124,"column":3}},"loc":{"start":{"line":124,"column":14},"end":{"line":126,"column":3}},"line":124},"2":{"name":"(anonymous_2)","decl":{"start":{"line":128,"column":2},"end":{"line":128,"column":3}},"loc":{"start":{"line":128,"column":15},"end":{"line":130,"column":3}},"line":128},"3":{"name":"(anonymous_3)","decl":{"start":{"line":132,"column":2},"end":{"line":132,"column":3}},"loc":{"start":{"line":132,"column":20},"end":{"line":134,"column":3}},"line":132},"4":{"name":"(anonymous_4)","decl":{"start":{"line":136,"column":2},"end":{"line":136,"column":3}},"loc":{"start":{"line":136,"column":18},"end":{"line":167,"column":3}},"line":136},"5":{"name":"(anonymous_5)","decl":{"start":{"line":175,"column":2},"end":{"line":175,"column":3}},"loc":{"start":{"line":175,"column":34},"end":{"line":258,"column":3}},"line":175},"6":{"name":"(anonymous_6)","decl":{"start":{"line":196,"column":34},"end":{"line":196,"column":35}},"loc":{"start":{"line":196,"column":51},"end":{"line":198,"column":5}},"line":196},"7":{"name":"(anonymous_7)","decl":{"start":{"line":200,"column":36},"end":{"line":200,"column":37}},"loc":{"start":{"line":200,"column":55},"end":{"line":202,"column":5}},"line":200},"8":{"name":"(anonymous_8)","decl":{"start":{"line":204,"column":36},"end":{"line":204,"column":37}},"loc":{"start":{"line":204,"column":55},"end":{"line":228,"column":5}},"line":204},"9":{"name":"(anonymous_9)","decl":{"start":{"line":230,"column":35},"end":{"line":230,"column":36}},"loc":{"start":{"line":230,"column":47},"end":{"line":235,"column":5}},"line":230},"10":{"name":"(anonymous_10)","decl":{"start":{"line":260,"column":2},"end":{"line":260,"column":3}},"loc":{"start":{"line":260,"column":22},"end":{"line":269,"column":3}},"line":260},"11":{"name":"(anonymous_11)","decl":{"start":{"line":271,"column":2},"end":{"line":271,"column":3}},"loc":{"start":{"line":271,"column":17},"end":{"line":277,"column":3}},"line":271},"12":{"name":"(anonymous_12)","decl":{"start":{"line":274,"column":25},"end":{"line":274,"column":26}},"loc":{"start":{"line":274,"column":40},"end":{"line":276,"column":5}},"line":274},"13":{"name":"(anonymous_13)","decl":{"start":{"line":279,"column":2},"end":{"line":279,"column":3}},"loc":{"start":{"line":279,"column":33},"end":{"line":281,"column":3}},"line":279},"14":{"name":"(anonymous_14)","decl":{"start":{"line":283,"column":2},"end":{"line":283,"column":3}},"loc":{"start":{"line":283,"column":26},"end":{"line":285,"column":3}},"line":283},"15":{"name":"(anonymous_15)","decl":{"start":{"line":287,"column":2},"end":{"line":287,"column":3}},"loc":{"start":{"line":287,"column":21},"end":{"line":292,"column":3}},"line":287},"16":{"name":"(anonymous_16)","decl":{"start":{"line":300,"column":2},"end":{"line":300,"column":3}},"loc":{"start":{"line":300,"column":37},"end":{"line":479,"column":3}},"line":300},"17":{"name":"(anonymous_17)","decl":{"start":{"line":313,"column":29},"end":{"line":313,"column":30}},"loc":{"start":{"line":313,"column":41},"end":{"line":327,"column":5}},"line":313},"18":{"name":"(anonymous_18)","decl":{"start":{"line":315,"column":38},"end":{"line":315,"column":39}},"loc":{"start":{"line":315,"column":50},"end":{"line":326,"column":7}},"line":315},"19":{"name":"(anonymous_19)","decl":{"start":{"line":333,"column":23},"end":{"line":333,"column":24}},"loc":{"start":{"line":333,"column":35},"end":{"line":336,"column":5}},"line":333},"20":{"name":"handler","decl":{"start":{"line":339,"column":40},"end":{"line":339,"column":47}},"loc":{"start":{"line":339,"column":54},"end":{"line":443,"column":5}},"line":339},"21":{"name":"(anonymous_21)","decl":{"start":{"line":446,"column":41},"end":{"line":446,"column":42}},"loc":{"start":{"line":446,"column":60},"end":{"line":448,"column":5}},"line":446},"22":{"name":"(anonymous_22)","decl":{"start":{"line":481,"column":2},"end":{"line":481,"column":3}},"loc":{"start":{"line":481,"column":23},"end":{"line":486,"column":3}},"line":481},"23":{"name":"(anonymous_23)","decl":{"start":{"line":488,"column":2},"end":{"line":488,"column":3}},"loc":{"start":{"line":488,"column":26},"end":{"line":502,"column":3}},"line":488},"24":{"name":"(anonymous_24)","decl":{"start":{"line":489,"column":53},"end":{"line":489,"column":54}},"loc":{"start":{"line":489,"column":60},"end":{"line":491,"column":5}},"line":489},"25":{"name":"(anonymous_25)","decl":{"start":{"line":509,"column":2},"end":{"line":509,"column":3}},"loc":{"start":{"line":509,"column":33},"end":{"line":521,"column":3}},"line":509},"26":{"name":"(anonymous_26)","decl":{"start":{"line":523,"column":2},"end":{"line":523,"column":3}},"loc":{"start":{"line":523,"column":35},"end":{"line":529,"column":3}},"line":523},"27":{"name":"(anonymous_27)","decl":{"start":{"line":531,"column":2},"end":{"line":531,"column":3}},"loc":{"start":{"line":531,"column":34},"end":{"line":543,"column":3}},"line":531},"28":{"name":"(anonymous_28)","decl":{"start":{"line":545,"column":2},"end":{"line":545,"column":3}},"loc":{"start":{"line":545,"column":37},"end":{"line":550,"column":3}},"line":545},"29":{"name":"(anonymous_29)","decl":{"start":{"line":552,"column":2},"end":{"line":552,"column":3}},"loc":{"start":{"line":552,"column":29},"end":{"line":559,"column":3}},"line":552},"30":{"name":"(anonymous_30)","decl":{"start":{"line":555,"column":32},"end":{"line":555,"column":33}},"loc":{"start":{"line":555,"column":38},"end":{"line":558,"column":5}},"line":555},"31":{"name":"(anonymous_31)","decl":{"start":{"line":567,"column":2},"end":{"line":567,"column":3}},"loc":{"start":{"line":567,"column":36},"end":{"line":570,"column":3}},"line":567},"32":{"name":"(anonymous_32)","decl":{"start":{"line":572,"column":2},"end":{"line":572,"column":3}},"loc":{"start":{"line":572,"column":35},"end":{"line":574,"column":3}},"line":572},"33":{"name":"(anonymous_33)","decl":{"start":{"line":576,"column":2},"end":{"line":576,"column":3}},"loc":{"start":{"line":576,"column":28},"end":{"line":585,"column":3}},"line":576},"34":{"name":"(anonymous_34)","decl":{"start":{"line":587,"column":2},"end":{"line":587,"column":3}},"loc":{"start":{"line":587,"column":48},"end":{"line":689,"column":3}},"line":587},"35":{"name":"(anonymous_35)","decl":{"start":{"line":675,"column":12},"end":{"line":675,"column":13}},"loc":{"start":{"line":675,"column":24},"end":{"line":678,"column":7}},"line":675},"36":{"name":"(anonymous_36)","decl":{"start":{"line":679,"column":12},"end":{"line":679,"column":13}},"loc":{"start":{"line":679,"column":24},"end":{"line":687,"column":7}},"line":679},"37":{"name":"(anonymous_37)","decl":{"start":{"line":691,"column":2},"end":{"line":691,"column":3}},"loc":{"start":{"line":691,"column":17},"end":{"line":817,"column":3}},"line":691},"38":{"name":"(anonymous_38)","decl":{"start":{"line":777,"column":24},"end":{"line":777,"column":25}},"loc":{"start":{"line":777,"column":45},"end":{"line":779,"column":5}},"line":777},"39":{"name":"(anonymous_39)","decl":{"start":{"line":781,"column":25},"end":{"line":781,"column":26}},"loc":{"start":{"line":781,"column":46},"end":{"line":783,"column":5}},"line":781},"40":{"name":"notifyReady","decl":{"start":{"line":801,"column":13},"end":{"line":801,"column":24}},"loc":{"start":{"line":801,"column":28},"end":{"line":806,"column":5}},"line":801},"41":{"name":"(anonymous_41)","decl":{"start":{"line":819,"column":2},"end":{"line":819,"column":3}},"loc":{"start":{"line":819,"column":17},"end":{"line":830,"column":3}},"line":819},"42":{"name":"(anonymous_42)","decl":{"start":{"line":832,"column":2},"end":{"line":832,"column":3}},"loc":{"start":{"line":832,"column":16},"end":{"line":856,"column":3}},"line":832},"43":{"name":"(anonymous_43)","decl":{"start":{"line":858,"column":2},"end":{"line":858,"column":3}},"loc":{"start":{"line":858,"column":20},"end":{"line":865,"column":3}},"line":858},"44":{"name":"(anonymous_44)","decl":{"start":{"line":867,"column":2},"end":{"line":867,"column":3}},"loc":{"start":{"line":867,"column":26},"end":{"line":871,"column":3}},"line":867},"45":{"name":"(anonymous_45)","decl":{"start":{"line":873,"column":2},"end":{"line":873,"column":3}},"loc":{"start":{"line":873,"column":27},"end":{"line":876,"column":3}},"line":873},"46":{"name":"(anonymous_46)","decl":{"start":{"line":878,"column":2},"end":{"line":878,"column":3}},"loc":{"start":{"line":878,"column":28},"end":{"line":882,"column":3}},"line":878},"47":{"name":"(anonymous_47)","decl":{"start":{"line":884,"column":2},"end":{"line":884,"column":3}},"loc":{"start":{"line":884,"column":23},"end":{"line":887,"column":3}},"line":884}},"branchMap":{"0":{"loc":{"start":{"line":62,"column":15},"end":{"line":62,"column":28}},"type":"default-arg","locations":[{"start":{"line":62,"column":26},"end":{"line":62,"column":28}}],"line":62},"1":{"loc":{"start":{"line":145,"column":4},"end":{"line":147,"column":5}},"type":"if","locations":[{"start":{"line":145,"column":4},"end":{"line":147,"column":5}},{"start":{"line":145,"column":4},"end":{"line":147,"column":5}}],"line":145},"2":{"loc":{"start":{"line":149,"column":4},"end":{"line":164,"column":5}},"type":"if","locations":[{"start":{"line":149,"column":4},"end":{"line":164,"column":5}},{"start":{"line":149,"column":4},"end":{"line":164,"column":5}}],"line":149},"3":{"loc":{"start":{"line":149,"column":8},"end":{"line":149,"column":51}},"type":"binary-expr","locations":[{"start":{"line":149,"column":8},"end":{"line":149,"column":24}},{"start":{"line":149,"column":28},"end":{"line":149,"column":51}}],"line":149},"4":{"loc":{"start":{"line":176,"column":4},"end":{"line":176,"column":98}},"type":"if","locations":[{"start":{"line":176,"column":4},"end":{"line":176,"column":98}},{"start":{"line":176,"column":4},"end":{"line":176,"column":98}}],"line":176},"5":{"loc":{"start":{"line":188,"column":4},"end":{"line":188,"column":98}},"type":"if","locations":[{"start":{"line":188,"column":4},"end":{"line":188,"column":98}},{"start":{"line":188,"column":4},"end":{"line":188,"column":98}}],"line":188},"6":{"loc":{"start":{"line":189,"column":4},"end":{"line":189,"column":90}},"type":"if","locations":[{"start":{"line":189,"column":4},"end":{"line":189,"column":90}},{"start":{"line":189,"column":4},"end":{"line":189,"column":90}}],"line":189},"7":{"loc":{"start":{"line":206,"column":6},"end":{"line":222,"column":7}},"type":"switch","locations":[{"start":{"line":207,"column":8},"end":{"line":215,"column":16}},{"start":{"line":216,"column":8},"end":{"line":218,"column":16}},{"start":{"line":219,"column":8},"end":{"line":221,"column":16}}],"line":206},"8":{"loc":{"start":{"line":288,"column":4},"end":{"line":288,"column":75}},"type":"if","locations":[{"start":{"line":288,"column":4},"end":{"line":288,"column":75}},{"start":{"line":288,"column":4},"end":{"line":288,"column":75}}],"line":288},"9":{"loc":{"start":{"line":289,"column":4},"end":{"line":289,"column":75}},"type":"if","locations":[{"start":{"line":289,"column":4},"end":{"line":289,"column":75}},{"start":{"line":289,"column":4},"end":{"line":289,"column":75}}],"line":289},"10":{"loc":{"start":{"line":290,"column":4},"end":{"line":290,"column":104}},"type":"if","locations":[{"start":{"line":290,"column":4},"end":{"line":290,"column":104}},{"start":{"line":290,"column":4},"end":{"line":290,"column":104}}],"line":290},"11":{"loc":{"start":{"line":345,"column":6},"end":{"line":350,"column":7}},"type":"if","locations":[{"start":{"line":345,"column":6},"end":{"line":350,"column":7}},{"start":{"line":345,"column":6},"end":{"line":350,"column":7}}],"line":345},"12":{"loc":{"start":{"line":345,"column":10},"end":{"line":345,"column":30}},"type":"binary-expr","locations":[{"start":{"line":345,"column":10},"end":{"line":345,"column":18}},{"start":{"line":345,"column":22},"end":{"line":345,"column":30}}],"line":345},"13":{"loc":{"start":{"line":359,"column":6},"end":{"line":373,"column":7}},"type":"if","locations":[{"start":{"line":359,"column":6},"end":{"line":373,"column":7}},{"start":{"line":359,"column":6},"end":{"line":373,"column":7}}],"line":359},"14":{"loc":{"start":{"line":362,"column":10},"end":{"line":364,"column":11}},"type":"if","locations":[{"start":{"line":362,"column":10},"end":{"line":364,"column":11}},{"start":{"line":362,"column":10},"end":{"line":364,"column":11}}],"line":362},"15":{"loc":{"start":{"line":367,"column":17},"end":{"line":367,"column":49}},"type":"binary-expr","locations":[{"start":{"line":367,"column":17},"end":{"line":367,"column":33}},{"start":{"line":367,"column":37},"end":{"line":367,"column":49}}],"line":367},"16":{"loc":{"start":{"line":380,"column":6},"end":{"line":431,"column":7}},"type":"switch","locations":[{"start":{"line":381,"column":8},"end":{"line":383,"column":16}},{"start":{"line":384,"column":8},"end":{"line":387,"column":24}},{"start":{"line":388,"column":8},"end":{"line":391,"column":16}},{"start":{"line":392,"column":8},"end":{"line":395,"column":16}},{"start":{"line":396,"column":8},"end":{"line":400,"column":46}},{"start":{"line":401,"column":8},"end":{"line":420,"column":16}},{"start":{"line":421,"column":8},"end":{"line":424,"column":16}},{"start":{"line":425,"column":8},"end":{"line":430,"column":16}}],"line":380},"17":{"loc":{"start":{"line":413,"column":10},"end":{"line":418,"column":11}},"type":"if","locations":[{"start":{"line":413,"column":10},"end":{"line":418,"column":11}},{"start":{"line":413,"column":10},"end":{"line":418,"column":11}}],"line":413},"18":{"loc":{"start":{"line":414,"column":32},"end":{"line":417,"column":13}},"type":"binary-expr","locations":[{"start":{"line":414,"column":32},"end":{"line":414,"column":40}},{"start":{"line":414,"column":44},"end":{"line":417,"column":13}}],"line":414},"19":{"loc":{"start":{"line":464,"column":4},"end":{"line":476,"column":5}},"type":"if","locations":[{"start":{"line":464,"column":4},"end":{"line":476,"column":5}},{"start":{"line":464,"column":4},"end":{"line":476,"column":5}}],"line":464},"20":{"loc":{"start":{"line":484,"column":4},"end":{"line":484,"column":52}},"type":"if","locations":[{"start":{"line":484,"column":4},"end":{"line":484,"column":52}},{"start":{"line":484,"column":4},"end":{"line":484,"column":52}}],"line":484},"21":{"loc":{"start":{"line":513,"column":4},"end":{"line":517,"column":5}},"type":"if","locations":[{"start":{"line":513,"column":4},"end":{"line":517,"column":5}},{"start":{"line":513,"column":4},"end":{"line":517,"column":5}}],"line":513},"22":{"loc":{"start":{"line":554,"column":4},"end":{"line":554,"column":47}},"type":"if","locations":[{"start":{"line":554,"column":4},"end":{"line":554,"column":47}},{"start":{"line":554,"column":4},"end":{"line":554,"column":47}}],"line":554},"23":{"loc":{"start":{"line":588,"column":4},"end":{"line":588,"column":119}},"type":"if","locations":[{"start":{"line":588,"column":4},"end":{"line":588,"column":119}},{"start":{"line":588,"column":4},"end":{"line":588,"column":119}}],"line":588},"24":{"loc":{"start":{"line":598,"column":6},"end":{"line":602,"column":7}},"type":"if","locations":[{"start":{"line":598,"column":6},"end":{"line":602,"column":7}},{"start":{"line":598,"column":6},"end":{"line":602,"column":7}}],"line":598},"25":{"loc":{"start":{"line":605,"column":4},"end":{"line":660,"column":5}},"type":"switch","locations":[{"start":{"line":607,"column":6},"end":{"line":608,"column":22}},{"start":{"line":609,"column":6},"end":{"line":612,"column":14}},{"start":{"line":613,"column":6},"end":{"line":629,"column":14}},{"start":{"line":630,"column":6},"end":{"line":632,"column":14}},{"start":{"line":633,"column":6},"end":{"line":647,"column":39}},{"start":{"line":648,"column":6},"end":{"line":651,"column":14}},{"start":{"line":652,"column":6},"end":{"line":654,"column":35}},{"start":{"line":655,"column":6},"end":{"line":659,"column":11}}],"line":605},"26":{"loc":{"start":{"line":611,"column":8},"end":{"line":611,"column":52}},"type":"if","locations":[{"start":{"line":611,"column":8},"end":{"line":611,"column":52}},{"start":{"line":611,"column":8},"end":{"line":611,"column":52}}],"line":611},"27":{"loc":{"start":{"line":614,"column":8},"end":{"line":620,"column":9}},"type":"if","locations":[{"start":{"line":614,"column":8},"end":{"line":620,"column":9}},{"start":{"line":614,"column":8},"end":{"line":620,"column":9}}],"line":614},"28":{"loc":{"start":{"line":634,"column":8},"end":{"line":636,"column":9}},"type":"if","locations":[{"start":{"line":634,"column":8},"end":{"line":636,"column":9}},{"start":{"line":634,"column":8},"end":{"line":636,"column":9}}],"line":634},"29":{"loc":{"start":{"line":638,"column":8},"end":{"line":638,"column":50}},"type":"if","locations":[{"start":{"line":638,"column":8},"end":{"line":638,"column":50}},{"start":{"line":638,"column":8},"end":{"line":638,"column":50}}],"line":638},"30":{"loc":{"start":{"line":663,"column":4},"end":{"line":672,"column":5}},"type":"if","locations":[{"start":{"line":663,"column":4},"end":{"line":672,"column":5}},{"start":{"line":663,"column":4},"end":{"line":672,"column":5}}],"line":663},"31":{"loc":{"start":{"line":692,"column":4},"end":{"line":692,"column":82}},"type":"if","locations":[{"start":{"line":692,"column":4},"end":{"line":692,"column":82}},{"start":{"line":692,"column":4},"end":{"line":692,"column":82}}],"line":692},"32":{"loc":{"start":{"line":696,"column":4},"end":{"line":698,"column":5}},"type":"if","locations":[{"start":{"line":696,"column":4},"end":{"line":698,"column":5}},{"start":{"line":696,"column":4},"end":{"line":698,"column":5}}],"line":696},"33":{"loc":{"start":{"line":696,"column":8},"end":{"line":696,"column":84}},"type":"binary-expr","locations":[{"start":{"line":696,"column":8},"end":{"line":696,"column":34}},{"start":{"line":696,"column":38},"end":{"line":696,"column":84}}],"line":696},"34":{"loc":{"start":{"line":703,"column":6},"end":{"line":703,"column":96}},"type":"if","locations":[{"start":{"line":703,"column":6},"end":{"line":703,"column":96}},{"start":{"line":703,"column":6},"end":{"line":703,"column":96}}],"line":703},"35":{"loc":{"start":{"line":718,"column":4},"end":{"line":718,"column":70}},"type":"if","locations":[{"start":{"line":718,"column":4},"end":{"line":718,"column":70}},{"start":{"line":718,"column":4},"end":{"line":718,"column":70}}],"line":718},"36":{"loc":{"start":{"line":734,"column":6},"end":{"line":742,"column":7}},"type":"switch","locations":[{"start":{"line":735,"column":8},"end":{"line":735,"column":19}},{"start":{"line":736,"column":8},"end":{"line":736,"column":19}},{"start":{"line":737,"column":8},"end":{"line":737,"column":20}},{"start":{"line":738,"column":8},"end":{"line":738,"column":21}},{"start":{"line":739,"column":8},"end":{"line":741,"column":16}}],"line":734},"37":{"loc":{"start":{"line":767,"column":4},"end":{"line":771,"column":5}},"type":"if","locations":[{"start":{"line":767,"column":4},"end":{"line":771,"column":5}},{"start":{"line":767,"column":4},"end":{"line":771,"column":5}}],"line":767},"38":{"loc":{"start":{"line":785,"column":4},"end":{"line":791,"column":5}},"type":"if","locations":[{"start":{"line":785,"column":4},"end":{"line":791,"column":5}},{"start":{"line":785,"column":4},"end":{"line":791,"column":5}}],"line":785},"39":{"loc":{"start":{"line":793,"column":4},"end":{"line":799,"column":5}},"type":"if","locations":[{"start":{"line":793,"column":4},"end":{"line":799,"column":5}},{"start":{"line":793,"column":4},"end":{"line":799,"column":5}}],"line":793},"40":{"loc":{"start":{"line":814,"column":4},"end":{"line":814,"column":79}},"type":"if","locations":[{"start":{"line":814,"column":4},"end":{"line":814,"column":79}},{"start":{"line":814,"column":4},"end":{"line":814,"column":79}}],"line":814},"41":{"loc":{"start":{"line":833,"column":4},"end":{"line":833,"column":82}},"type":"if","locations":[{"start":{"line":833,"column":4},"end":{"line":833,"column":82}},{"start":{"line":833,"column":4},"end":{"line":833,"column":82}}],"line":833},"42":{"loc":{"start":{"line":843,"column":4},"end":{"line":849,"column":5}},"type":"if","locations":[{"start":{"line":843,"column":4},"end":{"line":849,"column":5}},{"start":{"line":843,"column":4},"end":{"line":849,"column":5}}],"line":843},"43":{"loc":{"start":{"line":854,"column":4},"end":{"line":854,"column":79}},"type":"if","locations":[{"start":{"line":854,"column":4},"end":{"line":854,"column":79}},{"start":{"line":854,"column":4},"end":{"line":854,"column":79}}],"line":854},"44":{"loc":{"start":{"line":859,"column":4},"end":{"line":859,"column":50}},"type":"if","locations":[{"start":{"line":859,"column":4},"end":{"line":859,"column":50}},{"start":{"line":859,"column":4},"end":{"line":859,"column":50}}],"line":859},"45":{"loc":{"start":{"line":859,"column":8},"end":{"line":859,"column":36}},"type":"binary-expr","locations":[{"start":{"line":859,"column":8},"end":{"line":859,"column":17}},{"start":{"line":859,"column":21},"end":{"line":859,"column":36}}],"line":859},"46":{"loc":{"start":{"line":860,"column":4},"end":{"line":860,"column":92}},"type":"if","locations":[{"start":{"line":860,"column":4},"end":{"line":860,"column":92}},{"start":{"line":860,"column":4},"end":{"line":860,"column":92}}],"line":860},"47":{"loc":{"start":{"line":862,"column":4},"end":{"line":862,"column":89}},"type":"if","locations":[{"start":{"line":862,"column":4},"end":{"line":862,"column":89}},{"start":{"line":862,"column":4},"end":{"line":862,"column":89}}],"line":862},"48":{"loc":{"start":{"line":863,"column":4},"end":{"line":863,"column":64}},"type":"if","locations":[{"start":{"line":863,"column":4},"end":{"line":863,"column":64}},{"start":{"line":863,"column":4},"end":{"line":863,"column":64}}],"line":863},"49":{"loc":{"start":{"line":863,"column":8},"end":{"line":863,"column":50}},"type":"binary-expr","locations":[{"start":{"line":863,"column":8},"end":{"line":863,"column":15}},{"start":{"line":863,"column":19},"end":{"line":863,"column":50}}],"line":863},"50":{"loc":{"start":{"line":868,"column":4},"end":{"line":868,"column":50}},"type":"if","locations":[{"start":{"line":868,"column":4},"end":{"line":868,"column":50}},{"start":{"line":868,"column":4},"end":{"line":868,"column":50}}],"line":868},"51":{"loc":{"start":{"line":868,"column":8},"end":{"line":868,"column":36}},"type":"binary-expr","locations":[{"start":{"line":868,"column":8},"end":{"line":868,"column":17}},{"start":{"line":868,"column":21},"end":{"line":868,"column":36}}],"line":868},"52":{"loc":{"start":{"line":869,"column":4},"end":{"line":869,"column":98}},"type":"if","locations":[{"start":{"line":869,"column":4},"end":{"line":869,"column":98}},{"start":{"line":869,"column":4},"end":{"line":869,"column":98}}],"line":869},"53":{"loc":{"start":{"line":874,"column":4},"end":{"line":874,"column":101}},"type":"if","locations":[{"start":{"line":874,"column":4},"end":{"line":874,"column":101}},{"start":{"line":874,"column":4},"end":{"line":874,"column":101}}],"line":874},"54":{"loc":{"start":{"line":879,"column":4},"end":{"line":879,"column":50}},"type":"if","locations":[{"start":{"line":879,"column":4},"end":{"line":879,"column":50}},{"start":{"line":879,"column":4},"end":{"line":879,"column":50}}],"line":879},"55":{"loc":{"start":{"line":879,"column":8},"end":{"line":879,"column":36}},"type":"binary-expr","locations":[{"start":{"line":879,"column":8},"end":{"line":879,"column":17}},{"start":{"line":879,"column":21},"end":{"line":879,"column":36}}],"line":879},"56":{"loc":{"start":{"line":880,"column":4},"end":{"line":880,"column":100}},"type":"if","locations":[{"start":{"line":880,"column":4},"end":{"line":880,"column":100}},{"start":{"line":880,"column":4},"end":{"line":880,"column":100}}],"line":880},"57":{"loc":{"start":{"line":885,"column":4},"end":{"line":885,"column":95}},"type":"if","locations":[{"start":{"line":885,"column":4},"end":{"line":885,"column":95}},{"start":{"line":885,"column":4},"end":{"line":885,"column":95}}],"line":885}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":4,"21":4,"22":4,"23":4,"24":4,"25":4,"26":4,"27":4,"28":4,"29":4,"30":4,"31":4,"32":4,"33":4,"34":4,"35":4,"36":4,"37":0,"38":6,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":1,"211":1,"212":1,"213":1,"214":1,"215":1,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":2,"275":0,"276":2,"277":2,"278":2,"279":0,"280":2,"281":2,"282":2,"283":2,"284":0,"285":2,"286":2,"287":2,"288":2,"289":2,"290":2,"291":0,"292":2,"293":2,"294":2,"295":2,"296":2,"297":2,"298":0,"299":0,"300":0,"301":0,"302":2,"303":2,"304":2,"305":2,"306":2,"307":2,"308":2,"309":2,"310":2,"311":2,"312":0,"313":0,"314":0,"315":2,"316":2,"317":0,"318":2,"319":0,"320":2,"321":0,"322":0,"323":0,"324":2,"325":2,"326":2,"327":0,"328":0,"329":2,"330":2,"331":2,"332":0,"333":2,"334":0,"335":0,"336":0,"337":0,"338":2,"339":0,"340":2,"341":2,"342":2,"343":2,"344":0,"345":2,"346":0,"347":0,"348":0,"349":2,"350":2,"351":2,"352":0,"353":2,"354":0,"355":0,"356":0,"357":0,"358":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"367":0,"368":0,"369":0,"370":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":1},"f":{"0":4,"1":0,"2":6,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":1,"28":1,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":2,"38":0,"39":0,"40":2,"41":0,"42":2,"43":0,"44":0,"45":0,"46":0,"47":0},"b":{"0":[0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0,0,0,0,0,0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0,0,0,0,0,0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,2],"32":[0,2],"33":[2,2],"34":[0,2],"35":[0,2],"36":[0,0,0,0,0],"37":[0,2],"38":[0,2],"39":[2,0],"40":[0,2],"41":[0,2],"42":[0,2],"43":[0,2],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"99abf197b37cc8f2d6357442eda2d59a9f60c08b","contentHash":"6f0c5d787be101042fc060d7461d605c3c0ed256b7cbfff74c322e17ee368ac0"},"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/constants.js":{"path":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/constants.js","statementMap":{"0":{"start":{"line":5,"column":4},"end":{"line":5,"column":37}},"1":{"start":{"line":8,"column":22},"end":{"line":8,"column":26}},"2":{"start":{"line":9,"column":21},"end":{"line":9,"column":87}},"3":{"start":{"line":12,"column":25},"end":{"line":12,"column":27}},"4":{"start":{"line":13,"column":25},"end":{"line":13,"column":29}},"5":{"start":{"line":16,"column":26},"end":{"line":16,"column":29}},"6":{"start":{"line":17,"column":26},"end":{"line":17,"column":31}},"7":{"start":{"line":20,"column":21},"end":{"line":20,"column":26}},"8":{"start":{"line":21,"column":28},"end":{"line":21,"column":34}},"9":{"start":{"line":24,"column":23},"end":{"line":24,"column":41}},"10":{"start":{"line":27,"column":0},"end":{"line":38,"column":2}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1},"f":{},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"95e80fbfec2439813f7a60dbd195ee991b685508","contentHash":"ca7d810133505485f29e45d4555f6f125a946e86c1439e4e984569ba3e2618d8"},"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/router.js":{"path":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/router.js","statementMap":{"0":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}},"1":{"start":{"line":4,"column":48},"end":{"line":4,"column":73}},"2":{"start":{"line":6,"column":15},"end":{"line":6,"column":51}},"3":{"start":{"line":7,"column":16},"end":{"line":7,"column":53}},"4":{"start":{"line":20,"column":4},"end":{"line":20,"column":20}},"5":{"start":{"line":22,"column":14},"end":{"line":25,"column":5}},"6":{"start":{"line":27,"column":4},"end":{"line":27,"column":24}},"7":{"start":{"line":28,"column":4},"end":{"line":28,"column":53}},"8":{"start":{"line":29,"column":4},"end":{"line":29,"column":25}},"9":{"start":{"line":30,"column":4},"end":{"line":30,"column":24}},"10":{"start":{"line":31,"column":4},"end":{"line":31,"column":21}},"11":{"start":{"line":32,"column":4},"end":{"line":32,"column":21}},"12":{"start":{"line":34,"column":4},"end":{"line":34,"column":16}},"13":{"start":{"line":38,"column":17},"end":{"line":38,"column":47}},"14":{"start":{"line":40,"column":4},"end":{"line":47,"column":5}},"15":{"start":{"line":41,"column":6},"end":{"line":43,"column":7}},"16":{"start":{"line":42,"column":8},"end":{"line":42,"column":66}},"17":{"start":{"line":44,"column":6},"end":{"line":46,"column":7}},"18":{"start":{"line":45,"column":8},"end":{"line":45,"column":66}},"19":{"start":{"line":49,"column":4},"end":{"line":49,"column":18}},"20":{"start":{"line":53,"column":4},"end":{"line":53,"column":84}},"21":{"start":{"line":54,"column":16},"end":{"line":54,"column":32}},"22":{"start":{"line":55,"column":4},"end":{"line":55,"column":37}},"23":{"start":{"line":56,"column":4},"end":{"line":56,"column":23}},"24":{"start":{"line":57,"column":4},"end":{"line":60,"column":7}},"25":{"start":{"line":64,"column":4},"end":{"line":67,"column":6}},"26":{"start":{"line":69,"column":4},"end":{"line":69,"column":35}},"27":{"start":{"line":73,"column":4},"end":{"line":82,"column":5}},"28":{"start":{"line":74,"column":18},"end":{"line":74,"column":35}},"29":{"start":{"line":75,"column":18},"end":{"line":75,"column":40}},"30":{"start":{"line":76,"column":6},"end":{"line":81,"column":7}},"31":{"start":{"line":77,"column":8},"end":{"line":80,"column":10}},"32":{"start":{"line":83,"column":4},"end":{"line":83,"column":16}},"33":{"start":{"line":93,"column":4},"end":{"line":93,"column":35}},"34":{"start":{"line":97,"column":4},"end":{"line":97,"column":44}},"35":{"start":{"line":98,"column":4},"end":{"line":98,"column":32}},"36":{"start":{"line":102,"column":4},"end":{"line":102,"column":36}},"37":{"start":{"line":106,"column":4},"end":{"line":106,"column":94}},"38":{"start":{"line":106,"column":38},"end":{"line":106,"column":94}},"39":{"start":{"line":107,"column":4},"end":{"line":107,"column":29}},"40":{"start":{"line":109,"column":4},"end":{"line":116,"column":5}},"41":{"start":{"line":110,"column":18},"end":{"line":110,"column":52}},"42":{"start":{"line":118,"column":4},"end":{"line":118,"column":28}},"43":{"start":{"line":119,"column":4},"end":{"line":119,"column":103}},"44":{"start":{"line":119,"column":38},"end":{"line":119,"column":103}},"45":{"start":{"line":120,"column":4},"end":{"line":120,"column":16}},"46":{"start":{"line":124,"column":4},"end":{"line":124,"column":94}},"47":{"start":{"line":124,"column":38},"end":{"line":124,"column":94}},"48":{"start":{"line":125,"column":4},"end":{"line":125,"column":29}},"49":{"start":{"line":126,"column":4},"end":{"line":126,"column":28}},"50":{"start":{"line":127,"column":4},"end":{"line":127,"column":16}},"51":{"start":{"line":131,"column":0},"end":{"line":131,"column":24}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":19,"column":2},"end":{"line":19,"column":3}},"loc":{"start":{"line":19,"column":30},"end":{"line":35,"column":3}},"line":19},"1":{"name":"(anonymous_1)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":3}},"loc":{"start":{"line":37,"column":28},"end":{"line":50,"column":3}},"line":37},"2":{"name":"(anonymous_2)","decl":{"start":{"line":52,"column":2},"end":{"line":52,"column":3}},"loc":{"start":{"line":52,"column":14},"end":{"line":61,"column":3}},"line":52},"3":{"name":"(anonymous_3)","decl":{"start":{"line":63,"column":2},"end":{"line":63,"column":3}},"loc":{"start":{"line":63,"column":31},"end":{"line":70,"column":3}},"line":63},"4":{"name":"(anonymous_4)","decl":{"start":{"line":72,"column":2},"end":{"line":72,"column":3}},"loc":{"start":{"line":72,"column":16},"end":{"line":84,"column":3}},"line":72},"5":{"name":"(anonymous_5)","decl":{"start":{"line":92,"column":2},"end":{"line":92,"column":3}},"loc":{"start":{"line":92,"column":36},"end":{"line":94,"column":3}},"line":92},"6":{"name":"(anonymous_6)","decl":{"start":{"line":96,"column":2},"end":{"line":96,"column":3}},"loc":{"start":{"line":96,"column":31},"end":{"line":99,"column":3}},"line":96},"7":{"name":"(anonymous_7)","decl":{"start":{"line":101,"column":2},"end":{"line":101,"column":3}},"loc":{"start":{"line":101,"column":39},"end":{"line":103,"column":3}},"line":101},"8":{"name":"(anonymous_8)","decl":{"start":{"line":105,"column":2},"end":{"line":105,"column":3}},"loc":{"start":{"line":105,"column":17},"end":{"line":121,"column":3}},"line":105},"9":{"name":"(anonymous_9)","decl":{"start":{"line":123,"column":2},"end":{"line":123,"column":3}},"loc":{"start":{"line":123,"column":16},"end":{"line":128,"column":3}},"line":123}},"branchMap":{"0":{"loc":{"start":{"line":19,"column":15},"end":{"line":19,"column":28}},"type":"default-arg","locations":[{"start":{"line":19,"column":26},"end":{"line":19,"column":28}}],"line":19},"1":{"loc":{"start":{"line":40,"column":4},"end":{"line":47,"column":5}},"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":47,"column":5}},{"start":{"line":40,"column":4},"end":{"line":47,"column":5}}],"line":40},"2":{"loc":{"start":{"line":41,"column":6},"end":{"line":43,"column":7}},"type":"if","locations":[{"start":{"line":41,"column":6},"end":{"line":43,"column":7}},{"start":{"line":41,"column":6},"end":{"line":43,"column":7}}],"line":41},"3":{"loc":{"start":{"line":44,"column":6},"end":{"line":46,"column":7}},"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":46,"column":7}},{"start":{"line":44,"column":6},"end":{"line":46,"column":7}}],"line":44},"4":{"loc":{"start":{"line":76,"column":6},"end":{"line":81,"column":7}},"type":"if","locations":[{"start":{"line":76,"column":6},"end":{"line":81,"column":7}},{"start":{"line":76,"column":6},"end":{"line":81,"column":7}}],"line":76},"5":{"loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":94}},"type":"if","locations":[{"start":{"line":106,"column":4},"end":{"line":106,"column":94}},{"start":{"line":106,"column":4},"end":{"line":106,"column":94}}],"line":106},"6":{"loc":{"start":{"line":119,"column":4},"end":{"line":119,"column":103}},"type":"if","locations":[{"start":{"line":119,"column":4},"end":{"line":119,"column":103}},{"start":{"line":119,"column":4},"end":{"line":119,"column":103}}],"line":119},"7":{"loc":{"start":{"line":124,"column":4},"end":{"line":124,"column":94}},"type":"if","locations":[{"start":{"line":124,"column":4},"end":{"line":124,"column":94}},{"start":{"line":124,"column":4},"end":{"line":124,"column":94}}],"line":124}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":1,"38":0,"39":1,"40":1,"41":0,"42":1,"43":1,"44":0,"45":1,"46":1,"47":0,"48":1,"49":1,"50":1,"51":1},"f":{"0":1,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":1,"9":1},"b":{"0":[1],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,1],"6":[0,1],"7":[0,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c8f5c313ed2cb21770ccdffdf3682ba639d162fd","contentHash":"bb2c87ca084f2b830b38bef811cd62dd16fb4f57507b66c2c9ebcd5dee552e3d"}} \ No newline at end of file diff --git a/reports/nyc/fde8e075-7556-4760-813b-223f5900ac05.json b/reports/nyc/fde8e075-7556-4760-813b-223f5900ac05.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/reports/nyc/fde8e075-7556-4760-813b-223f5900ac05.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/reports/nyc/processinfo/8823c08b-f48c-4c6a-825f-f29cedd362f9.json b/reports/nyc/processinfo/8823c08b-f48c-4c6a-825f-f29cedd362f9.json new file mode 100644 index 00000000..97b30d6c --- /dev/null +++ b/reports/nyc/processinfo/8823c08b-f48c-4c6a-825f-f29cedd362f9.json @@ -0,0 +1 @@ +{"parent":"fde8e075-7556-4760-813b-223f5900ac05","pid":78840,"argv":["/Users/dev/.nvm/versions/node/v16.15.0/bin/node","/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/node_modules/.bin/mocha","tests"],"execArgv":[],"cwd":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http","time":1657643436019,"ppid":78839,"coverageFilename":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/reports/nyc/8823c08b-f48c-4c6a-825f-f29cedd362f9.json","externalId":"","uuid":"8823c08b-f48c-4c6a-825f-f29cedd362f9","files":["/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/client.js","/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/remote.js","/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/server.js","/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/constants.js","/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/router.js"]} \ No newline at end of file diff --git a/reports/nyc/processinfo/fde8e075-7556-4760-813b-223f5900ac05.json b/reports/nyc/processinfo/fde8e075-7556-4760-813b-223f5900ac05.json new file mode 100644 index 00000000..a8978bb4 --- /dev/null +++ b/reports/nyc/processinfo/fde8e075-7556-4760-813b-223f5900ac05.json @@ -0,0 +1 @@ +{"parent":null,"pid":78839,"argv":["/Users/dev/.nvm/versions/node/v16.15.0/bin/node","/Users/dev/.nvm/versions/node/v16.15.0/bin/npm","run","test"],"execArgv":[],"cwd":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http","time":1657643435799,"ppid":78838,"coverageFilename":"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/reports/nyc/fde8e075-7556-4760-813b-223f5900ac05.json","externalId":"","uuid":"fde8e075-7556-4760-813b-223f5900ac05","files":[]} \ No newline at end of file diff --git a/reports/nyc/processinfo/index.json b/reports/nyc/processinfo/index.json new file mode 100644 index 00000000..428bf986 --- /dev/null +++ b/reports/nyc/processinfo/index.json @@ -0,0 +1 @@ +{"processes":{"8823c08b-f48c-4c6a-825f-f29cedd362f9":{"parent":"fde8e075-7556-4760-813b-223f5900ac05","children":[]},"fde8e075-7556-4760-813b-223f5900ac05":{"parent":null,"children":["8823c08b-f48c-4c6a-825f-f29cedd362f9"]}},"files":{"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/client.js":["8823c08b-f48c-4c6a-825f-f29cedd362f9"],"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/remote.js":["8823c08b-f48c-4c6a-825f-f29cedd362f9"],"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/server.js":["8823c08b-f48c-4c6a-825f-f29cedd362f9"],"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/constants.js":["8823c08b-f48c-4c6a-825f-f29cedd362f9"],"/Users/dev/Documents/code/src/github.com/victorwu/_FabricLabs/fabric-http/types/router.js":["8823c08b-f48c-4c6a-825f-f29cedd362f9"]},"externalIds":{}} \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index 0b98b6a8..83c30797 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,8 @@ import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; +import nodeGlobals from 'rollup-plugin-node-globals'; +import nodePolyfills from 'rollup-plugin-polyfill-node'; export default [ { @@ -13,8 +15,12 @@ export default [ } ], plugins: [ + nodeGlobals(), + nodePolyfills(), + commonjs({ + include: /node_modules/, + transformMixedEsModules:true}), resolve(), - commonjs() ] }, { @@ -32,8 +38,14 @@ export default [ ], plugins: [ json(), - resolve(), - commonjs() + nodeGlobals(), + nodePolyfills(), + commonjs({ + include: /node_modules/, + transformMixedEsModules: true}), + resolve({ + browser: true + }) ], external: [] } diff --git a/tsconfig.json b/tsconfig.json index 56d5c147..2a8a241f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { // Default - "target": "es5", + "target": "es6", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, @@ -9,7 +9,7 @@ // Added "jsx": "react", - "module": "ESNext", + "module": "commonjs", "declaration": true, "declarationDir": "types", "sourceMap": true,